[
  {
    "path": ".editorconfig",
    "content": "[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 2\nindent_style = space\ninsert_final_newline = false\nmax_line_length = 100\ntab_width = 2\nij_continuation_indent_size = 4\nij_formatter_off_tag = @formatter:off\nij_formatter_on_tag = @formatter:on\nij_formatter_tags_enabled = false\nij_smart_tabs = false\nij_wrap_on_typing = false\n\n[*.java]\nij_java_align_consecutive_assignments = false\nij_java_align_consecutive_variable_declarations = false\nij_java_align_group_field_declarations = false\nij_java_align_multiline_annotation_parameters = false\nij_java_align_multiline_array_initializer_expression = false\nij_java_align_multiline_assignment = false\nij_java_align_multiline_binary_operation = false\nij_java_align_multiline_chained_methods = false\nij_java_align_multiline_extends_list = false\nij_java_align_multiline_for = false\nij_java_align_multiline_method_parentheses = false\nij_java_align_multiline_parameters = false\nij_java_align_multiline_parameters_in_calls = false\nij_java_align_multiline_parenthesized_expression = false\nij_java_align_multiline_resources = false\nij_java_align_multiline_ternary_operation = false\nij_java_align_multiline_throws_list = false\nij_java_align_subsequent_simple_methods = false\nij_java_align_throws_keyword = false\nij_java_annotation_parameter_wrap = off\nij_java_array_initializer_new_line_after_left_brace = false\nij_java_array_initializer_right_brace_on_new_line = false\nij_java_array_initializer_wrap = normal\nij_java_assert_statement_colon_on_next_line = false\nij_java_assert_statement_wrap = off\nij_java_assignment_wrap = off\nij_java_binary_operation_sign_on_next_line = true\nij_java_binary_operation_wrap = normal\nij_java_blank_lines_after_anonymous_class_header = 0\nij_java_blank_lines_after_class_header = 1\nij_java_blank_lines_after_imports = 1\nij_java_blank_lines_after_package = 1\nij_java_blank_lines_around_class = 1\nij_java_blank_lines_around_field = 0\nij_java_blank_lines_around_field_in_interface = 0\nij_java_blank_lines_around_initializer = 1\nij_java_blank_lines_around_method = 1\nij_java_blank_lines_around_method_in_interface = 1\nij_java_blank_lines_before_class_end = 0\nij_java_blank_lines_before_imports = 1\nij_java_blank_lines_before_method_body = 0\nij_java_blank_lines_before_package = 0\nij_java_block_brace_style = end_of_line\nij_java_block_comment_at_first_column = true\nij_java_call_parameters_new_line_after_left_paren = false\nij_java_call_parameters_right_paren_on_new_line = false\nij_java_call_parameters_wrap = normal\nij_java_case_statement_on_separate_line = true\nij_java_catch_on_new_line = false\nij_java_class_annotation_wrap = split_into_lines\nij_java_class_brace_style = end_of_line\nij_java_class_count_to_use_import_on_demand = 999\nij_java_class_names_in_javadoc = 1\nij_java_do_not_indent_top_level_class_members = false\nij_java_do_not_wrap_after_single_annotation = false\nij_java_do_while_brace_force = always\nij_java_doc_add_blank_line_after_description = true\nij_java_doc_add_blank_line_after_param_comments = false\nij_java_doc_add_blank_line_after_return = false\nij_java_doc_add_p_tag_on_empty_lines = true\nij_java_doc_align_exception_comments = true\nij_java_doc_align_param_comments = true\nij_java_doc_do_not_wrap_if_one_line = false\nij_java_doc_enable_formatting = true\nij_java_doc_enable_leading_asterisks = true\nij_java_doc_indent_on_continuation = false\nij_java_doc_keep_empty_lines = true\nij_java_doc_keep_empty_parameter_tag = true\nij_java_doc_keep_empty_return_tag = true\nij_java_doc_keep_empty_throws_tag = true\nij_java_doc_keep_invalid_tags = true\nij_java_doc_param_description_on_new_line = false\nij_java_doc_preserve_line_breaks = false\nij_java_doc_use_throws_not_exception_tag = true\nij_java_else_on_new_line = false\nij_java_entity_dd_suffix = EJB\nij_java_entity_eb_suffix = Bean\nij_java_entity_hi_suffix = Home\nij_java_entity_lhi_prefix = Local\nij_java_entity_lhi_suffix = Home\nij_java_entity_li_prefix = Local\nij_java_entity_pk_class = java.lang.String\nij_java_entity_vo_suffix = VO\nij_java_enum_constants_wrap = off\nij_java_extends_keyword_wrap = off\nij_java_extends_list_wrap = normal\nij_java_field_annotation_wrap = split_into_lines\nij_java_finally_on_new_line = false\nij_java_for_brace_force = always\nij_java_for_statement_new_line_after_left_paren = false\nij_java_for_statement_right_paren_on_new_line = false\nij_java_for_statement_wrap = normal\nij_java_generate_final_locals = false\nij_java_generate_final_parameters = false\nij_java_if_brace_force = always\nij_java_imports_layout = $*,|,*\nij_java_indent_case_from_switch = true\nij_java_insert_inner_class_imports = true\nij_java_insert_override_annotation = true\nij_java_keep_blank_lines_before_right_brace = 2\nij_java_keep_blank_lines_between_package_declaration_and_header = 2\nij_java_keep_blank_lines_in_code = 1\nij_java_keep_blank_lines_in_declarations = 2\nij_java_keep_control_statement_in_one_line = false\nij_java_keep_first_column_comment = true\nij_java_keep_indents_on_empty_lines = false\nij_java_keep_line_breaks = true\nij_java_keep_multiple_expressions_in_one_line = false\nij_java_keep_simple_blocks_in_one_line = false\nij_java_keep_simple_classes_in_one_line = false\nij_java_keep_simple_lambdas_in_one_line = false\nij_java_keep_simple_methods_in_one_line = false\nij_java_lambda_brace_style = end_of_line\nij_java_layout_static_imports_separately = true\nij_java_line_comment_add_space = false\nij_java_line_comment_at_first_column = true\nij_java_message_dd_suffix = EJB\nij_java_message_eb_suffix = Bean\nij_java_method_annotation_wrap = split_into_lines\nij_java_method_brace_style = end_of_line\nij_java_method_call_chain_wrap = normal\nij_java_method_parameters_new_line_after_left_paren = false\nij_java_method_parameters_right_paren_on_new_line = false\nij_java_method_parameters_wrap = normal\nij_java_modifier_list_wrap = false\nij_java_names_count_to_use_import_on_demand = 999\nij_java_parameter_annotation_wrap = off\nij_java_parentheses_expression_new_line_after_left_paren = false\nij_java_parentheses_expression_right_paren_on_new_line = false\nij_java_place_assignment_sign_on_next_line = false\nij_java_prefer_longer_names = true\nij_java_prefer_parameters_wrap = false\nij_java_repeat_synchronized = true\nij_java_replace_instanceof_and_cast = false\nij_java_replace_null_check = true\nij_java_replace_sum_lambda_with_method_ref = true\nij_java_resource_list_new_line_after_left_paren = false\nij_java_resource_list_right_paren_on_new_line = false\nij_java_resource_list_wrap = off\nij_java_session_dd_suffix = EJB\nij_java_session_eb_suffix = Bean\nij_java_session_hi_suffix = Home\nij_java_session_lhi_prefix = Local\nij_java_session_lhi_suffix = Home\nij_java_session_li_prefix = Local\nij_java_session_si_suffix = Service\nij_java_space_after_closing_angle_bracket_in_type_argument = false\nij_java_space_after_colon = true\nij_java_space_after_comma = true\nij_java_space_after_comma_in_type_arguments = true\nij_java_space_after_for_semicolon = true\nij_java_space_after_quest = true\nij_java_space_after_type_cast = true\nij_java_space_before_annotation_array_initializer_left_brace = false\nij_java_space_before_annotation_parameter_list = false\nij_java_space_before_array_initializer_left_brace = false\nij_java_space_before_catch_keyword = true\nij_java_space_before_catch_left_brace = true\nij_java_space_before_catch_parentheses = true\nij_java_space_before_class_left_brace = true\nij_java_space_before_colon = true\nij_java_space_before_colon_in_foreach = true\nij_java_space_before_comma = false\nij_java_space_before_do_left_brace = true\nij_java_space_before_else_keyword = true\nij_java_space_before_else_left_brace = true\nij_java_space_before_finally_keyword = true\nij_java_space_before_finally_left_brace = true\nij_java_space_before_for_left_brace = true\nij_java_space_before_for_parentheses = true\nij_java_space_before_for_semicolon = false\nij_java_space_before_if_left_brace = true\nij_java_space_before_if_parentheses = true\nij_java_space_before_method_call_parentheses = false\nij_java_space_before_method_left_brace = true\nij_java_space_before_method_parentheses = false\nij_java_space_before_opening_angle_bracket_in_type_parameter = false\nij_java_space_before_quest = true\nij_java_space_before_switch_left_brace = true\nij_java_space_before_switch_parentheses = true\nij_java_space_before_synchronized_left_brace = true\nij_java_space_before_synchronized_parentheses = true\nij_java_space_before_try_left_brace = true\nij_java_space_before_try_parentheses = true\nij_java_space_before_type_parameter_list = false\nij_java_space_before_while_keyword = true\nij_java_space_before_while_left_brace = true\nij_java_space_before_while_parentheses = true\nij_java_space_inside_one_line_enum_braces = false\nij_java_space_within_empty_array_initializer_braces = false\nij_java_space_within_empty_method_call_parentheses = false\nij_java_space_within_empty_method_parentheses = false\nij_java_spaces_around_additive_operators = true\nij_java_spaces_around_assignment_operators = true\nij_java_spaces_around_bitwise_operators = true\nij_java_spaces_around_equality_operators = true\nij_java_spaces_around_lambda_arrow = true\nij_java_spaces_around_logical_operators = true\nij_java_spaces_around_method_ref_dbl_colon = false\nij_java_spaces_around_multiplicative_operators = true\nij_java_spaces_around_relational_operators = true\nij_java_spaces_around_shift_operators = true\nij_java_spaces_around_type_bounds_in_type_parameters = true\nij_java_spaces_around_unary_operator = false\nij_java_spaces_within_angle_brackets = false\nij_java_spaces_within_annotation_parentheses = false\nij_java_spaces_within_array_initializer_braces = false\nij_java_spaces_within_braces = false\nij_java_spaces_within_brackets = false\nij_java_spaces_within_cast_parentheses = false\nij_java_spaces_within_catch_parentheses = false\nij_java_spaces_within_for_parentheses = false\nij_java_spaces_within_if_parentheses = false\nij_java_spaces_within_method_call_parentheses = false\nij_java_spaces_within_method_parentheses = false\nij_java_spaces_within_parentheses = false\nij_java_spaces_within_switch_parentheses = false\nij_java_spaces_within_synchronized_parentheses = false\nij_java_spaces_within_try_parentheses = false\nij_java_spaces_within_while_parentheses = false\nij_java_special_else_if_treatment = true\nij_java_subclass_name_suffix = Impl\nij_java_ternary_operation_signs_on_next_line = true\nij_java_ternary_operation_wrap = normal\nij_java_test_name_suffix = Test\nij_java_throws_keyword_wrap = normal\nij_java_throws_list_wrap = off\nij_java_use_external_annotations = false\nij_java_use_fq_class_names = false\nij_java_use_single_class_imports = true\nij_java_variable_annotation_wrap = off\nij_java_visibility = public\nij_java_while_brace_force = always\nij_java_while_on_new_line = false\nij_java_wrap_comments = true\nij_java_wrap_first_method_in_call_chain = false\nij_java_wrap_long_lines = false\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "* @wiremock/wiremock-java-co-maintainers\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n- package-ecosystem: gradle\n  directory: \"/\"\n  schedule:\n    interval: daily\n    time: \"04:00\"\n  open-pull-requests-limit: 10\n\n- package-ecosystem: gradle\n  directory: \"/wiremock-url\"\n  schedule:\n    interval: daily\n    time: \"04:00\"\n  open-pull-requests-limit: 10\n  ignore:\n    - dependency-name: \"com.fasterxml.jackson.core:jackson-core\"\n    - dependency-name: \"com.fasterxml.jackson.core:jackson-databind\"\n"
  },
  {
    "path": ".github/release-drafter.yml",
    "content": "# Use https://github.com/wiremock/.github/blob/main/.github/release_drafter.yml\n_extends: .github\n"
  },
  {
    "path": ".github/workflows/build-and-test.yml",
    "content": "# This workflow will build a Java project with Gradle\n# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle\n\nname: Build and test\n\non:\n  push:\n    branches: [ master, v4.x ]\n  pull_request:\n    branches: [ master, v4.x ]\n  workflow_dispatch:\n\njobs:\n  core:\n    strategy:\n      fail-fast: false\n      matrix:\n        os: [ubuntu-latest, macos-latest, windows-latest]\n        jdk: [17]\n    runs-on: ${{ matrix.os }}\n    env:\n      JDK_VERSION:  ${{ matrix.jdk }}\n\n    steps:\n    - uses: actions/checkout@v4\n      with:\n        fetch-depth: 0\n    - name: Set up JDK\n      uses: actions/setup-java@v4\n      with:\n        java-version: ${{ matrix.jdk }}\n        distribution: 'temurin'\n    - name: Setup Gradle\n      uses: gradle/actions/setup-gradle@v4\n      with:\n        validate-wrappers: true\n    - name: Grant execute permission for gradlew\n      run: chmod +x gradlew\n    \n    - name: Cache SonarCloud packages\n      uses: actions/cache@v4\n      with:\n        path: ~/.sonar/cache\n        key: ${{ runner.os }}-sonar\n        restore-keys: ${{ runner.os }}-sonar\n\n    - name: Test WireMock with Sonarqube\n      if: ${{ matrix.os == 'ubuntu-latest' && matrix.jdk == 17 && github.event_name == 'push' }}\n      env:\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any\n        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n      run: ./gradlew :check :sonarqube --stacktrace --no-daemon\n\n    - name: Test WireMock\n      run: ./gradlew :check --stacktrace --no-daemon\n\n    - name: Archive WireMock reports - ${{ matrix.os }} JDK ${{ matrix.jdk }}\n      if: always()\n      uses: actions/upload-artifact@v4\n      with:\n        name: wiremock-core-test-report-${{ matrix.os }} JDK ${{ matrix.jdk }}\n        path: |\n          build/reports/tests/test\n          build/test-results/test\n          build/reports/dependency-analysis/build-health-report.txt\n"
  },
  {
    "path": ".github/workflows/changelog-draft-3-release.yml",
    "content": "name: Release Drafter 3.x\n\non:\n  push:\n    branches:\n      - 3.x\n  workflow_dispatch:\n\njobs:\n  update_release_draft:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: release-drafter/release-drafter@v5\n        with:\n          name: 3.x-next\n          tag: 3.x-next\n          version: 3.x-next\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/changelog-draft.yml",
    "content": "name: Release Drafter\n\non:\n  push:\n    branches:\n      - main\n      - master\n  workflow_dispatch:\n\njobs:\n  update_release_draft:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: release-drafter/release-drafter@v5\n        with:\n          name: next\n          tag: next\n          version: next\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/publish-snapshot.yml",
    "content": "name: Publish Snapshots\n\non:\n  workflow_dispatch:\n  push:\n    branches: [ master ]\n\njobs:\n  publish-core-snapshot:\n    runs-on: ubuntu-latest\n\n    permissions:\n      contents: read\n      packages: write\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: actions/setup-java@v4\n        with:\n          java-version: '17'\n          distribution: 'temurin'\n\n      - uses: gradle/actions/setup-gradle@v4\n        with:\n          validate-wrappers: true\n\n      - name: Set snapshot version\n        run: ./gradlew set-snapshot-version --stacktrace ${{ github.event_name == 'workflow_dispatch' && format('-PsnapshotVersion={0}-SNAPSHOT', github.ref_name) || '' }}\n\n      - name: Publish core package\n        id: publish_package\n        run: ./gradlew :publishMavenJavaPublicationToGitHubPackagesRepository wiremock-core:publishMavenJavaPublicationToGitHubPackagesRepository wiremock-jetty:publishMavenJavaPublicationToGitHubPackagesRepository --stacktrace\n\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/publish-test-results.yml",
    "content": "name: Publish Test Results\n\non:\n  workflow_run:\n    workflows: [\"CI\"]\n    types:\n      - completed\n\njobs:\n  unit-test-results:\n    name: Unit Test Results\n    runs-on: ubuntu-latest\n    if: github.event.workflow_run.conclusion != 'skipped'\n\n    steps:\n    - name: Download and Extract Artifacts\n      env:\n        GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}\n      run: |\n         mkdir -p artifacts && cd artifacts\n\n         artifacts_url=${{ github.event.workflow_run.artifacts_url }}\n\n         gh api \"$artifacts_url\" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact\n         do\n           IFS=$'\\t' read name url <<< \"$artifact\"\n           gh api $url > \"$name.zip\"\n           unzip -d \"$name\" \"$name.zip\"\n         done\n\n    - name: Publish Unit Test Results\n      uses: EnricoMi/publish-unit-test-result-action@v2\n      with:\n        commit: ${{ github.event.workflow_run.head_sha }}\n        event_file: artifacts/Event File/event.json\n        event_name: ${{ github.event.workflow_run.event }}\n        files: \"artifacts/**/*.xml\"\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "name: Release\n\non:\n  workflow_dispatch:\n\njobs:\n  publish-core:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      packages: write\n    steps:\n      - uses: actions/checkout@v4\n      - name: Set up Java\n        uses: actions/setup-java@v4\n        with:\n          java-version: '17'\n          distribution: 'temurin'\n      - name: Setup Gradle\n        uses: gradle/actions/setup-gradle@v4\n        with:\n          validate-wrappers: true\n\n      - name: Publish core package\n        id: publish_package\n        run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache --stacktrace\n\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ vars.MAVEN_CENTRAL_USERNAME }}\n          ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_TOKEN }}\n          OSSRH_GPG_SECRET_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}\n          OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}\n          SONATYPE_CLOSE_TIMEOUT_SECONDS: 1800\n"
  },
  {
    "path": ".gitignore",
    "content": "# Compiled source #\n###################\n*.com\n*.class\n*.dll\n*.exe\n*.o\n*.so\n*.pyc\n\n# Logs and databases #\n######################\n*.log\n*.sql\n*.sqlite\n\n# OS generated files #\n######################\n.DS_Store?\nehthumbs.db\nIcon?\nThumbs.db\n\n# Maven/Eclipse #\n#################\nbuild\n.project\n.classpath\n.settings\n.gradle\n**/target\nclasses\n.gradletasknamecache\n\n# IDEA #\n#################\nout\nwiremock.iml\nwiremock.ipr\nwiremock.iws\n**/*.iml\n.idea\n\n# NPM #\n##################\n**/node_modules\n\n# Misc #\n########\ncopy-admin.sh\n.DS_Store\n**/.DS_Store\n\n**/log.txt\n\n.vagrant\ntmp*\n\nbin\n\nscripts/client-cert.*\n!scripts/client-cert.conf\n\nnotes.txt\n\n.kotlin/\n"
  },
  {
    "path": ".nvmrc",
    "content": "22\n"
  },
  {
    "path": ".run/Build WireMock.run.xml",
    "content": "<component name=\"ProjectRunConfigurationManager\">\n  <configuration default=\"false\" name=\"Build WireMock\" type=\"GradleRunConfiguration\" factoryName=\"Gradle\">\n    <ExternalSystemSettings>\n      <option name=\"executionName\" />\n      <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n      <option name=\"externalSystemIdString\" value=\"GRADLE\" />\n      <option name=\"scriptParameters\" value=\"\" />\n      <option name=\"taskDescriptions\">\n        <list />\n      </option>\n      <option name=\"taskNames\">\n        <list>\n          <option value=\"jar\" />\n          <option value=\"shadowJar\" />\n        </list>\n      </option>\n      <option name=\"vmOptions\" />\n    </ExternalSystemSettings>\n    <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>\n    <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>\n    <DebugAllEnabled>false</DebugAllEnabled>\n    <ForceTestExec>false</ForceTestExec>\n    <method v=\"2\" />\n  </configuration>\n</component>"
  },
  {
    "path": ".run/Publish to Maven local.run.xml",
    "content": "<component name=\"ProjectRunConfigurationManager\">\n  <configuration default=\"false\" name=\"Publish to Maven local\" type=\"GradleRunConfiguration\" factoryName=\"Gradle\">\n    <ExternalSystemSettings>\n      <option name=\"executionName\" />\n      <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n      <option name=\"externalSystemIdString\" value=\"GRADLE\" />\n      <option name=\"scriptParameters\" value=\"\" />\n      <option name=\"taskDescriptions\">\n        <list />\n      </option>\n      <option name=\"taskNames\">\n        <list>\n          <option value=\"publishToMavenLocal\" />\n        </list>\n      </option>\n      <option name=\"vmOptions\" />\n    </ExternalSystemSettings>\n    <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>\n    <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>\n    <DebugAllEnabled>false</DebugAllEnabled>\n    <ForceTestExec>false</ForceTestExec>\n    <method v=\"2\" />\n  </configuration>\n</component>"
  },
  {
    "path": ".run/Run Spotless.run.xml",
    "content": "<component name=\"ProjectRunConfigurationManager\">\n  <configuration default=\"false\" name=\"Run Spotless\" type=\"GradleRunConfiguration\" factoryName=\"Gradle\">\n    <ExternalSystemSettings>\n      <option name=\"executionName\" />\n      <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n      <option name=\"externalSystemIdString\" value=\"GRADLE\" />\n      <option name=\"scriptParameters\" value=\"\" />\n      <option name=\"taskDescriptions\">\n        <list />\n      </option>\n      <option name=\"taskNames\">\n        <list>\n          <option value=\"spotlessApply\" />\n        </list>\n      </option>\n      <option name=\"vmOptions\" />\n    </ExternalSystemSettings>\n    <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>\n    <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>\n    <DebugAllEnabled>false</DebugAllEnabled>\n    <ForceTestExec>false</ForceTestExec>\n    <method v=\"2\" />\n  </configuration>\n</component>"
  },
  {
    "path": ".run/Run Tests.run.xml",
    "content": "<component name=\"ProjectRunConfigurationManager\">\n  <configuration default=\"false\" name=\"Run Tests\" type=\"GradleRunConfiguration\" factoryName=\"Gradle\">\n    <ExternalSystemSettings>\n      <option name=\"executionName\" />\n      <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n      <option name=\"externalSystemIdString\" value=\"GRADLE\" />\n      <option name=\"scriptParameters\" value=\"\" />\n      <option name=\"taskDescriptions\">\n        <list />\n      </option>\n      <option name=\"taskNames\">\n        <list>\n          <option value=\"check\" />\n        </list>\n      </option>\n      <option name=\"vmOptions\" />\n    </ExternalSystemSettings>\n    <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>\n    <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>\n    <DebugAllEnabled>false</DebugAllEnabled>\n    <ForceTestExec>false</ForceTestExec>\n    <method v=\"2\" />\n  </configuration>\n</component>"
  },
  {
    "path": ".sdkmanrc",
    "content": "# Enable auto-env through the sdkman_auto_env config\n# Add key=value pairs of SDKs to use below\njava=17.0.14-tem\n"
  },
  {
    "path": ".snyk",
    "content": "# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.\nversion: v1.25.0\nignore: {}\npatch: {}\nexclude:\n  global:\n    - ./sample-war/**/*:\n        reason: test only sub-project\n        expires: 2044-05-23T00:00:00.000Z\n        created: 2024-05-23T13:24:10.953Z\n    - ./perf-test/**/*:\n        reason: test only sub-project\n        expires: 2044-05-23T00:00:00.000Z\n        created: 2024-05-23T13:24:46.178Z\n    - ./test-logging/**/*:\n        reason: test only sub-project\n        expires: 2044-05-23T00:00:00.000Z\n        created: 2024-05-23T13:25:17.519Z\n    - ./test-extension/**/*:\n        reason: test only sub-project\n        expires: 2044-05-23T00:00:00.000Z\n        created: 2024-05-23T13:25:37.801Z\n"
  },
  {
    "path": "AGENTS.md",
    "content": "# Agent Rules\n\n## Running the build\nAlways use `./gradlew` to run the build. This ensures that the correct version of Gradle is used and all plugins are applied.\n\n## Messaging/WebSocket Code\n\nThe following packages contain messaging/websocket functionality:\n- `wiremock-core/src/main/java/com/github/tomakehurst/wiremock/websocket/`\n- `wiremock-core/src/main/java/com/github/tomakehurst/wiremock/websocket/message/`\n- Message-related classes in `wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/` (classes with \"Message\" in the name)\n\n### Rules for these packages:\n\n1. **No Javadoc** - Do not add javadoc comments to classes, interfaces, methods, or fields.\n\n2. **No Comments** - Do not add inline comments except in rare cases to explain non-obvious decisions that cannot be made clear through better naming or code structure.\n\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to WireMock\n\n[![Docs](https://img.shields.io/static/v1?label=Documentation&message=public&color=green)](https://wiremock.org/docs/)\n[![a](https://img.shields.io/badge/slack-%23wiremock%5Fjava-brightgreen?style=flat&logo=slack)](https://slack.wiremock.org/)\n[![a](https://img.shields.io/badge/Public-Roadmap-brightgreen?style=flat)](https://github.com/orgs/wiremock/projects/4)\n[![Participate](https://img.shields.io/static/v1?label=Contributing&message=guide&color=blue)](https://github.com/wiremock/wiremock/blob/master/CONTRIBUTING.md)\n\nWireMock exists and continues to thrive due to the efforts of over 150 contributors,\nand we continue to welcome contributions to its evolution.\nRegardless of your expertise and time you could dedicate,\nthere're opportunities to participate and help the project!\n\n## Ways to contribute\n\nThis guide is for contributing to WireMock, also known as _WireMock Java_ or _WireMock Core_.\nThere are many other repositories waiting for contributors,\ncheck out the [Contributor Guide](https://github.com/wiremock/wiremock/blob/master/CONTRIBUTING.md)\nfor the references and details.\n\n## Getting started\n\nIf you want to contribute to WireMock Java codebase, do the following:\n\n* Join the [community Slack channel](http://slack.wiremock.org/),\n  especially the `#help-contributing` and `#wiremock-java` channels.\n  The latter is used to coordinate development of this repository.\n* Read the guidelines below\n* Start contributing by creating issues, submitting patches via pull requests, and helping others!\n\n## Building WireMock locally\n\nTo run all of WireMock's tests:\n\n```bash\n./gradlew check\n```\n\nTo build both JARs (thin and standalone), the JARs will be placed under ``build/libs``.:\n\n```bash\n./gradlew jar shadowJar\n```\n\nTo publish both JARs to your local Maven repository:\n\n```bash\n./gradlew publishToMavenLocal\n```\n\nIf you use IntelliJ, you can also use the corresponding run configurations, **Run Tests**, **Build WireMock** and **Publish to Maven local** respectively.\n\n## Contributing Code\n\nPlease be mindful of the\nfollowing guidelines:\n\n* All changes should include suitable tests, whether to demonstrate the bug or exercise and document the new feature.\n* Please make one change per pull request.\n* If the new feature is significantly large/complex/breaks existing behaviour, please first post a summary of your idea\non the GitHub Issue to generate a discussion. This will avoid significant amounts of coding time spent on changes that ultimately get rejected.\n* Try to avoid reformats of files that change the indentation, tabs to spaces etc., as this makes reviewing diffs much\nmore difficult.\n* Abide by [the Architecture Rules](https://github.com/wiremock/wiremock/tree/master/src/test/java/com/github/tomakehurst/wiremock/archunit) enforced by ArchUnit.\n\n### Before opening a PR\n\nWhen proposing new features or enhancements, we strongly recommend opening an issue first so that the problem being solved\nand the implementation design can be discussed. This helps to avoid time being invested in code that is never eventually\nmerged, and also promotes better designs by involving the community more widely.\n\nFor straightforward bug fixes where the issue is clear and can be illustrated via a failing unit or acceptance test, please\njust open a PR.\n\n### Code style\n\nWireMock uses the [Google Java style guide](https://google.github.io/styleguide/javaguide.html) and this is enforced in\nthe build via the Gradle [Spotless plugin](https://github.com/diffplug/spotless).\n\nWhen running pre-commit checks, if there are any formatting failures the Spotless plugin can fix them for you:\n\n```bash\n./gradlew spotlessApply\n```\n\nIf you use IntelliJ, you can also use the run configuration called **Run Spotless**,\nor there's also an [IntelliJ plugin](https://plugins.jetbrains.com/plugin/8527-google-java-format) for the same purpose.\n\n## Testing\n\nWireMock has a fairly comprehensive test suite which ensures it remains robust and correct as the codebase evolves.\n\nIn particular, there are acceptance tests for almost all features, where a full WireMock server is started up and tested\nvia its public APIs.\n\nNew features should by default come with acceptance tests covering the major positive and negative cases. Unit tests\nshould also be used judiciously where non-trivial logic would benefit from finer-grained checking.\n\nWhen making performance enhancements a representative benchmark test should be developed using an appropriate tool, and\nthe results before and after applying the change attached to the associated PR.\n\n## Writing documentation\n\nIt is expected that all new features and enhancements are documented properly,\nin most cases before the patches are merged.\n\nMost of WireMock's documentation is published on `wiremock.org`,\nwhich is a static website built using Jekyll.\nThe website sources are located here: [wiremock/wiremock.org](https://github.com/wiremock/wiremock.org).\nAll the documentation is located under the `_docs` directory as Markdown files,\nand it can be edited with all modern text editors and IDEs.\nSee the repository's contributor guide for more information.\n\n## Merge process\n\nMerges to this repository can be performed by the WireMock maintainer ([Tom Akehurst](https://github.com/tomakehurst))\nand by _co-maintainers_ assigned by him.\nThis is a [community role](https://github.com/wiremock/community/blob/main/governance/README.md)\ndesigned for WireMock itself and other key repositories,\nspecifically to improve velocity of reviews and changes.\n\n- The maintainers are responsible to verify the pull request readiness\n  in accordance with contributing guidelines (e.g. code quality, test automation, documentation, etc.).\n  The pull request can only be approved if these requirements are met\n- In the beginning, a review by one co-maintainer is required for the merge,\n  unless there are negative reviews and unaddressed comments by other contributors\n- After the approval, it is generally recommended to give at least 24 hours for reviews before merging\n\n### What can be merged by co-maintainers\n\nFor WireMock 3.x and beyond, co-maintainers can merge the following pull requests:\n\n- Minor features and improvements that do not impact the WireMock architecture\n- Refactorings, including the major ones, e.g. Guava replacement\n- Test Automation\n- Non-production repository changes: documentation (including Javadoc), GitHub Actions, bots and automation\n- Dependency updates for shaded dependencies, patch/minor versions for projects following the Semantic Versioning notation\n\nFor the WireMock 2.x branch, a decision of BDFL is is needed for any patch. \n\n### What CANNOT be merged by co-maintainers without BDFL’s approval\n\nThe following changes need a review by Tom Akehurst before being merged.\n\n- Any compatibility breaking changes, including binary API and REST API,\n  unless pre-approved by the BDFL in the associated GitHub issue\n- New request matchers (patterns)\n- Substantial changes to WireMock Architecture and API.\n  Examples: New REST API end-points, major features like GraphQL fetching\n- Inclusion of new libraries, even if shaded\n- Major version Dependency updates, e.g. Jetty 11 => 12\n- Changes in the deliverable artefacts, e.g. new modules\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "NOTICE.txt",
    "content": "This product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/)."
  },
  {
    "path": "README.md",
    "content": "# WireMock - flexible, open source API mocking\n\n<p align=\"center\">\n    <a href=\"https://wiremock.org\" target=\"_blank\">\n        <img width=\"512px\" src=\"https://wiremock.org/images/logos/wiremock/logo_wide.svg\" alt=\"WireMock Logo\"/>\n    </a>\n</p>\n\n<p align=\"center\">\n    <a href=\"https://github.com/tomakehurst/wiremock/actions/workflows/build-and-test.yml\">\n        <img src=\"https://github.com/tomakehurst/wiremock/actions/workflows/build-and-test.yml/badge.svg\" alt=\"Build Status\"/>\n    </a>\n    <a href=\"https://wiremock.org/docs/\">\n        <img src=\"https://img.shields.io/static/v1?label=Documentation&message=public&color=green\" alt=\"Docs\"/>\n    </a>\n    <a href=\"https://slack.wiremock.org/\">\n        <img src=\"https://img.shields.io/badge/slack-Join%20us-brightgreen?style=flat&logo=slack\" alt=\"Join us on Slack\"/>\n    </a>\n    <a href=\"./CONTRIBUTING.md\">\n        <img src=\"https://img.shields.io/static/v1?label=Contributing&message=guide&color=orange\" alt=\"Contributing Guide\"/>\n    </a>\n    <a href=\"https://search.maven.org/artifact/org.wiremock/wiremock\">\n        <img src=\"https://img.shields.io/maven-central/v/org.wiremock/wiremock.svg\" alt=\"Maven Central\"/>\n    </a>\n</p>\n\n---\n\n<table>\n<tr>\n<td>\n<img src=\"https://wiremock.org/images/wiremock-cloud/wiremock_cloud_logo.png\" alt=\"WireMock Cloud Logo\" height=\"20\" align=\"left\">\n<strong>WireMock open source is supported by <a href=\"https://www.wiremock.io/cloud-overview?utm_source=github.com&utm_campaign=wiremock-README.md-banner\">WireMock Cloud</a>. Please consider trying it out if your team needs advanced capabilities such as OpenAPI, dynamic state, data sources and more.</strong>\n</td>\n</tr>\n</table>\n\n---\n\nWireMock is the popular open source tool for API mocking, with over 6 million downloads per month,\nand powers [WireMock Cloud](https://www.wiremock.io/comparison?utm_source=github.com&utm_campaign=wiremock-README.md).\n\nIt can help you to create stable test and development environments,\nisolate yourself from flaky 3rd parties and simulate APIs that don’t exist yet.\n\nStarted in 2011 as a Java library by [Tom Akehurst](https://github.com/tomakehurst),\nnow WireMock spans across multiple programming languages and technology stacks.\nIt can run as a library or client wrapper in many languages, or as a standalone server.\nThere is a big community behind the project and its ecosystem.\n\nWireMock supports several approaches for creating mock APIs -\nin code, via its REST API, as JSON files and by recording HTTP traffic proxied to another destination.\nWireMock has a rich matching system, allowing any part of an incoming request to be matched against complex and precise criteria.\nResponses of any complexity can be dynamically generated via the Handlebars based templating system.\nFinally, WireMock is easy to integrate into any workflow due to its numerous extension points and comprehensive APIs.\n\n## Key Features\n\nWireMock can run in unit tests, as a standalone process or a container.\nKey features include:\n\n- HTTP response stubbing, matchable on URL, header and body content patterns\n- Configuration via a fluent Java API, JSON files and JSON over HTTP\n- Record/playback of stubs\n- Request verification\n- Fault and response delays injection\n- Per-request conditional proxying\n- Browser proxying for request inspection and replacement\n- Stateful behaviour simulation\n- Extensibility\n\nFull documentation can be found at [wiremock.org/docs](https://wiremock.org/docs).\n\n## Questions and Issues\n\nIf you have a question about WireMock, or are experiencing a problem you're not sure is a bug please post a message to the\n[WireMock Community Slack](https://slack.wiremock.org) in the `#help` channel.\n\nOn the other hand if you're pretty certain you've found a bug please open an issue.\n\n## Log4j Notice\n\nWireMock only uses log4j in its test dependencies. Neither the thin nor standalone JAR depends on or embeds log4j, so\nyou can continue to use WireMock 2.32.0 and above without any risk of exposure to the recently discovered vulnerability.\n\n## Contributing\n\nWireMock exists and continues to thrive due to the efforts of contributors.\nRegardless of your expertise and time you could dedicate,\nthere're opportunities to participate and help the project!\n\nSee the [Contributing Guide](./CONTRIBUTING.md) for more information.\n"
  },
  {
    "path": "RELEASING.md",
    "content": "# Checklist for releasing WireMock\n\n- [ ] Bump version number\n- [ ] Run the release\n- [ ] Publish the release note\n- [ ] Update the version on wiremock.org\n- [ ] Release the Docker image\n- [ ] Announce on the WireMock Community Slack\n- [ ] Announce on social\n\n## Pre-release - bump version number\nMake sure the version number has been updated. Do this either via\n\n```\n./gradlew bump-minor-version\n```\n\nor\n\n```\n./gradlew bump-patch-version\n```\n\nCommit and push the changes made by this command.\n\n## Release\nManually trigger the [Release](https://github.com/wiremock/wiremock/actions/workflows/release.yml) workflow from the master branch.\n\n## Publish the release note\nRelease drafter should have created a draft release note called \"next\". Check it for sanity and edit it to add any additional information and then set the tag\nto the version you've just released and publish it.\n\n## Update the version on wiremock.org\nhttps://github.com/wiremock/wiremock.org\n\nPublish the changes by merging to the `live-publish` branch and manually triggering the \"Deploy Jekyll site to Pages\" workflow.\n\n## Release the Docker image\n\n1. Wait for the JAR version you just published to be synced to Maven Central. You can check [here](https://repo1.maven.org/maven2/org/wiremock/wiremock/)\n2. Run the [Release workflow](https://github.com/wiremock/wiremock-docker/actions/workflows/release.yml), with the following parameters:\n    - Branch: `main`\n    - Image version (single-digit suffix like 2.35.0-1): Usually `1` \n    - Bundled WireMock version: The JAR version just published. You can check [here](https://repo1.maven.org/maven2/org/wiremock/wiremock/)\n3. Update the README manually on Docker Hub (until we get around to automating it).\n\n## Post an announcement on the WireMock Community Slack\nAnnounce in the #announcments channel then link to the message from #general.\n\n## Shout about it on as many social media platforms as possible\nYou know the drill."
  },
  {
    "path": "Vagrantfile",
    "content": "def windows?\n    (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil\nend\n\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"tcthien/java-dev-server\"\n  config.vm.box_version = \"0.0.7\"\n  config.vm.box_check_update = false\n\n  # config.vm.synced_folder \"#{Dir.home}/.m2/repository\", \"/share/mavenRepo\"\n  # config.vm.synced_folder \"\", \"/share/source\"\n\n  # MySQL Port\n  # config.vm.network \"forwarded_port\", guest: 3306, host: 3306\n  # Cassandra Port\n  # config.vm.network \"forwarded_port\", guest: 9042, host: 9042\n  # config.vm.network \"forwarded_port\", guest: 7000, host: 7000\n  # config.vm.network \"forwarded_port\", guest: 7001, host: 7001\n  # config.vm.network \"forwarded_port\", guest: 9160, host: 9160\n\n  config.vm.provider \"virtualbox\" do |vb|\n     vb.memory = \"2048\"\n     vb.name = \"codelab-server\"\n  end\n\n  # update node+npm\n  config.vm.provision \"shell\", privileged: false, inline: <<-SHELL\n    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash\n    export NVM_DIR=\"\\$HOME/.nvm\"\n    [ -s \"\\$NVM_DIR/nvm.sh\" ] && \\. \"\\$NVM_DIR/nvm.sh\"\n    [ -s \"\\$NVM_DIR/bash_completion\" ] && \\. \"\\$NVM_DIR/bash_completion\"\n    nvm install --lts\n  SHELL\n\n  # node/npm has symlink errors on windows hosts, this config disables them\n  if windows?\n    config.vm.provision \"shell\", privileged: false, inline: <<-SHELL\n      export NVM_DIR=\"\\$HOME/.nvm\"\n      [ -s \"\\$NVM_DIR/nvm.sh\" ] && \\. \"\\$NVM_DIR/nvm.sh\"\n      npm config set bin-links false\n    SHELL\n  end\nend"
  },
  {
    "path": "build.gradle.kts",
    "content": "\nimport com.github.gundy.semver4j.model.Version\nimport org.gradle.plugins.ide.eclipse.model.Classpath\nimport org.gradle.plugins.ide.eclipse.model.Container\n\nbuildscript {\n  repositories {\n    mavenCentral()\n  }\n  dependencies {\n    classpath(\"com.github.gundy:semver4j:0.16.4\")\n  }\n}\n\nplugins {\n  id(\"wiremock.common-conventions\")\n  id(\"scala\")\n  id(\"idea\")\n  id(\"eclipse\")\n  id(\"project-report\")\n  alias(libs.plugins.jmh)\n  alias(libs.plugins.task.tree)\n}\n\ndependencies {\n  api(project(\":wiremock-core\"))\n  api(project(\":wiremock-jetty\"))\n  implementation(project(\":wiremock-httpclient-apache5\"))\n  implementation(project(\":wiremock-url:wiremock-url\"))\n\n  implementation(libs.jopt.simple)\n\n  testFixturesApi(project(\":wiremock-core\"))\n\n  testFixturesApi(libs.apache.http5.client)\n  testFixturesApi(libs.apache.http5.core)\n  testFixturesApi(libs.guava)\n  testFixturesApi(libs.hamcrest)\n  testFixturesApi(libs.handlebars)\n  testFixturesApi(libs.jakarta.servlet.api)\n  testFixturesApi(libs.jakarta.websockets)\n  testFixturesApi(libs.jsonassert)\n  testFixturesApi(libs.junit.jupiter.api)\n\n  testFixturesImplementation(platform(libs.jetty.bom))\n  testFixturesImplementation(libs.jetty.util)\n  testFixturesImplementation(platform(libs.junit.bom))\n  testFixturesImplementation(libs.mockito.core)\n  testFixturesImplementation(libs.xmlunit.core)\n  testFixturesImplementation(libs.awaitility)\n\n  testImplementation(platform(libs.okhttp.bom))\n  testImplementation(libs.okhttp)\n\n  testImplementation(project(\":wiremock-junit5\"))\n  testImplementation(libs.apache.http5.client)\n  testImplementation(libs.apache.http5.core)\n  testImplementation(libs.guava)\n  testImplementation(libs.handlebars)\n  testImplementation(libs.commons.lang)\n\n  testImplementation(platform(libs.jackson.bom))\n  testImplementation(libs.jackson.core)\n  testImplementation(libs.jackson.annotations)\n\n  testImplementation(libs.jakarta.servlet.api)\n\n  testImplementation(platform(libs.jetty.bom))\n  testImplementation(platform(libs.jetty.ee11.bom))\n  testImplementation(libs.jetty.ee11.servlet)\n  testImplementation(libs.jetty.io)\n  testImplementation(libs.jetty.server)\n  testImplementation(libs.jetty.util)\n  testImplementation(libs.json.schema.validator)\n\n  testImplementation(libs.xmlunit.core)\n  testImplementation(libs.json.unit.core)\n\n  testImplementation(libs.json.path) {\n    // See https://github.com/json-path/JsonPath/issues/224\n    exclude(group = \"org.ow2.asm\", module = \"asm\")\n  }\n  testImplementation(libs.slf4j.api)\n\n  testImplementation(project(\":wiremock-junit5\"))\n  testImplementation(libs.android.json)\n  testImplementation(libs.archunit)\n  testImplementation(libs.archunit.junit5.api)\n  testImplementation(libs.assertj.core)\n  testImplementation(libs.jackson.databind)\n  testImplementation(libs.jetty.client)\n  testImplementation(libs.jetty.ee11.webapp)\n  testImplementation(libs.jetty.http)\n  testImplementation(libs.jetty.http2.client)\n  testImplementation(libs.jetty.http2.client.transport)\n  testImplementation(libs.jmh.core)\n  testImplementation(libs.json.unit)\n  testImplementation(libs.jsonassert.toomuchcoding)\n  testImplementation(platform(libs.junit.bom))\n  testImplementation(libs.junit.jupiter.api)\n  testImplementation(libs.junit.jupiter.params)\n  testImplementation(libs.junit.pioneer)\n  testImplementation(libs.junit.platform.engine)\n  testImplementation(libs.junit.platform.launcher)\n  testImplementation(libs.awaitility)\n  testImplementation(libs.mockito.core)\n  testImplementation(libs.mockito.junit.jupiter)\n  testImplementation(libs.scala.library)\n\n  testRuntimeOnly(files(\"src/test/resources/classpath file source/classpathfiles.zip\", \"src/test/resources/classpath-filesource.jar\"))\n  testRuntimeOnly(files(\"test-extension/test-extension.jar\"))\n  testRuntimeOnly(libs.archunit.junit5)\n  testRuntimeOnly(libs.jmh.generator.annprocess)\n  testRuntimeOnly(libs.junit.vintage.engine)\n  testRuntimeOnly(libs.junit.jupiter)\n  testRuntimeOnly(libs.junit4)\n\n  modules {\n    module(\"org.apache.logging.log4j:log4j-core\") {\n      replacedBy(\"org.apache.logging.log4j:log4j-to-slf4j\")\n    }\n    module(\"commons-logging:commons-logging\") {\n      replacedBy(\"org.slf4j:jcl-over-slf4j\")\n    }\n    module(\"log4j:log4j\") {\n      replacedBy(\"org.slf4j:log4j-over-slf4j\")\n    }\n    module(\"javax.activation:activation\") {\n      replacedBy(\"jakarta.activation:jakarta.activation-api\")\n    }\n    module(\"javax.activation:javax.activation-api\") {\n      replacedBy(\"jakarta.activation:jakarta.activation-api\")\n    }\n    module(\"javax.validation:validation-api\") {\n      replacedBy(\"jakarta.validation:jakarta.validation-api\")\n    }\n    module(\"javax.xml.bind:jaxb-api\") {\n      replacedBy(\"jakarta.xml.bind:jakarta.xml.bind-api\")\n    }\n    module(\"org.hamcrest:hamcrest-core\") {\n      replacedBy(\"org.hamcrest:hamcrest\")\n    }\n    module(\"org.hamcrest:hamcrest-library\") {\n      replacedBy(\"org.hamcrest:hamcrest\")\n    }\n    module(\"javax.ws.rs:jsr311-api\") {\n      replacedBy(\"jakarta.ws.rs:jakarta.ws.rs-api\")\n    }\n    module(\"javax.ws.rs:javax.ws.rs-api\") {\n      replacedBy(\"jakarta.ws.rs:jakarta.ws.rs-api\")\n    }\n    module(\"javax.servlet:javax.servlet-api\") {\n      replacedBy(\"jakarta.servlet:jakarta.servlet-api\")\n    }\n    module(\"org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api\") {\n      replacedBy(\"jakarta.servlet:jakarta.servlet-api\")\n    }\n    module(\"javax.annotation:javax.annotation-api\") {\n      replacedBy(\"jakarta.annotation:jakarta.annotation-api\")\n    }\n    module(\"com.sun.activation:jakarta.activation\") {\n      replacedBy(\"jakarta.activation:jakarta.activation-api\")\n    }\n  }\n}\n\ntasks {\n  check {\n    dependsOn(buildHealth)\n  }\n}\n\ntasks.test {\n  // Without this the archunit tests fail. I do not know why.\n  classpath += sourceSets.main.get().compileClasspath + sourceSets.main.get().runtimeClasspath\n}\n\nval testJar by tasks.registering(Jar::class) {\n  archiveClassifier.set(\"tests\")\n  from(sourceSets.test.get().output)\n}\n\ntasks.jar {\n  archiveBaseName.set(\"wiremock\")\n  manifest {\n    attributes(\"Main-Class\" to \"wiremock.Run\")\n  }\n}\n\ntasks.shadowJar {\n  archiveBaseName = \"wiremock-standalone\"\n  archiveClassifier = \"\"\n  configurations = listOf(\n    project.configurations.runtimeClasspath.get(),\n  )\n\n  relocate(\"org.mortbay\", \"wiremock.org.mortbay\")\n  relocate(\"org.eclipse\", \"wiremock.org.eclipse\")\n  relocate(\"org.codehaus\", \"wiremock.org.codehaus\")\n  relocate(\"com.google\", \"wiremock.com.google\")\n  relocate(\"com.google.thirdparty\", \"wiremock.com.google.thirdparty\")\n  relocate(\"com.fasterxml.jackson\", \"wiremock.com.fasterxml.jackson\")\n  relocate(\"org.apache\", \"wiremock.org.apache\")\n  relocate(\"org.xmlunit\", \"wiremock.org.xmlunit\")\n  relocate(\"org.hamcrest\", \"wiremock.org.hamcrest\")\n  relocate(\"org.skyscreamer\", \"wiremock.org.skyscreamer\")\n  relocate(\"org.json\", \"wiremock.org.json\")\n  relocate(\"net.minidev\", \"wiremock.net.minidev\")\n  relocate(\"com.jayway\", \"wiremock.com.jayway\")\n  relocate(\"org.objectweb\", \"wiremock.org.objectweb\")\n  relocate(\"org.custommonkey\", \"wiremock.org.custommonkey\")\n  relocate(\"net.javacrumbs\", \"wiremock.net.javacrumbs\")\n  relocate(\"net.sf\", \"wiremock.net.sf\")\n  relocate(\"com.github.jknack\", \"wiremock.com.github.jknack\")\n  relocate(\"org.antlr\", \"wiremock.org.antlr\")\n  relocate(\"jakarta.servlet\", \"wiremock.jakarta.servlet\")\n  relocate(\"org.checkerframework\", \"wiremock.org.checkerframework\")\n  relocate(\"org.hamcrest\", \"wiremock.org.hamcrest\")\n  relocate(\"org.slf4j\", \"wiremock.org.slf4j\")\n  relocate(\"joptsimple\", \"wiremock.joptsimple\")\n  exclude(\"joptsimple/HelpFormatterMessages.properties\")\n  relocate(\"org.yaml\", \"wiremock.org.yaml\")\n  relocate(\"com.ethlo\", \"wiremock.com.ethlo\")\n  relocate(\"com.networknt\", \"wiremock.com.networknt\")\n  relocate(\"org.jspecify\", \"wiremock.org.jspecify\")\n\n  dependencies {\n    exclude(dependency(\"junit:junit\"))\n  }\n\n  mergeServiceFiles()\n\n  exclude(\"META-INF/maven/**\")\n  exclude(\"META-INF/versions/17/**\")\n  exclude(\"META-INF/versions/21/**\")\n  exclude(\"META-INF/versions/22/**\")\n  exclude(\"module-info.class\")\n  exclude(\"handlebars-*.js\")\n}\n\npublishing {\n  publications {\n    create<MavenPublication>(\"mavenJava\") {\n      artifactId = tasks.jar.get().archiveBaseName.get()\n      from(components[\"java\"])\n      artifact(testJar)\n\n      pom {\n        name = \"WireMock\"\n        description = \"A web service test double for all occasions\"\n      }\n    }\n\n    create<MavenPublication>(\"standaloneJar\") {\n      artifactId = \"${tasks.jar.get().archiveBaseName.get()}-standalone\"\n      project.shadow.component(this)\n\n      artifact(tasks.named(\"sourcesJar\"))\n      artifact(tasks.named(\"javadocJar\"))\n      artifact(testJar)\n\n      pom.packaging = \"jar\"\n      pom {\n        name = \"WireMock\"\n        description = \"A web service test double for all occasions - standalone edition\"\n      }\n    }\n  }\n}\n\nval checkReleasePreconditions by tasks.registering  {\n  doLast {\n    val releaseBranches = listOf(\"master\", \"v4.x\")\n    val currentGitBranch = providers.exec {\n      commandLine(\"git\", \"rev-parse\", \"--abbrev-ref\", \"HEAD\")\n    }.standardOutput.asText.get().trim()\n    require(currentGitBranch in releaseBranches) {\n      \"Must be on one of $releaseBranches branches in order to release to Sonatype; was on [$currentGitBranch]\"\n    }\n  }\n}\n\nval addGitTag by tasks.registering {\n  doLast {\n    println(providers.exec { commandLine(\"git\", \"tag\", version) }.standardOutput.asText.get())\n    println(providers.exec { commandLine(\"git\", \"push\", \"origin\", \"--tags\") }.standardOutput.asText.get())\n  }\n}\n\ntasks.publish {\n  dependsOn(\n    checkReleasePreconditions,\n    \"signStandaloneJarPublication\",\n    \"signMavenJavaPublication\",\n  )\n}\ntasks.withType<AbstractPublishToMaven>().configureEach {\n  val signingTasks = tasks.withType<Sign>()\n  mustRunAfter(signingTasks)\n}\n\ntasks.assemble {\n  dependsOn(tasks.jar, tasks.shadowJar)\n}\n\ntasks.register(\"release\") {\n  dependsOn(tasks.clean, tasks.assemble, tasks.publish, addGitTag)\n}\n\ntasks.register(\"localRelease\") {\n  dependsOn(tasks.clean, tasks.assemble, tasks.publishToMavenLocal)\n}\n\nfun updateFiles(currentVersion: String, nextVersion: String) {\n\n  val filesWithVersion: Map<String, (String) -> String> = mapOf(\n    \"buildSrc/src/main/kotlin/wiremock.common-conventions.gradle.kts\"    to { \"version = \\\"${it}\\\"\" },\n    \"ui/package.json\"                                                    to { \"\\\"version\\\": \\\"${it}\\\"\" },\n    \"wiremock-core/src/main/resources/version.properties\"              to { \"version=${it}\" },\n    \"wiremock-core/src/main/resources/swagger/wiremock-admin-api.json\" to { \"\\\"version\\\": \\\"${it}\\\"\" },\n    \"wiremock-core/src/main/resources/swagger/wiremock-admin-api.yaml\" to { \"version: $it\" },\n  )\n\n  filesWithVersion.forEach { (fileName, lineWithVersionTemplates) ->\n    val file = file(fileName)\n    val lineWithVersionTemplateList = listOf(lineWithVersionTemplates)\n\n    lineWithVersionTemplateList.forEach { lineWithVersionTemplate ->\n      val oldLine = lineWithVersionTemplate(currentVersion)\n      val newLine = lineWithVersionTemplate(nextVersion)\n      println(\"Replacing '${oldLine}' with '${newLine}' in $fileName\")\n      file.writeText(file.readText().replace(oldLine, newLine))\n    }\n  }\n}\n\ntasks.register(\"bump-patch-version\") {\n  doLast {\n\n    val currentVersion = Version.fromString(project.version.toString())\n    val nextVersion = currentVersion.incrementPatch().toString()\n\n    updateFiles(currentVersion.toString(), nextVersion)\n  }\n}\n\ntasks.register(\"bump-minor-version\") {\n  doLast {\n\n    val currentVersion = Version.fromString(project.version.toString())\n    val nextVersion = currentVersion.incrementMinor().toString()\n\n    updateFiles(currentVersion.toString(), nextVersion)\n  }\n}\n\ntasks.register(\"bump-pre-release-version\") {\n  doLast {\n\n    val currentVersion = Version.fromString(project.version.toString())\n    val preReleaseType = currentVersion.preReleaseIdentifiers.getOrNull(0) ?: \"beta\"\n    val preReleaseVersion = currentVersion.preReleaseIdentifiers.getOrNull(1)?.toString()?.toInt() ?: 0\n\n    val nextVersion = \"${currentVersion.major}.${currentVersion.minor}.${currentVersion.patch}-${preReleaseType}.${preReleaseVersion + 1}\"\n\n    updateFiles(currentVersion.toString(), nextVersion)\n  }\n}\n\ntasks.register(\"set-snapshot-version\") {\n  doLast {\n\n    val currentVersion = Version.fromString(project.version.toString())\n    val nextVersion = project.findProperty(\"snapshotVersion\")?.toString()\n      ?: \"${currentVersion.incrementMinor()}-SNAPSHOT\"\n\n    updateFiles(currentVersion.toString(), nextVersion)\n  }\n}\n\neclipse.classpath.file {\n  whenMerged {\n    (this as Classpath).entries\n      .filterIsInstance<Container>()\n      .filter { it.path.contains(\"JRE_CONTAINER\") }\n      .forEach {\n        it.entryAttributes[\"module\"] = true\n        it.entryAttributes[\"add-exports\"] = \"java.base/sun.security.x509=ALL-UNNAMED\"\n      }\n  }\n}\n\njmh {\n  includes = listOf(\".*benchmarks.*\")\n  threads = 50\n}\n\ntasks.register(\"listRuntimeDependencies\") {\n    group = \"help\"\n    description = \"Writes a flat, sorted list of runtime dependencies to a file\"\n\n    val outputFile = layout.buildDirectory.file(\"reports/flat-runtime-dependencies.txt\")\n\n    inputs.files(configurations.runtimeClasspath)\n    outputs.file(outputFile)\n\n    doLast {\n        val dependencies = configurations.runtimeClasspath.get()\n            .resolvedConfiguration\n            .resolvedArtifacts\n            .map { \"${it.moduleVersion.id.group}:${it.name}:${it.moduleVersion.id.version}\" }\n            .toSortedSet()\n\n        val file = outputFile.get().asFile\n        file.parentFile.mkdirs()\n        file.printWriter().use { writer ->\n            writer.println(\"Runtime dependencies:\")\n            dependencies.forEach { writer.println(\"  $it\") }\n        }\n    }\n}\n\ndependencyAnalysis {\n  issues {\n    // configure for all projects\n    all {\n      // set behavior for all issue types\n      onAny {\n        severity(\"fail\")\n      }\n      onDuplicateClassWarnings {\n        severity(\"fail\")\n      }\n    }\n    project(project.path) {\n      onAny {\n        exclude(\n          \":wiremock-jetty\",\n          \":wiremock-core\",\n        )\n      }\n    }\n  }\n  useTypesafeProjectAccessors(true)\n  usage {\n    analysis {\n      checkSuperClasses(true)\n    }\n  }\n}\n"
  },
  {
    "path": "buildSrc/build.gradle.kts",
    "content": "import org.gradle.api.JavaVersion.VERSION_17\n\nplugins {\n  `kotlin-dsl`\n}\n\nrepositories {\n  mavenCentral()\n  gradlePluginPortal()\n}\n\ndependencies {\n  implementation(\"com.diffplug.gradle.spotless:com.diffplug.gradle.spotless.gradle.plugin:6.25.0\")\n  implementation(\"com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:8.1.1\")\n  implementation(\"org.sonarqube:org.sonarqube.gradle.plugin:6.2.0.5505\")\n  implementation(\"com.vanniktech.maven.publish.base:com.vanniktech.maven.publish.base.gradle.plugin:0.35.0\")\n}\n\njava {\n  sourceCompatibility = VERSION_17\n  targetCompatibility = VERSION_17\n}\n"
  },
  {
    "path": "buildSrc/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.10-bin.zip\nnetworkTimeout=10000\nvalidateDistributionUrl=true\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "buildSrc/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 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\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\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    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\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, 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        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\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": "buildSrc/gradlew.bat",
    "content": "@rem\n@rem Copyright 2015 the original author or authors.\n@rem\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\n@rem you may not use this file except in compliance with the License.\n@rem You may obtain a copy of the License at\n@rem\n@rem      https://www.apache.org/licenses/LICENSE-2.0\n@rem\n@rem Unless required by applicable law or agreed to in writing, software\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n@rem See the License for the specific language governing permissions and\n@rem limitations under the License.\n@rem\n@rem SPDX-License-Identifier: Apache-2.0\n@rem\n\n@if \"%DEBUG%\"==\"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\"==\"\" set DIRNAME=.\n@rem This is normally unused\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif %ERRORLEVEL% equ 0 goto execute\n\necho. 1>&2\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2\necho. 1>&2\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\necho location of your Java installation. 1>&2\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto execute\n\necho. 1>&2\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2\necho. 1>&2\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\necho location of your Java installation. 1>&2\n\ngoto fail\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\n\n:end\n@rem End local scope for the variables with windows NT shell\nif %ERRORLEVEL% equ 0 goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nset EXIT_CODE=%ERRORLEVEL%\nif %EXIT_CODE% equ 0 set EXIT_CODE=1\nif not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\nexit /b %EXIT_CODE%\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "buildSrc/settings.gradle.kts",
    "content": "rootProject.name = \"buildSrc\"\n"
  },
  {
    "path": "buildSrc/src/main/kotlin/wiremock.common-conventions.gradle.kts",
    "content": "import org.gradle.api.JavaVersion.VERSION_17\nimport org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL\nimport java.net.URI\n\nplugins {\n  `java-library`\n  `java-test-fixtures`\n  jacoco\n  signing\n  `maven-publish`\n  id(\"com.diffplug.spotless\")\n  id(\"com.github.johnrengelman.shadow\")\n  id(\"org.sonarqube\")\n  id(\"com.vanniktech.maven.publish.base\")\n}\n\ngroup = \"org.wiremock\"\nversion = \"4.0.0-beta.30\"\n\nrepositories {\n  mavenCentral()\n}\n\njava {\n  sourceCompatibility = VERSION_17\n  targetCompatibility = VERSION_17\n  withSourcesJar()\n  withJavadocJar()\n}\n\ntasks.jar {\n  manifest {\n    attributes(\"Add-Exports\" to \"java.base/sun.security.x509\")\n    attributes(\"Implementation-Version\" to project.version)\n    attributes(\"Implementation-Title\" to \"WireMock\")\n  }\n}\n\nval runningOnCI = System.getenv(\"CI\") == \"true\"\n\ntasks {\n\n  withType<JavaCompile>().configureEach {\n    options.encoding = \"UTF-8\"\n    options.compilerArgs.addAll(listOf(\n      \"-XDenableSunApiLintControl\",\n      \"--add-exports=java.base/sun.security.x509=ALL-UNNAMED\",\n    ))\n  }\n\n  compileTestFixturesJava {\n    options.encoding = \"UTF-8\"\n  }\n\n  test {\n    // Set the timezone for testing somewhere other than my machine to increase the chances of catching timezone bugs\n    systemProperty(\"user.timezone\", \"Australia/Sydney\")\n\n    useJUnitPlatform()\n    exclude(\"ignored/**\")\n\n    maxParallelForks = if (runningOnCI) 1 else 3\n\n    testLogging {\n      events(\"FAILED\", \"SKIPPED\")\n      exceptionFormat = FULL\n    }\n\n    finalizedBy(jacocoTestReport)\n  }\n\n  jacocoTestReport {\n    reports {\n      xml.required = true\n    }\n  }\n\n  sonarqube {\n    properties {\n      property( \"sonar.projectKey\", \"wiremock_wiremock\")\n      property( \"sonar.organization\", \"wiremock\")\n      property( \"sonar.host.url\", \"https://sonarcloud.io\")\n    }\n  }\n\n  shadowJar {\n    dependsOn(jar)\n  }\n}\n\ntasks.withType<Test>().configureEach {\n  useJUnitPlatform()\n}\n\n// Check if we're in a git worktree (where .git is a file, not a directory)\nfun isGitWorktree(): Boolean {\n  return try {\n    val gitFile = file(\"$rootDir/.git\")\n    gitFile.exists() && gitFile.isFile\n  } catch (e: Exception) {\n    false\n  }\n}\n\nval inWorktree = isGitWorktree()\nval spotlessEnabled = providers.gradleProperty(\"spotless.enabled\")\n  .map { it.toBoolean() }\n  .orElse(!inWorktree) // Auto-disable in worktrees unless explicitly enabled\n  .get()\n\nif (spotlessEnabled) {\n  spotless {\n    java {\n      target(\"src/**/*.java\")\n      googleJavaFormat(\"1.17.0\")\n      licenseHeaderFile(\"$rootDir/gradle/spotless.java.license.txt\")\n      ratchetFrom(\"origin/master\")\n      trimTrailingWhitespace()\n      endWithNewline()\n      targetExclude(\"**/Tmp*.java\")\n    }\n    kotlinGradle {\n      target(\"**/*.gradle.kts\")\n      targetExclude(\"**/build/**\")\n      indentWithSpaces(2)\n      trimTrailingWhitespace()\n      endWithNewline()\n    }\n    groovyGradle {\n      target(\"**/*.gradle\")\n      greclipse()\n      indentWithSpaces(2)\n      trimTrailingWhitespace()\n      endWithNewline()\n    }\n    json {\n      target(\"src/**/*.json\")\n      targetExclude(\n        \"**/tmp*.json\",\n        \"src/test/resources/sample.json\",\n        \"src/main/resources/swagger/*.json\",\n        \"src/test/resources/filesource/subdir/deepfile.json\",\n        \"src/test/resources/schema-validation/*.json\",\n        \"src/test/resources/test-file-root/mappings/testjsonmapping.json\",\n        \"src/test/resources/message-stub-test/*.json\",\n        \"src/main/resources/assets/swagger-ui/swagger-ui-dist/package.json\"\n      )\n      gson().indentWithSpaces(2)\n    }\n  }\n} else {\n  logger.lifecycle(\"Spotless is disabled (git worktree detected or spotless.enabled=false)\")\n}\n\ntasks.withType<AbstractArchiveTask>().configureEach {\n  isPreserveFileTimestamps = false\n  isReproducibleFileOrder = true\n}\n\nfun MavenPom.pomInfo() {\n  url.set(\"https://wiremock.org\")\n  scm {\n    connection.set(\"https://github.com/wiremock/wiremock.git\")\n    developerConnection.set(\"https://github.com/wiremock/wiremock.git\")\n    url.set(\"https://github.com/wiremock/wiremock\")\n  }\n  licenses {\n    license {\n      name.set(\"The Apache Software License, Version 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(\"tomakehurst\")\n      name.set(\"Tom Akehurst\")\n    }\n  }\n}\n\ntasks.javadoc {\n  exclude(\"**/CertificateAuthority.java\")\n  options.quiet()\n  (options as StandardJavadocDocletOptions)\n    .addBooleanOption(\"Xdoclint:none\", true)\n}\n\nsigning {\n  isRequired = !version.toString().contains(\"SNAPSHOT\") && (gradle.taskGraph.hasTask(\"uploadArchives\") || gradle.taskGraph.hasTask(\"publish\"))\n  val signingKey = providers.environmentVariable(\"OSSRH_GPG_SECRET_KEY\").orElse(\"\").get()\n  val signingPassphrase = providers.environmentVariable(\"OSSRH_GPG_SECRET_KEY_PASSWORD\").orElse(\"\").get()\n  if (signingKey.isNotEmpty() && signingPassphrase.isNotEmpty()) {\n    useInMemoryPgpKeys(signingKey, signingPassphrase)\n  }\n  sign(publishing.publications)\n}\n\npublishing {\n  repositories {\n    maven {\n      name = \"GitHubPackages\"\n      url = URI.create(\"https://maven.pkg.github.com/wiremock/wiremock\")\n      credentials {\n        username = System.getenv(\"GITHUB_ACTOR\")\n        password = System.getenv(\"GITHUB_TOKEN\")\n      }\n    }\n  }\n\n  getComponents().withType<AdhocComponentWithVariants>().forEach { c ->\n    c.withVariantsFromConfiguration(configurations.shadowRuntimeElements.get()) {\n      skip()\n    }\n  }\n\n  publications {\n    withType<MavenPublication> {\n      pom {\n        pomInfo()\n      }\n      suppressPomMetadataWarningsFor(\"testFixturesApiElements\")\n      suppressPomMetadataWarningsFor(\"testFixturesRuntimeElements\")\n    }\n  }\n}\n\nmavenPublishing {\n  publishToMavenCentral(automaticRelease = true)\n}\n"
  },
  {
    "path": "gradle/libs.versions.toml",
    "content": "[versions]\njetty = \"12.1.7\"\njackson = \"2.21.1\"\nxmlUnit = \"2.11.0\"\njsonUnit = \"5.1.1\"\njunitJupiter = \"5.14.3\"\nhandlebars = \"4.5.0\"\nslf4j = \"2.0.17\"\nhamcrest = \"3.0\"\nmockito = \"5.23.0\"\njmh = \"1.37\"\napache-http5 = \"5.4.3\"\narchunit = \"1.4.1\"\n\n[libraries]\n# Jetty dependencies\njetty-bom = { module = \"org.eclipse.jetty:jetty-bom\", version.ref = \"jetty\" }\njetty-ee11-bom = { module = \"org.eclipse.jetty.ee11:jetty-ee11-bom\", version.ref = \"jetty\" }\njetty-server = { module = \"org.eclipse.jetty:jetty-server\" }\njetty-proxy = { module = \"org.eclipse.jetty:jetty-proxy\" }\njetty-http2-server = { module = \"org.eclipse.jetty.http2:jetty-http2-server\" }\njetty-alpn-server = { module = \"org.eclipse.jetty:jetty-alpn-server\" }\njetty-alpn-java-server = { module = \"org.eclipse.jetty:jetty-alpn-java-server\" }\njetty-alpn-java-client = { module = \"org.eclipse.jetty:jetty-alpn-java-client\" }\njetty-alpn-client = { module = \"org.eclipse.jetty:jetty-alpn-client\" }\njetty-ee11-servlet = { module = \"org.eclipse.jetty.ee11:jetty-ee11-servlet\" }\njetty-ee11-servlets = { module = \"org.eclipse.jetty.ee11:jetty-ee11-servlets\" }\njetty-ee11-webapp = { module = \"org.eclipse.jetty.ee11:jetty-ee11-webapp\" }\njetty-ee11-websockets = { module = \"org.eclipse.jetty.ee11.websocket:jetty-ee11-websocket-jakarta-server\" }\njetty-ee11-websocket-jetty-server = { module = \"org.eclipse.jetty.ee11.websocket:jetty-ee11-websocket-jetty-server\" }\njetty-websocket-jetty-api = { module = \"org.eclipse.jetty.websocket:jetty-websocket-jetty-api\" }\n\njetty-client = { module = \"org.eclipse.jetty:jetty-client\" }\njetty-http2-client = { module = \"org.eclipse.jetty.http2:jetty-http2-client\" }\njetty-http2-client-transport = { module = \"org.eclipse.jetty.http2:jetty-http2-client-transport\" }\njetty-http2-common = { module = \"org.eclipse.jetty.http2:jetty-http2-common\" }\njetty-http = { module = \"org.eclipse.jetty:jetty-http\" }\njetty-io = { module = \"org.eclipse.jetty:jetty-io\" }\njetty-util = { module = \"org.eclipse.jetty:jetty-util\" }\n\n# Apache Commons dependencies\napache-commons-text = { module = \"org.apache.commons:commons-text\", version = \"1.15.0\" }\n# Jackson dependencies\njackson-bom = { module = \"com.fasterxml.jackson:jackson-bom\", version.ref = \"jackson\" }\njackson-core = { module = \"com.fasterxml.jackson.core:jackson-core\" }\njackson-annotations = { module = \"com.fasterxml.jackson.core:jackson-annotations\" }\njackson-databind = { module = \"com.fasterxml.jackson.core:jackson-databind\" }\njackson-datatype-jsr310 = { module = \"com.fasterxml.jackson.datatype:jackson-datatype-jsr310\" }\n\n# Guava\nguava = { module = \"com.google.guava:guava\", version = \"33.5.0-jre\" }\n\n# HTTP Client\napache-http5-client = { module = \"org.apache.httpcomponents.client5:httpclient5\", version = \"5.6\" }\napache-http5-core = { module = \"org.apache.httpcomponents.core5:httpcore5\", version = \"5.4.2\" }\n\n# OkHttp\nokhttp-bom = { module = \"com.squareup.okhttp3:okhttp-bom\", version = \"5.3.2\" }\nokhttp = { module = \"com.squareup.okhttp3:okhttp\" }\n\nokio = { module = \"com.squareup.okio:okio\", version = \"3.17.0\" }\n\n# XML Unit\nxmlunit-core = { module = \"org.xmlunit:xmlunit-core\", version.ref = \"xmlUnit\" }\nxmlunit-legacy = { module = \"org.xmlunit:xmlunit-legacy\", version.ref = \"xmlUnit\" }\nxmlunit-placeholders = { module = \"org.xmlunit:xmlunit-placeholders\", version.ref = \"xmlUnit\" }\n\n# JSON Unit\njson-unit-core = { module = \"net.javacrumbs.json-unit:json-unit-core\", version.ref = \"jsonUnit\" }\njson-unit = { module = \"net.javacrumbs.json-unit:json-unit\", version.ref = \"jsonUnit\" }\n\n# JSON Path\njson-path = { module = \"com.jayway.jsonpath:json-path\", version = \"3.0.0\" }\njson-smart = { module = \"net.minidev:json-smart\", version = \"2.6.0\" }\n\n# SLF4J\nslf4j-api = { module = \"org.slf4j:slf4j-api\", version.ref = \"slf4j\" }\nslf4j-nop = { module = \"org.slf4j:slf4j-nop\", version.ref = \"slf4j\" }\n\n# Command line options\njopt-simple = { module = \"net.sf.jopt-simple:jopt-simple\", version = \"5.0.4\" }\n\n# JUnit\njunit4 = { module = \"junit:junit\", version = \"4.13.2\" }\njunit-bom = { module = \"org.junit:junit-bom\", version.ref = \"junitJupiter\" }\njunit-jupiter = { module = \"org.junit.jupiter:junit-jupiter\" }\njunit-jupiter-api = { module = \"org.junit.jupiter:junit-jupiter-api\" }\njunit-jupiter-params = { module = \"org.junit.jupiter:junit-jupiter-params\" }\njunit-platform-testkit = { module = \"org.junit.platform:junit-platform-testkit\" }\njunit-platform-launcher = { module = \"org.junit.platform:junit-platform-launcher\" }\njunit-platform-engine = { module = \"org.junit.platform:junit-platform-engine\" }\njunit-platform-commons = { module = \"org.junit.platform:junit-platform-commons\" }\njunit-vintage-engine = { module = \"org.junit.vintage:junit-vintage-engine\" }\njunit-pioneer = { module = \"org.junit-pioneer:junit-pioneer\", version = \"2.3.0\" }\n\n# Handlebars\nhandlebars = { module = \"com.github.jknack:handlebars\", version.ref = \"handlebars\" }\nhandlebars-helpers = { module = \"com.github.jknack:handlebars-helpers\", version.ref = \"handlebars\" }\n\n# File upload\ncommons-fileupload = { module = \"commons-fileupload:commons-fileupload\", version = \"1.6.0\" }\n\n# JSON Schema\njson-schema-validator = { module = \"com.networknt:json-schema-validator\", version = \"1.5.9\" }\n\n# Testing\nhamcrest = { module = \"org.hamcrest:hamcrest\", version.ref = \"hamcrest\" }\nhamcrest-core = { module = \"org.hamcrest:hamcrest-core\", version.ref = \"hamcrest\" }\nhamcrest-library = { module = \"org.hamcrest:hamcrest-library\", version.ref = \"hamcrest\" }\nmockito-core = { module = \"org.mockito:mockito-core\", version.ref = \"mockito\" }\nmockito-junit-jupiter = { module = \"org.mockito:mockito-junit-jupiter\", version.ref = \"mockito\" }\njsonassert = { module = \"org.skyscreamer:jsonassert\", version = \"1.5.3\" }\njsonassert-toomuchcoding = { module = \"com.toomuchcoding.jsonassert:jsonassert\", version = \"0.8.0\" }\nawaitility = { module = \"org.awaitility:awaitility\", version = \"4.3.0\" }\ncommons-io = { module = \"commons-io:commons-io\", version = \"2.21.0\" }\ncommons-lang = { module = \"org.apache.commons:commons-lang3\", version = \"3.20.0\" }\nscala-library = { module = \"org.scala-lang:scala-library\", version = \"2.13.18\" }\narchunit = { module = \"com.tngtech.archunit:archunit\", version.ref = \"archunit\" }\narchunit-junit5 = { module = \"com.tngtech.archunit:archunit-junit5\", version.ref = \"archunit\" }\narchunit-junit5-api = { module = \"com.tngtech.archunit:archunit-junit5-api\", version.ref = \"archunit\" }\nandroid-json = { module = \"com.vaadin.external.google:android-json\", version = \"0.0.20131108.vaadin1\" }\nassertj-core = { module = \"org.assertj:assertj-core\", version = \"3.27.7\" }\n\n# JMH\njmh-core = { module = \"org.openjdk.jmh:jmh-core\", version.ref = \"jmh\" }\njmh-generator-annprocess = { module = \"org.openjdk.jmh:jmh-generator-annprocess\", version.ref = \"jmh\" }\n\njakarta-servlet-api = { module = \"jakarta.servlet:jakarta.servlet-api\", version = \"6.1.0\" }\njakarta-websockets = { module = \"jakarta.websocket:jakarta.websocket-client-api\", version=\"2.2.0\" }\n\njspecify = { module = \"org.jspecify:jspecify\", version = \"1.0.0\" }\n\n[plugins]\nnexus-publish = { id = \"io.github.gradle-nexus.publish-plugin\", version = \"2.0.0\" }\nspotless = { id = \"com.diffplug.spotless\", version = \"8.4.0\" }\nshadow = { id = \"com.github.johnrengelman.shadow\", version = \"8.1.1\" }\nsonarqube = { id = \"org.sonarqube\", version = \"7.2.3.7755\" }\njmh = { id = \"me.champeau.jmh\", version = \"0.7.3\" }\ntask-tree = { id = \"com.dorongold.task-tree\", version = \"4.0.1\" }\n"
  },
  {
    "path": "gradle/spotless.java.license.txt",
    "content": "/*\n * Copyright (C) $YEAR Thomas Akehurst\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 */\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.14.3-bin.zip\nnetworkTimeout=10000\nvalidateDistributionUrl=true\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "gradle.properties",
    "content": "org.gradle.jvmargs=-Xmx3g -Dfile.encoding=UTF-8\norg.gradle.parallel=true\norg.gradle.workers.max=4\nsystemProp.org.gradle.internal.http.connectionTimeout=120000\nsystemProp.org.gradle.internal.http.socketTimeout=120000\n\n# Spotless code formatting\n# By default, Spotless is automatically disabled in git worktrees (due to a plugin bug)\n# Uncomment and set to true/false to explicitly enable/disable Spotless:\n# spotless.enabled=true"
  },
  {
    "path": "gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 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\nCLASSPATH=\"\\\\\\\"\\\\\\\"\"\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    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\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        -classpath \"$CLASSPATH\" \\\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\nset CLASSPATH=\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%\" -classpath \"%CLASSPATH%\" -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": "jdepend.xsl",
    "content": "<!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->\n<xsl:stylesheet\txmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n\n    <!--\n       Copyright 2002-2004   Apache Software Foundation\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\n     -->\n\n    <xsl:output method=\"html\" indent=\"yes\"/>\n\n    <xsl:template match=\"JDepend\">\n        <html>\n            <head>\n                <title>JDepend Analysis</title>\n\n                <style type=\"text/css\">\n                    body {\n                    font:normal 68% verdana,arial,helvetica;\n                    color:#000000;\n                    }\n                    table tr td, tr th {\n                    font-size: 68%;\n                    }\n                    table.details tr th{\n                    font-weight: bold;\n                    text-align:left;\n                    background:#a6caf0;\n                    }\n                    table.details tr td{\n                    background:#eeeee0;\n                    }\n\n                    p {\n                    line-height:1.5em;\n                    margin-top:0.5em; margin-bottom:1.0em;\n                    margin-left:2em;\n                    margin-right:2em;\n                    }\n                    h1 {\n                    margin: 0px 0px 5px; font: 165% verdana,arial,helvetica\n                    }\n                    h2 {\n                    margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica\n                    }\n                    h3 {\n                    margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica\n                    }\n                    h4 {\n                    margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica\n                    }\n                    h5 {\n                    margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica\n                    }\n                    h6 {\n                    margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica\n                    }\n                    .Error {\n                    font-weight:bold; color:red;\n                    }\n                    .Failure {\n                    font-weight:bold; color:purple;\n                    }\n                    .Properties {\n                    text-align:right;\n                    }\n                </style>\n\n\n            </head>\n            <body>\n                <!--h1>JDepend Report</h1>\n                <ul>\n                <xsl:for-each select=\"./Packages/Package\">\n                            <xsl:sort select=\"@name\"/>\n                    <li><xsl:value-of select=\"@name\"/></li>\n                </xsl:for-each>\n                </ul-->\n\n                <h1><a name=\"top\">JDepend Analysis</a></h1>\n                <p align=\"right\">Designed for use with <a href=\"http://www.clarkware.com/software/JDepend.html\">JDepend</a> and <a href=\"http://jakarta.apache.org\">Ant</a>.</p>\n                <hr size=\"2\" />\n\n                <table width=\"100%\"><tr><td>\n                    <a name=\"NVsummary\"><h2>Summary</h2></a>\n                </td><td align=\"right\">\n                    [<a href=\"#NVsummary\">summary</a>]\n                    [<a href=\"#NVpackages\">packages</a>]\n                    [<a href=\"#NVcycles\">cycles</a>]\n                    [<a href=\"#NVexplanations\">explanations</a>]\n                </td></tr></table>\n\n                <table width=\"100%\" class=\"details\">\n                    <tr>\n                        <th>Package</th>\n                        <th>Total Classes</th>\n                        <th><a href=\"#EXnumber\">Abstract Classes</a></th>\n                        <th><a href=\"#EXnumber\">Concrete Classes</a></th>\n                        <th><a href=\"#EXafferent\">Afferent Couplings</a></th>\n                        <th><a href=\"#EXefferent\">Efferent Couplings</a></th>\n                        <th><a href=\"#EXabstractness\">Abstractness</a></th>\n                        <th><a href=\"#EXinstability\">Instability</a></th>\n                        <th><a href=\"#EXdistance\">Distance</a></th>\n\n                    </tr>\n                    <xsl:for-each select=\"./Packages/Package\">\n                        <xsl:if test=\"count(error) = 0\">\n                            <tr>\n                                <td align=\"left\">\n                                    <a>\n                                        <xsl:attribute name=\"href\">#PK<xsl:value-of select=\"@name\"/>\n                                        </xsl:attribute>\n                                        <xsl:value-of select=\"@name\"/>\n                                    </a>\n                                </td>\n                                <td align=\"right\"><xsl:value-of select=\"Stats/TotalClasses\"/></td>\n                                <td align=\"right\"><xsl:value-of select=\"Stats/AbstractClasses\"/></td>\n                                <td align=\"right\"><xsl:value-of select=\"Stats/ConcreteClasses\"/></td>\n                                <td align=\"right\"><xsl:value-of select=\"Stats/Ca\"/></td>\n                                <td align=\"right\"><xsl:value-of select=\"Stats/Ce\"/></td>\n                                <td align=\"right\"><xsl:value-of select=\"Stats/A\"/></td>\n                                <td align=\"right\"><xsl:value-of select=\"Stats/I\"/></td>\n                                <td align=\"right\"><xsl:value-of select=\"Stats/D\"/></td>\n\n\n                            </tr>\n                        </xsl:if>\n                    </xsl:for-each>\n                    <xsl:for-each select=\"./Packages/Package\">\n                        <xsl:if test=\"count(error) &gt; 0\">\n                            <tr>\n                                <td align=\"left\">\n                                    <xsl:value-of select=\"@name\"/>\n                                </td>\n                                <td align=\"left\" colspan=\"8\"><xsl:value-of select=\"error\"/></td>\n                            </tr>\n                        </xsl:if>\n                    </xsl:for-each>\n                </table>\n\n                <table width=\"100%\"><tr><td>\n                    <a name=\"NVpackages\"><h2>Packages</h2></a>\n                </td><td align=\"right\">\n                    [<a href=\"#NVsummary\">summary</a>]\n                    [<a href=\"#NVpackages\">packages</a>]\n                    [<a href=\"#NVcycles\">cycles</a>]\n                    [<a href=\"#NVexplanations\">explanations</a>]\n                </td></tr></table>\n\n                <xsl:for-each select=\"./Packages/Package\">\n                    <xsl:if test=\"count(error) = 0\">\n                        <h3><a><xsl:attribute name=\"name\">PK<xsl:value-of select=\"@name\"/></xsl:attribute>\n                            <xsl:value-of select=\"@name\"/></a></h3>\n\n                        <table width=\"100%\"><tr>\n                            <td><a href=\"#EXafferent\">Afferent Couplings</a>: <xsl:value-of select=\"Stats/Ca\"/></td>\n                            <td><a href=\"#EXefferent\">Efferent Couplings</a>: <xsl:value-of select=\"Stats/Ce\"/></td>\n                            <td><a href=\"#EXabstractness\">Abstractness</a>: <xsl:value-of select=\"Stats/A\"/></td>\n                            <td><a href=\"#EXinstability\">Instability</a>: <xsl:value-of select=\"Stats/I\"/></td>\n                            <td><a href=\"#EXdistance\">Distance</a>: <xsl:value-of select=\"Stats/D\"/></td>\n                        </tr></table>\n\n                        <table width=\"100%\" class=\"details\">\n                            <tr>\n                                <th>Abstract Classes</th>\n                                <th>Concrete Classes</th>\n                                <th>Used by Packages</th>\n                                <th>Uses Packages</th>\n                            </tr>\n                            <tr>\n                                <td valign=\"top\" width=\"25%\">\n                                    <xsl:if test=\"count(AbstractClasses/Class)=0\">\n                                        <i>None</i>\n                                    </xsl:if>\n                                    <xsl:for-each select=\"AbstractClasses/Class\">\n                                        <xsl:value-of select=\"node()\"/><br/>\n                                    </xsl:for-each>\n                                </td>\n                                <td valign=\"top\" width=\"25%\">\n                                    <xsl:if test=\"count(ConcreteClasses/Class)=0\">\n                                        <i>None</i>\n                                    </xsl:if>\n                                    <xsl:for-each select=\"ConcreteClasses/Class\">\n                                        <xsl:value-of select=\"node()\"/><br/>\n                                    </xsl:for-each>\n                                </td>\n                                <td valign=\"top\" width=\"25%\">\n                                    <xsl:if test=\"count(UsedBy/Package)=0\">\n                                        <i>None</i>\n                                    </xsl:if>\n                                    <xsl:for-each select=\"UsedBy/Package\">\n                                        <a>\n                                            <xsl:attribute name=\"href\">#PK<xsl:value-of select=\"node()\"/></xsl:attribute>\n                                            <xsl:value-of select=\"node()\"/>\n                                        </a><br/>\n                                    </xsl:for-each>\n                                </td>\n                                <td valign=\"top\" width=\"25%\">\n                                    <xsl:if test=\"count(DependsUpon/Package)=0\">\n                                        <i>None</i>\n                                    </xsl:if>\n                                    <xsl:for-each select=\"DependsUpon/Package\">\n                                        <a>\n                                            <xsl:attribute name=\"href\">#PK<xsl:value-of select=\"node()\"/></xsl:attribute>\n                                            <xsl:value-of select=\"node()\"/>\n                                        </a><br/>\n                                    </xsl:for-each>\n                                </td>\n                            </tr>\n                        </table>\n                    </xsl:if>\n                </xsl:for-each>\n\n                <table width=\"100%\"><tr><td>\n                    <a name=\"NVcycles\"><h2>Cycles</h2></a>\n                </td><td align=\"right\">\n                    [<a href=\"#NVsummary\">summary</a>]\n                    [<a href=\"#NVpackages\">packages</a>]\n                    [<a href=\"#NVcycles\">cycles</a>]\n                    [<a href=\"#NVexplanations\">explanations</a>]\n                </td></tr></table>\n\n                <xsl:if test=\"count(Cycles/Package) = 0\">\n                    <p>There are no cyclic dependancies.</p>\n                </xsl:if>\n                <xsl:for-each select=\"Cycles/Package\">\n                    <h3><xsl:value-of select=\"@Name\"/></h3><p>\n                    <xsl:for-each select=\"Package\">\n                        <xsl:value-of select=\".\"/><br/>\n                    </xsl:for-each></p>\n                </xsl:for-each>\n\n                <table width=\"100%\"><tr><td>\n                    <a name=\"NVexplanations\"><h2>Explanations</h2></a>\n                </td><td align=\"right\">\n                    [<a href=\"#NVsummary\">summary</a>]\n                    [<a href=\"#NVpackages\">packages</a>]\n                    [<a href=\"#NVcycles\">cycles</a>]\n                    [<a href=\"#NVexplanations\">explanations</a>]\n                </td></tr></table>\n\n                <p>The following explanations are for quick reference and are lifted directly from the original <a href=\"http://www.clarkware.com/software/JDepend.html\">JDepend documentation</a>.</p>\n\n                <h3><a name=\"EXnumber\">Number of Classes</a></h3>\n                <p>The number of concrete and abstract classes (and interfaces) in the package is an indicator of the extensibility of the package.</p>\n                <h3><a name=\"EXafferent\">Afferent Couplings</a></h3>\n                <p>The number of other packages that depend upon classes within the package is an indicator of the package's responsibility. </p>\n                <h3><a name=\"EXefferent\">Efferent Couplings</a></h3>\n                <p>The number of other packages that the classes in the package depend upon is an indicator of the package's independence. </p>\n                <h3><a name=\"EXabstractness\">Abstractness</a></h3>\n                <p>The ratio of the number of abstract classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package. </p>\n                <p>The range for this metric is 0 to 1, with A=0 indicating a completely concrete package and A=1 indicating a completely abstract package. </p>\n                <h3><a name=\"EXinstability\">Instability</a></h3>\n                <p>The ratio of efferent coupling (Ce) to total coupling (Ce / (Ce + Ca)). This metric is an indicator of the package's resilience to change. </p>\n                <p>The range for this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely instable package. </p>\n                <h3><a name=\"EXdistance\">Distance</a></h3>\n                <p>The perpendicular distance of a package from the idealized line A + I = 1. This metric is an indicator of the package's balance between abstractness and stability. </p>\n                <p>A package squarely on the main sequence is optimally balanced with respect to its abstractness and stability. Ideal packages are either completely abstract and stable (x=0, y=1) or completely concrete and instable (x=1, y=0). </p>\n                <p>The range for this metric is 0 to 1, with D=0 indicating a package that is coincident with the main sequence and D=1 indicating a package that is as far from the main sequence as possible. </p>\n\n            </body>\n        </html>\n    </xsl:template>\n\n</xsl:stylesheet>"
  },
  {
    "path": "perf-test/.gitignore",
    "content": "# Compiled source #\n###################\n*.com\n*.class\n*.dll\n*.exe\n*.o\n*.so\n*.pyc\n\n# Logs and databases #\n######################\n*.log\n*.sql\n*.sqlite\n\n# OS generated files #\n######################\n.DS_Store?\nehthumbs.db\nIcon?\nThumbs.db\n\n# Maven/Eclipse #\n#################\nbuild\n.project\n.classpath\n.settings\n.gradle\n**/target\nclasses\n.gradletasknamecache\n\n# IDEA #\n#################\nout\n*.iml\n*.ipr\n*.iws\n**/*.iml\n.idea\n\n\n# Misc #\n########\ncopy-admin.sh\n.DS_Store\n**/.DS_Store\n\n.vagrant\ntmp*\n\nsrc/main/resources/swagger\ndocs-v2/_docs/wiremock-admin-api.html"
  },
  {
    "path": "perf-test/build.gradle",
    "content": "plugins {\n  id \"com.github.lkishalmi.gatling\" version \"0.7.1\"\n}\n\napply plugin: 'idea'\napply plugin: 'java'\napply plugin: 'scala'\n\nrepositories {\n  mavenLocal()\n  mavenCentral()\n  jcenter()\n}\n\ndependencies {\n  compile 'org.scala-lang:scala-library:2.11.8'\n  compile 'io.gatling.highcharts:gatling-charts-highcharts:2.3.0'\n  compile 'com.github.tomakehurst:wiremock:2.17.0'\n  gatlingCompile 'com.github.tomakehurst:wiremock:2.17.0'\n}\n\ntask wrapper(type: Wrapper) {\n  gradleVersion = '4.5.1'\n}\n\ngatling {\n  simulations { include \"**/*Simulation.scala\" }\n}\n"
  },
  {
    "path": "perf-test/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionUrl=https\\://services.gradle.org/distributions/gradle-4.5.1-bin.zip\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStorePath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\n"
  },
  {
    "path": "perf-test/gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\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=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\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    which java >/dev/null 2>&1 || 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.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "perf-test/gradlew.bat",
    "content": "@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\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\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=\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%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\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 init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windows variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"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\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "perf-test/src/gatling/resources/conf/gatling.conf",
    "content": "gatling {\n  http {\n    enableGA = false\n\n    ahc {\n      connectTimeout = 5000                               # Timeout when establishing a connection\n      handshakeTimeout = 5000                             # Timeout when performing TLS hashshake\n      pooledConnectionIdleTimeout = 30000                 # Timeout when a connection stays unused in the pool\n      readTimeout = 10000                                 # Timeout when a used connection stays idle\n      maxRetry = 0                                        # Number of times that a request should be tried again\n      requestTimeout = 10000                              # Timeout of the requests\n    }\n  }\n}\n"
  },
  {
    "path": "perf-test/src/gatling/scala/wiremock/StubbingAndVerifyingSimulation.scala",
    "content": "package wiremock\n\nimport io.gatling.core.Predef._\nimport io.gatling.http.Predef._\n\nimport scala.concurrent.duration._\n\nclass StubbingAndVerifyingSimulation extends Simulation {\n\n  val loadTestConfiguration = LoadTestConfiguration.fromEnvironment()\n\n  val random = scala.util.Random\n\n  before {\n    loadTestConfiguration.before()\n//    loadTestConfiguration.mixed100StubScenario()\n//    loadTestConfiguration.onlyGet6000StubScenario()\n    loadTestConfiguration.getLargeStubScenario()\n  }\n\n  after {\n    loadTestConfiguration.after()\n  }\n\n  val httpConf = http\n    .baseURL(loadTestConfiguration.getBaseUrl)\n\n  val mixed100StubScenario = {\n\n    scenario(\"Mixed 100\")\n          .repeat(1) {\n            exec(http(\"GETs\")\n                .get(session => s\"load-test/${random.nextInt(49) + 1}\")\n                .header(\"Accept\", \"text/plain+stuff\")\n                .check(status.is(200)))\n          }\n          .exec(http(\"JSON equality POSTs\")\n              .post(\"load-test/json\")\n              .header(\"Accept\", \"text/plain\")\n              .header(\"Content-Type\", \"application/json\")\n              .body(StringBody(LoadTestConfiguration.POSTED_JSON))\n              .check(status.is(200)))\n          .exec(http(\"JSONPath POSTs\")\n              .post(\"load-test/jsonpath\")\n              .header(\"Content-Type\", \"application/json\")\n              .body(StringBody(LoadTestConfiguration.JSON_FOR_JSON_PATH_MATCH))\n              .check(status.is(201)))\n//          .exec(http(\"XML equality POSTs\")\n//              .post(\"load-test/xml\")\n//              .header(\"Content-Type\", \"application/xml\")\n//              .body(StringBody(LoadTestConfiguration.POSTED_XML.replace(\"$1\", \"2\")))\n//              .check(status.is(200)))\n          .exec(http(\"XPath POSTs\")\n              .post(\"load-test/xpath\")\n              .header(\"Content-Type\", \"application/xml\")\n              .body(StringBody(LoadTestConfiguration.POSTED_XML.replace(\"$1\", String.valueOf(random.nextInt(10)))))\n              .check(status.is(200)))\n          .exec(http(\"Text POSTs\")\n              .post(\"load-test/text\")\n              .header(\"Content-Type\", \"text/plain\")\n              .body(StringBody(\"JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or 12345 integrity protected with a Message Authentication Code (MAC) and/or encrypted.\\n\"))\n              .check(status.is(200)))\n          .exec(http(\"Response templating\")\n              .put(\"load-test/templated\")\n              .header(\"MyDate\", \"2018-05-16T01:02:03Z\")\n              .body(StringBody(\"{\\n    \\\"outer\\\": {\\n        \\\"inner\\\": [1, 2, 3, 4]\\n    }\\n}\"))\n              .check(status.is(200)))\n  }\n\n  val onlyGet6000StubScenario = {\n    scenario(\"6000 GETs\")\n      .repeat(1) {\n        exec(http(\"GETs\")\n          .get(session => s\"load-test/${random.nextInt(5999) + 1}\")\n          .header(\"Accept\", \"text/plain+stuff\")\n          .check(status.is(200)))\n        .exec(http(\"Not founds\")\n          .get(session => s\"load-test/${random.nextInt(5999) + 7000}\")\n          .header(\"Accept\", \"text/plain+stuff\")\n          .check(status.is(404)))\n      }\n  }\n\n  val getLargeStubsScenario = {\n    scenario(\"100 large GETs\")\n      .repeat(1) {\n        exec(http(\"GETs\")\n          .get(session => s\"load-test/${random.nextInt(99) + 1}\")\n          .header(\"Accept\", \"text/plain+stuff\")\n          .check(status.is(200)))\n      }\n  }\n\n  setUp(\n//    mixed100StubScenario.inject(constantUsersPerSec(loadTestConfiguration.getRate) during(loadTestConfiguration.getDurationSeconds seconds))\n//    onlyGet6000StubScenario.inject(constantUsersPerSec(loadTestConfiguration.getRate) during(loadTestConfiguration.getDurationSeconds seconds))\n    getLargeStubsScenario.inject(constantUsersPerSec(loadTestConfiguration.getRate) during(loadTestConfiguration.getDurationSeconds seconds))\n  ).protocols(httpConf)\n\n}"
  },
  {
    "path": "perf-test/src/main/java/wiremock/LoadTestConfiguration.java",
    "content": "package wiremock;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Slf4jNotifier;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.DelayDistribution;\nimport com.github.tomakehurst.wiremock.http.UniformDistribution;\nimport com.github.tomakehurst.wiremock.junit.Stubbing;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.Future;\nimport java.util.concurrent.TimeUnit;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static java.util.concurrent.TimeUnit.SECONDS;\n\npublic class LoadTestConfiguration {\n\n    private WireMockServer wireMockServer;\n    private WireMock wm;\n\n    private String host;\n    private Integer port;\n    private int durationSeconds;\n    private int rate;\n\n    public static LoadTestConfiguration fromEnvironment() {\n        String host = System.getenv(\"HOST\");\n        Integer port = envInt(\"PORT\", null);\n        int durationSeconds = envInt(\"DURATION_SECONDS\", 10);\n        int rate = envInt(\"RATE\", 200);\n\n        return new LoadTestConfiguration(host, port, durationSeconds, rate);\n    }\n\n    private static Integer envInt(String key, Integer defaultValue) {\n        String valString = System.getenv(key);\n        return valString != null ? Integer.parseInt(valString) : defaultValue;\n    }\n\n    public LoadTestConfiguration() {\n        this(null, null, 10, 200);\n    }\n\n    public LoadTestConfiguration(String host, Integer port, int durationSeconds, int rate) {\n        System.out.println(\"Running test against host \" + host + \", for \" + durationSeconds + \" seconds at rate \" + rate);\n\n        if (host == null || port == null) {\n            wireMockServer = new WireMockServer(WireMockConfiguration.options()\n                    .dynamicPort()\n                    .dynamicHttpsPort()\n                    .asynchronousResponseEnabled(true)\n                    .asynchronousResponseThreads(50)\n                    .containerThreads(50)\n                    .maxRequestJournalEntries(1000)\n                    .notifier(new Slf4jNotifier(false))\n                    .extensions(new ResponseTemplateTransformer(false)));\n            wireMockServer.start();\n            wm = new WireMock(wireMockServer);\n        } else {\n            this.host = host;\n            this.port = port;\n            wm = new WireMock(host, port);\n        }\n\n        this.durationSeconds = durationSeconds;\n        this.rate = rate;\n    }\n\n    public void before() {\n        wm.resetToDefaultMappings();\n    }\n\n    public void onlyGet6000StubScenario() {\n        System.out.println(\"Registering stubs\");\n\n        ExecutorService executorService = Executors.newFixedThreadPool(100);\n\n        wm.register(any(anyUrl()).atPriority(10)\n            .willReturn(notFound())\n        );\n\n        List<Future<?>> futures = new ArrayList<>();\n        for (int i = 1; i <= 6000; i++) {\n            final int count = i;\n            futures.add(executorService.submit(new Runnable() {\n                @Override\n                public void run() {\n                    wm.register(get(\"/load-test/\" + count)\n                            .willReturn(ok(randomAscii(2000, 5000))));\n\n                    if (count % 100 == 0) {\n                        System.out.print(count + \" \");\n                    }\n\n                }\n            }));\n\n        }\n\n        for (Future<?> future: futures) {\n            try {\n                future.get(30, SECONDS);\n            } catch (Exception e) {\n                e.printStackTrace();\n            }\n        }\n\n        executorService.shutdown();\n    }\n\n    public void getLargeStubScenario() {\n        System.out.println(\"Registering stubs\");\n\n        ExecutorService executorService = Executors.newFixedThreadPool(10);\n\n        wm.register(any(anyUrl()).atPriority(10)\n                .willReturn(notFound())\n        );\n\n        List<Future<?>> futures = new ArrayList<>();\n        for (int i = 1; i <= 100; i++) {\n            final int count = i;\n            futures.add(executorService.submit(new Runnable() {\n                @Override\n                public void run() {\n                    wm.register(get(\"/load-test/\" + count)\n                            .willReturn(ok(randomAscii(50000, 90000))));\n\n                    if (count % 100 == 0) {\n                        System.out.print(count + \" \");\n                    }\n\n                }\n            }));\n\n        }\n\n        for (Future<?> future: futures) {\n            try {\n                future.get(30, SECONDS);\n            } catch (Exception e) {\n                e.printStackTrace();\n            }\n        }\n\n        executorService.shutdown();\n    }\n\n    public void mixed100StubScenario() {\n        // TODO: Optionally add delay\n        wm.setGlobalRandomDelayVariable(new UniformDistribution(100, 2000));\n\n        // Basic GET\n        for (int i = 1; i <= 50; i++) {\n            wm.register(get(\"/load-test/\" + i)\n                .withHeader(\"Accept\", containing(\"text/plain\"))\n                .willReturn(ok(randomAscii(1, 2000))));\n        }\n\n        // POST JSON equality\n        for (int i = 1; i <= 10; i++) {\n            wm.register(post(\"/load-test/json\")\n                .withHeader(\"Accept\", equalTo(\"text/plain\"))\n                .withHeader(\"Content-Type\", matching(\".*/json\"))\n                .withRequestBody(equalToJson(POSTED_JSON))\n                .willReturn(ok(randomAscii(i * 200))));\n        }\n\n        // POST JSONPath\n        for (int i = 1; i <= 10; i++) {\n            wm.register(post(\"/load-test/jsonpath\")\n                .withHeader(\"Content-Type\", equalTo(\"application/json\"))\n                .withRequestBody(matchingJsonPath(\"$.matchThis.inner.innermost\", equalTo(\"42\")))\n                .willReturn(created()));\n        }\n\n        // POST XML equality\n        for (int i = 1; i <= 2; i++) {\n            wm.register(post(\"/load-test/xml\")\n                .withHeader(\"Content-Type\", matching(\".*/xml.*\"))\n                .withRequestBody(equalToXml(POSTED_XML.replace(\"$1\", String.valueOf(i))))\n                .willReturn(ok(randomAscii(i * 200))));\n        }\n\n        // POST XML XPath\n        for (int i = 1; i <= 10; i++) {\n            wm.register(post(\"/load-test/xpath\")\n                .withHeader(\"Content-Type\", matching(\".*/xml.*\"))\n//                .withRequestBody(matchingXPath(\"//description[@subject = 'JWT']/text()\", containing(\"JSON Web Token\")))\n                .withRequestBody(matchingXPath(\"//description/text()\", containing(\"JSON Web Token\")))\n                .willReturn(ok(randomAscii(i * 200))));\n        }\n\n        // POST text body regex\n        for (int i = 1; i <= 10; i++) {\n            wm.register(post(\"/load-test/text\")\n                .withHeader(\"Content-Type\", matching(\".*text/plain.*\"))\n                .withRequestBody(matching(\".*[0-9]{5}.*\"))\n                .willReturn(ok(randomAscii(i * 200))));\n        }\n\n        // TODO: Response templating\n        wm.register(put(\"/load-test/templated\")\n            .willReturn(ok(TEMPLATED_RESPONSE).withTransformers(\"response-template\")));\n\n    }\n\n    public void after() {\n        if (wireMockServer != null) {\n            wireMockServer.stop();\n        }\n    }\n\n    public String getHost() {\n        return host != null ? host : \"localhost\";\n    }\n\n    public int getPort() {\n        return port != null ? port : wireMockServer.port();\n    }\n\n    public String getBaseUrl() {\n        return String.format(\"http://%s:%d/\", host, port);\n    }\n\n    public int getDurationSeconds() {\n        return durationSeconds;\n    }\n\n    public int getRate() {\n        return rate;\n    }\n\n    public static final String POSTED_JSON = \"{\\n\" +\n        \"    \\\"things\\\": [\\n\" +\n        \"        {\\n\" +\n        \"            \\\"name\\\": \\\"First\\\",\\n\" +\n        \"            \\\"value\\\": 111\\n\" +\n        \"        },\\n\" +\n        \"        {\\n\" +\n        \"            \\\"name\\\": \\\"Second\\\",\\n\" +\n        \"            \\\"value\\\": 22222\\n\" +\n        \"        },\\n\" +\n        \"        {\\n\" +\n        \"            \\\"name\\\": \\\"Third\\\",\\n\" +\n        \"            \\\"value\\\": 111\\n\" +\n        \"        },\\n\" +\n        \"        {\\n\" +\n        \"            \\\"name\\\": \\\"Fourth\\\",\\n\" +\n        \"            \\\"value\\\": 555\\n\" +\n        \"        }\\n\" +\n        \"    ],\\n\" +\n        \"    \\\"meta\\\": {\\n\" +\n        \"        \\\"countOfThings\\\": 4,\\n\" +\n        \"        \\\"tags\\\": [\\\"one\\\", \\\"two\\\"]\\n\" +\n        \"    }\\n\" +\n        \"}\";\n\n    public static final String JSON_FOR_JSON_PATH_MATCH = \"{\\n\" +\n        \"    \\\"matchThis\\\": {\\n\" +\n        \"        \\\"inner\\\": {\\n\" +\n        \"            \\\"innermost\\\": 42\\n\" +\n        \"        }\\n\" +\n        \"    }\\n\" +\n        \"}\";\n\n    public static final String POSTED_XML = \"<?xml version=\\\"1.0\\\"?>\\n\" +\n            \"\\n\" +\n            \"<things id=\\\"$1\\\">\\n\" +\n            \"    <stuff id=\\\"1\\\"/>\\n\" +\n            \"    <fluff id=\\\"2\\\"/>\\n\" +\n            \"\\n\" +\n            \"    <inside>\\n\" +\n            \"        <deep-inside level=\\\"3\\\">\\n\" +\n            \"            <one/>\\n\" +\n            \"            <two/>\\n\" +\n            \"            <three/>\\n\" +\n            \"            <four/>\\n\" +\n            \"            <one/>\\n\" +\n            \"            <description subject=\\\"JWT\\\">\\n\" +\n            \"                JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or integrity protected with a Message Authentication Code (MAC) and/or encrypted.\\n\" +\n            \"            </description>\\n\" +\n            \"        </deep-inside>\\n\" +\n            \"    </inside>\\n\" +\n            \"\\n\" +\n            \"</things>\";\n\n    public static final String TEMPLATED_RESPONSE = \"Templated response\\n\" +\n            \"==================\\n\" +\n            \"\\n\" +\n            \"{{date offset=\\\"-5 months\\\" format=\\\"yyyy-MM-dd\\\"}}\\n\" +\n            \"\\n\" +\n            \"{{date (parseDate request.headers.MyDate) timezone='Australia/Sydney'}}\\n\" +\n            \"\\n\" +\n            \"{{randomValue length=36 type='ALPHANUMERIC_AND_SYMBOLS'}}\\n\" +\n            \"\\n\" +\n            \"{{jsonPath request.body '$..inner'}}\";\n}\n"
  },
  {
    "path": "perf-test/src/main/resources/logback.xml",
    "content": "<configuration>\n\n    <appender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\">\n        <encoder>\n            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>\n        </encoder>\n    </appender>\n\n    <root level=\"WARN\">\n        <appender-ref ref=\"STDOUT\" />\n    </root>\n</configuration>"
  },
  {
    "path": "sample-war/build.gradle",
    "content": "apply plugin: 'java'\napply plugin: 'eclipse'\napply plugin: 'war'\napply plugin: 'maven'\n\nsourceCompatibility = 1.6\ngroup = 'com.github.tomakehurst'\nversion = 1\n\nrepositories {\n  mavenCentral()\n  mavenLocal()\n}\n\ndependencies {\n  compile \"javax.servlet:servlet-api:2.4\"\n  compile \"log4j:log4j:1.2.16\"\n  compile \"com.github.tomakehurst:wiremock:2.1.6\"\n}\n"
  },
  {
    "path": "sample-war/src/main/webapp/WEB-INF/web.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<web-app id=\"WebApp_9\" version=\"2.4\" xmlns=\"http://java.sun.com/xml/ns/j2ee\" \n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n\txsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n  \n  <listener>\n  \t<display-name>wiremock-startup-listener</display-name>\n  \t<listener-class>com.github.tomakehurst.wiremock.jetty.servlet.WireMockWebContextListener</listener-class>\n  \t<description>Loads WireMock and populates the servlet context with its services</description>\n  </listener>\n  \n  <context-param>\n  \t<param-name>WireMockFileSourceRoot</param-name>\n  \t<param-value>/WEB-INF/wiremock</param-value>\n  </context-param>\n\n  <context-param>\n    <param-name>verboseLoggingEnabled</param-name>\n    <param-value>false</param-value>\n  </context-param>\n\n\n  <servlet>\n  \t<servlet-name>wiremock-mock-service-handler-servlet</servlet-name>\n  \t<servlet-class>com.github.tomakehurst.wiremock.jetty.WireMockHandlerDispatchingServlet</servlet-class>\n  \t<init-param>\n  \t\t<param-name>RequestHandlerClass</param-name>\n  \t\t<param-value>com.github.tomakehurst.wiremock.http.StubRequestHandler</param-value>\n  \t</init-param>\n  </servlet>\n  <servlet-mapping>\n  \t<servlet-name>wiremock-mock-service-handler-servlet</servlet-name>\n  \t<url-pattern>/*</url-pattern>\n  </servlet-mapping>\n  \n  <servlet>\n  \t<servlet-name>wiremock-admin-handler-servlet</servlet-name>\n  \t<servlet-class>com.github.tomakehurst.wiremock.jetty.WireMockHandlerDispatchingServlet</servlet-class>\n  \t<init-param>\n  \t\t<param-name>RequestHandlerClass</param-name>\n  \t\t<param-value>com.github.tomakehurst.wiremock.http.AdminRequestHandler</param-value>\n  \t</init-param>\n  </servlet>\n  <servlet-mapping>\n  \t<servlet-name>wiremock-admin-handler-servlet</servlet-name>\n  \t<url-pattern>/__admin/*</url-pattern>\n  </servlet-mapping>\n  \n  <welcome-file-list>\n  \t<welcome-file>index.json</welcome-file>\n  \t<welcome-file>index.xml</welcome-file>\n  \t<welcome-file>index.html</welcome-file>\n  \t<welcome-file>index.txt</welcome-file>\n  </welcome-file-list>\n  \n  <mime-mapping>\n  \t<extension>json</extension>\n  \t<mime-type>application/json</mime-type>\n  </mime-mapping>\n  <mime-mapping>\n  \t<extension>xml</extension>\n  \t<mime-type>application/xml</mime-type>\n  </mime-mapping>\n  <mime-mapping>\n  \t<extension>html</extension>\n  \t<mime-type>text/html</mime-type>\n  </mime-mapping>\n  <mime-mapping>\n  \t<extension>txt</extension>\n  \t<mime-type>text/plain</mime-type>\n  </mime-mapping>\n  \n</web-app>"
  },
  {
    "path": "sample-war/src/main/webapp/WEB-INF/wiremock/__files/mytest.json",
    "content": "{\r\n    \"working\": \"YES\" \r\n}"
  },
  {
    "path": "sample-war/src/main/webapp/WEB-INF/wiremock/mappings/mytest-mapping.json",
    "content": "{        \r\n    \"request\": {                                    \r\n        \"method\": \"GET\",                        \r\n        \"urlPattern\": \"/api/mytest\"\r\n    },                                      \r\n    \"response\": {                                   \r\n        \"status\": 200,                          \r\n        \"bodyFileName\": \"mytest.json\",\r\n        \"headers\": {\r\n            \"Content-Type\": \"application/json\",\r\n            \"Cache-Control\": \"max-age=86400\"\r\n        }\r\n    }                                               \r\n}\r\n"
  },
  {
    "path": "sample-war/src/main/webappCustomMapping/WEB-INF/web.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<web-app id=\"WebApp_9\" version=\"2.4\" xmlns=\"http://java.sun.com/xml/ns/j2ee\" \n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n\txsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n\n    <!-- This is a way of integrating the wiremock servlet and mounting it under a path which is different\n     from the root path. For reference please use the version in the webapp folder. This version is stripped\n     down. -->\n  \n  <listener>\n  \t<display-name>wiremock-startup-listener</display-name>\n  \t<listener-class>com.github.tomakehurst.wiremock.jetty.servlet.WireMockWebContextListener</listener-class>\n  </listener>\n  \n  <context-param>\n  \t<param-name>WireMockFileSourceRoot</param-name>\n  \t<param-value>/WEB-INF/wiremock</param-value>\n  </context-param>\n\n  <context-param>\n    <param-name>verboseLoggingEnabled</param-name>\n    <param-value>false</param-value>\n  </context-param>\n\n\n  <servlet>\n  \t<servlet-name>wiremock-mock-service-handler-servlet</servlet-name>\n  \t<servlet-class>com.github.tomakehurst.wiremock.jetty.WireMockHandlerDispatchingServlet</servlet-class>\n  \t<init-param>\n  \t\t<param-name>RequestHandlerClass</param-name>\n  \t\t<param-value>com.github.tomakehurst.wiremock.http.StubRequestHandler</param-value>\n  \t</init-param>\n    <init-param>\n     <!-- A servlet mapping path may be specified to allow a mapping of wiremock to a different path.\n     This has to be equal to the servlet mappings (e.g. if the wiremock servlet is mapped under /mapping and\n     the wiremock admin servlet is mapped under /mapping/__admin then the correct value for this setting would be\n     /mapping) -->\n      <param-name>mappedUnder</param-name>\n      <param-value>/mapping</param-value>\n    </init-param>\n  </servlet>\n  <servlet-mapping>\n  \t<servlet-name>wiremock-mock-service-handler-servlet</servlet-name>\n  \t<url-pattern>/mapping/*</url-pattern>\n  </servlet-mapping>\n  \n  <servlet>\n  \t<servlet-name>wiremock-admin-handler-servlet</servlet-name>\n  \t<servlet-class>com.github.tomakehurst.wiremock.jetty.WireMockHandlerDispatchingServlet</servlet-class>\n  \t<init-param>\n  \t\t<param-name>RequestHandlerClass</param-name>\n  \t\t<param-value>com.github.tomakehurst.wiremock.http.AdminRequestHandler</param-value>\n  \t</init-param>\n    <init-param>\n      <!-- A servlet mapping path may be specified to allow a mapping of wiremock to a different path.\n      This has to be equal to the servlet mappings (e.g. if the wiremock servlet is mapped under /mapping and\n      the wiremock admin servlet is mapped under /mapping/__admin then the correct value for this setting would be\n      /mapping) -->\n      <param-name>mappedUnder</param-name>\n      <param-value>/mapping/__admin</param-value>\n    </init-param>\n  </servlet>\n  <servlet-mapping>\n  \t<servlet-name>wiremock-admin-handler-servlet</servlet-name>\n  \t<url-pattern>/mapping/__admin/*</url-pattern>\n  </servlet-mapping>\n</web-app>"
  },
  {
    "path": "sample-war/src/main/webappCustomMapping/WEB-INF/wiremock/__files/.gitignore",
    "content": ""
  },
  {
    "path": "sample-war/src/main/webappCustomMapping/WEB-INF/wiremock/mappings/.gitignore",
    "content": ""
  },
  {
    "path": "sample-war/src/main/webappLimitedRequestJournal/WEB-INF/web.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<web-app id=\"WebApp_9\" version=\"2.4\" xmlns=\"http://java.sun.com/xml/ns/j2ee\" \n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n\txsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\">\n\n    <!-- This is an example on how the request log size can be restricted in the web.xml configuration of a deployed\n    wiremock. -->\n  \n  <listener>\n  \t<display-name>wiremock-startup-listener</display-name>\n  \t<listener-class>com.github.tomakehurst.wiremock.jetty.servlet.WireMockWebContextListener</listener-class>\n  </listener>\n  \n  <context-param>\n  \t<param-name>WireMockFileSourceRoot</param-name>\n  \t<param-value>/WEB-INF/wiremock</param-value>\n  </context-param>\n\n  <context-param>\n    <param-name>verboseLoggingEnabled</param-name>\n    <param-value>false</param-value>\n  </context-param>\n  <!-- Restrict size of request journal -->\n  <context-param>\n    <param-name>maxRequestJournalEntries</param-name>\n    <param-value>2</param-value>\n  </context-param>\n\n  <servlet>\n  \t<servlet-name>wiremock-mock-service-handler-servlet</servlet-name>\n  \t<servlet-class>com.github.tomakehurst.wiremock.jetty.WireMockHandlerDispatchingServlet</servlet-class>\n  \t<init-param>\n  \t\t<param-name>RequestHandlerClass</param-name>\n  \t\t<param-value>com.github.tomakehurst.wiremock.http.StubRequestHandler</param-value>\n  \t</init-param>\n  </servlet>\n  <servlet-mapping>\n  \t<servlet-name>wiremock-mock-service-handler-servlet</servlet-name>\n  \t<url-pattern>/*</url-pattern>\n  </servlet-mapping>\n  \n  <servlet>\n  \t<servlet-name>wiremock-admin-handler-servlet</servlet-name>\n  \t<servlet-class>com.github.tomakehurst.wiremock.jetty.WireMockHandlerDispatchingServlet</servlet-class>\n  \t<init-param>\n  \t\t<param-name>RequestHandlerClass</param-name>\n  \t\t<param-value>com.github.tomakehurst.wiremock.http.AdminRequestHandler</param-value>\n  \t</init-param>\n  </servlet>\n  <servlet-mapping>\n  \t<servlet-name>wiremock-admin-handler-servlet</servlet-name>\n  \t<url-pattern>/__admin/*</url-pattern>\n  </servlet-mapping>\n</web-app>\n"
  },
  {
    "path": "sample-war/src/main/webappLimitedRequestJournal/WEB-INF/wiremock/__files/.gitignore",
    "content": ""
  },
  {
    "path": "sample-war/src/main/webappLimitedRequestJournal/WEB-INF/wiremock/mappings/.gitignore",
    "content": ""
  },
  {
    "path": "schemas/wiremock-message-stub-mapping-or-mappings.json",
    "content": "{\n  \"title\" : \"WireMock message stub mapping\",\n  \"type\" : \"object\",\n  \"$schema\" : \"http://json-schema.org/draft-07/schema#\",\n  \"definitions\" : {\n    \"absent-pattern\" : {\n      \"title\" : \"Absent matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"absent\" : {\n          \"type\" : \"boolean\"\n        }\n      },\n      \"required\" : [ \"absent\" ]\n    },\n    \"after-pattern\" : {\n      \"title\" : \"After datetime\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"after\" : {\n          \"$ref\" : \"#/definitions/dateTimeExpression\"\n        },\n        \"actualFormat\" : {\n          \"$ref\" : \"#/definitions/format\"\n        },\n        \"truncateExpected\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        },\n        \"truncateActual\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        }\n      },\n      \"required\" : [ \"after\" ]\n    },\n    \"and-pattern\" : {\n      \"title\" : \"Logical AND matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"and\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        }\n      },\n      \"required\" : [ \"and\" ]\n    },\n    \"bad-request-entity\" : {\n      \"title\" : \"Bad request entity\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"errors\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"code\" : {\n                \"type\" : \"integer\"\n              },\n              \"source\" : {\n                \"type\" : \"string\"\n              },\n              \"title\" : {\n                \"type\" : \"string\"\n              },\n              \"detail\" : {\n                \"type\" : \"string\"\n              }\n            }\n          }\n        }\n      }\n    },\n    \"base64-string\" : {\n      \"title\" : \"Base64 string\",\n      \"type\" : \"string\",\n      \"pattern\" : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$\",\n      \"description\" : \"A base64 encoded string used to describe binary data.\"\n    },\n    \"before-pattern\" : {\n      \"title\" : \"Before datetime\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"before\" : {\n          \"$ref\" : \"#/definitions/dateTimeExpression\"\n        },\n        \"actualFormat\" : {\n          \"$ref\" : \"#/definitions/format\"\n        },\n        \"truncateExpected\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        },\n        \"truncateActual\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        }\n      },\n      \"required\" : [ \"before\" ]\n    },\n    \"binary-equal-to-pattern\" : {\n      \"title\" : \"Binary equals\",\n      \"type\" : \"object\",\n      \"required\" : [ \"binaryEqualTo\" ],\n      \"properties\" : {\n        \"binaryEqualTo\" : {\n          \"$ref\" : \"#/definitions/base64-string\"\n        }\n      }\n    },\n    \"channel-pattern\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Pattern for matching message channels\",\n      \"required\" : [ \"type\" ],\n      \"properties\" : {\n        \"type\" : {\n          \"$ref\" : \"#/definitions/channel-type\"\n        },\n        \"initiatingRequestPattern\" : {\n          \"$ref\" : \"#/definitions/request-pattern\",\n          \"description\" : \"Pattern to match the request that initiated the channel\"\n        }\n      }\n    },\n    \"channel-target\" : {\n      \"oneOf\" : [ {\n        \"type\" : \"object\",\n        \"description\" : \"Target the originating channel\",\n        \"required\" : [ \"type\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"originating\" ]\n          }\n        }\n      }, {\n        \"type\" : \"object\",\n        \"description\" : \"Target channels initiated by requests matching a pattern\",\n        \"required\" : [ \"type\", \"requestPattern\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"request-initiated\" ]\n          },\n          \"channelType\" : {\n            \"$ref\" : \"#/definitions/channel-type\"\n          },\n          \"requestPattern\" : {\n            \"$ref\" : \"#/definitions/request-pattern\"\n          }\n        }\n      } ]\n    },\n    \"channel-type\" : {\n      \"type\" : \"string\",\n      \"description\" : \"The type of message channel\",\n      \"enum\" : [ \"websocket\" ],\n      \"example\" : \"websocket\"\n    },\n    \"contains-pattern\" : {\n      \"title\" : \"String contains\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"contains\" : {\n          \"type\" : \"string\"\n        }\n      },\n      \"required\" : [ \"contains\" ]\n    },\n    \"content-pattern\" : {\n      \"type\" : \"object\",\n      \"title\" : \"Content pattern\",\n      \"oneOf\" : [ {\n        \"$ref\" : \"#/definitions/equal-to-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/binary-equal-to-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/contains-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/does-not-contain-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/matches-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/does-not-match-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/not-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/before-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/after-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/equal-to-date-time-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/equal-to-json-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/matches-json-path-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/equal-to-xml-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/matches-xpath-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/matches-json-schema-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/absent-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/and-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/or-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/has-exactly-multivalue-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/includes-multivalue-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/equal-to-number-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/greater-than-number-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/greater-than-equal-number-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/less-than-number-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/less-than-equal-number-pattern\"\n      } ]\n    },\n    \"dateTimeExpression\" : {\n      \"type\" : \"string\",\n      \"example\" : \"now +3 days\"\n    },\n    \"format\" : {\n      \"type\" : \"string\",\n      \"example\" : \"yyyy-MM-dd\"\n    },\n    \"truncation\" : {\n      \"type\" : \"string\",\n      \"enum\" : [ \"first second of minute\", \"first minute of hour\", \"first hour of day\", \"first day of month\", \"first day of next month\", \"last day of month\", \"first day of year\", \"first day of next year\", \"last day of year\" ],\n      \"example\" : \"first day of month\"\n    },\n    \"delay-distribution\" : {\n      \"type\" : \"object\",\n      \"description\" : \"The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.\",\n      \"oneOf\" : [ {\n        \"title\" : \"Log normal\",\n        \"description\" : \"Log normal randomly distributed response delay.\",\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"median\" : {\n            \"type\" : \"integer\"\n          },\n          \"sigma\" : {\n            \"type\" : \"number\"\n          },\n          \"maxValue\" : {\n            \"type\" : \"number\"\n          },\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"lognormal\" ]\n          }\n        },\n        \"required\" : [ \"median\", \"sigma\" ]\n      }, {\n        \"title\" : \"Uniform\",\n        \"description\" : \"Uniformly distributed random response delay.\",\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"lower\" : {\n            \"type\" : \"integer\"\n          },\n          \"upper\" : {\n            \"type\" : \"integer\"\n          },\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"uniform\" ]\n          }\n        },\n        \"required\" : [ \"lower\", \"upper\" ]\n      }, {\n        \"title\" : \"Fixed\",\n        \"description\" : \"Fixed response delay.\",\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"milliseconds\" : {\n            \"type\" : \"integer\"\n          },\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"fixed\" ]\n          }\n        },\n        \"required\" : [ \"milliseconds\" ]\n      } ]\n    },\n    \"does-not-contain-pattern\" : {\n      \"title\" : \"String does not contain\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"doesNotContain\" : {\n          \"type\" : \"string\"\n        }\n      },\n      \"required\" : [ \"doesNotContain\" ]\n    },\n    \"does-not-match-pattern\" : {\n      \"title\" : \"Negative regular expression match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"doesNotMatch\" : {\n          \"type\" : \"string\",\n          \"x-intellij-language-injection\" : \"RegExp\"\n        }\n      },\n      \"required\" : [ \"doesNotMatch\" ]\n    },\n    \"equal-to-date-time-pattern\" : {\n      \"title\" : \"Before datetime\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"equalToDateTime\" : {\n          \"$ref\" : \"#/definitions/dateTimeExpression\"\n        },\n        \"actualFormat\" : {\n          \"$ref\" : \"#/definitions/format\"\n        },\n        \"truncateExpected\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        },\n        \"truncateActual\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        }\n      },\n      \"required\" : [ \"equalToDateTime\" ]\n    },\n    \"equal-to-json-pattern\" : {\n      \"title\" : \"JSON equals\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"equalToJson\" : {\n          \"oneOf\" : [ {\n            \"type\" : \"object\",\n            \"description\" : \"The JSON object to match.\",\n            \"example\" : {\n              \"message\" : \"hello\"\n            }\n          }, {\n            \"type\" : \"string\",\n            \"x-intellij-language-injection\" : \"JSON\",\n            \"description\" : \"A JSON-encoded JSON string to match.\",\n            \"example\" : \"{ \\\"message\\\": \\\"hello\\\" }\"\n          } ]\n        },\n        \"ignoreExtraElements\" : {\n          \"type\" : \"boolean\"\n        },\n        \"ignoreArrayOrder\" : {\n          \"type\" : \"boolean\"\n        }\n      },\n      \"required\" : [ \"equalToJson\" ]\n    },\n    \"equal-to-number-pattern\" : {\n      \"title\" : \"Number equals\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"equalToNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"equalToNumber\" ]\n    },\n    \"equal-to-pattern\" : {\n      \"title\" : \"String equals\",\n      \"type\" : \"object\",\n      \"required\" : [ \"equalTo\" ],\n      \"properties\" : {\n        \"equalTo\" : {\n          \"type\" : \"string\"\n        },\n        \"caseInsensitive\" : {\n          \"type\" : \"boolean\"\n        }\n      }\n    },\n    \"equal-to-xml-pattern\" : {\n      \"title\" : \"XML equality\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"equalToXml\" : {\n          \"type\" : \"string\",\n          \"x-intellij-language-injection\" : \"XML\",\n          \"example\" : \"<amount>123</amount>\"\n        },\n        \"enablePlaceholders\" : {\n          \"type\" : \"boolean\"\n        },\n        \"placeholderOpeningDelimiterRegex\" : {\n          \"type\" : \"string\",\n          \"example\" : \"\\\\[\"\n        },\n        \"placeholderClosingDelimiterRegex\" : {\n          \"type\" : \"string\",\n          \"example\" : \"]\"\n        },\n        \"namespaceAwareness\" : {\n          \"type\" : \"string\",\n          \"enum\" : [ \"LEGACY\", \"STRICT\", \"NONE\" ]\n        }\n      },\n      \"required\" : [ \"equalToXml\" ]\n    },\n    \"greater-than-equal-number-pattern\" : {\n      \"title\" : \"Number greater than or equal\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"greaterThanEqualNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"greaterThanEqualNumber\" ]\n    },\n    \"greater-than-number-pattern\" : {\n      \"title\" : \"Number greater than\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"greaterThanNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"greaterThanNumber\" ]\n    },\n    \"has-exactly-multivalue-pattern\" : {\n      \"title\" : \"Has exactly multi value matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"hasExactly\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        }\n      },\n      \"required\" : [ \"hasExactly\" ]\n    },\n    \"headers\" : {\n      \"type\" : \"object\",\n      \"description\" : \"HTTP headers\",\n      \"additionalProperties\" : {\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"key\" : {\n            \"type\" : \"string\"\n          },\n          \"values\" : {\n            \"type\" : \"array\",\n            \"items\" : {\n              \"type\" : \"string\"\n            }\n          }\n        }\n      },\n      \"example\" : {\n        \"Connection\" : {\n          \"key\" : \"Connection\",\n          \"values\" : [ \"keep-alive\" ]\n        },\n        \"Host\" : {\n          \"key\" : \"Host\",\n          \"values\" : [ \"localhost:56738\" ]\n        },\n        \"User-Agent\" : {\n          \"key\" : \"User-Agent\",\n          \"values\" : [ \"Apache-HttpClient/4.5.1 (Java/1.7.0_51)\" ]\n        }\n      }\n    },\n    \"health\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"status\" : {\n          \"type\" : \"string\",\n          \"example\" : \"healthy\",\n          \"description\" : \"The status of the server\",\n          \"enum\" : [ \"healthy\", \"unhealthy\" ]\n        },\n        \"message\" : {\n          \"type\" : \"string\",\n          \"description\" : \"Longer message regarding the status of the server\",\n          \"example\" : \"Wiremock is ok\"\n        },\n        \"version\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The WireMock version\",\n          \"example\" : \"3.8.0\"\n        },\n        \"uptimeInSeconds\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"How long the server has been running\",\n          \"example\" : 14355\n        },\n        \"timestamp\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The current timestamp\",\n          \"example\" : \"2024-07-03T13:16:06.172362Z\"\n        }\n      }\n    },\n    \"includes-multivalue-pattern\" : {\n      \"title\" : \"Has exactly multi value matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"includes\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        }\n      },\n      \"required\" : [ \"includes\" ]\n    },\n    \"less-than-equal-number-pattern\" : {\n      \"title\" : \"Number less than or equal\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"lessThanEqualNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"lessThanEqualNumber\" ]\n    },\n    \"less-than-number-pattern\" : {\n      \"title\" : \"Number less than\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"lessThanNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"lessThanNumber\" ]\n    },\n    \"logged-message-channel\" : {\n      \"type\" : \"object\",\n      \"description\" : \"A logged message channel\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"Unique identifier for this channel\"\n        },\n        \"type\" : {\n          \"$ref\" : \"#/definitions/channel-type\"\n        },\n        \"initiatingRequest\" : {\n          \"$ref\" : \"#/definitions/logged-request\",\n          \"description\" : \"The HTTP request that initiated the channel (for request-initiated channels)\"\n        },\n        \"open\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Whether the channel is currently open\"\n        }\n      }\n    },\n    \"logged-request\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"id\" : {\n          \"description\" : \"The unique identifier for this request\",\n          \"type\" : \"string\",\n          \"format\" : \"uuid\"\n        },\n        \"method\" : {\n          \"description\" : \"The HTTP request method\",\n          \"type\" : \"string\",\n          \"example\" : \"GET\"\n        },\n        \"url\" : {\n          \"description\" : \"The path and query to match exactly against\",\n          \"type\" : \"string\",\n          \"example\" : \"/received-request/2\"\n        },\n        \"absoluteUrl\" : {\n          \"description\" : \"The full URL to match against\",\n          \"type\" : \"string\",\n          \"example\" : \"http://localhost:56738/received-request/2\"\n        },\n        \"scheme\" : {\n          \"description\" : \"The URL scheme (http/https)\",\n          \"type\" : \"string\",\n          \"example\" : \"http\"\n        },\n        \"host\" : {\n          \"description\" : \"The host part of the URL\",\n          \"type\" : \"string\",\n          \"example\" : \"localhost\"\n        },\n        \"port\" : {\n          \"description\" : \"The port number\",\n          \"type\" : \"integer\",\n          \"example\" : 56738\n        },\n        \"clientIp\" : {\n          \"description\" : \"The client IP address\",\n          \"type\" : \"string\",\n          \"example\" : \"127.0.0.1\"\n        },\n        \"headers\" : {\n          \"$ref\" : \"#/definitions/headers\"\n        },\n        \"cookies\" : {\n          \"description\" : \"Cookies received with the request\",\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"name\" : {\n                \"type\" : \"string\"\n              },\n              \"value\" : {\n                \"type\" : \"string\"\n              }\n            }\n          },\n          \"example\" : { }\n        },\n        \"body\" : {\n          \"description\" : \"Body string to match against\",\n          \"type\" : \"string\",\n          \"example\" : \"Hello world\"\n        },\n        \"bodyAsBase64\" : {\n          \"description\" : \"Base64 encoded body content\",\n          \"type\" : \"string\"\n        },\n        \"browserProxyRequest\" : {\n          \"description\" : \"Whether this request was made via a browser proxy\",\n          \"type\" : \"boolean\",\n          \"example\" : false\n        },\n        \"loggedDate\" : {\n          \"description\" : \"The timestamp when the request was logged (epoch millis)\",\n          \"type\" : \"integer\",\n          \"format\" : \"int64\",\n          \"example\" : 1471442557047\n        },\n        \"loggedDateString\" : {\n          \"description\" : \"The formatted date string when the request was logged\",\n          \"type\" : \"string\",\n          \"example\" : \"2016-08-17T14:02:37Z\"\n        },\n        \"queryParams\" : {\n          \"description\" : \"Query parameters parsed from the URL\",\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"key\" : {\n                \"type\" : \"string\"\n              },\n              \"values\" : {\n                \"type\" : \"array\",\n                \"items\" : {\n                  \"type\" : \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"formParams\" : {\n          \"description\" : \"Form parameters parsed from the request body\",\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"key\" : {\n                \"type\" : \"string\"\n              },\n              \"values\" : {\n                \"type\" : \"array\",\n                \"items\" : {\n                  \"type\" : \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"multiparts\" : {\n          \"description\" : \"Multipart form data parts\",\n          \"type\" : \"array\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"name\" : {\n                \"type\" : \"string\",\n                \"description\" : \"The name of the multipart part\"\n              },\n              \"fileName\" : {\n                \"type\" : \"string\",\n                \"description\" : \"The filename of the multipart part, if provided\"\n              },\n              \"headers\" : {\n                \"$ref\" : \"#/definitions/headers\"\n              },\n              \"body\" : {\n                \"type\" : \"string\",\n                \"description\" : \"The body content of this part\"\n              },\n              \"bodyAsBase64\" : {\n                \"type\" : \"string\",\n                \"description\" : \"Base64 encoded body content of this part\"\n              }\n            },\n            \"required\" : [ \"name\" ]\n          }\n        },\n        \"protocol\" : {\n          \"description\" : \"The HTTP protocol version\",\n          \"type\" : \"string\",\n          \"example\" : \"HTTP/1.1\"\n        }\n      }\n    },\n    \"matches-json-path-pattern\" : {\n      \"title\" : \"JSONPath match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"matchesJsonPath\" : {\n          \"oneOf\" : [ {\n            \"type\" : \"string\",\n            \"example\" : \"$.name\",\n            \"x-intellij-language-injection\" : \"JSONPath\"\n          }, {\n            \"type\" : \"object\",\n            \"allOf\" : [ {\n              \"properties\" : {\n                \"expression\" : {\n                  \"type\" : \"string\",\n                  \"example\" : \"$.name\"\n                }\n              }\n            }, {\n              \"$ref\" : \"#/definitions/content-pattern\"\n            } ],\n            \"required\" : [ \"expression\" ]\n          } ]\n        }\n      },\n      \"required\" : [ \"matchesJsonPath\" ]\n    },\n    \"matches-json-schema-pattern\" : {\n      \"title\" : \"JSON Schema match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"matchesJsonSchema\" : {\n          \"type\" : \"string\",\n          \"x-intellij-language-injection\" : \"JSON\",\n          \"description\" : \"A valid JSON schema as a string\",\n          \"example\" : \"{\\n  \\\"type\\\": \\\"object\\\",\\n  \\\"required\\\": [\\n    \\\"name\\\"\\n  ],\\n  \\\"properties\\\": {\\n    \\\"name\\\": {\\n      \\\"type\\\": \\\"string\\\"\\n    },\\n    \\\"tag\\\": {\\n      \\\"type\\\": \\\"string\\\"\\n    }\\n  }\\n}\"\n        },\n        \"schemaVersion\" : {\n          \"description\" : \"The JSON schema version to interpret the schema against\",\n          \"example\" : \"V202012\",\n          \"enum\" : [ \"V4\", \"V6\", \"V7\", \"V201909\", \"V202012\" ]\n        }\n      },\n      \"required\" : [ \"matchesJsonSchema\" ]\n    },\n    \"matches-pattern\" : {\n      \"title\" : \"Regular expression match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"matches\" : {\n          \"type\" : \"string\",\n          \"x-intellij-language-injection\" : \"RegExp\"\n        }\n      },\n      \"required\" : [ \"matches\" ]\n    },\n    \"matches-xpath-pattern\" : {\n      \"title\" : \"XPath match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"matchesXPath\" : {\n          \"oneOf\" : [ {\n            \"type\" : \"string\",\n            \"example\" : \"//Order/Amount\",\n            \"x-intellij-language-injection\" : \"XPath\"\n          }, {\n            \"type\" : \"object\",\n            \"allOf\" : [ {\n              \"properties\" : {\n                \"expression\" : {\n                  \"type\" : \"string\",\n                  \"example\" : \"//Order/Amount\"\n                }\n              }\n            }, {\n              \"$ref\" : \"#/definitions/content-pattern\"\n            } ],\n            \"required\" : [ \"expression\" ]\n          } ]\n        },\n        \"xPathNamespaces\" : {\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"string\"\n          }\n        }\n      },\n      \"required\" : [ \"matchesXPath\" ]\n    },\n    \"message-action\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Action to perform when a message stub is triggered\",\n      \"required\" : [ \"type\", \"message\" ],\n      \"properties\" : {\n        \"type\" : {\n          \"type\" : \"string\",\n          \"enum\" : [ \"send\" ]\n        },\n        \"message\" : {\n          \"$ref\" : \"#/definitions/message-definition\"\n        },\n        \"channelTarget\" : {\n          \"$ref\" : \"#/definitions/channel-target\"\n        },\n        \"transformers\" : {\n          \"type\" : \"array\",\n          \"description\" : \"List of transformer names to apply to the message\",\n          \"items\" : {\n            \"type\" : \"string\"\n          }\n        },\n        \"transformerParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Parameters to pass to transformers\",\n          \"additionalProperties\" : true\n        }\n      }\n    },\n    \"message-channels-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result containing message channels\",\n      \"properties\" : {\n        \"channels\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/logged-message-channel\"\n          }\n        },\n        \"meta\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Pagination metadata\",\n          \"properties\" : {\n            \"total\" : {\n              \"type\" : \"integer\",\n              \"description\" : \"Total number of channels\"\n            }\n          }\n        }\n      }\n    },\n    \"message-definition\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Definition of a message to be sent\",\n      \"properties\" : {\n        \"body\" : {\n          \"description\" : \"The message body\",\n          \"oneOf\" : [ {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"data\" : {\n                \"type\" : \"string\",\n                \"description\" : \"Text message data\"\n              }\n            }\n          }, {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"data\" : {\n                \"type\" : \"string\",\n                \"format\" : \"byte\",\n                \"description\" : \"Base64-encoded binary message data\"\n              },\n              \"isBinary\" : {\n                \"type\" : \"boolean\",\n                \"description\" : \"Indicates this is binary data\"\n              }\n            }\n          } ]\n        }\n      }\n    },\n    \"message-pattern\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Pattern for matching messages\",\n      \"properties\" : {\n        \"channel\" : {\n          \"$ref\" : \"#/definitions/request-pattern\",\n          \"description\" : \"Pattern to match the channel's initiating request\"\n        },\n        \"body\" : {\n          \"$ref\" : \"#/definitions/content-pattern\",\n          \"description\" : \"Pattern to match the message body\"\n        }\n      }\n    },\n    \"message-serve-event\" : {\n      \"type\" : \"object\",\n      \"description\" : \"A message event logged in the journal\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"Unique identifier for this message event\"\n        },\n        \"eventType\" : {\n          \"type\" : \"string\",\n          \"enum\" : [ \"RECEIVED\", \"SENT\" ],\n          \"description\" : \"Whether the message was received or sent\"\n        },\n        \"channelType\" : {\n          \"$ref\" : \"#/definitions/channel-type\"\n        },\n        \"channelId\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"ID of the channel on which the message was sent/received\"\n        },\n        \"channelRequest\" : {\n          \"$ref\" : \"#/definitions/logged-request\",\n          \"description\" : \"The HTTP request that initiated the channel (for request-initiated channels)\"\n        },\n        \"message\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The message body as a string\"\n        },\n        \"stubMapping\" : {\n          \"$ref\" : \"#/definitions/message-stub-mapping\",\n          \"description\" : \"The message stub mapping that was matched (if any)\"\n        },\n        \"wasMatched\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Whether this message matched a stub mapping\"\n        },\n        \"timestamp\" : {\n          \"type\" : \"string\",\n          \"format\" : \"date-time\",\n          \"description\" : \"When the message event occurred\"\n        },\n        \"subEvents\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Sub-events that occurred during message processing\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"type\" : {\n                \"type\" : \"string\"\n              },\n              \"relativeTiming\" : {\n                \"type\" : \"integer\",\n                \"description\" : \"Timing in nanoseconds relative to the start of the event\"\n              },\n              \"data\" : {\n                \"type\" : \"object\"\n              }\n            }\n          }\n        }\n      }\n    },\n    \"message-serve-events-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result containing message serve events\",\n      \"properties\" : {\n        \"messageServeEvents\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/message-serve-event\"\n          }\n        },\n        \"messageJournalDisabled\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Whether the message journal is disabled\"\n        }\n      }\n    },\n    \"message-stub-mapping\" : {\n      \"type\" : \"object\",\n      \"description\" : \"A message stub mapping defines how WireMock responds to messages on channels\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"This message stub mapping's unique identifier\"\n        },\n        \"uuid\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"Alias for the id\"\n        },\n        \"name\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The message stub mapping's name\"\n        },\n        \"priority\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"This message stub mapping's priority relative to others. 1 is highest.\",\n          \"minimum\" : 1\n        },\n        \"trigger\" : {\n          \"$ref\" : \"#/definitions/message-trigger\"\n        },\n        \"actions\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Actions to perform when this stub is triggered\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/message-action\"\n          }\n        },\n        \"metadata\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Arbitrary metadata to be attached to the stub mapping\",\n          \"additionalProperties\" : true\n        }\n      }\n    },\n    \"message-stub-mappings\" : {\n      \"type\" : \"object\",\n      \"description\" : \"A collection of message stub mappings\",\n      \"properties\" : {\n        \"messageMappings\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/message-stub-mapping\"\n          }\n        },\n        \"meta\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Pagination metadata\",\n          \"properties\" : {\n            \"total\" : {\n              \"type\" : \"integer\",\n              \"description\" : \"Total number of message stub mappings\"\n            }\n          }\n        }\n      }\n    },\n    \"message-trigger\" : {\n      \"oneOf\" : [ {\n        \"type\" : \"object\",\n        \"description\" : \"Trigger on incoming message\",\n        \"required\" : [ \"type\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"message\" ]\n          },\n          \"channel\" : {\n            \"$ref\" : \"#/definitions/channel-pattern\"\n          },\n          \"message\" : {\n            \"$ref\" : \"#/definitions/message-pattern\"\n          }\n        }\n      }, {\n        \"type\" : \"object\",\n        \"description\" : \"Trigger when a specific HTTP stub is matched\",\n        \"required\" : [ \"type\", \"stubId\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"http-stub\" ]\n          },\n          \"stubId\" : {\n            \"type\" : \"string\",\n            \"format\" : \"uuid\",\n            \"description\" : \"The ID of the HTTP stub mapping that triggers this message stub\"\n          }\n        }\n      }, {\n        \"type\" : \"object\",\n        \"description\" : \"Trigger when an HTTP request matches a pattern\",\n        \"required\" : [ \"type\", \"requestPattern\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"http-request\" ]\n          },\n          \"requestPattern\" : {\n            \"$ref\" : \"#/definitions/request-pattern\"\n          }\n        }\n      } ]\n    },\n    \"message-verification-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result of a message verification operation\",\n      \"properties\" : {\n        \"count\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"Number of messages matching the criteria\"\n        },\n        \"messageJournalDisabled\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Whether the message journal is disabled\"\n        }\n      }\n    },\n    \"none-of-request-method-pattern\" : {\n      \"title\" : \"One of request method pattern\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"noneOf\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"type\" : \"string\"\n          }\n        }\n      },\n      \"required\" : [ \"noneOf\" ]\n    },\n    \"not-pattern\" : {\n      \"title\" : \"Logical NOT modifier\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"not\" : {\n          \"$ref\" : \"#/definitions/content-pattern\"\n        }\n      },\n      \"required\" : [ \"not\" ]\n    },\n    \"one-of-request-method-pattern\" : {\n      \"title\" : \"One of request method pattern\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"oneOf\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"type\" : \"string\"\n          }\n        }\n      },\n      \"required\" : [ \"oneOf\" ]\n    },\n    \"or-pattern\" : {\n      \"title\" : \"Logical OR matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"or\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        }\n      },\n      \"required\" : [ \"or\" ]\n    },\n    \"record-spec\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"captureHeaders\" : {\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"object\",\n            \"additionalProperties\" : false,\n            \"properties\" : {\n              \"caseInsensitive\" : {\n                \"type\" : \"boolean\"\n              }\n            }\n          },\n          \"description\" : \"Headers from the request to include in the generated stub mappings, mapped to parameter objects. The only parameter available is \\\"caseInsensitive\\\", which defaults to false\",\n          \"example\" : {\n            \"Accept\" : { },\n            \"Content-Type\" : {\n              \"caseInsensitive\" : true\n            }\n          }\n        },\n        \"extractBodyCriteria\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Criteria for extracting response bodies to a separate file instead of including it in the stub mapping\",\n          \"example\" : [ {\n            \"binarySizeThreshold\" : \"1 Mb\",\n            \"textSizeThreshold\" : \"2 kb\"\n          } ],\n          \"properties\" : {\n            \"binarySizeThreshold\" : {\n              \"type\" : \"string\",\n              \"default\" : \"0\",\n              \"description\" : \"Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \\\"56 Mb\\\". Default unit is bytes.\",\n              \"example\" : \"18.2 GB\"\n            },\n            \"textSizeThreshold\" : {\n              \"default\" : \"0\",\n              \"description\" : \"Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \\\"56 Mb\\\". Default unit is bytes.\",\n              \"example\" : \"18.2 GB\",\n              \"type\" : \"string\"\n            }\n          }\n        },\n        \"persist\" : {\n          \"type\" : \"boolean\",\n          \"default\" : true,\n          \"description\" : \"Whether to save stub mappings to the file system or just return them\"\n        },\n        \"repeatsAsScenarios\" : {\n          \"type\" : \"boolean\",\n          \"default\" : true,\n          \"description\" : \"When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded\"\n        },\n        \"requestBodyPattern\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Control the request body matcher used in generated stub mappings\",\n          \"oneOf\" : [ {\n            \"type\" : \"object\",\n            \"description\" : \"Automatically determine matcher based on content type (the default)\",\n            \"properties\" : {\n              \"caseInsensitive\" : {\n                \"type\" : \"boolean\",\n                \"default\" : false,\n                \"description\" : \"If equalTo is used, match body use case-insensitive string comparison\"\n              },\n              \"ignoreArrayOrder\" : {\n                \"type\" : \"boolean\",\n                \"default\" : true,\n                \"description\" : \"If equalToJson is used, ignore order of array elements\"\n              },\n              \"ignoreExtraElements\" : {\n                \"type\" : \"boolean\",\n                \"default\" : true,\n                \"description\" : \"If equalToJson is used, matcher ignores extra elements in objects\"\n              },\n              \"matcher\" : {\n                \"type\" : \"string\",\n                \"enum\" : [ \"auto\" ]\n              }\n            }\n          }, {\n            \"type\" : \"object\",\n            \"description\" : \"Always match request bodies using equalTo\",\n            \"properties\" : {\n              \"caseInsensitive\" : {\n                \"default\" : false,\n                \"description\" : \"Match body using case-insensitive string comparison\",\n                \"type\" : \"boolean\"\n              },\n              \"matcher\" : {\n                \"enum\" : [ \"equalTo\" ],\n                \"type\" : \"string\"\n              }\n            }\n          }, {\n            \"type\" : \"object\",\n            \"description\" : \"Always match request bodies using equalToJson\",\n            \"properties\" : {\n              \"ignoreArrayOrder\" : {\n                \"default\" : true,\n                \"description\" : \"Ignore order of array elements\",\n                \"type\" : \"boolean\"\n              },\n              \"ignoreExtraElements\" : {\n                \"default\" : true,\n                \"description\" : \"Ignore extra elements in objects\",\n                \"type\" : \"boolean\"\n              },\n              \"matcher\" : {\n                \"enum\" : [ \"equalToJson\" ],\n                \"type\" : \"string\"\n              }\n            }\n          }, {\n            \"type\" : \"object\",\n            \"description\" : \"Always match request bodies using equalToXml\",\n            \"properties\" : {\n              \"matcher\" : {\n                \"type\" : \"string\",\n                \"enum\" : [ \"equalToXml\" ]\n              }\n            }\n          } ]\n        },\n        \"transformerParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"List of names of stub mappings transformers to apply to generated stubs\"\n        },\n        \"transformers\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Parameters to pass to stub mapping transformers\",\n          \"items\" : {\n            \"type\" : \"string\"\n          }\n        }\n      }\n    },\n    \"request-method-pattern\" : {\n      \"type\" : \"object\",\n      \"title\" : \"Request method pattern\",\n      \"oneOf\" : [ {\n        \"$ref\" : \"#/definitions/one-of-request-method-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/none-of-request-method-pattern\"\n      } ]\n    },\n    \"request-pattern\" : {\n      \"type\" : \"object\",\n      \"example\" : \"{\\n  \\\"urlPath\\\" : \\\"/charges\\\",\\n  \\\"method\\\" : \\\"POST\\\",\\n  \\\"headers\\\" : {\\n    \\\"Content-Type\\\" : {\\n      \\\"equalTo\\\" : \\\"application/json\\\"\\n    }\\n  }\\n}\",\n      \"properties\" : {\n        \"scheme\" : {\n          \"type\" : \"string\",\n          \"enum\" : [ \"http\", \"https\" ],\n          \"description\" : \"The scheme (protocol) part of the request URL\"\n        },\n        \"host\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The hostname part of the request URL\"\n        },\n        \"port\" : {\n          \"type\" : \"integer\",\n          \"minimum\" : 1,\n          \"maximum\" : 65535,\n          \"description\" : \"The HTTP port number of the request URL\"\n        },\n        \"method\" : {\n          \"oneOf\" : [ {\n            \"type\" : \"string\",\n            \"pattern\" : \"^[A-Z]+$\",\n            \"description\" : \"The HTTP request method e.g. GET\"\n          }, {\n            \"$ref\" : \"#/definitions/one-of-request-method-pattern\"\n          }, {\n            \"$ref\" : \"#/definitions/none-of-request-method-pattern\"\n          } ]\n        },\n        \"url\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n        },\n        \"urlPath\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n        },\n        \"urlPathPattern\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n        },\n        \"urlPattern\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n        },\n        \"urlPathTemplate\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification.\\nOnly one of url, urlPattern, urlPath or urlPathPattern may be specified.\\n\"\n        },\n        \"pathParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Path parameter patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form. Can only\\nbe used when the urlPathPattern URL match type is in use and all keys must be present as variables\\nin the path template.\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"queryParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Query parameter patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"formParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"application/x-www-form-urlencoded form parameter patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"headers\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Header patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"clientIp\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The client IP address to match against\"\n        },\n        \"basicAuthCredentials\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Pre-emptive basic auth credentials to match against\",\n          \"properties\" : {\n            \"password\" : {\n              \"type\" : \"string\"\n            },\n            \"username\" : {\n              \"type\" : \"string\"\n            }\n          },\n          \"required\" : [ \"username\", \"password\" ]\n        },\n        \"cookies\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Cookie patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"bodyPatterns\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Request body patterns to match against in the { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"customMatcher\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Custom request matcher to match against\",\n          \"properties\" : {\n            \"name\" : {\n              \"type\" : \"string\",\n              \"description\" : \"The matcher's name specified in the implementation of the matcher.\"\n            },\n            \"parameters\" : {\n              \"type\" : \"object\"\n            }\n          }\n        },\n        \"multipartPatterns\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Multipart patterns to match against headers and body.\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"name\" : {\n                \"type\" : \"string\"\n              },\n              \"fileName\" : {\n                \"type\" : \"string\"\n              },\n              \"matchingType\" : {\n                \"type\" : \"string\",\n                \"description\" : \"Determines whether all or any of the parts must match the criteria for an overall match.\",\n                \"default\" : \"ANY\",\n                \"enum\" : [ \"ALL\", \"ANY\" ]\n              },\n              \"headers\" : {\n                \"type\" : \"object\",\n                \"description\" : \"Header patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n                \"additionalProperties\" : {\n                  \"$ref\" : \"#/definitions/content-pattern\"\n                }\n              },\n              \"bodyPatterns\" : {\n                \"type\" : \"array\",\n                \"description\" : \"Body patterns to match against in the { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n                \"items\" : {\n                  \"$ref\" : \"#/definitions/content-pattern\"\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"response-definition\" : {\n      \"allOf\" : [ {\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"status\" : {\n            \"type\" : \"integer\",\n            \"description\" : \"The HTTP status code to be returned\"\n          },\n          \"statusMessage\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The HTTP status message to be returned\"\n          },\n          \"headers\" : {\n            \"type\" : \"object\",\n            \"description\" : \"Map of response headers to send\",\n            \"additionalProperties\" : {\n              \"type\" : \"string\"\n            }\n          },\n          \"additionalProxyRequestHeaders\" : {\n            \"type\" : \"object\",\n            \"description\" : \"Extra request headers to send when proxying to another host.\",\n            \"additionalProperties\" : {\n              \"type\" : \"string\"\n            }\n          },\n          \"removeProxyRequestHeaders\" : {\n            \"type\" : \"array\",\n            \"description\" : \"Request headers to remove when proxying to another host.\",\n            \"items\" : {\n              \"type\" : \"string\"\n            }\n          },\n          \"body\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\"\n          },\n          \"base64Body\" : {\n            \"$ref\" : \"#/definitions/base64-string\"\n          },\n          \"jsonBody\" : {\n            \"description\" : \"The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\",\n            \"oneOf\" : [ {\n              \"type\" : \"object\"\n            }, {\n              \"type\" : \"array\"\n            } ]\n          },\n          \"bodyFileName\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The path to the file containing the response body, relative to the configured file root. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\",\n            \"example\" : \"user-profile-responses/user1.json\"\n          },\n          \"fault\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The fault to apply (instead of a full, valid response).\",\n            \"enum\" : [ \"CONNECTION_RESET_BY_PEER\", \"EMPTY_RESPONSE\", \"MALFORMED_RESPONSE_CHUNK\", \"RANDOM_DATA_THEN_CLOSE\" ]\n          },\n          \"fixedDelayMilliseconds\" : {\n            \"type\" : \"integer\",\n            \"description\" : \"Number of milliseconds to delay be before sending the response.\"\n          },\n          \"delayDistribution\" : {\n            \"$ref\" : \"#/definitions/delay-distribution\"\n          },\n          \"chunkedDribbleDelay\" : {\n            \"type\" : \"object\",\n            \"description\" : \"The parameters for chunked dribble delay - chopping the response into pieces and sending them at delayed intervals\",\n            \"properties\" : {\n              \"numberOfChunks\" : {\n                \"type\" : \"integer\"\n              },\n              \"totalDuration\" : {\n                \"type\" : \"integer\"\n              }\n            },\n            \"required\" : [ \"numberOfChunks\", \"totalDuration\" ]\n          },\n          \"fromConfiguredStub\" : {\n            \"type\" : \"boolean\",\n            \"description\" : \"Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.\"\n          },\n          \"proxyBaseUrl\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The base URL of the target to proxy matching requests to.\"\n          },\n          \"proxyUrlPrefixToRemove\" : {\n            \"type\" : \"string\",\n            \"description\" : \"A path segment to remove from the beginning in incoming request URL paths before proxying to the target.\"\n          },\n          \"transformerParameters\" : {\n            \"type\" : \"object\",\n            \"description\" : \"Parameters to apply to response transformers.\"\n          },\n          \"transformers\" : {\n            \"type\" : \"array\",\n            \"description\" : \"List of names of transformers to apply to this response.\",\n            \"items\" : {\n              \"type\" : \"string\"\n            }\n          }\n        }\n      } ]\n    },\n    \"scenario\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The scenario ID\",\n          \"example\" : \"c8d249ec-d86d-48b1-88a8-a660e6848042\"\n        },\n        \"name\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The scenario name\",\n          \"example\" : \"my_scenario\"\n        },\n        \"possibleStates\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"default\" : \"Started\",\n            \"description\" : \"All the states this scenario can be in\",\n            \"type\" : \"string\"\n          },\n          \"example\" : [ \"Started\", \"state_1\", \"state_2\" ]\n        },\n        \"state\" : {\n          \"type\" : \"string\",\n          \"default\" : \"Started\",\n          \"description\" : \"The current state of this scenario\",\n          \"example\" : \"state_2\"\n        }\n      }\n    },\n    \"send-channel-message-request\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Request to send a message to channels\",\n      \"required\" : [ \"type\", \"message\" ],\n      \"properties\" : {\n        \"type\" : {\n          \"$ref\" : \"#/definitions/channel-type\"\n        },\n        \"initiatingRequest\" : {\n          \"$ref\" : \"#/definitions/request-pattern\",\n          \"description\" : \"Pattern to match the initiating request of target channels\"\n        },\n        \"message\" : {\n          \"$ref\" : \"#/definitions/message-definition\"\n        }\n      }\n    },\n    \"send-channel-message-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result of sending a message to channels\",\n      \"properties\" : {\n        \"channels\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Channels that received the message\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/logged-message-channel\"\n          }\n        },\n        \"channelsMessaged\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"Number of channels that received the message\"\n        }\n      }\n    },\n    \"single-message-serve-event-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result containing a single message serve event\",\n      \"properties\" : {\n        \"item\" : {\n          \"$ref\" : \"#/definitions/message-serve-event\",\n          \"description\" : \"The message serve event, or null if not found\"\n        }\n      }\n    },\n    \"stub-mapping\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"description\" : \"This stub mapping's unique identifier\"\n        },\n        \"uuid\" : {\n          \"type\" : \"string\",\n          \"description\" : \"Alias for the id\"\n        },\n        \"name\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The stub mapping's name\"\n        },\n        \"request\" : {\n          \"$ref\" : \"#/definitions/request-pattern\"\n        },\n        \"response\" : {\n          \"$ref\" : \"#/definitions/response-definition\"\n        },\n        \"persistent\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.\"\n        },\n        \"priority\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"This stub mapping's priority relative to others. 1 is highest.\",\n          \"minimum\" : 1\n        },\n        \"scenarioName\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The name of the scenario that this stub mapping is part of\"\n        },\n        \"requiredScenarioState\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The required state of the scenario in order for this stub to be matched.\"\n        },\n        \"newScenarioState\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The new state for the scenario to be updated to after this stub is served.\"\n        },\n        \"postServeActions\" : {\n          \"type\" : \"array\",\n          \"description\" : \"DEPRECATED: Use `serveEventListeners` instead.\\nA map of the names of post serve action extensions to trigger and their parameters.\\n\",\n          \"items\" : {\n            \"type\" : \"object\"\n          }\n        },\n        \"serveEventListeners\" : {\n          \"type\" : \"array\",\n          \"description\" : \"The list of serve event listeners\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"name\" : {\n                \"type\" : \"string\"\n              },\n              \"requestPhases\" : {\n                \"type\" : \"array\",\n                \"items\" : {\n                  \"type\" : \"string\",\n                  \"enum\" : [ \"BEFORE_MATCH\", \"AFTER_MATCH\", \"BEFORE_RESPONSE_SENT\", \"AFTER_COMPLETE\" ]\n                }\n              },\n              \"parameters\" : {\n                \"type\" : \"object\"\n              }\n            }\n          }\n        },\n        \"metadata\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.\"\n        }\n      },\n      \"additionalProperties\" : false\n    },\n    \"stub-mappings\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"mappings\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/stub-mapping\"\n          }\n        },\n        \"meta\" : {\n          \"type\" : \"object\",\n          \"properties\" : {\n            \"total\" : {\n              \"type\" : \"integer\",\n              \"example\" : 4\n            }\n          },\n          \"required\" : [ \"total\" ]\n        }\n      },\n      \"additionalProperties\" : false\n    },\n    \"wait-for-message-request\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Request to wait for message events\",\n      \"required\" : [ \"timeoutMillis\" ],\n      \"properties\" : {\n        \"pattern\" : {\n          \"$ref\" : \"#/definitions/message-pattern\"\n        },\n        \"timeoutMillis\" : {\n          \"type\" : \"integer\",\n          \"format\" : \"int64\",\n          \"description\" : \"Maximum time to wait in milliseconds\"\n        },\n        \"count\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"Number of messages to wait for (for wait-for-count endpoint)\"\n        }\n      }\n    }\n  },\n  \"oneOf\" : [ {\n    \"$ref\" : \"#/definitions/message-stub-mapping\"\n  }, {\n    \"$ref\" : \"#/definitions/message-stub-mappings\"\n  } ]\n}"
  },
  {
    "path": "schemas/wiremock-stub-mapping-or-mappings.json",
    "content": "{\n  \"title\" : \"WireMock stub mapping\",\n  \"type\" : \"object\",\n  \"$schema\" : \"http://json-schema.org/draft-07/schema#\",\n  \"definitions\" : {\n    \"absent-pattern\" : {\n      \"title\" : \"Absent matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"absent\" : {\n          \"type\" : \"boolean\"\n        }\n      },\n      \"required\" : [ \"absent\" ]\n    },\n    \"after-pattern\" : {\n      \"title\" : \"After datetime\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"after\" : {\n          \"$ref\" : \"#/definitions/dateTimeExpression\"\n        },\n        \"actualFormat\" : {\n          \"$ref\" : \"#/definitions/format\"\n        },\n        \"truncateExpected\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        },\n        \"truncateActual\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        }\n      },\n      \"required\" : [ \"after\" ]\n    },\n    \"and-pattern\" : {\n      \"title\" : \"Logical AND matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"and\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        }\n      },\n      \"required\" : [ \"and\" ]\n    },\n    \"bad-request-entity\" : {\n      \"title\" : \"Bad request entity\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"errors\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"code\" : {\n                \"type\" : \"integer\"\n              },\n              \"source\" : {\n                \"type\" : \"string\"\n              },\n              \"title\" : {\n                \"type\" : \"string\"\n              },\n              \"detail\" : {\n                \"type\" : \"string\"\n              }\n            }\n          }\n        }\n      }\n    },\n    \"base64-string\" : {\n      \"title\" : \"Base64 string\",\n      \"type\" : \"string\",\n      \"pattern\" : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$\",\n      \"description\" : \"A base64 encoded string used to describe binary data.\"\n    },\n    \"before-pattern\" : {\n      \"title\" : \"Before datetime\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"before\" : {\n          \"$ref\" : \"#/definitions/dateTimeExpression\"\n        },\n        \"actualFormat\" : {\n          \"$ref\" : \"#/definitions/format\"\n        },\n        \"truncateExpected\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        },\n        \"truncateActual\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        }\n      },\n      \"required\" : [ \"before\" ]\n    },\n    \"binary-equal-to-pattern\" : {\n      \"title\" : \"Binary equals\",\n      \"type\" : \"object\",\n      \"required\" : [ \"binaryEqualTo\" ],\n      \"properties\" : {\n        \"binaryEqualTo\" : {\n          \"$ref\" : \"#/definitions/base64-string\"\n        }\n      }\n    },\n    \"channel-pattern\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Pattern for matching message channels\",\n      \"required\" : [ \"type\" ],\n      \"properties\" : {\n        \"type\" : {\n          \"$ref\" : \"#/definitions/channel-type\"\n        },\n        \"initiatingRequestPattern\" : {\n          \"$ref\" : \"#/definitions/request-pattern\",\n          \"description\" : \"Pattern to match the request that initiated the channel\"\n        }\n      }\n    },\n    \"channel-target\" : {\n      \"oneOf\" : [ {\n        \"type\" : \"object\",\n        \"description\" : \"Target the originating channel\",\n        \"required\" : [ \"type\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"originating\" ]\n          }\n        }\n      }, {\n        \"type\" : \"object\",\n        \"description\" : \"Target channels initiated by requests matching a pattern\",\n        \"required\" : [ \"type\", \"requestPattern\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"request-initiated\" ]\n          },\n          \"channelType\" : {\n            \"$ref\" : \"#/definitions/channel-type\"\n          },\n          \"requestPattern\" : {\n            \"$ref\" : \"#/definitions/request-pattern\"\n          }\n        }\n      } ]\n    },\n    \"channel-type\" : {\n      \"type\" : \"string\",\n      \"description\" : \"The type of message channel\",\n      \"enum\" : [ \"websocket\" ],\n      \"example\" : \"websocket\"\n    },\n    \"contains-pattern\" : {\n      \"title\" : \"String contains\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"contains\" : {\n          \"type\" : \"string\"\n        }\n      },\n      \"required\" : [ \"contains\" ]\n    },\n    \"content-pattern\" : {\n      \"type\" : \"object\",\n      \"title\" : \"Content pattern\",\n      \"oneOf\" : [ {\n        \"$ref\" : \"#/definitions/equal-to-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/binary-equal-to-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/contains-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/does-not-contain-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/matches-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/does-not-match-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/not-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/before-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/after-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/equal-to-date-time-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/equal-to-json-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/matches-json-path-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/equal-to-xml-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/matches-xpath-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/matches-json-schema-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/absent-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/and-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/or-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/has-exactly-multivalue-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/includes-multivalue-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/equal-to-number-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/greater-than-number-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/greater-than-equal-number-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/less-than-number-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/less-than-equal-number-pattern\"\n      } ]\n    },\n    \"dateTimeExpression\" : {\n      \"type\" : \"string\",\n      \"example\" : \"now +3 days\"\n    },\n    \"format\" : {\n      \"type\" : \"string\",\n      \"example\" : \"yyyy-MM-dd\"\n    },\n    \"truncation\" : {\n      \"type\" : \"string\",\n      \"enum\" : [ \"first second of minute\", \"first minute of hour\", \"first hour of day\", \"first day of month\", \"first day of next month\", \"last day of month\", \"first day of year\", \"first day of next year\", \"last day of year\" ],\n      \"example\" : \"first day of month\"\n    },\n    \"delay-distribution\" : {\n      \"type\" : \"object\",\n      \"description\" : \"The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.\",\n      \"oneOf\" : [ {\n        \"title\" : \"Log normal\",\n        \"description\" : \"Log normal randomly distributed response delay.\",\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"median\" : {\n            \"type\" : \"integer\"\n          },\n          \"sigma\" : {\n            \"type\" : \"number\"\n          },\n          \"maxValue\" : {\n            \"type\" : \"number\"\n          },\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"lognormal\" ]\n          }\n        },\n        \"required\" : [ \"median\", \"sigma\" ]\n      }, {\n        \"title\" : \"Uniform\",\n        \"description\" : \"Uniformly distributed random response delay.\",\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"lower\" : {\n            \"type\" : \"integer\"\n          },\n          \"upper\" : {\n            \"type\" : \"integer\"\n          },\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"uniform\" ]\n          }\n        },\n        \"required\" : [ \"lower\", \"upper\" ]\n      }, {\n        \"title\" : \"Fixed\",\n        \"description\" : \"Fixed response delay.\",\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"milliseconds\" : {\n            \"type\" : \"integer\"\n          },\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"fixed\" ]\n          }\n        },\n        \"required\" : [ \"milliseconds\" ]\n      } ]\n    },\n    \"does-not-contain-pattern\" : {\n      \"title\" : \"String does not contain\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"doesNotContain\" : {\n          \"type\" : \"string\"\n        }\n      },\n      \"required\" : [ \"doesNotContain\" ]\n    },\n    \"does-not-match-pattern\" : {\n      \"title\" : \"Negative regular expression match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"doesNotMatch\" : {\n          \"type\" : \"string\",\n          \"x-intellij-language-injection\" : \"RegExp\"\n        }\n      },\n      \"required\" : [ \"doesNotMatch\" ]\n    },\n    \"equal-to-date-time-pattern\" : {\n      \"title\" : \"Before datetime\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"equalToDateTime\" : {\n          \"$ref\" : \"#/definitions/dateTimeExpression\"\n        },\n        \"actualFormat\" : {\n          \"$ref\" : \"#/definitions/format\"\n        },\n        \"truncateExpected\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        },\n        \"truncateActual\" : {\n          \"$ref\" : \"#/definitions/truncation\"\n        }\n      },\n      \"required\" : [ \"equalToDateTime\" ]\n    },\n    \"equal-to-json-pattern\" : {\n      \"title\" : \"JSON equals\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"equalToJson\" : {\n          \"oneOf\" : [ {\n            \"type\" : \"object\",\n            \"description\" : \"The JSON object to match.\",\n            \"example\" : {\n              \"message\" : \"hello\"\n            }\n          }, {\n            \"type\" : \"string\",\n            \"x-intellij-language-injection\" : \"JSON\",\n            \"description\" : \"A JSON-encoded JSON string to match.\",\n            \"example\" : \"{ \\\"message\\\": \\\"hello\\\" }\"\n          } ]\n        },\n        \"ignoreExtraElements\" : {\n          \"type\" : \"boolean\"\n        },\n        \"ignoreArrayOrder\" : {\n          \"type\" : \"boolean\"\n        }\n      },\n      \"required\" : [ \"equalToJson\" ]\n    },\n    \"equal-to-number-pattern\" : {\n      \"title\" : \"Number equals\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"equalToNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"equalToNumber\" ]\n    },\n    \"equal-to-pattern\" : {\n      \"title\" : \"String equals\",\n      \"type\" : \"object\",\n      \"required\" : [ \"equalTo\" ],\n      \"properties\" : {\n        \"equalTo\" : {\n          \"type\" : \"string\"\n        },\n        \"caseInsensitive\" : {\n          \"type\" : \"boolean\"\n        }\n      }\n    },\n    \"equal-to-xml-pattern\" : {\n      \"title\" : \"XML equality\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"equalToXml\" : {\n          \"type\" : \"string\",\n          \"x-intellij-language-injection\" : \"XML\",\n          \"example\" : \"<amount>123</amount>\"\n        },\n        \"enablePlaceholders\" : {\n          \"type\" : \"boolean\"\n        },\n        \"placeholderOpeningDelimiterRegex\" : {\n          \"type\" : \"string\",\n          \"example\" : \"\\\\[\"\n        },\n        \"placeholderClosingDelimiterRegex\" : {\n          \"type\" : \"string\",\n          \"example\" : \"]\"\n        },\n        \"namespaceAwareness\" : {\n          \"type\" : \"string\",\n          \"enum\" : [ \"LEGACY\", \"STRICT\", \"NONE\" ]\n        }\n      },\n      \"required\" : [ \"equalToXml\" ]\n    },\n    \"greater-than-equal-number-pattern\" : {\n      \"title\" : \"Number greater than or equal\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"greaterThanEqualNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"greaterThanEqualNumber\" ]\n    },\n    \"greater-than-number-pattern\" : {\n      \"title\" : \"Number greater than\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"greaterThanNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"greaterThanNumber\" ]\n    },\n    \"has-exactly-multivalue-pattern\" : {\n      \"title\" : \"Has exactly multi value matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"hasExactly\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        }\n      },\n      \"required\" : [ \"hasExactly\" ]\n    },\n    \"headers\" : {\n      \"type\" : \"object\",\n      \"description\" : \"HTTP headers\",\n      \"additionalProperties\" : {\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"key\" : {\n            \"type\" : \"string\"\n          },\n          \"values\" : {\n            \"type\" : \"array\",\n            \"items\" : {\n              \"type\" : \"string\"\n            }\n          }\n        }\n      },\n      \"example\" : {\n        \"Connection\" : {\n          \"key\" : \"Connection\",\n          \"values\" : [ \"keep-alive\" ]\n        },\n        \"Host\" : {\n          \"key\" : \"Host\",\n          \"values\" : [ \"localhost:56738\" ]\n        },\n        \"User-Agent\" : {\n          \"key\" : \"User-Agent\",\n          \"values\" : [ \"Apache-HttpClient/4.5.1 (Java/1.7.0_51)\" ]\n        }\n      }\n    },\n    \"health\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"status\" : {\n          \"type\" : \"string\",\n          \"example\" : \"healthy\",\n          \"description\" : \"The status of the server\",\n          \"enum\" : [ \"healthy\", \"unhealthy\" ]\n        },\n        \"message\" : {\n          \"type\" : \"string\",\n          \"description\" : \"Longer message regarding the status of the server\",\n          \"example\" : \"Wiremock is ok\"\n        },\n        \"version\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The WireMock version\",\n          \"example\" : \"3.8.0\"\n        },\n        \"uptimeInSeconds\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"How long the server has been running\",\n          \"example\" : 14355\n        },\n        \"timestamp\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The current timestamp\",\n          \"example\" : \"2024-07-03T13:16:06.172362Z\"\n        }\n      }\n    },\n    \"includes-multivalue-pattern\" : {\n      \"title\" : \"Has exactly multi value matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"includes\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        }\n      },\n      \"required\" : [ \"includes\" ]\n    },\n    \"less-than-equal-number-pattern\" : {\n      \"title\" : \"Number less than or equal\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"lessThanEqualNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"lessThanEqualNumber\" ]\n    },\n    \"less-than-number-pattern\" : {\n      \"title\" : \"Number less than\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"lessThanNumber\" : {\n          \"type\" : \"number\"\n        }\n      },\n      \"required\" : [ \"lessThanNumber\" ]\n    },\n    \"logged-message-channel\" : {\n      \"type\" : \"object\",\n      \"description\" : \"A logged message channel\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"Unique identifier for this channel\"\n        },\n        \"type\" : {\n          \"$ref\" : \"#/definitions/channel-type\"\n        },\n        \"initiatingRequest\" : {\n          \"$ref\" : \"#/definitions/logged-request\",\n          \"description\" : \"The HTTP request that initiated the channel (for request-initiated channels)\"\n        },\n        \"open\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Whether the channel is currently open\"\n        }\n      }\n    },\n    \"logged-request\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"id\" : {\n          \"description\" : \"The unique identifier for this request\",\n          \"type\" : \"string\",\n          \"format\" : \"uuid\"\n        },\n        \"method\" : {\n          \"description\" : \"The HTTP request method\",\n          \"type\" : \"string\",\n          \"example\" : \"GET\"\n        },\n        \"url\" : {\n          \"description\" : \"The path and query to match exactly against\",\n          \"type\" : \"string\",\n          \"example\" : \"/received-request/2\"\n        },\n        \"absoluteUrl\" : {\n          \"description\" : \"The full URL to match against\",\n          \"type\" : \"string\",\n          \"example\" : \"http://localhost:56738/received-request/2\"\n        },\n        \"scheme\" : {\n          \"description\" : \"The URL scheme (http/https)\",\n          \"type\" : \"string\",\n          \"example\" : \"http\"\n        },\n        \"host\" : {\n          \"description\" : \"The host part of the URL\",\n          \"type\" : \"string\",\n          \"example\" : \"localhost\"\n        },\n        \"port\" : {\n          \"description\" : \"The port number\",\n          \"type\" : \"integer\",\n          \"example\" : 56738\n        },\n        \"clientIp\" : {\n          \"description\" : \"The client IP address\",\n          \"type\" : \"string\",\n          \"example\" : \"127.0.0.1\"\n        },\n        \"headers\" : {\n          \"$ref\" : \"#/definitions/headers\"\n        },\n        \"cookies\" : {\n          \"description\" : \"Cookies received with the request\",\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"name\" : {\n                \"type\" : \"string\"\n              },\n              \"value\" : {\n                \"type\" : \"string\"\n              }\n            }\n          },\n          \"example\" : { }\n        },\n        \"body\" : {\n          \"description\" : \"Body string to match against\",\n          \"type\" : \"string\",\n          \"example\" : \"Hello world\"\n        },\n        \"bodyAsBase64\" : {\n          \"description\" : \"Base64 encoded body content\",\n          \"type\" : \"string\"\n        },\n        \"browserProxyRequest\" : {\n          \"description\" : \"Whether this request was made via a browser proxy\",\n          \"type\" : \"boolean\",\n          \"example\" : false\n        },\n        \"loggedDate\" : {\n          \"description\" : \"The timestamp when the request was logged (epoch millis)\",\n          \"type\" : \"integer\",\n          \"format\" : \"int64\",\n          \"example\" : 1471442557047\n        },\n        \"loggedDateString\" : {\n          \"description\" : \"The formatted date string when the request was logged\",\n          \"type\" : \"string\",\n          \"example\" : \"2016-08-17T14:02:37Z\"\n        },\n        \"queryParams\" : {\n          \"description\" : \"Query parameters parsed from the URL\",\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"key\" : {\n                \"type\" : \"string\"\n              },\n              \"values\" : {\n                \"type\" : \"array\",\n                \"items\" : {\n                  \"type\" : \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"formParams\" : {\n          \"description\" : \"Form parameters parsed from the request body\",\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"key\" : {\n                \"type\" : \"string\"\n              },\n              \"values\" : {\n                \"type\" : \"array\",\n                \"items\" : {\n                  \"type\" : \"string\"\n                }\n              }\n            }\n          }\n        },\n        \"multiparts\" : {\n          \"description\" : \"Multipart form data parts\",\n          \"type\" : \"array\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"name\" : {\n                \"type\" : \"string\",\n                \"description\" : \"The name of the multipart part\"\n              },\n              \"fileName\" : {\n                \"type\" : \"string\",\n                \"description\" : \"The filename of the multipart part, if provided\"\n              },\n              \"headers\" : {\n                \"$ref\" : \"#/definitions/headers\"\n              },\n              \"body\" : {\n                \"type\" : \"string\",\n                \"description\" : \"The body content of this part\"\n              },\n              \"bodyAsBase64\" : {\n                \"type\" : \"string\",\n                \"description\" : \"Base64 encoded body content of this part\"\n              }\n            },\n            \"required\" : [ \"name\" ]\n          }\n        },\n        \"protocol\" : {\n          \"description\" : \"The HTTP protocol version\",\n          \"type\" : \"string\",\n          \"example\" : \"HTTP/1.1\"\n        }\n      }\n    },\n    \"matches-json-path-pattern\" : {\n      \"title\" : \"JSONPath match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"matchesJsonPath\" : {\n          \"oneOf\" : [ {\n            \"type\" : \"string\",\n            \"example\" : \"$.name\",\n            \"x-intellij-language-injection\" : \"JSONPath\"\n          }, {\n            \"type\" : \"object\",\n            \"allOf\" : [ {\n              \"properties\" : {\n                \"expression\" : {\n                  \"type\" : \"string\",\n                  \"example\" : \"$.name\"\n                }\n              }\n            }, {\n              \"$ref\" : \"#/definitions/content-pattern\"\n            } ],\n            \"required\" : [ \"expression\" ]\n          } ]\n        }\n      },\n      \"required\" : [ \"matchesJsonPath\" ]\n    },\n    \"matches-json-schema-pattern\" : {\n      \"title\" : \"JSON Schema match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"matchesJsonSchema\" : {\n          \"type\" : \"string\",\n          \"x-intellij-language-injection\" : \"JSON\",\n          \"description\" : \"A valid JSON schema as a string\",\n          \"example\" : \"{\\n  \\\"type\\\": \\\"object\\\",\\n  \\\"required\\\": [\\n    \\\"name\\\"\\n  ],\\n  \\\"properties\\\": {\\n    \\\"name\\\": {\\n      \\\"type\\\": \\\"string\\\"\\n    },\\n    \\\"tag\\\": {\\n      \\\"type\\\": \\\"string\\\"\\n    }\\n  }\\n}\"\n        },\n        \"schemaVersion\" : {\n          \"description\" : \"The JSON schema version to interpret the schema against\",\n          \"example\" : \"V202012\",\n          \"enum\" : [ \"V4\", \"V6\", \"V7\", \"V201909\", \"V202012\" ]\n        }\n      },\n      \"required\" : [ \"matchesJsonSchema\" ]\n    },\n    \"matches-pattern\" : {\n      \"title\" : \"Regular expression match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"matches\" : {\n          \"type\" : \"string\",\n          \"x-intellij-language-injection\" : \"RegExp\"\n        }\n      },\n      \"required\" : [ \"matches\" ]\n    },\n    \"matches-xpath-pattern\" : {\n      \"title\" : \"XPath match\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"matchesXPath\" : {\n          \"oneOf\" : [ {\n            \"type\" : \"string\",\n            \"example\" : \"//Order/Amount\",\n            \"x-intellij-language-injection\" : \"XPath\"\n          }, {\n            \"type\" : \"object\",\n            \"allOf\" : [ {\n              \"properties\" : {\n                \"expression\" : {\n                  \"type\" : \"string\",\n                  \"example\" : \"//Order/Amount\"\n                }\n              }\n            }, {\n              \"$ref\" : \"#/definitions/content-pattern\"\n            } ],\n            \"required\" : [ \"expression\" ]\n          } ]\n        },\n        \"xPathNamespaces\" : {\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"string\"\n          }\n        }\n      },\n      \"required\" : [ \"matchesXPath\" ]\n    },\n    \"message-action\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Action to perform when a message stub is triggered\",\n      \"required\" : [ \"type\", \"message\" ],\n      \"properties\" : {\n        \"type\" : {\n          \"type\" : \"string\",\n          \"enum\" : [ \"send\" ]\n        },\n        \"message\" : {\n          \"$ref\" : \"#/definitions/message-definition\"\n        },\n        \"channelTarget\" : {\n          \"$ref\" : \"#/definitions/channel-target\"\n        },\n        \"transformers\" : {\n          \"type\" : \"array\",\n          \"description\" : \"List of transformer names to apply to the message\",\n          \"items\" : {\n            \"type\" : \"string\"\n          }\n        },\n        \"transformerParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Parameters to pass to transformers\",\n          \"additionalProperties\" : true\n        }\n      }\n    },\n    \"message-channels-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result containing message channels\",\n      \"properties\" : {\n        \"channels\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/logged-message-channel\"\n          }\n        },\n        \"meta\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Pagination metadata\",\n          \"properties\" : {\n            \"total\" : {\n              \"type\" : \"integer\",\n              \"description\" : \"Total number of channels\"\n            }\n          }\n        }\n      }\n    },\n    \"message-definition\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Definition of a message to be sent\",\n      \"properties\" : {\n        \"body\" : {\n          \"description\" : \"The message body\",\n          \"oneOf\" : [ {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"data\" : {\n                \"type\" : \"string\",\n                \"description\" : \"Text message data\"\n              }\n            }\n          }, {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"data\" : {\n                \"type\" : \"string\",\n                \"format\" : \"byte\",\n                \"description\" : \"Base64-encoded binary message data\"\n              },\n              \"isBinary\" : {\n                \"type\" : \"boolean\",\n                \"description\" : \"Indicates this is binary data\"\n              }\n            }\n          } ]\n        }\n      }\n    },\n    \"message-pattern\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Pattern for matching messages\",\n      \"properties\" : {\n        \"channel\" : {\n          \"$ref\" : \"#/definitions/request-pattern\",\n          \"description\" : \"Pattern to match the channel's initiating request\"\n        },\n        \"body\" : {\n          \"$ref\" : \"#/definitions/content-pattern\",\n          \"description\" : \"Pattern to match the message body\"\n        }\n      }\n    },\n    \"message-serve-event\" : {\n      \"type\" : \"object\",\n      \"description\" : \"A message event logged in the journal\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"Unique identifier for this message event\"\n        },\n        \"eventType\" : {\n          \"type\" : \"string\",\n          \"enum\" : [ \"RECEIVED\", \"SENT\" ],\n          \"description\" : \"Whether the message was received or sent\"\n        },\n        \"channelType\" : {\n          \"$ref\" : \"#/definitions/channel-type\"\n        },\n        \"channelId\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"ID of the channel on which the message was sent/received\"\n        },\n        \"channelRequest\" : {\n          \"$ref\" : \"#/definitions/logged-request\",\n          \"description\" : \"The HTTP request that initiated the channel (for request-initiated channels)\"\n        },\n        \"message\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The message body as a string\"\n        },\n        \"stubMapping\" : {\n          \"$ref\" : \"#/definitions/message-stub-mapping\",\n          \"description\" : \"The message stub mapping that was matched (if any)\"\n        },\n        \"wasMatched\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Whether this message matched a stub mapping\"\n        },\n        \"timestamp\" : {\n          \"type\" : \"string\",\n          \"format\" : \"date-time\",\n          \"description\" : \"When the message event occurred\"\n        },\n        \"subEvents\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Sub-events that occurred during message processing\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"type\" : {\n                \"type\" : \"string\"\n              },\n              \"relativeTiming\" : {\n                \"type\" : \"integer\",\n                \"description\" : \"Timing in nanoseconds relative to the start of the event\"\n              },\n              \"data\" : {\n                \"type\" : \"object\"\n              }\n            }\n          }\n        }\n      }\n    },\n    \"message-serve-events-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result containing message serve events\",\n      \"properties\" : {\n        \"messageServeEvents\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/message-serve-event\"\n          }\n        },\n        \"messageJournalDisabled\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Whether the message journal is disabled\"\n        }\n      }\n    },\n    \"message-stub-mapping\" : {\n      \"type\" : \"object\",\n      \"description\" : \"A message stub mapping defines how WireMock responds to messages on channels\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"This message stub mapping's unique identifier\"\n        },\n        \"uuid\" : {\n          \"type\" : \"string\",\n          \"format\" : \"uuid\",\n          \"description\" : \"Alias for the id\"\n        },\n        \"name\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The message stub mapping's name\"\n        },\n        \"priority\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"This message stub mapping's priority relative to others. 1 is highest.\",\n          \"minimum\" : 1\n        },\n        \"trigger\" : {\n          \"$ref\" : \"#/definitions/message-trigger\"\n        },\n        \"actions\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Actions to perform when this stub is triggered\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/message-action\"\n          }\n        },\n        \"metadata\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Arbitrary metadata to be attached to the stub mapping\",\n          \"additionalProperties\" : true\n        }\n      }\n    },\n    \"message-stub-mappings\" : {\n      \"type\" : \"object\",\n      \"description\" : \"A collection of message stub mappings\",\n      \"properties\" : {\n        \"messageMappings\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/message-stub-mapping\"\n          }\n        },\n        \"meta\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Pagination metadata\",\n          \"properties\" : {\n            \"total\" : {\n              \"type\" : \"integer\",\n              \"description\" : \"Total number of message stub mappings\"\n            }\n          }\n        }\n      }\n    },\n    \"message-trigger\" : {\n      \"oneOf\" : [ {\n        \"type\" : \"object\",\n        \"description\" : \"Trigger on incoming message\",\n        \"required\" : [ \"type\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"message\" ]\n          },\n          \"channel\" : {\n            \"$ref\" : \"#/definitions/channel-pattern\"\n          },\n          \"message\" : {\n            \"$ref\" : \"#/definitions/message-pattern\"\n          }\n        }\n      }, {\n        \"type\" : \"object\",\n        \"description\" : \"Trigger when a specific HTTP stub is matched\",\n        \"required\" : [ \"type\", \"stubId\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"http-stub\" ]\n          },\n          \"stubId\" : {\n            \"type\" : \"string\",\n            \"format\" : \"uuid\",\n            \"description\" : \"The ID of the HTTP stub mapping that triggers this message stub\"\n          }\n        }\n      }, {\n        \"type\" : \"object\",\n        \"description\" : \"Trigger when an HTTP request matches a pattern\",\n        \"required\" : [ \"type\", \"requestPattern\" ],\n        \"properties\" : {\n          \"type\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"http-request\" ]\n          },\n          \"requestPattern\" : {\n            \"$ref\" : \"#/definitions/request-pattern\"\n          }\n        }\n      } ]\n    },\n    \"message-verification-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result of a message verification operation\",\n      \"properties\" : {\n        \"count\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"Number of messages matching the criteria\"\n        },\n        \"messageJournalDisabled\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Whether the message journal is disabled\"\n        }\n      }\n    },\n    \"none-of-request-method-pattern\" : {\n      \"title\" : \"One of request method pattern\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"noneOf\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"type\" : \"string\"\n          }\n        }\n      },\n      \"required\" : [ \"noneOf\" ]\n    },\n    \"not-pattern\" : {\n      \"title\" : \"Logical NOT modifier\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"not\" : {\n          \"$ref\" : \"#/definitions/content-pattern\"\n        }\n      },\n      \"required\" : [ \"not\" ]\n    },\n    \"one-of-request-method-pattern\" : {\n      \"title\" : \"One of request method pattern\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"oneOf\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"type\" : \"string\"\n          }\n        }\n      },\n      \"required\" : [ \"oneOf\" ]\n    },\n    \"or-pattern\" : {\n      \"title\" : \"Logical OR matcher\",\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"or\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        }\n      },\n      \"required\" : [ \"or\" ]\n    },\n    \"record-spec\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"captureHeaders\" : {\n          \"type\" : \"object\",\n          \"additionalProperties\" : {\n            \"type\" : \"object\",\n            \"additionalProperties\" : false,\n            \"properties\" : {\n              \"caseInsensitive\" : {\n                \"type\" : \"boolean\"\n              }\n            }\n          },\n          \"description\" : \"Headers from the request to include in the generated stub mappings, mapped to parameter objects. The only parameter available is \\\"caseInsensitive\\\", which defaults to false\",\n          \"example\" : {\n            \"Accept\" : { },\n            \"Content-Type\" : {\n              \"caseInsensitive\" : true\n            }\n          }\n        },\n        \"extractBodyCriteria\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Criteria for extracting response bodies to a separate file instead of including it in the stub mapping\",\n          \"example\" : [ {\n            \"binarySizeThreshold\" : \"1 Mb\",\n            \"textSizeThreshold\" : \"2 kb\"\n          } ],\n          \"properties\" : {\n            \"binarySizeThreshold\" : {\n              \"type\" : \"string\",\n              \"default\" : \"0\",\n              \"description\" : \"Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \\\"56 Mb\\\". Default unit is bytes.\",\n              \"example\" : \"18.2 GB\"\n            },\n            \"textSizeThreshold\" : {\n              \"default\" : \"0\",\n              \"description\" : \"Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \\\"56 Mb\\\". Default unit is bytes.\",\n              \"example\" : \"18.2 GB\",\n              \"type\" : \"string\"\n            }\n          }\n        },\n        \"persist\" : {\n          \"type\" : \"boolean\",\n          \"default\" : true,\n          \"description\" : \"Whether to save stub mappings to the file system or just return them\"\n        },\n        \"repeatsAsScenarios\" : {\n          \"type\" : \"boolean\",\n          \"default\" : true,\n          \"description\" : \"When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded\"\n        },\n        \"requestBodyPattern\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Control the request body matcher used in generated stub mappings\",\n          \"oneOf\" : [ {\n            \"type\" : \"object\",\n            \"description\" : \"Automatically determine matcher based on content type (the default)\",\n            \"properties\" : {\n              \"caseInsensitive\" : {\n                \"type\" : \"boolean\",\n                \"default\" : false,\n                \"description\" : \"If equalTo is used, match body use case-insensitive string comparison\"\n              },\n              \"ignoreArrayOrder\" : {\n                \"type\" : \"boolean\",\n                \"default\" : true,\n                \"description\" : \"If equalToJson is used, ignore order of array elements\"\n              },\n              \"ignoreExtraElements\" : {\n                \"type\" : \"boolean\",\n                \"default\" : true,\n                \"description\" : \"If equalToJson is used, matcher ignores extra elements in objects\"\n              },\n              \"matcher\" : {\n                \"type\" : \"string\",\n                \"enum\" : [ \"auto\" ]\n              }\n            }\n          }, {\n            \"type\" : \"object\",\n            \"description\" : \"Always match request bodies using equalTo\",\n            \"properties\" : {\n              \"caseInsensitive\" : {\n                \"default\" : false,\n                \"description\" : \"Match body using case-insensitive string comparison\",\n                \"type\" : \"boolean\"\n              },\n              \"matcher\" : {\n                \"enum\" : [ \"equalTo\" ],\n                \"type\" : \"string\"\n              }\n            }\n          }, {\n            \"type\" : \"object\",\n            \"description\" : \"Always match request bodies using equalToJson\",\n            \"properties\" : {\n              \"ignoreArrayOrder\" : {\n                \"default\" : true,\n                \"description\" : \"Ignore order of array elements\",\n                \"type\" : \"boolean\"\n              },\n              \"ignoreExtraElements\" : {\n                \"default\" : true,\n                \"description\" : \"Ignore extra elements in objects\",\n                \"type\" : \"boolean\"\n              },\n              \"matcher\" : {\n                \"enum\" : [ \"equalToJson\" ],\n                \"type\" : \"string\"\n              }\n            }\n          }, {\n            \"type\" : \"object\",\n            \"description\" : \"Always match request bodies using equalToXml\",\n            \"properties\" : {\n              \"matcher\" : {\n                \"type\" : \"string\",\n                \"enum\" : [ \"equalToXml\" ]\n              }\n            }\n          } ]\n        },\n        \"transformerParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"List of names of stub mappings transformers to apply to generated stubs\"\n        },\n        \"transformers\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Parameters to pass to stub mapping transformers\",\n          \"items\" : {\n            \"type\" : \"string\"\n          }\n        }\n      }\n    },\n    \"request-method-pattern\" : {\n      \"type\" : \"object\",\n      \"title\" : \"Request method pattern\",\n      \"oneOf\" : [ {\n        \"$ref\" : \"#/definitions/one-of-request-method-pattern\"\n      }, {\n        \"$ref\" : \"#/definitions/none-of-request-method-pattern\"\n      } ]\n    },\n    \"request-pattern\" : {\n      \"type\" : \"object\",\n      \"example\" : \"{\\n  \\\"urlPath\\\" : \\\"/charges\\\",\\n  \\\"method\\\" : \\\"POST\\\",\\n  \\\"headers\\\" : {\\n    \\\"Content-Type\\\" : {\\n      \\\"equalTo\\\" : \\\"application/json\\\"\\n    }\\n  }\\n}\",\n      \"properties\" : {\n        \"scheme\" : {\n          \"type\" : \"string\",\n          \"enum\" : [ \"http\", \"https\" ],\n          \"description\" : \"The scheme (protocol) part of the request URL\"\n        },\n        \"host\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The hostname part of the request URL\"\n        },\n        \"port\" : {\n          \"type\" : \"integer\",\n          \"minimum\" : 1,\n          \"maximum\" : 65535,\n          \"description\" : \"The HTTP port number of the request URL\"\n        },\n        \"method\" : {\n          \"oneOf\" : [ {\n            \"type\" : \"string\",\n            \"pattern\" : \"^[A-Z]+$\",\n            \"description\" : \"The HTTP request method e.g. GET\"\n          }, {\n            \"$ref\" : \"#/definitions/one-of-request-method-pattern\"\n          }, {\n            \"$ref\" : \"#/definitions/none-of-request-method-pattern\"\n          } ]\n        },\n        \"url\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n        },\n        \"urlPath\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n        },\n        \"urlPathPattern\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n        },\n        \"urlPattern\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n        },\n        \"urlPathTemplate\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification.\\nOnly one of url, urlPattern, urlPath or urlPathPattern may be specified.\\n\"\n        },\n        \"pathParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Path parameter patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form. Can only\\nbe used when the urlPathPattern URL match type is in use and all keys must be present as variables\\nin the path template.\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"queryParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Query parameter patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"formParameters\" : {\n          \"type\" : \"object\",\n          \"description\" : \"application/x-www-form-urlencoded form parameter patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"headers\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Header patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"clientIp\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The client IP address to match against\"\n        },\n        \"basicAuthCredentials\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Pre-emptive basic auth credentials to match against\",\n          \"properties\" : {\n            \"password\" : {\n              \"type\" : \"string\"\n            },\n            \"username\" : {\n              \"type\" : \"string\"\n            }\n          },\n          \"required\" : [ \"username\", \"password\" ]\n        },\n        \"cookies\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Cookie patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"additionalProperties\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"bodyPatterns\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Request body patterns to match against in the { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/content-pattern\"\n          }\n        },\n        \"customMatcher\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Custom request matcher to match against\",\n          \"properties\" : {\n            \"name\" : {\n              \"type\" : \"string\",\n              \"description\" : \"The matcher's name specified in the implementation of the matcher.\"\n            },\n            \"parameters\" : {\n              \"type\" : \"object\"\n            }\n          }\n        },\n        \"multipartPatterns\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Multipart patterns to match against headers and body.\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"name\" : {\n                \"type\" : \"string\"\n              },\n              \"fileName\" : {\n                \"type\" : \"string\"\n              },\n              \"matchingType\" : {\n                \"type\" : \"string\",\n                \"description\" : \"Determines whether all or any of the parts must match the criteria for an overall match.\",\n                \"default\" : \"ANY\",\n                \"enum\" : [ \"ALL\", \"ANY\" ]\n              },\n              \"headers\" : {\n                \"type\" : \"object\",\n                \"description\" : \"Header patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n                \"additionalProperties\" : {\n                  \"$ref\" : \"#/definitions/content-pattern\"\n                }\n              },\n              \"bodyPatterns\" : {\n                \"type\" : \"array\",\n                \"description\" : \"Body patterns to match against in the { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n                \"items\" : {\n                  \"$ref\" : \"#/definitions/content-pattern\"\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"response-definition\" : {\n      \"allOf\" : [ {\n        \"type\" : \"object\",\n        \"properties\" : {\n          \"status\" : {\n            \"type\" : \"integer\",\n            \"description\" : \"The HTTP status code to be returned\"\n          },\n          \"statusMessage\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The HTTP status message to be returned\"\n          },\n          \"headers\" : {\n            \"type\" : \"object\",\n            \"description\" : \"Map of response headers to send\",\n            \"additionalProperties\" : {\n              \"type\" : \"string\"\n            }\n          },\n          \"additionalProxyRequestHeaders\" : {\n            \"type\" : \"object\",\n            \"description\" : \"Extra request headers to send when proxying to another host.\",\n            \"additionalProperties\" : {\n              \"type\" : \"string\"\n            }\n          },\n          \"removeProxyRequestHeaders\" : {\n            \"type\" : \"array\",\n            \"description\" : \"Request headers to remove when proxying to another host.\",\n            \"items\" : {\n              \"type\" : \"string\"\n            }\n          },\n          \"body\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\"\n          },\n          \"base64Body\" : {\n            \"$ref\" : \"#/definitions/base64-string\"\n          },\n          \"jsonBody\" : {\n            \"description\" : \"The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\",\n            \"oneOf\" : [ {\n              \"type\" : \"object\"\n            }, {\n              \"type\" : \"array\"\n            } ]\n          },\n          \"bodyFileName\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The path to the file containing the response body, relative to the configured file root. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\",\n            \"example\" : \"user-profile-responses/user1.json\"\n          },\n          \"fault\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The fault to apply (instead of a full, valid response).\",\n            \"enum\" : [ \"CONNECTION_RESET_BY_PEER\", \"EMPTY_RESPONSE\", \"MALFORMED_RESPONSE_CHUNK\", \"RANDOM_DATA_THEN_CLOSE\" ]\n          },\n          \"fixedDelayMilliseconds\" : {\n            \"type\" : \"integer\",\n            \"description\" : \"Number of milliseconds to delay be before sending the response.\"\n          },\n          \"delayDistribution\" : {\n            \"$ref\" : \"#/definitions/delay-distribution\"\n          },\n          \"chunkedDribbleDelay\" : {\n            \"type\" : \"object\",\n            \"description\" : \"The parameters for chunked dribble delay - chopping the response into pieces and sending them at delayed intervals\",\n            \"properties\" : {\n              \"numberOfChunks\" : {\n                \"type\" : \"integer\"\n              },\n              \"totalDuration\" : {\n                \"type\" : \"integer\"\n              }\n            },\n            \"required\" : [ \"numberOfChunks\", \"totalDuration\" ]\n          },\n          \"fromConfiguredStub\" : {\n            \"type\" : \"boolean\",\n            \"description\" : \"Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.\"\n          },\n          \"proxyBaseUrl\" : {\n            \"type\" : \"string\",\n            \"description\" : \"The base URL of the target to proxy matching requests to.\"\n          },\n          \"proxyUrlPrefixToRemove\" : {\n            \"type\" : \"string\",\n            \"description\" : \"A path segment to remove from the beginning in incoming request URL paths before proxying to the target.\"\n          },\n          \"transformerParameters\" : {\n            \"type\" : \"object\",\n            \"description\" : \"Parameters to apply to response transformers.\"\n          },\n          \"transformers\" : {\n            \"type\" : \"array\",\n            \"description\" : \"List of names of transformers to apply to this response.\",\n            \"items\" : {\n              \"type\" : \"string\"\n            }\n          }\n        }\n      } ]\n    },\n    \"scenario\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The scenario ID\",\n          \"example\" : \"c8d249ec-d86d-48b1-88a8-a660e6848042\"\n        },\n        \"name\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The scenario name\",\n          \"example\" : \"my_scenario\"\n        },\n        \"possibleStates\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"default\" : \"Started\",\n            \"description\" : \"All the states this scenario can be in\",\n            \"type\" : \"string\"\n          },\n          \"example\" : [ \"Started\", \"state_1\", \"state_2\" ]\n        },\n        \"state\" : {\n          \"type\" : \"string\",\n          \"default\" : \"Started\",\n          \"description\" : \"The current state of this scenario\",\n          \"example\" : \"state_2\"\n        }\n      }\n    },\n    \"send-channel-message-request\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Request to send a message to channels\",\n      \"required\" : [ \"type\", \"message\" ],\n      \"properties\" : {\n        \"type\" : {\n          \"$ref\" : \"#/definitions/channel-type\"\n        },\n        \"initiatingRequest\" : {\n          \"$ref\" : \"#/definitions/request-pattern\",\n          \"description\" : \"Pattern to match the initiating request of target channels\"\n        },\n        \"message\" : {\n          \"$ref\" : \"#/definitions/message-definition\"\n        }\n      }\n    },\n    \"send-channel-message-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result of sending a message to channels\",\n      \"properties\" : {\n        \"channels\" : {\n          \"type\" : \"array\",\n          \"description\" : \"Channels that received the message\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/logged-message-channel\"\n          }\n        },\n        \"channelsMessaged\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"Number of channels that received the message\"\n        }\n      }\n    },\n    \"single-message-serve-event-result\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Result containing a single message serve event\",\n      \"properties\" : {\n        \"item\" : {\n          \"$ref\" : \"#/definitions/message-serve-event\",\n          \"description\" : \"The message serve event, or null if not found\"\n        }\n      }\n    },\n    \"stub-mapping\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"id\" : {\n          \"type\" : \"string\",\n          \"description\" : \"This stub mapping's unique identifier\"\n        },\n        \"uuid\" : {\n          \"type\" : \"string\",\n          \"description\" : \"Alias for the id\"\n        },\n        \"name\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The stub mapping's name\"\n        },\n        \"request\" : {\n          \"$ref\" : \"#/definitions/request-pattern\"\n        },\n        \"response\" : {\n          \"$ref\" : \"#/definitions/response-definition\"\n        },\n        \"persistent\" : {\n          \"type\" : \"boolean\",\n          \"description\" : \"Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.\"\n        },\n        \"priority\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"This stub mapping's priority relative to others. 1 is highest.\",\n          \"minimum\" : 1\n        },\n        \"scenarioName\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The name of the scenario that this stub mapping is part of\"\n        },\n        \"requiredScenarioState\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The required state of the scenario in order for this stub to be matched.\"\n        },\n        \"newScenarioState\" : {\n          \"type\" : \"string\",\n          \"description\" : \"The new state for the scenario to be updated to after this stub is served.\"\n        },\n        \"postServeActions\" : {\n          \"type\" : \"array\",\n          \"description\" : \"DEPRECATED: Use `serveEventListeners` instead.\\nA map of the names of post serve action extensions to trigger and their parameters.\\n\",\n          \"items\" : {\n            \"type\" : \"object\"\n          }\n        },\n        \"serveEventListeners\" : {\n          \"type\" : \"array\",\n          \"description\" : \"The list of serve event listeners\",\n          \"items\" : {\n            \"type\" : \"object\",\n            \"properties\" : {\n              \"name\" : {\n                \"type\" : \"string\"\n              },\n              \"requestPhases\" : {\n                \"type\" : \"array\",\n                \"items\" : {\n                  \"type\" : \"string\",\n                  \"enum\" : [ \"BEFORE_MATCH\", \"AFTER_MATCH\", \"BEFORE_RESPONSE_SENT\", \"AFTER_COMPLETE\" ]\n                }\n              },\n              \"parameters\" : {\n                \"type\" : \"object\"\n              }\n            }\n          }\n        },\n        \"metadata\" : {\n          \"type\" : \"object\",\n          \"description\" : \"Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.\"\n        }\n      },\n      \"additionalProperties\" : false\n    },\n    \"stub-mappings\" : {\n      \"type\" : \"object\",\n      \"properties\" : {\n        \"mappings\" : {\n          \"type\" : \"array\",\n          \"items\" : {\n            \"$ref\" : \"#/definitions/stub-mapping\"\n          }\n        },\n        \"meta\" : {\n          \"type\" : \"object\",\n          \"properties\" : {\n            \"total\" : {\n              \"type\" : \"integer\",\n              \"example\" : 4\n            }\n          },\n          \"required\" : [ \"total\" ]\n        }\n      },\n      \"additionalProperties\" : false\n    },\n    \"wait-for-message-request\" : {\n      \"type\" : \"object\",\n      \"description\" : \"Request to wait for message events\",\n      \"required\" : [ \"timeoutMillis\" ],\n      \"properties\" : {\n        \"pattern\" : {\n          \"$ref\" : \"#/definitions/message-pattern\"\n        },\n        \"timeoutMillis\" : {\n          \"type\" : \"integer\",\n          \"format\" : \"int64\",\n          \"description\" : \"Maximum time to wait in milliseconds\"\n        },\n        \"count\" : {\n          \"type\" : \"integer\",\n          \"description\" : \"Number of messages to wait for (for wait-for-count endpoint)\"\n        }\n      }\n    }\n  },\n  \"oneOf\" : [ {\n    \"$ref\" : \"#/definitions/stub-mapping\"\n  }, {\n    \"$ref\" : \"#/definitions/stub-mappings\"\n  } ]\n}"
  },
  {
    "path": "scripts/ca-cert.conf",
    "content": "[req]\ndefault_bits = 4096\nprompt = no\ndefault_md = sha256\ndistinguished_name = req_distinguished_name\nx509_extensions = v3_ca\ndefault_days = 36525\n\n[req_distinguished_name]\nC = GB\nST = London\nO = WireMock\nCN = WireMock Local Self Signed Root Certificate\n\n[v3_ca]\nsubjectKeyIdentifier    = hash\nauthorityKeyIdentifier  = keyid:always\nbasicConstraints            = critical, CA:TRUE\nkeyUsage = critical, keyCertSign, cRLSign\n"
  },
  {
    "path": "scripts/client-cert.conf",
    "content": "[CA_default]\ncopy_extensions = copy\n\n[req]\ndefault_bits = 4096\nprompt = no\ndefault_md = sha256\ndistinguished_name = req_distinguished_name\nx509_extensions = v3_ca\n\n[req_distinguished_name]\nC = GB\nST = London\nO = WireMock\nemailAddress = tom@wiremock.org\nCN = localhost\n\n[v3_ca]\nbasicConstraints = CA:FALSE\nkeyUsage = digitalSignature, keyEncipherment\nsubjectAltName = @alternate_names\n\n[alternate_names]\nDNS.1 = localhost\nIP.1 = 127.0.0.1\n"
  },
  {
    "path": "scripts/create-ca-keystore.sh",
    "content": "#!/usr/bin/env bash\n\nset -euo pipefail\nread -r -s -p \"Please enter a password for the key & keystore (default: password):\" PASSWORD\nPASSWORD=${PASSWORD:=password}\nopenssl req -x509 -newkey rsa:2048 -utf8 -days 3650 -nodes -config ca-cert.conf -keyout ca-cert.key -out ca-cert.crt\nopenssl pkcs12 -export -inkey ca-cert.key -in ca-cert.crt -out ca-cert.p12 -password \"pass:$PASSWORD\"\nkeytool -importkeystore -deststorepass \"$PASSWORD\" -destkeypass \"$PASSWORD\" -srckeystore ca-cert.p12 -srcstorepass \"$PASSWORD\" -deststoretype jks -destkeystore ca-cert.jks\nrm ca-cert.key ca-cert.p12\n"
  },
  {
    "path": "scripts/create-client-cert.sh",
    "content": "#!/usr/bin/env bash\n\nopenssl req -x509 -newkey rsa:2048 -utf8 -days 3650 -nodes -config client-cert.conf -keyout client-cert.key -out client-cert.crt\nopenssl pkcs12 -export -inkey client-cert.key -in client-cert.crt -out client-cert.p12 -password pass:mytruststorepassword\nkeytool -importkeystore -deststorepass mytruststorepassword -destkeypass mytruststorepassword -srckeystore client-cert.p12 -srcstorepass mytruststorepassword -deststoretype pkcs12 -destkeystore client-cert.pkcs12"
  },
  {
    "path": "settings.gradle.kts",
    "content": "plugins {\n    id(\"com.autonomousapps.build-health\") version \"3.6.1\"\n}\n\nrootProject.name = \"wiremock\"\n\ninclude(\"wiremock-core\")\ninclude(\"wiremock-junit4\")\ninclude(\"wiremock-junit5\")\ninclude(\"wiremock-jetty\")\ninclude(\"wiremock-httpclient-apache5\")\ninclude(\"test-extension\")\ninclude(\"wiremock-url:wiremock-string-parser\")\ninclude(\"wiremock-url:wiremock-string-parser-jackson2\")\ninclude(\"wiremock-url:wiremock-string-parser-jackson3\")\ninclude(\"wiremock-url:wiremock-url\")\ninclude(\"wiremock-url:wiremock-url-jackson2\")\ninclude(\"wiremock-url:wiremock-url-jackson3\")\n"
  },
  {
    "path": "src/main/java/com/github/tomakehurst/wiremock/standalone/CommandLineOptions.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\nimport static com.github.tomakehurst.wiremock.common.BrowserProxySettings.DEFAULT_CA_KESTORE_PASSWORD;\nimport static com.github.tomakehurst.wiremock.common.BrowserProxySettings.DEFAULT_CA_KEYSTORE_PATH;\nimport static com.github.tomakehurst.wiremock.common.ProxySettings.NO_PROXY;\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResource;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MAPPINGS_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MESSAGE_MAPPINGS_ROOT;\nimport static com.github.tomakehurst.wiremock.http.CaseInsensitiveKey.TO_CASE_INSENSITIVE_KEYS;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSourceFactory;\nimport com.github.tomakehurst.wiremock.core.MappingsSaver;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.Version;\nimport com.github.tomakehurst.wiremock.core.WireMockApp;\nimport com.github.tomakehurst.wiremock.extension.ExtensionDeclarations;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.CaseInsensitiveKey;\nimport com.github.tomakehurst.wiremock.http.HttpServerFactory;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.ConsoleNotifyingWiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.DoNothingWiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.WiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.jetty.JettyHttpServerFactory;\nimport com.github.tomakehurst.wiremock.jetty.JettySettings;\nimport com.github.tomakehurst.wiremock.security.Authenticator;\nimport com.github.tomakehurst.wiremock.security.BasicAuthenticator;\nimport com.github.tomakehurst.wiremock.security.NoAuthenticator;\nimport com.github.tomakehurst.wiremock.store.DefaultStores;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport java.io.IOException;\nimport java.io.StringWriter;\nimport java.util.*;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.stream.Collectors;\nimport joptsimple.OptionParser;\nimport joptsimple.OptionSet;\nimport org.wiremock.url.AbsoluteUrl;\n\npublic class CommandLineOptions implements Options {\n\n  private static final String HELP = \"help\";\n  private static final String VERSION = \"version\";\n  private static final String RECORD_MAPPINGS = \"record-mappings\";\n  private static final String MATCH_HEADERS = \"match-headers\";\n  private static final String PROXY_ALL = \"proxy-all\";\n  private static final String PRESERVE_HOST_HEADER = \"preserve-host-header\";\n  private static final String PRESERVE_USER_AGENT_PROXY_HEADER = \"preserve-user-agent-proxy-header\";\n  private static final String PROXY_VIA = \"proxy-via\";\n  private static final String TIMEOUT = \"timeout\";\n  private static final String PORT = \"port\";\n  private static final String DISABLE_HTTP = \"disable-http\";\n  private static final String DISABLE_HTTP2_PLAIN = \"disable-http2-plain\";\n  private static final String DISABLE_HTTP2_TLS = \"disable-http2-tls\";\n  private static final String BIND_ADDRESS = \"bind-address\";\n  private static final String HTTPS_PORT = \"https-port\";\n  private static final String HTTPS_KEYSTORE = \"https-keystore\";\n  private static final String HTTPS_KEYSTORE_PASSWORD = \"keystore-password\";\n  private static final String HTTPS_KEYSTORE_TYPE = \"keystore-type\";\n  private static final String HTTPS_KEY_MANAGER_PASSWORD = \"key-manager-password\";\n  private static final String HTTPS_TRUSTSTORE = \"https-truststore\";\n  private static final String HTTPS_TRUSTSTORE_PASSWORD = \"truststore-password\";\n  private static final String HTTPS_TRUSTSTORE_TYPE = \"truststore-type\";\n  private static final String REQUIRE_CLIENT_CERT = \"https-require-client-cert\";\n  private static final String VERBOSE = \"verbose\";\n  private static final String ENABLE_BROWSER_PROXYING = \"enable-browser-proxying\";\n  private static final String DISABLE_BANNER = \"disable-banner\";\n  private static final String DISABLE_REQUEST_JOURNAL = \"no-request-journal\";\n  private static final String EXTENSIONS = \"extensions\";\n  private static final String DISABLE_EXTENSION_SCANNING = \"disable-extensions-scanning\";\n  private static final String MAX_ENTRIES_REQUEST_JOURNAL = \"max-request-journal-entries\";\n  private static final String JETTY_ACCEPTOR_THREAD_COUNT = \"jetty-acceptor-threads\";\n  private static final String PRINT_ALL_NETWORK_TRAFFIC = \"print-all-network-traffic\";\n  private static final String JETTY_ACCEPT_QUEUE_SIZE = \"jetty-accept-queue-size\";\n  @Deprecated private static final String JETTY_HEADER_BUFFER_SIZE = \"jetty-header-buffer-size\";\n  private static final String JETTY_HEADER_REQUEST_SIZE = \"jetty-header-request-size\";\n  private static final String JETTY_HEADER_RESPONSE_SIZE = \"jetty-header-response-size\";\n  private static final String JETTY_STOP_TIMEOUT = \"jetty-stop-timeout\";\n  private static final String JETTY_IDLE_TIMEOUT = \"jetty-idle-timeout\";\n  private static final String ROOT_DIR = \"root-dir\";\n  private static final String CONTAINER_THREADS = \"container-threads\";\n  private static final String GLOBAL_RESPONSE_TEMPLATING = \"global-response-templating\";\n  private static final String LOCAL_RESPONSE_TEMPLATING = \"local-response-templating\";\n  private static final String DISABLE_RESPONSE_TEMPLATING = \"disable-response-templating\";\n  public static final String FILENAME_TEMPLATE = \"filename-template\";\n  private static final String ADMIN_API_BASIC_AUTH = \"admin-api-basic-auth\";\n  private static final String ADMIN_API_REQUIRE_HTTPS = \"admin-api-require-https\";\n  private static final String ASYNCHRONOUS_RESPONSE_ENABLED = \"async-response-enabled\";\n  private static final String ASYNCHRONOUS_RESPONSE_THREADS = \"async-response-threads\";\n  private static final String USE_CHUNKED_ENCODING = \"use-chunked-encoding\";\n  private static final String MAX_TEMPLATE_CACHE_ENTRIES = \"max-template-cache-entries\";\n  private static final String PERMITTED_SYSTEM_KEYS = \"permitted-system-keys\";\n  private static final String DISABLE_GZIP = \"disable-gzip\";\n  private static final String DISABLE_REQUEST_LOGGING = \"disable-request-logging\";\n  private static final String ENABLE_STUB_CORS = \"enable-stub-cors\";\n  private static final String TRUST_ALL_PROXY_TARGETS = \"trust-all-proxy-targets\";\n  private static final String TRUST_PROXY_TARGET = \"trust-proxy-target\";\n  private static final String HTTPS_CA_KEYSTORE = \"ca-keystore\";\n  private static final String HTTPS_CA_KEYSTORE_PASSWORD = \"ca-keystore-password\";\n  private static final String HTTPS_CA_KEYSTORE_TYPE = \"ca-keystore-type\";\n  private static final String DISABLE_OPTIMIZE_XML_FACTORIES_LOADING =\n      \"disable-optimize-xml-factories-loading\";\n  private static final String DISABLE_STRICT_HTTP_HEADERS = \"disable-strict-http-headers\";\n  private static final String LOAD_RESOURCES_FROM_CLASSPATH = \"load-resources-from-classpath\";\n  private static final String LOGGED_RESPONSE_BODY_SIZE_LIMIT = \"logged-response-body-size-limit\";\n  private static final String ALLOW_PROXY_TARGETS = \"allow-proxy-targets\";\n  private static final String DENY_PROXY_TARGETS = \"deny-proxy-targets\";\n  private static final String PROXY_TIMEOUT = \"proxy-timeout\";\n  private static final String MAX_HTTP_CLIENT_CONNECTIONS = \"max-http-client-connections\";\n  private static final String DISABLE_CONNECTION_REUSE = \"disable-connection-reuse\";\n  private static final String PROXY_PASS_THROUGH = \"proxy-pass-through\";\n  private static final String SUPPORTED_PROXY_ENCODINGS = \"supported-proxy-encodings\";\n  private static final String WEBHOOK_THREADPOOL_SIZE = \"webhook-threadpool-size\";\n  private static final String WEBSOCKET_IDLE_TIMEOUT = \"websocket-idle-timeout\";\n  private static final String WEBSOCKET_MAX_TEXT_MESSAGE_SIZE = \"websocket-max-text-message-size\";\n  private static final String WEBSOCKET_MAX_BINARY_MESSAGE_SIZE =\n      \"websocket-max-binary-message-size\";\n\n  private final OptionSet optionSet;\n\n  private final Stores stores;\n  private final FileSource fileSource;\n\n  private final MappingsSource mappingsSource;\n  private final ExtensionDeclarations extensions;\n  private final FilenameMaker filenameMaker;\n\n  private String helpText;\n  private Integer actualHttpPort;\n  private Integer actualHttpsPort;\n\n  public CommandLineOptions(String... args) {\n    OptionParser optionParser = new OptionParser();\n    optionParser\n        .accepts(\n            PORT,\n            \"The port number for the server to listen on (default: 8080). 0 for dynamic port selection.\")\n        .withRequiredArg();\n    optionParser.accepts(DISABLE_HTTP, \"Disable the default HTTP listener.\");\n    optionParser.accepts(DISABLE_HTTP2_PLAIN, \"Disable HTTP/2 on plain text (HTTP) connections.\");\n    optionParser.accepts(DISABLE_HTTP2_TLS, \"Disable HTTP/2 on TLS (HTTPS) connections.\");\n    optionParser\n        .accepts(\n            HTTPS_PORT,\n            \"If this option is present WireMock will enable HTTPS on the specified port\")\n        .withRequiredArg();\n    optionParser.accepts(BIND_ADDRESS, \"The IP to listen connections\").withRequiredArg();\n    optionParser.accepts(CONTAINER_THREADS, \"The number of container threads\").withRequiredArg();\n    optionParser.accepts(TIMEOUT, \"The default global timeout in milliseconds.\").withRequiredArg();\n    optionParser.accepts(\n        DISABLE_OPTIMIZE_XML_FACTORIES_LOADING,\n        \"Whether to disable optimize XML factories loading or not.\");\n    optionParser.accepts(\n        DISABLE_STRICT_HTTP_HEADERS,\n        \"Whether to disable strict HTTP header handling of Jetty or not.\");\n    optionParser.accepts(\n        REQUIRE_CLIENT_CERT,\n        \"Make the server require a trusted client certificate to enable a connection\");\n    optionParser\n        .accepts(HTTPS_TRUSTSTORE_TYPE, \"The HTTPS trust store type\")\n        .withRequiredArg()\n        .defaultsTo(\"JKS\");\n    optionParser\n        .accepts(HTTPS_TRUSTSTORE_PASSWORD, \"Password for the trust store\")\n        .withRequiredArg()\n        .defaultsTo(\"password\");\n    optionParser\n        .accepts(\n            HTTPS_TRUSTSTORE,\n            \"Path to an alternative truststore for HTTPS client certificates. Must have a password of \\\"password\\\".\")\n        .requiredIf(REQUIRE_CLIENT_CERT)\n        .requiredIf(HTTPS_TRUSTSTORE_PASSWORD)\n        .withRequiredArg();\n    optionParser\n        .accepts(HTTPS_KEYSTORE_TYPE, \"The HTTPS keystore type.\")\n        .withRequiredArg()\n        .defaultsTo(\"JKS\");\n    optionParser\n        .accepts(HTTPS_KEYSTORE_PASSWORD, \"Password for the alternative keystore.\")\n        .withRequiredArg()\n        .defaultsTo(\"password\");\n    optionParser\n        .accepts(\n            HTTPS_KEY_MANAGER_PASSWORD,\n            \"Key manager password for use with the alternative keystore.\")\n        .withRequiredArg()\n        .defaultsTo(\"password\");\n    optionParser\n        .accepts(\n            HTTPS_KEYSTORE,\n            \"Path to an alternative keystore for HTTPS. Password is assumed to be \\\"password\\\" if not specified.\")\n        .requiredIf(HTTPS_KEYSTORE_PASSWORD)\n        .withRequiredArg()\n        .defaultsTo(getResource(CommandLineOptions.class, \"keystore\").toString());\n    optionParser\n        .accepts(PROXY_ALL, \"Will create a proxy mapping for /* to the specified URL\")\n        .withRequiredArg();\n    optionParser.accepts(\n        PRESERVE_HOST_HEADER,\n        \"Will transfer the original host header from the client to the proxied service\");\n    optionParser.accepts(\n        PRESERVE_USER_AGENT_PROXY_HEADER,\n        \"Will transfer the original User-Agent header from the client to the proxied service\");\n    optionParser\n        .accepts(PROXY_VIA, \"Specifies a proxy server to use when routing proxy mapped requests\")\n        .withRequiredArg();\n    optionParser.accepts(\n        RECORD_MAPPINGS, \"Enable recording of all (non-admin) requests as mapping files\");\n    optionParser\n        .accepts(MATCH_HEADERS, \"Enable request header matching when recording through a proxy\")\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            ROOT_DIR,\n            \"Specifies path for storing recordings (parent for \"\n                + MAPPINGS_ROOT\n                + \" and \"\n                + WireMockApp.FILES_ROOT\n                + \" folders)\")\n        .withRequiredArg()\n        .defaultsTo(\".\");\n    optionParser.accepts(VERBOSE, \"Enable verbose logging to stdout\");\n    optionParser.accepts(\n        ENABLE_BROWSER_PROXYING, \"Allow wiremock to be set as a browser's proxy server\");\n    optionParser.accepts(\n        DISABLE_REQUEST_JOURNAL,\n        \"Disable the request journal (to avoid heap growth when running wiremock for long periods without reset)\");\n    optionParser.accepts(DISABLE_BANNER, \"Disable print banner logo\");\n    optionParser\n        .accepts(\n            EXTENSIONS,\n            \"Matching and/or response transformer extension class names, comma separated.\")\n        .withRequiredArg();\n    optionParser.accepts(\n        DISABLE_EXTENSION_SCANNING,\n        \"Prevent extensions from being scanned and loaded from the classpath\");\n    optionParser\n        .accepts(\n            MAX_ENTRIES_REQUEST_JOURNAL,\n            \"Set maximum number of entries in request journal (if enabled) to discard old entries if the log becomes too large. Default: no discard\")\n        .withRequiredArg();\n    optionParser\n        .accepts(JETTY_ACCEPTOR_THREAD_COUNT, \"Number of Jetty acceptor threads\")\n        .withRequiredArg();\n    optionParser\n        .accepts(JETTY_ACCEPT_QUEUE_SIZE, \"The size of Jetty's accept queue size\")\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            JETTY_HEADER_BUFFER_SIZE, \"Deprecated. The size of Jetty's buffer for request headers\")\n        .withRequiredArg();\n    optionParser\n        .accepts(JETTY_HEADER_REQUEST_SIZE, \"The size of Jetty's buffer for request headers\")\n        .withRequiredArg();\n    optionParser\n        .accepts(JETTY_HEADER_RESPONSE_SIZE, \"The size of Jetty's buffer for response headers\")\n        .withRequiredArg();\n    optionParser\n        .accepts(JETTY_STOP_TIMEOUT, \"Timeout in milliseconds for Jetty to stop\")\n        .withRequiredArg();\n    optionParser\n        .accepts(JETTY_IDLE_TIMEOUT, \"Idle timeout in milliseconds for Jetty connections\")\n        .withRequiredArg();\n    optionParser.accepts(\n        PRINT_ALL_NETWORK_TRAFFIC,\n        \"Print all raw incoming and outgoing network traffic to console\");\n    optionParser.accepts(\n        GLOBAL_RESPONSE_TEMPLATING, \"Preprocess all responses with Handlebars templates\");\n    optionParser.accepts(FILENAME_TEMPLATE, \"Add filename template\").withRequiredArg();\n    optionParser.accepts(\n        LOCAL_RESPONSE_TEMPLATING, \"Preprocess selected responses with Handlebars templates\");\n    optionParser.accepts(\n        DISABLE_RESPONSE_TEMPLATING, \"Disable processing of responses with Handlebars templates\");\n    optionParser\n        .accepts(\n            ADMIN_API_BASIC_AUTH,\n            \"Require HTTP Basic authentication for admin API calls with the supplied credentials in username:password format\")\n        .withRequiredArg();\n    optionParser.accepts(\n        ADMIN_API_REQUIRE_HTTPS, \"Require HTTPS to be used to access the admin API\");\n    optionParser\n        .accepts(ASYNCHRONOUS_RESPONSE_ENABLED, \"Enable asynchronous response\")\n        .withRequiredArg()\n        .defaultsTo(\"false\");\n    optionParser\n        .accepts(ASYNCHRONOUS_RESPONSE_THREADS, \"Number of asynchronous response threads\")\n        .withRequiredArg()\n        .defaultsTo(\"10\");\n    optionParser\n        .accepts(\n            USE_CHUNKED_ENCODING,\n            \"Whether to use Transfer-Encoding: chunked in responses. Can be set to always, never or body_file.\")\n        .withRequiredArg()\n        .defaultsTo(\"always\");\n    optionParser\n        .accepts(\n            MAX_TEMPLATE_CACHE_ENTRIES,\n            \"The maximum number of response template fragments that can be cached. Only has any effect when templating is enabled. Defaults to no limit.\")\n        .withOptionalArg();\n    optionParser\n        .accepts(\n            PERMITTED_SYSTEM_KEYS,\n            \"A list of case-insensitive regular expressions for names of permitted system properties and environment vars. Only has any effect when templating is enabled. Defaults to no limit.\")\n        .withOptionalArg()\n        .ofType(String.class)\n        .withValuesSeparatedBy(\",\");\n    optionParser.accepts(DISABLE_GZIP, \"Disable gzipping of request and response bodies\");\n    optionParser.accepts(\n        DISABLE_REQUEST_LOGGING,\n        \"Disable logging of stub requests and responses to the notifier. Useful when performance testing.\");\n    optionParser.accepts(\n        ENABLE_STUB_CORS, \"Enable automatic sending of CORS headers with stub responses.\");\n    optionParser\n        .accepts(\n            TRUST_ALL_PROXY_TARGETS,\n            \"Trust all certificates presented by origins when browser proxying\")\n        .availableIf(ENABLE_BROWSER_PROXYING);\n    optionParser\n        .accepts(\n            TRUST_PROXY_TARGET,\n            \"Trust any certificate presented by this origin when browser proxying\")\n        .availableIf(ENABLE_BROWSER_PROXYING)\n        .availableUnless(TRUST_ALL_PROXY_TARGETS)\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            HTTPS_CA_KEYSTORE,\n            \"Path to an alternative keystore containing a Certificate Authority private key & certificate for generating certificates when proxying HTTPS. Password is assumed to be \\\"password\\\" if not specified.\")\n        .availableIf(ENABLE_BROWSER_PROXYING)\n        .withRequiredArg()\n        .defaultsTo(DEFAULT_CA_KEYSTORE_PATH);\n    optionParser\n        .accepts(HTTPS_CA_KEYSTORE_PASSWORD, \"Password for the alternative CA keystore.\")\n        .availableIf(HTTPS_CA_KEYSTORE)\n        .withRequiredArg()\n        .defaultsTo(DEFAULT_CA_KESTORE_PASSWORD);\n    optionParser\n        .accepts(HTTPS_CA_KEYSTORE_TYPE, \"Type of the alternative CA keystore (jks or pkcs12).\")\n        .availableIf(HTTPS_CA_KEYSTORE)\n        .withRequiredArg()\n        .defaultsTo(\"jks\");\n    optionParser\n        .accepts(\n            LOAD_RESOURCES_FROM_CLASSPATH,\n            \"Specifies path on the classpath for storing recordings (parent for \"\n                + MAPPINGS_ROOT\n                + \" and \"\n                + WireMockApp.FILES_ROOT\n                + \" folders)\")\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            LOGGED_RESPONSE_BODY_SIZE_LIMIT,\n            \"Maximum size for response bodies stored in the request journal beyond which truncation will be applied\")\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            ALLOW_PROXY_TARGETS,\n            \"Comma separated list of IP addresses, IP ranges (hyphenated) and domain name wildcards that can be proxied to/recorded from. Is evaluated before the list of denied addresses.\")\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            DENY_PROXY_TARGETS,\n            \"Comma-separated list of IP addresses, IP ranges (hyphenated) and domain name wildcards that cannot be proxied to/recorded from. Is evaluated after the list of allowed addresses.\")\n        .withRequiredArg();\n    optionParser\n        .accepts(PROXY_TIMEOUT, \"Timeout in milliseconds for requests to proxy\")\n        .withRequiredArg();\n    optionParser\n        .accepts(PROXY_PASS_THROUGH, \"Flag to control browser proxy pass through\")\n        .withRequiredArg();\n    optionParser\n        .accepts(MAX_HTTP_CLIENT_CONNECTIONS, \"Maximum connections for Http Client\")\n        .withRequiredArg();\n    optionParser\n        .accepts(DISABLE_CONNECTION_REUSE, \"Disable http connection reuse\")\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            SUPPORTED_PROXY_ENCODINGS,\n            \"Comma-separated list of supported accept-encoding values for use when proxying and recording\")\n        .withRequiredArg()\n        .ofType(String.class)\n        .withValuesSeparatedBy(\",\");\n    optionParser\n        .accepts(WEBHOOK_THREADPOOL_SIZE, \"The size of the webhook thread pool\")\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            WEBSOCKET_IDLE_TIMEOUT,\n            \"Idle timeout in milliseconds for WebSocket connections (default: 300000)\")\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            WEBSOCKET_MAX_TEXT_MESSAGE_SIZE,\n            \"Maximum size in bytes for WebSocket text messages (default: 65536)\")\n        .withRequiredArg();\n    optionParser\n        .accepts(\n            WEBSOCKET_MAX_BINARY_MESSAGE_SIZE,\n            \"Maximum size in bytes for WebSocket binary messages (default: 65536)\")\n        .withRequiredArg();\n\n    optionParser.accepts(VERSION, \"Prints wiremock version information and exits\");\n\n    optionParser.accepts(HELP, \"Print this message\").forHelp();\n\n    optionSet = optionParser.parse(args);\n    validate();\n    captureHelpTextIfRequested(optionParser);\n\n    extensions = new ExtensionDeclarations();\n\n    if (optionSet.has(LOAD_RESOURCES_FROM_CLASSPATH)) {\n      fileSource =\n          new ClasspathFileSource((String) optionSet.valueOf(LOAD_RESOURCES_FROM_CLASSPATH));\n    } else {\n      fileSource = new SingleRootFileSource((String) optionSet.valueOf(ROOT_DIR));\n    }\n\n    stores = new DefaultStores(fileSource);\n\n    if (optionSet.has(PROXY_PASS_THROUGH)) {\n      GlobalSettings newSettings =\n          stores\n              .getSettingsStore()\n              .get()\n              .copy()\n              .proxyPassThrough(\n                  Boolean.parseBoolean((String) optionSet.valueOf(PROXY_PASS_THROUGH)))\n              .build();\n      stores.getSettingsStore().set(newSettings);\n    }\n\n    filenameMaker = new FilenameMaker(getFilenameTemplateOption());\n    mappingsSource =\n        new JsonFileMappingsSource(\n            fileSource.child(MAPPINGS_ROOT),\n            fileSource.child(MESSAGE_MAPPINGS_ROOT),\n            filenameMaker);\n    buildExtensions();\n\n    actualHttpPort = null;\n  }\n\n  private void buildExtensions() {\n    if (optionSet.has(EXTENSIONS)) {\n      String classNamesParamValue = (String) optionSet.valueOf(EXTENSIONS);\n      final String[] classNames = classNamesParamValue.split(\",\");\n      extensions.add(classNames);\n    }\n  }\n\n  private String getFilenameTemplateOption() {\n    if (optionSet.has(FILENAME_TEMPLATE)) {\n      String filenameTemplate = (String) optionSet.valueOf(FILENAME_TEMPLATE);\n      validateFilenameTemplate(filenameTemplate);\n      return filenameTemplate;\n    }\n\n    return null;\n  }\n\n  private void validateFilenameTemplate(String filenameTemplate) {\n    String[] templateParts = filenameTemplate.split(\"-\");\n    boolean handlebarIdentifierMissed =\n        Arrays.stream(templateParts)\n            .anyMatch(part -> !part.contains(\"{{{\") || !part.contains(\"}}}\"));\n    if (handlebarIdentifierMissed) {\n      throw new IllegalArgumentException(\n          \"Format for filename template should be contain handlebar value. Please check format one more time\");\n    }\n  }\n\n  private void validate() {\n    if (optionSet.has(PORT) && optionSet.has(DISABLE_HTTP)) {\n      throw new IllegalArgumentException(\n          \"The HTTP listener can't have a port set and be disabled at the same time\");\n    }\n    if (!optionSet.has(HTTPS_PORT) && optionSet.has(DISABLE_HTTP)) {\n      throw new IllegalArgumentException(\"HTTPS must be enabled if HTTP is not.\");\n    }\n\n    if (optionSet.has(RECORD_MAPPINGS) && optionSet.has(DISABLE_REQUEST_JOURNAL)) {\n      throw new IllegalArgumentException(\"Request journal must be enabled to record stubs\");\n    }\n  }\n\n  private void captureHelpTextIfRequested(OptionParser optionParser) {\n    if (optionSet.has(HELP)) {\n      StringWriter out = new StringWriter();\n      try {\n        optionParser.printHelpOn(out);\n      } catch (IOException e) {\n        throw new RuntimeException(e);\n      }\n\n      helpText = out.toString();\n    }\n  }\n\n  public boolean verboseLoggingEnabled() {\n    return optionSet.has(VERBOSE);\n  }\n\n  public boolean recordMappingsEnabled() {\n    return optionSet.has(RECORD_MAPPINGS);\n  }\n\n  @Override\n  public List<CaseInsensitiveKey> matchingHeaders() {\n    if (optionSet.hasArgument(MATCH_HEADERS)) {\n      String headerSpec = (String) optionSet.valueOf(MATCH_HEADERS);\n\n      return Arrays.stream(headerSpec.split(\",\"))\n          .map(TO_CASE_INSENSITIVE_KEYS)\n          .collect(Collectors.toUnmodifiableList());\n    }\n\n    return Collections.emptyList();\n  }\n\n  @Override\n  public HttpServerFactory httpServerFactory() {\n    return new JettyHttpServerFactory(jettySettings());\n  }\n\n  @Override\n  public HttpClientFactory httpClientFactory() {\n    return new ApacheHttpClientFactory();\n  }\n\n  private boolean specifiesPortNumber() {\n    return optionSet.has(PORT);\n  }\n\n  @Override\n  public int portNumber() {\n    if (specifiesPortNumber()) {\n      return Integer.parseInt((String) optionSet.valueOf(PORT));\n    }\n\n    return DEFAULT_PORT;\n  }\n\n  @Override\n  public boolean getHttpDisabled() {\n    return optionSet.has(DISABLE_HTTP);\n  }\n\n  @Override\n  public boolean getHttp2PlainDisabled() {\n    return optionSet.has(DISABLE_HTTP2_PLAIN);\n  }\n\n  @Override\n  public boolean getHttp2TlsDisabled() {\n    return optionSet.has(DISABLE_HTTP2_TLS);\n  }\n\n  public void setActualHttpPort(int port) {\n    actualHttpPort = port;\n  }\n\n  public void setActualHttpsPort(int port) {\n    actualHttpsPort = port;\n  }\n\n  @Override\n  public String bindAddress() {\n    if (optionSet.has(BIND_ADDRESS)) {\n      return (String) optionSet.valueOf(BIND_ADDRESS);\n    }\n\n    return DEFAULT_BIND_ADDRESS;\n  }\n\n  @Override\n  public FilenameMaker getFilenameMaker() {\n    return filenameMaker;\n  }\n\n  @Override\n  public HttpsSettings httpsSettings() {\n    return new HttpsSettings.Builder()\n        .port(httpsPortNumber())\n        .keyStorePath((String) optionSet.valueOf(HTTPS_KEYSTORE))\n        .keyStorePassword((String) optionSet.valueOf(HTTPS_KEYSTORE_PASSWORD))\n        .keyStoreType((String) optionSet.valueOf(HTTPS_KEYSTORE_TYPE))\n        .keyManagerPassword((String) optionSet.valueOf(HTTPS_KEY_MANAGER_PASSWORD))\n        .trustStorePath((String) optionSet.valueOf(HTTPS_TRUSTSTORE))\n        .trustStorePassword((String) optionSet.valueOf(HTTPS_TRUSTSTORE_PASSWORD))\n        .trustStoreType((String) optionSet.valueOf(HTTPS_TRUSTSTORE_TYPE))\n        .needClientAuth(optionSet.has(REQUIRE_CLIENT_CERT))\n        .build();\n  }\n\n  private JettySettings jettySettings() {\n\n    JettySettings.Builder builder = JettySettings.Builder.aJettySettings();\n\n    if (optionSet.hasArgument(JETTY_ACCEPTOR_THREAD_COUNT)) {\n      builder =\n          builder.withAcceptors(\n              Integer.parseInt((String) optionSet.valueOf(JETTY_ACCEPTOR_THREAD_COUNT)));\n    }\n\n    if (optionSet.hasArgument(JETTY_ACCEPT_QUEUE_SIZE)) {\n      builder =\n          builder.withAcceptQueueSize(\n              Integer.parseInt((String) optionSet.valueOf(JETTY_ACCEPT_QUEUE_SIZE)));\n    }\n\n    // @Deprecated\n    if (optionSet.hasArgument(JETTY_HEADER_BUFFER_SIZE)) {\n      builder =\n          builder.withRequestHeaderSize(\n              Integer.parseInt((String) optionSet.valueOf(JETTY_HEADER_BUFFER_SIZE)));\n    }\n\n    if (optionSet.hasArgument(JETTY_HEADER_REQUEST_SIZE)) {\n      builder =\n          builder.withRequestHeaderSize(\n              Integer.parseInt((String) optionSet.valueOf(JETTY_HEADER_REQUEST_SIZE)));\n    }\n\n    if (optionSet.hasArgument(JETTY_HEADER_RESPONSE_SIZE)) {\n      builder =\n          builder.withResponseHeaderSize(\n              Integer.parseInt((String) optionSet.valueOf(JETTY_HEADER_RESPONSE_SIZE)));\n    }\n\n    if (optionSet.hasArgument(JETTY_STOP_TIMEOUT)) {\n      builder =\n          builder.withStopTimeout(Long.parseLong((String) optionSet.valueOf(JETTY_STOP_TIMEOUT)));\n    }\n\n    if (optionSet.hasArgument(JETTY_IDLE_TIMEOUT)) {\n      builder =\n          builder.withIdleTimeout(Long.parseLong((String) optionSet.valueOf(JETTY_IDLE_TIMEOUT)));\n    }\n\n    return builder.build();\n  }\n\n  private int httpsPortNumber() {\n    return optionSet.has(HTTPS_PORT)\n        ? Integer.parseInt((String) optionSet.valueOf(HTTPS_PORT))\n        : -1;\n  }\n\n  public boolean version() {\n    return optionSet.has(VERSION);\n  }\n\n  public boolean help() {\n    return optionSet.has(HELP);\n  }\n\n  public String helpText() {\n    return helpText;\n  }\n\n  public boolean specifiesProxyUrl() {\n    return optionSet.has(PROXY_ALL);\n  }\n\n  public String proxyUrl() {\n    return (String) optionSet.valueOf(PROXY_ALL);\n  }\n\n  @Override\n  public boolean shouldPreserveHostHeader() {\n    return optionSet.has(PRESERVE_HOST_HEADER);\n  }\n\n  @Override\n  public boolean shouldPreserveUserAgentProxyHeader() {\n    return optionSet.has(PRESERVE_USER_AGENT_PROXY_HEADER);\n  }\n\n  @Override\n  public String proxyHostHeader() {\n    return optionSet.hasArgument(PROXY_ALL) ? getHostAndPort() : null;\n  }\n\n  private String getHostAndPort() {\n    return AbsoluteUrl.parse((String) optionSet.valueOf(PROXY_ALL))\n        .getAuthority()\n        .getHostAndPort()\n        .toString();\n  }\n\n  @Override\n  public ExtensionDeclarations getDeclaredExtensions() {\n    return extensions;\n  }\n\n  @Override\n  public boolean isExtensionScanningEnabled() {\n    return !optionSet.has(DISABLE_EXTENSION_SCANNING);\n  }\n\n  @Override\n  public WiremockNetworkTrafficListener networkTrafficListener() {\n    if (optionSet.has(PRINT_ALL_NETWORK_TRAFFIC)) {\n      return new ConsoleNotifyingWiremockNetworkTrafficListener();\n    } else {\n      return new DoNothingWiremockNetworkTrafficListener();\n    }\n  }\n\n  @Override\n  public Authenticator getAdminAuthenticator() {\n    if (optionSet.has(ADMIN_API_BASIC_AUTH)) {\n      String[] parts = ((String) optionSet.valueOf(ADMIN_API_BASIC_AUTH)).split(\":\");\n      if (parts.length != 2) {\n        throw new IllegalArgumentException(\n            \"Admin API credentials must be in the format username:password\");\n      }\n\n      return new BasicAuthenticator(parts[0], parts[1]);\n    }\n\n    return new NoAuthenticator();\n  }\n\n  @Override\n  public boolean getHttpsRequiredForAdminApi() {\n    return optionSet.has(ADMIN_API_REQUIRE_HTTPS);\n  }\n\n  /**\n   * @deprecated use {@link BrowserProxySettings#enabled()}\n   */\n  @Deprecated\n  @Override\n  public boolean browserProxyingEnabled() {\n    return browserProxySettings().enabled();\n  }\n\n  @Override\n  public ProxySettings proxyVia() {\n    if (optionSet.has(PROXY_VIA)) {\n      String proxyVia = (String) optionSet.valueOf(PROXY_VIA);\n      return ProxySettings.fromString(proxyVia);\n    }\n    return NO_PROXY;\n  }\n\n  @Override\n  public Stores getStores() {\n    return stores;\n  }\n\n  @Override\n  public FileSource filesRoot() {\n    return fileSource;\n  }\n\n  @Override\n  public MappingsLoader mappingsLoader() {\n    return mappingsSource;\n  }\n\n  @Override\n  public MappingsSaver mappingsSaver() {\n    return mappingsSource;\n  }\n\n  @Override\n  public Notifier notifier() {\n    return new ConsoleNotifier(verboseLoggingEnabled());\n  }\n\n  @Override\n  public boolean requestJournalDisabled() {\n    return optionSet.has(DISABLE_REQUEST_JOURNAL);\n  }\n\n  public boolean bannerDisabled() {\n    return optionSet.has(DISABLE_BANNER);\n  }\n\n  private boolean specifiesMaxRequestJournalEntries() {\n    return optionSet.has(MAX_ENTRIES_REQUEST_JOURNAL);\n  }\n\n  @Override\n  public Optional<Integer> maxRequestJournalEntries() {\n    if (specifiesMaxRequestJournalEntries()) {\n      return Optional.of(Integer.parseInt((String) optionSet.valueOf(MAX_ENTRIES_REQUEST_JOURNAL)));\n    }\n    return Optional.empty();\n  }\n\n  @Override\n  public int containerThreads() {\n    if (optionSet.has(CONTAINER_THREADS)) {\n      return Integer.parseInt((String) optionSet.valueOf(CONTAINER_THREADS));\n    }\n\n    return DEFAULT_CONTAINER_THREADS;\n  }\n\n  @Override\n  public String toString() {\n    Map<String, Object> map = new LinkedHashMap<>();\n\n    map.put(VERSION, Version.getCurrentVersion());\n\n    if (actualHttpPort != null) {\n      map.put(PORT, actualHttpPort);\n    }\n\n    if (actualHttpsPort != null) {\n      map.put(HTTPS_PORT, actualHttpsPort);\n    }\n\n    if (httpsSettings().enabled()) {\n      map.put(HTTPS_KEYSTORE, nullToString(httpsSettings().keyStorePath()));\n    }\n\n    if (proxyVia() != NO_PROXY) {\n      map.put(PROXY_VIA, proxyVia());\n    }\n    if (proxyUrl() != null) {\n      map.put(PROXY_ALL, nullToString(proxyUrl()));\n      map.put(PRESERVE_HOST_HEADER, shouldPreserveHostHeader());\n      map.put(PRESERVE_USER_AGENT_PROXY_HEADER, shouldPreserveUserAgentProxyHeader());\n    }\n\n    BrowserProxySettings browserProxySettings = browserProxySettings();\n\n    map.put(ENABLE_BROWSER_PROXYING, browserProxySettings.enabled());\n    if (browserProxySettings.enabled()) {\n      KeyStoreSettings keyStoreSettings = browserProxySettings.caKeyStore();\n      map.put(TRUST_ALL_PROXY_TARGETS, browserProxySettings.trustAllProxyTargets());\n      List<String> trustedProxyTargets = browserProxySettings.trustedProxyTargets();\n      if (!trustedProxyTargets.isEmpty()) {\n        map.put(TRUST_PROXY_TARGET, String.join(\", \", trustedProxyTargets));\n      }\n      map.put(HTTPS_CA_KEYSTORE, keyStoreSettings.path());\n      map.put(HTTPS_CA_KEYSTORE_TYPE, keyStoreSettings.type());\n    }\n\n    map.put(DISABLE_BANNER, bannerDisabled());\n\n    if (recordMappingsEnabled()) {\n      map.put(RECORD_MAPPINGS, recordMappingsEnabled());\n      map.put(MATCH_HEADERS, matchingHeaders());\n    }\n\n    map.put(DISABLE_REQUEST_JOURNAL, requestJournalDisabled());\n    map.put(VERBOSE, verboseLoggingEnabled());\n\n    if (jettySettings().getAcceptQueueSize().isPresent()) {\n      map.put(JETTY_ACCEPT_QUEUE_SIZE, jettySettings().getAcceptQueueSize().get());\n    }\n\n    if (jettySettings().getAcceptors().isPresent()) {\n      map.put(JETTY_ACCEPTOR_THREAD_COUNT, jettySettings().getAcceptors().get());\n    }\n\n    if (jettySettings().getRequestHeaderSize().isPresent()) {\n      map.put(JETTY_HEADER_BUFFER_SIZE, jettySettings().getRequestHeaderSize().get());\n    }\n\n    if (!(getAdminAuthenticator() instanceof NoAuthenticator)) {\n      map.put(ADMIN_API_BASIC_AUTH, \"enabled\");\n    }\n\n    if (getHttpsRequiredForAdminApi()) {\n      map.put(ADMIN_API_REQUIRE_HTTPS, \"true\");\n    }\n\n    StringBuilder sb = new StringBuilder();\n    for (Map.Entry<String, Object> param : map.entrySet()) {\n      int paddingLength = 29 - param.getKey().length();\n      sb.append(param.getKey())\n          .append(\":\")\n          .append(\" \".repeat(Math.max(0, paddingLength)))\n          .append(nullToString(param.getValue()))\n          .append(\"\\n\");\n    }\n\n    return sb.toString();\n  }\n\n  private String nullToString(Object value) {\n    if (value == null) {\n      return \"(null)\";\n    }\n\n    return value.toString();\n  }\n\n  @Override\n  public AsynchronousResponseSettings getAsynchronousResponseSettings() {\n    return new AsynchronousResponseSettings(\n        isAsynchronousResponseEnabled(), getAsynchronousResponseThreads());\n  }\n\n  @Override\n  public ChunkedEncodingPolicy getChunkedEncodingPolicy() {\n    return optionSet.has(USE_CHUNKED_ENCODING)\n        ? ChunkedEncodingPolicy.valueOf(\n            optionSet.valueOf(USE_CHUNKED_ENCODING).toString().toUpperCase())\n        : ChunkedEncodingPolicy.ALWAYS;\n  }\n\n  @Override\n  public boolean getGzipDisabled() {\n    return optionSet.has(DISABLE_GZIP);\n  }\n\n  @Override\n  public boolean getStubRequestLoggingDisabled() {\n    return optionSet.has(DISABLE_REQUEST_LOGGING);\n  }\n\n  @Override\n  public boolean getStubCorsEnabled() {\n    return optionSet.has(ENABLE_STUB_CORS);\n  }\n\n  @Override\n  public long timeout() {\n    return optionSet.hasArgument(TIMEOUT)\n        ? Long.parseLong((String) optionSet.valueOf(TIMEOUT))\n        : DEFAULT_TIMEOUT;\n  }\n\n  @Override\n  public boolean getDisableOptimizeXmlFactoriesLoading() {\n    return optionSet.has(DISABLE_OPTIMIZE_XML_FACTORIES_LOADING);\n  }\n\n  @Override\n  public boolean getDisableStrictHttpHeaders() {\n    return optionSet.has(DISABLE_STRICT_HTTP_HEADERS);\n  }\n\n  @Override\n  public DataTruncationSettings getDataTruncationSettings() {\n    return optionSet.has(LOGGED_RESPONSE_BODY_SIZE_LIMIT)\n        ? new DataTruncationSettings(\n            new Limit(\n                Integer.parseInt((String) optionSet.valueOf(LOGGED_RESPONSE_BODY_SIZE_LIMIT))))\n        : DataTruncationSettings.DEFAULTS;\n  }\n\n  @Override\n  public NetworkAddressRules getProxyTargetRules() {\n    DefaultNetworkAddressRules.Builder builder = NetworkAddressRules.builder();\n    if (optionSet.has(ALLOW_PROXY_TARGETS)) {\n      Arrays.stream(((String) optionSet.valueOf(ALLOW_PROXY_TARGETS)).split(\",\"))\n          .forEach(builder::allow);\n    }\n\n    if (optionSet.has(DENY_PROXY_TARGETS)) {\n      Arrays.stream(((String) optionSet.valueOf(DENY_PROXY_TARGETS)).split(\",\"))\n          .forEach(builder::deny);\n    }\n\n    return builder.build();\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Override\n  public BrowserProxySettings browserProxySettings() {\n    KeyStoreSettings keyStoreSettings =\n        new KeyStoreSettings(\n            KeyStoreSourceFactory.getAppropriateForJreVersion(\n                (String) optionSet.valueOf(HTTPS_CA_KEYSTORE),\n                (String) optionSet.valueOf(HTTPS_CA_KEYSTORE_TYPE),\n                ((String) optionSet.valueOf(HTTPS_CA_KEYSTORE_PASSWORD)).toCharArray()));\n\n    return new BrowserProxySettings.Builder()\n        .enabled(optionSet.has(ENABLE_BROWSER_PROXYING))\n        .trustAllProxyTargets(optionSet.has(TRUST_ALL_PROXY_TARGETS))\n        .trustedProxyTargets((List<String>) optionSet.valuesOf(TRUST_PROXY_TARGET))\n        .caKeyStoreSettings(keyStoreSettings)\n        .build();\n  }\n\n  @Override\n  public int proxyTimeout() {\n    return optionSet.has(PROXY_TIMEOUT)\n        ? Integer.parseInt((String) optionSet.valueOf(PROXY_TIMEOUT))\n        : DEFAULT_TIMEOUT;\n  }\n\n  @Override\n  public int getMaxHttpClientConnections() {\n    return optionSet.has(MAX_HTTP_CLIENT_CONNECTIONS)\n        ? Integer.parseInt((String) optionSet.valueOf(MAX_HTTP_CLIENT_CONNECTIONS))\n        : DEFAULT_MAX_HTTP_CONNECTIONS;\n  }\n\n  @Override\n  public boolean getResponseTemplatingEnabled() {\n    return !optionSet.has(DISABLE_RESPONSE_TEMPLATING);\n  }\n\n  @Override\n  public boolean getResponseTemplatingGlobal() {\n    return optionSet.has(GLOBAL_RESPONSE_TEMPLATING);\n  }\n\n  @Override\n  public Long getMaxTemplateCacheEntries() {\n    return optionSet.has(MAX_TEMPLATE_CACHE_ENTRIES)\n        ? Long.parseLong(optionSet.valueOf(MAX_TEMPLATE_CACHE_ENTRIES).toString())\n        : DEFAULT_MAX_TEMPLATE_CACHE_ENTRIES;\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Override\n  public Set<String> getTemplatePermittedSystemKeys() {\n    return optionSet.has(PERMITTED_SYSTEM_KEYS)\n        ? Set.copyOf((List<String>) optionSet.valuesOf(PERMITTED_SYSTEM_KEYS))\n        : Collections.emptySet();\n  }\n\n  @Override\n  public boolean getTemplateEscapingDisabled() {\n    return true;\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Override\n  public Set<String> getSupportedProxyEncodings() {\n    return optionSet.has(SUPPORTED_PROXY_ENCODINGS)\n        ? Set.copyOf((List<String>) optionSet.valuesOf(SUPPORTED_PROXY_ENCODINGS))\n        : null;\n  }\n\n  private boolean isAsynchronousResponseEnabled() {\n    return optionSet.has(ASYNCHRONOUS_RESPONSE_ENABLED)\n        && Boolean.parseBoolean((String) optionSet.valueOf(ASYNCHRONOUS_RESPONSE_ENABLED));\n  }\n\n  private int getAsynchronousResponseThreads() {\n    return Integer.parseInt((String) optionSet.valueOf(ASYNCHRONOUS_RESPONSE_THREADS));\n  }\n\n  @Override\n  public boolean getDisableConnectionReuse() {\n    return optionSet.has(DISABLE_CONNECTION_REUSE)\n        ? Boolean.parseBoolean((String) optionSet.valueOf(DISABLE_CONNECTION_REUSE))\n        : DEFAULT_DISABLE_CONNECTION_REUSE;\n  }\n\n  @Override\n  public int getWebhookThreadPoolSize() {\n    return optionSet.has(WEBHOOK_THREADPOOL_SIZE)\n        ? Integer.parseInt((String) optionSet.valueOf(WEBHOOK_THREADPOOL_SIZE))\n        : DEFAULT_WEBHOOK_THREADPOOL_SIZE;\n  }\n\n  @Override\n  public long getWebSocketIdleTimeout() {\n    return optionSet.has(WEBSOCKET_IDLE_TIMEOUT)\n        ? Long.parseLong((String) optionSet.valueOf(WEBSOCKET_IDLE_TIMEOUT))\n        : DEFAULT_WEBSOCKET_IDLE_TIMEOUT;\n  }\n\n  @Override\n  public long getWebSocketMaxTextMessageSize() {\n    return optionSet.has(WEBSOCKET_MAX_TEXT_MESSAGE_SIZE)\n        ? Long.parseLong((String) optionSet.valueOf(WEBSOCKET_MAX_TEXT_MESSAGE_SIZE))\n        : DEFAULT_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE;\n  }\n\n  @Override\n  public long getWebSocketMaxBinaryMessageSize() {\n    return optionSet.has(WEBSOCKET_MAX_BINARY_MESSAGE_SIZE)\n        ? Long.parseLong((String) optionSet.valueOf(WEBSOCKET_MAX_BINARY_MESSAGE_SIZE))\n        : DEFAULT_WEBSOCKET_MAX_BINARY_MESSAGE_SIZE;\n  }\n}\n"
  },
  {
    "path": "src/main/java/com/github/tomakehurst/wiremock/standalone/WireMockServerRunner.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.FILES_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MAPPINGS_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MESSAGE_MAPPINGS_ROOT;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.ANY;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static java.lang.System.out;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.common.FatalStartupException;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.core.Version;\nimport com.github.tomakehurst.wiremock.http.CaseInsensitiveKey;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.recording.RecordSpecBuilder;\nimport com.github.tomakehurst.wiremock.recording.RecordingStatus;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.Set;\n\npublic class WireMockServerRunner {\n\n  private static final String BANNER =\n      \"\\n\"\n          + \"\\u001B[34m██     ██ ██ ██████  ███████ \\u001B[33m███    ███  ██████   ██████ ██   ██ \\n\"\n          + \"\\u001B[34m██     ██ ██ ██   ██ ██      \\u001B[33m████  ████ ██    ██ ██      ██  ██  \\n\"\n          + \"\\u001B[34m██  █  ██ ██ ██████  █████   \\u001B[33m██ ████ ██ ██    ██ ██      █████   \\n\"\n          + \"\\u001B[34m██ ███ ██ ██ ██   ██ ██      \\u001B[33m██  ██  ██ ██    ██ ██      ██  ██  \\n\"\n          + \"\\u001B[34m ███ ███  ██ ██   ██ ███████ \\u001B[33m██      ██  ██████   ██████ ██   ██ \\n\"\n          + \"\\n\\u001B[0m\"\n          + \"----------------------------------------------------------------\\n\"\n          + \"|               Cloud: https://wiremock.io/cloud               |\\n\"\n          + \"|                                                              |\\n\"\n          + \"|               Slack: https://slack.wiremock.org              |\\n\"\n          + \"----------------------------------------------------------------\";\n\n  private WireMockServer wireMockServer;\n  private Thread shutdownHook;\n\n  public void run(String... args) {\n    CommandLineOptions options = new CommandLineOptions(args);\n    if (options.help()) {\n      out.println(options.helpText());\n      return;\n    }\n    if (options.version()) {\n      out.println(Version.getCurrentVersion());\n      return;\n    }\n\n    FileSource fileSource = options.filesRoot();\n    fileSource.createIfNecessary();\n    FileSource filesFileSource = fileSource.child(FILES_ROOT);\n    filesFileSource.createIfNecessary();\n    FileSource mappingsFileSource = fileSource.child(MAPPINGS_ROOT);\n    mappingsFileSource.createIfNecessary();\n    FileSource messageMappingsFileSource = fileSource.child(MESSAGE_MAPPINGS_ROOT);\n    messageMappingsFileSource.createIfNecessary();\n\n    wireMockServer = new WireMockServer(options);\n\n    if (options.recordMappingsEnabled()) {\n      startRecordingWithOptions(options);\n    }\n\n    if (options.specifiesProxyUrl()) {\n      addProxyMapping(options.proxyUrl());\n    }\n\n    try {\n      wireMockServer.start();\n\n      // Add shutdown hook to snapshot recordings before JVM exits\n      if (options.recordMappingsEnabled()) {\n        shutdownHook = new Thread(this::stopRecordingIfNecessary);\n        Runtime.getRuntime().addShutdownHook(shutdownHook);\n      }\n      boolean https = options.httpsSettings().enabled();\n\n      if (!options.getHttpDisabled()) {\n        options.setActualHttpPort(wireMockServer.port());\n      }\n\n      if (https) {\n        options.setActualHttpsPort(wireMockServer.httpsPort());\n      }\n\n      if (!options.bannerDisabled()) {\n        out.println(BANNER);\n        out.println();\n      } else {\n        out.println();\n        out.println(\"The WireMock server is started .....\");\n      }\n      out.println(options);\n\n      final Set<String> loadedExtensionNames = wireMockServer.getLoadedExtensionNames();\n      if (!loadedExtensionNames.isEmpty()) {\n        out.println(\"extensions:                   \" + String.join(\",\", loadedExtensionNames));\n      }\n\n    } catch (FatalStartupException e) {\n      System.err.println(e.getMessage());\n      System.exit(1);\n    }\n  }\n\n  private void startRecordingWithOptions(CommandLineOptions options) {\n    RecordSpecBuilder recordSpecBuilder =\n        new RecordSpecBuilder()\n            .makeStubsPersistent(true)\n            .ignoreRepeatRequests()\n            .extractBinaryBodiesOver(0)\n            .extractTextBodiesOver(0);\n\n    List<CaseInsensitiveKey> matchingHeaders = options.matchingHeaders();\n    for (CaseInsensitiveKey header : matchingHeaders) {\n      recordSpecBuilder.captureHeader(header.value());\n    }\n\n    wireMockServer.startRecording(recordSpecBuilder);\n  }\n\n  private void addProxyMapping(final String baseUrl) {\n    wireMockServer.loadMappingsUsing(\n        stubMappings -> {\n          RequestPattern requestPattern = newRequestPattern(ANY, anyUrl()).build();\n          ResponseDefinition responseDef = responseDefinition().proxiedFrom(baseUrl).build();\n\n          StubMapping proxyBasedMapping =\n              StubMapping.builder()\n                  .setRequest(requestPattern)\n                  .setResponse(responseDef)\n                  .setPriority(10)\n                  .build();\n\n          stubMappings.addMapping(proxyBasedMapping);\n        });\n  }\n\n  public void stop() {\n    if (wireMockServer != null) {\n      if (wireMockServer.getRecordingStatus().getStatus() == RecordingStatus.Recording) {\n        stopRecordingIfNecessary();\n\n        // Remove shutdown hook to prevent double snapshotting\n        if (shutdownHook != null) {\n          try {\n            Runtime.getRuntime().removeShutdownHook(shutdownHook);\n          } catch (IllegalStateException e) {\n          }\n        }\n      }\n      wireMockServer.stop();\n    }\n  }\n\n  private void stopRecordingIfNecessary() {\n    if (wireMockServer.getRecordingStatus().getStatus() == RecordingStatus.Recording) {\n      wireMockServer.stopRecording();\n    }\n  }\n\n  public boolean isRunning() {\n    if (wireMockServer == null) {\n      return false;\n    } else {\n      return wireMockServer.isRunning();\n    }\n  }\n\n  public int port() {\n    return wireMockServer.port();\n  }\n}\n"
  },
  {
    "path": "src/main/java/wiremock/Run.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage wiremock;\n\nimport com.github.tomakehurst.wiremock.standalone.WireMockServerRunner;\n\npublic class Run extends WireMockServerRunner {\n\n  public static void main(String... args) {\n    new Run().run(args);\n  }\n}\n"
  },
  {
    "path": "src/main/resources/META-INF/services/wiremock.org.slf4j.spi.SLF4JServiceProvider",
    "content": "wiremock.org.slf4j.helpers.NOP_FallbackServiceProvider"
  },
  {
    "path": "src/main/resources/assets/recorder/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>WireMock Recorder</title>\n\n    <script src='/__admin/recorder/lib/jquery-3.6.0.min.js' type='text/javascript'></script>\n\n    <style type=\"text/css\">\n        body {\n            font-family: sans-serif;\n        }\n\n        h1 {\n            margin-bottom: 3rem;\n            color: #6C7692;\n        }\n\n        #logo {\n            height: 40px;\n            width: auto;\n            display: inline;\n            vertical-align: text-bottom;\n            padding-bottom: 0.2rem;\n        }\n\n        .content {\n            margin: auto;\n            width: 600px;\n            /*height: 300px;*/\n            padding-top: 100px;\n            vertical-align: middle;\n        }\n\n        .ca-cert-box {\n            border: 1px solid black;\n            padding: 1em;\n            vertical-align: middle;\n            margin-top: 80px;\n            color: #898989;\n            font-size: 90%;\n        }\n\n        .ca-cert-box a {\n            color: #42407d;\n        }\n\n        .ca-cert-box a:visited {\n            color: #42407d;\n        }\n\n        button {\n            background-color: #1D2539;\n            padding: 10px;\n            color: white;\n            font-size: 1.5rem;\n            border-radius: 5px;\n            border: none;\n            margin-right: 1rem;\n        }\n\n        button:disabled {\n            background-color: #AAA;\n        }\n\n        input {\n            border-radius: 5px;\n        }\n\n        #targetBaseUrlLabel {\n            color: #777;\n            font-size: 1.2rem;\n        }\n\n        #targetBaseUrl {\n            height: 1.5rem;\n            width: 32rem;\n            display: block;\n            margin-top: 0.3rem;\n            margin-bottom: 1rem;\n            border: 2px solid grey;\n            padding: 5px;\n        }\n\n        #validationMessage {\n            margin-bottom: 3rem;\n            border: none;\n            color: transparent;\n            width: 32rem;\n            padding: 6px;\n        }\n\n        .showError {\n            border: 1px solid red !important;\n            color: red !important;\n        }\n\n        .showMessage {\n            border: 1px solid darkgreen !important;\n            color: darkgreen !important;\n        }\n\n\n    </style>\n</head>\n<body>\n\n<div class=\"content\">\n    <h1>\n        <img src=\"/__admin/recorder/images/wiremock-concept-icon-01.png\" id=\"logo\"/>\n        WireMock Recorder\n    </h1>\n\n    <label id=\"targetBaseUrlLabel\" for=\"targetBaseUrl\">Target URL</label>\n    <input type=\"text\" id=\"targetBaseUrl\" name=\"targetBaseUrl\" max=\"128\"/>\n    <div id=\"validationMessage\"></div>\n\n    <button id=\"startRecording\" disabled=\"disabled\">Record</button>\n    <button id=\"stopRecording\" disabled=\"disabled\">Stop</button>\n\n    <div class=\"ca-cert-box\">\n        <p>To record stubs from an HTTPS endpoint using browser (forward) proxying, you may need to trust WireMock's CA cert, which\n        can be downloaded here: <a href=\"../certs/wiremock-ca.crt\">wiremock-ca.crt</a>\n        <p>See the <a href=\"http://wiremock.org/docs/proxying/#browser-proxying-of-https\" target=\"_blank\">documentation on HTTPS proxying</a> for more details.\n    </div>\n</div>\n\n<script type=\"text/javascript\">\n    function showMessage(message) {\n        $('#validationMessage')\n            .removeClass('showError')\n            .addClass('showMessage')\n            .text(message);\n    }\n\n    function showError(message) {\n        $('#validationMessage')\n            .removeClass('showMessage')\n            .addClass('showError')\n            .text(message);\n    }\n\n    function hideMessage() {\n        $('#validationMessage').removeClass('showError');\n    }\n\n    $(function() {\n        var base = window.location.href.startsWith('file') ?\n            'http://localhost:8080' :\n            '';\n\n        $.getJSON(base + '/__admin/recordings/status', function(data) {\n            if (data.status === 'Recording') {\n                $('#stopRecording').attr('disabled', false);\n                showMessage('Recording...');\n            } else {\n                $('#startRecording').attr('disabled', false);\n            }\n        });\n\n        $('#startRecording').click(function(event) {\n            var baseUrl = $('#targetBaseUrl').val();\n            if (baseUrl == null || baseUrl.length === 0) {\n                showError('You need to enter a valid target URL.');\n                return;\n            } else {\n                hideMessage();\n            }\n\n            event.target.disabled = true;\n\n            $.ajax({\n                method: \"POST\",\n                url: base + '/__admin/recordings/start',\n                crossDomain: true,\n                mimeType: 'application/json',\n                data: JSON.stringify({\n                    targetBaseUrl: baseUrl\n                }),\n                dataType: 'json'\n            }).done(function() {\n                $('#stopRecording').attr('disabled', false);\n                showMessage('Recording...');\n            });\n        });\n\n        $('#stopRecording').click(function(event) {\n            event.target.disabled = true;\n            $.ajax({\n                method: 'POST',\n                crossDomain: true,\n                url: base + '/__admin/recordings/stop'\n            }).done(function(data) {\n                var count = data.mappings.length;\n                showMessage('Captured ' + count + ' stub mappings.');\n                $('#startRecording').attr('disabled', false);\n            });\n\n        });\n    });\n</script>\n\n</body>\n</html>"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/index.html",
    "content": "<!-- HTML for static distribution bundle build -->\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\">\n    <title>WireMock Admin API | Swagger UI</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"swagger-ui-dist/swagger-ui.css\" />\n    <link rel=\"icon\" type=\"image/png\" href=\"swagger-ui-dist/favicon-32x32.png\" sizes=\"32x32\" />\n    <link rel=\"icon\" type=\"image/png\" href=\"swagger-ui-dist/favicon-16x16.png\" sizes=\"16x16\" />\n    <style>\n      html\n      {\n        box-sizing: border-box;\n        overflow: -moz-scrollbars-vertical;\n        overflow-y: scroll;\n      }\n\n      *,\n      *:before,\n      *:after\n      {\n        box-sizing: inherit;\n      }\n\n      body\n      {\n        margin:0;\n        background: #fafafa;\n      }\n    </style>\n  </head>\n\n  <body>\n    <div id=\"swagger-ui\"></div>\n\n    <script src=\"swagger-ui-dist/swagger-ui-bundle.js\" charset=\"UTF-8\"> </script>\n    <script src=\"swagger-ui-dist/swagger-ui-standalone-preset.js\" charset=\"UTF-8\"> </script>\n    <script>\n    window.onload = function() {\n      // Begin Swagger UI call region\n      const ui = SwaggerUIBundle({\n        url: \"/__admin/docs/swagger\",\n        dom_id: '#swagger-ui',\n        deepLinking: true,\n        presets: [\n          SwaggerUIBundle.presets.apis,\n          SwaggerUIStandalonePreset\n        ],\n        plugins: [\n          SwaggerUIBundle.plugins.DownloadUrl\n        ],\n        layout: \"StandaloneLayout\"\n      });\n      // End Swagger UI call region\n\n      window.ui = ui;\n    };\n  </script>\n  </body>\n</html>\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/NOTICE",
    "content": "swagger-ui\nCopyright 2020-2021 SmartBear Software Inc.\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/README.md",
    "content": "# Swagger UI Dist\n[![NPM version](https://badge.fury.io/js/swagger-ui-dist.svg)](http://badge.fury.io/js/swagger-ui-dist)\n\n# API\n\nThis module, `swagger-ui-dist`, exposes Swagger-UI's entire dist folder as a dependency-free npm module.\nUse `swagger-ui` instead, if you'd like to have npm install dependencies for you.\n\n`SwaggerUIBundle` and `SwaggerUIStandalonePreset` can be imported:\n```javascript\n  import { SwaggerUIBundle, SwaggerUIStandalonePreset } from \"swagger-ui-dist\"\n```\n\nTo get an absolute path to this directory for static file serving, use the exported `getAbsoluteFSPath` method:\n\n```javascript\nconst swaggerUiAssetPath = require(\"swagger-ui-dist\").getAbsoluteFSPath()\n\n// then instantiate server that serves files from the swaggerUiAssetPath\n```\n\nFor anything else, check the [Swagger-UI](https://github.com/swagger-api/swagger-ui) repository.\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/absolute-path.js",
    "content": "/*\n * getAbsoluteFSPath\n * @return {string} When run in NodeJS env, returns the absolute path to the current directory\n *                  When run outside of NodeJS, will return an error message\n */\nconst getAbsoluteFSPath = function () {\n  // detect whether we are running in a browser or nodejs\n  if (typeof module !== \"undefined\" && module.exports) {\n    return require(\"path\").resolve(__dirname)\n  }\n  throw new Error('getAbsoluteFSPath can only be called within a Nodejs environment');\n}\n\nmodule.exports = getAbsoluteFSPath\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/index.css",
    "content": "html {\n    box-sizing: border-box;\n    overflow: -moz-scrollbars-vertical;\n    overflow-y: scroll;\n}\n\n*,\n*:before,\n*:after {\n    box-sizing: inherit;\n}\n\nbody {\n    margin: 0;\n    background: #fafafa;\n}\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/index.html",
    "content": "<!-- HTML for static distribution bundle build -->\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\">\n    <title>Swagger UI</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"./swagger-ui.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"index.css\" />\n    <link rel=\"icon\" type=\"image/png\" href=\"./favicon-32x32.png\" sizes=\"32x32\" />\n    <link rel=\"icon\" type=\"image/png\" href=\"./favicon-16x16.png\" sizes=\"16x16\" />\n  </head>\n\n  <body>\n    <div id=\"swagger-ui\"></div>\n    <script src=\"./swagger-ui-bundle.js\" charset=\"UTF-8\"> </script>\n    <script src=\"./swagger-ui-standalone-preset.js\" charset=\"UTF-8\"> </script>\n    <script src=\"./swagger-initializer.js\" charset=\"UTF-8\"> </script>\n  </body>\n</html>\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/index.js",
    "content": "try {\n  module.exports.SwaggerUIBundle = require(\"./swagger-ui-bundle.js\")\n  module.exports.SwaggerUIStandalonePreset = require(\"./swagger-ui-standalone-preset.js\")\n} catch(e) {\n  // swallow the error if there's a problem loading the assets.\n  // allows this module to support providing the assets for browserish contexts,\n  // without exploding in a Node context.\n  //\n  // see https://github.com/swagger-api/swagger-ui/issues/3291#issuecomment-311195388\n  // for more information.\n}\n\n// `absolutePath` and `getAbsoluteFSPath` are both here because at one point,\n// we documented having one and actually implemented the other.\n// They were both retained so we don't break anyone's code.\nmodule.exports.absolutePath = require(\"./absolute-path.js\")\nmodule.exports.getAbsoluteFSPath = require(\"./absolute-path.js\")\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/log.bundle-sizes.swagger-ui.txt",
    "content": "ramda: 367.12 KB (5.44%)\nlodash: 255.69 KB (3.79%)\nramda-adjunct: 255.04 KB (3.78%)\nautolinker: 203.32 KB (3.01%)\n@swagger-api/apidom-ns-openapi-3-0: 192.76 KB (2.86%)\nswagger-client: 181.53 KB (2.69%)\n@swagger-api/apidom-ns-openapi-3-1: 142.98 KB (2.12%)\nimmutable: 139.01 KB (2.06%)\nreact-dom: 129.93 KB (1.92%)\nremarkable: 125.56 KB (1.86%)\nhighlight.js: 111.85 KB (1.66%)\njs-yaml: 105.01 KB (1.56%)\nreadable-stream: 96.66 KB (1.43%)\n@swagger-api/apidom-reference: 89.92 KB (1.33%)\ncore-js-pure: 83.37 KB (1.24%)\ndompurify: 60.88 KB (0.902%)\nminim: 57.35 KB (0.850%)\nbuffer: 56.99 KB (0.844%)\n@swagger-api/apidom-core: 54.17 KB (0.803%)\n@swagger-api/apidom-ast: 53.99 KB (0.800%)\n@swagger-api/apidom-ns-json-schema-draft-4: 52.01 KB (0.770%)\nreact-syntax-highlighter: 40.38 KB (0.598%)\napg-lite: 38.54 KB (0.571%)\nshort-unique-id: 37.48 KB (0.555%)\nreact-redux: 36.62 KB (0.543%)\n@swaggerexpert/cookie: 35.16 KB (0.521%)\n@swagger-api/apidom-ns-json-schema-2019-09: 35.04 KB (0.519%)\nfast-json-patch: 31.89 KB (0.473%)\n@swaggerexpert/json-pointer: 30.48 KB (0.452%)\n@swagger-api/apidom-ns-json-schema-draft-7: 23.62 KB (0.350%)\n@swagger-api/apidom-ns-json-schema-2020-12: 22.4 KB (0.332%)\n@swagger-api/apidom-ns-json-schema-draft-6: 21.63 KB (0.321%)\nreselect: 21.47 KB (0.318%)\nopenapi-path-templating: 20.81 KB (0.308%)\nneotraverse: 20.33 KB (0.301%)\nsha.js: 18.92 KB (0.280%)\nts-mixer: 17.56 KB (0.260%)\ntslib: 17.23 KB (0.255%)\nredux: 16.37 KB (0.243%)\nurl-parse: 16.23 KB (0.240%)\nevents: 14.54 KB (0.215%)\nopenapi-server-url-templating: 14.38 KB (0.213%)\nget-intrinsic: 14.02 KB (0.208%)\nzenscroll: 12.31 KB (0.182%)\nreact-debounce-input: 11.95 KB (0.177%)\nreact-immutable-proptypes: 11.82 KB (0.175%)\nret: 10.82 KB (0.160%)\nlodash.debounce: 10.53 KB (0.156%)\nunraw: 9.9 KB (0.147%)\nstring_decoder: 9.24 KB (0.137%)\nxml: 7.39 KB (0.109%)\nreact-copy-to-clipboard: 7.33 KB (0.109%)\nreact: 6.95 KB (0.103%)\nrandexp: 6.15 KB (0.0910%)\nreact-immutable-pure-component: 6.01 KB (0.0890%)\nredux-immutable: 5.43 KB (0.0805%)\nprocess: 5.29 KB (0.0784%)\ndrange: 4.8 KB (0.0712%)\nlowlight: 4.42 KB (0.0655%)\nscheduler: 4.33 KB (0.0641%)\ndeep-extend: 4.19 KB (0.0621%)\n@babel/runtime: 3.99 KB (0.0591%)\ndeepmerge: 3.95 KB (0.0586%)\nbase64-js: 3.84 KB (0.0569%)\nstream-browserify: 3.76 KB (0.0557%)\nwhich-typed-array: 3.64 KB (0.0539%)\n@swagger-api/apidom-error: 3.45 KB (0.0511%)\ncopy-to-clipboard: 3.29 KB (0.0487%)\nformat: 3.26 KB (0.0482%)\nis-callable: 3.15 KB (0.0466%)\ncss.escape: 3.08 KB (0.0456%)\nto-buffer: 3.03 KB (0.0449%)\nserialize-error: 2.93 KB (0.0434%)\nuse-sync-external-store: 2.81 KB (0.0417%)\nprop-types: 2.6 KB (0.0385%)\nquerystringify: 2.5 KB (0.0371%)\nfor-each: 2.32 KB (0.0343%)\nhas-symbols: 2.31 KB (0.0343%)\ndefine-data-property: 2.28 KB (0.0338%)\nxml-but-prettier: 2.17 KB (0.0321%)\nfunction-bind: 2.12 KB (0.0314%)\nieee754: 2.1 KB (0.0312%)\nsafe-buffer: 1.63 KB (0.0242%)\nutil-deprecate: 1.58 KB (0.0234%)\nrandombytes: 1.54 KB (0.0228%)\njs-file-download: 1.52 KB (0.0225%)\nclassnames: 1.49 KB (0.0221%)\ncall-bind-apply-helpers: 1.35 KB (0.0200%)\nset-function-length: 1.24 KB (0.0184%)\nrepeat-string: 1.18 KB (0.0175%)\nget-proto: 1.1 KB (0.0163%)\ndunder-proto: 980 B (0.0142%)\n@babel/runtime-corejs3: 781 B (0.0113%)\nmath-intrinsics: 781 B (0.0113%)\ntoggle-selection: 780 B (0.0113%)\nrequires-port: 753 B (0.0109%)\ninherits: 753 B (0.0109%)\n@swagger-api/apidom-json-pointer: 709 B (0.0103%)\nfault: 691 B (0.0100%)\ncall-bound: 667 B (0.00965%)\ncall-bind: 643 B (0.00930%)\ntyped-array-buffer: 591 B (0.00855%)\nhas-property-descriptors: 588 B (0.00851%)\nes-errors: 524 B (0.00758%)\navailable-typed-arrays: 475 B (0.00687%)\ngopd: 303 B (0.00438%)\nes-define-property: 288 B (0.00417%)\npossible-typed-array-names: 264 B (0.00382%)\nhasown: 206 B (0.00298%)\nhas-tostringtag: 189 B (0.00273%)\nis-typed-array: 180 B (0.00260%)\nisarray: 132 B (0.00191%)\nes-object-atoms: 67 B (0.000969%)\n<self>: 3.09 MB (46.9%)\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/log.es-bundle-core-sizes.swagger-ui.txt",
    "content": "readable-stream: 96.66 KB (5.76%)\nbuffer: 56.99 KB (3.40%)\nsha.js: 18.92 KB (1.13%)\nevents: 14.54 KB (0.867%)\nstring_decoder: 9.24 KB (0.551%)\nxml: 7.39 KB (0.440%)\nprocess: 5.29 KB (0.315%)\ndeep-extend: 4.19 KB (0.250%)\nstream-browserify: 3.76 KB (0.224%)\nsafe-buffer: 1.63 KB (0.0972%)\nutil-deprecate: 1.58 KB (0.0940%)\nrandombytes: 1.54 KB (0.0918%)\ninherits: 753 B (0.0438%)\n<self>: 1.42 MB (86.7%)\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/log.es-bundle-sizes.swagger-ui.txt",
    "content": "ramda: 367.12 KB (5.44%)\nlodash: 255.69 KB (3.79%)\nramda-adjunct: 255.04 KB (3.78%)\nautolinker: 203.32 KB (3.01%)\n@swagger-api/apidom-ns-openapi-3-0: 192.76 KB (2.86%)\nswagger-client: 181.53 KB (2.69%)\n@swagger-api/apidom-ns-openapi-3-1: 142.98 KB (2.12%)\nimmutable: 139.01 KB (2.06%)\nreact-dom: 129.93 KB (1.92%)\nremarkable: 125.56 KB (1.86%)\nhighlight.js: 111.85 KB (1.66%)\njs-yaml: 105.01 KB (1.56%)\nreadable-stream: 96.66 KB (1.43%)\n@swagger-api/apidom-reference: 89.92 KB (1.33%)\ncore-js-pure: 83.37 KB (1.24%)\ndompurify: 60.88 KB (0.902%)\nminim: 57.35 KB (0.850%)\nbuffer: 56.99 KB (0.844%)\n@swagger-api/apidom-core: 54.17 KB (0.803%)\n@swagger-api/apidom-ast: 53.99 KB (0.800%)\n@swagger-api/apidom-ns-json-schema-draft-4: 52.01 KB (0.770%)\nreact-syntax-highlighter: 40.38 KB (0.598%)\napg-lite: 38.54 KB (0.571%)\nshort-unique-id: 37.48 KB (0.555%)\nreact-redux: 36.62 KB (0.543%)\n@swaggerexpert/cookie: 35.16 KB (0.521%)\n@swagger-api/apidom-ns-json-schema-2019-09: 35.04 KB (0.519%)\nfast-json-patch: 31.89 KB (0.473%)\n@swaggerexpert/json-pointer: 30.48 KB (0.452%)\n@swagger-api/apidom-ns-json-schema-draft-7: 23.62 KB (0.350%)\n@swagger-api/apidom-ns-json-schema-2020-12: 22.4 KB (0.332%)\n@swagger-api/apidom-ns-json-schema-draft-6: 21.63 KB (0.321%)\nreselect: 21.47 KB (0.318%)\nopenapi-path-templating: 20.81 KB (0.308%)\nneotraverse: 20.33 KB (0.301%)\nsha.js: 18.92 KB (0.280%)\nts-mixer: 17.56 KB (0.260%)\ntslib: 17.23 KB (0.255%)\nredux: 16.37 KB (0.243%)\nurl-parse: 16.23 KB (0.240%)\nevents: 14.54 KB (0.215%)\nopenapi-server-url-templating: 14.38 KB (0.213%)\nget-intrinsic: 14.02 KB (0.208%)\nzenscroll: 12.31 KB (0.182%)\nreact-debounce-input: 11.95 KB (0.177%)\nreact-immutable-proptypes: 11.82 KB (0.175%)\nret: 10.82 KB (0.160%)\nlodash.debounce: 10.53 KB (0.156%)\nunraw: 9.9 KB (0.147%)\nstring_decoder: 9.24 KB (0.137%)\nxml: 7.39 KB (0.109%)\nreact-copy-to-clipboard: 7.33 KB (0.109%)\nreact: 6.95 KB (0.103%)\nrandexp: 6.15 KB (0.0910%)\nreact-immutable-pure-component: 6.01 KB (0.0890%)\nredux-immutable: 5.43 KB (0.0805%)\nprocess: 5.29 KB (0.0784%)\ndrange: 4.8 KB (0.0712%)\nlowlight: 4.42 KB (0.0655%)\nscheduler: 4.33 KB (0.0641%)\ndeep-extend: 4.19 KB (0.0621%)\n@babel/runtime: 3.99 KB (0.0591%)\ndeepmerge: 3.95 KB (0.0586%)\nbase64-js: 3.84 KB (0.0569%)\nstream-browserify: 3.76 KB (0.0557%)\nwhich-typed-array: 3.64 KB (0.0539%)\n@swagger-api/apidom-error: 3.45 KB (0.0511%)\ncopy-to-clipboard: 3.29 KB (0.0487%)\nformat: 3.26 KB (0.0482%)\nis-callable: 3.15 KB (0.0466%)\ncss.escape: 3.08 KB (0.0456%)\nto-buffer: 3.03 KB (0.0449%)\nserialize-error: 2.93 KB (0.0434%)\nuse-sync-external-store: 2.81 KB (0.0417%)\nprop-types: 2.6 KB (0.0385%)\nquerystringify: 2.5 KB (0.0371%)\nfor-each: 2.32 KB (0.0343%)\nhas-symbols: 2.31 KB (0.0343%)\ndefine-data-property: 2.28 KB (0.0338%)\nxml-but-prettier: 2.17 KB (0.0321%)\nfunction-bind: 2.12 KB (0.0314%)\nieee754: 2.1 KB (0.0312%)\nsafe-buffer: 1.63 KB (0.0242%)\nutil-deprecate: 1.58 KB (0.0234%)\nrandombytes: 1.54 KB (0.0228%)\njs-file-download: 1.52 KB (0.0225%)\nclassnames: 1.49 KB (0.0221%)\ncall-bind-apply-helpers: 1.35 KB (0.0200%)\nset-function-length: 1.24 KB (0.0184%)\nrepeat-string: 1.18 KB (0.0175%)\nget-proto: 1.1 KB (0.0163%)\ndunder-proto: 980 B (0.0142%)\n@babel/runtime-corejs3: 781 B (0.0113%)\nmath-intrinsics: 781 B (0.0113%)\ntoggle-selection: 780 B (0.0113%)\nrequires-port: 753 B (0.0109%)\ninherits: 753 B (0.0109%)\n@swagger-api/apidom-json-pointer: 709 B (0.0103%)\nfault: 691 B (0.0100%)\ncall-bound: 667 B (0.00965%)\ncall-bind: 643 B (0.00930%)\ntyped-array-buffer: 591 B (0.00855%)\nhas-property-descriptors: 588 B (0.00851%)\nes-errors: 524 B (0.00758%)\navailable-typed-arrays: 475 B (0.00687%)\ngopd: 303 B (0.00438%)\nes-define-property: 288 B (0.00417%)\npossible-typed-array-names: 264 B (0.00382%)\nhasown: 206 B (0.00298%)\nhas-tostringtag: 189 B (0.00273%)\nis-typed-array: 180 B (0.00260%)\nisarray: 132 B (0.00191%)\nes-object-atoms: 67 B (0.000969%)\n<self>: 3.09 MB (46.9%)\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/oauth2-redirect.html",
    "content": "<!doctype html>\n<html lang=\"en-US\">\n<head>\n    <title>Swagger UI: OAuth2 Redirect</title>\n</head>\n<body>\n<script>\n    'use strict';\n    function run () {\n        var oauth2 = window.opener.swaggerUIRedirectOauth2;\n        var sentState = oauth2.state;\n        var redirectUrl = oauth2.redirectUrl;\n        var isValid, qp, arr;\n\n        if (/code|token|error/.test(window.location.hash)) {\n            qp = window.location.hash.substring(1).replace('?', '&');\n        } else {\n            qp = location.search.substring(1);\n        }\n\n        arr = qp.split(\"&\");\n        arr.forEach(function (v,i,_arr) { _arr[i] = '\"' + v.replace('=', '\":\"') + '\"';});\n        qp = qp ? JSON.parse('{' + arr.join() + '}',\n                function (key, value) {\n                    return key === \"\" ? value : decodeURIComponent(value);\n                }\n        ) : {};\n\n        isValid = qp.state === sentState;\n\n        if ((\n          oauth2.auth.schema.get(\"flow\") === \"accessCode\" ||\n          oauth2.auth.schema.get(\"flow\") === \"authorizationCode\" ||\n          oauth2.auth.schema.get(\"flow\") === \"authorization_code\"\n        ) && !oauth2.auth.code) {\n            if (!isValid) {\n                oauth2.errCb({\n                    authId: oauth2.auth.name,\n                    source: \"auth\",\n                    level: \"warning\",\n                    message: \"Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server.\"\n                });\n            }\n\n            if (qp.code) {\n                delete oauth2.state;\n                oauth2.auth.code = qp.code;\n                oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});\n            } else {\n                let oauthErrorMsg;\n                if (qp.error) {\n                    oauthErrorMsg = \"[\"+qp.error+\"]: \" +\n                        (qp.error_description ? qp.error_description+ \". \" : \"no accessCode received from the server. \") +\n                        (qp.error_uri ? \"More info: \"+qp.error_uri : \"\");\n                }\n\n                oauth2.errCb({\n                    authId: oauth2.auth.name,\n                    source: \"auth\",\n                    level: \"error\",\n                    message: oauthErrorMsg || \"[Authorization failed]: no accessCode received from the server.\"\n                });\n            }\n        } else {\n            oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});\n        }\n        window.close();\n    }\n\n    if (document.readyState !== 'loading') {\n        run();\n    } else {\n        document.addEventListener('DOMContentLoaded', function () {\n            run();\n        });\n    }\n</script>\n</body>\n</html>\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/oauth2-redirect.js",
    "content": "\"use strict\";function run(){var e,r,t,a=window.opener.swaggerUIRedirectOauth2,o=a.state,n=a.redirectUrl;if((t=(r=/code|token|error/.test(window.location.hash)?window.location.hash.substring(1).replace(\"?\",\"&\"):location.search.substring(1)).split(\"&\")).forEach((function(e,r,t){t[r]='\"'+e.replace(\"=\",'\":\"')+'\"'})),e=(r=r?JSON.parse(\"{\"+t.join()+\"}\",(function(e,r){return\"\"===e?r:decodeURIComponent(r)})):{}).state===o,\"accessCode\"!==a.auth.schema.get(\"flow\")&&\"authorizationCode\"!==a.auth.schema.get(\"flow\")&&\"authorization_code\"!==a.auth.schema.get(\"flow\")||a.auth.code)a.callback({auth:a.auth,token:r,isValid:e,redirectUrl:n});else if(e||a.errCb({authId:a.auth.name,source:\"auth\",level:\"warning\",message:\"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server\"}),r.code)delete a.state,a.auth.code=r.code,a.callback({auth:a.auth,redirectUrl:n});else{let e;r.error&&(e=\"[\"+r.error+\"]: \"+(r.error_description?r.error_description+\". \":\"no accessCode received from the server. \")+(r.error_uri?\"More info: \"+r.error_uri:\"\")),a.errCb({authId:a.auth.name,source:\"auth\",level:\"error\",message:e||\"[Authorization failed]: no accessCode received from the server\"})}window.close()}\"loading\"!==document.readyState?run():document.addEventListener(\"DOMContentLoaded\",(function(){run()}));"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/package.json",
    "content": "{\n  \"name\": \"swagger-ui-dist\",\n  \"version\": \"5.17.14\",\n  \"main\": \"index.js\",\n  \"repository\": \"git@github.com:swagger-api/swagger-ui.git\",\n  \"contributors\": [\n    \"(in alphabetical order)\",\n    \"Anna Bodnia <anna.bodnia@gmail.com>\",\n    \"Buu Nguyen <buunguyen@gmail.com>\",\n    \"Josh Ponelat <jponelat@gmail.com>\",\n    \"Kyle Shockey <kyleshockey1@gmail.com>\",\n    \"Robert Barnwell <robert@robertismy.name>\",\n    \"Sahar Jafari <shr.jafari@gmail.com>\"\n  ],\n  \"license\": \"Apache-2.0\",\n  \"dependencies\": {},\n  \"devDependencies\": {}\n}\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-initializer.js",
    "content": "window.onload = function() {\n  //<editor-fold desc=\"Changeable Configuration Block\">\n\n  // the following lines will be replaced by docker/configurator, when it runs in a docker-container\n  window.ui = SwaggerUIBundle({\n    url: \"https://petstore.swagger.io/v2/swagger.json\",\n    dom_id: '#swagger-ui',\n    deepLinking: true,\n    presets: [\n      SwaggerUIBundle.presets.apis,\n      SwaggerUIStandalonePreset\n    ],\n    plugins: [\n      SwaggerUIBundle.plugins.DownloadUrl\n    ],\n    layout: \"StandaloneLayout\"\n  });\n\n  //</editor-fold>\n};\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui-bundle.js",
    "content": "/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */\n!function webpackUniversalModuleDefinition(o,s){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define([],s):\"object\"==typeof exports?exports.SwaggerUIBundle=s():o.SwaggerUIBundle=s()}(this,(()=>(()=>{var o,s,i={69119:(o,s)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0}),s.BLANK_URL=s.relativeFirstCharacters=s.whitespaceEscapeCharsRegex=s.urlSchemeRegex=s.ctrlCharactersRegex=s.htmlCtrlEntityRegex=s.htmlEntitiesRegex=s.invalidProtocolRegex=void 0,s.invalidProtocolRegex=/^([^\\w]*)(javascript|data|vbscript)/im,s.htmlEntitiesRegex=/&#(\\w+)(^\\w|;)?/g,s.htmlCtrlEntityRegex=/&(newline|tab);/gi,s.ctrlCharactersRegex=/[\\u0000-\\u001F\\u007F-\\u009F\\u2000-\\u200D\\uFEFF]/gim,s.urlSchemeRegex=/^.+(:|&colon;)/gim,s.whitespaceEscapeCharsRegex=/(\\\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,s.relativeFirstCharacters=[\".\",\"/\"],s.BLANK_URL=\"about:blank\"},16750:(o,s,i)=>{\"use strict\";s.J=void 0;var u=i(69119);function decodeURI(o){try{return decodeURIComponent(o)}catch(s){return o}}s.J=function sanitizeUrl(o){if(!o)return u.BLANK_URL;var s,i,_=decodeURI(o);do{s=(_=decodeURI(_=(i=_,i.replace(u.ctrlCharactersRegex,\"\").replace(u.htmlEntitiesRegex,(function(o,s){return String.fromCharCode(s)}))).replace(u.htmlCtrlEntityRegex,\"\").replace(u.ctrlCharactersRegex,\"\").replace(u.whitespaceEscapeCharsRegex,\"\").trim())).match(u.ctrlCharactersRegex)||_.match(u.htmlEntitiesRegex)||_.match(u.htmlCtrlEntityRegex)||_.match(u.whitespaceEscapeCharsRegex)}while(s&&s.length>0);var w=_;if(!w)return u.BLANK_URL;if(function isRelativeUrlWithoutProtocol(o){return u.relativeFirstCharacters.indexOf(o[0])>-1}(w))return w;var x=w.match(u.urlSchemeRegex);if(!x)return w;var C=x[0];return u.invalidProtocolRegex.test(C)?u.BLANK_URL:w}},67526:(o,s)=>{\"use strict\";s.byteLength=function byteLength(o){var s=getLens(o),i=s[0],u=s[1];return 3*(i+u)/4-u},s.toByteArray=function toByteArray(o){var s,i,w=getLens(o),x=w[0],C=w[1],j=new _(function _byteLength(o,s,i){return 3*(s+i)/4-i}(0,x,C)),L=0,B=C>0?x-4:x;for(i=0;i<B;i+=4)s=u[o.charCodeAt(i)]<<18|u[o.charCodeAt(i+1)]<<12|u[o.charCodeAt(i+2)]<<6|u[o.charCodeAt(i+3)],j[L++]=s>>16&255,j[L++]=s>>8&255,j[L++]=255&s;2===C&&(s=u[o.charCodeAt(i)]<<2|u[o.charCodeAt(i+1)]>>4,j[L++]=255&s);1===C&&(s=u[o.charCodeAt(i)]<<10|u[o.charCodeAt(i+1)]<<4|u[o.charCodeAt(i+2)]>>2,j[L++]=s>>8&255,j[L++]=255&s);return j},s.fromByteArray=function fromByteArray(o){for(var s,u=o.length,_=u%3,w=[],x=16383,C=0,j=u-_;C<j;C+=x)w.push(encodeChunk(o,C,C+x>j?j:C+x));1===_?(s=o[u-1],w.push(i[s>>2]+i[s<<4&63]+\"==\")):2===_&&(s=(o[u-2]<<8)+o[u-1],w.push(i[s>>10]+i[s>>4&63]+i[s<<2&63]+\"=\"));return w.join(\"\")};for(var i=[],u=[],_=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,w=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",x=0;x<64;++x)i[x]=w[x],u[w.charCodeAt(x)]=x;function getLens(o){var s=o.length;if(s%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var i=o.indexOf(\"=\");return-1===i&&(i=s),[i,i===s?0:4-i%4]}function encodeChunk(o,s,u){for(var _,w,x=[],C=s;C<u;C+=3)_=(o[C]<<16&16711680)+(o[C+1]<<8&65280)+(255&o[C+2]),x.push(i[(w=_)>>18&63]+i[w>>12&63]+i[w>>6&63]+i[63&w]);return x.join(\"\")}u[\"-\".charCodeAt(0)]=62,u[\"_\".charCodeAt(0)]=63},48287:(o,s,i)=>{\"use strict\";const u=i(67526),_=i(251),w=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;s.Buffer=Buffer,s.SlowBuffer=function SlowBuffer(o){+o!=o&&(o=0);return Buffer.alloc(+o)},s.INSPECT_MAX_BYTES=50;const x=2147483647;function createBuffer(o){if(o>x)throw new RangeError('The value \"'+o+'\" is invalid for option \"size\"');const s=new Uint8Array(o);return Object.setPrototypeOf(s,Buffer.prototype),s}function Buffer(o,s,i){if(\"number\"==typeof o){if(\"string\"==typeof s)throw new TypeError('The \"string\" argument must be of type string. Received type number');return allocUnsafe(o)}return from(o,s,i)}function from(o,s,i){if(\"string\"==typeof o)return function fromString(o,s){\"string\"==typeof s&&\"\"!==s||(s=\"utf8\");if(!Buffer.isEncoding(s))throw new TypeError(\"Unknown encoding: \"+s);const i=0|byteLength(o,s);let u=createBuffer(i);const _=u.write(o,s);_!==i&&(u=u.slice(0,_));return u}(o,s);if(ArrayBuffer.isView(o))return function fromArrayView(o){if(isInstance(o,Uint8Array)){const s=new Uint8Array(o);return fromArrayBuffer(s.buffer,s.byteOffset,s.byteLength)}return fromArrayLike(o)}(o);if(null==o)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof o);if(isInstance(o,ArrayBuffer)||o&&isInstance(o.buffer,ArrayBuffer))return fromArrayBuffer(o,s,i);if(\"undefined\"!=typeof SharedArrayBuffer&&(isInstance(o,SharedArrayBuffer)||o&&isInstance(o.buffer,SharedArrayBuffer)))return fromArrayBuffer(o,s,i);if(\"number\"==typeof o)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const u=o.valueOf&&o.valueOf();if(null!=u&&u!==o)return Buffer.from(u,s,i);const _=function fromObject(o){if(Buffer.isBuffer(o)){const s=0|checked(o.length),i=createBuffer(s);return 0===i.length||o.copy(i,0,0,s),i}if(void 0!==o.length)return\"number\"!=typeof o.length||numberIsNaN(o.length)?createBuffer(0):fromArrayLike(o);if(\"Buffer\"===o.type&&Array.isArray(o.data))return fromArrayLike(o.data)}(o);if(_)return _;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof o[Symbol.toPrimitive])return Buffer.from(o[Symbol.toPrimitive](\"string\"),s,i);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof o)}function assertSize(o){if(\"number\"!=typeof o)throw new TypeError('\"size\" argument must be of type number');if(o<0)throw new RangeError('The value \"'+o+'\" is invalid for option \"size\"')}function allocUnsafe(o){return assertSize(o),createBuffer(o<0?0:0|checked(o))}function fromArrayLike(o){const s=o.length<0?0:0|checked(o.length),i=createBuffer(s);for(let u=0;u<s;u+=1)i[u]=255&o[u];return i}function fromArrayBuffer(o,s,i){if(s<0||o.byteLength<s)throw new RangeError('\"offset\" is outside of buffer bounds');if(o.byteLength<s+(i||0))throw new RangeError('\"length\" is outside of buffer bounds');let u;return u=void 0===s&&void 0===i?new Uint8Array(o):void 0===i?new Uint8Array(o,s):new Uint8Array(o,s,i),Object.setPrototypeOf(u,Buffer.prototype),u}function checked(o){if(o>=x)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+x.toString(16)+\" bytes\");return 0|o}function byteLength(o,s){if(Buffer.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||isInstance(o,ArrayBuffer))return o.byteLength;if(\"string\"!=typeof o)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof o);const i=o.length,u=arguments.length>2&&!0===arguments[2];if(!u&&0===i)return 0;let _=!1;for(;;)switch(s){case\"ascii\":case\"latin1\":case\"binary\":return i;case\"utf8\":case\"utf-8\":return utf8ToBytes(o).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*i;case\"hex\":return i>>>1;case\"base64\":return base64ToBytes(o).length;default:if(_)return u?-1:utf8ToBytes(o).length;s=(\"\"+s).toLowerCase(),_=!0}}function slowToString(o,s,i){let u=!1;if((void 0===s||s<0)&&(s=0),s>this.length)return\"\";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return\"\";if((i>>>=0)<=(s>>>=0))return\"\";for(o||(o=\"utf8\");;)switch(o){case\"hex\":return hexSlice(this,s,i);case\"utf8\":case\"utf-8\":return utf8Slice(this,s,i);case\"ascii\":return asciiSlice(this,s,i);case\"latin1\":case\"binary\":return latin1Slice(this,s,i);case\"base64\":return base64Slice(this,s,i);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return utf16leSlice(this,s,i);default:if(u)throw new TypeError(\"Unknown encoding: \"+o);o=(o+\"\").toLowerCase(),u=!0}}function swap(o,s,i){const u=o[s];o[s]=o[i],o[i]=u}function bidirectionalIndexOf(o,s,i,u,_){if(0===o.length)return-1;if(\"string\"==typeof i?(u=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),numberIsNaN(i=+i)&&(i=_?0:o.length-1),i<0&&(i=o.length+i),i>=o.length){if(_)return-1;i=o.length-1}else if(i<0){if(!_)return-1;i=0}if(\"string\"==typeof s&&(s=Buffer.from(s,u)),Buffer.isBuffer(s))return 0===s.length?-1:arrayIndexOf(o,s,i,u,_);if(\"number\"==typeof s)return s&=255,\"function\"==typeof Uint8Array.prototype.indexOf?_?Uint8Array.prototype.indexOf.call(o,s,i):Uint8Array.prototype.lastIndexOf.call(o,s,i):arrayIndexOf(o,[s],i,u,_);throw new TypeError(\"val must be string, number or Buffer\")}function arrayIndexOf(o,s,i,u,_){let w,x=1,C=o.length,j=s.length;if(void 0!==u&&(\"ucs2\"===(u=String(u).toLowerCase())||\"ucs-2\"===u||\"utf16le\"===u||\"utf-16le\"===u)){if(o.length<2||s.length<2)return-1;x=2,C/=2,j/=2,i/=2}function read(o,s){return 1===x?o[s]:o.readUInt16BE(s*x)}if(_){let u=-1;for(w=i;w<C;w++)if(read(o,w)===read(s,-1===u?0:w-u)){if(-1===u&&(u=w),w-u+1===j)return u*x}else-1!==u&&(w-=w-u),u=-1}else for(i+j>C&&(i=C-j),w=i;w>=0;w--){let i=!0;for(let u=0;u<j;u++)if(read(o,w+u)!==read(s,u)){i=!1;break}if(i)return w}return-1}function hexWrite(o,s,i,u){i=Number(i)||0;const _=o.length-i;u?(u=Number(u))>_&&(u=_):u=_;const w=s.length;let x;for(u>w/2&&(u=w/2),x=0;x<u;++x){const u=parseInt(s.substr(2*x,2),16);if(numberIsNaN(u))return x;o[i+x]=u}return x}function utf8Write(o,s,i,u){return blitBuffer(utf8ToBytes(s,o.length-i),o,i,u)}function asciiWrite(o,s,i,u){return blitBuffer(function asciiToBytes(o){const s=[];for(let i=0;i<o.length;++i)s.push(255&o.charCodeAt(i));return s}(s),o,i,u)}function base64Write(o,s,i,u){return blitBuffer(base64ToBytes(s),o,i,u)}function ucs2Write(o,s,i,u){return blitBuffer(function utf16leToBytes(o,s){let i,u,_;const w=[];for(let x=0;x<o.length&&!((s-=2)<0);++x)i=o.charCodeAt(x),u=i>>8,_=i%256,w.push(_),w.push(u);return w}(s,o.length-i),o,i,u)}function base64Slice(o,s,i){return 0===s&&i===o.length?u.fromByteArray(o):u.fromByteArray(o.slice(s,i))}function utf8Slice(o,s,i){i=Math.min(o.length,i);const u=[];let _=s;for(;_<i;){const s=o[_];let w=null,x=s>239?4:s>223?3:s>191?2:1;if(_+x<=i){let i,u,C,j;switch(x){case 1:s<128&&(w=s);break;case 2:i=o[_+1],128==(192&i)&&(j=(31&s)<<6|63&i,j>127&&(w=j));break;case 3:i=o[_+1],u=o[_+2],128==(192&i)&&128==(192&u)&&(j=(15&s)<<12|(63&i)<<6|63&u,j>2047&&(j<55296||j>57343)&&(w=j));break;case 4:i=o[_+1],u=o[_+2],C=o[_+3],128==(192&i)&&128==(192&u)&&128==(192&C)&&(j=(15&s)<<18|(63&i)<<12|(63&u)<<6|63&C,j>65535&&j<1114112&&(w=j))}}null===w?(w=65533,x=1):w>65535&&(w-=65536,u.push(w>>>10&1023|55296),w=56320|1023&w),u.push(w),_+=x}return function decodeCodePointsArray(o){const s=o.length;if(s<=C)return String.fromCharCode.apply(String,o);let i=\"\",u=0;for(;u<s;)i+=String.fromCharCode.apply(String,o.slice(u,u+=C));return i}(u)}s.kMaxLength=x,Buffer.TYPED_ARRAY_SUPPORT=function typedArraySupport(){try{const o=new Uint8Array(1),s={foo:function(){return 42}};return Object.setPrototypeOf(s,Uint8Array.prototype),Object.setPrototypeOf(o,s),42===o.foo()}catch(o){return!1}}(),Buffer.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(Buffer.prototype,\"parent\",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,\"offset\",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(o,s,i){return from(o,s,i)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(o,s,i){return function alloc(o,s,i){return assertSize(o),o<=0?createBuffer(o):void 0!==s?\"string\"==typeof i?createBuffer(o).fill(s,i):createBuffer(o).fill(s):createBuffer(o)}(o,s,i)},Buffer.allocUnsafe=function(o){return allocUnsafe(o)},Buffer.allocUnsafeSlow=function(o){return allocUnsafe(o)},Buffer.isBuffer=function isBuffer(o){return null!=o&&!0===o._isBuffer&&o!==Buffer.prototype},Buffer.compare=function compare(o,s){if(isInstance(o,Uint8Array)&&(o=Buffer.from(o,o.offset,o.byteLength)),isInstance(s,Uint8Array)&&(s=Buffer.from(s,s.offset,s.byteLength)),!Buffer.isBuffer(o)||!Buffer.isBuffer(s))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(o===s)return 0;let i=o.length,u=s.length;for(let _=0,w=Math.min(i,u);_<w;++_)if(o[_]!==s[_]){i=o[_],u=s[_];break}return i<u?-1:u<i?1:0},Buffer.isEncoding=function isEncoding(o){switch(String(o).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},Buffer.concat=function concat(o,s){if(!Array.isArray(o))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===o.length)return Buffer.alloc(0);let i;if(void 0===s)for(s=0,i=0;i<o.length;++i)s+=o[i].length;const u=Buffer.allocUnsafe(s);let _=0;for(i=0;i<o.length;++i){let s=o[i];if(isInstance(s,Uint8Array))_+s.length>u.length?(Buffer.isBuffer(s)||(s=Buffer.from(s)),s.copy(u,_)):Uint8Array.prototype.set.call(u,s,_);else{if(!Buffer.isBuffer(s))throw new TypeError('\"list\" argument must be an Array of Buffers');s.copy(u,_)}_+=s.length}return u},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){const o=this.length;if(o%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let s=0;s<o;s+=2)swap(this,s,s+1);return this},Buffer.prototype.swap32=function swap32(){const o=this.length;if(o%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let s=0;s<o;s+=4)swap(this,s,s+3),swap(this,s+1,s+2);return this},Buffer.prototype.swap64=function swap64(){const o=this.length;if(o%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let s=0;s<o;s+=8)swap(this,s,s+7),swap(this,s+1,s+6),swap(this,s+2,s+5),swap(this,s+3,s+4);return this},Buffer.prototype.toString=function toString(){const o=this.length;return 0===o?\"\":0===arguments.length?utf8Slice(this,0,o):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function equals(o){if(!Buffer.isBuffer(o))throw new TypeError(\"Argument must be a Buffer\");return this===o||0===Buffer.compare(this,o)},Buffer.prototype.inspect=function inspect(){let o=\"\";const i=s.INSPECT_MAX_BYTES;return o=this.toString(\"hex\",0,i).replace(/(.{2})/g,\"$1 \").trim(),this.length>i&&(o+=\" ... \"),\"<Buffer \"+o+\">\"},w&&(Buffer.prototype[w]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(o,s,i,u,_){if(isInstance(o,Uint8Array)&&(o=Buffer.from(o,o.offset,o.byteLength)),!Buffer.isBuffer(o))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(void 0===s&&(s=0),void 0===i&&(i=o?o.length:0),void 0===u&&(u=0),void 0===_&&(_=this.length),s<0||i>o.length||u<0||_>this.length)throw new RangeError(\"out of range index\");if(u>=_&&s>=i)return 0;if(u>=_)return-1;if(s>=i)return 1;if(this===o)return 0;let w=(_>>>=0)-(u>>>=0),x=(i>>>=0)-(s>>>=0);const C=Math.min(w,x),j=this.slice(u,_),L=o.slice(s,i);for(let o=0;o<C;++o)if(j[o]!==L[o]){w=j[o],x=L[o];break}return w<x?-1:x<w?1:0},Buffer.prototype.includes=function includes(o,s,i){return-1!==this.indexOf(o,s,i)},Buffer.prototype.indexOf=function indexOf(o,s,i){return bidirectionalIndexOf(this,o,s,i,!0)},Buffer.prototype.lastIndexOf=function lastIndexOf(o,s,i){return bidirectionalIndexOf(this,o,s,i,!1)},Buffer.prototype.write=function write(o,s,i,u){if(void 0===s)u=\"utf8\",i=this.length,s=0;else if(void 0===i&&\"string\"==typeof s)u=s,i=this.length,s=0;else{if(!isFinite(s))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");s>>>=0,isFinite(i)?(i>>>=0,void 0===u&&(u=\"utf8\")):(u=i,i=void 0)}const _=this.length-s;if((void 0===i||i>_)&&(i=_),o.length>0&&(i<0||s<0)||s>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");u||(u=\"utf8\");let w=!1;for(;;)switch(u){case\"hex\":return hexWrite(this,o,s,i);case\"utf8\":case\"utf-8\":return utf8Write(this,o,s,i);case\"ascii\":case\"latin1\":case\"binary\":return asciiWrite(this,o,s,i);case\"base64\":return base64Write(this,o,s,i);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return ucs2Write(this,o,s,i);default:if(w)throw new TypeError(\"Unknown encoding: \"+u);u=(\"\"+u).toLowerCase(),w=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function asciiSlice(o,s,i){let u=\"\";i=Math.min(o.length,i);for(let _=s;_<i;++_)u+=String.fromCharCode(127&o[_]);return u}function latin1Slice(o,s,i){let u=\"\";i=Math.min(o.length,i);for(let _=s;_<i;++_)u+=String.fromCharCode(o[_]);return u}function hexSlice(o,s,i){const u=o.length;(!s||s<0)&&(s=0),(!i||i<0||i>u)&&(i=u);let _=\"\";for(let u=s;u<i;++u)_+=B[o[u]];return _}function utf16leSlice(o,s,i){const u=o.slice(s,i);let _=\"\";for(let o=0;o<u.length-1;o+=2)_+=String.fromCharCode(u[o]+256*u[o+1]);return _}function checkOffset(o,s,i){if(o%1!=0||o<0)throw new RangeError(\"offset is not uint\");if(o+s>i)throw new RangeError(\"Trying to access beyond buffer length\")}function checkInt(o,s,i,u,_,w){if(!Buffer.isBuffer(o))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(s>_||s<w)throw new RangeError('\"value\" argument is out of bounds');if(i+u>o.length)throw new RangeError(\"Index out of range\")}function wrtBigUInt64LE(o,s,i,u,_){checkIntBI(s,u,_,o,i,7);let w=Number(s&BigInt(4294967295));o[i++]=w,w>>=8,o[i++]=w,w>>=8,o[i++]=w,w>>=8,o[i++]=w;let x=Number(s>>BigInt(32)&BigInt(4294967295));return o[i++]=x,x>>=8,o[i++]=x,x>>=8,o[i++]=x,x>>=8,o[i++]=x,i}function wrtBigUInt64BE(o,s,i,u,_){checkIntBI(s,u,_,o,i,7);let w=Number(s&BigInt(4294967295));o[i+7]=w,w>>=8,o[i+6]=w,w>>=8,o[i+5]=w,w>>=8,o[i+4]=w;let x=Number(s>>BigInt(32)&BigInt(4294967295));return o[i+3]=x,x>>=8,o[i+2]=x,x>>=8,o[i+1]=x,x>>=8,o[i]=x,i+8}function checkIEEE754(o,s,i,u,_,w){if(i+u>o.length)throw new RangeError(\"Index out of range\");if(i<0)throw new RangeError(\"Index out of range\")}function writeFloat(o,s,i,u,w){return s=+s,i>>>=0,w||checkIEEE754(o,0,i,4),_.write(o,s,i,u,23,4),i+4}function writeDouble(o,s,i,u,w){return s=+s,i>>>=0,w||checkIEEE754(o,0,i,8),_.write(o,s,i,u,52,8),i+8}Buffer.prototype.slice=function slice(o,s){const i=this.length;(o=~~o)<0?(o+=i)<0&&(o=0):o>i&&(o=i),(s=void 0===s?i:~~s)<0?(s+=i)<0&&(s=0):s>i&&(s=i),s<o&&(s=o);const u=this.subarray(o,s);return Object.setPrototypeOf(u,Buffer.prototype),u},Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(o,s,i){o>>>=0,s>>>=0,i||checkOffset(o,s,this.length);let u=this[o],_=1,w=0;for(;++w<s&&(_*=256);)u+=this[o+w]*_;return u},Buffer.prototype.readUintBE=Buffer.prototype.readUIntBE=function readUIntBE(o,s,i){o>>>=0,s>>>=0,i||checkOffset(o,s,this.length);let u=this[o+--s],_=1;for(;s>0&&(_*=256);)u+=this[o+--s]*_;return u},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(o,s){return o>>>=0,s||checkOffset(o,1,this.length),this[o]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(o,s){return o>>>=0,s||checkOffset(o,2,this.length),this[o]|this[o+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(o,s){return o>>>=0,s||checkOffset(o,2,this.length),this[o]<<8|this[o+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+16777216*this[o+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),16777216*this[o]+(this[o+1]<<16|this[o+2]<<8|this[o+3])},Buffer.prototype.readBigUInt64LE=defineBigIntMethod((function readBigUInt64LE(o){validateNumber(o>>>=0,\"offset\");const s=this[o],i=this[o+7];void 0!==s&&void 0!==i||boundsError(o,this.length-8);const u=s+256*this[++o]+65536*this[++o]+this[++o]*2**24,_=this[++o]+256*this[++o]+65536*this[++o]+i*2**24;return BigInt(u)+(BigInt(_)<<BigInt(32))})),Buffer.prototype.readBigUInt64BE=defineBigIntMethod((function readBigUInt64BE(o){validateNumber(o>>>=0,\"offset\");const s=this[o],i=this[o+7];void 0!==s&&void 0!==i||boundsError(o,this.length-8);const u=s*2**24+65536*this[++o]+256*this[++o]+this[++o],_=this[++o]*2**24+65536*this[++o]+256*this[++o]+i;return(BigInt(u)<<BigInt(32))+BigInt(_)})),Buffer.prototype.readIntLE=function readIntLE(o,s,i){o>>>=0,s>>>=0,i||checkOffset(o,s,this.length);let u=this[o],_=1,w=0;for(;++w<s&&(_*=256);)u+=this[o+w]*_;return _*=128,u>=_&&(u-=Math.pow(2,8*s)),u},Buffer.prototype.readIntBE=function readIntBE(o,s,i){o>>>=0,s>>>=0,i||checkOffset(o,s,this.length);let u=s,_=1,w=this[o+--u];for(;u>0&&(_*=256);)w+=this[o+--u]*_;return _*=128,w>=_&&(w-=Math.pow(2,8*s)),w},Buffer.prototype.readInt8=function readInt8(o,s){return o>>>=0,s||checkOffset(o,1,this.length),128&this[o]?-1*(255-this[o]+1):this[o]},Buffer.prototype.readInt16LE=function readInt16LE(o,s){o>>>=0,s||checkOffset(o,2,this.length);const i=this[o]|this[o+1]<<8;return 32768&i?4294901760|i:i},Buffer.prototype.readInt16BE=function readInt16BE(o,s){o>>>=0,s||checkOffset(o,2,this.length);const i=this[o+1]|this[o]<<8;return 32768&i?4294901760|i:i},Buffer.prototype.readInt32LE=function readInt32LE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},Buffer.prototype.readBigInt64LE=defineBigIntMethod((function readBigInt64LE(o){validateNumber(o>>>=0,\"offset\");const s=this[o],i=this[o+7];void 0!==s&&void 0!==i||boundsError(o,this.length-8);const u=this[o+4]+256*this[o+5]+65536*this[o+6]+(i<<24);return(BigInt(u)<<BigInt(32))+BigInt(s+256*this[++o]+65536*this[++o]+this[++o]*2**24)})),Buffer.prototype.readBigInt64BE=defineBigIntMethod((function readBigInt64BE(o){validateNumber(o>>>=0,\"offset\");const s=this[o],i=this[o+7];void 0!==s&&void 0!==i||boundsError(o,this.length-8);const u=(s<<24)+65536*this[++o]+256*this[++o]+this[++o];return(BigInt(u)<<BigInt(32))+BigInt(this[++o]*2**24+65536*this[++o]+256*this[++o]+i)})),Buffer.prototype.readFloatLE=function readFloatLE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),_.read(this,o,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),_.read(this,o,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(o,s){return o>>>=0,s||checkOffset(o,8,this.length),_.read(this,o,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(o,s){return o>>>=0,s||checkOffset(o,8,this.length),_.read(this,o,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(o,s,i,u){if(o=+o,s>>>=0,i>>>=0,!u){checkInt(this,o,s,i,Math.pow(2,8*i)-1,0)}let _=1,w=0;for(this[s]=255&o;++w<i&&(_*=256);)this[s+w]=o/_&255;return s+i},Buffer.prototype.writeUintBE=Buffer.prototype.writeUIntBE=function writeUIntBE(o,s,i,u){if(o=+o,s>>>=0,i>>>=0,!u){checkInt(this,o,s,i,Math.pow(2,8*i)-1,0)}let _=i-1,w=1;for(this[s+_]=255&o;--_>=0&&(w*=256);)this[s+_]=o/w&255;return s+i},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,1,255,0),this[s]=255&o,s+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,2,65535,0),this[s]=255&o,this[s+1]=o>>>8,s+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,2,65535,0),this[s]=o>>>8,this[s+1]=255&o,s+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,4,4294967295,0),this[s+3]=o>>>24,this[s+2]=o>>>16,this[s+1]=o>>>8,this[s]=255&o,s+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,4,4294967295,0),this[s]=o>>>24,this[s+1]=o>>>16,this[s+2]=o>>>8,this[s+3]=255&o,s+4},Buffer.prototype.writeBigUInt64LE=defineBigIntMethod((function writeBigUInt64LE(o,s=0){return wrtBigUInt64LE(this,o,s,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),Buffer.prototype.writeBigUInt64BE=defineBigIntMethod((function writeBigUInt64BE(o,s=0){return wrtBigUInt64BE(this,o,s,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),Buffer.prototype.writeIntLE=function writeIntLE(o,s,i,u){if(o=+o,s>>>=0,!u){const u=Math.pow(2,8*i-1);checkInt(this,o,s,i,u-1,-u)}let _=0,w=1,x=0;for(this[s]=255&o;++_<i&&(w*=256);)o<0&&0===x&&0!==this[s+_-1]&&(x=1),this[s+_]=(o/w|0)-x&255;return s+i},Buffer.prototype.writeIntBE=function writeIntBE(o,s,i,u){if(o=+o,s>>>=0,!u){const u=Math.pow(2,8*i-1);checkInt(this,o,s,i,u-1,-u)}let _=i-1,w=1,x=0;for(this[s+_]=255&o;--_>=0&&(w*=256);)o<0&&0===x&&0!==this[s+_+1]&&(x=1),this[s+_]=(o/w|0)-x&255;return s+i},Buffer.prototype.writeInt8=function writeInt8(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,1,127,-128),o<0&&(o=255+o+1),this[s]=255&o,s+1},Buffer.prototype.writeInt16LE=function writeInt16LE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,2,32767,-32768),this[s]=255&o,this[s+1]=o>>>8,s+2},Buffer.prototype.writeInt16BE=function writeInt16BE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,2,32767,-32768),this[s]=o>>>8,this[s+1]=255&o,s+2},Buffer.prototype.writeInt32LE=function writeInt32LE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,4,2147483647,-2147483648),this[s]=255&o,this[s+1]=o>>>8,this[s+2]=o>>>16,this[s+3]=o>>>24,s+4},Buffer.prototype.writeInt32BE=function writeInt32BE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),this[s]=o>>>24,this[s+1]=o>>>16,this[s+2]=o>>>8,this[s+3]=255&o,s+4},Buffer.prototype.writeBigInt64LE=defineBigIntMethod((function writeBigInt64LE(o,s=0){return wrtBigUInt64LE(this,o,s,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),Buffer.prototype.writeBigInt64BE=defineBigIntMethod((function writeBigInt64BE(o,s=0){return wrtBigUInt64BE(this,o,s,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),Buffer.prototype.writeFloatLE=function writeFloatLE(o,s,i){return writeFloat(this,o,s,!0,i)},Buffer.prototype.writeFloatBE=function writeFloatBE(o,s,i){return writeFloat(this,o,s,!1,i)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(o,s,i){return writeDouble(this,o,s,!0,i)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(o,s,i){return writeDouble(this,o,s,!1,i)},Buffer.prototype.copy=function copy(o,s,i,u){if(!Buffer.isBuffer(o))throw new TypeError(\"argument should be a Buffer\");if(i||(i=0),u||0===u||(u=this.length),s>=o.length&&(s=o.length),s||(s=0),u>0&&u<i&&(u=i),u===i)return 0;if(0===o.length||0===this.length)return 0;if(s<0)throw new RangeError(\"targetStart out of bounds\");if(i<0||i>=this.length)throw new RangeError(\"Index out of range\");if(u<0)throw new RangeError(\"sourceEnd out of bounds\");u>this.length&&(u=this.length),o.length-s<u-i&&(u=o.length-s+i);const _=u-i;return this===o&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(s,i,u):Uint8Array.prototype.set.call(o,this.subarray(i,u),s),_},Buffer.prototype.fill=function fill(o,s,i,u){if(\"string\"==typeof o){if(\"string\"==typeof s?(u=s,s=0,i=this.length):\"string\"==typeof i&&(u=i,i=this.length),void 0!==u&&\"string\"!=typeof u)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof u&&!Buffer.isEncoding(u))throw new TypeError(\"Unknown encoding: \"+u);if(1===o.length){const s=o.charCodeAt(0);(\"utf8\"===u&&s<128||\"latin1\"===u)&&(o=s)}}else\"number\"==typeof o?o&=255:\"boolean\"==typeof o&&(o=Number(o));if(s<0||this.length<s||this.length<i)throw new RangeError(\"Out of range index\");if(i<=s)return this;let _;if(s>>>=0,i=void 0===i?this.length:i>>>0,o||(o=0),\"number\"==typeof o)for(_=s;_<i;++_)this[_]=o;else{const w=Buffer.isBuffer(o)?o:Buffer.from(o,u),x=w.length;if(0===x)throw new TypeError('The value \"'+o+'\" is invalid for argument \"value\"');for(_=0;_<i-s;++_)this[_+s]=w[_%x]}return this};const j={};function E(o,s,i){j[o]=class NodeError extends i{constructor(){super(),Object.defineProperty(this,\"message\",{value:s.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${o}]`,this.stack,delete this.name}get code(){return o}set code(o){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${o}]: ${this.message}`}}}function addNumericalSeparator(o){let s=\"\",i=o.length;const u=\"-\"===o[0]?1:0;for(;i>=u+4;i-=3)s=`_${o.slice(i-3,i)}${s}`;return`${o.slice(0,i)}${s}`}function checkIntBI(o,s,i,u,_,w){if(o>i||o<s){const u=\"bigint\"==typeof s?\"n\":\"\";let _;throw _=w>3?0===s||s===BigInt(0)?`>= 0${u} and < 2${u} ** ${8*(w+1)}${u}`:`>= -(2${u} ** ${8*(w+1)-1}${u}) and < 2 ** ${8*(w+1)-1}${u}`:`>= ${s}${u} and <= ${i}${u}`,new j.ERR_OUT_OF_RANGE(\"value\",_,o)}!function checkBounds(o,s,i){validateNumber(s,\"offset\"),void 0!==o[s]&&void 0!==o[s+i]||boundsError(s,o.length-(i+1))}(u,_,w)}function validateNumber(o,s){if(\"number\"!=typeof o)throw new j.ERR_INVALID_ARG_TYPE(s,\"number\",o)}function boundsError(o,s,i){if(Math.floor(o)!==o)throw validateNumber(o,i),new j.ERR_OUT_OF_RANGE(i||\"offset\",\"an integer\",o);if(s<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(i||\"offset\",`>= ${i?1:0} and <= ${s}`,o)}E(\"ERR_BUFFER_OUT_OF_BOUNDS\",(function(o){return o?`${o} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"}),RangeError),E(\"ERR_INVALID_ARG_TYPE\",(function(o,s){return`The \"${o}\" argument must be of type number. Received type ${typeof s}`}),TypeError),E(\"ERR_OUT_OF_RANGE\",(function(o,s,i){let u=`The value of \"${o}\" is out of range.`,_=i;return Number.isInteger(i)&&Math.abs(i)>2**32?_=addNumericalSeparator(String(i)):\"bigint\"==typeof i&&(_=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(_=addNumericalSeparator(_)),_+=\"n\"),u+=` It must be ${s}. Received ${_}`,u}),RangeError);const L=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(o,s){let i;s=s||1/0;const u=o.length;let _=null;const w=[];for(let x=0;x<u;++x){if(i=o.charCodeAt(x),i>55295&&i<57344){if(!_){if(i>56319){(s-=3)>-1&&w.push(239,191,189);continue}if(x+1===u){(s-=3)>-1&&w.push(239,191,189);continue}_=i;continue}if(i<56320){(s-=3)>-1&&w.push(239,191,189),_=i;continue}i=65536+(_-55296<<10|i-56320)}else _&&(s-=3)>-1&&w.push(239,191,189);if(_=null,i<128){if((s-=1)<0)break;w.push(i)}else if(i<2048){if((s-=2)<0)break;w.push(i>>6|192,63&i|128)}else if(i<65536){if((s-=3)<0)break;w.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error(\"Invalid code point\");if((s-=4)<0)break;w.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return w}function base64ToBytes(o){return u.toByteArray(function base64clean(o){if((o=(o=o.split(\"=\")[0]).trim().replace(L,\"\")).length<2)return\"\";for(;o.length%4!=0;)o+=\"=\";return o}(o))}function blitBuffer(o,s,i,u){let _;for(_=0;_<u&&!(_+i>=s.length||_>=o.length);++_)s[_+i]=o[_];return _}function isInstance(o,s){return o instanceof s||null!=o&&null!=o.constructor&&null!=o.constructor.name&&o.constructor.name===s.name}function numberIsNaN(o){return o!=o}const B=function(){const o=\"0123456789abcdef\",s=new Array(256);for(let i=0;i<16;++i){const u=16*i;for(let _=0;_<16;++_)s[u+_]=o[i]+o[_]}return s}();function defineBigIntMethod(o){return\"undefined\"==typeof BigInt?BufferBigIntNotDefined:o}function BufferBigIntNotDefined(){throw new Error(\"BigInt not supported\")}},38075:(o,s,i)=>{\"use strict\";var u=i(70453),_=i(10487),w=_(u(\"String.prototype.indexOf\"));o.exports=function callBoundIntrinsic(o,s){var i=u(o,!!s);return\"function\"==typeof i&&w(o,\".prototype.\")>-1?_(i):i}},10487:(o,s,i)=>{\"use strict\";var u=i(66743),_=i(70453),w=i(96897),x=i(69675),C=_(\"%Function.prototype.apply%\"),j=_(\"%Function.prototype.call%\"),L=_(\"%Reflect.apply%\",!0)||u.call(j,C),B=i(30655),$=_(\"%Math.max%\");o.exports=function callBind(o){if(\"function\"!=typeof o)throw new x(\"a function is required\");var s=L(u,j,arguments);return w(s,1+$(0,o.length-(arguments.length-1)),!0)};var V=function applyBind(){return L(u,C,arguments)};B?B(o.exports,\"apply\",{value:V}):o.exports.apply=V},57427:(o,s)=>{\"use strict\";s.parse=function parse(o,s){if(\"string\"!=typeof o)throw new TypeError(\"argument str must be a string\");var i={},u=(s||{}).decode||decode,_=0;for(;_<o.length;){var w=o.indexOf(\"=\",_);if(-1===w)break;var x=o.indexOf(\";\",_);if(-1===x)x=o.length;else if(x<w){_=o.lastIndexOf(\";\",w-1)+1;continue}var C=o.slice(_,w).trim();if(void 0===i[C]){var j=o.slice(w+1,x).trim();34===j.charCodeAt(0)&&(j=j.slice(1,-1)),i[C]=tryDecode(j,u)}_=x+1}return i},s.serialize=function serialize(o,s,_){var w=_||{},x=w.encode||encode;if(\"function\"!=typeof x)throw new TypeError(\"option encode is invalid\");if(!u.test(o))throw new TypeError(\"argument name is invalid\");var C=x(s);if(C&&!u.test(C))throw new TypeError(\"argument val is invalid\");var j=o+\"=\"+C;if(null!=w.maxAge){var L=w.maxAge-0;if(isNaN(L)||!isFinite(L))throw new TypeError(\"option maxAge is invalid\");j+=\"; Max-Age=\"+Math.floor(L)}if(w.domain){if(!u.test(w.domain))throw new TypeError(\"option domain is invalid\");j+=\"; Domain=\"+w.domain}if(w.path){if(!u.test(w.path))throw new TypeError(\"option path is invalid\");j+=\"; Path=\"+w.path}if(w.expires){var B=w.expires;if(!function isDate(o){return\"[object Date]\"===i.call(o)||o instanceof Date}(B)||isNaN(B.valueOf()))throw new TypeError(\"option expires is invalid\");j+=\"; Expires=\"+B.toUTCString()}w.httpOnly&&(j+=\"; HttpOnly\");w.secure&&(j+=\"; Secure\");w.partitioned&&(j+=\"; Partitioned\");if(w.priority){switch(\"string\"==typeof w.priority?w.priority.toLowerCase():w.priority){case\"low\":j+=\"; Priority=Low\";break;case\"medium\":j+=\"; Priority=Medium\";break;case\"high\":j+=\"; Priority=High\";break;default:throw new TypeError(\"option priority is invalid\")}}if(w.sameSite){switch(\"string\"==typeof w.sameSite?w.sameSite.toLowerCase():w.sameSite){case!0:j+=\"; SameSite=Strict\";break;case\"lax\":j+=\"; SameSite=Lax\";break;case\"strict\":j+=\"; SameSite=Strict\";break;case\"none\":j+=\"; SameSite=None\";break;default:throw new TypeError(\"option sameSite is invalid\")}}return j};var i=Object.prototype.toString,u=/^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;function decode(o){return-1!==o.indexOf(\"%\")?decodeURIComponent(o):o}function encode(o){return encodeURIComponent(o)}function tryDecode(o,s){try{return s(o)}catch(s){return o}}},17965:(o,s,i)=>{\"use strict\";var u=i(16426),_={\"text/plain\":\"Text\",\"text/html\":\"Url\",default:\"Text\"};o.exports=function copy(o,s){var i,w,x,C,j,L,B=!1;s||(s={}),i=s.debug||!1;try{if(x=u(),C=document.createRange(),j=document.getSelection(),(L=document.createElement(\"span\")).textContent=o,L.ariaHidden=\"true\",L.style.all=\"unset\",L.style.position=\"fixed\",L.style.top=0,L.style.clip=\"rect(0, 0, 0, 0)\",L.style.whiteSpace=\"pre\",L.style.webkitUserSelect=\"text\",L.style.MozUserSelect=\"text\",L.style.msUserSelect=\"text\",L.style.userSelect=\"text\",L.addEventListener(\"copy\",(function(u){if(u.stopPropagation(),s.format)if(u.preventDefault(),void 0===u.clipboardData){i&&console.warn(\"unable to use e.clipboardData\"),i&&console.warn(\"trying IE specific stuff\"),window.clipboardData.clearData();var w=_[s.format]||_.default;window.clipboardData.setData(w,o)}else u.clipboardData.clearData(),u.clipboardData.setData(s.format,o);s.onCopy&&(u.preventDefault(),s.onCopy(u.clipboardData))})),document.body.appendChild(L),C.selectNodeContents(L),j.addRange(C),!document.execCommand(\"copy\"))throw new Error(\"copy command was unsuccessful\");B=!0}catch(u){i&&console.error(\"unable to copy using execCommand: \",u),i&&console.warn(\"trying IE specific stuff\");try{window.clipboardData.setData(s.format||\"text\",o),s.onCopy&&s.onCopy(window.clipboardData),B=!0}catch(u){i&&console.error(\"unable to copy using clipboardData: \",u),i&&console.error(\"falling back to prompt\"),w=function format(o){var s=(/mac os x/i.test(navigator.userAgent)?\"⌘\":\"Ctrl\")+\"+C\";return o.replace(/#{\\s*key\\s*}/g,s)}(\"message\"in s?s.message:\"Copy to clipboard: #{key}, Enter\"),window.prompt(w,o)}}finally{j&&(\"function\"==typeof j.removeRange?j.removeRange(C):j.removeAllRanges()),L&&document.body.removeChild(L),x()}return B}},2205:function(o,s,i){var u;u=void 0!==i.g?i.g:this,o.exports=function(o){if(o.CSS&&o.CSS.escape)return o.CSS.escape;var cssEscape=function(o){if(0==arguments.length)throw new TypeError(\"`CSS.escape` requires an argument.\");for(var s,i=String(o),u=i.length,_=-1,w=\"\",x=i.charCodeAt(0);++_<u;)0!=(s=i.charCodeAt(_))?w+=s>=1&&s<=31||127==s||0==_&&s>=48&&s<=57||1==_&&s>=48&&s<=57&&45==x?\"\\\\\"+s.toString(16)+\" \":0==_&&1==u&&45==s||!(s>=128||45==s||95==s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122)?\"\\\\\"+i.charAt(_):i.charAt(_):w+=\"�\";return w};return o.CSS||(o.CSS={}),o.CSS.escape=cssEscape,cssEscape}(u)},81919:(o,s,i)=>{\"use strict\";var u=i(48287).Buffer;function isSpecificValue(o){return o instanceof u||o instanceof Date||o instanceof RegExp}function cloneSpecificValue(o){if(o instanceof u){var s=u.alloc?u.alloc(o.length):new u(o.length);return o.copy(s),s}if(o instanceof Date)return new Date(o.getTime());if(o instanceof RegExp)return new RegExp(o);throw new Error(\"Unexpected situation\")}function deepCloneArray(o){var s=[];return o.forEach((function(o,i){\"object\"==typeof o&&null!==o?Array.isArray(o)?s[i]=deepCloneArray(o):isSpecificValue(o)?s[i]=cloneSpecificValue(o):s[i]=_({},o):s[i]=o})),s}function safeGetProperty(o,s){return\"__proto__\"===s?void 0:o[s]}var _=o.exports=function(){if(arguments.length<1||\"object\"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var o,s,i=arguments[0];return Array.prototype.slice.call(arguments,1).forEach((function(u){\"object\"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach((function(w){return s=safeGetProperty(i,w),(o=safeGetProperty(u,w))===i?void 0:\"object\"!=typeof o||null===o?void(i[w]=o):Array.isArray(o)?void(i[w]=deepCloneArray(o)):isSpecificValue(o)?void(i[w]=cloneSpecificValue(o)):\"object\"!=typeof s||null===s||Array.isArray(s)?void(i[w]=_({},o)):void(i[w]=_(s,o))}))})),i}},14744:o=>{\"use strict\";var s=function isMergeableObject(o){return function isNonNullObject(o){return!!o&&\"object\"==typeof o}(o)&&!function isSpecial(o){var s=Object.prototype.toString.call(o);return\"[object RegExp]\"===s||\"[object Date]\"===s||function isReactElement(o){return o.$$typeof===i}(o)}(o)};var i=\"function\"==typeof Symbol&&Symbol.for?Symbol.for(\"react.element\"):60103;function cloneUnlessOtherwiseSpecified(o,s){return!1!==s.clone&&s.isMergeableObject(o)?deepmerge(function emptyTarget(o){return Array.isArray(o)?[]:{}}(o),o,s):o}function defaultArrayMerge(o,s,i){return o.concat(s).map((function(o){return cloneUnlessOtherwiseSpecified(o,i)}))}function getKeys(o){return Object.keys(o).concat(function getEnumerableOwnPropertySymbols(o){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(o).filter((function(s){return Object.propertyIsEnumerable.call(o,s)})):[]}(o))}function propertyIsOnObject(o,s){try{return s in o}catch(o){return!1}}function mergeObject(o,s,i){var u={};return i.isMergeableObject(o)&&getKeys(o).forEach((function(s){u[s]=cloneUnlessOtherwiseSpecified(o[s],i)})),getKeys(s).forEach((function(_){(function propertyIsUnsafe(o,s){return propertyIsOnObject(o,s)&&!(Object.hasOwnProperty.call(o,s)&&Object.propertyIsEnumerable.call(o,s))})(o,_)||(propertyIsOnObject(o,_)&&i.isMergeableObject(s[_])?u[_]=function getMergeFunction(o,s){if(!s.customMerge)return deepmerge;var i=s.customMerge(o);return\"function\"==typeof i?i:deepmerge}(_,i)(o[_],s[_],i):u[_]=cloneUnlessOtherwiseSpecified(s[_],i))})),u}function deepmerge(o,i,u){(u=u||{}).arrayMerge=u.arrayMerge||defaultArrayMerge,u.isMergeableObject=u.isMergeableObject||s,u.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var _=Array.isArray(i);return _===Array.isArray(o)?_?u.arrayMerge(o,i,u):mergeObject(o,i,u):cloneUnlessOtherwiseSpecified(i,u)}deepmerge.all=function deepmergeAll(o,s){if(!Array.isArray(o))throw new Error(\"first argument should be an array\");return o.reduce((function(o,i){return deepmerge(o,i,s)}),{})};var u=deepmerge;o.exports=u},30041:(o,s,i)=>{\"use strict\";var u=i(30655),_=i(58068),w=i(69675),x=i(75795);o.exports=function defineDataProperty(o,s,i){if(!o||\"object\"!=typeof o&&\"function\"!=typeof o)throw new w(\"`obj` must be an object or a function`\");if(\"string\"!=typeof s&&\"symbol\"!=typeof s)throw new w(\"`property` must be a string or a symbol`\");if(arguments.length>3&&\"boolean\"!=typeof arguments[3]&&null!==arguments[3])throw new w(\"`nonEnumerable`, if provided, must be a boolean or null\");if(arguments.length>4&&\"boolean\"!=typeof arguments[4]&&null!==arguments[4])throw new w(\"`nonWritable`, if provided, must be a boolean or null\");if(arguments.length>5&&\"boolean\"!=typeof arguments[5]&&null!==arguments[5])throw new w(\"`nonConfigurable`, if provided, must be a boolean or null\");if(arguments.length>6&&\"boolean\"!=typeof arguments[6])throw new w(\"`loose`, if provided, must be a boolean\");var C=arguments.length>3?arguments[3]:null,j=arguments.length>4?arguments[4]:null,L=arguments.length>5?arguments[5]:null,B=arguments.length>6&&arguments[6],$=!!x&&x(o,s);if(u)u(o,s,{configurable:null===L&&$?$.configurable:!L,enumerable:null===C&&$?$.enumerable:!C,value:i,writable:null===j&&$?$.writable:!j});else{if(!B&&(C||j||L))throw new _(\"This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.\");o[s]=i}}},42838:function(o){o.exports=function(){\"use strict\";const{entries:o,setPrototypeOf:s,isFrozen:i,getPrototypeOf:u,getOwnPropertyDescriptor:_}=Object;let{freeze:w,seal:x,create:C}=Object,{apply:j,construct:L}=\"undefined\"!=typeof Reflect&&Reflect;w||(w=function freeze(o){return o}),x||(x=function seal(o){return o}),j||(j=function apply(o,s,i){return o.apply(s,i)}),L||(L=function construct(o,s){return new o(...s)});const B=unapply(Array.prototype.forEach),$=unapply(Array.prototype.pop),V=unapply(Array.prototype.push),U=unapply(String.prototype.toLowerCase),z=unapply(String.prototype.toString),Y=unapply(String.prototype.match),Z=unapply(String.prototype.replace),ee=unapply(String.prototype.indexOf),ie=unapply(String.prototype.trim),ae=unapply(Object.prototype.hasOwnProperty),ce=unapply(RegExp.prototype.test),le=unconstruct(TypeError);function numberIsNaN(o){return\"number\"==typeof o&&isNaN(o)}function unapply(o){return function(s){for(var i=arguments.length,u=new Array(i>1?i-1:0),_=1;_<i;_++)u[_-1]=arguments[_];return j(o,s,u)}}function unconstruct(o){return function(){for(var s=arguments.length,i=new Array(s),u=0;u<s;u++)i[u]=arguments[u];return L(o,i)}}function addToSet(o,u){let _=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U;s&&s(o,null);let w=u.length;for(;w--;){let s=u[w];if(\"string\"==typeof s){const o=_(s);o!==s&&(i(u)||(u[w]=o),s=o)}o[s]=!0}return o}function cleanArray(o){for(let s=0;s<o.length;s++)ae(o,s)||(o[s]=null);return o}function clone(s){const i=C(null);for(const[u,_]of o(s))ae(s,u)&&(Array.isArray(_)?i[u]=cleanArray(_):_&&\"object\"==typeof _&&_.constructor===Object?i[u]=clone(_):i[u]=_);return i}function lookupGetter(o,s){for(;null!==o;){const i=_(o,s);if(i){if(i.get)return unapply(i.get);if(\"function\"==typeof i.value)return unapply(i.value)}o=u(o)}function fallbackValue(){return null}return fallbackValue}const pe=w([\"a\",\"abbr\",\"acronym\",\"address\",\"area\",\"article\",\"aside\",\"audio\",\"b\",\"bdi\",\"bdo\",\"big\",\"blink\",\"blockquote\",\"body\",\"br\",\"button\",\"canvas\",\"caption\",\"center\",\"cite\",\"code\",\"col\",\"colgroup\",\"content\",\"data\",\"datalist\",\"dd\",\"decorator\",\"del\",\"details\",\"dfn\",\"dialog\",\"dir\",\"div\",\"dl\",\"dt\",\"element\",\"em\",\"fieldset\",\"figcaption\",\"figure\",\"font\",\"footer\",\"form\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"head\",\"header\",\"hgroup\",\"hr\",\"html\",\"i\",\"img\",\"input\",\"ins\",\"kbd\",\"label\",\"legend\",\"li\",\"main\",\"map\",\"mark\",\"marquee\",\"menu\",\"menuitem\",\"meter\",\"nav\",\"nobr\",\"ol\",\"optgroup\",\"option\",\"output\",\"p\",\"picture\",\"pre\",\"progress\",\"q\",\"rp\",\"rt\",\"ruby\",\"s\",\"samp\",\"section\",\"select\",\"shadow\",\"small\",\"source\",\"spacer\",\"span\",\"strike\",\"strong\",\"style\",\"sub\",\"summary\",\"sup\",\"table\",\"tbody\",\"td\",\"template\",\"textarea\",\"tfoot\",\"th\",\"thead\",\"time\",\"tr\",\"track\",\"tt\",\"u\",\"ul\",\"var\",\"video\",\"wbr\"]),de=w([\"svg\",\"a\",\"altglyph\",\"altglyphdef\",\"altglyphitem\",\"animatecolor\",\"animatemotion\",\"animatetransform\",\"circle\",\"clippath\",\"defs\",\"desc\",\"ellipse\",\"filter\",\"font\",\"g\",\"glyph\",\"glyphref\",\"hkern\",\"image\",\"line\",\"lineargradient\",\"marker\",\"mask\",\"metadata\",\"mpath\",\"path\",\"pattern\",\"polygon\",\"polyline\",\"radialgradient\",\"rect\",\"stop\",\"style\",\"switch\",\"symbol\",\"text\",\"textpath\",\"title\",\"tref\",\"tspan\",\"view\",\"vkern\"]),fe=w([\"feBlend\",\"feColorMatrix\",\"feComponentTransfer\",\"feComposite\",\"feConvolveMatrix\",\"feDiffuseLighting\",\"feDisplacementMap\",\"feDistantLight\",\"feDropShadow\",\"feFlood\",\"feFuncA\",\"feFuncB\",\"feFuncG\",\"feFuncR\",\"feGaussianBlur\",\"feImage\",\"feMerge\",\"feMergeNode\",\"feMorphology\",\"feOffset\",\"fePointLight\",\"feSpecularLighting\",\"feSpotLight\",\"feTile\",\"feTurbulence\"]),ye=w([\"animate\",\"color-profile\",\"cursor\",\"discard\",\"font-face\",\"font-face-format\",\"font-face-name\",\"font-face-src\",\"font-face-uri\",\"foreignobject\",\"hatch\",\"hatchpath\",\"mesh\",\"meshgradient\",\"meshpatch\",\"meshrow\",\"missing-glyph\",\"script\",\"set\",\"solidcolor\",\"unknown\",\"use\"]),be=w([\"math\",\"menclose\",\"merror\",\"mfenced\",\"mfrac\",\"mglyph\",\"mi\",\"mlabeledtr\",\"mmultiscripts\",\"mn\",\"mo\",\"mover\",\"mpadded\",\"mphantom\",\"mroot\",\"mrow\",\"ms\",\"mspace\",\"msqrt\",\"mstyle\",\"msub\",\"msup\",\"msubsup\",\"mtable\",\"mtd\",\"mtext\",\"mtr\",\"munder\",\"munderover\",\"mprescripts\"]),_e=w([\"maction\",\"maligngroup\",\"malignmark\",\"mlongdiv\",\"mscarries\",\"mscarry\",\"msgroup\",\"mstack\",\"msline\",\"msrow\",\"semantics\",\"annotation\",\"annotation-xml\",\"mprescripts\",\"none\"]),we=w([\"#text\"]),Se=w([\"accept\",\"action\",\"align\",\"alt\",\"autocapitalize\",\"autocomplete\",\"autopictureinpicture\",\"autoplay\",\"background\",\"bgcolor\",\"border\",\"capture\",\"cellpadding\",\"cellspacing\",\"checked\",\"cite\",\"class\",\"clear\",\"color\",\"cols\",\"colspan\",\"controls\",\"controlslist\",\"coords\",\"crossorigin\",\"datetime\",\"decoding\",\"default\",\"dir\",\"disabled\",\"disablepictureinpicture\",\"disableremoteplayback\",\"download\",\"draggable\",\"enctype\",\"enterkeyhint\",\"face\",\"for\",\"headers\",\"height\",\"hidden\",\"high\",\"href\",\"hreflang\",\"id\",\"inputmode\",\"integrity\",\"ismap\",\"kind\",\"label\",\"lang\",\"list\",\"loading\",\"loop\",\"low\",\"max\",\"maxlength\",\"media\",\"method\",\"min\",\"minlength\",\"multiple\",\"muted\",\"name\",\"nonce\",\"noshade\",\"novalidate\",\"nowrap\",\"open\",\"optimum\",\"pattern\",\"placeholder\",\"playsinline\",\"popover\",\"popovertarget\",\"popovertargetaction\",\"poster\",\"preload\",\"pubdate\",\"radiogroup\",\"readonly\",\"rel\",\"required\",\"rev\",\"reversed\",\"role\",\"rows\",\"rowspan\",\"spellcheck\",\"scope\",\"selected\",\"shape\",\"size\",\"sizes\",\"span\",\"srclang\",\"start\",\"src\",\"srcset\",\"step\",\"style\",\"summary\",\"tabindex\",\"title\",\"translate\",\"type\",\"usemap\",\"valign\",\"value\",\"width\",\"wrap\",\"xmlns\",\"slot\"]),xe=w([\"accent-height\",\"accumulate\",\"additive\",\"alignment-baseline\",\"ascent\",\"attributename\",\"attributetype\",\"azimuth\",\"basefrequency\",\"baseline-shift\",\"begin\",\"bias\",\"by\",\"class\",\"clip\",\"clippathunits\",\"clip-path\",\"clip-rule\",\"color\",\"color-interpolation\",\"color-interpolation-filters\",\"color-profile\",\"color-rendering\",\"cx\",\"cy\",\"d\",\"dx\",\"dy\",\"diffuseconstant\",\"direction\",\"display\",\"divisor\",\"dur\",\"edgemode\",\"elevation\",\"end\",\"fill\",\"fill-opacity\",\"fill-rule\",\"filter\",\"filterunits\",\"flood-color\",\"flood-opacity\",\"font-family\",\"font-size\",\"font-size-adjust\",\"font-stretch\",\"font-style\",\"font-variant\",\"font-weight\",\"fx\",\"fy\",\"g1\",\"g2\",\"glyph-name\",\"glyphref\",\"gradientunits\",\"gradienttransform\",\"height\",\"href\",\"id\",\"image-rendering\",\"in\",\"in2\",\"k\",\"k1\",\"k2\",\"k3\",\"k4\",\"kerning\",\"keypoints\",\"keysplines\",\"keytimes\",\"lang\",\"lengthadjust\",\"letter-spacing\",\"kernelmatrix\",\"kernelunitlength\",\"lighting-color\",\"local\",\"marker-end\",\"marker-mid\",\"marker-start\",\"markerheight\",\"markerunits\",\"markerwidth\",\"maskcontentunits\",\"maskunits\",\"max\",\"mask\",\"media\",\"method\",\"mode\",\"min\",\"name\",\"numoctaves\",\"offset\",\"operator\",\"opacity\",\"order\",\"orient\",\"orientation\",\"origin\",\"overflow\",\"paint-order\",\"path\",\"pathlength\",\"patterncontentunits\",\"patterntransform\",\"patternunits\",\"points\",\"preservealpha\",\"preserveaspectratio\",\"primitiveunits\",\"r\",\"rx\",\"ry\",\"radius\",\"refx\",\"refy\",\"repeatcount\",\"repeatdur\",\"restart\",\"result\",\"rotate\",\"scale\",\"seed\",\"shape-rendering\",\"specularconstant\",\"specularexponent\",\"spreadmethod\",\"startoffset\",\"stddeviation\",\"stitchtiles\",\"stop-color\",\"stop-opacity\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-miterlimit\",\"stroke-opacity\",\"stroke\",\"stroke-width\",\"style\",\"surfacescale\",\"systemlanguage\",\"tabindex\",\"targetx\",\"targety\",\"transform\",\"transform-origin\",\"text-anchor\",\"text-decoration\",\"text-rendering\",\"textlength\",\"type\",\"u1\",\"u2\",\"unicode\",\"values\",\"viewbox\",\"visibility\",\"version\",\"vert-adv-y\",\"vert-origin-x\",\"vert-origin-y\",\"width\",\"word-spacing\",\"wrap\",\"writing-mode\",\"xchannelselector\",\"ychannelselector\",\"x\",\"x1\",\"x2\",\"xmlns\",\"y\",\"y1\",\"y2\",\"z\",\"zoomandpan\"]),Pe=w([\"accent\",\"accentunder\",\"align\",\"bevelled\",\"close\",\"columnsalign\",\"columnlines\",\"columnspan\",\"denomalign\",\"depth\",\"dir\",\"display\",\"displaystyle\",\"encoding\",\"fence\",\"frame\",\"height\",\"href\",\"id\",\"largeop\",\"length\",\"linethickness\",\"lspace\",\"lquote\",\"mathbackground\",\"mathcolor\",\"mathsize\",\"mathvariant\",\"maxsize\",\"minsize\",\"movablelimits\",\"notation\",\"numalign\",\"open\",\"rowalign\",\"rowlines\",\"rowspacing\",\"rowspan\",\"rspace\",\"rquote\",\"scriptlevel\",\"scriptminsize\",\"scriptsizemultiplier\",\"selection\",\"separator\",\"separators\",\"stretchy\",\"subscriptshift\",\"supscriptshift\",\"symmetric\",\"voffset\",\"width\",\"xmlns\"]),Te=w([\"xlink:href\",\"xml:id\",\"xlink:title\",\"xml:space\",\"xmlns:xlink\"]),Re=x(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm),qe=x(/<%[\\w\\W]*|[\\w\\W]*%>/gm),$e=x(/\\${[\\w\\W]*}/gm),ze=x(/^data-[\\-\\w.\\u00B7-\\uFFFF]/),We=x(/^aria-[\\-\\w]+$/),He=x(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i),Ye=x(/^(?:\\w+script|data):/i),Xe=x(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g),Qe=x(/^html$/i),et=x(/^[a-z][.\\w]*(-[.\\w]+)+$/i);var tt=Object.freeze({__proto__:null,MUSTACHE_EXPR:Re,ERB_EXPR:qe,TMPLIT_EXPR:$e,DATA_ATTR:ze,ARIA_ATTR:We,IS_ALLOWED_URI:He,IS_SCRIPT_OR_DATA:Ye,ATTR_WHITESPACE:Xe,DOCTYPE_NAME:Qe,CUSTOM_ELEMENT:et});const rt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},nt=function getGlobal(){return\"undefined\"==typeof window?null:window},ot=function _createTrustedTypesPolicy(o,s){if(\"object\"!=typeof o||\"function\"!=typeof o.createPolicy)return null;let i=null;const u=\"data-tt-policy-suffix\";s&&s.hasAttribute(u)&&(i=s.getAttribute(u));const _=\"dompurify\"+(i?\"#\"+i:\"\");try{return o.createPolicy(_,{createHTML:o=>o,createScriptURL:o=>o})}catch(o){return console.warn(\"TrustedTypes policy \"+_+\" could not be created.\"),null}};function createDOMPurify(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nt();const DOMPurify=o=>createDOMPurify(o);if(DOMPurify.version=\"3.1.4\",DOMPurify.removed=[],!s||!s.document||s.document.nodeType!==rt.document)return DOMPurify.isSupported=!1,DOMPurify;let{document:i}=s;const u=i,_=u.currentScript,{DocumentFragment:x,HTMLTemplateElement:j,Node:L,Element:Re,NodeFilter:qe,NamedNodeMap:$e=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:ze,DOMParser:We,trustedTypes:Ye}=s,Xe=Re.prototype,et=lookupGetter(Xe,\"cloneNode\"),st=lookupGetter(Xe,\"nextSibling\"),it=lookupGetter(Xe,\"childNodes\"),at=lookupGetter(Xe,\"parentNode\");if(\"function\"==typeof j){const o=i.createElement(\"template\");o.content&&o.content.ownerDocument&&(i=o.content.ownerDocument)}let ct,lt=\"\";const{implementation:ut,createNodeIterator:pt,createDocumentFragment:ht,getElementsByTagName:dt}=i,{importNode:mt}=u;let gt={};DOMPurify.isSupported=\"function\"==typeof o&&\"function\"==typeof at&&ut&&void 0!==ut.createHTMLDocument;const{MUSTACHE_EXPR:yt,ERB_EXPR:vt,TMPLIT_EXPR:bt,DATA_ATTR:_t,ARIA_ATTR:Et,IS_SCRIPT_OR_DATA:wt,ATTR_WHITESPACE:St,CUSTOM_ELEMENT:xt}=tt;let{IS_ALLOWED_URI:kt}=tt,Ot=null;const Ct=addToSet({},[...pe,...de,...fe,...be,...we]);let At=null;const jt=addToSet({},[...Se,...xe,...Pe,...Te]);let Pt=Object.seal(C(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),It=null,Mt=null,Nt=!0,Tt=!0,Rt=!1,Dt=!0,Lt=!1,Bt=!0,Ft=!1,qt=!1,$t=!1,Vt=!1,Ut=!1,zt=!1,Wt=!0,Kt=!1;const Ht=\"user-content-\";let Jt=!0,Gt=!1,Yt={},Xt=null;const Qt=addToSet({},[\"annotation-xml\",\"audio\",\"colgroup\",\"desc\",\"foreignobject\",\"head\",\"iframe\",\"math\",\"mi\",\"mn\",\"mo\",\"ms\",\"mtext\",\"noembed\",\"noframes\",\"noscript\",\"plaintext\",\"script\",\"style\",\"svg\",\"template\",\"thead\",\"title\",\"video\",\"xmp\"]);let Zt=null;const er=addToSet({},[\"audio\",\"video\",\"img\",\"source\",\"image\",\"track\"]);let tr=null;const rr=addToSet({},[\"alt\",\"class\",\"for\",\"id\",\"label\",\"name\",\"pattern\",\"placeholder\",\"role\",\"summary\",\"title\",\"value\",\"style\",\"xmlns\"]),nr=\"http://www.w3.org/1998/Math/MathML\",sr=\"http://www.w3.org/2000/svg\",ir=\"http://www.w3.org/1999/xhtml\";let ar=ir,cr=!1,lr=null;const ur=addToSet({},[nr,sr,ir],z);let pr=null;const dr=[\"application/xhtml+xml\",\"text/html\"],fr=\"text/html\";let mr=null,gr=null;const yr=255,vr=i.createElement(\"form\"),br=function isRegexOrFunction(o){return o instanceof RegExp||o instanceof Function},_r=function _parseConfig(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!gr||gr!==o){if(o&&\"object\"==typeof o||(o={}),o=clone(o),pr=-1===dr.indexOf(o.PARSER_MEDIA_TYPE)?fr:o.PARSER_MEDIA_TYPE,mr=\"application/xhtml+xml\"===pr?z:U,Ot=ae(o,\"ALLOWED_TAGS\")?addToSet({},o.ALLOWED_TAGS,mr):Ct,At=ae(o,\"ALLOWED_ATTR\")?addToSet({},o.ALLOWED_ATTR,mr):jt,lr=ae(o,\"ALLOWED_NAMESPACES\")?addToSet({},o.ALLOWED_NAMESPACES,z):ur,tr=ae(o,\"ADD_URI_SAFE_ATTR\")?addToSet(clone(rr),o.ADD_URI_SAFE_ATTR,mr):rr,Zt=ae(o,\"ADD_DATA_URI_TAGS\")?addToSet(clone(er),o.ADD_DATA_URI_TAGS,mr):er,Xt=ae(o,\"FORBID_CONTENTS\")?addToSet({},o.FORBID_CONTENTS,mr):Qt,It=ae(o,\"FORBID_TAGS\")?addToSet({},o.FORBID_TAGS,mr):{},Mt=ae(o,\"FORBID_ATTR\")?addToSet({},o.FORBID_ATTR,mr):{},Yt=!!ae(o,\"USE_PROFILES\")&&o.USE_PROFILES,Nt=!1!==o.ALLOW_ARIA_ATTR,Tt=!1!==o.ALLOW_DATA_ATTR,Rt=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Dt=!1!==o.ALLOW_SELF_CLOSE_IN_ATTR,Lt=o.SAFE_FOR_TEMPLATES||!1,Bt=!1!==o.SAFE_FOR_XML,Ft=o.WHOLE_DOCUMENT||!1,Vt=o.RETURN_DOM||!1,Ut=o.RETURN_DOM_FRAGMENT||!1,zt=o.RETURN_TRUSTED_TYPE||!1,$t=o.FORCE_BODY||!1,Wt=!1!==o.SANITIZE_DOM,Kt=o.SANITIZE_NAMED_PROPS||!1,Jt=!1!==o.KEEP_CONTENT,Gt=o.IN_PLACE||!1,kt=o.ALLOWED_URI_REGEXP||He,ar=o.NAMESPACE||ir,Pt=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&br(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Pt.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&br(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Pt.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&\"boolean\"==typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Pt.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Lt&&(Tt=!1),Ut&&(Vt=!0),Yt&&(Ot=addToSet({},we),At=[],!0===Yt.html&&(addToSet(Ot,pe),addToSet(At,Se)),!0===Yt.svg&&(addToSet(Ot,de),addToSet(At,xe),addToSet(At,Te)),!0===Yt.svgFilters&&(addToSet(Ot,fe),addToSet(At,xe),addToSet(At,Te)),!0===Yt.mathMl&&(addToSet(Ot,be),addToSet(At,Pe),addToSet(At,Te))),o.ADD_TAGS&&(Ot===Ct&&(Ot=clone(Ot)),addToSet(Ot,o.ADD_TAGS,mr)),o.ADD_ATTR&&(At===jt&&(At=clone(At)),addToSet(At,o.ADD_ATTR,mr)),o.ADD_URI_SAFE_ATTR&&addToSet(tr,o.ADD_URI_SAFE_ATTR,mr),o.FORBID_CONTENTS&&(Xt===Qt&&(Xt=clone(Xt)),addToSet(Xt,o.FORBID_CONTENTS,mr)),Jt&&(Ot[\"#text\"]=!0),Ft&&addToSet(Ot,[\"html\",\"head\",\"body\"]),Ot.table&&(addToSet(Ot,[\"tbody\"]),delete It.tbody),o.TRUSTED_TYPES_POLICY){if(\"function\"!=typeof o.TRUSTED_TYPES_POLICY.createHTML)throw le('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');if(\"function\"!=typeof o.TRUSTED_TYPES_POLICY.createScriptURL)throw le('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');ct=o.TRUSTED_TYPES_POLICY,lt=ct.createHTML(\"\")}else void 0===ct&&(ct=ot(Ye,_)),null!==ct&&\"string\"==typeof lt&&(lt=ct.createHTML(\"\"));w&&w(o),gr=o}},Er=addToSet({},[\"mi\",\"mo\",\"mn\",\"ms\",\"mtext\"]),wr=addToSet({},[\"foreignobject\",\"annotation-xml\"]),Sr=addToSet({},[\"title\",\"style\",\"font\",\"a\",\"script\"]),xr=addToSet({},[...de,...fe,...ye]),kr=addToSet({},[...be,..._e]),Or=function _checkValidNamespace(o){let s=at(o);s&&s.tagName||(s={namespaceURI:ar,tagName:\"template\"});const i=U(o.tagName),u=U(s.tagName);return!!lr[o.namespaceURI]&&(o.namespaceURI===sr?s.namespaceURI===ir?\"svg\"===i:s.namespaceURI===nr?\"svg\"===i&&(\"annotation-xml\"===u||Er[u]):Boolean(xr[i]):o.namespaceURI===nr?s.namespaceURI===ir?\"math\"===i:s.namespaceURI===sr?\"math\"===i&&wr[u]:Boolean(kr[i]):o.namespaceURI===ir?!(s.namespaceURI===sr&&!wr[u])&&!(s.namespaceURI===nr&&!Er[u])&&!kr[i]&&(Sr[i]||!xr[i]):!(\"application/xhtml+xml\"!==pr||!lr[o.namespaceURI]))},Cr=function _forceRemove(o){V(DOMPurify.removed,{element:o});try{o.parentNode.removeChild(o)}catch(s){o.remove()}},Ar=function _removeAttribute(o,s){try{V(DOMPurify.removed,{attribute:s.getAttributeNode(o),from:s})}catch(o){V(DOMPurify.removed,{attribute:null,from:s})}if(s.removeAttribute(o),\"is\"===o&&!At[o])if(Vt||Ut)try{Cr(s)}catch(o){}else try{s.setAttribute(o,\"\")}catch(o){}},jr=function _initDocument(o){let s=null,u=null;if($t)o=\"<remove></remove>\"+o;else{const s=Y(o,/^[\\r\\n\\t ]+/);u=s&&s[0]}\"application/xhtml+xml\"===pr&&ar===ir&&(o='<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>'+o+\"</body></html>\");const _=ct?ct.createHTML(o):o;if(ar===ir)try{s=(new We).parseFromString(_,pr)}catch(o){}if(!s||!s.documentElement){s=ut.createDocument(ar,\"template\",null);try{s.documentElement.innerHTML=cr?lt:_}catch(o){}}const w=s.body||s.documentElement;return o&&u&&w.insertBefore(i.createTextNode(u),w.childNodes[0]||null),ar===ir?dt.call(s,Ft?\"html\":\"body\")[0]:Ft?s.documentElement:w},Pr=function _createNodeIterator(o){return pt.call(o.ownerDocument||o,o,qe.SHOW_ELEMENT|qe.SHOW_COMMENT|qe.SHOW_TEXT|qe.SHOW_PROCESSING_INSTRUCTION|qe.SHOW_CDATA_SECTION,null)},Ir=function _isClobbered(o){return o instanceof ze&&(void 0!==o.__depth&&\"number\"!=typeof o.__depth||void 0!==o.__removalCount&&\"number\"!=typeof o.__removalCount||\"string\"!=typeof o.nodeName||\"string\"!=typeof o.textContent||\"function\"!=typeof o.removeChild||!(o.attributes instanceof $e)||\"function\"!=typeof o.removeAttribute||\"function\"!=typeof o.setAttribute||\"string\"!=typeof o.namespaceURI||\"function\"!=typeof o.insertBefore||\"function\"!=typeof o.hasChildNodes)},Mr=function _isNode(o){return\"function\"==typeof L&&o instanceof L},Nr=function _executeHook(o,s,i){gt[o]&&B(gt[o],(o=>{o.call(DOMPurify,s,i,gr)}))},Tr=function _sanitizeElements(o){let s=null;if(Nr(\"beforeSanitizeElements\",o,null),Ir(o))return Cr(o),!0;const i=mr(o.nodeName);if(Nr(\"uponSanitizeElement\",o,{tagName:i,allowedTags:Ot}),o.hasChildNodes()&&!Mr(o.firstElementChild)&&ce(/<[/\\w]/g,o.innerHTML)&&ce(/<[/\\w]/g,o.textContent))return Cr(o),!0;if(o.nodeType===rt.progressingInstruction)return Cr(o),!0;if(Bt&&o.nodeType===rt.comment&&ce(/<[/\\w]/g,o.data))return Cr(o),!0;if(!Ot[i]||It[i]){if(!It[i]&&Dr(i)){if(Pt.tagNameCheck instanceof RegExp&&ce(Pt.tagNameCheck,i))return!1;if(Pt.tagNameCheck instanceof Function&&Pt.tagNameCheck(i))return!1}if(Jt&&!Xt[i]){const s=at(o)||o.parentNode,i=it(o)||o.childNodes;if(i&&s)for(let u=i.length-1;u>=0;--u){const _=et(i[u],!0);_.__removalCount=(o.__removalCount||0)+1,s.insertBefore(_,st(o))}}return Cr(o),!0}return o instanceof Re&&!Or(o)?(Cr(o),!0):\"noscript\"!==i&&\"noembed\"!==i&&\"noframes\"!==i||!ce(/<\\/no(script|embed|frames)/i,o.innerHTML)?(Lt&&o.nodeType===rt.text&&(s=o.textContent,B([yt,vt,bt],(o=>{s=Z(s,o,\" \")})),o.textContent!==s&&(V(DOMPurify.removed,{element:o.cloneNode()}),o.textContent=s)),Nr(\"afterSanitizeElements\",o,null),!1):(Cr(o),!0)},Rr=function _isValidAttribute(o,s,u){if(Wt&&(\"id\"===s||\"name\"===s)&&(u in i||u in vr||\"__depth\"===u||\"__removalCount\"===u))return!1;if(Tt&&!Mt[s]&&ce(_t,s));else if(Nt&&ce(Et,s));else if(!At[s]||Mt[s]){if(!(Dr(o)&&(Pt.tagNameCheck instanceof RegExp&&ce(Pt.tagNameCheck,o)||Pt.tagNameCheck instanceof Function&&Pt.tagNameCheck(o))&&(Pt.attributeNameCheck instanceof RegExp&&ce(Pt.attributeNameCheck,s)||Pt.attributeNameCheck instanceof Function&&Pt.attributeNameCheck(s))||\"is\"===s&&Pt.allowCustomizedBuiltInElements&&(Pt.tagNameCheck instanceof RegExp&&ce(Pt.tagNameCheck,u)||Pt.tagNameCheck instanceof Function&&Pt.tagNameCheck(u))))return!1}else if(tr[s]);else if(ce(kt,Z(u,St,\"\")));else if(\"src\"!==s&&\"xlink:href\"!==s&&\"href\"!==s||\"script\"===o||0!==ee(u,\"data:\")||!Zt[o])if(Rt&&!ce(wt,Z(u,St,\"\")));else if(u)return!1;return!0},Dr=function _isBasicCustomElement(o){return\"annotation-xml\"!==o&&Y(o,xt)},Lr=function _sanitizeAttributes(o){Nr(\"beforeSanitizeAttributes\",o,null);const{attributes:s}=o;if(!s)return;const i={attrName:\"\",attrValue:\"\",keepAttr:!0,allowedAttributes:At};let u=s.length;for(;u--;){const _=s[u],{name:w,namespaceURI:x,value:C}=_,j=mr(w);let L=\"value\"===w?C:ie(C);if(i.attrName=j,i.attrValue=L,i.keepAttr=!0,i.forceKeepAttr=void 0,Nr(\"uponSanitizeAttribute\",o,i),L=i.attrValue,i.forceKeepAttr)continue;if(Ar(w,o),!i.keepAttr)continue;if(!Dt&&ce(/\\/>/i,L)){Ar(w,o);continue}if(Bt&&ce(/((--!?|])>)|<\\/(style|title)/i,L)){Ar(w,o);continue}Lt&&B([yt,vt,bt],(o=>{L=Z(L,o,\" \")}));const V=mr(o.nodeName);if(Rr(V,j,L)){if(!Kt||\"id\"!==j&&\"name\"!==j||(Ar(w,o),L=Ht+L),ct&&\"object\"==typeof Ye&&\"function\"==typeof Ye.getAttributeType)if(x);else switch(Ye.getAttributeType(V,j)){case\"TrustedHTML\":L=ct.createHTML(L);break;case\"TrustedScriptURL\":L=ct.createScriptURL(L)}try{x?o.setAttributeNS(x,w,L):o.setAttribute(w,L),Ir(o)?Cr(o):$(DOMPurify.removed)}catch(o){}}}Nr(\"afterSanitizeAttributes\",o,null)},Br=function _sanitizeShadowDOM(o){let s=null;const i=Pr(o);for(Nr(\"beforeSanitizeShadowDOM\",o,null);s=i.nextNode();){if(Nr(\"uponSanitizeShadowNode\",s,null),Tr(s))continue;const o=at(s);s.nodeType===rt.element&&(o&&o.__depth?s.__depth=(s.__removalCount||0)+o.__depth+1:s.__depth=1),(s.__depth>=yr||s.__depth<0||numberIsNaN(s.__depth))&&Cr(s),s.content instanceof x&&(s.content.__depth=s.__depth,_sanitizeShadowDOM(s.content)),Lr(s)}Nr(\"afterSanitizeShadowDOM\",o,null)};return DOMPurify.sanitize=function(o){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,_=null,w=null,C=null;if(cr=!o,cr&&(o=\"\\x3c!--\\x3e\"),\"string\"!=typeof o&&!Mr(o)){if(\"function\"!=typeof o.toString)throw le(\"toString is not a function\");if(\"string\"!=typeof(o=o.toString()))throw le(\"dirty is not a string, aborting\")}if(!DOMPurify.isSupported)return o;if(qt||_r(s),DOMPurify.removed=[],\"string\"==typeof o&&(Gt=!1),Gt){if(o.nodeName){const s=mr(o.nodeName);if(!Ot[s]||It[s])throw le(\"root node is forbidden and cannot be sanitized in-place\")}}else if(o instanceof L)i=jr(\"\\x3c!----\\x3e\"),_=i.ownerDocument.importNode(o,!0),_.nodeType===rt.element&&\"BODY\"===_.nodeName||\"HTML\"===_.nodeName?i=_:i.appendChild(_);else{if(!Vt&&!Lt&&!Ft&&-1===o.indexOf(\"<\"))return ct&&zt?ct.createHTML(o):o;if(i=jr(o),!i)return Vt?null:zt?lt:\"\"}i&&$t&&Cr(i.firstChild);const j=Pr(Gt?o:i);for(;w=j.nextNode();){if(Tr(w))continue;const o=at(w);w.nodeType===rt.element&&(o&&o.__depth?w.__depth=(w.__removalCount||0)+o.__depth+1:w.__depth=1),(w.__depth>=yr||w.__depth<0||numberIsNaN(w.__depth))&&Cr(w),w.content instanceof x&&(w.content.__depth=w.__depth,Br(w.content)),Lr(w)}if(Gt)return o;if(Vt){if(Ut)for(C=ht.call(i.ownerDocument);i.firstChild;)C.appendChild(i.firstChild);else C=i;return(At.shadowroot||At.shadowrootmode)&&(C=mt.call(u,C,!0)),C}let $=Ft?i.outerHTML:i.innerHTML;return Ft&&Ot[\"!doctype\"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ce(Qe,i.ownerDocument.doctype.name)&&($=\"<!DOCTYPE \"+i.ownerDocument.doctype.name+\">\\n\"+$),Lt&&B([yt,vt,bt],(o=>{$=Z($,o,\" \")})),ct&&zt?ct.createHTML($):$},DOMPurify.setConfig=function(){_r(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),qt=!0},DOMPurify.clearConfig=function(){gr=null,qt=!1},DOMPurify.isValidAttribute=function(o,s,i){gr||_r({});const u=mr(o),_=mr(s);return Rr(u,_,i)},DOMPurify.addHook=function(o,s){\"function\"==typeof s&&(gt[o]=gt[o]||[],V(gt[o],s))},DOMPurify.removeHook=function(o){if(gt[o])return $(gt[o])},DOMPurify.removeHooks=function(o){gt[o]&&(gt[o]=[])},DOMPurify.removeAllHooks=function(){gt={}},DOMPurify}return createDOMPurify()}()},78004:o=>{\"use strict\";class SubRange{constructor(o,s){this.low=o,this.high=s,this.length=1+s-o}overlaps(o){return!(this.high<o.low||this.low>o.high)}touches(o){return!(this.high+1<o.low||this.low-1>o.high)}add(o){return new SubRange(Math.min(this.low,o.low),Math.max(this.high,o.high))}subtract(o){return o.low<=this.low&&o.high>=this.high?[]:o.low>this.low&&o.high<this.high?[new SubRange(this.low,o.low-1),new SubRange(o.high+1,this.high)]:o.low<=this.low?[new SubRange(o.high+1,this.high)]:[new SubRange(this.low,o.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+\"-\"+this.high}}class DRange{constructor(o,s){this.ranges=[],this.length=0,null!=o&&this.add(o,s)}_update_length(){this.length=this.ranges.reduce(((o,s)=>o+s.length),0)}add(o,s){var _add=o=>{for(var s=0;s<this.ranges.length&&!o.touches(this.ranges[s]);)s++;for(var i=this.ranges.slice(0,s);s<this.ranges.length&&o.touches(this.ranges[s]);)o=o.add(this.ranges[s]),s++;i.push(o),this.ranges=i.concat(this.ranges.slice(s)),this._update_length()};return o instanceof DRange?o.ranges.forEach(_add):(null==s&&(s=o),_add(new SubRange(o,s))),this}subtract(o,s){var _subtract=o=>{for(var s=0;s<this.ranges.length&&!o.overlaps(this.ranges[s]);)s++;for(var i=this.ranges.slice(0,s);s<this.ranges.length&&o.overlaps(this.ranges[s]);)i=i.concat(this.ranges[s].subtract(o)),s++;this.ranges=i.concat(this.ranges.slice(s)),this._update_length()};return o instanceof DRange?o.ranges.forEach(_subtract):(null==s&&(s=o),_subtract(new SubRange(o,s))),this}intersect(o,s){var i=[],_intersect=o=>{for(var s=0;s<this.ranges.length&&!o.overlaps(this.ranges[s]);)s++;for(;s<this.ranges.length&&o.overlaps(this.ranges[s]);){var u=Math.max(this.ranges[s].low,o.low),_=Math.min(this.ranges[s].high,o.high);i.push(new SubRange(u,_)),s++}};return o instanceof DRange?o.ranges.forEach(_intersect):(null==s&&(s=o),_intersect(new SubRange(o,s))),this.ranges=i,this._update_length(),this}index(o){for(var s=0;s<this.ranges.length&&this.ranges[s].length<=o;)o-=this.ranges[s].length,s++;return this.ranges[s].low+o}toString(){return\"[ \"+this.ranges.join(\", \")+\" ]\"}clone(){return new DRange(this)}numbers(){return this.ranges.reduce(((o,s)=>{for(var i=s.low;i<=s.high;)o.push(i),i++;return o}),[])}subranges(){return this.ranges.map((o=>({low:o.low,high:o.high,length:1+o.high-o.low})))}}o.exports=DRange},30655:(o,s,i)=>{\"use strict\";var u=i(70453)(\"%Object.defineProperty%\",!0)||!1;if(u)try{u({},\"a\",{value:1})}catch(o){u=!1}o.exports=u},41237:o=>{\"use strict\";o.exports=EvalError},69383:o=>{\"use strict\";o.exports=Error},79290:o=>{\"use strict\";o.exports=RangeError},79538:o=>{\"use strict\";o.exports=ReferenceError},58068:o=>{\"use strict\";o.exports=SyntaxError},69675:o=>{\"use strict\";o.exports=TypeError},35345:o=>{\"use strict\";o.exports=URIError},37007:o=>{\"use strict\";var s,i=\"object\"==typeof Reflect?Reflect:null,u=i&&\"function\"==typeof i.apply?i.apply:function ReflectApply(o,s,i){return Function.prototype.apply.call(o,s,i)};s=i&&\"function\"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function ReflectOwnKeys(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:function ReflectOwnKeys(o){return Object.getOwnPropertyNames(o)};var _=Number.isNaN||function NumberIsNaN(o){return o!=o};function EventEmitter(){EventEmitter.init.call(this)}o.exports=EventEmitter,o.exports.once=function once(o,s){return new Promise((function(i,u){function errorListener(i){o.removeListener(s,resolver),u(i)}function resolver(){\"function\"==typeof o.removeListener&&o.removeListener(\"error\",errorListener),i([].slice.call(arguments))}eventTargetAgnosticAddListener(o,s,resolver,{once:!0}),\"error\"!==s&&function addErrorHandlerIfEventEmitter(o,s,i){\"function\"==typeof o.on&&eventTargetAgnosticAddListener(o,\"error\",s,i)}(o,errorListener,{once:!0})}))},EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var w=10;function checkListener(o){if(\"function\"!=typeof o)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof o)}function _getMaxListeners(o){return void 0===o._maxListeners?EventEmitter.defaultMaxListeners:o._maxListeners}function _addListener(o,s,i,u){var _,w,x;if(checkListener(i),void 0===(w=o._events)?(w=o._events=Object.create(null),o._eventsCount=0):(void 0!==w.newListener&&(o.emit(\"newListener\",s,i.listener?i.listener:i),w=o._events),x=w[s]),void 0===x)x=w[s]=i,++o._eventsCount;else if(\"function\"==typeof x?x=w[s]=u?[i,x]:[x,i]:u?x.unshift(i):x.push(i),(_=_getMaxListeners(o))>0&&x.length>_&&!x.warned){x.warned=!0;var C=new Error(\"Possible EventEmitter memory leak detected. \"+x.length+\" \"+String(s)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");C.name=\"MaxListenersExceededWarning\",C.emitter=o,C.type=s,C.count=x.length,function ProcessEmitWarning(o){console&&console.warn&&console.warn(o)}(C)}return o}function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(o,s,i){var u={fired:!1,wrapFn:void 0,target:o,type:s,listener:i},_=onceWrapper.bind(u);return _.listener=i,u.wrapFn=_,_}function _listeners(o,s,i){var u=o._events;if(void 0===u)return[];var _=u[s];return void 0===_?[]:\"function\"==typeof _?i?[_.listener||_]:[_]:i?function unwrapListeners(o){for(var s=new Array(o.length),i=0;i<s.length;++i)s[i]=o[i].listener||o[i];return s}(_):arrayClone(_,_.length)}function listenerCount(o){var s=this._events;if(void 0!==s){var i=s[o];if(\"function\"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function arrayClone(o,s){for(var i=new Array(s),u=0;u<s;++u)i[u]=o[u];return i}function eventTargetAgnosticAddListener(o,s,i,u){if(\"function\"==typeof o.on)u.once?o.once(s,i):o.on(s,i);else{if(\"function\"!=typeof o.addEventListener)throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type '+typeof o);o.addEventListener(s,(function wrapListener(_){u.once&&o.removeEventListener(s,wrapListener),i(_)}))}}Object.defineProperty(EventEmitter,\"defaultMaxListeners\",{enumerable:!0,get:function(){return w},set:function(o){if(\"number\"!=typeof o||o<0||_(o))throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received '+o+\".\");w=o}}),EventEmitter.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function setMaxListeners(o){if(\"number\"!=typeof o||o<0||_(o))throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received '+o+\".\");return this._maxListeners=o,this},EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return _getMaxListeners(this)},EventEmitter.prototype.emit=function emit(o){for(var s=[],i=1;i<arguments.length;i++)s.push(arguments[i]);var _=\"error\"===o,w=this._events;if(void 0!==w)_=_&&void 0===w.error;else if(!_)return!1;if(_){var x;if(s.length>0&&(x=s[0]),x instanceof Error)throw x;var C=new Error(\"Unhandled error.\"+(x?\" (\"+x.message+\")\":\"\"));throw C.context=x,C}var j=w[o];if(void 0===j)return!1;if(\"function\"==typeof j)u(j,this,s);else{var L=j.length,B=arrayClone(j,L);for(i=0;i<L;++i)u(B[i],this,s)}return!0},EventEmitter.prototype.addListener=function addListener(o,s){return _addListener(this,o,s,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function prependListener(o,s){return _addListener(this,o,s,!0)},EventEmitter.prototype.once=function once(o,s){return checkListener(s),this.on(o,_onceWrap(this,o,s)),this},EventEmitter.prototype.prependOnceListener=function prependOnceListener(o,s){return checkListener(s),this.prependListener(o,_onceWrap(this,o,s)),this},EventEmitter.prototype.removeListener=function removeListener(o,s){var i,u,_,w,x;if(checkListener(s),void 0===(u=this._events))return this;if(void 0===(i=u[o]))return this;if(i===s||i.listener===s)0==--this._eventsCount?this._events=Object.create(null):(delete u[o],u.removeListener&&this.emit(\"removeListener\",o,i.listener||s));else if(\"function\"!=typeof i){for(_=-1,w=i.length-1;w>=0;w--)if(i[w]===s||i[w].listener===s){x=i[w].listener,_=w;break}if(_<0)return this;0===_?i.shift():function spliceOne(o,s){for(;s+1<o.length;s++)o[s]=o[s+1];o.pop()}(i,_),1===i.length&&(u[o]=i[0]),void 0!==u.removeListener&&this.emit(\"removeListener\",o,x||s)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function removeAllListeners(o){var s,i,u;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[o]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[o]),this;if(0===arguments.length){var _,w=Object.keys(i);for(u=0;u<w.length;++u)\"removeListener\"!==(_=w[u])&&this.removeAllListeners(_);return this.removeAllListeners(\"removeListener\"),this._events=Object.create(null),this._eventsCount=0,this}if(\"function\"==typeof(s=i[o]))this.removeListener(o,s);else if(void 0!==s)for(u=s.length-1;u>=0;u--)this.removeListener(o,s[u]);return this},EventEmitter.prototype.listeners=function listeners(o){return _listeners(this,o,!0)},EventEmitter.prototype.rawListeners=function rawListeners(o){return _listeners(this,o,!1)},EventEmitter.listenerCount=function(o,s){return\"function\"==typeof o.listenerCount?o.listenerCount(s):listenerCount.call(o,s)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?s(this._events):[]}},85587:(o,s,i)=>{\"use strict\";var u=i(26311),_=create(Error);function create(o){return FormattedError.displayName=o.displayName||o.name,FormattedError;function FormattedError(s){return s&&(s=u.apply(null,arguments)),new o(s)}}o.exports=_,_.eval=create(EvalError),_.range=create(RangeError),_.reference=create(ReferenceError),_.syntax=create(SyntaxError),_.type=create(TypeError),_.uri=create(URIError),_.create=create},26311:o=>{!function(){var s;function format(o){for(var s,i,u,_,w=1,x=[].slice.call(arguments),C=0,j=o.length,L=\"\",B=!1,$=!1,nextArg=function(){return x[w++]},slurpNumber=function(){for(var i=\"\";/\\d/.test(o[C]);)i+=o[C++],s=o[C];return i.length>0?parseInt(i):null};C<j;++C)if(s=o[C],B)switch(B=!1,\".\"==s?($=!1,s=o[++C]):\"0\"==s&&\".\"==o[C+1]?($=!0,s=o[C+=2]):$=!0,_=slurpNumber(),s){case\"b\":L+=parseInt(nextArg(),10).toString(2);break;case\"c\":L+=\"string\"==typeof(i=nextArg())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case\"d\":L+=parseInt(nextArg(),10);break;case\"f\":u=String(parseFloat(nextArg()).toFixed(_||6)),L+=$?u:u.replace(/^0/,\"\");break;case\"j\":L+=JSON.stringify(nextArg());break;case\"o\":L+=\"0\"+parseInt(nextArg(),10).toString(8);break;case\"s\":L+=nextArg();break;case\"x\":L+=\"0x\"+parseInt(nextArg(),10).toString(16);break;case\"X\":L+=\"0x\"+parseInt(nextArg(),10).toString(16).toUpperCase();break;default:L+=s}else\"%\"===s?B=!0:L+=s;return L}(s=o.exports=format).format=format,s.vsprintf=function vsprintf(o,s){return format.apply(null,[o].concat(s))},\"undefined\"!=typeof console&&\"function\"==typeof console.log&&(s.printf=function printf(){console.log(format.apply(null,arguments))})}()},89353:o=>{\"use strict\";var s=Object.prototype.toString,i=Math.max,u=function concatty(o,s){for(var i=[],u=0;u<o.length;u+=1)i[u]=o[u];for(var _=0;_<s.length;_+=1)i[_+o.length]=s[_];return i};o.exports=function bind(o){var _=this;if(\"function\"!=typeof _||\"[object Function]\"!==s.apply(_))throw new TypeError(\"Function.prototype.bind called on incompatible \"+_);for(var w,x=function slicy(o,s){for(var i=[],u=s||0,_=0;u<o.length;u+=1,_+=1)i[_]=o[u];return i}(arguments,1),C=i(0,_.length-x.length),j=[],L=0;L<C;L++)j[L]=\"$\"+L;if(w=Function(\"binder\",\"return function (\"+function(o,s){for(var i=\"\",u=0;u<o.length;u+=1)i+=o[u],u+1<o.length&&(i+=s);return i}(j,\",\")+\"){ return binder.apply(this,arguments); }\")((function(){if(this instanceof w){var s=_.apply(this,u(x,arguments));return Object(s)===s?s:this}return _.apply(o,u(x,arguments))})),_.prototype){var B=function Empty(){};B.prototype=_.prototype,w.prototype=new B,B.prototype=null}return w}},66743:(o,s,i)=>{\"use strict\";var u=i(89353);o.exports=Function.prototype.bind||u},70453:(o,s,i)=>{\"use strict\";var u,_=i(69383),w=i(41237),x=i(79290),C=i(79538),j=i(58068),L=i(69675),B=i(35345),$=Function,getEvalledConstructor=function(o){try{return $('\"use strict\"; return ('+o+\").constructor;\")()}catch(o){}},V=Object.getOwnPropertyDescriptor;if(V)try{V({},\"\")}catch(o){V=null}var throwTypeError=function(){throw new L},U=V?function(){try{return throwTypeError}catch(o){try{return V(arguments,\"callee\").get}catch(o){return throwTypeError}}}():throwTypeError,z=i(64039)(),Y=i(80024)(),Z=Object.getPrototypeOf||(Y?function(o){return o.__proto__}:null),ee={},ie=\"undefined\"!=typeof Uint8Array&&Z?Z(Uint8Array):u,ae={__proto__:null,\"%AggregateError%\":\"undefined\"==typeof AggregateError?u:AggregateError,\"%Array%\":Array,\"%ArrayBuffer%\":\"undefined\"==typeof ArrayBuffer?u:ArrayBuffer,\"%ArrayIteratorPrototype%\":z&&Z?Z([][Symbol.iterator]()):u,\"%AsyncFromSyncIteratorPrototype%\":u,\"%AsyncFunction%\":ee,\"%AsyncGenerator%\":ee,\"%AsyncGeneratorFunction%\":ee,\"%AsyncIteratorPrototype%\":ee,\"%Atomics%\":\"undefined\"==typeof Atomics?u:Atomics,\"%BigInt%\":\"undefined\"==typeof BigInt?u:BigInt,\"%BigInt64Array%\":\"undefined\"==typeof BigInt64Array?u:BigInt64Array,\"%BigUint64Array%\":\"undefined\"==typeof BigUint64Array?u:BigUint64Array,\"%Boolean%\":Boolean,\"%DataView%\":\"undefined\"==typeof DataView?u:DataView,\"%Date%\":Date,\"%decodeURI%\":decodeURI,\"%decodeURIComponent%\":decodeURIComponent,\"%encodeURI%\":encodeURI,\"%encodeURIComponent%\":encodeURIComponent,\"%Error%\":_,\"%eval%\":eval,\"%EvalError%\":w,\"%Float32Array%\":\"undefined\"==typeof Float32Array?u:Float32Array,\"%Float64Array%\":\"undefined\"==typeof Float64Array?u:Float64Array,\"%FinalizationRegistry%\":\"undefined\"==typeof FinalizationRegistry?u:FinalizationRegistry,\"%Function%\":$,\"%GeneratorFunction%\":ee,\"%Int8Array%\":\"undefined\"==typeof Int8Array?u:Int8Array,\"%Int16Array%\":\"undefined\"==typeof Int16Array?u:Int16Array,\"%Int32Array%\":\"undefined\"==typeof Int32Array?u:Int32Array,\"%isFinite%\":isFinite,\"%isNaN%\":isNaN,\"%IteratorPrototype%\":z&&Z?Z(Z([][Symbol.iterator]())):u,\"%JSON%\":\"object\"==typeof JSON?JSON:u,\"%Map%\":\"undefined\"==typeof Map?u:Map,\"%MapIteratorPrototype%\":\"undefined\"!=typeof Map&&z&&Z?Z((new Map)[Symbol.iterator]()):u,\"%Math%\":Math,\"%Number%\":Number,\"%Object%\":Object,\"%parseFloat%\":parseFloat,\"%parseInt%\":parseInt,\"%Promise%\":\"undefined\"==typeof Promise?u:Promise,\"%Proxy%\":\"undefined\"==typeof Proxy?u:Proxy,\"%RangeError%\":x,\"%ReferenceError%\":C,\"%Reflect%\":\"undefined\"==typeof Reflect?u:Reflect,\"%RegExp%\":RegExp,\"%Set%\":\"undefined\"==typeof Set?u:Set,\"%SetIteratorPrototype%\":\"undefined\"!=typeof Set&&z&&Z?Z((new Set)[Symbol.iterator]()):u,\"%SharedArrayBuffer%\":\"undefined\"==typeof SharedArrayBuffer?u:SharedArrayBuffer,\"%String%\":String,\"%StringIteratorPrototype%\":z&&Z?Z(\"\"[Symbol.iterator]()):u,\"%Symbol%\":z?Symbol:u,\"%SyntaxError%\":j,\"%ThrowTypeError%\":U,\"%TypedArray%\":ie,\"%TypeError%\":L,\"%Uint8Array%\":\"undefined\"==typeof Uint8Array?u:Uint8Array,\"%Uint8ClampedArray%\":\"undefined\"==typeof Uint8ClampedArray?u:Uint8ClampedArray,\"%Uint16Array%\":\"undefined\"==typeof Uint16Array?u:Uint16Array,\"%Uint32Array%\":\"undefined\"==typeof Uint32Array?u:Uint32Array,\"%URIError%\":B,\"%WeakMap%\":\"undefined\"==typeof WeakMap?u:WeakMap,\"%WeakRef%\":\"undefined\"==typeof WeakRef?u:WeakRef,\"%WeakSet%\":\"undefined\"==typeof WeakSet?u:WeakSet};if(Z)try{null.error}catch(o){var ce=Z(Z(o));ae[\"%Error.prototype%\"]=ce}var le=function doEval(o){var s;if(\"%AsyncFunction%\"===o)s=getEvalledConstructor(\"async function () {}\");else if(\"%GeneratorFunction%\"===o)s=getEvalledConstructor(\"function* () {}\");else if(\"%AsyncGeneratorFunction%\"===o)s=getEvalledConstructor(\"async function* () {}\");else if(\"%AsyncGenerator%\"===o){var i=doEval(\"%AsyncGeneratorFunction%\");i&&(s=i.prototype)}else if(\"%AsyncIteratorPrototype%\"===o){var u=doEval(\"%AsyncGenerator%\");u&&Z&&(s=Z(u.prototype))}return ae[o]=s,s},pe={__proto__:null,\"%ArrayBufferPrototype%\":[\"ArrayBuffer\",\"prototype\"],\"%ArrayPrototype%\":[\"Array\",\"prototype\"],\"%ArrayProto_entries%\":[\"Array\",\"prototype\",\"entries\"],\"%ArrayProto_forEach%\":[\"Array\",\"prototype\",\"forEach\"],\"%ArrayProto_keys%\":[\"Array\",\"prototype\",\"keys\"],\"%ArrayProto_values%\":[\"Array\",\"prototype\",\"values\"],\"%AsyncFunctionPrototype%\":[\"AsyncFunction\",\"prototype\"],\"%AsyncGenerator%\":[\"AsyncGeneratorFunction\",\"prototype\"],\"%AsyncGeneratorPrototype%\":[\"AsyncGeneratorFunction\",\"prototype\",\"prototype\"],\"%BooleanPrototype%\":[\"Boolean\",\"prototype\"],\"%DataViewPrototype%\":[\"DataView\",\"prototype\"],\"%DatePrototype%\":[\"Date\",\"prototype\"],\"%ErrorPrototype%\":[\"Error\",\"prototype\"],\"%EvalErrorPrototype%\":[\"EvalError\",\"prototype\"],\"%Float32ArrayPrototype%\":[\"Float32Array\",\"prototype\"],\"%Float64ArrayPrototype%\":[\"Float64Array\",\"prototype\"],\"%FunctionPrototype%\":[\"Function\",\"prototype\"],\"%Generator%\":[\"GeneratorFunction\",\"prototype\"],\"%GeneratorPrototype%\":[\"GeneratorFunction\",\"prototype\",\"prototype\"],\"%Int8ArrayPrototype%\":[\"Int8Array\",\"prototype\"],\"%Int16ArrayPrototype%\":[\"Int16Array\",\"prototype\"],\"%Int32ArrayPrototype%\":[\"Int32Array\",\"prototype\"],\"%JSONParse%\":[\"JSON\",\"parse\"],\"%JSONStringify%\":[\"JSON\",\"stringify\"],\"%MapPrototype%\":[\"Map\",\"prototype\"],\"%NumberPrototype%\":[\"Number\",\"prototype\"],\"%ObjectPrototype%\":[\"Object\",\"prototype\"],\"%ObjProto_toString%\":[\"Object\",\"prototype\",\"toString\"],\"%ObjProto_valueOf%\":[\"Object\",\"prototype\",\"valueOf\"],\"%PromisePrototype%\":[\"Promise\",\"prototype\"],\"%PromiseProto_then%\":[\"Promise\",\"prototype\",\"then\"],\"%Promise_all%\":[\"Promise\",\"all\"],\"%Promise_reject%\":[\"Promise\",\"reject\"],\"%Promise_resolve%\":[\"Promise\",\"resolve\"],\"%RangeErrorPrototype%\":[\"RangeError\",\"prototype\"],\"%ReferenceErrorPrototype%\":[\"ReferenceError\",\"prototype\"],\"%RegExpPrototype%\":[\"RegExp\",\"prototype\"],\"%SetPrototype%\":[\"Set\",\"prototype\"],\"%SharedArrayBufferPrototype%\":[\"SharedArrayBuffer\",\"prototype\"],\"%StringPrototype%\":[\"String\",\"prototype\"],\"%SymbolPrototype%\":[\"Symbol\",\"prototype\"],\"%SyntaxErrorPrototype%\":[\"SyntaxError\",\"prototype\"],\"%TypedArrayPrototype%\":[\"TypedArray\",\"prototype\"],\"%TypeErrorPrototype%\":[\"TypeError\",\"prototype\"],\"%Uint8ArrayPrototype%\":[\"Uint8Array\",\"prototype\"],\"%Uint8ClampedArrayPrototype%\":[\"Uint8ClampedArray\",\"prototype\"],\"%Uint16ArrayPrototype%\":[\"Uint16Array\",\"prototype\"],\"%Uint32ArrayPrototype%\":[\"Uint32Array\",\"prototype\"],\"%URIErrorPrototype%\":[\"URIError\",\"prototype\"],\"%WeakMapPrototype%\":[\"WeakMap\",\"prototype\"],\"%WeakSetPrototype%\":[\"WeakSet\",\"prototype\"]},de=i(66743),fe=i(9957),ye=de.call(Function.call,Array.prototype.concat),be=de.call(Function.apply,Array.prototype.splice),_e=de.call(Function.call,String.prototype.replace),we=de.call(Function.call,String.prototype.slice),Se=de.call(Function.call,RegExp.prototype.exec),xe=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,Pe=/\\\\(\\\\)?/g,Te=function getBaseIntrinsic(o,s){var i,u=o;if(fe(pe,u)&&(u=\"%\"+(i=pe[u])[0]+\"%\"),fe(ae,u)){var _=ae[u];if(_===ee&&(_=le(u)),void 0===_&&!s)throw new L(\"intrinsic \"+o+\" exists, but is not available. Please file an issue!\");return{alias:i,name:u,value:_}}throw new j(\"intrinsic \"+o+\" does not exist!\")};o.exports=function GetIntrinsic(o,s){if(\"string\"!=typeof o||0===o.length)throw new L(\"intrinsic name must be a non-empty string\");if(arguments.length>1&&\"boolean\"!=typeof s)throw new L('\"allowMissing\" argument must be a boolean');if(null===Se(/^%?[^%]*%?$/,o))throw new j(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");var i=function stringToPath(o){var s=we(o,0,1),i=we(o,-1);if(\"%\"===s&&\"%\"!==i)throw new j(\"invalid intrinsic syntax, expected closing `%`\");if(\"%\"===i&&\"%\"!==s)throw new j(\"invalid intrinsic syntax, expected opening `%`\");var u=[];return _e(o,xe,(function(o,s,i,_){u[u.length]=i?_e(_,Pe,\"$1\"):s||o})),u}(o),u=i.length>0?i[0]:\"\",_=Te(\"%\"+u+\"%\",s),w=_.name,x=_.value,C=!1,B=_.alias;B&&(u=B[0],be(i,ye([0,1],B)));for(var $=1,U=!0;$<i.length;$+=1){var z=i[$],Y=we(z,0,1),Z=we(z,-1);if(('\"'===Y||\"'\"===Y||\"`\"===Y||'\"'===Z||\"'\"===Z||\"`\"===Z)&&Y!==Z)throw new j(\"property names with quotes must have matching quotes\");if(\"constructor\"!==z&&U||(C=!0),fe(ae,w=\"%\"+(u+=\".\"+z)+\"%\"))x=ae[w];else if(null!=x){if(!(z in x)){if(!s)throw new L(\"base intrinsic for \"+o+\" exists, but the property is not available.\");return}if(V&&$+1>=i.length){var ee=V(x,z);x=(U=!!ee)&&\"get\"in ee&&!(\"originalValue\"in ee.get)?ee.get:x[z]}else U=fe(x,z),x=x[z];U&&!C&&(ae[w]=x)}}return x}},75795:(o,s,i)=>{\"use strict\";var u=i(70453)(\"%Object.getOwnPropertyDescriptor%\",!0);if(u)try{u([],\"length\")}catch(o){u=null}o.exports=u},30592:(o,s,i)=>{\"use strict\";var u=i(30655),_=function hasPropertyDescriptors(){return!!u};_.hasArrayLengthDefineBug=function hasArrayLengthDefineBug(){if(!u)return null;try{return 1!==u([],\"length\",{value:1}).length}catch(o){return!0}},o.exports=_},80024:o=>{\"use strict\";var s={__proto__:null,foo:{}},i=Object;o.exports=function hasProto(){return{__proto__:s}.foo===s.foo&&!(s instanceof i)}},64039:(o,s,i)=>{\"use strict\";var u=\"undefined\"!=typeof Symbol&&Symbol,_=i(41333);o.exports=function hasNativeSymbols(){return\"function\"==typeof u&&(\"function\"==typeof Symbol&&(\"symbol\"==typeof u(\"foo\")&&(\"symbol\"==typeof Symbol(\"bar\")&&_())))}},41333:o=>{\"use strict\";o.exports=function hasSymbols(){if(\"function\"!=typeof Symbol||\"function\"!=typeof Object.getOwnPropertySymbols)return!1;if(\"symbol\"==typeof Symbol.iterator)return!0;var o={},s=Symbol(\"test\"),i=Object(s);if(\"string\"==typeof s)return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(s))return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(i))return!1;for(s in o[s]=42,o)return!1;if(\"function\"==typeof Object.keys&&0!==Object.keys(o).length)return!1;if(\"function\"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(o).length)return!1;var u=Object.getOwnPropertySymbols(o);if(1!==u.length||u[0]!==s)return!1;if(!Object.prototype.propertyIsEnumerable.call(o,s))return!1;if(\"function\"==typeof Object.getOwnPropertyDescriptor){var _=Object.getOwnPropertyDescriptor(o,s);if(42!==_.value||!0!==_.enumerable)return!1}return!0}},9957:(o,s,i)=>{\"use strict\";var u=Function.prototype.call,_=Object.prototype.hasOwnProperty,w=i(66743);o.exports=w.call(u,_)},45981:o=>{function deepFreeze(o){return o instanceof Map?o.clear=o.delete=o.set=function(){throw new Error(\"map is read-only\")}:o instanceof Set&&(o.add=o.clear=o.delete=function(){throw new Error(\"set is read-only\")}),Object.freeze(o),Object.getOwnPropertyNames(o).forEach((function(s){var i=o[s];\"object\"!=typeof i||Object.isFrozen(i)||deepFreeze(i)})),o}var s=deepFreeze,i=deepFreeze;s.default=i;class Response{constructor(o){void 0===o.data&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function escapeHTML(o){return o.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#x27;\")}function inherit(o,...s){const i=Object.create(null);for(const s in o)i[s]=o[s];return s.forEach((function(o){for(const s in o)i[s]=o[s]})),i}const emitsWrappingTags=o=>!!o.kind;class HTMLRenderer{constructor(o,s){this.buffer=\"\",this.classPrefix=s.classPrefix,o.walk(this)}addText(o){this.buffer+=escapeHTML(o)}openNode(o){if(!emitsWrappingTags(o))return;let s=o.kind;o.sublanguage||(s=`${this.classPrefix}${s}`),this.span(s)}closeNode(o){emitsWrappingTags(o)&&(this.buffer+=\"</span>\")}value(){return this.buffer}span(o){this.buffer+=`<span class=\"${o}\">`}}class TokenTree{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const s={kind:o,children:[]};this.add(s),this.stack.push(s)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,s){return\"string\"==typeof s?o.addText(s):s.children&&(o.openNode(s),s.children.forEach((s=>this._walk(o,s))),o.closeNode(s)),o}static _collapse(o){\"string\"!=typeof o&&o.children&&(o.children.every((o=>\"string\"==typeof o))?o.children=[o.children.join(\"\")]:o.children.forEach((o=>{TokenTree._collapse(o)})))}}class TokenTreeEmitter extends TokenTree{constructor(o){super(),this.options=o}addKeyword(o,s){\"\"!==o&&(this.openNode(s),this.addText(o),this.closeNode())}addText(o){\"\"!==o&&this.add(o)}addSublanguage(o,s){const i=o.root;i.kind=s,i.sublanguage=!0,this.add(i)}toHTML(){return new HTMLRenderer(this,this.options).value()}finalize(){return!0}}function source(o){return o?\"string\"==typeof o?o:o.source:null}const u=/\\[(?:[^\\\\\\]]|\\\\.)*\\]|\\(\\??|\\\\([1-9][0-9]*)|\\\\./;const _=\"[a-zA-Z]\\\\w*\",w=\"[a-zA-Z_]\\\\w*\",x=\"\\\\b\\\\d+(\\\\.\\\\d+)?\",C=\"(-?)(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)\",j=\"\\\\b(0b[01]+)\",L={begin:\"\\\\\\\\[\\\\s\\\\S]\",relevance:0},B={className:\"string\",begin:\"'\",end:\"'\",illegal:\"\\\\n\",contains:[L]},$={className:\"string\",begin:'\"',end:'\"',illegal:\"\\\\n\",contains:[L]},V={begin:/\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b/},COMMENT=function(o,s,i={}){const u=inherit({className:\"comment\",begin:o,end:s,contains:[]},i);return u.contains.push(V),u.contains.push({className:\"doctag\",begin:\"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):\",relevance:0}),u},U=COMMENT(\"//\",\"$\"),z=COMMENT(\"/\\\\*\",\"\\\\*/\"),Y=COMMENT(\"#\",\"$\"),Z={className:\"number\",begin:x,relevance:0},ee={className:\"number\",begin:C,relevance:0},ie={className:\"number\",begin:j,relevance:0},ae={className:\"number\",begin:x+\"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\",relevance:0},ce={begin:/(?=\\/[^/\\n]*\\/)/,contains:[{className:\"regexp\",begin:/\\//,end:/\\/[gimuy]*/,illegal:/\\n/,contains:[L,{begin:/\\[/,end:/\\]/,relevance:0,contains:[L]}]}]},le={className:\"title\",begin:_,relevance:0},pe={className:\"title\",begin:w,relevance:0},de={begin:\"\\\\.\\\\s*\"+w,relevance:0};var fe=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\\b\\B/,IDENT_RE:_,UNDERSCORE_IDENT_RE:w,NUMBER_RE:x,C_NUMBER_RE:C,BINARY_NUMBER_RE:j,RE_STARTERS_RE:\"!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~\",SHEBANG:(o={})=>{const s=/^#![ ]*\\//;return o.binary&&(o.begin=function concat(...o){return o.map((o=>source(o))).join(\"\")}(s,/.*\\b/,o.binary,/\\b.*/)),inherit({className:\"meta\",begin:s,end:/$/,relevance:0,\"on:begin\":(o,s)=>{0!==o.index&&s.ignoreMatch()}},o)},BACKSLASH_ESCAPE:L,APOS_STRING_MODE:B,QUOTE_STRING_MODE:$,PHRASAL_WORDS_MODE:V,COMMENT,C_LINE_COMMENT_MODE:U,C_BLOCK_COMMENT_MODE:z,HASH_COMMENT_MODE:Y,NUMBER_MODE:Z,C_NUMBER_MODE:ee,BINARY_NUMBER_MODE:ie,CSS_NUMBER_MODE:ae,REGEXP_MODE:ce,TITLE_MODE:le,UNDERSCORE_TITLE_MODE:pe,METHOD_GUARD:de,END_SAME_AS_BEGIN:function(o){return Object.assign(o,{\"on:begin\":(o,s)=>{s.data._beginMatch=o[1]},\"on:end\":(o,s)=>{s.data._beginMatch!==o[1]&&s.ignoreMatch()}})}});function skipIfhasPrecedingDot(o,s){\".\"===o.input[o.index-1]&&s.ignoreMatch()}function beginKeywords(o,s){s&&o.beginKeywords&&(o.begin=\"\\\\b(\"+o.beginKeywords.split(\" \").join(\"|\")+\")(?!\\\\.)(?=\\\\b|\\\\s)\",o.__beforeBegin=skipIfhasPrecedingDot,o.keywords=o.keywords||o.beginKeywords,delete o.beginKeywords,void 0===o.relevance&&(o.relevance=0))}function compileIllegal(o,s){Array.isArray(o.illegal)&&(o.illegal=function either(...o){return\"(\"+o.map((o=>source(o))).join(\"|\")+\")\"}(...o.illegal))}function compileMatch(o,s){if(o.match){if(o.begin||o.end)throw new Error(\"begin & end are not supported with match\");o.begin=o.match,delete o.match}}function compileRelevance(o,s){void 0===o.relevance&&(o.relevance=1)}const ye=[\"of\",\"and\",\"for\",\"in\",\"not\",\"or\",\"if\",\"then\",\"parent\",\"list\",\"value\"],be=\"keyword\";function compileKeywords(o,s,i=be){const u={};return\"string\"==typeof o?compileList(i,o.split(\" \")):Array.isArray(o)?compileList(i,o):Object.keys(o).forEach((function(i){Object.assign(u,compileKeywords(o[i],s,i))})),u;function compileList(o,i){s&&(i=i.map((o=>o.toLowerCase()))),i.forEach((function(s){const i=s.split(\"|\");u[i[0]]=[o,scoreForKeyword(i[0],i[1])]}))}}function scoreForKeyword(o,s){return s?Number(s):function commonKeyword(o){return ye.includes(o.toLowerCase())}(o)?0:1}function compileLanguage(o,{plugins:s}){function langRe(s,i){return new RegExp(source(s),\"m\"+(o.case_insensitive?\"i\":\"\")+(i?\"g\":\"\"))}class MultiRegex{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,s){s.position=this.position++,this.matchIndexes[this.matchAt]=s,this.regexes.push([s,o]),this.matchAt+=function countMatchGroups(o){return new RegExp(o.toString()+\"|\").exec(\"\").length-1}(o)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const o=this.regexes.map((o=>o[1]));this.matcherRe=langRe(function join(o,s=\"|\"){let i=0;return o.map((o=>{i+=1;const s=i;let _=source(o),w=\"\";for(;_.length>0;){const o=u.exec(_);if(!o){w+=_;break}w+=_.substring(0,o.index),_=_.substring(o.index+o[0].length),\"\\\\\"===o[0][0]&&o[1]?w+=\"\\\\\"+String(Number(o[1])+s):(w+=o[0],\"(\"===o[0]&&i++)}return w})).map((o=>`(${o})`)).join(s)}(o),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const s=this.matcherRe.exec(o);if(!s)return null;const i=s.findIndex(((o,s)=>s>0&&void 0!==o)),u=this.matchIndexes[i];return s.splice(0,i),Object.assign(s,u)}}class ResumableMultiRegex{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const s=new MultiRegex;return this.rules.slice(o).forEach((([o,i])=>s.addRule(o,i))),s.compile(),this.multiRegexes[o]=s,s}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(o,s){this.rules.push([o,s]),\"begin\"===s.type&&this.count++}exec(o){const s=this.getMatcher(this.regexIndex);s.lastIndex=this.lastIndex;let i=s.exec(o);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const s=this.getMatcher(0);s.lastIndex=this.lastIndex+1,i=s.exec(o)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(o.compilerExtensions||(o.compilerExtensions=[]),o.contains&&o.contains.includes(\"self\"))throw new Error(\"ERR: contains `self` is not supported at the top-level of a language.  See documentation.\");return o.classNameAliases=inherit(o.classNameAliases||{}),function compileMode(s,i){const u=s;if(s.isCompiled)return u;[compileMatch].forEach((o=>o(s,i))),o.compilerExtensions.forEach((o=>o(s,i))),s.__beforeBegin=null,[beginKeywords,compileIllegal,compileRelevance].forEach((o=>o(s,i))),s.isCompiled=!0;let _=null;if(\"object\"==typeof s.keywords&&(_=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=compileKeywords(s.keywords,o.case_insensitive)),s.lexemes&&_)throw new Error(\"ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) \");return _=_||s.lexemes||/\\w+/,u.keywordPatternRe=langRe(_,!0),i&&(s.begin||(s.begin=/\\B|\\b/),u.beginRe=langRe(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\\B|\\b/),s.end&&(u.endRe=langRe(s.end)),u.terminatorEnd=source(s.end)||\"\",s.endsWithParent&&i.terminatorEnd&&(u.terminatorEnd+=(s.end?\"|\":\"\")+i.terminatorEnd)),s.illegal&&(u.illegalRe=langRe(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(o){return function expandOrCloneMode(o){o.variants&&!o.cachedVariants&&(o.cachedVariants=o.variants.map((function(s){return inherit(o,{variants:null},s)})));if(o.cachedVariants)return o.cachedVariants;if(dependencyOnParent(o))return inherit(o,{starts:o.starts?inherit(o.starts):null});if(Object.isFrozen(o))return inherit(o);return o}(\"self\"===o?s:o)}))),s.contains.forEach((function(o){compileMode(o,u)})),s.starts&&compileMode(s.starts,i),u.matcher=function buildModeRegex(o){const s=new ResumableMultiRegex;return o.contains.forEach((o=>s.addRule(o.begin,{rule:o,type:\"begin\"}))),o.terminatorEnd&&s.addRule(o.terminatorEnd,{type:\"end\"}),o.illegal&&s.addRule(o.illegal,{type:\"illegal\"}),s}(u),u}(o)}function dependencyOnParent(o){return!!o&&(o.endsWithParent||dependencyOnParent(o.starts))}function BuildVuePlugin(o){const s={props:[\"language\",\"code\",\"autodetect\"],data:function(){return{detectedLanguage:\"\",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?\"\":\"hljs \"+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!o.getLanguage(this.language))return console.warn(`The language \"${this.language}\" you specified could not be found.`),this.unknownLanguage=!0,escapeHTML(this.code);let s={};return this.autoDetect?(s=o.highlightAuto(this.code),this.detectedLanguage=s.language):(s=o.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),s.value},autoDetect(){return!this.language||function hasValueOrEmptyAttribute(o){return Boolean(o||\"\"===o)}(this.autodetect)},ignoreIllegals:()=>!0},render(o){return o(\"pre\",{},[o(\"code\",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:s,VuePlugin:{install(o){o.component(\"highlightjs\",s)}}}}const _e={\"after:highlightElement\":({el:o,result:s,text:i})=>{const u=nodeStream(o);if(!u.length)return;const _=document.createElement(\"div\");_.innerHTML=s.value,s.value=function mergeStreams(o,s,i){let u=0,_=\"\";const w=[];function selectStream(){return o.length&&s.length?o[0].offset!==s[0].offset?o[0].offset<s[0].offset?o:s:\"start\"===s[0].event?o:s:o.length?o:s}function open(o){function attributeString(o){return\" \"+o.nodeName+'=\"'+escapeHTML(o.value)+'\"'}_+=\"<\"+tag(o)+[].map.call(o.attributes,attributeString).join(\"\")+\">\"}function close(o){_+=\"</\"+tag(o)+\">\"}function render(o){(\"start\"===o.event?open:close)(o.node)}for(;o.length||s.length;){let s=selectStream();if(_+=escapeHTML(i.substring(u,s[0].offset)),u=s[0].offset,s===o){w.reverse().forEach(close);do{render(s.splice(0,1)[0]),s=selectStream()}while(s===o&&s.length&&s[0].offset===u);w.reverse().forEach(open)}else\"start\"===s[0].event?w.push(s[0].node):w.pop(),render(s.splice(0,1)[0])}return _+escapeHTML(i.substr(u))}(u,nodeStream(_),i)}};function tag(o){return o.nodeName.toLowerCase()}function nodeStream(o){const s=[];return function _nodeStream(o,i){for(let u=o.firstChild;u;u=u.nextSibling)3===u.nodeType?i+=u.nodeValue.length:1===u.nodeType&&(s.push({event:\"start\",offset:i,node:u}),i=_nodeStream(u,i),tag(u).match(/br|hr|img|input/)||s.push({event:\"stop\",offset:i,node:u}));return i}(o,0),s}const we={},error=o=>{console.error(o)},warn=(o,...s)=>{console.log(`WARN: ${o}`,...s)},deprecated=(o,s)=>{we[`${o}/${s}`]||(console.log(`Deprecated as of ${o}. ${s}`),we[`${o}/${s}`]=!0)},Se=escapeHTML,xe=inherit,Pe=Symbol(\"nomatch\");var Te=function(o){const i=Object.create(null),u=Object.create(null),_=[];let w=!0;const x=/(^(<[^>]+>|\\t|)+|\\n)/gm,C=\"Could not find the language '{}', did you forget to load/include a language module?\",j={disableAutodetect:!0,name:\"Plain text\",contains:[]};let L={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\\blang(?:uage)?-([\\w-]+)\\b/i,classPrefix:\"hljs-\",tabReplace:null,useBR:!1,languages:null,__emitter:TokenTreeEmitter};function shouldNotHighlight(o){return L.noHighlightRe.test(o)}function highlight(o,s,i,u){let _=\"\",w=\"\";\"object\"==typeof s?(_=o,i=s.ignoreIllegals,w=s.language,u=void 0):(deprecated(\"10.7.0\",\"highlight(lang, code, ...args) has been deprecated.\"),deprecated(\"10.7.0\",\"Please use highlight(code, options) instead.\\nhttps://github.com/highlightjs/highlight.js/issues/2277\"),w=o,_=s);const x={code:_,language:w};fire(\"before:highlight\",x);const C=x.result?x.result:_highlight(x.language,x.code,i,u);return C.code=x.code,fire(\"after:highlight\",C),C}function _highlight(o,s,u,x){function keywordData(o,s){const i=B.case_insensitive?s[0].toLowerCase():s[0];return Object.prototype.hasOwnProperty.call(o.keywords,i)&&o.keywords[i]}function processBuffer(){null!=U.subLanguage?function processSubLanguage(){if(\"\"===Z)return;let o=null;if(\"string\"==typeof U.subLanguage){if(!i[U.subLanguage])return void Y.addText(Z);o=_highlight(U.subLanguage,Z,!0,z[U.subLanguage]),z[U.subLanguage]=o.top}else o=highlightAuto(Z,U.subLanguage.length?U.subLanguage:null);U.relevance>0&&(ee+=o.relevance),Y.addSublanguage(o.emitter,o.language)}():function processKeywords(){if(!U.keywords)return void Y.addText(Z);let o=0;U.keywordPatternRe.lastIndex=0;let s=U.keywordPatternRe.exec(Z),i=\"\";for(;s;){i+=Z.substring(o,s.index);const u=keywordData(U,s);if(u){const[o,_]=u;if(Y.addText(i),i=\"\",ee+=_,o.startsWith(\"_\"))i+=s[0];else{const i=B.classNameAliases[o]||o;Y.addKeyword(s[0],i)}}else i+=s[0];o=U.keywordPatternRe.lastIndex,s=U.keywordPatternRe.exec(Z)}i+=Z.substr(o),Y.addText(i)}(),Z=\"\"}function startNewMode(o){return o.className&&Y.openNode(B.classNameAliases[o.className]||o.className),U=Object.create(o,{parent:{value:U}}),U}function endOfMode(o,s,i){let u=function startsWith(o,s){const i=o&&o.exec(s);return i&&0===i.index}(o.endRe,i);if(u){if(o[\"on:end\"]){const i=new Response(o);o[\"on:end\"](s,i),i.isMatchIgnored&&(u=!1)}if(u){for(;o.endsParent&&o.parent;)o=o.parent;return o}}if(o.endsWithParent)return endOfMode(o.parent,s,i)}function doIgnore(o){return 0===U.matcher.regexIndex?(Z+=o[0],1):(ce=!0,0)}function doBeginMatch(o){const s=o[0],i=o.rule,u=new Response(i),_=[i.__beforeBegin,i[\"on:begin\"]];for(const i of _)if(i&&(i(o,u),u.isMatchIgnored))return doIgnore(s);return i&&i.endSameAsBegin&&(i.endRe=function escape(o){return new RegExp(o.replace(/[-/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\"),\"m\")}(s)),i.skip?Z+=s:(i.excludeBegin&&(Z+=s),processBuffer(),i.returnBegin||i.excludeBegin||(Z=s)),startNewMode(i),i.returnBegin?0:s.length}function doEndMatch(o){const i=o[0],u=s.substr(o.index),_=endOfMode(U,o,u);if(!_)return Pe;const w=U;w.skip?Z+=i:(w.returnEnd||w.excludeEnd||(Z+=i),processBuffer(),w.excludeEnd&&(Z=i));do{U.className&&Y.closeNode(),U.skip||U.subLanguage||(ee+=U.relevance),U=U.parent}while(U!==_.parent);return _.starts&&(_.endSameAsBegin&&(_.starts.endRe=_.endRe),startNewMode(_.starts)),w.returnEnd?0:i.length}let j={};function processLexeme(i,_){const x=_&&_[0];if(Z+=i,null==x)return processBuffer(),0;if(\"begin\"===j.type&&\"end\"===_.type&&j.index===_.index&&\"\"===x){if(Z+=s.slice(_.index,_.index+1),!w){const s=new Error(\"0 width match regex\");throw s.languageName=o,s.badRule=j.rule,s}return 1}if(j=_,\"begin\"===_.type)return doBeginMatch(_);if(\"illegal\"===_.type&&!u){const o=new Error('Illegal lexeme \"'+x+'\" for mode \"'+(U.className||\"<unnamed>\")+'\"');throw o.mode=U,o}if(\"end\"===_.type){const o=doEndMatch(_);if(o!==Pe)return o}if(\"illegal\"===_.type&&\"\"===x)return 1;if(ae>1e5&&ae>3*_.index){throw new Error(\"potential infinite loop, way more iterations than matches\")}return Z+=x,x.length}const B=getLanguage(o);if(!B)throw error(C.replace(\"{}\",o)),new Error('Unknown language: \"'+o+'\"');const $=compileLanguage(B,{plugins:_});let V=\"\",U=x||$;const z={},Y=new L.__emitter(L);!function processContinuations(){const o=[];for(let s=U;s!==B;s=s.parent)s.className&&o.unshift(s.className);o.forEach((o=>Y.openNode(o)))}();let Z=\"\",ee=0,ie=0,ae=0,ce=!1;try{for(U.matcher.considerAll();;){ae++,ce?ce=!1:U.matcher.considerAll(),U.matcher.lastIndex=ie;const o=U.matcher.exec(s);if(!o)break;const i=processLexeme(s.substring(ie,o.index),o);ie=o.index+i}return processLexeme(s.substr(ie)),Y.closeAllNodes(),Y.finalize(),V=Y.toHTML(),{relevance:Math.floor(ee),value:V,language:o,illegal:!1,emitter:Y,top:U}}catch(i){if(i.message&&i.message.includes(\"Illegal\"))return{illegal:!0,illegalBy:{msg:i.message,context:s.slice(ie-100,ie+100),mode:i.mode},sofar:V,relevance:0,value:Se(s),emitter:Y};if(w)return{illegal:!1,relevance:0,value:Se(s),emitter:Y,language:o,top:U,errorRaised:i};throw i}}function highlightAuto(o,s){s=s||L.languages||Object.keys(i);const u=function justTextHighlightResult(o){const s={relevance:0,emitter:new L.__emitter(L),value:Se(o),illegal:!1,top:j};return s.emitter.addText(o),s}(o),_=s.filter(getLanguage).filter(autoDetection).map((s=>_highlight(s,o,!1)));_.unshift(u);const w=_.sort(((o,s)=>{if(o.relevance!==s.relevance)return s.relevance-o.relevance;if(o.language&&s.language){if(getLanguage(o.language).supersetOf===s.language)return 1;if(getLanguage(s.language).supersetOf===o.language)return-1}return 0})),[x,C]=w,B=x;return B.second_best=C,B}const B={\"before:highlightElement\":({el:o})=>{L.useBR&&(o.innerHTML=o.innerHTML.replace(/\\n/g,\"\").replace(/<br[ /]*>/g,\"\\n\"))},\"after:highlightElement\":({result:o})=>{L.useBR&&(o.value=o.value.replace(/\\n/g,\"<br>\"))}},$=/^(<[^>]+>|\\t)+/gm,V={\"after:highlightElement\":({result:o})=>{L.tabReplace&&(o.value=o.value.replace($,(o=>o.replace(/\\t/g,L.tabReplace))))}};function highlightElement(o){let s=null;const i=function blockLanguage(o){let s=o.className+\" \";s+=o.parentNode?o.parentNode.className:\"\";const i=L.languageDetectRe.exec(s);if(i){const s=getLanguage(i[1]);return s||(warn(C.replace(\"{}\",i[1])),warn(\"Falling back to no-highlight mode for this block.\",o)),s?i[1]:\"no-highlight\"}return s.split(/\\s+/).find((o=>shouldNotHighlight(o)||getLanguage(o)))}(o);if(shouldNotHighlight(i))return;fire(\"before:highlightElement\",{el:o,language:i}),s=o;const _=s.textContent,w=i?highlight(_,{language:i,ignoreIllegals:!0}):highlightAuto(_);fire(\"after:highlightElement\",{el:o,result:w,text:_}),o.innerHTML=w.value,function updateClassName(o,s,i){const _=s?u[s]:i;o.classList.add(\"hljs\"),_&&o.classList.add(_)}(o,i,w.language),o.result={language:w.language,re:w.relevance,relavance:w.relevance},w.second_best&&(o.second_best={language:w.second_best.language,re:w.second_best.relevance,relavance:w.second_best.relevance})}const initHighlighting=()=>{if(initHighlighting.called)return;initHighlighting.called=!0,deprecated(\"10.6.0\",\"initHighlighting() is deprecated.  Use highlightAll() instead.\");document.querySelectorAll(\"pre code\").forEach(highlightElement)};let U=!1;function highlightAll(){if(\"loading\"===document.readyState)return void(U=!0);document.querySelectorAll(\"pre code\").forEach(highlightElement)}function getLanguage(o){return o=(o||\"\").toLowerCase(),i[o]||i[u[o]]}function registerAliases(o,{languageName:s}){\"string\"==typeof o&&(o=[o]),o.forEach((o=>{u[o.toLowerCase()]=s}))}function autoDetection(o){const s=getLanguage(o);return s&&!s.disableAutodetect}function fire(o,s){const i=o;_.forEach((function(o){o[i]&&o[i](s)}))}\"undefined\"!=typeof window&&window.addEventListener&&window.addEventListener(\"DOMContentLoaded\",(function boot(){U&&highlightAll()}),!1),Object.assign(o,{highlight,highlightAuto,highlightAll,fixMarkup:function deprecateFixMarkup(o){return deprecated(\"10.2.0\",\"fixMarkup will be removed entirely in v11.0\"),deprecated(\"10.2.0\",\"Please see https://github.com/highlightjs/highlight.js/issues/2534\"),function fixMarkup(o){return L.tabReplace||L.useBR?o.replace(x,(o=>\"\\n\"===o?L.useBR?\"<br>\":o:L.tabReplace?o.replace(/\\t/g,L.tabReplace):o)):o}(o)},highlightElement,highlightBlock:function deprecateHighlightBlock(o){return deprecated(\"10.7.0\",\"highlightBlock will be removed entirely in v12.0\"),deprecated(\"10.7.0\",\"Please use highlightElement now.\"),highlightElement(o)},configure:function configure(o){o.useBR&&(deprecated(\"10.3.0\",\"'useBR' will be removed entirely in v11.0\"),deprecated(\"10.3.0\",\"Please see https://github.com/highlightjs/highlight.js/issues/2559\")),L=xe(L,o)},initHighlighting,initHighlightingOnLoad:function initHighlightingOnLoad(){deprecated(\"10.6.0\",\"initHighlightingOnLoad() is deprecated.  Use highlightAll() instead.\"),U=!0},registerLanguage:function registerLanguage(s,u){let _=null;try{_=u(o)}catch(o){if(error(\"Language definition for '{}' could not be registered.\".replace(\"{}\",s)),!w)throw o;error(o),_=j}_.name||(_.name=s),i[s]=_,_.rawDefinition=u.bind(null,o),_.aliases&&registerAliases(_.aliases,{languageName:s})},unregisterLanguage:function unregisterLanguage(o){delete i[o];for(const s of Object.keys(u))u[s]===o&&delete u[s]},listLanguages:function listLanguages(){return Object.keys(i)},getLanguage,registerAliases,requireLanguage:function requireLanguage(o){deprecated(\"10.4.0\",\"requireLanguage will be removed entirely in v11.\"),deprecated(\"10.4.0\",\"Please see https://github.com/highlightjs/highlight.js/pull/2844\");const s=getLanguage(o);if(s)return s;throw new Error(\"The '{}' language is required, but not loaded.\".replace(\"{}\",o))},autoDetection,inherit:xe,addPlugin:function addPlugin(o){!function upgradePluginAPI(o){o[\"before:highlightBlock\"]&&!o[\"before:highlightElement\"]&&(o[\"before:highlightElement\"]=s=>{o[\"before:highlightBlock\"](Object.assign({block:s.el},s))}),o[\"after:highlightBlock\"]&&!o[\"after:highlightElement\"]&&(o[\"after:highlightElement\"]=s=>{o[\"after:highlightBlock\"](Object.assign({block:s.el},s))})}(o),_.push(o)},vuePlugin:BuildVuePlugin(o).VuePlugin}),o.debugMode=function(){w=!1},o.safeMode=function(){w=!0},o.versionString=\"10.7.3\";for(const o in fe)\"object\"==typeof fe[o]&&s(fe[o]);return Object.assign(o,fe),o.addPlugin(B),o.addPlugin(_e),o.addPlugin(V),o}({});o.exports=Te},35344:o=>{function concat(...o){return o.map((o=>function source(o){return o?\"string\"==typeof o?o:o.source:null}(o))).join(\"\")}o.exports=function bash(o){const s={},i={begin:/\\$\\{/,end:/\\}/,contains:[\"self\",{begin:/:-/,contains:[s]}]};Object.assign(s,{className:\"variable\",variants:[{begin:concat(/\\$[\\w\\d#@][\\w\\d_]*/,\"(?![\\\\w\\\\d])(?![$])\")},i]});const u={className:\"subst\",begin:/\\$\\(/,end:/\\)/,contains:[o.BACKSLASH_ESCAPE]},_={begin:/<<-?\\s*(?=\\w+)/,starts:{contains:[o.END_SAME_AS_BEGIN({begin:/(\\w+)/,end:/(\\w+)/,className:\"string\"})]}},w={className:\"string\",begin:/\"/,end:/\"/,contains:[o.BACKSLASH_ESCAPE,s,u]};u.contains.push(w);const x={begin:/\\$\\(\\(/,end:/\\)\\)/,contains:[{begin:/\\d+#[0-9a-f]+/,className:\"number\"},o.NUMBER_MODE,s]},C=o.SHEBANG({binary:`(${[\"fish\",\"bash\",\"zsh\",\"sh\",\"csh\",\"ksh\",\"tcsh\",\"dash\",\"scsh\"].join(\"|\")})`,relevance:10}),j={className:\"function\",begin:/\\w[\\w\\d_]*\\s*\\(\\s*\\)\\s*\\{/,returnBegin:!0,contains:[o.inherit(o.TITLE_MODE,{begin:/\\w[\\w\\d_]*/})],relevance:0};return{name:\"Bash\",aliases:[\"sh\",\"zsh\"],keywords:{$pattern:/\\b[a-z._-]+\\b/,keyword:\"if then else elif fi for while in do done case esac function\",literal:\"true false\",built_in:\"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp\"},contains:[C,o.SHEBANG(),j,x,o.HASH_COMMENT_MODE,_,w,{className:\"\",begin:/\\\\\"/},{className:\"string\",begin:/'/,end:/'/},s]}}},73402:o=>{function concat(...o){return o.map((o=>function source(o){return o?\"string\"==typeof o?o:o.source:null}(o))).join(\"\")}o.exports=function http(o){const s=\"HTTP/(2|1\\\\.[01])\",i={className:\"attribute\",begin:concat(\"^\",/[A-Za-z][A-Za-z0-9-]*/,\"(?=\\\\:\\\\s)\"),starts:{contains:[{className:\"punctuation\",begin:/: /,relevance:0,starts:{end:\"$\",relevance:0}}]}},u=[i,{begin:\"\\\\n\\\\n\",starts:{subLanguage:[],endsWithParent:!0}}];return{name:\"HTTP\",aliases:[\"https\"],illegal:/\\S/,contains:[{begin:\"^(?=\"+s+\" \\\\d{3})\",end:/$/,contains:[{className:\"meta\",begin:s},{className:\"number\",begin:\"\\\\b\\\\d{3}\\\\b\"}],starts:{end:/\\b\\B/,illegal:/\\S/,contains:u}},{begin:\"(?=^[A-Z]+ (.*?) \"+s+\"$)\",end:/$/,contains:[{className:\"string\",begin:\" \",end:\" \",excludeBegin:!0,excludeEnd:!0},{className:\"meta\",begin:s},{className:\"keyword\",begin:\"[A-Z]+\"}],starts:{end:/\\b\\B/,illegal:/\\S/,contains:u}},o.inherit(i,{relevance:0})]}}},95089:o=>{const s=\"[A-Za-z$_][0-9A-Za-z$_]*\",i=[\"as\",\"in\",\"of\",\"if\",\"for\",\"while\",\"finally\",\"var\",\"new\",\"function\",\"do\",\"return\",\"void\",\"else\",\"break\",\"catch\",\"instanceof\",\"with\",\"throw\",\"case\",\"default\",\"try\",\"switch\",\"continue\",\"typeof\",\"delete\",\"let\",\"yield\",\"const\",\"class\",\"debugger\",\"async\",\"await\",\"static\",\"import\",\"from\",\"export\",\"extends\"],u=[\"true\",\"false\",\"null\",\"undefined\",\"NaN\",\"Infinity\"],_=[].concat([\"setInterval\",\"setTimeout\",\"clearInterval\",\"clearTimeout\",\"require\",\"exports\",\"eval\",\"isFinite\",\"isNaN\",\"parseFloat\",\"parseInt\",\"decodeURI\",\"decodeURIComponent\",\"encodeURI\",\"encodeURIComponent\",\"escape\",\"unescape\"],[\"arguments\",\"this\",\"super\",\"console\",\"window\",\"document\",\"localStorage\",\"module\",\"global\"],[\"Intl\",\"DataView\",\"Number\",\"Math\",\"Date\",\"String\",\"RegExp\",\"Object\",\"Function\",\"Boolean\",\"Error\",\"Symbol\",\"Set\",\"Map\",\"WeakSet\",\"WeakMap\",\"Proxy\",\"Reflect\",\"JSON\",\"Promise\",\"Float64Array\",\"Int16Array\",\"Int32Array\",\"Int8Array\",\"Uint16Array\",\"Uint32Array\",\"Float32Array\",\"Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"ArrayBuffer\",\"BigInt64Array\",\"BigUint64Array\",\"BigInt\"],[\"EvalError\",\"InternalError\",\"RangeError\",\"ReferenceError\",\"SyntaxError\",\"TypeError\",\"URIError\"]);function lookahead(o){return concat(\"(?=\",o,\")\")}function concat(...o){return o.map((o=>function source(o){return o?\"string\"==typeof o?o:o.source:null}(o))).join(\"\")}o.exports=function javascript(o){const w=s,x=\"<>\",C=\"</>\",j={begin:/<[A-Za-z0-9\\\\._:-]+/,end:/\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,isTrulyOpeningTag:(o,s)=>{const i=o[0].length+o.index,u=o.input[i];\"<\"!==u?\">\"===u&&(((o,{after:s})=>{const i=\"</\"+o[0].slice(1);return-1!==o.input.indexOf(i,s)})(o,{after:i})||s.ignoreMatch()):s.ignoreMatch()}},L={$pattern:s,keyword:i,literal:u,built_in:_},B=\"[0-9](_?[0-9])*\",$=`\\\\.(${B})`,V=\"0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*\",U={className:\"number\",variants:[{begin:`(\\\\b(${V})((${$})|\\\\.)?|(${$}))[eE][+-]?(${B})\\\\b`},{begin:`\\\\b(${V})\\\\b((${$})\\\\b|\\\\.)?|(${$})\\\\b`},{begin:\"\\\\b(0|[1-9](_?[0-9])*)n\\\\b\"},{begin:\"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\"},{begin:\"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\"},{begin:\"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\"},{begin:\"\\\\b0[0-7]+n?\\\\b\"}],relevance:0},z={className:\"subst\",begin:\"\\\\$\\\\{\",end:\"\\\\}\",keywords:L,contains:[]},Y={begin:\"html`\",end:\"\",starts:{end:\"`\",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,z],subLanguage:\"xml\"}},Z={begin:\"css`\",end:\"\",starts:{end:\"`\",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,z],subLanguage:\"css\"}},ee={className:\"string\",begin:\"`\",end:\"`\",contains:[o.BACKSLASH_ESCAPE,z]},ie={className:\"comment\",variants:[o.COMMENT(/\\/\\*\\*(?!\\/)/,\"\\\\*/\",{relevance:0,contains:[{className:\"doctag\",begin:\"@[A-Za-z]+\",contains:[{className:\"type\",begin:\"\\\\{\",end:\"\\\\}\",relevance:0},{className:\"variable\",begin:w+\"(?=\\\\s*(-)|$)\",endsParent:!0,relevance:0},{begin:/(?=[^\\n])\\s/,relevance:0}]}]}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE]},ae=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,Y,Z,ee,U,o.REGEXP_MODE];z.contains=ae.concat({begin:/\\{/,end:/\\}/,keywords:L,contains:[\"self\"].concat(ae)});const ce=[].concat(ie,z.contains),le=ce.concat([{begin:/\\(/,end:/\\)/,keywords:L,contains:[\"self\"].concat(ce)}]),pe={className:\"params\",begin:/\\(/,end:/\\)/,excludeBegin:!0,excludeEnd:!0,keywords:L,contains:le};return{name:\"Javascript\",aliases:[\"js\",\"jsx\",\"mjs\",\"cjs\"],keywords:L,exports:{PARAMS_CONTAINS:le},illegal:/#(?![$_A-z])/,contains:[o.SHEBANG({label:\"shebang\",binary:\"node\",relevance:5}),{label:\"use_strict\",className:\"meta\",relevance:10,begin:/^\\s*['\"]use (strict|asm)['\"]/},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,Y,Z,ee,ie,U,{begin:concat(/[{,\\n]\\s*/,lookahead(concat(/(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,w+\"\\\\s*:\"))),relevance:0,contains:[{className:\"attr\",begin:w+lookahead(\"\\\\s*:\"),relevance:0}]},{begin:\"(\"+o.RE_STARTERS_RE+\"|\\\\b(case|return|throw)\\\\b)\\\\s*\",keywords:\"return throw case\",contains:[ie,o.REGEXP_MODE,{className:\"function\",begin:\"(\\\\([^()]*(\\\\([^()]*(\\\\([^()]*\\\\)[^()]*)*\\\\)[^()]*)*\\\\)|\"+o.UNDERSCORE_IDENT_RE+\")\\\\s*=>\",returnBegin:!0,end:\"\\\\s*=>\",contains:[{className:\"params\",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\\(\\s*\\)/,skip:!0},{begin:/\\(/,end:/\\)/,excludeBegin:!0,excludeEnd:!0,keywords:L,contains:le}]}]},{begin:/,/,relevance:0},{className:\"\",begin:/\\s/,end:/\\s*/,skip:!0},{variants:[{begin:x,end:C},{begin:j.begin,\"on:begin\":j.isTrulyOpeningTag,end:j.end}],subLanguage:\"xml\",contains:[{begin:j.begin,end:j.end,skip:!0,contains:[\"self\"]}]}],relevance:0},{className:\"function\",beginKeywords:\"function\",end:/[{;]/,excludeEnd:!0,keywords:L,contains:[\"self\",o.inherit(o.TITLE_MODE,{begin:w}),pe],illegal:/%/},{beginKeywords:\"while if switch catch for\"},{className:\"function\",begin:o.UNDERSCORE_IDENT_RE+\"\\\\([^()]*(\\\\([^()]*(\\\\([^()]*\\\\)[^()]*)*\\\\)[^()]*)*\\\\)\\\\s*\\\\{\",returnBegin:!0,contains:[pe,o.inherit(o.TITLE_MODE,{begin:w})]},{variants:[{begin:\"\\\\.\"+w},{begin:\"\\\\$\"+w}],relevance:0},{className:\"class\",beginKeywords:\"class\",end:/[{;=]/,excludeEnd:!0,illegal:/[:\"[\\]]/,contains:[{beginKeywords:\"extends\"},o.UNDERSCORE_TITLE_MODE]},{begin:/\\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[o.inherit(o.TITLE_MODE,{begin:w}),\"self\",pe]},{begin:\"(get|set)\\\\s+(?=\"+w+\"\\\\()\",end:/\\{/,keywords:\"get set\",contains:[o.inherit(o.TITLE_MODE,{begin:w}),{begin:/\\(\\)/},pe]},{begin:/\\$[(.]/}]}}},65772:o=>{o.exports=function json(o){const s={literal:\"true false null\"},i=[o.C_LINE_COMMENT_MODE,o.C_BLOCK_COMMENT_MODE],u=[o.QUOTE_STRING_MODE,o.C_NUMBER_MODE],_={end:\",\",endsWithParent:!0,excludeEnd:!0,contains:u,keywords:s},w={begin:/\\{/,end:/\\}/,contains:[{className:\"attr\",begin:/\"/,end:/\"/,contains:[o.BACKSLASH_ESCAPE],illegal:\"\\\\n\"},o.inherit(_,{begin:/:/})].concat(i),illegal:\"\\\\S\"},x={begin:\"\\\\[\",end:\"\\\\]\",contains:[o.inherit(_)],illegal:\"\\\\S\"};return u.push(w,x),i.forEach((function(o){u.push(o)})),{name:\"JSON\",contains:u,keywords:s,illegal:\"\\\\S\"}}},26571:o=>{o.exports=function powershell(o){const s={$pattern:/-?[A-z\\.\\-]+\\b/,keyword:\"if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter\",built_in:\"ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write\"},i={begin:\"`[\\\\s\\\\S]\",relevance:0},u={className:\"variable\",variants:[{begin:/\\$\\B/},{className:\"keyword\",begin:/\\$this/},{begin:/\\$[\\w\\d][\\w\\d_:]*/}]},_={className:\"string\",variants:[{begin:/\"/,end:/\"/},{begin:/@\"/,end:/^\"@/}],contains:[i,u,{className:\"variable\",begin:/\\$[A-z]/,end:/[^A-z]/}]},w={className:\"string\",variants:[{begin:/'/,end:/'/},{begin:/@'/,end:/^'@/}]},x=o.inherit(o.COMMENT(null,null),{variants:[{begin:/#/,end:/$/},{begin:/<#/,end:/#>/}],contains:[{className:\"doctag\",variants:[{begin:/\\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/},{begin:/\\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\\s+\\S+/}]}]}),C={className:\"built_in\",variants:[{begin:\"(\".concat(\"Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where\",\")+(-)[\\\\w\\\\d]+\")}]},j={className:\"class\",beginKeywords:\"class enum\",end:/\\s*[{]/,excludeEnd:!0,relevance:0,contains:[o.TITLE_MODE]},L={className:\"function\",begin:/function\\s+/,end:/\\s*\\{|$/,excludeEnd:!0,returnBegin:!0,relevance:0,contains:[{begin:\"function\",relevance:0,className:\"keyword\"},{className:\"title\",begin:/\\w[\\w\\d]*((-)[\\w\\d]+)*/,relevance:0},{begin:/\\(/,end:/\\)/,className:\"params\",relevance:0,contains:[u]}]},B={begin:/using\\s/,end:/$/,returnBegin:!0,contains:[_,w,{className:\"keyword\",begin:/(using|assembly|command|module|namespace|type)/}]},$={variants:[{className:\"operator\",begin:\"(\".concat(\"-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor\",\")\\\\b\")},{className:\"literal\",begin:/(-)[\\w\\d]+/,relevance:0}]},V={className:\"function\",begin:/\\[.*\\]\\s*[\\w]+[ ]??\\(/,end:/$/,returnBegin:!0,relevance:0,contains:[{className:\"keyword\",begin:\"(\".concat(s.keyword.toString().replace(/\\s/g,\"|\"),\")\\\\b\"),endsParent:!0,relevance:0},o.inherit(o.TITLE_MODE,{endsParent:!0})]},U=[V,x,i,o.NUMBER_MODE,_,w,C,u,{className:\"literal\",begin:/\\$(null|true|false)\\b/},{className:\"selector-tag\",begin:/@\\B/,relevance:0}],z={begin:/\\[/,end:/\\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[].concat(\"self\",U,{begin:\"(\"+[\"string\",\"char\",\"byte\",\"int\",\"long\",\"bool\",\"decimal\",\"single\",\"double\",\"DateTime\",\"xml\",\"array\",\"hashtable\",\"void\"].join(\"|\")+\")\",className:\"built_in\",relevance:0},{className:\"type\",begin:/[\\.\\w\\d]+/,relevance:0})};return V.contains.unshift(z),{name:\"PowerShell\",aliases:[\"ps\",\"ps1\"],case_insensitive:!0,keywords:s,contains:U.concat(j,L,B,$,z)}}},17285:o=>{function source(o){return o?\"string\"==typeof o?o:o.source:null}function lookahead(o){return concat(\"(?=\",o,\")\")}function concat(...o){return o.map((o=>source(o))).join(\"\")}function either(...o){return\"(\"+o.map((o=>source(o))).join(\"|\")+\")\"}o.exports=function xml(o){const s=concat(/[A-Z_]/,function optional(o){return concat(\"(\",o,\")?\")}(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),i={className:\"symbol\",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\\s/,contains:[{className:\"meta-keyword\",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\\n/}]},_=o.inherit(u,{begin:/\\(/,end:/\\)/}),w=o.inherit(o.APOS_STRING_MODE,{className:\"meta-string\"}),x=o.inherit(o.QUOTE_STRING_MODE,{className:\"meta-string\"}),C={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:\"attr\",begin:/[A-Za-z0-9._:-]+/,relevance:0},{begin:/=\\s*/,relevance:0,contains:[{className:\"string\",endsParent:!0,variants:[{begin:/\"/,end:/\"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\\s\"'=<>`]+/}]}]}]};return{name:\"HTML, XML\",aliases:[\"html\",\"xhtml\",\"rss\",\"atom\",\"xjb\",\"xsd\",\"xsl\",\"plist\",\"wsf\",\"svg\"],case_insensitive:!0,contains:[{className:\"meta\",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,x,w,_,{begin:/\\[/,end:/\\]/,contains:[{className:\"meta\",begin:/<![a-z]/,end:/>/,contains:[u,_,x,w]}]}]},o.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\\[CDATA\\[/,end:/\\]\\]>/,relevance:10},i,{className:\"meta\",begin:/<\\?xml/,end:/\\?>/,relevance:10},{className:\"tag\",begin:/<style(?=\\s|>)/,end:/>/,keywords:{name:\"style\"},contains:[C],starts:{end:/<\\/style>/,returnEnd:!0,subLanguage:[\"css\",\"xml\"]}},{className:\"tag\",begin:/<script(?=\\s|>)/,end:/>/,keywords:{name:\"script\"},contains:[C],starts:{end:/<\\/script>/,returnEnd:!0,subLanguage:[\"javascript\",\"handlebars\",\"xml\"]}},{className:\"tag\",begin:/<>|<\\/>/},{className:\"tag\",begin:concat(/</,lookahead(concat(s,either(/\\/>/,/>/,/\\s/)))),end:/\\/?>/,contains:[{className:\"name\",begin:s,relevance:0,starts:C}]},{className:\"tag\",begin:concat(/<\\//,lookahead(concat(s,/>/))),contains:[{className:\"name\",begin:s,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}},17533:o=>{o.exports=function yaml(o){var s=\"true false yes no null\",i=\"[\\\\w#;/?:@&=+$,.~*'()[\\\\]]+\",u={className:\"string\",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/\"/,end:/\"/},{begin:/\\S+/}],contains:[o.BACKSLASH_ESCAPE,{className:\"template-variable\",variants:[{begin:/\\{\\{/,end:/\\}\\}/},{begin:/%\\{/,end:/\\}/}]}]},_=o.inherit(u,{variants:[{begin:/'/,end:/'/},{begin:/\"/,end:/\"/},{begin:/[^\\s,{}[\\]]+/}]}),w={className:\"number\",begin:\"\\\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\\\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\\\.[0-9]*)?([ \\\\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\\\b\"},x={end:\",\",endsWithParent:!0,excludeEnd:!0,keywords:s,relevance:0},C={begin:/\\{/,end:/\\}/,contains:[x],illegal:\"\\\\n\",relevance:0},j={begin:\"\\\\[\",end:\"\\\\]\",contains:[x],illegal:\"\\\\n\",relevance:0},L=[{className:\"attr\",variants:[{begin:\"\\\\w[\\\\w :\\\\/.-]*:(?=[ \\t]|$)\"},{begin:'\"\\\\w[\\\\w :\\\\/.-]*\":(?=[ \\t]|$)'},{begin:\"'\\\\w[\\\\w :\\\\/.-]*':(?=[ \\t]|$)\"}]},{className:\"meta\",begin:\"^---\\\\s*$\",relevance:10},{className:\"string\",begin:\"[\\\\|>]([1-9]?[+-])?[ ]*\\\\n( +)[^ ][^\\\\n]*\\\\n(\\\\2[^\\\\n]+\\\\n?)*\"},{begin:\"<%[%=-]?\",end:\"[%-]?%>\",subLanguage:\"ruby\",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:\"type\",begin:\"!\\\\w+!\"+i},{className:\"type\",begin:\"!<\"+i+\">\"},{className:\"type\",begin:\"!\"+i},{className:\"type\",begin:\"!!\"+i},{className:\"meta\",begin:\"&\"+o.UNDERSCORE_IDENT_RE+\"$\"},{className:\"meta\",begin:\"\\\\*\"+o.UNDERSCORE_IDENT_RE+\"$\"},{className:\"bullet\",begin:\"-(?=[ ]|$)\",relevance:0},o.HASH_COMMENT_MODE,{beginKeywords:s,keywords:{literal:s}},w,{className:\"number\",begin:o.C_NUMBER_RE+\"\\\\b\",relevance:0},C,j,u],B=[...L];return B.pop(),B.push(_),x.contains=B,{name:\"YAML\",case_insensitive:!0,aliases:[\"yml\"],contains:L}}},251:(o,s)=>{s.read=function(o,s,i,u,_){var w,x,C=8*_-u-1,j=(1<<C)-1,L=j>>1,B=-7,$=i?_-1:0,V=i?-1:1,U=o[s+$];for($+=V,w=U&(1<<-B)-1,U>>=-B,B+=C;B>0;w=256*w+o[s+$],$+=V,B-=8);for(x=w&(1<<-B)-1,w>>=-B,B+=u;B>0;x=256*x+o[s+$],$+=V,B-=8);if(0===w)w=1-L;else{if(w===j)return x?NaN:1/0*(U?-1:1);x+=Math.pow(2,u),w-=L}return(U?-1:1)*x*Math.pow(2,w-u)},s.write=function(o,s,i,u,_,w){var x,C,j,L=8*w-_-1,B=(1<<L)-1,$=B>>1,V=23===_?Math.pow(2,-24)-Math.pow(2,-77):0,U=u?0:w-1,z=u?1:-1,Y=s<0||0===s&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(C=isNaN(s)?1:0,x=B):(x=Math.floor(Math.log(s)/Math.LN2),s*(j=Math.pow(2,-x))<1&&(x--,j*=2),(s+=x+$>=1?V/j:V*Math.pow(2,1-$))*j>=2&&(x++,j/=2),x+$>=B?(C=0,x=B):x+$>=1?(C=(s*j-1)*Math.pow(2,_),x+=$):(C=s*Math.pow(2,$-1)*Math.pow(2,_),x=0));_>=8;o[i+U]=255&C,U+=z,C/=256,_-=8);for(x=x<<_|C,L+=_;L>0;o[i+U]=255&x,U+=z,x/=256,L-=8);o[i+U-z]|=128*Y}},9404:function(o){o.exports=function(){\"use strict\";var o=Array.prototype.slice;function createClass(o,s){s&&(o.prototype=Object.create(s.prototype)),o.prototype.constructor=o}function Iterable(o){return isIterable(o)?o:Seq(o)}function KeyedIterable(o){return isKeyed(o)?o:KeyedSeq(o)}function IndexedIterable(o){return isIndexed(o)?o:IndexedSeq(o)}function SetIterable(o){return isIterable(o)&&!isAssociative(o)?o:SetSeq(o)}function isIterable(o){return!(!o||!o[s])}function isKeyed(o){return!(!o||!o[i])}function isIndexed(o){return!(!o||!o[u])}function isAssociative(o){return isKeyed(o)||isIndexed(o)}function isOrdered(o){return!(!o||!o[_])}createClass(KeyedIterable,Iterable),createClass(IndexedIterable,Iterable),createClass(SetIterable,Iterable),Iterable.isIterable=isIterable,Iterable.isKeyed=isKeyed,Iterable.isIndexed=isIndexed,Iterable.isAssociative=isAssociative,Iterable.isOrdered=isOrdered,Iterable.Keyed=KeyedIterable,Iterable.Indexed=IndexedIterable,Iterable.Set=SetIterable;var s=\"@@__IMMUTABLE_ITERABLE__@@\",i=\"@@__IMMUTABLE_KEYED__@@\",u=\"@@__IMMUTABLE_INDEXED__@@\",_=\"@@__IMMUTABLE_ORDERED__@@\",w=\"delete\",x=5,C=1<<x,j=C-1,L={},B={value:!1},$={value:!1};function MakeRef(o){return o.value=!1,o}function SetRef(o){o&&(o.value=!0)}function OwnerID(){}function arrCopy(o,s){s=s||0;for(var i=Math.max(0,o.length-s),u=new Array(i),_=0;_<i;_++)u[_]=o[_+s];return u}function ensureSize(o){return void 0===o.size&&(o.size=o.__iterate(returnTrue)),o.size}function wrapIndex(o,s){if(\"number\"!=typeof s){var i=s>>>0;if(\"\"+i!==s||4294967295===i)return NaN;s=i}return s<0?ensureSize(o)+s:s}function returnTrue(){return!0}function wholeSlice(o,s,i){return(0===o||void 0!==i&&o<=-i)&&(void 0===s||void 0!==i&&s>=i)}function resolveBegin(o,s){return resolveIndex(o,s,0)}function resolveEnd(o,s){return resolveIndex(o,s,s)}function resolveIndex(o,s,i){return void 0===o?i:o<0?Math.max(0,s+o):void 0===s?o:Math.min(s,o)}var V=0,U=1,z=2,Y=\"function\"==typeof Symbol&&Symbol.iterator,Z=\"@@iterator\",ee=Y||Z;function Iterator(o){this.next=o}function iteratorValue(o,s,i,u){var _=0===o?s:1===o?i:[s,i];return u?u.value=_:u={value:_,done:!1},u}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(o){return!!getIteratorFn(o)}function isIterator(o){return o&&\"function\"==typeof o.next}function getIterator(o){var s=getIteratorFn(o);return s&&s.call(o)}function getIteratorFn(o){var s=o&&(Y&&o[Y]||o[Z]);if(\"function\"==typeof s)return s}function isArrayLike(o){return o&&\"number\"==typeof o.length}function Seq(o){return null==o?emptySequence():isIterable(o)?o.toSeq():seqFromValue(o)}function KeyedSeq(o){return null==o?emptySequence().toKeyedSeq():isIterable(o)?isKeyed(o)?o.toSeq():o.fromEntrySeq():keyedSeqFromValue(o)}function IndexedSeq(o){return null==o?emptySequence():isIterable(o)?isKeyed(o)?o.entrySeq():o.toIndexedSeq():indexedSeqFromValue(o)}function SetSeq(o){return(null==o?emptySequence():isIterable(o)?isKeyed(o)?o.entrySeq():o:indexedSeqFromValue(o)).toSetSeq()}Iterator.prototype.toString=function(){return\"[Iterator]\"},Iterator.KEYS=V,Iterator.VALUES=U,Iterator.ENTRIES=z,Iterator.prototype.inspect=Iterator.prototype.toSource=function(){return this.toString()},Iterator.prototype[ee]=function(){return this},createClass(Seq,Iterable),Seq.of=function(){return Seq(arguments)},Seq.prototype.toSeq=function(){return this},Seq.prototype.toString=function(){return this.__toString(\"Seq {\",\"}\")},Seq.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Seq.prototype.__iterate=function(o,s){return seqIterate(this,o,s,!0)},Seq.prototype.__iterator=function(o,s){return seqIterator(this,o,s,!0)},createClass(KeyedSeq,Seq),KeyedSeq.prototype.toKeyedSeq=function(){return this},createClass(IndexedSeq,Seq),IndexedSeq.of=function(){return IndexedSeq(arguments)},IndexedSeq.prototype.toIndexedSeq=function(){return this},IndexedSeq.prototype.toString=function(){return this.__toString(\"Seq [\",\"]\")},IndexedSeq.prototype.__iterate=function(o,s){return seqIterate(this,o,s,!1)},IndexedSeq.prototype.__iterator=function(o,s){return seqIterator(this,o,s,!1)},createClass(SetSeq,Seq),SetSeq.of=function(){return SetSeq(arguments)},SetSeq.prototype.toSetSeq=function(){return this},Seq.isSeq=isSeq,Seq.Keyed=KeyedSeq,Seq.Set=SetSeq,Seq.Indexed=IndexedSeq;var ie,ae,ce,le=\"@@__IMMUTABLE_SEQ__@@\";function ArraySeq(o){this._array=o,this.size=o.length}function ObjectSeq(o){var s=Object.keys(o);this._object=o,this._keys=s,this.size=s.length}function IterableSeq(o){this._iterable=o,this.size=o.length||o.size}function IteratorSeq(o){this._iterator=o,this._iteratorCache=[]}function isSeq(o){return!(!o||!o[le])}function emptySequence(){return ie||(ie=new ArraySeq([]))}function keyedSeqFromValue(o){var s=Array.isArray(o)?new ArraySeq(o).fromEntrySeq():isIterator(o)?new IteratorSeq(o).fromEntrySeq():hasIterator(o)?new IterableSeq(o).fromEntrySeq():\"object\"==typeof o?new ObjectSeq(o):void 0;if(!s)throw new TypeError(\"Expected Array or iterable object of [k, v] entries, or keyed object: \"+o);return s}function indexedSeqFromValue(o){var s=maybeIndexedSeqFromValue(o);if(!s)throw new TypeError(\"Expected Array or iterable object of values: \"+o);return s}function seqFromValue(o){var s=maybeIndexedSeqFromValue(o)||\"object\"==typeof o&&new ObjectSeq(o);if(!s)throw new TypeError(\"Expected Array or iterable object of values, or keyed object: \"+o);return s}function maybeIndexedSeqFromValue(o){return isArrayLike(o)?new ArraySeq(o):isIterator(o)?new IteratorSeq(o):hasIterator(o)?new IterableSeq(o):void 0}function seqIterate(o,s,i,u){var _=o._cache;if(_){for(var w=_.length-1,x=0;x<=w;x++){var C=_[i?w-x:x];if(!1===s(C[1],u?C[0]:x,o))return x+1}return x}return o.__iterateUncached(s,i)}function seqIterator(o,s,i,u){var _=o._cache;if(_){var w=_.length-1,x=0;return new Iterator((function(){var o=_[i?w-x:x];return x++>w?iteratorDone():iteratorValue(s,u?o[0]:x-1,o[1])}))}return o.__iteratorUncached(s,i)}function fromJS(o,s){return s?fromJSWith(s,o,\"\",{\"\":o}):fromJSDefault(o)}function fromJSWith(o,s,i,u){return Array.isArray(s)?o.call(u,i,IndexedSeq(s).map((function(i,u){return fromJSWith(o,i,u,s)}))):isPlainObj(s)?o.call(u,i,KeyedSeq(s).map((function(i,u){return fromJSWith(o,i,u,s)}))):s}function fromJSDefault(o){return Array.isArray(o)?IndexedSeq(o).map(fromJSDefault).toList():isPlainObj(o)?KeyedSeq(o).map(fromJSDefault).toMap():o}function isPlainObj(o){return o&&(o.constructor===Object||void 0===o.constructor)}function is(o,s){if(o===s||o!=o&&s!=s)return!0;if(!o||!s)return!1;if(\"function\"==typeof o.valueOf&&\"function\"==typeof s.valueOf){if((o=o.valueOf())===(s=s.valueOf())||o!=o&&s!=s)return!0;if(!o||!s)return!1}return!(\"function\"!=typeof o.equals||\"function\"!=typeof s.equals||!o.equals(s))}function deepEqual(o,s){if(o===s)return!0;if(!isIterable(s)||void 0!==o.size&&void 0!==s.size&&o.size!==s.size||void 0!==o.__hash&&void 0!==s.__hash&&o.__hash!==s.__hash||isKeyed(o)!==isKeyed(s)||isIndexed(o)!==isIndexed(s)||isOrdered(o)!==isOrdered(s))return!1;if(0===o.size&&0===s.size)return!0;var i=!isAssociative(o);if(isOrdered(o)){var u=o.entries();return s.every((function(o,s){var _=u.next().value;return _&&is(_[1],o)&&(i||is(_[0],s))}))&&u.next().done}var _=!1;if(void 0===o.size)if(void 0===s.size)\"function\"==typeof o.cacheResult&&o.cacheResult();else{_=!0;var w=o;o=s,s=w}var x=!0,C=s.__iterate((function(s,u){if(i?!o.has(s):_?!is(s,o.get(u,L)):!is(o.get(u,L),s))return x=!1,!1}));return x&&o.size===C}function Repeat(o,s){if(!(this instanceof Repeat))return new Repeat(o,s);if(this._value=o,this.size=void 0===s?1/0:Math.max(0,s),0===this.size){if(ae)return ae;ae=this}}function invariant(o,s){if(!o)throw new Error(s)}function Range(o,s,i){if(!(this instanceof Range))return new Range(o,s,i);if(invariant(0!==i,\"Cannot step a Range by 0\"),o=o||0,void 0===s&&(s=1/0),i=void 0===i?1:Math.abs(i),s<o&&(i=-i),this._start=o,this._end=s,this._step=i,this.size=Math.max(0,Math.ceil((s-o)/i-1)+1),0===this.size){if(ce)return ce;ce=this}}function Collection(){throw TypeError(\"Abstract\")}function KeyedCollection(){}function IndexedCollection(){}function SetCollection(){}Seq.prototype[le]=!0,createClass(ArraySeq,IndexedSeq),ArraySeq.prototype.get=function(o,s){return this.has(o)?this._array[wrapIndex(this,o)]:s},ArraySeq.prototype.__iterate=function(o,s){for(var i=this._array,u=i.length-1,_=0;_<=u;_++)if(!1===o(i[s?u-_:_],_,this))return _+1;return _},ArraySeq.prototype.__iterator=function(o,s){var i=this._array,u=i.length-1,_=0;return new Iterator((function(){return _>u?iteratorDone():iteratorValue(o,_,i[s?u-_++:_++])}))},createClass(ObjectSeq,KeyedSeq),ObjectSeq.prototype.get=function(o,s){return void 0===s||this.has(o)?this._object[o]:s},ObjectSeq.prototype.has=function(o){return this._object.hasOwnProperty(o)},ObjectSeq.prototype.__iterate=function(o,s){for(var i=this._object,u=this._keys,_=u.length-1,w=0;w<=_;w++){var x=u[s?_-w:w];if(!1===o(i[x],x,this))return w+1}return w},ObjectSeq.prototype.__iterator=function(o,s){var i=this._object,u=this._keys,_=u.length-1,w=0;return new Iterator((function(){var x=u[s?_-w:w];return w++>_?iteratorDone():iteratorValue(o,x,i[x])}))},ObjectSeq.prototype[_]=!0,createClass(IterableSeq,IndexedSeq),IterableSeq.prototype.__iterateUncached=function(o,s){if(s)return this.cacheResult().__iterate(o,s);var i=getIterator(this._iterable),u=0;if(isIterator(i))for(var _;!(_=i.next()).done&&!1!==o(_.value,u++,this););return u},IterableSeq.prototype.__iteratorUncached=function(o,s){if(s)return this.cacheResult().__iterator(o,s);var i=getIterator(this._iterable);if(!isIterator(i))return new Iterator(iteratorDone);var u=0;return new Iterator((function(){var s=i.next();return s.done?s:iteratorValue(o,u++,s.value)}))},createClass(IteratorSeq,IndexedSeq),IteratorSeq.prototype.__iterateUncached=function(o,s){if(s)return this.cacheResult().__iterate(o,s);for(var i,u=this._iterator,_=this._iteratorCache,w=0;w<_.length;)if(!1===o(_[w],w++,this))return w;for(;!(i=u.next()).done;){var x=i.value;if(_[w]=x,!1===o(x,w++,this))break}return w},IteratorSeq.prototype.__iteratorUncached=function(o,s){if(s)return this.cacheResult().__iterator(o,s);var i=this._iterator,u=this._iteratorCache,_=0;return new Iterator((function(){if(_>=u.length){var s=i.next();if(s.done)return s;u[_]=s.value}return iteratorValue(o,_,u[_++])}))},createClass(Repeat,IndexedSeq),Repeat.prototype.toString=function(){return 0===this.size?\"Repeat []\":\"Repeat [ \"+this._value+\" \"+this.size+\" times ]\"},Repeat.prototype.get=function(o,s){return this.has(o)?this._value:s},Repeat.prototype.includes=function(o){return is(this._value,o)},Repeat.prototype.slice=function(o,s){var i=this.size;return wholeSlice(o,s,i)?this:new Repeat(this._value,resolveEnd(s,i)-resolveBegin(o,i))},Repeat.prototype.reverse=function(){return this},Repeat.prototype.indexOf=function(o){return is(this._value,o)?0:-1},Repeat.prototype.lastIndexOf=function(o){return is(this._value,o)?this.size:-1},Repeat.prototype.__iterate=function(o,s){for(var i=0;i<this.size;i++)if(!1===o(this._value,i,this))return i+1;return i},Repeat.prototype.__iterator=function(o,s){var i=this,u=0;return new Iterator((function(){return u<i.size?iteratorValue(o,u++,i._value):iteratorDone()}))},Repeat.prototype.equals=function(o){return o instanceof Repeat?is(this._value,o._value):deepEqual(o)},createClass(Range,IndexedSeq),Range.prototype.toString=function(){return 0===this.size?\"Range []\":\"Range [ \"+this._start+\"...\"+this._end+(1!==this._step?\" by \"+this._step:\"\")+\" ]\"},Range.prototype.get=function(o,s){return this.has(o)?this._start+wrapIndex(this,o)*this._step:s},Range.prototype.includes=function(o){var s=(o-this._start)/this._step;return s>=0&&s<this.size&&s===Math.floor(s)},Range.prototype.slice=function(o,s){return wholeSlice(o,s,this.size)?this:(o=resolveBegin(o,this.size),(s=resolveEnd(s,this.size))<=o?new Range(0,0):new Range(this.get(o,this._end),this.get(s,this._end),this._step))},Range.prototype.indexOf=function(o){var s=o-this._start;if(s%this._step==0){var i=s/this._step;if(i>=0&&i<this.size)return i}return-1},Range.prototype.lastIndexOf=function(o){return this.indexOf(o)},Range.prototype.__iterate=function(o,s){for(var i=this.size-1,u=this._step,_=s?this._start+i*u:this._start,w=0;w<=i;w++){if(!1===o(_,w,this))return w+1;_+=s?-u:u}return w},Range.prototype.__iterator=function(o,s){var i=this.size-1,u=this._step,_=s?this._start+i*u:this._start,w=0;return new Iterator((function(){var x=_;return _+=s?-u:u,w>i?iteratorDone():iteratorValue(o,w++,x)}))},Range.prototype.equals=function(o){return o instanceof Range?this._start===o._start&&this._end===o._end&&this._step===o._step:deepEqual(this,o)},createClass(Collection,Iterable),createClass(KeyedCollection,Collection),createClass(IndexedCollection,Collection),createClass(SetCollection,Collection),Collection.Keyed=KeyedCollection,Collection.Indexed=IndexedCollection,Collection.Set=SetCollection;var pe=\"function\"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function imul(o,s){var i=65535&(o|=0),u=65535&(s|=0);return i*u+((o>>>16)*u+i*(s>>>16)<<16>>>0)|0};function smi(o){return o>>>1&1073741824|3221225471&o}function hash(o){if(!1===o||null==o)return 0;if(\"function\"==typeof o.valueOf&&(!1===(o=o.valueOf())||null==o))return 0;if(!0===o)return 1;var s=typeof o;if(\"number\"===s){if(o!=o||o===1/0)return 0;var i=0|o;for(i!==o&&(i^=4294967295*o);o>4294967295;)i^=o/=4294967295;return smi(i)}if(\"string\"===s)return o.length>Se?cachedHashString(o):hashString(o);if(\"function\"==typeof o.hashCode)return o.hashCode();if(\"object\"===s)return hashJSObj(o);if(\"function\"==typeof o.toString)return hashString(o.toString());throw new Error(\"Value type \"+s+\" cannot be hashed.\")}function cachedHashString(o){var s=Te[o];return void 0===s&&(s=hashString(o),Pe===xe&&(Pe=0,Te={}),Pe++,Te[o]=s),s}function hashString(o){for(var s=0,i=0;i<o.length;i++)s=31*s+o.charCodeAt(i)|0;return smi(s)}function hashJSObj(o){var s;if(be&&void 0!==(s=ye.get(o)))return s;if(void 0!==(s=o[we]))return s;if(!fe){if(void 0!==(s=o.propertyIsEnumerable&&o.propertyIsEnumerable[we]))return s;if(void 0!==(s=getIENodeHash(o)))return s}if(s=++_e,1073741824&_e&&(_e=0),be)ye.set(o,s);else{if(void 0!==de&&!1===de(o))throw new Error(\"Non-extensible objects are not allowed as keys.\");if(fe)Object.defineProperty(o,we,{enumerable:!1,configurable:!1,writable:!1,value:s});else if(void 0!==o.propertyIsEnumerable&&o.propertyIsEnumerable===o.constructor.prototype.propertyIsEnumerable)o.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},o.propertyIsEnumerable[we]=s;else{if(void 0===o.nodeType)throw new Error(\"Unable to set a non-enumerable property on object.\");o[we]=s}}return s}var de=Object.isExtensible,fe=function(){try{return Object.defineProperty({},\"@\",{}),!0}catch(o){return!1}}();function getIENodeHash(o){if(o&&o.nodeType>0)switch(o.nodeType){case 1:return o.uniqueID;case 9:return o.documentElement&&o.documentElement.uniqueID}}var ye,be=\"function\"==typeof WeakMap;be&&(ye=new WeakMap);var _e=0,we=\"__immutablehash__\";\"function\"==typeof Symbol&&(we=Symbol(we));var Se=16,xe=255,Pe=0,Te={};function assertNotInfinite(o){invariant(o!==1/0,\"Cannot perform this action with an infinite size.\")}function Map(o){return null==o?emptyMap():isMap(o)&&!isOrdered(o)?o:emptyMap().withMutations((function(s){var i=KeyedIterable(o);assertNotInfinite(i.size),i.forEach((function(o,i){return s.set(i,o)}))}))}function isMap(o){return!(!o||!o[qe])}createClass(Map,KeyedCollection),Map.of=function(){var s=o.call(arguments,0);return emptyMap().withMutations((function(o){for(var i=0;i<s.length;i+=2){if(i+1>=s.length)throw new Error(\"Missing value for key: \"+s[i]);o.set(s[i],s[i+1])}}))},Map.prototype.toString=function(){return this.__toString(\"Map {\",\"}\")},Map.prototype.get=function(o,s){return this._root?this._root.get(0,void 0,o,s):s},Map.prototype.set=function(o,s){return updateMap(this,o,s)},Map.prototype.setIn=function(o,s){return this.updateIn(o,L,(function(){return s}))},Map.prototype.remove=function(o){return updateMap(this,o,L)},Map.prototype.deleteIn=function(o){return this.updateIn(o,(function(){return L}))},Map.prototype.update=function(o,s,i){return 1===arguments.length?o(this):this.updateIn([o],s,i)},Map.prototype.updateIn=function(o,s,i){i||(i=s,s=void 0);var u=updateInDeepMap(this,forceIterator(o),s,i);return u===L?void 0:u},Map.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},Map.prototype.merge=function(){return mergeIntoMapWith(this,void 0,arguments)},Map.prototype.mergeWith=function(s){return mergeIntoMapWith(this,s,o.call(arguments,1))},Map.prototype.mergeIn=function(s){var i=o.call(arguments,1);return this.updateIn(s,emptyMap(),(function(o){return\"function\"==typeof o.merge?o.merge.apply(o,i):i[i.length-1]}))},Map.prototype.mergeDeep=function(){return mergeIntoMapWith(this,deepMerger,arguments)},Map.prototype.mergeDeepWith=function(s){var i=o.call(arguments,1);return mergeIntoMapWith(this,deepMergerWith(s),i)},Map.prototype.mergeDeepIn=function(s){var i=o.call(arguments,1);return this.updateIn(s,emptyMap(),(function(o){return\"function\"==typeof o.mergeDeep?o.mergeDeep.apply(o,i):i[i.length-1]}))},Map.prototype.sort=function(o){return OrderedMap(sortFactory(this,o))},Map.prototype.sortBy=function(o,s){return OrderedMap(sortFactory(this,s,o))},Map.prototype.withMutations=function(o){var s=this.asMutable();return o(s),s.wasAltered()?s.__ensureOwner(this.__ownerID):this},Map.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)},Map.prototype.asImmutable=function(){return this.__ensureOwner()},Map.prototype.wasAltered=function(){return this.__altered},Map.prototype.__iterator=function(o,s){return new MapIterator(this,o,s)},Map.prototype.__iterate=function(o,s){var i=this,u=0;return this._root&&this._root.iterate((function(s){return u++,o(s[1],s[0],i)}),s),u},Map.prototype.__ensureOwner=function(o){return o===this.__ownerID?this:o?makeMap(this.size,this._root,o,this.__hash):(this.__ownerID=o,this.__altered=!1,this)},Map.isMap=isMap;var Re,qe=\"@@__IMMUTABLE_MAP__@@\",$e=Map.prototype;function ArrayMapNode(o,s){this.ownerID=o,this.entries=s}function BitmapIndexedNode(o,s,i){this.ownerID=o,this.bitmap=s,this.nodes=i}function HashArrayMapNode(o,s,i){this.ownerID=o,this.count=s,this.nodes=i}function HashCollisionNode(o,s,i){this.ownerID=o,this.keyHash=s,this.entries=i}function ValueNode(o,s,i){this.ownerID=o,this.keyHash=s,this.entry=i}function MapIterator(o,s,i){this._type=s,this._reverse=i,this._stack=o._root&&mapIteratorFrame(o._root)}function mapIteratorValue(o,s){return iteratorValue(o,s[0],s[1])}function mapIteratorFrame(o,s){return{node:o,index:0,__prev:s}}function makeMap(o,s,i,u){var _=Object.create($e);return _.size=o,_._root=s,_.__ownerID=i,_.__hash=u,_.__altered=!1,_}function emptyMap(){return Re||(Re=makeMap(0))}function updateMap(o,s,i){var u,_;if(o._root){var w=MakeRef(B),x=MakeRef($);if(u=updateNode(o._root,o.__ownerID,0,void 0,s,i,w,x),!x.value)return o;_=o.size+(w.value?i===L?-1:1:0)}else{if(i===L)return o;_=1,u=new ArrayMapNode(o.__ownerID,[[s,i]])}return o.__ownerID?(o.size=_,o._root=u,o.__hash=void 0,o.__altered=!0,o):u?makeMap(_,u):emptyMap()}function updateNode(o,s,i,u,_,w,x,C){return o?o.update(s,i,u,_,w,x,C):w===L?o:(SetRef(C),SetRef(x),new ValueNode(s,u,[_,w]))}function isLeafNode(o){return o.constructor===ValueNode||o.constructor===HashCollisionNode}function mergeIntoNode(o,s,i,u,_){if(o.keyHash===u)return new HashCollisionNode(s,u,[o.entry,_]);var w,C=(0===i?o.keyHash:o.keyHash>>>i)&j,L=(0===i?u:u>>>i)&j;return new BitmapIndexedNode(s,1<<C|1<<L,C===L?[mergeIntoNode(o,s,i+x,u,_)]:(w=new ValueNode(s,u,_),C<L?[o,w]:[w,o]))}function createNodes(o,s,i,u){o||(o=new OwnerID);for(var _=new ValueNode(o,hash(i),[i,u]),w=0;w<s.length;w++){var x=s[w];_=_.update(o,0,void 0,x[0],x[1])}return _}function packNodes(o,s,i,u){for(var _=0,w=0,x=new Array(i),C=0,j=1,L=s.length;C<L;C++,j<<=1){var B=s[C];void 0!==B&&C!==u&&(_|=j,x[w++]=B)}return new BitmapIndexedNode(o,_,x)}function expandNodes(o,s,i,u,_){for(var w=0,x=new Array(C),j=0;0!==i;j++,i>>>=1)x[j]=1&i?s[w++]:void 0;return x[u]=_,new HashArrayMapNode(o,w+1,x)}function mergeIntoMapWith(o,s,i){for(var u=[],_=0;_<i.length;_++){var w=i[_],x=KeyedIterable(w);isIterable(w)||(x=x.map((function(o){return fromJS(o)}))),u.push(x)}return mergeIntoCollectionWith(o,s,u)}function deepMerger(o,s,i){return o&&o.mergeDeep&&isIterable(s)?o.mergeDeep(s):is(o,s)?o:s}function deepMergerWith(o){return function(s,i,u){if(s&&s.mergeDeepWith&&isIterable(i))return s.mergeDeepWith(o,i);var _=o(s,i,u);return is(s,_)?s:_}}function mergeIntoCollectionWith(o,s,i){return 0===(i=i.filter((function(o){return 0!==o.size}))).length?o:0!==o.size||o.__ownerID||1!==i.length?o.withMutations((function(o){for(var u=s?function(i,u){o.update(u,L,(function(o){return o===L?i:s(o,i,u)}))}:function(s,i){o.set(i,s)},_=0;_<i.length;_++)i[_].forEach(u)})):o.constructor(i[0])}function updateInDeepMap(o,s,i,u){var _=o===L,w=s.next();if(w.done){var x=_?i:o,C=u(x);return C===x?o:C}invariant(_||o&&o.set,\"invalid keyPath\");var j=w.value,B=_?L:o.get(j,L),$=updateInDeepMap(B,s,i,u);return $===B?o:$===L?o.remove(j):(_?emptyMap():o).set(j,$)}function popCount(o){return o=(o=(858993459&(o-=o>>1&1431655765))+(o>>2&858993459))+(o>>4)&252645135,o+=o>>8,127&(o+=o>>16)}function setIn(o,s,i,u){var _=u?o:arrCopy(o);return _[s]=i,_}function spliceIn(o,s,i,u){var _=o.length+1;if(u&&s+1===_)return o[s]=i,o;for(var w=new Array(_),x=0,C=0;C<_;C++)C===s?(w[C]=i,x=-1):w[C]=o[C+x];return w}function spliceOut(o,s,i){var u=o.length-1;if(i&&s===u)return o.pop(),o;for(var _=new Array(u),w=0,x=0;x<u;x++)x===s&&(w=1),_[x]=o[x+w];return _}$e[qe]=!0,$e[w]=$e.remove,$e.removeIn=$e.deleteIn,ArrayMapNode.prototype.get=function(o,s,i,u){for(var _=this.entries,w=0,x=_.length;w<x;w++)if(is(i,_[w][0]))return _[w][1];return u},ArrayMapNode.prototype.update=function(o,s,i,u,_,w,x){for(var C=_===L,j=this.entries,B=0,$=j.length;B<$&&!is(u,j[B][0]);B++);var V=B<$;if(V?j[B][1]===_:C)return this;if(SetRef(x),(C||!V)&&SetRef(w),!C||1!==j.length){if(!V&&!C&&j.length>=ze)return createNodes(o,j,u,_);var U=o&&o===this.ownerID,z=U?j:arrCopy(j);return V?C?B===$-1?z.pop():z[B]=z.pop():z[B]=[u,_]:z.push([u,_]),U?(this.entries=z,this):new ArrayMapNode(o,z)}},BitmapIndexedNode.prototype.get=function(o,s,i,u){void 0===s&&(s=hash(i));var _=1<<((0===o?s:s>>>o)&j),w=this.bitmap;return w&_?this.nodes[popCount(w&_-1)].get(o+x,s,i,u):u},BitmapIndexedNode.prototype.update=function(o,s,i,u,_,w,C){void 0===i&&(i=hash(u));var B=(0===s?i:i>>>s)&j,$=1<<B,V=this.bitmap,U=!!(V&$);if(!U&&_===L)return this;var z=popCount(V&$-1),Y=this.nodes,Z=U?Y[z]:void 0,ee=updateNode(Z,o,s+x,i,u,_,w,C);if(ee===Z)return this;if(!U&&ee&&Y.length>=We)return expandNodes(o,Y,V,B,ee);if(U&&!ee&&2===Y.length&&isLeafNode(Y[1^z]))return Y[1^z];if(U&&ee&&1===Y.length&&isLeafNode(ee))return ee;var ie=o&&o===this.ownerID,ae=U?ee?V:V^$:V|$,ce=U?ee?setIn(Y,z,ee,ie):spliceOut(Y,z,ie):spliceIn(Y,z,ee,ie);return ie?(this.bitmap=ae,this.nodes=ce,this):new BitmapIndexedNode(o,ae,ce)},HashArrayMapNode.prototype.get=function(o,s,i,u){void 0===s&&(s=hash(i));var _=(0===o?s:s>>>o)&j,w=this.nodes[_];return w?w.get(o+x,s,i,u):u},HashArrayMapNode.prototype.update=function(o,s,i,u,_,w,C){void 0===i&&(i=hash(u));var B=(0===s?i:i>>>s)&j,$=_===L,V=this.nodes,U=V[B];if($&&!U)return this;var z=updateNode(U,o,s+x,i,u,_,w,C);if(z===U)return this;var Y=this.count;if(U){if(!z&&--Y<He)return packNodes(o,V,Y,B)}else Y++;var Z=o&&o===this.ownerID,ee=setIn(V,B,z,Z);return Z?(this.count=Y,this.nodes=ee,this):new HashArrayMapNode(o,Y,ee)},HashCollisionNode.prototype.get=function(o,s,i,u){for(var _=this.entries,w=0,x=_.length;w<x;w++)if(is(i,_[w][0]))return _[w][1];return u},HashCollisionNode.prototype.update=function(o,s,i,u,_,w,x){void 0===i&&(i=hash(u));var C=_===L;if(i!==this.keyHash)return C?this:(SetRef(x),SetRef(w),mergeIntoNode(this,o,s,i,[u,_]));for(var j=this.entries,B=0,$=j.length;B<$&&!is(u,j[B][0]);B++);var V=B<$;if(V?j[B][1]===_:C)return this;if(SetRef(x),(C||!V)&&SetRef(w),C&&2===$)return new ValueNode(o,this.keyHash,j[1^B]);var U=o&&o===this.ownerID,z=U?j:arrCopy(j);return V?C?B===$-1?z.pop():z[B]=z.pop():z[B]=[u,_]:z.push([u,_]),U?(this.entries=z,this):new HashCollisionNode(o,this.keyHash,z)},ValueNode.prototype.get=function(o,s,i,u){return is(i,this.entry[0])?this.entry[1]:u},ValueNode.prototype.update=function(o,s,i,u,_,w,x){var C=_===L,j=is(u,this.entry[0]);return(j?_===this.entry[1]:C)?this:(SetRef(x),C?void SetRef(w):j?o&&o===this.ownerID?(this.entry[1]=_,this):new ValueNode(o,this.keyHash,[u,_]):(SetRef(w),mergeIntoNode(this,o,s,hash(u),[u,_])))},ArrayMapNode.prototype.iterate=HashCollisionNode.prototype.iterate=function(o,s){for(var i=this.entries,u=0,_=i.length-1;u<=_;u++)if(!1===o(i[s?_-u:u]))return!1},BitmapIndexedNode.prototype.iterate=HashArrayMapNode.prototype.iterate=function(o,s){for(var i=this.nodes,u=0,_=i.length-1;u<=_;u++){var w=i[s?_-u:u];if(w&&!1===w.iterate(o,s))return!1}},ValueNode.prototype.iterate=function(o,s){return o(this.entry)},createClass(MapIterator,Iterator),MapIterator.prototype.next=function(){for(var o=this._type,s=this._stack;s;){var i,u=s.node,_=s.index++;if(u.entry){if(0===_)return mapIteratorValue(o,u.entry)}else if(u.entries){if(_<=(i=u.entries.length-1))return mapIteratorValue(o,u.entries[this._reverse?i-_:_])}else if(_<=(i=u.nodes.length-1)){var w=u.nodes[this._reverse?i-_:_];if(w){if(w.entry)return mapIteratorValue(o,w.entry);s=this._stack=mapIteratorFrame(w,s)}continue}s=this._stack=this._stack.__prev}return iteratorDone()};var ze=C/4,We=C/2,He=C/4;function List(o){var s=emptyList();if(null==o)return s;if(isList(o))return o;var i=IndexedIterable(o),u=i.size;return 0===u?s:(assertNotInfinite(u),u>0&&u<C?makeList(0,u,x,null,new VNode(i.toArray())):s.withMutations((function(o){o.setSize(u),i.forEach((function(s,i){return o.set(i,s)}))})))}function isList(o){return!(!o||!o[Ye])}createClass(List,IndexedCollection),List.of=function(){return this(arguments)},List.prototype.toString=function(){return this.__toString(\"List [\",\"]\")},List.prototype.get=function(o,s){if((o=wrapIndex(this,o))>=0&&o<this.size){var i=listNodeFor(this,o+=this._origin);return i&&i.array[o&j]}return s},List.prototype.set=function(o,s){return updateList(this,o,s)},List.prototype.remove=function(o){return this.has(o)?0===o?this.shift():o===this.size-1?this.pop():this.splice(o,1):this},List.prototype.insert=function(o,s){return this.splice(o,0,s)},List.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=x,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):emptyList()},List.prototype.push=function(){var o=arguments,s=this.size;return this.withMutations((function(i){setListBounds(i,0,s+o.length);for(var u=0;u<o.length;u++)i.set(s+u,o[u])}))},List.prototype.pop=function(){return setListBounds(this,0,-1)},List.prototype.unshift=function(){var o=arguments;return this.withMutations((function(s){setListBounds(s,-o.length);for(var i=0;i<o.length;i++)s.set(i,o[i])}))},List.prototype.shift=function(){return setListBounds(this,1)},List.prototype.merge=function(){return mergeIntoListWith(this,void 0,arguments)},List.prototype.mergeWith=function(s){return mergeIntoListWith(this,s,o.call(arguments,1))},List.prototype.mergeDeep=function(){return mergeIntoListWith(this,deepMerger,arguments)},List.prototype.mergeDeepWith=function(s){var i=o.call(arguments,1);return mergeIntoListWith(this,deepMergerWith(s),i)},List.prototype.setSize=function(o){return setListBounds(this,0,o)},List.prototype.slice=function(o,s){var i=this.size;return wholeSlice(o,s,i)?this:setListBounds(this,resolveBegin(o,i),resolveEnd(s,i))},List.prototype.__iterator=function(o,s){var i=0,u=iterateList(this,s);return new Iterator((function(){var s=u();return s===tt?iteratorDone():iteratorValue(o,i++,s)}))},List.prototype.__iterate=function(o,s){for(var i,u=0,_=iterateList(this,s);(i=_())!==tt&&!1!==o(i,u++,this););return u},List.prototype.__ensureOwner=function(o){return o===this.__ownerID?this:o?makeList(this._origin,this._capacity,this._level,this._root,this._tail,o,this.__hash):(this.__ownerID=o,this)},List.isList=isList;var Ye=\"@@__IMMUTABLE_LIST__@@\",Xe=List.prototype;function VNode(o,s){this.array=o,this.ownerID=s}Xe[Ye]=!0,Xe[w]=Xe.remove,Xe.setIn=$e.setIn,Xe.deleteIn=Xe.removeIn=$e.removeIn,Xe.update=$e.update,Xe.updateIn=$e.updateIn,Xe.mergeIn=$e.mergeIn,Xe.mergeDeepIn=$e.mergeDeepIn,Xe.withMutations=$e.withMutations,Xe.asMutable=$e.asMutable,Xe.asImmutable=$e.asImmutable,Xe.wasAltered=$e.wasAltered,VNode.prototype.removeBefore=function(o,s,i){if(i===s?1<<s:0===this.array.length)return this;var u=i>>>s&j;if(u>=this.array.length)return new VNode([],o);var _,w=0===u;if(s>0){var C=this.array[u];if((_=C&&C.removeBefore(o,s-x,i))===C&&w)return this}if(w&&!_)return this;var L=editableVNode(this,o);if(!w)for(var B=0;B<u;B++)L.array[B]=void 0;return _&&(L.array[u]=_),L},VNode.prototype.removeAfter=function(o,s,i){if(i===(s?1<<s:0)||0===this.array.length)return this;var u,_=i-1>>>s&j;if(_>=this.array.length)return this;if(s>0){var w=this.array[_];if((u=w&&w.removeAfter(o,s-x,i))===w&&_===this.array.length-1)return this}var C=editableVNode(this,o);return C.array.splice(_+1),u&&(C.array[_]=u),C};var Qe,et,tt={};function iterateList(o,s){var i=o._origin,u=o._capacity,_=getTailOffset(u),w=o._tail;return iterateNodeOrLeaf(o._root,o._level,0);function iterateNodeOrLeaf(o,s,i){return 0===s?iterateLeaf(o,i):iterateNode(o,s,i)}function iterateLeaf(o,x){var j=x===_?w&&w.array:o&&o.array,L=x>i?0:i-x,B=u-x;return B>C&&(B=C),function(){if(L===B)return tt;var o=s?--B:L++;return j&&j[o]}}function iterateNode(o,_,w){var j,L=o&&o.array,B=w>i?0:i-w>>_,$=1+(u-w>>_);return $>C&&($=C),function(){for(;;){if(j){var o=j();if(o!==tt)return o;j=null}if(B===$)return tt;var i=s?--$:B++;j=iterateNodeOrLeaf(L&&L[i],_-x,w+(i<<_))}}}}function makeList(o,s,i,u,_,w,x){var C=Object.create(Xe);return C.size=s-o,C._origin=o,C._capacity=s,C._level=i,C._root=u,C._tail=_,C.__ownerID=w,C.__hash=x,C.__altered=!1,C}function emptyList(){return Qe||(Qe=makeList(0,0,x))}function updateList(o,s,i){if((s=wrapIndex(o,s))!=s)return o;if(s>=o.size||s<0)return o.withMutations((function(o){s<0?setListBounds(o,s).set(0,i):setListBounds(o,0,s+1).set(s,i)}));s+=o._origin;var u=o._tail,_=o._root,w=MakeRef($);return s>=getTailOffset(o._capacity)?u=updateVNode(u,o.__ownerID,0,s,i,w):_=updateVNode(_,o.__ownerID,o._level,s,i,w),w.value?o.__ownerID?(o._root=_,o._tail=u,o.__hash=void 0,o.__altered=!0,o):makeList(o._origin,o._capacity,o._level,_,u):o}function updateVNode(o,s,i,u,_,w){var C,L=u>>>i&j,B=o&&L<o.array.length;if(!B&&void 0===_)return o;if(i>0){var $=o&&o.array[L],V=updateVNode($,s,i-x,u,_,w);return V===$?o:((C=editableVNode(o,s)).array[L]=V,C)}return B&&o.array[L]===_?o:(SetRef(w),C=editableVNode(o,s),void 0===_&&L===C.array.length-1?C.array.pop():C.array[L]=_,C)}function editableVNode(o,s){return s&&o&&s===o.ownerID?o:new VNode(o?o.array.slice():[],s)}function listNodeFor(o,s){if(s>=getTailOffset(o._capacity))return o._tail;if(s<1<<o._level+x){for(var i=o._root,u=o._level;i&&u>0;)i=i.array[s>>>u&j],u-=x;return i}}function setListBounds(o,s,i){void 0!==s&&(s|=0),void 0!==i&&(i|=0);var u=o.__ownerID||new OwnerID,_=o._origin,w=o._capacity,C=_+s,L=void 0===i?w:i<0?w+i:_+i;if(C===_&&L===w)return o;if(C>=L)return o.clear();for(var B=o._level,$=o._root,V=0;C+V<0;)$=new VNode($&&$.array.length?[void 0,$]:[],u),V+=1<<(B+=x);V&&(C+=V,_+=V,L+=V,w+=V);for(var U=getTailOffset(w),z=getTailOffset(L);z>=1<<B+x;)$=new VNode($&&$.array.length?[$]:[],u),B+=x;var Y=o._tail,Z=z<U?listNodeFor(o,L-1):z>U?new VNode([],u):Y;if(Y&&z>U&&C<w&&Y.array.length){for(var ee=$=editableVNode($,u),ie=B;ie>x;ie-=x){var ae=U>>>ie&j;ee=ee.array[ae]=editableVNode(ee.array[ae],u)}ee.array[U>>>x&j]=Y}if(L<w&&(Z=Z&&Z.removeAfter(u,0,L)),C>=z)C-=z,L-=z,B=x,$=null,Z=Z&&Z.removeBefore(u,0,C);else if(C>_||z<U){for(V=0;$;){var ce=C>>>B&j;if(ce!==z>>>B&j)break;ce&&(V+=(1<<B)*ce),B-=x,$=$.array[ce]}$&&C>_&&($=$.removeBefore(u,B,C-V)),$&&z<U&&($=$.removeAfter(u,B,z-V)),V&&(C-=V,L-=V)}return o.__ownerID?(o.size=L-C,o._origin=C,o._capacity=L,o._level=B,o._root=$,o._tail=Z,o.__hash=void 0,o.__altered=!0,o):makeList(C,L,B,$,Z)}function mergeIntoListWith(o,s,i){for(var u=[],_=0,w=0;w<i.length;w++){var x=i[w],C=IndexedIterable(x);C.size>_&&(_=C.size),isIterable(x)||(C=C.map((function(o){return fromJS(o)}))),u.push(C)}return _>o.size&&(o=o.setSize(_)),mergeIntoCollectionWith(o,s,u)}function getTailOffset(o){return o<C?0:o-1>>>x<<x}function OrderedMap(o){return null==o?emptyOrderedMap():isOrderedMap(o)?o:emptyOrderedMap().withMutations((function(s){var i=KeyedIterable(o);assertNotInfinite(i.size),i.forEach((function(o,i){return s.set(i,o)}))}))}function isOrderedMap(o){return isMap(o)&&isOrdered(o)}function makeOrderedMap(o,s,i,u){var _=Object.create(OrderedMap.prototype);return _.size=o?o.size:0,_._map=o,_._list=s,_.__ownerID=i,_.__hash=u,_}function emptyOrderedMap(){return et||(et=makeOrderedMap(emptyMap(),emptyList()))}function updateOrderedMap(o,s,i){var u,_,w=o._map,x=o._list,j=w.get(s),B=void 0!==j;if(i===L){if(!B)return o;x.size>=C&&x.size>=2*w.size?(u=(_=x.filter((function(o,s){return void 0!==o&&j!==s}))).toKeyedSeq().map((function(o){return o[0]})).flip().toMap(),o.__ownerID&&(u.__ownerID=_.__ownerID=o.__ownerID)):(u=w.remove(s),_=j===x.size-1?x.pop():x.set(j,void 0))}else if(B){if(i===x.get(j)[1])return o;u=w,_=x.set(j,[s,i])}else u=w.set(s,x.size),_=x.set(x.size,[s,i]);return o.__ownerID?(o.size=u.size,o._map=u,o._list=_,o.__hash=void 0,o):makeOrderedMap(u,_)}function ToKeyedSequence(o,s){this._iter=o,this._useKeys=s,this.size=o.size}function ToIndexedSequence(o){this._iter=o,this.size=o.size}function ToSetSequence(o){this._iter=o,this.size=o.size}function FromEntriesSequence(o){this._iter=o,this.size=o.size}function flipFactory(o){var s=makeSequence(o);return s._iter=o,s.size=o.size,s.flip=function(){return o},s.reverse=function(){var s=o.reverse.apply(this);return s.flip=function(){return o.reverse()},s},s.has=function(s){return o.includes(s)},s.includes=function(s){return o.has(s)},s.cacheResult=cacheResultThrough,s.__iterateUncached=function(s,i){var u=this;return o.__iterate((function(o,i){return!1!==s(i,o,u)}),i)},s.__iteratorUncached=function(s,i){if(s===z){var u=o.__iterator(s,i);return new Iterator((function(){var o=u.next();if(!o.done){var s=o.value[0];o.value[0]=o.value[1],o.value[1]=s}return o}))}return o.__iterator(s===U?V:U,i)},s}function mapFactory(o,s,i){var u=makeSequence(o);return u.size=o.size,u.has=function(s){return o.has(s)},u.get=function(u,_){var w=o.get(u,L);return w===L?_:s.call(i,w,u,o)},u.__iterateUncached=function(u,_){var w=this;return o.__iterate((function(o,_,x){return!1!==u(s.call(i,o,_,x),_,w)}),_)},u.__iteratorUncached=function(u,_){var w=o.__iterator(z,_);return new Iterator((function(){var _=w.next();if(_.done)return _;var x=_.value,C=x[0];return iteratorValue(u,C,s.call(i,x[1],C,o),_)}))},u}function reverseFactory(o,s){var i=makeSequence(o);return i._iter=o,i.size=o.size,i.reverse=function(){return o},o.flip&&(i.flip=function(){var s=flipFactory(o);return s.reverse=function(){return o.flip()},s}),i.get=function(i,u){return o.get(s?i:-1-i,u)},i.has=function(i){return o.has(s?i:-1-i)},i.includes=function(s){return o.includes(s)},i.cacheResult=cacheResultThrough,i.__iterate=function(s,i){var u=this;return o.__iterate((function(o,i){return s(o,i,u)}),!i)},i.__iterator=function(s,i){return o.__iterator(s,!i)},i}function filterFactory(o,s,i,u){var _=makeSequence(o);return u&&(_.has=function(u){var _=o.get(u,L);return _!==L&&!!s.call(i,_,u,o)},_.get=function(u,_){var w=o.get(u,L);return w!==L&&s.call(i,w,u,o)?w:_}),_.__iterateUncached=function(_,w){var x=this,C=0;return o.__iterate((function(o,w,j){if(s.call(i,o,w,j))return C++,_(o,u?w:C-1,x)}),w),C},_.__iteratorUncached=function(_,w){var x=o.__iterator(z,w),C=0;return new Iterator((function(){for(;;){var w=x.next();if(w.done)return w;var j=w.value,L=j[0],B=j[1];if(s.call(i,B,L,o))return iteratorValue(_,u?L:C++,B,w)}}))},_}function countByFactory(o,s,i){var u=Map().asMutable();return o.__iterate((function(_,w){u.update(s.call(i,_,w,o),0,(function(o){return o+1}))})),u.asImmutable()}function groupByFactory(o,s,i){var u=isKeyed(o),_=(isOrdered(o)?OrderedMap():Map()).asMutable();o.__iterate((function(w,x){_.update(s.call(i,w,x,o),(function(o){return(o=o||[]).push(u?[x,w]:w),o}))}));var w=iterableClass(o);return _.map((function(s){return reify(o,w(s))}))}function sliceFactory(o,s,i,u){var _=o.size;if(void 0!==s&&(s|=0),void 0!==i&&(i===1/0?i=_:i|=0),wholeSlice(s,i,_))return o;var w=resolveBegin(s,_),x=resolveEnd(i,_);if(w!=w||x!=x)return sliceFactory(o.toSeq().cacheResult(),s,i,u);var C,j=x-w;j==j&&(C=j<0?0:j);var L=makeSequence(o);return L.size=0===C?C:o.size&&C||void 0,!u&&isSeq(o)&&C>=0&&(L.get=function(s,i){return(s=wrapIndex(this,s))>=0&&s<C?o.get(s+w,i):i}),L.__iterateUncached=function(s,i){var _=this;if(0===C)return 0;if(i)return this.cacheResult().__iterate(s,i);var x=0,j=!0,L=0;return o.__iterate((function(o,i){if(!j||!(j=x++<w))return L++,!1!==s(o,u?i:L-1,_)&&L!==C})),L},L.__iteratorUncached=function(s,i){if(0!==C&&i)return this.cacheResult().__iterator(s,i);var _=0!==C&&o.__iterator(s,i),x=0,j=0;return new Iterator((function(){for(;x++<w;)_.next();if(++j>C)return iteratorDone();var o=_.next();return u||s===U?o:iteratorValue(s,j-1,s===V?void 0:o.value[1],o)}))},L}function takeWhileFactory(o,s,i){var u=makeSequence(o);return u.__iterateUncached=function(u,_){var w=this;if(_)return this.cacheResult().__iterate(u,_);var x=0;return o.__iterate((function(o,_,C){return s.call(i,o,_,C)&&++x&&u(o,_,w)})),x},u.__iteratorUncached=function(u,_){var w=this;if(_)return this.cacheResult().__iterator(u,_);var x=o.__iterator(z,_),C=!0;return new Iterator((function(){if(!C)return iteratorDone();var o=x.next();if(o.done)return o;var _=o.value,j=_[0],L=_[1];return s.call(i,L,j,w)?u===z?o:iteratorValue(u,j,L,o):(C=!1,iteratorDone())}))},u}function skipWhileFactory(o,s,i,u){var _=makeSequence(o);return _.__iterateUncached=function(_,w){var x=this;if(w)return this.cacheResult().__iterate(_,w);var C=!0,j=0;return o.__iterate((function(o,w,L){if(!C||!(C=s.call(i,o,w,L)))return j++,_(o,u?w:j-1,x)})),j},_.__iteratorUncached=function(_,w){var x=this;if(w)return this.cacheResult().__iterator(_,w);var C=o.__iterator(z,w),j=!0,L=0;return new Iterator((function(){var o,w,B;do{if((o=C.next()).done)return u||_===U?o:iteratorValue(_,L++,_===V?void 0:o.value[1],o);var $=o.value;w=$[0],B=$[1],j&&(j=s.call(i,B,w,x))}while(j);return _===z?o:iteratorValue(_,w,B,o)}))},_}function concatFactory(o,s){var i=isKeyed(o),u=[o].concat(s).map((function(o){return isIterable(o)?i&&(o=KeyedIterable(o)):o=i?keyedSeqFromValue(o):indexedSeqFromValue(Array.isArray(o)?o:[o]),o})).filter((function(o){return 0!==o.size}));if(0===u.length)return o;if(1===u.length){var _=u[0];if(_===o||i&&isKeyed(_)||isIndexed(o)&&isIndexed(_))return _}var w=new ArraySeq(u);return i?w=w.toKeyedSeq():isIndexed(o)||(w=w.toSetSeq()),(w=w.flatten(!0)).size=u.reduce((function(o,s){if(void 0!==o){var i=s.size;if(void 0!==i)return o+i}}),0),w}function flattenFactory(o,s,i){var u=makeSequence(o);return u.__iterateUncached=function(u,_){var w=0,x=!1;function flatDeep(o,C){var j=this;o.__iterate((function(o,_){return(!s||C<s)&&isIterable(o)?flatDeep(o,C+1):!1===u(o,i?_:w++,j)&&(x=!0),!x}),_)}return flatDeep(o,0),w},u.__iteratorUncached=function(u,_){var w=o.__iterator(u,_),x=[],C=0;return new Iterator((function(){for(;w;){var o=w.next();if(!1===o.done){var j=o.value;if(u===z&&(j=j[1]),s&&!(x.length<s)||!isIterable(j))return i?o:iteratorValue(u,C++,j,o);x.push(w),w=j.__iterator(u,_)}else w=x.pop()}return iteratorDone()}))},u}function flatMapFactory(o,s,i){var u=iterableClass(o);return o.toSeq().map((function(_,w){return u(s.call(i,_,w,o))})).flatten(!0)}function interposeFactory(o,s){var i=makeSequence(o);return i.size=o.size&&2*o.size-1,i.__iterateUncached=function(i,u){var _=this,w=0;return o.__iterate((function(o,u){return(!w||!1!==i(s,w++,_))&&!1!==i(o,w++,_)}),u),w},i.__iteratorUncached=function(i,u){var _,w=o.__iterator(U,u),x=0;return new Iterator((function(){return(!_||x%2)&&(_=w.next()).done?_:x%2?iteratorValue(i,x++,s):iteratorValue(i,x++,_.value,_)}))},i}function sortFactory(o,s,i){s||(s=defaultComparator);var u=isKeyed(o),_=0,w=o.toSeq().map((function(s,u){return[u,s,_++,i?i(s,u,o):s]})).toArray();return w.sort((function(o,i){return s(o[3],i[3])||o[2]-i[2]})).forEach(u?function(o,s){w[s].length=2}:function(o,s){w[s]=o[1]}),u?KeyedSeq(w):isIndexed(o)?IndexedSeq(w):SetSeq(w)}function maxFactory(o,s,i){if(s||(s=defaultComparator),i){var u=o.toSeq().map((function(s,u){return[s,i(s,u,o)]})).reduce((function(o,i){return maxCompare(s,o[1],i[1])?i:o}));return u&&u[0]}return o.reduce((function(o,i){return maxCompare(s,o,i)?i:o}))}function maxCompare(o,s,i){var u=o(i,s);return 0===u&&i!==s&&(null==i||i!=i)||u>0}function zipWithFactory(o,s,i){var u=makeSequence(o);return u.size=new ArraySeq(i).map((function(o){return o.size})).min(),u.__iterate=function(o,s){for(var i,u=this.__iterator(U,s),_=0;!(i=u.next()).done&&!1!==o(i.value,_++,this););return _},u.__iteratorUncached=function(o,u){var _=i.map((function(o){return o=Iterable(o),getIterator(u?o.reverse():o)})),w=0,x=!1;return new Iterator((function(){var i;return x||(i=_.map((function(o){return o.next()})),x=i.some((function(o){return o.done}))),x?iteratorDone():iteratorValue(o,w++,s.apply(null,i.map((function(o){return o.value}))))}))},u}function reify(o,s){return isSeq(o)?s:o.constructor(s)}function validateEntry(o){if(o!==Object(o))throw new TypeError(\"Expected [K, V] tuple: \"+o)}function resolveSize(o){return assertNotInfinite(o.size),ensureSize(o)}function iterableClass(o){return isKeyed(o)?KeyedIterable:isIndexed(o)?IndexedIterable:SetIterable}function makeSequence(o){return Object.create((isKeyed(o)?KeyedSeq:isIndexed(o)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Seq.prototype.cacheResult.call(this)}function defaultComparator(o,s){return o>s?1:o<s?-1:0}function forceIterator(o){var s=getIterator(o);if(!s){if(!isArrayLike(o))throw new TypeError(\"Expected iterable or array-like: \"+o);s=getIterator(Iterable(o))}return s}function Record(o,s){var i,u=function Record(w){if(w instanceof u)return w;if(!(this instanceof u))return new u(w);if(!i){i=!0;var x=Object.keys(o);setProps(_,x),_.size=x.length,_._name=s,_._keys=x,_._defaultValues=o}this._map=Map(w)},_=u.prototype=Object.create(rt);return _.constructor=u,u}createClass(OrderedMap,Map),OrderedMap.of=function(){return this(arguments)},OrderedMap.prototype.toString=function(){return this.__toString(\"OrderedMap {\",\"}\")},OrderedMap.prototype.get=function(o,s){var i=this._map.get(o);return void 0!==i?this._list.get(i)[1]:s},OrderedMap.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):emptyOrderedMap()},OrderedMap.prototype.set=function(o,s){return updateOrderedMap(this,o,s)},OrderedMap.prototype.remove=function(o){return updateOrderedMap(this,o,L)},OrderedMap.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},OrderedMap.prototype.__iterate=function(o,s){var i=this;return this._list.__iterate((function(s){return s&&o(s[1],s[0],i)}),s)},OrderedMap.prototype.__iterator=function(o,s){return this._list.fromEntrySeq().__iterator(o,s)},OrderedMap.prototype.__ensureOwner=function(o){if(o===this.__ownerID)return this;var s=this._map.__ensureOwner(o),i=this._list.__ensureOwner(o);return o?makeOrderedMap(s,i,o,this.__hash):(this.__ownerID=o,this._map=s,this._list=i,this)},OrderedMap.isOrderedMap=isOrderedMap,OrderedMap.prototype[_]=!0,OrderedMap.prototype[w]=OrderedMap.prototype.remove,createClass(ToKeyedSequence,KeyedSeq),ToKeyedSequence.prototype.get=function(o,s){return this._iter.get(o,s)},ToKeyedSequence.prototype.has=function(o){return this._iter.has(o)},ToKeyedSequence.prototype.valueSeq=function(){return this._iter.valueSeq()},ToKeyedSequence.prototype.reverse=function(){var o=this,s=reverseFactory(this,!0);return this._useKeys||(s.valueSeq=function(){return o._iter.toSeq().reverse()}),s},ToKeyedSequence.prototype.map=function(o,s){var i=this,u=mapFactory(this,o,s);return this._useKeys||(u.valueSeq=function(){return i._iter.toSeq().map(o,s)}),u},ToKeyedSequence.prototype.__iterate=function(o,s){var i,u=this;return this._iter.__iterate(this._useKeys?function(s,i){return o(s,i,u)}:(i=s?resolveSize(this):0,function(_){return o(_,s?--i:i++,u)}),s)},ToKeyedSequence.prototype.__iterator=function(o,s){if(this._useKeys)return this._iter.__iterator(o,s);var i=this._iter.__iterator(U,s),u=s?resolveSize(this):0;return new Iterator((function(){var _=i.next();return _.done?_:iteratorValue(o,s?--u:u++,_.value,_)}))},ToKeyedSequence.prototype[_]=!0,createClass(ToIndexedSequence,IndexedSeq),ToIndexedSequence.prototype.includes=function(o){return this._iter.includes(o)},ToIndexedSequence.prototype.__iterate=function(o,s){var i=this,u=0;return this._iter.__iterate((function(s){return o(s,u++,i)}),s)},ToIndexedSequence.prototype.__iterator=function(o,s){var i=this._iter.__iterator(U,s),u=0;return new Iterator((function(){var s=i.next();return s.done?s:iteratorValue(o,u++,s.value,s)}))},createClass(ToSetSequence,SetSeq),ToSetSequence.prototype.has=function(o){return this._iter.includes(o)},ToSetSequence.prototype.__iterate=function(o,s){var i=this;return this._iter.__iterate((function(s){return o(s,s,i)}),s)},ToSetSequence.prototype.__iterator=function(o,s){var i=this._iter.__iterator(U,s);return new Iterator((function(){var s=i.next();return s.done?s:iteratorValue(o,s.value,s.value,s)}))},createClass(FromEntriesSequence,KeyedSeq),FromEntriesSequence.prototype.entrySeq=function(){return this._iter.toSeq()},FromEntriesSequence.prototype.__iterate=function(o,s){var i=this;return this._iter.__iterate((function(s){if(s){validateEntry(s);var u=isIterable(s);return o(u?s.get(1):s[1],u?s.get(0):s[0],i)}}),s)},FromEntriesSequence.prototype.__iterator=function(o,s){var i=this._iter.__iterator(U,s);return new Iterator((function(){for(;;){var s=i.next();if(s.done)return s;var u=s.value;if(u){validateEntry(u);var _=isIterable(u);return iteratorValue(o,_?u.get(0):u[0],_?u.get(1):u[1],s)}}}))},ToIndexedSequence.prototype.cacheResult=ToKeyedSequence.prototype.cacheResult=ToSetSequence.prototype.cacheResult=FromEntriesSequence.prototype.cacheResult=cacheResultThrough,createClass(Record,KeyedCollection),Record.prototype.toString=function(){return this.__toString(recordName(this)+\" {\",\"}\")},Record.prototype.has=function(o){return this._defaultValues.hasOwnProperty(o)},Record.prototype.get=function(o,s){if(!this.has(o))return s;var i=this._defaultValues[o];return this._map?this._map.get(o,i):i},Record.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var o=this.constructor;return o._empty||(o._empty=makeRecord(this,emptyMap()))},Record.prototype.set=function(o,s){if(!this.has(o))throw new Error('Cannot set unknown key \"'+o+'\" on '+recordName(this));if(this._map&&!this._map.has(o)&&s===this._defaultValues[o])return this;var i=this._map&&this._map.set(o,s);return this.__ownerID||i===this._map?this:makeRecord(this,i)},Record.prototype.remove=function(o){if(!this.has(o))return this;var s=this._map&&this._map.remove(o);return this.__ownerID||s===this._map?this:makeRecord(this,s)},Record.prototype.wasAltered=function(){return this._map.wasAltered()},Record.prototype.__iterator=function(o,s){var i=this;return KeyedIterable(this._defaultValues).map((function(o,s){return i.get(s)})).__iterator(o,s)},Record.prototype.__iterate=function(o,s){var i=this;return KeyedIterable(this._defaultValues).map((function(o,s){return i.get(s)})).__iterate(o,s)},Record.prototype.__ensureOwner=function(o){if(o===this.__ownerID)return this;var s=this._map&&this._map.__ensureOwner(o);return o?makeRecord(this,s,o):(this.__ownerID=o,this._map=s,this)};var rt=Record.prototype;function makeRecord(o,s,i){var u=Object.create(Object.getPrototypeOf(o));return u._map=s,u.__ownerID=i,u}function recordName(o){return o._name||o.constructor.name||\"Record\"}function setProps(o,s){try{s.forEach(setProp.bind(void 0,o))}catch(o){}}function setProp(o,s){Object.defineProperty(o,s,{get:function(){return this.get(s)},set:function(o){invariant(this.__ownerID,\"Cannot set on an immutable record.\"),this.set(s,o)}})}function Set(o){return null==o?emptySet():isSet(o)&&!isOrdered(o)?o:emptySet().withMutations((function(s){var i=SetIterable(o);assertNotInfinite(i.size),i.forEach((function(o){return s.add(o)}))}))}function isSet(o){return!(!o||!o[ot])}rt[w]=rt.remove,rt.deleteIn=rt.removeIn=$e.removeIn,rt.merge=$e.merge,rt.mergeWith=$e.mergeWith,rt.mergeIn=$e.mergeIn,rt.mergeDeep=$e.mergeDeep,rt.mergeDeepWith=$e.mergeDeepWith,rt.mergeDeepIn=$e.mergeDeepIn,rt.setIn=$e.setIn,rt.update=$e.update,rt.updateIn=$e.updateIn,rt.withMutations=$e.withMutations,rt.asMutable=$e.asMutable,rt.asImmutable=$e.asImmutable,createClass(Set,SetCollection),Set.of=function(){return this(arguments)},Set.fromKeys=function(o){return this(KeyedIterable(o).keySeq())},Set.prototype.toString=function(){return this.__toString(\"Set {\",\"}\")},Set.prototype.has=function(o){return this._map.has(o)},Set.prototype.add=function(o){return updateSet(this,this._map.set(o,!0))},Set.prototype.remove=function(o){return updateSet(this,this._map.remove(o))},Set.prototype.clear=function(){return updateSet(this,this._map.clear())},Set.prototype.union=function(){var s=o.call(arguments,0);return 0===(s=s.filter((function(o){return 0!==o.size}))).length?this:0!==this.size||this.__ownerID||1!==s.length?this.withMutations((function(o){for(var i=0;i<s.length;i++)SetIterable(s[i]).forEach((function(s){return o.add(s)}))})):this.constructor(s[0])},Set.prototype.intersect=function(){var s=o.call(arguments,0);if(0===s.length)return this;s=s.map((function(o){return SetIterable(o)}));var i=this;return this.withMutations((function(o){i.forEach((function(i){s.every((function(o){return o.includes(i)}))||o.remove(i)}))}))},Set.prototype.subtract=function(){var s=o.call(arguments,0);if(0===s.length)return this;s=s.map((function(o){return SetIterable(o)}));var i=this;return this.withMutations((function(o){i.forEach((function(i){s.some((function(o){return o.includes(i)}))&&o.remove(i)}))}))},Set.prototype.merge=function(){return this.union.apply(this,arguments)},Set.prototype.mergeWith=function(s){var i=o.call(arguments,1);return this.union.apply(this,i)},Set.prototype.sort=function(o){return OrderedSet(sortFactory(this,o))},Set.prototype.sortBy=function(o,s){return OrderedSet(sortFactory(this,s,o))},Set.prototype.wasAltered=function(){return this._map.wasAltered()},Set.prototype.__iterate=function(o,s){var i=this;return this._map.__iterate((function(s,u){return o(u,u,i)}),s)},Set.prototype.__iterator=function(o,s){return this._map.map((function(o,s){return s})).__iterator(o,s)},Set.prototype.__ensureOwner=function(o){if(o===this.__ownerID)return this;var s=this._map.__ensureOwner(o);return o?this.__make(s,o):(this.__ownerID=o,this._map=s,this)},Set.isSet=isSet;var nt,ot=\"@@__IMMUTABLE_SET__@@\",st=Set.prototype;function updateSet(o,s){return o.__ownerID?(o.size=s.size,o._map=s,o):s===o._map?o:0===s.size?o.__empty():o.__make(s)}function makeSet(o,s){var i=Object.create(st);return i.size=o?o.size:0,i._map=o,i.__ownerID=s,i}function emptySet(){return nt||(nt=makeSet(emptyMap()))}function OrderedSet(o){return null==o?emptyOrderedSet():isOrderedSet(o)?o:emptyOrderedSet().withMutations((function(s){var i=SetIterable(o);assertNotInfinite(i.size),i.forEach((function(o){return s.add(o)}))}))}function isOrderedSet(o){return isSet(o)&&isOrdered(o)}st[ot]=!0,st[w]=st.remove,st.mergeDeep=st.merge,st.mergeDeepWith=st.mergeWith,st.withMutations=$e.withMutations,st.asMutable=$e.asMutable,st.asImmutable=$e.asImmutable,st.__empty=emptySet,st.__make=makeSet,createClass(OrderedSet,Set),OrderedSet.of=function(){return this(arguments)},OrderedSet.fromKeys=function(o){return this(KeyedIterable(o).keySeq())},OrderedSet.prototype.toString=function(){return this.__toString(\"OrderedSet {\",\"}\")},OrderedSet.isOrderedSet=isOrderedSet;var it,at=OrderedSet.prototype;function makeOrderedSet(o,s){var i=Object.create(at);return i.size=o?o.size:0,i._map=o,i.__ownerID=s,i}function emptyOrderedSet(){return it||(it=makeOrderedSet(emptyOrderedMap()))}function Stack(o){return null==o?emptyStack():isStack(o)?o:emptyStack().unshiftAll(o)}function isStack(o){return!(!o||!o[lt])}at[_]=!0,at.__empty=emptyOrderedSet,at.__make=makeOrderedSet,createClass(Stack,IndexedCollection),Stack.of=function(){return this(arguments)},Stack.prototype.toString=function(){return this.__toString(\"Stack [\",\"]\")},Stack.prototype.get=function(o,s){var i=this._head;for(o=wrapIndex(this,o);i&&o--;)i=i.next;return i?i.value:s},Stack.prototype.peek=function(){return this._head&&this._head.value},Stack.prototype.push=function(){if(0===arguments.length)return this;for(var o=this.size+arguments.length,s=this._head,i=arguments.length-1;i>=0;i--)s={value:arguments[i],next:s};return this.__ownerID?(this.size=o,this._head=s,this.__hash=void 0,this.__altered=!0,this):makeStack(o,s)},Stack.prototype.pushAll=function(o){if(0===(o=IndexedIterable(o)).size)return this;assertNotInfinite(o.size);var s=this.size,i=this._head;return o.reverse().forEach((function(o){s++,i={value:o,next:i}})),this.__ownerID?(this.size=s,this._head=i,this.__hash=void 0,this.__altered=!0,this):makeStack(s,i)},Stack.prototype.pop=function(){return this.slice(1)},Stack.prototype.unshift=function(){return this.push.apply(this,arguments)},Stack.prototype.unshiftAll=function(o){return this.pushAll(o)},Stack.prototype.shift=function(){return this.pop.apply(this,arguments)},Stack.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},Stack.prototype.slice=function(o,s){if(wholeSlice(o,s,this.size))return this;var i=resolveBegin(o,this.size);if(resolveEnd(s,this.size)!==this.size)return IndexedCollection.prototype.slice.call(this,o,s);for(var u=this.size-i,_=this._head;i--;)_=_.next;return this.__ownerID?(this.size=u,this._head=_,this.__hash=void 0,this.__altered=!0,this):makeStack(u,_)},Stack.prototype.__ensureOwner=function(o){return o===this.__ownerID?this:o?makeStack(this.size,this._head,o,this.__hash):(this.__ownerID=o,this.__altered=!1,this)},Stack.prototype.__iterate=function(o,s){if(s)return this.reverse().__iterate(o);for(var i=0,u=this._head;u&&!1!==o(u.value,i++,this);)u=u.next;return i},Stack.prototype.__iterator=function(o,s){if(s)return this.reverse().__iterator(o);var i=0,u=this._head;return new Iterator((function(){if(u){var s=u.value;return u=u.next,iteratorValue(o,i++,s)}return iteratorDone()}))},Stack.isStack=isStack;var ct,lt=\"@@__IMMUTABLE_STACK__@@\",ut=Stack.prototype;function makeStack(o,s,i,u){var _=Object.create(ut);return _.size=o,_._head=s,_.__ownerID=i,_.__hash=u,_.__altered=!1,_}function emptyStack(){return ct||(ct=makeStack(0))}function mixin(o,s){var keyCopier=function(i){o.prototype[i]=s[i]};return Object.keys(s).forEach(keyCopier),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(s).forEach(keyCopier),o}ut[lt]=!0,ut.withMutations=$e.withMutations,ut.asMutable=$e.asMutable,ut.asImmutable=$e.asImmutable,ut.wasAltered=$e.wasAltered,Iterable.Iterator=Iterator,mixin(Iterable,{toArray:function(){assertNotInfinite(this.size);var o=new Array(this.size||0);return this.valueSeq().__iterate((function(s,i){o[i]=s})),o},toIndexedSeq:function(){return new ToIndexedSequence(this)},toJS:function(){return this.toSeq().map((function(o){return o&&\"function\"==typeof o.toJS?o.toJS():o})).__toJS()},toJSON:function(){return this.toSeq().map((function(o){return o&&\"function\"==typeof o.toJSON?o.toJSON():o})).__toJS()},toKeyedSeq:function(){return new ToKeyedSequence(this,!0)},toMap:function(){return Map(this.toKeyedSeq())},toObject:function(){assertNotInfinite(this.size);var o={};return this.__iterate((function(s,i){o[i]=s})),o},toOrderedMap:function(){return OrderedMap(this.toKeyedSeq())},toOrderedSet:function(){return OrderedSet(isKeyed(this)?this.valueSeq():this)},toSet:function(){return Set(isKeyed(this)?this.valueSeq():this)},toSetSeq:function(){return new ToSetSequence(this)},toSeq:function(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Stack(isKeyed(this)?this.valueSeq():this)},toList:function(){return List(isKeyed(this)?this.valueSeq():this)},toString:function(){return\"[Iterable]\"},__toString:function(o,s){return 0===this.size?o+s:o+\" \"+this.toSeq().map(this.__toStringMapper).join(\", \")+\" \"+s},concat:function(){return reify(this,concatFactory(this,o.call(arguments,0)))},includes:function(o){return this.some((function(s){return is(s,o)}))},entries:function(){return this.__iterator(z)},every:function(o,s){assertNotInfinite(this.size);var i=!0;return this.__iterate((function(u,_,w){if(!o.call(s,u,_,w))return i=!1,!1})),i},filter:function(o,s){return reify(this,filterFactory(this,o,s,!0))},find:function(o,s,i){var u=this.findEntry(o,s);return u?u[1]:i},forEach:function(o,s){return assertNotInfinite(this.size),this.__iterate(s?o.bind(s):o)},join:function(o){assertNotInfinite(this.size),o=void 0!==o?\"\"+o:\",\";var s=\"\",i=!0;return this.__iterate((function(u){i?i=!1:s+=o,s+=null!=u?u.toString():\"\"})),s},keys:function(){return this.__iterator(V)},map:function(o,s){return reify(this,mapFactory(this,o,s))},reduce:function(o,s,i){var u,_;return assertNotInfinite(this.size),arguments.length<2?_=!0:u=s,this.__iterate((function(s,w,x){_?(_=!1,u=s):u=o.call(i,u,s,w,x)})),u},reduceRight:function(o,s,i){var u=this.toKeyedSeq().reverse();return u.reduce.apply(u,arguments)},reverse:function(){return reify(this,reverseFactory(this,!0))},slice:function(o,s){return reify(this,sliceFactory(this,o,s,!0))},some:function(o,s){return!this.every(not(o),s)},sort:function(o){return reify(this,sortFactory(this,o))},values:function(){return this.__iterator(U)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(o,s){return ensureSize(o?this.toSeq().filter(o,s):this)},countBy:function(o,s){return countByFactory(this,o,s)},equals:function(o){return deepEqual(this,o)},entrySeq:function(){var o=this;if(o._cache)return new ArraySeq(o._cache);var s=o.toSeq().map(entryMapper).toIndexedSeq();return s.fromEntrySeq=function(){return o.toSeq()},s},filterNot:function(o,s){return this.filter(not(o),s)},findEntry:function(o,s,i){var u=i;return this.__iterate((function(i,_,w){if(o.call(s,i,_,w))return u=[_,i],!1})),u},findKey:function(o,s){var i=this.findEntry(o,s);return i&&i[0]},findLast:function(o,s,i){return this.toKeyedSeq().reverse().find(o,s,i)},findLastEntry:function(o,s,i){return this.toKeyedSeq().reverse().findEntry(o,s,i)},findLastKey:function(o,s){return this.toKeyedSeq().reverse().findKey(o,s)},first:function(){return this.find(returnTrue)},flatMap:function(o,s){return reify(this,flatMapFactory(this,o,s))},flatten:function(o){return reify(this,flattenFactory(this,o,!0))},fromEntrySeq:function(){return new FromEntriesSequence(this)},get:function(o,s){return this.find((function(s,i){return is(i,o)}),void 0,s)},getIn:function(o,s){for(var i,u=this,_=forceIterator(o);!(i=_.next()).done;){var w=i.value;if((u=u&&u.get?u.get(w,L):L)===L)return s}return u},groupBy:function(o,s){return groupByFactory(this,o,s)},has:function(o){return this.get(o,L)!==L},hasIn:function(o){return this.getIn(o,L)!==L},isSubset:function(o){return o=\"function\"==typeof o.includes?o:Iterable(o),this.every((function(s){return o.includes(s)}))},isSuperset:function(o){return(o=\"function\"==typeof o.isSubset?o:Iterable(o)).isSubset(this)},keyOf:function(o){return this.findKey((function(s){return is(s,o)}))},keySeq:function(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(o){return this.toKeyedSeq().reverse().keyOf(o)},max:function(o){return maxFactory(this,o)},maxBy:function(o,s){return maxFactory(this,s,o)},min:function(o){return maxFactory(this,o?neg(o):defaultNegComparator)},minBy:function(o,s){return maxFactory(this,s?neg(s):defaultNegComparator,o)},rest:function(){return this.slice(1)},skip:function(o){return this.slice(Math.max(0,o))},skipLast:function(o){return reify(this,this.toSeq().reverse().skip(o).reverse())},skipWhile:function(o,s){return reify(this,skipWhileFactory(this,o,s,!0))},skipUntil:function(o,s){return this.skipWhile(not(o),s)},sortBy:function(o,s){return reify(this,sortFactory(this,s,o))},take:function(o){return this.slice(0,Math.max(0,o))},takeLast:function(o){return reify(this,this.toSeq().reverse().take(o).reverse())},takeWhile:function(o,s){return reify(this,takeWhileFactory(this,o,s))},takeUntil:function(o,s){return this.takeWhile(not(o),s)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=hashIterable(this))}});var pt=Iterable.prototype;pt[s]=!0,pt[ee]=pt.values,pt.__toJS=pt.toArray,pt.__toStringMapper=quoteString,pt.inspect=pt.toSource=function(){return this.toString()},pt.chain=pt.flatMap,pt.contains=pt.includes,mixin(KeyedIterable,{flip:function(){return reify(this,flipFactory(this))},mapEntries:function(o,s){var i=this,u=0;return reify(this,this.toSeq().map((function(_,w){return o.call(s,[w,_],u++,i)})).fromEntrySeq())},mapKeys:function(o,s){var i=this;return reify(this,this.toSeq().flip().map((function(u,_){return o.call(s,u,_,i)})).flip())}});var ht=KeyedIterable.prototype;function keyMapper(o,s){return s}function entryMapper(o,s){return[s,o]}function not(o){return function(){return!o.apply(this,arguments)}}function neg(o){return function(){return-o.apply(this,arguments)}}function quoteString(o){return\"string\"==typeof o?JSON.stringify(o):String(o)}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(o,s){return o<s?1:o>s?-1:0}function hashIterable(o){if(o.size===1/0)return 0;var s=isOrdered(o),i=isKeyed(o),u=s?1:0;return murmurHashOfSize(o.__iterate(i?s?function(o,s){u=31*u+hashMerge(hash(o),hash(s))|0}:function(o,s){u=u+hashMerge(hash(o),hash(s))|0}:s?function(o){u=31*u+hash(o)|0}:function(o){u=u+hash(o)|0}),u)}function murmurHashOfSize(o,s){return s=pe(s,3432918353),s=pe(s<<15|s>>>-15,461845907),s=pe(s<<13|s>>>-13,5),s=pe((s=s+3864292196^o)^s>>>16,2246822507),s=smi((s=pe(s^s>>>13,3266489909))^s>>>16)}function hashMerge(o,s){return o^s+2654435769+(o<<6)+(o>>2)}return ht[i]=!0,ht[ee]=pt.entries,ht.__toJS=pt.toObject,ht.__toStringMapper=function(o,s){return JSON.stringify(s)+\": \"+quoteString(o)},mixin(IndexedIterable,{toKeyedSeq:function(){return new ToKeyedSequence(this,!1)},filter:function(o,s){return reify(this,filterFactory(this,o,s,!1))},findIndex:function(o,s){var i=this.findEntry(o,s);return i?i[0]:-1},indexOf:function(o){var s=this.keyOf(o);return void 0===s?-1:s},lastIndexOf:function(o){var s=this.lastKeyOf(o);return void 0===s?-1:s},reverse:function(){return reify(this,reverseFactory(this,!1))},slice:function(o,s){return reify(this,sliceFactory(this,o,s,!1))},splice:function(o,s){var i=arguments.length;if(s=Math.max(0|s,0),0===i||2===i&&!s)return this;o=resolveBegin(o,o<0?this.count():this.size);var u=this.slice(0,o);return reify(this,1===i?u:u.concat(arrCopy(arguments,2),this.slice(o+s)))},findLastIndex:function(o,s){var i=this.findLastEntry(o,s);return i?i[0]:-1},first:function(){return this.get(0)},flatten:function(o){return reify(this,flattenFactory(this,o,!1))},get:function(o,s){return(o=wrapIndex(this,o))<0||this.size===1/0||void 0!==this.size&&o>this.size?s:this.find((function(s,i){return i===o}),void 0,s)},has:function(o){return(o=wrapIndex(this,o))>=0&&(void 0!==this.size?this.size===1/0||o<this.size:-1!==this.indexOf(o))},interpose:function(o){return reify(this,interposeFactory(this,o))},interleave:function(){var o=[this].concat(arrCopy(arguments)),s=zipWithFactory(this.toSeq(),IndexedSeq.of,o),i=s.flatten(!0);return s.size&&(i.size=s.size*o.length),reify(this,i)},keySeq:function(){return Range(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(o,s){return reify(this,skipWhileFactory(this,o,s,!1))},zip:function(){return reify(this,zipWithFactory(this,defaultZipper,[this].concat(arrCopy(arguments))))},zipWith:function(o){var s=arrCopy(arguments);return s[0]=this,reify(this,zipWithFactory(this,o,s))}}),IndexedIterable.prototype[u]=!0,IndexedIterable.prototype[_]=!0,mixin(SetIterable,{get:function(o,s){return this.has(o)?o:s},includes:function(o){return this.has(o)},keySeq:function(){return this.valueSeq()}}),SetIterable.prototype.has=pt.includes,SetIterable.prototype.contains=SetIterable.prototype.includes,mixin(KeyedSeq,KeyedIterable.prototype),mixin(IndexedSeq,IndexedIterable.prototype),mixin(SetSeq,SetIterable.prototype),mixin(KeyedCollection,KeyedIterable.prototype),mixin(IndexedCollection,IndexedIterable.prototype),mixin(SetCollection,SetIterable.prototype),{Iterable,Seq,Collection,Map,OrderedMap,List,Stack,Set,OrderedSet,Record,Range,Repeat,is,fromJS}}()},56698:o=>{\"function\"==typeof Object.create?o.exports=function inherits(o,s){s&&(o.super_=s,o.prototype=Object.create(s.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}))}:o.exports=function inherits(o,s){if(s){o.super_=s;var TempCtor=function(){};TempCtor.prototype=s.prototype,o.prototype=new TempCtor,o.prototype.constructor=o}}},5419:o=>{o.exports=function(o,s,i,u){var _=new Blob(void 0!==u?[u,o]:[o],{type:i||\"application/octet-stream\"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(_,s);else{var w=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(_):window.webkitURL.createObjectURL(_),x=document.createElement(\"a\");x.style.display=\"none\",x.href=w,x.setAttribute(\"download\",s),void 0===x.download&&x.setAttribute(\"target\",\"_blank\"),document.body.appendChild(x),x.click(),setTimeout((function(){document.body.removeChild(x),window.URL.revokeObjectURL(w)}),200)}}},20181:(o,s,i)=>{var u=NaN,_=\"[object Symbol]\",w=/^\\s+|\\s+$/g,x=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,j=/^0o[0-7]+$/i,L=parseInt,B=\"object\"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,$=\"object\"==typeof self&&self&&self.Object===Object&&self,V=B||$||Function(\"return this\")(),U=Object.prototype.toString,z=Math.max,Y=Math.min,now=function(){return V.Date.now()};function isObject(o){var s=typeof o;return!!o&&(\"object\"==s||\"function\"==s)}function toNumber(o){if(\"number\"==typeof o)return o;if(function isSymbol(o){return\"symbol\"==typeof o||function isObjectLike(o){return!!o&&\"object\"==typeof o}(o)&&U.call(o)==_}(o))return u;if(isObject(o)){var s=\"function\"==typeof o.valueOf?o.valueOf():o;o=isObject(s)?s+\"\":s}if(\"string\"!=typeof o)return 0===o?o:+o;o=o.replace(w,\"\");var i=C.test(o);return i||j.test(o)?L(o.slice(2),i?2:8):x.test(o)?u:+o}o.exports=function debounce(o,s,i){var u,_,w,x,C,j,L=0,B=!1,$=!1,V=!0;if(\"function\"!=typeof o)throw new TypeError(\"Expected a function\");function invokeFunc(s){var i=u,w=_;return u=_=void 0,L=s,x=o.apply(w,i)}function shouldInvoke(o){var i=o-j;return void 0===j||i>=s||i<0||$&&o-L>=w}function timerExpired(){var o=now();if(shouldInvoke(o))return trailingEdge(o);C=setTimeout(timerExpired,function remainingWait(o){var i=s-(o-j);return $?Y(i,w-(o-L)):i}(o))}function trailingEdge(o){return C=void 0,V&&u?invokeFunc(o):(u=_=void 0,x)}function debounced(){var o=now(),i=shouldInvoke(o);if(u=arguments,_=this,j=o,i){if(void 0===C)return function leadingEdge(o){return L=o,C=setTimeout(timerExpired,s),B?invokeFunc(o):x}(j);if($)return C=setTimeout(timerExpired,s),invokeFunc(j)}return void 0===C&&(C=setTimeout(timerExpired,s)),x}return s=toNumber(s)||0,isObject(i)&&(B=!!i.leading,w=($=\"maxWait\"in i)?z(toNumber(i.maxWait)||0,s):w,V=\"trailing\"in i?!!i.trailing:V),debounced.cancel=function cancel(){void 0!==C&&clearTimeout(C),L=0,u=j=_=C=void 0},debounced.flush=function flush(){return void 0===C?x:trailingEdge(now())},debounced}},55580:(o,s,i)=>{var u=i(56110)(i(9325),\"DataView\");o.exports=u},21549:(o,s,i)=>{var u=i(22032),_=i(63862),w=i(66721),x=i(12749),C=i(35749);function Hash(o){var s=-1,i=null==o?0:o.length;for(this.clear();++s<i;){var u=o[s];this.set(u[0],u[1])}}Hash.prototype.clear=u,Hash.prototype.delete=_,Hash.prototype.get=w,Hash.prototype.has=x,Hash.prototype.set=C,o.exports=Hash},30980:(o,s,i)=>{var u=i(39344),_=i(94033);function LazyWrapper(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}LazyWrapper.prototype=u(_.prototype),LazyWrapper.prototype.constructor=LazyWrapper,o.exports=LazyWrapper},80079:(o,s,i)=>{var u=i(63702),_=i(70080),w=i(24739),x=i(48655),C=i(31175);function ListCache(o){var s=-1,i=null==o?0:o.length;for(this.clear();++s<i;){var u=o[s];this.set(u[0],u[1])}}ListCache.prototype.clear=u,ListCache.prototype.delete=_,ListCache.prototype.get=w,ListCache.prototype.has=x,ListCache.prototype.set=C,o.exports=ListCache},56017:(o,s,i)=>{var u=i(39344),_=i(94033);function LodashWrapper(o,s){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=void 0}LodashWrapper.prototype=u(_.prototype),LodashWrapper.prototype.constructor=LodashWrapper,o.exports=LodashWrapper},68223:(o,s,i)=>{var u=i(56110)(i(9325),\"Map\");o.exports=u},53661:(o,s,i)=>{var u=i(63040),_=i(17670),w=i(90289),x=i(4509),C=i(72949);function MapCache(o){var s=-1,i=null==o?0:o.length;for(this.clear();++s<i;){var u=o[s];this.set(u[0],u[1])}}MapCache.prototype.clear=u,MapCache.prototype.delete=_,MapCache.prototype.get=w,MapCache.prototype.has=x,MapCache.prototype.set=C,o.exports=MapCache},32804:(o,s,i)=>{var u=i(56110)(i(9325),\"Promise\");o.exports=u},76545:(o,s,i)=>{var u=i(56110)(i(9325),\"Set\");o.exports=u},38859:(o,s,i)=>{var u=i(53661),_=i(31380),w=i(51459);function SetCache(o){var s=-1,i=null==o?0:o.length;for(this.__data__=new u;++s<i;)this.add(o[s])}SetCache.prototype.add=SetCache.prototype.push=_,SetCache.prototype.has=w,o.exports=SetCache},37217:(o,s,i)=>{var u=i(80079),_=i(51420),w=i(90938),x=i(63605),C=i(29817),j=i(80945);function Stack(o){var s=this.__data__=new u(o);this.size=s.size}Stack.prototype.clear=_,Stack.prototype.delete=w,Stack.prototype.get=x,Stack.prototype.has=C,Stack.prototype.set=j,o.exports=Stack},51873:(o,s,i)=>{var u=i(9325).Symbol;o.exports=u},37828:(o,s,i)=>{var u=i(9325).Uint8Array;o.exports=u},28303:(o,s,i)=>{var u=i(56110)(i(9325),\"WeakMap\");o.exports=u},91033:o=>{o.exports=function apply(o,s,i){switch(i.length){case 0:return o.call(s);case 1:return o.call(s,i[0]);case 2:return o.call(s,i[0],i[1]);case 3:return o.call(s,i[0],i[1],i[2])}return o.apply(s,i)}},83729:o=>{o.exports=function arrayEach(o,s){for(var i=-1,u=null==o?0:o.length;++i<u&&!1!==s(o[i],i,o););return o}},79770:o=>{o.exports=function arrayFilter(o,s){for(var i=-1,u=null==o?0:o.length,_=0,w=[];++i<u;){var x=o[i];s(x,i,o)&&(w[_++]=x)}return w}},15325:(o,s,i)=>{var u=i(96131);o.exports=function arrayIncludes(o,s){return!!(null==o?0:o.length)&&u(o,s,0)>-1}},70695:(o,s,i)=>{var u=i(78096),_=i(72428),w=i(56449),x=i(3656),C=i(30361),j=i(37167),L=Object.prototype.hasOwnProperty;o.exports=function arrayLikeKeys(o,s){var i=w(o),B=!i&&_(o),$=!i&&!B&&x(o),V=!i&&!B&&!$&&j(o),U=i||B||$||V,z=U?u(o.length,String):[],Y=z.length;for(var Z in o)!s&&!L.call(o,Z)||U&&(\"length\"==Z||$&&(\"offset\"==Z||\"parent\"==Z)||V&&(\"buffer\"==Z||\"byteLength\"==Z||\"byteOffset\"==Z)||C(Z,Y))||z.push(Z);return z}},34932:o=>{o.exports=function arrayMap(o,s){for(var i=-1,u=null==o?0:o.length,_=Array(u);++i<u;)_[i]=s(o[i],i,o);return _}},14528:o=>{o.exports=function arrayPush(o,s){for(var i=-1,u=s.length,_=o.length;++i<u;)o[_+i]=s[i];return o}},40882:o=>{o.exports=function arrayReduce(o,s,i,u){var _=-1,w=null==o?0:o.length;for(u&&w&&(i=o[++_]);++_<w;)i=s(i,o[_],_,o);return i}},14248:o=>{o.exports=function arraySome(o,s){for(var i=-1,u=null==o?0:o.length;++i<u;)if(s(o[i],i,o))return!0;return!1}},61074:o=>{o.exports=function asciiToArray(o){return o.split(\"\")}},1733:o=>{var s=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;o.exports=function asciiWords(o){return o.match(s)||[]}},87805:(o,s,i)=>{var u=i(43360),_=i(75288);o.exports=function assignMergeValue(o,s,i){(void 0!==i&&!_(o[s],i)||void 0===i&&!(s in o))&&u(o,s,i)}},16547:(o,s,i)=>{var u=i(43360),_=i(75288),w=Object.prototype.hasOwnProperty;o.exports=function assignValue(o,s,i){var x=o[s];w.call(o,s)&&_(x,i)&&(void 0!==i||s in o)||u(o,s,i)}},26025:(o,s,i)=>{var u=i(75288);o.exports=function assocIndexOf(o,s){for(var i=o.length;i--;)if(u(o[i][0],s))return i;return-1}},74733:(o,s,i)=>{var u=i(21791),_=i(95950);o.exports=function baseAssign(o,s){return o&&u(s,_(s),o)}},43838:(o,s,i)=>{var u=i(21791),_=i(37241);o.exports=function baseAssignIn(o,s){return o&&u(s,_(s),o)}},43360:(o,s,i)=>{var u=i(93243);o.exports=function baseAssignValue(o,s,i){\"__proto__\"==s&&u?u(o,s,{configurable:!0,enumerable:!0,value:i,writable:!0}):o[s]=i}},9999:(o,s,i)=>{var u=i(37217),_=i(83729),w=i(16547),x=i(74733),C=i(43838),j=i(93290),L=i(23007),B=i(92271),$=i(48948),V=i(50002),U=i(83349),z=i(5861),Y=i(76189),Z=i(77199),ee=i(35529),ie=i(56449),ae=i(3656),ce=i(87730),le=i(23805),pe=i(38440),de=i(95950),fe=i(37241),ye=\"[object Arguments]\",be=\"[object Function]\",_e=\"[object Object]\",we={};we[ye]=we[\"[object Array]\"]=we[\"[object ArrayBuffer]\"]=we[\"[object DataView]\"]=we[\"[object Boolean]\"]=we[\"[object Date]\"]=we[\"[object Float32Array]\"]=we[\"[object Float64Array]\"]=we[\"[object Int8Array]\"]=we[\"[object Int16Array]\"]=we[\"[object Int32Array]\"]=we[\"[object Map]\"]=we[\"[object Number]\"]=we[_e]=we[\"[object RegExp]\"]=we[\"[object Set]\"]=we[\"[object String]\"]=we[\"[object Symbol]\"]=we[\"[object Uint8Array]\"]=we[\"[object Uint8ClampedArray]\"]=we[\"[object Uint16Array]\"]=we[\"[object Uint32Array]\"]=!0,we[\"[object Error]\"]=we[be]=we[\"[object WeakMap]\"]=!1,o.exports=function baseClone(o,s,i,Se,xe,Pe){var Te,Re=1&s,qe=2&s,$e=4&s;if(i&&(Te=xe?i(o,Se,xe,Pe):i(o)),void 0!==Te)return Te;if(!le(o))return o;var ze=ie(o);if(ze){if(Te=Y(o),!Re)return L(o,Te)}else{var We=z(o),He=We==be||\"[object GeneratorFunction]\"==We;if(ae(o))return j(o,Re);if(We==_e||We==ye||He&&!xe){if(Te=qe||He?{}:ee(o),!Re)return qe?$(o,C(Te,o)):B(o,x(Te,o))}else{if(!we[We])return xe?o:{};Te=Z(o,We,Re)}}Pe||(Pe=new u);var Ye=Pe.get(o);if(Ye)return Ye;Pe.set(o,Te),pe(o)?o.forEach((function(u){Te.add(baseClone(u,s,i,u,o,Pe))})):ce(o)&&o.forEach((function(u,_){Te.set(_,baseClone(u,s,i,_,o,Pe))}));var Xe=ze?void 0:($e?qe?U:V:qe?fe:de)(o);return _(Xe||o,(function(u,_){Xe&&(u=o[_=u]),w(Te,_,baseClone(u,s,i,_,o,Pe))})),Te}},39344:(o,s,i)=>{var u=i(23805),_=Object.create,w=function(){function object(){}return function(o){if(!u(o))return{};if(_)return _(o);object.prototype=o;var s=new object;return object.prototype=void 0,s}}();o.exports=w},80909:(o,s,i)=>{var u=i(30641),_=i(38329)(u);o.exports=_},2523:o=>{o.exports=function baseFindIndex(o,s,i,u){for(var _=o.length,w=i+(u?1:-1);u?w--:++w<_;)if(s(o[w],w,o))return w;return-1}},83120:(o,s,i)=>{var u=i(14528),_=i(45891);o.exports=function baseFlatten(o,s,i,w,x){var C=-1,j=o.length;for(i||(i=_),x||(x=[]);++C<j;){var L=o[C];s>0&&i(L)?s>1?baseFlatten(L,s-1,i,w,x):u(x,L):w||(x[x.length]=L)}return x}},86649:(o,s,i)=>{var u=i(83221)();o.exports=u},30641:(o,s,i)=>{var u=i(86649),_=i(95950);o.exports=function baseForOwn(o,s){return o&&u(o,s,_)}},47422:(o,s,i)=>{var u=i(31769),_=i(77797);o.exports=function baseGet(o,s){for(var i=0,w=(s=u(s,o)).length;null!=o&&i<w;)o=o[_(s[i++])];return i&&i==w?o:void 0}},82199:(o,s,i)=>{var u=i(14528),_=i(56449);o.exports=function baseGetAllKeys(o,s,i){var w=s(o);return _(o)?w:u(w,i(o))}},72552:(o,s,i)=>{var u=i(51873),_=i(659),w=i(59350),x=u?u.toStringTag:void 0;o.exports=function baseGetTag(o){return null==o?void 0===o?\"[object Undefined]\":\"[object Null]\":x&&x in Object(o)?_(o):w(o)}},20426:o=>{var s=Object.prototype.hasOwnProperty;o.exports=function baseHas(o,i){return null!=o&&s.call(o,i)}},28077:o=>{o.exports=function baseHasIn(o,s){return null!=o&&s in Object(o)}},96131:(o,s,i)=>{var u=i(2523),_=i(85463),w=i(76959);o.exports=function baseIndexOf(o,s,i){return s==s?w(o,s,i):u(o,_,i)}},27534:(o,s,i)=>{var u=i(72552),_=i(40346);o.exports=function baseIsArguments(o){return _(o)&&\"[object Arguments]\"==u(o)}},60270:(o,s,i)=>{var u=i(87068),_=i(40346);o.exports=function baseIsEqual(o,s,i,w,x){return o===s||(null==o||null==s||!_(o)&&!_(s)?o!=o&&s!=s:u(o,s,i,w,baseIsEqual,x))}},87068:(o,s,i)=>{var u=i(37217),_=i(25911),w=i(21986),x=i(50689),C=i(5861),j=i(56449),L=i(3656),B=i(37167),$=\"[object Arguments]\",V=\"[object Array]\",U=\"[object Object]\",z=Object.prototype.hasOwnProperty;o.exports=function baseIsEqualDeep(o,s,i,Y,Z,ee){var ie=j(o),ae=j(s),ce=ie?V:C(o),le=ae?V:C(s),pe=(ce=ce==$?U:ce)==U,de=(le=le==$?U:le)==U,fe=ce==le;if(fe&&L(o)){if(!L(s))return!1;ie=!0,pe=!1}if(fe&&!pe)return ee||(ee=new u),ie||B(o)?_(o,s,i,Y,Z,ee):w(o,s,ce,i,Y,Z,ee);if(!(1&i)){var ye=pe&&z.call(o,\"__wrapped__\"),be=de&&z.call(s,\"__wrapped__\");if(ye||be){var _e=ye?o.value():o,we=be?s.value():s;return ee||(ee=new u),Z(_e,we,i,Y,ee)}}return!!fe&&(ee||(ee=new u),x(o,s,i,Y,Z,ee))}},29172:(o,s,i)=>{var u=i(5861),_=i(40346);o.exports=function baseIsMap(o){return _(o)&&\"[object Map]\"==u(o)}},41799:(o,s,i)=>{var u=i(37217),_=i(60270);o.exports=function baseIsMatch(o,s,i,w){var x=i.length,C=x,j=!w;if(null==o)return!C;for(o=Object(o);x--;){var L=i[x];if(j&&L[2]?L[1]!==o[L[0]]:!(L[0]in o))return!1}for(;++x<C;){var B=(L=i[x])[0],$=o[B],V=L[1];if(j&&L[2]){if(void 0===$&&!(B in o))return!1}else{var U=new u;if(w)var z=w($,V,B,o,s,U);if(!(void 0===z?_(V,$,3,w,U):z))return!1}}return!0}},85463:o=>{o.exports=function baseIsNaN(o){return o!=o}},45083:(o,s,i)=>{var u=i(1882),_=i(87296),w=i(23805),x=i(47473),C=/^\\[object .+?Constructor\\]$/,j=Function.prototype,L=Object.prototype,B=j.toString,$=L.hasOwnProperty,V=RegExp(\"^\"+B.call($).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");o.exports=function baseIsNative(o){return!(!w(o)||_(o))&&(u(o)?V:C).test(x(o))}},16038:(o,s,i)=>{var u=i(5861),_=i(40346);o.exports=function baseIsSet(o){return _(o)&&\"[object Set]\"==u(o)}},4901:(o,s,i)=>{var u=i(72552),_=i(30294),w=i(40346),x={};x[\"[object Float32Array]\"]=x[\"[object Float64Array]\"]=x[\"[object Int8Array]\"]=x[\"[object Int16Array]\"]=x[\"[object Int32Array]\"]=x[\"[object Uint8Array]\"]=x[\"[object Uint8ClampedArray]\"]=x[\"[object Uint16Array]\"]=x[\"[object Uint32Array]\"]=!0,x[\"[object Arguments]\"]=x[\"[object Array]\"]=x[\"[object ArrayBuffer]\"]=x[\"[object Boolean]\"]=x[\"[object DataView]\"]=x[\"[object Date]\"]=x[\"[object Error]\"]=x[\"[object Function]\"]=x[\"[object Map]\"]=x[\"[object Number]\"]=x[\"[object Object]\"]=x[\"[object RegExp]\"]=x[\"[object Set]\"]=x[\"[object String]\"]=x[\"[object WeakMap]\"]=!1,o.exports=function baseIsTypedArray(o){return w(o)&&_(o.length)&&!!x[u(o)]}},15389:(o,s,i)=>{var u=i(93663),_=i(87978),w=i(83488),x=i(56449),C=i(50583);o.exports=function baseIteratee(o){return\"function\"==typeof o?o:null==o?w:\"object\"==typeof o?x(o)?_(o[0],o[1]):u(o):C(o)}},88984:(o,s,i)=>{var u=i(55527),_=i(3650),w=Object.prototype.hasOwnProperty;o.exports=function baseKeys(o){if(!u(o))return _(o);var s=[];for(var i in Object(o))w.call(o,i)&&\"constructor\"!=i&&s.push(i);return s}},72903:(o,s,i)=>{var u=i(23805),_=i(55527),w=i(90181),x=Object.prototype.hasOwnProperty;o.exports=function baseKeysIn(o){if(!u(o))return w(o);var s=_(o),i=[];for(var C in o)(\"constructor\"!=C||!s&&x.call(o,C))&&i.push(C);return i}},94033:o=>{o.exports=function baseLodash(){}},93663:(o,s,i)=>{var u=i(41799),_=i(10776),w=i(67197);o.exports=function baseMatches(o){var s=_(o);return 1==s.length&&s[0][2]?w(s[0][0],s[0][1]):function(i){return i===o||u(i,o,s)}}},87978:(o,s,i)=>{var u=i(60270),_=i(58156),w=i(80631),x=i(28586),C=i(30756),j=i(67197),L=i(77797);o.exports=function baseMatchesProperty(o,s){return x(o)&&C(s)?j(L(o),s):function(i){var x=_(i,o);return void 0===x&&x===s?w(i,o):u(s,x,3)}}},85250:(o,s,i)=>{var u=i(37217),_=i(87805),w=i(86649),x=i(42824),C=i(23805),j=i(37241),L=i(14974);o.exports=function baseMerge(o,s,i,B,$){o!==s&&w(s,(function(w,j){if($||($=new u),C(w))x(o,s,j,i,baseMerge,B,$);else{var V=B?B(L(o,j),w,j+\"\",o,s,$):void 0;void 0===V&&(V=w),_(o,j,V)}}),j)}},42824:(o,s,i)=>{var u=i(87805),_=i(93290),w=i(71961),x=i(23007),C=i(35529),j=i(72428),L=i(56449),B=i(83693),$=i(3656),V=i(1882),U=i(23805),z=i(11331),Y=i(37167),Z=i(14974),ee=i(69884);o.exports=function baseMergeDeep(o,s,i,ie,ae,ce,le){var pe=Z(o,i),de=Z(s,i),fe=le.get(de);if(fe)u(o,i,fe);else{var ye=ce?ce(pe,de,i+\"\",o,s,le):void 0,be=void 0===ye;if(be){var _e=L(de),we=!_e&&$(de),Se=!_e&&!we&&Y(de);ye=de,_e||we||Se?L(pe)?ye=pe:B(pe)?ye=x(pe):we?(be=!1,ye=_(de,!0)):Se?(be=!1,ye=w(de,!0)):ye=[]:z(de)||j(de)?(ye=pe,j(pe)?ye=ee(pe):U(pe)&&!V(pe)||(ye=C(de))):be=!1}be&&(le.set(de,ye),ae(ye,de,ie,ce,le),le.delete(de)),u(o,i,ye)}}},47237:o=>{o.exports=function baseProperty(o){return function(s){return null==s?void 0:s[o]}}},17255:(o,s,i)=>{var u=i(47422);o.exports=function basePropertyDeep(o){return function(s){return u(s,o)}}},54552:o=>{o.exports=function basePropertyOf(o){return function(s){return null==o?void 0:o[s]}}},85558:o=>{o.exports=function baseReduce(o,s,i,u,_){return _(o,(function(o,_,w){i=u?(u=!1,o):s(i,o,_,w)})),i}},69302:(o,s,i)=>{var u=i(83488),_=i(56757),w=i(32865);o.exports=function baseRest(o,s){return w(_(o,s,u),o+\"\")}},73170:(o,s,i)=>{var u=i(16547),_=i(31769),w=i(30361),x=i(23805),C=i(77797);o.exports=function baseSet(o,s,i,j){if(!x(o))return o;for(var L=-1,B=(s=_(s,o)).length,$=B-1,V=o;null!=V&&++L<B;){var U=C(s[L]),z=i;if(\"__proto__\"===U||\"constructor\"===U||\"prototype\"===U)return o;if(L!=$){var Y=V[U];void 0===(z=j?j(Y,U,V):void 0)&&(z=x(Y)?Y:w(s[L+1])?[]:{})}u(V,U,z),V=V[U]}return o}},68882:(o,s,i)=>{var u=i(83488),_=i(48152),w=_?function(o,s){return _.set(o,s),o}:u;o.exports=w},19570:(o,s,i)=>{var u=i(37334),_=i(93243),w=i(83488),x=_?function(o,s){return _(o,\"toString\",{configurable:!0,enumerable:!1,value:u(s),writable:!0})}:w;o.exports=x},25160:o=>{o.exports=function baseSlice(o,s,i){var u=-1,_=o.length;s<0&&(s=-s>_?0:_+s),(i=i>_?_:i)<0&&(i+=_),_=s>i?0:i-s>>>0,s>>>=0;for(var w=Array(_);++u<_;)w[u]=o[u+s];return w}},90916:(o,s,i)=>{var u=i(80909);o.exports=function baseSome(o,s){var i;return u(o,(function(o,u,_){return!(i=s(o,u,_))})),!!i}},78096:o=>{o.exports=function baseTimes(o,s){for(var i=-1,u=Array(o);++i<o;)u[i]=s(i);return u}},77556:(o,s,i)=>{var u=i(51873),_=i(34932),w=i(56449),x=i(44394),C=u?u.prototype:void 0,j=C?C.toString:void 0;o.exports=function baseToString(o){if(\"string\"==typeof o)return o;if(w(o))return _(o,baseToString)+\"\";if(x(o))return j?j.call(o):\"\";var s=o+\"\";return\"0\"==s&&1/o==-1/0?\"-0\":s}},54128:(o,s,i)=>{var u=i(31800),_=/^\\s+/;o.exports=function baseTrim(o){return o?o.slice(0,u(o)+1).replace(_,\"\"):o}},27301:o=>{o.exports=function baseUnary(o){return function(s){return o(s)}}},19931:(o,s,i)=>{var u=i(31769),_=i(68090),w=i(68969),x=i(77797);o.exports=function baseUnset(o,s){return s=u(s,o),null==(o=w(o,s))||delete o[x(_(s))]}},51234:o=>{o.exports=function baseZipObject(o,s,i){for(var u=-1,_=o.length,w=s.length,x={};++u<_;){var C=u<w?s[u]:void 0;i(x,o[u],C)}return x}},19219:o=>{o.exports=function cacheHas(o,s){return o.has(s)}},31769:(o,s,i)=>{var u=i(56449),_=i(28586),w=i(61802),x=i(13222);o.exports=function castPath(o,s){return u(o)?o:_(o,s)?[o]:w(x(o))}},28754:(o,s,i)=>{var u=i(25160);o.exports=function castSlice(o,s,i){var _=o.length;return i=void 0===i?_:i,!s&&i>=_?o:u(o,s,i)}},49653:(o,s,i)=>{var u=i(37828);o.exports=function cloneArrayBuffer(o){var s=new o.constructor(o.byteLength);return new u(s).set(new u(o)),s}},93290:(o,s,i)=>{o=i.nmd(o);var u=i(9325),_=s&&!s.nodeType&&s,w=_&&o&&!o.nodeType&&o,x=w&&w.exports===_?u.Buffer:void 0,C=x?x.allocUnsafe:void 0;o.exports=function cloneBuffer(o,s){if(s)return o.slice();var i=o.length,u=C?C(i):new o.constructor(i);return o.copy(u),u}},76169:(o,s,i)=>{var u=i(49653);o.exports=function cloneDataView(o,s){var i=s?u(o.buffer):o.buffer;return new o.constructor(i,o.byteOffset,o.byteLength)}},73201:o=>{var s=/\\w*$/;o.exports=function cloneRegExp(o){var i=new o.constructor(o.source,s.exec(o));return i.lastIndex=o.lastIndex,i}},93736:(o,s,i)=>{var u=i(51873),_=u?u.prototype:void 0,w=_?_.valueOf:void 0;o.exports=function cloneSymbol(o){return w?Object(w.call(o)):{}}},71961:(o,s,i)=>{var u=i(49653);o.exports=function cloneTypedArray(o,s){var i=s?u(o.buffer):o.buffer;return new o.constructor(i,o.byteOffset,o.length)}},91596:o=>{var s=Math.max;o.exports=function composeArgs(o,i,u,_){for(var w=-1,x=o.length,C=u.length,j=-1,L=i.length,B=s(x-C,0),$=Array(L+B),V=!_;++j<L;)$[j]=i[j];for(;++w<C;)(V||w<x)&&($[u[w]]=o[w]);for(;B--;)$[j++]=o[w++];return $}},53320:o=>{var s=Math.max;o.exports=function composeArgsRight(o,i,u,_){for(var w=-1,x=o.length,C=-1,j=u.length,L=-1,B=i.length,$=s(x-j,0),V=Array($+B),U=!_;++w<$;)V[w]=o[w];for(var z=w;++L<B;)V[z+L]=i[L];for(;++C<j;)(U||w<x)&&(V[z+u[C]]=o[w++]);return V}},23007:o=>{o.exports=function copyArray(o,s){var i=-1,u=o.length;for(s||(s=Array(u));++i<u;)s[i]=o[i];return s}},21791:(o,s,i)=>{var u=i(16547),_=i(43360);o.exports=function copyObject(o,s,i,w){var x=!i;i||(i={});for(var C=-1,j=s.length;++C<j;){var L=s[C],B=w?w(i[L],o[L],L,i,o):void 0;void 0===B&&(B=o[L]),x?_(i,L,B):u(i,L,B)}return i}},92271:(o,s,i)=>{var u=i(21791),_=i(4664);o.exports=function copySymbols(o,s){return u(o,_(o),s)}},48948:(o,s,i)=>{var u=i(21791),_=i(86375);o.exports=function copySymbolsIn(o,s){return u(o,_(o),s)}},55481:(o,s,i)=>{var u=i(9325)[\"__core-js_shared__\"];o.exports=u},58523:o=>{o.exports=function countHolders(o,s){for(var i=o.length,u=0;i--;)o[i]===s&&++u;return u}},20999:(o,s,i)=>{var u=i(69302),_=i(36800);o.exports=function createAssigner(o){return u((function(s,i){var u=-1,w=i.length,x=w>1?i[w-1]:void 0,C=w>2?i[2]:void 0;for(x=o.length>3&&\"function\"==typeof x?(w--,x):void 0,C&&_(i[0],i[1],C)&&(x=w<3?void 0:x,w=1),s=Object(s);++u<w;){var j=i[u];j&&o(s,j,u,x)}return s}))}},38329:(o,s,i)=>{var u=i(64894);o.exports=function createBaseEach(o,s){return function(i,_){if(null==i)return i;if(!u(i))return o(i,_);for(var w=i.length,x=s?w:-1,C=Object(i);(s?x--:++x<w)&&!1!==_(C[x],x,C););return i}}},83221:o=>{o.exports=function createBaseFor(o){return function(s,i,u){for(var _=-1,w=Object(s),x=u(s),C=x.length;C--;){var j=x[o?C:++_];if(!1===i(w[j],j,w))break}return s}}},11842:(o,s,i)=>{var u=i(82819),_=i(9325);o.exports=function createBind(o,s,i){var w=1&s,x=u(o);return function wrapper(){return(this&&this!==_&&this instanceof wrapper?x:o).apply(w?i:this,arguments)}}},12507:(o,s,i)=>{var u=i(28754),_=i(49698),w=i(63912),x=i(13222);o.exports=function createCaseFirst(o){return function(s){s=x(s);var i=_(s)?w(s):void 0,C=i?i[0]:s.charAt(0),j=i?u(i,1).join(\"\"):s.slice(1);return C[o]()+j}}},45539:(o,s,i)=>{var u=i(40882),_=i(50828),w=i(66645),x=RegExp(\"['’]\",\"g\");o.exports=function createCompounder(o){return function(s){return u(w(_(s).replace(x,\"\")),o,\"\")}}},82819:(o,s,i)=>{var u=i(39344),_=i(23805);o.exports=function createCtor(o){return function(){var s=arguments;switch(s.length){case 0:return new o;case 1:return new o(s[0]);case 2:return new o(s[0],s[1]);case 3:return new o(s[0],s[1],s[2]);case 4:return new o(s[0],s[1],s[2],s[3]);case 5:return new o(s[0],s[1],s[2],s[3],s[4]);case 6:return new o(s[0],s[1],s[2],s[3],s[4],s[5]);case 7:return new o(s[0],s[1],s[2],s[3],s[4],s[5],s[6])}var i=u(o.prototype),w=o.apply(i,s);return _(w)?w:i}}},77078:(o,s,i)=>{var u=i(91033),_=i(82819),w=i(37471),x=i(18073),C=i(11287),j=i(36306),L=i(9325);o.exports=function createCurry(o,s,i){var B=_(o);return function wrapper(){for(var _=arguments.length,$=Array(_),V=_,U=C(wrapper);V--;)$[V]=arguments[V];var z=_<3&&$[0]!==U&&$[_-1]!==U?[]:j($,U);return(_-=z.length)<i?x(o,s,w,wrapper.placeholder,void 0,$,z,void 0,void 0,i-_):u(this&&this!==L&&this instanceof wrapper?B:o,this,$)}}},62006:(o,s,i)=>{var u=i(15389),_=i(64894),w=i(95950);o.exports=function createFind(o){return function(s,i,x){var C=Object(s);if(!_(s)){var j=u(i,3);s=w(s),i=function(o){return j(C[o],o,C)}}var L=o(s,i,x);return L>-1?C[j?s[L]:L]:void 0}}},37471:(o,s,i)=>{var u=i(91596),_=i(53320),w=i(58523),x=i(82819),C=i(18073),j=i(11287),L=i(68294),B=i(36306),$=i(9325);o.exports=function createHybrid(o,s,i,V,U,z,Y,Z,ee,ie){var ae=128&s,ce=1&s,le=2&s,pe=24&s,de=512&s,fe=le?void 0:x(o);return function wrapper(){for(var ye=arguments.length,be=Array(ye),_e=ye;_e--;)be[_e]=arguments[_e];if(pe)var we=j(wrapper),Se=w(be,we);if(V&&(be=u(be,V,U,pe)),z&&(be=_(be,z,Y,pe)),ye-=Se,pe&&ye<ie){var xe=B(be,we);return C(o,s,createHybrid,wrapper.placeholder,i,be,xe,Z,ee,ie-ye)}var Pe=ce?i:this,Te=le?Pe[o]:o;return ye=be.length,Z?be=L(be,Z):de&&ye>1&&be.reverse(),ae&&ee<ye&&(be.length=ee),this&&this!==$&&this instanceof wrapper&&(Te=fe||x(Te)),Te.apply(Pe,be)}}},24168:(o,s,i)=>{var u=i(91033),_=i(82819),w=i(9325);o.exports=function createPartial(o,s,i,x){var C=1&s,j=_(o);return function wrapper(){for(var s=-1,_=arguments.length,L=-1,B=x.length,$=Array(B+_),V=this&&this!==w&&this instanceof wrapper?j:o;++L<B;)$[L]=x[L];for(;_--;)$[L++]=arguments[++s];return u(V,C?i:this,$)}}},18073:(o,s,i)=>{var u=i(85087),_=i(54641),w=i(70981);o.exports=function createRecurry(o,s,i,x,C,j,L,B,$,V){var U=8&s;s|=U?32:64,4&(s&=~(U?64:32))||(s&=-4);var z=[o,s,C,U?j:void 0,U?L:void 0,U?void 0:j,U?void 0:L,B,$,V],Y=i.apply(void 0,z);return u(o)&&_(Y,z),Y.placeholder=x,w(Y,o,s)}},66977:(o,s,i)=>{var u=i(68882),_=i(11842),w=i(77078),x=i(37471),C=i(24168),j=i(37381),L=i(3209),B=i(54641),$=i(70981),V=i(61489),U=Math.max;o.exports=function createWrap(o,s,i,z,Y,Z,ee,ie){var ae=2&s;if(!ae&&\"function\"!=typeof o)throw new TypeError(\"Expected a function\");var ce=z?z.length:0;if(ce||(s&=-97,z=Y=void 0),ee=void 0===ee?ee:U(V(ee),0),ie=void 0===ie?ie:V(ie),ce-=Y?Y.length:0,64&s){var le=z,pe=Y;z=Y=void 0}var de=ae?void 0:j(o),fe=[o,s,i,z,Y,le,pe,Z,ee,ie];if(de&&L(fe,de),o=fe[0],s=fe[1],i=fe[2],z=fe[3],Y=fe[4],!(ie=fe[9]=void 0===fe[9]?ae?0:o.length:U(fe[9]-ce,0))&&24&s&&(s&=-25),s&&1!=s)ye=8==s||16==s?w(o,s,ie):32!=s&&33!=s||Y.length?x.apply(void 0,fe):C(o,s,i,z);else var ye=_(o,s,i);return $((de?u:B)(ye,fe),o,s)}},53138:(o,s,i)=>{var u=i(11331);o.exports=function customOmitClone(o){return u(o)?void 0:o}},24647:(o,s,i)=>{var u=i(54552)({À:\"A\",Á:\"A\",Â:\"A\",Ã:\"A\",Ä:\"A\",Å:\"A\",à:\"a\",á:\"a\",â:\"a\",ã:\"a\",ä:\"a\",å:\"a\",Ç:\"C\",ç:\"c\",Ð:\"D\",ð:\"d\",È:\"E\",É:\"E\",Ê:\"E\",Ë:\"E\",è:\"e\",é:\"e\",ê:\"e\",ë:\"e\",Ì:\"I\",Í:\"I\",Î:\"I\",Ï:\"I\",ì:\"i\",í:\"i\",î:\"i\",ï:\"i\",Ñ:\"N\",ñ:\"n\",Ò:\"O\",Ó:\"O\",Ô:\"O\",Õ:\"O\",Ö:\"O\",Ø:\"O\",ò:\"o\",ó:\"o\",ô:\"o\",õ:\"o\",ö:\"o\",ø:\"o\",Ù:\"U\",Ú:\"U\",Û:\"U\",Ü:\"U\",ù:\"u\",ú:\"u\",û:\"u\",ü:\"u\",Ý:\"Y\",ý:\"y\",ÿ:\"y\",Æ:\"Ae\",æ:\"ae\",Þ:\"Th\",þ:\"th\",ß:\"ss\",Ā:\"A\",Ă:\"A\",Ą:\"A\",ā:\"a\",ă:\"a\",ą:\"a\",Ć:\"C\",Ĉ:\"C\",Ċ:\"C\",Č:\"C\",ć:\"c\",ĉ:\"c\",ċ:\"c\",č:\"c\",Ď:\"D\",Đ:\"D\",ď:\"d\",đ:\"d\",Ē:\"E\",Ĕ:\"E\",Ė:\"E\",Ę:\"E\",Ě:\"E\",ē:\"e\",ĕ:\"e\",ė:\"e\",ę:\"e\",ě:\"e\",Ĝ:\"G\",Ğ:\"G\",Ġ:\"G\",Ģ:\"G\",ĝ:\"g\",ğ:\"g\",ġ:\"g\",ģ:\"g\",Ĥ:\"H\",Ħ:\"H\",ĥ:\"h\",ħ:\"h\",Ĩ:\"I\",Ī:\"I\",Ĭ:\"I\",Į:\"I\",İ:\"I\",ĩ:\"i\",ī:\"i\",ĭ:\"i\",į:\"i\",ı:\"i\",Ĵ:\"J\",ĵ:\"j\",Ķ:\"K\",ķ:\"k\",ĸ:\"k\",Ĺ:\"L\",Ļ:\"L\",Ľ:\"L\",Ŀ:\"L\",Ł:\"L\",ĺ:\"l\",ļ:\"l\",ľ:\"l\",ŀ:\"l\",ł:\"l\",Ń:\"N\",Ņ:\"N\",Ň:\"N\",Ŋ:\"N\",ń:\"n\",ņ:\"n\",ň:\"n\",ŋ:\"n\",Ō:\"O\",Ŏ:\"O\",Ő:\"O\",ō:\"o\",ŏ:\"o\",ő:\"o\",Ŕ:\"R\",Ŗ:\"R\",Ř:\"R\",ŕ:\"r\",ŗ:\"r\",ř:\"r\",Ś:\"S\",Ŝ:\"S\",Ş:\"S\",Š:\"S\",ś:\"s\",ŝ:\"s\",ş:\"s\",š:\"s\",Ţ:\"T\",Ť:\"T\",Ŧ:\"T\",ţ:\"t\",ť:\"t\",ŧ:\"t\",Ũ:\"U\",Ū:\"U\",Ŭ:\"U\",Ů:\"U\",Ű:\"U\",Ų:\"U\",ũ:\"u\",ū:\"u\",ŭ:\"u\",ů:\"u\",ű:\"u\",ų:\"u\",Ŵ:\"W\",ŵ:\"w\",Ŷ:\"Y\",ŷ:\"y\",Ÿ:\"Y\",Ź:\"Z\",Ż:\"Z\",Ž:\"Z\",ź:\"z\",ż:\"z\",ž:\"z\",Ĳ:\"IJ\",ĳ:\"ij\",Œ:\"Oe\",œ:\"oe\",ŉ:\"'n\",ſ:\"s\"});o.exports=u},93243:(o,s,i)=>{var u=i(56110),_=function(){try{var o=u(Object,\"defineProperty\");return o({},\"\",{}),o}catch(o){}}();o.exports=_},25911:(o,s,i)=>{var u=i(38859),_=i(14248),w=i(19219);o.exports=function equalArrays(o,s,i,x,C,j){var L=1&i,B=o.length,$=s.length;if(B!=$&&!(L&&$>B))return!1;var V=j.get(o),U=j.get(s);if(V&&U)return V==s&&U==o;var z=-1,Y=!0,Z=2&i?new u:void 0;for(j.set(o,s),j.set(s,o);++z<B;){var ee=o[z],ie=s[z];if(x)var ae=L?x(ie,ee,z,s,o,j):x(ee,ie,z,o,s,j);if(void 0!==ae){if(ae)continue;Y=!1;break}if(Z){if(!_(s,(function(o,s){if(!w(Z,s)&&(ee===o||C(ee,o,i,x,j)))return Z.push(s)}))){Y=!1;break}}else if(ee!==ie&&!C(ee,ie,i,x,j)){Y=!1;break}}return j.delete(o),j.delete(s),Y}},21986:(o,s,i)=>{var u=i(51873),_=i(37828),w=i(75288),x=i(25911),C=i(20317),j=i(84247),L=u?u.prototype:void 0,B=L?L.valueOf:void 0;o.exports=function equalByTag(o,s,i,u,L,$,V){switch(i){case\"[object DataView]\":if(o.byteLength!=s.byteLength||o.byteOffset!=s.byteOffset)return!1;o=o.buffer,s=s.buffer;case\"[object ArrayBuffer]\":return!(o.byteLength!=s.byteLength||!$(new _(o),new _(s)));case\"[object Boolean]\":case\"[object Date]\":case\"[object Number]\":return w(+o,+s);case\"[object Error]\":return o.name==s.name&&o.message==s.message;case\"[object RegExp]\":case\"[object String]\":return o==s+\"\";case\"[object Map]\":var U=C;case\"[object Set]\":var z=1&u;if(U||(U=j),o.size!=s.size&&!z)return!1;var Y=V.get(o);if(Y)return Y==s;u|=2,V.set(o,s);var Z=x(U(o),U(s),u,L,$,V);return V.delete(o),Z;case\"[object Symbol]\":if(B)return B.call(o)==B.call(s)}return!1}},50689:(o,s,i)=>{var u=i(50002),_=Object.prototype.hasOwnProperty;o.exports=function equalObjects(o,s,i,w,x,C){var j=1&i,L=u(o),B=L.length;if(B!=u(s).length&&!j)return!1;for(var $=B;$--;){var V=L[$];if(!(j?V in s:_.call(s,V)))return!1}var U=C.get(o),z=C.get(s);if(U&&z)return U==s&&z==o;var Y=!0;C.set(o,s),C.set(s,o);for(var Z=j;++$<B;){var ee=o[V=L[$]],ie=s[V];if(w)var ae=j?w(ie,ee,V,s,o,C):w(ee,ie,V,o,s,C);if(!(void 0===ae?ee===ie||x(ee,ie,i,w,C):ae)){Y=!1;break}Z||(Z=\"constructor\"==V)}if(Y&&!Z){var ce=o.constructor,le=s.constructor;ce==le||!(\"constructor\"in o)||!(\"constructor\"in s)||\"function\"==typeof ce&&ce instanceof ce&&\"function\"==typeof le&&le instanceof le||(Y=!1)}return C.delete(o),C.delete(s),Y}},38816:(o,s,i)=>{var u=i(35970),_=i(56757),w=i(32865);o.exports=function flatRest(o){return w(_(o,void 0,u),o+\"\")}},34840:(o,s,i)=>{var u=\"object\"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;o.exports=u},50002:(o,s,i)=>{var u=i(82199),_=i(4664),w=i(95950);o.exports=function getAllKeys(o){return u(o,w,_)}},83349:(o,s,i)=>{var u=i(82199),_=i(86375),w=i(37241);o.exports=function getAllKeysIn(o){return u(o,w,_)}},37381:(o,s,i)=>{var u=i(48152),_=i(63950),w=u?function(o){return u.get(o)}:_;o.exports=w},62284:(o,s,i)=>{var u=i(84629),_=Object.prototype.hasOwnProperty;o.exports=function getFuncName(o){for(var s=o.name+\"\",i=u[s],w=_.call(u,s)?i.length:0;w--;){var x=i[w],C=x.func;if(null==C||C==o)return x.name}return s}},11287:o=>{o.exports=function getHolder(o){return o.placeholder}},12651:(o,s,i)=>{var u=i(74218);o.exports=function getMapData(o,s){var i=o.__data__;return u(s)?i[\"string\"==typeof s?\"string\":\"hash\"]:i.map}},10776:(o,s,i)=>{var u=i(30756),_=i(95950);o.exports=function getMatchData(o){for(var s=_(o),i=s.length;i--;){var w=s[i],x=o[w];s[i]=[w,x,u(x)]}return s}},56110:(o,s,i)=>{var u=i(45083),_=i(10392);o.exports=function getNative(o,s){var i=_(o,s);return u(i)?i:void 0}},28879:(o,s,i)=>{var u=i(74335)(Object.getPrototypeOf,Object);o.exports=u},659:(o,s,i)=>{var u=i(51873),_=Object.prototype,w=_.hasOwnProperty,x=_.toString,C=u?u.toStringTag:void 0;o.exports=function getRawTag(o){var s=w.call(o,C),i=o[C];try{o[C]=void 0;var u=!0}catch(o){}var _=x.call(o);return u&&(s?o[C]=i:delete o[C]),_}},4664:(o,s,i)=>{var u=i(79770),_=i(63345),w=Object.prototype.propertyIsEnumerable,x=Object.getOwnPropertySymbols,C=x?function(o){return null==o?[]:(o=Object(o),u(x(o),(function(s){return w.call(o,s)})))}:_;o.exports=C},86375:(o,s,i)=>{var u=i(14528),_=i(28879),w=i(4664),x=i(63345),C=Object.getOwnPropertySymbols?function(o){for(var s=[];o;)u(s,w(o)),o=_(o);return s}:x;o.exports=C},5861:(o,s,i)=>{var u=i(55580),_=i(68223),w=i(32804),x=i(76545),C=i(28303),j=i(72552),L=i(47473),B=\"[object Map]\",$=\"[object Promise]\",V=\"[object Set]\",U=\"[object WeakMap]\",z=\"[object DataView]\",Y=L(u),Z=L(_),ee=L(w),ie=L(x),ae=L(C),ce=j;(u&&ce(new u(new ArrayBuffer(1)))!=z||_&&ce(new _)!=B||w&&ce(w.resolve())!=$||x&&ce(new x)!=V||C&&ce(new C)!=U)&&(ce=function(o){var s=j(o),i=\"[object Object]\"==s?o.constructor:void 0,u=i?L(i):\"\";if(u)switch(u){case Y:return z;case Z:return B;case ee:return $;case ie:return V;case ae:return U}return s}),o.exports=ce},10392:o=>{o.exports=function getValue(o,s){return null==o?void 0:o[s]}},75251:o=>{var s=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,i=/,? & /;o.exports=function getWrapDetails(o){var u=o.match(s);return u?u[1].split(i):[]}},49326:(o,s,i)=>{var u=i(31769),_=i(72428),w=i(56449),x=i(30361),C=i(30294),j=i(77797);o.exports=function hasPath(o,s,i){for(var L=-1,B=(s=u(s,o)).length,$=!1;++L<B;){var V=j(s[L]);if(!($=null!=o&&i(o,V)))break;o=o[V]}return $||++L!=B?$:!!(B=null==o?0:o.length)&&C(B)&&x(V,B)&&(w(o)||_(o))}},49698:o=>{var s=RegExp(\"[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]\");o.exports=function hasUnicode(o){return s.test(o)}},45434:o=>{var s=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;o.exports=function hasUnicodeWord(o){return s.test(o)}},22032:(o,s,i)=>{var u=i(81042);o.exports=function hashClear(){this.__data__=u?u(null):{},this.size=0}},63862:o=>{o.exports=function hashDelete(o){var s=this.has(o)&&delete this.__data__[o];return this.size-=s?1:0,s}},66721:(o,s,i)=>{var u=i(81042),_=Object.prototype.hasOwnProperty;o.exports=function hashGet(o){var s=this.__data__;if(u){var i=s[o];return\"__lodash_hash_undefined__\"===i?void 0:i}return _.call(s,o)?s[o]:void 0}},12749:(o,s,i)=>{var u=i(81042),_=Object.prototype.hasOwnProperty;o.exports=function hashHas(o){var s=this.__data__;return u?void 0!==s[o]:_.call(s,o)}},35749:(o,s,i)=>{var u=i(81042);o.exports=function hashSet(o,s){var i=this.__data__;return this.size+=this.has(o)?0:1,i[o]=u&&void 0===s?\"__lodash_hash_undefined__\":s,this}},76189:o=>{var s=Object.prototype.hasOwnProperty;o.exports=function initCloneArray(o){var i=o.length,u=new o.constructor(i);return i&&\"string\"==typeof o[0]&&s.call(o,\"index\")&&(u.index=o.index,u.input=o.input),u}},77199:(o,s,i)=>{var u=i(49653),_=i(76169),w=i(73201),x=i(93736),C=i(71961);o.exports=function initCloneByTag(o,s,i){var j=o.constructor;switch(s){case\"[object ArrayBuffer]\":return u(o);case\"[object Boolean]\":case\"[object Date]\":return new j(+o);case\"[object DataView]\":return _(o,i);case\"[object Float32Array]\":case\"[object Float64Array]\":case\"[object Int8Array]\":case\"[object Int16Array]\":case\"[object Int32Array]\":case\"[object Uint8Array]\":case\"[object Uint8ClampedArray]\":case\"[object Uint16Array]\":case\"[object Uint32Array]\":return C(o,i);case\"[object Map]\":case\"[object Set]\":return new j;case\"[object Number]\":case\"[object String]\":return new j(o);case\"[object RegExp]\":return w(o);case\"[object Symbol]\":return x(o)}}},35529:(o,s,i)=>{var u=i(39344),_=i(28879),w=i(55527);o.exports=function initCloneObject(o){return\"function\"!=typeof o.constructor||w(o)?{}:u(_(o))}},62060:o=>{var s=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;o.exports=function insertWrapDetails(o,i){var u=i.length;if(!u)return o;var _=u-1;return i[_]=(u>1?\"& \":\"\")+i[_],i=i.join(u>2?\", \":\" \"),o.replace(s,\"{\\n/* [wrapped with \"+i+\"] */\\n\")}},45891:(o,s,i)=>{var u=i(51873),_=i(72428),w=i(56449),x=u?u.isConcatSpreadable:void 0;o.exports=function isFlattenable(o){return w(o)||_(o)||!!(x&&o&&o[x])}},30361:o=>{var s=/^(?:0|[1-9]\\d*)$/;o.exports=function isIndex(o,i){var u=typeof o;return!!(i=null==i?9007199254740991:i)&&(\"number\"==u||\"symbol\"!=u&&s.test(o))&&o>-1&&o%1==0&&o<i}},36800:(o,s,i)=>{var u=i(75288),_=i(64894),w=i(30361),x=i(23805);o.exports=function isIterateeCall(o,s,i){if(!x(i))return!1;var C=typeof s;return!!(\"number\"==C?_(i)&&w(s,i.length):\"string\"==C&&s in i)&&u(i[s],o)}},28586:(o,s,i)=>{var u=i(56449),_=i(44394),w=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,x=/^\\w*$/;o.exports=function isKey(o,s){if(u(o))return!1;var i=typeof o;return!(\"number\"!=i&&\"symbol\"!=i&&\"boolean\"!=i&&null!=o&&!_(o))||(x.test(o)||!w.test(o)||null!=s&&o in Object(s))}},74218:o=>{o.exports=function isKeyable(o){var s=typeof o;return\"string\"==s||\"number\"==s||\"symbol\"==s||\"boolean\"==s?\"__proto__\"!==o:null===o}},85087:(o,s,i)=>{var u=i(30980),_=i(37381),w=i(62284),x=i(53758);o.exports=function isLaziable(o){var s=w(o),i=x[s];if(\"function\"!=typeof i||!(s in u.prototype))return!1;if(o===i)return!0;var C=_(i);return!!C&&o===C[0]}},87296:(o,s,i)=>{var u,_=i(55481),w=(u=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+u:\"\";o.exports=function isMasked(o){return!!w&&w in o}},55527:o=>{var s=Object.prototype;o.exports=function isPrototype(o){var i=o&&o.constructor;return o===(\"function\"==typeof i&&i.prototype||s)}},30756:(o,s,i)=>{var u=i(23805);o.exports=function isStrictComparable(o){return o==o&&!u(o)}},63702:o=>{o.exports=function listCacheClear(){this.__data__=[],this.size=0}},70080:(o,s,i)=>{var u=i(26025),_=Array.prototype.splice;o.exports=function listCacheDelete(o){var s=this.__data__,i=u(s,o);return!(i<0)&&(i==s.length-1?s.pop():_.call(s,i,1),--this.size,!0)}},24739:(o,s,i)=>{var u=i(26025);o.exports=function listCacheGet(o){var s=this.__data__,i=u(s,o);return i<0?void 0:s[i][1]}},48655:(o,s,i)=>{var u=i(26025);o.exports=function listCacheHas(o){return u(this.__data__,o)>-1}},31175:(o,s,i)=>{var u=i(26025);o.exports=function listCacheSet(o,s){var i=this.__data__,_=u(i,o);return _<0?(++this.size,i.push([o,s])):i[_][1]=s,this}},63040:(o,s,i)=>{var u=i(21549),_=i(80079),w=i(68223);o.exports=function mapCacheClear(){this.size=0,this.__data__={hash:new u,map:new(w||_),string:new u}}},17670:(o,s,i)=>{var u=i(12651);o.exports=function mapCacheDelete(o){var s=u(this,o).delete(o);return this.size-=s?1:0,s}},90289:(o,s,i)=>{var u=i(12651);o.exports=function mapCacheGet(o){return u(this,o).get(o)}},4509:(o,s,i)=>{var u=i(12651);o.exports=function mapCacheHas(o){return u(this,o).has(o)}},72949:(o,s,i)=>{var u=i(12651);o.exports=function mapCacheSet(o,s){var i=u(this,o),_=i.size;return i.set(o,s),this.size+=i.size==_?0:1,this}},20317:o=>{o.exports=function mapToArray(o){var s=-1,i=Array(o.size);return o.forEach((function(o,u){i[++s]=[u,o]})),i}},67197:o=>{o.exports=function matchesStrictComparable(o,s){return function(i){return null!=i&&(i[o]===s&&(void 0!==s||o in Object(i)))}}},62224:(o,s,i)=>{var u=i(50104);o.exports=function memoizeCapped(o){var s=u(o,(function(o){return 500===i.size&&i.clear(),o})),i=s.cache;return s}},3209:(o,s,i)=>{var u=i(91596),_=i(53320),w=i(36306),x=\"__lodash_placeholder__\",C=128,j=Math.min;o.exports=function mergeData(o,s){var i=o[1],L=s[1],B=i|L,$=B<131,V=L==C&&8==i||L==C&&256==i&&o[7].length<=s[8]||384==L&&s[7].length<=s[8]&&8==i;if(!$&&!V)return o;1&L&&(o[2]=s[2],B|=1&i?0:4);var U=s[3];if(U){var z=o[3];o[3]=z?u(z,U,s[4]):U,o[4]=z?w(o[3],x):s[4]}return(U=s[5])&&(z=o[5],o[5]=z?_(z,U,s[6]):U,o[6]=z?w(o[5],x):s[6]),(U=s[7])&&(o[7]=U),L&C&&(o[8]=null==o[8]?s[8]:j(o[8],s[8])),null==o[9]&&(o[9]=s[9]),o[0]=s[0],o[1]=B,o}},48152:(o,s,i)=>{var u=i(28303),_=u&&new u;o.exports=_},81042:(o,s,i)=>{var u=i(56110)(Object,\"create\");o.exports=u},3650:(o,s,i)=>{var u=i(74335)(Object.keys,Object);o.exports=u},90181:o=>{o.exports=function nativeKeysIn(o){var s=[];if(null!=o)for(var i in Object(o))s.push(i);return s}},86009:(o,s,i)=>{o=i.nmd(o);var u=i(34840),_=s&&!s.nodeType&&s,w=_&&o&&!o.nodeType&&o,x=w&&w.exports===_&&u.process,C=function(){try{var o=w&&w.require&&w.require(\"util\").types;return o||x&&x.binding&&x.binding(\"util\")}catch(o){}}();o.exports=C},59350:o=>{var s=Object.prototype.toString;o.exports=function objectToString(o){return s.call(o)}},74335:o=>{o.exports=function overArg(o,s){return function(i){return o(s(i))}}},56757:(o,s,i)=>{var u=i(91033),_=Math.max;o.exports=function overRest(o,s,i){return s=_(void 0===s?o.length-1:s,0),function(){for(var w=arguments,x=-1,C=_(w.length-s,0),j=Array(C);++x<C;)j[x]=w[s+x];x=-1;for(var L=Array(s+1);++x<s;)L[x]=w[x];return L[s]=i(j),u(o,this,L)}}},68969:(o,s,i)=>{var u=i(47422),_=i(25160);o.exports=function parent(o,s){return s.length<2?o:u(o,_(s,0,-1))}},84629:o=>{o.exports={}},68294:(o,s,i)=>{var u=i(23007),_=i(30361),w=Math.min;o.exports=function reorder(o,s){for(var i=o.length,x=w(s.length,i),C=u(o);x--;){var j=s[x];o[x]=_(j,i)?C[j]:void 0}return o}},36306:o=>{var s=\"__lodash_placeholder__\";o.exports=function replaceHolders(o,i){for(var u=-1,_=o.length,w=0,x=[];++u<_;){var C=o[u];C!==i&&C!==s||(o[u]=s,x[w++]=u)}return x}},9325:(o,s,i)=>{var u=i(34840),_=\"object\"==typeof self&&self&&self.Object===Object&&self,w=u||_||Function(\"return this\")();o.exports=w},14974:o=>{o.exports=function safeGet(o,s){if((\"constructor\"!==s||\"function\"!=typeof o[s])&&\"__proto__\"!=s)return o[s]}},31380:o=>{o.exports=function setCacheAdd(o){return this.__data__.set(o,\"__lodash_hash_undefined__\"),this}},51459:o=>{o.exports=function setCacheHas(o){return this.__data__.has(o)}},54641:(o,s,i)=>{var u=i(68882),_=i(51811)(u);o.exports=_},84247:o=>{o.exports=function setToArray(o){var s=-1,i=Array(o.size);return o.forEach((function(o){i[++s]=o})),i}},32865:(o,s,i)=>{var u=i(19570),_=i(51811)(u);o.exports=_},70981:(o,s,i)=>{var u=i(75251),_=i(62060),w=i(32865),x=i(75948);o.exports=function setWrapToString(o,s,i){var C=s+\"\";return w(o,_(C,x(u(C),i)))}},51811:o=>{var s=Date.now;o.exports=function shortOut(o){var i=0,u=0;return function(){var _=s(),w=16-(_-u);if(u=_,w>0){if(++i>=800)return arguments[0]}else i=0;return o.apply(void 0,arguments)}}},51420:(o,s,i)=>{var u=i(80079);o.exports=function stackClear(){this.__data__=new u,this.size=0}},90938:o=>{o.exports=function stackDelete(o){var s=this.__data__,i=s.delete(o);return this.size=s.size,i}},63605:o=>{o.exports=function stackGet(o){return this.__data__.get(o)}},29817:o=>{o.exports=function stackHas(o){return this.__data__.has(o)}},80945:(o,s,i)=>{var u=i(80079),_=i(68223),w=i(53661);o.exports=function stackSet(o,s){var i=this.__data__;if(i instanceof u){var x=i.__data__;if(!_||x.length<199)return x.push([o,s]),this.size=++i.size,this;i=this.__data__=new w(x)}return i.set(o,s),this.size=i.size,this}},76959:o=>{o.exports=function strictIndexOf(o,s,i){for(var u=i-1,_=o.length;++u<_;)if(o[u]===s)return u;return-1}},63912:(o,s,i)=>{var u=i(61074),_=i(49698),w=i(42054);o.exports=function stringToArray(o){return _(o)?w(o):u(o)}},61802:(o,s,i)=>{var u=i(62224),_=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,w=/\\\\(\\\\)?/g,x=u((function(o){var s=[];return 46===o.charCodeAt(0)&&s.push(\"\"),o.replace(_,(function(o,i,u,_){s.push(u?_.replace(w,\"$1\"):i||o)})),s}));o.exports=x},77797:(o,s,i)=>{var u=i(44394);o.exports=function toKey(o){if(\"string\"==typeof o||u(o))return o;var s=o+\"\";return\"0\"==s&&1/o==-1/0?\"-0\":s}},47473:o=>{var s=Function.prototype.toString;o.exports=function toSource(o){if(null!=o){try{return s.call(o)}catch(o){}try{return o+\"\"}catch(o){}}return\"\"}},31800:o=>{var s=/\\s/;o.exports=function trimmedEndIndex(o){for(var i=o.length;i--&&s.test(o.charAt(i)););return i}},42054:o=>{var s=\"\\\\ud800-\\\\udfff\",i=\"[\"+s+\"]\",u=\"[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]\",_=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",w=\"[^\"+s+\"]\",x=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",C=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",j=\"(?:\"+u+\"|\"+_+\")\"+\"?\",L=\"[\\\\ufe0e\\\\ufe0f]?\",B=L+j+(\"(?:\\\\u200d(?:\"+[w,x,C].join(\"|\")+\")\"+L+j+\")*\"),$=\"(?:\"+[w+u+\"?\",u,x,C,i].join(\"|\")+\")\",V=RegExp(_+\"(?=\"+_+\")|\"+$+B,\"g\");o.exports=function unicodeToArray(o){return o.match(V)||[]}},22225:o=>{var s=\"\\\\ud800-\\\\udfff\",i=\"\\\\u2700-\\\\u27bf\",u=\"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\",_=\"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\",w=\"\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\",x=\"[\"+w+\"]\",C=\"\\\\d+\",j=\"[\"+i+\"]\",L=\"[\"+u+\"]\",B=\"[^\"+s+w+C+i+u+_+\"]\",$=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",V=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",U=\"[\"+_+\"]\",z=\"(?:\"+L+\"|\"+B+\")\",Y=\"(?:\"+U+\"|\"+B+\")\",Z=\"(?:['’](?:d|ll|m|re|s|t|ve))?\",ee=\"(?:['’](?:D|LL|M|RE|S|T|VE))?\",ie=\"(?:[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]|\\\\ud83c[\\\\udffb-\\\\udfff])?\",ae=\"[\\\\ufe0e\\\\ufe0f]?\",ce=ae+ie+(\"(?:\\\\u200d(?:\"+[\"[^\"+s+\"]\",$,V].join(\"|\")+\")\"+ae+ie+\")*\"),le=\"(?:\"+[j,$,V].join(\"|\")+\")\"+ce,pe=RegExp([U+\"?\"+L+\"+\"+Z+\"(?=\"+[x,U,\"$\"].join(\"|\")+\")\",Y+\"+\"+ee+\"(?=\"+[x,U+z,\"$\"].join(\"|\")+\")\",U+\"?\"+z+\"+\"+Z,U+\"+\"+ee,\"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\",\"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\",C,le].join(\"|\"),\"g\");o.exports=function unicodeWords(o){return o.match(pe)||[]}},75948:(o,s,i)=>{var u=i(83729),_=i(15325),w=[[\"ary\",128],[\"bind\",1],[\"bindKey\",2],[\"curry\",8],[\"curryRight\",16],[\"flip\",512],[\"partial\",32],[\"partialRight\",64],[\"rearg\",256]];o.exports=function updateWrapDetails(o,s){return u(w,(function(i){var u=\"_.\"+i[0];s&i[1]&&!_(o,u)&&o.push(u)})),o.sort()}},80257:(o,s,i)=>{var u=i(30980),_=i(56017),w=i(23007);o.exports=function wrapperClone(o){if(o instanceof u)return o.clone();var s=new _(o.__wrapped__,o.__chain__);return s.__actions__=w(o.__actions__),s.__index__=o.__index__,s.__values__=o.__values__,s}},64626:(o,s,i)=>{var u=i(66977);o.exports=function ary(o,s,i){return s=i?void 0:s,s=o&&null==s?o.length:s,u(o,128,void 0,void 0,void 0,void 0,s)}},84058:(o,s,i)=>{var u=i(14792),_=i(45539)((function(o,s,i){return s=s.toLowerCase(),o+(i?u(s):s)}));o.exports=_},14792:(o,s,i)=>{var u=i(13222),_=i(55808);o.exports=function capitalize(o){return _(u(o).toLowerCase())}},32629:(o,s,i)=>{var u=i(9999);o.exports=function clone(o){return u(o,4)}},37334:o=>{o.exports=function constant(o){return function(){return o}}},49747:(o,s,i)=>{var u=i(66977);function curry(o,s,i){var _=u(o,8,void 0,void 0,void 0,void 0,void 0,s=i?void 0:s);return _.placeholder=curry.placeholder,_}curry.placeholder={},o.exports=curry},38221:(o,s,i)=>{var u=i(23805),_=i(10124),w=i(99374),x=Math.max,C=Math.min;o.exports=function debounce(o,s,i){var j,L,B,$,V,U,z=0,Y=!1,Z=!1,ee=!0;if(\"function\"!=typeof o)throw new TypeError(\"Expected a function\");function invokeFunc(s){var i=j,u=L;return j=L=void 0,z=s,$=o.apply(u,i)}function shouldInvoke(o){var i=o-U;return void 0===U||i>=s||i<0||Z&&o-z>=B}function timerExpired(){var o=_();if(shouldInvoke(o))return trailingEdge(o);V=setTimeout(timerExpired,function remainingWait(o){var i=s-(o-U);return Z?C(i,B-(o-z)):i}(o))}function trailingEdge(o){return V=void 0,ee&&j?invokeFunc(o):(j=L=void 0,$)}function debounced(){var o=_(),i=shouldInvoke(o);if(j=arguments,L=this,U=o,i){if(void 0===V)return function leadingEdge(o){return z=o,V=setTimeout(timerExpired,s),Y?invokeFunc(o):$}(U);if(Z)return clearTimeout(V),V=setTimeout(timerExpired,s),invokeFunc(U)}return void 0===V&&(V=setTimeout(timerExpired,s)),$}return s=w(s)||0,u(i)&&(Y=!!i.leading,B=(Z=\"maxWait\"in i)?x(w(i.maxWait)||0,s):B,ee=\"trailing\"in i?!!i.trailing:ee),debounced.cancel=function cancel(){void 0!==V&&clearTimeout(V),z=0,j=U=L=V=void 0},debounced.flush=function flush(){return void 0===V?$:trailingEdge(_())},debounced}},50828:(o,s,i)=>{var u=i(24647),_=i(13222),w=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,x=RegExp(\"[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]\",\"g\");o.exports=function deburr(o){return(o=_(o))&&o.replace(w,u).replace(x,\"\")}},75288:o=>{o.exports=function eq(o,s){return o===s||o!=o&&s!=s}},60680:(o,s,i)=>{var u=i(13222),_=/[\\\\^$.*+?()[\\]{}|]/g,w=RegExp(_.source);o.exports=function escapeRegExp(o){return(o=u(o))&&w.test(o)?o.replace(_,\"\\\\$&\"):o}},7309:(o,s,i)=>{var u=i(62006)(i(24713));o.exports=u},24713:(o,s,i)=>{var u=i(2523),_=i(15389),w=i(61489),x=Math.max;o.exports=function findIndex(o,s,i){var C=null==o?0:o.length;if(!C)return-1;var j=null==i?0:w(i);return j<0&&(j=x(C+j,0)),u(o,_(s,3),j)}},35970:(o,s,i)=>{var u=i(83120);o.exports=function flatten(o){return(null==o?0:o.length)?u(o,1):[]}},73424:(o,s,i)=>{var u=i(16962),_=i(2874),w=Array.prototype.push;function baseAry(o,s){return 2==s?function(s,i){return o(s,i)}:function(s){return o(s)}}function cloneArray(o){for(var s=o?o.length:0,i=Array(s);s--;)i[s]=o[s];return i}function wrapImmutable(o,s){return function(){var i=arguments.length;if(i){for(var u=Array(i);i--;)u[i]=arguments[i];var _=u[0]=s.apply(void 0,u);return o.apply(void 0,u),_}}}o.exports=function baseConvert(o,s,i,x){var C=\"function\"==typeof s,j=s===Object(s);if(j&&(x=i,i=s,s=void 0),null==i)throw new TypeError;x||(x={});var L={cap:!(\"cap\"in x)||x.cap,curry:!(\"curry\"in x)||x.curry,fixed:!(\"fixed\"in x)||x.fixed,immutable:!(\"immutable\"in x)||x.immutable,rearg:!(\"rearg\"in x)||x.rearg},B=C?i:_,$=\"curry\"in x&&x.curry,V=\"fixed\"in x&&x.fixed,U=\"rearg\"in x&&x.rearg,z=C?i.runInContext():void 0,Y=C?i:{ary:o.ary,assign:o.assign,clone:o.clone,curry:o.curry,forEach:o.forEach,isArray:o.isArray,isError:o.isError,isFunction:o.isFunction,isWeakMap:o.isWeakMap,iteratee:o.iteratee,keys:o.keys,rearg:o.rearg,toInteger:o.toInteger,toPath:o.toPath},Z=Y.ary,ee=Y.assign,ie=Y.clone,ae=Y.curry,ce=Y.forEach,le=Y.isArray,pe=Y.isError,de=Y.isFunction,fe=Y.isWeakMap,ye=Y.keys,be=Y.rearg,_e=Y.toInteger,we=Y.toPath,Se=ye(u.aryMethod),xe={castArray:function(o){return function(){var s=arguments[0];return le(s)?o(cloneArray(s)):o.apply(void 0,arguments)}},iteratee:function(o){return function(){var s=arguments[1],i=o(arguments[0],s),u=i.length;return L.cap&&\"number\"==typeof s?(s=s>2?s-2:1,u&&u<=s?i:baseAry(i,s)):i}},mixin:function(o){return function(s){var i=this;if(!de(i))return o(i,Object(s));var u=[];return ce(ye(s),(function(o){de(s[o])&&u.push([o,i.prototype[o]])})),o(i,Object(s)),ce(u,(function(o){var s=o[1];de(s)?i.prototype[o[0]]=s:delete i.prototype[o[0]]})),i}},nthArg:function(o){return function(s){var i=s<0?1:_e(s)+1;return ae(o(s),i)}},rearg:function(o){return function(s,i){var u=i?i.length:0;return ae(o(s,i),u)}},runInContext:function(s){return function(i){return baseConvert(o,s(i),x)}}};function castCap(o,s){if(L.cap){var i=u.iterateeRearg[o];if(i)return function iterateeRearg(o,s){return overArg(o,(function(o){var i=s.length;return function baseArity(o,s){return 2==s?function(s,i){return o.apply(void 0,arguments)}:function(s){return o.apply(void 0,arguments)}}(be(baseAry(o,i),s),i)}))}(s,i);var _=!C&&u.iterateeAry[o];if(_)return function iterateeAry(o,s){return overArg(o,(function(o){return\"function\"==typeof o?baseAry(o,s):o}))}(s,_)}return s}function castFixed(o,s,i){if(L.fixed&&(V||!u.skipFixed[o])){var _=u.methodSpread[o],x=_&&_.start;return void 0===x?Z(s,i):function flatSpread(o,s){return function(){for(var i=arguments.length,u=i-1,_=Array(i);i--;)_[i]=arguments[i];var x=_[s],C=_.slice(0,s);return x&&w.apply(C,x),s!=u&&w.apply(C,_.slice(s+1)),o.apply(this,C)}}(s,x)}return s}function castRearg(o,s,i){return L.rearg&&i>1&&(U||!u.skipRearg[o])?be(s,u.methodRearg[o]||u.aryRearg[i]):s}function cloneByPath(o,s){for(var i=-1,u=(s=we(s)).length,_=u-1,w=ie(Object(o)),x=w;null!=x&&++i<u;){var C=s[i],j=x[C];null==j||de(j)||pe(j)||fe(j)||(x[C]=ie(i==_?j:Object(j))),x=x[C]}return w}function createConverter(o,s){var i=u.aliasToReal[o]||o,_=u.remap[i]||i,w=x;return function(o){var u=C?z:Y,x=C?z[_]:s,j=ee(ee({},w),o);return baseConvert(u,i,x,j)}}function overArg(o,s){return function(){var i=arguments.length;if(!i)return o();for(var u=Array(i);i--;)u[i]=arguments[i];var _=L.rearg?0:i-1;return u[_]=s(u[_]),o.apply(void 0,u)}}function wrap(o,s,i){var _,w=u.aliasToReal[o]||o,x=s,C=xe[w];return C?x=C(s):L.immutable&&(u.mutate.array[w]?x=wrapImmutable(s,cloneArray):u.mutate.object[w]?x=wrapImmutable(s,function createCloner(o){return function(s){return o({},s)}}(s)):u.mutate.set[w]&&(x=wrapImmutable(s,cloneByPath))),ce(Se,(function(o){return ce(u.aryMethod[o],(function(s){if(w==s){var i=u.methodSpread[w],C=i&&i.afterRearg;return _=C?castFixed(w,castRearg(w,x,o),o):castRearg(w,castFixed(w,x,o),o),_=function castCurry(o,s,i){return $||L.curry&&i>1?ae(s,i):s}(0,_=castCap(w,_),o),!1}})),!_})),_||(_=x),_==s&&(_=$?ae(_,1):function(){return s.apply(this,arguments)}),_.convert=createConverter(w,s),_.placeholder=s.placeholder=i,_}if(!j)return wrap(s,i,B);var Pe=i,Te=[];return ce(Se,(function(o){ce(u.aryMethod[o],(function(o){var s=Pe[u.remap[o]||o];s&&Te.push([o,wrap(o,s,Pe)])}))})),ce(ye(Pe),(function(o){var s=Pe[o];if(\"function\"==typeof s){for(var i=Te.length;i--;)if(Te[i][0]==o)return;s.convert=createConverter(o,s),Te.push([o,s])}})),ce(Te,(function(o){Pe[o[0]]=o[1]})),Pe.convert=function convertLib(o){return Pe.runInContext.convert(o)(void 0)},Pe.placeholder=Pe,ce(ye(Pe),(function(o){ce(u.realToAlias[o]||[],(function(s){Pe[s]=Pe[o]}))})),Pe}},16962:(o,s)=>{s.aliasToReal={each:\"forEach\",eachRight:\"forEachRight\",entries:\"toPairs\",entriesIn:\"toPairsIn\",extend:\"assignIn\",extendAll:\"assignInAll\",extendAllWith:\"assignInAllWith\",extendWith:\"assignInWith\",first:\"head\",conforms:\"conformsTo\",matches:\"isMatch\",property:\"get\",__:\"placeholder\",F:\"stubFalse\",T:\"stubTrue\",all:\"every\",allPass:\"overEvery\",always:\"constant\",any:\"some\",anyPass:\"overSome\",apply:\"spread\",assoc:\"set\",assocPath:\"set\",complement:\"negate\",compose:\"flowRight\",contains:\"includes\",dissoc:\"unset\",dissocPath:\"unset\",dropLast:\"dropRight\",dropLastWhile:\"dropRightWhile\",equals:\"isEqual\",identical:\"eq\",indexBy:\"keyBy\",init:\"initial\",invertObj:\"invert\",juxt:\"over\",omitAll:\"omit\",nAry:\"ary\",path:\"get\",pathEq:\"matchesProperty\",pathOr:\"getOr\",paths:\"at\",pickAll:\"pick\",pipe:\"flow\",pluck:\"map\",prop:\"get\",propEq:\"matchesProperty\",propOr:\"getOr\",props:\"at\",symmetricDifference:\"xor\",symmetricDifferenceBy:\"xorBy\",symmetricDifferenceWith:\"xorWith\",takeLast:\"takeRight\",takeLastWhile:\"takeRightWhile\",unapply:\"rest\",unnest:\"flatten\",useWith:\"overArgs\",where:\"conformsTo\",whereEq:\"isMatch\",zipObj:\"zipObject\"},s.aryMethod={1:[\"assignAll\",\"assignInAll\",\"attempt\",\"castArray\",\"ceil\",\"create\",\"curry\",\"curryRight\",\"defaultsAll\",\"defaultsDeepAll\",\"floor\",\"flow\",\"flowRight\",\"fromPairs\",\"invert\",\"iteratee\",\"memoize\",\"method\",\"mergeAll\",\"methodOf\",\"mixin\",\"nthArg\",\"over\",\"overEvery\",\"overSome\",\"rest\",\"reverse\",\"round\",\"runInContext\",\"spread\",\"template\",\"trim\",\"trimEnd\",\"trimStart\",\"uniqueId\",\"words\",\"zipAll\"],2:[\"add\",\"after\",\"ary\",\"assign\",\"assignAllWith\",\"assignIn\",\"assignInAllWith\",\"at\",\"before\",\"bind\",\"bindAll\",\"bindKey\",\"chunk\",\"cloneDeepWith\",\"cloneWith\",\"concat\",\"conformsTo\",\"countBy\",\"curryN\",\"curryRightN\",\"debounce\",\"defaults\",\"defaultsDeep\",\"defaultTo\",\"delay\",\"difference\",\"divide\",\"drop\",\"dropRight\",\"dropRightWhile\",\"dropWhile\",\"endsWith\",\"eq\",\"every\",\"filter\",\"find\",\"findIndex\",\"findKey\",\"findLast\",\"findLastIndex\",\"findLastKey\",\"flatMap\",\"flatMapDeep\",\"flattenDepth\",\"forEach\",\"forEachRight\",\"forIn\",\"forInRight\",\"forOwn\",\"forOwnRight\",\"get\",\"groupBy\",\"gt\",\"gte\",\"has\",\"hasIn\",\"includes\",\"indexOf\",\"intersection\",\"invertBy\",\"invoke\",\"invokeMap\",\"isEqual\",\"isMatch\",\"join\",\"keyBy\",\"lastIndexOf\",\"lt\",\"lte\",\"map\",\"mapKeys\",\"mapValues\",\"matchesProperty\",\"maxBy\",\"meanBy\",\"merge\",\"mergeAllWith\",\"minBy\",\"multiply\",\"nth\",\"omit\",\"omitBy\",\"overArgs\",\"pad\",\"padEnd\",\"padStart\",\"parseInt\",\"partial\",\"partialRight\",\"partition\",\"pick\",\"pickBy\",\"propertyOf\",\"pull\",\"pullAll\",\"pullAt\",\"random\",\"range\",\"rangeRight\",\"rearg\",\"reject\",\"remove\",\"repeat\",\"restFrom\",\"result\",\"sampleSize\",\"some\",\"sortBy\",\"sortedIndex\",\"sortedIndexOf\",\"sortedLastIndex\",\"sortedLastIndexOf\",\"sortedUniqBy\",\"split\",\"spreadFrom\",\"startsWith\",\"subtract\",\"sumBy\",\"take\",\"takeRight\",\"takeRightWhile\",\"takeWhile\",\"tap\",\"throttle\",\"thru\",\"times\",\"trimChars\",\"trimCharsEnd\",\"trimCharsStart\",\"truncate\",\"union\",\"uniqBy\",\"uniqWith\",\"unset\",\"unzipWith\",\"without\",\"wrap\",\"xor\",\"zip\",\"zipObject\",\"zipObjectDeep\"],3:[\"assignInWith\",\"assignWith\",\"clamp\",\"differenceBy\",\"differenceWith\",\"findFrom\",\"findIndexFrom\",\"findLastFrom\",\"findLastIndexFrom\",\"getOr\",\"includesFrom\",\"indexOfFrom\",\"inRange\",\"intersectionBy\",\"intersectionWith\",\"invokeArgs\",\"invokeArgsMap\",\"isEqualWith\",\"isMatchWith\",\"flatMapDepth\",\"lastIndexOfFrom\",\"mergeWith\",\"orderBy\",\"padChars\",\"padCharsEnd\",\"padCharsStart\",\"pullAllBy\",\"pullAllWith\",\"rangeStep\",\"rangeStepRight\",\"reduce\",\"reduceRight\",\"replace\",\"set\",\"slice\",\"sortedIndexBy\",\"sortedLastIndexBy\",\"transform\",\"unionBy\",\"unionWith\",\"update\",\"xorBy\",\"xorWith\",\"zipWith\"],4:[\"fill\",\"setWith\",\"updateWith\"]},s.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},s.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},s.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},s.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},s.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},s.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},s.realToAlias=function(){var o=Object.prototype.hasOwnProperty,i=s.aliasToReal,u={};for(var _ in i){var w=i[_];o.call(u,w)?u[w].push(_):u[w]=[_]}return u}(),s.remap={assignAll:\"assign\",assignAllWith:\"assignWith\",assignInAll:\"assignIn\",assignInAllWith:\"assignInWith\",curryN:\"curry\",curryRightN:\"curryRight\",defaultsAll:\"defaults\",defaultsDeepAll:\"defaultsDeep\",findFrom:\"find\",findIndexFrom:\"findIndex\",findLastFrom:\"findLast\",findLastIndexFrom:\"findLastIndex\",getOr:\"get\",includesFrom:\"includes\",indexOfFrom:\"indexOf\",invokeArgs:\"invoke\",invokeArgsMap:\"invokeMap\",lastIndexOfFrom:\"lastIndexOf\",mergeAll:\"merge\",mergeAllWith:\"mergeWith\",padChars:\"pad\",padCharsEnd:\"padEnd\",padCharsStart:\"padStart\",propertyOf:\"get\",rangeStep:\"range\",rangeStepRight:\"rangeRight\",restFrom:\"rest\",spreadFrom:\"spread\",trimChars:\"trim\",trimCharsEnd:\"trimEnd\",trimCharsStart:\"trimStart\",zipAll:\"zip\"},s.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},s.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},47934:(o,s,i)=>{o.exports={ary:i(64626),assign:i(74733),clone:i(32629),curry:i(49747),forEach:i(83729),isArray:i(56449),isError:i(23546),isFunction:i(1882),isWeakMap:i(47886),iteratee:i(33855),keys:i(88984),rearg:i(84195),toInteger:i(61489),toPath:i(42072)}},56367:(o,s,i)=>{o.exports=i(77731)},79920:(o,s,i)=>{var u=i(73424),_=i(47934);o.exports=function convert(o,s,i){return u(_,o,s,i)}},2874:o=>{o.exports={}},77731:(o,s,i)=>{var u=i(79920)(\"set\",i(63560));u.placeholder=i(2874),o.exports=u},58156:(o,s,i)=>{var u=i(47422);o.exports=function get(o,s,i){var _=null==o?void 0:u(o,s);return void 0===_?i:_}},61448:(o,s,i)=>{var u=i(20426),_=i(49326);o.exports=function has(o,s){return null!=o&&_(o,s,u)}},80631:(o,s,i)=>{var u=i(28077),_=i(49326);o.exports=function hasIn(o,s){return null!=o&&_(o,s,u)}},83488:o=>{o.exports=function identity(o){return o}},72428:(o,s,i)=>{var u=i(27534),_=i(40346),w=Object.prototype,x=w.hasOwnProperty,C=w.propertyIsEnumerable,j=u(function(){return arguments}())?u:function(o){return _(o)&&x.call(o,\"callee\")&&!C.call(o,\"callee\")};o.exports=j},56449:o=>{var s=Array.isArray;o.exports=s},64894:(o,s,i)=>{var u=i(1882),_=i(30294);o.exports=function isArrayLike(o){return null!=o&&_(o.length)&&!u(o)}},83693:(o,s,i)=>{var u=i(64894),_=i(40346);o.exports=function isArrayLikeObject(o){return _(o)&&u(o)}},53812:(o,s,i)=>{var u=i(72552),_=i(40346);o.exports=function isBoolean(o){return!0===o||!1===o||_(o)&&\"[object Boolean]\"==u(o)}},3656:(o,s,i)=>{o=i.nmd(o);var u=i(9325),_=i(89935),w=s&&!s.nodeType&&s,x=w&&o&&!o.nodeType&&o,C=x&&x.exports===w?u.Buffer:void 0,j=(C?C.isBuffer:void 0)||_;o.exports=j},62193:(o,s,i)=>{var u=i(88984),_=i(5861),w=i(72428),x=i(56449),C=i(64894),j=i(3656),L=i(55527),B=i(37167),$=Object.prototype.hasOwnProperty;o.exports=function isEmpty(o){if(null==o)return!0;if(C(o)&&(x(o)||\"string\"==typeof o||\"function\"==typeof o.splice||j(o)||B(o)||w(o)))return!o.length;var s=_(o);if(\"[object Map]\"==s||\"[object Set]\"==s)return!o.size;if(L(o))return!u(o).length;for(var i in o)if($.call(o,i))return!1;return!0}},2404:(o,s,i)=>{var u=i(60270);o.exports=function isEqual(o,s){return u(o,s)}},23546:(o,s,i)=>{var u=i(72552),_=i(40346),w=i(11331);o.exports=function isError(o){if(!_(o))return!1;var s=u(o);return\"[object Error]\"==s||\"[object DOMException]\"==s||\"string\"==typeof o.message&&\"string\"==typeof o.name&&!w(o)}},1882:(o,s,i)=>{var u=i(72552),_=i(23805);o.exports=function isFunction(o){if(!_(o))return!1;var s=u(o);return\"[object Function]\"==s||\"[object GeneratorFunction]\"==s||\"[object AsyncFunction]\"==s||\"[object Proxy]\"==s}},30294:o=>{o.exports=function isLength(o){return\"number\"==typeof o&&o>-1&&o%1==0&&o<=9007199254740991}},87730:(o,s,i)=>{var u=i(29172),_=i(27301),w=i(86009),x=w&&w.isMap,C=x?_(x):u;o.exports=C},5187:o=>{o.exports=function isNull(o){return null===o}},98023:(o,s,i)=>{var u=i(72552),_=i(40346);o.exports=function isNumber(o){return\"number\"==typeof o||_(o)&&\"[object Number]\"==u(o)}},23805:o=>{o.exports=function isObject(o){var s=typeof o;return null!=o&&(\"object\"==s||\"function\"==s)}},40346:o=>{o.exports=function isObjectLike(o){return null!=o&&\"object\"==typeof o}},11331:(o,s,i)=>{var u=i(72552),_=i(28879),w=i(40346),x=Function.prototype,C=Object.prototype,j=x.toString,L=C.hasOwnProperty,B=j.call(Object);o.exports=function isPlainObject(o){if(!w(o)||\"[object Object]\"!=u(o))return!1;var s=_(o);if(null===s)return!0;var i=L.call(s,\"constructor\")&&s.constructor;return\"function\"==typeof i&&i instanceof i&&j.call(i)==B}},38440:(o,s,i)=>{var u=i(16038),_=i(27301),w=i(86009),x=w&&w.isSet,C=x?_(x):u;o.exports=C},85015:(o,s,i)=>{var u=i(72552),_=i(56449),w=i(40346);o.exports=function isString(o){return\"string\"==typeof o||!_(o)&&w(o)&&\"[object String]\"==u(o)}},44394:(o,s,i)=>{var u=i(72552),_=i(40346);o.exports=function isSymbol(o){return\"symbol\"==typeof o||_(o)&&\"[object Symbol]\"==u(o)}},37167:(o,s,i)=>{var u=i(4901),_=i(27301),w=i(86009),x=w&&w.isTypedArray,C=x?_(x):u;o.exports=C},47886:(o,s,i)=>{var u=i(5861),_=i(40346);o.exports=function isWeakMap(o){return _(o)&&\"[object WeakMap]\"==u(o)}},33855:(o,s,i)=>{var u=i(9999),_=i(15389);o.exports=function iteratee(o){return _(\"function\"==typeof o?o:u(o,1))}},95950:(o,s,i)=>{var u=i(70695),_=i(88984),w=i(64894);o.exports=function keys(o){return w(o)?u(o):_(o)}},37241:(o,s,i)=>{var u=i(70695),_=i(72903),w=i(64894);o.exports=function keysIn(o){return w(o)?u(o,!0):_(o)}},68090:o=>{o.exports=function last(o){var s=null==o?0:o.length;return s?o[s-1]:void 0}},50104:(o,s,i)=>{var u=i(53661);function memoize(o,s){if(\"function\"!=typeof o||null!=s&&\"function\"!=typeof s)throw new TypeError(\"Expected a function\");var memoized=function(){var i=arguments,u=s?s.apply(this,i):i[0],_=memoized.cache;if(_.has(u))return _.get(u);var w=o.apply(this,i);return memoized.cache=_.set(u,w)||_,w};return memoized.cache=new(memoize.Cache||u),memoized}memoize.Cache=u,o.exports=memoize},55364:(o,s,i)=>{var u=i(85250),_=i(20999)((function(o,s,i){u(o,s,i)}));o.exports=_},6048:o=>{o.exports=function negate(o){if(\"function\"!=typeof o)throw new TypeError(\"Expected a function\");return function(){var s=arguments;switch(s.length){case 0:return!o.call(this);case 1:return!o.call(this,s[0]);case 2:return!o.call(this,s[0],s[1]);case 3:return!o.call(this,s[0],s[1],s[2])}return!o.apply(this,s)}}},63950:o=>{o.exports=function noop(){}},10124:(o,s,i)=>{var u=i(9325);o.exports=function(){return u.Date.now()}},90179:(o,s,i)=>{var u=i(34932),_=i(9999),w=i(19931),x=i(31769),C=i(21791),j=i(53138),L=i(38816),B=i(83349),$=L((function(o,s){var i={};if(null==o)return i;var L=!1;s=u(s,(function(s){return s=x(s,o),L||(L=s.length>1),s})),C(o,B(o),i),L&&(i=_(i,7,j));for(var $=s.length;$--;)w(i,s[$]);return i}));o.exports=$},50583:(o,s,i)=>{var u=i(47237),_=i(17255),w=i(28586),x=i(77797);o.exports=function property(o){return w(o)?u(x(o)):_(o)}},84195:(o,s,i)=>{var u=i(66977),_=i(38816),w=_((function(o,s){return u(o,256,void 0,void 0,void 0,s)}));o.exports=w},40860:(o,s,i)=>{var u=i(40882),_=i(80909),w=i(15389),x=i(85558),C=i(56449);o.exports=function reduce(o,s,i){var j=C(o)?u:x,L=arguments.length<3;return j(o,w(s,4),i,L,_)}},63560:(o,s,i)=>{var u=i(73170);o.exports=function set(o,s,i){return null==o?o:u(o,s,i)}},42426:(o,s,i)=>{var u=i(14248),_=i(15389),w=i(90916),x=i(56449),C=i(36800);o.exports=function some(o,s,i){var j=x(o)?u:w;return i&&C(o,s,i)&&(s=void 0),j(o,_(s,3))}},63345:o=>{o.exports=function stubArray(){return[]}},89935:o=>{o.exports=function stubFalse(){return!1}},17400:(o,s,i)=>{var u=i(99374),_=1/0;o.exports=function toFinite(o){return o?(o=u(o))===_||o===-1/0?17976931348623157e292*(o<0?-1:1):o==o?o:0:0===o?o:0}},61489:(o,s,i)=>{var u=i(17400);o.exports=function toInteger(o){var s=u(o),i=s%1;return s==s?i?s-i:s:0}},80218:(o,s,i)=>{var u=i(13222);o.exports=function toLower(o){return u(o).toLowerCase()}},99374:(o,s,i)=>{var u=i(54128),_=i(23805),w=i(44394),x=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,j=/^0o[0-7]+$/i,L=parseInt;o.exports=function toNumber(o){if(\"number\"==typeof o)return o;if(w(o))return NaN;if(_(o)){var s=\"function\"==typeof o.valueOf?o.valueOf():o;o=_(s)?s+\"\":s}if(\"string\"!=typeof o)return 0===o?o:+o;o=u(o);var i=C.test(o);return i||j.test(o)?L(o.slice(2),i?2:8):x.test(o)?NaN:+o}},42072:(o,s,i)=>{var u=i(34932),_=i(23007),w=i(56449),x=i(44394),C=i(61802),j=i(77797),L=i(13222);o.exports=function toPath(o){return w(o)?u(o,j):x(o)?[o]:_(C(L(o)))}},69884:(o,s,i)=>{var u=i(21791),_=i(37241);o.exports=function toPlainObject(o){return u(o,_(o))}},13222:(o,s,i)=>{var u=i(77556);o.exports=function toString(o){return null==o?\"\":u(o)}},55808:(o,s,i)=>{var u=i(12507)(\"toUpperCase\");o.exports=u},66645:(o,s,i)=>{var u=i(1733),_=i(45434),w=i(13222),x=i(22225);o.exports=function words(o,s,i){return o=w(o),void 0===(s=i?void 0:s)?_(o)?x(o):u(o):o.match(s)||[]}},53758:(o,s,i)=>{var u=i(30980),_=i(56017),w=i(94033),x=i(56449),C=i(40346),j=i(80257),L=Object.prototype.hasOwnProperty;function lodash(o){if(C(o)&&!x(o)&&!(o instanceof u)){if(o instanceof _)return o;if(L.call(o,\"__wrapped__\"))return j(o)}return new _(o)}lodash.prototype=w.prototype,lodash.prototype.constructor=lodash,o.exports=lodash},47248:(o,s,i)=>{var u=i(16547),_=i(51234);o.exports=function zipObject(o,s){return _(o||[],s||[],u)}},43768:(o,s,i)=>{\"use strict\";var u=i(45981),_=i(85587);s.highlight=highlight,s.highlightAuto=function highlightAuto(o,s){var i,x,C,j,L=s||{},B=L.subset||u.listLanguages(),$=L.prefix,V=B.length,U=-1;null==$&&($=w);if(\"string\"!=typeof o)throw _(\"Expected `string` for value, got `%s`\",o);x={relevance:0,language:null,value:[]},i={relevance:0,language:null,value:[]};for(;++U<V;)j=B[U],u.getLanguage(j)&&((C=highlight(j,o,s)).language=j,C.relevance>x.relevance&&(x=C),C.relevance>i.relevance&&(x=i,i=C));x.language&&(i.secondBest=x);return i},s.registerLanguage=function registerLanguage(o,s){u.registerLanguage(o,s)},s.listLanguages=function listLanguages(){return u.listLanguages()},s.registerAlias=function registerAlias(o,s){var i,_=o;s&&((_={})[o]=s);for(i in _)u.registerAliases(_[i],{languageName:i})},Emitter.prototype.addText=function text(o){var s,i,u=this.stack;if(\"\"===o)return;s=u[u.length-1],(i=s.children[s.children.length-1])&&\"text\"===i.type?i.value+=o:s.children.push({type:\"text\",value:o})},Emitter.prototype.addKeyword=function addKeyword(o,s){this.openNode(s),this.addText(o),this.closeNode()},Emitter.prototype.addSublanguage=function addSublanguage(o,s){var i=this.stack,u=i[i.length-1],_=o.rootNode.children,w=s?{type:\"element\",tagName:\"span\",properties:{className:[s]},children:_}:_;u.children=u.children.concat(w)},Emitter.prototype.openNode=function open(o){var s=this.stack,i=this.options.classPrefix+o,u=s[s.length-1],_={type:\"element\",tagName:\"span\",properties:{className:[i]},children:[]};u.children.push(_),s.push(_)},Emitter.prototype.closeNode=function close(){this.stack.pop()},Emitter.prototype.closeAllNodes=noop,Emitter.prototype.finalize=noop,Emitter.prototype.toHTML=function toHtmlNoop(){return\"\"};var w=\"hljs-\";function highlight(o,s,i){var x,C=u.configure({}),j=(i||{}).prefix;if(\"string\"!=typeof o)throw _(\"Expected `string` for name, got `%s`\",o);if(!u.getLanguage(o))throw _(\"Unknown language: `%s` is not registered\",o);if(\"string\"!=typeof s)throw _(\"Expected `string` for value, got `%s`\",s);if(null==j&&(j=w),u.configure({__emitter:Emitter,classPrefix:j}),x=u.highlight(s,{language:o,ignoreIllegals:!0}),u.configure(C||{}),x.errorRaised)throw x.errorRaised;return{relevance:x.relevance,language:x.language,value:x.emitter.rootNode.children}}function Emitter(o){this.options=o,this.rootNode={children:[]},this.stack=[this.rootNode]}function noop(){}},92340:(o,s,i)=>{const u=i(6048);function coerceElementMatchingCallback(o){return\"string\"==typeof o?s=>s.element===o:o.constructor&&o.extend?s=>s instanceof o:o}class ArraySlice{constructor(o){this.elements=o||[]}toValue(){return this.elements.map((o=>o.toValue()))}map(o,s){return this.elements.map(o,s)}flatMap(o,s){return this.map(o,s).reduce(((o,s)=>o.concat(s)),[])}compactMap(o,s){const i=[];return this.forEach((u=>{const _=o.bind(s)(u);_&&i.push(_)})),i}filter(o,s){return o=coerceElementMatchingCallback(o),new ArraySlice(this.elements.filter(o,s))}reject(o,s){return o=coerceElementMatchingCallback(o),new ArraySlice(this.elements.filter(u(o),s))}find(o,s){return o=coerceElementMatchingCallback(o),this.elements.find(o,s)}forEach(o,s){this.elements.forEach(o,s)}reduce(o,s){return this.elements.reduce(o,s)}includes(o){return this.elements.some((s=>s.equals(o)))}shift(){return this.elements.shift()}unshift(o){this.elements.unshift(this.refract(o))}push(o){return this.elements.push(this.refract(o)),this}add(o){this.push(o)}get(o){return this.elements[o]}getValue(o){const s=this.elements[o];if(s)return s.toValue()}get length(){return this.elements.length}get isEmpty(){return 0===this.elements.length}get first(){return this.elements[0]}}\"undefined\"!=typeof Symbol&&(ArraySlice.prototype[Symbol.iterator]=function symbol(){return this.elements[Symbol.iterator]()}),o.exports=ArraySlice},55973:o=>{class KeyValuePair{constructor(o,s){this.key=o,this.value=s}clone(){const o=new KeyValuePair;return this.key&&(o.key=this.key.clone()),this.value&&(o.value=this.value.clone()),o}}o.exports=KeyValuePair},3110:(o,s,i)=>{const u=i(5187),_=i(85015),w=i(98023),x=i(53812),C=i(23805),j=i(85105),L=i(86804);class Namespace{constructor(o){this.elementMap={},this.elementDetection=[],this.Element=L.Element,this.KeyValuePair=L.KeyValuePair,o&&o.noDefault||this.useDefault(),this._attributeElementKeys=[],this._attributeElementArrayKeys=[]}use(o){return o.namespace&&o.namespace({base:this}),o.load&&o.load({base:this}),this}useDefault(){return this.register(\"null\",L.NullElement).register(\"string\",L.StringElement).register(\"number\",L.NumberElement).register(\"boolean\",L.BooleanElement).register(\"array\",L.ArrayElement).register(\"object\",L.ObjectElement).register(\"member\",L.MemberElement).register(\"ref\",L.RefElement).register(\"link\",L.LinkElement),this.detect(u,L.NullElement,!1).detect(_,L.StringElement,!1).detect(w,L.NumberElement,!1).detect(x,L.BooleanElement,!1).detect(Array.isArray,L.ArrayElement,!1).detect(C,L.ObjectElement,!1),this}register(o,s){return this._elements=void 0,this.elementMap[o]=s,this}unregister(o){return this._elements=void 0,delete this.elementMap[o],this}detect(o,s,i){return void 0===i||i?this.elementDetection.unshift([o,s]):this.elementDetection.push([o,s]),this}toElement(o){if(o instanceof this.Element)return o;let s;for(let i=0;i<this.elementDetection.length;i+=1){const u=this.elementDetection[i][0],_=this.elementDetection[i][1];if(u(o)){s=new _(o);break}}return s}getElementClass(o){const s=this.elementMap[o];return void 0===s?this.Element:s}fromRefract(o){return this.serialiser.deserialise(o)}toRefract(o){return this.serialiser.serialise(o)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach((o=>{const s=o[0].toUpperCase()+o.substr(1);this._elements[s]=this.elementMap[o]}))),this._elements}get serialiser(){return new j(this)}}j.prototype.Namespace=Namespace,o.exports=Namespace},10866:(o,s,i)=>{const u=i(6048),_=i(92340);class ObjectSlice extends _{map(o,s){return this.elements.map((i=>o.bind(s)(i.value,i.key,i)))}filter(o,s){return new ObjectSlice(this.elements.filter((i=>o.bind(s)(i.value,i.key,i))))}reject(o,s){return this.filter(u(o.bind(s)))}forEach(o,s){return this.elements.forEach(((i,u)=>{o.bind(s)(i.value,i.key,i,u)}))}keys(){return this.map(((o,s)=>s.toValue()))}values(){return this.map((o=>o.toValue()))}}o.exports=ObjectSlice},86804:(o,s,i)=>{const u=i(10316),_=i(41067),w=i(71167),x=i(40239),C=i(12242),j=i(6233),L=i(87726),B=i(61045),$=i(86303),V=i(14540),U=i(92340),z=i(10866),Y=i(55973);function refract(o){if(o instanceof u)return o;if(\"string\"==typeof o)return new w(o);if(\"number\"==typeof o)return new x(o);if(\"boolean\"==typeof o)return new C(o);if(null===o)return new _;if(Array.isArray(o))return new j(o.map(refract));if(\"object\"==typeof o){return new B(o)}return o}u.prototype.ObjectElement=B,u.prototype.RefElement=V,u.prototype.MemberElement=L,u.prototype.refract=refract,U.prototype.refract=refract,o.exports={Element:u,NullElement:_,StringElement:w,NumberElement:x,BooleanElement:C,ArrayElement:j,MemberElement:L,ObjectElement:B,LinkElement:$,RefElement:V,refract,ArraySlice:U,ObjectSlice:z,KeyValuePair:Y}},86303:(o,s,i)=>{const u=i(10316);o.exports=class LinkElement extends u{constructor(o,s,i){super(o||[],s,i),this.element=\"link\"}get relation(){return this.attributes.get(\"relation\")}set relation(o){this.attributes.set(\"relation\",o)}get href(){return this.attributes.get(\"href\")}set href(o){this.attributes.set(\"href\",o)}}},14540:(o,s,i)=>{const u=i(10316);o.exports=class RefElement extends u{constructor(o,s,i){super(o||[],s,i),this.element=\"ref\",this.path||(this.path=\"element\")}get path(){return this.attributes.get(\"path\")}set path(o){this.attributes.set(\"path\",o)}}},34035:(o,s,i)=>{const u=i(3110),_=i(86804);s.g$=u,s.KeyValuePair=i(55973),s.G6=_.ArraySlice,s.ot=_.ObjectSlice,s.Hg=_.Element,s.Om=_.StringElement,s.kT=_.NumberElement,s.bd=_.BooleanElement,s.Os=_.NullElement,s.wE=_.ArrayElement,s.Sh=_.ObjectElement,s.Pr=_.MemberElement,s.sI=_.RefElement,s.Ft=_.LinkElement,s.e=_.refract,i(85105),i(75147)},6233:(o,s,i)=>{const u=i(6048),_=i(10316),w=i(92340);class ArrayElement extends _{constructor(o,s,i){super(o||[],s,i),this.element=\"array\"}primitive(){return\"array\"}get(o){return this.content[o]}getValue(o){const s=this.get(o);if(s)return s.toValue()}getIndex(o){return this.content[o]}set(o,s){return this.content[o]=this.refract(s),this}remove(o){const s=this.content.splice(o,1);return s.length?s[0]:null}map(o,s){return this.content.map(o,s)}flatMap(o,s){return this.map(o,s).reduce(((o,s)=>o.concat(s)),[])}compactMap(o,s){const i=[];return this.forEach((u=>{const _=o.bind(s)(u);_&&i.push(_)})),i}filter(o,s){return new w(this.content.filter(o,s))}reject(o,s){return this.filter(u(o),s)}reduce(o,s){let i,u;void 0!==s?(i=0,u=this.refract(s)):(i=1,u=\"object\"===this.primitive()?this.first.value:this.first);for(let s=i;s<this.length;s+=1){const i=this.content[s];u=\"object\"===this.primitive()?this.refract(o(u,i.value,i.key,i,this)):this.refract(o(u,i,s,this))}return u}forEach(o,s){this.content.forEach(((i,u)=>{o.bind(s)(i,this.refract(u))}))}shift(){return this.content.shift()}unshift(o){this.content.unshift(this.refract(o))}push(o){return this.content.push(this.refract(o)),this}add(o){this.push(o)}findElements(o,s){const i=s||{},u=!!i.recursive,_=void 0===i.results?[]:i.results;return this.forEach(((s,i,w)=>{u&&void 0!==s.findElements&&s.findElements(o,{results:_,recursive:u}),o(s,i,w)&&_.push(s)})),_}find(o){return new w(this.findElements(o,{recursive:!0}))}findByElement(o){return this.find((s=>s.element===o))}findByClass(o){return this.find((s=>s.classes.includes(o)))}getById(o){return this.find((s=>s.id.toValue()===o)).first}includes(o){return this.content.some((s=>s.equals(o)))}contains(o){return this.includes(o)}empty(){return new this.constructor([])}\"fantasy-land/empty\"(){return this.empty()}concat(o){return new this.constructor(this.content.concat(o.content))}\"fantasy-land/concat\"(o){return this.concat(o)}\"fantasy-land/map\"(o){return new this.constructor(this.map(o))}\"fantasy-land/chain\"(o){return this.map((s=>o(s)),this).reduce(((o,s)=>o.concat(s)),this.empty())}\"fantasy-land/filter\"(o){return new this.constructor(this.content.filter(o))}\"fantasy-land/reduce\"(o,s){return this.content.reduce(o,s)}get length(){return this.content.length}get isEmpty(){return 0===this.content.length}get first(){return this.getIndex(0)}get second(){return this.getIndex(1)}get last(){return this.getIndex(this.length-1)}}ArrayElement.empty=function empty(){return new this},ArrayElement[\"fantasy-land/empty\"]=ArrayElement.empty,\"undefined\"!=typeof Symbol&&(ArrayElement.prototype[Symbol.iterator]=function symbol(){return this.content[Symbol.iterator]()}),o.exports=ArrayElement},12242:(o,s,i)=>{const u=i(10316);o.exports=class BooleanElement extends u{constructor(o,s,i){super(o,s,i),this.element=\"boolean\"}primitive(){return\"boolean\"}}},10316:(o,s,i)=>{const u=i(2404),_=i(55973),w=i(92340);class Element{constructor(o,s,i){s&&(this.meta=s),i&&(this.attributes=i),this.content=o}freeze(){Object.isFrozen(this)||(this._meta&&(this.meta.parent=this,this.meta.freeze()),this._attributes&&(this.attributes.parent=this,this.attributes.freeze()),this.children.forEach((o=>{o.parent=this,o.freeze()}),this),this.content&&Array.isArray(this.content)&&Object.freeze(this.content),Object.freeze(this))}primitive(){}clone(){const o=new this.constructor;return o.element=this.element,this.meta.length&&(o._meta=this.meta.clone()),this.attributes.length&&(o._attributes=this.attributes.clone()),this.content?this.content.clone?o.content=this.content.clone():Array.isArray(this.content)?o.content=this.content.map((o=>o.clone())):o.content=this.content:o.content=this.content,o}toValue(){return this.content instanceof Element?this.content.toValue():this.content instanceof _?{key:this.content.key.toValue(),value:this.content.value?this.content.value.toValue():void 0}:this.content&&this.content.map?this.content.map((o=>o.toValue()),this):this.content}toRef(o){if(\"\"===this.id.toValue())throw Error(\"Cannot create reference to an element that does not contain an ID\");const s=new this.RefElement(this.id.toValue());return o&&(s.path=o),s}findRecursive(...o){if(arguments.length>1&&!this.isFrozen)throw new Error(\"Cannot find recursive with multiple element names without first freezing the element. Call `element.freeze()`\");const s=o.pop();let i=new w;const append=(o,s)=>(o.push(s),o),checkElement=(o,i)=>{i.element===s&&o.push(i);const u=i.findRecursive(s);return u&&u.reduce(append,o),i.content instanceof _&&(i.content.key&&checkElement(o,i.content.key),i.content.value&&checkElement(o,i.content.value)),o};return this.content&&(this.content.element&&checkElement(i,this.content),Array.isArray(this.content)&&this.content.reduce(checkElement,i)),o.isEmpty||(i=i.filter((s=>{let i=s.parents.map((o=>o.element));for(const s in o){const u=o[s],_=i.indexOf(u);if(-1===_)return!1;i=i.splice(0,_)}return!0}))),i}set(o){return this.content=o,this}equals(o){return u(this.toValue(),o)}getMetaProperty(o,s){if(!this.meta.hasKey(o)){if(this.isFrozen){const o=this.refract(s);return o.freeze(),o}this.meta.set(o,s)}return this.meta.get(o)}setMetaProperty(o,s){this.meta.set(o,s)}get element(){return this._storedElement||\"element\"}set element(o){this._storedElement=o}get content(){return this._content}set content(o){if(o instanceof Element)this._content=o;else if(o instanceof w)this.content=o.elements;else if(\"string\"==typeof o||\"number\"==typeof o||\"boolean\"==typeof o||\"null\"===o||null==o)this._content=o;else if(o instanceof _)this._content=o;else if(Array.isArray(o))this._content=o.map(this.refract);else{if(\"object\"!=typeof o)throw new Error(\"Cannot set content to given value\");this._content=Object.keys(o).map((s=>new this.MemberElement(s,o[s])))}}get meta(){if(!this._meta){if(this.isFrozen){const o=new this.ObjectElement;return o.freeze(),o}this._meta=new this.ObjectElement}return this._meta}set meta(o){o instanceof this.ObjectElement?this._meta=o:this.meta.set(o||{})}get attributes(){if(!this._attributes){if(this.isFrozen){const o=new this.ObjectElement;return o.freeze(),o}this._attributes=new this.ObjectElement}return this._attributes}set attributes(o){o instanceof this.ObjectElement?this._attributes=o:this.attributes.set(o||{})}get id(){return this.getMetaProperty(\"id\",\"\")}set id(o){this.setMetaProperty(\"id\",o)}get classes(){return this.getMetaProperty(\"classes\",[])}set classes(o){this.setMetaProperty(\"classes\",o)}get title(){return this.getMetaProperty(\"title\",\"\")}set title(o){this.setMetaProperty(\"title\",o)}get description(){return this.getMetaProperty(\"description\",\"\")}set description(o){this.setMetaProperty(\"description\",o)}get links(){return this.getMetaProperty(\"links\",[])}set links(o){this.setMetaProperty(\"links\",o)}get isFrozen(){return Object.isFrozen(this)}get parents(){let{parent:o}=this;const s=new w;for(;o;)s.push(o),o=o.parent;return s}get children(){if(Array.isArray(this.content))return new w(this.content);if(this.content instanceof _){const o=new w([this.content.key]);return this.content.value&&o.push(this.content.value),o}return this.content instanceof Element?new w([this.content]):new w}get recursiveChildren(){const o=new w;return this.children.forEach((s=>{o.push(s),s.recursiveChildren.forEach((s=>{o.push(s)}))})),o}}o.exports=Element},87726:(o,s,i)=>{const u=i(55973),_=i(10316);o.exports=class MemberElement extends _{constructor(o,s,i,_){super(new u,i,_),this.element=\"member\",this.key=o,this.value=s}get key(){return this.content.key}set key(o){this.content.key=this.refract(o)}get value(){return this.content.value}set value(o){this.content.value=this.refract(o)}}},41067:(o,s,i)=>{const u=i(10316);o.exports=class NullElement extends u{constructor(o,s,i){super(o||null,s,i),this.element=\"null\"}primitive(){return\"null\"}set(){return new Error(\"Cannot set the value of null\")}}},40239:(o,s,i)=>{const u=i(10316);o.exports=class NumberElement extends u{constructor(o,s,i){super(o,s,i),this.element=\"number\"}primitive(){return\"number\"}}},61045:(o,s,i)=>{const u=i(6048),_=i(23805),w=i(6233),x=i(87726),C=i(10866);o.exports=class ObjectElement extends w{constructor(o,s,i){super(o||[],s,i),this.element=\"object\"}primitive(){return\"object\"}toValue(){return this.content.reduce(((o,s)=>(o[s.key.toValue()]=s.value?s.value.toValue():void 0,o)),{})}get(o){const s=this.getMember(o);if(s)return s.value}getMember(o){if(void 0!==o)return this.content.find((s=>s.key.toValue()===o))}remove(o){let s=null;return this.content=this.content.filter((i=>i.key.toValue()!==o||(s=i,!1))),s}getKey(o){const s=this.getMember(o);if(s)return s.key}set(o,s){if(_(o))return Object.keys(o).forEach((s=>{this.set(s,o[s])})),this;const i=o,u=this.getMember(i);return u?u.value=s:this.content.push(new x(i,s)),this}keys(){return this.content.map((o=>o.key.toValue()))}values(){return this.content.map((o=>o.value.toValue()))}hasKey(o){return this.content.some((s=>s.key.equals(o)))}items(){return this.content.map((o=>[o.key.toValue(),o.value.toValue()]))}map(o,s){return this.content.map((i=>o.bind(s)(i.value,i.key,i)))}compactMap(o,s){const i=[];return this.forEach(((u,_,w)=>{const x=o.bind(s)(u,_,w);x&&i.push(x)})),i}filter(o,s){return new C(this.content).filter(o,s)}reject(o,s){return this.filter(u(o),s)}forEach(o,s){return this.content.forEach((i=>o.bind(s)(i.value,i.key,i)))}}},71167:(o,s,i)=>{const u=i(10316);o.exports=class StringElement extends u{constructor(o,s,i){super(o,s,i),this.element=\"string\"}primitive(){return\"string\"}get length(){return this.content.length}}},75147:(o,s,i)=>{const u=i(85105);o.exports=class JSON06Serialiser extends u{serialise(o){if(!(o instanceof this.namespace.elements.Element))throw new TypeError(`Given element \\`${o}\\` is not an Element instance`);let s;o._attributes&&o.attributes.get(\"variable\")&&(s=o.attributes.get(\"variable\"));const i={element:o.element};o._meta&&o._meta.length>0&&(i.meta=this.serialiseObject(o.meta));const u=\"enum\"===o.element||-1!==o.attributes.keys().indexOf(\"enumerations\");if(u){const s=this.enumSerialiseAttributes(o);s&&(i.attributes=s)}else if(o._attributes&&o._attributes.length>0){let{attributes:u}=o;u.get(\"metadata\")&&(u=u.clone(),u.set(\"meta\",u.get(\"metadata\")),u.remove(\"metadata\")),\"member\"===o.element&&s&&(u=u.clone(),u.remove(\"variable\")),u.length>0&&(i.attributes=this.serialiseObject(u))}if(u)i.content=this.enumSerialiseContent(o,i);else if(this[`${o.element}SerialiseContent`])i.content=this[`${o.element}SerialiseContent`](o,i);else if(void 0!==o.content){let u;s&&o.content.key?(u=o.content.clone(),u.key.attributes.set(\"variable\",s),u=this.serialiseContent(u)):u=this.serialiseContent(o.content),this.shouldSerialiseContent(o,u)&&(i.content=u)}else this.shouldSerialiseContent(o,o.content)&&o instanceof this.namespace.elements.Array&&(i.content=[]);return i}shouldSerialiseContent(o,s){return\"parseResult\"===o.element||\"httpRequest\"===o.element||\"httpResponse\"===o.element||\"category\"===o.element||\"link\"===o.element||void 0!==s&&(!Array.isArray(s)||0!==s.length)}refSerialiseContent(o,s){return delete s.attributes,{href:o.toValue(),path:o.path.toValue()}}sourceMapSerialiseContent(o){return o.toValue()}dataStructureSerialiseContent(o){return[this.serialiseContent(o.content)]}enumSerialiseAttributes(o){const s=o.attributes.clone(),i=s.remove(\"enumerations\")||new this.namespace.elements.Array([]),u=s.get(\"default\");let _=s.get(\"samples\")||new this.namespace.elements.Array([]);if(u&&u.content&&(u.content.attributes&&u.content.attributes.remove(\"typeAttributes\"),s.set(\"default\",new this.namespace.elements.Array([u.content]))),_.forEach((o=>{o.content&&o.content.element&&o.content.attributes.remove(\"typeAttributes\")})),o.content&&0!==i.length&&_.unshift(o.content),_=_.map((o=>o instanceof this.namespace.elements.Array?[o]:new this.namespace.elements.Array([o.content]))),_.length&&s.set(\"samples\",_),s.length>0)return this.serialiseObject(s)}enumSerialiseContent(o){if(o._attributes){const s=o.attributes.get(\"enumerations\");if(s&&s.length>0)return s.content.map((o=>{const s=o.clone();return s.attributes.remove(\"typeAttributes\"),this.serialise(s)}))}if(o.content){const s=o.content.clone();return s.attributes.remove(\"typeAttributes\"),[this.serialise(s)]}return[]}deserialise(o){if(\"string\"==typeof o)return new this.namespace.elements.String(o);if(\"number\"==typeof o)return new this.namespace.elements.Number(o);if(\"boolean\"==typeof o)return new this.namespace.elements.Boolean(o);if(null===o)return new this.namespace.elements.Null;if(Array.isArray(o))return new this.namespace.elements.Array(o.map(this.deserialise,this));const s=this.namespace.getElementClass(o.element),i=new s;i.element!==o.element&&(i.element=o.element),o.meta&&this.deserialiseObject(o.meta,i.meta),o.attributes&&this.deserialiseObject(o.attributes,i.attributes);const u=this.deserialiseContent(o.content);if(void 0===u&&null!==i.content||(i.content=u),\"enum\"===i.element){i.content&&i.attributes.set(\"enumerations\",i.content);let o=i.attributes.get(\"samples\");if(i.attributes.remove(\"samples\"),o){const u=o;o=new this.namespace.elements.Array,u.forEach((u=>{u.forEach((u=>{const _=new s(u);_.element=i.element,o.push(_)}))}));const _=o.shift();i.content=_?_.content:void 0,i.attributes.set(\"samples\",o)}else i.content=void 0;let u=i.attributes.get(\"default\");if(u&&u.length>0){u=u.get(0);const o=new s(u);o.element=i.element,i.attributes.set(\"default\",o)}}else if(\"dataStructure\"===i.element&&Array.isArray(i.content))[i.content]=i.content;else if(\"category\"===i.element){const o=i.attributes.get(\"meta\");o&&(i.attributes.set(\"metadata\",o),i.attributes.remove(\"meta\"))}else\"member\"===i.element&&i.key&&i.key._attributes&&i.key._attributes.getValue(\"variable\")&&(i.attributes.set(\"variable\",i.key.attributes.get(\"variable\")),i.key.attributes.remove(\"variable\"));return i}serialiseContent(o){if(o instanceof this.namespace.elements.Element)return this.serialise(o);if(o instanceof this.namespace.KeyValuePair){const s={key:this.serialise(o.key)};return o.value&&(s.value=this.serialise(o.value)),s}return o&&o.map?o.map(this.serialise,this):o}deserialiseContent(o){if(o){if(o.element)return this.deserialise(o);if(o.key){const s=new this.namespace.KeyValuePair(this.deserialise(o.key));return o.value&&(s.value=this.deserialise(o.value)),s}if(o.map)return o.map(this.deserialise,this)}return o}shouldRefract(o){return!!(o._attributes&&o.attributes.keys().length||o._meta&&o.meta.keys().length)||\"enum\"!==o.element&&(o.element!==o.primitive()||\"member\"===o.element)}convertKeyToRefract(o,s){return this.shouldRefract(s)?this.serialise(s):\"enum\"===s.element?this.serialiseEnum(s):\"array\"===s.element?s.map((s=>this.shouldRefract(s)||\"default\"===o?this.serialise(s):\"array\"===s.element||\"object\"===s.element||\"enum\"===s.element?s.children.map((o=>this.serialise(o))):s.toValue())):\"object\"===s.element?(s.content||[]).map(this.serialise,this):s.toValue()}serialiseEnum(o){return o.children.map((o=>this.serialise(o)))}serialiseObject(o){const s={};return o.forEach(((o,i)=>{if(o){const u=i.toValue();s[u]=this.convertKeyToRefract(u,o)}})),s}deserialiseObject(o,s){Object.keys(o).forEach((i=>{s.set(i,this.deserialise(o[i]))}))}}},85105:o=>{o.exports=class JSONSerialiser{constructor(o){this.namespace=o||new this.Namespace}serialise(o){if(!(o instanceof this.namespace.elements.Element))throw new TypeError(`Given element \\`${o}\\` is not an Element instance`);const s={element:o.element};o._meta&&o._meta.length>0&&(s.meta=this.serialiseObject(o.meta)),o._attributes&&o._attributes.length>0&&(s.attributes=this.serialiseObject(o.attributes));const i=this.serialiseContent(o.content);return void 0!==i&&(s.content=i),s}deserialise(o){if(!o.element)throw new Error(\"Given value is not an object containing an element name\");const s=new(this.namespace.getElementClass(o.element));s.element!==o.element&&(s.element=o.element),o.meta&&this.deserialiseObject(o.meta,s.meta),o.attributes&&this.deserialiseObject(o.attributes,s.attributes);const i=this.deserialiseContent(o.content);return void 0===i&&null!==s.content||(s.content=i),s}serialiseContent(o){if(o instanceof this.namespace.elements.Element)return this.serialise(o);if(o instanceof this.namespace.KeyValuePair){const s={key:this.serialise(o.key)};return o.value&&(s.value=this.serialise(o.value)),s}if(o&&o.map){if(0===o.length)return;return o.map(this.serialise,this)}return o}deserialiseContent(o){if(o){if(o.element)return this.deserialise(o);if(o.key){const s=new this.namespace.KeyValuePair(this.deserialise(o.key));return o.value&&(s.value=this.deserialise(o.value)),s}if(o.map)return o.map(this.deserialise,this)}return o}serialiseObject(o){const s={};if(o.forEach(((o,i)=>{o&&(s[i.toValue()]=this.serialise(o))})),0!==Object.keys(s).length)return s}deserialiseObject(o,s){Object.keys(o).forEach((i=>{s.set(i,this.deserialise(o[i]))}))}}},58859:(o,s,i)=>{var u=\"function\"==typeof Map&&Map.prototype,_=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Map.prototype,\"size\"):null,w=u&&_&&\"function\"==typeof _.get?_.get:null,x=u&&Map.prototype.forEach,C=\"function\"==typeof Set&&Set.prototype,j=Object.getOwnPropertyDescriptor&&C?Object.getOwnPropertyDescriptor(Set.prototype,\"size\"):null,L=C&&j&&\"function\"==typeof j.get?j.get:null,B=C&&Set.prototype.forEach,$=\"function\"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,V=\"function\"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,U=\"function\"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,z=Boolean.prototype.valueOf,Y=Object.prototype.toString,Z=Function.prototype.toString,ee=String.prototype.match,ie=String.prototype.slice,ae=String.prototype.replace,ce=String.prototype.toUpperCase,le=String.prototype.toLowerCase,pe=RegExp.prototype.test,de=Array.prototype.concat,fe=Array.prototype.join,ye=Array.prototype.slice,be=Math.floor,_e=\"function\"==typeof BigInt?BigInt.prototype.valueOf:null,we=Object.getOwnPropertySymbols,Se=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?Symbol.prototype.toString:null,xe=\"function\"==typeof Symbol&&\"object\"==typeof Symbol.iterator,Pe=\"function\"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===xe||\"symbol\")?Symbol.toStringTag:null,Te=Object.prototype.propertyIsEnumerable,Re=(\"function\"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(o){return o.__proto__}:null);function addNumericSeparator(o,s){if(o===1/0||o===-1/0||o!=o||o&&o>-1e3&&o<1e3||pe.call(/e/,s))return s;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(\"number\"==typeof o){var u=o<0?-be(-o):be(o);if(u!==o){var _=String(u),w=ie.call(s,_.length+1);return ae.call(_,i,\"$&_\")+\".\"+ae.call(ae.call(w,/([0-9]{3})/g,\"$&_\"),/_$/,\"\")}}return ae.call(s,i,\"$&_\")}var qe=i(42634),$e=qe.custom,ze=isSymbol($e)?$e:null;function wrapQuotes(o,s,i){var u=\"double\"===(i.quoteStyle||s)?'\"':\"'\";return u+o+u}function quote(o){return ae.call(String(o),/\"/g,\"&quot;\")}function isArray(o){return!(\"[object Array]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}function isRegExp(o){return!(\"[object RegExp]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}function isSymbol(o){if(xe)return o&&\"object\"==typeof o&&o instanceof Symbol;if(\"symbol\"==typeof o)return!0;if(!o||\"object\"!=typeof o||!Se)return!1;try{return Se.call(o),!0}catch(o){}return!1}o.exports=function inspect_(o,s,u,_){var C=s||{};if(has(C,\"quoteStyle\")&&\"single\"!==C.quoteStyle&&\"double\"!==C.quoteStyle)throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');if(has(C,\"maxStringLength\")&&(\"number\"==typeof C.maxStringLength?C.maxStringLength<0&&C.maxStringLength!==1/0:null!==C.maxStringLength))throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');var j=!has(C,\"customInspect\")||C.customInspect;if(\"boolean\"!=typeof j&&\"symbol\"!==j)throw new TypeError(\"option \\\"customInspect\\\", if provided, must be `true`, `false`, or `'symbol'`\");if(has(C,\"indent\")&&null!==C.indent&&\"\\t\"!==C.indent&&!(parseInt(C.indent,10)===C.indent&&C.indent>0))throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');if(has(C,\"numericSeparator\")&&\"boolean\"!=typeof C.numericSeparator)throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');var Y=C.numericSeparator;if(void 0===o)return\"undefined\";if(null===o)return\"null\";if(\"boolean\"==typeof o)return o?\"true\":\"false\";if(\"string\"==typeof o)return inspectString(o,C);if(\"number\"==typeof o){if(0===o)return 1/0/o>0?\"0\":\"-0\";var ce=String(o);return Y?addNumericSeparator(o,ce):ce}if(\"bigint\"==typeof o){var pe=String(o)+\"n\";return Y?addNumericSeparator(o,pe):pe}var be=void 0===C.depth?5:C.depth;if(void 0===u&&(u=0),u>=be&&be>0&&\"object\"==typeof o)return isArray(o)?\"[Array]\":\"[Object]\";var we=function getIndent(o,s){var i;if(\"\\t\"===o.indent)i=\"\\t\";else{if(!(\"number\"==typeof o.indent&&o.indent>0))return null;i=fe.call(Array(o.indent+1),\" \")}return{base:i,prev:fe.call(Array(s+1),i)}}(C,u);if(void 0===_)_=[];else if(indexOf(_,o)>=0)return\"[Circular]\";function inspect(o,s,i){if(s&&(_=ye.call(_)).push(s),i){var w={depth:C.depth};return has(C,\"quoteStyle\")&&(w.quoteStyle=C.quoteStyle),inspect_(o,w,u+1,_)}return inspect_(o,C,u+1,_)}if(\"function\"==typeof o&&!isRegExp(o)){var $e=function nameOf(o){if(o.name)return o.name;var s=ee.call(Z.call(o),/^function\\s*([\\w$]+)/);if(s)return s[1];return null}(o),We=arrObjKeys(o,inspect);return\"[Function\"+($e?\": \"+$e:\" (anonymous)\")+\"]\"+(We.length>0?\" { \"+fe.call(We,\", \")+\" }\":\"\")}if(isSymbol(o)){var He=xe?ae.call(String(o),/^(Symbol\\(.*\\))_[^)]*$/,\"$1\"):Se.call(o);return\"object\"!=typeof o||xe?He:markBoxed(He)}if(function isElement(o){if(!o||\"object\"!=typeof o)return!1;if(\"undefined\"!=typeof HTMLElement&&o instanceof HTMLElement)return!0;return\"string\"==typeof o.nodeName&&\"function\"==typeof o.getAttribute}(o)){for(var Ye=\"<\"+le.call(String(o.nodeName)),Xe=o.attributes||[],Qe=0;Qe<Xe.length;Qe++)Ye+=\" \"+Xe[Qe].name+\"=\"+wrapQuotes(quote(Xe[Qe].value),\"double\",C);return Ye+=\">\",o.childNodes&&o.childNodes.length&&(Ye+=\"...\"),Ye+=\"</\"+le.call(String(o.nodeName))+\">\"}if(isArray(o)){if(0===o.length)return\"[]\";var et=arrObjKeys(o,inspect);return we&&!function singleLineValues(o){for(var s=0;s<o.length;s++)if(indexOf(o[s],\"\\n\")>=0)return!1;return!0}(et)?\"[\"+indentedJoin(et,we)+\"]\":\"[ \"+fe.call(et,\", \")+\" ]\"}if(function isError(o){return!(\"[object Error]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o)){var tt=arrObjKeys(o,inspect);return\"cause\"in Error.prototype||!(\"cause\"in o)||Te.call(o,\"cause\")?0===tt.length?\"[\"+String(o)+\"]\":\"{ [\"+String(o)+\"] \"+fe.call(tt,\", \")+\" }\":\"{ [\"+String(o)+\"] \"+fe.call(de.call(\"[cause]: \"+inspect(o.cause),tt),\", \")+\" }\"}if(\"object\"==typeof o&&j){if(ze&&\"function\"==typeof o[ze]&&qe)return qe(o,{depth:be-u});if(\"symbol\"!==j&&\"function\"==typeof o.inspect)return o.inspect()}if(function isMap(o){if(!w||!o||\"object\"!=typeof o)return!1;try{w.call(o);try{L.call(o)}catch(o){return!0}return o instanceof Map}catch(o){}return!1}(o)){var rt=[];return x&&x.call(o,(function(s,i){rt.push(inspect(i,o,!0)+\" => \"+inspect(s,o))})),collectionOf(\"Map\",w.call(o),rt,we)}if(function isSet(o){if(!L||!o||\"object\"!=typeof o)return!1;try{L.call(o);try{w.call(o)}catch(o){return!0}return o instanceof Set}catch(o){}return!1}(o)){var nt=[];return B&&B.call(o,(function(s){nt.push(inspect(s,o))})),collectionOf(\"Set\",L.call(o),nt,we)}if(function isWeakMap(o){if(!$||!o||\"object\"!=typeof o)return!1;try{$.call(o,$);try{V.call(o,V)}catch(o){return!0}return o instanceof WeakMap}catch(o){}return!1}(o))return weakCollectionOf(\"WeakMap\");if(function isWeakSet(o){if(!V||!o||\"object\"!=typeof o)return!1;try{V.call(o,V);try{$.call(o,$)}catch(o){return!0}return o instanceof WeakSet}catch(o){}return!1}(o))return weakCollectionOf(\"WeakSet\");if(function isWeakRef(o){if(!U||!o||\"object\"!=typeof o)return!1;try{return U.call(o),!0}catch(o){}return!1}(o))return weakCollectionOf(\"WeakRef\");if(function isNumber(o){return!(\"[object Number]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o))return markBoxed(inspect(Number(o)));if(function isBigInt(o){if(!o||\"object\"!=typeof o||!_e)return!1;try{return _e.call(o),!0}catch(o){}return!1}(o))return markBoxed(inspect(_e.call(o)));if(function isBoolean(o){return!(\"[object Boolean]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o))return markBoxed(z.call(o));if(function isString(o){return!(\"[object String]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o))return markBoxed(inspect(String(o)));if(\"undefined\"!=typeof window&&o===window)return\"{ [object Window] }\";if(o===i.g)return\"{ [object globalThis] }\";if(!function isDate(o){return!(\"[object Date]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o)&&!isRegExp(o)){var ot=arrObjKeys(o,inspect),st=Re?Re(o)===Object.prototype:o instanceof Object||o.constructor===Object,it=o instanceof Object?\"\":\"null prototype\",at=!st&&Pe&&Object(o)===o&&Pe in o?ie.call(toStr(o),8,-1):it?\"Object\":\"\",ct=(st||\"function\"!=typeof o.constructor?\"\":o.constructor.name?o.constructor.name+\" \":\"\")+(at||it?\"[\"+fe.call(de.call([],at||[],it||[]),\": \")+\"] \":\"\");return 0===ot.length?ct+\"{}\":we?ct+\"{\"+indentedJoin(ot,we)+\"}\":ct+\"{ \"+fe.call(ot,\", \")+\" }\"}return String(o)};var We=Object.prototype.hasOwnProperty||function(o){return o in this};function has(o,s){return We.call(o,s)}function toStr(o){return Y.call(o)}function indexOf(o,s){if(o.indexOf)return o.indexOf(s);for(var i=0,u=o.length;i<u;i++)if(o[i]===s)return i;return-1}function inspectString(o,s){if(o.length>s.maxStringLength){var i=o.length-s.maxStringLength,u=\"... \"+i+\" more character\"+(i>1?\"s\":\"\");return inspectString(ie.call(o,0,s.maxStringLength),s)+u}return wrapQuotes(ae.call(ae.call(o,/(['\\\\])/g,\"\\\\$1\"),/[\\x00-\\x1f]/g,lowbyte),\"single\",s)}function lowbyte(o){var s=o.charCodeAt(0),i={8:\"b\",9:\"t\",10:\"n\",12:\"f\",13:\"r\"}[s];return i?\"\\\\\"+i:\"\\\\x\"+(s<16?\"0\":\"\")+ce.call(s.toString(16))}function markBoxed(o){return\"Object(\"+o+\")\"}function weakCollectionOf(o){return o+\" { ? }\"}function collectionOf(o,s,i,u){return o+\" (\"+s+\") {\"+(u?indentedJoin(i,u):fe.call(i,\", \"))+\"}\"}function indentedJoin(o,s){if(0===o.length)return\"\";var i=\"\\n\"+s.prev+s.base;return i+fe.call(o,\",\"+i)+\"\\n\"+s.prev}function arrObjKeys(o,s){var i=isArray(o),u=[];if(i){u.length=o.length;for(var _=0;_<o.length;_++)u[_]=has(o,_)?s(o[_],o):\"\"}var w,x=\"function\"==typeof we?we(o):[];if(xe){w={};for(var C=0;C<x.length;C++)w[\"$\"+x[C]]=x[C]}for(var j in o)has(o,j)&&(i&&String(Number(j))===j&&j<o.length||xe&&w[\"$\"+j]instanceof Symbol||(pe.call(/[^\\w$]/,j)?u.push(s(j,o)+\": \"+s(o[j],o)):u.push(j+\": \"+s(o[j],o))));if(\"function\"==typeof we)for(var L=0;L<x.length;L++)Te.call(o,x[L])&&u.push(\"[\"+s(x[L])+\"]: \"+s(o[x[L]],o));return u}},65606:o=>{var s,i,u=o.exports={};function defaultSetTimout(){throw new Error(\"setTimeout has not been defined\")}function defaultClearTimeout(){throw new Error(\"clearTimeout has not been defined\")}function runTimeout(o){if(s===setTimeout)return setTimeout(o,0);if((s===defaultSetTimout||!s)&&setTimeout)return s=setTimeout,setTimeout(o,0);try{return s(o,0)}catch(i){try{return s.call(null,o,0)}catch(i){return s.call(this,o,0)}}}!function(){try{s=\"function\"==typeof setTimeout?setTimeout:defaultSetTimout}catch(o){s=defaultSetTimout}try{i=\"function\"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(o){i=defaultClearTimeout}}();var _,w=[],x=!1,C=-1;function cleanUpNextTick(){x&&_&&(x=!1,_.length?w=_.concat(w):C=-1,w.length&&drainQueue())}function drainQueue(){if(!x){var o=runTimeout(cleanUpNextTick);x=!0;for(var s=w.length;s;){for(_=w,w=[];++C<s;)_&&_[C].run();C=-1,s=w.length}_=null,x=!1,function runClearTimeout(o){if(i===clearTimeout)return clearTimeout(o);if((i===defaultClearTimeout||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(o);try{return i(o)}catch(s){try{return i.call(null,o)}catch(s){return i.call(this,o)}}}(o)}}function Item(o,s){this.fun=o,this.array=s}function noop(){}u.nextTick=function(o){var s=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)s[i-1]=arguments[i];w.push(new Item(o,s)),1!==w.length||x||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},u.title=\"browser\",u.browser=!0,u.env={},u.argv=[],u.version=\"\",u.versions={},u.on=noop,u.addListener=noop,u.once=noop,u.off=noop,u.removeListener=noop,u.removeAllListeners=noop,u.emit=noop,u.prependListener=noop,u.prependOnceListener=noop,u.listeners=function(o){return[]},u.binding=function(o){throw new Error(\"process.binding is not supported\")},u.cwd=function(){return\"/\"},u.chdir=function(o){throw new Error(\"process.chdir is not supported\")},u.umask=function(){return 0}},2694:(o,s,i)=>{\"use strict\";var u=i(6925);function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction,o.exports=function(){function shim(o,s,i,_,w,x){if(x!==u){var C=new Error(\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types\");throw C.name=\"Invariant Violation\",C}}function getShim(){return shim}shim.isRequired=shim;var o={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return o.PropTypes=o,o}},5556:(o,s,i)=>{o.exports=i(2694)()},6925:o=>{\"use strict\";o.exports=\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\"},74765:o=>{\"use strict\";var s=String.prototype.replace,i=/%20/g,u=\"RFC1738\",_=\"RFC3986\";o.exports={default:_,formatters:{RFC1738:function(o){return s.call(o,i,\"+\")},RFC3986:function(o){return String(o)}},RFC1738:u,RFC3986:_}},55373:(o,s,i)=>{\"use strict\";var u=i(98636),_=i(62642),w=i(74765);o.exports={formats:w,parse:_,stringify:u}},62642:(o,s,i)=>{\"use strict\";var u=i(37720),_=Object.prototype.hasOwnProperty,w=Array.isArray,x={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:\"utf-8\",charsetSentinel:!1,comma:!1,decoder:u.decode,delimiter:\"&\",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(o){return o.replace(/&#(\\d+);/g,(function(o,s){return String.fromCharCode(parseInt(s,10))}))},parseArrayValue=function(o,s){return o&&\"string\"==typeof o&&s.comma&&o.indexOf(\",\")>-1?o.split(\",\"):o},C=function parseQueryStringKeys(o,s,i,u){if(o){var w=i.allowDots?o.replace(/\\.([^.[]+)/g,\"[$1]\"):o,x=/(\\[[^[\\]]*])/g,C=i.depth>0&&/(\\[[^[\\]]*])/.exec(w),j=C?w.slice(0,C.index):w,L=[];if(j){if(!i.plainObjects&&_.call(Object.prototype,j)&&!i.allowPrototypes)return;L.push(j)}for(var B=0;i.depth>0&&null!==(C=x.exec(w))&&B<i.depth;){if(B+=1,!i.plainObjects&&_.call(Object.prototype,C[1].slice(1,-1))&&!i.allowPrototypes)return;L.push(C[1])}return C&&L.push(\"[\"+w.slice(C.index)+\"]\"),function(o,s,i,u){for(var _=u?s:parseArrayValue(s,i),w=o.length-1;w>=0;--w){var x,C=o[w];if(\"[]\"===C&&i.parseArrays)x=[].concat(_);else{x=i.plainObjects?Object.create(null):{};var j=\"[\"===C.charAt(0)&&\"]\"===C.charAt(C.length-1)?C.slice(1,-1):C,L=parseInt(j,10);i.parseArrays||\"\"!==j?!isNaN(L)&&C!==j&&String(L)===j&&L>=0&&i.parseArrays&&L<=i.arrayLimit?(x=[])[L]=_:\"__proto__\"!==j&&(x[j]=_):x={0:_}}_=x}return _}(L,s,i,u)}};o.exports=function(o,s){var i=function normalizeParseOptions(o){if(!o)return x;if(null!==o.decoder&&void 0!==o.decoder&&\"function\"!=typeof o.decoder)throw new TypeError(\"Decoder has to be a function.\");if(void 0!==o.charset&&\"utf-8\"!==o.charset&&\"iso-8859-1\"!==o.charset)throw new TypeError(\"The charset option must be either utf-8, iso-8859-1, or undefined\");var s=void 0===o.charset?x.charset:o.charset;return{allowDots:void 0===o.allowDots?x.allowDots:!!o.allowDots,allowPrototypes:\"boolean\"==typeof o.allowPrototypes?o.allowPrototypes:x.allowPrototypes,allowSparse:\"boolean\"==typeof o.allowSparse?o.allowSparse:x.allowSparse,arrayLimit:\"number\"==typeof o.arrayLimit?o.arrayLimit:x.arrayLimit,charset:s,charsetSentinel:\"boolean\"==typeof o.charsetSentinel?o.charsetSentinel:x.charsetSentinel,comma:\"boolean\"==typeof o.comma?o.comma:x.comma,decoder:\"function\"==typeof o.decoder?o.decoder:x.decoder,delimiter:\"string\"==typeof o.delimiter||u.isRegExp(o.delimiter)?o.delimiter:x.delimiter,depth:\"number\"==typeof o.depth||!1===o.depth?+o.depth:x.depth,ignoreQueryPrefix:!0===o.ignoreQueryPrefix,interpretNumericEntities:\"boolean\"==typeof o.interpretNumericEntities?o.interpretNumericEntities:x.interpretNumericEntities,parameterLimit:\"number\"==typeof o.parameterLimit?o.parameterLimit:x.parameterLimit,parseArrays:!1!==o.parseArrays,plainObjects:\"boolean\"==typeof o.plainObjects?o.plainObjects:x.plainObjects,strictNullHandling:\"boolean\"==typeof o.strictNullHandling?o.strictNullHandling:x.strictNullHandling}}(s);if(\"\"===o||null==o)return i.plainObjects?Object.create(null):{};for(var j=\"string\"==typeof o?function parseQueryStringValues(o,s){var i,C={},j=s.ignoreQueryPrefix?o.replace(/^\\?/,\"\"):o,L=s.parameterLimit===1/0?void 0:s.parameterLimit,B=j.split(s.delimiter,L),$=-1,V=s.charset;if(s.charsetSentinel)for(i=0;i<B.length;++i)0===B[i].indexOf(\"utf8=\")&&(\"utf8=%E2%9C%93\"===B[i]?V=\"utf-8\":\"utf8=%26%2310003%3B\"===B[i]&&(V=\"iso-8859-1\"),$=i,i=B.length);for(i=0;i<B.length;++i)if(i!==$){var U,z,Y=B[i],Z=Y.indexOf(\"]=\"),ee=-1===Z?Y.indexOf(\"=\"):Z+1;-1===ee?(U=s.decoder(Y,x.decoder,V,\"key\"),z=s.strictNullHandling?null:\"\"):(U=s.decoder(Y.slice(0,ee),x.decoder,V,\"key\"),z=u.maybeMap(parseArrayValue(Y.slice(ee+1),s),(function(o){return s.decoder(o,x.decoder,V,\"value\")}))),z&&s.interpretNumericEntities&&\"iso-8859-1\"===V&&(z=interpretNumericEntities(z)),Y.indexOf(\"[]=\")>-1&&(z=w(z)?[z]:z),_.call(C,U)?C[U]=u.combine(C[U],z):C[U]=z}return C}(o,i):o,L=i.plainObjects?Object.create(null):{},B=Object.keys(j),$=0;$<B.length;++$){var V=B[$],U=C(V,j[V],i,\"string\"==typeof o);L=u.merge(L,U,i)}return!0===i.allowSparse?L:u.compact(L)}},98636:(o,s,i)=>{\"use strict\";var u=i(920),_=i(37720),w=i(74765),x=Object.prototype.hasOwnProperty,C={brackets:function brackets(o){return o+\"[]\"},comma:\"comma\",indices:function indices(o,s){return o+\"[\"+s+\"]\"},repeat:function repeat(o){return o}},j=Array.isArray,L=String.prototype.split,B=Array.prototype.push,pushToArray=function(o,s){B.apply(o,j(s)?s:[s])},$=Date.prototype.toISOString,V=w.default,U={addQueryPrefix:!1,allowDots:!1,charset:\"utf-8\",charsetSentinel:!1,delimiter:\"&\",encode:!0,encoder:_.encode,encodeValuesOnly:!1,format:V,formatter:w.formatters[V],indices:!1,serializeDate:function serializeDate(o){return $.call(o)},skipNulls:!1,strictNullHandling:!1},z={},Y=function stringify(o,s,i,w,x,C,B,$,V,Y,Z,ee,ie,ae,ce,le){for(var pe=o,de=le,fe=0,ye=!1;void 0!==(de=de.get(z))&&!ye;){var be=de.get(o);if(fe+=1,void 0!==be){if(be===fe)throw new RangeError(\"Cyclic object value\");ye=!0}void 0===de.get(z)&&(fe=0)}if(\"function\"==typeof $?pe=$(s,pe):pe instanceof Date?pe=Z(pe):\"comma\"===i&&j(pe)&&(pe=_.maybeMap(pe,(function(o){return o instanceof Date?Z(o):o}))),null===pe){if(x)return B&&!ae?B(s,U.encoder,ce,\"key\",ee):s;pe=\"\"}if(function isNonNullishPrimitive(o){return\"string\"==typeof o||\"number\"==typeof o||\"boolean\"==typeof o||\"symbol\"==typeof o||\"bigint\"==typeof o}(pe)||_.isBuffer(pe)){if(B){var _e=ae?s:B(s,U.encoder,ce,\"key\",ee);if(\"comma\"===i&&ae){for(var we=L.call(String(pe),\",\"),Se=\"\",xe=0;xe<we.length;++xe)Se+=(0===xe?\"\":\",\")+ie(B(we[xe],U.encoder,ce,\"value\",ee));return[ie(_e)+(w&&j(pe)&&1===we.length?\"[]\":\"\")+\"=\"+Se]}return[ie(_e)+\"=\"+ie(B(pe,U.encoder,ce,\"value\",ee))]}return[ie(s)+\"=\"+ie(String(pe))]}var Pe,Te=[];if(void 0===pe)return Te;if(\"comma\"===i&&j(pe))Pe=[{value:pe.length>0?pe.join(\",\")||null:void 0}];else if(j($))Pe=$;else{var Re=Object.keys(pe);Pe=V?Re.sort(V):Re}for(var qe=w&&j(pe)&&1===pe.length?s+\"[]\":s,$e=0;$e<Pe.length;++$e){var ze=Pe[$e],We=\"object\"==typeof ze&&void 0!==ze.value?ze.value:pe[ze];if(!C||null!==We){var He=j(pe)?\"function\"==typeof i?i(qe,ze):qe:qe+(Y?\".\"+ze:\"[\"+ze+\"]\");le.set(o,fe);var Ye=u();Ye.set(z,le),pushToArray(Te,stringify(We,He,i,w,x,C,B,$,V,Y,Z,ee,ie,ae,ce,Ye))}}return Te};o.exports=function(o,s){var i,_=o,L=function normalizeStringifyOptions(o){if(!o)return U;if(null!==o.encoder&&void 0!==o.encoder&&\"function\"!=typeof o.encoder)throw new TypeError(\"Encoder has to be a function.\");var s=o.charset||U.charset;if(void 0!==o.charset&&\"utf-8\"!==o.charset&&\"iso-8859-1\"!==o.charset)throw new TypeError(\"The charset option must be either utf-8, iso-8859-1, or undefined\");var i=w.default;if(void 0!==o.format){if(!x.call(w.formatters,o.format))throw new TypeError(\"Unknown format option provided.\");i=o.format}var u=w.formatters[i],_=U.filter;return(\"function\"==typeof o.filter||j(o.filter))&&(_=o.filter),{addQueryPrefix:\"boolean\"==typeof o.addQueryPrefix?o.addQueryPrefix:U.addQueryPrefix,allowDots:void 0===o.allowDots?U.allowDots:!!o.allowDots,charset:s,charsetSentinel:\"boolean\"==typeof o.charsetSentinel?o.charsetSentinel:U.charsetSentinel,delimiter:void 0===o.delimiter?U.delimiter:o.delimiter,encode:\"boolean\"==typeof o.encode?o.encode:U.encode,encoder:\"function\"==typeof o.encoder?o.encoder:U.encoder,encodeValuesOnly:\"boolean\"==typeof o.encodeValuesOnly?o.encodeValuesOnly:U.encodeValuesOnly,filter:_,format:i,formatter:u,serializeDate:\"function\"==typeof o.serializeDate?o.serializeDate:U.serializeDate,skipNulls:\"boolean\"==typeof o.skipNulls?o.skipNulls:U.skipNulls,sort:\"function\"==typeof o.sort?o.sort:null,strictNullHandling:\"boolean\"==typeof o.strictNullHandling?o.strictNullHandling:U.strictNullHandling}}(s);\"function\"==typeof L.filter?_=(0,L.filter)(\"\",_):j(L.filter)&&(i=L.filter);var B,$=[];if(\"object\"!=typeof _||null===_)return\"\";B=s&&s.arrayFormat in C?s.arrayFormat:s&&\"indices\"in s?s.indices?\"indices\":\"repeat\":\"indices\";var V=C[B];if(s&&\"commaRoundTrip\"in s&&\"boolean\"!=typeof s.commaRoundTrip)throw new TypeError(\"`commaRoundTrip` must be a boolean, or absent\");var z=\"comma\"===V&&s&&s.commaRoundTrip;i||(i=Object.keys(_)),L.sort&&i.sort(L.sort);for(var Z=u(),ee=0;ee<i.length;++ee){var ie=i[ee];L.skipNulls&&null===_[ie]||pushToArray($,Y(_[ie],ie,V,z,L.strictNullHandling,L.skipNulls,L.encode?L.encoder:null,L.filter,L.sort,L.allowDots,L.serializeDate,L.format,L.formatter,L.encodeValuesOnly,L.charset,Z))}var ae=$.join(L.delimiter),ce=!0===L.addQueryPrefix?\"?\":\"\";return L.charsetSentinel&&(\"iso-8859-1\"===L.charset?ce+=\"utf8=%26%2310003%3B&\":ce+=\"utf8=%E2%9C%93&\"),ae.length>0?ce+ae:\"\"}},37720:(o,s,i)=>{\"use strict\";var u=i(74765),_=Object.prototype.hasOwnProperty,w=Array.isArray,x=function(){for(var o=[],s=0;s<256;++s)o.push(\"%\"+((s<16?\"0\":\"\")+s.toString(16)).toUpperCase());return o}(),C=function arrayToObject(o,s){for(var i=s&&s.plainObjects?Object.create(null):{},u=0;u<o.length;++u)void 0!==o[u]&&(i[u]=o[u]);return i};o.exports={arrayToObject:C,assign:function assignSingleSource(o,s){return Object.keys(s).reduce((function(o,i){return o[i]=s[i],o}),o)},combine:function combine(o,s){return[].concat(o,s)},compact:function compact(o){for(var s=[{obj:{o},prop:\"o\"}],i=[],u=0;u<s.length;++u)for(var _=s[u],x=_.obj[_.prop],C=Object.keys(x),j=0;j<C.length;++j){var L=C[j],B=x[L];\"object\"==typeof B&&null!==B&&-1===i.indexOf(B)&&(s.push({obj:x,prop:L}),i.push(B))}return function compactQueue(o){for(;o.length>1;){var s=o.pop(),i=s.obj[s.prop];if(w(i)){for(var u=[],_=0;_<i.length;++_)void 0!==i[_]&&u.push(i[_]);s.obj[s.prop]=u}}}(s),o},decode:function(o,s,i){var u=o.replace(/\\+/g,\" \");if(\"iso-8859-1\"===i)return u.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(u)}catch(o){return u}},encode:function encode(o,s,i,_,w){if(0===o.length)return o;var C=o;if(\"symbol\"==typeof o?C=Symbol.prototype.toString.call(o):\"string\"!=typeof o&&(C=String(o)),\"iso-8859-1\"===i)return escape(C).replace(/%u[0-9a-f]{4}/gi,(function(o){return\"%26%23\"+parseInt(o.slice(2),16)+\"%3B\"}));for(var j=\"\",L=0;L<C.length;++L){var B=C.charCodeAt(L);45===B||46===B||95===B||126===B||B>=48&&B<=57||B>=65&&B<=90||B>=97&&B<=122||w===u.RFC1738&&(40===B||41===B)?j+=C.charAt(L):B<128?j+=x[B]:B<2048?j+=x[192|B>>6]+x[128|63&B]:B<55296||B>=57344?j+=x[224|B>>12]+x[128|B>>6&63]+x[128|63&B]:(L+=1,B=65536+((1023&B)<<10|1023&C.charCodeAt(L)),j+=x[240|B>>18]+x[128|B>>12&63]+x[128|B>>6&63]+x[128|63&B])}return j},isBuffer:function isBuffer(o){return!(!o||\"object\"!=typeof o)&&!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))},isRegExp:function isRegExp(o){return\"[object RegExp]\"===Object.prototype.toString.call(o)},maybeMap:function maybeMap(o,s){if(w(o)){for(var i=[],u=0;u<o.length;u+=1)i.push(s(o[u]));return i}return s(o)},merge:function merge(o,s,i){if(!s)return o;if(\"object\"!=typeof s){if(w(o))o.push(s);else{if(!o||\"object\"!=typeof o)return[o,s];(i&&(i.plainObjects||i.allowPrototypes)||!_.call(Object.prototype,s))&&(o[s]=!0)}return o}if(!o||\"object\"!=typeof o)return[o].concat(s);var u=o;return w(o)&&!w(s)&&(u=C(o,i)),w(o)&&w(s)?(s.forEach((function(s,u){if(_.call(o,u)){var w=o[u];w&&\"object\"==typeof w&&s&&\"object\"==typeof s?o[u]=merge(w,s,i):o.push(s)}else o[u]=s})),o):Object.keys(s).reduce((function(o,u){var w=s[u];return _.call(o,u)?o[u]=merge(o[u],w,i):o[u]=w,o}),u)}}},73992:(o,s)=>{\"use strict\";var i=Object.prototype.hasOwnProperty;function decode(o){try{return decodeURIComponent(o.replace(/\\+/g,\" \"))}catch(o){return null}}function encode(o){try{return encodeURIComponent(o)}catch(o){return null}}s.stringify=function querystringify(o,s){s=s||\"\";var u,_,w=[];for(_ in\"string\"!=typeof s&&(s=\"?\"),o)if(i.call(o,_)){if((u=o[_])||null!=u&&!isNaN(u)||(u=\"\"),_=encode(_),u=encode(u),null===_||null===u)continue;w.push(_+\"=\"+u)}return w.length?s+w.join(\"&\"):\"\"},s.parse=function querystring(o){for(var s,i=/([^=?#&]+)=?([^&]*)/g,u={};s=i.exec(o);){var _=decode(s[1]),w=decode(s[2]);null===_||null===w||_ in u||(u[_]=w)}return u}},41859:(o,s,i)=>{const u=i(27096),_=i(78004),w=u.types;o.exports=class RandExp{constructor(o,s){if(this._setDefaults(o),o instanceof RegExp)this.ignoreCase=o.ignoreCase,this.multiline=o.multiline,o=o.source;else{if(\"string\"!=typeof o)throw new Error(\"Expected a regexp or string\");this.ignoreCase=s&&-1!==s.indexOf(\"i\"),this.multiline=s&&-1!==s.indexOf(\"m\")}this.tokens=u(o)}_setDefaults(o){this.max=null!=o.max?o.max:null!=RandExp.prototype.max?RandExp.prototype.max:100,this.defaultRange=o.defaultRange?o.defaultRange:this.defaultRange.clone(),o.randInt&&(this.randInt=o.randInt)}gen(){return this._gen(this.tokens,[])}_gen(o,s){var i,u,_,x,C;switch(o.type){case w.ROOT:case w.GROUP:if(o.followedBy||o.notFollowedBy)return\"\";for(o.remember&&void 0===o.groupNumber&&(o.groupNumber=s.push(null)-1),u=\"\",x=0,C=(i=o.options?this._randSelect(o.options):o.stack).length;x<C;x++)u+=this._gen(i[x],s);return o.remember&&(s[o.groupNumber]=u),u;case w.POSITION:return\"\";case w.SET:var j=this._expand(o);return j.length?String.fromCharCode(this._randSelect(j)):\"\";case w.REPETITION:for(_=this.randInt(o.min,o.max===1/0?o.min+this.max:o.max),u=\"\",x=0;x<_;x++)u+=this._gen(o.value,s);return u;case w.REFERENCE:return s[o.value-1]||\"\";case w.CHAR:var L=this.ignoreCase&&this._randBool()?this._toOtherCase(o.value):o.value;return String.fromCharCode(L)}}_toOtherCase(o){return o+(97<=o&&o<=122?-32:65<=o&&o<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(o){return o instanceof _?o.index(this.randInt(0,o.length-1)):o[this.randInt(0,o.length-1)]}_expand(o){if(o.type===u.types.CHAR)return new _(o.value);if(o.type===u.types.RANGE)return new _(o.from,o.to);{let s=new _;for(let i=0;i<o.set.length;i++){let u=this._expand(o.set[i]);if(s.add(u),this.ignoreCase)for(let o=0;o<u.length;o++){let i=u.index(o),_=this._toOtherCase(i);i!==_&&s.add(_)}}return o.not?this.defaultRange.clone().subtract(s):this.defaultRange.clone().intersect(s)}}randInt(o,s){return o+Math.floor(Math.random()*(1+s-o))}get defaultRange(){return this._range=this._range||new _(32,126)}set defaultRange(o){this._range=o}static randexp(o,s){var i;return\"string\"==typeof o&&(o=new RegExp(o,s)),void 0===o._randexp?(i=new RandExp(o,s),o._randexp=i):(i=o._randexp)._setDefaults(o),i.gen()}static sugar(){RegExp.prototype.gen=function(){return RandExp.randexp(this)}}}},53209:(o,s,i)=>{\"use strict\";var u=i(65606),_=65536,w=4294967295;var x=i(92861).Buffer,C=i.g.crypto||i.g.msCrypto;C&&C.getRandomValues?o.exports=function randomBytes(o,s){if(o>w)throw new RangeError(\"requested too many random bytes\");var i=x.allocUnsafe(o);if(o>0)if(o>_)for(var j=0;j<o;j+=_)C.getRandomValues(i.slice(j,j+_));else C.getRandomValues(i);if(\"function\"==typeof s)return u.nextTick((function(){s(null,i)}));return i}:o.exports=function oldBrowser(){throw new Error(\"Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11\")}},25264:(o,s,i)=>{\"use strict\";function _typeof(o){return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},_typeof(o)}Object.defineProperty(s,\"__esModule\",{value:!0}),s.CopyToClipboard=void 0;var u=_interopRequireDefault(i(96540)),_=_interopRequireDefault(i(17965)),w=[\"text\",\"onCopy\",\"options\",\"children\"];function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}function ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(i),!0).forEach((function(s){_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}function _objectWithoutProperties(o,s){if(null==o)return{};var i,u,_=function _objectWithoutPropertiesLoose(o,s){if(null==o)return{};var i,u,_={},w=Object.keys(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||(_[i]=o[i]);return _}(o,s);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(o,i)&&(_[i]=o[i])}return _}function _defineProperties(o,s){for(var i=0;i<s.length;i++){var u=s[i];u.enumerable=u.enumerable||!1,u.configurable=!0,\"value\"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function _setPrototypeOf(o,s){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,s){return o.__proto__=s,o},_setPrototypeOf(o,s)}function _createSuper(o){var s=function _isNativeReflectConstruct(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(o){return!1}}();return function _createSuperInternal(){var i,u=_getPrototypeOf(o);if(s){var _=_getPrototypeOf(this).constructor;i=Reflect.construct(u,arguments,_)}else i=u.apply(this,arguments);return function _possibleConstructorReturn(o,s){if(s&&(\"object\"===_typeof(s)||\"function\"==typeof s))return s;if(void 0!==s)throw new TypeError(\"Derived constructors may only return object or undefined\");return _assertThisInitialized(o)}(this,i)}}function _assertThisInitialized(o){if(void 0===o)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return o}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(o)}function _defineProperty(o,s,i){return s in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}var x=function(o){!function _inherits(o,s){if(\"function\"!=typeof s&&null!==s)throw new TypeError(\"Super expression must either be null or a function\");o.prototype=Object.create(s&&s.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,\"prototype\",{writable:!1}),s&&_setPrototypeOf(o,s)}(CopyToClipboard,o);var s=_createSuper(CopyToClipboard);function CopyToClipboard(){var o;!function _classCallCheck(o,s){if(!(o instanceof s))throw new TypeError(\"Cannot call a class as a function\")}(this,CopyToClipboard);for(var i=arguments.length,w=new Array(i),x=0;x<i;x++)w[x]=arguments[x];return _defineProperty(_assertThisInitialized(o=s.call.apply(s,[this].concat(w))),\"onClick\",(function(s){var i=o.props,w=i.text,x=i.onCopy,C=i.children,j=i.options,L=u.default.Children.only(C),B=(0,_.default)(w,j);x&&x(w,B),L&&L.props&&\"function\"==typeof L.props.onClick&&L.props.onClick(s)})),o}return function _createClass(o,s,i){return s&&_defineProperties(o.prototype,s),i&&_defineProperties(o,i),Object.defineProperty(o,\"prototype\",{writable:!1}),o}(CopyToClipboard,[{key:\"render\",value:function render(){var o=this.props,s=(o.text,o.onCopy,o.options,o.children),i=_objectWithoutProperties(o,w),_=u.default.Children.only(s);return u.default.cloneElement(_,_objectSpread(_objectSpread({},i),{},{onClick:this.onClick}))}}]),CopyToClipboard}(u.default.PureComponent);s.CopyToClipboard=x,_defineProperty(x,\"defaultProps\",{onCopy:void 0,options:void 0})},59399:(o,s,i)=>{\"use strict\";var u=i(25264).CopyToClipboard;u.CopyToClipboard=u,o.exports=u},81214:(o,s,i)=>{\"use strict\";function _typeof(o){return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},_typeof(o)}Object.defineProperty(s,\"__esModule\",{value:!0}),s.DebounceInput=void 0;var u=_interopRequireDefault(i(96540)),_=_interopRequireDefault(i(20181)),w=[\"element\",\"onChange\",\"value\",\"minLength\",\"debounceTimeout\",\"forceNotifyByEnter\",\"forceNotifyOnBlur\",\"onKeyDown\",\"onBlur\",\"inputRef\"];function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}function _objectWithoutProperties(o,s){if(null==o)return{};var i,u,_=function _objectWithoutPropertiesLoose(o,s){if(null==o)return{};var i,u,_={},w=Object.keys(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||(_[i]=o[i]);return _}(o,s);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(o,i)&&(_[i]=o[i])}return _}function ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(i),!0).forEach((function(s){_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}function _defineProperties(o,s){for(var i=0;i<s.length;i++){var u=s[i];u.enumerable=u.enumerable||!1,u.configurable=!0,\"value\"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function _setPrototypeOf(o,s){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,s){return o.__proto__=s,o},_setPrototypeOf(o,s)}function _createSuper(o){var s=function _isNativeReflectConstruct(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(o){return!1}}();return function _createSuperInternal(){var i,u=_getPrototypeOf(o);if(s){var _=_getPrototypeOf(this).constructor;i=Reflect.construct(u,arguments,_)}else i=u.apply(this,arguments);return function _possibleConstructorReturn(o,s){if(s&&(\"object\"===_typeof(s)||\"function\"==typeof s))return s;if(void 0!==s)throw new TypeError(\"Derived constructors may only return object or undefined\");return _assertThisInitialized(o)}(this,i)}}function _assertThisInitialized(o){if(void 0===o)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return o}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(o)}function _defineProperty(o,s,i){return s in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}var x=function(o){!function _inherits(o,s){if(\"function\"!=typeof s&&null!==s)throw new TypeError(\"Super expression must either be null or a function\");o.prototype=Object.create(s&&s.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,\"prototype\",{writable:!1}),s&&_setPrototypeOf(o,s)}(DebounceInput,o);var s=_createSuper(DebounceInput);function DebounceInput(o){var i;!function _classCallCheck(o,s){if(!(o instanceof s))throw new TypeError(\"Cannot call a class as a function\")}(this,DebounceInput),_defineProperty(_assertThisInitialized(i=s.call(this,o)),\"onChange\",(function(o){o.persist();var s=i.state.value,u=i.props.minLength;i.setState({value:o.target.value},(function(){var _=i.state.value;_.length>=u?i.notify(o):s.length>_.length&&i.notify(_objectSpread(_objectSpread({},o),{},{target:_objectSpread(_objectSpread({},o.target),{},{value:\"\"})}))}))})),_defineProperty(_assertThisInitialized(i),\"onKeyDown\",(function(o){\"Enter\"===o.key&&i.forceNotify(o);var s=i.props.onKeyDown;s&&(o.persist(),s(o))})),_defineProperty(_assertThisInitialized(i),\"onBlur\",(function(o){i.forceNotify(o);var s=i.props.onBlur;s&&(o.persist(),s(o))})),_defineProperty(_assertThisInitialized(i),\"createNotifier\",(function(o){if(o<0)i.notify=function(){return null};else if(0===o)i.notify=i.doNotify;else{var s=(0,_.default)((function(o){i.isDebouncing=!1,i.doNotify(o)}),o);i.notify=function(o){i.isDebouncing=!0,s(o)},i.flush=function(){return s.flush()},i.cancel=function(){i.isDebouncing=!1,s.cancel()}}})),_defineProperty(_assertThisInitialized(i),\"doNotify\",(function(){i.props.onChange.apply(void 0,arguments)})),_defineProperty(_assertThisInitialized(i),\"forceNotify\",(function(o){var s=i.props.debounceTimeout;if(i.isDebouncing||!(s>0)){i.cancel&&i.cancel();var u=i.state.value,_=i.props.minLength;u.length>=_?i.doNotify(o):i.doNotify(_objectSpread(_objectSpread({},o),{},{target:_objectSpread(_objectSpread({},o.target),{},{value:u})}))}})),i.isDebouncing=!1,i.state={value:void 0===o.value||null===o.value?\"\":o.value};var u=i.props.debounceTimeout;return i.createNotifier(u),i}return function _createClass(o,s,i){return s&&_defineProperties(o.prototype,s),i&&_defineProperties(o,i),Object.defineProperty(o,\"prototype\",{writable:!1}),o}(DebounceInput,[{key:\"componentDidUpdate\",value:function componentDidUpdate(o){if(!this.isDebouncing){var s=this.props,i=s.value,u=s.debounceTimeout,_=o.debounceTimeout,w=o.value,x=this.state.value;void 0!==i&&w!==i&&x!==i&&this.setState({value:i}),u!==_&&this.createNotifier(u)}}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){this.flush&&this.flush()}},{key:\"render\",value:function render(){var o,s,i=this.props,_=i.element,x=(i.onChange,i.value,i.minLength,i.debounceTimeout,i.forceNotifyByEnter),C=i.forceNotifyOnBlur,j=i.onKeyDown,L=i.onBlur,B=i.inputRef,$=_objectWithoutProperties(i,w),V=this.state.value;o=x?{onKeyDown:this.onKeyDown}:j?{onKeyDown:j}:{},s=C?{onBlur:this.onBlur}:L?{onBlur:L}:{};var U=B?{ref:B}:{};return u.default.createElement(_,_objectSpread(_objectSpread(_objectSpread(_objectSpread({},$),{},{onChange:this.onChange,value:V},o),s),U))}}]),DebounceInput}(u.default.PureComponent);s.DebounceInput=x,_defineProperty(x,\"defaultProps\",{element:\"input\",type:\"text\",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0})},24677:(o,s,i)=>{\"use strict\";var u=i(81214).DebounceInput;u.DebounceInput=u,o.exports=u},22551:(o,s,i)=>{\"use strict\";var u=i(96540),_=i(69982);function p(o){for(var s=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+o,i=1;i<arguments.length;i++)s+=\"&args[]=\"+encodeURIComponent(arguments[i]);return\"Minified React error #\"+o+\"; visit \"+s+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var w=new Set,x={};function fa(o,s){ha(o,s),ha(o+\"Capture\",s)}function ha(o,s){for(x[o]=s,o=0;o<s.length;o++)w.add(s[o])}var C=!(\"undefined\"==typeof window||void 0===window.document||void 0===window.document.createElement),j=Object.prototype.hasOwnProperty,L=/^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$/,B={},$={};function v(o,s,i,u,_,w,x){this.acceptsBooleans=2===s||3===s||4===s,this.attributeName=u,this.attributeNamespace=_,this.mustUseProperty=i,this.propertyName=o,this.type=s,this.sanitizeURL=w,this.removeEmptyString=x}var V={};\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach((function(o){V[o]=new v(o,0,!1,o,null,!1,!1)})),[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach((function(o){var s=o[0];V[s]=new v(s,1,!1,o[1],null,!1,!1)})),[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach((function(o){V[o]=new v(o,2,!1,o.toLowerCase(),null,!1,!1)})),[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach((function(o){V[o]=new v(o,2,!1,o,null,!1,!1)})),\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach((function(o){V[o]=new v(o,3,!1,o.toLowerCase(),null,!1,!1)})),[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach((function(o){V[o]=new v(o,3,!0,o,null,!1,!1)})),[\"capture\",\"download\"].forEach((function(o){V[o]=new v(o,4,!1,o,null,!1,!1)})),[\"cols\",\"rows\",\"size\",\"span\"].forEach((function(o){V[o]=new v(o,6,!1,o,null,!1,!1)})),[\"rowSpan\",\"start\"].forEach((function(o){V[o]=new v(o,5,!1,o.toLowerCase(),null,!1,!1)}));var U=/[\\-:]([a-z])/g;function sa(o){return o[1].toUpperCase()}function ta(o,s,i,u){var _=V.hasOwnProperty(s)?V[s]:null;(null!==_?0!==_.type:u||!(2<s.length)||\"o\"!==s[0]&&\"O\"!==s[0]||\"n\"!==s[1]&&\"N\"!==s[1])&&(function qa(o,s,i,u){if(null==s||function pa(o,s,i,u){if(null!==i&&0===i.type)return!1;switch(typeof s){case\"function\":case\"symbol\":return!0;case\"boolean\":return!u&&(null!==i?!i.acceptsBooleans:\"data-\"!==(o=o.toLowerCase().slice(0,5))&&\"aria-\"!==o);default:return!1}}(o,s,i,u))return!0;if(u)return!1;if(null!==i)switch(i.type){case 3:return!s;case 4:return!1===s;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}(s,i,_,u)&&(i=null),u||null===_?function oa(o){return!!j.call($,o)||!j.call(B,o)&&(L.test(o)?$[o]=!0:(B[o]=!0,!1))}(s)&&(null===i?o.removeAttribute(s):o.setAttribute(s,\"\"+i)):_.mustUseProperty?o[_.propertyName]=null===i?3!==_.type&&\"\":i:(s=_.attributeName,u=_.attributeNamespace,null===i?o.removeAttribute(s):(i=3===(_=_.type)||4===_&&!0===i?\"\":\"\"+i,u?o.setAttributeNS(u,s,i):o.setAttribute(s,i))))}\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach((function(o){var s=o.replace(U,sa);V[s]=new v(s,1,!1,o,null,!1,!1)})),\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach((function(o){var s=o.replace(U,sa);V[s]=new v(s,1,!1,o,\"http://www.w3.org/1999/xlink\",!1,!1)})),[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach((function(o){var s=o.replace(U,sa);V[s]=new v(s,1,!1,o,\"http://www.w3.org/XML/1998/namespace\",!1,!1)})),[\"tabIndex\",\"crossOrigin\"].forEach((function(o){V[o]=new v(o,1,!1,o.toLowerCase(),null,!1,!1)})),V.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1),[\"src\",\"href\",\"action\",\"formAction\"].forEach((function(o){V[o]=new v(o,1,!1,o.toLowerCase(),null,!0,!0)}));var z=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Y=Symbol.for(\"react.element\"),Z=Symbol.for(\"react.portal\"),ee=Symbol.for(\"react.fragment\"),ie=Symbol.for(\"react.strict_mode\"),ae=Symbol.for(\"react.profiler\"),ce=Symbol.for(\"react.provider\"),le=Symbol.for(\"react.context\"),pe=Symbol.for(\"react.forward_ref\"),de=Symbol.for(\"react.suspense\"),fe=Symbol.for(\"react.suspense_list\"),ye=Symbol.for(\"react.memo\"),be=Symbol.for(\"react.lazy\");Symbol.for(\"react.scope\"),Symbol.for(\"react.debug_trace_mode\");var _e=Symbol.for(\"react.offscreen\");Symbol.for(\"react.legacy_hidden\"),Symbol.for(\"react.cache\"),Symbol.for(\"react.tracing_marker\");var we=Symbol.iterator;function Ka(o){return null===o||\"object\"!=typeof o?null:\"function\"==typeof(o=we&&o[we]||o[\"@@iterator\"])?o:null}var Se,xe=Object.assign;function Ma(o){if(void 0===Se)try{throw Error()}catch(o){var s=o.stack.trim().match(/\\n( *(at )?)/);Se=s&&s[1]||\"\"}return\"\\n\"+Se+o}var Pe=!1;function Oa(o,s){if(!o||Pe)return\"\";Pe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,\"props\",{set:function(){throw Error()}}),\"object\"==typeof Reflect&&Reflect.construct){try{Reflect.construct(s,[])}catch(o){var u=o}Reflect.construct(o,[],s)}else{try{s.call()}catch(o){u=o}o.call(s.prototype)}else{try{throw Error()}catch(o){u=o}o()}}catch(s){if(s&&u&&\"string\"==typeof s.stack){for(var _=s.stack.split(\"\\n\"),w=u.stack.split(\"\\n\"),x=_.length-1,C=w.length-1;1<=x&&0<=C&&_[x]!==w[C];)C--;for(;1<=x&&0<=C;x--,C--)if(_[x]!==w[C]){if(1!==x||1!==C)do{if(x--,0>--C||_[x]!==w[C]){var j=\"\\n\"+_[x].replace(\" at new \",\" at \");return o.displayName&&j.includes(\"<anonymous>\")&&(j=j.replace(\"<anonymous>\",o.displayName)),j}}while(1<=x&&0<=C);break}}}finally{Pe=!1,Error.prepareStackTrace=i}return(o=o?o.displayName||o.name:\"\")?Ma(o):\"\"}function Pa(o){switch(o.tag){case 5:return Ma(o.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return o=Oa(o.type,!1);case 11:return o=Oa(o.type.render,!1);case 1:return o=Oa(o.type,!0);default:return\"\"}}function Qa(o){if(null==o)return null;if(\"function\"==typeof o)return o.displayName||o.name||null;if(\"string\"==typeof o)return o;switch(o){case ee:return\"Fragment\";case Z:return\"Portal\";case ae:return\"Profiler\";case ie:return\"StrictMode\";case de:return\"Suspense\";case fe:return\"SuspenseList\"}if(\"object\"==typeof o)switch(o.$$typeof){case le:return(o.displayName||\"Context\")+\".Consumer\";case ce:return(o._context.displayName||\"Context\")+\".Provider\";case pe:var s=o.render;return(o=o.displayName)||(o=\"\"!==(o=s.displayName||s.name||\"\")?\"ForwardRef(\"+o+\")\":\"ForwardRef\"),o;case ye:return null!==(s=o.displayName||null)?s:Qa(o.type)||\"Memo\";case be:s=o._payload,o=o._init;try{return Qa(o(s))}catch(o){}}return null}function Ra(o){var s=o.type;switch(o.tag){case 24:return\"Cache\";case 9:return(s.displayName||\"Context\")+\".Consumer\";case 10:return(s._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return o=(o=s.render).displayName||o.name||\"\",s.displayName||(\"\"!==o?\"ForwardRef(\"+o+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return s;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(s);case 8:return s===ie?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";case 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"==typeof s)return s.displayName||s.name||null;if(\"string\"==typeof s)return s}return null}function Sa(o){switch(typeof o){case\"boolean\":case\"number\":case\"string\":case\"undefined\":case\"object\":return o;default:return\"\"}}function Ta(o){var s=o.type;return(o=o.nodeName)&&\"input\"===o.toLowerCase()&&(\"checkbox\"===s||\"radio\"===s)}function Va(o){o._valueTracker||(o._valueTracker=function Ua(o){var s=Ta(o)?\"checked\":\"value\",i=Object.getOwnPropertyDescriptor(o.constructor.prototype,s),u=\"\"+o[s];if(!o.hasOwnProperty(s)&&void 0!==i&&\"function\"==typeof i.get&&\"function\"==typeof i.set){var _=i.get,w=i.set;return Object.defineProperty(o,s,{configurable:!0,get:function(){return _.call(this)},set:function(o){u=\"\"+o,w.call(this,o)}}),Object.defineProperty(o,s,{enumerable:i.enumerable}),{getValue:function(){return u},setValue:function(o){u=\"\"+o},stopTracking:function(){o._valueTracker=null,delete o[s]}}}}(o))}function Wa(o){if(!o)return!1;var s=o._valueTracker;if(!s)return!0;var i=s.getValue(),u=\"\";return o&&(u=Ta(o)?o.checked?\"true\":\"false\":o.value),(o=u)!==i&&(s.setValue(o),!0)}function Xa(o){if(void 0===(o=o||(\"undefined\"!=typeof document?document:void 0)))return null;try{return o.activeElement||o.body}catch(s){return o.body}}function Ya(o,s){var i=s.checked;return xe({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=i?i:o._wrapperState.initialChecked})}function Za(o,s){var i=null==s.defaultValue?\"\":s.defaultValue,u=null!=s.checked?s.checked:s.defaultChecked;i=Sa(null!=s.value?s.value:i),o._wrapperState={initialChecked:u,initialValue:i,controlled:\"checkbox\"===s.type||\"radio\"===s.type?null!=s.checked:null!=s.value}}function ab(o,s){null!=(s=s.checked)&&ta(o,\"checked\",s,!1)}function bb(o,s){ab(o,s);var i=Sa(s.value),u=s.type;if(null!=i)\"number\"===u?(0===i&&\"\"===o.value||o.value!=i)&&(o.value=\"\"+i):o.value!==\"\"+i&&(o.value=\"\"+i);else if(\"submit\"===u||\"reset\"===u)return void o.removeAttribute(\"value\");s.hasOwnProperty(\"value\")?cb(o,s.type,i):s.hasOwnProperty(\"defaultValue\")&&cb(o,s.type,Sa(s.defaultValue)),null==s.checked&&null!=s.defaultChecked&&(o.defaultChecked=!!s.defaultChecked)}function db(o,s,i){if(s.hasOwnProperty(\"value\")||s.hasOwnProperty(\"defaultValue\")){var u=s.type;if(!(\"submit\"!==u&&\"reset\"!==u||void 0!==s.value&&null!==s.value))return;s=\"\"+o._wrapperState.initialValue,i||s===o.value||(o.value=s),o.defaultValue=s}\"\"!==(i=o.name)&&(o.name=\"\"),o.defaultChecked=!!o._wrapperState.initialChecked,\"\"!==i&&(o.name=i)}function cb(o,s,i){\"number\"===s&&Xa(o.ownerDocument)===o||(null==i?o.defaultValue=\"\"+o._wrapperState.initialValue:o.defaultValue!==\"\"+i&&(o.defaultValue=\"\"+i))}var Te=Array.isArray;function fb(o,s,i,u){if(o=o.options,s){s={};for(var _=0;_<i.length;_++)s[\"$\"+i[_]]=!0;for(i=0;i<o.length;i++)_=s.hasOwnProperty(\"$\"+o[i].value),o[i].selected!==_&&(o[i].selected=_),_&&u&&(o[i].defaultSelected=!0)}else{for(i=\"\"+Sa(i),s=null,_=0;_<o.length;_++){if(o[_].value===i)return o[_].selected=!0,void(u&&(o[_].defaultSelected=!0));null!==s||o[_].disabled||(s=o[_])}null!==s&&(s.selected=!0)}}function gb(o,s){if(null!=s.dangerouslySetInnerHTML)throw Error(p(91));return xe({},s,{value:void 0,defaultValue:void 0,children:\"\"+o._wrapperState.initialValue})}function hb(o,s){var i=s.value;if(null==i){if(i=s.children,s=s.defaultValue,null!=i){if(null!=s)throw Error(p(92));if(Te(i)){if(1<i.length)throw Error(p(93));i=i[0]}s=i}null==s&&(s=\"\"),i=s}o._wrapperState={initialValue:Sa(i)}}function ib(o,s){var i=Sa(s.value),u=Sa(s.defaultValue);null!=i&&((i=\"\"+i)!==o.value&&(o.value=i),null==s.defaultValue&&o.defaultValue!==i&&(o.defaultValue=i)),null!=u&&(o.defaultValue=\"\"+u)}function jb(o){var s=o.textContent;s===o._wrapperState.initialValue&&\"\"!==s&&null!==s&&(o.value=s)}function kb(o){switch(o){case\"svg\":return\"http://www.w3.org/2000/svg\";case\"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function lb(o,s){return null==o||\"http://www.w3.org/1999/xhtml\"===o?kb(s):\"http://www.w3.org/2000/svg\"===o&&\"foreignObject\"===s?\"http://www.w3.org/1999/xhtml\":o}var Re,qe,$e=(qe=function(o,s){if(\"http://www.w3.org/2000/svg\"!==o.namespaceURI||\"innerHTML\"in o)o.innerHTML=s;else{for((Re=Re||document.createElement(\"div\")).innerHTML=\"<svg>\"+s.valueOf().toString()+\"</svg>\",s=Re.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;s.firstChild;)o.appendChild(s.firstChild)}},\"undefined\"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(o,s,i,u){MSApp.execUnsafeLocalFunction((function(){return qe(o,s)}))}:qe);function ob(o,s){if(s){var i=o.firstChild;if(i&&i===o.lastChild&&3===i.nodeType)return void(i.nodeValue=s)}o.textContent=s}var ze={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},We=[\"Webkit\",\"ms\",\"Moz\",\"O\"];function rb(o,s,i){return null==s||\"boolean\"==typeof s||\"\"===s?\"\":i||\"number\"!=typeof s||0===s||ze.hasOwnProperty(o)&&ze[o]?(\"\"+s).trim():s+\"px\"}function sb(o,s){for(var i in o=o.style,s)if(s.hasOwnProperty(i)){var u=0===i.indexOf(\"--\"),_=rb(i,s[i],u);\"float\"===i&&(i=\"cssFloat\"),u?o.setProperty(i,_):o[i]=_}}Object.keys(ze).forEach((function(o){We.forEach((function(s){s=s+o.charAt(0).toUpperCase()+o.substring(1),ze[s]=ze[o]}))}));var He=xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(o,s){if(s){if(He[o]&&(null!=s.children||null!=s.dangerouslySetInnerHTML))throw Error(p(137,o));if(null!=s.dangerouslySetInnerHTML){if(null!=s.children)throw Error(p(60));if(\"object\"!=typeof s.dangerouslySetInnerHTML||!(\"__html\"in s.dangerouslySetInnerHTML))throw Error(p(61))}if(null!=s.style&&\"object\"!=typeof s.style)throw Error(p(62))}}function vb(o,s){if(-1===o.indexOf(\"-\"))return\"string\"==typeof s.is;switch(o){case\"annotation-xml\":case\"color-profile\":case\"font-face\":case\"font-face-src\":case\"font-face-uri\":case\"font-face-format\":case\"font-face-name\":case\"missing-glyph\":return!1;default:return!0}}var Ye=null;function xb(o){return(o=o.target||o.srcElement||window).correspondingUseElement&&(o=o.correspondingUseElement),3===o.nodeType?o.parentNode:o}var Xe=null,Qe=null,et=null;function Bb(o){if(o=Cb(o)){if(\"function\"!=typeof Xe)throw Error(p(280));var s=o.stateNode;s&&(s=Db(s),Xe(o.stateNode,o.type,s))}}function Eb(o){Qe?et?et.push(o):et=[o]:Qe=o}function Fb(){if(Qe){var o=Qe,s=et;if(et=Qe=null,Bb(o),s)for(o=0;o<s.length;o++)Bb(s[o])}}function Gb(o,s){return o(s)}function Hb(){}var tt=!1;function Jb(o,s,i){if(tt)return o(s,i);tt=!0;try{return Gb(o,s,i)}finally{tt=!1,(null!==Qe||null!==et)&&(Hb(),Fb())}}function Kb(o,s){var i=o.stateNode;if(null===i)return null;var u=Db(i);if(null===u)return null;i=u[s];e:switch(s){case\"onClick\":case\"onClickCapture\":case\"onDoubleClick\":case\"onDoubleClickCapture\":case\"onMouseDown\":case\"onMouseDownCapture\":case\"onMouseMove\":case\"onMouseMoveCapture\":case\"onMouseUp\":case\"onMouseUpCapture\":case\"onMouseEnter\":(u=!u.disabled)||(u=!(\"button\"===(o=o.type)||\"input\"===o||\"select\"===o||\"textarea\"===o)),o=!u;break e;default:o=!1}if(o)return null;if(i&&\"function\"!=typeof i)throw Error(p(231,s,typeof i));return i}var rt=!1;if(C)try{var nt={};Object.defineProperty(nt,\"passive\",{get:function(){rt=!0}}),window.addEventListener(\"test\",nt,nt),window.removeEventListener(\"test\",nt,nt)}catch(qe){rt=!1}function Nb(o,s,i,u,_,w,x,C,j){var L=Array.prototype.slice.call(arguments,3);try{s.apply(i,L)}catch(o){this.onError(o)}}var ot=!1,st=null,it=!1,at=null,ct={onError:function(o){ot=!0,st=o}};function Tb(o,s,i,u,_,w,x,C,j){ot=!1,st=null,Nb.apply(ct,arguments)}function Vb(o){var s=o,i=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do{!!(4098&(s=o).flags)&&(i=s.return),o=s.return}while(o)}return 3===s.tag?i:null}function Wb(o){if(13===o.tag){var s=o.memoizedState;if(null===s&&(null!==(o=o.alternate)&&(s=o.memoizedState)),null!==s)return s.dehydrated}return null}function Xb(o){if(Vb(o)!==o)throw Error(p(188))}function Zb(o){return null!==(o=function Yb(o){var s=o.alternate;if(!s){if(null===(s=Vb(o)))throw Error(p(188));return s!==o?null:o}for(var i=o,u=s;;){var _=i.return;if(null===_)break;var w=_.alternate;if(null===w){if(null!==(u=_.return)){i=u;continue}break}if(_.child===w.child){for(w=_.child;w;){if(w===i)return Xb(_),o;if(w===u)return Xb(_),s;w=w.sibling}throw Error(p(188))}if(i.return!==u.return)i=_,u=w;else{for(var x=!1,C=_.child;C;){if(C===i){x=!0,i=_,u=w;break}if(C===u){x=!0,u=_,i=w;break}C=C.sibling}if(!x){for(C=w.child;C;){if(C===i){x=!0,i=w,u=_;break}if(C===u){x=!0,u=w,i=_;break}C=C.sibling}if(!x)throw Error(p(189))}}if(i.alternate!==u)throw Error(p(190))}if(3!==i.tag)throw Error(p(188));return i.stateNode.current===i?o:s}(o))?$b(o):null}function $b(o){if(5===o.tag||6===o.tag)return o;for(o=o.child;null!==o;){var s=$b(o);if(null!==s)return s;o=o.sibling}return null}var lt=_.unstable_scheduleCallback,ut=_.unstable_cancelCallback,pt=_.unstable_shouldYield,ht=_.unstable_requestPaint,dt=_.unstable_now,mt=_.unstable_getCurrentPriorityLevel,gt=_.unstable_ImmediatePriority,yt=_.unstable_UserBlockingPriority,vt=_.unstable_NormalPriority,bt=_.unstable_LowPriority,_t=_.unstable_IdlePriority,Et=null,wt=null;var St=Math.clz32?Math.clz32:function nc(o){return o>>>=0,0===o?32:31-(xt(o)/kt|0)|0},xt=Math.log,kt=Math.LN2;var Ot=64,Ct=4194304;function tc(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&o;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&o;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function uc(o,s){var i=o.pendingLanes;if(0===i)return 0;var u=0,_=o.suspendedLanes,w=o.pingedLanes,x=268435455&i;if(0!==x){var C=x&~_;0!==C?u=tc(C):0!==(w&=x)&&(u=tc(w))}else 0!==(x=i&~_)?u=tc(x):0!==w&&(u=tc(w));if(0===u)return 0;if(0!==s&&s!==u&&!(s&_)&&((_=u&-u)>=(w=s&-s)||16===_&&4194240&w))return s;if(4&u&&(u|=16&i),0!==(s=o.entangledLanes))for(o=o.entanglements,s&=u;0<s;)_=1<<(i=31-St(s)),u|=o[i],s&=~_;return u}function vc(o,s){switch(o){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;default:return-1}}function xc(o){return 0!==(o=-1073741825&o.pendingLanes)?o:1073741824&o?1073741824:0}function yc(){var o=Ot;return!(4194240&(Ot<<=1))&&(Ot=64),o}function zc(o){for(var s=[],i=0;31>i;i++)s.push(o);return s}function Ac(o,s,i){o.pendingLanes|=s,536870912!==s&&(o.suspendedLanes=0,o.pingedLanes=0),(o=o.eventTimes)[s=31-St(s)]=i}function Cc(o,s){var i=o.entangledLanes|=s;for(o=o.entanglements;i;){var u=31-St(i),_=1<<u;_&s|o[u]&s&&(o[u]|=s),i&=~_}}var At=0;function Dc(o){return 1<(o&=-o)?4<o?268435455&o?16:536870912:4:1}var jt,Pt,It,Mt,Nt,Tt=!1,Rt=[],Dt=null,Lt=null,Bt=null,Ft=new Map,qt=new Map,$t=[],Vt=\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit\".split(\" \");function Sc(o,s){switch(o){case\"focusin\":case\"focusout\":Dt=null;break;case\"dragenter\":case\"dragleave\":Lt=null;break;case\"mouseover\":case\"mouseout\":Bt=null;break;case\"pointerover\":case\"pointerout\":Ft.delete(s.pointerId);break;case\"gotpointercapture\":case\"lostpointercapture\":qt.delete(s.pointerId)}}function Tc(o,s,i,u,_,w){return null===o||o.nativeEvent!==w?(o={blockedOn:s,domEventName:i,eventSystemFlags:u,nativeEvent:w,targetContainers:[_]},null!==s&&(null!==(s=Cb(s))&&Pt(s)),o):(o.eventSystemFlags|=u,s=o.targetContainers,null!==_&&-1===s.indexOf(_)&&s.push(_),o)}function Vc(o){var s=Wc(o.target);if(null!==s){var i=Vb(s);if(null!==i)if(13===(s=i.tag)){if(null!==(s=Wb(i)))return o.blockedOn=s,void Nt(o.priority,(function(){It(i)}))}else if(3===s&&i.stateNode.current.memoizedState.isDehydrated)return void(o.blockedOn=3===i.tag?i.stateNode.containerInfo:null)}o.blockedOn=null}function Xc(o){if(null!==o.blockedOn)return!1;for(var s=o.targetContainers;0<s.length;){var i=Yc(o.domEventName,o.eventSystemFlags,s[0],o.nativeEvent);if(null!==i)return null!==(s=Cb(i))&&Pt(s),o.blockedOn=i,!1;var u=new(i=o.nativeEvent).constructor(i.type,i);Ye=u,i.target.dispatchEvent(u),Ye=null,s.shift()}return!0}function Zc(o,s,i){Xc(o)&&i.delete(s)}function $c(){Tt=!1,null!==Dt&&Xc(Dt)&&(Dt=null),null!==Lt&&Xc(Lt)&&(Lt=null),null!==Bt&&Xc(Bt)&&(Bt=null),Ft.forEach(Zc),qt.forEach(Zc)}function ad(o,s){o.blockedOn===s&&(o.blockedOn=null,Tt||(Tt=!0,_.unstable_scheduleCallback(_.unstable_NormalPriority,$c)))}function bd(o){function b(s){return ad(s,o)}if(0<Rt.length){ad(Rt[0],o);for(var s=1;s<Rt.length;s++){var i=Rt[s];i.blockedOn===o&&(i.blockedOn=null)}}for(null!==Dt&&ad(Dt,o),null!==Lt&&ad(Lt,o),null!==Bt&&ad(Bt,o),Ft.forEach(b),qt.forEach(b),s=0;s<$t.length;s++)(i=$t[s]).blockedOn===o&&(i.blockedOn=null);for(;0<$t.length&&null===(s=$t[0]).blockedOn;)Vc(s),null===s.blockedOn&&$t.shift()}var Ut=z.ReactCurrentBatchConfig,zt=!0;function ed(o,s,i,u){var _=At,w=Ut.transition;Ut.transition=null;try{At=1,fd(o,s,i,u)}finally{At=_,Ut.transition=w}}function gd(o,s,i,u){var _=At,w=Ut.transition;Ut.transition=null;try{At=4,fd(o,s,i,u)}finally{At=_,Ut.transition=w}}function fd(o,s,i,u){if(zt){var _=Yc(o,s,i,u);if(null===_)hd(o,s,u,Wt,i),Sc(o,u);else if(function Uc(o,s,i,u,_){switch(s){case\"focusin\":return Dt=Tc(Dt,o,s,i,u,_),!0;case\"dragenter\":return Lt=Tc(Lt,o,s,i,u,_),!0;case\"mouseover\":return Bt=Tc(Bt,o,s,i,u,_),!0;case\"pointerover\":var w=_.pointerId;return Ft.set(w,Tc(Ft.get(w)||null,o,s,i,u,_)),!0;case\"gotpointercapture\":return w=_.pointerId,qt.set(w,Tc(qt.get(w)||null,o,s,i,u,_)),!0}return!1}(_,o,s,i,u))u.stopPropagation();else if(Sc(o,u),4&s&&-1<Vt.indexOf(o)){for(;null!==_;){var w=Cb(_);if(null!==w&&jt(w),null===(w=Yc(o,s,i,u))&&hd(o,s,u,Wt,i),w===_)break;_=w}null!==_&&u.stopPropagation()}else hd(o,s,u,null,i)}}var Wt=null;function Yc(o,s,i,u){if(Wt=null,null!==(o=Wc(o=xb(u))))if(null===(s=Vb(o)))o=null;else if(13===(i=s.tag)){if(null!==(o=Wb(s)))return o;o=null}else if(3===i){if(s.stateNode.current.memoizedState.isDehydrated)return 3===s.tag?s.stateNode.containerInfo:null;o=null}else s!==o&&(o=null);return Wt=o,null}function jd(o){switch(o){case\"cancel\":case\"click\":case\"close\":case\"contextmenu\":case\"copy\":case\"cut\":case\"auxclick\":case\"dblclick\":case\"dragend\":case\"dragstart\":case\"drop\":case\"focusin\":case\"focusout\":case\"input\":case\"invalid\":case\"keydown\":case\"keypress\":case\"keyup\":case\"mousedown\":case\"mouseup\":case\"paste\":case\"pause\":case\"play\":case\"pointercancel\":case\"pointerdown\":case\"pointerup\":case\"ratechange\":case\"reset\":case\"resize\":case\"seeked\":case\"submit\":case\"touchcancel\":case\"touchend\":case\"touchstart\":case\"volumechange\":case\"change\":case\"selectionchange\":case\"textInput\":case\"compositionstart\":case\"compositionend\":case\"compositionupdate\":case\"beforeblur\":case\"afterblur\":case\"beforeinput\":case\"blur\":case\"fullscreenchange\":case\"focus\":case\"hashchange\":case\"popstate\":case\"select\":case\"selectstart\":return 1;case\"drag\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"mousemove\":case\"mouseout\":case\"mouseover\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"scroll\":case\"toggle\":case\"touchmove\":case\"wheel\":case\"mouseenter\":case\"mouseleave\":case\"pointerenter\":case\"pointerleave\":return 4;case\"message\":switch(mt()){case gt:return 1;case yt:return 4;case vt:case bt:return 16;case _t:return 536870912;default:return 16}default:return 16}}var Kt=null,Ht=null,Jt=null;function nd(){if(Jt)return Jt;var o,s,i=Ht,u=i.length,_=\"value\"in Kt?Kt.value:Kt.textContent,w=_.length;for(o=0;o<u&&i[o]===_[o];o++);var x=u-o;for(s=1;s<=x&&i[u-s]===_[w-s];s++);return Jt=_.slice(o,1<s?1-s:void 0)}function od(o){var s=o.keyCode;return\"charCode\"in o?0===(o=o.charCode)&&13===s&&(o=13):o=s,10===o&&(o=13),32<=o||13===o?o:0}function pd(){return!0}function qd(){return!1}function rd(o){function b(s,i,u,_,w){for(var x in this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=_,this.target=w,this.currentTarget=null,o)o.hasOwnProperty(x)&&(s=o[x],this[x]=s?s(_):_[x]);return this.isDefaultPrevented=(null!=_.defaultPrevented?_.defaultPrevented:!1===_.returnValue)?pd:qd,this.isPropagationStopped=qd,this}return xe(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():\"unknown\"!=typeof o.returnValue&&(o.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():\"unknown\"!=typeof o.cancelBubble&&(o.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd}),b}var Gt,Yt,Xt,Qt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zt=rd(Qt),er=xe({},Qt,{view:0,detail:0}),tr=rd(er),rr=xe({},er,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(o){return void 0===o.relatedTarget?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return\"movementX\"in o?o.movementX:(o!==Xt&&(Xt&&\"mousemove\"===o.type?(Gt=o.screenX-Xt.screenX,Yt=o.screenY-Xt.screenY):Yt=Gt=0,Xt=o),Gt)},movementY:function(o){return\"movementY\"in o?o.movementY:Yt}}),nr=rd(rr),sr=rd(xe({},rr,{dataTransfer:0})),ir=rd(xe({},er,{relatedTarget:0})),ar=rd(xe({},Qt,{animationName:0,elapsedTime:0,pseudoElement:0})),cr=xe({},Qt,{clipboardData:function(o){return\"clipboardData\"in o?o.clipboardData:window.clipboardData}}),lr=rd(cr),ur=rd(xe({},Qt,{data:0})),pr={Esc:\"Escape\",Spacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},dr={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",19:\"Pause\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"},fr={Alt:\"altKey\",Control:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};function Pd(o){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(o):!!(o=fr[o])&&!!s[o]}function zd(){return Pd}var mr=xe({},er,{key:function(o){if(o.key){var s=pr[o.key]||o.key;if(\"Unidentified\"!==s)return s}return\"keypress\"===o.type?13===(o=od(o))?\"Enter\":String.fromCharCode(o):\"keydown\"===o.type||\"keyup\"===o.type?dr[o.keyCode]||\"Unidentified\":\"\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(o){return\"keypress\"===o.type?od(o):0},keyCode:function(o){return\"keydown\"===o.type||\"keyup\"===o.type?o.keyCode:0},which:function(o){return\"keypress\"===o.type?od(o):\"keydown\"===o.type||\"keyup\"===o.type?o.keyCode:0}}),gr=rd(mr),yr=rd(xe({},rr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),vr=rd(xe({},er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd})),br=rd(xe({},Qt,{propertyName:0,elapsedTime:0,pseudoElement:0})),_r=xe({},rr,{deltaX:function(o){return\"deltaX\"in o?o.deltaX:\"wheelDeltaX\"in o?-o.wheelDeltaX:0},deltaY:function(o){return\"deltaY\"in o?o.deltaY:\"wheelDeltaY\"in o?-o.wheelDeltaY:\"wheelDelta\"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),Er=rd(_r),wr=[9,13,27,32],Sr=C&&\"CompositionEvent\"in window,xr=null;C&&\"documentMode\"in document&&(xr=document.documentMode);var kr=C&&\"TextEvent\"in window&&!xr,Or=C&&(!Sr||xr&&8<xr&&11>=xr),Cr=String.fromCharCode(32),Ar=!1;function ge(o,s){switch(o){case\"keyup\":return-1!==wr.indexOf(s.keyCode);case\"keydown\":return 229!==s.keyCode;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function he(o){return\"object\"==typeof(o=o.detail)&&\"data\"in o?o.data:null}var jr=!1;var Pr={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return\"input\"===s?!!Pr[o.type]:\"textarea\"===s}function ne(o,s,i,u){Eb(u),0<(s=oe(s,\"onChange\")).length&&(i=new Zt(\"onChange\",\"change\",null,i,u),o.push({event:i,listeners:s}))}var Ir=null,Mr=null;function re(o){se(o,0)}function te(o){if(Wa(ue(o)))return o}function ve(o,s){if(\"change\"===o)return s}var Nr=!1;if(C){var Tr;if(C){var Rr=\"oninput\"in document;if(!Rr){var Dr=document.createElement(\"div\");Dr.setAttribute(\"oninput\",\"return;\"),Rr=\"function\"==typeof Dr.oninput}Tr=Rr}else Tr=!1;Nr=Tr&&(!document.documentMode||9<document.documentMode)}function Ae(){Ir&&(Ir.detachEvent(\"onpropertychange\",Be),Mr=Ir=null)}function Be(o){if(\"value\"===o.propertyName&&te(Mr)){var s=[];ne(s,Mr,o,xb(o)),Jb(re,s)}}function Ce(o,s,i){\"focusin\"===o?(Ae(),Mr=i,(Ir=s).attachEvent(\"onpropertychange\",Be)):\"focusout\"===o&&Ae()}function De(o){if(\"selectionchange\"===o||\"keyup\"===o||\"keydown\"===o)return te(Mr)}function Ee(o,s){if(\"click\"===o)return te(s)}function Fe(o,s){if(\"input\"===o||\"change\"===o)return te(s)}var Lr=\"function\"==typeof Object.is?Object.is:function Ge(o,s){return o===s&&(0!==o||1/o==1/s)||o!=o&&s!=s};function Ie(o,s){if(Lr(o,s))return!0;if(\"object\"!=typeof o||null===o||\"object\"!=typeof s||null===s)return!1;var i=Object.keys(o),u=Object.keys(s);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var _=i[u];if(!j.call(s,_)||!Lr(o[_],s[_]))return!1}return!0}function Je(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Ke(o,s){var i,u=Je(o);for(o=0;u;){if(3===u.nodeType){if(i=o+u.textContent.length,o<=s&&i>=s)return{node:u,offset:s-o};o=i}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Je(u)}}function Le(o,s){return!(!o||!s)&&(o===s||(!o||3!==o.nodeType)&&(s&&3===s.nodeType?Le(o,s.parentNode):\"contains\"in o?o.contains(s):!!o.compareDocumentPosition&&!!(16&o.compareDocumentPosition(s))))}function Me(){for(var o=window,s=Xa();s instanceof o.HTMLIFrameElement;){try{var i=\"string\"==typeof s.contentWindow.location.href}catch(o){i=!1}if(!i)break;s=Xa((o=s.contentWindow).document)}return s}function Ne(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s&&(\"input\"===s&&(\"text\"===o.type||\"search\"===o.type||\"tel\"===o.type||\"url\"===o.type||\"password\"===o.type)||\"textarea\"===s||\"true\"===o.contentEditable)}function Oe(o){var s=Me(),i=o.focusedElem,u=o.selectionRange;if(s!==i&&i&&i.ownerDocument&&Le(i.ownerDocument.documentElement,i)){if(null!==u&&Ne(i))if(s=u.start,void 0===(o=u.end)&&(o=s),\"selectionStart\"in i)i.selectionStart=s,i.selectionEnd=Math.min(o,i.value.length);else if((o=(s=i.ownerDocument||document)&&s.defaultView||window).getSelection){o=o.getSelection();var _=i.textContent.length,w=Math.min(u.start,_);u=void 0===u.end?w:Math.min(u.end,_),!o.extend&&w>u&&(_=u,u=w,w=_),_=Ke(i,w);var x=Ke(i,u);_&&x&&(1!==o.rangeCount||o.anchorNode!==_.node||o.anchorOffset!==_.offset||o.focusNode!==x.node||o.focusOffset!==x.offset)&&((s=s.createRange()).setStart(_.node,_.offset),o.removeAllRanges(),w>u?(o.addRange(s),o.extend(x.node,x.offset)):(s.setEnd(x.node,x.offset),o.addRange(s)))}for(s=[],o=i;o=o.parentNode;)1===o.nodeType&&s.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(\"function\"==typeof i.focus&&i.focus(),i=0;i<s.length;i++)(o=s[i]).element.scrollLeft=o.left,o.element.scrollTop=o.top}}var Br=C&&\"documentMode\"in document&&11>=document.documentMode,Fr=null,qr=null,$r=null,Vr=!1;function Ue(o,s,i){var u=i.window===i?i.document:9===i.nodeType?i:i.ownerDocument;Vr||null==Fr||Fr!==Xa(u)||(\"selectionStart\"in(u=Fr)&&Ne(u)?u={start:u.selectionStart,end:u.selectionEnd}:u={anchorNode:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset},$r&&Ie($r,u)||($r=u,0<(u=oe(qr,\"onSelect\")).length&&(s=new Zt(\"onSelect\",\"select\",null,s,i),o.push({event:s,listeners:u}),s.target=Fr)))}function Ve(o,s){var i={};return i[o.toLowerCase()]=s.toLowerCase(),i[\"Webkit\"+o]=\"webkit\"+s,i[\"Moz\"+o]=\"moz\"+s,i}var Ur={animationend:Ve(\"Animation\",\"AnimationEnd\"),animationiteration:Ve(\"Animation\",\"AnimationIteration\"),animationstart:Ve(\"Animation\",\"AnimationStart\"),transitionend:Ve(\"Transition\",\"TransitionEnd\")},zr={},Wr={};function Ze(o){if(zr[o])return zr[o];if(!Ur[o])return o;var s,i=Ur[o];for(s in i)if(i.hasOwnProperty(s)&&s in Wr)return zr[o]=i[s];return o}C&&(Wr=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),\"TransitionEvent\"in window||delete Ur.transitionend.transition);var Kr=Ze(\"animationend\"),Hr=Ze(\"animationiteration\"),Jr=Ze(\"animationstart\"),Gr=Ze(\"transitionend\"),Yr=new Map,Xr=\"abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\".split(\" \");function ff(o,s){Yr.set(o,s),fa(s,[o])}for(var Qr=0;Qr<Xr.length;Qr++){var Zr=Xr[Qr];ff(Zr.toLowerCase(),\"on\"+(Zr[0].toUpperCase()+Zr.slice(1)))}ff(Kr,\"onAnimationEnd\"),ff(Hr,\"onAnimationIteration\"),ff(Jr,\"onAnimationStart\"),ff(\"dblclick\",\"onDoubleClick\"),ff(\"focusin\",\"onFocus\"),ff(\"focusout\",\"onBlur\"),ff(Gr,\"onTransitionEnd\"),ha(\"onMouseEnter\",[\"mouseout\",\"mouseover\"]),ha(\"onMouseLeave\",[\"mouseout\",\"mouseover\"]),ha(\"onPointerEnter\",[\"pointerout\",\"pointerover\"]),ha(\"onPointerLeave\",[\"pointerout\",\"pointerover\"]),fa(\"onChange\",\"change click focusin focusout input keydown keyup selectionchange\".split(\" \")),fa(\"onSelect\",\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\".split(\" \")),fa(\"onBeforeInput\",[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]),fa(\"onCompositionEnd\",\"compositionend focusout keydown keypress keyup mousedown\".split(\" \")),fa(\"onCompositionStart\",\"compositionstart focusout keydown keypress keyup mousedown\".split(\" \")),fa(\"onCompositionUpdate\",\"compositionupdate focusout keydown keypress keyup mousedown\".split(\" \"));var en=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),tn=new Set(\"cancel close invalid load scroll toggle\".split(\" \").concat(en));function nf(o,s,i){var u=o.type||\"unknown-event\";o.currentTarget=i,function Ub(o,s,i,u,_,w,x,C,j){if(Tb.apply(this,arguments),ot){if(!ot)throw Error(p(198));var L=st;ot=!1,st=null,it||(it=!0,at=L)}}(u,s,void 0,o),o.currentTarget=null}function se(o,s){s=!!(4&s);for(var i=0;i<o.length;i++){var u=o[i],_=u.event;u=u.listeners;e:{var w=void 0;if(s)for(var x=u.length-1;0<=x;x--){var C=u[x],j=C.instance,L=C.currentTarget;if(C=C.listener,j!==w&&_.isPropagationStopped())break e;nf(_,C,L),w=j}else for(x=0;x<u.length;x++){if(j=(C=u[x]).instance,L=C.currentTarget,C=C.listener,j!==w&&_.isPropagationStopped())break e;nf(_,C,L),w=j}}}if(it)throw o=at,it=!1,at=null,o}function D(o,s){var i=s[gn];void 0===i&&(i=s[gn]=new Set);var u=o+\"__bubble\";i.has(u)||(pf(s,o,2,!1),i.add(u))}function qf(o,s,i){var u=0;s&&(u|=4),pf(i,o,u,s)}var rn=\"_reactListening\"+Math.random().toString(36).slice(2);function sf(o){if(!o[rn]){o[rn]=!0,w.forEach((function(s){\"selectionchange\"!==s&&(tn.has(s)||qf(s,!1,o),qf(s,!0,o))}));var s=9===o.nodeType?o:o.ownerDocument;null===s||s[rn]||(s[rn]=!0,qf(\"selectionchange\",!1,s))}}function pf(o,s,i,u){switch(jd(s)){case 1:var _=ed;break;case 4:_=gd;break;default:_=fd}i=_.bind(null,s,i,o),_=void 0,!rt||\"touchstart\"!==s&&\"touchmove\"!==s&&\"wheel\"!==s||(_=!0),u?void 0!==_?o.addEventListener(s,i,{capture:!0,passive:_}):o.addEventListener(s,i,!0):void 0!==_?o.addEventListener(s,i,{passive:_}):o.addEventListener(s,i,!1)}function hd(o,s,i,u,_){var w=u;if(!(1&s||2&s||null===u))e:for(;;){if(null===u)return;var x=u.tag;if(3===x||4===x){var C=u.stateNode.containerInfo;if(C===_||8===C.nodeType&&C.parentNode===_)break;if(4===x)for(x=u.return;null!==x;){var j=x.tag;if((3===j||4===j)&&((j=x.stateNode.containerInfo)===_||8===j.nodeType&&j.parentNode===_))return;x=x.return}for(;null!==C;){if(null===(x=Wc(C)))return;if(5===(j=x.tag)||6===j){u=w=x;continue e}C=C.parentNode}}u=u.return}Jb((function(){var u=w,_=xb(i),x=[];e:{var C=Yr.get(o);if(void 0!==C){var j=Zt,L=o;switch(o){case\"keypress\":if(0===od(i))break e;case\"keydown\":case\"keyup\":j=gr;break;case\"focusin\":L=\"focus\",j=ir;break;case\"focusout\":L=\"blur\",j=ir;break;case\"beforeblur\":case\"afterblur\":j=ir;break;case\"click\":if(2===i.button)break e;case\"auxclick\":case\"dblclick\":case\"mousedown\":case\"mousemove\":case\"mouseup\":case\"mouseout\":case\"mouseover\":case\"contextmenu\":j=nr;break;case\"drag\":case\"dragend\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"dragstart\":case\"drop\":j=sr;break;case\"touchcancel\":case\"touchend\":case\"touchmove\":case\"touchstart\":j=vr;break;case Kr:case Hr:case Jr:j=ar;break;case Gr:j=br;break;case\"scroll\":j=tr;break;case\"wheel\":j=Er;break;case\"copy\":case\"cut\":case\"paste\":j=lr;break;case\"gotpointercapture\":case\"lostpointercapture\":case\"pointercancel\":case\"pointerdown\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"pointerup\":j=yr}var B=!!(4&s),$=!B&&\"scroll\"===o,V=B?null!==C?C+\"Capture\":null:C;B=[];for(var U,z=u;null!==z;){var Y=(U=z).stateNode;if(5===U.tag&&null!==Y&&(U=Y,null!==V&&(null!=(Y=Kb(z,V))&&B.push(tf(z,Y,U)))),$)break;z=z.return}0<B.length&&(C=new j(C,L,null,i,_),x.push({event:C,listeners:B}))}}if(!(7&s)){if(j=\"mouseout\"===o||\"pointerout\"===o,(!(C=\"mouseover\"===o||\"pointerover\"===o)||i===Ye||!(L=i.relatedTarget||i.fromElement)||!Wc(L)&&!L[mn])&&(j||C)&&(C=_.window===_?_:(C=_.ownerDocument)?C.defaultView||C.parentWindow:window,j?(j=u,null!==(L=(L=i.relatedTarget||i.toElement)?Wc(L):null)&&(L!==($=Vb(L))||5!==L.tag&&6!==L.tag)&&(L=null)):(j=null,L=u),j!==L)){if(B=nr,Y=\"onMouseLeave\",V=\"onMouseEnter\",z=\"mouse\",\"pointerout\"!==o&&\"pointerover\"!==o||(B=yr,Y=\"onPointerLeave\",V=\"onPointerEnter\",z=\"pointer\"),$=null==j?C:ue(j),U=null==L?C:ue(L),(C=new B(Y,z+\"leave\",j,i,_)).target=$,C.relatedTarget=U,Y=null,Wc(_)===u&&((B=new B(V,z+\"enter\",L,i,_)).target=U,B.relatedTarget=$,Y=B),$=Y,j&&L)e:{for(V=L,z=0,U=B=j;U;U=vf(U))z++;for(U=0,Y=V;Y;Y=vf(Y))U++;for(;0<z-U;)B=vf(B),z--;for(;0<U-z;)V=vf(V),U--;for(;z--;){if(B===V||null!==V&&B===V.alternate)break e;B=vf(B),V=vf(V)}B=null}else B=null;null!==j&&wf(x,C,j,B,!1),null!==L&&null!==$&&wf(x,$,L,B,!0)}if(\"select\"===(j=(C=u?ue(u):window).nodeName&&C.nodeName.toLowerCase())||\"input\"===j&&\"file\"===C.type)var Z=ve;else if(me(C))if(Nr)Z=Fe;else{Z=De;var ee=Ce}else(j=C.nodeName)&&\"input\"===j.toLowerCase()&&(\"checkbox\"===C.type||\"radio\"===C.type)&&(Z=Ee);switch(Z&&(Z=Z(o,u))?ne(x,Z,i,_):(ee&&ee(o,C,u),\"focusout\"===o&&(ee=C._wrapperState)&&ee.controlled&&\"number\"===C.type&&cb(C,\"number\",C.value)),ee=u?ue(u):window,o){case\"focusin\":(me(ee)||\"true\"===ee.contentEditable)&&(Fr=ee,qr=u,$r=null);break;case\"focusout\":$r=qr=Fr=null;break;case\"mousedown\":Vr=!0;break;case\"contextmenu\":case\"mouseup\":case\"dragend\":Vr=!1,Ue(x,i,_);break;case\"selectionchange\":if(Br)break;case\"keydown\":case\"keyup\":Ue(x,i,_)}var ie;if(Sr)e:{switch(o){case\"compositionstart\":var ae=\"onCompositionStart\";break e;case\"compositionend\":ae=\"onCompositionEnd\";break e;case\"compositionupdate\":ae=\"onCompositionUpdate\";break e}ae=void 0}else jr?ge(o,i)&&(ae=\"onCompositionEnd\"):\"keydown\"===o&&229===i.keyCode&&(ae=\"onCompositionStart\");ae&&(Or&&\"ko\"!==i.locale&&(jr||\"onCompositionStart\"!==ae?\"onCompositionEnd\"===ae&&jr&&(ie=nd()):(Ht=\"value\"in(Kt=_)?Kt.value:Kt.textContent,jr=!0)),0<(ee=oe(u,ae)).length&&(ae=new ur(ae,o,null,i,_),x.push({event:ae,listeners:ee}),ie?ae.data=ie:null!==(ie=he(i))&&(ae.data=ie))),(ie=kr?function je(o,s){switch(o){case\"compositionend\":return he(s);case\"keypress\":return 32!==s.which?null:(Ar=!0,Cr);case\"textInput\":return(o=s.data)===Cr&&Ar?null:o;default:return null}}(o,i):function ke(o,s){if(jr)return\"compositionend\"===o||!Sr&&ge(o,s)?(o=nd(),Jt=Ht=Kt=null,jr=!1,o):null;switch(o){case\"paste\":default:return null;case\"keypress\":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case\"compositionend\":return Or&&\"ko\"!==s.locale?null:s.data}}(o,i))&&(0<(u=oe(u,\"onBeforeInput\")).length&&(_=new ur(\"onBeforeInput\",\"beforeinput\",null,i,_),x.push({event:_,listeners:u}),_.data=ie))}se(x,s)}))}function tf(o,s,i){return{instance:o,listener:s,currentTarget:i}}function oe(o,s){for(var i=s+\"Capture\",u=[];null!==o;){var _=o,w=_.stateNode;5===_.tag&&null!==w&&(_=w,null!=(w=Kb(o,i))&&u.unshift(tf(o,w,_)),null!=(w=Kb(o,s))&&u.push(tf(o,w,_))),o=o.return}return u}function vf(o){if(null===o)return null;do{o=o.return}while(o&&5!==o.tag);return o||null}function wf(o,s,i,u,_){for(var w=s._reactName,x=[];null!==i&&i!==u;){var C=i,j=C.alternate,L=C.stateNode;if(null!==j&&j===u)break;5===C.tag&&null!==L&&(C=L,_?null!=(j=Kb(i,w))&&x.unshift(tf(i,j,C)):_||null!=(j=Kb(i,w))&&x.push(tf(i,j,C))),i=i.return}0!==x.length&&o.push({event:s,listeners:x})}var nn=/\\r\\n?/g,on=/\\u0000|\\uFFFD/g;function zf(o){return(\"string\"==typeof o?o:\"\"+o).replace(nn,\"\\n\").replace(on,\"\")}function Af(o,s,i){if(s=zf(s),zf(o)!==s&&i)throw Error(p(425))}function Bf(){}var sn=null,an=null;function Ef(o,s){return\"textarea\"===o||\"noscript\"===o||\"string\"==typeof s.children||\"number\"==typeof s.children||\"object\"==typeof s.dangerouslySetInnerHTML&&null!==s.dangerouslySetInnerHTML&&null!=s.dangerouslySetInnerHTML.__html}var cn=\"function\"==typeof setTimeout?setTimeout:void 0,ln=\"function\"==typeof clearTimeout?clearTimeout:void 0,un=\"function\"==typeof Promise?Promise:void 0,pn=\"function\"==typeof queueMicrotask?queueMicrotask:void 0!==un?function(o){return un.resolve(null).then(o).catch(If)}:cn;function If(o){setTimeout((function(){throw o}))}function Kf(o,s){var i=s,u=0;do{var _=i.nextSibling;if(o.removeChild(i),_&&8===_.nodeType)if(\"/$\"===(i=_.data)){if(0===u)return o.removeChild(_),void bd(s);u--}else\"$\"!==i&&\"$?\"!==i&&\"$!\"!==i||u++;i=_}while(i);bd(s)}function Lf(o){for(;null!=o;o=o.nextSibling){var s=o.nodeType;if(1===s||3===s)break;if(8===s){if(\"$\"===(s=o.data)||\"$!\"===s||\"$?\"===s)break;if(\"/$\"===s)return null}}return o}function Mf(o){o=o.previousSibling;for(var s=0;o;){if(8===o.nodeType){var i=o.data;if(\"$\"===i||\"$!\"===i||\"$?\"===i){if(0===s)return o;s--}else\"/$\"===i&&s++}o=o.previousSibling}return null}var hn=Math.random().toString(36).slice(2),dn=\"__reactFiber$\"+hn,fn=\"__reactProps$\"+hn,mn=\"__reactContainer$\"+hn,gn=\"__reactEvents$\"+hn,yn=\"__reactListeners$\"+hn,vn=\"__reactHandles$\"+hn;function Wc(o){var s=o[dn];if(s)return s;for(var i=o.parentNode;i;){if(s=i[mn]||i[dn]){if(i=s.alternate,null!==s.child||null!==i&&null!==i.child)for(o=Mf(o);null!==o;){if(i=o[dn])return i;o=Mf(o)}return s}i=(o=i).parentNode}return null}function Cb(o){return!(o=o[dn]||o[mn])||5!==o.tag&&6!==o.tag&&13!==o.tag&&3!==o.tag?null:o}function ue(o){if(5===o.tag||6===o.tag)return o.stateNode;throw Error(p(33))}function Db(o){return o[fn]||null}var bn=[],_n=-1;function Uf(o){return{current:o}}function E(o){0>_n||(o.current=bn[_n],bn[_n]=null,_n--)}function G(o,s){_n++,bn[_n]=o.current,o.current=s}var En={},wn=Uf(En),Sn=Uf(!1),xn=En;function Yf(o,s){var i=o.type.contextTypes;if(!i)return En;var u=o.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===s)return u.__reactInternalMemoizedMaskedChildContext;var _,w={};for(_ in i)w[_]=s[_];return u&&((o=o.stateNode).__reactInternalMemoizedUnmaskedChildContext=s,o.__reactInternalMemoizedMaskedChildContext=w),w}function Zf(o){return null!=(o=o.childContextTypes)}function $f(){E(Sn),E(wn)}function ag(o,s,i){if(wn.current!==En)throw Error(p(168));G(wn,s),G(Sn,i)}function bg(o,s,i){var u=o.stateNode;if(s=s.childContextTypes,\"function\"!=typeof u.getChildContext)return i;for(var _ in u=u.getChildContext())if(!(_ in s))throw Error(p(108,Ra(o)||\"Unknown\",_));return xe({},i,u)}function cg(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||En,xn=wn.current,G(wn,o),G(Sn,Sn.current),!0}function dg(o,s,i){var u=o.stateNode;if(!u)throw Error(p(169));i?(o=bg(o,s,xn),u.__reactInternalMemoizedMergedChildContext=o,E(Sn),E(wn),G(wn,o)):E(Sn),G(Sn,i)}var kn=null,On=!1,Cn=!1;function hg(o){null===kn?kn=[o]:kn.push(o)}function jg(){if(!Cn&&null!==kn){Cn=!0;var o=0,s=At;try{var i=kn;for(At=1;o<i.length;o++){var u=i[o];do{u=u(!0)}while(null!==u)}kn=null,On=!1}catch(s){throw null!==kn&&(kn=kn.slice(o+1)),lt(gt,jg),s}finally{At=s,Cn=!1}}return null}var An=[],jn=0,Pn=null,In=0,Mn=[],Nn=0,Tn=null,Rn=1,Dn=\"\";function tg(o,s){An[jn++]=In,An[jn++]=Pn,Pn=o,In=s}function ug(o,s,i){Mn[Nn++]=Rn,Mn[Nn++]=Dn,Mn[Nn++]=Tn,Tn=o;var u=Rn;o=Dn;var _=32-St(u)-1;u&=~(1<<_),i+=1;var w=32-St(s)+_;if(30<w){var x=_-_%5;w=(u&(1<<x)-1).toString(32),u>>=x,_-=x,Rn=1<<32-St(s)+_|i<<_|u,Dn=w+o}else Rn=1<<w|i<<_|u,Dn=o}function vg(o){null!==o.return&&(tg(o,1),ug(o,1,0))}function wg(o){for(;o===Pn;)Pn=An[--jn],An[jn]=null,In=An[--jn],An[jn]=null;for(;o===Tn;)Tn=Mn[--Nn],Mn[Nn]=null,Dn=Mn[--Nn],Mn[Nn]=null,Rn=Mn[--Nn],Mn[Nn]=null}var Ln=null,Bn=null,Fn=!1,qn=null;function Ag(o,s){var i=Bg(5,null,null,0);i.elementType=\"DELETED\",i.stateNode=s,i.return=o,null===(s=o.deletions)?(o.deletions=[i],o.flags|=16):s.push(i)}function Cg(o,s){switch(o.tag){case 5:var i=o.type;return null!==(s=1!==s.nodeType||i.toLowerCase()!==s.nodeName.toLowerCase()?null:s)&&(o.stateNode=s,Ln=o,Bn=Lf(s.firstChild),!0);case 6:return null!==(s=\"\"===o.pendingProps||3!==s.nodeType?null:s)&&(o.stateNode=s,Ln=o,Bn=null,!0);case 13:return null!==(s=8!==s.nodeType?null:s)&&(i=null!==Tn?{id:Rn,overflow:Dn}:null,o.memoizedState={dehydrated:s,treeContext:i,retryLane:1073741824},(i=Bg(18,null,null,0)).stateNode=s,i.return=o,o.child=i,Ln=o,Bn=null,!0);default:return!1}}function Dg(o){return!(!(1&o.mode)||128&o.flags)}function Eg(o){if(Fn){var s=Bn;if(s){var i=s;if(!Cg(o,s)){if(Dg(o))throw Error(p(418));s=Lf(i.nextSibling);var u=Ln;s&&Cg(o,s)?Ag(u,i):(o.flags=-4097&o.flags|2,Fn=!1,Ln=o)}}else{if(Dg(o))throw Error(p(418));o.flags=-4097&o.flags|2,Fn=!1,Ln=o}}}function Fg(o){for(o=o.return;null!==o&&5!==o.tag&&3!==o.tag&&13!==o.tag;)o=o.return;Ln=o}function Gg(o){if(o!==Ln)return!1;if(!Fn)return Fg(o),Fn=!0,!1;var s;if((s=3!==o.tag)&&!(s=5!==o.tag)&&(s=\"head\"!==(s=o.type)&&\"body\"!==s&&!Ef(o.type,o.memoizedProps)),s&&(s=Bn)){if(Dg(o))throw Hg(),Error(p(418));for(;s;)Ag(o,s),s=Lf(s.nextSibling)}if(Fg(o),13===o.tag){if(!(o=null!==(o=o.memoizedState)?o.dehydrated:null))throw Error(p(317));e:{for(o=o.nextSibling,s=0;o;){if(8===o.nodeType){var i=o.data;if(\"/$\"===i){if(0===s){Bn=Lf(o.nextSibling);break e}s--}else\"$\"!==i&&\"$!\"!==i&&\"$?\"!==i||s++}o=o.nextSibling}Bn=null}}else Bn=Ln?Lf(o.stateNode.nextSibling):null;return!0}function Hg(){for(var o=Bn;o;)o=Lf(o.nextSibling)}function Ig(){Bn=Ln=null,Fn=!1}function Jg(o){null===qn?qn=[o]:qn.push(o)}var $n=z.ReactCurrentBatchConfig;function Lg(o,s,i){if(null!==(o=i.ref)&&\"function\"!=typeof o&&\"object\"!=typeof o){if(i._owner){if(i=i._owner){if(1!==i.tag)throw Error(p(309));var u=i.stateNode}if(!u)throw Error(p(147,o));var _=u,w=\"\"+o;return null!==s&&null!==s.ref&&\"function\"==typeof s.ref&&s.ref._stringRef===w?s.ref:(s=function(o){var s=_.refs;null===o?delete s[w]:s[w]=o},s._stringRef=w,s)}if(\"string\"!=typeof o)throw Error(p(284));if(!i._owner)throw Error(p(290,o))}return o}function Mg(o,s){throw o=Object.prototype.toString.call(s),Error(p(31,\"[object Object]\"===o?\"object with keys {\"+Object.keys(s).join(\", \")+\"}\":o))}function Ng(o){return(0,o._init)(o._payload)}function Og(o){function b(s,i){if(o){var u=s.deletions;null===u?(s.deletions=[i],s.flags|=16):u.push(i)}}function c(s,i){if(!o)return null;for(;null!==i;)b(s,i),i=i.sibling;return null}function d(o,s){for(o=new Map;null!==s;)null!==s.key?o.set(s.key,s):o.set(s.index,s),s=s.sibling;return o}function e(o,s){return(o=Pg(o,s)).index=0,o.sibling=null,o}function f(s,i,u){return s.index=u,o?null!==(u=s.alternate)?(u=u.index)<i?(s.flags|=2,i):u:(s.flags|=2,i):(s.flags|=1048576,i)}function g(s){return o&&null===s.alternate&&(s.flags|=2),s}function h(o,s,i,u){return null===s||6!==s.tag?((s=Qg(i,o.mode,u)).return=o,s):((s=e(s,i)).return=o,s)}function k(o,s,i,u){var _=i.type;return _===ee?m(o,s,i.props.children,u,i.key):null!==s&&(s.elementType===_||\"object\"==typeof _&&null!==_&&_.$$typeof===be&&Ng(_)===s.type)?((u=e(s,i.props)).ref=Lg(o,s,i),u.return=o,u):((u=Rg(i.type,i.key,i.props,null,o.mode,u)).ref=Lg(o,s,i),u.return=o,u)}function l(o,s,i,u){return null===s||4!==s.tag||s.stateNode.containerInfo!==i.containerInfo||s.stateNode.implementation!==i.implementation?((s=Sg(i,o.mode,u)).return=o,s):((s=e(s,i.children||[])).return=o,s)}function m(o,s,i,u,_){return null===s||7!==s.tag?((s=Tg(i,o.mode,u,_)).return=o,s):((s=e(s,i)).return=o,s)}function q(o,s,i){if(\"string\"==typeof s&&\"\"!==s||\"number\"==typeof s)return(s=Qg(\"\"+s,o.mode,i)).return=o,s;if(\"object\"==typeof s&&null!==s){switch(s.$$typeof){case Y:return(i=Rg(s.type,s.key,s.props,null,o.mode,i)).ref=Lg(o,null,s),i.return=o,i;case Z:return(s=Sg(s,o.mode,i)).return=o,s;case be:return q(o,(0,s._init)(s._payload),i)}if(Te(s)||Ka(s))return(s=Tg(s,o.mode,i,null)).return=o,s;Mg(o,s)}return null}function r(o,s,i,u){var _=null!==s?s.key:null;if(\"string\"==typeof i&&\"\"!==i||\"number\"==typeof i)return null!==_?null:h(o,s,\"\"+i,u);if(\"object\"==typeof i&&null!==i){switch(i.$$typeof){case Y:return i.key===_?k(o,s,i,u):null;case Z:return i.key===_?l(o,s,i,u):null;case be:return r(o,s,(_=i._init)(i._payload),u)}if(Te(i)||Ka(i))return null!==_?null:m(o,s,i,u,null);Mg(o,i)}return null}function y(o,s,i,u,_){if(\"string\"==typeof u&&\"\"!==u||\"number\"==typeof u)return h(s,o=o.get(i)||null,\"\"+u,_);if(\"object\"==typeof u&&null!==u){switch(u.$$typeof){case Y:return k(s,o=o.get(null===u.key?i:u.key)||null,u,_);case Z:return l(s,o=o.get(null===u.key?i:u.key)||null,u,_);case be:return y(o,s,i,(0,u._init)(u._payload),_)}if(Te(u)||Ka(u))return m(s,o=o.get(i)||null,u,_,null);Mg(s,u)}return null}function n(s,i,u,_){for(var w=null,x=null,C=i,j=i=0,L=null;null!==C&&j<u.length;j++){C.index>j?(L=C,C=null):L=C.sibling;var B=r(s,C,u[j],_);if(null===B){null===C&&(C=L);break}o&&C&&null===B.alternate&&b(s,C),i=f(B,i,j),null===x?w=B:x.sibling=B,x=B,C=L}if(j===u.length)return c(s,C),Fn&&tg(s,j),w;if(null===C){for(;j<u.length;j++)null!==(C=q(s,u[j],_))&&(i=f(C,i,j),null===x?w=C:x.sibling=C,x=C);return Fn&&tg(s,j),w}for(C=d(s,C);j<u.length;j++)null!==(L=y(C,s,j,u[j],_))&&(o&&null!==L.alternate&&C.delete(null===L.key?j:L.key),i=f(L,i,j),null===x?w=L:x.sibling=L,x=L);return o&&C.forEach((function(o){return b(s,o)})),Fn&&tg(s,j),w}function t(s,i,u,_){var w=Ka(u);if(\"function\"!=typeof w)throw Error(p(150));if(null==(u=w.call(u)))throw Error(p(151));for(var x=w=null,C=i,j=i=0,L=null,B=u.next();null!==C&&!B.done;j++,B=u.next()){C.index>j?(L=C,C=null):L=C.sibling;var $=r(s,C,B.value,_);if(null===$){null===C&&(C=L);break}o&&C&&null===$.alternate&&b(s,C),i=f($,i,j),null===x?w=$:x.sibling=$,x=$,C=L}if(B.done)return c(s,C),Fn&&tg(s,j),w;if(null===C){for(;!B.done;j++,B=u.next())null!==(B=q(s,B.value,_))&&(i=f(B,i,j),null===x?w=B:x.sibling=B,x=B);return Fn&&tg(s,j),w}for(C=d(s,C);!B.done;j++,B=u.next())null!==(B=y(C,s,j,B.value,_))&&(o&&null!==B.alternate&&C.delete(null===B.key?j:B.key),i=f(B,i,j),null===x?w=B:x.sibling=B,x=B);return o&&C.forEach((function(o){return b(s,o)})),Fn&&tg(s,j),w}return function J(o,s,i,u){if(\"object\"==typeof i&&null!==i&&i.type===ee&&null===i.key&&(i=i.props.children),\"object\"==typeof i&&null!==i){switch(i.$$typeof){case Y:e:{for(var _=i.key,w=s;null!==w;){if(w.key===_){if((_=i.type)===ee){if(7===w.tag){c(o,w.sibling),(s=e(w,i.props.children)).return=o,o=s;break e}}else if(w.elementType===_||\"object\"==typeof _&&null!==_&&_.$$typeof===be&&Ng(_)===w.type){c(o,w.sibling),(s=e(w,i.props)).ref=Lg(o,w,i),s.return=o,o=s;break e}c(o,w);break}b(o,w),w=w.sibling}i.type===ee?((s=Tg(i.props.children,o.mode,u,i.key)).return=o,o=s):((u=Rg(i.type,i.key,i.props,null,o.mode,u)).ref=Lg(o,s,i),u.return=o,o=u)}return g(o);case Z:e:{for(w=i.key;null!==s;){if(s.key===w){if(4===s.tag&&s.stateNode.containerInfo===i.containerInfo&&s.stateNode.implementation===i.implementation){c(o,s.sibling),(s=e(s,i.children||[])).return=o,o=s;break e}c(o,s);break}b(o,s),s=s.sibling}(s=Sg(i,o.mode,u)).return=o,o=s}return g(o);case be:return J(o,s,(w=i._init)(i._payload),u)}if(Te(i))return n(o,s,i,u);if(Ka(i))return t(o,s,i,u);Mg(o,i)}return\"string\"==typeof i&&\"\"!==i||\"number\"==typeof i?(i=\"\"+i,null!==s&&6===s.tag?(c(o,s.sibling),(s=e(s,i)).return=o,o=s):(c(o,s),(s=Qg(i,o.mode,u)).return=o,o=s),g(o)):c(o,s)}}var Vn=Og(!0),Un=Og(!1),zn=Uf(null),Wn=null,Kn=null,Hn=null;function $g(){Hn=Kn=Wn=null}function ah(o){var s=zn.current;E(zn),o._currentValue=s}function bh(o,s,i){for(;null!==o;){var u=o.alternate;if((o.childLanes&s)!==s?(o.childLanes|=s,null!==u&&(u.childLanes|=s)):null!==u&&(u.childLanes&s)!==s&&(u.childLanes|=s),o===i)break;o=o.return}}function ch(o,s){Wn=o,Hn=Kn=null,null!==(o=o.dependencies)&&null!==o.firstContext&&(!!(o.lanes&s)&&(_o=!0),o.firstContext=null)}function eh(o){var s=o._currentValue;if(Hn!==o)if(o={context:o,memoizedValue:s,next:null},null===Kn){if(null===Wn)throw Error(p(308));Kn=o,Wn.dependencies={lanes:0,firstContext:o}}else Kn=Kn.next=o;return s}var Jn=null;function gh(o){null===Jn?Jn=[o]:Jn.push(o)}function hh(o,s,i,u){var _=s.interleaved;return null===_?(i.next=i,gh(s)):(i.next=_.next,_.next=i),s.interleaved=i,ih(o,u)}function ih(o,s){o.lanes|=s;var i=o.alternate;for(null!==i&&(i.lanes|=s),i=o,o=o.return;null!==o;)o.childLanes|=s,null!==(i=o.alternate)&&(i.childLanes|=s),i=o,o=o.return;return 3===i.tag?i.stateNode:null}var Gn=!1;function kh(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(o,s){o=o.updateQueue,s.updateQueue===o&&(s.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function mh(o,s){return{eventTime:o,lane:s,tag:0,payload:null,callback:null,next:null}}function nh(o,s,i){var u=o.updateQueue;if(null===u)return null;if(u=u.shared,2&Bo){var _=u.pending;return null===_?s.next=s:(s.next=_.next,_.next=s),u.pending=s,ih(o,i)}return null===(_=u.interleaved)?(s.next=s,gh(u)):(s.next=_.next,_.next=s),u.interleaved=s,ih(o,i)}function oh(o,s,i){if(null!==(s=s.updateQueue)&&(s=s.shared,4194240&i)){var u=s.lanes;i|=u&=o.pendingLanes,s.lanes=i,Cc(o,i)}}function ph(o,s){var i=o.updateQueue,u=o.alternate;if(null!==u&&i===(u=u.updateQueue)){var _=null,w=null;if(null!==(i=i.firstBaseUpdate)){do{var x={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};null===w?_=w=x:w=w.next=x,i=i.next}while(null!==i);null===w?_=w=s:w=w.next=s}else _=w=s;return i={baseState:u.baseState,firstBaseUpdate:_,lastBaseUpdate:w,shared:u.shared,effects:u.effects},void(o.updateQueue=i)}null===(o=i.lastBaseUpdate)?i.firstBaseUpdate=s:o.next=s,i.lastBaseUpdate=s}function qh(o,s,i,u){var _=o.updateQueue;Gn=!1;var w=_.firstBaseUpdate,x=_.lastBaseUpdate,C=_.shared.pending;if(null!==C){_.shared.pending=null;var j=C,L=j.next;j.next=null,null===x?w=L:x.next=L,x=j;var B=o.alternate;null!==B&&((C=(B=B.updateQueue).lastBaseUpdate)!==x&&(null===C?B.firstBaseUpdate=L:C.next=L,B.lastBaseUpdate=j))}if(null!==w){var $=_.baseState;for(x=0,B=L=j=null,C=w;;){var V=C.lane,U=C.eventTime;if((u&V)===V){null!==B&&(B=B.next={eventTime:U,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var z=o,Y=C;switch(V=s,U=i,Y.tag){case 1:if(\"function\"==typeof(z=Y.payload)){$=z.call(U,$,V);break e}$=z;break e;case 3:z.flags=-65537&z.flags|128;case 0:if(null==(V=\"function\"==typeof(z=Y.payload)?z.call(U,$,V):z))break e;$=xe({},$,V);break e;case 2:Gn=!0}}null!==C.callback&&0!==C.lane&&(o.flags|=64,null===(V=_.effects)?_.effects=[C]:V.push(C))}else U={eventTime:U,lane:V,tag:C.tag,payload:C.payload,callback:C.callback,next:null},null===B?(L=B=U,j=$):B=B.next=U,x|=V;if(null===(C=C.next)){if(null===(C=_.shared.pending))break;C=(V=C).next,V.next=null,_.lastBaseUpdate=V,_.shared.pending=null}}if(null===B&&(j=$),_.baseState=j,_.firstBaseUpdate=L,_.lastBaseUpdate=B,null!==(s=_.shared.interleaved)){_=s;do{x|=_.lane,_=_.next}while(_!==s)}else null===w&&(_.shared.lanes=0);Ko|=x,o.lanes=x,o.memoizedState=$}}function sh(o,s,i){if(o=s.effects,s.effects=null,null!==o)for(s=0;s<o.length;s++){var u=o[s],_=u.callback;if(null!==_){if(u.callback=null,u=i,\"function\"!=typeof _)throw Error(p(191,_));_.call(u)}}}var Yn={},Xn=Uf(Yn),Qn=Uf(Yn),Zn=Uf(Yn);function xh(o){if(o===Yn)throw Error(p(174));return o}function yh(o,s){switch(G(Zn,s),G(Qn,o),G(Xn,Yn),o=s.nodeType){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:lb(null,\"\");break;default:s=lb(s=(o=8===o?s.parentNode:s).namespaceURI||null,o=o.tagName)}E(Xn),G(Xn,s)}function zh(){E(Xn),E(Qn),E(Zn)}function Ah(o){xh(Zn.current);var s=xh(Xn.current),i=lb(s,o.type);s!==i&&(G(Qn,o),G(Xn,i))}function Bh(o){Qn.current===o&&(E(Xn),E(Qn))}var eo=Uf(0);function Ch(o){for(var s=o;null!==s;){if(13===s.tag){var i=s.memoizedState;if(null!==i&&(null===(i=i.dehydrated)||\"$?\"===i.data||\"$!\"===i.data))return s}else if(19===s.tag&&void 0!==s.memoizedProps.revealOrder){if(128&s.flags)return s}else if(null!==s.child){s.child.return=s,s=s.child;continue}if(s===o)break;for(;null===s.sibling;){if(null===s.return||s.return===o)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var to=[];function Eh(){for(var o=0;o<to.length;o++)to[o]._workInProgressVersionPrimary=null;to.length=0}var ro=z.ReactCurrentDispatcher,no=z.ReactCurrentBatchConfig,oo=0,so=null,io=null,ao=null,co=!1,lo=!1,uo=0,po=0;function P(){throw Error(p(321))}function Mh(o,s){if(null===s)return!1;for(var i=0;i<s.length&&i<o.length;i++)if(!Lr(o[i],s[i]))return!1;return!0}function Nh(o,s,i,u,_,w){if(oo=w,so=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,ro.current=null===o||null===o.memoizedState?fo:mo,o=i(u,_),lo){w=0;do{if(lo=!1,uo=0,25<=w)throw Error(p(301));w+=1,ao=io=null,s.updateQueue=null,ro.current=go,o=i(u,_)}while(lo)}if(ro.current=ho,s=null!==io&&null!==io.next,oo=0,ao=io=so=null,co=!1,s)throw Error(p(300));return o}function Sh(){var o=0!==uo;return uo=0,o}function Th(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ao?so.memoizedState=ao=o:ao=ao.next=o,ao}function Uh(){if(null===io){var o=so.alternate;o=null!==o?o.memoizedState:null}else o=io.next;var s=null===ao?so.memoizedState:ao.next;if(null!==s)ao=s,io=o;else{if(null===o)throw Error(p(310));o={memoizedState:(io=o).memoizedState,baseState:io.baseState,baseQueue:io.baseQueue,queue:io.queue,next:null},null===ao?so.memoizedState=ao=o:ao=ao.next=o}return ao}function Vh(o,s){return\"function\"==typeof s?s(o):s}function Wh(o){var s=Uh(),i=s.queue;if(null===i)throw Error(p(311));i.lastRenderedReducer=o;var u=io,_=u.baseQueue,w=i.pending;if(null!==w){if(null!==_){var x=_.next;_.next=w.next,w.next=x}u.baseQueue=_=w,i.pending=null}if(null!==_){w=_.next,u=u.baseState;var C=x=null,j=null,L=w;do{var B=L.lane;if((oo&B)===B)null!==j&&(j=j.next={lane:0,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),u=L.hasEagerState?L.eagerState:o(u,L.action);else{var $={lane:B,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null};null===j?(C=j=$,x=u):j=j.next=$,so.lanes|=B,Ko|=B}L=L.next}while(null!==L&&L!==w);null===j?x=u:j.next=C,Lr(u,s.memoizedState)||(_o=!0),s.memoizedState=u,s.baseState=x,s.baseQueue=j,i.lastRenderedState=u}if(null!==(o=i.interleaved)){_=o;do{w=_.lane,so.lanes|=w,Ko|=w,_=_.next}while(_!==o)}else null===_&&(i.lanes=0);return[s.memoizedState,i.dispatch]}function Xh(o){var s=Uh(),i=s.queue;if(null===i)throw Error(p(311));i.lastRenderedReducer=o;var u=i.dispatch,_=i.pending,w=s.memoizedState;if(null!==_){i.pending=null;var x=_=_.next;do{w=o(w,x.action),x=x.next}while(x!==_);Lr(w,s.memoizedState)||(_o=!0),s.memoizedState=w,null===s.baseQueue&&(s.baseState=w),i.lastRenderedState=w}return[w,u]}function Yh(){}function Zh(o,s){var i=so,u=Uh(),_=s(),w=!Lr(u.memoizedState,_);if(w&&(u.memoizedState=_,_o=!0),u=u.queue,$h(ai.bind(null,i,u,o),[o]),u.getSnapshot!==s||w||null!==ao&&1&ao.memoizedState.tag){if(i.flags|=2048,bi(9,ci.bind(null,i,u,_,s),void 0,null),null===Fo)throw Error(p(349));30&oo||di(i,s,_)}return _}function di(o,s,i){o.flags|=16384,o={getSnapshot:s,value:i},null===(s=so.updateQueue)?(s={lastEffect:null,stores:null},so.updateQueue=s,s.stores=[o]):null===(i=s.stores)?s.stores=[o]:i.push(o)}function ci(o,s,i,u){s.value=i,s.getSnapshot=u,ei(s)&&fi(o)}function ai(o,s,i){return i((function(){ei(s)&&fi(o)}))}function ei(o){var s=o.getSnapshot;o=o.value;try{var i=s();return!Lr(o,i)}catch(o){return!0}}function fi(o){var s=ih(o,1);null!==s&&gi(s,o,1,-1)}function hi(o){var s=Th();return\"function\"==typeof o&&(o=o()),s.memoizedState=s.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vh,lastRenderedState:o},s.queue=o,o=o.dispatch=ii.bind(null,so,o),[s.memoizedState,o]}function bi(o,s,i,u){return o={tag:o,create:s,destroy:i,deps:u,next:null},null===(s=so.updateQueue)?(s={lastEffect:null,stores:null},so.updateQueue=s,s.lastEffect=o.next=o):null===(i=s.lastEffect)?s.lastEffect=o.next=o:(u=i.next,i.next=o,o.next=u,s.lastEffect=o),o}function ji(){return Uh().memoizedState}function ki(o,s,i,u){var _=Th();so.flags|=o,_.memoizedState=bi(1|s,i,void 0,void 0===u?null:u)}function li(o,s,i,u){var _=Uh();u=void 0===u?null:u;var w=void 0;if(null!==io){var x=io.memoizedState;if(w=x.destroy,null!==u&&Mh(u,x.deps))return void(_.memoizedState=bi(s,i,w,u))}so.flags|=o,_.memoizedState=bi(1|s,i,w,u)}function mi(o,s){return ki(8390656,8,o,s)}function $h(o,s){return li(2048,8,o,s)}function ni(o,s){return li(4,2,o,s)}function oi(o,s){return li(4,4,o,s)}function pi(o,s){return\"function\"==typeof s?(o=o(),s(o),function(){s(null)}):null!=s?(o=o(),s.current=o,function(){s.current=null}):void 0}function qi(o,s,i){return i=null!=i?i.concat([o]):null,li(4,4,pi.bind(null,s,o),i)}function ri(){}function si(o,s){var i=Uh();s=void 0===s?null:s;var u=i.memoizedState;return null!==u&&null!==s&&Mh(s,u[1])?u[0]:(i.memoizedState=[o,s],o)}function ti(o,s){var i=Uh();s=void 0===s?null:s;var u=i.memoizedState;return null!==u&&null!==s&&Mh(s,u[1])?u[0]:(o=o(),i.memoizedState=[o,s],o)}function ui(o,s,i){return 21&oo?(Lr(i,s)||(i=yc(),so.lanes|=i,Ko|=i,o.baseState=!0),s):(o.baseState&&(o.baseState=!1,_o=!0),o.memoizedState=i)}function vi(o,s){var i=At;At=0!==i&&4>i?i:4,o(!0);var u=no.transition;no.transition={};try{o(!1),s()}finally{At=i,no.transition=u}}function wi(){return Uh().memoizedState}function xi(o,s,i){var u=yi(o);if(i={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null},zi(o))Ai(s,i);else if(null!==(i=hh(o,s,i,u))){gi(i,o,u,R()),Bi(i,s,u)}}function ii(o,s,i){var u=yi(o),_={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null};if(zi(o))Ai(s,_);else{var w=o.alternate;if(0===o.lanes&&(null===w||0===w.lanes)&&null!==(w=s.lastRenderedReducer))try{var x=s.lastRenderedState,C=w(x,i);if(_.hasEagerState=!0,_.eagerState=C,Lr(C,x)){var j=s.interleaved;return null===j?(_.next=_,gh(s)):(_.next=j.next,j.next=_),void(s.interleaved=_)}}catch(o){}null!==(i=hh(o,s,_,u))&&(gi(i,o,u,_=R()),Bi(i,s,u))}}function zi(o){var s=o.alternate;return o===so||null!==s&&s===so}function Ai(o,s){lo=co=!0;var i=o.pending;null===i?s.next=s:(s.next=i.next,i.next=s),o.pending=s}function Bi(o,s,i){if(4194240&i){var u=s.lanes;i|=u&=o.pendingLanes,s.lanes=i,Cc(o,i)}}var ho={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},fo={readContext:eh,useCallback:function(o,s){return Th().memoizedState=[o,void 0===s?null:s],o},useContext:eh,useEffect:mi,useImperativeHandle:function(o,s,i){return i=null!=i?i.concat([o]):null,ki(4194308,4,pi.bind(null,s,o),i)},useLayoutEffect:function(o,s){return ki(4194308,4,o,s)},useInsertionEffect:function(o,s){return ki(4,2,o,s)},useMemo:function(o,s){var i=Th();return s=void 0===s?null:s,o=o(),i.memoizedState=[o,s],o},useReducer:function(o,s,i){var u=Th();return s=void 0!==i?i(s):s,u.memoizedState=u.baseState=s,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:s},u.queue=o,o=o.dispatch=xi.bind(null,so,o),[u.memoizedState,o]},useRef:function(o){return o={current:o},Th().memoizedState=o},useState:hi,useDebugValue:ri,useDeferredValue:function(o){return Th().memoizedState=o},useTransition:function(){var o=hi(!1),s=o[0];return o=vi.bind(null,o[1]),Th().memoizedState=o,[s,o]},useMutableSource:function(){},useSyncExternalStore:function(o,s,i){var u=so,_=Th();if(Fn){if(void 0===i)throw Error(p(407));i=i()}else{if(i=s(),null===Fo)throw Error(p(349));30&oo||di(u,s,i)}_.memoizedState=i;var w={value:i,getSnapshot:s};return _.queue=w,mi(ai.bind(null,u,w,o),[o]),u.flags|=2048,bi(9,ci.bind(null,u,w,i,s),void 0,null),i},useId:function(){var o=Th(),s=Fo.identifierPrefix;if(Fn){var i=Dn;s=\":\"+s+\"R\"+(i=(Rn&~(1<<32-St(Rn)-1)).toString(32)+i),0<(i=uo++)&&(s+=\"H\"+i.toString(32)),s+=\":\"}else s=\":\"+s+\"r\"+(i=po++).toString(32)+\":\";return o.memoizedState=s},unstable_isNewReconciler:!1},mo={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Wh,useRef:ji,useState:function(){return Wh(Vh)},useDebugValue:ri,useDeferredValue:function(o){return ui(Uh(),io.memoizedState,o)},useTransition:function(){return[Wh(Vh)[0],Uh().memoizedState]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1},go={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Xh,useRef:ji,useState:function(){return Xh(Vh)},useDebugValue:ri,useDeferredValue:function(o){var s=Uh();return null===io?s.memoizedState=o:ui(s,io.memoizedState,o)},useTransition:function(){return[Xh(Vh)[0],Uh().memoizedState]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1};function Ci(o,s){if(o&&o.defaultProps){for(var i in s=xe({},s),o=o.defaultProps)void 0===s[i]&&(s[i]=o[i]);return s}return s}function Di(o,s,i,u){i=null==(i=i(u,s=o.memoizedState))?s:xe({},s,i),o.memoizedState=i,0===o.lanes&&(o.updateQueue.baseState=i)}var yo={isMounted:function(o){return!!(o=o._reactInternals)&&Vb(o)===o},enqueueSetState:function(o,s,i){o=o._reactInternals;var u=R(),_=yi(o),w=mh(u,_);w.payload=s,null!=i&&(w.callback=i),null!==(s=nh(o,w,_))&&(gi(s,o,_,u),oh(s,o,_))},enqueueReplaceState:function(o,s,i){o=o._reactInternals;var u=R(),_=yi(o),w=mh(u,_);w.tag=1,w.payload=s,null!=i&&(w.callback=i),null!==(s=nh(o,w,_))&&(gi(s,o,_,u),oh(s,o,_))},enqueueForceUpdate:function(o,s){o=o._reactInternals;var i=R(),u=yi(o),_=mh(i,u);_.tag=2,null!=s&&(_.callback=s),null!==(s=nh(o,_,u))&&(gi(s,o,u,i),oh(s,o,u))}};function Fi(o,s,i,u,_,w,x){return\"function\"==typeof(o=o.stateNode).shouldComponentUpdate?o.shouldComponentUpdate(u,w,x):!s.prototype||!s.prototype.isPureReactComponent||(!Ie(i,u)||!Ie(_,w))}function Gi(o,s,i){var u=!1,_=En,w=s.contextType;return\"object\"==typeof w&&null!==w?w=eh(w):(_=Zf(s)?xn:wn.current,w=(u=null!=(u=s.contextTypes))?Yf(o,_):En),s=new s(i,w),o.memoizedState=null!==s.state&&void 0!==s.state?s.state:null,s.updater=yo,o.stateNode=s,s._reactInternals=o,u&&((o=o.stateNode).__reactInternalMemoizedUnmaskedChildContext=_,o.__reactInternalMemoizedMaskedChildContext=w),s}function Hi(o,s,i,u){o=s.state,\"function\"==typeof s.componentWillReceiveProps&&s.componentWillReceiveProps(i,u),\"function\"==typeof s.UNSAFE_componentWillReceiveProps&&s.UNSAFE_componentWillReceiveProps(i,u),s.state!==o&&yo.enqueueReplaceState(s,s.state,null)}function Ii(o,s,i,u){var _=o.stateNode;_.props=i,_.state=o.memoizedState,_.refs={},kh(o);var w=s.contextType;\"object\"==typeof w&&null!==w?_.context=eh(w):(w=Zf(s)?xn:wn.current,_.context=Yf(o,w)),_.state=o.memoizedState,\"function\"==typeof(w=s.getDerivedStateFromProps)&&(Di(o,s,w,i),_.state=o.memoizedState),\"function\"==typeof s.getDerivedStateFromProps||\"function\"==typeof _.getSnapshotBeforeUpdate||\"function\"!=typeof _.UNSAFE_componentWillMount&&\"function\"!=typeof _.componentWillMount||(s=_.state,\"function\"==typeof _.componentWillMount&&_.componentWillMount(),\"function\"==typeof _.UNSAFE_componentWillMount&&_.UNSAFE_componentWillMount(),s!==_.state&&yo.enqueueReplaceState(_,_.state,null),qh(o,i,_,u),_.state=o.memoizedState),\"function\"==typeof _.componentDidMount&&(o.flags|=4194308)}function Ji(o,s){try{var i=\"\",u=s;do{i+=Pa(u),u=u.return}while(u);var _=i}catch(o){_=\"\\nError generating stack: \"+o.message+\"\\n\"+o.stack}return{value:o,source:s,stack:_,digest:null}}function Ki(o,s,i){return{value:o,source:null,stack:null!=i?i:null,digest:null!=s?s:null}}function Li(o,s){try{console.error(s.value)}catch(o){setTimeout((function(){throw o}))}}var vo=\"function\"==typeof WeakMap?WeakMap:Map;function Ni(o,s,i){(i=mh(-1,i)).tag=3,i.payload={element:null};var u=s.value;return i.callback=function(){es||(es=!0,ts=u),Li(0,s)},i}function Qi(o,s,i){(i=mh(-1,i)).tag=3;var u=o.type.getDerivedStateFromError;if(\"function\"==typeof u){var _=s.value;i.payload=function(){return u(_)},i.callback=function(){Li(0,s)}}var w=o.stateNode;return null!==w&&\"function\"==typeof w.componentDidCatch&&(i.callback=function(){Li(0,s),\"function\"!=typeof u&&(null===rs?rs=new Set([this]):rs.add(this));var o=s.stack;this.componentDidCatch(s.value,{componentStack:null!==o?o:\"\"})}),i}function Si(o,s,i){var u=o.pingCache;if(null===u){u=o.pingCache=new vo;var _=new Set;u.set(s,_)}else void 0===(_=u.get(s))&&(_=new Set,u.set(s,_));_.has(i)||(_.add(i),o=Ti.bind(null,o,s,i),s.then(o,o))}function Ui(o){do{var s;if((s=13===o.tag)&&(s=null===(s=o.memoizedState)||null!==s.dehydrated),s)return o;o=o.return}while(null!==o);return null}function Vi(o,s,i,u,_){return 1&o.mode?(o.flags|=65536,o.lanes=_,o):(o===s?o.flags|=65536:(o.flags|=128,i.flags|=131072,i.flags&=-52805,1===i.tag&&(null===i.alternate?i.tag=17:((s=mh(-1,1)).tag=2,nh(i,s,1))),i.lanes|=1),o)}var bo=z.ReactCurrentOwner,_o=!1;function Xi(o,s,i,u){s.child=null===o?Un(s,null,i,u):Vn(s,o.child,i,u)}function Yi(o,s,i,u,_){i=i.render;var w=s.ref;return ch(s,_),u=Nh(o,s,i,u,w,_),i=Sh(),null===o||_o?(Fn&&i&&vg(s),s.flags|=1,Xi(o,s,u,_),s.child):(s.updateQueue=o.updateQueue,s.flags&=-2053,o.lanes&=~_,Zi(o,s,_))}function $i(o,s,i,u,_){if(null===o){var w=i.type;return\"function\"!=typeof w||aj(w)||void 0!==w.defaultProps||null!==i.compare||void 0!==i.defaultProps?((o=Rg(i.type,null,u,s,s.mode,_)).ref=s.ref,o.return=s,s.child=o):(s.tag=15,s.type=w,bj(o,s,w,u,_))}if(w=o.child,!(o.lanes&_)){var x=w.memoizedProps;if((i=null!==(i=i.compare)?i:Ie)(x,u)&&o.ref===s.ref)return Zi(o,s,_)}return s.flags|=1,(o=Pg(w,u)).ref=s.ref,o.return=s,s.child=o}function bj(o,s,i,u,_){if(null!==o){var w=o.memoizedProps;if(Ie(w,u)&&o.ref===s.ref){if(_o=!1,s.pendingProps=u=w,!(o.lanes&_))return s.lanes=o.lanes,Zi(o,s,_);131072&o.flags&&(_o=!0)}}return cj(o,s,i,u,_)}function dj(o,s,i){var u=s.pendingProps,_=u.children,w=null!==o?o.memoizedState:null;if(\"hidden\"===u.mode)if(1&s.mode){if(!(1073741824&i))return o=null!==w?w.baseLanes|i:i,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:o,cachePool:null,transitions:null},s.updateQueue=null,G(Uo,Vo),Vo|=o,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=null!==w?w.baseLanes:i,G(Uo,Vo),Vo|=u}else s.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(Uo,Vo),Vo|=i;else null!==w?(u=w.baseLanes|i,s.memoizedState=null):u=i,G(Uo,Vo),Vo|=u;return Xi(o,s,_,i),s.child}function gj(o,s){var i=s.ref;(null===o&&null!==i||null!==o&&o.ref!==i)&&(s.flags|=512,s.flags|=2097152)}function cj(o,s,i,u,_){var w=Zf(i)?xn:wn.current;return w=Yf(s,w),ch(s,_),i=Nh(o,s,i,u,w,_),u=Sh(),null===o||_o?(Fn&&u&&vg(s),s.flags|=1,Xi(o,s,i,_),s.child):(s.updateQueue=o.updateQueue,s.flags&=-2053,o.lanes&=~_,Zi(o,s,_))}function hj(o,s,i,u,_){if(Zf(i)){var w=!0;cg(s)}else w=!1;if(ch(s,_),null===s.stateNode)ij(o,s),Gi(s,i,u),Ii(s,i,u,_),u=!0;else if(null===o){var x=s.stateNode,C=s.memoizedProps;x.props=C;var j=x.context,L=i.contextType;\"object\"==typeof L&&null!==L?L=eh(L):L=Yf(s,L=Zf(i)?xn:wn.current);var B=i.getDerivedStateFromProps,$=\"function\"==typeof B||\"function\"==typeof x.getSnapshotBeforeUpdate;$||\"function\"!=typeof x.UNSAFE_componentWillReceiveProps&&\"function\"!=typeof x.componentWillReceiveProps||(C!==u||j!==L)&&Hi(s,x,u,L),Gn=!1;var V=s.memoizedState;x.state=V,qh(s,u,x,_),j=s.memoizedState,C!==u||V!==j||Sn.current||Gn?(\"function\"==typeof B&&(Di(s,i,B,u),j=s.memoizedState),(C=Gn||Fi(s,i,C,u,V,j,L))?($||\"function\"!=typeof x.UNSAFE_componentWillMount&&\"function\"!=typeof x.componentWillMount||(\"function\"==typeof x.componentWillMount&&x.componentWillMount(),\"function\"==typeof x.UNSAFE_componentWillMount&&x.UNSAFE_componentWillMount()),\"function\"==typeof x.componentDidMount&&(s.flags|=4194308)):(\"function\"==typeof x.componentDidMount&&(s.flags|=4194308),s.memoizedProps=u,s.memoizedState=j),x.props=u,x.state=j,x.context=L,u=C):(\"function\"==typeof x.componentDidMount&&(s.flags|=4194308),u=!1)}else{x=s.stateNode,lh(o,s),C=s.memoizedProps,L=s.type===s.elementType?C:Ci(s.type,C),x.props=L,$=s.pendingProps,V=x.context,\"object\"==typeof(j=i.contextType)&&null!==j?j=eh(j):j=Yf(s,j=Zf(i)?xn:wn.current);var U=i.getDerivedStateFromProps;(B=\"function\"==typeof U||\"function\"==typeof x.getSnapshotBeforeUpdate)||\"function\"!=typeof x.UNSAFE_componentWillReceiveProps&&\"function\"!=typeof x.componentWillReceiveProps||(C!==$||V!==j)&&Hi(s,x,u,j),Gn=!1,V=s.memoizedState,x.state=V,qh(s,u,x,_);var z=s.memoizedState;C!==$||V!==z||Sn.current||Gn?(\"function\"==typeof U&&(Di(s,i,U,u),z=s.memoizedState),(L=Gn||Fi(s,i,L,u,V,z,j)||!1)?(B||\"function\"!=typeof x.UNSAFE_componentWillUpdate&&\"function\"!=typeof x.componentWillUpdate||(\"function\"==typeof x.componentWillUpdate&&x.componentWillUpdate(u,z,j),\"function\"==typeof x.UNSAFE_componentWillUpdate&&x.UNSAFE_componentWillUpdate(u,z,j)),\"function\"==typeof x.componentDidUpdate&&(s.flags|=4),\"function\"==typeof x.getSnapshotBeforeUpdate&&(s.flags|=1024)):(\"function\"!=typeof x.componentDidUpdate||C===o.memoizedProps&&V===o.memoizedState||(s.flags|=4),\"function\"!=typeof x.getSnapshotBeforeUpdate||C===o.memoizedProps&&V===o.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=z),x.props=u,x.state=z,x.context=j,u=L):(\"function\"!=typeof x.componentDidUpdate||C===o.memoizedProps&&V===o.memoizedState||(s.flags|=4),\"function\"!=typeof x.getSnapshotBeforeUpdate||C===o.memoizedProps&&V===o.memoizedState||(s.flags|=1024),u=!1)}return jj(o,s,i,u,w,_)}function jj(o,s,i,u,_,w){gj(o,s);var x=!!(128&s.flags);if(!u&&!x)return _&&dg(s,i,!1),Zi(o,s,w);u=s.stateNode,bo.current=s;var C=x&&\"function\"!=typeof i.getDerivedStateFromError?null:u.render();return s.flags|=1,null!==o&&x?(s.child=Vn(s,o.child,null,w),s.child=Vn(s,null,C,w)):Xi(o,s,C,w),s.memoizedState=u.state,_&&dg(s,i,!0),s.child}function kj(o){var s=o.stateNode;s.pendingContext?ag(0,s.pendingContext,s.pendingContext!==s.context):s.context&&ag(0,s.context,!1),yh(o,s.containerInfo)}function lj(o,s,i,u,_){return Ig(),Jg(_),s.flags|=256,Xi(o,s,i,u),s.child}var Eo,wo,So,xo,ko={dehydrated:null,treeContext:null,retryLane:0};function nj(o){return{baseLanes:o,cachePool:null,transitions:null}}function oj(o,s,i){var u,_=s.pendingProps,w=eo.current,x=!1,C=!!(128&s.flags);if((u=C)||(u=(null===o||null!==o.memoizedState)&&!!(2&w)),u?(x=!0,s.flags&=-129):null!==o&&null===o.memoizedState||(w|=1),G(eo,1&w),null===o)return Eg(s),null!==(o=s.memoizedState)&&null!==(o=o.dehydrated)?(1&s.mode?\"$!\"===o.data?s.lanes=8:s.lanes=1073741824:s.lanes=1,null):(C=_.children,o=_.fallback,x?(_=s.mode,x=s.child,C={mode:\"hidden\",children:C},1&_||null===x?x=pj(C,_,0,null):(x.childLanes=0,x.pendingProps=C),o=Tg(o,_,i,null),x.return=s,o.return=s,x.sibling=o,s.child=x,s.child.memoizedState=nj(i),s.memoizedState=ko,o):qj(s,C));if(null!==(w=o.memoizedState)&&null!==(u=w.dehydrated))return function rj(o,s,i,u,_,w,x){if(i)return 256&s.flags?(s.flags&=-257,sj(o,s,x,u=Ki(Error(p(422))))):null!==s.memoizedState?(s.child=o.child,s.flags|=128,null):(w=u.fallback,_=s.mode,u=pj({mode:\"visible\",children:u.children},_,0,null),(w=Tg(w,_,x,null)).flags|=2,u.return=s,w.return=s,u.sibling=w,s.child=u,1&s.mode&&Vn(s,o.child,null,x),s.child.memoizedState=nj(x),s.memoizedState=ko,w);if(!(1&s.mode))return sj(o,s,x,null);if(\"$!\"===_.data){if(u=_.nextSibling&&_.nextSibling.dataset)var C=u.dgst;return u=C,sj(o,s,x,u=Ki(w=Error(p(419)),u,void 0))}if(C=!!(x&o.childLanes),_o||C){if(null!==(u=Fo)){switch(x&-x){case 4:_=2;break;case 16:_=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:_=32;break;case 536870912:_=268435456;break;default:_=0}0!==(_=_&(u.suspendedLanes|x)?0:_)&&_!==w.retryLane&&(w.retryLane=_,ih(o,_),gi(u,o,_,-1))}return tj(),sj(o,s,x,u=Ki(Error(p(421))))}return\"$?\"===_.data?(s.flags|=128,s.child=o.child,s=uj.bind(null,o),_._reactRetry=s,null):(o=w.treeContext,Bn=Lf(_.nextSibling),Ln=s,Fn=!0,qn=null,null!==o&&(Mn[Nn++]=Rn,Mn[Nn++]=Dn,Mn[Nn++]=Tn,Rn=o.id,Dn=o.overflow,Tn=s),s=qj(s,u.children),s.flags|=4096,s)}(o,s,C,_,u,w,i);if(x){x=_.fallback,C=s.mode,u=(w=o.child).sibling;var j={mode:\"hidden\",children:_.children};return 1&C||s.child===w?(_=Pg(w,j)).subtreeFlags=14680064&w.subtreeFlags:((_=s.child).childLanes=0,_.pendingProps=j,s.deletions=null),null!==u?x=Pg(u,x):(x=Tg(x,C,i,null)).flags|=2,x.return=s,_.return=s,_.sibling=x,s.child=_,_=x,x=s.child,C=null===(C=o.child.memoizedState)?nj(i):{baseLanes:C.baseLanes|i,cachePool:null,transitions:C.transitions},x.memoizedState=C,x.childLanes=o.childLanes&~i,s.memoizedState=ko,_}return o=(x=o.child).sibling,_=Pg(x,{mode:\"visible\",children:_.children}),!(1&s.mode)&&(_.lanes=i),_.return=s,_.sibling=null,null!==o&&(null===(i=s.deletions)?(s.deletions=[o],s.flags|=16):i.push(o)),s.child=_,s.memoizedState=null,_}function qj(o,s){return(s=pj({mode:\"visible\",children:s},o.mode,0,null)).return=o,o.child=s}function sj(o,s,i,u){return null!==u&&Jg(u),Vn(s,o.child,null,i),(o=qj(s,s.pendingProps.children)).flags|=2,s.memoizedState=null,o}function vj(o,s,i){o.lanes|=s;var u=o.alternate;null!==u&&(u.lanes|=s),bh(o.return,s,i)}function wj(o,s,i,u,_){var w=o.memoizedState;null===w?o.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:_}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=i,w.tailMode=_)}function xj(o,s,i){var u=s.pendingProps,_=u.revealOrder,w=u.tail;if(Xi(o,s,u.children,i),2&(u=eo.current))u=1&u|2,s.flags|=128;else{if(null!==o&&128&o.flags)e:for(o=s.child;null!==o;){if(13===o.tag)null!==o.memoizedState&&vj(o,i,s);else if(19===o.tag)vj(o,i,s);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;null===o.sibling;){if(null===o.return||o.return===s)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}u&=1}if(G(eo,u),1&s.mode)switch(_){case\"forwards\":for(i=s.child,_=null;null!==i;)null!==(o=i.alternate)&&null===Ch(o)&&(_=i),i=i.sibling;null===(i=_)?(_=s.child,s.child=null):(_=i.sibling,i.sibling=null),wj(s,!1,_,i,w);break;case\"backwards\":for(i=null,_=s.child,s.child=null;null!==_;){if(null!==(o=_.alternate)&&null===Ch(o)){s.child=_;break}o=_.sibling,_.sibling=i,i=_,_=o}wj(s,!0,i,null,w);break;case\"together\":wj(s,!1,null,null,void 0);break;default:s.memoizedState=null}else s.memoizedState=null;return s.child}function ij(o,s){!(1&s.mode)&&null!==o&&(o.alternate=null,s.alternate=null,s.flags|=2)}function Zi(o,s,i){if(null!==o&&(s.dependencies=o.dependencies),Ko|=s.lanes,!(i&s.childLanes))return null;if(null!==o&&s.child!==o.child)throw Error(p(153));if(null!==s.child){for(i=Pg(o=s.child,o.pendingProps),s.child=i,i.return=s;null!==o.sibling;)o=o.sibling,(i=i.sibling=Pg(o,o.pendingProps)).return=s;i.sibling=null}return s.child}function Dj(o,s){if(!Fn)switch(o.tailMode){case\"hidden\":s=o.tail;for(var i=null;null!==s;)null!==s.alternate&&(i=s),s=s.sibling;null===i?o.tail=null:i.sibling=null;break;case\"collapsed\":i=o.tail;for(var u=null;null!==i;)null!==i.alternate&&(u=i),i=i.sibling;null===u?s||null===o.tail?o.tail=null:o.tail.sibling=null:u.sibling=null}}function S(o){var s=null!==o.alternate&&o.alternate.child===o.child,i=0,u=0;if(s)for(var _=o.child;null!==_;)i|=_.lanes|_.childLanes,u|=14680064&_.subtreeFlags,u|=14680064&_.flags,_.return=o,_=_.sibling;else for(_=o.child;null!==_;)i|=_.lanes|_.childLanes,u|=_.subtreeFlags,u|=_.flags,_.return=o,_=_.sibling;return o.subtreeFlags|=u,o.childLanes=i,s}function Ej(o,s,i){var u=s.pendingProps;switch(wg(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S(s),null;case 1:case 17:return Zf(s.type)&&$f(),S(s),null;case 3:return u=s.stateNode,zh(),E(Sn),E(wn),Eh(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),null!==o&&null!==o.child||(Gg(s)?s.flags|=4:null===o||o.memoizedState.isDehydrated&&!(256&s.flags)||(s.flags|=1024,null!==qn&&(Fj(qn),qn=null))),wo(o,s),S(s),null;case 5:Bh(s);var _=xh(Zn.current);if(i=s.type,null!==o&&null!=s.stateNode)So(o,s,i,u,_),o.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!u){if(null===s.stateNode)throw Error(p(166));return S(s),null}if(o=xh(Xn.current),Gg(s)){u=s.stateNode,i=s.type;var w=s.memoizedProps;switch(u[dn]=s,u[fn]=w,o=!!(1&s.mode),i){case\"dialog\":D(\"cancel\",u),D(\"close\",u);break;case\"iframe\":case\"object\":case\"embed\":D(\"load\",u);break;case\"video\":case\"audio\":for(_=0;_<en.length;_++)D(en[_],u);break;case\"source\":D(\"error\",u);break;case\"img\":case\"image\":case\"link\":D(\"error\",u),D(\"load\",u);break;case\"details\":D(\"toggle\",u);break;case\"input\":Za(u,w),D(\"invalid\",u);break;case\"select\":u._wrapperState={wasMultiple:!!w.multiple},D(\"invalid\",u);break;case\"textarea\":hb(u,w),D(\"invalid\",u)}for(var C in ub(i,w),_=null,w)if(w.hasOwnProperty(C)){var j=w[C];\"children\"===C?\"string\"==typeof j?u.textContent!==j&&(!0!==w.suppressHydrationWarning&&Af(u.textContent,j,o),_=[\"children\",j]):\"number\"==typeof j&&u.textContent!==\"\"+j&&(!0!==w.suppressHydrationWarning&&Af(u.textContent,j,o),_=[\"children\",\"\"+j]):x.hasOwnProperty(C)&&null!=j&&\"onScroll\"===C&&D(\"scroll\",u)}switch(i){case\"input\":Va(u),db(u,w,!0);break;case\"textarea\":Va(u),jb(u);break;case\"select\":case\"option\":break;default:\"function\"==typeof w.onClick&&(u.onclick=Bf)}u=_,s.updateQueue=u,null!==u&&(s.flags|=4)}else{C=9===_.nodeType?_:_.ownerDocument,\"http://www.w3.org/1999/xhtml\"===o&&(o=kb(i)),\"http://www.w3.org/1999/xhtml\"===o?\"script\"===i?((o=C.createElement(\"div\")).innerHTML=\"<script><\\/script>\",o=o.removeChild(o.firstChild)):\"string\"==typeof u.is?o=C.createElement(i,{is:u.is}):(o=C.createElement(i),\"select\"===i&&(C=o,u.multiple?C.multiple=!0:u.size&&(C.size=u.size))):o=C.createElementNS(o,i),o[dn]=s,o[fn]=u,Eo(o,s,!1,!1),s.stateNode=o;e:{switch(C=vb(i,u),i){case\"dialog\":D(\"cancel\",o),D(\"close\",o),_=u;break;case\"iframe\":case\"object\":case\"embed\":D(\"load\",o),_=u;break;case\"video\":case\"audio\":for(_=0;_<en.length;_++)D(en[_],o);_=u;break;case\"source\":D(\"error\",o),_=u;break;case\"img\":case\"image\":case\"link\":D(\"error\",o),D(\"load\",o),_=u;break;case\"details\":D(\"toggle\",o),_=u;break;case\"input\":Za(o,u),_=Ya(o,u),D(\"invalid\",o);break;case\"option\":default:_=u;break;case\"select\":o._wrapperState={wasMultiple:!!u.multiple},_=xe({},u,{value:void 0}),D(\"invalid\",o);break;case\"textarea\":hb(o,u),_=gb(o,u),D(\"invalid\",o)}for(w in ub(i,_),j=_)if(j.hasOwnProperty(w)){var L=j[w];\"style\"===w?sb(o,L):\"dangerouslySetInnerHTML\"===w?null!=(L=L?L.__html:void 0)&&$e(o,L):\"children\"===w?\"string\"==typeof L?(\"textarea\"!==i||\"\"!==L)&&ob(o,L):\"number\"==typeof L&&ob(o,\"\"+L):\"suppressContentEditableWarning\"!==w&&\"suppressHydrationWarning\"!==w&&\"autoFocus\"!==w&&(x.hasOwnProperty(w)?null!=L&&\"onScroll\"===w&&D(\"scroll\",o):null!=L&&ta(o,w,L,C))}switch(i){case\"input\":Va(o),db(o,u,!1);break;case\"textarea\":Va(o),jb(o);break;case\"option\":null!=u.value&&o.setAttribute(\"value\",\"\"+Sa(u.value));break;case\"select\":o.multiple=!!u.multiple,null!=(w=u.value)?fb(o,!!u.multiple,w,!1):null!=u.defaultValue&&fb(o,!!u.multiple,u.defaultValue,!0);break;default:\"function\"==typeof _.onClick&&(o.onclick=Bf)}switch(i){case\"button\":case\"input\":case\"select\":case\"textarea\":u=!!u.autoFocus;break e;case\"img\":u=!0;break e;default:u=!1}}u&&(s.flags|=4)}null!==s.ref&&(s.flags|=512,s.flags|=2097152)}return S(s),null;case 6:if(o&&null!=s.stateNode)xo(o,s,o.memoizedProps,u);else{if(\"string\"!=typeof u&&null===s.stateNode)throw Error(p(166));if(i=xh(Zn.current),xh(Xn.current),Gg(s)){if(u=s.stateNode,i=s.memoizedProps,u[dn]=s,(w=u.nodeValue!==i)&&null!==(o=Ln))switch(o.tag){case 3:Af(u.nodeValue,i,!!(1&o.mode));break;case 5:!0!==o.memoizedProps.suppressHydrationWarning&&Af(u.nodeValue,i,!!(1&o.mode))}w&&(s.flags|=4)}else(u=(9===i.nodeType?i:i.ownerDocument).createTextNode(u))[dn]=s,s.stateNode=u}return S(s),null;case 13:if(E(eo),u=s.memoizedState,null===o||null!==o.memoizedState&&null!==o.memoizedState.dehydrated){if(Fn&&null!==Bn&&1&s.mode&&!(128&s.flags))Hg(),Ig(),s.flags|=98560,w=!1;else if(w=Gg(s),null!==u&&null!==u.dehydrated){if(null===o){if(!w)throw Error(p(318));if(!(w=null!==(w=s.memoizedState)?w.dehydrated:null))throw Error(p(317));w[dn]=s}else Ig(),!(128&s.flags)&&(s.memoizedState=null),s.flags|=4;S(s),w=!1}else null!==qn&&(Fj(qn),qn=null),w=!0;if(!w)return 65536&s.flags?s:null}return 128&s.flags?(s.lanes=i,s):((u=null!==u)!==(null!==o&&null!==o.memoizedState)&&u&&(s.child.flags|=8192,1&s.mode&&(null===o||1&eo.current?0===zo&&(zo=3):tj())),null!==s.updateQueue&&(s.flags|=4),S(s),null);case 4:return zh(),wo(o,s),null===o&&sf(s.stateNode.containerInfo),S(s),null;case 10:return ah(s.type._context),S(s),null;case 19:if(E(eo),null===(w=s.memoizedState))return S(s),null;if(u=!!(128&s.flags),null===(C=w.rendering))if(u)Dj(w,!1);else{if(0!==zo||null!==o&&128&o.flags)for(o=s.child;null!==o;){if(null!==(C=Ch(o))){for(s.flags|=128,Dj(w,!1),null!==(u=C.updateQueue)&&(s.updateQueue=u,s.flags|=4),s.subtreeFlags=0,u=i,i=s.child;null!==i;)o=u,(w=i).flags&=14680066,null===(C=w.alternate)?(w.childLanes=0,w.lanes=o,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=C.childLanes,w.lanes=C.lanes,w.child=C.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=C.memoizedProps,w.memoizedState=C.memoizedState,w.updateQueue=C.updateQueue,w.type=C.type,o=C.dependencies,w.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),i=i.sibling;return G(eo,1&eo.current|2),s.child}o=o.sibling}null!==w.tail&&dt()>Qo&&(s.flags|=128,u=!0,Dj(w,!1),s.lanes=4194304)}else{if(!u)if(null!==(o=Ch(C))){if(s.flags|=128,u=!0,null!==(i=o.updateQueue)&&(s.updateQueue=i,s.flags|=4),Dj(w,!0),null===w.tail&&\"hidden\"===w.tailMode&&!C.alternate&&!Fn)return S(s),null}else 2*dt()-w.renderingStartTime>Qo&&1073741824!==i&&(s.flags|=128,u=!0,Dj(w,!1),s.lanes=4194304);w.isBackwards?(C.sibling=s.child,s.child=C):(null!==(i=w.last)?i.sibling=C:s.child=C,w.last=C)}return null!==w.tail?(s=w.tail,w.rendering=s,w.tail=s.sibling,w.renderingStartTime=dt(),s.sibling=null,i=eo.current,G(eo,u?1&i|2:1&i),s):(S(s),null);case 22:case 23:return Hj(),u=null!==s.memoizedState,null!==o&&null!==o.memoizedState!==u&&(s.flags|=8192),u&&1&s.mode?!!(1073741824&Vo)&&(S(s),6&s.subtreeFlags&&(s.flags|=8192)):S(s),null;case 24:case 25:return null}throw Error(p(156,s.tag))}function Ij(o,s){switch(wg(s),s.tag){case 1:return Zf(s.type)&&$f(),65536&(o=s.flags)?(s.flags=-65537&o|128,s):null;case 3:return zh(),E(Sn),E(wn),Eh(),65536&(o=s.flags)&&!(128&o)?(s.flags=-65537&o|128,s):null;case 5:return Bh(s),null;case 13:if(E(eo),null!==(o=s.memoizedState)&&null!==o.dehydrated){if(null===s.alternate)throw Error(p(340));Ig()}return 65536&(o=s.flags)?(s.flags=-65537&o|128,s):null;case 19:return E(eo),null;case 4:return zh(),null;case 10:return ah(s.type._context),null;case 22:case 23:return Hj(),null;default:return null}}Eo=function(o,s){for(var i=s.child;null!==i;){if(5===i.tag||6===i.tag)o.appendChild(i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===s)break;for(;null===i.sibling;){if(null===i.return||i.return===s)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},wo=function(){},So=function(o,s,i,u){var _=o.memoizedProps;if(_!==u){o=s.stateNode,xh(Xn.current);var w,C=null;switch(i){case\"input\":_=Ya(o,_),u=Ya(o,u),C=[];break;case\"select\":_=xe({},_,{value:void 0}),u=xe({},u,{value:void 0}),C=[];break;case\"textarea\":_=gb(o,_),u=gb(o,u),C=[];break;default:\"function\"!=typeof _.onClick&&\"function\"==typeof u.onClick&&(o.onclick=Bf)}for(B in ub(i,u),i=null,_)if(!u.hasOwnProperty(B)&&_.hasOwnProperty(B)&&null!=_[B])if(\"style\"===B){var j=_[B];for(w in j)j.hasOwnProperty(w)&&(i||(i={}),i[w]=\"\")}else\"dangerouslySetInnerHTML\"!==B&&\"children\"!==B&&\"suppressContentEditableWarning\"!==B&&\"suppressHydrationWarning\"!==B&&\"autoFocus\"!==B&&(x.hasOwnProperty(B)?C||(C=[]):(C=C||[]).push(B,null));for(B in u){var L=u[B];if(j=null!=_?_[B]:void 0,u.hasOwnProperty(B)&&L!==j&&(null!=L||null!=j))if(\"style\"===B)if(j){for(w in j)!j.hasOwnProperty(w)||L&&L.hasOwnProperty(w)||(i||(i={}),i[w]=\"\");for(w in L)L.hasOwnProperty(w)&&j[w]!==L[w]&&(i||(i={}),i[w]=L[w])}else i||(C||(C=[]),C.push(B,i)),i=L;else\"dangerouslySetInnerHTML\"===B?(L=L?L.__html:void 0,j=j?j.__html:void 0,null!=L&&j!==L&&(C=C||[]).push(B,L)):\"children\"===B?\"string\"!=typeof L&&\"number\"!=typeof L||(C=C||[]).push(B,\"\"+L):\"suppressContentEditableWarning\"!==B&&\"suppressHydrationWarning\"!==B&&(x.hasOwnProperty(B)?(null!=L&&\"onScroll\"===B&&D(\"scroll\",o),C||j===L||(C=[])):(C=C||[]).push(B,L))}i&&(C=C||[]).push(\"style\",i);var B=C;(s.updateQueue=B)&&(s.flags|=4)}},xo=function(o,s,i,u){i!==u&&(s.flags|=4)};var Oo=!1,Co=!1,Ao=\"function\"==typeof WeakSet?WeakSet:Set,jo=null;function Lj(o,s){var i=o.ref;if(null!==i)if(\"function\"==typeof i)try{i(null)}catch(i){W(o,s,i)}else i.current=null}function Mj(o,s,i){try{i()}catch(i){W(o,s,i)}}var Po=!1;function Pj(o,s,i){var u=s.updateQueue;if(null!==(u=null!==u?u.lastEffect:null)){var _=u=u.next;do{if((_.tag&o)===o){var w=_.destroy;_.destroy=void 0,void 0!==w&&Mj(s,i,w)}_=_.next}while(_!==u)}}function Qj(o,s){if(null!==(s=null!==(s=s.updateQueue)?s.lastEffect:null)){var i=s=s.next;do{if((i.tag&o)===o){var u=i.create;i.destroy=u()}i=i.next}while(i!==s)}}function Rj(o){var s=o.ref;if(null!==s){var i=o.stateNode;o.tag,o=i,\"function\"==typeof s?s(o):s.current=o}}function Sj(o){var s=o.alternate;null!==s&&(o.alternate=null,Sj(s)),o.child=null,o.deletions=null,o.sibling=null,5===o.tag&&(null!==(s=o.stateNode)&&(delete s[dn],delete s[fn],delete s[gn],delete s[yn],delete s[vn])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Tj(o){return 5===o.tag||3===o.tag||4===o.tag}function Uj(o){e:for(;;){for(;null===o.sibling;){if(null===o.return||Tj(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;5!==o.tag&&6!==o.tag&&18!==o.tag;){if(2&o.flags)continue e;if(null===o.child||4===o.tag)continue e;o.child.return=o,o=o.child}if(!(2&o.flags))return o.stateNode}}function Vj(o,s,i){var u=o.tag;if(5===u||6===u)o=o.stateNode,s?8===i.nodeType?i.parentNode.insertBefore(o,s):i.insertBefore(o,s):(8===i.nodeType?(s=i.parentNode).insertBefore(o,i):(s=i).appendChild(o),null!=(i=i._reactRootContainer)||null!==s.onclick||(s.onclick=Bf));else if(4!==u&&null!==(o=o.child))for(Vj(o,s,i),o=o.sibling;null!==o;)Vj(o,s,i),o=o.sibling}function Wj(o,s,i){var u=o.tag;if(5===u||6===u)o=o.stateNode,s?i.insertBefore(o,s):i.appendChild(o);else if(4!==u&&null!==(o=o.child))for(Wj(o,s,i),o=o.sibling;null!==o;)Wj(o,s,i),o=o.sibling}var Io=null,Mo=!1;function Yj(o,s,i){for(i=i.child;null!==i;)Zj(o,s,i),i=i.sibling}function Zj(o,s,i){if(wt&&\"function\"==typeof wt.onCommitFiberUnmount)try{wt.onCommitFiberUnmount(Et,i)}catch(o){}switch(i.tag){case 5:Co||Lj(i,s);case 6:var u=Io,_=Mo;Io=null,Yj(o,s,i),Mo=_,null!==(Io=u)&&(Mo?(o=Io,i=i.stateNode,8===o.nodeType?o.parentNode.removeChild(i):o.removeChild(i)):Io.removeChild(i.stateNode));break;case 18:null!==Io&&(Mo?(o=Io,i=i.stateNode,8===o.nodeType?Kf(o.parentNode,i):1===o.nodeType&&Kf(o,i),bd(o)):Kf(Io,i.stateNode));break;case 4:u=Io,_=Mo,Io=i.stateNode.containerInfo,Mo=!0,Yj(o,s,i),Io=u,Mo=_;break;case 0:case 11:case 14:case 15:if(!Co&&(null!==(u=i.updateQueue)&&null!==(u=u.lastEffect))){_=u=u.next;do{var w=_,x=w.destroy;w=w.tag,void 0!==x&&(2&w||4&w)&&Mj(i,s,x),_=_.next}while(_!==u)}Yj(o,s,i);break;case 1:if(!Co&&(Lj(i,s),\"function\"==typeof(u=i.stateNode).componentWillUnmount))try{u.props=i.memoizedProps,u.state=i.memoizedState,u.componentWillUnmount()}catch(o){W(i,s,o)}Yj(o,s,i);break;case 21:Yj(o,s,i);break;case 22:1&i.mode?(Co=(u=Co)||null!==i.memoizedState,Yj(o,s,i),Co=u):Yj(o,s,i);break;default:Yj(o,s,i)}}function ak(o){var s=o.updateQueue;if(null!==s){o.updateQueue=null;var i=o.stateNode;null===i&&(i=o.stateNode=new Ao),s.forEach((function(s){var u=bk.bind(null,o,s);i.has(s)||(i.add(s),s.then(u,u))}))}}function ck(o,s){var i=s.deletions;if(null!==i)for(var u=0;u<i.length;u++){var _=i[u];try{var w=o,x=s,C=x;e:for(;null!==C;){switch(C.tag){case 5:Io=C.stateNode,Mo=!1;break e;case 3:case 4:Io=C.stateNode.containerInfo,Mo=!0;break e}C=C.return}if(null===Io)throw Error(p(160));Zj(w,x,_),Io=null,Mo=!1;var j=_.alternate;null!==j&&(j.return=null),_.return=null}catch(o){W(_,s,o)}}if(12854&s.subtreeFlags)for(s=s.child;null!==s;)dk(s,o),s=s.sibling}function dk(o,s){var i=o.alternate,u=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(ck(s,o),ek(o),4&u){try{Pj(3,o,o.return),Qj(3,o)}catch(s){W(o,o.return,s)}try{Pj(5,o,o.return)}catch(s){W(o,o.return,s)}}break;case 1:ck(s,o),ek(o),512&u&&null!==i&&Lj(i,i.return);break;case 5:if(ck(s,o),ek(o),512&u&&null!==i&&Lj(i,i.return),32&o.flags){var _=o.stateNode;try{ob(_,\"\")}catch(s){W(o,o.return,s)}}if(4&u&&null!=(_=o.stateNode)){var w=o.memoizedProps,x=null!==i?i.memoizedProps:w,C=o.type,j=o.updateQueue;if(o.updateQueue=null,null!==j)try{\"input\"===C&&\"radio\"===w.type&&null!=w.name&&ab(_,w),vb(C,x);var L=vb(C,w);for(x=0;x<j.length;x+=2){var B=j[x],$=j[x+1];\"style\"===B?sb(_,$):\"dangerouslySetInnerHTML\"===B?$e(_,$):\"children\"===B?ob(_,$):ta(_,B,$,L)}switch(C){case\"input\":bb(_,w);break;case\"textarea\":ib(_,w);break;case\"select\":var V=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!w.multiple;var U=w.value;null!=U?fb(_,!!w.multiple,U,!1):V!==!!w.multiple&&(null!=w.defaultValue?fb(_,!!w.multiple,w.defaultValue,!0):fb(_,!!w.multiple,w.multiple?[]:\"\",!1))}_[fn]=w}catch(s){W(o,o.return,s)}}break;case 6:if(ck(s,o),ek(o),4&u){if(null===o.stateNode)throw Error(p(162));_=o.stateNode,w=o.memoizedProps;try{_.nodeValue=w}catch(s){W(o,o.return,s)}}break;case 3:if(ck(s,o),ek(o),4&u&&null!==i&&i.memoizedState.isDehydrated)try{bd(s.containerInfo)}catch(s){W(o,o.return,s)}break;case 4:default:ck(s,o),ek(o);break;case 13:ck(s,o),ek(o),8192&(_=o.child).flags&&(w=null!==_.memoizedState,_.stateNode.isHidden=w,!w||null!==_.alternate&&null!==_.alternate.memoizedState||(Xo=dt())),4&u&&ak(o);break;case 22:if(B=null!==i&&null!==i.memoizedState,1&o.mode?(Co=(L=Co)||B,ck(s,o),Co=L):ck(s,o),ek(o),8192&u){if(L=null!==o.memoizedState,(o.stateNode.isHidden=L)&&!B&&1&o.mode)for(jo=o,B=o.child;null!==B;){for($=jo=B;null!==jo;){switch(U=(V=jo).child,V.tag){case 0:case 11:case 14:case 15:Pj(4,V,V.return);break;case 1:Lj(V,V.return);var z=V.stateNode;if(\"function\"==typeof z.componentWillUnmount){u=V,i=V.return;try{s=u,z.props=s.memoizedProps,z.state=s.memoizedState,z.componentWillUnmount()}catch(o){W(u,i,o)}}break;case 5:Lj(V,V.return);break;case 22:if(null!==V.memoizedState){gk($);continue}}null!==U?(U.return=V,jo=U):gk($)}B=B.sibling}e:for(B=null,$=o;;){if(5===$.tag){if(null===B){B=$;try{_=$.stateNode,L?\"function\"==typeof(w=_.style).setProperty?w.setProperty(\"display\",\"none\",\"important\"):w.display=\"none\":(C=$.stateNode,x=null!=(j=$.memoizedProps.style)&&j.hasOwnProperty(\"display\")?j.display:null,C.style.display=rb(\"display\",x))}catch(s){W(o,o.return,s)}}}else if(6===$.tag){if(null===B)try{$.stateNode.nodeValue=L?\"\":$.memoizedProps}catch(s){W(o,o.return,s)}}else if((22!==$.tag&&23!==$.tag||null===$.memoizedState||$===o)&&null!==$.child){$.child.return=$,$=$.child;continue}if($===o)break e;for(;null===$.sibling;){if(null===$.return||$.return===o)break e;B===$&&(B=null),$=$.return}B===$&&(B=null),$.sibling.return=$.return,$=$.sibling}}break;case 19:ck(s,o),ek(o),4&u&&ak(o);case 21:}}function ek(o){var s=o.flags;if(2&s){try{e:{for(var i=o.return;null!==i;){if(Tj(i)){var u=i;break e}i=i.return}throw Error(p(160))}switch(u.tag){case 5:var _=u.stateNode;32&u.flags&&(ob(_,\"\"),u.flags&=-33),Wj(o,Uj(o),_);break;case 3:case 4:var w=u.stateNode.containerInfo;Vj(o,Uj(o),w);break;default:throw Error(p(161))}}catch(s){W(o,o.return,s)}o.flags&=-3}4096&s&&(o.flags&=-4097)}function hk(o,s,i){jo=o,ik(o,s,i)}function ik(o,s,i){for(var u=!!(1&o.mode);null!==jo;){var _=jo,w=_.child;if(22===_.tag&&u){var x=null!==_.memoizedState||Oo;if(!x){var C=_.alternate,j=null!==C&&null!==C.memoizedState||Co;C=Oo;var L=Co;if(Oo=x,(Co=j)&&!L)for(jo=_;null!==jo;)j=(x=jo).child,22===x.tag&&null!==x.memoizedState?jk(_):null!==j?(j.return=x,jo=j):jk(_);for(;null!==w;)jo=w,ik(w,s,i),w=w.sibling;jo=_,Oo=C,Co=L}kk(o)}else 8772&_.subtreeFlags&&null!==w?(w.return=_,jo=w):kk(o)}}function kk(o){for(;null!==jo;){var s=jo;if(8772&s.flags){var i=s.alternate;try{if(8772&s.flags)switch(s.tag){case 0:case 11:case 15:Co||Qj(5,s);break;case 1:var u=s.stateNode;if(4&s.flags&&!Co)if(null===i)u.componentDidMount();else{var _=s.elementType===s.type?i.memoizedProps:Ci(s.type,i.memoizedProps);u.componentDidUpdate(_,i.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var w=s.updateQueue;null!==w&&sh(s,w,u);break;case 3:var x=s.updateQueue;if(null!==x){if(i=null,null!==s.child)switch(s.child.tag){case 5:case 1:i=s.child.stateNode}sh(s,x,i)}break;case 5:var C=s.stateNode;if(null===i&&4&s.flags){i=C;var j=s.memoizedProps;switch(s.type){case\"button\":case\"input\":case\"select\":case\"textarea\":j.autoFocus&&i.focus();break;case\"img\":j.src&&(i.src=j.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===s.memoizedState){var L=s.alternate;if(null!==L){var B=L.memoizedState;if(null!==B){var $=B.dehydrated;null!==$&&bd($)}}}break;default:throw Error(p(163))}Co||512&s.flags&&Rj(s)}catch(o){W(s,s.return,o)}}if(s===o){jo=null;break}if(null!==(i=s.sibling)){i.return=s.return,jo=i;break}jo=s.return}}function gk(o){for(;null!==jo;){var s=jo;if(s===o){jo=null;break}var i=s.sibling;if(null!==i){i.return=s.return,jo=i;break}jo=s.return}}function jk(o){for(;null!==jo;){var s=jo;try{switch(s.tag){case 0:case 11:case 15:var i=s.return;try{Qj(4,s)}catch(o){W(s,i,o)}break;case 1:var u=s.stateNode;if(\"function\"==typeof u.componentDidMount){var _=s.return;try{u.componentDidMount()}catch(o){W(s,_,o)}}var w=s.return;try{Rj(s)}catch(o){W(s,w,o)}break;case 5:var x=s.return;try{Rj(s)}catch(o){W(s,x,o)}}}catch(o){W(s,s.return,o)}if(s===o){jo=null;break}var C=s.sibling;if(null!==C){C.return=s.return,jo=C;break}jo=s.return}}var No,To=Math.ceil,Ro=z.ReactCurrentDispatcher,Do=z.ReactCurrentOwner,Lo=z.ReactCurrentBatchConfig,Bo=0,Fo=null,qo=null,$o=0,Vo=0,Uo=Uf(0),zo=0,Wo=null,Ko=0,Ho=0,Jo=0,Go=null,Yo=null,Xo=0,Qo=1/0,Zo=null,es=!1,ts=null,rs=null,ns=!1,os=null,ss=0,as=0,cs=null,ls=-1,us=0;function R(){return 6&Bo?dt():-1!==ls?ls:ls=dt()}function yi(o){return 1&o.mode?2&Bo&&0!==$o?$o&-$o:null!==$n.transition?(0===us&&(us=yc()),us):0!==(o=At)?o:o=void 0===(o=window.event)?16:jd(o.type):1}function gi(o,s,i,u){if(50<as)throw as=0,cs=null,Error(p(185));Ac(o,i,u),2&Bo&&o===Fo||(o===Fo&&(!(2&Bo)&&(Ho|=i),4===zo&&Ck(o,$o)),Dk(o,u),1===i&&0===Bo&&!(1&s.mode)&&(Qo=dt()+500,On&&jg()))}function Dk(o,s){var i=o.callbackNode;!function wc(o,s){for(var i=o.suspendedLanes,u=o.pingedLanes,_=o.expirationTimes,w=o.pendingLanes;0<w;){var x=31-St(w),C=1<<x,j=_[x];-1===j?C&i&&!(C&u)||(_[x]=vc(C,s)):j<=s&&(o.expiredLanes|=C),w&=~C}}(o,s);var u=uc(o,o===Fo?$o:0);if(0===u)null!==i&&ut(i),o.callbackNode=null,o.callbackPriority=0;else if(s=u&-u,o.callbackPriority!==s){if(null!=i&&ut(i),1===s)0===o.tag?function ig(o){On=!0,hg(o)}(Ek.bind(null,o)):hg(Ek.bind(null,o)),pn((function(){!(6&Bo)&&jg()})),i=null;else{switch(Dc(u)){case 1:i=gt;break;case 4:i=yt;break;case 16:default:i=vt;break;case 536870912:i=_t}i=Fk(i,Gk.bind(null,o))}o.callbackPriority=s,o.callbackNode=i}}function Gk(o,s){if(ls=-1,us=0,6&Bo)throw Error(p(327));var i=o.callbackNode;if(Hk()&&o.callbackNode!==i)return null;var u=uc(o,o===Fo?$o:0);if(0===u)return null;if(30&u||u&o.expiredLanes||s)s=Ik(o,u);else{s=u;var _=Bo;Bo|=2;var w=Jk();for(Fo===o&&$o===s||(Zo=null,Qo=dt()+500,Kk(o,s));;)try{Lk();break}catch(s){Mk(o,s)}$g(),Ro.current=w,Bo=_,null!==qo?s=0:(Fo=null,$o=0,s=zo)}if(0!==s){if(2===s&&(0!==(_=xc(o))&&(u=_,s=Nk(o,_))),1===s)throw i=Wo,Kk(o,0),Ck(o,u),Dk(o,dt()),i;if(6===s)Ck(o,u);else{if(_=o.current.alternate,!(30&u||function Ok(o){for(var s=o;;){if(16384&s.flags){var i=s.updateQueue;if(null!==i&&null!==(i=i.stores))for(var u=0;u<i.length;u++){var _=i[u],w=_.getSnapshot;_=_.value;try{if(!Lr(w(),_))return!1}catch(o){return!1}}}if(i=s.child,16384&s.subtreeFlags&&null!==i)i.return=s,s=i;else{if(s===o)break;for(;null===s.sibling;){if(null===s.return||s.return===o)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}(_)||(s=Ik(o,u),2===s&&(w=xc(o),0!==w&&(u=w,s=Nk(o,w))),1!==s)))throw i=Wo,Kk(o,0),Ck(o,u),Dk(o,dt()),i;switch(o.finishedWork=_,o.finishedLanes=u,s){case 0:case 1:throw Error(p(345));case 2:case 5:Pk(o,Yo,Zo);break;case 3:if(Ck(o,u),(130023424&u)===u&&10<(s=Xo+500-dt())){if(0!==uc(o,0))break;if(((_=o.suspendedLanes)&u)!==u){R(),o.pingedLanes|=o.suspendedLanes&_;break}o.timeoutHandle=cn(Pk.bind(null,o,Yo,Zo),s);break}Pk(o,Yo,Zo);break;case 4:if(Ck(o,u),(4194240&u)===u)break;for(s=o.eventTimes,_=-1;0<u;){var x=31-St(u);w=1<<x,(x=s[x])>_&&(_=x),u&=~w}if(u=_,10<(u=(120>(u=dt()-u)?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*To(u/1960))-u)){o.timeoutHandle=cn(Pk.bind(null,o,Yo,Zo),u);break}Pk(o,Yo,Zo);break;default:throw Error(p(329))}}}return Dk(o,dt()),o.callbackNode===i?Gk.bind(null,o):null}function Nk(o,s){var i=Go;return o.current.memoizedState.isDehydrated&&(Kk(o,s).flags|=256),2!==(o=Ik(o,s))&&(s=Yo,Yo=i,null!==s&&Fj(s)),o}function Fj(o){null===Yo?Yo=o:Yo.push.apply(Yo,o)}function Ck(o,s){for(s&=~Jo,s&=~Ho,o.suspendedLanes|=s,o.pingedLanes&=~s,o=o.expirationTimes;0<s;){var i=31-St(s),u=1<<i;o[i]=-1,s&=~u}}function Ek(o){if(6&Bo)throw Error(p(327));Hk();var s=uc(o,0);if(!(1&s))return Dk(o,dt()),null;var i=Ik(o,s);if(0!==o.tag&&2===i){var u=xc(o);0!==u&&(s=u,i=Nk(o,u))}if(1===i)throw i=Wo,Kk(o,0),Ck(o,s),Dk(o,dt()),i;if(6===i)throw Error(p(345));return o.finishedWork=o.current.alternate,o.finishedLanes=s,Pk(o,Yo,Zo),Dk(o,dt()),null}function Qk(o,s){var i=Bo;Bo|=1;try{return o(s)}finally{0===(Bo=i)&&(Qo=dt()+500,On&&jg())}}function Rk(o){null!==os&&0===os.tag&&!(6&Bo)&&Hk();var s=Bo;Bo|=1;var i=Lo.transition,u=At;try{if(Lo.transition=null,At=1,o)return o()}finally{At=u,Lo.transition=i,!(6&(Bo=s))&&jg()}}function Hj(){Vo=Uo.current,E(Uo)}function Kk(o,s){o.finishedWork=null,o.finishedLanes=0;var i=o.timeoutHandle;if(-1!==i&&(o.timeoutHandle=-1,ln(i)),null!==qo)for(i=qo.return;null!==i;){var u=i;switch(wg(u),u.tag){case 1:null!=(u=u.type.childContextTypes)&&$f();break;case 3:zh(),E(Sn),E(wn),Eh();break;case 5:Bh(u);break;case 4:zh();break;case 13:case 19:E(eo);break;case 10:ah(u.type._context);break;case 22:case 23:Hj()}i=i.return}if(Fo=o,qo=o=Pg(o.current,null),$o=Vo=s,zo=0,Wo=null,Jo=Ho=Ko=0,Yo=Go=null,null!==Jn){for(s=0;s<Jn.length;s++)if(null!==(u=(i=Jn[s]).interleaved)){i.interleaved=null;var _=u.next,w=i.pending;if(null!==w){var x=w.next;w.next=_,u.next=x}i.pending=u}Jn=null}return o}function Mk(o,s){for(;;){var i=qo;try{if($g(),ro.current=ho,co){for(var u=so.memoizedState;null!==u;){var _=u.queue;null!==_&&(_.pending=null),u=u.next}co=!1}if(oo=0,ao=io=so=null,lo=!1,uo=0,Do.current=null,null===i||null===i.return){zo=1,Wo=s,qo=null;break}e:{var w=o,x=i.return,C=i,j=s;if(s=$o,C.flags|=32768,null!==j&&\"object\"==typeof j&&\"function\"==typeof j.then){var L=j,B=C,$=B.tag;if(!(1&B.mode||0!==$&&11!==$&&15!==$)){var V=B.alternate;V?(B.updateQueue=V.updateQueue,B.memoizedState=V.memoizedState,B.lanes=V.lanes):(B.updateQueue=null,B.memoizedState=null)}var U=Ui(x);if(null!==U){U.flags&=-257,Vi(U,x,C,0,s),1&U.mode&&Si(w,L,s),j=L;var z=(s=U).updateQueue;if(null===z){var Y=new Set;Y.add(j),s.updateQueue=Y}else z.add(j);break e}if(!(1&s)){Si(w,L,s),tj();break e}j=Error(p(426))}else if(Fn&&1&C.mode){var Z=Ui(x);if(null!==Z){!(65536&Z.flags)&&(Z.flags|=256),Vi(Z,x,C,0,s),Jg(Ji(j,C));break e}}w=j=Ji(j,C),4!==zo&&(zo=2),null===Go?Go=[w]:Go.push(w),w=x;do{switch(w.tag){case 3:w.flags|=65536,s&=-s,w.lanes|=s,ph(w,Ni(0,j,s));break e;case 1:C=j;var ee=w.type,ie=w.stateNode;if(!(128&w.flags||\"function\"!=typeof ee.getDerivedStateFromError&&(null===ie||\"function\"!=typeof ie.componentDidCatch||null!==rs&&rs.has(ie)))){w.flags|=65536,s&=-s,w.lanes|=s,ph(w,Qi(w,C,s));break e}}w=w.return}while(null!==w)}Sk(i)}catch(o){s=o,qo===i&&null!==i&&(qo=i=i.return);continue}break}}function Jk(){var o=Ro.current;return Ro.current=ho,null===o?ho:o}function tj(){0!==zo&&3!==zo&&2!==zo||(zo=4),null===Fo||!(268435455&Ko)&&!(268435455&Ho)||Ck(Fo,$o)}function Ik(o,s){var i=Bo;Bo|=2;var u=Jk();for(Fo===o&&$o===s||(Zo=null,Kk(o,s));;)try{Tk();break}catch(s){Mk(o,s)}if($g(),Bo=i,Ro.current=u,null!==qo)throw Error(p(261));return Fo=null,$o=0,zo}function Tk(){for(;null!==qo;)Uk(qo)}function Lk(){for(;null!==qo&&!pt();)Uk(qo)}function Uk(o){var s=No(o.alternate,o,Vo);o.memoizedProps=o.pendingProps,null===s?Sk(o):qo=s,Do.current=null}function Sk(o){var s=o;do{var i=s.alternate;if(o=s.return,32768&s.flags){if(null!==(i=Ij(i,s)))return i.flags&=32767,void(qo=i);if(null===o)return zo=6,void(qo=null);o.flags|=32768,o.subtreeFlags=0,o.deletions=null}else if(null!==(i=Ej(i,s,Vo)))return void(qo=i);if(null!==(s=s.sibling))return void(qo=s);qo=s=o}while(null!==s);0===zo&&(zo=5)}function Pk(o,s,i){var u=At,_=Lo.transition;try{Lo.transition=null,At=1,function Wk(o,s,i,u){do{Hk()}while(null!==os);if(6&Bo)throw Error(p(327));i=o.finishedWork;var _=o.finishedLanes;if(null===i)return null;if(o.finishedWork=null,o.finishedLanes=0,i===o.current)throw Error(p(177));o.callbackNode=null,o.callbackPriority=0;var w=i.lanes|i.childLanes;if(function Bc(o,s){var i=o.pendingLanes&~s;o.pendingLanes=s,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=s,o.mutableReadLanes&=s,o.entangledLanes&=s,s=o.entanglements;var u=o.eventTimes;for(o=o.expirationTimes;0<i;){var _=31-St(i),w=1<<_;s[_]=0,u[_]=-1,o[_]=-1,i&=~w}}(o,w),o===Fo&&(qo=Fo=null,$o=0),!(2064&i.subtreeFlags)&&!(2064&i.flags)||ns||(ns=!0,Fk(vt,(function(){return Hk(),null}))),w=!!(15990&i.flags),!!(15990&i.subtreeFlags)||w){w=Lo.transition,Lo.transition=null;var x=At;At=1;var C=Bo;Bo|=4,Do.current=null,function Oj(o,s){if(sn=zt,Ne(o=Me())){if(\"selectionStart\"in o)var i={start:o.selectionStart,end:o.selectionEnd};else e:{var u=(i=(i=o.ownerDocument)&&i.defaultView||window).getSelection&&i.getSelection();if(u&&0!==u.rangeCount){i=u.anchorNode;var _=u.anchorOffset,w=u.focusNode;u=u.focusOffset;try{i.nodeType,w.nodeType}catch(o){i=null;break e}var x=0,C=-1,j=-1,L=0,B=0,$=o,V=null;t:for(;;){for(var U;$!==i||0!==_&&3!==$.nodeType||(C=x+_),$!==w||0!==u&&3!==$.nodeType||(j=x+u),3===$.nodeType&&(x+=$.nodeValue.length),null!==(U=$.firstChild);)V=$,$=U;for(;;){if($===o)break t;if(V===i&&++L===_&&(C=x),V===w&&++B===u&&(j=x),null!==(U=$.nextSibling))break;V=($=V).parentNode}$=U}i=-1===C||-1===j?null:{start:C,end:j}}else i=null}i=i||{start:0,end:0}}else i=null;for(an={focusedElem:o,selectionRange:i},zt=!1,jo=s;null!==jo;)if(o=(s=jo).child,1028&s.subtreeFlags&&null!==o)o.return=s,jo=o;else for(;null!==jo;){s=jo;try{var z=s.alternate;if(1024&s.flags)switch(s.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==z){var Y=z.memoizedProps,Z=z.memoizedState,ee=s.stateNode,ie=ee.getSnapshotBeforeUpdate(s.elementType===s.type?Y:Ci(s.type,Y),Z);ee.__reactInternalSnapshotBeforeUpdate=ie}break;case 3:var ae=s.stateNode.containerInfo;1===ae.nodeType?ae.textContent=\"\":9===ae.nodeType&&ae.documentElement&&ae.removeChild(ae.documentElement);break;default:throw Error(p(163))}}catch(o){W(s,s.return,o)}if(null!==(o=s.sibling)){o.return=s.return,jo=o;break}jo=s.return}return z=Po,Po=!1,z}(o,i),dk(i,o),Oe(an),zt=!!sn,an=sn=null,o.current=i,hk(i,o,_),ht(),Bo=C,At=x,Lo.transition=w}else o.current=i;if(ns&&(ns=!1,os=o,ss=_),w=o.pendingLanes,0===w&&(rs=null),function mc(o){if(wt&&\"function\"==typeof wt.onCommitFiberRoot)try{wt.onCommitFiberRoot(Et,o,void 0,!(128&~o.current.flags))}catch(o){}}(i.stateNode),Dk(o,dt()),null!==s)for(u=o.onRecoverableError,i=0;i<s.length;i++)_=s[i],u(_.value,{componentStack:_.stack,digest:_.digest});if(es)throw es=!1,o=ts,ts=null,o;return!!(1&ss)&&0!==o.tag&&Hk(),w=o.pendingLanes,1&w?o===cs?as++:(as=0,cs=o):as=0,jg(),null}(o,s,i,u)}finally{Lo.transition=_,At=u}return null}function Hk(){if(null!==os){var o=Dc(ss),s=Lo.transition,i=At;try{if(Lo.transition=null,At=16>o?16:o,null===os)var u=!1;else{if(o=os,os=null,ss=0,6&Bo)throw Error(p(331));var _=Bo;for(Bo|=4,jo=o.current;null!==jo;){var w=jo,x=w.child;if(16&jo.flags){var C=w.deletions;if(null!==C){for(var j=0;j<C.length;j++){var L=C[j];for(jo=L;null!==jo;){var B=jo;switch(B.tag){case 0:case 11:case 15:Pj(8,B,w)}var $=B.child;if(null!==$)$.return=B,jo=$;else for(;null!==jo;){var V=(B=jo).sibling,U=B.return;if(Sj(B),B===L){jo=null;break}if(null!==V){V.return=U,jo=V;break}jo=U}}}var z=w.alternate;if(null!==z){var Y=z.child;if(null!==Y){z.child=null;do{var Z=Y.sibling;Y.sibling=null,Y=Z}while(null!==Y)}}jo=w}}if(2064&w.subtreeFlags&&null!==x)x.return=w,jo=x;else e:for(;null!==jo;){if(2048&(w=jo).flags)switch(w.tag){case 0:case 11:case 15:Pj(9,w,w.return)}var ee=w.sibling;if(null!==ee){ee.return=w.return,jo=ee;break e}jo=w.return}}var ie=o.current;for(jo=ie;null!==jo;){var ae=(x=jo).child;if(2064&x.subtreeFlags&&null!==ae)ae.return=x,jo=ae;else e:for(x=ie;null!==jo;){if(2048&(C=jo).flags)try{switch(C.tag){case 0:case 11:case 15:Qj(9,C)}}catch(o){W(C,C.return,o)}if(C===x){jo=null;break e}var ce=C.sibling;if(null!==ce){ce.return=C.return,jo=ce;break e}jo=C.return}}if(Bo=_,jg(),wt&&\"function\"==typeof wt.onPostCommitFiberRoot)try{wt.onPostCommitFiberRoot(Et,o)}catch(o){}u=!0}return u}finally{At=i,Lo.transition=s}}return!1}function Xk(o,s,i){o=nh(o,s=Ni(0,s=Ji(i,s),1),1),s=R(),null!==o&&(Ac(o,1,s),Dk(o,s))}function W(o,s,i){if(3===o.tag)Xk(o,o,i);else for(;null!==s;){if(3===s.tag){Xk(s,o,i);break}if(1===s.tag){var u=s.stateNode;if(\"function\"==typeof s.type.getDerivedStateFromError||\"function\"==typeof u.componentDidCatch&&(null===rs||!rs.has(u))){s=nh(s,o=Qi(s,o=Ji(i,o),1),1),o=R(),null!==s&&(Ac(s,1,o),Dk(s,o));break}}s=s.return}}function Ti(o,s,i){var u=o.pingCache;null!==u&&u.delete(s),s=R(),o.pingedLanes|=o.suspendedLanes&i,Fo===o&&($o&i)===i&&(4===zo||3===zo&&(130023424&$o)===$o&&500>dt()-Xo?Kk(o,0):Jo|=i),Dk(o,s)}function Yk(o,s){0===s&&(1&o.mode?(s=Ct,!(130023424&(Ct<<=1))&&(Ct=4194304)):s=1);var i=R();null!==(o=ih(o,s))&&(Ac(o,s,i),Dk(o,i))}function uj(o){var s=o.memoizedState,i=0;null!==s&&(i=s.retryLane),Yk(o,i)}function bk(o,s){var i=0;switch(o.tag){case 13:var u=o.stateNode,_=o.memoizedState;null!==_&&(i=_.retryLane);break;case 19:u=o.stateNode;break;default:throw Error(p(314))}null!==u&&u.delete(s),Yk(o,i)}function Fk(o,s){return lt(o,s)}function $k(o,s,i,u){this.tag=o,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(o,s,i,u){return new $k(o,s,i,u)}function aj(o){return!(!(o=o.prototype)||!o.isReactComponent)}function Pg(o,s){var i=o.alternate;return null===i?((i=Bg(o.tag,s,o.key,o.mode)).elementType=o.elementType,i.type=o.type,i.stateNode=o.stateNode,i.alternate=o,o.alternate=i):(i.pendingProps=s,i.type=o.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=14680064&o.flags,i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,s=o.dependencies,i.dependencies=null===s?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=o.sibling,i.index=o.index,i.ref=o.ref,i}function Rg(o,s,i,u,_,w){var x=2;if(u=o,\"function\"==typeof o)aj(o)&&(x=1);else if(\"string\"==typeof o)x=5;else e:switch(o){case ee:return Tg(i.children,_,w,s);case ie:x=8,_|=8;break;case ae:return(o=Bg(12,i,s,2|_)).elementType=ae,o.lanes=w,o;case de:return(o=Bg(13,i,s,_)).elementType=de,o.lanes=w,o;case fe:return(o=Bg(19,i,s,_)).elementType=fe,o.lanes=w,o;case _e:return pj(i,_,w,s);default:if(\"object\"==typeof o&&null!==o)switch(o.$$typeof){case ce:x=10;break e;case le:x=9;break e;case pe:x=11;break e;case ye:x=14;break e;case be:x=16,u=null;break e}throw Error(p(130,null==o?o:typeof o,\"\"))}return(s=Bg(x,i,s,_)).elementType=o,s.type=u,s.lanes=w,s}function Tg(o,s,i,u){return(o=Bg(7,o,u,s)).lanes=i,o}function pj(o,s,i,u){return(o=Bg(22,o,u,s)).elementType=_e,o.lanes=i,o.stateNode={isHidden:!1},o}function Qg(o,s,i){return(o=Bg(6,o,null,s)).lanes=i,o}function Sg(o,s,i){return(s=Bg(4,null!==o.children?o.children:[],o.key,s)).lanes=i,s.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},s}function al(o,s,i,u,_){this.tag=s,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=u,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function bl(o,s,i,u,_,w,x,C,j){return o=new al(o,s,i,C,j),1===s?(s=1,!0===w&&(s|=8)):s=0,w=Bg(3,null,null,s),o.current=w,w.stateNode=o,w.memoizedState={element:u,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(w),o}function dl(o){if(!o)return En;e:{if(Vb(o=o._reactInternals)!==o||1!==o.tag)throw Error(p(170));var s=o;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Zf(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(null!==s);throw Error(p(171))}if(1===o.tag){var i=o.type;if(Zf(i))return bg(o,i,s)}return s}function el(o,s,i,u,_,w,x,C,j){return(o=bl(i,u,!0,o,0,w,0,C,j)).context=dl(null),i=o.current,(w=mh(u=R(),_=yi(i))).callback=null!=s?s:null,nh(i,w,_),o.current.lanes=_,Ac(o,_,u),Dk(o,u),o}function fl(o,s,i,u){var _=s.current,w=R(),x=yi(_);return i=dl(i),null===s.context?s.context=i:s.pendingContext=i,(s=mh(w,x)).payload={element:o},null!==(u=void 0===u?null:u)&&(s.callback=u),null!==(o=nh(_,s,x))&&(gi(o,_,x,w),oh(o,_,x)),x}function gl(o){return(o=o.current).child?(o.child.tag,o.child.stateNode):null}function hl(o,s){if(null!==(o=o.memoizedState)&&null!==o.dehydrated){var i=o.retryLane;o.retryLane=0!==i&&i<s?i:s}}function il(o,s){hl(o,s),(o=o.alternate)&&hl(o,s)}No=function(o,s,i){if(null!==o)if(o.memoizedProps!==s.pendingProps||Sn.current)_o=!0;else{if(!(o.lanes&i||128&s.flags))return _o=!1,function yj(o,s,i){switch(s.tag){case 3:kj(s),Ig();break;case 5:Ah(s);break;case 1:Zf(s.type)&&cg(s);break;case 4:yh(s,s.stateNode.containerInfo);break;case 10:var u=s.type._context,_=s.memoizedProps.value;G(zn,u._currentValue),u._currentValue=_;break;case 13:if(null!==(u=s.memoizedState))return null!==u.dehydrated?(G(eo,1&eo.current),s.flags|=128,null):i&s.child.childLanes?oj(o,s,i):(G(eo,1&eo.current),null!==(o=Zi(o,s,i))?o.sibling:null);G(eo,1&eo.current);break;case 19:if(u=!!(i&s.childLanes),128&o.flags){if(u)return xj(o,s,i);s.flags|=128}if(null!==(_=s.memoizedState)&&(_.rendering=null,_.tail=null,_.lastEffect=null),G(eo,eo.current),u)break;return null;case 22:case 23:return s.lanes=0,dj(o,s,i)}return Zi(o,s,i)}(o,s,i);_o=!!(131072&o.flags)}else _o=!1,Fn&&1048576&s.flags&&ug(s,In,s.index);switch(s.lanes=0,s.tag){case 2:var u=s.type;ij(o,s),o=s.pendingProps;var _=Yf(s,wn.current);ch(s,i),_=Nh(null,s,u,o,_,i);var w=Sh();return s.flags|=1,\"object\"==typeof _&&null!==_&&\"function\"==typeof _.render&&void 0===_.$$typeof?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Zf(u)?(w=!0,cg(s)):w=!1,s.memoizedState=null!==_.state&&void 0!==_.state?_.state:null,kh(s),_.updater=yo,s.stateNode=_,_._reactInternals=s,Ii(s,u,o,i),s=jj(null,s,u,!0,w,i)):(s.tag=0,Fn&&w&&vg(s),Xi(null,s,_,i),s=s.child),s;case 16:u=s.elementType;e:{switch(ij(o,s),o=s.pendingProps,u=(_=u._init)(u._payload),s.type=u,_=s.tag=function Zk(o){if(\"function\"==typeof o)return aj(o)?1:0;if(null!=o){if((o=o.$$typeof)===pe)return 11;if(o===ye)return 14}return 2}(u),o=Ci(u,o),_){case 0:s=cj(null,s,u,o,i);break e;case 1:s=hj(null,s,u,o,i);break e;case 11:s=Yi(null,s,u,o,i);break e;case 14:s=$i(null,s,u,Ci(u.type,o),i);break e}throw Error(p(306,u,\"\"))}return s;case 0:return u=s.type,_=s.pendingProps,cj(o,s,u,_=s.elementType===u?_:Ci(u,_),i);case 1:return u=s.type,_=s.pendingProps,hj(o,s,u,_=s.elementType===u?_:Ci(u,_),i);case 3:e:{if(kj(s),null===o)throw Error(p(387));u=s.pendingProps,_=(w=s.memoizedState).element,lh(o,s),qh(s,u,null,i);var x=s.memoizedState;if(u=x.element,w.isDehydrated){if(w={element:u,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},s.updateQueue.baseState=w,s.memoizedState=w,256&s.flags){s=lj(o,s,u,i,_=Ji(Error(p(423)),s));break e}if(u!==_){s=lj(o,s,u,i,_=Ji(Error(p(424)),s));break e}for(Bn=Lf(s.stateNode.containerInfo.firstChild),Ln=s,Fn=!0,qn=null,i=Un(s,null,u,i),s.child=i;i;)i.flags=-3&i.flags|4096,i=i.sibling}else{if(Ig(),u===_){s=Zi(o,s,i);break e}Xi(o,s,u,i)}s=s.child}return s;case 5:return Ah(s),null===o&&Eg(s),u=s.type,_=s.pendingProps,w=null!==o?o.memoizedProps:null,x=_.children,Ef(u,_)?x=null:null!==w&&Ef(u,w)&&(s.flags|=32),gj(o,s),Xi(o,s,x,i),s.child;case 6:return null===o&&Eg(s),null;case 13:return oj(o,s,i);case 4:return yh(s,s.stateNode.containerInfo),u=s.pendingProps,null===o?s.child=Vn(s,null,u,i):Xi(o,s,u,i),s.child;case 11:return u=s.type,_=s.pendingProps,Yi(o,s,u,_=s.elementType===u?_:Ci(u,_),i);case 7:return Xi(o,s,s.pendingProps,i),s.child;case 8:case 12:return Xi(o,s,s.pendingProps.children,i),s.child;case 10:e:{if(u=s.type._context,_=s.pendingProps,w=s.memoizedProps,x=_.value,G(zn,u._currentValue),u._currentValue=x,null!==w)if(Lr(w.value,x)){if(w.children===_.children&&!Sn.current){s=Zi(o,s,i);break e}}else for(null!==(w=s.child)&&(w.return=s);null!==w;){var C=w.dependencies;if(null!==C){x=w.child;for(var j=C.firstContext;null!==j;){if(j.context===u){if(1===w.tag){(j=mh(-1,i&-i)).tag=2;var L=w.updateQueue;if(null!==L){var B=(L=L.shared).pending;null===B?j.next=j:(j.next=B.next,B.next=j),L.pending=j}}w.lanes|=i,null!==(j=w.alternate)&&(j.lanes|=i),bh(w.return,i,s),C.lanes|=i;break}j=j.next}}else if(10===w.tag)x=w.type===s.type?null:w.child;else if(18===w.tag){if(null===(x=w.return))throw Error(p(341));x.lanes|=i,null!==(C=x.alternate)&&(C.lanes|=i),bh(x,i,s),x=w.sibling}else x=w.child;if(null!==x)x.return=w;else for(x=w;null!==x;){if(x===s){x=null;break}if(null!==(w=x.sibling)){w.return=x.return,x=w;break}x=x.return}w=x}Xi(o,s,_.children,i),s=s.child}return s;case 9:return _=s.type,u=s.pendingProps.children,ch(s,i),u=u(_=eh(_)),s.flags|=1,Xi(o,s,u,i),s.child;case 14:return _=Ci(u=s.type,s.pendingProps),$i(o,s,u,_=Ci(u.type,_),i);case 15:return bj(o,s,s.type,s.pendingProps,i);case 17:return u=s.type,_=s.pendingProps,_=s.elementType===u?_:Ci(u,_),ij(o,s),s.tag=1,Zf(u)?(o=!0,cg(s)):o=!1,ch(s,i),Gi(s,u,_),Ii(s,u,_,i),jj(null,s,u,!0,o,i);case 19:return xj(o,s,i);case 22:return dj(o,s,i)}throw Error(p(156,s.tag))};var ps=\"function\"==typeof reportError?reportError:function(o){console.error(o)};function ll(o){this._internalRoot=o}function ml(o){this._internalRoot=o}function nl(o){return!(!o||1!==o.nodeType&&9!==o.nodeType&&11!==o.nodeType)}function ol(o){return!(!o||1!==o.nodeType&&9!==o.nodeType&&11!==o.nodeType&&(8!==o.nodeType||\" react-mount-point-unstable \"!==o.nodeValue))}function pl(){}function rl(o,s,i,u,_){var w=i._reactRootContainer;if(w){var x=w;if(\"function\"==typeof _){var C=_;_=function(){var o=gl(x);C.call(o)}}fl(s,x,o,_)}else x=function ql(o,s,i,u,_){if(_){if(\"function\"==typeof u){var w=u;u=function(){var o=gl(x);w.call(o)}}var x=el(s,u,o,0,null,!1,0,\"\",pl);return o._reactRootContainer=x,o[mn]=x.current,sf(8===o.nodeType?o.parentNode:o),Rk(),x}for(;_=o.lastChild;)o.removeChild(_);if(\"function\"==typeof u){var C=u;u=function(){var o=gl(j);C.call(o)}}var j=bl(o,0,!1,null,0,!1,0,\"\",pl);return o._reactRootContainer=j,o[mn]=j.current,sf(8===o.nodeType?o.parentNode:o),Rk((function(){fl(s,j,i,u)})),j}(i,s,o,_,u);return gl(x)}ml.prototype.render=ll.prototype.render=function(o){var s=this._internalRoot;if(null===s)throw Error(p(409));fl(o,s,null,null)},ml.prototype.unmount=ll.prototype.unmount=function(){var o=this._internalRoot;if(null!==o){this._internalRoot=null;var s=o.containerInfo;Rk((function(){fl(null,o,null,null)})),s[mn]=null}},ml.prototype.unstable_scheduleHydration=function(o){if(o){var s=Mt();o={blockedOn:null,target:o,priority:s};for(var i=0;i<$t.length&&0!==s&&s<$t[i].priority;i++);$t.splice(i,0,o),0===i&&Vc(o)}},jt=function(o){switch(o.tag){case 3:var s=o.stateNode;if(s.current.memoizedState.isDehydrated){var i=tc(s.pendingLanes);0!==i&&(Cc(s,1|i),Dk(s,dt()),!(6&Bo)&&(Qo=dt()+500,jg()))}break;case 13:Rk((function(){var s=ih(o,1);if(null!==s){var i=R();gi(s,o,1,i)}})),il(o,1)}},Pt=function(o){if(13===o.tag){var s=ih(o,134217728);if(null!==s)gi(s,o,134217728,R());il(o,134217728)}},It=function(o){if(13===o.tag){var s=yi(o),i=ih(o,s);if(null!==i)gi(i,o,s,R());il(o,s)}},Mt=function(){return At},Nt=function(o,s){var i=At;try{return At=o,s()}finally{At=i}},Xe=function(o,s,i){switch(s){case\"input\":if(bb(o,i),s=i.name,\"radio\"===i.type&&null!=s){for(i=o;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll(\"input[name=\"+JSON.stringify(\"\"+s)+'][type=\"radio\"]'),s=0;s<i.length;s++){var u=i[s];if(u!==o&&u.form===o.form){var _=Db(u);if(!_)throw Error(p(90));Wa(u),bb(u,_)}}}break;case\"textarea\":ib(o,i);break;case\"select\":null!=(s=i.value)&&fb(o,!!i.multiple,s,!1)}},Gb=Qk,Hb=Rk;var hs={usingClientEntryPoint:!1,Events:[Cb,ue,Db,Eb,Fb,Qk]},ds={findFiberByHostInstance:Wc,bundleType:0,version:\"18.3.1\",rendererPackageName:\"react-dom\"},fs={bundleType:ds.bundleType,version:ds.version,rendererPackageName:ds.rendererPackageName,rendererConfig:ds.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:z.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return null===(o=Zb(o))?null:o.stateNode},findFiberByHostInstance:ds.findFiberByHostInstance||function jl(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:\"18.3.1-next-f1338f8080-20240426\"};if(\"undefined\"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ms=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ms.isDisabled&&ms.supportsFiber)try{Et=ms.inject(fs),wt=ms}catch(qe){}}s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hs,s.createPortal=function(o,s){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nl(s))throw Error(p(200));return function cl(o,s,i){var u=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Z,key:null==u?null:\"\"+u,children:o,containerInfo:s,implementation:i}}(o,s,null,i)},s.createRoot=function(o,s){if(!nl(o))throw Error(p(299));var i=!1,u=\"\",_=ps;return null!=s&&(!0===s.unstable_strictMode&&(i=!0),void 0!==s.identifierPrefix&&(u=s.identifierPrefix),void 0!==s.onRecoverableError&&(_=s.onRecoverableError)),s=bl(o,1,!1,null,0,i,0,u,_),o[mn]=s.current,sf(8===o.nodeType?o.parentNode:o),new ll(s)},s.findDOMNode=function(o){if(null==o)return null;if(1===o.nodeType)return o;var s=o._reactInternals;if(void 0===s){if(\"function\"==typeof o.render)throw Error(p(188));throw o=Object.keys(o).join(\",\"),Error(p(268,o))}return o=null===(o=Zb(s))?null:o.stateNode},s.flushSync=function(o){return Rk(o)},s.hydrate=function(o,s,i){if(!ol(s))throw Error(p(200));return rl(null,o,s,!0,i)},s.hydrateRoot=function(o,s,i){if(!nl(o))throw Error(p(405));var u=null!=i&&i.hydratedSources||null,_=!1,w=\"\",x=ps;if(null!=i&&(!0===i.unstable_strictMode&&(_=!0),void 0!==i.identifierPrefix&&(w=i.identifierPrefix),void 0!==i.onRecoverableError&&(x=i.onRecoverableError)),s=el(s,null,o,1,null!=i?i:null,_,0,w,x),o[mn]=s.current,sf(o),u)for(o=0;o<u.length;o++)_=(_=(i=u[o])._getVersion)(i._source),null==s.mutableSourceEagerHydrationData?s.mutableSourceEagerHydrationData=[i,_]:s.mutableSourceEagerHydrationData.push(i,_);return new ml(s)},s.render=function(o,s,i){if(!ol(s))throw Error(p(200));return rl(null,o,s,!1,i)},s.unmountComponentAtNode=function(o){if(!ol(o))throw Error(p(40));return!!o._reactRootContainer&&(Rk((function(){rl(null,null,o,!1,(function(){o._reactRootContainer=null,o[mn]=null}))})),!0)},s.unstable_batchedUpdates=Qk,s.unstable_renderSubtreeIntoContainer=function(o,s,i,u){if(!ol(i))throw Error(p(200));if(null==o||void 0===o._reactInternals)throw Error(p(38));return rl(o,s,i,!1,u)},s.version=\"18.3.1-next-f1338f8080-20240426\"},40961:(o,s,i)=>{\"use strict\";!function checkDCE(){if(\"undefined\"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&\"function\"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(o){console.error(o)}}(),o.exports=i(22551)},2209:(o,s,i)=>{\"use strict\";var u,_=i(9404),w=\"<<anonymous>>\",x=function productionTypeChecker(){invariant(!1,\"ImmutablePropTypes type checking code is stripped in production.\")};x.isRequired=x;var C=function getProductionTypeChecker(){return x};function getPropType(o){var s=typeof o;return Array.isArray(o)?\"array\":o instanceof RegExp?\"object\":o instanceof _.Iterable?\"Immutable.\"+o.toSource().split(\" \")[0]:s}function createChainableTypeChecker(o){function checkType(s,i,u,_,x,C){for(var j=arguments.length,L=Array(j>6?j-6:0),B=6;B<j;B++)L[B-6]=arguments[B];return C=C||u,_=_||w,null!=i[u]?o.apply(void 0,[i,u,_,x,C].concat(L)):s?new Error(\"Required \"+x+\" `\"+C+\"` was not specified in `\"+_+\"`.\"):void 0}var s=checkType.bind(null,!1);return s.isRequired=checkType.bind(null,!0),s}function createIterableSubclassTypeChecker(o,s){return function createImmutableTypeChecker(o,s){return createChainableTypeChecker((function validate(i,u,_,w,x){var C=i[u];if(!s(C)){var j=getPropType(C);return new Error(\"Invalid \"+w+\" `\"+x+\"` of type `\"+j+\"` supplied to `\"+_+\"`, expected `\"+o+\"`.\")}return null}))}(\"Iterable.\"+o,(function(o){return _.Iterable.isIterable(o)&&s(o)}))}(u={listOf:C,mapOf:C,orderedMapOf:C,setOf:C,orderedSetOf:C,stackOf:C,iterableOf:C,recordOf:C,shape:C,contains:C,mapContains:C,orderedMapContains:C,list:x,map:x,orderedMap:x,set:x,orderedSet:x,stack:x,seq:x,record:x,iterable:x}).iterable.indexed=createIterableSubclassTypeChecker(\"Indexed\",_.Iterable.isIndexed),u.iterable.keyed=createIterableSubclassTypeChecker(\"Keyed\",_.Iterable.isKeyed),o.exports=u},15287:(o,s)=>{\"use strict\";var i=Symbol.for(\"react.element\"),u=Symbol.for(\"react.portal\"),_=Symbol.for(\"react.fragment\"),w=Symbol.for(\"react.strict_mode\"),x=Symbol.for(\"react.profiler\"),C=Symbol.for(\"react.provider\"),j=Symbol.for(\"react.context\"),L=Symbol.for(\"react.forward_ref\"),B=Symbol.for(\"react.suspense\"),$=Symbol.for(\"react.memo\"),V=Symbol.for(\"react.lazy\"),U=Symbol.iterator;var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,Z={};function E(o,s,i){this.props=o,this.context=s,this.refs=Z,this.updater=i||z}function F(){}function G(o,s,i){this.props=o,this.context=s,this.refs=Z,this.updater=i||z}E.prototype.isReactComponent={},E.prototype.setState=function(o,s){if(\"object\"!=typeof o&&\"function\"!=typeof o&&null!=o)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,o,s,\"setState\")},E.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,\"forceUpdate\")},F.prototype=E.prototype;var ee=G.prototype=new F;ee.constructor=G,Y(ee,E.prototype),ee.isPureReactComponent=!0;var ie=Array.isArray,ae=Object.prototype.hasOwnProperty,ce={current:null},le={key:!0,ref:!0,__self:!0,__source:!0};function M(o,s,u){var _,w={},x=null,C=null;if(null!=s)for(_ in void 0!==s.ref&&(C=s.ref),void 0!==s.key&&(x=\"\"+s.key),s)ae.call(s,_)&&!le.hasOwnProperty(_)&&(w[_]=s[_]);var j=arguments.length-2;if(1===j)w.children=u;else if(1<j){for(var L=Array(j),B=0;B<j;B++)L[B]=arguments[B+2];w.children=L}if(o&&o.defaultProps)for(_ in j=o.defaultProps)void 0===w[_]&&(w[_]=j[_]);return{$$typeof:i,type:o,key:x,ref:C,props:w,_owner:ce.current}}function O(o){return\"object\"==typeof o&&null!==o&&o.$$typeof===i}var pe=/\\/+/g;function Q(o,s){return\"object\"==typeof o&&null!==o&&null!=o.key?function escape(o){var s={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+o.replace(/[=:]/g,(function(o){return s[o]}))}(\"\"+o.key):s.toString(36)}function R(o,s,_,w,x){var C=typeof o;\"undefined\"!==C&&\"boolean\"!==C||(o=null);var j=!1;if(null===o)j=!0;else switch(C){case\"string\":case\"number\":j=!0;break;case\"object\":switch(o.$$typeof){case i:case u:j=!0}}if(j)return x=x(j=o),o=\"\"===w?\".\"+Q(j,0):w,ie(x)?(_=\"\",null!=o&&(_=o.replace(pe,\"$&/\")+\"/\"),R(x,s,_,\"\",(function(o){return o}))):null!=x&&(O(x)&&(x=function N(o,s){return{$$typeof:i,type:o.type,key:s,ref:o.ref,props:o.props,_owner:o._owner}}(x,_+(!x.key||j&&j.key===x.key?\"\":(\"\"+x.key).replace(pe,\"$&/\")+\"/\")+o)),s.push(x)),1;if(j=0,w=\"\"===w?\".\":w+\":\",ie(o))for(var L=0;L<o.length;L++){var B=w+Q(C=o[L],L);j+=R(C,s,_,B,x)}else if(B=function A(o){return null===o||\"object\"!=typeof o?null:\"function\"==typeof(o=U&&o[U]||o[\"@@iterator\"])?o:null}(o),\"function\"==typeof B)for(o=B.call(o),L=0;!(C=o.next()).done;)j+=R(C=C.value,s,_,B=w+Q(C,L++),x);else if(\"object\"===C)throw s=String(o),Error(\"Objects are not valid as a React child (found: \"+(\"[object Object]\"===s?\"object with keys {\"+Object.keys(o).join(\", \")+\"}\":s)+\"). If you meant to render a collection of children, use an array instead.\");return j}function S(o,s,i){if(null==o)return o;var u=[],_=0;return R(o,u,\"\",\"\",(function(o){return s.call(i,o,_++)})),u}function T(o){if(-1===o._status){var s=o._result;(s=s()).then((function(s){0!==o._status&&-1!==o._status||(o._status=1,o._result=s)}),(function(s){0!==o._status&&-1!==o._status||(o._status=2,o._result=s)})),-1===o._status&&(o._status=0,o._result=s)}if(1===o._status)return o._result.default;throw o._result}var de={current:null},fe={transition:null},ye={ReactCurrentDispatcher:de,ReactCurrentBatchConfig:fe,ReactCurrentOwner:ce};function X(){throw Error(\"act(...) is not supported in production builds of React.\")}s.Children={map:S,forEach:function(o,s,i){S(o,(function(){s.apply(this,arguments)}),i)},count:function(o){var s=0;return S(o,(function(){s++})),s},toArray:function(o){return S(o,(function(o){return o}))||[]},only:function(o){if(!O(o))throw Error(\"React.Children.only expected to receive a single React element child.\");return o}},s.Component=E,s.Fragment=_,s.Profiler=x,s.PureComponent=G,s.StrictMode=w,s.Suspense=B,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ye,s.act=X,s.cloneElement=function(o,s,u){if(null==o)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+o+\".\");var _=Y({},o.props),w=o.key,x=o.ref,C=o._owner;if(null!=s){if(void 0!==s.ref&&(x=s.ref,C=ce.current),void 0!==s.key&&(w=\"\"+s.key),o.type&&o.type.defaultProps)var j=o.type.defaultProps;for(L in s)ae.call(s,L)&&!le.hasOwnProperty(L)&&(_[L]=void 0===s[L]&&void 0!==j?j[L]:s[L])}var L=arguments.length-2;if(1===L)_.children=u;else if(1<L){j=Array(L);for(var B=0;B<L;B++)j[B]=arguments[B+2];_.children=j}return{$$typeof:i,type:o.type,key:w,ref:x,props:_,_owner:C}},s.createContext=function(o){return(o={$$typeof:j,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:C,_context:o},o.Consumer=o},s.createElement=M,s.createFactory=function(o){var s=M.bind(null,o);return s.type=o,s},s.createRef=function(){return{current:null}},s.forwardRef=function(o){return{$$typeof:L,render:o}},s.isValidElement=O,s.lazy=function(o){return{$$typeof:V,_payload:{_status:-1,_result:o},_init:T}},s.memo=function(o,s){return{$$typeof:$,type:o,compare:void 0===s?null:s}},s.startTransition=function(o){var s=fe.transition;fe.transition={};try{o()}finally{fe.transition=s}},s.unstable_act=X,s.useCallback=function(o,s){return de.current.useCallback(o,s)},s.useContext=function(o){return de.current.useContext(o)},s.useDebugValue=function(){},s.useDeferredValue=function(o){return de.current.useDeferredValue(o)},s.useEffect=function(o,s){return de.current.useEffect(o,s)},s.useId=function(){return de.current.useId()},s.useImperativeHandle=function(o,s,i){return de.current.useImperativeHandle(o,s,i)},s.useInsertionEffect=function(o,s){return de.current.useInsertionEffect(o,s)},s.useLayoutEffect=function(o,s){return de.current.useLayoutEffect(o,s)},s.useMemo=function(o,s){return de.current.useMemo(o,s)},s.useReducer=function(o,s,i){return de.current.useReducer(o,s,i)},s.useRef=function(o){return de.current.useRef(o)},s.useState=function(o){return de.current.useState(o)},s.useSyncExternalStore=function(o,s,i){return de.current.useSyncExternalStore(o,s,i)},s.useTransition=function(){return de.current.useTransition()},s.version=\"18.3.1\"},96540:(o,s,i)=>{\"use strict\";o.exports=i(15287)},86048:o=>{\"use strict\";var s={};function createErrorType(o,i,u){u||(u=Error);var _=function(o){function NodeError(s,u,_){return o.call(this,function getMessage(o,s,u){return\"string\"==typeof i?i:i(o,s,u)}(s,u,_))||this}return function _inheritsLoose(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.__proto__=s}(NodeError,o),NodeError}(u);_.prototype.name=u.name,_.prototype.code=o,s[o]=_}function oneOf(o,s){if(Array.isArray(o)){var i=o.length;return o=o.map((function(o){return String(o)})),i>2?\"one of \".concat(s,\" \").concat(o.slice(0,i-1).join(\", \"),\", or \")+o[i-1]:2===i?\"one of \".concat(s,\" \").concat(o[0],\" or \").concat(o[1]):\"of \".concat(s,\" \").concat(o[0])}return\"of \".concat(s,\" \").concat(String(o))}createErrorType(\"ERR_INVALID_OPT_VALUE\",(function(o,s){return'The value \"'+s+'\" is invalid for option \"'+o+'\"'}),TypeError),createErrorType(\"ERR_INVALID_ARG_TYPE\",(function(o,s,i){var u,_;if(\"string\"==typeof s&&function startsWith(o,s,i){return o.substr(!i||i<0?0:+i,s.length)===s}(s,\"not \")?(u=\"must not be\",s=s.replace(/^not /,\"\")):u=\"must be\",function endsWith(o,s,i){return(void 0===i||i>o.length)&&(i=o.length),o.substring(i-s.length,i)===s}(o,\" argument\"))_=\"The \".concat(o,\" \").concat(u,\" \").concat(oneOf(s,\"type\"));else{var w=function includes(o,s,i){return\"number\"!=typeof i&&(i=0),!(i+s.length>o.length)&&-1!==o.indexOf(s,i)}(o,\".\")?\"property\":\"argument\";_='The \"'.concat(o,'\" ').concat(w,\" \").concat(u,\" \").concat(oneOf(s,\"type\"))}return _+=\". Received type \".concat(typeof i)}),TypeError),createErrorType(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),createErrorType(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(o){return\"The \"+o+\" method is not implemented\"})),createErrorType(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),createErrorType(\"ERR_STREAM_DESTROYED\",(function(o){return\"Cannot call \"+o+\" after a stream was destroyed\"})),createErrorType(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),createErrorType(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),createErrorType(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),createErrorType(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),createErrorType(\"ERR_UNKNOWN_ENCODING\",(function(o){return\"Unknown encoding: \"+o}),TypeError),createErrorType(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),o.exports.F=s},25382:(o,s,i)=>{\"use strict\";var u=i(65606),_=Object.keys||function(o){var s=[];for(var i in o)s.push(i);return s};o.exports=Duplex;var w=i(45412),x=i(16708);i(56698)(Duplex,w);for(var C=_(x.prototype),j=0;j<C.length;j++){var L=C[j];Duplex.prototype[L]||(Duplex.prototype[L]=x.prototype[L])}function Duplex(o){if(!(this instanceof Duplex))return new Duplex(o);w.call(this,o),x.call(this,o),this.allowHalfOpen=!0,o&&(!1===o.readable&&(this.readable=!1),!1===o.writable&&(this.writable=!1),!1===o.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(\"end\",onend)))}function onend(){this._writableState.ended||u.nextTick(onEndNT,this)}function onEndNT(o){o.end()}Object.defineProperty(Duplex.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,\"writableBuffer\",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Duplex.prototype,\"writableLength\",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Duplex.prototype,\"destroyed\",{enumerable:!1,get:function get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function set(o){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=o,this._writableState.destroyed=o)}})},63600:(o,s,i)=>{\"use strict\";o.exports=PassThrough;var u=i(74610);function PassThrough(o){if(!(this instanceof PassThrough))return new PassThrough(o);u.call(this,o)}i(56698)(PassThrough,u),PassThrough.prototype._transform=function(o,s,i){i(null,o)}},45412:(o,s,i)=>{\"use strict\";var u,_=i(65606);o.exports=Readable,Readable.ReadableState=ReadableState;i(37007).EventEmitter;var w=function EElistenerCount(o,s){return o.listeners(s).length},x=i(40345),C=i(48287).Buffer,j=(void 0!==i.g?i.g:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var L,B=i(79838);L=B&&B.debuglog?B.debuglog(\"stream\"):function debug(){};var $,V,U,z=i(80345),Y=i(75896),Z=i(65291).getHighWaterMark,ee=i(86048).F,ie=ee.ERR_INVALID_ARG_TYPE,ae=ee.ERR_STREAM_PUSH_AFTER_EOF,ce=ee.ERR_METHOD_NOT_IMPLEMENTED,le=ee.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;i(56698)(Readable,x);var pe=Y.errorOrDestroy,de=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function ReadableState(o,s,_){u=u||i(25382),o=o||{},\"boolean\"!=typeof _&&(_=s instanceof u),this.objectMode=!!o.objectMode,_&&(this.objectMode=this.objectMode||!!o.readableObjectMode),this.highWaterMark=Z(this,o,\"readableHighWaterMark\",_),this.buffer=new z,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=!1!==o.emitClose,this.autoDestroy=!!o.autoDestroy,this.destroyed=!1,this.defaultEncoding=o.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,o.encoding&&($||($=i(83141).I),this.decoder=new $(o.encoding),this.encoding=o.encoding)}function Readable(o){if(u=u||i(25382),!(this instanceof Readable))return new Readable(o);var s=this instanceof u;this._readableState=new ReadableState(o,this,s),this.readable=!0,o&&(\"function\"==typeof o.read&&(this._read=o.read),\"function\"==typeof o.destroy&&(this._destroy=o.destroy)),x.call(this)}function readableAddChunk(o,s,i,u,_){L(\"readableAddChunk\",s);var w,x=o._readableState;if(null===s)x.reading=!1,function onEofChunk(o,s){if(L(\"onEofChunk\"),s.ended)return;if(s.decoder){var i=s.decoder.end();i&&i.length&&(s.buffer.push(i),s.length+=s.objectMode?1:i.length)}s.ended=!0,s.sync?emitReadable(o):(s.needReadable=!1,s.emittedReadable||(s.emittedReadable=!0,emitReadable_(o)))}(o,x);else if(_||(w=function chunkInvalid(o,s){var i;(function _isUint8Array(o){return C.isBuffer(o)||o instanceof j})(s)||\"string\"==typeof s||void 0===s||o.objectMode||(i=new ie(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],s));return i}(x,s)),w)pe(o,w);else if(x.objectMode||s&&s.length>0)if(\"string\"==typeof s||x.objectMode||Object.getPrototypeOf(s)===C.prototype||(s=function _uint8ArrayToBuffer(o){return C.from(o)}(s)),u)x.endEmitted?pe(o,new le):addChunk(o,x,s,!0);else if(x.ended)pe(o,new ae);else{if(x.destroyed)return!1;x.reading=!1,x.decoder&&!i?(s=x.decoder.write(s),x.objectMode||0!==s.length?addChunk(o,x,s,!1):maybeReadMore(o,x)):addChunk(o,x,s,!1)}else u||(x.reading=!1,maybeReadMore(o,x));return!x.ended&&(x.length<x.highWaterMark||0===x.length)}function addChunk(o,s,i,u){s.flowing&&0===s.length&&!s.sync?(s.awaitDrain=0,o.emit(\"data\",i)):(s.length+=s.objectMode?1:i.length,u?s.buffer.unshift(i):s.buffer.push(i),s.needReadable&&emitReadable(o)),maybeReadMore(o,s)}Object.defineProperty(Readable.prototype,\"destroyed\",{enumerable:!1,get:function get(){return void 0!==this._readableState&&this._readableState.destroyed},set:function set(o){this._readableState&&(this._readableState.destroyed=o)}}),Readable.prototype.destroy=Y.destroy,Readable.prototype._undestroy=Y.undestroy,Readable.prototype._destroy=function(o,s){s(o)},Readable.prototype.push=function(o,s){var i,u=this._readableState;return u.objectMode?i=!0:\"string\"==typeof o&&((s=s||u.defaultEncoding)!==u.encoding&&(o=C.from(o,s),s=\"\"),i=!0),readableAddChunk(this,o,s,!1,i)},Readable.prototype.unshift=function(o){return readableAddChunk(this,o,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(o){$||($=i(83141).I);var s=new $(o);this._readableState.decoder=s,this._readableState.encoding=this._readableState.decoder.encoding;for(var u=this._readableState.buffer.head,_=\"\";null!==u;)_+=s.write(u.data),u=u.next;return this._readableState.buffer.clear(),\"\"!==_&&this._readableState.buffer.push(_),this._readableState.length=_.length,this};var fe=1073741824;function howMuchToRead(o,s){return o<=0||0===s.length&&s.ended?0:s.objectMode?1:o!=o?s.flowing&&s.length?s.buffer.head.data.length:s.length:(o>s.highWaterMark&&(s.highWaterMark=function computeNewHighWaterMark(o){return o>=fe?o=fe:(o--,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o++),o}(o)),o<=s.length?o:s.ended?s.length:(s.needReadable=!0,0))}function emitReadable(o){var s=o._readableState;L(\"emitReadable\",s.needReadable,s.emittedReadable),s.needReadable=!1,s.emittedReadable||(L(\"emitReadable\",s.flowing),s.emittedReadable=!0,_.nextTick(emitReadable_,o))}function emitReadable_(o){var s=o._readableState;L(\"emitReadable_\",s.destroyed,s.length,s.ended),s.destroyed||!s.length&&!s.ended||(o.emit(\"readable\"),s.emittedReadable=!1),s.needReadable=!s.flowing&&!s.ended&&s.length<=s.highWaterMark,flow(o)}function maybeReadMore(o,s){s.readingMore||(s.readingMore=!0,_.nextTick(maybeReadMore_,o,s))}function maybeReadMore_(o,s){for(;!s.reading&&!s.ended&&(s.length<s.highWaterMark||s.flowing&&0===s.length);){var i=s.length;if(L(\"maybeReadMore read 0\"),o.read(0),i===s.length)break}s.readingMore=!1}function updateReadableListening(o){var s=o._readableState;s.readableListening=o.listenerCount(\"readable\")>0,s.resumeScheduled&&!s.paused?s.flowing=!0:o.listenerCount(\"data\")>0&&o.resume()}function nReadingNextTick(o){L(\"readable nexttick read 0\"),o.read(0)}function resume_(o,s){L(\"resume\",s.reading),s.reading||o.read(0),s.resumeScheduled=!1,o.emit(\"resume\"),flow(o),s.flowing&&!s.reading&&o.read(0)}function flow(o){var s=o._readableState;for(L(\"flow\",s.flowing);s.flowing&&null!==o.read(););}function fromList(o,s){return 0===s.length?null:(s.objectMode?i=s.buffer.shift():!o||o>=s.length?(i=s.decoder?s.buffer.join(\"\"):1===s.buffer.length?s.buffer.first():s.buffer.concat(s.length),s.buffer.clear()):i=s.buffer.consume(o,s.decoder),i);var i}function endReadable(o){var s=o._readableState;L(\"endReadable\",s.endEmitted),s.endEmitted||(s.ended=!0,_.nextTick(endReadableNT,s,o))}function endReadableNT(o,s){if(L(\"endReadableNT\",o.endEmitted,o.length),!o.endEmitted&&0===o.length&&(o.endEmitted=!0,s.readable=!1,s.emit(\"end\"),o.autoDestroy)){var i=s._writableState;(!i||i.autoDestroy&&i.finished)&&s.destroy()}}function indexOf(o,s){for(var i=0,u=o.length;i<u;i++)if(o[i]===s)return i;return-1}Readable.prototype.read=function(o){L(\"read\",o),o=parseInt(o,10);var s=this._readableState,i=o;if(0!==o&&(s.emittedReadable=!1),0===o&&s.needReadable&&((0!==s.highWaterMark?s.length>=s.highWaterMark:s.length>0)||s.ended))return L(\"read: emitReadable\",s.length,s.ended),0===s.length&&s.ended?endReadable(this):emitReadable(this),null;if(0===(o=howMuchToRead(o,s))&&s.ended)return 0===s.length&&endReadable(this),null;var u,_=s.needReadable;return L(\"need readable\",_),(0===s.length||s.length-o<s.highWaterMark)&&L(\"length less than watermark\",_=!0),s.ended||s.reading?L(\"reading or ended\",_=!1):_&&(L(\"do read\"),s.reading=!0,s.sync=!0,0===s.length&&(s.needReadable=!0),this._read(s.highWaterMark),s.sync=!1,s.reading||(o=howMuchToRead(i,s))),null===(u=o>0?fromList(o,s):null)?(s.needReadable=s.length<=s.highWaterMark,o=0):(s.length-=o,s.awaitDrain=0),0===s.length&&(s.ended||(s.needReadable=!0),i!==o&&s.ended&&endReadable(this)),null!==u&&this.emit(\"data\",u),u},Readable.prototype._read=function(o){pe(this,new ce(\"_read()\"))},Readable.prototype.pipe=function(o,s){var i=this,u=this._readableState;switch(u.pipesCount){case 0:u.pipes=o;break;case 1:u.pipes=[u.pipes,o];break;default:u.pipes.push(o)}u.pipesCount+=1,L(\"pipe count=%d opts=%j\",u.pipesCount,s);var x=(!s||!1!==s.end)&&o!==_.stdout&&o!==_.stderr?onend:unpipe;function onunpipe(s,_){L(\"onunpipe\"),s===i&&_&&!1===_.hasUnpiped&&(_.hasUnpiped=!0,function cleanup(){L(\"cleanup\"),o.removeListener(\"close\",onclose),o.removeListener(\"finish\",onfinish),o.removeListener(\"drain\",C),o.removeListener(\"error\",onerror),o.removeListener(\"unpipe\",onunpipe),i.removeListener(\"end\",onend),i.removeListener(\"end\",unpipe),i.removeListener(\"data\",ondata),j=!0,!u.awaitDrain||o._writableState&&!o._writableState.needDrain||C()}())}function onend(){L(\"onend\"),o.end()}u.endEmitted?_.nextTick(x):i.once(\"end\",x),o.on(\"unpipe\",onunpipe);var C=function pipeOnDrain(o){return function pipeOnDrainFunctionResult(){var s=o._readableState;L(\"pipeOnDrain\",s.awaitDrain),s.awaitDrain&&s.awaitDrain--,0===s.awaitDrain&&w(o,\"data\")&&(s.flowing=!0,flow(o))}}(i);o.on(\"drain\",C);var j=!1;function ondata(s){L(\"ondata\");var _=o.write(s);L(\"dest.write\",_),!1===_&&((1===u.pipesCount&&u.pipes===o||u.pipesCount>1&&-1!==indexOf(u.pipes,o))&&!j&&(L(\"false write response, pause\",u.awaitDrain),u.awaitDrain++),i.pause())}function onerror(s){L(\"onerror\",s),unpipe(),o.removeListener(\"error\",onerror),0===w(o,\"error\")&&pe(o,s)}function onclose(){o.removeListener(\"finish\",onfinish),unpipe()}function onfinish(){L(\"onfinish\"),o.removeListener(\"close\",onclose),unpipe()}function unpipe(){L(\"unpipe\"),i.unpipe(o)}return i.on(\"data\",ondata),function prependListener(o,s,i){if(\"function\"==typeof o.prependListener)return o.prependListener(s,i);o._events&&o._events[s]?Array.isArray(o._events[s])?o._events[s].unshift(i):o._events[s]=[i,o._events[s]]:o.on(s,i)}(o,\"error\",onerror),o.once(\"close\",onclose),o.once(\"finish\",onfinish),o.emit(\"pipe\",i),u.flowing||(L(\"pipe resume\"),i.resume()),o},Readable.prototype.unpipe=function(o){var s=this._readableState,i={hasUnpiped:!1};if(0===s.pipesCount)return this;if(1===s.pipesCount)return o&&o!==s.pipes||(o||(o=s.pipes),s.pipes=null,s.pipesCount=0,s.flowing=!1,o&&o.emit(\"unpipe\",this,i)),this;if(!o){var u=s.pipes,_=s.pipesCount;s.pipes=null,s.pipesCount=0,s.flowing=!1;for(var w=0;w<_;w++)u[w].emit(\"unpipe\",this,{hasUnpiped:!1});return this}var x=indexOf(s.pipes,o);return-1===x||(s.pipes.splice(x,1),s.pipesCount-=1,1===s.pipesCount&&(s.pipes=s.pipes[0]),o.emit(\"unpipe\",this,i)),this},Readable.prototype.on=function(o,s){var i=x.prototype.on.call(this,o,s),u=this._readableState;return\"data\"===o?(u.readableListening=this.listenerCount(\"readable\")>0,!1!==u.flowing&&this.resume()):\"readable\"===o&&(u.endEmitted||u.readableListening||(u.readableListening=u.needReadable=!0,u.flowing=!1,u.emittedReadable=!1,L(\"on readable\",u.length,u.reading),u.length?emitReadable(this):u.reading||_.nextTick(nReadingNextTick,this))),i},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.removeListener=function(o,s){var i=x.prototype.removeListener.call(this,o,s);return\"readable\"===o&&_.nextTick(updateReadableListening,this),i},Readable.prototype.removeAllListeners=function(o){var s=x.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==o&&void 0!==o||_.nextTick(updateReadableListening,this),s},Readable.prototype.resume=function(){var o=this._readableState;return o.flowing||(L(\"resume\"),o.flowing=!o.readableListening,function resume(o,s){s.resumeScheduled||(s.resumeScheduled=!0,_.nextTick(resume_,o,s))}(this,o)),o.paused=!1,this},Readable.prototype.pause=function(){return L(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(L(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},Readable.prototype.wrap=function(o){var s=this,i=this._readableState,u=!1;for(var _ in o.on(\"end\",(function(){if(L(\"wrapped end\"),i.decoder&&!i.ended){var o=i.decoder.end();o&&o.length&&s.push(o)}s.push(null)})),o.on(\"data\",(function(_){(L(\"wrapped data\"),i.decoder&&(_=i.decoder.write(_)),i.objectMode&&null==_)||(i.objectMode||_&&_.length)&&(s.push(_)||(u=!0,o.pause()))})),o)void 0===this[_]&&\"function\"==typeof o[_]&&(this[_]=function methodWrap(s){return function methodWrapReturnFunction(){return o[s].apply(o,arguments)}}(_));for(var w=0;w<de.length;w++)o.on(de[w],this.emit.bind(this,de[w]));return this._read=function(s){L(\"wrapped _read\",s),u&&(u=!1,o.resume())},this},\"function\"==typeof Symbol&&(Readable.prototype[Symbol.asyncIterator]=function(){return void 0===V&&(V=i(2955)),V(this)}),Object.defineProperty(Readable.prototype,\"readableHighWaterMark\",{enumerable:!1,get:function get(){return this._readableState.highWaterMark}}),Object.defineProperty(Readable.prototype,\"readableBuffer\",{enumerable:!1,get:function get(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Readable.prototype,\"readableFlowing\",{enumerable:!1,get:function get(){return this._readableState.flowing},set:function set(o){this._readableState&&(this._readableState.flowing=o)}}),Readable._fromList=fromList,Object.defineProperty(Readable.prototype,\"readableLength\",{enumerable:!1,get:function get(){return this._readableState.length}}),\"function\"==typeof Symbol&&(Readable.from=function(o,s){return void 0===U&&(U=i(55157)),U(Readable,o,s)})},74610:(o,s,i)=>{\"use strict\";o.exports=Transform;var u=i(86048).F,_=u.ERR_METHOD_NOT_IMPLEMENTED,w=u.ERR_MULTIPLE_CALLBACK,x=u.ERR_TRANSFORM_ALREADY_TRANSFORMING,C=u.ERR_TRANSFORM_WITH_LENGTH_0,j=i(25382);function afterTransform(o,s){var i=this._transformState;i.transforming=!1;var u=i.writecb;if(null===u)return this.emit(\"error\",new w);i.writechunk=null,i.writecb=null,null!=s&&this.push(s),u(o);var _=this._readableState;_.reading=!1,(_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}function Transform(o){if(!(this instanceof Transform))return new Transform(o);j.call(this,o),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,o&&(\"function\"==typeof o.transform&&(this._transform=o.transform),\"function\"==typeof o.flush&&(this._flush=o.flush)),this.on(\"prefinish\",prefinish)}function prefinish(){var o=this;\"function\"!=typeof this._flush||this._readableState.destroyed?done(this,null,null):this._flush((function(s,i){done(o,s,i)}))}function done(o,s,i){if(s)return o.emit(\"error\",s);if(null!=i&&o.push(i),o._writableState.length)throw new C;if(o._transformState.transforming)throw new x;return o.push(null)}i(56698)(Transform,j),Transform.prototype.push=function(o,s){return this._transformState.needTransform=!1,j.prototype.push.call(this,o,s)},Transform.prototype._transform=function(o,s,i){i(new _(\"_transform()\"))},Transform.prototype._write=function(o,s,i){var u=this._transformState;if(u.writecb=i,u.writechunk=o,u.writeencoding=s,!u.transforming){var _=this._readableState;(u.needTransform||_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}},Transform.prototype._read=function(o){var s=this._transformState;null===s.writechunk||s.transforming?s.needTransform=!0:(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform))},Transform.prototype._destroy=function(o,s){j.prototype._destroy.call(this,o,(function(o){s(o)}))}},16708:(o,s,i)=>{\"use strict\";var u,_=i(65606);function CorkedRequest(o){var s=this;this.next=null,this.entry=null,this.finish=function(){!function onCorkedFinish(o,s,i){var u=o.entry;o.entry=null;for(;u;){var _=u.callback;s.pendingcb--,_(i),u=u.next}s.corkedRequestsFree.next=o}(s,o)}}o.exports=Writable,Writable.WritableState=WritableState;var w={deprecate:i(94643)},x=i(40345),C=i(48287).Buffer,j=(void 0!==i.g?i.g:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var L,B=i(75896),$=i(65291).getHighWaterMark,V=i(86048).F,U=V.ERR_INVALID_ARG_TYPE,z=V.ERR_METHOD_NOT_IMPLEMENTED,Y=V.ERR_MULTIPLE_CALLBACK,Z=V.ERR_STREAM_CANNOT_PIPE,ee=V.ERR_STREAM_DESTROYED,ie=V.ERR_STREAM_NULL_VALUES,ae=V.ERR_STREAM_WRITE_AFTER_END,ce=V.ERR_UNKNOWN_ENCODING,le=B.errorOrDestroy;function nop(){}function WritableState(o,s,w){u=u||i(25382),o=o||{},\"boolean\"!=typeof w&&(w=s instanceof u),this.objectMode=!!o.objectMode,w&&(this.objectMode=this.objectMode||!!o.writableObjectMode),this.highWaterMark=$(this,o,\"writableHighWaterMark\",w),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var x=!1===o.decodeStrings;this.decodeStrings=!x,this.defaultEncoding=o.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){!function onwrite(o,s){var i=o._writableState,u=i.sync,w=i.writecb;if(\"function\"!=typeof w)throw new Y;if(function onwriteStateUpdate(o){o.writing=!1,o.writecb=null,o.length-=o.writelen,o.writelen=0}(i),s)!function onwriteError(o,s,i,u,w){--s.pendingcb,i?(_.nextTick(w,u),_.nextTick(finishMaybe,o,s),o._writableState.errorEmitted=!0,le(o,u)):(w(u),o._writableState.errorEmitted=!0,le(o,u),finishMaybe(o,s))}(o,i,u,s,w);else{var x=needFinish(i)||o.destroyed;x||i.corked||i.bufferProcessing||!i.bufferedRequest||clearBuffer(o,i),u?_.nextTick(afterWrite,o,i,x,w):afterWrite(o,i,x,w)}}(s,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==o.emitClose,this.autoDestroy=!!o.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(o){var s=this instanceof(u=u||i(25382));if(!s&&!L.call(Writable,this))return new Writable(o);this._writableState=new WritableState(o,this,s),this.writable=!0,o&&(\"function\"==typeof o.write&&(this._write=o.write),\"function\"==typeof o.writev&&(this._writev=o.writev),\"function\"==typeof o.destroy&&(this._destroy=o.destroy),\"function\"==typeof o.final&&(this._final=o.final)),x.call(this)}function doWrite(o,s,i,u,_,w,x){s.writelen=u,s.writecb=x,s.writing=!0,s.sync=!0,s.destroyed?s.onwrite(new ee(\"write\")):i?o._writev(_,s.onwrite):o._write(_,w,s.onwrite),s.sync=!1}function afterWrite(o,s,i,u){i||function onwriteDrain(o,s){0===s.length&&s.needDrain&&(s.needDrain=!1,o.emit(\"drain\"))}(o,s),s.pendingcb--,u(),finishMaybe(o,s)}function clearBuffer(o,s){s.bufferProcessing=!0;var i=s.bufferedRequest;if(o._writev&&i&&i.next){var u=s.bufferedRequestCount,_=new Array(u),w=s.corkedRequestsFree;w.entry=i;for(var x=0,C=!0;i;)_[x]=i,i.isBuf||(C=!1),i=i.next,x+=1;_.allBuffers=C,doWrite(o,s,!0,s.length,_,\"\",w.finish),s.pendingcb++,s.lastBufferedRequest=null,w.next?(s.corkedRequestsFree=w.next,w.next=null):s.corkedRequestsFree=new CorkedRequest(s),s.bufferedRequestCount=0}else{for(;i;){var j=i.chunk,L=i.encoding,B=i.callback;if(doWrite(o,s,!1,s.objectMode?1:j.length,j,L,B),i=i.next,s.bufferedRequestCount--,s.writing)break}null===i&&(s.lastBufferedRequest=null)}s.bufferedRequest=i,s.bufferProcessing=!1}function needFinish(o){return o.ending&&0===o.length&&null===o.bufferedRequest&&!o.finished&&!o.writing}function callFinal(o,s){o._final((function(i){s.pendingcb--,i&&le(o,i),s.prefinished=!0,o.emit(\"prefinish\"),finishMaybe(o,s)}))}function finishMaybe(o,s){var i=needFinish(s);if(i&&(function prefinish(o,s){s.prefinished||s.finalCalled||(\"function\"!=typeof o._final||s.destroyed?(s.prefinished=!0,o.emit(\"prefinish\")):(s.pendingcb++,s.finalCalled=!0,_.nextTick(callFinal,o,s)))}(o,s),0===s.pendingcb&&(s.finished=!0,o.emit(\"finish\"),s.autoDestroy))){var u=o._readableState;(!u||u.autoDestroy&&u.endEmitted)&&o.destroy()}return i}i(56698)(Writable,x),WritableState.prototype.getBuffer=function getBuffer(){for(var o=this.bufferedRequest,s=[];o;)s.push(o),o=o.next;return s},function(){try{Object.defineProperty(WritableState.prototype,\"buffer\",{get:w.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch(o){}}(),\"function\"==typeof Symbol&&Symbol.hasInstance&&\"function\"==typeof Function.prototype[Symbol.hasInstance]?(L=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(o){return!!L.call(this,o)||this===Writable&&(o&&o._writableState instanceof WritableState)}})):L=function realHasInstance(o){return o instanceof this},Writable.prototype.pipe=function(){le(this,new Z)},Writable.prototype.write=function(o,s,i){var u=this._writableState,w=!1,x=!u.objectMode&&function _isUint8Array(o){return C.isBuffer(o)||o instanceof j}(o);return x&&!C.isBuffer(o)&&(o=function _uint8ArrayToBuffer(o){return C.from(o)}(o)),\"function\"==typeof s&&(i=s,s=null),x?s=\"buffer\":s||(s=u.defaultEncoding),\"function\"!=typeof i&&(i=nop),u.ending?function writeAfterEnd(o,s){var i=new ae;le(o,i),_.nextTick(s,i)}(this,i):(x||function validChunk(o,s,i,u){var w;return null===i?w=new ie:\"string\"==typeof i||s.objectMode||(w=new U(\"chunk\",[\"string\",\"Buffer\"],i)),!w||(le(o,w),_.nextTick(u,w),!1)}(this,u,o,i))&&(u.pendingcb++,w=function writeOrBuffer(o,s,i,u,_,w){if(!i){var x=function decodeChunk(o,s,i){o.objectMode||!1===o.decodeStrings||\"string\"!=typeof s||(s=C.from(s,i));return s}(s,u,_);u!==x&&(i=!0,_=\"buffer\",u=x)}var j=s.objectMode?1:u.length;s.length+=j;var L=s.length<s.highWaterMark;L||(s.needDrain=!0);if(s.writing||s.corked){var B=s.lastBufferedRequest;s.lastBufferedRequest={chunk:u,encoding:_,isBuf:i,callback:w,next:null},B?B.next=s.lastBufferedRequest:s.bufferedRequest=s.lastBufferedRequest,s.bufferedRequestCount+=1}else doWrite(o,s,!1,j,u,_,w);return L}(this,u,x,o,s,i)),w},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var o=this._writableState;o.corked&&(o.corked--,o.writing||o.corked||o.bufferProcessing||!o.bufferedRequest||clearBuffer(this,o))},Writable.prototype.setDefaultEncoding=function setDefaultEncoding(o){if(\"string\"==typeof o&&(o=o.toLowerCase()),!([\"hex\",\"utf8\",\"utf-8\",\"ascii\",\"binary\",\"base64\",\"ucs2\",\"ucs-2\",\"utf16le\",\"utf-16le\",\"raw\"].indexOf((o+\"\").toLowerCase())>-1))throw new ce(o);return this._writableState.defaultEncoding=o,this},Object.defineProperty(Writable.prototype,\"writableBuffer\",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Writable.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(o,s,i){i(new z(\"_write()\"))},Writable.prototype._writev=null,Writable.prototype.end=function(o,s,i){var u=this._writableState;return\"function\"==typeof o?(i=o,o=null,s=null):\"function\"==typeof s&&(i=s,s=null),null!=o&&this.write(o,s),u.corked&&(u.corked=1,this.uncork()),u.ending||function endWritable(o,s,i){s.ending=!0,finishMaybe(o,s),i&&(s.finished?_.nextTick(i):o.once(\"finish\",i));s.ended=!0,o.writable=!1}(this,u,i),this},Object.defineProperty(Writable.prototype,\"writableLength\",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Writable.prototype,\"destroyed\",{enumerable:!1,get:function get(){return void 0!==this._writableState&&this._writableState.destroyed},set:function set(o){this._writableState&&(this._writableState.destroyed=o)}}),Writable.prototype.destroy=B.destroy,Writable.prototype._undestroy=B.undestroy,Writable.prototype._destroy=function(o,s){s(o)}},2955:(o,s,i)=>{\"use strict\";var u,_=i(65606);function _defineProperty(o,s,i){return(s=function _toPropertyKey(o){var s=function _toPrimitive(o,s){if(\"object\"!=typeof o||null===o)return o;var i=o[Symbol.toPrimitive];if(void 0!==i){var u=i.call(o,s||\"default\");if(\"object\"!=typeof u)return u;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===s?String:Number)(o)}(o,\"string\");return\"symbol\"==typeof s?s:String(s)}(s))in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}var w=i(86238),x=Symbol(\"lastResolve\"),C=Symbol(\"lastReject\"),j=Symbol(\"error\"),L=Symbol(\"ended\"),B=Symbol(\"lastPromise\"),$=Symbol(\"handlePromise\"),V=Symbol(\"stream\");function createIterResult(o,s){return{value:o,done:s}}function readAndResolve(o){var s=o[x];if(null!==s){var i=o[V].read();null!==i&&(o[B]=null,o[x]=null,o[C]=null,s(createIterResult(i,!1)))}}function onReadable(o){_.nextTick(readAndResolve,o)}var U=Object.getPrototypeOf((function(){})),z=Object.setPrototypeOf((_defineProperty(u={get stream(){return this[V]},next:function next(){var o=this,s=this[j];if(null!==s)return Promise.reject(s);if(this[L])return Promise.resolve(createIterResult(void 0,!0));if(this[V].destroyed)return new Promise((function(s,i){_.nextTick((function(){o[j]?i(o[j]):s(createIterResult(void 0,!0))}))}));var i,u=this[B];if(u)i=new Promise(function wrapForNext(o,s){return function(i,u){o.then((function(){s[L]?i(createIterResult(void 0,!0)):s[$](i,u)}),u)}}(u,this));else{var w=this[V].read();if(null!==w)return Promise.resolve(createIterResult(w,!1));i=new Promise(this[$])}return this[B]=i,i}},Symbol.asyncIterator,(function(){return this})),_defineProperty(u,\"return\",(function _return(){var o=this;return new Promise((function(s,i){o[V].destroy(null,(function(o){o?i(o):s(createIterResult(void 0,!0))}))}))})),u),U);o.exports=function createReadableStreamAsyncIterator(o){var s,i=Object.create(z,(_defineProperty(s={},V,{value:o,writable:!0}),_defineProperty(s,x,{value:null,writable:!0}),_defineProperty(s,C,{value:null,writable:!0}),_defineProperty(s,j,{value:null,writable:!0}),_defineProperty(s,L,{value:o._readableState.endEmitted,writable:!0}),_defineProperty(s,$,{value:function value(o,s){var u=i[V].read();u?(i[B]=null,i[x]=null,i[C]=null,o(createIterResult(u,!1))):(i[x]=o,i[C]=s)},writable:!0}),s));return i[B]=null,w(o,(function(o){if(o&&\"ERR_STREAM_PREMATURE_CLOSE\"!==o.code){var s=i[C];return null!==s&&(i[B]=null,i[x]=null,i[C]=null,s(o)),void(i[j]=o)}var u=i[x];null!==u&&(i[B]=null,i[x]=null,i[C]=null,u(createIterResult(void 0,!0))),i[L]=!0})),o.on(\"readable\",onReadable.bind(null,i)),i}},80345:(o,s,i)=>{\"use strict\";function ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(i),!0).forEach((function(s){_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}function _defineProperty(o,s,i){return(s=_toPropertyKey(s))in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}function _defineProperties(o,s){for(var i=0;i<s.length;i++){var u=s[i];u.enumerable=u.enumerable||!1,u.configurable=!0,\"value\"in u&&(u.writable=!0),Object.defineProperty(o,_toPropertyKey(u.key),u)}}function _toPropertyKey(o){var s=function _toPrimitive(o,s){if(\"object\"!=typeof o||null===o)return o;var i=o[Symbol.toPrimitive];if(void 0!==i){var u=i.call(o,s||\"default\");if(\"object\"!=typeof u)return u;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===s?String:Number)(o)}(o,\"string\");return\"symbol\"==typeof s?s:String(s)}var u=i(48287).Buffer,_=i(15340).inspect,w=_&&_.custom||\"inspect\";o.exports=function(){function BufferList(){!function _classCallCheck(o,s){if(!(o instanceof s))throw new TypeError(\"Cannot call a class as a function\")}(this,BufferList),this.head=null,this.tail=null,this.length=0}return function _createClass(o,s,i){return s&&_defineProperties(o.prototype,s),i&&_defineProperties(o,i),Object.defineProperty(o,\"prototype\",{writable:!1}),o}(BufferList,[{key:\"push\",value:function push(o){var s={data:o,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length}},{key:\"unshift\",value:function unshift(o){var s={data:o,next:this.head};0===this.length&&(this.tail=s),this.head=s,++this.length}},{key:\"shift\",value:function shift(){if(0!==this.length){var o=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,o}}},{key:\"clear\",value:function clear(){this.head=this.tail=null,this.length=0}},{key:\"join\",value:function join(o){if(0===this.length)return\"\";for(var s=this.head,i=\"\"+s.data;s=s.next;)i+=o+s.data;return i}},{key:\"concat\",value:function concat(o){if(0===this.length)return u.alloc(0);for(var s,i,_,w=u.allocUnsafe(o>>>0),x=this.head,C=0;x;)s=x.data,i=w,_=C,u.prototype.copy.call(s,i,_),C+=x.data.length,x=x.next;return w}},{key:\"consume\",value:function consume(o,s){var i;return o<this.head.data.length?(i=this.head.data.slice(0,o),this.head.data=this.head.data.slice(o)):i=o===this.head.data.length?this.shift():s?this._getString(o):this._getBuffer(o),i}},{key:\"first\",value:function first(){return this.head.data}},{key:\"_getString\",value:function _getString(o){var s=this.head,i=1,u=s.data;for(o-=u.length;s=s.next;){var _=s.data,w=o>_.length?_.length:o;if(w===_.length?u+=_:u+=_.slice(0,o),0===(o-=w)){w===_.length?(++i,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=_.slice(w));break}++i}return this.length-=i,u}},{key:\"_getBuffer\",value:function _getBuffer(o){var s=u.allocUnsafe(o),i=this.head,_=1;for(i.data.copy(s),o-=i.data.length;i=i.next;){var w=i.data,x=o>w.length?w.length:o;if(w.copy(s,s.length-o,0,x),0===(o-=x)){x===w.length?(++_,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=w.slice(x));break}++_}return this.length-=_,s}},{key:w,value:function value(o,s){return _(this,_objectSpread(_objectSpread({},s),{},{depth:0,customInspect:!1}))}}]),BufferList}()},75896:(o,s,i)=>{\"use strict\";var u=i(65606);function emitErrorAndCloseNT(o,s){emitErrorNT(o,s),emitCloseNT(o)}function emitCloseNT(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit(\"close\")}function emitErrorNT(o,s){o.emit(\"error\",s)}o.exports={destroy:function destroy(o,s){var i=this,_=this._readableState&&this._readableState.destroyed,w=this._writableState&&this._writableState.destroyed;return _||w?(s?s(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u.nextTick(emitErrorNT,this,o)):u.nextTick(emitErrorNT,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,(function(o){!s&&o?i._writableState?i._writableState.errorEmitted?u.nextTick(emitCloseNT,i):(i._writableState.errorEmitted=!0,u.nextTick(emitErrorAndCloseNT,i,o)):u.nextTick(emitErrorAndCloseNT,i,o):s?(u.nextTick(emitCloseNT,i),s(o)):u.nextTick(emitCloseNT,i)})),this)},undestroy:function undestroy(){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)},errorOrDestroy:function errorOrDestroy(o,s){var i=o._readableState,u=o._writableState;i&&i.autoDestroy||u&&u.autoDestroy?o.destroy(s):o.emit(\"error\",s)}}},86238:(o,s,i)=>{\"use strict\";var u=i(86048).F.ERR_STREAM_PREMATURE_CLOSE;function noop(){}o.exports=function eos(o,s,i){if(\"function\"==typeof s)return eos(o,null,s);s||(s={}),i=function once(o){var s=!1;return function(){if(!s){s=!0;for(var i=arguments.length,u=new Array(i),_=0;_<i;_++)u[_]=arguments[_];o.apply(this,u)}}}(i||noop);var _=s.readable||!1!==s.readable&&o.readable,w=s.writable||!1!==s.writable&&o.writable,x=function onlegacyfinish(){o.writable||j()},C=o._writableState&&o._writableState.finished,j=function onfinish(){w=!1,C=!0,_||i.call(o)},L=o._readableState&&o._readableState.endEmitted,B=function onend(){_=!1,L=!0,w||i.call(o)},$=function onerror(s){i.call(o,s)},V=function onclose(){var s;return _&&!L?(o._readableState&&o._readableState.ended||(s=new u),i.call(o,s)):w&&!C?(o._writableState&&o._writableState.ended||(s=new u),i.call(o,s)):void 0},U=function onrequest(){o.req.on(\"finish\",j)};return!function isRequest(o){return o.setHeader&&\"function\"==typeof o.abort}(o)?w&&!o._writableState&&(o.on(\"end\",x),o.on(\"close\",x)):(o.on(\"complete\",j),o.on(\"abort\",V),o.req?U():o.on(\"request\",U)),o.on(\"end\",B),o.on(\"finish\",j),!1!==s.error&&o.on(\"error\",$),o.on(\"close\",V),function(){o.removeListener(\"complete\",j),o.removeListener(\"abort\",V),o.removeListener(\"request\",U),o.req&&o.req.removeListener(\"finish\",j),o.removeListener(\"end\",x),o.removeListener(\"close\",x),o.removeListener(\"finish\",j),o.removeListener(\"end\",B),o.removeListener(\"error\",$),o.removeListener(\"close\",V)}}},55157:o=>{o.exports=function(){throw new Error(\"Readable.from is not available in the browser\")}},57758:(o,s,i)=>{\"use strict\";var u;var _=i(86048).F,w=_.ERR_MISSING_ARGS,x=_.ERR_STREAM_DESTROYED;function noop(o){if(o)throw o}function call(o){o()}function pipe(o,s){return o.pipe(s)}o.exports=function pipeline(){for(var o=arguments.length,s=new Array(o),_=0;_<o;_++)s[_]=arguments[_];var C,j=function popCallback(o){return o.length?\"function\"!=typeof o[o.length-1]?noop:o.pop():noop}(s);if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new w(\"streams\");var L=s.map((function(o,_){var w=_<s.length-1;return function destroyer(o,s,_,w){w=function once(o){var s=!1;return function(){s||(s=!0,o.apply(void 0,arguments))}}(w);var C=!1;o.on(\"close\",(function(){C=!0})),void 0===u&&(u=i(86238)),u(o,{readable:s,writable:_},(function(o){if(o)return w(o);C=!0,w()}));var j=!1;return function(s){if(!C&&!j)return j=!0,function isRequest(o){return o.setHeader&&\"function\"==typeof o.abort}(o)?o.abort():\"function\"==typeof o.destroy?o.destroy():void w(s||new x(\"pipe\"))}}(o,w,_>0,(function(o){C||(C=o),o&&L.forEach(call),w||(L.forEach(call),j(C))}))}));return s.reduce(pipe)}},65291:(o,s,i)=>{\"use strict\";var u=i(86048).F.ERR_INVALID_OPT_VALUE;o.exports={getHighWaterMark:function getHighWaterMark(o,s,i,_){var w=function highWaterMarkFrom(o,s,i){return null!=o.highWaterMark?o.highWaterMark:s?o[i]:null}(s,_,i);if(null!=w){if(!isFinite(w)||Math.floor(w)!==w||w<0)throw new u(_?i:\"highWaterMark\",w);return Math.floor(w)}return o.objectMode?16:16384}}},40345:(o,s,i)=>{o.exports=i(37007).EventEmitter},84977:(o,s,i)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0});var u=function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}(i(9404)),_=i(55674);s.default=function(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Map,i=Object.keys(o);return function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s(),w=arguments[1];return u.withMutations((function(s){i.forEach((function(i){var u=(0,o[i])(s.get(i),w);(0,_.validateNextState)(u,i,w),s.set(i,u)}))}))}},o.exports=s.default},89593:(o,s,i)=>{\"use strict\";s.H=void 0;var u=function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}(i(84977));s.H=u.default},48590:(o,s)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0}),s.default=function(o){return o&&\"@@redux/INIT\"===o.type?\"initialState argument passed to createStore\":\"previous state received by the reducer\"},o.exports=s.default},82261:(o,s,i)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0});var u=_interopRequireDefault(i(9404)),_=_interopRequireDefault(i(48590));function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}s.default=function(o,s,i){var w=Object.keys(s);if(!w.length)return\"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";var x=(0,_.default)(i);if(u.default.isImmutable?!u.default.isImmutable(o):!u.default.Iterable.isIterable(o))return\"The \"+x+' is of unexpected type. Expected argument to be an instance of Immutable.Collection or Immutable.Record with the following properties: \"'+w.join('\", \"')+'\".';var C=o.toSeq().keySeq().toArray().filter((function(o){return!s.hasOwnProperty(o)}));return C.length>0?\"Unexpected \"+(1===C.length?\"property\":\"properties\")+' \"'+C.join('\", \"')+'\" found in '+x+'. Expected to find one of the known reducer property names instead: \"'+w.join('\", \"')+'\". Unexpected properties will be ignored.':null},o.exports=s.default},55674:(o,s,i)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0}),s.validateNextState=s.getUnexpectedInvocationParameterMessage=s.getStateName=void 0;var u=_interopRequireDefault(i(48590)),_=_interopRequireDefault(i(82261)),w=_interopRequireDefault(i(27374));function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}s.getStateName=u.default,s.getUnexpectedInvocationParameterMessage=_.default,s.validateNextState=w.default},27374:(o,s)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0}),s.default=function(o,s,i){if(void 0===o)throw new Error('Reducer \"'+s+'\" returned undefined when handling \"'+i.type+'\" action. To ignore an action, you must explicitly return the previous state.')},o.exports=s.default},75208:o=>{\"use strict\";var s,i=\"\";o.exports=function repeat(o,u){if(\"string\"!=typeof o)throw new TypeError(\"expected a string\");if(1===u)return o;if(2===u)return o+o;var _=o.length*u;if(s!==o||void 0===s)s=o,i=\"\";else if(i.length>=_)return i.substr(0,_);for(;_>i.length&&u>1;)1&u&&(i+=o),u>>=1,o+=o;return i=(i+=o).substr(0,_)}},92063:o=>{\"use strict\";o.exports=function required(o,s){if(s=s.split(\":\")[0],!(o=+o))return!1;switch(s){case\"http\":case\"ws\":return 80!==o;case\"https\":case\"wss\":return 443!==o;case\"ftp\":return 21!==o;case\"gopher\":return 70!==o;case\"file\":return!1}return 0!==o}},27096:(o,s,i)=>{const u=i(87586),_=i(6205),w=i(10023),x=i(8048);o.exports=o=>{var s,i,C=0,j={type:_.ROOT,stack:[]},L=j,B=j.stack,$=[],repeatErr=s=>{u.error(o,\"Nothing to repeat at column \"+(s-1))},V=u.strToChars(o);for(s=V.length;C<s;)switch(i=V[C++]){case\"\\\\\":switch(i=V[C++]){case\"b\":B.push(x.wordBoundary());break;case\"B\":B.push(x.nonWordBoundary());break;case\"w\":B.push(w.words());break;case\"W\":B.push(w.notWords());break;case\"d\":B.push(w.ints());break;case\"D\":B.push(w.notInts());break;case\"s\":B.push(w.whitespace());break;case\"S\":B.push(w.notWhitespace());break;default:/\\d/.test(i)?B.push({type:_.REFERENCE,value:parseInt(i,10)}):B.push({type:_.CHAR,value:i.charCodeAt(0)})}break;case\"^\":B.push(x.begin());break;case\"$\":B.push(x.end());break;case\"[\":var U;\"^\"===V[C]?(U=!0,C++):U=!1;var z=u.tokenizeClass(V.slice(C),o);C+=z[1],B.push({type:_.SET,set:z[0],not:U});break;case\".\":B.push(w.anyChar());break;case\"(\":var Y={type:_.GROUP,stack:[],remember:!0};\"?\"===(i=V[C])&&(i=V[C+1],C+=2,\"=\"===i?Y.followedBy=!0:\"!\"===i?Y.notFollowedBy=!0:\":\"!==i&&u.error(o,`Invalid group, character '${i}' after '?' at column `+(C-1)),Y.remember=!1),B.push(Y),$.push(L),L=Y,B=Y.stack;break;case\")\":0===$.length&&u.error(o,\"Unmatched ) at column \"+(C-1)),B=(L=$.pop()).options?L.options[L.options.length-1]:L.stack;break;case\"|\":L.options||(L.options=[L.stack],delete L.stack);var Z=[];L.options.push(Z),B=Z;break;case\"{\":var ee,ie,ae=/^(\\d+)(,(\\d+)?)?\\}/.exec(V.slice(C));null!==ae?(0===B.length&&repeatErr(C),ee=parseInt(ae[1],10),ie=ae[2]?ae[3]?parseInt(ae[3],10):1/0:ee,C+=ae[0].length,B.push({type:_.REPETITION,min:ee,max:ie,value:B.pop()})):B.push({type:_.CHAR,value:123});break;case\"?\":0===B.length&&repeatErr(C),B.push({type:_.REPETITION,min:0,max:1,value:B.pop()});break;case\"+\":0===B.length&&repeatErr(C),B.push({type:_.REPETITION,min:1,max:1/0,value:B.pop()});break;case\"*\":0===B.length&&repeatErr(C),B.push({type:_.REPETITION,min:0,max:1/0,value:B.pop()});break;default:B.push({type:_.CHAR,value:i.charCodeAt(0)})}return 0!==$.length&&u.error(o,\"Unterminated group\"),j},o.exports.types=_},8048:(o,s,i)=>{const u=i(6205);s.wordBoundary=()=>({type:u.POSITION,value:\"b\"}),s.nonWordBoundary=()=>({type:u.POSITION,value:\"B\"}),s.begin=()=>({type:u.POSITION,value:\"^\"}),s.end=()=>({type:u.POSITION,value:\"$\"})},10023:(o,s,i)=>{const u=i(6205),INTS=()=>[{type:u.RANGE,from:48,to:57}],WORDS=()=>[{type:u.CHAR,value:95},{type:u.RANGE,from:97,to:122},{type:u.RANGE,from:65,to:90}].concat(INTS()),WHITESPACE=()=>[{type:u.CHAR,value:9},{type:u.CHAR,value:10},{type:u.CHAR,value:11},{type:u.CHAR,value:12},{type:u.CHAR,value:13},{type:u.CHAR,value:32},{type:u.CHAR,value:160},{type:u.CHAR,value:5760},{type:u.RANGE,from:8192,to:8202},{type:u.CHAR,value:8232},{type:u.CHAR,value:8233},{type:u.CHAR,value:8239},{type:u.CHAR,value:8287},{type:u.CHAR,value:12288},{type:u.CHAR,value:65279}];s.words=()=>({type:u.SET,set:WORDS(),not:!1}),s.notWords=()=>({type:u.SET,set:WORDS(),not:!0}),s.ints=()=>({type:u.SET,set:INTS(),not:!1}),s.notInts=()=>({type:u.SET,set:INTS(),not:!0}),s.whitespace=()=>({type:u.SET,set:WHITESPACE(),not:!1}),s.notWhitespace=()=>({type:u.SET,set:WHITESPACE(),not:!0}),s.anyChar=()=>({type:u.SET,set:[{type:u.CHAR,value:10},{type:u.CHAR,value:13},{type:u.CHAR,value:8232},{type:u.CHAR,value:8233}],not:!0})},6205:o=>{o.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}},87586:(o,s,i)=>{const u=i(6205),_=i(10023),w={0:0,t:9,n:10,v:11,f:12,r:13};s.strToChars=function(o){return o=o.replace(/(\\[\\\\b\\])|(\\\\)?\\\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\\\\]^?])|([0tnvfr]))/g,(function(o,s,i,u,_,x,C,j){if(i)return o;var L=s?8:u?parseInt(u,16):_?parseInt(_,16):x?parseInt(x,8):C?\"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^ ?\".indexOf(C):w[j],B=String.fromCharCode(L);return/[[\\]{}^$.|?*+()]/.test(B)&&(B=\"\\\\\"+B),B}))},s.tokenizeClass=(o,i)=>{for(var w,x,C=[],j=/\\\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\\\)(.)|([^\\]\\\\]))-(?:\\\\)?([^\\]]))|(\\])|(?:\\\\)?([^])/g;null!=(w=j.exec(o));)if(w[1])C.push(_.words());else if(w[2])C.push(_.ints());else if(w[3])C.push(_.whitespace());else if(w[4])C.push(_.notWords());else if(w[5])C.push(_.notInts());else if(w[6])C.push(_.notWhitespace());else if(w[7])C.push({type:u.RANGE,from:(w[8]||w[9]).charCodeAt(0),to:w[10].charCodeAt(0)});else{if(!(x=w[12]))return[C,j.lastIndex];C.push({type:u.CHAR,value:x.charCodeAt(0)})}s.error(i,\"Unterminated character class\")},s.error=(o,s)=>{throw new SyntaxError(\"Invalid regular expression: /\"+o+\"/: \"+s)}},92861:(o,s,i)=>{var u=i(48287),_=u.Buffer;function copyProps(o,s){for(var i in o)s[i]=o[i]}function SafeBuffer(o,s,i){return _(o,s,i)}_.from&&_.alloc&&_.allocUnsafe&&_.allocUnsafeSlow?o.exports=u:(copyProps(u,s),s.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(_.prototype),copyProps(_,SafeBuffer),SafeBuffer.from=function(o,s,i){if(\"number\"==typeof o)throw new TypeError(\"Argument must not be a number\");return _(o,s,i)},SafeBuffer.alloc=function(o,s,i){if(\"number\"!=typeof o)throw new TypeError(\"Argument must be a number\");var u=_(o);return void 0!==s?\"string\"==typeof i?u.fill(s,i):u.fill(s):u.fill(0),u},SafeBuffer.allocUnsafe=function(o){if(\"number\"!=typeof o)throw new TypeError(\"Argument must be a number\");return _(o)},SafeBuffer.allocUnsafeSlow=function(o){if(\"number\"!=typeof o)throw new TypeError(\"Argument must be a number\");return u.SlowBuffer(o)}},29844:(o,s)=>{\"use strict\";function f(o,s){var i=o.length;o.push(s);e:for(;0<i;){var u=i-1>>>1,_=o[u];if(!(0<g(_,s)))break e;o[u]=s,o[i]=_,i=u}}function h(o){return 0===o.length?null:o[0]}function k(o){if(0===o.length)return null;var s=o[0],i=o.pop();if(i!==s){o[0]=i;e:for(var u=0,_=o.length,w=_>>>1;u<w;){var x=2*(u+1)-1,C=o[x],j=x+1,L=o[j];if(0>g(C,i))j<_&&0>g(L,C)?(o[u]=L,o[j]=i,u=j):(o[u]=C,o[x]=i,u=x);else{if(!(j<_&&0>g(L,i)))break e;o[u]=L,o[j]=i,u=j}}}return s}function g(o,s){var i=o.sortIndex-s.sortIndex;return 0!==i?i:o.id-s.id}if(\"object\"==typeof performance&&\"function\"==typeof performance.now){var i=performance;s.unstable_now=function(){return i.now()}}else{var u=Date,_=u.now();s.unstable_now=function(){return u.now()-_}}var w=[],x=[],C=1,j=null,L=3,B=!1,$=!1,V=!1,U=\"function\"==typeof setTimeout?setTimeout:null,z=\"function\"==typeof clearTimeout?clearTimeout:null,Y=\"undefined\"!=typeof setImmediate?setImmediate:null;function G(o){for(var s=h(x);null!==s;){if(null===s.callback)k(x);else{if(!(s.startTime<=o))break;k(x),s.sortIndex=s.expirationTime,f(w,s)}s=h(x)}}function H(o){if(V=!1,G(o),!$)if(null!==h(w))$=!0,I(J);else{var s=h(x);null!==s&&K(H,s.startTime-o)}}function J(o,i){$=!1,V&&(V=!1,z(ae),ae=-1),B=!0;var u=L;try{for(G(i),j=h(w);null!==j&&(!(j.expirationTime>i)||o&&!M());){var _=j.callback;if(\"function\"==typeof _){j.callback=null,L=j.priorityLevel;var C=_(j.expirationTime<=i);i=s.unstable_now(),\"function\"==typeof C?j.callback=C:j===h(w)&&k(w),G(i)}else k(w);j=h(w)}if(null!==j)var U=!0;else{var Y=h(x);null!==Y&&K(H,Y.startTime-i),U=!1}return U}finally{j=null,L=u,B=!1}}\"undefined\"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var Z,ee=!1,ie=null,ae=-1,ce=5,le=-1;function M(){return!(s.unstable_now()-le<ce)}function R(){if(null!==ie){var o=s.unstable_now();le=o;var i=!0;try{i=ie(!0,o)}finally{i?Z():(ee=!1,ie=null)}}else ee=!1}if(\"function\"==typeof Y)Z=function(){Y(R)};else if(\"undefined\"!=typeof MessageChannel){var pe=new MessageChannel,de=pe.port2;pe.port1.onmessage=R,Z=function(){de.postMessage(null)}}else Z=function(){U(R,0)};function I(o){ie=o,ee||(ee=!0,Z())}function K(o,i){ae=U((function(){o(s.unstable_now())}),i)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(o){o.callback=null},s.unstable_continueExecution=function(){$||B||($=!0,I(J))},s.unstable_forceFrameRate=function(o){0>o||125<o?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):ce=0<o?Math.floor(1e3/o):5},s.unstable_getCurrentPriorityLevel=function(){return L},s.unstable_getFirstCallbackNode=function(){return h(w)},s.unstable_next=function(o){switch(L){case 1:case 2:case 3:var s=3;break;default:s=L}var i=L;L=s;try{return o()}finally{L=i}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(o,s){switch(o){case 1:case 2:case 3:case 4:case 5:break;default:o=3}var i=L;L=o;try{return s()}finally{L=i}},s.unstable_scheduleCallback=function(o,i,u){var _=s.unstable_now();switch(\"object\"==typeof u&&null!==u?u=\"number\"==typeof(u=u.delay)&&0<u?_+u:_:u=_,o){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return o={id:C++,callback:i,priorityLevel:o,startTime:u,expirationTime:j=u+j,sortIndex:-1},u>_?(o.sortIndex=u,f(x,o),null===h(w)&&o===h(x)&&(V?(z(ae),ae=-1):V=!0,K(H,u-_))):(o.sortIndex=j,f(w,o),$||B||($=!0,I(J))),o},s.unstable_shouldYield=M,s.unstable_wrapCallback=function(o){var s=L;return function(){var i=L;L=s;try{return o.apply(this,arguments)}finally{L=i}}}},69982:(o,s,i)=>{\"use strict\";o.exports=i(29844)},20334:(o,s,i)=>{\"use strict\";var u=i(48287).Buffer;class NonError extends Error{constructor(o){super(NonError._prepareSuperMessage(o)),Object.defineProperty(this,\"name\",{value:\"NonError\",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,NonError)}static _prepareSuperMessage(o){try{return JSON.stringify(o)}catch{return String(o)}}}const _=[{property:\"name\",enumerable:!1},{property:\"message\",enumerable:!1},{property:\"stack\",enumerable:!1},{property:\"code\",enumerable:!0}],w=Symbol(\".toJSON called\"),destroyCircular=({from:o,seen:s,to_:i,forceEnumerable:x,maxDepth:C,depth:j})=>{const L=i||(Array.isArray(o)?[]:{});if(s.push(o),j>=C)return L;if(\"function\"==typeof o.toJSON&&!0!==o[w])return(o=>{o[w]=!0;const s=o.toJSON();return delete o[w],s})(o);for(const[i,_]of Object.entries(o))\"function\"==typeof u&&u.isBuffer(_)?L[i]=\"[object Buffer]\":\"function\"!=typeof _&&(_&&\"object\"==typeof _?s.includes(o[i])?L[i]=\"[Circular]\":(j++,L[i]=destroyCircular({from:o[i],seen:s.slice(),forceEnumerable:x,maxDepth:C,depth:j})):L[i]=_);for(const{property:s,enumerable:i}of _)\"string\"==typeof o[s]&&Object.defineProperty(L,s,{value:o[s],enumerable:!!x||i,configurable:!0,writable:!0});return L};o.exports={serializeError:(o,s={})=>{const{maxDepth:i=Number.POSITIVE_INFINITY}=s;return\"object\"==typeof o&&null!==o?destroyCircular({from:o,seen:[],forceEnumerable:!0,maxDepth:i,depth:0}):\"function\"==typeof o?`[Function: ${o.name||\"anonymous\"}]`:o},deserializeError:(o,s={})=>{const{maxDepth:i=Number.POSITIVE_INFINITY}=s;if(o instanceof Error)return o;if(\"object\"==typeof o&&null!==o&&!Array.isArray(o)){const s=new Error;return destroyCircular({from:o,seen:[],to_:s,maxDepth:i,depth:0}),s}return new NonError(o)}}},96897:(o,s,i)=>{\"use strict\";var u=i(70453),_=i(30041),w=i(30592)(),x=i(75795),C=i(69675),j=u(\"%Math.floor%\");o.exports=function setFunctionLength(o,s){if(\"function\"!=typeof o)throw new C(\"`fn` is not a function\");if(\"number\"!=typeof s||s<0||s>4294967295||j(s)!==s)throw new C(\"`length` must be a positive 32-bit integer\");var i=arguments.length>2&&!!arguments[2],u=!0,L=!0;if(\"length\"in o&&x){var B=x(o,\"length\");B&&!B.configurable&&(u=!1),B&&!B.writable&&(L=!1)}return(u||L||!i)&&(w?_(o,\"length\",s,!0,!0):_(o,\"length\",s)),o}},90392:(o,s,i)=>{var u=i(92861).Buffer;function Hash(o,s){this._block=u.alloc(o),this._finalSize=s,this._blockSize=o,this._len=0}Hash.prototype.update=function(o,s){\"string\"==typeof o&&(s=s||\"utf8\",o=u.from(o,s));for(var i=this._block,_=this._blockSize,w=o.length,x=this._len,C=0;C<w;){for(var j=x%_,L=Math.min(w-C,_-j),B=0;B<L;B++)i[j+B]=o[C+B];C+=L,(x+=L)%_==0&&this._update(i)}return this._len+=w,this},Hash.prototype.digest=function(o){var s=this._len%this._blockSize;this._block[s]=128,this._block.fill(0,s+1),s>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var u=(4294967295&i)>>>0,_=(i-u)/4294967296;this._block.writeUInt32BE(_,this._blockSize-8),this._block.writeUInt32BE(u,this._blockSize-4)}this._update(this._block);var w=this._hash();return o?w.toString(o):w},Hash.prototype._update=function(){throw new Error(\"_update must be implemented by subclass\")},o.exports=Hash},62802:(o,s,i)=>{var u=o.exports=function SHA(o){o=o.toLowerCase();var s=u[o];if(!s)throw new Error(o+\" is not supported (we accept pull requests)\");return new s};u.sha=i(27816),u.sha1=i(63737),u.sha224=i(26710),u.sha256=i(24107),u.sha384=i(32827),u.sha512=i(82890)},27816:(o,s,i)=>{var u=i(56698),_=i(90392),w=i(92861).Buffer,x=[1518500249,1859775393,-1894007588,-899497514],C=new Array(80);function Sha(){this.init(),this._w=C,_.call(this,64,56)}function rotl30(o){return o<<30|o>>>2}function ft(o,s,i,u){return 0===o?s&i|~s&u:2===o?s&i|s&u|i&u:s^i^u}u(Sha,_),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(o){for(var s,i=this._w,u=0|this._a,_=0|this._b,w=0|this._c,C=0|this._d,j=0|this._e,L=0;L<16;++L)i[L]=o.readInt32BE(4*L);for(;L<80;++L)i[L]=i[L-3]^i[L-8]^i[L-14]^i[L-16];for(var B=0;B<80;++B){var $=~~(B/20),V=0|((s=u)<<5|s>>>27)+ft($,_,w,C)+j+i[B]+x[$];j=C,C=w,w=rotl30(_),_=u,u=V}this._a=u+this._a|0,this._b=_+this._b|0,this._c=w+this._c|0,this._d=C+this._d|0,this._e=j+this._e|0},Sha.prototype._hash=function(){var o=w.allocUnsafe(20);return o.writeInt32BE(0|this._a,0),o.writeInt32BE(0|this._b,4),o.writeInt32BE(0|this._c,8),o.writeInt32BE(0|this._d,12),o.writeInt32BE(0|this._e,16),o},o.exports=Sha},63737:(o,s,i)=>{var u=i(56698),_=i(90392),w=i(92861).Buffer,x=[1518500249,1859775393,-1894007588,-899497514],C=new Array(80);function Sha1(){this.init(),this._w=C,_.call(this,64,56)}function rotl5(o){return o<<5|o>>>27}function rotl30(o){return o<<30|o>>>2}function ft(o,s,i,u){return 0===o?s&i|~s&u:2===o?s&i|s&u|i&u:s^i^u}u(Sha1,_),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(o){for(var s,i=this._w,u=0|this._a,_=0|this._b,w=0|this._c,C=0|this._d,j=0|this._e,L=0;L<16;++L)i[L]=o.readInt32BE(4*L);for(;L<80;++L)i[L]=(s=i[L-3]^i[L-8]^i[L-14]^i[L-16])<<1|s>>>31;for(var B=0;B<80;++B){var $=~~(B/20),V=rotl5(u)+ft($,_,w,C)+j+i[B]+x[$]|0;j=C,C=w,w=rotl30(_),_=u,u=V}this._a=u+this._a|0,this._b=_+this._b|0,this._c=w+this._c|0,this._d=C+this._d|0,this._e=j+this._e|0},Sha1.prototype._hash=function(){var o=w.allocUnsafe(20);return o.writeInt32BE(0|this._a,0),o.writeInt32BE(0|this._b,4),o.writeInt32BE(0|this._c,8),o.writeInt32BE(0|this._d,12),o.writeInt32BE(0|this._e,16),o},o.exports=Sha1},26710:(o,s,i)=>{var u=i(56698),_=i(24107),w=i(90392),x=i(92861).Buffer,C=new Array(64);function Sha224(){this.init(),this._w=C,w.call(this,64,56)}u(Sha224,_),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var o=x.allocUnsafe(28);return o.writeInt32BE(this._a,0),o.writeInt32BE(this._b,4),o.writeInt32BE(this._c,8),o.writeInt32BE(this._d,12),o.writeInt32BE(this._e,16),o.writeInt32BE(this._f,20),o.writeInt32BE(this._g,24),o},o.exports=Sha224},24107:(o,s,i)=>{var u=i(56698),_=i(90392),w=i(92861).Buffer,x=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],C=new Array(64);function Sha256(){this.init(),this._w=C,_.call(this,64,56)}function ch(o,s,i){return i^o&(s^i)}function maj(o,s,i){return o&s|i&(o|s)}function sigma0(o){return(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10)}function sigma1(o){return(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7)}function gamma0(o){return(o>>>7|o<<25)^(o>>>18|o<<14)^o>>>3}u(Sha256,_),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(o){for(var s,i=this._w,u=0|this._a,_=0|this._b,w=0|this._c,C=0|this._d,j=0|this._e,L=0|this._f,B=0|this._g,$=0|this._h,V=0;V<16;++V)i[V]=o.readInt32BE(4*V);for(;V<64;++V)i[V]=0|(((s=i[V-2])>>>17|s<<15)^(s>>>19|s<<13)^s>>>10)+i[V-7]+gamma0(i[V-15])+i[V-16];for(var U=0;U<64;++U){var z=$+sigma1(j)+ch(j,L,B)+x[U]+i[U]|0,Y=sigma0(u)+maj(u,_,w)|0;$=B,B=L,L=j,j=C+z|0,C=w,w=_,_=u,u=z+Y|0}this._a=u+this._a|0,this._b=_+this._b|0,this._c=w+this._c|0,this._d=C+this._d|0,this._e=j+this._e|0,this._f=L+this._f|0,this._g=B+this._g|0,this._h=$+this._h|0},Sha256.prototype._hash=function(){var o=w.allocUnsafe(32);return o.writeInt32BE(this._a,0),o.writeInt32BE(this._b,4),o.writeInt32BE(this._c,8),o.writeInt32BE(this._d,12),o.writeInt32BE(this._e,16),o.writeInt32BE(this._f,20),o.writeInt32BE(this._g,24),o.writeInt32BE(this._h,28),o},o.exports=Sha256},32827:(o,s,i)=>{var u=i(56698),_=i(82890),w=i(90392),x=i(92861).Buffer,C=new Array(160);function Sha384(){this.init(),this._w=C,w.call(this,128,112)}u(Sha384,_),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){var o=x.allocUnsafe(48);function writeInt64BE(s,i,u){o.writeInt32BE(s,u),o.writeInt32BE(i,u+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),o},o.exports=Sha384},82890:(o,s,i)=>{var u=i(56698),_=i(90392),w=i(92861).Buffer,x=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],C=new Array(160);function Sha512(){this.init(),this._w=C,_.call(this,128,112)}function Ch(o,s,i){return i^o&(s^i)}function maj(o,s,i){return o&s|i&(o|s)}function sigma0(o,s){return(o>>>28|s<<4)^(s>>>2|o<<30)^(s>>>7|o<<25)}function sigma1(o,s){return(o>>>14|s<<18)^(o>>>18|s<<14)^(s>>>9|o<<23)}function Gamma0(o,s){return(o>>>1|s<<31)^(o>>>8|s<<24)^o>>>7}function Gamma0l(o,s){return(o>>>1|s<<31)^(o>>>8|s<<24)^(o>>>7|s<<25)}function Gamma1(o,s){return(o>>>19|s<<13)^(s>>>29|o<<3)^o>>>6}function Gamma1l(o,s){return(o>>>19|s<<13)^(s>>>29|o<<3)^(o>>>6|s<<26)}function getCarry(o,s){return o>>>0<s>>>0?1:0}u(Sha512,_),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(o){for(var s=this._w,i=0|this._ah,u=0|this._bh,_=0|this._ch,w=0|this._dh,C=0|this._eh,j=0|this._fh,L=0|this._gh,B=0|this._hh,$=0|this._al,V=0|this._bl,U=0|this._cl,z=0|this._dl,Y=0|this._el,Z=0|this._fl,ee=0|this._gl,ie=0|this._hl,ae=0;ae<32;ae+=2)s[ae]=o.readInt32BE(4*ae),s[ae+1]=o.readInt32BE(4*ae+4);for(;ae<160;ae+=2){var ce=s[ae-30],le=s[ae-30+1],pe=Gamma0(ce,le),de=Gamma0l(le,ce),fe=Gamma1(ce=s[ae-4],le=s[ae-4+1]),ye=Gamma1l(le,ce),be=s[ae-14],_e=s[ae-14+1],we=s[ae-32],Se=s[ae-32+1],xe=de+_e|0,Pe=pe+be+getCarry(xe,de)|0;Pe=(Pe=Pe+fe+getCarry(xe=xe+ye|0,ye)|0)+we+getCarry(xe=xe+Se|0,Se)|0,s[ae]=Pe,s[ae+1]=xe}for(var Te=0;Te<160;Te+=2){Pe=s[Te],xe=s[Te+1];var Re=maj(i,u,_),qe=maj($,V,U),$e=sigma0(i,$),ze=sigma0($,i),We=sigma1(C,Y),He=sigma1(Y,C),Ye=x[Te],Xe=x[Te+1],Qe=Ch(C,j,L),et=Ch(Y,Z,ee),tt=ie+He|0,rt=B+We+getCarry(tt,ie)|0;rt=(rt=(rt=rt+Qe+getCarry(tt=tt+et|0,et)|0)+Ye+getCarry(tt=tt+Xe|0,Xe)|0)+Pe+getCarry(tt=tt+xe|0,xe)|0;var nt=ze+qe|0,ot=$e+Re+getCarry(nt,ze)|0;B=L,ie=ee,L=j,ee=Z,j=C,Z=Y,C=w+rt+getCarry(Y=z+tt|0,z)|0,w=_,z=U,_=u,U=V,u=i,V=$,i=rt+ot+getCarry($=tt+nt|0,tt)|0}this._al=this._al+$|0,this._bl=this._bl+V|0,this._cl=this._cl+U|0,this._dl=this._dl+z|0,this._el=this._el+Y|0,this._fl=this._fl+Z|0,this._gl=this._gl+ee|0,this._hl=this._hl+ie|0,this._ah=this._ah+i+getCarry(this._al,$)|0,this._bh=this._bh+u+getCarry(this._bl,V)|0,this._ch=this._ch+_+getCarry(this._cl,U)|0,this._dh=this._dh+w+getCarry(this._dl,z)|0,this._eh=this._eh+C+getCarry(this._el,Y)|0,this._fh=this._fh+j+getCarry(this._fl,Z)|0,this._gh=this._gh+L+getCarry(this._gl,ee)|0,this._hh=this._hh+B+getCarry(this._hl,ie)|0},Sha512.prototype._hash=function(){var o=w.allocUnsafe(64);function writeInt64BE(s,i,u){o.writeInt32BE(s,u),o.writeInt32BE(i,u+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),o},o.exports=Sha512},8068:o=>{\"use strict\";var s=(()=>{var o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,__defNormalProp=(s,i,u)=>i in s?o(s,i,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[i]=u,__spreadValues=(o,s)=>{for(var i in s||(s={}))_.call(s,i)&&__defNormalProp(o,i,s[i]);if(u)for(var i of u(s))w.call(s,i)&&__defNormalProp(o,i,s[i]);return o},__publicField=(o,s,i)=>(__defNormalProp(o,\"symbol\"!=typeof s?s+\"\":s,i),i),x={};((s,i)=>{for(var u in i)o(s,u,{get:i[u],enumerable:!0})})(x,{DEFAULT_OPTIONS:()=>j,DEFAULT_UUID_LENGTH:()=>C,default:()=>$});var C=6,j={dictionary:\"alphanum\",shuffle:!0,debug:!1,length:C,counter:0},L=class _ShortUniqueId{constructor(o={}){__publicField(this,\"counter\"),__publicField(this,\"debug\"),__publicField(this,\"dict\"),__publicField(this,\"version\"),__publicField(this,\"dictIndex\",0),__publicField(this,\"dictRange\",[]),__publicField(this,\"lowerBound\",0),__publicField(this,\"upperBound\",0),__publicField(this,\"dictLength\",0),__publicField(this,\"uuidLength\"),__publicField(this,\"_digit_first_ascii\",48),__publicField(this,\"_digit_last_ascii\",58),__publicField(this,\"_alpha_lower_first_ascii\",97),__publicField(this,\"_alpha_lower_last_ascii\",123),__publicField(this,\"_hex_last_ascii\",103),__publicField(this,\"_alpha_upper_first_ascii\",65),__publicField(this,\"_alpha_upper_last_ascii\",91),__publicField(this,\"_number_dict_ranges\",{digits:[this._digit_first_ascii,this._digit_last_ascii]}),__publicField(this,\"_alpha_dict_ranges\",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),__publicField(this,\"_alpha_lower_dict_ranges\",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),__publicField(this,\"_alpha_upper_dict_ranges\",{upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),__publicField(this,\"_alphanum_dict_ranges\",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),__publicField(this,\"_alphanum_lower_dict_ranges\",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),__publicField(this,\"_alphanum_upper_dict_ranges\",{digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),__publicField(this,\"_hex_dict_ranges\",{decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]}),__publicField(this,\"_dict_ranges\",{_number_dict_ranges:this._number_dict_ranges,_alpha_dict_ranges:this._alpha_dict_ranges,_alpha_lower_dict_ranges:this._alpha_lower_dict_ranges,_alpha_upper_dict_ranges:this._alpha_upper_dict_ranges,_alphanum_dict_ranges:this._alphanum_dict_ranges,_alphanum_lower_dict_ranges:this._alphanum_lower_dict_ranges,_alphanum_upper_dict_ranges:this._alphanum_upper_dict_ranges,_hex_dict_ranges:this._hex_dict_ranges}),__publicField(this,\"log\",((...o)=>{const s=[...o];if(s[0]=`[short-unique-id] ${o[0]}`,!0===this.debug&&\"undefined\"!=typeof console&&null!==console)return console.log(...s)})),__publicField(this,\"_normalizeDictionary\",((o,s)=>{let i;if(o&&Array.isArray(o)&&o.length>1)i=o;else{let s;i=[],this.dictIndex=s=0;const u=`_${o}_dict_ranges`,_=this._dict_ranges[u];Object.keys(_).forEach((o=>{const u=o;for(this.dictRange=_[u],this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1],this.dictIndex=s=this.lowerBound;this.lowerBound<=this.upperBound?s<this.upperBound:s>this.upperBound;this.dictIndex=this.lowerBound<=this.upperBound?s+=1:s-=1)i.push(String.fromCharCode(this.dictIndex))}))}if(s){const o=.5;i=i.sort((()=>Math.random()-o))}return i})),__publicField(this,\"setDictionary\",((o,s)=>{this.dict=this._normalizeDictionary(o,s),this.dictLength=this.dict.length,this.setCounter(0)})),__publicField(this,\"seq\",(()=>this.sequentialUUID())),__publicField(this,\"sequentialUUID\",(()=>{let o,s,i=\"\";o=this.counter;do{s=o%this.dictLength,o=Math.trunc(o/this.dictLength),i+=this.dict[s]}while(0!==o);return this.counter+=1,i})),__publicField(this,\"rnd\",((o=this.uuidLength||C)=>this.randomUUID(o))),__publicField(this,\"randomUUID\",((o=this.uuidLength||C)=>{let s,i,u;if(null==o||o<1)throw new Error(\"Invalid UUID Length Provided\");for(s=\"\",u=0;u<o;u+=1)i=parseInt((Math.random()*this.dictLength).toFixed(0),10)%this.dictLength,s+=this.dict[i];return s})),__publicField(this,\"fmt\",((o,s)=>this.formattedUUID(o,s))),__publicField(this,\"formattedUUID\",((o,s)=>{const i={$r:this.randomUUID,$s:this.sequentialUUID,$t:this.stamp};return o.replace(/\\$[rs]\\d{0,}|\\$t0|\\$t[1-9]\\d{1,}/g,(o=>{const u=o.slice(0,2),_=parseInt(o.slice(2),10);return\"$s\"===u?i[u]().padStart(_,\"0\"):\"$t\"===u&&s?i[u](_,s):i[u](_)}))})),__publicField(this,\"availableUUIDs\",((o=this.uuidLength)=>parseFloat(Math.pow([...new Set(this.dict)].length,o).toFixed(0)))),__publicField(this,\"approxMaxBeforeCollision\",((o=this.availableUUIDs(this.uuidLength))=>parseFloat(Math.sqrt(Math.PI/2*o).toFixed(20)))),__publicField(this,\"collisionProbability\",((o=this.availableUUIDs(this.uuidLength),s=this.uuidLength)=>parseFloat((this.approxMaxBeforeCollision(o)/this.availableUUIDs(s)).toFixed(20)))),__publicField(this,\"uniqueness\",((o=this.availableUUIDs(this.uuidLength))=>{const s=parseFloat((1-this.approxMaxBeforeCollision(o)/o).toFixed(20));return s>1?1:s<0?0:s})),__publicField(this,\"getVersion\",(()=>this.version)),__publicField(this,\"stamp\",((o,s)=>{const i=Math.floor(+(s||new Date)/1e3).toString(16);if(\"number\"==typeof o&&0===o)return i;if(\"number\"!=typeof o||o<10)throw new Error([\"Param finalLength must be a number greater than or equal to 10,\",\"or 0 if you want the raw hexadecimal timestamp\"].join(\"\\n\"));const u=o-9,_=Math.round(Math.random()*(u>15?15:u)),w=this.randomUUID(u);return`${w.substring(0,_)}${i}${w.substring(_)}${_.toString(16)}`})),__publicField(this,\"parseStamp\",((o,s)=>{if(s&&!/t0|t[1-9]\\d{1,}/.test(s))throw new Error(\"Cannot extract date from a formated UUID with no timestamp in the format\");const i=s?s.replace(/\\$[rs]\\d{0,}|\\$t0|\\$t[1-9]\\d{1,}/g,(o=>{const s={$r:o=>[...Array(o)].map((()=>\"r\")).join(\"\"),$s:o=>[...Array(o)].map((()=>\"s\")).join(\"\"),$t:o=>[...Array(o)].map((()=>\"t\")).join(\"\")},i=o.slice(0,2),u=parseInt(o.slice(2),10);return s[i](u)})).replace(/^(.*?)(t{8,})(.*)$/g,((s,i,u)=>o.substring(i.length,i.length+u.length))):o;if(8===i.length)return new Date(1e3*parseInt(i,16));if(i.length<10)throw new Error(\"Stamp length invalid\");const u=parseInt(i.substring(i.length-1),16);return new Date(1e3*parseInt(i.substring(u,u+8),16))})),__publicField(this,\"setCounter\",(o=>{this.counter=o})),__publicField(this,\"validate\",((o,s)=>{const i=s?this._normalizeDictionary(s):this.dict;return o.split(\"\").every((o=>i.includes(o)))}));const s=__spreadValues(__spreadValues({},j),o);this.counter=0,this.debug=!1,this.dict=[],this.version=\"5.2.0\";const{dictionary:i,shuffle:u,length:_,counter:w}=s;return this.uuidLength=_,this.setDictionary(i,u),this.setCounter(w),this.debug=s.debug,this.log(this.dict),this.log(`Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this),this}};__publicField(L,\"default\",L);var B,$=L;return B=x,((u,w,x,C)=>{if(w&&\"object\"==typeof w||\"function\"==typeof w)for(let j of i(w))_.call(u,j)||j===x||o(u,j,{get:()=>w[j],enumerable:!(C=s(w,j))||C.enumerable});return u})(o({},\"__esModule\",{value:!0}),B)})();o.exports=s.default,\"undefined\"!=typeof window&&(s=s.default)},920:(o,s,i)=>{\"use strict\";var u=i(70453),_=i(38075),w=i(58859),x=i(69675),C=u(\"%WeakMap%\",!0),j=u(\"%Map%\",!0),L=_(\"WeakMap.prototype.get\",!0),B=_(\"WeakMap.prototype.set\",!0),$=_(\"WeakMap.prototype.has\",!0),V=_(\"Map.prototype.get\",!0),U=_(\"Map.prototype.set\",!0),z=_(\"Map.prototype.has\",!0),listGetNode=function(o,s){for(var i,u=o;null!==(i=u.next);u=i)if(i.key===s)return u.next=i.next,i.next=o.next,o.next=i,i};o.exports=function getSideChannel(){var o,s,i,u={assert:function(o){if(!u.has(o))throw new x(\"Side channel does not contain \"+w(o))},get:function(u){if(C&&u&&(\"object\"==typeof u||\"function\"==typeof u)){if(o)return L(o,u)}else if(j){if(s)return V(s,u)}else if(i)return function(o,s){var i=listGetNode(o,s);return i&&i.value}(i,u)},has:function(u){if(C&&u&&(\"object\"==typeof u||\"function\"==typeof u)){if(o)return $(o,u)}else if(j){if(s)return z(s,u)}else if(i)return function(o,s){return!!listGetNode(o,s)}(i,u);return!1},set:function(u,_){C&&u&&(\"object\"==typeof u||\"function\"==typeof u)?(o||(o=new C),B(o,u,_)):j?(s||(s=new j),U(s,u,_)):(i||(i={key:{},next:null}),function(o,s,i){var u=listGetNode(o,s);u?u.value=i:o.next={key:s,next:o.next,value:i}}(i,u,_))}};return u}},88310:(o,s,i)=>{o.exports=Stream;var u=i(37007).EventEmitter;function Stream(){u.call(this)}i(56698)(Stream,u),Stream.Readable=i(45412),Stream.Writable=i(16708),Stream.Duplex=i(25382),Stream.Transform=i(74610),Stream.PassThrough=i(63600),Stream.finished=i(86238),Stream.pipeline=i(57758),Stream.Stream=Stream,Stream.prototype.pipe=function(o,s){var i=this;function ondata(s){o.writable&&!1===o.write(s)&&i.pause&&i.pause()}function ondrain(){i.readable&&i.resume&&i.resume()}i.on(\"data\",ondata),o.on(\"drain\",ondrain),o._isStdio||s&&!1===s.end||(i.on(\"end\",onend),i.on(\"close\",onclose));var _=!1;function onend(){_||(_=!0,o.end())}function onclose(){_||(_=!0,\"function\"==typeof o.destroy&&o.destroy())}function onerror(o){if(cleanup(),0===u.listenerCount(this,\"error\"))throw o}function cleanup(){i.removeListener(\"data\",ondata),o.removeListener(\"drain\",ondrain),i.removeListener(\"end\",onend),i.removeListener(\"close\",onclose),i.removeListener(\"error\",onerror),o.removeListener(\"error\",onerror),i.removeListener(\"end\",cleanup),i.removeListener(\"close\",cleanup),o.removeListener(\"close\",cleanup)}return i.on(\"error\",onerror),o.on(\"error\",onerror),i.on(\"end\",cleanup),i.on(\"close\",cleanup),o.on(\"close\",cleanup),o.emit(\"pipe\",i),o}},83141:(o,s,i)=>{\"use strict\";var u=i(92861).Buffer,_=u.isEncoding||function(o){switch((o=\"\"+o)&&o.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 StringDecoder(o){var s;switch(this.encoding=function normalizeEncoding(o){var s=function _normalizeEncoding(o){if(!o)return\"utf8\";for(var s;;)switch(o){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 o;default:if(s)return;o=(\"\"+o).toLowerCase(),s=!0}}(o);if(\"string\"!=typeof s&&(u.isEncoding===_||!_(o)))throw new Error(\"Unknown encoding: \"+o);return s||o}(o),this.encoding){case\"utf16le\":this.text=utf16Text,this.end=utf16End,s=4;break;case\"utf8\":this.fillLast=utf8FillLast,s=4;break;case\"base64\":this.text=base64Text,this.end=base64End,s=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=u.allocUnsafe(s)}function utf8CheckByte(o){return o<=127?0:o>>5==6?2:o>>4==14?3:o>>3==30?4:o>>6==2?-1:-2}function utf8FillLast(o){var s=this.lastTotal-this.lastNeed,i=function utf8CheckExtraBytes(o,s,i){if(128!=(192&s[0]))return o.lastNeed=0,\"�\";if(o.lastNeed>1&&s.length>1){if(128!=(192&s[1]))return o.lastNeed=1,\"�\";if(o.lastNeed>2&&s.length>2&&128!=(192&s[2]))return o.lastNeed=2,\"�\"}}(this,o);return void 0!==i?i:this.lastNeed<=o.length?(o.copy(this.lastChar,s,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(o.copy(this.lastChar,s,0,o.length),void(this.lastNeed-=o.length))}function utf16Text(o,s){if((o.length-s)%2==0){var i=o.toString(\"utf16le\",s);if(i){var u=i.charCodeAt(i.length-1);if(u>=55296&&u<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=o[o.length-2],this.lastChar[1]=o[o.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=o[o.length-1],o.toString(\"utf16le\",s,o.length-1)}function utf16End(o){var s=o&&o.length?this.write(o):\"\";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return s+this.lastChar.toString(\"utf16le\",0,i)}return s}function base64Text(o,s){var i=(o.length-s)%3;return 0===i?o.toString(\"base64\",s):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=o[o.length-1]:(this.lastChar[0]=o[o.length-2],this.lastChar[1]=o[o.length-1]),o.toString(\"base64\",s,o.length-i))}function base64End(o){var s=o&&o.length?this.write(o):\"\";return this.lastNeed?s+this.lastChar.toString(\"base64\",0,3-this.lastNeed):s}function simpleWrite(o){return o.toString(this.encoding)}function simpleEnd(o){return o&&o.length?this.write(o):\"\"}s.I=StringDecoder,StringDecoder.prototype.write=function(o){if(0===o.length)return\"\";var s,i;if(this.lastNeed){if(void 0===(s=this.fillLast(o)))return\"\";i=this.lastNeed,this.lastNeed=0}else i=0;return i<o.length?s?s+this.text(o,i):this.text(o,i):s||\"\"},StringDecoder.prototype.end=function utf8End(o){var s=o&&o.length?this.write(o):\"\";return this.lastNeed?s+\"�\":s},StringDecoder.prototype.text=function utf8Text(o,s){var i=function utf8CheckIncomplete(o,s,i){var u=s.length-1;if(u<i)return 0;var _=utf8CheckByte(s[u]);if(_>=0)return _>0&&(o.lastNeed=_-1),_;if(--u<i||-2===_)return 0;if(_=utf8CheckByte(s[u]),_>=0)return _>0&&(o.lastNeed=_-2),_;if(--u<i||-2===_)return 0;if(_=utf8CheckByte(s[u]),_>=0)return _>0&&(2===_?_=0:o.lastNeed=_-3),_;return 0}(this,o,s);if(!this.lastNeed)return o.toString(\"utf8\",s);this.lastTotal=i;var u=o.length-(i-this.lastNeed);return o.copy(this.lastChar,0,u),o.toString(\"utf8\",s,u)},StringDecoder.prototype.fillLast=function(o){if(this.lastNeed<=o.length)return o.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);o.copy(this.lastChar,this.lastTotal-this.lastNeed,0,o.length),this.lastNeed-=o.length}},16426:o=>{o.exports=function(){var o=document.getSelection();if(!o.rangeCount)return function(){};for(var s=document.activeElement,i=[],u=0;u<o.rangeCount;u++)i.push(o.getRangeAt(u));switch(s.tagName.toUpperCase()){case\"INPUT\":case\"TEXTAREA\":s.blur();break;default:s=null}return o.removeAllRanges(),function(){\"Caret\"===o.type&&o.removeAllRanges(),o.rangeCount||i.forEach((function(s){o.addRange(s)})),s&&s.focus()}}},36623:o=>{\"use strict\";function toS(o){return Object.prototype.toString.call(o)}var s=Array.isArray||function isArray(o){return\"[object Array]\"===Object.prototype.toString.call(o)};function forEach(o,s){if(o.forEach)return o.forEach(s);for(var i=0;i<o.length;i++)s(o[i],i,o)}var i=Object.keys||function keys(o){var s=[];for(var i in o)s.push(i);return s},u=Object.prototype.propertyIsEnumerable,_=Object.getOwnPropertySymbols;function ownEnumerableKeys(o){var s=i(o);if(_)for(var w=_(o),x=0;x<w.length;x++)u.call(o,w[x])&&s.push(w[x]);return s}var w=Object.prototype.hasOwnProperty||function(o,s){return s in o};function copy(o){if(\"object\"==typeof o&&null!==o){var i;if(s(o))i=[];else if(function isDate(o){return\"[object Date]\"===toS(o)}(o))i=new Date(o.getTime?o.getTime():o);else if(function isRegExp(o){return\"[object RegExp]\"===toS(o)}(o))i=new RegExp(o);else if(function isError(o){return\"[object Error]\"===toS(o)}(o))i={message:o.message};else if(function isBoolean(o){return\"[object Boolean]\"===toS(o)}(o)||function isNumber(o){return\"[object Number]\"===toS(o)}(o)||function isString(o){return\"[object String]\"===toS(o)}(o))i=Object(o);else if(Object.create&&Object.getPrototypeOf)i=Object.create(Object.getPrototypeOf(o));else if(o.constructor===Object)i={};else{var u=o.constructor&&o.constructor.prototype||o.__proto__||{},_=function T(){};_.prototype=u,i=new _}return forEach(ownEnumerableKeys(o),(function(s){i[s]=o[s]})),i}return o}function walk(o,i,u){var _=[],x=[],C=!0;return function walker(o){var j=u?copy(o):o,L={},B=!0,$={node:j,node_:o,path:[].concat(_),parent:x[x.length-1],parents:x,key:_[_.length-1],isRoot:0===_.length,level:_.length,circular:null,update:function(o,s){$.isRoot||($.parent.node[$.key]=o),$.node=o,s&&(B=!1)},delete:function(o){delete $.parent.node[$.key],o&&(B=!1)},remove:function(o){s($.parent.node)?$.parent.node.splice($.key,1):delete $.parent.node[$.key],o&&(B=!1)},keys:null,before:function(o){L.before=o},after:function(o){L.after=o},pre:function(o){L.pre=o},post:function(o){L.post=o},stop:function(){C=!1},block:function(){B=!1}};if(!C)return $;function updateState(){if(\"object\"==typeof $.node&&null!==$.node){$.keys&&$.node_===$.node||($.keys=ownEnumerableKeys($.node)),$.isLeaf=0===$.keys.length;for(var s=0;s<x.length;s++)if(x[s].node_===o){$.circular=x[s];break}}else $.isLeaf=!0,$.keys=null;$.notLeaf=!$.isLeaf,$.notRoot=!$.isRoot}updateState();var V=i.call($,$.node);return void 0!==V&&$.update&&$.update(V),L.before&&L.before.call($,$.node),B?(\"object\"!=typeof $.node||null===$.node||$.circular||(x.push($),updateState(),forEach($.keys,(function(o,s){_.push(o),L.pre&&L.pre.call($,$.node[o],o);var i=walker($.node[o]);u&&w.call($.node,o)&&($.node[o]=i.node),i.isLast=s===$.keys.length-1,i.isFirst=0===s,L.post&&L.post.call($,i),_.pop()})),x.pop()),L.after&&L.after.call($,$.node),$):$}(o).node}function Traverse(o){this.value=o}function traverse(o){return new Traverse(o)}Traverse.prototype.get=function(o){for(var s=this.value,i=0;i<o.length;i++){var u=o[i];if(!s||!w.call(s,u))return;s=s[u]}return s},Traverse.prototype.has=function(o){for(var s=this.value,i=0;i<o.length;i++){var u=o[i];if(!s||!w.call(s,u))return!1;s=s[u]}return!0},Traverse.prototype.set=function(o,s){for(var i=this.value,u=0;u<o.length-1;u++){var _=o[u];w.call(i,_)||(i[_]={}),i=i[_]}return i[o[u]]=s,s},Traverse.prototype.map=function(o){return walk(this.value,o,!0)},Traverse.prototype.forEach=function(o){return this.value=walk(this.value,o,!1),this.value},Traverse.prototype.reduce=function(o,s){var i=1===arguments.length,u=i?this.value:s;return this.forEach((function(s){this.isRoot&&i||(u=o.call(this,u,s))})),u},Traverse.prototype.paths=function(){var o=[];return this.forEach((function(){o.push(this.path)})),o},Traverse.prototype.nodes=function(){var o=[];return this.forEach((function(){o.push(this.node)})),o},Traverse.prototype.clone=function(){var o=[],s=[];return function clone(i){for(var u=0;u<o.length;u++)if(o[u]===i)return s[u];if(\"object\"==typeof i&&null!==i){var _=copy(i);return o.push(i),s.push(_),forEach(ownEnumerableKeys(i),(function(o){_[o]=clone(i[o])})),o.pop(),s.pop(),_}return i}(this.value)},forEach(ownEnumerableKeys(Traverse.prototype),(function(o){traverse[o]=function(s){var i=[].slice.call(arguments,1),u=new Traverse(s);return u[o].apply(u,i)}})),o.exports=traverse},61160:(o,s,i)=>{\"use strict\";var u=i(92063),_=i(73992),w=/^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/,x=/[\\n\\r\\t]/g,C=/^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//,j=/:\\d+$/,L=/^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i,B=/^[a-zA-Z]:/;function trimLeft(o){return(o||\"\").toString().replace(w,\"\")}var $=[[\"#\",\"hash\"],[\"?\",\"query\"],function sanitize(o,s){return isSpecial(s.protocol)?o.replace(/\\\\/g,\"/\"):o},[\"/\",\"pathname\"],[\"@\",\"auth\",1],[NaN,\"host\",void 0,1,1],[/:(\\d*)$/,\"port\",void 0,1],[NaN,\"hostname\",void 0,1,1]],V={hash:1,query:1};function lolcation(o){var s,u=(\"undefined\"!=typeof window?window:void 0!==i.g?i.g:\"undefined\"!=typeof self?self:{}).location||{},_={},w=typeof(o=o||u);if(\"blob:\"===o.protocol)_=new Url(unescape(o.pathname),{});else if(\"string\"===w)for(s in _=new Url(o,{}),V)delete _[s];else if(\"object\"===w){for(s in o)s in V||(_[s]=o[s]);void 0===_.slashes&&(_.slashes=C.test(o.href))}return _}function isSpecial(o){return\"file:\"===o||\"ftp:\"===o||\"http:\"===o||\"https:\"===o||\"ws:\"===o||\"wss:\"===o}function extractProtocol(o,s){o=(o=trimLeft(o)).replace(x,\"\"),s=s||{};var i,u=L.exec(o),_=u[1]?u[1].toLowerCase():\"\",w=!!u[2],C=!!u[3],j=0;return w?C?(i=u[2]+u[3]+u[4],j=u[2].length+u[3].length):(i=u[2]+u[4],j=u[2].length):C?(i=u[3]+u[4],j=u[3].length):i=u[4],\"file:\"===_?j>=2&&(i=i.slice(2)):isSpecial(_)?i=u[4]:_?w&&(i=i.slice(2)):j>=2&&isSpecial(s.protocol)&&(i=u[4]),{protocol:_,slashes:w||isSpecial(_),slashesCount:j,rest:i}}function Url(o,s,i){if(o=(o=trimLeft(o)).replace(x,\"\"),!(this instanceof Url))return new Url(o,s,i);var w,C,j,L,V,U,z=$.slice(),Y=typeof s,Z=this,ee=0;for(\"object\"!==Y&&\"string\"!==Y&&(i=s,s=null),i&&\"function\"!=typeof i&&(i=_.parse),w=!(C=extractProtocol(o||\"\",s=lolcation(s))).protocol&&!C.slashes,Z.slashes=C.slashes||w&&s.slashes,Z.protocol=C.protocol||s.protocol||\"\",o=C.rest,(\"file:\"===C.protocol&&(2!==C.slashesCount||B.test(o))||!C.slashes&&(C.protocol||C.slashesCount<2||!isSpecial(Z.protocol)))&&(z[3]=[/(.*)/,\"pathname\"]);ee<z.length;ee++)\"function\"!=typeof(L=z[ee])?(j=L[0],U=L[1],j!=j?Z[U]=o:\"string\"==typeof j?~(V=\"@\"===j?o.lastIndexOf(j):o.indexOf(j))&&(\"number\"==typeof L[2]?(Z[U]=o.slice(0,V),o=o.slice(V+L[2])):(Z[U]=o.slice(V),o=o.slice(0,V))):(V=j.exec(o))&&(Z[U]=V[1],o=o.slice(0,V.index)),Z[U]=Z[U]||w&&L[3]&&s[U]||\"\",L[4]&&(Z[U]=Z[U].toLowerCase())):o=L(o,Z);i&&(Z.query=i(Z.query)),w&&s.slashes&&\"/\"!==Z.pathname.charAt(0)&&(\"\"!==Z.pathname||\"\"!==s.pathname)&&(Z.pathname=function resolve(o,s){if(\"\"===o)return s;for(var i=(s||\"/\").split(\"/\").slice(0,-1).concat(o.split(\"/\")),u=i.length,_=i[u-1],w=!1,x=0;u--;)\".\"===i[u]?i.splice(u,1):\"..\"===i[u]?(i.splice(u,1),x++):x&&(0===u&&(w=!0),i.splice(u,1),x--);return w&&i.unshift(\"\"),\".\"!==_&&\"..\"!==_||i.push(\"\"),i.join(\"/\")}(Z.pathname,s.pathname)),\"/\"!==Z.pathname.charAt(0)&&isSpecial(Z.protocol)&&(Z.pathname=\"/\"+Z.pathname),u(Z.port,Z.protocol)||(Z.host=Z.hostname,Z.port=\"\"),Z.username=Z.password=\"\",Z.auth&&(~(V=Z.auth.indexOf(\":\"))?(Z.username=Z.auth.slice(0,V),Z.username=encodeURIComponent(decodeURIComponent(Z.username)),Z.password=Z.auth.slice(V+1),Z.password=encodeURIComponent(decodeURIComponent(Z.password))):Z.username=encodeURIComponent(decodeURIComponent(Z.auth)),Z.auth=Z.password?Z.username+\":\"+Z.password:Z.username),Z.origin=\"file:\"!==Z.protocol&&isSpecial(Z.protocol)&&Z.host?Z.protocol+\"//\"+Z.host:\"null\",Z.href=Z.toString()}Url.prototype={set:function set(o,s,i){var w=this;switch(o){case\"query\":\"string\"==typeof s&&s.length&&(s=(i||_.parse)(s)),w[o]=s;break;case\"port\":w[o]=s,u(s,w.protocol)?s&&(w.host=w.hostname+\":\"+s):(w.host=w.hostname,w[o]=\"\");break;case\"hostname\":w[o]=s,w.port&&(s+=\":\"+w.port),w.host=s;break;case\"host\":w[o]=s,j.test(s)?(s=s.split(\":\"),w.port=s.pop(),w.hostname=s.join(\":\")):(w.hostname=s,w.port=\"\");break;case\"protocol\":w.protocol=s.toLowerCase(),w.slashes=!i;break;case\"pathname\":case\"hash\":if(s){var x=\"pathname\"===o?\"/\":\"#\";w[o]=s.charAt(0)!==x?x+s:s}else w[o]=s;break;case\"username\":case\"password\":w[o]=encodeURIComponent(s);break;case\"auth\":var C=s.indexOf(\":\");~C?(w.username=s.slice(0,C),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=s.slice(C+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(s))}for(var L=0;L<$.length;L++){var B=$[L];B[4]&&(w[B[1]]=w[B[1]].toLowerCase())}return w.auth=w.password?w.username+\":\"+w.password:w.username,w.origin=\"file:\"!==w.protocol&&isSpecial(w.protocol)&&w.host?w.protocol+\"//\"+w.host:\"null\",w.href=w.toString(),w},toString:function toString(o){o&&\"function\"==typeof o||(o=_.stringify);var s,i=this,u=i.host,w=i.protocol;w&&\":\"!==w.charAt(w.length-1)&&(w+=\":\");var x=w+(i.protocol&&i.slashes||isSpecial(i.protocol)?\"//\":\"\");return i.username?(x+=i.username,i.password&&(x+=\":\"+i.password),x+=\"@\"):i.password?(x+=\":\"+i.password,x+=\"@\"):\"file:\"!==i.protocol&&isSpecial(i.protocol)&&!u&&\"/\"!==i.pathname&&(x+=\"@\"),(\":\"===u[u.length-1]||j.test(i.hostname)&&!i.port)&&(u+=\":\"),x+=u+i.pathname,(s=\"object\"==typeof i.query?o(i.query):i.query)&&(x+=\"?\"!==s.charAt(0)?\"?\"+s:s),i.hash&&(x+=i.hash),x}},Url.extractProtocol=extractProtocol,Url.location=lolcation,Url.trimLeft=trimLeft,Url.qs=_,o.exports=Url},77154:(o,s,i)=>{\"use strict\";var u=i(96540);var _=\"function\"==typeof Object.is?Object.is:function n(o,s){return o===s&&(0!==o||1/o==1/s)||o!=o&&s!=s},w=u.useSyncExternalStore,x=u.useRef,C=u.useEffect,j=u.useMemo,L=u.useDebugValue;s.useSyncExternalStoreWithSelector=function(o,s,i,u,B){var $=x(null);if(null===$.current){var V={hasValue:!1,value:null};$.current=V}else V=$.current;$=j((function(){function a(s){if(!x){if(x=!0,o=s,s=u(s),void 0!==B&&V.hasValue){var i=V.value;if(B(i,s))return w=i}return w=s}if(i=w,_(o,s))return i;var C=u(s);return void 0!==B&&B(i,C)?i:(o=s,w=C)}var o,w,x=!1,C=void 0===i?null:i;return[function(){return a(s())},null===C?void 0:function(){return a(C())}]}),[s,i,u,B]);var U=w(o,$[0],$[1]);return C((function(){V.hasValue=!0,V.value=U}),[U]),L(U),U}},78418:(o,s,i)=>{\"use strict\";o.exports=i(77154)},94643:(o,s,i)=>{function config(o){try{if(!i.g.localStorage)return!1}catch(o){return!1}var s=i.g.localStorage[o];return null!=s&&\"true\"===String(s).toLowerCase()}o.exports=function deprecate(o,s){if(config(\"noDeprecation\"))return o;var i=!1;return function deprecated(){if(!i){if(config(\"throwDeprecation\"))throw new Error(s);config(\"traceDeprecation\")?console.trace(s):console.warn(s),i=!0}return o.apply(this,arguments)}}},26657:(o,s,i)=>{\"use strict\";var u=i(75208),_=function isClosingTag(o){return/<\\/+[^>]+>/.test(o)},w=function isSelfClosingTag(o){return/<[^>]+\\/>/.test(o)},x=function isOpeningTag(o){return function isTag(o){return/<[^>!]+>/.test(o)}(o)&&!_(o)&&!w(o)};function getType(o){return _(o)?\"ClosingTag\":x(o)?\"OpeningTag\":w(o)?\"SelfClosingTag\":\"Text\"}o.exports=function(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=s.indentor,_=s.textNodesOnSameLine,w=0,x=[];i=i||\"    \";var C=function lexer(o){return function splitOnTags(o){return o.split(/(<\\/?[^>]+>)/g).filter((function(o){return\"\"!==o.trim()}))}(o).map((function(o){return{value:o,type:getType(o)}}))}(o).map((function(o,s,C){var j=o.value,L=o.type;\"ClosingTag\"===L&&w--;var B=u(i,w),$=B+j;if(\"OpeningTag\"===L&&w++,_){var V=C[s-1],U=C[s-2];\"ClosingTag\"===L&&\"Text\"===V.type&&\"OpeningTag\"===U.type&&($=\"\"+B+U.value+V.value+j,x.push(s-2,s-1))}return $}));return x.forEach((function(o){return C[o]=null})),C.filter((function(o){return!!o})).join(\"\\n\")}},31499:o=>{var s={\"&\":\"&amp;\",'\"':\"&quot;\",\"'\":\"&apos;\",\"<\":\"&lt;\",\">\":\"&gt;\"};o.exports=function escapeForXML(o){return o&&o.replace?o.replace(/([&\"<>'])/g,(function(o,i){return s[i]})):o}},19123:(o,s,i)=>{var u=i(65606),_=i(31499),w=i(88310).Stream;function resolve(o,s,i){var u,w=function create_indent(o,s){return new Array(s||0).join(o||\"\")}(s,i=i||0),x=o;if(\"object\"==typeof o&&((x=o[u=Object.keys(o)[0]])&&x._elem))return x._elem.name=u,x._elem.icount=i,x._elem.indent=s,x._elem.indents=w,x._elem.interrupt=x,x._elem;var C,j=[],L=[];function get_attributes(o){Object.keys(o).forEach((function(s){j.push(function attribute(o,s){return o+'=\"'+_(s)+'\"'}(s,o[s]))}))}switch(typeof x){case\"object\":if(null===x)break;x._attr&&get_attributes(x._attr),x._cdata&&L.push((\"<![CDATA[\"+x._cdata).replace(/\\]\\]>/g,\"]]]]><![CDATA[>\")+\"]]>\"),x.forEach&&(C=!1,L.push(\"\"),x.forEach((function(o){\"object\"==typeof o?\"_attr\"==Object.keys(o)[0]?get_attributes(o._attr):L.push(resolve(o,s,i+1)):(L.pop(),C=!0,L.push(_(o)))})),C||L.push(\"\"));break;default:L.push(_(x))}return{name:u,interrupt:!1,attributes:j,content:L,icount:i,indents:w,indent:s}}function format(o,s,i){if(\"object\"!=typeof s)return o(!1,s);var u=s.interrupt?1:s.content.length;function proceed(){for(;s.content.length;){var _=s.content.shift();if(void 0!==_){if(interrupt(_))return;format(o,_)}}o(!1,(u>1?s.indents:\"\")+(s.name?\"</\"+s.name+\">\":\"\")+(s.indent&&!i?\"\\n\":\"\")),i&&i()}function interrupt(s){return!!s.interrupt&&(s.interrupt.append=o,s.interrupt.end=proceed,s.interrupt=!1,o(!0),!0)}if(o(!1,s.indents+(s.name?\"<\"+s.name:\"\")+(s.attributes.length?\" \"+s.attributes.join(\" \"):\"\")+(u?s.name?\">\":\"\":s.name?\"/>\":\"\")+(s.indent&&u>1?\"\\n\":\"\")),!u)return o(!1,s.indent?\"\\n\":\"\");interrupt(s)||proceed()}o.exports=function xml(o,s){\"object\"!=typeof s&&(s={indent:s});var i=s.stream?new w:null,_=\"\",x=!1,C=s.indent?!0===s.indent?\"    \":s.indent:\"\",j=!0;function delay(o){j?u.nextTick(o):o()}function append(o,s){if(void 0!==s&&(_+=s),o&&!x&&(i=i||new w,x=!0),o&&x){var u=_;delay((function(){i.emit(\"data\",u)})),_=\"\"}}function add(o,s){format(append,resolve(o,C,C?1:0),s)}function end(){if(i){var o=_;delay((function(){i.emit(\"data\",o),i.emit(\"end\"),i.readable=!1,i.emit(\"close\")}))}}return delay((function(){j=!1})),s.declaration&&function addXmlDeclaration(o){var s={version:\"1.0\",encoding:o.encoding||\"UTF-8\"};o.standalone&&(s.standalone=o.standalone),add({\"?xml\":{_attr:s}}),_=_.replace(\"/>\",\"?>\")}(s.declaration),o&&o.forEach?o.forEach((function(s,i){var u;i+1===o.length&&(u=end),add(s,u)})):add(o,end),i?(i.readable=!0,i):_},o.exports.element=o.exports.Element=function element(){var o={_elem:resolve(Array.prototype.slice.call(arguments)),push:function(o){if(!this.append)throw new Error(\"not assigned to a parent!\");var s=this,i=this._elem.indent;format(this.append,resolve(o,i,this._elem.icount+(i?1:0)),(function(){s.append(!0)}))},close:function(o){void 0!==o&&this.push(o),this.end&&this.end()}};return o}},86215:function(o,s){var i,u,_;u=[],i=function(){\"use strict\";var isNativeSmoothScrollEnabledOn=function(o){return o&&\"getComputedStyle\"in window&&\"smooth\"===window.getComputedStyle(o)[\"scroll-behavior\"]};if(\"undefined\"==typeof window||!(\"document\"in window))return{};var makeScroller=function(o,s,i){var u;s=s||999,i||0===i||(i=9);var setScrollTimeoutId=function(o){u=o},stopScroll=function(){clearTimeout(u),setScrollTimeoutId(0)},getTopWithEdgeOffset=function(s){return Math.max(0,o.getTopOf(s)-i)},scrollToY=function(i,u,_){if(stopScroll(),0===u||u&&u<0||isNativeSmoothScrollEnabledOn(o.body))o.toY(i),_&&_();else{var w=o.getY(),x=Math.max(0,i)-w,C=(new Date).getTime();u=u||Math.min(Math.abs(x),s),function loopScroll(){setScrollTimeoutId(setTimeout((function(){var s=Math.min(1,((new Date).getTime()-C)/u),i=Math.max(0,Math.floor(w+x*(s<.5?2*s*s:s*(4-2*s)-1)));o.toY(i),s<1&&o.getHeight()+i<o.body.scrollHeight?loopScroll():(setTimeout(stopScroll,99),_&&_())}),9))}()}},scrollToElem=function(o,s,i){scrollToY(getTopWithEdgeOffset(o),s,i)},scrollIntoView=function(s,u,_){var w=s.getBoundingClientRect().height,x=o.getTopOf(s)+w,C=o.getHeight(),j=o.getY(),L=j+C;getTopWithEdgeOffset(s)<j||w+i>C?scrollToElem(s,u,_):x+i>L?scrollToY(x-C+i,u,_):_&&_()},scrollToCenterOf=function(s,i,u,_){scrollToY(Math.max(0,o.getTopOf(s)-o.getHeight()/2+(u||s.getBoundingClientRect().height/2)),i,_)};return{setup:function(o,u){return(0===o||o)&&(s=o),(0===u||u)&&(i=u),{defaultDuration:s,edgeOffset:i}},to:scrollToElem,toY:scrollToY,intoView:scrollIntoView,center:scrollToCenterOf,stop:stopScroll,moving:function(){return!!u},getY:o.getY,getTopOf:o.getTopOf}},o=document.documentElement,getDocY=function(){return window.scrollY||o.scrollTop},s=makeScroller({body:document.scrollingElement||document.body,toY:function(o){window.scrollTo(0,o)},getY:getDocY,getHeight:function(){return window.innerHeight||o.clientHeight},getTopOf:function(s){return s.getBoundingClientRect().top+getDocY()-o.offsetTop}});if(s.createScroller=function(s,i,u){return makeScroller({body:s,toY:function(o){s.scrollTop=o},getY:function(){return s.scrollTop},getHeight:function(){return Math.min(s.clientHeight,window.innerHeight||o.clientHeight)},getTopOf:function(o){return o.offsetTop}},i,u)},\"addEventListener\"in window&&!window.noZensmooth&&!isNativeSmoothScrollEnabledOn(document.body)){var i=\"history\"in window&&\"pushState\"in history,u=i&&\"scrollRestoration\"in history;u&&(history.scrollRestoration=\"auto\"),window.addEventListener(\"load\",(function(){u&&(setTimeout((function(){history.scrollRestoration=\"manual\"}),9),window.addEventListener(\"popstate\",(function(o){o.state&&\"zenscrollY\"in o.state&&s.toY(o.state.zenscrollY)}),!1)),window.location.hash&&setTimeout((function(){var o=s.setup().edgeOffset;if(o){var i=document.getElementById(window.location.href.split(\"#\")[1]);if(i){var u=Math.max(0,s.getTopOf(i)-o),_=s.getY()-u;0<=_&&_<9&&window.scrollTo(0,u)}}}),9)}),!1);var _=new RegExp(\"(^|\\\\s)noZensmooth(\\\\s|$)\");window.addEventListener(\"click\",(function(o){for(var w=o.target;w&&\"A\"!==w.tagName;)w=w.parentNode;if(!(!w||1!==o.which||o.shiftKey||o.metaKey||o.ctrlKey||o.altKey)){if(u){var x=history.state&&\"object\"==typeof history.state?history.state:{};x.zenscrollY=s.getY();try{history.replaceState(x,\"\")}catch(o){}}var C=w.getAttribute(\"href\")||\"\";if(0===C.indexOf(\"#\")&&!_.test(w.className)){var j=0,L=document.getElementById(C.substring(1));if(\"#\"!==C){if(!L)return;j=s.getTopOf(L)}o.preventDefault();var onDone=function(){window.location=C},B=s.setup().edgeOffset;B&&(j=Math.max(0,j-B),i&&(onDone=function(){history.pushState({},\"\",C)})),s.toY(j,null,onDone)}}}),!1)}return s}(),void 0===(_=\"function\"==typeof i?i.apply(s,u):i)||(o.exports=_)},42634:()=>{},15340:()=>{},79838:()=>{},48675:(o,s,i)=>{o.exports=i(20850)},39584:(o,s,i)=>{o.exports=i(92983)},7666:(o,s,i)=>{var u=i(84851),_=i(953);function _extends(){var s;return o.exports=_extends=u?_(s=u).call(s):function(o){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(o[u]=i[u])}return o},o.exports.__esModule=!0,o.exports.default=o.exports,_extends.apply(this,arguments)}o.exports=_extends,o.exports.__esModule=!0,o.exports.default=o.exports},46942:(o,s)=>{var i;!function(){\"use strict\";var u={}.hasOwnProperty;function classNames(){for(var o=\"\",s=0;s<arguments.length;s++){var i=arguments[s];i&&(o=appendClass(o,parseValue(i)))}return o}function parseValue(o){if(\"string\"==typeof o||\"number\"==typeof o)return o;if(\"object\"!=typeof o)return\"\";if(Array.isArray(o))return classNames.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes(\"[native code]\"))return o.toString();var s=\"\";for(var i in o)u.call(o,i)&&o[i]&&(s=appendClass(s,i));return s}function appendClass(o,s){return s?o?o+\" \"+s:o+s:o}o.exports?(classNames.default=classNames,o.exports=classNames):void 0===(i=function(){return classNames}.apply(s,[]))||(o.exports=i)}()},68623:(o,s,i)=>{\"use strict\";var u=i(694);o.exports=u},93700:(o,s,i)=>{\"use strict\";var u=i(19709);o.exports=u},4588:(o,s,i)=>{\"use strict\";var u=i(96203);o.exports=u},462:(o,s,i)=>{\"use strict\";var u=i(40975);o.exports=u},37257:(o,s,i)=>{\"use strict\";i(96605),i(64502),i(36371),i(99363),i(7057);var u=i(92046);o.exports=u.AggregateError},32567:(o,s,i)=>{\"use strict\";i(79307);var u=i(61747);o.exports=u(\"Function\",\"bind\")},23034:(o,s,i)=>{\"use strict\";var u=i(88280),_=i(32567),w=Function.prototype;o.exports=function(o){var s=o.bind;return o===w||u(w,o)&&s===w.bind?_:s}},3258:(o,s,i)=>{\"use strict\";var u=i(88280),_=i(16768),w=String.prototype;o.exports=function(o){var s=o.matchAll;return\"string\"==typeof o||o===w||u(w,o)&&s===w.matchAll?_:s}},9748:(o,s,i)=>{\"use strict\";i(71340);var u=i(92046);o.exports=u.Object.assign},16768:(o,s,i)=>{\"use strict\";i(86024),i(51398),i(79104);var u=i(61747);o.exports=u(\"String\",\"matchAll\")},20850:(o,s,i)=>{\"use strict\";o.exports=i(46076)},953:(o,s,i)=>{\"use strict\";o.exports=i(53375)},92983:(o,s,i)=>{\"use strict\";o.exports=i(5077)},84851:(o,s,i)=>{\"use strict\";o.exports=i(85401)},46076:(o,s,i)=>{\"use strict\";i(91599);var u=i(68623);o.exports=u},53375:(o,s,i)=>{\"use strict\";var u=i(93700);o.exports=u},5077:(o,s,i)=>{\"use strict\";i(37347);var u=i(4588);o.exports=u},85401:(o,s,i)=>{\"use strict\";var u=i(462);o.exports=u},82159:(o,s,i)=>{\"use strict\";var u=i(62250),_=i(4640),w=TypeError;o.exports=function(o){if(u(o))return o;throw new w(_(o)+\" is not a function\")}},82235:(o,s,i)=>{\"use strict\";var u=i(25468),_=i(4640),w=TypeError;o.exports=function(o){if(u(o))return o;throw new w(_(o)+\" is not a constructor\")}},10043:(o,s,i)=>{\"use strict\";var u=i(54018),_=String,w=TypeError;o.exports=function(o){if(u(o))return o;throw new w(\"Can't set \"+_(o)+\" as a prototype\")}},42156:o=>{\"use strict\";o.exports=function(){}},25592:(o,s,i)=>{\"use strict\";var u=i(11470).charAt;o.exports=function(o,s,i){return s+(i?u(o,s).length:1)}},36624:(o,s,i)=>{\"use strict\";var u=i(46285),_=String,w=TypeError;o.exports=function(o){if(u(o))return o;throw new w(_(o)+\" is not an object\")}},74436:(o,s,i)=>{\"use strict\";var u=i(4993),_=i(34849),w=i(20575),createMethod=function(o){return function(s,i,x){var C=u(s),j=w(C);if(0===j)return!o&&-1;var L,B=_(x,j);if(o&&i!=i){for(;j>B;)if((L=C[B++])!=L)return!0}else for(;j>B;B++)if((o||B in C)&&C[B]===i)return o||B||0;return!o&&-1}};o.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},93427:(o,s,i)=>{\"use strict\";var u=i(1907);o.exports=u([].slice)},45807:(o,s,i)=>{\"use strict\";var u=i(1907),_=u({}.toString),w=u(\"\".slice);o.exports=function(o){return w(_(o),8,-1)}},73948:(o,s,i)=>{\"use strict\";var u=i(52623),_=i(62250),w=i(45807),x=i(76264)(\"toStringTag\"),C=Object,j=\"Arguments\"===w(function(){return arguments}());o.exports=u?w:function(o){var s,i,u;return void 0===o?\"Undefined\":null===o?\"Null\":\"string\"==typeof(i=function(o,s){try{return o[s]}catch(o){}}(s=C(o),x))?i:j?w(s):\"Object\"===(u=w(s))&&_(s.callee)?\"Arguments\":u}},19595:(o,s,i)=>{\"use strict\";var u=i(49724),_=i(11042),w=i(13846),x=i(74284);o.exports=function(o,s,i){for(var C=_(s),j=x.f,L=w.f,B=0;B<C.length;B++){var $=C[B];u(o,$)||i&&u(i,$)||j(o,$,L(s,$))}}},57382:(o,s,i)=>{\"use strict\";var u=i(98828);o.exports=!u((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))},59550:o=>{\"use strict\";o.exports=function(o,s){return{value:o,done:s}}},61626:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(74284),w=i(75817);o.exports=u?function(o,s,i){return _.f(o,s,w(1,i))}:function(o,s,i){return o[s]=i,o}},75817:o=>{\"use strict\";o.exports=function(o,s){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:s}}},68055:(o,s,i)=>{\"use strict\";var u=i(61626);o.exports=function(o,s,i,_){return _&&_.enumerable?o[s]=i:u(o,s,i),o}},2532:(o,s,i)=>{\"use strict\";var u=i(41010),_=Object.defineProperty;o.exports=function(o,s){try{_(u,o,{value:s,configurable:!0,writable:!0})}catch(i){u[o]=s}return s}},39447:(o,s,i)=>{\"use strict\";var u=i(98828);o.exports=!u((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},49552:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(46285),w=u.document,x=_(w)&&_(w.createElement);o.exports=function(o){return x?w.createElement(o):{}}},19287:o=>{\"use strict\";o.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},64723:o=>{\"use strict\";o.exports=\"undefined\"!=typeof navigator&&String(navigator.userAgent)||\"\"},15683:(o,s,i)=>{\"use strict\";var u,_,w=i(41010),x=i(64723),C=w.process,j=w.Deno,L=C&&C.versions||j&&j.version,B=L&&L.v8;B&&(_=(u=B.split(\".\"))[0]>0&&u[0]<4?1:+(u[0]+u[1])),!_&&x&&(!(u=x.match(/Edge\\/(\\d+)/))||u[1]>=74)&&(u=x.match(/Chrome\\/(\\d+)/))&&(_=+u[1]),o.exports=_},80376:o=>{\"use strict\";o.exports=[\"constructor\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toLocaleString\",\"toString\",\"valueOf\"]},85762:(o,s,i)=>{\"use strict\";var u=i(1907),_=Error,w=u(\"\".replace),x=String(new _(\"zxcasd\").stack),C=/\\n\\s*at [^:]*:[^\\n]*/,j=C.test(x);o.exports=function(o,s){if(j&&\"string\"==typeof o&&!_.prepareStackTrace)for(;s--;)o=w(o,C,\"\");return o}},85884:(o,s,i)=>{\"use strict\";var u=i(61626),_=i(85762),w=i(23888),x=Error.captureStackTrace;o.exports=function(o,s,i,C){w&&(x?x(o,s):u(o,\"stack\",_(i,C)))}},23888:(o,s,i)=>{\"use strict\";var u=i(98828),_=i(75817);o.exports=!u((function(){var o=new Error(\"a\");return!(\"stack\"in o)||(Object.defineProperty(o,\"stack\",_(1,7)),7!==o.stack)}))},11091:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(76024),w=i(92361),x=i(62250),C=i(13846).f,j=i(7463),L=i(92046),B=i(28311),$=i(61626),V=i(49724);i(36128);var wrapConstructor=function(o){var Wrapper=function(s,i,u){if(this instanceof Wrapper){switch(arguments.length){case 0:return new o;case 1:return new o(s);case 2:return new o(s,i)}return new o(s,i,u)}return _(o,this,arguments)};return Wrapper.prototype=o.prototype,Wrapper};o.exports=function(o,s){var i,_,U,z,Y,Z,ee,ie,ae,ce=o.target,le=o.global,pe=o.stat,de=o.proto,fe=le?u:pe?u[ce]:u[ce]&&u[ce].prototype,ye=le?L:L[ce]||$(L,ce,{})[ce],be=ye.prototype;for(z in s)_=!(i=j(le?z:ce+(pe?\".\":\"#\")+z,o.forced))&&fe&&V(fe,z),Z=ye[z],_&&(ee=o.dontCallGetSet?(ae=C(fe,z))&&ae.value:fe[z]),Y=_&&ee?ee:s[z],(i||de||typeof Z!=typeof Y)&&(ie=o.bind&&_?B(Y,u):o.wrap&&_?wrapConstructor(Y):de&&x(Y)?w(Y):Y,(o.sham||Y&&Y.sham||Z&&Z.sham)&&$(ie,\"sham\",!0),$(ye,z,ie),de&&(V(L,U=ce+\"Prototype\")||$(L,U,{}),$(L[U],z,Y),o.real&&be&&(i||!be[z])&&$(be,z,Y)))}},98828:o=>{\"use strict\";o.exports=function(o){try{return!!o()}catch(o){return!0}}},76024:(o,s,i)=>{\"use strict\";var u=i(41505),_=Function.prototype,w=_.apply,x=_.call;o.exports=\"object\"==typeof Reflect&&Reflect.apply||(u?x.bind(w):function(){return x.apply(w,arguments)})},28311:(o,s,i)=>{\"use strict\";var u=i(92361),_=i(82159),w=i(41505),x=u(u.bind);o.exports=function(o,s){return _(o),void 0===s?o:w?x(o,s):function(){return o.apply(s,arguments)}}},41505:(o,s,i)=>{\"use strict\";var u=i(98828);o.exports=!u((function(){var o=function(){}.bind();return\"function\"!=typeof o||o.hasOwnProperty(\"prototype\")}))},44673:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(82159),w=i(46285),x=i(49724),C=i(93427),j=i(41505),L=Function,B=u([].concat),$=u([].join),V={};o.exports=j?L.bind:function bind(o){var s=_(this),i=s.prototype,u=C(arguments,1),j=function bound(){var i=B(u,C(arguments));return this instanceof j?function(o,s,i){if(!x(V,s)){for(var u=[],_=0;_<s;_++)u[_]=\"a[\"+_+\"]\";V[s]=L(\"C,a\",\"return new C(\"+$(u,\",\")+\")\")}return V[s](o,i)}(s,i.length,i):s.apply(o,i)};return w(i)&&(j.prototype=i),j}},13930:(o,s,i)=>{\"use strict\";var u=i(41505),_=Function.prototype.call;o.exports=u?_.bind(_):function(){return _.apply(_,arguments)}},36833:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(49724),w=Function.prototype,x=u&&Object.getOwnPropertyDescriptor,C=_(w,\"name\"),j=C&&\"something\"===function something(){}.name,L=C&&(!u||u&&x(w,\"name\").configurable);o.exports={EXISTS:C,PROPER:j,CONFIGURABLE:L}},51871:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(82159);o.exports=function(o,s,i){try{return u(_(Object.getOwnPropertyDescriptor(o,s)[i]))}catch(o){}}},92361:(o,s,i)=>{\"use strict\";var u=i(45807),_=i(1907);o.exports=function(o){if(\"Function\"===u(o))return _(o)}},1907:(o,s,i)=>{\"use strict\";var u=i(41505),_=Function.prototype,w=_.call,x=u&&_.bind.bind(w,w);o.exports=u?x:function(o){return function(){return w.apply(o,arguments)}}},61747:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(92046);o.exports=function(o,s){var i=_[o+\"Prototype\"],w=i&&i[s];if(w)return w;var x=u[o],C=x&&x.prototype;return C&&C[s]}},85582:(o,s,i)=>{\"use strict\";var u=i(92046),_=i(41010),w=i(62250),aFunction=function(o){return w(o)?o:void 0};o.exports=function(o,s){return arguments.length<2?aFunction(u[o])||aFunction(_[o]):u[o]&&u[o][s]||_[o]&&_[o][s]}},73448:(o,s,i)=>{\"use strict\";var u=i(73948),_=i(29367),w=i(87136),x=i(93742),C=i(76264)(\"iterator\");o.exports=function(o){if(!w(o))return _(o,C)||_(o,\"@@iterator\")||x[u(o)]}},10300:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(82159),w=i(36624),x=i(4640),C=i(73448),j=TypeError;o.exports=function(o,s){var i=arguments.length<2?C(o):s;if(_(i))return w(u(i,o));throw new j(x(o)+\" is not iterable\")}},29367:(o,s,i)=>{\"use strict\";var u=i(82159),_=i(87136);o.exports=function(o,s){var i=o[s];return _(i)?void 0:u(i)}},41010:function(o,s,i){\"use strict\";var check=function(o){return o&&o.Math===Math&&o};o.exports=check(\"object\"==typeof globalThis&&globalThis)||check(\"object\"==typeof window&&window)||check(\"object\"==typeof self&&self)||check(\"object\"==typeof i.g&&i.g)||check(\"object\"==typeof this&&this)||function(){return this}()||Function(\"return this\")()},49724:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(39298),w=u({}.hasOwnProperty);o.exports=Object.hasOwn||function hasOwn(o,s){return w(_(o),s)}},38530:o=>{\"use strict\";o.exports={}},62416:(o,s,i)=>{\"use strict\";var u=i(85582);o.exports=u(\"document\",\"documentElement\")},73648:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(98828),w=i(49552);o.exports=!u&&!_((function(){return 7!==Object.defineProperty(w(\"div\"),\"a\",{get:function(){return 7}}).a}))},16946:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(98828),w=i(45807),x=Object,C=u(\"\".split);o.exports=_((function(){return!x(\"z\").propertyIsEnumerable(0)}))?function(o){return\"String\"===w(o)?C(o,\"\"):x(o)}:x},34084:(o,s,i)=>{\"use strict\";var u=i(62250),_=i(46285),w=i(79192);o.exports=function(o,s,i){var x,C;return w&&u(x=s.constructor)&&x!==i&&_(C=x.prototype)&&C!==i.prototype&&w(o,C),o}},12647:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(62250),w=i(36128),x=u(Function.toString);_(w.inspectSource)||(w.inspectSource=function(o){return x(o)}),o.exports=w.inspectSource},39259:(o,s,i)=>{\"use strict\";var u=i(46285),_=i(61626);o.exports=function(o,s){u(s)&&\"cause\"in s&&_(o,\"cause\",s.cause)}},64932:(o,s,i)=>{\"use strict\";var u,_,w,x=i(40551),C=i(41010),j=i(46285),L=i(61626),B=i(49724),$=i(36128),V=i(92522),U=i(38530),z=\"Object already initialized\",Y=C.TypeError,Z=C.WeakMap;if(x||$.state){var ee=$.state||($.state=new Z);ee.get=ee.get,ee.has=ee.has,ee.set=ee.set,u=function(o,s){if(ee.has(o))throw new Y(z);return s.facade=o,ee.set(o,s),s},_=function(o){return ee.get(o)||{}},w=function(o){return ee.has(o)}}else{var ie=V(\"state\");U[ie]=!0,u=function(o,s){if(B(o,ie))throw new Y(z);return s.facade=o,L(o,ie,s),s},_=function(o){return B(o,ie)?o[ie]:{}},w=function(o){return B(o,ie)}}o.exports={set:u,get:_,has:w,enforce:function(o){return w(o)?_(o):u(o,{})},getterFor:function(o){return function(s){var i;if(!j(s)||(i=_(s)).type!==o)throw new Y(\"Incompatible receiver, \"+o+\" required\");return i}}}},37812:(o,s,i)=>{\"use strict\";var u=i(76264),_=i(93742),w=u(\"iterator\"),x=Array.prototype;o.exports=function(o){return void 0!==o&&(_.Array===o||x[w]===o)}},62250:o=>{\"use strict\";var s=\"object\"==typeof document&&document.all;o.exports=void 0===s&&void 0!==s?function(o){return\"function\"==typeof o||o===s}:function(o){return\"function\"==typeof o}},25468:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(98828),w=i(62250),x=i(73948),C=i(85582),j=i(12647),noop=function(){},L=C(\"Reflect\",\"construct\"),B=/^\\s*(?:class|function)\\b/,$=u(B.exec),V=!B.test(noop),U=function isConstructor(o){if(!w(o))return!1;try{return L(noop,[],o),!0}catch(o){return!1}},z=function isConstructor(o){if(!w(o))return!1;switch(x(o)){case\"AsyncFunction\":case\"GeneratorFunction\":case\"AsyncGeneratorFunction\":return!1}try{return V||!!$(B,j(o))}catch(o){return!0}};z.sham=!0,o.exports=!L||_((function(){var o;return U(U.call)||!U(Object)||!U((function(){o=!0}))||o}))?z:U},7463:(o,s,i)=>{\"use strict\";var u=i(98828),_=i(62250),w=/#|\\.prototype\\./,isForced=function(o,s){var i=C[x(o)];return i===L||i!==j&&(_(s)?u(s):!!s)},x=isForced.normalize=function(o){return String(o).replace(w,\".\").toLowerCase()},C=isForced.data={},j=isForced.NATIVE=\"N\",L=isForced.POLYFILL=\"P\";o.exports=isForced},87136:o=>{\"use strict\";o.exports=function(o){return null==o}},46285:(o,s,i)=>{\"use strict\";var u=i(62250);o.exports=function(o){return\"object\"==typeof o?null!==o:u(o)}},54018:(o,s,i)=>{\"use strict\";var u=i(46285);o.exports=function(o){return u(o)||null===o}},7376:o=>{\"use strict\";o.exports=!0},72087:(o,s,i)=>{\"use strict\";var u=i(46285),_=i(45807),w=i(76264)(\"match\");o.exports=function(o){var s;return u(o)&&(void 0!==(s=o[w])?!!s:\"RegExp\"===_(o))}},25594:(o,s,i)=>{\"use strict\";var u=i(85582),_=i(62250),w=i(88280),x=i(51175),C=Object;o.exports=x?function(o){return\"symbol\"==typeof o}:function(o){var s=u(\"Symbol\");return _(s)&&w(s.prototype,C(o))}},24823:(o,s,i)=>{\"use strict\";var u=i(28311),_=i(13930),w=i(36624),x=i(4640),C=i(37812),j=i(20575),L=i(88280),B=i(10300),$=i(73448),V=i(40154),U=TypeError,Result=function(o,s){this.stopped=o,this.result=s},z=Result.prototype;o.exports=function(o,s,i){var Y,Z,ee,ie,ae,ce,le,pe=i&&i.that,de=!(!i||!i.AS_ENTRIES),fe=!(!i||!i.IS_RECORD),ye=!(!i||!i.IS_ITERATOR),be=!(!i||!i.INTERRUPTED),_e=u(s,pe),stop=function(o){return Y&&V(Y,\"normal\",o),new Result(!0,o)},callFn=function(o){return de?(w(o),be?_e(o[0],o[1],stop):_e(o[0],o[1])):be?_e(o,stop):_e(o)};if(fe)Y=o.iterator;else if(ye)Y=o;else{if(!(Z=$(o)))throw new U(x(o)+\" is not iterable\");if(C(Z)){for(ee=0,ie=j(o);ie>ee;ee++)if((ae=callFn(o[ee]))&&L(z,ae))return ae;return new Result(!1)}Y=B(o,Z)}for(ce=fe?o.next:Y.next;!(le=_(ce,Y)).done;){try{ae=callFn(le.value)}catch(o){V(Y,\"throw\",o)}if(\"object\"==typeof ae&&ae&&L(z,ae))return ae}return new Result(!1)}},40154:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(36624),w=i(29367);o.exports=function(o,s,i){var x,C;_(o);try{if(!(x=w(o,\"return\"))){if(\"throw\"===s)throw i;return i}x=u(x,o)}catch(o){C=!0,x=o}if(\"throw\"===s)throw i;if(C)throw x;return _(x),i}},47181:(o,s,i)=>{\"use strict\";var u=i(95116).IteratorPrototype,_=i(58075),w=i(75817),x=i(14840),C=i(93742),returnThis=function(){return this};o.exports=function(o,s,i,j){var L=s+\" Iterator\";return o.prototype=_(u,{next:w(+!j,i)}),x(o,L,!1,!0),C[L]=returnThis,o}},60183:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(13930),w=i(7376),x=i(36833),C=i(62250),j=i(47181),L=i(15972),B=i(79192),$=i(14840),V=i(61626),U=i(68055),z=i(76264),Y=i(93742),Z=i(95116),ee=x.PROPER,ie=x.CONFIGURABLE,ae=Z.IteratorPrototype,ce=Z.BUGGY_SAFARI_ITERATORS,le=z(\"iterator\"),pe=\"keys\",de=\"values\",fe=\"entries\",returnThis=function(){return this};o.exports=function(o,s,i,x,z,Z,ye){j(i,s,x);var be,_e,we,getIterationMethod=function(o){if(o===z&&Re)return Re;if(!ce&&o&&o in Pe)return Pe[o];switch(o){case pe:return function keys(){return new i(this,o)};case de:return function values(){return new i(this,o)};case fe:return function entries(){return new i(this,o)}}return function(){return new i(this)}},Se=s+\" Iterator\",xe=!1,Pe=o.prototype,Te=Pe[le]||Pe[\"@@iterator\"]||z&&Pe[z],Re=!ce&&Te||getIterationMethod(z),qe=\"Array\"===s&&Pe.entries||Te;if(qe&&(be=L(qe.call(new o)))!==Object.prototype&&be.next&&(w||L(be)===ae||(B?B(be,ae):C(be[le])||U(be,le,returnThis)),$(be,Se,!0,!0),w&&(Y[Se]=returnThis)),ee&&z===de&&Te&&Te.name!==de&&(!w&&ie?V(Pe,\"name\",de):(xe=!0,Re=function values(){return _(Te,this)})),z)if(_e={values:getIterationMethod(de),keys:Z?Re:getIterationMethod(pe),entries:getIterationMethod(fe)},ye)for(we in _e)(ce||xe||!(we in Pe))&&U(Pe,we,_e[we]);else u({target:s,proto:!0,forced:ce||xe},_e);return w&&!ye||Pe[le]===Re||U(Pe,le,Re,{name:z}),Y[s]=Re,_e}},95116:(o,s,i)=>{\"use strict\";var u,_,w,x=i(98828),C=i(62250),j=i(46285),L=i(58075),B=i(15972),$=i(68055),V=i(76264),U=i(7376),z=V(\"iterator\"),Y=!1;[].keys&&(\"next\"in(w=[].keys())?(_=B(B(w)))!==Object.prototype&&(u=_):Y=!0),!j(u)||x((function(){var o={};return u[z].call(o)!==o}))?u={}:U&&(u=L(u)),C(u[z])||$(u,z,(function(){return this})),o.exports={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:Y}},93742:o=>{\"use strict\";o.exports={}},20575:(o,s,i)=>{\"use strict\";var u=i(3121);o.exports=function(o){return u(o.length)}},41176:o=>{\"use strict\";var s=Math.ceil,i=Math.floor;o.exports=Math.trunc||function trunc(o){var u=+o;return(u>0?i:s)(u)}},32096:(o,s,i)=>{\"use strict\";var u=i(90160);o.exports=function(o,s){return void 0===o?arguments.length<2?\"\":s:u(o)}},29538:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(1907),w=i(13930),x=i(98828),C=i(2875),j=i(87170),L=i(22574),B=i(39298),$=i(16946),V=Object.assign,U=Object.defineProperty,z=_([].concat);o.exports=!V||x((function(){if(u&&1!==V({b:1},V(U({},\"a\",{enumerable:!0,get:function(){U(this,\"b\",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var o={},s={},i=Symbol(\"assign detection\"),_=\"abcdefghijklmnopqrst\";return o[i]=7,_.split(\"\").forEach((function(o){s[o]=o})),7!==V({},o)[i]||C(V({},s)).join(\"\")!==_}))?function assign(o,s){for(var i=B(o),_=arguments.length,x=1,V=j.f,U=L.f;_>x;)for(var Y,Z=$(arguments[x++]),ee=V?z(C(Z),V(Z)):C(Z),ie=ee.length,ae=0;ie>ae;)Y=ee[ae++],u&&!w(U,Z,Y)||(i[Y]=Z[Y]);return i}:V},58075:(o,s,i)=>{\"use strict\";var u,_=i(36624),w=i(42220),x=i(80376),C=i(38530),j=i(62416),L=i(49552),B=i(92522),$=\"prototype\",V=\"script\",U=B(\"IE_PROTO\"),EmptyConstructor=function(){},scriptTag=function(o){return\"<\"+V+\">\"+o+\"</\"+V+\">\"},NullProtoObjectViaActiveX=function(o){o.write(scriptTag(\"\")),o.close();var s=o.parentWindow.Object;return o=null,s},NullProtoObject=function(){try{u=new ActiveXObject(\"htmlfile\")}catch(o){}var o,s,i;NullProtoObject=\"undefined\"!=typeof document?document.domain&&u?NullProtoObjectViaActiveX(u):(s=L(\"iframe\"),i=\"java\"+V+\":\",s.style.display=\"none\",j.appendChild(s),s.src=String(i),(o=s.contentWindow.document).open(),o.write(scriptTag(\"document.F=Object\")),o.close(),o.F):NullProtoObjectViaActiveX(u);for(var _=x.length;_--;)delete NullProtoObject[$][x[_]];return NullProtoObject()};C[U]=!0,o.exports=Object.create||function create(o,s){var i;return null!==o?(EmptyConstructor[$]=_(o),i=new EmptyConstructor,EmptyConstructor[$]=null,i[U]=o):i=NullProtoObject(),void 0===s?i:w.f(i,s)}},42220:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(58661),w=i(74284),x=i(36624),C=i(4993),j=i(2875);s.f=u&&!_?Object.defineProperties:function defineProperties(o,s){x(o);for(var i,u=C(s),_=j(s),L=_.length,B=0;L>B;)w.f(o,i=_[B++],u[i]);return o}},74284:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(73648),w=i(58661),x=i(36624),C=i(70470),j=TypeError,L=Object.defineProperty,B=Object.getOwnPropertyDescriptor,$=\"enumerable\",V=\"configurable\",U=\"writable\";s.f=u?w?function defineProperty(o,s,i){if(x(o),s=C(s),x(i),\"function\"==typeof o&&\"prototype\"===s&&\"value\"in i&&U in i&&!i[U]){var u=B(o,s);u&&u[U]&&(o[s]=i.value,i={configurable:V in i?i[V]:u[V],enumerable:$ in i?i[$]:u[$],writable:!1})}return L(o,s,i)}:L:function defineProperty(o,s,i){if(x(o),s=C(s),x(i),_)try{return L(o,s,i)}catch(o){}if(\"get\"in i||\"set\"in i)throw new j(\"Accessors not supported\");return\"value\"in i&&(o[s]=i.value),o}},13846:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(13930),w=i(22574),x=i(75817),C=i(4993),j=i(70470),L=i(49724),B=i(73648),$=Object.getOwnPropertyDescriptor;s.f=u?$:function getOwnPropertyDescriptor(o,s){if(o=C(o),s=j(s),B)try{return $(o,s)}catch(o){}if(L(o,s))return x(!_(w.f,o,s),o[s])}},24443:(o,s,i)=>{\"use strict\";var u=i(23045),_=i(80376).concat(\"length\",\"prototype\");s.f=Object.getOwnPropertyNames||function getOwnPropertyNames(o){return u(o,_)}},87170:(o,s)=>{\"use strict\";s.f=Object.getOwnPropertySymbols},15972:(o,s,i)=>{\"use strict\";var u=i(49724),_=i(62250),w=i(39298),x=i(92522),C=i(57382),j=x(\"IE_PROTO\"),L=Object,B=L.prototype;o.exports=C?L.getPrototypeOf:function(o){var s=w(o);if(u(s,j))return s[j];var i=s.constructor;return _(i)&&s instanceof i?i.prototype:s instanceof L?B:null}},88280:(o,s,i)=>{\"use strict\";var u=i(1907);o.exports=u({}.isPrototypeOf)},23045:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(49724),w=i(4993),x=i(74436).indexOf,C=i(38530),j=u([].push);o.exports=function(o,s){var i,u=w(o),L=0,B=[];for(i in u)!_(C,i)&&_(u,i)&&j(B,i);for(;s.length>L;)_(u,i=s[L++])&&(~x(B,i)||j(B,i));return B}},2875:(o,s,i)=>{\"use strict\";var u=i(23045),_=i(80376);o.exports=Object.keys||function keys(o){return u(o,_)}},22574:(o,s)=>{\"use strict\";var i={}.propertyIsEnumerable,u=Object.getOwnPropertyDescriptor,_=u&&!i.call({1:2},1);s.f=_?function propertyIsEnumerable(o){var s=u(this,o);return!!s&&s.enumerable}:i},79192:(o,s,i)=>{\"use strict\";var u=i(51871),_=i(46285),w=i(74239),x=i(10043);o.exports=Object.setPrototypeOf||(\"__proto__\"in{}?function(){var o,s=!1,i={};try{(o=u(Object.prototype,\"__proto__\",\"set\"))(i,[]),s=i instanceof Array}catch(o){}return function setPrototypeOf(i,u){return w(i),x(u),_(i)?(s?o(i,u):i.__proto__=u,i):i}}():void 0)},54878:(o,s,i)=>{\"use strict\";var u=i(52623),_=i(73948);o.exports=u?{}.toString:function toString(){return\"[object \"+_(this)+\"]\"}},60581:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(62250),w=i(46285),x=TypeError;o.exports=function(o,s){var i,C;if(\"string\"===s&&_(i=o.toString)&&!w(C=u(i,o)))return C;if(_(i=o.valueOf)&&!w(C=u(i,o)))return C;if(\"string\"!==s&&_(i=o.toString)&&!w(C=u(i,o)))return C;throw new x(\"Can't convert object to primitive value\")}},11042:(o,s,i)=>{\"use strict\";var u=i(85582),_=i(1907),w=i(24443),x=i(87170),C=i(36624),j=_([].concat);o.exports=u(\"Reflect\",\"ownKeys\")||function ownKeys(o){var s=w.f(C(o)),i=x.f;return i?j(s,i(o)):s}},92046:o=>{\"use strict\";o.exports={}},54829:(o,s,i)=>{\"use strict\";var u=i(74284).f;o.exports=function(o,s,i){i in o||u(o,i,{configurable:!0,get:function(){return s[i]},set:function(o){s[i]=o}})}},70971:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(36624),w=i(62250),x=i(45807),C=i(16820),j=TypeError;o.exports=function(o,s){var i=o.exec;if(w(i)){var L=u(i,o,s);return null!==L&&_(L),L}if(\"RegExp\"===x(o))return u(C,o,s);throw new j(\"RegExp#exec called on incompatible receiver\")}},16820:o=>{\"use strict\";o.exports=/./.exec},85606:(o,s,i)=>{\"use strict\";var u=i(36624);o.exports=function(){var o=u(this),s=\"\";return o.hasIndices&&(s+=\"d\"),o.global&&(s+=\"g\"),o.ignoreCase&&(s+=\"i\"),o.multiline&&(s+=\"m\"),o.dotAll&&(s+=\"s\"),o.unicode&&(s+=\"u\"),o.unicodeSets&&(s+=\"v\"),o.sticky&&(s+=\"y\"),s}},40663:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(49724),w=i(88280),x=i(85606),C=RegExp.prototype;o.exports=function(o){var s=o.flags;return void 0!==s||\"flags\"in C||_(o,\"flags\")||!w(C,o)?s:u(x,o)}},74239:(o,s,i)=>{\"use strict\";var u=i(87136),_=TypeError;o.exports=function(o){if(u(o))throw new _(\"Can't call method on \"+o);return o}},14840:(o,s,i)=>{\"use strict\";var u=i(52623),_=i(74284).f,w=i(61626),x=i(49724),C=i(54878),j=i(76264)(\"toStringTag\");o.exports=function(o,s,i,L){var B=i?o:o&&o.prototype;B&&(x(B,j)||_(B,j,{configurable:!0,value:s}),L&&!u&&w(B,\"toString\",C))}},92522:(o,s,i)=>{\"use strict\";var u=i(85816),_=i(6499),w=u(\"keys\");o.exports=function(o){return w[o]||(w[o]=_(o))}},36128:(o,s,i)=>{\"use strict\";var u=i(7376),_=i(41010),w=i(2532),x=\"__core-js_shared__\",C=o.exports=_[x]||w(x,{});(C.versions||(C.versions=[])).push({version:\"3.37.1\",mode:u?\"pure\":\"global\",copyright:\"© 2014-2024 Denis Pushkarev (zloirock.ru)\",license:\"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE\",source:\"https://github.com/zloirock/core-js\"})},85816:(o,s,i)=>{\"use strict\";var u=i(36128);o.exports=function(o,s){return u[o]||(u[o]=s||{})}},28450:(o,s,i)=>{\"use strict\";var u=i(36624),_=i(82235),w=i(87136),x=i(76264)(\"species\");o.exports=function(o,s){var i,C=u(o).constructor;return void 0===C||w(i=u(C)[x])?s:_(i)}},11470:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(65482),w=i(90160),x=i(74239),C=u(\"\".charAt),j=u(\"\".charCodeAt),L=u(\"\".slice),createMethod=function(o){return function(s,i){var u,B,$=w(x(s)),V=_(i),U=$.length;return V<0||V>=U?o?\"\":void 0:(u=j($,V))<55296||u>56319||V+1===U||(B=j($,V+1))<56320||B>57343?o?C($,V):u:o?L($,V,V+2):B-56320+(u-55296<<10)+65536}};o.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},19846:(o,s,i)=>{\"use strict\";var u=i(15683),_=i(98828),w=i(41010).String;o.exports=!!Object.getOwnPropertySymbols&&!_((function(){var o=Symbol(\"symbol detection\");return!w(o)||!(Object(o)instanceof Symbol)||!Symbol.sham&&u&&u<41}))},34849:(o,s,i)=>{\"use strict\";var u=i(65482),_=Math.max,w=Math.min;o.exports=function(o,s){var i=u(o);return i<0?_(i+s,0):w(i,s)}},4993:(o,s,i)=>{\"use strict\";var u=i(16946),_=i(74239);o.exports=function(o){return u(_(o))}},65482:(o,s,i)=>{\"use strict\";var u=i(41176);o.exports=function(o){var s=+o;return s!=s||0===s?0:u(s)}},3121:(o,s,i)=>{\"use strict\";var u=i(65482),_=Math.min;o.exports=function(o){var s=u(o);return s>0?_(s,9007199254740991):0}},39298:(o,s,i)=>{\"use strict\";var u=i(74239),_=Object;o.exports=function(o){return _(u(o))}},46028:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(46285),w=i(25594),x=i(29367),C=i(60581),j=i(76264),L=TypeError,B=j(\"toPrimitive\");o.exports=function(o,s){if(!_(o)||w(o))return o;var i,j=x(o,B);if(j){if(void 0===s&&(s=\"default\"),i=u(j,o,s),!_(i)||w(i))return i;throw new L(\"Can't convert object to primitive value\")}return void 0===s&&(s=\"number\"),C(o,s)}},70470:(o,s,i)=>{\"use strict\";var u=i(46028),_=i(25594);o.exports=function(o){var s=u(o,\"string\");return _(s)?s:s+\"\"}},52623:(o,s,i)=>{\"use strict\";var u={};u[i(76264)(\"toStringTag\")]=\"z\",o.exports=\"[object z]\"===String(u)},90160:(o,s,i)=>{\"use strict\";var u=i(73948),_=String;o.exports=function(o){if(\"Symbol\"===u(o))throw new TypeError(\"Cannot convert a Symbol value to a string\");return _(o)}},4640:o=>{\"use strict\";var s=String;o.exports=function(o){try{return s(o)}catch(o){return\"Object\"}}},6499:(o,s,i)=>{\"use strict\";var u=i(1907),_=0,w=Math.random(),x=u(1..toString);o.exports=function(o){return\"Symbol(\"+(void 0===o?\"\":o)+\")_\"+x(++_+w,36)}},51175:(o,s,i)=>{\"use strict\";var u=i(19846);o.exports=u&&!Symbol.sham&&\"symbol\"==typeof Symbol.iterator},58661:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(98828);o.exports=u&&_((function(){return 42!==Object.defineProperty((function(){}),\"prototype\",{value:42,writable:!1}).prototype}))},40551:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(62250),w=u.WeakMap;o.exports=_(w)&&/native code/.test(String(w))},76264:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(85816),w=i(49724),x=i(6499),C=i(19846),j=i(51175),L=u.Symbol,B=_(\"wks\"),$=j?L.for||L:L&&L.withoutSetter||x;o.exports=function(o){return w(B,o)||(B[o]=C&&w(L,o)?L[o]:$(\"Symbol.\"+o)),B[o]}},19358:(o,s,i)=>{\"use strict\";var u=i(85582),_=i(49724),w=i(61626),x=i(88280),C=i(79192),j=i(19595),L=i(54829),B=i(34084),$=i(32096),V=i(39259),U=i(85884),z=i(39447),Y=i(7376);o.exports=function(o,s,i,Z){var ee=\"stackTraceLimit\",ie=Z?2:1,ae=o.split(\".\"),ce=ae[ae.length-1],le=u.apply(null,ae);if(le){var pe=le.prototype;if(!Y&&_(pe,\"cause\")&&delete pe.cause,!i)return le;var de=u(\"Error\"),fe=s((function(o,s){var i=$(Z?s:o,void 0),u=Z?new le(o):new le;return void 0!==i&&w(u,\"message\",i),U(u,fe,u.stack,2),this&&x(pe,this)&&B(u,this,fe),arguments.length>ie&&V(u,arguments[ie]),u}));if(fe.prototype=pe,\"Error\"!==ce?C?C(fe,de):j(fe,de,{name:!0}):z&&ee in le&&(L(fe,le,ee),L(fe,le,\"prepareStackTrace\")),j(fe,le),!Y)try{pe.name!==ce&&w(pe,\"name\",ce),pe.constructor=fe}catch(o){}return fe}}},36371:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(85582),w=i(76024),x=i(98828),C=i(19358),j=\"AggregateError\",L=_(j),B=!x((function(){return 1!==L([1]).errors[0]}))&&x((function(){return 7!==L([1],j,{cause:7}).cause}));u({global:!0,constructor:!0,arity:2,forced:B},{AggregateError:C(j,(function(o){return function AggregateError(s,i){return w(o,this,arguments)}}),B,!0)})},82048:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(88280),w=i(15972),x=i(79192),C=i(19595),j=i(58075),L=i(61626),B=i(75817),$=i(39259),V=i(85884),U=i(24823),z=i(32096),Y=i(76264)(\"toStringTag\"),Z=Error,ee=[].push,ie=function AggregateError(o,s){var i,u=_(ae,this);x?i=x(new Z,u?w(this):ae):(i=u?this:j(ae),L(i,Y,\"Error\")),void 0!==s&&L(i,\"message\",z(s)),V(i,ie,i.stack,1),arguments.length>2&&$(i,arguments[2]);var C=[];return U(o,ee,{that:C}),L(i,\"errors\",C),i};x?x(ie,Z):C(ie,Z,{name:!0});var ae=ie.prototype=j(Z.prototype,{constructor:B(1,ie),message:B(1,\"\"),name:B(1,\"AggregateError\")});u({global:!0,constructor:!0,arity:2},{AggregateError:ie})},64502:(o,s,i)=>{\"use strict\";i(82048)},99363:(o,s,i)=>{\"use strict\";var u=i(4993),_=i(42156),w=i(93742),x=i(64932),C=i(74284).f,j=i(60183),L=i(59550),B=i(7376),$=i(39447),V=\"Array Iterator\",U=x.set,z=x.getterFor(V);o.exports=j(Array,\"Array\",(function(o,s){U(this,{type:V,target:u(o),index:0,kind:s})}),(function(){var o=z(this),s=o.target,i=o.index++;if(!s||i>=s.length)return o.target=void 0,L(void 0,!0);switch(o.kind){case\"keys\":return L(i,!1);case\"values\":return L(s[i],!1)}return L([i,s[i]],!1)}),\"values\");var Y=w.Arguments=w.Array;if(_(\"keys\"),_(\"values\"),_(\"entries\"),!B&&$&&\"values\"!==Y.name)try{C(Y,\"name\",{value:\"values\"})}catch(o){}},96605:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(41010),w=i(76024),x=i(19358),C=\"WebAssembly\",j=_[C],L=7!==new Error(\"e\",{cause:7}).cause,exportGlobalErrorCauseWrapper=function(o,s){var i={};i[o]=x(o,s,L),u({global:!0,constructor:!0,arity:1,forced:L},i)},exportWebAssemblyErrorCauseWrapper=function(o,s){if(j&&j[o]){var i={};i[o]=x(C+\".\"+o,s,L),u({target:C,stat:!0,constructor:!0,arity:1,forced:L},i)}};exportGlobalErrorCauseWrapper(\"Error\",(function(o){return function Error(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"EvalError\",(function(o){return function EvalError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"RangeError\",(function(o){return function RangeError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"ReferenceError\",(function(o){return function ReferenceError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"SyntaxError\",(function(o){return function SyntaxError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"TypeError\",(function(o){return function TypeError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"URIError\",(function(o){return function URIError(s){return w(o,this,arguments)}})),exportWebAssemblyErrorCauseWrapper(\"CompileError\",(function(o){return function CompileError(s){return w(o,this,arguments)}})),exportWebAssemblyErrorCauseWrapper(\"LinkError\",(function(o){return function LinkError(s){return w(o,this,arguments)}})),exportWebAssemblyErrorCauseWrapper(\"RuntimeError\",(function(o){return function RuntimeError(s){return w(o,this,arguments)}}))},79307:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(44673);u({target:\"Function\",proto:!0,forced:Function.bind!==_},{bind:_})},71340:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(29538);u({target:\"Object\",stat:!0,arity:2,forced:Object.assign!==_},{assign:_})},86024:()=>{},51398:()=>{},7057:(o,s,i)=>{\"use strict\";var u=i(11470).charAt,_=i(90160),w=i(64932),x=i(60183),C=i(59550),j=\"String Iterator\",L=w.set,B=w.getterFor(j);x(String,\"String\",(function(o){L(this,{type:j,string:_(o),index:0})}),(function next(){var o,s=B(this),i=s.string,_=s.index;return _>=i.length?C(void 0,!0):(o=u(i,_),s.index+=o.length,C(o,!1))}))},79104:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(13930),w=i(92361),x=i(47181),C=i(59550),j=i(74239),L=i(3121),B=i(90160),$=i(36624),V=i(87136),U=i(45807),z=i(72087),Y=i(40663),Z=i(29367),ee=i(68055),ie=i(98828),ae=i(76264),ce=i(28450),le=i(25592),pe=i(70971),de=i(64932),fe=i(7376),ye=ae(\"matchAll\"),be=\"RegExp String\",_e=be+\" Iterator\",we=de.set,Se=de.getterFor(_e),xe=RegExp.prototype,Pe=TypeError,Te=w(\"\".indexOf),Re=w(\"\".matchAll),qe=!!Re&&!ie((function(){Re(\"a\",/./)})),$e=x((function RegExpStringIterator(o,s,i,u){we(this,{type:_e,regexp:o,string:s,global:i,unicode:u,done:!1})}),be,(function next(){var o=Se(this);if(o.done)return C(void 0,!0);var s=o.regexp,i=o.string,u=pe(s,i);return null===u?(o.done=!0,C(void 0,!0)):o.global?(\"\"===B(u[0])&&(s.lastIndex=le(i,L(s.lastIndex),o.unicode)),C(u,!1)):(o.done=!0,C(u,!1))})),$matchAll=function(o){var s,i,u,_=$(this),w=B(o),x=ce(_,RegExp),C=B(Y(_));return s=new x(x===RegExp?_.source:_,C),i=!!~Te(C,\"g\"),u=!!~Te(C,\"u\"),s.lastIndex=L(_.lastIndex),new $e(s,w,i,u)};u({target:\"String\",proto:!0,forced:qe},{matchAll:function matchAll(o){var s,i,u,w,x=j(this);if(V(o)){if(qe)return Re(x,o)}else{if(z(o)&&(s=B(j(Y(o))),!~Te(s,\"g\")))throw new Pe(\"`.matchAll` does not allow non-global regexes\");if(qe)return Re(x,o);if(void 0===(u=Z(o,ye))&&fe&&\"RegExp\"===U(o)&&(u=$matchAll),u)return _(u,o,x)}return i=B(x),w=new RegExp(o,\"g\"),fe?_($matchAll,w,i):w[ye](i)}}),fe||ye in xe||ee(xe,ye,$matchAll)},91599:(o,s,i)=>{\"use strict\";i(64502)},37347:(o,s,i)=>{\"use strict\";i(79104)},12560:(o,s,i)=>{\"use strict\";i(99363);var u=i(19287),_=i(41010),w=i(14840),x=i(93742);for(var C in u)w(_[C],C),x[C]=x.Array},694:(o,s,i)=>{\"use strict\";i(91599);var u=i(37257);i(12560),o.exports=u},19709:(o,s,i)=>{\"use strict\";var u=i(23034);o.exports=u},96203:(o,s,i)=>{\"use strict\";var u=i(3258);o.exports=u},40975:(o,s,i)=>{\"use strict\";var u=i(9748);o.exports=u}},u={};function __webpack_require__(o){var s=u[o];if(void 0!==s)return s.exports;var _=u[o]={id:o,loaded:!1,exports:{}};return i[o].call(_.exports,_,_.exports,__webpack_require__),_.loaded=!0,_.exports}__webpack_require__.n=o=>{var s=o&&o.__esModule?()=>o.default:()=>o;return __webpack_require__.d(s,{a:s}),s},s=Object.getPrototypeOf?o=>Object.getPrototypeOf(o):o=>o.__proto__,__webpack_require__.t=function(i,u){if(1&u&&(i=this(i)),8&u)return i;if(\"object\"==typeof i&&i){if(4&u&&i.__esModule)return i;if(16&u&&\"function\"==typeof i.then)return i}var _=Object.create(null);__webpack_require__.r(_);var w={};o=o||[null,s({}),s([]),s(s)];for(var x=2&u&&i;\"object\"==typeof x&&!~o.indexOf(x);x=s(x))Object.getOwnPropertyNames(x).forEach((o=>w[o]=()=>i[o]));return w.default=()=>i,__webpack_require__.d(_,w),_},__webpack_require__.d=(o,s)=>{for(var i in s)__webpack_require__.o(s,i)&&!__webpack_require__.o(o,i)&&Object.defineProperty(o,i,{enumerable:!0,get:s[i]})},__webpack_require__.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(o){if(\"object\"==typeof window)return window}}(),__webpack_require__.o=(o,s)=>Object.prototype.hasOwnProperty.call(o,s),__webpack_require__.r=o=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(o,\"__esModule\",{value:!0})},__webpack_require__.nmd=o=>(o.paths=[],o.children||(o.children=[]),o);var _={};return(()=>{\"use strict\";__webpack_require__.d(_,{default:()=>kI});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{CLEAR:()=>st,CLEAR_BY:()=>it,NEW_AUTH_ERR:()=>ot,NEW_SPEC_ERR:()=>rt,NEW_SPEC_ERR_BATCH:()=>nt,NEW_THROWN_ERR:()=>et,NEW_THROWN_ERR_BATCH:()=>tt,clear:()=>clear,clearBy:()=>clearBy,newAuthErr:()=>newAuthErr,newSpecErr:()=>newSpecErr,newSpecErrBatch:()=>newSpecErrBatch,newThrownErr:()=>newThrownErr,newThrownErrBatch:()=>newThrownErrBatch});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{AUTHORIZE:()=>Tt,AUTHORIZE_OAUTH2:()=>Lt,CONFIGURE_AUTH:()=>Ft,LOGOUT:()=>Rt,PRE_AUTHORIZE_OAUTH2:()=>Dt,RESTORE_AUTHORIZATION:()=>qt,SHOW_AUTH_POPUP:()=>Nt,VALIDATE:()=>Bt,authPopup:()=>authPopup,authorize:()=>authorize,authorizeAccessCodeWithBasicAuthentication:()=>authorizeAccessCodeWithBasicAuthentication,authorizeAccessCodeWithFormParams:()=>authorizeAccessCodeWithFormParams,authorizeApplication:()=>authorizeApplication,authorizeOauth2:()=>authorizeOauth2,authorizeOauth2WithPersistOption:()=>authorizeOauth2WithPersistOption,authorizePassword:()=>authorizePassword,authorizeRequest:()=>authorizeRequest,authorizeWithPersistOption:()=>authorizeWithPersistOption,configureAuth:()=>configureAuth,logout:()=>logout,logoutWithPersistOption:()=>logoutWithPersistOption,persistAuthorizationIfNeeded:()=>persistAuthorizationIfNeeded,preAuthorizeImplicit:()=>preAuthorizeImplicit,restoreAuthorization:()=>restoreAuthorization,showDefinitions:()=>showDefinitions});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{authorized:()=>Gt,definitionsForRequirements:()=>definitionsForRequirements,definitionsToAuthorize:()=>Jt,getConfigs:()=>Yt,getDefinitionsByNames:()=>getDefinitionsByNames,isAuthorized:()=>isAuthorized,shownDefinitions:()=>Ht});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{TOGGLE_CONFIGS:()=>no,UPDATE_CONFIGS:()=>ro,downloadConfig:()=>downloadConfig,getConfigByUrl:()=>getConfigByUrl,loaded:()=>actions_loaded,toggle:()=>toggle,update:()=>update});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{get:()=>get});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{transform:()=>transform});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{transform:()=>parameter_oneof_transform});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{allErrors:()=>bo,lastError:()=>_o});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{SHOW:()=>Oo,UPDATE_FILTER:()=>xo,UPDATE_LAYOUT:()=>So,UPDATE_MODE:()=>ko,changeMode:()=>changeMode,show:()=>actions_show,updateFilter:()=>updateFilter,updateLayout:()=>updateLayout});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{current:()=>current,currentFilter:()=>currentFilter,isShown:()=>isShown,showSummary:()=>Ao,whatMode:()=>whatMode});var $={};__webpack_require__.r($),__webpack_require__.d($,{taggedOperations:()=>taggedOperations});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{requestSnippetGenerator_curl_bash:()=>requestSnippetGenerator_curl_bash,requestSnippetGenerator_curl_cmd:()=>requestSnippetGenerator_curl_cmd,requestSnippetGenerator_curl_powershell:()=>requestSnippetGenerator_curl_powershell});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{getActiveLanguage:()=>Io,getDefaultExpanded:()=>Mo,getGenerators:()=>Po,getSnippetGenerators:()=>getSnippetGenerators});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{JsonSchemaArrayItemFile:()=>JsonSchemaArrayItemFile,JsonSchemaArrayItemText:()=>JsonSchemaArrayItemText,JsonSchemaForm:()=>JsonSchemaForm,JsonSchema_array:()=>JsonSchema_array,JsonSchema_boolean:()=>JsonSchema_boolean,JsonSchema_object:()=>JsonSchema_object,JsonSchema_string:()=>JsonSchema_string});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{allowTryItOutFor:()=>allowTryItOutFor,basePath:()=>Ns,canExecuteScheme:()=>canExecuteScheme,consumes:()=>As,consumesOptionsFor:()=>consumesOptionsFor,contentTypeValues:()=>contentTypeValues,currentProducesFor:()=>currentProducesFor,definitions:()=>Ms,externalDocs:()=>ws,findDefinition:()=>findDefinition,getOAS3RequiredRequestBodyContentType:()=>getOAS3RequiredRequestBodyContentType,getParameter:()=>getParameter,hasHost:()=>Vs,host:()=>Ts,info:()=>Es,isMediaTypeSchemaPropertiesEqual:()=>isMediaTypeSchemaPropertiesEqual,isOAS3:()=>_s,lastError:()=>hs,mutatedRequestFor:()=>mutatedRequestFor,mutatedRequests:()=>$s,operationScheme:()=>operationScheme,operationWithMeta:()=>operationWithMeta,operations:()=>Cs,operationsWithRootInherited:()=>Ds,operationsWithTags:()=>Bs,parameterInclusionSettingFor:()=>parameterInclusionSettingFor,parameterValues:()=>parameterValues,parameterWithMeta:()=>parameterWithMeta,parameterWithMetaByIdentity:()=>parameterWithMetaByIdentity,parametersIncludeIn:()=>parametersIncludeIn,parametersIncludeType:()=>parametersIncludeType,paths:()=>ks,produces:()=>js,producesOptionsFor:()=>producesOptionsFor,requestFor:()=>requestFor,requests:()=>qs,responseFor:()=>responseFor,responses:()=>Fs,schemes:()=>Rs,security:()=>Ps,securityDefinitions:()=>Is,semver:()=>xs,spec:()=>spec,specJS:()=>ys,specJson:()=>gs,specJsonWithResolvedSubtrees:()=>bs,specResolved:()=>vs,specResolvedSubtree:()=>specResolvedSubtree,specSource:()=>ms,specStr:()=>fs,tagDetails:()=>tagDetails,taggedOperations:()=>selectors_taggedOperations,tags:()=>Ls,url:()=>ds,validOperationMethods:()=>Os,validateBeforeExecute:()=>validateBeforeExecute,validationErrors:()=>validationErrors,version:()=>Ss});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{CLEAR_REQUEST:()=>ra,CLEAR_RESPONSE:()=>ea,CLEAR_VALIDATE_PARAMS:()=>na,LOG_REQUEST:()=>Wi,SET_MUTATED_REQUEST:()=>Ri,SET_REQUEST:()=>Mi,SET_RESPONSE:()=>Pi,SET_SCHEME:()=>la,UPDATE_EMPTY_PARAM_INCLUSION:()=>Ei,UPDATE_JSON:()=>Zs,UPDATE_OPERATION_META_VALUE:()=>ia,UPDATE_PARAM:()=>_i,UPDATE_RESOLVED:()=>aa,UPDATE_RESOLVED_SUBTREE:()=>ca,UPDATE_SPEC:()=>Xs,UPDATE_URL:()=>Qs,VALIDATE_PARAMS:()=>Oi,changeConsumesValue:()=>changeConsumesValue,changeParam:()=>changeParam,changeParamByIdentity:()=>changeParamByIdentity,changeProducesValue:()=>changeProducesValue,clearRequest:()=>clearRequest,clearResponse:()=>clearResponse,clearValidateParams:()=>clearValidateParams,execute:()=>actions_execute,executeRequest:()=>executeRequest,invalidateResolvedSubtreeCache:()=>invalidateResolvedSubtreeCache,logRequest:()=>logRequest,parseToJson:()=>parseToJson,requestResolvedSubtree:()=>requestResolvedSubtree,resolveSpec:()=>resolveSpec,setMutatedRequest:()=>setMutatedRequest,setRequest:()=>setRequest,setResponse:()=>setResponse,setScheme:()=>setScheme,updateEmptyParamInclusion:()=>updateEmptyParamInclusion,updateJsonSpec:()=>updateJsonSpec,updateResolved:()=>updateResolved,updateResolvedSubtree:()=>updateResolvedSubtree,updateSpec:()=>updateSpec,updateUrl:()=>updateUrl,validateParams:()=>validateParams});var ee={};__webpack_require__.r(ee),__webpack_require__.d(ee,{executeRequest:()=>wrap_actions_executeRequest,updateJsonSpec:()=>wrap_actions_updateJsonSpec,updateSpec:()=>wrap_actions_updateSpec,validateParams:()=>wrap_actions_validateParams});var ie={};__webpack_require__.r(ie),__webpack_require__.d(ie,{JsonPatchError:()=>_a,_areEquals:()=>_areEquals,applyOperation:()=>applyOperation,applyPatch:()=>applyPatch,applyReducer:()=>applyReducer,deepClone:()=>Ea,getValueByPointer:()=>getValueByPointer,validate:()=>validate,validator:()=>validator});var ae={};__webpack_require__.r(ae),__webpack_require__.d(ae,{compare:()=>compare,generate:()=>generate,observe:()=>observe,unobserve:()=>unobserve});var ce={};__webpack_require__.r(ce),__webpack_require__.d(ce,{hasElementSourceMap:()=>hasElementSourceMap,includesClasses:()=>includesClasses,includesSymbols:()=>includesSymbols,isAnnotationElement:()=>gp,isArrayElement:()=>hp,isBooleanElement:()=>up,isCommentElement:()=>yp,isElement:()=>sp,isLinkElement:()=>fp,isMemberElement:()=>dp,isNullElement:()=>lp,isNumberElement:()=>cp,isObjectElement:()=>pp,isParseResultElement:()=>vp,isPrimitiveElement:()=>isPrimitiveElement,isRefElement:()=>mp,isSourceMapElement:()=>bp,isStringElement:()=>ip});var le={};__webpack_require__.r(le),__webpack_require__.d(le,{isJSONReferenceElement:()=>xm,isJSONSchemaElement:()=>Sm,isLinkDescriptionElement:()=>Om,isMediaElement:()=>km});var pe={};__webpack_require__.r(pe),__webpack_require__.d(pe,{isBooleanJsonSchemaElement:()=>isBooleanJsonSchemaElement,isCallbackElement:()=>_g,isComponentsElement:()=>xg,isContactElement:()=>kg,isExampleElement:()=>qg,isExternalDocumentationElement:()=>Vg,isHeaderElement:()=>Ug,isInfoElement:()=>zg,isLicenseElement:()=>Wg,isLinkElement:()=>Kg,isMediaTypeElement:()=>hy,isOpenApi3_0Element:()=>Xg,isOpenapiElement:()=>Yg,isOperationElement:()=>Zg,isParameterElement:()=>ey,isPathItemElement:()=>ty,isPathsElement:()=>ry,isReferenceElement:()=>ny,isRequestBodyElement:()=>oy,isResponseElement:()=>sy,isResponsesElement:()=>iy,isSchemaElement:()=>ay,isSecurityRequirementElement:()=>cy,isSecuritySchemeElement:()=>ly,isServerElement:()=>uy,isServerVariableElement:()=>py,isServersElement:()=>dy});var de={};__webpack_require__.r(de),__webpack_require__.d(de,{isBooleanJsonSchemaElement:()=>predicates_isBooleanJsonSchemaElement,isCallbackElement:()=>fE,isComponentsElement:()=>mE,isContactElement:()=>gE,isExampleElement:()=>yE,isExternalDocumentationElement:()=>vE,isHeaderElement:()=>bE,isInfoElement:()=>_E,isJsonSchemaDialectElement:()=>EE,isLicenseElement:()=>wE,isLinkElement:()=>SE,isMediaTypeElement:()=>FE,isOpenApi3_1Element:()=>kE,isOpenapiElement:()=>xE,isOperationElement:()=>OE,isParameterElement:()=>CE,isPathItemElement:()=>AE,isPathItemElementExternal:()=>isPathItemElementExternal,isPathsElement:()=>jE,isReferenceElement:()=>PE,isReferenceElementExternal:()=>isReferenceElementExternal,isRequestBodyElement:()=>IE,isResponseElement:()=>ME,isResponsesElement:()=>NE,isSchemaElement:()=>TE,isSecurityRequirementElement:()=>RE,isSecuritySchemeElement:()=>DE,isServerElement:()=>LE,isServerVariableElement:()=>BE});var fe={};__webpack_require__.r(fe),__webpack_require__.d(fe,{cookie:()=>parameter_builders_cookie,header:()=>parameter_builders_header,path:()=>parameter_builders_path,query:()=>parameter_builders_query});var ye={};__webpack_require__.r(ye),__webpack_require__.d(ye,{Button:()=>Button,Col:()=>Col,Collapse:()=>Collapse,Container:()=>Container,Input:()=>Input,Link:()=>layout_utils_Link,Row:()=>Row,Select:()=>Select,TextArea:()=>TextArea});var be={};__webpack_require__.r(be),__webpack_require__.d(be,{basePath:()=>OA,consumes:()=>CA,definitions:()=>wA,findDefinition:()=>EA,hasHost:()=>SA,host:()=>kA,produces:()=>AA,schemes:()=>jA,securityDefinitions:()=>xA,validOperationMethods:()=>wrap_selectors_validOperationMethods});var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{definitionsToAuthorize:()=>PA});var we={};__webpack_require__.r(we),__webpack_require__.d(we,{callbacksOperations:()=>NA,findSchema:()=>findSchema,isOAS3:()=>selectors_isOAS3,isOAS30:()=>selectors_isOAS30,isSwagger2:()=>selectors_isSwagger2,servers:()=>MA});var Se={};__webpack_require__.r(Se),__webpack_require__.d(Se,{CLEAR_REQUEST_BODY_VALIDATE_ERROR:()=>ZA,CLEAR_REQUEST_BODY_VALUE:()=>ej,SET_REQUEST_BODY_VALIDATE_ERROR:()=>QA,UPDATE_ACTIVE_EXAMPLES_MEMBER:()=>JA,UPDATE_REQUEST_BODY_INCLUSION:()=>HA,UPDATE_REQUEST_BODY_VALUE:()=>WA,UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG:()=>KA,UPDATE_REQUEST_CONTENT_TYPE:()=>GA,UPDATE_RESPONSE_CONTENT_TYPE:()=>YA,UPDATE_SELECTED_SERVER:()=>zA,UPDATE_SERVER_VARIABLE_VALUE:()=>XA,clearRequestBodyValidateError:()=>clearRequestBodyValidateError,clearRequestBodyValue:()=>clearRequestBodyValue,initRequestBodyValidateError:()=>initRequestBodyValidateError,setActiveExamplesMember:()=>setActiveExamplesMember,setRequestBodyInclusion:()=>setRequestBodyInclusion,setRequestBodyValidateError:()=>setRequestBodyValidateError,setRequestBodyValue:()=>setRequestBodyValue,setRequestContentType:()=>setRequestContentType,setResponseContentType:()=>setResponseContentType,setRetainRequestBodyValueFlag:()=>setRetainRequestBodyValueFlag,setSelectedServer:()=>setSelectedServer,setServerVariableValue:()=>setServerVariableValue});var xe={};__webpack_require__.r(xe),__webpack_require__.d(xe,{activeExamplesMember:()=>zj,hasUserEditedBody:()=>Nj,requestBodyErrors:()=>$j,requestBodyInclusionSetting:()=>Bj,requestBodyValue:()=>Cj,requestContentType:()=>Kj,responseContentType:()=>Jj,selectDefaultRequestBodyValue:()=>selectDefaultRequestBodyValue,selectedServer:()=>_j,serverEffectiveValue:()=>eP,serverVariableValue:()=>Gj,serverVariables:()=>Xj,shouldRetainRequestBodyValue:()=>Aj,validOperationMethods:()=>rP,validateBeforeExecute:()=>tP,validateShallowRequired:()=>validateShallowRequired});var Pe=__webpack_require__(96540);function formatProdErrorMessage(o){return`Minified Redux error #${o}; visit https://redux.js.org/Errors?code=${o} for the full message or use the non-minified dev environment for full errors. `}var Te=(()=>\"function\"==typeof Symbol&&Symbol.observable||\"@@observable\")(),randomString=()=>Math.random().toString(36).substring(7).split(\"\").join(\".\"),Re={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`};function isPlainObject(o){if(\"object\"!=typeof o||null===o)return!1;let s=o;for(;null!==Object.getPrototypeOf(s);)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(o)===s||null===Object.getPrototypeOf(o)}function createStore(o,s,i){if(\"function\"!=typeof o)throw new Error(formatProdErrorMessage(2));if(\"function\"==typeof s&&\"function\"==typeof i||\"function\"==typeof i&&\"function\"==typeof arguments[3])throw new Error(formatProdErrorMessage(0));if(\"function\"==typeof s&&void 0===i&&(i=s,s=void 0),void 0!==i){if(\"function\"!=typeof i)throw new Error(formatProdErrorMessage(1));return i(createStore)(o,s)}let u=o,_=s,w=new Map,x=w,C=0,j=!1;function ensureCanMutateNextListeners(){x===w&&(x=new Map,w.forEach(((o,s)=>{x.set(s,o)})))}function getState(){if(j)throw new Error(formatProdErrorMessage(3));return _}function subscribe(o){if(\"function\"!=typeof o)throw new Error(formatProdErrorMessage(4));if(j)throw new Error(formatProdErrorMessage(5));let s=!0;ensureCanMutateNextListeners();const i=C++;return x.set(i,o),function unsubscribe(){if(s){if(j)throw new Error(formatProdErrorMessage(6));s=!1,ensureCanMutateNextListeners(),x.delete(i),w=null}}}function dispatch(o){if(!isPlainObject(o))throw new Error(formatProdErrorMessage(7));if(void 0===o.type)throw new Error(formatProdErrorMessage(8));if(\"string\"!=typeof o.type)throw new Error(formatProdErrorMessage(17));if(j)throw new Error(formatProdErrorMessage(9));try{j=!0,_=u(_,o)}finally{j=!1}return(w=x).forEach((o=>{o()})),o}dispatch({type:Re.INIT});return{dispatch,subscribe,getState,replaceReducer:function replaceReducer(o){if(\"function\"!=typeof o)throw new Error(formatProdErrorMessage(10));u=o,dispatch({type:Re.REPLACE})},[Te]:function observable(){const o=subscribe;return{subscribe(s){if(\"object\"!=typeof s||null===s)throw new Error(formatProdErrorMessage(11));function observeState(){const o=s;o.next&&o.next(getState())}observeState();return{unsubscribe:o(observeState)}},[Te](){return this}}}}}function bindActionCreator(o,s){return function(...i){return s(o.apply(this,i))}}function compose(...o){return 0===o.length?o=>o:1===o.length?o[0]:o.reduce(((o,s)=>(...i)=>o(s(...i))))}var qe=__webpack_require__(9404),$e=__webpack_require__.n(qe),ze=__webpack_require__(81919),We=__webpack_require__.n(ze),He=__webpack_require__(89593),Ye=__webpack_require__(20334),Xe=__webpack_require__(55364),Qe=__webpack_require__.n(Xe);const et=\"err_new_thrown_err\",tt=\"err_new_thrown_err_batch\",rt=\"err_new_spec_err\",nt=\"err_new_spec_err_batch\",ot=\"err_new_auth_err\",st=\"err_clear\",it=\"err_clear_by\";function newThrownErr(o){return{type:et,payload:(0,Ye.serializeError)(o)}}function newThrownErrBatch(o){return{type:tt,payload:o}}function newSpecErr(o){return{type:rt,payload:o}}function newSpecErrBatch(o){return{type:nt,payload:o}}function newAuthErr(o){return{type:ot,payload:o}}function clear(o={}){return{type:st,payload:o}}function clearBy(o=(()=>!0)){return{type:it,payload:o}}const at=function makeWindow(){var o={location:{},history:{},open:()=>{},close:()=>{},File:function(){},FormData:function(){}};if(\"undefined\"==typeof window)return o;try{o=window;for(var s of[\"File\",\"Blob\",\"FormData\"])s in window&&(o[s]=window[s])}catch(o){console.error(o)}return o}();var ct=__webpack_require__(16750),lt=(__webpack_require__(84058),__webpack_require__(55808),__webpack_require__(50104)),ut=__webpack_require__.n(lt),pt=__webpack_require__(7309),ht=__webpack_require__.n(pt),dt=__webpack_require__(42426),mt=__webpack_require__.n(dt),gt=__webpack_require__(75288),yt=__webpack_require__.n(gt),vt=__webpack_require__(1882),bt=__webpack_require__.n(vt),_t=__webpack_require__(2205),Et=__webpack_require__.n(_t),wt=__webpack_require__(53209),St=__webpack_require__.n(wt),xt=__webpack_require__(62802),kt=__webpack_require__.n(xt);const Ot=$e().Set.of(\"type\",\"format\",\"items\",\"default\",\"maximum\",\"exclusiveMaximum\",\"minimum\",\"exclusiveMinimum\",\"maxLength\",\"minLength\",\"pattern\",\"maxItems\",\"minItems\",\"uniqueItems\",\"enum\",\"multipleOf\");function getParameterSchema(o,{isOAS3:s}={}){if(!$e().Map.isMap(o))return{schema:$e().Map(),parameterContentMediaType:null};if(!s)return\"body\"===o.get(\"in\")?{schema:o.get(\"schema\",$e().Map()),parameterContentMediaType:null}:{schema:o.filter(((o,s)=>Ot.includes(s))),parameterContentMediaType:null};if(o.get(\"content\")){const s=o.get(\"content\",$e().Map({})).keySeq().first();return{schema:o.getIn([\"content\",s,\"schema\"],$e().Map()),parameterContentMediaType:s}}return{schema:o.get(\"schema\")?o.get(\"schema\",$e().Map()):$e().Map(),parameterContentMediaType:null}}var Ct=__webpack_require__(48287).Buffer;const At=\"default\",isImmutable=o=>$e().Iterable.isIterable(o);function objectify(o){return isObject(o)?isImmutable(o)?o.toJS():o:{}}function fromJSOrdered(o){if(isImmutable(o))return o;if(o instanceof at.File)return o;if(!isObject(o))return o;if(Array.isArray(o))return $e().Seq(o).map(fromJSOrdered).toList();if(bt()(o.entries)){const s=function createObjWithHashedKeys(o){if(!bt()(o.entries))return o;const s={},i=\"_**[]\",u={};for(let _ of o.entries())if(s[_[0]]||u[_[0]]&&u[_[0]].containsMultiple){if(!u[_[0]]){u[_[0]]={containsMultiple:!0,length:1},s[`${_[0]}${i}${u[_[0]].length}`]=s[_[0]],delete s[_[0]]}u[_[0]].length+=1,s[`${_[0]}${i}${u[_[0]].length}`]=_[1]}else s[_[0]]=_[1];return s}(o);return $e().OrderedMap(s).map(fromJSOrdered)}return $e().OrderedMap(o).map(fromJSOrdered)}function normalizeArray(o){return Array.isArray(o)?o:[o]}function isFn(o){return\"function\"==typeof o}function isObject(o){return!!o&&\"object\"==typeof o}function isFunc(o){return\"function\"==typeof o}function isArray(o){return Array.isArray(o)}const jt=ut();function objMap(o,s){return Object.keys(o).reduce(((i,u)=>(i[u]=s(o[u],u),i)),{})}function objReduce(o,s){return Object.keys(o).reduce(((i,u)=>{let _=s(o[u],u);return _&&\"object\"==typeof _&&Object.assign(i,_),i}),{})}function systemThunkMiddleware(o){return({dispatch:s,getState:i})=>s=>i=>\"function\"==typeof i?i(o()):s(i)}function validateValueBySchema(o,s,i,u,_){if(!s)return[];let w=[],x=s.get(\"nullable\"),C=s.get(\"required\"),j=s.get(\"maximum\"),L=s.get(\"minimum\"),B=s.get(\"type\"),$=s.get(\"format\"),V=s.get(\"maxLength\"),U=s.get(\"minLength\"),z=s.get(\"uniqueItems\"),Y=s.get(\"maxItems\"),Z=s.get(\"minItems\"),ee=s.get(\"pattern\");const ie=i||!0===C,ae=null!=o,ce=ie||ae&&\"array\"===B||!(!ie&&!ae),le=x&&null===o;if(ie&&!ae&&!le&&!u&&!B)return w.push(\"Required field is not provided\"),w;if(le||!B||!ce)return[];let pe=\"string\"===B&&o,de=\"array\"===B&&Array.isArray(o)&&o.length,fe=\"array\"===B&&$e().List.isList(o)&&o.count();const ye=[pe,de,fe,\"array\"===B&&\"string\"==typeof o&&o,\"file\"===B&&o instanceof at.File,\"boolean\"===B&&(o||!1===o),\"number\"===B&&(o||0===o),\"integer\"===B&&(o||0===o),\"object\"===B&&\"object\"==typeof o&&null!==o,\"object\"===B&&\"string\"==typeof o&&o].some((o=>!!o));if(ie&&!ye&&!u)return w.push(\"Required field is not provided\"),w;if(\"object\"===B&&(null===_||\"application/json\"===_)){let i=o;if(\"string\"==typeof o)try{i=JSON.parse(o)}catch(o){return w.push(\"Parameter string value must be valid JSON\"),w}s&&s.has(\"required\")&&isFunc(C.isList)&&C.isList()&&C.forEach((o=>{void 0===i[o]&&w.push({propKey:o,error:\"Required property not found\"})})),s&&s.has(\"properties\")&&s.get(\"properties\").forEach(((o,s)=>{const x=validateValueBySchema(i[s],o,!1,u,_);w.push(...x.map((o=>({propKey:s,error:o}))))}))}if(ee){let s=((o,s)=>{if(!new RegExp(s).test(o))return\"Value must follow pattern \"+s})(o,ee);s&&w.push(s)}if(Z&&\"array\"===B){let s=((o,s)=>{if(!o&&s>=1||o&&o.length<s)return`Array must contain at least ${s} item${1===s?\"\":\"s\"}`})(o,Z);s&&w.push(s)}if(Y&&\"array\"===B){let s=((o,s)=>{if(o&&o.length>s)return`Array must not contain more then ${s} item${1===s?\"\":\"s\"}`})(o,Y);s&&w.push({needRemove:!0,error:s})}if(z&&\"array\"===B){let s=((o,s)=>{if(o&&(\"true\"===s||!0===s)){const s=(0,qe.fromJS)(o),i=s.toSet();if(o.length>i.size){let o=(0,qe.Set)();if(s.forEach(((i,u)=>{s.filter((o=>isFunc(o.equals)?o.equals(i):o===i)).size>1&&(o=o.add(u))})),0!==o.size)return o.map((o=>({index:o,error:\"No duplicates allowed.\"}))).toArray()}}})(o,z);s&&w.push(...s)}if(V||0===V){let s=((o,s)=>{if(o.length>s)return`Value must be no longer than ${s} character${1!==s?\"s\":\"\"}`})(o,V);s&&w.push(s)}if(U){let s=((o,s)=>{if(o.length<s)return`Value must be at least ${s} character${1!==s?\"s\":\"\"}`})(o,U);s&&w.push(s)}if(j||0===j){let s=((o,s)=>{if(o>s)return`Value must be less than ${s}`})(o,j);s&&w.push(s)}if(L||0===L){let s=((o,s)=>{if(o<s)return`Value must be greater than ${s}`})(o,L);s&&w.push(s)}if(\"string\"===B){let s;if(s=\"date-time\"===$?(o=>{if(isNaN(Date.parse(o)))return\"Value must be a DateTime\"})(o):\"uuid\"===$?(o=>{if(o=o.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(o))return\"Value must be a Guid\"})(o):(o=>{if(o&&\"string\"!=typeof o)return\"Value must be a string\"})(o),!s)return w;w.push(s)}else if(\"boolean\"===B){let s=(o=>{if(\"true\"!==o&&\"false\"!==o&&!0!==o&&!1!==o)return\"Value must be a boolean\"})(o);if(!s)return w;w.push(s)}else if(\"number\"===B){let s=(o=>{if(!/^-?\\d+(\\.?\\d+)?$/.test(o))return\"Value must be a number\"})(o);if(!s)return w;w.push(s)}else if(\"integer\"===B){let s=(o=>{if(!/^-?\\d+$/.test(o))return\"Value must be an integer\"})(o);if(!s)return w;w.push(s)}else if(\"array\"===B){if(!de&&!fe)return w;o&&o.forEach(((o,i)=>{const x=validateValueBySchema(o,s.get(\"items\"),!1,u,_);w.push(...x.map((o=>({index:i,error:o}))))}))}else if(\"file\"===B){let s=(o=>{if(o&&!(o instanceof at.File))return\"Value must be a file\"})(o);if(!s)return w;w.push(s)}return w}const utils_btoa=o=>{let s;return s=o instanceof Ct?o:Ct.from(o.toString(),\"utf-8\"),s.toString(\"base64\")},Pt={operationsSorter:{alpha:(o,s)=>o.get(\"path\").localeCompare(s.get(\"path\")),method:(o,s)=>o.get(\"method\").localeCompare(s.get(\"method\"))},tagsSorter:{alpha:(o,s)=>o.localeCompare(s)}},buildFormData=o=>{let s=[];for(let i in o){let u=o[i];void 0!==u&&\"\"!==u&&s.push([i,\"=\",encodeURIComponent(u).replace(/%20/g,\"+\")].join(\"\"))}return s.join(\"&\")},shallowEqualKeys=(o,s,i)=>!!ht()(i,(i=>yt()(o[i],s[i])));function sanitizeUrl(o){return\"string\"!=typeof o||\"\"===o?\"\":(0,ct.J)(o)}function requiresValidationURL(o){return!(!o||o.indexOf(\"localhost\")>=0||o.indexOf(\"127.0.0.1\")>=0||\"none\"===o)}const createDeepLinkPath=o=>\"string\"==typeof o||o instanceof String?o.trim().replace(/\\s/g,\"%20\"):\"\",escapeDeepLinkPath=o=>Et()(createDeepLinkPath(o).replace(/%20/g,\"_\")),getExtensions=o=>o.filter(((o,s)=>/^x-/.test(s))),getCommonExtensions=o=>o.filter(((o,s)=>/^pattern|maxLength|minLength|maximum|minimum/.test(s)));function deeplyStripKey(o,s,i=(()=>!0)){if(\"object\"!=typeof o||Array.isArray(o)||null===o||!s)return o;const u=Object.assign({},o);return Object.keys(u).forEach((o=>{o===s&&i(u[o],o)?delete u[o]:u[o]=deeplyStripKey(u[o],s,i)})),u}function stringify(o){if(\"string\"==typeof o)return o;if(o&&o.toJS&&(o=o.toJS()),\"object\"==typeof o&&null!==o)try{return JSON.stringify(o,null,2)}catch(s){return String(o)}return null==o?\"\":o.toString()}function paramToIdentifier(o,{returnAll:s=!1,allowHashes:i=!0}={}){if(!$e().Map.isMap(o))throw new Error(\"paramToIdentifier: received a non-Im.Map parameter as input\");const u=o.get(\"name\"),_=o.get(\"in\");let w=[];return o&&o.hashCode&&_&&u&&i&&w.push(`${_}.${u}.hash-${o.hashCode()}`),_&&u&&w.push(`${_}.${u}`),w.push(u),s?w:w[0]||\"\"}function paramToValue(o,s){return paramToIdentifier(o,{returnAll:!0}).map((o=>s[o])).filter((o=>void 0!==o))[0]}function b64toB64UrlEncoded(o){return o.replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=/g,\"\")}const isEmptyValue=o=>!o||!(!isImmutable(o)||!o.isEmpty()),idFn=o=>o;function createStoreWithMiddleware(o,s,i){let u=[systemThunkMiddleware(i)];return createStore(o,s,(at.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||compose)(function applyMiddleware(...o){return s=>(i,u)=>{const _=s(i,u);let dispatch=()=>{throw new Error(formatProdErrorMessage(15))};const w={getState:_.getState,dispatch:(o,...s)=>dispatch(o,...s)},x=o.map((o=>o(w)));return dispatch=compose(...x)(_.dispatch),{..._,dispatch}}}(...u)))}class Store{constructor(o={}){We()(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},o),this.getSystem=this._getSystem.bind(this),this.store=function configureStore(o,s,i){return createStoreWithMiddleware(o,s,i)}(idFn,(0,qe.fromJS)(this.state),this.getSystem),this.buildSystem(!1),this.register(this.plugins)}getStore(){return this.store}register(o,s=!0){var i=combinePlugins(o,this.getSystem());systemExtend(this.system,i),s&&this.buildSystem();callAfterLoad.call(this.system,o,this.getSystem())&&this.buildSystem()}buildSystem(o=!0){let s=this.getStore().dispatch,i=this.getStore().getState;this.boundSystem=Object.assign({},this.getRootInjects(),this.getWrappedAndBoundActions(s),this.getWrappedAndBoundSelectors(i,this.getSystem),this.getStateThunks(i),this.getFn(),this.getConfigs()),o&&this.rebuildReducer()}_getSystem(){return this.boundSystem}getRootInjects(){return Object.assign({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:$e(),React:Pe},this.system.rootInjects||{})}_getConfigs(){return this.system.configs}getConfigs(){return{configs:this.system.configs}}setConfigs(o){this.system.configs=o}rebuildReducer(){this.store.replaceReducer(function buildReducer(o){return function allReducers(o){let s=Object.keys(o).reduce(((s,i)=>(s[i]=function makeReducer(o){return(s=new qe.Map,i)=>{if(!o)return s;let u=o[i.type];if(u){const o=wrapWithTryCatch(u)(s,i);return null===o?s:o}return s}}(o[i]),s)),{});if(!Object.keys(s).length)return idFn;return(0,He.H)(s)}(objMap(o,(o=>o.reducers)))}(this.system.statePlugins))}getType(o){let s=o[0].toUpperCase()+o.slice(1);return objReduce(this.system.statePlugins,((i,u)=>{let _=i[o];if(_)return{[u+s]:_}}))}getSelectors(){return this.getType(\"selectors\")}getActions(){return objMap(this.getType(\"actions\"),(o=>objReduce(o,((o,s)=>{if(isFn(o))return{[s]:o}}))))}getWrappedAndBoundActions(o){return objMap(this.getBoundActions(o),((o,s)=>{let i=this.system.statePlugins[s.slice(0,-7)].wrapActions;return i?objMap(o,((o,s)=>{let u=i[s];return u?(Array.isArray(u)||(u=[u]),u.reduce(((o,s)=>{let newAction=(...i)=>s(o,this.getSystem())(...i);if(!isFn(newAction))throw new TypeError(\"wrapActions needs to return a function that returns a new function (ie the wrapped action)\");return wrapWithTryCatch(newAction)}),o||Function.prototype)):o})):o}))}getWrappedAndBoundSelectors(o,s){return objMap(this.getBoundSelectors(o,s),((s,i)=>{let u=[i.slice(0,-9)],_=this.system.statePlugins[u].wrapSelectors;return _?objMap(s,((s,i)=>{let w=_[i];return w?(Array.isArray(w)||(w=[w]),w.reduce(((s,i)=>{let wrappedSelector=(..._)=>i(s,this.getSystem())(o().getIn(u),..._);if(!isFn(wrappedSelector))throw new TypeError(\"wrapSelector needs to return a function that returns a new function (ie the wrapped action)\");return wrappedSelector}),s||Function.prototype)):s})):s}))}getStates(o){return Object.keys(this.system.statePlugins).reduce(((s,i)=>(s[i]=o.get(i),s)),{})}getStateThunks(o){return Object.keys(this.system.statePlugins).reduce(((s,i)=>(s[i]=()=>o().get(i),s)),{})}getFn(){return{fn:this.system.fn}}getComponents(o){const s=this.system.components[o];return Array.isArray(s)?s.reduce(((o,s)=>s(o,this.getSystem()))):void 0!==o?this.system.components[o]:this.system.components}getBoundSelectors(o,s){return objMap(this.getSelectors(),((i,u)=>{let _=[u.slice(0,-9)];return objMap(i,(i=>(...u)=>{let w=wrapWithTryCatch(i).apply(null,[o().getIn(_),...u]);return\"function\"==typeof w&&(w=wrapWithTryCatch(w)(s())),w}))}))}getBoundActions(o){o=o||this.getStore().dispatch;const s=this.getActions(),process=o=>\"function\"!=typeof o?objMap(o,(o=>process(o))):(...s)=>{var i=null;try{i=o(...s)}catch(o){i={type:et,error:!0,payload:(0,Ye.serializeError)(o)}}finally{return i}};return objMap(s,(s=>function bindActionCreators(o,s){if(\"function\"==typeof o)return bindActionCreator(o,s);if(\"object\"!=typeof o||null===o)throw new Error(formatProdErrorMessage(16));const i={};for(const u in o){const _=o[u];\"function\"==typeof _&&(i[u]=bindActionCreator(_,s))}return i}(process(s),o)))}getMapStateToProps(){return()=>Object.assign({},this.getSystem())}getMapDispatchToProps(o){return s=>We()({},this.getWrappedAndBoundActions(s),this.getFn(),o)}}function combinePlugins(o,s){return isObject(o)&&!isArray(o)?Qe()({},o):isFunc(o)?combinePlugins(o(s),s):isArray(o)?o.map((o=>combinePlugins(o,s))).reduce(systemExtend,{components:s.getComponents()}):{}}function callAfterLoad(o,s,{hasLoaded:i}={}){let u=i;return isObject(o)&&!isArray(o)&&\"function\"==typeof o.afterLoad&&(u=!0,wrapWithTryCatch(o.afterLoad).call(this,s)),isFunc(o)?callAfterLoad.call(this,o(s),s,{hasLoaded:u}):isArray(o)?o.map((o=>callAfterLoad.call(this,o,s,{hasLoaded:u}))):u}function systemExtend(o={},s={}){if(!isObject(o))return{};if(!isObject(s))return o;s.wrapComponents&&(objMap(s.wrapComponents,((i,u)=>{const _=o.components&&o.components[u];_&&Array.isArray(_)?(o.components[u]=_.concat([i]),delete s.wrapComponents[u]):_&&(o.components[u]=[_,i],delete s.wrapComponents[u])})),Object.keys(s.wrapComponents).length||delete s.wrapComponents);const{statePlugins:i}=o;if(isObject(i))for(let o in i){const u=i[o];if(!isObject(u))continue;const{wrapActions:_,wrapSelectors:w}=u;if(isObject(_))for(let i in _){let u=_[i];Array.isArray(u)||(u=[u],_[i]=u),s&&s.statePlugins&&s.statePlugins[o]&&s.statePlugins[o].wrapActions&&s.statePlugins[o].wrapActions[i]&&(s.statePlugins[o].wrapActions[i]=_[i].concat(s.statePlugins[o].wrapActions[i]))}if(isObject(w))for(let i in w){let u=w[i];Array.isArray(u)||(u=[u],w[i]=u),s&&s.statePlugins&&s.statePlugins[o]&&s.statePlugins[o].wrapSelectors&&s.statePlugins[o].wrapSelectors[i]&&(s.statePlugins[o].wrapSelectors[i]=w[i].concat(s.statePlugins[o].wrapSelectors[i]))}}return We()(o,s)}function wrapWithTryCatch(o,{logErrors:s=!0}={}){return\"function\"!=typeof o?o:function(...i){try{return o.call(this,...i)}catch(o){return s&&console.error(o),null}}}var It=__webpack_require__(61160),Mt=__webpack_require__.n(It);const Nt=\"show_popup\",Tt=\"authorize\",Rt=\"logout\",Dt=\"pre_authorize_oauth2\",Lt=\"authorize_oauth2\",Bt=\"validate\",Ft=\"configure_auth\",qt=\"restore_authorization\";function showDefinitions(o){return{type:Nt,payload:o}}function authorize(o){return{type:Tt,payload:o}}const authorizeWithPersistOption=o=>({authActions:s})=>{s.authorize(o),s.persistAuthorizationIfNeeded()};function logout(o){return{type:Rt,payload:o}}const logoutWithPersistOption=o=>({authActions:s})=>{s.logout(o),s.persistAuthorizationIfNeeded()},preAuthorizeImplicit=o=>({authActions:s,errActions:i})=>{let{auth:u,token:_,isValid:w}=o,{schema:x,name:C}=u,j=x.get(\"flow\");delete at.swaggerUIRedirectOauth2,\"accessCode\"===j||w||i.newAuthErr({authId:C,source:\"auth\",level:\"warning\",message:\"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server\"}),_.error?i.newAuthErr({authId:C,source:\"auth\",level:\"error\",message:JSON.stringify(_)}):s.authorizeOauth2WithPersistOption({auth:u,token:_})};function authorizeOauth2(o){return{type:Lt,payload:o}}const authorizeOauth2WithPersistOption=o=>({authActions:s})=>{s.authorizeOauth2(o),s.persistAuthorizationIfNeeded()},authorizePassword=o=>({authActions:s})=>{let{schema:i,name:u,username:_,password:w,passwordType:x,clientId:C,clientSecret:j}=o,L={grant_type:\"password\",scope:o.scopes.join(\" \"),username:_,password:w},B={};switch(x){case\"request-body\":!function setClientIdAndSecret(o,s,i){s&&Object.assign(o,{client_id:s});i&&Object.assign(o,{client_secret:i})}(L,C,j);break;case\"basic\":B.Authorization=\"Basic \"+utils_btoa(C+\":\"+j);break;default:console.warn(`Warning: invalid passwordType ${x} was passed, not including client id and secret`)}return s.authorizeRequest({body:buildFormData(L),url:i.get(\"tokenUrl\"),name:u,headers:B,query:{},auth:o})};const authorizeApplication=o=>({authActions:s})=>{let{schema:i,scopes:u,name:_,clientId:w,clientSecret:x}=o,C={Authorization:\"Basic \"+utils_btoa(w+\":\"+x)},j={grant_type:\"client_credentials\",scope:u.join(\" \")};return s.authorizeRequest({body:buildFormData(j),name:_,url:i.get(\"tokenUrl\"),auth:o,headers:C})},authorizeAccessCodeWithFormParams=({auth:o,redirectUrl:s})=>({authActions:i})=>{let{schema:u,name:_,clientId:w,clientSecret:x,codeVerifier:C}=o,j={grant_type:\"authorization_code\",code:o.code,client_id:w,client_secret:x,redirect_uri:s,code_verifier:C};return i.authorizeRequest({body:buildFormData(j),name:_,url:u.get(\"tokenUrl\"),auth:o})},authorizeAccessCodeWithBasicAuthentication=({auth:o,redirectUrl:s})=>({authActions:i})=>{let{schema:u,name:_,clientId:w,clientSecret:x,codeVerifier:C}=o,j={Authorization:\"Basic \"+utils_btoa(w+\":\"+x)},L={grant_type:\"authorization_code\",code:o.code,client_id:w,redirect_uri:s,code_verifier:C};return i.authorizeRequest({body:buildFormData(L),name:_,url:u.get(\"tokenUrl\"),auth:o,headers:j})},authorizeRequest=o=>({fn:s,getConfigs:i,authActions:u,errActions:_,oas3Selectors:w,specSelectors:x,authSelectors:C})=>{let j,{body:L,query:B={},headers:$={},name:V,url:U,auth:z}=o,{additionalQueryStringParams:Y}=C.getConfigs()||{};if(x.isOAS3()){let o=w.serverEffectiveValue(w.selectedServer());j=Mt()(U,o,!0)}else j=Mt()(U,x.url(),!0);\"object\"==typeof Y&&(j.query=Object.assign({},j.query,Y));const Z=j.toString();let ee=Object.assign({Accept:\"application/json, text/plain, */*\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"X-Requested-With\":\"XMLHttpRequest\"},$);s.fetch({url:Z,method:\"post\",headers:ee,query:B,body:L,requestInterceptor:i().requestInterceptor,responseInterceptor:i().responseInterceptor}).then((function(o){let s=JSON.parse(o.data),i=s&&(s.error||\"\"),w=s&&(s.parseError||\"\");o.ok?i||w?_.newAuthErr({authId:V,level:\"error\",source:\"auth\",message:JSON.stringify(s)}):u.authorizeOauth2WithPersistOption({auth:z,token:s}):_.newAuthErr({authId:V,level:\"error\",source:\"auth\",message:o.statusText})})).catch((o=>{let s=new Error(o).message;if(o.response&&o.response.data){const i=o.response.data;try{const o=\"string\"==typeof i?JSON.parse(i):i;o.error&&(s+=`, error: ${o.error}`),o.error_description&&(s+=`, description: ${o.error_description}`)}catch(o){}}_.newAuthErr({authId:V,level:\"error\",source:\"auth\",message:s})}))};function configureAuth(o){return{type:Ft,payload:o}}function restoreAuthorization(o){return{type:qt,payload:o}}const persistAuthorizationIfNeeded=()=>({authSelectors:o,getConfigs:s})=>{if(!s().persistAuthorization)return;const i=o.authorized().toJS();localStorage.setItem(\"authorized\",JSON.stringify(i))},authPopup=(o,s)=>()=>{at.swaggerUIRedirectOauth2=s,at.open(o)},$t={[Nt]:(o,{payload:s})=>o.set(\"showDefinitions\",s),[Tt]:(o,{payload:s})=>{let i=(0,qe.fromJS)(s),u=o.get(\"authorized\")||(0,qe.Map)();return i.entrySeq().forEach((([s,i])=>{if(!isFunc(i.getIn))return o.set(\"authorized\",u);let _=i.getIn([\"schema\",\"type\"]);if(\"apiKey\"===_||\"http\"===_)u=u.set(s,i);else if(\"basic\"===_){let o=i.getIn([\"value\",\"username\"]),_=i.getIn([\"value\",\"password\"]);u=u.setIn([s,\"value\"],{username:o,header:\"Basic \"+utils_btoa(o+\":\"+_)}),u=u.setIn([s,\"schema\"],i.get(\"schema\"))}})),o.set(\"authorized\",u)},[Lt]:(o,{payload:s})=>{let i,{auth:u,token:_}=s;u.token=Object.assign({},_),i=(0,qe.fromJS)(u);let w=o.get(\"authorized\")||(0,qe.Map)();return w=w.set(i.get(\"name\"),i),o.set(\"authorized\",w)},[Rt]:(o,{payload:s})=>{let i=o.get(\"authorized\").withMutations((o=>{s.forEach((s=>{o.delete(s)}))}));return o.set(\"authorized\",i)},[Ft]:(o,{payload:s})=>o.set(\"configs\",s),[qt]:(o,{payload:s})=>o.set(\"authorized\",(0,qe.fromJS)(s.authorized))};function assertIsFunction(o,s=\"expected a function, instead received \"+typeof o){if(\"function\"!=typeof o)throw new TypeError(s)}var ensureIsArray=o=>Array.isArray(o)?o:[o];function getDependencies(o){const s=Array.isArray(o[0])?o[0]:o;return function assertIsArrayOfFunctions(o,s=\"expected all items to be functions, instead received the following types: \"){if(!o.every((o=>\"function\"==typeof o))){const i=o.map((o=>\"function\"==typeof o?`function ${o.name||\"unnamed\"}()`:typeof o)).join(\", \");throw new TypeError(`${s}[${i}]`)}}(s,\"createSelector expects all input-selectors to be functions, but received the following types: \"),s}Symbol(),Object.getPrototypeOf({});var Vt=\"undefined\"!=typeof WeakRef?WeakRef:class{constructor(o){this.value=o}deref(){return this.value}},Ut=0,zt=1;function createCacheNode(){return{s:Ut,v:void 0,o:null,p:null}}function weakMapMemoize(o,s={}){let i=createCacheNode();const{resultEqualityCheck:u}=s;let _,w=0;function memoized(){let s=i;const{length:x}=arguments;for(let o=0,i=x;o<i;o++){const i=arguments[o];if(\"function\"==typeof i||\"object\"==typeof i&&null!==i){let o=s.o;null===o&&(s.o=o=new WeakMap);const u=o.get(i);void 0===u?(s=createCacheNode(),o.set(i,s)):s=u}else{let o=s.p;null===o&&(s.p=o=new Map);const u=o.get(i);void 0===u?(s=createCacheNode(),o.set(i,s)):s=u}}const C=s;let j;if(s.s===zt?j=s.v:(j=o.apply(null,arguments),w++),C.s=zt,u){const o=_?.deref?.()??_;null!=o&&u(o,j)&&(j=o,0!==w&&w--);_=\"object\"==typeof j&&null!==j||\"function\"==typeof j?new Vt(j):j}return C.v=j,j}return memoized.clearCache=()=>{i=createCacheNode(),memoized.resetResultsCount()},memoized.resultsCount=()=>w,memoized.resetResultsCount=()=>{w=0},memoized}function createSelectorCreator(o,...s){const i=\"function\"==typeof o?{memoize:o,memoizeOptions:s}:o,createSelector2=(...o)=>{let s,u=0,_=0,w={},x=o.pop();\"object\"==typeof x&&(w=x,x=o.pop()),assertIsFunction(x,`createSelector expects an output function after the inputs, but received: [${typeof x}]`);const C={...i,...w},{memoize:j,memoizeOptions:L=[],argsMemoize:B=weakMapMemoize,argsMemoizeOptions:$=[],devModeChecks:V={}}=C,U=ensureIsArray(L),z=ensureIsArray($),Y=getDependencies(o),Z=j((function recomputationWrapper(){return u++,x.apply(null,arguments)}),...U);const ee=B((function dependenciesChecker(){_++;const o=function collectInputSelectorResults(o,s){const i=[],{length:u}=o;for(let _=0;_<u;_++)i.push(o[_].apply(null,s));return i}(Y,arguments);return s=Z.apply(null,o),s}),...z);return Object.assign(ee,{resultFunc:x,memoizedResultFunc:Z,dependencies:Y,dependencyRecomputations:()=>_,resetDependencyRecomputations:()=>{_=0},lastResult:()=>s,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:j,argsMemoize:B})};return Object.assign(createSelector2,{withTypes:()=>createSelector2}),createSelector2}var Wt=createSelectorCreator(weakMapMemoize),Kt=Object.assign(((o,s=Wt)=>{!function assertIsObject(o,s=\"expected an object, instead received \"+typeof o){if(\"object\"!=typeof o)throw new TypeError(s)}(o,\"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a \"+typeof o);const i=Object.keys(o);return s(i.map((s=>o[s])),((...o)=>o.reduce(((o,s,u)=>(o[i[u]]=s,o)),{})))}),{withTypes:()=>Kt});const state=o=>o,Ht=Wt(state,(o=>o.get(\"showDefinitions\"))),Jt=Wt(state,(()=>({specSelectors:o})=>{let s=o.securityDefinitions()||(0,qe.Map)({}),i=(0,qe.List)();return s.entrySeq().forEach((([o,s])=>{let u=(0,qe.Map)();u=u.set(o,s),i=i.push(u)})),i})),getDefinitionsByNames=(o,s)=>({specSelectors:o})=>{console.warn(\"WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.\");let i=o.securityDefinitions(),u=(0,qe.List)();return s.valueSeq().forEach((o=>{let s=(0,qe.Map)();o.entrySeq().forEach((([o,u])=>{let _,w=i.get(o);\"oauth2\"===w.get(\"type\")&&u.size&&(_=w.get(\"scopes\"),_.keySeq().forEach((o=>{u.contains(o)||(_=_.delete(o))})),w=w.set(\"allowedScopes\",_)),s=s.set(o,w)})),u=u.push(s)})),u},definitionsForRequirements=(o,s=(0,qe.List)())=>({authSelectors:o})=>{const i=o.definitionsToAuthorize()||(0,qe.List)();let u=(0,qe.List)();return i.forEach((o=>{let i=s.find((s=>s.get(o.keySeq().first())));i&&(o.forEach(((s,u)=>{if(\"oauth2\"===s.get(\"type\")){const _=i.get(u);let w=s.get(\"scopes\");qe.List.isList(_)&&qe.Map.isMap(w)&&(w.keySeq().forEach((o=>{_.contains(o)||(w=w.delete(o))})),o=o.set(u,s.set(\"scopes\",w)))}})),u=u.push(o))})),u},Gt=Wt(state,(o=>o.get(\"authorized\")||(0,qe.Map)())),isAuthorized=(o,s)=>({authSelectors:o})=>{let i=o.authorized();return qe.List.isList(s)?!!s.toJS().filter((o=>-1===Object.keys(o).map((o=>!!i.get(o))).indexOf(!1))).length:null},Yt=Wt(state,(o=>o.get(\"configs\"))),execute=(o,{authSelectors:s,specSelectors:i})=>({path:u,method:_,operation:w,extras:x})=>{let C={authorized:s.authorized()&&s.authorized().toJS(),definitions:i.securityDefinitions()&&i.securityDefinitions().toJS(),specSecurity:i.security()&&i.security().toJS()};return o({path:u,method:_,operation:w,securities:C,...x})},loaded=(o,s)=>i=>{const{getConfigs:u,authActions:_}=s,w=u();if(o(i),w.persistAuthorization){const o=localStorage.getItem(\"authorized\");o&&_.restoreAuthorization({authorized:JSON.parse(o)})}},wrap_actions_authorize=(o,s)=>i=>{o(i);if(s.getConfigs().persistAuthorization)try{const[{schema:o,value:s}]=Object.values(i),u=\"apiKey\"===o.get(\"type\"),_=\"cookie\"===o.get(\"in\");u&&_&&(document.cookie=`${o.get(\"name\")}=${s}; SameSite=None; Secure`)}catch(o){console.error(\"Error persisting cookie based apiKey in document.cookie.\",o)}},wrap_actions_logout=(o,s)=>i=>{const u=s.getConfigs(),_=s.authSelectors.authorized();try{u.persistAuthorization&&Array.isArray(i)&&i.forEach((o=>{const s=_.get(o,{}),i=\"apiKey\"===s.getIn([\"schema\",\"type\"]),u=\"cookie\"===s.getIn([\"schema\",\"in\"]);if(i&&u){const o=s.getIn([\"schema\",\"name\"]);document.cookie=`${o}=; Max-Age=-99999999`}}))}catch(o){console.error(\"Error deleting cookie based apiKey from document.cookie.\",o)}o(i)};var Xt=__webpack_require__(90179),Qt=__webpack_require__.n(Xt);class LockAuthIcon extends Pe.Component{mapStateToProps(o,s){return{state:o,ownProps:Qt()(s,Object.keys(s.getSystem()))}}render(){const{getComponent:o,ownProps:s}=this.props,i=o(\"LockIcon\");return Pe.createElement(i,s)}}const Zt=LockAuthIcon;class UnlockAuthIcon extends Pe.Component{mapStateToProps(o,s){return{state:o,ownProps:Qt()(s,Object.keys(s.getSystem()))}}render(){const{getComponent:o,ownProps:s}=this.props,i=o(\"UnlockIcon\");return Pe.createElement(i,s)}}const er=UnlockAuthIcon;function auth(){return{afterLoad(o){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=o.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=preauthorizeApiKey.bind(null,o),this.rootInjects.preauthorizeBasic=preauthorizeBasic.bind(null,o)},components:{LockAuthIcon:Zt,UnlockAuthIcon:er,LockAuthOperationIcon:Zt,UnlockAuthOperationIcon:er},statePlugins:{auth:{reducers:$t,actions:s,selectors:i,wrapActions:{authorize:wrap_actions_authorize,logout:wrap_actions_logout}},configs:{wrapActions:{loaded}},spec:{wrapActions:{execute}}}}}function preauthorizeBasic(o,s,i,u){const{authActions:{authorize:_},specSelectors:{specJson:w,isOAS3:x}}=o,C=x()?[\"components\",\"securitySchemes\"]:[\"securityDefinitions\"],j=w().getIn([...C,s]);return j?_({[s]:{value:{username:i,password:u},schema:j.toJS()}}):null}function preauthorizeApiKey(o,s,i){const{authActions:{authorize:u},specSelectors:{specJson:_,isOAS3:w}}=o,x=w()?[\"components\",\"securitySchemes\"]:[\"securityDefinitions\"],C=_().getIn([...x,s]);return C?u({[s]:{value:i,schema:C.toJS()}}):null}function isNothing(o){return null==o}var tr=function repeat(o,s){var i,u=\"\";for(i=0;i<s;i+=1)u+=o;return u},rr=function isNegativeZero(o){return 0===o&&Number.NEGATIVE_INFINITY===1/o},nr={isNothing,isObject:function js_yaml_isObject(o){return\"object\"==typeof o&&null!==o},toArray:function toArray(o){return Array.isArray(o)?o:isNothing(o)?[]:[o]},repeat:tr,isNegativeZero:rr,extend:function extend(o,s){var i,u,_,w;if(s)for(i=0,u=(w=Object.keys(s)).length;i<u;i+=1)o[_=w[i]]=s[_];return o}};function formatError(o,s){var i=\"\",u=o.reason||\"(unknown reason)\";return o.mark?(o.mark.name&&(i+='in \"'+o.mark.name+'\" '),i+=\"(\"+(o.mark.line+1)+\":\"+(o.mark.column+1)+\")\",!s&&o.mark.snippet&&(i+=\"\\n\\n\"+o.mark.snippet),u+\" \"+i):u}function YAMLException$1(o,s){Error.call(this),this.name=\"YAMLException\",this.reason=o,this.mark=s,this.message=formatError(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||\"\"}YAMLException$1.prototype=Object.create(Error.prototype),YAMLException$1.prototype.constructor=YAMLException$1,YAMLException$1.prototype.toString=function toString(o){return this.name+\": \"+formatError(this,o)};var sr=YAMLException$1;function getLine(o,s,i,u,_){var w=\"\",x=\"\",C=Math.floor(_/2)-1;return u-s>C&&(s=u-C+(w=\" ... \").length),i-u>C&&(i=u+C-(x=\" ...\").length),{str:w+o.slice(s,i).replace(/\\t/g,\"→\")+x,pos:u-s+w.length}}function padStart(o,s){return nr.repeat(\" \",s-o.length)+o}var ir=function makeSnippet(o,s){if(s=Object.create(s||null),!o.buffer)return null;s.maxLength||(s.maxLength=79),\"number\"!=typeof s.indent&&(s.indent=1),\"number\"!=typeof s.linesBefore&&(s.linesBefore=3),\"number\"!=typeof s.linesAfter&&(s.linesAfter=2);for(var i,u=/\\r?\\n|\\r|\\0/g,_=[0],w=[],x=-1;i=u.exec(o.buffer);)w.push(i.index),_.push(i.index+i[0].length),o.position<=i.index&&x<0&&(x=_.length-2);x<0&&(x=_.length-1);var C,j,L=\"\",B=Math.min(o.line+s.linesAfter,w.length).toString().length,$=s.maxLength-(s.indent+B+3);for(C=1;C<=s.linesBefore&&!(x-C<0);C++)j=getLine(o.buffer,_[x-C],w[x-C],o.position-(_[x]-_[x-C]),$),L=nr.repeat(\" \",s.indent)+padStart((o.line-C+1).toString(),B)+\" | \"+j.str+\"\\n\"+L;for(j=getLine(o.buffer,_[x],w[x],o.position,$),L+=nr.repeat(\" \",s.indent)+padStart((o.line+1).toString(),B)+\" | \"+j.str+\"\\n\",L+=nr.repeat(\"-\",s.indent+B+3+j.pos)+\"^\\n\",C=1;C<=s.linesAfter&&!(x+C>=w.length);C++)j=getLine(o.buffer,_[x+C],w[x+C],o.position-(_[x]-_[x+C]),$),L+=nr.repeat(\" \",s.indent)+padStart((o.line+C+1).toString(),B)+\" | \"+j.str+\"\\n\";return L.replace(/\\n$/,\"\")},ar=[\"kind\",\"multi\",\"resolve\",\"construct\",\"instanceOf\",\"predicate\",\"represent\",\"representName\",\"defaultStyle\",\"styleAliases\"],cr=[\"scalar\",\"sequence\",\"mapping\"];var lr=function Type$1(o,s){if(s=s||{},Object.keys(s).forEach((function(s){if(-1===ar.indexOf(s))throw new sr('Unknown option \"'+s+'\" is met in definition of \"'+o+'\" YAML type.')})),this.options=s,this.tag=o,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(o){return o},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=function compileStyleAliases(o){var s={};return null!==o&&Object.keys(o).forEach((function(i){o[i].forEach((function(o){s[String(o)]=i}))})),s}(s.styleAliases||null),-1===cr.indexOf(this.kind))throw new sr('Unknown kind \"'+this.kind+'\" is specified for \"'+o+'\" YAML type.')};function compileList(o,s){var i=[];return o[s].forEach((function(o){var s=i.length;i.forEach((function(i,u){i.tag===o.tag&&i.kind===o.kind&&i.multi===o.multi&&(s=u)})),i[s]=o})),i}function Schema$1(o){return this.extend(o)}Schema$1.prototype.extend=function extend(o){var s=[],i=[];if(o instanceof lr)i.push(o);else if(Array.isArray(o))i=i.concat(o);else{if(!o||!Array.isArray(o.implicit)&&!Array.isArray(o.explicit))throw new sr(\"Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })\");o.implicit&&(s=s.concat(o.implicit)),o.explicit&&(i=i.concat(o.explicit))}s.forEach((function(o){if(!(o instanceof lr))throw new sr(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\");if(o.loadKind&&\"scalar\"!==o.loadKind)throw new sr(\"There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.\");if(o.multi)throw new sr(\"There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.\")})),i.forEach((function(o){if(!(o instanceof lr))throw new sr(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\")}));var u=Object.create(Schema$1.prototype);return u.implicit=(this.implicit||[]).concat(s),u.explicit=(this.explicit||[]).concat(i),u.compiledImplicit=compileList(u,\"implicit\"),u.compiledExplicit=compileList(u,\"explicit\"),u.compiledTypeMap=function compileMap(){var o,s,i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function collectType(o){o.multi?(i.multi[o.kind].push(o),i.multi.fallback.push(o)):i[o.kind][o.tag]=i.fallback[o.tag]=o}for(o=0,s=arguments.length;o<s;o+=1)arguments[o].forEach(collectType);return i}(u.compiledImplicit,u.compiledExplicit),u};var ur=Schema$1,pr=new lr(\"tag:yaml.org,2002:str\",{kind:\"scalar\",construct:function(o){return null!==o?o:\"\"}}),dr=new lr(\"tag:yaml.org,2002:seq\",{kind:\"sequence\",construct:function(o){return null!==o?o:[]}}),fr=new lr(\"tag:yaml.org,2002:map\",{kind:\"mapping\",construct:function(o){return null!==o?o:{}}}),mr=new ur({explicit:[pr,dr,fr]});var gr=new lr(\"tag:yaml.org,2002:null\",{kind:\"scalar\",resolve:function resolveYamlNull(o){if(null===o)return!0;var s=o.length;return 1===s&&\"~\"===o||4===s&&(\"null\"===o||\"Null\"===o||\"NULL\"===o)},construct:function constructYamlNull(){return null},predicate:function isNull(o){return null===o},represent:{canonical:function(){return\"~\"},lowercase:function(){return\"null\"},uppercase:function(){return\"NULL\"},camelcase:function(){return\"Null\"},empty:function(){return\"\"}},defaultStyle:\"lowercase\"});var yr=new lr(\"tag:yaml.org,2002:bool\",{kind:\"scalar\",resolve:function resolveYamlBoolean(o){if(null===o)return!1;var s=o.length;return 4===s&&(\"true\"===o||\"True\"===o||\"TRUE\"===o)||5===s&&(\"false\"===o||\"False\"===o||\"FALSE\"===o)},construct:function constructYamlBoolean(o){return\"true\"===o||\"True\"===o||\"TRUE\"===o},predicate:function isBoolean(o){return\"[object Boolean]\"===Object.prototype.toString.call(o)},represent:{lowercase:function(o){return o?\"true\":\"false\"},uppercase:function(o){return o?\"TRUE\":\"FALSE\"},camelcase:function(o){return o?\"True\":\"False\"}},defaultStyle:\"lowercase\"});function isOctCode(o){return 48<=o&&o<=55}function isDecCode(o){return 48<=o&&o<=57}var vr=new lr(\"tag:yaml.org,2002:int\",{kind:\"scalar\",resolve:function resolveYamlInteger(o){if(null===o)return!1;var s,i,u=o.length,_=0,w=!1;if(!u)return!1;if(\"-\"!==(s=o[_])&&\"+\"!==s||(s=o[++_]),\"0\"===s){if(_+1===u)return!0;if(\"b\"===(s=o[++_])){for(_++;_<u;_++)if(\"_\"!==(s=o[_])){if(\"0\"!==s&&\"1\"!==s)return!1;w=!0}return w&&\"_\"!==s}if(\"x\"===s){for(_++;_<u;_++)if(\"_\"!==(s=o[_])){if(!(48<=(i=o.charCodeAt(_))&&i<=57||65<=i&&i<=70||97<=i&&i<=102))return!1;w=!0}return w&&\"_\"!==s}if(\"o\"===s){for(_++;_<u;_++)if(\"_\"!==(s=o[_])){if(!isOctCode(o.charCodeAt(_)))return!1;w=!0}return w&&\"_\"!==s}}if(\"_\"===s)return!1;for(;_<u;_++)if(\"_\"!==(s=o[_])){if(!isDecCode(o.charCodeAt(_)))return!1;w=!0}return!(!w||\"_\"===s)},construct:function constructYamlInteger(o){var s,i=o,u=1;if(-1!==i.indexOf(\"_\")&&(i=i.replace(/_/g,\"\")),\"-\"!==(s=i[0])&&\"+\"!==s||(\"-\"===s&&(u=-1),s=(i=i.slice(1))[0]),\"0\"===i)return 0;if(\"0\"===s){if(\"b\"===i[1])return u*parseInt(i.slice(2),2);if(\"x\"===i[1])return u*parseInt(i.slice(2),16);if(\"o\"===i[1])return u*parseInt(i.slice(2),8)}return u*parseInt(i,10)},predicate:function isInteger(o){return\"[object Number]\"===Object.prototype.toString.call(o)&&o%1==0&&!nr.isNegativeZero(o)},represent:{binary:function(o){return o>=0?\"0b\"+o.toString(2):\"-0b\"+o.toString(2).slice(1)},octal:function(o){return o>=0?\"0o\"+o.toString(8):\"-0o\"+o.toString(8).slice(1)},decimal:function(o){return o.toString(10)},hexadecimal:function(o){return o>=0?\"0x\"+o.toString(16).toUpperCase():\"-0x\"+o.toString(16).toUpperCase().slice(1)}},defaultStyle:\"decimal\",styleAliases:{binary:[2,\"bin\"],octal:[8,\"oct\"],decimal:[10,\"dec\"],hexadecimal:[16,\"hex\"]}}),br=new RegExp(\"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))$\");var _r=/^[-+]?[0-9]+e/;var Er=new lr(\"tag:yaml.org,2002:float\",{kind:\"scalar\",resolve:function resolveYamlFloat(o){return null!==o&&!(!br.test(o)||\"_\"===o[o.length-1])},construct:function constructYamlFloat(o){var s,i;return i=\"-\"===(s=o.replace(/_/g,\"\").toLowerCase())[0]?-1:1,\"+-\".indexOf(s[0])>=0&&(s=s.slice(1)),\".inf\"===s?1===i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:\".nan\"===s?NaN:i*parseFloat(s,10)},predicate:function isFloat(o){return\"[object Number]\"===Object.prototype.toString.call(o)&&(o%1!=0||nr.isNegativeZero(o))},represent:function representYamlFloat(o,s){var i;if(isNaN(o))switch(s){case\"lowercase\":return\".nan\";case\"uppercase\":return\".NAN\";case\"camelcase\":return\".NaN\"}else if(Number.POSITIVE_INFINITY===o)switch(s){case\"lowercase\":return\".inf\";case\"uppercase\":return\".INF\";case\"camelcase\":return\".Inf\"}else if(Number.NEGATIVE_INFINITY===o)switch(s){case\"lowercase\":return\"-.inf\";case\"uppercase\":return\"-.INF\";case\"camelcase\":return\"-.Inf\"}else if(nr.isNegativeZero(o))return\"-0.0\";return i=o.toString(10),_r.test(i)?i.replace(\"e\",\".e\"):i},defaultStyle:\"lowercase\"}),wr=mr.extend({implicit:[gr,yr,vr,Er]}),Sr=wr,xr=new RegExp(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$\"),kr=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]))?))?$\");var Or=new lr(\"tag:yaml.org,2002:timestamp\",{kind:\"scalar\",resolve:function resolveYamlTimestamp(o){return null!==o&&(null!==xr.exec(o)||null!==kr.exec(o))},construct:function constructYamlTimestamp(o){var s,i,u,_,w,x,C,j,L=0,B=null;if(null===(s=xr.exec(o))&&(s=kr.exec(o)),null===s)throw new Error(\"Date resolve error\");if(i=+s[1],u=+s[2]-1,_=+s[3],!s[4])return new Date(Date.UTC(i,u,_));if(w=+s[4],x=+s[5],C=+s[6],s[7]){for(L=s[7].slice(0,3);L.length<3;)L+=\"0\";L=+L}return s[9]&&(B=6e4*(60*+s[10]+ +(s[11]||0)),\"-\"===s[9]&&(B=-B)),j=new Date(Date.UTC(i,u,_,w,x,C,L)),B&&j.setTime(j.getTime()-B),j},instanceOf:Date,represent:function representYamlTimestamp(o){return o.toISOString()}});var Cr=new lr(\"tag:yaml.org,2002:merge\",{kind:\"scalar\",resolve:function resolveYamlMerge(o){return\"<<\"===o||null===o}}),Ar=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r\";var jr=new lr(\"tag:yaml.org,2002:binary\",{kind:\"scalar\",resolve:function resolveYamlBinary(o){if(null===o)return!1;var s,i,u=0,_=o.length,w=Ar;for(i=0;i<_;i++)if(!((s=w.indexOf(o.charAt(i)))>64)){if(s<0)return!1;u+=6}return u%8==0},construct:function constructYamlBinary(o){var s,i,u=o.replace(/[\\r\\n=]/g,\"\"),_=u.length,w=Ar,x=0,C=[];for(s=0;s<_;s++)s%4==0&&s&&(C.push(x>>16&255),C.push(x>>8&255),C.push(255&x)),x=x<<6|w.indexOf(u.charAt(s));return 0===(i=_%4*6)?(C.push(x>>16&255),C.push(x>>8&255),C.push(255&x)):18===i?(C.push(x>>10&255),C.push(x>>2&255)):12===i&&C.push(x>>4&255),new Uint8Array(C)},predicate:function isBinary(o){return\"[object Uint8Array]\"===Object.prototype.toString.call(o)},represent:function representYamlBinary(o){var s,i,u=\"\",_=0,w=o.length,x=Ar;for(s=0;s<w;s++)s%3==0&&s&&(u+=x[_>>18&63],u+=x[_>>12&63],u+=x[_>>6&63],u+=x[63&_]),_=(_<<8)+o[s];return 0===(i=w%3)?(u+=x[_>>18&63],u+=x[_>>12&63],u+=x[_>>6&63],u+=x[63&_]):2===i?(u+=x[_>>10&63],u+=x[_>>4&63],u+=x[_<<2&63],u+=x[64]):1===i&&(u+=x[_>>2&63],u+=x[_<<4&63],u+=x[64],u+=x[64]),u}}),Pr=Object.prototype.hasOwnProperty,Ir=Object.prototype.toString;var Mr=new lr(\"tag:yaml.org,2002:omap\",{kind:\"sequence\",resolve:function resolveYamlOmap(o){if(null===o)return!0;var s,i,u,_,w,x=[],C=o;for(s=0,i=C.length;s<i;s+=1){if(u=C[s],w=!1,\"[object Object]\"!==Ir.call(u))return!1;for(_ in u)if(Pr.call(u,_)){if(w)return!1;w=!0}if(!w)return!1;if(-1!==x.indexOf(_))return!1;x.push(_)}return!0},construct:function constructYamlOmap(o){return null!==o?o:[]}}),Nr=Object.prototype.toString;var Tr=new lr(\"tag:yaml.org,2002:pairs\",{kind:\"sequence\",resolve:function resolveYamlPairs(o){if(null===o)return!0;var s,i,u,_,w,x=o;for(w=new Array(x.length),s=0,i=x.length;s<i;s+=1){if(u=x[s],\"[object Object]\"!==Nr.call(u))return!1;if(1!==(_=Object.keys(u)).length)return!1;w[s]=[_[0],u[_[0]]]}return!0},construct:function constructYamlPairs(o){if(null===o)return[];var s,i,u,_,w,x=o;for(w=new Array(x.length),s=0,i=x.length;s<i;s+=1)u=x[s],_=Object.keys(u),w[s]=[_[0],u[_[0]]];return w}}),Rr=Object.prototype.hasOwnProperty;var Dr=new lr(\"tag:yaml.org,2002:set\",{kind:\"mapping\",resolve:function resolveYamlSet(o){if(null===o)return!0;var s,i=o;for(s in i)if(Rr.call(i,s)&&null!==i[s])return!1;return!0},construct:function constructYamlSet(o){return null!==o?o:{}}}),Lr=Sr.extend({implicit:[Or,Cr],explicit:[jr,Mr,Tr,Dr]}),Br=Object.prototype.hasOwnProperty,Fr=1,qr=2,$r=3,Vr=4,Ur=1,zr=2,Wr=3,Kr=/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/,Hr=/[\\x85\\u2028\\u2029]/,Jr=/[,\\[\\]\\{\\}]/,Gr=/^(?:!|!!|![a-z\\-]+!)$/i,Yr=/^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;function _class(o){return Object.prototype.toString.call(o)}function is_EOL(o){return 10===o||13===o}function is_WHITE_SPACE(o){return 9===o||32===o}function is_WS_OR_EOL(o){return 9===o||32===o||10===o||13===o}function is_FLOW_INDICATOR(o){return 44===o||91===o||93===o||123===o||125===o}function fromHexCode(o){var s;return 48<=o&&o<=57?o-48:97<=(s=32|o)&&s<=102?s-97+10:-1}function simpleEscapeSequence(o){return 48===o?\"\\0\":97===o?\"\u0007\":98===o?\"\\b\":116===o||9===o?\"\\t\":110===o?\"\\n\":118===o?\"\\v\":102===o?\"\\f\":114===o?\"\\r\":101===o?\"\u001b\":32===o?\" \":34===o?'\"':47===o?\"/\":92===o?\"\\\\\":78===o?\"\":95===o?\" \":76===o?\"\\u2028\":80===o?\"\\u2029\":\"\"}function charFromCodepoint(o){return o<=65535?String.fromCharCode(o):String.fromCharCode(55296+(o-65536>>10),56320+(o-65536&1023))}for(var Xr=new Array(256),Qr=new Array(256),Zr=0;Zr<256;Zr++)Xr[Zr]=simpleEscapeSequence(Zr)?1:0,Qr[Zr]=simpleEscapeSequence(Zr);function State$1(o,s){this.input=o,this.filename=s.filename||null,this.schema=s.schema||Lr,this.onWarning=s.onWarning||null,this.legacy=s.legacy||!1,this.json=s.json||!1,this.listener=s.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=o.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function generateError(o,s){var i={name:o.filename,buffer:o.input.slice(0,-1),position:o.position,line:o.line,column:o.position-o.lineStart};return i.snippet=ir(i),new sr(s,i)}function throwError(o,s){throw generateError(o,s)}function throwWarning(o,s){o.onWarning&&o.onWarning.call(null,generateError(o,s))}var en={YAML:function handleYamlDirective(o,s,i){var u,_,w;null!==o.version&&throwError(o,\"duplication of %YAML directive\"),1!==i.length&&throwError(o,\"YAML directive accepts exactly one argument\"),null===(u=/^([0-9]+)\\.([0-9]+)$/.exec(i[0]))&&throwError(o,\"ill-formed argument of the YAML directive\"),_=parseInt(u[1],10),w=parseInt(u[2],10),1!==_&&throwError(o,\"unacceptable YAML version of the document\"),o.version=i[0],o.checkLineBreaks=w<2,1!==w&&2!==w&&throwWarning(o,\"unsupported YAML version of the document\")},TAG:function handleTagDirective(o,s,i){var u,_;2!==i.length&&throwError(o,\"TAG directive accepts exactly two arguments\"),u=i[0],_=i[1],Gr.test(u)||throwError(o,\"ill-formed tag handle (first argument) of the TAG directive\"),Br.call(o.tagMap,u)&&throwError(o,'there is a previously declared suffix for \"'+u+'\" tag handle'),Yr.test(_)||throwError(o,\"ill-formed tag prefix (second argument) of the TAG directive\");try{_=decodeURIComponent(_)}catch(s){throwError(o,\"tag prefix is malformed: \"+_)}o.tagMap[u]=_}};function captureSegment(o,s,i,u){var _,w,x,C;if(s<i){if(C=o.input.slice(s,i),u)for(_=0,w=C.length;_<w;_+=1)9===(x=C.charCodeAt(_))||32<=x&&x<=1114111||throwError(o,\"expected valid JSON character\");else Kr.test(C)&&throwError(o,\"the stream contains non-printable characters\");o.result+=C}}function mergeMappings(o,s,i,u){var _,w,x,C;for(nr.isObject(i)||throwError(o,\"cannot merge mappings; the provided source object is unacceptable\"),x=0,C=(_=Object.keys(i)).length;x<C;x+=1)w=_[x],Br.call(s,w)||(s[w]=i[w],u[w]=!0)}function storeMappingPair(o,s,i,u,_,w,x,C,j){var L,B;if(Array.isArray(_))for(L=0,B=(_=Array.prototype.slice.call(_)).length;L<B;L+=1)Array.isArray(_[L])&&throwError(o,\"nested arrays are not supported inside keys\"),\"object\"==typeof _&&\"[object Object]\"===_class(_[L])&&(_[L]=\"[object Object]\");if(\"object\"==typeof _&&\"[object Object]\"===_class(_)&&(_=\"[object Object]\"),_=String(_),null===s&&(s={}),\"tag:yaml.org,2002:merge\"===u)if(Array.isArray(w))for(L=0,B=w.length;L<B;L+=1)mergeMappings(o,s,w[L],i);else mergeMappings(o,s,w,i);else o.json||Br.call(i,_)||!Br.call(s,_)||(o.line=x||o.line,o.lineStart=C||o.lineStart,o.position=j||o.position,throwError(o,\"duplicated mapping key\")),\"__proto__\"===_?Object.defineProperty(s,_,{configurable:!0,enumerable:!0,writable:!0,value:w}):s[_]=w,delete i[_];return s}function readLineBreak(o){var s;10===(s=o.input.charCodeAt(o.position))?o.position++:13===s?(o.position++,10===o.input.charCodeAt(o.position)&&o.position++):throwError(o,\"a line break is expected\"),o.line+=1,o.lineStart=o.position,o.firstTabInLine=-1}function skipSeparationSpace(o,s,i){for(var u=0,_=o.input.charCodeAt(o.position);0!==_;){for(;is_WHITE_SPACE(_);)9===_&&-1===o.firstTabInLine&&(o.firstTabInLine=o.position),_=o.input.charCodeAt(++o.position);if(s&&35===_)do{_=o.input.charCodeAt(++o.position)}while(10!==_&&13!==_&&0!==_);if(!is_EOL(_))break;for(readLineBreak(o),_=o.input.charCodeAt(o.position),u++,o.lineIndent=0;32===_;)o.lineIndent++,_=o.input.charCodeAt(++o.position)}return-1!==i&&0!==u&&o.lineIndent<i&&throwWarning(o,\"deficient indentation\"),u}function testDocumentSeparator(o){var s,i=o.position;return!(45!==(s=o.input.charCodeAt(i))&&46!==s||s!==o.input.charCodeAt(i+1)||s!==o.input.charCodeAt(i+2)||(i+=3,0!==(s=o.input.charCodeAt(i))&&!is_WS_OR_EOL(s)))}function writeFoldedLines(o,s){1===s?o.result+=\" \":s>1&&(o.result+=nr.repeat(\"\\n\",s-1))}function readBlockSequence(o,s){var i,u,_=o.tag,w=o.anchor,x=[],C=!1;if(-1!==o.firstTabInLine)return!1;for(null!==o.anchor&&(o.anchorMap[o.anchor]=x),u=o.input.charCodeAt(o.position);0!==u&&(-1!==o.firstTabInLine&&(o.position=o.firstTabInLine,throwError(o,\"tab characters must not be used in indentation\")),45===u)&&is_WS_OR_EOL(o.input.charCodeAt(o.position+1));)if(C=!0,o.position++,skipSeparationSpace(o,!0,-1)&&o.lineIndent<=s)x.push(null),u=o.input.charCodeAt(o.position);else if(i=o.line,composeNode(o,s,$r,!1,!0),x.push(o.result),skipSeparationSpace(o,!0,-1),u=o.input.charCodeAt(o.position),(o.line===i||o.lineIndent>s)&&0!==u)throwError(o,\"bad indentation of a sequence entry\");else if(o.lineIndent<s)break;return!!C&&(o.tag=_,o.anchor=w,o.kind=\"sequence\",o.result=x,!0)}function readTagProperty(o){var s,i,u,_,w=!1,x=!1;if(33!==(_=o.input.charCodeAt(o.position)))return!1;if(null!==o.tag&&throwError(o,\"duplication of a tag property\"),60===(_=o.input.charCodeAt(++o.position))?(w=!0,_=o.input.charCodeAt(++o.position)):33===_?(x=!0,i=\"!!\",_=o.input.charCodeAt(++o.position)):i=\"!\",s=o.position,w){do{_=o.input.charCodeAt(++o.position)}while(0!==_&&62!==_);o.position<o.length?(u=o.input.slice(s,o.position),_=o.input.charCodeAt(++o.position)):throwError(o,\"unexpected end of the stream within a verbatim tag\")}else{for(;0!==_&&!is_WS_OR_EOL(_);)33===_&&(x?throwError(o,\"tag suffix cannot contain exclamation marks\"):(i=o.input.slice(s-1,o.position+1),Gr.test(i)||throwError(o,\"named tag handle cannot contain such characters\"),x=!0,s=o.position+1)),_=o.input.charCodeAt(++o.position);u=o.input.slice(s,o.position),Jr.test(u)&&throwError(o,\"tag suffix cannot contain flow indicator characters\")}u&&!Yr.test(u)&&throwError(o,\"tag name cannot contain such characters: \"+u);try{u=decodeURIComponent(u)}catch(s){throwError(o,\"tag name is malformed: \"+u)}return w?o.tag=u:Br.call(o.tagMap,i)?o.tag=o.tagMap[i]+u:\"!\"===i?o.tag=\"!\"+u:\"!!\"===i?o.tag=\"tag:yaml.org,2002:\"+u:throwError(o,'undeclared tag handle \"'+i+'\"'),!0}function readAnchorProperty(o){var s,i;if(38!==(i=o.input.charCodeAt(o.position)))return!1;for(null!==o.anchor&&throwError(o,\"duplication of an anchor property\"),i=o.input.charCodeAt(++o.position),s=o.position;0!==i&&!is_WS_OR_EOL(i)&&!is_FLOW_INDICATOR(i);)i=o.input.charCodeAt(++o.position);return o.position===s&&throwError(o,\"name of an anchor node must contain at least one character\"),o.anchor=o.input.slice(s,o.position),!0}function composeNode(o,s,i,u,_){var w,x,C,j,L,B,$,V,U,z=1,Y=!1,Z=!1;if(null!==o.listener&&o.listener(\"open\",o),o.tag=null,o.anchor=null,o.kind=null,o.result=null,w=x=C=Vr===i||$r===i,u&&skipSeparationSpace(o,!0,-1)&&(Y=!0,o.lineIndent>s?z=1:o.lineIndent===s?z=0:o.lineIndent<s&&(z=-1)),1===z)for(;readTagProperty(o)||readAnchorProperty(o);)skipSeparationSpace(o,!0,-1)?(Y=!0,C=w,o.lineIndent>s?z=1:o.lineIndent===s?z=0:o.lineIndent<s&&(z=-1)):C=!1;if(C&&(C=Y||_),1!==z&&Vr!==i||(V=Fr===i||qr===i?s:s+1,U=o.position-o.lineStart,1===z?C&&(readBlockSequence(o,U)||function readBlockMapping(o,s,i){var u,_,w,x,C,j,L,B=o.tag,$=o.anchor,V={},U=Object.create(null),z=null,Y=null,Z=null,ee=!1,ie=!1;if(-1!==o.firstTabInLine)return!1;for(null!==o.anchor&&(o.anchorMap[o.anchor]=V),L=o.input.charCodeAt(o.position);0!==L;){if(ee||-1===o.firstTabInLine||(o.position=o.firstTabInLine,throwError(o,\"tab characters must not be used in indentation\")),u=o.input.charCodeAt(o.position+1),w=o.line,63!==L&&58!==L||!is_WS_OR_EOL(u)){if(x=o.line,C=o.lineStart,j=o.position,!composeNode(o,i,qr,!1,!0))break;if(o.line===w){for(L=o.input.charCodeAt(o.position);is_WHITE_SPACE(L);)L=o.input.charCodeAt(++o.position);if(58===L)is_WS_OR_EOL(L=o.input.charCodeAt(++o.position))||throwError(o,\"a whitespace character is expected after the key-value separator within a block mapping\"),ee&&(storeMappingPair(o,V,U,z,Y,null,x,C,j),z=Y=Z=null),ie=!0,ee=!1,_=!1,z=o.tag,Y=o.result;else{if(!ie)return o.tag=B,o.anchor=$,!0;throwError(o,\"can not read an implicit mapping pair; a colon is missed\")}}else{if(!ie)return o.tag=B,o.anchor=$,!0;throwError(o,\"can not read a block mapping entry; a multiline key may not be an implicit key\")}}else 63===L?(ee&&(storeMappingPair(o,V,U,z,Y,null,x,C,j),z=Y=Z=null),ie=!0,ee=!0,_=!0):ee?(ee=!1,_=!0):throwError(o,\"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line\"),o.position+=1,L=u;if((o.line===w||o.lineIndent>s)&&(ee&&(x=o.line,C=o.lineStart,j=o.position),composeNode(o,s,Vr,!0,_)&&(ee?Y=o.result:Z=o.result),ee||(storeMappingPair(o,V,U,z,Y,Z,x,C,j),z=Y=Z=null),skipSeparationSpace(o,!0,-1),L=o.input.charCodeAt(o.position)),(o.line===w||o.lineIndent>s)&&0!==L)throwError(o,\"bad indentation of a mapping entry\");else if(o.lineIndent<s)break}return ee&&storeMappingPair(o,V,U,z,Y,null,x,C,j),ie&&(o.tag=B,o.anchor=$,o.kind=\"mapping\",o.result=V),ie}(o,U,V))||function readFlowCollection(o,s){var i,u,_,w,x,C,j,L,B,$,V,U,z=!0,Y=o.tag,Z=o.anchor,ee=Object.create(null);if(91===(U=o.input.charCodeAt(o.position)))x=93,L=!1,w=[];else{if(123!==U)return!1;x=125,L=!0,w={}}for(null!==o.anchor&&(o.anchorMap[o.anchor]=w),U=o.input.charCodeAt(++o.position);0!==U;){if(skipSeparationSpace(o,!0,s),(U=o.input.charCodeAt(o.position))===x)return o.position++,o.tag=Y,o.anchor=Z,o.kind=L?\"mapping\":\"sequence\",o.result=w,!0;z?44===U&&throwError(o,\"expected the node content, but found ','\"):throwError(o,\"missed comma between flow collection entries\"),V=null,C=j=!1,63===U&&is_WS_OR_EOL(o.input.charCodeAt(o.position+1))&&(C=j=!0,o.position++,skipSeparationSpace(o,!0,s)),i=o.line,u=o.lineStart,_=o.position,composeNode(o,s,Fr,!1,!0),$=o.tag,B=o.result,skipSeparationSpace(o,!0,s),U=o.input.charCodeAt(o.position),!j&&o.line!==i||58!==U||(C=!0,U=o.input.charCodeAt(++o.position),skipSeparationSpace(o,!0,s),composeNode(o,s,Fr,!1,!0),V=o.result),L?storeMappingPair(o,w,ee,$,B,V,i,u,_):C?w.push(storeMappingPair(o,null,ee,$,B,V,i,u,_)):w.push(B),skipSeparationSpace(o,!0,s),44===(U=o.input.charCodeAt(o.position))?(z=!0,U=o.input.charCodeAt(++o.position)):z=!1}throwError(o,\"unexpected end of the stream within a flow collection\")}(o,V)?Z=!0:(x&&function readBlockScalar(o,s){var i,u,_,w,x,C=Ur,j=!1,L=!1,B=s,$=0,V=!1;if(124===(w=o.input.charCodeAt(o.position)))u=!1;else{if(62!==w)return!1;u=!0}for(o.kind=\"scalar\",o.result=\"\";0!==w;)if(43===(w=o.input.charCodeAt(++o.position))||45===w)Ur===C?C=43===w?Wr:zr:throwError(o,\"repeat of a chomping mode identifier\");else{if(!((_=48<=(x=w)&&x<=57?x-48:-1)>=0))break;0===_?throwError(o,\"bad explicit indentation width of a block scalar; it cannot be less than one\"):L?throwError(o,\"repeat of an indentation width identifier\"):(B=s+_-1,L=!0)}if(is_WHITE_SPACE(w)){do{w=o.input.charCodeAt(++o.position)}while(is_WHITE_SPACE(w));if(35===w)do{w=o.input.charCodeAt(++o.position)}while(!is_EOL(w)&&0!==w)}for(;0!==w;){for(readLineBreak(o),o.lineIndent=0,w=o.input.charCodeAt(o.position);(!L||o.lineIndent<B)&&32===w;)o.lineIndent++,w=o.input.charCodeAt(++o.position);if(!L&&o.lineIndent>B&&(B=o.lineIndent),is_EOL(w))$++;else{if(o.lineIndent<B){C===Wr?o.result+=nr.repeat(\"\\n\",j?1+$:$):C===Ur&&j&&(o.result+=\"\\n\");break}for(u?is_WHITE_SPACE(w)?(V=!0,o.result+=nr.repeat(\"\\n\",j?1+$:$)):V?(V=!1,o.result+=nr.repeat(\"\\n\",$+1)):0===$?j&&(o.result+=\" \"):o.result+=nr.repeat(\"\\n\",$):o.result+=nr.repeat(\"\\n\",j?1+$:$),j=!0,L=!0,$=0,i=o.position;!is_EOL(w)&&0!==w;)w=o.input.charCodeAt(++o.position);captureSegment(o,i,o.position,!1)}}return!0}(o,V)||function readSingleQuotedScalar(o,s){var i,u,_;if(39!==(i=o.input.charCodeAt(o.position)))return!1;for(o.kind=\"scalar\",o.result=\"\",o.position++,u=_=o.position;0!==(i=o.input.charCodeAt(o.position));)if(39===i){if(captureSegment(o,u,o.position,!0),39!==(i=o.input.charCodeAt(++o.position)))return!0;u=o.position,o.position++,_=o.position}else is_EOL(i)?(captureSegment(o,u,_,!0),writeFoldedLines(o,skipSeparationSpace(o,!1,s)),u=_=o.position):o.position===o.lineStart&&testDocumentSeparator(o)?throwError(o,\"unexpected end of the document within a single quoted scalar\"):(o.position++,_=o.position);throwError(o,\"unexpected end of the stream within a single quoted scalar\")}(o,V)||function readDoubleQuotedScalar(o,s){var i,u,_,w,x,C,j;if(34!==(C=o.input.charCodeAt(o.position)))return!1;for(o.kind=\"scalar\",o.result=\"\",o.position++,i=u=o.position;0!==(C=o.input.charCodeAt(o.position));){if(34===C)return captureSegment(o,i,o.position,!0),o.position++,!0;if(92===C){if(captureSegment(o,i,o.position,!0),is_EOL(C=o.input.charCodeAt(++o.position)))skipSeparationSpace(o,!1,s);else if(C<256&&Xr[C])o.result+=Qr[C],o.position++;else if((x=120===(j=C)?2:117===j?4:85===j?8:0)>0){for(_=x,w=0;_>0;_--)(x=fromHexCode(C=o.input.charCodeAt(++o.position)))>=0?w=(w<<4)+x:throwError(o,\"expected hexadecimal character\");o.result+=charFromCodepoint(w),o.position++}else throwError(o,\"unknown escape sequence\");i=u=o.position}else is_EOL(C)?(captureSegment(o,i,u,!0),writeFoldedLines(o,skipSeparationSpace(o,!1,s)),i=u=o.position):o.position===o.lineStart&&testDocumentSeparator(o)?throwError(o,\"unexpected end of the document within a double quoted scalar\"):(o.position++,u=o.position)}throwError(o,\"unexpected end of the stream within a double quoted scalar\")}(o,V)?Z=!0:!function readAlias(o){var s,i,u;if(42!==(u=o.input.charCodeAt(o.position)))return!1;for(u=o.input.charCodeAt(++o.position),s=o.position;0!==u&&!is_WS_OR_EOL(u)&&!is_FLOW_INDICATOR(u);)u=o.input.charCodeAt(++o.position);return o.position===s&&throwError(o,\"name of an alias node must contain at least one character\"),i=o.input.slice(s,o.position),Br.call(o.anchorMap,i)||throwError(o,'unidentified alias \"'+i+'\"'),o.result=o.anchorMap[i],skipSeparationSpace(o,!0,-1),!0}(o)?function readPlainScalar(o,s,i){var u,_,w,x,C,j,L,B,$=o.kind,V=o.result;if(is_WS_OR_EOL(B=o.input.charCodeAt(o.position))||is_FLOW_INDICATOR(B)||35===B||38===B||42===B||33===B||124===B||62===B||39===B||34===B||37===B||64===B||96===B)return!1;if((63===B||45===B)&&(is_WS_OR_EOL(u=o.input.charCodeAt(o.position+1))||i&&is_FLOW_INDICATOR(u)))return!1;for(o.kind=\"scalar\",o.result=\"\",_=w=o.position,x=!1;0!==B;){if(58===B){if(is_WS_OR_EOL(u=o.input.charCodeAt(o.position+1))||i&&is_FLOW_INDICATOR(u))break}else if(35===B){if(is_WS_OR_EOL(o.input.charCodeAt(o.position-1)))break}else{if(o.position===o.lineStart&&testDocumentSeparator(o)||i&&is_FLOW_INDICATOR(B))break;if(is_EOL(B)){if(C=o.line,j=o.lineStart,L=o.lineIndent,skipSeparationSpace(o,!1,-1),o.lineIndent>=s){x=!0,B=o.input.charCodeAt(o.position);continue}o.position=w,o.line=C,o.lineStart=j,o.lineIndent=L;break}}x&&(captureSegment(o,_,w,!1),writeFoldedLines(o,o.line-C),_=w=o.position,x=!1),is_WHITE_SPACE(B)||(w=o.position+1),B=o.input.charCodeAt(++o.position)}return captureSegment(o,_,w,!1),!!o.result||(o.kind=$,o.result=V,!1)}(o,V,Fr===i)&&(Z=!0,null===o.tag&&(o.tag=\"?\")):(Z=!0,null===o.tag&&null===o.anchor||throwError(o,\"alias node should not have any properties\")),null!==o.anchor&&(o.anchorMap[o.anchor]=o.result)):0===z&&(Z=C&&readBlockSequence(o,U))),null===o.tag)null!==o.anchor&&(o.anchorMap[o.anchor]=o.result);else if(\"?\"===o.tag){for(null!==o.result&&\"scalar\"!==o.kind&&throwError(o,'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"'+o.kind+'\"'),j=0,L=o.implicitTypes.length;j<L;j+=1)if(($=o.implicitTypes[j]).resolve(o.result)){o.result=$.construct(o.result),o.tag=$.tag,null!==o.anchor&&(o.anchorMap[o.anchor]=o.result);break}}else if(\"!\"!==o.tag){if(Br.call(o.typeMap[o.kind||\"fallback\"],o.tag))$=o.typeMap[o.kind||\"fallback\"][o.tag];else for($=null,j=0,L=(B=o.typeMap.multi[o.kind||\"fallback\"]).length;j<L;j+=1)if(o.tag.slice(0,B[j].tag.length)===B[j].tag){$=B[j];break}$||throwError(o,\"unknown tag !<\"+o.tag+\">\"),null!==o.result&&$.kind!==o.kind&&throwError(o,\"unacceptable node kind for !<\"+o.tag+'> tag; it should be \"'+$.kind+'\", not \"'+o.kind+'\"'),$.resolve(o.result,o.tag)?(o.result=$.construct(o.result,o.tag),null!==o.anchor&&(o.anchorMap[o.anchor]=o.result)):throwError(o,\"cannot resolve a node with !<\"+o.tag+\"> explicit tag\")}return null!==o.listener&&o.listener(\"close\",o),null!==o.tag||null!==o.anchor||Z}function readDocument(o){var s,i,u,_,w=o.position,x=!1;for(o.version=null,o.checkLineBreaks=o.legacy,o.tagMap=Object.create(null),o.anchorMap=Object.create(null);0!==(_=o.input.charCodeAt(o.position))&&(skipSeparationSpace(o,!0,-1),_=o.input.charCodeAt(o.position),!(o.lineIndent>0||37!==_));){for(x=!0,_=o.input.charCodeAt(++o.position),s=o.position;0!==_&&!is_WS_OR_EOL(_);)_=o.input.charCodeAt(++o.position);for(u=[],(i=o.input.slice(s,o.position)).length<1&&throwError(o,\"directive name must not be less than one character in length\");0!==_;){for(;is_WHITE_SPACE(_);)_=o.input.charCodeAt(++o.position);if(35===_){do{_=o.input.charCodeAt(++o.position)}while(0!==_&&!is_EOL(_));break}if(is_EOL(_))break;for(s=o.position;0!==_&&!is_WS_OR_EOL(_);)_=o.input.charCodeAt(++o.position);u.push(o.input.slice(s,o.position))}0!==_&&readLineBreak(o),Br.call(en,i)?en[i](o,i,u):throwWarning(o,'unknown document directive \"'+i+'\"')}skipSeparationSpace(o,!0,-1),0===o.lineIndent&&45===o.input.charCodeAt(o.position)&&45===o.input.charCodeAt(o.position+1)&&45===o.input.charCodeAt(o.position+2)?(o.position+=3,skipSeparationSpace(o,!0,-1)):x&&throwError(o,\"directives end mark is expected\"),composeNode(o,o.lineIndent-1,Vr,!1,!0),skipSeparationSpace(o,!0,-1),o.checkLineBreaks&&Hr.test(o.input.slice(w,o.position))&&throwWarning(o,\"non-ASCII line breaks are interpreted as content\"),o.documents.push(o.result),o.position===o.lineStart&&testDocumentSeparator(o)?46===o.input.charCodeAt(o.position)&&(o.position+=3,skipSeparationSpace(o,!0,-1)):o.position<o.length-1&&throwError(o,\"end of the stream or a document separator is expected\")}function loadDocuments(o,s){s=s||{},0!==(o=String(o)).length&&(10!==o.charCodeAt(o.length-1)&&13!==o.charCodeAt(o.length-1)&&(o+=\"\\n\"),65279===o.charCodeAt(0)&&(o=o.slice(1)));var i=new State$1(o,s),u=o.indexOf(\"\\0\");for(-1!==u&&(i.position=u,throwError(i,\"null byte is not allowed in input\")),i.input+=\"\\0\";32===i.input.charCodeAt(i.position);)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)readDocument(i);return i.documents}var tn={loadAll:function loadAll$1(o,s,i){null!==s&&\"object\"==typeof s&&void 0===i&&(i=s,s=null);var u=loadDocuments(o,i);if(\"function\"!=typeof s)return u;for(var _=0,w=u.length;_<w;_+=1)s(u[_])},load:function load$1(o,s){var i=loadDocuments(o,s);if(0!==i.length){if(1===i.length)return i[0];throw new sr(\"expected a single document in the stream, but found more\")}}},rn=Object.prototype.toString,nn=Object.prototype.hasOwnProperty,on=65279,sn=9,an=10,cn=13,ln=32,un=33,pn=34,hn=35,dn=37,fn=38,mn=39,gn=42,yn=44,vn=45,bn=58,_n=61,En=62,wn=63,Sn=64,xn=91,kn=93,On=96,Cn=123,An=124,jn=125,Pn={0:\"\\\\0\",7:\"\\\\a\",8:\"\\\\b\",9:\"\\\\t\",10:\"\\\\n\",11:\"\\\\v\",12:\"\\\\f\",13:\"\\\\r\",27:\"\\\\e\",34:'\\\\\"',92:\"\\\\\\\\\",133:\"\\\\N\",160:\"\\\\_\",8232:\"\\\\L\",8233:\"\\\\P\"},In=[\"y\",\"Y\",\"yes\",\"Yes\",\"YES\",\"on\",\"On\",\"ON\",\"n\",\"N\",\"no\",\"No\",\"NO\",\"off\",\"Off\",\"OFF\"],Mn=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;function encodeHex(o){var s,i,u;if(s=o.toString(16).toUpperCase(),o<=255)i=\"x\",u=2;else if(o<=65535)i=\"u\",u=4;else{if(!(o<=4294967295))throw new sr(\"code point within a string may not be greater than 0xFFFFFFFF\");i=\"U\",u=8}return\"\\\\\"+i+nr.repeat(\"0\",u-s.length)+s}var Nn=1,Tn=2;function State(o){this.schema=o.schema||Lr,this.indent=Math.max(1,o.indent||2),this.noArrayIndent=o.noArrayIndent||!1,this.skipInvalid=o.skipInvalid||!1,this.flowLevel=nr.isNothing(o.flowLevel)?-1:o.flowLevel,this.styleMap=function compileStyleMap(o,s){var i,u,_,w,x,C,j;if(null===s)return{};for(i={},_=0,w=(u=Object.keys(s)).length;_<w;_+=1)x=u[_],C=String(s[x]),\"!!\"===x.slice(0,2)&&(x=\"tag:yaml.org,2002:\"+x.slice(2)),(j=o.compiledTypeMap.fallback[x])&&nn.call(j.styleAliases,C)&&(C=j.styleAliases[C]),i[x]=C;return i}(this.schema,o.styles||null),this.sortKeys=o.sortKeys||!1,this.lineWidth=o.lineWidth||80,this.noRefs=o.noRefs||!1,this.noCompatMode=o.noCompatMode||!1,this.condenseFlow=o.condenseFlow||!1,this.quotingType='\"'===o.quotingType?Tn:Nn,this.forceQuotes=o.forceQuotes||!1,this.replacer=\"function\"==typeof o.replacer?o.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=\"\",this.duplicates=[],this.usedDuplicates=null}function indentString(o,s){for(var i,u=nr.repeat(\" \",s),_=0,w=-1,x=\"\",C=o.length;_<C;)-1===(w=o.indexOf(\"\\n\",_))?(i=o.slice(_),_=C):(i=o.slice(_,w+1),_=w+1),i.length&&\"\\n\"!==i&&(x+=u),x+=i;return x}function generateNextLine(o,s){return\"\\n\"+nr.repeat(\" \",o.indent*s)}function isWhitespace(o){return o===ln||o===sn}function isPrintable(o){return 32<=o&&o<=126||161<=o&&o<=55295&&8232!==o&&8233!==o||57344<=o&&o<=65533&&o!==on||65536<=o&&o<=1114111}function isNsCharOrWhitespace(o){return isPrintable(o)&&o!==on&&o!==cn&&o!==an}function isPlainSafe(o,s,i){var u=isNsCharOrWhitespace(o),_=u&&!isWhitespace(o);return(i?u:u&&o!==yn&&o!==xn&&o!==kn&&o!==Cn&&o!==jn)&&o!==hn&&!(s===bn&&!_)||isNsCharOrWhitespace(s)&&!isWhitespace(s)&&o===hn||s===bn&&_}function codePointAt(o,s){var i,u=o.charCodeAt(s);return u>=55296&&u<=56319&&s+1<o.length&&(i=o.charCodeAt(s+1))>=56320&&i<=57343?1024*(u-55296)+i-56320+65536:u}function needIndentIndicator(o){return/^\\n* /.test(o)}var Rn=1,Dn=2,Ln=3,Bn=4,Fn=5;function chooseScalarStyle(o,s,i,u,_,w,x,C){var j,L=0,B=null,$=!1,V=!1,U=-1!==u,z=-1,Y=function isPlainSafeFirst(o){return isPrintable(o)&&o!==on&&!isWhitespace(o)&&o!==vn&&o!==wn&&o!==bn&&o!==yn&&o!==xn&&o!==kn&&o!==Cn&&o!==jn&&o!==hn&&o!==fn&&o!==gn&&o!==un&&o!==An&&o!==_n&&o!==En&&o!==mn&&o!==pn&&o!==dn&&o!==Sn&&o!==On}(codePointAt(o,0))&&function isPlainSafeLast(o){return!isWhitespace(o)&&o!==bn}(codePointAt(o,o.length-1));if(s||x)for(j=0;j<o.length;L>=65536?j+=2:j++){if(!isPrintable(L=codePointAt(o,j)))return Fn;Y=Y&&isPlainSafe(L,B,C),B=L}else{for(j=0;j<o.length;L>=65536?j+=2:j++){if((L=codePointAt(o,j))===an)$=!0,U&&(V=V||j-z-1>u&&\" \"!==o[z+1],z=j);else if(!isPrintable(L))return Fn;Y=Y&&isPlainSafe(L,B,C),B=L}V=V||U&&j-z-1>u&&\" \"!==o[z+1]}return $||V?i>9&&needIndentIndicator(o)?Fn:x?w===Tn?Fn:Dn:V?Bn:Ln:!Y||x||_(o)?w===Tn?Fn:Dn:Rn}function writeScalar(o,s,i,u,_){o.dump=function(){if(0===s.length)return o.quotingType===Tn?'\"\"':\"''\";if(!o.noCompatMode&&(-1!==In.indexOf(s)||Mn.test(s)))return o.quotingType===Tn?'\"'+s+'\"':\"'\"+s+\"'\";var w=o.indent*Math.max(1,i),x=-1===o.lineWidth?-1:Math.max(Math.min(o.lineWidth,40),o.lineWidth-w),C=u||o.flowLevel>-1&&i>=o.flowLevel;switch(chooseScalarStyle(s,C,o.indent,x,(function testAmbiguity(s){return function testImplicitResolving(o,s){var i,u;for(i=0,u=o.implicitTypes.length;i<u;i+=1)if(o.implicitTypes[i].resolve(s))return!0;return!1}(o,s)}),o.quotingType,o.forceQuotes&&!u,_)){case Rn:return s;case Dn:return\"'\"+s.replace(/'/g,\"''\")+\"'\";case Ln:return\"|\"+blockHeader(s,o.indent)+dropEndingNewline(indentString(s,w));case Bn:return\">\"+blockHeader(s,o.indent)+dropEndingNewline(indentString(function foldString(o,s){var i,u,_=/(\\n+)([^\\n]*)/g,w=(C=o.indexOf(\"\\n\"),C=-1!==C?C:o.length,_.lastIndex=C,foldLine(o.slice(0,C),s)),x=\"\\n\"===o[0]||\" \"===o[0];var C;for(;u=_.exec(o);){var j=u[1],L=u[2];i=\" \"===L[0],w+=j+(x||i||\"\"===L?\"\":\"\\n\")+foldLine(L,s),x=i}return w}(s,x),w));case Fn:return'\"'+function escapeString(o){for(var s,i=\"\",u=0,_=0;_<o.length;u>=65536?_+=2:_++)u=codePointAt(o,_),!(s=Pn[u])&&isPrintable(u)?(i+=o[_],u>=65536&&(i+=o[_+1])):i+=s||encodeHex(u);return i}(s)+'\"';default:throw new sr(\"impossible error: invalid scalar style\")}}()}function blockHeader(o,s){var i=needIndentIndicator(o)?String(s):\"\",u=\"\\n\"===o[o.length-1];return i+(u&&(\"\\n\"===o[o.length-2]||\"\\n\"===o)?\"+\":u?\"\":\"-\")+\"\\n\"}function dropEndingNewline(o){return\"\\n\"===o[o.length-1]?o.slice(0,-1):o}function foldLine(o,s){if(\"\"===o||\" \"===o[0])return o;for(var i,u,_=/ [^ ]/g,w=0,x=0,C=0,j=\"\";i=_.exec(o);)(C=i.index)-w>s&&(u=x>w?x:C,j+=\"\\n\"+o.slice(w,u),w=u+1),x=C;return j+=\"\\n\",o.length-w>s&&x>w?j+=o.slice(w,x)+\"\\n\"+o.slice(x+1):j+=o.slice(w),j.slice(1)}function writeBlockSequence(o,s,i,u){var _,w,x,C=\"\",j=o.tag;for(_=0,w=i.length;_<w;_+=1)x=i[_],o.replacer&&(x=o.replacer.call(i,String(_),x)),(writeNode(o,s+1,x,!0,!0,!1,!0)||void 0===x&&writeNode(o,s+1,null,!0,!0,!1,!0))&&(u&&\"\"===C||(C+=generateNextLine(o,s)),o.dump&&an===o.dump.charCodeAt(0)?C+=\"-\":C+=\"- \",C+=o.dump);o.tag=j,o.dump=C||\"[]\"}function detectType(o,s,i){var u,_,w,x,C,j;for(w=0,x=(_=i?o.explicitTypes:o.implicitTypes).length;w<x;w+=1)if(((C=_[w]).instanceOf||C.predicate)&&(!C.instanceOf||\"object\"==typeof s&&s instanceof C.instanceOf)&&(!C.predicate||C.predicate(s))){if(i?C.multi&&C.representName?o.tag=C.representName(s):o.tag=C.tag:o.tag=\"?\",C.represent){if(j=o.styleMap[C.tag]||C.defaultStyle,\"[object Function]\"===rn.call(C.represent))u=C.represent(s,j);else{if(!nn.call(C.represent,j))throw new sr(\"!<\"+C.tag+'> tag resolver accepts not \"'+j+'\" style');u=C.represent[j](s,j)}o.dump=u}return!0}return!1}function writeNode(o,s,i,u,_,w,x){o.tag=null,o.dump=i,detectType(o,i,!1)||detectType(o,i,!0);var C,j=rn.call(o.dump),L=u;u&&(u=o.flowLevel<0||o.flowLevel>s);var B,$,V=\"[object Object]\"===j||\"[object Array]\"===j;if(V&&($=-1!==(B=o.duplicates.indexOf(i))),(null!==o.tag&&\"?\"!==o.tag||$||2!==o.indent&&s>0)&&(_=!1),$&&o.usedDuplicates[B])o.dump=\"*ref_\"+B;else{if(V&&$&&!o.usedDuplicates[B]&&(o.usedDuplicates[B]=!0),\"[object Object]\"===j)u&&0!==Object.keys(o.dump).length?(!function writeBlockMapping(o,s,i,u){var _,w,x,C,j,L,B=\"\",$=o.tag,V=Object.keys(i);if(!0===o.sortKeys)V.sort();else if(\"function\"==typeof o.sortKeys)V.sort(o.sortKeys);else if(o.sortKeys)throw new sr(\"sortKeys must be a boolean or a function\");for(_=0,w=V.length;_<w;_+=1)L=\"\",u&&\"\"===B||(L+=generateNextLine(o,s)),C=i[x=V[_]],o.replacer&&(C=o.replacer.call(i,x,C)),writeNode(o,s+1,x,!0,!0,!0)&&((j=null!==o.tag&&\"?\"!==o.tag||o.dump&&o.dump.length>1024)&&(o.dump&&an===o.dump.charCodeAt(0)?L+=\"?\":L+=\"? \"),L+=o.dump,j&&(L+=generateNextLine(o,s)),writeNode(o,s+1,C,!0,j)&&(o.dump&&an===o.dump.charCodeAt(0)?L+=\":\":L+=\": \",B+=L+=o.dump));o.tag=$,o.dump=B||\"{}\"}(o,s,o.dump,_),$&&(o.dump=\"&ref_\"+B+o.dump)):(!function writeFlowMapping(o,s,i){var u,_,w,x,C,j=\"\",L=o.tag,B=Object.keys(i);for(u=0,_=B.length;u<_;u+=1)C=\"\",\"\"!==j&&(C+=\", \"),o.condenseFlow&&(C+='\"'),x=i[w=B[u]],o.replacer&&(x=o.replacer.call(i,w,x)),writeNode(o,s,w,!1,!1)&&(o.dump.length>1024&&(C+=\"? \"),C+=o.dump+(o.condenseFlow?'\"':\"\")+\":\"+(o.condenseFlow?\"\":\" \"),writeNode(o,s,x,!1,!1)&&(j+=C+=o.dump));o.tag=L,o.dump=\"{\"+j+\"}\"}(o,s,o.dump),$&&(o.dump=\"&ref_\"+B+\" \"+o.dump));else if(\"[object Array]\"===j)u&&0!==o.dump.length?(o.noArrayIndent&&!x&&s>0?writeBlockSequence(o,s-1,o.dump,_):writeBlockSequence(o,s,o.dump,_),$&&(o.dump=\"&ref_\"+B+o.dump)):(!function writeFlowSequence(o,s,i){var u,_,w,x=\"\",C=o.tag;for(u=0,_=i.length;u<_;u+=1)w=i[u],o.replacer&&(w=o.replacer.call(i,String(u),w)),(writeNode(o,s,w,!1,!1)||void 0===w&&writeNode(o,s,null,!1,!1))&&(\"\"!==x&&(x+=\",\"+(o.condenseFlow?\"\":\" \")),x+=o.dump);o.tag=C,o.dump=\"[\"+x+\"]\"}(o,s,o.dump),$&&(o.dump=\"&ref_\"+B+\" \"+o.dump));else{if(\"[object String]\"!==j){if(\"[object Undefined]\"===j)return!1;if(o.skipInvalid)return!1;throw new sr(\"unacceptable kind of an object to dump \"+j)}\"?\"!==o.tag&&writeScalar(o,o.dump,s,w,L)}null!==o.tag&&\"?\"!==o.tag&&(C=encodeURI(\"!\"===o.tag[0]?o.tag.slice(1):o.tag).replace(/!/g,\"%21\"),C=\"!\"===o.tag[0]?\"!\"+C:\"tag:yaml.org,2002:\"===C.slice(0,18)?\"!!\"+C.slice(18):\"!<\"+C+\">\",o.dump=C+\" \"+o.dump)}return!0}function getDuplicateReferences(o,s){var i,u,_=[],w=[];for(inspectNode(o,_,w),i=0,u=w.length;i<u;i+=1)s.duplicates.push(_[w[i]]);s.usedDuplicates=new Array(u)}function inspectNode(o,s,i){var u,_,w;if(null!==o&&\"object\"==typeof o)if(-1!==(_=s.indexOf(o)))-1===i.indexOf(_)&&i.push(_);else if(s.push(o),Array.isArray(o))for(_=0,w=o.length;_<w;_+=1)inspectNode(o[_],s,i);else for(_=0,w=(u=Object.keys(o)).length;_<w;_+=1)inspectNode(o[u[_]],s,i)}var qn=function dump$1(o,s){var i=new State(s=s||{});i.noRefs||getDuplicateReferences(o,i);var u=o;return i.replacer&&(u=i.replacer.call({\"\":u},\"\",u)),writeNode(i,0,u,!0,!0)?i.dump+\"\\n\":\"\"};function renamed(o,s){return function(){throw new Error(\"Function yaml.\"+o+\" is removed in js-yaml 4. Use yaml.\"+s+\" instead, which is now safe by default.\")}}var $n=lr,Vn=ur,Un=mr,zn=wr,Wn=Sr,Kn=Lr,Hn=tn.load,Jn=tn.loadAll,Gn={dump:qn}.dump,Yn=sr,Xn={binary:jr,float:Er,map:fr,null:gr,pairs:Tr,set:Dr,timestamp:Or,bool:yr,int:vr,merge:Cr,omap:Mr,seq:dr,str:pr},Qn=renamed(\"safeLoad\",\"load\"),Zn=renamed(\"safeLoadAll\",\"loadAll\"),eo=renamed(\"safeDump\",\"dump\");const to={Type:$n,Schema:Vn,FAILSAFE_SCHEMA:Un,JSON_SCHEMA:zn,CORE_SCHEMA:Wn,DEFAULT_SCHEMA:Kn,load:Hn,loadAll:Jn,dump:Gn,YAMLException:Yn,types:Xn,safeLoad:Qn,safeLoadAll:Zn,safeDump:eo},ro=\"configs_update\",no=\"configs_toggle\";function update(o,s){return{type:ro,payload:{[o]:s}}}function toggle(o){return{type:no,payload:o}}const actions_loaded=()=>()=>{},downloadConfig=o=>s=>{const{fn:{fetch:i}}=s;return i(o)},getConfigByUrl=(o,s)=>i=>{const{specActions:u,configsActions:_}=i;if(o)return _.downloadConfig(o).then(next,next);function next(_){_ instanceof Error||_.status>=400?(u.updateLoadingStatus(\"failedConfig\"),u.updateLoadingStatus(\"failedConfig\"),u.updateUrl(\"\"),console.error(_.statusText+\" \"+o.url),s(null)):s(((o,s)=>{try{return to.load(o)}catch(o){return s&&s.errActions.newThrownErr(new Error(o)),{}}})(_.text,i))}},get=(o,s)=>o.getIn(Array.isArray(s)?s:[s]),oo={[ro]:(o,s)=>o.merge((0,qe.fromJS)(s.payload)),[no]:(o,s)=>{const i=s.payload,u=o.get(i);return o.set(i,!u)}};function configsPlugin(){return{statePlugins:{configs:{reducers:oo,actions:u,selectors:w}}}}const setHash=o=>o?history.pushState(null,null,`#${o}`):window.location.hash=\"\";var so=__webpack_require__(86215),io=__webpack_require__.n(so);const ao=\"layout_scroll_to\",co=\"layout_clear_scroll\";const lo={fn:{getScrollParent:function getScrollParent(o,s){const i=document.documentElement;let u=getComputedStyle(o);const _=\"absolute\"===u.position,w=s?/(auto|scroll|hidden)/:/(auto|scroll)/;if(\"fixed\"===u.position)return i;for(let s=o;s=s.parentElement;)if(u=getComputedStyle(s),(!_||\"static\"!==u.position)&&w.test(u.overflow+u.overflowY+u.overflowX))return s;return i}},statePlugins:{layout:{actions:{scrollToElement:(o,s)=>i=>{try{s=s||i.fn.getScrollParent(o),io().createScroller(s).to(o)}catch(o){console.error(o)}},scrollTo:o=>({type:ao,payload:Array.isArray(o)?o:[o]}),clearScrollTo:()=>({type:co}),readyToScroll:(o,s)=>i=>{const u=i.layoutSelectors.getScrollToKey();$e().is(u,(0,qe.fromJS)(o))&&(i.layoutActions.scrollToElement(s),i.layoutActions.clearScrollTo())},parseDeepLinkHash:o=>({layoutActions:s,layoutSelectors:i,getConfigs:u})=>{if(u().deepLinking&&o){let u=o.slice(1);\"!\"===u[0]&&(u=u.slice(1)),\"/\"===u[0]&&(u=u.slice(1));const _=u.split(\"/\").map((o=>o||\"\")),w=i.isShownKeyFromUrlHashArray(_),[x,C=\"\",j=\"\"]=w;if(\"operations\"===x){const o=i.isShownKeyFromUrlHashArray([C]);C.indexOf(\"_\")>-1&&(console.warn(\"Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.\"),s.show(o.map((o=>o.replace(/_/g,\" \"))),!0)),s.show(o,!0)}(C.indexOf(\"_\")>-1||j.indexOf(\"_\")>-1)&&(console.warn(\"Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.\"),s.show(w.map((o=>o.replace(/_/g,\" \"))),!0)),s.show(w,!0),s.scrollTo(w)}}},selectors:{getScrollToKey:o=>o.get(\"scrollToKey\"),isShownKeyFromUrlHashArray(o,s){const[i,u]=s;return u?[\"operations\",i,u]:i?[\"operations-tag\",i]:[]},urlHashArrayFromIsShownKey(o,s){let[i,u,_]=s;return\"operations\"==i?[u,_]:\"operations-tag\"==i?[u]:[]}},reducers:{[ao]:(o,s)=>o.set(\"scrollToKey\",$e().fromJS(s.payload)),[co]:o=>o.delete(\"scrollToKey\")},wrapActions:{show:(o,{getConfigs:s,layoutSelectors:i})=>(...u)=>{if(o(...u),s().deepLinking)try{let[o,s]=u;o=Array.isArray(o)?o:[o];const _=i.urlHashArrayFromIsShownKey(o);if(!_.length)return;const[w,x]=_;if(!s)return setHash(\"/\");2===_.length?setHash(createDeepLinkPath(`/${encodeURIComponent(w)}/${encodeURIComponent(x)}`)):1===_.length&&setHash(createDeepLinkPath(`/${encodeURIComponent(w)}`))}catch(o){console.error(o)}}}}}};var uo=__webpack_require__(2209),po=__webpack_require__.n(uo);const operation_wrapper=(o,s)=>class OperationWrapper extends Pe.Component{onLoad=o=>{const{operation:i}=this.props,{tag:u,operationId:_}=i.toObject();let{isShownKey:w}=i.toObject();w=w||[\"operations\",u,_],s.layoutActions.readyToScroll(w,o)};render(){return Pe.createElement(\"span\",{ref:this.onLoad},Pe.createElement(o,this.props))}},operation_tag_wrapper=(o,s)=>class OperationTagWrapper extends Pe.Component{onLoad=o=>{const{tag:i}=this.props,u=[\"operations-tag\",i];s.layoutActions.readyToScroll(u,o)};render(){return Pe.createElement(\"span\",{ref:this.onLoad},Pe.createElement(o,this.props))}};function deep_linking(){return[lo,{statePlugins:{configs:{wrapActions:{loaded:(o,s)=>(...i)=>{o(...i);const u=decodeURIComponent(window.location.hash);s.layoutActions.parseDeepLinkHash(u)}}}},wrapComponents:{operation:operation_wrapper,OperationTag:operation_tag_wrapper}}]}var ho=__webpack_require__(40860),fo=__webpack_require__.n(ho);function transform(o){return o.map((o=>{let s=\"is not of a type(s)\",i=o.get(\"message\").indexOf(s);if(i>-1){let s=o.get(\"message\").slice(i+19).split(\",\");return o.set(\"message\",o.get(\"message\").slice(0,i)+function makeNewMessage(o){return o.reduce(((o,s,i,u)=>i===u.length-1&&u.length>1?o+\"or \"+s:u[i+1]&&u.length>2?o+s+\", \":u[i+1]?o+s+\" \":o+s),\"should be a\")}(s))}return o}))}var mo=__webpack_require__(58156),go=__webpack_require__.n(mo);function parameter_oneof_transform(o,{jsSpec:s}){return o}const yo=[x,C];function transformErrors(o){let s={jsSpec:{}},i=fo()(yo,((o,i)=>{try{return i.transform(o,s).filter((o=>!!o))}catch(s){return console.error(\"Transformer error:\",s),o}}),o);return i.filter((o=>!!o)).map((o=>(!o.get(\"line\")&&o.get(\"path\"),o)))}let vo={line:0,level:\"error\",message:\"Unknown error\"};const bo=Wt((o=>o),(o=>o.get(\"errors\",(0,qe.List)()))),_o=Wt(bo,(o=>o.last()));function err(s){return{statePlugins:{err:{reducers:{[et]:(o,{payload:s})=>{let i=Object.assign(vo,s,{type:\"thrown\"});return o.update(\"errors\",(o=>(o||(0,qe.List)()).push((0,qe.fromJS)(i)))).update(\"errors\",(o=>transformErrors(o)))},[tt]:(o,{payload:s})=>(s=s.map((o=>(0,qe.fromJS)(Object.assign(vo,o,{type:\"thrown\"})))),o.update(\"errors\",(o=>(o||(0,qe.List)()).concat((0,qe.fromJS)(s)))).update(\"errors\",(o=>transformErrors(o)))),[rt]:(o,{payload:s})=>{let i=(0,qe.fromJS)(s);return i=i.set(\"type\",\"spec\"),o.update(\"errors\",(o=>(o||(0,qe.List)()).push((0,qe.fromJS)(i)).sortBy((o=>o.get(\"line\"))))).update(\"errors\",(o=>transformErrors(o)))},[nt]:(o,{payload:s})=>(s=s.map((o=>(0,qe.fromJS)(Object.assign(vo,o,{type:\"spec\"})))),o.update(\"errors\",(o=>(o||(0,qe.List)()).concat((0,qe.fromJS)(s)))).update(\"errors\",(o=>transformErrors(o)))),[ot]:(o,{payload:s})=>{let i=(0,qe.fromJS)(Object.assign({},s));return i=i.set(\"type\",\"auth\"),o.update(\"errors\",(o=>(o||(0,qe.List)()).push((0,qe.fromJS)(i)))).update(\"errors\",(o=>transformErrors(o)))},[st]:(o,{payload:s})=>{if(!s||!o.get(\"errors\"))return o;let i=o.get(\"errors\").filter((o=>o.keySeq().every((i=>{const u=o.get(i),_=s[i];return!_||u!==_}))));return o.merge({errors:i})},[it]:(o,{payload:s})=>{if(!s||\"function\"!=typeof s)return o;let i=o.get(\"errors\").filter((o=>s(o)));return o.merge({errors:i})}},actions:o,selectors:j}}}}function opsFilter(o,s){return o.filter(((o,i)=>-1!==i.indexOf(s)))}function filter(){return{fn:{opsFilter}}}var Eo=__webpack_require__(7666),wo=__webpack_require__.n(Eo);const arrow_up=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z\"})),arrow_down=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z\"})),arrow=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z\"})),components_close=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z\"})),copy=({className:o=null,width:s=15,height:i=16,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 15 16\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"g\",{transform:\"translate(2, -1)\"},Pe.createElement(\"path\",{fill:\"#ffffff\",fillRule:\"evenodd\",d:\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"}))),lock=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z\"})),unlock=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z\"})),icons=()=>({components:{ArrowUpIcon:arrow_up,ArrowDownIcon:arrow_down,ArrowIcon:arrow,CloseIcon:components_close,CopyIcon:copy,LockIcon:lock,UnlockIcon:unlock}}),So=\"layout_update_layout\",xo=\"layout_update_filter\",ko=\"layout_update_mode\",Oo=\"layout_show\";function updateLayout(o){return{type:So,payload:o}}function updateFilter(o){return{type:xo,payload:o}}function actions_show(o,s=!0){return o=normalizeArray(o),{type:Oo,payload:{thing:o,shown:s}}}function changeMode(o,s=\"\"){return o=normalizeArray(o),{type:ko,payload:{thing:o,mode:s}}}const Co={[So]:(o,s)=>o.set(\"layout\",s.payload),[xo]:(o,s)=>o.set(\"filter\",s.payload),[Oo]:(o,s)=>{const i=s.payload.shown,u=(0,qe.fromJS)(s.payload.thing);return o.update(\"shown\",(0,qe.fromJS)({}),(o=>o.set(u,i)))},[ko]:(o,s)=>{let i=s.payload.thing,u=s.payload.mode;return o.setIn([\"modes\"].concat(i),(u||\"\")+\"\")}},current=o=>o.get(\"layout\"),currentFilter=o=>o.get(\"filter\"),isShown=(o,s,i)=>(s=normalizeArray(s),o.get(\"shown\",(0,qe.fromJS)({})).get((0,qe.fromJS)(s),i)),whatMode=(o,s,i=\"\")=>(s=normalizeArray(s),o.getIn([\"modes\",...s],i)),Ao=Wt((o=>o),(o=>!isShown(o,\"editor\"))),taggedOperations=(o,s)=>(i,...u)=>{let _=o(i,...u);const{fn:w,layoutSelectors:x,getConfigs:C}=s.getSystem(),j=C(),{maxDisplayedTags:L}=j;let B=x.currentFilter();return B&&!0!==B&&(_=w.opsFilter(_,B)),L>=0&&(_=_.slice(0,L)),_};function plugins_layout(){return{statePlugins:{layout:{reducers:Co,actions:L,selectors:B},spec:{wrapSelectors:$}}}}function logs({configs:o}){const s={debug:0,info:1,log:2,warn:3,error:4},getLevel=o=>s[o]||-1;let{logLevel:i}=o,u=getLevel(i);function log(o,...s){getLevel(o)>=u&&console[o](...s)}return log.warn=log.bind(null,\"warn\"),log.error=log.bind(null,\"error\"),log.info=log.bind(null,\"info\"),log.debug=log.bind(null,\"debug\"),{rootInjects:{log}}}let jo=!1;function on_complete(){return{statePlugins:{spec:{wrapActions:{updateSpec:o=>(...s)=>(jo=!0,o(...s)),updateJsonSpec:(o,s)=>(...i)=>{const u=s.getConfigs().onComplete;return jo&&\"function\"==typeof u&&(setTimeout(u,0),jo=!1),o(...i)}}}}}}const extractKey=o=>{const s=\"_**[]\";return o.indexOf(s)<0?o:o.split(s)[0].trim()},escapeShell=o=>\"-d \"===o||/^[_\\/-]/g.test(o)?o:\"'\"+o.replace(/'/g,\"'\\\\''\")+\"'\",escapeCMD=o=>\"-d \"===(o=o.replace(/\\^/g,\"^^\").replace(/\\\\\"/g,'\\\\\\\\\"').replace(/\"/g,'\"\"').replace(/\\n/g,\"^\\n\"))?o.replace(/-d /g,\"-d ^\\n\"):/^[_\\/-]/g.test(o)?o:'\"'+o+'\"',escapePowershell=o=>{if(\"-d \"===o)return o;if(/\\n/.test(o)){return`@\"\\n${o.replace(/`/g,\"``\").replace(/\\$/g,\"`$\")}\\n\"@`}if(!/^[_\\/-]/.test(o)){return`'${o.replace(/'/g,\"''\")}'`}return o};const curlify=(o,s,i,u=\"\")=>{let _=!1,w=\"\";const addWords=(...o)=>w+=\" \"+o.map(s).join(\" \"),addWordsWithoutLeadingSpace=(...o)=>w+=o.map(s).join(\" \"),addNewLine=()=>w+=` ${i}`,addIndent=(o=1)=>w+=\"  \".repeat(o);let x=o.get(\"headers\");w+=\"curl\"+u;const C=o.get(\"curlOptions\");if(qe.List.isList(C)&&!C.isEmpty()&&addWords(...o.get(\"curlOptions\")),addWords(\"-X\",o.get(\"method\")),addNewLine(),addIndent(),addWordsWithoutLeadingSpace(`${o.get(\"url\")}`),x&&x.size)for(let s of o.get(\"headers\").entries()){addNewLine(),addIndent();let[o,i]=s;addWordsWithoutLeadingSpace(\"-H\",`${o}: ${i}`),_=_||/^content-type$/i.test(o)&&/^multipart\\/form-data$/i.test(i)}const j=o.get(\"body\");if(j)if(_&&[\"POST\",\"PUT\",\"PATCH\"].includes(o.get(\"method\")))for(let[o,s]of j.entrySeq()){let i=extractKey(o);addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-F\"),s instanceof at.File&&\"string\"==typeof s.valueOf()?addWords(`${i}=${s.data}${s.type?`;type=${s.type}`:\"\"}`):s instanceof at.File?addWords(`${i}=@${s.name}${s.type?`;type=${s.type}`:\"\"}`):addWords(`${i}=${s}`)}else if(j instanceof at.File)addNewLine(),addIndent(),addWordsWithoutLeadingSpace(`--data-binary '@${j.name}'`);else{addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-d \");let s=j;qe.Map.isMap(s)?addWordsWithoutLeadingSpace(function getStringBodyOfMap(o){let s=[];for(let[i,u]of o.get(\"body\").entrySeq()){let o=extractKey(i);u instanceof at.File?s.push(`  \"${o}\": {\\n    \"name\": \"${u.name}\"${u.type?`,\\n    \"type\": \"${u.type}\"`:\"\"}\\n  }`):s.push(`  \"${o}\": ${JSON.stringify(u,null,2).replace(/(\\r\\n|\\r|\\n)/g,\"\\n  \")}`)}return`{\\n${s.join(\",\\n\")}\\n}`}(o)):(\"string\"!=typeof s&&(s=JSON.stringify(s)),addWordsWithoutLeadingSpace(s))}else j||\"POST\"!==o.get(\"method\")||(addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-d ''\"));return w},requestSnippetGenerator_curl_powershell=o=>curlify(o,escapePowershell,\"`\\n\",\".exe\"),requestSnippetGenerator_curl_bash=o=>curlify(o,escapeShell,\"\\\\\\n\"),requestSnippetGenerator_curl_cmd=o=>curlify(o,escapeCMD,\"^\\n\"),request_snippets_selectors_state=o=>o||(0,qe.Map)(),Po=Wt(request_snippets_selectors_state,(o=>{const s=o.get(\"languages\"),i=o.get(\"generators\",(0,qe.Map)());return!s||s.isEmpty()?i:i.filter(((o,i)=>s.includes(i)))})),getSnippetGenerators=o=>({fn:s})=>Po(o).map(((o,i)=>{const u=(o=>s[`requestSnippetGenerator_${o}`])(i);return\"function\"!=typeof u?null:o.set(\"fn\",u)})).filter((o=>o)),Io=Wt(request_snippets_selectors_state,(o=>o.get(\"activeLanguage\"))),Mo=Wt(request_snippets_selectors_state,(o=>o.get(\"defaultExpanded\")));var No=__webpack_require__(46942),To=__webpack_require__.n(No),Ro=__webpack_require__(59399);const Do={cursor:\"pointer\",lineHeight:1,display:\"inline-flex\",backgroundColor:\"rgb(250, 250, 250)\",paddingBottom:\"0\",paddingTop:\"0\",border:\"1px solid rgb(51, 51, 51)\",borderRadius:\"4px 4px 0 0\",boxShadow:\"none\",borderBottom:\"none\"},Lo={cursor:\"pointer\",lineHeight:1,display:\"inline-flex\",backgroundColor:\"rgb(51, 51, 51)\",boxShadow:\"none\",border:\"1px solid rgb(51, 51, 51)\",paddingBottom:\"0\",paddingTop:\"0\",borderRadius:\"4px 4px 0 0\",marginTop:\"-5px\",marginRight:\"-5px\",marginLeft:\"-5px\",zIndex:\"9999\",borderBottom:\"none\"},request_snippets=({request:o,requestSnippetsSelectors:s,getComponent:i})=>{const u=(0,Pe.useRef)(null),_=i(\"ArrowUpIcon\"),w=i(\"ArrowDownIcon\"),x=i(\"SyntaxHighlighter\",!0),[C,j]=(0,Pe.useState)(s.getSnippetGenerators()?.keySeq().first()),[L,B]=(0,Pe.useState)(s?.getDefaultExpanded()),$=s.getSnippetGenerators(),V=$.get(C),U=V.get(\"fn\")(o),handleSetIsExpanded=()=>{B(!L)},handleGetBtnStyle=o=>o===C?Lo:Do,handlePreventYScrollingBeyondElement=o=>{const{target:s,deltaY:i}=o,{scrollHeight:u,offsetHeight:_,scrollTop:w}=s;u>_&&(0===w&&i<0||_+w>=u&&i>0)&&o.preventDefault()};return(0,Pe.useEffect)((()=>{}),[]),(0,Pe.useEffect)((()=>{const o=Array.from(u.current.childNodes).filter((o=>!!o.nodeType&&o.classList?.contains(\"curl-command\")));return o.forEach((o=>o.addEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement,{passive:!1}))),()=>{o.forEach((o=>o.removeEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement)))}}),[o]),Pe.createElement(\"div\",{className:\"request-snippets\",ref:u},Pe.createElement(\"div\",{style:{width:\"100%\",display:\"flex\",justifyContent:\"flex-start\",alignItems:\"center\",marginBottom:\"15px\"}},Pe.createElement(\"h4\",{onClick:()=>handleSetIsExpanded(),style:{cursor:\"pointer\"}},\"Snippets\"),Pe.createElement(\"button\",{onClick:()=>handleSetIsExpanded(),style:{border:\"none\",background:\"none\"},title:L?\"Collapse operation\":\"Expand operation\"},L?Pe.createElement(w,{className:\"arrow\",width:\"10\",height:\"10\"}):Pe.createElement(_,{className:\"arrow\",width:\"10\",height:\"10\"}))),L&&Pe.createElement(\"div\",{className:\"curl-command\"},Pe.createElement(\"div\",{style:{paddingLeft:\"15px\",paddingRight:\"10px\",width:\"100%\",display:\"flex\"}},$.entrySeq().map((([o,s])=>Pe.createElement(\"div\",{className:To()(\"btn\",{active:o===C}),style:handleGetBtnStyle(o),key:o,onClick:()=>(o=>{C!==o&&j(o)})(o)},Pe.createElement(\"h4\",{style:o===C?{color:\"white\"}:{}},s.get(\"title\")))))),Pe.createElement(\"div\",{className:\"copy-to-clipboard\"},Pe.createElement(Ro.CopyToClipboard,{text:U},Pe.createElement(\"button\",null))),Pe.createElement(\"div\",null,Pe.createElement(x,{language:V.get(\"syntax\"),className:\"curl microlight\",renderPlainText:({children:o,PlainTextViewer:s})=>Pe.createElement(s,{className:\"curl\"},o)},U))))},plugins_request_snippets=()=>({components:{RequestSnippets:request_snippets},fn:V,statePlugins:{requestSnippets:{selectors:U}}});class ModelCollapse extends Pe.Component{static defaultProps={collapsedContent:\"{...}\",expanded:!1,title:null,onToggle:()=>{},hideSelfOnExpand:!1,specPath:$e().List([])};constructor(o,s){super(o,s);let{expanded:i,collapsedContent:u}=this.props;this.state={expanded:i,collapsedContent:u||ModelCollapse.defaultProps.collapsedContent}}componentDidMount(){const{hideSelfOnExpand:o,expanded:s,modelName:i}=this.props;o&&s&&this.props.onToggle(i,s)}UNSAFE_componentWillReceiveProps(o){this.props.expanded!==o.expanded&&this.setState({expanded:o.expanded})}toggleCollapsed=()=>{this.props.onToggle&&this.props.onToggle(this.props.modelName,!this.state.expanded),this.setState({expanded:!this.state.expanded})};onLoad=o=>{if(o&&this.props.layoutSelectors){const s=this.props.layoutSelectors.getScrollToKey();$e().is(s,this.props.specPath)&&this.toggleCollapsed(),this.props.layoutActions.readyToScroll(this.props.specPath,o.parentElement)}};render(){const{title:o,classes:s}=this.props;return this.state.expanded&&this.props.hideSelfOnExpand?Pe.createElement(\"span\",{className:s||\"\"},this.props.children):Pe.createElement(\"span\",{className:s||\"\",ref:this.onLoad},Pe.createElement(\"button\",{\"aria-expanded\":this.state.expanded,className:\"model-box-control\",onClick:this.toggleCollapsed},o&&Pe.createElement(\"span\",{className:\"pointer\"},o),Pe.createElement(\"span\",{className:\"model-toggle\"+(this.state.expanded?\"\":\" collapsed\")}),!this.state.expanded&&Pe.createElement(\"span\",null,this.state.collapsedContent)),this.state.expanded&&this.props.children)}}const useTabs=({initialTab:o,isExecute:s,schema:i,example:u})=>{const _=(0,Pe.useMemo)((()=>({example:\"example\",model:\"model\"})),[]),w=(0,Pe.useMemo)((()=>Object.keys(_)),[_]).includes(o)&&i&&!s?o:_.example,x=(o=>{const s=(0,Pe.useRef)();return(0,Pe.useEffect)((()=>{s.current=o})),s.current})(s),[C,j]=(0,Pe.useState)(w),L=(0,Pe.useCallback)((o=>{j(o.target.dataset.name)}),[]);return(0,Pe.useEffect)((()=>{x&&!s&&u&&j(_.example)}),[x,s,u]),{activeTab:C,onTabChange:L,tabs:_}},model_example=({schema:o,example:s,isExecute:i=!1,specPath:u,includeWriteOnly:_=!1,includeReadOnly:w=!1,getComponent:x,getConfigs:C,specSelectors:j})=>{const{defaultModelRendering:L,defaultModelExpandDepth:B}=C(),$=x(\"ModelWrapper\"),V=x(\"HighlightCode\",!0),U=St()(5).toString(\"base64\"),z=St()(5).toString(\"base64\"),Y=St()(5).toString(\"base64\"),Z=St()(5).toString(\"base64\"),ee=j.isOAS3(),{activeTab:ie,tabs:ae,onTabChange:ce}=useTabs({initialTab:L,isExecute:i,schema:o,example:s});return Pe.createElement(\"div\",{className:\"model-example\"},Pe.createElement(\"ul\",{className:\"tab\",role:\"tablist\"},Pe.createElement(\"li\",{className:To()(\"tabitem\",{active:ie===ae.example}),role:\"presentation\"},Pe.createElement(\"button\",{\"aria-controls\":z,\"aria-selected\":ie===ae.example,className:\"tablinks\",\"data-name\":\"example\",id:U,onClick:ce,role:\"tab\"},i?\"Edit Value\":\"Example Value\")),o&&Pe.createElement(\"li\",{className:To()(\"tabitem\",{active:ie===ae.model}),role:\"presentation\"},Pe.createElement(\"button\",{\"aria-controls\":Z,\"aria-selected\":ie===ae.model,className:To()(\"tablinks\",{inactive:i}),\"data-name\":\"model\",id:Y,onClick:ce,role:\"tab\"},ee?\"Schema\":\"Model\"))),ie===ae.example&&Pe.createElement(\"div\",{\"aria-hidden\":ie!==ae.example,\"aria-labelledby\":U,\"data-name\":\"examplePanel\",id:z,role:\"tabpanel\",tabIndex:\"0\"},s||Pe.createElement(V,null,\"(no example available\")),ie===ae.model&&Pe.createElement(\"div\",{\"aria-hidden\":ie===ae.example,\"aria-labelledby\":Y,\"data-name\":\"modelPanel\",id:Z,role:\"tabpanel\",tabIndex:\"0\"},Pe.createElement($,{schema:o,getComponent:x,getConfigs:C,specSelectors:j,expandDepth:B,specPath:u,includeReadOnly:w,includeWriteOnly:_})))};class ModelWrapper extends Pe.Component{onToggle=(o,s)=>{this.props.layoutActions&&this.props.layoutActions.show(this.props.fullPath,s)};render(){let{getComponent:o,getConfigs:s}=this.props;const i=o(\"Model\");let u;return this.props.layoutSelectors&&(u=this.props.layoutSelectors.isShown(this.props.fullPath)),Pe.createElement(\"div\",{className:\"model-box\"},Pe.createElement(i,wo()({},this.props,{getConfigs:s,expanded:u,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}function _typeof(o){return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},_typeof(o)}function _defineProperties(o,s){for(var i=0;i<s.length;i++){var u=s[i];u.enumerable=u.enumerable||!1,u.configurable=!0,\"value\"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function _defineProperty(o,s,i){return s in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}function ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(o)}function _setPrototypeOf(o,s){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,s){return o.__proto__=s,o},_setPrototypeOf(o,s)}function _possibleConstructorReturn(o,s){return!s||\"object\"!=typeof s&&\"function\"!=typeof s?function _assertThisInitialized(o){if(void 0===o)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return o}(o):s}var Bo={};function react_immutable_pure_component_es_get(o,s,i){return function isInvalid(o){return null==o}(o)?i:function isMapLike(o){return null!==o&&\"object\"===_typeof(o)&&\"function\"==typeof o.get&&\"function\"==typeof o.has}(o)?o.has(s)?o.get(s):i:hasOwnProperty.call(o,s)?o[s]:i}function getIn(o,s,i){for(var u=0;u!==s.length;)if((o=react_immutable_pure_component_es_get(o,s[u++],Bo))===Bo)return i;return o}function check(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=function createChecker(o,s){return function(i){if(\"string\"==typeof i)return(0,qe.is)(s[i],o[i]);if(Array.isArray(i))return(0,qe.is)(getIn(s,i),getIn(o,i));throw new TypeError(\"Invalid key: expected Array or string: \"+i)}}(s,i),_=o||Object.keys(function _objectSpread2(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(i,!0).forEach((function(s){_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):ownKeys(i).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}({},i,{},s));return _.every(u)}const Fo=function(o){function ImmutablePureComponent(){return function _classCallCheck(o,s){if(!(o instanceof s))throw new TypeError(\"Cannot call a class as a function\")}(this,ImmutablePureComponent),_possibleConstructorReturn(this,_getPrototypeOf(ImmutablePureComponent).apply(this,arguments))}return function _inherits(o,s){if(\"function\"!=typeof s&&null!==s)throw new TypeError(\"Super expression must either be null or a function\");o.prototype=Object.create(s&&s.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),s&&_setPrototypeOf(o,s)}(ImmutablePureComponent,o),function _createClass(o,s,i){return s&&_defineProperties(o.prototype,s),i&&_defineProperties(o,i),o}(ImmutablePureComponent,[{key:\"shouldComponentUpdate\",value:function shouldComponentUpdate(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!check(this.updateOnProps,this.props,o,\"updateOnProps\")||!check(this.updateOnStates,this.state,s,\"updateOnStates\")}}]),ImmutablePureComponent}(Pe.Component);var qo,$o=__webpack_require__(5556),Vo=__webpack_require__.n($o);function _extends(){return _extends=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(o[u]=i[u])}return o},_extends.apply(this,arguments)}const rolling_load=o=>Pe.createElement(\"svg\",_extends({xmlns:\"http://www.w3.org/2000/svg\",width:200,height:200,className:\"rolling-load_svg__lds-rolling\",preserveAspectRatio:\"xMidYMid\",style:{backgroundImage:\"none\",backgroundPosition:\"initial initial\",backgroundRepeat:\"initial initial\"},viewBox:\"0 0 100 100\"},o),qo||(qo=Pe.createElement(\"circle\",{cx:50,cy:50,r:35,fill:\"none\",stroke:\"#555\",strokeDasharray:\"164.93361431346415 56.97787143782138\",strokeWidth:10},Pe.createElement(\"animateTransform\",{attributeName:\"transform\",begin:\"0s\",calcMode:\"linear\",dur:\"1s\",keyTimes:\"0;1\",repeatCount:\"indefinite\",type:\"rotate\",values:\"0 50 50;360 50 50\"})))),decodeRefName=o=>{const s=o.replace(/~1/g,\"/\").replace(/~0/g,\"~\");try{return decodeURIComponent(s)}catch{return s}};class Model extends Fo{static propTypes={schema:po().map.isRequired,getComponent:Vo().func.isRequired,getConfigs:Vo().func.isRequired,specSelectors:Vo().object.isRequired,name:Vo().string,displayName:Vo().string,isRef:Vo().bool,required:Vo().bool,expandDepth:Vo().number,depth:Vo().number,specPath:po().list.isRequired,includeReadOnly:Vo().bool,includeWriteOnly:Vo().bool};getModelName=o=>-1!==o.indexOf(\"#/definitions/\")?decodeRefName(o.replace(/^.*#\\/definitions\\//,\"\")):-1!==o.indexOf(\"#/components/schemas/\")?decodeRefName(o.replace(/^.*#\\/components\\/schemas\\//,\"\")):void 0;getRefSchema=o=>{let{specSelectors:s}=this.props;return s.findDefinition(o)};render(){let{getComponent:o,getConfigs:s,specSelectors:i,schema:u,required:_,name:w,isRef:x,specPath:C,displayName:j,includeReadOnly:L,includeWriteOnly:B}=this.props;const $=o(\"ObjectModel\"),V=o(\"ArrayModel\"),U=o(\"PrimitiveModel\");let z=\"object\",Y=u&&u.get(\"$$ref\"),Z=u&&u.get(\"$ref\");if(!w&&Y&&(w=this.getModelName(Y)),Z){const o=this.getModelName(Z),s=this.getRefSchema(o);qe.Map.isMap(s)?(u=s.mergeDeep(u),Y||(u=u.set(\"$$ref\",Z),Y=Z)):qe.Map.isMap(u)&&1===u.size&&(u=null,w=Z)}if(!u)return Pe.createElement(\"span\",{className:\"model model-title\"},Pe.createElement(\"span\",{className:\"model-title__text\"},j||w),!Z&&Pe.createElement(rolling_load,{height:\"20px\",width:\"20px\"}));const ee=i.isOAS3()&&u.get(\"deprecated\");switch(x=void 0!==x?x:!!Y,z=u&&u.get(\"type\")||z,z){case\"object\":return Pe.createElement($,wo()({className:\"object\"},this.props,{specPath:C,getConfigs:s,schema:u,name:w,deprecated:ee,isRef:x,includeReadOnly:L,includeWriteOnly:B}));case\"array\":return Pe.createElement(V,wo()({className:\"array\"},this.props,{getConfigs:s,schema:u,name:w,deprecated:ee,required:_,includeReadOnly:L,includeWriteOnly:B}));default:return Pe.createElement(U,wo()({},this.props,{getComponent:o,getConfigs:s,schema:u,name:w,deprecated:ee,required:_}))}}}class Models extends Pe.Component{getSchemaBasePath=()=>this.props.specSelectors.isOAS3()?[\"components\",\"schemas\"]:[\"definitions\"];getCollapsedContent=()=>\" \";handleToggle=(o,s)=>{const{layoutActions:i}=this.props;i.show([...this.getSchemaBasePath(),o],s),s&&this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(),o])};onLoadModels=o=>{o&&this.props.layoutActions.readyToScroll(this.getSchemaBasePath(),o)};onLoadModel=o=>{if(o){const s=o.getAttribute(\"data-name\");this.props.layoutActions.readyToScroll([...this.getSchemaBasePath(),s],o)}};render(){let{specSelectors:o,getComponent:s,layoutSelectors:i,layoutActions:u,getConfigs:_}=this.props,w=o.definitions(),{docExpansion:x,defaultModelsExpandDepth:C}=_();if(!w.size||C<0)return null;const j=this.getSchemaBasePath();let L=i.isShown(j,C>0&&\"none\"!==x);const B=o.isOAS3(),$=s(\"ModelWrapper\"),V=s(\"Collapse\"),U=s(\"ModelCollapse\"),z=s(\"JumpToPath\",!0),Y=s(\"ArrowUpIcon\"),Z=s(\"ArrowDownIcon\");return Pe.createElement(\"section\",{className:L?\"models is-open\":\"models\",ref:this.onLoadModels},Pe.createElement(\"h4\",null,Pe.createElement(\"button\",{\"aria-expanded\":L,className:\"models-control\",onClick:()=>u.show(j,!L)},Pe.createElement(\"span\",null,B?\"Schemas\":\"Models\"),L?Pe.createElement(Y,null):Pe.createElement(Z,null))),Pe.createElement(V,{isOpened:L},w.entrySeq().map((([w])=>{const x=[...j,w],L=$e().List(x),B=o.specResolvedSubtree(x),V=o.specJson().getIn(x),Y=qe.Map.isMap(B)?B:$e().Map(),Z=qe.Map.isMap(V)?V:$e().Map(),ee=Y.get(\"title\")||Z.get(\"title\")||w,ie=i.isShown(x,!1);ie&&0===Y.size&&Z.size>0&&this.props.specActions.requestResolvedSubtree(x);const ae=Pe.createElement($,{name:w,expandDepth:C,schema:Y||$e().Map(),displayName:ee,fullPath:x,specPath:L,getComponent:s,specSelectors:o,getConfigs:_,layoutSelectors:i,layoutActions:u,includeReadOnly:!0,includeWriteOnly:!0}),ce=Pe.createElement(\"span\",{className:\"model-box\"},Pe.createElement(\"span\",{className:\"model model-title\"},ee));return Pe.createElement(\"div\",{id:`model-${w}`,className:\"model-container\",key:`models-section-${w}`,\"data-name\":w,ref:this.onLoadModel},Pe.createElement(\"span\",{className:\"models-jump-to-path\"},Pe.createElement(z,{specPath:L})),Pe.createElement(U,{classes:\"model-box\",collapsedContent:this.getCollapsedContent(w),onToggle:this.handleToggle,title:ce,displayName:ee,modelName:w,specPath:L,layoutSelectors:i,layoutActions:u,hideSelfOnExpand:!0,expanded:C>0&&ie},ae))})).toArray()))}}const enum_model=({value:o,getComponent:s})=>{let i=s(\"ModelCollapse\"),u=Pe.createElement(\"span\",null,\"Array [ \",o.count(),\" ]\");return Pe.createElement(\"span\",{className:\"prop-enum\"},\"Enum:\",Pe.createElement(\"br\",null),Pe.createElement(i,{collapsedContent:u},\"[ \",o.map(String).join(\", \"),\" ]\"))};class ObjectModel extends Pe.Component{render(){let{schema:o,name:s,displayName:i,isRef:u,getComponent:_,getConfigs:w,depth:x,onToggle:C,expanded:j,specPath:L,...B}=this.props,{specSelectors:$,expandDepth:V,includeReadOnly:U,includeWriteOnly:z}=B;const{isOAS3:Y}=$;if(!o)return null;const{showExtensions:Z}=w();let ee=o.get(\"description\"),ie=o.get(\"properties\"),ae=o.get(\"additionalProperties\"),ce=o.get(\"title\")||i||s,le=o.get(\"required\"),pe=o.filter(((o,s)=>-1!==[\"maxProperties\",\"minProperties\",\"nullable\",\"example\"].indexOf(s))),de=o.get(\"deprecated\"),fe=o.getIn([\"externalDocs\",\"url\"]),ye=o.getIn([\"externalDocs\",\"description\"]);const be=_(\"JumpToPath\",!0),_e=_(\"Markdown\",!0),we=_(\"Model\"),Se=_(\"ModelCollapse\"),xe=_(\"Property\"),Te=_(\"Link\"),JumpToPathSection=()=>Pe.createElement(\"span\",{className:\"model-jump-to-path\"},Pe.createElement(be,{specPath:L})),Re=Pe.createElement(\"span\",null,Pe.createElement(\"span\",null,\"{\"),\"...\",Pe.createElement(\"span\",null,\"}\"),u?Pe.createElement(JumpToPathSection,null):\"\"),$e=$.isOAS3()?o.get(\"allOf\"):null,ze=$.isOAS3()?o.get(\"anyOf\"):null,We=$.isOAS3()?o.get(\"oneOf\"):null,He=$.isOAS3()?o.get(\"not\"):null,Ye=ce&&Pe.createElement(\"span\",{className:\"model-title\"},u&&o.get(\"$$ref\")&&Pe.createElement(\"span\",{className:\"model-hint\"},o.get(\"$$ref\")),Pe.createElement(\"span\",{className:\"model-title__text\"},ce));return Pe.createElement(\"span\",{className:\"model\"},Pe.createElement(Se,{modelName:s,title:Ye,onToggle:C,expanded:!!j||x<=V,collapsedContent:Re},Pe.createElement(\"span\",{className:\"brace-open object\"},\"{\"),u?Pe.createElement(JumpToPathSection,null):null,Pe.createElement(\"span\",{className:\"inner-object\"},Pe.createElement(\"table\",{className:\"model\"},Pe.createElement(\"tbody\",null,ee?Pe.createElement(\"tr\",{className:\"description\"},Pe.createElement(\"td\",null,\"description:\"),Pe.createElement(\"td\",null,Pe.createElement(_e,{source:ee}))):null,fe&&Pe.createElement(\"tr\",{className:\"external-docs\"},Pe.createElement(\"td\",null,\"externalDocs:\"),Pe.createElement(\"td\",null,Pe.createElement(Te,{target:\"_blank\",href:sanitizeUrl(fe)},ye||fe))),de?Pe.createElement(\"tr\",{className:\"property\"},Pe.createElement(\"td\",null,\"deprecated:\"),Pe.createElement(\"td\",null,\"true\")):null,ie&&ie.size?ie.entrySeq().filter((([,o])=>(!o.get(\"readOnly\")||U)&&(!o.get(\"writeOnly\")||z))).map((([o,i])=>{let u=Y()&&i.get(\"deprecated\"),C=qe.List.isList(le)&&le.contains(o),j=[\"property-row\"];return u&&j.push(\"deprecated\"),C&&j.push(\"required\"),Pe.createElement(\"tr\",{key:o,className:j.join(\" \")},Pe.createElement(\"td\",null,o,C&&Pe.createElement(\"span\",{className:\"star\"},\"*\")),Pe.createElement(\"td\",null,Pe.createElement(we,wo()({key:`object-${s}-${o}_${i}`},B,{required:C,getComponent:_,specPath:L.push(\"properties\",o),getConfigs:w,schema:i,depth:x+1}))))})).toArray():null,Z?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\" \")):null,Z?o.entrySeq().map((([o,s])=>{if(\"x-\"!==o.slice(0,2))return;const i=s?s.toJS?s.toJS():s:null;return Pe.createElement(\"tr\",{key:o,className:\"extension\"},Pe.createElement(\"td\",null,o),Pe.createElement(\"td\",null,JSON.stringify(i)))})).toArray():null,ae&&ae.size?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"< * >:\"),Pe.createElement(\"td\",null,Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"additionalProperties\"),getConfigs:w,schema:ae,depth:x+1})))):null,$e?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"allOf ->\"),Pe.createElement(\"td\",null,$e.map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"allOf\",s),getConfigs:w,schema:o,depth:x+1}))))))):null,ze?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"anyOf ->\"),Pe.createElement(\"td\",null,ze.map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"anyOf\",s),getConfigs:w,schema:o,depth:x+1}))))))):null,We?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"oneOf ->\"),Pe.createElement(\"td\",null,We.map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"oneOf\",s),getConfigs:w,schema:o,depth:x+1}))))))):null,He?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"not ->\"),Pe.createElement(\"td\",null,Pe.createElement(\"div\",null,Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"not\"),getConfigs:w,schema:He,depth:x+1}))))):null))),Pe.createElement(\"span\",{className:\"brace-close\"},\"}\")),pe.size?pe.entrySeq().map((([o,s])=>Pe.createElement(xe,{key:`${o}-${s}`,propKey:o,propVal:s,propClass:\"property\"}))):null)}}class ArrayModel extends Pe.Component{render(){let{getComponent:o,getConfigs:s,schema:i,depth:u,expandDepth:_,name:w,displayName:x,specPath:C}=this.props,j=i.get(\"description\"),L=i.get(\"items\"),B=i.get(\"title\")||x||w,$=i.filter(((o,s)=>-1===[\"type\",\"items\",\"description\",\"$$ref\",\"externalDocs\"].indexOf(s))),V=i.getIn([\"externalDocs\",\"url\"]),U=i.getIn([\"externalDocs\",\"description\"]);const z=o(\"Markdown\",!0),Y=o(\"ModelCollapse\"),Z=o(\"Model\"),ee=o(\"Property\"),ie=o(\"Link\"),ae=B&&Pe.createElement(\"span\",{className:\"model-title\"},Pe.createElement(\"span\",{className:\"model-title__text\"},B));return Pe.createElement(\"span\",{className:\"model\"},Pe.createElement(Y,{title:ae,expanded:u<=_,collapsedContent:\"[...]\"},\"[\",$.size?$.entrySeq().map((([o,s])=>Pe.createElement(ee,{key:`${o}-${s}`,propKey:o,propVal:s,propClass:\"property\"}))):null,j?Pe.createElement(z,{source:j}):$.size?Pe.createElement(\"div\",{className:\"markdown\"}):null,V&&Pe.createElement(\"div\",{className:\"external-docs\"},Pe.createElement(ie,{target:\"_blank\",href:sanitizeUrl(V)},U||V)),Pe.createElement(\"span\",null,Pe.createElement(Z,wo()({},this.props,{getConfigs:s,specPath:C.push(\"items\"),name:null,schema:L,required:!1,depth:u+1}))),\"]\"))}}const Uo=\"property primitive\";class Primitive extends Pe.Component{render(){let{schema:o,getComponent:s,getConfigs:i,name:u,displayName:_,depth:w,expandDepth:x}=this.props;const{showExtensions:C}=i();if(!o||!o.get)return Pe.createElement(\"div\",null);let j=o.get(\"type\"),L=o.get(\"format\"),B=o.get(\"xml\"),$=o.get(\"enum\"),V=o.get(\"title\")||_||u,U=o.get(\"description\"),z=getExtensions(o),Y=o.filter(((o,s)=>-1===[\"enum\",\"type\",\"format\",\"description\",\"$$ref\",\"externalDocs\"].indexOf(s))).filterNot(((o,s)=>z.has(s))),Z=o.getIn([\"externalDocs\",\"url\"]),ee=o.getIn([\"externalDocs\",\"description\"]);const ie=s(\"Markdown\",!0),ae=s(\"EnumModel\"),ce=s(\"Property\"),le=s(\"ModelCollapse\"),pe=s(\"Link\"),de=V&&Pe.createElement(\"span\",{className:\"model-title\"},Pe.createElement(\"span\",{className:\"model-title__text\"},V));return Pe.createElement(\"span\",{className:\"model\"},Pe.createElement(le,{title:de,expanded:w<=x,collapsedContent:\"[...]\"},Pe.createElement(\"span\",{className:\"prop\"},u&&w>1&&Pe.createElement(\"span\",{className:\"prop-name\"},V),Pe.createElement(\"span\",{className:\"prop-type\"},j),L&&Pe.createElement(\"span\",{className:\"prop-format\"},\"($\",L,\")\"),Y.size?Y.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,propKey:o,propVal:s,propClass:Uo}))):null,C&&z.size?z.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,propKey:o,propVal:s,propClass:Uo}))):null,U?Pe.createElement(ie,{source:U}):null,Z&&Pe.createElement(\"div\",{className:\"external-docs\"},Pe.createElement(pe,{target:\"_blank\",href:sanitizeUrl(Z)},ee||Z)),B&&B.size?Pe.createElement(\"span\",null,Pe.createElement(\"br\",null),Pe.createElement(\"span\",{className:Uo},\"xml:\"),B.entrySeq().map((([o,s])=>Pe.createElement(\"span\",{key:`${o}-${s}`,className:Uo},Pe.createElement(\"br\",null),\"   \",o,\": \",String(s)))).toArray()):null,$&&Pe.createElement(ae,{value:$,getComponent:s}))))}}class Schemes extends Pe.Component{UNSAFE_componentWillMount(){let{schemes:o}=this.props;this.setScheme(o.first())}UNSAFE_componentWillReceiveProps(o){this.props.currentScheme&&o.schemes.includes(this.props.currentScheme)||this.setScheme(o.schemes.first())}onChange=o=>{this.setScheme(o.target.value)};setScheme=o=>{let{path:s,method:i,specActions:u}=this.props;u.setScheme(o,s,i)};render(){let{schemes:o,currentScheme:s}=this.props;return Pe.createElement(\"label\",{htmlFor:\"schemes\"},Pe.createElement(\"span\",{className:\"schemes-title\"},\"Schemes\"),Pe.createElement(\"select\",{onChange:this.onChange,value:s,id:\"schemes\"},o.valueSeq().map((o=>Pe.createElement(\"option\",{value:o,key:o},o))).toArray()))}}class SchemesContainer extends Pe.Component{render(){const{specActions:o,specSelectors:s,getComponent:i}=this.props,u=s.operationScheme(),_=s.schemes(),w=i(\"schemes\");return _&&_.size?Pe.createElement(w,{currentScheme:u,schemes:_,specActions:o}):null}}var zo=__webpack_require__(24677),Wo=__webpack_require__.n(zo);const Ko={value:\"\",onChange:()=>{},schema:{},keyName:\"\",required:!1,errors:(0,qe.List)()};class JsonSchemaForm extends Pe.Component{static defaultProps=Ko;componentDidMount(){const{dispatchInitialValue:o,value:s,onChange:i}=this.props;o?i(s):!1===o&&i(\"\")}render(){let{schema:o,errors:s,value:i,onChange:u,getComponent:_,fn:w,disabled:x}=this.props;const C=o&&o.get?o.get(\"format\"):null,j=o&&o.get?o.get(\"type\"):null;let getComponentSilently=o=>_(o,!1,{failSilently:!0}),L=j?getComponentSilently(C?`JsonSchema_${j}_${C}`:`JsonSchema_${j}`):_(\"JsonSchema_string\");return L||(L=_(\"JsonSchema_string\")),Pe.createElement(L,wo()({},this.props,{errors:s,fn:w,getComponent:_,value:i,onChange:u,schema:o,disabled:x}))}}class JsonSchema_string extends Pe.Component{static defaultProps=Ko;onChange=o=>{const s=this.props.schema&&\"file\"===this.props.schema.get(\"type\")?o.target.files[0]:o.target.value;this.props.onChange(s,this.props.keyName)};onEnumChange=o=>this.props.onChange(o);render(){let{getComponent:o,value:s,schema:i,errors:u,required:_,description:w,disabled:x}=this.props;const C=i&&i.get?i.get(\"enum\"):null,j=i&&i.get?i.get(\"format\"):null,L=i&&i.get?i.get(\"type\"):null,B=i&&i.get?i.get(\"in\"):null;if(s||(s=\"\"),u=u.toJS?u.toJS():[],C){const i=o(\"Select\");return Pe.createElement(i,{className:u.length?\"invalid\":\"\",title:u.length?u:\"\",allowedValues:[...C],value:s,allowEmptyValue:!_,disabled:x,onChange:this.onEnumChange})}const $=x||B&&\"formData\"===B&&!(\"FormData\"in window),V=o(\"Input\");return L&&\"file\"===L?Pe.createElement(V,{type:\"file\",className:u.length?\"invalid\":\"\",title:u.length?u:\"\",onChange:this.onChange,disabled:$}):Pe.createElement(Wo(),{type:j&&\"password\"===j?\"password\":\"text\",className:u.length?\"invalid\":\"\",title:u.length?u:\"\",value:s,minLength:0,debounceTimeout:350,placeholder:w,onChange:this.onChange,disabled:$})}}class JsonSchema_array extends Pe.PureComponent{static defaultProps=Ko;constructor(o,s){super(o,s),this.state={value:valueOrEmptyList(o.value),schema:o.schema}}UNSAFE_componentWillReceiveProps(o){const s=valueOrEmptyList(o.value);s!==this.state.value&&this.setState({value:s}),o.schema!==this.state.schema&&this.setState({schema:o.schema})}onChange=()=>{this.props.onChange(this.state.value)};onItemChange=(o,s)=>{this.setState((({value:i})=>({value:i.set(s,o)})),this.onChange)};removeItem=o=>{this.setState((({value:s})=>({value:s.delete(o)})),this.onChange)};addItem=()=>{const{fn:o}=this.props;let s=valueOrEmptyList(this.state.value);this.setState((()=>({value:s.push(o.getSampleSchema(this.state.schema.get(\"items\"),!1,{includeWriteOnly:!0}))})),this.onChange)};onEnumChange=o=>{this.setState((()=>({value:o})),this.onChange)};render(){let{getComponent:o,required:s,schema:i,errors:u,fn:_,disabled:w}=this.props;u=u.toJS?u.toJS():Array.isArray(u)?u:[];const x=u.filter((o=>\"string\"==typeof o)),C=u.filter((o=>void 0!==o.needRemove)).map((o=>o.error)),j=this.state.value,L=!!(j&&j.count&&j.count()>0),B=i.getIn([\"items\",\"enum\"]),$=i.getIn([\"items\",\"type\"]),V=i.getIn([\"items\",\"format\"]),U=i.get(\"items\");let z,Y=!1,Z=\"file\"===$||\"string\"===$&&\"binary\"===V;if($&&V?z=o(`JsonSchema_${$}_${V}`):\"boolean\"!==$&&\"array\"!==$&&\"object\"!==$||(z=o(`JsonSchema_${$}`)),z||Z||(Y=!0),B){const i=o(\"Select\");return Pe.createElement(i,{className:u.length?\"invalid\":\"\",title:u.length?u:\"\",multiple:!0,value:j,disabled:w,allowedValues:B,allowEmptyValue:!s,onChange:this.onEnumChange})}const ee=o(\"Button\");return Pe.createElement(\"div\",{className:\"json-schema-array\"},L?j.map(((s,i)=>{const x=(0,qe.fromJS)([...u.filter((o=>o.index===i)).map((o=>o.error))]);return Pe.createElement(\"div\",{key:i,className:\"json-schema-form-item\"},Z?Pe.createElement(JsonSchemaArrayItemFile,{value:s,onChange:o=>this.onItemChange(o,i),disabled:w,errors:x,getComponent:o}):Y?Pe.createElement(JsonSchemaArrayItemText,{value:s,onChange:o=>this.onItemChange(o,i),disabled:w,errors:x}):Pe.createElement(z,wo()({},this.props,{value:s,onChange:o=>this.onItemChange(o,i),disabled:w,errors:x,schema:U,getComponent:o,fn:_})),w?null:Pe.createElement(ee,{className:`btn btn-sm json-schema-form-item-remove ${C.length?\"invalid\":null}`,title:C.length?C:\"\",onClick:()=>this.removeItem(i)},\" - \"))})):null,w?null:Pe.createElement(ee,{className:`btn btn-sm json-schema-form-item-add ${x.length?\"invalid\":null}`,title:x.length?x:\"\",onClick:this.addItem},\"Add \",$?`${$} `:\"\",\"item\"))}}class JsonSchemaArrayItemText extends Pe.Component{static defaultProps=Ko;onChange=o=>{const s=o.target.value;this.props.onChange(s,this.props.keyName)};render(){let{value:o,errors:s,description:i,disabled:u}=this.props;return o||(o=\"\"),s=s.toJS?s.toJS():[],Pe.createElement(Wo(),{type:\"text\",className:s.length?\"invalid\":\"\",title:s.length?s:\"\",value:o,minLength:0,debounceTimeout:350,placeholder:i,onChange:this.onChange,disabled:u})}}class JsonSchemaArrayItemFile extends Pe.Component{static defaultProps=Ko;onFileChange=o=>{const s=o.target.files[0];this.props.onChange(s,this.props.keyName)};render(){let{getComponent:o,errors:s,disabled:i}=this.props;const u=o(\"Input\"),_=i||!(\"FormData\"in window);return Pe.createElement(u,{type:\"file\",className:s.length?\"invalid\":\"\",title:s.length?s:\"\",onChange:this.onFileChange,disabled:_})}}class JsonSchema_boolean extends Pe.Component{static defaultProps=Ko;onEnumChange=o=>this.props.onChange(o);render(){let{getComponent:o,value:s,errors:i,schema:u,required:_,disabled:w}=this.props;i=i.toJS?i.toJS():[];let x=u&&u.get?u.get(\"enum\"):null,C=!x||!_,j=!x&&[\"true\",\"false\"];const L=o(\"Select\");return Pe.createElement(L,{className:i.length?\"invalid\":\"\",title:i.length?i:\"\",value:String(s),disabled:w,allowedValues:x?[...x]:j,allowEmptyValue:C,onChange:this.onEnumChange})}}const stringifyObjectErrors=o=>o.map((o=>{const s=void 0!==o.propKey?o.propKey:o.index;let i=\"string\"==typeof o?o:\"string\"==typeof o.error?o.error:null;if(!s&&i)return i;let u=o.error,_=`/${o.propKey}`;for(;\"object\"==typeof u;){const o=void 0!==u.propKey?u.propKey:u.index;if(void 0===o)break;if(_+=`/${o}`,!u.error)break;u=u.error}return`${_}: ${u}`}));class JsonSchema_object extends Pe.PureComponent{constructor(){super()}static defaultProps=Ko;onChange=o=>{this.props.onChange(o)};handleOnChange=o=>{const s=o.target.value;this.onChange(s)};render(){let{getComponent:o,value:s,errors:i,disabled:u}=this.props;const _=o(\"TextArea\");return i=i.toJS?i.toJS():Array.isArray(i)?i:[],Pe.createElement(\"div\",null,Pe.createElement(_,{className:To()({invalid:i.length}),title:i.length?stringifyObjectErrors(i).join(\", \"):\"\",value:stringify(s),disabled:u,onChange:this.handleOnChange}))}}function valueOrEmptyList(o){return qe.List.isList(o)?o:Array.isArray(o)?(0,qe.fromJS)(o):(0,qe.List)()}const json_schema_5=()=>({components:{modelExample:model_example,ModelWrapper,ModelCollapse,Model,Models,EnumModel:enum_model,ObjectModel,ArrayModel,PrimitiveModel:Primitive,schemes:Schemes,SchemesContainer,...z}});var Ho=__webpack_require__(19123),Jo=__webpack_require__.n(Ho),Go=__webpack_require__(41859),Yo=__webpack_require__.n(Go),Xo=__webpack_require__(62193),Qo=__webpack_require__.n(Xo);const shallowArrayEquals=o=>s=>Array.isArray(o)&&Array.isArray(s)&&o.length===s.length&&o.every(((o,i)=>o===s[i])),list=(...o)=>o;class Cache extends Map{delete(o){const s=Array.from(this.keys()).find(shallowArrayEquals(o));return super.delete(s)}get(o){const s=Array.from(this.keys()).find(shallowArrayEquals(o));return super.get(s)}has(o){return-1!==Array.from(this.keys()).findIndex(shallowArrayEquals(o))}}const utils_memoizeN=(o,s=list)=>{const{Cache:i}=ut();ut().Cache=Cache;const u=ut()(o,s);return ut().Cache=i,u},Zo={string:o=>o.pattern?(o=>{try{return new(Yo())(o).gen()}catch(o){return\"string\"}})(o.pattern):\"string\",string_email:()=>\"user@example.com\",\"string_date-time\":()=>(new Date).toISOString(),string_date:()=>(new Date).toISOString().substring(0,10),string_uuid:()=>\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",string_hostname:()=>\"example.com\",string_ipv4:()=>\"198.51.100.42\",string_ipv6:()=>\"2001:0db8:5b96:0000:0000:426f:8e17:642a\",number:()=>0,number_float:()=>0,integer:()=>0,boolean:o=>\"boolean\"!=typeof o.default||o.default},primitive=o=>{o=objectify(o);let{type:s,format:i}=o,u=Zo[`${s}_${i}`]||Zo[s];return isFunc(u)?u(o):\"Unknown Type: \"+o.type},sanitizeRef=o=>deeplyStripKey(o,\"$$ref\",(o=>\"string\"==typeof o&&o.indexOf(\"#\")>-1)),es=[\"maxProperties\",\"minProperties\"],ts=[\"minItems\",\"maxItems\"],rs=[\"minimum\",\"maximum\",\"exclusiveMinimum\",\"exclusiveMaximum\"],ns=[\"minLength\",\"maxLength\"],mergeJsonSchema=(o,s,i={})=>{const u={...o};if([\"example\",\"default\",\"enum\",\"xml\",\"type\",...es,...ts,...rs,...ns].forEach((o=>(o=>{void 0===u[o]&&void 0!==s[o]&&(u[o]=s[o])})(o))),void 0!==s.required&&Array.isArray(s.required)&&(void 0!==u.required&&u.required.length||(u.required=[]),s.required.forEach((o=>{u.required.includes(o)||u.required.push(o)}))),s.properties){u.properties||(u.properties={});let o=objectify(s.properties);for(let _ in o)Object.prototype.hasOwnProperty.call(o,_)&&(o[_]&&o[_].deprecated||o[_]&&o[_].readOnly&&!i.includeReadOnly||o[_]&&o[_].writeOnly&&!i.includeWriteOnly||u.properties[_]||(u.properties[_]=o[_],!s.required&&Array.isArray(s.required)&&-1!==s.required.indexOf(_)&&(u.required?u.required.push(_):u.required=[_])))}return s.items&&(u.items||(u.items={}),u.items=mergeJsonSchema(u.items,s.items,i)),u},sampleFromSchemaGeneric=(o,s={},i=void 0,u=!1)=>{o&&isFunc(o.toJS)&&(o=o.toJS());let _=void 0!==i||o&&void 0!==o.example||o&&void 0!==o.default;const w=!_&&o&&o.oneOf&&o.oneOf.length>0,x=!_&&o&&o.anyOf&&o.anyOf.length>0;if(!_&&(w||x)){const i=objectify(w?o.oneOf[0]:o.anyOf[0]);if(!(o=mergeJsonSchema(o,i,s)).xml&&i.xml&&(o.xml=i.xml),void 0!==o.example&&void 0!==i.example)_=!0;else if(i.properties){o.properties||(o.properties={});let u=objectify(i.properties);for(let _ in u)Object.prototype.hasOwnProperty.call(u,_)&&(u[_]&&u[_].deprecated||u[_]&&u[_].readOnly&&!s.includeReadOnly||u[_]&&u[_].writeOnly&&!s.includeWriteOnly||o.properties[_]||(o.properties[_]=u[_],!i.required&&Array.isArray(i.required)&&-1!==i.required.indexOf(_)&&(o.required?o.required.push(_):o.required=[_])))}}const C={};let{xml:j,type:L,example:B,properties:$,additionalProperties:V,items:U}=o||{},{includeReadOnly:z,includeWriteOnly:Y}=s;j=j||{};let Z,{name:ee,prefix:ie,namespace:ae}=j,ce={};if(u&&(ee=ee||\"notagname\",Z=(ie?ie+\":\":\"\")+ee,ae)){C[ie?\"xmlns:\"+ie:\"xmlns\"]=ae}u&&(ce[Z]=[]);const schemaHasAny=s=>s.some((s=>Object.prototype.hasOwnProperty.call(o,s)));o&&!L&&($||V||schemaHasAny(es)?L=\"object\":U||schemaHasAny(ts)?L=\"array\":schemaHasAny(rs)?(L=\"number\",o.type=\"number\"):_||o.enum||(L=\"string\",o.type=\"string\"));const handleMinMaxItems=s=>{if(null!=o?.maxItems&&(s=s.slice(0,o?.maxItems)),null!=o?.minItems){let i=0;for(;s.length<o?.minItems;)s.push(s[i++%s.length])}return s},le=objectify($);let pe,de=0;const hasExceededMaxProperties=()=>o&&null!==o.maxProperties&&void 0!==o.maxProperties&&de>=o.maxProperties,canAddProperty=s=>!o||null===o.maxProperties||void 0===o.maxProperties||!hasExceededMaxProperties()&&(!(s=>!(o&&o.required&&o.required.length&&o.required.includes(s)))(s)||o.maxProperties-de-(()=>{if(!o||!o.required)return 0;let s=0;return u?o.required.forEach((o=>s+=void 0===ce[o]?0:1)):o.required.forEach((o=>s+=void 0===ce[Z]?.find((s=>void 0!==s[o]))?0:1)),o.required.length-s})()>0);if(pe=u?(i,_=void 0)=>{if(o&&le[i]){if(le[i].xml=le[i].xml||{},le[i].xml.attribute){const o=Array.isArray(le[i].enum)?le[i].enum[0]:void 0,s=le[i].example,u=le[i].default;return void(C[le[i].xml.name||i]=void 0!==s?s:void 0!==u?u:void 0!==o?o:primitive(le[i]))}le[i].xml.name=le[i].xml.name||i}else le[i]||!1===V||(le[i]={xml:{name:i}});let w=sampleFromSchemaGeneric(o&&le[i]||void 0,s,_,u);canAddProperty(i)&&(de++,Array.isArray(w)?ce[Z]=ce[Z].concat(w):ce[Z].push(w))}:(i,_)=>{if(canAddProperty(i)){if(Object.prototype.hasOwnProperty.call(o,\"discriminator\")&&o.discriminator&&Object.prototype.hasOwnProperty.call(o.discriminator,\"mapping\")&&o.discriminator.mapping&&Object.prototype.hasOwnProperty.call(o,\"$$ref\")&&o.$$ref&&o.discriminator.propertyName===i){for(let s in o.discriminator.mapping)if(-1!==o.$$ref.search(o.discriminator.mapping[s])){ce[i]=s;break}}else ce[i]=sampleFromSchemaGeneric(le[i],s,_,u);de++}},_){let _;if(_=sanitizeRef(void 0!==i?i:void 0!==B?B:o.default),!u){if(\"number\"==typeof _&&\"string\"===L)return`${_}`;if(\"string\"!=typeof _||\"string\"===L)return _;try{return JSON.parse(_)}catch(o){return _}}if(o||(L=Array.isArray(_)?\"array\":typeof _),\"array\"===L){if(!Array.isArray(_)){if(\"string\"==typeof _)return _;_=[_]}const i=o?o.items:void 0;i&&(i.xml=i.xml||j||{},i.xml.name=i.xml.name||j.name);let w=_.map((o=>sampleFromSchemaGeneric(i,s,o,u)));return w=handleMinMaxItems(w),j.wrapped?(ce[Z]=w,Qo()(C)||ce[Z].push({_attr:C})):ce=w,ce}if(\"object\"===L){if(\"string\"==typeof _)return _;for(let s in _)Object.prototype.hasOwnProperty.call(_,s)&&(o&&le[s]&&le[s].readOnly&&!z||o&&le[s]&&le[s].writeOnly&&!Y||(o&&le[s]&&le[s].xml&&le[s].xml.attribute?C[le[s].xml.name||s]=_[s]:pe(s,_[s])));return Qo()(C)||ce[Z].push({_attr:C}),ce}return ce[Z]=Qo()(C)?_:[{_attr:C},_],ce}if(\"object\"===L){for(let o in le)Object.prototype.hasOwnProperty.call(le,o)&&(le[o]&&le[o].deprecated||le[o]&&le[o].readOnly&&!z||le[o]&&le[o].writeOnly&&!Y||pe(o));if(u&&C&&ce[Z].push({_attr:C}),hasExceededMaxProperties())return ce;if(!0===V)u?ce[Z].push({additionalProp:\"Anything can be here\"}):ce.additionalProp1={},de++;else if(V){const i=objectify(V),_=sampleFromSchemaGeneric(i,s,void 0,u);if(u&&i.xml&&i.xml.name&&\"notagname\"!==i.xml.name)ce[Z].push(_);else{const s=null!==o.minProperties&&void 0!==o.minProperties&&de<o.minProperties?o.minProperties-de:3;for(let o=1;o<=s;o++){if(hasExceededMaxProperties())return ce;if(u){const s={};s[\"additionalProp\"+o]=_.notagname,ce[Z].push(s)}else ce[\"additionalProp\"+o]=_;de++}}}return ce}if(\"array\"===L){if(!U)return;let i;if(u&&(U.xml=U.xml||o?.xml||{},U.xml.name=U.xml.name||j.name),Array.isArray(U.anyOf))i=U.anyOf.map((o=>sampleFromSchemaGeneric(mergeJsonSchema(o,U,s),s,void 0,u)));else if(Array.isArray(U.oneOf))i=U.oneOf.map((o=>sampleFromSchemaGeneric(mergeJsonSchema(o,U,s),s,void 0,u)));else{if(!(!u||u&&j.wrapped))return sampleFromSchemaGeneric(U,s,void 0,u);i=[sampleFromSchemaGeneric(U,s,void 0,u)]}return i=handleMinMaxItems(i),u&&j.wrapped?(ce[Z]=i,Qo()(C)||ce[Z].push({_attr:C}),ce):i}let fe;if(o&&Array.isArray(o.enum))fe=normalizeArray(o.enum)[0];else{if(!o)return;if(fe=primitive(o),\"number\"==typeof fe){let s=o.minimum;null!=s&&(o.exclusiveMinimum&&s++,fe=s);let i=o.maximum;null!=i&&(o.exclusiveMaximum&&i--,fe=i)}if(\"string\"==typeof fe&&(null!==o.maxLength&&void 0!==o.maxLength&&(fe=fe.slice(0,o.maxLength)),null!==o.minLength&&void 0!==o.minLength)){let s=0;for(;fe.length<o.minLength;)fe+=fe[s++%fe.length]}}if(\"file\"!==L)return u?(ce[Z]=Qo()(C)?fe:[{_attr:C},fe],ce):fe},inferSchema=o=>(o.schema&&(o=o.schema),o.properties&&(o.type=\"object\"),o),createXMLExample=(o,s,i)=>{const u=sampleFromSchemaGeneric(o,s,i,!0);if(u)return\"string\"==typeof u?u:Jo()(u,{declaration:!0,indent:\"\\t\"})},sampleFromSchema=(o,s,i)=>sampleFromSchemaGeneric(o,s,i,!1),resolver=(o,s,i)=>[o,JSON.stringify(s),JSON.stringify(i)],os=utils_memoizeN(createXMLExample,resolver),ss=utils_memoizeN(sampleFromSchema,resolver),as=[{when:/json/,shouldStringifyTypes:[\"string\"]}],cs=[\"object\"],get_json_sample_schema=o=>(s,i,u,_)=>{const{fn:w}=o(),x=w.memoizedSampleFromSchema(s,i,_),C=typeof x,j=as.reduce(((o,s)=>s.when.test(u)?[...o,...s.shouldStringifyTypes]:o),cs);return mt()(j,(o=>o===C))?JSON.stringify(x,null,2):x},get_yaml_sample_schema=o=>(s,i,u,_)=>{const{fn:w}=o(),x=w.getJsonSampleSchema(s,i,u,_);let C;try{C=to.dump(to.load(x),{lineWidth:-1},{schema:zn}),\"\\n\"===C[C.length-1]&&(C=C.slice(0,C.length-1))}catch(o){return console.error(o),\"error: could not generate yaml example\"}return C.replace(/\\t/g,\"  \")},get_xml_sample_schema=o=>(s,i,u)=>{const{fn:_}=o();if(s&&!s.xml&&(s.xml={}),s&&!s.xml.name){if(!s.$$ref&&(s.type||s.items||s.properties||s.additionalProperties))return'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n\\x3c!-- XML example cannot be generated; root element name is undefined --\\x3e';if(s.$$ref){let o=s.$$ref.match(/\\S*\\/(\\S+)$/);s.xml.name=o[1]}}return _.memoizedCreateXMLExample(s,i,u)},get_sample_schema=o=>(s,i=\"\",u={},_=void 0)=>{const{fn:w}=o();return\"function\"==typeof s?.toJS&&(s=s.toJS()),\"function\"==typeof _?.toJS&&(_=_.toJS()),/xml/.test(i)?w.getXmlSampleSchema(s,u,_):/(yaml|yml)/.test(i)?w.getYamlSampleSchema(s,u,i,_):w.getJsonSampleSchema(s,u,i,_)},json_schema_5_samples=({getSystem:o})=>{const s=get_json_sample_schema(o),i=get_yaml_sample_schema(o),u=get_xml_sample_schema(o),_=get_sample_schema(o);return{fn:{jsonSchema5:{inferSchema,sampleFromSchema,sampleFromSchemaGeneric,createXMLExample,memoizedSampleFromSchema:ss,memoizedCreateXMLExample:os,getJsonSampleSchema:s,getYamlSampleSchema:i,getXmlSampleSchema:u,getSampleSchema:_,mergeJsonSchema},inferSchema,sampleFromSchema,sampleFromSchemaGeneric,createXMLExample,memoizedSampleFromSchema:ss,memoizedCreateXMLExample:os,getJsonSampleSchema:s,getYamlSampleSchema:i,getXmlSampleSchema:u,getSampleSchema:_,mergeJsonSchema}}};var ls=__webpack_require__(37334),us=__webpack_require__.n(ls);const ps=[\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"],spec_selectors_state=o=>o||(0,qe.Map)(),hs=Wt(spec_selectors_state,(o=>o.get(\"lastError\"))),ds=Wt(spec_selectors_state,(o=>o.get(\"url\"))),fs=Wt(spec_selectors_state,(o=>o.get(\"spec\")||\"\")),ms=Wt(spec_selectors_state,(o=>o.get(\"specSource\")||\"not-editor\")),gs=Wt(spec_selectors_state,(o=>o.get(\"json\",(0,qe.Map)()))),ys=Wt(gs,(o=>o.toJS())),vs=Wt(spec_selectors_state,(o=>o.get(\"resolved\",(0,qe.Map)()))),specResolvedSubtree=(o,s)=>o.getIn([\"resolvedSubtrees\",...s],void 0),mergerFn=(o,s)=>qe.Map.isMap(o)&&qe.Map.isMap(s)?s.get(\"$$ref\")?s:(0,qe.OrderedMap)().mergeWith(mergerFn,o,s):s,bs=Wt(spec_selectors_state,(o=>(0,qe.OrderedMap)().mergeWith(mergerFn,o.get(\"json\"),o.get(\"resolvedSubtrees\")))),spec=o=>gs(o),_s=Wt(spec,(()=>!1)),Es=Wt(spec,(o=>returnSelfOrNewMap(o&&o.get(\"info\")))),ws=Wt(spec,(o=>returnSelfOrNewMap(o&&o.get(\"externalDocs\")))),Ss=Wt(Es,(o=>o&&o.get(\"version\"))),xs=Wt(Ss,(o=>/v?([0-9]*)\\.([0-9]*)\\.([0-9]*)/i.exec(o).slice(1))),ks=Wt(bs,(o=>o.get(\"paths\"))),Os=us()([\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\"]),Cs=Wt(ks,(o=>{if(!o||o.size<1)return(0,qe.List)();let s=(0,qe.List)();return o&&o.forEach?(o.forEach(((o,i)=>{if(!o||!o.forEach)return{};o.forEach(((o,u)=>{ps.indexOf(u)<0||(s=s.push((0,qe.fromJS)({path:i,method:u,operation:o,id:`${u}-${i}`})))}))})),s):(0,qe.List)()})),As=Wt(spec,(o=>(0,qe.Set)(o.get(\"consumes\")))),js=Wt(spec,(o=>(0,qe.Set)(o.get(\"produces\")))),Ps=Wt(spec,(o=>o.get(\"security\",(0,qe.List)()))),Is=Wt(spec,(o=>o.get(\"securityDefinitions\"))),findDefinition=(o,s)=>{const i=o.getIn([\"resolvedSubtrees\",\"definitions\",s],null),u=o.getIn([\"json\",\"definitions\",s],null);return i||u||null},Ms=Wt(spec,(o=>{const s=o.get(\"definitions\");return qe.Map.isMap(s)?s:(0,qe.Map)()})),Ns=Wt(spec,(o=>o.get(\"basePath\"))),Ts=Wt(spec,(o=>o.get(\"host\"))),Rs=Wt(spec,(o=>o.get(\"schemes\",(0,qe.Map)()))),Ds=Wt([Cs,As,js],((o,s,i)=>o.map((o=>o.update(\"operation\",(o=>{if(o){if(!qe.Map.isMap(o))return;return o.withMutations((o=>(o.get(\"consumes\")||o.update(\"consumes\",(o=>(0,qe.Set)(o).merge(s))),o.get(\"produces\")||o.update(\"produces\",(o=>(0,qe.Set)(o).merge(i))),o)))}return(0,qe.Map)()})))))),Ls=Wt(spec,(o=>{const s=o.get(\"tags\",(0,qe.List)());return qe.List.isList(s)?s.filter((o=>qe.Map.isMap(o))):(0,qe.List)()})),tagDetails=(o,s)=>(Ls(o)||(0,qe.List)()).filter(qe.Map.isMap).find((o=>o.get(\"name\")===s),(0,qe.Map)()),Bs=Wt(Ds,Ls,((o,s)=>o.reduce(((o,s)=>{let i=(0,qe.Set)(s.getIn([\"operation\",\"tags\"]));return i.count()<1?o.update(\"default\",(0,qe.List)(),(o=>o.push(s))):i.reduce(((o,i)=>o.update(i,(0,qe.List)(),(o=>o.push(s)))),o)}),s.reduce(((o,s)=>o.set(s.get(\"name\"),(0,qe.List)())),(0,qe.OrderedMap)())))),selectors_taggedOperations=o=>({getConfigs:s})=>{let{tagsSorter:i,operationsSorter:u}=s();return Bs(o).sortBy(((o,s)=>s),((o,s)=>{let u=\"function\"==typeof i?i:Pt.tagsSorter[i];return u?u(o,s):null})).map(((s,i)=>{let _=\"function\"==typeof u?u:Pt.operationsSorter[u],w=_?s.sort(_):s;return(0,qe.Map)({tagDetails:tagDetails(o,i),operations:w})}))},Fs=Wt(spec_selectors_state,(o=>o.get(\"responses\",(0,qe.Map)()))),qs=Wt(spec_selectors_state,(o=>o.get(\"requests\",(0,qe.Map)()))),$s=Wt(spec_selectors_state,(o=>o.get(\"mutatedRequests\",(0,qe.Map)()))),responseFor=(o,s,i)=>Fs(o).getIn([s,i],null),requestFor=(o,s,i)=>qs(o).getIn([s,i],null),mutatedRequestFor=(o,s,i)=>$s(o).getIn([s,i],null),allowTryItOutFor=()=>!0,parameterWithMetaByIdentity=(o,s,i)=>{const u=bs(o).getIn([\"paths\",...s,\"parameters\"],(0,qe.OrderedMap)()),_=o.getIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.OrderedMap)());return u.map((o=>{const s=_.get(`${i.get(\"in\")}.${i.get(\"name\")}`),u=_.get(`${i.get(\"in\")}.${i.get(\"name\")}.hash-${i.hashCode()}`);return(0,qe.OrderedMap)().merge(o,s,u)})).find((o=>o.get(\"in\")===i.get(\"in\")&&o.get(\"name\")===i.get(\"name\")),(0,qe.OrderedMap)())},parameterInclusionSettingFor=(o,s,i,u)=>{const _=`${u}.${i}`;return o.getIn([\"meta\",\"paths\",...s,\"parameter_inclusions\",_],!1)},parameterWithMeta=(o,s,i,u)=>{const _=bs(o).getIn([\"paths\",...s,\"parameters\"],(0,qe.OrderedMap)()).find((o=>o.get(\"in\")===u&&o.get(\"name\")===i),(0,qe.OrderedMap)());return parameterWithMetaByIdentity(o,s,_)},operationWithMeta=(o,s,i)=>{const u=bs(o).getIn([\"paths\",s,i],(0,qe.OrderedMap)()),_=o.getIn([\"meta\",\"paths\",s,i],(0,qe.OrderedMap)()),w=u.get(\"parameters\",(0,qe.List)()).map((u=>parameterWithMetaByIdentity(o,[s,i],u)));return(0,qe.OrderedMap)().merge(u,_).set(\"parameters\",w)};function getParameter(o,s,i,u){return s=s||[],o.getIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.fromJS)([])).find((o=>qe.Map.isMap(o)&&o.get(\"name\")===i&&o.get(\"in\")===u))||(0,qe.Map)()}const Vs=Wt(spec,(o=>{const s=o.get(\"host\");return\"string\"==typeof s&&s.length>0&&\"/\"!==s[0]}));function parameterValues(o,s,i){return s=s||[],operationWithMeta(o,...s).get(\"parameters\",(0,qe.List)()).reduce(((o,s)=>{let u=i&&\"body\"===s.get(\"in\")?s.get(\"value_xml\"):s.get(\"value\");return qe.List.isList(u)&&(u=u.filter((o=>\"\"!==o))),o.set(paramToIdentifier(s,{allowHashes:!1}),u)}),(0,qe.fromJS)({}))}function parametersIncludeIn(o,s=\"\"){if(qe.List.isList(o))return o.some((o=>qe.Map.isMap(o)&&o.get(\"in\")===s))}function parametersIncludeType(o,s=\"\"){if(qe.List.isList(o))return o.some((o=>qe.Map.isMap(o)&&o.get(\"type\")===s))}function contentTypeValues(o,s){s=s||[];let i=bs(o).getIn([\"paths\",...s],(0,qe.fromJS)({})),u=o.getIn([\"meta\",\"paths\",...s],(0,qe.fromJS)({})),_=currentProducesFor(o,s);const w=i.get(\"parameters\")||new qe.List,x=u.get(\"consumes_value\")?u.get(\"consumes_value\"):parametersIncludeType(w,\"file\")?\"multipart/form-data\":parametersIncludeType(w,\"formData\")?\"application/x-www-form-urlencoded\":void 0;return(0,qe.fromJS)({requestContentType:x,responseContentType:_})}function currentProducesFor(o,s){s=s||[];const i=bs(o).getIn([\"paths\",...s],null);if(null===i)return;const u=o.getIn([\"meta\",\"paths\",...s,\"produces_value\"],null),_=i.getIn([\"produces\",0],null);return u||_||\"application/json\"}function producesOptionsFor(o,s){s=s||[];const i=bs(o),u=i.getIn([\"paths\",...s],null);if(null===u)return;const[_]=s,w=u.get(\"produces\",null),x=i.getIn([\"paths\",_,\"produces\"],null),C=i.getIn([\"produces\"],null);return w||x||C}function consumesOptionsFor(o,s){s=s||[];const i=bs(o),u=i.getIn([\"paths\",...s],null);if(null===u)return;const[_]=s,w=u.get(\"consumes\",null),x=i.getIn([\"paths\",_,\"consumes\"],null),C=i.getIn([\"consumes\"],null);return w||x||C}const operationScheme=(o,s,i)=>{let u=o.get(\"url\").match(/^([a-z][a-z0-9+\\-.]*):/),_=Array.isArray(u)?u[1]:null;return o.getIn([\"scheme\",s,i])||o.getIn([\"scheme\",\"_defaultScheme\"])||_||\"\"},canExecuteScheme=(o,s,i)=>[\"http\",\"https\"].indexOf(operationScheme(o,s,i))>-1,validationErrors=(o,s)=>{s=s||[];const i=o.getIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.fromJS)([])),u=[];if(0===i.length)return u;const getErrorsWithPaths=(o,s=[])=>{const getNestedErrorsWithPaths=(o,s)=>{const i=[...s,o.get(\"propKey\")||o.get(\"index\")];return qe.Map.isMap(o.get(\"error\"))?getErrorsWithPaths(o.get(\"error\"),i):{error:o.get(\"error\"),path:i}};return qe.List.isList(o)?o.map((o=>qe.Map.isMap(o)?getNestedErrorsWithPaths(o,s):{error:o,path:s})):getNestedErrorsWithPaths(o,s)};return i.forEach(((o,s)=>{const i=s.split(\".\").slice(1,-1).join(\".\"),_=o.get(\"errors\");if(_&&_.count()){getErrorsWithPaths(_).forEach((({error:o,path:s})=>{u.push(((o,s,i)=>`For '${i}'${(s=s.reduce(((o,s)=>\"number\"==typeof s?`${o}[${s}]`:o?`${o}.${s}`:s),\"\"))?` at path '${s}'`:\"\"}: ${o}.`)(o,s,i))}))}})),u},validateBeforeExecute=(o,s)=>0===validationErrors(o,s).length,getOAS3RequiredRequestBodyContentType=(o,s)=>{let i={requestBody:!1,requestContentType:{}},u=o.getIn([\"resolvedSubtrees\",\"paths\",...s,\"requestBody\"],(0,qe.fromJS)([]));return u.size<1||(u.getIn([\"required\"])&&(i.requestBody=u.getIn([\"required\"])),u.getIn([\"content\"]).entrySeq().forEach((o=>{const s=o[0];if(o[1].getIn([\"schema\",\"required\"])){const u=o[1].getIn([\"schema\",\"required\"]).toJS();i.requestContentType[s]=u}}))),i},isMediaTypeSchemaPropertiesEqual=(o,s,i,u)=>{if((i||u)&&i===u)return!0;let _=o.getIn([\"resolvedSubtrees\",\"paths\",...s,\"requestBody\",\"content\"],(0,qe.fromJS)([]));if(_.size<2||!i||!u)return!1;let w=_.getIn([i,\"schema\",\"properties\"],(0,qe.fromJS)([])),x=_.getIn([u,\"schema\",\"properties\"],(0,qe.fromJS)([]));return!!w.equals(x)};function returnSelfOrNewMap(o){return qe.Map.isMap(o)?o:new qe.Map}var Us=__webpack_require__(85015),zs=__webpack_require__.n(Us),Ws=__webpack_require__(38221),Ks=__webpack_require__.n(Ws),Hs=__webpack_require__(63560),Js=__webpack_require__.n(Hs),Gs=__webpack_require__(56367),Ys=__webpack_require__.n(Gs);const Xs=\"spec_update_spec\",Qs=\"spec_update_url\",Zs=\"spec_update_json\",_i=\"spec_update_param\",Ei=\"spec_update_empty_param_inclusion\",Oi=\"spec_validate_param\",Pi=\"spec_set_response\",Mi=\"spec_set_request\",Ri=\"spec_set_mutated_request\",Wi=\"spec_log_request\",ea=\"spec_clear_response\",ra=\"spec_clear_request\",na=\"spec_clear_validate_param\",ia=\"spec_update_operation_meta_value\",aa=\"spec_update_resolved\",ca=\"spec_update_resolved_subtree\",la=\"set_scheme\",toStr=o=>zs()(o)?o:\"\";function updateSpec(o){const s=toStr(o).replace(/\\t/g,\"  \");if(\"string\"==typeof o)return{type:Xs,payload:s}}function updateResolved(o){return{type:aa,payload:o}}function updateUrl(o){return{type:Qs,payload:o}}function updateJsonSpec(o){return{type:Zs,payload:o}}const parseToJson=o=>({specActions:s,specSelectors:i,errActions:u})=>{let{specStr:_}=i,w=null;try{o=o||_(),u.clear({source:\"parser\"}),w=to.load(o,{schema:zn})}catch(o){return console.error(o),u.newSpecErr({source:\"parser\",level:\"error\",message:o.reason,line:o.mark&&o.mark.line?o.mark.line+1:void 0})}return w&&\"object\"==typeof w?s.updateJsonSpec(w):{}};let ua=!1;const resolveSpec=(o,s)=>({specActions:i,specSelectors:u,errActions:_,fn:{fetch:w,resolve:x,AST:C={}},getConfigs:j})=>{ua||(console.warn(\"specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!\"),ua=!0);const{modelPropertyMacro:L,parameterMacro:B,requestInterceptor:$,responseInterceptor:V}=j();void 0===o&&(o=u.specJson()),void 0===s&&(s=u.url());let U=C.getLineNumberForPath?C.getLineNumberForPath:()=>{},z=u.specStr();return x({fetch:w,spec:o,baseDoc:String(new URL(s,document.baseURI)),modelPropertyMacro:L,parameterMacro:B,requestInterceptor:$,responseInterceptor:V}).then((({spec:o,errors:s})=>{if(_.clear({type:\"thrown\"}),Array.isArray(s)&&s.length>0){let o=s.map((o=>(console.error(o),o.line=o.fullPath?U(z,o.fullPath):null,o.path=o.fullPath?o.fullPath.join(\".\"):null,o.level=\"error\",o.type=\"thrown\",o.source=\"resolver\",Object.defineProperty(o,\"message\",{enumerable:!0,value:o.message}),o)));_.newThrownErrBatch(o)}return i.updateResolved(o)}))};let da=[];const ma=Ks()((()=>{const o=da.reduce(((o,{path:s,system:i})=>(o.has(i)||o.set(i,[]),o.get(i).push(s),o)),new Map);da=[],o.forEach((async(o,s)=>{if(!s)return void console.error(\"debResolveSubtrees: don't have a system to operate on, aborting.\");if(!s.fn.resolveSubtree)return void console.error(\"Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing.\");const{errActions:i,errSelectors:u,fn:{resolveSubtree:_,fetch:w,AST:x={}},specSelectors:C,specActions:j}=s,L=x.getLineNumberForPath??us()(void 0),B=C.specStr(),{modelPropertyMacro:$,parameterMacro:V,requestInterceptor:U,responseInterceptor:z}=s.getConfigs();try{const s=await o.reduce((async(o,s)=>{let{resultMap:x,specWithCurrentSubtrees:j}=await o;const{errors:Y,spec:Z}=await _(j,s,{baseDoc:String(new URL(C.url(),document.baseURI)),modelPropertyMacro:$,parameterMacro:V,requestInterceptor:U,responseInterceptor:z});if(u.allErrors().size&&i.clearBy((o=>\"thrown\"!==o.get(\"type\")||\"resolver\"!==o.get(\"source\")||!o.get(\"fullPath\").every(((o,i)=>o===s[i]||void 0===s[i])))),Array.isArray(Y)&&Y.length>0){let o=Y.map((o=>(o.line=o.fullPath?L(B,o.fullPath):null,o.path=o.fullPath?o.fullPath.join(\".\"):null,o.level=\"error\",o.type=\"thrown\",o.source=\"resolver\",Object.defineProperty(o,\"message\",{enumerable:!0,value:o.message}),o)));i.newThrownErrBatch(o)}return Z&&C.isOAS3()&&\"components\"===s[0]&&\"securitySchemes\"===s[1]&&await Promise.all(Object.values(Z).filter((o=>\"openIdConnect\"===o.type)).map((async o=>{const s={url:o.openIdConnectUrl,requestInterceptor:U,responseInterceptor:z};try{const i=await w(s);i instanceof Error||i.status>=400?console.error(i.statusText+\" \"+s.url):o.openIdConnectData=JSON.parse(i.text)}catch(o){console.error(o)}}))),Js()(x,s,Z),j=Ys()(s,Z,j),{resultMap:x,specWithCurrentSubtrees:j}}),Promise.resolve({resultMap:(C.specResolvedSubtree([])||(0,qe.Map)()).toJS(),specWithCurrentSubtrees:C.specJS()}));j.updateResolvedSubtree([],s.resultMap)}catch(o){console.error(o)}}))}),35),requestResolvedSubtree=o=>s=>{da.find((({path:i,system:u})=>u===s&&i.toString()===o.toString()))||(da.push({path:o,system:s}),ma())};function changeParam(o,s,i,u,_){return{type:_i,payload:{path:o,value:u,paramName:s,paramIn:i,isXml:_}}}function changeParamByIdentity(o,s,i,u){return{type:_i,payload:{path:o,param:s,value:i,isXml:u}}}const updateResolvedSubtree=(o,s)=>({type:ca,payload:{path:o,value:s}}),invalidateResolvedSubtreeCache=()=>({type:ca,payload:{path:[],value:(0,qe.Map)()}}),validateParams=(o,s)=>({type:Oi,payload:{pathMethod:o,isOAS3:s}}),updateEmptyParamInclusion=(o,s,i,u)=>({type:Ei,payload:{pathMethod:o,paramName:s,paramIn:i,includeEmptyValue:u}});function clearValidateParams(o){return{type:na,payload:{pathMethod:o}}}function changeConsumesValue(o,s){return{type:ia,payload:{path:o,value:s,key:\"consumes_value\"}}}function changeProducesValue(o,s){return{type:ia,payload:{path:o,value:s,key:\"produces_value\"}}}const setResponse=(o,s,i)=>({payload:{path:o,method:s,res:i},type:Pi}),setRequest=(o,s,i)=>({payload:{path:o,method:s,req:i},type:Mi}),setMutatedRequest=(o,s,i)=>({payload:{path:o,method:s,req:i},type:Ri}),logRequest=o=>({payload:o,type:Wi}),executeRequest=o=>({fn:s,specActions:i,specSelectors:u,getConfigs:_,oas3Selectors:w})=>{let{pathName:x,method:C,operation:j}=o,{requestInterceptor:L,responseInterceptor:B}=_(),$=j.toJS();if(j&&j.get(\"parameters\")&&j.get(\"parameters\").filter((o=>o&&!0===o.get(\"allowEmptyValue\"))).forEach((s=>{if(u.parameterInclusionSettingFor([x,C],s.get(\"name\"),s.get(\"in\"))){o.parameters=o.parameters||{};const i=paramToValue(s,o.parameters);(!i||i&&0===i.size)&&(o.parameters[s.get(\"name\")]=\"\")}})),o.contextUrl=Mt()(u.url()).toString(),$&&$.operationId?o.operationId=$.operationId:$&&x&&C&&(o.operationId=s.opId($,x,C)),u.isOAS3()){const s=`${x}:${C}`;o.server=w.selectedServer(s)||w.selectedServer();const i=w.serverVariables({server:o.server,namespace:s}).toJS(),u=w.serverVariables({server:o.server}).toJS();o.serverVariables=Object.keys(i).length?i:u,o.requestContentType=w.requestContentType(x,C),o.responseContentType=w.responseContentType(x,C)||\"*/*\";const _=w.requestBodyValue(x,C),j=w.requestBodyInclusionSetting(x,C);_&&_.toJS?o.requestBody=_.map((o=>qe.Map.isMap(o)?o.get(\"value\"):o)).filter(((o,s)=>(Array.isArray(o)?0!==o.length:!isEmptyValue(o))||j.get(s))).toJS():o.requestBody=_}let V=Object.assign({},o);V=s.buildRequest(V),i.setRequest(o.pathName,o.method,V);o.requestInterceptor=async s=>{let u=await L.apply(void 0,[s]),_=Object.assign({},u);return i.setMutatedRequest(o.pathName,o.method,_),u},o.responseInterceptor=B;const U=Date.now();return s.execute(o).then((s=>{s.duration=Date.now()-U,i.setResponse(o.pathName,o.method,s)})).catch((s=>{\"Failed to fetch\"===s.message&&(s.name=\"\",s.message='**Failed to fetch.**  \\n**Possible Reasons:** \\n  - CORS \\n  - Network Failure \\n  - URL scheme must be \"http\" or \"https\" for CORS request.'),i.setResponse(o.pathName,o.method,{error:!0,err:s})}))},actions_execute=({path:o,method:s,...i}={})=>u=>{let{fn:{fetch:_},specSelectors:w,specActions:x}=u,C=w.specJsonWithResolvedSubtrees().toJS(),j=w.operationScheme(o,s),{requestContentType:L,responseContentType:B}=w.contentTypeValues([o,s]).toJS(),$=/xml/i.test(L),V=w.parameterValues([o,s],$).toJS();return x.executeRequest({...i,fetch:_,spec:C,pathName:o,method:s,parameters:V,requestContentType:L,scheme:j,responseContentType:B})};function clearResponse(o,s){return{type:ea,payload:{path:o,method:s}}}function clearRequest(o,s){return{type:ra,payload:{path:o,method:s}}}function setScheme(o,s,i){return{type:la,payload:{scheme:o,path:s,method:i}}}const ga={[Xs]:(o,s)=>\"string\"==typeof s.payload?o.set(\"spec\",s.payload):o,[Qs]:(o,s)=>o.set(\"url\",s.payload+\"\"),[Zs]:(o,s)=>o.set(\"json\",fromJSOrdered(s.payload)),[aa]:(o,s)=>o.setIn([\"resolved\"],fromJSOrdered(s.payload)),[ca]:(o,s)=>{const{value:i,path:u}=s.payload;return o.setIn([\"resolvedSubtrees\",...u],fromJSOrdered(i))},[_i]:(o,{payload:s})=>{let{path:i,paramName:u,paramIn:_,param:w,value:x,isXml:C}=s,j=w?paramToIdentifier(w):`${_}.${u}`;const L=C?\"value_xml\":\"value\";return o.setIn([\"meta\",\"paths\",...i,\"parameters\",j,L],(0,qe.fromJS)(x))},[Ei]:(o,{payload:s})=>{let{pathMethod:i,paramName:u,paramIn:_,includeEmptyValue:w}=s;if(!u||!_)return console.warn(\"Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey.\"),o;const x=`${_}.${u}`;return o.setIn([\"meta\",\"paths\",...i,\"parameter_inclusions\",x],w)},[Oi]:(o,{payload:{pathMethod:s,isOAS3:i}})=>{const u=bs(o).getIn([\"paths\",...s]),_=parameterValues(o,s).toJS();return o.updateIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.fromJS)({}),(w=>u.get(\"parameters\",(0,qe.List)()).reduce(((u,w)=>{const x=paramToValue(w,_),C=parameterInclusionSettingFor(o,s,w.get(\"name\"),w.get(\"in\")),j=((o,s,{isOAS3:i=!1,bypassRequiredCheck:u=!1}={})=>{let _=o.get(\"required\"),{schema:w,parameterContentMediaType:x}=getParameterSchema(o,{isOAS3:i});return validateValueBySchema(s,w,_,u,x)})(w,x,{bypassRequiredCheck:C,isOAS3:i});return u.setIn([paramToIdentifier(w),\"errors\"],(0,qe.fromJS)(j))}),w)))},[na]:(o,{payload:{pathMethod:s}})=>o.updateIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.fromJS)([]),(o=>o.map((o=>o.set(\"errors\",(0,qe.fromJS)([])))))),[Pi]:(o,{payload:{res:s,path:i,method:u}})=>{let _;_=s.error?Object.assign({error:!0,name:s.err.name,message:s.err.message,statusCode:s.err.statusCode},s.err.response):s,_.headers=_.headers||{};let w=o.setIn([\"responses\",i,u],fromJSOrdered(_));return at.Blob&&_.data instanceof at.Blob&&(w=w.setIn([\"responses\",i,u,\"text\"],_.data)),w},[Mi]:(o,{payload:{req:s,path:i,method:u}})=>o.setIn([\"requests\",i,u],fromJSOrdered(s)),[Ri]:(o,{payload:{req:s,path:i,method:u}})=>o.setIn([\"mutatedRequests\",i,u],fromJSOrdered(s)),[ia]:(o,{payload:{path:s,value:i,key:u}})=>{let _=[\"paths\",...s],w=[\"meta\",\"paths\",...s];return o.getIn([\"json\",..._])||o.getIn([\"resolved\",..._])||o.getIn([\"resolvedSubtrees\",..._])?o.setIn([...w,u],(0,qe.fromJS)(i)):o},[ea]:(o,{payload:{path:s,method:i}})=>o.deleteIn([\"responses\",s,i]),[ra]:(o,{payload:{path:s,method:i}})=>o.deleteIn([\"requests\",s,i]),[la]:(o,{payload:{scheme:s,path:i,method:u}})=>i&&u?o.setIn([\"scheme\",i,u],s):i||u?void 0:o.setIn([\"scheme\",\"_defaultScheme\"],s)},wrap_actions_updateSpec=(o,{specActions:s})=>(...i)=>{o(...i),s.parseToJson(...i)},wrap_actions_updateJsonSpec=(o,{specActions:s})=>(...i)=>{o(...i),s.invalidateResolvedSubtreeCache();const[u]=i,_=go()(u,[\"paths\"])||{};Object.keys(_).forEach((o=>{go()(_,[o]).$ref&&s.requestResolvedSubtree([\"paths\",o])})),s.requestResolvedSubtree([\"components\",\"securitySchemes\"])},wrap_actions_executeRequest=(o,{specActions:s})=>i=>(s.logRequest(i),o(i)),wrap_actions_validateParams=(o,{specSelectors:s})=>i=>o(i,s.isOAS3()),plugins_spec=()=>({statePlugins:{spec:{wrapActions:{...ee},reducers:{...ga},actions:{...Z},selectors:{...Y}}}});var ya=function(){var extendStatics=function(o,s){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var i in s)s.hasOwnProperty(i)&&(o[i]=s[i])},extendStatics(o,s)};return function(o,s){function __(){this.constructor=o}extendStatics(o,s),o.prototype=null===s?Object.create(s):(__.prototype=s.prototype,new __)}}(),va=Object.prototype.hasOwnProperty;function module_helpers_hasOwnProperty(o,s){return va.call(o,s)}function _objectKeys(o){if(Array.isArray(o)){for(var s=new Array(o.length),i=0;i<s.length;i++)s[i]=\"\"+i;return s}if(Object.keys)return Object.keys(o);var u=[];for(var _ in o)module_helpers_hasOwnProperty(o,_)&&u.push(_);return u}function _deepClone(o){switch(typeof o){case\"object\":return JSON.parse(JSON.stringify(o));case\"undefined\":return null;default:return o}}function helpers_isInteger(o){for(var s,i=0,u=o.length;i<u;){if(!((s=o.charCodeAt(i))>=48&&s<=57))return!1;i++}return!0}function escapePathComponent(o){return-1===o.indexOf(\"/\")&&-1===o.indexOf(\"~\")?o:o.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")}function unescapePathComponent(o){return o.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}function hasUndefined(o){if(void 0===o)return!0;if(o)if(Array.isArray(o)){for(var s=0,i=o.length;s<i;s++)if(hasUndefined(o[s]))return!0}else if(\"object\"==typeof o)for(var u=_objectKeys(o),_=u.length,w=0;w<_;w++)if(hasUndefined(o[u[w]]))return!0;return!1}function patchErrorMessageFormatter(o,s){var i=[o];for(var u in s){var _=\"object\"==typeof s[u]?JSON.stringify(s[u],null,2):s[u];void 0!==_&&i.push(u+\": \"+_)}return i.join(\"\\n\")}var ba=function(o){function PatchError(s,i,u,_,w){var x=this.constructor,C=o.call(this,patchErrorMessageFormatter(s,{name:i,index:u,operation:_,tree:w}))||this;return C.name=i,C.index=u,C.operation=_,C.tree=w,Object.setPrototypeOf(C,x.prototype),C.message=patchErrorMessageFormatter(s,{name:i,index:u,operation:_,tree:w}),C}return ya(PatchError,o),PatchError}(Error),_a=ba,Ea=_deepClone,wa={add:function(o,s,i){return o[s]=this.value,{newDocument:i}},remove:function(o,s,i){var u=o[s];return delete o[s],{newDocument:i,removed:u}},replace:function(o,s,i){var u=o[s];return o[s]=this.value,{newDocument:i,removed:u}},move:function(o,s,i){var u=getValueByPointer(i,this.path);u&&(u=_deepClone(u));var _=applyOperation(i,{op:\"remove\",path:this.from}).removed;return applyOperation(i,{op:\"add\",path:this.path,value:_}),{newDocument:i,removed:u}},copy:function(o,s,i){var u=getValueByPointer(i,this.from);return applyOperation(i,{op:\"add\",path:this.path,value:_deepClone(u)}),{newDocument:i}},test:function(o,s,i){return{newDocument:i,test:_areEquals(o[s],this.value)}},_get:function(o,s,i){return this.value=o[s],{newDocument:i}}},xa={add:function(o,s,i){return helpers_isInteger(s)?o.splice(s,0,this.value):o[s]=this.value,{newDocument:i,index:s}},remove:function(o,s,i){return{newDocument:i,removed:o.splice(s,1)[0]}},replace:function(o,s,i){var u=o[s];return o[s]=this.value,{newDocument:i,removed:u}},move:wa.move,copy:wa.copy,test:wa.test,_get:wa._get};function getValueByPointer(o,s){if(\"\"==s)return o;var i={op:\"_get\",path:s};return applyOperation(o,i),i.value}function applyOperation(o,s,i,u,_,w){if(void 0===i&&(i=!1),void 0===u&&(u=!0),void 0===_&&(_=!0),void 0===w&&(w=0),i&&(\"function\"==typeof i?i(s,0,o,s.path):validator(s,0)),\"\"===s.path){var x={newDocument:o};if(\"add\"===s.op)return x.newDocument=s.value,x;if(\"replace\"===s.op)return x.newDocument=s.value,x.removed=o,x;if(\"move\"===s.op||\"copy\"===s.op)return x.newDocument=getValueByPointer(o,s.from),\"move\"===s.op&&(x.removed=o),x;if(\"test\"===s.op){if(x.test=_areEquals(o,s.value),!1===x.test)throw new _a(\"Test operation failed\",\"TEST_OPERATION_FAILED\",w,s,o);return x.newDocument=o,x}if(\"remove\"===s.op)return x.removed=o,x.newDocument=null,x;if(\"_get\"===s.op)return s.value=o,x;if(i)throw new _a(\"Operation `op` property is not one of operations defined in RFC-6902\",\"OPERATION_OP_INVALID\",w,s,o);return x}u||(o=_deepClone(o));var C=(s.path||\"\").split(\"/\"),j=o,L=1,B=C.length,$=void 0,V=void 0,U=void 0;for(U=\"function\"==typeof i?i:validator;;){if((V=C[L])&&-1!=V.indexOf(\"~\")&&(V=unescapePathComponent(V)),_&&(\"__proto__\"==V||\"prototype\"==V&&L>0&&\"constructor\"==C[L-1]))throw new TypeError(\"JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README\");if(i&&void 0===$&&(void 0===j[V]?$=C.slice(0,L).join(\"/\"):L==B-1&&($=s.path),void 0!==$&&U(s,0,o,$)),L++,Array.isArray(j)){if(\"-\"===V)V=j.length;else{if(i&&!helpers_isInteger(V))throw new _a(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\",\"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\",w,s,o);helpers_isInteger(V)&&(V=~~V)}if(L>=B){if(i&&\"add\"===s.op&&V>j.length)throw new _a(\"The specified index MUST NOT be greater than the number of elements in the array\",\"OPERATION_VALUE_OUT_OF_BOUNDS\",w,s,o);if(!1===(x=xa[s.op].call(s,j,V,o)).test)throw new _a(\"Test operation failed\",\"TEST_OPERATION_FAILED\",w,s,o);return x}}else if(L>=B){if(!1===(x=wa[s.op].call(s,j,V,o)).test)throw new _a(\"Test operation failed\",\"TEST_OPERATION_FAILED\",w,s,o);return x}if(j=j[V],i&&L<B&&(!j||\"object\"!=typeof j))throw new _a(\"Cannot perform operation at the desired path\",\"OPERATION_PATH_UNRESOLVABLE\",w,s,o)}}function applyPatch(o,s,i,u,_){if(void 0===u&&(u=!0),void 0===_&&(_=!0),i&&!Array.isArray(s))throw new _a(\"Patch sequence must be an array\",\"SEQUENCE_NOT_AN_ARRAY\");u||(o=_deepClone(o));for(var w=new Array(s.length),x=0,C=s.length;x<C;x++)w[x]=applyOperation(o,s[x],i,!0,_,x),o=w[x].newDocument;return w.newDocument=o,w}function applyReducer(o,s,i){var u=applyOperation(o,s);if(!1===u.test)throw new _a(\"Test operation failed\",\"TEST_OPERATION_FAILED\",i,s,o);return u.newDocument}function validator(o,s,i,u){if(\"object\"!=typeof o||null===o||Array.isArray(o))throw new _a(\"Operation is not an object\",\"OPERATION_NOT_AN_OBJECT\",s,o,i);if(!wa[o.op])throw new _a(\"Operation `op` property is not one of operations defined in RFC-6902\",\"OPERATION_OP_INVALID\",s,o,i);if(\"string\"!=typeof o.path)throw new _a(\"Operation `path` property is not a string\",\"OPERATION_PATH_INVALID\",s,o,i);if(0!==o.path.indexOf(\"/\")&&o.path.length>0)throw new _a('Operation `path` property must start with \"/\"',\"OPERATION_PATH_INVALID\",s,o,i);if((\"move\"===o.op||\"copy\"===o.op)&&\"string\"!=typeof o.from)throw new _a(\"Operation `from` property is not present (applicable in `move` and `copy` operations)\",\"OPERATION_FROM_REQUIRED\",s,o,i);if((\"add\"===o.op||\"replace\"===o.op||\"test\"===o.op)&&void 0===o.value)throw new _a(\"Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)\",\"OPERATION_VALUE_REQUIRED\",s,o,i);if((\"add\"===o.op||\"replace\"===o.op||\"test\"===o.op)&&hasUndefined(o.value))throw new _a(\"Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)\",\"OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED\",s,o,i);if(i)if(\"add\"==o.op){var _=o.path.split(\"/\").length,w=u.split(\"/\").length;if(_!==w+1&&_!==w)throw new _a(\"Cannot perform an `add` operation at the desired path\",\"OPERATION_PATH_CANNOT_ADD\",s,o,i)}else if(\"replace\"===o.op||\"remove\"===o.op||\"_get\"===o.op){if(o.path!==u)throw new _a(\"Cannot perform the operation at a path that does not exist\",\"OPERATION_PATH_UNRESOLVABLE\",s,o,i)}else if(\"move\"===o.op||\"copy\"===o.op){var x=validate([{op:\"_get\",path:o.from,value:void 0}],i);if(x&&\"OPERATION_PATH_UNRESOLVABLE\"===x.name)throw new _a(\"Cannot perform the operation from a path that does not exist\",\"OPERATION_FROM_UNRESOLVABLE\",s,o,i)}}function validate(o,s,i){try{if(!Array.isArray(o))throw new _a(\"Patch sequence must be an array\",\"SEQUENCE_NOT_AN_ARRAY\");if(s)applyPatch(_deepClone(s),_deepClone(o),i||!0);else{i=i||validator;for(var u=0;u<o.length;u++)i(o[u],u,s,void 0)}}catch(o){if(o instanceof _a)return o;throw o}}function _areEquals(o,s){if(o===s)return!0;if(o&&s&&\"object\"==typeof o&&\"object\"==typeof s){var i,u,_,w=Array.isArray(o),x=Array.isArray(s);if(w&&x){if((u=o.length)!=s.length)return!1;for(i=u;0!=i--;)if(!_areEquals(o[i],s[i]))return!1;return!0}if(w!=x)return!1;var C=Object.keys(o);if((u=C.length)!==Object.keys(s).length)return!1;for(i=u;0!=i--;)if(!s.hasOwnProperty(C[i]))return!1;for(i=u;0!=i--;)if(!_areEquals(o[_=C[i]],s[_]))return!1;return!0}return o!=o&&s!=s}var ka=new WeakMap,Ca=function Ca(o){this.observers=new Map,this.obj=o},Aa=function Aa(o,s){this.callback=o,this.observer=s};function unobserve(o,s){s.unobserve()}function observe(o,s){var i,u=function getMirror(o){return ka.get(o)}(o);if(u){var _=function getObserverFromMirror(o,s){return o.observers.get(s)}(u,s);i=_&&_.observer}else u=new Ca(o),ka.set(o,u);if(i)return i;if(i={},u.value=_deepClone(o),s){i.callback=s,i.next=null;var dirtyCheck=function(){generate(i)},fastCheck=function(){clearTimeout(i.next),i.next=setTimeout(dirtyCheck)};\"undefined\"!=typeof window&&(window.addEventListener(\"mouseup\",fastCheck),window.addEventListener(\"keyup\",fastCheck),window.addEventListener(\"mousedown\",fastCheck),window.addEventListener(\"keydown\",fastCheck),window.addEventListener(\"change\",fastCheck))}return i.patches=[],i.object=o,i.unobserve=function(){generate(i),clearTimeout(i.next),function removeObserverFromMirror(o,s){o.observers.delete(s.callback)}(u,i),\"undefined\"!=typeof window&&(window.removeEventListener(\"mouseup\",fastCheck),window.removeEventListener(\"keyup\",fastCheck),window.removeEventListener(\"mousedown\",fastCheck),window.removeEventListener(\"keydown\",fastCheck),window.removeEventListener(\"change\",fastCheck))},u.observers.set(s,new Aa(s,i)),i}function generate(o,s){void 0===s&&(s=!1);var i=ka.get(o.object);_generate(i.value,o.object,o.patches,\"\",s),o.patches.length&&applyPatch(i.value,o.patches);var u=o.patches;return u.length>0&&(o.patches=[],o.callback&&o.callback(u)),u}function _generate(o,s,i,u,_){if(s!==o){\"function\"==typeof s.toJSON&&(s=s.toJSON());for(var w=_objectKeys(s),x=_objectKeys(o),C=!1,j=x.length-1;j>=0;j--){var L=o[$=x[j]];if(!module_helpers_hasOwnProperty(s,$)||void 0===s[$]&&void 0!==L&&!1===Array.isArray(s))Array.isArray(o)===Array.isArray(s)?(_&&i.push({op:\"test\",path:u+\"/\"+escapePathComponent($),value:_deepClone(L)}),i.push({op:\"remove\",path:u+\"/\"+escapePathComponent($)}),C=!0):(_&&i.push({op:\"test\",path:u,value:o}),i.push({op:\"replace\",path:u,value:s}),!0);else{var B=s[$];\"object\"==typeof L&&null!=L&&\"object\"==typeof B&&null!=B&&Array.isArray(L)===Array.isArray(B)?_generate(L,B,i,u+\"/\"+escapePathComponent($),_):L!==B&&(!0,_&&i.push({op:\"test\",path:u+\"/\"+escapePathComponent($),value:_deepClone(L)}),i.push({op:\"replace\",path:u+\"/\"+escapePathComponent($),value:_deepClone(B)}))}}if(C||w.length!=x.length)for(j=0;j<w.length;j++){var $;module_helpers_hasOwnProperty(o,$=w[j])||void 0===s[$]||i.push({op:\"add\",path:u+\"/\"+escapePathComponent($),value:_deepClone(s[$])})}}}function compare(o,s,i){void 0===i&&(i=!1);var u=[];return _generate(o,s,u,\"\",i),u}Object.assign({},ie,ae,{JsonPatchError:ba,deepClone:_deepClone,escapePathComponent,unescapePathComponent});var ja=__webpack_require__(14744),Ia=__webpack_require__.n(ja);const Na={add:function add(o,s){return{op:\"add\",path:o,value:s}},replace,remove:function remove(o){return{op:\"remove\",path:o}},merge:function lib_merge(o,s){return{type:\"mutation\",op:\"merge\",path:o,value:s}},mergeDeep:function mergeDeep(o,s){return{type:\"mutation\",op:\"mergeDeep\",path:o,value:s}},context:function context(o,s){return{type:\"context\",path:o,value:s}},getIn:function lib_getIn(o,s){return s.reduce(((o,s)=>void 0!==s&&o?o[s]:o),o)},applyPatch:function lib_applyPatch(o,s,i){if(i=i||{},\"merge\"===(s={...s,path:s.path&&normalizeJSONPath(s.path)}).op){const i=getInByJsonPath(o,s.path);Object.assign(i,s.value),applyPatch(o,[replace(s.path,i)])}else if(\"mergeDeep\"===s.op){const i=getInByJsonPath(o,s.path),u=Ia()(i,s.value);o=applyPatch(o,[replace(s.path,u)]).newDocument}else if(\"add\"===s.op&&\"\"===s.path&&lib_isObject(s.value)){applyPatch(o,Object.keys(s.value).reduce(((o,i)=>(o.push({op:\"add\",path:`/${normalizeJSONPath(i)}`,value:s.value[i]}),o)),[]))}else if(\"replace\"===s.op&&\"\"===s.path){let{value:u}=s;i.allowMetaPatches&&s.meta&&isAdditiveMutation(s)&&(Array.isArray(s.value)||lib_isObject(s.value))&&(u={...u,...s.meta}),o=u}else if(applyPatch(o,[s]),i.allowMetaPatches&&s.meta&&isAdditiveMutation(s)&&(Array.isArray(s.value)||lib_isObject(s.value))){const i={...getInByJsonPath(o,s.path),...s.meta};applyPatch(o,[replace(s.path,i)])}return o},parentPathMatch:function parentPathMatch(o,s){if(!Array.isArray(s))return!1;for(let i=0,u=s.length;i<u;i+=1)if(s[i]!==o[i])return!1;return!0},flatten,fullyNormalizeArray:function fullyNormalizeArray(o){return cleanArray(flatten(lib_normalizeArray(o)))},normalizeArray:lib_normalizeArray,isPromise:function isPromise(o){return lib_isObject(o)&&lib_isFunction(o.then)},forEachNew:function forEachNew(o,s){try{return forEachNewPatch(o,forEach,s)}catch(o){return o}},forEachNewPrimitive:function forEachNewPrimitive(o,s){try{return forEachNewPatch(o,forEachPrimitive,s)}catch(o){return o}},isJsonPatch,isContextPatch:function isContextPatch(o){return isPatch(o)&&\"context\"===o.type},isPatch,isMutation,isAdditiveMutation,isGenerator:function isGenerator(o){return\"[object GeneratorFunction]\"===Object.prototype.toString.call(o)},isFunction:lib_isFunction,isObject:lib_isObject,isError:function lib_isError(o){return o instanceof Error}};function normalizeJSONPath(o){return Array.isArray(o)?o.length<1?\"\":`/${o.map((o=>(o+\"\").replace(/~/g,\"~0\").replace(/\\//g,\"~1\"))).join(\"/\")}`:o}function replace(o,s,i){return{op:\"replace\",path:o,value:s,meta:i}}function forEachNewPatch(o,s,i){return cleanArray(flatten(o.filter(isAdditiveMutation).map((o=>s(o.value,i,o.path)))||[]))}function forEachPrimitive(o,s,i){return i=i||[],Array.isArray(o)?o.map(((o,u)=>forEachPrimitive(o,s,i.concat(u)))):lib_isObject(o)?Object.keys(o).map((u=>forEachPrimitive(o[u],s,i.concat(u)))):s(o,i[i.length-1],i)}function forEach(o,s,i){let u=[];if((i=i||[]).length>0){const _=s(o,i[i.length-1],i);_&&(u=u.concat(_))}if(Array.isArray(o)){const _=o.map(((o,u)=>forEach(o,s,i.concat(u))));_&&(u=u.concat(_))}else if(lib_isObject(o)){const _=Object.keys(o).map((u=>forEach(o[u],s,i.concat(u))));_&&(u=u.concat(_))}return u=flatten(u),u}function lib_normalizeArray(o){return Array.isArray(o)?o:[o]}function flatten(o){return[].concat(...o.map((o=>Array.isArray(o)?flatten(o):o)))}function cleanArray(o){return o.filter((o=>void 0!==o))}function lib_isObject(o){return o&&\"object\"==typeof o}function lib_isFunction(o){return o&&\"function\"==typeof o}function isJsonPatch(o){if(isPatch(o)){const{op:s}=o;return\"add\"===s||\"remove\"===s||\"replace\"===s}return!1}function isMutation(o){return isJsonPatch(o)||isPatch(o)&&\"mutation\"===o.type}function isAdditiveMutation(o){return isMutation(o)&&(\"add\"===o.op||\"replace\"===o.op||\"merge\"===o.op||\"mergeDeep\"===o.op)}function isPatch(o){return o&&\"object\"==typeof o}function getInByJsonPath(o,s){try{return getValueByPointer(o,s)}catch(o){return console.error(o),{}}}var Da=__webpack_require__(48675);const La=class ApiDOMAggregateError extends Da{constructor(o,s,i){if(super(o,s,i),this.name=this.constructor.name,\"string\"==typeof s&&(this.message=s),\"function\"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(s).stack,null!=i&&\"object\"==typeof i&&Object.hasOwn(i,\"cause\")&&!(\"cause\"in this)){const{cause:o}=i;this.cause=o,o instanceof Error&&\"stack\"in o&&(this.stack=`${this.stack}\\nCAUSE: ${o.stack}`)}}};class ApiDOMError extends Error{static[Symbol.hasInstance](o){return super[Symbol.hasInstance](o)||Function.prototype[Symbol.hasInstance].call(La,o)}constructor(o,s){if(super(o,s),this.name=this.constructor.name,\"string\"==typeof o&&(this.message=o),\"function\"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(o).stack,null!=s&&\"object\"==typeof s&&Object.hasOwn(s,\"cause\")&&!(\"cause\"in this)){const{cause:o}=s;this.cause=o,o instanceof Error&&\"stack\"in o&&(this.stack=`${this.stack}\\nCAUSE: ${o.stack}`)}}}const Ba=ApiDOMError;const Fa=class ApiDOMStructuredError extends Ba{constructor(o,s){if(super(o,s),null!=s&&\"object\"==typeof s){const{cause:o,...i}=s;Object.assign(this,i)}}};var $a=__webpack_require__(65606);const za={\"@@functional/placeholder\":!0};function _isPlaceholder(o){return o===za}function _curry1(o){return function f1(s){return 0===arguments.length||_isPlaceholder(s)?f1:o.apply(this,arguments)}}function _curry2(o){return function f2(s,i){switch(arguments.length){case 0:return f2;case 1:return _isPlaceholder(s)?f2:_curry1((function(i){return o(s,i)}));default:return _isPlaceholder(s)&&_isPlaceholder(i)?f2:_isPlaceholder(s)?_curry1((function(s){return o(s,i)})):_isPlaceholder(i)?_curry1((function(i){return o(s,i)})):o(s,i)}}}function _curry3(o){return function f3(s,i,u){switch(arguments.length){case 0:return f3;case 1:return _isPlaceholder(s)?f3:_curry2((function(i,u){return o(s,i,u)}));case 2:return _isPlaceholder(s)&&_isPlaceholder(i)?f3:_isPlaceholder(s)?_curry2((function(s,u){return o(s,i,u)})):_isPlaceholder(i)?_curry2((function(i,u){return o(s,i,u)})):_curry1((function(u){return o(s,i,u)}));default:return _isPlaceholder(s)&&_isPlaceholder(i)&&_isPlaceholder(u)?f3:_isPlaceholder(s)&&_isPlaceholder(i)?_curry2((function(s,i){return o(s,i,u)})):_isPlaceholder(s)&&_isPlaceholder(u)?_curry2((function(s,u){return o(s,i,u)})):_isPlaceholder(i)&&_isPlaceholder(u)?_curry2((function(i,u){return o(s,i,u)})):_isPlaceholder(s)?_curry1((function(s){return o(s,i,u)})):_isPlaceholder(i)?_curry1((function(i){return o(s,i,u)})):_isPlaceholder(u)?_curry1((function(u){return o(s,i,u)})):o(s,i,u)}}}const Ha=Number.isInteger||function _isInteger(o){return(o|0)===o};function _isString(o){return\"[object String]\"===Object.prototype.toString.call(o)}function _nth(o,s){var i=o<0?s.length+o:o;return _isString(s)?s.charAt(i):s[i]}function _path(o,s){for(var i=s,u=0;u<o.length;u+=1){if(null==i)return;var _=o[u];i=Ha(_)?_nth(_,i):i[_]}return i}const Ja=_curry3((function pathSatisfies(o,s,i){return o(_path(s,i))}));function _cloneRegExp(o){return new RegExp(o.source,o.flags?o.flags:(o.global?\"g\":\"\")+(o.ignoreCase?\"i\":\"\")+(o.multiline?\"m\":\"\")+(o.sticky?\"y\":\"\")+(o.unicode?\"u\":\"\")+(o.dotAll?\"s\":\"\"))}function _arrayFromIterator(o){for(var s,i=[];!(s=o.next()).done;)i.push(s.value);return i}function _includesWith(o,s,i){for(var u=0,_=i.length;u<_;){if(o(s,i[u]))return!0;u+=1}return!1}function _has(o,s){return Object.prototype.hasOwnProperty.call(s,o)}const Ga=\"function\"==typeof Object.is?Object.is:function _objectIs(o,s){return o===s?0!==o||1/o==1/s:o!=o&&s!=s};var ec=Object.prototype.toString;const rc=function(){return\"[object Arguments]\"===ec.call(arguments)?function _isArguments(o){return\"[object Arguments]\"===ec.call(o)}:function _isArguments(o){return _has(\"callee\",o)}}();var oc=!{toString:null}.propertyIsEnumerable(\"toString\"),sc=[\"constructor\",\"valueOf\",\"isPrototypeOf\",\"toString\",\"propertyIsEnumerable\",\"hasOwnProperty\",\"toLocaleString\"],ic=function(){return arguments.propertyIsEnumerable(\"length\")}(),ac=function contains(o,s){for(var i=0;i<o.length;){if(o[i]===s)return!0;i+=1}return!1},cc=\"function\"!=typeof Object.keys||ic?_curry1((function keys(o){if(Object(o)!==o)return[];var s,i,u=[],_=ic&&rc(o);for(s in o)!_has(s,o)||_&&\"length\"===s||(u[u.length]=s);if(oc)for(i=sc.length-1;i>=0;)_has(s=sc[i],o)&&!ac(u,s)&&(u[u.length]=s),i-=1;return u})):_curry1((function keys(o){return Object(o)!==o?[]:Object.keys(o)}));const lc=cc;const pc=_curry1((function type(o){return null===o?\"Null\":void 0===o?\"Undefined\":Object.prototype.toString.call(o).slice(8,-1)}));function _uniqContentEquals(o,s,i,u){var _=_arrayFromIterator(o);function eq(o,s){return _equals(o,s,i.slice(),u.slice())}return!_includesWith((function(o,s){return!_includesWith(eq,s,o)}),_arrayFromIterator(s),_)}function _equals(o,s,i,u){if(Ga(o,s))return!0;var _=pc(o);if(_!==pc(s))return!1;if(\"function\"==typeof o[\"fantasy-land/equals\"]||\"function\"==typeof s[\"fantasy-land/equals\"])return\"function\"==typeof o[\"fantasy-land/equals\"]&&o[\"fantasy-land/equals\"](s)&&\"function\"==typeof s[\"fantasy-land/equals\"]&&s[\"fantasy-land/equals\"](o);if(\"function\"==typeof o.equals||\"function\"==typeof s.equals)return\"function\"==typeof o.equals&&o.equals(s)&&\"function\"==typeof s.equals&&s.equals(o);switch(_){case\"Arguments\":case\"Array\":case\"Object\":if(\"function\"==typeof o.constructor&&\"Promise\"===function _functionName(o){var s=String(o).match(/^function (\\w*)/);return null==s?\"\":s[1]}(o.constructor))return o===s;break;case\"Boolean\":case\"Number\":case\"String\":if(typeof o!=typeof s||!Ga(o.valueOf(),s.valueOf()))return!1;break;case\"Date\":if(!Ga(o.valueOf(),s.valueOf()))return!1;break;case\"Error\":return o.name===s.name&&o.message===s.message;case\"RegExp\":if(o.source!==s.source||o.global!==s.global||o.ignoreCase!==s.ignoreCase||o.multiline!==s.multiline||o.sticky!==s.sticky||o.unicode!==s.unicode)return!1}for(var w=i.length-1;w>=0;){if(i[w]===o)return u[w]===s;w-=1}switch(_){case\"Map\":return o.size===s.size&&_uniqContentEquals(o.entries(),s.entries(),i.concat([o]),u.concat([s]));case\"Set\":return o.size===s.size&&_uniqContentEquals(o.values(),s.values(),i.concat([o]),u.concat([s]));case\"Arguments\":case\"Array\":case\"Object\":case\"Boolean\":case\"Number\":case\"String\":case\"Date\":case\"Error\":case\"RegExp\":case\"Int8Array\":case\"Uint8Array\":case\"Uint8ClampedArray\":case\"Int16Array\":case\"Uint16Array\":case\"Int32Array\":case\"Uint32Array\":case\"Float32Array\":case\"Float64Array\":case\"ArrayBuffer\":break;default:return!1}var x=lc(o);if(x.length!==lc(s).length)return!1;var C=i.concat([o]),j=u.concat([s]);for(w=x.length-1;w>=0;){var L=x[w];if(!_has(L,s)||!_equals(s[L],o[L],C,j))return!1;w-=1}return!0}const hc=_curry2((function equals(o,s){return _equals(o,s,[],[])}));function _includes(o,s){return function _indexOf(o,s,i){var u,_;if(\"function\"==typeof o.indexOf)switch(typeof s){case\"number\":if(0===s){for(u=1/s;i<o.length;){if(0===(_=o[i])&&1/_===u)return i;i+=1}return-1}if(s!=s){for(;i<o.length;){if(\"number\"==typeof(_=o[i])&&_!=_)return i;i+=1}return-1}return o.indexOf(s,i);case\"string\":case\"boolean\":case\"function\":case\"undefined\":return o.indexOf(s,i);case\"object\":if(null===s)return o.indexOf(s,i)}for(;i<o.length;){if(hc(o[i],s))return i;i+=1}return-1}(s,o,0)>=0}function _map(o,s){for(var i=0,u=s.length,_=Array(u);i<u;)_[i]=o(s[i]),i+=1;return _}function _quote(o){return'\"'+o.replace(/\\\\/g,\"\\\\\\\\\").replace(/[\\b]/g,\"\\\\b\").replace(/\\f/g,\"\\\\f\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/\\t/g,\"\\\\t\").replace(/\\v/g,\"\\\\v\").replace(/\\0/g,\"\\\\0\").replace(/\"/g,'\\\\\"')+'\"'}var dc=function pad(o){return(o<10?\"0\":\"\")+o};const fc=\"function\"==typeof Date.prototype.toISOString?function _toISOString(o){return o.toISOString()}:function _toISOString(o){return o.getUTCFullYear()+\"-\"+dc(o.getUTCMonth()+1)+\"-\"+dc(o.getUTCDate())+\"T\"+dc(o.getUTCHours())+\":\"+dc(o.getUTCMinutes())+\":\"+dc(o.getUTCSeconds())+\".\"+(o.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+\"Z\"};function _complement(o){return function(){return!o.apply(this,arguments)}}function _arrayReduce(o,s,i){for(var u=0,_=i.length;u<_;)s=o(s,i[u]),u+=1;return s}const gc=Array.isArray||function _isArray(o){return null!=o&&o.length>=0&&\"[object Array]\"===Object.prototype.toString.call(o)};function _dispatchable(o,s,i){return function(){if(0===arguments.length)return i();var u=arguments[arguments.length-1];if(!gc(u)){for(var _=0;_<o.length;){if(\"function\"==typeof u[o[_]])return u[o[_]].apply(u,Array.prototype.slice.call(arguments,0,-1));_+=1}if(function _isTransformer(o){return null!=o&&\"function\"==typeof o[\"@@transducer/step\"]}(u))return s.apply(null,Array.prototype.slice.call(arguments,0,-1))(u)}return i.apply(this,arguments)}}function _isObject(o){return\"[object Object]\"===Object.prototype.toString.call(o)}const _xfBase_init=function(){return this.xf[\"@@transducer/init\"]()},_xfBase_result=function(o){return this.xf[\"@@transducer/result\"](o)};var bc=function(){function XFilter(o,s){this.xf=s,this.f=o}return XFilter.prototype[\"@@transducer/init\"]=_xfBase_init,XFilter.prototype[\"@@transducer/result\"]=_xfBase_result,XFilter.prototype[\"@@transducer/step\"]=function(o,s){return this.f(s)?this.xf[\"@@transducer/step\"](o,s):o},XFilter}();function _xfilter(o){return function(s){return new bc(o,s)}}var _c=_curry2(_dispatchable([\"fantasy-land/filter\",\"filter\"],_xfilter,(function(o,s){return _isObject(s)?_arrayReduce((function(i,u){return o(s[u])&&(i[u]=s[u]),i}),{},lc(s)):function _filter(o,s){for(var i=0,u=s.length,_=[];i<u;)o(s[i])&&(_[_.length]=s[i]),i+=1;return _}(o,s)})));const Ec=_c;const kc=_curry2((function reject(o,s){return Ec(_complement(o),s)}));function _toString_toString(o,s){var i=function recur(i){var u=s.concat([o]);return _includes(i,u)?\"<Circular>\":_toString_toString(i,u)},mapPairs=function(o,s){return _map((function(s){return _quote(s)+\": \"+i(o[s])}),s.slice().sort())};switch(Object.prototype.toString.call(o)){case\"[object Arguments]\":return\"(function() { return arguments; }(\"+_map(i,o).join(\", \")+\"))\";case\"[object Array]\":return\"[\"+_map(i,o).concat(mapPairs(o,kc((function(o){return/^\\d+$/.test(o)}),lc(o)))).join(\", \")+\"]\";case\"[object Boolean]\":return\"object\"==typeof o?\"new Boolean(\"+i(o.valueOf())+\")\":o.toString();case\"[object Date]\":return\"new Date(\"+(isNaN(o.valueOf())?i(NaN):_quote(fc(o)))+\")\";case\"[object Map]\":return\"new Map(\"+i(Array.from(o))+\")\";case\"[object Null]\":return\"null\";case\"[object Number]\":return\"object\"==typeof o?\"new Number(\"+i(o.valueOf())+\")\":1/o==-1/0?\"-0\":o.toString(10);case\"[object Set]\":return\"new Set(\"+i(Array.from(o).sort())+\")\";case\"[object String]\":return\"object\"==typeof o?\"new String(\"+i(o.valueOf())+\")\":_quote(o);case\"[object Undefined]\":return\"undefined\";default:if(\"function\"==typeof o.toString){var u=o.toString();if(\"[object Object]\"!==u)return u}return\"{\"+mapPairs(o,lc(o)).join(\", \")+\"}\"}}const Oc=_curry1((function toString(o){return _toString_toString(o,[])}));var jc=_curry2((function test(o,s){if(!function _isRegExp(o){return\"[object RegExp]\"===Object.prototype.toString.call(o)}(o))throw new TypeError(\"‘test’ requires a value of type RegExp as its first argument; received \"+Oc(o));return _cloneRegExp(o).test(s)}));const Pc=jc;function _arity(o,s){switch(o){case 0:return function(){return s.apply(this,arguments)};case 1:return function(o){return s.apply(this,arguments)};case 2:return function(o,i){return s.apply(this,arguments)};case 3:return function(o,i,u){return s.apply(this,arguments)};case 4:return function(o,i,u,_){return s.apply(this,arguments)};case 5:return function(o,i,u,_,w){return s.apply(this,arguments)};case 6:return function(o,i,u,_,w,x){return s.apply(this,arguments)};case 7:return function(o,i,u,_,w,x,C){return s.apply(this,arguments)};case 8:return function(o,i,u,_,w,x,C,j){return s.apply(this,arguments)};case 9:return function(o,i,u,_,w,x,C,j,L){return s.apply(this,arguments)};case 10:return function(o,i,u,_,w,x,C,j,L,B){return s.apply(this,arguments)};default:throw new Error(\"First argument to _arity must be a non-negative integer no greater than ten\")}}function _pipe(o,s){return function(){return s.call(this,o.apply(this,arguments))}}const Ic=_curry1((function isArrayLike(o){return!!gc(o)||!!o&&(\"object\"==typeof o&&(!_isString(o)&&(0===o.length||o.length>0&&(o.hasOwnProperty(0)&&o.hasOwnProperty(o.length-1)))))}));var Mc=\"undefined\"!=typeof Symbol?Symbol.iterator:\"@@iterator\";function _createReduce(o,s,i){return function _reduce(u,_,w){if(Ic(w))return o(u,_,w);if(null==w)return _;if(\"function\"==typeof w[\"fantasy-land/reduce\"])return s(u,_,w,\"fantasy-land/reduce\");if(null!=w[Mc])return i(u,_,w[Mc]());if(\"function\"==typeof w.next)return i(u,_,w);if(\"function\"==typeof w.reduce)return s(u,_,w,\"reduce\");throw new TypeError(\"reduce: list must be array or iterable\")}}function _xArrayReduce(o,s,i){for(var u=0,_=i.length;u<_;){if((s=o[\"@@transducer/step\"](s,i[u]))&&s[\"@@transducer/reduced\"]){s=s[\"@@transducer/value\"];break}u+=1}return o[\"@@transducer/result\"](s)}var Nc=_curry2((function bind(o,s){return _arity(o.length,(function(){return o.apply(s,arguments)}))}));const Rc=Nc;function _xIterableReduce(o,s,i){for(var u=i.next();!u.done;){if((s=o[\"@@transducer/step\"](s,u.value))&&s[\"@@transducer/reduced\"]){s=s[\"@@transducer/value\"];break}u=i.next()}return o[\"@@transducer/result\"](s)}function _xMethodReduce(o,s,i,u){return o[\"@@transducer/result\"](i[u](Rc(o[\"@@transducer/step\"],o),s))}const Lc=_createReduce(_xArrayReduce,_xMethodReduce,_xIterableReduce);var Fc=function(){function XWrap(o){this.f=o}return XWrap.prototype[\"@@transducer/init\"]=function(){throw new Error(\"init not implemented on XWrap\")},XWrap.prototype[\"@@transducer/result\"]=function(o){return o},XWrap.prototype[\"@@transducer/step\"]=function(o,s){return this.f(o,s)},XWrap}();function _xwrap(o){return new Fc(o)}var qc=_curry3((function(o,s,i){return Lc(\"function\"==typeof o?_xwrap(o):o,s,i)}));const Kc=qc;function _checkForMethod(o,s){return function(){var i=arguments.length;if(0===i)return s();var u=arguments[i-1];return gc(u)||\"function\"!=typeof u[o]?s.apply(this,arguments):u[o].apply(u,Array.prototype.slice.call(arguments,0,i-1))}}var Hc=_curry3(_checkForMethod(\"slice\",(function slice(o,s,i){return Array.prototype.slice.call(i,o,s)})));const Jc=Hc;const Gc=_curry1(_checkForMethod(\"tail\",Jc(1,1/0)));function pipe(){if(0===arguments.length)throw new Error(\"pipe requires at least one argument\");return _arity(arguments[0].length,Kc(_pipe,arguments[0],Gc(arguments)))}const Qc=_curry2((function defaultTo(o,s){return null==s||s!=s?o:s}));const tl=_curry2((function prop(o,s){if(null!=s)return Ha(o)?_nth(o,s):s[o]}));const sl=_curry3((function propOr(o,s,i){return Qc(o,tl(s,i))}));var ul=_curry1((function(o){return _nth(-1,o)}));const yl=ul;function _curryN(o,s,i){return function(){for(var u=[],_=0,w=o,x=0,C=!1;x<s.length||_<arguments.length;){var j;x<s.length&&(!_isPlaceholder(s[x])||_>=arguments.length)?j=s[x]:(j=arguments[_],_+=1),u[x]=j,_isPlaceholder(j)?C=!0:w-=1,x+=1}return!C&&w<=0?i.apply(this,u):_arity(Math.max(0,w),_curryN(o,u,i))}}var vl=_curry2((function curryN(o,s){return 1===o?_curry1(s):_arity(o,_curryN(o,[],s))}));const _l=vl;var El=_curry1((function curry(o){return _l(o.length,o)}));const wl=El;function _isFunction(o){var s=Object.prototype.toString.call(o);return\"[object Function]\"===s||\"[object AsyncFunction]\"===s||\"[object GeneratorFunction]\"===s||\"[object AsyncGeneratorFunction]\"===s}const Sl=_curry2((function invoker(o,s){return _l(o+1,(function(){var i=arguments[o];if(null!=i&&_isFunction(i[s]))return i[s].apply(i,Array.prototype.slice.call(arguments,0,o));throw new TypeError(Oc(i)+' does not have a method named \"'+s+'\"')}))}));const xl=Sl(1,\"split\");function dropLastWhile(o,s){for(var i=s.length-1;i>=0&&o(s[i]);)i-=1;return Jc(0,i+1,s)}var kl=function(){function XDropLastWhile(o,s){this.f=o,this.retained=[],this.xf=s}return XDropLastWhile.prototype[\"@@transducer/init\"]=_xfBase_init,XDropLastWhile.prototype[\"@@transducer/result\"]=function(o){return this.retained=null,this.xf[\"@@transducer/result\"](o)},XDropLastWhile.prototype[\"@@transducer/step\"]=function(o,s){return this.f(s)?this.retain(o,s):this.flush(o,s)},XDropLastWhile.prototype.flush=function(o,s){return o=Lc(this.xf,o,this.retained),this.retained=[],this.xf[\"@@transducer/step\"](o,s)},XDropLastWhile.prototype.retain=function(o,s){return this.retained.push(s),o},XDropLastWhile}();function _xdropLastWhile(o){return function(s){return new kl(o,s)}}const Ol=_curry2(_dispatchable([],_xdropLastWhile,dropLastWhile));const Cl=Sl(1,\"join\");var Al=_curry1((function flip(o){return _l(o.length,(function(s,i){var u=Array.prototype.slice.call(arguments,0);return u[0]=i,u[1]=s,o.apply(this,u)}))}));const Pl=Al(_curry2(_includes));const Il=wl((function(o,s){return pipe(xl(\"\"),Ol(Pl(o)),Cl(\"\"))(s)}));function _iterableReduce(o,s,i){for(var u=i.next();!u.done;)s=o(s,u.value),u=i.next();return s}function _methodReduce(o,s,i,u){return i[u](o,s)}const Ml=_createReduce(_arrayReduce,_methodReduce,_iterableReduce);var Nl=function(){function XMap(o,s){this.xf=s,this.f=o}return XMap.prototype[\"@@transducer/init\"]=_xfBase_init,XMap.prototype[\"@@transducer/result\"]=_xfBase_result,XMap.prototype[\"@@transducer/step\"]=function(o,s){return this.xf[\"@@transducer/step\"](o,this.f(s))},XMap}();var Tl=_curry2(_dispatchable([\"fantasy-land/map\",\"map\"],(function _xmap(o){return function(s){return new Nl(o,s)}}),(function map(o,s){switch(Object.prototype.toString.call(s)){case\"[object Function]\":return _l(s.length,(function(){return o.call(this,s.apply(this,arguments))}));case\"[object Object]\":return _arrayReduce((function(i,u){return i[u]=o(s[u]),i}),{},lc(s));default:return _map(o,s)}})));const Rl=Tl;const Dl=_curry2((function ap(o,s){return\"function\"==typeof s[\"fantasy-land/ap\"]?s[\"fantasy-land/ap\"](o):\"function\"==typeof o.ap?o.ap(s):\"function\"==typeof o?function(i){return o(i)(s(i))}:Ml((function(o,i){return function _concat(o,s){var i;s=s||[];var u=(o=o||[]).length,_=s.length,w=[];for(i=0;i<u;)w[w.length]=o[i],i+=1;for(i=0;i<_;)w[w.length]=s[i],i+=1;return w}(o,Rl(i,s))}),[],o)}));var Ll=_curry2((function liftN(o,s){var i=_l(o,s);return _l(o,(function(){return _arrayReduce(Dl,Rl(i,arguments[0]),Array.prototype.slice.call(arguments,1))}))}));const Bl=Ll;var Fl=_curry1((function lift(o){return Bl(o.length,o)}));const $l=Fl;const Vl=$l(_curry1((function not(o){return!o})));const Ul=_curry1((function always(o){return function(){return o}}));const zl=Ul(void 0);const Wl=hc(zl());const Kl=Vl(Wl);const Hl=_curry2((function max(o,s){if(o===s)return s;function safeMax(o,s){if(o>s!=s>o)return s>o?s:o}var i=safeMax(o,s);if(void 0!==i)return i;var u=safeMax(typeof o,typeof s);if(void 0!==u)return u===typeof o?o:s;var _=Oc(o),w=safeMax(_,Oc(s));return void 0!==w&&w===_?o:s}));var Jl=_curry2((function pluck(o,s){return Rl(tl(o),s)}));const Gl=Jl;const Yl=_curry1((function anyPass(o){return _l(Kc(Hl,0,Gl(\"length\",o)),(function(){for(var s=0,i=o.length;s<i;){if(o[s].apply(this,arguments))return!0;s+=1}return!1}))}));var identical=function(o,s){switch(arguments.length){case 0:return identical;case 1:return function unaryIdentical(s){return 0===arguments.length?unaryIdentical:Ga(o,s)};default:return Ga(o,s)}};const Xl=identical;const Ql=_l(1,pipe(pc,Xl(\"GeneratorFunction\")));const Zl=_l(1,pipe(pc,Xl(\"AsyncFunction\")));const eu=Yl([pipe(pc,Xl(\"Function\")),Ql,Zl]);var tu=_curry3((function replace(o,s,i){return i.replace(o,s)}));const ru=tu;const nu=_l(1,pipe(pc,Xl(\"RegExp\")));const ou=_curry3((function when(o,s,i){return o(i)?s(i):i}));const su=_l(1,pipe(pc,Xl(\"String\")));const iu=ou(su,ru(/[.*+?^${}()|[\\]\\\\-]/g,\"\\\\$&\"));var au=function checkValue(o,s){if(\"string\"!=typeof o&&!(o instanceof String))throw TypeError(\"`\".concat(s,\"` must be a string\"))};const cu=function replaceAll(o,s,i){!function checkArguments(o,s,i){if(null==i||null==o||null==s)throw TypeError(\"Input values must not be `null` or `undefined`\")}(o,s,i),au(i,\"str\"),au(s,\"replaceValue\"),function checkSearchValue(o){if(!(\"string\"==typeof o||o instanceof String||o instanceof RegExp))throw TypeError(\"`searchValue` must be a string or an regexp\")}(o);var u=new RegExp(nu(o)?o:iu(o),\"g\");return ru(u,s,i)};var lu=_l(3,cu),uu=Sl(2,\"replaceAll\");const pu=eu(String.prototype.replaceAll)?uu:lu,isWindows=()=>Ja(Pc(/^win/),[\"platform\"],$a),getProtocol=o=>{try{const s=new URL(o);return Il(\":\",s.protocol)}catch{return}},hu=(pipe(getProtocol,Kl),o=>{if($a.browser)return!1;const s=getProtocol(o);return Wl(s)||\"file\"===s||/^[a-zA-Z]$/.test(s)}),isHttpUrl=o=>{const s=getProtocol(o);return\"http\"===s||\"https\"===s},toFileSystemPath=(o,s)=>{const i=[/%23/g,\"#\",/%24/g,\"$\",/%26/g,\"&\",/%2C/g,\",\",/%40/g,\"@\"],u=sl(!1,\"keepFileProtocol\",s),_=sl(isWindows,\"isWindows\",s);let w=decodeURI(o);for(let o=0;o<i.length;o+=2)w=w.replace(i[o],i[o+1]);let x=\"file://\"===w.substring(0,7).toLowerCase();return x&&(w=\"/\"===w[7]?w.substring(8):w.substring(7),_()&&\"/\"===w[1]&&(w=`${w[0]}:${w.substring(1)}`),u?w=`file:///${w}`:(x=!1,w=_()?w:`/${w}`)),_()&&!x&&(w=pu(\"/\",\"\\\\\",w),\":\\\\\"===w.substring(1,3)&&(w=w[0].toUpperCase()+w.substring(1))),w},getHash=o=>{const s=o.indexOf(\"#\");return-1!==s?o.substring(s):\"#\"},stripHash=o=>{const s=o.indexOf(\"#\");let i=o;return s>=0&&(i=o.substring(0,s)),i},url_cwd=()=>{if($a.browser)return stripHash(globalThis.location.href);const o=$a.cwd(),s=yl(o);return[\"/\",\"\\\\\"].includes(s)?o:o+(isWindows()?\"\\\\\":\"/\")},resolve=(o,s)=>{const i=new URL(s,new URL(o,\"resolve://\"));if(\"resolve:\"===i.protocol){const{pathname:o,search:s,hash:u}=i;return o+s+u}return i.toString()},sanitize=o=>{if(hu(o))return(o=>{const s=[/\\?/g,\"%3F\",/#/g,\"%23\"];let i=o;isWindows()&&(i=i.replace(/\\\\/g,\"/\")),i=encodeURI(i);for(let o=0;o<s.length;o+=2)i=i.replace(s[o],s[o+1]);return i})(toFileSystemPath(o));try{return new URL(o).toString()}catch{return encodeURI(decodeURI(o)).replace(/%5B/g,\"[\").replace(/%5D/g,\"]\")}},unsanitize=o=>hu(o)?toFileSystemPath(o):decodeURI(o),{fetch:du,Response:fu,Headers:mu,Request:gu,FormData:yu,File:vu,Blob:bu}=globalThis;void 0===globalThis.fetch&&(globalThis.fetch=du),void 0===globalThis.Headers&&(globalThis.Headers=mu),void 0===globalThis.Request&&(globalThis.Request=gu),void 0===globalThis.Response&&(globalThis.Response=fu),void 0===globalThis.FormData&&(globalThis.FormData=yu),void 0===globalThis.File&&(globalThis.File=vu),void 0===globalThis.Blob&&(globalThis.Blob=bu);var _u=__webpack_require__(36623),Eu=__webpack_require__.n(_u);const wu=\"application/json, application/yaml\",Su=\"https://swagger.io\",xu=Object.freeze({url:\"/\"}),ku=[\"properties\"],Ou=[\"properties\"],Cu=[\"definitions\",\"parameters\",\"responses\",\"securityDefinitions\",\"components/schemas\",\"components/responses\",\"components/parameters\",\"components/securitySchemes\"],Au=[\"schema/example\",\"items/example\"];function isFreelyNamed(o){const s=o[o.length-1],i=o[o.length-2],u=o.join(\"/\");return ku.indexOf(s)>-1&&-1===Ou.indexOf(i)||Cu.indexOf(u)>-1||Au.some((o=>u.indexOf(o)>-1))}function absolutifyPointer(o,s){const[i,u]=o.split(\"#\"),_=null!=s?s:\"\",w=null!=i?i:\"\";let x;if(isHttpUrl(_))x=resolve(_,w);else{const o=resolve(Su,_),s=resolve(o,w).replace(Su,\"\");x=w.startsWith(\"/\")?s:s.substring(1)}return u?`${x}#${u}`:x}const ju=/^([a-z]+:\\/\\/|\\/\\/)/i;class JSONRefError extends Fa{}const Pu={},Iu=new WeakMap,Mu=[o=>\"paths\"===o[0]&&\"responses\"===o[3]&&\"examples\"===o[5],o=>\"paths\"===o[0]&&\"responses\"===o[3]&&\"content\"===o[5]&&\"example\"===o[7],o=>\"paths\"===o[0]&&\"responses\"===o[3]&&\"content\"===o[5]&&\"examples\"===o[7]&&\"value\"===o[9],o=>\"paths\"===o[0]&&\"requestBody\"===o[3]&&\"content\"===o[4]&&\"example\"===o[6],o=>\"paths\"===o[0]&&\"requestBody\"===o[3]&&\"content\"===o[4]&&\"examples\"===o[6]&&\"value\"===o[8],o=>\"paths\"===o[0]&&\"parameters\"===o[2]&&\"example\"===o[4],o=>\"paths\"===o[0]&&\"parameters\"===o[3]&&\"example\"===o[5],o=>\"paths\"===o[0]&&\"parameters\"===o[2]&&\"examples\"===o[4]&&\"value\"===o[6],o=>\"paths\"===o[0]&&\"parameters\"===o[3]&&\"examples\"===o[5]&&\"value\"===o[7],o=>\"paths\"===o[0]&&\"parameters\"===o[2]&&\"content\"===o[4]&&\"example\"===o[6],o=>\"paths\"===o[0]&&\"parameters\"===o[2]&&\"content\"===o[4]&&\"examples\"===o[6]&&\"value\"===o[8],o=>\"paths\"===o[0]&&\"parameters\"===o[3]&&\"content\"===o[4]&&\"example\"===o[7],o=>\"paths\"===o[0]&&\"parameters\"===o[3]&&\"content\"===o[5]&&\"examples\"===o[7]&&\"value\"===o[9]],Nu={key:\"$ref\",plugin:(o,s,i,u)=>{const _=u.getInstance(),w=i.slice(0,-1);if(isFreelyNamed(w)||(o=>Mu.some((s=>s(o))))(w))return;const{baseDoc:x}=u.getContext(i);if(\"string\"!=typeof o)return new JSONRefError(\"$ref: must be a string (JSON-Ref)\",{$ref:o,baseDoc:x,fullPath:i});const C=refs_split(o),j=C[0],L=C[1]||\"\";let B,$,V;try{B=x||j?absoluteify(j,x):null}catch(s){return wrapError(s,{pointer:L,$ref:o,basePath:B,fullPath:i})}if(function pointerAlreadyInPath(o,s,i,u){let _=Iu.get(u);_||(_={},Iu.set(u,_));const w=function arrayToJsonPointer(o){if(0===o.length)return\"\";return`/${o.map(escapeJsonPointerToken).join(\"/\")}`}(i),x=`${s||\"<specmap-base>\"}#${o}`,C=w.replace(/allOf\\/\\d+\\/?/g,\"\"),j=u.contextTree.get([]).baseDoc;if(s===j&&pointerIsAParent(C,o))return!0;let L=\"\";const B=i.some((o=>(L=`${L}/${escapeJsonPointerToken(o)}`,_[L]&&_[L].some((o=>pointerIsAParent(o,x)||pointerIsAParent(x,o))))));if(B)return!0;return void(_[C]=(_[C]||[]).concat(x))}(L,B,w,u)&&!_.useCircularStructures){const s=absolutifyPointer(o,B);return o===s?null:Na.replace(i,s)}if(null==B?(V=jsonPointerToArray(L),$=u.get(V),void 0===$&&($=new JSONRefError(`Could not resolve reference: ${o}`,{pointer:L,$ref:o,baseDoc:x,fullPath:i}))):($=extractFromDoc(B,L),$=null!=$.__value?$.__value:$.catch((s=>{throw wrapError(s,{pointer:L,$ref:o,baseDoc:x,fullPath:i})}))),$ instanceof Error)return[Na.remove(i),$];const U=absolutifyPointer(o,B),z=Na.replace(w,$,{$$ref:U});if(B&&B!==x)return[z,Na.context(w,{baseDoc:B})];try{if(!function patchValueAlreadyInPath(o,s){const i=[o];return s.path.reduce(((o,s)=>(i.push(o[s]),o[s])),o),pointToAncestor(s.value);function pointToAncestor(o){return Na.isObject(o)&&(i.indexOf(o)>=0||Object.keys(o).some((s=>pointToAncestor(o[s]))))}}(u.state,z)||_.useCircularStructures)return z}catch(o){return null}}},Tu=Object.assign(Nu,{docCache:Pu,absoluteify,clearCache:function clearCache(o){void 0!==o?delete Pu[o]:Object.keys(Pu).forEach((o=>{delete Pu[o]}))},JSONRefError,wrapError,getDoc,split:refs_split,extractFromDoc,fetchJSON:function fetchJSON(o){return fetch(o,{headers:{Accept:wu},loadSpec:!0}).then((o=>o.text())).then((o=>to.load(o)))},extract,jsonPointerToArray,unescapeJsonPointerToken}),Ru=Tu;function absoluteify(o,s){if(!ju.test(o)){if(!s)throw new JSONRefError(`Tried to resolve a relative URL, without having a basePath. path: '${o}' basePath: '${s}'`);return resolve(s,o)}return o}function wrapError(o,s){let i;return i=o&&o.response&&o.response.body?`${o.response.body.code} ${o.response.body.message}`:o.message,new JSONRefError(`Could not resolve reference: ${i}`,{...s,cause:o})}function refs_split(o){return(o+\"\").split(\"#\")}function extractFromDoc(o,s){const i=Pu[o];if(i&&!Na.isPromise(i))try{const o=extract(s,i);return Object.assign(Promise.resolve(o),{__value:o})}catch(o){return Promise.reject(o)}return getDoc(o).then((o=>extract(s,o)))}function getDoc(o){const s=Pu[o];return s?Na.isPromise(s)?s:Promise.resolve(s):(Pu[o]=Tu.fetchJSON(o).then((s=>(Pu[o]=s,s))),Pu[o])}function extract(o,s){const i=jsonPointerToArray(o);if(i.length<1)return s;const u=Na.getIn(s,i);if(void 0===u)throw new JSONRefError(`Could not resolve pointer: ${o} does not exist in document`,{pointer:o});return u}function jsonPointerToArray(o){if(\"string\"!=typeof o)throw new TypeError(\"Expected a string, got a \"+typeof o);return\"/\"===o[0]&&(o=o.substr(1)),\"\"===o?[]:o.split(\"/\").map(unescapeJsonPointerToken)}function unescapeJsonPointerToken(o){if(\"string\"!=typeof o)return o;return new URLSearchParams(`=${o.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}`).get(\"\")}function escapeJsonPointerToken(o){return new URLSearchParams([[\"\",o.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")]]).toString().slice(1)}const pointerBoundaryChar=o=>!o||\"/\"===o||\"#\"===o;function pointerIsAParent(o,s){if(pointerBoundaryChar(s))return!0;const i=o.charAt(s.length),u=s.slice(-1);return 0===o.indexOf(s)&&(!i||\"/\"===i||\"#\"===i)&&\"#\"!==u}const Du={key:\"allOf\",plugin:(o,s,i,u,_)=>{if(_.meta&&_.meta.$$ref)return;const w=i.slice(0,-1);if(isFreelyNamed(w))return;if(!Array.isArray(o)){const o=new TypeError(\"allOf must be an array\");return o.fullPath=i,o}let x=!1,C=_.value;if(w.forEach((o=>{C&&(C=C[o])})),C={...C},0===Object.keys(C).length)return;delete C.allOf;const j=[];return j.push(u.replace(w,{})),o.forEach(((o,s)=>{if(!u.isObject(o)){if(x)return null;x=!0;const o=new TypeError(\"Elements in allOf must be objects\");return o.fullPath=i,j.push(o)}j.push(u.mergeDeep(w,o));const _=function generateAbsoluteRefPatches(o,s,{specmap:i,getBaseUrlForNodePath:u=(o=>i.getContext([...s,...o]).baseDoc),targetKeys:_=[\"$ref\",\"$$ref\"]}={}){const w=[];return Eu()(o).forEach((function callback(){if(_.includes(this.key)&&\"string\"==typeof this.node){const o=this.path,_=s.concat(this.path),x=absolutifyPointer(this.node,u(o));w.push(i.replace(_,x))}})),w}(o,i.slice(0,-1),{getBaseUrlForNodePath:o=>u.getContext([...i,s,...o]).baseDoc,specmap:u});j.push(..._)})),C.example&&j.push(u.remove([].concat(w,\"example\"))),j.push(u.mergeDeep(w,C)),C.$$ref||j.push(u.remove([].concat(w,\"$$ref\"))),j}},Lu={key:\"parameters\",plugin:(o,s,i,u)=>{if(Array.isArray(o)&&o.length){const s=Object.assign([],o),_=i.slice(0,-1),w={...Na.getIn(u.spec,_)};for(let _=0;_<o.length;_+=1){const x=o[_];try{s[_].default=u.parameterMacro(w,x)}catch(o){const s=new Error(o);return s.fullPath=i,s}}return Na.replace(i,s)}return Na.replace(i,o)}},Bu={key:\"properties\",plugin:(o,s,i,u)=>{const _={...o};for(const s in o)try{_[s].default=u.modelPropertyMacro(_[s])}catch(o){const s=new Error(o);return s.fullPath=i,s}return Na.replace(i,_)}};class ContextTree{constructor(o){this.root=context_tree_createNode(o||{})}set(o,s){const i=this.getParent(o,!0);if(!i)return void context_tree_updateNode(this.root,s,null);const u=o[o.length-1],{children:_}=i;_[u]?context_tree_updateNode(_[u],s,i):_[u]=context_tree_createNode(s,i)}get(o){if((o=o||[]).length<1)return this.root.value;let s,i,u=this.root;for(let _=0;_<o.length&&(i=o[_],s=u.children,s[i]);_+=1)u=s[i];return u&&u.protoValue}getParent(o,s){return!o||o.length<1?null:o.length<2?this.root:o.slice(0,-1).reduce(((o,i)=>{if(!o)return o;const{children:u}=o;return!u[i]&&s&&(u[i]=context_tree_createNode(null,o)),u[i]}),this.root)}}function context_tree_createNode(o,s){return context_tree_updateNode({children:{}},o,s)}function context_tree_updateNode(o,s,i){return o.value=s||{},o.protoValue=i?{...i.protoValue,...o.value}:o.value,Object.keys(o.children).forEach((s=>{const i=o.children[s];o.children[s]=context_tree_updateNode(i,i.value,o)})),o}const specmap_noop=()=>{};class SpecMap{static getPluginName(o){return o.pluginName}static getPatchesOfType(o,s){return o.filter(s)}constructor(o){Object.assign(this,{spec:\"\",debugLevel:\"info\",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new ContextTree,showDebug:!1,allPatches:[],pluginProp:\"specMap\",libMethods:Object.assign(Object.create(this),Na,{getInstance:()=>this}),allowMetaPatches:!1},o),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(Na.isFunction),this.patches.push(Na.add([],this.spec)),this.patches.push(Na.context([],this.context)),this.updatePatches(this.patches)}debug(o,...s){this.debugLevel===o&&console.log(...s)}verbose(o,...s){\"verbose\"===this.debugLevel&&console.log(`[${o}]   `,...s)}wrapPlugin(o,s){const{pathDiscriminator:i}=this;let u,_=null;return o[this.pluginProp]?(_=o,u=o[this.pluginProp]):Na.isFunction(o)?u=o:Na.isObject(o)&&(u=function createKeyBasedPlugin(o){const isSubPath=(o,s)=>!Array.isArray(o)||o.every(((o,i)=>o===s[i]));return function*generator(s,u){const _={};for(const[o,i]of s.filter(Na.isAdditiveMutation).entries()){if(!(o<3e3))return;yield*traverse(i.value,i.path,i)}function*traverse(s,w,x){if(Na.isObject(s)){const C=w.length-1,j=w[C],L=w.indexOf(\"properties\"),B=\"properties\"===j&&C===L,$=u.allowMetaPatches&&_[s.$$ref];for(const C of Object.keys(s)){const j=s[C],L=w.concat(C),V=Na.isObject(j),U=s.$$ref;if($||V&&(u.allowMetaPatches&&U&&(_[U]=!0),yield*traverse(j,L,x)),!B&&C===o.key){const s=isSubPath(i,w);i&&!s||(yield o.plugin(j,C,L,u,x))}}}else o.key===w[w.length-1]&&(yield o.plugin(s,o.key,w,u))}}}(o)),Object.assign(u.bind(_),{pluginName:o.name||s,isGenerator:Na.isGenerator(u)})}nextPlugin(){return this.wrappedPlugins.find((o=>this.getMutationsForPlugin(o).length>0))}nextPromisedPatch(){if(this.promisedPatches.length>0)return Promise.race(this.promisedPatches.map((o=>o.value)))}getPluginHistory(o){const s=this.constructor.getPluginName(o);return this.pluginHistory[s]||[]}getPluginRunCount(o){return this.getPluginHistory(o).length}getPluginHistoryTip(o){const s=this.getPluginHistory(o);return s&&s[s.length-1]||{}}getPluginMutationIndex(o){const s=this.getPluginHistoryTip(o).mutationIndex;return\"number\"!=typeof s?-1:s}updatePluginHistory(o,s){const i=this.constructor.getPluginName(o);this.pluginHistory[i]=this.pluginHistory[i]||[],this.pluginHistory[i].push(s)}updatePatches(o){Na.normalizeArray(o).forEach((o=>{if(o instanceof Error)this.errors.push(o);else try{if(!Na.isObject(o))return void this.debug(\"updatePatches\",\"Got a non-object patch\",o);if(this.showDebug&&this.allPatches.push(o),Na.isPromise(o.value))return this.promisedPatches.push(o),void this.promisedPatchThen(o);if(Na.isContextPatch(o))return void this.setContext(o.path,o.value);Na.isMutation(o)&&this.updateMutations(o)}catch(o){console.error(o),this.errors.push(o)}}))}updateMutations(o){\"object\"==typeof o.value&&!Array.isArray(o.value)&&this.allowMetaPatches&&(o.value={...o.value});const s=Na.applyPatch(this.state,o,{allowMetaPatches:this.allowMetaPatches});s&&(this.mutations.push(o),this.state=s)}removePromisedPatch(o){const s=this.promisedPatches.indexOf(o);s<0?this.debug(\"Tried to remove a promisedPatch that isn't there!\"):this.promisedPatches.splice(s,1)}promisedPatchThen(o){return o.value=o.value.then((s=>{const i={...o,value:s};this.removePromisedPatch(o),this.updatePatches(i)})).catch((s=>{this.removePromisedPatch(o),this.updatePatches(s)})),o.value}getMutations(o,s){return o=o||0,\"number\"!=typeof s&&(s=this.mutations.length),this.mutations.slice(o,s)}getCurrentMutations(){return this.getMutationsForPlugin(this.getCurrentPlugin())}getMutationsForPlugin(o){const s=this.getPluginMutationIndex(o);return this.getMutations(s+1)}getCurrentPlugin(){return this.currentPlugin}getLib(){return this.libMethods}_get(o){return Na.getIn(this.state,o)}_getContext(o){return this.contextTree.get(o)}setContext(o,s){return this.contextTree.set(o,s)}_hasRun(o){return this.getPluginRunCount(this.getCurrentPlugin())>(o||0)}dispatch(){const o=this,s=this.nextPlugin();if(!s){const o=this.nextPromisedPatch();if(o)return o.then((()=>this.dispatch())).catch((()=>this.dispatch()));const s={spec:this.state,errors:this.errors};return this.showDebug&&(s.patches=this.allPatches),Promise.resolve(s)}if(o.pluginCount=o.pluginCount||new WeakMap,o.pluginCount.set(s,(o.pluginCount.get(s)||0)+1),o.pluginCount[s]>100)return Promise.resolve({spec:o.state,errors:o.errors.concat(new Error(\"We've reached a hard limit of 100 plugin runs\"))});if(s!==this.currentPlugin&&this.promisedPatches.length){const o=this.promisedPatches.map((o=>o.value));return Promise.all(o.map((o=>o.then(specmap_noop,specmap_noop)))).then((()=>this.dispatch()))}return function executePlugin(){o.currentPlugin=s;const i=o.getCurrentMutations(),u=o.mutations.length-1;try{if(s.isGenerator)for(const u of s(i,o.getLib()))updatePatches(u);else{updatePatches(s(i,o.getLib()))}}catch(o){console.error(o),updatePatches([Object.assign(Object.create(o),{plugin:s})])}finally{o.updatePluginHistory(s,{mutationIndex:u})}return o.dispatch()}();function updatePatches(i){i&&(i=Na.fullyNormalizeArray(i),o.updatePatches(i,s))}}}const Fu={refs:Ru,allOf:Du,parameters:Lu,properties:Bu},replace_special_chars_with_underscore=o=>o.replace(/\\W/gi,\"_\");function opId(o,s,i=\"\",{v2OperationIdCompatibilityMode:u}={}){if(!o||\"object\"!=typeof o)return null;return(o.operationId||\"\").replace(/\\s/g,\"\").length?replace_special_chars_with_underscore(o.operationId):function idFromPathMethod(o,s,{v2OperationIdCompatibilityMode:i}={}){if(i){let i=`${s.toLowerCase()}_${o}`.replace(/[\\s!@#$%^&*()_+=[{\\]};:<>|./?,\\\\'\"\"-]/g,\"_\");return i=i||`${o.substring(1)}_${s}`,i.replace(/((_){2,})/g,\"_\").replace(/^(_)*/g,\"\").replace(/([_])*$/g,\"\")}return`${s.toLowerCase()}${replace_special_chars_with_underscore(o)}`}(s,i,{v2OperationIdCompatibilityMode:u})}function normalize(o){const{spec:s}=o,{paths:i}=s,u={};if(!i||s.$$normalized)return o;for(const o in i){const _=i[o];if(null==_||![\"object\",\"function\"].includes(typeof _))continue;const w=_.parameters;for(const i in _){const x=_[i];if(null==x||![\"object\",\"function\"].includes(typeof x))continue;const C=opId(x,o,i);if(C){u[C]?u[C].push(x):u[C]=[x];const o=u[C];if(o.length>1)o.forEach(((o,s)=>{o.__originalOperationId=o.__originalOperationId||o.operationId,o.operationId=`${C}${s+1}`}));else if(void 0!==x.operationId){const s=o[0];s.__originalOperationId=s.__originalOperationId||x.operationId,s.operationId=C}}if(\"parameters\"!==i){const o=[],i={};for(const u in s)\"produces\"!==u&&\"consumes\"!==u&&\"security\"!==u||(i[u]=s[u],o.push(i));if(w&&(i.parameters=w,o.push(i)),o.length)for(const s of o)for(const o in s)if(x[o]){if(\"parameters\"===o)for(const i of s[o]){x[o].some((o=>o.name&&o.name===i.name||o.$ref&&o.$ref===i.$ref||o.$$ref&&o.$$ref===i.$$ref||o===i))||x[o].push(i)}}else x[o]=s[o]}}}return s.$$normalized=!0,o}function makeFetchJSON(o,s={}){const{requestInterceptor:i,responseInterceptor:u}=s,_=o.withCredentials?\"include\":\"same-origin\";return s=>o({url:s,loadSpec:!0,requestInterceptor:i,responseInterceptor:u,headers:{Accept:wu},credentials:_}).then((o=>o.body))}var qu=__webpack_require__(55373),$u=__webpack_require__.n(qu);function isFile(o,s){return s||\"undefined\"==typeof navigator||(s=navigator),s&&\"ReactNative\"===s.product?!(!o||\"object\"!=typeof o||\"string\"!=typeof o.uri):\"undefined\"!=typeof File&&o instanceof File||(\"undefined\"!=typeof Blob&&o instanceof Blob||(!!ArrayBuffer.isView(o)||null!==o&&\"object\"==typeof o&&\"function\"==typeof o.pipe))}function isArrayOfFile(o,s){return Array.isArray(o)&&o.some((o=>isFile(o,s)))}class FileWithData extends File{constructor(o,s=\"\",i={}){super([o],s,i),this.data=o}valueOf(){return this.data}toString(){return this.valueOf()}}const isRfc3986Reserved=o=>\":/?#[]@!$&'()*+,;=\".indexOf(o)>-1,isRfc3986Unreserved=o=>/^[a-z0-9\\-._~]+$/i.test(o);function encodeCharacters(o,s=\"reserved\"){return[...o].map((o=>{if(isRfc3986Unreserved(o))return o;if(isRfc3986Reserved(o)&&\"unsafe\"===s)return o;const i=new TextEncoder;return Array.from(i.encode(o)).map((o=>`0${o.toString(16).toUpperCase()}`.slice(-2))).map((o=>`%${o}`)).join(\"\")})).join(\"\")}function stylize(o){const{value:s}=o;return Array.isArray(s)?function encodeArray({key:o,value:s,style:i,explode:u,escape:_}){if(\"simple\"===i)return s.map((o=>valueEncoder(o,_))).join(\",\");if(\"label\"===i)return`.${s.map((o=>valueEncoder(o,_))).join(\".\")}`;if(\"matrix\"===i)return s.map((o=>valueEncoder(o,_))).reduce(((s,i)=>!s||u?`${s||\"\"};${o}=${i}`:`${s},${i}`),\"\");if(\"form\"===i){const i=u?`&${o}=`:\",\";return s.map((o=>valueEncoder(o,_))).join(i)}if(\"spaceDelimited\"===i){const i=u?`${o}=`:\"\";return s.map((o=>valueEncoder(o,_))).join(` ${i}`)}if(\"pipeDelimited\"===i){const i=u?`${o}=`:\"\";return s.map((o=>valueEncoder(o,_))).join(`|${i}`)}return}(o):\"object\"==typeof s?function encodeObject({key:o,value:s,style:i,explode:u,escape:_}){const w=Object.keys(s);if(\"simple\"===i)return w.reduce(((o,i)=>{const w=valueEncoder(s[i],_);return`${o?`${o},`:\"\"}${i}${u?\"=\":\",\"}${w}`}),\"\");if(\"label\"===i)return w.reduce(((o,i)=>{const w=valueEncoder(s[i],_);return`${o?`${o}.`:\".\"}${i}${u?\"=\":\".\"}${w}`}),\"\");if(\"matrix\"===i&&u)return w.reduce(((o,i)=>`${o?`${o};`:\";\"}${i}=${valueEncoder(s[i],_)}`),\"\");if(\"matrix\"===i)return w.reduce(((i,u)=>{const w=valueEncoder(s[u],_);return`${i?`${i},`:`;${o}=`}${u},${w}`}),\"\");if(\"form\"===i)return w.reduce(((o,i)=>{const w=valueEncoder(s[i],_);return`${o?`${o}${u?\"&\":\",\"}`:\"\"}${i}${u?\"=\":\",\"}${w}`}),\"\");return}(o):function encodePrimitive({key:o,value:s,style:i,escape:u}){if(\"simple\"===i)return valueEncoder(s,u);if(\"label\"===i)return`.${valueEncoder(s,u)}`;if(\"matrix\"===i)return`;${o}=${valueEncoder(s,u)}`;if(\"form\"===i)return valueEncoder(s,u);if(\"deepObject\"===i)return valueEncoder(s,u);return}(o)}function valueEncoder(o,s=!1){return Array.isArray(o)||null!==o&&\"object\"==typeof o?o=JSON.stringify(o):\"number\"!=typeof o&&\"boolean\"!=typeof o||(o=String(o)),s&&o.length>0?encodeCharacters(o,s):o}const Vu={form:\",\",spaceDelimited:\"%20\",pipeDelimited:\"|\"},Uu={csv:\",\",ssv:\"%20\",tsv:\"%09\",pipes:\"|\"};function formatKeyValue(o,s,i=!1){const{collectionFormat:u,allowEmptyValue:_,serializationOption:w,encoding:x}=s,C=\"object\"!=typeof s||Array.isArray(s)?s:s.value,j=i?o=>o.toString():o=>encodeURIComponent(o),L=j(o);if(void 0===C&&_)return[[L,\"\"]];if(isFile(C)||isArrayOfFile(C))return[[L,C]];if(w)return formatKeyValueBySerializationOption(o,C,i,w);if(x){if([typeof x.style,typeof x.explode,typeof x.allowReserved].some((o=>\"undefined\"!==o))){const{style:s,explode:u,allowReserved:_}=x;return formatKeyValueBySerializationOption(o,C,i,{style:s,explode:u,allowReserved:_})}if(\"string\"==typeof x.contentType){if(x.contentType.startsWith(\"application/json\")){const o=j(\"string\"==typeof C?C:JSON.stringify(C));return[[L,new FileWithData(o,\"blob\",{type:x.contentType})]]}const o=j(String(C));return[[L,new FileWithData(o,\"blob\",{type:x.contentType})]]}return\"object\"!=typeof C?[[L,j(C)]]:Array.isArray(C)&&C.every((o=>\"object\"!=typeof o))?[[L,C.map(j).join(\",\")]]:[[L,j(JSON.stringify(C))]]}return\"object\"!=typeof C?[[L,j(C)]]:Array.isArray(C)?\"multi\"===u?[[L,C.map(j)]]:[[L,C.map(j).join(Uu[u||\"csv\"])]]:[[L,\"\"]]}function formatKeyValueBySerializationOption(o,s,i,u){const _=u.style||\"form\",w=void 0===u.explode?\"form\"===_:u.explode,x=!i&&(u&&u.allowReserved?\"unsafe\":\"reserved\"),encodeFn=o=>valueEncoder(o,x),C=i?o=>o:o=>encodeFn(o);return\"object\"!=typeof s?[[C(o),encodeFn(s)]]:Array.isArray(s)?w?[[C(o),s.map(encodeFn)]]:[[C(o),s.map(encodeFn).join(Vu[_])]]:\"deepObject\"===_?Object.keys(s).map((i=>[C(`${o}[${i}]`),encodeFn(s[i])])):w?Object.keys(s).map((o=>[C(o),encodeFn(s[o])])):[[C(o),Object.keys(s).map((o=>[`${C(o)},${encodeFn(s[o])}`])).join(\",\")]]}function encodeFormOrQuery(o){const s=Object.keys(o).reduce(((s,i)=>{for(const[u,_]of formatKeyValue(i,o[i]))s[u]=_ instanceof FileWithData?_.valueOf():_;return s}),{});return $u().stringify(s,{encode:!1,indices:!1})||\"\"}function serializeRequest(o={}){const{url:s=\"\",query:i,form:u}=o;if(u){const s=Object.keys(u).some((o=>{const{value:s}=u[o];return isFile(s)||isArrayOfFile(s)})),i=o.headers[\"content-type\"]||o.headers[\"Content-Type\"];if(s||/multipart\\/form-data/i.test(i)){const s=function request_buildFormData(o){return Object.entries(o).reduce(((o,[s,i])=>{for(const[u,_]of formatKeyValue(s,i,!0))if(Array.isArray(_))for(const s of _)if(ArrayBuffer.isView(s)){const i=new Blob([s]);o.append(u,i)}else o.append(u,s);else if(ArrayBuffer.isView(_)){const s=new Blob([_]);o.append(u,s)}else o.append(u,_);return o}),new FormData)}(o.form);o.formdata=s,o.body=s}else o.body=encodeFormOrQuery(u);delete o.form}if(i){const[u,_]=s.split(\"?\");let w=\"\";if(_){const o=$u().parse(_);Object.keys(i).forEach((s=>delete o[s])),w=$u().stringify(o,{encode:!0})}const x=((...o)=>{const s=o.filter((o=>o)).join(\"&\");return s?`?${s}`:\"\"})(w,encodeFormOrQuery(i));o.url=u+x,delete o.query}return o}const shouldDownloadAsText=(o=\"\")=>/(json|xml|yaml|text)\\b/.test(o);function serializeHeaders(o={}){return\"function\"!=typeof o.entries?{}:Array.from(o.entries()).reduce(((o,[s,i])=>(o[s]=function serializeHeaderValue(o){return o.includes(\", \")?o.split(\", \"):o}(i),o)),{})}function serializeResponse(o,s,{loadSpec:i=!1}={}){const u={ok:o.ok,url:o.url||s,status:o.status,statusText:o.statusText,headers:serializeHeaders(o.headers)},_=u.headers[\"content-type\"],w=i||shouldDownloadAsText(_);return(w?o.text:o.blob||o.buffer).call(o).then((o=>{if(u.text=o,u.data=o,w)try{const s=function parseBody(o,s){return s&&(0===s.indexOf(\"application/json\")||s.indexOf(\"+json\")>0)?JSON.parse(o):to.load(o)}(o,_);u.body=s,u.obj=s}catch(o){u.parseError=o}return u}))}async function http_http(o,s={}){\"object\"==typeof o&&(o=(s=o).url),s.headers=s.headers||{},(s=serializeRequest(s)).headers&&Object.keys(s.headers).forEach((o=>{const i=s.headers[o];\"string\"==typeof i&&(s.headers[o]=i.replace(/\\n+/g,\" \"))})),s.requestInterceptor&&(s=await s.requestInterceptor(s)||s);const i=s.headers[\"content-type\"]||s.headers[\"Content-Type\"];let u;/multipart\\/form-data/i.test(i)&&(delete s.headers[\"content-type\"],delete s.headers[\"Content-Type\"]);try{u=await(s.userFetch||fetch)(s.url,s),u=await serializeResponse(u,o,s),s.responseInterceptor&&(u=await s.responseInterceptor(u)||u)}catch(o){if(!u)throw o;const s=new Error(u.statusText||`response status is ${u.status}`);throw s.status=u.status,s.statusCode=u.status,s.responseError=o,s}if(!u.ok){const o=new Error(u.statusText||`response status is ${u.status}`);throw o.status=u.status,o.statusCode=u.status,o.response=u,o}return u}const options_retrievalURI=o=>{var s,i;const{baseDoc:u,url:_}=o,w=null!==(s=null!=u?u:_)&&void 0!==s?s:\"\";return\"string\"==typeof(null===(i=globalThis.document)||void 0===i?void 0:i.baseURI)?String(new URL(w,globalThis.document.baseURI)):w},options_httpClient=o=>{const{fetch:s,http:i}=o;return s||i||http_http};async function resolveGenericStrategy(o){const{spec:s,mode:i,allowMetaPatches:u=!0,pathDiscriminator:_,modelPropertyMacro:w,parameterMacro:x,requestInterceptor:C,responseInterceptor:j,skipNormalization:L,useCircularStructures:B}=o,$=options_retrievalURI(o),V=options_httpClient(o);return function doResolve(o){$&&(Fu.refs.docCache[$]=o);Fu.refs.fetchJSON=makeFetchJSON(V,{requestInterceptor:C,responseInterceptor:j});const s=[Fu.refs];\"function\"==typeof x&&s.push(Fu.parameters);\"function\"==typeof w&&s.push(Fu.properties);\"strict\"!==i&&s.push(Fu.allOf);return function mapSpec(o){return new SpecMap(o).dispatch()}({spec:o,context:{baseDoc:$},plugins:s,allowMetaPatches:u,pathDiscriminator:_,parameterMacro:x,modelPropertyMacro:w,useCircularStructures:B}).then(L?async o=>o:normalize)}(s)}const zu={name:\"generic\",match:()=>!0,normalize({spec:o}){const{spec:s}=normalize({spec:o});return s},resolve:async o=>resolveGenericStrategy(o)},Wu=zu;const isOpenAPI30=o=>{try{const{openapi:s}=o;return\"string\"==typeof s&&/^3\\.0\\.([0123])(?:-rc[012])?$/.test(s)}catch{return!1}},isOpenAPI31=o=>{try{const{openapi:s}=o;return\"string\"==typeof s&&/^3\\.1\\.(?:[1-9]\\d*|0)$/.test(s)}catch{return!1}},isOpenAPI3=o=>isOpenAPI30(o)||isOpenAPI31(o),Ku={name:\"openapi-2\",match:({spec:o})=>(o=>{try{const{swagger:s}=o;return\"2.0\"===s}catch{return!1}})(o),normalize({spec:o}){const{spec:s}=normalize({spec:o});return s},resolve:async o=>async function resolveOpenAPI2Strategy(o){return resolveGenericStrategy(o)}(o)},Hu=Ku;const Ju={name:\"openapi-3-0\",match:({spec:o})=>isOpenAPI30(o),normalize({spec:o}){const{spec:s}=normalize({spec:o});return s},resolve:async o=>async function resolveOpenAPI30Strategy(o){return resolveGenericStrategy(o)}(o)},Gu=Ju;const es_T=function(){return!0};const es_F=function(){return!1},getVisitFn=(o,s,i)=>{const u=o[s];if(null!=u){if(!i&&\"function\"==typeof u)return u;const o=i?u.leave:u.enter;if(\"function\"==typeof o)return o}else{const u=i?o.leave:o.enter;if(null!=u){if(\"function\"==typeof u)return u;const o=u[s];if(\"function\"==typeof o)return o}}return null},Yu={},getNodeType=o=>null==o?void 0:o.type,isNode=o=>\"string\"==typeof getNodeType(o),cloneNode=o=>Object.create(Object.getPrototypeOf(o),Object.getOwnPropertyDescriptors(o)),mergeAll=(o,{visitFnGetter:s=getVisitFn,nodeTypeGetter:i=getNodeType,breakSymbol:u=Yu,deleteNodeSymbol:_=null,skipVisitingNodeSymbol:w=!1,exposeEdits:x=!1}={})=>{const C=Symbol(\"skip\"),j=new Array(o.length).fill(C);return{enter(L,B,$,V,U,z){let Y=L,Z=!1;const ee={...z,replaceWith(o,s){z.replaceWith(o,s),Y=o}};for(let L=0;L<o.length;L+=1)if(j[L]===C){const C=s(o[L],i(Y),!1);if(\"function\"==typeof C){const s=C.call(o[L],Y,B,$,V,U,ee);if(\"function\"==typeof(null==s?void 0:s.then))throw new Fa(\"Async visitor not supported in sync mode\",{visitor:o[L],visitFn:C});if(s===w)j[L]=Y;else if(s===u)j[L]=u;else{if(s===_)return s;if(void 0!==s){if(!x)return s;Y=s,Z=!0}}}}return Z?Y:void 0},leave(_,x,L,B,$,V){let U=_;const z={...V,replaceWith(o,s){V.replaceWith(o,s),U=o}};for(let _=0;_<o.length;_+=1)if(j[_]===C){const C=s(o[_],i(U),!0);if(\"function\"==typeof C){const s=C.call(o[_],U,x,L,B,$,z);if(\"function\"==typeof(null==s?void 0:s.then))throw new Fa(\"Async visitor not supported in sync mode\",{visitor:o[_],visitFn:C});if(s===u)j[_]=u;else if(void 0!==s&&s!==w)return s}}else j[_]===U&&(j[_]=C)}}};mergeAll[Symbol.for(\"nodejs.util.promisify.custom\")]=(o,{visitFnGetter:s=getVisitFn,nodeTypeGetter:i=getNodeType,breakSymbol:u=Yu,deleteNodeSymbol:_=null,skipVisitingNodeSymbol:w=!1,exposeEdits:x=!1}={})=>{const C=Symbol(\"skip\"),j=new Array(o.length).fill(C);return{async enter(L,B,$,V,U,z){let Y=L,Z=!1;const ee={...z,replaceWith(o,s){z.replaceWith(o,s),Y=o}};for(let L=0;L<o.length;L+=1)if(j[L]===C){const C=s(o[L],i(Y),!1);if(\"function\"==typeof C){const s=await C.call(o[L],Y,B,$,V,U,ee);if(s===w)j[L]=Y;else if(s===u)j[L]=u;else{if(s===_)return s;if(void 0!==s){if(!x)return s;Y=s,Z=!0}}}}return Z?Y:void 0},async leave(_,x,L,B,$,V){let U=_;const z={...V,replaceWith(o,s){V.replaceWith(o,s),U=o}};for(let _=0;_<o.length;_+=1)if(j[_]===C){const C=s(o[_],i(U),!0);if(\"function\"==typeof C){const s=await C.call(o[_],U,x,L,B,$,z);if(s===u)j[_]=u;else if(void 0!==s&&s!==w)return s}}else j[_]===U&&(j[_]=C)}}};const visit=(o,s,{keyMap:i=null,state:u={},breakSymbol:_=Yu,deleteNodeSymbol:w=null,skipVisitingNodeSymbol:x=!1,visitFnGetter:C=getVisitFn,nodeTypeGetter:j=getNodeType,nodePredicate:L=isNode,nodeCloneFn:B=cloneNode,detectCycles:$=!0}={})=>{const V=i||{};let U,z,Y=Array.isArray(o),Z=[o],ee=-1,ie=[],ae=o;const ce=[],le=[];do{ee+=1;const o=ee===Z.length;let i;const fe=o&&0!==ie.length;if(o){if(i=0===le.length?void 0:ce.pop(),ae=z,z=le.pop(),fe)if(Y){ae=ae.slice();let o=0;for(const[s,i]of ie){const u=s-o;i===w?(ae.splice(u,1),o+=1):ae[u]=i}}else{ae=B(ae);for(const[o,s]of ie)ae[o]=s}ee=U.index,Z=U.keys,ie=U.edits,Y=U.inArray,U=U.prev}else if(z!==w&&void 0!==z){if(i=Y?ee:Z[ee],ae=z[i],ae===w||void 0===ae)continue;ce.push(i)}let ye;if(!Array.isArray(ae)){var pe;if(!L(ae))throw new Fa(`Invalid AST Node:  ${String(ae)}`,{node:ae});if($&&le.includes(ae)){ce.pop();continue}const w=C(s,j(ae),o);if(w){for(const[o,i]of Object.entries(u))s[o]=i;const _={replaceWith(s,u){\"function\"==typeof u?u(s,ae,i,z,ce,le):z&&(z[i]=s),o||(ae=s)}};ye=w.call(s,ae,i,z,ce,le,_)}if(\"function\"==typeof(null===(pe=ye)||void 0===pe?void 0:pe.then))throw new Fa(\"Async visitor not supported in sync mode\",{visitor:s,visitFn:w});if(ye===_)break;if(ye===x){if(!o){ce.pop();continue}}else if(void 0!==ye&&(ie.push([i,ye]),!o)){if(!L(ye)){ce.pop();continue}ae=ye}}var de;if(void 0===ye&&fe&&ie.push([i,ae]),!o)U={inArray:Y,index:ee,keys:Z,edits:ie,prev:U},Y=Array.isArray(ae),Z=Y?ae:null!==(de=V[j(ae)])&&void 0!==de?de:[],ee=-1,ie=[],z!==w&&void 0!==z&&le.push(z),z=ae}while(void 0!==U);return 0!==ie.length?ie[ie.length-1][1]:o};visit[Symbol.for(\"nodejs.util.promisify.custom\")]=async(o,s,{keyMap:i=null,state:u={},breakSymbol:_=Yu,deleteNodeSymbol:w=null,skipVisitingNodeSymbol:x=!1,visitFnGetter:C=getVisitFn,nodeTypeGetter:j=getNodeType,nodePredicate:L=isNode,nodeCloneFn:B=cloneNode,detectCycles:$=!0}={})=>{const V=i||{};let U,z,Y=Array.isArray(o),Z=[o],ee=-1,ie=[],ae=o;const ce=[],le=[];do{ee+=1;const o=ee===Z.length;let i;const de=o&&0!==ie.length;if(o){if(i=0===le.length?void 0:ce.pop(),ae=z,z=le.pop(),de)if(Y){ae=ae.slice();let o=0;for(const[s,i]of ie){const u=s-o;i===w?(ae.splice(u,1),o+=1):ae[u]=i}}else{ae=B(ae);for(const[o,s]of ie)ae[o]=s}ee=U.index,Z=U.keys,ie=U.edits,Y=U.inArray,U=U.prev}else if(z!==w&&void 0!==z){if(i=Y?ee:Z[ee],ae=z[i],ae===w||void 0===ae)continue;ce.push(i)}let fe;if(!Array.isArray(ae)){if(!L(ae))throw new Fa(`Invalid AST Node: ${String(ae)}`,{node:ae});if($&&le.includes(ae)){ce.pop();continue}const w=C(s,j(ae),o);if(w){for(const[o,i]of Object.entries(u))s[o]=i;const _={replaceWith(s,u){\"function\"==typeof u?u(s,ae,i,z,ce,le):z&&(z[i]=s),o||(ae=s)}};fe=await w.call(s,ae,i,z,ce,le,_)}if(fe===_)break;if(fe===x){if(!o){ce.pop();continue}}else if(void 0!==fe&&(ie.push([i,fe]),!o)){if(!L(fe)){ce.pop();continue}ae=fe}}var pe;if(void 0===fe&&de&&ie.push([i,ae]),!o)U={inArray:Y,index:ee,keys:Z,edits:ie,prev:U},Y=Array.isArray(ae),Z=Y?ae:null!==(pe=V[j(ae)])&&void 0!==pe?pe:[],ee=-1,ie=[],z!==w&&void 0!==z&&le.push(z),z=ae}while(void 0!==U);return 0!==ie.length?ie[ie.length-1][1]:o};var Xu=__webpack_require__(34035);function _reduced(o){return o&&o[\"@@transducer/reduced\"]?o:{\"@@transducer/value\":o,\"@@transducer/reduced\":!0}}var Qu=function(){function XAll(o,s){this.xf=s,this.f=o,this.all=!0}return XAll.prototype[\"@@transducer/init\"]=_xfBase_init,XAll.prototype[\"@@transducer/result\"]=function(o){return this.all&&(o=this.xf[\"@@transducer/step\"](o,!0)),this.xf[\"@@transducer/result\"](o)},XAll.prototype[\"@@transducer/step\"]=function(o,s){return this.f(s)||(this.all=!1,o=_reduced(this.xf[\"@@transducer/step\"](o,!1))),o},XAll}();function _xall(o){return function(s){return new Qu(o,s)}}var Zu=_curry2(_dispatchable([\"all\"],_xall,(function all(o,s){for(var i=0;i<s.length;){if(!o(s[i]))return!1;i+=1}return!0})));const ep=Zu;class Annotation extends Xu.Om{constructor(o,s,i){super(o,s,i),this.element=\"annotation\"}get code(){return this.attributes.get(\"code\")}set code(o){this.attributes.set(\"code\",o)}}const tp=Annotation;class Comment extends Xu.Om{constructor(o,s,i){super(o,s,i),this.element=\"comment\"}}const rp=Comment;class ParseResult extends Xu.wE{constructor(o,s,i){super(o,s,i),this.element=\"parseResult\"}get api(){return this.children.filter((o=>o.classes.contains(\"api\"))).first}get results(){return this.children.filter((o=>o.classes.contains(\"result\")))}get result(){return this.results.first}get annotations(){return this.children.filter((o=>\"annotation\"===o.element))}get warnings(){return this.children.filter((o=>\"annotation\"===o.element&&o.classes.contains(\"warning\")))}get errors(){return this.children.filter((o=>\"annotation\"===o.element&&o.classes.contains(\"error\")))}get isEmpty(){return this.children.reject((o=>\"annotation\"===o.element)).isEmpty}replaceResult(o){const{result:s}=this;if(Wl(s))return!1;const i=this.content.findIndex((o=>o===s));return-1!==i&&(this.content[i]=o,!0)}}const np=ParseResult;class SourceMap extends Xu.wE{constructor(o,s,i){super(o,s,i),this.element=\"sourceMap\"}get positionStart(){return this.children.filter((o=>o.classes.contains(\"position\"))).get(0)}get positionEnd(){return this.children.filter((o=>o.classes.contains(\"position\"))).get(1)}set position(o){if(void 0===o)return;const s=new Xu.wE([o.start.row,o.start.column,o.start.char]),i=new Xu.wE([o.end.row,o.end.column,o.end.char]);s.classes.push(\"position\"),i.classes.push(\"position\"),this.push(s).push(i)}}const op=SourceMap,hasMethod=(o,s)=>\"object\"==typeof s&&null!==s&&o in s&&\"function\"==typeof s[o],hasBasicElementProps=o=>\"object\"==typeof o&&null!=o&&\"_storedElement\"in o&&\"string\"==typeof o._storedElement&&\"_content\"in o,primitiveEq=(o,s)=>\"object\"==typeof s&&null!==s&&\"primitive\"in s&&(\"function\"==typeof s.primitive&&s.primitive()===o),hasClass=(o,s)=>\"object\"==typeof s&&null!==s&&\"classes\"in s&&(Array.isArray(s.classes)||s.classes instanceof Xu.wE)&&s.classes.includes(o),isElementType=(o,s)=>\"object\"==typeof s&&null!==s&&\"element\"in s&&s.element===o,helpers=o=>o({hasMethod,hasBasicElementProps,primitiveEq,isElementType,hasClass}),sp=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.Hg||o(i)&&s(void 0,i))),ip=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.Om||o(i)&&s(\"string\",i))),cp=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.kT||o(i)&&s(\"number\",i))),lp=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.Os||o(i)&&s(\"null\",i))),up=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.bd||o(i)&&s(\"boolean\",i))),pp=helpers((({hasBasicElementProps:o,primitiveEq:s,hasMethod:i})=>u=>u instanceof Xu.Sh||o(u)&&s(\"object\",u)&&i(\"keys\",u)&&i(\"values\",u)&&i(\"items\",u))),hp=helpers((({hasBasicElementProps:o,primitiveEq:s,hasMethod:i})=>u=>u instanceof Xu.wE&&!(u instanceof Xu.Sh)||o(u)&&s(\"array\",u)&&i(\"push\",u)&&i(\"unshift\",u)&&i(\"map\",u)&&i(\"reduce\",u))),dp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Xu.Pr||o(u)&&s(\"member\",u)&&i(void 0,u))),fp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Xu.Ft||o(u)&&s(\"link\",u)&&i(void 0,u))),mp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Xu.sI||o(u)&&s(\"ref\",u)&&i(void 0,u))),gp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof tp||o(u)&&s(\"annotation\",u)&&i(\"array\",u))),yp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof rp||o(u)&&s(\"comment\",u)&&i(\"string\",u))),vp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof np||o(u)&&s(\"parseResult\",u)&&i(\"array\",u))),bp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof op||o(u)&&s(\"sourceMap\",u)&&i(\"array\",u))),isPrimitiveElement=o=>isElementType(\"object\",o)||isElementType(\"array\",o)||isElementType(\"boolean\",o)||isElementType(\"number\",o)||isElementType(\"string\",o)||isElementType(\"null\",o)||isElementType(\"member\",o),hasElementSourceMap=o=>bp(o.meta.get(\"sourceMap\")),includesSymbols=(o,s)=>{if(0===o.length)return!0;const i=s.attributes.get(\"symbols\");return!!hp(i)&&ep(Pl(i.toValue()),o)},includesClasses=(o,s)=>0===o.length||ep(Pl(s.classes.toValue()),o);const _p=class CloneError extends Fa{value;constructor(o,s){super(o,s),void 0!==s&&(this.value=s.value)}};const Ep=class DeepCloneError extends _p{};const wp=class ShallowCloneError extends _p{},cloneDeep=(o,s={})=>{const{visited:i=new WeakMap}=s,u={...s,visited:i};if(i.has(o))return i.get(o);if(o instanceof Xu.KeyValuePair){const{key:s,value:_}=o,w=sp(s)?cloneDeep(s,u):s,x=sp(_)?cloneDeep(_,u):_,C=new Xu.KeyValuePair(w,x);return i.set(o,C),C}if(o instanceof Xu.ot){const mapper=o=>cloneDeep(o,u),s=[...o].map(mapper),_=new Xu.ot(s);return i.set(o,_),_}if(o instanceof Xu.G6){const mapper=o=>cloneDeep(o,u),s=[...o].map(mapper),_=new Xu.G6(s);return i.set(o,_),_}if(sp(o)){const s=cloneShallow(o);if(i.set(o,s),o.content)if(sp(o.content))s.content=cloneDeep(o.content,u);else if(o.content instanceof Xu.KeyValuePair)s.content=cloneDeep(o.content,u);else if(Array.isArray(o.content)){const mapper=o=>cloneDeep(o,u);s.content=o.content.map(mapper)}else s.content=o.content;else s.content=o.content;return s}throw new Ep(\"Value provided to cloneDeep function couldn't be cloned\",{value:o})};cloneDeep.safe=o=>{try{return cloneDeep(o)}catch{return o}};const cloneShallowKeyValuePair=o=>{const{key:s,value:i}=o;return new Xu.KeyValuePair(s,i)},cloneShallowElement=o=>{const s=new o.constructor;if(s.element=o.element,o.meta.length>0&&(s._meta=cloneDeep(o.meta)),o.attributes.length>0&&(s._attributes=cloneDeep(o.attributes)),sp(o.content)){const i=o.content;s.content=cloneShallowElement(i)}else Array.isArray(o.content)?s.content=[...o.content]:o.content instanceof Xu.KeyValuePair?s.content=cloneShallowKeyValuePair(o.content):s.content=o.content;return s},cloneShallow=o=>{if(o instanceof Xu.KeyValuePair)return cloneShallowKeyValuePair(o);if(o instanceof Xu.ot)return(o=>{const s=[...o];return new Xu.ot(s)})(o);if(o instanceof Xu.G6)return(o=>{const s=[...o];return new Xu.G6(s)})(o);if(sp(o))return cloneShallowElement(o);throw new wp(\"Value provided to cloneShallow function couldn't be cloned\",{value:o})};cloneShallow.safe=o=>{try{return cloneShallow(o)}catch{return o}};const visitor_getNodeType=o=>pp(o)?\"ObjectElement\":hp(o)?\"ArrayElement\":dp(o)?\"MemberElement\":ip(o)?\"StringElement\":up(o)?\"BooleanElement\":cp(o)?\"NumberElement\":lp(o)?\"NullElement\":fp(o)?\"LinkElement\":mp(o)?\"RefElement\":void 0,visitor_cloneNode=o=>sp(o)?cloneShallow(o):cloneNode(o),Sp=pipe(visitor_getNodeType,su),xp={ObjectElement:[\"content\"],ArrayElement:[\"content\"],MemberElement:[\"key\",\"value\"],StringElement:[],BooleanElement:[],NumberElement:[],NullElement:[],RefElement:[],LinkElement:[],Annotation:[],Comment:[],ParseResultElement:[\"content\"],SourceMap:[\"content\"]};class PredicateVisitor{result;predicate;returnOnTrue;returnOnFalse;constructor({predicate:o=es_F,returnOnTrue:s,returnOnFalse:i}={}){this.result=[],this.predicate=o,this.returnOnTrue=s,this.returnOnFalse=i}enter(o){return this.predicate(o)?(this.result.push(o),this.returnOnTrue):this.returnOnFalse}}const visitor_visit=(o,s,{keyMap:i=xp,...u}={})=>visit(o,s,{keyMap:i,nodeTypeGetter:visitor_getNodeType,nodePredicate:Sp,nodeCloneFn:visitor_cloneNode,...u});visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")]=async(o,s,{keyMap:i=xp,...u}={})=>visit[Symbol.for(\"nodejs.util.promisify.custom\")](o,s,{keyMap:i,nodeTypeGetter:visitor_getNodeType,nodePredicate:Sp,nodeCloneFn:visitor_cloneNode,...u});const nodeTypeGetter=o=>\"string\"==typeof(null==o?void 0:o.type)?o.type:visitor_getNodeType(o),kp={EphemeralObject:[\"content\"],EphemeralArray:[\"content\"],...xp},value_visitor_visit=(o,s,{keyMap:i=kp,...u}={})=>visitor_visit(o,s,{keyMap:i,nodeTypeGetter,nodePredicate:es_T,detectCycles:!1,deleteNodeSymbol:Symbol.for(\"delete-node\"),skipVisitingNodeSymbol:Symbol.for(\"skip-visiting-node\"),...u});value_visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")]=async(o,{keyMap:s=kp,...i}={})=>visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")](o,visitor,{keyMap:s,nodeTypeGetter,nodePredicate:es_T,detectCycles:!1,deleteNodeSymbol:Symbol.for(\"delete-node\"),skipVisitingNodeSymbol:Symbol.for(\"skip-visiting-node\"),...i});const Op=class EphemeralArray{type=\"EphemeralArray\";content=[];reference=void 0;constructor(o){this.content=o,this.reference=[]}toReference(){return this.reference}toArray(){return this.reference.push(...this.content),this.reference}};const Cp=class EphemeralObject{type=\"EphemeralObject\";content=[];reference=void 0;constructor(o){this.content=o,this.reference={}}toReference(){return this.reference}toObject(){return Object.assign(this.reference,Object.fromEntries(this.content))}};class Visitor{ObjectElement={enter:o=>{if(this.references.has(o))return this.references.get(o).toReference();const s=new Cp(o.content);return this.references.set(o,s),s}};EphemeralObject={leave:o=>o.toObject()};MemberElement={enter:o=>[o.key,o.value]};ArrayElement={enter:o=>{if(this.references.has(o))return this.references.get(o).toReference();const s=new Op(o.content);return this.references.set(o,s),s}};EphemeralArray={leave:o=>o.toArray()};references=new WeakMap;BooleanElement(o){return o.toValue()}NumberElement(o){return o.toValue()}StringElement(o){return o.toValue()}NullElement(){return null}RefElement(o,...s){var i;const u=s[3];return\"EphemeralObject\"===(null===(i=u[u.length-1])||void 0===i?void 0:i.type)?Symbol.for(\"delete-node\"):String(o.toValue())}LinkElement(o){return ip(o.href)?o.href.toValue():\"\"}}const serializers_value=o=>sp(o)?ip(o)||cp(o)||up(o)||lp(o)?o.toValue():value_visitor_visit(o,new Visitor):o;var Ap=_curry3((function mergeWithKey(o,s,i){var u,_={};for(u in i=i||{},s=s||{})_has(u,s)&&(_[u]=_has(u,i)?o(u,s[u],i[u]):s[u]);for(u in i)_has(u,i)&&!_has(u,_)&&(_[u]=i[u]);return _}));const jp=Ap;var Pp=_curry3((function mergeDeepWithKey(o,s,i){return jp((function(s,i,u){return _isObject(i)&&_isObject(u)?mergeDeepWithKey(o,i,u):o(s,i,u)}),s,i)}));const Ip=Pp;const Mp=_curry2((function mergeDeepRight(o,s){return Ip((function(o,s,i){return i}),o,s)}));const Np=_curry2(_path);const Tp=Jc(0,-1);var Rp=_curry2((function apply(o,s){return o.apply(this,s)}));const Dp=Rp;const Lp=Vl(eu);const Bp=_curry2((function and(o,s){return o&&s}));const Fp=_curry2((function both(o,s){return _isFunction(o)?function _both(){return o.apply(this,arguments)&&s.apply(this,arguments)}:$l(Bp)(o,s)}));var qp=_curry1((function empty(o){return null!=o&&\"function\"==typeof o[\"fantasy-land/empty\"]?o[\"fantasy-land/empty\"]():null!=o&&null!=o.constructor&&\"function\"==typeof o.constructor[\"fantasy-land/empty\"]?o.constructor[\"fantasy-land/empty\"]():null!=o&&\"function\"==typeof o.empty?o.empty():null!=o&&null!=o.constructor&&\"function\"==typeof o.constructor.empty?o.constructor.empty():gc(o)?[]:_isString(o)?\"\":_isObject(o)?{}:rc(o)?function(){return arguments}():function _isTypedArray(o){var s=Object.prototype.toString.call(o);return\"[object Uint8ClampedArray]\"===s||\"[object Int8Array]\"===s||\"[object Uint8Array]\"===s||\"[object Int16Array]\"===s||\"[object Uint16Array]\"===s||\"[object Int32Array]\"===s||\"[object Uint32Array]\"===s||\"[object Float32Array]\"===s||\"[object Float64Array]\"===s||\"[object BigInt64Array]\"===s||\"[object BigUint64Array]\"===s}(o)?o.constructor.from(\"\"):void 0}));const $p=qp;const Vp=_curry1((function isEmpty(o){return null!=o&&hc(o,$p(o))}));const Up=_l(1,eu(Array.isArray)?Array.isArray:pipe(pc,Xl(\"Array\")));const zp=Fp(Up,Vp);var Wp=_l(3,(function(o,s,i){var u=Np(o,i),_=Np(Tp(o),i);if(!Lp(u)&&!zp(o)){var w=Rc(u,_);return Dp(w,s)}}));const Kp=Wp;const Hp=hc(null);const Jp=Vl(Hp);function isOfTypeObject_typeof(o){return isOfTypeObject_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},isOfTypeObject_typeof(o)}const Gp=function isOfTypeObject(o){return\"object\"===isOfTypeObject_typeof(o)};const Yp=_l(1,Fp(Jp,Gp));var Xp=pipe(pc,Xl(\"Object\")),Qp=pipe(Oc,hc(Oc(Object))),Zp=Ja(Fp(eu,Qp),[\"constructor\"]),th=_l(1,(function(o){if(!Yp(o)||!Xp(o))return!1;var s=Object.getPrototypeOf(o);return!!Hp(s)||Zp(s)}));const rh=th;class Namespace extends Xu.g${constructor(){super(),this.register(\"annotation\",tp),this.register(\"comment\",rp),this.register(\"parseResult\",np),this.register(\"sourceMap\",op)}}const uh=new Namespace,createNamespace=o=>{const s=new Namespace;return rh(o)&&s.use(o),s},dh=uh,toolbox=()=>({predicates:{...ce},namespace:dh}),fh={toolboxCreator:toolbox,visitorOptions:{nodeTypeGetter:visitor_getNodeType,exposeEdits:!0}},dispatchPluginsSync=(o,s,i={})=>{if(0===s.length)return o;const u=Mp(fh,i),{toolboxCreator:_,visitorOptions:w}=u,x=_(),C=s.map((o=>o(x))),j=mergeAll(C.map(sl({},\"visitor\")),{...w});C.forEach(Kp([\"pre\"],[]));const L=visitor_visit(o,j,w);return C.forEach(Kp([\"post\"],[])),L};dispatchPluginsSync[Symbol.for(\"nodejs.util.promisify.custom\")]=async(o,s,i={})=>{if(0===s.length)return o;const u=Mp(fh,i),{toolboxCreator:_,visitorOptions:w}=u,x=_(),C=s.map((o=>o(x))),j=mergeAll[Symbol.for(\"nodejs.util.promisify.custom\")],L=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")],B=j(C.map(sl({},\"visitor\")),{...w});await Promise.allSettled(C.map(Kp([\"pre\"],[])));const $=await L(o,B,w);return await Promise.allSettled(C.map(Kp([\"post\"],[]))),$};const refract=(o,{Type:s,plugins:i=[]})=>{const u=new s(o);return sp(o)&&(o.meta.length>0&&(u.meta=cloneDeep(o.meta)),o.attributes.length>0&&(u.attributes=cloneDeep(o.attributes))),dispatchPluginsSync(u,i,{toolboxCreator:toolbox,visitorOptions:{nodeTypeGetter:visitor_getNodeType}})},createRefractor=o=>(s,i={})=>refract(s,{...i,Type:o});Xu.Sh.refract=createRefractor(Xu.Sh),Xu.wE.refract=createRefractor(Xu.wE),Xu.Om.refract=createRefractor(Xu.Om),Xu.bd.refract=createRefractor(Xu.bd),Xu.Os.refract=createRefractor(Xu.Os),Xu.kT.refract=createRefractor(Xu.kT),Xu.Ft.refract=createRefractor(Xu.Ft),Xu.sI.refract=createRefractor(Xu.sI),tp.refract=createRefractor(tp),rp.refract=createRefractor(rp),np.refract=createRefractor(np),op.refract=createRefractor(op);const computeEdges=(o,s=new WeakMap)=>(dp(o)?(s.set(o.key,o),computeEdges(o.key,s),s.set(o.value,o),computeEdges(o.value,s)):o.children.forEach((i=>{s.set(i,o),computeEdges(i,s)})),s);const vh=class Transcluder_Transcluder{element;edges;constructor({element:o}){this.element=o}transclude(o,s){var i;if(o===this.element)return s;if(o===s)return this.element;this.edges=null!==(i=this.edges)&&void 0!==i?i:computeEdges(this.element);const u=this.edges.get(o);return Wl(u)?void 0:(pp(u)?((o,s,i)=>{const u=i.get(o);pp(u)&&(u.content=u.map(((_,w,x)=>x===o?(i.delete(o),i.set(s,u),s):x)))})(o,s,this.edges):hp(u)?((o,s,i)=>{const u=i.get(o);hp(u)&&(u.content=u.map((_=>_===o?(i.delete(o),i.set(s,u),s):_)))})(o,s,this.edges):dp(u)&&((o,s,i)=>{const u=i.get(o);dp(u)&&(u.key===o&&(u.key=s,i.delete(o),i.set(s,u)),u.value===o&&(u.value=s,i.delete(o),i.set(s,u)))})(o,s,this.edges),this.element)}},_h=pipe(ru(/~/g,\"~0\"),ru(/\\//g,\"~1\"),encodeURIComponent);const wh=class JsonPointerError extends Fa{};const Oh=class CompilationJsonPointerError extends wh{tokens;constructor(o,s){super(o,s),void 0!==s&&(this.tokens=[...s.tokens])}},es_compile=o=>{try{return 0===o.length?\"\":`/${o.map(_h).join(\"/\")}`}catch(s){throw new Oh(\"JSON Pointer compilation of tokens encountered an error.\",{tokens:o,cause:s})}};var jh=_curry2((function converge(o,s){return _l(Kc(Hl,0,Gl(\"length\",s)),(function(){var i=arguments,u=this;return o.apply(u,_map((function(o){return o.apply(u,i)}),s))}))}));const Ph=jh;function _identity(o){return o}const Ih=_curry1(_identity);var Rh=Fp(_l(1,pipe(pc,Xl(\"Number\"))),isFinite);var Dh=_l(1,Rh);var Lh=Fp(eu(Number.isFinite)?_l(1,Rc(Number.isFinite,Number)):Dh,Ph(hc,[Math.floor,Ih]));var Fh=_l(1,Lh);const Kh=eu(Number.isInteger)?_l(1,Rc(Number.isInteger,Number)):Fh;var Hh=function(){function XTake(o,s){this.xf=s,this.n=o,this.i=0}return XTake.prototype[\"@@transducer/init\"]=_xfBase_init,XTake.prototype[\"@@transducer/result\"]=_xfBase_result,XTake.prototype[\"@@transducer/step\"]=function(o,s){this.i+=1;var i=0===this.n?o:this.xf[\"@@transducer/step\"](o,s);return this.n>=0&&this.i>=this.n?_reduced(i):i},XTake}();function _xtake(o){return function(s){return new Hh(o,s)}}const Jh=_curry2(_dispatchable([\"take\"],_xtake,(function take(o,s){return Jc(0,o<0?1/0:o,s)})));var Gh=_curry2((function(o,s){return hc(Jh(o.length,s),o)}));const Qh=Gh;const td=hc(\"\");var sd=function(){function XDropWhile(o,s){this.xf=s,this.f=o}return XDropWhile.prototype[\"@@transducer/init\"]=_xfBase_init,XDropWhile.prototype[\"@@transducer/result\"]=_xfBase_result,XDropWhile.prototype[\"@@transducer/step\"]=function(o,s){if(this.f){if(this.f(s))return o;this.f=null}return this.xf[\"@@transducer/step\"](o,s)},XDropWhile}();function _xdropWhile(o){return function(s){return new sd(o,s)}}const id=_curry2(_dispatchable([\"dropWhile\"],_xdropWhile,(function dropWhile(o,s){for(var i=0,u=s.length;i<u&&o(s[i]);)i+=1;return Jc(i,1/0,s)})));const cd=wl((function(o,s){return pipe(xl(\"\"),id(Pl(o)),Cl(\"\"))(s)})),ld=pipe(ru(/~1/g,\"/\"),ru(/~0/g,\"~\"),(o=>{try{return decodeURIComponent(o)}catch{return o}}));const ud=class InvalidJsonPointerError extends wh{pointer;constructor(o,s){super(o,s),void 0!==s&&(this.pointer=s.pointer)}},uriToPointer=o=>{const s=(o=>{const s=o.indexOf(\"#\");return-1!==s?o.substring(s):\"#\"})(o);return cd(\"#\",s)},es_parse=o=>{if(td(o))return[];if(!Qh(\"/\",o))throw new ud(`Invalid JSON Pointer \"${o}\". JSON Pointers must begin with \"/\"`,{pointer:o});try{const s=pipe(xl(\"/\"),Rl(ld))(o);return Gc(s)}catch(s){throw new ud(`JSON Pointer parsing of \"${o}\" encountered an error.`,{pointer:o,cause:s})}};const dd=class EvaluationJsonPointerError extends wh{pointer;tokens;failedToken;failedTokenPosition;element;constructor(o,s){super(o,s),void 0!==s&&(this.pointer=s.pointer,Array.isArray(s.tokens)&&(this.tokens=[...s.tokens]),this.failedToken=s.failedToken,this.failedTokenPosition=s.failedTokenPosition,this.element=s.element)}},es_evaluate=(o,s)=>{let i;try{i=es_parse(o)}catch(i){throw new dd(`JSON Pointer evaluation failed while parsing the pointer \"${o}\".`,{pointer:o,element:cloneDeep(s),cause:i})}return i.reduce(((s,u,_)=>{if(pp(s)){if(!s.hasKey(u))throw new dd(`JSON Pointer evaluation failed while evaluating token \"${u}\" against an ObjectElement`,{pointer:o,tokens:i,failedToken:u,failedTokenPosition:_,element:cloneDeep(s)});return s.get(u)}if(hp(s)){if(!(u in s.content)||!Kh(Number(u)))throw new dd(`JSON Pointer evaluation failed while evaluating token \"${u}\" against an ArrayElement`,{pointer:o,tokens:i,failedToken:u,failedTokenPosition:_,element:cloneDeep(s)});return s.get(Number(u))}throw new dd(`JSON Pointer evaluation failed while evaluating token \"${u}\" against an unexpected Element`,{pointer:o,tokens:i,failedToken:u,failedTokenPosition:_,element:cloneDeep(s)})}),s)};class Callback extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"callback\"}}const md=Callback;class Components extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"components\"}get schemas(){return this.get(\"schemas\")}set schemas(o){this.set(\"schemas\",o)}get responses(){return this.get(\"responses\")}set responses(o){this.set(\"responses\",o)}get parameters(){return this.get(\"parameters\")}set parameters(o){this.set(\"parameters\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get requestBodies(){return this.get(\"requestBodies\")}set requestBodies(o){this.set(\"requestBodies\",o)}get headers(){return this.get(\"headers\")}set headers(o){this.set(\"headers\",o)}get securitySchemes(){return this.get(\"securitySchemes\")}set securitySchemes(o){this.set(\"securitySchemes\",o)}get links(){return this.get(\"links\")}set links(o){this.set(\"links\",o)}get callbacks(){return this.get(\"callbacks\")}set callbacks(o){this.set(\"callbacks\",o)}}const yd=Components;class Contact extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"contact\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get url(){return this.get(\"url\")}set url(o){this.set(\"url\",o)}get email(){return this.get(\"email\")}set email(o){this.set(\"email\",o)}}const vd=Contact;class Discriminator extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"discriminator\"}get propertyName(){return this.get(\"propertyName\")}set propertyName(o){this.set(\"propertyName\",o)}get mapping(){return this.get(\"mapping\")}set mapping(o){this.set(\"mapping\",o)}}const _d=Discriminator;class Encoding extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"encoding\"}get contentType(){return this.get(\"contentType\")}set contentType(o){this.set(\"contentType\",o)}get headers(){return this.get(\"headers\")}set headers(o){this.set(\"headers\",o)}get style(){return this.get(\"style\")}set style(o){this.set(\"style\",o)}get explode(){return this.get(\"explode\")}set explode(o){this.set(\"explode\",o)}get allowedReserved(){return this.get(\"allowedReserved\")}set allowedReserved(o){this.set(\"allowedReserved\",o)}}const Ed=Encoding;class Example extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"example\"}get summary(){return this.get(\"summary\")}set summary(o){this.set(\"summary\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get value(){return this.get(\"value\")}set value(o){this.set(\"value\",o)}get externalValue(){return this.get(\"externalValue\")}set externalValue(o){this.set(\"externalValue\",o)}}const wd=Example;class ExternalDocumentation extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"externalDocumentation\"}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get url(){return this.get(\"url\")}set url(o){this.set(\"url\",o)}}const Sd=ExternalDocumentation;class Header extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"header\"}get required(){return this.hasKey(\"required\")?this.get(\"required\"):new Xu.bd(!1)}set required(o){this.set(\"required\",o)}get deprecated(){return this.hasKey(\"deprecated\")?this.get(\"deprecated\"):new Xu.bd(!1)}set deprecated(o){this.set(\"deprecated\",o)}get allowEmptyValue(){return this.get(\"allowEmptyValue\")}set allowEmptyValue(o){this.set(\"allowEmptyValue\",o)}get style(){return this.get(\"style\")}set style(o){this.set(\"style\",o)}get explode(){return this.get(\"explode\")}set explode(o){this.set(\"explode\",o)}get allowReserved(){return this.get(\"allowReserved\")}set allowReserved(o){this.set(\"allowReserved\",o)}get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get contentProp(){return this.get(\"content\")}set contentProp(o){this.set(\"content\",o)}}Object.defineProperty(Header.prototype,\"description\",{get(){return this.get(\"description\")},set(o){this.set(\"description\",o)},enumerable:!0});const xd=Header;class Info extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"info\",this.classes.push(\"info\")}get title(){return this.get(\"title\")}set title(o){this.set(\"title\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get termsOfService(){return this.get(\"termsOfService\")}set termsOfService(o){this.set(\"termsOfService\",o)}get contact(){return this.get(\"contact\")}set contact(o){this.set(\"contact\",o)}get license(){return this.get(\"license\")}set license(o){this.set(\"license\",o)}get version(){return this.get(\"version\")}set version(o){this.set(\"version\",o)}}const kd=Info;class License extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"license\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get url(){return this.get(\"url\")}set url(o){this.set(\"url\",o)}}const Od=License;class Link extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"link\"}get operationRef(){return this.get(\"operationRef\")}set operationRef(o){this.set(\"operationRef\",o)}get operationId(){return this.get(\"operationId\")}set operationId(o){this.set(\"operationId\",o)}get operation(){var o,s;return ip(this.operationRef)?null===(o=this.operationRef)||void 0===o?void 0:o.meta.get(\"operation\"):ip(this.operationId)?null===(s=this.operationId)||void 0===s?void 0:s.meta.get(\"operation\"):void 0}set operation(o){this.set(\"operation\",o)}get parameters(){return this.get(\"parameters\")}set parameters(o){this.set(\"parameters\",o)}get requestBody(){return this.get(\"requestBody\")}set requestBody(o){this.set(\"requestBody\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get server(){return this.get(\"server\")}set server(o){this.set(\"server\",o)}}const Cd=Link;class MediaType extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"mediaType\"}get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get encoding(){return this.get(\"encoding\")}set encoding(o){this.set(\"encoding\",o)}}const Ad=MediaType;class OAuthFlow extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"oAuthFlow\"}get authorizationUrl(){return this.get(\"authorizationUrl\")}set authorizationUrl(o){this.set(\"authorizationUrl\",o)}get tokenUrl(){return this.get(\"tokenUrl\")}set tokenUrl(o){this.set(\"tokenUrl\",o)}get refreshUrl(){return this.get(\"refreshUrl\")}set refreshUrl(o){this.set(\"refreshUrl\",o)}get scopes(){return this.get(\"scopes\")}set scopes(o){this.set(\"scopes\",o)}}const Id=OAuthFlow;class OAuthFlows extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"oAuthFlows\"}get implicit(){return this.get(\"implicit\")}set implicit(o){this.set(\"implicit\",o)}get password(){return this.get(\"password\")}set password(o){this.set(\"password\",o)}get clientCredentials(){return this.get(\"clientCredentials\")}set clientCredentials(o){this.set(\"clientCredentials\",o)}get authorizationCode(){return this.get(\"authorizationCode\")}set authorizationCode(o){this.set(\"authorizationCode\",o)}}const Md=OAuthFlows;class Openapi extends Xu.Om{constructor(o,s,i){super(o,s,i),this.element=\"openapi\",this.classes.push(\"spec-version\"),this.classes.push(\"version\")}}const Nd=Openapi;class OpenApi3_0 extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"openApi3_0\",this.classes.push(\"api\")}get openapi(){return this.get(\"openapi\")}set openapi(o){this.set(\"openapi\",o)}get info(){return this.get(\"info\")}set info(o){this.set(\"info\",o)}get servers(){return this.get(\"servers\")}set servers(o){this.set(\"servers\",o)}get paths(){return this.get(\"paths\")}set paths(o){this.set(\"paths\",o)}get components(){return this.get(\"components\")}set components(o){this.set(\"components\",o)}get security(){return this.get(\"security\")}set security(o){this.set(\"security\",o)}get tags(){return this.get(\"tags\")}set tags(o){this.set(\"tags\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}}const Td=OpenApi3_0;class Operation extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"operation\"}get tags(){return this.get(\"tags\")}set tags(o){this.set(\"tags\",o)}get summary(){return this.get(\"summary\")}set summary(o){this.set(\"summary\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}set externalDocs(o){this.set(\"externalDocs\",o)}get externalDocs(){return this.get(\"externalDocs\")}get operationId(){return this.get(\"operationId\")}set operationId(o){this.set(\"operationId\",o)}get parameters(){return this.get(\"parameters\")}set parameters(o){this.set(\"parameters\",o)}get requestBody(){return this.get(\"requestBody\")}set requestBody(o){this.set(\"requestBody\",o)}get responses(){return this.get(\"responses\")}set responses(o){this.set(\"responses\",o)}get callbacks(){return this.get(\"callbacks\")}set callbacks(o){this.set(\"callbacks\",o)}get deprecated(){return this.hasKey(\"deprecated\")?this.get(\"deprecated\"):new Xu.bd(!1)}set deprecated(o){this.set(\"deprecated\",o)}get security(){return this.get(\"security\")}set security(o){this.set(\"security\",o)}get servers(){return this.get(\"severs\")}set servers(o){this.set(\"servers\",o)}}const Rd=Operation;class Parameter extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"parameter\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get in(){return this.get(\"in\")}set in(o){this.set(\"in\",o)}get required(){return this.hasKey(\"required\")?this.get(\"required\"):new Xu.bd(!1)}set required(o){this.set(\"required\",o)}get deprecated(){return this.hasKey(\"deprecated\")?this.get(\"deprecated\"):new Xu.bd(!1)}set deprecated(o){this.set(\"deprecated\",o)}get allowEmptyValue(){return this.get(\"allowEmptyValue\")}set allowEmptyValue(o){this.set(\"allowEmptyValue\",o)}get style(){return this.get(\"style\")}set style(o){this.set(\"style\",o)}get explode(){return this.get(\"explode\")}set explode(o){this.set(\"explode\",o)}get allowReserved(){return this.get(\"allowReserved\")}set allowReserved(o){this.set(\"allowReserved\",o)}get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get contentProp(){return this.get(\"content\")}set contentProp(o){this.set(\"content\",o)}}Object.defineProperty(Parameter.prototype,\"description\",{get(){return this.get(\"description\")},set(o){this.set(\"description\",o)},enumerable:!0});const Dd=Parameter;class PathItem extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"pathItem\"}get $ref(){return this.get(\"$ref\")}set $ref(o){this.set(\"$ref\",o)}get summary(){return this.get(\"summary\")}set summary(o){this.set(\"summary\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get GET(){return this.get(\"get\")}set GET(o){this.set(\"GET\",o)}get PUT(){return this.get(\"put\")}set PUT(o){this.set(\"PUT\",o)}get POST(){return this.get(\"post\")}set POST(o){this.set(\"POST\",o)}get DELETE(){return this.get(\"delete\")}set DELETE(o){this.set(\"DELETE\",o)}get OPTIONS(){return this.get(\"options\")}set OPTIONS(o){this.set(\"OPTIONS\",o)}get HEAD(){return this.get(\"head\")}set HEAD(o){this.set(\"HEAD\",o)}get PATCH(){return this.get(\"patch\")}set PATCH(o){this.set(\"PATCH\",o)}get TRACE(){return this.get(\"trace\")}set TRACE(o){this.set(\"TRACE\",o)}get servers(){return this.get(\"servers\")}set servers(o){this.set(\"servers\",o)}get parameters(){return this.get(\"parameters\")}set parameters(o){this.set(\"parameters\",o)}}const Ld=PathItem;class Paths extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"paths\"}}const Bd=Paths;class Reference extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"reference\",this.classes.push(\"openapi-reference\")}get $ref(){return this.get(\"$ref\")}set $ref(o){this.set(\"$ref\",o)}}const Fd=Reference;class RequestBody extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"requestBody\"}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get contentProp(){return this.get(\"content\")}set contentProp(o){this.set(\"content\",o)}get required(){return this.hasKey(\"required\")?this.get(\"required\"):new Xu.bd(!1)}set required(o){this.set(\"required\",o)}}const $d=RequestBody;class Response_Response extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"response\"}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get headers(){return this.get(\"headers\")}set headers(o){this.set(\"headers\",o)}get contentProp(){return this.get(\"content\")}set contentProp(o){this.set(\"content\",o)}get links(){return this.get(\"links\")}set links(o){this.set(\"links\",o)}}const Vd=Response_Response;class Responses extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"responses\"}get default(){return this.get(\"default\")}set default(o){this.set(\"default\",o)}}const Ud=Responses;const Wd=class UnsupportedOperationError extends Ba{};class JSONSchema extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"JSONSchemaDraft4\"}get idProp(){return this.get(\"id\")}set idProp(o){this.set(\"id\",o)}get $schema(){return this.get(\"$schema\")}set $schema(o){this.set(\"$schema\",o)}get multipleOf(){return this.get(\"multipleOf\")}set multipleOf(o){this.set(\"multipleOf\",o)}get maximum(){return this.get(\"maximum\")}set maximum(o){this.set(\"maximum\",o)}get exclusiveMaximum(){return this.get(\"exclusiveMaximum\")}set exclusiveMaximum(o){this.set(\"exclusiveMaximum\",o)}get minimum(){return this.get(\"minimum\")}set minimum(o){this.set(\"minimum\",o)}get exclusiveMinimum(){return this.get(\"exclusiveMinimum\")}set exclusiveMinimum(o){this.set(\"exclusiveMinimum\",o)}get maxLength(){return this.get(\"maxLength\")}set maxLength(o){this.set(\"maxLength\",o)}get minLength(){return this.get(\"minLength\")}set minLength(o){this.set(\"minLength\",o)}get pattern(){return this.get(\"pattern\")}set pattern(o){this.set(\"pattern\",o)}get additionalItems(){return this.get(\"additionalItems\")}set additionalItems(o){this.set(\"additionalItems\",o)}get items(){return this.get(\"items\")}set items(o){this.set(\"items\",o)}get maxItems(){return this.get(\"maxItems\")}set maxItems(o){this.set(\"maxItems\",o)}get minItems(){return this.get(\"minItems\")}set minItems(o){this.set(\"minItems\",o)}get uniqueItems(){return this.get(\"uniqueItems\")}set uniqueItems(o){this.set(\"uniqueItems\",o)}get maxProperties(){return this.get(\"maxProperties\")}set maxProperties(o){this.set(\"maxProperties\",o)}get minProperties(){return this.get(\"minProperties\")}set minProperties(o){this.set(\"minProperties\",o)}get required(){return this.get(\"required\")}set required(o){this.set(\"required\",o)}get properties(){return this.get(\"properties\")}set properties(o){this.set(\"properties\",o)}get additionalProperties(){return this.get(\"additionalProperties\")}set additionalProperties(o){this.set(\"additionalProperties\",o)}get patternProperties(){return this.get(\"patternProperties\")}set patternProperties(o){this.set(\"patternProperties\",o)}get dependencies(){return this.get(\"dependencies\")}set dependencies(o){this.set(\"dependencies\",o)}get enum(){return this.get(\"enum\")}set enum(o){this.set(\"enum\",o)}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}get allOf(){return this.get(\"allOf\")}set allOf(o){this.set(\"allOf\",o)}get anyOf(){return this.get(\"anyOf\")}set anyOf(o){this.set(\"anyOf\",o)}get oneOf(){return this.get(\"oneOf\")}set oneOf(o){this.set(\"oneOf\",o)}get not(){return this.get(\"not\")}set not(o){this.set(\"not\",o)}get definitions(){return this.get(\"definitions\")}set definitions(o){this.set(\"definitions\",o)}get title(){return this.get(\"title\")}set title(o){this.set(\"title\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get default(){return this.get(\"default\")}set default(o){this.set(\"default\",o)}get format(){return this.get(\"format\")}set format(o){this.set(\"format\",o)}get base(){return this.get(\"base\")}set base(o){this.set(\"base\",o)}get links(){return this.get(\"links\")}set links(o){this.set(\"links\",o)}get media(){return this.get(\"media\")}set media(o){this.set(\"media\",o)}get readOnly(){return this.get(\"readOnly\")}set readOnly(o){this.set(\"readOnly\",o)}}const Kd=JSONSchema;class JSONReference extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"JSONReference\",this.classes.push(\"json-reference\")}get $ref(){return this.get(\"$ref\")}set $ref(o){this.set(\"$ref\",o)}}const Hd=JSONReference;class Media extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"media\"}get binaryEncoding(){return this.get(\"binaryEncoding\")}set binaryEncoding(o){this.set(\"binaryEncoding\",o)}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}}const Jd=Media;class LinkDescription extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"linkDescription\"}get href(){return this.get(\"href\")}set href(o){this.set(\"href\",o)}get rel(){return this.get(\"rel\")}set rel(o){this.set(\"rel\",o)}get title(){return this.get(\"title\")}set title(o){this.set(\"title\",o)}get targetSchema(){return this.get(\"targetSchema\")}set targetSchema(o){this.set(\"targetSchema\",o)}get mediaType(){return this.get(\"mediaType\")}set mediaType(o){this.set(\"mediaType\",o)}get method(){return this.get(\"method\")}set method(o){this.set(\"method\",o)}get encType(){return this.get(\"encType\")}set encType(o){this.set(\"encType\",o)}get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}}const Gd=LinkDescription;var Yd=_curry2((function mapObjIndexed(o,s){return _arrayReduce((function(i,u){return i[u]=o(s[u],u,s),i}),{},lc(s))}));const Xd=Yd;const Qd=_curry1((function isNil(o){return null==o}));var Zd=_curry2((function hasPath(o,s){if(0===o.length||Qd(s))return!1;for(var i=s,u=0;u<o.length;){if(Qd(i)||!_has(o[u],i))return!1;i=i[o[u]],u+=1}return!0}));const ef=Zd;var rf=_curry2((function has(o,s){return ef([o],s)}));const of=rf;const af=_curry3((function propSatisfies(o,s,i){return o(tl(s,i))})),dereference=(o,s)=>{const i=Qc(o,s);return Xd((o=>{if(rh(o)&&of(\"$ref\",o)&&af(su,\"$ref\",o)){const s=Np([\"$ref\"],o),u=cd(\"#/\",s);return Np(u.split(\"/\"),i)}return rh(o)?dereference(o,i):o}),o)},emptyElement=o=>{const s=o.meta.length>0?cloneDeep(o.meta):void 0,i=o.attributes.length>0?cloneDeep(o.attributes):void 0;return new o.constructor(void 0,s,i)},cloneUnlessOtherwiseSpecified=(o,s)=>s.clone&&s.isMergeableElement(o)?deepmerge(emptyElement(o),o,s):o,getMetaMergeFunction=o=>\"function\"!=typeof o.customMetaMerge?o=>cloneDeep(o):o.customMetaMerge,getAttributesMergeFunction=o=>\"function\"!=typeof o.customAttributesMerge?o=>cloneDeep(o):o.customAttributesMerge,cf={clone:!0,isMergeableElement:o=>pp(o)||hp(o),arrayElementMerge:(o,s,i)=>o.concat(s)[\"fantasy-land/map\"]((o=>cloneUnlessOtherwiseSpecified(o,i))),objectElementMerge:(o,s,i)=>{const u=pp(o)?emptyElement(o):emptyElement(s);return pp(o)&&o.forEach(((o,s,_)=>{const w=cloneShallow(_);w.value=cloneUnlessOtherwiseSpecified(o,i),u.content.push(w)})),s.forEach(((s,_,w)=>{const x=serializers_value(_);let C;if(pp(o)&&o.hasKey(x)&&i.isMergeableElement(s)){const u=o.get(x);C=cloneShallow(w),C.value=((o,s)=>{if(\"function\"!=typeof s.customMerge)return deepmerge;const i=s.customMerge(o,s);return\"function\"==typeof i?i:deepmerge})(_,i)(u,s)}else C=cloneShallow(w),C.value=cloneUnlessOtherwiseSpecified(s,i);u.remove(x),u.content.push(C)})),u},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0};function deepmerge(o,s,i){var u,_,w;const x={...cf,...i};x.isMergeableElement=null!==(u=x.isMergeableElement)&&void 0!==u?u:cf.isMergeableElement,x.arrayElementMerge=null!==(_=x.arrayElementMerge)&&void 0!==_?_:cf.arrayElementMerge,x.objectElementMerge=null!==(w=x.objectElementMerge)&&void 0!==w?w:cf.objectElementMerge;const C=hp(s);if(!(C===hp(o)))return cloneUnlessOtherwiseSpecified(s,x);const j=C&&\"function\"==typeof x.arrayElementMerge?x.arrayElementMerge(o,s,x):x.objectElementMerge(o,s,x);return j.meta=getMetaMergeFunction(x)(o.meta,s.meta),j.attributes=getAttributesMergeFunction(x)(o.attributes,s.attributes),j}deepmerge.all=(o,s)=>{if(!Array.isArray(o))throw new TypeError(\"First argument of deepmerge should be an array.\");return 0===o.length?new Xu.Sh:o.reduce(((o,i)=>deepmerge(o,i,s)),emptyElement(o[0]))};const lf=class Visitor_Visitor{element;constructor(o){Object.assign(this,o)}copyMetaAndAttributes(o,s){(o.meta.length>0||s.meta.length>0)&&(s.meta=deepmerge(s.meta,o.meta),hasElementSourceMap(o)&&s.meta.set(\"sourceMap\",o.meta.get(\"sourceMap\"))),(o.attributes.length>0||o.meta.length>0)&&(s.attributes=deepmerge(s.attributes,o.attributes))}};const uf=class FallbackVisitor extends lf{enter(o){return this.element=cloneDeep(o),Yu}},copyProps=(o,s,i=[])=>{const u=Object.getOwnPropertyDescriptors(s);for(let o of i)delete u[o];Object.defineProperties(o,u)},protoChain=(o,s=[o])=>{const i=Object.getPrototypeOf(o);return null===i?s:protoChain(i,[...s,i])},hardMixProtos=(o,s,i=[])=>{var u;const _=null!==(u=((...o)=>{if(0===o.length)return;let s;const i=o.map((o=>protoChain(o)));for(;i.every((o=>o.length>0));){const o=i.map((o=>o.pop())),u=o[0];if(!o.every((o=>o===u)))break;s=u}return s})(...o))&&void 0!==u?u:Object.prototype,w=Object.create(_),x=protoChain(_);for(let s of o){let o=protoChain(s);for(let s=o.length-1;s>=0;s--){let u=o[s];-1===x.indexOf(u)&&(copyProps(w,u,[\"constructor\",...i]),x.push(u))}}return w.constructor=s,w},unique=o=>o.filter(((s,i)=>o.indexOf(s)==i)),getIngredientWithProp=(o,s)=>{const i=s.map((o=>protoChain(o)));let u=0,_=!0;for(;_;){_=!1;for(let w=s.length-1;w>=0;w--){const s=i[w][u];if(null!=s&&(_=!0,null!=Object.getOwnPropertyDescriptor(s,o)))return i[w][0]}u++}},proxyMix=(o,s=Object.prototype)=>new Proxy({},{getPrototypeOf:()=>s,setPrototypeOf(){throw Error(\"Cannot set prototype of Proxies created by ts-mixer\")},getOwnPropertyDescriptor:(s,i)=>Object.getOwnPropertyDescriptor(getIngredientWithProp(i,o)||{},i),defineProperty(){throw new Error(\"Cannot define new properties on Proxies created by ts-mixer\")},has:(i,u)=>void 0!==getIngredientWithProp(u,o)||void 0!==s[u],get:(i,u)=>(getIngredientWithProp(u,o)||s)[u],set(s,i,u){const _=getIngredientWithProp(i,o);if(void 0===_)throw new Error(\"Cannot set new properties on Proxies created by ts-mixer\");return _[i]=u,!0},deleteProperty(){throw new Error(\"Cannot delete properties on Proxies created by ts-mixer\")},ownKeys:()=>o.map(Object.getOwnPropertyNames).reduce(((o,s)=>s.concat(o.filter((o=>s.indexOf(o)<0)))))}),hf=null,df=\"copy\",mf=\"copy\",gf=\"deep\",yf=new WeakMap,getMixinsForClass=o=>yf.get(o),mergeObjectsOfDecorators=(o,s)=>{var i,u;const _=unique([...Object.getOwnPropertyNames(o),...Object.getOwnPropertyNames(s)]),w={};for(let x of _)w[x]=unique([...null!==(i=null==o?void 0:o[x])&&void 0!==i?i:[],...null!==(u=null==s?void 0:s[x])&&void 0!==u?u:[]]);return w},mergePropertyAndMethodDecorators=(o,s)=>{var i,u,_,w;return{property:mergeObjectsOfDecorators(null!==(i=null==o?void 0:o.property)&&void 0!==i?i:{},null!==(u=null==s?void 0:s.property)&&void 0!==u?u:{}),method:mergeObjectsOfDecorators(null!==(_=null==o?void 0:o.method)&&void 0!==_?_:{},null!==(w=null==s?void 0:s.method)&&void 0!==w?w:{})}},mergeDecorators=(o,s)=>{var i,u,_,w,x,C;return{class:unique([...null!==(i=null==o?void 0:o.class)&&void 0!==i?i:[],...null!==(u=null==s?void 0:s.class)&&void 0!==u?u:[]]),static:mergePropertyAndMethodDecorators(null!==(_=null==o?void 0:o.static)&&void 0!==_?_:{},null!==(w=null==s?void 0:s.static)&&void 0!==w?w:{}),instance:mergePropertyAndMethodDecorators(null!==(x=null==o?void 0:o.instance)&&void 0!==x?x:{},null!==(C=null==s?void 0:s.instance)&&void 0!==C?C:{})}},bf=new Map,deepDecoratorSearch=(...o)=>{const s=((...o)=>{var s;const i=new Set,u=new Set([...o]);for(;u.size>0;)for(let o of u){const _=protoChain(o.prototype).map((o=>o.constructor)),w=[..._,...null!==(s=getMixinsForClass(o))&&void 0!==s?s:[]].filter((o=>!i.has(o)));for(let o of w)u.add(o);i.add(o),u.delete(o)}return[...i]})(...o).map((o=>bf.get(o))).filter((o=>!!o));return 0==s.length?{}:1==s.length?s[0]:s.reduce(((o,s)=>mergeDecorators(o,s)))},getDecoratorsForClass=o=>{let s=bf.get(o);return s||(s={},bf.set(o,s)),s};function Mixin(...o){var s,i,u;const _=o.map((o=>o.prototype)),w=hf;if(null!==w){const o=_.map((o=>o[w])).filter((o=>\"function\"==typeof o)),combinedInitFunction=function(...s){for(let i of o)i.apply(this,s)},s={[w]:combinedInitFunction};_.push(s)}function MixedClass(...s){for(const i of o)copyProps(this,new i(...s));null!==w&&\"function\"==typeof this[w]&&this[w].apply(this,s)}var x,C;MixedClass.prototype=\"copy\"===mf?hardMixProtos(_,MixedClass):(x=_,C=MixedClass,proxyMix([...x,{constructor:C}])),Object.setPrototypeOf(MixedClass,\"copy\"===df?hardMixProtos(o,null,[\"prototype\"]):proxyMix(o,Function.prototype));let j=MixedClass;if(\"none\"!==gf){const _=\"deep\"===gf?deepDecoratorSearch(...o):((...o)=>{const s=o.map((o=>getDecoratorsForClass(o)));return 0===s.length?{}:1===s.length?s[0]:s.reduce(((o,s)=>mergeDecorators(o,s)))})(...o);for(let o of null!==(s=null==_?void 0:_.class)&&void 0!==s?s:[]){const s=o(j);s&&(j=s)}applyPropAndMethodDecorators(null!==(i=null==_?void 0:_.static)&&void 0!==i?i:{},j),applyPropAndMethodDecorators(null!==(u=null==_?void 0:_.instance)&&void 0!==u?u:{},j.prototype)}var L,B;return L=j,B=o,yf.set(L,B),j}const applyPropAndMethodDecorators=(o,s)=>{const i=o.property,u=o.method;if(i)for(let o in i)for(let u of i[o])u(s,o);if(u)for(let o in u)for(let i of u[o])i(s,o,Object.getOwnPropertyDescriptor(s,o))};const _f=_curry2((function pick(o,s){for(var i={},u=0;u<o.length;)o[u]in s&&(i[o[u]]=s[o[u]]),u+=1;return i}));const Sf=class SpecificationVisitor extends lf{specObj;passingOptionsNames=[\"specObj\"];constructor({specObj:o,...s}){super({...s}),this.specObj=o}retrievePassingOptions(){return _f(this.passingOptionsNames,this)}retrieveFixedFields(o){const s=Np([\"visitors\",...o,\"fixedFields\"],this.specObj);return\"object\"==typeof s&&null!==s?Object.keys(s):[]}retrieveVisitor(o){return Ja(eu,[\"visitors\",...o],this.specObj)?Np([\"visitors\",...o],this.specObj):Np([\"visitors\",...o,\"$visitor\"],this.specObj)}retrieveVisitorInstance(o,s={}){const i=this.retrievePassingOptions();return new(this.retrieveVisitor(o))({...i,...s})}toRefractedElement(o,s,i={}){const u=this.retrieveVisitorInstance(o,i);return u instanceof uf&&(null==u?void 0:u.constructor)===uf?cloneDeep(s):(visitor_visit(s,u,i),u.element)}};const xf=class FixedFieldsVisitor extends Sf{specPath;ignoredFields;constructor({specPath:o,ignoredFields:s,...i}){super({...i}),this.specPath=o,this.ignoredFields=s||[]}ObjectElement(o){const s=this.specPath(o),i=this.retrieveFixedFields(s);return o.forEach(((o,u,_)=>{if(ip(u)&&i.includes(serializers_value(u))&&!this.ignoredFields.includes(serializers_value(u))){const i=this.toRefractedElement([...s,\"fixedFields\",serializers_value(u)],o),w=new Xu.Pr(cloneDeep(u),i);this.copyMetaAndAttributes(_,w),w.classes.push(\"fixed-field\"),this.element.content.push(w)}else this.ignoredFields.includes(serializers_value(u))||this.element.content.push(cloneDeep(_))})),this.copyMetaAndAttributes(o,this.element),Yu}};class JSONSchemaVisitor extends(Mixin(xf,uf)){constructor(o){super(o),this.element=new Kd,this.specPath=Ul([\"document\",\"objects\",\"JSONSchema\"])}}const kf=JSONSchemaVisitor;const Of=class ParentSchemaAwareVisitor{parent;constructor({parent:o}){this.parent=o}},isJSONReferenceLikeElement=o=>pp(o)&&o.hasKey(\"$ref\");class ItemsVisitor extends(Mixin(Sf,Of,uf)){ObjectElement(o){const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"];return this.element=this.toRefractedElement(s,o),Yu}ArrayElement(o){return this.element=new Xu.wE,this.element.classes.push(\"json-schema-items\"),o.forEach((o=>{const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const Cf=ItemsVisitor;const jf=class RequiredVisitor extends uf{ArrayElement(o){const s=this.enter(o);return this.element.classes.push(\"json-schema-required\"),s}};const Pf=_curry1((function allPass(o){return _l(Kc(Hl,0,Gl(\"length\",o)),(function(){for(var s=0,i=o.length;s<i;){if(!o[s].apply(this,arguments))return!1;s+=1}return!0}))}));const Nf=_curry1((function isNotEmpty(o){return!Vp(o)}));const Tf=_curry2((function or(o,s){return o||s}));var Rf=Vl(_l(1,Fp(Jp,_curry2((function either(o,s){return _isFunction(o)?function _either(){return o.apply(this,arguments)||s.apply(this,arguments)}:$l(Tf)(o,s)}))(Gp,eu))));const Df=Pf([su,Rf,Nf]);const Ff=class PatternedFieldsVisitor extends Sf{specPath;ignoredFields;fieldPatternPredicate=es_F;constructor({specPath:o,ignoredFields:s,fieldPatternPredicate:i,...u}){super({...u}),this.specPath=o,this.ignoredFields=s||[],\"function\"==typeof i&&(this.fieldPatternPredicate=i)}ObjectElement(o){return o.forEach(((o,s,i)=>{if(!this.ignoredFields.includes(serializers_value(s))&&this.fieldPatternPredicate(serializers_value(s))){const u=this.specPath(o),_=this.toRefractedElement(u,o),w=new Xu.Pr(cloneDeep(s),_);this.copyMetaAndAttributes(i,w),w.classes.push(\"patterned-field\"),this.element.content.push(w)}else this.ignoredFields.includes(serializers_value(s))||this.element.content.push(cloneDeep(i))})),this.copyMetaAndAttributes(o,this.element),Yu}};const Vf=class MapVisitor extends Ff{constructor(o){super(o),this.fieldPatternPredicate=Df}};class PropertiesVisitor extends(Mixin(Vf,Of,uf)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-properties\"),this.specPath=o=>isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"]}}const Wf=PropertiesVisitor;class PatternPropertiesVisitor extends(Mixin(Vf,Of,uf)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-patternProperties\"),this.specPath=o=>isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"]}}const Hf=PatternPropertiesVisitor;class DependenciesVisitor extends(Mixin(Vf,Of,uf)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-dependencies\"),this.specPath=o=>isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"]}}const Jf=DependenciesVisitor;const Gf=class EnumVisitor extends uf{ArrayElement(o){const s=this.enter(o);return this.element.classes.push(\"json-schema-enum\"),s}};const Xf=class TypeVisitor extends uf{StringElement(o){const s=this.enter(o);return this.element.classes.push(\"json-schema-type\"),s}ArrayElement(o){const s=this.enter(o);return this.element.classes.push(\"json-schema-type\"),s}};class AllOfVisitor extends(Mixin(Sf,Of,uf)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-allOf\")}ArrayElement(o){return o.forEach((o=>{const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const Qf=AllOfVisitor;class AnyOfVisitor extends(Mixin(Sf,Of,uf)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-anyOf\")}ArrayElement(o){return o.forEach((o=>{const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const em=AnyOfVisitor;class OneOfVisitor extends(Mixin(Sf,Of,uf)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-oneOf\")}ArrayElement(o){return o.forEach((o=>{const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const tm=OneOfVisitor;class DefinitionsVisitor extends(Mixin(Vf,Of,uf)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-definitions\"),this.specPath=o=>isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"]}}const rm=DefinitionsVisitor;class LinksVisitor extends(Mixin(Sf,Of,uf)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-links\")}ArrayElement(o){return o.forEach((o=>{const s=this.toRefractedElement([\"document\",\"objects\",\"LinkDescription\"],o);this.element.push(s)})),this.copyMetaAndAttributes(o,this.element),Yu}}const nm=LinksVisitor;class JSONReferenceVisitor extends(Mixin(xf,uf)){constructor(o){super(o),this.element=new Hd,this.specPath=Ul([\"document\",\"objects\",\"JSONReference\"])}ObjectElement(o){const s=xf.prototype.ObjectElement.call(this,o);return ip(this.element.$ref)&&this.element.classes.push(\"reference-element\"),s}}const om=JSONReferenceVisitor;const sm=class $RefVisitor extends uf{StringElement(o){const s=this.enter(o);return this.element.classes.push(\"reference-value\"),s}};const im=_curry3((function ifElse(o,s,i){return _l(Math.max(o.length,s.length,i.length),(function _ifElse(){return o.apply(this,arguments)?s.apply(this,arguments):i.apply(this,arguments)}))}));const am=_curry1((function comparator(o){return function(s,i){return o(s,i)?-1:o(i,s)?1:0}}));var cm=_curry2((function sort(o,s){return Array.prototype.slice.call(s,0).sort(o)}));const lm=cm;var um=_curry1((function(o){return _nth(0,o)}));const pm=um;const hm=_curry1(_reduced);const dm=Vl(Qd);const fm=Fp(Up,Nf);function _toConsumableArray(o){return function _arrayWithoutHoles(o){if(Array.isArray(o))return _arrayLikeToArray(o)}(o)||function _iterableToArray(o){if(\"undefined\"!=typeof Symbol&&null!=o[Symbol.iterator]||null!=o[\"@@iterator\"])return Array.from(o)}(o)||function _unsupportedIterableToArray(o,s){if(!o)return;if(\"string\"==typeof o)return _arrayLikeToArray(o,s);var i=Object.prototype.toString.call(o).slice(8,-1);\"Object\"===i&&o.constructor&&(i=o.constructor.name);if(\"Map\"===i||\"Set\"===i)return Array.from(o);if(\"Arguments\"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(o,s)}(o)||function _nonIterableSpread(){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 _arrayLikeToArray(o,s){(null==s||s>o.length)&&(s=o.length);for(var i=0,u=new Array(s);i<s;i++)u[i]=o[i];return u}var mm=pipe(lm(am((function(o,s){return o.length>s.length}))),pm,tl(\"length\")),gm=wl((function(o,s,i){var u=i.apply(void 0,_toConsumableArray(o));return dm(u)?hm(u):s}));const ym=im(fm,(function dispatchImpl(o){var s=mm(o);return _l(s,(function(){for(var s=arguments.length,i=new Array(s),u=0;u<s;u++)i[u]=arguments[u];return Kc(gm(i),void 0,o)}))}),zl);const vm=class AlternatingVisitor extends Sf{alternator;constructor({alternator:o,...s}){super({...s}),this.alternator=o}enter(o){const s=this.alternator.map((({predicate:o,specPath:s})=>im(o,Ul(s),zl))),i=ym(s)(o);return this.element=this.toRefractedElement(i,o),Yu}};const bm=class SchemaOrReferenceVisitor extends vm{constructor(o){super(o),this.alternator=[{predicate:isJSONReferenceLikeElement,specPath:[\"document\",\"objects\",\"JSONReference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"JSONSchema\"]}]}};class MediaVisitor extends(Mixin(xf,uf)){constructor(o){super(o),this.element=new Jd,this.specPath=Ul([\"document\",\"objects\",\"Media\"])}}const _m=MediaVisitor;class LinkDescriptionVisitor extends(Mixin(xf,uf)){constructor(o){super(o),this.element=new Gd,this.specPath=Ul([\"document\",\"objects\",\"LinkDescription\"])}}const Em={visitors:{value:uf,JSONSchemaOrJSONReferenceVisitor:bm,document:{objects:{JSONSchema:{$visitor:kf,fixedFields:{id:{$ref:\"#/visitors/value\"},$schema:{$ref:\"#/visitors/value\"},multipleOf:{$ref:\"#/visitors/value\"},maximum:{$ref:\"#/visitors/value\"},exclusiveMaximum:{$ref:\"#/visitors/value\"},minimum:{$ref:\"#/visitors/value\"},exclusiveMinimum:{$ref:\"#/visitors/value\"},maxLength:{$ref:\"#/visitors/value\"},minLength:{$ref:\"#/visitors/value\"},pattern:{$ref:\"#/visitors/value\"},additionalItems:bm,items:Cf,maxItems:{$ref:\"#/visitors/value\"},minItems:{$ref:\"#/visitors/value\"},uniqueItems:{$ref:\"#/visitors/value\"},maxProperties:{$ref:\"#/visitors/value\"},minProperties:{$ref:\"#/visitors/value\"},required:jf,properties:Wf,additionalProperties:bm,patternProperties:Hf,dependencies:Jf,enum:Gf,type:Xf,allOf:Qf,anyOf:em,oneOf:tm,not:bm,definitions:rm,title:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},default:{$ref:\"#/visitors/value\"},format:{$ref:\"#/visitors/value\"},base:{$ref:\"#/visitors/value\"},links:nm,media:{$ref:\"#/visitors/document/objects/Media\"},readOnly:{$ref:\"#/visitors/value\"}}},JSONReference:{$visitor:om,fixedFields:{$ref:sm}},Media:{$visitor:_m,fixedFields:{binaryEncoding:{$ref:\"#/visitors/value\"},type:{$ref:\"#/visitors/value\"}}},LinkDescription:{$visitor:LinkDescriptionVisitor,fixedFields:{href:{$ref:\"#/visitors/value\"},rel:{$ref:\"#/visitors/value\"},title:{$ref:\"#/visitors/value\"},targetSchema:bm,mediaType:{$ref:\"#/visitors/value\"},method:{$ref:\"#/visitors/value\"},encType:{$ref:\"#/visitors/value\"},schema:bm}}}}}},traversal_visitor_getNodeType=o=>{if(sp(o))return`${o.element.charAt(0).toUpperCase()+o.element.slice(1)}Element`},wm={JSONSchemaDraft4Element:[\"content\"],JSONReferenceElement:[\"content\"],MediaElement:[\"content\"],LinkDescriptionElement:[\"content\"],...xp},Sm=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Kd||o(u)&&s(\"JSONSchemaDraft4\",u)&&i(\"object\",u))),xm=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Hd||o(u)&&s(\"JSONReference\",u)&&i(\"object\",u))),km=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Jd||o(u)&&s(\"media\",u)&&i(\"object\",u))),Om=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Gd||o(u)&&s(\"linkDescription\",u)&&i(\"object\",u))),Cm={namespace:o=>{const{base:s}=o;return s.register(\"jSONSchemaDraft4\",Kd),s.register(\"jSONReference\",Hd),s.register(\"media\",Jd),s.register(\"linkDescription\",Gd),s}},Am=Cm,refractor_toolbox=()=>{const o=createNamespace(Am);return{predicates:{...le,isStringElement:ip},namespace:o}},refractor_refract=(o,{specPath:s=[\"visitors\",\"document\",\"objects\",\"JSONSchema\",\"$visitor\"],plugins:i=[],specificationObj:u=Em}={})=>{const _=(0,Xu.e)(o),w=dereference(u),x=new(Np(s,w))({specObj:w});return visitor_visit(_,x),dispatchPluginsSync(x.element,i,{toolboxCreator:refractor_toolbox,visitorOptions:{keyMap:wm,nodeTypeGetter:traversal_visitor_getNodeType}})},refractor_createRefractor=o=>(s,i={})=>refractor_refract(s,{specPath:o,...i});Kd.refract=refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"JSONSchema\",\"$visitor\"]),Hd.refract=refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"JSONReference\",\"$visitor\"]),Jd.refract=refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Media\",\"$visitor\"]),Gd.refract=refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"LinkDescription\",\"$visitor\"]);const jm=class Schema_Schema extends Kd{constructor(o,s,i){super(o,s,i),this.element=\"schema\",this.classes.push(\"json-schema-draft-4\")}get idProp(){throw new Wd(\"idProp getter in Schema class is not not supported.\")}set idProp(o){throw new Wd(\"idProp setter in Schema class is not not supported.\")}get $schema(){throw new Wd(\"$schema getter in Schema class is not not supported.\")}set $schema(o){throw new Wd(\"$schema setter in Schema class is not not supported.\")}get additionalItems(){return this.get(\"additionalItems\")}set additionalItems(o){this.set(\"additionalItems\",o)}get items(){return this.get(\"items\")}set items(o){this.set(\"items\",o)}get additionalProperties(){return this.get(\"additionalProperties\")}set additionalProperties(o){this.set(\"additionalProperties\",o)}get patternProperties(){throw new Wd(\"patternProperties getter in Schema class is not not supported.\")}set patternProperties(o){throw new Wd(\"patternProperties setter in Schema class is not not supported.\")}get dependencies(){throw new Wd(\"dependencies getter in Schema class is not not supported.\")}set dependencies(o){throw new Wd(\"dependencies setter in Schema class is not not supported.\")}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}get not(){return this.get(\"not\")}set not(o){this.set(\"not\",o)}get definitions(){throw new Wd(\"definitions getter in Schema class is not not supported.\")}set definitions(o){throw new Wd(\"definitions setter in Schema class is not not supported.\")}get base(){throw new Wd(\"base getter in Schema class is not not supported.\")}set base(o){throw new Wd(\"base setter in Schema class is not not supported.\")}get links(){throw new Wd(\"links getter in Schema class is not not supported.\")}set links(o){throw new Wd(\"links setter in Schema class is not not supported.\")}get media(){throw new Wd(\"media getter in Schema class is not not supported.\")}set media(o){throw new Wd(\"media setter in Schema class is not not supported.\")}get nullable(){return this.get(\"nullable\")}set nullable(o){this.set(\"nullable\",o)}get discriminator(){return this.get(\"discriminator\")}set discriminator(o){this.set(\"discriminator\",o)}get writeOnly(){return this.get(\"writeOnly\")}set writeOnly(o){this.set(\"writeOnly\",o)}get xml(){return this.get(\"xml\")}set xml(o){this.set(\"xml\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}get deprecated(){return this.get(\"deprecated\")}set deprecated(o){this.set(\"deprecated\",o)}};class SecurityRequirement extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"securityRequirement\"}}const Pm=SecurityRequirement;class SecurityScheme extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"securityScheme\"}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get in(){return this.get(\"in\")}set in(o){this.set(\"in\",o)}get scheme(){return this.get(\"scheme\")}set scheme(o){this.set(\"scheme\",o)}get bearerFormat(){return this.get(\"bearerFormat\")}set bearerFormat(o){this.set(\"bearerFormat\",o)}get flows(){return this.get(\"flows\")}set flows(o){this.set(\"flows\",o)}get openIdConnectUrl(){return this.get(\"openIdConnectUrl\")}set openIdConnectUrl(o){this.set(\"openIdConnectUrl\",o)}}const Im=SecurityScheme;class Server extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"server\"}get url(){return this.get(\"url\")}set url(o){this.set(\"url\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get variables(){return this.get(\"variables\")}set variables(o){this.set(\"variables\",o)}}const Mm=Server;class ServerVariable extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"serverVariable\"}get enum(){return this.get(\"enum\")}set enum(o){this.set(\"enum\",o)}get default(){return this.get(\"default\")}set default(o){this.set(\"default\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}}const Nm=ServerVariable;class Tag extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"tag\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}}const Tm=Tag;class Xml extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"xml\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get namespace(){return this.get(\"namespace\")}set namespace(o){this.set(\"namespace\",o)}get prefix(){return this.get(\"prefix\")}set prefix(o){this.set(\"prefix\",o)}get attribute(){return this.get(\"attribute\")}set attribute(o){this.set(\"attribute\",o)}get wrapped(){return this.get(\"wrapped\")}set wrapped(o){this.set(\"wrapped\",o)}}const Rm=Xml;const Dm=class visitors_Visitor_Visitor{element;constructor(o={}){Object.assign(this,o)}copyMetaAndAttributes(o,s){(o.meta.length>0||s.meta.length>0)&&(s.meta=deepmerge(s.meta,o.meta),hasElementSourceMap(o)&&s.meta.set(\"sourceMap\",o.meta.get(\"sourceMap\"))),(o.attributes.length>0||o.meta.length>0)&&(s.attributes=deepmerge(s.attributes,o.attributes))}};const Lm=class FallbackVisitor_FallbackVisitor extends Dm{enter(o){return this.element=cloneDeep(o),Yu}};const Bm=class SpecificationVisitor_SpecificationVisitor extends Dm{specObj;passingOptionsNames=[\"specObj\",\"openApiGenericElement\",\"openApiSemanticElement\"];openApiGenericElement;openApiSemanticElement;constructor({specObj:o,passingOptionsNames:s,openApiGenericElement:i,openApiSemanticElement:u,..._}){super({..._}),this.specObj=o,this.openApiGenericElement=i,this.openApiSemanticElement=u,Array.isArray(s)&&(this.passingOptionsNames=s)}retrievePassingOptions(){return _f(this.passingOptionsNames,this)}retrieveFixedFields(o){const s=Np([\"visitors\",...o,\"fixedFields\"],this.specObj);return\"object\"==typeof s&&null!==s?Object.keys(s):[]}retrieveVisitor(o){return Ja(eu,[\"visitors\",...o],this.specObj)?Np([\"visitors\",...o],this.specObj):Np([\"visitors\",...o,\"$visitor\"],this.specObj)}retrieveVisitorInstance(o,s={}){const i=this.retrievePassingOptions();return new(this.retrieveVisitor(o))({...i,...s})}toRefractedElement(o,s,i={}){const u=this.retrieveVisitorInstance(o,i);return u instanceof Lm&&(null==u?void 0:u.constructor)===Lm?cloneDeep(s):(visitor_visit(s,u,i),u.element)}},isReferenceLikeElement=o=>pp(o)&&o.hasKey(\"$ref\"),Fm=pp,qm=pp,isOpenApiExtension=o=>ip(o.key)&&Qh(\"x-\",serializers_value(o.key));const $m=class FixedFieldsVisitor_FixedFieldsVisitor extends Bm{specPath;ignoredFields;canSupportSpecificationExtensions=!0;specificationExtensionPredicate=isOpenApiExtension;constructor({specPath:o,ignoredFields:s,canSupportSpecificationExtensions:i,specificationExtensionPredicate:u,..._}){super({..._}),this.specPath=o,this.ignoredFields=s||[],\"boolean\"==typeof i&&(this.canSupportSpecificationExtensions=i),\"function\"==typeof u&&(this.specificationExtensionPredicate=u)}ObjectElement(o){const s=this.specPath(o),i=this.retrieveFixedFields(s);return o.forEach(((o,u,_)=>{if(ip(u)&&i.includes(serializers_value(u))&&!this.ignoredFields.includes(serializers_value(u))){const i=this.toRefractedElement([...s,\"fixedFields\",serializers_value(u)],o),w=new Xu.Pr(cloneDeep(u),i);this.copyMetaAndAttributes(_,w),w.classes.push(\"fixed-field\"),this.element.content.push(w)}else if(this.canSupportSpecificationExtensions&&this.specificationExtensionPredicate(_)){const o=this.toRefractedElement([\"document\",\"extension\"],_);this.element.content.push(o)}else this.ignoredFields.includes(serializers_value(u))||this.element.content.push(cloneDeep(_))})),this.copyMetaAndAttributes(o,this.element),Yu}};class OpenApi3_0Visitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Td,this.specPath=Ul([\"document\",\"objects\",\"OpenApi\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){return $m.prototype.ObjectElement.call(this,o)}}const Vm=OpenApi3_0Visitor;class OpenapiVisitor extends(Mixin(Bm,Lm)){StringElement(o){const s=new Nd(serializers_value(o));return this.copyMetaAndAttributes(o,s),this.element=s,Yu}}const Um=OpenapiVisitor;const zm=class SpecificationExtensionVisitor extends Bm{MemberElement(o){return this.element=cloneDeep(o),this.element.classes.push(\"specification-extension\"),Yu}};class InfoVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new kd,this.specPath=Ul([\"document\",\"objects\",\"Info\"]),this.canSupportSpecificationExtensions=!0}}const Wm=InfoVisitor;const Km=class VersionVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"api-version\"),this.element.classes.push(\"version\"),s}};class ContactVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new vd,this.specPath=Ul([\"document\",\"objects\",\"Contact\"]),this.canSupportSpecificationExtensions=!0}}const Hm=ContactVisitor;class LicenseVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Od,this.specPath=Ul([\"document\",\"objects\",\"License\"]),this.canSupportSpecificationExtensions=!0}}const Jm=LicenseVisitor;class LinkVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Cd,this.specPath=Ul([\"document\",\"objects\",\"Link\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return(ip(this.element.operationId)||ip(this.element.operationRef))&&this.element.classes.push(\"reference-element\"),s}}const Gm=LinkVisitor;const Ym=class OperationRefVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};const Xm=class OperationIdVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};const Qm=class PatternedFieldsVisitor_PatternedFieldsVisitor extends Bm{specPath;ignoredFields;fieldPatternPredicate=es_F;canSupportSpecificationExtensions=!1;specificationExtensionPredicate=isOpenApiExtension;constructor({specPath:o,ignoredFields:s,fieldPatternPredicate:i,canSupportSpecificationExtensions:u,specificationExtensionPredicate:_,...w}){super({...w}),this.specPath=o,this.ignoredFields=s||[],\"function\"==typeof i&&(this.fieldPatternPredicate=i),\"boolean\"==typeof u&&(this.canSupportSpecificationExtensions=u),\"function\"==typeof _&&(this.specificationExtensionPredicate=_)}ObjectElement(o){return o.forEach(((o,s,i)=>{if(this.canSupportSpecificationExtensions&&this.specificationExtensionPredicate(i)){const o=this.toRefractedElement([\"document\",\"extension\"],i);this.element.content.push(o)}else if(!this.ignoredFields.includes(serializers_value(s))&&this.fieldPatternPredicate(serializers_value(s))){const u=this.specPath(o),_=this.toRefractedElement(u,o),w=new Xu.Pr(cloneDeep(s),_);this.copyMetaAndAttributes(i,w),w.classes.push(\"patterned-field\"),this.element.content.push(w)}else this.ignoredFields.includes(serializers_value(s))||this.element.content.push(cloneDeep(i))})),this.copyMetaAndAttributes(o,this.element),Yu}};const Zm=class MapVisitor_MapVisitor extends Qm{constructor(o){super(o),this.fieldPatternPredicate=Df}};class LinkParameters extends Xu.Sh{static primaryClass=\"link-parameters\";constructor(o,s,i){super(o,s,i),this.classes.push(LinkParameters.primaryClass)}}const eg=LinkParameters;class ParametersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new eg,this.specPath=Ul([\"value\"])}}const rg=ParametersVisitor;class ServerVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Mm,this.specPath=Ul([\"document\",\"objects\",\"Server\"]),this.canSupportSpecificationExtensions=!0}}const ng=ServerVisitor;const og=class UrlVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"server-url\"),s}};class Servers extends Xu.wE{static primaryClass=\"servers\";constructor(o,s,i){super(o,s,i),this.classes.push(Servers.primaryClass)}}const sg=Servers;class ServersVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new sg}ArrayElement(o){return o.forEach((o=>{const s=Fm(o)?[\"document\",\"objects\",\"Server\"]:[\"value\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const lg=ServersVisitor;class ServerVariableVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Nm,this.specPath=Ul([\"document\",\"objects\",\"ServerVariable\"]),this.canSupportSpecificationExtensions=!0}}const pg=ServerVariableVisitor;class ServerVariables extends Xu.Sh{static primaryClass=\"server-variables\";constructor(o,s,i){super(o,s,i),this.classes.push(ServerVariables.primaryClass)}}const fg=ServerVariables;class VariablesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new fg,this.specPath=Ul([\"document\",\"objects\",\"ServerVariable\"])}}const mg=VariablesVisitor;class MediaTypeVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Ad,this.specPath=Ul([\"document\",\"objects\",\"MediaType\"]),this.canSupportSpecificationExtensions=!0}}const gg=MediaTypeVisitor;const yg=class AlternatingVisitor_AlternatingVisitor extends Bm{alternator;constructor({alternator:o,...s}){super({...s}),this.alternator=o||[]}enter(o){const s=this.alternator.map((({predicate:o,specPath:s})=>im(o,Ul(s),zl))),i=ym(s)(o);return this.element=this.toRefractedElement(i,o),Yu}},_g=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof md||o(u)&&s(\"callback\",u)&&i(\"object\",u))),xg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof yd||o(u)&&s(\"components\",u)&&i(\"object\",u))),kg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof vd||o(u)&&s(\"contact\",u)&&i(\"object\",u))),qg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof wd||o(u)&&s(\"example\",u)&&i(\"object\",u))),Vg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Sd||o(u)&&s(\"externalDocumentation\",u)&&i(\"object\",u))),Ug=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof xd||o(u)&&s(\"header\",u)&&i(\"object\",u))),zg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof kd||o(u)&&s(\"info\",u)&&i(\"object\",u))),Wg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Od||o(u)&&s(\"license\",u)&&i(\"object\",u))),Kg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Cd||o(u)&&s(\"link\",u)&&i(\"object\",u))),Yg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Nd||o(u)&&s(\"openapi\",u)&&i(\"string\",u))),Xg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i,hasClass:u})=>_=>_ instanceof Td||o(_)&&s(\"openApi3_0\",_)&&i(\"object\",_)&&u(\"api\",_))),Zg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Rd||o(u)&&s(\"operation\",u)&&i(\"object\",u))),ey=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Dd||o(u)&&s(\"parameter\",u)&&i(\"object\",u))),ty=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Ld||o(u)&&s(\"pathItem\",u)&&i(\"object\",u))),ry=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Bd||o(u)&&s(\"paths\",u)&&i(\"object\",u))),ny=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Fd||o(u)&&s(\"reference\",u)&&i(\"object\",u))),oy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof $d||o(u)&&s(\"requestBody\",u)&&i(\"object\",u))),sy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Vd||o(u)&&s(\"response\",u)&&i(\"object\",u))),iy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Ud||o(u)&&s(\"responses\",u)&&i(\"object\",u))),ay=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof jm||o(u)&&s(\"schema\",u)&&i(\"object\",u))),isBooleanJsonSchemaElement=o=>up(o)&&o.classes.includes(\"boolean-json-schema\"),cy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Pm||o(u)&&s(\"securityRequirement\",u)&&i(\"object\",u))),ly=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Im||o(u)&&s(\"securityScheme\",u)&&i(\"object\",u))),uy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Mm||o(u)&&s(\"server\",u)&&i(\"object\",u))),py=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Nm||o(u)&&s(\"serverVariable\",u)&&i(\"object\",u))),hy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Ad||o(u)&&s(\"mediaType\",u)&&i(\"object\",u))),dy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i,hasClass:u})=>_=>_ instanceof sg||o(_)&&s(\"array\",_)&&i(\"array\",_)&&u(\"servers\",_)));class SchemaVisitor extends(Mixin(yg,Lm)){constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"Schema\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}}const fy=SchemaVisitor;class ExamplesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"examples\"),this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Example\"],this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"example\")})),s}}const my=ExamplesVisitor;class MediaTypeExamples extends Xu.Sh{static primaryClass=\"media-type-examples\";constructor(o,s,i){super(o,s,i),this.classes.push(MediaTypeExamples.primaryClass),this.classes.push(\"examples\")}}const gy=MediaTypeExamples;const yy=class ExamplesVisitor_ExamplesVisitor extends my{constructor(o){super(o),this.element=new gy}};class MediaTypeEncoding extends Xu.Sh{static primaryClass=\"media-type-encoding\";constructor(o,s,i){super(o,s,i),this.classes.push(MediaTypeEncoding.primaryClass)}}const vy=MediaTypeEncoding;class EncodingVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new vy,this.specPath=Ul([\"document\",\"objects\",\"Encoding\"])}}const by=EncodingVisitor;class SecurityRequirementVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Pm,this.specPath=Ul([\"value\"])}}const _y=SecurityRequirementVisitor;class Security extends Xu.wE{static primaryClass=\"security\";constructor(o,s,i){super(o,s,i),this.classes.push(Security.primaryClass)}}const Ey=Security;class SecurityVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new Ey}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"SecurityRequirement\"],o);this.element.push(s)}else this.element.push(cloneDeep(o))})),this.copyMetaAndAttributes(o,this.element),Yu}}const wy=SecurityVisitor;class ComponentsVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new yd,this.specPath=Ul([\"document\",\"objects\",\"Components\"]),this.canSupportSpecificationExtensions=!0}}const Sy=ComponentsVisitor;class TagVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Tm,this.specPath=Ul([\"document\",\"objects\",\"Tag\"]),this.canSupportSpecificationExtensions=!0}}const xy=TagVisitor;class ReferenceVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Fd,this.specPath=Ul([\"document\",\"objects\",\"Reference\"]),this.canSupportSpecificationExtensions=!1}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return ip(this.element.$ref)&&this.element.classes.push(\"reference-element\"),s}}const ky=ReferenceVisitor;const Oy=class $RefVisitor_$RefVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};class ParameterVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Dd,this.specPath=Ul([\"document\",\"objects\",\"Parameter\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return pp(this.element.contentProp)&&this.element.contentProp.filter(hy).forEach(((o,s)=>{o.setMetaProperty(\"media-type\",serializers_value(s))})),s}}const Cy=ParameterVisitor;class SchemaVisitor_SchemaVisitor extends(Mixin(yg,Lm)){constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"Schema\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}}const Ay=SchemaVisitor_SchemaVisitor;class HeaderVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new xd,this.specPath=Ul([\"document\",\"objects\",\"Header\"]),this.canSupportSpecificationExtensions=!0}}const jy=HeaderVisitor;class header_SchemaVisitor_SchemaVisitor extends(Mixin(yg,Lm)){constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"Schema\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}}const Py=header_SchemaVisitor_SchemaVisitor;class HeaderExamples extends Xu.Sh{static primaryClass=\"header-examples\";constructor(o,s,i){super(o,s,i),this.classes.push(HeaderExamples.primaryClass),this.classes.push(\"examples\")}}const Iy=HeaderExamples;const My=class header_ExamplesVisitor_ExamplesVisitor extends my{constructor(o){super(o),this.element=new Iy}};class ContentVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"content\"),this.specPath=Ul([\"document\",\"objects\",\"MediaType\"])}}const Ny=ContentVisitor;class HeaderContent extends Xu.Sh{static primaryClass=\"header-content\";constructor(o,s,i){super(o,s,i),this.classes.push(HeaderContent.primaryClass),this.classes.push(\"content\")}}const Ty=HeaderContent;const Ry=class ContentVisitor_ContentVisitor extends Ny{constructor(o){super(o),this.element=new Ty}};class schema_SchemaVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new jm,this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.canSupportSpecificationExtensions=!0}}const Dy=schema_SchemaVisitor,{allOf:Ly}=Em.visitors.document.objects.JSONSchema.fixedFields;const By=class AllOfVisitor_AllOfVisitor extends Ly{ArrayElement(o){const s=Ly.prototype.ArrayElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}},{anyOf:Fy}=Em.visitors.document.objects.JSONSchema.fixedFields;const qy=class AnyOfVisitor_AnyOfVisitor extends Fy{ArrayElement(o){const s=Fy.prototype.ArrayElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}},{oneOf:$y}=Em.visitors.document.objects.JSONSchema.fixedFields;const Vy=class OneOfVisitor_OneOfVisitor extends $y{ArrayElement(o){const s=$y.prototype.ArrayElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}},{items:Uy}=Em.visitors.document.objects.JSONSchema.fixedFields;const zy=class ItemsVisitor_ItemsVisitor extends Uy{ObjectElement(o){const s=Uy.prototype.ObjectElement.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}ArrayElement(o){return this.enter(o)}},{properties:Wy}=Em.visitors.document.objects.JSONSchema.fixedFields;const Ky=class PropertiesVisitor_PropertiesVisitor extends Wy{ObjectElement(o){const s=Wy.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}},{type:Hy}=Em.visitors.document.objects.JSONSchema.fixedFields;const Jy=class TypeVisitor_TypeVisitor extends Hy{ArrayElement(o){return this.enter(o)}},{JSONSchemaOrJSONReferenceVisitor:Gy}=Em.visitors;const Yy=class SchemaOrReferenceVisitor_SchemaOrReferenceVisitor extends Gy{ObjectElement(o){const s=Gy.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}};class DiscriminatorVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new _d,this.specPath=Ul([\"document\",\"objects\",\"Discriminator\"]),this.canSupportSpecificationExtensions=!1}}const Xy=DiscriminatorVisitor;class DiscriminatorMapping extends Xu.Sh{static primaryClass=\"discriminator-mapping\";constructor(o,s,i){super(o,s,i),this.classes.push(DiscriminatorMapping.primaryClass)}}const Qy=DiscriminatorMapping;class MappingVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Qy,this.specPath=Ul([\"value\"])}}const Zy=MappingVisitor;class XmlVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Rm,this.specPath=Ul([\"document\",\"objects\",\"XML\"]),this.canSupportSpecificationExtensions=!0}}const ev=XmlVisitor;class ParameterExamples extends Xu.Sh{static primaryClass=\"parameter-examples\";constructor(o,s,i){super(o,s,i),this.classes.push(ParameterExamples.primaryClass),this.classes.push(\"examples\")}}const tv=ParameterExamples;const rv=class parameter_ExamplesVisitor_ExamplesVisitor extends my{constructor(o){super(o),this.element=new tv}};class ParameterContent extends Xu.Sh{static primaryClass=\"parameter-content\";constructor(o,s,i){super(o,s,i),this.classes.push(ParameterContent.primaryClass),this.classes.push(\"content\")}}const nv=ParameterContent;const ov=class parameter_ContentVisitor_ContentVisitor extends Ny{constructor(o){super(o),this.element=new nv}};class ComponentsSchemas extends Xu.Sh{static primaryClass=\"components-schemas\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsSchemas.primaryClass)}}const sv=ComponentsSchemas;class SchemasVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new sv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Schema\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}}const iv=SchemasVisitor;class ComponentsResponses extends Xu.Sh{static primaryClass=\"components-responses\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsResponses.primaryClass)}}const av=ComponentsResponses;class ResponsesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new av,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Response\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"response\")})),this.element.filter(sy).forEach(((o,s)=>{o.setMetaProperty(\"http-status-code\",serializers_value(s))})),s}}const cv=ResponsesVisitor;class ComponentsParameters extends Xu.Sh{static primaryClass=\"components-parameters\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsParameters.primaryClass),this.classes.push(\"parameters\")}}const lv=ComponentsParameters;class ParametersVisitor_ParametersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new lv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Parameter\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"parameter\")})),s}}const uv=ParametersVisitor_ParametersVisitor;class ComponentsExamples extends Xu.Sh{static primaryClass=\"components-examples\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsExamples.primaryClass),this.classes.push(\"examples\")}}const pv=ComponentsExamples;class components_ExamplesVisitor_ExamplesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new pv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Example\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"example\")})),s}}const hv=components_ExamplesVisitor_ExamplesVisitor;class ComponentsRequestBodies extends Xu.Sh{static primaryClass=\"components-request-bodies\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsRequestBodies.primaryClass)}}const dv=ComponentsRequestBodies;class RequestBodiesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new dv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"RequestBody\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"requestBody\")})),s}}const fv=RequestBodiesVisitor;class ComponentsHeaders extends Xu.Sh{static primaryClass=\"components-headers\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsHeaders.primaryClass)}}const mv=ComponentsHeaders;class HeadersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new mv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Header\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"header\")})),this.element.filter(Ug).forEach(((o,s)=>{o.setMetaProperty(\"header-name\",serializers_value(s))})),s}}const gv=HeadersVisitor;class ComponentsSecuritySchemes extends Xu.Sh{static primaryClass=\"components-security-schemes\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsSecuritySchemes.primaryClass)}}const yv=ComponentsSecuritySchemes;class SecuritySchemesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new yv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"SecurityScheme\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"securityScheme\")})),s}}const vv=SecuritySchemesVisitor;class ComponentsLinks extends Xu.Sh{static primaryClass=\"components-links\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsLinks.primaryClass)}}const bv=ComponentsLinks;class LinksVisitor_LinksVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new bv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Link\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"link\")})),s}}const _v=LinksVisitor_LinksVisitor;class ComponentsCallbacks extends Xu.Sh{static primaryClass=\"components-callbacks\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsCallbacks.primaryClass)}}const Ev=ComponentsCallbacks;class CallbacksVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Ev,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Callback\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"callback\")})),s}}const wv=CallbacksVisitor;class ExampleVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new wd,this.specPath=Ul([\"document\",\"objects\",\"Example\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return ip(this.element.externalValue)&&this.element.classes.push(\"reference-element\"),s}}const Sv=ExampleVisitor;const xv=class ExternalValueVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};class ExternalDocumentationVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Sd,this.specPath=Ul([\"document\",\"objects\",\"ExternalDocumentation\"]),this.canSupportSpecificationExtensions=!0}}const kv=ExternalDocumentationVisitor;class encoding_EncodingVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Ed,this.specPath=Ul([\"document\",\"objects\",\"Encoding\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return pp(this.element.headers)&&this.element.headers.filter(Ug).forEach(((o,s)=>{o.setMetaProperty(\"header-name\",serializers_value(s))})),s}}const Ov=encoding_EncodingVisitor;class EncodingHeaders extends Xu.Sh{static primaryClass=\"encoding-headers\";constructor(o,s,i){super(o,s,i),this.classes.push(EncodingHeaders.primaryClass)}}const Cv=EncodingHeaders;class HeadersVisitor_HeadersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Cv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Header\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"header\")})),this.element.forEach(((o,s)=>{if(!Ug(o))return;const i=serializers_value(s);o.setMetaProperty(\"headerName\",i)})),s}}const Av=HeadersVisitor_HeadersVisitor;class PathsVisitor extends(Mixin(Qm,Lm)){constructor(o){super(o),this.element=new Bd,this.specPath=Ul([\"document\",\"objects\",\"PathItem\"]),this.canSupportSpecificationExtensions=!0,this.fieldPatternPredicate=es_T}ObjectElement(o){const s=Qm.prototype.ObjectElement.call(this,o);return this.element.filter(ty).forEach(((o,s)=>{s.classes.push(\"openapi-path-template\"),s.classes.push(\"path-template\"),o.setMetaProperty(\"path\",cloneDeep(s))})),s}}const jv=PathsVisitor;class RequestBodyVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new $d,this.specPath=Ul([\"document\",\"objects\",\"RequestBody\"])}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return pp(this.element.contentProp)&&this.element.contentProp.filter(hy).forEach(((o,s)=>{o.setMetaProperty(\"media-type\",serializers_value(s))})),s}}const Pv=RequestBodyVisitor;class RequestBodyContent extends Xu.Sh{static primaryClass=\"request-body-content\";constructor(o,s,i){super(o,s,i),this.classes.push(RequestBodyContent.primaryClass),this.classes.push(\"content\")}}const Iv=RequestBodyContent;const Mv=class request_body_ContentVisitor_ContentVisitor extends Ny{constructor(o){super(o),this.element=new Iv}};class CallbackVisitor extends(Mixin(Qm,Lm)){constructor(o){super(o),this.element=new md,this.specPath=Ul([\"document\",\"objects\",\"PathItem\"]),this.canSupportSpecificationExtensions=!0,this.fieldPatternPredicate=o=>/{(?<expression>[^}]{1,2083})}/.test(String(o))}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ty).forEach(((o,s)=>{o.setMetaProperty(\"runtime-expression\",serializers_value(s))})),s}}const Nv=CallbackVisitor;class ResponseVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Vd,this.specPath=Ul([\"document\",\"objects\",\"Response\"])}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return pp(this.element.contentProp)&&this.element.contentProp.filter(hy).forEach(((o,s)=>{o.setMetaProperty(\"media-type\",serializers_value(s))})),pp(this.element.headers)&&this.element.headers.filter(Ug).forEach(((o,s)=>{o.setMetaProperty(\"header-name\",serializers_value(s))})),s}}const Tv=ResponseVisitor;class ResponseHeaders extends Xu.Sh{static primaryClass=\"response-headers\";constructor(o,s,i){super(o,s,i),this.classes.push(ResponseHeaders.primaryClass)}}const Rv=ResponseHeaders;class response_HeadersVisitor_HeadersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Rv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Header\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"header\")})),this.element.forEach(((o,s)=>{if(!Ug(o))return;const i=serializers_value(s);o.setMetaProperty(\"header-name\",i)})),s}}const Dv=response_HeadersVisitor_HeadersVisitor;class ResponseContent extends Xu.Sh{static primaryClass=\"response-content\";constructor(o,s,i){super(o,s,i),this.classes.push(ResponseContent.primaryClass),this.classes.push(\"content\")}}const Lv=ResponseContent;const Bv=class response_ContentVisitor_ContentVisitor extends Ny{constructor(o){super(o),this.element=new Lv}};class ResponseLinks extends Xu.Sh{static primaryClass=\"response-links\";constructor(o,s,i){super(o,s,i),this.classes.push(ResponseLinks.primaryClass)}}const Fv=ResponseLinks;class response_LinksVisitor_LinksVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Fv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Link\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"link\")})),s}}const qv=response_LinksVisitor_LinksVisitor;function _isNumber(o){return\"[object Number]\"===Object.prototype.toString.call(o)}var $v=_curry2((function range(o,s){if(!_isNumber(o)||!_isNumber(s))throw new TypeError(\"Both arguments to range must be numbers\");for(var i=Array(o<s?s-o:0),u=o<0?s+Math.abs(o):s-o,_=0;_<u;)i[_]=_+o,_+=1;return i}));const Vv=$v;function hasOrAdd(o,s,i){var u,_=typeof o;switch(_){case\"string\":case\"number\":return 0===o&&1/o==-1/0?!!i._items[\"-0\"]||(s&&(i._items[\"-0\"]=!0),!1):null!==i._nativeSet?s?(u=i._nativeSet.size,i._nativeSet.add(o),i._nativeSet.size===u):i._nativeSet.has(o):_ in i._items?o in i._items[_]||(s&&(i._items[_][o]=!0),!1):(s&&(i._items[_]={},i._items[_][o]=!0),!1);case\"boolean\":if(_ in i._items){var w=o?1:0;return!!i._items[_][w]||(s&&(i._items[_][w]=!0),!1)}return s&&(i._items[_]=o?[!1,!0]:[!0,!1]),!1;case\"function\":return null!==i._nativeSet?s?(u=i._nativeSet.size,i._nativeSet.add(o),i._nativeSet.size===u):i._nativeSet.has(o):_ in i._items?!!_includes(o,i._items[_])||(s&&i._items[_].push(o),!1):(s&&(i._items[_]=[o]),!1);case\"undefined\":return!!i._items[_]||(s&&(i._items[_]=!0),!1);case\"object\":if(null===o)return!!i._items.null||(s&&(i._items.null=!0),!1);default:return(_=Object.prototype.toString.call(o))in i._items?!!_includes(o,i._items[_])||(s&&i._items[_].push(o),!1):(s&&(i._items[_]=[o]),!1)}}const Uv=function(){function _Set(){this._nativeSet=\"function\"==typeof Set?new Set:null,this._items={}}return _Set.prototype.add=function(o){return!hasOrAdd(o,!0,this)},_Set.prototype.has=function(o){return hasOrAdd(o,!1,this)},_Set}();var zv=_curry2((function difference(o,s){for(var i=[],u=0,_=o.length,w=s.length,x=new Uv,C=0;C<w;C+=1)x.add(s[C]);for(;u<_;)x.add(o[u])&&(i[i.length]=o[u]),u+=1;return i}));const Wv=zv;class MixedFieldsVisitor extends(Mixin($m,Qm)){specPathFixedFields;specPathPatternedFields;constructor({specPathFixedFields:o,specPathPatternedFields:s,...i}){super({...i}),this.specPathFixedFields=o,this.specPathPatternedFields=s}ObjectElement(o){const{specPath:s,ignoredFields:i}=this;try{this.specPath=this.specPathFixedFields;const s=this.retrieveFixedFields(this.specPath(o));this.ignoredFields=[...i,...Wv(o.keys(),s)],$m.prototype.ObjectElement.call(this,o),this.specPath=this.specPathPatternedFields,this.ignoredFields=s,Qm.prototype.ObjectElement.call(this,o)}catch(o){throw this.specPath=s,o}return Yu}}const Kv=MixedFieldsVisitor;class responses_ResponsesVisitor extends(Mixin(Kv,Lm)){constructor(o){super(o),this.element=new Ud,this.specPathFixedFields=Ul([\"document\",\"objects\",\"Responses\"]),this.canSupportSpecificationExtensions=!0,this.specPathPatternedFields=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Response\"],this.fieldPatternPredicate=o=>new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${Vv(100,600).join(\"|\")})$`).test(String(o))}ObjectElement(o){const s=Kv.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"response\")})),this.element.filter(sy).forEach(((o,s)=>{const i=cloneDeep(s);this.fieldPatternPredicate(serializers_value(i))&&o.setMetaProperty(\"http-status-code\",i)})),s}}const Hv=responses_ResponsesVisitor;class DefaultVisitor extends(Mixin(yg,Lm)){constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"Response\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)?this.element.setMetaProperty(\"referenced-element\",\"response\"):sy(this.element)&&this.element.setMetaProperty(\"http-status-code\",\"default\"),s}}const Jv=DefaultVisitor;class OperationVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Rd,this.specPath=Ul([\"document\",\"objects\",\"Operation\"])}}const Gv=OperationVisitor;class OperationTags extends Xu.wE{static primaryClass=\"operation-tags\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationTags.primaryClass)}}const Yv=OperationTags;const Xv=class TagsVisitor extends Lm{constructor(o){super(o),this.element=new Yv}ArrayElement(o){return this.element=this.element.concat(cloneDeep(o)),Yu}};class OperationParameters extends Xu.wE{static primaryClass=\"operation-parameters\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationParameters.primaryClass),this.classes.push(\"parameters\")}}const Qv=OperationParameters;class open_api_3_0_ParametersVisitor_ParametersVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"parameters\")}ArrayElement(o){return o.forEach((o=>{const s=isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Parameter\"],i=this.toRefractedElement(s,o);ny(i)&&i.setMetaProperty(\"referenced-element\",\"parameter\"),this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const Zv=open_api_3_0_ParametersVisitor_ParametersVisitor;const eb=class operation_ParametersVisitor_ParametersVisitor extends Zv{constructor(o){super(o),this.element=new Qv}};const tb=class RequestBodyVisitor_RequestBodyVisitor extends yg{constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"RequestBody\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"requestBody\"),s}};class OperationCallbacks extends Xu.Sh{static primaryClass=\"operation-callbacks\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationCallbacks.primaryClass)}}const nb=OperationCallbacks;class CallbacksVisitor_CallbacksVisitor extends(Mixin(Zm,Lm)){specPath;constructor(o){super(o),this.element=new nb,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Callback\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"callback\")})),s}}const pb=CallbacksVisitor_CallbacksVisitor;class OperationSecurity extends Xu.wE{static primaryClass=\"operation-security\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationSecurity.primaryClass),this.classes.push(\"security\")}}const mb=OperationSecurity;class SecurityVisitor_SecurityVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new mb}ArrayElement(o){return o.forEach((o=>{const s=pp(o)?[\"document\",\"objects\",\"SecurityRequirement\"]:[\"value\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const yb=SecurityVisitor_SecurityVisitor;class OperationServers extends Xu.wE{static primaryClass=\"operation-servers\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationServers.primaryClass),this.classes.push(\"servers\")}}const _b=OperationServers;const wb=class ServersVisitor_ServersVisitor extends lg{constructor(o){super(o),this.element=new _b}};class PathItemVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Ld,this.specPath=Ul([\"document\",\"objects\",\"PathItem\"])}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return this.element.filter(Zg).forEach(((o,s)=>{const i=cloneDeep(s);i.content=serializers_value(i).toUpperCase(),o.setMetaProperty(\"http-method\",i)})),ip(this.element.$ref)&&this.element.classes.push(\"reference-element\"),s}}const Sb=PathItemVisitor;const Ob=class path_item_$RefVisitor_$RefVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};class PathItemServers extends Xu.wE{static primaryClass=\"path-item-servers\";constructor(o,s,i){super(o,s,i),this.classes.push(PathItemServers.primaryClass),this.classes.push(\"servers\")}}const Ab=PathItemServers;const Pb=class path_item_ServersVisitor_ServersVisitor extends lg{constructor(o){super(o),this.element=new Ab}};class PathItemParameters extends Xu.wE{static primaryClass=\"path-item-parameters\";constructor(o,s,i){super(o,s,i),this.classes.push(PathItemParameters.primaryClass),this.classes.push(\"parameters\")}}const Ib=PathItemParameters;const Mb=class path_item_ParametersVisitor_ParametersVisitor extends Zv{constructor(o){super(o),this.element=new Ib}};class SecuritySchemeVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Im,this.specPath=Ul([\"document\",\"objects\",\"SecurityScheme\"]),this.canSupportSpecificationExtensions=!0}}const Rb=SecuritySchemeVisitor;class OAuthFlowsVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Md,this.specPath=Ul([\"document\",\"objects\",\"OAuthFlows\"]),this.canSupportSpecificationExtensions=!0}}const Lb=OAuthFlowsVisitor;class OAuthFlowVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Id,this.specPath=Ul([\"document\",\"objects\",\"OAuthFlow\"]),this.canSupportSpecificationExtensions=!0}}const qb=OAuthFlowVisitor;class OAuthFlowScopes extends Xu.Sh{static primaryClass=\"oauth-flow-scopes\";constructor(o,s,i){super(o,s,i),this.classes.push(OAuthFlowScopes.primaryClass)}}const zb=OAuthFlowScopes;class ScopesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new zb,this.specPath=Ul([\"value\"])}}const Qb=ScopesVisitor;class Tags extends Xu.wE{static primaryClass=\"tags\";constructor(o,s,i){super(o,s,i),this.classes.push(Tags.primaryClass)}}const e_=Tags;class TagsVisitor_TagsVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new e_}ArrayElement(o){return o.forEach((o=>{const s=qm(o)?[\"document\",\"objects\",\"Tag\"]:[\"value\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const t_=TagsVisitor_TagsVisitor,{fixedFields:r_}=Em.visitors.document.objects.JSONSchema,n_={visitors:{value:Lm,document:{objects:{OpenApi:{$visitor:Vm,fixedFields:{openapi:Um,info:{$ref:\"#/visitors/document/objects/Info\"},servers:lg,paths:{$ref:\"#/visitors/document/objects/Paths\"},components:{$ref:\"#/visitors/document/objects/Components\"},security:wy,tags:t_,externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"}}},Info:{$visitor:Wm,fixedFields:{title:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},termsOfService:{$ref:\"#/visitors/value\"},contact:{$ref:\"#/visitors/document/objects/Contact\"},license:{$ref:\"#/visitors/document/objects/License\"},version:Km}},Contact:{$visitor:Hm,fixedFields:{name:{$ref:\"#/visitors/value\"},url:{$ref:\"#/visitors/value\"},email:{$ref:\"#/visitors/value\"}}},License:{$visitor:Jm,fixedFields:{name:{$ref:\"#/visitors/value\"},url:{$ref:\"#/visitors/value\"}}},Server:{$visitor:ng,fixedFields:{url:og,description:{$ref:\"#/visitors/value\"},variables:mg}},ServerVariable:{$visitor:pg,fixedFields:{enum:{$ref:\"#/visitors/value\"},default:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"}}},Components:{$visitor:Sy,fixedFields:{schemas:iv,responses:cv,parameters:uv,examples:hv,requestBodies:fv,headers:gv,securitySchemes:vv,links:_v,callbacks:wv}},Paths:{$visitor:jv},PathItem:{$visitor:Sb,fixedFields:{$ref:Ob,summary:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},get:{$ref:\"#/visitors/document/objects/Operation\"},put:{$ref:\"#/visitors/document/objects/Operation\"},post:{$ref:\"#/visitors/document/objects/Operation\"},delete:{$ref:\"#/visitors/document/objects/Operation\"},options:{$ref:\"#/visitors/document/objects/Operation\"},head:{$ref:\"#/visitors/document/objects/Operation\"},patch:{$ref:\"#/visitors/document/objects/Operation\"},trace:{$ref:\"#/visitors/document/objects/Operation\"},servers:Pb,parameters:Mb}},Operation:{$visitor:Gv,fixedFields:{tags:Xv,summary:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"},operationId:{$ref:\"#/visitors/value\"},parameters:eb,requestBody:tb,responses:{$ref:\"#/visitors/document/objects/Responses\"},callbacks:pb,deprecated:{$ref:\"#/visitors/value\"},security:yb,servers:wb}},ExternalDocumentation:{$visitor:kv,fixedFields:{description:{$ref:\"#/visitors/value\"},url:{$ref:\"#/visitors/value\"}}},Parameter:{$visitor:Cy,fixedFields:{name:{$ref:\"#/visitors/value\"},in:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},required:{$ref:\"#/visitors/value\"},deprecated:{$ref:\"#/visitors/value\"},allowEmptyValue:{$ref:\"#/visitors/value\"},style:{$ref:\"#/visitors/value\"},explode:{$ref:\"#/visitors/value\"},allowReserved:{$ref:\"#/visitors/value\"},schema:Ay,example:{$ref:\"#/visitors/value\"},examples:rv,content:ov}},RequestBody:{$visitor:Pv,fixedFields:{description:{$ref:\"#/visitors/value\"},content:Mv,required:{$ref:\"#/visitors/value\"}}},MediaType:{$visitor:gg,fixedFields:{schema:fy,example:{$ref:\"#/visitors/value\"},examples:yy,encoding:by}},Encoding:{$visitor:Ov,fixedFields:{contentType:{$ref:\"#/visitors/value\"},headers:Av,style:{$ref:\"#/visitors/value\"},explode:{$ref:\"#/visitors/value\"},allowReserved:{$ref:\"#/visitors/value\"}}},Responses:{$visitor:Hv,fixedFields:{default:Jv}},Response:{$visitor:Tv,fixedFields:{description:{$ref:\"#/visitors/value\"},headers:Dv,content:Bv,links:qv}},Callback:{$visitor:Nv},Example:{$visitor:Sv,fixedFields:{summary:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},value:{$ref:\"#/visitors/value\"},externalValue:xv}},Link:{$visitor:Gm,fixedFields:{operationRef:Ym,operationId:Xm,parameters:rg,requestBody:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},server:{$ref:\"#/visitors/document/objects/Server\"}}},Header:{$visitor:jy,fixedFields:{description:{$ref:\"#/visitors/value\"},required:{$ref:\"#/visitors/value\"},deprecated:{$ref:\"#/visitors/value\"},allowEmptyValue:{$ref:\"#/visitors/value\"},style:{$ref:\"#/visitors/value\"},explode:{$ref:\"#/visitors/value\"},allowReserved:{$ref:\"#/visitors/value\"},schema:Py,example:{$ref:\"#/visitors/value\"},examples:My,content:Ry}},Tag:{$visitor:xy,fixedFields:{name:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"}}},Reference:{$visitor:ky,fixedFields:{$ref:Oy}},JSONSchema:{$ref:\"#/visitors/document/objects/Schema\"},JSONReference:{$ref:\"#/visitors/document/objects/Reference\"},Schema:{$visitor:Dy,fixedFields:{title:r_.title,multipleOf:r_.multipleOf,maximum:r_.maximum,exclusiveMaximum:r_.exclusiveMaximum,minimum:r_.minimum,exclusiveMinimum:r_.exclusiveMinimum,maxLength:r_.maxLength,minLength:r_.minLength,pattern:r_.pattern,maxItems:r_.maxItems,minItems:r_.minItems,uniqueItems:r_.uniqueItems,maxProperties:r_.maxProperties,minProperties:r_.minProperties,required:r_.required,enum:r_.enum,type:Jy,allOf:By,anyOf:qy,oneOf:Vy,not:Yy,items:zy,properties:Ky,additionalProperties:Yy,description:r_.description,format:r_.format,default:r_.default,nullable:{$ref:\"#/visitors/value\"},discriminator:{$ref:\"#/visitors/document/objects/Discriminator\"},writeOnly:{$ref:\"#/visitors/value\"},xml:{$ref:\"#/visitors/document/objects/XML\"},externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"},example:{$ref:\"#/visitors/value\"},deprecated:{$ref:\"#/visitors/value\"}}},Discriminator:{$visitor:Xy,fixedFields:{propertyName:{$ref:\"#/visitors/value\"},mapping:Zy}},XML:{$visitor:ev,fixedFields:{name:{$ref:\"#/visitors/value\"},namespace:{$ref:\"#/visitors/value\"},prefix:{$ref:\"#/visitors/value\"},attribute:{$ref:\"#/visitors/value\"},wrapped:{$ref:\"#/visitors/value\"}}},SecurityScheme:{$visitor:Rb,fixedFields:{type:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},name:{$ref:\"#/visitors/value\"},in:{$ref:\"#/visitors/value\"},scheme:{$ref:\"#/visitors/value\"},bearerFormat:{$ref:\"#/visitors/value\"},flows:{$ref:\"#/visitors/document/objects/OAuthFlows\"},openIdConnectUrl:{$ref:\"#/visitors/value\"}}},OAuthFlows:{$visitor:Lb,fixedFields:{implicit:{$ref:\"#/visitors/document/objects/OAuthFlow\"},password:{$ref:\"#/visitors/document/objects/OAuthFlow\"},clientCredentials:{$ref:\"#/visitors/document/objects/OAuthFlow\"},authorizationCode:{$ref:\"#/visitors/document/objects/OAuthFlow\"}}},OAuthFlow:{$visitor:qb,fixedFields:{authorizationUrl:{$ref:\"#/visitors/value\"},tokenUrl:{$ref:\"#/visitors/value\"},refreshUrl:{$ref:\"#/visitors/value\"},scopes:Qb}},SecurityRequirement:{$visitor:_y}},extension:{$visitor:zm}}}},es_traversal_visitor_getNodeType=o=>{if(sp(o))return`${o.element.charAt(0).toUpperCase()+o.element.slice(1)}Element`},o_={CallbackElement:[\"content\"],ComponentsElement:[\"content\"],ContactElement:[\"content\"],DiscriminatorElement:[\"content\"],Encoding:[\"content\"],Example:[\"content\"],ExternalDocumentationElement:[\"content\"],HeaderElement:[\"content\"],InfoElement:[\"content\"],LicenseElement:[\"content\"],MediaTypeElement:[\"content\"],OAuthFlowElement:[\"content\"],OAuthFlowsElement:[\"content\"],OpenApi3_0Element:[\"content\"],OperationElement:[\"content\"],ParameterElement:[\"content\"],PathItemElement:[\"content\"],PathsElement:[\"content\"],ReferenceElement:[\"content\"],RequestBodyElement:[\"content\"],ResponseElement:[\"content\"],ResponsesElement:[\"content\"],SchemaElement:[\"content\"],SecurityRequirementElement:[\"content\"],SecuritySchemeElement:[\"content\"],ServerElement:[\"content\"],ServerVariableElement:[\"content\"],TagElement:[\"content\"],...xp},s_={namespace:o=>{const{base:s}=o;return s.register(\"callback\",md),s.register(\"components\",yd),s.register(\"contact\",vd),s.register(\"discriminator\",_d),s.register(\"encoding\",Ed),s.register(\"example\",wd),s.register(\"externalDocumentation\",Sd),s.register(\"header\",xd),s.register(\"info\",kd),s.register(\"license\",Od),s.register(\"link\",Cd),s.register(\"mediaType\",Ad),s.register(\"oAuthFlow\",Id),s.register(\"oAuthFlows\",Md),s.register(\"openapi\",Nd),s.register(\"openApi3_0\",Td),s.register(\"operation\",Rd),s.register(\"parameter\",Dd),s.register(\"pathItem\",Ld),s.register(\"paths\",Bd),s.register(\"reference\",Fd),s.register(\"requestBody\",$d),s.register(\"response\",Vd),s.register(\"responses\",Ud),s.register(\"schema\",jm),s.register(\"securityRequirement\",Pm),s.register(\"securityScheme\",Im),s.register(\"server\",Mm),s.register(\"serverVariable\",Nm),s.register(\"tag\",Tm),s.register(\"xml\",Rm),s}},i_=s_,es_refractor_toolbox=()=>{const o=createNamespace(i_);return{predicates:{...pe,isElement:sp,isStringElement:ip,isArrayElement:hp,isObjectElement:pp,isMemberElement:dp,includesClasses,hasElementSourceMap},namespace:o}},es_refractor_refract=(o,{specPath:s=[\"visitors\",\"document\",\"objects\",\"OpenApi\",\"$visitor\"],plugins:i=[]}={})=>{const u=(0,Xu.e)(o),_=dereference(n_),w=new(Np(s,_))({specObj:_});return visitor_visit(u,w),dispatchPluginsSync(w.element,i,{toolboxCreator:es_refractor_toolbox,visitorOptions:{keyMap:o_,nodeTypeGetter:es_traversal_visitor_getNodeType}})},es_refractor_createRefractor=o=>(s,i={})=>es_refractor_refract(s,{specPath:o,...i});md.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Callback\",\"$visitor\"]),yd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Components\",\"$visitor\"]),vd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Contact\",\"$visitor\"]),wd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Example\",\"$visitor\"]),_d.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Discriminator\",\"$visitor\"]),Ed.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Encoding\",\"$visitor\"]),Sd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"ExternalDocumentation\",\"$visitor\"]),xd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Header\",\"$visitor\"]),kd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Info\",\"$visitor\"]),Od.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"License\",\"$visitor\"]),Cd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Link\",\"$visitor\"]),Ad.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"MediaType\",\"$visitor\"]),Id.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OAuthFlow\",\"$visitor\"]),Md.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OAuthFlows\",\"$visitor\"]),Nd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"fixedFields\",\"openapi\"]),Td.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"$visitor\"]),Rd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Operation\",\"$visitor\"]),Dd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Parameter\",\"$visitor\"]),Ld.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"PathItem\",\"$visitor\"]),Bd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Paths\",\"$visitor\"]),Fd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Reference\",\"$visitor\"]),$d.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"RequestBody\",\"$visitor\"]),Vd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Response\",\"$visitor\"]),Ud.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Responses\",\"$visitor\"]),jm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Schema\",\"$visitor\"]),Pm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"SecurityRequirement\",\"$visitor\"]),Im.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"SecurityScheme\",\"$visitor\"]),Mm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Server\",\"$visitor\"]),Nm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"ServerVariable\",\"$visitor\"]),Tm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Tag\",\"$visitor\"]),Rm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"XML\",\"$visitor\"]);const a_=class Callback_Callback extends md{};const c_=class Components_Components extends yd{get pathItems(){return this.get(\"pathItems\")}set pathItems(o){this.set(\"pathItems\",o)}};const l_=class Contact_Contact extends vd{};const u_=class Discriminator_Discriminator extends _d{};const p_=class Encoding_Encoding extends Ed{};const h_=class Example_Example extends wd{};const d_=class ExternalDocumentation_ExternalDocumentation extends Sd{};const f_=class Header_Header extends xd{get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}};const m_=class Info_Info extends kd{get license(){return this.get(\"license\")}set license(o){this.set(\"license\",o)}get summary(){return this.get(\"summary\")}set summary(o){this.set(\"summary\",o)}};class JsonSchemaDialect extends Xu.Om{static default=new JsonSchemaDialect(\"https://spec.openapis.org/oas/3.1/dialect/base\");constructor(o,s,i){super(o,s,i),this.element=\"jsonSchemaDialect\"}}const g_=JsonSchemaDialect;const y_=class License_License extends Od{get identifier(){return this.get(\"identifier\")}set identifier(o){this.set(\"identifier\",o)}};const v_=class Link_Link extends Cd{};const b_=class MediaType_MediaType extends Ad{get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}};const E_=class OAuthFlow_OAuthFlow extends Id{};const w_=class OAuthFlows_OAuthFlows extends Md{};const S_=class Openapi_Openapi extends Nd{};class OpenApi3_1 extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"openApi3_1\",this.classes.push(\"api\")}get openapi(){return this.get(\"openapi\")}set openapi(o){this.set(\"openapi\",o)}get info(){return this.get(\"info\")}set info(o){this.set(\"info\",o)}get jsonSchemaDialect(){return this.get(\"jsonSchemaDialect\")}set jsonSchemaDialect(o){this.set(\"jsonSchemaDialect\",o)}get servers(){return this.get(\"servers\")}set servers(o){this.set(\"servers\",o)}get paths(){return this.get(\"paths\")}set paths(o){this.set(\"paths\",o)}get components(){return this.get(\"components\")}set components(o){this.set(\"components\",o)}get security(){return this.get(\"security\")}set security(o){this.set(\"security\",o)}get tags(){return this.get(\"tags\")}set tags(o){this.set(\"tags\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}get webhooks(){return this.get(\"webhooks\")}set webhooks(o){this.set(\"webhooks\",o)}}const x_=OpenApi3_1;const k_=class Operation_Operation extends Rd{get requestBody(){return this.get(\"requestBody\")}set requestBody(o){this.set(\"requestBody\",o)}};const O_=class Parameter_Parameter extends Dd{get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}};const C_=class PathItem_PathItem extends Ld{get GET(){return this.get(\"get\")}set GET(o){this.set(\"GET\",o)}get PUT(){return this.get(\"put\")}set PUT(o){this.set(\"PUT\",o)}get POST(){return this.get(\"post\")}set POST(o){this.set(\"POST\",o)}get DELETE(){return this.get(\"delete\")}set DELETE(o){this.set(\"DELETE\",o)}get OPTIONS(){return this.get(\"options\")}set OPTIONS(o){this.set(\"OPTIONS\",o)}get HEAD(){return this.get(\"head\")}set HEAD(o){this.set(\"HEAD\",o)}get PATCH(){return this.get(\"patch\")}set PATCH(o){this.set(\"PATCH\",o)}get TRACE(){return this.get(\"trace\")}set TRACE(o){this.set(\"TRACE\",o)}};const A_=class Paths_Paths extends Bd{};class Reference_Reference extends Fd{}Object.defineProperty(Reference_Reference.prototype,\"description\",{get(){return this.get(\"description\")},set(o){this.set(\"description\",o)},enumerable:!0}),Object.defineProperty(Reference_Reference.prototype,\"summary\",{get(){return this.get(\"summary\")},set(o){this.set(\"summary\",o)},enumerable:!0});const j_=Reference_Reference;const P_=class RequestBody_RequestBody extends $d{};const I_=class elements_Response_Response extends Vd{};const M_=class Responses_Responses extends Ud{};class elements_Schema_Schema extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"schema\"}get $schema(){return this.get(\"$schema\")}set $schema(o){this.set(\"$schema\",o)}get $vocabulary(){return this.get(\"$vocabulary\")}set $vocabulary(o){this.set(\"$vocabulary\",o)}get $id(){return this.get(\"$id\")}set $id(o){this.set(\"$id\",o)}get $anchor(){return this.get(\"$anchor\")}set $anchor(o){this.set(\"$anchor\",o)}get $dynamicAnchor(){return this.get(\"$dynamicAnchor\")}set $dynamicAnchor(o){this.set(\"$dynamicAnchor\",o)}get $dynamicRef(){return this.get(\"$dynamicRef\")}set $dynamicRef(o){this.set(\"$dynamicRef\",o)}get $ref(){return this.get(\"$ref\")}set $ref(o){this.set(\"$ref\",o)}get $defs(){return this.get(\"$defs\")}set $defs(o){this.set(\"$defs\",o)}get $comment(){return this.get(\"$comment\")}set $comment(o){this.set(\"$comment\",o)}get allOf(){return this.get(\"allOf\")}set allOf(o){this.set(\"allOf\",o)}get anyOf(){return this.get(\"anyOf\")}set anyOf(o){this.set(\"anyOf\",o)}get oneOf(){return this.get(\"oneOf\")}set oneOf(o){this.set(\"oneOf\",o)}get not(){return this.get(\"not\")}set not(o){this.set(\"not\",o)}get if(){return this.get(\"if\")}set if(o){this.set(\"if\",o)}get then(){return this.get(\"then\")}set then(o){this.set(\"then\",o)}get else(){return this.get(\"else\")}set else(o){this.set(\"else\",o)}get dependentSchemas(){return this.get(\"dependentSchemas\")}set dependentSchemas(o){this.set(\"dependentSchemas\",o)}get prefixItems(){return this.get(\"prefixItems\")}set prefixItems(o){this.set(\"prefixItems\",o)}get items(){return this.get(\"items\")}set items(o){this.set(\"items\",o)}get containsProp(){return this.get(\"contains\")}set containsProp(o){this.set(\"contains\",o)}get properties(){return this.get(\"properties\")}set properties(o){this.set(\"properties\",o)}get patternProperties(){return this.get(\"patternProperties\")}set patternProperties(o){this.set(\"patternProperties\",o)}get additionalProperties(){return this.get(\"additionalProperties\")}set additionalProperties(o){this.set(\"additionalProperties\",o)}get propertyNames(){return this.get(\"propertyNames\")}set propertyNames(o){this.set(\"propertyNames\",o)}get unevaluatedItems(){return this.get(\"unevaluatedItems\")}set unevaluatedItems(o){this.set(\"unevaluatedItems\",o)}get unevaluatedProperties(){return this.get(\"unevaluatedProperties\")}set unevaluatedProperties(o){this.set(\"unevaluatedProperties\",o)}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}get enum(){return this.get(\"enum\")}set enum(o){this.set(\"enum\",o)}get const(){return this.get(\"const\")}set const(o){this.set(\"const\",o)}get multipleOf(){return this.get(\"multipleOf\")}set multipleOf(o){this.set(\"multipleOf\",o)}get maximum(){return this.get(\"maximum\")}set maximum(o){this.set(\"maximum\",o)}get exclusiveMaximum(){return this.get(\"exclusiveMaximum\")}set exclusiveMaximum(o){this.set(\"exclusiveMaximum\",o)}get minimum(){return this.get(\"minimum\")}set minimum(o){this.set(\"minimum\",o)}get exclusiveMinimum(){return this.get(\"exclusiveMinimum\")}set exclusiveMinimum(o){this.set(\"exclusiveMinimum\",o)}get maxLength(){return this.get(\"maxLength\")}set maxLength(o){this.set(\"maxLength\",o)}get minLength(){return this.get(\"minLength\")}set minLength(o){this.set(\"minLength\",o)}get pattern(){return this.get(\"pattern\")}set pattern(o){this.set(\"pattern\",o)}get maxItems(){return this.get(\"maxItems\")}set maxItems(o){this.set(\"maxItems\",o)}get minItems(){return this.get(\"minItems\")}set minItems(o){this.set(\"minItems\",o)}get uniqueItems(){return this.get(\"uniqueItems\")}set uniqueItems(o){this.set(\"uniqueItems\",o)}get maxContains(){return this.get(\"maxContains\")}set maxContains(o){this.set(\"maxContains\",o)}get minContains(){return this.get(\"minContains\")}set minContains(o){this.set(\"minContains\",o)}get maxProperties(){return this.get(\"maxProperties\")}set maxProperties(o){this.set(\"maxProperties\",o)}get minProperties(){return this.get(\"minProperties\")}set minProperties(o){this.set(\"minProperties\",o)}get required(){return this.get(\"required\")}set required(o){this.set(\"required\",o)}get dependentRequired(){return this.get(\"dependentRequired\")}set dependentRequired(o){this.set(\"dependentRequired\",o)}get title(){return this.get(\"title\")}set title(o){this.set(\"title\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get default(){return this.get(\"default\")}set default(o){this.set(\"default\",o)}get deprecated(){return this.get(\"deprecated\")}set deprecated(o){this.set(\"deprecated\",o)}get readOnly(){return this.get(\"readOnly\")}set readOnly(o){this.set(\"readOnly\",o)}get writeOnly(){return this.get(\"writeOnly\")}set writeOnly(o){this.set(\"writeOnly\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get format(){return this.get(\"format\")}set format(o){this.set(\"format\",o)}get contentEncoding(){return this.get(\"contentEncoding\")}set contentEncoding(o){this.set(\"contentEncoding\",o)}get contentMediaType(){return this.get(\"contentMediaType\")}set contentMediaType(o){this.set(\"contentMediaType\",o)}get contentSchema(){return this.get(\"contentSchema\")}set contentSchema(o){this.set(\"contentSchema\",o)}get discriminator(){return this.get(\"discriminator\")}set discriminator(o){this.set(\"discriminator\",o)}get xml(){return this.get(\"xml\")}set xml(o){this.set(\"xml\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}}const N_=elements_Schema_Schema;const T_=class SecurityRequirement_SecurityRequirement extends Pm{};const R_=class SecurityScheme_SecurityScheme extends Im{};const D_=class Server_Server extends Mm{};const L_=class ServerVariable_ServerVariable extends Nm{};const B_=class Tag_Tag extends Tm{};const F_=class Xml_Xml extends Rm{};class OpenApi3_1Visitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new x_,this.specPath=Ul([\"document\",\"objects\",\"OpenApi\"]),this.canSupportSpecificationExtensions=!0,this.openApiSemanticElement=this.element}ObjectElement(o){return this.openApiGenericElement=o,$m.prototype.ObjectElement.call(this,o)}}const q_=OpenApi3_1Visitor,{visitors:{document:{objects:{Info:{$visitor:$_}}}}}=n_;const V_=class info_InfoVisitor extends $_{constructor(o){super(o),this.element=new m_}},{visitors:{document:{objects:{Contact:{$visitor:U_}}}}}=n_;const z_=class contact_ContactVisitor extends U_{constructor(o){super(o),this.element=new l_}},{visitors:{document:{objects:{License:{$visitor:W_}}}}}=n_;const K_=class license_LicenseVisitor extends W_{constructor(o){super(o),this.element=new y_}},{visitors:{document:{objects:{Link:{$visitor:H_}}}}}=n_;const J_=class link_LinkVisitor extends H_{constructor(o){super(o),this.element=new v_}};class JsonSchemaDialectVisitor extends(Mixin(Bm,Lm)){StringElement(o){const s=new g_(serializers_value(o));return this.copyMetaAndAttributes(o,s),this.element=s,Yu}}const G_=JsonSchemaDialectVisitor,{visitors:{document:{objects:{Server:{$visitor:Y_}}}}}=n_;const X_=class server_ServerVisitor extends Y_{constructor(o){super(o),this.element=new D_}},{visitors:{document:{objects:{ServerVariable:{$visitor:Q_}}}}}=n_;const Z_=class server_variable_ServerVariableVisitor extends Q_{constructor(o){super(o),this.element=new L_}},{visitors:{document:{objects:{MediaType:{$visitor:eE}}}}}=n_;const tE=class media_type_MediaTypeVisitor extends eE{constructor(o){super(o),this.element=new b_}},{visitors:{document:{objects:{SecurityRequirement:{$visitor:rE}}}}}=n_;const nE=class security_requirement_SecurityRequirementVisitor extends rE{constructor(o){super(o),this.element=new T_}},{visitors:{document:{objects:{Components:{$visitor:oE}}}}}=n_;const sE=class components_ComponentsVisitor extends oE{constructor(o){super(o),this.element=new c_}},{visitors:{document:{objects:{Tag:{$visitor:iE}}}}}=n_;const aE=class tag_TagVisitor extends iE{constructor(o){super(o),this.element=new B_}},{visitors:{document:{objects:{Reference:{$visitor:cE}}}}}=n_;const lE=class reference_ReferenceVisitor extends cE{constructor(o){super(o),this.element=new j_}},{visitors:{document:{objects:{Parameter:{$visitor:uE}}}}}=n_;const pE=class parameter_ParameterVisitor extends uE{constructor(o){super(o),this.element=new O_}},{visitors:{document:{objects:{Header:{$visitor:hE}}}}}=n_;const dE=class header_HeaderVisitor extends hE{constructor(o){super(o),this.element=new f_}},fE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof a_||o(u)&&s(\"callback\",u)&&i(\"object\",u))),mE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof c_||o(u)&&s(\"components\",u)&&i(\"object\",u))),gE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof l_||o(u)&&s(\"contact\",u)&&i(\"object\",u))),yE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof h_||o(u)&&s(\"example\",u)&&i(\"object\",u))),vE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof d_||o(u)&&s(\"externalDocumentation\",u)&&i(\"object\",u))),bE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof f_||o(u)&&s(\"header\",u)&&i(\"object\",u))),_E=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof m_||o(u)&&s(\"info\",u)&&i(\"object\",u))),EE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof g_||o(u)&&s(\"jsonSchemaDialect\",u)&&i(\"string\",u))),wE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof y_||o(u)&&s(\"license\",u)&&i(\"object\",u))),SE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof v_||o(u)&&s(\"link\",u)&&i(\"object\",u))),xE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof S_||o(u)&&s(\"openapi\",u)&&i(\"string\",u))),kE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i,hasClass:u})=>_=>_ instanceof x_||o(_)&&s(\"openApi3_1\",_)&&i(\"object\",_)&&u(\"api\",_))),OE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof k_||o(u)&&s(\"operation\",u)&&i(\"object\",u))),CE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof O_||o(u)&&s(\"parameter\",u)&&i(\"object\",u))),AE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof C_||o(u)&&s(\"pathItem\",u)&&i(\"object\",u))),isPathItemElementExternal=o=>{if(!AE(o))return!1;if(!ip(o.$ref))return!1;const s=serializers_value(o.$ref);return\"string\"==typeof s&&s.length>0&&!s.startsWith(\"#\")},jE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof A_||o(u)&&s(\"paths\",u)&&i(\"object\",u))),PE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof j_||o(u)&&s(\"reference\",u)&&i(\"object\",u))),isReferenceElementExternal=o=>{if(!PE(o))return!1;if(!ip(o.$ref))return!1;const s=serializers_value(o.$ref);return\"string\"==typeof s&&s.length>0&&!s.startsWith(\"#\")},IE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof P_||o(u)&&s(\"requestBody\",u)&&i(\"object\",u))),ME=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof I_||o(u)&&s(\"response\",u)&&i(\"object\",u))),NE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof M_||o(u)&&s(\"responses\",u)&&i(\"object\",u))),TE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof N_||o(u)&&s(\"schema\",u)&&i(\"object\",u))),predicates_isBooleanJsonSchemaElement=o=>up(o)&&o.classes.includes(\"boolean-json-schema\"),RE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof T_||o(u)&&s(\"securityRequirement\",u)&&i(\"object\",u))),DE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof R_||o(u)&&s(\"securityScheme\",u)&&i(\"object\",u))),LE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof D_||o(u)&&s(\"server\",u)&&i(\"object\",u))),BE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof L_||o(u)&&s(\"serverVariable\",u)&&i(\"object\",u))),FE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof b_||o(u)&&s(\"mediaType\",u)&&i(\"object\",u)));const qE=class ParentSchemaAwareVisitor_ParentSchemaAwareVisitor{parent;constructor({parent:o}){this.parent=o}};class open_api_3_1_schema_SchemaVisitor extends(Mixin($m,qE,Lm)){constructor(o){super(o),this.element=new N_,this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.canSupportSpecificationExtensions=!0,this.jsonSchemaDefaultDialect=g_.default,this.passingOptionsNames.push(\"parent\")}ObjectElement(o){this.handle$schema(o),this.handle$id(o),this.parent=this.element;const s=$m.prototype.ObjectElement.call(this,o);return ip(this.element.$ref)&&(this.element.classes.push(\"reference-element\"),this.element.setMetaProperty(\"referenced-element\",\"schema\")),s}BooleanElement(o){const s=super.enter(o);return this.element.classes.push(\"boolean-json-schema\"),s}getJsonSchemaDialect(){let o;return o=void 0!==this.openApiSemanticElement&&EE(this.openApiSemanticElement.jsonSchemaDialect)?serializers_value(this.openApiSemanticElement.jsonSchemaDialect):void 0!==this.openApiGenericElement&&ip(this.openApiGenericElement.get(\"jsonSchemaDialect\"))?serializers_value(this.openApiGenericElement.get(\"jsonSchemaDialect\")):serializers_value(this.jsonSchemaDefaultDialect),o}handle$schema(o){if(Wl(this.parent)&&!ip(o.get(\"$schema\")))this.element.setMetaProperty(\"inherited$schema\",this.getJsonSchemaDialect());else if(TE(this.parent)&&!ip(o.get(\"$schema\"))){const o=Qc(serializers_value(this.parent.meta.get(\"inherited$schema\")),serializers_value(this.parent.$schema));this.element.setMetaProperty(\"inherited$schema\",o)}}handle$id(o){const s=void 0!==this.parent?cloneDeep(this.parent.getMetaProperty(\"inherited$id\",[])):new Xu.wE,i=serializers_value(o.get(\"$id\"));Df(i)&&s.push(i),this.element.setMetaProperty(\"inherited$id\",s)}}const $E=open_api_3_1_schema_SchemaVisitor;const VE=class $vocabularyVisitor extends Lm{ObjectElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-$vocabulary\"),s}};const UE=class $refVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};class $defsVisitor extends(Mixin(Zm,qE,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-$defs\"),this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.passingOptionsNames.push(\"parent\")}}const zE=$defsVisitor;class schema_AllOfVisitor_AllOfVisitor extends(Mixin(Bm,qE,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-allOf\"),this.passingOptionsNames.push(\"parent\")}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"Schema\"],o);this.element.push(s)}else{const s=cloneDeep(o);this.element.push(s)}})),this.copyMetaAndAttributes(o,this.element),Yu}}const WE=schema_AllOfVisitor_AllOfVisitor;class schema_AnyOfVisitor_AnyOfVisitor extends(Mixin(Bm,qE,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-anyOf\"),this.passingOptionsNames.push(\"parent\")}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"Schema\"],o);this.element.push(s)}else{const s=cloneDeep(o);this.element.push(s)}})),this.copyMetaAndAttributes(o,this.element),Yu}}const KE=schema_AnyOfVisitor_AnyOfVisitor;class schema_OneOfVisitor_OneOfVisitor extends(Mixin(Bm,qE,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-oneOf\"),this.passingOptionsNames.push(\"parent\")}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"Schema\"],o);this.element.push(s)}else{const s=cloneDeep(o);this.element.push(s)}})),this.copyMetaAndAttributes(o,this.element),Yu}}const HE=schema_OneOfVisitor_OneOfVisitor;class DependentSchemasVisitor extends(Mixin(Zm,qE,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-dependentSchemas\"),this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.passingOptionsNames.push(\"parent\")}}const JE=DependentSchemasVisitor;class PrefixItemsVisitor extends(Mixin(Bm,qE,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-prefixItems\"),this.passingOptionsNames.push(\"parent\")}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"Schema\"],o);this.element.push(s)}else{const s=cloneDeep(o);this.element.push(s)}})),this.copyMetaAndAttributes(o,this.element),Yu}}const GE=PrefixItemsVisitor;class schema_PropertiesVisitor_PropertiesVisitor extends(Mixin(Zm,qE,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-properties\"),this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.passingOptionsNames.push(\"parent\")}}const YE=schema_PropertiesVisitor_PropertiesVisitor;class PatternPropertiesVisitor_PatternPropertiesVisitor extends(Mixin(Zm,qE,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-patternProperties\"),this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.passingOptionsNames.push(\"parent\")}}const XE=PatternPropertiesVisitor_PatternPropertiesVisitor;const QE=class schema_TypeVisitor_TypeVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-type\"),s}ArrayElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-type\"),s}};const ZE=class EnumVisitor_EnumVisitor extends Lm{ArrayElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-enum\"),s}};const ew=class DependentRequiredVisitor extends Lm{ObjectElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-dependentRequired\"),s}};const tw=class schema_ExamplesVisitor_ExamplesVisitor extends Lm{ArrayElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-examples\"),s}},{visitors:{document:{objects:{Discriminator:{$visitor:rw}}}}}=n_;const nw=class distriminator_DiscriminatorVisitor extends rw{constructor(o){super(o),this.element=new u_,this.canSupportSpecificationExtensions=!0}},{visitors:{document:{objects:{XML:{$visitor:ow}}}}}=n_;const sw=class xml_XmlVisitor extends ow{constructor(o){super(o),this.element=new F_}};class SchemasVisitor_SchemasVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new sv,this.specPath=Ul([\"document\",\"objects\",\"Schema\"])}}const iw=SchemasVisitor_SchemasVisitor;class ComponentsPathItems extends Xu.Sh{static primaryClass=\"components-path-items\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsPathItems.primaryClass)}}const aw=ComponentsPathItems;class PathItemsVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new aw,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"PathItem\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(PE).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"pathItem\")})),s}}const cw=PathItemsVisitor,{visitors:{document:{objects:{Example:{$visitor:lw}}}}}=n_;const uw=class example_ExampleVisitor extends lw{constructor(o){super(o),this.element=new h_}},{visitors:{document:{objects:{ExternalDocumentation:{$visitor:pw}}}}}=n_;const hw=class external_documentation_ExternalDocumentationVisitor extends pw{constructor(o){super(o),this.element=new d_}},{visitors:{document:{objects:{Encoding:{$visitor:dw}}}}}=n_;const fw=class open_api_3_1_encoding_EncodingVisitor extends dw{constructor(o){super(o),this.element=new p_}},{visitors:{document:{objects:{Paths:{$visitor:mw}}}}}=n_;const gw=class paths_PathsVisitor extends mw{constructor(o){super(o),this.element=new A_}},{visitors:{document:{objects:{RequestBody:{$visitor:yw}}}}}=n_;const vw=class request_body_RequestBodyVisitor extends yw{constructor(o){super(o),this.element=new P_}},{visitors:{document:{objects:{Callback:{$visitor:bw}}}}}=n_;const _w=class callback_CallbackVisitor extends bw{constructor(o){super(o),this.element=new a_,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"PathItem\"]}ObjectElement(o){const s=bw.prototype.ObjectElement.call(this,o);return this.element.filter(PE).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"pathItem\")})),s}},{visitors:{document:{objects:{Response:{$visitor:Ew}}}}}=n_;const ww=class response_ResponseVisitor extends Ew{constructor(o){super(o),this.element=new I_}},{visitors:{document:{objects:{Responses:{$visitor:Sw}}}}}=n_;const xw=class open_api_3_1_responses_ResponsesVisitor extends Sw{constructor(o){super(o),this.element=new M_}},{visitors:{document:{objects:{Operation:{$visitor:kw}}}}}=n_;const Ow=class operation_OperationVisitor extends kw{constructor(o){super(o),this.element=new k_}},{visitors:{document:{objects:{PathItem:{$visitor:Cw}}}}}=n_;const Aw=class path_item_PathItemVisitor extends Cw{constructor(o){super(o),this.element=new C_}},{visitors:{document:{objects:{SecurityScheme:{$visitor:jw}}}}}=n_;const Pw=class security_scheme_SecuritySchemeVisitor extends jw{constructor(o){super(o),this.element=new R_}},{visitors:{document:{objects:{OAuthFlows:{$visitor:Iw}}}}}=n_;const Mw=class oauth_flows_OAuthFlowsVisitor extends Iw{constructor(o){super(o),this.element=new w_}},{visitors:{document:{objects:{OAuthFlow:{$visitor:Nw}}}}}=n_;const Tw=class oauth_flow_OAuthFlowVisitor extends Nw{constructor(o){super(o),this.element=new E_}};class Webhooks extends Xu.Sh{static primaryClass=\"webhooks\";constructor(o,s,i){super(o,s,i),this.classes.push(Webhooks.primaryClass)}}const Rw=Webhooks;class WebhooksVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Rw,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"PathItem\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(PE).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"pathItem\")})),this.element.filter(AE).forEach(((o,s)=>{o.setMetaProperty(\"webhook-name\",serializers_value(s))})),s}}const Dw=WebhooksVisitor,Lw={visitors:{value:n_.visitors.value,document:{objects:{OpenApi:{$visitor:q_,fixedFields:{openapi:n_.visitors.document.objects.OpenApi.fixedFields.openapi,info:{$ref:\"#/visitors/document/objects/Info\"},jsonSchemaDialect:G_,servers:n_.visitors.document.objects.OpenApi.fixedFields.servers,paths:{$ref:\"#/visitors/document/objects/Paths\"},webhooks:Dw,components:{$ref:\"#/visitors/document/objects/Components\"},security:n_.visitors.document.objects.OpenApi.fixedFields.security,tags:n_.visitors.document.objects.OpenApi.fixedFields.tags,externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"}}},Info:{$visitor:V_,fixedFields:{title:n_.visitors.document.objects.Info.fixedFields.title,description:n_.visitors.document.objects.Info.fixedFields.description,summary:{$ref:\"#/visitors/value\"},termsOfService:n_.visitors.document.objects.Info.fixedFields.termsOfService,contact:{$ref:\"#/visitors/document/objects/Contact\"},license:{$ref:\"#/visitors/document/objects/License\"},version:n_.visitors.document.objects.Info.fixedFields.version}},Contact:{$visitor:z_,fixedFields:{name:n_.visitors.document.objects.Contact.fixedFields.name,url:n_.visitors.document.objects.Contact.fixedFields.url,email:n_.visitors.document.objects.Contact.fixedFields.email}},License:{$visitor:K_,fixedFields:{name:n_.visitors.document.objects.License.fixedFields.name,identifier:{$ref:\"#/visitors/value\"},url:n_.visitors.document.objects.License.fixedFields.url}},Server:{$visitor:X_,fixedFields:{url:n_.visitors.document.objects.Server.fixedFields.url,description:n_.visitors.document.objects.Server.fixedFields.description,variables:n_.visitors.document.objects.Server.fixedFields.variables}},ServerVariable:{$visitor:Z_,fixedFields:{enum:n_.visitors.document.objects.ServerVariable.fixedFields.enum,default:n_.visitors.document.objects.ServerVariable.fixedFields.default,description:n_.visitors.document.objects.ServerVariable.fixedFields.description}},Components:{$visitor:sE,fixedFields:{schemas:iw,responses:n_.visitors.document.objects.Components.fixedFields.responses,parameters:n_.visitors.document.objects.Components.fixedFields.parameters,examples:n_.visitors.document.objects.Components.fixedFields.examples,requestBodies:n_.visitors.document.objects.Components.fixedFields.requestBodies,headers:n_.visitors.document.objects.Components.fixedFields.headers,securitySchemes:n_.visitors.document.objects.Components.fixedFields.securitySchemes,links:n_.visitors.document.objects.Components.fixedFields.links,callbacks:n_.visitors.document.objects.Components.fixedFields.callbacks,pathItems:cw}},Paths:{$visitor:gw},PathItem:{$visitor:Aw,fixedFields:{$ref:n_.visitors.document.objects.PathItem.fixedFields.$ref,summary:n_.visitors.document.objects.PathItem.fixedFields.summary,description:n_.visitors.document.objects.PathItem.fixedFields.description,get:{$ref:\"#/visitors/document/objects/Operation\"},put:{$ref:\"#/visitors/document/objects/Operation\"},post:{$ref:\"#/visitors/document/objects/Operation\"},delete:{$ref:\"#/visitors/document/objects/Operation\"},options:{$ref:\"#/visitors/document/objects/Operation\"},head:{$ref:\"#/visitors/document/objects/Operation\"},patch:{$ref:\"#/visitors/document/objects/Operation\"},trace:{$ref:\"#/visitors/document/objects/Operation\"},servers:n_.visitors.document.objects.PathItem.fixedFields.servers,parameters:n_.visitors.document.objects.PathItem.fixedFields.parameters}},Operation:{$visitor:Ow,fixedFields:{tags:n_.visitors.document.objects.Operation.fixedFields.tags,summary:n_.visitors.document.objects.Operation.fixedFields.summary,description:n_.visitors.document.objects.Operation.fixedFields.description,externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"},operationId:n_.visitors.document.objects.Operation.fixedFields.operationId,parameters:n_.visitors.document.objects.Operation.fixedFields.parameters,requestBody:n_.visitors.document.objects.Operation.fixedFields.requestBody,responses:{$ref:\"#/visitors/document/objects/Responses\"},callbacks:n_.visitors.document.objects.Operation.fixedFields.callbacks,deprecated:n_.visitors.document.objects.Operation.fixedFields.deprecated,security:n_.visitors.document.objects.Operation.fixedFields.security,servers:n_.visitors.document.objects.Operation.fixedFields.servers}},ExternalDocumentation:{$visitor:hw,fixedFields:{description:n_.visitors.document.objects.ExternalDocumentation.fixedFields.description,url:n_.visitors.document.objects.ExternalDocumentation.fixedFields.url}},Parameter:{$visitor:pE,fixedFields:{name:n_.visitors.document.objects.Parameter.fixedFields.name,in:n_.visitors.document.objects.Parameter.fixedFields.in,description:n_.visitors.document.objects.Parameter.fixedFields.description,required:n_.visitors.document.objects.Parameter.fixedFields.required,deprecated:n_.visitors.document.objects.Parameter.fixedFields.deprecated,allowEmptyValue:n_.visitors.document.objects.Parameter.fixedFields.allowEmptyValue,style:n_.visitors.document.objects.Parameter.fixedFields.style,explode:n_.visitors.document.objects.Parameter.fixedFields.explode,allowReserved:n_.visitors.document.objects.Parameter.fixedFields.allowReserved,schema:{$ref:\"#/visitors/document/objects/Schema\"},example:n_.visitors.document.objects.Parameter.fixedFields.example,examples:n_.visitors.document.objects.Parameter.fixedFields.examples,content:n_.visitors.document.objects.Parameter.fixedFields.content}},RequestBody:{$visitor:vw,fixedFields:{description:n_.visitors.document.objects.RequestBody.fixedFields.description,content:n_.visitors.document.objects.RequestBody.fixedFields.content,required:n_.visitors.document.objects.RequestBody.fixedFields.required}},MediaType:{$visitor:tE,fixedFields:{schema:{$ref:\"#/visitors/document/objects/Schema\"},example:n_.visitors.document.objects.MediaType.fixedFields.example,examples:n_.visitors.document.objects.MediaType.fixedFields.examples,encoding:n_.visitors.document.objects.MediaType.fixedFields.encoding}},Encoding:{$visitor:fw,fixedFields:{contentType:n_.visitors.document.objects.Encoding.fixedFields.contentType,headers:n_.visitors.document.objects.Encoding.fixedFields.headers,style:n_.visitors.document.objects.Encoding.fixedFields.style,explode:n_.visitors.document.objects.Encoding.fixedFields.explode,allowReserved:n_.visitors.document.objects.Encoding.fixedFields.allowReserved}},Responses:{$visitor:xw,fixedFields:{default:n_.visitors.document.objects.Responses.fixedFields.default}},Response:{$visitor:ww,fixedFields:{description:n_.visitors.document.objects.Response.fixedFields.description,headers:n_.visitors.document.objects.Response.fixedFields.headers,content:n_.visitors.document.objects.Response.fixedFields.content,links:n_.visitors.document.objects.Response.fixedFields.links}},Callback:{$visitor:_w},Example:{$visitor:uw,fixedFields:{summary:n_.visitors.document.objects.Example.fixedFields.summary,description:n_.visitors.document.objects.Example.fixedFields.description,value:n_.visitors.document.objects.Example.fixedFields.value,externalValue:n_.visitors.document.objects.Example.fixedFields.externalValue}},Link:{$visitor:J_,fixedFields:{operationRef:n_.visitors.document.objects.Link.fixedFields.operationRef,operationId:n_.visitors.document.objects.Link.fixedFields.operationId,parameters:n_.visitors.document.objects.Link.fixedFields.parameters,requestBody:n_.visitors.document.objects.Link.fixedFields.requestBody,description:n_.visitors.document.objects.Link.fixedFields.description,server:{$ref:\"#/visitors/document/objects/Server\"}}},Header:{$visitor:dE,fixedFields:{description:n_.visitors.document.objects.Header.fixedFields.description,required:n_.visitors.document.objects.Header.fixedFields.required,deprecated:n_.visitors.document.objects.Header.fixedFields.deprecated,allowEmptyValue:n_.visitors.document.objects.Header.fixedFields.allowEmptyValue,style:n_.visitors.document.objects.Header.fixedFields.style,explode:n_.visitors.document.objects.Header.fixedFields.explode,allowReserved:n_.visitors.document.objects.Header.fixedFields.allowReserved,schema:{$ref:\"#/visitors/document/objects/Schema\"},example:n_.visitors.document.objects.Header.fixedFields.example,examples:n_.visitors.document.objects.Header.fixedFields.examples,content:n_.visitors.document.objects.Header.fixedFields.content}},Tag:{$visitor:aE,fixedFields:{name:n_.visitors.document.objects.Tag.fixedFields.name,description:n_.visitors.document.objects.Tag.fixedFields.description,externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"}}},Reference:{$visitor:lE,fixedFields:{$ref:n_.visitors.document.objects.Reference.fixedFields.$ref,summary:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"}}},Schema:{$visitor:$E,fixedFields:{$schema:{$ref:\"#/visitors/value\"},$vocabulary:VE,$id:{$ref:\"#/visitors/value\"},$anchor:{$ref:\"#/visitors/value\"},$dynamicAnchor:{$ref:\"#/visitors/value\"},$dynamicRef:{$ref:\"#/visitors/value\"},$ref:UE,$defs:zE,$comment:{$ref:\"#/visitors/value\"},allOf:WE,anyOf:KE,oneOf:HE,not:{$ref:\"#/visitors/document/objects/Schema\"},if:{$ref:\"#/visitors/document/objects/Schema\"},then:{$ref:\"#/visitors/document/objects/Schema\"},else:{$ref:\"#/visitors/document/objects/Schema\"},dependentSchemas:JE,prefixItems:GE,items:{$ref:\"#/visitors/document/objects/Schema\"},contains:{$ref:\"#/visitors/document/objects/Schema\"},properties:YE,patternProperties:XE,additionalProperties:{$ref:\"#/visitors/document/objects/Schema\"},propertyNames:{$ref:\"#/visitors/document/objects/Schema\"},unevaluatedItems:{$ref:\"#/visitors/document/objects/Schema\"},unevaluatedProperties:{$ref:\"#/visitors/document/objects/Schema\"},type:QE,enum:ZE,const:{$ref:\"#/visitors/value\"},multipleOf:{$ref:\"#/visitors/value\"},maximum:{$ref:\"#/visitors/value\"},exclusiveMaximum:{$ref:\"#/visitors/value\"},minimum:{$ref:\"#/visitors/value\"},exclusiveMinimum:{$ref:\"#/visitors/value\"},maxLength:{$ref:\"#/visitors/value\"},minLength:{$ref:\"#/visitors/value\"},pattern:{$ref:\"#/visitors/value\"},maxItems:{$ref:\"#/visitors/value\"},minItems:{$ref:\"#/visitors/value\"},uniqueItems:{$ref:\"#/visitors/value\"},maxContains:{$ref:\"#/visitors/value\"},minContains:{$ref:\"#/visitors/value\"},maxProperties:{$ref:\"#/visitors/value\"},minProperties:{$ref:\"#/visitors/value\"},required:{$ref:\"#/visitors/value\"},dependentRequired:ew,title:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},default:{$ref:\"#/visitors/value\"},deprecated:{$ref:\"#/visitors/value\"},readOnly:{$ref:\"#/visitors/value\"},writeOnly:{$ref:\"#/visitors/value\"},examples:tw,format:{$ref:\"#/visitors/value\"},contentEncoding:{$ref:\"#/visitors/value\"},contentMediaType:{$ref:\"#/visitors/value\"},contentSchema:{$ref:\"#/visitors/document/objects/Schema\"},discriminator:{$ref:\"#/visitors/document/objects/Discriminator\"},xml:{$ref:\"#/visitors/document/objects/XML\"},externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"},example:{$ref:\"#/visitors/value\"}}},Discriminator:{$visitor:nw,fixedFields:{propertyName:n_.visitors.document.objects.Discriminator.fixedFields.propertyName,mapping:n_.visitors.document.objects.Discriminator.fixedFields.mapping}},XML:{$visitor:sw,fixedFields:{name:n_.visitors.document.objects.XML.fixedFields.name,namespace:n_.visitors.document.objects.XML.fixedFields.namespace,prefix:n_.visitors.document.objects.XML.fixedFields.prefix,attribute:n_.visitors.document.objects.XML.fixedFields.attribute,wrapped:n_.visitors.document.objects.XML.fixedFields.wrapped}},SecurityScheme:{$visitor:Pw,fixedFields:{type:n_.visitors.document.objects.SecurityScheme.fixedFields.type,description:n_.visitors.document.objects.SecurityScheme.fixedFields.description,name:n_.visitors.document.objects.SecurityScheme.fixedFields.name,in:n_.visitors.document.objects.SecurityScheme.fixedFields.in,scheme:n_.visitors.document.objects.SecurityScheme.fixedFields.scheme,bearerFormat:n_.visitors.document.objects.SecurityScheme.fixedFields.bearerFormat,flows:{$ref:\"#/visitors/document/objects/OAuthFlows\"},openIdConnectUrl:n_.visitors.document.objects.SecurityScheme.fixedFields.openIdConnectUrl}},OAuthFlows:{$visitor:Mw,fixedFields:{implicit:{$ref:\"#/visitors/document/objects/OAuthFlow\"},password:{$ref:\"#/visitors/document/objects/OAuthFlow\"},clientCredentials:{$ref:\"#/visitors/document/objects/OAuthFlow\"},authorizationCode:{$ref:\"#/visitors/document/objects/OAuthFlow\"}}},OAuthFlow:{$visitor:Tw,fixedFields:{authorizationUrl:n_.visitors.document.objects.OAuthFlow.fixedFields.authorizationUrl,tokenUrl:n_.visitors.document.objects.OAuthFlow.fixedFields.tokenUrl,refreshUrl:n_.visitors.document.objects.OAuthFlow.fixedFields.refreshUrl,scopes:n_.visitors.document.objects.OAuthFlow.fixedFields.scopes}},SecurityRequirement:{$visitor:nE}},extension:{$visitor:n_.visitors.document.extension.$visitor}}}},apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType=o=>{if(sp(o))return`${o.element.charAt(0).toUpperCase()+o.element.slice(1)}Element`},Bw={CallbackElement:[\"content\"],ComponentsElement:[\"content\"],ContactElement:[\"content\"],DiscriminatorElement:[\"content\"],Encoding:[\"content\"],Example:[\"content\"],ExternalDocumentationElement:[\"content\"],HeaderElement:[\"content\"],InfoElement:[\"content\"],LicenseElement:[\"content\"],MediaTypeElement:[\"content\"],OAuthFlowElement:[\"content\"],OAuthFlowsElement:[\"content\"],OpenApi3_1Element:[\"content\"],OperationElement:[\"content\"],ParameterElement:[\"content\"],PathItemElement:[\"content\"],PathsElement:[\"content\"],ReferenceElement:[\"content\"],RequestBodyElement:[\"content\"],ResponseElement:[\"content\"],ResponsesElement:[\"content\"],SchemaElement:[\"content\"],SecurityRequirementElement:[\"content\"],SecuritySchemeElement:[\"content\"],ServerElement:[\"content\"],ServerVariableElement:[\"content\"],TagElement:[\"content\"],...xp},Fw={namespace:o=>{const{base:s}=o;return s.register(\"callback\",a_),s.register(\"components\",c_),s.register(\"contact\",l_),s.register(\"discriminator\",u_),s.register(\"encoding\",p_),s.register(\"example\",h_),s.register(\"externalDocumentation\",d_),s.register(\"header\",f_),s.register(\"info\",m_),s.register(\"jsonSchemaDialect\",g_),s.register(\"license\",y_),s.register(\"link\",v_),s.register(\"mediaType\",b_),s.register(\"oAuthFlow\",E_),s.register(\"oAuthFlows\",w_),s.register(\"openapi\",S_),s.register(\"openApi3_1\",x_),s.register(\"operation\",k_),s.register(\"parameter\",O_),s.register(\"pathItem\",C_),s.register(\"paths\",A_),s.register(\"reference\",j_),s.register(\"requestBody\",P_),s.register(\"response\",I_),s.register(\"responses\",M_),s.register(\"schema\",N_),s.register(\"securityRequirement\",T_),s.register(\"securityScheme\",R_),s.register(\"server\",D_),s.register(\"serverVariable\",L_),s.register(\"tag\",B_),s.register(\"xml\",F_),s}},qw=Fw,apidom_ns_openapi_3_1_es_refractor_toolbox=()=>{const o=createNamespace(qw);return{predicates:{...de,isElement:sp,isStringElement:ip,isArrayElement:hp,isObjectElement:pp,isMemberElement:dp,isServersElement:dy,includesClasses,hasElementSourceMap},namespace:o}},apidom_ns_openapi_3_1_es_refractor_refract=(o,{specPath:s=[\"visitors\",\"document\",\"objects\",\"OpenApi\",\"$visitor\"],plugins:i=[]}={})=>{const u=(0,Xu.e)(o),_=dereference(Lw),w=new(Np(s,_))({specObj:_});return visitor_visit(u,w),dispatchPluginsSync(w.element,i,{toolboxCreator:apidom_ns_openapi_3_1_es_refractor_toolbox,visitorOptions:{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}})},apidom_ns_openapi_3_1_es_refractor_createRefractor=o=>(s,i={})=>apidom_ns_openapi_3_1_es_refractor_refract(s,{specPath:o,...i});a_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Callback\",\"$visitor\"]),c_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Components\",\"$visitor\"]),l_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Contact\",\"$visitor\"]),h_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Example\",\"$visitor\"]),u_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Discriminator\",\"$visitor\"]),p_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Encoding\",\"$visitor\"]),d_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"ExternalDocumentation\",\"$visitor\"]),f_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Header\",\"$visitor\"]),m_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Info\",\"$visitor\"]),g_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"fixedFields\",\"jsonSchemaDialect\"]),y_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"License\",\"$visitor\"]),v_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Link\",\"$visitor\"]),b_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"MediaType\",\"$visitor\"]),E_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OAuthFlow\",\"$visitor\"]),w_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OAuthFlows\",\"$visitor\"]),S_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"fixedFields\",\"openapi\"]),x_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"$visitor\"]),k_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Operation\",\"$visitor\"]),O_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Parameter\",\"$visitor\"]),C_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"PathItem\",\"$visitor\"]),A_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Paths\",\"$visitor\"]),j_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Reference\",\"$visitor\"]),P_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"RequestBody\",\"$visitor\"]),I_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Response\",\"$visitor\"]),M_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Responses\",\"$visitor\"]),N_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Schema\",\"$visitor\"]),T_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"SecurityRequirement\",\"$visitor\"]),R_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"SecurityScheme\",\"$visitor\"]),D_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Server\",\"$visitor\"]),L_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"ServerVariable\",\"$visitor\"]),B_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Tag\",\"$visitor\"]),F_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"XML\",\"$visitor\"]);const $w=class NotImplementedError extends Wd{};const Vw=class MediaTypes extends Array{unknownMediaType=\"application/octet-stream\";filterByFormat(){throw new $w(\"filterByFormat method in MediaTypes class is not yet implemented.\")}findBy(){throw new $w(\"findBy method in MediaTypes class is not yet implemented.\")}latest(){throw new $w(\"latest method in MediaTypes class is not yet implemented.\")}};class OpenAPIMediaTypes extends Vw{filterByFormat(o=\"generic\"){const s=\"generic\"===o?\"openapi;version\":o;return this.filter((o=>o.includes(s)))}findBy(o=\"3.1.0\",s=\"generic\"){const i=\"generic\"===s?`vnd.oai.openapi;version=${o}`:`vnd.oai.openapi+${s};version=${o}`;return this.find((o=>o.includes(i)))||this.unknownMediaType}latest(o=\"generic\"){return yl(this.filterByFormat(o))}}const Uw=new OpenAPIMediaTypes(\"application/vnd.oai.openapi;version=3.1.0\",\"application/vnd.oai.openapi+json;version=3.1.0\",\"application/vnd.oai.openapi+yaml;version=3.1.0\");const zw=class es_Reference_Reference{uri;depth;value;refSet;errors;constructor({uri:o,depth:s=0,refSet:i,value:u}){this.uri=o,this.value=u,this.depth=s,this.refSet=i,this.errors=[]}};const Ww=class ReferenceSet{rootRef;refs;circular;constructor({refs:o=[],circular:s=!1}={}){this.refs=[],this.circular=s,o.forEach(this.add.bind(this))}get size(){return this.refs.length}add(o){return this.has(o)||(this.refs.push(o),this.rootRef=void 0===this.rootRef?o:this.rootRef,o.refSet=this),this}merge(o){for(const s of o.values())this.add(s);return this}has(o){const s=su(o)?o:o.uri;return Kl(this.find((o=>o.uri===s)))}find(o){return this.refs.find(o)}*values(){yield*this.refs}clean(){this.refs.forEach((o=>{o.refSet=void 0})),this.rootRef=void 0,this.refs.length=0}},Kw={parse:{mediaType:\"text/plain\",parsers:[],parserOpts:{}},resolve:{baseURI:\"\",resolvers:[],resolverOpts:{},strategies:[],strategyOpts:{},internal:!0,external:!0,maxDepth:1/0},dereference:{strategies:[],strategyOpts:{},refSet:null,maxDepth:1/0,circular:\"ignore\",circularReplacer:Ih,immutable:!0},bundle:{strategies:[],refSet:null,maxDepth:1/0}};const Hw=_curry2((function lens(o,s){return function(i){return function(u){return Rl((function(o){return s(o,u)}),i(o(u)))}}}));var Jw=_curry3((function assocPath(o,s,i){if(0===o.length)return s;var u=o[0];if(o.length>1){var _=!Qd(i)&&_has(u,i)&&\"object\"==typeof i[u]?i[u]:Ha(o[1])?[]:{};s=assocPath(Array.prototype.slice.call(o,1),s,_)}return function _assoc(o,s,i){if(Ha(o)&&gc(i)){var u=[].concat(i);return u[o]=s,u}var _={};for(var w in i)_[w]=i[w];return _[o]=s,_}(u,s,i)}));const Gw=Jw;var Identity=function(o){return{value:o,map:function(s){return Identity(s(o))}}},Yw=_curry3((function over(o,s,i){return o((function(o){return Identity(s(o))}))(i).value}));const Xw=Yw,Qw=Hw(Np([\"resolve\",\"baseURI\"]),Gw([\"resolve\",\"baseURI\"])),baseURIDefault=o=>td(o)?url_cwd():o,util_merge=(o,s)=>{const i=Mp(o,s);return Xw(Qw,baseURIDefault,i)};const Zw=class File_File{uri;mediaType;data;parseResult;constructor({uri:o,mediaType:s=\"text/plain\",data:i,parseResult:u}){this.uri=o,this.mediaType=s,this.data=i,this.parseResult=u}get extension(){return su(this.uri)?(o=>{const s=o.lastIndexOf(\".\");return s>=0?o.substring(s).toLowerCase():\"\"})(this.uri):\"\"}toString(){if(\"string\"==typeof this.data)return this.data;if(this.data instanceof ArrayBuffer||[\"ArrayBuffer\"].includes(pc(this.data))||ArrayBuffer.isView(this.data)){return new TextDecoder(\"utf-8\").decode(this.data)}return String(this.data)}};const eS=class PluginError extends Ba{plugin;constructor(o,s){super(o,{cause:s.cause}),this.plugin=s.plugin}},plugins_filter=async(o,s,i)=>{const u=await Promise.all(i.map(Kp([o],s)));return i.filter(((o,s)=>u[s]))},run=async(o,s,i)=>{let u;for(const _ of i)try{const i=await _[o].call(_,...s);return{plugin:_,result:i}}catch(o){u=new eS(\"Error while running plugin\",{cause:o,plugin:_})}return Promise.reject(u)};const tS=class DereferenceError extends Ba{};const rS=class UnmatchedDereferenceStrategyError extends tS{},dereferenceApiDOM=async(o,s)=>{let i=o,u=!1;if(!vp(o)){const s=cloneShallow(o);s.classes.push(\"result\"),i=new np([s]),u=!0}const _=new Zw({uri:s.resolve.baseURI,parseResult:i,mediaType:s.parse.mediaType}),w=await plugins_filter(\"canDereference\",[_,s],s.dereference.strategies);if(Vp(w))throw new rS(_.uri);try{const{result:o}=await run(\"dereference\",[_,s],w);return u?o.get(0):o}catch(o){throw new tS(`Error while dereferencing file \"${_.uri}\"`,{cause:o})}};const nS=class ParseError extends Ba{};const oS=class ParserError extends nS{};const sS=class Parser{name;allowEmpty;sourceMap;fileExtensions;mediaTypes;constructor({name:o,allowEmpty:s=!0,sourceMap:i=!1,fileExtensions:u=[],mediaTypes:_=[]}){this.name=o,this.allowEmpty=s,this.sourceMap=i,this.fileExtensions=u,this.mediaTypes=_}};const iS=class BinaryParser extends sS{constructor(o){super({...null!=o?o:{},name:\"binary\"})}canParse(o){return 0===this.fileExtensions.length||this.fileExtensions.includes(o.extension)}parse(o){try{const s=unescape(encodeURIComponent(o.toString())),i=btoa(s),u=new np;if(0!==i.length){const o=new Xu.Om(i);o.classes.push(\"result\"),u.push(o)}return u}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const aS=class ResolveStrategy{name;constructor({name:o}){this.name=o}};const cS=class OpenAPI3_1ResolveStrategy extends aS{constructor(o){super({...null!=o?o:{},name:\"openapi-3-1\"})}canResolve(o,s){const i=s.dereference.strategies.find((o=>\"openapi-3-1\"===o.name));return void 0!==i&&i.canDereference(o,s)}async resolve(o,s){const i=s.dereference.strategies.find((o=>\"openapi-3-1\"===o.name));if(void 0===i)throw new rS('\"openapi-3-1\" dereference strategy is not available.');const u=new Ww,_=util_merge(s,{resolve:{internal:!1},dereference:{refSet:u}});return await i.dereference(o,_),u}};function _clone(o,s,i){if(i||(i=new lS),function _isPrimitive(o){var s=typeof o;return null==o||\"object\"!=s&&\"function\"!=s}(o))return o;var u=function copy(u){var _=i.get(o);if(_)return _;for(var w in i.set(o,u),o)Object.prototype.hasOwnProperty.call(o,w)&&(u[w]=s?_clone(o[w],!0,i):o[w]);return u};switch(pc(o)){case\"Object\":return u(Object.create(Object.getPrototypeOf(o)));case\"Array\":return u(Array(o.length));case\"Date\":return new Date(o.valueOf());case\"RegExp\":return _cloneRegExp(o);case\"Int8Array\":case\"Uint8Array\":case\"Uint8ClampedArray\":case\"Int16Array\":case\"Uint16Array\":case\"Int32Array\":case\"Uint32Array\":case\"Float32Array\":case\"Float64Array\":case\"BigInt64Array\":case\"BigUint64Array\":return o.slice();default:return o}}var lS=function(){function _ObjectMap(){this.map={},this.length=0}return _ObjectMap.prototype.set=function(o,s){var i=this.hash(o),u=this.map[i];u||(this.map[i]=u=[]),u.push([o,s]),this.length+=1},_ObjectMap.prototype.hash=function(o){var s=[];for(var i in o)s.push(Object.prototype.toString.call(o[i]));return s.join()},_ObjectMap.prototype.get=function(o){if(this.length<=180)for(var s in this.map)for(var i=this.map[s],u=0;u<i.length;u+=1){if((w=i[u])[0]===o)return w[1]}else{var _=this.hash(o);if(i=this.map[_])for(u=0;u<i.length;u+=1){var w;if((w=i[u])[0]===o)return w[1]}}},_ObjectMap}(),uS=function(){function XReduceBy(o,s,i,u){this.valueFn=o,this.valueAcc=s,this.keyFn=i,this.xf=u,this.inputs={}}return XReduceBy.prototype[\"@@transducer/init\"]=_xfBase_init,XReduceBy.prototype[\"@@transducer/result\"]=function(o){var s;for(s in this.inputs)if(_has(s,this.inputs)&&(o=this.xf[\"@@transducer/step\"](o,this.inputs[s]))[\"@@transducer/reduced\"]){o=o[\"@@transducer/value\"];break}return this.inputs=null,this.xf[\"@@transducer/result\"](o)},XReduceBy.prototype[\"@@transducer/step\"]=function(o,s){var i=this.keyFn(s);return this.inputs[i]=this.inputs[i]||[i,_clone(this.valueAcc,!1)],this.inputs[i][1]=this.valueFn(this.inputs[i][1],s),o},XReduceBy}();function _xreduceBy(o,s,i){return function(u){return new uS(o,s,i,u)}}var pS=_curryN(4,[],_dispatchable([],_xreduceBy,(function reduceBy(o,s,i,u){var _=_xwrap((function(u,_){var w=i(_),x=o(_has(w,u)?u[w]:_clone(s,!1),_);return x&&x[\"@@transducer/reduced\"]?_reduced(u):(u[w]=x,u)}));return Lc(_,{},u)})));const hS=_curry2(_checkForMethod(\"groupBy\",pS((function(o,s){return o.push(s),o}),[]))),removeSpaces=o=>o.replace(/\\s/g,\"\"),normalize_operation_ids_replaceSpecialCharsWithUnderscore=o=>o.replace(/\\W/gi,\"_\"),normalizeOperationId=(o,s,i)=>{const u=removeSpaces(o);return u.length>0?normalize_operation_ids_replaceSpecialCharsWithUnderscore(u):((o,s)=>`${normalize_operation_ids_replaceSpecialCharsWithUnderscore(removeSpaces(s.toLowerCase()))}${normalize_operation_ids_replaceSpecialCharsWithUnderscore(removeSpaces(o))}`)(s,i)},normalize_operation_ids=({operationIdNormalizer:o=normalizeOperationId}={})=>({predicates:s,namespace:i})=>{const u=[],_=[],w=[];return{visitor:{OpenApi3_1Element:{leave(){const o=hS((o=>serializers_value(o.operationId)),_);Object.entries(o).forEach((([o,s])=>{Array.isArray(s)&&(s.length<=1||s.forEach(((s,u)=>{const _=`${o}${u+1}`;s.operationId=new i.elements.String(_)})))})),w.forEach((o=>{if(void 0===o.operationId)return;const s=String(serializers_value(o.operationId)),i=_.find((o=>serializers_value(o.meta.get(\"originalOperationId\"))===s));void 0!==i&&(o.operationId=cloneDeep.safe(i.operationId),o.meta.set(\"originalOperationId\",s),o.set(\"__originalOperationId\",s))})),_.length=0,w.length=0}},PathItemElement:{enter(o){const s=Qc(\"path\",serializers_value(o.meta.get(\"path\")));u.push(s)},leave(){u.pop()}},OperationElement:{enter(s){if(void 0===s.operationId)return;const w=String(serializers_value(s.operationId)),x=yl(u),C=Qc(\"method\",serializers_value(s.meta.get(\"http-method\"))),j=o(w,x,C);w!==j&&(s.operationId=new i.elements.String(j),s.set(\"__originalOperationId\",w),s.meta.set(\"originalOperationId\",w),_.push(s))}},LinkElement:{leave(o){s.isLinkElement(o)&&void 0!==o.operationId&&w.push(o)}}}}};const dS=_curry3((function pathOr(o,s,i){return Qc(o,_path(s,i))}));var fS=function(){function XUniqWith(o,s){this.xf=s,this.pred=o,this.items=[]}return XUniqWith.prototype[\"@@transducer/init\"]=_xfBase_init,XUniqWith.prototype[\"@@transducer/result\"]=_xfBase_result,XUniqWith.prototype[\"@@transducer/step\"]=function(o,s){return _includesWith(this.pred,s,this.items)?o:(this.items.push(s),this.xf[\"@@transducer/step\"](o,s))},XUniqWith}();function _xuniqWith(o){return function(s){return new fS(o,s)}}var mS=_curry2(_dispatchable([],_xuniqWith,(function(o,s){for(var i,u=0,_=s.length,w=[];u<_;)_includesWith(o,i=s[u],w)||(w[w.length]=i),u+=1;return w})));const gS=mS,normalize_parameters=()=>({predicates:o})=>{const parameterEquals=(s,i)=>!!o.isParameterElement(s)&&(!!o.isParameterElement(i)&&(!!o.isStringElement(s.name)&&(!!o.isStringElement(s.in)&&(!!o.isStringElement(i.name)&&(!!o.isStringElement(i.in)&&(serializers_value(s.name)===serializers_value(i.name)&&serializers_value(s.in)===serializers_value(i.in))))))),s=[];return{visitor:{PathItemElement:{enter(i,u,_,w,x){if(x.some(o.isComponentsElement))return;const{parameters:C}=i;o.isArrayElement(C)?s.push([...C.content]):s.push([])},leave(){s.pop()}},OperationElement:{leave(o){const i=yl(s);if(!Array.isArray(i)||0===i.length)return;const u=dS([],[\"parameters\",\"content\"],o),_=gS(parameterEquals,[...u,...i]);o.parameters=new Qv(_)}}}}},normalize_security_requirements=()=>({predicates:o})=>{let s;return{visitor:{OpenApi3_1Element:{enter(i){o.isArrayElement(i.security)&&(s=i.security)},leave(){s=void 0}},OperationElement:{leave(i,u,_,w,x){if(x.some(o.isComponentsElement))return;var C;void 0===i.security&&void 0!==s&&(i.security=new mb(null===(C=s)||void 0===C?void 0:C.content))}}}}},normalize_servers=()=>({predicates:o,namespace:s})=>({visitor:{OpenApi3_1Element(i){const u=void 0===i.servers,_=o.isArrayElement(i.servers),w=_&&0===i.servers.length,x=s.elements.Server.refract({url:\"/\"});u||!_?i.servers=new sg([x]):_&&w&&i.servers.push(x)},PathItemElement(s,i,u,_,w){if(w.some(o.isComponentsElement))return;if(!w.some(o.isOpenApi3_1Element))return;const x=w.find(o.isOpenApi3_1Element),C=void 0===s.servers,j=o.isArrayElement(s.servers),L=j&&0===s.servers.length;if(o.isOpenApi3_1Element(x)){var B;const o=null===(B=x.servers)||void 0===B?void 0:B.content,i=null!=o?o:[];C||!j?s.servers=new Ab(i):j&&L&&i.forEach((o=>{s.servers.push(o)}))}},OperationElement(s,i,u,_,w){if(w.some(o.isComponentsElement))return;if(!w.some(o.isOpenApi3_1Element))return;const x=[...w].reverse().find(o.isPathItemElement),C=void 0===s.servers,j=o.isArrayElement(s.servers),L=j&&0===s.servers.length;if(o.isPathItemElement(x)){var B;const o=null===(B=x.servers)||void 0===B?void 0:B.content,i=null!=o?o:[];C||!j?s.servers=new _b(i):j&&L&&i.forEach((o=>{s.servers.push(o)}))}}}}),normalize_parameter_examples=()=>({predicates:o})=>({visitor:{ParameterElement:{leave(s,i,u,_,w){var x,C;if(!w.some(o.isComponentsElement)&&void 0!==s.schema&&o.isSchemaElement(s.schema)&&(void 0!==(null===(x=s.schema)||void 0===x?void 0:x.example)||void 0!==(null===(C=s.schema)||void 0===C?void 0:C.examples))){if(void 0!==s.examples&&o.isObjectElement(s.examples)){const o=s.examples.map((o=>cloneDeep.safe(o.value)));return void 0!==s.schema.examples&&s.schema.set(\"examples\",o),void(void 0!==s.schema.example&&s.schema.set(\"example\",o))}void 0!==s.example&&(void 0!==s.schema.examples&&s.schema.set(\"examples\",[cloneDeep(s.example)]),void 0!==s.schema.example&&s.schema.set(\"example\",cloneDeep(s.example)))}}}}}),normalize_header_examples=()=>({predicates:o})=>({visitor:{HeaderElement:{leave(s,i,u,_,w){var x,C;if(!w.some(o.isComponentsElement)&&void 0!==s.schema&&o.isSchemaElement(s.schema)&&(void 0!==(null===(x=s.schema)||void 0===x?void 0:x.example)||void 0!==(null===(C=s.schema)||void 0===C?void 0:C.examples))){if(void 0!==s.examples&&o.isObjectElement(s.examples)){const o=s.examples.map((o=>cloneDeep.safe(o.value)));return void 0!==s.schema.examples&&s.schema.set(\"examples\",o),void(void 0!==s.schema.example&&s.schema.set(\"example\",o))}void 0!==s.example&&(void 0!==s.schema.examples&&s.schema.set(\"examples\",[cloneDeep(s.example)]),void 0!==s.schema.example&&s.schema.set(\"example\",cloneDeep(s.example)))}}}}}),pojoAdapter=o=>s=>{if(null!=s&&s.$$normalized)return s;if(pojoAdapter.cache.has(s))return pojoAdapter.cache.get(s);const i=x_.refract(s),u=o(i),_=serializers_value(u);return pojoAdapter.cache.set(s,_),_};pojoAdapter.cache=new WeakMap;const openapi_3_1_apidom_normalize=o=>{if(!pp(o))return o;if(o.hasKey(\"$$normalized\"))return o;const s=[normalize_operation_ids({operationIdNormalizer:(o,s,i)=>opId({operationId:o},s,i,{v2OperationIdCompatibilityMode:!1})}),normalize_parameters(),normalize_security_requirements(),normalize_servers(),normalize_parameter_examples(),normalize_header_examples()],i=dispatchPluginsSync(o,s,{toolboxCreator:apidom_ns_openapi_3_1_es_refractor_toolbox,visitorOptions:{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}});return i.set(\"$$normalized\",!0),i};const yS=class Resolver{name;constructor({name:o}){this.name=o}};const vS=class HTTPResolver extends yS{timeout;redirects;withCredentials;constructor(o){const{name:s=\"http-resolver\",timeout:i=5e3,redirects:u=5,withCredentials:_=!1}=null!=o?o:{};super({name:s}),this.timeout=i,this.redirects=u,this.withCredentials=_}canRead(o){return isHttpUrl(o.uri)}};const bS=class ResolveError extends Ba{};const _S=class ResolverError extends bS{},{AbortController:ES,AbortSignal:wS}=globalThis;void 0===globalThis.AbortController&&(globalThis.AbortController=ES),void 0===globalThis.AbortSignal&&(globalThis.AbortSignal=wS);const SS=class HTTPResolverSwaggerClient extends vS{swaggerHTTPClient=http_http;swaggerHTTPClientConfig;constructor({swaggerHTTPClient:o=http_http,swaggerHTTPClientConfig:s={},...i}={}){super({...i,name:\"http-swagger-client\"}),this.swaggerHTTPClient=o,this.swaggerHTTPClientConfig=s}getHttpClient(){return this.swaggerHTTPClient}async read(o){const s=this.getHttpClient(),i=new AbortController,{signal:u}=i,_=setTimeout((()=>{i.abort()}),this.timeout),w=this.getHttpClient().withCredentials||this.withCredentials?\"include\":\"same-origin\",x=0===this.redirects?\"error\":\"follow\",C=this.redirects>0?this.redirects:void 0;try{return(await s({url:o.uri,signal:u,userFetch:async(o,s)=>{let i=await fetch(o,s);try{i.headers.delete(\"Content-Type\")}catch{i=new Response(i.body,{...i,headers:new Headers(i.headers)}),i.headers.delete(\"Content-Type\")}return i},credentials:w,redirect:x,follow:C,...this.swaggerHTTPClientConfig})).text.arrayBuffer()}catch(s){throw new _S(`Error downloading \"${o.uri}\"`,{cause:s})}finally{clearTimeout(_)}}},from=(o,s=dh)=>{if(su(o))try{return s.fromRefract(JSON.parse(o))}catch{}return rh(o)&&of(\"element\",o)?s.fromRefract(o):s.toElement(o)};const xS=class JSONParser extends sS{constructor(o={}){super({...o,name:\"json-swagger-client\",fileExtensions:[\".json\"],mediaTypes:[\"application/json\"]})}async canParse(o){const s=0===this.fileExtensions.length||this.fileExtensions.includes(o.extension),i=this.mediaTypes.includes(o.mediaType);if(!s)return!1;if(i)return!0;if(!i)try{return JSON.parse(o.toString()),!0}catch(o){return!1}return!1}async parse(o){if(this.sourceMap)throw new oS(\"json-swagger-client parser plugin doesn't support sourceMaps option\");const s=new np,i=o.toString();if(this.allowEmpty&&\"\"===i.trim())return s;try{const o=from(JSON.parse(i));return o.classes.push(\"result\"),s.push(o),s}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const kS=class YAMLParser extends sS{constructor(o={}){super({...o,name:\"yaml-1-2-swagger-client\",fileExtensions:[\".yaml\",\".yml\"],mediaTypes:[\"text/yaml\",\"application/yaml\"]})}async canParse(o){const s=0===this.fileExtensions.length||this.fileExtensions.includes(o.extension),i=this.mediaTypes.includes(o.mediaType);if(!s)return!1;if(i)return!0;if(!i)try{return to.load(o.toString(),{schema:zn}),!0}catch(o){return!1}return!1}async parse(o){if(this.sourceMap)throw new oS(\"yaml-1-2-swagger-client parser plugin doesn't support sourceMaps option\");const s=new np,i=o.toString();try{const o=to.load(i,{schema:zn});if(this.allowEmpty&&void 0===o)return s;const u=from(o);return u.classes.push(\"result\"),s.push(u),s}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const OS=class OpenAPIJSON3_1Parser extends sS{detectionRegExp=/\"openapi\"\\s*:\\s*\"(?<version_json>3\\.1\\.(?:[1-9]\\d*|0))\"/;constructor(o={}){super({...o,name:\"openapi-json-3-1-swagger-client\",fileExtensions:[\".json\"],mediaTypes:new OpenAPIMediaTypes(...Uw.filterByFormat(\"generic\"),...Uw.filterByFormat(\"json\"))})}async canParse(o){const s=0===this.fileExtensions.length||this.fileExtensions.includes(o.extension),i=this.mediaTypes.includes(o.mediaType);if(!s)return!1;if(i)return!0;if(!i)try{const s=o.toString();return JSON.parse(s),this.detectionRegExp.test(s)}catch(o){return!1}return!1}async parse(o){if(this.sourceMap)throw new oS(\"openapi-json-3-1-swagger-client parser plugin doesn't support sourceMaps option\");const s=new np,i=o.toString();if(this.allowEmpty&&\"\"===i.trim())return s;try{const o=JSON.parse(i),u=x_.refract(o,this.refractorOpts);return u.classes.push(\"result\"),s.push(u),s}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const CS=class OpenAPIYAML31Parser extends sS{detectionRegExp=/(?<YAML>^([\"']?)openapi\\2\\s*:\\s*([\"']?)(?<version_yaml>3\\.1\\.(?:[1-9]\\d*|0))\\3(?:\\s+|$))|(?<JSON>\"openapi\"\\s*:\\s*\"(?<version_json>3\\.1\\.(?:[1-9]\\d*|0))\")/m;constructor(o={}){super({name:\"openapi-yaml-3-1-swagger-client\",...o,fileExtensions:[\".yaml\",\".yml\"],mediaTypes:new OpenAPIMediaTypes(...Uw.filterByFormat(\"generic\"),...Uw.filterByFormat(\"yaml\"))})}async canParse(o){const s=0===this.fileExtensions.length||this.fileExtensions.includes(o.extension),i=this.mediaTypes.includes(o.mediaType);if(!s)return!1;if(i)return!0;if(!i)try{const s=o.toString();return to.load(s),this.detectionRegExp.test(s)}catch(o){return!1}return!1}async parse(o){if(this.sourceMap)throw new oS(\"openapi-yaml-3-1-swagger-client parser plugin doesn't support sourceMaps option\");const s=new np,i=o.toString();try{const o=to.load(i,{schema:zn});if(this.allowEmpty&&void 0===o)return s;const u=x_.refract(o,this.refractorOpts);return u.classes.push(\"result\"),s.push(u),s}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const AS=_curry3((function propEq(o,s,i){return hc(o,tl(s,i))}));const jS=class DereferenceStrategy{name;constructor({name:o}){this.name=o}};var PS=_curry2((function none(o,s){return ep(_complement(o),s)}));const IS=PS;var MS=__webpack_require__(8068);const NS=class ElementIdentityError extends Fa{value;constructor(o,s){super(o,s),void 0!==s&&(this.value=s.value)}};class IdentityManager{uuid;identityMap;constructor({length:o=6}={}){this.uuid=new MS({length:o}),this.identityMap=new WeakMap}identify(o){if(!sp(o))throw new NS(\"Cannot not identify the element. `element` is neither structurally compatible nor a subclass of an Element class.\",{value:o});if(o.meta.hasKey(\"id\")&&ip(o.meta.get(\"id\"))&&!o.meta.get(\"id\").equals(\"\"))return o.id;if(this.identityMap.has(o))return this.identityMap.get(o);const s=new Xu.Om(this.generateId());return this.identityMap.set(o,s),s}forget(o){return!!this.identityMap.has(o)&&(this.identityMap.delete(o),!0)}generateId(){return this.uuid.randomUUID()}}new IdentityManager;const traversal_find=(o,s)=>{const i=new PredicateVisitor({predicate:o,returnOnTrue:Yu});return visitor_visit(s,i),dS(void 0,[0],i.result)};const TS=class JsonSchema$anchorError extends Ba{};const RS=class EvaluationJsonSchema$anchorError extends TS{};const DS=class InvalidJsonSchema$anchorError extends TS{constructor(o){super(`Invalid JSON Schema $anchor \"${o}\".`)}},isAnchor=o=>/^[A-Za-z_][A-Za-z_0-9.-]*$/.test(o),uriToAnchor=o=>{const s=getHash(o);return cd(\"#\",s)},$anchor_evaluate=(o,s)=>{const i=(o=>{if(!isAnchor(o))throw new DS(o);return o})(o),u=traversal_find((o=>TE(o)&&serializers_value(o.$anchor)===i),s);if(Wl(u))throw new RS(`Evaluation failed on token: \"${i}\"`);return u},traversal_filter=(o,s)=>{const i=new PredicateVisitor({predicate:o});return visitor_visit(s,i),new Xu.G6(i.result)};const LS=class JsonSchemaUriError extends Ba{};const BS=class EvaluationJsonSchemaUriError extends LS{},resolveSchema$refField=(o,s)=>{if(void 0===s.$ref)return;const i=getHash(serializers_value(s.$ref)),u=serializers_value(s.meta.get(\"inherited$id\")),_=Kc(((o,s)=>resolve(o,sanitize(stripHash(s)))),o,[...u,serializers_value(s.$ref)]);return`${_}${\"#\"===i?\"\":i}`},refractToSchemaElement=o=>{if(refractToSchemaElement.cache.has(o))return refractToSchemaElement.cache.get(o);const s=N_.refract(o);return refractToSchemaElement.cache.set(o,s),s};refractToSchemaElement.cache=new WeakMap;const maybeRefractToSchemaElement=o=>isPrimitiveElement(o)?refractToSchemaElement(o):o,uri_evaluate=(o,s)=>{const{cache:i}=uri_evaluate,u=stripHash(o),isSchemaElementWith$id=o=>TE(o)&&void 0!==o.$id;if(!i.has(s)){const o=traversal_filter(isSchemaElementWith$id,s);i.set(s,Array.from(o))}const _=i.get(s).find((o=>{const s=((o,s)=>{if(void 0===s.$id)return;const i=serializers_value(s.meta.get(\"inherited$id\"));return Kc(((o,s)=>resolve(o,sanitize(stripHash(s)))),o,[...i,serializers_value(s.$id)])})(u,o);return s===u}));if(Wl(_))throw new BS(`Evaluation failed on URI: \"${o}\"`);let w,x;return isAnchor(uriToAnchor(o))?(w=$anchor_evaluate,x=uriToAnchor(o)):(w=es_evaluate,x=uriToPointer(o)),w(x,_)};uri_evaluate.cache=new WeakMap;const FS=class MaximumDereferenceDepthError extends tS{};const qS=class MaximumResolveDepthError extends bS{};const $S=class UnmatchedResolverError extends _S{},_swagger_api_apidom_reference_es_parse=async(o,s)=>{const i=new Zw({uri:sanitize(stripHash(o)),mediaType:s.parse.mediaType}),u=await(async(o,s)=>{const i=s.resolve.resolvers.map((o=>{const i=Object.create(o);return Object.assign(i,s.resolve.resolverOpts)})),u=await plugins_filter(\"canRead\",[o,s],i);if(Vp(u))throw new $S(o.uri);try{const{result:s}=await run(\"read\",[o],u);return s}catch(s){throw new bS(`Error while reading file \"${o.uri}\"`,{cause:s})}})(i,s);return(async(o,s)=>{const i=s.parse.parsers.map((o=>{const i=Object.create(o);return Object.assign(i,s.parse.parserOpts)})),u=await plugins_filter(\"canParse\",[o,s],i);if(Vp(u))throw new $S(o.uri);try{const{plugin:i,result:_}=await run(\"parse\",[o,s],u);return!i.allowEmpty&&_.isEmpty?Promise.reject(new nS(`Error while parsing file \"${o.uri}\". File is empty.`)):_}catch(s){throw new nS(`Error while parsing file \"${o.uri}\"`,{cause:s})}})(new Zw({...i,data:u}),s)};class AncestorLineage extends Array{includesCycle(o){return this.filter((s=>s.has(o))).length>1}includes(o,s){return o instanceof Set?super.includes(o,s):this.some((s=>s.has(o)))}findItem(o){for(const s of this)for(const i of s)if(sp(i)&&o(i))return i}}const VS=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")],US=new IdentityManager,mutationReplacer=(o,s,i,u)=>{dp(u)?u.value=o:Array.isArray(u)&&(u[i]=o)};class OpenAPI3_1DereferenceVisitor{indirections;namespace;reference;options;ancestors;refractCache;constructor({reference:o,namespace:s,options:i,indirections:u=[],ancestors:_=new AncestorLineage,refractCache:w=new Map}){this.indirections=u,this.namespace=s,this.reference=o,this.options=i,this.ancestors=new AncestorLineage(..._),this.refractCache=w}toBaseURI(o){return resolve(this.reference.uri,sanitize(stripHash(o)))}async toReference(o){if(this.reference.depth>=this.options.resolve.maxDepth)throw new qS(`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file \"${this.reference.uri}\"`);const s=this.toBaseURI(o),{refSet:i}=this.reference;if(i.has(s))return i.find(AS(s,\"uri\"));const u=await _swagger_api_apidom_reference_es_parse(unsanitize(s),{...this.options,parse:{...this.options.parse,mediaType:\"text/plain\"}}),_=new zw({uri:s,value:cloneDeep(u),depth:this.reference.depth+1});if(i.add(_),this.options.dereference.immutable){const o=new zw({uri:`immutable://${s}`,value:u,depth:this.reference.depth+1});i.add(o)}return _}toAncestorLineage(o){const s=new Set(o.filter(sp));return[new AncestorLineage(...this.ancestors,s),s]}async ReferenceElement(o,s,i,u,_,w){if(this.indirections.includes(o))return!1;const[x,C]=this.toAncestorLineage([..._,i]),j=this.toBaseURI(serializers_value(o.$ref)),L=stripHash(this.reference.uri)===j,B=!L;if(!this.options.resolve.internal&&L)return!1;if(!this.options.resolve.external&&B)return!1;const $=await this.toReference(serializers_value(o.$ref)),V=resolve(j,serializers_value(o.$ref));this.indirections.push(o);const U=uriToPointer(V);let z=es_evaluate(U,$.value.result);if(z.id=US.identify(z),isPrimitiveElement(z)){const s=serializers_value(o.meta.get(\"referenced-element\")),i=`${s}-${serializers_value(US.identify(z))}`;if(this.refractCache.has(i))z=this.refractCache.get(i);else if(isReferenceLikeElement(z))z=j_.refract(z),z.setMetaProperty(\"referenced-element\",s),this.refractCache.set(i,z);else{z=this.namespace.getElementClass(s).refract(z),this.refractCache.set(i,z)}}if(o===z)throw new Ba(\"Recursive Reference Object detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(x.includes(z)){if($.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var Y,Z;const s=new Xu.sI(z.id,{type:\"reference\",uri:$.uri,$ref:serializers_value(o.$ref)}),u=(null!==(Y=null===(Z=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===Z?void 0:Z.circularReplacer)&&void 0!==Y?Y:this.options.dereference.circularReplacer)(s);return w.replaceWith(u,mutationReplacer),!i&&u}}const ee=stripHash($.refSet.rootRef.uri)!==$.uri,ie=[\"error\",\"replace\"].includes(this.options.dereference.circular);if((B||ee||PE(z)||ie)&&!x.includesCycle(z)){C.add(o);const s=new OpenAPI3_1DereferenceVisitor({reference:$,namespace:this.namespace,indirections:[...this.indirections],options:this.options,refractCache:this.refractCache,ancestors:x});z=await VS(z,s,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),C.delete(o)}this.indirections.pop();const ae=cloneShallow(z);return ae.setMetaProperty(\"id\",US.generateId()),ae.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref),description:serializers_value(o.description),summary:serializers_value(o.summary)}),ae.setMetaProperty(\"ref-origin\",$.uri),ae.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(US.identify(o))),pp(z)&&pp(ae)&&(o.hasKey(\"description\")&&\"description\"in z&&(ae.remove(\"description\"),ae.set(\"description\",o.get(\"description\"))),o.hasKey(\"summary\")&&\"summary\"in z&&(ae.remove(\"summary\"),ae.set(\"summary\",o.get(\"summary\")))),w.replaceWith(ae,mutationReplacer),!i&&ae}async PathItemElement(o,s,i,u,_,w){if(!ip(o.$ref))return;if(this.indirections.includes(o))return!1;const[x,C]=this.toAncestorLineage([..._,i]),j=this.toBaseURI(serializers_value(o.$ref)),L=stripHash(this.reference.uri)===j,B=!L;if(!this.options.resolve.internal&&L)return;if(!this.options.resolve.external&&B)return;const $=await this.toReference(serializers_value(o.$ref)),V=resolve(j,serializers_value(o.$ref));this.indirections.push(o);const U=uriToPointer(V);let z=es_evaluate(U,$.value.result);if(z.id=US.identify(z),isPrimitiveElement(z)){const o=`path-item-${serializers_value(US.identify(z))}`;this.refractCache.has(o)?z=this.refractCache.get(o):(z=C_.refract(z),this.refractCache.set(o,z))}if(o===z)throw new Ba(\"Recursive Path Item Object reference detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(x.includes(z)){if($.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var Y,Z;const s=new Xu.sI(z.id,{type:\"path-item\",uri:$.uri,$ref:serializers_value(o.$ref)}),u=(null!==(Y=null===(Z=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===Z?void 0:Z.circularReplacer)&&void 0!==Y?Y:this.options.dereference.circularReplacer)(s);return w.replaceWith(u,mutationReplacer),!i&&u}}const ee=stripHash($.refSet.rootRef.uri)!==$.uri,ie=[\"error\",\"replace\"].includes(this.options.dereference.circular);if((B||ee||AE(z)&&ip(z.$ref)||ie)&&!x.includesCycle(z)){C.add(o);const s=new OpenAPI3_1DereferenceVisitor({reference:$,namespace:this.namespace,indirections:[...this.indirections],options:this.options,refractCache:this.refractCache,ancestors:x});z=await VS(z,s,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),C.delete(o)}if(this.indirections.pop(),AE(z)){const s=new C_([...z.content],cloneDeep(z.meta),cloneDeep(z.attributes));s.setMetaProperty(\"id\",US.generateId()),o.forEach(((o,i,u)=>{s.remove(serializers_value(i)),s.content.push(u)})),s.remove(\"$ref\"),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",$.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(US.identify(o))),z=s}return w.replaceWith(z,mutationReplacer),i?void 0:z}async LinkElement(o,s,i,u,_,w){if(!ip(o.operationRef)&&!ip(o.operationId))return;if(ip(o.operationRef)&&ip(o.operationId))throw new Ba(\"LinkElement operationRef and operationId fields are mutually exclusive.\");let x;if(ip(o.operationRef)){var C;const s=uriToPointer(serializers_value(o.operationRef)),u=this.toBaseURI(serializers_value(o.operationRef)),_=stripHash(this.reference.uri)===u,j=!_;if(!this.options.resolve.internal&&_)return;if(!this.options.resolve.external&&j)return;const L=await this.toReference(serializers_value(o.operationRef));if(x=es_evaluate(s,L.value.result),isPrimitiveElement(x)){const o=`operation-${serializers_value(US.identify(x))}`;this.refractCache.has(o)?x=this.refractCache.get(o):(x=k_.refract(x),this.refractCache.set(o,x))}x=cloneShallow(x),x.setMetaProperty(\"ref-origin\",L.uri);const B=cloneShallow(o);return null===(C=B.operationRef)||void 0===C||C.meta.set(\"operation\",x),w.replaceWith(B,mutationReplacer),i?void 0:B}if(ip(o.operationId)){var j;const s=serializers_value(o.operationId),u=await this.toReference(unsanitize(this.reference.uri));if(x=traversal_find((o=>OE(o)&&sp(o.operationId)&&o.operationId.equals(s)),u.value.result),Wl(x))throw new Ba(`OperationElement(operationId=${s}) not found.`);const _=cloneShallow(o);return null===(j=_.operationId)||void 0===j||j.meta.set(\"operation\",x),w.replaceWith(_,mutationReplacer),i?void 0:_}}async ExampleElement(o,s,i,u,_,w){if(!ip(o.externalValue))return;if(o.hasKey(\"value\")&&ip(o.externalValue))throw new Ba(\"ExampleElement value and externalValue fields are mutually exclusive.\");const x=this.toBaseURI(serializers_value(o.externalValue)),C=stripHash(this.reference.uri)===x,j=!C;if(!this.options.resolve.internal&&C)return;if(!this.options.resolve.external&&j)return;const L=await this.toReference(serializers_value(o.externalValue)),B=cloneShallow(L.value.result);B.setMetaProperty(\"ref-origin\",L.uri);const $=cloneShallow(o);return $.value=B,w.replaceWith($,mutationReplacer),i?void 0:$}async SchemaElement(o,s,i,u,_,w){if(!ip(o.$ref))return;if(this.indirections.includes(o))return!1;const[x,C]=this.toAncestorLineage([..._,i]);let j=await this.toReference(unsanitize(this.reference.uri)),{uri:L}=j;const B=resolveSchema$refField(L,o),$=stripHash(B),V=new Zw({uri:$}),U=IS((o=>o.canRead(V)),this.options.resolve.resolvers),z=!U;let Y,Z=stripHash(this.reference.uri)===B,ee=!Z;this.indirections.push(o);try{if(U||z){L=this.toBaseURI(B);const o=B,s=maybeRefractToSchemaElement(j.value.result);if(Y=uri_evaluate(o,s),Y=maybeRefractToSchemaElement(Y),Y.id=US.identify(Y),!this.options.resolve.internal&&Z)return;if(!this.options.resolve.external&&ee)return}else{if(L=this.toBaseURI(B),Z=stripHash(this.reference.uri)===L,ee=!Z,!this.options.resolve.internal&&Z)return;if(!this.options.resolve.external&&ee)return;j=await this.toReference(unsanitize(B));const o=uriToPointer(B),s=maybeRefractToSchemaElement(j.value.result);Y=es_evaluate(o,s),Y=maybeRefractToSchemaElement(Y),Y.id=US.identify(Y)}}catch(o){if(!(z&&o instanceof BS))throw o;if(isAnchor(uriToAnchor(B))){if(Z=stripHash(this.reference.uri)===L,ee=!Z,!this.options.resolve.internal&&Z)return;if(!this.options.resolve.external&&ee)return;j=await this.toReference(unsanitize(B));const o=uriToAnchor(B),s=maybeRefractToSchemaElement(j.value.result);Y=$anchor_evaluate(o,s),Y=maybeRefractToSchemaElement(Y),Y.id=US.identify(Y)}else{if(L=this.toBaseURI(B),Z=stripHash(this.reference.uri)===L,ee=!Z,!this.options.resolve.internal&&Z)return;if(!this.options.resolve.external&&ee)return;j=await this.toReference(unsanitize(B));const o=uriToPointer(B),s=maybeRefractToSchemaElement(j.value.result);Y=es_evaluate(o,s),Y=maybeRefractToSchemaElement(Y),Y.id=US.identify(Y)}}if(o===Y)throw new Ba(\"Recursive Schema Object reference detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(x.includes(Y)){if(j.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var ie,ae;const s=new Xu.sI(Y.id,{type:\"json-schema\",uri:j.uri,$ref:serializers_value(o.$ref)}),u=(null!==(ie=null===(ae=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===ae?void 0:ae.circularReplacer)&&void 0!==ie?ie:this.options.dereference.circularReplacer)(s);return w.replaceWith(u,mutationReplacer),!i&&u}}const ce=stripHash(j.refSet.rootRef.uri)!==j.uri,le=[\"error\",\"replace\"].includes(this.options.dereference.circular);if((ee||ce||TE(Y)&&ip(Y.$ref)||le)&&!x.includesCycle(Y)){C.add(o);const s=new OpenAPI3_1DereferenceVisitor({reference:j,namespace:this.namespace,indirections:[...this.indirections],options:this.options,refractCache:this.refractCache,ancestors:x});Y=await VS(Y,s,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),C.delete(o)}if(this.indirections.pop(),predicates_isBooleanJsonSchemaElement(Y)){const s=cloneDeep(Y);return s.setMetaProperty(\"id\",US.generateId()),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",j.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(US.identify(o))),w.replaceWith(s,mutationReplacer),!i&&s}if(TE(Y)){const s=new N_([...Y.content],cloneDeep(Y.meta),cloneDeep(Y.attributes));s.setMetaProperty(\"id\",US.generateId()),o.forEach(((o,i,u)=>{s.remove(serializers_value(i)),s.content.push(u)})),s.remove(\"$ref\"),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",j.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(US.identify(o))),Y=s}return w.replaceWith(Y,mutationReplacer),i?void 0:Y}}const zS=OpenAPI3_1DereferenceVisitor,WS=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")];const KS=class OpenAPI3_1DereferenceStrategy extends jS{constructor(o){super({...null!=o?o:{},name:\"openapi-3-1\"})}canDereference(o){var s;return\"text/plain\"!==o.mediaType?Uw.includes(o.mediaType):kE(null===(s=o.parseResult)||void 0===s?void 0:s.result)}async dereference(o,s){var i;const u=createNamespace(qw),_=null!==(i=s.dereference.refSet)&&void 0!==i?i:new Ww,w=new Ww;let x,C=_;_.has(o.uri)?x=_.find(AS(o.uri,\"uri\")):(x=new zw({uri:o.uri,value:o.parseResult}),_.add(x)),s.dereference.immutable&&(_.refs.map((o=>new zw({...o,value:cloneDeep(o.value)}))).forEach((o=>w.add(o))),x=w.find((s=>s.uri===o.uri)),C=w);const j=new zS({reference:x,namespace:u,options:s}),L=await WS(C.rootRef.value,j,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType});return s.dereference.immutable&&w.refs.filter((o=>o.uri.startsWith(\"immutable://\"))).map((o=>new zw({...o,uri:o.uri.replace(/^immutable:\\/\\//,\"\")}))).forEach((o=>_.add(o))),null===s.dereference.refSet&&_.clean(),w.clean(),L}},to_path=o=>{const s=(o=>o.slice(2))(o);return s.reduce(((o,i,u)=>{if(dp(i)){const s=String(serializers_value(i.key));o.push(s)}else if(hp(s[u-2])){const _=s[u-2].content.indexOf(i);o.push(_)}return o}),[])};const HS=class ModelPropertyMacroVisitor{modelPropertyMacro;options;SchemaElement={leave:(o,s,i,u,_)=>{void 0!==o.properties&&pp(o.properties)&&o.properties.forEach((s=>{if(pp(s))try{const o=this.modelPropertyMacro(serializers_value(s));s.set(\"default\",o)}catch(s){var u,w;const x=new Error(s,{cause:s});x.fullPath=[...to_path([..._,i,o]),\"properties\"],null===(u=this.options.dereference.dereferenceOpts)||void 0===u||null===(u=u.errors)||void 0===u||null===(w=u.push)||void 0===w||w.call(u,x)}}))}};constructor({modelPropertyMacro:o,options:s}){this.modelPropertyMacro=o,this.options=s}};const JS=class all_of_AllOfVisitor{options;SchemaElement={leave(o,s,i,u,_){if(void 0===o.allOf)return;if(!hp(o.allOf)){var w,x;const s=new TypeError(\"allOf must be an array\");return s.fullPath=[...to_path([..._,i,o]),\"allOf\"],void(null===(w=this.options.dereference.dereferenceOpts)||void 0===w||null===(w=w.errors)||void 0===w||null===(x=w.push)||void 0===x||x.call(w,s))}if(o.allOf.isEmpty)return void o.remove(\"allOf\");if(!o.allOf.content.every(TE)){var C,j;const s=new TypeError(\"Elements in allOf must be objects\");return s.fullPath=[...to_path([..._,i,o]),\"allOf\"],void(null===(C=this.options.dereference.dereferenceOpts)||void 0===C||null===(C=C.errors)||void 0===C||null===(j=C.push)||void 0===j||j.call(C,s))}for(;o.hasKey(\"allOf\");){const{allOf:s}=o;o.remove(\"allOf\");const i=deepmerge.all([...s.content,o]);if(o.hasKey(\"$$ref\")||i.remove(\"$$ref\"),o.hasKey(\"example\")){const s=i.getMember(\"example\");s&&(s.value=o.get(\"example\"))}if(o.hasKey(\"examples\")){const s=i.getMember(\"examples\");s&&(s.value=o.get(\"examples\"))}o.content=i.content}}};constructor({options:o}){this.options=o}};const GS=class ParameterMacroVisitor{parameterMacro;options;#e;OperationElement={enter:o=>{this.#e=o},leave:()=>{this.#e=void 0}};ParameterElement={leave:(o,s,i,u,_)=>{const w=this.#e?serializers_value(this.#e):null,x=serializers_value(o);try{const s=this.parameterMacro(w,x);o.set(\"default\",s)}catch(o){var C,j;const s=new Error(o,{cause:o});s.fullPath=to_path([..._,i]),null===(C=this.options.dereference.dereferenceOpts)||void 0===C||null===(C=C.errors)||void 0===C||null===(j=C.push)||void 0===j||j.call(C,s)}}};constructor({parameterMacro:o,options:s}){this.parameterMacro=o,this.options=s}},get_root_cause=o=>{if(null==o.cause)return o;let{cause:s}=o;for(;null!=s.cause;)s=s.cause;return s};const YS=class SchemaRefError extends Fa{},{wrapError:XS}=Ru,QS=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")],ZS=new IdentityManager,dereference_mutationReplacer=(o,s,i,u)=>{dp(u)?u.value=o:Array.isArray(u)&&(u[i]=o)};class OpenAPI3_1SwaggerClientDereferenceVisitor extends zS{useCircularStructures;allowMetaPatches;basePath;constructor({allowMetaPatches:o=!0,useCircularStructures:s=!1,basePath:i=null,...u}){super(u),this.allowMetaPatches=o,this.useCircularStructures=s,this.basePath=i}async ReferenceElement(o,s,i,u,_,w){try{if(this.indirections.includes(o))return!1;const[s,u]=this.toAncestorLineage([..._,i]),L=this.toBaseURI(serializers_value(o.$ref)),B=stripHash(this.reference.uri)===L,$=!B;if(!this.options.resolve.internal&&B)return!1;if(!this.options.resolve.external&&$)return!1;const V=await this.toReference(serializers_value(o.$ref)),U=resolve(L,serializers_value(o.$ref));this.indirections.push(o);const z=uriToPointer(U);let Y=es_evaluate(z,V.value.result);if(Y.id=ZS.identify(Y),isPrimitiveElement(Y)){const s=serializers_value(o.meta.get(\"referenced-element\")),i=`${s}-${serializers_value(ZS.identify(Y))}`;if(this.refractCache.has(i))Y=this.refractCache.get(i);else if(isReferenceLikeElement(Y))Y=j_.refract(Y),Y.setMetaProperty(\"referenced-element\",s),this.refractCache.set(i,Y);else{Y=this.namespace.getElementClass(s).refract(Y),this.refractCache.set(i,Y)}}if(o===Y)throw new Ba(\"Recursive Reference Object detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(s.includes(Y)){if(V.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var x,C;const s=new Xu.sI(Y.id,{type:\"reference\",uri:V.uri,$ref:serializers_value(o.$ref),baseURI:U,referencingElement:o}),u=(null!==(x=null===(C=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===C?void 0:C.circularReplacer)&&void 0!==x?x:this.options.dereference.circularReplacer)(s);return w.replaceWith(s,dereference_mutationReplacer),!i&&u}}const Z=stripHash(V.refSet.rootRef.uri)!==V.uri,ee=[\"error\",\"replace\"].includes(this.options.dereference.circular);if(($||Z||PE(Y)||ee)&&!s.includesCycle(Y)){var j;u.add(o);const w=new OpenAPI3_1SwaggerClientDereferenceVisitor({reference:V,namespace:this.namespace,indirections:[...this.indirections],options:this.options,refractCache:this.refractCache,ancestors:s,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,basePath:null!==(j=this.basePath)&&void 0!==j?j:[...to_path([..._,i,o]),\"$ref\"]});Y=await QS(Y,w,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),u.delete(o)}this.indirections.pop();const ie=cloneShallow(Y);if(ie.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref),description:serializers_value(o.description),summary:serializers_value(o.summary)}),ie.setMetaProperty(\"ref-origin\",V.uri),ie.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(ZS.identify(o))),pp(Y)&&(o.hasKey(\"description\")&&\"description\"in Y&&(ie.remove(\"description\"),ie.set(\"description\",o.get(\"description\"))),o.hasKey(\"summary\")&&\"summary\"in Y&&(ie.remove(\"summary\"),ie.set(\"summary\",o.get(\"summary\")))),this.allowMetaPatches&&pp(ie)&&!ie.hasKey(\"$$ref\")){const o=resolve(L,U);ie.set(\"$$ref\",o)}return w.replaceWith(ie,dereference_mutationReplacer),!i&&ie}catch(s){var L,B,$;const u=get_root_cause(s),w=XS(u,{baseDoc:this.reference.uri,$ref:serializers_value(o.$ref),pointer:uriToPointer(serializers_value(o.$ref)),fullPath:null!==(L=this.basePath)&&void 0!==L?L:[...to_path([..._,i,o]),\"$ref\"]});return void(null===(B=this.options.dereference.dereferenceOpts)||void 0===B||null===(B=B.errors)||void 0===B||null===($=B.push)||void 0===$||$.call(B,w))}}async PathItemElement(o,s,i,u,_,w){try{if(!ip(o.$ref))return;if(this.indirections.includes(o))return!1;if(includesClasses([\"cycle\"],o.$ref))return!1;const[s,u]=this.toAncestorLineage([..._,i]),L=this.toBaseURI(serializers_value(o.$ref)),B=stripHash(this.reference.uri)===L,$=!B;if(!this.options.resolve.internal&&B)return;if(!this.options.resolve.external&&$)return;const V=await this.toReference(serializers_value(o.$ref)),U=resolve(L,serializers_value(o.$ref));this.indirections.push(o);const z=uriToPointer(U);let Y=es_evaluate(z,V.value.result);if(Y.id=ZS.identify(Y),isPrimitiveElement(Y)){const o=`path-item-${serializers_value(ZS.identify(Y))}`;this.refractCache.has(o)?Y=this.refractCache.get(o):(Y=C_.refract(Y),this.refractCache.set(o,Y))}if(o===Y)throw new Ba(\"Recursive Path Item Object reference detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(s.includes(Y)){if(V.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var x,C;const s=new Xu.sI(Y.id,{type:\"path-item\",uri:V.uri,$ref:serializers_value(o.$ref),baseURI:U,referencingElement:o}),u=(null!==(x=null===(C=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===C?void 0:C.circularReplacer)&&void 0!==x?x:this.options.dereference.circularReplacer)(s);return w.replaceWith(s,dereference_mutationReplacer),!i&&u}}const Z=stripHash(V.refSet.rootRef.uri)!==V.uri,ee=[\"error\",\"replace\"].includes(this.options.dereference.circular);if(($||Z||AE(Y)&&ip(Y.$ref)||ee)&&!s.includesCycle(Y)){var j;u.add(o);const w=new OpenAPI3_1SwaggerClientDereferenceVisitor({reference:V,namespace:this.namespace,indirections:[...this.indirections],options:this.options,ancestors:s,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,basePath:null!==(j=this.basePath)&&void 0!==j?j:[...to_path([..._,i,o]),\"$ref\"]});Y=await QS(Y,w,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),u.delete(o)}if(this.indirections.pop(),AE(Y)){const s=new C_([...Y.content],cloneDeep(Y.meta),cloneDeep(Y.attributes));if(o.forEach(((o,i,u)=>{s.remove(serializers_value(i)),s.content.push(u)})),s.remove(\"$ref\"),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",V.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(ZS.identify(o))),this.allowMetaPatches&&void 0===s.get(\"$$ref\")){const o=resolve(L,U);s.set(\"$$ref\",o)}Y=s}return w.replaceWith(Y,dereference_mutationReplacer),i?void 0:Y}catch(s){var L,B,$;const u=get_root_cause(s),w=XS(u,{baseDoc:this.reference.uri,$ref:serializers_value(o.$ref),pointer:uriToPointer(serializers_value(o.$ref)),fullPath:null!==(L=this.basePath)&&void 0!==L?L:[...to_path([..._,i,o]),\"$ref\"]});return void(null===(B=this.options.dereference.dereferenceOpts)||void 0===B||null===(B=B.errors)||void 0===B||null===($=B.push)||void 0===$||$.call(B,w))}}async SchemaElement(o,s,i,u,_,w){try{if(!ip(o.$ref))return;if(this.indirections.includes(o))return!1;const[s,u]=this.toAncestorLineage([..._,i]);let L=await this.toReference(unsanitize(this.reference.uri)),{uri:B}=L;const $=resolveSchema$refField(B,o),V=stripHash($),U=new Zw({uri:V}),z=!this.options.resolve.resolvers.some((o=>o.canRead(U))),Y=!z;let Z,ee=stripHash(this.reference.uri)===$,ie=!ee;this.indirections.push(o);try{if(z||Y){B=this.toBaseURI($);const o=$,s=maybeRefractToSchemaElement(L.value.result);if(Z=uri_evaluate(o,s),Z=maybeRefractToSchemaElement(Z),Z.id=ZS.identify(Z),!this.options.resolve.internal&&ee)return;if(!this.options.resolve.external&&ie)return}else{if(B=this.toBaseURI($),ee=stripHash(this.reference.uri)===B,ie=!ee,!this.options.resolve.internal&&ee)return;if(!this.options.resolve.external&&ie)return;L=await this.toReference(unsanitize($));const o=uriToPointer($),s=maybeRefractToSchemaElement(L.value.result);Z=es_evaluate(o,s),Z=maybeRefractToSchemaElement(Z),Z.id=ZS.identify(Z)}}catch(o){if(!(Y&&o instanceof BS))throw o;if(isAnchor(uriToAnchor($))){if(ee=stripHash(this.reference.uri)===B,ie=!ee,!this.options.resolve.internal&&ee)return;if(!this.options.resolve.external&&ie)return;L=await this.toReference(unsanitize($));const o=uriToAnchor($),s=maybeRefractToSchemaElement(L.value.result);Z=$anchor_evaluate(o,s),Z=maybeRefractToSchemaElement(Z),Z.id=ZS.identify(Z)}else{if(B=this.toBaseURI(serializers_value($)),ee=stripHash(this.reference.uri)===B,ie=!ee,!this.options.resolve.internal&&ee)return;if(!this.options.resolve.external&&ie)return;L=await this.toReference(unsanitize($));const o=uriToPointer($),s=maybeRefractToSchemaElement(L.value.result);Z=es_evaluate(o,s),Z=maybeRefractToSchemaElement(Z),Z.id=ZS.identify(Z)}}if(o===Z)throw new Ba(\"Recursive Schema Object reference detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(s.includes(Z)){if(L.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var x,C;const s=new Xu.sI(Z.id,{type:\"json-schema\",uri:L.uri,$ref:serializers_value(o.$ref),baseURI:resolve(B,$),referencingElement:o}),u=(null!==(x=null===(C=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===C?void 0:C.circularReplacer)&&void 0!==x?x:this.options.dereference.circularReplacer)(s);return w.replaceWith(u,dereference_mutationReplacer),!i&&u}}const ae=stripHash(L.refSet.rootRef.uri)!==L.uri,ce=[\"error\",\"replace\"].includes(this.options.dereference.circular);if((ie||ae||TE(Z)&&ip(Z.$ref)||ce)&&!s.includesCycle(Z)){var j;u.add(o);const w=new OpenAPI3_1SwaggerClientDereferenceVisitor({reference:L,namespace:this.namespace,indirections:[...this.indirections],options:this.options,useCircularStructures:this.useCircularStructures,allowMetaPatches:this.allowMetaPatches,ancestors:s,basePath:null!==(j=this.basePath)&&void 0!==j?j:[...to_path([..._,i,o]),\"$ref\"]});Z=await QS(Z,w,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),u.delete(o)}if(this.indirections.pop(),predicates_isBooleanJsonSchemaElement(Z)){const s=cloneDeep(Z);return s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",L.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(ZS.identify(o))),w.replaceWith(s,dereference_mutationReplacer),!i&&s}if(TE(Z)){const s=new N_([...Z.content],cloneDeep(Z.meta),cloneDeep(Z.attributes));if(o.forEach(((o,i,u)=>{s.remove(serializers_value(i)),s.content.push(u)})),s.remove(\"$ref\"),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",L.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(ZS.identify(o))),this.allowMetaPatches&&void 0===s.get(\"$$ref\")){const o=resolve(B,$);s.set(\"$$ref\",o)}Z=s}return w.replaceWith(Z,dereference_mutationReplacer),i?void 0:Z}catch(s){var L,B,$;const u=get_root_cause(s),w=new YS(`Could not resolve reference: ${u.message}`,{baseDoc:this.reference.uri,$ref:serializers_value(o.$ref),fullPath:null!==(L=this.basePath)&&void 0!==L?L:[...to_path([..._,i,o]),\"$ref\"],cause:u});return void(null===(B=this.options.dereference.dereferenceOpts)||void 0===B||null===(B=B.errors)||void 0===B||null===($=B.push)||void 0===$||$.call(B,w))}}async LinkElement(){}async ExampleElement(o,s,i,u,_,w){try{return await super.ExampleElement(o,s,i,u,_,w)}catch(s){var x,C,j;const u=get_root_cause(s),w=XS(u,{baseDoc:this.reference.uri,externalValue:serializers_value(o.externalValue),fullPath:null!==(x=this.basePath)&&void 0!==x?x:[...to_path([..._,i,o]),\"externalValue\"]});return void(null===(C=this.options.dereference.dereferenceOpts)||void 0===C||null===(C=C.errors)||void 0===C||null===(j=C.push)||void 0===j||j.call(C,w))}}}const ex=OpenAPI3_1SwaggerClientDereferenceVisitor,tx=mergeAll[Symbol.for(\"nodejs.util.promisify.custom\")];const rx=class RootVisitor{constructor({parameterMacro:o,modelPropertyMacro:s,mode:i,options:u,..._}){const w=[];w.push(new ex({..._,options:u})),\"function\"==typeof s&&w.push(new HS({modelPropertyMacro:s,options:u})),\"strict\"!==i&&w.push(new JS({options:u})),\"function\"==typeof o&&w.push(new GS({parameterMacro:o,options:u}));const x=tx(w,{nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType});Object.assign(this,x)}},nx=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")];const ox=class OpenAPI3_1SwaggerClientDereferenceStrategy extends KS{allowMetaPatches;parameterMacro;modelPropertyMacro;mode;ancestors;constructor({allowMetaPatches:o=!1,parameterMacro:s=null,modelPropertyMacro:i=null,mode:u=\"non-strict\",ancestors:_=[],...w}={}){super({...w}),this.name=\"openapi-3-1-swagger-client\",this.allowMetaPatches=o,this.parameterMacro=s,this.modelPropertyMacro=i,this.mode=u,this.ancestors=[..._]}async dereference(o,s){var i;const u=createNamespace(qw),_=null!==(i=s.dereference.refSet)&&void 0!==i?i:new Ww,w=new Ww;let x,C=_;_.has(o.uri)?x=_.find((s=>s.uri===o.uri)):(x=new zw({uri:o.uri,value:o.parseResult}),_.add(x)),s.dereference.immutable&&(_.refs.map((o=>new zw({...o,value:cloneDeep(o.value)}))).forEach((o=>w.add(o))),x=w.find((s=>s.uri===o.uri)),C=w);const j=new rx({reference:x,namespace:u,options:s,allowMetaPatches:this.allowMetaPatches,ancestors:this.ancestors,modelPropertyMacro:this.modelPropertyMacro,mode:this.mode,parameterMacro:this.parameterMacro}),L=await nx(C.rootRef.value,j,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType});return s.dereference.immutable&&w.refs.filter((o=>o.uri.startsWith(\"immutable://\"))).map((o=>new zw({...o,uri:o.uri.replace(/^immutable:\\/\\//,\"\")}))).forEach((o=>_.add(o))),null===s.dereference.refSet&&_.clean(),w.clean(),L}},circularReplacer=o=>{const s=serializers_value(o.meta.get(\"baseURI\")),i=o.meta.get(\"referencingElement\");return new Xu.Sh({$ref:s},cloneDeep(i.meta),cloneDeep(i.attributes))},resolveOpenAPI31Strategy=async o=>{const{spec:s,timeout:i,redirects:u,requestInterceptor:_,responseInterceptor:w,pathDiscriminator:x=[],allowMetaPatches:C=!1,useCircularStructures:j=!1,skipNormalization:L=!1,parameterMacro:B=null,modelPropertyMacro:$=null,mode:V=\"non-strict\"}=o;try{const{cache:U}=resolveOpenAPI31Strategy,z=isHttpUrl(url_cwd())?url_cwd():Su,Y=options_retrievalURI(o),Z=resolve(z,Y);let ee;U.has(s)?ee=U.get(s):(ee=x_.refract(s),ee.classes.push(\"result\"),U.set(s,ee));const ie=new np([ee]),ae=es_compile(x),ce=\"\"===ae?\"\":`#${ae}`,le=es_evaluate(ae,ee),pe=new zw({uri:Z,value:ie}),de=new Ww({refs:[pe]});\"\"!==ae&&(de.rootRef=void 0);const fe=[new Set([le])],ye=[],be=await(async(o,s={})=>{const i=util_merge(Kw,s);return dereferenceApiDOM(o,i)})(le,{resolve:{baseURI:`${Z}${ce}`,resolvers:[new SS({timeout:i||1e4,redirects:u||10})],resolverOpts:{swaggerHTTPClientConfig:{requestInterceptor:_,responseInterceptor:w}},strategies:[new cS]},parse:{mediaType:Uw.latest(),parsers:[new OS({allowEmpty:!1,sourceMap:!1}),new CS({allowEmpty:!1,sourceMap:!1}),new xS({allowEmpty:!1,sourceMap:!1}),new kS({allowEmpty:!1,sourceMap:!1}),new iS({allowEmpty:!1,sourceMap:!1})]},dereference:{maxDepth:100,strategies:[new ox({allowMetaPatches:C,useCircularStructures:j,parameterMacro:B,modelPropertyMacro:$,mode:V,ancestors:fe})],refSet:de,dereferenceOpts:{errors:ye},immutable:!1,circular:j?\"ignore\":\"replace\",circularReplacer:j?Kw.dereference.circularReplacer:circularReplacer}}),_e=((o,s,i)=>new vh({element:i}).transclude(o,s))(le,be,ee),we=L?_e:openapi_3_1_apidom_normalize(_e);return{spec:serializers_value(we),errors:ye}}catch(o){if(o instanceof ud||o instanceof dd)return{spec:null,errors:[]};throw o}};resolveOpenAPI31Strategy.cache=new WeakMap;const sx=resolveOpenAPI31Strategy,ix={name:\"openapi-3-1-apidom\",match:({spec:o})=>isOpenAPI31(o),normalize:({spec:o})=>pojoAdapter(openapi_3_1_apidom_normalize)(o),resolve:async o=>sx(o)},ax=ix,makeResolve=o=>async s=>(async o=>{const{spec:s,requestInterceptor:i,responseInterceptor:u}=o,_=options_retrievalURI(o),w=options_httpClient(o),x=s||await makeFetchJSON(w,{requestInterceptor:i,responseInterceptor:u})(_),C={...o,spec:x};return o.strategies.find((o=>o.match(C))).resolve(C)})({...o,...s}),cx=makeResolve({strategies:[Gu,Hu,Wu]});var lx=__webpack_require__(39584),ux=__webpack_require__.n(lx),px=__webpack_require__(57427);function is_plain_object_isObject(o){return\"[object Object]\"===Object.prototype.toString.call(o)}function is_plain_object_isPlainObject(o){var s,i;return!1!==is_plain_object_isObject(o)&&(void 0===(s=o.constructor)||!1!==is_plain_object_isObject(i=s.prototype)&&!1!==i.hasOwnProperty(\"isPrototypeOf\"))}const hx=function fnparser(){const o=mx,s=fx,i=this,u=\"parser.js: Parser(): \";i.ast=void 0,i.stats=void 0,i.trace=void 0,i.callbacks=[];let _,w,x,C,j,L,B,$=0,V=0,U=0,z=0,Y=0,Z=new function systemData(){this.state=o.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=o.ACTIVE,this.phraseLength=0}};i.parse=(ee,ie,ae,ce)=>{const le=`${u}parse(): `;$=0,V=0,U=0,z=0,Y=0,_=void 0,w=void 0,x=void 0,C=void 0,Z.refresh(),j=void 0,L=void 0,B=void 0,C=s.stringToChars(ae),_=ee.rules,w=ee.udts;const pe=ie.toLowerCase();let de;for(const o in _)if(pe===_[o].lower){de=_[o].index;break}if(void 0===de)throw new Error(`${le}start rule name '${startRule}' not recognized`);(()=>{const o=`${u}initializeCallbacks(): `;let s,x;for(j=[],L=[],s=0;s<_.length;s+=1)j[s]=void 0;for(s=0;s<w.length;s+=1)L[s]=void 0;const C=[];for(s=0;s<_.length;s+=1)C.push(_[s].lower);for(s=0;s<w.length;s+=1)C.push(w[s].lower);for(const u in i.callbacks){if(s=C.indexOf(u.toLowerCase()),s<0)throw new Error(`${o}syntax callback '${u}' not a rule or udt name`);if(x=i.callbacks[u]?i.callbacks[u]:void 0,\"function\"!=typeof x&&void 0!==x)throw new Error(`${o}syntax callback[${u}] must be function reference or falsy)`);s<_.length?j[s]=x:L[s-_.length]=x}})(),i.trace&&i.trace.init(_,w,C),i.stats&&i.stats.init(_,w),i.ast&&i.ast.init(_,w,C),B=ce,x=[{type:o.RNM,index:de}],opExecute(0,0),x=void 0;let fe=!1;switch(Z.state){case o.ACTIVE:throw new Error(`${le}final state should never be 'ACTIVE'`);case o.NOMATCH:fe=!1;break;case o.EMPTY:case o.MATCH:fe=Z.phraseLength===C.length;break;default:throw new Error(\"unrecognized state\")}return{success:fe,state:Z.state,stateName:o.idName(Z.state),length:C.length,matched:Z.phraseLength,maxMatched:Y,maxTreeDepth:U,nodeHits:z}};const validateRnmCallbackResult=(s,i,_,w)=>{if(i.phraseLength>_){let o=`${u}opRNM(${s.name}): callback function error: `;throw o+=`sysData.phraseLength: ${i.phraseLength}`,o+=` must be <= remaining chars: ${_}`,new Error(o)}switch(i.state){case o.ACTIVE:if(!w)throw new Error(`${u}opRNM(${s.name}): callback function return error. ACTIVE state not allowed.`);break;case o.EMPTY:i.phraseLength=0;break;case o.MATCH:0===i.phraseLength&&(i.state=o.EMPTY);break;case o.NOMATCH:i.phraseLength=0;break;default:throw new Error(`${u}opRNM(${s.name}): callback function return error. Unrecognized return state: ${i.state}`)}},opUDT=(s,j)=>{let V,U,z;const Y=x[s],ee=w[Y.index];Z.UdtIndex=ee.index,$||(z=i.ast&&i.ast.udtDefined(Y.index),z&&(U=_.length+Y.index,V=i.ast.getLength(),i.ast.down(U,ee.name)));const ie=C.length-j;L[Y.index](Z,C,j,B),((s,i,_)=>{if(i.phraseLength>_){let o=`${u}opUDT(${s.name}): callback function error: `;throw o+=`sysData.phraseLength: ${i.phraseLength}`,o+=` must be <= remaining chars: ${_}`,new Error(o)}switch(i.state){case o.ACTIVE:throw new Error(`${u}opUDT(${s.name}) ACTIVE state return not allowed.`);case o.EMPTY:if(!s.empty)throw new Error(`${u}opUDT(${s.name}) may not return EMPTY.`);i.phraseLength=0;break;case o.MATCH:if(0===i.phraseLength){if(!s.empty)throw new Error(`${u}opUDT(${s.name}) may not return EMPTY.`);i.state=o.EMPTY}break;case o.NOMATCH:i.phraseLength=0;break;default:throw new Error(`${u}opUDT(${s.name}): callback function return error. Unrecognized return state: ${i.state}`)}})(ee,Z,ie),$||z&&(Z.state===o.NOMATCH?i.ast.setLength(V):i.ast.up(U,ee.name,j,Z.phraseLength))},opExecute=(s,w)=>{const L=`${u}opExecute(): `,ee=x[s];switch(z+=1,V>U&&(U=V),V+=1,Z.refresh(),i.trace&&i.trace.down(ee,w),ee.type){case o.ALT:((s,i)=>{const u=x[s];for(let s=0;s<u.children.length&&(opExecute(u.children[s],i),Z.state===o.NOMATCH);s+=1);})(s,w);break;case o.CAT:((s,u)=>{let _,w,C,j;const L=x[s];i.ast&&(w=i.ast.getLength()),_=!0,C=u,j=0;for(let s=0;s<L.children.length;s+=1){if(opExecute(L.children[s],C),Z.state===o.NOMATCH){_=!1;break}C+=Z.phraseLength,j+=Z.phraseLength}_?(Z.state=0===j?o.EMPTY:o.MATCH,Z.phraseLength=j):(Z.state=o.NOMATCH,Z.phraseLength=0,i.ast&&i.ast.setLength(w))})(s,w);break;case o.REP:((s,u)=>{let _,w,j,L;const B=x[s];if(0===B.max)return Z.state=o.EMPTY,void(Z.phraseLength=0);for(w=u,j=0,L=0,i.ast&&(_=i.ast.getLength());!(w>=C.length)&&(opExecute(s+1,w),Z.state!==o.NOMATCH)&&Z.state!==o.EMPTY&&(L+=1,j+=Z.phraseLength,w+=Z.phraseLength,L!==B.max););Z.state===o.EMPTY||L>=B.min?(Z.state=0===j?o.EMPTY:o.MATCH,Z.phraseLength=j):(Z.state=o.NOMATCH,Z.phraseLength=0,i.ast&&i.ast.setLength(_))})(s,w);break;case o.RNM:((s,u)=>{let w,L,V;const U=x[s],z=_[U.index],Y=j[z.index];if($||(L=i.ast&&i.ast.ruleDefined(U.index),L&&(w=i.ast.getLength(),i.ast.down(U.index,_[U.index].name))),Y){const s=C.length-u;Y(Z,C,u,B),validateRnmCallbackResult(z,Z,s,!0),Z.state===o.ACTIVE&&(V=x,x=z.opcodes,opExecute(0,u),x=V,Y(Z,C,u,B),validateRnmCallbackResult(z,Z,s,!1))}else V=x,x=z.opcodes,opExecute(0,u,Z),x=V;$||L&&(Z.state===o.NOMATCH?i.ast.setLength(w):i.ast.up(U.index,z.name,u,Z.phraseLength))})(s,w);break;case o.TRG:((s,i)=>{const u=x[s];Z.state=o.NOMATCH,i<C.length&&u.min<=C[i]&&C[i]<=u.max&&(Z.state=o.MATCH,Z.phraseLength=1)})(s,w);break;case o.TBS:((s,i)=>{const u=x[s],_=u.string.length;if(Z.state=o.NOMATCH,i+_<=C.length){for(let o=0;o<_;o+=1)if(C[i+o]!==u.string[o])return;Z.state=o.MATCH,Z.phraseLength=_}})(s,w);break;case o.TLS:((s,i)=>{let u;const _=x[s];Z.state=o.NOMATCH;const w=_.string.length;if(0!==w){if(i+w<=C.length){for(let o=0;o<w;o+=1)if(u=C[i+o],u>=65&&u<=90&&(u+=32),u!==_.string[o])return;Z.state=o.MATCH,Z.phraseLength=w}}else Z.state=o.EMPTY})(s,w);break;case o.UDT:opUDT(s,w);break;case o.AND:((s,i)=>{switch($+=1,opExecute(s+1,i),$-=1,Z.phraseLength=0,Z.state){case o.EMPTY:case o.MATCH:Z.state=o.EMPTY;break;case o.NOMATCH:Z.state=o.NOMATCH;break;default:throw new Error(`opAND: invalid state ${Z.state}`)}})(s,w);break;case o.NOT:((s,i)=>{switch($+=1,opExecute(s+1,i),$-=1,Z.phraseLength=0,Z.state){case o.EMPTY:case o.MATCH:Z.state=o.NOMATCH;break;case o.NOMATCH:Z.state=o.EMPTY;break;default:throw new Error(`opNOT: invalid state ${Z.state}`)}})(s,w);break;default:throw new Error(`${L}unrecognized operator`)}$||w+Z.phraseLength>Y&&(Y=w+Z.phraseLength),i.stats&&i.stats.collect(ee,Z),i.trace&&i.trace.up(ee,Z.state,w,Z.phraseLength),V-=1}},dx=function fnast(){const o=mx,s=fx,i=this;let u,_,w,x=0;const C=[],j=[],L=[];function indent(o){let s=\"\";for(;o-- >0;)s+=\" \";return s}i.callbacks=[],i.init=(o,s,B)=>{let $;j.length=0,L.length=0,x=0,u=o,_=s,w=B;const V=[];for($=0;$<u.length;$+=1)V.push(u[$].lower);for($=0;$<_.length;$+=1)V.push(_[$].lower);for(x=u.length+_.length,$=0;$<x;$+=1)C[$]=void 0;for(const o in i.callbacks){const s=o.toLowerCase();if($=V.indexOf(s),$<0)throw new Error(`parser.js: Ast()): init: node '${o}' not a rule or udt name`);C[$]=i.callbacks[o]}},i.ruleDefined=o=>!!C[o],i.udtDefined=o=>!!C[u.length+o],i.down=(s,i)=>{const u=L.length;return j.push(u),L.push({name:i,thisIndex:u,thatIndex:void 0,state:o.SEM_PRE,callbackIndex:s,phraseIndex:void 0,phraseLength:void 0,stack:j.length}),u},i.up=(s,i,u,_)=>{const w=L.length,x=j.pop();return L.push({name:i,thisIndex:w,thatIndex:x,state:o.SEM_POST,callbackIndex:s,phraseIndex:u,phraseLength:_,stack:j.length}),L[x].thatIndex=w,L[x].phraseIndex=u,L[x].phraseLength=_,w},i.translate=s=>{let i,u;for(let _=0;_<L.length;_+=1)u=L[_],i=C[u.callbackIndex],i&&(u.state===o.SEM_PRE?i(o.SEM_PRE,w,u.phraseIndex,u.phraseLength,s):i&&i(o.SEM_POST,w,u.phraseIndex,u.phraseLength,s))},i.setLength=o=>{L.length=o,j.length=o>0?L[o-1].stack:0},i.getLength=()=>L.length,i.toXml=()=>{let i=\"\",u=0;return i+='<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n',i+=`<root nodes=\"${L.length/2}\" characters=\"${w.length}\">\\n`,i+=\"\\x3c!-- input string --\\x3e\\n\",i+=indent(u+2),i+=s.charsToString(w),i+=\"\\n\",L.forEach((_=>{_.state===o.SEM_PRE?(u+=1,i+=indent(u),i+=`<node name=\"${_.name}\" index=\"${_.phraseIndex}\" length=\"${_.phraseLength}\">\\n`,i+=indent(u+2),i+=s.charsToString(w,_.phraseIndex,_.phraseLength),i+=\"\\n\"):(i+=indent(u),i+=`</node>\\x3c!-- name=\"${_.name}\" --\\x3e\\n`,u-=1)})),i+=\"</root>\\n\",i}},fx={stringToChars:o=>[...o].map((o=>o.codePointAt(0))),charsToString:(o,s,i)=>{let u=o;for(;!(void 0===s||s<0);){if(void 0===i){u=o.slice(s);break}if(i<=0)return\"\";u=o.slice(s,s+i);break}return String.fromCodePoint(...u)}},mx={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,idName:o=>{switch(o){case mx.ALT:return\"ALT\";case mx.CAT:return\"CAT\";case mx.REP:return\"REP\";case mx.RNM:return\"RNM\";case mx.TRG:return\"TRG\";case mx.TBS:return\"TBS\";case mx.TLS:return\"TLS\";case mx.UDT:return\"UDT\";case mx.AND:return\"AND\";case mx.NOT:return\"NOT\";case mx.ACTIVE:return\"ACTIVE\";case mx.EMPTY:return\"EMPTY\";case mx.MATCH:return\"MATCH\";case mx.NOMATCH:return\"NOMATCH\";case mx.SEM_PRE:return\"SEM_PRE\";case mx.SEM_POST:return\"SEM_POST\";case mx.SEM_OK:return\"SEM_OK\";default:return\"UNRECOGNIZED STATE\"}}};const callbacks_slash=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"slash\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),path_template=(o,s,i,u,_)=>{if(o===mx.SEM_PRE){if(!1===Array.isArray(_))throw new Error(\"parser's user data must be an array\");_.push([\"path-template\",fx.charsToString(s,i,u)])}return mx.SEM_OK},callbacks_path=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"path\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),path_literal=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"path-literal\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),callbacks_query=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"query\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),query_marker=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"query-marker\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),callbacks_fragment=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"fragment\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),fragment_marker=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"fragment-marker\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),template_expression=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"template-expression\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),template_expression_param_name=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"template-expression-param-name\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),gx=new function grammar(){this.grammarObject=\"grammarObject\",this.rules=[],this.rules[0]={name:\"path-template\",lower:\"path-template\",index:0,isBkr:!1},this.rules[1]={name:\"path\",lower:\"path\",index:1,isBkr:!1},this.rules[2]={name:\"path-segment\",lower:\"path-segment\",index:2,isBkr:!1},this.rules[3]={name:\"query\",lower:\"query\",index:3,isBkr:!1},this.rules[4]={name:\"query-literal\",lower:\"query-literal\",index:4,isBkr:!1},this.rules[5]={name:\"query-marker\",lower:\"query-marker\",index:5,isBkr:!1},this.rules[6]={name:\"fragment\",lower:\"fragment\",index:6,isBkr:!1},this.rules[7]={name:\"fragment-literal\",lower:\"fragment-literal\",index:7,isBkr:!1},this.rules[8]={name:\"fragment-marker\",lower:\"fragment-marker\",index:8,isBkr:!1},this.rules[9]={name:\"slash\",lower:\"slash\",index:9,isBkr:!1},this.rules[10]={name:\"path-literal\",lower:\"path-literal\",index:10,isBkr:!1},this.rules[11]={name:\"template-expression\",lower:\"template-expression\",index:11,isBkr:!1},this.rules[12]={name:\"template-expression-param-name\",lower:\"template-expression-param-name\",index:12,isBkr:!1},this.rules[13]={name:\"unreserved\",lower:\"unreserved\",index:13,isBkr:!1},this.rules[14]={name:\"pct-encoded\",lower:\"pct-encoded\",index:14,isBkr:!1},this.rules[15]={name:\"sub-delims\",lower:\"sub-delims\",index:15,isBkr:!1},this.rules[16]={name:\"sub-delims-no-slash\",lower:\"sub-delims-no-slash\",index:16,isBkr:!1},this.rules[17]={name:\"ALPHA\",lower:\"alpha\",index:17,isBkr:!1},this.rules[18]={name:\"DIGIT\",lower:\"digit\",index:18,isBkr:!1},this.rules[19]={name:\"HEXDIG\",lower:\"hexdig\",index:19,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,2,6]},this.rules[0].opcodes[1]={type:4,index:1},this.rules[0].opcodes[2]={type:3,min:0,max:1},this.rules[0].opcodes[3]={type:2,children:[4,5]},this.rules[0].opcodes[4]={type:4,index:5},this.rules[0].opcodes[5]={type:4,index:3},this.rules[0].opcodes[6]={type:3,min:0,max:1},this.rules[0].opcodes[7]={type:2,children:[8,9]},this.rules[0].opcodes[8]={type:4,index:8},this.rules[0].opcodes[9]={type:4,index:6},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2,6]},this.rules[1].opcodes[1]={type:4,index:9},this.rules[1].opcodes[2]={type:3,min:0,max:1/0},this.rules[1].opcodes[3]={type:2,children:[4,5]},this.rules[1].opcodes[4]={type:4,index:2},this.rules[1].opcodes[5]={type:4,index:9},this.rules[1].opcodes[6]={type:3,min:0,max:1},this.rules[1].opcodes[7]={type:4,index:2},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:1,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:10},this.rules[2].opcodes[3]={type:4,index:11},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:0,max:1/0},this.rules[3].opcodes[1]={type:4,index:4},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:3,min:1,max:1/0},this.rules[4].opcodes[1]={type:1,children:[2,3,4,5,6,7,8,9,10]},this.rules[4].opcodes[2]={type:4,index:13},this.rules[4].opcodes[3]={type:4,index:14},this.rules[4].opcodes[4]={type:4,index:15},this.rules[4].opcodes[5]={type:7,string:[58]},this.rules[4].opcodes[6]={type:7,string:[64]},this.rules[4].opcodes[7]={type:7,string:[47]},this.rules[4].opcodes[8]={type:7,string:[63]},this.rules[4].opcodes[9]={type:7,string:[38]},this.rules[4].opcodes[10]={type:7,string:[61]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:7,string:[63]},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:0,max:1/0},this.rules[6].opcodes[1]={type:4,index:7},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:3,min:1,max:1/0},this.rules[7].opcodes[1]={type:1,children:[2,3,4,5,6,7,8]},this.rules[7].opcodes[2]={type:4,index:13},this.rules[7].opcodes[3]={type:4,index:14},this.rules[7].opcodes[4]={type:4,index:15},this.rules[7].opcodes[5]={type:7,string:[58]},this.rules[7].opcodes[6]={type:7,string:[64]},this.rules[7].opcodes[7]={type:7,string:[47]},this.rules[7].opcodes[8]={type:7,string:[63]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:7,string:[35]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:7,string:[47]},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:3,min:1,max:1/0},this.rules[10].opcodes[1]={type:1,children:[2,3,4,5,6]},this.rules[10].opcodes[2]={type:4,index:13},this.rules[10].opcodes[3]={type:4,index:14},this.rules[10].opcodes[4]={type:4,index:16},this.rules[10].opcodes[5]={type:7,string:[58]},this.rules[10].opcodes[6]={type:7,string:[64]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:2,children:[1,2,3]},this.rules[11].opcodes[1]={type:7,string:[123]},this.rules[11].opcodes[2]={type:4,index:12},this.rules[11].opcodes[3]={type:7,string:[125]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:3,min:1,max:1/0},this.rules[12].opcodes[1]={type:1,children:[2,3,4,5,6]},this.rules[12].opcodes[2]={type:4,index:13},this.rules[12].opcodes[3]={type:4,index:14},this.rules[12].opcodes[4]={type:4,index:16},this.rules[12].opcodes[5]={type:7,string:[58]},this.rules[12].opcodes[6]={type:7,string:[64]},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:1,children:[1,2,3,4,5,6]},this.rules[13].opcodes[1]={type:4,index:17},this.rules[13].opcodes[2]={type:4,index:18},this.rules[13].opcodes[3]={type:7,string:[45]},this.rules[13].opcodes[4]={type:7,string:[46]},this.rules[13].opcodes[5]={type:7,string:[95]},this.rules[13].opcodes[6]={type:7,string:[126]},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2,3]},this.rules[14].opcodes[1]={type:7,string:[37]},this.rules[14].opcodes[2]={type:4,index:19},this.rules[14].opcodes[3]={type:4,index:19},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10,11]},this.rules[15].opcodes[1]={type:7,string:[33]},this.rules[15].opcodes[2]={type:7,string:[36]},this.rules[15].opcodes[3]={type:7,string:[38]},this.rules[15].opcodes[4]={type:7,string:[39]},this.rules[15].opcodes[5]={type:7,string:[40]},this.rules[15].opcodes[6]={type:7,string:[41]},this.rules[15].opcodes[7]={type:7,string:[42]},this.rules[15].opcodes[8]={type:7,string:[43]},this.rules[15].opcodes[9]={type:7,string:[44]},this.rules[15].opcodes[10]={type:7,string:[59]},this.rules[15].opcodes[11]={type:7,string:[61]},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[16].opcodes[1]={type:7,string:[33]},this.rules[16].opcodes[2]={type:7,string:[36]},this.rules[16].opcodes[3]={type:7,string:[38]},this.rules[16].opcodes[4]={type:7,string:[39]},this.rules[16].opcodes[5]={type:7,string:[40]},this.rules[16].opcodes[6]={type:7,string:[41]},this.rules[16].opcodes[7]={type:7,string:[42]},this.rules[16].opcodes[8]={type:7,string:[43]},this.rules[16].opcodes[9]={type:7,string:[44]},this.rules[16].opcodes[10]={type:7,string:[59]},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,2]},this.rules[17].opcodes[1]={type:5,min:65,max:90},this.rules[17].opcodes[2]={type:5,min:97,max:122},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:5,min:48,max:57},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7]},this.rules[19].opcodes[1]={type:4,index:18},this.rules[19].opcodes[2]={type:7,string:[97]},this.rules[19].opcodes[3]={type:7,string:[98]},this.rules[19].opcodes[4]={type:7,string:[99]},this.rules[19].opcodes[5]={type:7,string:[100]},this.rules[19].opcodes[6]={type:7,string:[101]},this.rules[19].opcodes[7]={type:7,string:[102]},this.toString=function toString(){let o=\"\";return o+=\"; OpenAPI Path Templating ABNF syntax\\n\",o+=\"path-template                  = path [ query-marker query ] [ fragment-marker fragment ]\\n\",o+=\"path                           = slash *( path-segment slash ) [ path-segment ]\\n\",o+=\"path-segment                   = 1*( path-literal / template-expression )\\n\",o+=\"query                          = *( query-literal )\\n\",o+='query-literal                  = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" / \"/\" / \"?\" / \"&\" / \"=\" )\\n',o+='query-marker                   = \"?\"\\n',o+=\"fragment                       = *( fragment-literal )\\n\",o+='fragment-literal               = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" / \"/\" / \"?\" )\\n',o+='fragment-marker                = \"#\"\\n',o+='slash                          = \"/\"\\n',o+='path-literal                   = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\\n',o+='template-expression            = \"{\" template-expression-param-name \"}\"\\n',o+='template-expression-param-name = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\\n',o+=\"\\n\",o+=\"; Characters definitions (from RFC 3986)\\n\",o+='unreserved          = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\\n',o+='pct-encoded         = \"%\" HEXDIG HEXDIG\\n',o+='sub-delims          = \"!\" / \"$\" / \"&\" / \"\\'\" / \"(\" / \")\"\\n',o+='                    / \"*\" / \"+\" / \",\" / \";\" / \"=\"\\n',o+='sub-delims-no-slash = \"!\" / \"$\" / \"&\" / \"\\'\" / \"(\" / \")\"\\n',o+='                    / \"*\" / \"+\" / \",\" / \";\"\\n',o+=\"ALPHA               = %x41-5A / %x61-7A   ; A-Z / a-z\\n\",o+=\"DIGIT               = %x30-39            ; 0-9\\n\",o+='HEXDIG              = DIGIT / \"A\" / \"B\" / \"C\" / \"D\" / \"E\" / \"F\"\\n','; OpenAPI Path Templating ABNF syntax\\npath-template                  = path [ query-marker query ] [ fragment-marker fragment ]\\npath                           = slash *( path-segment slash ) [ path-segment ]\\npath-segment                   = 1*( path-literal / template-expression )\\nquery                          = *( query-literal )\\nquery-literal                  = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" / \"/\" / \"?\" / \"&\" / \"=\" )\\nquery-marker                   = \"?\"\\nfragment                       = *( fragment-literal )\\nfragment-literal               = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" / \"/\" / \"?\" )\\nfragment-marker                = \"#\"\\nslash                          = \"/\"\\npath-literal                   = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\\ntemplate-expression            = \"{\" template-expression-param-name \"}\"\\ntemplate-expression-param-name = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\\n\\n; Characters definitions (from RFC 3986)\\nunreserved          = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\\npct-encoded         = \"%\" HEXDIG HEXDIG\\nsub-delims          = \"!\" / \"$\" / \"&\" / \"\\'\" / \"(\" / \")\"\\n                    / \"*\" / \"+\" / \",\" / \";\" / \"=\"\\nsub-delims-no-slash = \"!\" / \"$\" / \"&\" / \"\\'\" / \"(\" / \")\"\\n                    / \"*\" / \"+\" / \",\" / \";\"\\nALPHA               = %x41-5A / %x61-7A   ; A-Z / a-z\\nDIGIT               = %x30-39            ; 0-9\\nHEXDIG              = DIGIT / \"A\" / \"B\" / \"C\" / \"D\" / \"E\" / \"F\"\\n'}},openapi_path_templating_es_parse=o=>{const s=new hx;s.ast=new dx,s.ast.callbacks[\"path-template\"]=path_template,s.ast.callbacks.path=callbacks_path,s.ast.callbacks.query=callbacks_query,s.ast.callbacks[\"query-marker\"]=query_marker,s.ast.callbacks.fragment=callbacks_fragment,s.ast.callbacks[\"fragment-marker\"]=fragment_marker,s.ast.callbacks.slash=callbacks_slash,s.ast.callbacks[\"path-literal\"]=path_literal,s.ast.callbacks[\"template-expression\"]=template_expression,s.ast.callbacks[\"template-expression-param-name\"]=template_expression_param_name;return{result:s.parse(gx,\"path-template\",o),ast:s.ast}},encodePathComponent=o=>(o=>{try{return\"string\"==typeof o&&decodeURIComponent(o)!==o}catch(o){return!1}})(o)?o:encodeURIComponent(o),yx=[\"slash\",\"path-literal\",\"query-marker\",\"query-literal\",\"template-expression-param-name\"],openapi_path_templating_es_resolve=(o,s={},i={})=>{const u={...{encoder:encodePathComponent},...i},_=openapi_path_templating_es_parse(o);if(!_.result.success)return o;const w=[];_.ast.translate(w);const x=w.filter((([o])=>yx.includes(o))).map((([o,i])=>\"template-expression-param-name\"===o?Object.hasOwn(s,i)?u.encoder(s[i]):`{${i}}`:i));return x.join(\"\")},vx={body:function bodyBuilder({req:o,value:s}){void 0!==s&&(o.body=s)},header:function headerBuilder({req:o,parameter:s,value:i}){o.headers=o.headers||{},void 0!==i&&(o.headers[s.name]=i)},query:function queryBuilder({req:o,value:s,parameter:i}){o.query=o.query||{},!1===s&&\"boolean\"===i.type&&(s=\"false\");0===s&&[\"number\",\"integer\"].indexOf(i.type)>-1&&(s=\"0\");if(s)o.query[i.name]={collectionFormat:i.collectionFormat,value:s};else if(i.allowEmptyValue&&void 0!==s){const s=i.name;o.query[s]=o.query[s]||{},o.query[s].allowEmptyValue=!0}},path:function pathBuilder({req:o,value:s,parameter:i,baseURL:u}){if(void 0!==s){const _=o.url.replace(u,\"\"),w=openapi_path_templating_es_resolve(_,{[i.name]:s});o.url=u+w}},formData:function formDataBuilder({req:o,value:s,parameter:i}){!1===s&&\"boolean\"===i.type&&(s=\"false\");0===s&&[\"number\",\"integer\"].indexOf(i.type)>-1&&(s=\"0\");if(s)o.form=o.form||{},o.form[i.name]={collectionFormat:i.collectionFormat,value:s};else if(i.allowEmptyValue&&void 0!==s){o.form=o.form||{};const s=i.name;o.form[s]=o.form[s]||{},o.form[s].allowEmptyValue=!0}}};function serialize(o,s){return s.includes(\"application/json\")?\"string\"==typeof o?o:(Array.isArray(o)&&(o=o.map((o=>{try{return JSON.parse(o)}catch(s){return o}}))),JSON.stringify(o)):String(o)}function parameter_builders_path({req:o,value:s,parameter:i,baseURL:u}){const{name:_,style:w,explode:x,content:C}=i;if(void 0===s)return;const j=o.url.replace(u,\"\");let L;if(C){const o=Object.keys(C)[0];L=openapi_path_templating_es_resolve(j,{[_]:s},{encoder:s=>encodeCharacters(serialize(s,o))})}else L=openapi_path_templating_es_resolve(j,{[_]:s},{encoder:o=>stylize({key:i.name,value:o,style:w||\"simple\",explode:x||!1,escape:\"reserved\"})});o.url=u+L}function parameter_builders_query({req:o,value:s,parameter:i}){if(o.query=o.query||{},void 0!==s&&i.content){const u=serialize(s,Object.keys(i.content)[0]);if(u)o.query[i.name]=u;else if(i.allowEmptyValue){const s=i.name;o.query[s]=o.query[s]||{},o.query[s].allowEmptyValue=!0}}else if(!1===s&&(s=\"false\"),0===s&&(s=\"0\"),s){const{style:u,explode:_,allowReserved:w}=i;o.query[i.name]={value:s,serializationOption:{style:u,explode:_,allowReserved:w}}}else if(i.allowEmptyValue&&void 0!==s){const s=i.name;o.query[s]=o.query[s]||{},o.query[s].allowEmptyValue=!0}}const bx=[\"accept\",\"authorization\",\"content-type\"];function parameter_builders_header({req:o,parameter:s,value:i}){if(o.headers=o.headers||{},!(bx.indexOf(s.name.toLowerCase())>-1))if(void 0!==i&&s.content){const u=Object.keys(s.content)[0];o.headers[s.name]=serialize(i,u)}else void 0===i||Array.isArray(i)&&0===i.length||(o.headers[s.name]=stylize({key:s.name,value:i,style:s.style||\"simple\",explode:void 0!==s.explode&&s.explode,escape:!1}))}function parameter_builders_cookie({req:o,parameter:s,value:i}){o.headers=o.headers||{};const u=typeof i;if(void 0!==i&&s.content){const u=Object.keys(s.content)[0];o.headers.Cookie=`${s.name}=${serialize(i,u)}`}else if(void 0!==i&&(!Array.isArray(i)||0!==i.length)){const _=\"object\"===u&&!Array.isArray(i)&&s.explode?\"\":`${s.name}=`;o.headers.Cookie=_+stylize({key:s.name,value:i,escape:!1,style:s.style||\"form\",explode:void 0!==s.explode&&s.explode})}}const _x=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof self?self:window,{btoa:Ex}=_x,wx=Ex;function buildRequest(o,s){const{operation:i,requestBody:u,securities:_,spec:w,attachContentTypeForEmptyPayload:x}=o;let{requestContentType:C}=o;s=function applySecurities({request:o,securities:s={},operation:i={},spec:u}){var _;const w={...o},{authorized:x={}}=s,C=i.security||u.security||[],j=x&&!!Object.keys(x).length,L=(null==u||null===(_=u.components)||void 0===_?void 0:_.securitySchemes)||{};if(w.headers=w.headers||{},w.query=w.query||{},!Object.keys(s).length||!j||!C||Array.isArray(i.security)&&!i.security.length)return o;return C.forEach((o=>{Object.keys(o).forEach((o=>{const s=x[o],i=L[o];if(!s)return;const u=s.value||s,{type:_}=i;if(s)if(\"apiKey\"===_)\"query\"===i.in&&(w.query[i.name]=u),\"header\"===i.in&&(w.headers[i.name]=u),\"cookie\"===i.in&&(w.cookies[i.name]=u);else if(\"http\"===_){if(/^basic$/i.test(i.scheme)){const o=u.username||\"\",s=u.password||\"\",i=wx(`${o}:${s}`);w.headers.Authorization=`Basic ${i}`}/^bearer$/i.test(i.scheme)&&(w.headers.Authorization=`Bearer ${u}`)}else if(\"oauth2\"===_||\"openIdConnect\"===_){const o=s.token||{},u=o[i[\"x-tokenName\"]||\"access_token\"];let _=o.token_type;_&&\"bearer\"!==_.toLowerCase()||(_=\"Bearer\"),w.headers.Authorization=`${_} ${u}`}}))})),w}({request:s,securities:_,operation:i,spec:w});const j=i.requestBody||{},L=Object.keys(j.content||{}),B=C&&L.indexOf(C)>-1;if(u||x){if(C&&B)s.headers[\"Content-Type\"]=C;else if(!C){const o=L[0];o&&(s.headers[\"Content-Type\"]=o,C=o)}}else C&&B&&(s.headers[\"Content-Type\"]=C);if(!o.responseContentType&&i.responses){const o=Object.entries(i.responses).filter((([o,s])=>{const i=parseInt(o,10);return i>=200&&i<300&&is_plain_object_isPlainObject(s.content)})).reduce(((o,[,s])=>o.concat(Object.keys(s.content))),[]);o.length>0&&(s.headers.accept=o.join(\", \"))}if(u)if(C){if(L.indexOf(C)>-1)if(\"application/x-www-form-urlencoded\"===C||\"multipart/form-data\"===C)if(\"object\"==typeof u){var $,V;const o=null!==($=null===(V=j.content[C])||void 0===V?void 0:V.encoding)&&void 0!==$?$:{};s.form={},Object.keys(u).forEach((i=>{let _;try{_=JSON.parse(u[i])}catch{_=u[i]}s.form[i]={value:_,encoding:o[i]||{}}}))}else if(\"string\"==typeof u){var U,z;const o=null!==(U=null===(z=j.content[C])||void 0===z?void 0:z.encoding)&&void 0!==U?U:{};try{s.form={};const i=JSON.parse(u);Object.entries(i).forEach((([i,u])=>{s.form[i]={value:u,encoding:o[i]||{}}}))}catch{s.form=u}}else s.form=u;else s.body=u}else s.body=u;return s}function build_request_buildRequest(o,s){const{spec:i,operation:u,securities:_,requestContentType:w,responseContentType:x,attachContentTypeForEmptyPayload:C}=o;if(s=function build_request_applySecurities({request:o,securities:s={},operation:i={},spec:u}){const _={...o},{authorized:w={},specSecurity:x=[]}=s,C=i.security||x,j=w&&!!Object.keys(w).length,L=u.securityDefinitions;if(_.headers=_.headers||{},_.query=_.query||{},!Object.keys(s).length||!j||!C||Array.isArray(i.security)&&!i.security.length)return o;return C.forEach((o=>{Object.keys(o).forEach((o=>{const s=w[o];if(!s)return;const{token:i}=s,u=s.value||s,x=L[o],{type:C}=x,j=x[\"x-tokenName\"]||\"access_token\",B=i&&i[j];let $=i&&i.token_type;if(s)if(\"apiKey\"===C){const o=\"query\"===x.in?\"query\":\"headers\";_[o]=_[o]||{},_[o][x.name]=u}else if(\"basic\"===C)if(u.header)_.headers.authorization=u.header;else{const o=u.username||\"\",s=u.password||\"\";u.base64=wx(`${o}:${s}`),_.headers.authorization=`Basic ${u.base64}`}else\"oauth2\"===C&&B&&($=$&&\"bearer\"!==$.toLowerCase()?$:\"Bearer\",_.headers.authorization=`${$} ${B}`)}))})),_}({request:s,securities:_,operation:u,spec:i}),s.body||s.form||C)w?s.headers[\"Content-Type\"]=w:Array.isArray(u.consumes)?[s.headers[\"Content-Type\"]]=u.consumes:Array.isArray(i.consumes)?[s.headers[\"Content-Type\"]]=i.consumes:u.parameters&&u.parameters.filter((o=>\"file\"===o.type)).length?s.headers[\"Content-Type\"]=\"multipart/form-data\":u.parameters&&u.parameters.filter((o=>\"formData\"===o.in)).length&&(s.headers[\"Content-Type\"]=\"application/x-www-form-urlencoded\");else if(w){const o=u.parameters&&u.parameters.filter((o=>\"body\"===o.in)).length>0,i=u.parameters&&u.parameters.filter((o=>\"formData\"===o.in)).length>0;(o||i)&&(s.headers[\"Content-Type\"]=w)}return!x&&Array.isArray(u.produces)&&u.produces.length>0&&(s.headers.accept=u.produces.join(\", \")),s}function idFromPathMethodLegacy(o,s){return`${s.toLowerCase()}-${o}`}const arrayOrEmpty=o=>Array.isArray(o)?o:[],parseURIReference=o=>{try{return new URL(o)}catch{const s=new URL(o,Su),i=String(o).startsWith(\"/\")?s.pathname:s.pathname.substring(1);return{hash:s.hash,host:\"\",hostname:\"\",href:\"\",origin:\"\",password:\"\",pathname:i,port:\"\",protocol:\"\",search:s.search,searchParams:s.searchParams}}};class OperationNotFoundError extends Fa{}const findParametersWithName=(o,s)=>s.filter((s=>s.name===o)),deduplicateParameters=o=>{const s={};o.forEach((o=>{s[o.in]||(s[o.in]={}),s[o.in][o.name]=o}));const i=[];return Object.keys(s).forEach((o=>{Object.keys(s[o]).forEach((u=>{i.push(s[o][u])}))})),i},Sx={buildRequest:execute_buildRequest};function execute_execute({http:o,fetch:s,spec:i,operationId:u,pathName:_,method:w,parameters:x,securities:C,...j}){const L=o||s||http_http;_&&w&&!u&&(u=idFromPathMethodLegacy(_,w));const B=Sx.buildRequest({spec:i,operationId:u,parameters:x,securities:C,http:L,...j});return B.body&&(is_plain_object_isPlainObject(B.body)||Array.isArray(B.body))&&(B.body=JSON.stringify(B.body)),L(B)}function execute_buildRequest(o){const{spec:s,operationId:i,responseContentType:u,scheme:_,requestInterceptor:w,responseInterceptor:x,contextUrl:C,userFetch:j,server:L,serverVariables:B,http:$,signal:V}=o;let{parameters:U,parameterBuilders:z}=o;const Y=isOpenAPI3(s);z||(z=Y?fe:vx);let Z={url:\"\",credentials:$&&$.withCredentials?\"include\":\"same-origin\",headers:{},cookies:{}};V&&(Z.signal=V),w&&(Z.requestInterceptor=w),x&&(Z.responseInterceptor=x),j&&(Z.userFetch=j);const ee=function getOperationRaw(o,s){return o&&o.paths?function findOperation(o,s){return function eachOperation(o,s,i){if(!o||\"object\"!=typeof o||!o.paths||\"object\"!=typeof o.paths)return null;const{paths:u}=o;for(const _ in u)for(const w in u[_]){if(\"PARAMETERS\"===w.toUpperCase())continue;const x=u[_][w];if(!x||\"object\"!=typeof x)continue;const C={spec:o,pathName:_,method:w.toUpperCase(),operation:x},j=s(C);if(i&&j)return C}}(o,s,!0)||null}(o,(({pathName:o,method:i,operation:u})=>{if(!u||\"object\"!=typeof u)return!1;const _=u.operationId;return[opId(u,o,i),idFromPathMethodLegacy(o,i),_].some((o=>o&&o===s))})):null}(s,i);if(!ee)throw new OperationNotFoundError(`Operation ${i} not found`);const{operation:ie={},method:ae,pathName:ce}=ee,le=function baseUrl(o){const s=isOpenAPI3(o.spec);return s?function oas3BaseUrl({spec:o,pathName:s,method:i,server:u,contextUrl:_,serverVariables:w={}}){var x,C;let j,L=[],B=\"\";const $=null==o||null===(x=o.paths)||void 0===x||null===(x=x[s])||void 0===x||null===(x=x[(i||\"\").toLowerCase()])||void 0===x?void 0:x.servers,V=null==o||null===(C=o.paths)||void 0===C||null===(C=C[s])||void 0===C?void 0:C.servers,U=null==o?void 0:o.servers;L=isNonEmptyServerList($)?$:isNonEmptyServerList(V)?V:isNonEmptyServerList(U)?U:[xu],u&&(j=L.find((o=>o.url===u)),j&&(B=u));B||([j]=L,B=j.url);if(B.includes(\"{\")){(function extractServerVariableNames(o){const s=ux()(o).call(o,/\\{([^{}]+)}|([^{}]+)/g);return Array.from(s,(([,o])=>o)).filter(Boolean)})(B).forEach((o=>{if(j.variables&&j.variables[o]){const s=j.variables[o],i=w[o]||s.default,u=new RegExp(`{${iu(o)}}`,\"g\");B=B.replace(u,i)}}))}return function buildOas3UrlWithContext(o=\"\",s=\"\"){const i=parseURIReference(o&&s?resolve(s,o):o),u=parseURIReference(s),_=stripNonAlpha(i.protocol)||stripNonAlpha(u.protocol),w=i.host||u.host,x=i.pathname;let C;C=_&&w?`${_}://${w+x}`:x;return\"/\"===C[C.length-1]?C.slice(0,-1):C}(B,_)}(o):function swagger2BaseUrl({spec:o,scheme:s,contextUrl:i=\"\"}){const u=parseURIReference(i),_=Array.isArray(o.schemes)?o.schemes[0]:null,w=s||_||stripNonAlpha(u.protocol)||\"http\",x=o.host||u.host||\"\",C=o.basePath||\"\";let j;j=w&&x?`${w}://${x+C}`:C;return\"/\"===j[j.length-1]?j.slice(0,-1):j}(o)}({spec:s,scheme:_,contextUrl:C,server:L,serverVariables:B,pathName:ce,method:ae});if(Z.url+=le,!i)return delete Z.cookies,Z;Z.url+=ce,Z.method=`${ae}`.toUpperCase(),U=U||{};const pe=s.paths[ce]||{};u&&(Z.headers.accept=u);const de=deduplicateParameters([].concat(arrayOrEmpty(ie.parameters)).concat(arrayOrEmpty(pe.parameters)));de.forEach((o=>{const i=z[o.in];let u;if(\"body\"===o.in&&o.schema&&o.schema.properties&&(u=U),u=o&&o.name&&U[o.name],void 0===u?u=o&&o.name&&U[`${o.in}.${o.name}`]:findParametersWithName(o.name,de).length>1&&console.warn(`Parameter '${o.name}' is ambiguous because the defined spec has more than one parameter with the name: '${o.name}' and the passed-in parameter values did not define an 'in' value.`),null!==u){if(void 0!==o.default&&void 0===u&&(u=o.default),void 0===u&&o.required&&!o.allowEmptyValue)throw new Error(`Required parameter ${o.name} is not provided`);if(Y&&o.schema&&\"object\"===o.schema.type&&\"string\"==typeof u)try{u=JSON.parse(u)}catch(o){throw new Error(\"Could not parse object parameter value string as JSON\")}i&&i({req:Z,parameter:o,value:u,operation:ie,spec:s,baseURL:le})}}));const ye={...o,operation:ie};if(Z=Y?buildRequest(ye,Z):build_request_buildRequest(ye,Z),Z.cookies&&Object.keys(Z.cookies).length){const o=Object.keys(Z.cookies).reduce(((o,s)=>{const i=Z.cookies[s];return o+(o?\"&\":\"\")+px.serialize(s,i)}),\"\");Z.headers.Cookie=o}return Z.cookies&&delete Z.cookies,serializeRequest(Z)}const stripNonAlpha=o=>o?o.replace(/\\W/g,\"\"):null;const isNonEmptyServerList=o=>Array.isArray(o)&&o.length>0;const makeResolveSubtree=o=>async(s,i,u={})=>(async(o,s,i={})=>{const{returnEntireTree:u,baseDoc:_,requestInterceptor:w,responseInterceptor:x,parameterMacro:C,modelPropertyMacro:j,useCircularStructures:L,strategies:B}=i,$={spec:o,pathDiscriminator:s,baseDoc:_,requestInterceptor:w,responseInterceptor:x,parameterMacro:C,modelPropertyMacro:j,useCircularStructures:L,strategies:B},V=B.find((o=>o.match($))).normalize($),U=await cx({...$,spec:V,allowMetaPatches:!0,skipNormalization:!0});return!u&&Array.isArray(s)&&s.length&&(U.spec=s.reduce(((o,s)=>null==o?void 0:o[s]),U.spec)||null),U})(s,i,{...o,...u}),xx=(makeResolveSubtree({strategies:[Gu,Hu,Wu]}),(o,s)=>(...i)=>{o(...i);const u=s.getConfigs().withCredentials;s.fn.fetch.withCredentials=u});function swagger_client({configs:o,getConfigs:s}){return{fn:{fetch:(i=http_http,u=o.preFetch,_=o.postFetch,_=_||(o=>o),u=u||(o=>o),o=>(\"string\"==typeof o&&(o={url:o}),o=serializeRequest(o),o=u(o),_(i(o)))),buildRequest:execute_buildRequest,execute:execute_execute,resolve:makeResolve({strategies:[ax,Gu,Hu,Wu]}),resolveSubtree:async(o,i,u={})=>{const _=s(),w={modelPropertyMacro:_.modelPropertyMacro,parameterMacro:_.parameterMacro,requestInterceptor:_.requestInterceptor,responseInterceptor:_.responseInterceptor,strategies:[ax,Gu,Hu,Wu]};return makeResolveSubtree(w)(o,i,u)},serializeRes:serializeResponse,opId},statePlugins:{configs:{wrapActions:{loaded:xx}}}};var i,u,_}function util(){return{fn:{shallowEqualKeys}}}var kx=__webpack_require__(40961),Ox=__webpack_require__(78418),Cx=Pe,Ax=Symbol.for(\"react-redux-context\"),jx=\"undefined\"!=typeof globalThis?globalThis:{};function getContext(){if(!Cx.createContext)return{};const o=jx[Ax]??(jx[Ax]=new Map);let s=o.get(Cx.createContext);return s||(s=Cx.createContext(null),o.set(Cx.createContext,s)),s}var Px=getContext(),notInitialized=()=>{throw new Error(\"uSES not initialized!\")};var Ix=Symbol.for(\"react.element\"),Mx=Symbol.for(\"react.portal\"),Nx=Symbol.for(\"react.fragment\"),Tx=Symbol.for(\"react.strict_mode\"),Rx=Symbol.for(\"react.profiler\"),Dx=Symbol.for(\"react.provider\"),Lx=Symbol.for(\"react.context\"),Bx=Symbol.for(\"react.server_context\"),Fx=Symbol.for(\"react.forward_ref\"),qx=Symbol.for(\"react.suspense\"),$x=Symbol.for(\"react.suspense_list\"),Vx=Symbol.for(\"react.memo\"),Ux=Symbol.for(\"react.lazy\"),zx=(Symbol.for(\"react.offscreen\"),Symbol.for(\"react.client.reference\"),Fx),Wx=Vx;function typeOf(o){if(\"object\"==typeof o&&null!==o){const s=o.$$typeof;switch(s){case Ix:{const i=o.type;switch(i){case Nx:case Rx:case Tx:case qx:case $x:return i;default:{const o=i&&i.$$typeof;switch(o){case Bx:case Lx:case Fx:case Ux:case Vx:case Dx:return o;default:return s}}}}case Mx:return s}}}function pureFinalPropsSelectorFactory(o,s,i,u,{areStatesEqual:_,areOwnPropsEqual:w,areStatePropsEqual:x}){let C,j,L,B,$,V=!1;function handleSubsequentCalls(V,U){const z=!w(U,j),Y=!_(V,C,U,j);return C=V,j=U,z&&Y?function handleNewPropsAndNewState(){return L=o(C,j),s.dependsOnOwnProps&&(B=s(u,j)),$=i(L,B,j),$}():z?function handleNewProps(){return o.dependsOnOwnProps&&(L=o(C,j)),s.dependsOnOwnProps&&(B=s(u,j)),$=i(L,B,j),$}():Y?function handleNewState(){const s=o(C,j),u=!x(s,L);return L=s,u&&($=i(L,B,j)),$}():$}return function pureFinalPropsSelector(_,w){return V?handleSubsequentCalls(_,w):function handleFirstCall(_,w){return C=_,j=w,L=o(C,j),B=s(u,j),$=i(L,B,j),V=!0,$}(_,w)}}function wrapMapToPropsConstant(o){return function initConstantSelector(s){const i=o(s);function constantSelector(){return i}return constantSelector.dependsOnOwnProps=!1,constantSelector}}function getDependsOnOwnProps(o){return o.dependsOnOwnProps?Boolean(o.dependsOnOwnProps):1!==o.length}function wrapMapToPropsFunc(o,s){return function initProxySelector(s,{displayName:i}){const u=function mapToPropsProxy(o,s){return u.dependsOnOwnProps?u.mapToProps(o,s):u.mapToProps(o,void 0)};return u.dependsOnOwnProps=!0,u.mapToProps=function detectFactoryAndVerify(s,i){u.mapToProps=o,u.dependsOnOwnProps=getDependsOnOwnProps(o);let _=u(s,i);return\"function\"==typeof _&&(u.mapToProps=_,u.dependsOnOwnProps=getDependsOnOwnProps(_),_=u(s,i)),_},u}}function createInvalidArgFactory(o,s){return(i,u)=>{throw new Error(`Invalid value of type ${typeof o} for ${s} argument when connecting component ${u.wrappedComponentName}.`)}}function defaultMergeProps(o,s,i){return{...i,...o,...s}}function defaultNoopBatch(o){o()}var Kx={notify(){},get:()=>[]};function createSubscription(o,s){let i,u=Kx,_=0,w=!1;function handleChangeWrapper(){x.onStateChange&&x.onStateChange()}function trySubscribe(){_++,i||(i=s?s.addNestedSub(handleChangeWrapper):o.subscribe(handleChangeWrapper),u=function createListenerCollection(){let o=null,s=null;return{clear(){o=null,s=null},notify(){defaultNoopBatch((()=>{let s=o;for(;s;)s.callback(),s=s.next}))},get(){const s=[];let i=o;for(;i;)s.push(i),i=i.next;return s},subscribe(i){let u=!0;const _=s={callback:i,next:null,prev:s};return _.prev?_.prev.next=_:o=_,function unsubscribe(){u&&null!==o&&(u=!1,_.next?_.next.prev=_.prev:s=_.prev,_.prev?_.prev.next=_.next:o=_.next)}}}}())}function tryUnsubscribe(){_--,i&&0===_&&(i(),i=void 0,u.clear(),u=Kx)}const x={addNestedSub:function addNestedSub(o){trySubscribe();const s=u.subscribe(o);let i=!1;return()=>{i||(i=!0,s(),tryUnsubscribe())}},notifyNestedSubs:function notifyNestedSubs(){u.notify()},handleChangeWrapper,isSubscribed:function isSubscribed(){return w},trySubscribe:function trySubscribeSelf(){w||(w=!0,trySubscribe())},tryUnsubscribe:function tryUnsubscribeSelf(){w&&(w=!1,tryUnsubscribe())},getListeners:()=>u};return x}var Hx=!(\"undefined\"==typeof window||void 0===window.document||void 0===window.document.createElement),Jx=\"undefined\"!=typeof navigator&&\"ReactNative\"===navigator.product,Gx=Hx||Jx?Cx.useLayoutEffect:Cx.useEffect;function is(o,s){return o===s?0!==o||0!==s||1/o==1/s:o!=o&&s!=s}function shallowEqual(o,s){if(is(o,s))return!0;if(\"object\"!=typeof o||null===o||\"object\"!=typeof s||null===s)return!1;const i=Object.keys(o),u=Object.keys(s);if(i.length!==u.length)return!1;for(let u=0;u<i.length;u++)if(!Object.prototype.hasOwnProperty.call(s,i[u])||!is(o[i[u]],s[i[u]]))return!1;return!0}var Yx={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Xx={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Qx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Zx={[zx]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[Wx]:Qx};function getStatics(o){return function isMemo(o){return typeOf(o)===Vx}(o)?Qx:Zx[o.$$typeof]||Yx}var tk=Object.defineProperty,rk=Object.getOwnPropertyNames,nk=Object.getOwnPropertySymbols,ok=Object.getOwnPropertyDescriptor,sk=Object.getPrototypeOf,lk=Object.prototype;function hoistNonReactStatics(o,s){if(\"string\"!=typeof s){if(lk){const i=sk(s);i&&i!==lk&&hoistNonReactStatics(o,i)}let i=rk(s);nk&&(i=i.concat(nk(s)));const u=getStatics(o),_=getStatics(s);for(let w=0;w<i.length;++w){const x=i[w];if(!(Xx[x]||_&&_[x]||u&&u[x])){const i=ok(s,x);try{tk(o,x,i)}catch(o){}}}}return o}var uk=notInitialized,pk=[null,null];function captureWrapperProps(o,s,i,u,_,w){o.current=u,i.current=!1,_.current&&(_.current=null,w())}function strictEqual(o,s){return o===s}var fk=function connect(o,s,i,{pure:u,areStatesEqual:_=strictEqual,areOwnPropsEqual:w=shallowEqual,areStatePropsEqual:x=shallowEqual,areMergedPropsEqual:C=shallowEqual,forwardRef:j=!1,context:L=Px}={}){const B=L,$=function mapStateToPropsFactory(o){return o?\"function\"==typeof o?wrapMapToPropsFunc(o):createInvalidArgFactory(o,\"mapStateToProps\"):wrapMapToPropsConstant((()=>({})))}(o),V=function mapDispatchToPropsFactory(o){return o&&\"object\"==typeof o?wrapMapToPropsConstant((s=>function react_redux_bindActionCreators(o,s){const i={};for(const u in o){const _=o[u];\"function\"==typeof _&&(i[u]=(...o)=>s(_(...o)))}return i}(o,s))):o?\"function\"==typeof o?wrapMapToPropsFunc(o):createInvalidArgFactory(o,\"mapDispatchToProps\"):wrapMapToPropsConstant((o=>({dispatch:o})))}(s),U=function mergePropsFactory(o){return o?\"function\"==typeof o?function wrapMergePropsFunc(o){return function initMergePropsProxy(s,{displayName:i,areMergedPropsEqual:u}){let _,w=!1;return function mergePropsProxy(s,i,x){const C=o(s,i,x);return w?u(C,_)||(_=C):(w=!0,_=C),_}}}(o):createInvalidArgFactory(o,\"mergeProps\"):()=>defaultMergeProps}(i),z=Boolean(o);return o=>{const s=o.displayName||o.name||\"Component\",i=`Connect(${s})`,u={shouldHandleStateChanges:z,displayName:i,wrappedComponentName:s,WrappedComponent:o,initMapStateToProps:$,initMapDispatchToProps:V,initMergeProps:U,areStatesEqual:_,areStatePropsEqual:x,areOwnPropsEqual:w,areMergedPropsEqual:C};function ConnectFunction(s){const[i,_,w]=Cx.useMemo((()=>{const{reactReduxForwardedRef:o,...i}=s;return[s.context,o,i]}),[s]),x=Cx.useMemo((()=>B),[i,B]),C=Cx.useContext(x),j=Boolean(s.store)&&Boolean(s.store.getState)&&Boolean(s.store.dispatch),L=Boolean(C)&&Boolean(C.store);const $=j?s.store:C.store,V=L?C.getServerState:$.getState,U=Cx.useMemo((()=>function finalPropsSelectorFactory(o,{initMapStateToProps:s,initMapDispatchToProps:i,initMergeProps:u,..._}){return pureFinalPropsSelectorFactory(s(o,_),i(o,_),u(o,_),o,_)}($.dispatch,u)),[$]),[Y,Z]=Cx.useMemo((()=>{if(!z)return pk;const o=createSubscription($,j?void 0:C.subscription),s=o.notifyNestedSubs.bind(o);return[o,s]}),[$,j,C]),ee=Cx.useMemo((()=>j?C:{...C,subscription:Y}),[j,C,Y]),ie=Cx.useRef(void 0),ae=Cx.useRef(w),ce=Cx.useRef(void 0),le=Cx.useRef(!1),pe=Cx.useRef(!1),de=Cx.useRef(void 0);Gx((()=>(pe.current=!0,()=>{pe.current=!1})),[]);const fe=Cx.useMemo((()=>()=>ce.current&&w===ae.current?ce.current:U($.getState(),w)),[$,w]),ye=Cx.useMemo((()=>o=>Y?function subscribeUpdates(o,s,i,u,_,w,x,C,j,L,B){if(!o)return()=>{};let $=!1,V=null;const checkForUpdates=()=>{if($||!C.current)return;const o=s.getState();let i,U;try{i=u(o,_.current)}catch(o){U=o,V=o}U||(V=null),i===w.current?x.current||L():(w.current=i,j.current=i,x.current=!0,B())};return i.onStateChange=checkForUpdates,i.trySubscribe(),checkForUpdates(),()=>{if($=!0,i.tryUnsubscribe(),i.onStateChange=null,V)throw V}}(z,$,Y,U,ae,ie,le,pe,ce,Z,o):()=>{}),[Y]);let be;!function useIsomorphicLayoutEffectWithArgs(o,s,i){Gx((()=>o(...s)),i)}(captureWrapperProps,[ae,ie,le,w,ce,Z]);try{be=uk(ye,fe,V?()=>U(V(),w):fe)}catch(o){throw de.current&&(o.message+=`\\nThe error may be correlated with this previous error:\\n${de.current.stack}\\n\\n`),o}Gx((()=>{de.current=void 0,ce.current=void 0,ie.current=be}));const _e=Cx.useMemo((()=>Cx.createElement(o,{...be,ref:_})),[_,o,be]);return Cx.useMemo((()=>z?Cx.createElement(x.Provider,{value:ee},_e):_e),[x,_e,ee])}const L=Cx.memo(ConnectFunction);if(L.WrappedComponent=o,L.displayName=ConnectFunction.displayName=i,j){const s=Cx.forwardRef((function forwardConnectRef(o,s){return Cx.createElement(L,{...o,reactReduxForwardedRef:s})}));return s.displayName=i,s.WrappedComponent=o,hoistNonReactStatics(s,o)}return hoistNonReactStatics(L,o)}};var mk=function Provider({store:o,context:s,children:i,serverState:u,stabilityCheck:_=\"once\",identityFunctionCheck:w=\"once\"}){const x=Cx.useMemo((()=>{const s=createSubscription(o);return{store:o,subscription:s,getServerState:u?()=>u:void 0,stabilityCheck:_,identityFunctionCheck:w}}),[o,u,_,w]),C=Cx.useMemo((()=>o.getState()),[o]);Gx((()=>{const{subscription:s}=x;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),C!==o.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}}),[x,C]);const j=s||Px;return Cx.createElement(j.Provider,{value:x},i)};var yk;yk=Ox.useSyncExternalStoreWithSelector,(o=>{uk=o})(Pe.useSyncExternalStore);var vk=__webpack_require__(83488),_k=__webpack_require__.n(vk);const withSystem=o=>s=>{const{fn:i}=o();class WithSystem extends Pe.Component{render(){return Pe.createElement(s,wo()({},o(),this.props,this.context))}}return WithSystem.displayName=`WithSystem(${i.getDisplayName(s)})`,WithSystem},withRoot=(o,s)=>i=>{const{fn:u}=o();class WithRoot extends Pe.Component{render(){return Pe.createElement(mk,{store:s},Pe.createElement(i,wo()({},this.props,this.context)))}}return WithRoot.displayName=`WithRoot(${u.getDisplayName(i)})`,WithRoot},withConnect=(o,s,i)=>compose(i?withRoot(o,i):_k(),fk(((i,u)=>{const _={...u,...o()},w=s.prototype?.mapStateToProps||(o=>({state:o}));return w(i,_)})),withSystem(o))(s),handleProps=(o,s,i,u)=>{for(const _ in s){const w=s[_];\"function\"==typeof w&&w(i[_],u[_],o())}},withMappedContainer=(o,s,i)=>(s,u)=>{const{fn:_}=o(),w=i(s,\"root\");class WithMappedContainer extends Pe.Component{constructor(s,i){super(s,i),handleProps(o,u,s,{})}UNSAFE_componentWillReceiveProps(s){handleProps(o,u,s,this.props)}render(){const o=Qt()(this.props,u?Object.keys(u):[]);return Pe.createElement(w,o)}}return WithMappedContainer.displayName=`WithMappedContainer(${_.getDisplayName(w)})`,WithMappedContainer},render=(o,s,i,u)=>_=>{const w=i(o,s,u)(\"App\",\"root\"),{createRoot:x}=kx;x(_).render(Pe.createElement(w,null))},getComponent=(o,s,i)=>(u,_,w={})=>{if(\"string\"!=typeof u)throw new TypeError(\"Need a string, to fetch a component. Was given a \"+typeof u);const x=i(u);return x?_?\"root\"===_?withConnect(o,x,s()):withConnect(o,x):x:(w.failSilently||o().log.warn(\"Could not find component:\",u),null)},getDisplayName=o=>o.displayName||o.name||\"Component\",view=({getComponents:o,getStore:s,getSystem:i})=>{const u=(o=>jt(o,((...o)=>JSON.stringify(o))))(getComponent(i,s,o)),_=(o=>utils_memoizeN(o,((...o)=>o)))(withMappedContainer(i,0,u));return{rootInjects:{getComponent:u,makeMappedContainer:_,render:render(i,s,getComponent,o)},fn:{getDisplayName}}},view_legacy=({React:o,getSystem:s,getStore:i,getComponents:u})=>{const _={},w=parseInt(o?.version,10);return w>=16&&w<18&&(_.render=((o,s,i,u)=>_=>{const w=i(o,s,u)(\"App\",\"root\");kx.render(Pe.createElement(w,null),_)})(s,i,getComponent,u)),{rootInjects:_}};function downloadUrlPlugin(o){let{fn:s}=o;const i={download:o=>({errActions:i,specSelectors:u,specActions:_,getConfigs:w})=>{let{fetch:x}=s;const C=w();function next(s){if(s instanceof Error||s.status>=400)return _.updateLoadingStatus(\"failed\"),i.newThrownErr(Object.assign(new Error((s.message||s.statusText)+\" \"+o),{source:\"fetch\"})),void(!s.status&&s instanceof Error&&function checkPossibleFailReasons(){try{let s;if(\"URL\"in at?s=new URL(o):(s=document.createElement(\"a\"),s.href=o),\"https:\"!==s.protocol&&\"https:\"===at.location.protocol){const o=Object.assign(new Error(`Possible mixed-content issue? The page was loaded over https:// but a ${s.protocol}// URL was specified. Check that you are not attempting to load mixed content.`),{source:\"fetch\"});return void i.newThrownErr(o)}if(s.origin!==at.location.origin){const o=Object.assign(new Error(`Possible cross-origin (CORS) issue? The URL origin (${s.origin}) does not match the page (${at.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`),{source:\"fetch\"});i.newThrownErr(o)}}catch(o){return}}());_.updateLoadingStatus(\"success\"),_.updateSpec(s.text),u.url()!==o&&_.updateUrl(o)}o=o||u.url(),_.updateLoadingStatus(\"loading\"),i.clear({source:\"fetch\"}),x({url:o,loadSpec:!0,requestInterceptor:C.requestInterceptor||(o=>o),responseInterceptor:C.responseInterceptor||(o=>o),credentials:\"same-origin\",headers:{Accept:\"application/json,*/*\"}}).then(next,next)},updateLoadingStatus:o=>{let s=[null,\"loading\",\"failed\",\"success\",\"failedConfig\"];return-1===s.indexOf(o)&&console.error(`Error: ${o} is not one of ${JSON.stringify(s)}`),{type:\"spec_update_loading_status\",payload:o}}};let u={loadingStatus:Wt((o=>o||(0,qe.Map)()),(o=>o.get(\"loadingStatus\")||null))};return{statePlugins:{spec:{actions:i,reducers:{spec_update_loading_status:(o,s)=>\"string\"==typeof s.payload?o.set(\"loadingStatus\",s.payload):o},selectors:u}}}}function _objectWithoutProperties(o,s){if(null==o)return{};var i,u,_=function _objectWithoutPropertiesLoose(o,s){if(null==o)return{};var i={};for(var u in o)if(Object.prototype.hasOwnProperty.call(o,u)){if(s.indexOf(u)>=0)continue;i[u]=o[u]}return i}(o,s);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(o,i)&&(_[i]=o[i])}return _}function arrayLikeToArray_arrayLikeToArray(o,s){(null==s||s>o.length)&&(s=o.length);for(var i=0,u=new Array(s);i<s;i++)u[i]=o[i];return u}function toConsumableArray_toConsumableArray(o){return function arrayWithoutHoles_arrayWithoutHoles(o){if(Array.isArray(o))return arrayLikeToArray_arrayLikeToArray(o)}(o)||function iterableToArray_iterableToArray(o){if(\"undefined\"!=typeof Symbol&&null!=o[Symbol.iterator]||null!=o[\"@@iterator\"])return Array.from(o)}(o)||function unsupportedIterableToArray_unsupportedIterableToArray(o,s){if(o){if(\"string\"==typeof o)return arrayLikeToArray_arrayLikeToArray(o,s);var i=Object.prototype.toString.call(o).slice(8,-1);return\"Object\"===i&&o.constructor&&(i=o.constructor.name),\"Map\"===i||\"Set\"===i?Array.from(o):\"Arguments\"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?arrayLikeToArray_arrayLikeToArray(o,s):void 0}}(o)||function nonIterableSpread_nonIterableSpread(){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 typeof_typeof(o){return typeof_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},typeof_typeof(o)}function toPropertyKey(o){var s=function toPrimitive(o,s){if(\"object\"!=typeof_typeof(o)||!o)return o;var i=o[Symbol.toPrimitive];if(void 0!==i){var u=i.call(o,s||\"default\");if(\"object\"!=typeof_typeof(u))return u;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===s?String:Number)(o)}(o,\"string\");return\"symbol\"==typeof_typeof(s)?s:s+\"\"}function defineProperty_defineProperty(o,s,i){return(s=toPropertyKey(s))in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}function extends_extends(){return extends_extends=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(o[u]=i[u])}return o},extends_extends.apply(this,arguments)}function create_element_ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?create_element_ownKeys(Object(i),!0).forEach((function(s){defineProperty_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):create_element_ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}var wk={};function createStyleObject(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return function getClassNameCombinations(o){if(0===o.length||1===o.length)return o;var s=o.join(\".\");return wk[s]||(wk[s]=function powerSetPermutations(o){var s=o.length;return 0===s||1===s?o:2===s?[o[0],o[1],\"\".concat(o[0],\".\").concat(o[1]),\"\".concat(o[1],\".\").concat(o[0])]:3===s?[o[0],o[1],o[2],\"\".concat(o[0],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[2]),\"\".concat(o[2],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[0])]:s>=4?[o[0],o[1],o[2],o[3],\"\".concat(o[0],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[3]),\"\".concat(o[3],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[3]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[3]),\"\".concat(o[0],\".\").concat(o[3],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[3],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[3],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[3],\".\").concat(o[2]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[3],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[3],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[3],\".\").concat(o[1],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[3],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[2],\".\").concat(o[3]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[3],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[1],\".\").concat(o[3]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[3],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[3],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[3],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[2],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[3],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[0],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[3],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[3],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[3],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[1],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[3],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[0],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[3],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[3],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[3],\".\").concat(o[1],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[0],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[3],\".\").concat(o[0],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[1],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[3],\".\").concat(o[1],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[2],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[2],\".\").concat(o[1],\".\").concat(o[0])]:void 0}(o)),wk[s]}(o.filter((function(o){return\"token\"!==o}))).reduce((function(o,s){return _objectSpread(_objectSpread({},o),i[s])}),s)}function createClassNameString(o){return o.join(\" \")}function createElement(o){var s=o.node,i=o.stylesheet,u=o.style,_=void 0===u?{}:u,w=o.useInlineStyles,x=o.key,C=s.properties,j=s.type,L=s.tagName,B=s.value;if(\"text\"===j)return B;if(L){var $,V=function createChildren(o,s){var i=0;return function(u){return i+=1,u.map((function(u,_){return createElement({node:u,stylesheet:o,useInlineStyles:s,key:\"code-segment-\".concat(i,\"-\").concat(_)})}))}}(i,w);if(w){var U=Object.keys(i).reduce((function(o,s){return s.split(\".\").forEach((function(s){o.includes(s)||o.push(s)})),o}),[]),z=C.className&&C.className.includes(\"token\")?[\"token\"]:[],Y=C.className&&z.concat(C.className.filter((function(o){return!U.includes(o)})));$=_objectSpread(_objectSpread({},C),{},{className:createClassNameString(Y)||void 0,style:createStyleObject(C.className,Object.assign({},C.style,_),i)})}else $=_objectSpread(_objectSpread({},C),{},{className:createClassNameString(C.className)});var Z=V(s.children);return Pe.createElement(L,extends_extends({key:x},$),Z)}}const checkForListedLanguage=function(o,s){return-1!==o.listLanguages().indexOf(s)};var xk=[\"language\",\"children\",\"style\",\"customStyle\",\"codeTagProps\",\"useInlineStyles\",\"showLineNumbers\",\"showInlineLineNumbers\",\"startingLineNumber\",\"lineNumberContainerStyle\",\"lineNumberStyle\",\"wrapLines\",\"wrapLongLines\",\"lineProps\",\"renderer\",\"PreTag\",\"CodeTag\",\"code\",\"astGenerator\"];function highlight_ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function highlight_objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?highlight_ownKeys(Object(i),!0).forEach((function(s){defineProperty_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):highlight_ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}var Ak=/\\n/g;function AllLineNumbers(o){var s=o.codeString,i=o.codeStyle,u=o.containerStyle,_=void 0===u?{float:\"left\",paddingRight:\"10px\"}:u,w=o.numberStyle,x=void 0===w?{}:w,C=o.startingLineNumber;return Pe.createElement(\"code\",{style:Object.assign({},i,_)},function getAllLineNumbers(o){var s=o.lines,i=o.startingLineNumber,u=o.style;return s.map((function(o,s){var _=s+i;return Pe.createElement(\"span\",{key:\"line-\".concat(s),className:\"react-syntax-highlighter-line-number\",style:\"function\"==typeof u?u(_):u},\"\".concat(_,\"\\n\"))}))}({lines:s.replace(/\\n$/,\"\").split(\"\\n\"),style:x,startingLineNumber:C}))}function getInlineLineNumber(o,s){return{type:\"element\",tagName:\"span\",properties:{key:\"line-number--\".concat(o),className:[\"comment\",\"linenumber\",\"react-syntax-highlighter-line-number\"],style:s},children:[{type:\"text\",value:o}]}}function assembleLineNumberStyles(o,s,i){var u,_={display:\"inline-block\",minWidth:(u=i,\"\".concat(u.toString().length,\".25em\")),paddingRight:\"1em\",textAlign:\"right\",userSelect:\"none\"},w=\"function\"==typeof o?o(s):o;return highlight_objectSpread(highlight_objectSpread({},_),w)}function createLineElement(o){var s=o.children,i=o.lineNumber,u=o.lineNumberStyle,_=o.largestLineNumber,w=o.showInlineLineNumbers,x=o.lineProps,C=void 0===x?{}:x,j=o.className,L=void 0===j?[]:j,B=o.showLineNumbers,$=o.wrapLongLines,V=\"function\"==typeof C?C(i):C;if(V.className=L,i&&w){var U=assembleLineNumberStyles(u,i,_);s.unshift(getInlineLineNumber(i,U))}return $&B&&(V.style=highlight_objectSpread(highlight_objectSpread({},V.style),{},{display:\"flex\"})),{type:\"element\",tagName:\"span\",properties:V,children:s}}function flattenCodeTree(o){for(var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],u=0;u<o.length;u++){var _=o[u];if(\"text\"===_.type)i.push(createLineElement({children:[_],className:toConsumableArray_toConsumableArray(new Set(s))}));else if(_.children){var w=s.concat(_.properties.className);flattenCodeTree(_.children,w).forEach((function(o){return i.push(o)}))}}return i}function processLines(o,s,i,u,_,w,x,C,j){var L,B=flattenCodeTree(o.value),$=[],V=-1,U=0;function createLine(o,w){var L=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return s||L.length>0?function createWrappedLine(o,s){return createLineElement({children:o,lineNumber:s,lineNumberStyle:C,largestLineNumber:x,showInlineLineNumbers:_,lineProps:i,className:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],showLineNumbers:u,wrapLongLines:j})}(o,w,L):function createUnwrappedLine(o,s){if(u&&s&&_){var i=assembleLineNumberStyles(C,s,x);o.unshift(getInlineLineNumber(s,i))}return o}(o,w)}for(var z=function _loop(){var o=B[U],s=o.children[0].value,i=function getNewLines(o){return o.match(Ak)}(s);if(i){var _=s.split(\"\\n\");_.forEach((function(s,i){var x=u&&$.length+w,C={type:\"text\",value:\"\".concat(s,\"\\n\")};if(0===i){var j=createLine(B.slice(V+1,U).concat(createLineElement({children:[C],className:o.properties.className})),x);$.push(j)}else if(i===_.length-1){var L=B[U+1]&&B[U+1].children&&B[U+1].children[0],z={type:\"text\",value:\"\".concat(s)};if(L){var Y=createLineElement({children:[z],className:o.properties.className});B.splice(U+1,0,Y)}else{var Z=createLine([z],x,o.properties.className);$.push(Z)}}else{var ee=createLine([C],x,o.properties.className);$.push(ee)}})),V=U}U++};U<B.length;)z();if(V!==B.length-1){var Y=B.slice(V+1,B.length);if(Y&&Y.length){var Z=createLine(Y,u&&$.length+w);$.push(Z)}}return s?$:(L=[]).concat.apply(L,$)}function defaultRenderer(o){var s=o.rows,i=o.stylesheet,u=o.useInlineStyles;return s.map((function(o,s){return createElement({node:o,stylesheet:i,useInlineStyles:u,key:\"code-segement\".concat(s)})}))}function isHighlightJs(o){return o&&void 0!==o.highlightAuto}var Bk=__webpack_require__(43768),qk=function highlight(o,s){return function SyntaxHighlighter(i){var u=i.language,_=i.children,w=i.style,x=void 0===w?s:w,C=i.customStyle,j=void 0===C?{}:C,L=i.codeTagProps,B=void 0===L?{className:u?\"language-\".concat(u):void 0,style:highlight_objectSpread(highlight_objectSpread({},x['code[class*=\"language-\"]']),x['code[class*=\"language-'.concat(u,'\"]')])}:L,$=i.useInlineStyles,V=void 0===$||$,U=i.showLineNumbers,z=void 0!==U&&U,Y=i.showInlineLineNumbers,Z=void 0===Y||Y,ee=i.startingLineNumber,ie=void 0===ee?1:ee,ae=i.lineNumberContainerStyle,ce=i.lineNumberStyle,le=void 0===ce?{}:ce,pe=i.wrapLines,de=i.wrapLongLines,fe=void 0!==de&&de,ye=i.lineProps,be=void 0===ye?{}:ye,_e=i.renderer,we=i.PreTag,Se=void 0===we?\"pre\":we,xe=i.CodeTag,Te=void 0===xe?\"code\":xe,Re=i.code,qe=void 0===Re?(Array.isArray(_)?_[0]:_)||\"\":Re,$e=i.astGenerator,ze=_objectWithoutProperties(i,xk);$e=$e||o;var We=z?Pe.createElement(AllLineNumbers,{containerStyle:ae,codeStyle:B.style||{},numberStyle:le,startingLineNumber:ie,codeString:qe}):null,He=x.hljs||x['pre[class*=\"language-\"]']||{backgroundColor:\"#fff\"},Ye=isHighlightJs($e)?\"hljs\":\"prismjs\",Xe=V?Object.assign({},ze,{style:Object.assign({},He,j)}):Object.assign({},ze,{className:ze.className?\"\".concat(Ye,\" \").concat(ze.className):Ye,style:Object.assign({},j)});if(B.style=highlight_objectSpread(highlight_objectSpread({},B.style),{},fe?{whiteSpace:\"pre-wrap\"}:{whiteSpace:\"pre\"}),!$e)return Pe.createElement(Se,Xe,We,Pe.createElement(Te,B,qe));(void 0===pe&&_e||fe)&&(pe=!0),_e=_e||defaultRenderer;var Qe=[{type:\"text\",value:qe}],et=function getCodeTree(o){var s=o.astGenerator,i=o.language,u=o.code,_=o.defaultCodeValue;if(isHighlightJs(s)){var w=checkForListedLanguage(s,i);return\"text\"===i?{value:_,language:\"text\"}:w?s.highlight(i,u):s.highlightAuto(u)}try{return i&&\"text\"!==i?{value:s.highlight(u,i)}:{value:_}}catch(o){return{value:_}}}({astGenerator:$e,language:u,code:qe,defaultCodeValue:Qe});null===et.language&&(et.value=Qe);var tt=processLines(et,pe,be,z,Z,ie,et.value.length+ie,le,fe);return Pe.createElement(Se,Xe,Pe.createElement(Te,B,!Z&&We,_e({rows:tt,stylesheet:x,useInlineStyles:V})))}}(Bk,{});qk.registerLanguage=Bk.registerLanguage;const Vk=qk;var zk=__webpack_require__(95089);const eO=__webpack_require__.n(zk)();var tO=__webpack_require__(65772);const rO=__webpack_require__.n(tO)();var nO=__webpack_require__(17285);const oO=__webpack_require__.n(nO)();var sO=__webpack_require__(35344);const iO=__webpack_require__.n(sO)();var aO=__webpack_require__(17533);const cO=__webpack_require__.n(aO)();var lO=__webpack_require__(73402);const uO=__webpack_require__.n(lO)();var pO=__webpack_require__(26571);const hO=__webpack_require__.n(pO)(),after_load=()=>{Vk.registerLanguage(\"json\",rO),Vk.registerLanguage(\"js\",eO),Vk.registerLanguage(\"xml\",oO),Vk.registerLanguage(\"yaml\",cO),Vk.registerLanguage(\"http\",uO),Vk.registerLanguage(\"bash\",iO),Vk.registerLanguage(\"powershell\",hO),Vk.registerLanguage(\"javascript\",eO)},dO={hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#333\",color:\"white\"},\"hljs-name\":{fontWeight:\"bold\"},\"hljs-strong\":{fontWeight:\"bold\"},\"hljs-code\":{fontStyle:\"italic\",color:\"#888\"},\"hljs-emphasis\":{fontStyle:\"italic\"},\"hljs-tag\":{color:\"#62c8f3\"},\"hljs-variable\":{color:\"#ade5fc\"},\"hljs-template-variable\":{color:\"#ade5fc\"},\"hljs-selector-id\":{color:\"#ade5fc\"},\"hljs-selector-class\":{color:\"#ade5fc\"},\"hljs-string\":{color:\"#a2fca2\"},\"hljs-bullet\":{color:\"#d36363\"},\"hljs-type\":{color:\"#ffa\"},\"hljs-title\":{color:\"#ffa\"},\"hljs-section\":{color:\"#ffa\"},\"hljs-attribute\":{color:\"#ffa\"},\"hljs-quote\":{color:\"#ffa\"},\"hljs-built_in\":{color:\"#ffa\"},\"hljs-builtin-name\":{color:\"#ffa\"},\"hljs-number\":{color:\"#d36363\"},\"hljs-symbol\":{color:\"#d36363\"},\"hljs-keyword\":{color:\"#fcc28c\"},\"hljs-selector-tag\":{color:\"#fcc28c\"},\"hljs-literal\":{color:\"#fcc28c\"},\"hljs-comment\":{color:\"#888\"},\"hljs-deletion\":{color:\"#333\",backgroundColor:\"#fc9b9b\"},\"hljs-regexp\":{color:\"#c6b4f0\"},\"hljs-link\":{color:\"#c6b4f0\"},\"hljs-meta\":{color:\"#fc9b9b\"},\"hljs-addition\":{backgroundColor:\"#a2fca2\",color:\"#333\"}},fO={agate:dO,arta:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#222\",color:\"#aaa\"},\"hljs-subst\":{color:\"#aaa\"},\"hljs-section\":{color:\"#fff\",fontWeight:\"bold\"},\"hljs-comment\":{color:\"#444\"},\"hljs-quote\":{color:\"#444\"},\"hljs-meta\":{color:\"#444\"},\"hljs-string\":{color:\"#ffcc33\"},\"hljs-symbol\":{color:\"#ffcc33\"},\"hljs-bullet\":{color:\"#ffcc33\"},\"hljs-regexp\":{color:\"#ffcc33\"},\"hljs-number\":{color:\"#00cc66\"},\"hljs-addition\":{color:\"#00cc66\"},\"hljs-built_in\":{color:\"#32aaee\"},\"hljs-builtin-name\":{color:\"#32aaee\"},\"hljs-literal\":{color:\"#32aaee\"},\"hljs-type\":{color:\"#32aaee\"},\"hljs-template-variable\":{color:\"#32aaee\"},\"hljs-attribute\":{color:\"#32aaee\"},\"hljs-link\":{color:\"#32aaee\"},\"hljs-keyword\":{color:\"#6644aa\"},\"hljs-selector-tag\":{color:\"#6644aa\"},\"hljs-name\":{color:\"#6644aa\"},\"hljs-selector-id\":{color:\"#6644aa\"},\"hljs-selector-class\":{color:\"#6644aa\"},\"hljs-title\":{color:\"#bb1166\"},\"hljs-variable\":{color:\"#bb1166\"},\"hljs-deletion\":{color:\"#bb1166\"},\"hljs-template-tag\":{color:\"#bb1166\"},\"hljs-doctag\":{fontWeight:\"bold\"},\"hljs-strong\":{fontWeight:\"bold\"},\"hljs-emphasis\":{fontStyle:\"italic\"}},monokai:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#272822\",color:\"#ddd\"},\"hljs-tag\":{color:\"#f92672\"},\"hljs-keyword\":{color:\"#f92672\",fontWeight:\"bold\"},\"hljs-selector-tag\":{color:\"#f92672\",fontWeight:\"bold\"},\"hljs-literal\":{color:\"#f92672\",fontWeight:\"bold\"},\"hljs-strong\":{color:\"#f92672\"},\"hljs-name\":{color:\"#f92672\"},\"hljs-code\":{color:\"#66d9ef\"},\"hljs-class .hljs-title\":{color:\"white\"},\"hljs-attribute\":{color:\"#bf79db\"},\"hljs-symbol\":{color:\"#bf79db\"},\"hljs-regexp\":{color:\"#bf79db\"},\"hljs-link\":{color:\"#bf79db\"},\"hljs-string\":{color:\"#a6e22e\"},\"hljs-bullet\":{color:\"#a6e22e\"},\"hljs-subst\":{color:\"#a6e22e\"},\"hljs-title\":{color:\"#a6e22e\",fontWeight:\"bold\"},\"hljs-section\":{color:\"#a6e22e\",fontWeight:\"bold\"},\"hljs-emphasis\":{color:\"#a6e22e\"},\"hljs-type\":{color:\"#a6e22e\",fontWeight:\"bold\"},\"hljs-built_in\":{color:\"#a6e22e\"},\"hljs-builtin-name\":{color:\"#a6e22e\"},\"hljs-selector-attr\":{color:\"#a6e22e\"},\"hljs-selector-pseudo\":{color:\"#a6e22e\"},\"hljs-addition\":{color:\"#a6e22e\"},\"hljs-variable\":{color:\"#a6e22e\"},\"hljs-template-tag\":{color:\"#a6e22e\"},\"hljs-template-variable\":{color:\"#a6e22e\"},\"hljs-comment\":{color:\"#75715e\"},\"hljs-quote\":{color:\"#75715e\"},\"hljs-deletion\":{color:\"#75715e\"},\"hljs-meta\":{color:\"#75715e\"},\"hljs-doctag\":{fontWeight:\"bold\"},\"hljs-selector-id\":{fontWeight:\"bold\"}},nord:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#2E3440\",color:\"#D8DEE9\"},\"hljs-subst\":{color:\"#D8DEE9\"},\"hljs-selector-tag\":{color:\"#81A1C1\"},\"hljs-selector-id\":{color:\"#8FBCBB\",fontWeight:\"bold\"},\"hljs-selector-class\":{color:\"#8FBCBB\"},\"hljs-selector-attr\":{color:\"#8FBCBB\"},\"hljs-selector-pseudo\":{color:\"#88C0D0\"},\"hljs-addition\":{backgroundColor:\"rgba(163, 190, 140, 0.5)\"},\"hljs-deletion\":{backgroundColor:\"rgba(191, 97, 106, 0.5)\"},\"hljs-built_in\":{color:\"#8FBCBB\"},\"hljs-type\":{color:\"#8FBCBB\"},\"hljs-class\":{color:\"#8FBCBB\"},\"hljs-function\":{color:\"#88C0D0\"},\"hljs-function > .hljs-title\":{color:\"#88C0D0\"},\"hljs-keyword\":{color:\"#81A1C1\"},\"hljs-literal\":{color:\"#81A1C1\"},\"hljs-symbol\":{color:\"#81A1C1\"},\"hljs-number\":{color:\"#B48EAD\"},\"hljs-regexp\":{color:\"#EBCB8B\"},\"hljs-string\":{color:\"#A3BE8C\"},\"hljs-title\":{color:\"#8FBCBB\"},\"hljs-params\":{color:\"#D8DEE9\"},\"hljs-bullet\":{color:\"#81A1C1\"},\"hljs-code\":{color:\"#8FBCBB\"},\"hljs-emphasis\":{fontStyle:\"italic\"},\"hljs-formula\":{color:\"#8FBCBB\"},\"hljs-strong\":{fontWeight:\"bold\"},\"hljs-link:hover\":{textDecoration:\"underline\"},\"hljs-quote\":{color:\"#4C566A\"},\"hljs-comment\":{color:\"#4C566A\"},\"hljs-doctag\":{color:\"#8FBCBB\"},\"hljs-meta\":{color:\"#5E81AC\"},\"hljs-meta-keyword\":{color:\"#5E81AC\"},\"hljs-meta-string\":{color:\"#A3BE8C\"},\"hljs-attr\":{color:\"#8FBCBB\"},\"hljs-attribute\":{color:\"#D8DEE9\"},\"hljs-builtin-name\":{color:\"#81A1C1\"},\"hljs-name\":{color:\"#81A1C1\"},\"hljs-section\":{color:\"#88C0D0\"},\"hljs-tag\":{color:\"#81A1C1\"},\"hljs-variable\":{color:\"#D8DEE9\"},\"hljs-template-variable\":{color:\"#D8DEE9\"},\"hljs-template-tag\":{color:\"#5E81AC\"},\"abnf .hljs-attribute\":{color:\"#88C0D0\"},\"abnf .hljs-symbol\":{color:\"#EBCB8B\"},\"apache .hljs-attribute\":{color:\"#88C0D0\"},\"apache .hljs-section\":{color:\"#81A1C1\"},\"arduino .hljs-built_in\":{color:\"#88C0D0\"},\"aspectj .hljs-meta\":{color:\"#D08770\"},\"aspectj > .hljs-title\":{color:\"#88C0D0\"},\"bnf .hljs-attribute\":{color:\"#8FBCBB\"},\"clojure .hljs-name\":{color:\"#88C0D0\"},\"clojure .hljs-symbol\":{color:\"#EBCB8B\"},\"coq .hljs-built_in\":{color:\"#88C0D0\"},\"cpp .hljs-meta-string\":{color:\"#8FBCBB\"},\"css .hljs-built_in\":{color:\"#88C0D0\"},\"css .hljs-keyword\":{color:\"#D08770\"},\"diff .hljs-meta\":{color:\"#8FBCBB\"},\"ebnf .hljs-attribute\":{color:\"#8FBCBB\"},\"glsl .hljs-built_in\":{color:\"#88C0D0\"},\"groovy .hljs-meta:not(:first-child)\":{color:\"#D08770\"},\"haxe .hljs-meta\":{color:\"#D08770\"},\"java .hljs-meta\":{color:\"#D08770\"},\"ldif .hljs-attribute\":{color:\"#8FBCBB\"},\"lisp .hljs-name\":{color:\"#88C0D0\"},\"lua .hljs-built_in\":{color:\"#88C0D0\"},\"moonscript .hljs-built_in\":{color:\"#88C0D0\"},\"nginx .hljs-attribute\":{color:\"#88C0D0\"},\"nginx .hljs-section\":{color:\"#5E81AC\"},\"pf .hljs-built_in\":{color:\"#88C0D0\"},\"processing .hljs-built_in\":{color:\"#88C0D0\"},\"scss .hljs-keyword\":{color:\"#81A1C1\"},\"stylus .hljs-keyword\":{color:\"#81A1C1\"},\"swift .hljs-meta\":{color:\"#D08770\"},\"vim .hljs-built_in\":{color:\"#88C0D0\",fontStyle:\"italic\"},\"yaml .hljs-meta\":{color:\"#D08770\"}},obsidian:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#282b2e\",color:\"#e0e2e4\"},\"hljs-keyword\":{color:\"#93c763\",fontWeight:\"bold\"},\"hljs-selector-tag\":{color:\"#93c763\",fontWeight:\"bold\"},\"hljs-literal\":{color:\"#93c763\",fontWeight:\"bold\"},\"hljs-selector-id\":{color:\"#93c763\"},\"hljs-number\":{color:\"#ffcd22\"},\"hljs-attribute\":{color:\"#668bb0\"},\"hljs-code\":{color:\"white\"},\"hljs-class .hljs-title\":{color:\"white\"},\"hljs-section\":{color:\"white\",fontWeight:\"bold\"},\"hljs-regexp\":{color:\"#d39745\"},\"hljs-link\":{color:\"#d39745\"},\"hljs-meta\":{color:\"#557182\"},\"hljs-tag\":{color:\"#8cbbad\"},\"hljs-name\":{color:\"#8cbbad\",fontWeight:\"bold\"},\"hljs-bullet\":{color:\"#8cbbad\"},\"hljs-subst\":{color:\"#8cbbad\"},\"hljs-emphasis\":{color:\"#8cbbad\"},\"hljs-type\":{color:\"#8cbbad\",fontWeight:\"bold\"},\"hljs-built_in\":{color:\"#8cbbad\"},\"hljs-selector-attr\":{color:\"#8cbbad\"},\"hljs-selector-pseudo\":{color:\"#8cbbad\"},\"hljs-addition\":{color:\"#8cbbad\"},\"hljs-variable\":{color:\"#8cbbad\"},\"hljs-template-tag\":{color:\"#8cbbad\"},\"hljs-template-variable\":{color:\"#8cbbad\"},\"hljs-string\":{color:\"#ec7600\"},\"hljs-symbol\":{color:\"#ec7600\"},\"hljs-comment\":{color:\"#818e96\"},\"hljs-quote\":{color:\"#818e96\"},\"hljs-deletion\":{color:\"#818e96\"},\"hljs-selector-class\":{color:\"#A082BD\"},\"hljs-doctag\":{fontWeight:\"bold\"},\"hljs-title\":{fontWeight:\"bold\"},\"hljs-strong\":{fontWeight:\"bold\"}},\"tomorrow-night\":{\"hljs-comment\":{color:\"#969896\"},\"hljs-quote\":{color:\"#969896\"},\"hljs-variable\":{color:\"#cc6666\"},\"hljs-template-variable\":{color:\"#cc6666\"},\"hljs-tag\":{color:\"#cc6666\"},\"hljs-name\":{color:\"#cc6666\"},\"hljs-selector-id\":{color:\"#cc6666\"},\"hljs-selector-class\":{color:\"#cc6666\"},\"hljs-regexp\":{color:\"#cc6666\"},\"hljs-deletion\":{color:\"#cc6666\"},\"hljs-number\":{color:\"#de935f\"},\"hljs-built_in\":{color:\"#de935f\"},\"hljs-builtin-name\":{color:\"#de935f\"},\"hljs-literal\":{color:\"#de935f\"},\"hljs-type\":{color:\"#de935f\"},\"hljs-params\":{color:\"#de935f\"},\"hljs-meta\":{color:\"#de935f\"},\"hljs-link\":{color:\"#de935f\"},\"hljs-attribute\":{color:\"#f0c674\"},\"hljs-string\":{color:\"#b5bd68\"},\"hljs-symbol\":{color:\"#b5bd68\"},\"hljs-bullet\":{color:\"#b5bd68\"},\"hljs-addition\":{color:\"#b5bd68\"},\"hljs-title\":{color:\"#81a2be\"},\"hljs-section\":{color:\"#81a2be\"},\"hljs-keyword\":{color:\"#b294bb\"},\"hljs-selector-tag\":{color:\"#b294bb\"},hljs:{display:\"block\",overflowX:\"auto\",background:\"#1d1f21\",color:\"#c5c8c6\",padding:\"0.5em\"},\"hljs-emphasis\":{fontStyle:\"italic\"},\"hljs-strong\":{fontWeight:\"bold\"}},idea:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",color:\"#000\",background:\"#fff\"},\"hljs-subst\":{fontWeight:\"normal\",color:\"#000\"},\"hljs-title\":{fontWeight:\"normal\",color:\"#000\"},\"hljs-comment\":{color:\"#808080\",fontStyle:\"italic\"},\"hljs-quote\":{color:\"#808080\",fontStyle:\"italic\"},\"hljs-meta\":{color:\"#808000\"},\"hljs-tag\":{background:\"#efefef\"},\"hljs-section\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-name\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-literal\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-keyword\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-selector-tag\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-type\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-selector-id\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-selector-class\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-attribute\":{fontWeight:\"bold\",color:\"#0000ff\"},\"hljs-number\":{fontWeight:\"normal\",color:\"#0000ff\"},\"hljs-regexp\":{fontWeight:\"normal\",color:\"#0000ff\"},\"hljs-link\":{fontWeight:\"normal\",color:\"#0000ff\"},\"hljs-string\":{color:\"#008000\",fontWeight:\"bold\"},\"hljs-symbol\":{color:\"#000\",background:\"#d0eded\",fontStyle:\"italic\"},\"hljs-bullet\":{color:\"#000\",background:\"#d0eded\",fontStyle:\"italic\"},\"hljs-formula\":{color:\"#000\",background:\"#d0eded\",fontStyle:\"italic\"},\"hljs-doctag\":{textDecoration:\"underline\"},\"hljs-variable\":{color:\"#660e7a\"},\"hljs-template-variable\":{color:\"#660e7a\"},\"hljs-addition\":{background:\"#baeeba\"},\"hljs-deletion\":{background:\"#ffc8bd\"},\"hljs-emphasis\":{fontStyle:\"italic\"},\"hljs-strong\":{fontWeight:\"bold\"}}},mO=dO,components_SyntaxHighlighter=({language:o,className:s=\"\",getConfigs:i,syntaxHighlighting:u={},children:_=\"\"})=>{const w=i().syntaxHighlight.theme,{styles:x,defaultStyle:C}=u,j=x?.[w]??C;return Pe.createElement(Vk,{language:o,className:s,style:j},_)};var gO=__webpack_require__(5419),yO=__webpack_require__.n(gO);const components_HighlightCode=({fileName:o=\"response.txt\",className:s,downloadable:i,getComponent:u,canCopy:_,language:w,children:x})=>{const C=(0,Pe.useRef)(null),j=u(\"SyntaxHighlighter\",!0),handlePreventYScrollingBeyondElement=o=>{const{target:s,deltaY:i}=o,{scrollHeight:u,offsetHeight:_,scrollTop:w}=s;u>_&&(0===w&&i<0||_+w>=u&&i>0)&&o.preventDefault()};return(0,Pe.useEffect)((()=>{const o=Array.from(C.current.childNodes).filter((o=>!!o.nodeType&&o.classList.contains(\"microlight\")));return o.forEach((o=>o.addEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement,{passive:!1}))),()=>{o.forEach((o=>o.removeEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement)))}}),[x,s,w]),Pe.createElement(\"div\",{className:\"highlight-code\",ref:C},_&&Pe.createElement(\"div\",{className:\"copy-to-clipboard\"},Pe.createElement(Ro.CopyToClipboard,{text:x},Pe.createElement(\"button\",null))),i?Pe.createElement(\"button\",{className:\"download-contents\",onClick:()=>{yO()(x,o)}},\"Download\"):null,Pe.createElement(j,{language:w,className:To()(s,\"microlight\"),renderPlainText:({children:o,PlainTextViewer:i})=>Pe.createElement(i,{className:s},o)},x))},components_PlainTextViewer=({className:o=\"\",children:s})=>Pe.createElement(\"pre\",{className:To()(\"microlight\",o)},s),wrap_components_SyntaxHighlighter=(o,s)=>({renderPlainText:i,children:u,..._})=>{const w=s.getConfigs().syntaxHighlight.activated,x=s.getComponent(\"PlainTextViewer\");return w||\"function\"!=typeof i?w?Pe.createElement(o,_,u):Pe.createElement(x,null,u):i({children:u,PlainTextViewer:x})},SyntaxHighlightingPlugin1=()=>({afterLoad:after_load,rootInjects:{syntaxHighlighting:{styles:fO,defaultStyle:mO}},components:{SyntaxHighlighter:components_SyntaxHighlighter,HighlightCode:components_HighlightCode,PlainTextViewer:components_PlainTextViewer}}),SyntaxHighlightingPlugin2=()=>({wrapComponents:{SyntaxHighlighter:wrap_components_SyntaxHighlighter}}),syntax_highlighting=()=>[SyntaxHighlightingPlugin1,SyntaxHighlightingPlugin2],versions_after_load=()=>{const{GIT_DIRTY:o,GIT_COMMIT:s,PACKAGE_VERSION:i,BUILD_TIME:u}={PACKAGE_VERSION:\"5.17.14\",GIT_COMMIT:\"g8aa52920\",GIT_DIRTY:!0,BUILD_TIME:\"Tue, 28 May 2024 05:23:41 GMT\"};at.versions=at.versions||{},at.versions.swaggerUI={version:i,gitRevision:s,gitDirty:o,buildTimestamp:u}},versions=()=>({afterLoad:versions_after_load});var vO=__webpack_require__(47248),bO=__webpack_require__.n(vO);const _O=console.error,withErrorBoundary=o=>s=>{const{getComponent:i,fn:u}=o(),_=i(\"ErrorBoundary\"),w=u.getDisplayName(s);class WithErrorBoundary extends Pe.Component{render(){return Pe.createElement(_,{targetName:w,getComponent:i,fn:u},Pe.createElement(s,wo()({},this.props,this.context)))}}var x;return WithErrorBoundary.displayName=`WithErrorBoundary(${w})`,(x=s).prototype&&x.prototype.isReactComponent&&(WithErrorBoundary.prototype.mapStateToProps=s.prototype.mapStateToProps),WithErrorBoundary},fallback=({name:o})=>Pe.createElement(\"div\",{className:\"fallback\"},\"😱 \",Pe.createElement(\"i\",null,\"Could not render \",\"t\"===o?\"this component\":o,\", see the console.\"));class ErrorBoundary extends Pe.Component{static defaultProps={targetName:\"this component\",getComponent:()=>fallback,fn:{componentDidCatch:_O},children:null};static getDerivedStateFromError(o){return{hasError:!0,error:o}}constructor(...o){super(...o),this.state={hasError:!1,error:null}}componentDidCatch(o,s){this.props.fn.componentDidCatch(o,s)}render(){const{getComponent:o,targetName:s,children:i}=this.props;if(this.state.hasError){const i=o(\"Fallback\");return Pe.createElement(i,{name:s})}return i}}const EO=ErrorBoundary,safe_render=({componentList:o=[],fullOverride:s=!1}={})=>({getSystem:i})=>{const u=s?o:[\"App\",\"BaseLayout\",\"VersionPragmaFilter\",\"InfoContainer\",\"ServersContainer\",\"SchemesContainer\",\"AuthorizeBtnContainer\",\"FilterContainer\",\"Operations\",\"OperationContainer\",\"parameters\",\"responses\",\"OperationServers\",\"Models\",\"ModelWrapper\",...o],_=bO()(u,Array(u.length).fill(((o,{fn:s})=>s.withErrorBoundary(o))));return{fn:{componentDidCatch:_O,withErrorBoundary:withErrorBoundary(i)},components:{ErrorBoundary:EO,Fallback:fallback},wrapComponents:_}};class App extends Pe.Component{getLayout(){const{getComponent:o,layoutSelectors:s}=this.props,i=s.current(),u=o(i,!0);return u||(()=>Pe.createElement(\"h1\",null,' No layout defined for \"',i,'\" '))}render(){const o=this.getLayout();return Pe.createElement(o,null)}}const wO=App;class AuthorizationPopup extends Pe.Component{close=()=>{let{authActions:o}=this.props;o.showDefinitions(!1)};render(){let{authSelectors:o,authActions:s,getComponent:i,errSelectors:u,specSelectors:_,fn:{AST:w={}}}=this.props,x=o.shownDefinitions();const C=i(\"auths\"),j=i(\"CloseIcon\");return Pe.createElement(\"div\",{className:\"dialog-ux\"},Pe.createElement(\"div\",{className:\"backdrop-ux\"}),Pe.createElement(\"div\",{className:\"modal-ux\"},Pe.createElement(\"div\",{className:\"modal-dialog-ux\"},Pe.createElement(\"div\",{className:\"modal-ux-inner\"},Pe.createElement(\"div\",{className:\"modal-ux-header\"},Pe.createElement(\"h3\",null,\"Available authorizations\"),Pe.createElement(\"button\",{type:\"button\",className:\"close-modal\",onClick:this.close},Pe.createElement(j,null))),Pe.createElement(\"div\",{className:\"modal-ux-content\"},x.valueSeq().map(((x,j)=>Pe.createElement(C,{key:j,AST:w,definitions:x,getComponent:i,errSelectors:u,authSelectors:o,authActions:s,specSelectors:_}))))))))}}class AuthorizeBtn extends Pe.Component{render(){let{isAuthorized:o,showPopup:s,onClick:i,getComponent:u}=this.props;const _=u(\"authorizationPopup\",!0),w=u(\"LockAuthIcon\",!0),x=u(\"UnlockAuthIcon\",!0);return Pe.createElement(\"div\",{className:\"auth-wrapper\"},Pe.createElement(\"button\",{className:o?\"btn authorize locked\":\"btn authorize unlocked\",onClick:i},Pe.createElement(\"span\",null,\"Authorize\"),o?Pe.createElement(w,null):Pe.createElement(x,null)),s&&Pe.createElement(_,null))}}class AuthorizeBtnContainer extends Pe.Component{render(){const{authActions:o,authSelectors:s,specSelectors:i,getComponent:u}=this.props,_=i.securityDefinitions(),w=s.definitionsToAuthorize(),x=u(\"authorizeBtn\");return _?Pe.createElement(x,{onClick:()=>o.showDefinitions(w),isAuthorized:!!s.authorized().size,showPopup:!!s.shownDefinitions(),getComponent:u}):null}}class AuthorizeOperationBtn extends Pe.Component{onClick=o=>{o.stopPropagation();let{onClick:s}=this.props;s&&s()};render(){let{isAuthorized:o,getComponent:s}=this.props;const i=s(\"LockAuthOperationIcon\",!0),u=s(\"UnlockAuthOperationIcon\",!0);return Pe.createElement(\"button\",{className:\"authorization__btn\",\"aria-label\":o?\"authorization button locked\":\"authorization button unlocked\",onClick:this.onClick},o?Pe.createElement(i,{className:\"locked\"}):Pe.createElement(u,{className:\"unlocked\"}))}}class Auths extends Pe.Component{constructor(o,s){super(o,s),this.state={}}onAuthChange=o=>{let{name:s}=o;this.setState({[s]:o})};submitAuth=o=>{o.preventDefault();let{authActions:s}=this.props;s.authorizeWithPersistOption(this.state)};logoutClick=o=>{o.preventDefault();let{authActions:s,definitions:i}=this.props,u=i.map(((o,s)=>s)).toArray();this.setState(u.reduce(((o,s)=>(o[s]=\"\",o)),{})),s.logoutWithPersistOption(u)};close=o=>{o.preventDefault();let{authActions:s}=this.props;s.showDefinitions(!1)};render(){let{definitions:o,getComponent:s,authSelectors:i,errSelectors:u}=this.props;const _=s(\"AuthItem\"),w=s(\"oauth2\",!0),x=s(\"Button\");let C=i.authorized(),j=o.filter(((o,s)=>!!C.get(s))),L=o.filter((o=>\"oauth2\"!==o.get(\"type\"))),B=o.filter((o=>\"oauth2\"===o.get(\"type\")));return Pe.createElement(\"div\",{className:\"auth-container\"},!!L.size&&Pe.createElement(\"form\",{onSubmit:this.submitAuth},L.map(((o,i)=>Pe.createElement(_,{key:i,schema:o,name:i,getComponent:s,onAuthChange:this.onAuthChange,authorized:C,errSelectors:u}))).toArray(),Pe.createElement(\"div\",{className:\"auth-btn-wrapper\"},L.size===j.size?Pe.createElement(x,{className:\"btn modal-btn auth\",onClick:this.logoutClick,\"aria-label\":\"Remove authorization\"},\"Logout\"):Pe.createElement(x,{type:\"submit\",className:\"btn modal-btn auth authorize\",\"aria-label\":\"Apply credentials\"},\"Authorize\"),Pe.createElement(x,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\"))),B&&B.size?Pe.createElement(\"div\",null,Pe.createElement(\"div\",{className:\"scope-def\"},Pe.createElement(\"p\",null,\"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\"),Pe.createElement(\"p\",null,\"API requires the following scopes. Select which ones you want to grant to Swagger UI.\")),o.filter((o=>\"oauth2\"===o.get(\"type\"))).map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(w,{authorized:C,schema:o,name:s})))).toArray()):null)}}class auth_item_Auths extends Pe.Component{render(){let{schema:o,name:s,getComponent:i,onAuthChange:u,authorized:_,errSelectors:w}=this.props;const x=i(\"apiKeyAuth\"),C=i(\"basicAuth\");let j;const L=o.get(\"type\");switch(L){case\"apiKey\":j=Pe.createElement(x,{key:s,schema:o,name:s,errSelectors:w,authorized:_,getComponent:i,onChange:u});break;case\"basic\":j=Pe.createElement(C,{key:s,schema:o,name:s,errSelectors:w,authorized:_,getComponent:i,onChange:u});break;default:j=Pe.createElement(\"div\",{key:s},\"Unknown security definition type \",L)}return Pe.createElement(\"div\",{key:`${s}-jump`},j)}}class AuthError extends Pe.Component{render(){let{error:o}=this.props,s=o.get(\"level\"),i=o.get(\"message\"),u=o.get(\"source\");return Pe.createElement(\"div\",{className:\"errors\"},Pe.createElement(\"b\",null,u,\" \",s),Pe.createElement(\"span\",null,i))}}class ApiKeyAuth extends Pe.Component{constructor(o,s){super(o,s);let{name:i,schema:u}=this.props,_=this.getValue();this.state={name:i,schema:u,value:_}}getValue(){let{name:o,authorized:s}=this.props;return s&&s.getIn([o,\"value\"])}onChange=o=>{let{onChange:s}=this.props,i=o.target.value,u=Object.assign({},this.state,{value:i});this.setState(u),s(u)};render(){let{schema:o,getComponent:s,errSelectors:i,name:u}=this.props;const _=s(\"Input\"),w=s(\"Row\"),x=s(\"Col\"),C=s(\"authError\"),j=s(\"Markdown\",!0),L=s(\"JumpToPath\",!0);let B=this.getValue(),$=i.allErrors().filter((o=>o.get(\"authId\")===u));return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,Pe.createElement(\"code\",null,u||o.get(\"name\")),\" (apiKey)\",Pe.createElement(L,{path:[\"securityDefinitions\",u]})),B&&Pe.createElement(\"h6\",null,\"Authorized\"),Pe.createElement(w,null,Pe.createElement(j,{source:o.get(\"description\")})),Pe.createElement(w,null,Pe.createElement(\"p\",null,\"Name: \",Pe.createElement(\"code\",null,o.get(\"name\")))),Pe.createElement(w,null,Pe.createElement(\"p\",null,\"In: \",Pe.createElement(\"code\",null,o.get(\"in\")))),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"api_key_value\"},\"Value:\"),B?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"api_key_value\",type:\"text\",onChange:this.onChange,autoFocus:!0}))),$.valueSeq().map(((o,s)=>Pe.createElement(C,{error:o,key:s}))))}}class BasicAuth extends Pe.Component{constructor(o,s){super(o,s);let{schema:i,name:u}=this.props,_=this.getValue().username;this.state={name:u,schema:i,value:_?{username:_}:{}}}getValue(){let{authorized:o,name:s}=this.props;return o&&o.getIn([s,\"value\"])||{}}onChange=o=>{let{onChange:s}=this.props,{value:i,name:u}=o.target,_=this.state.value;_[u]=i,this.setState({value:_}),s(this.state)};render(){let{schema:o,getComponent:s,name:i,errSelectors:u}=this.props;const _=s(\"Input\"),w=s(\"Row\"),x=s(\"Col\"),C=s(\"authError\"),j=s(\"JumpToPath\",!0),L=s(\"Markdown\",!0);let B=this.getValue().username,$=u.allErrors().filter((o=>o.get(\"authId\")===i));return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,\"Basic authorization\",Pe.createElement(j,{path:[\"securityDefinitions\",i]})),B&&Pe.createElement(\"h6\",null,\"Authorized\"),Pe.createElement(w,null,Pe.createElement(L,{source:o.get(\"description\")})),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth_username\"},\"Username:\"),B?Pe.createElement(\"code\",null,\" \",B,\" \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth_username\",type:\"text\",required:\"required\",name:\"username\",onChange:this.onChange,autoFocus:!0}))),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth_password\"},\"Password:\"),B?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth_password\",autoComplete:\"new-password\",name:\"password\",type:\"password\",onChange:this.onChange}))),$.valueSeq().map(((o,s)=>Pe.createElement(C,{error:o,key:s}))))}}function example_Example(o){const{example:s,showValue:i,getComponent:u}=o,_=u(\"Markdown\",!0),w=u(\"HighlightCode\",!0);return s?Pe.createElement(\"div\",{className:\"example\"},s.get(\"description\")?Pe.createElement(\"section\",{className:\"example__section\"},Pe.createElement(\"div\",{className:\"example__section-header\"},\"Example Description\"),Pe.createElement(\"p\",null,Pe.createElement(_,{source:s.get(\"description\")}))):null,i&&s.has(\"value\")?Pe.createElement(\"section\",{className:\"example__section\"},Pe.createElement(\"div\",{className:\"example__section-header\"},\"Example Value\"),Pe.createElement(w,null,stringify(s.get(\"value\")))):null):null}class ExamplesSelect extends Pe.PureComponent{static defaultProps={examples:$e().Map({}),onSelect:(...o)=>console.log(\"DEBUG: ExamplesSelect was not given an onSelect callback\",...o),currentExampleKey:null,showLabels:!0};_onSelect=(o,{isSyntheticChange:s=!1}={})=>{\"function\"==typeof this.props.onSelect&&this.props.onSelect(o,{isSyntheticChange:s})};_onDomSelect=o=>{if(\"function\"==typeof this.props.onSelect){const s=o.target.selectedOptions[0].getAttribute(\"value\");this._onSelect(s,{isSyntheticChange:!1})}};getCurrentExample=()=>{const{examples:o,currentExampleKey:s}=this.props,i=o.get(s),u=o.keySeq().first(),_=o.get(u);return i||_||Map({})};componentDidMount(){const{onSelect:o,examples:s}=this.props;if(\"function\"==typeof o){const o=s.first(),i=s.keyOf(o);this._onSelect(i,{isSyntheticChange:!0})}}UNSAFE_componentWillReceiveProps(o){const{currentExampleKey:s,examples:i}=o;if(i!==this.props.examples&&!i.has(s)){const o=i.first(),s=i.keyOf(o);this._onSelect(s,{isSyntheticChange:!0})}}render(){const{examples:o,currentExampleKey:s,isValueModified:i,isModifiedValueAvailable:u,showLabels:_}=this.props;return Pe.createElement(\"div\",{className:\"examples-select\"},_?Pe.createElement(\"span\",{className:\"examples-select__section-label\"},\"Examples: \"):null,Pe.createElement(\"select\",{className:\"examples-select-element\",onChange:this._onDomSelect,value:u&&i?\"__MODIFIED__VALUE__\":s||\"\"},u?Pe.createElement(\"option\",{value:\"__MODIFIED__VALUE__\"},\"[Modified value]\"):null,o.map(((o,s)=>Pe.createElement(\"option\",{key:s,value:s},o.get(\"summary\")||s))).valueSeq()))}}const stringifyUnlessList=o=>qe.List.isList(o)?o:stringify(o);class ExamplesSelectValueRetainer extends Pe.PureComponent{static defaultProps={userHasEditedBody:!1,examples:(0,qe.Map)({}),currentNamespace:\"__DEFAULT__NAMESPACE__\",setRetainRequestBodyValueFlag:()=>{},onSelect:(...o)=>console.log(\"ExamplesSelectValueRetainer: no `onSelect` function was provided\",...o),updateValue:(...o)=>console.log(\"ExamplesSelectValueRetainer: no `updateValue` function was provided\",...o)};constructor(o){super(o);const s=this._getCurrentExampleValue();this.state={[o.currentNamespace]:(0,qe.Map)({lastUserEditedValue:this.props.currentUserInputValue,lastDownstreamValue:s,isModifiedValueSelected:this.props.userHasEditedBody||this.props.currentUserInputValue!==s})}}componentWillUnmount(){this.props.setRetainRequestBodyValueFlag(!1)}_getStateForCurrentNamespace=()=>{const{currentNamespace:o}=this.props;return(this.state[o]||(0,qe.Map)()).toObject()};_setStateForCurrentNamespace=o=>{const{currentNamespace:s}=this.props;return this._setStateForNamespace(s,o)};_setStateForNamespace=(o,s)=>{const i=(this.state[o]||(0,qe.Map)()).mergeDeep(s);return this.setState({[o]:i})};_isCurrentUserInputSameAsExampleValue=()=>{const{currentUserInputValue:o}=this.props;return this._getCurrentExampleValue()===o};_getValueForExample=(o,s)=>{const{examples:i}=s||this.props;return stringifyUnlessList((i||(0,qe.Map)({})).getIn([o,\"value\"]))};_getCurrentExampleValue=o=>{const{currentKey:s}=o||this.props;return this._getValueForExample(s,o||this.props)};_onExamplesSelect=(o,{isSyntheticChange:s}={},...i)=>{const{onSelect:u,updateValue:_,currentUserInputValue:w,userHasEditedBody:x}=this.props,{lastUserEditedValue:C}=this._getStateForCurrentNamespace(),j=this._getValueForExample(o);if(\"__MODIFIED__VALUE__\"===o)return _(stringifyUnlessList(C)),this._setStateForCurrentNamespace({isModifiedValueSelected:!0});\"function\"==typeof u&&u(o,{isSyntheticChange:s},...i),this._setStateForCurrentNamespace({lastDownstreamValue:j,isModifiedValueSelected:s&&x||!!w&&w!==j}),s||\"function\"==typeof _&&_(stringifyUnlessList(j))};UNSAFE_componentWillReceiveProps(o){const{currentUserInputValue:s,examples:i,onSelect:u,userHasEditedBody:_}=o,{lastUserEditedValue:w,lastDownstreamValue:x}=this._getStateForCurrentNamespace(),C=this._getValueForExample(o.currentKey,o),j=i.filter((o=>o.get(\"value\")===s||stringify(o.get(\"value\"))===s));if(j.size){let s;s=j.has(o.currentKey)?o.currentKey:j.keySeq().first(),u(s,{isSyntheticChange:!0})}else s!==this.props.currentUserInputValue&&s!==w&&s!==x&&(this.props.setRetainRequestBodyValueFlag(!0),this._setStateForNamespace(o.currentNamespace,{lastUserEditedValue:o.currentUserInputValue,isModifiedValueSelected:_||s!==C}))}render(){const{currentUserInputValue:o,examples:s,currentKey:i,getComponent:u,userHasEditedBody:_}=this.props,{lastDownstreamValue:w,lastUserEditedValue:x,isModifiedValueSelected:C}=this._getStateForCurrentNamespace(),j=u(\"ExamplesSelect\");return Pe.createElement(j,{examples:s,currentExampleKey:i,onSelect:this._onExamplesSelect,isModifiedValueAvailable:!!x&&x!==w,isValueModified:void 0!==o&&C&&o!==this._getCurrentExampleValue()||_})}}function oauth2_authorize_authorize({auth:o,authActions:s,errActions:i,configs:u,authConfigs:_={},currentServer:w}){let{schema:x,scopes:C,name:j,clientId:L}=o,B=x.get(\"flow\"),$=[];switch(B){case\"password\":return void s.authorizePassword(o);case\"application\":case\"clientCredentials\":case\"client_credentials\":return void s.authorizeApplication(o);case\"accessCode\":case\"authorizationCode\":case\"authorization_code\":$.push(\"response_type=code\");break;case\"implicit\":$.push(\"response_type=token\")}\"string\"==typeof L&&$.push(\"client_id=\"+encodeURIComponent(L));let V=u.oauth2RedirectUrl;if(void 0===V)return void i.newAuthErr({authId:j,source:\"validation\",level:\"error\",message:\"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed.\"});$.push(\"redirect_uri=\"+encodeURIComponent(V));let U=[];if(Array.isArray(C)?U=C:$e().List.isList(C)&&(U=C.toArray()),U.length>0){let o=_.scopeSeparator||\" \";$.push(\"scope=\"+encodeURIComponent(U.join(o)))}let z=utils_btoa(new Date);if($.push(\"state=\"+encodeURIComponent(z)),void 0!==_.realm&&$.push(\"realm=\"+encodeURIComponent(_.realm)),(\"authorizationCode\"===B||\"authorization_code\"===B||\"accessCode\"===B)&&_.usePkceWithAuthorizationCodeGrant){const s=function generateCodeVerifier(){return b64toB64UrlEncoded(St()(32).toString(\"base64\"))}(),i=function createCodeChallenge(o){return b64toB64UrlEncoded(kt()(\"sha256\").update(o).digest(\"base64\"))}(s);$.push(\"code_challenge=\"+i),$.push(\"code_challenge_method=S256\"),o.codeVerifier=s}let{additionalQueryStringParams:Y}=_;for(let o in Y)void 0!==Y[o]&&$.push([o,Y[o]].map(encodeURIComponent).join(\"=\"));const Z=x.get(\"authorizationUrl\");let ee;ee=w?Mt()(sanitizeUrl(Z),w,!0).toString():sanitizeUrl(Z);let ie,ae=[ee,$.join(\"&\")].join(-1===Z.indexOf(\"?\")?\"?\":\"&\");ie=\"implicit\"===B?s.preAuthorizeImplicit:_.useBasicAuthenticationWithAccessCodeGrant?s.authorizeAccessCodeWithBasicAuthentication:s.authorizeAccessCodeWithFormParams,s.authPopup(ae,{auth:o,state:z,redirectUrl:V,callback:ie,errCb:i.newAuthErr})}class Oauth2 extends Pe.Component{constructor(o,s){super(o,s);let{name:i,schema:u,authorized:_,authSelectors:w}=this.props,x=_&&_.get(i),C=w.getConfigs()||{},j=x&&x.get(\"username\")||\"\",L=x&&x.get(\"clientId\")||C.clientId||\"\",B=x&&x.get(\"clientSecret\")||C.clientSecret||\"\",$=x&&x.get(\"passwordType\")||\"basic\",V=x&&x.get(\"scopes\")||C.scopes||[];\"string\"==typeof V&&(V=V.split(C.scopeSeparator||\" \")),this.state={appName:C.appName,name:i,schema:u,scopes:V,clientId:L,clientSecret:B,username:j,password:\"\",passwordType:$}}close=o=>{o.preventDefault();let{authActions:s}=this.props;s.showDefinitions(!1)};authorize=()=>{let{authActions:o,errActions:s,getConfigs:i,authSelectors:u,oas3Selectors:_}=this.props,w=i(),x=u.getConfigs();s.clear({authId:name,type:\"auth\",source:\"auth\"}),oauth2_authorize_authorize({auth:this.state,currentServer:_.serverEffectiveValue(_.selectedServer()),authActions:o,errActions:s,configs:w,authConfigs:x})};onScopeChange=o=>{let{target:s}=o,{checked:i}=s,u=s.dataset.value;if(i&&-1===this.state.scopes.indexOf(u)){let o=this.state.scopes.concat([u]);this.setState({scopes:o})}else!i&&this.state.scopes.indexOf(u)>-1&&this.setState({scopes:this.state.scopes.filter((o=>o!==u))})};onInputChange=o=>{let{target:{dataset:{name:s},value:i}}=o,u={[s]:i};this.setState(u)};selectScopes=o=>{o.target.dataset.all?this.setState({scopes:Array.from((this.props.schema.get(\"allowedScopes\")||this.props.schema.get(\"scopes\")).keys())}):this.setState({scopes:[]})};logout=o=>{o.preventDefault();let{authActions:s,errActions:i,name:u}=this.props;i.clear({authId:u,type:\"auth\",source:\"auth\"}),s.logoutWithPersistOption([u])};render(){let{schema:o,getComponent:s,authSelectors:i,errSelectors:u,name:_,specSelectors:w}=this.props;const x=s(\"Input\"),C=s(\"Row\"),j=s(\"Col\"),L=s(\"Button\"),B=s(\"authError\"),$=s(\"JumpToPath\",!0),V=s(\"Markdown\",!0),U=s(\"InitializedInput\"),{isOAS3:z}=w;let Y=z()?o.get(\"openIdConnectUrl\"):null;const Z=\"implicit\",ee=\"password\",ie=z()?Y?\"authorization_code\":\"authorizationCode\":\"accessCode\",ae=z()?Y?\"client_credentials\":\"clientCredentials\":\"application\";let ce=!!(i.getConfigs()||{}).usePkceWithAuthorizationCodeGrant,le=o.get(\"flow\"),pe=le===ie&&ce?le+\" with PKCE\":le,de=o.get(\"allowedScopes\")||o.get(\"scopes\"),fe=!!i.authorized().get(_),ye=u.allErrors().filter((o=>o.get(\"authId\")===_)),be=!ye.filter((o=>\"validation\"===o.get(\"source\"))).size,_e=o.get(\"description\");return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,_,\" (OAuth2, \",pe,\") \",Pe.createElement($,{path:[\"securityDefinitions\",_]})),this.state.appName?Pe.createElement(\"h5\",null,\"Application: \",this.state.appName,\" \"):null,_e&&Pe.createElement(V,{source:o.get(\"description\")}),fe&&Pe.createElement(\"h6\",null,\"Authorized\"),Y&&Pe.createElement(\"p\",null,\"OpenID Connect URL: \",Pe.createElement(\"code\",null,Y)),(le===Z||le===ie)&&Pe.createElement(\"p\",null,\"Authorization URL: \",Pe.createElement(\"code\",null,o.get(\"authorizationUrl\"))),(le===ee||le===ie||le===ae)&&Pe.createElement(\"p\",null,\"Token URL:\",Pe.createElement(\"code\",null,\" \",o.get(\"tokenUrl\"))),Pe.createElement(\"p\",{className:\"flow\"},\"Flow: \",Pe.createElement(\"code\",null,pe)),le!==ee?null:Pe.createElement(C,null,Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:\"oauth_username\"},\"username:\"),fe?Pe.createElement(\"code\",null,\" \",this.state.username,\" \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(\"input\",{id:\"oauth_username\",type:\"text\",\"data-name\":\"username\",onChange:this.onInputChange,autoFocus:!0}))),Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:\"oauth_password\"},\"password:\"),fe?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(\"input\",{id:\"oauth_password\",type:\"password\",\"data-name\":\"password\",onChange:this.onInputChange}))),Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:\"password_type\"},\"Client credentials location:\"),fe?Pe.createElement(\"code\",null,\" \",this.state.passwordType,\" \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(\"select\",{id:\"password_type\",\"data-name\":\"passwordType\",onChange:this.onInputChange},Pe.createElement(\"option\",{value:\"basic\"},\"Authorization header\"),Pe.createElement(\"option\",{value:\"request-body\"},\"Request body\"))))),(le===ae||le===Z||le===ie||le===ee)&&(!fe||fe&&this.state.clientId)&&Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:`client_id_${le}`},\"client_id:\"),fe?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(U,{id:`client_id_${le}`,type:\"text\",required:le===ee,initialValue:this.state.clientId,\"data-name\":\"clientId\",onChange:this.onInputChange}))),(le===ae||le===ie||le===ee)&&Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:`client_secret_${le}`},\"client_secret:\"),fe?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(U,{id:`client_secret_${le}`,initialValue:this.state.clientSecret,type:\"password\",\"data-name\":\"clientSecret\",onChange:this.onInputChange}))),!fe&&de&&de.size?Pe.createElement(\"div\",{className:\"scopes\"},Pe.createElement(\"h2\",null,\"Scopes:\",Pe.createElement(\"a\",{onClick:this.selectScopes,\"data-all\":!0},\"select all\"),Pe.createElement(\"a\",{onClick:this.selectScopes},\"select none\")),de.map(((o,s)=>Pe.createElement(C,{key:s},Pe.createElement(\"div\",{className:\"checkbox\"},Pe.createElement(x,{\"data-value\":s,id:`${s}-${le}-checkbox-${this.state.name}`,disabled:fe,checked:this.state.scopes.includes(s),type:\"checkbox\",onChange:this.onScopeChange}),Pe.createElement(\"label\",{htmlFor:`${s}-${le}-checkbox-${this.state.name}`},Pe.createElement(\"span\",{className:\"item\"}),Pe.createElement(\"div\",{className:\"text\"},Pe.createElement(\"p\",{className:\"name\"},s),Pe.createElement(\"p\",{className:\"description\"},o))))))).toArray()):null,ye.valueSeq().map(((o,s)=>Pe.createElement(B,{error:o,key:s}))),Pe.createElement(\"div\",{className:\"auth-btn-wrapper\"},be&&(fe?Pe.createElement(L,{className:\"btn modal-btn auth authorize\",onClick:this.logout,\"aria-label\":\"Remove authorization\"},\"Logout\"):Pe.createElement(L,{className:\"btn modal-btn auth authorize\",onClick:this.authorize,\"aria-label\":\"Apply given OAuth2 credentials\"},\"Authorize\")),Pe.createElement(L,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\")))}}class Clear extends Pe.Component{onClick=()=>{let{specActions:o,path:s,method:i}=this.props;o.clearResponse(s,i),o.clearRequest(s,i)};render(){return Pe.createElement(\"button\",{className:\"btn btn-clear opblock-control__btn\",onClick:this.onClick},\"Clear\")}}const live_response_Headers=({headers:o})=>Pe.createElement(\"div\",null,Pe.createElement(\"h5\",null,\"Response headers\"),Pe.createElement(\"pre\",{className:\"microlight\"},o)),Duration=({duration:o})=>Pe.createElement(\"div\",null,Pe.createElement(\"h5\",null,\"Request duration\"),Pe.createElement(\"pre\",{className:\"microlight\"},o,\" ms\"));class LiveResponse extends Pe.Component{shouldComponentUpdate(o){return this.props.response!==o.response||this.props.path!==o.path||this.props.method!==o.method||this.props.displayRequestDuration!==o.displayRequestDuration}render(){const{response:o,getComponent:s,getConfigs:i,displayRequestDuration:u,specSelectors:_,path:w,method:x}=this.props,{showMutatedRequest:C,requestSnippetsEnabled:j}=i(),L=C?_.mutatedRequestFor(w,x):_.requestFor(w,x),B=o.get(\"status\"),$=L.get(\"url\"),V=o.get(\"headers\").toJS(),U=o.get(\"notDocumented\"),z=o.get(\"error\"),Y=o.get(\"text\"),Z=o.get(\"duration\"),ee=Object.keys(V),ie=V[\"content-type\"]||V[\"Content-Type\"],ae=s(\"responseBody\"),ce=ee.map((o=>{var s=Array.isArray(V[o])?V[o].join():V[o];return Pe.createElement(\"span\",{className:\"headerline\",key:o},\" \",o,\": \",s,\" \")})),le=0!==ce.length,pe=s(\"Markdown\",!0),de=s(\"RequestSnippets\",!0),fe=s(\"curl\",!0);return Pe.createElement(\"div\",null,L&&j?Pe.createElement(de,{request:L}):Pe.createElement(fe,{request:L}),$&&Pe.createElement(\"div\",null,Pe.createElement(\"div\",{className:\"request-url\"},Pe.createElement(\"h4\",null,\"Request URL\"),Pe.createElement(\"pre\",{className:\"microlight\"},$))),Pe.createElement(\"h4\",null,\"Server response\"),Pe.createElement(\"table\",{className:\"responses-table live-responses-table\"},Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",{className:\"responses-header\"},Pe.createElement(\"td\",{className:\"col_header response-col_status\"},\"Code\"),Pe.createElement(\"td\",{className:\"col_header response-col_description\"},\"Details\"))),Pe.createElement(\"tbody\",null,Pe.createElement(\"tr\",{className:\"response\"},Pe.createElement(\"td\",{className:\"response-col_status\"},B,U?Pe.createElement(\"div\",{className:\"response-undocumented\"},Pe.createElement(\"i\",null,\" Undocumented \")):null),Pe.createElement(\"td\",{className:\"response-col_description\"},z?Pe.createElement(pe,{source:`${\"\"!==o.get(\"name\")?`${o.get(\"name\")}: `:\"\"}${o.get(\"message\")}`}):null,Y?Pe.createElement(ae,{content:Y,contentType:ie,url:$,headers:V,getConfigs:i,getComponent:s}):null,le?Pe.createElement(live_response_Headers,{headers:ce}):null,u&&Z?Pe.createElement(Duration,{duration:Z}):null)))))}}class OnlineValidatorBadge extends Pe.Component{constructor(o,s){super(o,s);let{getConfigs:i}=o,{validatorUrl:u}=i();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===u?\"https://validator.swagger.io/validator\":u}}getDefinitionUrl=()=>{let{specSelectors:o}=this.props;return new(Mt())(o.url(),at.location).toString()};UNSAFE_componentWillReceiveProps(o){let{getConfigs:s}=o,{validatorUrl:i}=s();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===i?\"https://validator.swagger.io/validator\":i})}render(){let{getConfigs:o}=this.props,{spec:s}=o(),i=sanitizeUrl(this.state.validatorUrl);return\"object\"==typeof s&&Object.keys(s).length?null:this.state.url&&requiresValidationURL(this.state.validatorUrl)&&requiresValidationURL(this.state.url)?Pe.createElement(\"span\",{className:\"float-right\"},Pe.createElement(\"a\",{target:\"_blank\",rel:\"noopener noreferrer\",href:`${i}/debug?url=${encodeURIComponent(this.state.url)}`},Pe.createElement(ValidatorImage,{src:`${i}?url=${encodeURIComponent(this.state.url)}`,alt:\"Online validator badge\"}))):null}}class ValidatorImage extends Pe.Component{constructor(o){super(o),this.state={loaded:!1,error:!1}}componentDidMount(){const o=new Image;o.onload=()=>{this.setState({loaded:!0})},o.onerror=()=>{this.setState({error:!0})},o.src=this.props.src}UNSAFE_componentWillReceiveProps(o){if(o.src!==this.props.src){const s=new Image;s.onload=()=>{this.setState({loaded:!0})},s.onerror=()=>{this.setState({error:!0})},s.src=o.src}}render(){return this.state.error?Pe.createElement(\"img\",{alt:\"Error\"}):this.state.loaded?Pe.createElement(\"img\",{src:this.props.src,alt:this.props.alt}):null}}class Operations extends Pe.Component{render(){let{specSelectors:o}=this.props;const s=o.taggedOperations();return 0===s.size?Pe.createElement(\"h3\",null,\" No operations defined in spec!\"):Pe.createElement(\"div\",null,s.map(this.renderOperationTag).toArray(),s.size<1?Pe.createElement(\"h3\",null,\" No operations defined in spec! \"):null)}renderOperationTag=(o,s)=>{const{specSelectors:i,getComponent:u,oas3Selectors:_,layoutSelectors:w,layoutActions:x,getConfigs:C}=this.props,j=i.validOperationMethods(),L=u(\"OperationContainer\",!0),B=u(\"OperationTag\"),$=o.get(\"operations\");return Pe.createElement(B,{key:\"operation-\"+s,tagObj:o,tag:s,oas3Selectors:_,layoutSelectors:w,layoutActions:x,getConfigs:C,getComponent:u,specUrl:i.url()},Pe.createElement(\"div\",{className:\"operation-tag-content\"},$.map((o=>{const i=o.get(\"path\"),u=o.get(\"method\"),_=$e().List([\"paths\",i,u]);return-1===j.indexOf(u)?null:Pe.createElement(L,{key:`${i}-${u}`,specPath:_,op:o,path:i,method:u,tag:s})})).toArray()))}}function isAbsoluteUrl(o){return o.match(/^(?:[a-z]+:)?\\/\\//i)}function buildBaseUrl(o,s){return o?isAbsoluteUrl(o)?function addProtocol(o){return o.match(/^\\/\\//i)?`${window.location.protocol}${o}`:o}(o):new URL(o,s).href:s}function safeBuildUrl(o,s,{selectedServer:i=\"\"}={}){try{return function buildUrl(o,s,{selectedServer:i=\"\"}={}){if(!o)return;if(isAbsoluteUrl(o))return o;const u=buildBaseUrl(i,s);return isAbsoluteUrl(u)?new URL(o,u).href:new URL(o,window.location.href).href}(o,s,{selectedServer:i})}catch{return}}class OperationTag extends Pe.Component{static defaultProps={tagObj:$e().fromJS({}),tag:\"\"};render(){const{tagObj:o,tag:s,children:i,oas3Selectors:u,layoutSelectors:_,layoutActions:w,getConfigs:x,getComponent:C,specUrl:j}=this.props;let{docExpansion:L,deepLinking:B}=x();const $=C(\"Collapse\"),V=C(\"Markdown\",!0),U=C(\"DeepLink\"),z=C(\"Link\"),Y=C(\"ArrowUpIcon\"),Z=C(\"ArrowDownIcon\");let ee,ie=o.getIn([\"tagDetails\",\"description\"],null),ae=o.getIn([\"tagDetails\",\"externalDocs\",\"description\"]),ce=o.getIn([\"tagDetails\",\"externalDocs\",\"url\"]);ee=isFunc(u)&&isFunc(u.selectedServer)?safeBuildUrl(ce,j,{selectedServer:u.selectedServer()}):ce;let le=[\"operations-tag\",s],pe=_.isShown(le,\"full\"===L||\"list\"===L);return Pe.createElement(\"div\",{className:pe?\"opblock-tag-section is-open\":\"opblock-tag-section\"},Pe.createElement(\"h3\",{onClick:()=>w.show(le,!pe),className:ie?\"opblock-tag\":\"opblock-tag no-desc\",id:le.map((o=>escapeDeepLinkPath(o))).join(\"-\"),\"data-tag\":s,\"data-is-open\":pe},Pe.createElement(U,{enabled:B,isShown:pe,path:createDeepLinkPath(s),text:s}),ie?Pe.createElement(\"small\",null,Pe.createElement(V,{source:ie})):Pe.createElement(\"small\",null),ee?Pe.createElement(\"div\",{className:\"info__externaldocs\"},Pe.createElement(\"small\",null,Pe.createElement(z,{href:sanitizeUrl(ee),onClick:o=>o.stopPropagation(),target:\"_blank\"},ae||ee))):null,Pe.createElement(\"button\",{\"aria-expanded\":pe,className:\"expand-operation\",title:pe?\"Collapse operation\":\"Expand operation\",onClick:()=>w.show(le,!pe)},pe?Pe.createElement(Y,{className:\"arrow\"}):Pe.createElement(Z,{className:\"arrow\"}))),Pe.createElement($,{isOpened:pe},i))}}class operation_Operation extends Pe.PureComponent{static defaultProps={operation:null,response:null,request:null,specPath:(0,qe.List)(),summary:\"\"};render(){let{specPath:o,response:s,request:i,toggleShown:u,onTryoutClick:_,onResetClick:w,onCancelClick:x,onExecute:C,fn:j,getComponent:L,getConfigs:B,specActions:$,specSelectors:V,authActions:U,authSelectors:z,oas3Actions:Y,oas3Selectors:Z}=this.props,ee=this.props.operation,{deprecated:ie,isShown:ae,path:ce,method:le,op:pe,tag:de,operationId:fe,allowTryItOut:ye,displayRequestDuration:be,tryItOutEnabled:_e,executeInProgress:we}=ee.toJS(),{description:Se,externalDocs:xe,schemes:Te}=pe;const Re=xe?safeBuildUrl(xe.url,V.url(),{selectedServer:Z.selectedServer()}):\"\";let qe=ee.getIn([\"op\"]),ze=qe.get(\"responses\"),We=function getList(o,s){if(!$e().Iterable.isIterable(o))return $e().List();let i=o.getIn(Array.isArray(s)?s:[s]);return $e().List.isList(i)?i:$e().List()}(qe,[\"parameters\"]),He=V.operationScheme(ce,le),Ye=[\"operations\",de,fe],Xe=getExtensions(qe);const Qe=L(\"responses\"),et=L(\"parameters\"),tt=L(\"execute\"),rt=L(\"clear\"),nt=L(\"Collapse\"),ot=L(\"Markdown\",!0),st=L(\"schemes\"),it=L(\"OperationServers\"),at=L(\"OperationExt\"),ct=L(\"OperationSummary\"),lt=L(\"Link\"),{showExtensions:ut}=B();if(ze&&s&&s.size>0){let o=!ze.get(String(s.get(\"status\")))&&!ze.get(\"default\");s=s.set(\"notDocumented\",o)}let pt=[ce,le];const ht=V.validationErrors([ce,le]);return Pe.createElement(\"div\",{className:ie?\"opblock opblock-deprecated\":ae?`opblock opblock-${le} is-open`:`opblock opblock-${le}`,id:escapeDeepLinkPath(Ye.join(\"-\"))},Pe.createElement(ct,{operationProps:ee,isShown:ae,toggleShown:u,getComponent:L,authActions:U,authSelectors:z,specPath:o}),Pe.createElement(nt,{isOpened:ae},Pe.createElement(\"div\",{className:\"opblock-body\"},qe&&qe.size||null===qe?null:Pe.createElement(rolling_load,{height:\"32px\",width:\"32px\",className:\"opblock-loading-animation\"}),ie&&Pe.createElement(\"h4\",{className:\"opblock-title_normal\"},\" Warning: Deprecated\"),Se&&Pe.createElement(\"div\",{className:\"opblock-description-wrapper\"},Pe.createElement(\"div\",{className:\"opblock-description\"},Pe.createElement(ot,{source:Se}))),Re?Pe.createElement(\"div\",{className:\"opblock-external-docs-wrapper\"},Pe.createElement(\"h4\",{className:\"opblock-title_normal\"},\"Find more details\"),Pe.createElement(\"div\",{className:\"opblock-external-docs\"},xe.description&&Pe.createElement(\"span\",{className:\"opblock-external-docs__description\"},Pe.createElement(ot,{source:xe.description})),Pe.createElement(lt,{target:\"_blank\",className:\"opblock-external-docs__link\",href:sanitizeUrl(Re)},Re))):null,qe&&qe.size?Pe.createElement(et,{parameters:We,specPath:o.push(\"parameters\"),operation:qe,onChangeKey:pt,onTryoutClick:_,onResetClick:w,onCancelClick:x,tryItOutEnabled:_e,allowTryItOut:ye,fn:j,getComponent:L,specActions:$,specSelectors:V,pathMethod:[ce,le],getConfigs:B,oas3Actions:Y,oas3Selectors:Z}):null,_e?Pe.createElement(it,{getComponent:L,path:ce,method:le,operationServers:qe.get(\"servers\"),pathServers:V.paths().getIn([ce,\"servers\"]),getSelectedServer:Z.selectedServer,setSelectedServer:Y.setSelectedServer,setServerVariableValue:Y.setServerVariableValue,getServerVariable:Z.serverVariableValue,getEffectiveServerValue:Z.serverEffectiveValue}):null,_e&&ye&&Te&&Te.size?Pe.createElement(\"div\",{className:\"opblock-schemes\"},Pe.createElement(st,{schemes:Te,path:ce,method:le,specActions:$,currentScheme:He})):null,!_e||!ye||ht.length<=0?null:Pe.createElement(\"div\",{className:\"validation-errors errors-wrapper\"},\"Please correct the following validation errors and try again.\",Pe.createElement(\"ul\",null,ht.map(((o,s)=>Pe.createElement(\"li\",{key:s},\" \",o,\" \"))))),Pe.createElement(\"div\",{className:_e&&s&&ye?\"btn-group\":\"execute-wrapper\"},_e&&ye?Pe.createElement(tt,{operation:qe,specActions:$,specSelectors:V,oas3Selectors:Z,oas3Actions:Y,path:ce,method:le,onExecute:C,disabled:we}):null,_e&&s&&ye?Pe.createElement(rt,{specActions:$,path:ce,method:le}):null),we?Pe.createElement(\"div\",{className:\"loading-container\"},Pe.createElement(\"div\",{className:\"loading\"})):null,ze?Pe.createElement(Qe,{responses:ze,request:i,tryItOutResponse:s,getComponent:L,getConfigs:B,specSelectors:V,oas3Actions:Y,oas3Selectors:Z,specActions:$,produces:V.producesOptionsFor([ce,le]),producesValue:V.currentProducesFor([ce,le]),specPath:o.push(\"responses\"),path:ce,method:le,displayRequestDuration:be,fn:j}):null,ut&&Xe.size?Pe.createElement(at,{extensions:Xe,getComponent:L}):null)))}}class OperationContainer extends Pe.PureComponent{constructor(o,s){super(o,s);const{tryItOutEnabled:i}=o.getConfigs();this.state={tryItOutEnabled:i,executeInProgress:!1}}static defaultProps={showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1};mapStateToProps(o,s){const{op:i,layoutSelectors:u,getConfigs:_}=s,{docExpansion:w,deepLinking:x,displayOperationId:C,displayRequestDuration:j,supportedSubmitMethods:L}=_(),B=u.showSummary(),$=i.getIn([\"operation\",\"__originalOperationId\"])||i.getIn([\"operation\",\"operationId\"])||opId(i.get(\"operation\"),s.path,s.method)||i.get(\"id\"),V=[\"operations\",s.tag,$],U=L.indexOf(s.method)>=0&&(void 0===s.allowTryItOut?s.specSelectors.allowTryItOutFor(s.path,s.method):s.allowTryItOut),z=i.getIn([\"operation\",\"security\"])||s.specSelectors.security();return{operationId:$,isDeepLinkingEnabled:x,showSummary:B,displayOperationId:C,displayRequestDuration:j,allowTryItOut:U,security:z,isAuthorized:s.authSelectors.isAuthorized(z),isShown:u.isShown(V,\"full\"===w),jumpToKey:`paths.${s.path}.${s.method}`,response:s.specSelectors.responseFor(s.path,s.method),request:s.specSelectors.requestFor(s.path,s.method)}}componentDidMount(){const{isShown:o}=this.props,s=this.getResolvedSubtree();o&&void 0===s&&this.requestResolvedSubtree()}UNSAFE_componentWillReceiveProps(o){const{response:s,isShown:i}=o,u=this.getResolvedSubtree();s!==this.props.response&&this.setState({executeInProgress:!1}),i&&void 0===u&&this.requestResolvedSubtree()}toggleShown=()=>{let{layoutActions:o,tag:s,operationId:i,isShown:u}=this.props;const _=this.getResolvedSubtree();u||void 0!==_||this.requestResolvedSubtree(),o.show([\"operations\",s,i],!u)};onCancelClick=()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})};onTryoutClick=()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})};onResetClick=o=>{const s=this.props.oas3Selectors.selectDefaultRequestBodyValue(...o);this.props.oas3Actions.setRequestBodyValue({value:s,pathMethod:o})};onExecute=()=>{this.setState({executeInProgress:!0})};getResolvedSubtree=()=>{const{specSelectors:o,path:s,method:i,specPath:u}=this.props;return u?o.specResolvedSubtree(u.toJS()):o.specResolvedSubtree([\"paths\",s,i])};requestResolvedSubtree=()=>{const{specActions:o,path:s,method:i,specPath:u}=this.props;return u?o.requestResolvedSubtree(u.toJS()):o.requestResolvedSubtree([\"paths\",s,i])};render(){let{op:o,tag:s,path:i,method:u,security:_,isAuthorized:w,operationId:x,showSummary:C,isShown:j,jumpToKey:L,allowTryItOut:B,response:$,request:V,displayOperationId:U,displayRequestDuration:z,isDeepLinkingEnabled:Y,specPath:Z,specSelectors:ee,specActions:ie,getComponent:ae,getConfigs:ce,layoutSelectors:le,layoutActions:pe,authActions:de,authSelectors:fe,oas3Actions:ye,oas3Selectors:be,fn:_e}=this.props;const we=ae(\"operation\"),Se=this.getResolvedSubtree()||(0,qe.Map)(),xe=(0,qe.fromJS)({op:Se,tag:s,path:i,summary:o.getIn([\"operation\",\"summary\"])||\"\",deprecated:Se.get(\"deprecated\")||o.getIn([\"operation\",\"deprecated\"])||!1,method:u,security:_,isAuthorized:w,operationId:x,originalOperationId:Se.getIn([\"operation\",\"__originalOperationId\"]),showSummary:C,isShown:j,jumpToKey:L,allowTryItOut:B,request:V,displayOperationId:U,displayRequestDuration:z,isDeepLinkingEnabled:Y,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return Pe.createElement(we,{operation:xe,response:$,request:V,isShown:j,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onResetClick:this.onResetClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:Z,specActions:ie,specSelectors:ee,oas3Actions:ye,oas3Selectors:be,layoutActions:pe,layoutSelectors:le,authActions:de,authSelectors:fe,getComponent:ae,getConfigs:ce,fn:_e})}}var SO=__webpack_require__(13222),xO=__webpack_require__.n(SO);class OperationSummary extends Pe.PureComponent{static defaultProps={operationProps:null,specPath:(0,qe.List)(),summary:\"\"};render(){let{isShown:o,toggleShown:s,getComponent:i,authActions:u,authSelectors:_,operationProps:w,specPath:x}=this.props,{summary:C,isAuthorized:j,method:L,op:B,showSummary:$,path:V,operationId:U,originalOperationId:z,displayOperationId:Y}=w.toJS(),{summary:Z}=B,ee=w.get(\"security\");const ie=i(\"authorizeOperationBtn\",!0),ae=i(\"OperationSummaryMethod\"),ce=i(\"OperationSummaryPath\"),le=i(\"JumpToPath\",!0),pe=i(\"CopyToClipboardBtn\",!0),de=i(\"ArrowUpIcon\"),fe=i(\"ArrowDownIcon\"),ye=ee&&!!ee.count(),be=ye&&1===ee.size&&ee.first().isEmpty(),_e=!ye||be;return Pe.createElement(\"div\",{className:`opblock-summary opblock-summary-${L}`},Pe.createElement(\"button\",{\"aria-expanded\":o,className:\"opblock-summary-control\",onClick:s},Pe.createElement(ae,{method:L}),Pe.createElement(\"div\",{className:\"opblock-summary-path-description-wrapper\"},Pe.createElement(ce,{getComponent:i,operationProps:w,specPath:x}),$?Pe.createElement(\"div\",{className:\"opblock-summary-description\"},xO()(Z||C)):null),Y&&(z||U)?Pe.createElement(\"span\",{className:\"opblock-summary-operation-id\"},z||U):null),Pe.createElement(pe,{textToCopy:`${x.get(1)}`}),_e?null:Pe.createElement(ie,{isAuthorized:j,onClick:()=>{const o=_.definitionsForRequirements(ee);u.showDefinitions(o)}}),Pe.createElement(le,{path:x}),Pe.createElement(\"button\",{\"aria-label\":`${L} ${V.replace(/\\//g,\"​/\")}`,className:\"opblock-control-arrow\",\"aria-expanded\":o,tabIndex:\"-1\",onClick:s},o?Pe.createElement(de,{className:\"arrow\"}):Pe.createElement(fe,{className:\"arrow\"})))}}class OperationSummaryMethod extends Pe.PureComponent{static defaultProps={operationProps:null};render(){let{method:o}=this.props;return Pe.createElement(\"span\",{className:\"opblock-summary-method\"},o.toUpperCase())}}class OperationSummaryPath extends Pe.PureComponent{render(){let{getComponent:o,operationProps:s}=this.props,{deprecated:i,isShown:u,path:_,tag:w,operationId:x,isDeepLinkingEnabled:C}=s.toJS();const j=_.split(/(?=\\/)/g);for(let o=1;o<j.length;o+=2)j.splice(o,0,Pe.createElement(\"wbr\",{key:o}));const L=o(\"DeepLink\");return Pe.createElement(\"span\",{className:i?\"opblock-summary-path__deprecated\":\"opblock-summary-path\",\"data-path\":_},Pe.createElement(L,{enabled:C,isShown:u,path:createDeepLinkPath(`${w}/${x}`),text:j}))}}const operation_extensions=({extensions:o,getComponent:s})=>{let i=s(\"OperationExtRow\");return Pe.createElement(\"div\",{className:\"opblock-section\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},Pe.createElement(\"h4\",null,\"Extensions\")),Pe.createElement(\"div\",{className:\"table-container\"},Pe.createElement(\"table\",null,Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",null,Pe.createElement(\"td\",{className:\"col_header\"},\"Field\"),Pe.createElement(\"td\",{className:\"col_header\"},\"Value\"))),Pe.createElement(\"tbody\",null,o.entrySeq().map((([o,s])=>Pe.createElement(i,{key:`${o}-${s}`,xKey:o,xVal:s})))))))},operation_extension_row=({xKey:o,xVal:s})=>{const i=s?s.toJS?s.toJS():s:null;return Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,o),Pe.createElement(\"td\",null,JSON.stringify(i)))};function createHtmlReadyId(o,s=\"_\"){return o.replace(/[^\\w-]/g,s)}class responses_Responses extends Pe.Component{static defaultProps={tryItOutResponse:null,produces:(0,qe.fromJS)([\"application/json\"]),displayRequestDuration:!1};onChangeProducesWrapper=o=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],o);onResponseContentTypeChange=({controlsAcceptHeader:o,value:s})=>{const{oas3Actions:i,path:u,method:_}=this.props;o&&i.setResponseContentType({value:s,path:u,method:_})};render(){let{responses:o,tryItOutResponse:s,getComponent:i,getConfigs:u,specSelectors:_,fn:w,producesValue:x,displayRequestDuration:C,specPath:j,path:L,method:B,oas3Selectors:$,oas3Actions:V}=this.props,U=function defaultStatusCode(o){let s=o.keySeq();return s.contains(At)?At:s.filter((o=>\"2\"===(o+\"\")[0])).sort().first()}(o);const z=i(\"contentType\"),Y=i(\"liveResponse\"),Z=i(\"response\");let ee=this.props.produces&&this.props.produces.size?this.props.produces:responses_Responses.defaultProps.produces;const ie=_.isOAS3()?function getAcceptControllingResponse(o){if(!$e().OrderedMap.isOrderedMap(o))return null;if(!o.size)return null;const s=o.find(((o,s)=>s.startsWith(\"2\")&&Object.keys(o.get(\"content\")||{}).length>0)),i=o.get(\"default\")||$e().OrderedMap(),u=(i.get(\"content\")||$e().OrderedMap()).keySeq().toJS().length?i:null;return s||u}(o):null,ae=createHtmlReadyId(`${B}${L}_responses`),ce=`${ae}_select`;return Pe.createElement(\"div\",{className:\"responses-wrapper\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},Pe.createElement(\"h4\",null,\"Responses\"),_.isOAS3()?null:Pe.createElement(\"label\",{htmlFor:ce},Pe.createElement(\"span\",null,\"Response content type\"),Pe.createElement(z,{value:x,ariaControls:ae,ariaLabel:\"Response content type\",className:\"execute-content-type\",contentTypes:ee,controlId:ce,onChange:this.onChangeProducesWrapper}))),Pe.createElement(\"div\",{className:\"responses-inner\"},s?Pe.createElement(\"div\",null,Pe.createElement(Y,{response:s,getComponent:i,getConfigs:u,specSelectors:_,path:this.props.path,method:this.props.method,displayRequestDuration:C}),Pe.createElement(\"h4\",null,\"Responses\")):null,Pe.createElement(\"table\",{\"aria-live\":\"polite\",className:\"responses-table\",id:ae,role:\"region\"},Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",{className:\"responses-header\"},Pe.createElement(\"td\",{className:\"col_header response-col_status\"},\"Code\"),Pe.createElement(\"td\",{className:\"col_header response-col_description\"},\"Description\"),_.isOAS3()?Pe.createElement(\"td\",{className:\"col col_header response-col_links\"},\"Links\"):null)),Pe.createElement(\"tbody\",null,o.entrySeq().map((([o,C])=>{let z=s&&s.get(\"status\")==o?\"response_current\":\"\";return Pe.createElement(Z,{key:o,path:L,method:B,specPath:j.push(o),isDefault:U===o,fn:w,className:z,code:o,response:C,specSelectors:_,controlsAcceptHeader:C===ie,onContentTypeChange:this.onResponseContentTypeChange,contentType:x,getConfigs:u,activeExamplesKey:$.activeExamplesMember(L,B,\"responses\",o),oas3Actions:V,getComponent:i})})).toArray()))))}}function getKnownSyntaxHighlighterLanguage(o){const s=function canJsonParse(o){try{return!!JSON.parse(o)}catch(o){return null}}(o);return s?\"json\":null}class response_Response extends Pe.Component{constructor(o,s){super(o,s),this.state={responseContentType:\"\"}}static defaultProps={response:(0,qe.fromJS)({}),onContentTypeChange:()=>{}};_onContentTypeChange=o=>{const{onContentTypeChange:s,controlsAcceptHeader:i}=this.props;this.setState({responseContentType:o}),s({value:o,controlsAcceptHeader:i})};getTargetExamplesKey=()=>{const{response:o,contentType:s,activeExamplesKey:i}=this.props,u=this.state.responseContentType||s,_=o.getIn([\"content\",u],(0,qe.Map)({})).get(\"examples\",null).keySeq().first();return i||_};render(){let{path:o,method:s,code:i,response:u,className:_,specPath:w,fn:x,getComponent:C,getConfigs:j,specSelectors:L,contentType:B,controlsAcceptHeader:$,oas3Actions:V}=this.props,{inferSchema:U,getSampleSchema:z}=x,Y=L.isOAS3();const{showExtensions:Z}=j();let ee=Z?getExtensions(u):null,ie=u.get(\"headers\"),ae=u.get(\"links\");const ce=C(\"ResponseExtension\"),le=C(\"headers\"),pe=C(\"HighlightCode\",!0),de=C(\"modelExample\"),fe=C(\"Markdown\",!0),ye=C(\"operationLink\"),be=C(\"contentType\"),_e=C(\"ExamplesSelect\"),we=C(\"Example\");var Se,xe;const Te=this.state.responseContentType||B,Re=u.getIn([\"content\",Te],(0,qe.Map)({})),$e=Re.get(\"examples\",null);if(Y){const o=Re.get(\"schema\");Se=o?U(o.toJS()):null,xe=o?(0,qe.List)([\"content\",this.state.responseContentType,\"schema\"]):w}else Se=u.get(\"schema\"),xe=u.has(\"schema\")?w.push(\"schema\"):w;let ze,We,He=!1,Ye={includeReadOnly:!0};if(Y)if(We=Re.get(\"schema\")?.toJS(),qe.Map.isMap($e)&&!$e.isEmpty()){const o=this.getTargetExamplesKey(),getMediaTypeExample=o=>o.get(\"value\");ze=getMediaTypeExample($e.get(o,(0,qe.Map)({}))),void 0===ze&&(ze=getMediaTypeExample($e.values().next().value)),He=!0}else void 0!==Re.get(\"example\")&&(ze=Re.get(\"example\"),He=!0);else{We=Se,Ye={...Ye,includeWriteOnly:!0};const o=u.getIn([\"examples\",Te]);o&&(ze=o,He=!0)}const Xe=((o,s)=>{if(null==o)return null;const i=getKnownSyntaxHighlighterLanguage(o)?\"json\":null;return Pe.createElement(\"div\",null,Pe.createElement(s,{className:\"example\",language:i},stringify(o)))})(z(We,Te,Ye,He?ze:void 0),pe);return Pe.createElement(\"tr\",{className:\"response \"+(_||\"\"),\"data-code\":i},Pe.createElement(\"td\",{className:\"response-col_status\"},i),Pe.createElement(\"td\",{className:\"response-col_description\"},Pe.createElement(\"div\",{className:\"response-col_description__inner\"},Pe.createElement(fe,{source:u.get(\"description\")})),Z&&ee.size?ee.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,xKey:o,xVal:s}))):null,Y&&u.get(\"content\")?Pe.createElement(\"section\",{className:\"response-controls\"},Pe.createElement(\"div\",{className:To()(\"response-control-media-type\",{\"response-control-media-type--accept-controller\":$})},Pe.createElement(\"small\",{className:\"response-control-media-type__title\"},\"Media type\"),Pe.createElement(be,{value:this.state.responseContentType,contentTypes:u.get(\"content\")?u.get(\"content\").keySeq():(0,qe.Seq)(),onChange:this._onContentTypeChange,ariaLabel:\"Media Type\"}),$?Pe.createElement(\"small\",{className:\"response-control-media-type__accept-message\"},\"Controls \",Pe.createElement(\"code\",null,\"Accept\"),\" header.\"):null),qe.Map.isMap($e)&&!$e.isEmpty()?Pe.createElement(\"div\",{className:\"response-control-examples\"},Pe.createElement(\"small\",{className:\"response-control-examples__title\"},\"Examples\"),Pe.createElement(_e,{examples:$e,currentExampleKey:this.getTargetExamplesKey(),onSelect:u=>V.setActiveExamplesMember({name:u,pathMethod:[o,s],contextType:\"responses\",contextName:i}),showLabels:!1})):null):null,Xe||Se?Pe.createElement(de,{specPath:xe,getComponent:C,getConfigs:j,specSelectors:L,schema:fromJSOrdered(Se),example:Xe,includeReadOnly:!0}):null,Y&&$e?Pe.createElement(we,{example:$e.get(this.getTargetExamplesKey(),(0,qe.Map)({})),getComponent:C,getConfigs:j,omitValue:!0}):null,ie?Pe.createElement(le,{headers:ie,getComponent:C}):null),Y?Pe.createElement(\"td\",{className:\"response-col_links\"},ae?ae.toSeq().entrySeq().map((([o,s])=>Pe.createElement(ye,{key:o,name:o,link:s,getComponent:C}))):Pe.createElement(\"i\",null,\"No links\")):null)}}const response_extension=({xKey:o,xVal:s})=>Pe.createElement(\"div\",{className:\"response__extension\"},o,\": \",String(s));var kO=__webpack_require__(26657),OO=__webpack_require__.n(kO),CO=__webpack_require__(80218),AO=__webpack_require__.n(CO);class ResponseBody extends Pe.PureComponent{state={parsedContent:null};updateParsedContent=o=>{const{content:s}=this.props;if(o!==s)if(s&&s instanceof Blob){var i=new FileReader;i.onload=()=>{this.setState({parsedContent:i.result})},i.readAsText(s)}else this.setState({parsedContent:s.toString()})};componentDidMount(){this.updateParsedContent(null)}componentDidUpdate(o){this.updateParsedContent(o.content)}render(){let{content:o,contentType:s,url:i,headers:u={},getComponent:_}=this.props;const{parsedContent:w}=this.state,x=_(\"HighlightCode\",!0),C=\"response_\"+(new Date).getTime();let j,L;if(i=i||\"\",(/^application\\/octet-stream/i.test(s)||u[\"Content-Disposition\"]&&/attachment/i.test(u[\"Content-Disposition\"])||u[\"content-disposition\"]&&/attachment/i.test(u[\"content-disposition\"])||u[\"Content-Description\"]&&/File Transfer/i.test(u[\"Content-Description\"])||u[\"content-description\"]&&/File Transfer/i.test(u[\"content-description\"]))&&(o.size>0||o.length>0))if(\"Blob\"in window){let _=s||\"text/html\",w=o instanceof Blob?o:new Blob([o],{type:_}),x=window.URL.createObjectURL(w),C=[_,i.substr(i.lastIndexOf(\"/\")+1),x].join(\":\"),j=u[\"content-disposition\"]||u[\"Content-Disposition\"];if(void 0!==j){let o=function extractFileNameFromContentDispositionHeader(o){let s;if([/filename\\*=[^']+'\\w*'\"([^\"]+)\";?/i,/filename\\*=[^']+'\\w*'([^;]+);?/i,/filename=\"([^;]*);?\"/i,/filename=([^;]*);?/i].some((i=>(s=i.exec(o),null!==s))),null!==s&&s.length>1)try{return decodeURIComponent(s[1])}catch(o){console.error(o)}return null}(j);null!==o&&(C=o)}L=at.navigator&&at.navigator.msSaveOrOpenBlob?Pe.createElement(\"div\",null,Pe.createElement(\"a\",{href:x,onClick:()=>at.navigator.msSaveOrOpenBlob(w,C)},\"Download file\")):Pe.createElement(\"div\",null,Pe.createElement(\"a\",{href:x,download:C},\"Download file\"))}else L=Pe.createElement(\"pre\",{className:\"microlight\"},\"Download headers detected but your browser does not support downloading binary via XHR (Blob).\");else if(/json/i.test(s)){let s=null;getKnownSyntaxHighlighterLanguage(o)&&(s=\"json\");try{j=JSON.stringify(JSON.parse(o),null,\"  \")}catch(s){j=\"can't parse JSON.  Raw result:\\n\\n\"+o}L=Pe.createElement(x,{language:s,downloadable:!0,fileName:`${C}.json`,canCopy:!0},j)}else/xml/i.test(s)?(j=OO()(o,{textNodesOnSameLine:!0,indentor:\"  \"}),L=Pe.createElement(x,{downloadable:!0,fileName:`${C}.xml`,canCopy:!0},j)):L=\"text/html\"===AO()(s)||/text\\/plain/.test(s)?Pe.createElement(x,{downloadable:!0,fileName:`${C}.html`,canCopy:!0},o):\"text/csv\"===AO()(s)||/text\\/csv/.test(s)?Pe.createElement(x,{downloadable:!0,fileName:`${C}.csv`,canCopy:!0},o):/^image\\//i.test(s)?s.includes(\"svg\")?Pe.createElement(\"div\",null,\" \",o,\" \"):Pe.createElement(\"img\",{src:window.URL.createObjectURL(o)}):/^audio\\//i.test(s)?Pe.createElement(\"pre\",{className:\"microlight\"},Pe.createElement(\"audio\",{controls:!0,key:i},Pe.createElement(\"source\",{src:i,type:s}))):\"string\"==typeof o?Pe.createElement(x,{downloadable:!0,fileName:`${C}.txt`,canCopy:!0},o):o.size>0?w?Pe.createElement(\"div\",null,Pe.createElement(\"p\",{className:\"i\"},\"Unrecognized response type; displaying content as text.\"),Pe.createElement(x,{downloadable:!0,fileName:`${C}.txt`,canCopy:!0},w)):Pe.createElement(\"p\",{className:\"i\"},\"Unrecognized response type; unable to display.\"):null;return L?Pe.createElement(\"div\",null,Pe.createElement(\"h5\",null,\"Response body\"),L):null}}class Parameters extends Pe.Component{constructor(o){super(o),this.state={callbackVisible:!1,parametersVisible:!0}}static defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]};onChange=(o,s,i)=>{let{specActions:{changeParamByIdentity:u},onChangeKey:_}=this.props;u(_,o,s,i)};onChangeConsumesWrapper=o=>{let{specActions:{changeConsumesValue:s},onChangeKey:i}=this.props;s(i,o)};toggleTab=o=>\"parameters\"===o?this.setState({parametersVisible:!0,callbackVisible:!1}):\"callbacks\"===o?this.setState({callbackVisible:!0,parametersVisible:!1}):void 0;onChangeMediaType=({value:o,pathMethod:s})=>{let{specActions:i,oas3Selectors:u,oas3Actions:_}=this.props;const w=u.hasUserEditedBody(...s),x=u.shouldRetainRequestBodyValue(...s);_.setRequestContentType({value:o,pathMethod:s}),_.initRequestBodyValidateError({pathMethod:s}),w||(x||_.setRequestBodyValue({value:void 0,pathMethod:s}),i.clearResponse(...s),i.clearRequest(...s),i.clearValidateParams(s))};render(){let{onTryoutClick:o,onResetClick:s,parameters:i,allowTryItOut:u,tryItOutEnabled:_,specPath:w,fn:x,getComponent:C,getConfigs:j,specSelectors:L,specActions:B,pathMethod:$,oas3Actions:V,oas3Selectors:U,operation:z}=this.props;const Y=C(\"parameterRow\"),Z=C(\"TryItOutButton\"),ee=C(\"contentType\"),ie=C(\"Callbacks\",!0),ae=C(\"RequestBody\",!0),ce=_&&u,le=L.isOAS3(),pe=`${createHtmlReadyId(`${$[1]}${$[0]}_requests`)}_select`,de=z.get(\"requestBody\"),fe=Object.values(i.reduce(((o,s)=>{const i=s.get(\"in\");return o[i]??=[],o[i].push(s),o}),{})).reduce(((o,s)=>o.concat(s)),[]);return Pe.createElement(\"div\",{className:\"opblock-section\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},le?Pe.createElement(\"div\",{className:\"tab-header\"},Pe.createElement(\"div\",{onClick:()=>this.toggleTab(\"parameters\"),className:`tab-item ${this.state.parametersVisible&&\"active\"}`},Pe.createElement(\"h4\",{className:\"opblock-title\"},Pe.createElement(\"span\",null,\"Parameters\"))),z.get(\"callbacks\")?Pe.createElement(\"div\",{onClick:()=>this.toggleTab(\"callbacks\"),className:`tab-item ${this.state.callbackVisible&&\"active\"}`},Pe.createElement(\"h4\",{className:\"opblock-title\"},Pe.createElement(\"span\",null,\"Callbacks\"))):null):Pe.createElement(\"div\",{className:\"tab-header\"},Pe.createElement(\"h4\",{className:\"opblock-title\"},\"Parameters\")),u?Pe.createElement(Z,{isOAS3:L.isOAS3(),hasUserEditedBody:U.hasUserEditedBody(...$),enabled:_,onCancelClick:this.props.onCancelClick,onTryoutClick:o,onResetClick:()=>s($)}):null),this.state.parametersVisible?Pe.createElement(\"div\",{className:\"parameters-container\"},fe.length?Pe.createElement(\"div\",{className:\"table-container\"},Pe.createElement(\"table\",{className:\"parameters\"},Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",null,Pe.createElement(\"th\",{className:\"col_header parameters-col_name\"},\"Name\"),Pe.createElement(\"th\",{className:\"col_header parameters-col_description\"},\"Description\"))),Pe.createElement(\"tbody\",null,fe.map(((o,s)=>Pe.createElement(Y,{fn:x,specPath:w.push(s.toString()),getComponent:C,getConfigs:j,rawParam:o,param:L.parameterWithMetaByIdentity($,o),key:`${o.get(\"in\")}.${o.get(\"name\")}`,onChange:this.onChange,onChangeConsumes:this.onChangeConsumesWrapper,specSelectors:L,specActions:B,oas3Actions:V,oas3Selectors:U,pathMethod:$,isExecute:ce})))))):Pe.createElement(\"div\",{className:\"opblock-description-wrapper\"},Pe.createElement(\"p\",null,\"No parameters\"))):null,this.state.callbackVisible?Pe.createElement(\"div\",{className:\"callbacks-container opblock-description-wrapper\"},Pe.createElement(ie,{callbacks:(0,qe.Map)(z.get(\"callbacks\")),specPath:w.slice(0,-1).push(\"callbacks\")})):null,le&&de&&this.state.parametersVisible&&Pe.createElement(\"div\",{className:\"opblock-section opblock-section-request-body\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},Pe.createElement(\"h4\",{className:`opblock-title parameter__name ${de.get(\"required\")&&\"required\"}`},\"Request body\"),Pe.createElement(\"label\",{id:pe},Pe.createElement(ee,{value:U.requestContentType(...$),contentTypes:de.get(\"content\",(0,qe.List)()).keySeq(),onChange:o=>{this.onChangeMediaType({value:o,pathMethod:$})},className:\"body-param-content-type\",ariaLabel:\"Request content type\",controlId:pe}))),Pe.createElement(\"div\",{className:\"opblock-description-wrapper\"},Pe.createElement(ae,{setRetainRequestBodyValueFlag:o=>V.setRetainRequestBodyValueFlag({value:o,pathMethod:$}),userHasEditedBody:U.hasUserEditedBody(...$),specPath:w.slice(0,-1).push(\"requestBody\"),requestBody:de,requestBodyValue:U.requestBodyValue(...$),requestBodyInclusionSetting:U.requestBodyInclusionSetting(...$),requestBodyErrors:U.requestBodyErrors(...$),isExecute:ce,getConfigs:j,activeExamplesKey:U.activeExamplesMember(...$,\"requestBody\",\"requestBody\"),updateActiveExamplesKey:o=>{this.props.oas3Actions.setActiveExamplesMember({name:o,pathMethod:this.props.pathMethod,contextType:\"requestBody\",contextName:\"requestBody\"})},onChange:(o,s)=>{if(s){const i=U.requestBodyValue(...$),u=qe.Map.isMap(i)?i:(0,qe.Map)();return V.setRequestBodyValue({pathMethod:$,value:u.setIn(s,o)})}V.setRequestBodyValue({value:o,pathMethod:$})},onChangeIncludeEmpty:(o,s)=>{V.setRequestBodyInclusion({pathMethod:$,value:s,name:o})},contentType:U.requestContentType(...$)}))))}}const parameter_extension=({xKey:o,xVal:s})=>Pe.createElement(\"div\",{className:\"parameter__extension\"},o,\": \",String(s)),jO={onChange:()=>{},isIncludedOptions:{}};class ParameterIncludeEmpty extends Pe.Component{static defaultProps=jO;componentDidMount(){const{isIncludedOptions:o,onChange:s}=this.props,{shouldDispatchInit:i,defaultValue:u}=o;i&&s(u)}onCheckboxChange=o=>{const{onChange:s}=this.props;s(o.target.checked)};render(){let{isIncluded:o,isDisabled:s}=this.props;return Pe.createElement(\"div\",null,Pe.createElement(\"label\",{htmlFor:\"include_empty_value\",className:To()(\"parameter__empty_value_toggle\",{disabled:s})},Pe.createElement(\"input\",{id:\"include_empty_value\",type:\"checkbox\",disabled:s,checked:!s&&o,onChange:this.onCheckboxChange}),\"Send empty value\"))}}class ParameterRow extends Pe.Component{constructor(o,s){super(o,s),this.setDefaultValue()}UNSAFE_componentWillReceiveProps(o){let s,{specSelectors:i,pathMethod:u,rawParam:_}=o,w=i.isOAS3(),x=i.parameterWithMetaByIdentity(u,_)||new qe.Map;if(x=x.isEmpty()?_:x,w){let{schema:o}=getParameterSchema(x,{isOAS3:w});s=o?o.get(\"enum\"):void 0}else s=x?x.get(\"enum\"):void 0;let C,j=x?x.get(\"value\"):void 0;void 0!==j?C=j:_.get(\"required\")&&s&&s.size&&(C=s.first()),void 0!==C&&C!==j&&this.onChangeWrapper(function numberToString(o){return\"number\"==typeof o?o.toString():o}(C)),this.setDefaultValue()}onChangeWrapper=(o,s=!1)=>{let i,{onChange:u,rawParam:_}=this.props;return i=\"\"===o||o&&0===o.size?null:o,u(_,i,s)};_onExampleSelect=o=>{this.props.oas3Actions.setActiveExamplesMember({name:o,pathMethod:this.props.pathMethod,contextType:\"parameters\",contextName:this.getParamKey()})};onChangeIncludeEmpty=o=>{let{specActions:s,param:i,pathMethod:u}=this.props;const _=i.get(\"name\"),w=i.get(\"in\");return s.updateEmptyParamInclusion(u,_,w,o)};setDefaultValue=()=>{let{specSelectors:o,pathMethod:s,rawParam:i,oas3Selectors:u,fn:_}=this.props;const w=o.parameterWithMetaByIdentity(s,i)||(0,qe.Map)();let{schema:x}=getParameterSchema(w,{isOAS3:o.isOAS3()});const C=w.get(\"content\",(0,qe.Map)()).keySeq().first(),j=x?_.getSampleSchema(x.toJS(),C,{includeWriteOnly:!0}):null;if(w&&void 0===w.get(\"value\")&&\"body\"!==w.get(\"in\")){let i;if(o.isSwagger2())i=void 0!==w.get(\"x-example\")?w.get(\"x-example\"):void 0!==w.getIn([\"schema\",\"example\"])?w.getIn([\"schema\",\"example\"]):x&&x.getIn([\"default\"]);else if(o.isOAS3()){x=this.composeJsonSchema(x);const o=u.activeExamplesMember(...s,\"parameters\",this.getParamKey());i=void 0!==w.getIn([\"examples\",o,\"value\"])?w.getIn([\"examples\",o,\"value\"]):void 0!==w.getIn([\"content\",C,\"example\"])?w.getIn([\"content\",C,\"example\"]):void 0!==w.get(\"example\")?w.get(\"example\"):void 0!==(x&&x.get(\"example\"))?x&&x.get(\"example\"):void 0!==(x&&x.get(\"default\"))?x&&x.get(\"default\"):w.get(\"default\")}void 0===i||qe.List.isList(i)||(i=stringify(i)),void 0!==i?this.onChangeWrapper(i):x&&\"object\"===x.get(\"type\")&&j&&!w.get(\"examples\")&&this.onChangeWrapper(qe.List.isList(j)?j:stringify(j))}};getParamKey(){const{param:o}=this.props;return o?`${o.get(\"name\")}-${o.get(\"in\")}`:null}composeJsonSchema(o){const{fn:s}=this.props,i=o.get(\"oneOf\")?.get(0)?.toJS(),u=o.get(\"anyOf\")?.get(0)?.toJS();return(0,qe.fromJS)(s.mergeJsonSchema(o.toJS(),i??u??{}))}render(){let{param:o,rawParam:s,getComponent:i,getConfigs:u,isExecute:_,fn:w,onChangeConsumes:x,specSelectors:C,pathMethod:j,specPath:L,oas3Selectors:B}=this.props,$=C.isOAS3();const{showExtensions:V,showCommonExtensions:U}=u();if(o||(o=s),!s)return null;const z=i(\"JsonSchemaForm\"),Y=i(\"ParamBody\");let Z=o.get(\"in\"),ee=\"body\"!==Z?null:Pe.createElement(Y,{getComponent:i,getConfigs:u,fn:w,param:o,consumes:C.consumesOptionsFor(j),consumesValue:C.contentTypeValues(j).get(\"requestContentType\"),onChange:this.onChangeWrapper,onChangeConsumes:x,isExecute:_,specSelectors:C,pathMethod:j});const ie=i(\"modelExample\"),ae=i(\"Markdown\",!0),ce=i(\"ParameterExt\"),le=i(\"ParameterIncludeEmpty\"),pe=i(\"ExamplesSelectValueRetainer\"),de=i(\"Example\");let{schema:fe}=getParameterSchema(o,{isOAS3:$}),ye=C.parameterWithMetaByIdentity(j,s)||(0,qe.Map)();$&&(fe=this.composeJsonSchema(fe));let be,_e,we,Se,xe=fe?fe.get(\"format\"):null,Te=fe?fe.get(\"type\"):null,Re=fe?fe.getIn([\"items\",\"type\"]):null,$e=\"formData\"===Z,ze=\"FormData\"in at,We=o.get(\"required\"),He=ye?ye.get(\"value\"):\"\",Ye=U?getCommonExtensions(fe):null,Xe=V?getExtensions(o):null,Qe=!1;return void 0!==o&&fe&&(be=fe.get(\"items\")),void 0!==be?(_e=be.get(\"enum\"),we=be.get(\"default\")):fe&&(_e=fe.get(\"enum\")),_e&&_e.size&&_e.size>0&&(Qe=!0),void 0!==o&&(fe&&(we=fe.get(\"default\")),void 0===we&&(we=o.get(\"default\")),Se=o.get(\"example\"),void 0===Se&&(Se=o.get(\"x-example\"))),Pe.createElement(\"tr\",{\"data-param-name\":o.get(\"name\"),\"data-param-in\":o.get(\"in\")},Pe.createElement(\"td\",{className:\"parameters-col_name\"},Pe.createElement(\"div\",{className:We?\"parameter__name required\":\"parameter__name\"},o.get(\"name\"),We?Pe.createElement(\"span\",null,\" *\"):null),Pe.createElement(\"div\",{className:\"parameter__type\"},Te,Re&&`[${Re}]`,xe&&Pe.createElement(\"span\",{className:\"prop-format\"},\"($\",xe,\")\")),Pe.createElement(\"div\",{className:\"parameter__deprecated\"},$&&o.get(\"deprecated\")?\"deprecated\":null),Pe.createElement(\"div\",{className:\"parameter__in\"},\"(\",o.get(\"in\"),\")\")),Pe.createElement(\"td\",{className:\"parameters-col_description\"},o.get(\"description\")?Pe.createElement(ae,{source:o.get(\"description\")}):null,!ee&&_||!Qe?null:Pe.createElement(ae,{className:\"parameter__enum\",source:\"<i>Available values</i> : \"+_e.map((function(o){return o})).toArray().map(String).join(\", \")}),!ee&&_||void 0===we?null:Pe.createElement(ae,{className:\"parameter__default\",source:\"<i>Default value</i> : \"+we}),!ee&&_||void 0===Se?null:Pe.createElement(ae,{source:\"<i>Example</i> : \"+Se}),$e&&!ze&&Pe.createElement(\"div\",null,\"Error: your browser does not support FormData\"),$&&o.get(\"examples\")?Pe.createElement(\"section\",{className:\"parameter-controls\"},Pe.createElement(pe,{examples:o.get(\"examples\"),onSelect:this._onExampleSelect,updateValue:this.onChangeWrapper,getComponent:i,defaultToFirstExample:!0,currentKey:B.activeExamplesMember(...j,\"parameters\",this.getParamKey()),currentUserInputValue:He})):null,ee?null:Pe.createElement(z,{fn:w,getComponent:i,value:He,required:We,disabled:!_,description:o.get(\"name\"),onChange:this.onChangeWrapper,errors:ye.get(\"errors\"),schema:fe}),ee&&fe?Pe.createElement(ie,{getComponent:i,specPath:L.push(\"schema\"),getConfigs:u,isExecute:_,specSelectors:C,schema:fe,example:ee,includeWriteOnly:!0}):null,!ee&&_&&o.get(\"allowEmptyValue\")?Pe.createElement(le,{onChange:this.onChangeIncludeEmpty,isIncluded:C.parameterInclusionSettingFor(j,o.get(\"name\"),o.get(\"in\")),isDisabled:!isEmptyValue(He)}):null,$&&o.get(\"examples\")?Pe.createElement(de,{example:o.getIn([\"examples\",B.activeExamplesMember(...j,\"parameters\",this.getParamKey())]),getComponent:i,getConfigs:u}):null,U&&Ye.size?Ye.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,xKey:o,xVal:s}))):null,V&&Xe.size?Xe.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,xKey:o,xVal:s}))):null))}}class Execute extends Pe.Component{handleValidateParameters=()=>{let{specSelectors:o,specActions:s,path:i,method:u}=this.props;return s.validateParams([i,u]),o.validateBeforeExecute([i,u])};handleValidateRequestBody=()=>{let{path:o,method:s,specSelectors:i,oas3Selectors:u,oas3Actions:_}=this.props,w={missingBodyValue:!1,missingRequiredKeys:[]};_.clearRequestBodyValidateError({path:o,method:s});let x=i.getOAS3RequiredRequestBodyContentType([o,s]),C=u.requestBodyValue(o,s),j=u.validateBeforeExecute([o,s]),L=u.requestContentType(o,s);if(!j)return w.missingBodyValue=!0,_.setRequestBodyValidateError({path:o,method:s,validationErrors:w}),!1;if(!x)return!0;let B=u.validateShallowRequired({oas3RequiredRequestBodyContentType:x,oas3RequestContentType:L,oas3RequestBodyValue:C});return!B||B.length<1||(B.forEach((o=>{w.missingRequiredKeys.push(o)})),_.setRequestBodyValidateError({path:o,method:s,validationErrors:w}),!1)};handleValidationResultPass=()=>{let{specActions:o,operation:s,path:i,method:u}=this.props;this.props.onExecute&&this.props.onExecute(),o.execute({operation:s,path:i,method:u})};handleValidationResultFail=()=>{let{specActions:o,path:s,method:i}=this.props;o.clearValidateParams([s,i]),setTimeout((()=>{o.validateParams([s,i])}),40)};handleValidationResult=o=>{o?this.handleValidationResultPass():this.handleValidationResultFail()};onClick=()=>{let o=this.handleValidateParameters(),s=this.handleValidateRequestBody(),i=o&&s;this.handleValidationResult(i)};onChangeProducesWrapper=o=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],o);render(){const{disabled:o}=this.props;return Pe.createElement(\"button\",{className:\"btn execute opblock-control__btn\",onClick:this.onClick,disabled:o},\"Execute\")}}class headers_Headers extends Pe.Component{render(){let{headers:o,getComponent:s}=this.props;const i=s(\"Property\"),u=s(\"Markdown\",!0);return o&&o.size?Pe.createElement(\"div\",{className:\"headers-wrapper\"},Pe.createElement(\"h4\",{className:\"headers__title\"},\"Headers:\"),Pe.createElement(\"table\",{className:\"headers\"},Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",{className:\"header-row\"},Pe.createElement(\"th\",{className:\"header-col\"},\"Name\"),Pe.createElement(\"th\",{className:\"header-col\"},\"Description\"),Pe.createElement(\"th\",{className:\"header-col\"},\"Type\"))),Pe.createElement(\"tbody\",null,o.entrySeq().map((([o,s])=>{if(!$e().Map.isMap(s))return null;const _=s.get(\"description\"),w=s.getIn([\"schema\"])?s.getIn([\"schema\",\"type\"]):s.getIn([\"type\"]),x=s.getIn([\"schema\",\"example\"]);return Pe.createElement(\"tr\",{key:o},Pe.createElement(\"td\",{className:\"header-col\"},o),Pe.createElement(\"td\",{className:\"header-col\"},_?Pe.createElement(u,{source:_}):null),Pe.createElement(\"td\",{className:\"header-col\"},w,\" \",x?Pe.createElement(i,{propKey:\"Example\",propVal:x,propClass:\"header-example\"}):null))})).toArray()))):null}}class Errors extends Pe.Component{render(){let{editorActions:o,errSelectors:s,layoutSelectors:i,layoutActions:u,getComponent:_}=this.props;const w=_(\"Collapse\");if(o&&o.jumpToLine)var x=o.jumpToLine;let C=s.allErrors().filter((o=>\"thrown\"===o.get(\"type\")||\"error\"===o.get(\"level\")));if(!C||C.count()<1)return null;let j=i.isShown([\"errorPane\"],!0),L=C.sortBy((o=>o.get(\"line\")));return Pe.createElement(\"pre\",{className:\"errors-wrapper\"},Pe.createElement(\"hgroup\",{className:\"error\"},Pe.createElement(\"h4\",{className:\"errors__title\"},\"Errors\"),Pe.createElement(\"button\",{className:\"btn errors__clear-btn\",onClick:()=>u.show([\"errorPane\"],!j)},j?\"Hide\":\"Show\")),Pe.createElement(w,{isOpened:j,animated:!0},Pe.createElement(\"div\",{className:\"errors\"},L.map(((o,s)=>{let i=o.get(\"type\");return\"thrown\"===i||\"auth\"===i?Pe.createElement(ThrownErrorItem,{key:s,error:o.get(\"error\")||o,jumpToLine:x}):\"spec\"===i?Pe.createElement(SpecErrorItem,{key:s,error:o,jumpToLine:x}):void 0})))))}}const ThrownErrorItem=({error:o,jumpToLine:s})=>{if(!o)return null;let i=o.get(\"line\");return Pe.createElement(\"div\",{className:\"error-wrapper\"},o?Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,o.get(\"source\")&&o.get(\"level\")?toTitleCase(o.get(\"source\"))+\" \"+o.get(\"level\"):\"\",o.get(\"path\")?Pe.createElement(\"small\",null,\" at \",o.get(\"path\")):null),Pe.createElement(\"span\",{className:\"message thrown\"},o.get(\"message\")),Pe.createElement(\"div\",{className:\"error-line\"},i&&s?Pe.createElement(\"a\",{onClick:s.bind(null,i)},\"Jump to line \",i):null)):null)},SpecErrorItem=({error:o,jumpToLine:s=null})=>{let i=null;return o.get(\"path\")?i=qe.List.isList(o.get(\"path\"))?Pe.createElement(\"small\",null,\"at \",o.get(\"path\").join(\".\")):Pe.createElement(\"small\",null,\"at \",o.get(\"path\")):o.get(\"line\")&&!s&&(i=Pe.createElement(\"small\",null,\"on line \",o.get(\"line\"))),Pe.createElement(\"div\",{className:\"error-wrapper\"},o?Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,toTitleCase(o.get(\"source\"))+\" \"+o.get(\"level\"),\" \",i),Pe.createElement(\"span\",{className:\"message\"},o.get(\"message\")),Pe.createElement(\"div\",{className:\"error-line\"},s?Pe.createElement(\"a\",{onClick:s.bind(null,o.get(\"line\"))},\"Jump to line \",o.get(\"line\")):null)):null)};function toTitleCase(o){return(o||\"\").split(\" \").map((o=>o[0].toUpperCase()+o.slice(1))).join(\" \")}const content_type_noop=()=>{};class ContentType extends Pe.Component{static defaultProps={onChange:content_type_noop,value:null,contentTypes:(0,qe.fromJS)([\"application/json\"])};componentDidMount(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}UNSAFE_componentWillReceiveProps(o){o.contentTypes&&o.contentTypes.size&&(o.contentTypes.includes(o.value)||o.onChange(o.contentTypes.first()))}onChangeWrapper=o=>this.props.onChange(o.target.value);render(){let{ariaControls:o,ariaLabel:s,className:i,contentTypes:u,controlId:_,value:w}=this.props;return u&&u.size?Pe.createElement(\"div\",{className:\"content-type-wrapper \"+(i||\"\")},Pe.createElement(\"select\",{\"aria-controls\":o,\"aria-label\":s,className:\"content-type\",id:_,onChange:this.onChangeWrapper,value:w||\"\"},u.map((o=>Pe.createElement(\"option\",{key:o,value:o},o))).toArray())):null}}function xclass(...o){return o.filter((o=>!!o)).join(\" \").trim()}class Container extends Pe.Component{render(){let{fullscreen:o,full:s,...i}=this.props;if(o)return Pe.createElement(\"section\",i);let u=\"swagger-container\"+(s?\"-full\":\"\");return Pe.createElement(\"section\",wo()({},i,{className:xclass(i.className,u)}))}}const PO={mobile:\"\",tablet:\"-tablet\",desktop:\"-desktop\",large:\"-hd\"};class Col extends Pe.Component{render(){const{hide:o,keepContents:s,mobile:i,tablet:u,desktop:_,large:w,...x}=this.props;if(o&&!s)return Pe.createElement(\"span\",null);let C=[];for(let o in PO){if(!Object.prototype.hasOwnProperty.call(PO,o))continue;let s=PO[o];if(o in this.props){let i=this.props[o];if(i<1){C.push(\"none\"+s);continue}C.push(\"block\"+s),C.push(\"col-\"+i+s)}}o&&C.push(\"hidden\");let j=xclass(x.className,...C);return Pe.createElement(\"section\",wo()({},x,{className:j}))}}class Row extends Pe.Component{render(){return Pe.createElement(\"div\",wo()({},this.props,{className:xclass(this.props.className,\"wrapper\")}))}}class Button extends Pe.Component{static defaultProps={className:\"\"};render(){return Pe.createElement(\"button\",wo()({},this.props,{className:xclass(this.props.className,\"button\")}))}}const TextArea=o=>Pe.createElement(\"textarea\",o),Input=o=>Pe.createElement(\"input\",o);class Select extends Pe.Component{static defaultProps={multiple:!1,allowEmptyValue:!0};constructor(o,s){let i;super(o,s),i=o.value?o.value:o.multiple?[\"\"]:\"\",this.state={value:i}}onChange=o=>{let s,{onChange:i,multiple:u}=this.props,_=[].slice.call(o.target.options);s=u?_.filter((function(o){return o.selected})).map((function(o){return o.value})):o.target.value,this.setState({value:s}),i&&i(s)};UNSAFE_componentWillReceiveProps(o){o.value!==this.props.value&&this.setState({value:o.value})}render(){let{allowedValues:o,multiple:s,allowEmptyValue:i,disabled:u}=this.props,_=this.state.value?.toJS?.()||this.state.value;return Pe.createElement(\"select\",{className:this.props.className,multiple:s,value:_,onChange:this.onChange,disabled:u},i?Pe.createElement(\"option\",{value:\"\"},\"--\"):null,o.map((function(o,s){return Pe.createElement(\"option\",{key:s,value:String(o)},String(o))})))}}class layout_utils_Link extends Pe.Component{render(){return Pe.createElement(\"a\",wo()({},this.props,{rel:\"noopener noreferrer\",className:xclass(this.props.className,\"link\")}))}}const NoMargin=({children:o})=>Pe.createElement(\"div\",{className:\"no-margin\"},\" \",o,\" \");class Collapse extends Pe.Component{static defaultProps={isOpened:!1,animated:!1};renderNotAnimated(){return this.props.isOpened?Pe.createElement(NoMargin,null,this.props.children):Pe.createElement(\"noscript\",null)}render(){let{animated:o,isOpened:s,children:i}=this.props;return o?(i=s?i:null,Pe.createElement(NoMargin,null,i)):this.renderNotAnimated()}}class Overview extends Pe.Component{constructor(...o){super(...o),this.setTagShown=this._setTagShown.bind(this)}_setTagShown(o,s){this.props.layoutActions.show(o,s)}showOp(o,s){let{layoutActions:i}=this.props;i.show(o,s)}render(){let{specSelectors:o,layoutSelectors:s,layoutActions:i,getComponent:u}=this.props,_=o.taggedOperations();const w=u(\"Collapse\");return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",{className:\"overview-title\"},\"Overview\"),_.map(((o,u)=>{let _=o.get(\"operations\"),x=[\"overview-tags\",u],C=s.isShown(x,!0);return Pe.createElement(\"div\",{key:\"overview-\"+u},Pe.createElement(\"h4\",{onClick:()=>i.show(x,!C),className:\"link overview-tag\"},\" \",C?\"-\":\"+\",u),Pe.createElement(w,{isOpened:C,animated:!0},_.map((o=>{let{path:u,method:_,id:w}=o.toObject(),x=\"operations\",C=w,j=s.isShown([x,C]);return Pe.createElement(OperationLink,{key:w,path:u,method:_,id:u+\"-\"+_,shown:j,showOpId:C,showOpIdPrefix:x,href:`#operation-${C}`,onClick:i.show})})).toArray()))})).toArray(),_.size<1&&Pe.createElement(\"h3\",null,\" No operations defined in spec! \"))}}class OperationLink extends Pe.Component{constructor(o){super(o),this.onClick=this._onClick.bind(this)}_onClick(){let{showOpId:o,showOpIdPrefix:s,onClick:i,shown:u}=this.props;i([s,o],!u)}render(){let{id:o,method:s,shown:i,href:u}=this.props;return Pe.createElement(layout_utils_Link,{href:u,onClick:this.onClick,className:\"block opblock-link \"+(i?\"shown\":\"\")},Pe.createElement(\"div\",null,Pe.createElement(\"small\",{className:`bold-label-${s}`},s.toUpperCase()),Pe.createElement(\"span\",{className:\"bold-label\"},o)))}}class InitializedInput extends Pe.Component{componentDidMount(){this.props.initialValue&&(this.inputRef.value=this.props.initialValue)}render(){const{value:o,defaultValue:s,initialValue:i,...u}=this.props;return Pe.createElement(\"input\",wo()({},u,{ref:o=>this.inputRef=o}))}}class InfoBasePath extends Pe.Component{render(){const{host:o,basePath:s}=this.props;return Pe.createElement(\"pre\",{className:\"base-url\"},\"[ Base URL: \",o,s,\" ]\")}}class InfoUrl extends Pe.PureComponent{render(){const{url:o,getComponent:s}=this.props,i=s(\"Link\");return Pe.createElement(i,{target:\"_blank\",href:sanitizeUrl(o)},Pe.createElement(\"span\",{className:\"url\"},\" \",o))}}class info_Info extends Pe.Component{render(){const{info:o,url:s,host:i,basePath:u,getComponent:_,externalDocs:w,selectedServer:x,url:C}=this.props,j=o.get(\"version\"),L=o.get(\"description\"),B=o.get(\"title\"),$=safeBuildUrl(o.get(\"termsOfService\"),C,{selectedServer:x}),V=o.get(\"contact\"),U=o.get(\"license\"),z=safeBuildUrl(w&&w.get(\"url\"),C,{selectedServer:x}),Y=w&&w.get(\"description\"),Z=_(\"Markdown\",!0),ee=_(\"Link\"),ie=_(\"VersionStamp\"),ae=_(\"OpenAPIVersion\"),ce=_(\"InfoUrl\"),le=_(\"InfoBasePath\"),pe=_(\"License\"),de=_(\"Contact\");return Pe.createElement(\"div\",{className:\"info\"},Pe.createElement(\"hgroup\",{className:\"main\"},Pe.createElement(\"h2\",{className:\"title\"},B,Pe.createElement(\"span\",null,j&&Pe.createElement(ie,{version:j}),Pe.createElement(ae,{oasVersion:\"2.0\"}))),i||u?Pe.createElement(le,{host:i,basePath:u}):null,s&&Pe.createElement(ce,{getComponent:_,url:s})),Pe.createElement(\"div\",{className:\"description\"},Pe.createElement(Z,{source:L})),$&&Pe.createElement(\"div\",{className:\"info__tos\"},Pe.createElement(ee,{target:\"_blank\",href:sanitizeUrl($)},\"Terms of service\")),V?.size>0&&Pe.createElement(de,{getComponent:_,data:V,selectedServer:x,url:s}),U?.size>0&&Pe.createElement(pe,{getComponent:_,license:U,selectedServer:x,url:s}),z?Pe.createElement(ee,{className:\"info__extdocs\",target:\"_blank\",href:sanitizeUrl(z)},Y||z):null)}}const IO=info_Info;class InfoContainer extends Pe.Component{render(){const{specSelectors:o,getComponent:s,oas3Selectors:i}=this.props,u=o.info(),_=o.url(),w=o.basePath(),x=o.host(),C=o.externalDocs(),j=i.selectedServer(),L=s(\"info\");return Pe.createElement(\"div\",null,u&&u.count()?Pe.createElement(L,{info:u,url:_,host:x,basePath:w,externalDocs:C,getComponent:s,selectedServer:j}):null)}}class contact_Contact extends Pe.Component{render(){const{data:o,getComponent:s,selectedServer:i,url:u}=this.props,_=o.get(\"name\",\"the developer\"),w=safeBuildUrl(o.get(\"url\"),u,{selectedServer:i}),x=o.get(\"email\"),C=s(\"Link\");return Pe.createElement(\"div\",{className:\"info__contact\"},w&&Pe.createElement(\"div\",null,Pe.createElement(C,{href:sanitizeUrl(w),target:\"_blank\"},_,\" - Website\")),x&&Pe.createElement(C,{href:sanitizeUrl(`mailto:${x}`)},w?`Send email to ${_}`:`Contact ${_}`))}}const MO=contact_Contact;class license_License extends Pe.Component{render(){const{license:o,getComponent:s,selectedServer:i,url:u}=this.props,_=o.get(\"name\",\"License\"),w=safeBuildUrl(o.get(\"url\"),u,{selectedServer:i}),x=s(\"Link\");return Pe.createElement(\"div\",{className:\"info__license\"},w?Pe.createElement(\"div\",{className:\"info__license__url\"},Pe.createElement(x,{target:\"_blank\",href:sanitizeUrl(w)},_)):Pe.createElement(\"span\",null,_))}}const NO=license_License;class JumpToPath extends Pe.Component{render(){return null}}class CopyToClipboardBtn extends Pe.Component{render(){let{getComponent:o}=this.props;const s=o(\"CopyIcon\");return Pe.createElement(\"div\",{className:\"view-line-link copy-to-clipboard\",title:\"Copy to clipboard\"},Pe.createElement(Ro.CopyToClipboard,{text:this.props.textToCopy},Pe.createElement(s,null)))}}class Footer extends Pe.Component{render(){return Pe.createElement(\"div\",{className:\"footer\"})}}class FilterContainer extends Pe.Component{onFilterChange=o=>{const{target:{value:s}}=o;this.props.layoutActions.updateFilter(s)};render(){const{specSelectors:o,layoutSelectors:s,getComponent:i}=this.props,u=i(\"Col\"),_=\"loading\"===o.loadingStatus(),w=\"failed\"===o.loadingStatus(),x=s.currentFilter(),C=[\"operation-filter-input\"];return w&&C.push(\"failed\"),_&&C.push(\"loading\"),Pe.createElement(\"div\",null,!1===x?null:Pe.createElement(\"div\",{className:\"filter-container\"},Pe.createElement(u,{className:\"filter wrapper\",mobile:12},Pe.createElement(\"input\",{className:C.join(\" \"),placeholder:\"Filter by tag\",type:\"text\",onChange:this.onFilterChange,value:\"string\"==typeof x?x:\"\",disabled:_}))))}}const TO=Function.prototype;class ParamBody extends Pe.PureComponent{static defaultProp={consumes:(0,qe.fromJS)([\"application/json\"]),param:(0,qe.fromJS)({}),onChange:TO,onChangeConsumes:TO};constructor(o,s){super(o,s),this.state={isEditBox:!1,value:\"\"}}componentDidMount(){this.updateValues.call(this,this.props)}UNSAFE_componentWillReceiveProps(o){this.updateValues.call(this,o)}updateValues=o=>{let{param:s,isExecute:i,consumesValue:u=\"\"}=o,_=/xml/i.test(u),w=/json/i.test(u),x=_?s.get(\"value_xml\"):s.get(\"value\");if(void 0!==x){let o=!x&&w?\"{}\":x;this.setState({value:o}),this.onChange(o,{isXml:_,isEditBox:i})}else _?this.onChange(this.sample(\"xml\"),{isXml:_,isEditBox:i}):this.onChange(this.sample(),{isEditBox:i})};sample=o=>{let{param:s,fn:i}=this.props,u=i.inferSchema(s.toJS());return i.getSampleSchema(u,o,{includeWriteOnly:!0})};onChange=(o,{isEditBox:s,isXml:i})=>{this.setState({value:o,isEditBox:s}),this._onChange(o,i)};_onChange=(o,s)=>{(this.props.onChange||TO)(o,s)};handleOnChange=o=>{const{consumesValue:s}=this.props,i=/xml/i.test(s),u=o.target.value;this.onChange(u,{isXml:i,isEditBox:this.state.isEditBox})};toggleIsEditBox=()=>this.setState((o=>({isEditBox:!o.isEditBox})));render(){let{onChangeConsumes:o,param:s,isExecute:i,specSelectors:u,pathMethod:_,getComponent:w}=this.props;const x=w(\"Button\"),C=w(\"TextArea\"),j=w(\"HighlightCode\",!0),L=w(\"contentType\");let B=(u?u.parameterWithMetaByIdentity(_,s):s).get(\"errors\",(0,qe.List)()),$=u.contentTypeValues(_).get(\"requestContentType\"),V=this.props.consumes&&this.props.consumes.size?this.props.consumes:ParamBody.defaultProp.consumes,{value:U,isEditBox:z}=this.state,Y=null;getKnownSyntaxHighlighterLanguage(U)&&(Y=\"json\");const Z=`${createHtmlReadyId(`${_[1]}${_[0]}_parameters`)}_select`;return Pe.createElement(\"div\",{className:\"body-param\",\"data-param-name\":s.get(\"name\"),\"data-param-in\":s.get(\"in\")},z&&i?Pe.createElement(C,{className:\"body-param__text\"+(B.count()?\" invalid\":\"\"),value:U,onChange:this.handleOnChange}):U&&Pe.createElement(j,{className:\"body-param__example\",language:Y},U),Pe.createElement(\"div\",{className:\"body-param-options\"},i?Pe.createElement(\"div\",{className:\"body-param-edit\"},Pe.createElement(x,{className:z?\"btn cancel body-param__example-edit\":\"btn edit body-param__example-edit\",onClick:this.toggleIsEditBox},z?\"Cancel\":\"Edit\")):null,Pe.createElement(\"label\",{htmlFor:Z},Pe.createElement(\"span\",null,\"Parameter content type\"),Pe.createElement(L,{value:$,contentTypes:V,onChange:o,className:\"body-param-content-type\",ariaLabel:\"Parameter content type\",controlId:Z}))))}}class Curl extends Pe.Component{render(){const{request:o,getComponent:s}=this.props,i=requestSnippetGenerator_curl_bash(o),u=s(\"SyntaxHighlighter\",!0);return Pe.createElement(\"div\",{className:\"curl-command\"},Pe.createElement(\"h4\",null,\"Curl\"),Pe.createElement(\"div\",{className:\"copy-to-clipboard\"},Pe.createElement(Ro.CopyToClipboard,{text:i},Pe.createElement(\"button\",null))),Pe.createElement(\"div\",null,Pe.createElement(u,{language:\"bash\",className:\"curl microlight\",renderPlainText:({children:o,PlainTextViewer:s})=>Pe.createElement(s,{className:\"curl\"},o)},i)))}}const property=({propKey:o,propVal:s,propClass:i})=>Pe.createElement(\"span\",{className:i},Pe.createElement(\"br\",null),o,\": \",String(s));class TryItOutButton extends Pe.Component{static defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,onResetClick:Function.prototype,enabled:!1,hasUserEditedBody:!1,isOAS3:!1};render(){const{onTryoutClick:o,onCancelClick:s,onResetClick:i,enabled:u,hasUserEditedBody:_,isOAS3:w}=this.props,x=w&&_;return Pe.createElement(\"div\",{className:x?\"try-out btn-group\":\"try-out\"},u?Pe.createElement(\"button\",{className:\"btn try-out__btn cancel\",onClick:s},\"Cancel\"):Pe.createElement(\"button\",{className:\"btn try-out__btn\",onClick:o},\"Try it out \"),x&&Pe.createElement(\"button\",{className:\"btn try-out__btn reset\",onClick:i},\"Reset\"))}}class VersionPragmaFilter extends Pe.PureComponent{static defaultProps={alsoShow:null,children:null,bypass:!1};render(){const{bypass:o,isSwagger2:s,isOAS3:i,alsoShow:u}=this.props;return o?Pe.createElement(\"div\",null,this.props.children):s&&i?Pe.createElement(\"div\",{className:\"version-pragma\"},u,Pe.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--ambiguous\"},Pe.createElement(\"div\",null,Pe.createElement(\"h3\",null,\"Unable to render this definition\"),Pe.createElement(\"p\",null,Pe.createElement(\"code\",null,\"swagger\"),\" and \",Pe.createElement(\"code\",null,\"openapi\"),\" fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields.\"),Pe.createElement(\"p\",null,\"Supported version fields are \",Pe.createElement(\"code\",null,\"swagger: \",'\"2.0\"'),\" and those that match \",Pe.createElement(\"code\",null,\"openapi: 3.0.n\"),\" (for example, \",Pe.createElement(\"code\",null,\"openapi: 3.0.0\"),\").\")))):s||i?Pe.createElement(\"div\",null,this.props.children):Pe.createElement(\"div\",{className:\"version-pragma\"},u,Pe.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--missing\"},Pe.createElement(\"div\",null,Pe.createElement(\"h3\",null,\"Unable to render this definition\"),Pe.createElement(\"p\",null,\"The provided definition does not specify a valid version field.\"),Pe.createElement(\"p\",null,\"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are \",Pe.createElement(\"code\",null,\"swagger: \",'\"2.0\"'),\" and those that match \",Pe.createElement(\"code\",null,\"openapi: 3.0.n\"),\" (for example, \",Pe.createElement(\"code\",null,\"openapi: 3.0.0\"),\").\"))))}}const version_stamp=({version:o})=>Pe.createElement(\"small\",null,Pe.createElement(\"pre\",{className:\"version\"},\" \",o,\" \")),openapi_version=({oasVersion:o})=>Pe.createElement(\"small\",{className:\"version-stamp\"},Pe.createElement(\"pre\",{className:\"version\"},\"OAS \",o)),deep_link=({enabled:o,path:s,text:i})=>Pe.createElement(\"a\",{className:\"nostyle\",onClick:o?o=>o.preventDefault():null,href:o?`#/${s}`:null},Pe.createElement(\"span\",null,i)),svg_assets=()=>Pe.createElement(\"div\",null,Pe.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",xmlnsXlink:\"http://www.w3.org/1999/xlink\",className:\"svg-assets\"},Pe.createElement(\"defs\",null,Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"unlocked\"},Pe.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"locked\"},Pe.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"close\"},Pe.createElement(\"path\",{d:\"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow\"},Pe.createElement(\"path\",{d:\"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow-down\"},Pe.createElement(\"path\",{d:\"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow-up\"},Pe.createElement(\"path\",{d:\"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 24 24\",id:\"jump-to\"},Pe.createElement(\"path\",{d:\"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 24 24\",id:\"expand\"},Pe.createElement(\"path\",{d:\"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 15 16\",id:\"copy\"},Pe.createElement(\"g\",{transform:\"translate(2, -1)\"},Pe.createElement(\"path\",{fill:\"#ffffff\",fillRule:\"evenodd\",d:\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"}))))));var RO;function decodeEntity(o){return(RO=RO||document.createElement(\"textarea\")).innerHTML=\"&\"+o+\";\",RO.value}var DO=Object.prototype.hasOwnProperty;function index_browser_has(o,s){return!!o&&DO.call(o,s)}function index_browser_assign(o){return[].slice.call(arguments,1).forEach((function(s){if(s){if(\"object\"!=typeof s)throw new TypeError(s+\"must be object\");Object.keys(s).forEach((function(i){o[i]=s[i]}))}})),o}var LO=/\\\\([\\\\!\"#$%&'()*+,.\\/:;<=>?@[\\]^_`{|}~-])/g;function unescapeMd(o){return o.indexOf(\"\\\\\")<0?o:o.replace(LO,\"$1\")}function isValidEntityCode(o){return!(o>=55296&&o<=57343)&&(!(o>=64976&&o<=65007)&&(!!(65535&~o&&65534!=(65535&o))&&(!(o>=0&&o<=8)&&(11!==o&&(!(o>=14&&o<=31)&&(!(o>=127&&o<=159)&&!(o>1114111)))))))}function fromCodePoint(o){if(o>65535){var s=55296+((o-=65536)>>10),i=56320+(1023&o);return String.fromCharCode(s,i)}return String.fromCharCode(o)}var BO=/&([a-z#][a-z0-9]{1,31});/gi,FO=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function replaceEntityPattern(o,s){var i=0,u=decodeEntity(s);return s!==u?u:35===s.charCodeAt(0)&&FO.test(s)&&isValidEntityCode(i=\"x\"===s[1].toLowerCase()?parseInt(s.slice(2),16):parseInt(s.slice(1),10))?fromCodePoint(i):o}function replaceEntities(o){return o.indexOf(\"&\")<0?o:o.replace(BO,replaceEntityPattern)}var qO=/[&<>\"]/,$O=/[&<>\"]/g,VO={\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\"};function replaceUnsafeChar(o){return VO[o]}function escapeHtml(o){return qO.test(o)?o.replace($O,replaceUnsafeChar):o}var UO={};function nextToken(o,s){return++s>=o.length-2?s:\"paragraph_open\"===o[s].type&&o[s].tight&&\"inline\"===o[s+1].type&&0===o[s+1].content.length&&\"paragraph_close\"===o[s+2].type&&o[s+2].tight?nextToken(o,s+2):s}UO.blockquote_open=function(){return\"<blockquote>\\n\"},UO.blockquote_close=function(o,s){return\"</blockquote>\"+zO(o,s)},UO.code=function(o,s){return o[s].block?\"<pre><code>\"+escapeHtml(o[s].content)+\"</code></pre>\"+zO(o,s):\"<code>\"+escapeHtml(o[s].content)+\"</code>\"},UO.fence=function(o,s,i,u,_){var w,x,C=o[s],j=\"\",L=i.langPrefix;if(C.params){if(x=(w=C.params.split(/\\s+/g)).join(\" \"),index_browser_has(_.rules.fence_custom,w[0]))return _.rules.fence_custom[w[0]](o,s,i,u,_);j=' class=\"'+L+escapeHtml(replaceEntities(unescapeMd(x)))+'\"'}return\"<pre><code\"+j+\">\"+(i.highlight&&i.highlight.apply(i.highlight,[C.content].concat(w))||escapeHtml(C.content))+\"</code></pre>\"+zO(o,s)},UO.fence_custom={},UO.heading_open=function(o,s){return\"<h\"+o[s].hLevel+\">\"},UO.heading_close=function(o,s){return\"</h\"+o[s].hLevel+\">\\n\"},UO.hr=function(o,s,i){return(i.xhtmlOut?\"<hr />\":\"<hr>\")+zO(o,s)},UO.bullet_list_open=function(){return\"<ul>\\n\"},UO.bullet_list_close=function(o,s){return\"</ul>\"+zO(o,s)},UO.list_item_open=function(){return\"<li>\"},UO.list_item_close=function(){return\"</li>\\n\"},UO.ordered_list_open=function(o,s){var i=o[s];return\"<ol\"+(i.order>1?' start=\"'+i.order+'\"':\"\")+\">\\n\"},UO.ordered_list_close=function(o,s){return\"</ol>\"+zO(o,s)},UO.paragraph_open=function(o,s){return o[s].tight?\"\":\"<p>\"},UO.paragraph_close=function(o,s){var i=!(o[s].tight&&s&&\"inline\"===o[s-1].type&&!o[s-1].content);return(o[s].tight?\"\":\"</p>\")+(i?zO(o,s):\"\")},UO.link_open=function(o,s,i){var u=o[s].title?' title=\"'+escapeHtml(replaceEntities(o[s].title))+'\"':\"\",_=i.linkTarget?' target=\"'+i.linkTarget+'\"':\"\";return'<a href=\"'+escapeHtml(o[s].href)+'\"'+u+_+\">\"},UO.link_close=function(){return\"</a>\"},UO.image=function(o,s,i){var u=' src=\"'+escapeHtml(o[s].src)+'\"',_=o[s].title?' title=\"'+escapeHtml(replaceEntities(o[s].title))+'\"':\"\";return\"<img\"+u+(' alt=\"'+(o[s].alt?escapeHtml(replaceEntities(unescapeMd(o[s].alt))):\"\")+'\"')+_+(i.xhtmlOut?\" /\":\"\")+\">\"},UO.table_open=function(){return\"<table>\\n\"},UO.table_close=function(){return\"</table>\\n\"},UO.thead_open=function(){return\"<thead>\\n\"},UO.thead_close=function(){return\"</thead>\\n\"},UO.tbody_open=function(){return\"<tbody>\\n\"},UO.tbody_close=function(){return\"</tbody>\\n\"},UO.tr_open=function(){return\"<tr>\"},UO.tr_close=function(){return\"</tr>\\n\"},UO.th_open=function(o,s){var i=o[s];return\"<th\"+(i.align?' style=\"text-align:'+i.align+'\"':\"\")+\">\"},UO.th_close=function(){return\"</th>\"},UO.td_open=function(o,s){var i=o[s];return\"<td\"+(i.align?' style=\"text-align:'+i.align+'\"':\"\")+\">\"},UO.td_close=function(){return\"</td>\"},UO.strong_open=function(){return\"<strong>\"},UO.strong_close=function(){return\"</strong>\"},UO.em_open=function(){return\"<em>\"},UO.em_close=function(){return\"</em>\"},UO.del_open=function(){return\"<del>\"},UO.del_close=function(){return\"</del>\"},UO.ins_open=function(){return\"<ins>\"},UO.ins_close=function(){return\"</ins>\"},UO.mark_open=function(){return\"<mark>\"},UO.mark_close=function(){return\"</mark>\"},UO.sub=function(o,s){return\"<sub>\"+escapeHtml(o[s].content)+\"</sub>\"},UO.sup=function(o,s){return\"<sup>\"+escapeHtml(o[s].content)+\"</sup>\"},UO.hardbreak=function(o,s,i){return i.xhtmlOut?\"<br />\\n\":\"<br>\\n\"},UO.softbreak=function(o,s,i){return i.breaks?i.xhtmlOut?\"<br />\\n\":\"<br>\\n\":\"\\n\"},UO.text=function(o,s){return escapeHtml(o[s].content)},UO.htmlblock=function(o,s){return o[s].content},UO.htmltag=function(o,s){return o[s].content},UO.abbr_open=function(o,s){return'<abbr title=\"'+escapeHtml(replaceEntities(o[s].title))+'\">'},UO.abbr_close=function(){return\"</abbr>\"},UO.footnote_ref=function(o,s){var i=Number(o[s].id+1).toString(),u=\"fnref\"+i;return o[s].subId>0&&(u+=\":\"+o[s].subId),'<sup class=\"footnote-ref\"><a href=\"#fn'+i+'\" id=\"'+u+'\">['+i+\"]</a></sup>\"},UO.footnote_block_open=function(o,s,i){return(i.xhtmlOut?'<hr class=\"footnotes-sep\" />\\n':'<hr class=\"footnotes-sep\">\\n')+'<section class=\"footnotes\">\\n<ol class=\"footnotes-list\">\\n'},UO.footnote_block_close=function(){return\"</ol>\\n</section>\\n\"},UO.footnote_open=function(o,s){return'<li id=\"fn'+Number(o[s].id+1).toString()+'\"  class=\"footnote-item\">'},UO.footnote_close=function(){return\"</li>\\n\"},UO.footnote_anchor=function(o,s){var i=\"fnref\"+Number(o[s].id+1).toString();return o[s].subId>0&&(i+=\":\"+o[s].subId),' <a href=\"#'+i+'\" class=\"footnote-backref\">↩</a>'},UO.dl_open=function(){return\"<dl>\\n\"},UO.dt_open=function(){return\"<dt>\"},UO.dd_open=function(){return\"<dd>\"},UO.dl_close=function(){return\"</dl>\\n\"},UO.dt_close=function(){return\"</dt>\\n\"},UO.dd_close=function(){return\"</dd>\\n\"};var zO=UO.getBreak=function getBreak(o,s){return(s=nextToken(o,s))<o.length&&\"list_item_close\"===o[s].type?\"\":\"\\n\"};function Renderer(){this.rules=index_browser_assign({},UO),this.getBreak=UO.getBreak}function Ruler(){this.__rules__=[],this.__cache__=null}function StateInline(o,s,i,u,_){this.src=o,this.env=u,this.options=i,this.parser=s,this.tokens=_,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=\"\",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent=\"\",this.labelUnmatchedScopes=0}function parseLinkLabel(o,s){var i,u,_,w=-1,x=o.posMax,C=o.pos,j=o.isInLabel;if(o.isInLabel)return-1;if(o.labelUnmatchedScopes)return o.labelUnmatchedScopes--,-1;for(o.pos=s+1,o.isInLabel=!0,i=1;o.pos<x;){if(91===(_=o.src.charCodeAt(o.pos)))i++;else if(93===_&&0===--i){u=!0;break}o.parser.skipToken(o)}return u?(w=o.pos,o.labelUnmatchedScopes=0):o.labelUnmatchedScopes=i-1,o.pos=C,o.isInLabel=j,w}function parseAbbr(o,s,i,u){var _,w,x,C,j,L;if(42!==o.charCodeAt(0))return-1;if(91!==o.charCodeAt(1))return-1;if(-1===o.indexOf(\"]:\"))return-1;if((w=parseLinkLabel(_=new StateInline(o,s,i,u,[]),1))<0||58!==o.charCodeAt(w+1))return-1;for(C=_.posMax,x=w+2;x<C&&10!==_.src.charCodeAt(x);x++);return j=o.slice(2,w),0===(L=o.slice(w+2,x).trim()).length?-1:(u.abbreviations||(u.abbreviations={}),void 0===u.abbreviations[\":\"+j]&&(u.abbreviations[\":\"+j]=L),x)}function normalizeLink(o){var s=replaceEntities(o);try{s=decodeURI(s)}catch(o){}return encodeURI(s)}function parseLinkDestination(o,s){var i,u,_,w=s,x=o.posMax;if(60===o.src.charCodeAt(s)){for(s++;s<x;){if(10===(i=o.src.charCodeAt(s)))return!1;if(62===i)return _=normalizeLink(unescapeMd(o.src.slice(w+1,s))),!!o.parser.validateLink(_)&&(o.pos=s+1,o.linkContent=_,!0);92===i&&s+1<x?s+=2:s++}return!1}for(u=0;s<x&&32!==(i=o.src.charCodeAt(s))&&!(i<32||127===i);)if(92===i&&s+1<x)s+=2;else{if(40===i&&++u>1)break;if(41===i&&--u<0)break;s++}return w!==s&&(_=unescapeMd(o.src.slice(w,s)),!!o.parser.validateLink(_)&&(o.linkContent=_,o.pos=s,!0))}function parseLinkTitle(o,s){var i,u=s,_=o.posMax,w=o.src.charCodeAt(s);if(34!==w&&39!==w&&40!==w)return!1;for(s++,40===w&&(w=41);s<_;){if((i=o.src.charCodeAt(s))===w)return o.pos=s+1,o.linkContent=unescapeMd(o.src.slice(u+1,s)),!0;92===i&&s+1<_?s+=2:s++}return!1}function normalizeReference(o){return o.trim().replace(/\\s+/g,\" \").toUpperCase()}function parseReference(o,s,i,u){var _,w,x,C,j,L,B,$,V;if(91!==o.charCodeAt(0))return-1;if(-1===o.indexOf(\"]:\"))return-1;if((w=parseLinkLabel(_=new StateInline(o,s,i,u,[]),0))<0||58!==o.charCodeAt(w+1))return-1;for(C=_.posMax,x=w+2;x<C&&(32===(j=_.src.charCodeAt(x))||10===j);x++);if(!parseLinkDestination(_,x))return-1;for(B=_.linkContent,L=x=_.pos,x+=1;x<C&&(32===(j=_.src.charCodeAt(x))||10===j);x++);for(x<C&&L!==x&&parseLinkTitle(_,x)?($=_.linkContent,x=_.pos):($=\"\",x=L);x<C&&32===_.src.charCodeAt(x);)x++;return x<C&&10!==_.src.charCodeAt(x)?-1:(V=normalizeReference(o.slice(1,w)),void 0===u.references[V]&&(u.references[V]={title:$,href:B}),x)}Renderer.prototype.renderInline=function(o,s,i){for(var u=this.rules,_=o.length,w=0,x=\"\";_--;)x+=u[o[w].type](o,w++,s,i,this);return x},Renderer.prototype.render=function(o,s,i){for(var u=this.rules,_=o.length,w=-1,x=\"\";++w<_;)\"inline\"===o[w].type?x+=this.renderInline(o[w].children,s,i):x+=u[o[w].type](o,w,s,i,this);return x},Ruler.prototype.__find__=function(o){for(var s=this.__rules__.length,i=-1;s--;)if(this.__rules__[++i].name===o)return i;return-1},Ruler.prototype.__compile__=function(){var o=this,s=[\"\"];o.__rules__.forEach((function(o){o.enabled&&o.alt.forEach((function(o){s.indexOf(o)<0&&s.push(o)}))})),o.__cache__={},s.forEach((function(s){o.__cache__[s]=[],o.__rules__.forEach((function(i){i.enabled&&(s&&i.alt.indexOf(s)<0||o.__cache__[s].push(i.fn))}))}))},Ruler.prototype.at=function(o,s,i){var u=this.__find__(o),_=i||{};if(-1===u)throw new Error(\"Parser rule not found: \"+o);this.__rules__[u].fn=s,this.__rules__[u].alt=_.alt||[],this.__cache__=null},Ruler.prototype.before=function(o,s,i,u){var _=this.__find__(o),w=u||{};if(-1===_)throw new Error(\"Parser rule not found: \"+o);this.__rules__.splice(_,0,{name:s,enabled:!0,fn:i,alt:w.alt||[]}),this.__cache__=null},Ruler.prototype.after=function(o,s,i,u){var _=this.__find__(o),w=u||{};if(-1===_)throw new Error(\"Parser rule not found: \"+o);this.__rules__.splice(_+1,0,{name:s,enabled:!0,fn:i,alt:w.alt||[]}),this.__cache__=null},Ruler.prototype.push=function(o,s,i){var u=i||{};this.__rules__.push({name:o,enabled:!0,fn:s,alt:u.alt||[]}),this.__cache__=null},Ruler.prototype.enable=function(o,s){o=Array.isArray(o)?o:[o],s&&this.__rules__.forEach((function(o){o.enabled=!1})),o.forEach((function(o){var s=this.__find__(o);if(s<0)throw new Error(\"Rules manager: invalid rule name \"+o);this.__rules__[s].enabled=!0}),this),this.__cache__=null},Ruler.prototype.disable=function(o){(o=Array.isArray(o)?o:[o]).forEach((function(o){var s=this.__find__(o);if(s<0)throw new Error(\"Rules manager: invalid rule name \"+o);this.__rules__[s].enabled=!1}),this),this.__cache__=null},Ruler.prototype.getRules=function(o){return null===this.__cache__&&this.__compile__(),this.__cache__[o]||[]},StateInline.prototype.pushPending=function(){this.tokens.push({type:\"text\",content:this.pending,level:this.pendingLevel}),this.pending=\"\"},StateInline.prototype.push=function(o){this.pending&&this.pushPending(),this.tokens.push(o),this.pendingLevel=this.level},StateInline.prototype.cacheSet=function(o,s){for(var i=this.cache.length;i<=o;i++)this.cache.push(0);this.cache[o]=s},StateInline.prototype.cacheGet=function(o){return o<this.cache.length?this.cache[o]:0};var WO=\" \\n()[]'\\\".,!?-\";function regEscape(o){return o.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g,\"\\\\$1\")}var KO=/\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/,HO=/\\((c|tm|r|p)\\)/gi,JO={c:\"©\",r:\"®\",p:\"§\",tm:\"™\"};function replaceScopedAbbr(o){return o.indexOf(\"(\")<0?o:o.replace(HO,(function(o,s){return JO[s.toLowerCase()]}))}var GO=/['\"]/,YO=/['\"]/g,XO=/[-\\s()\\[\\]]/;function isLetter(o,s){return!(s<0||s>=o.length)&&!XO.test(o[s])}function replaceAt(o,s,i){return o.substr(0,s)+i+o.substr(s+1)}var QO=[[\"block\",function block(o){o.inlineMode?o.tokens.push({type:\"inline\",content:o.src.replace(/\\n/g,\" \").trim(),level:0,lines:[0,1],children:[]}):o.block.parse(o.src,o.options,o.env,o.tokens)}],[\"abbr\",function abbr(o){var s,i,u,_,w=o.tokens;if(!o.inlineMode)for(s=1,i=w.length-1;s<i;s++)if(\"paragraph_open\"===w[s-1].type&&\"inline\"===w[s].type&&\"paragraph_close\"===w[s+1].type){for(u=w[s].content;u.length&&!((_=parseAbbr(u,o.inline,o.options,o.env))<0);)u=u.slice(_).trim();w[s].content=u,u.length||(w[s-1].tight=!0,w[s+1].tight=!0)}}],[\"references\",function references(o){var s,i,u,_,w=o.tokens;if(o.env.references=o.env.references||{},!o.inlineMode)for(s=1,i=w.length-1;s<i;s++)if(\"inline\"===w[s].type&&\"paragraph_open\"===w[s-1].type&&\"paragraph_close\"===w[s+1].type){for(u=w[s].content;u.length&&!((_=parseReference(u,o.inline,o.options,o.env))<0);)u=u.slice(_).trim();w[s].content=u,u.length||(w[s-1].tight=!0,w[s+1].tight=!0)}}],[\"inline\",function inline(o){var s,i,u,_=o.tokens;for(i=0,u=_.length;i<u;i++)\"inline\"===(s=_[i]).type&&o.inline.parse(s.content,o.options,o.env,s.children)}],[\"footnote_tail\",function footnote_block(o){var s,i,u,_,w,x,C,j,L,B=0,$=!1,V={};if(o.env.footnotes&&(o.tokens=o.tokens.filter((function(o){return\"footnote_reference_open\"===o.type?($=!0,j=[],L=o.label,!1):\"footnote_reference_close\"===o.type?($=!1,V[\":\"+L]=j,!1):($&&j.push(o),!$)})),o.env.footnotes.list)){for(x=o.env.footnotes.list,o.tokens.push({type:\"footnote_block_open\",level:B++}),s=0,i=x.length;s<i;s++){for(o.tokens.push({type:\"footnote_open\",id:s,level:B++}),x[s].tokens?((C=[]).push({type:\"paragraph_open\",tight:!1,level:B++}),C.push({type:\"inline\",content:\"\",level:B,children:x[s].tokens}),C.push({type:\"paragraph_close\",tight:!1,level:--B})):x[s].label&&(C=V[\":\"+x[s].label]),o.tokens=o.tokens.concat(C),w=\"paragraph_close\"===o.tokens[o.tokens.length-1].type?o.tokens.pop():null,_=x[s].count>0?x[s].count:1,u=0;u<_;u++)o.tokens.push({type:\"footnote_anchor\",id:s,subId:u,level:B});w&&o.tokens.push(w),o.tokens.push({type:\"footnote_close\",level:--B})}o.tokens.push({type:\"footnote_block_close\",level:--B})}}],[\"abbr2\",function abbr2(o){var s,i,u,_,w,x,C,j,L,B,$,V,U=o.tokens;if(o.env.abbreviations)for(o.env.abbrRegExp||(V=\"(^|[\"+WO.split(\"\").map(regEscape).join(\"\")+\"])(\"+Object.keys(o.env.abbreviations).map((function(o){return o.substr(1)})).sort((function(o,s){return s.length-o.length})).map(regEscape).join(\"|\")+\")($|[\"+WO.split(\"\").map(regEscape).join(\"\")+\"])\",o.env.abbrRegExp=new RegExp(V,\"g\")),B=o.env.abbrRegExp,i=0,u=U.length;i<u;i++)if(\"inline\"===U[i].type)for(s=(_=U[i].children).length-1;s>=0;s--)if(\"text\"===(w=_[s]).type){for(j=0,x=w.content,B.lastIndex=0,L=w.level,C=[];$=B.exec(x);)B.lastIndex>j&&C.push({type:\"text\",content:x.slice(j,$.index+$[1].length),level:L}),C.push({type:\"abbr_open\",title:o.env.abbreviations[\":\"+$[2]],level:L++}),C.push({type:\"text\",content:$[2],level:L}),C.push({type:\"abbr_close\",level:--L}),j=B.lastIndex-$[3].length;C.length&&(j<x.length&&C.push({type:\"text\",content:x.slice(j),level:L}),U[i].children=_=[].concat(_.slice(0,s),C,_.slice(s+1)))}}],[\"replacements\",function index_browser_replace(o){var s,i,u,_,w;if(o.options.typographer)for(w=o.tokens.length-1;w>=0;w--)if(\"inline\"===o.tokens[w].type)for(s=(_=o.tokens[w].children).length-1;s>=0;s--)\"text\"===(i=_[s]).type&&(u=replaceScopedAbbr(u=i.content),KO.test(u)&&(u=u.replace(/\\+-/g,\"±\").replace(/\\.{2,}/g,\"…\").replace(/([?!])…/g,\"$1..\").replace(/([?!]){4,}/g,\"$1$1$1\").replace(/,{2,}/g,\",\").replace(/(^|[^-])---([^-]|$)/gm,\"$1—$2\").replace(/(^|\\s)--(\\s|$)/gm,\"$1–$2\").replace(/(^|[^-\\s])--([^-\\s]|$)/gm,\"$1–$2\")),i.content=u)}],[\"smartquotes\",function smartquotes(o){var s,i,u,_,w,x,C,j,L,B,$,V,U,z,Y,Z,ee;if(o.options.typographer)for(ee=[],Y=o.tokens.length-1;Y>=0;Y--)if(\"inline\"===o.tokens[Y].type)for(Z=o.tokens[Y].children,ee.length=0,s=0;s<Z.length;s++)if(\"text\"===(i=Z[s]).type&&!GO.test(i.text)){for(C=Z[s].level,U=ee.length-1;U>=0&&!(ee[U].level<=C);U--);ee.length=U+1,w=0,x=(u=i.content).length;e:for(;w<x&&(YO.lastIndex=w,_=YO.exec(u));)if(j=!isLetter(u,_.index-1),w=_.index+1,z=\"'\"===_[0],(L=!isLetter(u,w))||j){if($=!L,V=!j)for(U=ee.length-1;U>=0&&(B=ee[U],!(ee[U].level<C));U--)if(B.single===z&&ee[U].level===C){B=ee[U],z?(Z[B.token].content=replaceAt(Z[B.token].content,B.pos,o.options.quotes[2]),i.content=replaceAt(i.content,_.index,o.options.quotes[3])):(Z[B.token].content=replaceAt(Z[B.token].content,B.pos,o.options.quotes[0]),i.content=replaceAt(i.content,_.index,o.options.quotes[1])),ee.length=U;continue e}$?ee.push({token:s,pos:_.index,single:z,level:C}):V&&z&&(i.content=replaceAt(i.content,_.index,\"’\"))}else z&&(i.content=replaceAt(i.content,_.index,\"’\"))}}]];function Core(){this.options={},this.ruler=new Ruler;for(var o=0;o<QO.length;o++)this.ruler.push(QO[o][0],QO[o][1])}function StateBlock(o,s,i,u,_){var w,x,C,j,L,B,$;for(this.src=o,this.parser=s,this.options=i,this.env=u,this.tokens=_,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType=\"root\",this.ddIndent=-1,this.level=0,this.result=\"\",B=0,$=!1,C=j=B=0,L=(x=this.src).length;j<L;j++){if(w=x.charCodeAt(j),!$){if(32===w){B++;continue}$=!0}10!==w&&j!==L-1||(10!==w&&j++,this.bMarks.push(C),this.eMarks.push(j),this.tShift.push(B),$=!1,B=0,C=j+1)}this.bMarks.push(x.length),this.eMarks.push(x.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function skipBulletListMarker(o,s){var i,u,_;return(u=o.bMarks[s]+o.tShift[s])>=(_=o.eMarks[s])||42!==(i=o.src.charCodeAt(u++))&&45!==i&&43!==i||u<_&&32!==o.src.charCodeAt(u)?-1:u}function skipOrderedListMarker(o,s){var i,u=o.bMarks[s]+o.tShift[s],_=o.eMarks[s];if(u+1>=_)return-1;if((i=o.src.charCodeAt(u++))<48||i>57)return-1;for(;;){if(u>=_)return-1;if(!((i=o.src.charCodeAt(u++))>=48&&i<=57)){if(41===i||46===i)break;return-1}}return u<_&&32!==o.src.charCodeAt(u)?-1:u}Core.prototype.process=function(o){var s,i,u;for(s=0,i=(u=this.ruler.getRules(\"\")).length;s<i;s++)u[s](o)},StateBlock.prototype.isEmpty=function isEmpty(o){return this.bMarks[o]+this.tShift[o]>=this.eMarks[o]},StateBlock.prototype.skipEmptyLines=function skipEmptyLines(o){for(var s=this.lineMax;o<s&&!(this.bMarks[o]+this.tShift[o]<this.eMarks[o]);o++);return o},StateBlock.prototype.skipSpaces=function skipSpaces(o){for(var s=this.src.length;o<s&&32===this.src.charCodeAt(o);o++);return o},StateBlock.prototype.skipChars=function skipChars(o,s){for(var i=this.src.length;o<i&&this.src.charCodeAt(o)===s;o++);return o},StateBlock.prototype.skipCharsBack=function skipCharsBack(o,s,i){if(o<=i)return o;for(;o>i;)if(s!==this.src.charCodeAt(--o))return o+1;return o},StateBlock.prototype.getLines=function getLines(o,s,i,u){var _,w,x,C,j,L=o;if(o>=s)return\"\";if(L+1===s)return w=this.bMarks[L]+Math.min(this.tShift[L],i),x=u?this.eMarks[L]+1:this.eMarks[L],this.src.slice(w,x);for(C=new Array(s-o),_=0;L<s;L++,_++)(j=this.tShift[L])>i&&(j=i),j<0&&(j=0),w=this.bMarks[L]+j,x=L+1<s||u?this.eMarks[L]+1:this.eMarks[L],C[_]=this.src.slice(w,x);return C.join(\"\")};var ZO={};[\"article\",\"aside\",\"button\",\"blockquote\",\"body\",\"canvas\",\"caption\",\"col\",\"colgroup\",\"dd\",\"div\",\"dl\",\"dt\",\"embed\",\"fieldset\",\"figcaption\",\"figure\",\"footer\",\"form\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"header\",\"hgroup\",\"hr\",\"iframe\",\"li\",\"map\",\"object\",\"ol\",\"output\",\"p\",\"pre\",\"progress\",\"script\",\"section\",\"style\",\"table\",\"tbody\",\"td\",\"textarea\",\"tfoot\",\"th\",\"tr\",\"thead\",\"ul\",\"video\"].forEach((function(o){ZO[o]=!0}));var eC=/^<([a-zA-Z]{1,15})[\\s\\/>]/,tC=/^<\\/([a-zA-Z]{1,15})[\\s>]/;function index_browser_getLine(o,s){var i=o.bMarks[s]+o.blkIndent,u=o.eMarks[s];return o.src.substr(i,u-i)}function skipMarker(o,s){var i,u,_=o.bMarks[s]+o.tShift[s],w=o.eMarks[s];return _>=w||126!==(u=o.src.charCodeAt(_++))&&58!==u||_===(i=o.skipSpaces(_))||i>=w?-1:i}var rC=[[\"code\",function code(o,s,i){var u,_;if(o.tShift[s]-o.blkIndent<4)return!1;for(_=u=s+1;u<i;)if(o.isEmpty(u))u++;else{if(!(o.tShift[u]-o.blkIndent>=4))break;_=++u}return o.line=u,o.tokens.push({type:\"code\",content:o.getLines(s,_,4+o.blkIndent,!0),block:!0,lines:[s,o.line],level:o.level}),!0}],[\"fences\",function fences(o,s,i,u){var _,w,x,C,j,L=!1,B=o.bMarks[s]+o.tShift[s],$=o.eMarks[s];if(B+3>$)return!1;if(126!==(_=o.src.charCodeAt(B))&&96!==_)return!1;if(j=B,(w=(B=o.skipChars(B,_))-j)<3)return!1;if((x=o.src.slice(B,$).trim()).indexOf(\"`\")>=0)return!1;if(u)return!0;for(C=s;!(++C>=i)&&!((B=j=o.bMarks[C]+o.tShift[C])<($=o.eMarks[C])&&o.tShift[C]<o.blkIndent);)if(o.src.charCodeAt(B)===_&&!(o.tShift[C]-o.blkIndent>=4||(B=o.skipChars(B,_))-j<w||(B=o.skipSpaces(B))<$)){L=!0;break}return w=o.tShift[s],o.line=C+(L?1:0),o.tokens.push({type:\"fence\",params:x,content:o.getLines(s+1,C,w,!0),lines:[s,o.line],level:o.level}),!0},[\"paragraph\",\"blockquote\",\"list\"]],[\"blockquote\",function blockquote(o,s,i,u){var _,w,x,C,j,L,B,$,V,U,z,Y=o.bMarks[s]+o.tShift[s],Z=o.eMarks[s];if(Y>Z)return!1;if(62!==o.src.charCodeAt(Y++))return!1;if(o.level>=o.options.maxNesting)return!1;if(u)return!0;for(32===o.src.charCodeAt(Y)&&Y++,j=o.blkIndent,o.blkIndent=0,C=[o.bMarks[s]],o.bMarks[s]=Y,w=(Y=Y<Z?o.skipSpaces(Y):Y)>=Z,x=[o.tShift[s]],o.tShift[s]=Y-o.bMarks[s],$=o.parser.ruler.getRules(\"blockquote\"),_=s+1;_<i&&!((Y=o.bMarks[_]+o.tShift[_])>=(Z=o.eMarks[_]));_++)if(62!==o.src.charCodeAt(Y++)){if(w)break;for(z=!1,V=0,U=$.length;V<U;V++)if($[V](o,_,i,!0)){z=!0;break}if(z)break;C.push(o.bMarks[_]),x.push(o.tShift[_]),o.tShift[_]=-1337}else 32===o.src.charCodeAt(Y)&&Y++,C.push(o.bMarks[_]),o.bMarks[_]=Y,w=(Y=Y<Z?o.skipSpaces(Y):Y)>=Z,x.push(o.tShift[_]),o.tShift[_]=Y-o.bMarks[_];for(L=o.parentType,o.parentType=\"blockquote\",o.tokens.push({type:\"blockquote_open\",lines:B=[s,0],level:o.level++}),o.parser.tokenize(o,s,_),o.tokens.push({type:\"blockquote_close\",level:--o.level}),o.parentType=L,B[1]=o.line,V=0;V<x.length;V++)o.bMarks[V+s]=C[V],o.tShift[V+s]=x[V];return o.blkIndent=j,!0},[\"paragraph\",\"blockquote\",\"list\"]],[\"hr\",function hr(o,s,i,u){var _,w,x,C=o.bMarks[s],j=o.eMarks[s];if((C+=o.tShift[s])>j)return!1;if(42!==(_=o.src.charCodeAt(C++))&&45!==_&&95!==_)return!1;for(w=1;C<j;){if((x=o.src.charCodeAt(C++))!==_&&32!==x)return!1;x===_&&w++}return!(w<3)&&(u||(o.line=s+1,o.tokens.push({type:\"hr\",lines:[s,o.line],level:o.level})),!0)},[\"paragraph\",\"blockquote\",\"list\"]],[\"list\",function index_browser_list(o,s,i,u){var _,w,x,C,j,L,B,$,V,U,z,Y,Z,ee,ie,ae,ce,le,pe,de,fe,ye=!0;if(($=skipOrderedListMarker(o,s))>=0)Y=!0;else{if(!(($=skipBulletListMarker(o,s))>=0))return!1;Y=!1}if(o.level>=o.options.maxNesting)return!1;if(z=o.src.charCodeAt($-1),u)return!0;for(ee=o.tokens.length,Y?(B=o.bMarks[s]+o.tShift[s],U=Number(o.src.substr(B,$-B-1)),o.tokens.push({type:\"ordered_list_open\",order:U,lines:ae=[s,0],level:o.level++})):o.tokens.push({type:\"bullet_list_open\",lines:ae=[s,0],level:o.level++}),_=s,ie=!1,le=o.parser.ruler.getRules(\"list\");!(!(_<i)||((V=(Z=o.skipSpaces($))>=o.eMarks[_]?1:Z-$)>4&&(V=1),V<1&&(V=1),w=$-o.bMarks[_]+V,o.tokens.push({type:\"list_item_open\",lines:ce=[s,0],level:o.level++}),C=o.blkIndent,j=o.tight,x=o.tShift[s],L=o.parentType,o.tShift[s]=Z-o.bMarks[s],o.blkIndent=w,o.tight=!0,o.parentType=\"list\",o.parser.tokenize(o,s,i,!0),o.tight&&!ie||(ye=!1),ie=o.line-s>1&&o.isEmpty(o.line-1),o.blkIndent=C,o.tShift[s]=x,o.tight=j,o.parentType=L,o.tokens.push({type:\"list_item_close\",level:--o.level}),_=s=o.line,ce[1]=_,Z=o.bMarks[s],_>=i)||o.isEmpty(_)||o.tShift[_]<o.blkIndent);){for(fe=!1,pe=0,de=le.length;pe<de;pe++)if(le[pe](o,_,i,!0)){fe=!0;break}if(fe)break;if(Y){if(($=skipOrderedListMarker(o,_))<0)break}else if(($=skipBulletListMarker(o,_))<0)break;if(z!==o.src.charCodeAt($-1))break}return o.tokens.push({type:Y?\"ordered_list_close\":\"bullet_list_close\",level:--o.level}),ae[1]=_,o.line=_,ye&&function markTightParagraphs(o,s){var i,u,_=o.level+2;for(i=s+2,u=o.tokens.length-2;i<u;i++)o.tokens[i].level===_&&\"paragraph_open\"===o.tokens[i].type&&(o.tokens[i+2].tight=!0,o.tokens[i].tight=!0,i+=2)}(o,ee),!0},[\"paragraph\",\"blockquote\"]],[\"footnote\",function footnote(o,s,i,u){var _,w,x,C,j,L=o.bMarks[s]+o.tShift[s],B=o.eMarks[s];if(L+4>B)return!1;if(91!==o.src.charCodeAt(L))return!1;if(94!==o.src.charCodeAt(L+1))return!1;if(o.level>=o.options.maxNesting)return!1;for(C=L+2;C<B;C++){if(32===o.src.charCodeAt(C))return!1;if(93===o.src.charCodeAt(C))break}return C!==L+2&&(!(C+1>=B||58!==o.src.charCodeAt(++C))&&(u||(C++,o.env.footnotes||(o.env.footnotes={}),o.env.footnotes.refs||(o.env.footnotes.refs={}),j=o.src.slice(L+2,C-2),o.env.footnotes.refs[\":\"+j]=-1,o.tokens.push({type:\"footnote_reference_open\",label:j,level:o.level++}),_=o.bMarks[s],w=o.tShift[s],x=o.parentType,o.tShift[s]=o.skipSpaces(C)-C,o.bMarks[s]=C,o.blkIndent+=4,o.parentType=\"footnote\",o.tShift[s]<o.blkIndent&&(o.tShift[s]+=o.blkIndent,o.bMarks[s]-=o.blkIndent),o.parser.tokenize(o,s,i,!0),o.parentType=x,o.blkIndent-=4,o.tShift[s]=w,o.bMarks[s]=_,o.tokens.push({type:\"footnote_reference_close\",level:--o.level})),!0))},[\"paragraph\"]],[\"heading\",function heading(o,s,i,u){var _,w,x,C=o.bMarks[s]+o.tShift[s],j=o.eMarks[s];if(C>=j)return!1;if(35!==(_=o.src.charCodeAt(C))||C>=j)return!1;for(w=1,_=o.src.charCodeAt(++C);35===_&&C<j&&w<=6;)w++,_=o.src.charCodeAt(++C);return!(w>6||C<j&&32!==_)&&(u||(j=o.skipCharsBack(j,32,C),(x=o.skipCharsBack(j,35,C))>C&&32===o.src.charCodeAt(x-1)&&(j=x),o.line=s+1,o.tokens.push({type:\"heading_open\",hLevel:w,lines:[s,o.line],level:o.level}),C<j&&o.tokens.push({type:\"inline\",content:o.src.slice(C,j).trim(),level:o.level+1,lines:[s,o.line],children:[]}),o.tokens.push({type:\"heading_close\",hLevel:w,level:o.level})),!0)},[\"paragraph\",\"blockquote\"]],[\"lheading\",function lheading(o,s,i){var u,_,w,x=s+1;return!(x>=i)&&(!(o.tShift[x]<o.blkIndent)&&(!(o.tShift[x]-o.blkIndent>3)&&(!((_=o.bMarks[x]+o.tShift[x])>=(w=o.eMarks[x]))&&((45===(u=o.src.charCodeAt(_))||61===u)&&(_=o.skipChars(_,u),!((_=o.skipSpaces(_))<w)&&(_=o.bMarks[s]+o.tShift[s],o.line=x+1,o.tokens.push({type:\"heading_open\",hLevel:61===u?1:2,lines:[s,o.line],level:o.level}),o.tokens.push({type:\"inline\",content:o.src.slice(_,o.eMarks[s]).trim(),level:o.level+1,lines:[s,o.line-1],children:[]}),o.tokens.push({type:\"heading_close\",hLevel:61===u?1:2,level:o.level}),!0))))))}],[\"htmlblock\",function htmlblock(o,s,i,u){var _,w,x,C=o.bMarks[s],j=o.eMarks[s],L=o.tShift[s];if(C+=L,!o.options.html)return!1;if(L>3||C+2>=j)return!1;if(60!==o.src.charCodeAt(C))return!1;if(33===(_=o.src.charCodeAt(C+1))||63===_){if(u)return!0}else{if(47!==_&&!function isLetter$1(o){var s=32|o;return s>=97&&s<=122}(_))return!1;if(47===_){if(!(w=o.src.slice(C,j).match(tC)))return!1}else if(!(w=o.src.slice(C,j).match(eC)))return!1;if(!0!==ZO[w[1].toLowerCase()])return!1;if(u)return!0}for(x=s+1;x<o.lineMax&&!o.isEmpty(x);)x++;return o.line=x,o.tokens.push({type:\"htmlblock\",level:o.level,lines:[s,o.line],content:o.getLines(s,x,0,!0)}),!0},[\"paragraph\",\"blockquote\"]],[\"table\",function table(o,s,i,u){var _,w,x,C,j,L,B,$,V,U,z;if(s+2>i)return!1;if(j=s+1,o.tShift[j]<o.blkIndent)return!1;if((x=o.bMarks[j]+o.tShift[j])>=o.eMarks[j])return!1;if(124!==(_=o.src.charCodeAt(x))&&45!==_&&58!==_)return!1;if(w=index_browser_getLine(o,s+1),!/^[-:| ]+$/.test(w))return!1;if((L=w.split(\"|\"))<=2)return!1;for($=[],C=0;C<L.length;C++){if(!(V=L[C].trim())){if(0===C||C===L.length-1)continue;return!1}if(!/^:?-+:?$/.test(V))return!1;58===V.charCodeAt(V.length-1)?$.push(58===V.charCodeAt(0)?\"center\":\"right\"):58===V.charCodeAt(0)?$.push(\"left\"):$.push(\"\")}if(-1===(w=index_browser_getLine(o,s).trim()).indexOf(\"|\"))return!1;if(L=w.replace(/^\\||\\|$/g,\"\").split(\"|\"),$.length!==L.length)return!1;if(u)return!0;for(o.tokens.push({type:\"table_open\",lines:U=[s,0],level:o.level++}),o.tokens.push({type:\"thead_open\",lines:[s,s+1],level:o.level++}),o.tokens.push({type:\"tr_open\",lines:[s,s+1],level:o.level++}),C=0;C<L.length;C++)o.tokens.push({type:\"th_open\",align:$[C],lines:[s,s+1],level:o.level++}),o.tokens.push({type:\"inline\",content:L[C].trim(),lines:[s,s+1],level:o.level,children:[]}),o.tokens.push({type:\"th_close\",level:--o.level});for(o.tokens.push({type:\"tr_close\",level:--o.level}),o.tokens.push({type:\"thead_close\",level:--o.level}),o.tokens.push({type:\"tbody_open\",lines:z=[s+2,0],level:o.level++}),j=s+2;j<i&&!(o.tShift[j]<o.blkIndent)&&-1!==(w=index_browser_getLine(o,j).trim()).indexOf(\"|\");j++){for(L=w.replace(/^\\||\\|$/g,\"\").split(\"|\"),o.tokens.push({type:\"tr_open\",level:o.level++}),C=0;C<L.length;C++)o.tokens.push({type:\"td_open\",align:$[C],level:o.level++}),B=L[C].substring(124===L[C].charCodeAt(0)?1:0,124===L[C].charCodeAt(L[C].length-1)?L[C].length-1:L[C].length).trim(),o.tokens.push({type:\"inline\",content:B,level:o.level,children:[]}),o.tokens.push({type:\"td_close\",level:--o.level});o.tokens.push({type:\"tr_close\",level:--o.level})}return o.tokens.push({type:\"tbody_close\",level:--o.level}),o.tokens.push({type:\"table_close\",level:--o.level}),U[1]=z[1]=j,o.line=j,!0},[\"paragraph\"]],[\"deflist\",function deflist(o,s,i,u){var _,w,x,C,j,L,B,$,V,U,z,Y,Z,ee;if(u)return!(o.ddIndent<0)&&skipMarker(o,s)>=0;if(B=s+1,o.isEmpty(B)&&++B>i)return!1;if(o.tShift[B]<o.blkIndent)return!1;if((_=skipMarker(o,B))<0)return!1;if(o.level>=o.options.maxNesting)return!1;L=o.tokens.length,o.tokens.push({type:\"dl_open\",lines:j=[s,0],level:o.level++}),x=s,w=B;e:for(;;){for(ee=!0,Z=!1,o.tokens.push({type:\"dt_open\",lines:[x,x],level:o.level++}),o.tokens.push({type:\"inline\",content:o.getLines(x,x+1,o.blkIndent,!1).trim(),level:o.level+1,lines:[x,x],children:[]}),o.tokens.push({type:\"dt_close\",level:--o.level});;){if(o.tokens.push({type:\"dd_open\",lines:C=[B,0],level:o.level++}),Y=o.tight,V=o.ddIndent,$=o.blkIndent,z=o.tShift[w],U=o.parentType,o.blkIndent=o.ddIndent=o.tShift[w]+2,o.tShift[w]=_-o.bMarks[w],o.tight=!0,o.parentType=\"deflist\",o.parser.tokenize(o,w,i,!0),o.tight&&!Z||(ee=!1),Z=o.line-w>1&&o.isEmpty(o.line-1),o.tShift[w]=z,o.tight=Y,o.parentType=U,o.blkIndent=$,o.ddIndent=V,o.tokens.push({type:\"dd_close\",level:--o.level}),C[1]=B=o.line,B>=i)break e;if(o.tShift[B]<o.blkIndent)break e;if((_=skipMarker(o,B))<0)break;w=B}if(B>=i)break;if(x=B,o.isEmpty(x))break;if(o.tShift[x]<o.blkIndent)break;if((w=x+1)>=i)break;if(o.isEmpty(w)&&w++,w>=i)break;if(o.tShift[w]<o.blkIndent)break;if((_=skipMarker(o,w))<0)break}return o.tokens.push({type:\"dl_close\",level:--o.level}),j[1]=B,o.line=B,ee&&function markTightParagraphs$1(o,s){var i,u,_=o.level+2;for(i=s+2,u=o.tokens.length-2;i<u;i++)o.tokens[i].level===_&&\"paragraph_open\"===o.tokens[i].type&&(o.tokens[i+2].tight=!0,o.tokens[i].tight=!0,i+=2)}(o,L),!0},[\"paragraph\"]],[\"paragraph\",function paragraph(o,s){var i,u,_,w,x,C,j=s+1;if(j<(i=o.lineMax)&&!o.isEmpty(j))for(C=o.parser.ruler.getRules(\"paragraph\");j<i&&!o.isEmpty(j);j++)if(!(o.tShift[j]-o.blkIndent>3)){for(_=!1,w=0,x=C.length;w<x;w++)if(C[w](o,j,i,!0)){_=!0;break}if(_)break}return u=o.getLines(s,j,o.blkIndent,!1).trim(),o.line=j,u.length&&(o.tokens.push({type:\"paragraph_open\",tight:!1,lines:[s,o.line],level:o.level}),o.tokens.push({type:\"inline\",content:u,level:o.level+1,lines:[s,o.line],children:[]}),o.tokens.push({type:\"paragraph_close\",tight:!1,level:o.level})),!0}]];function ParserBlock(){this.ruler=new Ruler;for(var o=0;o<rC.length;o++)this.ruler.push(rC[o][0],rC[o][1],{alt:(rC[o][2]||[]).slice()})}ParserBlock.prototype.tokenize=function(o,s,i){for(var u,_=this.ruler.getRules(\"\"),w=_.length,x=s,C=!1;x<i&&(o.line=x=o.skipEmptyLines(x),!(x>=i))&&!(o.tShift[x]<o.blkIndent);){for(u=0;u<w&&!_[u](o,x,i,!1);u++);if(o.tight=!C,o.isEmpty(o.line-1)&&(C=!0),(x=o.line)<i&&o.isEmpty(x)){if(C=!0,++x<i&&\"list\"===o.parentType&&o.isEmpty(x))break;o.line=x}}};var nC=/[\\n\\t]/g,oC=/\\r[\\n\\u0085]|[\\u2424\\u2028\\u0085]/g,sC=/\\u00a0/g;function isTerminatorChar(o){switch(o){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}ParserBlock.prototype.parse=function(o,s,i,u){var _,w=0,x=0;if(!o)return[];(o=(o=o.replace(sC,\" \")).replace(oC,\"\\n\")).indexOf(\"\\t\")>=0&&(o=o.replace(nC,(function(s,i){var u;return 10===o.charCodeAt(i)?(w=i+1,x=0,s):(u=\"    \".slice((i-w-x)%4),x=i-w+1,u)}))),_=new StateBlock(o,this,s,i,u),this.tokenize(_,_.line,_.lineMax)};for(var iC=[],aC=0;aC<256;aC++)iC.push(0);function isAlphaNum(o){return o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122}function scanDelims(o,s){var i,u,_,w=s,x=!0,C=!0,j=o.posMax,L=o.src.charCodeAt(s);for(i=s>0?o.src.charCodeAt(s-1):-1;w<j&&o.src.charCodeAt(w)===L;)w++;return w>=j&&(x=!1),(_=w-s)>=4?x=C=!1:(32!==(u=w<j?o.src.charCodeAt(w):-1)&&10!==u||(x=!1),32!==i&&10!==i||(C=!1),95===L&&(isAlphaNum(i)&&(x=!1),isAlphaNum(u)&&(C=!1))),{can_open:x,can_close:C,delims:_}}\"\\\\!\\\"#$%&'()*+,./:;<=>?@[]^_`{|}~-\".split(\"\").forEach((function(o){iC[o.charCodeAt(0)]=1}));var cC=/\\\\([ \\\\!\"#$%&'()*+,.\\/:;<=>?@[\\]^_`{|}~-])/g;var lC=/\\\\([ \\\\!\"#$%&'()*+,.\\/:;<=>?@[\\]^_`{|}~-])/g;var uC=[\"coap\",\"doi\",\"javascript\",\"aaa\",\"aaas\",\"about\",\"acap\",\"cap\",\"cid\",\"crid\",\"data\",\"dav\",\"dict\",\"dns\",\"file\",\"ftp\",\"geo\",\"go\",\"gopher\",\"h323\",\"http\",\"https\",\"iax\",\"icap\",\"im\",\"imap\",\"info\",\"ipp\",\"iris\",\"iris.beep\",\"iris.xpc\",\"iris.xpcs\",\"iris.lwz\",\"ldap\",\"mailto\",\"mid\",\"msrp\",\"msrps\",\"mtqp\",\"mupdate\",\"news\",\"nfs\",\"ni\",\"nih\",\"nntp\",\"opaquelocktoken\",\"pop\",\"pres\",\"rtsp\",\"service\",\"session\",\"shttp\",\"sieve\",\"sip\",\"sips\",\"sms\",\"snmp\",\"soap.beep\",\"soap.beeps\",\"tag\",\"tel\",\"telnet\",\"tftp\",\"thismessage\",\"tn3270\",\"tip\",\"tv\",\"urn\",\"vemmi\",\"ws\",\"wss\",\"xcon\",\"xcon-userid\",\"xmlrpc.beep\",\"xmlrpc.beeps\",\"xmpp\",\"z39.50r\",\"z39.50s\",\"adiumxtra\",\"afp\",\"afs\",\"aim\",\"apt\",\"attachment\",\"aw\",\"beshare\",\"bitcoin\",\"bolo\",\"callto\",\"chrome\",\"chrome-extension\",\"com-eventbrite-attendee\",\"content\",\"cvs\",\"dlna-playsingle\",\"dlna-playcontainer\",\"dtn\",\"dvb\",\"ed2k\",\"facetime\",\"feed\",\"finger\",\"fish\",\"gg\",\"git\",\"gizmoproject\",\"gtalk\",\"hcp\",\"icon\",\"ipn\",\"irc\",\"irc6\",\"ircs\",\"itms\",\"jar\",\"jms\",\"keyparc\",\"lastfm\",\"ldaps\",\"magnet\",\"maps\",\"market\",\"message\",\"mms\",\"ms-help\",\"msnim\",\"mumble\",\"mvn\",\"notes\",\"oid\",\"palm\",\"paparazzi\",\"platform\",\"proxy\",\"psyc\",\"query\",\"res\",\"resource\",\"rmi\",\"rsync\",\"rtmp\",\"secondlife\",\"sftp\",\"sgn\",\"skype\",\"smb\",\"soldat\",\"spotify\",\"ssh\",\"steam\",\"svn\",\"teamspeak\",\"things\",\"udp\",\"unreal\",\"ut2004\",\"ventrilo\",\"view-source\",\"webcal\",\"wtai\",\"wyciwyg\",\"xfire\",\"xri\",\"ymsgr\"],pC=/^<([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])?)*)>/,hC=/^<([a-zA-Z.\\-]{1,25}):([^<>\\x00-\\x20]*)>/;function replace$1(o,s){return o=o.source,s=s||\"\",function self(i,u){return i?(u=u.source||u,o=o.replace(i,u),self):new RegExp(o,s)}}var dC=replace$1(/(?:unquoted|single_quoted|double_quoted)/)(\"unquoted\",/[^\"'=<>`\\x00-\\x20]+/)(\"single_quoted\",/'[^']*'/)(\"double_quoted\",/\"[^\"]*\"/)(),fC=replace$1(/(?:\\s+attr_name(?:\\s*=\\s*attr_value)?)/)(\"attr_name\",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)(\"attr_value\",dC)(),mC=replace$1(/<[A-Za-z][A-Za-z0-9]*attribute*\\s*\\/?>/)(\"attribute\",fC)(),gC=replace$1(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)(\"open_tag\",mC)(\"close_tag\",/<\\/[A-Za-z][A-Za-z0-9]*\\s*>/)(\"comment\",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)(\"processing\",/<[?].*?[?]>/)(\"declaration\",/<![A-Z]+\\s+[^>]*>/)(\"cdata\",/<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/)();var yC=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,vC=/^&([a-z][a-z0-9]{1,31});/i;var bC=[[\"text\",function index_browser_text(o,s){for(var i=o.pos;i<o.posMax&&!isTerminatorChar(o.src.charCodeAt(i));)i++;return i!==o.pos&&(s||(o.pending+=o.src.slice(o.pos,i)),o.pos=i,!0)}],[\"newline\",function newline(o,s){var i,u,_=o.pos;if(10!==o.src.charCodeAt(_))return!1;if(i=o.pending.length-1,u=o.posMax,!s)if(i>=0&&32===o.pending.charCodeAt(i))if(i>=1&&32===o.pending.charCodeAt(i-1)){for(var w=i-2;w>=0;w--)if(32!==o.pending.charCodeAt(w)){o.pending=o.pending.substring(0,w+1);break}o.push({type:\"hardbreak\",level:o.level})}else o.pending=o.pending.slice(0,-1),o.push({type:\"softbreak\",level:o.level});else o.push({type:\"softbreak\",level:o.level});for(_++;_<u&&32===o.src.charCodeAt(_);)_++;return o.pos=_,!0}],[\"escape\",function index_browser_escape(o,s){var i,u=o.pos,_=o.posMax;if(92!==o.src.charCodeAt(u))return!1;if(++u<_){if((i=o.src.charCodeAt(u))<256&&0!==iC[i])return s||(o.pending+=o.src[u]),o.pos+=2,!0;if(10===i){for(s||o.push({type:\"hardbreak\",level:o.level}),u++;u<_&&32===o.src.charCodeAt(u);)u++;return o.pos=u,!0}}return s||(o.pending+=\"\\\\\"),o.pos++,!0}],[\"backticks\",function backticks(o,s){var i,u,_,w,x,C=o.pos;if(96!==o.src.charCodeAt(C))return!1;for(i=C,C++,u=o.posMax;C<u&&96===o.src.charCodeAt(C);)C++;for(_=o.src.slice(i,C),w=x=C;-1!==(w=o.src.indexOf(\"`\",x));){for(x=w+1;x<u&&96===o.src.charCodeAt(x);)x++;if(x-w===_.length)return s||o.push({type:\"code\",content:o.src.slice(C,w).replace(/[ \\n]+/g,\" \").trim(),block:!1,level:o.level}),o.pos=x,!0}return s||(o.pending+=_),o.pos+=_.length,!0}],[\"del\",function del(o,s){var i,u,_,w,x,C=o.posMax,j=o.pos;if(126!==o.src.charCodeAt(j))return!1;if(s)return!1;if(j+4>=C)return!1;if(126!==o.src.charCodeAt(j+1))return!1;if(o.level>=o.options.maxNesting)return!1;if(w=j>0?o.src.charCodeAt(j-1):-1,x=o.src.charCodeAt(j+2),126===w)return!1;if(126===x)return!1;if(32===x||10===x)return!1;for(u=j+2;u<C&&126===o.src.charCodeAt(u);)u++;if(u>j+3)return o.pos+=u-j,s||(o.pending+=o.src.slice(j,u)),!0;for(o.pos=j+2,_=1;o.pos+1<C;){if(126===o.src.charCodeAt(o.pos)&&126===o.src.charCodeAt(o.pos+1)&&(w=o.src.charCodeAt(o.pos-1),126!==(x=o.pos+2<C?o.src.charCodeAt(o.pos+2):-1)&&126!==w&&(32!==w&&10!==w?_--:32!==x&&10!==x&&_++,_<=0))){i=!0;break}o.parser.skipToken(o)}return i?(o.posMax=o.pos,o.pos=j+2,s||(o.push({type:\"del_open\",level:o.level++}),o.parser.tokenize(o),o.push({type:\"del_close\",level:--o.level})),o.pos=o.posMax+2,o.posMax=C,!0):(o.pos=j,!1)}],[\"ins\",function ins(o,s){var i,u,_,w,x,C=o.posMax,j=o.pos;if(43!==o.src.charCodeAt(j))return!1;if(s)return!1;if(j+4>=C)return!1;if(43!==o.src.charCodeAt(j+1))return!1;if(o.level>=o.options.maxNesting)return!1;if(w=j>0?o.src.charCodeAt(j-1):-1,x=o.src.charCodeAt(j+2),43===w)return!1;if(43===x)return!1;if(32===x||10===x)return!1;for(u=j+2;u<C&&43===o.src.charCodeAt(u);)u++;if(u!==j+2)return o.pos+=u-j,s||(o.pending+=o.src.slice(j,u)),!0;for(o.pos=j+2,_=1;o.pos+1<C;){if(43===o.src.charCodeAt(o.pos)&&43===o.src.charCodeAt(o.pos+1)&&(w=o.src.charCodeAt(o.pos-1),43!==(x=o.pos+2<C?o.src.charCodeAt(o.pos+2):-1)&&43!==w&&(32!==w&&10!==w?_--:32!==x&&10!==x&&_++,_<=0))){i=!0;break}o.parser.skipToken(o)}return i?(o.posMax=o.pos,o.pos=j+2,s||(o.push({type:\"ins_open\",level:o.level++}),o.parser.tokenize(o),o.push({type:\"ins_close\",level:--o.level})),o.pos=o.posMax+2,o.posMax=C,!0):(o.pos=j,!1)}],[\"mark\",function mark(o,s){var i,u,_,w,x,C=o.posMax,j=o.pos;if(61!==o.src.charCodeAt(j))return!1;if(s)return!1;if(j+4>=C)return!1;if(61!==o.src.charCodeAt(j+1))return!1;if(o.level>=o.options.maxNesting)return!1;if(w=j>0?o.src.charCodeAt(j-1):-1,x=o.src.charCodeAt(j+2),61===w)return!1;if(61===x)return!1;if(32===x||10===x)return!1;for(u=j+2;u<C&&61===o.src.charCodeAt(u);)u++;if(u!==j+2)return o.pos+=u-j,s||(o.pending+=o.src.slice(j,u)),!0;for(o.pos=j+2,_=1;o.pos+1<C;){if(61===o.src.charCodeAt(o.pos)&&61===o.src.charCodeAt(o.pos+1)&&(w=o.src.charCodeAt(o.pos-1),61!==(x=o.pos+2<C?o.src.charCodeAt(o.pos+2):-1)&&61!==w&&(32!==w&&10!==w?_--:32!==x&&10!==x&&_++,_<=0))){i=!0;break}o.parser.skipToken(o)}return i?(o.posMax=o.pos,o.pos=j+2,s||(o.push({type:\"mark_open\",level:o.level++}),o.parser.tokenize(o),o.push({type:\"mark_close\",level:--o.level})),o.pos=o.posMax+2,o.posMax=C,!0):(o.pos=j,!1)}],[\"emphasis\",function emphasis(o,s){var i,u,_,w,x,C,j,L=o.posMax,B=o.pos,$=o.src.charCodeAt(B);if(95!==$&&42!==$)return!1;if(s)return!1;if(i=(j=scanDelims(o,B)).delims,!j.can_open)return o.pos+=i,s||(o.pending+=o.src.slice(B,o.pos)),!0;if(o.level>=o.options.maxNesting)return!1;for(o.pos=B+i,C=[i];o.pos<L;)if(o.src.charCodeAt(o.pos)!==$)o.parser.skipToken(o);else{if(u=(j=scanDelims(o,o.pos)).delims,j.can_close){for(w=C.pop(),x=u;w!==x;){if(x<w){C.push(w-x);break}if(x-=w,0===C.length)break;o.pos+=w,w=C.pop()}if(0===C.length){i=w,_=!0;break}o.pos+=u;continue}j.can_open&&C.push(u),o.pos+=u}return _?(o.posMax=o.pos,o.pos=B+i,s||(2!==i&&3!==i||o.push({type:\"strong_open\",level:o.level++}),1!==i&&3!==i||o.push({type:\"em_open\",level:o.level++}),o.parser.tokenize(o),1!==i&&3!==i||o.push({type:\"em_close\",level:--o.level}),2!==i&&3!==i||o.push({type:\"strong_close\",level:--o.level})),o.pos=o.posMax+i,o.posMax=L,!0):(o.pos=B,!1)}],[\"sub\",function sub(o,s){var i,u,_=o.posMax,w=o.pos;if(126!==o.src.charCodeAt(w))return!1;if(s)return!1;if(w+2>=_)return!1;if(o.level>=o.options.maxNesting)return!1;for(o.pos=w+1;o.pos<_;){if(126===o.src.charCodeAt(o.pos)){i=!0;break}o.parser.skipToken(o)}return i&&w+1!==o.pos?(u=o.src.slice(w+1,o.pos)).match(/(^|[^\\\\])(\\\\\\\\)*\\s/)?(o.pos=w,!1):(o.posMax=o.pos,o.pos=w+1,s||o.push({type:\"sub\",level:o.level,content:u.replace(cC,\"$1\")}),o.pos=o.posMax+1,o.posMax=_,!0):(o.pos=w,!1)}],[\"sup\",function sup(o,s){var i,u,_=o.posMax,w=o.pos;if(94!==o.src.charCodeAt(w))return!1;if(s)return!1;if(w+2>=_)return!1;if(o.level>=o.options.maxNesting)return!1;for(o.pos=w+1;o.pos<_;){if(94===o.src.charCodeAt(o.pos)){i=!0;break}o.parser.skipToken(o)}return i&&w+1!==o.pos?(u=o.src.slice(w+1,o.pos)).match(/(^|[^\\\\])(\\\\\\\\)*\\s/)?(o.pos=w,!1):(o.posMax=o.pos,o.pos=w+1,s||o.push({type:\"sup\",level:o.level,content:u.replace(lC,\"$1\")}),o.pos=o.posMax+1,o.posMax=_,!0):(o.pos=w,!1)}],[\"links\",function links(o,s){var i,u,_,w,x,C,j,L,B=!1,$=o.pos,V=o.posMax,U=o.pos,z=o.src.charCodeAt(U);if(33===z&&(B=!0,z=o.src.charCodeAt(++U)),91!==z)return!1;if(o.level>=o.options.maxNesting)return!1;if(i=U+1,(u=parseLinkLabel(o,U))<0)return!1;if((C=u+1)<V&&40===o.src.charCodeAt(C)){for(C++;C<V&&(32===(L=o.src.charCodeAt(C))||10===L);C++);if(C>=V)return!1;for(U=C,parseLinkDestination(o,C)?(w=o.linkContent,C=o.pos):w=\"\",U=C;C<V&&(32===(L=o.src.charCodeAt(C))||10===L);C++);if(C<V&&U!==C&&parseLinkTitle(o,C))for(x=o.linkContent,C=o.pos;C<V&&(32===(L=o.src.charCodeAt(C))||10===L);C++);else x=\"\";if(C>=V||41!==o.src.charCodeAt(C))return o.pos=$,!1;C++}else{if(o.linkLevel>0)return!1;for(;C<V&&(32===(L=o.src.charCodeAt(C))||10===L);C++);if(C<V&&91===o.src.charCodeAt(C)&&(U=C+1,(C=parseLinkLabel(o,C))>=0?_=o.src.slice(U,C++):C=U-1),_||(void 0===_&&(C=u+1),_=o.src.slice(i,u)),!(j=o.env.references[normalizeReference(_)]))return o.pos=$,!1;w=j.href,x=j.title}return s||(o.pos=i,o.posMax=u,B?o.push({type:\"image\",src:w,title:x,alt:o.src.substr(i,u-i),level:o.level}):(o.push({type:\"link_open\",href:w,title:x,level:o.level++}),o.linkLevel++,o.parser.tokenize(o),o.linkLevel--,o.push({type:\"link_close\",level:--o.level}))),o.pos=C,o.posMax=V,!0}],[\"footnote_inline\",function footnote_inline(o,s){var i,u,_,w,x=o.posMax,C=o.pos;return!(C+2>=x)&&(94===o.src.charCodeAt(C)&&(91===o.src.charCodeAt(C+1)&&(!(o.level>=o.options.maxNesting)&&(i=C+2,!((u=parseLinkLabel(o,C+1))<0)&&(s||(o.env.footnotes||(o.env.footnotes={}),o.env.footnotes.list||(o.env.footnotes.list=[]),_=o.env.footnotes.list.length,o.pos=i,o.posMax=u,o.push({type:\"footnote_ref\",id:_,level:o.level}),o.linkLevel++,w=o.tokens.length,o.parser.tokenize(o),o.env.footnotes.list[_]={tokens:o.tokens.splice(w)},o.linkLevel--),o.pos=u+1,o.posMax=x,!0)))))}],[\"footnote_ref\",function footnote_ref(o,s){var i,u,_,w,x=o.posMax,C=o.pos;if(C+3>x)return!1;if(!o.env.footnotes||!o.env.footnotes.refs)return!1;if(91!==o.src.charCodeAt(C))return!1;if(94!==o.src.charCodeAt(C+1))return!1;if(o.level>=o.options.maxNesting)return!1;for(u=C+2;u<x;u++){if(32===o.src.charCodeAt(u))return!1;if(10===o.src.charCodeAt(u))return!1;if(93===o.src.charCodeAt(u))break}return u!==C+2&&(!(u>=x)&&(u++,i=o.src.slice(C+2,u-1),void 0!==o.env.footnotes.refs[\":\"+i]&&(s||(o.env.footnotes.list||(o.env.footnotes.list=[]),o.env.footnotes.refs[\":\"+i]<0?(_=o.env.footnotes.list.length,o.env.footnotes.list[_]={label:i,count:0},o.env.footnotes.refs[\":\"+i]=_):_=o.env.footnotes.refs[\":\"+i],w=o.env.footnotes.list[_].count,o.env.footnotes.list[_].count++,o.push({type:\"footnote_ref\",id:_,subId:w,level:o.level})),o.pos=u,o.posMax=x,!0)))}],[\"autolink\",function autolink(o,s){var i,u,_,w,x,C=o.pos;return 60===o.src.charCodeAt(C)&&(!((i=o.src.slice(C)).indexOf(\">\")<0)&&((u=i.match(hC))?!(uC.indexOf(u[1].toLowerCase())<0)&&(x=normalizeLink(w=u[0].slice(1,-1)),!!o.parser.validateLink(w)&&(s||(o.push({type:\"link_open\",href:x,level:o.level}),o.push({type:\"text\",content:w,level:o.level+1}),o.push({type:\"link_close\",level:o.level})),o.pos+=u[0].length,!0)):!!(_=i.match(pC))&&(x=normalizeLink(\"mailto:\"+(w=_[0].slice(1,-1))),!!o.parser.validateLink(x)&&(s||(o.push({type:\"link_open\",href:x,level:o.level}),o.push({type:\"text\",content:w,level:o.level+1}),o.push({type:\"link_close\",level:o.level})),o.pos+=_[0].length,!0))))}],[\"htmltag\",function htmltag(o,s){var i,u,_,w=o.pos;return!!o.options.html&&(_=o.posMax,!(60!==o.src.charCodeAt(w)||w+2>=_)&&(!(33!==(i=o.src.charCodeAt(w+1))&&63!==i&&47!==i&&!function isLetter$2(o){var s=32|o;return s>=97&&s<=122}(i))&&(!!(u=o.src.slice(w).match(gC))&&(s||o.push({type:\"htmltag\",content:o.src.slice(w,w+u[0].length),level:o.level}),o.pos+=u[0].length,!0))))}],[\"entity\",function entity(o,s){var i,u,_=o.pos,w=o.posMax;if(38!==o.src.charCodeAt(_))return!1;if(_+1<w)if(35===o.src.charCodeAt(_+1)){if(u=o.src.slice(_).match(yC))return s||(i=\"x\"===u[1][0].toLowerCase()?parseInt(u[1].slice(1),16):parseInt(u[1],10),o.pending+=isValidEntityCode(i)?fromCodePoint(i):fromCodePoint(65533)),o.pos+=u[0].length,!0}else if(u=o.src.slice(_).match(vC)){var x=decodeEntity(u[1]);if(u[1]!==x)return s||(o.pending+=x),o.pos+=u[0].length,!0}return s||(o.pending+=\"&\"),o.pos++,!0}]];function ParserInline(){this.ruler=new Ruler;for(var o=0;o<bC.length;o++)this.ruler.push(bC[o][0],bC[o][1]);this.validateLink=validateLink}function validateLink(o){var s=o.trim().toLowerCase();return-1===(s=replaceEntities(s)).indexOf(\":\")||-1===[\"vbscript\",\"javascript\",\"file\",\"data\"].indexOf(s.split(\":\")[0])}ParserInline.prototype.skipToken=function(o){var s,i,u=this.ruler.getRules(\"\"),_=u.length,w=o.pos;if((i=o.cacheGet(w))>0)o.pos=i;else{for(s=0;s<_;s++)if(u[s](o,!0))return void o.cacheSet(w,o.pos);o.pos++,o.cacheSet(w,o.pos)}},ParserInline.prototype.tokenize=function(o){for(var s,i,u=this.ruler.getRules(\"\"),_=u.length,w=o.posMax;o.pos<w;){for(i=0;i<_&&!(s=u[i](o,!1));i++);if(s){if(o.pos>=w)break}else o.pending+=o.src[o.pos++]}o.pending&&o.pushPending()},ParserInline.prototype.parse=function(o,s,i,u){var _=new StateInline(o,this,s,i,u);this.tokenize(_)};var _C={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:\"language-\",linkTarget:\"\",typographer:!1,quotes:\"“”‘’\",highlight:null,maxNesting:20},components:{core:{rules:[\"block\",\"inline\",\"references\",\"replacements\",\"smartquotes\",\"references\",\"abbr2\",\"footnote_tail\"]},block:{rules:[\"blockquote\",\"code\",\"fences\",\"footnote\",\"heading\",\"hr\",\"htmlblock\",\"lheading\",\"list\",\"paragraph\",\"table\"]},inline:{rules:[\"autolink\",\"backticks\",\"del\",\"emphasis\",\"entity\",\"escape\",\"footnote_ref\",\"htmltag\",\"links\",\"newline\",\"text\"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:\"language-\",linkTarget:\"\",typographer:!1,quotes:\"“”‘’\",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:\"language-\",linkTarget:\"\",typographer:!1,quotes:\"“”‘’\",highlight:null,maxNesting:20},components:{core:{rules:[\"block\",\"inline\",\"references\",\"abbr2\"]},block:{rules:[\"blockquote\",\"code\",\"fences\",\"heading\",\"hr\",\"htmlblock\",\"lheading\",\"list\",\"paragraph\"]},inline:{rules:[\"autolink\",\"backticks\",\"emphasis\",\"entity\",\"escape\",\"htmltag\",\"links\",\"newline\",\"text\"]}}}};function StateCore(o,s,i){this.src=s,this.env=i,this.options=o.options,this.tokens=[],this.inlineMode=!1,this.inline=o.inline,this.block=o.block,this.renderer=o.renderer,this.typographer=o.typographer}function Remarkable(o,s){\"string\"!=typeof o&&(s=o,o=\"default\"),s&&null!=s.linkify&&console.warn(\"linkify option is removed. Use linkify plugin instead:\\n\\nimport Remarkable from 'remarkable';\\nimport linkify from 'remarkable/linkify';\\nnew Remarkable().use(linkify)\\n\"),this.inline=new ParserInline,this.block=new ParserBlock,this.core=new Core,this.renderer=new Renderer,this.ruler=new Ruler,this.options={},this.configure(_C[o]),this.set(s||{})}Remarkable.prototype.set=function(o){index_browser_assign(this.options,o)},Remarkable.prototype.configure=function(o){var s=this;if(!o)throw new Error(\"Wrong `remarkable` preset, check name/content\");o.options&&s.set(o.options),o.components&&Object.keys(o.components).forEach((function(i){o.components[i].rules&&s[i].ruler.enable(o.components[i].rules,!0)}))},Remarkable.prototype.use=function(o,s){return o(this,s),this},Remarkable.prototype.parse=function(o,s){var i=new StateCore(this,o,s);return this.core.process(i),i.tokens},Remarkable.prototype.render=function(o,s){return s=s||{},this.renderer.render(this.parse(o,s),this.options,s)},Remarkable.prototype.parseInline=function(o,s){var i=new StateCore(this,o,s);return i.inlineMode=!0,this.core.process(i),i.tokens},Remarkable.prototype.renderInline=function(o,s){return s=s||{},this.renderer.render(this.parseInline(o,s),this.options,s)};function indexOf(o,s){if(Array.prototype.indexOf)return o.indexOf(s);for(var i=0,u=o.length;i<u;i++)if(o[i]===s)return i;return-1}function utils_remove(o,s){for(var i=o.length-1;i>=0;i--)!0===s(o[i])&&o.splice(i,1)}function throwUnhandledCaseError(o){throw new Error(\"Unhandled case for value: '\".concat(o,\"'\"))}var EC=function(){function HtmlTag(o){void 0===o&&(o={}),this.tagName=\"\",this.attrs={},this.innerHTML=\"\",this.whitespaceRegex=/\\s+/,this.tagName=o.tagName||\"\",this.attrs=o.attrs||{},this.innerHTML=o.innerHtml||o.innerHTML||\"\"}return HtmlTag.prototype.setTagName=function(o){return this.tagName=o,this},HtmlTag.prototype.getTagName=function(){return this.tagName||\"\"},HtmlTag.prototype.setAttr=function(o,s){return this.getAttrs()[o]=s,this},HtmlTag.prototype.getAttr=function(o){return this.getAttrs()[o]},HtmlTag.prototype.setAttrs=function(o){return Object.assign(this.getAttrs(),o),this},HtmlTag.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},HtmlTag.prototype.setClass=function(o){return this.setAttr(\"class\",o)},HtmlTag.prototype.addClass=function(o){for(var s,i=this.getClass(),u=this.whitespaceRegex,_=i?i.split(u):[],w=o.split(u);s=w.shift();)-1===indexOf(_,s)&&_.push(s);return this.getAttrs().class=_.join(\" \"),this},HtmlTag.prototype.removeClass=function(o){for(var s,i=this.getClass(),u=this.whitespaceRegex,_=i?i.split(u):[],w=o.split(u);_.length&&(s=w.shift());){var x=indexOf(_,s);-1!==x&&_.splice(x,1)}return this.getAttrs().class=_.join(\" \"),this},HtmlTag.prototype.getClass=function(){return this.getAttrs().class||\"\"},HtmlTag.prototype.hasClass=function(o){return-1!==(\" \"+this.getClass()+\" \").indexOf(\" \"+o+\" \")},HtmlTag.prototype.setInnerHTML=function(o){return this.innerHTML=o,this},HtmlTag.prototype.setInnerHtml=function(o){return this.setInnerHTML(o)},HtmlTag.prototype.getInnerHTML=function(){return this.innerHTML||\"\"},HtmlTag.prototype.getInnerHtml=function(){return this.getInnerHTML()},HtmlTag.prototype.toAnchorString=function(){var o=this.getTagName(),s=this.buildAttrsStr();return[\"<\",o,s=s?\" \"+s:\"\",\">\",this.getInnerHtml(),\"</\",o,\">\"].join(\"\")},HtmlTag.prototype.buildAttrsStr=function(){if(!this.attrs)return\"\";var o=this.getAttrs(),s=[];for(var i in o)o.hasOwnProperty(i)&&s.push(i+'=\"'+o[i]+'\"');return s.join(\" \")},HtmlTag}();var wC=function(){function AnchorTagBuilder(o){void 0===o&&(o={}),this.newWindow=!1,this.truncate={},this.className=\"\",this.newWindow=o.newWindow||!1,this.truncate=o.truncate||{},this.className=o.className||\"\"}return AnchorTagBuilder.prototype.build=function(o){return new EC({tagName:\"a\",attrs:this.createAttrs(o),innerHtml:this.processAnchorText(o.getAnchorText())})},AnchorTagBuilder.prototype.createAttrs=function(o){var s={href:o.getAnchorHref()},i=this.createCssClass(o);return i&&(s.class=i),this.newWindow&&(s.target=\"_blank\",s.rel=\"noopener noreferrer\"),this.truncate&&this.truncate.length&&this.truncate.length<o.getAnchorText().length&&(s.title=o.getAnchorHref()),s},AnchorTagBuilder.prototype.createCssClass=function(o){var s=this.className;if(s){for(var i=[s],u=o.getCssClassSuffixes(),_=0,w=u.length;_<w;_++)i.push(s+\"-\"+u[_]);return i.join(\" \")}return\"\"},AnchorTagBuilder.prototype.processAnchorText=function(o){return o=this.doTruncate(o)},AnchorTagBuilder.prototype.doTruncate=function(o){var s=this.truncate;if(!s||!s.length)return o;var i=s.length,u=s.location;return\"smart\"===u?function truncateSmart(o,s,i){var u,_;null==i?(i=\"&hellip;\",_=3,u=8):(_=i.length,u=i.length);var buildUrl=function(o){var s=\"\";return o.scheme&&o.host&&(s+=o.scheme+\"://\"),o.host&&(s+=o.host),o.path&&(s+=\"/\"+o.path),o.query&&(s+=\"?\"+o.query),o.fragment&&(s+=\"#\"+o.fragment),s},buildSegment=function(o,s){var u=s/2,_=Math.ceil(u),w=-1*Math.floor(u),x=\"\";return w<0&&(x=o.substr(w)),o.substr(0,_)+i+x};if(o.length<=s)return o;var w=s-_,x=function(o){var s={},i=o,u=i.match(/^([a-z]+):\\/\\//i);return u&&(s.scheme=u[1],i=i.substr(u[0].length)),(u=i.match(/^(.*?)(?=(\\?|#|\\/|$))/i))&&(s.host=u[1],i=i.substr(u[0].length)),(u=i.match(/^\\/(.*?)(?=(\\?|#|$))/i))&&(s.path=u[1],i=i.substr(u[0].length)),(u=i.match(/^\\?(.*?)(?=(#|$))/i))&&(s.query=u[1],i=i.substr(u[0].length)),(u=i.match(/^#(.*?)$/i))&&(s.fragment=u[1]),s}(o);if(x.query){var C=x.query.match(/^(.*?)(?=(\\?|\\#))(.*?)$/i);C&&(x.query=x.query.substr(0,C[1].length),o=buildUrl(x))}if(o.length<=s)return o;if(x.host&&(x.host=x.host.replace(/^www\\./,\"\"),o=buildUrl(x)),o.length<=s)return o;var j=\"\";if(x.host&&(j+=x.host),j.length>=w)return x.host.length==s?(x.host.substr(0,s-_)+i).substr(0,w+u):buildSegment(j,w).substr(0,w+u);var L=\"\";if(x.path&&(L+=\"/\"+x.path),x.query&&(L+=\"?\"+x.query),L){if((j+L).length>=w)return(j+L).length==s?(j+L).substr(0,s):(j+buildSegment(L,w-j.length)).substr(0,w+u);j+=L}if(x.fragment){var B=\"#\"+x.fragment;if((j+B).length>=w)return(j+B).length==s?(j+B).substr(0,s):(j+buildSegment(B,w-j.length)).substr(0,w+u);j+=B}if(x.scheme&&x.host){var $=x.scheme+\"://\";if((j+$).length<w)return($+j).substr(0,s)}if(j.length<=s)return j;var V=\"\";return w>0&&(V=j.substr(-1*Math.floor(w/2))),(j.substr(0,Math.ceil(w/2))+i+V).substr(0,w+u)}(o,i):\"middle\"===u?function truncateMiddle(o,s,i){if(o.length<=s)return o;var u,_;null==i?(i=\"&hellip;\",u=8,_=3):(u=i.length,_=i.length);var w=s-_,x=\"\";return w>0&&(x=o.substr(-1*Math.floor(w/2))),(o.substr(0,Math.ceil(w/2))+i+x).substr(0,w+u)}(o,i):function truncateEnd(o,s,i){return function ellipsis(o,s,i){var u;return o.length>s&&(null==i?(i=\"&hellip;\",u=3):u=i.length,o=o.substring(0,s-u)+i),o}(o,s,i)}(o,i)},AnchorTagBuilder}(),SC=function(){function Match(o){this.__jsduckDummyDocProp=null,this.matchedText=\"\",this.offset=0,this.tagBuilder=o.tagBuilder,this.matchedText=o.matchedText,this.offset=o.offset}return Match.prototype.getMatchedText=function(){return this.matchedText},Match.prototype.setOffset=function(o){this.offset=o},Match.prototype.getOffset=function(){return this.offset},Match.prototype.getCssClassSuffixes=function(){return[this.getType()]},Match.prototype.buildTag=function(){return this.tagBuilder.build(this)},Match}(),extendStatics=function(o,s){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(o[i]=s[i])},extendStatics(o,s)};function tslib_es6_extends(o,s){if(\"function\"!=typeof s&&null!==s)throw new TypeError(\"Class extends value \"+String(s)+\" is not a constructor or null\");function __(){this.constructor=o}extendStatics(o,s),o.prototype=null===s?Object.create(s):(__.prototype=s.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(o){for(var s,i=1,u=arguments.length;i<u;i++)for(var _ in s=arguments[i])Object.prototype.hasOwnProperty.call(s,_)&&(o[_]=s[_]);return o},__assign.apply(this,arguments)};Object.create;Object.create;\"function\"==typeof SuppressedError&&SuppressedError;var xC,kC=function(o){function EmailMatch(s){var i=o.call(this,s)||this;return i.email=\"\",i.email=s.email,i}return tslib_es6_extends(EmailMatch,o),EmailMatch.prototype.getType=function(){return\"email\"},EmailMatch.prototype.getEmail=function(){return this.email},EmailMatch.prototype.getAnchorHref=function(){return\"mailto:\"+this.email},EmailMatch.prototype.getAnchorText=function(){return this.email},EmailMatch}(SC),OC=function(o){function HashtagMatch(s){var i=o.call(this,s)||this;return i.serviceName=\"\",i.hashtag=\"\",i.serviceName=s.serviceName,i.hashtag=s.hashtag,i}return tslib_es6_extends(HashtagMatch,o),HashtagMatch.prototype.getType=function(){return\"hashtag\"},HashtagMatch.prototype.getServiceName=function(){return this.serviceName},HashtagMatch.prototype.getHashtag=function(){return this.hashtag},HashtagMatch.prototype.getAnchorHref=function(){var o=this.serviceName,s=this.hashtag;switch(o){case\"twitter\":return\"https://twitter.com/hashtag/\"+s;case\"facebook\":return\"https://www.facebook.com/hashtag/\"+s;case\"instagram\":return\"https://instagram.com/explore/tags/\"+s;case\"tiktok\":return\"https://www.tiktok.com/tag/\"+s;default:throw new Error(\"Unknown service name to point hashtag to: \"+o)}},HashtagMatch.prototype.getAnchorText=function(){return\"#\"+this.hashtag},HashtagMatch}(SC),CC=function(o){function MentionMatch(s){var i=o.call(this,s)||this;return i.serviceName=\"twitter\",i.mention=\"\",i.mention=s.mention,i.serviceName=s.serviceName,i}return tslib_es6_extends(MentionMatch,o),MentionMatch.prototype.getType=function(){return\"mention\"},MentionMatch.prototype.getMention=function(){return this.mention},MentionMatch.prototype.getServiceName=function(){return this.serviceName},MentionMatch.prototype.getAnchorHref=function(){switch(this.serviceName){case\"twitter\":return\"https://twitter.com/\"+this.mention;case\"instagram\":return\"https://instagram.com/\"+this.mention;case\"soundcloud\":return\"https://soundcloud.com/\"+this.mention;case\"tiktok\":return\"https://www.tiktok.com/@\"+this.mention;default:throw new Error(\"Unknown service name to point mention to: \"+this.serviceName)}},MentionMatch.prototype.getAnchorText=function(){return\"@\"+this.mention},MentionMatch.prototype.getCssClassSuffixes=function(){var s=o.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&s.push(i),s},MentionMatch}(SC),AC=function(o){function PhoneMatch(s){var i=o.call(this,s)||this;return i.number=\"\",i.plusSign=!1,i.number=s.number,i.plusSign=s.plusSign,i}return tslib_es6_extends(PhoneMatch,o),PhoneMatch.prototype.getType=function(){return\"phone\"},PhoneMatch.prototype.getPhoneNumber=function(){return this.number},PhoneMatch.prototype.getNumber=function(){return this.getPhoneNumber()},PhoneMatch.prototype.getAnchorHref=function(){return\"tel:\"+(this.plusSign?\"+\":\"\")+this.number},PhoneMatch.prototype.getAnchorText=function(){return this.matchedText},PhoneMatch}(SC),jC=function(o){function UrlMatch(s){var i=o.call(this,s)||this;return i.url=\"\",i.urlMatchType=\"scheme\",i.protocolUrlMatch=!1,i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.schemePrefixRegex=/^(https?:\\/\\/)?/i,i.wwwPrefixRegex=/^(https?:\\/\\/)?(www\\.)?/i,i.protocolRelativeRegex=/^\\/\\//,i.protocolPrepended=!1,i.urlMatchType=s.urlMatchType,i.url=s.url,i.protocolUrlMatch=s.protocolUrlMatch,i.protocolRelativeMatch=s.protocolRelativeMatch,i.stripPrefix=s.stripPrefix,i.stripTrailingSlash=s.stripTrailingSlash,i.decodePercentEncoding=s.decodePercentEncoding,i}return tslib_es6_extends(UrlMatch,o),UrlMatch.prototype.getType=function(){return\"url\"},UrlMatch.prototype.getUrlMatchType=function(){return this.urlMatchType},UrlMatch.prototype.getUrl=function(){var o=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(o=this.url=\"http://\"+o,this.protocolPrepended=!0),o},UrlMatch.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,\"&\")},UrlMatch.prototype.getAnchorText=function(){var o=this.getMatchedText();return this.protocolRelativeMatch&&(o=this.stripProtocolRelativePrefix(o)),this.stripPrefix.scheme&&(o=this.stripSchemePrefix(o)),this.stripPrefix.www&&(o=this.stripWwwPrefix(o)),this.stripTrailingSlash&&(o=this.removeTrailingSlash(o)),this.decodePercentEncoding&&(o=this.removePercentEncoding(o)),o},UrlMatch.prototype.stripSchemePrefix=function(o){return o.replace(this.schemePrefixRegex,\"\")},UrlMatch.prototype.stripWwwPrefix=function(o){return o.replace(this.wwwPrefixRegex,\"$1\")},UrlMatch.prototype.stripProtocolRelativePrefix=function(o){return o.replace(this.protocolRelativeRegex,\"\")},UrlMatch.prototype.removeTrailingSlash=function(o){return\"/\"===o.charAt(o.length-1)&&(o=o.slice(0,-1)),o},UrlMatch.prototype.removePercentEncoding=function(o){var s=o.replace(/%22/gi,\"&quot;\").replace(/%26/gi,\"&amp;\").replace(/%27/gi,\"&#39;\").replace(/%3C/gi,\"&lt;\").replace(/%3E/gi,\"&gt;\");try{return decodeURIComponent(s)}catch(o){return s}},UrlMatch}(SC),PC=function PC(o){this.__jsduckDummyDocProp=null,this.tagBuilder=o.tagBuilder},IC=/[A-Za-z]/,MC=/[\\d]/,NC=/[\\D]/,TC=/\\s/,RC=/['\"]/,DC=/[\\x00-\\x1F\\x7F]/,LC=/A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC/.source,BC=LC+/\\u2700-\\u27bf\\udde6-\\uddff\\ud800-\\udbff\\udc00-\\udfff\\ufe0e\\ufe0f\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ud83c\\udffb-\\udfff\\u200d\\u3299\\u3297\\u303d\\u3030\\u24c2\\ud83c\\udd70-\\udd71\\udd7e-\\udd7f\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01-\\ude02\\ude1a\\ude2f\\ude32-\\ude3a\\ude50-\\ude51\\u203c\\u2049\\u25aa-\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u00a9\\u00ae\\u2122\\u2139\\udc04\\u2600-\\u26FF\\u2b05\\u2b06\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u231a\\u231b\\u2328\\u23cf\\u23e9-\\u23f3\\u23f8-\\u23fa\\udccf\\u2935\\u2934\\u2190-\\u21ff/.source+/\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D4-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFB-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F/.source,FC=/0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0DE6-\\u0DEF\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uA9F0-\\uA9F9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19/.source,qC=BC+FC,$C=BC+FC,VC=new RegExp(\"[\".concat($C,\"]\")),UC=\"(?:[\"+FC+\"]{1,3}\\\\.){3}[\"+FC+\"]{1,3}\",zC=\"[\"+$C+\"](?:[\"+$C+\"\\\\-_]{0,61}[\"+$C+\"])?\",getDomainLabelStr=function(o){return\"(?=(\"+zC+\"))\\\\\"+o},getDomainNameStr=function(o){return\"(?:\"+getDomainLabelStr(o)+\"(?:\\\\.\"+getDomainLabelStr(o+1)+\"){0,126}|\"+UC+\")\"},WC=(new RegExp(\"[\"+$C+\".\\\\-]*[\"+$C+\"\\\\-]\"),VC),KC=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,HC=new RegExp(\"[\".concat($C,\"!#$%&'*+/=?^_`{|}~-]\")),JC=new RegExp(\"^\".concat(KC.source,\"$\")),GC=function(o){function EmailMatcher(){var s=null!==o&&o.apply(this,arguments)||this;return s.localPartCharRegex=HC,s.strictTldRegex=JC,s}return tslib_es6_extends(EmailMatcher,o),EmailMatcher.prototype.parseMatches=function(o){for(var s=this.tagBuilder,i=this.localPartCharRegex,u=this.strictTldRegex,_=[],w=o.length,x=new YC,C={m:\"a\",a:\"i\",i:\"l\",l:\"t\",t:\"o\",o:\":\"},j=0,L=0,B=x;j<w;){var $=o.charAt(j);switch(L){case 0:stateNonEmailAddress($);break;case 1:stateMailTo(o.charAt(j-1),$);break;case 2:stateLocalPart($);break;case 3:stateLocalPartDot($);break;case 4:stateAtSign($);break;case 5:stateDomainChar($);break;case 6:stateDomainHyphen($);break;case 7:stateDomainDot($);break;default:throwUnhandledCaseError(L)}j++}return captureMatchIfValidAndReset(),_;function stateNonEmailAddress(o){\"m\"===o?beginEmailMatch(1):i.test(o)&&beginEmailMatch()}function stateMailTo(o,s){\":\"===o?i.test(s)?(L=2,B=new YC(__assign(__assign({},B),{hasMailtoPrefix:!0}))):resetToNonEmailMatchState():C[o]===s||(i.test(s)?L=2:\".\"===s?L=3:\"@\"===s?L=4:resetToNonEmailMatchState())}function stateLocalPart(o){\".\"===o?L=3:\"@\"===o?L=4:i.test(o)||resetToNonEmailMatchState()}function stateLocalPartDot(o){\".\"===o||\"@\"===o?resetToNonEmailMatchState():i.test(o)?L=2:resetToNonEmailMatchState()}function stateAtSign(o){WC.test(o)?L=5:resetToNonEmailMatchState()}function stateDomainChar(o){\".\"===o?L=7:\"-\"===o?L=6:WC.test(o)||captureMatchIfValidAndReset()}function stateDomainHyphen(o){\"-\"===o||\".\"===o?captureMatchIfValidAndReset():WC.test(o)?L=5:captureMatchIfValidAndReset()}function stateDomainDot(o){\".\"===o||\"-\"===o?captureMatchIfValidAndReset():WC.test(o)?(L=5,B=new YC(__assign(__assign({},B),{hasDomainDot:!0}))):captureMatchIfValidAndReset()}function beginEmailMatch(o){void 0===o&&(o=2),L=o,B=new YC({idx:j})}function resetToNonEmailMatchState(){L=0,B=x}function captureMatchIfValidAndReset(){if(B.hasDomainDot){var i=o.slice(B.idx,j);/[-.]$/.test(i)&&(i=i.slice(0,-1));var w=B.hasMailtoPrefix?i.slice(7):i;(function doesEmailHaveValidTld(o){var s=o.split(\".\").pop()||\"\",i=s.toLowerCase();return u.test(i)})(w)&&_.push(new kC({tagBuilder:s,matchedText:i,offset:B.idx,email:w}))}resetToNonEmailMatchState()}},EmailMatcher}(PC),YC=function YC(o){void 0===o&&(o={}),this.idx=void 0!==o.idx?o.idx:-1,this.hasMailtoPrefix=!!o.hasMailtoPrefix,this.hasDomainDot=!!o.hasDomainDot},XC=function(){function UrlMatchValidator(){}return UrlMatchValidator.isValid=function(o,s){return!(s&&!this.isValidUriScheme(s)||this.urlMatchDoesNotHaveProtocolOrDot(o,s)||this.urlMatchDoesNotHaveAtLeastOneWordChar(o,s)&&!this.isValidIpAddress(o)||this.containsMultipleDots(o))},UrlMatchValidator.isValidIpAddress=function(o){var s=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==o.match(s)},UrlMatchValidator.containsMultipleDots=function(o){var s=o;return this.hasFullProtocolRegex.test(o)&&(s=o.split(\"://\")[1]),s.split(\"/\")[0].indexOf(\"..\")>-1},UrlMatchValidator.isValidUriScheme=function(o){var s=o.match(this.uriSchemeRegex),i=s&&s[0].toLowerCase();return\"javascript:\"!==i&&\"vbscript:\"!==i},UrlMatchValidator.urlMatchDoesNotHaveProtocolOrDot=function(o,s){return!(!o||s&&this.hasFullProtocolRegex.test(s)||-1!==o.indexOf(\".\"))},UrlMatchValidator.urlMatchDoesNotHaveAtLeastOneWordChar=function(o,s){return!(!o||!s)&&(!this.hasFullProtocolRegex.test(s)&&!this.hasWordCharAfterProtocolRegex.test(o))},UrlMatchValidator.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\\/\\//,UrlMatchValidator.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,UrlMatchValidator.hasWordCharAfterProtocolRegex=new RegExp(\":[^\\\\s]*?[\"+LC+\"]\"),UrlMatchValidator.ipRegex=/[0-9][0-9]?[0-9]?\\.[0-9][0-9]?[0-9]?\\.[0-9][0-9]?[0-9]?\\.[0-9][0-9]?[0-9]?(:[0-9]*)?\\/?$/,UrlMatchValidator}(),QC=(xC=new RegExp(\"[/?#](?:[\"+$C+\"\\\\-+&@#/%=~_()|'$*\\\\[\\\\]{}?!:,.;^✓]*[\"+$C+\"\\\\-+&@#/%=~_()|'$*\\\\[\\\\]{}✓])?\"),new RegExp([\"(?:\",\"(\",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\\/\\/)(?!\\d+\\/?)(?:\\/\\/)?)/.source,getDomainNameStr(2),\")\",\"|\",\"(\",\"(//)?\",/(?:www\\.)/.source,getDomainNameStr(6),\")\",\"|\",\"(\",\"(//)?\",getDomainNameStr(10)+\"\\\\.\",KC.source,\"(?![-\"+qC+\"])\",\")\",\")\",\"(?::[0-9]+)?\",\"(?:\"+xC.source+\")?\"].join(\"\"),\"gi\")),ZC=new RegExp(\"[\"+$C+\"]\"),eA=function(o){function UrlMatcher(s){var i=o.call(this,s)||this;return i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.matcherRegex=QC,i.wordCharRegExp=ZC,i.stripPrefix=s.stripPrefix,i.stripTrailingSlash=s.stripTrailingSlash,i.decodePercentEncoding=s.decodePercentEncoding,i}return tslib_es6_extends(UrlMatcher,o),UrlMatcher.prototype.parseMatches=function(o){for(var s,i=this.matcherRegex,u=this.stripPrefix,_=this.stripTrailingSlash,w=this.decodePercentEncoding,x=this.tagBuilder,C=[],_loop_1=function(){var i=s[0],L=s[1],B=s[4],$=s[5],V=s[9],U=s.index,z=$||V,Y=o.charAt(U-1);if(!XC.isValid(i,L))return\"continue\";if(U>0&&\"@\"===Y)return\"continue\";if(U>0&&z&&j.wordCharRegExp.test(Y))return\"continue\";if(/\\?$/.test(i)&&(i=i.substr(0,i.length-1)),j.matchHasUnbalancedClosingParen(i))i=i.substr(0,i.length-1);else{var Z=j.matchHasInvalidCharAfterTld(i,L);Z>-1&&(i=i.substr(0,Z))}var ee=[\"http://\",\"https://\"].find((function(o){return!!L&&-1!==L.indexOf(o)}));if(ee){var ie=i.indexOf(ee);i=i.substr(ie),L=L.substr(ie),U+=ie}var ae=L?\"scheme\":B?\"www\":\"tld\",ce=!!L;C.push(new jC({tagBuilder:x,matchedText:i,offset:U,urlMatchType:ae,url:i,protocolUrlMatch:ce,protocolRelativeMatch:!!z,stripPrefix:u,stripTrailingSlash:_,decodePercentEncoding:w}))},j=this;null!==(s=i.exec(o));)_loop_1();return C},UrlMatcher.prototype.matchHasUnbalancedClosingParen=function(o){var s,i=o.charAt(o.length-1);if(\")\"===i)s=\"(\";else if(\"]\"===i)s=\"[\";else{if(\"}\"!==i)return!1;s=\"{\"}for(var u=0,_=0,w=o.length-1;_<w;_++){var x=o.charAt(_);x===s?u++:x===i&&(u=Math.max(u-1,0))}return 0===u},UrlMatcher.prototype.matchHasInvalidCharAfterTld=function(o,s){if(!o)return-1;var i=0;s&&(i=o.indexOf(\":\"),o=o.slice(i));var u=new RegExp(\"^((.?//)?[-.\"+$C+\"]*[-\"+$C+\"]\\\\.[-\"+$C+\"]+)\").exec(o);return null===u?-1:(i+=u[1].length,o=o.slice(u[1].length),/^[^-.A-Za-z0-9:\\/?#]/.test(o)?i:-1)},UrlMatcher}(PC),tA=new RegExp(\"[_\".concat($C,\"]\")),rA=function(o){function HashtagMatcher(s){var i=o.call(this,s)||this;return i.serviceName=\"twitter\",i.serviceName=s.serviceName,i}return tslib_es6_extends(HashtagMatcher,o),HashtagMatcher.prototype.parseMatches=function(o){for(var s=this.tagBuilder,i=this.serviceName,u=[],_=o.length,w=0,x=-1,C=0;w<_;){var j=o.charAt(w);switch(C){case 0:stateNone(j);break;case 1:stateNonHashtagWordChar(j);break;case 2:stateHashtagHashChar(j);break;case 3:stateHashtagTextChar(j);break;default:throwUnhandledCaseError(C)}w++}return captureMatchIfValid(),u;function stateNone(o){\"#\"===o?(C=2,x=w):VC.test(o)&&(C=1)}function stateNonHashtagWordChar(o){VC.test(o)||(C=0)}function stateHashtagHashChar(o){C=tA.test(o)?3:VC.test(o)?1:0}function stateHashtagTextChar(o){tA.test(o)||(captureMatchIfValid(),x=-1,C=VC.test(o)?1:0)}function captureMatchIfValid(){if(x>-1&&w-x<=140){var _=o.slice(x,w),C=new OC({tagBuilder:s,matchedText:_,offset:x,serviceName:i,hashtag:_.slice(1)});u.push(C)}}},HashtagMatcher}(PC),nA=[\"twitter\",\"facebook\",\"instagram\",\"tiktok\"],oA=new RegExp(\"\".concat(/(?:(?:(?:(\\+)?\\d{1,3}[-\\040.]?)?\\(?\\d{3}\\)?[-\\040.]?\\d{3}[-\\040.]?\\d{4})|(?:(\\+)(?:9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\\040.]?(?:\\d[-\\040.]?){6,12}\\d+))([,;]+[0-9]+#?)*/.source,\"|\").concat(/(0([1-9]{1}-?[1-9]\\d{3}|[1-9]{2}-?\\d{3}|[1-9]{2}\\d{1}-?\\d{2}|[1-9]{2}\\d{2}-?\\d{1})-?\\d{4}|0[789]0-?\\d{4}-?\\d{4}|050-?\\d{4}-?\\d{4})/.source),\"g\"),sA=function(o){function PhoneMatcher(){var s=null!==o&&o.apply(this,arguments)||this;return s.matcherRegex=oA,s}return tslib_es6_extends(PhoneMatcher,o),PhoneMatcher.prototype.parseMatches=function(o){for(var s,i=this.matcherRegex,u=this.tagBuilder,_=[];null!==(s=i.exec(o));){var w=s[0],x=w.replace(/[^0-9,;#]/g,\"\"),C=!(!s[1]&&!s[2]),j=0==s.index?\"\":o.substr(s.index-1,1),L=o.substr(s.index+w.length,1),B=!j.match(/\\d/)&&!L.match(/\\d/);this.testMatch(s[3])&&this.testMatch(w)&&B&&_.push(new AC({tagBuilder:u,matchedText:w,offset:s.index,number:x,plusSign:C}))}return _},PhoneMatcher.prototype.testMatch=function(o){return NC.test(o)},PhoneMatcher}(PC),iA=new RegExp(\"@[_\".concat($C,\"]{1,50}(?![_\").concat($C,\"])\"),\"g\"),aA=new RegExp(\"@[_.\".concat($C,\"]{1,30}(?![_\").concat($C,\"])\"),\"g\"),cA=new RegExp(\"@[-_.\".concat($C,\"]{1,50}(?![-_\").concat($C,\"])\"),\"g\"),lA=new RegExp(\"@[_.\".concat($C,\"]{1,23}[_\").concat($C,\"](?![_\").concat($C,\"])\"),\"g\"),uA=new RegExp(\"[^\"+$C+\"]\"),pA=function(o){function MentionMatcher(s){var i=o.call(this,s)||this;return i.serviceName=\"twitter\",i.matcherRegexes={twitter:iA,instagram:aA,soundcloud:cA,tiktok:lA},i.nonWordCharRegex=uA,i.serviceName=s.serviceName,i}return tslib_es6_extends(MentionMatcher,o),MentionMatcher.prototype.parseMatches=function(o){var s,i=this.serviceName,u=this.matcherRegexes[this.serviceName],_=this.nonWordCharRegex,w=this.tagBuilder,x=[];if(!u)return x;for(;null!==(s=u.exec(o));){var C=s.index,j=o.charAt(C-1);if(0===C||_.test(j)){var L=s[0].replace(/\\.+$/g,\"\"),B=L.slice(1);x.push(new CC({tagBuilder:w,matchedText:L,offset:C,serviceName:i,mention:B}))}}return x},MentionMatcher}(PC);function parseHtml(o,s){for(var i=s.onOpenTag,u=s.onCloseTag,_=s.onText,w=s.onComment,x=s.onDoctype,C=new hA,j=0,L=o.length,B=0,$=0,V=C;j<L;){var U=o.charAt(j);switch(B){case 0:stateData(U);break;case 1:stateTagOpen(U);break;case 2:stateEndTagOpen(U);break;case 3:stateTagName(U);break;case 4:stateBeforeAttributeName(U);break;case 5:stateAttributeName(U);break;case 6:stateAfterAttributeName(U);break;case 7:stateBeforeAttributeValue(U);break;case 8:stateAttributeValueDoubleQuoted(U);break;case 9:stateAttributeValueSingleQuoted(U);break;case 10:stateAttributeValueUnquoted(U);break;case 11:stateAfterAttributeValueQuoted(U);break;case 12:stateSelfClosingStartTag(U);break;case 13:stateMarkupDeclarationOpen(U);break;case 14:stateCommentStart(U);break;case 15:stateCommentStartDash(U);break;case 16:stateComment(U);break;case 17:stateCommentEndDash(U);break;case 18:stateCommentEnd(U);break;case 19:stateCommentEndBang(U);break;case 20:stateDoctype(U);break;default:throwUnhandledCaseError(B)}j++}function stateData(o){\"<\"===o&&startNewTag()}function stateTagOpen(o){\"!\"===o?B=13:\"/\"===o?(B=2,V=new hA(__assign(__assign({},V),{isClosing:!0}))):\"<\"===o?startNewTag():IC.test(o)?(B=3,V=new hA(__assign(__assign({},V),{isOpening:!0}))):(B=0,V=C)}function stateTagName(o){TC.test(o)?(V=new hA(__assign(__assign({},V),{name:captureTagName()})),B=4):\"<\"===o?startNewTag():\"/\"===o?(V=new hA(__assign(__assign({},V),{name:captureTagName()})),B=12):\">\"===o?(V=new hA(__assign(__assign({},V),{name:captureTagName()})),emitTagAndPreviousTextNode()):IC.test(o)||MC.test(o)||\":\"===o||resetToDataState()}function stateEndTagOpen(o){\">\"===o?resetToDataState():IC.test(o)?B=3:resetToDataState()}function stateBeforeAttributeName(o){TC.test(o)||(\"/\"===o?B=12:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o?startNewTag():\"=\"===o||RC.test(o)||DC.test(o)?resetToDataState():B=5)}function stateAttributeName(o){TC.test(o)?B=6:\"/\"===o?B=12:\"=\"===o?B=7:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o?startNewTag():RC.test(o)&&resetToDataState()}function stateAfterAttributeName(o){TC.test(o)||(\"/\"===o?B=12:\"=\"===o?B=7:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o?startNewTag():RC.test(o)?resetToDataState():B=5)}function stateBeforeAttributeValue(o){TC.test(o)||('\"'===o?B=8:\"'\"===o?B=9:/[>=`]/.test(o)?resetToDataState():\"<\"===o?startNewTag():B=10)}function stateAttributeValueDoubleQuoted(o){'\"'===o&&(B=11)}function stateAttributeValueSingleQuoted(o){\"'\"===o&&(B=11)}function stateAttributeValueUnquoted(o){TC.test(o)?B=4:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o&&startNewTag()}function stateAfterAttributeValueQuoted(o){TC.test(o)?B=4:\"/\"===o?B=12:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o?startNewTag():(B=4,function reconsumeCurrentCharacter(){j--}())}function stateSelfClosingStartTag(o){\">\"===o?(V=new hA(__assign(__assign({},V),{isClosing:!0})),emitTagAndPreviousTextNode()):B=4}function stateMarkupDeclarationOpen(s){\"--\"===o.substr(j,2)?(j+=2,V=new hA(__assign(__assign({},V),{type:\"comment\"})),B=14):\"DOCTYPE\"===o.substr(j,7).toUpperCase()?(j+=7,V=new hA(__assign(__assign({},V),{type:\"doctype\"})),B=20):resetToDataState()}function stateCommentStart(o){\"-\"===o?B=15:\">\"===o?resetToDataState():B=16}function stateCommentStartDash(o){\"-\"===o?B=18:\">\"===o?resetToDataState():B=16}function stateComment(o){\"-\"===o&&(B=17)}function stateCommentEndDash(o){B=\"-\"===o?18:16}function stateCommentEnd(o){\">\"===o?emitTagAndPreviousTextNode():\"!\"===o?B=19:\"-\"===o||(B=16)}function stateCommentEndBang(o){\"-\"===o?B=17:\">\"===o?emitTagAndPreviousTextNode():B=16}function stateDoctype(o){\">\"===o?emitTagAndPreviousTextNode():\"<\"===o&&startNewTag()}function resetToDataState(){B=0,V=C}function startNewTag(){B=1,V=new hA({idx:j})}function emitTagAndPreviousTextNode(){var s=o.slice($,V.idx);s&&_(s,$),\"comment\"===V.type?w(V.idx):\"doctype\"===V.type?x(V.idx):(V.isOpening&&i(V.name,V.idx),V.isClosing&&u(V.name,V.idx)),resetToDataState(),$=j+1}function captureTagName(){var s=V.idx+(V.isClosing?2:1);return o.slice(s,j).toLowerCase()}$<j&&function emitText(){var s=o.slice($,j);_(s,$),$=j+1}()}var hA=function hA(o){void 0===o&&(o={}),this.idx=void 0!==o.idx?o.idx:-1,this.type=o.type||\"tag\",this.name=o.name||\"\",this.isOpening=!!o.isOpening,this.isClosing=!!o.isClosing},dA=function(){function Autolinker(o){void 0===o&&(o={}),this.version=Autolinker.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:\"end\"},this.className=\"\",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(o.urls),this.email=\"boolean\"==typeof o.email?o.email:this.email,this.phone=\"boolean\"==typeof o.phone?o.phone:this.phone,this.hashtag=o.hashtag||this.hashtag,this.mention=o.mention||this.mention,this.newWindow=\"boolean\"==typeof o.newWindow?o.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(o.stripPrefix),this.stripTrailingSlash=\"boolean\"==typeof o.stripTrailingSlash?o.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=\"boolean\"==typeof o.decodePercentEncoding?o.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=o.sanitizeHtml||!1;var s=this.mention;if(!1!==s&&-1===[\"twitter\",\"instagram\",\"soundcloud\",\"tiktok\"].indexOf(s))throw new Error(\"invalid `mention` cfg '\".concat(s,\"' - see docs\"));var i=this.hashtag;if(!1!==i&&-1===nA.indexOf(i))throw new Error(\"invalid `hashtag` cfg '\".concat(i,\"' - see docs\"));this.truncate=this.normalizeTruncateCfg(o.truncate),this.className=o.className||this.className,this.replaceFn=o.replaceFn||this.replaceFn,this.context=o.context||this}return Autolinker.link=function(o,s){return new Autolinker(s).link(o)},Autolinker.parse=function(o,s){return new Autolinker(s).parse(o)},Autolinker.prototype.normalizeUrlsCfg=function(o){return null==o&&(o=!0),\"boolean\"==typeof o?{schemeMatches:o,wwwMatches:o,tldMatches:o}:{schemeMatches:\"boolean\"!=typeof o.schemeMatches||o.schemeMatches,wwwMatches:\"boolean\"!=typeof o.wwwMatches||o.wwwMatches,tldMatches:\"boolean\"!=typeof o.tldMatches||o.tldMatches}},Autolinker.prototype.normalizeStripPrefixCfg=function(o){return null==o&&(o=!0),\"boolean\"==typeof o?{scheme:o,www:o}:{scheme:\"boolean\"!=typeof o.scheme||o.scheme,www:\"boolean\"!=typeof o.www||o.www}},Autolinker.prototype.normalizeTruncateCfg=function(o){return\"number\"==typeof o?{length:o,location:\"end\"}:function defaults(o,s){for(var i in s)s.hasOwnProperty(i)&&void 0===o[i]&&(o[i]=s[i]);return o}(o||{},{length:Number.POSITIVE_INFINITY,location:\"end\"})},Autolinker.prototype.parse=function(o){var s=this,i=[\"a\",\"style\",\"script\"],u=0,_=[];return parseHtml(o,{onOpenTag:function(o){i.indexOf(o)>=0&&u++},onText:function(o,i){if(0===u){var w=function splitAndCapture(o,s){if(!s.global)throw new Error(\"`splitRegex` must have the 'g' flag set\");for(var i,u=[],_=0;i=s.exec(o);)u.push(o.substring(_,i.index)),u.push(i[0]),_=i.index+i[0].length;return u.push(o.substring(_)),u}(o,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),x=i;w.forEach((function(o,i){if(i%2==0){var u=s.parseText(o,x);_.push.apply(_,u)}x+=o.length}))}},onCloseTag:function(o){i.indexOf(o)>=0&&(u=Math.max(u-1,0))},onComment:function(o){},onDoctype:function(o){}}),_=this.compactMatches(_),_=this.removeUnwantedMatches(_)},Autolinker.prototype.compactMatches=function(o){o.sort((function(o,s){return o.getOffset()-s.getOffset()}));for(var s=0;s<o.length-1;){var i=o[s],u=i.getOffset(),_=i.getMatchedText().length,w=u+_;if(s+1<o.length){if(o[s+1].getOffset()===u){var x=o[s+1].getMatchedText().length>_?s:s+1;o.splice(x,1);continue}if(o[s+1].getOffset()<w){o.splice(s+1,1);continue}}s++}return o},Autolinker.prototype.removeUnwantedMatches=function(o){return this.hashtag||utils_remove(o,(function(o){return\"hashtag\"===o.getType()})),this.email||utils_remove(o,(function(o){return\"email\"===o.getType()})),this.phone||utils_remove(o,(function(o){return\"phone\"===o.getType()})),this.mention||utils_remove(o,(function(o){return\"mention\"===o.getType()})),this.urls.schemeMatches||utils_remove(o,(function(o){return\"url\"===o.getType()&&\"scheme\"===o.getUrlMatchType()})),this.urls.wwwMatches||utils_remove(o,(function(o){return\"url\"===o.getType()&&\"www\"===o.getUrlMatchType()})),this.urls.tldMatches||utils_remove(o,(function(o){return\"url\"===o.getType()&&\"tld\"===o.getUrlMatchType()})),o},Autolinker.prototype.parseText=function(o,s){void 0===s&&(s=0),s=s||0;for(var i=this.getMatchers(),u=[],_=0,w=i.length;_<w;_++){for(var x=i[_].parseMatches(o),C=0,j=x.length;C<j;C++)x[C].setOffset(s+x[C].getOffset());u.push.apply(u,x)}return u},Autolinker.prototype.link=function(o){if(!o)return\"\";this.sanitizeHtml&&(o=o.replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\"));for(var s=this.parse(o),i=[],u=0,_=0,w=s.length;_<w;_++){var x=s[_];i.push(o.substring(u,x.getOffset())),i.push(this.createMatchReturnVal(x)),u=x.getOffset()+x.getMatchedText().length}return i.push(o.substring(u)),i.join(\"\")},Autolinker.prototype.createMatchReturnVal=function(o){var s;return this.replaceFn&&(s=this.replaceFn.call(this.context,o)),\"string\"==typeof s?s:!1===s?o.getMatchedText():s instanceof EC?s.toAnchorString():o.buildTag().toAnchorString()},Autolinker.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var o=this.getTagBuilder(),s=[new rA({tagBuilder:o,serviceName:this.hashtag}),new GC({tagBuilder:o}),new sA({tagBuilder:o}),new pA({tagBuilder:o,serviceName:this.mention}),new eA({tagBuilder:o,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=s},Autolinker.prototype.getTagBuilder=function(){var o=this.tagBuilder;return o||(o=this.tagBuilder=new wC({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),o},Autolinker.version=\"3.16.2\",Autolinker.AnchorTagBuilder=wC,Autolinker.HtmlTag=EC,Autolinker.matcher={Email:GC,Hashtag:rA,Matcher:PC,Mention:pA,Phone:sA,Url:eA},Autolinker.match={Email:kC,Hashtag:OC,Match:SC,Mention:CC,Phone:AC,Url:jC},Autolinker}();const fA=dA;var mA=/www|@|\\:\\/\\//;function isLinkOpen(o){return/^<a[>\\s]/i.test(o)}function isLinkClose(o){return/^<\\/a\\s*>/i.test(o)}function createLinkifier(){var o=[],s=new fA({stripPrefix:!1,url:!0,email:!0,replaceFn:function(s){switch(s.getType()){case\"url\":o.push({text:s.matchedText,url:s.getUrl()});break;case\"email\":o.push({text:s.matchedText,url:\"mailto:\"+s.getEmail().replace(/^mailto:/i,\"\")})}return!1}});return{links:o,autolinker:s}}function parseTokens(o){var s,i,u,_,w,x,C,j,L,B,$,V,U,z=o.tokens,Y=null;for(i=0,u=z.length;i<u;i++)if(\"inline\"===z[i].type)for($=0,s=(_=z[i].children).length-1;s>=0;s--)if(\"link_close\"!==(w=_[s]).type){if(\"htmltag\"===w.type&&(isLinkOpen(w.content)&&$>0&&$--,isLinkClose(w.content)&&$++),!($>0)&&\"text\"===w.type&&mA.test(w.content)){if(Y||(V=(Y=createLinkifier()).links,U=Y.autolinker),x=w.content,V.length=0,U.link(x),!V.length)continue;for(C=[],B=w.level,j=0;j<V.length;j++)o.inline.validateLink(V[j].url)&&((L=x.indexOf(V[j].text))&&C.push({type:\"text\",content:x.slice(0,L),level:B}),C.push({type:\"link_open\",href:V[j].url,title:\"\",level:B++}),C.push({type:\"text\",content:V[j].text,level:B}),C.push({type:\"link_close\",level:--B}),x=x.slice(L+V[j].text.length));x.length&&C.push({type:\"text\",content:x,level:B}),z[i].children=_=[].concat(_.slice(0,s),C,_.slice(s+1))}}else for(s--;_[s].level!==w.level&&\"link_open\"!==_[s].type;)s--}function linkify(o){o.core.ruler.push(\"linkify\",parseTokens)}var gA=__webpack_require__(42838),yA=__webpack_require__.n(gA);yA().addHook&&yA().addHook(\"beforeSanitizeElements\",(function(o){return o.href&&o.setAttribute(\"rel\",\"noopener noreferrer\"),o}));const vA=function Markdown({source:o,className:s=\"\",getConfigs:i=(()=>({useUnsafeMarkdown:!1}))}){if(\"string\"!=typeof o)return null;const u=new Remarkable({html:!0,typographer:!0,breaks:!0,linkTarget:\"_blank\"}).use(linkify);u.core.ruler.disable([\"replacements\",\"smartquotes\"]);const{useUnsafeMarkdown:_}=i(),w=u.render(o),x=sanitizer(w,{useUnsafeMarkdown:_});return o&&w&&x?Pe.createElement(\"div\",{className:To()(s,\"markdown\"),dangerouslySetInnerHTML:{__html:x}}):null};function sanitizer(o,{useUnsafeMarkdown:s=!1}={}){const i=s,u=s?[]:[\"style\",\"class\"];return s&&!sanitizer.hasWarnedAboutDeprecation&&(console.warn(\"useUnsafeMarkdown display configuration parameter is deprecated since >3.26.0 and will be removed in v4.0.0.\"),sanitizer.hasWarnedAboutDeprecation=!0),yA().sanitize(o,{ADD_ATTR:[\"target\"],FORBID_TAGS:[\"style\",\"form\"],ALLOW_DATA_ATTR:i,FORBID_ATTR:u})}sanitizer.hasWarnedAboutDeprecation=!1;class BaseLayout extends Pe.Component{render(){const{errSelectors:o,specSelectors:s,getComponent:i}=this.props,u=i(\"SvgAssets\"),_=i(\"InfoContainer\",!0),w=i(\"VersionPragmaFilter\"),x=i(\"operations\",!0),C=i(\"Models\",!0),j=i(\"Webhooks\",!0),L=i(\"Row\"),B=i(\"Col\"),$=i(\"errors\",!0),V=i(\"ServersContainer\",!0),U=i(\"SchemesContainer\",!0),z=i(\"AuthorizeBtnContainer\",!0),Y=i(\"FilterContainer\",!0),Z=s.isSwagger2(),ee=s.isOAS3(),ie=s.isOAS31(),ae=!s.specStr(),ce=s.loadingStatus();let le=null;if(\"loading\"===ce&&(le=Pe.createElement(\"div\",{className:\"info\"},Pe.createElement(\"div\",{className:\"loading-container\"},Pe.createElement(\"div\",{className:\"loading\"})))),\"failed\"===ce&&(le=Pe.createElement(\"div\",{className:\"info\"},Pe.createElement(\"div\",{className:\"loading-container\"},Pe.createElement(\"h4\",{className:\"title\"},\"Failed to load API definition.\"),Pe.createElement($,null)))),\"failedConfig\"===ce){const s=o.lastError(),i=s?s.get(\"message\"):\"\";le=Pe.createElement(\"div\",{className:\"info failed-config\"},Pe.createElement(\"div\",{className:\"loading-container\"},Pe.createElement(\"h4\",{className:\"title\"},\"Failed to load remote configuration.\"),Pe.createElement(\"p\",null,i)))}if(!le&&ae&&(le=Pe.createElement(\"h4\",null,\"No API definition provided.\")),le)return Pe.createElement(\"div\",{className:\"swagger-ui\"},Pe.createElement(\"div\",{className:\"loading-container\"},le));const pe=s.servers(),de=s.schemes(),fe=pe&&pe.size,ye=de&&de.size,be=!!s.securityDefinitions();return Pe.createElement(\"div\",{className:\"swagger-ui\"},Pe.createElement(u,null),Pe.createElement(w,{isSwagger2:Z,isOAS3:ee,alsoShow:Pe.createElement($,null)},Pe.createElement($,null),Pe.createElement(L,{className:\"information-container\"},Pe.createElement(B,{mobile:12},Pe.createElement(_,null))),fe||ye||be?Pe.createElement(\"div\",{className:\"scheme-container\"},Pe.createElement(B,{className:\"schemes wrapper\",mobile:12},fe||ye?Pe.createElement(\"div\",{className:\"schemes-server-container\"},fe?Pe.createElement(V,null):null,ye?Pe.createElement(U,null):null):null,be?Pe.createElement(z,null):null)):null,Pe.createElement(Y,null),Pe.createElement(L,null,Pe.createElement(B,{mobile:12,desktop:12},Pe.createElement(x,null))),ie&&Pe.createElement(L,{className:\"webhooks-container\"},Pe.createElement(B,{mobile:12,desktop:12},Pe.createElement(j,null))),Pe.createElement(L,null,Pe.createElement(B,{mobile:12,desktop:12},Pe.createElement(C,null)))))}}const core_components=()=>({components:{App:wO,authorizationPopup:AuthorizationPopup,authorizeBtn:AuthorizeBtn,AuthorizeBtnContainer,authorizeOperationBtn:AuthorizeOperationBtn,auths:Auths,AuthItem:auth_item_Auths,authError:AuthError,oauth2:Oauth2,apiKeyAuth:ApiKeyAuth,basicAuth:BasicAuth,clear:Clear,liveResponse:LiveResponse,InitializedInput,info:IO,InfoContainer,InfoUrl,InfoBasePath,Contact:MO,License:NO,JumpToPath,CopyToClipboardBtn,onlineValidatorBadge:OnlineValidatorBadge,operations:Operations,operation:operation_Operation,OperationSummary,OperationSummaryMethod,OperationSummaryPath,responses:responses_Responses,response:response_Response,ResponseExtension:response_extension,responseBody:ResponseBody,parameters:Parameters,parameterRow:ParameterRow,execute:Execute,headers:headers_Headers,errors:Errors,contentType:ContentType,overview:Overview,footer:Footer,FilterContainer,ParamBody,curl:Curl,Property:property,TryItOutButton,Markdown:vA,BaseLayout,VersionPragmaFilter,VersionStamp:version_stamp,OperationExt:operation_extensions,OperationExtRow:operation_extension_row,ParameterExt:parameter_extension,ParameterIncludeEmpty,OperationTag,OperationContainer,OpenAPIVersion:openapi_version,DeepLink:deep_link,SvgAssets:svg_assets,Example:example_Example,ExamplesSelect,ExamplesSelectValueRetainer}}),form_components=()=>({components:{...ye}}),base=()=>[configsPlugin,util,logs,view,view_legacy,plugins_spec,err,icons,plugins_layout,json_schema_5,json_schema_5_samples,core_components,form_components,swagger_client,auth,downloadUrlPlugin,deep_linking,filter,on_complete,plugins_request_snippets,syntax_highlighting,versions,safe_render()],bA=(0,qe.Map)();function onlyOAS3(o){return(s,i)=>(...u)=>{if(i.getSystem().specSelectors.isOAS3()){const s=o(...u);return\"function\"==typeof s?s(i):s}return s(...u)}}const _A=onlyOAS3(us()(null)),EA=onlyOAS3(((o,s)=>o=>o.getSystem().specSelectors.findSchema(s))),wA=onlyOAS3((()=>o=>{const s=o.getSystem().specSelectors.specJson().getIn([\"components\",\"schemas\"]);return qe.Map.isMap(s)?s:bA})),SA=onlyOAS3((()=>o=>o.getSystem().specSelectors.specJson().hasIn([\"servers\",0]))),xA=onlyOAS3(Wt(bs,(o=>o.getIn([\"components\",\"securitySchemes\"])||null))),wrap_selectors_validOperationMethods=(o,s)=>(i,...u)=>s.specSelectors.isOAS3()?s.oas3Selectors.validOperationMethods():o(...u),kA=_A,OA=_A,CA=_A,AA=_A,jA=_A;const PA=function wrap_selectors_onlyOAS3(o){return(s,i)=>(...u)=>{if(i.getSystem().specSelectors.isOAS3()){let s=i.getState().getIn([\"spec\",\"resolvedSubtrees\",\"components\",\"securitySchemes\"]);return o(i,s,...u)}return s(...u)}}(Wt((o=>o),(({specSelectors:o})=>o.securityDefinitions()),((o,s)=>{let i=(0,qe.List)();return s?(s.entrySeq().forEach((([o,s])=>{const u=s.get(\"type\");if(\"oauth2\"===u&&s.get(\"flows\").entrySeq().forEach((([u,_])=>{let w=(0,qe.fromJS)({flow:u,authorizationUrl:_.get(\"authorizationUrl\"),tokenUrl:_.get(\"tokenUrl\"),scopes:_.get(\"scopes\"),type:s.get(\"type\"),description:s.get(\"description\")});i=i.push(new qe.Map({[o]:w.filter((o=>void 0!==o))}))})),\"http\"!==u&&\"apiKey\"!==u||(i=i.push(new qe.Map({[o]:s}))),\"openIdConnect\"===u&&s.get(\"openIdConnectData\")){let u=s.get(\"openIdConnectData\");(u.get(\"grant_types_supported\")||[\"authorization_code\",\"implicit\"]).forEach((_=>{let w=u.get(\"scopes_supported\")&&u.get(\"scopes_supported\").reduce(((o,s)=>o.set(s,\"\")),new qe.Map),x=(0,qe.fromJS)({flow:_,authorizationUrl:u.get(\"authorization_endpoint\"),tokenUrl:u.get(\"token_endpoint\"),scopes:w,type:\"oauth2\",openIdConnectUrl:s.get(\"openIdConnectUrl\")});i=i.push(new qe.Map({[o]:x.filter((o=>void 0!==o))}))}))}})),i):i})));function OAS3ComponentWrapFactory(o){return(s,i)=>u=>\"function\"==typeof i.specSelectors?.isOAS3?i.specSelectors.isOAS3()?Pe.createElement(o,wo()({},u,i,{Ori:s})):Pe.createElement(s,u):(console.warn(\"OAS3 wrapper: couldn't get spec\"),null)}const IA=(0,qe.Map)(),selectors_isSwagger2=()=>o=>function isSwagger2(o){const s=o.get(\"swagger\");return\"string\"==typeof s&&\"2.0\"===s}(o.getSystem().specSelectors.specJson()),selectors_isOAS30=()=>o=>function isOAS30(o){const s=o.get(\"openapi\");return\"string\"==typeof s&&/^3\\.0\\.([0123])(?:-rc[012])?$/.test(s)}(o.getSystem().specSelectors.specJson()),selectors_isOAS3=()=>o=>o.getSystem().specSelectors.isOAS30();function selectors_onlyOAS3(o){return(s,...i)=>u=>{if(u.specSelectors.isOAS3()){const _=o(s,...i);return\"function\"==typeof _?_(u):_}return null}}const MA=selectors_onlyOAS3((()=>o=>o.specSelectors.specJson().get(\"servers\",IA))),findSchema=(o,s)=>{const i=o.getIn([\"resolvedSubtrees\",\"components\",\"schemas\",s],null),u=o.getIn([\"json\",\"components\",\"schemas\",s],null);return i||u||null},NA=selectors_onlyOAS3(((o,{callbacks:s,specPath:i})=>o=>{const u=o.specSelectors.validOperationMethods();return qe.Map.isMap(s)?s.reduce(((o,s,_)=>{if(!qe.Map.isMap(s))return o;const w=s.reduce(((o,s,w)=>{if(!qe.Map.isMap(s))return o;const x=s.entrySeq().filter((([o])=>u.includes(o))).map((([o,s])=>({operation:(0,qe.Map)({operation:s}),method:o,path:w,callbackName:_,specPath:i.concat([_,w,o])})));return o.concat(x)}),(0,qe.List)());return o.concat(w)}),(0,qe.List)()).groupBy((o=>o.callbackName)).map((o=>o.toArray())).toObject():{}})),callbacks=({callbacks:o,specPath:s,specSelectors:i,getComponent:u})=>{const _=i.callbacksOperations({callbacks:o,specPath:s}),w=Object.keys(_),x=u(\"OperationContainer\",!0);return 0===w.length?Pe.createElement(\"span\",null,\"No callbacks\"):Pe.createElement(\"div\",null,w.map((o=>Pe.createElement(\"div\",{key:`${o}`},Pe.createElement(\"h2\",null,o),_[o].map((s=>Pe.createElement(x,{key:`${o}-${s.path}-${s.method}`,op:s.operation,tag:\"callbacks\",method:s.method,path:s.path,specPath:s.specPath,allowTryItOut:!1})))))))},getDefaultRequestBodyValue=(o,s,i,u)=>{const _=o.getIn([\"content\",s])??(0,qe.OrderedMap)(),w=_.get(\"schema\",(0,qe.OrderedMap)()).toJS(),x=void 0!==_.get(\"examples\"),C=_.get(\"example\"),j=x?_.getIn([\"examples\",i,\"value\"]):C;return stringify(u.getSampleSchema(w,s,{includeWriteOnly:!0},j))},components_request_body=({userHasEditedBody:o,requestBody:s,requestBodyValue:i,requestBodyInclusionSetting:u,requestBodyErrors:_,getComponent:w,getConfigs:x,specSelectors:C,fn:j,contentType:L,isExecute:B,specPath:$,onChange:V,onChangeIncludeEmpty:U,activeExamplesKey:z,updateActiveExamplesKey:Y,setRetainRequestBodyValueFlag:Z})=>{const handleFile=o=>{V(o.target.files[0])},setIsIncludedOptions=o=>{let s={key:o,shouldDispatchInit:!1,defaultValue:!0};return\"no value\"===u.get(o,\"no value\")&&(s.shouldDispatchInit=!0),s},ee=w(\"Markdown\",!0),ie=w(\"modelExample\"),ae=w(\"RequestBodyEditor\"),ce=w(\"HighlightCode\",!0),le=w(\"ExamplesSelectValueRetainer\"),pe=w(\"Example\"),de=w(\"ParameterIncludeEmpty\"),{showCommonExtensions:fe}=x(),ye=s?.get(\"description\")??null,be=s?.get(\"content\")??new qe.OrderedMap;L=L||be.keySeq().first()||\"\";const _e=be.get(L)??(0,qe.OrderedMap)(),we=_e.get(\"schema\",(0,qe.OrderedMap)()),Se=_e.get(\"examples\",null),xe=Se?.map(((o,i)=>{const u=o?.get(\"value\",null);return u&&(o=o.set(\"value\",getDefaultRequestBodyValue(s,L,i,j),u)),o}));if(_=qe.List.isList(_)?_:(0,qe.List)(),!_e.size)return null;const Te=\"object\"===_e.getIn([\"schema\",\"type\"]),Re=\"binary\"===_e.getIn([\"schema\",\"format\"]),$e=\"base64\"===_e.getIn([\"schema\",\"format\"]);if(\"application/octet-stream\"===L||0===L.indexOf(\"image/\")||0===L.indexOf(\"audio/\")||0===L.indexOf(\"video/\")||Re||$e){const o=w(\"Input\");return B?Pe.createElement(o,{type:\"file\",onChange:handleFile}):Pe.createElement(\"i\",null,\"Example values are not available for \",Pe.createElement(\"code\",null,L),\" media types.\")}if(Te&&(\"application/x-www-form-urlencoded\"===L||0===L.indexOf(\"multipart/\"))&&we.get(\"properties\",(0,qe.OrderedMap)()).size>0){const o=w(\"JsonSchemaForm\"),s=w(\"ParameterExt\"),x=we.get(\"properties\",(0,qe.OrderedMap)());return i=qe.Map.isMap(i)?i:(0,qe.OrderedMap)(),Pe.createElement(\"div\",{className:\"table-container\"},ye&&Pe.createElement(ee,{source:ye}),Pe.createElement(\"table\",null,Pe.createElement(\"tbody\",null,qe.Map.isMap(x)&&x.entrySeq().map((([x,C])=>{if(C.get(\"readOnly\"))return;const L=C.get(\"oneOf\")?.get(0)?.toJS(),$=C.get(\"anyOf\")?.get(0)?.toJS();C=(0,qe.fromJS)(j.mergeJsonSchema(C.toJS(),L??$??{}));let z=fe?getCommonExtensions(C):null;const Y=we.get(\"required\",(0,qe.List)()).includes(x),Z=C.get(\"type\"),ie=C.get(\"format\"),ae=C.get(\"description\"),ce=i.getIn([x,\"value\"]),le=i.getIn([x,\"errors\"])||_,pe=u.get(x)||!1;let ye=j.getSampleSchema(C,!1,{includeWriteOnly:!0});!1===ye&&(ye=\"false\"),0===ye&&(ye=\"0\"),\"string\"!=typeof ye&&\"object\"===Z&&(ye=stringify(ye)),\"string\"==typeof ye&&\"array\"===Z&&(ye=JSON.parse(ye));const be=\"string\"===Z&&(\"binary\"===ie||\"base64\"===ie);return Pe.createElement(\"tr\",{key:x,className:\"parameters\",\"data-property-name\":x},Pe.createElement(\"td\",{className:\"parameters-col_name\"},Pe.createElement(\"div\",{className:Y?\"parameter__name required\":\"parameter__name\"},x,Y?Pe.createElement(\"span\",null,\" *\"):null),Pe.createElement(\"div\",{className:\"parameter__type\"},Z,ie&&Pe.createElement(\"span\",{className:\"prop-format\"},\"($\",ie,\")\"),fe&&z.size?z.entrySeq().map((([o,i])=>Pe.createElement(s,{key:`${o}-${i}`,xKey:o,xVal:i}))):null),Pe.createElement(\"div\",{className:\"parameter__deprecated\"},C.get(\"deprecated\")?\"deprecated\":null)),Pe.createElement(\"td\",{className:\"parameters-col_description\"},Pe.createElement(ee,{source:ae}),B?Pe.createElement(\"div\",null,Pe.createElement(o,{fn:j,dispatchInitialValue:!be,schema:C,description:x,getComponent:w,value:void 0===ce?ye:ce,required:Y,errors:le,onChange:o=>{V(o,[x])}}),Y?null:Pe.createElement(de,{onChange:o=>U(x,o),isIncluded:pe,isIncludedOptions:setIsIncludedOptions(x),isDisabled:Array.isArray(ce)?0!==ce.length:!isEmptyValue(ce)})):null))})))))}const ze=getDefaultRequestBodyValue(s,L,z,j);let We=null;return getKnownSyntaxHighlighterLanguage(ze)&&(We=\"json\"),Pe.createElement(\"div\",null,ye&&Pe.createElement(ee,{source:ye}),xe?Pe.createElement(le,{userHasEditedBody:o,examples:xe,currentKey:z,currentUserInputValue:i,onSelect:o=>{Y(o)},updateValue:V,defaultToFirstExample:!0,getComponent:w,setRetainRequestBodyValueFlag:Z}):null,B?Pe.createElement(\"div\",null,Pe.createElement(ae,{value:i,errors:_,defaultValue:ze,onChange:V,getComponent:w})):Pe.createElement(ie,{getComponent:w,getConfigs:x,specSelectors:C,expandDepth:1,isExecute:B,schema:_e.get(\"schema\"),specPath:$.push(\"content\",L),example:Pe.createElement(ce,{className:\"body-param__example\",language:We},stringify(i)||ze),includeWriteOnly:!0}),xe?Pe.createElement(pe,{example:xe.get(z),getComponent:w,getConfigs:x}):null)};class operation_link_OperationLink extends Pe.Component{render(){const{link:o,name:s,getComponent:i}=this.props,u=i(\"Markdown\",!0);let _=o.get(\"operationId\")||o.get(\"operationRef\"),w=o.get(\"parameters\")&&o.get(\"parameters\").toJS(),x=o.get(\"description\");return Pe.createElement(\"div\",{className:\"operation-link\"},Pe.createElement(\"div\",{className:\"description\"},Pe.createElement(\"b\",null,Pe.createElement(\"code\",null,s)),x?Pe.createElement(u,{source:x}):null),Pe.createElement(\"pre\",null,\"Operation `\",_,\"`\",Pe.createElement(\"br\",null),Pe.createElement(\"br\",null),\"Parameters \",function padString(o,s){if(\"string\"!=typeof s)return\"\";return s.split(\"\\n\").map(((s,i)=>i>0?Array(o+1).join(\" \")+s:s)).join(\"\\n\")}(0,JSON.stringify(w,null,2))||\"{}\",Pe.createElement(\"br\",null)))}}const TA=operation_link_OperationLink,components_servers=({servers:o,currentServer:s,setSelectedServer:i,setServerVariableValue:u,getServerVariable:_,getEffectiveServerValue:w})=>{const x=(o.find((o=>o.get(\"url\")===s))||(0,qe.OrderedMap)()).get(\"variables\")||(0,qe.OrderedMap)(),C=0!==x.size;(0,Pe.useEffect)((()=>{s||i(o.first()?.get(\"url\"))}),[]),(0,Pe.useEffect)((()=>{const _=o.find((o=>o.get(\"url\")===s));if(!_)return void i(o.first().get(\"url\"));(_.get(\"variables\")||(0,qe.OrderedMap)()).map(((o,i)=>{u({server:s,key:i,val:o.get(\"default\")||\"\"})}))}),[s,o]);const j=(0,Pe.useCallback)((o=>{i(o.target.value)}),[i]),L=(0,Pe.useCallback)((o=>{const i=o.target.getAttribute(\"data-variable\"),_=o.target.value;u({server:s,key:i,val:_})}),[u,s]);return Pe.createElement(\"div\",{className:\"servers\"},Pe.createElement(\"label\",{htmlFor:\"servers\"},Pe.createElement(\"select\",{onChange:j,value:s,id:\"servers\"},o.valueSeq().map((o=>Pe.createElement(\"option\",{value:o.get(\"url\"),key:o.get(\"url\")},o.get(\"url\"),o.get(\"description\")&&` - ${o.get(\"description\")}`))).toArray())),C&&Pe.createElement(\"div\",null,Pe.createElement(\"div\",{className:\"computed-url\"},\"Computed URL:\",Pe.createElement(\"code\",null,w(s))),Pe.createElement(\"h4\",null,\"Server variables\"),Pe.createElement(\"table\",null,Pe.createElement(\"tbody\",null,x.entrySeq().map((([o,i])=>Pe.createElement(\"tr\",{key:o},Pe.createElement(\"td\",null,o),Pe.createElement(\"td\",null,i.get(\"enum\")?Pe.createElement(\"select\",{\"data-variable\":o,onChange:L},i.get(\"enum\").map((i=>Pe.createElement(\"option\",{selected:i===_(s,o),key:i,value:i},i)))):Pe.createElement(\"input\",{type:\"text\",value:_(s,o)||\"\",onChange:L,\"data-variable\":o})))))))))};class ServersContainer extends Pe.Component{render(){const{specSelectors:o,oas3Selectors:s,oas3Actions:i,getComponent:u}=this.props,_=o.servers(),w=u(\"Servers\");return _&&_.size?Pe.createElement(\"div\",null,Pe.createElement(\"span\",{className:\"servers-title\"},\"Servers\"),Pe.createElement(w,{servers:_,currentServer:s.selectedServer(),setSelectedServer:i.setSelectedServer,setServerVariableValue:i.setServerVariableValue,getServerVariable:s.serverVariableValue,getEffectiveServerValue:s.serverEffectiveValue})):null}}const RA=Function.prototype;class RequestBodyEditor extends Pe.PureComponent{static defaultProps={onChange:RA,userHasEditedBody:!1};constructor(o,s){super(o,s),this.state={value:stringify(o.value)||o.defaultValue},o.onChange(o.value)}applyDefaultValue=o=>{const{onChange:s,defaultValue:i}=o||this.props;return this.setState({value:i}),s(i)};onChange=o=>{this.props.onChange(stringify(o))};onDomChange=o=>{const s=o.target.value;this.setState({value:s},(()=>this.onChange(s)))};UNSAFE_componentWillReceiveProps(o){this.props.value!==o.value&&o.value!==this.state.value&&this.setState({value:stringify(o.value)}),!o.value&&o.defaultValue&&this.state.value&&this.applyDefaultValue(o)}render(){let{getComponent:o,errors:s}=this.props,{value:i}=this.state,u=s.size>0;const _=o(\"TextArea\");return Pe.createElement(\"div\",{className:\"body-param\"},Pe.createElement(_,{className:To()(\"body-param__text\",{invalid:u}),title:s.size?s.join(\", \"):\"\",value:i,onChange:this.onDomChange}))}}class HttpAuth extends Pe.Component{constructor(o,s){super(o,s);let{name:i,schema:u}=this.props,_=this.getValue();this.state={name:i,schema:u,value:_}}getValue(){let{name:o,authorized:s}=this.props;return s&&s.getIn([o,\"value\"])}onChange=o=>{let{onChange:s}=this.props,{value:i,name:u}=o.target,_=Object.assign({},this.state.value);u?_[u]=i:_=i,this.setState({value:_},(()=>s(this.state)))};render(){let{schema:o,getComponent:s,errSelectors:i,name:u}=this.props;const _=s(\"Input\"),w=s(\"Row\"),x=s(\"Col\"),C=s(\"authError\"),j=s(\"Markdown\",!0),L=s(\"JumpToPath\",!0),B=(o.get(\"scheme\")||\"\").toLowerCase();let $=this.getValue(),V=i.allErrors().filter((o=>o.get(\"authId\")===u));if(\"basic\"===B){let s=$?$.get(\"username\"):null;return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,Pe.createElement(\"code\",null,u||o.get(\"name\")),\"  (http, Basic)\",Pe.createElement(L,{path:[\"securityDefinitions\",u]})),s&&Pe.createElement(\"h6\",null,\"Authorized\"),Pe.createElement(w,null,Pe.createElement(j,{source:o.get(\"description\")})),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth-basic-username\"},\"Username:\"),s?Pe.createElement(\"code\",null,\" \",s,\" \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth-basic-username\",type:\"text\",required:\"required\",name:\"username\",\"aria-label\":\"auth-basic-username\",onChange:this.onChange,autoFocus:!0}))),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth-basic-password\"},\"Password:\"),s?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth-basic-password\",autoComplete:\"new-password\",name:\"password\",type:\"password\",\"aria-label\":\"auth-basic-password\",onChange:this.onChange}))),V.valueSeq().map(((o,s)=>Pe.createElement(C,{error:o,key:s}))))}return\"bearer\"===B?Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,Pe.createElement(\"code\",null,u||o.get(\"name\")),\"  (http, Bearer)\",Pe.createElement(L,{path:[\"securityDefinitions\",u]})),$&&Pe.createElement(\"h6\",null,\"Authorized\"),Pe.createElement(w,null,Pe.createElement(j,{source:o.get(\"description\")})),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth-bearer-value\"},\"Value:\"),$?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth-bearer-value\",type:\"text\",\"aria-label\":\"auth-bearer-value\",onChange:this.onChange,autoFocus:!0}))),V.valueSeq().map(((o,s)=>Pe.createElement(C,{error:o,key:s})))):Pe.createElement(\"div\",null,Pe.createElement(\"em\",null,Pe.createElement(\"b\",null,u),\" HTTP authentication: unsupported scheme \",`'${B}'`))}}class operation_servers_OperationServers extends Pe.Component{setSelectedServer=o=>{const{path:s,method:i}=this.props;return this.forceUpdate(),this.props.setSelectedServer(o,`${s}:${i}`)};setServerVariableValue=o=>{const{path:s,method:i}=this.props;return this.forceUpdate(),this.props.setServerVariableValue({...o,namespace:`${s}:${i}`})};getSelectedServer=()=>{const{path:o,method:s}=this.props;return this.props.getSelectedServer(`${o}:${s}`)};getServerVariable=(o,s)=>{const{path:i,method:u}=this.props;return this.props.getServerVariable({namespace:`${i}:${u}`,server:o},s)};getEffectiveServerValue=o=>{const{path:s,method:i}=this.props;return this.props.getEffectiveServerValue({server:o,namespace:`${s}:${i}`})};render(){const{operationServers:o,pathServers:s,getComponent:i}=this.props;if(!o&&!s)return null;const u=i(\"Servers\"),_=o||s,w=o?\"operation\":\"path\";return Pe.createElement(\"div\",{className:\"opblock-section operation-servers\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},Pe.createElement(\"div\",{className:\"tab-header\"},Pe.createElement(\"h4\",{className:\"opblock-title\"},\"Servers\"))),Pe.createElement(\"div\",{className:\"opblock-description-wrapper\"},Pe.createElement(\"h4\",{className:\"message\"},\"These \",w,\"-level options override the global server options.\"),Pe.createElement(u,{servers:_,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}const DA={Callbacks:callbacks,HttpAuth,RequestBody:components_request_body,Servers:components_servers,ServersContainer,RequestBodyEditor,OperationServers:operation_servers_OperationServers,operationLink:TA},LA=new Remarkable(\"commonmark\");LA.block.ruler.enable([\"table\"]),LA.set({linkTarget:\"_blank\"});const BA=OAS3ComponentWrapFactory((({source:o,className:s=\"\",getConfigs:i=(()=>({useUnsafeMarkdown:!1}))})=>{if(\"string\"!=typeof o)return null;if(o){const{useUnsafeMarkdown:u}=i(),_=sanitizer(LA.render(o),{useUnsafeMarkdown:u});let w;return\"string\"==typeof _&&(w=_.trim()),Pe.createElement(\"div\",{dangerouslySetInnerHTML:{__html:w},className:To()(s,\"renderedMarkdown\")})}return null})),FA=OAS3ComponentWrapFactory((({Ori:o,...s})=>{const{schema:i,getComponent:u,errSelectors:_,authorized:w,onAuthChange:x,name:C}=s,j=u(\"HttpAuth\");return\"http\"===i.get(\"type\")?Pe.createElement(j,{key:C,schema:i,name:C,errSelectors:_,authorized:w,getComponent:u,onChange:x}):Pe.createElement(o,s)})),qA=OAS3ComponentWrapFactory(OnlineValidatorBadge);class ModelComponent extends Pe.Component{render(){let{getConfigs:o,schema:s,Ori:i}=this.props,u=[\"model-box\"],_=null;return!0===s.get(\"deprecated\")&&(u.push(\"deprecated\"),_=Pe.createElement(\"span\",{className:\"model-deprecated-warning\"},\"Deprecated:\")),Pe.createElement(\"div\",{className:u.join(\" \")},_,Pe.createElement(i,wo()({},this.props,{getConfigs:o,depth:1,expandDepth:this.props.expandDepth||0})))}}const $A=OAS3ComponentWrapFactory(ModelComponent),VA=OAS3ComponentWrapFactory((({Ori:o,...s})=>{const{schema:i,getComponent:u,errors:_,onChange:w}=s,x=i&&i.get?i.get(\"format\"):null,C=i&&i.get?i.get(\"type\"):null,j=u(\"Input\");return C&&\"string\"===C&&x&&(\"binary\"===x||\"base64\"===x)?Pe.createElement(j,{type:\"file\",className:_.length?\"invalid\":\"\",title:_.length?_:\"\",onChange:o=>{w(o.target.files[0])},disabled:o.isDisabled}):Pe.createElement(o,s)})),UA={Markdown:BA,AuthItem:FA,OpenAPIVersion:function OAS30ComponentWrapFactory(o){return(s,i)=>u=>\"function\"==typeof i.specSelectors?.isOAS30?i.specSelectors.isOAS30()?Pe.createElement(o,wo()({},u,i,{Ori:s})):Pe.createElement(s,u):(console.warn(\"OAS30 wrapper: couldn't get spec\"),null)}((o=>{const{Ori:s}=o;return Pe.createElement(s,{oasVersion:\"3.0\"})})),JsonSchema_string:VA,model:$A,onlineValidatorBadge:qA},zA=\"oas3_set_servers\",WA=\"oas3_set_request_body_value\",KA=\"oas3_set_request_body_retain_flag\",HA=\"oas3_set_request_body_inclusion\",JA=\"oas3_set_active_examples_member\",GA=\"oas3_set_request_content_type\",YA=\"oas3_set_response_content_type\",XA=\"oas3_set_server_variable_value\",QA=\"oas3_set_request_body_validate_error\",ZA=\"oas3_clear_request_body_validate_error\",ej=\"oas3_clear_request_body_value\";function setSelectedServer(o,s){return{type:zA,payload:{selectedServerUrl:o,namespace:s}}}function setRequestBodyValue({value:o,pathMethod:s}){return{type:WA,payload:{value:o,pathMethod:s}}}const setRetainRequestBodyValueFlag=({value:o,pathMethod:s})=>({type:KA,payload:{value:o,pathMethod:s}});function setRequestBodyInclusion({value:o,pathMethod:s,name:i}){return{type:HA,payload:{value:o,pathMethod:s,name:i}}}function setActiveExamplesMember({name:o,pathMethod:s,contextType:i,contextName:u}){return{type:JA,payload:{name:o,pathMethod:s,contextType:i,contextName:u}}}function setRequestContentType({value:o,pathMethod:s}){return{type:GA,payload:{value:o,pathMethod:s}}}function setResponseContentType({value:o,path:s,method:i}){return{type:YA,payload:{value:o,path:s,method:i}}}function setServerVariableValue({server:o,namespace:s,key:i,val:u}){return{type:XA,payload:{server:o,namespace:s,key:i,val:u}}}const setRequestBodyValidateError=({path:o,method:s,validationErrors:i})=>({type:QA,payload:{path:o,method:s,validationErrors:i}}),clearRequestBodyValidateError=({path:o,method:s})=>({type:ZA,payload:{path:o,method:s}}),initRequestBodyValidateError=({pathMethod:o})=>({type:ZA,payload:{path:o[0],method:o[1]}}),clearRequestBodyValue=({pathMethod:o})=>({type:ej,payload:{pathMethod:o}});var fj=__webpack_require__(60680),mj=__webpack_require__.n(fj);const oas3_selectors_onlyOAS3=o=>(s,...i)=>u=>{if(u.getSystem().specSelectors.isOAS3()){const _=o(s,...i);return\"function\"==typeof _?_(u):_}return null};const _j=oas3_selectors_onlyOAS3(((o,s)=>{const i=s?[s,\"selectedServer\"]:[\"selectedServer\"];return o.getIn(i)||\"\"})),Cj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"bodyValue\"])||null)),Aj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"retainBodyValue\"])||!1)),selectDefaultRequestBodyValue=(o,s,i)=>o=>{const{oas3Selectors:u,specSelectors:_,fn:w}=o.getSystem();if(_.isOAS3()){const o=u.requestContentType(s,i);if(o)return getDefaultRequestBodyValue(_.specResolvedSubtree([\"paths\",s,i,\"requestBody\"]),o,u.activeExamplesMember(s,i,\"requestBody\",\"requestBody\"),w)}return null},Nj=oas3_selectors_onlyOAS3(((o,s,i)=>o=>{const{oas3Selectors:u,specSelectors:_,fn:w}=o;let x=!1;const C=u.requestContentType(s,i);let j=u.requestBodyValue(s,i);const L=_.specResolvedSubtree([\"paths\",s,i,\"requestBody\"]);if(!L)return!1;if(qe.Map.isMap(j)&&(j=stringify(j.mapEntries((o=>qe.Map.isMap(o[1])?[o[0],o[1].get(\"value\")]:o)).toJS())),qe.List.isList(j)&&(j=stringify(j)),C){const o=getDefaultRequestBodyValue(L,C,u.activeExamplesMember(s,i,\"requestBody\",\"requestBody\"),w);x=!!j&&j!==o}return x})),Bj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"bodyInclusion\"])||(0,qe.Map)())),$j=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"errors\"])||null)),zj=oas3_selectors_onlyOAS3(((o,s,i,u,_)=>o.getIn([\"examples\",s,i,u,_,\"activeExample\"])||null)),Kj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"requestContentType\"])||null)),Jj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"responseContentType\"])||null)),Gj=oas3_selectors_onlyOAS3(((o,s,i)=>{let u;if(\"string\"!=typeof s){const{server:o,namespace:_}=s;u=_?[_,\"serverVariableValues\",o,i]:[\"serverVariableValues\",o,i]}else{u=[\"serverVariableValues\",s,i]}return o.getIn(u)||null})),Xj=oas3_selectors_onlyOAS3(((o,s)=>{let i;if(\"string\"!=typeof s){const{server:o,namespace:u}=s;i=u?[u,\"serverVariableValues\",o]:[\"serverVariableValues\",o]}else{i=[\"serverVariableValues\",s]}return o.getIn(i)||(0,qe.OrderedMap)()})),eP=oas3_selectors_onlyOAS3(((o,s)=>{var i,u;if(\"string\"!=typeof s){const{server:_,namespace:w}=s;u=_,i=w?o.getIn([w,\"serverVariableValues\",u]):o.getIn([\"serverVariableValues\",u])}else u=s,i=o.getIn([\"serverVariableValues\",u]);i=i||(0,qe.OrderedMap)();let _=u;return i.map(((o,s)=>{_=_.replace(new RegExp(`{${mj()(s)}}`,\"g\"),o)})),_})),tP=function validateRequestBodyIsRequired(o){return(...s)=>i=>{const u=i.getSystem().specSelectors.specJson();let _=[...s][1]||[];return!u.getIn([\"paths\",..._,\"requestBody\",\"required\"])||o(...s)}}(((o,s)=>((o,s)=>(s=s||[],!!o.getIn([\"requestData\",...s,\"bodyValue\"])))(o,s))),validateShallowRequired=(o,{oas3RequiredRequestBodyContentType:s,oas3RequestContentType:i,oas3RequestBodyValue:u})=>{let _=[];if(!qe.Map.isMap(u))return _;let w=[];return Object.keys(s.requestContentType).forEach((o=>{if(o===i){s.requestContentType[o].forEach((o=>{w.indexOf(o)<0&&w.push(o)}))}})),w.forEach((o=>{u.getIn([o,\"value\"])||_.push(o)})),_},rP=us()([\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"]),nP={[zA]:(o,{payload:{selectedServerUrl:s,namespace:i}})=>{const u=i?[i,\"selectedServer\"]:[\"selectedServer\"];return o.setIn(u,s)},[WA]:(o,{payload:{value:s,pathMethod:i}})=>{let[u,_]=i;if(!qe.Map.isMap(s))return o.setIn([\"requestData\",u,_,\"bodyValue\"],s);let w,x=o.getIn([\"requestData\",u,_,\"bodyValue\"])||(0,qe.Map)();qe.Map.isMap(x)||(x=(0,qe.Map)());const[...C]=s.keys();return C.forEach((o=>{let i=s.getIn([o]);x.has(o)&&qe.Map.isMap(i)||(w=x.setIn([o,\"value\"],i))})),o.setIn([\"requestData\",u,_,\"bodyValue\"],w)},[KA]:(o,{payload:{value:s,pathMethod:i}})=>{let[u,_]=i;return o.setIn([\"requestData\",u,_,\"retainBodyValue\"],s)},[HA]:(o,{payload:{value:s,pathMethod:i,name:u}})=>{let[_,w]=i;return o.setIn([\"requestData\",_,w,\"bodyInclusion\",u],s)},[JA]:(o,{payload:{name:s,pathMethod:i,contextType:u,contextName:_}})=>{let[w,x]=i;return o.setIn([\"examples\",w,x,u,_,\"activeExample\"],s)},[GA]:(o,{payload:{value:s,pathMethod:i}})=>{let[u,_]=i;return o.setIn([\"requestData\",u,_,\"requestContentType\"],s)},[YA]:(o,{payload:{value:s,path:i,method:u}})=>o.setIn([\"requestData\",i,u,\"responseContentType\"],s),[XA]:(o,{payload:{server:s,namespace:i,key:u,val:_}})=>{const w=i?[i,\"serverVariableValues\",s,u]:[\"serverVariableValues\",s,u];return o.setIn(w,_)},[QA]:(o,{payload:{path:s,method:i,validationErrors:u}})=>{let _=[];if(_.push(\"Required field is not provided\"),u.missingBodyValue)return o.setIn([\"requestData\",s,i,\"errors\"],(0,qe.fromJS)(_));if(u.missingRequiredKeys&&u.missingRequiredKeys.length>0){const{missingRequiredKeys:w}=u;return o.updateIn([\"requestData\",s,i,\"bodyValue\"],(0,qe.fromJS)({}),(o=>w.reduce(((o,s)=>o.setIn([s,\"errors\"],(0,qe.fromJS)(_))),o)))}return console.warn(\"unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR\"),o},[ZA]:(o,{payload:{path:s,method:i}})=>{const u=o.getIn([\"requestData\",s,i,\"bodyValue\"]);if(!qe.Map.isMap(u))return o.setIn([\"requestData\",s,i,\"errors\"],(0,qe.fromJS)([]));const[..._]=u.keys();return _?o.updateIn([\"requestData\",s,i,\"bodyValue\"],(0,qe.fromJS)({}),(o=>_.reduce(((o,s)=>o.setIn([s,\"errors\"],(0,qe.fromJS)([]))),o))):o},[ej]:(o,{payload:{pathMethod:s}})=>{let[i,u]=s;const _=o.getIn([\"requestData\",i,u,\"bodyValue\"]);return _?qe.Map.isMap(_)?o.setIn([\"requestData\",i,u,\"bodyValue\"],(0,qe.Map)()):o.setIn([\"requestData\",i,u,\"bodyValue\"],\"\"):o}};function oas3(){return{components:DA,wrapComponents:UA,statePlugins:{spec:{wrapSelectors:be,selectors:we},auth:{wrapSelectors:_e},oas3:{actions:{...Se},reducers:nP,selectors:{...xe}}}}}const webhooks=({specSelectors:o,getComponent:s})=>{const i=o.selectWebhooksOperations(),u=Object.keys(i),_=s(\"OperationContainer\",!0);return 0===u.length?null:Pe.createElement(\"div\",{className:\"webhooks\"},Pe.createElement(\"h2\",null,\"Webhooks\"),u.map((o=>Pe.createElement(\"div\",{key:`${o}-webhook`},i[o].map((s=>Pe.createElement(_,{key:`${o}-${s.method}-webhook`,op:s.operation,tag:\"webhooks\",method:s.method,path:o,specPath:(0,qe.List)(s.specPath),allowTryItOut:!1})))))))},oas31_components_license=({getComponent:o,specSelectors:s})=>{const i=s.selectLicenseNameField(),u=s.selectLicenseUrl(),_=o(\"Link\");return Pe.createElement(\"div\",{className:\"info__license\"},u?Pe.createElement(\"div\",{className:\"info__license__url\"},Pe.createElement(_,{target:\"_blank\",href:sanitizeUrl(u)},i)):Pe.createElement(\"span\",null,i))},oas31_components_contact=({getComponent:o,specSelectors:s})=>{const i=s.selectContactNameField(),u=s.selectContactUrl(),_=s.selectContactEmailField(),w=o(\"Link\");return Pe.createElement(\"div\",{className:\"info__contact\"},u&&Pe.createElement(\"div\",null,Pe.createElement(w,{href:sanitizeUrl(u),target:\"_blank\"},i,\" - Website\")),_&&Pe.createElement(w,{href:sanitizeUrl(`mailto:${_}`)},u?`Send email to ${i}`:`Contact ${i}`))},oas31_components_info=({getComponent:o,specSelectors:s})=>{const i=s.version(),u=s.url(),_=s.basePath(),w=s.host(),x=s.selectInfoSummaryField(),C=s.selectInfoDescriptionField(),j=s.selectInfoTitleField(),L=s.selectInfoTermsOfServiceUrl(),B=s.selectExternalDocsUrl(),$=s.selectExternalDocsDescriptionField(),V=s.contact(),U=s.license(),z=o(\"Markdown\",!0),Y=o(\"Link\"),Z=o(\"VersionStamp\"),ee=o(\"OpenAPIVersion\"),ie=o(\"InfoUrl\"),ae=o(\"InfoBasePath\"),ce=o(\"License\",!0),le=o(\"Contact\",!0),pe=o(\"JsonSchemaDialect\",!0);return Pe.createElement(\"div\",{className:\"info\"},Pe.createElement(\"hgroup\",{className:\"main\"},Pe.createElement(\"h2\",{className:\"title\"},j,Pe.createElement(\"span\",null,i&&Pe.createElement(Z,{version:i}),Pe.createElement(ee,{oasVersion:\"3.1\"}))),(w||_)&&Pe.createElement(ae,{host:w,basePath:_}),u&&Pe.createElement(ie,{getComponent:o,url:u})),x&&Pe.createElement(\"p\",{className:\"info__summary\"},x),Pe.createElement(\"div\",{className:\"info__description description\"},Pe.createElement(z,{source:C})),L&&Pe.createElement(\"div\",{className:\"info__tos\"},Pe.createElement(Y,{target:\"_blank\",href:sanitizeUrl(L)},\"Terms of service\")),V.size>0&&Pe.createElement(le,null),U.size>0&&Pe.createElement(ce,null),B&&Pe.createElement(Y,{className:\"info__extdocs\",target:\"_blank\",href:sanitizeUrl(B)},$||B),Pe.createElement(pe,null))},json_schema_dialect=({getComponent:o,specSelectors:s})=>{const i=s.selectJsonSchemaDialectField(),u=s.selectJsonSchemaDialectDefault(),_=o(\"Link\");return Pe.createElement(Pe.Fragment,null,i&&i===u&&Pe.createElement(\"p\",{className:\"info__jsonschemadialect\"},\"JSON Schema dialect:\",\" \",Pe.createElement(_,{target:\"_blank\",href:sanitizeUrl(i)},i)),i&&i!==u&&Pe.createElement(\"div\",{className:\"error-wrapper\"},Pe.createElement(\"div\",{className:\"no-margin\"},Pe.createElement(\"div\",{className:\"errors\"},Pe.createElement(\"div\",{className:\"errors-wrapper\"},Pe.createElement(\"h4\",{className:\"center\"},\"Warning\"),Pe.createElement(\"p\",{className:\"message\"},Pe.createElement(\"strong\",null,\"OpenAPI.jsonSchemaDialect\"),\" field contains a value different from the default value of\",\" \",Pe.createElement(_,{target:\"_blank\",href:u},u),\". Values different from the default one are currently not supported. Please either omit the field or provide it with the default value.\"))))))},version_pragma_filter=({bypass:o,isSwagger2:s,isOAS3:i,isOAS31:u,alsoShow:_,children:w})=>o?Pe.createElement(\"div\",null,w):s&&(i||u)?Pe.createElement(\"div\",{className:\"version-pragma\"},_,Pe.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--ambiguous\"},Pe.createElement(\"div\",null,Pe.createElement(\"h3\",null,\"Unable to render this definition\"),Pe.createElement(\"p\",null,Pe.createElement(\"code\",null,\"swagger\"),\" and \",Pe.createElement(\"code\",null,\"openapi\"),\" fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields.\"),Pe.createElement(\"p\",null,\"Supported version fields are \",Pe.createElement(\"code\",null,'swagger: \"2.0\"'),\" and those that match \",Pe.createElement(\"code\",null,\"openapi: 3.x.y\"),\" (for example,\",\" \",Pe.createElement(\"code\",null,\"openapi: 3.1.0\"),\").\")))):s||i||u?Pe.createElement(\"div\",null,w):Pe.createElement(\"div\",{className:\"version-pragma\"},_,Pe.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--missing\"},Pe.createElement(\"div\",null,Pe.createElement(\"h3\",null,\"Unable to render this definition\"),Pe.createElement(\"p\",null,\"The provided definition does not specify a valid version field.\"),Pe.createElement(\"p\",null,\"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are \",Pe.createElement(\"code\",null,'swagger: \"2.0\"'),\" and those that match \",Pe.createElement(\"code\",null,\"openapi: 3.x.y\"),\" (for example,\",\" \",Pe.createElement(\"code\",null,\"openapi: 3.1.0\"),\").\")))),getModelName=o=>\"string\"==typeof o&&o.includes(\"#/components/schemas/\")?(o=>{const s=o.replace(/~1/g,\"/\").replace(/~0/g,\"~\");try{return decodeURIComponent(s)}catch{return s}})(o.replace(/^.*#\\/components\\/schemas\\//,\"\")):null,oP=(0,Pe.forwardRef)((({schema:o,getComponent:s,onToggle:i=(()=>{})},u)=>{const _=s(\"JSONSchema202012\"),w=getModelName(o.get(\"$$ref\")),x=(0,Pe.useCallback)(((o,s)=>{i(w,s)}),[w,i]);return Pe.createElement(_,{name:w,schema:o.toJS(),ref:u,onExpand:x})})),sP=oP,models=({specActions:o,specSelectors:s,layoutSelectors:i,layoutActions:u,getComponent:_,getConfigs:w,fn:x})=>{const C=s.selectSchemas(),j=Object.keys(C).length>0,L=[\"components\",\"schemas\"],{docExpansion:B,defaultModelsExpandDepth:$}=w(),V=$>0&&\"none\"!==B,U=i.isShown(L,V),z=_(\"Collapse\"),Y=_(\"JSONSchema202012\"),Z=_(\"ArrowUpIcon\"),ee=_(\"ArrowDownIcon\"),{getTitle:ie}=x.jsonSchema202012.useFn();(0,Pe.useEffect)((()=>{const i=U&&$>1,u=null!=s.specResolvedSubtree(L);i&&!u&&o.requestResolvedSubtree(L)}),[U,$]);const ae=(0,Pe.useCallback)((()=>{u.show(L,!U)}),[U]),ce=(0,Pe.useCallback)((o=>{null!==o&&u.readyToScroll(L,o)}),[]),handleJSONSchema202012Ref=o=>s=>{null!==s&&u.readyToScroll([...L,o],s)},handleJSONSchema202012Expand=i=>(u,_)=>{if(_){const u=[...L,i];null!=s.specResolvedSubtree(u)||o.requestResolvedSubtree([...L,i])}};return!j||$<0?null:Pe.createElement(\"section\",{className:To()(\"models\",{\"is-open\":U}),ref:ce},Pe.createElement(\"h4\",null,Pe.createElement(\"button\",{\"aria-expanded\":U,className:\"models-control\",onClick:ae},Pe.createElement(\"span\",null,\"Schemas\"),U?Pe.createElement(Z,null):Pe.createElement(ee,null))),Pe.createElement(z,{isOpened:U},Object.entries(C).map((([o,s])=>{const i=ie(s,{lookup:\"basic\"})||o;return Pe.createElement(Y,{key:o,ref:handleJSONSchema202012Ref(o),schema:s,name:i,onExpand:handleJSONSchema202012Expand(o)})}))))},mutual_tls_auth=({schema:o,getComponent:s})=>{const i=s(\"JumpToPath\",!0);return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,o.get(\"name\"),\" (mutualTLS)\",\" \",Pe.createElement(i,{path:[\"securityDefinitions\",o.get(\"name\")]})),Pe.createElement(\"p\",null,\"Mutual TLS is required by this API/Operation. Certificates are managed via your Operating System and/or your browser.\"),Pe.createElement(\"p\",null,o.get(\"description\")))};class auths_Auths extends Pe.Component{constructor(o,s){super(o,s),this.state={}}onAuthChange=o=>{let{name:s}=o;this.setState({[s]:o})};submitAuth=o=>{o.preventDefault();let{authActions:s}=this.props;s.authorizeWithPersistOption(this.state)};logoutClick=o=>{o.preventDefault();let{authActions:s,definitions:i}=this.props,u=i.map(((o,s)=>s)).toArray();this.setState(u.reduce(((o,s)=>(o[s]=\"\",o)),{})),s.logoutWithPersistOption(u)};close=o=>{o.preventDefault();let{authActions:s}=this.props;s.showDefinitions(!1)};render(){let{definitions:o,getComponent:s,authSelectors:i,errSelectors:u}=this.props;const _=s(\"AuthItem\"),w=s(\"oauth2\",!0),x=s(\"Button\"),C=i.authorized(),j=o.filter(((o,s)=>!!C.get(s))),L=o.filter((o=>\"oauth2\"!==o.get(\"type\")&&\"mutualTLS\"!==o.get(\"type\"))),B=o.filter((o=>\"oauth2\"===o.get(\"type\"))),$=o.filter((o=>\"mutualTLS\"===o.get(\"type\")));return Pe.createElement(\"div\",{className:\"auth-container\"},L.size>0&&Pe.createElement(\"form\",{onSubmit:this.submitAuth},L.map(((o,i)=>Pe.createElement(_,{key:i,schema:o,name:i,getComponent:s,onAuthChange:this.onAuthChange,authorized:C,errSelectors:u}))).toArray(),Pe.createElement(\"div\",{className:\"auth-btn-wrapper\"},L.size===j.size?Pe.createElement(x,{className:\"btn modal-btn auth\",onClick:this.logoutClick,\"aria-label\":\"Remove authorization\"},\"Logout\"):Pe.createElement(x,{type:\"submit\",className:\"btn modal-btn auth authorize\",\"aria-label\":\"Apply credentials\"},\"Authorize\"),Pe.createElement(x,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\"))),B.size>0?Pe.createElement(\"div\",null,Pe.createElement(\"div\",{className:\"scope-def\"},Pe.createElement(\"p\",null,\"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\"),Pe.createElement(\"p\",null,\"API requires the following scopes. Select which ones you want to grant to Swagger UI.\")),o.filter((o=>\"oauth2\"===o.get(\"type\"))).map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(w,{authorized:C,schema:o,name:s})))).toArray()):null,$.size>0&&Pe.createElement(\"div\",null,$.map(((o,i)=>Pe.createElement(_,{key:i,schema:o,name:i,getComponent:s,onAuthChange:this.onAuthChange,authorized:C,errSelectors:u}))).toArray()))}}const iP=auths_Auths,isOAS31=o=>{const s=o.get(\"openapi\");return\"string\"==typeof s&&/^3\\.1\\.(?:[1-9]\\d*|0)$/.test(s)},fn_createOnlyOAS31Selector=o=>(s,...i)=>u=>{if(u.getSystem().specSelectors.isOAS31()){const _=o(s,...i);return\"function\"==typeof _?_(u):_}return null},createOnlyOAS31SelectorWrapper=o=>(s,i)=>(u,..._)=>{if(i.getSystem().specSelectors.isOAS31()){const w=o(u,..._);return\"function\"==typeof w?w(s,i):w}return s(..._)},fn_createSystemSelector=o=>(s,...i)=>u=>{const _=o(s,u,...i);return\"function\"==typeof _?_(u):_},createOnlyOAS31ComponentWrapper=o=>(s,i)=>u=>i.specSelectors.isOAS31()?Pe.createElement(o,wo()({},u,{originalComponent:s,getSystem:i.getSystem})):Pe.createElement(s,u),aP=createOnlyOAS31ComponentWrapper((({getSystem:o})=>{const s=o().getComponent(\"OAS31License\",!0);return Pe.createElement(s,null)})),cP=createOnlyOAS31ComponentWrapper((({getSystem:o})=>{const s=o().getComponent(\"OAS31Contact\",!0);return Pe.createElement(s,null)})),lP=createOnlyOAS31ComponentWrapper((({getSystem:o})=>{const s=o().getComponent(\"OAS31Info\",!0);return Pe.createElement(s,null)})),uP=createOnlyOAS31ComponentWrapper((({getSystem:o,...s})=>{const i=o(),{getComponent:u,fn:_,getConfigs:w}=i,x=w(),C=u(\"OAS31Model\"),j=u(\"JSONSchema202012\"),L=u(\"JSONSchema202012Keyword$schema\"),B=u(\"JSONSchema202012Keyword$vocabulary\"),$=u(\"JSONSchema202012Keyword$id\"),V=u(\"JSONSchema202012Keyword$anchor\"),U=u(\"JSONSchema202012Keyword$dynamicAnchor\"),z=u(\"JSONSchema202012Keyword$ref\"),Y=u(\"JSONSchema202012Keyword$dynamicRef\"),Z=u(\"JSONSchema202012Keyword$defs\"),ee=u(\"JSONSchema202012Keyword$comment\"),ie=u(\"JSONSchema202012KeywordAllOf\"),ae=u(\"JSONSchema202012KeywordAnyOf\"),ce=u(\"JSONSchema202012KeywordOneOf\"),le=u(\"JSONSchema202012KeywordNot\"),pe=u(\"JSONSchema202012KeywordIf\"),de=u(\"JSONSchema202012KeywordThen\"),fe=u(\"JSONSchema202012KeywordElse\"),ye=u(\"JSONSchema202012KeywordDependentSchemas\"),be=u(\"JSONSchema202012KeywordPrefixItems\"),_e=u(\"JSONSchema202012KeywordItems\"),we=u(\"JSONSchema202012KeywordContains\"),Se=u(\"JSONSchema202012KeywordProperties\"),xe=u(\"JSONSchema202012KeywordPatternProperties\"),Te=u(\"JSONSchema202012KeywordAdditionalProperties\"),Re=u(\"JSONSchema202012KeywordPropertyNames\"),qe=u(\"JSONSchema202012KeywordUnevaluatedItems\"),$e=u(\"JSONSchema202012KeywordUnevaluatedProperties\"),ze=u(\"JSONSchema202012KeywordType\"),We=u(\"JSONSchema202012KeywordEnum\"),He=u(\"JSONSchema202012KeywordConst\"),Ye=u(\"JSONSchema202012KeywordConstraint\"),Xe=u(\"JSONSchema202012KeywordDependentRequired\"),Qe=u(\"JSONSchema202012KeywordContentSchema\"),et=u(\"JSONSchema202012KeywordTitle\"),tt=u(\"JSONSchema202012KeywordDescription\"),rt=u(\"JSONSchema202012KeywordDefault\"),nt=u(\"JSONSchema202012KeywordDeprecated\"),ot=u(\"JSONSchema202012KeywordReadOnly\"),st=u(\"JSONSchema202012KeywordWriteOnly\"),it=u(\"JSONSchema202012Accordion\"),at=u(\"JSONSchema202012ExpandDeepButton\"),ct=u(\"JSONSchema202012ChevronRightIcon\"),lt=u(\"withJSONSchema202012Context\")(C,{config:{default$schema:\"https://spec.openapis.org/oas/3.1/dialect/base\",defaultExpandedLevels:x.defaultModelExpandDepth,includeReadOnly:Boolean(s.includeReadOnly),includeWriteOnly:Boolean(s.includeWriteOnly)},components:{JSONSchema:j,Keyword$schema:L,Keyword$vocabulary:B,Keyword$id:$,Keyword$anchor:V,Keyword$dynamicAnchor:U,Keyword$ref:z,Keyword$dynamicRef:Y,Keyword$defs:Z,Keyword$comment:ee,KeywordAllOf:ie,KeywordAnyOf:ae,KeywordOneOf:ce,KeywordNot:le,KeywordIf:pe,KeywordThen:de,KeywordElse:fe,KeywordDependentSchemas:ye,KeywordPrefixItems:be,KeywordItems:_e,KeywordContains:we,KeywordProperties:Se,KeywordPatternProperties:xe,KeywordAdditionalProperties:Te,KeywordPropertyNames:Re,KeywordUnevaluatedItems:qe,KeywordUnevaluatedProperties:$e,KeywordType:ze,KeywordEnum:We,KeywordConst:He,KeywordConstraint:Ye,KeywordDependentRequired:Xe,KeywordContentSchema:Qe,KeywordTitle:et,KeywordDescription:tt,KeywordDefault:rt,KeywordDeprecated:nt,KeywordReadOnly:ot,KeywordWriteOnly:st,Accordion:it,ExpandDeepButton:at,ChevronRightIcon:ct},fn:{upperFirst:_.upperFirst,isExpandable:_.jsonSchema202012.isExpandable,getProperties:_.jsonSchema202012.getProperties}});return Pe.createElement(lt,s)})),pP=uP,hP=createOnlyOAS31ComponentWrapper((({getSystem:o})=>{const{getComponent:s,fn:i,getConfigs:u}=o(),_=u();if(hP.ModelsWithJSONSchemaContext)return Pe.createElement(hP.ModelsWithJSONSchemaContext,null);const w=s(\"OAS31Models\",!0),x=s(\"JSONSchema202012\"),C=s(\"JSONSchema202012Keyword$schema\"),j=s(\"JSONSchema202012Keyword$vocabulary\"),L=s(\"JSONSchema202012Keyword$id\"),B=s(\"JSONSchema202012Keyword$anchor\"),$=s(\"JSONSchema202012Keyword$dynamicAnchor\"),V=s(\"JSONSchema202012Keyword$ref\"),U=s(\"JSONSchema202012Keyword$dynamicRef\"),z=s(\"JSONSchema202012Keyword$defs\"),Y=s(\"JSONSchema202012Keyword$comment\"),Z=s(\"JSONSchema202012KeywordAllOf\"),ee=s(\"JSONSchema202012KeywordAnyOf\"),ie=s(\"JSONSchema202012KeywordOneOf\"),ae=s(\"JSONSchema202012KeywordNot\"),ce=s(\"JSONSchema202012KeywordIf\"),le=s(\"JSONSchema202012KeywordThen\"),pe=s(\"JSONSchema202012KeywordElse\"),de=s(\"JSONSchema202012KeywordDependentSchemas\"),fe=s(\"JSONSchema202012KeywordPrefixItems\"),ye=s(\"JSONSchema202012KeywordItems\"),be=s(\"JSONSchema202012KeywordContains\"),_e=s(\"JSONSchema202012KeywordProperties\"),we=s(\"JSONSchema202012KeywordPatternProperties\"),Se=s(\"JSONSchema202012KeywordAdditionalProperties\"),xe=s(\"JSONSchema202012KeywordPropertyNames\"),Te=s(\"JSONSchema202012KeywordUnevaluatedItems\"),Re=s(\"JSONSchema202012KeywordUnevaluatedProperties\"),qe=s(\"JSONSchema202012KeywordType\"),$e=s(\"JSONSchema202012KeywordEnum\"),ze=s(\"JSONSchema202012KeywordConst\"),We=s(\"JSONSchema202012KeywordConstraint\"),He=s(\"JSONSchema202012KeywordDependentRequired\"),Ye=s(\"JSONSchema202012KeywordContentSchema\"),Xe=s(\"JSONSchema202012KeywordTitle\"),Qe=s(\"JSONSchema202012KeywordDescription\"),et=s(\"JSONSchema202012KeywordDefault\"),tt=s(\"JSONSchema202012KeywordDeprecated\"),rt=s(\"JSONSchema202012KeywordReadOnly\"),nt=s(\"JSONSchema202012KeywordWriteOnly\"),ot=s(\"JSONSchema202012Accordion\"),st=s(\"JSONSchema202012ExpandDeepButton\"),it=s(\"JSONSchema202012ChevronRightIcon\"),at=s(\"withJSONSchema202012Context\");return hP.ModelsWithJSONSchemaContext=at(w,{config:{default$schema:\"https://spec.openapis.org/oas/3.1/dialect/base\",defaultExpandedLevels:_.defaultModelsExpandDepth-1,includeReadOnly:!0,includeWriteOnly:!0},components:{JSONSchema:x,Keyword$schema:C,Keyword$vocabulary:j,Keyword$id:L,Keyword$anchor:B,Keyword$dynamicAnchor:$,Keyword$ref:V,Keyword$dynamicRef:U,Keyword$defs:z,Keyword$comment:Y,KeywordAllOf:Z,KeywordAnyOf:ee,KeywordOneOf:ie,KeywordNot:ae,KeywordIf:ce,KeywordThen:le,KeywordElse:pe,KeywordDependentSchemas:de,KeywordPrefixItems:fe,KeywordItems:ye,KeywordContains:be,KeywordProperties:_e,KeywordPatternProperties:we,KeywordAdditionalProperties:Se,KeywordPropertyNames:xe,KeywordUnevaluatedItems:Te,KeywordUnevaluatedProperties:Re,KeywordType:qe,KeywordEnum:$e,KeywordConst:ze,KeywordConstraint:We,KeywordDependentRequired:He,KeywordContentSchema:Ye,KeywordTitle:Xe,KeywordDescription:Qe,KeywordDefault:et,KeywordDeprecated:tt,KeywordReadOnly:rt,KeywordWriteOnly:nt,Accordion:ot,ExpandDeepButton:st,ChevronRightIcon:it},fn:{upperFirst:i.upperFirst,isExpandable:i.jsonSchema202012.isExpandable,getProperties:i.jsonSchema202012.getProperties}}),Pe.createElement(hP.ModelsWithJSONSchemaContext,null)}));hP.ModelsWithJSONSchemaContext=null;const dP=hP,wrap_components_version_pragma_filter=(o,s)=>o=>{const i=s.specSelectors.isOAS31(),u=s.getComponent(\"OAS31VersionPragmaFilter\");return Pe.createElement(u,wo()({isOAS31:i},o))},fP=createOnlyOAS31ComponentWrapper((({originalComponent:o,...s})=>{const{getComponent:i,schema:u}=s,_=i(\"MutualTLSAuth\",!0);return\"mutualTLS\"===u.get(\"type\")?Pe.createElement(_,{schema:u}):Pe.createElement(o,s)})),mP=fP,gP=createOnlyOAS31ComponentWrapper((({getSystem:o,...s})=>{const i=o().getComponent(\"OAS31Auths\",!0);return Pe.createElement(i,s)})),yP=(0,qe.Map)(),vP=Wt(((o,s)=>s.specSelectors.specJson()),isOAS31),selectors_webhooks=()=>o=>{const s=o.specSelectors.specJson().get(\"webhooks\");return qe.Map.isMap(s)?s:yP},bP=Wt([(o,s)=>s.specSelectors.webhooks(),(o,s)=>s.specSelectors.validOperationMethods(),(o,s)=>s.specSelectors.specResolvedSubtree([\"webhooks\"])],((o,s)=>o.reduce(((o,i,u)=>{if(!qe.Map.isMap(i))return o;const _=i.entrySeq().filter((([o])=>s.includes(o))).map((([o,s])=>({operation:(0,qe.Map)({operation:s}),method:o,path:u,specPath:[\"webhooks\",u,o]})));return o.concat(_)}),(0,qe.List)()).groupBy((o=>o.path)).map((o=>o.toArray())).toObject())),selectors_license=()=>o=>{const s=o.specSelectors.info().get(\"license\");return qe.Map.isMap(s)?s:yP},selectLicenseNameField=()=>o=>o.specSelectors.license().get(\"name\",\"License\"),selectLicenseUrlField=()=>o=>o.specSelectors.license().get(\"url\"),_P=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectLicenseUrlField()],((o,s,i)=>{if(i)return safeBuildUrl(i,o,{selectedServer:s})})),selectLicenseIdentifierField=()=>o=>o.specSelectors.license().get(\"identifier\"),selectors_contact=()=>o=>{const s=o.specSelectors.info().get(\"contact\");return qe.Map.isMap(s)?s:yP},selectContactNameField=()=>o=>o.specSelectors.contact().get(\"name\",\"the developer\"),selectContactEmailField=()=>o=>o.specSelectors.contact().get(\"email\"),selectContactUrlField=()=>o=>o.specSelectors.contact().get(\"url\"),EP=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectContactUrlField()],((o,s,i)=>{if(i)return safeBuildUrl(i,o,{selectedServer:s})})),selectInfoTitleField=()=>o=>o.specSelectors.info().get(\"title\"),selectInfoSummaryField=()=>o=>o.specSelectors.info().get(\"summary\"),selectInfoDescriptionField=()=>o=>o.specSelectors.info().get(\"description\"),selectInfoTermsOfServiceField=()=>o=>o.specSelectors.info().get(\"termsOfService\"),wP=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectInfoTermsOfServiceField()],((o,s,i)=>{if(i)return safeBuildUrl(i,o,{selectedServer:s})})),selectExternalDocsDescriptionField=()=>o=>o.specSelectors.externalDocs().get(\"description\"),selectExternalDocsUrlField=()=>o=>o.specSelectors.externalDocs().get(\"url\"),SP=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectExternalDocsUrlField()],((o,s,i)=>{if(i)return safeBuildUrl(i,o,{selectedServer:s})})),selectJsonSchemaDialectField=()=>o=>o.specSelectors.specJson().get(\"jsonSchemaDialect\"),selectJsonSchemaDialectDefault=()=>\"https://spec.openapis.org/oas/3.1/dialect/base\",xP=Wt(((o,s)=>s.specSelectors.definitions()),((o,s)=>s.specSelectors.specResolvedSubtree([\"components\",\"schemas\"])),((o,s)=>qe.Map.isMap(o)?qe.Map.isMap(s)?Object.entries(o.toJS()).reduce(((o,[i,u])=>{const _=s.get(i);return o[i]=_?.toJS()||u,o}),{}):o.toJS():{})),wrap_selectors_isOAS3=(o,s)=>(i,...u)=>s.specSelectors.isOAS31()||o(...u),kP=createOnlyOAS31SelectorWrapper((()=>(o,s)=>s.oas31Selectors.selectLicenseUrl())),OP=createOnlyOAS31SelectorWrapper((()=>(o,s)=>{const i=s.specSelectors.securityDefinitions();let u=o();return i?(i.entrySeq().forEach((([o,s])=>{\"mutualTLS\"===s.get(\"type\")&&(u=u.push(new qe.Map({[o]:s})))})),u):u})),CP=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectLicenseUrlField(),(o,s)=>s.specSelectors.selectLicenseIdentifierField()],((o,s,i,u)=>i?safeBuildUrl(i,o,{selectedServer:s}):u?`https://spdx.org/licenses/${u}.html`:void 0)),keywords_Example=({schema:o,getSystem:s})=>{const{fn:i}=s(),{hasKeyword:u,stringify:_}=i.jsonSchema202012.useFn();return u(o,\"example\")?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--example\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Example\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},_(o.example))):null},keywords_Xml=({schema:o,getSystem:s})=>{const i=o?.xml||{},{fn:u,getComponent:_}=s(),{useIsExpandedDeeply:w,useComponent:x}=u.jsonSchema202012,C=w(),j=!!(i.name||i.namespace||i.prefix),[L,B]=(0,Pe.useState)(C),[$,V]=(0,Pe.useState)(!1),U=x(\"Accordion\"),z=x(\"ExpandDeepButton\"),Y=_(\"JSONSchema202012DeepExpansionContext\")(),Z=(0,Pe.useCallback)((()=>{B((o=>!o))}),[]),ee=(0,Pe.useCallback)(((o,s)=>{B(s),V(s)}),[]);return 0===Object.keys(i).length?null:Pe.createElement(Y.Provider,{value:$},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--xml\"},j?Pe.createElement(Pe.Fragment,null,Pe.createElement(U,{expanded:L,onChange:Z},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"XML\")),Pe.createElement(z,{expanded:L,onClick:ee})):Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"XML\"),!0===i.attribute&&Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"attribute\"),!0===i.wrapped&&Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"wrapped\"),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!L})},L&&Pe.createElement(Pe.Fragment,null,i.name&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"name\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},i.name))),i.namespace&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"namespace\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},i.namespace))),i.prefix&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"prefix\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},i.prefix)))))))},Discriminator_DiscriminatorMapping=({discriminator:o})=>{const s=o?.mapping||{};return 0===Object.keys(s).length?null:Object.entries(s).map((([o,s])=>Pe.createElement(\"div\",{key:`${o}-${s}`,className:\"json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},o),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},s))))},keywords_Discriminator_Discriminator=({schema:o,getSystem:s})=>{const i=o?.discriminator||{},{fn:u,getComponent:_}=s(),{useIsExpandedDeeply:w,useComponent:x}=u.jsonSchema202012,C=w(),j=!!i.mapping,[L,B]=(0,Pe.useState)(C),[$,V]=(0,Pe.useState)(!1),U=x(\"Accordion\"),z=x(\"ExpandDeepButton\"),Y=_(\"JSONSchema202012DeepExpansionContext\")(),Z=(0,Pe.useCallback)((()=>{B((o=>!o))}),[]),ee=(0,Pe.useCallback)(((o,s)=>{B(s),V(s)}),[]);return 0===Object.keys(i).length?null:Pe.createElement(Y.Provider,{value:$},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--discriminator\"},j?Pe.createElement(Pe.Fragment,null,Pe.createElement(U,{expanded:L,onChange:Z},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Discriminator\")),Pe.createElement(z,{expanded:L,onClick:ee})):Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Discriminator\"),i.propertyName&&Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},i.propertyName),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!L})},L&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(Discriminator_DiscriminatorMapping,{discriminator:i})))))},keywords_ExternalDocs=({schema:o,getSystem:s})=>{const i=o?.externalDocs||{},{fn:u,getComponent:_}=s(),{useIsExpandedDeeply:w,useComponent:x}=u.jsonSchema202012,C=w(),j=!(!i.description&&!i.url),[L,B]=(0,Pe.useState)(C),[$,V]=(0,Pe.useState)(!1),U=x(\"Accordion\"),z=x(\"ExpandDeepButton\"),Y=_(\"JSONSchema202012KeywordDescription\"),Z=_(\"Link\"),ee=_(\"JSONSchema202012DeepExpansionContext\")(),ie=(0,Pe.useCallback)((()=>{B((o=>!o))}),[]),ae=(0,Pe.useCallback)(((o,s)=>{B(s),V(s)}),[]);return 0===Object.keys(i).length?null:Pe.createElement(ee.Provider,{value:$},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--externalDocs\"},j?Pe.createElement(Pe.Fragment,null,Pe.createElement(U,{expanded:L,onChange:ie},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"External documentation\")),Pe.createElement(z,{expanded:L,onClick:ae})):Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"External documentation\"),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!L})},L&&Pe.createElement(Pe.Fragment,null,i.description&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(Y,{schema:i,getSystem:s})),i.url&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"url\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},Pe.createElement(Z,{target:\"_blank\",href:sanitizeUrl(i.url)},i.url))))))))},keywords_Description=({schema:o,getSystem:s})=>{if(!o?.description)return null;const{getComponent:i}=s(),u=i(\"Markdown\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--description\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary\"},Pe.createElement(u,{source:o.description})))},AP=createOnlyOAS31ComponentWrapper(keywords_Description),jP=createOnlyOAS31ComponentWrapper((({schema:o,getSystem:s,originalComponent:i})=>{const{getComponent:u}=s(),_=u(\"JSONSchema202012KeywordDiscriminator\"),w=u(\"JSONSchema202012KeywordXml\"),x=u(\"JSONSchema202012KeywordExample\"),C=u(\"JSONSchema202012KeywordExternalDocs\");return Pe.createElement(Pe.Fragment,null,Pe.createElement(i,{schema:o}),Pe.createElement(_,{schema:o,getSystem:s}),Pe.createElement(w,{schema:o,getSystem:s}),Pe.createElement(C,{schema:o,getSystem:s}),Pe.createElement(x,{schema:o,getSystem:s}))})),PP=jP,keywords_Properties=({schema:o,getSystem:s})=>{const{fn:i}=s(),{useComponent:u}=i.jsonSchema202012,{getDependentRequired:_,getProperties:w}=i.jsonSchema202012.useFn(),x=i.jsonSchema202012.useConfig(),C=Array.isArray(o?.required)?o.required:[],j=u(\"JSONSchema\"),L=w(o,x);return 0===Object.keys(L).length?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties\"},Pe.createElement(\"ul\",null,Object.entries(L).map((([s,i])=>{const u=C.includes(s),w=_(s,o);return Pe.createElement(\"li\",{key:s,className:To()(\"json-schema-2020-12-property\",{\"json-schema-2020-12-property--required\":u})},Pe.createElement(j,{name:s,schema:i,dependentRequired:w}))}))))},IP=createOnlyOAS31ComponentWrapper(keywords_Properties),getProperties=(o,{includeReadOnly:s,includeWriteOnly:i})=>{if(!o?.properties)return{};const u=Object.entries(o.properties).filter((([,o])=>(!(!0===o?.readOnly)||s)&&(!(!0===o?.writeOnly)||i)));return Object.fromEntries(u)};const MP=function oas31_after_load_afterLoad({fn:o,getSystem:s}){if(o.jsonSchema202012){const i=((o,s)=>{const{fn:i}=s();if(\"function\"!=typeof o)return null;const{hasKeyword:u}=i.jsonSchema202012;return s=>o(s)||u(s,\"example\")||s?.xml||s?.discriminator||s?.externalDocs})(o.jsonSchema202012.isExpandable,s);Object.assign(this.fn.jsonSchema202012,{isExpandable:i,getProperties})}if(\"function\"==typeof o.sampleFromSchema&&o.jsonSchema202012){const i=((o,s)=>{const{fn:i,specSelectors:u}=s;return Object.fromEntries(Object.entries(o).map((([o,s])=>{const _=i[o];return[o,(...o)=>u.isOAS31()?s(...o):\"function\"==typeof _?_(...o):void 0]})))})({sampleFromSchema:o.jsonSchema202012.sampleFromSchema,sampleFromSchemaGeneric:o.jsonSchema202012.sampleFromSchemaGeneric,createXMLExample:o.jsonSchema202012.createXMLExample,memoizedSampleFromSchema:o.jsonSchema202012.memoizedSampleFromSchema,memoizedCreateXMLExample:o.jsonSchema202012.memoizedCreateXMLExample,getJsonSampleSchema:o.jsonSchema202012.getJsonSampleSchema,getYamlSampleSchema:o.jsonSchema202012.getYamlSampleSchema,getXmlSampleSchema:o.jsonSchema202012.getXmlSampleSchema,getSampleSchema:o.jsonSchema202012.getSampleSchema,mergeJsonSchema:o.jsonSchema202012.mergeJsonSchema},s());Object.assign(this.fn,i)}},oas31=({fn:o})=>{const s=o.createSystemSelector||fn_createSystemSelector,i=o.createOnlyOAS31Selector||fn_createOnlyOAS31Selector;return{afterLoad:MP,fn:{isOAS31,createSystemSelector:fn_createSystemSelector,createOnlyOAS31Selector:fn_createOnlyOAS31Selector},components:{Webhooks:webhooks,JsonSchemaDialect:json_schema_dialect,MutualTLSAuth:mutual_tls_auth,OAS31Info:oas31_components_info,OAS31License:oas31_components_license,OAS31Contact:oas31_components_contact,OAS31VersionPragmaFilter:version_pragma_filter,OAS31Model:sP,OAS31Models:models,OAS31Auths:iP,JSONSchema202012KeywordExample:keywords_Example,JSONSchema202012KeywordXml:keywords_Xml,JSONSchema202012KeywordDiscriminator:keywords_Discriminator_Discriminator,JSONSchema202012KeywordExternalDocs:keywords_ExternalDocs},wrapComponents:{InfoContainer:lP,License:aP,Contact:cP,VersionPragmaFilter:wrap_components_version_pragma_filter,Model:pP,Models:dP,AuthItem:mP,auths:gP,JSONSchema202012KeywordDescription:AP,JSONSchema202012KeywordDefault:PP,JSONSchema202012KeywordProperties:IP},statePlugins:{auth:{wrapSelectors:{definitionsToAuthorize:OP}},spec:{selectors:{isOAS31:s(vP),license:selectors_license,selectLicenseNameField,selectLicenseUrlField,selectLicenseIdentifierField:i(selectLicenseIdentifierField),selectLicenseUrl:s(_P),contact:selectors_contact,selectContactNameField,selectContactEmailField,selectContactUrlField,selectContactUrl:s(EP),selectInfoTitleField,selectInfoSummaryField:i(selectInfoSummaryField),selectInfoDescriptionField,selectInfoTermsOfServiceField,selectInfoTermsOfServiceUrl:s(wP),selectExternalDocsDescriptionField,selectExternalDocsUrlField,selectExternalDocsUrl:s(SP),webhooks:i(selectors_webhooks),selectWebhooksOperations:i(s(bP)),selectJsonSchemaDialectField,selectJsonSchemaDialectDefault,selectSchemas:s(xP)},wrapSelectors:{isOAS3:wrap_selectors_isOAS3,selectLicenseUrl:kP}},oas31:{selectors:{selectLicenseUrl:i(s(CP))}}}}},NP=Vo().object,TP=Vo().bool,RP=(Vo().oneOfType([NP,TP]),(0,Pe.createContext)(null));RP.displayName=\"JSONSchemaContext\";const DP=(0,Pe.createContext)(0);DP.displayName=\"JSONSchemaLevelContext\";const LP=(0,Pe.createContext)(!1);LP.displayName=\"JSONSchemaDeepExpansionContext\";const BP=(0,Pe.createContext)(new Set),useConfig=()=>{const{config:o}=(0,Pe.useContext)(RP);return o},useComponent=o=>{const{components:s}=(0,Pe.useContext)(RP);return s[o]||null},useFn=(o=void 0)=>{const{fn:s}=(0,Pe.useContext)(RP);return void 0!==o?s[o]:s},useLevel=()=>{const o=(0,Pe.useContext)(DP);return[o,o+1]},useIsExpanded=()=>{const[o]=useLevel(),{defaultExpandedLevels:s}=useConfig();return s-o>0},useIsExpandedDeeply=()=>(0,Pe.useContext)(LP),useRenderedSchemas=(o=void 0)=>{if(void 0===o)return(0,Pe.useContext)(BP);const s=(0,Pe.useContext)(BP);return new Set([...s,o])},FP=(0,Pe.forwardRef)((({schema:o,name:s=\"\",dependentRequired:i=[],onExpand:u=(()=>{})},_)=>{const w=useFn(),x=useIsExpanded(),C=useIsExpandedDeeply(),[j,L]=(0,Pe.useState)(x||C),[B,$]=(0,Pe.useState)(C),[V,U]=useLevel(),z=(()=>{const[o]=useLevel();return o>0})(),Y=w.isExpandable(o)||i.length>0,Z=(o=>useRenderedSchemas().has(o))(o),ee=useRenderedSchemas(o),ie=w.stringifyConstraints(o),ae=useComponent(\"Accordion\"),ce=useComponent(\"Keyword$schema\"),le=useComponent(\"Keyword$vocabulary\"),pe=useComponent(\"Keyword$id\"),de=useComponent(\"Keyword$anchor\"),fe=useComponent(\"Keyword$dynamicAnchor\"),ye=useComponent(\"Keyword$ref\"),be=useComponent(\"Keyword$dynamicRef\"),_e=useComponent(\"Keyword$defs\"),we=useComponent(\"Keyword$comment\"),Se=useComponent(\"KeywordAllOf\"),xe=useComponent(\"KeywordAnyOf\"),Te=useComponent(\"KeywordOneOf\"),Re=useComponent(\"KeywordNot\"),qe=useComponent(\"KeywordIf\"),$e=useComponent(\"KeywordThen\"),ze=useComponent(\"KeywordElse\"),We=useComponent(\"KeywordDependentSchemas\"),He=useComponent(\"KeywordPrefixItems\"),Ye=useComponent(\"KeywordItems\"),Xe=useComponent(\"KeywordContains\"),Qe=useComponent(\"KeywordProperties\"),et=useComponent(\"KeywordPatternProperties\"),tt=useComponent(\"KeywordAdditionalProperties\"),rt=useComponent(\"KeywordPropertyNames\"),nt=useComponent(\"KeywordUnevaluatedItems\"),ot=useComponent(\"KeywordUnevaluatedProperties\"),st=useComponent(\"KeywordType\"),it=useComponent(\"KeywordEnum\"),at=useComponent(\"KeywordConst\"),ct=useComponent(\"KeywordConstraint\"),lt=useComponent(\"KeywordDependentRequired\"),ut=useComponent(\"KeywordContentSchema\"),pt=useComponent(\"KeywordTitle\"),ht=useComponent(\"KeywordDescription\"),dt=useComponent(\"KeywordDefault\"),mt=useComponent(\"KeywordDeprecated\"),gt=useComponent(\"KeywordReadOnly\"),yt=useComponent(\"KeywordWriteOnly\"),vt=useComponent(\"ExpandDeepButton\");(0,Pe.useEffect)((()=>{$(C)}),[C]),(0,Pe.useEffect)((()=>{$(B)}),[B]);const bt=(0,Pe.useCallback)(((o,s)=>{L(s),!s&&$(!1),u(o,s,!1)}),[u]),_t=(0,Pe.useCallback)(((o,s)=>{L(s),$(s),u(o,s,!0)}),[u]);return Pe.createElement(DP.Provider,{value:U},Pe.createElement(LP.Provider,{value:B},Pe.createElement(BP.Provider,{value:ee},Pe.createElement(\"article\",{ref:_,\"data-json-schema-level\":V,className:To()(\"json-schema-2020-12\",{\"json-schema-2020-12--embedded\":z,\"json-schema-2020-12--circular\":Z})},Pe.createElement(\"div\",{className:\"json-schema-2020-12-head\"},Y&&!Z?Pe.createElement(Pe.Fragment,null,Pe.createElement(ae,{expanded:j,onChange:bt},Pe.createElement(pt,{title:s,schema:o})),Pe.createElement(vt,{expanded:j,onClick:_t})):Pe.createElement(pt,{title:s,schema:o}),Pe.createElement(mt,{schema:o}),Pe.createElement(gt,{schema:o}),Pe.createElement(yt,{schema:o}),Pe.createElement(st,{schema:o,isCircular:Z}),ie.length>0&&ie.map((o=>Pe.createElement(ct,{key:`${o.scope}-${o.value}`,constraint:o})))),Pe.createElement(\"div\",{className:To()(\"json-schema-2020-12-body\",{\"json-schema-2020-12-body--collapsed\":!j})},j&&Pe.createElement(Pe.Fragment,null,Pe.createElement(ht,{schema:o}),!Z&&Y&&Pe.createElement(Pe.Fragment,null,Pe.createElement(Qe,{schema:o}),Pe.createElement(et,{schema:o}),Pe.createElement(tt,{schema:o}),Pe.createElement(ot,{schema:o}),Pe.createElement(rt,{schema:o}),Pe.createElement(Se,{schema:o}),Pe.createElement(xe,{schema:o}),Pe.createElement(Te,{schema:o}),Pe.createElement(Re,{schema:o}),Pe.createElement(qe,{schema:o}),Pe.createElement($e,{schema:o}),Pe.createElement(ze,{schema:o}),Pe.createElement(We,{schema:o}),Pe.createElement(He,{schema:o}),Pe.createElement(Ye,{schema:o}),Pe.createElement(nt,{schema:o}),Pe.createElement(Xe,{schema:o}),Pe.createElement(ut,{schema:o})),Pe.createElement(it,{schema:o}),Pe.createElement(at,{schema:o}),Pe.createElement(lt,{schema:o,dependentRequired:i}),Pe.createElement(dt,{schema:o}),Pe.createElement(ce,{schema:o}),Pe.createElement(le,{schema:o}),Pe.createElement(pe,{schema:o}),Pe.createElement(de,{schema:o}),Pe.createElement(fe,{schema:o}),Pe.createElement(ye,{schema:o}),!Z&&Y&&Pe.createElement(_e,{schema:o}),Pe.createElement(be,{schema:o}),Pe.createElement(we,{schema:o})))))))})),qP=FP,keywords_$schema=({schema:o})=>o?.$schema?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$schema\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$schema\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$schema)):null,$vocabulary_$vocabulary=({schema:o})=>{const s=useIsExpanded(),i=useIsExpandedDeeply(),[u,_]=(0,Pe.useState)(s||i),w=useComponent(\"Accordion\"),x=(0,Pe.useCallback)((()=>{_((o=>!o))}),[]);return o?.$vocabulary?\"object\"!=typeof o.$vocabulary?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$vocabulary\"},Pe.createElement(w,{expanded:u,onChange:x},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$vocabulary\")),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",null,u&&Object.entries(o.$vocabulary).map((([o,s])=>Pe.createElement(\"li\",{key:o,className:To()(\"json-schema-2020-12-$vocabulary-uri\",{\"json-schema-2020-12-$vocabulary-uri--disabled\":!s})},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o)))))):null},keywords_$id=({schema:o})=>o?.$id?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$id\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$id\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$id)):null,keywords_$anchor=({schema:o})=>o?.$anchor?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$anchor\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$anchor\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$anchor)):null,keywords_$dynamicAnchor=({schema:o})=>o?.$dynamicAnchor?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicAnchor\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$dynamicAnchor\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$dynamicAnchor)):null,keywords_$ref=({schema:o})=>o?.$ref?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$ref\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$ref\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$ref)):null,keywords_$dynamicRef=({schema:o})=>o?.$dynamicRef?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicRef\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$dynamicRef\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$dynamicRef)):null,keywords_$defs=({schema:o})=>{const s=o?.$defs||{},i=useIsExpanded(),u=useIsExpandedDeeply(),[_,w]=(0,Pe.useState)(i||u),[x,C]=(0,Pe.useState)(!1),j=useComponent(\"Accordion\"),L=useComponent(\"ExpandDeepButton\"),B=useComponent(\"JSONSchema\"),$=(0,Pe.useCallback)((()=>{w((o=>!o))}),[]),V=(0,Pe.useCallback)(((o,s)=>{w(s),C(s)}),[]);return 0===Object.keys(s).length?null:Pe.createElement(LP.Provider,{value:x},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$defs\"},Pe.createElement(j,{expanded:_,onChange:$},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$defs\")),Pe.createElement(L,{expanded:_,onClick:V}),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!_})},_&&Pe.createElement(Pe.Fragment,null,Object.entries(s).map((([o,s])=>Pe.createElement(\"li\",{key:o,className:\"json-schema-2020-12-property\"},Pe.createElement(B,{name:o,schema:s}))))))))},keywords_$comment=({schema:o})=>o?.$comment?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$comment\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$comment\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$comment)):null,keywords_AllOf=({schema:o})=>{const s=o?.allOf||[],i=useFn(),u=useIsExpanded(),_=useIsExpandedDeeply(),[w,x]=(0,Pe.useState)(u||_),[C,j]=(0,Pe.useState)(!1),L=useComponent(\"Accordion\"),B=useComponent(\"ExpandDeepButton\"),$=useComponent(\"JSONSchema\"),V=useComponent(\"KeywordType\"),U=(0,Pe.useCallback)((()=>{x((o=>!o))}),[]),z=(0,Pe.useCallback)(((o,s)=>{x(s),j(s)}),[]);return Array.isArray(s)&&0!==s.length?Pe.createElement(LP.Provider,{value:C},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--allOf\"},Pe.createElement(L,{expanded:w,onChange:U},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"All of\")),Pe.createElement(B,{expanded:w,onClick:z}),Pe.createElement(V,{schema:{allOf:s}}),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!w})},w&&Pe.createElement(Pe.Fragment,null,s.map(((o,s)=>Pe.createElement(\"li\",{key:`#${s}`,className:\"json-schema-2020-12-property\"},Pe.createElement($,{name:`#${s} ${i.getTitle(o)}`,schema:o})))))))):null},keywords_AnyOf=({schema:o})=>{const s=o?.anyOf||[],i=useFn(),u=useIsExpanded(),_=useIsExpandedDeeply(),[w,x]=(0,Pe.useState)(u||_),[C,j]=(0,Pe.useState)(!1),L=useComponent(\"Accordion\"),B=useComponent(\"ExpandDeepButton\"),$=useComponent(\"JSONSchema\"),V=useComponent(\"KeywordType\"),U=(0,Pe.useCallback)((()=>{x((o=>!o))}),[]),z=(0,Pe.useCallback)(((o,s)=>{x(s),j(s)}),[]);return Array.isArray(s)&&0!==s.length?Pe.createElement(LP.Provider,{value:C},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--anyOf\"},Pe.createElement(L,{expanded:w,onChange:U},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Any of\")),Pe.createElement(B,{expanded:w,onClick:z}),Pe.createElement(V,{schema:{anyOf:s}}),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!w})},w&&Pe.createElement(Pe.Fragment,null,s.map(((o,s)=>Pe.createElement(\"li\",{key:`#${s}`,className:\"json-schema-2020-12-property\"},Pe.createElement($,{name:`#${s} ${i.getTitle(o)}`,schema:o})))))))):null},keywords_OneOf=({schema:o})=>{const s=o?.oneOf||[],i=useFn(),u=useIsExpanded(),_=useIsExpandedDeeply(),[w,x]=(0,Pe.useState)(u||_),[C,j]=(0,Pe.useState)(!1),L=useComponent(\"Accordion\"),B=useComponent(\"ExpandDeepButton\"),$=useComponent(\"JSONSchema\"),V=useComponent(\"KeywordType\"),U=(0,Pe.useCallback)((()=>{x((o=>!o))}),[]),z=(0,Pe.useCallback)(((o,s)=>{x(s),j(s)}),[]);return Array.isArray(s)&&0!==s.length?Pe.createElement(LP.Provider,{value:C},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--oneOf\"},Pe.createElement(L,{expanded:w,onChange:U},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"One of\")),Pe.createElement(B,{expanded:w,onClick:z}),Pe.createElement(V,{schema:{oneOf:s}}),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!w})},w&&Pe.createElement(Pe.Fragment,null,s.map(((o,s)=>Pe.createElement(\"li\",{key:`#${s}`,className:\"json-schema-2020-12-property\"},Pe.createElement($,{name:`#${s} ${i.getTitle(o)}`,schema:o})))))))):null},keywords_Not=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"not\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Not\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--not\"},Pe.createElement(i,{name:u,schema:o.not}))},keywords_If=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"if\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"If\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--if\"},Pe.createElement(i,{name:u,schema:o.if}))},keywords_Then=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"then\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Then\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--then\"},Pe.createElement(i,{name:u,schema:o.then}))},keywords_Else=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"else\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Else\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--if\"},Pe.createElement(i,{name:u,schema:o.else}))},keywords_DependentSchemas=({schema:o})=>{const s=o?.dependentSchemas||[],i=useIsExpanded(),u=useIsExpandedDeeply(),[_,w]=(0,Pe.useState)(i||u),[x,C]=(0,Pe.useState)(!1),j=useComponent(\"Accordion\"),L=useComponent(\"ExpandDeepButton\"),B=useComponent(\"JSONSchema\"),$=(0,Pe.useCallback)((()=>{w((o=>!o))}),[]),V=(0,Pe.useCallback)(((o,s)=>{w(s),C(s)}),[]);return\"object\"!=typeof s||0===Object.keys(s).length?null:Pe.createElement(LP.Provider,{value:x},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentSchemas\"},Pe.createElement(j,{expanded:_,onChange:$},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Dependent schemas\")),Pe.createElement(L,{expanded:_,onClick:V}),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!_})},_&&Pe.createElement(Pe.Fragment,null,Object.entries(s).map((([o,s])=>Pe.createElement(\"li\",{key:o,className:\"json-schema-2020-12-property\"},Pe.createElement(B,{name:o,schema:s}))))))))},keywords_PrefixItems=({schema:o})=>{const s=o?.prefixItems||[],i=useFn(),u=useIsExpanded(),_=useIsExpandedDeeply(),[w,x]=(0,Pe.useState)(u||_),[C,j]=(0,Pe.useState)(!1),L=useComponent(\"Accordion\"),B=useComponent(\"ExpandDeepButton\"),$=useComponent(\"JSONSchema\"),V=useComponent(\"KeywordType\"),U=(0,Pe.useCallback)((()=>{x((o=>!o))}),[]),z=(0,Pe.useCallback)(((o,s)=>{x(s),j(s)}),[]);return Array.isArray(s)&&0!==s.length?Pe.createElement(LP.Provider,{value:C},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--prefixItems\"},Pe.createElement(L,{expanded:w,onChange:U},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Prefix items\")),Pe.createElement(B,{expanded:w,onClick:z}),Pe.createElement(V,{schema:{prefixItems:s}}),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!w})},w&&Pe.createElement(Pe.Fragment,null,s.map(((o,s)=>Pe.createElement(\"li\",{key:`#${s}`,className:\"json-schema-2020-12-property\"},Pe.createElement($,{name:`#${s} ${i.getTitle(o)}`,schema:o})))))))):null},keywords_Items=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"items\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Items\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--items\"},Pe.createElement(i,{name:u,schema:o.items}))},keywords_Contains=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"contains\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Contains\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--contains\"},Pe.createElement(i,{name:u,schema:o.contains}))},keywords_Properties_Properties=({schema:o})=>{const s=useFn(),i=o?.properties||{},u=Array.isArray(o?.required)?o.required:[],_=useComponent(\"JSONSchema\");return 0===Object.keys(i).length?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties\"},Pe.createElement(\"ul\",null,Object.entries(i).map((([i,w])=>{const x=u.includes(i),C=s.getDependentRequired(i,o);return Pe.createElement(\"li\",{key:i,className:To()(\"json-schema-2020-12-property\",{\"json-schema-2020-12-property--required\":x})},Pe.createElement(_,{name:i,schema:w,dependentRequired:C}))}))))},PatternProperties_PatternProperties=({schema:o})=>{const s=o?.patternProperties||{},i=useComponent(\"JSONSchema\");return 0===Object.keys(s).length?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--patternProperties\"},Pe.createElement(\"ul\",null,Object.entries(s).map((([o,s])=>Pe.createElement(\"li\",{key:o,className:\"json-schema-2020-12-property\"},Pe.createElement(i,{name:o,schema:s}))))))},keywords_AdditionalProperties=({schema:o})=>{const s=useFn(),{additionalProperties:i}=o,u=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"additionalProperties\"))return null;const _=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Additional properties\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--additionalProperties\"},!0===i?Pe.createElement(Pe.Fragment,null,_,Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"allowed\")):!1===i?Pe.createElement(Pe.Fragment,null,_,Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"forbidden\")):Pe.createElement(u,{name:_,schema:i}))},keywords_PropertyNames=({schema:o})=>{const s=useFn(),{propertyNames:i}=o,u=useComponent(\"JSONSchema\"),_=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Property names\");return s.hasKeyword(o,\"propertyNames\")?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--propertyNames\"},Pe.createElement(u,{name:_,schema:i})):null},keywords_UnevaluatedItems=({schema:o})=>{const s=useFn(),{unevaluatedItems:i}=o,u=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"unevaluatedItems\"))return null;const _=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Unevaluated items\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedItems\"},Pe.createElement(u,{name:_,schema:i}))},keywords_UnevaluatedProperties=({schema:o})=>{const s=useFn(),{unevaluatedProperties:i}=o,u=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"unevaluatedProperties\"))return null;const _=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Unevaluated properties\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedProperties\"},Pe.createElement(u,{name:_,schema:i}))},keywords_Type=({schema:o,isCircular:s=!1})=>{const i=useFn().getType(o),u=s?\" [circular]\":\"\";return Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},`${i}${u}`)},Enum_Enum=({schema:o})=>{const s=useFn();return Array.isArray(o?.enum)?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--enum\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Allowed values\"),Pe.createElement(\"ul\",null,o.enum.map((o=>{const i=s.stringify(o);return Pe.createElement(\"li\",{key:i},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},i))})))):null},keywords_Const=({schema:o})=>{const s=useFn();return s.hasKeyword(o,\"const\")?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--const\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Const\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},s.stringify(o.const))):null},Constraint=({constraint:o})=>Pe.createElement(\"span\",{className:`json-schema-2020-12__constraint json-schema-2020-12__constraint--${o.scope}`},o.value),$P=Pe.memo(Constraint),DependentRequired_DependentRequired=({dependentRequired:o})=>0===o.length?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentRequired\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Required when defined\"),Pe.createElement(\"ul\",null,o.map((o=>Pe.createElement(\"li\",{key:o},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--warning\"},o)))))),keywords_ContentSchema=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"contentSchema\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Content schema\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--contentSchema\"},Pe.createElement(i,{name:u,schema:o.contentSchema}))},Title_Title=({title:o=\"\",schema:s})=>{const i=useFn(),u=o||i.getTitle(s);return u?Pe.createElement(\"div\",{className:\"json-schema-2020-12__title\"},u):null},keywords_Description_Description=({schema:o})=>o?.description?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--description\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary\"},o.description)):null,keywords_Default=({schema:o})=>{const s=useFn();return s.hasKeyword(o,\"default\")?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--default\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Default\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},s.stringify(o.default))):null},keywords_Deprecated=({schema:o})=>!0!==o?.deprecated?null:Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--warning\"},\"deprecated\"),keywords_ReadOnly=({schema:o})=>!0!==o?.readOnly?null:Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"read-only\"),keywords_WriteOnly=({schema:o})=>!0!==o?.writeOnly?null:Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"write-only\"),Accordion_Accordion=({expanded:o=!1,children:s,onChange:i})=>{const u=useComponent(\"ChevronRightIcon\"),_=(0,Pe.useCallback)((s=>{i(s,!o)}),[o,i]);return Pe.createElement(\"button\",{type:\"button\",className:\"json-schema-2020-12-accordion\",onClick:_},Pe.createElement(\"div\",{className:\"json-schema-2020-12-accordion__children\"},s),Pe.createElement(\"span\",{className:To()(\"json-schema-2020-12-accordion__icon\",{\"json-schema-2020-12-accordion__icon--expanded\":o,\"json-schema-2020-12-accordion__icon--collapsed\":!o})},Pe.createElement(u,null)))},ExpandDeepButton_ExpandDeepButton=({expanded:o,onClick:s})=>{const i=(0,Pe.useCallback)((i=>{s(i,!o)}),[o,s]);return Pe.createElement(\"button\",{type:\"button\",className:\"json-schema-2020-12-expand-deep-button\",onClick:i},o?\"Collapse all\":\"Expand all\")},icons_ChevronRight=()=>Pe.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\"},Pe.createElement(\"path\",{d:\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"})),fn_upperFirst=o=>\"string\"==typeof o?`${o.charAt(0).toUpperCase()}${o.slice(1)}`:o,getTitle=(o,{lookup:s=\"extended\"}={})=>{const i=useFn();if(null!=o?.title)return i.upperFirst(String(o.title));if(\"extended\"===s){if(null!=o?.$anchor)return i.upperFirst(String(o.$anchor));if(null!=o?.$id)return String(o.$id)}return\"\"},getType=(o,s=new WeakSet)=>{const i=useFn();if(null==o)return\"any\";if(i.isBooleanJSONSchema(o))return o?\"any\":\"never\";if(\"object\"!=typeof o)return\"any\";if(s.has(o))return\"any\";s.add(o);const{type:u,prefixItems:_,items:w}=o,getArrayType=()=>{if(Array.isArray(_)){const o=_.map((o=>getType(o,s))),i=w?getType(w,s):\"any\";return`array<[${o.join(\", \")}], ${i}>`}if(w){return`array<${getType(w,s)}>`}return\"array<any>\"};if(o.not&&\"any\"===getType(o.not))return\"never\";const handleCombiningKeywords=(i,u)=>{if(Array.isArray(o[i])){return`(${o[i].map((o=>getType(o,s))).join(u)})`}return null},x=[Array.isArray(u)?u.map((o=>\"array\"===o?getArrayType():o)).join(\" | \"):\"array\"===u?getArrayType():[\"null\",\"boolean\",\"object\",\"array\",\"number\",\"integer\",\"string\"].includes(u)?u:(()=>{if(Object.hasOwn(o,\"prefixItems\")||Object.hasOwn(o,\"items\")||Object.hasOwn(o,\"contains\"))return getArrayType();if(Object.hasOwn(o,\"properties\")||Object.hasOwn(o,\"additionalProperties\")||Object.hasOwn(o,\"patternProperties\"))return\"object\";if([\"int32\",\"int64\"].includes(o.format))return\"integer\";if([\"float\",\"double\"].includes(o.format))return\"number\";if(Object.hasOwn(o,\"minimum\")||Object.hasOwn(o,\"maximum\")||Object.hasOwn(o,\"exclusiveMinimum\")||Object.hasOwn(o,\"exclusiveMaximum\")||Object.hasOwn(o,\"multipleOf\"))return\"number | integer\";if(Object.hasOwn(o,\"pattern\")||Object.hasOwn(o,\"format\")||Object.hasOwn(o,\"minLength\")||Object.hasOwn(o,\"maxLength\"))return\"string\";if(void 0!==o.const){if(null===o.const)return\"null\";if(\"boolean\"==typeof o.const)return\"boolean\";if(\"number\"==typeof o.const)return Number.isInteger(o.const)?\"integer\":\"number\";if(\"string\"==typeof o.const)return\"string\";if(Array.isArray(o.const))return\"array<any>\";if(\"object\"==typeof o.const)return\"object\"}return null})(),handleCombiningKeywords(\"oneOf\",\" | \"),handleCombiningKeywords(\"anyOf\",\" | \"),handleCombiningKeywords(\"allOf\",\" & \")].filter(Boolean).join(\" | \");return s.delete(o),x||\"any\"},isBooleanJSONSchema=o=>\"boolean\"==typeof o,hasKeyword=(o,s)=>null!==o&&\"object\"==typeof o&&Object.hasOwn(o,s),isExpandable=o=>{const s=useFn();return o?.$schema||o?.$vocabulary||o?.$id||o?.$anchor||o?.$dynamicAnchor||o?.$ref||o?.$dynamicRef||o?.$defs||o?.$comment||o?.allOf||o?.anyOf||o?.oneOf||s.hasKeyword(o,\"not\")||s.hasKeyword(o,\"if\")||s.hasKeyword(o,\"then\")||s.hasKeyword(o,\"else\")||o?.dependentSchemas||o?.prefixItems||s.hasKeyword(o,\"items\")||s.hasKeyword(o,\"contains\")||o?.properties||o?.patternProperties||s.hasKeyword(o,\"additionalProperties\")||s.hasKeyword(o,\"propertyNames\")||s.hasKeyword(o,\"unevaluatedItems\")||s.hasKeyword(o,\"unevaluatedProperties\")||o?.description||o?.enum||s.hasKeyword(o,\"const\")||s.hasKeyword(o,\"contentSchema\")||s.hasKeyword(o,\"default\")},fn_stringify=o=>null===o||[\"number\",\"bigint\",\"boolean\"].includes(typeof o)?String(o):Array.isArray(o)?`[${o.map(fn_stringify).join(\", \")}]`:JSON.stringify(o),stringifyConstraintRange=(o,s,i)=>{const u=\"number\"==typeof s,_=\"number\"==typeof i;return u&&_?s===i?`${s} ${o}`:`[${s}, ${i}] ${o}`:u?`>= ${s} ${o}`:_?`<= ${i} ${o}`:null},stringifyConstraints=o=>{const s=[],i=(o=>{if(\"number\"!=typeof o?.multipleOf)return null;if(o.multipleOf<=0)return null;if(1===o.multipleOf)return null;const{multipleOf:s}=o;if(Number.isInteger(s))return`multiple of ${s}`;const i=10**s.toString().split(\".\")[1].length;return`multiple of ${s*i}/${i}`})(o);null!==i&&s.push({scope:\"number\",value:i});const u=(o=>{const s=o?.minimum,i=o?.maximum,u=o?.exclusiveMinimum,_=o?.exclusiveMaximum,w=\"number\"==typeof s,x=\"number\"==typeof i,C=\"number\"==typeof u,j=\"number\"==typeof _,L=C&&(!w||s<u),B=j&&(!x||i>_);if((w||C)&&(x||j))return`${L?\"(\":\"[\"}${L?u:s}, ${B?_:i}${B?\")\":\"]\"}`;if(w||C)return`${L?\">\":\"≥\"} ${L?u:s}`;if(x||j)return`${B?\"<\":\"≤\"} ${B?_:i}`;return null})(o);null!==u&&s.push({scope:\"number\",value:u}),o?.format&&s.push({scope:\"string\",value:o.format});const _=stringifyConstraintRange(\"characters\",o?.minLength,o?.maxLength);null!==_&&s.push({scope:\"string\",value:_}),o?.pattern&&s.push({scope:\"string\",value:`matches ${o?.pattern}`}),o?.contentMediaType&&s.push({scope:\"string\",value:`media type: ${o.contentMediaType}`}),o?.contentEncoding&&s.push({scope:\"string\",value:`encoding: ${o.contentEncoding}`});const w=stringifyConstraintRange(o?.hasUniqueItems?\"unique items\":\"items\",o?.minItems,o?.maxItems);null!==w&&s.push({scope:\"array\",value:w});const x=stringifyConstraintRange(\"contained items\",o?.minContains,o?.maxContains);null!==x&&s.push({scope:\"array\",value:x});const C=stringifyConstraintRange(\"properties\",o?.minProperties,o?.maxProperties);return null!==C&&s.push({scope:\"object\",value:C}),s},getDependentRequired=(o,s)=>s?.dependentRequired?Array.from(Object.entries(s.dependentRequired).reduce(((s,[i,u])=>Array.isArray(u)&&u.includes(o)?(s.add(i),s):s),new Set)):[],withJSONSchemaContext=(o,s={})=>{const i={components:{JSONSchema:qP,Keyword$schema:keywords_$schema,Keyword$vocabulary:$vocabulary_$vocabulary,Keyword$id:keywords_$id,Keyword$anchor:keywords_$anchor,Keyword$dynamicAnchor:keywords_$dynamicAnchor,Keyword$ref:keywords_$ref,Keyword$dynamicRef:keywords_$dynamicRef,Keyword$defs:keywords_$defs,Keyword$comment:keywords_$comment,KeywordAllOf:keywords_AllOf,KeywordAnyOf:keywords_AnyOf,KeywordOneOf:keywords_OneOf,KeywordNot:keywords_Not,KeywordIf:keywords_If,KeywordThen:keywords_Then,KeywordElse:keywords_Else,KeywordDependentSchemas:keywords_DependentSchemas,KeywordPrefixItems:keywords_PrefixItems,KeywordItems:keywords_Items,KeywordContains:keywords_Contains,KeywordProperties:keywords_Properties_Properties,KeywordPatternProperties:PatternProperties_PatternProperties,KeywordAdditionalProperties:keywords_AdditionalProperties,KeywordPropertyNames:keywords_PropertyNames,KeywordUnevaluatedItems:keywords_UnevaluatedItems,KeywordUnevaluatedProperties:keywords_UnevaluatedProperties,KeywordType:keywords_Type,KeywordEnum:Enum_Enum,KeywordConst:keywords_Const,KeywordConstraint:$P,KeywordDependentRequired:DependentRequired_DependentRequired,KeywordContentSchema:keywords_ContentSchema,KeywordTitle:Title_Title,KeywordDescription:keywords_Description_Description,KeywordDefault:keywords_Default,KeywordDeprecated:keywords_Deprecated,KeywordReadOnly:keywords_ReadOnly,KeywordWriteOnly:keywords_WriteOnly,Accordion:Accordion_Accordion,ExpandDeepButton:ExpandDeepButton_ExpandDeepButton,ChevronRightIcon:icons_ChevronRight,...s.components},config:{default$schema:\"https://json-schema.org/draft/2020-12/schema\",defaultExpandedLevels:0,...s.config},fn:{upperFirst:fn_upperFirst,getTitle,getType,isBooleanJSONSchema,hasKeyword,isExpandable,stringify:fn_stringify,stringifyConstraints,getDependentRequired,...s.fn}},HOC=s=>Pe.createElement(RP.Provider,{value:i},Pe.createElement(o,s));return HOC.contexts={JSONSchemaContext:RP},HOC.displayName=o.displayName,HOC},json_schema_2020_12=()=>({components:{JSONSchema202012:qP,JSONSchema202012Keyword$schema:keywords_$schema,JSONSchema202012Keyword$vocabulary:$vocabulary_$vocabulary,JSONSchema202012Keyword$id:keywords_$id,JSONSchema202012Keyword$anchor:keywords_$anchor,JSONSchema202012Keyword$dynamicAnchor:keywords_$dynamicAnchor,JSONSchema202012Keyword$ref:keywords_$ref,JSONSchema202012Keyword$dynamicRef:keywords_$dynamicRef,JSONSchema202012Keyword$defs:keywords_$defs,JSONSchema202012Keyword$comment:keywords_$comment,JSONSchema202012KeywordAllOf:keywords_AllOf,JSONSchema202012KeywordAnyOf:keywords_AnyOf,JSONSchema202012KeywordOneOf:keywords_OneOf,JSONSchema202012KeywordNot:keywords_Not,JSONSchema202012KeywordIf:keywords_If,JSONSchema202012KeywordThen:keywords_Then,JSONSchema202012KeywordElse:keywords_Else,JSONSchema202012KeywordDependentSchemas:keywords_DependentSchemas,JSONSchema202012KeywordPrefixItems:keywords_PrefixItems,JSONSchema202012KeywordItems:keywords_Items,JSONSchema202012KeywordContains:keywords_Contains,JSONSchema202012KeywordProperties:keywords_Properties_Properties,JSONSchema202012KeywordPatternProperties:PatternProperties_PatternProperties,JSONSchema202012KeywordAdditionalProperties:keywords_AdditionalProperties,JSONSchema202012KeywordPropertyNames:keywords_PropertyNames,JSONSchema202012KeywordUnevaluatedItems:keywords_UnevaluatedItems,JSONSchema202012KeywordUnevaluatedProperties:keywords_UnevaluatedProperties,JSONSchema202012KeywordType:keywords_Type,JSONSchema202012KeywordEnum:Enum_Enum,JSONSchema202012KeywordConst:keywords_Const,JSONSchema202012KeywordConstraint:$P,JSONSchema202012KeywordDependentRequired:DependentRequired_DependentRequired,JSONSchema202012KeywordContentSchema:keywords_ContentSchema,JSONSchema202012KeywordTitle:Title_Title,JSONSchema202012KeywordDescription:keywords_Description_Description,JSONSchema202012KeywordDefault:keywords_Default,JSONSchema202012KeywordDeprecated:keywords_Deprecated,JSONSchema202012KeywordReadOnly:keywords_ReadOnly,JSONSchema202012KeywordWriteOnly:keywords_WriteOnly,JSONSchema202012Accordion:Accordion_Accordion,JSONSchema202012ExpandDeepButton:ExpandDeepButton_ExpandDeepButton,JSONSchema202012ChevronRightIcon:icons_ChevronRight,withJSONSchema202012Context:withJSONSchemaContext,JSONSchema202012DeepExpansionContext:()=>LP},fn:{upperFirst:fn_upperFirst,jsonSchema202012:{isExpandable,hasKeyword,useFn,useConfig,useComponent,useIsExpandedDeeply}}});var VP=__webpack_require__(11331),UP=__webpack_require__.n(VP);const array=(o,{sample:s})=>((o,s={})=>{const{minItems:i,maxItems:u,uniqueItems:_}=s,{contains:w,minContains:x,maxContains:C}=s;let j=[...o];if(null!=w&&\"object\"==typeof w){if(Number.isInteger(x)&&x>1){const o=j.at(0);for(let s=1;s<x;s+=1)j.unshift(o)}Number.isInteger(C)}if(Number.isInteger(u)&&u>0&&(j=o.slice(0,u)),Number.isInteger(i)&&i>0)for(let o=0;j.length<i;o+=1)j.push(j[o%j.length]);return!0===_&&(j=Array.from(new Set(j))),j})(s,o),object=()=>{throw new Error(\"Not implemented\")},bytes=o=>St()(o),random_pick=o=>o.at(0),predicates_isBooleanJSONSchema=o=>\"boolean\"==typeof o,isJSONSchemaObject=o=>UP()(o),isJSONSchema=o=>predicates_isBooleanJSONSchema(o)||isJSONSchemaObject(o);const zP=class Registry{data={};register(o,s){this.data[o]=s}unregister(o){void 0===o?this.data={}:delete this.data[o]}get(o){return this.data[o]}},int32=()=>2**30>>>0,int64=()=>2**53-1,generators_float=()=>.1,generators_double=()=>.1,email=()=>\"user@example.com\",idn_email=()=>\"실례@example.com\",hostname=()=>\"example.com\",idn_hostname=()=>\"실례.com\",ipv4=()=>\"198.51.100.42\",ipv6=()=>\"2001:0db8:5b96:0000:0000:426f:8e17:642a\",uri=()=>\"https://example.com/\",uri_reference=()=>\"path/index.html\",iri=()=>\"https://실례.com/\",iri_reference=()=>\"path/실례.html\",uuid=()=>\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",uri_template=()=>\"https://example.com/dictionary/{term:1}/{term}\",json_pointer=()=>\"/a/b/c\",relative_json_pointer=()=>\"1/0\",date_time=()=>(new Date).toISOString(),date=()=>(new Date).toISOString().substring(0,10),time=()=>(new Date).toISOString().substring(11),duration=()=>\"P3D\",generators_password=()=>\"********\",regex=()=>\"^[a-z]+$\";const WP=new class FormatRegistry extends zP{#t={int32,int64,float:generators_float,double:generators_double,email,\"idn-email\":idn_email,hostname,\"idn-hostname\":idn_hostname,ipv4,ipv6,uri,\"uri-reference\":uri_reference,iri,\"iri-reference\":iri_reference,uuid,\"uri-template\":uri_template,\"json-pointer\":json_pointer,\"relative-json-pointer\":relative_json_pointer,\"date-time\":date_time,date,time,duration,password:generators_password,regex};data={...this.#t};get defaults(){return{...this.#t}}},formatAPI=(o,s)=>\"function\"==typeof s?WP.register(o,s):null===s?WP.unregister(o):WP.get(o);formatAPI.getDefaults=()=>WP.defaults;const KP=formatAPI;var HP=__webpack_require__(48287).Buffer;const _7bit=o=>HP.from(o).toString(\"ascii\");var JP=__webpack_require__(48287).Buffer;const _8bit=o=>JP.from(o).toString(\"utf8\");var GP=__webpack_require__(48287).Buffer;const encoders_binary=o=>GP.from(o).toString(\"binary\"),quoted_printable=o=>{let s=\"\";for(let i=0;i<o.length;i++){const u=o.charCodeAt(i);if(61===u)s+=\"=3D\";else if(u>=33&&u<=60||u>=62&&u<=126||9===u||32===u)s+=o.charAt(i);else if(13===u||10===u)s+=\"\\r\\n\";else if(u>126){const u=unescape(encodeURIComponent(o.charAt(i)));for(let o=0;o<u.length;o++)s+=\"=\"+(\"0\"+u.charCodeAt(o).toString(16)).slice(-2).toUpperCase()}else s+=\"=\"+(\"0\"+u.toString(16)).slice(-2).toUpperCase()}return s};var YP=__webpack_require__(48287).Buffer;const base16=o=>YP.from(o).toString(\"hex\");var XP=__webpack_require__(48287).Buffer;const base32=o=>{const s=XP.from(o).toString(\"utf8\"),i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\";let u=0,_=\"\",w=0,x=0;for(let o=0;o<s.length;o++)for(w=w<<8|s.charCodeAt(o),x+=8;x>=5;)_+=i.charAt(w>>>x-5&31),x-=5;x>0&&(_+=i.charAt(w<<5-x&31),u=(8-8*s.length%5)%5);for(let o=0;o<u;o++)_+=\"=\";return _};var QP=__webpack_require__(48287).Buffer;const base64=o=>QP.from(o).toString(\"base64\");var ZP=__webpack_require__(48287).Buffer;const base64url=o=>ZP.from(o).toString(\"base64url\");const eI=new class EncoderRegistry extends zP{#t={\"7bit\":_7bit,\"8bit\":_8bit,binary:encoders_binary,\"quoted-printable\":quoted_printable,base16,base32,base64,base64url};data={...this.#t};get defaults(){return{...this.#t}}},encoderAPI=(o,s)=>\"function\"==typeof s?eI.register(o,s):null===s?eI.unregister(o):eI.get(o);encoderAPI.getDefaults=()=>eI.defaults;const tI=encoderAPI,rI={\"text/plain\":()=>\"string\",\"text/css\":()=>\".selector { border: 1px solid red }\",\"text/csv\":()=>\"value1,value2,value3\",\"text/html\":()=>\"<p>content</p>\",\"text/calendar\":()=>\"BEGIN:VCALENDAR\",\"text/javascript\":()=>\"console.dir('Hello world!');\",\"text/xml\":()=>'<person age=\"30\">John Doe</person>',\"text/*\":()=>\"string\"},nI={\"image/*\":()=>bytes(25).toString(\"binary\")},oI={\"audio/*\":()=>bytes(25).toString(\"binary\")},sI={\"video/*\":()=>bytes(25).toString(\"binary\")},iI={\"application/json\":()=>'{\"key\":\"value\"}',\"application/ld+json\":()=>'{\"name\": \"John Doe\"}',\"application/x-httpd-php\":()=>\"<?php echo '<p>Hello World!</p>'; ?>\",\"application/rtf\":()=>String.raw`{\\rtf1\\adeflang1025\\ansi\\ansicpg1252\\uc1`,\"application/x-sh\":()=>'echo \"Hello World!\"',\"application/xhtml+xml\":()=>\"<p>content</p>\",\"application/*\":()=>bytes(25).toString(\"binary\")};const aI=new class MediaTypeRegistry extends zP{#t={...rI,...nI,...oI,...sI,...iI};data={...this.#t};get defaults(){return{...this.#t}}},mediaTypeAPI=(o,s)=>{if(\"function\"==typeof s)return aI.register(o,s);if(null===s)return aI.unregister(o);const i=o.split(\";\").at(0),u=`${i.split(\"/\").at(0)}/*`;return aI.get(o)||aI.get(i)||aI.get(u)};mediaTypeAPI.getDefaults=()=>aI.defaults;const cI=mediaTypeAPI,applyStringConstraints=(o,s={})=>{const{maxLength:i,minLength:u}=s;let _=o;if(Number.isInteger(i)&&i>0&&(_=_.slice(0,i)),Number.isInteger(u)&&u>0){let o=0;for(;_.length<u;)_+=_[o++%_.length]}return _},types_string=(o,{sample:s}={})=>{const{contentEncoding:i,contentMediaType:u,contentSchema:_}=o,{pattern:w,format:x}=o,C=tI(i)||_k();let j;return j=\"string\"==typeof w?applyStringConstraints((o=>{try{return new(Yo())(o).gen()}catch{return\"string\"}})(w),o):\"string\"==typeof x?(o=>{const{format:s}=o,i=KP(s);return\"function\"==typeof i?i(o):\"string\"})(o):isJSONSchema(_)&&\"string\"==typeof u&&void 0!==s?Array.isArray(s)||\"object\"==typeof s?JSON.stringify(s):applyStringConstraints(String(s),o):\"string\"==typeof u?(o=>{const{contentMediaType:s}=o,i=cI(s);return\"function\"==typeof i?i(o):\"string\"})(o):applyStringConstraints(\"string\",o),C(j)},applyNumberConstraints=(o,s={})=>{const{minimum:i,maximum:u,exclusiveMinimum:_,exclusiveMaximum:w}=s,{multipleOf:x}=s,C=Number.isInteger(o)?1:Number.EPSILON;let j=\"number\"==typeof i?i:null,L=\"number\"==typeof u?u:null,B=o;if(\"number\"==typeof _&&(j=null!==j?Math.max(j,_+C):_+C),\"number\"==typeof w&&(L=null!==L?Math.min(L,w-C):w-C),B=j>L&&o||j||L||B,\"number\"==typeof x&&x>0){const o=B%x;B=0===o?B:B+x-o}return B},types_number=o=>{const{format:s}=o;let i;return i=\"string\"==typeof s?(o=>{const{format:s}=o,i=KP(s);return\"function\"==typeof i?i(o):0})(o):0,applyNumberConstraints(i,o)},types_integer=o=>{const{format:s}=o;let i;return i=\"string\"==typeof s?(o=>{const{format:s}=o,i=KP(s);if(\"function\"==typeof i)return i(o);switch(s){case\"int32\":return int32();case\"int64\":return int64()}return 0})(o):0,applyNumberConstraints(i,o)},types_boolean=o=>\"boolean\"!=typeof o.default||o.default,lI=new Proxy({array,object,string:types_string,number:types_number,integer:types_integer,boolean:types_boolean,null:()=>null},{get:(o,s)=>\"string\"==typeof s&&Object.hasOwn(o,s)?o[s]:()=>`Unknown Type: ${s}`}),uI=[\"array\",\"object\",\"number\",\"integer\",\"string\",\"boolean\",\"null\"],hasExample=o=>{if(!isJSONSchemaObject(o))return!1;const{examples:s,example:i,default:u}=o;return!!(Array.isArray(s)&&s.length>=1)||(void 0!==u||void 0!==i)},extractExample=o=>{if(!isJSONSchemaObject(o))return null;const{examples:s,example:i,default:u}=o;return Array.isArray(s)&&s.length>=1?s.at(0):void 0!==u?u:void 0!==i?i:void 0},pI={array:[\"items\",\"prefixItems\",\"contains\",\"maxContains\",\"minContains\",\"maxItems\",\"minItems\",\"uniqueItems\",\"unevaluatedItems\"],object:[\"properties\",\"additionalProperties\",\"patternProperties\",\"propertyNames\",\"minProperties\",\"maxProperties\",\"required\",\"dependentSchemas\",\"dependentRequired\",\"unevaluatedProperties\"],string:[\"pattern\",\"format\",\"minLength\",\"maxLength\",\"contentEncoding\",\"contentMediaType\",\"contentSchema\"],integer:[\"minimum\",\"maximum\",\"exclusiveMinimum\",\"exclusiveMaximum\",\"multipleOf\"]};pI.number=pI.integer;const hI=\"string\",inferTypeFromValue=o=>void 0===o?null:null===o?\"null\":Array.isArray(o)?\"array\":Number.isInteger(o)?\"integer\":typeof o,foldType=o=>{if(Array.isArray(o)&&o.length>=1){if(o.includes(\"array\"))return\"array\";if(o.includes(\"object\"))return\"object\";{const s=random_pick(o);if(uI.includes(s))return s}}return uI.includes(o)?o:null},inferType=(o,s=new WeakSet)=>{if(!isJSONSchemaObject(o))return hI;if(s.has(o))return hI;s.add(o);let{type:i,const:u}=o;if(i=foldType(i),\"string\"!=typeof i){const s=Object.keys(pI);e:for(let u=0;u<s.length;u+=1){const _=s[u],w=pI[_];for(let s=0;s<w.length;s+=1){const u=w[s];if(Object.hasOwn(o,u)){i=_;break e}}}}if(\"string\"!=typeof i&&void 0!==u){const o=inferTypeFromValue(u);i=\"string\"==typeof o?o:i}if(\"string\"!=typeof i){const combineTypes=i=>{if(Array.isArray(o[i])){const u=o[i].map((o=>inferType(o,s)));return foldType(u)}return null},u=combineTypes(\"allOf\"),_=combineTypes(\"anyOf\"),w=combineTypes(\"oneOf\"),x=o.not?inferType(o.not,s):null;(u||_||w||x)&&(i=foldType([u,_,w,x].filter(Boolean)))}if(\"string\"!=typeof i&&hasExample(o)){const s=extractExample(o),u=inferTypeFromValue(s);i=\"string\"==typeof u?u:i}return s.delete(o),i||hI},type_getType=o=>inferType(o),typeCast=o=>predicates_isBooleanJSONSchema(o)?(o=>!1===o?{not:{}}:{})(o):isJSONSchemaObject(o)?o:{},merge_merge=(o,s,i={})=>{if(predicates_isBooleanJSONSchema(o)&&!0===o)return!0;if(predicates_isBooleanJSONSchema(o)&&!1===o)return!1;if(predicates_isBooleanJSONSchema(s)&&!0===s)return!0;if(predicates_isBooleanJSONSchema(s)&&!1===s)return!1;if(!isJSONSchema(o))return s;if(!isJSONSchema(s))return o;const u={...s,...o};if(s.type&&o.type&&Array.isArray(s.type)&&\"string\"==typeof s.type){const i=normalizeArray(s.type).concat(o.type);u.type=Array.from(new Set(i))}if(Array.isArray(s.required)&&Array.isArray(o.required)&&(u.required=[...new Set([...o.required,...s.required])]),s.properties&&o.properties){const _=new Set([...Object.keys(s.properties),...Object.keys(o.properties)]);u.properties={};for(const w of _){const _=s.properties[w]||{},x=o.properties[w]||{};_.readOnly&&!i.includeReadOnly||_.writeOnly&&!i.includeWriteOnly?u.required=(u.required||[]).filter((o=>o!==w)):u.properties[w]=merge_merge(x,_,i)}}return isJSONSchema(s.items)&&isJSONSchema(o.items)&&(u.items=merge_merge(o.items,s.items,i)),isJSONSchema(s.contains)&&isJSONSchema(o.contains)&&(u.contains=merge_merge(o.contains,s.contains,i)),isJSONSchema(s.contentSchema)&&isJSONSchema(o.contentSchema)&&(u.contentSchema=merge_merge(o.contentSchema,s.contentSchema,i)),u},dI=merge_merge,main_sampleFromSchemaGeneric=(o,s={},i=void 0,u=!1)=>{if(null==o&&void 0===i)return;\"function\"==typeof o?.toJS&&(o=o.toJS()),o=typeCast(o);let _=void 0!==i||hasExample(o);const w=!_&&Array.isArray(o.oneOf)&&o.oneOf.length>0,x=!_&&Array.isArray(o.anyOf)&&o.anyOf.length>0;if(!_&&(w||x)){const i=typeCast(random_pick(w?o.oneOf:o.anyOf));!(o=dI(o,i,s)).xml&&i.xml&&(o.xml=i.xml),hasExample(o)&&hasExample(i)&&(_=!0)}const C={};let{xml:j,properties:L,additionalProperties:B,items:$,contains:V}=o||{},U=type_getType(o),{includeReadOnly:z,includeWriteOnly:Y}=s;j=j||{};let Z,{name:ee,prefix:ie,namespace:ae}=j,ce={};if(Object.hasOwn(o,\"type\")||(o.type=U),u&&(ee=ee||\"notagname\",Z=(ie?`${ie}:`:\"\")+ee,ae)){C[ie?`xmlns:${ie}`:\"xmlns\"]=ae}u&&(ce[Z]=[]);const le=objectify(L);let pe,de=0;const hasExceededMaxProperties=()=>Number.isInteger(o.maxProperties)&&o.maxProperties>0&&de>=o.maxProperties,canAddProperty=s=>!(Number.isInteger(o.maxProperties)&&o.maxProperties>0)||!hasExceededMaxProperties()&&(!(s=>!Array.isArray(o.required)||0===o.required.length||!o.required.includes(s))(s)||o.maxProperties-de-(()=>{if(!Array.isArray(o.required)||0===o.required.length)return 0;let s=0;return u?o.required.forEach((o=>s+=void 0===ce[o]?0:1)):o.required.forEach((o=>{s+=void 0===ce[Z]?.find((s=>void 0!==s[o]))?0:1})),o.required.length-s})()>0);if(pe=u?(i,_=void 0)=>{if(o&&le[i]){if(le[i].xml=le[i].xml||{},le[i].xml.attribute){const o=Array.isArray(le[i].enum)?random_pick(le[i].enum):void 0;if(hasExample(le[i]))C[le[i].xml.name||i]=extractExample(le[i]);else if(void 0!==o)C[le[i].xml.name||i]=o;else{const o=typeCast(le[i]),s=type_getType(o),u=le[i].xml.name||i;C[u]=lI[s](o)}return}le[i].xml.name=le[i].xml.name||i}else le[i]||!1===B||(le[i]={xml:{name:i}});let w=main_sampleFromSchemaGeneric(le[i],s,_,u);canAddProperty(i)&&(de++,Array.isArray(w)?ce[Z]=ce[Z].concat(w):ce[Z].push(w))}:(i,_)=>{if(canAddProperty(i)){if(UP()(o.discriminator?.mapping)&&o.discriminator.propertyName===i&&\"string\"==typeof o.$$ref){for(const s in o.discriminator.mapping)if(-1!==o.$$ref.search(o.discriminator.mapping[s])){ce[i]=s;break}}else ce[i]=main_sampleFromSchemaGeneric(le[i],s,_,u);de++}},_){let _;if(_=void 0!==i?i:extractExample(o),!u){if(\"number\"==typeof _&&\"string\"===U)return`${_}`;if(\"string\"!=typeof _||\"string\"===U)return _;try{return JSON.parse(_)}catch{return _}}if(\"array\"===U){if(!Array.isArray(_)){if(\"string\"==typeof _)return _;_=[_]}let i=[];return isJSONSchemaObject($)&&($.xml=$.xml||j||{},$.xml.name=$.xml.name||j.name,i=_.map((o=>main_sampleFromSchemaGeneric($,s,o,u)))),isJSONSchemaObject(V)&&(V.xml=V.xml||j||{},V.xml.name=V.xml.name||j.name,i=[main_sampleFromSchemaGeneric(V,s,void 0,u),...i]),i=lI.array(o,{sample:i}),j.wrapped?(ce[Z]=i,Qo()(C)||ce[Z].push({_attr:C})):ce=i,ce}if(\"object\"===U){if(\"string\"==typeof _)return _;for(const o in _)Object.hasOwn(_,o)&&(le[o]?.readOnly&&!z||le[o]?.writeOnly&&!Y||(le[o]?.xml?.attribute?C[le[o].xml.name||o]=_[o]:pe(o,_[o])));return Qo()(C)||ce[Z].push({_attr:C}),ce}return ce[Z]=Qo()(C)?_:[{_attr:C},_],ce}if(\"array\"===U){let i=[];if(isJSONSchemaObject(V))if(u&&(V.xml=V.xml||o.xml||{},V.xml.name=V.xml.name||j.name),Array.isArray(V.anyOf)){const{anyOf:o,..._}=$;i.push(...V.anyOf.map((o=>main_sampleFromSchemaGeneric(dI(o,_,s),s,void 0,u))))}else if(Array.isArray(V.oneOf)){const{oneOf:o,..._}=$;i.push(...V.oneOf.map((o=>main_sampleFromSchemaGeneric(dI(o,_,s),s,void 0,u))))}else{if(!(!u||u&&j.wrapped))return main_sampleFromSchemaGeneric(V,s,void 0,u);i.push(main_sampleFromSchemaGeneric(V,s,void 0,u))}if(isJSONSchemaObject($))if(u&&($.xml=$.xml||o.xml||{},$.xml.name=$.xml.name||j.name),Array.isArray($.anyOf)){const{anyOf:o,..._}=$;i.push(...$.anyOf.map((o=>main_sampleFromSchemaGeneric(dI(o,_,s),s,void 0,u))))}else if(Array.isArray($.oneOf)){const{oneOf:o,..._}=$;i.push(...$.oneOf.map((o=>main_sampleFromSchemaGeneric(dI(o,_,s),s,void 0,u))))}else{if(!(!u||u&&j.wrapped))return main_sampleFromSchemaGeneric($,s,void 0,u);i.push(main_sampleFromSchemaGeneric($,s,void 0,u))}return i=lI.array(o,{sample:i}),u&&j.wrapped?(ce[Z]=i,Qo()(C)||ce[Z].push({_attr:C}),ce):i}if(\"object\"===U){for(let o in le)Object.hasOwn(le,o)&&(le[o]?.deprecated||le[o]?.readOnly&&!z||le[o]?.writeOnly&&!Y||pe(o));if(u&&C&&ce[Z].push({_attr:C}),hasExceededMaxProperties())return ce;if(predicates_isBooleanJSONSchema(B)&&B)u?ce[Z].push({additionalProp:\"Anything can be here\"}):ce.additionalProp1={},de++;else if(isJSONSchemaObject(B)){const i=B,_=main_sampleFromSchemaGeneric(i,s,void 0,u);if(u&&\"string\"==typeof i?.xml?.name&&\"notagname\"!==i?.xml?.name)ce[Z].push(_);else{const s=Number.isInteger(o.minProperties)&&o.minProperties>0&&de<o.minProperties?o.minProperties-de:3;for(let o=1;o<=s;o++){if(hasExceededMaxProperties())return ce;if(u){const s={};s[\"additionalProp\"+o]=_.notagname,ce[Z].push(s)}else ce[\"additionalProp\"+o]=_;de++}}}return ce}let fe;if(void 0!==o.const)fe=o.const;else if(o&&Array.isArray(o.enum))fe=random_pick(normalizeArray(o.enum));else{const i=isJSONSchemaObject(o.contentSchema)?main_sampleFromSchemaGeneric(o.contentSchema,s,void 0,u):void 0;fe=lI[U](o,{sample:i})}return u?(ce[Z]=Qo()(C)?fe:[{_attr:C},fe],ce):fe},main_createXMLExample=(o,s,i)=>{const u=main_sampleFromSchemaGeneric(o,s,i,!0);if(u)return\"string\"==typeof u?u:Jo()(u,{declaration:!0,indent:\"\\t\"})},main_sampleFromSchema=(o,s,i)=>main_sampleFromSchemaGeneric(o,s,i,!1),main_resolver=(o,s,i)=>[o,JSON.stringify(s),JSON.stringify(i)],fI=utils_memoizeN(main_createXMLExample,main_resolver),mI=utils_memoizeN(main_sampleFromSchema,main_resolver);const gI=new class OptionRegistry extends zP{#t={};data={...this.#t};get defaults(){return{...this.#t}}},api_optionAPI=(o,s)=>(void 0!==s&&gI.register(o,s),gI.get(o)),yI=[{when:/json/,shouldStringifyTypes:[\"string\"]}],vI=[\"object\"],fn_get_json_sample_schema=o=>(s,i,u,_)=>{const{fn:w}=o(),x=w.jsonSchema202012.memoizedSampleFromSchema(s,i,_),C=typeof x,j=yI.reduce(((o,s)=>s.when.test(u)?[...o,...s.shouldStringifyTypes]:o),vI);return mt()(j,(o=>o===C))?JSON.stringify(x,null,2):x},fn_get_yaml_sample_schema=o=>(s,i,u,_)=>{const{fn:w}=o(),x=w.jsonSchema202012.getJsonSampleSchema(s,i,u,_);let C;try{C=to.dump(to.load(x),{lineWidth:-1},{schema:zn}),\"\\n\"===C[C.length-1]&&(C=C.slice(0,C.length-1))}catch(o){return console.error(o),\"error: could not generate yaml example\"}return C.replace(/\\t/g,\"  \")},fn_get_xml_sample_schema=o=>(s,i,u)=>{const{fn:_}=o();if(s&&!s.xml&&(s.xml={}),s&&!s.xml.name){if(!s.$$ref&&(s.type||s.items||s.properties||s.additionalProperties))return'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n\\x3c!-- XML example cannot be generated; root element name is undefined --\\x3e';if(s.$$ref){let o=s.$$ref.match(/\\S*\\/(\\S+)$/);s.xml.name=o[1]}}return _.jsonSchema202012.memoizedCreateXMLExample(s,i,u)},fn_get_sample_schema=o=>(s,i=\"\",u={},_=void 0)=>{const{fn:w}=o();return\"function\"==typeof s?.toJS&&(s=s.toJS()),\"function\"==typeof _?.toJS&&(_=_.toJS()),/xml/.test(i)?w.jsonSchema202012.getXmlSampleSchema(s,u,_):/(yaml|yml)/.test(i)?w.jsonSchema202012.getYamlSampleSchema(s,u,i,_):w.jsonSchema202012.getJsonSampleSchema(s,u,i,_)},json_schema_2020_12_samples=({getSystem:o})=>{const s=fn_get_json_sample_schema(o),i=fn_get_yaml_sample_schema(o),u=fn_get_xml_sample_schema(o),_=fn_get_sample_schema(o);return{fn:{jsonSchema202012:{sampleFromSchema:main_sampleFromSchema,sampleFromSchemaGeneric:main_sampleFromSchemaGeneric,sampleOptionAPI:api_optionAPI,sampleEncoderAPI:tI,sampleFormatAPI:KP,sampleMediaTypeAPI:cI,createXMLExample:main_createXMLExample,memoizedSampleFromSchema:mI,memoizedCreateXMLExample:fI,getJsonSampleSchema:s,getYamlSampleSchema:i,getXmlSampleSchema:u,getSampleSchema:_,mergeJsonSchema:dI}}}};function PresetApis(){return[base,oas3,json_schema_2020_12,json_schema_2020_12_samples,oas31]}const inline_plugin=o=>()=>({fn:o.fn,components:o.components}),factorization_system=o=>{const s=We()({layout:{layout:o.layout,filter:o.filter},spec:{spec:\"\",url:o.url},requestSnippets:o.requestSnippets},o.initialState);if(o.initialState)for(const[i,u]of Object.entries(o.initialState))void 0===u&&delete s[i];return{system:{configs:o.configs},plugins:o.presets,state:s}},sources_query=()=>o=>{const s=o.queryConfigEnabled?(()=>{const o=new URLSearchParams(at.location.search);return Object.fromEntries(o)})():{};return Object.entries(s).reduce(((o,[s,i])=>(\"config\"===s?o.configUrl=i:\"urls.primaryName\"===s?o[s]=i:o=Js()(o,s,i),o)),{})},sources_url=({url:o,system:s})=>async i=>{if(!o)return{};if(\"function\"!=typeof s.configsActions?.getConfigByUrl)return{};const u=(()=>{const o={};return o.promise=new Promise(((s,i)=>{o.resolve=s,o.reject=i})),o})();return s.configsActions.getConfigByUrl({url:o,loadRemoteConfig:!0,requestInterceptor:i.requestInterceptor,responseInterceptor:i.responseInterceptor},(o=>{u.resolve(o)})),u.promise},runtime=()=>()=>{const o={};return globalThis.location&&(o.oauth2RedirectUrl=`${globalThis.location.protocol}//${globalThis.location.host}${globalThis.location.pathname.substring(0,globalThis.location.pathname.lastIndexOf(\"/\"))}/oauth2-redirect.html`),o},bI=Object.freeze({dom_id:null,domNode:null,spec:{},url:\"\",urls:null,configUrl:null,layout:\"BaseLayout\",docExpansion:\"list\",maxDisplayedTags:-1,filter:!1,validatorUrl:\"https://validator.swagger.io/validator\",oauth2RedirectUrl:void 0,persistAuthorization:!1,configs:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,tryItOutEnabled:!1,requestInterceptor:o=>(o.curlOptions=[],o),responseInterceptor:o=>o,showMutatedRequest:!0,defaultModelRendering:\"example\",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:!1,requestSnippetsEnabled:!1,requestSnippets:{generators:{curl_bash:{title:\"cURL (bash)\",syntax:\"bash\"},curl_powershell:{title:\"cURL (PowerShell)\",syntax:\"powershell\"},curl_cmd:{title:\"cURL (CMD)\",syntax:\"bash\"}},defaultExpanded:!0,languages:null},supportedSubmitMethods:[\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"],queryConfigEnabled:!1,presets:[PresetApis],plugins:[],initialState:{},fn:{},components:{},syntaxHighlight:{activated:!0,theme:\"agate\"},operationsSorter:null,tagsSorter:null,onComplete:null,modelPropertyMacro:null,parameterMacro:null});var _I=__webpack_require__(61448),EI=__webpack_require__.n(_I),wI=__webpack_require__(77731),SI=__webpack_require__.n(wI);const type_casters_array=(o,s=[])=>Array.isArray(o)?o:s,type_casters_boolean=(o,s=!1)=>!0===o||\"true\"===o||1===o||\"1\"===o||!1!==o&&\"false\"!==o&&0!==o&&\"0\"!==o&&s,dom_node=o=>null===o||\"null\"===o?null:o,type_casters_filter=o=>{const s=String(o);return type_casters_boolean(o,s)},type_casters_function=(o,s)=>\"function\"==typeof o?o:s,nullable_array=o=>Array.isArray(o)?o:null,nullable_function=o=>\"function\"==typeof o?o:null,nullable_string=o=>null===o||\"null\"===o?null:String(o),type_casters_number=(o,s=-1)=>{const i=parseInt(o,10);return Number.isNaN(i)?s:i},type_casters_object=(o,s={})=>UP()(o)?o:s,sorter=o=>\"function\"==typeof o||\"string\"==typeof o?o:null,type_casters_string=o=>String(o),syntax_highlight=(o,s)=>UP()(o)?o:!1===o||\"false\"===o||0===o||\"0\"===o?{activated:!1}:s,undefined_string=o=>void 0===o||\"undefined\"===o?void 0:String(o),xI={components:{typeCaster:type_casters_object},configs:{typeCaster:type_casters_object},configUrl:{typeCaster:nullable_string},deepLinking:{typeCaster:type_casters_boolean,defaultValue:bI.deepLinking},defaultModelExpandDepth:{typeCaster:type_casters_number,defaultValue:bI.defaultModelExpandDepth},defaultModelRendering:{typeCaster:type_casters_string},defaultModelsExpandDepth:{typeCaster:type_casters_number,defaultValue:bI.defaultModelsExpandDepth},displayOperationId:{typeCaster:type_casters_boolean,defaultValue:bI.displayOperationId},displayRequestDuration:{typeCaster:type_casters_boolean,defaultValue:bI.displayRequestDuration},docExpansion:{typeCaster:type_casters_string},dom_id:{typeCaster:nullable_string},domNode:{typeCaster:dom_node},filter:{typeCaster:type_casters_filter},fn:{typeCaster:type_casters_object},initialState:{typeCaster:type_casters_object},layout:{typeCaster:type_casters_string},maxDisplayedTags:{typeCaster:type_casters_number,defaultValue:bI.maxDisplayedTags},modelPropertyMacro:{typeCaster:nullable_function},oauth2RedirectUrl:{typeCaster:undefined_string},onComplete:{typeCaster:nullable_function},operationsSorter:{typeCaster:sorter},paramaterMacro:{typeCaster:nullable_function},persistAuthorization:{typeCaster:type_casters_boolean,defaultValue:bI.persistAuthorization},plugins:{typeCaster:type_casters_array,defaultValue:bI.plugins},presets:{typeCaster:type_casters_array,defaultValue:bI.presets},requestInterceptor:{typeCaster:type_casters_function,defaultValue:bI.requestInterceptor},requestSnippets:{typeCaster:type_casters_object,defaultValue:bI.requestSnippets},requestSnippetsEnabled:{typeCaster:type_casters_boolean,defaultValue:bI.requestSnippetsEnabled},responseInterceptor:{typeCaster:type_casters_function,defaultValue:bI.responseInterceptor},showCommonExtensions:{typeCaster:type_casters_boolean,defaultValue:bI.showCommonExtensions},showExtensions:{typeCaster:type_casters_boolean,defaultValue:bI.showExtensions},showMutatedRequest:{typeCaster:type_casters_boolean,defaultValue:bI.showMutatedRequest},spec:{typeCaster:type_casters_object,defaultValue:bI.spec},supportedSubmitMethods:{typeCaster:type_casters_array,defaultValue:bI.supportedSubmitMethods},syntaxHighlight:{typeCaster:syntax_highlight,defaultValue:bI.syntaxHighlight},\"syntaxHighlight.activated\":{typeCaster:type_casters_boolean,defaultValue:bI.syntaxHighlight.activated},\"syntaxHighlight.theme\":{typeCaster:type_casters_string},tagsSorter:{typeCaster:sorter},tryItOutEnabled:{typeCaster:type_casters_boolean,defaultValue:bI.tryItOutEnabled},url:{typeCaster:type_casters_string},urls:{typeCaster:nullable_array},\"urls.primaryName\":{typeCaster:type_casters_string},validatorUrl:{typeCaster:nullable_string},withCredentials:{typeCaster:type_casters_boolean,defaultValue:bI.withCredentials}},type_cast=o=>Object.entries(xI).reduce(((o,[s,{typeCaster:i,defaultValue:u}])=>{if(EI()(o,s)){const _=i(go()(o,s),u);o=SI()(s,_,o)}return o}),{...o}),config_merge=(o,...s)=>{let i=Symbol.for(\"domNode\"),u=Symbol.for(\"primaryName\");const _=[];for(const o of s){const s={...o};Object.hasOwn(s,\"domNode\")&&(i=s.domNode,delete s.domNode),Object.hasOwn(s,\"urls.primaryName\")?(u=s[\"urls.primaryName\"],delete s[\"urls.primaryName\"]):Array.isArray(s.urls)&&Object.hasOwn(s.urls,\"primaryName\")&&(u=s.urls.primaryName,delete s.urls.primaryName),_.push(s)}const w=We()(o,..._);return i!==Symbol.for(\"domNode\")&&(w.domNode=i),u!==Symbol.for(\"primaryName\")&&Array.isArray(w.urls)&&(w.urls.primaryName=u),type_cast(w)};function SwaggerUI(o){const s=sources_query()(o),i=runtime()(),u=SwaggerUI.config.merge({},SwaggerUI.config.defaults,i,o,s),_=factorization_system(u),w=inline_plugin(u),x=new Store(_);x.register([u.plugins,w]);const C=x.getSystem(),persistConfigs=o=>{x.setConfigs(o),C.configsActions.loaded()},updateSpec=o=>{!s.url&&\"object\"==typeof o.spec&&Object.keys(o.spec).length>0?(C.specActions.updateUrl(\"\"),C.specActions.updateLoadingStatus(\"success\"),C.specActions.updateSpec(JSON.stringify(o.spec))):\"function\"==typeof C.specActions.download&&o.url&&!o.urls&&(C.specActions.updateUrl(o.url),C.specActions.download(o.url))},render=o=>{if(o.domNode)C.render(o.domNode,\"App\");else if(o.dom_id){const s=document.querySelector(o.dom_id);C.render(s,\"App\")}else null===o.dom_id||null===o.domNode||console.error(\"Skipped rendering: no `dom_id` or `domNode` was specified\")};return u.configUrl?((async()=>{const{configUrl:o}=u,i=await sources_url({url:o,system:C})(u),_=SwaggerUI.config.merge({},u,i,s);persistConfigs(_),null!==i&&updateSpec(_),render(_)})(),C):(persistConfigs(u),updateSpec(u),render(u),C)}SwaggerUI.System=Store,SwaggerUI.config={defaults:bI,merge:config_merge,typeCast:type_cast,typeCastMappings:xI},SwaggerUI.presets={base,apis:PresetApis},SwaggerUI.plugins={Auth:auth,Configs:configsPlugin,DeepLining:deep_linking,Err:err,Filter:filter,Icons:icons,JSONSchema5:json_schema_5,JSONSchema5Samples:json_schema_5_samples,JSONSchema202012:json_schema_2020_12,JSONSchema202012Samples:json_schema_2020_12_samples,Layout:plugins_layout,Logs:logs,OpenAPI30:oas3,OpenAPI31:oas3,OnComplete:on_complete,RequestSnippets:plugins_request_snippets,Spec:plugins_spec,SwaggerClient:swagger_client,Util:util,View:view,ViewLegacy:view_legacy,DownloadUrl:downloadUrlPlugin,SyntaxHighlighting:syntax_highlighting,Versions:versions,SafeRender:safe_render};const kI=SwaggerUI})(),_=_.default})()));"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui-bundle.js.LICENSE.txt",
    "content": "/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n\n/*!\n * @description Recursive object extending\n * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>\n * @license MIT\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2013-2018 Viacheslav Lotsmanov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * 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, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author   Feross Aboukhadijeh <https://feross.org>\n * @license  MIT\n */\n\n/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2021 Joachim Wester\n * MIT license\n */\n\n/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2022 Joachim Wester\n * MIT licensed\n */\n\n/*!\n * repeat-string <https://github.com/jonschlinkert/repeat-string>\n *\n * Copyright (c) 2014-2015, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\n/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */\n\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\n\n/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */\n\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n\n/**\n * @license React\n * react-dom.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\n/**\n * @license React\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\n/**\n * @license React\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\n/**\n * @license React\n * use-sync-external-store-with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and 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"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui-es-bundle-core.js",
    "content": "/*! For license information please see swagger-ui-es-bundle-core.js.LICENSE.txt */\nimport*as e from\"base64-js\";import*as t from\"ieee754\";import*as r from\"react\";import*as n from\"redux\";import*as a from\"immutable\";import*as o from\"redux-immutable\";import*as s from\"serialize-error\";import*as l from\"lodash/merge\";import*as i from\"@braintree/sanitize-url\";import*as c from\"lodash/camelCase\";import*as u from\"lodash/upperFirst\";import*as d from\"lodash/memoize\";import*as p from\"lodash/find\";import*as m from\"lodash/some\";import*as f from\"lodash/eq\";import*as h from\"lodash/isFunction\";import*as g from\"css.escape\";import*as y from\"url-parse\";import*as S from\"reselect\";import*as _ from\"prop-types\";import*as v from\"lodash/omit\";import*as b from\"js-yaml\";import*as w from\"zenscroll\";import*as C from\"react-immutable-proptypes\";import*as x from\"lodash/reduce\";import*as O from\"lodash/get\";import*as k from\"@babel/runtime-corejs3/helpers/extends\";import*as N from\"classnames\";import*as A from\"react-copy-to-clipboard\";import*as I from\"react-immutable-pure-component\";import*as R from\"react-debounce-input\";import*as T from\"randexp\";import*as B from\"lodash/isEmpty\";import*as j from\"lodash/constant\";import*as P from\"lodash/isString\";import*as M from\"lodash/debounce\";import*as q from\"lodash/set\";import*as L from\"lodash/fp/assocPath\";import*as D from\"swagger-client/es/resolver/strategies/generic\";import*as U from\"swagger-client/es/resolver/strategies/openapi-2\";import*as $ from\"swagger-client/es/resolver/strategies/openapi-3-0\";import*as J from\"swagger-client/es/resolver/strategies/openapi-3-1-apidom\";import*as V from\"swagger-client/es/resolver\";import*as K from\"swagger-client/es/execute\";import*as z from\"swagger-client/es/http\";import*as F from\"swagger-client/es/subtree-resolver\";import*as W from\"swagger-client/es/helpers\";import*as H from\"react-dom\";import*as G from\"react-redux\";import*as X from\"lodash/identity\";import*as Y from\"react-syntax-highlighter/dist/esm/light\";import*as Q from\"react-syntax-highlighter/dist/esm/languages/hljs/javascript\";import*as Z from\"react-syntax-highlighter/dist/esm/languages/hljs/json\";import*as ee from\"react-syntax-highlighter/dist/esm/languages/hljs/xml\";import*as te from\"react-syntax-highlighter/dist/esm/languages/hljs/bash\";import*as re from\"react-syntax-highlighter/dist/esm/languages/hljs/yaml\";import*as ne from\"react-syntax-highlighter/dist/esm/languages/hljs/http\";import*as ae from\"react-syntax-highlighter/dist/esm/languages/hljs/powershell\";import*as oe from\"react-syntax-highlighter/dist/esm/styles/hljs/agate\";import*as se from\"react-syntax-highlighter/dist/esm/styles/hljs/arta\";import*as le from\"react-syntax-highlighter/dist/esm/styles/hljs/monokai\";import*as ie from\"react-syntax-highlighter/dist/esm/styles/hljs/nord\";import*as ce from\"react-syntax-highlighter/dist/esm/styles/hljs/obsidian\";import*as ue from\"react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night\";import*as de from\"react-syntax-highlighter/dist/esm/styles/hljs/idea\";import*as pe from\"js-file-download\";import*as me from\"lodash/zipObject\";import*as fe from\"lodash/toString\";import*as he from\"xml-but-prettier\";import*as ge from\"lodash/toLower\";import*as ye from\"remarkable\";import*as Ee from\"remarkable/linkify\";import*as Se from\"dompurify\";import*as _e from\"lodash/escapeRegExp\";import*as ve from\"lodash/isPlainObject\";import*as be from\"lodash/has\";import*as we from\"lodash/fp/set\";var Ce={287:function(e,t,r){const n=r(987),a=r(362),o=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function createBuffer(e){if(e>s)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if(\"string\"==typeof e)return function fromString(e,t){\"string\"==typeof t&&\"\"!==t||(t=\"utf8\");if(!Buffer.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const r=0|byteLength(e,t);let n=createBuffer(r);const a=n.write(e,t);a!==r&&(n=n.slice(0,a));return n}(e,t);if(ArrayBuffer.isView(e))return function fromArrayView(e){if(isInstance(e,Uint8Array)){const t=new Uint8Array(e);return fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength)}return fromArrayLike(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if(\"undefined\"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,r);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);const a=function fromObject(e){if(Buffer.isBuffer(e)){const t=0|checked(e.length),r=createBuffer(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return\"number\"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e);if(\"Buffer\"===e.type&&Array.isArray(e.data))return fromArrayLike(e.data)}(e);if(a)return a;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive](\"string\"),t,r);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function assertSize(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){const t=e.length<0?0:0|checked(e.length),r=createBuffer(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('\"length\" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,Buffer.prototype),n}function checked(e){if(e>=s)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+s.toString(16)+\" bytes\");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let a=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":return utf8ToBytes(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return base64ToBytes(e).length;default:if(a)return n?-1:utf8ToBytes(e).length;t=(\"\"+t).toLowerCase(),a=!0}}function slowToString(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return hexSlice(this,t,r);case\"utf8\":case\"utf-8\":return utf8Slice(this,t,r);case\"ascii\":return asciiSlice(this,t,r);case\"latin1\":case\"binary\":return latin1Slice(this,t,r);case\"base64\":return base64Slice(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return utf16leSlice(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function swap(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,a){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),numberIsNaN(r=+r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if(\"string\"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,a);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,a);throw new TypeError(\"val must be string, number or Buffer\")}function arrayIndexOf(e,t,r,n,a){let o,s=1,l=e.length,i=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;s=2,l/=2,i/=2,r/=2}function read(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(a){let n=-1;for(o=r;o<l;o++)if(read(e,o)===read(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===i)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+i>l&&(r=l-i),o=r;o>=0;o--){let r=!0;for(let n=0;n<i;n++)if(read(e,o+n)!==read(t,n)){r=!1;break}if(r)return o}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;const a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(numberIsNaN(n))return s;e[r+s]=n}return s}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(function asciiToBytes(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(function utf16leToBytes(e,t){let r,n,a;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,a=r%256,o.push(a),o.push(n);return o}(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);const n=[];let a=t;for(;a<r;){const t=e[a];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(a+s<=r){let r,n,l,i;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[a+1],128==(192&r)&&(i=(31&t)<<6|63&r,i>127&&(o=i));break;case 3:r=e[a+1],n=e[a+2],128==(192&r)&&128==(192&n)&&(i=(15&t)<<12|(63&r)<<6|63&n,i>2047&&(i<55296||i>57343)&&(o=i));break;case 4:r=e[a+1],n=e[a+2],l=e[a+3],128==(192&r)&&128==(192&n)&&128==(192&l)&&(i=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&l,i>65535&&i<1114112&&(o=i))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),a+=s}return function decodeCodePointsArray(e){const t=e.length;if(t<=l)return String.fromCharCode.apply(String,e);let r=\"\",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=l));return r}(n)}t.kMaxLength=s,Buffer.TYPED_ARRAY_SUPPORT=function typedArraySupport(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),Buffer.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(Buffer.prototype,\"parent\",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,\"offset\",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(e,t,r){return function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?\"string\"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function isBuffer(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function compare(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let a=0,o=Math.min(r,n);a<o;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function isEncoding(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},Buffer.concat=function concat(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=Buffer.allocUnsafe(t);let a=0;for(r=0;r<e.length;++r){let t=e[r];if(isInstance(t,Uint8Array))a+t.length>n.length?(Buffer.isBuffer(t)||(t=Buffer.from(t)),t.copy(n,a)):Uint8Array.prototype.set.call(n,t,a);else{if(!Buffer.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(n,a)}a+=t.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function swap32(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function swap64(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function toString(){const e=this.length;return 0===e?\"\":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function equals(e){if(!Buffer.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function inspect(){let e=\"\";const r=t.INSPECT_MAX_BYTES;return e=this.toString(\"hex\",0,r).replace(/(.{2})/g,\"$1 \").trim(),this.length>r&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(e,t,r,n,a){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError(\"out of range index\");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const l=Math.min(o,s),i=this.slice(n,a),c=e.slice(t,r);for(let e=0;e<l;++e)if(i[e]!==c[e]){o=i[e],s=c[e];break}return o<s?-1:s<o?1:0},Buffer.prototype.includes=function includes(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function indexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function lastIndexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.prototype.write=function write(e,t,r,n){if(void 0===t)n=\"utf8\",r=this.length,t=0;else if(void 0===r&&\"string\"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n=\"utf8\")):(n=r,r=void 0)}const a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");let o=!1;for(;;)switch(n){case\"hex\":return hexWrite(this,e,t,r);case\"utf8\":case\"utf-8\":return utf8Write(this,e,t,r);case\"ascii\":case\"latin1\":case\"binary\":return asciiWrite(this,e,t,r);case\"base64\":return base64Write(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return ucs2Write(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const l=4096;function asciiSlice(e,t,r){let n=\"\";r=Math.min(e.length,r);for(let a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}function latin1Slice(e,t,r){let n=\"\";r=Math.min(e.length,r);for(let a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}function hexSlice(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let a=\"\";for(let n=t;n<r;++n)a+=u[e[n]];return a}function utf16leSlice(e,t,r){const n=e.slice(t,r);let a=\"\";for(let e=0;e<n.length-1;e+=2)a+=String.fromCharCode(n[e]+256*n[e+1]);return a}function checkOffset(e,t,r){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>r)throw new RangeError(\"Trying to access beyond buffer length\")}function checkInt(e,t,r,n,a,o){if(!Buffer.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('\"value\" argument is out of bounds');if(r+n>e.length)throw new RangeError(\"Index out of range\")}function wrtBigUInt64LE(e,t,r,n,a){checkIntBI(t,n,a,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function wrtBigUInt64BE(e,t,r,n,a){checkIntBI(t,n,a,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function checkIEEE754(e,t,r,n,a,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function writeFloat(e,t,r,n,o){return t=+t,r>>>=0,o||checkIEEE754(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,o){return t=+t,r>>>=0,o||checkIEEE754(e,0,r,8),a.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function slice(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,Buffer.prototype),n},Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);let n=this[e],a=1,o=0;for(;++o<t&&(a*=256);)n+=this[e+o]*a;return n},Buffer.prototype.readUintBE=Buffer.prototype.readUIntBE=function readUIntBE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);let n=this[e+--t],a=1;for(;t>0&&(a*=256);)n+=this[e+--t]*a;return n},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readBigUInt64LE=defineBigIntMethod((function readBigUInt64LE(e){validateNumber(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||boundsError(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,a=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(a)<<BigInt(32))})),Buffer.prototype.readBigUInt64BE=defineBigIntMethod((function readBigUInt64BE(e){validateNumber(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||boundsError(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],a=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(a)})),Buffer.prototype.readIntLE=function readIntLE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);let n=this[e],a=1,o=0;for(;++o<t&&(a*=256);)n+=this[e+o]*a;return a*=128,n>=a&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function readIntBE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);let n=t,a=1,o=this[e+--n];for(;n>0&&(a*=256);)o+=this[e+--n]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function readInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){e>>>=0,t||checkOffset(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function readInt16BE(e,t){e>>>=0,t||checkOffset(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readBigInt64LE=defineBigIntMethod((function readBigInt64LE(e){validateNumber(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||boundsError(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),Buffer.prototype.readBigInt64BE=defineBigIntMethod((function readBigInt64BE(e){validateNumber(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||boundsError(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),Buffer.prototype.readFloatLE=function readFloatLE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),a.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),a.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),a.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),a.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){checkInt(this,e,t,r,Math.pow(2,8*r)-1,0)}let a=1,o=0;for(this[t]=255&e;++o<r&&(a*=256);)this[t+o]=e/a&255;return t+r},Buffer.prototype.writeUintBE=Buffer.prototype.writeUIntBE=function writeUIntBE(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){checkInt(this,e,t,r,Math.pow(2,8*r)-1,0)}let a=r-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigUInt64LE=defineBigIntMethod((function writeBigUInt64LE(e,t=0){return wrtBigUInt64LE(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),Buffer.prototype.writeBigUInt64BE=defineBigIntMethod((function writeBigUInt64BE(e,t=0){return wrtBigUInt64BE(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),Buffer.prototype.writeIntLE=function writeIntLE(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);checkInt(this,e,t,r,n-1,-n)}let a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},Buffer.prototype.writeIntBE=function writeIntBE(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);checkInt(this,e,t,r,n-1,-n)}let a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},Buffer.prototype.writeInt8=function writeInt8(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigInt64LE=defineBigIntMethod((function writeBigInt64LE(e,t=0){return wrtBigUInt64LE(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),Buffer.prototype.writeBigInt64BE=defineBigIntMethod((function writeBigInt64BE(e,t=0){return wrtBigUInt64BE(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function copy(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(r<0||r>=this.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const a=n-r;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),a},Buffer.prototype.fill=function fill(e,t,r,n){if(\"string\"==typeof e){if(\"string\"==typeof t?(n=t,t=0,r=this.length):\"string\"==typeof r&&(n=r,r=this.length),void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!Buffer.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===n&&t<128||\"latin1\"===n)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError(\"Out of range index\");if(r<=t)return this;let a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(a=t;a<r;++a)this[a]=e;else{const o=Buffer.isBuffer(e)?e:Buffer.from(e,n),s=o.length;if(0===s)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};const i={};function E(e,t,r){i[e]=class NodeError extends r{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function addNumericalSeparator(e){let t=\"\",r=e.length;const n=\"-\"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function checkIntBI(e,t,r,n,a,o){if(e>r||e<t){const n=\"bigint\"==typeof t?\"n\":\"\";let a;throw a=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new i.ERR_OUT_OF_RANGE(\"value\",a,e)}!function checkBounds(e,t,r){validateNumber(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+r]||boundsError(t,e.length-(r+1))}(n,a,o)}function validateNumber(e,t){if(\"number\"!=typeof e)throw new i.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function boundsError(e,t,r){if(Math.floor(e)!==e)throw validateNumber(e,r),new i.ERR_OUT_OF_RANGE(r||\"offset\",\"an integer\",e);if(t<0)throw new i.ERR_BUFFER_OUT_OF_BOUNDS;throw new i.ERR_OUT_OF_RANGE(r||\"offset\",`>= ${r?1:0} and <= ${t}`,e)}E(\"ERR_BUFFER_OUT_OF_BOUNDS\",(function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"}),RangeError),E(\"ERR_INVALID_ARG_TYPE\",(function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`}),TypeError),E(\"ERR_OUT_OF_RANGE\",(function(e,t,r){let n=`The value of \"${e}\" is out of range.`,a=r;return Number.isInteger(r)&&Math.abs(r)>2**32?a=addNumericalSeparator(String(r)):\"bigint\"==typeof r&&(a=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(a=addNumericalSeparator(a)),a+=\"n\"),n+=` It must be ${t}. Received ${a}`,n}),RangeError);const c=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(e,t){let r;t=t||1/0;const n=e.length;let a=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&o.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function base64ToBytes(e){return n.toByteArray(function base64clean(e){if((e=(e=e.split(\"=\")[0]).trim().replace(c,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function blitBuffer(e,t,r,n){let a;for(a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}const u=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let a=0;a<16;++a)t[n+a]=e[r]+e[a]}return t}();function defineBigIntMethod(e){return\"undefined\"==typeof BigInt?BufferBigIntNotDefined:e}function BufferBigIntNotDefined(){throw new Error(\"BigInt not supported\")}},919:function(e,t,r){var n=r(287).Buffer;function isSpecificValue(e){return e instanceof n||e instanceof Date||e instanceof RegExp}function cloneSpecificValue(e){if(e instanceof n){var t=n.alloc?n.alloc(e.length):new n(e.length);return e.copy(t),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error(\"Unexpected situation\")}function deepCloneArray(e){var t=[];return e.forEach((function(e,r){\"object\"==typeof e&&null!==e?Array.isArray(e)?t[r]=deepCloneArray(e):isSpecificValue(e)?t[r]=cloneSpecificValue(e):t[r]=a({},e):t[r]=e})),t}function safeGetProperty(e,t){return\"__proto__\"===t?void 0:e[t]}var a=e.exports=function(){if(arguments.length<1||\"object\"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,r=arguments[0];return Array.prototype.slice.call(arguments,1).forEach((function(n){\"object\"!=typeof n||null===n||Array.isArray(n)||Object.keys(n).forEach((function(o){return t=safeGetProperty(r,o),(e=safeGetProperty(n,o))===r?void 0:\"object\"!=typeof e||null===e?void(r[o]=e):Array.isArray(e)?void(r[o]=deepCloneArray(e)):isSpecificValue(e)?void(r[o]=cloneSpecificValue(e)):\"object\"!=typeof t||null===t||Array.isArray(t)?void(r[o]=a({},e)):void(r[o]=a(t,e))}))})),r}},7:function(e){var t,r=\"object\"==typeof Reflect?Reflect:null,n=r&&\"function\"==typeof r.apply?r.apply:function ReflectApply(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&\"function\"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function ReflectOwnKeys(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function ReflectOwnKeys(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function NumberIsNaN(e){return e!=e};function EventEmitter(){EventEmitter.init.call(this)}e.exports=EventEmitter,e.exports.once=function once(e,t){return new Promise((function(r,n){function errorListener(r){e.removeListener(t,resolver),n(r)}function resolver(){\"function\"==typeof e.removeListener&&e.removeListener(\"error\",errorListener),r([].slice.call(arguments))}eventTargetAgnosticAddListener(e,t,resolver,{once:!0}),\"error\"!==t&&function addErrorHandlerIfEventEmitter(e,t,r){\"function\"==typeof e.on&&eventTargetAgnosticAddListener(e,\"error\",t,r)}(e,errorListener,{once:!0})}))},EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var o=10;function checkListener(e){if(\"function\"!=typeof e)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof e)}function _getMaxListeners(e){return void 0===e._maxListeners?EventEmitter.defaultMaxListeners:e._maxListeners}function _addListener(e,t,r,n){var a,o,s;if(checkListener(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit(\"newListener\",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if(\"function\"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(a=_getMaxListeners(e))>0&&s.length>a&&!s.warned){s.warned=!0;var l=new Error(\"Possible EventEmitter memory leak detected. \"+s.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");l.name=\"MaxListenersExceededWarning\",l.emitter=e,l.type=t,l.count=s.length,function ProcessEmitWarning(e){console&&console.warn&&console.warn(e)}(l)}return e}function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=onceWrapper.bind(n);return a.listener=r,n.wrapFn=a,a}function _listeners(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:\"function\"==typeof a?r?[a.listener||a]:[a]:r?function unwrapListeners(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(a):arrayClone(a,a.length)}function listenerCount(e){var t=this._events;if(void 0!==t){var r=t[e];if(\"function\"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function arrayClone(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function eventTargetAgnosticAddListener(e,t,r,n){if(\"function\"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if(\"function\"!=typeof e.addEventListener)throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function wrapListener(a){n.once&&e.removeEventListener(t,wrapListener),r(a)}))}}Object.defineProperty(EventEmitter,\"defaultMaxListeners\",{enumerable:!0,get:function(){return o},set:function(e){if(\"number\"!=typeof e||e<0||a(e))throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received '+e+\".\");o=e}}),EventEmitter.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function setMaxListeners(e){if(\"number\"!=typeof e||e<0||a(e))throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received '+e+\".\");return this._maxListeners=e,this},EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return _getMaxListeners(this)},EventEmitter.prototype.emit=function emit(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var a=\"error\"===e,o=this._events;if(void 0!==o)a=a&&void 0===o.error;else if(!a)return!1;if(a){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var l=new Error(\"Unhandled error.\"+(s?\" (\"+s.message+\")\":\"\"));throw l.context=s,l}var i=o[e];if(void 0===i)return!1;if(\"function\"==typeof i)n(i,this,t);else{var c=i.length,u=arrayClone(i,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},EventEmitter.prototype.addListener=function addListener(e,t){return _addListener(this,e,t,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function prependListener(e,t){return _addListener(this,e,t,!0)},EventEmitter.prototype.once=function once(e,t){return checkListener(t),this.on(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.prependOnceListener=function prependOnceListener(e,t){return checkListener(t),this.prependListener(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.removeListener=function removeListener(e,t){var r,n,a,o,s;if(checkListener(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit(\"removeListener\",e,r.listener||t));else if(\"function\"!=typeof r){for(a=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,a=o;break}if(a<0)return this;0===a?r.shift():function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,a),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit(\"removeListener\",e,s||t)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var a,o=Object.keys(r);for(n=0;n<o.length;++n)\"removeListener\"!==(a=o[n])&&this.removeAllListeners(a);return this.removeAllListeners(\"removeListener\"),this._events=Object.create(null),this._eventsCount=0,this}if(\"function\"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},EventEmitter.prototype.listeners=function listeners(e){return _listeners(this,e,!0)},EventEmitter.prototype.rawListeners=function rawListeners(e){return _listeners(this,e,!1)},EventEmitter.listenerCount=function(e,t){return\"function\"==typeof e.listenerCount?e.listenerCount(t):listenerCount.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?t(this._events):[]}},698:function(e){\"function\"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},606:function(e){var t,r,n=e.exports={};function defaultSetTimout(){throw new Error(\"setTimeout has not been defined\")}function defaultClearTimeout(){throw new Error(\"clearTimeout has not been defined\")}function runTimeout(e){if(t===setTimeout)return setTimeout(e,0);if((t===defaultSetTimout||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t=\"function\"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){t=defaultSetTimout}try{r=\"function\"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){r=defaultClearTimeout}}();var a,o=[],s=!1,l=-1;function cleanUpNextTick(){s&&a&&(s=!1,a.length?o=a.concat(o):l=-1,o.length&&drainQueue())}function drainQueue(){if(!s){var e=runTimeout(cleanUpNextTick);s=!0;for(var t=o.length;t;){for(a=o,o=[];++l<t;)a&&a[l].run();l=-1,t=o.length}a=null,s=!1,function runClearTimeout(e){if(r===clearTimeout)return clearTimeout(e);if((r===defaultClearTimeout||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];o.push(new Item(e,t)),1!==o.length||s||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},n.title=\"browser\",n.browser=!0,n.env={},n.argv=[],n.version=\"\",n.versions={},n.on=noop,n.addListener=noop,n.once=noop,n.off=noop,n.removeListener=noop,n.removeAllListeners=noop,n.emit=noop,n.prependListener=noop,n.prependOnceListener=noop,n.listeners=function(e){return[]},n.binding=function(e){throw new Error(\"process.binding is not supported\")},n.cwd=function(){return\"/\"},n.chdir=function(e){throw new Error(\"process.chdir is not supported\")},n.umask=function(){return 0}},209:function(e,t,r){var n=r(606),a=65536,o=4294967295;var s=r(861).Buffer,l=r.g.crypto||r.g.msCrypto;l&&l.getRandomValues?e.exports=function randomBytes(e,t){if(e>o)throw new RangeError(\"requested too many random bytes\");var r=s.allocUnsafe(e);if(e>0)if(e>a)for(var i=0;i<e;i+=a)l.getRandomValues(r.slice(i,i+a));else l.getRandomValues(r);if(\"function\"==typeof t)return n.nextTick((function(){t(null,r)}));return r}:e.exports=function oldBrowser(){throw new Error(\"Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11\")}},48:function(e){var t={};function createErrorType(e,r,n){n||(n=Error);var a=function(e){function NodeError(t,n,a){return e.call(this,function getMessage(e,t,n){return\"string\"==typeof r?r:r(e,t,n)}(t,n,a))||this}return function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(NodeError,e),NodeError}(n);a.prototype.name=n.name,a.prototype.code=e,t[e]=a}function oneOf(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?\"one of \".concat(t,\" \").concat(e.slice(0,r-1).join(\", \"),\", or \")+e[r-1]:2===r?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}createErrorType(\"ERR_INVALID_OPT_VALUE\",(function(e,t){return'The value \"'+t+'\" is invalid for option \"'+e+'\"'}),TypeError),createErrorType(\"ERR_INVALID_ARG_TYPE\",(function(e,t,r){var n,a;if(\"string\"==typeof t&&function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}(t,\"not \")?(n=\"must not be\",t=t.replace(/^not /,\"\")):n=\"must be\",function endsWith(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e,\" argument\"))a=\"The \".concat(e,\" \").concat(n,\" \").concat(oneOf(t,\"type\"));else{var o=function includes(e,t,r){return\"number\"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,\".\")?\"property\":\"argument\";a='The \"'.concat(e,'\" ').concat(o,\" \").concat(n,\" \").concat(oneOf(t,\"type\"))}return a+=\". Received type \".concat(typeof r)}),TypeError),createErrorType(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),createErrorType(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(e){return\"The \"+e+\" method is not implemented\"})),createErrorType(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),createErrorType(\"ERR_STREAM_DESTROYED\",(function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"})),createErrorType(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),createErrorType(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),createErrorType(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),createErrorType(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),createErrorType(\"ERR_UNKNOWN_ENCODING\",(function(e){return\"Unknown encoding: \"+e}),TypeError),createErrorType(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),e.exports.F=t},382:function(e,t,r){var n=r(606),a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=Duplex;var o=r(412),s=r(708);r(698)(Duplex,o);for(var l=a(s.prototype),i=0;i<l.length;i++){var c=l[i];Duplex.prototype[c]||(Duplex.prototype[c]=s.prototype[c])}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(\"end\",onend)))}function onend(){this._writableState.ended||n.nextTick(onEndNT,this)}function onEndNT(e){e.end()}Object.defineProperty(Duplex.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,\"writableBuffer\",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Duplex.prototype,\"writableLength\",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Duplex.prototype,\"destroyed\",{enumerable:!1,get:function get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function set(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},600:function(e,t,r){e.exports=PassThrough;var n=r(610);function PassThrough(e){if(!(this instanceof PassThrough))return new PassThrough(e);n.call(this,e)}r(698)(PassThrough,n),PassThrough.prototype._transform=function(e,t,r){r(null,e)}},412:function(e,t,r){var n,a=r(606);e.exports=Readable,Readable.ReadableState=ReadableState;r(7).EventEmitter;var o=function EElistenerCount(e,t){return e.listeners(t).length},s=r(345),l=r(287).Buffer,i=(void 0!==r.g?r.g:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var c,u=r(838);c=u&&u.debuglog?u.debuglog(\"stream\"):function debug(){};var d,p,m,f=r(726),h=r(896),g=r(291).getHighWaterMark,y=r(48).F,S=y.ERR_INVALID_ARG_TYPE,_=y.ERR_STREAM_PUSH_AFTER_EOF,v=y.ERR_METHOD_NOT_IMPLEMENTED,b=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(698)(Readable,s);var w=h.errorOrDestroy,C=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function ReadableState(e,t,a){n=n||r(382),e=e||{},\"boolean\"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,\"readableHighWaterMark\",a),this.buffer=new f,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=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=r(141).I),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function Readable(e){if(n=n||r(382),!(this instanceof Readable))return new Readable(e);var t=this instanceof n;this._readableState=new ReadableState(e,this,t),this.readable=!0,e&&(\"function\"==typeof e.read&&(this._read=e.read),\"function\"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function readableAddChunk(e,t,r,n,a){c(\"readableAddChunk\",t);var o,s=e._readableState;if(null===t)s.reading=!1,function onEofChunk(e,t){if(c(\"onEofChunk\"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?emitReadable(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,emitReadable_(e)))}(e,s);else if(a||(o=function chunkInvalid(e,t){var r;(function _isUint8Array(e){return l.isBuffer(e)||e instanceof i})(t)||\"string\"==typeof t||void 0===t||e.objectMode||(r=new S(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],t));return r}(s,t)),o)w(e,o);else if(s.objectMode||t&&t.length>0)if(\"string\"==typeof t||s.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function _uint8ArrayToBuffer(e){return l.from(e)}(t)),n)s.endEmitted?w(e,new b):addChunk(e,s,t,!0);else if(s.ended)w(e,new _);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?addChunk(e,s,t,!1):maybeReadMore(e,s)):addChunk(e,s,t,!1)}else n||(s.reading=!1,maybeReadMore(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function addChunk(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit(\"data\",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&emitReadable(e)),maybeReadMore(e,t)}Object.defineProperty(Readable.prototype,\"destroyed\",{enumerable:!1,get:function get(){return void 0!==this._readableState&&this._readableState.destroyed},set:function set(e){this._readableState&&(this._readableState.destroyed=e)}}),Readable.prototype.destroy=h.destroy,Readable.prototype._undestroy=h.undestroy,Readable.prototype._destroy=function(e,t){t(e)},Readable.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:\"string\"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=\"\"),r=!0),readableAddChunk(this,e,t,!1,r)},Readable.prototype.unshift=function(e){return readableAddChunk(this,e,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(e){d||(d=r(141).I);var t=new d(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,a=\"\";null!==n;)a+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),\"\"!==a&&this._readableState.buffer.push(a),this._readableState.length=a.length,this};var x=1073741824;function howMuchToRead(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function computeNewHighWaterMark(e){return e>=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function emitReadable(e){var t=e._readableState;c(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c(\"emitReadable\",t.flowing),t.emittedReadable=!0,a.nextTick(emitReadable_,e))}function emitReadable_(e){var t=e._readableState;c(\"emitReadable_\",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit(\"readable\"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c(\"maybeReadMore read 0\"),e.read(0),r===t.length)break}t.readingMore=!1}function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount(\"readable\")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount(\"data\")>0&&e.resume()}function nReadingNextTick(e){c(\"readable nexttick read 0\"),e.read(0)}function resume_(e,t){c(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),flow(e),t.flowing&&!t.reading&&e.read(0)}function flow(e){var t=e._readableState;for(c(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function fromList(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function endReadable(e){var t=e._readableState;c(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(endReadableNT,t,e))}function endReadableNT(e,t){if(c(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function indexOf(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Readable.prototype.read=function(e){c(\"read\",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?endReadable(this):emitReadable(this),null;if(0===(e=howMuchToRead(e,t))&&t.ended)return 0===t.length&&endReadable(this),null;var n,a=t.needReadable;return c(\"need readable\",a),(0===t.length||t.length-e<t.highWaterMark)&&c(\"length less than watermark\",a=!0),t.ended||t.reading?c(\"reading or ended\",a=!1):a&&(c(\"do read\"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=howMuchToRead(r,t))),null===(n=e>0?fromList(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&endReadable(this)),null!==n&&this.emit(\"data\",n),n},Readable.prototype._read=function(e){w(this,new v(\"_read()\"))},Readable.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,c(\"pipe count=%d opts=%j\",n.pipesCount,t);var s=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?onend:unpipe;function onunpipe(t,a){c(\"onunpipe\"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,function cleanup(){c(\"cleanup\"),e.removeListener(\"close\",onclose),e.removeListener(\"finish\",onfinish),e.removeListener(\"drain\",l),e.removeListener(\"error\",onerror),e.removeListener(\"unpipe\",onunpipe),r.removeListener(\"end\",onend),r.removeListener(\"end\",unpipe),r.removeListener(\"data\",ondata),i=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l()}())}function onend(){c(\"onend\"),e.end()}n.endEmitted?a.nextTick(s):r.once(\"end\",s),e.on(\"unpipe\",onunpipe);var l=function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;c(\"pipeOnDrain\",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,\"data\")&&(t.flowing=!0,flow(e))}}(r);e.on(\"drain\",l);var i=!1;function ondata(t){c(\"ondata\");var a=e.write(t);c(\"dest.write\",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==indexOf(n.pipes,e))&&!i&&(c(\"false write response, pause\",n.awaitDrain),n.awaitDrain++),r.pause())}function onerror(t){c(\"onerror\",t),unpipe(),e.removeListener(\"error\",onerror),0===o(e,\"error\")&&w(e,t)}function onclose(){e.removeListener(\"finish\",onfinish),unpipe()}function onfinish(){c(\"onfinish\"),e.removeListener(\"close\",onclose),unpipe()}function unpipe(){c(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",ondata),function prependListener(e,t,r){if(\"function\"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,\"error\",onerror),e.once(\"close\",onclose),e.once(\"finish\",onfinish),e.emit(\"pipe\",r),n.flowing||(c(\"pipe resume\"),r.resume()),e},Readable.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(\"unpipe\",this,r)),this;if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<a;o++)n[o].emit(\"unpipe\",this,{hasUnpiped:!1});return this}var s=indexOf(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit(\"unpipe\",this,r)),this},Readable.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return\"data\"===e?(n.readableListening=this.listenerCount(\"readable\")>0,!1!==n.flowing&&this.resume()):\"readable\"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c(\"on readable\",n.length,n.reading),n.length?emitReadable(this):n.reading||a.nextTick(nReadingNextTick,this))),r},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return\"readable\"===e&&a.nextTick(updateReadableListening,this),r},Readable.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||a.nextTick(updateReadableListening,this),t},Readable.prototype.resume=function(){var e=this._readableState;return e.flowing||(c(\"resume\"),e.flowing=!e.readableListening,function resume(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(resume_,e,t))}(this,e)),e.paused=!1,this},Readable.prototype.pause=function(){return c(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(c(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},Readable.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on(\"end\",(function(){if(c(\"wrapped end\"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(\"data\",(function(a){(c(\"wrapped data\"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))})),e)void 0===this[a]&&\"function\"==typeof e[a]&&(this[a]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(a));for(var o=0;o<C.length;o++)e.on(C[o],this.emit.bind(this,C[o]));return this._read=function(t){c(\"wrapped _read\",t),n&&(n=!1,e.resume())},this},\"function\"==typeof Symbol&&(Readable.prototype[Symbol.asyncIterator]=function(){return void 0===p&&(p=r(955)),p(this)}),Object.defineProperty(Readable.prototype,\"readableHighWaterMark\",{enumerable:!1,get:function get(){return this._readableState.highWaterMark}}),Object.defineProperty(Readable.prototype,\"readableBuffer\",{enumerable:!1,get:function get(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Readable.prototype,\"readableFlowing\",{enumerable:!1,get:function get(){return this._readableState.flowing},set:function set(e){this._readableState&&(this._readableState.flowing=e)}}),Readable._fromList=fromList,Object.defineProperty(Readable.prototype,\"readableLength\",{enumerable:!1,get:function get(){return this._readableState.length}}),\"function\"==typeof Symbol&&(Readable.from=function(e,t){return void 0===m&&(m=r(157)),m(Readable,e,t)})},610:function(e,t,r){e.exports=Transform;var n=r(48).F,a=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,l=n.ERR_TRANSFORM_WITH_LENGTH_0,i=r(382);function afterTransform(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit(\"error\",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function Transform(e){if(!(this instanceof Transform))return new Transform(e);i.call(this,e),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(\"function\"==typeof e.transform&&(this._transform=e.transform),\"function\"==typeof e.flush&&(this._flush=e.flush)),this.on(\"prefinish\",prefinish)}function prefinish(){var e=this;\"function\"!=typeof this._flush||this._readableState.destroyed?done(this,null,null):this._flush((function(t,r){done(e,t,r)}))}function done(e,t,r){if(t)return e.emit(\"error\",t);if(null!=r&&e.push(r),e._writableState.length)throw new l;if(e._transformState.transforming)throw new s;return e.push(null)}r(698)(Transform,i),Transform.prototype.push=function(e,t){return this._transformState.needTransform=!1,i.prototype.push.call(this,e,t)},Transform.prototype._transform=function(e,t,r){r(new a(\"_transform()\"))},Transform.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var a=this._readableState;(n.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},Transform.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},Transform.prototype._destroy=function(e,t){i.prototype._destroy.call(this,e,(function(e){t(e)}))}},708:function(e,t,r){var n,a=r(606);function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function onCorkedFinish(e,t,r){var n=e.entry;e.entry=null;for(;n;){var a=n.callback;t.pendingcb--,a(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=Writable,Writable.WritableState=WritableState;var o={deprecate:r(643)},s=r(345),l=r(287).Buffer,i=(void 0!==r.g?r.g:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var c,u=r(896),d=r(291).getHighWaterMark,p=r(48).F,m=p.ERR_INVALID_ARG_TYPE,f=p.ERR_METHOD_NOT_IMPLEMENTED,h=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,y=p.ERR_STREAM_DESTROYED,S=p.ERR_STREAM_NULL_VALUES,_=p.ERR_STREAM_WRITE_AFTER_END,v=p.ERR_UNKNOWN_ENCODING,b=u.errorOrDestroy;function nop(){}function WritableState(e,t,o){n=n||r(382),e=e||{},\"boolean\"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,\"writableHighWaterMark\",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function onwrite(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if(\"function\"!=typeof o)throw new h;if(function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function onwriteError(e,t,r,n,o){--t.pendingcb,r?(a.nextTick(o,n),a.nextTick(finishMaybe,e,t),e._writableState.errorEmitted=!0,b(e,n)):(o(n),e._writableState.errorEmitted=!0,b(e,n),finishMaybe(e,t))}(e,r,n,t,o);else{var s=needFinish(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||clearBuffer(e,r),n?a.nextTick(afterWrite,e,r,s,o):afterWrite(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(e){var t=this instanceof(n=n||r(382));if(!t&&!c.call(Writable,this))return new Writable(e);this._writableState=new WritableState(e,this,t),this.writable=!0,e&&(\"function\"==typeof e.write&&(this._write=e.write),\"function\"==typeof e.writev&&(this._writev=e.writev),\"function\"==typeof e.destroy&&(this._destroy=e.destroy),\"function\"==typeof e.final&&(this._final=e.final)),s.call(this)}function doWrite(e,t,r,n,a,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y(\"write\")):r?e._writev(a,t.onwrite):e._write(a,o,t.onwrite),t.sync=!1}function afterWrite(e,t,r,n){r||function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit(\"drain\"))}(e,t),t.pendingcb--,n(),finishMaybe(e,t)}function clearBuffer(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,l=!0;r;)a[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;a.allBuffers=l,doWrite(e,t,!0,t.length,a,\"\",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new CorkedRequest(t),t.bufferedRequestCount=0}else{for(;r;){var i=r.chunk,c=r.encoding,u=r.callback;if(doWrite(e,t,!1,t.objectMode?1:i.length,i,c,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function needFinish(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function callFinal(e,t){e._final((function(r){t.pendingcb--,r&&b(e,r),t.prefinished=!0,e.emit(\"prefinish\"),finishMaybe(e,t)}))}function finishMaybe(e,t){var r=needFinish(t);if(r&&(function prefinish(e,t){t.prefinished||t.finalCalled||(\"function\"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit(\"prefinish\")):(t.pendingcb++,t.finalCalled=!0,a.nextTick(callFinal,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit(\"finish\"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(698)(Writable,s),WritableState.prototype.getBuffer=function getBuffer(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(WritableState.prototype,\"buffer\",{get:o.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch(e){}}(),\"function\"==typeof Symbol&&Symbol.hasInstance&&\"function\"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(e){return!!c.call(this,e)||this===Writable&&(e&&e._writableState instanceof WritableState)}})):c=function realHasInstance(e){return e instanceof this},Writable.prototype.pipe=function(){b(this,new g)},Writable.prototype.write=function(e,t,r){var n=this._writableState,o=!1,s=!n.objectMode&&function _isUint8Array(e){return l.isBuffer(e)||e instanceof i}(e);return s&&!l.isBuffer(e)&&(e=function _uint8ArrayToBuffer(e){return l.from(e)}(e)),\"function\"==typeof t&&(r=t,t=null),s?t=\"buffer\":t||(t=n.defaultEncoding),\"function\"!=typeof r&&(r=nop),n.ending?function writeAfterEnd(e,t){var r=new _;b(e,r),a.nextTick(t,r)}(this,r):(s||function validChunk(e,t,r,n){var o;return null===r?o=new S:\"string\"==typeof r||t.objectMode||(o=new m(\"chunk\",[\"string\",\"Buffer\"],r)),!o||(b(e,o),a.nextTick(n,o),!1)}(this,n,e,r))&&(n.pendingcb++,o=function writeOrBuffer(e,t,r,n,a,o){if(!r){var s=function decodeChunk(e,t,r){e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=l.from(t,r));return t}(t,n,a);n!==s&&(r=!0,a=\"buffer\",n=s)}var i=t.objectMode?1:n.length;t.length+=i;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:a,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else doWrite(e,t,!1,i,n,a,o);return c}(this,n,s,e,t,r)),o},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||clearBuffer(this,e))},Writable.prototype.setDefaultEncoding=function setDefaultEncoding(e){if(\"string\"==typeof e&&(e=e.toLowerCase()),!([\"hex\",\"utf8\",\"utf-8\",\"ascii\",\"binary\",\"base64\",\"ucs2\",\"ucs-2\",\"utf16le\",\"utf-16le\",\"raw\"].indexOf((e+\"\").toLowerCase())>-1))throw new v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(Writable.prototype,\"writableBuffer\",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Writable.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(e,t,r){r(new f(\"_write()\"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,r){var n=this._writableState;return\"function\"==typeof e?(r=e,e=null,t=null):\"function\"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function endWritable(e,t,r){t.ending=!0,finishMaybe(e,t),r&&(t.finished?a.nextTick(r):e.once(\"finish\",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(Writable.prototype,\"writableLength\",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Writable.prototype,\"destroyed\",{enumerable:!1,get:function get(){return void 0!==this._writableState&&this._writableState.destroyed},set:function set(e){this._writableState&&(this._writableState.destroyed=e)}}),Writable.prototype.destroy=u.destroy,Writable.prototype._undestroy=u.undestroy,Writable.prototype._destroy=function(e,t){t(e)}},955:function(e,t,r){var n,a=r(606);function _defineProperty(e,t,r){return(t=function _toPropertyKey(e){var t=function _toPrimitive(e,t){if(\"object\"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||\"default\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)}(e,\"string\");return\"symbol\"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(238),s=Symbol(\"lastResolve\"),l=Symbol(\"lastReject\"),i=Symbol(\"error\"),c=Symbol(\"ended\"),u=Symbol(\"lastPromise\"),d=Symbol(\"handlePromise\"),p=Symbol(\"stream\");function createIterResult(e,t){return{value:e,done:t}}function readAndResolve(e){var t=e[s];if(null!==t){var r=e[p].read();null!==r&&(e[u]=null,e[s]=null,e[l]=null,t(createIterResult(r,!1)))}}function onReadable(e){a.nextTick(readAndResolve,e)}var m=Object.getPrototypeOf((function(){})),f=Object.setPrototypeOf((_defineProperty(n={get stream(){return this[p]},next:function next(){var e=this,t=this[i];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(createIterResult(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){a.nextTick((function(){e[i]?r(e[i]):t(createIterResult(void 0,!0))}))}));var r,n=this[u];if(n)r=new Promise(function wrapForNext(e,t){return function(r,n){e.then((function(){t[c]?r(createIterResult(void 0,!0)):t[d](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(createIterResult(o,!1));r=new Promise(this[d])}return this[u]=r,r}},Symbol.asyncIterator,(function(){return this})),_defineProperty(n,\"return\",(function _return(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(createIterResult(void 0,!0))}))}))})),n),m);e.exports=function createReadableStreamAsyncIterator(e){var t,r=Object.create(f,(_defineProperty(t={},p,{value:e,writable:!0}),_defineProperty(t,s,{value:null,writable:!0}),_defineProperty(t,l,{value:null,writable:!0}),_defineProperty(t,i,{value:null,writable:!0}),_defineProperty(t,c,{value:e._readableState.endEmitted,writable:!0}),_defineProperty(t,d,{value:function value(e,t){var n=r[p].read();n?(r[u]=null,r[s]=null,r[l]=null,e(createIterResult(n,!1))):(r[s]=e,r[l]=t)},writable:!0}),t));return r[u]=null,o(e,(function(e){if(e&&\"ERR_STREAM_PREMATURE_CLOSE\"!==e.code){var t=r[l];return null!==t&&(r[u]=null,r[s]=null,r[l]=null,t(e)),void(r[i]=e)}var n=r[s];null!==n&&(r[u]=null,r[s]=null,r[l]=null,n(createIterResult(void 0,!0))),r[c]=!0})),e.on(\"readable\",onReadable.bind(null,r)),r}},726:function(e,t,r){function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _toPropertyKey(e){var t=function _toPrimitive(e,t){if(\"object\"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||\"default\");if(\"object\"!=typeof n)return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)}(e,\"string\");return\"symbol\"==typeof t?t:String(t)}var n=r(287).Buffer,a=r(340).inspect,o=a&&a.custom||\"inspect\";e.exports=function(){function BufferList(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,BufferList),this.head=null,this.tail=null,this.length=0}return function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,\"prototype\",{writable:!1}),e}(BufferList,[{key:\"push\",value:function push(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:\"unshift\",value:function unshift(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:\"shift\",value:function shift(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:\"clear\",value:function clear(){this.head=this.tail=null,this.length=0}},{key:\"join\",value:function join(e){if(0===this.length)return\"\";for(var t=this.head,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r}},{key:\"concat\",value:function concat(e){if(0===this.length)return n.alloc(0);for(var t,r,a,o=n.allocUnsafe(e>>>0),s=this.head,l=0;s;)t=s.data,r=o,a=l,n.prototype.copy.call(t,r,a),l+=s.data.length,s=s.next;return o}},{key:\"consume\",value:function consume(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:\"first\",value:function first(){return this.head.data}},{key:\"_getString\",value:function _getString(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var a=t.data,o=e>a.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(o));break}++r}return this.length-=r,n}},{key:\"_getBuffer\",value:function _getBuffer(e){var t=n.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,s),0===(e-=s)){s===o.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(s));break}++a}return this.length-=a,t}},{key:o,value:function value(e,t){return a(this,_objectSpread(_objectSpread({},t),{},{depth:0,customInspect:!1}))}}]),BufferList}()},896:function(e,t,r){var n=r(606);function emitErrorAndCloseNT(e,t){emitErrorNT(e,t),emitCloseNT(e)}function emitCloseNT(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(\"close\")}function emitErrorNT(e,t){e.emit(\"error\",t)}e.exports={destroy:function destroy(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(emitErrorNT,this,e)):n.nextTick(emitErrorNT,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(emitCloseNT,r):(r._writableState.errorEmitted=!0,n.nextTick(emitErrorAndCloseNT,r,e)):n.nextTick(emitErrorAndCloseNT,r,e):t?(n.nextTick(emitCloseNT,r),t(e)):n.nextTick(emitCloseNT,r)})),this)},undestroy:function undestroy(){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)},errorOrDestroy:function errorOrDestroy(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit(\"error\",t)}}},238:function(e,t,r){var n=r(48).F.ERR_STREAM_PREMATURE_CLOSE;function noop(){}e.exports=function eos(e,t,r){if(\"function\"==typeof t)return eos(e,null,t);t||(t={}),r=function once(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];e.apply(this,n)}}}(r||noop);var a=t.readable||!1!==t.readable&&e.readable,o=t.writable||!1!==t.writable&&e.writable,s=function onlegacyfinish(){e.writable||i()},l=e._writableState&&e._writableState.finished,i=function onfinish(){o=!1,l=!0,a||r.call(e)},c=e._readableState&&e._readableState.endEmitted,u=function onend(){a=!1,c=!0,o||r.call(e)},d=function onerror(t){r.call(e,t)},p=function onclose(){var t;return a&&!c?(e._readableState&&e._readableState.ended||(t=new n),r.call(e,t)):o&&!l?(e._writableState&&e._writableState.ended||(t=new n),r.call(e,t)):void 0},m=function onrequest(){e.req.on(\"finish\",i)};return!function isRequest(e){return e.setHeader&&\"function\"==typeof e.abort}(e)?o&&!e._writableState&&(e.on(\"end\",s),e.on(\"close\",s)):(e.on(\"complete\",i),e.on(\"abort\",p),e.req?m():e.on(\"request\",m)),e.on(\"end\",u),e.on(\"finish\",i),!1!==t.error&&e.on(\"error\",d),e.on(\"close\",p),function(){e.removeListener(\"complete\",i),e.removeListener(\"abort\",p),e.removeListener(\"request\",m),e.req&&e.req.removeListener(\"finish\",i),e.removeListener(\"end\",s),e.removeListener(\"close\",s),e.removeListener(\"finish\",i),e.removeListener(\"end\",u),e.removeListener(\"error\",d),e.removeListener(\"close\",p)}}},157:function(e){e.exports=function(){throw new Error(\"Readable.from is not available in the browser\")}},758:function(e,t,r){var n;var a=r(48).F,o=a.ERR_MISSING_ARGS,s=a.ERR_STREAM_DESTROYED;function noop(e){if(e)throw e}function call(e){e()}function pipe(e,t){return e.pipe(t)}e.exports=function pipeline(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var l,i=function popCallback(e){return e.length?\"function\"!=typeof e[e.length-1]?noop:e.pop():noop}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o(\"streams\");var c=t.map((function(e,a){var o=a<t.length-1;return function destroyer(e,t,a,o){o=function once(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var l=!1;e.on(\"close\",(function(){l=!0})),void 0===n&&(n=r(238)),n(e,{readable:t,writable:a},(function(e){if(e)return o(e);l=!0,o()}));var i=!1;return function(t){if(!l&&!i)return i=!0,function isRequest(e){return e.setHeader&&\"function\"==typeof e.abort}(e)?e.abort():\"function\"==typeof e.destroy?e.destroy():void o(t||new s(\"pipe\"))}}(e,o,a>0,(function(e){l||(l=e),e&&c.forEach(call),o||(c.forEach(call),i(l))}))}));return t.reduce(pipe)}},291:function(e,t,r){var n=r(48).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function getHighWaterMark(e,t,r,a){var o=function highWaterMarkFrom(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(a?r:\"highWaterMark\",o);return Math.floor(o)}return e.objectMode?16:16384}}},345:function(e,t,r){e.exports=r(7).EventEmitter},861:function(e,t,r){var n=r(287),a=n.Buffer;function copyProps(e,t){for(var r in e)t[r]=e[r]}function SafeBuffer(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=n:(copyProps(n,t),t.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(a.prototype),copyProps(a,SafeBuffer),SafeBuffer.from=function(e,t,r){if(\"number\"==typeof e)throw new TypeError(\"Argument must not be a number\");return a(e,t,r)},SafeBuffer.alloc=function(e,t,r){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");var n=a(e);return void 0!==t?\"string\"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},SafeBuffer.allocUnsafe=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return a(e)},SafeBuffer.allocUnsafeSlow=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return n.SlowBuffer(e)}},392:function(e,t,r){var n=r(861).Buffer;function Hash(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){\"string\"==typeof e&&(t=t||\"utf8\",e=n.from(e,t));for(var r=this._block,a=this._blockSize,o=e.length,s=this._len,l=0;l<o;){for(var i=s%a,c=Math.min(o-l,a-i),u=0;u<c;u++)r[i+u]=e[l+u];l+=c,(s+=c)%a==0&&this._update(r)}return this._len+=o,this},Hash.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,a=(r-n)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error(\"_update must be implemented by subclass\")},e.exports=Hash},802:function(e,t,r){var n=e.exports=function SHA(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+\" is not supported (we accept pull requests)\");return new t};n.sha=r(816),n.sha1=r(737),n.sha224=r(710),n.sha256=r(107),n.sha384=r(827),n.sha512=r(890)},816:function(e,t,r){var n=r(698),a=r(392),o=r(861).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);function Sha(){this.init(),this._w=l,a.call(this,64,56)}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(Sha,a),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,a=0|this._b,o=0|this._c,l=0|this._d,i=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var u=0;u<80;++u){var d=~~(u/20),p=0|((t=n)<<5|t>>>27)+ft(d,a,o,l)+i+r[u]+s[d];i=l,l=o,o=rotl30(a),a=n,n=p}this._a=n+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=l+this._d|0,this._e=i+this._e|0},Sha.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=Sha},737:function(e,t,r){var n=r(698),a=r(392),o=r(861).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);function Sha1(){this.init(),this._w=l,a.call(this,64,56)}function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(Sha1,a),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,a=0|this._b,o=0|this._c,l=0|this._d,i=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var u=0;u<80;++u){var d=~~(u/20),p=rotl5(n)+ft(d,a,o,l)+i+r[u]+s[d]|0;i=l,l=o,o=rotl30(a),a=n,n=p}this._a=n+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=l+this._d|0,this._e=i+this._e|0},Sha1.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=Sha1},710:function(e,t,r){var n=r(698),a=r(107),o=r(392),s=r(861).Buffer,l=new Array(64);function Sha224(){this.init(),this._w=l,o.call(this,64,56)}n(Sha224,a),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=Sha224},107:function(e,t,r){var n=r(698),a=r(392),o=r(861).Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=new Array(64);function Sha256(){this.init(),this._w=l,a.call(this,64,56)}function ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function sigma1(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function gamma0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(Sha256,a),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,a=0|this._b,o=0|this._c,l=0|this._d,i=0|this._e,c=0|this._f,u=0|this._g,d=0|this._h,p=0;p<16;++p)r[p]=e.readInt32BE(4*p);for(;p<64;++p)r[p]=0|(((t=r[p-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[p-7]+gamma0(r[p-15])+r[p-16];for(var m=0;m<64;++m){var f=d+sigma1(i)+ch(i,c,u)+s[m]+r[m]|0,h=sigma0(n)+maj(n,a,o)|0;d=u,u=c,c=i,i=l+f|0,l=o,o=a,a=n,n=f+h|0}this._a=n+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=l+this._d|0,this._e=i+this._e|0,this._f=c+this._f|0,this._g=u+this._g|0,this._h=d+this._h|0},Sha256.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=Sha256},827:function(e,t,r){var n=r(698),a=r(890),o=r(392),s=r(861).Buffer,l=new Array(160);function Sha384(){this.init(),this._w=l,o.call(this,128,112)}n(Sha384,a),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){var e=s.allocUnsafe(48);function writeInt64BE(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),e},e.exports=Sha384},890:function(e,t,r){var n=r(698),a=r(392),o=r(861).Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],l=new Array(160);function Sha512(){this.init(),this._w=l,a.call(this,128,112)}function Ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function sigma1(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Gamma0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Gamma0l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Gamma1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gamma1l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function getCarry(e,t){return e>>>0<t>>>0?1:0}n(Sha512,a),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,a=0|this._ch,o=0|this._dh,l=0|this._eh,i=0|this._fh,c=0|this._gh,u=0|this._hh,d=0|this._al,p=0|this._bl,m=0|this._cl,f=0|this._dl,h=0|this._el,g=0|this._fl,y=0|this._gl,S=0|this._hl,_=0;_<32;_+=2)t[_]=e.readInt32BE(4*_),t[_+1]=e.readInt32BE(4*_+4);for(;_<160;_+=2){var v=t[_-30],b=t[_-30+1],w=Gamma0(v,b),C=Gamma0l(b,v),x=Gamma1(v=t[_-4],b=t[_-4+1]),O=Gamma1l(b,v),k=t[_-14],N=t[_-14+1],A=t[_-32],I=t[_-32+1],R=C+N|0,T=w+k+getCarry(R,C)|0;T=(T=T+x+getCarry(R=R+O|0,O)|0)+A+getCarry(R=R+I|0,I)|0,t[_]=T,t[_+1]=R}for(var B=0;B<160;B+=2){T=t[B],R=t[B+1];var j=maj(r,n,a),P=maj(d,p,m),M=sigma0(r,d),q=sigma0(d,r),L=sigma1(l,h),D=sigma1(h,l),U=s[B],$=s[B+1],J=Ch(l,i,c),V=Ch(h,g,y),K=S+D|0,z=u+L+getCarry(K,S)|0;z=(z=(z=z+J+getCarry(K=K+V|0,V)|0)+U+getCarry(K=K+$|0,$)|0)+T+getCarry(K=K+R|0,R)|0;var F=q+P|0,W=M+j+getCarry(F,q)|0;u=c,S=y,c=i,y=g,i=l,g=h,l=o+z+getCarry(h=f+K|0,f)|0,o=a,f=m,a=n,m=p,n=r,p=d,r=z+W+getCarry(d=K+F|0,K)|0}this._al=this._al+d|0,this._bl=this._bl+p|0,this._cl=this._cl+m|0,this._dl=this._dl+f|0,this._el=this._el+h|0,this._fl=this._fl+g|0,this._gl=this._gl+y|0,this._hl=this._hl+S|0,this._ah=this._ah+r+getCarry(this._al,d)|0,this._bh=this._bh+n+getCarry(this._bl,p)|0,this._ch=this._ch+a+getCarry(this._cl,m)|0,this._dh=this._dh+o+getCarry(this._dl,f)|0,this._eh=this._eh+l+getCarry(this._el,h)|0,this._fh=this._fh+i+getCarry(this._fl,g)|0,this._gh=this._gh+c+getCarry(this._gl,y)|0,this._hh=this._hh+u+getCarry(this._hl,S)|0},Sha512.prototype._hash=function(){var e=o.allocUnsafe(64);function writeInt64BE(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),e},e.exports=Sha512},310:function(e,t,r){e.exports=Stream;var n=r(7).EventEmitter;function Stream(){n.call(this)}r(698)(Stream,n),Stream.Readable=r(412),Stream.Writable=r(708),Stream.Duplex=r(382),Stream.Transform=r(610),Stream.PassThrough=r(600),Stream.finished=r(238),Stream.pipeline=r(758),Stream.Stream=Stream,Stream.prototype.pipe=function(e,t){var r=this;function ondata(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function ondrain(){r.readable&&r.resume&&r.resume()}r.on(\"data\",ondata),e.on(\"drain\",ondrain),e._isStdio||t&&!1===t.end||(r.on(\"end\",onend),r.on(\"close\",onclose));var a=!1;function onend(){a||(a=!0,e.end())}function onclose(){a||(a=!0,\"function\"==typeof e.destroy&&e.destroy())}function onerror(e){if(cleanup(),0===n.listenerCount(this,\"error\"))throw e}function cleanup(){r.removeListener(\"data\",ondata),e.removeListener(\"drain\",ondrain),r.removeListener(\"end\",onend),r.removeListener(\"close\",onclose),r.removeListener(\"error\",onerror),e.removeListener(\"error\",onerror),r.removeListener(\"end\",cleanup),r.removeListener(\"close\",cleanup),e.removeListener(\"close\",cleanup)}return r.on(\"error\",onerror),e.on(\"error\",onerror),r.on(\"end\",cleanup),r.on(\"close\",cleanup),e.on(\"close\",cleanup),e.emit(\"pipe\",r),e}},141:function(e,t,r){var n=r(861).Buffer,a=n.isEncoding||function(e){switch((e=\"\"+e)&&e.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 StringDecoder(e){var t;switch(this.encoding=function normalizeEncoding(e){var t=function _normalizeEncoding(e){if(!e)return\"utf8\";for(var t;;)switch(e){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 e;default:if(t)return;e=(\"\"+e).toLowerCase(),t=!0}}(e);if(\"string\"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error(\"Unknown encoding: \"+e);return t||e}(e),this.encoding){case\"utf16le\":this.text=utf16Text,this.end=utf16End,t=4;break;case\"utf8\":this.fillLast=utf8FillLast,t=4;break;case\"base64\":this.text=base64Text,this.end=base64End,t=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function utf8CheckByte(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed,r=function utf8CheckExtraBytes(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,\"�\";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,\"�\";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,\"�\"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function utf16Text(e,t){if((e.length-t)%2==0){var r=e.toString(\"utf16le\",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(\"utf16le\",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):\"\";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(\"utf16le\",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;return 0===r?e.toString(\"base64\",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(\"base64\",t,e.length-r))}function base64End(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+this.lastChar.toString(\"base64\",0,3-this.lastNeed):t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):\"\"}t.I=StringDecoder,StringDecoder.prototype.write=function(e){if(0===e.length)return\"\";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return\"\";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||\"\"},StringDecoder.prototype.end=function utf8End(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+\"�\":t},StringDecoder.prototype.text=function utf8Text(e,t){var r=function utf8CheckIncomplete(e,t,r){var n=t.length-1;if(n<r)return 0;var a=utf8CheckByte(t[n]);if(a>=0)return a>0&&(e.lastNeed=a-1),a;if(--n<r||-2===a)return 0;if(a=utf8CheckByte(t[n]),a>=0)return a>0&&(e.lastNeed=a-2),a;if(--n<r||-2===a)return 0;if(a=utf8CheckByte(t[n]),a>=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString(\"utf8\",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString(\"utf8\",t,n)},StringDecoder.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},643:function(e,t,r){function config(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&\"true\"===String(t).toLowerCase()}e.exports=function deprecate(e,t){if(config(\"noDeprecation\"))return e;var r=!1;return function deprecated(){if(!r){if(config(\"throwDeprecation\"))throw new Error(t);config(\"traceDeprecation\")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},499:function(e){var t={\"&\":\"&amp;\",'\"':\"&quot;\",\"'\":\"&apos;\",\"<\":\"&lt;\",\">\":\"&gt;\"};e.exports=function escapeForXML(e){return e&&e.replace?e.replace(/([&\"<>'])/g,(function(e,r){return t[r]})):e}},123:function(e,t,r){var n=r(606),a=r(499),o=r(310).Stream;function resolve(e,t,r){var n,o=function create_indent(e,t){return new Array(t||0).join(e||\"\")}(t,r=r||0),s=e;if(\"object\"==typeof e&&((s=e[n=Object.keys(e)[0]])&&s._elem))return s._elem.name=n,s._elem.icount=r,s._elem.indent=t,s._elem.indents=o,s._elem.interrupt=s,s._elem;var l,i=[],c=[];function get_attributes(e){Object.keys(e).forEach((function(t){i.push(function attribute(e,t){return e+'=\"'+a(t)+'\"'}(t,e[t]))}))}switch(typeof s){case\"object\":if(null===s)break;s._attr&&get_attributes(s._attr),s._cdata&&c.push((\"<![CDATA[\"+s._cdata).replace(/\\]\\]>/g,\"]]]]><![CDATA[>\")+\"]]>\"),s.forEach&&(l=!1,c.push(\"\"),s.forEach((function(e){\"object\"==typeof e?\"_attr\"==Object.keys(e)[0]?get_attributes(e._attr):c.push(resolve(e,t,r+1)):(c.pop(),l=!0,c.push(a(e)))})),l||c.push(\"\"));break;default:c.push(a(s))}return{name:n,interrupt:!1,attributes:i,content:c,icount:r,indents:o,indent:t}}function format(e,t,r){if(\"object\"!=typeof t)return e(!1,t);var n=t.interrupt?1:t.content.length;function proceed(){for(;t.content.length;){var a=t.content.shift();if(void 0!==a){if(interrupt(a))return;format(e,a)}}e(!1,(n>1?t.indents:\"\")+(t.name?\"</\"+t.name+\">\":\"\")+(t.indent&&!r?\"\\n\":\"\")),r&&r()}function interrupt(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=proceed,t.interrupt=!1,e(!0),!0)}if(e(!1,t.indents+(t.name?\"<\"+t.name:\"\")+(t.attributes.length?\" \"+t.attributes.join(\" \"):\"\")+(n?t.name?\">\":\"\":t.name?\"/>\":\"\")+(t.indent&&n>1?\"\\n\":\"\")),!n)return e(!1,t.indent?\"\\n\":\"\");interrupt(t)||proceed()}e.exports=function xml(e,t){\"object\"!=typeof t&&(t={indent:t});var r=t.stream?new o:null,a=\"\",s=!1,l=t.indent?!0===t.indent?\"    \":t.indent:\"\",i=!0;function delay(e){i?n.nextTick(e):e()}function append(e,t){if(void 0!==t&&(a+=t),e&&!s&&(r=r||new o,s=!0),e&&s){var n=a;delay((function(){r.emit(\"data\",n)})),a=\"\"}}function add(e,t){format(append,resolve(e,l,l?1:0),t)}function end(){if(r){var e=a;delay((function(){r.emit(\"data\",e),r.emit(\"end\"),r.readable=!1,r.emit(\"close\")}))}}return delay((function(){i=!1})),t.declaration&&function addXmlDeclaration(e){var t={version:\"1.0\",encoding:e.encoding||\"UTF-8\"};e.standalone&&(t.standalone=e.standalone),add({\"?xml\":{_attr:t}}),a=a.replace(\"/>\",\"?>\")}(t.declaration),e&&e.forEach?e.forEach((function(t,r){var n;r+1===e.length&&(n=end),add(t,n)})):add(e,end),r?(r.readable=!0,r):a},e.exports.element=e.exports.Element=function element(){var e={_elem:resolve(Array.prototype.slice.call(arguments)),push:function(e){if(!this.append)throw new Error(\"not assigned to a parent!\");var t=this,r=this._elem.indent;format(this.append,resolve(e,r,this._elem.icount+(r?1:0)),(function(){t.append(!0)}))},close:function(e){void 0!==e&&this.push(e),this.end&&this.end()}};return e}},987:function(t){t.exports=e},362:function(e){e.exports=t},340:function(){},838:function(){}},xe={};function __webpack_require__(e){var t=xe[e];if(void 0!==t)return t.exports;var r=xe[e]={exports:{}};return Ce[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var Oe={};!function(){__webpack_require__.d(Oe,{A:function(){return Ys}});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{CLEAR:function(){return nt},CLEAR_BY:function(){return at},NEW_AUTH_ERR:function(){return rt},NEW_SPEC_ERR:function(){return et},NEW_SPEC_ERR_BATCH:function(){return tt},NEW_THROWN_ERR:function(){return Qe},NEW_THROWN_ERR_BATCH:function(){return Ze},clear:function(){return clear},clearBy:function(){return clearBy},newAuthErr:function(){return newAuthErr},newSpecErr:function(){return newSpecErr},newSpecErrBatch:function(){return newSpecErrBatch},newThrownErr:function(){return newThrownErr},newThrownErrBatch:function(){return newThrownErrBatch}});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{AUTHORIZE:function(){return xt},AUTHORIZE_OAUTH2:function(){return Nt},CONFIGURE_AUTH:function(){return It},LOGOUT:function(){return Ot},PRE_AUTHORIZE_OAUTH2:function(){return kt},RESTORE_AUTHORIZATION:function(){return Rt},SHOW_AUTH_POPUP:function(){return Ct},VALIDATE:function(){return At},authPopup:function(){return authPopup},authorize:function(){return authorize},authorizeAccessCodeWithBasicAuthentication:function(){return authorizeAccessCodeWithBasicAuthentication},authorizeAccessCodeWithFormParams:function(){return authorizeAccessCodeWithFormParams},authorizeApplication:function(){return authorizeApplication},authorizeOauth2:function(){return authorizeOauth2},authorizeOauth2WithPersistOption:function(){return authorizeOauth2WithPersistOption},authorizePassword:function(){return authorizePassword},authorizeRequest:function(){return authorizeRequest},authorizeWithPersistOption:function(){return authorizeWithPersistOption},configureAuth:function(){return configureAuth},logout:function(){return logout},logoutWithPersistOption:function(){return logoutWithPersistOption},persistAuthorizationIfNeeded:function(){return persistAuthorizationIfNeeded},preAuthorizeImplicit:function(){return preAuthorizeImplicit},restoreAuthorization:function(){return restoreAuthorization},showDefinitions:function(){return showDefinitions}});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{authorized:function(){return Mt},definitionsForRequirements:function(){return definitionsForRequirements},definitionsToAuthorize:function(){return Pt},getConfigs:function(){return qt},getDefinitionsByNames:function(){return getDefinitionsByNames},isAuthorized:function(){return isAuthorized},shownDefinitions:function(){return jt}});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{TOGGLE_CONFIGS:function(){return Kt},UPDATE_CONFIGS:function(){return Vt},downloadConfig:function(){return downloadConfig},getConfigByUrl:function(){return getConfigByUrl},loaded:function(){return actions_loaded},toggle:function(){return toggle},update:function(){return update}});var Ce={};__webpack_require__.r(Ce),__webpack_require__.d(Ce,{get:function(){return get}});var xe={};__webpack_require__.r(xe),__webpack_require__.d(xe,{transform:function(){return transform}});var ke={};__webpack_require__.r(ke),__webpack_require__.d(ke,{transform:function(){return parameter_oneof_transform}});var Ne={};__webpack_require__.r(Ne),__webpack_require__.d(Ne,{allErrors:function(){return tr},lastError:function(){return rr}});var Ae={};__webpack_require__.r(Ae),__webpack_require__.d(Ae,{SHOW:function(){return lr},UPDATE_FILTER:function(){return or},UPDATE_LAYOUT:function(){return ar},UPDATE_MODE:function(){return sr},changeMode:function(){return changeMode},show:function(){return actions_show},updateFilter:function(){return updateFilter},updateLayout:function(){return updateLayout}});var Ie={};__webpack_require__.r(Ie),__webpack_require__.d(Ie,{current:function(){return current},currentFilter:function(){return currentFilter},isShown:function(){return isShown},showSummary:function(){return cr},whatMode:function(){return whatMode}});var Re={};__webpack_require__.r(Re),__webpack_require__.d(Re,{taggedOperations:function(){return taggedOperations}});var Te={};__webpack_require__.r(Te),__webpack_require__.d(Te,{requestSnippetGenerator_curl_bash:function(){return requestSnippetGenerator_curl_bash},requestSnippetGenerator_curl_cmd:function(){return requestSnippetGenerator_curl_cmd},requestSnippetGenerator_curl_powershell:function(){return requestSnippetGenerator_curl_powershell}});var Be={};__webpack_require__.r(Be),__webpack_require__.d(Be,{getActiveLanguage:function(){return pr},getDefaultExpanded:function(){return mr},getGenerators:function(){return dr},getSnippetGenerators:function(){return getSnippetGenerators}});var je={};__webpack_require__.r(je),__webpack_require__.d(je,{JsonSchemaArrayItemFile:function(){return JsonSchemaArrayItemFile},JsonSchemaArrayItemText:function(){return JsonSchemaArrayItemText},JsonSchemaForm:function(){return JsonSchemaForm},JsonSchema_array:function(){return JsonSchema_array},JsonSchema_boolean:function(){return JsonSchema_boolean},JsonSchema_object:function(){return JsonSchema_object},JsonSchema_string:function(){return JsonSchema_string}});var Pe={};__webpack_require__.r(Pe),__webpack_require__.d(Pe,{allowTryItOutFor:function(){return allowTryItOutFor},basePath:function(){return on},canExecuteScheme:function(){return canExecuteScheme},consumes:function(){return en},consumesOptionsFor:function(){return consumesOptionsFor},contentTypeValues:function(){return contentTypeValues},currentProducesFor:function(){return currentProducesFor},definitions:function(){return an},externalDocs:function(){return Hr},findDefinition:function(){return findDefinition},getOAS3RequiredRequestBodyContentType:function(){return getOAS3RequiredRequestBodyContentType},getParameter:function(){return getParameter},hasHost:function(){return hn},host:function(){return sn},info:function(){return Wr},isMediaTypeSchemaPropertiesEqual:function(){return isMediaTypeSchemaPropertiesEqual},isOAS3:function(){return Fr},lastError:function(){return Lr},mutatedRequestFor:function(){return mutatedRequestFor},mutatedRequests:function(){return fn},operationScheme:function(){return operationScheme},operationWithMeta:function(){return operationWithMeta},operations:function(){return Zr},operationsWithRootInherited:function(){return cn},operationsWithTags:function(){return dn},parameterInclusionSettingFor:function(){return parameterInclusionSettingFor},parameterValues:function(){return parameterValues},parameterWithMeta:function(){return parameterWithMeta},parameterWithMetaByIdentity:function(){return parameterWithMetaByIdentity},parametersIncludeIn:function(){return parametersIncludeIn},parametersIncludeType:function(){return parametersIncludeType},paths:function(){return Yr},produces:function(){return tn},producesOptionsFor:function(){return producesOptionsFor},requestFor:function(){return requestFor},requests:function(){return mn},responseFor:function(){return responseFor},responses:function(){return pn},schemes:function(){return ln},security:function(){return rn},securityDefinitions:function(){return nn},semver:function(){return Xr},spec:function(){return spec},specJS:function(){return Vr},specJson:function(){return Jr},specJsonWithResolvedSubtrees:function(){return zr},specResolved:function(){return Kr},specResolvedSubtree:function(){return specResolvedSubtree},specSource:function(){return $r},specStr:function(){return Ur},tagDetails:function(){return tagDetails},taggedOperations:function(){return selectors_taggedOperations},tags:function(){return un},url:function(){return Dr},validOperationMethods:function(){return Qr},validateBeforeExecute:function(){return validateBeforeExecute},validationErrors:function(){return validationErrors},version:function(){return Gr}});var Me={};__webpack_require__.r(Me),__webpack_require__.d(Me,{CLEAR_REQUEST:function(){return Rn},CLEAR_RESPONSE:function(){return In},CLEAR_VALIDATE_PARAMS:function(){return Tn},LOG_REQUEST:function(){return An},SET_MUTATED_REQUEST:function(){return Nn},SET_REQUEST:function(){return kn},SET_RESPONSE:function(){return On},SET_SCHEME:function(){return Mn},UPDATE_EMPTY_PARAM_INCLUSION:function(){return Cn},UPDATE_JSON:function(){return bn},UPDATE_OPERATION_META_VALUE:function(){return Bn},UPDATE_PARAM:function(){return wn},UPDATE_RESOLVED:function(){return jn},UPDATE_RESOLVED_SUBTREE:function(){return Pn},UPDATE_SPEC:function(){return _n},UPDATE_URL:function(){return vn},VALIDATE_PARAMS:function(){return xn},changeConsumesValue:function(){return changeConsumesValue},changeParam:function(){return changeParam},changeParamByIdentity:function(){return changeParamByIdentity},changeProducesValue:function(){return changeProducesValue},clearRequest:function(){return clearRequest},clearResponse:function(){return clearResponse},clearValidateParams:function(){return clearValidateParams},execute:function(){return actions_execute},executeRequest:function(){return executeRequest},invalidateResolvedSubtreeCache:function(){return invalidateResolvedSubtreeCache},logRequest:function(){return logRequest},parseToJson:function(){return parseToJson},requestResolvedSubtree:function(){return requestResolvedSubtree},resolveSpec:function(){return resolveSpec},setMutatedRequest:function(){return setMutatedRequest},setRequest:function(){return setRequest},setResponse:function(){return setResponse},setScheme:function(){return setScheme},updateEmptyParamInclusion:function(){return updateEmptyParamInclusion},updateJsonSpec:function(){return updateJsonSpec},updateResolved:function(){return updateResolved},updateResolvedSubtree:function(){return updateResolvedSubtree},updateSpec:function(){return updateSpec},updateUrl:function(){return updateUrl},validateParams:function(){return validateParams}});var qe={};__webpack_require__.r(qe),__webpack_require__.d(qe,{executeRequest:function(){return wrap_actions_executeRequest},updateJsonSpec:function(){return wrap_actions_updateJsonSpec},updateSpec:function(){return wrap_actions_updateSpec},validateParams:function(){return wrap_actions_validateParams}});var Le={};__webpack_require__.r(Le),__webpack_require__.d(Le,{Button:function(){return Button},Col:function(){return Col},Collapse:function(){return Collapse},Container:function(){return Container},Input:function(){return Input},Link:function(){return Link},Row:function(){return Row},Select:function(){return Select},TextArea:function(){return TextArea}});var De={};__webpack_require__.r(De),__webpack_require__.d(De,{basePath:function(){return $a},consumes:function(){return Ja},definitions:function(){return qa},findDefinition:function(){return Ma},hasHost:function(){return La},host:function(){return Ua},produces:function(){return Va},schemes:function(){return Ka},securityDefinitions:function(){return Da},validOperationMethods:function(){return wrap_selectors_validOperationMethods}});var Ue={};__webpack_require__.r(Ue),__webpack_require__.d(Ue,{definitionsToAuthorize:function(){return za}});var $e={};__webpack_require__.r($e),__webpack_require__.d($e,{callbacksOperations:function(){return Ha},findSchema:function(){return findSchema},isOAS3:function(){return selectors_isOAS3},isOAS30:function(){return selectors_isOAS30},isSwagger2:function(){return selectors_isSwagger2},servers:function(){return Wa}});var Je={};__webpack_require__.r(Je),__webpack_require__.d(Je,{CLEAR_REQUEST_BODY_VALIDATE_ERROR:function(){return ho},CLEAR_REQUEST_BODY_VALUE:function(){return go},SET_REQUEST_BODY_VALIDATE_ERROR:function(){return fo},UPDATE_ACTIVE_EXAMPLES_MEMBER:function(){return co},UPDATE_REQUEST_BODY_INCLUSION:function(){return io},UPDATE_REQUEST_BODY_VALUE:function(){return so},UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG:function(){return lo},UPDATE_REQUEST_CONTENT_TYPE:function(){return uo},UPDATE_RESPONSE_CONTENT_TYPE:function(){return po},UPDATE_SELECTED_SERVER:function(){return oo},UPDATE_SERVER_VARIABLE_VALUE:function(){return mo},clearRequestBodyValidateError:function(){return clearRequestBodyValidateError},clearRequestBodyValue:function(){return clearRequestBodyValue},initRequestBodyValidateError:function(){return initRequestBodyValidateError},setActiveExamplesMember:function(){return setActiveExamplesMember},setRequestBodyInclusion:function(){return setRequestBodyInclusion},setRequestBodyValidateError:function(){return setRequestBodyValidateError},setRequestBodyValue:function(){return setRequestBodyValue},setRequestContentType:function(){return setRequestContentType},setResponseContentType:function(){return setResponseContentType},setRetainRequestBodyValueFlag:function(){return setRetainRequestBodyValueFlag},setSelectedServer:function(){return setSelectedServer},setServerVariableValue:function(){return setServerVariableValue}});var Ve={};__webpack_require__.r(Ve),__webpack_require__.d(Ve,{activeExamplesMember:function(){return Co},hasUserEditedBody:function(){return vo},requestBodyErrors:function(){return wo},requestBodyInclusionSetting:function(){return bo},requestBodyValue:function(){return So},requestContentType:function(){return xo},responseContentType:function(){return Oo},selectDefaultRequestBodyValue:function(){return selectDefaultRequestBodyValue},selectedServer:function(){return Eo},serverEffectiveValue:function(){return Ao},serverVariableValue:function(){return ko},serverVariables:function(){return No},shouldRetainRequestBodyValue:function(){return _o},validOperationMethods:function(){return Ro},validateBeforeExecute:function(){return Io},validateShallowRequired:function(){return validateShallowRequired}});var Ke=function(e){var t={};return __webpack_require__.d(t,e),t}({Component:function(){return r.Component},PureComponent:function(){return r.PureComponent},createContext:function(){return r.createContext},createElement:function(){return r.createElement},default:function(){return r.default},forwardRef:function(){return r.forwardRef},useCallback:function(){return r.useCallback},useContext:function(){return r.useContext},useEffect:function(){return r.useEffect},useMemo:function(){return r.useMemo},useRef:function(){return r.useRef},useState:function(){return r.useState}}),ze=function(e){var t={};return __webpack_require__.d(t,e),t}({applyMiddleware:function(){return n.applyMiddleware},bindActionCreators:function(){return n.bindActionCreators},compose:function(){return n.compose},createStore:function(){return n.createStore}}),Fe=function(e){var t={};return __webpack_require__.d(t,e),t}({List:function(){return a.List},Map:function(){return a.Map},OrderedMap:function(){return a.OrderedMap},Seq:function(){return a.Seq},Set:function(){return a.Set},default:function(){return a.default},fromJS:function(){return a.fromJS}}),We=__webpack_require__(919),He=__webpack_require__.n(We),Ge=function(e){var t={};return __webpack_require__.d(t,e),t}({combineReducers:function(){return o.combineReducers}}),Xe=function(e){var t={};return __webpack_require__.d(t,e),t}({serializeError:function(){return s.serializeError}}),Ye=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return l.default}});const Qe=\"err_new_thrown_err\",Ze=\"err_new_thrown_err_batch\",et=\"err_new_spec_err\",tt=\"err_new_spec_err_batch\",rt=\"err_new_auth_err\",nt=\"err_clear\",at=\"err_clear_by\";function newThrownErr(e){return{type:Qe,payload:(0,Xe.serializeError)(e)}}function newThrownErrBatch(e){return{type:Ze,payload:e}}function newSpecErr(e){return{type:et,payload:e}}function newSpecErrBatch(e){return{type:tt,payload:e}}function newAuthErr(e){return{type:rt,payload:e}}function clear(e={}){return{type:nt,payload:e}}function clearBy(e=(()=>!0)){return{type:at,payload:e}}var ot=function makeWindow(){var e={location:{},history:{},open:()=>{},close:()=>{},File:function(){},FormData:function(){}};if(\"undefined\"==typeof window)return e;try{e=window;for(var t of[\"File\",\"Blob\",\"FormData\"])t in window&&(e[t]=window[t])}catch(e){console.error(e)}return e}(),st=function(e){var t={};return __webpack_require__.d(t,e),t}({sanitizeUrl:function(){return i.sanitizeUrl}}),lt=(function(e){var t={};__webpack_require__.d(t,e)}({}),function(e){var t={};__webpack_require__.d(t,e)}({}),function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return d.default}})),it=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return p.default}}),ct=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return m.default}}),ut=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return f.default}}),dt=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return h.default}}),pt=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return g.default}}),mt=__webpack_require__(209),ht=__webpack_require__.n(mt),gt=__webpack_require__(802),yt=__webpack_require__.n(gt);const Et=Fe.default.Set.of(\"type\",\"format\",\"items\",\"default\",\"maximum\",\"exclusiveMaximum\",\"minimum\",\"exclusiveMinimum\",\"maxLength\",\"minLength\",\"pattern\",\"maxItems\",\"minItems\",\"uniqueItems\",\"enum\",\"multipleOf\");function getParameterSchema(e,{isOAS3:t}={}){if(!Fe.default.Map.isMap(e))return{schema:Fe.default.Map(),parameterContentMediaType:null};if(!t)return\"body\"===e.get(\"in\")?{schema:e.get(\"schema\",Fe.default.Map()),parameterContentMediaType:null}:{schema:e.filter(((e,t)=>Et.includes(t))),parameterContentMediaType:null};if(e.get(\"content\")){const t=e.get(\"content\",Fe.default.Map({})).keySeq().first();return{schema:e.getIn([\"content\",t,\"schema\"],Fe.default.Map()),parameterContentMediaType:t}}return{schema:e.get(\"schema\")?e.get(\"schema\",Fe.default.Map()):Fe.default.Map(),parameterContentMediaType:null}}var St=__webpack_require__(287).Buffer;const _t=\"default\",isImmutable=e=>Fe.default.Iterable.isIterable(e);function objectify(e){return isObject(e)?isImmutable(e)?e.toJS():e:{}}function fromJSOrdered(e){if(isImmutable(e))return e;if(e instanceof ot.File)return e;if(!isObject(e))return e;if(Array.isArray(e))return Fe.default.Seq(e).map(fromJSOrdered).toList();if((0,dt.default)(e.entries)){const t=function createObjWithHashedKeys(e){if(!(0,dt.default)(e.entries))return e;const t={},r=\"_**[]\",n={};for(let a of e.entries())if(t[a[0]]||n[a[0]]&&n[a[0]].containsMultiple){if(!n[a[0]]){n[a[0]]={containsMultiple:!0,length:1},t[`${a[0]}${r}${n[a[0]].length}`]=t[a[0]],delete t[a[0]]}n[a[0]].length+=1,t[`${a[0]}${r}${n[a[0]].length}`]=a[1]}else t[a[0]]=a[1];return t}(e);return Fe.default.OrderedMap(t).map(fromJSOrdered)}return Fe.default.OrderedMap(e).map(fromJSOrdered)}function normalizeArray(e){return Array.isArray(e)?e:[e]}function isFn(e){return\"function\"==typeof e}function isObject(e){return!!e&&\"object\"==typeof e}function isFunc(e){return\"function\"==typeof e}function isArray(e){return Array.isArray(e)}const vt=lt.default;function objMap(e,t){return Object.keys(e).reduce(((r,n)=>(r[n]=t(e[n],n),r)),{})}function objReduce(e,t){return Object.keys(e).reduce(((r,n)=>{let a=t(e[n],n);return a&&\"object\"==typeof a&&Object.assign(r,a),r}),{})}function systemThunkMiddleware(e){return({dispatch:t,getState:r})=>t=>r=>\"function\"==typeof r?r(e()):t(r)}function validateValueBySchema(e,t,r,n,a){if(!t)return[];let o=[],s=t.get(\"nullable\"),l=t.get(\"required\"),i=t.get(\"maximum\"),c=t.get(\"minimum\"),u=t.get(\"type\"),d=t.get(\"format\"),p=t.get(\"maxLength\"),m=t.get(\"minLength\"),f=t.get(\"uniqueItems\"),h=t.get(\"maxItems\"),g=t.get(\"minItems\"),y=t.get(\"pattern\");const S=r||!0===l,_=null!=e,v=S||_&&\"array\"===u||!(!S&&!_),b=s&&null===e;if(S&&!_&&!b&&!n&&!u)return o.push(\"Required field is not provided\"),o;if(b||!u||!v)return[];let w=\"string\"===u&&e,C=\"array\"===u&&Array.isArray(e)&&e.length,x=\"array\"===u&&Fe.default.List.isList(e)&&e.count();const O=[w,C,x,\"array\"===u&&\"string\"==typeof e&&e,\"file\"===u&&e instanceof ot.File,\"boolean\"===u&&(e||!1===e),\"number\"===u&&(e||0===e),\"integer\"===u&&(e||0===e),\"object\"===u&&\"object\"==typeof e&&null!==e,\"object\"===u&&\"string\"==typeof e&&e].some((e=>!!e));if(S&&!O&&!n)return o.push(\"Required field is not provided\"),o;if(\"object\"===u&&(null===a||\"application/json\"===a)){let r=e;if(\"string\"==typeof e)try{r=JSON.parse(e)}catch(e){return o.push(\"Parameter string value must be valid JSON\"),o}t&&t.has(\"required\")&&isFunc(l.isList)&&l.isList()&&l.forEach((e=>{void 0===r[e]&&o.push({propKey:e,error:\"Required property not found\"})})),t&&t.has(\"properties\")&&t.get(\"properties\").forEach(((e,t)=>{const s=validateValueBySchema(r[t],e,!1,n,a);o.push(...s.map((e=>({propKey:t,error:e}))))}))}if(y){let t=((e,t)=>{if(!new RegExp(t).test(e))return\"Value must follow pattern \"+t})(e,y);t&&o.push(t)}if(g&&\"array\"===u){let t=((e,t)=>{if(!e&&t>=1||e&&e.length<t)return`Array must contain at least ${t} item${1===t?\"\":\"s\"}`})(e,g);t&&o.push(t)}if(h&&\"array\"===u){let t=((e,t)=>{if(e&&e.length>t)return`Array must not contain more then ${t} item${1===t?\"\":\"s\"}`})(e,h);t&&o.push({needRemove:!0,error:t})}if(f&&\"array\"===u){let t=((e,t)=>{if(e&&(\"true\"===t||!0===t)){const t=(0,Fe.fromJS)(e),r=t.toSet();if(e.length>r.size){let e=(0,Fe.Set)();if(t.forEach(((r,n)=>{t.filter((e=>isFunc(e.equals)?e.equals(r):e===r)).size>1&&(e=e.add(n))})),0!==e.size)return e.map((e=>({index:e,error:\"No duplicates allowed.\"}))).toArray()}}})(e,f);t&&o.push(...t)}if(p||0===p){let t=((e,t)=>{if(e.length>t)return`Value must be no longer than ${t} character${1!==t?\"s\":\"\"}`})(e,p);t&&o.push(t)}if(m){let t=((e,t)=>{if(e.length<t)return`Value must be at least ${t} character${1!==t?\"s\":\"\"}`})(e,m);t&&o.push(t)}if(i||0===i){let t=((e,t)=>{if(e>t)return`Value must be less than ${t}`})(e,i);t&&o.push(t)}if(c||0===c){let t=((e,t)=>{if(e<t)return`Value must be greater than ${t}`})(e,c);t&&o.push(t)}if(\"string\"===u){let t;if(t=\"date-time\"===d?(e=>{if(isNaN(Date.parse(e)))return\"Value must be a DateTime\"})(e):\"uuid\"===d?(e=>{if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(e))return\"Value must be a Guid\"})(e):(e=>{if(e&&\"string\"!=typeof e)return\"Value must be a string\"})(e),!t)return o;o.push(t)}else if(\"boolean\"===u){let t=(e=>{if(\"true\"!==e&&\"false\"!==e&&!0!==e&&!1!==e)return\"Value must be a boolean\"})(e);if(!t)return o;o.push(t)}else if(\"number\"===u){let t=(e=>{if(!/^-?\\d+(\\.?\\d+)?$/.test(e))return\"Value must be a number\"})(e);if(!t)return o;o.push(t)}else if(\"integer\"===u){let t=(e=>{if(!/^-?\\d+$/.test(e))return\"Value must be an integer\"})(e);if(!t)return o;o.push(t)}else if(\"array\"===u){if(!C&&!x)return o;e&&e.forEach(((e,r)=>{const s=validateValueBySchema(e,t.get(\"items\"),!1,n,a);o.push(...s.map((e=>({index:r,error:e}))))}))}else if(\"file\"===u){let t=(e=>{if(e&&!(e instanceof ot.File))return\"Value must be a file\"})(e);if(!t)return o;o.push(t)}return o}const btoa=e=>{let t;return t=e instanceof St?e:St.from(e.toString(),\"utf-8\"),t.toString(\"base64\")},bt={operationsSorter:{alpha:(e,t)=>e.get(\"path\").localeCompare(t.get(\"path\")),method:(e,t)=>e.get(\"method\").localeCompare(t.get(\"method\"))},tagsSorter:{alpha:(e,t)=>e.localeCompare(t)}},buildFormData=e=>{let t=[];for(let r in e){let n=e[r];void 0!==n&&\"\"!==n&&t.push([r,\"=\",encodeURIComponent(n).replace(/%20/g,\"+\")].join(\"\"))}return t.join(\"&\")},shallowEqualKeys=(e,t,r)=>!!(0,it.default)(r,(r=>(0,ut.default)(e[r],t[r])));function sanitizeUrl(e){return\"string\"!=typeof e||\"\"===e?\"\":(0,st.sanitizeUrl)(e)}function requiresValidationURL(e){return!(!e||e.indexOf(\"localhost\")>=0||e.indexOf(\"127.0.0.1\")>=0||\"none\"===e)}const createDeepLinkPath=e=>\"string\"==typeof e||e instanceof String?e.trim().replace(/\\s/g,\"%20\"):\"\",escapeDeepLinkPath=e=>(0,pt.default)(createDeepLinkPath(e).replace(/%20/g,\"_\")),getExtensions=e=>e.filter(((e,t)=>/^x-/.test(t))),getCommonExtensions=e=>e.filter(((e,t)=>/^pattern|maxLength|minLength|maximum|minimum/.test(t)));function deeplyStripKey(e,t,r=(()=>!0)){if(\"object\"!=typeof e||Array.isArray(e)||null===e||!t)return e;const n=Object.assign({},e);return Object.keys(n).forEach((e=>{e===t&&r(n[e],e)?delete n[e]:n[e]=deeplyStripKey(n[e],t,r)})),n}function stringify(e){if(\"string\"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS()),\"object\"==typeof e&&null!==e)try{return JSON.stringify(e,null,2)}catch(t){return String(e)}return null==e?\"\":e.toString()}function paramToIdentifier(e,{returnAll:t=!1,allowHashes:r=!0}={}){if(!Fe.default.Map.isMap(e))throw new Error(\"paramToIdentifier: received a non-Im.Map parameter as input\");const n=e.get(\"name\"),a=e.get(\"in\");let o=[];return e&&e.hashCode&&a&&n&&r&&o.push(`${a}.${n}.hash-${e.hashCode()}`),a&&n&&o.push(`${a}.${n}`),o.push(n),t?o:o[0]||\"\"}function paramToValue(e,t){return paramToIdentifier(e,{returnAll:!0}).map((e=>t[e])).filter((e=>void 0!==e))[0]}function b64toB64UrlEncoded(e){return e.replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=/g,\"\")}const isEmptyValue=e=>!e||!(!isImmutable(e)||!e.isEmpty()),idFn=e=>e;class Store{constructor(e={}){He()(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},e),this.getSystem=this._getSystem.bind(this),this.store=function configureStore(e,t,r){return function createStoreWithMiddleware(e,t,r){let n=[systemThunkMiddleware(r)];const a=ot.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||ze.compose;return(0,ze.createStore)(e,t,a((0,ze.applyMiddleware)(...n)))}(e,t,r)}(idFn,(0,Fe.fromJS)(this.state),this.getSystem),this.buildSystem(!1),this.register(this.plugins)}getStore(){return this.store}register(e,t=!0){var r=combinePlugins(e,this.getSystem());systemExtend(this.system,r),t&&this.buildSystem();callAfterLoad.call(this.system,e,this.getSystem())&&this.buildSystem()}buildSystem(e=!0){let t=this.getStore().dispatch,r=this.getStore().getState;this.boundSystem=Object.assign({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(r,this.getSystem),this.getStateThunks(r),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}_getSystem(){return this.boundSystem}getRootInjects(){return Object.assign({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:Fe.default,React:Ke.default},this.system.rootInjects||{})}_getConfigs(){return this.system.configs}getConfigs(){return{configs:this.system.configs}}setConfigs(e){this.system.configs=e}rebuildReducer(){this.store.replaceReducer(function buildReducer(e){return function allReducers(e){let t=Object.keys(e).reduce(((t,r)=>(t[r]=function makeReducer(e){return(t=new Fe.Map,r)=>{if(!e)return t;let n=e[r.type];if(n){const e=wrapWithTryCatch(n)(t,r);return null===e?t:e}return t}}(e[r]),t)),{});if(!Object.keys(t).length)return idFn;return(0,Ge.combineReducers)(t)}(objMap(e,(e=>e.reducers)))}(this.system.statePlugins))}getType(e){let t=e[0].toUpperCase()+e.slice(1);return objReduce(this.system.statePlugins,((r,n)=>{let a=r[e];if(a)return{[n+t]:a}}))}getSelectors(){return this.getType(\"selectors\")}getActions(){return objMap(this.getType(\"actions\"),(e=>objReduce(e,((e,t)=>{if(isFn(e))return{[t]:e}}))))}getWrappedAndBoundActions(e){return objMap(this.getBoundActions(e),((e,t)=>{let r=this.system.statePlugins[t.slice(0,-7)].wrapActions;return r?objMap(e,((e,t)=>{let n=r[t];return n?(Array.isArray(n)||(n=[n]),n.reduce(((e,t)=>{let newAction=(...r)=>t(e,this.getSystem())(...r);if(!isFn(newAction))throw new TypeError(\"wrapActions needs to return a function that returns a new function (ie the wrapped action)\");return wrapWithTryCatch(newAction)}),e||Function.prototype)):e})):e}))}getWrappedAndBoundSelectors(e,t){return objMap(this.getBoundSelectors(e,t),((t,r)=>{let n=[r.slice(0,-9)],a=this.system.statePlugins[n].wrapSelectors;return a?objMap(t,((t,r)=>{let o=a[r];return o?(Array.isArray(o)||(o=[o]),o.reduce(((t,r)=>{let wrappedSelector=(...a)=>r(t,this.getSystem())(e().getIn(n),...a);if(!isFn(wrappedSelector))throw new TypeError(\"wrapSelector needs to return a function that returns a new function (ie the wrapped action)\");return wrappedSelector}),t||Function.prototype)):t})):t}))}getStates(e){return Object.keys(this.system.statePlugins).reduce(((t,r)=>(t[r]=e.get(r),t)),{})}getStateThunks(e){return Object.keys(this.system.statePlugins).reduce(((t,r)=>(t[r]=()=>e().get(r),t)),{})}getFn(){return{fn:this.system.fn}}getComponents(e){const t=this.system.components[e];return Array.isArray(t)?t.reduce(((e,t)=>t(e,this.getSystem()))):void 0!==e?this.system.components[e]:this.system.components}getBoundSelectors(e,t){return objMap(this.getSelectors(),((r,n)=>{let a=[n.slice(0,-9)];return objMap(r,(r=>(...n)=>{let o=wrapWithTryCatch(r).apply(null,[e().getIn(a),...n]);return\"function\"==typeof o&&(o=wrapWithTryCatch(o)(t())),o}))}))}getBoundActions(e){e=e||this.getStore().dispatch;const t=this.getActions(),process=e=>\"function\"!=typeof e?objMap(e,(e=>process(e))):(...t)=>{var r=null;try{r=e(...t)}catch(e){r={type:Qe,error:!0,payload:(0,Xe.serializeError)(e)}}finally{return r}};return objMap(t,(t=>(0,ze.bindActionCreators)(process(t),e)))}getMapStateToProps(){return()=>Object.assign({},this.getSystem())}getMapDispatchToProps(e){return t=>He()({},this.getWrappedAndBoundActions(t),this.getFn(),e)}}function combinePlugins(e,t){return isObject(e)&&!isArray(e)?(0,Ye.default)({},e):isFunc(e)?combinePlugins(e(t),t):isArray(e)?e.map((e=>combinePlugins(e,t))).reduce(systemExtend,{components:t.getComponents()}):{}}function callAfterLoad(e,t,{hasLoaded:r}={}){let n=r;return isObject(e)&&!isArray(e)&&\"function\"==typeof e.afterLoad&&(n=!0,wrapWithTryCatch(e.afterLoad).call(this,t)),isFunc(e)?callAfterLoad.call(this,e(t),t,{hasLoaded:n}):isArray(e)?e.map((e=>callAfterLoad.call(this,e,t,{hasLoaded:n}))):n}function systemExtend(e={},t={}){if(!isObject(e))return{};if(!isObject(t))return e;t.wrapComponents&&(objMap(t.wrapComponents,((r,n)=>{const a=e.components&&e.components[n];a&&Array.isArray(a)?(e.components[n]=a.concat([r]),delete t.wrapComponents[n]):a&&(e.components[n]=[a,r],delete t.wrapComponents[n])})),Object.keys(t.wrapComponents).length||delete t.wrapComponents);const{statePlugins:r}=e;if(isObject(r))for(let e in r){const n=r[e];if(!isObject(n))continue;const{wrapActions:a,wrapSelectors:o}=n;if(isObject(a))for(let r in a){let n=a[r];Array.isArray(n)||(n=[n],a[r]=n),t&&t.statePlugins&&t.statePlugins[e]&&t.statePlugins[e].wrapActions&&t.statePlugins[e].wrapActions[r]&&(t.statePlugins[e].wrapActions[r]=a[r].concat(t.statePlugins[e].wrapActions[r]))}if(isObject(o))for(let r in o){let n=o[r];Array.isArray(n)||(n=[n],o[r]=n),t&&t.statePlugins&&t.statePlugins[e]&&t.statePlugins[e].wrapSelectors&&t.statePlugins[e].wrapSelectors[r]&&(t.statePlugins[e].wrapSelectors[r]=o[r].concat(t.statePlugins[e].wrapSelectors[r]))}}return He()(e,t)}function wrapWithTryCatch(e,{logErrors:t=!0}={}){return\"function\"!=typeof e?e:function(...r){try{return e.call(this,...r)}catch(e){return t&&console.error(e),null}}}var wt=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return y.default}});const Ct=\"show_popup\",xt=\"authorize\",Ot=\"logout\",kt=\"pre_authorize_oauth2\",Nt=\"authorize_oauth2\",At=\"validate\",It=\"configure_auth\",Rt=\"restore_authorization\";function showDefinitions(e){return{type:Ct,payload:e}}function authorize(e){return{type:xt,payload:e}}const authorizeWithPersistOption=e=>({authActions:t})=>{t.authorize(e),t.persistAuthorizationIfNeeded()};function logout(e){return{type:Ot,payload:e}}const logoutWithPersistOption=e=>({authActions:t})=>{t.logout(e),t.persistAuthorizationIfNeeded()},preAuthorizeImplicit=e=>({authActions:t,errActions:r})=>{let{auth:n,token:a,isValid:o}=e,{schema:s,name:l}=n,i=s.get(\"flow\");delete ot.swaggerUIRedirectOauth2,\"accessCode\"===i||o||r.newAuthErr({authId:l,source:\"auth\",level:\"warning\",message:\"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server\"}),a.error?r.newAuthErr({authId:l,source:\"auth\",level:\"error\",message:JSON.stringify(a)}):t.authorizeOauth2WithPersistOption({auth:n,token:a})};function authorizeOauth2(e){return{type:Nt,payload:e}}const authorizeOauth2WithPersistOption=e=>({authActions:t})=>{t.authorizeOauth2(e),t.persistAuthorizationIfNeeded()},authorizePassword=e=>({authActions:t})=>{let{schema:r,name:n,username:a,password:o,passwordType:s,clientId:l,clientSecret:i}=e,c={grant_type:\"password\",scope:e.scopes.join(\" \"),username:a,password:o},u={};switch(s){case\"request-body\":!function setClientIdAndSecret(e,t,r){t&&Object.assign(e,{client_id:t});r&&Object.assign(e,{client_secret:r})}(c,l,i);break;case\"basic\":u.Authorization=\"Basic \"+btoa(l+\":\"+i);break;default:console.warn(`Warning: invalid passwordType ${s} was passed, not including client id and secret`)}return t.authorizeRequest({body:buildFormData(c),url:r.get(\"tokenUrl\"),name:n,headers:u,query:{},auth:e})};const authorizeApplication=e=>({authActions:t})=>{let{schema:r,scopes:n,name:a,clientId:o,clientSecret:s}=e,l={Authorization:\"Basic \"+btoa(o+\":\"+s)},i={grant_type:\"client_credentials\",scope:n.join(\" \")};return t.authorizeRequest({body:buildFormData(i),name:a,url:r.get(\"tokenUrl\"),auth:e,headers:l})},authorizeAccessCodeWithFormParams=({auth:e,redirectUrl:t})=>({authActions:r})=>{let{schema:n,name:a,clientId:o,clientSecret:s,codeVerifier:l}=e,i={grant_type:\"authorization_code\",code:e.code,client_id:o,client_secret:s,redirect_uri:t,code_verifier:l};return r.authorizeRequest({body:buildFormData(i),name:a,url:n.get(\"tokenUrl\"),auth:e})},authorizeAccessCodeWithBasicAuthentication=({auth:e,redirectUrl:t})=>({authActions:r})=>{let{schema:n,name:a,clientId:o,clientSecret:s,codeVerifier:l}=e,i={Authorization:\"Basic \"+btoa(o+\":\"+s)},c={grant_type:\"authorization_code\",code:e.code,client_id:o,redirect_uri:t,code_verifier:l};return r.authorizeRequest({body:buildFormData(c),name:a,url:n.get(\"tokenUrl\"),auth:e,headers:i})},authorizeRequest=e=>({fn:t,getConfigs:r,authActions:n,errActions:a,oas3Selectors:o,specSelectors:s,authSelectors:l})=>{let i,{body:c,query:u={},headers:d={},name:p,url:m,auth:f}=e,{additionalQueryStringParams:h}=l.getConfigs()||{};if(s.isOAS3()){let e=o.serverEffectiveValue(o.selectedServer());i=(0,wt.default)(m,e,!0)}else i=(0,wt.default)(m,s.url(),!0);\"object\"==typeof h&&(i.query=Object.assign({},i.query,h));const g=i.toString();let y=Object.assign({Accept:\"application/json, text/plain, */*\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"X-Requested-With\":\"XMLHttpRequest\"},d);t.fetch({url:g,method:\"post\",headers:y,query:u,body:c,requestInterceptor:r().requestInterceptor,responseInterceptor:r().responseInterceptor}).then((function(e){let t=JSON.parse(e.data),r=t&&(t.error||\"\"),o=t&&(t.parseError||\"\");e.ok?r||o?a.newAuthErr({authId:p,level:\"error\",source:\"auth\",message:JSON.stringify(t)}):n.authorizeOauth2WithPersistOption({auth:f,token:t}):a.newAuthErr({authId:p,level:\"error\",source:\"auth\",message:e.statusText})})).catch((e=>{let t=new Error(e).message;if(e.response&&e.response.data){const r=e.response.data;try{const e=\"string\"==typeof r?JSON.parse(r):r;e.error&&(t+=`, error: ${e.error}`),e.error_description&&(t+=`, description: ${e.error_description}`)}catch(e){}}a.newAuthErr({authId:p,level:\"error\",source:\"auth\",message:t})}))};function configureAuth(e){return{type:It,payload:e}}function restoreAuthorization(e){return{type:Rt,payload:e}}const persistAuthorizationIfNeeded=()=>({authSelectors:e,getConfigs:t})=>{if(!t().persistAuthorization)return;const r=e.authorized().toJS();localStorage.setItem(\"authorized\",JSON.stringify(r))},authPopup=(e,t)=>()=>{ot.swaggerUIRedirectOauth2=t,ot.open(e)};var Tt={[Ct]:(e,{payload:t})=>e.set(\"showDefinitions\",t),[xt]:(e,{payload:t})=>{let r=(0,Fe.fromJS)(t),n=e.get(\"authorized\")||(0,Fe.Map)();return r.entrySeq().forEach((([t,r])=>{if(!isFunc(r.getIn))return e.set(\"authorized\",n);let a=r.getIn([\"schema\",\"type\"]);if(\"apiKey\"===a||\"http\"===a)n=n.set(t,r);else if(\"basic\"===a){let e=r.getIn([\"value\",\"username\"]),a=r.getIn([\"value\",\"password\"]);n=n.setIn([t,\"value\"],{username:e,header:\"Basic \"+btoa(e+\":\"+a)}),n=n.setIn([t,\"schema\"],r.get(\"schema\"))}})),e.set(\"authorized\",n)},[Nt]:(e,{payload:t})=>{let r,{auth:n,token:a}=t;n.token=Object.assign({},a),r=(0,Fe.fromJS)(n);let o=e.get(\"authorized\")||(0,Fe.Map)();return o=o.set(r.get(\"name\"),r),e.set(\"authorized\",o)},[Ot]:(e,{payload:t})=>{let r=e.get(\"authorized\").withMutations((e=>{t.forEach((t=>{e.delete(t)}))}));return e.set(\"authorized\",r)},[It]:(e,{payload:t})=>e.set(\"configs\",t),[Rt]:(e,{payload:t})=>e.set(\"authorized\",(0,Fe.fromJS)(t.authorized))},Bt=function(e){var t={};return __webpack_require__.d(t,e),t}({createSelector:function(){return S.createSelector}});const state=e=>e,jt=(0,Bt.createSelector)(state,(e=>e.get(\"showDefinitions\"))),Pt=(0,Bt.createSelector)(state,(()=>({specSelectors:e})=>{let t=e.securityDefinitions()||(0,Fe.Map)({}),r=(0,Fe.List)();return t.entrySeq().forEach((([e,t])=>{let n=(0,Fe.Map)();n=n.set(e,t),r=r.push(n)})),r})),getDefinitionsByNames=(e,t)=>({specSelectors:e})=>{console.warn(\"WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.\");let r=e.securityDefinitions(),n=(0,Fe.List)();return t.valueSeq().forEach((e=>{let t=(0,Fe.Map)();e.entrySeq().forEach((([e,n])=>{let a,o=r.get(e);\"oauth2\"===o.get(\"type\")&&n.size&&(a=o.get(\"scopes\"),a.keySeq().forEach((e=>{n.contains(e)||(a=a.delete(e))})),o=o.set(\"allowedScopes\",a)),t=t.set(e,o)})),n=n.push(t)})),n},definitionsForRequirements=(e,t=(0,Fe.List)())=>({authSelectors:e})=>{const r=e.definitionsToAuthorize()||(0,Fe.List)();let n=(0,Fe.List)();return r.forEach((e=>{let r=t.find((t=>t.get(e.keySeq().first())));r&&(e.forEach(((t,n)=>{if(\"oauth2\"===t.get(\"type\")){const a=r.get(n);let o=t.get(\"scopes\");Fe.List.isList(a)&&Fe.Map.isMap(o)&&(o.keySeq().forEach((e=>{a.contains(e)||(o=o.delete(e))})),e=e.set(n,t.set(\"scopes\",o)))}})),n=n.push(e))})),n},Mt=(0,Bt.createSelector)(state,(e=>e.get(\"authorized\")||(0,Fe.Map)())),isAuthorized=(e,t)=>({authSelectors:e})=>{let r=e.authorized();return Fe.List.isList(t)?!!t.toJS().filter((e=>-1===Object.keys(e).map((e=>!!r.get(e))).indexOf(!1))).length:null},qt=(0,Bt.createSelector)(state,(e=>e.get(\"configs\"))),execute=(e,{authSelectors:t,specSelectors:r})=>({path:n,method:a,operation:o,extras:s})=>{let l={authorized:t.authorized()&&t.authorized().toJS(),definitions:r.securityDefinitions()&&r.securityDefinitions().toJS(),specSecurity:r.security()&&r.security().toJS()};return e({path:n,method:a,operation:o,securities:l,...s})},loaded=(e,t)=>r=>{const{getConfigs:n,authActions:a}=t,o=n();if(e(r),o.persistAuthorization){const e=localStorage.getItem(\"authorized\");e&&a.restoreAuthorization({authorized:JSON.parse(e)})}},wrap_actions_authorize=(e,t)=>r=>{e(r);if(t.getConfigs().persistAuthorization)try{const[{schema:e,value:t}]=Object.values(r),n=\"apiKey\"===e.get(\"type\"),a=\"cookie\"===e.get(\"in\");n&&a&&(document.cookie=`${e.get(\"name\")}=${t}; SameSite=None; Secure`)}catch(e){console.error(\"Error persisting cookie based apiKey in document.cookie.\",e)}},wrap_actions_logout=(e,t)=>r=>{const n=t.getConfigs(),a=t.authSelectors.authorized();try{n.persistAuthorization&&Array.isArray(r)&&r.forEach((e=>{const t=a.get(e,{}),r=\"apiKey\"===t.getIn([\"schema\",\"type\"]),n=\"cookie\"===t.getIn([\"schema\",\"in\"]);if(r&&n){const e=t.getIn([\"schema\",\"name\"]);document.cookie=`${e}=; Max-Age=-99999999`}}))}catch(e){console.error(\"Error deleting cookie based apiKey from document.cookie.\",e)}e(r)};var Lt=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return _.default}}),Dt=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return v.default}});class LockAuthIcon extends Ke.default.Component{mapStateToProps(e,t){return{state:e,ownProps:(0,Dt.default)(t,Object.keys(t.getSystem()))}}render(){const{getComponent:e,ownProps:t}=this.props,r=e(\"LockIcon\");return Ke.default.createElement(r,t)}}var Ut=LockAuthIcon;class UnlockAuthIcon extends Ke.default.Component{mapStateToProps(e,t){return{state:e,ownProps:(0,Dt.default)(t,Object.keys(t.getSystem()))}}render(){const{getComponent:e,ownProps:t}=this.props,r=e(\"UnlockIcon\");return Ke.default.createElement(r,t)}}var $t=UnlockAuthIcon;function auth(){return{afterLoad(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=preauthorizeApiKey.bind(null,e),this.rootInjects.preauthorizeBasic=preauthorizeBasic.bind(null,e)},components:{LockAuthIcon:Ut,UnlockAuthIcon:$t,LockAuthOperationIcon:Ut,UnlockAuthOperationIcon:$t},statePlugins:{auth:{reducers:Tt,actions:t,selectors:c,wrapActions:{authorize:wrap_actions_authorize,logout:wrap_actions_logout}},configs:{wrapActions:{loaded}},spec:{wrapActions:{execute}}}}}function preauthorizeBasic(e,t,r,n){const{authActions:{authorize:a},specSelectors:{specJson:o,isOAS3:s}}=e,l=s()?[\"components\",\"securitySchemes\"]:[\"securityDefinitions\"],i=o().getIn([...l,t]);return i?a({[t]:{value:{username:r,password:n},schema:i.toJS()}}):null}function preauthorizeApiKey(e,t,r){const{authActions:{authorize:n},specSelectors:{specJson:a,isOAS3:o}}=e,s=o()?[\"components\",\"securitySchemes\"]:[\"securityDefinitions\"],l=a().getIn([...s,t]);return l?n({[t]:{value:r,schema:l.toJS()}}):null}var Jt=function(e){var t={};return __webpack_require__.d(t,e),t}({JSON_SCHEMA:function(){return b.JSON_SCHEMA},default:function(){return b.default}});const Vt=\"configs_update\",Kt=\"configs_toggle\";function update(e,t){return{type:Vt,payload:{[e]:t}}}function toggle(e){return{type:Kt,payload:e}}const actions_loaded=()=>()=>{},downloadConfig=e=>t=>{const{fn:{fetch:r}}=t;return r(e)},getConfigByUrl=(e,t)=>r=>{const{specActions:n,configsActions:a}=r;if(e)return a.downloadConfig(e).then(next,next);function next(a){a instanceof Error||a.status>=400?(n.updateLoadingStatus(\"failedConfig\"),n.updateLoadingStatus(\"failedConfig\"),n.updateUrl(\"\"),console.error(a.statusText+\" \"+e.url),t(null)):t(((e,t)=>{try{return Jt.default.load(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}})(a.text,r))}},get=(e,t)=>e.getIn(Array.isArray(t)?t:[t]);var zt={[Vt]:(e,t)=>e.merge((0,Fe.fromJS)(t.payload)),[Kt]:(e,t)=>{const r=t.payload,n=e.get(r);return e.set(r,!n)}};function configsPlugin(){return{statePlugins:{configs:{reducers:zt,actions:u,selectors:Ce}}}}const setHash=e=>e?history.pushState(null,null,`#${e}`):window.location.hash=\"\";var Ft=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return w.default}});const Wt=\"layout_scroll_to\",Ht=\"layout_clear_scroll\";var Gt={fn:{getScrollParent:function getScrollParent(e,t){const r=document.documentElement;let n=getComputedStyle(e);const a=\"absolute\"===n.position,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if(\"fixed\"===n.position)return r;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!a||\"static\"!==n.position)&&o.test(n.overflow+n.overflowY+n.overflowX))return t;return r}},statePlugins:{layout:{actions:{scrollToElement:(e,t)=>r=>{try{t=t||r.fn.getScrollParent(e),Ft.default.createScroller(t).to(e)}catch(e){console.error(e)}},scrollTo:e=>({type:Wt,payload:Array.isArray(e)?e:[e]}),clearScrollTo:()=>({type:Ht}),readyToScroll:(e,t)=>r=>{const n=r.layoutSelectors.getScrollToKey();Fe.default.is(n,(0,Fe.fromJS)(e))&&(r.layoutActions.scrollToElement(t),r.layoutActions.clearScrollTo())},parseDeepLinkHash:e=>({layoutActions:t,layoutSelectors:r,getConfigs:n})=>{if(n().deepLinking&&e){let n=e.slice(1);\"!\"===n[0]&&(n=n.slice(1)),\"/\"===n[0]&&(n=n.slice(1));const a=n.split(\"/\").map((e=>e||\"\")),o=r.isShownKeyFromUrlHashArray(a),[s,l=\"\",i=\"\"]=o;if(\"operations\"===s){const e=r.isShownKeyFromUrlHashArray([l]);l.indexOf(\"_\")>-1&&(console.warn(\"Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.\"),t.show(e.map((e=>e.replace(/_/g,\" \"))),!0)),t.show(e,!0)}(l.indexOf(\"_\")>-1||i.indexOf(\"_\")>-1)&&(console.warn(\"Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.\"),t.show(o.map((e=>e.replace(/_/g,\" \"))),!0)),t.show(o,!0),t.scrollTo(o)}}},selectors:{getScrollToKey:e=>e.get(\"scrollToKey\"),isShownKeyFromUrlHashArray(e,t){const[r,n]=t;return n?[\"operations\",r,n]:r?[\"operations-tag\",r]:[]},urlHashArrayFromIsShownKey(e,t){let[r,n,a]=t;return\"operations\"==r?[n,a]:\"operations-tag\"==r?[n]:[]}},reducers:{[Wt]:(e,t)=>e.set(\"scrollToKey\",Fe.default.fromJS(t.payload)),[Ht]:e=>e.delete(\"scrollToKey\")},wrapActions:{show:(e,{getConfigs:t,layoutSelectors:r})=>(...n)=>{if(e(...n),t().deepLinking)try{let[e,t]=n;e=Array.isArray(e)?e:[e];const a=r.urlHashArrayFromIsShownKey(e);if(!a.length)return;const[o,s]=a;if(!t)return setHash(\"/\");2===a.length?setHash(createDeepLinkPath(`/${encodeURIComponent(o)}/${encodeURIComponent(s)}`)):1===a.length&&setHash(createDeepLinkPath(`/${encodeURIComponent(o)}`))}catch(e){console.error(e)}}}}}},Xt=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return C.default}});var operation_wrapper=(e,t)=>class OperationWrapper extends Ke.default.Component{onLoad=e=>{const{operation:r}=this.props,{tag:n,operationId:a}=r.toObject();let{isShownKey:o}=r.toObject();o=o||[\"operations\",n,a],t.layoutActions.readyToScroll(o,e)};render(){return Ke.default.createElement(\"span\",{ref:this.onLoad},Ke.default.createElement(e,this.props))}};var operation_tag_wrapper=(e,t)=>class OperationTagWrapper extends Ke.default.Component{onLoad=e=>{const{tag:r}=this.props,n=[\"operations-tag\",r];t.layoutActions.readyToScroll(n,e)};render(){return Ke.default.createElement(\"span\",{ref:this.onLoad},Ke.default.createElement(e,this.props))}};function deep_linking(){return[Gt,{statePlugins:{configs:{wrapActions:{loaded:(e,t)=>(...r)=>{e(...r);const n=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(n)}}}},wrapComponents:{operation:operation_wrapper,OperationTag:operation_tag_wrapper}}]}var Yt=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return x.default}});function transform(e){return e.map((e=>{let t=\"is not of a type(s)\",r=e.get(\"message\").indexOf(t);if(r>-1){let t=e.get(\"message\").slice(r+19).split(\",\");return e.set(\"message\",e.get(\"message\").slice(0,r)+function makeNewMessage(e){return e.reduce(((e,t,r,n)=>r===n.length-1&&n.length>1?e+\"or \"+t:n[r+1]&&n.length>2?e+t+\", \":n[r+1]?e+t+\" \":e+t),\"should be a\")}(t))}return e}))}var Qt=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return O.default}});function parameter_oneof_transform(e,{jsSpec:t}){return e}const Zt=[xe,ke];function transformErrors(e){let t={jsSpec:{}},r=(0,Yt.default)(Zt,((e,r)=>{try{return r.transform(e,t).filter((e=>!!e))}catch(t){return console.error(\"Transformer error:\",t),e}}),e);return r.filter((e=>!!e)).map((e=>(!e.get(\"line\")&&e.get(\"path\"),e)))}let er={line:0,level:\"error\",message:\"Unknown error\"};const tr=(0,Bt.createSelector)((e=>e),(e=>e.get(\"errors\",(0,Fe.List)()))),rr=(0,Bt.createSelector)(tr,(e=>e.last()));function err(t){return{statePlugins:{err:{reducers:{[Qe]:(e,{payload:t})=>{let r=Object.assign(er,t,{type:\"thrown\"});return e.update(\"errors\",(e=>(e||(0,Fe.List)()).push((0,Fe.fromJS)(r)))).update(\"errors\",(e=>transformErrors(e)))},[Ze]:(e,{payload:t})=>(t=t.map((e=>(0,Fe.fromJS)(Object.assign(er,e,{type:\"thrown\"})))),e.update(\"errors\",(e=>(e||(0,Fe.List)()).concat((0,Fe.fromJS)(t)))).update(\"errors\",(e=>transformErrors(e)))),[et]:(e,{payload:t})=>{let r=(0,Fe.fromJS)(t);return r=r.set(\"type\",\"spec\"),e.update(\"errors\",(e=>(e||(0,Fe.List)()).push((0,Fe.fromJS)(r)).sortBy((e=>e.get(\"line\"))))).update(\"errors\",(e=>transformErrors(e)))},[tt]:(e,{payload:t})=>(t=t.map((e=>(0,Fe.fromJS)(Object.assign(er,e,{type:\"spec\"})))),e.update(\"errors\",(e=>(e||(0,Fe.List)()).concat((0,Fe.fromJS)(t)))).update(\"errors\",(e=>transformErrors(e)))),[rt]:(e,{payload:t})=>{let r=(0,Fe.fromJS)(Object.assign({},t));return r=r.set(\"type\",\"auth\"),e.update(\"errors\",(e=>(e||(0,Fe.List)()).push((0,Fe.fromJS)(r)))).update(\"errors\",(e=>transformErrors(e)))},[nt]:(e,{payload:t})=>{if(!t||!e.get(\"errors\"))return e;let r=e.get(\"errors\").filter((e=>e.keySeq().every((r=>{const n=e.get(r),a=t[r];return!a||n!==a}))));return e.merge({errors:r})},[at]:(e,{payload:t})=>{if(!t||\"function\"!=typeof t)return e;let r=e.get(\"errors\").filter((e=>t(e)));return e.merge({errors:r})}},actions:e,selectors:Ne}}}}function opsFilter(e,t){return e.filter(((e,r)=>-1!==r.indexOf(t)))}function filter(){return{fn:{opsFilter}}}var nr=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return k.default}});var arrow_up=({className:e=null,width:t=20,height:r=20,...n})=>Ke.default.createElement(\"svg\",(0,nr.default)({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},n),Ke.default.createElement(\"path\",{d:\"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z\"}));var arrow_down=({className:e=null,width:t=20,height:r=20,...n})=>Ke.default.createElement(\"svg\",(0,nr.default)({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},n),Ke.default.createElement(\"path\",{d:\"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z\"}));var arrow=({className:e=null,width:t=20,height:r=20,...n})=>Ke.default.createElement(\"svg\",(0,nr.default)({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},n),Ke.default.createElement(\"path\",{d:\"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z\"}));var components_close=({className:e=null,width:t=20,height:r=20,...n})=>Ke.default.createElement(\"svg\",(0,nr.default)({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},n),Ke.default.createElement(\"path\",{d:\"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z\"}));var copy=({className:e=null,width:t=15,height:r=16,...n})=>Ke.default.createElement(\"svg\",(0,nr.default)({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 15 16\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},n),Ke.default.createElement(\"g\",{transform:\"translate(2, -1)\"},Ke.default.createElement(\"path\",{fill:\"#ffffff\",fillRule:\"evenodd\",d:\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"})));var lock=({className:e=null,width:t=20,height:r=20,...n})=>Ke.default.createElement(\"svg\",(0,nr.default)({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},n),Ke.default.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z\"}));var unlock=({className:e=null,width:t=20,height:r=20,...n})=>Ke.default.createElement(\"svg\",(0,nr.default)({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},n),Ke.default.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z\"}));var icons=()=>({components:{ArrowUpIcon:arrow_up,ArrowDownIcon:arrow_down,ArrowIcon:arrow,CloseIcon:components_close,CopyIcon:copy,LockIcon:lock,UnlockIcon:unlock}});const ar=\"layout_update_layout\",or=\"layout_update_filter\",sr=\"layout_update_mode\",lr=\"layout_show\";function updateLayout(e){return{type:ar,payload:e}}function updateFilter(e){return{type:or,payload:e}}function actions_show(e,t=!0){return e=normalizeArray(e),{type:lr,payload:{thing:e,shown:t}}}function changeMode(e,t=\"\"){return e=normalizeArray(e),{type:sr,payload:{thing:e,mode:t}}}var ir={[ar]:(e,t)=>e.set(\"layout\",t.payload),[or]:(e,t)=>e.set(\"filter\",t.payload),[lr]:(e,t)=>{const r=t.payload.shown,n=(0,Fe.fromJS)(t.payload.thing);return e.update(\"shown\",(0,Fe.fromJS)({}),(e=>e.set(n,r)))},[sr]:(e,t)=>{let r=t.payload.thing,n=t.payload.mode;return e.setIn([\"modes\"].concat(r),(n||\"\")+\"\")}};const current=e=>e.get(\"layout\"),currentFilter=e=>e.get(\"filter\"),isShown=(e,t,r)=>(t=normalizeArray(t),e.get(\"shown\",(0,Fe.fromJS)({})).get((0,Fe.fromJS)(t),r)),whatMode=(e,t,r=\"\")=>(t=normalizeArray(t),e.getIn([\"modes\",...t],r)),cr=(0,Bt.createSelector)((e=>e),(e=>!isShown(e,\"editor\"))),taggedOperations=(e,t)=>(r,...n)=>{let a=e(r,...n);const{fn:o,layoutSelectors:s,getConfigs:l}=t.getSystem(),i=l(),{maxDisplayedTags:c}=i;let u=s.currentFilter();return u&&!0!==u&&(a=o.opsFilter(a,u)),c>=0&&(a=a.slice(0,c)),a};function plugins_layout(){return{statePlugins:{layout:{reducers:ir,actions:Ae,selectors:Ie},spec:{wrapSelectors:Re}}}}function logs({configs:e}){const t={debug:0,info:1,log:2,warn:3,error:4},getLevel=e=>t[e]||-1;let{logLevel:r}=e,n=getLevel(r);function log(e,...t){getLevel(e)>=n&&console[e](...t)}return log.warn=log.bind(null,\"warn\"),log.error=log.bind(null,\"error\"),log.info=log.bind(null,\"info\"),log.debug=log.bind(null,\"debug\"),{rootInjects:{log}}}let ur=!1;function on_complete(){return{statePlugins:{spec:{wrapActions:{updateSpec:e=>(...t)=>(ur=!0,e(...t)),updateJsonSpec:(e,t)=>(...r)=>{const n=t.getConfigs().onComplete;return ur&&\"function\"==typeof n&&(setTimeout(n,0),ur=!1),e(...r)}}}}}}const extractKey=e=>{const t=\"_**[]\";return e.indexOf(t)<0?e:e.split(t)[0].trim()},escapeShell=e=>\"-d \"===e||/^[_\\/-]/g.test(e)?e:\"'\"+e.replace(/'/g,\"'\\\\''\")+\"'\",escapeCMD=e=>\"-d \"===(e=e.replace(/\\^/g,\"^^\").replace(/\\\\\"/g,'\\\\\\\\\"').replace(/\"/g,'\"\"').replace(/\\n/g,\"^\\n\"))?e.replace(/-d /g,\"-d ^\\n\"):/^[_\\/-]/g.test(e)?e:'\"'+e+'\"',escapePowershell=e=>{if(\"-d \"===e)return e;if(/\\n/.test(e)){return`@\"\\n${e.replace(/`/g,\"``\").replace(/\\$/g,\"`$\")}\\n\"@`}if(!/^[_\\/-]/.test(e)){return`'${e.replace(/'/g,\"''\")}'`}return e};const curlify=(e,t,r,n=\"\")=>{let a=!1,o=\"\";const addWords=(...e)=>o+=\" \"+e.map(t).join(\" \"),addWordsWithoutLeadingSpace=(...e)=>o+=e.map(t).join(\" \"),addNewLine=()=>o+=` ${r}`,addIndent=(e=1)=>o+=\"  \".repeat(e);let s=e.get(\"headers\");o+=\"curl\"+n;const l=e.get(\"curlOptions\");if(Fe.List.isList(l)&&!l.isEmpty()&&addWords(...e.get(\"curlOptions\")),addWords(\"-X\",e.get(\"method\")),addNewLine(),addIndent(),addWordsWithoutLeadingSpace(`${e.get(\"url\")}`),s&&s.size)for(let t of e.get(\"headers\").entries()){addNewLine(),addIndent();let[e,r]=t;addWordsWithoutLeadingSpace(\"-H\",`${e}: ${r}`),a=a||/^content-type$/i.test(e)&&/^multipart\\/form-data$/i.test(r)}const i=e.get(\"body\");if(i)if(a&&[\"POST\",\"PUT\",\"PATCH\"].includes(e.get(\"method\")))for(let[e,t]of i.entrySeq()){let r=extractKey(e);addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-F\"),t instanceof ot.File&&\"string\"==typeof t.valueOf()?addWords(`${r}=${t.data}${t.type?`;type=${t.type}`:\"\"}`):t instanceof ot.File?addWords(`${r}=@${t.name}${t.type?`;type=${t.type}`:\"\"}`):addWords(`${r}=${t}`)}else if(i instanceof ot.File)addNewLine(),addIndent(),addWordsWithoutLeadingSpace(`--data-binary '@${i.name}'`);else{addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-d \");let t=i;Fe.Map.isMap(t)?addWordsWithoutLeadingSpace(function getStringBodyOfMap(e){let t=[];for(let[r,n]of e.get(\"body\").entrySeq()){let e=extractKey(r);n instanceof ot.File?t.push(`  \"${e}\": {\\n    \"name\": \"${n.name}\"${n.type?`,\\n    \"type\": \"${n.type}\"`:\"\"}\\n  }`):t.push(`  \"${e}\": ${JSON.stringify(n,null,2).replace(/(\\r\\n|\\r|\\n)/g,\"\\n  \")}`)}return`{\\n${t.join(\",\\n\")}\\n}`}(e)):(\"string\"!=typeof t&&(t=JSON.stringify(t)),addWordsWithoutLeadingSpace(t))}else i||\"POST\"!==e.get(\"method\")||(addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-d ''\"));return o},requestSnippetGenerator_curl_powershell=e=>curlify(e,escapePowershell,\"`\\n\",\".exe\"),requestSnippetGenerator_curl_bash=e=>curlify(e,escapeShell,\"\\\\\\n\"),requestSnippetGenerator_curl_cmd=e=>curlify(e,escapeCMD,\"^\\n\"),request_snippets_selectors_state=e=>e||(0,Fe.Map)(),dr=(0,Bt.createSelector)(request_snippets_selectors_state,(e=>{const t=e.get(\"languages\"),r=e.get(\"generators\",(0,Fe.Map)());return!t||t.isEmpty()?r:r.filter(((e,r)=>t.includes(r)))})),getSnippetGenerators=e=>({fn:t})=>dr(e).map(((e,r)=>{const n=(e=>t[`requestSnippetGenerator_${e}`])(r);return\"function\"!=typeof n?null:e.set(\"fn\",n)})).filter((e=>e)),pr=(0,Bt.createSelector)(request_snippets_selectors_state,(e=>e.get(\"activeLanguage\"))),mr=(0,Bt.createSelector)(request_snippets_selectors_state,(e=>e.get(\"defaultExpanded\")));var fr=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return N.default}}),hr=function(e){var t={};return __webpack_require__.d(t,e),t}({CopyToClipboard:function(){return A.CopyToClipboard}});const gr={cursor:\"pointer\",lineHeight:1,display:\"inline-flex\",backgroundColor:\"rgb(250, 250, 250)\",paddingBottom:\"0\",paddingTop:\"0\",border:\"1px solid rgb(51, 51, 51)\",borderRadius:\"4px 4px 0 0\",boxShadow:\"none\",borderBottom:\"none\"},yr={cursor:\"pointer\",lineHeight:1,display:\"inline-flex\",backgroundColor:\"rgb(51, 51, 51)\",boxShadow:\"none\",border:\"1px solid rgb(51, 51, 51)\",paddingBottom:\"0\",paddingTop:\"0\",borderRadius:\"4px 4px 0 0\",marginTop:\"-5px\",marginRight:\"-5px\",marginLeft:\"-5px\",zIndex:\"9999\",borderBottom:\"none\"};var request_snippets=({request:e,requestSnippetsSelectors:t,getComponent:r})=>{const n=(0,Ke.useRef)(null),a=r(\"ArrowUpIcon\"),o=r(\"ArrowDownIcon\"),s=r(\"SyntaxHighlighter\",!0),[l,i]=(0,Ke.useState)(t.getSnippetGenerators()?.keySeq().first()),[c,u]=(0,Ke.useState)(t?.getDefaultExpanded()),d=t.getSnippetGenerators(),p=d.get(l),m=p.get(\"fn\")(e),handleSetIsExpanded=()=>{u(!c)},handleGetBtnStyle=e=>e===l?yr:gr,handlePreventYScrollingBeyondElement=e=>{const{target:t,deltaY:r}=e,{scrollHeight:n,offsetHeight:a,scrollTop:o}=t;n>a&&(0===o&&r<0||a+o>=n&&r>0)&&e.preventDefault()};return(0,Ke.useEffect)((()=>{}),[]),(0,Ke.useEffect)((()=>{const e=Array.from(n.current.childNodes).filter((e=>!!e.nodeType&&e.classList?.contains(\"curl-command\")));return e.forEach((e=>e.addEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement,{passive:!1}))),()=>{e.forEach((e=>e.removeEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement)))}}),[e]),Ke.default.createElement(\"div\",{className:\"request-snippets\",ref:n},Ke.default.createElement(\"div\",{style:{width:\"100%\",display:\"flex\",justifyContent:\"flex-start\",alignItems:\"center\",marginBottom:\"15px\"}},Ke.default.createElement(\"h4\",{onClick:()=>handleSetIsExpanded(),style:{cursor:\"pointer\"}},\"Snippets\"),Ke.default.createElement(\"button\",{onClick:()=>handleSetIsExpanded(),style:{border:\"none\",background:\"none\"},title:c?\"Collapse operation\":\"Expand operation\"},c?Ke.default.createElement(o,{className:\"arrow\",width:\"10\",height:\"10\"}):Ke.default.createElement(a,{className:\"arrow\",width:\"10\",height:\"10\"}))),c&&Ke.default.createElement(\"div\",{className:\"curl-command\"},Ke.default.createElement(\"div\",{style:{paddingLeft:\"15px\",paddingRight:\"10px\",width:\"100%\",display:\"flex\"}},d.entrySeq().map((([e,t])=>Ke.default.createElement(\"div\",{className:(0,fr.default)(\"btn\",{active:e===l}),style:handleGetBtnStyle(e),key:e,onClick:()=>(e=>{l!==e&&i(e)})(e)},Ke.default.createElement(\"h4\",{style:e===l?{color:\"white\"}:{}},t.get(\"title\")))))),Ke.default.createElement(\"div\",{className:\"copy-to-clipboard\"},Ke.default.createElement(hr.CopyToClipboard,{text:m},Ke.default.createElement(\"button\",null))),Ke.default.createElement(\"div\",null,Ke.default.createElement(s,{language:p.get(\"syntax\"),className:\"curl microlight\",renderPlainText:({children:e,PlainTextViewer:t})=>Ke.default.createElement(t,{className:\"curl\"},e)},m))))},plugins_request_snippets=()=>({components:{RequestSnippets:request_snippets},fn:Te,statePlugins:{requestSnippets:{selectors:Be}}});class ModelCollapse extends Ke.Component{static defaultProps={collapsedContent:\"{...}\",expanded:!1,title:null,onToggle:()=>{},hideSelfOnExpand:!1,specPath:Fe.default.List([])};constructor(e,t){super(e,t);let{expanded:r,collapsedContent:n}=this.props;this.state={expanded:r,collapsedContent:n||ModelCollapse.defaultProps.collapsedContent}}componentDidMount(){const{hideSelfOnExpand:e,expanded:t,modelName:r}=this.props;e&&t&&this.props.onToggle(r,t)}UNSAFE_componentWillReceiveProps(e){this.props.expanded!==e.expanded&&this.setState({expanded:e.expanded})}toggleCollapsed=()=>{this.props.onToggle&&this.props.onToggle(this.props.modelName,!this.state.expanded),this.setState({expanded:!this.state.expanded})};onLoad=e=>{if(e&&this.props.layoutSelectors){const t=this.props.layoutSelectors.getScrollToKey();Fe.default.is(t,this.props.specPath)&&this.toggleCollapsed(),this.props.layoutActions.readyToScroll(this.props.specPath,e.parentElement)}};render(){const{title:e,classes:t}=this.props;return this.state.expanded&&this.props.hideSelfOnExpand?Ke.default.createElement(\"span\",{className:t||\"\"},this.props.children):Ke.default.createElement(\"span\",{className:t||\"\",ref:this.onLoad},Ke.default.createElement(\"button\",{\"aria-expanded\":this.state.expanded,className:\"model-box-control\",onClick:this.toggleCollapsed},e&&Ke.default.createElement(\"span\",{className:\"pointer\"},e),Ke.default.createElement(\"span\",{className:\"model-toggle\"+(this.state.expanded?\"\":\" collapsed\")}),!this.state.expanded&&Ke.default.createElement(\"span\",null,this.state.collapsedContent)),this.state.expanded&&this.props.children)}}const useTabs=({initialTab:e,isExecute:t,schema:r,example:n})=>{const a=(0,Ke.useMemo)((()=>({example:\"example\",model:\"model\"})),[]),o=(0,Ke.useMemo)((()=>Object.keys(a)),[a]).includes(e)&&r&&!t?e:a.example,s=(e=>{const t=(0,Ke.useRef)();return(0,Ke.useEffect)((()=>{t.current=e})),t.current})(t),[l,i]=(0,Ke.useState)(o),c=(0,Ke.useCallback)((e=>{i(e.target.dataset.name)}),[]);return(0,Ke.useEffect)((()=>{s&&!t&&n&&i(a.example)}),[s,t,n]),{activeTab:l,onTabChange:c,tabs:a}};var model_example=({schema:e,example:t,isExecute:r=!1,specPath:n,includeWriteOnly:a=!1,includeReadOnly:o=!1,getComponent:s,getConfigs:l,specSelectors:i})=>{const{defaultModelRendering:c,defaultModelExpandDepth:u}=l(),d=s(\"ModelWrapper\"),p=s(\"HighlightCode\",!0),m=ht()(5).toString(\"base64\"),f=ht()(5).toString(\"base64\"),h=ht()(5).toString(\"base64\"),g=ht()(5).toString(\"base64\"),y=i.isOAS3(),{activeTab:S,tabs:_,onTabChange:v}=useTabs({initialTab:c,isExecute:r,schema:e,example:t});return Ke.default.createElement(\"div\",{className:\"model-example\"},Ke.default.createElement(\"ul\",{className:\"tab\",role:\"tablist\"},Ke.default.createElement(\"li\",{className:(0,fr.default)(\"tabitem\",{active:S===_.example}),role:\"presentation\"},Ke.default.createElement(\"button\",{\"aria-controls\":f,\"aria-selected\":S===_.example,className:\"tablinks\",\"data-name\":\"example\",id:m,onClick:v,role:\"tab\"},r?\"Edit Value\":\"Example Value\")),e&&Ke.default.createElement(\"li\",{className:(0,fr.default)(\"tabitem\",{active:S===_.model}),role:\"presentation\"},Ke.default.createElement(\"button\",{\"aria-controls\":g,\"aria-selected\":S===_.model,className:(0,fr.default)(\"tablinks\",{inactive:r}),\"data-name\":\"model\",id:h,onClick:v,role:\"tab\"},y?\"Schema\":\"Model\"))),S===_.example&&Ke.default.createElement(\"div\",{\"aria-hidden\":S!==_.example,\"aria-labelledby\":m,\"data-name\":\"examplePanel\",id:f,role:\"tabpanel\",tabIndex:\"0\"},t||Ke.default.createElement(p,null,\"(no example available\")),S===_.model&&Ke.default.createElement(\"div\",{\"aria-hidden\":S===_.example,\"aria-labelledby\":h,\"data-name\":\"modelPanel\",id:g,role:\"tabpanel\",tabIndex:\"0\"},Ke.default.createElement(d,{schema:e,getComponent:s,getConfigs:l,specSelectors:i,expandDepth:u,specPath:n,includeReadOnly:o,includeWriteOnly:a})))};class ModelWrapper extends Ke.Component{onToggle=(e,t)=>{this.props.layoutActions&&this.props.layoutActions.show(this.props.fullPath,t)};render(){let{getComponent:e,getConfigs:t}=this.props;const r=e(\"Model\");let n;return this.props.layoutSelectors&&(n=this.props.layoutSelectors.isShown(this.props.fullPath)),Ke.default.createElement(\"div\",{className:\"model-box\"},Ke.default.createElement(r,(0,nr.default)({},this.props,{getConfigs:t,expanded:n,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}var Er,Sr=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return I.default}});function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(this,arguments)}var rolling_load=e=>Ke.createElement(\"svg\",_extends({xmlns:\"http://www.w3.org/2000/svg\",width:200,height:200,className:\"rolling-load_svg__lds-rolling\",preserveAspectRatio:\"xMidYMid\",style:{backgroundImage:\"none\",backgroundPosition:\"initial initial\",backgroundRepeat:\"initial initial\"},viewBox:\"0 0 100 100\"},e),Er||(Er=Ke.createElement(\"circle\",{cx:50,cy:50,r:35,fill:\"none\",stroke:\"#555\",strokeDasharray:\"164.93361431346415 56.97787143782138\",strokeWidth:10},Ke.createElement(\"animateTransform\",{attributeName:\"transform\",begin:\"0s\",calcMode:\"linear\",dur:\"1s\",keyTimes:\"0;1\",repeatCount:\"indefinite\",type:\"rotate\",values:\"0 50 50;360 50 50\"}))));const decodeRefName=e=>{const t=e.replace(/~1/g,\"/\").replace(/~0/g,\"~\");try{return decodeURIComponent(t)}catch{return t}};class Model extends Sr.default{static propTypes={schema:Xt.default.map.isRequired,getComponent:Lt.default.func.isRequired,getConfigs:Lt.default.func.isRequired,specSelectors:Lt.default.object.isRequired,name:Lt.default.string,displayName:Lt.default.string,isRef:Lt.default.bool,required:Lt.default.bool,expandDepth:Lt.default.number,depth:Lt.default.number,specPath:Xt.default.list.isRequired,includeReadOnly:Lt.default.bool,includeWriteOnly:Lt.default.bool};getModelName=e=>-1!==e.indexOf(\"#/definitions/\")?decodeRefName(e.replace(/^.*#\\/definitions\\//,\"\")):-1!==e.indexOf(\"#/components/schemas/\")?decodeRefName(e.replace(/^.*#\\/components\\/schemas\\//,\"\")):void 0;getRefSchema=e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)};render(){let{getComponent:e,getConfigs:t,specSelectors:r,schema:n,required:a,name:o,isRef:s,specPath:l,displayName:i,includeReadOnly:c,includeWriteOnly:u}=this.props;const d=e(\"ObjectModel\"),p=e(\"ArrayModel\"),m=e(\"PrimitiveModel\");let f=\"object\",h=n&&n.get(\"$$ref\"),g=n&&n.get(\"$ref\");if(!o&&h&&(o=this.getModelName(h)),g){const e=this.getModelName(g),t=this.getRefSchema(e);Fe.Map.isMap(t)?(n=t.mergeDeep(n),h||(n=n.set(\"$$ref\",g),h=g)):Fe.Map.isMap(n)&&1===n.size&&(n=null,o=g)}if(!n)return Ke.default.createElement(\"span\",{className:\"model model-title\"},Ke.default.createElement(\"span\",{className:\"model-title__text\"},i||o),!g&&Ke.default.createElement(rolling_load,{height:\"20px\",width:\"20px\"}));const y=r.isOAS3()&&n.get(\"deprecated\");switch(s=void 0!==s?s:!!h,f=n&&n.get(\"type\")||f,f){case\"object\":return Ke.default.createElement(d,(0,nr.default)({className:\"object\"},this.props,{specPath:l,getConfigs:t,schema:n,name:o,deprecated:y,isRef:s,includeReadOnly:c,includeWriteOnly:u}));case\"array\":return Ke.default.createElement(p,(0,nr.default)({className:\"array\"},this.props,{getConfigs:t,schema:n,name:o,deprecated:y,required:a,includeReadOnly:c,includeWriteOnly:u}));default:return Ke.default.createElement(m,(0,nr.default)({},this.props,{getComponent:e,getConfigs:t,schema:n,name:o,deprecated:y,required:a}))}}}class Models extends Ke.Component{getSchemaBasePath=()=>this.props.specSelectors.isOAS3()?[\"components\",\"schemas\"]:[\"definitions\"];getCollapsedContent=()=>\" \";handleToggle=(e,t)=>{const{layoutActions:r}=this.props;r.show([...this.getSchemaBasePath(),e],t),t&&this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(),e])};onLoadModels=e=>{e&&this.props.layoutActions.readyToScroll(this.getSchemaBasePath(),e)};onLoadModel=e=>{if(e){const t=e.getAttribute(\"data-name\");this.props.layoutActions.readyToScroll([...this.getSchemaBasePath(),t],e)}};render(){let{specSelectors:e,getComponent:t,layoutSelectors:r,layoutActions:n,getConfigs:a}=this.props,o=e.definitions(),{docExpansion:s,defaultModelsExpandDepth:l}=a();if(!o.size||l<0)return null;const i=this.getSchemaBasePath();let c=r.isShown(i,l>0&&\"none\"!==s);const u=e.isOAS3(),d=t(\"ModelWrapper\"),p=t(\"Collapse\"),m=t(\"ModelCollapse\"),f=t(\"JumpToPath\",!0),h=t(\"ArrowUpIcon\"),g=t(\"ArrowDownIcon\");return Ke.default.createElement(\"section\",{className:c?\"models is-open\":\"models\",ref:this.onLoadModels},Ke.default.createElement(\"h4\",null,Ke.default.createElement(\"button\",{\"aria-expanded\":c,className:\"models-control\",onClick:()=>n.show(i,!c)},Ke.default.createElement(\"span\",null,u?\"Schemas\":\"Models\"),c?Ke.default.createElement(h,null):Ke.default.createElement(g,null))),Ke.default.createElement(p,{isOpened:c},o.entrySeq().map((([o])=>{const s=[...i,o],c=Fe.default.List(s),u=e.specResolvedSubtree(s),p=e.specJson().getIn(s),h=Fe.Map.isMap(u)?u:Fe.default.Map(),g=Fe.Map.isMap(p)?p:Fe.default.Map(),y=h.get(\"title\")||g.get(\"title\")||o,S=r.isShown(s,!1);S&&0===h.size&&g.size>0&&this.props.specActions.requestResolvedSubtree(s);const _=Ke.default.createElement(d,{name:o,expandDepth:l,schema:h||Fe.default.Map(),displayName:y,fullPath:s,specPath:c,getComponent:t,specSelectors:e,getConfigs:a,layoutSelectors:r,layoutActions:n,includeReadOnly:!0,includeWriteOnly:!0}),v=Ke.default.createElement(\"span\",{className:\"model-box\"},Ke.default.createElement(\"span\",{className:\"model model-title\"},y));return Ke.default.createElement(\"div\",{id:`model-${o}`,className:\"model-container\",key:`models-section-${o}`,\"data-name\":o,ref:this.onLoadModel},Ke.default.createElement(\"span\",{className:\"models-jump-to-path\"},Ke.default.createElement(f,{specPath:c})),Ke.default.createElement(m,{classes:\"model-box\",collapsedContent:this.getCollapsedContent(o),onToggle:this.handleToggle,title:v,displayName:y,modelName:o,specPath:c,layoutSelectors:r,layoutActions:n,hideSelfOnExpand:!0,expanded:l>0&&S},_))})).toArray()))}}var enum_model=({value:e,getComponent:t})=>{let r=t(\"ModelCollapse\"),n=Ke.default.createElement(\"span\",null,\"Array [ \",e.count(),\" ]\");return Ke.default.createElement(\"span\",{className:\"prop-enum\"},\"Enum:\",Ke.default.createElement(\"br\",null),Ke.default.createElement(r,{collapsedContent:n},\"[ \",e.map(String).join(\", \"),\" ]\"))};class ObjectModel extends Ke.Component{render(){let{schema:e,name:t,displayName:r,isRef:n,getComponent:a,getConfigs:o,depth:s,onToggle:l,expanded:i,specPath:c,...u}=this.props,{specSelectors:d,expandDepth:p,includeReadOnly:m,includeWriteOnly:f}=u;const{isOAS3:h}=d;if(!e)return null;const{showExtensions:g}=o();let y=e.get(\"description\"),S=e.get(\"properties\"),_=e.get(\"additionalProperties\"),v=e.get(\"title\")||r||t,b=e.get(\"required\"),w=e.filter(((e,t)=>-1!==[\"maxProperties\",\"minProperties\",\"nullable\",\"example\"].indexOf(t))),C=e.get(\"deprecated\"),x=e.getIn([\"externalDocs\",\"url\"]),O=e.getIn([\"externalDocs\",\"description\"]);const k=a(\"JumpToPath\",!0),N=a(\"Markdown\",!0),A=a(\"Model\"),I=a(\"ModelCollapse\"),R=a(\"Property\"),T=a(\"Link\"),JumpToPathSection=()=>Ke.default.createElement(\"span\",{className:\"model-jump-to-path\"},Ke.default.createElement(k,{specPath:c})),B=Ke.default.createElement(\"span\",null,Ke.default.createElement(\"span\",null,\"{\"),\"...\",Ke.default.createElement(\"span\",null,\"}\"),n?Ke.default.createElement(JumpToPathSection,null):\"\"),j=d.isOAS3()?e.get(\"allOf\"):null,P=d.isOAS3()?e.get(\"anyOf\"):null,M=d.isOAS3()?e.get(\"oneOf\"):null,q=d.isOAS3()?e.get(\"not\"):null,L=v&&Ke.default.createElement(\"span\",{className:\"model-title\"},n&&e.get(\"$$ref\")&&Ke.default.createElement(\"span\",{className:\"model-hint\"},e.get(\"$$ref\")),Ke.default.createElement(\"span\",{className:\"model-title__text\"},v));return Ke.default.createElement(\"span\",{className:\"model\"},Ke.default.createElement(I,{modelName:t,title:L,onToggle:l,expanded:!!i||s<=p,collapsedContent:B},Ke.default.createElement(\"span\",{className:\"brace-open object\"},\"{\"),n?Ke.default.createElement(JumpToPathSection,null):null,Ke.default.createElement(\"span\",{className:\"inner-object\"},Ke.default.createElement(\"table\",{className:\"model\"},Ke.default.createElement(\"tbody\",null,y?Ke.default.createElement(\"tr\",{className:\"description\"},Ke.default.createElement(\"td\",null,\"description:\"),Ke.default.createElement(\"td\",null,Ke.default.createElement(N,{source:y}))):null,x&&Ke.default.createElement(\"tr\",{className:\"external-docs\"},Ke.default.createElement(\"td\",null,\"externalDocs:\"),Ke.default.createElement(\"td\",null,Ke.default.createElement(T,{target:\"_blank\",href:sanitizeUrl(x)},O||x))),C?Ke.default.createElement(\"tr\",{className:\"property\"},Ke.default.createElement(\"td\",null,\"deprecated:\"),Ke.default.createElement(\"td\",null,\"true\")):null,S&&S.size?S.entrySeq().filter((([,e])=>(!e.get(\"readOnly\")||m)&&(!e.get(\"writeOnly\")||f))).map((([e,r])=>{let n=h()&&r.get(\"deprecated\"),l=Fe.List.isList(b)&&b.contains(e),i=[\"property-row\"];return n&&i.push(\"deprecated\"),l&&i.push(\"required\"),Ke.default.createElement(\"tr\",{key:e,className:i.join(\" \")},Ke.default.createElement(\"td\",null,e,l&&Ke.default.createElement(\"span\",{className:\"star\"},\"*\")),Ke.default.createElement(\"td\",null,Ke.default.createElement(A,(0,nr.default)({key:`object-${t}-${e}_${r}`},u,{required:l,getComponent:a,specPath:c.push(\"properties\",e),getConfigs:o,schema:r,depth:s+1}))))})).toArray():null,g?Ke.default.createElement(\"tr\",null,Ke.default.createElement(\"td\",null,\" \")):null,g?e.entrySeq().map((([e,t])=>{if(\"x-\"!==e.slice(0,2))return;const r=t?t.toJS?t.toJS():t:null;return Ke.default.createElement(\"tr\",{key:e,className:\"extension\"},Ke.default.createElement(\"td\",null,e),Ke.default.createElement(\"td\",null,JSON.stringify(r)))})).toArray():null,_&&_.size?Ke.default.createElement(\"tr\",null,Ke.default.createElement(\"td\",null,\"< * >:\"),Ke.default.createElement(\"td\",null,Ke.default.createElement(A,(0,nr.default)({},u,{required:!1,getComponent:a,specPath:c.push(\"additionalProperties\"),getConfigs:o,schema:_,depth:s+1})))):null,j?Ke.default.createElement(\"tr\",null,Ke.default.createElement(\"td\",null,\"allOf ->\"),Ke.default.createElement(\"td\",null,j.map(((e,t)=>Ke.default.createElement(\"div\",{key:t},Ke.default.createElement(A,(0,nr.default)({},u,{required:!1,getComponent:a,specPath:c.push(\"allOf\",t),getConfigs:o,schema:e,depth:s+1}))))))):null,P?Ke.default.createElement(\"tr\",null,Ke.default.createElement(\"td\",null,\"anyOf ->\"),Ke.default.createElement(\"td\",null,P.map(((e,t)=>Ke.default.createElement(\"div\",{key:t},Ke.default.createElement(A,(0,nr.default)({},u,{required:!1,getComponent:a,specPath:c.push(\"anyOf\",t),getConfigs:o,schema:e,depth:s+1}))))))):null,M?Ke.default.createElement(\"tr\",null,Ke.default.createElement(\"td\",null,\"oneOf ->\"),Ke.default.createElement(\"td\",null,M.map(((e,t)=>Ke.default.createElement(\"div\",{key:t},Ke.default.createElement(A,(0,nr.default)({},u,{required:!1,getComponent:a,specPath:c.push(\"oneOf\",t),getConfigs:o,schema:e,depth:s+1}))))))):null,q?Ke.default.createElement(\"tr\",null,Ke.default.createElement(\"td\",null,\"not ->\"),Ke.default.createElement(\"td\",null,Ke.default.createElement(\"div\",null,Ke.default.createElement(A,(0,nr.default)({},u,{required:!1,getComponent:a,specPath:c.push(\"not\"),getConfigs:o,schema:q,depth:s+1}))))):null))),Ke.default.createElement(\"span\",{className:\"brace-close\"},\"}\")),w.size?w.entrySeq().map((([e,t])=>Ke.default.createElement(R,{key:`${e}-${t}`,propKey:e,propVal:t,propClass:\"property\"}))):null)}}class ArrayModel extends Ke.Component{render(){let{getComponent:e,getConfigs:t,schema:r,depth:n,expandDepth:a,name:o,displayName:s,specPath:l}=this.props,i=r.get(\"description\"),c=r.get(\"items\"),u=r.get(\"title\")||s||o,d=r.filter(((e,t)=>-1===[\"type\",\"items\",\"description\",\"$$ref\",\"externalDocs\"].indexOf(t))),p=r.getIn([\"externalDocs\",\"url\"]),m=r.getIn([\"externalDocs\",\"description\"]);const f=e(\"Markdown\",!0),h=e(\"ModelCollapse\"),g=e(\"Model\"),y=e(\"Property\"),S=e(\"Link\"),_=u&&Ke.default.createElement(\"span\",{className:\"model-title\"},Ke.default.createElement(\"span\",{className:\"model-title__text\"},u));return Ke.default.createElement(\"span\",{className:\"model\"},Ke.default.createElement(h,{title:_,expanded:n<=a,collapsedContent:\"[...]\"},\"[\",d.size?d.entrySeq().map((([e,t])=>Ke.default.createElement(y,{key:`${e}-${t}`,propKey:e,propVal:t,propClass:\"property\"}))):null,i?Ke.default.createElement(f,{source:i}):d.size?Ke.default.createElement(\"div\",{className:\"markdown\"}):null,p&&Ke.default.createElement(\"div\",{className:\"external-docs\"},Ke.default.createElement(S,{target:\"_blank\",href:sanitizeUrl(p)},m||p)),Ke.default.createElement(\"span\",null,Ke.default.createElement(g,(0,nr.default)({},this.props,{getConfigs:t,specPath:l.push(\"items\"),name:null,schema:c,required:!1,depth:n+1}))),\"]\"))}}const _r=\"property primitive\";class Primitive extends Ke.Component{render(){let{schema:e,getComponent:t,getConfigs:r,name:n,displayName:a,depth:o,expandDepth:s}=this.props;const{showExtensions:l}=r();if(!e||!e.get)return Ke.default.createElement(\"div\",null);let i=e.get(\"type\"),c=e.get(\"format\"),u=e.get(\"xml\"),d=e.get(\"enum\"),p=e.get(\"title\")||a||n,m=e.get(\"description\"),f=getExtensions(e),h=e.filter(((e,t)=>-1===[\"enum\",\"type\",\"format\",\"description\",\"$$ref\",\"externalDocs\"].indexOf(t))).filterNot(((e,t)=>f.has(t))),g=e.getIn([\"externalDocs\",\"url\"]),y=e.getIn([\"externalDocs\",\"description\"]);const S=t(\"Markdown\",!0),_=t(\"EnumModel\"),v=t(\"Property\"),b=t(\"ModelCollapse\"),w=t(\"Link\"),C=p&&Ke.default.createElement(\"span\",{className:\"model-title\"},Ke.default.createElement(\"span\",{className:\"model-title__text\"},p));return Ke.default.createElement(\"span\",{className:\"model\"},Ke.default.createElement(b,{title:C,expanded:o<=s,collapsedContent:\"[...]\"},Ke.default.createElement(\"span\",{className:\"prop\"},n&&o>1&&Ke.default.createElement(\"span\",{className:\"prop-name\"},p),Ke.default.createElement(\"span\",{className:\"prop-type\"},i),c&&Ke.default.createElement(\"span\",{className:\"prop-format\"},\"($\",c,\")\"),h.size?h.entrySeq().map((([e,t])=>Ke.default.createElement(v,{key:`${e}-${t}`,propKey:e,propVal:t,propClass:_r}))):null,l&&f.size?f.entrySeq().map((([e,t])=>Ke.default.createElement(v,{key:`${e}-${t}`,propKey:e,propVal:t,propClass:_r}))):null,m?Ke.default.createElement(S,{source:m}):null,g&&Ke.default.createElement(\"div\",{className:\"external-docs\"},Ke.default.createElement(w,{target:\"_blank\",href:sanitizeUrl(g)},y||g)),u&&u.size?Ke.default.createElement(\"span\",null,Ke.default.createElement(\"br\",null),Ke.default.createElement(\"span\",{className:_r},\"xml:\"),u.entrySeq().map((([e,t])=>Ke.default.createElement(\"span\",{key:`${e}-${t}`,className:_r},Ke.default.createElement(\"br\",null),\"   \",e,\": \",String(t)))).toArray()):null,d&&Ke.default.createElement(_,{value:d,getComponent:t}))))}}class Schemes extends Ke.default.Component{UNSAFE_componentWillMount(){let{schemes:e}=this.props;this.setScheme(e.first())}UNSAFE_componentWillReceiveProps(e){this.props.currentScheme&&e.schemes.includes(this.props.currentScheme)||this.setScheme(e.schemes.first())}onChange=e=>{this.setScheme(e.target.value)};setScheme=e=>{let{path:t,method:r,specActions:n}=this.props;n.setScheme(e,t,r)};render(){let{schemes:e,currentScheme:t}=this.props;return Ke.default.createElement(\"label\",{htmlFor:\"schemes\"},Ke.default.createElement(\"span\",{className:\"schemes-title\"},\"Schemes\"),Ke.default.createElement(\"select\",{onChange:this.onChange,value:t,id:\"schemes\"},e.valueSeq().map((e=>Ke.default.createElement(\"option\",{value:e,key:e},e))).toArray()))}}class SchemesContainer extends Ke.default.Component{render(){const{specActions:e,specSelectors:t,getComponent:r}=this.props,n=t.operationScheme(),a=t.schemes(),o=r(\"schemes\");return a&&a.size?Ke.default.createElement(o,{currentScheme:n,schemes:a,specActions:e}):null}}var vr=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return R.default}});const br={value:\"\",onChange:()=>{},schema:{},keyName:\"\",required:!1,errors:(0,Fe.List)()};class JsonSchemaForm extends Ke.Component{static defaultProps=br;componentDidMount(){const{dispatchInitialValue:e,value:t,onChange:r}=this.props;e?r(t):!1===e&&r(\"\")}render(){let{schema:e,errors:t,value:r,onChange:n,getComponent:a,fn:o,disabled:s}=this.props;const l=e&&e.get?e.get(\"format\"):null,i=e&&e.get?e.get(\"type\"):null;let getComponentSilently=e=>a(e,!1,{failSilently:!0}),c=i?getComponentSilently(l?`JsonSchema_${i}_${l}`:`JsonSchema_${i}`):a(\"JsonSchema_string\");return c||(c=a(\"JsonSchema_string\")),Ke.default.createElement(c,(0,nr.default)({},this.props,{errors:t,fn:o,getComponent:a,value:r,onChange:n,schema:e,disabled:s}))}}class JsonSchema_string extends Ke.Component{static defaultProps=br;onChange=e=>{const t=this.props.schema&&\"file\"===this.props.schema.get(\"type\")?e.target.files[0]:e.target.value;this.props.onChange(t,this.props.keyName)};onEnumChange=e=>this.props.onChange(e);render(){let{getComponent:e,value:t,schema:r,errors:n,required:a,description:o,disabled:s}=this.props;const l=r&&r.get?r.get(\"enum\"):null,i=r&&r.get?r.get(\"format\"):null,c=r&&r.get?r.get(\"type\"):null,u=r&&r.get?r.get(\"in\"):null;if(t||(t=\"\"),n=n.toJS?n.toJS():[],l){const r=e(\"Select\");return Ke.default.createElement(r,{className:n.length?\"invalid\":\"\",title:n.length?n:\"\",allowedValues:[...l],value:t,allowEmptyValue:!a,disabled:s,onChange:this.onEnumChange})}const d=s||u&&\"formData\"===u&&!(\"FormData\"in window),p=e(\"Input\");return c&&\"file\"===c?Ke.default.createElement(p,{type:\"file\",className:n.length?\"invalid\":\"\",title:n.length?n:\"\",onChange:this.onChange,disabled:d}):Ke.default.createElement(vr.default,{type:i&&\"password\"===i?\"password\":\"text\",className:n.length?\"invalid\":\"\",title:n.length?n:\"\",value:t,minLength:0,debounceTimeout:350,placeholder:o,onChange:this.onChange,disabled:d})}}class JsonSchema_array extends Ke.PureComponent{static defaultProps=br;constructor(e,t){super(e,t),this.state={value:valueOrEmptyList(e.value),schema:e.schema}}UNSAFE_componentWillReceiveProps(e){const t=valueOrEmptyList(e.value);t!==this.state.value&&this.setState({value:t}),e.schema!==this.state.schema&&this.setState({schema:e.schema})}onChange=()=>{this.props.onChange(this.state.value)};onItemChange=(e,t)=>{this.setState((({value:r})=>({value:r.set(t,e)})),this.onChange)};removeItem=e=>{this.setState((({value:t})=>({value:t.delete(e)})),this.onChange)};addItem=()=>{const{fn:e}=this.props;let t=valueOrEmptyList(this.state.value);this.setState((()=>({value:t.push(e.getSampleSchema(this.state.schema.get(\"items\"),!1,{includeWriteOnly:!0}))})),this.onChange)};onEnumChange=e=>{this.setState((()=>({value:e})),this.onChange)};render(){let{getComponent:e,required:t,schema:r,errors:n,fn:a,disabled:o}=this.props;n=n.toJS?n.toJS():Array.isArray(n)?n:[];const s=n.filter((e=>\"string\"==typeof e)),l=n.filter((e=>void 0!==e.needRemove)).map((e=>e.error)),i=this.state.value,c=!!(i&&i.count&&i.count()>0),u=r.getIn([\"items\",\"enum\"]),d=r.getIn([\"items\",\"type\"]),p=r.getIn([\"items\",\"format\"]),m=r.get(\"items\");let f,h=!1,g=\"file\"===d||\"string\"===d&&\"binary\"===p;if(d&&p?f=e(`JsonSchema_${d}_${p}`):\"boolean\"!==d&&\"array\"!==d&&\"object\"!==d||(f=e(`JsonSchema_${d}`)),f||g||(h=!0),u){const r=e(\"Select\");return Ke.default.createElement(r,{className:n.length?\"invalid\":\"\",title:n.length?n:\"\",multiple:!0,value:i,disabled:o,allowedValues:u,allowEmptyValue:!t,onChange:this.onEnumChange})}const y=e(\"Button\");return Ke.default.createElement(\"div\",{className:\"json-schema-array\"},c?i.map(((t,r)=>{const s=(0,Fe.fromJS)([...n.filter((e=>e.index===r)).map((e=>e.error))]);return Ke.default.createElement(\"div\",{key:r,className:\"json-schema-form-item\"},g?Ke.default.createElement(JsonSchemaArrayItemFile,{value:t,onChange:e=>this.onItemChange(e,r),disabled:o,errors:s,getComponent:e}):h?Ke.default.createElement(JsonSchemaArrayItemText,{value:t,onChange:e=>this.onItemChange(e,r),disabled:o,errors:s}):Ke.default.createElement(f,(0,nr.default)({},this.props,{value:t,onChange:e=>this.onItemChange(e,r),disabled:o,errors:s,schema:m,getComponent:e,fn:a})),o?null:Ke.default.createElement(y,{className:`btn btn-sm json-schema-form-item-remove ${l.length?\"invalid\":null}`,title:l.length?l:\"\",onClick:()=>this.removeItem(r)},\" - \"))})):null,o?null:Ke.default.createElement(y,{className:`btn btn-sm json-schema-form-item-add ${s.length?\"invalid\":null}`,title:s.length?s:\"\",onClick:this.addItem},\"Add \",d?`${d} `:\"\",\"item\"))}}class JsonSchemaArrayItemText extends Ke.Component{static defaultProps=br;onChange=e=>{const t=e.target.value;this.props.onChange(t,this.props.keyName)};render(){let{value:e,errors:t,description:r,disabled:n}=this.props;return e||(e=\"\"),t=t.toJS?t.toJS():[],Ke.default.createElement(vr.default,{type:\"text\",className:t.length?\"invalid\":\"\",title:t.length?t:\"\",value:e,minLength:0,debounceTimeout:350,placeholder:r,onChange:this.onChange,disabled:n})}}class JsonSchemaArrayItemFile extends Ke.Component{static defaultProps=br;onFileChange=e=>{const t=e.target.files[0];this.props.onChange(t,this.props.keyName)};render(){let{getComponent:e,errors:t,disabled:r}=this.props;const n=e(\"Input\"),a=r||!(\"FormData\"in window);return Ke.default.createElement(n,{type:\"file\",className:t.length?\"invalid\":\"\",title:t.length?t:\"\",onChange:this.onFileChange,disabled:a})}}class JsonSchema_boolean extends Ke.Component{static defaultProps=br;onEnumChange=e=>this.props.onChange(e);render(){let{getComponent:e,value:t,errors:r,schema:n,required:a,disabled:o}=this.props;r=r.toJS?r.toJS():[];let s=n&&n.get?n.get(\"enum\"):null,l=!s||!a,i=!s&&[\"true\",\"false\"];const c=e(\"Select\");return Ke.default.createElement(c,{className:r.length?\"invalid\":\"\",title:r.length?r:\"\",value:String(t),disabled:o,allowedValues:s?[...s]:i,allowEmptyValue:l,onChange:this.onEnumChange})}}const stringifyObjectErrors=e=>e.map((e=>{const t=void 0!==e.propKey?e.propKey:e.index;let r=\"string\"==typeof e?e:\"string\"==typeof e.error?e.error:null;if(!t&&r)return r;let n=e.error,a=`/${e.propKey}`;for(;\"object\"==typeof n;){const e=void 0!==n.propKey?n.propKey:n.index;if(void 0===e)break;if(a+=`/${e}`,!n.error)break;n=n.error}return`${a}: ${n}`}));class JsonSchema_object extends Ke.PureComponent{constructor(){super()}static defaultProps=br;onChange=e=>{this.props.onChange(e)};handleOnChange=e=>{const t=e.target.value;this.onChange(t)};render(){let{getComponent:e,value:t,errors:r,disabled:n}=this.props;const a=e(\"TextArea\");return r=r.toJS?r.toJS():Array.isArray(r)?r:[],Ke.default.createElement(\"div\",null,Ke.default.createElement(a,{className:(0,fr.default)({invalid:r.length}),title:r.length?stringifyObjectErrors(r).join(\", \"):\"\",value:stringify(t),disabled:n,onChange:this.handleOnChange}))}}function valueOrEmptyList(e){return Fe.List.isList(e)?e:Array.isArray(e)?(0,Fe.fromJS)(e):(0,Fe.List)()}var json_schema_5=()=>({components:{modelExample:model_example,ModelWrapper,ModelCollapse,Model,Models,EnumModel:enum_model,ObjectModel,ArrayModel,PrimitiveModel:Primitive,schemes:Schemes,SchemesContainer,...je}}),wr=__webpack_require__(123),Cr=__webpack_require__.n(wr),xr=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return T.default}}),Or=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return B.default}});const shallowArrayEquals=e=>t=>Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(((e,r)=>e===t[r])),list=(...e)=>e;class Cache extends Map{delete(e){const t=Array.from(this.keys()).find(shallowArrayEquals(e));return super.delete(t)}get(e){const t=Array.from(this.keys()).find(shallowArrayEquals(e));return super.get(t)}has(e){return-1!==Array.from(this.keys()).findIndex(shallowArrayEquals(e))}}var utils_memoizeN=(e,t=list)=>{const{Cache:r}=lt.default;lt.default.Cache=Cache;const n=(0,lt.default)(e,t);return lt.default.Cache=r,n};const kr={string:e=>e.pattern?(e=>{try{return new xr.default(e).gen()}catch(e){return\"string\"}})(e.pattern):\"string\",string_email:()=>\"user@example.com\",\"string_date-time\":()=>(new Date).toISOString(),string_date:()=>(new Date).toISOString().substring(0,10),string_uuid:()=>\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",string_hostname:()=>\"example.com\",string_ipv4:()=>\"198.51.100.42\",string_ipv6:()=>\"2001:0db8:5b96:0000:0000:426f:8e17:642a\",number:()=>0,number_float:()=>0,integer:()=>0,boolean:e=>\"boolean\"!=typeof e.default||e.default},primitive=e=>{e=objectify(e);let{type:t,format:r}=e,n=kr[`${t}_${r}`]||kr[t];return isFunc(n)?n(e):\"Unknown Type: \"+e.type},sanitizeRef=e=>deeplyStripKey(e,\"$$ref\",(e=>\"string\"==typeof e&&e.indexOf(\"#\")>-1)),Nr=[\"maxProperties\",\"minProperties\"],Ar=[\"minItems\",\"maxItems\"],Ir=[\"minimum\",\"maximum\",\"exclusiveMinimum\",\"exclusiveMaximum\"],Rr=[\"minLength\",\"maxLength\"],mergeJsonSchema=(e,t,r={})=>{const n={...e};if([\"example\",\"default\",\"enum\",\"xml\",\"type\",...Nr,...Ar,...Ir,...Rr].forEach((e=>(e=>{void 0===n[e]&&void 0!==t[e]&&(n[e]=t[e])})(e))),void 0!==t.required&&Array.isArray(t.required)&&(void 0!==n.required&&n.required.length||(n.required=[]),t.required.forEach((e=>{n.required.includes(e)||n.required.push(e)}))),t.properties){n.properties||(n.properties={});let e=objectify(t.properties);for(let a in e)Object.prototype.hasOwnProperty.call(e,a)&&(e[a]&&e[a].deprecated||e[a]&&e[a].readOnly&&!r.includeReadOnly||e[a]&&e[a].writeOnly&&!r.includeWriteOnly||n.properties[a]||(n.properties[a]=e[a],!t.required&&Array.isArray(t.required)&&-1!==t.required.indexOf(a)&&(n.required?n.required.push(a):n.required=[a])))}return t.items&&(n.items||(n.items={}),n.items=mergeJsonSchema(n.items,t.items,r)),n},sampleFromSchemaGeneric=(e,t={},r=void 0,n=!1)=>{e&&isFunc(e.toJS)&&(e=e.toJS());let a=void 0!==r||e&&void 0!==e.example||e&&void 0!==e.default;const o=!a&&e&&e.oneOf&&e.oneOf.length>0,s=!a&&e&&e.anyOf&&e.anyOf.length>0;if(!a&&(o||s)){const r=objectify(o?e.oneOf[0]:e.anyOf[0]);if(!(e=mergeJsonSchema(e,r,t)).xml&&r.xml&&(e.xml=r.xml),void 0!==e.example&&void 0!==r.example)a=!0;else if(r.properties){e.properties||(e.properties={});let n=objectify(r.properties);for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(n[a]&&n[a].deprecated||n[a]&&n[a].readOnly&&!t.includeReadOnly||n[a]&&n[a].writeOnly&&!t.includeWriteOnly||e.properties[a]||(e.properties[a]=n[a],!r.required&&Array.isArray(r.required)&&-1!==r.required.indexOf(a)&&(e.required?e.required.push(a):e.required=[a])))}}const l={};let{xml:i,type:c,example:u,properties:d,additionalProperties:p,items:m}=e||{},{includeReadOnly:f,includeWriteOnly:h}=t;i=i||{};let g,{name:y,prefix:S,namespace:_}=i,v={};if(n&&(y=y||\"notagname\",g=(S?S+\":\":\"\")+y,_)){l[S?\"xmlns:\"+S:\"xmlns\"]=_}n&&(v[g]=[]);const schemaHasAny=t=>t.some((t=>Object.prototype.hasOwnProperty.call(e,t)));e&&!c&&(d||p||schemaHasAny(Nr)?c=\"object\":m||schemaHasAny(Ar)?c=\"array\":schemaHasAny(Ir)?(c=\"number\",e.type=\"number\"):a||e.enum||(c=\"string\",e.type=\"string\"));const handleMinMaxItems=t=>{if(null!=e?.maxItems&&(t=t.slice(0,e?.maxItems)),null!=e?.minItems){let r=0;for(;t.length<e?.minItems;)t.push(t[r++%t.length])}return t},b=objectify(d);let w,C=0;const hasExceededMaxProperties=()=>e&&null!==e.maxProperties&&void 0!==e.maxProperties&&C>=e.maxProperties,canAddProperty=t=>!e||null===e.maxProperties||void 0===e.maxProperties||!hasExceededMaxProperties()&&(!(t=>!(e&&e.required&&e.required.length&&e.required.includes(t)))(t)||e.maxProperties-C-(()=>{if(!e||!e.required)return 0;let t=0;return n?e.required.forEach((e=>t+=void 0===v[e]?0:1)):e.required.forEach((e=>t+=void 0===v[g]?.find((t=>void 0!==t[e]))?0:1)),e.required.length-t})()>0);if(w=n?(r,a=void 0)=>{if(e&&b[r]){if(b[r].xml=b[r].xml||{},b[r].xml.attribute){const e=Array.isArray(b[r].enum)?b[r].enum[0]:void 0,t=b[r].example,n=b[r].default;return void(l[b[r].xml.name||r]=void 0!==t?t:void 0!==n?n:void 0!==e?e:primitive(b[r]))}b[r].xml.name=b[r].xml.name||r}else b[r]||!1===p||(b[r]={xml:{name:r}});let o=sampleFromSchemaGeneric(e&&b[r]||void 0,t,a,n);canAddProperty(r)&&(C++,Array.isArray(o)?v[g]=v[g].concat(o):v[g].push(o))}:(r,a)=>{if(canAddProperty(r)){if(Object.prototype.hasOwnProperty.call(e,\"discriminator\")&&e.discriminator&&Object.prototype.hasOwnProperty.call(e.discriminator,\"mapping\")&&e.discriminator.mapping&&Object.prototype.hasOwnProperty.call(e,\"$$ref\")&&e.$$ref&&e.discriminator.propertyName===r){for(let t in e.discriminator.mapping)if(-1!==e.$$ref.search(e.discriminator.mapping[t])){v[r]=t;break}}else v[r]=sampleFromSchemaGeneric(b[r],t,a,n);C++}},a){let a;if(a=sanitizeRef(void 0!==r?r:void 0!==u?u:e.default),!n){if(\"number\"==typeof a&&\"string\"===c)return`${a}`;if(\"string\"!=typeof a||\"string\"===c)return a;try{return JSON.parse(a)}catch(e){return a}}if(e||(c=Array.isArray(a)?\"array\":typeof a),\"array\"===c){if(!Array.isArray(a)){if(\"string\"==typeof a)return a;a=[a]}const r=e?e.items:void 0;r&&(r.xml=r.xml||i||{},r.xml.name=r.xml.name||i.name);let o=a.map((e=>sampleFromSchemaGeneric(r,t,e,n)));return o=handleMinMaxItems(o),i.wrapped?(v[g]=o,(0,Or.default)(l)||v[g].push({_attr:l})):v=o,v}if(\"object\"===c){if(\"string\"==typeof a)return a;for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e&&b[t]&&b[t].readOnly&&!f||e&&b[t]&&b[t].writeOnly&&!h||(e&&b[t]&&b[t].xml&&b[t].xml.attribute?l[b[t].xml.name||t]=a[t]:w(t,a[t])));return(0,Or.default)(l)||v[g].push({_attr:l}),v}return v[g]=(0,Or.default)(l)?a:[{_attr:l},a],v}if(\"object\"===c){for(let e in b)Object.prototype.hasOwnProperty.call(b,e)&&(b[e]&&b[e].deprecated||b[e]&&b[e].readOnly&&!f||b[e]&&b[e].writeOnly&&!h||w(e));if(n&&l&&v[g].push({_attr:l}),hasExceededMaxProperties())return v;if(!0===p)n?v[g].push({additionalProp:\"Anything can be here\"}):v.additionalProp1={},C++;else if(p){const r=objectify(p),a=sampleFromSchemaGeneric(r,t,void 0,n);if(n&&r.xml&&r.xml.name&&\"notagname\"!==r.xml.name)v[g].push(a);else{const t=null!==e.minProperties&&void 0!==e.minProperties&&C<e.minProperties?e.minProperties-C:3;for(let e=1;e<=t;e++){if(hasExceededMaxProperties())return v;if(n){const t={};t[\"additionalProp\"+e]=a.notagname,v[g].push(t)}else v[\"additionalProp\"+e]=a;C++}}}return v}if(\"array\"===c){if(!m)return;let r;if(n&&(m.xml=m.xml||e?.xml||{},m.xml.name=m.xml.name||i.name),Array.isArray(m.anyOf))r=m.anyOf.map((e=>sampleFromSchemaGeneric(mergeJsonSchema(e,m,t),t,void 0,n)));else if(Array.isArray(m.oneOf))r=m.oneOf.map((e=>sampleFromSchemaGeneric(mergeJsonSchema(e,m,t),t,void 0,n)));else{if(!(!n||n&&i.wrapped))return sampleFromSchemaGeneric(m,t,void 0,n);r=[sampleFromSchemaGeneric(m,t,void 0,n)]}return r=handleMinMaxItems(r),n&&i.wrapped?(v[g]=r,(0,Or.default)(l)||v[g].push({_attr:l}),v):r}let x;if(e&&Array.isArray(e.enum))x=normalizeArray(e.enum)[0];else{if(!e)return;if(x=primitive(e),\"number\"==typeof x){let t=e.minimum;null!=t&&(e.exclusiveMinimum&&t++,x=t);let r=e.maximum;null!=r&&(e.exclusiveMaximum&&r--,x=r)}if(\"string\"==typeof x&&(null!==e.maxLength&&void 0!==e.maxLength&&(x=x.slice(0,e.maxLength)),null!==e.minLength&&void 0!==e.minLength)){let t=0;for(;x.length<e.minLength;)x+=x[t++%x.length]}}if(\"file\"!==c)return n?(v[g]=(0,Or.default)(l)?x:[{_attr:l},x],v):x},inferSchema=e=>(e.schema&&(e=e.schema),e.properties&&(e.type=\"object\"),e),createXMLExample=(e,t,r)=>{const n=sampleFromSchemaGeneric(e,t,r,!0);if(n)return\"string\"==typeof n?n:Cr()(n,{declaration:!0,indent:\"\\t\"})},sampleFromSchema=(e,t,r)=>sampleFromSchemaGeneric(e,t,r,!1),resolver=(e,t,r)=>[e,JSON.stringify(t),JSON.stringify(r)],Tr=utils_memoizeN(createXMLExample,resolver),Br=utils_memoizeN(sampleFromSchema,resolver),jr=[{when:/json/,shouldStringifyTypes:[\"string\"]}],Pr=[\"object\"];var get_json_sample_schema=e=>(t,r,n,a)=>{const{fn:o}=e(),s=o.memoizedSampleFromSchema(t,r,a),l=typeof s,i=jr.reduce(((e,t)=>t.when.test(n)?[...e,...t.shouldStringifyTypes]:e),Pr);return(0,ct.default)(i,(e=>e===l))?JSON.stringify(s,null,2):s};var get_yaml_sample_schema=e=>(t,r,n,a)=>{const{fn:o}=e(),s=o.getJsonSampleSchema(t,r,n,a);let l;try{l=Jt.default.dump(Jt.default.load(s),{lineWidth:-1},{schema:Jt.JSON_SCHEMA}),\"\\n\"===l[l.length-1]&&(l=l.slice(0,l.length-1))}catch(e){return console.error(e),\"error: could not generate yaml example\"}return l.replace(/\\t/g,\"  \")};var get_xml_sample_schema=e=>(t,r,n)=>{const{fn:a}=e();if(t&&!t.xml&&(t.xml={}),t&&!t.xml.name){if(!t.$$ref&&(t.type||t.items||t.properties||t.additionalProperties))return'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n\\x3c!-- XML example cannot be generated; root element name is undefined --\\x3e';if(t.$$ref){let e=t.$$ref.match(/\\S*\\/(\\S+)$/);t.xml.name=e[1]}}return a.memoizedCreateXMLExample(t,r,n)};var get_sample_schema=e=>(t,r=\"\",n={},a=void 0)=>{const{fn:o}=e();return\"function\"==typeof t?.toJS&&(t=t.toJS()),\"function\"==typeof a?.toJS&&(a=a.toJS()),/xml/.test(r)?o.getXmlSampleSchema(t,n,a):/(yaml|yml)/.test(r)?o.getYamlSampleSchema(t,n,r,a):o.getJsonSampleSchema(t,n,r,a)};var json_schema_5_samples=({getSystem:e})=>{const t=get_json_sample_schema(e),r=get_yaml_sample_schema(e),n=get_xml_sample_schema(e),a=get_sample_schema(e);return{fn:{jsonSchema5:{inferSchema,sampleFromSchema,sampleFromSchemaGeneric,createXMLExample,memoizedSampleFromSchema:Br,memoizedCreateXMLExample:Tr,getJsonSampleSchema:t,getYamlSampleSchema:r,getXmlSampleSchema:n,getSampleSchema:a,mergeJsonSchema},inferSchema,sampleFromSchema,sampleFromSchemaGeneric,createXMLExample,memoizedSampleFromSchema:Br,memoizedCreateXMLExample:Tr,getJsonSampleSchema:t,getYamlSampleSchema:r,getXmlSampleSchema:n,getSampleSchema:a,mergeJsonSchema}}},Mr=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return j.default}});const qr=[\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"],spec_selectors_state=e=>e||(0,Fe.Map)(),Lr=(0,Bt.createSelector)(spec_selectors_state,(e=>e.get(\"lastError\"))),Dr=(0,Bt.createSelector)(spec_selectors_state,(e=>e.get(\"url\"))),Ur=(0,Bt.createSelector)(spec_selectors_state,(e=>e.get(\"spec\")||\"\")),$r=(0,Bt.createSelector)(spec_selectors_state,(e=>e.get(\"specSource\")||\"not-editor\")),Jr=(0,Bt.createSelector)(spec_selectors_state,(e=>e.get(\"json\",(0,Fe.Map)()))),Vr=(0,Bt.createSelector)(Jr,(e=>e.toJS())),Kr=(0,Bt.createSelector)(spec_selectors_state,(e=>e.get(\"resolved\",(0,Fe.Map)()))),specResolvedSubtree=(e,t)=>e.getIn([\"resolvedSubtrees\",...t],void 0),mergerFn=(e,t)=>Fe.Map.isMap(e)&&Fe.Map.isMap(t)?t.get(\"$$ref\")?t:(0,Fe.OrderedMap)().mergeWith(mergerFn,e,t):t,zr=(0,Bt.createSelector)(spec_selectors_state,(e=>(0,Fe.OrderedMap)().mergeWith(mergerFn,e.get(\"json\"),e.get(\"resolvedSubtrees\")))),spec=e=>Jr(e),Fr=(0,Bt.createSelector)(spec,(()=>!1)),Wr=(0,Bt.createSelector)(spec,(e=>returnSelfOrNewMap(e&&e.get(\"info\")))),Hr=(0,Bt.createSelector)(spec,(e=>returnSelfOrNewMap(e&&e.get(\"externalDocs\")))),Gr=(0,Bt.createSelector)(Wr,(e=>e&&e.get(\"version\"))),Xr=(0,Bt.createSelector)(Gr,(e=>/v?([0-9]*)\\.([0-9]*)\\.([0-9]*)/i.exec(e).slice(1))),Yr=(0,Bt.createSelector)(zr,(e=>e.get(\"paths\"))),Qr=(0,Mr.default)([\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\"]),Zr=(0,Bt.createSelector)(Yr,(e=>{if(!e||e.size<1)return(0,Fe.List)();let t=(0,Fe.List)();return e&&e.forEach?(e.forEach(((e,r)=>{if(!e||!e.forEach)return{};e.forEach(((e,n)=>{qr.indexOf(n)<0||(t=t.push((0,Fe.fromJS)({path:r,method:n,operation:e,id:`${n}-${r}`})))}))})),t):(0,Fe.List)()})),en=(0,Bt.createSelector)(spec,(e=>(0,Fe.Set)(e.get(\"consumes\")))),tn=(0,Bt.createSelector)(spec,(e=>(0,Fe.Set)(e.get(\"produces\")))),rn=(0,Bt.createSelector)(spec,(e=>e.get(\"security\",(0,Fe.List)()))),nn=(0,Bt.createSelector)(spec,(e=>e.get(\"securityDefinitions\"))),findDefinition=(e,t)=>{const r=e.getIn([\"resolvedSubtrees\",\"definitions\",t],null),n=e.getIn([\"json\",\"definitions\",t],null);return r||n||null},an=(0,Bt.createSelector)(spec,(e=>{const t=e.get(\"definitions\");return Fe.Map.isMap(t)?t:(0,Fe.Map)()})),on=(0,Bt.createSelector)(spec,(e=>e.get(\"basePath\"))),sn=(0,Bt.createSelector)(spec,(e=>e.get(\"host\"))),ln=(0,Bt.createSelector)(spec,(e=>e.get(\"schemes\",(0,Fe.Map)()))),cn=(0,Bt.createSelector)([Zr,en,tn],((e,t,r)=>e.map((e=>e.update(\"operation\",(e=>{if(e){if(!Fe.Map.isMap(e))return;return e.withMutations((e=>(e.get(\"consumes\")||e.update(\"consumes\",(e=>(0,Fe.Set)(e).merge(t))),e.get(\"produces\")||e.update(\"produces\",(e=>(0,Fe.Set)(e).merge(r))),e)))}return(0,Fe.Map)()})))))),un=(0,Bt.createSelector)(spec,(e=>{const t=e.get(\"tags\",(0,Fe.List)());return Fe.List.isList(t)?t.filter((e=>Fe.Map.isMap(e))):(0,Fe.List)()})),tagDetails=(e,t)=>(un(e)||(0,Fe.List)()).filter(Fe.Map.isMap).find((e=>e.get(\"name\")===t),(0,Fe.Map)()),dn=(0,Bt.createSelector)(cn,un,((e,t)=>e.reduce(((e,t)=>{let r=(0,Fe.Set)(t.getIn([\"operation\",\"tags\"]));return r.count()<1?e.update(\"default\",(0,Fe.List)(),(e=>e.push(t))):r.reduce(((e,r)=>e.update(r,(0,Fe.List)(),(e=>e.push(t)))),e)}),t.reduce(((e,t)=>e.set(t.get(\"name\"),(0,Fe.List)())),(0,Fe.OrderedMap)())))),selectors_taggedOperations=e=>({getConfigs:t})=>{let{tagsSorter:r,operationsSorter:n}=t();return dn(e).sortBy(((e,t)=>t),((e,t)=>{let n=\"function\"==typeof r?r:bt.tagsSorter[r];return n?n(e,t):null})).map(((t,r)=>{let a=\"function\"==typeof n?n:bt.operationsSorter[n],o=a?t.sort(a):t;return(0,Fe.Map)({tagDetails:tagDetails(e,r),operations:o})}))},pn=(0,Bt.createSelector)(spec_selectors_state,(e=>e.get(\"responses\",(0,Fe.Map)()))),mn=(0,Bt.createSelector)(spec_selectors_state,(e=>e.get(\"requests\",(0,Fe.Map)()))),fn=(0,Bt.createSelector)(spec_selectors_state,(e=>e.get(\"mutatedRequests\",(0,Fe.Map)()))),responseFor=(e,t,r)=>pn(e).getIn([t,r],null),requestFor=(e,t,r)=>mn(e).getIn([t,r],null),mutatedRequestFor=(e,t,r)=>fn(e).getIn([t,r],null),allowTryItOutFor=()=>!0,parameterWithMetaByIdentity=(e,t,r)=>{const n=zr(e).getIn([\"paths\",...t,\"parameters\"],(0,Fe.OrderedMap)()),a=e.getIn([\"meta\",\"paths\",...t,\"parameters\"],(0,Fe.OrderedMap)());return n.map((e=>{const t=a.get(`${r.get(\"in\")}.${r.get(\"name\")}`),n=a.get(`${r.get(\"in\")}.${r.get(\"name\")}.hash-${r.hashCode()}`);return(0,Fe.OrderedMap)().merge(e,t,n)})).find((e=>e.get(\"in\")===r.get(\"in\")&&e.get(\"name\")===r.get(\"name\")),(0,Fe.OrderedMap)())},parameterInclusionSettingFor=(e,t,r,n)=>{const a=`${n}.${r}`;return e.getIn([\"meta\",\"paths\",...t,\"parameter_inclusions\",a],!1)},parameterWithMeta=(e,t,r,n)=>{const a=zr(e).getIn([\"paths\",...t,\"parameters\"],(0,Fe.OrderedMap)()).find((e=>e.get(\"in\")===n&&e.get(\"name\")===r),(0,Fe.OrderedMap)());return parameterWithMetaByIdentity(e,t,a)},operationWithMeta=(e,t,r)=>{const n=zr(e).getIn([\"paths\",t,r],(0,Fe.OrderedMap)()),a=e.getIn([\"meta\",\"paths\",t,r],(0,Fe.OrderedMap)()),o=n.get(\"parameters\",(0,Fe.List)()).map((n=>parameterWithMetaByIdentity(e,[t,r],n)));return(0,Fe.OrderedMap)().merge(n,a).set(\"parameters\",o)};function getParameter(e,t,r,n){return t=t||[],e.getIn([\"meta\",\"paths\",...t,\"parameters\"],(0,Fe.fromJS)([])).find((e=>Fe.Map.isMap(e)&&e.get(\"name\")===r&&e.get(\"in\")===n))||(0,Fe.Map)()}const hn=(0,Bt.createSelector)(spec,(e=>{const t=e.get(\"host\");return\"string\"==typeof t&&t.length>0&&\"/\"!==t[0]}));function parameterValues(e,t,r){return t=t||[],operationWithMeta(e,...t).get(\"parameters\",(0,Fe.List)()).reduce(((e,t)=>{let n=r&&\"body\"===t.get(\"in\")?t.get(\"value_xml\"):t.get(\"value\");return Fe.List.isList(n)&&(n=n.filter((e=>\"\"!==e))),e.set(paramToIdentifier(t,{allowHashes:!1}),n)}),(0,Fe.fromJS)({}))}function parametersIncludeIn(e,t=\"\"){if(Fe.List.isList(e))return e.some((e=>Fe.Map.isMap(e)&&e.get(\"in\")===t))}function parametersIncludeType(e,t=\"\"){if(Fe.List.isList(e))return e.some((e=>Fe.Map.isMap(e)&&e.get(\"type\")===t))}function contentTypeValues(e,t){t=t||[];let r=zr(e).getIn([\"paths\",...t],(0,Fe.fromJS)({})),n=e.getIn([\"meta\",\"paths\",...t],(0,Fe.fromJS)({})),a=currentProducesFor(e,t);const o=r.get(\"parameters\")||new Fe.List,s=n.get(\"consumes_value\")?n.get(\"consumes_value\"):parametersIncludeType(o,\"file\")?\"multipart/form-data\":parametersIncludeType(o,\"formData\")?\"application/x-www-form-urlencoded\":void 0;return(0,Fe.fromJS)({requestContentType:s,responseContentType:a})}function currentProducesFor(e,t){t=t||[];const r=zr(e).getIn([\"paths\",...t],null);if(null===r)return;const n=e.getIn([\"meta\",\"paths\",...t,\"produces_value\"],null),a=r.getIn([\"produces\",0],null);return n||a||\"application/json\"}function producesOptionsFor(e,t){t=t||[];const r=zr(e),n=r.getIn([\"paths\",...t],null);if(null===n)return;const[a]=t,o=n.get(\"produces\",null),s=r.getIn([\"paths\",a,\"produces\"],null),l=r.getIn([\"produces\"],null);return o||s||l}function consumesOptionsFor(e,t){t=t||[];const r=zr(e),n=r.getIn([\"paths\",...t],null);if(null===n)return;const[a]=t,o=n.get(\"consumes\",null),s=r.getIn([\"paths\",a,\"consumes\"],null),l=r.getIn([\"consumes\"],null);return o||s||l}const operationScheme=(e,t,r)=>{let n=e.get(\"url\").match(/^([a-z][a-z0-9+\\-.]*):/),a=Array.isArray(n)?n[1]:null;return e.getIn([\"scheme\",t,r])||e.getIn([\"scheme\",\"_defaultScheme\"])||a||\"\"},canExecuteScheme=(e,t,r)=>[\"http\",\"https\"].indexOf(operationScheme(e,t,r))>-1,validationErrors=(e,t)=>{t=t||[];const r=e.getIn([\"meta\",\"paths\",...t,\"parameters\"],(0,Fe.fromJS)([])),n=[];if(0===r.length)return n;const getErrorsWithPaths=(e,t=[])=>{const getNestedErrorsWithPaths=(e,t)=>{const r=[...t,e.get(\"propKey\")||e.get(\"index\")];return Fe.Map.isMap(e.get(\"error\"))?getErrorsWithPaths(e.get(\"error\"),r):{error:e.get(\"error\"),path:r}};return Fe.List.isList(e)?e.map((e=>Fe.Map.isMap(e)?getNestedErrorsWithPaths(e,t):{error:e,path:t})):getNestedErrorsWithPaths(e,t)};return r.forEach(((e,t)=>{const r=t.split(\".\").slice(1,-1).join(\".\"),a=e.get(\"errors\");if(a&&a.count()){getErrorsWithPaths(a).forEach((({error:e,path:t})=>{n.push(((e,t,r)=>`For '${r}'${(t=t.reduce(((e,t)=>\"number\"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t),\"\"))?` at path '${t}'`:\"\"}: ${e}.`)(e,t,r))}))}})),n},validateBeforeExecute=(e,t)=>0===validationErrors(e,t).length,getOAS3RequiredRequestBodyContentType=(e,t)=>{let r={requestBody:!1,requestContentType:{}},n=e.getIn([\"resolvedSubtrees\",\"paths\",...t,\"requestBody\"],(0,Fe.fromJS)([]));return n.size<1||(n.getIn([\"required\"])&&(r.requestBody=n.getIn([\"required\"])),n.getIn([\"content\"]).entrySeq().forEach((e=>{const t=e[0];if(e[1].getIn([\"schema\",\"required\"])){const n=e[1].getIn([\"schema\",\"required\"]).toJS();r.requestContentType[t]=n}}))),r},isMediaTypeSchemaPropertiesEqual=(e,t,r,n)=>{if((r||n)&&r===n)return!0;let a=e.getIn([\"resolvedSubtrees\",\"paths\",...t,\"requestBody\",\"content\"],(0,Fe.fromJS)([]));if(a.size<2||!r||!n)return!1;let o=a.getIn([r,\"schema\",\"properties\"],(0,Fe.fromJS)([])),s=a.getIn([n,\"schema\",\"properties\"],(0,Fe.fromJS)([]));return!!o.equals(s)};function returnSelfOrNewMap(e){return Fe.Map.isMap(e)?e:new Fe.Map}var gn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return P.default}}),yn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return M.default}}),En=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return q.default}}),Sn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return L.default}});const _n=\"spec_update_spec\",vn=\"spec_update_url\",bn=\"spec_update_json\",wn=\"spec_update_param\",Cn=\"spec_update_empty_param_inclusion\",xn=\"spec_validate_param\",On=\"spec_set_response\",kn=\"spec_set_request\",Nn=\"spec_set_mutated_request\",An=\"spec_log_request\",In=\"spec_clear_response\",Rn=\"spec_clear_request\",Tn=\"spec_clear_validate_param\",Bn=\"spec_update_operation_meta_value\",jn=\"spec_update_resolved\",Pn=\"spec_update_resolved_subtree\",Mn=\"set_scheme\",toStr=e=>(0,gn.default)(e)?e:\"\";function updateSpec(e){const t=toStr(e).replace(/\\t/g,\"  \");if(\"string\"==typeof e)return{type:_n,payload:t}}function updateResolved(e){return{type:jn,payload:e}}function updateUrl(e){return{type:vn,payload:e}}function updateJsonSpec(e){return{type:bn,payload:e}}const parseToJson=e=>({specActions:t,specSelectors:r,errActions:n})=>{let{specStr:a}=r,o=null;try{e=e||a(),n.clear({source:\"parser\"}),o=Jt.default.load(e,{schema:Jt.JSON_SCHEMA})}catch(e){return console.error(e),n.newSpecErr({source:\"parser\",level:\"error\",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return o&&\"object\"==typeof o?t.updateJsonSpec(o):{}};let qn=!1;const resolveSpec=(e,t)=>({specActions:r,specSelectors:n,errActions:a,fn:{fetch:o,resolve:s,AST:l={}},getConfigs:i})=>{qn||(console.warn(\"specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!\"),qn=!0);const{modelPropertyMacro:c,parameterMacro:u,requestInterceptor:d,responseInterceptor:p}=i();void 0===e&&(e=n.specJson()),void 0===t&&(t=n.url());let m=l.getLineNumberForPath?l.getLineNumberForPath:()=>{},f=n.specStr();return s({fetch:o,spec:e,baseDoc:String(new URL(t,document.baseURI)),modelPropertyMacro:c,parameterMacro:u,requestInterceptor:d,responseInterceptor:p}).then((({spec:e,errors:t})=>{if(a.clear({type:\"thrown\"}),Array.isArray(t)&&t.length>0){let e=t.map((e=>(console.error(e),e.line=e.fullPath?m(f,e.fullPath):null,e.path=e.fullPath?e.fullPath.join(\".\"):null,e.level=\"error\",e.type=\"thrown\",e.source=\"resolver\",Object.defineProperty(e,\"message\",{enumerable:!0,value:e.message}),e)));a.newThrownErrBatch(e)}return r.updateResolved(e)}))};let Ln=[];const Dn=(0,yn.default)((()=>{const e=Ln.reduce(((e,{path:t,system:r})=>(e.has(r)||e.set(r,[]),e.get(r).push(t),e)),new Map);Ln=[],e.forEach((async(e,t)=>{if(!t)return void console.error(\"debResolveSubtrees: don't have a system to operate on, aborting.\");if(!t.fn.resolveSubtree)return void console.error(\"Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing.\");const{errActions:r,errSelectors:n,fn:{resolveSubtree:a,fetch:o,AST:s={}},specSelectors:l,specActions:i}=t,c=s.getLineNumberForPath??(0,Mr.default)(void 0),u=l.specStr(),{modelPropertyMacro:d,parameterMacro:p,requestInterceptor:m,responseInterceptor:f}=t.getConfigs();try{const t=await e.reduce((async(e,t)=>{let{resultMap:s,specWithCurrentSubtrees:i}=await e;const{errors:h,spec:g}=await a(i,t,{baseDoc:String(new URL(l.url(),document.baseURI)),modelPropertyMacro:d,parameterMacro:p,requestInterceptor:m,responseInterceptor:f});if(n.allErrors().size&&r.clearBy((e=>\"thrown\"!==e.get(\"type\")||\"resolver\"!==e.get(\"source\")||!e.get(\"fullPath\").every(((e,r)=>e===t[r]||void 0===t[r])))),Array.isArray(h)&&h.length>0){let e=h.map((e=>(e.line=e.fullPath?c(u,e.fullPath):null,e.path=e.fullPath?e.fullPath.join(\".\"):null,e.level=\"error\",e.type=\"thrown\",e.source=\"resolver\",Object.defineProperty(e,\"message\",{enumerable:!0,value:e.message}),e)));r.newThrownErrBatch(e)}return g&&l.isOAS3()&&\"components\"===t[0]&&\"securitySchemes\"===t[1]&&await Promise.all(Object.values(g).filter((e=>\"openIdConnect\"===e.type)).map((async e=>{const t={url:e.openIdConnectUrl,requestInterceptor:m,responseInterceptor:f};try{const r=await o(t);r instanceof Error||r.status>=400?console.error(r.statusText+\" \"+t.url):e.openIdConnectData=JSON.parse(r.text)}catch(e){console.error(e)}}))),(0,En.default)(s,t,g),i=(0,Sn.default)(t,g,i),{resultMap:s,specWithCurrentSubtrees:i}}),Promise.resolve({resultMap:(l.specResolvedSubtree([])||(0,Fe.Map)()).toJS(),specWithCurrentSubtrees:l.specJS()}));i.updateResolvedSubtree([],t.resultMap)}catch(e){console.error(e)}}))}),35),requestResolvedSubtree=e=>t=>{Ln.find((({path:r,system:n})=>n===t&&r.toString()===e.toString()))||(Ln.push({path:e,system:t}),Dn())};function changeParam(e,t,r,n,a){return{type:wn,payload:{path:e,value:n,paramName:t,paramIn:r,isXml:a}}}function changeParamByIdentity(e,t,r,n){return{type:wn,payload:{path:e,param:t,value:r,isXml:n}}}const updateResolvedSubtree=(e,t)=>({type:Pn,payload:{path:e,value:t}}),invalidateResolvedSubtreeCache=()=>({type:Pn,payload:{path:[],value:(0,Fe.Map)()}}),validateParams=(e,t)=>({type:xn,payload:{pathMethod:e,isOAS3:t}}),updateEmptyParamInclusion=(e,t,r,n)=>({type:Cn,payload:{pathMethod:e,paramName:t,paramIn:r,includeEmptyValue:n}});function clearValidateParams(e){return{type:Tn,payload:{pathMethod:e}}}function changeConsumesValue(e,t){return{type:Bn,payload:{path:e,value:t,key:\"consumes_value\"}}}function changeProducesValue(e,t){return{type:Bn,payload:{path:e,value:t,key:\"produces_value\"}}}const setResponse=(e,t,r)=>({payload:{path:e,method:t,res:r},type:On}),setRequest=(e,t,r)=>({payload:{path:e,method:t,req:r},type:kn}),setMutatedRequest=(e,t,r)=>({payload:{path:e,method:t,req:r},type:Nn}),logRequest=e=>({payload:e,type:An}),executeRequest=e=>({fn:t,specActions:r,specSelectors:n,getConfigs:a,oas3Selectors:o})=>{let{pathName:s,method:l,operation:i}=e,{requestInterceptor:c,responseInterceptor:u}=a(),d=i.toJS();if(i&&i.get(\"parameters\")&&i.get(\"parameters\").filter((e=>e&&!0===e.get(\"allowEmptyValue\"))).forEach((t=>{if(n.parameterInclusionSettingFor([s,l],t.get(\"name\"),t.get(\"in\"))){e.parameters=e.parameters||{};const r=paramToValue(t,e.parameters);(!r||r&&0===r.size)&&(e.parameters[t.get(\"name\")]=\"\")}})),e.contextUrl=(0,wt.default)(n.url()).toString(),d&&d.operationId?e.operationId=d.operationId:d&&s&&l&&(e.operationId=t.opId(d,s,l)),n.isOAS3()){const t=`${s}:${l}`;e.server=o.selectedServer(t)||o.selectedServer();const r=o.serverVariables({server:e.server,namespace:t}).toJS(),n=o.serverVariables({server:e.server}).toJS();e.serverVariables=Object.keys(r).length?r:n,e.requestContentType=o.requestContentType(s,l),e.responseContentType=o.responseContentType(s,l)||\"*/*\";const a=o.requestBodyValue(s,l),i=o.requestBodyInclusionSetting(s,l);a&&a.toJS?e.requestBody=a.map((e=>Fe.Map.isMap(e)?e.get(\"value\"):e)).filter(((e,t)=>(Array.isArray(e)?0!==e.length:!isEmptyValue(e))||i.get(t))).toJS():e.requestBody=a}let p=Object.assign({},e);p=t.buildRequest(p),r.setRequest(e.pathName,e.method,p);e.requestInterceptor=async t=>{let n=await c.apply(void 0,[t]),a=Object.assign({},n);return r.setMutatedRequest(e.pathName,e.method,a),n},e.responseInterceptor=u;const m=Date.now();return t.execute(e).then((t=>{t.duration=Date.now()-m,r.setResponse(e.pathName,e.method,t)})).catch((t=>{\"Failed to fetch\"===t.message&&(t.name=\"\",t.message='**Failed to fetch.**  \\n**Possible Reasons:** \\n  - CORS \\n  - Network Failure \\n  - URL scheme must be \"http\" or \"https\" for CORS request.'),r.setResponse(e.pathName,e.method,{error:!0,err:t})}))},actions_execute=({path:e,method:t,...r}={})=>n=>{let{fn:{fetch:a},specSelectors:o,specActions:s}=n,l=o.specJsonWithResolvedSubtrees().toJS(),i=o.operationScheme(e,t),{requestContentType:c,responseContentType:u}=o.contentTypeValues([e,t]).toJS(),d=/xml/i.test(c),p=o.parameterValues([e,t],d).toJS();return s.executeRequest({...r,fetch:a,spec:l,pathName:e,method:t,parameters:p,requestContentType:c,scheme:i,responseContentType:u})};function clearResponse(e,t){return{type:In,payload:{path:e,method:t}}}function clearRequest(e,t){return{type:Rn,payload:{path:e,method:t}}}function setScheme(e,t,r){return{type:Mn,payload:{scheme:e,path:t,method:r}}}var Un={[_n]:(e,t)=>\"string\"==typeof t.payload?e.set(\"spec\",t.payload):e,[vn]:(e,t)=>e.set(\"url\",t.payload+\"\"),[bn]:(e,t)=>e.set(\"json\",fromJSOrdered(t.payload)),[jn]:(e,t)=>e.setIn([\"resolved\"],fromJSOrdered(t.payload)),[Pn]:(e,t)=>{const{value:r,path:n}=t.payload;return e.setIn([\"resolvedSubtrees\",...n],fromJSOrdered(r))},[wn]:(e,{payload:t})=>{let{path:r,paramName:n,paramIn:a,param:o,value:s,isXml:l}=t,i=o?paramToIdentifier(o):`${a}.${n}`;const c=l?\"value_xml\":\"value\";return e.setIn([\"meta\",\"paths\",...r,\"parameters\",i,c],(0,Fe.fromJS)(s))},[Cn]:(e,{payload:t})=>{let{pathMethod:r,paramName:n,paramIn:a,includeEmptyValue:o}=t;if(!n||!a)return console.warn(\"Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey.\"),e;const s=`${a}.${n}`;return e.setIn([\"meta\",\"paths\",...r,\"parameter_inclusions\",s],o)},[xn]:(e,{payload:{pathMethod:t,isOAS3:r}})=>{const n=zr(e).getIn([\"paths\",...t]),a=parameterValues(e,t).toJS();return e.updateIn([\"meta\",\"paths\",...t,\"parameters\"],(0,Fe.fromJS)({}),(o=>n.get(\"parameters\",(0,Fe.List)()).reduce(((n,o)=>{const s=paramToValue(o,a),l=parameterInclusionSettingFor(e,t,o.get(\"name\"),o.get(\"in\")),i=((e,t,{isOAS3:r=!1,bypassRequiredCheck:n=!1}={})=>{let a=e.get(\"required\"),{schema:o,parameterContentMediaType:s}=getParameterSchema(e,{isOAS3:r});return validateValueBySchema(t,o,a,n,s)})(o,s,{bypassRequiredCheck:l,isOAS3:r});return n.setIn([paramToIdentifier(o),\"errors\"],(0,Fe.fromJS)(i))}),o)))},[Tn]:(e,{payload:{pathMethod:t}})=>e.updateIn([\"meta\",\"paths\",...t,\"parameters\"],(0,Fe.fromJS)([]),(e=>e.map((e=>e.set(\"errors\",(0,Fe.fromJS)([])))))),[On]:(e,{payload:{res:t,path:r,method:n}})=>{let a;a=t.error?Object.assign({error:!0,name:t.err.name,message:t.err.message,statusCode:t.err.statusCode},t.err.response):t,a.headers=a.headers||{};let o=e.setIn([\"responses\",r,n],fromJSOrdered(a));return ot.Blob&&a.data instanceof ot.Blob&&(o=o.setIn([\"responses\",r,n,\"text\"],a.data)),o},[kn]:(e,{payload:{req:t,path:r,method:n}})=>e.setIn([\"requests\",r,n],fromJSOrdered(t)),[Nn]:(e,{payload:{req:t,path:r,method:n}})=>e.setIn([\"mutatedRequests\",r,n],fromJSOrdered(t)),[Bn]:(e,{payload:{path:t,value:r,key:n}})=>{let a=[\"paths\",...t],o=[\"meta\",\"paths\",...t];return e.getIn([\"json\",...a])||e.getIn([\"resolved\",...a])||e.getIn([\"resolvedSubtrees\",...a])?e.setIn([...o,n],(0,Fe.fromJS)(r)):e},[In]:(e,{payload:{path:t,method:r}})=>e.deleteIn([\"responses\",t,r]),[Rn]:(e,{payload:{path:t,method:r}})=>e.deleteIn([\"requests\",t,r]),[Mn]:(e,{payload:{scheme:t,path:r,method:n}})=>r&&n?e.setIn([\"scheme\",r,n],t):r||n?void 0:e.setIn([\"scheme\",\"_defaultScheme\"],t)};const wrap_actions_updateSpec=(e,{specActions:t})=>(...r)=>{e(...r),t.parseToJson(...r)},wrap_actions_updateJsonSpec=(e,{specActions:t})=>(...r)=>{e(...r),t.invalidateResolvedSubtreeCache();const[n]=r,a=(0,Qt.default)(n,[\"paths\"])||{};Object.keys(a).forEach((e=>{(0,Qt.default)(a,[e]).$ref&&t.requestResolvedSubtree([\"paths\",e])})),t.requestResolvedSubtree([\"components\",\"securitySchemes\"])},wrap_actions_executeRequest=(e,{specActions:t})=>r=>(t.logRequest(r),e(r)),wrap_actions_validateParams=(e,{specSelectors:t})=>r=>e(r,t.isOAS3());var plugins_spec=()=>({statePlugins:{spec:{wrapActions:{...qe},reducers:{...Un},actions:{...Me},selectors:{...Pe}}}}),$n=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return D.default}}),Jn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return U.default}}),Vn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return $.default}}),Kn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return J.default}}),zn=function(e){var t={};return __webpack_require__.d(t,e),t}({makeResolve:function(){return V.makeResolve}}),Fn=function(e){var t={};return __webpack_require__.d(t,e),t}({buildRequest:function(){return K.buildRequest},execute:function(){return K.execute}}),Wn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return z.default},makeHttp:function(){return z.makeHttp},serializeRes:function(){return z.serializeRes}}),Hn=function(e){var t={};return __webpack_require__.d(t,e),t}({makeResolveSubtree:function(){return F.makeResolveSubtree}}),Gn=function(e){var t={};return __webpack_require__.d(t,e),t}({opId:function(){return W.opId}});const configs_wrap_actions_loaded=(e,t)=>(...r)=>{e(...r);const n=t.getConfigs().withCredentials;t.fn.fetch.withCredentials=n};function swagger_client({configs:e,getConfigs:t}){return{fn:{fetch:(0,Wn.makeHttp)(Wn.default,e.preFetch,e.postFetch),buildRequest:Fn.buildRequest,execute:Fn.execute,resolve:(0,zn.makeResolve)({strategies:[Kn.default,Vn.default,Jn.default,$n.default]}),resolveSubtree:async(e,r,n={})=>{const a=t(),o={modelPropertyMacro:a.modelPropertyMacro,parameterMacro:a.parameterMacro,requestInterceptor:a.requestInterceptor,responseInterceptor:a.responseInterceptor,strategies:[Kn.default,Vn.default,Jn.default,$n.default]};return(0,Hn.makeResolveSubtree)(o)(e,r,n)},serializeRes:Wn.serializeRes,opId:Gn.opId},statePlugins:{configs:{wrapActions:{loaded:configs_wrap_actions_loaded}}}}}function util(){return{fn:{shallowEqualKeys}}}var Xn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return H.default}}),Yn=function(e){var t={};return __webpack_require__.d(t,e),t}({Provider:function(){return G.Provider},connect:function(){return G.connect}}),Qn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return X.default}});const withSystem=e=>t=>{const{fn:r}=e();class WithSystem extends Ke.Component{render(){return Ke.default.createElement(t,(0,nr.default)({},e(),this.props,this.context))}}return WithSystem.displayName=`WithSystem(${r.getDisplayName(t)})`,WithSystem},withRoot=(e,t)=>r=>{const{fn:n}=e();class WithRoot extends Ke.Component{render(){return Ke.default.createElement(Yn.Provider,{store:t},Ke.default.createElement(r,(0,nr.default)({},this.props,this.context)))}}return WithRoot.displayName=`WithRoot(${n.getDisplayName(r)})`,WithRoot},withConnect=(e,t,r)=>(0,ze.compose)(r?withRoot(e,r):Qn.default,(0,Yn.connect)(((r,n)=>{const a={...n,...e()},o=t.prototype?.mapStateToProps||(e=>({state:e}));return o(r,a)})),withSystem(e))(t),handleProps=(e,t,r,n)=>{for(const a in t){const o=t[a];\"function\"==typeof o&&o(r[a],n[a],e())}},withMappedContainer=(e,t,r)=>(t,n)=>{const{fn:a}=e(),o=r(t,\"root\");class WithMappedContainer extends Ke.Component{constructor(t,r){super(t,r),handleProps(e,n,t,{})}UNSAFE_componentWillReceiveProps(t){handleProps(e,n,t,this.props)}render(){const e=(0,Dt.default)(this.props,n?Object.keys(n):[]);return Ke.default.createElement(o,e)}}return WithMappedContainer.displayName=`WithMappedContainer(${a.getDisplayName(o)})`,WithMappedContainer},render=(e,t,r,n)=>a=>{const o=r(e,t,n)(\"App\",\"root\"),{createRoot:s}=Xn.default;s(a).render(Ke.default.createElement(o,null))},getComponent=(e,t,r)=>(n,a,o={})=>{if(\"string\"!=typeof n)throw new TypeError(\"Need a string, to fetch a component. Was given a \"+typeof n);const s=r(n);return s?a?\"root\"===a?withConnect(e,s,t()):withConnect(e,s):s:(o.failSilently||e().log.warn(\"Could not find component:\",n),null)},getDisplayName=e=>e.displayName||e.name||\"Component\";var view=({getComponents:e,getStore:t,getSystem:r})=>{const n=(a=getComponent(r,t,e),vt(a,((...e)=>JSON.stringify(e))));var a;const o=(e=>utils_memoizeN(e,((...e)=>e)))(withMappedContainer(r,0,n));return{rootInjects:{getComponent:n,makeMappedContainer:o,render:render(r,t,getComponent,e)},fn:{getDisplayName}}};var view_legacy=({React:e,getSystem:t,getStore:r,getComponents:n})=>{const a={},o=parseInt(e?.version,10);return o>=16&&o<18&&(a.render=((e,t,r,n)=>a=>{const o=r(e,t,n)(\"App\",\"root\");Xn.default.render(Ke.default.createElement(o,null),a)})(t,r,getComponent,n)),{rootInjects:a}};function downloadUrlPlugin(e){let{fn:t}=e;const r={download:e=>({errActions:r,specSelectors:n,specActions:a,getConfigs:o})=>{let{fetch:s}=t;const l=o();function next(t){if(t instanceof Error||t.status>=400)return a.updateLoadingStatus(\"failed\"),r.newThrownErr(Object.assign(new Error((t.message||t.statusText)+\" \"+e),{source:\"fetch\"})),void(!t.status&&t instanceof Error&&function checkPossibleFailReasons(){try{let t;if(\"URL\"in ot?t=new URL(e):(t=document.createElement(\"a\"),t.href=e),\"https:\"!==t.protocol&&\"https:\"===ot.location.protocol){const e=Object.assign(new Error(`Possible mixed-content issue? The page was loaded over https:// but a ${t.protocol}// URL was specified. Check that you are not attempting to load mixed content.`),{source:\"fetch\"});return void r.newThrownErr(e)}if(t.origin!==ot.location.origin){const e=Object.assign(new Error(`Possible cross-origin (CORS) issue? The URL origin (${t.origin}) does not match the page (${ot.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`),{source:\"fetch\"});r.newThrownErr(e)}}catch(e){return}}());a.updateLoadingStatus(\"success\"),a.updateSpec(t.text),n.url()!==e&&a.updateUrl(e)}e=e||n.url(),a.updateLoadingStatus(\"loading\"),r.clear({source:\"fetch\"}),s({url:e,loadSpec:!0,requestInterceptor:l.requestInterceptor||(e=>e),responseInterceptor:l.responseInterceptor||(e=>e),credentials:\"same-origin\",headers:{Accept:\"application/json,*/*\"}}).then(next,next)},updateLoadingStatus:e=>{let t=[null,\"loading\",\"failed\",\"success\",\"failedConfig\"];return-1===t.indexOf(e)&&console.error(`Error: ${e} is not one of ${JSON.stringify(t)}`),{type:\"spec_update_loading_status\",payload:e}}};let n={loadingStatus:(0,Bt.createSelector)((e=>e||(0,Fe.Map)()),(e=>e.get(\"loadingStatus\")||null))};return{statePlugins:{spec:{actions:r,reducers:{spec_update_loading_status:(e,t)=>\"string\"==typeof t.payload?e.set(\"loadingStatus\",t.payload):e},selectors:n}}}}var Zn=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return Y.default}}),ea=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return Q.default}}),ta=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return Z.default}}),ra=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return ee.default}}),na=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return te.default}}),aa=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return re.default}}),oa=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return ne.default}}),sa=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return ae.default}});var after_load=()=>{Zn.default.registerLanguage(\"json\",ta.default),Zn.default.registerLanguage(\"js\",ea.default),Zn.default.registerLanguage(\"xml\",ra.default),Zn.default.registerLanguage(\"yaml\",aa.default),Zn.default.registerLanguage(\"http\",oa.default),Zn.default.registerLanguage(\"bash\",na.default),Zn.default.registerLanguage(\"powershell\",sa.default),Zn.default.registerLanguage(\"javascript\",ea.default)},la=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return oe.default}}),ia=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return se.default}}),ca=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return le.default}}),ua=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return ie.default}}),da=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return ce.default}}),pa=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return ue.default}}),ma=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return de.default}});const fa={agate:la.default,arta:ia.default,monokai:ca.default,nord:ua.default,obsidian:da.default,\"tomorrow-night\":pa.default,idea:ma.default},ha=la.default;var components_SyntaxHighlighter=({language:e,className:t=\"\",getConfigs:r,syntaxHighlighting:n={},children:a=\"\"})=>{const o=r().syntaxHighlight.theme,{styles:s,defaultStyle:l}=n,i=s?.[o]??l;return Ke.default.createElement(Zn.default,{language:e,className:t,style:i},a)},ga=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return pe.default}});var components_HighlightCode=({fileName:e=\"response.txt\",className:t,downloadable:r,getComponent:n,canCopy:a,language:o,children:s})=>{const l=(0,Ke.useRef)(null),i=n(\"SyntaxHighlighter\",!0),handlePreventYScrollingBeyondElement=e=>{const{target:t,deltaY:r}=e,{scrollHeight:n,offsetHeight:a,scrollTop:o}=t;n>a&&(0===o&&r<0||a+o>=n&&r>0)&&e.preventDefault()};return(0,Ke.useEffect)((()=>{const e=Array.from(l.current.childNodes).filter((e=>!!e.nodeType&&e.classList.contains(\"microlight\")));return e.forEach((e=>e.addEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement,{passive:!1}))),()=>{e.forEach((e=>e.removeEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement)))}}),[s,t,o]),Ke.default.createElement(\"div\",{className:\"highlight-code\",ref:l},a&&Ke.default.createElement(\"div\",{className:\"copy-to-clipboard\"},Ke.default.createElement(hr.CopyToClipboard,{text:s},Ke.default.createElement(\"button\",null))),r?Ke.default.createElement(\"button\",{className:\"download-contents\",onClick:()=>{(0,ga.default)(s,e)}},\"Download\"):null,Ke.default.createElement(i,{language:o,className:(0,fr.default)(t,\"microlight\"),renderPlainText:({children:e,PlainTextViewer:r})=>Ke.default.createElement(r,{className:t},e)},s))};var components_PlainTextViewer=({className:e=\"\",children:t})=>Ke.default.createElement(\"pre\",{className:(0,fr.default)(\"microlight\",e)},t);var wrap_components_SyntaxHighlighter=(e,t)=>({renderPlainText:r,children:n,...a})=>{const o=t.getConfigs().syntaxHighlight.activated,s=t.getComponent(\"PlainTextViewer\");return o||\"function\"!=typeof r?o?Ke.default.createElement(e,a,n):Ke.default.createElement(s,null,n):r({children:n,PlainTextViewer:s})};const SyntaxHighlightingPlugin1=()=>({afterLoad:after_load,rootInjects:{syntaxHighlighting:{styles:fa,defaultStyle:ha}},components:{SyntaxHighlighter:components_SyntaxHighlighter,HighlightCode:components_HighlightCode,PlainTextViewer:components_PlainTextViewer}}),SyntaxHighlightingPlugin2=()=>({wrapComponents:{SyntaxHighlighter:wrap_components_SyntaxHighlighter}});var syntax_highlighting=()=>[SyntaxHighlightingPlugin1,SyntaxHighlightingPlugin2];var versions_after_load=()=>{const{GIT_DIRTY:e,GIT_COMMIT:t,PACKAGE_VERSION:r,BUILD_TIME:n}={PACKAGE_VERSION:\"5.17.14\",GIT_COMMIT:\"g8aa52920\",GIT_DIRTY:!0,BUILD_TIME:\"Tue, 28 May 2024 05:23:41 GMT\"};ot.versions=ot.versions||{},ot.versions.swaggerUI={version:r,gitRevision:t,gitDirty:e,buildTimestamp:n}};var versions=()=>({afterLoad:versions_after_load}),ya=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return me.default}});const Ea=console.error,withErrorBoundary=e=>t=>{const{getComponent:r,fn:n}=e(),a=r(\"ErrorBoundary\"),o=n.getDisplayName(t);class WithErrorBoundary extends Ke.Component{render(){return Ke.default.createElement(a,{targetName:o,getComponent:r,fn:n},Ke.default.createElement(t,(0,nr.default)({},this.props,this.context)))}}var s;return WithErrorBoundary.displayName=`WithErrorBoundary(${o})`,(s=t).prototype&&s.prototype.isReactComponent&&(WithErrorBoundary.prototype.mapStateToProps=t.prototype.mapStateToProps),WithErrorBoundary};var fallback=({name:e})=>Ke.default.createElement(\"div\",{className:\"fallback\"},\"😱 \",Ke.default.createElement(\"i\",null,\"Could not render \",\"t\"===e?\"this component\":e,\", see the console.\"));class ErrorBoundary extends Ke.Component{static defaultProps={targetName:\"this component\",getComponent:()=>fallback,fn:{componentDidCatch:Ea},children:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}constructor(...e){super(...e),this.state={hasError:!1,error:null}}componentDidCatch(e,t){this.props.fn.componentDidCatch(e,t)}render(){const{getComponent:e,targetName:t,children:r}=this.props;if(this.state.hasError){const r=e(\"Fallback\");return Ke.default.createElement(r,{name:t})}return r}}var Sa=ErrorBoundary;var safe_render=({componentList:e=[],fullOverride:t=!1}={})=>({getSystem:r})=>{const n=t?e:[\"App\",\"BaseLayout\",\"VersionPragmaFilter\",\"InfoContainer\",\"ServersContainer\",\"SchemesContainer\",\"AuthorizeBtnContainer\",\"FilterContainer\",\"Operations\",\"OperationContainer\",\"parameters\",\"responses\",\"OperationServers\",\"Models\",\"ModelWrapper\",...e],a=(0,ya.default)(n,Array(n.length).fill(((e,{fn:t})=>t.withErrorBoundary(e))));return{fn:{componentDidCatch:Ea,withErrorBoundary:withErrorBoundary(r)},components:{ErrorBoundary:Sa,Fallback:fallback},wrapComponents:a}};class App extends Ke.default.Component{getLayout(){const{getComponent:e,layoutSelectors:t}=this.props,r=t.current(),n=e(r,!0);return n||(()=>Ke.default.createElement(\"h1\",null,' No layout defined for \"',r,'\" '))}render(){const e=this.getLayout();return Ke.default.createElement(e,null)}}var _a=App;class AuthorizationPopup extends Ke.default.Component{close=()=>{let{authActions:e}=this.props;e.showDefinitions(!1)};render(){let{authSelectors:e,authActions:t,getComponent:r,errSelectors:n,specSelectors:a,fn:{AST:o={}}}=this.props,s=e.shownDefinitions();const l=r(\"auths\"),i=r(\"CloseIcon\");return Ke.default.createElement(\"div\",{className:\"dialog-ux\"},Ke.default.createElement(\"div\",{className:\"backdrop-ux\"}),Ke.default.createElement(\"div\",{className:\"modal-ux\"},Ke.default.createElement(\"div\",{className:\"modal-dialog-ux\"},Ke.default.createElement(\"div\",{className:\"modal-ux-inner\"},Ke.default.createElement(\"div\",{className:\"modal-ux-header\"},Ke.default.createElement(\"h3\",null,\"Available authorizations\"),Ke.default.createElement(\"button\",{type:\"button\",className:\"close-modal\",onClick:this.close},Ke.default.createElement(i,null))),Ke.default.createElement(\"div\",{className:\"modal-ux-content\"},s.valueSeq().map(((s,i)=>Ke.default.createElement(l,{key:i,AST:o,definitions:s,getComponent:r,errSelectors:n,authSelectors:e,authActions:t,specSelectors:a}))))))))}}class AuthorizeBtn extends Ke.default.Component{render(){let{isAuthorized:e,showPopup:t,onClick:r,getComponent:n}=this.props;const a=n(\"authorizationPopup\",!0),o=n(\"LockAuthIcon\",!0),s=n(\"UnlockAuthIcon\",!0);return Ke.default.createElement(\"div\",{className:\"auth-wrapper\"},Ke.default.createElement(\"button\",{className:e?\"btn authorize locked\":\"btn authorize unlocked\",onClick:r},Ke.default.createElement(\"span\",null,\"Authorize\"),e?Ke.default.createElement(o,null):Ke.default.createElement(s,null)),t&&Ke.default.createElement(a,null))}}class AuthorizeBtnContainer extends Ke.default.Component{render(){const{authActions:e,authSelectors:t,specSelectors:r,getComponent:n}=this.props,a=r.securityDefinitions(),o=t.definitionsToAuthorize(),s=n(\"authorizeBtn\");return a?Ke.default.createElement(s,{onClick:()=>e.showDefinitions(o),isAuthorized:!!t.authorized().size,showPopup:!!t.shownDefinitions(),getComponent:n}):null}}class AuthorizeOperationBtn extends Ke.default.Component{onClick=e=>{e.stopPropagation();let{onClick:t}=this.props;t&&t()};render(){let{isAuthorized:e,getComponent:t}=this.props;const r=t(\"LockAuthOperationIcon\",!0),n=t(\"UnlockAuthOperationIcon\",!0);return Ke.default.createElement(\"button\",{className:\"authorization__btn\",\"aria-label\":e?\"authorization button locked\":\"authorization button unlocked\",onClick:this.onClick},e?Ke.default.createElement(r,{className:\"locked\"}):Ke.default.createElement(n,{className:\"unlocked\"}))}}class Auths extends Ke.default.Component{constructor(e,t){super(e,t),this.state={}}onAuthChange=e=>{let{name:t}=e;this.setState({[t]:e})};submitAuth=e=>{e.preventDefault();let{authActions:t}=this.props;t.authorizeWithPersistOption(this.state)};logoutClick=e=>{e.preventDefault();let{authActions:t,definitions:r}=this.props,n=r.map(((e,t)=>t)).toArray();this.setState(n.reduce(((e,t)=>(e[t]=\"\",e)),{})),t.logoutWithPersistOption(n)};close=e=>{e.preventDefault();let{authActions:t}=this.props;t.showDefinitions(!1)};render(){let{definitions:e,getComponent:t,authSelectors:r,errSelectors:n}=this.props;const a=t(\"AuthItem\"),o=t(\"oauth2\",!0),s=t(\"Button\");let l=r.authorized(),i=e.filter(((e,t)=>!!l.get(t))),c=e.filter((e=>\"oauth2\"!==e.get(\"type\"))),u=e.filter((e=>\"oauth2\"===e.get(\"type\")));return Ke.default.createElement(\"div\",{className:\"auth-container\"},!!c.size&&Ke.default.createElement(\"form\",{onSubmit:this.submitAuth},c.map(((e,r)=>Ke.default.createElement(a,{key:r,schema:e,name:r,getComponent:t,onAuthChange:this.onAuthChange,authorized:l,errSelectors:n}))).toArray(),Ke.default.createElement(\"div\",{className:\"auth-btn-wrapper\"},c.size===i.size?Ke.default.createElement(s,{className:\"btn modal-btn auth\",onClick:this.logoutClick,\"aria-label\":\"Remove authorization\"},\"Logout\"):Ke.default.createElement(s,{type:\"submit\",className:\"btn modal-btn auth authorize\",\"aria-label\":\"Apply credentials\"},\"Authorize\"),Ke.default.createElement(s,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\"))),u&&u.size?Ke.default.createElement(\"div\",null,Ke.default.createElement(\"div\",{className:\"scope-def\"},Ke.default.createElement(\"p\",null,\"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\"),Ke.default.createElement(\"p\",null,\"API requires the following scopes. Select which ones you want to grant to Swagger UI.\")),e.filter((e=>\"oauth2\"===e.get(\"type\"))).map(((e,t)=>Ke.default.createElement(\"div\",{key:t},Ke.default.createElement(o,{authorized:l,schema:e,name:t})))).toArray()):null)}}class auth_item_Auths extends Ke.default.Component{render(){let{schema:e,name:t,getComponent:r,onAuthChange:n,authorized:a,errSelectors:o}=this.props;const s=r(\"apiKeyAuth\"),l=r(\"basicAuth\");let i;const c=e.get(\"type\");switch(c){case\"apiKey\":i=Ke.default.createElement(s,{key:t,schema:e,name:t,errSelectors:o,authorized:a,getComponent:r,onChange:n});break;case\"basic\":i=Ke.default.createElement(l,{key:t,schema:e,name:t,errSelectors:o,authorized:a,getComponent:r,onChange:n});break;default:i=Ke.default.createElement(\"div\",{key:t},\"Unknown security definition type \",c)}return Ke.default.createElement(\"div\",{key:`${t}-jump`},i)}}class AuthError extends Ke.default.Component{render(){let{error:e}=this.props,t=e.get(\"level\"),r=e.get(\"message\"),n=e.get(\"source\");return Ke.default.createElement(\"div\",{className:\"errors\"},Ke.default.createElement(\"b\",null,n,\" \",t),Ke.default.createElement(\"span\",null,r))}}class ApiKeyAuth extends Ke.default.Component{constructor(e,t){super(e,t);let{name:r,schema:n}=this.props,a=this.getValue();this.state={name:r,schema:n,value:a}}getValue(){let{name:e,authorized:t}=this.props;return t&&t.getIn([e,\"value\"])}onChange=e=>{let{onChange:t}=this.props,r=e.target.value,n=Object.assign({},this.state,{value:r});this.setState(n),t(n)};render(){let{schema:e,getComponent:t,errSelectors:r,name:n}=this.props;const a=t(\"Input\"),o=t(\"Row\"),s=t(\"Col\"),l=t(\"authError\"),i=t(\"Markdown\",!0),c=t(\"JumpToPath\",!0);let u=this.getValue(),d=r.allErrors().filter((e=>e.get(\"authId\")===n));return Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h4\",null,Ke.default.createElement(\"code\",null,n||e.get(\"name\")),\" (apiKey)\",Ke.default.createElement(c,{path:[\"securityDefinitions\",n]})),u&&Ke.default.createElement(\"h6\",null,\"Authorized\"),Ke.default.createElement(o,null,Ke.default.createElement(i,{source:e.get(\"description\")})),Ke.default.createElement(o,null,Ke.default.createElement(\"p\",null,\"Name: \",Ke.default.createElement(\"code\",null,e.get(\"name\")))),Ke.default.createElement(o,null,Ke.default.createElement(\"p\",null,\"In: \",Ke.default.createElement(\"code\",null,e.get(\"in\")))),Ke.default.createElement(o,null,Ke.default.createElement(\"label\",{htmlFor:\"api_key_value\"},\"Value:\"),u?Ke.default.createElement(\"code\",null,\" ****** \"):Ke.default.createElement(s,null,Ke.default.createElement(a,{id:\"api_key_value\",type:\"text\",onChange:this.onChange,autoFocus:!0}))),d.valueSeq().map(((e,t)=>Ke.default.createElement(l,{error:e,key:t}))))}}class BasicAuth extends Ke.default.Component{constructor(e,t){super(e,t);let{schema:r,name:n}=this.props,a=this.getValue().username;this.state={name:n,schema:r,value:a?{username:a}:{}}}getValue(){let{authorized:e,name:t}=this.props;return e&&e.getIn([t,\"value\"])||{}}onChange=e=>{let{onChange:t}=this.props,{value:r,name:n}=e.target,a=this.state.value;a[n]=r,this.setState({value:a}),t(this.state)};render(){let{schema:e,getComponent:t,name:r,errSelectors:n}=this.props;const a=t(\"Input\"),o=t(\"Row\"),s=t(\"Col\"),l=t(\"authError\"),i=t(\"JumpToPath\",!0),c=t(\"Markdown\",!0);let u=this.getValue().username,d=n.allErrors().filter((e=>e.get(\"authId\")===r));return Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h4\",null,\"Basic authorization\",Ke.default.createElement(i,{path:[\"securityDefinitions\",r]})),u&&Ke.default.createElement(\"h6\",null,\"Authorized\"),Ke.default.createElement(o,null,Ke.default.createElement(c,{source:e.get(\"description\")})),Ke.default.createElement(o,null,Ke.default.createElement(\"label\",{htmlFor:\"auth_username\"},\"Username:\"),u?Ke.default.createElement(\"code\",null,\" \",u,\" \"):Ke.default.createElement(s,null,Ke.default.createElement(a,{id:\"auth_username\",type:\"text\",required:\"required\",name:\"username\",onChange:this.onChange,autoFocus:!0}))),Ke.default.createElement(o,null,Ke.default.createElement(\"label\",{htmlFor:\"auth_password\"},\"Password:\"),u?Ke.default.createElement(\"code\",null,\" ****** \"):Ke.default.createElement(s,null,Ke.default.createElement(a,{id:\"auth_password\",autoComplete:\"new-password\",name:\"password\",type:\"password\",onChange:this.onChange}))),d.valueSeq().map(((e,t)=>Ke.default.createElement(l,{error:e,key:t}))))}}function Example(e){const{example:t,showValue:r,getComponent:n}=e,a=n(\"Markdown\",!0),o=n(\"HighlightCode\",!0);return t?Ke.default.createElement(\"div\",{className:\"example\"},t.get(\"description\")?Ke.default.createElement(\"section\",{className:\"example__section\"},Ke.default.createElement(\"div\",{className:\"example__section-header\"},\"Example Description\"),Ke.default.createElement(\"p\",null,Ke.default.createElement(a,{source:t.get(\"description\")}))):null,r&&t.has(\"value\")?Ke.default.createElement(\"section\",{className:\"example__section\"},Ke.default.createElement(\"div\",{className:\"example__section-header\"},\"Example Value\"),Ke.default.createElement(o,null,stringify(t.get(\"value\")))):null):null}class ExamplesSelect extends Ke.default.PureComponent{static defaultProps={examples:Fe.default.Map({}),onSelect:(...e)=>console.log(\"DEBUG: ExamplesSelect was not given an onSelect callback\",...e),currentExampleKey:null,showLabels:!0};_onSelect=(e,{isSyntheticChange:t=!1}={})=>{\"function\"==typeof this.props.onSelect&&this.props.onSelect(e,{isSyntheticChange:t})};_onDomSelect=e=>{if(\"function\"==typeof this.props.onSelect){const t=e.target.selectedOptions[0].getAttribute(\"value\");this._onSelect(t,{isSyntheticChange:!1})}};getCurrentExample=()=>{const{examples:e,currentExampleKey:t}=this.props,r=e.get(t),n=e.keySeq().first(),a=e.get(n);return r||a||Map({})};componentDidMount(){const{onSelect:e,examples:t}=this.props;if(\"function\"==typeof e){const e=t.first(),r=t.keyOf(e);this._onSelect(r,{isSyntheticChange:!0})}}UNSAFE_componentWillReceiveProps(e){const{currentExampleKey:t,examples:r}=e;if(r!==this.props.examples&&!r.has(t)){const e=r.first(),t=r.keyOf(e);this._onSelect(t,{isSyntheticChange:!0})}}render(){const{examples:e,currentExampleKey:t,isValueModified:r,isModifiedValueAvailable:n,showLabels:a}=this.props;return Ke.default.createElement(\"div\",{className:\"examples-select\"},a?Ke.default.createElement(\"span\",{className:\"examples-select__section-label\"},\"Examples: \"):null,Ke.default.createElement(\"select\",{className:\"examples-select-element\",onChange:this._onDomSelect,value:n&&r?\"__MODIFIED__VALUE__\":t||\"\"},n?Ke.default.createElement(\"option\",{value:\"__MODIFIED__VALUE__\"},\"[Modified value]\"):null,e.map(((e,t)=>Ke.default.createElement(\"option\",{key:t,value:t},e.get(\"summary\")||t))).valueSeq()))}}const stringifyUnlessList=e=>Fe.List.isList(e)?e:stringify(e);class ExamplesSelectValueRetainer extends Ke.default.PureComponent{static defaultProps={userHasEditedBody:!1,examples:(0,Fe.Map)({}),currentNamespace:\"__DEFAULT__NAMESPACE__\",setRetainRequestBodyValueFlag:()=>{},onSelect:(...e)=>console.log(\"ExamplesSelectValueRetainer: no `onSelect` function was provided\",...e),updateValue:(...e)=>console.log(\"ExamplesSelectValueRetainer: no `updateValue` function was provided\",...e)};constructor(e){super(e);const t=this._getCurrentExampleValue();this.state={[e.currentNamespace]:(0,Fe.Map)({lastUserEditedValue:this.props.currentUserInputValue,lastDownstreamValue:t,isModifiedValueSelected:this.props.userHasEditedBody||this.props.currentUserInputValue!==t})}}componentWillUnmount(){this.props.setRetainRequestBodyValueFlag(!1)}_getStateForCurrentNamespace=()=>{const{currentNamespace:e}=this.props;return(this.state[e]||(0,Fe.Map)()).toObject()};_setStateForCurrentNamespace=e=>{const{currentNamespace:t}=this.props;return this._setStateForNamespace(t,e)};_setStateForNamespace=(e,t)=>{const r=(this.state[e]||(0,Fe.Map)()).mergeDeep(t);return this.setState({[e]:r})};_isCurrentUserInputSameAsExampleValue=()=>{const{currentUserInputValue:e}=this.props;return this._getCurrentExampleValue()===e};_getValueForExample=(e,t)=>{const{examples:r}=t||this.props;return stringifyUnlessList((r||(0,Fe.Map)({})).getIn([e,\"value\"]))};_getCurrentExampleValue=e=>{const{currentKey:t}=e||this.props;return this._getValueForExample(t,e||this.props)};_onExamplesSelect=(e,{isSyntheticChange:t}={},...r)=>{const{onSelect:n,updateValue:a,currentUserInputValue:o,userHasEditedBody:s}=this.props,{lastUserEditedValue:l}=this._getStateForCurrentNamespace(),i=this._getValueForExample(e);if(\"__MODIFIED__VALUE__\"===e)return a(stringifyUnlessList(l)),this._setStateForCurrentNamespace({isModifiedValueSelected:!0});\"function\"==typeof n&&n(e,{isSyntheticChange:t},...r),this._setStateForCurrentNamespace({lastDownstreamValue:i,isModifiedValueSelected:t&&s||!!o&&o!==i}),t||\"function\"==typeof a&&a(stringifyUnlessList(i))};UNSAFE_componentWillReceiveProps(e){const{currentUserInputValue:t,examples:r,onSelect:n,userHasEditedBody:a}=e,{lastUserEditedValue:o,lastDownstreamValue:s}=this._getStateForCurrentNamespace(),l=this._getValueForExample(e.currentKey,e),i=r.filter((e=>e.get(\"value\")===t||stringify(e.get(\"value\"))===t));if(i.size){let t;t=i.has(e.currentKey)?e.currentKey:i.keySeq().first(),n(t,{isSyntheticChange:!0})}else t!==this.props.currentUserInputValue&&t!==o&&t!==s&&(this.props.setRetainRequestBodyValueFlag(!0),this._setStateForNamespace(e.currentNamespace,{lastUserEditedValue:e.currentUserInputValue,isModifiedValueSelected:a||t!==l}))}render(){const{currentUserInputValue:e,examples:t,currentKey:r,getComponent:n,userHasEditedBody:a}=this.props,{lastDownstreamValue:o,lastUserEditedValue:s,isModifiedValueSelected:l}=this._getStateForCurrentNamespace(),i=n(\"ExamplesSelect\");return Ke.default.createElement(i,{examples:t,currentExampleKey:r,onSelect:this._onExamplesSelect,isModifiedValueAvailable:!!s&&s!==o,isValueModified:void 0!==e&&l&&e!==this._getCurrentExampleValue()||a})}}function oauth2_authorize_authorize({auth:e,authActions:t,errActions:r,configs:n,authConfigs:a={},currentServer:o}){let{schema:s,scopes:l,name:i,clientId:c}=e,u=s.get(\"flow\"),d=[];switch(u){case\"password\":return void t.authorizePassword(e);case\"application\":case\"clientCredentials\":case\"client_credentials\":return void t.authorizeApplication(e);case\"accessCode\":case\"authorizationCode\":case\"authorization_code\":d.push(\"response_type=code\");break;case\"implicit\":d.push(\"response_type=token\")}\"string\"==typeof c&&d.push(\"client_id=\"+encodeURIComponent(c));let p=n.oauth2RedirectUrl;if(void 0===p)return void r.newAuthErr({authId:i,source:\"validation\",level:\"error\",message:\"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed.\"});d.push(\"redirect_uri=\"+encodeURIComponent(p));let m=[];if(Array.isArray(l)?m=l:Fe.default.List.isList(l)&&(m=l.toArray()),m.length>0){let e=a.scopeSeparator||\" \";d.push(\"scope=\"+encodeURIComponent(m.join(e)))}let f=btoa(new Date);if(d.push(\"state=\"+encodeURIComponent(f)),void 0!==a.realm&&d.push(\"realm=\"+encodeURIComponent(a.realm)),(\"authorizationCode\"===u||\"authorization_code\"===u||\"accessCode\"===u)&&a.usePkceWithAuthorizationCodeGrant){const t=function generateCodeVerifier(){return b64toB64UrlEncoded(ht()(32).toString(\"base64\"))}(),r=function createCodeChallenge(e){return b64toB64UrlEncoded(yt()(\"sha256\").update(e).digest(\"base64\"))}(t);d.push(\"code_challenge=\"+r),d.push(\"code_challenge_method=S256\"),e.codeVerifier=t}let{additionalQueryStringParams:h}=a;for(let e in h)void 0!==h[e]&&d.push([e,h[e]].map(encodeURIComponent).join(\"=\"));const g=s.get(\"authorizationUrl\");let y;y=o?(0,wt.default)(sanitizeUrl(g),o,!0).toString():sanitizeUrl(g);let S,_=[y,d.join(\"&\")].join(-1===g.indexOf(\"?\")?\"?\":\"&\");S=\"implicit\"===u?t.preAuthorizeImplicit:a.useBasicAuthenticationWithAccessCodeGrant?t.authorizeAccessCodeWithBasicAuthentication:t.authorizeAccessCodeWithFormParams,t.authPopup(_,{auth:e,state:f,redirectUrl:p,callback:S,errCb:r.newAuthErr})}class Oauth2 extends Ke.default.Component{constructor(e,t){super(e,t);let{name:r,schema:n,authorized:a,authSelectors:o}=this.props,s=a&&a.get(r),l=o.getConfigs()||{},i=s&&s.get(\"username\")||\"\",c=s&&s.get(\"clientId\")||l.clientId||\"\",u=s&&s.get(\"clientSecret\")||l.clientSecret||\"\",d=s&&s.get(\"passwordType\")||\"basic\",p=s&&s.get(\"scopes\")||l.scopes||[];\"string\"==typeof p&&(p=p.split(l.scopeSeparator||\" \")),this.state={appName:l.appName,name:r,schema:n,scopes:p,clientId:c,clientSecret:u,username:i,password:\"\",passwordType:d}}close=e=>{e.preventDefault();let{authActions:t}=this.props;t.showDefinitions(!1)};authorize=()=>{let{authActions:e,errActions:t,getConfigs:r,authSelectors:n,oas3Selectors:a}=this.props,o=r(),s=n.getConfigs();t.clear({authId:name,type:\"auth\",source:\"auth\"}),oauth2_authorize_authorize({auth:this.state,currentServer:a.serverEffectiveValue(a.selectedServer()),authActions:e,errActions:t,configs:o,authConfigs:s})};onScopeChange=e=>{let{target:t}=e,{checked:r}=t,n=t.dataset.value;if(r&&-1===this.state.scopes.indexOf(n)){let e=this.state.scopes.concat([n]);this.setState({scopes:e})}else!r&&this.state.scopes.indexOf(n)>-1&&this.setState({scopes:this.state.scopes.filter((e=>e!==n))})};onInputChange=e=>{let{target:{dataset:{name:t},value:r}}=e,n={[t]:r};this.setState(n)};selectScopes=e=>{e.target.dataset.all?this.setState({scopes:Array.from((this.props.schema.get(\"allowedScopes\")||this.props.schema.get(\"scopes\")).keys())}):this.setState({scopes:[]})};logout=e=>{e.preventDefault();let{authActions:t,errActions:r,name:n}=this.props;r.clear({authId:n,type:\"auth\",source:\"auth\"}),t.logoutWithPersistOption([n])};render(){let{schema:e,getComponent:t,authSelectors:r,errSelectors:n,name:a,specSelectors:o}=this.props;const s=t(\"Input\"),l=t(\"Row\"),i=t(\"Col\"),c=t(\"Button\"),u=t(\"authError\"),d=t(\"JumpToPath\",!0),p=t(\"Markdown\",!0),m=t(\"InitializedInput\"),{isOAS3:f}=o;let h=f()?e.get(\"openIdConnectUrl\"):null;const g=\"implicit\",y=\"password\",S=f()?h?\"authorization_code\":\"authorizationCode\":\"accessCode\",_=f()?h?\"client_credentials\":\"clientCredentials\":\"application\";let v=!!(r.getConfigs()||{}).usePkceWithAuthorizationCodeGrant,b=e.get(\"flow\"),w=b===S&&v?b+\" with PKCE\":b,C=e.get(\"allowedScopes\")||e.get(\"scopes\"),x=!!r.authorized().get(a),O=n.allErrors().filter((e=>e.get(\"authId\")===a)),k=!O.filter((e=>\"validation\"===e.get(\"source\"))).size,N=e.get(\"description\");return Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h4\",null,a,\" (OAuth2, \",w,\") \",Ke.default.createElement(d,{path:[\"securityDefinitions\",a]})),this.state.appName?Ke.default.createElement(\"h5\",null,\"Application: \",this.state.appName,\" \"):null,N&&Ke.default.createElement(p,{source:e.get(\"description\")}),x&&Ke.default.createElement(\"h6\",null,\"Authorized\"),h&&Ke.default.createElement(\"p\",null,\"OpenID Connect URL: \",Ke.default.createElement(\"code\",null,h)),(b===g||b===S)&&Ke.default.createElement(\"p\",null,\"Authorization URL: \",Ke.default.createElement(\"code\",null,e.get(\"authorizationUrl\"))),(b===y||b===S||b===_)&&Ke.default.createElement(\"p\",null,\"Token URL:\",Ke.default.createElement(\"code\",null,\" \",e.get(\"tokenUrl\"))),Ke.default.createElement(\"p\",{className:\"flow\"},\"Flow: \",Ke.default.createElement(\"code\",null,w)),b!==y?null:Ke.default.createElement(l,null,Ke.default.createElement(l,null,Ke.default.createElement(\"label\",{htmlFor:\"oauth_username\"},\"username:\"),x?Ke.default.createElement(\"code\",null,\" \",this.state.username,\" \"):Ke.default.createElement(i,{tablet:10,desktop:10},Ke.default.createElement(\"input\",{id:\"oauth_username\",type:\"text\",\"data-name\":\"username\",onChange:this.onInputChange,autoFocus:!0}))),Ke.default.createElement(l,null,Ke.default.createElement(\"label\",{htmlFor:\"oauth_password\"},\"password:\"),x?Ke.default.createElement(\"code\",null,\" ****** \"):Ke.default.createElement(i,{tablet:10,desktop:10},Ke.default.createElement(\"input\",{id:\"oauth_password\",type:\"password\",\"data-name\":\"password\",onChange:this.onInputChange}))),Ke.default.createElement(l,null,Ke.default.createElement(\"label\",{htmlFor:\"password_type\"},\"Client credentials location:\"),x?Ke.default.createElement(\"code\",null,\" \",this.state.passwordType,\" \"):Ke.default.createElement(i,{tablet:10,desktop:10},Ke.default.createElement(\"select\",{id:\"password_type\",\"data-name\":\"passwordType\",onChange:this.onInputChange},Ke.default.createElement(\"option\",{value:\"basic\"},\"Authorization header\"),Ke.default.createElement(\"option\",{value:\"request-body\"},\"Request body\"))))),(b===_||b===g||b===S||b===y)&&(!x||x&&this.state.clientId)&&Ke.default.createElement(l,null,Ke.default.createElement(\"label\",{htmlFor:`client_id_${b}`},\"client_id:\"),x?Ke.default.createElement(\"code\",null,\" ****** \"):Ke.default.createElement(i,{tablet:10,desktop:10},Ke.default.createElement(m,{id:`client_id_${b}`,type:\"text\",required:b===y,initialValue:this.state.clientId,\"data-name\":\"clientId\",onChange:this.onInputChange}))),(b===_||b===S||b===y)&&Ke.default.createElement(l,null,Ke.default.createElement(\"label\",{htmlFor:`client_secret_${b}`},\"client_secret:\"),x?Ke.default.createElement(\"code\",null,\" ****** \"):Ke.default.createElement(i,{tablet:10,desktop:10},Ke.default.createElement(m,{id:`client_secret_${b}`,initialValue:this.state.clientSecret,type:\"password\",\"data-name\":\"clientSecret\",onChange:this.onInputChange}))),!x&&C&&C.size?Ke.default.createElement(\"div\",{className:\"scopes\"},Ke.default.createElement(\"h2\",null,\"Scopes:\",Ke.default.createElement(\"a\",{onClick:this.selectScopes,\"data-all\":!0},\"select all\"),Ke.default.createElement(\"a\",{onClick:this.selectScopes},\"select none\")),C.map(((e,t)=>Ke.default.createElement(l,{key:t},Ke.default.createElement(\"div\",{className:\"checkbox\"},Ke.default.createElement(s,{\"data-value\":t,id:`${t}-${b}-checkbox-${this.state.name}`,disabled:x,checked:this.state.scopes.includes(t),type:\"checkbox\",onChange:this.onScopeChange}),Ke.default.createElement(\"label\",{htmlFor:`${t}-${b}-checkbox-${this.state.name}`},Ke.default.createElement(\"span\",{className:\"item\"}),Ke.default.createElement(\"div\",{className:\"text\"},Ke.default.createElement(\"p\",{className:\"name\"},t),Ke.default.createElement(\"p\",{className:\"description\"},e))))))).toArray()):null,O.valueSeq().map(((e,t)=>Ke.default.createElement(u,{error:e,key:t}))),Ke.default.createElement(\"div\",{className:\"auth-btn-wrapper\"},k&&(x?Ke.default.createElement(c,{className:\"btn modal-btn auth authorize\",onClick:this.logout,\"aria-label\":\"Remove authorization\"},\"Logout\"):Ke.default.createElement(c,{className:\"btn modal-btn auth authorize\",onClick:this.authorize,\"aria-label\":\"Apply given OAuth2 credentials\"},\"Authorize\")),Ke.default.createElement(c,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\")))}}class Clear extends Ke.Component{onClick=()=>{let{specActions:e,path:t,method:r}=this.props;e.clearResponse(t,r),e.clearRequest(t,r)};render(){return Ke.default.createElement(\"button\",{className:\"btn btn-clear opblock-control__btn\",onClick:this.onClick},\"Clear\")}}const Headers=({headers:e})=>Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h5\",null,\"Response headers\"),Ke.default.createElement(\"pre\",{className:\"microlight\"},e)),Duration=({duration:e})=>Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h5\",null,\"Request duration\"),Ke.default.createElement(\"pre\",{className:\"microlight\"},e,\" ms\"));class LiveResponse extends Ke.default.Component{shouldComponentUpdate(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}render(){const{response:e,getComponent:t,getConfigs:r,displayRequestDuration:n,specSelectors:a,path:o,method:s}=this.props,{showMutatedRequest:l,requestSnippetsEnabled:i}=r(),c=l?a.mutatedRequestFor(o,s):a.requestFor(o,s),u=e.get(\"status\"),d=c.get(\"url\"),p=e.get(\"headers\").toJS(),m=e.get(\"notDocumented\"),f=e.get(\"error\"),h=e.get(\"text\"),g=e.get(\"duration\"),y=Object.keys(p),S=p[\"content-type\"]||p[\"Content-Type\"],_=t(\"responseBody\"),v=y.map((e=>{var t=Array.isArray(p[e])?p[e].join():p[e];return Ke.default.createElement(\"span\",{className:\"headerline\",key:e},\" \",e,\": \",t,\" \")})),b=0!==v.length,w=t(\"Markdown\",!0),C=t(\"RequestSnippets\",!0),x=t(\"curl\",!0);return Ke.default.createElement(\"div\",null,c&&i?Ke.default.createElement(C,{request:c}):Ke.default.createElement(x,{request:c}),d&&Ke.default.createElement(\"div\",null,Ke.default.createElement(\"div\",{className:\"request-url\"},Ke.default.createElement(\"h4\",null,\"Request URL\"),Ke.default.createElement(\"pre\",{className:\"microlight\"},d))),Ke.default.createElement(\"h4\",null,\"Server response\"),Ke.default.createElement(\"table\",{className:\"responses-table live-responses-table\"},Ke.default.createElement(\"thead\",null,Ke.default.createElement(\"tr\",{className:\"responses-header\"},Ke.default.createElement(\"td\",{className:\"col_header response-col_status\"},\"Code\"),Ke.default.createElement(\"td\",{className:\"col_header response-col_description\"},\"Details\"))),Ke.default.createElement(\"tbody\",null,Ke.default.createElement(\"tr\",{className:\"response\"},Ke.default.createElement(\"td\",{className:\"response-col_status\"},u,m?Ke.default.createElement(\"div\",{className:\"response-undocumented\"},Ke.default.createElement(\"i\",null,\" Undocumented \")):null),Ke.default.createElement(\"td\",{className:\"response-col_description\"},f?Ke.default.createElement(w,{source:`${\"\"!==e.get(\"name\")?`${e.get(\"name\")}: `:\"\"}${e.get(\"message\")}`}):null,h?Ke.default.createElement(_,{content:h,contentType:S,url:d,headers:p,getConfigs:r,getComponent:t}):null,b?Ke.default.createElement(Headers,{headers:v}):null,n&&g?Ke.default.createElement(Duration,{duration:g}):null)))))}}class OnlineValidatorBadge extends Ke.default.Component{constructor(e,t){super(e,t);let{getConfigs:r}=e,{validatorUrl:n}=r();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===n?\"https://validator.swagger.io/validator\":n}}getDefinitionUrl=()=>{let{specSelectors:e}=this.props;return new wt.default(e.url(),ot.location).toString()};UNSAFE_componentWillReceiveProps(e){let{getConfigs:t}=e,{validatorUrl:r}=t();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===r?\"https://validator.swagger.io/validator\":r})}render(){let{getConfigs:e}=this.props,{spec:t}=e(),r=sanitizeUrl(this.state.validatorUrl);return\"object\"==typeof t&&Object.keys(t).length?null:this.state.url&&requiresValidationURL(this.state.validatorUrl)&&requiresValidationURL(this.state.url)?Ke.default.createElement(\"span\",{className:\"float-right\"},Ke.default.createElement(\"a\",{target:\"_blank\",rel:\"noopener noreferrer\",href:`${r}/debug?url=${encodeURIComponent(this.state.url)}`},Ke.default.createElement(ValidatorImage,{src:`${r}?url=${encodeURIComponent(this.state.url)}`,alt:\"Online validator badge\"}))):null}}class ValidatorImage extends Ke.default.Component{constructor(e){super(e),this.state={loaded:!1,error:!1}}componentDidMount(){const e=new Image;e.onload=()=>{this.setState({loaded:!0})},e.onerror=()=>{this.setState({error:!0})},e.src=this.props.src}UNSAFE_componentWillReceiveProps(e){if(e.src!==this.props.src){const t=new Image;t.onload=()=>{this.setState({loaded:!0})},t.onerror=()=>{this.setState({error:!0})},t.src=e.src}}render(){return this.state.error?Ke.default.createElement(\"img\",{alt:\"Error\"}):this.state.loaded?Ke.default.createElement(\"img\",{src:this.props.src,alt:this.props.alt}):null}}class Operations extends Ke.default.Component{render(){let{specSelectors:e}=this.props;const t=e.taggedOperations();return 0===t.size?Ke.default.createElement(\"h3\",null,\" No operations defined in spec!\"):Ke.default.createElement(\"div\",null,t.map(this.renderOperationTag).toArray(),t.size<1?Ke.default.createElement(\"h3\",null,\" No operations defined in spec! \"):null)}renderOperationTag=(e,t)=>{const{specSelectors:r,getComponent:n,oas3Selectors:a,layoutSelectors:o,layoutActions:s,getConfigs:l}=this.props,i=r.validOperationMethods(),c=n(\"OperationContainer\",!0),u=n(\"OperationTag\"),d=e.get(\"operations\");return Ke.default.createElement(u,{key:\"operation-\"+t,tagObj:e,tag:t,oas3Selectors:a,layoutSelectors:o,layoutActions:s,getConfigs:l,getComponent:n,specUrl:r.url()},Ke.default.createElement(\"div\",{className:\"operation-tag-content\"},d.map((e=>{const r=e.get(\"path\"),n=e.get(\"method\"),a=Fe.default.List([\"paths\",r,n]);return-1===i.indexOf(n)?null:Ke.default.createElement(c,{key:`${r}-${n}`,specPath:a,op:e,path:r,method:n,tag:t})})).toArray()))}}function isAbsoluteUrl(e){return e.match(/^(?:[a-z]+:)?\\/\\//i)}function buildBaseUrl(e,t){return e?isAbsoluteUrl(e)?function addProtocol(e){return e.match(/^\\/\\//i)?`${window.location.protocol}${e}`:e}(e):new URL(e,t).href:t}function safeBuildUrl(e,t,{selectedServer:r=\"\"}={}){try{return function buildUrl(e,t,{selectedServer:r=\"\"}={}){if(!e)return;if(isAbsoluteUrl(e))return e;const n=buildBaseUrl(r,t);return isAbsoluteUrl(n)?new URL(e,n).href:new URL(e,window.location.href).href}(e,t,{selectedServer:r})}catch{return}}class OperationTag extends Ke.default.Component{static defaultProps={tagObj:Fe.default.fromJS({}),tag:\"\"};render(){const{tagObj:e,tag:t,children:r,oas3Selectors:n,layoutSelectors:a,layoutActions:o,getConfigs:s,getComponent:l,specUrl:i}=this.props;let{docExpansion:c,deepLinking:u}=s();const d=l(\"Collapse\"),p=l(\"Markdown\",!0),m=l(\"DeepLink\"),f=l(\"Link\"),h=l(\"ArrowUpIcon\"),g=l(\"ArrowDownIcon\");let y,S=e.getIn([\"tagDetails\",\"description\"],null),_=e.getIn([\"tagDetails\",\"externalDocs\",\"description\"]),v=e.getIn([\"tagDetails\",\"externalDocs\",\"url\"]);y=isFunc(n)&&isFunc(n.selectedServer)?safeBuildUrl(v,i,{selectedServer:n.selectedServer()}):v;let b=[\"operations-tag\",t],w=a.isShown(b,\"full\"===c||\"list\"===c);return Ke.default.createElement(\"div\",{className:w?\"opblock-tag-section is-open\":\"opblock-tag-section\"},Ke.default.createElement(\"h3\",{onClick:()=>o.show(b,!w),className:S?\"opblock-tag\":\"opblock-tag no-desc\",id:b.map((e=>escapeDeepLinkPath(e))).join(\"-\"),\"data-tag\":t,\"data-is-open\":w},Ke.default.createElement(m,{enabled:u,isShown:w,path:createDeepLinkPath(t),text:t}),S?Ke.default.createElement(\"small\",null,Ke.default.createElement(p,{source:S})):Ke.default.createElement(\"small\",null),y?Ke.default.createElement(\"div\",{className:\"info__externaldocs\"},Ke.default.createElement(\"small\",null,Ke.default.createElement(f,{href:sanitizeUrl(y),onClick:e=>e.stopPropagation(),target:\"_blank\"},_||y))):null,Ke.default.createElement(\"button\",{\"aria-expanded\":w,className:\"expand-operation\",title:w?\"Collapse operation\":\"Expand operation\",onClick:()=>o.show(b,!w)},w?Ke.default.createElement(h,{className:\"arrow\"}):Ke.default.createElement(g,{className:\"arrow\"}))),Ke.default.createElement(d,{isOpened:w},r))}}class Operation extends Ke.PureComponent{static defaultProps={operation:null,response:null,request:null,specPath:(0,Fe.List)(),summary:\"\"};render(){let{specPath:e,response:t,request:r,toggleShown:n,onTryoutClick:a,onResetClick:o,onCancelClick:s,onExecute:l,fn:i,getComponent:c,getConfigs:u,specActions:d,specSelectors:p,authActions:m,authSelectors:f,oas3Actions:h,oas3Selectors:g}=this.props,y=this.props.operation,{deprecated:S,isShown:_,path:v,method:b,op:w,tag:C,operationId:x,allowTryItOut:O,displayRequestDuration:k,tryItOutEnabled:N,executeInProgress:A}=y.toJS(),{description:I,externalDocs:R,schemes:T}=w;const B=R?safeBuildUrl(R.url,p.url(),{selectedServer:g.selectedServer()}):\"\";let j=y.getIn([\"op\"]),P=j.get(\"responses\"),M=function getList(e,t){if(!Fe.default.Iterable.isIterable(e))return Fe.default.List();let r=e.getIn(Array.isArray(t)?t:[t]);return Fe.default.List.isList(r)?r:Fe.default.List()}(j,[\"parameters\"]),q=p.operationScheme(v,b),L=[\"operations\",C,x],D=getExtensions(j);const U=c(\"responses\"),$=c(\"parameters\"),J=c(\"execute\"),V=c(\"clear\"),K=c(\"Collapse\"),z=c(\"Markdown\",!0),F=c(\"schemes\"),W=c(\"OperationServers\"),H=c(\"OperationExt\"),G=c(\"OperationSummary\"),X=c(\"Link\"),{showExtensions:Y}=u();if(P&&t&&t.size>0){let e=!P.get(String(t.get(\"status\")))&&!P.get(\"default\");t=t.set(\"notDocumented\",e)}let Q=[v,b];const Z=p.validationErrors([v,b]);return Ke.default.createElement(\"div\",{className:S?\"opblock opblock-deprecated\":_?`opblock opblock-${b} is-open`:`opblock opblock-${b}`,id:escapeDeepLinkPath(L.join(\"-\"))},Ke.default.createElement(G,{operationProps:y,isShown:_,toggleShown:n,getComponent:c,authActions:m,authSelectors:f,specPath:e}),Ke.default.createElement(K,{isOpened:_},Ke.default.createElement(\"div\",{className:\"opblock-body\"},j&&j.size||null===j?null:Ke.default.createElement(rolling_load,{height:\"32px\",width:\"32px\",className:\"opblock-loading-animation\"}),S&&Ke.default.createElement(\"h4\",{className:\"opblock-title_normal\"},\" Warning: Deprecated\"),I&&Ke.default.createElement(\"div\",{className:\"opblock-description-wrapper\"},Ke.default.createElement(\"div\",{className:\"opblock-description\"},Ke.default.createElement(z,{source:I}))),B?Ke.default.createElement(\"div\",{className:\"opblock-external-docs-wrapper\"},Ke.default.createElement(\"h4\",{className:\"opblock-title_normal\"},\"Find more details\"),Ke.default.createElement(\"div\",{className:\"opblock-external-docs\"},R.description&&Ke.default.createElement(\"span\",{className:\"opblock-external-docs__description\"},Ke.default.createElement(z,{source:R.description})),Ke.default.createElement(X,{target:\"_blank\",className:\"opblock-external-docs__link\",href:sanitizeUrl(B)},B))):null,j&&j.size?Ke.default.createElement($,{parameters:M,specPath:e.push(\"parameters\"),operation:j,onChangeKey:Q,onTryoutClick:a,onResetClick:o,onCancelClick:s,tryItOutEnabled:N,allowTryItOut:O,fn:i,getComponent:c,specActions:d,specSelectors:p,pathMethod:[v,b],getConfigs:u,oas3Actions:h,oas3Selectors:g}):null,N?Ke.default.createElement(W,{getComponent:c,path:v,method:b,operationServers:j.get(\"servers\"),pathServers:p.paths().getIn([v,\"servers\"]),getSelectedServer:g.selectedServer,setSelectedServer:h.setSelectedServer,setServerVariableValue:h.setServerVariableValue,getServerVariable:g.serverVariableValue,getEffectiveServerValue:g.serverEffectiveValue}):null,N&&O&&T&&T.size?Ke.default.createElement(\"div\",{className:\"opblock-schemes\"},Ke.default.createElement(F,{schemes:T,path:v,method:b,specActions:d,currentScheme:q})):null,!N||!O||Z.length<=0?null:Ke.default.createElement(\"div\",{className:\"validation-errors errors-wrapper\"},\"Please correct the following validation errors and try again.\",Ke.default.createElement(\"ul\",null,Z.map(((e,t)=>Ke.default.createElement(\"li\",{key:t},\" \",e,\" \"))))),Ke.default.createElement(\"div\",{className:N&&t&&O?\"btn-group\":\"execute-wrapper\"},N&&O?Ke.default.createElement(J,{operation:j,specActions:d,specSelectors:p,oas3Selectors:g,oas3Actions:h,path:v,method:b,onExecute:l,disabled:A}):null,N&&t&&O?Ke.default.createElement(V,{specActions:d,path:v,method:b}):null),A?Ke.default.createElement(\"div\",{className:\"loading-container\"},Ke.default.createElement(\"div\",{className:\"loading\"})):null,P?Ke.default.createElement(U,{responses:P,request:r,tryItOutResponse:t,getComponent:c,getConfigs:u,specSelectors:p,oas3Actions:h,oas3Selectors:g,specActions:d,produces:p.producesOptionsFor([v,b]),producesValue:p.currentProducesFor([v,b]),specPath:e.push(\"responses\"),path:v,method:b,displayRequestDuration:k,fn:i}):null,Y&&D.size?Ke.default.createElement(H,{extensions:D,getComponent:c}):null)))}}class OperationContainer extends Ke.PureComponent{constructor(e,t){super(e,t);const{tryItOutEnabled:r}=e.getConfigs();this.state={tryItOutEnabled:r,executeInProgress:!1}}static defaultProps={showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1};mapStateToProps(e,t){const{op:r,layoutSelectors:n,getConfigs:a}=t,{docExpansion:o,deepLinking:s,displayOperationId:l,displayRequestDuration:i,supportedSubmitMethods:c}=a(),u=n.showSummary(),d=r.getIn([\"operation\",\"__originalOperationId\"])||r.getIn([\"operation\",\"operationId\"])||(0,Gn.opId)(r.get(\"operation\"),t.path,t.method)||r.get(\"id\"),p=[\"operations\",t.tag,d],m=c.indexOf(t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),f=r.getIn([\"operation\",\"security\"])||t.specSelectors.security();return{operationId:d,isDeepLinkingEnabled:s,showSummary:u,displayOperationId:l,displayRequestDuration:i,allowTryItOut:m,security:f,isAuthorized:t.authSelectors.isAuthorized(f),isShown:n.isShown(p,\"full\"===o),jumpToKey:`paths.${t.path}.${t.method}`,response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}componentDidMount(){const{isShown:e}=this.props,t=this.getResolvedSubtree();e&&void 0===t&&this.requestResolvedSubtree()}UNSAFE_componentWillReceiveProps(e){const{response:t,isShown:r}=e,n=this.getResolvedSubtree();t!==this.props.response&&this.setState({executeInProgress:!1}),r&&void 0===n&&this.requestResolvedSubtree()}toggleShown=()=>{let{layoutActions:e,tag:t,operationId:r,isShown:n}=this.props;const a=this.getResolvedSubtree();n||void 0!==a||this.requestResolvedSubtree(),e.show([\"operations\",t,r],!n)};onCancelClick=()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})};onTryoutClick=()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})};onResetClick=e=>{const t=this.props.oas3Selectors.selectDefaultRequestBodyValue(...e);this.props.oas3Actions.setRequestBodyValue({value:t,pathMethod:e})};onExecute=()=>{this.setState({executeInProgress:!0})};getResolvedSubtree=()=>{const{specSelectors:e,path:t,method:r,specPath:n}=this.props;return n?e.specResolvedSubtree(n.toJS()):e.specResolvedSubtree([\"paths\",t,r])};requestResolvedSubtree=()=>{const{specActions:e,path:t,method:r,specPath:n}=this.props;return n?e.requestResolvedSubtree(n.toJS()):e.requestResolvedSubtree([\"paths\",t,r])};render(){let{op:e,tag:t,path:r,method:n,security:a,isAuthorized:o,operationId:s,showSummary:l,isShown:i,jumpToKey:c,allowTryItOut:u,response:d,request:p,displayOperationId:m,displayRequestDuration:f,isDeepLinkingEnabled:h,specPath:g,specSelectors:y,specActions:S,getComponent:_,getConfigs:v,layoutSelectors:b,layoutActions:w,authActions:C,authSelectors:x,oas3Actions:O,oas3Selectors:k,fn:N}=this.props;const A=_(\"operation\"),I=this.getResolvedSubtree()||(0,Fe.Map)(),R=(0,Fe.fromJS)({op:I,tag:t,path:r,summary:e.getIn([\"operation\",\"summary\"])||\"\",deprecated:I.get(\"deprecated\")||e.getIn([\"operation\",\"deprecated\"])||!1,method:n,security:a,isAuthorized:o,operationId:s,originalOperationId:I.getIn([\"operation\",\"__originalOperationId\"]),showSummary:l,isShown:i,jumpToKey:c,allowTryItOut:u,request:p,displayOperationId:m,displayRequestDuration:f,isDeepLinkingEnabled:h,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return Ke.default.createElement(A,{operation:R,response:d,request:p,isShown:i,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onResetClick:this.onResetClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:g,specActions:S,specSelectors:y,oas3Actions:O,oas3Selectors:k,layoutActions:w,layoutSelectors:b,authActions:C,authSelectors:x,getComponent:_,getConfigs:v,fn:N})}}var va=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return fe.default}});class OperationSummary extends Ke.PureComponent{static defaultProps={operationProps:null,specPath:(0,Fe.List)(),summary:\"\"};render(){let{isShown:e,toggleShown:t,getComponent:r,authActions:n,authSelectors:a,operationProps:o,specPath:s}=this.props,{summary:l,isAuthorized:i,method:c,op:u,showSummary:d,path:p,operationId:m,originalOperationId:f,displayOperationId:h}=o.toJS(),{summary:g}=u,y=o.get(\"security\");const S=r(\"authorizeOperationBtn\",!0),_=r(\"OperationSummaryMethod\"),v=r(\"OperationSummaryPath\"),b=r(\"JumpToPath\",!0),w=r(\"CopyToClipboardBtn\",!0),C=r(\"ArrowUpIcon\"),x=r(\"ArrowDownIcon\"),O=y&&!!y.count(),k=O&&1===y.size&&y.first().isEmpty(),N=!O||k;return Ke.default.createElement(\"div\",{className:`opblock-summary opblock-summary-${c}`},Ke.default.createElement(\"button\",{\"aria-expanded\":e,className:\"opblock-summary-control\",onClick:t},Ke.default.createElement(_,{method:c}),Ke.default.createElement(\"div\",{className:\"opblock-summary-path-description-wrapper\"},Ke.default.createElement(v,{getComponent:r,operationProps:o,specPath:s}),d?Ke.default.createElement(\"div\",{className:\"opblock-summary-description\"},(0,va.default)(g||l)):null),h&&(f||m)?Ke.default.createElement(\"span\",{className:\"opblock-summary-operation-id\"},f||m):null),Ke.default.createElement(w,{textToCopy:`${s.get(1)}`}),N?null:Ke.default.createElement(S,{isAuthorized:i,onClick:()=>{const e=a.definitionsForRequirements(y);n.showDefinitions(e)}}),Ke.default.createElement(b,{path:s}),Ke.default.createElement(\"button\",{\"aria-label\":`${c} ${p.replace(/\\//g,\"​/\")}`,className:\"opblock-control-arrow\",\"aria-expanded\":e,tabIndex:\"-1\",onClick:t},e?Ke.default.createElement(C,{className:\"arrow\"}):Ke.default.createElement(x,{className:\"arrow\"})))}}class OperationSummaryMethod extends Ke.PureComponent{static defaultProps={operationProps:null};render(){let{method:e}=this.props;return Ke.default.createElement(\"span\",{className:\"opblock-summary-method\"},e.toUpperCase())}}class OperationSummaryPath extends Ke.PureComponent{render(){let{getComponent:e,operationProps:t}=this.props,{deprecated:r,isShown:n,path:a,tag:o,operationId:s,isDeepLinkingEnabled:l}=t.toJS();const i=a.split(/(?=\\/)/g);for(let e=1;e<i.length;e+=2)i.splice(e,0,Ke.default.createElement(\"wbr\",{key:e}));const c=e(\"DeepLink\");return Ke.default.createElement(\"span\",{className:r?\"opblock-summary-path__deprecated\":\"opblock-summary-path\",\"data-path\":a},Ke.default.createElement(c,{enabled:l,isShown:n,path:createDeepLinkPath(`${o}/${s}`),text:i}))}}var operation_extensions=({extensions:e,getComponent:t})=>{let r=t(\"OperationExtRow\");return Ke.default.createElement(\"div\",{className:\"opblock-section\"},Ke.default.createElement(\"div\",{className:\"opblock-section-header\"},Ke.default.createElement(\"h4\",null,\"Extensions\")),Ke.default.createElement(\"div\",{className:\"table-container\"},Ke.default.createElement(\"table\",null,Ke.default.createElement(\"thead\",null,Ke.default.createElement(\"tr\",null,Ke.default.createElement(\"td\",{className:\"col_header\"},\"Field\"),Ke.default.createElement(\"td\",{className:\"col_header\"},\"Value\"))),Ke.default.createElement(\"tbody\",null,e.entrySeq().map((([e,t])=>Ke.default.createElement(r,{key:`${e}-${t}`,xKey:e,xVal:t})))))))};var operation_extension_row=({xKey:e,xVal:t})=>{const r=t?t.toJS?t.toJS():t:null;return Ke.default.createElement(\"tr\",null,Ke.default.createElement(\"td\",null,e),Ke.default.createElement(\"td\",null,JSON.stringify(r)))};function createHtmlReadyId(e,t=\"_\"){return e.replace(/[^\\w-]/g,t)}class Responses extends Ke.default.Component{static defaultProps={tryItOutResponse:null,produces:(0,Fe.fromJS)([\"application/json\"]),displayRequestDuration:!1};onChangeProducesWrapper=e=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],e);onResponseContentTypeChange=({controlsAcceptHeader:e,value:t})=>{const{oas3Actions:r,path:n,method:a}=this.props;e&&r.setResponseContentType({value:t,path:n,method:a})};render(){let{responses:e,tryItOutResponse:t,getComponent:r,getConfigs:n,specSelectors:a,fn:o,producesValue:s,displayRequestDuration:l,specPath:i,path:c,method:u,oas3Selectors:d,oas3Actions:p}=this.props,m=function defaultStatusCode(e){let t=e.keySeq();return t.contains(_t)?_t:t.filter((e=>\"2\"===(e+\"\")[0])).sort().first()}(e);const f=r(\"contentType\"),h=r(\"liveResponse\"),g=r(\"response\");let y=this.props.produces&&this.props.produces.size?this.props.produces:Responses.defaultProps.produces;const S=a.isOAS3()?function getAcceptControllingResponse(e){if(!Fe.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;const t=e.find(((e,t)=>t.startsWith(\"2\")&&Object.keys(e.get(\"content\")||{}).length>0)),r=e.get(\"default\")||Fe.default.OrderedMap(),n=(r.get(\"content\")||Fe.default.OrderedMap()).keySeq().toJS().length?r:null;return t||n}(e):null,_=createHtmlReadyId(`${u}${c}_responses`),v=`${_}_select`;return Ke.default.createElement(\"div\",{className:\"responses-wrapper\"},Ke.default.createElement(\"div\",{className:\"opblock-section-header\"},Ke.default.createElement(\"h4\",null,\"Responses\"),a.isOAS3()?null:Ke.default.createElement(\"label\",{htmlFor:v},Ke.default.createElement(\"span\",null,\"Response content type\"),Ke.default.createElement(f,{value:s,ariaControls:_,ariaLabel:\"Response content type\",className:\"execute-content-type\",contentTypes:y,controlId:v,onChange:this.onChangeProducesWrapper}))),Ke.default.createElement(\"div\",{className:\"responses-inner\"},t?Ke.default.createElement(\"div\",null,Ke.default.createElement(h,{response:t,getComponent:r,getConfigs:n,specSelectors:a,path:this.props.path,method:this.props.method,displayRequestDuration:l}),Ke.default.createElement(\"h4\",null,\"Responses\")):null,Ke.default.createElement(\"table\",{\"aria-live\":\"polite\",className:\"responses-table\",id:_,role:\"region\"},Ke.default.createElement(\"thead\",null,Ke.default.createElement(\"tr\",{className:\"responses-header\"},Ke.default.createElement(\"td\",{className:\"col_header response-col_status\"},\"Code\"),Ke.default.createElement(\"td\",{className:\"col_header response-col_description\"},\"Description\"),a.isOAS3()?Ke.default.createElement(\"td\",{className:\"col col_header response-col_links\"},\"Links\"):null)),Ke.default.createElement(\"tbody\",null,e.entrySeq().map((([e,l])=>{let f=t&&t.get(\"status\")==e?\"response_current\":\"\";return Ke.default.createElement(g,{key:e,path:c,method:u,specPath:i.push(e),isDefault:m===e,fn:o,className:f,code:e,response:l,specSelectors:a,controlsAcceptHeader:l===S,onContentTypeChange:this.onResponseContentTypeChange,contentType:s,getConfigs:n,activeExamplesKey:d.activeExamplesMember(c,u,\"responses\",e),oas3Actions:p,getComponent:r})})).toArray()))))}}function getKnownSyntaxHighlighterLanguage(e){return function canJsonParse(e){try{return!!JSON.parse(e)}catch(e){return null}}(e)?\"json\":null}class Response extends Ke.default.Component{constructor(e,t){super(e,t),this.state={responseContentType:\"\"}}static defaultProps={response:(0,Fe.fromJS)({}),onContentTypeChange:()=>{}};_onContentTypeChange=e=>{const{onContentTypeChange:t,controlsAcceptHeader:r}=this.props;this.setState({responseContentType:e}),t({value:e,controlsAcceptHeader:r})};getTargetExamplesKey=()=>{const{response:e,contentType:t,activeExamplesKey:r}=this.props,n=this.state.responseContentType||t,a=e.getIn([\"content\",n],(0,Fe.Map)({})).get(\"examples\",null).keySeq().first();return r||a};render(){let{path:e,method:t,code:r,response:n,className:a,specPath:o,fn:s,getComponent:l,getConfigs:i,specSelectors:c,contentType:u,controlsAcceptHeader:d,oas3Actions:p}=this.props,{inferSchema:m,getSampleSchema:f}=s,h=c.isOAS3();const{showExtensions:g}=i();let y=g?getExtensions(n):null,S=n.get(\"headers\"),_=n.get(\"links\");const v=l(\"ResponseExtension\"),b=l(\"headers\"),w=l(\"HighlightCode\",!0),C=l(\"modelExample\"),x=l(\"Markdown\",!0),O=l(\"operationLink\"),k=l(\"contentType\"),N=l(\"ExamplesSelect\"),A=l(\"Example\");var I,R;const T=this.state.responseContentType||u,B=n.getIn([\"content\",T],(0,Fe.Map)({})),j=B.get(\"examples\",null);if(h){const e=B.get(\"schema\");I=e?m(e.toJS()):null,R=e?(0,Fe.List)([\"content\",this.state.responseContentType,\"schema\"]):o}else I=n.get(\"schema\"),R=n.has(\"schema\")?o.push(\"schema\"):o;let P,M,q=!1,L={includeReadOnly:!0};if(h)if(M=B.get(\"schema\")?.toJS(),Fe.Map.isMap(j)&&!j.isEmpty()){const e=this.getTargetExamplesKey(),getMediaTypeExample=e=>e.get(\"value\");P=getMediaTypeExample(j.get(e,(0,Fe.Map)({}))),void 0===P&&(P=getMediaTypeExample(j.values().next().value)),q=!0}else void 0!==B.get(\"example\")&&(P=B.get(\"example\"),q=!0);else{M=I,L={...L,includeWriteOnly:!0};const e=n.getIn([\"examples\",T]);e&&(P=e,q=!0)}const D=((e,t)=>{if(null==e)return null;const r=getKnownSyntaxHighlighterLanguage(e)?\"json\":null;return Ke.default.createElement(\"div\",null,Ke.default.createElement(t,{className:\"example\",language:r},stringify(e)))})(f(M,T,L,q?P:void 0),w);return Ke.default.createElement(\"tr\",{className:\"response \"+(a||\"\"),\"data-code\":r},Ke.default.createElement(\"td\",{className:\"response-col_status\"},r),Ke.default.createElement(\"td\",{className:\"response-col_description\"},Ke.default.createElement(\"div\",{className:\"response-col_description__inner\"},Ke.default.createElement(x,{source:n.get(\"description\")})),g&&y.size?y.entrySeq().map((([e,t])=>Ke.default.createElement(v,{key:`${e}-${t}`,xKey:e,xVal:t}))):null,h&&n.get(\"content\")?Ke.default.createElement(\"section\",{className:\"response-controls\"},Ke.default.createElement(\"div\",{className:(0,fr.default)(\"response-control-media-type\",{\"response-control-media-type--accept-controller\":d})},Ke.default.createElement(\"small\",{className:\"response-control-media-type__title\"},\"Media type\"),Ke.default.createElement(k,{value:this.state.responseContentType,contentTypes:n.get(\"content\")?n.get(\"content\").keySeq():(0,Fe.Seq)(),onChange:this._onContentTypeChange,ariaLabel:\"Media Type\"}),d?Ke.default.createElement(\"small\",{className:\"response-control-media-type__accept-message\"},\"Controls \",Ke.default.createElement(\"code\",null,\"Accept\"),\" header.\"):null),Fe.Map.isMap(j)&&!j.isEmpty()?Ke.default.createElement(\"div\",{className:\"response-control-examples\"},Ke.default.createElement(\"small\",{className:\"response-control-examples__title\"},\"Examples\"),Ke.default.createElement(N,{examples:j,currentExampleKey:this.getTargetExamplesKey(),onSelect:n=>p.setActiveExamplesMember({name:n,pathMethod:[e,t],contextType:\"responses\",contextName:r}),showLabels:!1})):null):null,D||I?Ke.default.createElement(C,{specPath:R,getComponent:l,getConfigs:i,specSelectors:c,schema:fromJSOrdered(I),example:D,includeReadOnly:!0}):null,h&&j?Ke.default.createElement(A,{example:j.get(this.getTargetExamplesKey(),(0,Fe.Map)({})),getComponent:l,getConfigs:i,omitValue:!0}):null,S?Ke.default.createElement(b,{headers:S,getComponent:l}):null),h?Ke.default.createElement(\"td\",{className:\"response-col_links\"},_?_.toSeq().entrySeq().map((([e,t])=>Ke.default.createElement(O,{key:e,name:e,link:t,getComponent:l}))):Ke.default.createElement(\"i\",null,\"No links\")):null)}}var response_extension=({xKey:e,xVal:t})=>Ke.default.createElement(\"div\",{className:\"response__extension\"},e,\": \",String(t)),ba=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return he.default}}),wa=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return ge.default}});class ResponseBody extends Ke.default.PureComponent{state={parsedContent:null};updateParsedContent=e=>{const{content:t}=this.props;if(e!==t)if(t&&t instanceof Blob){var r=new FileReader;r.onload=()=>{this.setState({parsedContent:r.result})},r.readAsText(t)}else this.setState({parsedContent:t.toString()})};componentDidMount(){this.updateParsedContent(null)}componentDidUpdate(e){this.updateParsedContent(e.content)}render(){let{content:e,contentType:t,url:r,headers:n={},getComponent:a}=this.props;const{parsedContent:o}=this.state,s=a(\"HighlightCode\",!0),l=\"response_\"+(new Date).getTime();let i,c;if(r=r||\"\",(/^application\\/octet-stream/i.test(t)||n[\"Content-Disposition\"]&&/attachment/i.test(n[\"Content-Disposition\"])||n[\"content-disposition\"]&&/attachment/i.test(n[\"content-disposition\"])||n[\"Content-Description\"]&&/File Transfer/i.test(n[\"Content-Description\"])||n[\"content-description\"]&&/File Transfer/i.test(n[\"content-description\"]))&&(e.size>0||e.length>0))if(\"Blob\"in window){let a=t||\"text/html\",o=e instanceof Blob?e:new Blob([e],{type:a}),s=window.URL.createObjectURL(o),l=[a,r.substr(r.lastIndexOf(\"/\")+1),s].join(\":\"),i=n[\"content-disposition\"]||n[\"Content-Disposition\"];if(void 0!==i){let e=function extractFileNameFromContentDispositionHeader(e){let t;if([/filename\\*=[^']+'\\w*'\"([^\"]+)\";?/i,/filename\\*=[^']+'\\w*'([^;]+);?/i,/filename=\"([^;]*);?\"/i,/filename=([^;]*);?/i].some((r=>(t=r.exec(e),null!==t))),null!==t&&t.length>1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null}(i);null!==e&&(l=e)}c=ot.navigator&&ot.navigator.msSaveOrOpenBlob?Ke.default.createElement(\"div\",null,Ke.default.createElement(\"a\",{href:s,onClick:()=>ot.navigator.msSaveOrOpenBlob(o,l)},\"Download file\")):Ke.default.createElement(\"div\",null,Ke.default.createElement(\"a\",{href:s,download:l},\"Download file\"))}else c=Ke.default.createElement(\"pre\",{className:\"microlight\"},\"Download headers detected but your browser does not support downloading binary via XHR (Blob).\");else if(/json/i.test(t)){let t=null;getKnownSyntaxHighlighterLanguage(e)&&(t=\"json\");try{i=JSON.stringify(JSON.parse(e),null,\"  \")}catch(t){i=\"can't parse JSON.  Raw result:\\n\\n\"+e}c=Ke.default.createElement(s,{language:t,downloadable:!0,fileName:`${l}.json`,canCopy:!0},i)}else/xml/i.test(t)?(i=(0,ba.default)(e,{textNodesOnSameLine:!0,indentor:\"  \"}),c=Ke.default.createElement(s,{downloadable:!0,fileName:`${l}.xml`,canCopy:!0},i)):c=\"text/html\"===(0,wa.default)(t)||/text\\/plain/.test(t)?Ke.default.createElement(s,{downloadable:!0,fileName:`${l}.html`,canCopy:!0},e):\"text/csv\"===(0,wa.default)(t)||/text\\/csv/.test(t)?Ke.default.createElement(s,{downloadable:!0,fileName:`${l}.csv`,canCopy:!0},e):/^image\\//i.test(t)?t.includes(\"svg\")?Ke.default.createElement(\"div\",null,\" \",e,\" \"):Ke.default.createElement(\"img\",{src:window.URL.createObjectURL(e)}):/^audio\\//i.test(t)?Ke.default.createElement(\"pre\",{className:\"microlight\"},Ke.default.createElement(\"audio\",{controls:!0,key:r},Ke.default.createElement(\"source\",{src:r,type:t}))):\"string\"==typeof e?Ke.default.createElement(s,{downloadable:!0,fileName:`${l}.txt`,canCopy:!0},e):e.size>0?o?Ke.default.createElement(\"div\",null,Ke.default.createElement(\"p\",{className:\"i\"},\"Unrecognized response type; displaying content as text.\"),Ke.default.createElement(s,{downloadable:!0,fileName:`${l}.txt`,canCopy:!0},o)):Ke.default.createElement(\"p\",{className:\"i\"},\"Unrecognized response type; unable to display.\"):null;return c?Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h5\",null,\"Response body\"),c):null}}class Parameters extends Ke.Component{constructor(e){super(e),this.state={callbackVisible:!1,parametersVisible:!0}}static defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]};onChange=(e,t,r)=>{let{specActions:{changeParamByIdentity:n},onChangeKey:a}=this.props;n(a,e,t,r)};onChangeConsumesWrapper=e=>{let{specActions:{changeConsumesValue:t},onChangeKey:r}=this.props;t(r,e)};toggleTab=e=>\"parameters\"===e?this.setState({parametersVisible:!0,callbackVisible:!1}):\"callbacks\"===e?this.setState({callbackVisible:!0,parametersVisible:!1}):void 0;onChangeMediaType=({value:e,pathMethod:t})=>{let{specActions:r,oas3Selectors:n,oas3Actions:a}=this.props;const o=n.hasUserEditedBody(...t),s=n.shouldRetainRequestBodyValue(...t);a.setRequestContentType({value:e,pathMethod:t}),a.initRequestBodyValidateError({pathMethod:t}),o||(s||a.setRequestBodyValue({value:void 0,pathMethod:t}),r.clearResponse(...t),r.clearRequest(...t),r.clearValidateParams(t))};render(){let{onTryoutClick:e,onResetClick:t,parameters:r,allowTryItOut:n,tryItOutEnabled:a,specPath:o,fn:s,getComponent:l,getConfigs:i,specSelectors:c,specActions:u,pathMethod:d,oas3Actions:p,oas3Selectors:m,operation:f}=this.props;const h=l(\"parameterRow\"),g=l(\"TryItOutButton\"),y=l(\"contentType\"),S=l(\"Callbacks\",!0),_=l(\"RequestBody\",!0),v=a&&n,b=c.isOAS3(),w=`${createHtmlReadyId(`${d[1]}${d[0]}_requests`)}_select`,C=f.get(\"requestBody\"),x=Object.values(r.reduce(((e,t)=>{const r=t.get(\"in\");return e[r]??=[],e[r].push(t),e}),{})).reduce(((e,t)=>e.concat(t)),[]);return Ke.default.createElement(\"div\",{className:\"opblock-section\"},Ke.default.createElement(\"div\",{className:\"opblock-section-header\"},b?Ke.default.createElement(\"div\",{className:\"tab-header\"},Ke.default.createElement(\"div\",{onClick:()=>this.toggleTab(\"parameters\"),className:`tab-item ${this.state.parametersVisible&&\"active\"}`},Ke.default.createElement(\"h4\",{className:\"opblock-title\"},Ke.default.createElement(\"span\",null,\"Parameters\"))),f.get(\"callbacks\")?Ke.default.createElement(\"div\",{onClick:()=>this.toggleTab(\"callbacks\"),className:`tab-item ${this.state.callbackVisible&&\"active\"}`},Ke.default.createElement(\"h4\",{className:\"opblock-title\"},Ke.default.createElement(\"span\",null,\"Callbacks\"))):null):Ke.default.createElement(\"div\",{className:\"tab-header\"},Ke.default.createElement(\"h4\",{className:\"opblock-title\"},\"Parameters\")),n?Ke.default.createElement(g,{isOAS3:c.isOAS3(),hasUserEditedBody:m.hasUserEditedBody(...d),enabled:a,onCancelClick:this.props.onCancelClick,onTryoutClick:e,onResetClick:()=>t(d)}):null),this.state.parametersVisible?Ke.default.createElement(\"div\",{className:\"parameters-container\"},x.length?Ke.default.createElement(\"div\",{className:\"table-container\"},Ke.default.createElement(\"table\",{className:\"parameters\"},Ke.default.createElement(\"thead\",null,Ke.default.createElement(\"tr\",null,Ke.default.createElement(\"th\",{className:\"col_header parameters-col_name\"},\"Name\"),Ke.default.createElement(\"th\",{className:\"col_header parameters-col_description\"},\"Description\"))),Ke.default.createElement(\"tbody\",null,x.map(((e,t)=>Ke.default.createElement(h,{fn:s,specPath:o.push(t.toString()),getComponent:l,getConfigs:i,rawParam:e,param:c.parameterWithMetaByIdentity(d,e),key:`${e.get(\"in\")}.${e.get(\"name\")}`,onChange:this.onChange,onChangeConsumes:this.onChangeConsumesWrapper,specSelectors:c,specActions:u,oas3Actions:p,oas3Selectors:m,pathMethod:d,isExecute:v})))))):Ke.default.createElement(\"div\",{className:\"opblock-description-wrapper\"},Ke.default.createElement(\"p\",null,\"No parameters\"))):null,this.state.callbackVisible?Ke.default.createElement(\"div\",{className:\"callbacks-container opblock-description-wrapper\"},Ke.default.createElement(S,{callbacks:(0,Fe.Map)(f.get(\"callbacks\")),specPath:o.slice(0,-1).push(\"callbacks\")})):null,b&&C&&this.state.parametersVisible&&Ke.default.createElement(\"div\",{className:\"opblock-section opblock-section-request-body\"},Ke.default.createElement(\"div\",{className:\"opblock-section-header\"},Ke.default.createElement(\"h4\",{className:`opblock-title parameter__name ${C.get(\"required\")&&\"required\"}`},\"Request body\"),Ke.default.createElement(\"label\",{id:w},Ke.default.createElement(y,{value:m.requestContentType(...d),contentTypes:C.get(\"content\",(0,Fe.List)()).keySeq(),onChange:e=>{this.onChangeMediaType({value:e,pathMethod:d})},className:\"body-param-content-type\",ariaLabel:\"Request content type\",controlId:w}))),Ke.default.createElement(\"div\",{className:\"opblock-description-wrapper\"},Ke.default.createElement(_,{setRetainRequestBodyValueFlag:e=>p.setRetainRequestBodyValueFlag({value:e,pathMethod:d}),userHasEditedBody:m.hasUserEditedBody(...d),specPath:o.slice(0,-1).push(\"requestBody\"),requestBody:C,requestBodyValue:m.requestBodyValue(...d),requestBodyInclusionSetting:m.requestBodyInclusionSetting(...d),requestBodyErrors:m.requestBodyErrors(...d),isExecute:v,getConfigs:i,activeExamplesKey:m.activeExamplesMember(...d,\"requestBody\",\"requestBody\"),updateActiveExamplesKey:e=>{this.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:this.props.pathMethod,contextType:\"requestBody\",contextName:\"requestBody\"})},onChange:(e,t)=>{if(t){const r=m.requestBodyValue(...d),n=Fe.Map.isMap(r)?r:(0,Fe.Map)();return p.setRequestBodyValue({pathMethod:d,value:n.setIn(t,e)})}p.setRequestBodyValue({value:e,pathMethod:d})},onChangeIncludeEmpty:(e,t)=>{p.setRequestBodyInclusion({pathMethod:d,value:t,name:e})},contentType:m.requestContentType(...d)}))))}}var parameter_extension=({xKey:e,xVal:t})=>Ke.default.createElement(\"div\",{className:\"parameter__extension\"},e,\": \",String(t));const Ca={onChange:()=>{},isIncludedOptions:{}};class ParameterIncludeEmpty extends Ke.Component{static defaultProps=Ca;componentDidMount(){const{isIncludedOptions:e,onChange:t}=this.props,{shouldDispatchInit:r,defaultValue:n}=e;r&&t(n)}onCheckboxChange=e=>{const{onChange:t}=this.props;t(e.target.checked)};render(){let{isIncluded:e,isDisabled:t}=this.props;return Ke.default.createElement(\"div\",null,Ke.default.createElement(\"label\",{htmlFor:\"include_empty_value\",className:(0,fr.default)(\"parameter__empty_value_toggle\",{disabled:t})},Ke.default.createElement(\"input\",{id:\"include_empty_value\",type:\"checkbox\",disabled:t,checked:!t&&e,onChange:this.onCheckboxChange}),\"Send empty value\"))}}class ParameterRow extends Ke.Component{constructor(e,t){super(e,t),this.setDefaultValue()}UNSAFE_componentWillReceiveProps(e){let t,{specSelectors:r,pathMethod:n,rawParam:a}=e,o=r.isOAS3(),s=r.parameterWithMetaByIdentity(n,a)||new Fe.Map;if(s=s.isEmpty()?a:s,o){let{schema:e}=getParameterSchema(s,{isOAS3:o});t=e?e.get(\"enum\"):void 0}else t=s?s.get(\"enum\"):void 0;let l,i=s?s.get(\"value\"):void 0;void 0!==i?l=i:a.get(\"required\")&&t&&t.size&&(l=t.first()),void 0!==l&&l!==i&&this.onChangeWrapper(function numberToString(e){return\"number\"==typeof e?e.toString():e}(l)),this.setDefaultValue()}onChangeWrapper=(e,t=!1)=>{let r,{onChange:n,rawParam:a}=this.props;return r=\"\"===e||e&&0===e.size?null:e,n(a,r,t)};_onExampleSelect=e=>{this.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:this.props.pathMethod,contextType:\"parameters\",contextName:this.getParamKey()})};onChangeIncludeEmpty=e=>{let{specActions:t,param:r,pathMethod:n}=this.props;const a=r.get(\"name\"),o=r.get(\"in\");return t.updateEmptyParamInclusion(n,a,o,e)};setDefaultValue=()=>{let{specSelectors:e,pathMethod:t,rawParam:r,oas3Selectors:n,fn:a}=this.props;const o=e.parameterWithMetaByIdentity(t,r)||(0,Fe.Map)();let{schema:s}=getParameterSchema(o,{isOAS3:e.isOAS3()});const l=o.get(\"content\",(0,Fe.Map)()).keySeq().first(),i=s?a.getSampleSchema(s.toJS(),l,{includeWriteOnly:!0}):null;if(o&&void 0===o.get(\"value\")&&\"body\"!==o.get(\"in\")){let r;if(e.isSwagger2())r=void 0!==o.get(\"x-example\")?o.get(\"x-example\"):void 0!==o.getIn([\"schema\",\"example\"])?o.getIn([\"schema\",\"example\"]):s&&s.getIn([\"default\"]);else if(e.isOAS3()){s=this.composeJsonSchema(s);const e=n.activeExamplesMember(...t,\"parameters\",this.getParamKey());r=void 0!==o.getIn([\"examples\",e,\"value\"])?o.getIn([\"examples\",e,\"value\"]):void 0!==o.getIn([\"content\",l,\"example\"])?o.getIn([\"content\",l,\"example\"]):void 0!==o.get(\"example\")?o.get(\"example\"):void 0!==(s&&s.get(\"example\"))?s&&s.get(\"example\"):void 0!==(s&&s.get(\"default\"))?s&&s.get(\"default\"):o.get(\"default\")}void 0===r||Fe.List.isList(r)||(r=stringify(r)),void 0!==r?this.onChangeWrapper(r):s&&\"object\"===s.get(\"type\")&&i&&!o.get(\"examples\")&&this.onChangeWrapper(Fe.List.isList(i)?i:stringify(i))}};getParamKey(){const{param:e}=this.props;return e?`${e.get(\"name\")}-${e.get(\"in\")}`:null}composeJsonSchema(e){const{fn:t}=this.props,r=e.get(\"oneOf\")?.get(0)?.toJS(),n=e.get(\"anyOf\")?.get(0)?.toJS();return(0,Fe.fromJS)(t.mergeJsonSchema(e.toJS(),r??n??{}))}render(){let{param:e,rawParam:t,getComponent:r,getConfigs:n,isExecute:a,fn:o,onChangeConsumes:s,specSelectors:l,pathMethod:i,specPath:c,oas3Selectors:u}=this.props,d=l.isOAS3();const{showExtensions:p,showCommonExtensions:m}=n();if(e||(e=t),!t)return null;const f=r(\"JsonSchemaForm\"),h=r(\"ParamBody\");let g=e.get(\"in\"),y=\"body\"!==g?null:Ke.default.createElement(h,{getComponent:r,getConfigs:n,fn:o,param:e,consumes:l.consumesOptionsFor(i),consumesValue:l.contentTypeValues(i).get(\"requestContentType\"),onChange:this.onChangeWrapper,onChangeConsumes:s,isExecute:a,specSelectors:l,pathMethod:i});const S=r(\"modelExample\"),_=r(\"Markdown\",!0),v=r(\"ParameterExt\"),b=r(\"ParameterIncludeEmpty\"),w=r(\"ExamplesSelectValueRetainer\"),C=r(\"Example\");let{schema:x}=getParameterSchema(e,{isOAS3:d}),O=l.parameterWithMetaByIdentity(i,t)||(0,Fe.Map)();d&&(x=this.composeJsonSchema(x));let k,N,A,I,R=x?x.get(\"format\"):null,T=x?x.get(\"type\"):null,B=x?x.getIn([\"items\",\"type\"]):null,j=\"formData\"===g,P=\"FormData\"in ot,M=e.get(\"required\"),q=O?O.get(\"value\"):\"\",L=m?getCommonExtensions(x):null,D=p?getExtensions(e):null,U=!1;return void 0!==e&&x&&(k=x.get(\"items\")),void 0!==k?(N=k.get(\"enum\"),A=k.get(\"default\")):x&&(N=x.get(\"enum\")),N&&N.size&&N.size>0&&(U=!0),void 0!==e&&(x&&(A=x.get(\"default\")),void 0===A&&(A=e.get(\"default\")),I=e.get(\"example\"),void 0===I&&(I=e.get(\"x-example\"))),Ke.default.createElement(\"tr\",{\"data-param-name\":e.get(\"name\"),\"data-param-in\":e.get(\"in\")},Ke.default.createElement(\"td\",{className:\"parameters-col_name\"},Ke.default.createElement(\"div\",{className:M?\"parameter__name required\":\"parameter__name\"},e.get(\"name\"),M?Ke.default.createElement(\"span\",null,\" *\"):null),Ke.default.createElement(\"div\",{className:\"parameter__type\"},T,B&&`[${B}]`,R&&Ke.default.createElement(\"span\",{className:\"prop-format\"},\"($\",R,\")\")),Ke.default.createElement(\"div\",{className:\"parameter__deprecated\"},d&&e.get(\"deprecated\")?\"deprecated\":null),Ke.default.createElement(\"div\",{className:\"parameter__in\"},\"(\",e.get(\"in\"),\")\")),Ke.default.createElement(\"td\",{className:\"parameters-col_description\"},e.get(\"description\")?Ke.default.createElement(_,{source:e.get(\"description\")}):null,!y&&a||!U?null:Ke.default.createElement(_,{className:\"parameter__enum\",source:\"<i>Available values</i> : \"+N.map((function(e){return e})).toArray().map(String).join(\", \")}),!y&&a||void 0===A?null:Ke.default.createElement(_,{className:\"parameter__default\",source:\"<i>Default value</i> : \"+A}),!y&&a||void 0===I?null:Ke.default.createElement(_,{source:\"<i>Example</i> : \"+I}),j&&!P&&Ke.default.createElement(\"div\",null,\"Error: your browser does not support FormData\"),d&&e.get(\"examples\")?Ke.default.createElement(\"section\",{className:\"parameter-controls\"},Ke.default.createElement(w,{examples:e.get(\"examples\"),onSelect:this._onExampleSelect,updateValue:this.onChangeWrapper,getComponent:r,defaultToFirstExample:!0,currentKey:u.activeExamplesMember(...i,\"parameters\",this.getParamKey()),currentUserInputValue:q})):null,y?null:Ke.default.createElement(f,{fn:o,getComponent:r,value:q,required:M,disabled:!a,description:e.get(\"name\"),onChange:this.onChangeWrapper,errors:O.get(\"errors\"),schema:x}),y&&x?Ke.default.createElement(S,{getComponent:r,specPath:c.push(\"schema\"),getConfigs:n,isExecute:a,specSelectors:l,schema:x,example:y,includeWriteOnly:!0}):null,!y&&a&&e.get(\"allowEmptyValue\")?Ke.default.createElement(b,{onChange:this.onChangeIncludeEmpty,isIncluded:l.parameterInclusionSettingFor(i,e.get(\"name\"),e.get(\"in\")),isDisabled:!isEmptyValue(q)}):null,d&&e.get(\"examples\")?Ke.default.createElement(C,{example:e.getIn([\"examples\",u.activeExamplesMember(...i,\"parameters\",this.getParamKey())]),getComponent:r,getConfigs:n}):null,m&&L.size?L.entrySeq().map((([e,t])=>Ke.default.createElement(v,{key:`${e}-${t}`,xKey:e,xVal:t}))):null,p&&D.size?D.entrySeq().map((([e,t])=>Ke.default.createElement(v,{key:`${e}-${t}`,xKey:e,xVal:t}))):null))}}class Execute extends Ke.Component{handleValidateParameters=()=>{let{specSelectors:e,specActions:t,path:r,method:n}=this.props;return t.validateParams([r,n]),e.validateBeforeExecute([r,n])};handleValidateRequestBody=()=>{let{path:e,method:t,specSelectors:r,oas3Selectors:n,oas3Actions:a}=this.props,o={missingBodyValue:!1,missingRequiredKeys:[]};a.clearRequestBodyValidateError({path:e,method:t});let s=r.getOAS3RequiredRequestBodyContentType([e,t]),l=n.requestBodyValue(e,t),i=n.validateBeforeExecute([e,t]),c=n.requestContentType(e,t);if(!i)return o.missingBodyValue=!0,a.setRequestBodyValidateError({path:e,method:t,validationErrors:o}),!1;if(!s)return!0;let u=n.validateShallowRequired({oas3RequiredRequestBodyContentType:s,oas3RequestContentType:c,oas3RequestBodyValue:l});return!u||u.length<1||(u.forEach((e=>{o.missingRequiredKeys.push(e)})),a.setRequestBodyValidateError({path:e,method:t,validationErrors:o}),!1)};handleValidationResultPass=()=>{let{specActions:e,operation:t,path:r,method:n}=this.props;this.props.onExecute&&this.props.onExecute(),e.execute({operation:t,path:r,method:n})};handleValidationResultFail=()=>{let{specActions:e,path:t,method:r}=this.props;e.clearValidateParams([t,r]),setTimeout((()=>{e.validateParams([t,r])}),40)};handleValidationResult=e=>{e?this.handleValidationResultPass():this.handleValidationResultFail()};onClick=()=>{let e=this.handleValidateParameters(),t=this.handleValidateRequestBody(),r=e&&t;this.handleValidationResult(r)};onChangeProducesWrapper=e=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],e);render(){const{disabled:e}=this.props;return Ke.default.createElement(\"button\",{className:\"btn execute opblock-control__btn\",onClick:this.onClick,disabled:e},\"Execute\")}}class headers_Headers extends Ke.default.Component{render(){let{headers:e,getComponent:t}=this.props;const r=t(\"Property\"),n=t(\"Markdown\",!0);return e&&e.size?Ke.default.createElement(\"div\",{className:\"headers-wrapper\"},Ke.default.createElement(\"h4\",{className:\"headers__title\"},\"Headers:\"),Ke.default.createElement(\"table\",{className:\"headers\"},Ke.default.createElement(\"thead\",null,Ke.default.createElement(\"tr\",{className:\"header-row\"},Ke.default.createElement(\"th\",{className:\"header-col\"},\"Name\"),Ke.default.createElement(\"th\",{className:\"header-col\"},\"Description\"),Ke.default.createElement(\"th\",{className:\"header-col\"},\"Type\"))),Ke.default.createElement(\"tbody\",null,e.entrySeq().map((([e,t])=>{if(!Fe.default.Map.isMap(t))return null;const a=t.get(\"description\"),o=t.getIn([\"schema\"])?t.getIn([\"schema\",\"type\"]):t.getIn([\"type\"]),s=t.getIn([\"schema\",\"example\"]);return Ke.default.createElement(\"tr\",{key:e},Ke.default.createElement(\"td\",{className:\"header-col\"},e),Ke.default.createElement(\"td\",{className:\"header-col\"},a?Ke.default.createElement(n,{source:a}):null),Ke.default.createElement(\"td\",{className:\"header-col\"},o,\" \",s?Ke.default.createElement(r,{propKey:\"Example\",propVal:s,propClass:\"header-example\"}):null))})).toArray()))):null}}class Errors extends Ke.default.Component{render(){let{editorActions:e,errSelectors:t,layoutSelectors:r,layoutActions:n,getComponent:a}=this.props;const o=a(\"Collapse\");if(e&&e.jumpToLine)var s=e.jumpToLine;let l=t.allErrors().filter((e=>\"thrown\"===e.get(\"type\")||\"error\"===e.get(\"level\")));if(!l||l.count()<1)return null;let i=r.isShown([\"errorPane\"],!0),c=l.sortBy((e=>e.get(\"line\")));return Ke.default.createElement(\"pre\",{className:\"errors-wrapper\"},Ke.default.createElement(\"hgroup\",{className:\"error\"},Ke.default.createElement(\"h4\",{className:\"errors__title\"},\"Errors\"),Ke.default.createElement(\"button\",{className:\"btn errors__clear-btn\",onClick:()=>n.show([\"errorPane\"],!i)},i?\"Hide\":\"Show\")),Ke.default.createElement(o,{isOpened:i,animated:!0},Ke.default.createElement(\"div\",{className:\"errors\"},c.map(((e,t)=>{let r=e.get(\"type\");return\"thrown\"===r||\"auth\"===r?Ke.default.createElement(ThrownErrorItem,{key:t,error:e.get(\"error\")||e,jumpToLine:s}):\"spec\"===r?Ke.default.createElement(SpecErrorItem,{key:t,error:e,jumpToLine:s}):void 0})))))}}const ThrownErrorItem=({error:e,jumpToLine:t})=>{if(!e)return null;let r=e.get(\"line\");return Ke.default.createElement(\"div\",{className:\"error-wrapper\"},e?Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h4\",null,e.get(\"source\")&&e.get(\"level\")?toTitleCase(e.get(\"source\"))+\" \"+e.get(\"level\"):\"\",e.get(\"path\")?Ke.default.createElement(\"small\",null,\" at \",e.get(\"path\")):null),Ke.default.createElement(\"span\",{className:\"message thrown\"},e.get(\"message\")),Ke.default.createElement(\"div\",{className:\"error-line\"},r&&t?Ke.default.createElement(\"a\",{onClick:t.bind(null,r)},\"Jump to line \",r):null)):null)},SpecErrorItem=({error:e,jumpToLine:t=null})=>{let r=null;return e.get(\"path\")?r=Fe.List.isList(e.get(\"path\"))?Ke.default.createElement(\"small\",null,\"at \",e.get(\"path\").join(\".\")):Ke.default.createElement(\"small\",null,\"at \",e.get(\"path\")):e.get(\"line\")&&!t&&(r=Ke.default.createElement(\"small\",null,\"on line \",e.get(\"line\"))),Ke.default.createElement(\"div\",{className:\"error-wrapper\"},e?Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h4\",null,toTitleCase(e.get(\"source\"))+\" \"+e.get(\"level\"),\" \",r),Ke.default.createElement(\"span\",{className:\"message\"},e.get(\"message\")),Ke.default.createElement(\"div\",{className:\"error-line\"},t?Ke.default.createElement(\"a\",{onClick:t.bind(null,e.get(\"line\"))},\"Jump to line \",e.get(\"line\")):null)):null)};function toTitleCase(e){return(e||\"\").split(\" \").map((e=>e[0].toUpperCase()+e.slice(1))).join(\" \")}const content_type_noop=()=>{};class ContentType extends Ke.default.Component{static defaultProps={onChange:content_type_noop,value:null,contentTypes:(0,Fe.fromJS)([\"application/json\"])};componentDidMount(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}UNSAFE_componentWillReceiveProps(e){e.contentTypes&&e.contentTypes.size&&(e.contentTypes.includes(e.value)||e.onChange(e.contentTypes.first()))}onChangeWrapper=e=>this.props.onChange(e.target.value);render(){let{ariaControls:e,ariaLabel:t,className:r,contentTypes:n,controlId:a,value:o}=this.props;return n&&n.size?Ke.default.createElement(\"div\",{className:\"content-type-wrapper \"+(r||\"\")},Ke.default.createElement(\"select\",{\"aria-controls\":e,\"aria-label\":t,className:\"content-type\",id:a,onChange:this.onChangeWrapper,value:o||\"\"},n.map((e=>Ke.default.createElement(\"option\",{key:e,value:e},e))).toArray())):null}}function xclass(...e){return e.filter((e=>!!e)).join(\" \").trim()}class Container extends Ke.default.Component{render(){let{fullscreen:e,full:t,...r}=this.props;if(e)return Ke.default.createElement(\"section\",r);let n=\"swagger-container\"+(t?\"-full\":\"\");return Ke.default.createElement(\"section\",(0,nr.default)({},r,{className:xclass(r.className,n)}))}}const xa={mobile:\"\",tablet:\"-tablet\",desktop:\"-desktop\",large:\"-hd\"};class Col extends Ke.default.Component{render(){const{hide:e,keepContents:t,mobile:r,tablet:n,desktop:a,large:o,...s}=this.props;if(e&&!t)return Ke.default.createElement(\"span\",null);let l=[];for(let e in xa){if(!Object.prototype.hasOwnProperty.call(xa,e))continue;let t=xa[e];if(e in this.props){let r=this.props[e];if(r<1){l.push(\"none\"+t);continue}l.push(\"block\"+t),l.push(\"col-\"+r+t)}}e&&l.push(\"hidden\");let i=xclass(s.className,...l);return Ke.default.createElement(\"section\",(0,nr.default)({},s,{className:i}))}}class Row extends Ke.default.Component{render(){return Ke.default.createElement(\"div\",(0,nr.default)({},this.props,{className:xclass(this.props.className,\"wrapper\")}))}}class Button extends Ke.default.Component{static defaultProps={className:\"\"};render(){return Ke.default.createElement(\"button\",(0,nr.default)({},this.props,{className:xclass(this.props.className,\"button\")}))}}const TextArea=e=>Ke.default.createElement(\"textarea\",e),Input=e=>Ke.default.createElement(\"input\",e);class Select extends Ke.default.Component{static defaultProps={multiple:!1,allowEmptyValue:!0};constructor(e,t){let r;super(e,t),r=e.value?e.value:e.multiple?[\"\"]:\"\",this.state={value:r}}onChange=e=>{let t,{onChange:r,multiple:n}=this.props,a=[].slice.call(e.target.options);t=n?a.filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value,this.setState({value:t}),r&&r(t)};UNSAFE_componentWillReceiveProps(e){e.value!==this.props.value&&this.setState({value:e.value})}render(){let{allowedValues:e,multiple:t,allowEmptyValue:r,disabled:n}=this.props,a=this.state.value?.toJS?.()||this.state.value;return Ke.default.createElement(\"select\",{className:this.props.className,multiple:t,value:a,onChange:this.onChange,disabled:n},r?Ke.default.createElement(\"option\",{value:\"\"},\"--\"):null,e.map((function(e,t){return Ke.default.createElement(\"option\",{key:t,value:String(e)},String(e))})))}}class Link extends Ke.default.Component{render(){return Ke.default.createElement(\"a\",(0,nr.default)({},this.props,{rel:\"noopener noreferrer\",className:xclass(this.props.className,\"link\")}))}}const NoMargin=({children:e})=>Ke.default.createElement(\"div\",{className:\"no-margin\"},\" \",e,\" \");class Collapse extends Ke.default.Component{static defaultProps={isOpened:!1,animated:!1};renderNotAnimated(){return this.props.isOpened?Ke.default.createElement(NoMargin,null,this.props.children):Ke.default.createElement(\"noscript\",null)}render(){let{animated:e,isOpened:t,children:r}=this.props;return e?(r=t?r:null,Ke.default.createElement(NoMargin,null,r)):this.renderNotAnimated()}}class Overview extends Ke.default.Component{constructor(...e){super(...e),this.setTagShown=this._setTagShown.bind(this)}_setTagShown(e,t){this.props.layoutActions.show(e,t)}showOp(e,t){let{layoutActions:r}=this.props;r.show(e,t)}render(){let{specSelectors:e,layoutSelectors:t,layoutActions:r,getComponent:n}=this.props,a=e.taggedOperations();const o=n(\"Collapse\");return Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h4\",{className:\"overview-title\"},\"Overview\"),a.map(((e,n)=>{let a=e.get(\"operations\"),s=[\"overview-tags\",n],l=t.isShown(s,!0);return Ke.default.createElement(\"div\",{key:\"overview-\"+n},Ke.default.createElement(\"h4\",{onClick:()=>r.show(s,!l),className:\"link overview-tag\"},\" \",l?\"-\":\"+\",n),Ke.default.createElement(o,{isOpened:l,animated:!0},a.map((e=>{let{path:n,method:a,id:o}=e.toObject(),s=\"operations\",l=o,i=t.isShown([s,l]);return Ke.default.createElement(OperationLink,{key:o,path:n,method:a,id:n+\"-\"+a,shown:i,showOpId:l,showOpIdPrefix:s,href:`#operation-${l}`,onClick:r.show})})).toArray()))})).toArray(),a.size<1&&Ke.default.createElement(\"h3\",null,\" No operations defined in spec! \"))}}class OperationLink extends Ke.default.Component{constructor(e){super(e),this.onClick=this._onClick.bind(this)}_onClick(){let{showOpId:e,showOpIdPrefix:t,onClick:r,shown:n}=this.props;r([t,e],!n)}render(){let{id:e,method:t,shown:r,href:n}=this.props;return Ke.default.createElement(Link,{href:n,onClick:this.onClick,className:\"block opblock-link \"+(r?\"shown\":\"\")},Ke.default.createElement(\"div\",null,Ke.default.createElement(\"small\",{className:`bold-label-${t}`},t.toUpperCase()),Ke.default.createElement(\"span\",{className:\"bold-label\"},e)))}}class InitializedInput extends Ke.default.Component{componentDidMount(){this.props.initialValue&&(this.inputRef.value=this.props.initialValue)}render(){const{value:e,defaultValue:t,initialValue:r,...n}=this.props;return Ke.default.createElement(\"input\",(0,nr.default)({},n,{ref:e=>this.inputRef=e}))}}class InfoBasePath extends Ke.default.Component{render(){const{host:e,basePath:t}=this.props;return Ke.default.createElement(\"pre\",{className:\"base-url\"},\"[ Base URL: \",e,t,\" ]\")}}class InfoUrl extends Ke.default.PureComponent{render(){const{url:e,getComponent:t}=this.props,r=t(\"Link\");return Ke.default.createElement(r,{target:\"_blank\",href:sanitizeUrl(e)},Ke.default.createElement(\"span\",{className:\"url\"},\" \",e))}}class Info extends Ke.default.Component{render(){const{info:e,url:t,host:r,basePath:n,getComponent:a,externalDocs:o,selectedServer:s,url:l}=this.props,i=e.get(\"version\"),c=e.get(\"description\"),u=e.get(\"title\"),d=safeBuildUrl(e.get(\"termsOfService\"),l,{selectedServer:s}),p=e.get(\"contact\"),m=e.get(\"license\"),f=safeBuildUrl(o&&o.get(\"url\"),l,{selectedServer:s}),h=o&&o.get(\"description\"),g=a(\"Markdown\",!0),y=a(\"Link\"),S=a(\"VersionStamp\"),_=a(\"OpenAPIVersion\"),v=a(\"InfoUrl\"),b=a(\"InfoBasePath\"),w=a(\"License\"),C=a(\"Contact\");return Ke.default.createElement(\"div\",{className:\"info\"},Ke.default.createElement(\"hgroup\",{className:\"main\"},Ke.default.createElement(\"h2\",{className:\"title\"},u,Ke.default.createElement(\"span\",null,i&&Ke.default.createElement(S,{version:i}),Ke.default.createElement(_,{oasVersion:\"2.0\"}))),r||n?Ke.default.createElement(b,{host:r,basePath:n}):null,t&&Ke.default.createElement(v,{getComponent:a,url:t})),Ke.default.createElement(\"div\",{className:\"description\"},Ke.default.createElement(g,{source:c})),d&&Ke.default.createElement(\"div\",{className:\"info__tos\"},Ke.default.createElement(y,{target:\"_blank\",href:sanitizeUrl(d)},\"Terms of service\")),p?.size>0&&Ke.default.createElement(C,{getComponent:a,data:p,selectedServer:s,url:t}),m?.size>0&&Ke.default.createElement(w,{getComponent:a,license:m,selectedServer:s,url:t}),f?Ke.default.createElement(y,{className:\"info__extdocs\",target:\"_blank\",href:sanitizeUrl(f)},h||f):null)}}var Oa=Info;class InfoContainer extends Ke.default.Component{render(){const{specSelectors:e,getComponent:t,oas3Selectors:r}=this.props,n=e.info(),a=e.url(),o=e.basePath(),s=e.host(),l=e.externalDocs(),i=r.selectedServer(),c=t(\"info\");return Ke.default.createElement(\"div\",null,n&&n.count()?Ke.default.createElement(c,{info:n,url:a,host:s,basePath:o,externalDocs:l,getComponent:t,selectedServer:i}):null)}}class Contact extends Ke.default.Component{render(){const{data:e,getComponent:t,selectedServer:r,url:n}=this.props,a=e.get(\"name\",\"the developer\"),o=safeBuildUrl(e.get(\"url\"),n,{selectedServer:r}),s=e.get(\"email\"),l=t(\"Link\");return Ke.default.createElement(\"div\",{className:\"info__contact\"},o&&Ke.default.createElement(\"div\",null,Ke.default.createElement(l,{href:sanitizeUrl(o),target:\"_blank\"},a,\" - Website\")),s&&Ke.default.createElement(l,{href:sanitizeUrl(`mailto:${s}`)},o?`Send email to ${a}`:`Contact ${a}`))}}var ka=Contact;class License extends Ke.default.Component{render(){const{license:e,getComponent:t,selectedServer:r,url:n}=this.props,a=e.get(\"name\",\"License\"),o=safeBuildUrl(e.get(\"url\"),n,{selectedServer:r}),s=t(\"Link\");return Ke.default.createElement(\"div\",{className:\"info__license\"},o?Ke.default.createElement(\"div\",{className:\"info__license__url\"},Ke.default.createElement(s,{target:\"_blank\",href:sanitizeUrl(o)},a)):Ke.default.createElement(\"span\",null,a))}}var Na=License;class JumpToPath extends Ke.default.Component{render(){return null}}class CopyToClipboardBtn extends Ke.default.Component{render(){let{getComponent:e}=this.props;const t=e(\"CopyIcon\");return Ke.default.createElement(\"div\",{className:\"view-line-link copy-to-clipboard\",title:\"Copy to clipboard\"},Ke.default.createElement(hr.CopyToClipboard,{text:this.props.textToCopy},Ke.default.createElement(t,null)))}}class Footer extends Ke.default.Component{render(){return Ke.default.createElement(\"div\",{className:\"footer\"})}}class FilterContainer extends Ke.default.Component{onFilterChange=e=>{const{target:{value:t}}=e;this.props.layoutActions.updateFilter(t)};render(){const{specSelectors:e,layoutSelectors:t,getComponent:r}=this.props,n=r(\"Col\"),a=\"loading\"===e.loadingStatus(),o=\"failed\"===e.loadingStatus(),s=t.currentFilter(),l=[\"operation-filter-input\"];return o&&l.push(\"failed\"),a&&l.push(\"loading\"),Ke.default.createElement(\"div\",null,!1===s?null:Ke.default.createElement(\"div\",{className:\"filter-container\"},Ke.default.createElement(n,{className:\"filter wrapper\",mobile:12},Ke.default.createElement(\"input\",{className:l.join(\" \"),placeholder:\"Filter by tag\",type:\"text\",onChange:this.onFilterChange,value:\"string\"==typeof s?s:\"\",disabled:a}))))}}const Aa=Function.prototype;class ParamBody extends Ke.PureComponent{static defaultProp={consumes:(0,Fe.fromJS)([\"application/json\"]),param:(0,Fe.fromJS)({}),onChange:Aa,onChangeConsumes:Aa};constructor(e,t){super(e,t),this.state={isEditBox:!1,value:\"\"}}componentDidMount(){this.updateValues.call(this,this.props)}UNSAFE_componentWillReceiveProps(e){this.updateValues.call(this,e)}updateValues=e=>{let{param:t,isExecute:r,consumesValue:n=\"\"}=e,a=/xml/i.test(n),o=/json/i.test(n),s=a?t.get(\"value_xml\"):t.get(\"value\");if(void 0!==s){let e=!s&&o?\"{}\":s;this.setState({value:e}),this.onChange(e,{isXml:a,isEditBox:r})}else a?this.onChange(this.sample(\"xml\"),{isXml:a,isEditBox:r}):this.onChange(this.sample(),{isEditBox:r})};sample=e=>{let{param:t,fn:r}=this.props,n=r.inferSchema(t.toJS());return r.getSampleSchema(n,e,{includeWriteOnly:!0})};onChange=(e,{isEditBox:t,isXml:r})=>{this.setState({value:e,isEditBox:t}),this._onChange(e,r)};_onChange=(e,t)=>{(this.props.onChange||Aa)(e,t)};handleOnChange=e=>{const{consumesValue:t}=this.props,r=/xml/i.test(t),n=e.target.value;this.onChange(n,{isXml:r,isEditBox:this.state.isEditBox})};toggleIsEditBox=()=>this.setState((e=>({isEditBox:!e.isEditBox})));render(){let{onChangeConsumes:e,param:t,isExecute:r,specSelectors:n,pathMethod:a,getComponent:o}=this.props;const s=o(\"Button\"),l=o(\"TextArea\"),i=o(\"HighlightCode\",!0),c=o(\"contentType\");let u=(n?n.parameterWithMetaByIdentity(a,t):t).get(\"errors\",(0,Fe.List)()),d=n.contentTypeValues(a).get(\"requestContentType\"),p=this.props.consumes&&this.props.consumes.size?this.props.consumes:ParamBody.defaultProp.consumes,{value:m,isEditBox:f}=this.state,h=null;getKnownSyntaxHighlighterLanguage(m)&&(h=\"json\");const g=`${createHtmlReadyId(`${a[1]}${a[0]}_parameters`)}_select`;return Ke.default.createElement(\"div\",{className:\"body-param\",\"data-param-name\":t.get(\"name\"),\"data-param-in\":t.get(\"in\")},f&&r?Ke.default.createElement(l,{className:\"body-param__text\"+(u.count()?\" invalid\":\"\"),value:m,onChange:this.handleOnChange}):m&&Ke.default.createElement(i,{className:\"body-param__example\",language:h},m),Ke.default.createElement(\"div\",{className:\"body-param-options\"},r?Ke.default.createElement(\"div\",{className:\"body-param-edit\"},Ke.default.createElement(s,{className:f?\"btn cancel body-param__example-edit\":\"btn edit body-param__example-edit\",onClick:this.toggleIsEditBox},f?\"Cancel\":\"Edit\")):null,Ke.default.createElement(\"label\",{htmlFor:g},Ke.default.createElement(\"span\",null,\"Parameter content type\"),Ke.default.createElement(c,{value:d,contentTypes:p,onChange:e,className:\"body-param-content-type\",ariaLabel:\"Parameter content type\",controlId:g}))))}}class Curl extends Ke.default.Component{render(){const{request:e,getComponent:t}=this.props,r=requestSnippetGenerator_curl_bash(e),n=t(\"SyntaxHighlighter\",!0);return Ke.default.createElement(\"div\",{className:\"curl-command\"},Ke.default.createElement(\"h4\",null,\"Curl\"),Ke.default.createElement(\"div\",{className:\"copy-to-clipboard\"},Ke.default.createElement(hr.CopyToClipboard,{text:r},Ke.default.createElement(\"button\",null))),Ke.default.createElement(\"div\",null,Ke.default.createElement(n,{language:\"bash\",className:\"curl microlight\",renderPlainText:({children:e,PlainTextViewer:t})=>Ke.default.createElement(t,{className:\"curl\"},e)},r)))}}var property=({propKey:e,propVal:t,propClass:r})=>Ke.default.createElement(\"span\",{className:r},Ke.default.createElement(\"br\",null),e,\": \",String(t));class TryItOutButton extends Ke.default.Component{static defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,onResetClick:Function.prototype,enabled:!1,hasUserEditedBody:!1,isOAS3:!1};render(){const{onTryoutClick:e,onCancelClick:t,onResetClick:r,enabled:n,hasUserEditedBody:a,isOAS3:o}=this.props,s=o&&a;return Ke.default.createElement(\"div\",{className:s?\"try-out btn-group\":\"try-out\"},n?Ke.default.createElement(\"button\",{className:\"btn try-out__btn cancel\",onClick:t},\"Cancel\"):Ke.default.createElement(\"button\",{className:\"btn try-out__btn\",onClick:e},\"Try it out \"),s&&Ke.default.createElement(\"button\",{className:\"btn try-out__btn reset\",onClick:r},\"Reset\"))}}class VersionPragmaFilter extends Ke.default.PureComponent{static defaultProps={alsoShow:null,children:null,bypass:!1};render(){const{bypass:e,isSwagger2:t,isOAS3:r,alsoShow:n}=this.props;return e?Ke.default.createElement(\"div\",null,this.props.children):t&&r?Ke.default.createElement(\"div\",{className:\"version-pragma\"},n,Ke.default.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--ambiguous\"},Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h3\",null,\"Unable to render this definition\"),Ke.default.createElement(\"p\",null,Ke.default.createElement(\"code\",null,\"swagger\"),\" and \",Ke.default.createElement(\"code\",null,\"openapi\"),\" fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields.\"),Ke.default.createElement(\"p\",null,\"Supported version fields are \",Ke.default.createElement(\"code\",null,\"swagger: \",'\"2.0\"'),\" and those that match \",Ke.default.createElement(\"code\",null,\"openapi: 3.0.n\"),\" (for example, \",Ke.default.createElement(\"code\",null,\"openapi: 3.0.0\"),\").\")))):t||r?Ke.default.createElement(\"div\",null,this.props.children):Ke.default.createElement(\"div\",{className:\"version-pragma\"},n,Ke.default.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--missing\"},Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h3\",null,\"Unable to render this definition\"),Ke.default.createElement(\"p\",null,\"The provided definition does not specify a valid version field.\"),Ke.default.createElement(\"p\",null,\"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are \",Ke.default.createElement(\"code\",null,\"swagger: \",'\"2.0\"'),\" and those that match \",Ke.default.createElement(\"code\",null,\"openapi: 3.0.n\"),\" (for example, \",Ke.default.createElement(\"code\",null,\"openapi: 3.0.0\"),\").\"))))}}var version_stamp=({version:e})=>Ke.default.createElement(\"small\",null,Ke.default.createElement(\"pre\",{className:\"version\"},\" \",e,\" \"));var openapi_version=({oasVersion:e})=>Ke.default.createElement(\"small\",{className:\"version-stamp\"},Ke.default.createElement(\"pre\",{className:\"version\"},\"OAS \",e));var deep_link=({enabled:e,path:t,text:r})=>Ke.default.createElement(\"a\",{className:\"nostyle\",onClick:e?e=>e.preventDefault():null,href:e?`#/${t}`:null},Ke.default.createElement(\"span\",null,r));var svg_assets=()=>Ke.default.createElement(\"div\",null,Ke.default.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",xmlnsXlink:\"http://www.w3.org/1999/xlink\",className:\"svg-assets\"},Ke.default.createElement(\"defs\",null,Ke.default.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"unlocked\"},Ke.default.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z\"})),Ke.default.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"locked\"},Ke.default.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z\"})),Ke.default.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"close\"},Ke.default.createElement(\"path\",{d:\"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z\"})),Ke.default.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow\"},Ke.default.createElement(\"path\",{d:\"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z\"})),Ke.default.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow-down\"},Ke.default.createElement(\"path\",{d:\"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z\"})),Ke.default.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow-up\"},Ke.default.createElement(\"path\",{d:\"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z\"})),Ke.default.createElement(\"symbol\",{viewBox:\"0 0 24 24\",id:\"jump-to\"},Ke.default.createElement(\"path\",{d:\"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z\"})),Ke.default.createElement(\"symbol\",{viewBox:\"0 0 24 24\",id:\"expand\"},Ke.default.createElement(\"path\",{d:\"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z\"})),Ke.default.createElement(\"symbol\",{viewBox:\"0 0 15 16\",id:\"copy\"},Ke.default.createElement(\"g\",{transform:\"translate(2, -1)\"},Ke.default.createElement(\"path\",{fill:\"#ffffff\",fillRule:\"evenodd\",d:\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"})))))),Ia=function(e){var t={};return __webpack_require__.d(t,e),t}({Remarkable:function(){return ye.Remarkable}}),Ra=function(e){var t={};return __webpack_require__.d(t,e),t}({linkify:function(){return Ee.linkify}}),Ta=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return Se.default}});Ta.default.addHook&&Ta.default.addHook(\"beforeSanitizeElements\",(function(e){return e.href&&e.setAttribute(\"rel\",\"noopener noreferrer\"),e}));var Ba=function Markdown({source:e,className:t=\"\",getConfigs:r=(()=>({useUnsafeMarkdown:!1}))}){if(\"string\"!=typeof e)return null;const n=new Ia.Remarkable({html:!0,typographer:!0,breaks:!0,linkTarget:\"_blank\"}).use(Ra.linkify);n.core.ruler.disable([\"replacements\",\"smartquotes\"]);const{useUnsafeMarkdown:a}=r(),o=n.render(e),s=sanitizer(o,{useUnsafeMarkdown:a});return e&&o&&s?Ke.default.createElement(\"div\",{className:(0,fr.default)(t,\"markdown\"),dangerouslySetInnerHTML:{__html:s}}):null};function sanitizer(e,{useUnsafeMarkdown:t=!1}={}){const r=t,n=t?[]:[\"style\",\"class\"];return t&&!sanitizer.hasWarnedAboutDeprecation&&(console.warn(\"useUnsafeMarkdown display configuration parameter is deprecated since >3.26.0 and will be removed in v4.0.0.\"),sanitizer.hasWarnedAboutDeprecation=!0),Ta.default.sanitize(e,{ADD_ATTR:[\"target\"],FORBID_TAGS:[\"style\",\"form\"],ALLOW_DATA_ATTR:r,FORBID_ATTR:n})}sanitizer.hasWarnedAboutDeprecation=!1;class BaseLayout extends Ke.default.Component{render(){const{errSelectors:e,specSelectors:t,getComponent:r}=this.props,n=r(\"SvgAssets\"),a=r(\"InfoContainer\",!0),o=r(\"VersionPragmaFilter\"),s=r(\"operations\",!0),l=r(\"Models\",!0),i=r(\"Webhooks\",!0),c=r(\"Row\"),u=r(\"Col\"),d=r(\"errors\",!0),p=r(\"ServersContainer\",!0),m=r(\"SchemesContainer\",!0),f=r(\"AuthorizeBtnContainer\",!0),h=r(\"FilterContainer\",!0),g=t.isSwagger2(),y=t.isOAS3(),S=t.isOAS31(),_=!t.specStr(),v=t.loadingStatus();let b=null;if(\"loading\"===v&&(b=Ke.default.createElement(\"div\",{className:\"info\"},Ke.default.createElement(\"div\",{className:\"loading-container\"},Ke.default.createElement(\"div\",{className:\"loading\"})))),\"failed\"===v&&(b=Ke.default.createElement(\"div\",{className:\"info\"},Ke.default.createElement(\"div\",{className:\"loading-container\"},Ke.default.createElement(\"h4\",{className:\"title\"},\"Failed to load API definition.\"),Ke.default.createElement(d,null)))),\"failedConfig\"===v){const t=e.lastError(),r=t?t.get(\"message\"):\"\";b=Ke.default.createElement(\"div\",{className:\"info failed-config\"},Ke.default.createElement(\"div\",{className:\"loading-container\"},Ke.default.createElement(\"h4\",{className:\"title\"},\"Failed to load remote configuration.\"),Ke.default.createElement(\"p\",null,r)))}if(!b&&_&&(b=Ke.default.createElement(\"h4\",null,\"No API definition provided.\")),b)return Ke.default.createElement(\"div\",{className:\"swagger-ui\"},Ke.default.createElement(\"div\",{className:\"loading-container\"},b));const w=t.servers(),C=t.schemes(),x=w&&w.size,O=C&&C.size,k=!!t.securityDefinitions();return Ke.default.createElement(\"div\",{className:\"swagger-ui\"},Ke.default.createElement(n,null),Ke.default.createElement(o,{isSwagger2:g,isOAS3:y,alsoShow:Ke.default.createElement(d,null)},Ke.default.createElement(d,null),Ke.default.createElement(c,{className:\"information-container\"},Ke.default.createElement(u,{mobile:12},Ke.default.createElement(a,null))),x||O||k?Ke.default.createElement(\"div\",{className:\"scheme-container\"},Ke.default.createElement(u,{className:\"schemes wrapper\",mobile:12},x||O?Ke.default.createElement(\"div\",{className:\"schemes-server-container\"},x?Ke.default.createElement(p,null):null,O?Ke.default.createElement(m,null):null):null,k?Ke.default.createElement(f,null):null)):null,Ke.default.createElement(h,null),Ke.default.createElement(c,null,Ke.default.createElement(u,{mobile:12,desktop:12},Ke.default.createElement(s,null))),S&&Ke.default.createElement(c,{className:\"webhooks-container\"},Ke.default.createElement(u,{mobile:12,desktop:12},Ke.default.createElement(i,null))),Ke.default.createElement(c,null,Ke.default.createElement(u,{mobile:12,desktop:12},Ke.default.createElement(l,null)))))}}var core_components=()=>({components:{App:_a,authorizationPopup:AuthorizationPopup,authorizeBtn:AuthorizeBtn,AuthorizeBtnContainer,authorizeOperationBtn:AuthorizeOperationBtn,auths:Auths,AuthItem:auth_item_Auths,authError:AuthError,oauth2:Oauth2,apiKeyAuth:ApiKeyAuth,basicAuth:BasicAuth,clear:Clear,liveResponse:LiveResponse,InitializedInput,info:Oa,InfoContainer,InfoUrl,InfoBasePath,Contact:ka,License:Na,JumpToPath,CopyToClipboardBtn,onlineValidatorBadge:OnlineValidatorBadge,operations:Operations,operation:Operation,OperationSummary,OperationSummaryMethod,OperationSummaryPath,responses:Responses,response:Response,ResponseExtension:response_extension,responseBody:ResponseBody,parameters:Parameters,parameterRow:ParameterRow,execute:Execute,headers:headers_Headers,errors:Errors,contentType:ContentType,overview:Overview,footer:Footer,FilterContainer,ParamBody,curl:Curl,Property:property,TryItOutButton,Markdown:Ba,BaseLayout,VersionPragmaFilter,VersionStamp:version_stamp,OperationExt:operation_extensions,OperationExtRow:operation_extension_row,ParameterExt:parameter_extension,ParameterIncludeEmpty,OperationTag,OperationContainer,OpenAPIVersion:openapi_version,DeepLink:deep_link,SvgAssets:svg_assets,Example,ExamplesSelect,ExamplesSelectValueRetainer}});var form_components=()=>({components:{...Le}});var base=()=>[configsPlugin,util,logs,view,view_legacy,plugins_spec,err,icons,plugins_layout,json_schema_5,json_schema_5_samples,core_components,form_components,swagger_client,auth,downloadUrlPlugin,deep_linking,filter,on_complete,plugins_request_snippets,syntax_highlighting,versions,safe_render()];const ja=(0,Fe.Map)();function onlyOAS3(e){return(t,r)=>(...n)=>{if(r.getSystem().specSelectors.isOAS3()){const t=e(...n);return\"function\"==typeof t?t(r):t}return t(...n)}}const Pa=onlyOAS3((0,Mr.default)(null)),Ma=onlyOAS3(((e,t)=>e=>e.getSystem().specSelectors.findSchema(t))),qa=onlyOAS3((()=>e=>{const t=e.getSystem().specSelectors.specJson().getIn([\"components\",\"schemas\"]);return Fe.Map.isMap(t)?t:ja})),La=onlyOAS3((()=>e=>e.getSystem().specSelectors.specJson().hasIn([\"servers\",0]))),Da=onlyOAS3((0,Bt.createSelector)(zr,(e=>e.getIn([\"components\",\"securitySchemes\"])||null))),wrap_selectors_validOperationMethods=(e,t)=>(r,...n)=>t.specSelectors.isOAS3()?t.oas3Selectors.validOperationMethods():e(...n),Ua=Pa,$a=Pa,Ja=Pa,Va=Pa,Ka=Pa;const za=function wrap_selectors_onlyOAS3(e){return(t,r)=>(...n)=>{if(r.getSystem().specSelectors.isOAS3()){let t=r.getState().getIn([\"spec\",\"resolvedSubtrees\",\"components\",\"securitySchemes\"]);return e(r,t,...n)}return t(...n)}}((0,Bt.createSelector)((e=>e),(({specSelectors:e})=>e.securityDefinitions()),((e,t)=>{let r=(0,Fe.List)();return t?(t.entrySeq().forEach((([e,t])=>{const n=t.get(\"type\");if(\"oauth2\"===n&&t.get(\"flows\").entrySeq().forEach((([n,a])=>{let o=(0,Fe.fromJS)({flow:n,authorizationUrl:a.get(\"authorizationUrl\"),tokenUrl:a.get(\"tokenUrl\"),scopes:a.get(\"scopes\"),type:t.get(\"type\"),description:t.get(\"description\")});r=r.push(new Fe.Map({[e]:o.filter((e=>void 0!==e))}))})),\"http\"!==n&&\"apiKey\"!==n||(r=r.push(new Fe.Map({[e]:t}))),\"openIdConnect\"===n&&t.get(\"openIdConnectData\")){let n=t.get(\"openIdConnectData\");(n.get(\"grant_types_supported\")||[\"authorization_code\",\"implicit\"]).forEach((a=>{let o=n.get(\"scopes_supported\")&&n.get(\"scopes_supported\").reduce(((e,t)=>e.set(t,\"\")),new Fe.Map),s=(0,Fe.fromJS)({flow:a,authorizationUrl:n.get(\"authorization_endpoint\"),tokenUrl:n.get(\"token_endpoint\"),scopes:o,type:\"oauth2\",openIdConnectUrl:t.get(\"openIdConnectUrl\")});r=r.push(new Fe.Map({[e]:s.filter((e=>void 0!==e))}))}))}})),r):r})));function OAS3ComponentWrapFactory(e){return(t,r)=>n=>\"function\"==typeof r.specSelectors?.isOAS3?r.specSelectors.isOAS3()?Ke.default.createElement(e,(0,nr.default)({},n,r,{Ori:t})):Ke.default.createElement(t,n):(console.warn(\"OAS3 wrapper: couldn't get spec\"),null)}const Fa=(0,Fe.Map)(),selectors_isSwagger2=()=>e=>function isSwagger2(e){const t=e.get(\"swagger\");return\"string\"==typeof t&&\"2.0\"===t}(e.getSystem().specSelectors.specJson()),selectors_isOAS30=()=>e=>function isOAS30(e){const t=e.get(\"openapi\");return\"string\"==typeof t&&/^3\\.0\\.([0123])(?:-rc[012])?$/.test(t)}(e.getSystem().specSelectors.specJson()),selectors_isOAS3=()=>e=>e.getSystem().specSelectors.isOAS30();function selectors_onlyOAS3(e){return(t,...r)=>n=>{if(n.specSelectors.isOAS3()){const a=e(t,...r);return\"function\"==typeof a?a(n):a}return null}}const Wa=selectors_onlyOAS3((()=>e=>e.specSelectors.specJson().get(\"servers\",Fa))),findSchema=(e,t)=>{const r=e.getIn([\"resolvedSubtrees\",\"components\",\"schemas\",t],null),n=e.getIn([\"json\",\"components\",\"schemas\",t],null);return r||n||null},Ha=selectors_onlyOAS3(((e,{callbacks:t,specPath:r})=>e=>{const n=e.specSelectors.validOperationMethods();return Fe.Map.isMap(t)?t.reduce(((e,t,a)=>{if(!Fe.Map.isMap(t))return e;const o=t.reduce(((e,t,o)=>{if(!Fe.Map.isMap(t))return e;const s=t.entrySeq().filter((([e])=>n.includes(e))).map((([e,t])=>({operation:(0,Fe.Map)({operation:t}),method:e,path:o,callbackName:a,specPath:r.concat([a,o,e])})));return e.concat(s)}),(0,Fe.List)());return e.concat(o)}),(0,Fe.List)()).groupBy((e=>e.callbackName)).map((e=>e.toArray())).toObject():{}}));var callbacks=({callbacks:e,specPath:t,specSelectors:r,getComponent:n})=>{const a=r.callbacksOperations({callbacks:e,specPath:t}),o=Object.keys(a),s=n(\"OperationContainer\",!0);return 0===o.length?Ke.default.createElement(\"span\",null,\"No callbacks\"):Ke.default.createElement(\"div\",null,o.map((e=>Ke.default.createElement(\"div\",{key:`${e}`},Ke.default.createElement(\"h2\",null,e),a[e].map((t=>Ke.default.createElement(s,{key:`${e}-${t.path}-${t.method}`,op:t.operation,tag:\"callbacks\",method:t.method,path:t.path,specPath:t.specPath,allowTryItOut:!1})))))))};const getDefaultRequestBodyValue=(e,t,r,n)=>{const a=e.getIn([\"content\",t])??(0,Fe.OrderedMap)(),o=a.get(\"schema\",(0,Fe.OrderedMap)()).toJS(),s=void 0!==a.get(\"examples\"),l=a.get(\"example\"),i=s?a.getIn([\"examples\",r,\"value\"]):l;return stringify(n.getSampleSchema(o,t,{includeWriteOnly:!0},i))};var request_body=({userHasEditedBody:e,requestBody:t,requestBodyValue:r,requestBodyInclusionSetting:n,requestBodyErrors:a,getComponent:o,getConfigs:s,specSelectors:l,fn:i,contentType:c,isExecute:u,specPath:d,onChange:p,onChangeIncludeEmpty:m,activeExamplesKey:f,updateActiveExamplesKey:h,setRetainRequestBodyValueFlag:g})=>{const handleFile=e=>{p(e.target.files[0])},setIsIncludedOptions=e=>{let t={key:e,shouldDispatchInit:!1,defaultValue:!0};return\"no value\"===n.get(e,\"no value\")&&(t.shouldDispatchInit=!0),t},y=o(\"Markdown\",!0),S=o(\"modelExample\"),_=o(\"RequestBodyEditor\"),v=o(\"HighlightCode\",!0),b=o(\"ExamplesSelectValueRetainer\"),w=o(\"Example\"),C=o(\"ParameterIncludeEmpty\"),{showCommonExtensions:x}=s(),O=t?.get(\"description\")??null,k=t?.get(\"content\")??new Fe.OrderedMap;c=c||k.keySeq().first()||\"\";const N=k.get(c)??(0,Fe.OrderedMap)(),A=N.get(\"schema\",(0,Fe.OrderedMap)()),I=N.get(\"examples\",null),R=I?.map(((e,r)=>{const n=e?.get(\"value\",null);return n&&(e=e.set(\"value\",getDefaultRequestBodyValue(t,c,r,i),n)),e}));if(a=Fe.List.isList(a)?a:(0,Fe.List)(),!N.size)return null;const T=\"object\"===N.getIn([\"schema\",\"type\"]),B=\"binary\"===N.getIn([\"schema\",\"format\"]),j=\"base64\"===N.getIn([\"schema\",\"format\"]);if(\"application/octet-stream\"===c||0===c.indexOf(\"image/\")||0===c.indexOf(\"audio/\")||0===c.indexOf(\"video/\")||B||j){const e=o(\"Input\");return u?Ke.default.createElement(e,{type:\"file\",onChange:handleFile}):Ke.default.createElement(\"i\",null,\"Example values are not available for \",Ke.default.createElement(\"code\",null,c),\" media types.\")}if(T&&(\"application/x-www-form-urlencoded\"===c||0===c.indexOf(\"multipart/\"))&&A.get(\"properties\",(0,Fe.OrderedMap)()).size>0){const e=o(\"JsonSchemaForm\"),t=o(\"ParameterExt\"),s=A.get(\"properties\",(0,Fe.OrderedMap)());return r=Fe.Map.isMap(r)?r:(0,Fe.OrderedMap)(),Ke.default.createElement(\"div\",{className:\"table-container\"},O&&Ke.default.createElement(y,{source:O}),Ke.default.createElement(\"table\",null,Ke.default.createElement(\"tbody\",null,Fe.Map.isMap(s)&&s.entrySeq().map((([s,l])=>{if(l.get(\"readOnly\"))return;const c=l.get(\"oneOf\")?.get(0)?.toJS(),d=l.get(\"anyOf\")?.get(0)?.toJS();l=(0,Fe.fromJS)(i.mergeJsonSchema(l.toJS(),c??d??{}));let f=x?getCommonExtensions(l):null;const h=A.get(\"required\",(0,Fe.List)()).includes(s),g=l.get(\"type\"),S=l.get(\"format\"),_=l.get(\"description\"),v=r.getIn([s,\"value\"]),b=r.getIn([s,\"errors\"])||a,w=n.get(s)||!1;let O=i.getSampleSchema(l,!1,{includeWriteOnly:!0});!1===O&&(O=\"false\"),0===O&&(O=\"0\"),\"string\"!=typeof O&&\"object\"===g&&(O=stringify(O)),\"string\"==typeof O&&\"array\"===g&&(O=JSON.parse(O));const k=\"string\"===g&&(\"binary\"===S||\"base64\"===S);return Ke.default.createElement(\"tr\",{key:s,className:\"parameters\",\"data-property-name\":s},Ke.default.createElement(\"td\",{className:\"parameters-col_name\"},Ke.default.createElement(\"div\",{className:h?\"parameter__name required\":\"parameter__name\"},s,h?Ke.default.createElement(\"span\",null,\" *\"):null),Ke.default.createElement(\"div\",{className:\"parameter__type\"},g,S&&Ke.default.createElement(\"span\",{className:\"prop-format\"},\"($\",S,\")\"),x&&f.size?f.entrySeq().map((([e,r])=>Ke.default.createElement(t,{key:`${e}-${r}`,xKey:e,xVal:r}))):null),Ke.default.createElement(\"div\",{className:\"parameter__deprecated\"},l.get(\"deprecated\")?\"deprecated\":null)),Ke.default.createElement(\"td\",{className:\"parameters-col_description\"},Ke.default.createElement(y,{source:_}),u?Ke.default.createElement(\"div\",null,Ke.default.createElement(e,{fn:i,dispatchInitialValue:!k,schema:l,description:s,getComponent:o,value:void 0===v?O:v,required:h,errors:b,onChange:e=>{p(e,[s])}}),h?null:Ke.default.createElement(C,{onChange:e=>m(s,e),isIncluded:w,isIncludedOptions:setIsIncludedOptions(s),isDisabled:Array.isArray(v)?0!==v.length:!isEmptyValue(v)})):null))})))))}const P=getDefaultRequestBodyValue(t,c,f,i);let M=null;return getKnownSyntaxHighlighterLanguage(P)&&(M=\"json\"),Ke.default.createElement(\"div\",null,O&&Ke.default.createElement(y,{source:O}),R?Ke.default.createElement(b,{userHasEditedBody:e,examples:R,currentKey:f,currentUserInputValue:r,onSelect:e=>{h(e)},updateValue:p,defaultToFirstExample:!0,getComponent:o,setRetainRequestBodyValueFlag:g}):null,u?Ke.default.createElement(\"div\",null,Ke.default.createElement(_,{value:r,errors:a,defaultValue:P,onChange:p,getComponent:o})):Ke.default.createElement(S,{getComponent:o,getConfigs:s,specSelectors:l,expandDepth:1,isExecute:u,schema:N.get(\"schema\"),specPath:d.push(\"content\",c),example:Ke.default.createElement(v,{className:\"body-param__example\",language:M},stringify(r)||P),includeWriteOnly:!0}),R?Ke.default.createElement(w,{example:R.get(f),getComponent:o,getConfigs:s}):null)};class operation_link_OperationLink extends Ke.Component{render(){const{link:e,name:t,getComponent:r}=this.props,n=r(\"Markdown\",!0);let a=e.get(\"operationId\")||e.get(\"operationRef\"),o=e.get(\"parameters\")&&e.get(\"parameters\").toJS(),s=e.get(\"description\");return Ke.default.createElement(\"div\",{className:\"operation-link\"},Ke.default.createElement(\"div\",{className:\"description\"},Ke.default.createElement(\"b\",null,Ke.default.createElement(\"code\",null,t)),s?Ke.default.createElement(n,{source:s}):null),Ke.default.createElement(\"pre\",null,\"Operation `\",a,\"`\",Ke.default.createElement(\"br\",null),Ke.default.createElement(\"br\",null),\"Parameters \",function padString(e,t){if(\"string\"!=typeof t)return\"\";return t.split(\"\\n\").map(((t,r)=>r>0?Array(e+1).join(\" \")+t:t)).join(\"\\n\")}(0,JSON.stringify(o,null,2))||\"{}\",Ke.default.createElement(\"br\",null)))}}var Ga=operation_link_OperationLink;var components_servers=({servers:e,currentServer:t,setSelectedServer:r,setServerVariableValue:n,getServerVariable:a,getEffectiveServerValue:o})=>{const s=(e.find((e=>e.get(\"url\")===t))||(0,Fe.OrderedMap)()).get(\"variables\")||(0,Fe.OrderedMap)(),l=0!==s.size;(0,Ke.useEffect)((()=>{t||r(e.first()?.get(\"url\"))}),[]),(0,Ke.useEffect)((()=>{const a=e.find((e=>e.get(\"url\")===t));if(!a)return void r(e.first().get(\"url\"));(a.get(\"variables\")||(0,Fe.OrderedMap)()).map(((e,r)=>{n({server:t,key:r,val:e.get(\"default\")||\"\"})}))}),[t,e]);const i=(0,Ke.useCallback)((e=>{r(e.target.value)}),[r]),c=(0,Ke.useCallback)((e=>{const r=e.target.getAttribute(\"data-variable\"),a=e.target.value;n({server:t,key:r,val:a})}),[n,t]);return Ke.default.createElement(\"div\",{className:\"servers\"},Ke.default.createElement(\"label\",{htmlFor:\"servers\"},Ke.default.createElement(\"select\",{onChange:i,value:t,id:\"servers\"},e.valueSeq().map((e=>Ke.default.createElement(\"option\",{value:e.get(\"url\"),key:e.get(\"url\")},e.get(\"url\"),e.get(\"description\")&&` - ${e.get(\"description\")}`))).toArray())),l&&Ke.default.createElement(\"div\",null,Ke.default.createElement(\"div\",{className:\"computed-url\"},\"Computed URL:\",Ke.default.createElement(\"code\",null,o(t))),Ke.default.createElement(\"h4\",null,\"Server variables\"),Ke.default.createElement(\"table\",null,Ke.default.createElement(\"tbody\",null,s.entrySeq().map((([e,r])=>Ke.default.createElement(\"tr\",{key:e},Ke.default.createElement(\"td\",null,e),Ke.default.createElement(\"td\",null,r.get(\"enum\")?Ke.default.createElement(\"select\",{\"data-variable\":e,onChange:c},r.get(\"enum\").map((r=>Ke.default.createElement(\"option\",{selected:r===a(t,e),key:r,value:r},r)))):Ke.default.createElement(\"input\",{type:\"text\",value:a(t,e)||\"\",onChange:c,\"data-variable\":e})))))))))};class ServersContainer extends Ke.default.Component{render(){const{specSelectors:e,oas3Selectors:t,oas3Actions:r,getComponent:n}=this.props,a=e.servers(),o=n(\"Servers\");return a&&a.size?Ke.default.createElement(\"div\",null,Ke.default.createElement(\"span\",{className:\"servers-title\"},\"Servers\"),Ke.default.createElement(o,{servers:a,currentServer:t.selectedServer(),setSelectedServer:r.setSelectedServer,setServerVariableValue:r.setServerVariableValue,getServerVariable:t.serverVariableValue,getEffectiveServerValue:t.serverEffectiveValue})):null}}const Xa=Function.prototype;class RequestBodyEditor extends Ke.PureComponent{static defaultProps={onChange:Xa,userHasEditedBody:!1};constructor(e,t){super(e,t),this.state={value:stringify(e.value)||e.defaultValue},e.onChange(e.value)}applyDefaultValue=e=>{const{onChange:t,defaultValue:r}=e||this.props;return this.setState({value:r}),t(r)};onChange=e=>{this.props.onChange(stringify(e))};onDomChange=e=>{const t=e.target.value;this.setState({value:t},(()=>this.onChange(t)))};UNSAFE_componentWillReceiveProps(e){this.props.value!==e.value&&e.value!==this.state.value&&this.setState({value:stringify(e.value)}),!e.value&&e.defaultValue&&this.state.value&&this.applyDefaultValue(e)}render(){let{getComponent:e,errors:t}=this.props,{value:r}=this.state,n=t.size>0;const a=e(\"TextArea\");return Ke.default.createElement(\"div\",{className:\"body-param\"},Ke.default.createElement(a,{className:(0,fr.default)(\"body-param__text\",{invalid:n}),title:t.size?t.join(\", \"):\"\",value:r,onChange:this.onDomChange}))}}class HttpAuth extends Ke.default.Component{constructor(e,t){super(e,t);let{name:r,schema:n}=this.props,a=this.getValue();this.state={name:r,schema:n,value:a}}getValue(){let{name:e,authorized:t}=this.props;return t&&t.getIn([e,\"value\"])}onChange=e=>{let{onChange:t}=this.props,{value:r,name:n}=e.target,a=Object.assign({},this.state.value);n?a[n]=r:a=r,this.setState({value:a},(()=>t(this.state)))};render(){let{schema:e,getComponent:t,errSelectors:r,name:n}=this.props;const a=t(\"Input\"),o=t(\"Row\"),s=t(\"Col\"),l=t(\"authError\"),i=t(\"Markdown\",!0),c=t(\"JumpToPath\",!0),u=(e.get(\"scheme\")||\"\").toLowerCase();let d=this.getValue(),p=r.allErrors().filter((e=>e.get(\"authId\")===n));if(\"basic\"===u){let t=d?d.get(\"username\"):null;return Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h4\",null,Ke.default.createElement(\"code\",null,n||e.get(\"name\")),\"  (http, Basic)\",Ke.default.createElement(c,{path:[\"securityDefinitions\",n]})),t&&Ke.default.createElement(\"h6\",null,\"Authorized\"),Ke.default.createElement(o,null,Ke.default.createElement(i,{source:e.get(\"description\")})),Ke.default.createElement(o,null,Ke.default.createElement(\"label\",{htmlFor:\"auth-basic-username\"},\"Username:\"),t?Ke.default.createElement(\"code\",null,\" \",t,\" \"):Ke.default.createElement(s,null,Ke.default.createElement(a,{id:\"auth-basic-username\",type:\"text\",required:\"required\",name:\"username\",\"aria-label\":\"auth-basic-username\",onChange:this.onChange,autoFocus:!0}))),Ke.default.createElement(o,null,Ke.default.createElement(\"label\",{htmlFor:\"auth-basic-password\"},\"Password:\"),t?Ke.default.createElement(\"code\",null,\" ****** \"):Ke.default.createElement(s,null,Ke.default.createElement(a,{id:\"auth-basic-password\",autoComplete:\"new-password\",name:\"password\",type:\"password\",\"aria-label\":\"auth-basic-password\",onChange:this.onChange}))),p.valueSeq().map(((e,t)=>Ke.default.createElement(l,{error:e,key:t}))))}return\"bearer\"===u?Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h4\",null,Ke.default.createElement(\"code\",null,n||e.get(\"name\")),\"  (http, Bearer)\",Ke.default.createElement(c,{path:[\"securityDefinitions\",n]})),d&&Ke.default.createElement(\"h6\",null,\"Authorized\"),Ke.default.createElement(o,null,Ke.default.createElement(i,{source:e.get(\"description\")})),Ke.default.createElement(o,null,Ke.default.createElement(\"label\",{htmlFor:\"auth-bearer-value\"},\"Value:\"),d?Ke.default.createElement(\"code\",null,\" ****** \"):Ke.default.createElement(s,null,Ke.default.createElement(a,{id:\"auth-bearer-value\",type:\"text\",\"aria-label\":\"auth-bearer-value\",onChange:this.onChange,autoFocus:!0}))),p.valueSeq().map(((e,t)=>Ke.default.createElement(l,{error:e,key:t})))):Ke.default.createElement(\"div\",null,Ke.default.createElement(\"em\",null,Ke.default.createElement(\"b\",null,n),\" HTTP authentication: unsupported scheme \",`'${u}'`))}}class OperationServers extends Ke.default.Component{setSelectedServer=e=>{const{path:t,method:r}=this.props;return this.forceUpdate(),this.props.setSelectedServer(e,`${t}:${r}`)};setServerVariableValue=e=>{const{path:t,method:r}=this.props;return this.forceUpdate(),this.props.setServerVariableValue({...e,namespace:`${t}:${r}`})};getSelectedServer=()=>{const{path:e,method:t}=this.props;return this.props.getSelectedServer(`${e}:${t}`)};getServerVariable=(e,t)=>{const{path:r,method:n}=this.props;return this.props.getServerVariable({namespace:`${r}:${n}`,server:e},t)};getEffectiveServerValue=e=>{const{path:t,method:r}=this.props;return this.props.getEffectiveServerValue({server:e,namespace:`${t}:${r}`})};render(){const{operationServers:e,pathServers:t,getComponent:r}=this.props;if(!e&&!t)return null;const n=r(\"Servers\"),a=e||t,o=e?\"operation\":\"path\";return Ke.default.createElement(\"div\",{className:\"opblock-section operation-servers\"},Ke.default.createElement(\"div\",{className:\"opblock-section-header\"},Ke.default.createElement(\"div\",{className:\"tab-header\"},Ke.default.createElement(\"h4\",{className:\"opblock-title\"},\"Servers\"))),Ke.default.createElement(\"div\",{className:\"opblock-description-wrapper\"},Ke.default.createElement(\"h4\",{className:\"message\"},\"These \",o,\"-level options override the global server options.\"),Ke.default.createElement(n,{servers:a,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}var Ya={Callbacks:callbacks,HttpAuth,RequestBody:request_body,Servers:components_servers,ServersContainer,RequestBodyEditor,OperationServers,operationLink:Ga};const Qa=new Ia.Remarkable(\"commonmark\");Qa.block.ruler.enable([\"table\"]),Qa.set({linkTarget:\"_blank\"});var Za=OAS3ComponentWrapFactory((({source:e,className:t=\"\",getConfigs:r=(()=>({useUnsafeMarkdown:!1}))})=>{if(\"string\"!=typeof e)return null;if(e){const{useUnsafeMarkdown:n}=r(),a=sanitizer(Qa.render(e),{useUnsafeMarkdown:n});let o;return\"string\"==typeof a&&(o=a.trim()),Ke.default.createElement(\"div\",{dangerouslySetInnerHTML:{__html:o},className:(0,fr.default)(t,\"renderedMarkdown\")})}return null})),eo=OAS3ComponentWrapFactory((({Ori:e,...t})=>{const{schema:r,getComponent:n,errSelectors:a,authorized:o,onAuthChange:s,name:l}=t,i=n(\"HttpAuth\");return\"http\"===r.get(\"type\")?Ke.default.createElement(i,{key:l,schema:r,name:l,errSelectors:a,authorized:o,getComponent:n,onChange:s}):Ke.default.createElement(e,t)})),to=OAS3ComponentWrapFactory(OnlineValidatorBadge);class ModelComponent extends Ke.Component{render(){let{getConfigs:e,schema:t,Ori:r}=this.props,n=[\"model-box\"],a=null;return!0===t.get(\"deprecated\")&&(n.push(\"deprecated\"),a=Ke.default.createElement(\"span\",{className:\"model-deprecated-warning\"},\"Deprecated:\")),Ke.default.createElement(\"div\",{className:n.join(\" \")},a,Ke.default.createElement(r,(0,nr.default)({},this.props,{getConfigs:e,depth:1,expandDepth:this.props.expandDepth||0})))}}var ro=OAS3ComponentWrapFactory(ModelComponent),no=OAS3ComponentWrapFactory((({Ori:e,...t})=>{const{schema:r,getComponent:n,errors:a,onChange:o}=t,s=r&&r.get?r.get(\"format\"):null,l=r&&r.get?r.get(\"type\"):null,i=n(\"Input\");return l&&\"string\"===l&&s&&(\"binary\"===s||\"base64\"===s)?Ke.default.createElement(i,{type:\"file\",className:a.length?\"invalid\":\"\",title:a.length?a:\"\",onChange:e=>{o(e.target.files[0])},disabled:e.isDisabled}):Ke.default.createElement(e,t)})),ao={Markdown:Za,AuthItem:eo,OpenAPIVersion:function OAS30ComponentWrapFactory(e){return(t,r)=>n=>\"function\"==typeof r.specSelectors?.isOAS30?r.specSelectors.isOAS30()?Ke.default.createElement(e,(0,nr.default)({},n,r,{Ori:t})):Ke.default.createElement(t,n):(console.warn(\"OAS30 wrapper: couldn't get spec\"),null)}((e=>{const{Ori:t}=e;return Ke.default.createElement(t,{oasVersion:\"3.0\"})})),JsonSchema_string:no,model:ro,onlineValidatorBadge:to};const oo=\"oas3_set_servers\",so=\"oas3_set_request_body_value\",lo=\"oas3_set_request_body_retain_flag\",io=\"oas3_set_request_body_inclusion\",co=\"oas3_set_active_examples_member\",uo=\"oas3_set_request_content_type\",po=\"oas3_set_response_content_type\",mo=\"oas3_set_server_variable_value\",fo=\"oas3_set_request_body_validate_error\",ho=\"oas3_clear_request_body_validate_error\",go=\"oas3_clear_request_body_value\";function setSelectedServer(e,t){return{type:oo,payload:{selectedServerUrl:e,namespace:t}}}function setRequestBodyValue({value:e,pathMethod:t}){return{type:so,payload:{value:e,pathMethod:t}}}const setRetainRequestBodyValueFlag=({value:e,pathMethod:t})=>({type:lo,payload:{value:e,pathMethod:t}});function setRequestBodyInclusion({value:e,pathMethod:t,name:r}){return{type:io,payload:{value:e,pathMethod:t,name:r}}}function setActiveExamplesMember({name:e,pathMethod:t,contextType:r,contextName:n}){return{type:co,payload:{name:e,pathMethod:t,contextType:r,contextName:n}}}function setRequestContentType({value:e,pathMethod:t}){return{type:uo,payload:{value:e,pathMethod:t}}}function setResponseContentType({value:e,path:t,method:r}){return{type:po,payload:{value:e,path:t,method:r}}}function setServerVariableValue({server:e,namespace:t,key:r,val:n}){return{type:mo,payload:{server:e,namespace:t,key:r,val:n}}}const setRequestBodyValidateError=({path:e,method:t,validationErrors:r})=>({type:fo,payload:{path:e,method:t,validationErrors:r}}),clearRequestBodyValidateError=({path:e,method:t})=>({type:ho,payload:{path:e,method:t}}),initRequestBodyValidateError=({pathMethod:e})=>({type:ho,payload:{path:e[0],method:e[1]}}),clearRequestBodyValue=({pathMethod:e})=>({type:go,payload:{pathMethod:e}});var yo=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return _e.default}});const oas3_selectors_onlyOAS3=e=>(t,...r)=>n=>{if(n.getSystem().specSelectors.isOAS3()){const a=e(t,...r);return\"function\"==typeof a?a(n):a}return null};const Eo=oas3_selectors_onlyOAS3(((e,t)=>{const r=t?[t,\"selectedServer\"]:[\"selectedServer\"];return e.getIn(r)||\"\"})),So=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"bodyValue\"])||null)),_o=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"retainBodyValue\"])||!1)),selectDefaultRequestBodyValue=(e,t,r)=>e=>{const{oas3Selectors:n,specSelectors:a,fn:o}=e.getSystem();if(a.isOAS3()){const e=n.requestContentType(t,r);if(e)return getDefaultRequestBodyValue(a.specResolvedSubtree([\"paths\",t,r,\"requestBody\"]),e,n.activeExamplesMember(t,r,\"requestBody\",\"requestBody\"),o)}return null},vo=oas3_selectors_onlyOAS3(((e,t,r)=>e=>{const{oas3Selectors:n,specSelectors:a,fn:o}=e;let s=!1;const l=n.requestContentType(t,r);let i=n.requestBodyValue(t,r);const c=a.specResolvedSubtree([\"paths\",t,r,\"requestBody\"]);if(!c)return!1;if(Fe.Map.isMap(i)&&(i=stringify(i.mapEntries((e=>Fe.Map.isMap(e[1])?[e[0],e[1].get(\"value\")]:e)).toJS())),Fe.List.isList(i)&&(i=stringify(i)),l){const e=getDefaultRequestBodyValue(c,l,n.activeExamplesMember(t,r,\"requestBody\",\"requestBody\"),o);s=!!i&&i!==e}return s})),bo=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"bodyInclusion\"])||(0,Fe.Map)())),wo=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"errors\"])||null)),Co=oas3_selectors_onlyOAS3(((e,t,r,n,a)=>e.getIn([\"examples\",t,r,n,a,\"activeExample\"])||null)),xo=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"requestContentType\"])||null)),Oo=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"responseContentType\"])||null)),ko=oas3_selectors_onlyOAS3(((e,t,r)=>{let n;if(\"string\"!=typeof t){const{server:e,namespace:a}=t;n=a?[a,\"serverVariableValues\",e,r]:[\"serverVariableValues\",e,r]}else{n=[\"serverVariableValues\",t,r]}return e.getIn(n)||null})),No=oas3_selectors_onlyOAS3(((e,t)=>{let r;if(\"string\"!=typeof t){const{server:e,namespace:n}=t;r=n?[n,\"serverVariableValues\",e]:[\"serverVariableValues\",e]}else{r=[\"serverVariableValues\",t]}return e.getIn(r)||(0,Fe.OrderedMap)()})),Ao=oas3_selectors_onlyOAS3(((e,t)=>{var r,n;if(\"string\"!=typeof t){const{server:a,namespace:o}=t;n=a,r=o?e.getIn([o,\"serverVariableValues\",n]):e.getIn([\"serverVariableValues\",n])}else n=t,r=e.getIn([\"serverVariableValues\",n]);r=r||(0,Fe.OrderedMap)();let a=n;return r.map(((e,t)=>{a=a.replace(new RegExp(`{${(0,yo.default)(t)}}`,\"g\"),e)})),a})),Io=function validateRequestBodyIsRequired(e){return(...t)=>r=>{const n=r.getSystem().specSelectors.specJson();let a=[...t][1]||[];return!n.getIn([\"paths\",...a,\"requestBody\",\"required\"])||e(...t)}}(((e,t)=>((e,t)=>(t=t||[],!!e.getIn([\"requestData\",...t,\"bodyValue\"])))(e,t))),validateShallowRequired=(e,{oas3RequiredRequestBodyContentType:t,oas3RequestContentType:r,oas3RequestBodyValue:n})=>{let a=[];if(!Fe.Map.isMap(n))return a;let o=[];return Object.keys(t.requestContentType).forEach((e=>{if(e===r){t.requestContentType[e].forEach((e=>{o.indexOf(e)<0&&o.push(e)}))}})),o.forEach((e=>{n.getIn([e,\"value\"])||a.push(e)})),a},Ro=(0,Mr.default)([\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"]);var To={[oo]:(e,{payload:{selectedServerUrl:t,namespace:r}})=>{const n=r?[r,\"selectedServer\"]:[\"selectedServer\"];return e.setIn(n,t)},[so]:(e,{payload:{value:t,pathMethod:r}})=>{let[n,a]=r;if(!Fe.Map.isMap(t))return e.setIn([\"requestData\",n,a,\"bodyValue\"],t);let o,s=e.getIn([\"requestData\",n,a,\"bodyValue\"])||(0,Fe.Map)();Fe.Map.isMap(s)||(s=(0,Fe.Map)());const[...l]=t.keys();return l.forEach((e=>{let r=t.getIn([e]);s.has(e)&&Fe.Map.isMap(r)||(o=s.setIn([e,\"value\"],r))})),e.setIn([\"requestData\",n,a,\"bodyValue\"],o)},[lo]:(e,{payload:{value:t,pathMethod:r}})=>{let[n,a]=r;return e.setIn([\"requestData\",n,a,\"retainBodyValue\"],t)},[io]:(e,{payload:{value:t,pathMethod:r,name:n}})=>{let[a,o]=r;return e.setIn([\"requestData\",a,o,\"bodyInclusion\",n],t)},[co]:(e,{payload:{name:t,pathMethod:r,contextType:n,contextName:a}})=>{let[o,s]=r;return e.setIn([\"examples\",o,s,n,a,\"activeExample\"],t)},[uo]:(e,{payload:{value:t,pathMethod:r}})=>{let[n,a]=r;return e.setIn([\"requestData\",n,a,\"requestContentType\"],t)},[po]:(e,{payload:{value:t,path:r,method:n}})=>e.setIn([\"requestData\",r,n,\"responseContentType\"],t),[mo]:(e,{payload:{server:t,namespace:r,key:n,val:a}})=>{const o=r?[r,\"serverVariableValues\",t,n]:[\"serverVariableValues\",t,n];return e.setIn(o,a)},[fo]:(e,{payload:{path:t,method:r,validationErrors:n}})=>{let a=[];if(a.push(\"Required field is not provided\"),n.missingBodyValue)return e.setIn([\"requestData\",t,r,\"errors\"],(0,Fe.fromJS)(a));if(n.missingRequiredKeys&&n.missingRequiredKeys.length>0){const{missingRequiredKeys:o}=n;return e.updateIn([\"requestData\",t,r,\"bodyValue\"],(0,Fe.fromJS)({}),(e=>o.reduce(((e,t)=>e.setIn([t,\"errors\"],(0,Fe.fromJS)(a))),e)))}return console.warn(\"unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR\"),e},[ho]:(e,{payload:{path:t,method:r}})=>{const n=e.getIn([\"requestData\",t,r,\"bodyValue\"]);if(!Fe.Map.isMap(n))return e.setIn([\"requestData\",t,r,\"errors\"],(0,Fe.fromJS)([]));const[...a]=n.keys();return a?e.updateIn([\"requestData\",t,r,\"bodyValue\"],(0,Fe.fromJS)({}),(e=>a.reduce(((e,t)=>e.setIn([t,\"errors\"],(0,Fe.fromJS)([]))),e))):e},[go]:(e,{payload:{pathMethod:t}})=>{let[r,n]=t;const a=e.getIn([\"requestData\",r,n,\"bodyValue\"]);return a?Fe.Map.isMap(a)?e.setIn([\"requestData\",r,n,\"bodyValue\"],(0,Fe.Map)()):e.setIn([\"requestData\",r,n,\"bodyValue\"],\"\"):e}};function oas3(){return{components:Ya,wrapComponents:ao,statePlugins:{spec:{wrapSelectors:De,selectors:$e},auth:{wrapSelectors:Ue},oas3:{actions:{...Je},reducers:To,selectors:{...Ve}}}}}var webhooks=({specSelectors:e,getComponent:t})=>{const r=e.selectWebhooksOperations(),n=Object.keys(r),a=t(\"OperationContainer\",!0);return 0===n.length?null:Ke.default.createElement(\"div\",{className:\"webhooks\"},Ke.default.createElement(\"h2\",null,\"Webhooks\"),n.map((e=>Ke.default.createElement(\"div\",{key:`${e}-webhook`},r[e].map((t=>Ke.default.createElement(a,{key:`${e}-${t.method}-webhook`,op:t.operation,tag:\"webhooks\",method:t.method,path:e,specPath:(0,Fe.List)(t.specPath),allowTryItOut:!1})))))))};var components_license=({getComponent:e,specSelectors:t})=>{const r=t.selectLicenseNameField(),n=t.selectLicenseUrl(),a=e(\"Link\");return Ke.default.createElement(\"div\",{className:\"info__license\"},n?Ke.default.createElement(\"div\",{className:\"info__license__url\"},Ke.default.createElement(a,{target:\"_blank\",href:sanitizeUrl(n)},r)):Ke.default.createElement(\"span\",null,r))};var components_contact=({getComponent:e,specSelectors:t})=>{const r=t.selectContactNameField(),n=t.selectContactUrl(),a=t.selectContactEmailField(),o=e(\"Link\");return Ke.default.createElement(\"div\",{className:\"info__contact\"},n&&Ke.default.createElement(\"div\",null,Ke.default.createElement(o,{href:sanitizeUrl(n),target:\"_blank\"},r,\" - Website\")),a&&Ke.default.createElement(o,{href:sanitizeUrl(`mailto:${a}`)},n?`Send email to ${r}`:`Contact ${r}`))};var oas31_components_info=({getComponent:e,specSelectors:t})=>{const r=t.version(),n=t.url(),a=t.basePath(),o=t.host(),s=t.selectInfoSummaryField(),l=t.selectInfoDescriptionField(),i=t.selectInfoTitleField(),c=t.selectInfoTermsOfServiceUrl(),u=t.selectExternalDocsUrl(),d=t.selectExternalDocsDescriptionField(),p=t.contact(),m=t.license(),f=e(\"Markdown\",!0),h=e(\"Link\"),g=e(\"VersionStamp\"),y=e(\"OpenAPIVersion\"),S=e(\"InfoUrl\"),_=e(\"InfoBasePath\"),v=e(\"License\",!0),b=e(\"Contact\",!0),w=e(\"JsonSchemaDialect\",!0);return Ke.default.createElement(\"div\",{className:\"info\"},Ke.default.createElement(\"hgroup\",{className:\"main\"},Ke.default.createElement(\"h2\",{className:\"title\"},i,Ke.default.createElement(\"span\",null,r&&Ke.default.createElement(g,{version:r}),Ke.default.createElement(y,{oasVersion:\"3.1\"}))),(o||a)&&Ke.default.createElement(_,{host:o,basePath:a}),n&&Ke.default.createElement(S,{getComponent:e,url:n})),s&&Ke.default.createElement(\"p\",{className:\"info__summary\"},s),Ke.default.createElement(\"div\",{className:\"info__description description\"},Ke.default.createElement(f,{source:l})),c&&Ke.default.createElement(\"div\",{className:\"info__tos\"},Ke.default.createElement(h,{target:\"_blank\",href:sanitizeUrl(c)},\"Terms of service\")),p.size>0&&Ke.default.createElement(b,null),m.size>0&&Ke.default.createElement(v,null),u&&Ke.default.createElement(h,{className:\"info__extdocs\",target:\"_blank\",href:sanitizeUrl(u)},d||u),Ke.default.createElement(w,null))};var json_schema_dialect=({getComponent:e,specSelectors:t})=>{const r=t.selectJsonSchemaDialectField(),n=t.selectJsonSchemaDialectDefault(),a=e(\"Link\");return Ke.default.createElement(Ke.default.Fragment,null,r&&r===n&&Ke.default.createElement(\"p\",{className:\"info__jsonschemadialect\"},\"JSON Schema dialect:\",\" \",Ke.default.createElement(a,{target:\"_blank\",href:sanitizeUrl(r)},r)),r&&r!==n&&Ke.default.createElement(\"div\",{className:\"error-wrapper\"},Ke.default.createElement(\"div\",{className:\"no-margin\"},Ke.default.createElement(\"div\",{className:\"errors\"},Ke.default.createElement(\"div\",{className:\"errors-wrapper\"},Ke.default.createElement(\"h4\",{className:\"center\"},\"Warning\"),Ke.default.createElement(\"p\",{className:\"message\"},Ke.default.createElement(\"strong\",null,\"OpenAPI.jsonSchemaDialect\"),\" field contains a value different from the default value of\",\" \",Ke.default.createElement(a,{target:\"_blank\",href:n},n),\". Values different from the default one are currently not supported. Please either omit the field or provide it with the default value.\"))))))};var version_pragma_filter=({bypass:e,isSwagger2:t,isOAS3:r,isOAS31:n,alsoShow:a,children:o})=>e?Ke.default.createElement(\"div\",null,o):t&&(r||n)?Ke.default.createElement(\"div\",{className:\"version-pragma\"},a,Ke.default.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--ambiguous\"},Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h3\",null,\"Unable to render this definition\"),Ke.default.createElement(\"p\",null,Ke.default.createElement(\"code\",null,\"swagger\"),\" and \",Ke.default.createElement(\"code\",null,\"openapi\"),\" fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields.\"),Ke.default.createElement(\"p\",null,\"Supported version fields are \",Ke.default.createElement(\"code\",null,'swagger: \"2.0\"'),\" and those that match \",Ke.default.createElement(\"code\",null,\"openapi: 3.x.y\"),\" (for example,\",\" \",Ke.default.createElement(\"code\",null,\"openapi: 3.1.0\"),\").\")))):t||r||n?Ke.default.createElement(\"div\",null,o):Ke.default.createElement(\"div\",{className:\"version-pragma\"},a,Ke.default.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--missing\"},Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h3\",null,\"Unable to render this definition\"),Ke.default.createElement(\"p\",null,\"The provided definition does not specify a valid version field.\"),Ke.default.createElement(\"p\",null,\"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are \",Ke.default.createElement(\"code\",null,'swagger: \"2.0\"'),\" and those that match \",Ke.default.createElement(\"code\",null,\"openapi: 3.x.y\"),\" (for example,\",\" \",Ke.default.createElement(\"code\",null,\"openapi: 3.1.0\"),\").\"))));const getModelName=e=>\"string\"==typeof e&&e.includes(\"#/components/schemas/\")?(e=>{const t=e.replace(/~1/g,\"/\").replace(/~0/g,\"~\");try{return decodeURIComponent(t)}catch{return t}})(e.replace(/^.*#\\/components\\/schemas\\//,\"\")):null,Bo=(0,Ke.forwardRef)((({schema:e,getComponent:t,onToggle:r=(()=>{})},n)=>{const a=t(\"JSONSchema202012\"),o=getModelName(e.get(\"$$ref\")),s=(0,Ke.useCallback)(((e,t)=>{r(o,t)}),[o,r]);return Ke.default.createElement(a,{name:o,schema:e.toJS(),ref:n,onExpand:s})}));var jo=Bo;var models=({specActions:e,specSelectors:t,layoutSelectors:r,layoutActions:n,getComponent:a,getConfigs:o,fn:s})=>{const l=t.selectSchemas(),i=Object.keys(l).length>0,c=[\"components\",\"schemas\"],{docExpansion:u,defaultModelsExpandDepth:d}=o(),p=d>0&&\"none\"!==u,m=r.isShown(c,p),f=a(\"Collapse\"),h=a(\"JSONSchema202012\"),g=a(\"ArrowUpIcon\"),y=a(\"ArrowDownIcon\"),{getTitle:S}=s.jsonSchema202012.useFn();(0,Ke.useEffect)((()=>{const r=m&&d>1,n=null!=t.specResolvedSubtree(c);r&&!n&&e.requestResolvedSubtree(c)}),[m,d]);const _=(0,Ke.useCallback)((()=>{n.show(c,!m)}),[m]),v=(0,Ke.useCallback)((e=>{null!==e&&n.readyToScroll(c,e)}),[]),handleJSONSchema202012Ref=e=>t=>{null!==t&&n.readyToScroll([...c,e],t)},handleJSONSchema202012Expand=r=>(n,a)=>{if(a){const n=[...c,r];null!=t.specResolvedSubtree(n)||e.requestResolvedSubtree([...c,r])}};return!i||d<0?null:Ke.default.createElement(\"section\",{className:(0,fr.default)(\"models\",{\"is-open\":m}),ref:v},Ke.default.createElement(\"h4\",null,Ke.default.createElement(\"button\",{\"aria-expanded\":m,className:\"models-control\",onClick:_},Ke.default.createElement(\"span\",null,\"Schemas\"),m?Ke.default.createElement(g,null):Ke.default.createElement(y,null))),Ke.default.createElement(f,{isOpened:m},Object.entries(l).map((([e,t])=>{const r=S(t,{lookup:\"basic\"})||e;return Ke.default.createElement(h,{key:e,ref:handleJSONSchema202012Ref(e),schema:t,name:r,onExpand:handleJSONSchema202012Expand(e)})}))))};var mutual_tls_auth=({schema:e,getComponent:t})=>{const r=t(\"JumpToPath\",!0);return Ke.default.createElement(\"div\",null,Ke.default.createElement(\"h4\",null,e.get(\"name\"),\" (mutualTLS)\",\" \",Ke.default.createElement(r,{path:[\"securityDefinitions\",e.get(\"name\")]})),Ke.default.createElement(\"p\",null,\"Mutual TLS is required by this API/Operation. Certificates are managed via your Operating System and/or your browser.\"),Ke.default.createElement(\"p\",null,e.get(\"description\")))};class auths_Auths extends Ke.default.Component{constructor(e,t){super(e,t),this.state={}}onAuthChange=e=>{let{name:t}=e;this.setState({[t]:e})};submitAuth=e=>{e.preventDefault();let{authActions:t}=this.props;t.authorizeWithPersistOption(this.state)};logoutClick=e=>{e.preventDefault();let{authActions:t,definitions:r}=this.props,n=r.map(((e,t)=>t)).toArray();this.setState(n.reduce(((e,t)=>(e[t]=\"\",e)),{})),t.logoutWithPersistOption(n)};close=e=>{e.preventDefault();let{authActions:t}=this.props;t.showDefinitions(!1)};render(){let{definitions:e,getComponent:t,authSelectors:r,errSelectors:n}=this.props;const a=t(\"AuthItem\"),o=t(\"oauth2\",!0),s=t(\"Button\"),l=r.authorized(),i=e.filter(((e,t)=>!!l.get(t))),c=e.filter((e=>\"oauth2\"!==e.get(\"type\")&&\"mutualTLS\"!==e.get(\"type\"))),u=e.filter((e=>\"oauth2\"===e.get(\"type\"))),d=e.filter((e=>\"mutualTLS\"===e.get(\"type\")));return Ke.default.createElement(\"div\",{className:\"auth-container\"},c.size>0&&Ke.default.createElement(\"form\",{onSubmit:this.submitAuth},c.map(((e,r)=>Ke.default.createElement(a,{key:r,schema:e,name:r,getComponent:t,onAuthChange:this.onAuthChange,authorized:l,errSelectors:n}))).toArray(),Ke.default.createElement(\"div\",{className:\"auth-btn-wrapper\"},c.size===i.size?Ke.default.createElement(s,{className:\"btn modal-btn auth\",onClick:this.logoutClick,\"aria-label\":\"Remove authorization\"},\"Logout\"):Ke.default.createElement(s,{type:\"submit\",className:\"btn modal-btn auth authorize\",\"aria-label\":\"Apply credentials\"},\"Authorize\"),Ke.default.createElement(s,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\"))),u.size>0?Ke.default.createElement(\"div\",null,Ke.default.createElement(\"div\",{className:\"scope-def\"},Ke.default.createElement(\"p\",null,\"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\"),Ke.default.createElement(\"p\",null,\"API requires the following scopes. Select which ones you want to grant to Swagger UI.\")),e.filter((e=>\"oauth2\"===e.get(\"type\"))).map(((e,t)=>Ke.default.createElement(\"div\",{key:t},Ke.default.createElement(o,{authorized:l,schema:e,name:t})))).toArray()):null,d.size>0&&Ke.default.createElement(\"div\",null,d.map(((e,r)=>Ke.default.createElement(a,{key:r,schema:e,name:r,getComponent:t,onAuthChange:this.onAuthChange,authorized:l,errSelectors:n}))).toArray()))}}var Po=auths_Auths;const isOAS31=e=>{const t=e.get(\"openapi\");return\"string\"==typeof t&&/^3\\.1\\.(?:[1-9]\\d*|0)$/.test(t)},fn_createOnlyOAS31Selector=e=>(t,...r)=>n=>{if(n.getSystem().specSelectors.isOAS31()){const a=e(t,...r);return\"function\"==typeof a?a(n):a}return null},createOnlyOAS31SelectorWrapper=e=>(t,r)=>(n,...a)=>{if(r.getSystem().specSelectors.isOAS31()){const o=e(n,...a);return\"function\"==typeof o?o(t,r):o}return t(...a)},fn_createSystemSelector=e=>(t,...r)=>n=>{const a=e(t,n,...r);return\"function\"==typeof a?a(n):a},createOnlyOAS31ComponentWrapper=e=>(t,r)=>n=>r.specSelectors.isOAS31()?Ke.default.createElement(e,(0,nr.default)({},n,{originalComponent:t,getSystem:r.getSystem})):Ke.default.createElement(t,n);var Mo=createOnlyOAS31ComponentWrapper((({getSystem:e})=>{const t=e().getComponent(\"OAS31License\",!0);return Ke.default.createElement(t,null)}));var qo=createOnlyOAS31ComponentWrapper((({getSystem:e})=>{const t=e().getComponent(\"OAS31Contact\",!0);return Ke.default.createElement(t,null)}));var Lo=createOnlyOAS31ComponentWrapper((({getSystem:e})=>{const t=e().getComponent(\"OAS31Info\",!0);return Ke.default.createElement(t,null)}));const Do=createOnlyOAS31ComponentWrapper((({getSystem:e,...t})=>{const r=e(),{getComponent:n,fn:a,getConfigs:o}=r,s=o(),l=n(\"OAS31Model\"),i=n(\"JSONSchema202012\"),c=n(\"JSONSchema202012Keyword$schema\"),u=n(\"JSONSchema202012Keyword$vocabulary\"),d=n(\"JSONSchema202012Keyword$id\"),p=n(\"JSONSchema202012Keyword$anchor\"),m=n(\"JSONSchema202012Keyword$dynamicAnchor\"),f=n(\"JSONSchema202012Keyword$ref\"),h=n(\"JSONSchema202012Keyword$dynamicRef\"),g=n(\"JSONSchema202012Keyword$defs\"),y=n(\"JSONSchema202012Keyword$comment\"),S=n(\"JSONSchema202012KeywordAllOf\"),_=n(\"JSONSchema202012KeywordAnyOf\"),v=n(\"JSONSchema202012KeywordOneOf\"),b=n(\"JSONSchema202012KeywordNot\"),w=n(\"JSONSchema202012KeywordIf\"),C=n(\"JSONSchema202012KeywordThen\"),x=n(\"JSONSchema202012KeywordElse\"),O=n(\"JSONSchema202012KeywordDependentSchemas\"),k=n(\"JSONSchema202012KeywordPrefixItems\"),N=n(\"JSONSchema202012KeywordItems\"),A=n(\"JSONSchema202012KeywordContains\"),I=n(\"JSONSchema202012KeywordProperties\"),R=n(\"JSONSchema202012KeywordPatternProperties\"),T=n(\"JSONSchema202012KeywordAdditionalProperties\"),B=n(\"JSONSchema202012KeywordPropertyNames\"),j=n(\"JSONSchema202012KeywordUnevaluatedItems\"),P=n(\"JSONSchema202012KeywordUnevaluatedProperties\"),M=n(\"JSONSchema202012KeywordType\"),q=n(\"JSONSchema202012KeywordEnum\"),L=n(\"JSONSchema202012KeywordConst\"),D=n(\"JSONSchema202012KeywordConstraint\"),U=n(\"JSONSchema202012KeywordDependentRequired\"),$=n(\"JSONSchema202012KeywordContentSchema\"),J=n(\"JSONSchema202012KeywordTitle\"),V=n(\"JSONSchema202012KeywordDescription\"),K=n(\"JSONSchema202012KeywordDefault\"),z=n(\"JSONSchema202012KeywordDeprecated\"),F=n(\"JSONSchema202012KeywordReadOnly\"),W=n(\"JSONSchema202012KeywordWriteOnly\"),H=n(\"JSONSchema202012Accordion\"),G=n(\"JSONSchema202012ExpandDeepButton\"),X=n(\"JSONSchema202012ChevronRightIcon\"),Y=n(\"withJSONSchema202012Context\")(l,{config:{default$schema:\"https://spec.openapis.org/oas/3.1/dialect/base\",defaultExpandedLevels:s.defaultModelExpandDepth,includeReadOnly:Boolean(t.includeReadOnly),includeWriteOnly:Boolean(t.includeWriteOnly)},components:{JSONSchema:i,Keyword$schema:c,Keyword$vocabulary:u,Keyword$id:d,Keyword$anchor:p,Keyword$dynamicAnchor:m,Keyword$ref:f,Keyword$dynamicRef:h,Keyword$defs:g,Keyword$comment:y,KeywordAllOf:S,KeywordAnyOf:_,KeywordOneOf:v,KeywordNot:b,KeywordIf:w,KeywordThen:C,KeywordElse:x,KeywordDependentSchemas:O,KeywordPrefixItems:k,KeywordItems:N,KeywordContains:A,KeywordProperties:I,KeywordPatternProperties:R,KeywordAdditionalProperties:T,KeywordPropertyNames:B,KeywordUnevaluatedItems:j,KeywordUnevaluatedProperties:P,KeywordType:M,KeywordEnum:q,KeywordConst:L,KeywordConstraint:D,KeywordDependentRequired:U,KeywordContentSchema:$,KeywordTitle:J,KeywordDescription:V,KeywordDefault:K,KeywordDeprecated:z,KeywordReadOnly:F,KeywordWriteOnly:W,Accordion:H,ExpandDeepButton:G,ChevronRightIcon:X},fn:{upperFirst:a.upperFirst,isExpandable:a.jsonSchema202012.isExpandable,getProperties:a.jsonSchema202012.getProperties}});return Ke.default.createElement(Y,t)}));var Uo=Do;const $o=createOnlyOAS31ComponentWrapper((({getSystem:e})=>{const{getComponent:t,fn:r,getConfigs:n}=e(),a=n();if($o.ModelsWithJSONSchemaContext)return Ke.default.createElement($o.ModelsWithJSONSchemaContext,null);const o=t(\"OAS31Models\",!0),s=t(\"JSONSchema202012\"),l=t(\"JSONSchema202012Keyword$schema\"),i=t(\"JSONSchema202012Keyword$vocabulary\"),c=t(\"JSONSchema202012Keyword$id\"),u=t(\"JSONSchema202012Keyword$anchor\"),d=t(\"JSONSchema202012Keyword$dynamicAnchor\"),p=t(\"JSONSchema202012Keyword$ref\"),m=t(\"JSONSchema202012Keyword$dynamicRef\"),f=t(\"JSONSchema202012Keyword$defs\"),h=t(\"JSONSchema202012Keyword$comment\"),g=t(\"JSONSchema202012KeywordAllOf\"),y=t(\"JSONSchema202012KeywordAnyOf\"),S=t(\"JSONSchema202012KeywordOneOf\"),_=t(\"JSONSchema202012KeywordNot\"),v=t(\"JSONSchema202012KeywordIf\"),b=t(\"JSONSchema202012KeywordThen\"),w=t(\"JSONSchema202012KeywordElse\"),C=t(\"JSONSchema202012KeywordDependentSchemas\"),x=t(\"JSONSchema202012KeywordPrefixItems\"),O=t(\"JSONSchema202012KeywordItems\"),k=t(\"JSONSchema202012KeywordContains\"),N=t(\"JSONSchema202012KeywordProperties\"),A=t(\"JSONSchema202012KeywordPatternProperties\"),I=t(\"JSONSchema202012KeywordAdditionalProperties\"),R=t(\"JSONSchema202012KeywordPropertyNames\"),T=t(\"JSONSchema202012KeywordUnevaluatedItems\"),B=t(\"JSONSchema202012KeywordUnevaluatedProperties\"),j=t(\"JSONSchema202012KeywordType\"),P=t(\"JSONSchema202012KeywordEnum\"),M=t(\"JSONSchema202012KeywordConst\"),q=t(\"JSONSchema202012KeywordConstraint\"),L=t(\"JSONSchema202012KeywordDependentRequired\"),D=t(\"JSONSchema202012KeywordContentSchema\"),U=t(\"JSONSchema202012KeywordTitle\"),$=t(\"JSONSchema202012KeywordDescription\"),J=t(\"JSONSchema202012KeywordDefault\"),V=t(\"JSONSchema202012KeywordDeprecated\"),K=t(\"JSONSchema202012KeywordReadOnly\"),z=t(\"JSONSchema202012KeywordWriteOnly\"),F=t(\"JSONSchema202012Accordion\"),W=t(\"JSONSchema202012ExpandDeepButton\"),H=t(\"JSONSchema202012ChevronRightIcon\"),G=t(\"withJSONSchema202012Context\");return $o.ModelsWithJSONSchemaContext=G(o,{config:{default$schema:\"https://spec.openapis.org/oas/3.1/dialect/base\",defaultExpandedLevels:a.defaultModelsExpandDepth-1,includeReadOnly:!0,includeWriteOnly:!0},components:{JSONSchema:s,Keyword$schema:l,Keyword$vocabulary:i,Keyword$id:c,Keyword$anchor:u,Keyword$dynamicAnchor:d,Keyword$ref:p,Keyword$dynamicRef:m,Keyword$defs:f,Keyword$comment:h,KeywordAllOf:g,KeywordAnyOf:y,KeywordOneOf:S,KeywordNot:_,KeywordIf:v,KeywordThen:b,KeywordElse:w,KeywordDependentSchemas:C,KeywordPrefixItems:x,KeywordItems:O,KeywordContains:k,KeywordProperties:N,KeywordPatternProperties:A,KeywordAdditionalProperties:I,KeywordPropertyNames:R,KeywordUnevaluatedItems:T,KeywordUnevaluatedProperties:B,KeywordType:j,KeywordEnum:P,KeywordConst:M,KeywordConstraint:q,KeywordDependentRequired:L,KeywordContentSchema:D,KeywordTitle:U,KeywordDescription:$,KeywordDefault:J,KeywordDeprecated:V,KeywordReadOnly:K,KeywordWriteOnly:z,Accordion:F,ExpandDeepButton:W,ChevronRightIcon:H},fn:{upperFirst:r.upperFirst,isExpandable:r.jsonSchema202012.isExpandable,getProperties:r.jsonSchema202012.getProperties}}),Ke.default.createElement($o.ModelsWithJSONSchemaContext,null)}));$o.ModelsWithJSONSchemaContext=null;var Jo=$o;var wrap_components_version_pragma_filter=(e,t)=>e=>{const r=t.specSelectors.isOAS31(),n=t.getComponent(\"OAS31VersionPragmaFilter\");return Ke.default.createElement(n,(0,nr.default)({isOAS31:r},e))};const Vo=createOnlyOAS31ComponentWrapper((({originalComponent:e,...t})=>{const{getComponent:r,schema:n}=t,a=r(\"MutualTLSAuth\",!0);return\"mutualTLS\"===n.get(\"type\")?Ke.default.createElement(a,{schema:n}):Ke.default.createElement(e,t)}));var Ko=Vo;var zo=createOnlyOAS31ComponentWrapper((({getSystem:e,...t})=>{const r=e().getComponent(\"OAS31Auths\",!0);return Ke.default.createElement(r,t)}));const Fo=(0,Fe.Map)(),Wo=(0,Bt.createSelector)(((e,t)=>t.specSelectors.specJson()),isOAS31),selectors_webhooks=()=>e=>{const t=e.specSelectors.specJson().get(\"webhooks\");return Fe.Map.isMap(t)?t:Fo},Ho=(0,Bt.createSelector)([(e,t)=>t.specSelectors.webhooks(),(e,t)=>t.specSelectors.validOperationMethods(),(e,t)=>t.specSelectors.specResolvedSubtree([\"webhooks\"])],((e,t)=>e.reduce(((e,r,n)=>{if(!Fe.Map.isMap(r))return e;const a=r.entrySeq().filter((([e])=>t.includes(e))).map((([e,t])=>({operation:(0,Fe.Map)({operation:t}),method:e,path:n,specPath:[\"webhooks\",n,e]})));return e.concat(a)}),(0,Fe.List)()).groupBy((e=>e.path)).map((e=>e.toArray())).toObject())),selectors_license=()=>e=>{const t=e.specSelectors.info().get(\"license\");return Fe.Map.isMap(t)?t:Fo},selectLicenseNameField=()=>e=>e.specSelectors.license().get(\"name\",\"License\"),selectLicenseUrlField=()=>e=>e.specSelectors.license().get(\"url\"),Go=(0,Bt.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectLicenseUrlField()],((e,t,r)=>{if(r)return safeBuildUrl(r,e,{selectedServer:t})})),selectLicenseIdentifierField=()=>e=>e.specSelectors.license().get(\"identifier\"),selectors_contact=()=>e=>{const t=e.specSelectors.info().get(\"contact\");return Fe.Map.isMap(t)?t:Fo},selectContactNameField=()=>e=>e.specSelectors.contact().get(\"name\",\"the developer\"),selectContactEmailField=()=>e=>e.specSelectors.contact().get(\"email\"),selectContactUrlField=()=>e=>e.specSelectors.contact().get(\"url\"),Xo=(0,Bt.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectContactUrlField()],((e,t,r)=>{if(r)return safeBuildUrl(r,e,{selectedServer:t})})),selectInfoTitleField=()=>e=>e.specSelectors.info().get(\"title\"),selectInfoSummaryField=()=>e=>e.specSelectors.info().get(\"summary\"),selectInfoDescriptionField=()=>e=>e.specSelectors.info().get(\"description\"),selectInfoTermsOfServiceField=()=>e=>e.specSelectors.info().get(\"termsOfService\"),Yo=(0,Bt.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectInfoTermsOfServiceField()],((e,t,r)=>{if(r)return safeBuildUrl(r,e,{selectedServer:t})})),selectExternalDocsDescriptionField=()=>e=>e.specSelectors.externalDocs().get(\"description\"),selectExternalDocsUrlField=()=>e=>e.specSelectors.externalDocs().get(\"url\"),Qo=(0,Bt.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectExternalDocsUrlField()],((e,t,r)=>{if(r)return safeBuildUrl(r,e,{selectedServer:t})})),selectJsonSchemaDialectField=()=>e=>e.specSelectors.specJson().get(\"jsonSchemaDialect\"),selectJsonSchemaDialectDefault=()=>\"https://spec.openapis.org/oas/3.1/dialect/base\",Zo=(0,Bt.createSelector)(((e,t)=>t.specSelectors.definitions()),((e,t)=>t.specSelectors.specResolvedSubtree([\"components\",\"schemas\"])),((e,t)=>Fe.Map.isMap(e)?Fe.Map.isMap(t)?Object.entries(e.toJS()).reduce(((e,[r,n])=>{const a=t.get(r);return e[r]=a?.toJS()||n,e}),{}):e.toJS():{})),wrap_selectors_isOAS3=(e,t)=>(r,...n)=>t.specSelectors.isOAS31()||e(...n),es=createOnlyOAS31SelectorWrapper((()=>(e,t)=>t.oas31Selectors.selectLicenseUrl())),ts=createOnlyOAS31SelectorWrapper((()=>(e,t)=>{const r=t.specSelectors.securityDefinitions();let n=e();return r?(r.entrySeq().forEach((([e,t])=>{\"mutualTLS\"===t.get(\"type\")&&(n=n.push(new Fe.Map({[e]:t})))})),n):n})),rs=(0,Bt.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectLicenseUrlField(),(e,t)=>t.specSelectors.selectLicenseIdentifierField()],((e,t,r,n)=>r?safeBuildUrl(r,e,{selectedServer:t}):n?`https://spdx.org/licenses/${n}.html`:void 0));var keywords_Example=({schema:e,getSystem:t})=>{const{fn:r}=t(),{hasKeyword:n,stringify:a}=r.jsonSchema202012.useFn();return n(e,\"example\")?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--example\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Example\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},a(e.example))):null};var keywords_Xml=({schema:e,getSystem:t})=>{const r=e?.xml||{},{fn:n,getComponent:a}=t(),{useIsExpandedDeeply:o,useComponent:s}=n.jsonSchema202012,l=o(),i=!!(r.name||r.namespace||r.prefix),[c,u]=(0,Ke.useState)(l),[d,p]=(0,Ke.useState)(!1),m=s(\"Accordion\"),f=s(\"ExpandDeepButton\"),h=a(\"JSONSchema202012DeepExpansionContext\")(),g=(0,Ke.useCallback)((()=>{u((e=>!e))}),[]),y=(0,Ke.useCallback)(((e,t)=>{u(t),p(t)}),[]);return 0===Object.keys(r).length?null:Ke.default.createElement(h.Provider,{value:d},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--xml\"},i?Ke.default.createElement(Ke.default.Fragment,null,Ke.default.createElement(m,{expanded:c,onChange:g},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"XML\")),Ke.default.createElement(f,{expanded:c,onClick:y})):Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"XML\"),!0===r.attribute&&Ke.default.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"attribute\"),!0===r.wrapped&&Ke.default.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"wrapped\"),Ke.default.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Ke.default.createElement(\"ul\",{className:(0,fr.default)(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!c})},c&&Ke.default.createElement(Ke.default.Fragment,null,r.name&&Ke.default.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"name\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},r.name))),r.namespace&&Ke.default.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"namespace\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},r.namespace))),r.prefix&&Ke.default.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"prefix\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},r.prefix)))))))};var Discriminator_DiscriminatorMapping=({discriminator:e})=>{const t=e?.mapping||{};return 0===Object.keys(t).length?null:Object.entries(t).map((([e,t])=>Ke.default.createElement(\"div\",{key:`${e}-${t}`,className:\"json-schema-2020-12-keyword\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},e),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},t))))};var Discriminator_Discriminator=({schema:e,getSystem:t})=>{const r=e?.discriminator||{},{fn:n,getComponent:a}=t(),{useIsExpandedDeeply:o,useComponent:s}=n.jsonSchema202012,l=o(),i=!!r.mapping,[c,u]=(0,Ke.useState)(l),[d,p]=(0,Ke.useState)(!1),m=s(\"Accordion\"),f=s(\"ExpandDeepButton\"),h=a(\"JSONSchema202012DeepExpansionContext\")(),g=(0,Ke.useCallback)((()=>{u((e=>!e))}),[]),y=(0,Ke.useCallback)(((e,t)=>{u(t),p(t)}),[]);return 0===Object.keys(r).length?null:Ke.default.createElement(h.Provider,{value:d},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--discriminator\"},i?Ke.default.createElement(Ke.default.Fragment,null,Ke.default.createElement(m,{expanded:c,onChange:g},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Discriminator\")),Ke.default.createElement(f,{expanded:c,onClick:y})):Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Discriminator\"),r.propertyName&&Ke.default.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},r.propertyName),Ke.default.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Ke.default.createElement(\"ul\",{className:(0,fr.default)(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!c})},c&&Ke.default.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Ke.default.createElement(Discriminator_DiscriminatorMapping,{discriminator:r})))))};var keywords_ExternalDocs=({schema:e,getSystem:t})=>{const r=e?.externalDocs||{},{fn:n,getComponent:a}=t(),{useIsExpandedDeeply:o,useComponent:s}=n.jsonSchema202012,l=o(),i=!(!r.description&&!r.url),[c,u]=(0,Ke.useState)(l),[d,p]=(0,Ke.useState)(!1),m=s(\"Accordion\"),f=s(\"ExpandDeepButton\"),h=a(\"JSONSchema202012KeywordDescription\"),g=a(\"Link\"),y=a(\"JSONSchema202012DeepExpansionContext\")(),S=(0,Ke.useCallback)((()=>{u((e=>!e))}),[]),_=(0,Ke.useCallback)(((e,t)=>{u(t),p(t)}),[]);return 0===Object.keys(r).length?null:Ke.default.createElement(y.Provider,{value:d},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--externalDocs\"},i?Ke.default.createElement(Ke.default.Fragment,null,Ke.default.createElement(m,{expanded:c,onChange:S},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"External documentation\")),Ke.default.createElement(f,{expanded:c,onClick:_})):Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"External documentation\"),Ke.default.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Ke.default.createElement(\"ul\",{className:(0,fr.default)(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!c})},c&&Ke.default.createElement(Ke.default.Fragment,null,r.description&&Ke.default.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Ke.default.createElement(h,{schema:r,getSystem:t})),r.url&&Ke.default.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"url\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},Ke.default.createElement(g,{target:\"_blank\",href:sanitizeUrl(r.url)},r.url))))))))};var keywords_Description=({schema:e,getSystem:t})=>{if(!e?.description)return null;const{getComponent:r}=t(),n=r(\"Markdown\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--description\"},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary\"},Ke.default.createElement(n,{source:e.description})))};var ns=createOnlyOAS31ComponentWrapper(keywords_Description);const as=createOnlyOAS31ComponentWrapper((({schema:e,getSystem:t,originalComponent:r})=>{const{getComponent:n}=t(),a=n(\"JSONSchema202012KeywordDiscriminator\"),o=n(\"JSONSchema202012KeywordXml\"),s=n(\"JSONSchema202012KeywordExample\"),l=n(\"JSONSchema202012KeywordExternalDocs\");return Ke.default.createElement(Ke.default.Fragment,null,Ke.default.createElement(r,{schema:e}),Ke.default.createElement(a,{schema:e,getSystem:t}),Ke.default.createElement(o,{schema:e,getSystem:t}),Ke.default.createElement(l,{schema:e,getSystem:t}),Ke.default.createElement(s,{schema:e,getSystem:t}))}));var os=as;var keywords_Properties=({schema:e,getSystem:t})=>{const{fn:r}=t(),{useComponent:n}=r.jsonSchema202012,{getDependentRequired:a,getProperties:o}=r.jsonSchema202012.useFn(),s=r.jsonSchema202012.useConfig(),l=Array.isArray(e?.required)?e.required:[],i=n(\"JSONSchema\"),c=o(e,s);return 0===Object.keys(c).length?null:Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties\"},Ke.default.createElement(\"ul\",null,Object.entries(c).map((([t,r])=>{const n=l.includes(t),o=a(t,e);return Ke.default.createElement(\"li\",{key:t,className:(0,fr.default)(\"json-schema-2020-12-property\",{\"json-schema-2020-12-property--required\":n})},Ke.default.createElement(i,{name:t,schema:r,dependentRequired:o}))}))))};var ss=createOnlyOAS31ComponentWrapper(keywords_Properties);const getProperties=(e,{includeReadOnly:t,includeWriteOnly:r})=>{if(!e?.properties)return{};const n=Object.entries(e.properties).filter((([,e])=>(!(!0===e?.readOnly)||t)&&(!(!0===e?.writeOnly)||r)));return Object.fromEntries(n)};var ls=function oas31_after_load_afterLoad({fn:e,getSystem:t}){if(e.jsonSchema202012){const r=((e,t)=>{const{fn:r}=t();if(\"function\"!=typeof e)return null;const{hasKeyword:n}=r.jsonSchema202012;return t=>e(t)||n(t,\"example\")||t?.xml||t?.discriminator||t?.externalDocs})(e.jsonSchema202012.isExpandable,t);Object.assign(this.fn.jsonSchema202012,{isExpandable:r,getProperties})}if(\"function\"==typeof e.sampleFromSchema&&e.jsonSchema202012){const r=((e,t)=>{const{fn:r,specSelectors:n}=t;return Object.fromEntries(Object.entries(e).map((([e,t])=>{const a=r[e];return[e,(...e)=>n.isOAS31()?t(...e):\"function\"==typeof a?a(...e):void 0]})))})({sampleFromSchema:e.jsonSchema202012.sampleFromSchema,sampleFromSchemaGeneric:e.jsonSchema202012.sampleFromSchemaGeneric,createXMLExample:e.jsonSchema202012.createXMLExample,memoizedSampleFromSchema:e.jsonSchema202012.memoizedSampleFromSchema,memoizedCreateXMLExample:e.jsonSchema202012.memoizedCreateXMLExample,getJsonSampleSchema:e.jsonSchema202012.getJsonSampleSchema,getYamlSampleSchema:e.jsonSchema202012.getYamlSampleSchema,getXmlSampleSchema:e.jsonSchema202012.getXmlSampleSchema,getSampleSchema:e.jsonSchema202012.getSampleSchema,mergeJsonSchema:e.jsonSchema202012.mergeJsonSchema},t());Object.assign(this.fn,r)}};var oas31=({fn:e})=>{const t=e.createSystemSelector||fn_createSystemSelector,r=e.createOnlyOAS31Selector||fn_createOnlyOAS31Selector;return{afterLoad:ls,fn:{isOAS31,createSystemSelector:fn_createSystemSelector,createOnlyOAS31Selector:fn_createOnlyOAS31Selector},components:{Webhooks:webhooks,JsonSchemaDialect:json_schema_dialect,MutualTLSAuth:mutual_tls_auth,OAS31Info:oas31_components_info,OAS31License:components_license,OAS31Contact:components_contact,OAS31VersionPragmaFilter:version_pragma_filter,OAS31Model:jo,OAS31Models:models,OAS31Auths:Po,JSONSchema202012KeywordExample:keywords_Example,JSONSchema202012KeywordXml:keywords_Xml,JSONSchema202012KeywordDiscriminator:Discriminator_Discriminator,JSONSchema202012KeywordExternalDocs:keywords_ExternalDocs},wrapComponents:{InfoContainer:Lo,License:Mo,Contact:qo,VersionPragmaFilter:wrap_components_version_pragma_filter,Model:Uo,Models:Jo,AuthItem:Ko,auths:zo,JSONSchema202012KeywordDescription:ns,JSONSchema202012KeywordDefault:os,JSONSchema202012KeywordProperties:ss},statePlugins:{auth:{wrapSelectors:{definitionsToAuthorize:ts}},spec:{selectors:{isOAS31:t(Wo),license:selectors_license,selectLicenseNameField,selectLicenseUrlField,selectLicenseIdentifierField:r(selectLicenseIdentifierField),selectLicenseUrl:t(Go),contact:selectors_contact,selectContactNameField,selectContactEmailField,selectContactUrlField,selectContactUrl:t(Xo),selectInfoTitleField,selectInfoSummaryField:r(selectInfoSummaryField),selectInfoDescriptionField,selectInfoTermsOfServiceField,selectInfoTermsOfServiceUrl:t(Yo),selectExternalDocsDescriptionField,selectExternalDocsUrlField,selectExternalDocsUrl:t(Qo),webhooks:r(selectors_webhooks),selectWebhooksOperations:r(t(Ho)),selectJsonSchemaDialectField,selectJsonSchemaDialectDefault,selectSchemas:t(Zo)},wrapSelectors:{isOAS3:wrap_selectors_isOAS3,selectLicenseUrl:es}},oas31:{selectors:{selectLicenseUrl:r(t(rs))}}}}};const is=Lt.default.object,cs=Lt.default.bool,us=(Lt.default.oneOfType([is,cs]),(0,Ke.createContext)(null));us.displayName=\"JSONSchemaContext\";const ds=(0,Ke.createContext)(0);ds.displayName=\"JSONSchemaLevelContext\";const ps=(0,Ke.createContext)(!1);ps.displayName=\"JSONSchemaDeepExpansionContext\";const ms=(0,Ke.createContext)(new Set),useConfig=()=>{const{config:e}=(0,Ke.useContext)(us);return e},useComponent=e=>{const{components:t}=(0,Ke.useContext)(us);return t[e]||null},useFn=(e=void 0)=>{const{fn:t}=(0,Ke.useContext)(us);return void 0!==e?t[e]:t},useLevel=()=>{const e=(0,Ke.useContext)(ds);return[e,e+1]},useIsExpanded=()=>{const[e]=useLevel(),{defaultExpandedLevels:t}=useConfig();return t-e>0},useIsExpandedDeeply=()=>(0,Ke.useContext)(ps),useRenderedSchemas=(e=void 0)=>{if(void 0===e)return(0,Ke.useContext)(ms);const t=(0,Ke.useContext)(ms);return new Set([...t,e])},fs=(0,Ke.forwardRef)((({schema:e,name:t=\"\",dependentRequired:r=[],onExpand:n=(()=>{})},a)=>{const o=useFn(),s=useIsExpanded(),l=useIsExpandedDeeply(),[i,c]=(0,Ke.useState)(s||l),[u,d]=(0,Ke.useState)(l),[p,m]=useLevel(),f=(()=>{const[e]=useLevel();return e>0})(),h=o.isExpandable(e)||r.length>0,g=(e=>useRenderedSchemas().has(e))(e),y=useRenderedSchemas(e),S=o.stringifyConstraints(e),_=useComponent(\"Accordion\"),v=useComponent(\"Keyword$schema\"),b=useComponent(\"Keyword$vocabulary\"),w=useComponent(\"Keyword$id\"),C=useComponent(\"Keyword$anchor\"),x=useComponent(\"Keyword$dynamicAnchor\"),O=useComponent(\"Keyword$ref\"),k=useComponent(\"Keyword$dynamicRef\"),N=useComponent(\"Keyword$defs\"),A=useComponent(\"Keyword$comment\"),I=useComponent(\"KeywordAllOf\"),R=useComponent(\"KeywordAnyOf\"),T=useComponent(\"KeywordOneOf\"),B=useComponent(\"KeywordNot\"),j=useComponent(\"KeywordIf\"),P=useComponent(\"KeywordThen\"),M=useComponent(\"KeywordElse\"),q=useComponent(\"KeywordDependentSchemas\"),L=useComponent(\"KeywordPrefixItems\"),D=useComponent(\"KeywordItems\"),U=useComponent(\"KeywordContains\"),$=useComponent(\"KeywordProperties\"),J=useComponent(\"KeywordPatternProperties\"),V=useComponent(\"KeywordAdditionalProperties\"),K=useComponent(\"KeywordPropertyNames\"),z=useComponent(\"KeywordUnevaluatedItems\"),F=useComponent(\"KeywordUnevaluatedProperties\"),W=useComponent(\"KeywordType\"),H=useComponent(\"KeywordEnum\"),G=useComponent(\"KeywordConst\"),X=useComponent(\"KeywordConstraint\"),Y=useComponent(\"KeywordDependentRequired\"),Q=useComponent(\"KeywordContentSchema\"),Z=useComponent(\"KeywordTitle\"),ee=useComponent(\"KeywordDescription\"),te=useComponent(\"KeywordDefault\"),re=useComponent(\"KeywordDeprecated\"),ne=useComponent(\"KeywordReadOnly\"),ae=useComponent(\"KeywordWriteOnly\"),oe=useComponent(\"ExpandDeepButton\");(0,Ke.useEffect)((()=>{d(l)}),[l]),(0,Ke.useEffect)((()=>{d(u)}),[u]);const se=(0,Ke.useCallback)(((e,t)=>{c(t),!t&&d(!1),n(e,t,!1)}),[n]),le=(0,Ke.useCallback)(((e,t)=>{c(t),d(t),n(e,t,!0)}),[n]);return Ke.default.createElement(ds.Provider,{value:m},Ke.default.createElement(ps.Provider,{value:u},Ke.default.createElement(ms.Provider,{value:y},Ke.default.createElement(\"article\",{ref:a,\"data-json-schema-level\":p,className:(0,fr.default)(\"json-schema-2020-12\",{\"json-schema-2020-12--embedded\":f,\"json-schema-2020-12--circular\":g})},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-head\"},h&&!g?Ke.default.createElement(Ke.default.Fragment,null,Ke.default.createElement(_,{expanded:i,onChange:se},Ke.default.createElement(Z,{title:t,schema:e})),Ke.default.createElement(oe,{expanded:i,onClick:le})):Ke.default.createElement(Z,{title:t,schema:e}),Ke.default.createElement(re,{schema:e}),Ke.default.createElement(ne,{schema:e}),Ke.default.createElement(ae,{schema:e}),Ke.default.createElement(W,{schema:e,isCircular:g}),S.length>0&&S.map((e=>Ke.default.createElement(X,{key:`${e.scope}-${e.value}`,constraint:e})))),Ke.default.createElement(\"div\",{className:(0,fr.default)(\"json-schema-2020-12-body\",{\"json-schema-2020-12-body--collapsed\":!i})},i&&Ke.default.createElement(Ke.default.Fragment,null,Ke.default.createElement(ee,{schema:e}),!g&&h&&Ke.default.createElement(Ke.default.Fragment,null,Ke.default.createElement($,{schema:e}),Ke.default.createElement(J,{schema:e}),Ke.default.createElement(V,{schema:e}),Ke.default.createElement(F,{schema:e}),Ke.default.createElement(K,{schema:e}),Ke.default.createElement(I,{schema:e}),Ke.default.createElement(R,{schema:e}),Ke.default.createElement(T,{schema:e}),Ke.default.createElement(B,{schema:e}),Ke.default.createElement(j,{schema:e}),Ke.default.createElement(P,{schema:e}),Ke.default.createElement(M,{schema:e}),Ke.default.createElement(q,{schema:e}),Ke.default.createElement(L,{schema:e}),Ke.default.createElement(D,{schema:e}),Ke.default.createElement(z,{schema:e}),Ke.default.createElement(U,{schema:e}),Ke.default.createElement(Q,{schema:e})),Ke.default.createElement(H,{schema:e}),Ke.default.createElement(G,{schema:e}),Ke.default.createElement(Y,{schema:e,dependentRequired:r}),Ke.default.createElement(te,{schema:e}),Ke.default.createElement(v,{schema:e}),Ke.default.createElement(b,{schema:e}),Ke.default.createElement(w,{schema:e}),Ke.default.createElement(C,{schema:e}),Ke.default.createElement(x,{schema:e}),Ke.default.createElement(O,{schema:e}),!g&&h&&Ke.default.createElement(N,{schema:e}),Ke.default.createElement(k,{schema:e}),Ke.default.createElement(A,{schema:e})))))))}));var hs=fs;var keywords_$schema=({schema:e})=>e?.$schema?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$schema\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$schema\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$schema)):null;var $vocabulary_$vocabulary=({schema:e})=>{const t=useIsExpanded(),r=useIsExpandedDeeply(),[n,a]=(0,Ke.useState)(t||r),o=useComponent(\"Accordion\"),s=(0,Ke.useCallback)((()=>{a((e=>!e))}),[]);return e?.$vocabulary?\"object\"!=typeof e.$vocabulary?null:Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$vocabulary\"},Ke.default.createElement(o,{expanded:n,onChange:s},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$vocabulary\")),Ke.default.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Ke.default.createElement(\"ul\",null,n&&Object.entries(e.$vocabulary).map((([e,t])=>Ke.default.createElement(\"li\",{key:e,className:(0,fr.default)(\"json-schema-2020-12-$vocabulary-uri\",{\"json-schema-2020-12-$vocabulary-uri--disabled\":!t})},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e)))))):null};var keywords_$id=({schema:e})=>e?.$id?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$id\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$id\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$id)):null;var keywords_$anchor=({schema:e})=>e?.$anchor?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$anchor\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$anchor\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$anchor)):null;var keywords_$dynamicAnchor=({schema:e})=>e?.$dynamicAnchor?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicAnchor\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$dynamicAnchor\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$dynamicAnchor)):null;var keywords_$ref=({schema:e})=>e?.$ref?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$ref\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$ref\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$ref)):null;var keywords_$dynamicRef=({schema:e})=>e?.$dynamicRef?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicRef\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$dynamicRef\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$dynamicRef)):null;var keywords_$defs=({schema:e})=>{const t=e?.$defs||{},r=useIsExpanded(),n=useIsExpandedDeeply(),[a,o]=(0,Ke.useState)(r||n),[s,l]=(0,Ke.useState)(!1),i=useComponent(\"Accordion\"),c=useComponent(\"ExpandDeepButton\"),u=useComponent(\"JSONSchema\"),d=(0,Ke.useCallback)((()=>{o((e=>!e))}),[]),p=(0,Ke.useCallback)(((e,t)=>{o(t),l(t)}),[]);return 0===Object.keys(t).length?null:Ke.default.createElement(ps.Provider,{value:s},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$defs\"},Ke.default.createElement(i,{expanded:a,onChange:d},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$defs\")),Ke.default.createElement(c,{expanded:a,onClick:p}),Ke.default.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Ke.default.createElement(\"ul\",{className:(0,fr.default)(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!a})},a&&Ke.default.createElement(Ke.default.Fragment,null,Object.entries(t).map((([e,t])=>Ke.default.createElement(\"li\",{key:e,className:\"json-schema-2020-12-property\"},Ke.default.createElement(u,{name:e,schema:t}))))))))};var keywords_$comment=({schema:e})=>e?.$comment?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$comment\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$comment\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$comment)):null;var keywords_AllOf=({schema:e})=>{const t=e?.allOf||[],r=useFn(),n=useIsExpanded(),a=useIsExpandedDeeply(),[o,s]=(0,Ke.useState)(n||a),[l,i]=(0,Ke.useState)(!1),c=useComponent(\"Accordion\"),u=useComponent(\"ExpandDeepButton\"),d=useComponent(\"JSONSchema\"),p=useComponent(\"KeywordType\"),m=(0,Ke.useCallback)((()=>{s((e=>!e))}),[]),f=(0,Ke.useCallback)(((e,t)=>{s(t),i(t)}),[]);return Array.isArray(t)&&0!==t.length?Ke.default.createElement(ps.Provider,{value:l},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--allOf\"},Ke.default.createElement(c,{expanded:o,onChange:m},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"All of\")),Ke.default.createElement(u,{expanded:o,onClick:f}),Ke.default.createElement(p,{schema:{allOf:t}}),Ke.default.createElement(\"ul\",{className:(0,fr.default)(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!o})},o&&Ke.default.createElement(Ke.default.Fragment,null,t.map(((e,t)=>Ke.default.createElement(\"li\",{key:`#${t}`,className:\"json-schema-2020-12-property\"},Ke.default.createElement(d,{name:`#${t} ${r.getTitle(e)}`,schema:e})))))))):null};var keywords_AnyOf=({schema:e})=>{const t=e?.anyOf||[],r=useFn(),n=useIsExpanded(),a=useIsExpandedDeeply(),[o,s]=(0,Ke.useState)(n||a),[l,i]=(0,Ke.useState)(!1),c=useComponent(\"Accordion\"),u=useComponent(\"ExpandDeepButton\"),d=useComponent(\"JSONSchema\"),p=useComponent(\"KeywordType\"),m=(0,Ke.useCallback)((()=>{s((e=>!e))}),[]),f=(0,Ke.useCallback)(((e,t)=>{s(t),i(t)}),[]);return Array.isArray(t)&&0!==t.length?Ke.default.createElement(ps.Provider,{value:l},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--anyOf\"},Ke.default.createElement(c,{expanded:o,onChange:m},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Any of\")),Ke.default.createElement(u,{expanded:o,onClick:f}),Ke.default.createElement(p,{schema:{anyOf:t}}),Ke.default.createElement(\"ul\",{className:(0,fr.default)(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!o})},o&&Ke.default.createElement(Ke.default.Fragment,null,t.map(((e,t)=>Ke.default.createElement(\"li\",{key:`#${t}`,className:\"json-schema-2020-12-property\"},Ke.default.createElement(d,{name:`#${t} ${r.getTitle(e)}`,schema:e})))))))):null};var keywords_OneOf=({schema:e})=>{const t=e?.oneOf||[],r=useFn(),n=useIsExpanded(),a=useIsExpandedDeeply(),[o,s]=(0,Ke.useState)(n||a),[l,i]=(0,Ke.useState)(!1),c=useComponent(\"Accordion\"),u=useComponent(\"ExpandDeepButton\"),d=useComponent(\"JSONSchema\"),p=useComponent(\"KeywordType\"),m=(0,Ke.useCallback)((()=>{s((e=>!e))}),[]),f=(0,Ke.useCallback)(((e,t)=>{s(t),i(t)}),[]);return Array.isArray(t)&&0!==t.length?Ke.default.createElement(ps.Provider,{value:l},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--oneOf\"},Ke.default.createElement(c,{expanded:o,onChange:m},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"One of\")),Ke.default.createElement(u,{expanded:o,onClick:f}),Ke.default.createElement(p,{schema:{oneOf:t}}),Ke.default.createElement(\"ul\",{className:(0,fr.default)(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!o})},o&&Ke.default.createElement(Ke.default.Fragment,null,t.map(((e,t)=>Ke.default.createElement(\"li\",{key:`#${t}`,className:\"json-schema-2020-12-property\"},Ke.default.createElement(d,{name:`#${t} ${r.getTitle(e)}`,schema:e})))))))):null};var keywords_Not=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"not\"))return null;const n=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Not\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--not\"},Ke.default.createElement(r,{name:n,schema:e.not}))};var keywords_If=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"if\"))return null;const n=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"If\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--if\"},Ke.default.createElement(r,{name:n,schema:e.if}))};var keywords_Then=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"then\"))return null;const n=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Then\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--then\"},Ke.default.createElement(r,{name:n,schema:e.then}))};var keywords_Else=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"else\"))return null;const n=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Else\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--if\"},Ke.default.createElement(r,{name:n,schema:e.else}))};var keywords_DependentSchemas=({schema:e})=>{const t=e?.dependentSchemas||[],r=useIsExpanded(),n=useIsExpandedDeeply(),[a,o]=(0,Ke.useState)(r||n),[s,l]=(0,Ke.useState)(!1),i=useComponent(\"Accordion\"),c=useComponent(\"ExpandDeepButton\"),u=useComponent(\"JSONSchema\"),d=(0,Ke.useCallback)((()=>{o((e=>!e))}),[]),p=(0,Ke.useCallback)(((e,t)=>{o(t),l(t)}),[]);return\"object\"!=typeof t||0===Object.keys(t).length?null:Ke.default.createElement(ps.Provider,{value:s},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentSchemas\"},Ke.default.createElement(i,{expanded:a,onChange:d},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Dependent schemas\")),Ke.default.createElement(c,{expanded:a,onClick:p}),Ke.default.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Ke.default.createElement(\"ul\",{className:(0,fr.default)(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!a})},a&&Ke.default.createElement(Ke.default.Fragment,null,Object.entries(t).map((([e,t])=>Ke.default.createElement(\"li\",{key:e,className:\"json-schema-2020-12-property\"},Ke.default.createElement(u,{name:e,schema:t}))))))))};var keywords_PrefixItems=({schema:e})=>{const t=e?.prefixItems||[],r=useFn(),n=useIsExpanded(),a=useIsExpandedDeeply(),[o,s]=(0,Ke.useState)(n||a),[l,i]=(0,Ke.useState)(!1),c=useComponent(\"Accordion\"),u=useComponent(\"ExpandDeepButton\"),d=useComponent(\"JSONSchema\"),p=useComponent(\"KeywordType\"),m=(0,Ke.useCallback)((()=>{s((e=>!e))}),[]),f=(0,Ke.useCallback)(((e,t)=>{s(t),i(t)}),[]);return Array.isArray(t)&&0!==t.length?Ke.default.createElement(ps.Provider,{value:l},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--prefixItems\"},Ke.default.createElement(c,{expanded:o,onChange:m},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Prefix items\")),Ke.default.createElement(u,{expanded:o,onClick:f}),Ke.default.createElement(p,{schema:{prefixItems:t}}),Ke.default.createElement(\"ul\",{className:(0,fr.default)(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!o})},o&&Ke.default.createElement(Ke.default.Fragment,null,t.map(((e,t)=>Ke.default.createElement(\"li\",{key:`#${t}`,className:\"json-schema-2020-12-property\"},Ke.default.createElement(d,{name:`#${t} ${r.getTitle(e)}`,schema:e})))))))):null};var keywords_Items=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"items\"))return null;const n=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Items\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--items\"},Ke.default.createElement(r,{name:n,schema:e.items}))};var keywords_Contains=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"contains\"))return null;const n=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Contains\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--contains\"},Ke.default.createElement(r,{name:n,schema:e.contains}))};var keywords_Properties_Properties=({schema:e})=>{const t=useFn(),r=e?.properties||{},n=Array.isArray(e?.required)?e.required:[],a=useComponent(\"JSONSchema\");return 0===Object.keys(r).length?null:Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties\"},Ke.default.createElement(\"ul\",null,Object.entries(r).map((([r,o])=>{const s=n.includes(r),l=t.getDependentRequired(r,e);return Ke.default.createElement(\"li\",{key:r,className:(0,fr.default)(\"json-schema-2020-12-property\",{\"json-schema-2020-12-property--required\":s})},Ke.default.createElement(a,{name:r,schema:o,dependentRequired:l}))}))))};var PatternProperties_PatternProperties=({schema:e})=>{const t=e?.patternProperties||{},r=useComponent(\"JSONSchema\");return 0===Object.keys(t).length?null:Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--patternProperties\"},Ke.default.createElement(\"ul\",null,Object.entries(t).map((([e,t])=>Ke.default.createElement(\"li\",{key:e,className:\"json-schema-2020-12-property\"},Ke.default.createElement(r,{name:e,schema:t}))))))};var keywords_AdditionalProperties=({schema:e})=>{const t=useFn(),{additionalProperties:r}=e,n=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"additionalProperties\"))return null;const a=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Additional properties\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--additionalProperties\"},!0===r?Ke.default.createElement(Ke.default.Fragment,null,a,Ke.default.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"allowed\")):!1===r?Ke.default.createElement(Ke.default.Fragment,null,a,Ke.default.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"forbidden\")):Ke.default.createElement(n,{name:a,schema:r}))};var keywords_PropertyNames=({schema:e})=>{const t=useFn(),{propertyNames:r}=e,n=useComponent(\"JSONSchema\"),a=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Property names\");return t.hasKeyword(e,\"propertyNames\")?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--propertyNames\"},Ke.default.createElement(n,{name:a,schema:r})):null};var keywords_UnevaluatedItems=({schema:e})=>{const t=useFn(),{unevaluatedItems:r}=e,n=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"unevaluatedItems\"))return null;const a=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Unevaluated items\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedItems\"},Ke.default.createElement(n,{name:a,schema:r}))};var keywords_UnevaluatedProperties=({schema:e})=>{const t=useFn(),{unevaluatedProperties:r}=e,n=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"unevaluatedProperties\"))return null;const a=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Unevaluated properties\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedProperties\"},Ke.default.createElement(n,{name:a,schema:r}))};var keywords_Type=({schema:e,isCircular:t=!1})=>{const r=useFn().getType(e),n=t?\" [circular]\":\"\";return Ke.default.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},`${r}${n}`)};var Enum_Enum=({schema:e})=>{const t=useFn();return Array.isArray(e?.enum)?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--enum\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Allowed values\"),Ke.default.createElement(\"ul\",null,e.enum.map((e=>{const r=t.stringify(e);return Ke.default.createElement(\"li\",{key:r},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},r))})))):null};var keywords_Const=({schema:e})=>{const t=useFn();return t.hasKeyword(e,\"const\")?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--const\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Const\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},t.stringify(e.const))):null};const Constraint=({constraint:e})=>Ke.default.createElement(\"span\",{className:`json-schema-2020-12__constraint json-schema-2020-12__constraint--${e.scope}`},e.value);var gs=Ke.default.memo(Constraint);var DependentRequired_DependentRequired=({dependentRequired:e})=>0===e.length?null:Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentRequired\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Required when defined\"),Ke.default.createElement(\"ul\",null,e.map((e=>Ke.default.createElement(\"li\",{key:e},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--warning\"},e))))));var keywords_ContentSchema=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"contentSchema\"))return null;const n=Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Content schema\");return Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--contentSchema\"},Ke.default.createElement(r,{name:n,schema:e.contentSchema}))};var Title_Title=({title:e=\"\",schema:t})=>{const r=useFn(),n=e||r.getTitle(t);return n?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12__title\"},n):null};var keywords_Description_Description=({schema:e})=>e?.description?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--description\"},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary\"},e.description)):null;var keywords_Default=({schema:e})=>{const t=useFn();return t.hasKeyword(e,\"default\")?Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--default\"},Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Default\"),Ke.default.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},t.stringify(e.default))):null};var keywords_Deprecated=({schema:e})=>!0!==e?.deprecated?null:Ke.default.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--warning\"},\"deprecated\");var keywords_ReadOnly=({schema:e})=>!0!==e?.readOnly?null:Ke.default.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"read-only\");var keywords_WriteOnly=({schema:e})=>!0!==e?.writeOnly?null:Ke.default.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"write-only\");var Accordion_Accordion=({expanded:e=!1,children:t,onChange:r})=>{const n=useComponent(\"ChevronRightIcon\"),a=(0,Ke.useCallback)((t=>{r(t,!e)}),[e,r]);return Ke.default.createElement(\"button\",{type:\"button\",className:\"json-schema-2020-12-accordion\",onClick:a},Ke.default.createElement(\"div\",{className:\"json-schema-2020-12-accordion__children\"},t),Ke.default.createElement(\"span\",{className:(0,fr.default)(\"json-schema-2020-12-accordion__icon\",{\"json-schema-2020-12-accordion__icon--expanded\":e,\"json-schema-2020-12-accordion__icon--collapsed\":!e})},Ke.default.createElement(n,null)))};var ExpandDeepButton_ExpandDeepButton=({expanded:e,onClick:t})=>{const r=(0,Ke.useCallback)((r=>{t(r,!e)}),[e,t]);return Ke.default.createElement(\"button\",{type:\"button\",className:\"json-schema-2020-12-expand-deep-button\",onClick:r},e?\"Collapse all\":\"Expand all\")};var icons_ChevronRight=()=>Ke.default.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\"},Ke.default.createElement(\"path\",{d:\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"}));const fn_upperFirst=e=>\"string\"==typeof e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:e,getTitle=(e,{lookup:t=\"extended\"}={})=>{const r=useFn();if(null!=e?.title)return r.upperFirst(String(e.title));if(\"extended\"===t){if(null!=e?.$anchor)return r.upperFirst(String(e.$anchor));if(null!=e?.$id)return String(e.$id)}return\"\"},getType=(e,t=new WeakSet)=>{const r=useFn();if(null==e)return\"any\";if(r.isBooleanJSONSchema(e))return e?\"any\":\"never\";if(\"object\"!=typeof e)return\"any\";if(t.has(e))return\"any\";t.add(e);const{type:n,prefixItems:a,items:o}=e,getArrayType=()=>{if(Array.isArray(a)){const e=a.map((e=>getType(e,t))),r=o?getType(o,t):\"any\";return`array<[${e.join(\", \")}], ${r}>`}if(o){return`array<${getType(o,t)}>`}return\"array<any>\"};if(e.not&&\"any\"===getType(e.not))return\"never\";const handleCombiningKeywords=(r,n)=>{if(Array.isArray(e[r])){return`(${e[r].map((e=>getType(e,t))).join(n)})`}return null},s=[Array.isArray(n)?n.map((e=>\"array\"===e?getArrayType():e)).join(\" | \"):\"array\"===n?getArrayType():[\"null\",\"boolean\",\"object\",\"array\",\"number\",\"integer\",\"string\"].includes(n)?n:(()=>{if(Object.hasOwn(e,\"prefixItems\")||Object.hasOwn(e,\"items\")||Object.hasOwn(e,\"contains\"))return getArrayType();if(Object.hasOwn(e,\"properties\")||Object.hasOwn(e,\"additionalProperties\")||Object.hasOwn(e,\"patternProperties\"))return\"object\";if([\"int32\",\"int64\"].includes(e.format))return\"integer\";if([\"float\",\"double\"].includes(e.format))return\"number\";if(Object.hasOwn(e,\"minimum\")||Object.hasOwn(e,\"maximum\")||Object.hasOwn(e,\"exclusiveMinimum\")||Object.hasOwn(e,\"exclusiveMaximum\")||Object.hasOwn(e,\"multipleOf\"))return\"number | integer\";if(Object.hasOwn(e,\"pattern\")||Object.hasOwn(e,\"format\")||Object.hasOwn(e,\"minLength\")||Object.hasOwn(e,\"maxLength\"))return\"string\";if(void 0!==e.const){if(null===e.const)return\"null\";if(\"boolean\"==typeof e.const)return\"boolean\";if(\"number\"==typeof e.const)return Number.isInteger(e.const)?\"integer\":\"number\";if(\"string\"==typeof e.const)return\"string\";if(Array.isArray(e.const))return\"array<any>\";if(\"object\"==typeof e.const)return\"object\"}return null})(),handleCombiningKeywords(\"oneOf\",\" | \"),handleCombiningKeywords(\"anyOf\",\" | \"),handleCombiningKeywords(\"allOf\",\" & \")].filter(Boolean).join(\" | \");return t.delete(e),s||\"any\"},isBooleanJSONSchema=e=>\"boolean\"==typeof e,hasKeyword=(e,t)=>null!==e&&\"object\"==typeof e&&Object.hasOwn(e,t),isExpandable=e=>{const t=useFn();return e?.$schema||e?.$vocabulary||e?.$id||e?.$anchor||e?.$dynamicAnchor||e?.$ref||e?.$dynamicRef||e?.$defs||e?.$comment||e?.allOf||e?.anyOf||e?.oneOf||t.hasKeyword(e,\"not\")||t.hasKeyword(e,\"if\")||t.hasKeyword(e,\"then\")||t.hasKeyword(e,\"else\")||e?.dependentSchemas||e?.prefixItems||t.hasKeyword(e,\"items\")||t.hasKeyword(e,\"contains\")||e?.properties||e?.patternProperties||t.hasKeyword(e,\"additionalProperties\")||t.hasKeyword(e,\"propertyNames\")||t.hasKeyword(e,\"unevaluatedItems\")||t.hasKeyword(e,\"unevaluatedProperties\")||e?.description||e?.enum||t.hasKeyword(e,\"const\")||t.hasKeyword(e,\"contentSchema\")||t.hasKeyword(e,\"default\")},fn_stringify=e=>null===e||[\"number\",\"bigint\",\"boolean\"].includes(typeof e)?String(e):Array.isArray(e)?`[${e.map(fn_stringify).join(\", \")}]`:JSON.stringify(e),stringifyConstraintRange=(e,t,r)=>{const n=\"number\"==typeof t,a=\"number\"==typeof r;return n&&a?t===r?`${t} ${e}`:`[${t}, ${r}] ${e}`:n?`>= ${t} ${e}`:a?`<= ${r} ${e}`:null},stringifyConstraints=e=>{const t=[],r=(e=>{if(\"number\"!=typeof e?.multipleOf)return null;if(e.multipleOf<=0)return null;if(1===e.multipleOf)return null;const{multipleOf:t}=e;if(Number.isInteger(t))return`multiple of ${t}`;const r=10**t.toString().split(\".\")[1].length;return`multiple of ${t*r}/${r}`})(e);null!==r&&t.push({scope:\"number\",value:r});const n=(e=>{const t=e?.minimum,r=e?.maximum,n=e?.exclusiveMinimum,a=e?.exclusiveMaximum,o=\"number\"==typeof t,s=\"number\"==typeof r,l=\"number\"==typeof n,i=\"number\"==typeof a,c=l&&(!o||t<n),u=i&&(!s||r>a);if((o||l)&&(s||i))return`${c?\"(\":\"[\"}${c?n:t}, ${u?a:r}${u?\")\":\"]\"}`;if(o||l)return`${c?\">\":\"≥\"} ${c?n:t}`;if(s||i)return`${u?\"<\":\"≤\"} ${u?a:r}`;return null})(e);null!==n&&t.push({scope:\"number\",value:n}),e?.format&&t.push({scope:\"string\",value:e.format});const a=stringifyConstraintRange(\"characters\",e?.minLength,e?.maxLength);null!==a&&t.push({scope:\"string\",value:a}),e?.pattern&&t.push({scope:\"string\",value:`matches ${e?.pattern}`}),e?.contentMediaType&&t.push({scope:\"string\",value:`media type: ${e.contentMediaType}`}),e?.contentEncoding&&t.push({scope:\"string\",value:`encoding: ${e.contentEncoding}`});const o=stringifyConstraintRange(e?.hasUniqueItems?\"unique items\":\"items\",e?.minItems,e?.maxItems);null!==o&&t.push({scope:\"array\",value:o});const s=stringifyConstraintRange(\"contained items\",e?.minContains,e?.maxContains);null!==s&&t.push({scope:\"array\",value:s});const l=stringifyConstraintRange(\"properties\",e?.minProperties,e?.maxProperties);return null!==l&&t.push({scope:\"object\",value:l}),t},getDependentRequired=(e,t)=>t?.dependentRequired?Array.from(Object.entries(t.dependentRequired).reduce(((t,[r,n])=>Array.isArray(n)&&n.includes(e)?(t.add(r),t):t),new Set)):[],withJSONSchemaContext=(e,t={})=>{const r={components:{JSONSchema:hs,Keyword$schema:keywords_$schema,Keyword$vocabulary:$vocabulary_$vocabulary,Keyword$id:keywords_$id,Keyword$anchor:keywords_$anchor,Keyword$dynamicAnchor:keywords_$dynamicAnchor,Keyword$ref:keywords_$ref,Keyword$dynamicRef:keywords_$dynamicRef,Keyword$defs:keywords_$defs,Keyword$comment:keywords_$comment,KeywordAllOf:keywords_AllOf,KeywordAnyOf:keywords_AnyOf,KeywordOneOf:keywords_OneOf,KeywordNot:keywords_Not,KeywordIf:keywords_If,KeywordThen:keywords_Then,KeywordElse:keywords_Else,KeywordDependentSchemas:keywords_DependentSchemas,KeywordPrefixItems:keywords_PrefixItems,KeywordItems:keywords_Items,KeywordContains:keywords_Contains,KeywordProperties:keywords_Properties_Properties,KeywordPatternProperties:PatternProperties_PatternProperties,KeywordAdditionalProperties:keywords_AdditionalProperties,KeywordPropertyNames:keywords_PropertyNames,KeywordUnevaluatedItems:keywords_UnevaluatedItems,KeywordUnevaluatedProperties:keywords_UnevaluatedProperties,KeywordType:keywords_Type,KeywordEnum:Enum_Enum,KeywordConst:keywords_Const,KeywordConstraint:gs,KeywordDependentRequired:DependentRequired_DependentRequired,KeywordContentSchema:keywords_ContentSchema,KeywordTitle:Title_Title,KeywordDescription:keywords_Description_Description,KeywordDefault:keywords_Default,KeywordDeprecated:keywords_Deprecated,KeywordReadOnly:keywords_ReadOnly,KeywordWriteOnly:keywords_WriteOnly,Accordion:Accordion_Accordion,ExpandDeepButton:ExpandDeepButton_ExpandDeepButton,ChevronRightIcon:icons_ChevronRight,...t.components},config:{default$schema:\"https://json-schema.org/draft/2020-12/schema\",defaultExpandedLevels:0,...t.config},fn:{upperFirst:fn_upperFirst,getTitle,getType,isBooleanJSONSchema,hasKeyword,isExpandable,stringify:fn_stringify,stringifyConstraints,getDependentRequired,...t.fn}},HOC=t=>Ke.default.createElement(us.Provider,{value:r},Ke.default.createElement(e,t));return HOC.contexts={JSONSchemaContext:us},HOC.displayName=e.displayName,HOC};var json_schema_2020_12=()=>({components:{JSONSchema202012:hs,JSONSchema202012Keyword$schema:keywords_$schema,JSONSchema202012Keyword$vocabulary:$vocabulary_$vocabulary,JSONSchema202012Keyword$id:keywords_$id,JSONSchema202012Keyword$anchor:keywords_$anchor,JSONSchema202012Keyword$dynamicAnchor:keywords_$dynamicAnchor,JSONSchema202012Keyword$ref:keywords_$ref,JSONSchema202012Keyword$dynamicRef:keywords_$dynamicRef,JSONSchema202012Keyword$defs:keywords_$defs,JSONSchema202012Keyword$comment:keywords_$comment,JSONSchema202012KeywordAllOf:keywords_AllOf,JSONSchema202012KeywordAnyOf:keywords_AnyOf,JSONSchema202012KeywordOneOf:keywords_OneOf,JSONSchema202012KeywordNot:keywords_Not,JSONSchema202012KeywordIf:keywords_If,JSONSchema202012KeywordThen:keywords_Then,JSONSchema202012KeywordElse:keywords_Else,JSONSchema202012KeywordDependentSchemas:keywords_DependentSchemas,JSONSchema202012KeywordPrefixItems:keywords_PrefixItems,JSONSchema202012KeywordItems:keywords_Items,JSONSchema202012KeywordContains:keywords_Contains,JSONSchema202012KeywordProperties:keywords_Properties_Properties,JSONSchema202012KeywordPatternProperties:PatternProperties_PatternProperties,JSONSchema202012KeywordAdditionalProperties:keywords_AdditionalProperties,JSONSchema202012KeywordPropertyNames:keywords_PropertyNames,JSONSchema202012KeywordUnevaluatedItems:keywords_UnevaluatedItems,JSONSchema202012KeywordUnevaluatedProperties:keywords_UnevaluatedProperties,JSONSchema202012KeywordType:keywords_Type,JSONSchema202012KeywordEnum:Enum_Enum,JSONSchema202012KeywordConst:keywords_Const,JSONSchema202012KeywordConstraint:gs,JSONSchema202012KeywordDependentRequired:DependentRequired_DependentRequired,JSONSchema202012KeywordContentSchema:keywords_ContentSchema,JSONSchema202012KeywordTitle:Title_Title,JSONSchema202012KeywordDescription:keywords_Description_Description,JSONSchema202012KeywordDefault:keywords_Default,JSONSchema202012KeywordDeprecated:keywords_Deprecated,JSONSchema202012KeywordReadOnly:keywords_ReadOnly,JSONSchema202012KeywordWriteOnly:keywords_WriteOnly,JSONSchema202012Accordion:Accordion_Accordion,JSONSchema202012ExpandDeepButton:ExpandDeepButton_ExpandDeepButton,JSONSchema202012ChevronRightIcon:icons_ChevronRight,withJSONSchema202012Context:withJSONSchemaContext,JSONSchema202012DeepExpansionContext:()=>ps},fn:{upperFirst:fn_upperFirst,jsonSchema202012:{isExpandable,hasKeyword,useFn,useConfig,useComponent,useIsExpandedDeeply}}}),ys=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return ve.default}});var array=(e,{sample:t})=>((e,t={})=>{const{minItems:r,maxItems:n,uniqueItems:a}=t,{contains:o,minContains:s,maxContains:l}=t;let i=[...e];if(null!=o&&\"object\"==typeof o){if(Number.isInteger(s)&&s>1){const e=i.at(0);for(let t=1;t<s;t+=1)i.unshift(e)}Number.isInteger(l)}if(Number.isInteger(n)&&n>0&&(i=e.slice(0,n)),Number.isInteger(r)&&r>0)for(let e=0;i.length<r;e+=1)i.push(i[e%i.length]);return!0===a&&(i=Array.from(new Set(i))),i})(t,e);var object=()=>{throw new Error(\"Not implemented\")};const bytes=e=>ht()(e),pick=e=>e.at(0),predicates_isBooleanJSONSchema=e=>\"boolean\"==typeof e,isJSONSchemaObject=e=>(0,ys.default)(e),isJSONSchema=e=>predicates_isBooleanJSONSchema(e)||isJSONSchemaObject(e);var Es=class Registry{data={};register(e,t){this.data[e]=t}unregister(e){void 0===e?this.data={}:delete this.data[e]}get(e){return this.data[e]}};var int32=()=>2**30>>>0;var int64=()=>2**53-1;var generators_float=()=>.1;var generators_double=()=>.1;var email=()=>\"user@example.com\";var idn_email=()=>\"실례@example.com\";var hostname=()=>\"example.com\";var idn_hostname=()=>\"실례.com\";var ipv4=()=>\"198.51.100.42\";var ipv6=()=>\"2001:0db8:5b96:0000:0000:426f:8e17:642a\";var uri=()=>\"https://example.com/\";var uri_reference=()=>\"path/index.html\";var iri=()=>\"https://실례.com/\";var iri_reference=()=>\"path/실례.html\";var uuid=()=>\"3fa85f64-5717-4562-b3fc-2c963f66afa6\";var uri_template=()=>\"https://example.com/dictionary/{term:1}/{term}\";var json_pointer=()=>\"/a/b/c\";var relative_json_pointer=()=>\"1/0\";var date_time=()=>(new Date).toISOString();var date=()=>(new Date).toISOString().substring(0,10);var time=()=>(new Date).toISOString().substring(11);var duration=()=>\"P3D\";var generators_password=()=>\"********\";var regex=()=>\"^[a-z]+$\";const Ss=new class FormatRegistry extends Es{#e={int32,int64,float:generators_float,double:generators_double,email,\"idn-email\":idn_email,hostname,\"idn-hostname\":idn_hostname,ipv4,ipv6,uri,\"uri-reference\":uri_reference,iri,\"iri-reference\":iri_reference,uuid,\"uri-template\":uri_template,\"json-pointer\":json_pointer,\"relative-json-pointer\":relative_json_pointer,\"date-time\":date_time,date,time,duration,password:generators_password,regex};data={...this.#e};get defaults(){return{...this.#e}}},formatAPI=(e,t)=>\"function\"==typeof t?Ss.register(e,t):null===t?Ss.unregister(e):Ss.get(e);formatAPI.getDefaults=()=>Ss.defaults;var _s=formatAPI,vs=__webpack_require__(287).Buffer;var _7bit=e=>vs.from(e).toString(\"ascii\"),bs=__webpack_require__(287).Buffer;var _8bit=e=>bs.from(e).toString(\"utf8\"),ws=__webpack_require__(287).Buffer;var binary=e=>ws.from(e).toString(\"binary\");var quoted_printable=e=>{let t=\"\";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);if(61===n)t+=\"=3D\";else if(n>=33&&n<=60||n>=62&&n<=126||9===n||32===n)t+=e.charAt(r);else if(13===n||10===n)t+=\"\\r\\n\";else if(n>126){const n=unescape(encodeURIComponent(e.charAt(r)));for(let e=0;e<n.length;e++)t+=\"=\"+(\"0\"+n.charCodeAt(e).toString(16)).slice(-2).toUpperCase()}else t+=\"=\"+(\"0\"+n.toString(16)).slice(-2).toUpperCase()}return t},Cs=__webpack_require__(287).Buffer;var base16=e=>Cs.from(e).toString(\"hex\"),xs=__webpack_require__(287).Buffer;var base32=e=>{const t=xs.from(e).toString(\"utf8\"),r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\";let n=0,a=\"\",o=0,s=0;for(let e=0;e<t.length;e++)for(o=o<<8|t.charCodeAt(e),s+=8;s>=5;)a+=r.charAt(o>>>s-5&31),s-=5;s>0&&(a+=r.charAt(o<<5-s&31),n=(8-8*t.length%5)%5);for(let e=0;e<n;e++)a+=\"=\";return a},Os=__webpack_require__(287).Buffer;var base64=e=>Os.from(e).toString(\"base64\"),ks=__webpack_require__(287).Buffer;var base64url=e=>ks.from(e).toString(\"base64url\");const Ns=new class EncoderRegistry extends Es{#e={\"7bit\":_7bit,\"8bit\":_8bit,binary,\"quoted-printable\":quoted_printable,base16,base32,base64,base64url};data={...this.#e};get defaults(){return{...this.#e}}},encoderAPI=(e,t)=>\"function\"==typeof t?Ns.register(e,t):null===t?Ns.unregister(e):Ns.get(e);encoderAPI.getDefaults=()=>Ns.defaults;var As=encoderAPI;var Is={\"text/plain\":()=>\"string\",\"text/css\":()=>\".selector { border: 1px solid red }\",\"text/csv\":()=>\"value1,value2,value3\",\"text/html\":()=>\"<p>content</p>\",\"text/calendar\":()=>\"BEGIN:VCALENDAR\",\"text/javascript\":()=>\"console.dir('Hello world!');\",\"text/xml\":()=>'<person age=\"30\">John Doe</person>',\"text/*\":()=>\"string\"};var Rs={\"image/*\":()=>bytes(25).toString(\"binary\")};var Ts={\"audio/*\":()=>bytes(25).toString(\"binary\")};var Bs={\"video/*\":()=>bytes(25).toString(\"binary\")};var js={\"application/json\":()=>'{\"key\":\"value\"}',\"application/ld+json\":()=>'{\"name\": \"John Doe\"}',\"application/x-httpd-php\":()=>\"<?php echo '<p>Hello World!</p>'; ?>\",\"application/rtf\":()=>String.raw`{\\rtf1\\adeflang1025\\ansi\\ansicpg1252\\uc1`,\"application/x-sh\":()=>'echo \"Hello World!\"',\"application/xhtml+xml\":()=>\"<p>content</p>\",\"application/*\":()=>bytes(25).toString(\"binary\")};const Ps=new class MediaTypeRegistry extends Es{#e={...Is,...Rs,...Ts,...Bs,...js};data={...this.#e};get defaults(){return{...this.#e}}},mediaTypeAPI=(e,t)=>{if(\"function\"==typeof t)return Ps.register(e,t);if(null===t)return Ps.unregister(e);const r=e.split(\";\").at(0),n=`${r.split(\"/\").at(0)}/*`;return Ps.get(e)||Ps.get(r)||Ps.get(n)};mediaTypeAPI.getDefaults=()=>Ps.defaults;var Ms=mediaTypeAPI;const applyStringConstraints=(e,t={})=>{const{maxLength:r,minLength:n}=t;let a=e;if(Number.isInteger(r)&&r>0&&(a=a.slice(0,r)),Number.isInteger(n)&&n>0){let e=0;for(;a.length<n;)a+=a[e++%a.length]}return a};var types_string=(e,{sample:t}={})=>{const{contentEncoding:r,contentMediaType:n,contentSchema:a}=e,{pattern:o,format:s}=e,l=As(r)||Qn.default;let i;return i=\"string\"==typeof o?applyStringConstraints((e=>{try{return new xr.default(e).gen()}catch{return\"string\"}})(o),e):\"string\"==typeof s?(e=>{const{format:t}=e,r=_s(t);return\"function\"==typeof r?r(e):\"string\"})(e):isJSONSchema(a)&&\"string\"==typeof n&&void 0!==t?Array.isArray(t)||\"object\"==typeof t?JSON.stringify(t):applyStringConstraints(String(t),e):\"string\"==typeof n?(e=>{const{contentMediaType:t}=e,r=Ms(t);return\"function\"==typeof r?r(e):\"string\"})(e):applyStringConstraints(\"string\",e),l(i)};const applyNumberConstraints=(e,t={})=>{const{minimum:r,maximum:n,exclusiveMinimum:a,exclusiveMaximum:o}=t,{multipleOf:s}=t,l=Number.isInteger(e)?1:Number.EPSILON;let i=\"number\"==typeof r?r:null,c=\"number\"==typeof n?n:null,u=e;if(\"number\"==typeof a&&(i=null!==i?Math.max(i,a+l):a+l),\"number\"==typeof o&&(c=null!==c?Math.min(c,o-l):o-l),u=i>c&&e||i||c||u,\"number\"==typeof s&&s>0){const e=u%s;u=0===e?u:u+s-e}return u};var types_number=e=>{const{format:t}=e;let r;return r=\"string\"==typeof t?(e=>{const{format:t}=e,r=_s(t);return\"function\"==typeof r?r(e):0})(e):0,applyNumberConstraints(r,e)};var types_integer=e=>{const{format:t}=e;let r;return r=\"string\"==typeof t?(e=>{const{format:t}=e,r=_s(t);if(\"function\"==typeof r)return r(e);switch(t){case\"int32\":return int32();case\"int64\":return int64()}return 0})(e):0,applyNumberConstraints(r,e)};var types_boolean=e=>\"boolean\"!=typeof e.default||e.default;var qs=new Proxy({array,object,string:types_string,number:types_number,integer:types_integer,boolean:types_boolean,null:()=>null},{get:(e,t)=>\"string\"==typeof t&&Object.hasOwn(e,t)?e[t]:()=>`Unknown Type: ${t}`});const Ls=[\"array\",\"object\",\"number\",\"integer\",\"string\",\"boolean\",\"null\"],hasExample=e=>{if(!isJSONSchemaObject(e))return!1;const{examples:t,example:r,default:n}=e;return!!(Array.isArray(t)&&t.length>=1)||(void 0!==n||void 0!==r)},extractExample=e=>{if(!isJSONSchemaObject(e))return null;const{examples:t,example:r,default:n}=e;return Array.isArray(t)&&t.length>=1?t.at(0):void 0!==n?n:void 0!==r?r:void 0},Ds={array:[\"items\",\"prefixItems\",\"contains\",\"maxContains\",\"minContains\",\"maxItems\",\"minItems\",\"uniqueItems\",\"unevaluatedItems\"],object:[\"properties\",\"additionalProperties\",\"patternProperties\",\"propertyNames\",\"minProperties\",\"maxProperties\",\"required\",\"dependentSchemas\",\"dependentRequired\",\"unevaluatedProperties\"],string:[\"pattern\",\"format\",\"minLength\",\"maxLength\",\"contentEncoding\",\"contentMediaType\",\"contentSchema\"],integer:[\"minimum\",\"maximum\",\"exclusiveMinimum\",\"exclusiveMaximum\",\"multipleOf\"]};Ds.number=Ds.integer;const Us=\"string\",inferTypeFromValue=e=>void 0===e?null:null===e?\"null\":Array.isArray(e)?\"array\":Number.isInteger(e)?\"integer\":typeof e,foldType=e=>{if(Array.isArray(e)&&e.length>=1){if(e.includes(\"array\"))return\"array\";if(e.includes(\"object\"))return\"object\";{const t=pick(e);if(Ls.includes(t))return t}}return Ls.includes(e)?e:null},inferType=(e,t=new WeakSet)=>{if(!isJSONSchemaObject(e))return Us;if(t.has(e))return Us;t.add(e);let{type:r,const:n}=e;if(r=foldType(r),\"string\"!=typeof r){const t=Object.keys(Ds);e:for(let n=0;n<t.length;n+=1){const a=t[n],o=Ds[a];for(let t=0;t<o.length;t+=1){const n=o[t];if(Object.hasOwn(e,n)){r=a;break e}}}}if(\"string\"!=typeof r&&void 0!==n){const e=inferTypeFromValue(n);r=\"string\"==typeof e?e:r}if(\"string\"!=typeof r){const combineTypes=r=>{if(Array.isArray(e[r])){const n=e[r].map((e=>inferType(e,t)));return foldType(n)}return null},n=combineTypes(\"allOf\"),a=combineTypes(\"anyOf\"),o=combineTypes(\"oneOf\"),s=e.not?inferType(e.not,t):null;(n||a||o||s)&&(r=foldType([n,a,o,s].filter(Boolean)))}if(\"string\"!=typeof r&&hasExample(e)){const t=extractExample(e),n=inferTypeFromValue(t);r=\"string\"==typeof n?n:r}return t.delete(e),r||Us},type_getType=e=>inferType(e),typeCast=e=>predicates_isBooleanJSONSchema(e)?(e=>!1===e?{not:{}}:{})(e):isJSONSchemaObject(e)?e:{},merge=(e,t,r={})=>{if(predicates_isBooleanJSONSchema(e)&&!0===e)return!0;if(predicates_isBooleanJSONSchema(e)&&!1===e)return!1;if(predicates_isBooleanJSONSchema(t)&&!0===t)return!0;if(predicates_isBooleanJSONSchema(t)&&!1===t)return!1;if(!isJSONSchema(e))return t;if(!isJSONSchema(t))return e;const n={...t,...e};if(t.type&&e.type&&Array.isArray(t.type)&&\"string\"==typeof t.type){const r=normalizeArray(t.type).concat(e.type);n.type=Array.from(new Set(r))}if(Array.isArray(t.required)&&Array.isArray(e.required)&&(n.required=[...new Set([...e.required,...t.required])]),t.properties&&e.properties){const a=new Set([...Object.keys(t.properties),...Object.keys(e.properties)]);n.properties={};for(const o of a){const a=t.properties[o]||{},s=e.properties[o]||{};a.readOnly&&!r.includeReadOnly||a.writeOnly&&!r.includeWriteOnly?n.required=(n.required||[]).filter((e=>e!==o)):n.properties[o]=merge(s,a,r)}}return isJSONSchema(t.items)&&isJSONSchema(e.items)&&(n.items=merge(e.items,t.items,r)),isJSONSchema(t.contains)&&isJSONSchema(e.contains)&&(n.contains=merge(e.contains,t.contains,r)),isJSONSchema(t.contentSchema)&&isJSONSchema(e.contentSchema)&&(n.contentSchema=merge(e.contentSchema,t.contentSchema,r)),n};var $s=merge;const main_sampleFromSchemaGeneric=(e,t={},r=void 0,n=!1)=>{if(null==e&&void 0===r)return;\"function\"==typeof e?.toJS&&(e=e.toJS()),e=typeCast(e);let a=void 0!==r||hasExample(e);const o=!a&&Array.isArray(e.oneOf)&&e.oneOf.length>0,s=!a&&Array.isArray(e.anyOf)&&e.anyOf.length>0;if(!a&&(o||s)){const r=typeCast(pick(o?e.oneOf:e.anyOf));!(e=$s(e,r,t)).xml&&r.xml&&(e.xml=r.xml),hasExample(e)&&hasExample(r)&&(a=!0)}const l={};let{xml:i,properties:c,additionalProperties:u,items:d,contains:p}=e||{},m=type_getType(e),{includeReadOnly:f,includeWriteOnly:h}=t;i=i||{};let g,{name:y,prefix:S,namespace:_}=i,v={};if(Object.hasOwn(e,\"type\")||(e.type=m),n&&(y=y||\"notagname\",g=(S?`${S}:`:\"\")+y,_)){l[S?`xmlns:${S}`:\"xmlns\"]=_}n&&(v[g]=[]);const b=objectify(c);let w,C=0;const hasExceededMaxProperties=()=>Number.isInteger(e.maxProperties)&&e.maxProperties>0&&C>=e.maxProperties,canAddProperty=t=>!(Number.isInteger(e.maxProperties)&&e.maxProperties>0)||!hasExceededMaxProperties()&&(!(t=>!Array.isArray(e.required)||0===e.required.length||!e.required.includes(t))(t)||e.maxProperties-C-(()=>{if(!Array.isArray(e.required)||0===e.required.length)return 0;let t=0;return n?e.required.forEach((e=>t+=void 0===v[e]?0:1)):e.required.forEach((e=>{t+=void 0===v[g]?.find((t=>void 0!==t[e]))?0:1})),e.required.length-t})()>0);if(w=n?(r,a=void 0)=>{if(e&&b[r]){if(b[r].xml=b[r].xml||{},b[r].xml.attribute){const e=Array.isArray(b[r].enum)?pick(b[r].enum):void 0;if(hasExample(b[r]))l[b[r].xml.name||r]=extractExample(b[r]);else if(void 0!==e)l[b[r].xml.name||r]=e;else{const e=typeCast(b[r]),t=type_getType(e),n=b[r].xml.name||r;l[n]=qs[t](e)}return}b[r].xml.name=b[r].xml.name||r}else b[r]||!1===u||(b[r]={xml:{name:r}});let o=main_sampleFromSchemaGeneric(b[r],t,a,n);canAddProperty(r)&&(C++,Array.isArray(o)?v[g]=v[g].concat(o):v[g].push(o))}:(r,a)=>{if(canAddProperty(r)){if((0,ys.default)(e.discriminator?.mapping)&&e.discriminator.propertyName===r&&\"string\"==typeof e.$$ref){for(const t in e.discriminator.mapping)if(-1!==e.$$ref.search(e.discriminator.mapping[t])){v[r]=t;break}}else v[r]=main_sampleFromSchemaGeneric(b[r],t,a,n);C++}},a){let a;if(a=void 0!==r?r:extractExample(e),!n){if(\"number\"==typeof a&&\"string\"===m)return`${a}`;if(\"string\"!=typeof a||\"string\"===m)return a;try{return JSON.parse(a)}catch{return a}}if(\"array\"===m){if(!Array.isArray(a)){if(\"string\"==typeof a)return a;a=[a]}let r=[];return isJSONSchemaObject(d)&&(d.xml=d.xml||i||{},d.xml.name=d.xml.name||i.name,r=a.map((e=>main_sampleFromSchemaGeneric(d,t,e,n)))),isJSONSchemaObject(p)&&(p.xml=p.xml||i||{},p.xml.name=p.xml.name||i.name,r=[main_sampleFromSchemaGeneric(p,t,void 0,n),...r]),r=qs.array(e,{sample:r}),i.wrapped?(v[g]=r,(0,Or.default)(l)||v[g].push({_attr:l})):v=r,v}if(\"object\"===m){if(\"string\"==typeof a)return a;for(const e in a)Object.hasOwn(a,e)&&(b[e]?.readOnly&&!f||b[e]?.writeOnly&&!h||(b[e]?.xml?.attribute?l[b[e].xml.name||e]=a[e]:w(e,a[e])));return(0,Or.default)(l)||v[g].push({_attr:l}),v}return v[g]=(0,Or.default)(l)?a:[{_attr:l},a],v}if(\"array\"===m){let r=[];if(isJSONSchemaObject(p))if(n&&(p.xml=p.xml||e.xml||{},p.xml.name=p.xml.name||i.name),Array.isArray(p.anyOf)){const{anyOf:e,...a}=d;r.push(...p.anyOf.map((e=>main_sampleFromSchemaGeneric($s(e,a,t),t,void 0,n))))}else if(Array.isArray(p.oneOf)){const{oneOf:e,...a}=d;r.push(...p.oneOf.map((e=>main_sampleFromSchemaGeneric($s(e,a,t),t,void 0,n))))}else{if(!(!n||n&&i.wrapped))return main_sampleFromSchemaGeneric(p,t,void 0,n);r.push(main_sampleFromSchemaGeneric(p,t,void 0,n))}if(isJSONSchemaObject(d))if(n&&(d.xml=d.xml||e.xml||{},d.xml.name=d.xml.name||i.name),Array.isArray(d.anyOf)){const{anyOf:e,...a}=d;r.push(...d.anyOf.map((e=>main_sampleFromSchemaGeneric($s(e,a,t),t,void 0,n))))}else if(Array.isArray(d.oneOf)){const{oneOf:e,...a}=d;r.push(...d.oneOf.map((e=>main_sampleFromSchemaGeneric($s(e,a,t),t,void 0,n))))}else{if(!(!n||n&&i.wrapped))return main_sampleFromSchemaGeneric(d,t,void 0,n);r.push(main_sampleFromSchemaGeneric(d,t,void 0,n))}return r=qs.array(e,{sample:r}),n&&i.wrapped?(v[g]=r,(0,Or.default)(l)||v[g].push({_attr:l}),v):r}if(\"object\"===m){for(let e in b)Object.hasOwn(b,e)&&(b[e]?.deprecated||b[e]?.readOnly&&!f||b[e]?.writeOnly&&!h||w(e));if(n&&l&&v[g].push({_attr:l}),hasExceededMaxProperties())return v;if(predicates_isBooleanJSONSchema(u)&&u)n?v[g].push({additionalProp:\"Anything can be here\"}):v.additionalProp1={},C++;else if(isJSONSchemaObject(u)){const r=u,a=main_sampleFromSchemaGeneric(r,t,void 0,n);if(n&&\"string\"==typeof r?.xml?.name&&\"notagname\"!==r?.xml?.name)v[g].push(a);else{const t=Number.isInteger(e.minProperties)&&e.minProperties>0&&C<e.minProperties?e.minProperties-C:3;for(let e=1;e<=t;e++){if(hasExceededMaxProperties())return v;if(n){const t={};t[\"additionalProp\"+e]=a.notagname,v[g].push(t)}else v[\"additionalProp\"+e]=a;C++}}}return v}let x;if(void 0!==e.const)x=e.const;else if(e&&Array.isArray(e.enum))x=pick(normalizeArray(e.enum));else{const r=isJSONSchemaObject(e.contentSchema)?main_sampleFromSchemaGeneric(e.contentSchema,t,void 0,n):void 0;x=qs[m](e,{sample:r})}return n?(v[g]=(0,Or.default)(l)?x:[{_attr:l},x],v):x},main_createXMLExample=(e,t,r)=>{const n=main_sampleFromSchemaGeneric(e,t,r,!0);if(n)return\"string\"==typeof n?n:Cr()(n,{declaration:!0,indent:\"\\t\"})},main_sampleFromSchema=(e,t,r)=>main_sampleFromSchemaGeneric(e,t,r,!1),main_resolver=(e,t,r)=>[e,JSON.stringify(t),JSON.stringify(r)],Js=utils_memoizeN(main_createXMLExample,main_resolver),Vs=utils_memoizeN(main_sampleFromSchema,main_resolver);const Ks=new class OptionRegistry extends Es{#e={};data={...this.#e};get defaults(){return{...this.#e}}};var api_optionAPI=(e,t)=>(void 0!==t&&Ks.register(e,t),Ks.get(e));const zs=[{when:/json/,shouldStringifyTypes:[\"string\"]}],Fs=[\"object\"];var fn_get_json_sample_schema=e=>(t,r,n,a)=>{const{fn:o}=e(),s=o.jsonSchema202012.memoizedSampleFromSchema(t,r,a),l=typeof s,i=zs.reduce(((e,t)=>t.when.test(n)?[...e,...t.shouldStringifyTypes]:e),Fs);return(0,ct.default)(i,(e=>e===l))?JSON.stringify(s,null,2):s};var fn_get_yaml_sample_schema=e=>(t,r,n,a)=>{const{fn:o}=e(),s=o.jsonSchema202012.getJsonSampleSchema(t,r,n,a);let l;try{l=Jt.default.dump(Jt.default.load(s),{lineWidth:-1},{schema:Jt.JSON_SCHEMA}),\"\\n\"===l[l.length-1]&&(l=l.slice(0,l.length-1))}catch(e){return console.error(e),\"error: could not generate yaml example\"}return l.replace(/\\t/g,\"  \")};var fn_get_xml_sample_schema=e=>(t,r,n)=>{const{fn:a}=e();if(t&&!t.xml&&(t.xml={}),t&&!t.xml.name){if(!t.$$ref&&(t.type||t.items||t.properties||t.additionalProperties))return'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n\\x3c!-- XML example cannot be generated; root element name is undefined --\\x3e';if(t.$$ref){let e=t.$$ref.match(/\\S*\\/(\\S+)$/);t.xml.name=e[1]}}return a.jsonSchema202012.memoizedCreateXMLExample(t,r,n)};var fn_get_sample_schema=e=>(t,r=\"\",n={},a=void 0)=>{const{fn:o}=e();return\"function\"==typeof t?.toJS&&(t=t.toJS()),\"function\"==typeof a?.toJS&&(a=a.toJS()),/xml/.test(r)?o.jsonSchema202012.getXmlSampleSchema(t,n,a):/(yaml|yml)/.test(r)?o.jsonSchema202012.getYamlSampleSchema(t,n,r,a):o.jsonSchema202012.getJsonSampleSchema(t,n,r,a)};var json_schema_2020_12_samples=({getSystem:e})=>{const t=fn_get_json_sample_schema(e),r=fn_get_yaml_sample_schema(e),n=fn_get_xml_sample_schema(e),a=fn_get_sample_schema(e);return{fn:{jsonSchema202012:{sampleFromSchema:main_sampleFromSchema,sampleFromSchemaGeneric:main_sampleFromSchemaGeneric,sampleOptionAPI:api_optionAPI,sampleEncoderAPI:As,sampleFormatAPI:_s,sampleMediaTypeAPI:Ms,createXMLExample:main_createXMLExample,memoizedSampleFromSchema:Vs,memoizedCreateXMLExample:Js,getJsonSampleSchema:t,getYamlSampleSchema:r,getXmlSampleSchema:n,getSampleSchema:a,mergeJsonSchema:$s}}}};function PresetApis(){return[base,oas3,json_schema_2020_12,json_schema_2020_12_samples,oas31]}var inline_plugin=e=>()=>({fn:e.fn,components:e.components});var factorization_system=e=>{const t=He()({layout:{layout:e.layout,filter:e.filter},spec:{spec:\"\",url:e.url},requestSnippets:e.requestSnippets},e.initialState);if(e.initialState)for(const[r,n]of Object.entries(e.initialState))void 0===n&&delete t[r];return{system:{configs:e.configs},plugins:e.presets,state:t}};var query=()=>e=>{const t=e.queryConfigEnabled?(()=>{const e=new URLSearchParams(ot.location.search);return Object.fromEntries(e)})():{};return Object.entries(t).reduce(((e,[t,r])=>(\"config\"===t?e.configUrl=r:\"urls.primaryName\"===t?e[t]=r:e=(0,En.default)(e,t,r),e)),{})};var sources_url=({url:e,system:t})=>async r=>{if(!e)return{};if(\"function\"!=typeof t.configsActions?.getConfigByUrl)return{};const n=(()=>{const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e})();return t.configsActions.getConfigByUrl({url:e,loadRemoteConfig:!0,requestInterceptor:r.requestInterceptor,responseInterceptor:r.responseInterceptor},(e=>{n.resolve(e)})),n.promise};var runtime=()=>()=>{const e={};return globalThis.location&&(e.oauth2RedirectUrl=`${globalThis.location.protocol}//${globalThis.location.host}${globalThis.location.pathname.substring(0,globalThis.location.pathname.lastIndexOf(\"/\"))}/oauth2-redirect.html`),e};var Ws=Object.freeze({dom_id:null,domNode:null,spec:{},url:\"\",urls:null,configUrl:null,layout:\"BaseLayout\",docExpansion:\"list\",maxDisplayedTags:-1,filter:!1,validatorUrl:\"https://validator.swagger.io/validator\",oauth2RedirectUrl:void 0,persistAuthorization:!1,configs:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,tryItOutEnabled:!1,requestInterceptor:e=>(e.curlOptions=[],e),responseInterceptor:e=>e,showMutatedRequest:!0,defaultModelRendering:\"example\",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:!1,requestSnippetsEnabled:!1,requestSnippets:{generators:{curl_bash:{title:\"cURL (bash)\",syntax:\"bash\"},curl_powershell:{title:\"cURL (PowerShell)\",syntax:\"powershell\"},curl_cmd:{title:\"cURL (CMD)\",syntax:\"bash\"}},defaultExpanded:!0,languages:null},supportedSubmitMethods:[\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"],queryConfigEnabled:!1,presets:[PresetApis],plugins:[],initialState:{},fn:{},components:{},syntaxHighlight:{activated:!0,theme:\"agate\"},operationsSorter:null,tagsSorter:null,onComplete:null,modelPropertyMacro:null,parameterMacro:null}),Hs=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return be.default}}),Gs=function(e){var t={};return __webpack_require__.d(t,e),t}({default:function(){return we.default}});var type_casters_array=(e,t=[])=>Array.isArray(e)?e:t;var type_casters_boolean=(e,t=!1)=>!0===e||\"true\"===e||1===e||\"1\"===e||!1!==e&&\"false\"!==e&&0!==e&&\"0\"!==e&&t;var dom_node=e=>null===e||\"null\"===e?null:e;var type_casters_filter=e=>{const t=String(e);return type_casters_boolean(e,t)};var type_casters_function=(e,t)=>\"function\"==typeof e?e:t;var nullable_array=e=>Array.isArray(e)?e:null;var nullable_function=e=>\"function\"==typeof e?e:null;var nullable_string=e=>null===e||\"null\"===e?null:String(e);var type_casters_number=(e,t=-1)=>{const r=parseInt(e,10);return Number.isNaN(r)?t:r};var type_casters_object=(e,t={})=>(0,ys.default)(e)?e:t;var sorter=e=>\"function\"==typeof e||\"string\"==typeof e?e:null;var type_casters_string=e=>String(e);var syntax_highlight=(e,t)=>(0,ys.default)(e)?e:!1===e||\"false\"===e||0===e||\"0\"===e?{activated:!1}:t;var undefined_string=e=>void 0===e||\"undefined\"===e?void 0:String(e);var Xs={components:{typeCaster:type_casters_object},configs:{typeCaster:type_casters_object},configUrl:{typeCaster:nullable_string},deepLinking:{typeCaster:type_casters_boolean,defaultValue:Ws.deepLinking},defaultModelExpandDepth:{typeCaster:type_casters_number,defaultValue:Ws.defaultModelExpandDepth},defaultModelRendering:{typeCaster:type_casters_string},defaultModelsExpandDepth:{typeCaster:type_casters_number,defaultValue:Ws.defaultModelsExpandDepth},displayOperationId:{typeCaster:type_casters_boolean,defaultValue:Ws.displayOperationId},displayRequestDuration:{typeCaster:type_casters_boolean,defaultValue:Ws.displayRequestDuration},docExpansion:{typeCaster:type_casters_string},dom_id:{typeCaster:nullable_string},domNode:{typeCaster:dom_node},filter:{typeCaster:type_casters_filter},fn:{typeCaster:type_casters_object},initialState:{typeCaster:type_casters_object},layout:{typeCaster:type_casters_string},maxDisplayedTags:{typeCaster:type_casters_number,defaultValue:Ws.maxDisplayedTags},modelPropertyMacro:{typeCaster:nullable_function},oauth2RedirectUrl:{typeCaster:undefined_string},onComplete:{typeCaster:nullable_function},operationsSorter:{typeCaster:sorter},paramaterMacro:{typeCaster:nullable_function},persistAuthorization:{typeCaster:type_casters_boolean,defaultValue:Ws.persistAuthorization},plugins:{typeCaster:type_casters_array,defaultValue:Ws.plugins},presets:{typeCaster:type_casters_array,defaultValue:Ws.presets},requestInterceptor:{typeCaster:type_casters_function,defaultValue:Ws.requestInterceptor},requestSnippets:{typeCaster:type_casters_object,defaultValue:Ws.requestSnippets},requestSnippetsEnabled:{typeCaster:type_casters_boolean,defaultValue:Ws.requestSnippetsEnabled},responseInterceptor:{typeCaster:type_casters_function,defaultValue:Ws.responseInterceptor},showCommonExtensions:{typeCaster:type_casters_boolean,defaultValue:Ws.showCommonExtensions},showExtensions:{typeCaster:type_casters_boolean,defaultValue:Ws.showExtensions},showMutatedRequest:{typeCaster:type_casters_boolean,defaultValue:Ws.showMutatedRequest},spec:{typeCaster:type_casters_object,defaultValue:Ws.spec},supportedSubmitMethods:{typeCaster:type_casters_array,defaultValue:Ws.supportedSubmitMethods},syntaxHighlight:{typeCaster:syntax_highlight,defaultValue:Ws.syntaxHighlight},\"syntaxHighlight.activated\":{typeCaster:type_casters_boolean,defaultValue:Ws.syntaxHighlight.activated},\"syntaxHighlight.theme\":{typeCaster:type_casters_string},tagsSorter:{typeCaster:sorter},tryItOutEnabled:{typeCaster:type_casters_boolean,defaultValue:Ws.tryItOutEnabled},url:{typeCaster:type_casters_string},urls:{typeCaster:nullable_array},\"urls.primaryName\":{typeCaster:type_casters_string},validatorUrl:{typeCaster:nullable_string},withCredentials:{typeCaster:type_casters_boolean,defaultValue:Ws.withCredentials}};var type_cast=e=>Object.entries(Xs).reduce(((e,[t,{typeCaster:r,defaultValue:n}])=>{if((0,Hs.default)(e,t)){const a=r((0,Qt.default)(e,t),n);e=(0,Gs.default)(t,a,e)}return e}),{...e});var config_merge=(e,...t)=>{let r=Symbol.for(\"domNode\"),n=Symbol.for(\"primaryName\");const a=[];for(const e of t){const t={...e};Object.hasOwn(t,\"domNode\")&&(r=t.domNode,delete t.domNode),Object.hasOwn(t,\"urls.primaryName\")?(n=t[\"urls.primaryName\"],delete t[\"urls.primaryName\"]):Array.isArray(t.urls)&&Object.hasOwn(t.urls,\"primaryName\")&&(n=t.urls.primaryName,delete t.urls.primaryName),a.push(t)}const o=He()(e,...a);return r!==Symbol.for(\"domNode\")&&(o.domNode=r),n!==Symbol.for(\"primaryName\")&&Array.isArray(o.urls)&&(o.urls.primaryName=n),type_cast(o)};function SwaggerUI(e){const t=query()(e),r=runtime()(),n=SwaggerUI.config.merge({},SwaggerUI.config.defaults,r,e,t),a=factorization_system(n),o=inline_plugin(n),s=new Store(a);s.register([n.plugins,o]);const l=s.getSystem(),persistConfigs=e=>{s.setConfigs(e),l.configsActions.loaded()},updateSpec=e=>{!t.url&&\"object\"==typeof e.spec&&Object.keys(e.spec).length>0?(l.specActions.updateUrl(\"\"),l.specActions.updateLoadingStatus(\"success\"),l.specActions.updateSpec(JSON.stringify(e.spec))):\"function\"==typeof l.specActions.download&&e.url&&!e.urls&&(l.specActions.updateUrl(e.url),l.specActions.download(e.url))},render=e=>{if(e.domNode)l.render(e.domNode,\"App\");else if(e.dom_id){const t=document.querySelector(e.dom_id);l.render(t,\"App\")}else null===e.dom_id||null===e.domNode||console.error(\"Skipped rendering: no `dom_id` or `domNode` was specified\")};return n.configUrl?((async()=>{const{configUrl:e}=n,r=await sources_url({url:e,system:l})(n),a=SwaggerUI.config.merge({},n,r,t);persistConfigs(a),null!==r&&updateSpec(a),render(a)})(),l):(persistConfigs(n),updateSpec(n),render(n),l)}SwaggerUI.System=Store,SwaggerUI.config={defaults:Ws,merge:config_merge,typeCast:type_cast,typeCastMappings:Xs},SwaggerUI.presets={base,apis:PresetApis},SwaggerUI.plugins={Auth:auth,Configs:configsPlugin,DeepLining:deep_linking,Err:err,Filter:filter,Icons:icons,JSONSchema5:json_schema_5,JSONSchema5Samples:json_schema_5_samples,JSONSchema202012:json_schema_2020_12,JSONSchema202012Samples:json_schema_2020_12_samples,Layout:plugins_layout,Logs:logs,OpenAPI30:oas3,OpenAPI31:oas3,OnComplete:on_complete,RequestSnippets:plugins_request_snippets,Spec:plugins_spec,SwaggerClient:swagger_client,Util:util,View:view,ViewLegacy:view_legacy,DownloadUrl:downloadUrlPlugin,SyntaxHighlighting:syntax_highlighting,Versions:versions,SafeRender:safe_render};var Ys=SwaggerUI}();var ke=Oe.A;export{ke as default};\n//# sourceMappingURL=swagger-ui-es-bundle-core.js.map"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui-es-bundle-core.js.LICENSE.txt",
    "content": "/*!\n * @description Recursive object extending\n * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>\n * @license MIT\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2013-2018 Viacheslav Lotsmanov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * 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, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author   Feross Aboukhadijeh <https://feross.org>\n * @license  MIT\n */\n\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui-es-bundle.js",
    "content": "/*! For license information please see swagger-ui-es-bundle.js.LICENSE.txt */\n(()=>{var o,s,i={69119:(o,s)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0}),s.BLANK_URL=s.relativeFirstCharacters=s.whitespaceEscapeCharsRegex=s.urlSchemeRegex=s.ctrlCharactersRegex=s.htmlCtrlEntityRegex=s.htmlEntitiesRegex=s.invalidProtocolRegex=void 0,s.invalidProtocolRegex=/^([^\\w]*)(javascript|data|vbscript)/im,s.htmlEntitiesRegex=/&#(\\w+)(^\\w|;)?/g,s.htmlCtrlEntityRegex=/&(newline|tab);/gi,s.ctrlCharactersRegex=/[\\u0000-\\u001F\\u007F-\\u009F\\u2000-\\u200D\\uFEFF]/gim,s.urlSchemeRegex=/^.+(:|&colon;)/gim,s.whitespaceEscapeCharsRegex=/(\\\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,s.relativeFirstCharacters=[\".\",\"/\"],s.BLANK_URL=\"about:blank\"},16750:(o,s,i)=>{\"use strict\";s.J=void 0;var u=i(69119);function decodeURI(o){try{return decodeURIComponent(o)}catch(s){return o}}s.J=function sanitizeUrl(o){if(!o)return u.BLANK_URL;var s,i,_=decodeURI(o);do{s=(_=decodeURI(_=(i=_,i.replace(u.ctrlCharactersRegex,\"\").replace(u.htmlEntitiesRegex,(function(o,s){return String.fromCharCode(s)}))).replace(u.htmlCtrlEntityRegex,\"\").replace(u.ctrlCharactersRegex,\"\").replace(u.whitespaceEscapeCharsRegex,\"\").trim())).match(u.ctrlCharactersRegex)||_.match(u.htmlEntitiesRegex)||_.match(u.htmlCtrlEntityRegex)||_.match(u.whitespaceEscapeCharsRegex)}while(s&&s.length>0);var w=_;if(!w)return u.BLANK_URL;if(function isRelativeUrlWithoutProtocol(o){return u.relativeFirstCharacters.indexOf(o[0])>-1}(w))return w;var x=w.match(u.urlSchemeRegex);if(!x)return w;var C=x[0];return u.invalidProtocolRegex.test(C)?u.BLANK_URL:w}},67526:(o,s)=>{\"use strict\";s.byteLength=function byteLength(o){var s=getLens(o),i=s[0],u=s[1];return 3*(i+u)/4-u},s.toByteArray=function toByteArray(o){var s,i,w=getLens(o),x=w[0],C=w[1],j=new _(function _byteLength(o,s,i){return 3*(s+i)/4-i}(0,x,C)),L=0,B=C>0?x-4:x;for(i=0;i<B;i+=4)s=u[o.charCodeAt(i)]<<18|u[o.charCodeAt(i+1)]<<12|u[o.charCodeAt(i+2)]<<6|u[o.charCodeAt(i+3)],j[L++]=s>>16&255,j[L++]=s>>8&255,j[L++]=255&s;2===C&&(s=u[o.charCodeAt(i)]<<2|u[o.charCodeAt(i+1)]>>4,j[L++]=255&s);1===C&&(s=u[o.charCodeAt(i)]<<10|u[o.charCodeAt(i+1)]<<4|u[o.charCodeAt(i+2)]>>2,j[L++]=s>>8&255,j[L++]=255&s);return j},s.fromByteArray=function fromByteArray(o){for(var s,u=o.length,_=u%3,w=[],x=16383,C=0,j=u-_;C<j;C+=x)w.push(encodeChunk(o,C,C+x>j?j:C+x));1===_?(s=o[u-1],w.push(i[s>>2]+i[s<<4&63]+\"==\")):2===_&&(s=(o[u-2]<<8)+o[u-1],w.push(i[s>>10]+i[s>>4&63]+i[s<<2&63]+\"=\"));return w.join(\"\")};for(var i=[],u=[],_=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,w=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",x=0;x<64;++x)i[x]=w[x],u[w.charCodeAt(x)]=x;function getLens(o){var s=o.length;if(s%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var i=o.indexOf(\"=\");return-1===i&&(i=s),[i,i===s?0:4-i%4]}function encodeChunk(o,s,u){for(var _,w,x=[],C=s;C<u;C+=3)_=(o[C]<<16&16711680)+(o[C+1]<<8&65280)+(255&o[C+2]),x.push(i[(w=_)>>18&63]+i[w>>12&63]+i[w>>6&63]+i[63&w]);return x.join(\"\")}u[\"-\".charCodeAt(0)]=62,u[\"_\".charCodeAt(0)]=63},48287:(o,s,i)=>{\"use strict\";const u=i(67526),_=i(251),w=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;s.Buffer=Buffer,s.SlowBuffer=function SlowBuffer(o){+o!=o&&(o=0);return Buffer.alloc(+o)},s.INSPECT_MAX_BYTES=50;const x=2147483647;function createBuffer(o){if(o>x)throw new RangeError('The value \"'+o+'\" is invalid for option \"size\"');const s=new Uint8Array(o);return Object.setPrototypeOf(s,Buffer.prototype),s}function Buffer(o,s,i){if(\"number\"==typeof o){if(\"string\"==typeof s)throw new TypeError('The \"string\" argument must be of type string. Received type number');return allocUnsafe(o)}return from(o,s,i)}function from(o,s,i){if(\"string\"==typeof o)return function fromString(o,s){\"string\"==typeof s&&\"\"!==s||(s=\"utf8\");if(!Buffer.isEncoding(s))throw new TypeError(\"Unknown encoding: \"+s);const i=0|byteLength(o,s);let u=createBuffer(i);const _=u.write(o,s);_!==i&&(u=u.slice(0,_));return u}(o,s);if(ArrayBuffer.isView(o))return function fromArrayView(o){if(isInstance(o,Uint8Array)){const s=new Uint8Array(o);return fromArrayBuffer(s.buffer,s.byteOffset,s.byteLength)}return fromArrayLike(o)}(o);if(null==o)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof o);if(isInstance(o,ArrayBuffer)||o&&isInstance(o.buffer,ArrayBuffer))return fromArrayBuffer(o,s,i);if(\"undefined\"!=typeof SharedArrayBuffer&&(isInstance(o,SharedArrayBuffer)||o&&isInstance(o.buffer,SharedArrayBuffer)))return fromArrayBuffer(o,s,i);if(\"number\"==typeof o)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const u=o.valueOf&&o.valueOf();if(null!=u&&u!==o)return Buffer.from(u,s,i);const _=function fromObject(o){if(Buffer.isBuffer(o)){const s=0|checked(o.length),i=createBuffer(s);return 0===i.length||o.copy(i,0,0,s),i}if(void 0!==o.length)return\"number\"!=typeof o.length||numberIsNaN(o.length)?createBuffer(0):fromArrayLike(o);if(\"Buffer\"===o.type&&Array.isArray(o.data))return fromArrayLike(o.data)}(o);if(_)return _;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof o[Symbol.toPrimitive])return Buffer.from(o[Symbol.toPrimitive](\"string\"),s,i);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof o)}function assertSize(o){if(\"number\"!=typeof o)throw new TypeError('\"size\" argument must be of type number');if(o<0)throw new RangeError('The value \"'+o+'\" is invalid for option \"size\"')}function allocUnsafe(o){return assertSize(o),createBuffer(o<0?0:0|checked(o))}function fromArrayLike(o){const s=o.length<0?0:0|checked(o.length),i=createBuffer(s);for(let u=0;u<s;u+=1)i[u]=255&o[u];return i}function fromArrayBuffer(o,s,i){if(s<0||o.byteLength<s)throw new RangeError('\"offset\" is outside of buffer bounds');if(o.byteLength<s+(i||0))throw new RangeError('\"length\" is outside of buffer bounds');let u;return u=void 0===s&&void 0===i?new Uint8Array(o):void 0===i?new Uint8Array(o,s):new Uint8Array(o,s,i),Object.setPrototypeOf(u,Buffer.prototype),u}function checked(o){if(o>=x)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+x.toString(16)+\" bytes\");return 0|o}function byteLength(o,s){if(Buffer.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||isInstance(o,ArrayBuffer))return o.byteLength;if(\"string\"!=typeof o)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof o);const i=o.length,u=arguments.length>2&&!0===arguments[2];if(!u&&0===i)return 0;let _=!1;for(;;)switch(s){case\"ascii\":case\"latin1\":case\"binary\":return i;case\"utf8\":case\"utf-8\":return utf8ToBytes(o).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*i;case\"hex\":return i>>>1;case\"base64\":return base64ToBytes(o).length;default:if(_)return u?-1:utf8ToBytes(o).length;s=(\"\"+s).toLowerCase(),_=!0}}function slowToString(o,s,i){let u=!1;if((void 0===s||s<0)&&(s=0),s>this.length)return\"\";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return\"\";if((i>>>=0)<=(s>>>=0))return\"\";for(o||(o=\"utf8\");;)switch(o){case\"hex\":return hexSlice(this,s,i);case\"utf8\":case\"utf-8\":return utf8Slice(this,s,i);case\"ascii\":return asciiSlice(this,s,i);case\"latin1\":case\"binary\":return latin1Slice(this,s,i);case\"base64\":return base64Slice(this,s,i);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return utf16leSlice(this,s,i);default:if(u)throw new TypeError(\"Unknown encoding: \"+o);o=(o+\"\").toLowerCase(),u=!0}}function swap(o,s,i){const u=o[s];o[s]=o[i],o[i]=u}function bidirectionalIndexOf(o,s,i,u,_){if(0===o.length)return-1;if(\"string\"==typeof i?(u=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),numberIsNaN(i=+i)&&(i=_?0:o.length-1),i<0&&(i=o.length+i),i>=o.length){if(_)return-1;i=o.length-1}else if(i<0){if(!_)return-1;i=0}if(\"string\"==typeof s&&(s=Buffer.from(s,u)),Buffer.isBuffer(s))return 0===s.length?-1:arrayIndexOf(o,s,i,u,_);if(\"number\"==typeof s)return s&=255,\"function\"==typeof Uint8Array.prototype.indexOf?_?Uint8Array.prototype.indexOf.call(o,s,i):Uint8Array.prototype.lastIndexOf.call(o,s,i):arrayIndexOf(o,[s],i,u,_);throw new TypeError(\"val must be string, number or Buffer\")}function arrayIndexOf(o,s,i,u,_){let w,x=1,C=o.length,j=s.length;if(void 0!==u&&(\"ucs2\"===(u=String(u).toLowerCase())||\"ucs-2\"===u||\"utf16le\"===u||\"utf-16le\"===u)){if(o.length<2||s.length<2)return-1;x=2,C/=2,j/=2,i/=2}function read(o,s){return 1===x?o[s]:o.readUInt16BE(s*x)}if(_){let u=-1;for(w=i;w<C;w++)if(read(o,w)===read(s,-1===u?0:w-u)){if(-1===u&&(u=w),w-u+1===j)return u*x}else-1!==u&&(w-=w-u),u=-1}else for(i+j>C&&(i=C-j),w=i;w>=0;w--){let i=!0;for(let u=0;u<j;u++)if(read(o,w+u)!==read(s,u)){i=!1;break}if(i)return w}return-1}function hexWrite(o,s,i,u){i=Number(i)||0;const _=o.length-i;u?(u=Number(u))>_&&(u=_):u=_;const w=s.length;let x;for(u>w/2&&(u=w/2),x=0;x<u;++x){const u=parseInt(s.substr(2*x,2),16);if(numberIsNaN(u))return x;o[i+x]=u}return x}function utf8Write(o,s,i,u){return blitBuffer(utf8ToBytes(s,o.length-i),o,i,u)}function asciiWrite(o,s,i,u){return blitBuffer(function asciiToBytes(o){const s=[];for(let i=0;i<o.length;++i)s.push(255&o.charCodeAt(i));return s}(s),o,i,u)}function base64Write(o,s,i,u){return blitBuffer(base64ToBytes(s),o,i,u)}function ucs2Write(o,s,i,u){return blitBuffer(function utf16leToBytes(o,s){let i,u,_;const w=[];for(let x=0;x<o.length&&!((s-=2)<0);++x)i=o.charCodeAt(x),u=i>>8,_=i%256,w.push(_),w.push(u);return w}(s,o.length-i),o,i,u)}function base64Slice(o,s,i){return 0===s&&i===o.length?u.fromByteArray(o):u.fromByteArray(o.slice(s,i))}function utf8Slice(o,s,i){i=Math.min(o.length,i);const u=[];let _=s;for(;_<i;){const s=o[_];let w=null,x=s>239?4:s>223?3:s>191?2:1;if(_+x<=i){let i,u,C,j;switch(x){case 1:s<128&&(w=s);break;case 2:i=o[_+1],128==(192&i)&&(j=(31&s)<<6|63&i,j>127&&(w=j));break;case 3:i=o[_+1],u=o[_+2],128==(192&i)&&128==(192&u)&&(j=(15&s)<<12|(63&i)<<6|63&u,j>2047&&(j<55296||j>57343)&&(w=j));break;case 4:i=o[_+1],u=o[_+2],C=o[_+3],128==(192&i)&&128==(192&u)&&128==(192&C)&&(j=(15&s)<<18|(63&i)<<12|(63&u)<<6|63&C,j>65535&&j<1114112&&(w=j))}}null===w?(w=65533,x=1):w>65535&&(w-=65536,u.push(w>>>10&1023|55296),w=56320|1023&w),u.push(w),_+=x}return function decodeCodePointsArray(o){const s=o.length;if(s<=C)return String.fromCharCode.apply(String,o);let i=\"\",u=0;for(;u<s;)i+=String.fromCharCode.apply(String,o.slice(u,u+=C));return i}(u)}s.kMaxLength=x,Buffer.TYPED_ARRAY_SUPPORT=function typedArraySupport(){try{const o=new Uint8Array(1),s={foo:function(){return 42}};return Object.setPrototypeOf(s,Uint8Array.prototype),Object.setPrototypeOf(o,s),42===o.foo()}catch(o){return!1}}(),Buffer.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(Buffer.prototype,\"parent\",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,\"offset\",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(o,s,i){return from(o,s,i)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(o,s,i){return function alloc(o,s,i){return assertSize(o),o<=0?createBuffer(o):void 0!==s?\"string\"==typeof i?createBuffer(o).fill(s,i):createBuffer(o).fill(s):createBuffer(o)}(o,s,i)},Buffer.allocUnsafe=function(o){return allocUnsafe(o)},Buffer.allocUnsafeSlow=function(o){return allocUnsafe(o)},Buffer.isBuffer=function isBuffer(o){return null!=o&&!0===o._isBuffer&&o!==Buffer.prototype},Buffer.compare=function compare(o,s){if(isInstance(o,Uint8Array)&&(o=Buffer.from(o,o.offset,o.byteLength)),isInstance(s,Uint8Array)&&(s=Buffer.from(s,s.offset,s.byteLength)),!Buffer.isBuffer(o)||!Buffer.isBuffer(s))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(o===s)return 0;let i=o.length,u=s.length;for(let _=0,w=Math.min(i,u);_<w;++_)if(o[_]!==s[_]){i=o[_],u=s[_];break}return i<u?-1:u<i?1:0},Buffer.isEncoding=function isEncoding(o){switch(String(o).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},Buffer.concat=function concat(o,s){if(!Array.isArray(o))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===o.length)return Buffer.alloc(0);let i;if(void 0===s)for(s=0,i=0;i<o.length;++i)s+=o[i].length;const u=Buffer.allocUnsafe(s);let _=0;for(i=0;i<o.length;++i){let s=o[i];if(isInstance(s,Uint8Array))_+s.length>u.length?(Buffer.isBuffer(s)||(s=Buffer.from(s)),s.copy(u,_)):Uint8Array.prototype.set.call(u,s,_);else{if(!Buffer.isBuffer(s))throw new TypeError('\"list\" argument must be an Array of Buffers');s.copy(u,_)}_+=s.length}return u},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){const o=this.length;if(o%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let s=0;s<o;s+=2)swap(this,s,s+1);return this},Buffer.prototype.swap32=function swap32(){const o=this.length;if(o%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let s=0;s<o;s+=4)swap(this,s,s+3),swap(this,s+1,s+2);return this},Buffer.prototype.swap64=function swap64(){const o=this.length;if(o%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let s=0;s<o;s+=8)swap(this,s,s+7),swap(this,s+1,s+6),swap(this,s+2,s+5),swap(this,s+3,s+4);return this},Buffer.prototype.toString=function toString(){const o=this.length;return 0===o?\"\":0===arguments.length?utf8Slice(this,0,o):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function equals(o){if(!Buffer.isBuffer(o))throw new TypeError(\"Argument must be a Buffer\");return this===o||0===Buffer.compare(this,o)},Buffer.prototype.inspect=function inspect(){let o=\"\";const i=s.INSPECT_MAX_BYTES;return o=this.toString(\"hex\",0,i).replace(/(.{2})/g,\"$1 \").trim(),this.length>i&&(o+=\" ... \"),\"<Buffer \"+o+\">\"},w&&(Buffer.prototype[w]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(o,s,i,u,_){if(isInstance(o,Uint8Array)&&(o=Buffer.from(o,o.offset,o.byteLength)),!Buffer.isBuffer(o))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof o);if(void 0===s&&(s=0),void 0===i&&(i=o?o.length:0),void 0===u&&(u=0),void 0===_&&(_=this.length),s<0||i>o.length||u<0||_>this.length)throw new RangeError(\"out of range index\");if(u>=_&&s>=i)return 0;if(u>=_)return-1;if(s>=i)return 1;if(this===o)return 0;let w=(_>>>=0)-(u>>>=0),x=(i>>>=0)-(s>>>=0);const C=Math.min(w,x),j=this.slice(u,_),L=o.slice(s,i);for(let o=0;o<C;++o)if(j[o]!==L[o]){w=j[o],x=L[o];break}return w<x?-1:x<w?1:0},Buffer.prototype.includes=function includes(o,s,i){return-1!==this.indexOf(o,s,i)},Buffer.prototype.indexOf=function indexOf(o,s,i){return bidirectionalIndexOf(this,o,s,i,!0)},Buffer.prototype.lastIndexOf=function lastIndexOf(o,s,i){return bidirectionalIndexOf(this,o,s,i,!1)},Buffer.prototype.write=function write(o,s,i,u){if(void 0===s)u=\"utf8\",i=this.length,s=0;else if(void 0===i&&\"string\"==typeof s)u=s,i=this.length,s=0;else{if(!isFinite(s))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");s>>>=0,isFinite(i)?(i>>>=0,void 0===u&&(u=\"utf8\")):(u=i,i=void 0)}const _=this.length-s;if((void 0===i||i>_)&&(i=_),o.length>0&&(i<0||s<0)||s>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");u||(u=\"utf8\");let w=!1;for(;;)switch(u){case\"hex\":return hexWrite(this,o,s,i);case\"utf8\":case\"utf-8\":return utf8Write(this,o,s,i);case\"ascii\":case\"latin1\":case\"binary\":return asciiWrite(this,o,s,i);case\"base64\":return base64Write(this,o,s,i);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return ucs2Write(this,o,s,i);default:if(w)throw new TypeError(\"Unknown encoding: \"+u);u=(\"\"+u).toLowerCase(),w=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function asciiSlice(o,s,i){let u=\"\";i=Math.min(o.length,i);for(let _=s;_<i;++_)u+=String.fromCharCode(127&o[_]);return u}function latin1Slice(o,s,i){let u=\"\";i=Math.min(o.length,i);for(let _=s;_<i;++_)u+=String.fromCharCode(o[_]);return u}function hexSlice(o,s,i){const u=o.length;(!s||s<0)&&(s=0),(!i||i<0||i>u)&&(i=u);let _=\"\";for(let u=s;u<i;++u)_+=B[o[u]];return _}function utf16leSlice(o,s,i){const u=o.slice(s,i);let _=\"\";for(let o=0;o<u.length-1;o+=2)_+=String.fromCharCode(u[o]+256*u[o+1]);return _}function checkOffset(o,s,i){if(o%1!=0||o<0)throw new RangeError(\"offset is not uint\");if(o+s>i)throw new RangeError(\"Trying to access beyond buffer length\")}function checkInt(o,s,i,u,_,w){if(!Buffer.isBuffer(o))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(s>_||s<w)throw new RangeError('\"value\" argument is out of bounds');if(i+u>o.length)throw new RangeError(\"Index out of range\")}function wrtBigUInt64LE(o,s,i,u,_){checkIntBI(s,u,_,o,i,7);let w=Number(s&BigInt(4294967295));o[i++]=w,w>>=8,o[i++]=w,w>>=8,o[i++]=w,w>>=8,o[i++]=w;let x=Number(s>>BigInt(32)&BigInt(4294967295));return o[i++]=x,x>>=8,o[i++]=x,x>>=8,o[i++]=x,x>>=8,o[i++]=x,i}function wrtBigUInt64BE(o,s,i,u,_){checkIntBI(s,u,_,o,i,7);let w=Number(s&BigInt(4294967295));o[i+7]=w,w>>=8,o[i+6]=w,w>>=8,o[i+5]=w,w>>=8,o[i+4]=w;let x=Number(s>>BigInt(32)&BigInt(4294967295));return o[i+3]=x,x>>=8,o[i+2]=x,x>>=8,o[i+1]=x,x>>=8,o[i]=x,i+8}function checkIEEE754(o,s,i,u,_,w){if(i+u>o.length)throw new RangeError(\"Index out of range\");if(i<0)throw new RangeError(\"Index out of range\")}function writeFloat(o,s,i,u,w){return s=+s,i>>>=0,w||checkIEEE754(o,0,i,4),_.write(o,s,i,u,23,4),i+4}function writeDouble(o,s,i,u,w){return s=+s,i>>>=0,w||checkIEEE754(o,0,i,8),_.write(o,s,i,u,52,8),i+8}Buffer.prototype.slice=function slice(o,s){const i=this.length;(o=~~o)<0?(o+=i)<0&&(o=0):o>i&&(o=i),(s=void 0===s?i:~~s)<0?(s+=i)<0&&(s=0):s>i&&(s=i),s<o&&(s=o);const u=this.subarray(o,s);return Object.setPrototypeOf(u,Buffer.prototype),u},Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(o,s,i){o>>>=0,s>>>=0,i||checkOffset(o,s,this.length);let u=this[o],_=1,w=0;for(;++w<s&&(_*=256);)u+=this[o+w]*_;return u},Buffer.prototype.readUintBE=Buffer.prototype.readUIntBE=function readUIntBE(o,s,i){o>>>=0,s>>>=0,i||checkOffset(o,s,this.length);let u=this[o+--s],_=1;for(;s>0&&(_*=256);)u+=this[o+--s]*_;return u},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(o,s){return o>>>=0,s||checkOffset(o,1,this.length),this[o]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(o,s){return o>>>=0,s||checkOffset(o,2,this.length),this[o]|this[o+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(o,s){return o>>>=0,s||checkOffset(o,2,this.length),this[o]<<8|this[o+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+16777216*this[o+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),16777216*this[o]+(this[o+1]<<16|this[o+2]<<8|this[o+3])},Buffer.prototype.readBigUInt64LE=defineBigIntMethod((function readBigUInt64LE(o){validateNumber(o>>>=0,\"offset\");const s=this[o],i=this[o+7];void 0!==s&&void 0!==i||boundsError(o,this.length-8);const u=s+256*this[++o]+65536*this[++o]+this[++o]*2**24,_=this[++o]+256*this[++o]+65536*this[++o]+i*2**24;return BigInt(u)+(BigInt(_)<<BigInt(32))})),Buffer.prototype.readBigUInt64BE=defineBigIntMethod((function readBigUInt64BE(o){validateNumber(o>>>=0,\"offset\");const s=this[o],i=this[o+7];void 0!==s&&void 0!==i||boundsError(o,this.length-8);const u=s*2**24+65536*this[++o]+256*this[++o]+this[++o],_=this[++o]*2**24+65536*this[++o]+256*this[++o]+i;return(BigInt(u)<<BigInt(32))+BigInt(_)})),Buffer.prototype.readIntLE=function readIntLE(o,s,i){o>>>=0,s>>>=0,i||checkOffset(o,s,this.length);let u=this[o],_=1,w=0;for(;++w<s&&(_*=256);)u+=this[o+w]*_;return _*=128,u>=_&&(u-=Math.pow(2,8*s)),u},Buffer.prototype.readIntBE=function readIntBE(o,s,i){o>>>=0,s>>>=0,i||checkOffset(o,s,this.length);let u=s,_=1,w=this[o+--u];for(;u>0&&(_*=256);)w+=this[o+--u]*_;return _*=128,w>=_&&(w-=Math.pow(2,8*s)),w},Buffer.prototype.readInt8=function readInt8(o,s){return o>>>=0,s||checkOffset(o,1,this.length),128&this[o]?-1*(255-this[o]+1):this[o]},Buffer.prototype.readInt16LE=function readInt16LE(o,s){o>>>=0,s||checkOffset(o,2,this.length);const i=this[o]|this[o+1]<<8;return 32768&i?4294901760|i:i},Buffer.prototype.readInt16BE=function readInt16BE(o,s){o>>>=0,s||checkOffset(o,2,this.length);const i=this[o+1]|this[o]<<8;return 32768&i?4294901760|i:i},Buffer.prototype.readInt32LE=function readInt32LE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},Buffer.prototype.readBigInt64LE=defineBigIntMethod((function readBigInt64LE(o){validateNumber(o>>>=0,\"offset\");const s=this[o],i=this[o+7];void 0!==s&&void 0!==i||boundsError(o,this.length-8);const u=this[o+4]+256*this[o+5]+65536*this[o+6]+(i<<24);return(BigInt(u)<<BigInt(32))+BigInt(s+256*this[++o]+65536*this[++o]+this[++o]*2**24)})),Buffer.prototype.readBigInt64BE=defineBigIntMethod((function readBigInt64BE(o){validateNumber(o>>>=0,\"offset\");const s=this[o],i=this[o+7];void 0!==s&&void 0!==i||boundsError(o,this.length-8);const u=(s<<24)+65536*this[++o]+256*this[++o]+this[++o];return(BigInt(u)<<BigInt(32))+BigInt(this[++o]*2**24+65536*this[++o]+256*this[++o]+i)})),Buffer.prototype.readFloatLE=function readFloatLE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),_.read(this,o,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(o,s){return o>>>=0,s||checkOffset(o,4,this.length),_.read(this,o,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(o,s){return o>>>=0,s||checkOffset(o,8,this.length),_.read(this,o,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(o,s){return o>>>=0,s||checkOffset(o,8,this.length),_.read(this,o,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(o,s,i,u){if(o=+o,s>>>=0,i>>>=0,!u){checkInt(this,o,s,i,Math.pow(2,8*i)-1,0)}let _=1,w=0;for(this[s]=255&o;++w<i&&(_*=256);)this[s+w]=o/_&255;return s+i},Buffer.prototype.writeUintBE=Buffer.prototype.writeUIntBE=function writeUIntBE(o,s,i,u){if(o=+o,s>>>=0,i>>>=0,!u){checkInt(this,o,s,i,Math.pow(2,8*i)-1,0)}let _=i-1,w=1;for(this[s+_]=255&o;--_>=0&&(w*=256);)this[s+_]=o/w&255;return s+i},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,1,255,0),this[s]=255&o,s+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,2,65535,0),this[s]=255&o,this[s+1]=o>>>8,s+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,2,65535,0),this[s]=o>>>8,this[s+1]=255&o,s+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,4,4294967295,0),this[s+3]=o>>>24,this[s+2]=o>>>16,this[s+1]=o>>>8,this[s]=255&o,s+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,4,4294967295,0),this[s]=o>>>24,this[s+1]=o>>>16,this[s+2]=o>>>8,this[s+3]=255&o,s+4},Buffer.prototype.writeBigUInt64LE=defineBigIntMethod((function writeBigUInt64LE(o,s=0){return wrtBigUInt64LE(this,o,s,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),Buffer.prototype.writeBigUInt64BE=defineBigIntMethod((function writeBigUInt64BE(o,s=0){return wrtBigUInt64BE(this,o,s,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),Buffer.prototype.writeIntLE=function writeIntLE(o,s,i,u){if(o=+o,s>>>=0,!u){const u=Math.pow(2,8*i-1);checkInt(this,o,s,i,u-1,-u)}let _=0,w=1,x=0;for(this[s]=255&o;++_<i&&(w*=256);)o<0&&0===x&&0!==this[s+_-1]&&(x=1),this[s+_]=(o/w|0)-x&255;return s+i},Buffer.prototype.writeIntBE=function writeIntBE(o,s,i,u){if(o=+o,s>>>=0,!u){const u=Math.pow(2,8*i-1);checkInt(this,o,s,i,u-1,-u)}let _=i-1,w=1,x=0;for(this[s+_]=255&o;--_>=0&&(w*=256);)o<0&&0===x&&0!==this[s+_+1]&&(x=1),this[s+_]=(o/w|0)-x&255;return s+i},Buffer.prototype.writeInt8=function writeInt8(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,1,127,-128),o<0&&(o=255+o+1),this[s]=255&o,s+1},Buffer.prototype.writeInt16LE=function writeInt16LE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,2,32767,-32768),this[s]=255&o,this[s+1]=o>>>8,s+2},Buffer.prototype.writeInt16BE=function writeInt16BE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,2,32767,-32768),this[s]=o>>>8,this[s+1]=255&o,s+2},Buffer.prototype.writeInt32LE=function writeInt32LE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,4,2147483647,-2147483648),this[s]=255&o,this[s+1]=o>>>8,this[s+2]=o>>>16,this[s+3]=o>>>24,s+4},Buffer.prototype.writeInt32BE=function writeInt32BE(o,s,i){return o=+o,s>>>=0,i||checkInt(this,o,s,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),this[s]=o>>>24,this[s+1]=o>>>16,this[s+2]=o>>>8,this[s+3]=255&o,s+4},Buffer.prototype.writeBigInt64LE=defineBigIntMethod((function writeBigInt64LE(o,s=0){return wrtBigUInt64LE(this,o,s,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),Buffer.prototype.writeBigInt64BE=defineBigIntMethod((function writeBigInt64BE(o,s=0){return wrtBigUInt64BE(this,o,s,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),Buffer.prototype.writeFloatLE=function writeFloatLE(o,s,i){return writeFloat(this,o,s,!0,i)},Buffer.prototype.writeFloatBE=function writeFloatBE(o,s,i){return writeFloat(this,o,s,!1,i)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(o,s,i){return writeDouble(this,o,s,!0,i)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(o,s,i){return writeDouble(this,o,s,!1,i)},Buffer.prototype.copy=function copy(o,s,i,u){if(!Buffer.isBuffer(o))throw new TypeError(\"argument should be a Buffer\");if(i||(i=0),u||0===u||(u=this.length),s>=o.length&&(s=o.length),s||(s=0),u>0&&u<i&&(u=i),u===i)return 0;if(0===o.length||0===this.length)return 0;if(s<0)throw new RangeError(\"targetStart out of bounds\");if(i<0||i>=this.length)throw new RangeError(\"Index out of range\");if(u<0)throw new RangeError(\"sourceEnd out of bounds\");u>this.length&&(u=this.length),o.length-s<u-i&&(u=o.length-s+i);const _=u-i;return this===o&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(s,i,u):Uint8Array.prototype.set.call(o,this.subarray(i,u),s),_},Buffer.prototype.fill=function fill(o,s,i,u){if(\"string\"==typeof o){if(\"string\"==typeof s?(u=s,s=0,i=this.length):\"string\"==typeof i&&(u=i,i=this.length),void 0!==u&&\"string\"!=typeof u)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof u&&!Buffer.isEncoding(u))throw new TypeError(\"Unknown encoding: \"+u);if(1===o.length){const s=o.charCodeAt(0);(\"utf8\"===u&&s<128||\"latin1\"===u)&&(o=s)}}else\"number\"==typeof o?o&=255:\"boolean\"==typeof o&&(o=Number(o));if(s<0||this.length<s||this.length<i)throw new RangeError(\"Out of range index\");if(i<=s)return this;let _;if(s>>>=0,i=void 0===i?this.length:i>>>0,o||(o=0),\"number\"==typeof o)for(_=s;_<i;++_)this[_]=o;else{const w=Buffer.isBuffer(o)?o:Buffer.from(o,u),x=w.length;if(0===x)throw new TypeError('The value \"'+o+'\" is invalid for argument \"value\"');for(_=0;_<i-s;++_)this[_+s]=w[_%x]}return this};const j={};function E(o,s,i){j[o]=class NodeError extends i{constructor(){super(),Object.defineProperty(this,\"message\",{value:s.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${o}]`,this.stack,delete this.name}get code(){return o}set code(o){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${o}]: ${this.message}`}}}function addNumericalSeparator(o){let s=\"\",i=o.length;const u=\"-\"===o[0]?1:0;for(;i>=u+4;i-=3)s=`_${o.slice(i-3,i)}${s}`;return`${o.slice(0,i)}${s}`}function checkIntBI(o,s,i,u,_,w){if(o>i||o<s){const u=\"bigint\"==typeof s?\"n\":\"\";let _;throw _=w>3?0===s||s===BigInt(0)?`>= 0${u} and < 2${u} ** ${8*(w+1)}${u}`:`>= -(2${u} ** ${8*(w+1)-1}${u}) and < 2 ** ${8*(w+1)-1}${u}`:`>= ${s}${u} and <= ${i}${u}`,new j.ERR_OUT_OF_RANGE(\"value\",_,o)}!function checkBounds(o,s,i){validateNumber(s,\"offset\"),void 0!==o[s]&&void 0!==o[s+i]||boundsError(s,o.length-(i+1))}(u,_,w)}function validateNumber(o,s){if(\"number\"!=typeof o)throw new j.ERR_INVALID_ARG_TYPE(s,\"number\",o)}function boundsError(o,s,i){if(Math.floor(o)!==o)throw validateNumber(o,i),new j.ERR_OUT_OF_RANGE(i||\"offset\",\"an integer\",o);if(s<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(i||\"offset\",`>= ${i?1:0} and <= ${s}`,o)}E(\"ERR_BUFFER_OUT_OF_BOUNDS\",(function(o){return o?`${o} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"}),RangeError),E(\"ERR_INVALID_ARG_TYPE\",(function(o,s){return`The \"${o}\" argument must be of type number. Received type ${typeof s}`}),TypeError),E(\"ERR_OUT_OF_RANGE\",(function(o,s,i){let u=`The value of \"${o}\" is out of range.`,_=i;return Number.isInteger(i)&&Math.abs(i)>2**32?_=addNumericalSeparator(String(i)):\"bigint\"==typeof i&&(_=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(_=addNumericalSeparator(_)),_+=\"n\"),u+=` It must be ${s}. Received ${_}`,u}),RangeError);const L=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(o,s){let i;s=s||1/0;const u=o.length;let _=null;const w=[];for(let x=0;x<u;++x){if(i=o.charCodeAt(x),i>55295&&i<57344){if(!_){if(i>56319){(s-=3)>-1&&w.push(239,191,189);continue}if(x+1===u){(s-=3)>-1&&w.push(239,191,189);continue}_=i;continue}if(i<56320){(s-=3)>-1&&w.push(239,191,189),_=i;continue}i=65536+(_-55296<<10|i-56320)}else _&&(s-=3)>-1&&w.push(239,191,189);if(_=null,i<128){if((s-=1)<0)break;w.push(i)}else if(i<2048){if((s-=2)<0)break;w.push(i>>6|192,63&i|128)}else if(i<65536){if((s-=3)<0)break;w.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error(\"Invalid code point\");if((s-=4)<0)break;w.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return w}function base64ToBytes(o){return u.toByteArray(function base64clean(o){if((o=(o=o.split(\"=\")[0]).trim().replace(L,\"\")).length<2)return\"\";for(;o.length%4!=0;)o+=\"=\";return o}(o))}function blitBuffer(o,s,i,u){let _;for(_=0;_<u&&!(_+i>=s.length||_>=o.length);++_)s[_+i]=o[_];return _}function isInstance(o,s){return o instanceof s||null!=o&&null!=o.constructor&&null!=o.constructor.name&&o.constructor.name===s.name}function numberIsNaN(o){return o!=o}const B=function(){const o=\"0123456789abcdef\",s=new Array(256);for(let i=0;i<16;++i){const u=16*i;for(let _=0;_<16;++_)s[u+_]=o[i]+o[_]}return s}();function defineBigIntMethod(o){return\"undefined\"==typeof BigInt?BufferBigIntNotDefined:o}function BufferBigIntNotDefined(){throw new Error(\"BigInt not supported\")}},38075:(o,s,i)=>{\"use strict\";var u=i(70453),_=i(10487),w=_(u(\"String.prototype.indexOf\"));o.exports=function callBoundIntrinsic(o,s){var i=u(o,!!s);return\"function\"==typeof i&&w(o,\".prototype.\")>-1?_(i):i}},10487:(o,s,i)=>{\"use strict\";var u=i(66743),_=i(70453),w=i(96897),x=i(69675),C=_(\"%Function.prototype.apply%\"),j=_(\"%Function.prototype.call%\"),L=_(\"%Reflect.apply%\",!0)||u.call(j,C),B=i(30655),$=_(\"%Math.max%\");o.exports=function callBind(o){if(\"function\"!=typeof o)throw new x(\"a function is required\");var s=L(u,j,arguments);return w(s,1+$(0,o.length-(arguments.length-1)),!0)};var V=function applyBind(){return L(u,C,arguments)};B?B(o.exports,\"apply\",{value:V}):o.exports.apply=V},57427:(o,s)=>{\"use strict\";s.parse=function parse(o,s){if(\"string\"!=typeof o)throw new TypeError(\"argument str must be a string\");var i={},u=(s||{}).decode||decode,_=0;for(;_<o.length;){var w=o.indexOf(\"=\",_);if(-1===w)break;var x=o.indexOf(\";\",_);if(-1===x)x=o.length;else if(x<w){_=o.lastIndexOf(\";\",w-1)+1;continue}var C=o.slice(_,w).trim();if(void 0===i[C]){var j=o.slice(w+1,x).trim();34===j.charCodeAt(0)&&(j=j.slice(1,-1)),i[C]=tryDecode(j,u)}_=x+1}return i},s.serialize=function serialize(o,s,_){var w=_||{},x=w.encode||encode;if(\"function\"!=typeof x)throw new TypeError(\"option encode is invalid\");if(!u.test(o))throw new TypeError(\"argument name is invalid\");var C=x(s);if(C&&!u.test(C))throw new TypeError(\"argument val is invalid\");var j=o+\"=\"+C;if(null!=w.maxAge){var L=w.maxAge-0;if(isNaN(L)||!isFinite(L))throw new TypeError(\"option maxAge is invalid\");j+=\"; Max-Age=\"+Math.floor(L)}if(w.domain){if(!u.test(w.domain))throw new TypeError(\"option domain is invalid\");j+=\"; Domain=\"+w.domain}if(w.path){if(!u.test(w.path))throw new TypeError(\"option path is invalid\");j+=\"; Path=\"+w.path}if(w.expires){var B=w.expires;if(!function isDate(o){return\"[object Date]\"===i.call(o)||o instanceof Date}(B)||isNaN(B.valueOf()))throw new TypeError(\"option expires is invalid\");j+=\"; Expires=\"+B.toUTCString()}w.httpOnly&&(j+=\"; HttpOnly\");w.secure&&(j+=\"; Secure\");w.partitioned&&(j+=\"; Partitioned\");if(w.priority){switch(\"string\"==typeof w.priority?w.priority.toLowerCase():w.priority){case\"low\":j+=\"; Priority=Low\";break;case\"medium\":j+=\"; Priority=Medium\";break;case\"high\":j+=\"; Priority=High\";break;default:throw new TypeError(\"option priority is invalid\")}}if(w.sameSite){switch(\"string\"==typeof w.sameSite?w.sameSite.toLowerCase():w.sameSite){case!0:j+=\"; SameSite=Strict\";break;case\"lax\":j+=\"; SameSite=Lax\";break;case\"strict\":j+=\"; SameSite=Strict\";break;case\"none\":j+=\"; SameSite=None\";break;default:throw new TypeError(\"option sameSite is invalid\")}}return j};var i=Object.prototype.toString,u=/^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;function decode(o){return-1!==o.indexOf(\"%\")?decodeURIComponent(o):o}function encode(o){return encodeURIComponent(o)}function tryDecode(o,s){try{return s(o)}catch(s){return o}}},17965:(o,s,i)=>{\"use strict\";var u=i(16426),_={\"text/plain\":\"Text\",\"text/html\":\"Url\",default:\"Text\"};o.exports=function copy(o,s){var i,w,x,C,j,L,B=!1;s||(s={}),i=s.debug||!1;try{if(x=u(),C=document.createRange(),j=document.getSelection(),(L=document.createElement(\"span\")).textContent=o,L.ariaHidden=\"true\",L.style.all=\"unset\",L.style.position=\"fixed\",L.style.top=0,L.style.clip=\"rect(0, 0, 0, 0)\",L.style.whiteSpace=\"pre\",L.style.webkitUserSelect=\"text\",L.style.MozUserSelect=\"text\",L.style.msUserSelect=\"text\",L.style.userSelect=\"text\",L.addEventListener(\"copy\",(function(u){if(u.stopPropagation(),s.format)if(u.preventDefault(),void 0===u.clipboardData){i&&console.warn(\"unable to use e.clipboardData\"),i&&console.warn(\"trying IE specific stuff\"),window.clipboardData.clearData();var w=_[s.format]||_.default;window.clipboardData.setData(w,o)}else u.clipboardData.clearData(),u.clipboardData.setData(s.format,o);s.onCopy&&(u.preventDefault(),s.onCopy(u.clipboardData))})),document.body.appendChild(L),C.selectNodeContents(L),j.addRange(C),!document.execCommand(\"copy\"))throw new Error(\"copy command was unsuccessful\");B=!0}catch(u){i&&console.error(\"unable to copy using execCommand: \",u),i&&console.warn(\"trying IE specific stuff\");try{window.clipboardData.setData(s.format||\"text\",o),s.onCopy&&s.onCopy(window.clipboardData),B=!0}catch(u){i&&console.error(\"unable to copy using clipboardData: \",u),i&&console.error(\"falling back to prompt\"),w=function format(o){var s=(/mac os x/i.test(navigator.userAgent)?\"⌘\":\"Ctrl\")+\"+C\";return o.replace(/#{\\s*key\\s*}/g,s)}(\"message\"in s?s.message:\"Copy to clipboard: #{key}, Enter\"),window.prompt(w,o)}}finally{j&&(\"function\"==typeof j.removeRange?j.removeRange(C):j.removeAllRanges()),L&&document.body.removeChild(L),x()}return B}},2205:function(o,s,i){var u;u=void 0!==i.g?i.g:this,o.exports=function(o){if(o.CSS&&o.CSS.escape)return o.CSS.escape;var cssEscape=function(o){if(0==arguments.length)throw new TypeError(\"`CSS.escape` requires an argument.\");for(var s,i=String(o),u=i.length,_=-1,w=\"\",x=i.charCodeAt(0);++_<u;)0!=(s=i.charCodeAt(_))?w+=s>=1&&s<=31||127==s||0==_&&s>=48&&s<=57||1==_&&s>=48&&s<=57&&45==x?\"\\\\\"+s.toString(16)+\" \":0==_&&1==u&&45==s||!(s>=128||45==s||95==s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122)?\"\\\\\"+i.charAt(_):i.charAt(_):w+=\"�\";return w};return o.CSS||(o.CSS={}),o.CSS.escape=cssEscape,cssEscape}(u)},81919:(o,s,i)=>{\"use strict\";var u=i(48287).Buffer;function isSpecificValue(o){return o instanceof u||o instanceof Date||o instanceof RegExp}function cloneSpecificValue(o){if(o instanceof u){var s=u.alloc?u.alloc(o.length):new u(o.length);return o.copy(s),s}if(o instanceof Date)return new Date(o.getTime());if(o instanceof RegExp)return new RegExp(o);throw new Error(\"Unexpected situation\")}function deepCloneArray(o){var s=[];return o.forEach((function(o,i){\"object\"==typeof o&&null!==o?Array.isArray(o)?s[i]=deepCloneArray(o):isSpecificValue(o)?s[i]=cloneSpecificValue(o):s[i]=_({},o):s[i]=o})),s}function safeGetProperty(o,s){return\"__proto__\"===s?void 0:o[s]}var _=o.exports=function(){if(arguments.length<1||\"object\"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var o,s,i=arguments[0];return Array.prototype.slice.call(arguments,1).forEach((function(u){\"object\"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach((function(w){return s=safeGetProperty(i,w),(o=safeGetProperty(u,w))===i?void 0:\"object\"!=typeof o||null===o?void(i[w]=o):Array.isArray(o)?void(i[w]=deepCloneArray(o)):isSpecificValue(o)?void(i[w]=cloneSpecificValue(o)):\"object\"!=typeof s||null===s||Array.isArray(s)?void(i[w]=_({},o)):void(i[w]=_(s,o))}))})),i}},14744:o=>{\"use strict\";var s=function isMergeableObject(o){return function isNonNullObject(o){return!!o&&\"object\"==typeof o}(o)&&!function isSpecial(o){var s=Object.prototype.toString.call(o);return\"[object RegExp]\"===s||\"[object Date]\"===s||function isReactElement(o){return o.$$typeof===i}(o)}(o)};var i=\"function\"==typeof Symbol&&Symbol.for?Symbol.for(\"react.element\"):60103;function cloneUnlessOtherwiseSpecified(o,s){return!1!==s.clone&&s.isMergeableObject(o)?deepmerge(function emptyTarget(o){return Array.isArray(o)?[]:{}}(o),o,s):o}function defaultArrayMerge(o,s,i){return o.concat(s).map((function(o){return cloneUnlessOtherwiseSpecified(o,i)}))}function getKeys(o){return Object.keys(o).concat(function getEnumerableOwnPropertySymbols(o){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(o).filter((function(s){return Object.propertyIsEnumerable.call(o,s)})):[]}(o))}function propertyIsOnObject(o,s){try{return s in o}catch(o){return!1}}function mergeObject(o,s,i){var u={};return i.isMergeableObject(o)&&getKeys(o).forEach((function(s){u[s]=cloneUnlessOtherwiseSpecified(o[s],i)})),getKeys(s).forEach((function(_){(function propertyIsUnsafe(o,s){return propertyIsOnObject(o,s)&&!(Object.hasOwnProperty.call(o,s)&&Object.propertyIsEnumerable.call(o,s))})(o,_)||(propertyIsOnObject(o,_)&&i.isMergeableObject(s[_])?u[_]=function getMergeFunction(o,s){if(!s.customMerge)return deepmerge;var i=s.customMerge(o);return\"function\"==typeof i?i:deepmerge}(_,i)(o[_],s[_],i):u[_]=cloneUnlessOtherwiseSpecified(s[_],i))})),u}function deepmerge(o,i,u){(u=u||{}).arrayMerge=u.arrayMerge||defaultArrayMerge,u.isMergeableObject=u.isMergeableObject||s,u.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var _=Array.isArray(i);return _===Array.isArray(o)?_?u.arrayMerge(o,i,u):mergeObject(o,i,u):cloneUnlessOtherwiseSpecified(i,u)}deepmerge.all=function deepmergeAll(o,s){if(!Array.isArray(o))throw new Error(\"first argument should be an array\");return o.reduce((function(o,i){return deepmerge(o,i,s)}),{})};var u=deepmerge;o.exports=u},30041:(o,s,i)=>{\"use strict\";var u=i(30655),_=i(58068),w=i(69675),x=i(75795);o.exports=function defineDataProperty(o,s,i){if(!o||\"object\"!=typeof o&&\"function\"!=typeof o)throw new w(\"`obj` must be an object or a function`\");if(\"string\"!=typeof s&&\"symbol\"!=typeof s)throw new w(\"`property` must be a string or a symbol`\");if(arguments.length>3&&\"boolean\"!=typeof arguments[3]&&null!==arguments[3])throw new w(\"`nonEnumerable`, if provided, must be a boolean or null\");if(arguments.length>4&&\"boolean\"!=typeof arguments[4]&&null!==arguments[4])throw new w(\"`nonWritable`, if provided, must be a boolean or null\");if(arguments.length>5&&\"boolean\"!=typeof arguments[5]&&null!==arguments[5])throw new w(\"`nonConfigurable`, if provided, must be a boolean or null\");if(arguments.length>6&&\"boolean\"!=typeof arguments[6])throw new w(\"`loose`, if provided, must be a boolean\");var C=arguments.length>3?arguments[3]:null,j=arguments.length>4?arguments[4]:null,L=arguments.length>5?arguments[5]:null,B=arguments.length>6&&arguments[6],$=!!x&&x(o,s);if(u)u(o,s,{configurable:null===L&&$?$.configurable:!L,enumerable:null===C&&$?$.enumerable:!C,value:i,writable:null===j&&$?$.writable:!j});else{if(!B&&(C||j||L))throw new _(\"This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.\");o[s]=i}}},42838:function(o){o.exports=function(){\"use strict\";const{entries:o,setPrototypeOf:s,isFrozen:i,getPrototypeOf:u,getOwnPropertyDescriptor:_}=Object;let{freeze:w,seal:x,create:C}=Object,{apply:j,construct:L}=\"undefined\"!=typeof Reflect&&Reflect;w||(w=function freeze(o){return o}),x||(x=function seal(o){return o}),j||(j=function apply(o,s,i){return o.apply(s,i)}),L||(L=function construct(o,s){return new o(...s)});const B=unapply(Array.prototype.forEach),$=unapply(Array.prototype.pop),V=unapply(Array.prototype.push),U=unapply(String.prototype.toLowerCase),z=unapply(String.prototype.toString),Y=unapply(String.prototype.match),Z=unapply(String.prototype.replace),ee=unapply(String.prototype.indexOf),ie=unapply(String.prototype.trim),ae=unapply(Object.prototype.hasOwnProperty),ce=unapply(RegExp.prototype.test),le=unconstruct(TypeError);function numberIsNaN(o){return\"number\"==typeof o&&isNaN(o)}function unapply(o){return function(s){for(var i=arguments.length,u=new Array(i>1?i-1:0),_=1;_<i;_++)u[_-1]=arguments[_];return j(o,s,u)}}function unconstruct(o){return function(){for(var s=arguments.length,i=new Array(s),u=0;u<s;u++)i[u]=arguments[u];return L(o,i)}}function addToSet(o,u){let _=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U;s&&s(o,null);let w=u.length;for(;w--;){let s=u[w];if(\"string\"==typeof s){const o=_(s);o!==s&&(i(u)||(u[w]=o),s=o)}o[s]=!0}return o}function cleanArray(o){for(let s=0;s<o.length;s++)ae(o,s)||(o[s]=null);return o}function clone(s){const i=C(null);for(const[u,_]of o(s))ae(s,u)&&(Array.isArray(_)?i[u]=cleanArray(_):_&&\"object\"==typeof _&&_.constructor===Object?i[u]=clone(_):i[u]=_);return i}function lookupGetter(o,s){for(;null!==o;){const i=_(o,s);if(i){if(i.get)return unapply(i.get);if(\"function\"==typeof i.value)return unapply(i.value)}o=u(o)}function fallbackValue(){return null}return fallbackValue}const pe=w([\"a\",\"abbr\",\"acronym\",\"address\",\"area\",\"article\",\"aside\",\"audio\",\"b\",\"bdi\",\"bdo\",\"big\",\"blink\",\"blockquote\",\"body\",\"br\",\"button\",\"canvas\",\"caption\",\"center\",\"cite\",\"code\",\"col\",\"colgroup\",\"content\",\"data\",\"datalist\",\"dd\",\"decorator\",\"del\",\"details\",\"dfn\",\"dialog\",\"dir\",\"div\",\"dl\",\"dt\",\"element\",\"em\",\"fieldset\",\"figcaption\",\"figure\",\"font\",\"footer\",\"form\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"head\",\"header\",\"hgroup\",\"hr\",\"html\",\"i\",\"img\",\"input\",\"ins\",\"kbd\",\"label\",\"legend\",\"li\",\"main\",\"map\",\"mark\",\"marquee\",\"menu\",\"menuitem\",\"meter\",\"nav\",\"nobr\",\"ol\",\"optgroup\",\"option\",\"output\",\"p\",\"picture\",\"pre\",\"progress\",\"q\",\"rp\",\"rt\",\"ruby\",\"s\",\"samp\",\"section\",\"select\",\"shadow\",\"small\",\"source\",\"spacer\",\"span\",\"strike\",\"strong\",\"style\",\"sub\",\"summary\",\"sup\",\"table\",\"tbody\",\"td\",\"template\",\"textarea\",\"tfoot\",\"th\",\"thead\",\"time\",\"tr\",\"track\",\"tt\",\"u\",\"ul\",\"var\",\"video\",\"wbr\"]),de=w([\"svg\",\"a\",\"altglyph\",\"altglyphdef\",\"altglyphitem\",\"animatecolor\",\"animatemotion\",\"animatetransform\",\"circle\",\"clippath\",\"defs\",\"desc\",\"ellipse\",\"filter\",\"font\",\"g\",\"glyph\",\"glyphref\",\"hkern\",\"image\",\"line\",\"lineargradient\",\"marker\",\"mask\",\"metadata\",\"mpath\",\"path\",\"pattern\",\"polygon\",\"polyline\",\"radialgradient\",\"rect\",\"stop\",\"style\",\"switch\",\"symbol\",\"text\",\"textpath\",\"title\",\"tref\",\"tspan\",\"view\",\"vkern\"]),fe=w([\"feBlend\",\"feColorMatrix\",\"feComponentTransfer\",\"feComposite\",\"feConvolveMatrix\",\"feDiffuseLighting\",\"feDisplacementMap\",\"feDistantLight\",\"feDropShadow\",\"feFlood\",\"feFuncA\",\"feFuncB\",\"feFuncG\",\"feFuncR\",\"feGaussianBlur\",\"feImage\",\"feMerge\",\"feMergeNode\",\"feMorphology\",\"feOffset\",\"fePointLight\",\"feSpecularLighting\",\"feSpotLight\",\"feTile\",\"feTurbulence\"]),ye=w([\"animate\",\"color-profile\",\"cursor\",\"discard\",\"font-face\",\"font-face-format\",\"font-face-name\",\"font-face-src\",\"font-face-uri\",\"foreignobject\",\"hatch\",\"hatchpath\",\"mesh\",\"meshgradient\",\"meshpatch\",\"meshrow\",\"missing-glyph\",\"script\",\"set\",\"solidcolor\",\"unknown\",\"use\"]),be=w([\"math\",\"menclose\",\"merror\",\"mfenced\",\"mfrac\",\"mglyph\",\"mi\",\"mlabeledtr\",\"mmultiscripts\",\"mn\",\"mo\",\"mover\",\"mpadded\",\"mphantom\",\"mroot\",\"mrow\",\"ms\",\"mspace\",\"msqrt\",\"mstyle\",\"msub\",\"msup\",\"msubsup\",\"mtable\",\"mtd\",\"mtext\",\"mtr\",\"munder\",\"munderover\",\"mprescripts\"]),_e=w([\"maction\",\"maligngroup\",\"malignmark\",\"mlongdiv\",\"mscarries\",\"mscarry\",\"msgroup\",\"mstack\",\"msline\",\"msrow\",\"semantics\",\"annotation\",\"annotation-xml\",\"mprescripts\",\"none\"]),we=w([\"#text\"]),Se=w([\"accept\",\"action\",\"align\",\"alt\",\"autocapitalize\",\"autocomplete\",\"autopictureinpicture\",\"autoplay\",\"background\",\"bgcolor\",\"border\",\"capture\",\"cellpadding\",\"cellspacing\",\"checked\",\"cite\",\"class\",\"clear\",\"color\",\"cols\",\"colspan\",\"controls\",\"controlslist\",\"coords\",\"crossorigin\",\"datetime\",\"decoding\",\"default\",\"dir\",\"disabled\",\"disablepictureinpicture\",\"disableremoteplayback\",\"download\",\"draggable\",\"enctype\",\"enterkeyhint\",\"face\",\"for\",\"headers\",\"height\",\"hidden\",\"high\",\"href\",\"hreflang\",\"id\",\"inputmode\",\"integrity\",\"ismap\",\"kind\",\"label\",\"lang\",\"list\",\"loading\",\"loop\",\"low\",\"max\",\"maxlength\",\"media\",\"method\",\"min\",\"minlength\",\"multiple\",\"muted\",\"name\",\"nonce\",\"noshade\",\"novalidate\",\"nowrap\",\"open\",\"optimum\",\"pattern\",\"placeholder\",\"playsinline\",\"popover\",\"popovertarget\",\"popovertargetaction\",\"poster\",\"preload\",\"pubdate\",\"radiogroup\",\"readonly\",\"rel\",\"required\",\"rev\",\"reversed\",\"role\",\"rows\",\"rowspan\",\"spellcheck\",\"scope\",\"selected\",\"shape\",\"size\",\"sizes\",\"span\",\"srclang\",\"start\",\"src\",\"srcset\",\"step\",\"style\",\"summary\",\"tabindex\",\"title\",\"translate\",\"type\",\"usemap\",\"valign\",\"value\",\"width\",\"wrap\",\"xmlns\",\"slot\"]),xe=w([\"accent-height\",\"accumulate\",\"additive\",\"alignment-baseline\",\"ascent\",\"attributename\",\"attributetype\",\"azimuth\",\"basefrequency\",\"baseline-shift\",\"begin\",\"bias\",\"by\",\"class\",\"clip\",\"clippathunits\",\"clip-path\",\"clip-rule\",\"color\",\"color-interpolation\",\"color-interpolation-filters\",\"color-profile\",\"color-rendering\",\"cx\",\"cy\",\"d\",\"dx\",\"dy\",\"diffuseconstant\",\"direction\",\"display\",\"divisor\",\"dur\",\"edgemode\",\"elevation\",\"end\",\"fill\",\"fill-opacity\",\"fill-rule\",\"filter\",\"filterunits\",\"flood-color\",\"flood-opacity\",\"font-family\",\"font-size\",\"font-size-adjust\",\"font-stretch\",\"font-style\",\"font-variant\",\"font-weight\",\"fx\",\"fy\",\"g1\",\"g2\",\"glyph-name\",\"glyphref\",\"gradientunits\",\"gradienttransform\",\"height\",\"href\",\"id\",\"image-rendering\",\"in\",\"in2\",\"k\",\"k1\",\"k2\",\"k3\",\"k4\",\"kerning\",\"keypoints\",\"keysplines\",\"keytimes\",\"lang\",\"lengthadjust\",\"letter-spacing\",\"kernelmatrix\",\"kernelunitlength\",\"lighting-color\",\"local\",\"marker-end\",\"marker-mid\",\"marker-start\",\"markerheight\",\"markerunits\",\"markerwidth\",\"maskcontentunits\",\"maskunits\",\"max\",\"mask\",\"media\",\"method\",\"mode\",\"min\",\"name\",\"numoctaves\",\"offset\",\"operator\",\"opacity\",\"order\",\"orient\",\"orientation\",\"origin\",\"overflow\",\"paint-order\",\"path\",\"pathlength\",\"patterncontentunits\",\"patterntransform\",\"patternunits\",\"points\",\"preservealpha\",\"preserveaspectratio\",\"primitiveunits\",\"r\",\"rx\",\"ry\",\"radius\",\"refx\",\"refy\",\"repeatcount\",\"repeatdur\",\"restart\",\"result\",\"rotate\",\"scale\",\"seed\",\"shape-rendering\",\"specularconstant\",\"specularexponent\",\"spreadmethod\",\"startoffset\",\"stddeviation\",\"stitchtiles\",\"stop-color\",\"stop-opacity\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-miterlimit\",\"stroke-opacity\",\"stroke\",\"stroke-width\",\"style\",\"surfacescale\",\"systemlanguage\",\"tabindex\",\"targetx\",\"targety\",\"transform\",\"transform-origin\",\"text-anchor\",\"text-decoration\",\"text-rendering\",\"textlength\",\"type\",\"u1\",\"u2\",\"unicode\",\"values\",\"viewbox\",\"visibility\",\"version\",\"vert-adv-y\",\"vert-origin-x\",\"vert-origin-y\",\"width\",\"word-spacing\",\"wrap\",\"writing-mode\",\"xchannelselector\",\"ychannelselector\",\"x\",\"x1\",\"x2\",\"xmlns\",\"y\",\"y1\",\"y2\",\"z\",\"zoomandpan\"]),Pe=w([\"accent\",\"accentunder\",\"align\",\"bevelled\",\"close\",\"columnsalign\",\"columnlines\",\"columnspan\",\"denomalign\",\"depth\",\"dir\",\"display\",\"displaystyle\",\"encoding\",\"fence\",\"frame\",\"height\",\"href\",\"id\",\"largeop\",\"length\",\"linethickness\",\"lspace\",\"lquote\",\"mathbackground\",\"mathcolor\",\"mathsize\",\"mathvariant\",\"maxsize\",\"minsize\",\"movablelimits\",\"notation\",\"numalign\",\"open\",\"rowalign\",\"rowlines\",\"rowspacing\",\"rowspan\",\"rspace\",\"rquote\",\"scriptlevel\",\"scriptminsize\",\"scriptsizemultiplier\",\"selection\",\"separator\",\"separators\",\"stretchy\",\"subscriptshift\",\"supscriptshift\",\"symmetric\",\"voffset\",\"width\",\"xmlns\"]),Te=w([\"xlink:href\",\"xml:id\",\"xlink:title\",\"xml:space\",\"xmlns:xlink\"]),Re=x(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm),qe=x(/<%[\\w\\W]*|[\\w\\W]*%>/gm),$e=x(/\\${[\\w\\W]*}/gm),ze=x(/^data-[\\-\\w.\\u00B7-\\uFFFF]/),We=x(/^aria-[\\-\\w]+$/),He=x(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i),Ye=x(/^(?:\\w+script|data):/i),Xe=x(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g),Qe=x(/^html$/i),et=x(/^[a-z][.\\w]*(-[.\\w]+)+$/i);var tt=Object.freeze({__proto__:null,MUSTACHE_EXPR:Re,ERB_EXPR:qe,TMPLIT_EXPR:$e,DATA_ATTR:ze,ARIA_ATTR:We,IS_ALLOWED_URI:He,IS_SCRIPT_OR_DATA:Ye,ATTR_WHITESPACE:Xe,DOCTYPE_NAME:Qe,CUSTOM_ELEMENT:et});const rt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},nt=function getGlobal(){return\"undefined\"==typeof window?null:window},ot=function _createTrustedTypesPolicy(o,s){if(\"object\"!=typeof o||\"function\"!=typeof o.createPolicy)return null;let i=null;const u=\"data-tt-policy-suffix\";s&&s.hasAttribute(u)&&(i=s.getAttribute(u));const _=\"dompurify\"+(i?\"#\"+i:\"\");try{return o.createPolicy(_,{createHTML:o=>o,createScriptURL:o=>o})}catch(o){return console.warn(\"TrustedTypes policy \"+_+\" could not be created.\"),null}};function createDOMPurify(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nt();const DOMPurify=o=>createDOMPurify(o);if(DOMPurify.version=\"3.1.4\",DOMPurify.removed=[],!s||!s.document||s.document.nodeType!==rt.document)return DOMPurify.isSupported=!1,DOMPurify;let{document:i}=s;const u=i,_=u.currentScript,{DocumentFragment:x,HTMLTemplateElement:j,Node:L,Element:Re,NodeFilter:qe,NamedNodeMap:$e=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:ze,DOMParser:We,trustedTypes:Ye}=s,Xe=Re.prototype,et=lookupGetter(Xe,\"cloneNode\"),st=lookupGetter(Xe,\"nextSibling\"),it=lookupGetter(Xe,\"childNodes\"),at=lookupGetter(Xe,\"parentNode\");if(\"function\"==typeof j){const o=i.createElement(\"template\");o.content&&o.content.ownerDocument&&(i=o.content.ownerDocument)}let ct,lt=\"\";const{implementation:ut,createNodeIterator:pt,createDocumentFragment:ht,getElementsByTagName:dt}=i,{importNode:mt}=u;let gt={};DOMPurify.isSupported=\"function\"==typeof o&&\"function\"==typeof at&&ut&&void 0!==ut.createHTMLDocument;const{MUSTACHE_EXPR:yt,ERB_EXPR:vt,TMPLIT_EXPR:bt,DATA_ATTR:_t,ARIA_ATTR:Et,IS_SCRIPT_OR_DATA:wt,ATTR_WHITESPACE:St,CUSTOM_ELEMENT:xt}=tt;let{IS_ALLOWED_URI:kt}=tt,Ot=null;const Ct=addToSet({},[...pe,...de,...fe,...be,...we]);let At=null;const jt=addToSet({},[...Se,...xe,...Pe,...Te]);let Pt=Object.seal(C(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),It=null,Mt=null,Nt=!0,Tt=!0,Rt=!1,Dt=!0,Lt=!1,Bt=!0,Ft=!1,qt=!1,$t=!1,Vt=!1,Ut=!1,zt=!1,Wt=!0,Kt=!1;const Ht=\"user-content-\";let Jt=!0,Gt=!1,Yt={},Xt=null;const Qt=addToSet({},[\"annotation-xml\",\"audio\",\"colgroup\",\"desc\",\"foreignobject\",\"head\",\"iframe\",\"math\",\"mi\",\"mn\",\"mo\",\"ms\",\"mtext\",\"noembed\",\"noframes\",\"noscript\",\"plaintext\",\"script\",\"style\",\"svg\",\"template\",\"thead\",\"title\",\"video\",\"xmp\"]);let Zt=null;const er=addToSet({},[\"audio\",\"video\",\"img\",\"source\",\"image\",\"track\"]);let tr=null;const rr=addToSet({},[\"alt\",\"class\",\"for\",\"id\",\"label\",\"name\",\"pattern\",\"placeholder\",\"role\",\"summary\",\"title\",\"value\",\"style\",\"xmlns\"]),nr=\"http://www.w3.org/1998/Math/MathML\",sr=\"http://www.w3.org/2000/svg\",ir=\"http://www.w3.org/1999/xhtml\";let ar=ir,cr=!1,lr=null;const ur=addToSet({},[nr,sr,ir],z);let pr=null;const dr=[\"application/xhtml+xml\",\"text/html\"],fr=\"text/html\";let mr=null,gr=null;const yr=255,vr=i.createElement(\"form\"),br=function isRegexOrFunction(o){return o instanceof RegExp||o instanceof Function},_r=function _parseConfig(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!gr||gr!==o){if(o&&\"object\"==typeof o||(o={}),o=clone(o),pr=-1===dr.indexOf(o.PARSER_MEDIA_TYPE)?fr:o.PARSER_MEDIA_TYPE,mr=\"application/xhtml+xml\"===pr?z:U,Ot=ae(o,\"ALLOWED_TAGS\")?addToSet({},o.ALLOWED_TAGS,mr):Ct,At=ae(o,\"ALLOWED_ATTR\")?addToSet({},o.ALLOWED_ATTR,mr):jt,lr=ae(o,\"ALLOWED_NAMESPACES\")?addToSet({},o.ALLOWED_NAMESPACES,z):ur,tr=ae(o,\"ADD_URI_SAFE_ATTR\")?addToSet(clone(rr),o.ADD_URI_SAFE_ATTR,mr):rr,Zt=ae(o,\"ADD_DATA_URI_TAGS\")?addToSet(clone(er),o.ADD_DATA_URI_TAGS,mr):er,Xt=ae(o,\"FORBID_CONTENTS\")?addToSet({},o.FORBID_CONTENTS,mr):Qt,It=ae(o,\"FORBID_TAGS\")?addToSet({},o.FORBID_TAGS,mr):{},Mt=ae(o,\"FORBID_ATTR\")?addToSet({},o.FORBID_ATTR,mr):{},Yt=!!ae(o,\"USE_PROFILES\")&&o.USE_PROFILES,Nt=!1!==o.ALLOW_ARIA_ATTR,Tt=!1!==o.ALLOW_DATA_ATTR,Rt=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Dt=!1!==o.ALLOW_SELF_CLOSE_IN_ATTR,Lt=o.SAFE_FOR_TEMPLATES||!1,Bt=!1!==o.SAFE_FOR_XML,Ft=o.WHOLE_DOCUMENT||!1,Vt=o.RETURN_DOM||!1,Ut=o.RETURN_DOM_FRAGMENT||!1,zt=o.RETURN_TRUSTED_TYPE||!1,$t=o.FORCE_BODY||!1,Wt=!1!==o.SANITIZE_DOM,Kt=o.SANITIZE_NAMED_PROPS||!1,Jt=!1!==o.KEEP_CONTENT,Gt=o.IN_PLACE||!1,kt=o.ALLOWED_URI_REGEXP||He,ar=o.NAMESPACE||ir,Pt=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&br(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Pt.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&br(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Pt.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&\"boolean\"==typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Pt.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Lt&&(Tt=!1),Ut&&(Vt=!0),Yt&&(Ot=addToSet({},we),At=[],!0===Yt.html&&(addToSet(Ot,pe),addToSet(At,Se)),!0===Yt.svg&&(addToSet(Ot,de),addToSet(At,xe),addToSet(At,Te)),!0===Yt.svgFilters&&(addToSet(Ot,fe),addToSet(At,xe),addToSet(At,Te)),!0===Yt.mathMl&&(addToSet(Ot,be),addToSet(At,Pe),addToSet(At,Te))),o.ADD_TAGS&&(Ot===Ct&&(Ot=clone(Ot)),addToSet(Ot,o.ADD_TAGS,mr)),o.ADD_ATTR&&(At===jt&&(At=clone(At)),addToSet(At,o.ADD_ATTR,mr)),o.ADD_URI_SAFE_ATTR&&addToSet(tr,o.ADD_URI_SAFE_ATTR,mr),o.FORBID_CONTENTS&&(Xt===Qt&&(Xt=clone(Xt)),addToSet(Xt,o.FORBID_CONTENTS,mr)),Jt&&(Ot[\"#text\"]=!0),Ft&&addToSet(Ot,[\"html\",\"head\",\"body\"]),Ot.table&&(addToSet(Ot,[\"tbody\"]),delete It.tbody),o.TRUSTED_TYPES_POLICY){if(\"function\"!=typeof o.TRUSTED_TYPES_POLICY.createHTML)throw le('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');if(\"function\"!=typeof o.TRUSTED_TYPES_POLICY.createScriptURL)throw le('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');ct=o.TRUSTED_TYPES_POLICY,lt=ct.createHTML(\"\")}else void 0===ct&&(ct=ot(Ye,_)),null!==ct&&\"string\"==typeof lt&&(lt=ct.createHTML(\"\"));w&&w(o),gr=o}},Er=addToSet({},[\"mi\",\"mo\",\"mn\",\"ms\",\"mtext\"]),wr=addToSet({},[\"foreignobject\",\"annotation-xml\"]),Sr=addToSet({},[\"title\",\"style\",\"font\",\"a\",\"script\"]),xr=addToSet({},[...de,...fe,...ye]),kr=addToSet({},[...be,..._e]),Or=function _checkValidNamespace(o){let s=at(o);s&&s.tagName||(s={namespaceURI:ar,tagName:\"template\"});const i=U(o.tagName),u=U(s.tagName);return!!lr[o.namespaceURI]&&(o.namespaceURI===sr?s.namespaceURI===ir?\"svg\"===i:s.namespaceURI===nr?\"svg\"===i&&(\"annotation-xml\"===u||Er[u]):Boolean(xr[i]):o.namespaceURI===nr?s.namespaceURI===ir?\"math\"===i:s.namespaceURI===sr?\"math\"===i&&wr[u]:Boolean(kr[i]):o.namespaceURI===ir?!(s.namespaceURI===sr&&!wr[u])&&!(s.namespaceURI===nr&&!Er[u])&&!kr[i]&&(Sr[i]||!xr[i]):!(\"application/xhtml+xml\"!==pr||!lr[o.namespaceURI]))},Cr=function _forceRemove(o){V(DOMPurify.removed,{element:o});try{o.parentNode.removeChild(o)}catch(s){o.remove()}},Ar=function _removeAttribute(o,s){try{V(DOMPurify.removed,{attribute:s.getAttributeNode(o),from:s})}catch(o){V(DOMPurify.removed,{attribute:null,from:s})}if(s.removeAttribute(o),\"is\"===o&&!At[o])if(Vt||Ut)try{Cr(s)}catch(o){}else try{s.setAttribute(o,\"\")}catch(o){}},jr=function _initDocument(o){let s=null,u=null;if($t)o=\"<remove></remove>\"+o;else{const s=Y(o,/^[\\r\\n\\t ]+/);u=s&&s[0]}\"application/xhtml+xml\"===pr&&ar===ir&&(o='<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>'+o+\"</body></html>\");const _=ct?ct.createHTML(o):o;if(ar===ir)try{s=(new We).parseFromString(_,pr)}catch(o){}if(!s||!s.documentElement){s=ut.createDocument(ar,\"template\",null);try{s.documentElement.innerHTML=cr?lt:_}catch(o){}}const w=s.body||s.documentElement;return o&&u&&w.insertBefore(i.createTextNode(u),w.childNodes[0]||null),ar===ir?dt.call(s,Ft?\"html\":\"body\")[0]:Ft?s.documentElement:w},Pr=function _createNodeIterator(o){return pt.call(o.ownerDocument||o,o,qe.SHOW_ELEMENT|qe.SHOW_COMMENT|qe.SHOW_TEXT|qe.SHOW_PROCESSING_INSTRUCTION|qe.SHOW_CDATA_SECTION,null)},Ir=function _isClobbered(o){return o instanceof ze&&(void 0!==o.__depth&&\"number\"!=typeof o.__depth||void 0!==o.__removalCount&&\"number\"!=typeof o.__removalCount||\"string\"!=typeof o.nodeName||\"string\"!=typeof o.textContent||\"function\"!=typeof o.removeChild||!(o.attributes instanceof $e)||\"function\"!=typeof o.removeAttribute||\"function\"!=typeof o.setAttribute||\"string\"!=typeof o.namespaceURI||\"function\"!=typeof o.insertBefore||\"function\"!=typeof o.hasChildNodes)},Mr=function _isNode(o){return\"function\"==typeof L&&o instanceof L},Nr=function _executeHook(o,s,i){gt[o]&&B(gt[o],(o=>{o.call(DOMPurify,s,i,gr)}))},Tr=function _sanitizeElements(o){let s=null;if(Nr(\"beforeSanitizeElements\",o,null),Ir(o))return Cr(o),!0;const i=mr(o.nodeName);if(Nr(\"uponSanitizeElement\",o,{tagName:i,allowedTags:Ot}),o.hasChildNodes()&&!Mr(o.firstElementChild)&&ce(/<[/\\w]/g,o.innerHTML)&&ce(/<[/\\w]/g,o.textContent))return Cr(o),!0;if(o.nodeType===rt.progressingInstruction)return Cr(o),!0;if(Bt&&o.nodeType===rt.comment&&ce(/<[/\\w]/g,o.data))return Cr(o),!0;if(!Ot[i]||It[i]){if(!It[i]&&Dr(i)){if(Pt.tagNameCheck instanceof RegExp&&ce(Pt.tagNameCheck,i))return!1;if(Pt.tagNameCheck instanceof Function&&Pt.tagNameCheck(i))return!1}if(Jt&&!Xt[i]){const s=at(o)||o.parentNode,i=it(o)||o.childNodes;if(i&&s)for(let u=i.length-1;u>=0;--u){const _=et(i[u],!0);_.__removalCount=(o.__removalCount||0)+1,s.insertBefore(_,st(o))}}return Cr(o),!0}return o instanceof Re&&!Or(o)?(Cr(o),!0):\"noscript\"!==i&&\"noembed\"!==i&&\"noframes\"!==i||!ce(/<\\/no(script|embed|frames)/i,o.innerHTML)?(Lt&&o.nodeType===rt.text&&(s=o.textContent,B([yt,vt,bt],(o=>{s=Z(s,o,\" \")})),o.textContent!==s&&(V(DOMPurify.removed,{element:o.cloneNode()}),o.textContent=s)),Nr(\"afterSanitizeElements\",o,null),!1):(Cr(o),!0)},Rr=function _isValidAttribute(o,s,u){if(Wt&&(\"id\"===s||\"name\"===s)&&(u in i||u in vr||\"__depth\"===u||\"__removalCount\"===u))return!1;if(Tt&&!Mt[s]&&ce(_t,s));else if(Nt&&ce(Et,s));else if(!At[s]||Mt[s]){if(!(Dr(o)&&(Pt.tagNameCheck instanceof RegExp&&ce(Pt.tagNameCheck,o)||Pt.tagNameCheck instanceof Function&&Pt.tagNameCheck(o))&&(Pt.attributeNameCheck instanceof RegExp&&ce(Pt.attributeNameCheck,s)||Pt.attributeNameCheck instanceof Function&&Pt.attributeNameCheck(s))||\"is\"===s&&Pt.allowCustomizedBuiltInElements&&(Pt.tagNameCheck instanceof RegExp&&ce(Pt.tagNameCheck,u)||Pt.tagNameCheck instanceof Function&&Pt.tagNameCheck(u))))return!1}else if(tr[s]);else if(ce(kt,Z(u,St,\"\")));else if(\"src\"!==s&&\"xlink:href\"!==s&&\"href\"!==s||\"script\"===o||0!==ee(u,\"data:\")||!Zt[o])if(Rt&&!ce(wt,Z(u,St,\"\")));else if(u)return!1;return!0},Dr=function _isBasicCustomElement(o){return\"annotation-xml\"!==o&&Y(o,xt)},Lr=function _sanitizeAttributes(o){Nr(\"beforeSanitizeAttributes\",o,null);const{attributes:s}=o;if(!s)return;const i={attrName:\"\",attrValue:\"\",keepAttr:!0,allowedAttributes:At};let u=s.length;for(;u--;){const _=s[u],{name:w,namespaceURI:x,value:C}=_,j=mr(w);let L=\"value\"===w?C:ie(C);if(i.attrName=j,i.attrValue=L,i.keepAttr=!0,i.forceKeepAttr=void 0,Nr(\"uponSanitizeAttribute\",o,i),L=i.attrValue,i.forceKeepAttr)continue;if(Ar(w,o),!i.keepAttr)continue;if(!Dt&&ce(/\\/>/i,L)){Ar(w,o);continue}if(Bt&&ce(/((--!?|])>)|<\\/(style|title)/i,L)){Ar(w,o);continue}Lt&&B([yt,vt,bt],(o=>{L=Z(L,o,\" \")}));const V=mr(o.nodeName);if(Rr(V,j,L)){if(!Kt||\"id\"!==j&&\"name\"!==j||(Ar(w,o),L=Ht+L),ct&&\"object\"==typeof Ye&&\"function\"==typeof Ye.getAttributeType)if(x);else switch(Ye.getAttributeType(V,j)){case\"TrustedHTML\":L=ct.createHTML(L);break;case\"TrustedScriptURL\":L=ct.createScriptURL(L)}try{x?o.setAttributeNS(x,w,L):o.setAttribute(w,L),Ir(o)?Cr(o):$(DOMPurify.removed)}catch(o){}}}Nr(\"afterSanitizeAttributes\",o,null)},Br=function _sanitizeShadowDOM(o){let s=null;const i=Pr(o);for(Nr(\"beforeSanitizeShadowDOM\",o,null);s=i.nextNode();){if(Nr(\"uponSanitizeShadowNode\",s,null),Tr(s))continue;const o=at(s);s.nodeType===rt.element&&(o&&o.__depth?s.__depth=(s.__removalCount||0)+o.__depth+1:s.__depth=1),(s.__depth>=yr||s.__depth<0||numberIsNaN(s.__depth))&&Cr(s),s.content instanceof x&&(s.content.__depth=s.__depth,_sanitizeShadowDOM(s.content)),Lr(s)}Nr(\"afterSanitizeShadowDOM\",o,null)};return DOMPurify.sanitize=function(o){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,_=null,w=null,C=null;if(cr=!o,cr&&(o=\"\\x3c!--\\x3e\"),\"string\"!=typeof o&&!Mr(o)){if(\"function\"!=typeof o.toString)throw le(\"toString is not a function\");if(\"string\"!=typeof(o=o.toString()))throw le(\"dirty is not a string, aborting\")}if(!DOMPurify.isSupported)return o;if(qt||_r(s),DOMPurify.removed=[],\"string\"==typeof o&&(Gt=!1),Gt){if(o.nodeName){const s=mr(o.nodeName);if(!Ot[s]||It[s])throw le(\"root node is forbidden and cannot be sanitized in-place\")}}else if(o instanceof L)i=jr(\"\\x3c!----\\x3e\"),_=i.ownerDocument.importNode(o,!0),_.nodeType===rt.element&&\"BODY\"===_.nodeName||\"HTML\"===_.nodeName?i=_:i.appendChild(_);else{if(!Vt&&!Lt&&!Ft&&-1===o.indexOf(\"<\"))return ct&&zt?ct.createHTML(o):o;if(i=jr(o),!i)return Vt?null:zt?lt:\"\"}i&&$t&&Cr(i.firstChild);const j=Pr(Gt?o:i);for(;w=j.nextNode();){if(Tr(w))continue;const o=at(w);w.nodeType===rt.element&&(o&&o.__depth?w.__depth=(w.__removalCount||0)+o.__depth+1:w.__depth=1),(w.__depth>=yr||w.__depth<0||numberIsNaN(w.__depth))&&Cr(w),w.content instanceof x&&(w.content.__depth=w.__depth,Br(w.content)),Lr(w)}if(Gt)return o;if(Vt){if(Ut)for(C=ht.call(i.ownerDocument);i.firstChild;)C.appendChild(i.firstChild);else C=i;return(At.shadowroot||At.shadowrootmode)&&(C=mt.call(u,C,!0)),C}let $=Ft?i.outerHTML:i.innerHTML;return Ft&&Ot[\"!doctype\"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ce(Qe,i.ownerDocument.doctype.name)&&($=\"<!DOCTYPE \"+i.ownerDocument.doctype.name+\">\\n\"+$),Lt&&B([yt,vt,bt],(o=>{$=Z($,o,\" \")})),ct&&zt?ct.createHTML($):$},DOMPurify.setConfig=function(){_r(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),qt=!0},DOMPurify.clearConfig=function(){gr=null,qt=!1},DOMPurify.isValidAttribute=function(o,s,i){gr||_r({});const u=mr(o),_=mr(s);return Rr(u,_,i)},DOMPurify.addHook=function(o,s){\"function\"==typeof s&&(gt[o]=gt[o]||[],V(gt[o],s))},DOMPurify.removeHook=function(o){if(gt[o])return $(gt[o])},DOMPurify.removeHooks=function(o){gt[o]&&(gt[o]=[])},DOMPurify.removeAllHooks=function(){gt={}},DOMPurify}return createDOMPurify()}()},78004:o=>{\"use strict\";class SubRange{constructor(o,s){this.low=o,this.high=s,this.length=1+s-o}overlaps(o){return!(this.high<o.low||this.low>o.high)}touches(o){return!(this.high+1<o.low||this.low-1>o.high)}add(o){return new SubRange(Math.min(this.low,o.low),Math.max(this.high,o.high))}subtract(o){return o.low<=this.low&&o.high>=this.high?[]:o.low>this.low&&o.high<this.high?[new SubRange(this.low,o.low-1),new SubRange(o.high+1,this.high)]:o.low<=this.low?[new SubRange(o.high+1,this.high)]:[new SubRange(this.low,o.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+\"-\"+this.high}}class DRange{constructor(o,s){this.ranges=[],this.length=0,null!=o&&this.add(o,s)}_update_length(){this.length=this.ranges.reduce(((o,s)=>o+s.length),0)}add(o,s){var _add=o=>{for(var s=0;s<this.ranges.length&&!o.touches(this.ranges[s]);)s++;for(var i=this.ranges.slice(0,s);s<this.ranges.length&&o.touches(this.ranges[s]);)o=o.add(this.ranges[s]),s++;i.push(o),this.ranges=i.concat(this.ranges.slice(s)),this._update_length()};return o instanceof DRange?o.ranges.forEach(_add):(null==s&&(s=o),_add(new SubRange(o,s))),this}subtract(o,s){var _subtract=o=>{for(var s=0;s<this.ranges.length&&!o.overlaps(this.ranges[s]);)s++;for(var i=this.ranges.slice(0,s);s<this.ranges.length&&o.overlaps(this.ranges[s]);)i=i.concat(this.ranges[s].subtract(o)),s++;this.ranges=i.concat(this.ranges.slice(s)),this._update_length()};return o instanceof DRange?o.ranges.forEach(_subtract):(null==s&&(s=o),_subtract(new SubRange(o,s))),this}intersect(o,s){var i=[],_intersect=o=>{for(var s=0;s<this.ranges.length&&!o.overlaps(this.ranges[s]);)s++;for(;s<this.ranges.length&&o.overlaps(this.ranges[s]);){var u=Math.max(this.ranges[s].low,o.low),_=Math.min(this.ranges[s].high,o.high);i.push(new SubRange(u,_)),s++}};return o instanceof DRange?o.ranges.forEach(_intersect):(null==s&&(s=o),_intersect(new SubRange(o,s))),this.ranges=i,this._update_length(),this}index(o){for(var s=0;s<this.ranges.length&&this.ranges[s].length<=o;)o-=this.ranges[s].length,s++;return this.ranges[s].low+o}toString(){return\"[ \"+this.ranges.join(\", \")+\" ]\"}clone(){return new DRange(this)}numbers(){return this.ranges.reduce(((o,s)=>{for(var i=s.low;i<=s.high;)o.push(i),i++;return o}),[])}subranges(){return this.ranges.map((o=>({low:o.low,high:o.high,length:1+o.high-o.low})))}}o.exports=DRange},30655:(o,s,i)=>{\"use strict\";var u=i(70453)(\"%Object.defineProperty%\",!0)||!1;if(u)try{u({},\"a\",{value:1})}catch(o){u=!1}o.exports=u},41237:o=>{\"use strict\";o.exports=EvalError},69383:o=>{\"use strict\";o.exports=Error},79290:o=>{\"use strict\";o.exports=RangeError},79538:o=>{\"use strict\";o.exports=ReferenceError},58068:o=>{\"use strict\";o.exports=SyntaxError},69675:o=>{\"use strict\";o.exports=TypeError},35345:o=>{\"use strict\";o.exports=URIError},37007:o=>{\"use strict\";var s,i=\"object\"==typeof Reflect?Reflect:null,u=i&&\"function\"==typeof i.apply?i.apply:function ReflectApply(o,s,i){return Function.prototype.apply.call(o,s,i)};s=i&&\"function\"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function ReflectOwnKeys(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:function ReflectOwnKeys(o){return Object.getOwnPropertyNames(o)};var _=Number.isNaN||function NumberIsNaN(o){return o!=o};function EventEmitter(){EventEmitter.init.call(this)}o.exports=EventEmitter,o.exports.once=function once(o,s){return new Promise((function(i,u){function errorListener(i){o.removeListener(s,resolver),u(i)}function resolver(){\"function\"==typeof o.removeListener&&o.removeListener(\"error\",errorListener),i([].slice.call(arguments))}eventTargetAgnosticAddListener(o,s,resolver,{once:!0}),\"error\"!==s&&function addErrorHandlerIfEventEmitter(o,s,i){\"function\"==typeof o.on&&eventTargetAgnosticAddListener(o,\"error\",s,i)}(o,errorListener,{once:!0})}))},EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var w=10;function checkListener(o){if(\"function\"!=typeof o)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof o)}function _getMaxListeners(o){return void 0===o._maxListeners?EventEmitter.defaultMaxListeners:o._maxListeners}function _addListener(o,s,i,u){var _,w,x;if(checkListener(i),void 0===(w=o._events)?(w=o._events=Object.create(null),o._eventsCount=0):(void 0!==w.newListener&&(o.emit(\"newListener\",s,i.listener?i.listener:i),w=o._events),x=w[s]),void 0===x)x=w[s]=i,++o._eventsCount;else if(\"function\"==typeof x?x=w[s]=u?[i,x]:[x,i]:u?x.unshift(i):x.push(i),(_=_getMaxListeners(o))>0&&x.length>_&&!x.warned){x.warned=!0;var C=new Error(\"Possible EventEmitter memory leak detected. \"+x.length+\" \"+String(s)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");C.name=\"MaxListenersExceededWarning\",C.emitter=o,C.type=s,C.count=x.length,function ProcessEmitWarning(o){console&&console.warn&&console.warn(o)}(C)}return o}function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(o,s,i){var u={fired:!1,wrapFn:void 0,target:o,type:s,listener:i},_=onceWrapper.bind(u);return _.listener=i,u.wrapFn=_,_}function _listeners(o,s,i){var u=o._events;if(void 0===u)return[];var _=u[s];return void 0===_?[]:\"function\"==typeof _?i?[_.listener||_]:[_]:i?function unwrapListeners(o){for(var s=new Array(o.length),i=0;i<s.length;++i)s[i]=o[i].listener||o[i];return s}(_):arrayClone(_,_.length)}function listenerCount(o){var s=this._events;if(void 0!==s){var i=s[o];if(\"function\"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function arrayClone(o,s){for(var i=new Array(s),u=0;u<s;++u)i[u]=o[u];return i}function eventTargetAgnosticAddListener(o,s,i,u){if(\"function\"==typeof o.on)u.once?o.once(s,i):o.on(s,i);else{if(\"function\"!=typeof o.addEventListener)throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type '+typeof o);o.addEventListener(s,(function wrapListener(_){u.once&&o.removeEventListener(s,wrapListener),i(_)}))}}Object.defineProperty(EventEmitter,\"defaultMaxListeners\",{enumerable:!0,get:function(){return w},set:function(o){if(\"number\"!=typeof o||o<0||_(o))throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received '+o+\".\");w=o}}),EventEmitter.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function setMaxListeners(o){if(\"number\"!=typeof o||o<0||_(o))throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received '+o+\".\");return this._maxListeners=o,this},EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return _getMaxListeners(this)},EventEmitter.prototype.emit=function emit(o){for(var s=[],i=1;i<arguments.length;i++)s.push(arguments[i]);var _=\"error\"===o,w=this._events;if(void 0!==w)_=_&&void 0===w.error;else if(!_)return!1;if(_){var x;if(s.length>0&&(x=s[0]),x instanceof Error)throw x;var C=new Error(\"Unhandled error.\"+(x?\" (\"+x.message+\")\":\"\"));throw C.context=x,C}var j=w[o];if(void 0===j)return!1;if(\"function\"==typeof j)u(j,this,s);else{var L=j.length,B=arrayClone(j,L);for(i=0;i<L;++i)u(B[i],this,s)}return!0},EventEmitter.prototype.addListener=function addListener(o,s){return _addListener(this,o,s,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function prependListener(o,s){return _addListener(this,o,s,!0)},EventEmitter.prototype.once=function once(o,s){return checkListener(s),this.on(o,_onceWrap(this,o,s)),this},EventEmitter.prototype.prependOnceListener=function prependOnceListener(o,s){return checkListener(s),this.prependListener(o,_onceWrap(this,o,s)),this},EventEmitter.prototype.removeListener=function removeListener(o,s){var i,u,_,w,x;if(checkListener(s),void 0===(u=this._events))return this;if(void 0===(i=u[o]))return this;if(i===s||i.listener===s)0==--this._eventsCount?this._events=Object.create(null):(delete u[o],u.removeListener&&this.emit(\"removeListener\",o,i.listener||s));else if(\"function\"!=typeof i){for(_=-1,w=i.length-1;w>=0;w--)if(i[w]===s||i[w].listener===s){x=i[w].listener,_=w;break}if(_<0)return this;0===_?i.shift():function spliceOne(o,s){for(;s+1<o.length;s++)o[s]=o[s+1];o.pop()}(i,_),1===i.length&&(u[o]=i[0]),void 0!==u.removeListener&&this.emit(\"removeListener\",o,x||s)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function removeAllListeners(o){var s,i,u;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[o]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[o]),this;if(0===arguments.length){var _,w=Object.keys(i);for(u=0;u<w.length;++u)\"removeListener\"!==(_=w[u])&&this.removeAllListeners(_);return this.removeAllListeners(\"removeListener\"),this._events=Object.create(null),this._eventsCount=0,this}if(\"function\"==typeof(s=i[o]))this.removeListener(o,s);else if(void 0!==s)for(u=s.length-1;u>=0;u--)this.removeListener(o,s[u]);return this},EventEmitter.prototype.listeners=function listeners(o){return _listeners(this,o,!0)},EventEmitter.prototype.rawListeners=function rawListeners(o){return _listeners(this,o,!1)},EventEmitter.listenerCount=function(o,s){return\"function\"==typeof o.listenerCount?o.listenerCount(s):listenerCount.call(o,s)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?s(this._events):[]}},85587:(o,s,i)=>{\"use strict\";var u=i(26311),_=create(Error);function create(o){return FormattedError.displayName=o.displayName||o.name,FormattedError;function FormattedError(s){return s&&(s=u.apply(null,arguments)),new o(s)}}o.exports=_,_.eval=create(EvalError),_.range=create(RangeError),_.reference=create(ReferenceError),_.syntax=create(SyntaxError),_.type=create(TypeError),_.uri=create(URIError),_.create=create},26311:o=>{!function(){var s;function format(o){for(var s,i,u,_,w=1,x=[].slice.call(arguments),C=0,j=o.length,L=\"\",B=!1,$=!1,nextArg=function(){return x[w++]},slurpNumber=function(){for(var i=\"\";/\\d/.test(o[C]);)i+=o[C++],s=o[C];return i.length>0?parseInt(i):null};C<j;++C)if(s=o[C],B)switch(B=!1,\".\"==s?($=!1,s=o[++C]):\"0\"==s&&\".\"==o[C+1]?($=!0,s=o[C+=2]):$=!0,_=slurpNumber(),s){case\"b\":L+=parseInt(nextArg(),10).toString(2);break;case\"c\":L+=\"string\"==typeof(i=nextArg())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case\"d\":L+=parseInt(nextArg(),10);break;case\"f\":u=String(parseFloat(nextArg()).toFixed(_||6)),L+=$?u:u.replace(/^0/,\"\");break;case\"j\":L+=JSON.stringify(nextArg());break;case\"o\":L+=\"0\"+parseInt(nextArg(),10).toString(8);break;case\"s\":L+=nextArg();break;case\"x\":L+=\"0x\"+parseInt(nextArg(),10).toString(16);break;case\"X\":L+=\"0x\"+parseInt(nextArg(),10).toString(16).toUpperCase();break;default:L+=s}else\"%\"===s?B=!0:L+=s;return L}(s=o.exports=format).format=format,s.vsprintf=function vsprintf(o,s){return format.apply(null,[o].concat(s))},\"undefined\"!=typeof console&&\"function\"==typeof console.log&&(s.printf=function printf(){console.log(format.apply(null,arguments))})}()},89353:o=>{\"use strict\";var s=Object.prototype.toString,i=Math.max,u=function concatty(o,s){for(var i=[],u=0;u<o.length;u+=1)i[u]=o[u];for(var _=0;_<s.length;_+=1)i[_+o.length]=s[_];return i};o.exports=function bind(o){var _=this;if(\"function\"!=typeof _||\"[object Function]\"!==s.apply(_))throw new TypeError(\"Function.prototype.bind called on incompatible \"+_);for(var w,x=function slicy(o,s){for(var i=[],u=s||0,_=0;u<o.length;u+=1,_+=1)i[_]=o[u];return i}(arguments,1),C=i(0,_.length-x.length),j=[],L=0;L<C;L++)j[L]=\"$\"+L;if(w=Function(\"binder\",\"return function (\"+function(o,s){for(var i=\"\",u=0;u<o.length;u+=1)i+=o[u],u+1<o.length&&(i+=s);return i}(j,\",\")+\"){ return binder.apply(this,arguments); }\")((function(){if(this instanceof w){var s=_.apply(this,u(x,arguments));return Object(s)===s?s:this}return _.apply(o,u(x,arguments))})),_.prototype){var B=function Empty(){};B.prototype=_.prototype,w.prototype=new B,B.prototype=null}return w}},66743:(o,s,i)=>{\"use strict\";var u=i(89353);o.exports=Function.prototype.bind||u},70453:(o,s,i)=>{\"use strict\";var u,_=i(69383),w=i(41237),x=i(79290),C=i(79538),j=i(58068),L=i(69675),B=i(35345),$=Function,getEvalledConstructor=function(o){try{return $('\"use strict\"; return ('+o+\").constructor;\")()}catch(o){}},V=Object.getOwnPropertyDescriptor;if(V)try{V({},\"\")}catch(o){V=null}var throwTypeError=function(){throw new L},U=V?function(){try{return throwTypeError}catch(o){try{return V(arguments,\"callee\").get}catch(o){return throwTypeError}}}():throwTypeError,z=i(64039)(),Y=i(80024)(),Z=Object.getPrototypeOf||(Y?function(o){return o.__proto__}:null),ee={},ie=\"undefined\"!=typeof Uint8Array&&Z?Z(Uint8Array):u,ae={__proto__:null,\"%AggregateError%\":\"undefined\"==typeof AggregateError?u:AggregateError,\"%Array%\":Array,\"%ArrayBuffer%\":\"undefined\"==typeof ArrayBuffer?u:ArrayBuffer,\"%ArrayIteratorPrototype%\":z&&Z?Z([][Symbol.iterator]()):u,\"%AsyncFromSyncIteratorPrototype%\":u,\"%AsyncFunction%\":ee,\"%AsyncGenerator%\":ee,\"%AsyncGeneratorFunction%\":ee,\"%AsyncIteratorPrototype%\":ee,\"%Atomics%\":\"undefined\"==typeof Atomics?u:Atomics,\"%BigInt%\":\"undefined\"==typeof BigInt?u:BigInt,\"%BigInt64Array%\":\"undefined\"==typeof BigInt64Array?u:BigInt64Array,\"%BigUint64Array%\":\"undefined\"==typeof BigUint64Array?u:BigUint64Array,\"%Boolean%\":Boolean,\"%DataView%\":\"undefined\"==typeof DataView?u:DataView,\"%Date%\":Date,\"%decodeURI%\":decodeURI,\"%decodeURIComponent%\":decodeURIComponent,\"%encodeURI%\":encodeURI,\"%encodeURIComponent%\":encodeURIComponent,\"%Error%\":_,\"%eval%\":eval,\"%EvalError%\":w,\"%Float32Array%\":\"undefined\"==typeof Float32Array?u:Float32Array,\"%Float64Array%\":\"undefined\"==typeof Float64Array?u:Float64Array,\"%FinalizationRegistry%\":\"undefined\"==typeof FinalizationRegistry?u:FinalizationRegistry,\"%Function%\":$,\"%GeneratorFunction%\":ee,\"%Int8Array%\":\"undefined\"==typeof Int8Array?u:Int8Array,\"%Int16Array%\":\"undefined\"==typeof Int16Array?u:Int16Array,\"%Int32Array%\":\"undefined\"==typeof Int32Array?u:Int32Array,\"%isFinite%\":isFinite,\"%isNaN%\":isNaN,\"%IteratorPrototype%\":z&&Z?Z(Z([][Symbol.iterator]())):u,\"%JSON%\":\"object\"==typeof JSON?JSON:u,\"%Map%\":\"undefined\"==typeof Map?u:Map,\"%MapIteratorPrototype%\":\"undefined\"!=typeof Map&&z&&Z?Z((new Map)[Symbol.iterator]()):u,\"%Math%\":Math,\"%Number%\":Number,\"%Object%\":Object,\"%parseFloat%\":parseFloat,\"%parseInt%\":parseInt,\"%Promise%\":\"undefined\"==typeof Promise?u:Promise,\"%Proxy%\":\"undefined\"==typeof Proxy?u:Proxy,\"%RangeError%\":x,\"%ReferenceError%\":C,\"%Reflect%\":\"undefined\"==typeof Reflect?u:Reflect,\"%RegExp%\":RegExp,\"%Set%\":\"undefined\"==typeof Set?u:Set,\"%SetIteratorPrototype%\":\"undefined\"!=typeof Set&&z&&Z?Z((new Set)[Symbol.iterator]()):u,\"%SharedArrayBuffer%\":\"undefined\"==typeof SharedArrayBuffer?u:SharedArrayBuffer,\"%String%\":String,\"%StringIteratorPrototype%\":z&&Z?Z(\"\"[Symbol.iterator]()):u,\"%Symbol%\":z?Symbol:u,\"%SyntaxError%\":j,\"%ThrowTypeError%\":U,\"%TypedArray%\":ie,\"%TypeError%\":L,\"%Uint8Array%\":\"undefined\"==typeof Uint8Array?u:Uint8Array,\"%Uint8ClampedArray%\":\"undefined\"==typeof Uint8ClampedArray?u:Uint8ClampedArray,\"%Uint16Array%\":\"undefined\"==typeof Uint16Array?u:Uint16Array,\"%Uint32Array%\":\"undefined\"==typeof Uint32Array?u:Uint32Array,\"%URIError%\":B,\"%WeakMap%\":\"undefined\"==typeof WeakMap?u:WeakMap,\"%WeakRef%\":\"undefined\"==typeof WeakRef?u:WeakRef,\"%WeakSet%\":\"undefined\"==typeof WeakSet?u:WeakSet};if(Z)try{null.error}catch(o){var ce=Z(Z(o));ae[\"%Error.prototype%\"]=ce}var le=function doEval(o){var s;if(\"%AsyncFunction%\"===o)s=getEvalledConstructor(\"async function () {}\");else if(\"%GeneratorFunction%\"===o)s=getEvalledConstructor(\"function* () {}\");else if(\"%AsyncGeneratorFunction%\"===o)s=getEvalledConstructor(\"async function* () {}\");else if(\"%AsyncGenerator%\"===o){var i=doEval(\"%AsyncGeneratorFunction%\");i&&(s=i.prototype)}else if(\"%AsyncIteratorPrototype%\"===o){var u=doEval(\"%AsyncGenerator%\");u&&Z&&(s=Z(u.prototype))}return ae[o]=s,s},pe={__proto__:null,\"%ArrayBufferPrototype%\":[\"ArrayBuffer\",\"prototype\"],\"%ArrayPrototype%\":[\"Array\",\"prototype\"],\"%ArrayProto_entries%\":[\"Array\",\"prototype\",\"entries\"],\"%ArrayProto_forEach%\":[\"Array\",\"prototype\",\"forEach\"],\"%ArrayProto_keys%\":[\"Array\",\"prototype\",\"keys\"],\"%ArrayProto_values%\":[\"Array\",\"prototype\",\"values\"],\"%AsyncFunctionPrototype%\":[\"AsyncFunction\",\"prototype\"],\"%AsyncGenerator%\":[\"AsyncGeneratorFunction\",\"prototype\"],\"%AsyncGeneratorPrototype%\":[\"AsyncGeneratorFunction\",\"prototype\",\"prototype\"],\"%BooleanPrototype%\":[\"Boolean\",\"prototype\"],\"%DataViewPrototype%\":[\"DataView\",\"prototype\"],\"%DatePrototype%\":[\"Date\",\"prototype\"],\"%ErrorPrototype%\":[\"Error\",\"prototype\"],\"%EvalErrorPrototype%\":[\"EvalError\",\"prototype\"],\"%Float32ArrayPrototype%\":[\"Float32Array\",\"prototype\"],\"%Float64ArrayPrototype%\":[\"Float64Array\",\"prototype\"],\"%FunctionPrototype%\":[\"Function\",\"prototype\"],\"%Generator%\":[\"GeneratorFunction\",\"prototype\"],\"%GeneratorPrototype%\":[\"GeneratorFunction\",\"prototype\",\"prototype\"],\"%Int8ArrayPrototype%\":[\"Int8Array\",\"prototype\"],\"%Int16ArrayPrototype%\":[\"Int16Array\",\"prototype\"],\"%Int32ArrayPrototype%\":[\"Int32Array\",\"prototype\"],\"%JSONParse%\":[\"JSON\",\"parse\"],\"%JSONStringify%\":[\"JSON\",\"stringify\"],\"%MapPrototype%\":[\"Map\",\"prototype\"],\"%NumberPrototype%\":[\"Number\",\"prototype\"],\"%ObjectPrototype%\":[\"Object\",\"prototype\"],\"%ObjProto_toString%\":[\"Object\",\"prototype\",\"toString\"],\"%ObjProto_valueOf%\":[\"Object\",\"prototype\",\"valueOf\"],\"%PromisePrototype%\":[\"Promise\",\"prototype\"],\"%PromiseProto_then%\":[\"Promise\",\"prototype\",\"then\"],\"%Promise_all%\":[\"Promise\",\"all\"],\"%Promise_reject%\":[\"Promise\",\"reject\"],\"%Promise_resolve%\":[\"Promise\",\"resolve\"],\"%RangeErrorPrototype%\":[\"RangeError\",\"prototype\"],\"%ReferenceErrorPrototype%\":[\"ReferenceError\",\"prototype\"],\"%RegExpPrototype%\":[\"RegExp\",\"prototype\"],\"%SetPrototype%\":[\"Set\",\"prototype\"],\"%SharedArrayBufferPrototype%\":[\"SharedArrayBuffer\",\"prototype\"],\"%StringPrototype%\":[\"String\",\"prototype\"],\"%SymbolPrototype%\":[\"Symbol\",\"prototype\"],\"%SyntaxErrorPrototype%\":[\"SyntaxError\",\"prototype\"],\"%TypedArrayPrototype%\":[\"TypedArray\",\"prototype\"],\"%TypeErrorPrototype%\":[\"TypeError\",\"prototype\"],\"%Uint8ArrayPrototype%\":[\"Uint8Array\",\"prototype\"],\"%Uint8ClampedArrayPrototype%\":[\"Uint8ClampedArray\",\"prototype\"],\"%Uint16ArrayPrototype%\":[\"Uint16Array\",\"prototype\"],\"%Uint32ArrayPrototype%\":[\"Uint32Array\",\"prototype\"],\"%URIErrorPrototype%\":[\"URIError\",\"prototype\"],\"%WeakMapPrototype%\":[\"WeakMap\",\"prototype\"],\"%WeakSetPrototype%\":[\"WeakSet\",\"prototype\"]},de=i(66743),fe=i(9957),ye=de.call(Function.call,Array.prototype.concat),be=de.call(Function.apply,Array.prototype.splice),_e=de.call(Function.call,String.prototype.replace),we=de.call(Function.call,String.prototype.slice),Se=de.call(Function.call,RegExp.prototype.exec),xe=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,Pe=/\\\\(\\\\)?/g,Te=function getBaseIntrinsic(o,s){var i,u=o;if(fe(pe,u)&&(u=\"%\"+(i=pe[u])[0]+\"%\"),fe(ae,u)){var _=ae[u];if(_===ee&&(_=le(u)),void 0===_&&!s)throw new L(\"intrinsic \"+o+\" exists, but is not available. Please file an issue!\");return{alias:i,name:u,value:_}}throw new j(\"intrinsic \"+o+\" does not exist!\")};o.exports=function GetIntrinsic(o,s){if(\"string\"!=typeof o||0===o.length)throw new L(\"intrinsic name must be a non-empty string\");if(arguments.length>1&&\"boolean\"!=typeof s)throw new L('\"allowMissing\" argument must be a boolean');if(null===Se(/^%?[^%]*%?$/,o))throw new j(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");var i=function stringToPath(o){var s=we(o,0,1),i=we(o,-1);if(\"%\"===s&&\"%\"!==i)throw new j(\"invalid intrinsic syntax, expected closing `%`\");if(\"%\"===i&&\"%\"!==s)throw new j(\"invalid intrinsic syntax, expected opening `%`\");var u=[];return _e(o,xe,(function(o,s,i,_){u[u.length]=i?_e(_,Pe,\"$1\"):s||o})),u}(o),u=i.length>0?i[0]:\"\",_=Te(\"%\"+u+\"%\",s),w=_.name,x=_.value,C=!1,B=_.alias;B&&(u=B[0],be(i,ye([0,1],B)));for(var $=1,U=!0;$<i.length;$+=1){var z=i[$],Y=we(z,0,1),Z=we(z,-1);if(('\"'===Y||\"'\"===Y||\"`\"===Y||'\"'===Z||\"'\"===Z||\"`\"===Z)&&Y!==Z)throw new j(\"property names with quotes must have matching quotes\");if(\"constructor\"!==z&&U||(C=!0),fe(ae,w=\"%\"+(u+=\".\"+z)+\"%\"))x=ae[w];else if(null!=x){if(!(z in x)){if(!s)throw new L(\"base intrinsic for \"+o+\" exists, but the property is not available.\");return}if(V&&$+1>=i.length){var ee=V(x,z);x=(U=!!ee)&&\"get\"in ee&&!(\"originalValue\"in ee.get)?ee.get:x[z]}else U=fe(x,z),x=x[z];U&&!C&&(ae[w]=x)}}return x}},75795:(o,s,i)=>{\"use strict\";var u=i(70453)(\"%Object.getOwnPropertyDescriptor%\",!0);if(u)try{u([],\"length\")}catch(o){u=null}o.exports=u},30592:(o,s,i)=>{\"use strict\";var u=i(30655),_=function hasPropertyDescriptors(){return!!u};_.hasArrayLengthDefineBug=function hasArrayLengthDefineBug(){if(!u)return null;try{return 1!==u([],\"length\",{value:1}).length}catch(o){return!0}},o.exports=_},80024:o=>{\"use strict\";var s={__proto__:null,foo:{}},i=Object;o.exports=function hasProto(){return{__proto__:s}.foo===s.foo&&!(s instanceof i)}},64039:(o,s,i)=>{\"use strict\";var u=\"undefined\"!=typeof Symbol&&Symbol,_=i(41333);o.exports=function hasNativeSymbols(){return\"function\"==typeof u&&(\"function\"==typeof Symbol&&(\"symbol\"==typeof u(\"foo\")&&(\"symbol\"==typeof Symbol(\"bar\")&&_())))}},41333:o=>{\"use strict\";o.exports=function hasSymbols(){if(\"function\"!=typeof Symbol||\"function\"!=typeof Object.getOwnPropertySymbols)return!1;if(\"symbol\"==typeof Symbol.iterator)return!0;var o={},s=Symbol(\"test\"),i=Object(s);if(\"string\"==typeof s)return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(s))return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(i))return!1;for(s in o[s]=42,o)return!1;if(\"function\"==typeof Object.keys&&0!==Object.keys(o).length)return!1;if(\"function\"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(o).length)return!1;var u=Object.getOwnPropertySymbols(o);if(1!==u.length||u[0]!==s)return!1;if(!Object.prototype.propertyIsEnumerable.call(o,s))return!1;if(\"function\"==typeof Object.getOwnPropertyDescriptor){var _=Object.getOwnPropertyDescriptor(o,s);if(42!==_.value||!0!==_.enumerable)return!1}return!0}},9957:(o,s,i)=>{\"use strict\";var u=Function.prototype.call,_=Object.prototype.hasOwnProperty,w=i(66743);o.exports=w.call(u,_)},45981:o=>{function deepFreeze(o){return o instanceof Map?o.clear=o.delete=o.set=function(){throw new Error(\"map is read-only\")}:o instanceof Set&&(o.add=o.clear=o.delete=function(){throw new Error(\"set is read-only\")}),Object.freeze(o),Object.getOwnPropertyNames(o).forEach((function(s){var i=o[s];\"object\"!=typeof i||Object.isFrozen(i)||deepFreeze(i)})),o}var s=deepFreeze,i=deepFreeze;s.default=i;class Response{constructor(o){void 0===o.data&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function escapeHTML(o){return o.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#x27;\")}function inherit(o,...s){const i=Object.create(null);for(const s in o)i[s]=o[s];return s.forEach((function(o){for(const s in o)i[s]=o[s]})),i}const emitsWrappingTags=o=>!!o.kind;class HTMLRenderer{constructor(o,s){this.buffer=\"\",this.classPrefix=s.classPrefix,o.walk(this)}addText(o){this.buffer+=escapeHTML(o)}openNode(o){if(!emitsWrappingTags(o))return;let s=o.kind;o.sublanguage||(s=`${this.classPrefix}${s}`),this.span(s)}closeNode(o){emitsWrappingTags(o)&&(this.buffer+=\"</span>\")}value(){return this.buffer}span(o){this.buffer+=`<span class=\"${o}\">`}}class TokenTree{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const s={kind:o,children:[]};this.add(s),this.stack.push(s)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,s){return\"string\"==typeof s?o.addText(s):s.children&&(o.openNode(s),s.children.forEach((s=>this._walk(o,s))),o.closeNode(s)),o}static _collapse(o){\"string\"!=typeof o&&o.children&&(o.children.every((o=>\"string\"==typeof o))?o.children=[o.children.join(\"\")]:o.children.forEach((o=>{TokenTree._collapse(o)})))}}class TokenTreeEmitter extends TokenTree{constructor(o){super(),this.options=o}addKeyword(o,s){\"\"!==o&&(this.openNode(s),this.addText(o),this.closeNode())}addText(o){\"\"!==o&&this.add(o)}addSublanguage(o,s){const i=o.root;i.kind=s,i.sublanguage=!0,this.add(i)}toHTML(){return new HTMLRenderer(this,this.options).value()}finalize(){return!0}}function source(o){return o?\"string\"==typeof o?o:o.source:null}const u=/\\[(?:[^\\\\\\]]|\\\\.)*\\]|\\(\\??|\\\\([1-9][0-9]*)|\\\\./;const _=\"[a-zA-Z]\\\\w*\",w=\"[a-zA-Z_]\\\\w*\",x=\"\\\\b\\\\d+(\\\\.\\\\d+)?\",C=\"(-?)(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)\",j=\"\\\\b(0b[01]+)\",L={begin:\"\\\\\\\\[\\\\s\\\\S]\",relevance:0},B={className:\"string\",begin:\"'\",end:\"'\",illegal:\"\\\\n\",contains:[L]},$={className:\"string\",begin:'\"',end:'\"',illegal:\"\\\\n\",contains:[L]},V={begin:/\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b/},COMMENT=function(o,s,i={}){const u=inherit({className:\"comment\",begin:o,end:s,contains:[]},i);return u.contains.push(V),u.contains.push({className:\"doctag\",begin:\"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):\",relevance:0}),u},U=COMMENT(\"//\",\"$\"),z=COMMENT(\"/\\\\*\",\"\\\\*/\"),Y=COMMENT(\"#\",\"$\"),Z={className:\"number\",begin:x,relevance:0},ee={className:\"number\",begin:C,relevance:0},ie={className:\"number\",begin:j,relevance:0},ae={className:\"number\",begin:x+\"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\",relevance:0},ce={begin:/(?=\\/[^/\\n]*\\/)/,contains:[{className:\"regexp\",begin:/\\//,end:/\\/[gimuy]*/,illegal:/\\n/,contains:[L,{begin:/\\[/,end:/\\]/,relevance:0,contains:[L]}]}]},le={className:\"title\",begin:_,relevance:0},pe={className:\"title\",begin:w,relevance:0},de={begin:\"\\\\.\\\\s*\"+w,relevance:0};var fe=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\\b\\B/,IDENT_RE:_,UNDERSCORE_IDENT_RE:w,NUMBER_RE:x,C_NUMBER_RE:C,BINARY_NUMBER_RE:j,RE_STARTERS_RE:\"!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~\",SHEBANG:(o={})=>{const s=/^#![ ]*\\//;return o.binary&&(o.begin=function concat(...o){return o.map((o=>source(o))).join(\"\")}(s,/.*\\b/,o.binary,/\\b.*/)),inherit({className:\"meta\",begin:s,end:/$/,relevance:0,\"on:begin\":(o,s)=>{0!==o.index&&s.ignoreMatch()}},o)},BACKSLASH_ESCAPE:L,APOS_STRING_MODE:B,QUOTE_STRING_MODE:$,PHRASAL_WORDS_MODE:V,COMMENT,C_LINE_COMMENT_MODE:U,C_BLOCK_COMMENT_MODE:z,HASH_COMMENT_MODE:Y,NUMBER_MODE:Z,C_NUMBER_MODE:ee,BINARY_NUMBER_MODE:ie,CSS_NUMBER_MODE:ae,REGEXP_MODE:ce,TITLE_MODE:le,UNDERSCORE_TITLE_MODE:pe,METHOD_GUARD:de,END_SAME_AS_BEGIN:function(o){return Object.assign(o,{\"on:begin\":(o,s)=>{s.data._beginMatch=o[1]},\"on:end\":(o,s)=>{s.data._beginMatch!==o[1]&&s.ignoreMatch()}})}});function skipIfhasPrecedingDot(o,s){\".\"===o.input[o.index-1]&&s.ignoreMatch()}function beginKeywords(o,s){s&&o.beginKeywords&&(o.begin=\"\\\\b(\"+o.beginKeywords.split(\" \").join(\"|\")+\")(?!\\\\.)(?=\\\\b|\\\\s)\",o.__beforeBegin=skipIfhasPrecedingDot,o.keywords=o.keywords||o.beginKeywords,delete o.beginKeywords,void 0===o.relevance&&(o.relevance=0))}function compileIllegal(o,s){Array.isArray(o.illegal)&&(o.illegal=function either(...o){return\"(\"+o.map((o=>source(o))).join(\"|\")+\")\"}(...o.illegal))}function compileMatch(o,s){if(o.match){if(o.begin||o.end)throw new Error(\"begin & end are not supported with match\");o.begin=o.match,delete o.match}}function compileRelevance(o,s){void 0===o.relevance&&(o.relevance=1)}const ye=[\"of\",\"and\",\"for\",\"in\",\"not\",\"or\",\"if\",\"then\",\"parent\",\"list\",\"value\"],be=\"keyword\";function compileKeywords(o,s,i=be){const u={};return\"string\"==typeof o?compileList(i,o.split(\" \")):Array.isArray(o)?compileList(i,o):Object.keys(o).forEach((function(i){Object.assign(u,compileKeywords(o[i],s,i))})),u;function compileList(o,i){s&&(i=i.map((o=>o.toLowerCase()))),i.forEach((function(s){const i=s.split(\"|\");u[i[0]]=[o,scoreForKeyword(i[0],i[1])]}))}}function scoreForKeyword(o,s){return s?Number(s):function commonKeyword(o){return ye.includes(o.toLowerCase())}(o)?0:1}function compileLanguage(o,{plugins:s}){function langRe(s,i){return new RegExp(source(s),\"m\"+(o.case_insensitive?\"i\":\"\")+(i?\"g\":\"\"))}class MultiRegex{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,s){s.position=this.position++,this.matchIndexes[this.matchAt]=s,this.regexes.push([s,o]),this.matchAt+=function countMatchGroups(o){return new RegExp(o.toString()+\"|\").exec(\"\").length-1}(o)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const o=this.regexes.map((o=>o[1]));this.matcherRe=langRe(function join(o,s=\"|\"){let i=0;return o.map((o=>{i+=1;const s=i;let _=source(o),w=\"\";for(;_.length>0;){const o=u.exec(_);if(!o){w+=_;break}w+=_.substring(0,o.index),_=_.substring(o.index+o[0].length),\"\\\\\"===o[0][0]&&o[1]?w+=\"\\\\\"+String(Number(o[1])+s):(w+=o[0],\"(\"===o[0]&&i++)}return w})).map((o=>`(${o})`)).join(s)}(o),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const s=this.matcherRe.exec(o);if(!s)return null;const i=s.findIndex(((o,s)=>s>0&&void 0!==o)),u=this.matchIndexes[i];return s.splice(0,i),Object.assign(s,u)}}class ResumableMultiRegex{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const s=new MultiRegex;return this.rules.slice(o).forEach((([o,i])=>s.addRule(o,i))),s.compile(),this.multiRegexes[o]=s,s}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(o,s){this.rules.push([o,s]),\"begin\"===s.type&&this.count++}exec(o){const s=this.getMatcher(this.regexIndex);s.lastIndex=this.lastIndex;let i=s.exec(o);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const s=this.getMatcher(0);s.lastIndex=this.lastIndex+1,i=s.exec(o)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(o.compilerExtensions||(o.compilerExtensions=[]),o.contains&&o.contains.includes(\"self\"))throw new Error(\"ERR: contains `self` is not supported at the top-level of a language.  See documentation.\");return o.classNameAliases=inherit(o.classNameAliases||{}),function compileMode(s,i){const u=s;if(s.isCompiled)return u;[compileMatch].forEach((o=>o(s,i))),o.compilerExtensions.forEach((o=>o(s,i))),s.__beforeBegin=null,[beginKeywords,compileIllegal,compileRelevance].forEach((o=>o(s,i))),s.isCompiled=!0;let _=null;if(\"object\"==typeof s.keywords&&(_=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=compileKeywords(s.keywords,o.case_insensitive)),s.lexemes&&_)throw new Error(\"ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) \");return _=_||s.lexemes||/\\w+/,u.keywordPatternRe=langRe(_,!0),i&&(s.begin||(s.begin=/\\B|\\b/),u.beginRe=langRe(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\\B|\\b/),s.end&&(u.endRe=langRe(s.end)),u.terminatorEnd=source(s.end)||\"\",s.endsWithParent&&i.terminatorEnd&&(u.terminatorEnd+=(s.end?\"|\":\"\")+i.terminatorEnd)),s.illegal&&(u.illegalRe=langRe(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(o){return function expandOrCloneMode(o){o.variants&&!o.cachedVariants&&(o.cachedVariants=o.variants.map((function(s){return inherit(o,{variants:null},s)})));if(o.cachedVariants)return o.cachedVariants;if(dependencyOnParent(o))return inherit(o,{starts:o.starts?inherit(o.starts):null});if(Object.isFrozen(o))return inherit(o);return o}(\"self\"===o?s:o)}))),s.contains.forEach((function(o){compileMode(o,u)})),s.starts&&compileMode(s.starts,i),u.matcher=function buildModeRegex(o){const s=new ResumableMultiRegex;return o.contains.forEach((o=>s.addRule(o.begin,{rule:o,type:\"begin\"}))),o.terminatorEnd&&s.addRule(o.terminatorEnd,{type:\"end\"}),o.illegal&&s.addRule(o.illegal,{type:\"illegal\"}),s}(u),u}(o)}function dependencyOnParent(o){return!!o&&(o.endsWithParent||dependencyOnParent(o.starts))}function BuildVuePlugin(o){const s={props:[\"language\",\"code\",\"autodetect\"],data:function(){return{detectedLanguage:\"\",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?\"\":\"hljs \"+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!o.getLanguage(this.language))return console.warn(`The language \"${this.language}\" you specified could not be found.`),this.unknownLanguage=!0,escapeHTML(this.code);let s={};return this.autoDetect?(s=o.highlightAuto(this.code),this.detectedLanguage=s.language):(s=o.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),s.value},autoDetect(){return!this.language||function hasValueOrEmptyAttribute(o){return Boolean(o||\"\"===o)}(this.autodetect)},ignoreIllegals:()=>!0},render(o){return o(\"pre\",{},[o(\"code\",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:s,VuePlugin:{install(o){o.component(\"highlightjs\",s)}}}}const _e={\"after:highlightElement\":({el:o,result:s,text:i})=>{const u=nodeStream(o);if(!u.length)return;const _=document.createElement(\"div\");_.innerHTML=s.value,s.value=function mergeStreams(o,s,i){let u=0,_=\"\";const w=[];function selectStream(){return o.length&&s.length?o[0].offset!==s[0].offset?o[0].offset<s[0].offset?o:s:\"start\"===s[0].event?o:s:o.length?o:s}function open(o){function attributeString(o){return\" \"+o.nodeName+'=\"'+escapeHTML(o.value)+'\"'}_+=\"<\"+tag(o)+[].map.call(o.attributes,attributeString).join(\"\")+\">\"}function close(o){_+=\"</\"+tag(o)+\">\"}function render(o){(\"start\"===o.event?open:close)(o.node)}for(;o.length||s.length;){let s=selectStream();if(_+=escapeHTML(i.substring(u,s[0].offset)),u=s[0].offset,s===o){w.reverse().forEach(close);do{render(s.splice(0,1)[0]),s=selectStream()}while(s===o&&s.length&&s[0].offset===u);w.reverse().forEach(open)}else\"start\"===s[0].event?w.push(s[0].node):w.pop(),render(s.splice(0,1)[0])}return _+escapeHTML(i.substr(u))}(u,nodeStream(_),i)}};function tag(o){return o.nodeName.toLowerCase()}function nodeStream(o){const s=[];return function _nodeStream(o,i){for(let u=o.firstChild;u;u=u.nextSibling)3===u.nodeType?i+=u.nodeValue.length:1===u.nodeType&&(s.push({event:\"start\",offset:i,node:u}),i=_nodeStream(u,i),tag(u).match(/br|hr|img|input/)||s.push({event:\"stop\",offset:i,node:u}));return i}(o,0),s}const we={},error=o=>{console.error(o)},warn=(o,...s)=>{console.log(`WARN: ${o}`,...s)},deprecated=(o,s)=>{we[`${o}/${s}`]||(console.log(`Deprecated as of ${o}. ${s}`),we[`${o}/${s}`]=!0)},Se=escapeHTML,xe=inherit,Pe=Symbol(\"nomatch\");var Te=function(o){const i=Object.create(null),u=Object.create(null),_=[];let w=!0;const x=/(^(<[^>]+>|\\t|)+|\\n)/gm,C=\"Could not find the language '{}', did you forget to load/include a language module?\",j={disableAutodetect:!0,name:\"Plain text\",contains:[]};let L={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\\blang(?:uage)?-([\\w-]+)\\b/i,classPrefix:\"hljs-\",tabReplace:null,useBR:!1,languages:null,__emitter:TokenTreeEmitter};function shouldNotHighlight(o){return L.noHighlightRe.test(o)}function highlight(o,s,i,u){let _=\"\",w=\"\";\"object\"==typeof s?(_=o,i=s.ignoreIllegals,w=s.language,u=void 0):(deprecated(\"10.7.0\",\"highlight(lang, code, ...args) has been deprecated.\"),deprecated(\"10.7.0\",\"Please use highlight(code, options) instead.\\nhttps://github.com/highlightjs/highlight.js/issues/2277\"),w=o,_=s);const x={code:_,language:w};fire(\"before:highlight\",x);const C=x.result?x.result:_highlight(x.language,x.code,i,u);return C.code=x.code,fire(\"after:highlight\",C),C}function _highlight(o,s,u,x){function keywordData(o,s){const i=B.case_insensitive?s[0].toLowerCase():s[0];return Object.prototype.hasOwnProperty.call(o.keywords,i)&&o.keywords[i]}function processBuffer(){null!=U.subLanguage?function processSubLanguage(){if(\"\"===Z)return;let o=null;if(\"string\"==typeof U.subLanguage){if(!i[U.subLanguage])return void Y.addText(Z);o=_highlight(U.subLanguage,Z,!0,z[U.subLanguage]),z[U.subLanguage]=o.top}else o=highlightAuto(Z,U.subLanguage.length?U.subLanguage:null);U.relevance>0&&(ee+=o.relevance),Y.addSublanguage(o.emitter,o.language)}():function processKeywords(){if(!U.keywords)return void Y.addText(Z);let o=0;U.keywordPatternRe.lastIndex=0;let s=U.keywordPatternRe.exec(Z),i=\"\";for(;s;){i+=Z.substring(o,s.index);const u=keywordData(U,s);if(u){const[o,_]=u;if(Y.addText(i),i=\"\",ee+=_,o.startsWith(\"_\"))i+=s[0];else{const i=B.classNameAliases[o]||o;Y.addKeyword(s[0],i)}}else i+=s[0];o=U.keywordPatternRe.lastIndex,s=U.keywordPatternRe.exec(Z)}i+=Z.substr(o),Y.addText(i)}(),Z=\"\"}function startNewMode(o){return o.className&&Y.openNode(B.classNameAliases[o.className]||o.className),U=Object.create(o,{parent:{value:U}}),U}function endOfMode(o,s,i){let u=function startsWith(o,s){const i=o&&o.exec(s);return i&&0===i.index}(o.endRe,i);if(u){if(o[\"on:end\"]){const i=new Response(o);o[\"on:end\"](s,i),i.isMatchIgnored&&(u=!1)}if(u){for(;o.endsParent&&o.parent;)o=o.parent;return o}}if(o.endsWithParent)return endOfMode(o.parent,s,i)}function doIgnore(o){return 0===U.matcher.regexIndex?(Z+=o[0],1):(ce=!0,0)}function doBeginMatch(o){const s=o[0],i=o.rule,u=new Response(i),_=[i.__beforeBegin,i[\"on:begin\"]];for(const i of _)if(i&&(i(o,u),u.isMatchIgnored))return doIgnore(s);return i&&i.endSameAsBegin&&(i.endRe=function escape(o){return new RegExp(o.replace(/[-/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\"),\"m\")}(s)),i.skip?Z+=s:(i.excludeBegin&&(Z+=s),processBuffer(),i.returnBegin||i.excludeBegin||(Z=s)),startNewMode(i),i.returnBegin?0:s.length}function doEndMatch(o){const i=o[0],u=s.substr(o.index),_=endOfMode(U,o,u);if(!_)return Pe;const w=U;w.skip?Z+=i:(w.returnEnd||w.excludeEnd||(Z+=i),processBuffer(),w.excludeEnd&&(Z=i));do{U.className&&Y.closeNode(),U.skip||U.subLanguage||(ee+=U.relevance),U=U.parent}while(U!==_.parent);return _.starts&&(_.endSameAsBegin&&(_.starts.endRe=_.endRe),startNewMode(_.starts)),w.returnEnd?0:i.length}let j={};function processLexeme(i,_){const x=_&&_[0];if(Z+=i,null==x)return processBuffer(),0;if(\"begin\"===j.type&&\"end\"===_.type&&j.index===_.index&&\"\"===x){if(Z+=s.slice(_.index,_.index+1),!w){const s=new Error(\"0 width match regex\");throw s.languageName=o,s.badRule=j.rule,s}return 1}if(j=_,\"begin\"===_.type)return doBeginMatch(_);if(\"illegal\"===_.type&&!u){const o=new Error('Illegal lexeme \"'+x+'\" for mode \"'+(U.className||\"<unnamed>\")+'\"');throw o.mode=U,o}if(\"end\"===_.type){const o=doEndMatch(_);if(o!==Pe)return o}if(\"illegal\"===_.type&&\"\"===x)return 1;if(ae>1e5&&ae>3*_.index){throw new Error(\"potential infinite loop, way more iterations than matches\")}return Z+=x,x.length}const B=getLanguage(o);if(!B)throw error(C.replace(\"{}\",o)),new Error('Unknown language: \"'+o+'\"');const $=compileLanguage(B,{plugins:_});let V=\"\",U=x||$;const z={},Y=new L.__emitter(L);!function processContinuations(){const o=[];for(let s=U;s!==B;s=s.parent)s.className&&o.unshift(s.className);o.forEach((o=>Y.openNode(o)))}();let Z=\"\",ee=0,ie=0,ae=0,ce=!1;try{for(U.matcher.considerAll();;){ae++,ce?ce=!1:U.matcher.considerAll(),U.matcher.lastIndex=ie;const o=U.matcher.exec(s);if(!o)break;const i=processLexeme(s.substring(ie,o.index),o);ie=o.index+i}return processLexeme(s.substr(ie)),Y.closeAllNodes(),Y.finalize(),V=Y.toHTML(),{relevance:Math.floor(ee),value:V,language:o,illegal:!1,emitter:Y,top:U}}catch(i){if(i.message&&i.message.includes(\"Illegal\"))return{illegal:!0,illegalBy:{msg:i.message,context:s.slice(ie-100,ie+100),mode:i.mode},sofar:V,relevance:0,value:Se(s),emitter:Y};if(w)return{illegal:!1,relevance:0,value:Se(s),emitter:Y,language:o,top:U,errorRaised:i};throw i}}function highlightAuto(o,s){s=s||L.languages||Object.keys(i);const u=function justTextHighlightResult(o){const s={relevance:0,emitter:new L.__emitter(L),value:Se(o),illegal:!1,top:j};return s.emitter.addText(o),s}(o),_=s.filter(getLanguage).filter(autoDetection).map((s=>_highlight(s,o,!1)));_.unshift(u);const w=_.sort(((o,s)=>{if(o.relevance!==s.relevance)return s.relevance-o.relevance;if(o.language&&s.language){if(getLanguage(o.language).supersetOf===s.language)return 1;if(getLanguage(s.language).supersetOf===o.language)return-1}return 0})),[x,C]=w,B=x;return B.second_best=C,B}const B={\"before:highlightElement\":({el:o})=>{L.useBR&&(o.innerHTML=o.innerHTML.replace(/\\n/g,\"\").replace(/<br[ /]*>/g,\"\\n\"))},\"after:highlightElement\":({result:o})=>{L.useBR&&(o.value=o.value.replace(/\\n/g,\"<br>\"))}},$=/^(<[^>]+>|\\t)+/gm,V={\"after:highlightElement\":({result:o})=>{L.tabReplace&&(o.value=o.value.replace($,(o=>o.replace(/\\t/g,L.tabReplace))))}};function highlightElement(o){let s=null;const i=function blockLanguage(o){let s=o.className+\" \";s+=o.parentNode?o.parentNode.className:\"\";const i=L.languageDetectRe.exec(s);if(i){const s=getLanguage(i[1]);return s||(warn(C.replace(\"{}\",i[1])),warn(\"Falling back to no-highlight mode for this block.\",o)),s?i[1]:\"no-highlight\"}return s.split(/\\s+/).find((o=>shouldNotHighlight(o)||getLanguage(o)))}(o);if(shouldNotHighlight(i))return;fire(\"before:highlightElement\",{el:o,language:i}),s=o;const _=s.textContent,w=i?highlight(_,{language:i,ignoreIllegals:!0}):highlightAuto(_);fire(\"after:highlightElement\",{el:o,result:w,text:_}),o.innerHTML=w.value,function updateClassName(o,s,i){const _=s?u[s]:i;o.classList.add(\"hljs\"),_&&o.classList.add(_)}(o,i,w.language),o.result={language:w.language,re:w.relevance,relavance:w.relevance},w.second_best&&(o.second_best={language:w.second_best.language,re:w.second_best.relevance,relavance:w.second_best.relevance})}const initHighlighting=()=>{if(initHighlighting.called)return;initHighlighting.called=!0,deprecated(\"10.6.0\",\"initHighlighting() is deprecated.  Use highlightAll() instead.\");document.querySelectorAll(\"pre code\").forEach(highlightElement)};let U=!1;function highlightAll(){if(\"loading\"===document.readyState)return void(U=!0);document.querySelectorAll(\"pre code\").forEach(highlightElement)}function getLanguage(o){return o=(o||\"\").toLowerCase(),i[o]||i[u[o]]}function registerAliases(o,{languageName:s}){\"string\"==typeof o&&(o=[o]),o.forEach((o=>{u[o.toLowerCase()]=s}))}function autoDetection(o){const s=getLanguage(o);return s&&!s.disableAutodetect}function fire(o,s){const i=o;_.forEach((function(o){o[i]&&o[i](s)}))}\"undefined\"!=typeof window&&window.addEventListener&&window.addEventListener(\"DOMContentLoaded\",(function boot(){U&&highlightAll()}),!1),Object.assign(o,{highlight,highlightAuto,highlightAll,fixMarkup:function deprecateFixMarkup(o){return deprecated(\"10.2.0\",\"fixMarkup will be removed entirely in v11.0\"),deprecated(\"10.2.0\",\"Please see https://github.com/highlightjs/highlight.js/issues/2534\"),function fixMarkup(o){return L.tabReplace||L.useBR?o.replace(x,(o=>\"\\n\"===o?L.useBR?\"<br>\":o:L.tabReplace?o.replace(/\\t/g,L.tabReplace):o)):o}(o)},highlightElement,highlightBlock:function deprecateHighlightBlock(o){return deprecated(\"10.7.0\",\"highlightBlock will be removed entirely in v12.0\"),deprecated(\"10.7.0\",\"Please use highlightElement now.\"),highlightElement(o)},configure:function configure(o){o.useBR&&(deprecated(\"10.3.0\",\"'useBR' will be removed entirely in v11.0\"),deprecated(\"10.3.0\",\"Please see https://github.com/highlightjs/highlight.js/issues/2559\")),L=xe(L,o)},initHighlighting,initHighlightingOnLoad:function initHighlightingOnLoad(){deprecated(\"10.6.0\",\"initHighlightingOnLoad() is deprecated.  Use highlightAll() instead.\"),U=!0},registerLanguage:function registerLanguage(s,u){let _=null;try{_=u(o)}catch(o){if(error(\"Language definition for '{}' could not be registered.\".replace(\"{}\",s)),!w)throw o;error(o),_=j}_.name||(_.name=s),i[s]=_,_.rawDefinition=u.bind(null,o),_.aliases&&registerAliases(_.aliases,{languageName:s})},unregisterLanguage:function unregisterLanguage(o){delete i[o];for(const s of Object.keys(u))u[s]===o&&delete u[s]},listLanguages:function listLanguages(){return Object.keys(i)},getLanguage,registerAliases,requireLanguage:function requireLanguage(o){deprecated(\"10.4.0\",\"requireLanguage will be removed entirely in v11.\"),deprecated(\"10.4.0\",\"Please see https://github.com/highlightjs/highlight.js/pull/2844\");const s=getLanguage(o);if(s)return s;throw new Error(\"The '{}' language is required, but not loaded.\".replace(\"{}\",o))},autoDetection,inherit:xe,addPlugin:function addPlugin(o){!function upgradePluginAPI(o){o[\"before:highlightBlock\"]&&!o[\"before:highlightElement\"]&&(o[\"before:highlightElement\"]=s=>{o[\"before:highlightBlock\"](Object.assign({block:s.el},s))}),o[\"after:highlightBlock\"]&&!o[\"after:highlightElement\"]&&(o[\"after:highlightElement\"]=s=>{o[\"after:highlightBlock\"](Object.assign({block:s.el},s))})}(o),_.push(o)},vuePlugin:BuildVuePlugin(o).VuePlugin}),o.debugMode=function(){w=!1},o.safeMode=function(){w=!0},o.versionString=\"10.7.3\";for(const o in fe)\"object\"==typeof fe[o]&&s(fe[o]);return Object.assign(o,fe),o.addPlugin(B),o.addPlugin(_e),o.addPlugin(V),o}({});o.exports=Te},35344:o=>{function concat(...o){return o.map((o=>function source(o){return o?\"string\"==typeof o?o:o.source:null}(o))).join(\"\")}o.exports=function bash(o){const s={},i={begin:/\\$\\{/,end:/\\}/,contains:[\"self\",{begin:/:-/,contains:[s]}]};Object.assign(s,{className:\"variable\",variants:[{begin:concat(/\\$[\\w\\d#@][\\w\\d_]*/,\"(?![\\\\w\\\\d])(?![$])\")},i]});const u={className:\"subst\",begin:/\\$\\(/,end:/\\)/,contains:[o.BACKSLASH_ESCAPE]},_={begin:/<<-?\\s*(?=\\w+)/,starts:{contains:[o.END_SAME_AS_BEGIN({begin:/(\\w+)/,end:/(\\w+)/,className:\"string\"})]}},w={className:\"string\",begin:/\"/,end:/\"/,contains:[o.BACKSLASH_ESCAPE,s,u]};u.contains.push(w);const x={begin:/\\$\\(\\(/,end:/\\)\\)/,contains:[{begin:/\\d+#[0-9a-f]+/,className:\"number\"},o.NUMBER_MODE,s]},C=o.SHEBANG({binary:`(${[\"fish\",\"bash\",\"zsh\",\"sh\",\"csh\",\"ksh\",\"tcsh\",\"dash\",\"scsh\"].join(\"|\")})`,relevance:10}),j={className:\"function\",begin:/\\w[\\w\\d_]*\\s*\\(\\s*\\)\\s*\\{/,returnBegin:!0,contains:[o.inherit(o.TITLE_MODE,{begin:/\\w[\\w\\d_]*/})],relevance:0};return{name:\"Bash\",aliases:[\"sh\",\"zsh\"],keywords:{$pattern:/\\b[a-z._-]+\\b/,keyword:\"if then else elif fi for while in do done case esac function\",literal:\"true false\",built_in:\"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp\"},contains:[C,o.SHEBANG(),j,x,o.HASH_COMMENT_MODE,_,w,{className:\"\",begin:/\\\\\"/},{className:\"string\",begin:/'/,end:/'/},s]}}},73402:o=>{function concat(...o){return o.map((o=>function source(o){return o?\"string\"==typeof o?o:o.source:null}(o))).join(\"\")}o.exports=function http(o){const s=\"HTTP/(2|1\\\\.[01])\",i={className:\"attribute\",begin:concat(\"^\",/[A-Za-z][A-Za-z0-9-]*/,\"(?=\\\\:\\\\s)\"),starts:{contains:[{className:\"punctuation\",begin:/: /,relevance:0,starts:{end:\"$\",relevance:0}}]}},u=[i,{begin:\"\\\\n\\\\n\",starts:{subLanguage:[],endsWithParent:!0}}];return{name:\"HTTP\",aliases:[\"https\"],illegal:/\\S/,contains:[{begin:\"^(?=\"+s+\" \\\\d{3})\",end:/$/,contains:[{className:\"meta\",begin:s},{className:\"number\",begin:\"\\\\b\\\\d{3}\\\\b\"}],starts:{end:/\\b\\B/,illegal:/\\S/,contains:u}},{begin:\"(?=^[A-Z]+ (.*?) \"+s+\"$)\",end:/$/,contains:[{className:\"string\",begin:\" \",end:\" \",excludeBegin:!0,excludeEnd:!0},{className:\"meta\",begin:s},{className:\"keyword\",begin:\"[A-Z]+\"}],starts:{end:/\\b\\B/,illegal:/\\S/,contains:u}},o.inherit(i,{relevance:0})]}}},95089:o=>{const s=\"[A-Za-z$_][0-9A-Za-z$_]*\",i=[\"as\",\"in\",\"of\",\"if\",\"for\",\"while\",\"finally\",\"var\",\"new\",\"function\",\"do\",\"return\",\"void\",\"else\",\"break\",\"catch\",\"instanceof\",\"with\",\"throw\",\"case\",\"default\",\"try\",\"switch\",\"continue\",\"typeof\",\"delete\",\"let\",\"yield\",\"const\",\"class\",\"debugger\",\"async\",\"await\",\"static\",\"import\",\"from\",\"export\",\"extends\"],u=[\"true\",\"false\",\"null\",\"undefined\",\"NaN\",\"Infinity\"],_=[].concat([\"setInterval\",\"setTimeout\",\"clearInterval\",\"clearTimeout\",\"require\",\"exports\",\"eval\",\"isFinite\",\"isNaN\",\"parseFloat\",\"parseInt\",\"decodeURI\",\"decodeURIComponent\",\"encodeURI\",\"encodeURIComponent\",\"escape\",\"unescape\"],[\"arguments\",\"this\",\"super\",\"console\",\"window\",\"document\",\"localStorage\",\"module\",\"global\"],[\"Intl\",\"DataView\",\"Number\",\"Math\",\"Date\",\"String\",\"RegExp\",\"Object\",\"Function\",\"Boolean\",\"Error\",\"Symbol\",\"Set\",\"Map\",\"WeakSet\",\"WeakMap\",\"Proxy\",\"Reflect\",\"JSON\",\"Promise\",\"Float64Array\",\"Int16Array\",\"Int32Array\",\"Int8Array\",\"Uint16Array\",\"Uint32Array\",\"Float32Array\",\"Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"ArrayBuffer\",\"BigInt64Array\",\"BigUint64Array\",\"BigInt\"],[\"EvalError\",\"InternalError\",\"RangeError\",\"ReferenceError\",\"SyntaxError\",\"TypeError\",\"URIError\"]);function lookahead(o){return concat(\"(?=\",o,\")\")}function concat(...o){return o.map((o=>function source(o){return o?\"string\"==typeof o?o:o.source:null}(o))).join(\"\")}o.exports=function javascript(o){const w=s,x=\"<>\",C=\"</>\",j={begin:/<[A-Za-z0-9\\\\._:-]+/,end:/\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,isTrulyOpeningTag:(o,s)=>{const i=o[0].length+o.index,u=o.input[i];\"<\"!==u?\">\"===u&&(((o,{after:s})=>{const i=\"</\"+o[0].slice(1);return-1!==o.input.indexOf(i,s)})(o,{after:i})||s.ignoreMatch()):s.ignoreMatch()}},L={$pattern:s,keyword:i,literal:u,built_in:_},B=\"[0-9](_?[0-9])*\",$=`\\\\.(${B})`,V=\"0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*\",U={className:\"number\",variants:[{begin:`(\\\\b(${V})((${$})|\\\\.)?|(${$}))[eE][+-]?(${B})\\\\b`},{begin:`\\\\b(${V})\\\\b((${$})\\\\b|\\\\.)?|(${$})\\\\b`},{begin:\"\\\\b(0|[1-9](_?[0-9])*)n\\\\b\"},{begin:\"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\"},{begin:\"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\"},{begin:\"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\"},{begin:\"\\\\b0[0-7]+n?\\\\b\"}],relevance:0},z={className:\"subst\",begin:\"\\\\$\\\\{\",end:\"\\\\}\",keywords:L,contains:[]},Y={begin:\"html`\",end:\"\",starts:{end:\"`\",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,z],subLanguage:\"xml\"}},Z={begin:\"css`\",end:\"\",starts:{end:\"`\",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,z],subLanguage:\"css\"}},ee={className:\"string\",begin:\"`\",end:\"`\",contains:[o.BACKSLASH_ESCAPE,z]},ie={className:\"comment\",variants:[o.COMMENT(/\\/\\*\\*(?!\\/)/,\"\\\\*/\",{relevance:0,contains:[{className:\"doctag\",begin:\"@[A-Za-z]+\",contains:[{className:\"type\",begin:\"\\\\{\",end:\"\\\\}\",relevance:0},{className:\"variable\",begin:w+\"(?=\\\\s*(-)|$)\",endsParent:!0,relevance:0},{begin:/(?=[^\\n])\\s/,relevance:0}]}]}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE]},ae=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,Y,Z,ee,U,o.REGEXP_MODE];z.contains=ae.concat({begin:/\\{/,end:/\\}/,keywords:L,contains:[\"self\"].concat(ae)});const ce=[].concat(ie,z.contains),le=ce.concat([{begin:/\\(/,end:/\\)/,keywords:L,contains:[\"self\"].concat(ce)}]),pe={className:\"params\",begin:/\\(/,end:/\\)/,excludeBegin:!0,excludeEnd:!0,keywords:L,contains:le};return{name:\"Javascript\",aliases:[\"js\",\"jsx\",\"mjs\",\"cjs\"],keywords:L,exports:{PARAMS_CONTAINS:le},illegal:/#(?![$_A-z])/,contains:[o.SHEBANG({label:\"shebang\",binary:\"node\",relevance:5}),{label:\"use_strict\",className:\"meta\",relevance:10,begin:/^\\s*['\"]use (strict|asm)['\"]/},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,Y,Z,ee,ie,U,{begin:concat(/[{,\\n]\\s*/,lookahead(concat(/(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,w+\"\\\\s*:\"))),relevance:0,contains:[{className:\"attr\",begin:w+lookahead(\"\\\\s*:\"),relevance:0}]},{begin:\"(\"+o.RE_STARTERS_RE+\"|\\\\b(case|return|throw)\\\\b)\\\\s*\",keywords:\"return throw case\",contains:[ie,o.REGEXP_MODE,{className:\"function\",begin:\"(\\\\([^()]*(\\\\([^()]*(\\\\([^()]*\\\\)[^()]*)*\\\\)[^()]*)*\\\\)|\"+o.UNDERSCORE_IDENT_RE+\")\\\\s*=>\",returnBegin:!0,end:\"\\\\s*=>\",contains:[{className:\"params\",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\\(\\s*\\)/,skip:!0},{begin:/\\(/,end:/\\)/,excludeBegin:!0,excludeEnd:!0,keywords:L,contains:le}]}]},{begin:/,/,relevance:0},{className:\"\",begin:/\\s/,end:/\\s*/,skip:!0},{variants:[{begin:x,end:C},{begin:j.begin,\"on:begin\":j.isTrulyOpeningTag,end:j.end}],subLanguage:\"xml\",contains:[{begin:j.begin,end:j.end,skip:!0,contains:[\"self\"]}]}],relevance:0},{className:\"function\",beginKeywords:\"function\",end:/[{;]/,excludeEnd:!0,keywords:L,contains:[\"self\",o.inherit(o.TITLE_MODE,{begin:w}),pe],illegal:/%/},{beginKeywords:\"while if switch catch for\"},{className:\"function\",begin:o.UNDERSCORE_IDENT_RE+\"\\\\([^()]*(\\\\([^()]*(\\\\([^()]*\\\\)[^()]*)*\\\\)[^()]*)*\\\\)\\\\s*\\\\{\",returnBegin:!0,contains:[pe,o.inherit(o.TITLE_MODE,{begin:w})]},{variants:[{begin:\"\\\\.\"+w},{begin:\"\\\\$\"+w}],relevance:0},{className:\"class\",beginKeywords:\"class\",end:/[{;=]/,excludeEnd:!0,illegal:/[:\"[\\]]/,contains:[{beginKeywords:\"extends\"},o.UNDERSCORE_TITLE_MODE]},{begin:/\\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[o.inherit(o.TITLE_MODE,{begin:w}),\"self\",pe]},{begin:\"(get|set)\\\\s+(?=\"+w+\"\\\\()\",end:/\\{/,keywords:\"get set\",contains:[o.inherit(o.TITLE_MODE,{begin:w}),{begin:/\\(\\)/},pe]},{begin:/\\$[(.]/}]}}},65772:o=>{o.exports=function json(o){const s={literal:\"true false null\"},i=[o.C_LINE_COMMENT_MODE,o.C_BLOCK_COMMENT_MODE],u=[o.QUOTE_STRING_MODE,o.C_NUMBER_MODE],_={end:\",\",endsWithParent:!0,excludeEnd:!0,contains:u,keywords:s},w={begin:/\\{/,end:/\\}/,contains:[{className:\"attr\",begin:/\"/,end:/\"/,contains:[o.BACKSLASH_ESCAPE],illegal:\"\\\\n\"},o.inherit(_,{begin:/:/})].concat(i),illegal:\"\\\\S\"},x={begin:\"\\\\[\",end:\"\\\\]\",contains:[o.inherit(_)],illegal:\"\\\\S\"};return u.push(w,x),i.forEach((function(o){u.push(o)})),{name:\"JSON\",contains:u,keywords:s,illegal:\"\\\\S\"}}},26571:o=>{o.exports=function powershell(o){const s={$pattern:/-?[A-z\\.\\-]+\\b/,keyword:\"if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter\",built_in:\"ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write\"},i={begin:\"`[\\\\s\\\\S]\",relevance:0},u={className:\"variable\",variants:[{begin:/\\$\\B/},{className:\"keyword\",begin:/\\$this/},{begin:/\\$[\\w\\d][\\w\\d_:]*/}]},_={className:\"string\",variants:[{begin:/\"/,end:/\"/},{begin:/@\"/,end:/^\"@/}],contains:[i,u,{className:\"variable\",begin:/\\$[A-z]/,end:/[^A-z]/}]},w={className:\"string\",variants:[{begin:/'/,end:/'/},{begin:/@'/,end:/^'@/}]},x=o.inherit(o.COMMENT(null,null),{variants:[{begin:/#/,end:/$/},{begin:/<#/,end:/#>/}],contains:[{className:\"doctag\",variants:[{begin:/\\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/},{begin:/\\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\\s+\\S+/}]}]}),C={className:\"built_in\",variants:[{begin:\"(\".concat(\"Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where\",\")+(-)[\\\\w\\\\d]+\")}]},j={className:\"class\",beginKeywords:\"class enum\",end:/\\s*[{]/,excludeEnd:!0,relevance:0,contains:[o.TITLE_MODE]},L={className:\"function\",begin:/function\\s+/,end:/\\s*\\{|$/,excludeEnd:!0,returnBegin:!0,relevance:0,contains:[{begin:\"function\",relevance:0,className:\"keyword\"},{className:\"title\",begin:/\\w[\\w\\d]*((-)[\\w\\d]+)*/,relevance:0},{begin:/\\(/,end:/\\)/,className:\"params\",relevance:0,contains:[u]}]},B={begin:/using\\s/,end:/$/,returnBegin:!0,contains:[_,w,{className:\"keyword\",begin:/(using|assembly|command|module|namespace|type)/}]},$={variants:[{className:\"operator\",begin:\"(\".concat(\"-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor\",\")\\\\b\")},{className:\"literal\",begin:/(-)[\\w\\d]+/,relevance:0}]},V={className:\"function\",begin:/\\[.*\\]\\s*[\\w]+[ ]??\\(/,end:/$/,returnBegin:!0,relevance:0,contains:[{className:\"keyword\",begin:\"(\".concat(s.keyword.toString().replace(/\\s/g,\"|\"),\")\\\\b\"),endsParent:!0,relevance:0},o.inherit(o.TITLE_MODE,{endsParent:!0})]},U=[V,x,i,o.NUMBER_MODE,_,w,C,u,{className:\"literal\",begin:/\\$(null|true|false)\\b/},{className:\"selector-tag\",begin:/@\\B/,relevance:0}],z={begin:/\\[/,end:/\\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[].concat(\"self\",U,{begin:\"(\"+[\"string\",\"char\",\"byte\",\"int\",\"long\",\"bool\",\"decimal\",\"single\",\"double\",\"DateTime\",\"xml\",\"array\",\"hashtable\",\"void\"].join(\"|\")+\")\",className:\"built_in\",relevance:0},{className:\"type\",begin:/[\\.\\w\\d]+/,relevance:0})};return V.contains.unshift(z),{name:\"PowerShell\",aliases:[\"ps\",\"ps1\"],case_insensitive:!0,keywords:s,contains:U.concat(j,L,B,$,z)}}},17285:o=>{function source(o){return o?\"string\"==typeof o?o:o.source:null}function lookahead(o){return concat(\"(?=\",o,\")\")}function concat(...o){return o.map((o=>source(o))).join(\"\")}function either(...o){return\"(\"+o.map((o=>source(o))).join(\"|\")+\")\"}o.exports=function xml(o){const s=concat(/[A-Z_]/,function optional(o){return concat(\"(\",o,\")?\")}(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),i={className:\"symbol\",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\\s/,contains:[{className:\"meta-keyword\",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\\n/}]},_=o.inherit(u,{begin:/\\(/,end:/\\)/}),w=o.inherit(o.APOS_STRING_MODE,{className:\"meta-string\"}),x=o.inherit(o.QUOTE_STRING_MODE,{className:\"meta-string\"}),C={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:\"attr\",begin:/[A-Za-z0-9._:-]+/,relevance:0},{begin:/=\\s*/,relevance:0,contains:[{className:\"string\",endsParent:!0,variants:[{begin:/\"/,end:/\"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\\s\"'=<>`]+/}]}]}]};return{name:\"HTML, XML\",aliases:[\"html\",\"xhtml\",\"rss\",\"atom\",\"xjb\",\"xsd\",\"xsl\",\"plist\",\"wsf\",\"svg\"],case_insensitive:!0,contains:[{className:\"meta\",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,x,w,_,{begin:/\\[/,end:/\\]/,contains:[{className:\"meta\",begin:/<![a-z]/,end:/>/,contains:[u,_,x,w]}]}]},o.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\\[CDATA\\[/,end:/\\]\\]>/,relevance:10},i,{className:\"meta\",begin:/<\\?xml/,end:/\\?>/,relevance:10},{className:\"tag\",begin:/<style(?=\\s|>)/,end:/>/,keywords:{name:\"style\"},contains:[C],starts:{end:/<\\/style>/,returnEnd:!0,subLanguage:[\"css\",\"xml\"]}},{className:\"tag\",begin:/<script(?=\\s|>)/,end:/>/,keywords:{name:\"script\"},contains:[C],starts:{end:/<\\/script>/,returnEnd:!0,subLanguage:[\"javascript\",\"handlebars\",\"xml\"]}},{className:\"tag\",begin:/<>|<\\/>/},{className:\"tag\",begin:concat(/</,lookahead(concat(s,either(/\\/>/,/>/,/\\s/)))),end:/\\/?>/,contains:[{className:\"name\",begin:s,relevance:0,starts:C}]},{className:\"tag\",begin:concat(/<\\//,lookahead(concat(s,/>/))),contains:[{className:\"name\",begin:s,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}},17533:o=>{o.exports=function yaml(o){var s=\"true false yes no null\",i=\"[\\\\w#;/?:@&=+$,.~*'()[\\\\]]+\",u={className:\"string\",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/\"/,end:/\"/},{begin:/\\S+/}],contains:[o.BACKSLASH_ESCAPE,{className:\"template-variable\",variants:[{begin:/\\{\\{/,end:/\\}\\}/},{begin:/%\\{/,end:/\\}/}]}]},_=o.inherit(u,{variants:[{begin:/'/,end:/'/},{begin:/\"/,end:/\"/},{begin:/[^\\s,{}[\\]]+/}]}),w={className:\"number\",begin:\"\\\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\\\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\\\.[0-9]*)?([ \\\\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\\\b\"},x={end:\",\",endsWithParent:!0,excludeEnd:!0,keywords:s,relevance:0},C={begin:/\\{/,end:/\\}/,contains:[x],illegal:\"\\\\n\",relevance:0},j={begin:\"\\\\[\",end:\"\\\\]\",contains:[x],illegal:\"\\\\n\",relevance:0},L=[{className:\"attr\",variants:[{begin:\"\\\\w[\\\\w :\\\\/.-]*:(?=[ \\t]|$)\"},{begin:'\"\\\\w[\\\\w :\\\\/.-]*\":(?=[ \\t]|$)'},{begin:\"'\\\\w[\\\\w :\\\\/.-]*':(?=[ \\t]|$)\"}]},{className:\"meta\",begin:\"^---\\\\s*$\",relevance:10},{className:\"string\",begin:\"[\\\\|>]([1-9]?[+-])?[ ]*\\\\n( +)[^ ][^\\\\n]*\\\\n(\\\\2[^\\\\n]+\\\\n?)*\"},{begin:\"<%[%=-]?\",end:\"[%-]?%>\",subLanguage:\"ruby\",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:\"type\",begin:\"!\\\\w+!\"+i},{className:\"type\",begin:\"!<\"+i+\">\"},{className:\"type\",begin:\"!\"+i},{className:\"type\",begin:\"!!\"+i},{className:\"meta\",begin:\"&\"+o.UNDERSCORE_IDENT_RE+\"$\"},{className:\"meta\",begin:\"\\\\*\"+o.UNDERSCORE_IDENT_RE+\"$\"},{className:\"bullet\",begin:\"-(?=[ ]|$)\",relevance:0},o.HASH_COMMENT_MODE,{beginKeywords:s,keywords:{literal:s}},w,{className:\"number\",begin:o.C_NUMBER_RE+\"\\\\b\",relevance:0},C,j,u],B=[...L];return B.pop(),B.push(_),x.contains=B,{name:\"YAML\",case_insensitive:!0,aliases:[\"yml\"],contains:L}}},251:(o,s)=>{s.read=function(o,s,i,u,_){var w,x,C=8*_-u-1,j=(1<<C)-1,L=j>>1,B=-7,$=i?_-1:0,V=i?-1:1,U=o[s+$];for($+=V,w=U&(1<<-B)-1,U>>=-B,B+=C;B>0;w=256*w+o[s+$],$+=V,B-=8);for(x=w&(1<<-B)-1,w>>=-B,B+=u;B>0;x=256*x+o[s+$],$+=V,B-=8);if(0===w)w=1-L;else{if(w===j)return x?NaN:1/0*(U?-1:1);x+=Math.pow(2,u),w-=L}return(U?-1:1)*x*Math.pow(2,w-u)},s.write=function(o,s,i,u,_,w){var x,C,j,L=8*w-_-1,B=(1<<L)-1,$=B>>1,V=23===_?Math.pow(2,-24)-Math.pow(2,-77):0,U=u?0:w-1,z=u?1:-1,Y=s<0||0===s&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(C=isNaN(s)?1:0,x=B):(x=Math.floor(Math.log(s)/Math.LN2),s*(j=Math.pow(2,-x))<1&&(x--,j*=2),(s+=x+$>=1?V/j:V*Math.pow(2,1-$))*j>=2&&(x++,j/=2),x+$>=B?(C=0,x=B):x+$>=1?(C=(s*j-1)*Math.pow(2,_),x+=$):(C=s*Math.pow(2,$-1)*Math.pow(2,_),x=0));_>=8;o[i+U]=255&C,U+=z,C/=256,_-=8);for(x=x<<_|C,L+=_;L>0;o[i+U]=255&x,U+=z,x/=256,L-=8);o[i+U-z]|=128*Y}},9404:function(o){o.exports=function(){\"use strict\";var o=Array.prototype.slice;function createClass(o,s){s&&(o.prototype=Object.create(s.prototype)),o.prototype.constructor=o}function Iterable(o){return isIterable(o)?o:Seq(o)}function KeyedIterable(o){return isKeyed(o)?o:KeyedSeq(o)}function IndexedIterable(o){return isIndexed(o)?o:IndexedSeq(o)}function SetIterable(o){return isIterable(o)&&!isAssociative(o)?o:SetSeq(o)}function isIterable(o){return!(!o||!o[s])}function isKeyed(o){return!(!o||!o[i])}function isIndexed(o){return!(!o||!o[u])}function isAssociative(o){return isKeyed(o)||isIndexed(o)}function isOrdered(o){return!(!o||!o[_])}createClass(KeyedIterable,Iterable),createClass(IndexedIterable,Iterable),createClass(SetIterable,Iterable),Iterable.isIterable=isIterable,Iterable.isKeyed=isKeyed,Iterable.isIndexed=isIndexed,Iterable.isAssociative=isAssociative,Iterable.isOrdered=isOrdered,Iterable.Keyed=KeyedIterable,Iterable.Indexed=IndexedIterable,Iterable.Set=SetIterable;var s=\"@@__IMMUTABLE_ITERABLE__@@\",i=\"@@__IMMUTABLE_KEYED__@@\",u=\"@@__IMMUTABLE_INDEXED__@@\",_=\"@@__IMMUTABLE_ORDERED__@@\",w=\"delete\",x=5,C=1<<x,j=C-1,L={},B={value:!1},$={value:!1};function MakeRef(o){return o.value=!1,o}function SetRef(o){o&&(o.value=!0)}function OwnerID(){}function arrCopy(o,s){s=s||0;for(var i=Math.max(0,o.length-s),u=new Array(i),_=0;_<i;_++)u[_]=o[_+s];return u}function ensureSize(o){return void 0===o.size&&(o.size=o.__iterate(returnTrue)),o.size}function wrapIndex(o,s){if(\"number\"!=typeof s){var i=s>>>0;if(\"\"+i!==s||4294967295===i)return NaN;s=i}return s<0?ensureSize(o)+s:s}function returnTrue(){return!0}function wholeSlice(o,s,i){return(0===o||void 0!==i&&o<=-i)&&(void 0===s||void 0!==i&&s>=i)}function resolveBegin(o,s){return resolveIndex(o,s,0)}function resolveEnd(o,s){return resolveIndex(o,s,s)}function resolveIndex(o,s,i){return void 0===o?i:o<0?Math.max(0,s+o):void 0===s?o:Math.min(s,o)}var V=0,U=1,z=2,Y=\"function\"==typeof Symbol&&Symbol.iterator,Z=\"@@iterator\",ee=Y||Z;function Iterator(o){this.next=o}function iteratorValue(o,s,i,u){var _=0===o?s:1===o?i:[s,i];return u?u.value=_:u={value:_,done:!1},u}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(o){return!!getIteratorFn(o)}function isIterator(o){return o&&\"function\"==typeof o.next}function getIterator(o){var s=getIteratorFn(o);return s&&s.call(o)}function getIteratorFn(o){var s=o&&(Y&&o[Y]||o[Z]);if(\"function\"==typeof s)return s}function isArrayLike(o){return o&&\"number\"==typeof o.length}function Seq(o){return null==o?emptySequence():isIterable(o)?o.toSeq():seqFromValue(o)}function KeyedSeq(o){return null==o?emptySequence().toKeyedSeq():isIterable(o)?isKeyed(o)?o.toSeq():o.fromEntrySeq():keyedSeqFromValue(o)}function IndexedSeq(o){return null==o?emptySequence():isIterable(o)?isKeyed(o)?o.entrySeq():o.toIndexedSeq():indexedSeqFromValue(o)}function SetSeq(o){return(null==o?emptySequence():isIterable(o)?isKeyed(o)?o.entrySeq():o:indexedSeqFromValue(o)).toSetSeq()}Iterator.prototype.toString=function(){return\"[Iterator]\"},Iterator.KEYS=V,Iterator.VALUES=U,Iterator.ENTRIES=z,Iterator.prototype.inspect=Iterator.prototype.toSource=function(){return this.toString()},Iterator.prototype[ee]=function(){return this},createClass(Seq,Iterable),Seq.of=function(){return Seq(arguments)},Seq.prototype.toSeq=function(){return this},Seq.prototype.toString=function(){return this.__toString(\"Seq {\",\"}\")},Seq.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Seq.prototype.__iterate=function(o,s){return seqIterate(this,o,s,!0)},Seq.prototype.__iterator=function(o,s){return seqIterator(this,o,s,!0)},createClass(KeyedSeq,Seq),KeyedSeq.prototype.toKeyedSeq=function(){return this},createClass(IndexedSeq,Seq),IndexedSeq.of=function(){return IndexedSeq(arguments)},IndexedSeq.prototype.toIndexedSeq=function(){return this},IndexedSeq.prototype.toString=function(){return this.__toString(\"Seq [\",\"]\")},IndexedSeq.prototype.__iterate=function(o,s){return seqIterate(this,o,s,!1)},IndexedSeq.prototype.__iterator=function(o,s){return seqIterator(this,o,s,!1)},createClass(SetSeq,Seq),SetSeq.of=function(){return SetSeq(arguments)},SetSeq.prototype.toSetSeq=function(){return this},Seq.isSeq=isSeq,Seq.Keyed=KeyedSeq,Seq.Set=SetSeq,Seq.Indexed=IndexedSeq;var ie,ae,ce,le=\"@@__IMMUTABLE_SEQ__@@\";function ArraySeq(o){this._array=o,this.size=o.length}function ObjectSeq(o){var s=Object.keys(o);this._object=o,this._keys=s,this.size=s.length}function IterableSeq(o){this._iterable=o,this.size=o.length||o.size}function IteratorSeq(o){this._iterator=o,this._iteratorCache=[]}function isSeq(o){return!(!o||!o[le])}function emptySequence(){return ie||(ie=new ArraySeq([]))}function keyedSeqFromValue(o){var s=Array.isArray(o)?new ArraySeq(o).fromEntrySeq():isIterator(o)?new IteratorSeq(o).fromEntrySeq():hasIterator(o)?new IterableSeq(o).fromEntrySeq():\"object\"==typeof o?new ObjectSeq(o):void 0;if(!s)throw new TypeError(\"Expected Array or iterable object of [k, v] entries, or keyed object: \"+o);return s}function indexedSeqFromValue(o){var s=maybeIndexedSeqFromValue(o);if(!s)throw new TypeError(\"Expected Array or iterable object of values: \"+o);return s}function seqFromValue(o){var s=maybeIndexedSeqFromValue(o)||\"object\"==typeof o&&new ObjectSeq(o);if(!s)throw new TypeError(\"Expected Array or iterable object of values, or keyed object: \"+o);return s}function maybeIndexedSeqFromValue(o){return isArrayLike(o)?new ArraySeq(o):isIterator(o)?new IteratorSeq(o):hasIterator(o)?new IterableSeq(o):void 0}function seqIterate(o,s,i,u){var _=o._cache;if(_){for(var w=_.length-1,x=0;x<=w;x++){var C=_[i?w-x:x];if(!1===s(C[1],u?C[0]:x,o))return x+1}return x}return o.__iterateUncached(s,i)}function seqIterator(o,s,i,u){var _=o._cache;if(_){var w=_.length-1,x=0;return new Iterator((function(){var o=_[i?w-x:x];return x++>w?iteratorDone():iteratorValue(s,u?o[0]:x-1,o[1])}))}return o.__iteratorUncached(s,i)}function fromJS(o,s){return s?fromJSWith(s,o,\"\",{\"\":o}):fromJSDefault(o)}function fromJSWith(o,s,i,u){return Array.isArray(s)?o.call(u,i,IndexedSeq(s).map((function(i,u){return fromJSWith(o,i,u,s)}))):isPlainObj(s)?o.call(u,i,KeyedSeq(s).map((function(i,u){return fromJSWith(o,i,u,s)}))):s}function fromJSDefault(o){return Array.isArray(o)?IndexedSeq(o).map(fromJSDefault).toList():isPlainObj(o)?KeyedSeq(o).map(fromJSDefault).toMap():o}function isPlainObj(o){return o&&(o.constructor===Object||void 0===o.constructor)}function is(o,s){if(o===s||o!=o&&s!=s)return!0;if(!o||!s)return!1;if(\"function\"==typeof o.valueOf&&\"function\"==typeof s.valueOf){if((o=o.valueOf())===(s=s.valueOf())||o!=o&&s!=s)return!0;if(!o||!s)return!1}return!(\"function\"!=typeof o.equals||\"function\"!=typeof s.equals||!o.equals(s))}function deepEqual(o,s){if(o===s)return!0;if(!isIterable(s)||void 0!==o.size&&void 0!==s.size&&o.size!==s.size||void 0!==o.__hash&&void 0!==s.__hash&&o.__hash!==s.__hash||isKeyed(o)!==isKeyed(s)||isIndexed(o)!==isIndexed(s)||isOrdered(o)!==isOrdered(s))return!1;if(0===o.size&&0===s.size)return!0;var i=!isAssociative(o);if(isOrdered(o)){var u=o.entries();return s.every((function(o,s){var _=u.next().value;return _&&is(_[1],o)&&(i||is(_[0],s))}))&&u.next().done}var _=!1;if(void 0===o.size)if(void 0===s.size)\"function\"==typeof o.cacheResult&&o.cacheResult();else{_=!0;var w=o;o=s,s=w}var x=!0,C=s.__iterate((function(s,u){if(i?!o.has(s):_?!is(s,o.get(u,L)):!is(o.get(u,L),s))return x=!1,!1}));return x&&o.size===C}function Repeat(o,s){if(!(this instanceof Repeat))return new Repeat(o,s);if(this._value=o,this.size=void 0===s?1/0:Math.max(0,s),0===this.size){if(ae)return ae;ae=this}}function invariant(o,s){if(!o)throw new Error(s)}function Range(o,s,i){if(!(this instanceof Range))return new Range(o,s,i);if(invariant(0!==i,\"Cannot step a Range by 0\"),o=o||0,void 0===s&&(s=1/0),i=void 0===i?1:Math.abs(i),s<o&&(i=-i),this._start=o,this._end=s,this._step=i,this.size=Math.max(0,Math.ceil((s-o)/i-1)+1),0===this.size){if(ce)return ce;ce=this}}function Collection(){throw TypeError(\"Abstract\")}function KeyedCollection(){}function IndexedCollection(){}function SetCollection(){}Seq.prototype[le]=!0,createClass(ArraySeq,IndexedSeq),ArraySeq.prototype.get=function(o,s){return this.has(o)?this._array[wrapIndex(this,o)]:s},ArraySeq.prototype.__iterate=function(o,s){for(var i=this._array,u=i.length-1,_=0;_<=u;_++)if(!1===o(i[s?u-_:_],_,this))return _+1;return _},ArraySeq.prototype.__iterator=function(o,s){var i=this._array,u=i.length-1,_=0;return new Iterator((function(){return _>u?iteratorDone():iteratorValue(o,_,i[s?u-_++:_++])}))},createClass(ObjectSeq,KeyedSeq),ObjectSeq.prototype.get=function(o,s){return void 0===s||this.has(o)?this._object[o]:s},ObjectSeq.prototype.has=function(o){return this._object.hasOwnProperty(o)},ObjectSeq.prototype.__iterate=function(o,s){for(var i=this._object,u=this._keys,_=u.length-1,w=0;w<=_;w++){var x=u[s?_-w:w];if(!1===o(i[x],x,this))return w+1}return w},ObjectSeq.prototype.__iterator=function(o,s){var i=this._object,u=this._keys,_=u.length-1,w=0;return new Iterator((function(){var x=u[s?_-w:w];return w++>_?iteratorDone():iteratorValue(o,x,i[x])}))},ObjectSeq.prototype[_]=!0,createClass(IterableSeq,IndexedSeq),IterableSeq.prototype.__iterateUncached=function(o,s){if(s)return this.cacheResult().__iterate(o,s);var i=getIterator(this._iterable),u=0;if(isIterator(i))for(var _;!(_=i.next()).done&&!1!==o(_.value,u++,this););return u},IterableSeq.prototype.__iteratorUncached=function(o,s){if(s)return this.cacheResult().__iterator(o,s);var i=getIterator(this._iterable);if(!isIterator(i))return new Iterator(iteratorDone);var u=0;return new Iterator((function(){var s=i.next();return s.done?s:iteratorValue(o,u++,s.value)}))},createClass(IteratorSeq,IndexedSeq),IteratorSeq.prototype.__iterateUncached=function(o,s){if(s)return this.cacheResult().__iterate(o,s);for(var i,u=this._iterator,_=this._iteratorCache,w=0;w<_.length;)if(!1===o(_[w],w++,this))return w;for(;!(i=u.next()).done;){var x=i.value;if(_[w]=x,!1===o(x,w++,this))break}return w},IteratorSeq.prototype.__iteratorUncached=function(o,s){if(s)return this.cacheResult().__iterator(o,s);var i=this._iterator,u=this._iteratorCache,_=0;return new Iterator((function(){if(_>=u.length){var s=i.next();if(s.done)return s;u[_]=s.value}return iteratorValue(o,_,u[_++])}))},createClass(Repeat,IndexedSeq),Repeat.prototype.toString=function(){return 0===this.size?\"Repeat []\":\"Repeat [ \"+this._value+\" \"+this.size+\" times ]\"},Repeat.prototype.get=function(o,s){return this.has(o)?this._value:s},Repeat.prototype.includes=function(o){return is(this._value,o)},Repeat.prototype.slice=function(o,s){var i=this.size;return wholeSlice(o,s,i)?this:new Repeat(this._value,resolveEnd(s,i)-resolveBegin(o,i))},Repeat.prototype.reverse=function(){return this},Repeat.prototype.indexOf=function(o){return is(this._value,o)?0:-1},Repeat.prototype.lastIndexOf=function(o){return is(this._value,o)?this.size:-1},Repeat.prototype.__iterate=function(o,s){for(var i=0;i<this.size;i++)if(!1===o(this._value,i,this))return i+1;return i},Repeat.prototype.__iterator=function(o,s){var i=this,u=0;return new Iterator((function(){return u<i.size?iteratorValue(o,u++,i._value):iteratorDone()}))},Repeat.prototype.equals=function(o){return o instanceof Repeat?is(this._value,o._value):deepEqual(o)},createClass(Range,IndexedSeq),Range.prototype.toString=function(){return 0===this.size?\"Range []\":\"Range [ \"+this._start+\"...\"+this._end+(1!==this._step?\" by \"+this._step:\"\")+\" ]\"},Range.prototype.get=function(o,s){return this.has(o)?this._start+wrapIndex(this,o)*this._step:s},Range.prototype.includes=function(o){var s=(o-this._start)/this._step;return s>=0&&s<this.size&&s===Math.floor(s)},Range.prototype.slice=function(o,s){return wholeSlice(o,s,this.size)?this:(o=resolveBegin(o,this.size),(s=resolveEnd(s,this.size))<=o?new Range(0,0):new Range(this.get(o,this._end),this.get(s,this._end),this._step))},Range.prototype.indexOf=function(o){var s=o-this._start;if(s%this._step==0){var i=s/this._step;if(i>=0&&i<this.size)return i}return-1},Range.prototype.lastIndexOf=function(o){return this.indexOf(o)},Range.prototype.__iterate=function(o,s){for(var i=this.size-1,u=this._step,_=s?this._start+i*u:this._start,w=0;w<=i;w++){if(!1===o(_,w,this))return w+1;_+=s?-u:u}return w},Range.prototype.__iterator=function(o,s){var i=this.size-1,u=this._step,_=s?this._start+i*u:this._start,w=0;return new Iterator((function(){var x=_;return _+=s?-u:u,w>i?iteratorDone():iteratorValue(o,w++,x)}))},Range.prototype.equals=function(o){return o instanceof Range?this._start===o._start&&this._end===o._end&&this._step===o._step:deepEqual(this,o)},createClass(Collection,Iterable),createClass(KeyedCollection,Collection),createClass(IndexedCollection,Collection),createClass(SetCollection,Collection),Collection.Keyed=KeyedCollection,Collection.Indexed=IndexedCollection,Collection.Set=SetCollection;var pe=\"function\"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function imul(o,s){var i=65535&(o|=0),u=65535&(s|=0);return i*u+((o>>>16)*u+i*(s>>>16)<<16>>>0)|0};function smi(o){return o>>>1&1073741824|3221225471&o}function hash(o){if(!1===o||null==o)return 0;if(\"function\"==typeof o.valueOf&&(!1===(o=o.valueOf())||null==o))return 0;if(!0===o)return 1;var s=typeof o;if(\"number\"===s){if(o!=o||o===1/0)return 0;var i=0|o;for(i!==o&&(i^=4294967295*o);o>4294967295;)i^=o/=4294967295;return smi(i)}if(\"string\"===s)return o.length>Se?cachedHashString(o):hashString(o);if(\"function\"==typeof o.hashCode)return o.hashCode();if(\"object\"===s)return hashJSObj(o);if(\"function\"==typeof o.toString)return hashString(o.toString());throw new Error(\"Value type \"+s+\" cannot be hashed.\")}function cachedHashString(o){var s=Te[o];return void 0===s&&(s=hashString(o),Pe===xe&&(Pe=0,Te={}),Pe++,Te[o]=s),s}function hashString(o){for(var s=0,i=0;i<o.length;i++)s=31*s+o.charCodeAt(i)|0;return smi(s)}function hashJSObj(o){var s;if(be&&void 0!==(s=ye.get(o)))return s;if(void 0!==(s=o[we]))return s;if(!fe){if(void 0!==(s=o.propertyIsEnumerable&&o.propertyIsEnumerable[we]))return s;if(void 0!==(s=getIENodeHash(o)))return s}if(s=++_e,1073741824&_e&&(_e=0),be)ye.set(o,s);else{if(void 0!==de&&!1===de(o))throw new Error(\"Non-extensible objects are not allowed as keys.\");if(fe)Object.defineProperty(o,we,{enumerable:!1,configurable:!1,writable:!1,value:s});else if(void 0!==o.propertyIsEnumerable&&o.propertyIsEnumerable===o.constructor.prototype.propertyIsEnumerable)o.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},o.propertyIsEnumerable[we]=s;else{if(void 0===o.nodeType)throw new Error(\"Unable to set a non-enumerable property on object.\");o[we]=s}}return s}var de=Object.isExtensible,fe=function(){try{return Object.defineProperty({},\"@\",{}),!0}catch(o){return!1}}();function getIENodeHash(o){if(o&&o.nodeType>0)switch(o.nodeType){case 1:return o.uniqueID;case 9:return o.documentElement&&o.documentElement.uniqueID}}var ye,be=\"function\"==typeof WeakMap;be&&(ye=new WeakMap);var _e=0,we=\"__immutablehash__\";\"function\"==typeof Symbol&&(we=Symbol(we));var Se=16,xe=255,Pe=0,Te={};function assertNotInfinite(o){invariant(o!==1/0,\"Cannot perform this action with an infinite size.\")}function Map(o){return null==o?emptyMap():isMap(o)&&!isOrdered(o)?o:emptyMap().withMutations((function(s){var i=KeyedIterable(o);assertNotInfinite(i.size),i.forEach((function(o,i){return s.set(i,o)}))}))}function isMap(o){return!(!o||!o[qe])}createClass(Map,KeyedCollection),Map.of=function(){var s=o.call(arguments,0);return emptyMap().withMutations((function(o){for(var i=0;i<s.length;i+=2){if(i+1>=s.length)throw new Error(\"Missing value for key: \"+s[i]);o.set(s[i],s[i+1])}}))},Map.prototype.toString=function(){return this.__toString(\"Map {\",\"}\")},Map.prototype.get=function(o,s){return this._root?this._root.get(0,void 0,o,s):s},Map.prototype.set=function(o,s){return updateMap(this,o,s)},Map.prototype.setIn=function(o,s){return this.updateIn(o,L,(function(){return s}))},Map.prototype.remove=function(o){return updateMap(this,o,L)},Map.prototype.deleteIn=function(o){return this.updateIn(o,(function(){return L}))},Map.prototype.update=function(o,s,i){return 1===arguments.length?o(this):this.updateIn([o],s,i)},Map.prototype.updateIn=function(o,s,i){i||(i=s,s=void 0);var u=updateInDeepMap(this,forceIterator(o),s,i);return u===L?void 0:u},Map.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},Map.prototype.merge=function(){return mergeIntoMapWith(this,void 0,arguments)},Map.prototype.mergeWith=function(s){return mergeIntoMapWith(this,s,o.call(arguments,1))},Map.prototype.mergeIn=function(s){var i=o.call(arguments,1);return this.updateIn(s,emptyMap(),(function(o){return\"function\"==typeof o.merge?o.merge.apply(o,i):i[i.length-1]}))},Map.prototype.mergeDeep=function(){return mergeIntoMapWith(this,deepMerger,arguments)},Map.prototype.mergeDeepWith=function(s){var i=o.call(arguments,1);return mergeIntoMapWith(this,deepMergerWith(s),i)},Map.prototype.mergeDeepIn=function(s){var i=o.call(arguments,1);return this.updateIn(s,emptyMap(),(function(o){return\"function\"==typeof o.mergeDeep?o.mergeDeep.apply(o,i):i[i.length-1]}))},Map.prototype.sort=function(o){return OrderedMap(sortFactory(this,o))},Map.prototype.sortBy=function(o,s){return OrderedMap(sortFactory(this,s,o))},Map.prototype.withMutations=function(o){var s=this.asMutable();return o(s),s.wasAltered()?s.__ensureOwner(this.__ownerID):this},Map.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)},Map.prototype.asImmutable=function(){return this.__ensureOwner()},Map.prototype.wasAltered=function(){return this.__altered},Map.prototype.__iterator=function(o,s){return new MapIterator(this,o,s)},Map.prototype.__iterate=function(o,s){var i=this,u=0;return this._root&&this._root.iterate((function(s){return u++,o(s[1],s[0],i)}),s),u},Map.prototype.__ensureOwner=function(o){return o===this.__ownerID?this:o?makeMap(this.size,this._root,o,this.__hash):(this.__ownerID=o,this.__altered=!1,this)},Map.isMap=isMap;var Re,qe=\"@@__IMMUTABLE_MAP__@@\",$e=Map.prototype;function ArrayMapNode(o,s){this.ownerID=o,this.entries=s}function BitmapIndexedNode(o,s,i){this.ownerID=o,this.bitmap=s,this.nodes=i}function HashArrayMapNode(o,s,i){this.ownerID=o,this.count=s,this.nodes=i}function HashCollisionNode(o,s,i){this.ownerID=o,this.keyHash=s,this.entries=i}function ValueNode(o,s,i){this.ownerID=o,this.keyHash=s,this.entry=i}function MapIterator(o,s,i){this._type=s,this._reverse=i,this._stack=o._root&&mapIteratorFrame(o._root)}function mapIteratorValue(o,s){return iteratorValue(o,s[0],s[1])}function mapIteratorFrame(o,s){return{node:o,index:0,__prev:s}}function makeMap(o,s,i,u){var _=Object.create($e);return _.size=o,_._root=s,_.__ownerID=i,_.__hash=u,_.__altered=!1,_}function emptyMap(){return Re||(Re=makeMap(0))}function updateMap(o,s,i){var u,_;if(o._root){var w=MakeRef(B),x=MakeRef($);if(u=updateNode(o._root,o.__ownerID,0,void 0,s,i,w,x),!x.value)return o;_=o.size+(w.value?i===L?-1:1:0)}else{if(i===L)return o;_=1,u=new ArrayMapNode(o.__ownerID,[[s,i]])}return o.__ownerID?(o.size=_,o._root=u,o.__hash=void 0,o.__altered=!0,o):u?makeMap(_,u):emptyMap()}function updateNode(o,s,i,u,_,w,x,C){return o?o.update(s,i,u,_,w,x,C):w===L?o:(SetRef(C),SetRef(x),new ValueNode(s,u,[_,w]))}function isLeafNode(o){return o.constructor===ValueNode||o.constructor===HashCollisionNode}function mergeIntoNode(o,s,i,u,_){if(o.keyHash===u)return new HashCollisionNode(s,u,[o.entry,_]);var w,C=(0===i?o.keyHash:o.keyHash>>>i)&j,L=(0===i?u:u>>>i)&j;return new BitmapIndexedNode(s,1<<C|1<<L,C===L?[mergeIntoNode(o,s,i+x,u,_)]:(w=new ValueNode(s,u,_),C<L?[o,w]:[w,o]))}function createNodes(o,s,i,u){o||(o=new OwnerID);for(var _=new ValueNode(o,hash(i),[i,u]),w=0;w<s.length;w++){var x=s[w];_=_.update(o,0,void 0,x[0],x[1])}return _}function packNodes(o,s,i,u){for(var _=0,w=0,x=new Array(i),C=0,j=1,L=s.length;C<L;C++,j<<=1){var B=s[C];void 0!==B&&C!==u&&(_|=j,x[w++]=B)}return new BitmapIndexedNode(o,_,x)}function expandNodes(o,s,i,u,_){for(var w=0,x=new Array(C),j=0;0!==i;j++,i>>>=1)x[j]=1&i?s[w++]:void 0;return x[u]=_,new HashArrayMapNode(o,w+1,x)}function mergeIntoMapWith(o,s,i){for(var u=[],_=0;_<i.length;_++){var w=i[_],x=KeyedIterable(w);isIterable(w)||(x=x.map((function(o){return fromJS(o)}))),u.push(x)}return mergeIntoCollectionWith(o,s,u)}function deepMerger(o,s,i){return o&&o.mergeDeep&&isIterable(s)?o.mergeDeep(s):is(o,s)?o:s}function deepMergerWith(o){return function(s,i,u){if(s&&s.mergeDeepWith&&isIterable(i))return s.mergeDeepWith(o,i);var _=o(s,i,u);return is(s,_)?s:_}}function mergeIntoCollectionWith(o,s,i){return 0===(i=i.filter((function(o){return 0!==o.size}))).length?o:0!==o.size||o.__ownerID||1!==i.length?o.withMutations((function(o){for(var u=s?function(i,u){o.update(u,L,(function(o){return o===L?i:s(o,i,u)}))}:function(s,i){o.set(i,s)},_=0;_<i.length;_++)i[_].forEach(u)})):o.constructor(i[0])}function updateInDeepMap(o,s,i,u){var _=o===L,w=s.next();if(w.done){var x=_?i:o,C=u(x);return C===x?o:C}invariant(_||o&&o.set,\"invalid keyPath\");var j=w.value,B=_?L:o.get(j,L),$=updateInDeepMap(B,s,i,u);return $===B?o:$===L?o.remove(j):(_?emptyMap():o).set(j,$)}function popCount(o){return o=(o=(858993459&(o-=o>>1&1431655765))+(o>>2&858993459))+(o>>4)&252645135,o+=o>>8,127&(o+=o>>16)}function setIn(o,s,i,u){var _=u?o:arrCopy(o);return _[s]=i,_}function spliceIn(o,s,i,u){var _=o.length+1;if(u&&s+1===_)return o[s]=i,o;for(var w=new Array(_),x=0,C=0;C<_;C++)C===s?(w[C]=i,x=-1):w[C]=o[C+x];return w}function spliceOut(o,s,i){var u=o.length-1;if(i&&s===u)return o.pop(),o;for(var _=new Array(u),w=0,x=0;x<u;x++)x===s&&(w=1),_[x]=o[x+w];return _}$e[qe]=!0,$e[w]=$e.remove,$e.removeIn=$e.deleteIn,ArrayMapNode.prototype.get=function(o,s,i,u){for(var _=this.entries,w=0,x=_.length;w<x;w++)if(is(i,_[w][0]))return _[w][1];return u},ArrayMapNode.prototype.update=function(o,s,i,u,_,w,x){for(var C=_===L,j=this.entries,B=0,$=j.length;B<$&&!is(u,j[B][0]);B++);var V=B<$;if(V?j[B][1]===_:C)return this;if(SetRef(x),(C||!V)&&SetRef(w),!C||1!==j.length){if(!V&&!C&&j.length>=ze)return createNodes(o,j,u,_);var U=o&&o===this.ownerID,z=U?j:arrCopy(j);return V?C?B===$-1?z.pop():z[B]=z.pop():z[B]=[u,_]:z.push([u,_]),U?(this.entries=z,this):new ArrayMapNode(o,z)}},BitmapIndexedNode.prototype.get=function(o,s,i,u){void 0===s&&(s=hash(i));var _=1<<((0===o?s:s>>>o)&j),w=this.bitmap;return w&_?this.nodes[popCount(w&_-1)].get(o+x,s,i,u):u},BitmapIndexedNode.prototype.update=function(o,s,i,u,_,w,C){void 0===i&&(i=hash(u));var B=(0===s?i:i>>>s)&j,$=1<<B,V=this.bitmap,U=!!(V&$);if(!U&&_===L)return this;var z=popCount(V&$-1),Y=this.nodes,Z=U?Y[z]:void 0,ee=updateNode(Z,o,s+x,i,u,_,w,C);if(ee===Z)return this;if(!U&&ee&&Y.length>=We)return expandNodes(o,Y,V,B,ee);if(U&&!ee&&2===Y.length&&isLeafNode(Y[1^z]))return Y[1^z];if(U&&ee&&1===Y.length&&isLeafNode(ee))return ee;var ie=o&&o===this.ownerID,ae=U?ee?V:V^$:V|$,ce=U?ee?setIn(Y,z,ee,ie):spliceOut(Y,z,ie):spliceIn(Y,z,ee,ie);return ie?(this.bitmap=ae,this.nodes=ce,this):new BitmapIndexedNode(o,ae,ce)},HashArrayMapNode.prototype.get=function(o,s,i,u){void 0===s&&(s=hash(i));var _=(0===o?s:s>>>o)&j,w=this.nodes[_];return w?w.get(o+x,s,i,u):u},HashArrayMapNode.prototype.update=function(o,s,i,u,_,w,C){void 0===i&&(i=hash(u));var B=(0===s?i:i>>>s)&j,$=_===L,V=this.nodes,U=V[B];if($&&!U)return this;var z=updateNode(U,o,s+x,i,u,_,w,C);if(z===U)return this;var Y=this.count;if(U){if(!z&&--Y<He)return packNodes(o,V,Y,B)}else Y++;var Z=o&&o===this.ownerID,ee=setIn(V,B,z,Z);return Z?(this.count=Y,this.nodes=ee,this):new HashArrayMapNode(o,Y,ee)},HashCollisionNode.prototype.get=function(o,s,i,u){for(var _=this.entries,w=0,x=_.length;w<x;w++)if(is(i,_[w][0]))return _[w][1];return u},HashCollisionNode.prototype.update=function(o,s,i,u,_,w,x){void 0===i&&(i=hash(u));var C=_===L;if(i!==this.keyHash)return C?this:(SetRef(x),SetRef(w),mergeIntoNode(this,o,s,i,[u,_]));for(var j=this.entries,B=0,$=j.length;B<$&&!is(u,j[B][0]);B++);var V=B<$;if(V?j[B][1]===_:C)return this;if(SetRef(x),(C||!V)&&SetRef(w),C&&2===$)return new ValueNode(o,this.keyHash,j[1^B]);var U=o&&o===this.ownerID,z=U?j:arrCopy(j);return V?C?B===$-1?z.pop():z[B]=z.pop():z[B]=[u,_]:z.push([u,_]),U?(this.entries=z,this):new HashCollisionNode(o,this.keyHash,z)},ValueNode.prototype.get=function(o,s,i,u){return is(i,this.entry[0])?this.entry[1]:u},ValueNode.prototype.update=function(o,s,i,u,_,w,x){var C=_===L,j=is(u,this.entry[0]);return(j?_===this.entry[1]:C)?this:(SetRef(x),C?void SetRef(w):j?o&&o===this.ownerID?(this.entry[1]=_,this):new ValueNode(o,this.keyHash,[u,_]):(SetRef(w),mergeIntoNode(this,o,s,hash(u),[u,_])))},ArrayMapNode.prototype.iterate=HashCollisionNode.prototype.iterate=function(o,s){for(var i=this.entries,u=0,_=i.length-1;u<=_;u++)if(!1===o(i[s?_-u:u]))return!1},BitmapIndexedNode.prototype.iterate=HashArrayMapNode.prototype.iterate=function(o,s){for(var i=this.nodes,u=0,_=i.length-1;u<=_;u++){var w=i[s?_-u:u];if(w&&!1===w.iterate(o,s))return!1}},ValueNode.prototype.iterate=function(o,s){return o(this.entry)},createClass(MapIterator,Iterator),MapIterator.prototype.next=function(){for(var o=this._type,s=this._stack;s;){var i,u=s.node,_=s.index++;if(u.entry){if(0===_)return mapIteratorValue(o,u.entry)}else if(u.entries){if(_<=(i=u.entries.length-1))return mapIteratorValue(o,u.entries[this._reverse?i-_:_])}else if(_<=(i=u.nodes.length-1)){var w=u.nodes[this._reverse?i-_:_];if(w){if(w.entry)return mapIteratorValue(o,w.entry);s=this._stack=mapIteratorFrame(w,s)}continue}s=this._stack=this._stack.__prev}return iteratorDone()};var ze=C/4,We=C/2,He=C/4;function List(o){var s=emptyList();if(null==o)return s;if(isList(o))return o;var i=IndexedIterable(o),u=i.size;return 0===u?s:(assertNotInfinite(u),u>0&&u<C?makeList(0,u,x,null,new VNode(i.toArray())):s.withMutations((function(o){o.setSize(u),i.forEach((function(s,i){return o.set(i,s)}))})))}function isList(o){return!(!o||!o[Ye])}createClass(List,IndexedCollection),List.of=function(){return this(arguments)},List.prototype.toString=function(){return this.__toString(\"List [\",\"]\")},List.prototype.get=function(o,s){if((o=wrapIndex(this,o))>=0&&o<this.size){var i=listNodeFor(this,o+=this._origin);return i&&i.array[o&j]}return s},List.prototype.set=function(o,s){return updateList(this,o,s)},List.prototype.remove=function(o){return this.has(o)?0===o?this.shift():o===this.size-1?this.pop():this.splice(o,1):this},List.prototype.insert=function(o,s){return this.splice(o,0,s)},List.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=x,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):emptyList()},List.prototype.push=function(){var o=arguments,s=this.size;return this.withMutations((function(i){setListBounds(i,0,s+o.length);for(var u=0;u<o.length;u++)i.set(s+u,o[u])}))},List.prototype.pop=function(){return setListBounds(this,0,-1)},List.prototype.unshift=function(){var o=arguments;return this.withMutations((function(s){setListBounds(s,-o.length);for(var i=0;i<o.length;i++)s.set(i,o[i])}))},List.prototype.shift=function(){return setListBounds(this,1)},List.prototype.merge=function(){return mergeIntoListWith(this,void 0,arguments)},List.prototype.mergeWith=function(s){return mergeIntoListWith(this,s,o.call(arguments,1))},List.prototype.mergeDeep=function(){return mergeIntoListWith(this,deepMerger,arguments)},List.prototype.mergeDeepWith=function(s){var i=o.call(arguments,1);return mergeIntoListWith(this,deepMergerWith(s),i)},List.prototype.setSize=function(o){return setListBounds(this,0,o)},List.prototype.slice=function(o,s){var i=this.size;return wholeSlice(o,s,i)?this:setListBounds(this,resolveBegin(o,i),resolveEnd(s,i))},List.prototype.__iterator=function(o,s){var i=0,u=iterateList(this,s);return new Iterator((function(){var s=u();return s===tt?iteratorDone():iteratorValue(o,i++,s)}))},List.prototype.__iterate=function(o,s){for(var i,u=0,_=iterateList(this,s);(i=_())!==tt&&!1!==o(i,u++,this););return u},List.prototype.__ensureOwner=function(o){return o===this.__ownerID?this:o?makeList(this._origin,this._capacity,this._level,this._root,this._tail,o,this.__hash):(this.__ownerID=o,this)},List.isList=isList;var Ye=\"@@__IMMUTABLE_LIST__@@\",Xe=List.prototype;function VNode(o,s){this.array=o,this.ownerID=s}Xe[Ye]=!0,Xe[w]=Xe.remove,Xe.setIn=$e.setIn,Xe.deleteIn=Xe.removeIn=$e.removeIn,Xe.update=$e.update,Xe.updateIn=$e.updateIn,Xe.mergeIn=$e.mergeIn,Xe.mergeDeepIn=$e.mergeDeepIn,Xe.withMutations=$e.withMutations,Xe.asMutable=$e.asMutable,Xe.asImmutable=$e.asImmutable,Xe.wasAltered=$e.wasAltered,VNode.prototype.removeBefore=function(o,s,i){if(i===s?1<<s:0===this.array.length)return this;var u=i>>>s&j;if(u>=this.array.length)return new VNode([],o);var _,w=0===u;if(s>0){var C=this.array[u];if((_=C&&C.removeBefore(o,s-x,i))===C&&w)return this}if(w&&!_)return this;var L=editableVNode(this,o);if(!w)for(var B=0;B<u;B++)L.array[B]=void 0;return _&&(L.array[u]=_),L},VNode.prototype.removeAfter=function(o,s,i){if(i===(s?1<<s:0)||0===this.array.length)return this;var u,_=i-1>>>s&j;if(_>=this.array.length)return this;if(s>0){var w=this.array[_];if((u=w&&w.removeAfter(o,s-x,i))===w&&_===this.array.length-1)return this}var C=editableVNode(this,o);return C.array.splice(_+1),u&&(C.array[_]=u),C};var Qe,et,tt={};function iterateList(o,s){var i=o._origin,u=o._capacity,_=getTailOffset(u),w=o._tail;return iterateNodeOrLeaf(o._root,o._level,0);function iterateNodeOrLeaf(o,s,i){return 0===s?iterateLeaf(o,i):iterateNode(o,s,i)}function iterateLeaf(o,x){var j=x===_?w&&w.array:o&&o.array,L=x>i?0:i-x,B=u-x;return B>C&&(B=C),function(){if(L===B)return tt;var o=s?--B:L++;return j&&j[o]}}function iterateNode(o,_,w){var j,L=o&&o.array,B=w>i?0:i-w>>_,$=1+(u-w>>_);return $>C&&($=C),function(){for(;;){if(j){var o=j();if(o!==tt)return o;j=null}if(B===$)return tt;var i=s?--$:B++;j=iterateNodeOrLeaf(L&&L[i],_-x,w+(i<<_))}}}}function makeList(o,s,i,u,_,w,x){var C=Object.create(Xe);return C.size=s-o,C._origin=o,C._capacity=s,C._level=i,C._root=u,C._tail=_,C.__ownerID=w,C.__hash=x,C.__altered=!1,C}function emptyList(){return Qe||(Qe=makeList(0,0,x))}function updateList(o,s,i){if((s=wrapIndex(o,s))!=s)return o;if(s>=o.size||s<0)return o.withMutations((function(o){s<0?setListBounds(o,s).set(0,i):setListBounds(o,0,s+1).set(s,i)}));s+=o._origin;var u=o._tail,_=o._root,w=MakeRef($);return s>=getTailOffset(o._capacity)?u=updateVNode(u,o.__ownerID,0,s,i,w):_=updateVNode(_,o.__ownerID,o._level,s,i,w),w.value?o.__ownerID?(o._root=_,o._tail=u,o.__hash=void 0,o.__altered=!0,o):makeList(o._origin,o._capacity,o._level,_,u):o}function updateVNode(o,s,i,u,_,w){var C,L=u>>>i&j,B=o&&L<o.array.length;if(!B&&void 0===_)return o;if(i>0){var $=o&&o.array[L],V=updateVNode($,s,i-x,u,_,w);return V===$?o:((C=editableVNode(o,s)).array[L]=V,C)}return B&&o.array[L]===_?o:(SetRef(w),C=editableVNode(o,s),void 0===_&&L===C.array.length-1?C.array.pop():C.array[L]=_,C)}function editableVNode(o,s){return s&&o&&s===o.ownerID?o:new VNode(o?o.array.slice():[],s)}function listNodeFor(o,s){if(s>=getTailOffset(o._capacity))return o._tail;if(s<1<<o._level+x){for(var i=o._root,u=o._level;i&&u>0;)i=i.array[s>>>u&j],u-=x;return i}}function setListBounds(o,s,i){void 0!==s&&(s|=0),void 0!==i&&(i|=0);var u=o.__ownerID||new OwnerID,_=o._origin,w=o._capacity,C=_+s,L=void 0===i?w:i<0?w+i:_+i;if(C===_&&L===w)return o;if(C>=L)return o.clear();for(var B=o._level,$=o._root,V=0;C+V<0;)$=new VNode($&&$.array.length?[void 0,$]:[],u),V+=1<<(B+=x);V&&(C+=V,_+=V,L+=V,w+=V);for(var U=getTailOffset(w),z=getTailOffset(L);z>=1<<B+x;)$=new VNode($&&$.array.length?[$]:[],u),B+=x;var Y=o._tail,Z=z<U?listNodeFor(o,L-1):z>U?new VNode([],u):Y;if(Y&&z>U&&C<w&&Y.array.length){for(var ee=$=editableVNode($,u),ie=B;ie>x;ie-=x){var ae=U>>>ie&j;ee=ee.array[ae]=editableVNode(ee.array[ae],u)}ee.array[U>>>x&j]=Y}if(L<w&&(Z=Z&&Z.removeAfter(u,0,L)),C>=z)C-=z,L-=z,B=x,$=null,Z=Z&&Z.removeBefore(u,0,C);else if(C>_||z<U){for(V=0;$;){var ce=C>>>B&j;if(ce!==z>>>B&j)break;ce&&(V+=(1<<B)*ce),B-=x,$=$.array[ce]}$&&C>_&&($=$.removeBefore(u,B,C-V)),$&&z<U&&($=$.removeAfter(u,B,z-V)),V&&(C-=V,L-=V)}return o.__ownerID?(o.size=L-C,o._origin=C,o._capacity=L,o._level=B,o._root=$,o._tail=Z,o.__hash=void 0,o.__altered=!0,o):makeList(C,L,B,$,Z)}function mergeIntoListWith(o,s,i){for(var u=[],_=0,w=0;w<i.length;w++){var x=i[w],C=IndexedIterable(x);C.size>_&&(_=C.size),isIterable(x)||(C=C.map((function(o){return fromJS(o)}))),u.push(C)}return _>o.size&&(o=o.setSize(_)),mergeIntoCollectionWith(o,s,u)}function getTailOffset(o){return o<C?0:o-1>>>x<<x}function OrderedMap(o){return null==o?emptyOrderedMap():isOrderedMap(o)?o:emptyOrderedMap().withMutations((function(s){var i=KeyedIterable(o);assertNotInfinite(i.size),i.forEach((function(o,i){return s.set(i,o)}))}))}function isOrderedMap(o){return isMap(o)&&isOrdered(o)}function makeOrderedMap(o,s,i,u){var _=Object.create(OrderedMap.prototype);return _.size=o?o.size:0,_._map=o,_._list=s,_.__ownerID=i,_.__hash=u,_}function emptyOrderedMap(){return et||(et=makeOrderedMap(emptyMap(),emptyList()))}function updateOrderedMap(o,s,i){var u,_,w=o._map,x=o._list,j=w.get(s),B=void 0!==j;if(i===L){if(!B)return o;x.size>=C&&x.size>=2*w.size?(u=(_=x.filter((function(o,s){return void 0!==o&&j!==s}))).toKeyedSeq().map((function(o){return o[0]})).flip().toMap(),o.__ownerID&&(u.__ownerID=_.__ownerID=o.__ownerID)):(u=w.remove(s),_=j===x.size-1?x.pop():x.set(j,void 0))}else if(B){if(i===x.get(j)[1])return o;u=w,_=x.set(j,[s,i])}else u=w.set(s,x.size),_=x.set(x.size,[s,i]);return o.__ownerID?(o.size=u.size,o._map=u,o._list=_,o.__hash=void 0,o):makeOrderedMap(u,_)}function ToKeyedSequence(o,s){this._iter=o,this._useKeys=s,this.size=o.size}function ToIndexedSequence(o){this._iter=o,this.size=o.size}function ToSetSequence(o){this._iter=o,this.size=o.size}function FromEntriesSequence(o){this._iter=o,this.size=o.size}function flipFactory(o){var s=makeSequence(o);return s._iter=o,s.size=o.size,s.flip=function(){return o},s.reverse=function(){var s=o.reverse.apply(this);return s.flip=function(){return o.reverse()},s},s.has=function(s){return o.includes(s)},s.includes=function(s){return o.has(s)},s.cacheResult=cacheResultThrough,s.__iterateUncached=function(s,i){var u=this;return o.__iterate((function(o,i){return!1!==s(i,o,u)}),i)},s.__iteratorUncached=function(s,i){if(s===z){var u=o.__iterator(s,i);return new Iterator((function(){var o=u.next();if(!o.done){var s=o.value[0];o.value[0]=o.value[1],o.value[1]=s}return o}))}return o.__iterator(s===U?V:U,i)},s}function mapFactory(o,s,i){var u=makeSequence(o);return u.size=o.size,u.has=function(s){return o.has(s)},u.get=function(u,_){var w=o.get(u,L);return w===L?_:s.call(i,w,u,o)},u.__iterateUncached=function(u,_){var w=this;return o.__iterate((function(o,_,x){return!1!==u(s.call(i,o,_,x),_,w)}),_)},u.__iteratorUncached=function(u,_){var w=o.__iterator(z,_);return new Iterator((function(){var _=w.next();if(_.done)return _;var x=_.value,C=x[0];return iteratorValue(u,C,s.call(i,x[1],C,o),_)}))},u}function reverseFactory(o,s){var i=makeSequence(o);return i._iter=o,i.size=o.size,i.reverse=function(){return o},o.flip&&(i.flip=function(){var s=flipFactory(o);return s.reverse=function(){return o.flip()},s}),i.get=function(i,u){return o.get(s?i:-1-i,u)},i.has=function(i){return o.has(s?i:-1-i)},i.includes=function(s){return o.includes(s)},i.cacheResult=cacheResultThrough,i.__iterate=function(s,i){var u=this;return o.__iterate((function(o,i){return s(o,i,u)}),!i)},i.__iterator=function(s,i){return o.__iterator(s,!i)},i}function filterFactory(o,s,i,u){var _=makeSequence(o);return u&&(_.has=function(u){var _=o.get(u,L);return _!==L&&!!s.call(i,_,u,o)},_.get=function(u,_){var w=o.get(u,L);return w!==L&&s.call(i,w,u,o)?w:_}),_.__iterateUncached=function(_,w){var x=this,C=0;return o.__iterate((function(o,w,j){if(s.call(i,o,w,j))return C++,_(o,u?w:C-1,x)}),w),C},_.__iteratorUncached=function(_,w){var x=o.__iterator(z,w),C=0;return new Iterator((function(){for(;;){var w=x.next();if(w.done)return w;var j=w.value,L=j[0],B=j[1];if(s.call(i,B,L,o))return iteratorValue(_,u?L:C++,B,w)}}))},_}function countByFactory(o,s,i){var u=Map().asMutable();return o.__iterate((function(_,w){u.update(s.call(i,_,w,o),0,(function(o){return o+1}))})),u.asImmutable()}function groupByFactory(o,s,i){var u=isKeyed(o),_=(isOrdered(o)?OrderedMap():Map()).asMutable();o.__iterate((function(w,x){_.update(s.call(i,w,x,o),(function(o){return(o=o||[]).push(u?[x,w]:w),o}))}));var w=iterableClass(o);return _.map((function(s){return reify(o,w(s))}))}function sliceFactory(o,s,i,u){var _=o.size;if(void 0!==s&&(s|=0),void 0!==i&&(i===1/0?i=_:i|=0),wholeSlice(s,i,_))return o;var w=resolveBegin(s,_),x=resolveEnd(i,_);if(w!=w||x!=x)return sliceFactory(o.toSeq().cacheResult(),s,i,u);var C,j=x-w;j==j&&(C=j<0?0:j);var L=makeSequence(o);return L.size=0===C?C:o.size&&C||void 0,!u&&isSeq(o)&&C>=0&&(L.get=function(s,i){return(s=wrapIndex(this,s))>=0&&s<C?o.get(s+w,i):i}),L.__iterateUncached=function(s,i){var _=this;if(0===C)return 0;if(i)return this.cacheResult().__iterate(s,i);var x=0,j=!0,L=0;return o.__iterate((function(o,i){if(!j||!(j=x++<w))return L++,!1!==s(o,u?i:L-1,_)&&L!==C})),L},L.__iteratorUncached=function(s,i){if(0!==C&&i)return this.cacheResult().__iterator(s,i);var _=0!==C&&o.__iterator(s,i),x=0,j=0;return new Iterator((function(){for(;x++<w;)_.next();if(++j>C)return iteratorDone();var o=_.next();return u||s===U?o:iteratorValue(s,j-1,s===V?void 0:o.value[1],o)}))},L}function takeWhileFactory(o,s,i){var u=makeSequence(o);return u.__iterateUncached=function(u,_){var w=this;if(_)return this.cacheResult().__iterate(u,_);var x=0;return o.__iterate((function(o,_,C){return s.call(i,o,_,C)&&++x&&u(o,_,w)})),x},u.__iteratorUncached=function(u,_){var w=this;if(_)return this.cacheResult().__iterator(u,_);var x=o.__iterator(z,_),C=!0;return new Iterator((function(){if(!C)return iteratorDone();var o=x.next();if(o.done)return o;var _=o.value,j=_[0],L=_[1];return s.call(i,L,j,w)?u===z?o:iteratorValue(u,j,L,o):(C=!1,iteratorDone())}))},u}function skipWhileFactory(o,s,i,u){var _=makeSequence(o);return _.__iterateUncached=function(_,w){var x=this;if(w)return this.cacheResult().__iterate(_,w);var C=!0,j=0;return o.__iterate((function(o,w,L){if(!C||!(C=s.call(i,o,w,L)))return j++,_(o,u?w:j-1,x)})),j},_.__iteratorUncached=function(_,w){var x=this;if(w)return this.cacheResult().__iterator(_,w);var C=o.__iterator(z,w),j=!0,L=0;return new Iterator((function(){var o,w,B;do{if((o=C.next()).done)return u||_===U?o:iteratorValue(_,L++,_===V?void 0:o.value[1],o);var $=o.value;w=$[0],B=$[1],j&&(j=s.call(i,B,w,x))}while(j);return _===z?o:iteratorValue(_,w,B,o)}))},_}function concatFactory(o,s){var i=isKeyed(o),u=[o].concat(s).map((function(o){return isIterable(o)?i&&(o=KeyedIterable(o)):o=i?keyedSeqFromValue(o):indexedSeqFromValue(Array.isArray(o)?o:[o]),o})).filter((function(o){return 0!==o.size}));if(0===u.length)return o;if(1===u.length){var _=u[0];if(_===o||i&&isKeyed(_)||isIndexed(o)&&isIndexed(_))return _}var w=new ArraySeq(u);return i?w=w.toKeyedSeq():isIndexed(o)||(w=w.toSetSeq()),(w=w.flatten(!0)).size=u.reduce((function(o,s){if(void 0!==o){var i=s.size;if(void 0!==i)return o+i}}),0),w}function flattenFactory(o,s,i){var u=makeSequence(o);return u.__iterateUncached=function(u,_){var w=0,x=!1;function flatDeep(o,C){var j=this;o.__iterate((function(o,_){return(!s||C<s)&&isIterable(o)?flatDeep(o,C+1):!1===u(o,i?_:w++,j)&&(x=!0),!x}),_)}return flatDeep(o,0),w},u.__iteratorUncached=function(u,_){var w=o.__iterator(u,_),x=[],C=0;return new Iterator((function(){for(;w;){var o=w.next();if(!1===o.done){var j=o.value;if(u===z&&(j=j[1]),s&&!(x.length<s)||!isIterable(j))return i?o:iteratorValue(u,C++,j,o);x.push(w),w=j.__iterator(u,_)}else w=x.pop()}return iteratorDone()}))},u}function flatMapFactory(o,s,i){var u=iterableClass(o);return o.toSeq().map((function(_,w){return u(s.call(i,_,w,o))})).flatten(!0)}function interposeFactory(o,s){var i=makeSequence(o);return i.size=o.size&&2*o.size-1,i.__iterateUncached=function(i,u){var _=this,w=0;return o.__iterate((function(o,u){return(!w||!1!==i(s,w++,_))&&!1!==i(o,w++,_)}),u),w},i.__iteratorUncached=function(i,u){var _,w=o.__iterator(U,u),x=0;return new Iterator((function(){return(!_||x%2)&&(_=w.next()).done?_:x%2?iteratorValue(i,x++,s):iteratorValue(i,x++,_.value,_)}))},i}function sortFactory(o,s,i){s||(s=defaultComparator);var u=isKeyed(o),_=0,w=o.toSeq().map((function(s,u){return[u,s,_++,i?i(s,u,o):s]})).toArray();return w.sort((function(o,i){return s(o[3],i[3])||o[2]-i[2]})).forEach(u?function(o,s){w[s].length=2}:function(o,s){w[s]=o[1]}),u?KeyedSeq(w):isIndexed(o)?IndexedSeq(w):SetSeq(w)}function maxFactory(o,s,i){if(s||(s=defaultComparator),i){var u=o.toSeq().map((function(s,u){return[s,i(s,u,o)]})).reduce((function(o,i){return maxCompare(s,o[1],i[1])?i:o}));return u&&u[0]}return o.reduce((function(o,i){return maxCompare(s,o,i)?i:o}))}function maxCompare(o,s,i){var u=o(i,s);return 0===u&&i!==s&&(null==i||i!=i)||u>0}function zipWithFactory(o,s,i){var u=makeSequence(o);return u.size=new ArraySeq(i).map((function(o){return o.size})).min(),u.__iterate=function(o,s){for(var i,u=this.__iterator(U,s),_=0;!(i=u.next()).done&&!1!==o(i.value,_++,this););return _},u.__iteratorUncached=function(o,u){var _=i.map((function(o){return o=Iterable(o),getIterator(u?o.reverse():o)})),w=0,x=!1;return new Iterator((function(){var i;return x||(i=_.map((function(o){return o.next()})),x=i.some((function(o){return o.done}))),x?iteratorDone():iteratorValue(o,w++,s.apply(null,i.map((function(o){return o.value}))))}))},u}function reify(o,s){return isSeq(o)?s:o.constructor(s)}function validateEntry(o){if(o!==Object(o))throw new TypeError(\"Expected [K, V] tuple: \"+o)}function resolveSize(o){return assertNotInfinite(o.size),ensureSize(o)}function iterableClass(o){return isKeyed(o)?KeyedIterable:isIndexed(o)?IndexedIterable:SetIterable}function makeSequence(o){return Object.create((isKeyed(o)?KeyedSeq:isIndexed(o)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Seq.prototype.cacheResult.call(this)}function defaultComparator(o,s){return o>s?1:o<s?-1:0}function forceIterator(o){var s=getIterator(o);if(!s){if(!isArrayLike(o))throw new TypeError(\"Expected iterable or array-like: \"+o);s=getIterator(Iterable(o))}return s}function Record(o,s){var i,u=function Record(w){if(w instanceof u)return w;if(!(this instanceof u))return new u(w);if(!i){i=!0;var x=Object.keys(o);setProps(_,x),_.size=x.length,_._name=s,_._keys=x,_._defaultValues=o}this._map=Map(w)},_=u.prototype=Object.create(rt);return _.constructor=u,u}createClass(OrderedMap,Map),OrderedMap.of=function(){return this(arguments)},OrderedMap.prototype.toString=function(){return this.__toString(\"OrderedMap {\",\"}\")},OrderedMap.prototype.get=function(o,s){var i=this._map.get(o);return void 0!==i?this._list.get(i)[1]:s},OrderedMap.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):emptyOrderedMap()},OrderedMap.prototype.set=function(o,s){return updateOrderedMap(this,o,s)},OrderedMap.prototype.remove=function(o){return updateOrderedMap(this,o,L)},OrderedMap.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},OrderedMap.prototype.__iterate=function(o,s){var i=this;return this._list.__iterate((function(s){return s&&o(s[1],s[0],i)}),s)},OrderedMap.prototype.__iterator=function(o,s){return this._list.fromEntrySeq().__iterator(o,s)},OrderedMap.prototype.__ensureOwner=function(o){if(o===this.__ownerID)return this;var s=this._map.__ensureOwner(o),i=this._list.__ensureOwner(o);return o?makeOrderedMap(s,i,o,this.__hash):(this.__ownerID=o,this._map=s,this._list=i,this)},OrderedMap.isOrderedMap=isOrderedMap,OrderedMap.prototype[_]=!0,OrderedMap.prototype[w]=OrderedMap.prototype.remove,createClass(ToKeyedSequence,KeyedSeq),ToKeyedSequence.prototype.get=function(o,s){return this._iter.get(o,s)},ToKeyedSequence.prototype.has=function(o){return this._iter.has(o)},ToKeyedSequence.prototype.valueSeq=function(){return this._iter.valueSeq()},ToKeyedSequence.prototype.reverse=function(){var o=this,s=reverseFactory(this,!0);return this._useKeys||(s.valueSeq=function(){return o._iter.toSeq().reverse()}),s},ToKeyedSequence.prototype.map=function(o,s){var i=this,u=mapFactory(this,o,s);return this._useKeys||(u.valueSeq=function(){return i._iter.toSeq().map(o,s)}),u},ToKeyedSequence.prototype.__iterate=function(o,s){var i,u=this;return this._iter.__iterate(this._useKeys?function(s,i){return o(s,i,u)}:(i=s?resolveSize(this):0,function(_){return o(_,s?--i:i++,u)}),s)},ToKeyedSequence.prototype.__iterator=function(o,s){if(this._useKeys)return this._iter.__iterator(o,s);var i=this._iter.__iterator(U,s),u=s?resolveSize(this):0;return new Iterator((function(){var _=i.next();return _.done?_:iteratorValue(o,s?--u:u++,_.value,_)}))},ToKeyedSequence.prototype[_]=!0,createClass(ToIndexedSequence,IndexedSeq),ToIndexedSequence.prototype.includes=function(o){return this._iter.includes(o)},ToIndexedSequence.prototype.__iterate=function(o,s){var i=this,u=0;return this._iter.__iterate((function(s){return o(s,u++,i)}),s)},ToIndexedSequence.prototype.__iterator=function(o,s){var i=this._iter.__iterator(U,s),u=0;return new Iterator((function(){var s=i.next();return s.done?s:iteratorValue(o,u++,s.value,s)}))},createClass(ToSetSequence,SetSeq),ToSetSequence.prototype.has=function(o){return this._iter.includes(o)},ToSetSequence.prototype.__iterate=function(o,s){var i=this;return this._iter.__iterate((function(s){return o(s,s,i)}),s)},ToSetSequence.prototype.__iterator=function(o,s){var i=this._iter.__iterator(U,s);return new Iterator((function(){var s=i.next();return s.done?s:iteratorValue(o,s.value,s.value,s)}))},createClass(FromEntriesSequence,KeyedSeq),FromEntriesSequence.prototype.entrySeq=function(){return this._iter.toSeq()},FromEntriesSequence.prototype.__iterate=function(o,s){var i=this;return this._iter.__iterate((function(s){if(s){validateEntry(s);var u=isIterable(s);return o(u?s.get(1):s[1],u?s.get(0):s[0],i)}}),s)},FromEntriesSequence.prototype.__iterator=function(o,s){var i=this._iter.__iterator(U,s);return new Iterator((function(){for(;;){var s=i.next();if(s.done)return s;var u=s.value;if(u){validateEntry(u);var _=isIterable(u);return iteratorValue(o,_?u.get(0):u[0],_?u.get(1):u[1],s)}}}))},ToIndexedSequence.prototype.cacheResult=ToKeyedSequence.prototype.cacheResult=ToSetSequence.prototype.cacheResult=FromEntriesSequence.prototype.cacheResult=cacheResultThrough,createClass(Record,KeyedCollection),Record.prototype.toString=function(){return this.__toString(recordName(this)+\" {\",\"}\")},Record.prototype.has=function(o){return this._defaultValues.hasOwnProperty(o)},Record.prototype.get=function(o,s){if(!this.has(o))return s;var i=this._defaultValues[o];return this._map?this._map.get(o,i):i},Record.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var o=this.constructor;return o._empty||(o._empty=makeRecord(this,emptyMap()))},Record.prototype.set=function(o,s){if(!this.has(o))throw new Error('Cannot set unknown key \"'+o+'\" on '+recordName(this));if(this._map&&!this._map.has(o)&&s===this._defaultValues[o])return this;var i=this._map&&this._map.set(o,s);return this.__ownerID||i===this._map?this:makeRecord(this,i)},Record.prototype.remove=function(o){if(!this.has(o))return this;var s=this._map&&this._map.remove(o);return this.__ownerID||s===this._map?this:makeRecord(this,s)},Record.prototype.wasAltered=function(){return this._map.wasAltered()},Record.prototype.__iterator=function(o,s){var i=this;return KeyedIterable(this._defaultValues).map((function(o,s){return i.get(s)})).__iterator(o,s)},Record.prototype.__iterate=function(o,s){var i=this;return KeyedIterable(this._defaultValues).map((function(o,s){return i.get(s)})).__iterate(o,s)},Record.prototype.__ensureOwner=function(o){if(o===this.__ownerID)return this;var s=this._map&&this._map.__ensureOwner(o);return o?makeRecord(this,s,o):(this.__ownerID=o,this._map=s,this)};var rt=Record.prototype;function makeRecord(o,s,i){var u=Object.create(Object.getPrototypeOf(o));return u._map=s,u.__ownerID=i,u}function recordName(o){return o._name||o.constructor.name||\"Record\"}function setProps(o,s){try{s.forEach(setProp.bind(void 0,o))}catch(o){}}function setProp(o,s){Object.defineProperty(o,s,{get:function(){return this.get(s)},set:function(o){invariant(this.__ownerID,\"Cannot set on an immutable record.\"),this.set(s,o)}})}function Set(o){return null==o?emptySet():isSet(o)&&!isOrdered(o)?o:emptySet().withMutations((function(s){var i=SetIterable(o);assertNotInfinite(i.size),i.forEach((function(o){return s.add(o)}))}))}function isSet(o){return!(!o||!o[ot])}rt[w]=rt.remove,rt.deleteIn=rt.removeIn=$e.removeIn,rt.merge=$e.merge,rt.mergeWith=$e.mergeWith,rt.mergeIn=$e.mergeIn,rt.mergeDeep=$e.mergeDeep,rt.mergeDeepWith=$e.mergeDeepWith,rt.mergeDeepIn=$e.mergeDeepIn,rt.setIn=$e.setIn,rt.update=$e.update,rt.updateIn=$e.updateIn,rt.withMutations=$e.withMutations,rt.asMutable=$e.asMutable,rt.asImmutable=$e.asImmutable,createClass(Set,SetCollection),Set.of=function(){return this(arguments)},Set.fromKeys=function(o){return this(KeyedIterable(o).keySeq())},Set.prototype.toString=function(){return this.__toString(\"Set {\",\"}\")},Set.prototype.has=function(o){return this._map.has(o)},Set.prototype.add=function(o){return updateSet(this,this._map.set(o,!0))},Set.prototype.remove=function(o){return updateSet(this,this._map.remove(o))},Set.prototype.clear=function(){return updateSet(this,this._map.clear())},Set.prototype.union=function(){var s=o.call(arguments,0);return 0===(s=s.filter((function(o){return 0!==o.size}))).length?this:0!==this.size||this.__ownerID||1!==s.length?this.withMutations((function(o){for(var i=0;i<s.length;i++)SetIterable(s[i]).forEach((function(s){return o.add(s)}))})):this.constructor(s[0])},Set.prototype.intersect=function(){var s=o.call(arguments,0);if(0===s.length)return this;s=s.map((function(o){return SetIterable(o)}));var i=this;return this.withMutations((function(o){i.forEach((function(i){s.every((function(o){return o.includes(i)}))||o.remove(i)}))}))},Set.prototype.subtract=function(){var s=o.call(arguments,0);if(0===s.length)return this;s=s.map((function(o){return SetIterable(o)}));var i=this;return this.withMutations((function(o){i.forEach((function(i){s.some((function(o){return o.includes(i)}))&&o.remove(i)}))}))},Set.prototype.merge=function(){return this.union.apply(this,arguments)},Set.prototype.mergeWith=function(s){var i=o.call(arguments,1);return this.union.apply(this,i)},Set.prototype.sort=function(o){return OrderedSet(sortFactory(this,o))},Set.prototype.sortBy=function(o,s){return OrderedSet(sortFactory(this,s,o))},Set.prototype.wasAltered=function(){return this._map.wasAltered()},Set.prototype.__iterate=function(o,s){var i=this;return this._map.__iterate((function(s,u){return o(u,u,i)}),s)},Set.prototype.__iterator=function(o,s){return this._map.map((function(o,s){return s})).__iterator(o,s)},Set.prototype.__ensureOwner=function(o){if(o===this.__ownerID)return this;var s=this._map.__ensureOwner(o);return o?this.__make(s,o):(this.__ownerID=o,this._map=s,this)},Set.isSet=isSet;var nt,ot=\"@@__IMMUTABLE_SET__@@\",st=Set.prototype;function updateSet(o,s){return o.__ownerID?(o.size=s.size,o._map=s,o):s===o._map?o:0===s.size?o.__empty():o.__make(s)}function makeSet(o,s){var i=Object.create(st);return i.size=o?o.size:0,i._map=o,i.__ownerID=s,i}function emptySet(){return nt||(nt=makeSet(emptyMap()))}function OrderedSet(o){return null==o?emptyOrderedSet():isOrderedSet(o)?o:emptyOrderedSet().withMutations((function(s){var i=SetIterable(o);assertNotInfinite(i.size),i.forEach((function(o){return s.add(o)}))}))}function isOrderedSet(o){return isSet(o)&&isOrdered(o)}st[ot]=!0,st[w]=st.remove,st.mergeDeep=st.merge,st.mergeDeepWith=st.mergeWith,st.withMutations=$e.withMutations,st.asMutable=$e.asMutable,st.asImmutable=$e.asImmutable,st.__empty=emptySet,st.__make=makeSet,createClass(OrderedSet,Set),OrderedSet.of=function(){return this(arguments)},OrderedSet.fromKeys=function(o){return this(KeyedIterable(o).keySeq())},OrderedSet.prototype.toString=function(){return this.__toString(\"OrderedSet {\",\"}\")},OrderedSet.isOrderedSet=isOrderedSet;var it,at=OrderedSet.prototype;function makeOrderedSet(o,s){var i=Object.create(at);return i.size=o?o.size:0,i._map=o,i.__ownerID=s,i}function emptyOrderedSet(){return it||(it=makeOrderedSet(emptyOrderedMap()))}function Stack(o){return null==o?emptyStack():isStack(o)?o:emptyStack().unshiftAll(o)}function isStack(o){return!(!o||!o[lt])}at[_]=!0,at.__empty=emptyOrderedSet,at.__make=makeOrderedSet,createClass(Stack,IndexedCollection),Stack.of=function(){return this(arguments)},Stack.prototype.toString=function(){return this.__toString(\"Stack [\",\"]\")},Stack.prototype.get=function(o,s){var i=this._head;for(o=wrapIndex(this,o);i&&o--;)i=i.next;return i?i.value:s},Stack.prototype.peek=function(){return this._head&&this._head.value},Stack.prototype.push=function(){if(0===arguments.length)return this;for(var o=this.size+arguments.length,s=this._head,i=arguments.length-1;i>=0;i--)s={value:arguments[i],next:s};return this.__ownerID?(this.size=o,this._head=s,this.__hash=void 0,this.__altered=!0,this):makeStack(o,s)},Stack.prototype.pushAll=function(o){if(0===(o=IndexedIterable(o)).size)return this;assertNotInfinite(o.size);var s=this.size,i=this._head;return o.reverse().forEach((function(o){s++,i={value:o,next:i}})),this.__ownerID?(this.size=s,this._head=i,this.__hash=void 0,this.__altered=!0,this):makeStack(s,i)},Stack.prototype.pop=function(){return this.slice(1)},Stack.prototype.unshift=function(){return this.push.apply(this,arguments)},Stack.prototype.unshiftAll=function(o){return this.pushAll(o)},Stack.prototype.shift=function(){return this.pop.apply(this,arguments)},Stack.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},Stack.prototype.slice=function(o,s){if(wholeSlice(o,s,this.size))return this;var i=resolveBegin(o,this.size);if(resolveEnd(s,this.size)!==this.size)return IndexedCollection.prototype.slice.call(this,o,s);for(var u=this.size-i,_=this._head;i--;)_=_.next;return this.__ownerID?(this.size=u,this._head=_,this.__hash=void 0,this.__altered=!0,this):makeStack(u,_)},Stack.prototype.__ensureOwner=function(o){return o===this.__ownerID?this:o?makeStack(this.size,this._head,o,this.__hash):(this.__ownerID=o,this.__altered=!1,this)},Stack.prototype.__iterate=function(o,s){if(s)return this.reverse().__iterate(o);for(var i=0,u=this._head;u&&!1!==o(u.value,i++,this);)u=u.next;return i},Stack.prototype.__iterator=function(o,s){if(s)return this.reverse().__iterator(o);var i=0,u=this._head;return new Iterator((function(){if(u){var s=u.value;return u=u.next,iteratorValue(o,i++,s)}return iteratorDone()}))},Stack.isStack=isStack;var ct,lt=\"@@__IMMUTABLE_STACK__@@\",ut=Stack.prototype;function makeStack(o,s,i,u){var _=Object.create(ut);return _.size=o,_._head=s,_.__ownerID=i,_.__hash=u,_.__altered=!1,_}function emptyStack(){return ct||(ct=makeStack(0))}function mixin(o,s){var keyCopier=function(i){o.prototype[i]=s[i]};return Object.keys(s).forEach(keyCopier),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(s).forEach(keyCopier),o}ut[lt]=!0,ut.withMutations=$e.withMutations,ut.asMutable=$e.asMutable,ut.asImmutable=$e.asImmutable,ut.wasAltered=$e.wasAltered,Iterable.Iterator=Iterator,mixin(Iterable,{toArray:function(){assertNotInfinite(this.size);var o=new Array(this.size||0);return this.valueSeq().__iterate((function(s,i){o[i]=s})),o},toIndexedSeq:function(){return new ToIndexedSequence(this)},toJS:function(){return this.toSeq().map((function(o){return o&&\"function\"==typeof o.toJS?o.toJS():o})).__toJS()},toJSON:function(){return this.toSeq().map((function(o){return o&&\"function\"==typeof o.toJSON?o.toJSON():o})).__toJS()},toKeyedSeq:function(){return new ToKeyedSequence(this,!0)},toMap:function(){return Map(this.toKeyedSeq())},toObject:function(){assertNotInfinite(this.size);var o={};return this.__iterate((function(s,i){o[i]=s})),o},toOrderedMap:function(){return OrderedMap(this.toKeyedSeq())},toOrderedSet:function(){return OrderedSet(isKeyed(this)?this.valueSeq():this)},toSet:function(){return Set(isKeyed(this)?this.valueSeq():this)},toSetSeq:function(){return new ToSetSequence(this)},toSeq:function(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Stack(isKeyed(this)?this.valueSeq():this)},toList:function(){return List(isKeyed(this)?this.valueSeq():this)},toString:function(){return\"[Iterable]\"},__toString:function(o,s){return 0===this.size?o+s:o+\" \"+this.toSeq().map(this.__toStringMapper).join(\", \")+\" \"+s},concat:function(){return reify(this,concatFactory(this,o.call(arguments,0)))},includes:function(o){return this.some((function(s){return is(s,o)}))},entries:function(){return this.__iterator(z)},every:function(o,s){assertNotInfinite(this.size);var i=!0;return this.__iterate((function(u,_,w){if(!o.call(s,u,_,w))return i=!1,!1})),i},filter:function(o,s){return reify(this,filterFactory(this,o,s,!0))},find:function(o,s,i){var u=this.findEntry(o,s);return u?u[1]:i},forEach:function(o,s){return assertNotInfinite(this.size),this.__iterate(s?o.bind(s):o)},join:function(o){assertNotInfinite(this.size),o=void 0!==o?\"\"+o:\",\";var s=\"\",i=!0;return this.__iterate((function(u){i?i=!1:s+=o,s+=null!=u?u.toString():\"\"})),s},keys:function(){return this.__iterator(V)},map:function(o,s){return reify(this,mapFactory(this,o,s))},reduce:function(o,s,i){var u,_;return assertNotInfinite(this.size),arguments.length<2?_=!0:u=s,this.__iterate((function(s,w,x){_?(_=!1,u=s):u=o.call(i,u,s,w,x)})),u},reduceRight:function(o,s,i){var u=this.toKeyedSeq().reverse();return u.reduce.apply(u,arguments)},reverse:function(){return reify(this,reverseFactory(this,!0))},slice:function(o,s){return reify(this,sliceFactory(this,o,s,!0))},some:function(o,s){return!this.every(not(o),s)},sort:function(o){return reify(this,sortFactory(this,o))},values:function(){return this.__iterator(U)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(o,s){return ensureSize(o?this.toSeq().filter(o,s):this)},countBy:function(o,s){return countByFactory(this,o,s)},equals:function(o){return deepEqual(this,o)},entrySeq:function(){var o=this;if(o._cache)return new ArraySeq(o._cache);var s=o.toSeq().map(entryMapper).toIndexedSeq();return s.fromEntrySeq=function(){return o.toSeq()},s},filterNot:function(o,s){return this.filter(not(o),s)},findEntry:function(o,s,i){var u=i;return this.__iterate((function(i,_,w){if(o.call(s,i,_,w))return u=[_,i],!1})),u},findKey:function(o,s){var i=this.findEntry(o,s);return i&&i[0]},findLast:function(o,s,i){return this.toKeyedSeq().reverse().find(o,s,i)},findLastEntry:function(o,s,i){return this.toKeyedSeq().reverse().findEntry(o,s,i)},findLastKey:function(o,s){return this.toKeyedSeq().reverse().findKey(o,s)},first:function(){return this.find(returnTrue)},flatMap:function(o,s){return reify(this,flatMapFactory(this,o,s))},flatten:function(o){return reify(this,flattenFactory(this,o,!0))},fromEntrySeq:function(){return new FromEntriesSequence(this)},get:function(o,s){return this.find((function(s,i){return is(i,o)}),void 0,s)},getIn:function(o,s){for(var i,u=this,_=forceIterator(o);!(i=_.next()).done;){var w=i.value;if((u=u&&u.get?u.get(w,L):L)===L)return s}return u},groupBy:function(o,s){return groupByFactory(this,o,s)},has:function(o){return this.get(o,L)!==L},hasIn:function(o){return this.getIn(o,L)!==L},isSubset:function(o){return o=\"function\"==typeof o.includes?o:Iterable(o),this.every((function(s){return o.includes(s)}))},isSuperset:function(o){return(o=\"function\"==typeof o.isSubset?o:Iterable(o)).isSubset(this)},keyOf:function(o){return this.findKey((function(s){return is(s,o)}))},keySeq:function(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(o){return this.toKeyedSeq().reverse().keyOf(o)},max:function(o){return maxFactory(this,o)},maxBy:function(o,s){return maxFactory(this,s,o)},min:function(o){return maxFactory(this,o?neg(o):defaultNegComparator)},minBy:function(o,s){return maxFactory(this,s?neg(s):defaultNegComparator,o)},rest:function(){return this.slice(1)},skip:function(o){return this.slice(Math.max(0,o))},skipLast:function(o){return reify(this,this.toSeq().reverse().skip(o).reverse())},skipWhile:function(o,s){return reify(this,skipWhileFactory(this,o,s,!0))},skipUntil:function(o,s){return this.skipWhile(not(o),s)},sortBy:function(o,s){return reify(this,sortFactory(this,s,o))},take:function(o){return this.slice(0,Math.max(0,o))},takeLast:function(o){return reify(this,this.toSeq().reverse().take(o).reverse())},takeWhile:function(o,s){return reify(this,takeWhileFactory(this,o,s))},takeUntil:function(o,s){return this.takeWhile(not(o),s)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=hashIterable(this))}});var pt=Iterable.prototype;pt[s]=!0,pt[ee]=pt.values,pt.__toJS=pt.toArray,pt.__toStringMapper=quoteString,pt.inspect=pt.toSource=function(){return this.toString()},pt.chain=pt.flatMap,pt.contains=pt.includes,mixin(KeyedIterable,{flip:function(){return reify(this,flipFactory(this))},mapEntries:function(o,s){var i=this,u=0;return reify(this,this.toSeq().map((function(_,w){return o.call(s,[w,_],u++,i)})).fromEntrySeq())},mapKeys:function(o,s){var i=this;return reify(this,this.toSeq().flip().map((function(u,_){return o.call(s,u,_,i)})).flip())}});var ht=KeyedIterable.prototype;function keyMapper(o,s){return s}function entryMapper(o,s){return[s,o]}function not(o){return function(){return!o.apply(this,arguments)}}function neg(o){return function(){return-o.apply(this,arguments)}}function quoteString(o){return\"string\"==typeof o?JSON.stringify(o):String(o)}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(o,s){return o<s?1:o>s?-1:0}function hashIterable(o){if(o.size===1/0)return 0;var s=isOrdered(o),i=isKeyed(o),u=s?1:0;return murmurHashOfSize(o.__iterate(i?s?function(o,s){u=31*u+hashMerge(hash(o),hash(s))|0}:function(o,s){u=u+hashMerge(hash(o),hash(s))|0}:s?function(o){u=31*u+hash(o)|0}:function(o){u=u+hash(o)|0}),u)}function murmurHashOfSize(o,s){return s=pe(s,3432918353),s=pe(s<<15|s>>>-15,461845907),s=pe(s<<13|s>>>-13,5),s=pe((s=s+3864292196^o)^s>>>16,2246822507),s=smi((s=pe(s^s>>>13,3266489909))^s>>>16)}function hashMerge(o,s){return o^s+2654435769+(o<<6)+(o>>2)}return ht[i]=!0,ht[ee]=pt.entries,ht.__toJS=pt.toObject,ht.__toStringMapper=function(o,s){return JSON.stringify(s)+\": \"+quoteString(o)},mixin(IndexedIterable,{toKeyedSeq:function(){return new ToKeyedSequence(this,!1)},filter:function(o,s){return reify(this,filterFactory(this,o,s,!1))},findIndex:function(o,s){var i=this.findEntry(o,s);return i?i[0]:-1},indexOf:function(o){var s=this.keyOf(o);return void 0===s?-1:s},lastIndexOf:function(o){var s=this.lastKeyOf(o);return void 0===s?-1:s},reverse:function(){return reify(this,reverseFactory(this,!1))},slice:function(o,s){return reify(this,sliceFactory(this,o,s,!1))},splice:function(o,s){var i=arguments.length;if(s=Math.max(0|s,0),0===i||2===i&&!s)return this;o=resolveBegin(o,o<0?this.count():this.size);var u=this.slice(0,o);return reify(this,1===i?u:u.concat(arrCopy(arguments,2),this.slice(o+s)))},findLastIndex:function(o,s){var i=this.findLastEntry(o,s);return i?i[0]:-1},first:function(){return this.get(0)},flatten:function(o){return reify(this,flattenFactory(this,o,!1))},get:function(o,s){return(o=wrapIndex(this,o))<0||this.size===1/0||void 0!==this.size&&o>this.size?s:this.find((function(s,i){return i===o}),void 0,s)},has:function(o){return(o=wrapIndex(this,o))>=0&&(void 0!==this.size?this.size===1/0||o<this.size:-1!==this.indexOf(o))},interpose:function(o){return reify(this,interposeFactory(this,o))},interleave:function(){var o=[this].concat(arrCopy(arguments)),s=zipWithFactory(this.toSeq(),IndexedSeq.of,o),i=s.flatten(!0);return s.size&&(i.size=s.size*o.length),reify(this,i)},keySeq:function(){return Range(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(o,s){return reify(this,skipWhileFactory(this,o,s,!1))},zip:function(){return reify(this,zipWithFactory(this,defaultZipper,[this].concat(arrCopy(arguments))))},zipWith:function(o){var s=arrCopy(arguments);return s[0]=this,reify(this,zipWithFactory(this,o,s))}}),IndexedIterable.prototype[u]=!0,IndexedIterable.prototype[_]=!0,mixin(SetIterable,{get:function(o,s){return this.has(o)?o:s},includes:function(o){return this.has(o)},keySeq:function(){return this.valueSeq()}}),SetIterable.prototype.has=pt.includes,SetIterable.prototype.contains=SetIterable.prototype.includes,mixin(KeyedSeq,KeyedIterable.prototype),mixin(IndexedSeq,IndexedIterable.prototype),mixin(SetSeq,SetIterable.prototype),mixin(KeyedCollection,KeyedIterable.prototype),mixin(IndexedCollection,IndexedIterable.prototype),mixin(SetCollection,SetIterable.prototype),{Iterable,Seq,Collection,Map,OrderedMap,List,Stack,Set,OrderedSet,Record,Range,Repeat,is,fromJS}}()},56698:o=>{\"function\"==typeof Object.create?o.exports=function inherits(o,s){s&&(o.super_=s,o.prototype=Object.create(s.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}))}:o.exports=function inherits(o,s){if(s){o.super_=s;var TempCtor=function(){};TempCtor.prototype=s.prototype,o.prototype=new TempCtor,o.prototype.constructor=o}}},5419:o=>{o.exports=function(o,s,i,u){var _=new Blob(void 0!==u?[u,o]:[o],{type:i||\"application/octet-stream\"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(_,s);else{var w=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(_):window.webkitURL.createObjectURL(_),x=document.createElement(\"a\");x.style.display=\"none\",x.href=w,x.setAttribute(\"download\",s),void 0===x.download&&x.setAttribute(\"target\",\"_blank\"),document.body.appendChild(x),x.click(),setTimeout((function(){document.body.removeChild(x),window.URL.revokeObjectURL(w)}),200)}}},20181:(o,s,i)=>{var u=NaN,_=\"[object Symbol]\",w=/^\\s+|\\s+$/g,x=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,j=/^0o[0-7]+$/i,L=parseInt,B=\"object\"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,$=\"object\"==typeof self&&self&&self.Object===Object&&self,V=B||$||Function(\"return this\")(),U=Object.prototype.toString,z=Math.max,Y=Math.min,now=function(){return V.Date.now()};function isObject(o){var s=typeof o;return!!o&&(\"object\"==s||\"function\"==s)}function toNumber(o){if(\"number\"==typeof o)return o;if(function isSymbol(o){return\"symbol\"==typeof o||function isObjectLike(o){return!!o&&\"object\"==typeof o}(o)&&U.call(o)==_}(o))return u;if(isObject(o)){var s=\"function\"==typeof o.valueOf?o.valueOf():o;o=isObject(s)?s+\"\":s}if(\"string\"!=typeof o)return 0===o?o:+o;o=o.replace(w,\"\");var i=C.test(o);return i||j.test(o)?L(o.slice(2),i?2:8):x.test(o)?u:+o}o.exports=function debounce(o,s,i){var u,_,w,x,C,j,L=0,B=!1,$=!1,V=!0;if(\"function\"!=typeof o)throw new TypeError(\"Expected a function\");function invokeFunc(s){var i=u,w=_;return u=_=void 0,L=s,x=o.apply(w,i)}function shouldInvoke(o){var i=o-j;return void 0===j||i>=s||i<0||$&&o-L>=w}function timerExpired(){var o=now();if(shouldInvoke(o))return trailingEdge(o);C=setTimeout(timerExpired,function remainingWait(o){var i=s-(o-j);return $?Y(i,w-(o-L)):i}(o))}function trailingEdge(o){return C=void 0,V&&u?invokeFunc(o):(u=_=void 0,x)}function debounced(){var o=now(),i=shouldInvoke(o);if(u=arguments,_=this,j=o,i){if(void 0===C)return function leadingEdge(o){return L=o,C=setTimeout(timerExpired,s),B?invokeFunc(o):x}(j);if($)return C=setTimeout(timerExpired,s),invokeFunc(j)}return void 0===C&&(C=setTimeout(timerExpired,s)),x}return s=toNumber(s)||0,isObject(i)&&(B=!!i.leading,w=($=\"maxWait\"in i)?z(toNumber(i.maxWait)||0,s):w,V=\"trailing\"in i?!!i.trailing:V),debounced.cancel=function cancel(){void 0!==C&&clearTimeout(C),L=0,u=j=_=C=void 0},debounced.flush=function flush(){return void 0===C?x:trailingEdge(now())},debounced}},55580:(o,s,i)=>{var u=i(56110)(i(9325),\"DataView\");o.exports=u},21549:(o,s,i)=>{var u=i(22032),_=i(63862),w=i(66721),x=i(12749),C=i(35749);function Hash(o){var s=-1,i=null==o?0:o.length;for(this.clear();++s<i;){var u=o[s];this.set(u[0],u[1])}}Hash.prototype.clear=u,Hash.prototype.delete=_,Hash.prototype.get=w,Hash.prototype.has=x,Hash.prototype.set=C,o.exports=Hash},30980:(o,s,i)=>{var u=i(39344),_=i(94033);function LazyWrapper(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}LazyWrapper.prototype=u(_.prototype),LazyWrapper.prototype.constructor=LazyWrapper,o.exports=LazyWrapper},80079:(o,s,i)=>{var u=i(63702),_=i(70080),w=i(24739),x=i(48655),C=i(31175);function ListCache(o){var s=-1,i=null==o?0:o.length;for(this.clear();++s<i;){var u=o[s];this.set(u[0],u[1])}}ListCache.prototype.clear=u,ListCache.prototype.delete=_,ListCache.prototype.get=w,ListCache.prototype.has=x,ListCache.prototype.set=C,o.exports=ListCache},56017:(o,s,i)=>{var u=i(39344),_=i(94033);function LodashWrapper(o,s){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=void 0}LodashWrapper.prototype=u(_.prototype),LodashWrapper.prototype.constructor=LodashWrapper,o.exports=LodashWrapper},68223:(o,s,i)=>{var u=i(56110)(i(9325),\"Map\");o.exports=u},53661:(o,s,i)=>{var u=i(63040),_=i(17670),w=i(90289),x=i(4509),C=i(72949);function MapCache(o){var s=-1,i=null==o?0:o.length;for(this.clear();++s<i;){var u=o[s];this.set(u[0],u[1])}}MapCache.prototype.clear=u,MapCache.prototype.delete=_,MapCache.prototype.get=w,MapCache.prototype.has=x,MapCache.prototype.set=C,o.exports=MapCache},32804:(o,s,i)=>{var u=i(56110)(i(9325),\"Promise\");o.exports=u},76545:(o,s,i)=>{var u=i(56110)(i(9325),\"Set\");o.exports=u},38859:(o,s,i)=>{var u=i(53661),_=i(31380),w=i(51459);function SetCache(o){var s=-1,i=null==o?0:o.length;for(this.__data__=new u;++s<i;)this.add(o[s])}SetCache.prototype.add=SetCache.prototype.push=_,SetCache.prototype.has=w,o.exports=SetCache},37217:(o,s,i)=>{var u=i(80079),_=i(51420),w=i(90938),x=i(63605),C=i(29817),j=i(80945);function Stack(o){var s=this.__data__=new u(o);this.size=s.size}Stack.prototype.clear=_,Stack.prototype.delete=w,Stack.prototype.get=x,Stack.prototype.has=C,Stack.prototype.set=j,o.exports=Stack},51873:(o,s,i)=>{var u=i(9325).Symbol;o.exports=u},37828:(o,s,i)=>{var u=i(9325).Uint8Array;o.exports=u},28303:(o,s,i)=>{var u=i(56110)(i(9325),\"WeakMap\");o.exports=u},91033:o=>{o.exports=function apply(o,s,i){switch(i.length){case 0:return o.call(s);case 1:return o.call(s,i[0]);case 2:return o.call(s,i[0],i[1]);case 3:return o.call(s,i[0],i[1],i[2])}return o.apply(s,i)}},83729:o=>{o.exports=function arrayEach(o,s){for(var i=-1,u=null==o?0:o.length;++i<u&&!1!==s(o[i],i,o););return o}},79770:o=>{o.exports=function arrayFilter(o,s){for(var i=-1,u=null==o?0:o.length,_=0,w=[];++i<u;){var x=o[i];s(x,i,o)&&(w[_++]=x)}return w}},15325:(o,s,i)=>{var u=i(96131);o.exports=function arrayIncludes(o,s){return!!(null==o?0:o.length)&&u(o,s,0)>-1}},70695:(o,s,i)=>{var u=i(78096),_=i(72428),w=i(56449),x=i(3656),C=i(30361),j=i(37167),L=Object.prototype.hasOwnProperty;o.exports=function arrayLikeKeys(o,s){var i=w(o),B=!i&&_(o),$=!i&&!B&&x(o),V=!i&&!B&&!$&&j(o),U=i||B||$||V,z=U?u(o.length,String):[],Y=z.length;for(var Z in o)!s&&!L.call(o,Z)||U&&(\"length\"==Z||$&&(\"offset\"==Z||\"parent\"==Z)||V&&(\"buffer\"==Z||\"byteLength\"==Z||\"byteOffset\"==Z)||C(Z,Y))||z.push(Z);return z}},34932:o=>{o.exports=function arrayMap(o,s){for(var i=-1,u=null==o?0:o.length,_=Array(u);++i<u;)_[i]=s(o[i],i,o);return _}},14528:o=>{o.exports=function arrayPush(o,s){for(var i=-1,u=s.length,_=o.length;++i<u;)o[_+i]=s[i];return o}},40882:o=>{o.exports=function arrayReduce(o,s,i,u){var _=-1,w=null==o?0:o.length;for(u&&w&&(i=o[++_]);++_<w;)i=s(i,o[_],_,o);return i}},14248:o=>{o.exports=function arraySome(o,s){for(var i=-1,u=null==o?0:o.length;++i<u;)if(s(o[i],i,o))return!0;return!1}},61074:o=>{o.exports=function asciiToArray(o){return o.split(\"\")}},1733:o=>{var s=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;o.exports=function asciiWords(o){return o.match(s)||[]}},87805:(o,s,i)=>{var u=i(43360),_=i(75288);o.exports=function assignMergeValue(o,s,i){(void 0!==i&&!_(o[s],i)||void 0===i&&!(s in o))&&u(o,s,i)}},16547:(o,s,i)=>{var u=i(43360),_=i(75288),w=Object.prototype.hasOwnProperty;o.exports=function assignValue(o,s,i){var x=o[s];w.call(o,s)&&_(x,i)&&(void 0!==i||s in o)||u(o,s,i)}},26025:(o,s,i)=>{var u=i(75288);o.exports=function assocIndexOf(o,s){for(var i=o.length;i--;)if(u(o[i][0],s))return i;return-1}},74733:(o,s,i)=>{var u=i(21791),_=i(95950);o.exports=function baseAssign(o,s){return o&&u(s,_(s),o)}},43838:(o,s,i)=>{var u=i(21791),_=i(37241);o.exports=function baseAssignIn(o,s){return o&&u(s,_(s),o)}},43360:(o,s,i)=>{var u=i(93243);o.exports=function baseAssignValue(o,s,i){\"__proto__\"==s&&u?u(o,s,{configurable:!0,enumerable:!0,value:i,writable:!0}):o[s]=i}},9999:(o,s,i)=>{var u=i(37217),_=i(83729),w=i(16547),x=i(74733),C=i(43838),j=i(93290),L=i(23007),B=i(92271),$=i(48948),V=i(50002),U=i(83349),z=i(5861),Y=i(76189),Z=i(77199),ee=i(35529),ie=i(56449),ae=i(3656),ce=i(87730),le=i(23805),pe=i(38440),de=i(95950),fe=i(37241),ye=\"[object Arguments]\",be=\"[object Function]\",_e=\"[object Object]\",we={};we[ye]=we[\"[object Array]\"]=we[\"[object ArrayBuffer]\"]=we[\"[object DataView]\"]=we[\"[object Boolean]\"]=we[\"[object Date]\"]=we[\"[object Float32Array]\"]=we[\"[object Float64Array]\"]=we[\"[object Int8Array]\"]=we[\"[object Int16Array]\"]=we[\"[object Int32Array]\"]=we[\"[object Map]\"]=we[\"[object Number]\"]=we[_e]=we[\"[object RegExp]\"]=we[\"[object Set]\"]=we[\"[object String]\"]=we[\"[object Symbol]\"]=we[\"[object Uint8Array]\"]=we[\"[object Uint8ClampedArray]\"]=we[\"[object Uint16Array]\"]=we[\"[object Uint32Array]\"]=!0,we[\"[object Error]\"]=we[be]=we[\"[object WeakMap]\"]=!1,o.exports=function baseClone(o,s,i,Se,xe,Pe){var Te,Re=1&s,qe=2&s,$e=4&s;if(i&&(Te=xe?i(o,Se,xe,Pe):i(o)),void 0!==Te)return Te;if(!le(o))return o;var ze=ie(o);if(ze){if(Te=Y(o),!Re)return L(o,Te)}else{var We=z(o),He=We==be||\"[object GeneratorFunction]\"==We;if(ae(o))return j(o,Re);if(We==_e||We==ye||He&&!xe){if(Te=qe||He?{}:ee(o),!Re)return qe?$(o,C(Te,o)):B(o,x(Te,o))}else{if(!we[We])return xe?o:{};Te=Z(o,We,Re)}}Pe||(Pe=new u);var Ye=Pe.get(o);if(Ye)return Ye;Pe.set(o,Te),pe(o)?o.forEach((function(u){Te.add(baseClone(u,s,i,u,o,Pe))})):ce(o)&&o.forEach((function(u,_){Te.set(_,baseClone(u,s,i,_,o,Pe))}));var Xe=ze?void 0:($e?qe?U:V:qe?fe:de)(o);return _(Xe||o,(function(u,_){Xe&&(u=o[_=u]),w(Te,_,baseClone(u,s,i,_,o,Pe))})),Te}},39344:(o,s,i)=>{var u=i(23805),_=Object.create,w=function(){function object(){}return function(o){if(!u(o))return{};if(_)return _(o);object.prototype=o;var s=new object;return object.prototype=void 0,s}}();o.exports=w},80909:(o,s,i)=>{var u=i(30641),_=i(38329)(u);o.exports=_},2523:o=>{o.exports=function baseFindIndex(o,s,i,u){for(var _=o.length,w=i+(u?1:-1);u?w--:++w<_;)if(s(o[w],w,o))return w;return-1}},83120:(o,s,i)=>{var u=i(14528),_=i(45891);o.exports=function baseFlatten(o,s,i,w,x){var C=-1,j=o.length;for(i||(i=_),x||(x=[]);++C<j;){var L=o[C];s>0&&i(L)?s>1?baseFlatten(L,s-1,i,w,x):u(x,L):w||(x[x.length]=L)}return x}},86649:(o,s,i)=>{var u=i(83221)();o.exports=u},30641:(o,s,i)=>{var u=i(86649),_=i(95950);o.exports=function baseForOwn(o,s){return o&&u(o,s,_)}},47422:(o,s,i)=>{var u=i(31769),_=i(77797);o.exports=function baseGet(o,s){for(var i=0,w=(s=u(s,o)).length;null!=o&&i<w;)o=o[_(s[i++])];return i&&i==w?o:void 0}},82199:(o,s,i)=>{var u=i(14528),_=i(56449);o.exports=function baseGetAllKeys(o,s,i){var w=s(o);return _(o)?w:u(w,i(o))}},72552:(o,s,i)=>{var u=i(51873),_=i(659),w=i(59350),x=u?u.toStringTag:void 0;o.exports=function baseGetTag(o){return null==o?void 0===o?\"[object Undefined]\":\"[object Null]\":x&&x in Object(o)?_(o):w(o)}},20426:o=>{var s=Object.prototype.hasOwnProperty;o.exports=function baseHas(o,i){return null!=o&&s.call(o,i)}},28077:o=>{o.exports=function baseHasIn(o,s){return null!=o&&s in Object(o)}},96131:(o,s,i)=>{var u=i(2523),_=i(85463),w=i(76959);o.exports=function baseIndexOf(o,s,i){return s==s?w(o,s,i):u(o,_,i)}},27534:(o,s,i)=>{var u=i(72552),_=i(40346);o.exports=function baseIsArguments(o){return _(o)&&\"[object Arguments]\"==u(o)}},60270:(o,s,i)=>{var u=i(87068),_=i(40346);o.exports=function baseIsEqual(o,s,i,w,x){return o===s||(null==o||null==s||!_(o)&&!_(s)?o!=o&&s!=s:u(o,s,i,w,baseIsEqual,x))}},87068:(o,s,i)=>{var u=i(37217),_=i(25911),w=i(21986),x=i(50689),C=i(5861),j=i(56449),L=i(3656),B=i(37167),$=\"[object Arguments]\",V=\"[object Array]\",U=\"[object Object]\",z=Object.prototype.hasOwnProperty;o.exports=function baseIsEqualDeep(o,s,i,Y,Z,ee){var ie=j(o),ae=j(s),ce=ie?V:C(o),le=ae?V:C(s),pe=(ce=ce==$?U:ce)==U,de=(le=le==$?U:le)==U,fe=ce==le;if(fe&&L(o)){if(!L(s))return!1;ie=!0,pe=!1}if(fe&&!pe)return ee||(ee=new u),ie||B(o)?_(o,s,i,Y,Z,ee):w(o,s,ce,i,Y,Z,ee);if(!(1&i)){var ye=pe&&z.call(o,\"__wrapped__\"),be=de&&z.call(s,\"__wrapped__\");if(ye||be){var _e=ye?o.value():o,we=be?s.value():s;return ee||(ee=new u),Z(_e,we,i,Y,ee)}}return!!fe&&(ee||(ee=new u),x(o,s,i,Y,Z,ee))}},29172:(o,s,i)=>{var u=i(5861),_=i(40346);o.exports=function baseIsMap(o){return _(o)&&\"[object Map]\"==u(o)}},41799:(o,s,i)=>{var u=i(37217),_=i(60270);o.exports=function baseIsMatch(o,s,i,w){var x=i.length,C=x,j=!w;if(null==o)return!C;for(o=Object(o);x--;){var L=i[x];if(j&&L[2]?L[1]!==o[L[0]]:!(L[0]in o))return!1}for(;++x<C;){var B=(L=i[x])[0],$=o[B],V=L[1];if(j&&L[2]){if(void 0===$&&!(B in o))return!1}else{var U=new u;if(w)var z=w($,V,B,o,s,U);if(!(void 0===z?_(V,$,3,w,U):z))return!1}}return!0}},85463:o=>{o.exports=function baseIsNaN(o){return o!=o}},45083:(o,s,i)=>{var u=i(1882),_=i(87296),w=i(23805),x=i(47473),C=/^\\[object .+?Constructor\\]$/,j=Function.prototype,L=Object.prototype,B=j.toString,$=L.hasOwnProperty,V=RegExp(\"^\"+B.call($).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");o.exports=function baseIsNative(o){return!(!w(o)||_(o))&&(u(o)?V:C).test(x(o))}},16038:(o,s,i)=>{var u=i(5861),_=i(40346);o.exports=function baseIsSet(o){return _(o)&&\"[object Set]\"==u(o)}},4901:(o,s,i)=>{var u=i(72552),_=i(30294),w=i(40346),x={};x[\"[object Float32Array]\"]=x[\"[object Float64Array]\"]=x[\"[object Int8Array]\"]=x[\"[object Int16Array]\"]=x[\"[object Int32Array]\"]=x[\"[object Uint8Array]\"]=x[\"[object Uint8ClampedArray]\"]=x[\"[object Uint16Array]\"]=x[\"[object Uint32Array]\"]=!0,x[\"[object Arguments]\"]=x[\"[object Array]\"]=x[\"[object ArrayBuffer]\"]=x[\"[object Boolean]\"]=x[\"[object DataView]\"]=x[\"[object Date]\"]=x[\"[object Error]\"]=x[\"[object Function]\"]=x[\"[object Map]\"]=x[\"[object Number]\"]=x[\"[object Object]\"]=x[\"[object RegExp]\"]=x[\"[object Set]\"]=x[\"[object String]\"]=x[\"[object WeakMap]\"]=!1,o.exports=function baseIsTypedArray(o){return w(o)&&_(o.length)&&!!x[u(o)]}},15389:(o,s,i)=>{var u=i(93663),_=i(87978),w=i(83488),x=i(56449),C=i(50583);o.exports=function baseIteratee(o){return\"function\"==typeof o?o:null==o?w:\"object\"==typeof o?x(o)?_(o[0],o[1]):u(o):C(o)}},88984:(o,s,i)=>{var u=i(55527),_=i(3650),w=Object.prototype.hasOwnProperty;o.exports=function baseKeys(o){if(!u(o))return _(o);var s=[];for(var i in Object(o))w.call(o,i)&&\"constructor\"!=i&&s.push(i);return s}},72903:(o,s,i)=>{var u=i(23805),_=i(55527),w=i(90181),x=Object.prototype.hasOwnProperty;o.exports=function baseKeysIn(o){if(!u(o))return w(o);var s=_(o),i=[];for(var C in o)(\"constructor\"!=C||!s&&x.call(o,C))&&i.push(C);return i}},94033:o=>{o.exports=function baseLodash(){}},93663:(o,s,i)=>{var u=i(41799),_=i(10776),w=i(67197);o.exports=function baseMatches(o){var s=_(o);return 1==s.length&&s[0][2]?w(s[0][0],s[0][1]):function(i){return i===o||u(i,o,s)}}},87978:(o,s,i)=>{var u=i(60270),_=i(58156),w=i(80631),x=i(28586),C=i(30756),j=i(67197),L=i(77797);o.exports=function baseMatchesProperty(o,s){return x(o)&&C(s)?j(L(o),s):function(i){var x=_(i,o);return void 0===x&&x===s?w(i,o):u(s,x,3)}}},85250:(o,s,i)=>{var u=i(37217),_=i(87805),w=i(86649),x=i(42824),C=i(23805),j=i(37241),L=i(14974);o.exports=function baseMerge(o,s,i,B,$){o!==s&&w(s,(function(w,j){if($||($=new u),C(w))x(o,s,j,i,baseMerge,B,$);else{var V=B?B(L(o,j),w,j+\"\",o,s,$):void 0;void 0===V&&(V=w),_(o,j,V)}}),j)}},42824:(o,s,i)=>{var u=i(87805),_=i(93290),w=i(71961),x=i(23007),C=i(35529),j=i(72428),L=i(56449),B=i(83693),$=i(3656),V=i(1882),U=i(23805),z=i(11331),Y=i(37167),Z=i(14974),ee=i(69884);o.exports=function baseMergeDeep(o,s,i,ie,ae,ce,le){var pe=Z(o,i),de=Z(s,i),fe=le.get(de);if(fe)u(o,i,fe);else{var ye=ce?ce(pe,de,i+\"\",o,s,le):void 0,be=void 0===ye;if(be){var _e=L(de),we=!_e&&$(de),Se=!_e&&!we&&Y(de);ye=de,_e||we||Se?L(pe)?ye=pe:B(pe)?ye=x(pe):we?(be=!1,ye=_(de,!0)):Se?(be=!1,ye=w(de,!0)):ye=[]:z(de)||j(de)?(ye=pe,j(pe)?ye=ee(pe):U(pe)&&!V(pe)||(ye=C(de))):be=!1}be&&(le.set(de,ye),ae(ye,de,ie,ce,le),le.delete(de)),u(o,i,ye)}}},47237:o=>{o.exports=function baseProperty(o){return function(s){return null==s?void 0:s[o]}}},17255:(o,s,i)=>{var u=i(47422);o.exports=function basePropertyDeep(o){return function(s){return u(s,o)}}},54552:o=>{o.exports=function basePropertyOf(o){return function(s){return null==o?void 0:o[s]}}},85558:o=>{o.exports=function baseReduce(o,s,i,u,_){return _(o,(function(o,_,w){i=u?(u=!1,o):s(i,o,_,w)})),i}},69302:(o,s,i)=>{var u=i(83488),_=i(56757),w=i(32865);o.exports=function baseRest(o,s){return w(_(o,s,u),o+\"\")}},73170:(o,s,i)=>{var u=i(16547),_=i(31769),w=i(30361),x=i(23805),C=i(77797);o.exports=function baseSet(o,s,i,j){if(!x(o))return o;for(var L=-1,B=(s=_(s,o)).length,$=B-1,V=o;null!=V&&++L<B;){var U=C(s[L]),z=i;if(\"__proto__\"===U||\"constructor\"===U||\"prototype\"===U)return o;if(L!=$){var Y=V[U];void 0===(z=j?j(Y,U,V):void 0)&&(z=x(Y)?Y:w(s[L+1])?[]:{})}u(V,U,z),V=V[U]}return o}},68882:(o,s,i)=>{var u=i(83488),_=i(48152),w=_?function(o,s){return _.set(o,s),o}:u;o.exports=w},19570:(o,s,i)=>{var u=i(37334),_=i(93243),w=i(83488),x=_?function(o,s){return _(o,\"toString\",{configurable:!0,enumerable:!1,value:u(s),writable:!0})}:w;o.exports=x},25160:o=>{o.exports=function baseSlice(o,s,i){var u=-1,_=o.length;s<0&&(s=-s>_?0:_+s),(i=i>_?_:i)<0&&(i+=_),_=s>i?0:i-s>>>0,s>>>=0;for(var w=Array(_);++u<_;)w[u]=o[u+s];return w}},90916:(o,s,i)=>{var u=i(80909);o.exports=function baseSome(o,s){var i;return u(o,(function(o,u,_){return!(i=s(o,u,_))})),!!i}},78096:o=>{o.exports=function baseTimes(o,s){for(var i=-1,u=Array(o);++i<o;)u[i]=s(i);return u}},77556:(o,s,i)=>{var u=i(51873),_=i(34932),w=i(56449),x=i(44394),C=u?u.prototype:void 0,j=C?C.toString:void 0;o.exports=function baseToString(o){if(\"string\"==typeof o)return o;if(w(o))return _(o,baseToString)+\"\";if(x(o))return j?j.call(o):\"\";var s=o+\"\";return\"0\"==s&&1/o==-1/0?\"-0\":s}},54128:(o,s,i)=>{var u=i(31800),_=/^\\s+/;o.exports=function baseTrim(o){return o?o.slice(0,u(o)+1).replace(_,\"\"):o}},27301:o=>{o.exports=function baseUnary(o){return function(s){return o(s)}}},19931:(o,s,i)=>{var u=i(31769),_=i(68090),w=i(68969),x=i(77797);o.exports=function baseUnset(o,s){return s=u(s,o),null==(o=w(o,s))||delete o[x(_(s))]}},51234:o=>{o.exports=function baseZipObject(o,s,i){for(var u=-1,_=o.length,w=s.length,x={};++u<_;){var C=u<w?s[u]:void 0;i(x,o[u],C)}return x}},19219:o=>{o.exports=function cacheHas(o,s){return o.has(s)}},31769:(o,s,i)=>{var u=i(56449),_=i(28586),w=i(61802),x=i(13222);o.exports=function castPath(o,s){return u(o)?o:_(o,s)?[o]:w(x(o))}},28754:(o,s,i)=>{var u=i(25160);o.exports=function castSlice(o,s,i){var _=o.length;return i=void 0===i?_:i,!s&&i>=_?o:u(o,s,i)}},49653:(o,s,i)=>{var u=i(37828);o.exports=function cloneArrayBuffer(o){var s=new o.constructor(o.byteLength);return new u(s).set(new u(o)),s}},93290:(o,s,i)=>{o=i.nmd(o);var u=i(9325),_=s&&!s.nodeType&&s,w=_&&o&&!o.nodeType&&o,x=w&&w.exports===_?u.Buffer:void 0,C=x?x.allocUnsafe:void 0;o.exports=function cloneBuffer(o,s){if(s)return o.slice();var i=o.length,u=C?C(i):new o.constructor(i);return o.copy(u),u}},76169:(o,s,i)=>{var u=i(49653);o.exports=function cloneDataView(o,s){var i=s?u(o.buffer):o.buffer;return new o.constructor(i,o.byteOffset,o.byteLength)}},73201:o=>{var s=/\\w*$/;o.exports=function cloneRegExp(o){var i=new o.constructor(o.source,s.exec(o));return i.lastIndex=o.lastIndex,i}},93736:(o,s,i)=>{var u=i(51873),_=u?u.prototype:void 0,w=_?_.valueOf:void 0;o.exports=function cloneSymbol(o){return w?Object(w.call(o)):{}}},71961:(o,s,i)=>{var u=i(49653);o.exports=function cloneTypedArray(o,s){var i=s?u(o.buffer):o.buffer;return new o.constructor(i,o.byteOffset,o.length)}},91596:o=>{var s=Math.max;o.exports=function composeArgs(o,i,u,_){for(var w=-1,x=o.length,C=u.length,j=-1,L=i.length,B=s(x-C,0),$=Array(L+B),V=!_;++j<L;)$[j]=i[j];for(;++w<C;)(V||w<x)&&($[u[w]]=o[w]);for(;B--;)$[j++]=o[w++];return $}},53320:o=>{var s=Math.max;o.exports=function composeArgsRight(o,i,u,_){for(var w=-1,x=o.length,C=-1,j=u.length,L=-1,B=i.length,$=s(x-j,0),V=Array($+B),U=!_;++w<$;)V[w]=o[w];for(var z=w;++L<B;)V[z+L]=i[L];for(;++C<j;)(U||w<x)&&(V[z+u[C]]=o[w++]);return V}},23007:o=>{o.exports=function copyArray(o,s){var i=-1,u=o.length;for(s||(s=Array(u));++i<u;)s[i]=o[i];return s}},21791:(o,s,i)=>{var u=i(16547),_=i(43360);o.exports=function copyObject(o,s,i,w){var x=!i;i||(i={});for(var C=-1,j=s.length;++C<j;){var L=s[C],B=w?w(i[L],o[L],L,i,o):void 0;void 0===B&&(B=o[L]),x?_(i,L,B):u(i,L,B)}return i}},92271:(o,s,i)=>{var u=i(21791),_=i(4664);o.exports=function copySymbols(o,s){return u(o,_(o),s)}},48948:(o,s,i)=>{var u=i(21791),_=i(86375);o.exports=function copySymbolsIn(o,s){return u(o,_(o),s)}},55481:(o,s,i)=>{var u=i(9325)[\"__core-js_shared__\"];o.exports=u},58523:o=>{o.exports=function countHolders(o,s){for(var i=o.length,u=0;i--;)o[i]===s&&++u;return u}},20999:(o,s,i)=>{var u=i(69302),_=i(36800);o.exports=function createAssigner(o){return u((function(s,i){var u=-1,w=i.length,x=w>1?i[w-1]:void 0,C=w>2?i[2]:void 0;for(x=o.length>3&&\"function\"==typeof x?(w--,x):void 0,C&&_(i[0],i[1],C)&&(x=w<3?void 0:x,w=1),s=Object(s);++u<w;){var j=i[u];j&&o(s,j,u,x)}return s}))}},38329:(o,s,i)=>{var u=i(64894);o.exports=function createBaseEach(o,s){return function(i,_){if(null==i)return i;if(!u(i))return o(i,_);for(var w=i.length,x=s?w:-1,C=Object(i);(s?x--:++x<w)&&!1!==_(C[x],x,C););return i}}},83221:o=>{o.exports=function createBaseFor(o){return function(s,i,u){for(var _=-1,w=Object(s),x=u(s),C=x.length;C--;){var j=x[o?C:++_];if(!1===i(w[j],j,w))break}return s}}},11842:(o,s,i)=>{var u=i(82819),_=i(9325);o.exports=function createBind(o,s,i){var w=1&s,x=u(o);return function wrapper(){return(this&&this!==_&&this instanceof wrapper?x:o).apply(w?i:this,arguments)}}},12507:(o,s,i)=>{var u=i(28754),_=i(49698),w=i(63912),x=i(13222);o.exports=function createCaseFirst(o){return function(s){s=x(s);var i=_(s)?w(s):void 0,C=i?i[0]:s.charAt(0),j=i?u(i,1).join(\"\"):s.slice(1);return C[o]()+j}}},45539:(o,s,i)=>{var u=i(40882),_=i(50828),w=i(66645),x=RegExp(\"['’]\",\"g\");o.exports=function createCompounder(o){return function(s){return u(w(_(s).replace(x,\"\")),o,\"\")}}},82819:(o,s,i)=>{var u=i(39344),_=i(23805);o.exports=function createCtor(o){return function(){var s=arguments;switch(s.length){case 0:return new o;case 1:return new o(s[0]);case 2:return new o(s[0],s[1]);case 3:return new o(s[0],s[1],s[2]);case 4:return new o(s[0],s[1],s[2],s[3]);case 5:return new o(s[0],s[1],s[2],s[3],s[4]);case 6:return new o(s[0],s[1],s[2],s[3],s[4],s[5]);case 7:return new o(s[0],s[1],s[2],s[3],s[4],s[5],s[6])}var i=u(o.prototype),w=o.apply(i,s);return _(w)?w:i}}},77078:(o,s,i)=>{var u=i(91033),_=i(82819),w=i(37471),x=i(18073),C=i(11287),j=i(36306),L=i(9325);o.exports=function createCurry(o,s,i){var B=_(o);return function wrapper(){for(var _=arguments.length,$=Array(_),V=_,U=C(wrapper);V--;)$[V]=arguments[V];var z=_<3&&$[0]!==U&&$[_-1]!==U?[]:j($,U);return(_-=z.length)<i?x(o,s,w,wrapper.placeholder,void 0,$,z,void 0,void 0,i-_):u(this&&this!==L&&this instanceof wrapper?B:o,this,$)}}},62006:(o,s,i)=>{var u=i(15389),_=i(64894),w=i(95950);o.exports=function createFind(o){return function(s,i,x){var C=Object(s);if(!_(s)){var j=u(i,3);s=w(s),i=function(o){return j(C[o],o,C)}}var L=o(s,i,x);return L>-1?C[j?s[L]:L]:void 0}}},37471:(o,s,i)=>{var u=i(91596),_=i(53320),w=i(58523),x=i(82819),C=i(18073),j=i(11287),L=i(68294),B=i(36306),$=i(9325);o.exports=function createHybrid(o,s,i,V,U,z,Y,Z,ee,ie){var ae=128&s,ce=1&s,le=2&s,pe=24&s,de=512&s,fe=le?void 0:x(o);return function wrapper(){for(var ye=arguments.length,be=Array(ye),_e=ye;_e--;)be[_e]=arguments[_e];if(pe)var we=j(wrapper),Se=w(be,we);if(V&&(be=u(be,V,U,pe)),z&&(be=_(be,z,Y,pe)),ye-=Se,pe&&ye<ie){var xe=B(be,we);return C(o,s,createHybrid,wrapper.placeholder,i,be,xe,Z,ee,ie-ye)}var Pe=ce?i:this,Te=le?Pe[o]:o;return ye=be.length,Z?be=L(be,Z):de&&ye>1&&be.reverse(),ae&&ee<ye&&(be.length=ee),this&&this!==$&&this instanceof wrapper&&(Te=fe||x(Te)),Te.apply(Pe,be)}}},24168:(o,s,i)=>{var u=i(91033),_=i(82819),w=i(9325);o.exports=function createPartial(o,s,i,x){var C=1&s,j=_(o);return function wrapper(){for(var s=-1,_=arguments.length,L=-1,B=x.length,$=Array(B+_),V=this&&this!==w&&this instanceof wrapper?j:o;++L<B;)$[L]=x[L];for(;_--;)$[L++]=arguments[++s];return u(V,C?i:this,$)}}},18073:(o,s,i)=>{var u=i(85087),_=i(54641),w=i(70981);o.exports=function createRecurry(o,s,i,x,C,j,L,B,$,V){var U=8&s;s|=U?32:64,4&(s&=~(U?64:32))||(s&=-4);var z=[o,s,C,U?j:void 0,U?L:void 0,U?void 0:j,U?void 0:L,B,$,V],Y=i.apply(void 0,z);return u(o)&&_(Y,z),Y.placeholder=x,w(Y,o,s)}},66977:(o,s,i)=>{var u=i(68882),_=i(11842),w=i(77078),x=i(37471),C=i(24168),j=i(37381),L=i(3209),B=i(54641),$=i(70981),V=i(61489),U=Math.max;o.exports=function createWrap(o,s,i,z,Y,Z,ee,ie){var ae=2&s;if(!ae&&\"function\"!=typeof o)throw new TypeError(\"Expected a function\");var ce=z?z.length:0;if(ce||(s&=-97,z=Y=void 0),ee=void 0===ee?ee:U(V(ee),0),ie=void 0===ie?ie:V(ie),ce-=Y?Y.length:0,64&s){var le=z,pe=Y;z=Y=void 0}var de=ae?void 0:j(o),fe=[o,s,i,z,Y,le,pe,Z,ee,ie];if(de&&L(fe,de),o=fe[0],s=fe[1],i=fe[2],z=fe[3],Y=fe[4],!(ie=fe[9]=void 0===fe[9]?ae?0:o.length:U(fe[9]-ce,0))&&24&s&&(s&=-25),s&&1!=s)ye=8==s||16==s?w(o,s,ie):32!=s&&33!=s||Y.length?x.apply(void 0,fe):C(o,s,i,z);else var ye=_(o,s,i);return $((de?u:B)(ye,fe),o,s)}},53138:(o,s,i)=>{var u=i(11331);o.exports=function customOmitClone(o){return u(o)?void 0:o}},24647:(o,s,i)=>{var u=i(54552)({À:\"A\",Á:\"A\",Â:\"A\",Ã:\"A\",Ä:\"A\",Å:\"A\",à:\"a\",á:\"a\",â:\"a\",ã:\"a\",ä:\"a\",å:\"a\",Ç:\"C\",ç:\"c\",Ð:\"D\",ð:\"d\",È:\"E\",É:\"E\",Ê:\"E\",Ë:\"E\",è:\"e\",é:\"e\",ê:\"e\",ë:\"e\",Ì:\"I\",Í:\"I\",Î:\"I\",Ï:\"I\",ì:\"i\",í:\"i\",î:\"i\",ï:\"i\",Ñ:\"N\",ñ:\"n\",Ò:\"O\",Ó:\"O\",Ô:\"O\",Õ:\"O\",Ö:\"O\",Ø:\"O\",ò:\"o\",ó:\"o\",ô:\"o\",õ:\"o\",ö:\"o\",ø:\"o\",Ù:\"U\",Ú:\"U\",Û:\"U\",Ü:\"U\",ù:\"u\",ú:\"u\",û:\"u\",ü:\"u\",Ý:\"Y\",ý:\"y\",ÿ:\"y\",Æ:\"Ae\",æ:\"ae\",Þ:\"Th\",þ:\"th\",ß:\"ss\",Ā:\"A\",Ă:\"A\",Ą:\"A\",ā:\"a\",ă:\"a\",ą:\"a\",Ć:\"C\",Ĉ:\"C\",Ċ:\"C\",Č:\"C\",ć:\"c\",ĉ:\"c\",ċ:\"c\",č:\"c\",Ď:\"D\",Đ:\"D\",ď:\"d\",đ:\"d\",Ē:\"E\",Ĕ:\"E\",Ė:\"E\",Ę:\"E\",Ě:\"E\",ē:\"e\",ĕ:\"e\",ė:\"e\",ę:\"e\",ě:\"e\",Ĝ:\"G\",Ğ:\"G\",Ġ:\"G\",Ģ:\"G\",ĝ:\"g\",ğ:\"g\",ġ:\"g\",ģ:\"g\",Ĥ:\"H\",Ħ:\"H\",ĥ:\"h\",ħ:\"h\",Ĩ:\"I\",Ī:\"I\",Ĭ:\"I\",Į:\"I\",İ:\"I\",ĩ:\"i\",ī:\"i\",ĭ:\"i\",į:\"i\",ı:\"i\",Ĵ:\"J\",ĵ:\"j\",Ķ:\"K\",ķ:\"k\",ĸ:\"k\",Ĺ:\"L\",Ļ:\"L\",Ľ:\"L\",Ŀ:\"L\",Ł:\"L\",ĺ:\"l\",ļ:\"l\",ľ:\"l\",ŀ:\"l\",ł:\"l\",Ń:\"N\",Ņ:\"N\",Ň:\"N\",Ŋ:\"N\",ń:\"n\",ņ:\"n\",ň:\"n\",ŋ:\"n\",Ō:\"O\",Ŏ:\"O\",Ő:\"O\",ō:\"o\",ŏ:\"o\",ő:\"o\",Ŕ:\"R\",Ŗ:\"R\",Ř:\"R\",ŕ:\"r\",ŗ:\"r\",ř:\"r\",Ś:\"S\",Ŝ:\"S\",Ş:\"S\",Š:\"S\",ś:\"s\",ŝ:\"s\",ş:\"s\",š:\"s\",Ţ:\"T\",Ť:\"T\",Ŧ:\"T\",ţ:\"t\",ť:\"t\",ŧ:\"t\",Ũ:\"U\",Ū:\"U\",Ŭ:\"U\",Ů:\"U\",Ű:\"U\",Ų:\"U\",ũ:\"u\",ū:\"u\",ŭ:\"u\",ů:\"u\",ű:\"u\",ų:\"u\",Ŵ:\"W\",ŵ:\"w\",Ŷ:\"Y\",ŷ:\"y\",Ÿ:\"Y\",Ź:\"Z\",Ż:\"Z\",Ž:\"Z\",ź:\"z\",ż:\"z\",ž:\"z\",Ĳ:\"IJ\",ĳ:\"ij\",Œ:\"Oe\",œ:\"oe\",ŉ:\"'n\",ſ:\"s\"});o.exports=u},93243:(o,s,i)=>{var u=i(56110),_=function(){try{var o=u(Object,\"defineProperty\");return o({},\"\",{}),o}catch(o){}}();o.exports=_},25911:(o,s,i)=>{var u=i(38859),_=i(14248),w=i(19219);o.exports=function equalArrays(o,s,i,x,C,j){var L=1&i,B=o.length,$=s.length;if(B!=$&&!(L&&$>B))return!1;var V=j.get(o),U=j.get(s);if(V&&U)return V==s&&U==o;var z=-1,Y=!0,Z=2&i?new u:void 0;for(j.set(o,s),j.set(s,o);++z<B;){var ee=o[z],ie=s[z];if(x)var ae=L?x(ie,ee,z,s,o,j):x(ee,ie,z,o,s,j);if(void 0!==ae){if(ae)continue;Y=!1;break}if(Z){if(!_(s,(function(o,s){if(!w(Z,s)&&(ee===o||C(ee,o,i,x,j)))return Z.push(s)}))){Y=!1;break}}else if(ee!==ie&&!C(ee,ie,i,x,j)){Y=!1;break}}return j.delete(o),j.delete(s),Y}},21986:(o,s,i)=>{var u=i(51873),_=i(37828),w=i(75288),x=i(25911),C=i(20317),j=i(84247),L=u?u.prototype:void 0,B=L?L.valueOf:void 0;o.exports=function equalByTag(o,s,i,u,L,$,V){switch(i){case\"[object DataView]\":if(o.byteLength!=s.byteLength||o.byteOffset!=s.byteOffset)return!1;o=o.buffer,s=s.buffer;case\"[object ArrayBuffer]\":return!(o.byteLength!=s.byteLength||!$(new _(o),new _(s)));case\"[object Boolean]\":case\"[object Date]\":case\"[object Number]\":return w(+o,+s);case\"[object Error]\":return o.name==s.name&&o.message==s.message;case\"[object RegExp]\":case\"[object String]\":return o==s+\"\";case\"[object Map]\":var U=C;case\"[object Set]\":var z=1&u;if(U||(U=j),o.size!=s.size&&!z)return!1;var Y=V.get(o);if(Y)return Y==s;u|=2,V.set(o,s);var Z=x(U(o),U(s),u,L,$,V);return V.delete(o),Z;case\"[object Symbol]\":if(B)return B.call(o)==B.call(s)}return!1}},50689:(o,s,i)=>{var u=i(50002),_=Object.prototype.hasOwnProperty;o.exports=function equalObjects(o,s,i,w,x,C){var j=1&i,L=u(o),B=L.length;if(B!=u(s).length&&!j)return!1;for(var $=B;$--;){var V=L[$];if(!(j?V in s:_.call(s,V)))return!1}var U=C.get(o),z=C.get(s);if(U&&z)return U==s&&z==o;var Y=!0;C.set(o,s),C.set(s,o);for(var Z=j;++$<B;){var ee=o[V=L[$]],ie=s[V];if(w)var ae=j?w(ie,ee,V,s,o,C):w(ee,ie,V,o,s,C);if(!(void 0===ae?ee===ie||x(ee,ie,i,w,C):ae)){Y=!1;break}Z||(Z=\"constructor\"==V)}if(Y&&!Z){var ce=o.constructor,le=s.constructor;ce==le||!(\"constructor\"in o)||!(\"constructor\"in s)||\"function\"==typeof ce&&ce instanceof ce&&\"function\"==typeof le&&le instanceof le||(Y=!1)}return C.delete(o),C.delete(s),Y}},38816:(o,s,i)=>{var u=i(35970),_=i(56757),w=i(32865);o.exports=function flatRest(o){return w(_(o,void 0,u),o+\"\")}},34840:(o,s,i)=>{var u=\"object\"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;o.exports=u},50002:(o,s,i)=>{var u=i(82199),_=i(4664),w=i(95950);o.exports=function getAllKeys(o){return u(o,w,_)}},83349:(o,s,i)=>{var u=i(82199),_=i(86375),w=i(37241);o.exports=function getAllKeysIn(o){return u(o,w,_)}},37381:(o,s,i)=>{var u=i(48152),_=i(63950),w=u?function(o){return u.get(o)}:_;o.exports=w},62284:(o,s,i)=>{var u=i(84629),_=Object.prototype.hasOwnProperty;o.exports=function getFuncName(o){for(var s=o.name+\"\",i=u[s],w=_.call(u,s)?i.length:0;w--;){var x=i[w],C=x.func;if(null==C||C==o)return x.name}return s}},11287:o=>{o.exports=function getHolder(o){return o.placeholder}},12651:(o,s,i)=>{var u=i(74218);o.exports=function getMapData(o,s){var i=o.__data__;return u(s)?i[\"string\"==typeof s?\"string\":\"hash\"]:i.map}},10776:(o,s,i)=>{var u=i(30756),_=i(95950);o.exports=function getMatchData(o){for(var s=_(o),i=s.length;i--;){var w=s[i],x=o[w];s[i]=[w,x,u(x)]}return s}},56110:(o,s,i)=>{var u=i(45083),_=i(10392);o.exports=function getNative(o,s){var i=_(o,s);return u(i)?i:void 0}},28879:(o,s,i)=>{var u=i(74335)(Object.getPrototypeOf,Object);o.exports=u},659:(o,s,i)=>{var u=i(51873),_=Object.prototype,w=_.hasOwnProperty,x=_.toString,C=u?u.toStringTag:void 0;o.exports=function getRawTag(o){var s=w.call(o,C),i=o[C];try{o[C]=void 0;var u=!0}catch(o){}var _=x.call(o);return u&&(s?o[C]=i:delete o[C]),_}},4664:(o,s,i)=>{var u=i(79770),_=i(63345),w=Object.prototype.propertyIsEnumerable,x=Object.getOwnPropertySymbols,C=x?function(o){return null==o?[]:(o=Object(o),u(x(o),(function(s){return w.call(o,s)})))}:_;o.exports=C},86375:(o,s,i)=>{var u=i(14528),_=i(28879),w=i(4664),x=i(63345),C=Object.getOwnPropertySymbols?function(o){for(var s=[];o;)u(s,w(o)),o=_(o);return s}:x;o.exports=C},5861:(o,s,i)=>{var u=i(55580),_=i(68223),w=i(32804),x=i(76545),C=i(28303),j=i(72552),L=i(47473),B=\"[object Map]\",$=\"[object Promise]\",V=\"[object Set]\",U=\"[object WeakMap]\",z=\"[object DataView]\",Y=L(u),Z=L(_),ee=L(w),ie=L(x),ae=L(C),ce=j;(u&&ce(new u(new ArrayBuffer(1)))!=z||_&&ce(new _)!=B||w&&ce(w.resolve())!=$||x&&ce(new x)!=V||C&&ce(new C)!=U)&&(ce=function(o){var s=j(o),i=\"[object Object]\"==s?o.constructor:void 0,u=i?L(i):\"\";if(u)switch(u){case Y:return z;case Z:return B;case ee:return $;case ie:return V;case ae:return U}return s}),o.exports=ce},10392:o=>{o.exports=function getValue(o,s){return null==o?void 0:o[s]}},75251:o=>{var s=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,i=/,? & /;o.exports=function getWrapDetails(o){var u=o.match(s);return u?u[1].split(i):[]}},49326:(o,s,i)=>{var u=i(31769),_=i(72428),w=i(56449),x=i(30361),C=i(30294),j=i(77797);o.exports=function hasPath(o,s,i){for(var L=-1,B=(s=u(s,o)).length,$=!1;++L<B;){var V=j(s[L]);if(!($=null!=o&&i(o,V)))break;o=o[V]}return $||++L!=B?$:!!(B=null==o?0:o.length)&&C(B)&&x(V,B)&&(w(o)||_(o))}},49698:o=>{var s=RegExp(\"[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]\");o.exports=function hasUnicode(o){return s.test(o)}},45434:o=>{var s=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;o.exports=function hasUnicodeWord(o){return s.test(o)}},22032:(o,s,i)=>{var u=i(81042);o.exports=function hashClear(){this.__data__=u?u(null):{},this.size=0}},63862:o=>{o.exports=function hashDelete(o){var s=this.has(o)&&delete this.__data__[o];return this.size-=s?1:0,s}},66721:(o,s,i)=>{var u=i(81042),_=Object.prototype.hasOwnProperty;o.exports=function hashGet(o){var s=this.__data__;if(u){var i=s[o];return\"__lodash_hash_undefined__\"===i?void 0:i}return _.call(s,o)?s[o]:void 0}},12749:(o,s,i)=>{var u=i(81042),_=Object.prototype.hasOwnProperty;o.exports=function hashHas(o){var s=this.__data__;return u?void 0!==s[o]:_.call(s,o)}},35749:(o,s,i)=>{var u=i(81042);o.exports=function hashSet(o,s){var i=this.__data__;return this.size+=this.has(o)?0:1,i[o]=u&&void 0===s?\"__lodash_hash_undefined__\":s,this}},76189:o=>{var s=Object.prototype.hasOwnProperty;o.exports=function initCloneArray(o){var i=o.length,u=new o.constructor(i);return i&&\"string\"==typeof o[0]&&s.call(o,\"index\")&&(u.index=o.index,u.input=o.input),u}},77199:(o,s,i)=>{var u=i(49653),_=i(76169),w=i(73201),x=i(93736),C=i(71961);o.exports=function initCloneByTag(o,s,i){var j=o.constructor;switch(s){case\"[object ArrayBuffer]\":return u(o);case\"[object Boolean]\":case\"[object Date]\":return new j(+o);case\"[object DataView]\":return _(o,i);case\"[object Float32Array]\":case\"[object Float64Array]\":case\"[object Int8Array]\":case\"[object Int16Array]\":case\"[object Int32Array]\":case\"[object Uint8Array]\":case\"[object Uint8ClampedArray]\":case\"[object Uint16Array]\":case\"[object Uint32Array]\":return C(o,i);case\"[object Map]\":case\"[object Set]\":return new j;case\"[object Number]\":case\"[object String]\":return new j(o);case\"[object RegExp]\":return w(o);case\"[object Symbol]\":return x(o)}}},35529:(o,s,i)=>{var u=i(39344),_=i(28879),w=i(55527);o.exports=function initCloneObject(o){return\"function\"!=typeof o.constructor||w(o)?{}:u(_(o))}},62060:o=>{var s=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;o.exports=function insertWrapDetails(o,i){var u=i.length;if(!u)return o;var _=u-1;return i[_]=(u>1?\"& \":\"\")+i[_],i=i.join(u>2?\", \":\" \"),o.replace(s,\"{\\n/* [wrapped with \"+i+\"] */\\n\")}},45891:(o,s,i)=>{var u=i(51873),_=i(72428),w=i(56449),x=u?u.isConcatSpreadable:void 0;o.exports=function isFlattenable(o){return w(o)||_(o)||!!(x&&o&&o[x])}},30361:o=>{var s=/^(?:0|[1-9]\\d*)$/;o.exports=function isIndex(o,i){var u=typeof o;return!!(i=null==i?9007199254740991:i)&&(\"number\"==u||\"symbol\"!=u&&s.test(o))&&o>-1&&o%1==0&&o<i}},36800:(o,s,i)=>{var u=i(75288),_=i(64894),w=i(30361),x=i(23805);o.exports=function isIterateeCall(o,s,i){if(!x(i))return!1;var C=typeof s;return!!(\"number\"==C?_(i)&&w(s,i.length):\"string\"==C&&s in i)&&u(i[s],o)}},28586:(o,s,i)=>{var u=i(56449),_=i(44394),w=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,x=/^\\w*$/;o.exports=function isKey(o,s){if(u(o))return!1;var i=typeof o;return!(\"number\"!=i&&\"symbol\"!=i&&\"boolean\"!=i&&null!=o&&!_(o))||(x.test(o)||!w.test(o)||null!=s&&o in Object(s))}},74218:o=>{o.exports=function isKeyable(o){var s=typeof o;return\"string\"==s||\"number\"==s||\"symbol\"==s||\"boolean\"==s?\"__proto__\"!==o:null===o}},85087:(o,s,i)=>{var u=i(30980),_=i(37381),w=i(62284),x=i(53758);o.exports=function isLaziable(o){var s=w(o),i=x[s];if(\"function\"!=typeof i||!(s in u.prototype))return!1;if(o===i)return!0;var C=_(i);return!!C&&o===C[0]}},87296:(o,s,i)=>{var u,_=i(55481),w=(u=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+u:\"\";o.exports=function isMasked(o){return!!w&&w in o}},55527:o=>{var s=Object.prototype;o.exports=function isPrototype(o){var i=o&&o.constructor;return o===(\"function\"==typeof i&&i.prototype||s)}},30756:(o,s,i)=>{var u=i(23805);o.exports=function isStrictComparable(o){return o==o&&!u(o)}},63702:o=>{o.exports=function listCacheClear(){this.__data__=[],this.size=0}},70080:(o,s,i)=>{var u=i(26025),_=Array.prototype.splice;o.exports=function listCacheDelete(o){var s=this.__data__,i=u(s,o);return!(i<0)&&(i==s.length-1?s.pop():_.call(s,i,1),--this.size,!0)}},24739:(o,s,i)=>{var u=i(26025);o.exports=function listCacheGet(o){var s=this.__data__,i=u(s,o);return i<0?void 0:s[i][1]}},48655:(o,s,i)=>{var u=i(26025);o.exports=function listCacheHas(o){return u(this.__data__,o)>-1}},31175:(o,s,i)=>{var u=i(26025);o.exports=function listCacheSet(o,s){var i=this.__data__,_=u(i,o);return _<0?(++this.size,i.push([o,s])):i[_][1]=s,this}},63040:(o,s,i)=>{var u=i(21549),_=i(80079),w=i(68223);o.exports=function mapCacheClear(){this.size=0,this.__data__={hash:new u,map:new(w||_),string:new u}}},17670:(o,s,i)=>{var u=i(12651);o.exports=function mapCacheDelete(o){var s=u(this,o).delete(o);return this.size-=s?1:0,s}},90289:(o,s,i)=>{var u=i(12651);o.exports=function mapCacheGet(o){return u(this,o).get(o)}},4509:(o,s,i)=>{var u=i(12651);o.exports=function mapCacheHas(o){return u(this,o).has(o)}},72949:(o,s,i)=>{var u=i(12651);o.exports=function mapCacheSet(o,s){var i=u(this,o),_=i.size;return i.set(o,s),this.size+=i.size==_?0:1,this}},20317:o=>{o.exports=function mapToArray(o){var s=-1,i=Array(o.size);return o.forEach((function(o,u){i[++s]=[u,o]})),i}},67197:o=>{o.exports=function matchesStrictComparable(o,s){return function(i){return null!=i&&(i[o]===s&&(void 0!==s||o in Object(i)))}}},62224:(o,s,i)=>{var u=i(50104);o.exports=function memoizeCapped(o){var s=u(o,(function(o){return 500===i.size&&i.clear(),o})),i=s.cache;return s}},3209:(o,s,i)=>{var u=i(91596),_=i(53320),w=i(36306),x=\"__lodash_placeholder__\",C=128,j=Math.min;o.exports=function mergeData(o,s){var i=o[1],L=s[1],B=i|L,$=B<131,V=L==C&&8==i||L==C&&256==i&&o[7].length<=s[8]||384==L&&s[7].length<=s[8]&&8==i;if(!$&&!V)return o;1&L&&(o[2]=s[2],B|=1&i?0:4);var U=s[3];if(U){var z=o[3];o[3]=z?u(z,U,s[4]):U,o[4]=z?w(o[3],x):s[4]}return(U=s[5])&&(z=o[5],o[5]=z?_(z,U,s[6]):U,o[6]=z?w(o[5],x):s[6]),(U=s[7])&&(o[7]=U),L&C&&(o[8]=null==o[8]?s[8]:j(o[8],s[8])),null==o[9]&&(o[9]=s[9]),o[0]=s[0],o[1]=B,o}},48152:(o,s,i)=>{var u=i(28303),_=u&&new u;o.exports=_},81042:(o,s,i)=>{var u=i(56110)(Object,\"create\");o.exports=u},3650:(o,s,i)=>{var u=i(74335)(Object.keys,Object);o.exports=u},90181:o=>{o.exports=function nativeKeysIn(o){var s=[];if(null!=o)for(var i in Object(o))s.push(i);return s}},86009:(o,s,i)=>{o=i.nmd(o);var u=i(34840),_=s&&!s.nodeType&&s,w=_&&o&&!o.nodeType&&o,x=w&&w.exports===_&&u.process,C=function(){try{var o=w&&w.require&&w.require(\"util\").types;return o||x&&x.binding&&x.binding(\"util\")}catch(o){}}();o.exports=C},59350:o=>{var s=Object.prototype.toString;o.exports=function objectToString(o){return s.call(o)}},74335:o=>{o.exports=function overArg(o,s){return function(i){return o(s(i))}}},56757:(o,s,i)=>{var u=i(91033),_=Math.max;o.exports=function overRest(o,s,i){return s=_(void 0===s?o.length-1:s,0),function(){for(var w=arguments,x=-1,C=_(w.length-s,0),j=Array(C);++x<C;)j[x]=w[s+x];x=-1;for(var L=Array(s+1);++x<s;)L[x]=w[x];return L[s]=i(j),u(o,this,L)}}},68969:(o,s,i)=>{var u=i(47422),_=i(25160);o.exports=function parent(o,s){return s.length<2?o:u(o,_(s,0,-1))}},84629:o=>{o.exports={}},68294:(o,s,i)=>{var u=i(23007),_=i(30361),w=Math.min;o.exports=function reorder(o,s){for(var i=o.length,x=w(s.length,i),C=u(o);x--;){var j=s[x];o[x]=_(j,i)?C[j]:void 0}return o}},36306:o=>{var s=\"__lodash_placeholder__\";o.exports=function replaceHolders(o,i){for(var u=-1,_=o.length,w=0,x=[];++u<_;){var C=o[u];C!==i&&C!==s||(o[u]=s,x[w++]=u)}return x}},9325:(o,s,i)=>{var u=i(34840),_=\"object\"==typeof self&&self&&self.Object===Object&&self,w=u||_||Function(\"return this\")();o.exports=w},14974:o=>{o.exports=function safeGet(o,s){if((\"constructor\"!==s||\"function\"!=typeof o[s])&&\"__proto__\"!=s)return o[s]}},31380:o=>{o.exports=function setCacheAdd(o){return this.__data__.set(o,\"__lodash_hash_undefined__\"),this}},51459:o=>{o.exports=function setCacheHas(o){return this.__data__.has(o)}},54641:(o,s,i)=>{var u=i(68882),_=i(51811)(u);o.exports=_},84247:o=>{o.exports=function setToArray(o){var s=-1,i=Array(o.size);return o.forEach((function(o){i[++s]=o})),i}},32865:(o,s,i)=>{var u=i(19570),_=i(51811)(u);o.exports=_},70981:(o,s,i)=>{var u=i(75251),_=i(62060),w=i(32865),x=i(75948);o.exports=function setWrapToString(o,s,i){var C=s+\"\";return w(o,_(C,x(u(C),i)))}},51811:o=>{var s=Date.now;o.exports=function shortOut(o){var i=0,u=0;return function(){var _=s(),w=16-(_-u);if(u=_,w>0){if(++i>=800)return arguments[0]}else i=0;return o.apply(void 0,arguments)}}},51420:(o,s,i)=>{var u=i(80079);o.exports=function stackClear(){this.__data__=new u,this.size=0}},90938:o=>{o.exports=function stackDelete(o){var s=this.__data__,i=s.delete(o);return this.size=s.size,i}},63605:o=>{o.exports=function stackGet(o){return this.__data__.get(o)}},29817:o=>{o.exports=function stackHas(o){return this.__data__.has(o)}},80945:(o,s,i)=>{var u=i(80079),_=i(68223),w=i(53661);o.exports=function stackSet(o,s){var i=this.__data__;if(i instanceof u){var x=i.__data__;if(!_||x.length<199)return x.push([o,s]),this.size=++i.size,this;i=this.__data__=new w(x)}return i.set(o,s),this.size=i.size,this}},76959:o=>{o.exports=function strictIndexOf(o,s,i){for(var u=i-1,_=o.length;++u<_;)if(o[u]===s)return u;return-1}},63912:(o,s,i)=>{var u=i(61074),_=i(49698),w=i(42054);o.exports=function stringToArray(o){return _(o)?w(o):u(o)}},61802:(o,s,i)=>{var u=i(62224),_=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,w=/\\\\(\\\\)?/g,x=u((function(o){var s=[];return 46===o.charCodeAt(0)&&s.push(\"\"),o.replace(_,(function(o,i,u,_){s.push(u?_.replace(w,\"$1\"):i||o)})),s}));o.exports=x},77797:(o,s,i)=>{var u=i(44394);o.exports=function toKey(o){if(\"string\"==typeof o||u(o))return o;var s=o+\"\";return\"0\"==s&&1/o==-1/0?\"-0\":s}},47473:o=>{var s=Function.prototype.toString;o.exports=function toSource(o){if(null!=o){try{return s.call(o)}catch(o){}try{return o+\"\"}catch(o){}}return\"\"}},31800:o=>{var s=/\\s/;o.exports=function trimmedEndIndex(o){for(var i=o.length;i--&&s.test(o.charAt(i)););return i}},42054:o=>{var s=\"\\\\ud800-\\\\udfff\",i=\"[\"+s+\"]\",u=\"[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]\",_=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",w=\"[^\"+s+\"]\",x=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",C=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",j=\"(?:\"+u+\"|\"+_+\")\"+\"?\",L=\"[\\\\ufe0e\\\\ufe0f]?\",B=L+j+(\"(?:\\\\u200d(?:\"+[w,x,C].join(\"|\")+\")\"+L+j+\")*\"),$=\"(?:\"+[w+u+\"?\",u,x,C,i].join(\"|\")+\")\",V=RegExp(_+\"(?=\"+_+\")|\"+$+B,\"g\");o.exports=function unicodeToArray(o){return o.match(V)||[]}},22225:o=>{var s=\"\\\\ud800-\\\\udfff\",i=\"\\\\u2700-\\\\u27bf\",u=\"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\",_=\"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\",w=\"\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\",x=\"[\"+w+\"]\",C=\"\\\\d+\",j=\"[\"+i+\"]\",L=\"[\"+u+\"]\",B=\"[^\"+s+w+C+i+u+_+\"]\",$=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",V=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",U=\"[\"+_+\"]\",z=\"(?:\"+L+\"|\"+B+\")\",Y=\"(?:\"+U+\"|\"+B+\")\",Z=\"(?:['’](?:d|ll|m|re|s|t|ve))?\",ee=\"(?:['’](?:D|LL|M|RE|S|T|VE))?\",ie=\"(?:[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]|\\\\ud83c[\\\\udffb-\\\\udfff])?\",ae=\"[\\\\ufe0e\\\\ufe0f]?\",ce=ae+ie+(\"(?:\\\\u200d(?:\"+[\"[^\"+s+\"]\",$,V].join(\"|\")+\")\"+ae+ie+\")*\"),le=\"(?:\"+[j,$,V].join(\"|\")+\")\"+ce,pe=RegExp([U+\"?\"+L+\"+\"+Z+\"(?=\"+[x,U,\"$\"].join(\"|\")+\")\",Y+\"+\"+ee+\"(?=\"+[x,U+z,\"$\"].join(\"|\")+\")\",U+\"?\"+z+\"+\"+Z,U+\"+\"+ee,\"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\",\"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\",C,le].join(\"|\"),\"g\");o.exports=function unicodeWords(o){return o.match(pe)||[]}},75948:(o,s,i)=>{var u=i(83729),_=i(15325),w=[[\"ary\",128],[\"bind\",1],[\"bindKey\",2],[\"curry\",8],[\"curryRight\",16],[\"flip\",512],[\"partial\",32],[\"partialRight\",64],[\"rearg\",256]];o.exports=function updateWrapDetails(o,s){return u(w,(function(i){var u=\"_.\"+i[0];s&i[1]&&!_(o,u)&&o.push(u)})),o.sort()}},80257:(o,s,i)=>{var u=i(30980),_=i(56017),w=i(23007);o.exports=function wrapperClone(o){if(o instanceof u)return o.clone();var s=new _(o.__wrapped__,o.__chain__);return s.__actions__=w(o.__actions__),s.__index__=o.__index__,s.__values__=o.__values__,s}},64626:(o,s,i)=>{var u=i(66977);o.exports=function ary(o,s,i){return s=i?void 0:s,s=o&&null==s?o.length:s,u(o,128,void 0,void 0,void 0,void 0,s)}},84058:(o,s,i)=>{var u=i(14792),_=i(45539)((function(o,s,i){return s=s.toLowerCase(),o+(i?u(s):s)}));o.exports=_},14792:(o,s,i)=>{var u=i(13222),_=i(55808);o.exports=function capitalize(o){return _(u(o).toLowerCase())}},32629:(o,s,i)=>{var u=i(9999);o.exports=function clone(o){return u(o,4)}},37334:o=>{o.exports=function constant(o){return function(){return o}}},49747:(o,s,i)=>{var u=i(66977);function curry(o,s,i){var _=u(o,8,void 0,void 0,void 0,void 0,void 0,s=i?void 0:s);return _.placeholder=curry.placeholder,_}curry.placeholder={},o.exports=curry},38221:(o,s,i)=>{var u=i(23805),_=i(10124),w=i(99374),x=Math.max,C=Math.min;o.exports=function debounce(o,s,i){var j,L,B,$,V,U,z=0,Y=!1,Z=!1,ee=!0;if(\"function\"!=typeof o)throw new TypeError(\"Expected a function\");function invokeFunc(s){var i=j,u=L;return j=L=void 0,z=s,$=o.apply(u,i)}function shouldInvoke(o){var i=o-U;return void 0===U||i>=s||i<0||Z&&o-z>=B}function timerExpired(){var o=_();if(shouldInvoke(o))return trailingEdge(o);V=setTimeout(timerExpired,function remainingWait(o){var i=s-(o-U);return Z?C(i,B-(o-z)):i}(o))}function trailingEdge(o){return V=void 0,ee&&j?invokeFunc(o):(j=L=void 0,$)}function debounced(){var o=_(),i=shouldInvoke(o);if(j=arguments,L=this,U=o,i){if(void 0===V)return function leadingEdge(o){return z=o,V=setTimeout(timerExpired,s),Y?invokeFunc(o):$}(U);if(Z)return clearTimeout(V),V=setTimeout(timerExpired,s),invokeFunc(U)}return void 0===V&&(V=setTimeout(timerExpired,s)),$}return s=w(s)||0,u(i)&&(Y=!!i.leading,B=(Z=\"maxWait\"in i)?x(w(i.maxWait)||0,s):B,ee=\"trailing\"in i?!!i.trailing:ee),debounced.cancel=function cancel(){void 0!==V&&clearTimeout(V),z=0,j=U=L=V=void 0},debounced.flush=function flush(){return void 0===V?$:trailingEdge(_())},debounced}},50828:(o,s,i)=>{var u=i(24647),_=i(13222),w=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,x=RegExp(\"[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]\",\"g\");o.exports=function deburr(o){return(o=_(o))&&o.replace(w,u).replace(x,\"\")}},75288:o=>{o.exports=function eq(o,s){return o===s||o!=o&&s!=s}},60680:(o,s,i)=>{var u=i(13222),_=/[\\\\^$.*+?()[\\]{}|]/g,w=RegExp(_.source);o.exports=function escapeRegExp(o){return(o=u(o))&&w.test(o)?o.replace(_,\"\\\\$&\"):o}},7309:(o,s,i)=>{var u=i(62006)(i(24713));o.exports=u},24713:(o,s,i)=>{var u=i(2523),_=i(15389),w=i(61489),x=Math.max;o.exports=function findIndex(o,s,i){var C=null==o?0:o.length;if(!C)return-1;var j=null==i?0:w(i);return j<0&&(j=x(C+j,0)),u(o,_(s,3),j)}},35970:(o,s,i)=>{var u=i(83120);o.exports=function flatten(o){return(null==o?0:o.length)?u(o,1):[]}},73424:(o,s,i)=>{var u=i(16962),_=i(2874),w=Array.prototype.push;function baseAry(o,s){return 2==s?function(s,i){return o(s,i)}:function(s){return o(s)}}function cloneArray(o){for(var s=o?o.length:0,i=Array(s);s--;)i[s]=o[s];return i}function wrapImmutable(o,s){return function(){var i=arguments.length;if(i){for(var u=Array(i);i--;)u[i]=arguments[i];var _=u[0]=s.apply(void 0,u);return o.apply(void 0,u),_}}}o.exports=function baseConvert(o,s,i,x){var C=\"function\"==typeof s,j=s===Object(s);if(j&&(x=i,i=s,s=void 0),null==i)throw new TypeError;x||(x={});var L={cap:!(\"cap\"in x)||x.cap,curry:!(\"curry\"in x)||x.curry,fixed:!(\"fixed\"in x)||x.fixed,immutable:!(\"immutable\"in x)||x.immutable,rearg:!(\"rearg\"in x)||x.rearg},B=C?i:_,$=\"curry\"in x&&x.curry,V=\"fixed\"in x&&x.fixed,U=\"rearg\"in x&&x.rearg,z=C?i.runInContext():void 0,Y=C?i:{ary:o.ary,assign:o.assign,clone:o.clone,curry:o.curry,forEach:o.forEach,isArray:o.isArray,isError:o.isError,isFunction:o.isFunction,isWeakMap:o.isWeakMap,iteratee:o.iteratee,keys:o.keys,rearg:o.rearg,toInteger:o.toInteger,toPath:o.toPath},Z=Y.ary,ee=Y.assign,ie=Y.clone,ae=Y.curry,ce=Y.forEach,le=Y.isArray,pe=Y.isError,de=Y.isFunction,fe=Y.isWeakMap,ye=Y.keys,be=Y.rearg,_e=Y.toInteger,we=Y.toPath,Se=ye(u.aryMethod),xe={castArray:function(o){return function(){var s=arguments[0];return le(s)?o(cloneArray(s)):o.apply(void 0,arguments)}},iteratee:function(o){return function(){var s=arguments[1],i=o(arguments[0],s),u=i.length;return L.cap&&\"number\"==typeof s?(s=s>2?s-2:1,u&&u<=s?i:baseAry(i,s)):i}},mixin:function(o){return function(s){var i=this;if(!de(i))return o(i,Object(s));var u=[];return ce(ye(s),(function(o){de(s[o])&&u.push([o,i.prototype[o]])})),o(i,Object(s)),ce(u,(function(o){var s=o[1];de(s)?i.prototype[o[0]]=s:delete i.prototype[o[0]]})),i}},nthArg:function(o){return function(s){var i=s<0?1:_e(s)+1;return ae(o(s),i)}},rearg:function(o){return function(s,i){var u=i?i.length:0;return ae(o(s,i),u)}},runInContext:function(s){return function(i){return baseConvert(o,s(i),x)}}};function castCap(o,s){if(L.cap){var i=u.iterateeRearg[o];if(i)return function iterateeRearg(o,s){return overArg(o,(function(o){var i=s.length;return function baseArity(o,s){return 2==s?function(s,i){return o.apply(void 0,arguments)}:function(s){return o.apply(void 0,arguments)}}(be(baseAry(o,i),s),i)}))}(s,i);var _=!C&&u.iterateeAry[o];if(_)return function iterateeAry(o,s){return overArg(o,(function(o){return\"function\"==typeof o?baseAry(o,s):o}))}(s,_)}return s}function castFixed(o,s,i){if(L.fixed&&(V||!u.skipFixed[o])){var _=u.methodSpread[o],x=_&&_.start;return void 0===x?Z(s,i):function flatSpread(o,s){return function(){for(var i=arguments.length,u=i-1,_=Array(i);i--;)_[i]=arguments[i];var x=_[s],C=_.slice(0,s);return x&&w.apply(C,x),s!=u&&w.apply(C,_.slice(s+1)),o.apply(this,C)}}(s,x)}return s}function castRearg(o,s,i){return L.rearg&&i>1&&(U||!u.skipRearg[o])?be(s,u.methodRearg[o]||u.aryRearg[i]):s}function cloneByPath(o,s){for(var i=-1,u=(s=we(s)).length,_=u-1,w=ie(Object(o)),x=w;null!=x&&++i<u;){var C=s[i],j=x[C];null==j||de(j)||pe(j)||fe(j)||(x[C]=ie(i==_?j:Object(j))),x=x[C]}return w}function createConverter(o,s){var i=u.aliasToReal[o]||o,_=u.remap[i]||i,w=x;return function(o){var u=C?z:Y,x=C?z[_]:s,j=ee(ee({},w),o);return baseConvert(u,i,x,j)}}function overArg(o,s){return function(){var i=arguments.length;if(!i)return o();for(var u=Array(i);i--;)u[i]=arguments[i];var _=L.rearg?0:i-1;return u[_]=s(u[_]),o.apply(void 0,u)}}function wrap(o,s,i){var _,w=u.aliasToReal[o]||o,x=s,C=xe[w];return C?x=C(s):L.immutable&&(u.mutate.array[w]?x=wrapImmutable(s,cloneArray):u.mutate.object[w]?x=wrapImmutable(s,function createCloner(o){return function(s){return o({},s)}}(s)):u.mutate.set[w]&&(x=wrapImmutable(s,cloneByPath))),ce(Se,(function(o){return ce(u.aryMethod[o],(function(s){if(w==s){var i=u.methodSpread[w],C=i&&i.afterRearg;return _=C?castFixed(w,castRearg(w,x,o),o):castRearg(w,castFixed(w,x,o),o),_=function castCurry(o,s,i){return $||L.curry&&i>1?ae(s,i):s}(0,_=castCap(w,_),o),!1}})),!_})),_||(_=x),_==s&&(_=$?ae(_,1):function(){return s.apply(this,arguments)}),_.convert=createConverter(w,s),_.placeholder=s.placeholder=i,_}if(!j)return wrap(s,i,B);var Pe=i,Te=[];return ce(Se,(function(o){ce(u.aryMethod[o],(function(o){var s=Pe[u.remap[o]||o];s&&Te.push([o,wrap(o,s,Pe)])}))})),ce(ye(Pe),(function(o){var s=Pe[o];if(\"function\"==typeof s){for(var i=Te.length;i--;)if(Te[i][0]==o)return;s.convert=createConverter(o,s),Te.push([o,s])}})),ce(Te,(function(o){Pe[o[0]]=o[1]})),Pe.convert=function convertLib(o){return Pe.runInContext.convert(o)(void 0)},Pe.placeholder=Pe,ce(ye(Pe),(function(o){ce(u.realToAlias[o]||[],(function(s){Pe[s]=Pe[o]}))})),Pe}},16962:(o,s)=>{s.aliasToReal={each:\"forEach\",eachRight:\"forEachRight\",entries:\"toPairs\",entriesIn:\"toPairsIn\",extend:\"assignIn\",extendAll:\"assignInAll\",extendAllWith:\"assignInAllWith\",extendWith:\"assignInWith\",first:\"head\",conforms:\"conformsTo\",matches:\"isMatch\",property:\"get\",__:\"placeholder\",F:\"stubFalse\",T:\"stubTrue\",all:\"every\",allPass:\"overEvery\",always:\"constant\",any:\"some\",anyPass:\"overSome\",apply:\"spread\",assoc:\"set\",assocPath:\"set\",complement:\"negate\",compose:\"flowRight\",contains:\"includes\",dissoc:\"unset\",dissocPath:\"unset\",dropLast:\"dropRight\",dropLastWhile:\"dropRightWhile\",equals:\"isEqual\",identical:\"eq\",indexBy:\"keyBy\",init:\"initial\",invertObj:\"invert\",juxt:\"over\",omitAll:\"omit\",nAry:\"ary\",path:\"get\",pathEq:\"matchesProperty\",pathOr:\"getOr\",paths:\"at\",pickAll:\"pick\",pipe:\"flow\",pluck:\"map\",prop:\"get\",propEq:\"matchesProperty\",propOr:\"getOr\",props:\"at\",symmetricDifference:\"xor\",symmetricDifferenceBy:\"xorBy\",symmetricDifferenceWith:\"xorWith\",takeLast:\"takeRight\",takeLastWhile:\"takeRightWhile\",unapply:\"rest\",unnest:\"flatten\",useWith:\"overArgs\",where:\"conformsTo\",whereEq:\"isMatch\",zipObj:\"zipObject\"},s.aryMethod={1:[\"assignAll\",\"assignInAll\",\"attempt\",\"castArray\",\"ceil\",\"create\",\"curry\",\"curryRight\",\"defaultsAll\",\"defaultsDeepAll\",\"floor\",\"flow\",\"flowRight\",\"fromPairs\",\"invert\",\"iteratee\",\"memoize\",\"method\",\"mergeAll\",\"methodOf\",\"mixin\",\"nthArg\",\"over\",\"overEvery\",\"overSome\",\"rest\",\"reverse\",\"round\",\"runInContext\",\"spread\",\"template\",\"trim\",\"trimEnd\",\"trimStart\",\"uniqueId\",\"words\",\"zipAll\"],2:[\"add\",\"after\",\"ary\",\"assign\",\"assignAllWith\",\"assignIn\",\"assignInAllWith\",\"at\",\"before\",\"bind\",\"bindAll\",\"bindKey\",\"chunk\",\"cloneDeepWith\",\"cloneWith\",\"concat\",\"conformsTo\",\"countBy\",\"curryN\",\"curryRightN\",\"debounce\",\"defaults\",\"defaultsDeep\",\"defaultTo\",\"delay\",\"difference\",\"divide\",\"drop\",\"dropRight\",\"dropRightWhile\",\"dropWhile\",\"endsWith\",\"eq\",\"every\",\"filter\",\"find\",\"findIndex\",\"findKey\",\"findLast\",\"findLastIndex\",\"findLastKey\",\"flatMap\",\"flatMapDeep\",\"flattenDepth\",\"forEach\",\"forEachRight\",\"forIn\",\"forInRight\",\"forOwn\",\"forOwnRight\",\"get\",\"groupBy\",\"gt\",\"gte\",\"has\",\"hasIn\",\"includes\",\"indexOf\",\"intersection\",\"invertBy\",\"invoke\",\"invokeMap\",\"isEqual\",\"isMatch\",\"join\",\"keyBy\",\"lastIndexOf\",\"lt\",\"lte\",\"map\",\"mapKeys\",\"mapValues\",\"matchesProperty\",\"maxBy\",\"meanBy\",\"merge\",\"mergeAllWith\",\"minBy\",\"multiply\",\"nth\",\"omit\",\"omitBy\",\"overArgs\",\"pad\",\"padEnd\",\"padStart\",\"parseInt\",\"partial\",\"partialRight\",\"partition\",\"pick\",\"pickBy\",\"propertyOf\",\"pull\",\"pullAll\",\"pullAt\",\"random\",\"range\",\"rangeRight\",\"rearg\",\"reject\",\"remove\",\"repeat\",\"restFrom\",\"result\",\"sampleSize\",\"some\",\"sortBy\",\"sortedIndex\",\"sortedIndexOf\",\"sortedLastIndex\",\"sortedLastIndexOf\",\"sortedUniqBy\",\"split\",\"spreadFrom\",\"startsWith\",\"subtract\",\"sumBy\",\"take\",\"takeRight\",\"takeRightWhile\",\"takeWhile\",\"tap\",\"throttle\",\"thru\",\"times\",\"trimChars\",\"trimCharsEnd\",\"trimCharsStart\",\"truncate\",\"union\",\"uniqBy\",\"uniqWith\",\"unset\",\"unzipWith\",\"without\",\"wrap\",\"xor\",\"zip\",\"zipObject\",\"zipObjectDeep\"],3:[\"assignInWith\",\"assignWith\",\"clamp\",\"differenceBy\",\"differenceWith\",\"findFrom\",\"findIndexFrom\",\"findLastFrom\",\"findLastIndexFrom\",\"getOr\",\"includesFrom\",\"indexOfFrom\",\"inRange\",\"intersectionBy\",\"intersectionWith\",\"invokeArgs\",\"invokeArgsMap\",\"isEqualWith\",\"isMatchWith\",\"flatMapDepth\",\"lastIndexOfFrom\",\"mergeWith\",\"orderBy\",\"padChars\",\"padCharsEnd\",\"padCharsStart\",\"pullAllBy\",\"pullAllWith\",\"rangeStep\",\"rangeStepRight\",\"reduce\",\"reduceRight\",\"replace\",\"set\",\"slice\",\"sortedIndexBy\",\"sortedLastIndexBy\",\"transform\",\"unionBy\",\"unionWith\",\"update\",\"xorBy\",\"xorWith\",\"zipWith\"],4:[\"fill\",\"setWith\",\"updateWith\"]},s.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},s.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},s.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},s.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},s.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},s.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},s.realToAlias=function(){var o=Object.prototype.hasOwnProperty,i=s.aliasToReal,u={};for(var _ in i){var w=i[_];o.call(u,w)?u[w].push(_):u[w]=[_]}return u}(),s.remap={assignAll:\"assign\",assignAllWith:\"assignWith\",assignInAll:\"assignIn\",assignInAllWith:\"assignInWith\",curryN:\"curry\",curryRightN:\"curryRight\",defaultsAll:\"defaults\",defaultsDeepAll:\"defaultsDeep\",findFrom:\"find\",findIndexFrom:\"findIndex\",findLastFrom:\"findLast\",findLastIndexFrom:\"findLastIndex\",getOr:\"get\",includesFrom:\"includes\",indexOfFrom:\"indexOf\",invokeArgs:\"invoke\",invokeArgsMap:\"invokeMap\",lastIndexOfFrom:\"lastIndexOf\",mergeAll:\"merge\",mergeAllWith:\"mergeWith\",padChars:\"pad\",padCharsEnd:\"padEnd\",padCharsStart:\"padStart\",propertyOf:\"get\",rangeStep:\"range\",rangeStepRight:\"rangeRight\",restFrom:\"rest\",spreadFrom:\"spread\",trimChars:\"trim\",trimCharsEnd:\"trimEnd\",trimCharsStart:\"trimStart\",zipAll:\"zip\"},s.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},s.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},47934:(o,s,i)=>{o.exports={ary:i(64626),assign:i(74733),clone:i(32629),curry:i(49747),forEach:i(83729),isArray:i(56449),isError:i(23546),isFunction:i(1882),isWeakMap:i(47886),iteratee:i(33855),keys:i(88984),rearg:i(84195),toInteger:i(61489),toPath:i(42072)}},56367:(o,s,i)=>{o.exports=i(77731)},79920:(o,s,i)=>{var u=i(73424),_=i(47934);o.exports=function convert(o,s,i){return u(_,o,s,i)}},2874:o=>{o.exports={}},77731:(o,s,i)=>{var u=i(79920)(\"set\",i(63560));u.placeholder=i(2874),o.exports=u},58156:(o,s,i)=>{var u=i(47422);o.exports=function get(o,s,i){var _=null==o?void 0:u(o,s);return void 0===_?i:_}},61448:(o,s,i)=>{var u=i(20426),_=i(49326);o.exports=function has(o,s){return null!=o&&_(o,s,u)}},80631:(o,s,i)=>{var u=i(28077),_=i(49326);o.exports=function hasIn(o,s){return null!=o&&_(o,s,u)}},83488:o=>{o.exports=function identity(o){return o}},72428:(o,s,i)=>{var u=i(27534),_=i(40346),w=Object.prototype,x=w.hasOwnProperty,C=w.propertyIsEnumerable,j=u(function(){return arguments}())?u:function(o){return _(o)&&x.call(o,\"callee\")&&!C.call(o,\"callee\")};o.exports=j},56449:o=>{var s=Array.isArray;o.exports=s},64894:(o,s,i)=>{var u=i(1882),_=i(30294);o.exports=function isArrayLike(o){return null!=o&&_(o.length)&&!u(o)}},83693:(o,s,i)=>{var u=i(64894),_=i(40346);o.exports=function isArrayLikeObject(o){return _(o)&&u(o)}},53812:(o,s,i)=>{var u=i(72552),_=i(40346);o.exports=function isBoolean(o){return!0===o||!1===o||_(o)&&\"[object Boolean]\"==u(o)}},3656:(o,s,i)=>{o=i.nmd(o);var u=i(9325),_=i(89935),w=s&&!s.nodeType&&s,x=w&&o&&!o.nodeType&&o,C=x&&x.exports===w?u.Buffer:void 0,j=(C?C.isBuffer:void 0)||_;o.exports=j},62193:(o,s,i)=>{var u=i(88984),_=i(5861),w=i(72428),x=i(56449),C=i(64894),j=i(3656),L=i(55527),B=i(37167),$=Object.prototype.hasOwnProperty;o.exports=function isEmpty(o){if(null==o)return!0;if(C(o)&&(x(o)||\"string\"==typeof o||\"function\"==typeof o.splice||j(o)||B(o)||w(o)))return!o.length;var s=_(o);if(\"[object Map]\"==s||\"[object Set]\"==s)return!o.size;if(L(o))return!u(o).length;for(var i in o)if($.call(o,i))return!1;return!0}},2404:(o,s,i)=>{var u=i(60270);o.exports=function isEqual(o,s){return u(o,s)}},23546:(o,s,i)=>{var u=i(72552),_=i(40346),w=i(11331);o.exports=function isError(o){if(!_(o))return!1;var s=u(o);return\"[object Error]\"==s||\"[object DOMException]\"==s||\"string\"==typeof o.message&&\"string\"==typeof o.name&&!w(o)}},1882:(o,s,i)=>{var u=i(72552),_=i(23805);o.exports=function isFunction(o){if(!_(o))return!1;var s=u(o);return\"[object Function]\"==s||\"[object GeneratorFunction]\"==s||\"[object AsyncFunction]\"==s||\"[object Proxy]\"==s}},30294:o=>{o.exports=function isLength(o){return\"number\"==typeof o&&o>-1&&o%1==0&&o<=9007199254740991}},87730:(o,s,i)=>{var u=i(29172),_=i(27301),w=i(86009),x=w&&w.isMap,C=x?_(x):u;o.exports=C},5187:o=>{o.exports=function isNull(o){return null===o}},98023:(o,s,i)=>{var u=i(72552),_=i(40346);o.exports=function isNumber(o){return\"number\"==typeof o||_(o)&&\"[object Number]\"==u(o)}},23805:o=>{o.exports=function isObject(o){var s=typeof o;return null!=o&&(\"object\"==s||\"function\"==s)}},40346:o=>{o.exports=function isObjectLike(o){return null!=o&&\"object\"==typeof o}},11331:(o,s,i)=>{var u=i(72552),_=i(28879),w=i(40346),x=Function.prototype,C=Object.prototype,j=x.toString,L=C.hasOwnProperty,B=j.call(Object);o.exports=function isPlainObject(o){if(!w(o)||\"[object Object]\"!=u(o))return!1;var s=_(o);if(null===s)return!0;var i=L.call(s,\"constructor\")&&s.constructor;return\"function\"==typeof i&&i instanceof i&&j.call(i)==B}},38440:(o,s,i)=>{var u=i(16038),_=i(27301),w=i(86009),x=w&&w.isSet,C=x?_(x):u;o.exports=C},85015:(o,s,i)=>{var u=i(72552),_=i(56449),w=i(40346);o.exports=function isString(o){return\"string\"==typeof o||!_(o)&&w(o)&&\"[object String]\"==u(o)}},44394:(o,s,i)=>{var u=i(72552),_=i(40346);o.exports=function isSymbol(o){return\"symbol\"==typeof o||_(o)&&\"[object Symbol]\"==u(o)}},37167:(o,s,i)=>{var u=i(4901),_=i(27301),w=i(86009),x=w&&w.isTypedArray,C=x?_(x):u;o.exports=C},47886:(o,s,i)=>{var u=i(5861),_=i(40346);o.exports=function isWeakMap(o){return _(o)&&\"[object WeakMap]\"==u(o)}},33855:(o,s,i)=>{var u=i(9999),_=i(15389);o.exports=function iteratee(o){return _(\"function\"==typeof o?o:u(o,1))}},95950:(o,s,i)=>{var u=i(70695),_=i(88984),w=i(64894);o.exports=function keys(o){return w(o)?u(o):_(o)}},37241:(o,s,i)=>{var u=i(70695),_=i(72903),w=i(64894);o.exports=function keysIn(o){return w(o)?u(o,!0):_(o)}},68090:o=>{o.exports=function last(o){var s=null==o?0:o.length;return s?o[s-1]:void 0}},50104:(o,s,i)=>{var u=i(53661);function memoize(o,s){if(\"function\"!=typeof o||null!=s&&\"function\"!=typeof s)throw new TypeError(\"Expected a function\");var memoized=function(){var i=arguments,u=s?s.apply(this,i):i[0],_=memoized.cache;if(_.has(u))return _.get(u);var w=o.apply(this,i);return memoized.cache=_.set(u,w)||_,w};return memoized.cache=new(memoize.Cache||u),memoized}memoize.Cache=u,o.exports=memoize},55364:(o,s,i)=>{var u=i(85250),_=i(20999)((function(o,s,i){u(o,s,i)}));o.exports=_},6048:o=>{o.exports=function negate(o){if(\"function\"!=typeof o)throw new TypeError(\"Expected a function\");return function(){var s=arguments;switch(s.length){case 0:return!o.call(this);case 1:return!o.call(this,s[0]);case 2:return!o.call(this,s[0],s[1]);case 3:return!o.call(this,s[0],s[1],s[2])}return!o.apply(this,s)}}},63950:o=>{o.exports=function noop(){}},10124:(o,s,i)=>{var u=i(9325);o.exports=function(){return u.Date.now()}},90179:(o,s,i)=>{var u=i(34932),_=i(9999),w=i(19931),x=i(31769),C=i(21791),j=i(53138),L=i(38816),B=i(83349),$=L((function(o,s){var i={};if(null==o)return i;var L=!1;s=u(s,(function(s){return s=x(s,o),L||(L=s.length>1),s})),C(o,B(o),i),L&&(i=_(i,7,j));for(var $=s.length;$--;)w(i,s[$]);return i}));o.exports=$},50583:(o,s,i)=>{var u=i(47237),_=i(17255),w=i(28586),x=i(77797);o.exports=function property(o){return w(o)?u(x(o)):_(o)}},84195:(o,s,i)=>{var u=i(66977),_=i(38816),w=_((function(o,s){return u(o,256,void 0,void 0,void 0,s)}));o.exports=w},40860:(o,s,i)=>{var u=i(40882),_=i(80909),w=i(15389),x=i(85558),C=i(56449);o.exports=function reduce(o,s,i){var j=C(o)?u:x,L=arguments.length<3;return j(o,w(s,4),i,L,_)}},63560:(o,s,i)=>{var u=i(73170);o.exports=function set(o,s,i){return null==o?o:u(o,s,i)}},42426:(o,s,i)=>{var u=i(14248),_=i(15389),w=i(90916),x=i(56449),C=i(36800);o.exports=function some(o,s,i){var j=x(o)?u:w;return i&&C(o,s,i)&&(s=void 0),j(o,_(s,3))}},63345:o=>{o.exports=function stubArray(){return[]}},89935:o=>{o.exports=function stubFalse(){return!1}},17400:(o,s,i)=>{var u=i(99374),_=1/0;o.exports=function toFinite(o){return o?(o=u(o))===_||o===-1/0?17976931348623157e292*(o<0?-1:1):o==o?o:0:0===o?o:0}},61489:(o,s,i)=>{var u=i(17400);o.exports=function toInteger(o){var s=u(o),i=s%1;return s==s?i?s-i:s:0}},80218:(o,s,i)=>{var u=i(13222);o.exports=function toLower(o){return u(o).toLowerCase()}},99374:(o,s,i)=>{var u=i(54128),_=i(23805),w=i(44394),x=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,j=/^0o[0-7]+$/i,L=parseInt;o.exports=function toNumber(o){if(\"number\"==typeof o)return o;if(w(o))return NaN;if(_(o)){var s=\"function\"==typeof o.valueOf?o.valueOf():o;o=_(s)?s+\"\":s}if(\"string\"!=typeof o)return 0===o?o:+o;o=u(o);var i=C.test(o);return i||j.test(o)?L(o.slice(2),i?2:8):x.test(o)?NaN:+o}},42072:(o,s,i)=>{var u=i(34932),_=i(23007),w=i(56449),x=i(44394),C=i(61802),j=i(77797),L=i(13222);o.exports=function toPath(o){return w(o)?u(o,j):x(o)?[o]:_(C(L(o)))}},69884:(o,s,i)=>{var u=i(21791),_=i(37241);o.exports=function toPlainObject(o){return u(o,_(o))}},13222:(o,s,i)=>{var u=i(77556);o.exports=function toString(o){return null==o?\"\":u(o)}},55808:(o,s,i)=>{var u=i(12507)(\"toUpperCase\");o.exports=u},66645:(o,s,i)=>{var u=i(1733),_=i(45434),w=i(13222),x=i(22225);o.exports=function words(o,s,i){return o=w(o),void 0===(s=i?void 0:s)?_(o)?x(o):u(o):o.match(s)||[]}},53758:(o,s,i)=>{var u=i(30980),_=i(56017),w=i(94033),x=i(56449),C=i(40346),j=i(80257),L=Object.prototype.hasOwnProperty;function lodash(o){if(C(o)&&!x(o)&&!(o instanceof u)){if(o instanceof _)return o;if(L.call(o,\"__wrapped__\"))return j(o)}return new _(o)}lodash.prototype=w.prototype,lodash.prototype.constructor=lodash,o.exports=lodash},47248:(o,s,i)=>{var u=i(16547),_=i(51234);o.exports=function zipObject(o,s){return _(o||[],s||[],u)}},43768:(o,s,i)=>{\"use strict\";var u=i(45981),_=i(85587);s.highlight=highlight,s.highlightAuto=function highlightAuto(o,s){var i,x,C,j,L=s||{},B=L.subset||u.listLanguages(),$=L.prefix,V=B.length,U=-1;null==$&&($=w);if(\"string\"!=typeof o)throw _(\"Expected `string` for value, got `%s`\",o);x={relevance:0,language:null,value:[]},i={relevance:0,language:null,value:[]};for(;++U<V;)j=B[U],u.getLanguage(j)&&((C=highlight(j,o,s)).language=j,C.relevance>x.relevance&&(x=C),C.relevance>i.relevance&&(x=i,i=C));x.language&&(i.secondBest=x);return i},s.registerLanguage=function registerLanguage(o,s){u.registerLanguage(o,s)},s.listLanguages=function listLanguages(){return u.listLanguages()},s.registerAlias=function registerAlias(o,s){var i,_=o;s&&((_={})[o]=s);for(i in _)u.registerAliases(_[i],{languageName:i})},Emitter.prototype.addText=function text(o){var s,i,u=this.stack;if(\"\"===o)return;s=u[u.length-1],(i=s.children[s.children.length-1])&&\"text\"===i.type?i.value+=o:s.children.push({type:\"text\",value:o})},Emitter.prototype.addKeyword=function addKeyword(o,s){this.openNode(s),this.addText(o),this.closeNode()},Emitter.prototype.addSublanguage=function addSublanguage(o,s){var i=this.stack,u=i[i.length-1],_=o.rootNode.children,w=s?{type:\"element\",tagName:\"span\",properties:{className:[s]},children:_}:_;u.children=u.children.concat(w)},Emitter.prototype.openNode=function open(o){var s=this.stack,i=this.options.classPrefix+o,u=s[s.length-1],_={type:\"element\",tagName:\"span\",properties:{className:[i]},children:[]};u.children.push(_),s.push(_)},Emitter.prototype.closeNode=function close(){this.stack.pop()},Emitter.prototype.closeAllNodes=noop,Emitter.prototype.finalize=noop,Emitter.prototype.toHTML=function toHtmlNoop(){return\"\"};var w=\"hljs-\";function highlight(o,s,i){var x,C=u.configure({}),j=(i||{}).prefix;if(\"string\"!=typeof o)throw _(\"Expected `string` for name, got `%s`\",o);if(!u.getLanguage(o))throw _(\"Unknown language: `%s` is not registered\",o);if(\"string\"!=typeof s)throw _(\"Expected `string` for value, got `%s`\",s);if(null==j&&(j=w),u.configure({__emitter:Emitter,classPrefix:j}),x=u.highlight(s,{language:o,ignoreIllegals:!0}),u.configure(C||{}),x.errorRaised)throw x.errorRaised;return{relevance:x.relevance,language:x.language,value:x.emitter.rootNode.children}}function Emitter(o){this.options=o,this.rootNode={children:[]},this.stack=[this.rootNode]}function noop(){}},92340:(o,s,i)=>{const u=i(6048);function coerceElementMatchingCallback(o){return\"string\"==typeof o?s=>s.element===o:o.constructor&&o.extend?s=>s instanceof o:o}class ArraySlice{constructor(o){this.elements=o||[]}toValue(){return this.elements.map((o=>o.toValue()))}map(o,s){return this.elements.map(o,s)}flatMap(o,s){return this.map(o,s).reduce(((o,s)=>o.concat(s)),[])}compactMap(o,s){const i=[];return this.forEach((u=>{const _=o.bind(s)(u);_&&i.push(_)})),i}filter(o,s){return o=coerceElementMatchingCallback(o),new ArraySlice(this.elements.filter(o,s))}reject(o,s){return o=coerceElementMatchingCallback(o),new ArraySlice(this.elements.filter(u(o),s))}find(o,s){return o=coerceElementMatchingCallback(o),this.elements.find(o,s)}forEach(o,s){this.elements.forEach(o,s)}reduce(o,s){return this.elements.reduce(o,s)}includes(o){return this.elements.some((s=>s.equals(o)))}shift(){return this.elements.shift()}unshift(o){this.elements.unshift(this.refract(o))}push(o){return this.elements.push(this.refract(o)),this}add(o){this.push(o)}get(o){return this.elements[o]}getValue(o){const s=this.elements[o];if(s)return s.toValue()}get length(){return this.elements.length}get isEmpty(){return 0===this.elements.length}get first(){return this.elements[0]}}\"undefined\"!=typeof Symbol&&(ArraySlice.prototype[Symbol.iterator]=function symbol(){return this.elements[Symbol.iterator]()}),o.exports=ArraySlice},55973:o=>{class KeyValuePair{constructor(o,s){this.key=o,this.value=s}clone(){const o=new KeyValuePair;return this.key&&(o.key=this.key.clone()),this.value&&(o.value=this.value.clone()),o}}o.exports=KeyValuePair},3110:(o,s,i)=>{const u=i(5187),_=i(85015),w=i(98023),x=i(53812),C=i(23805),j=i(85105),L=i(86804);class Namespace{constructor(o){this.elementMap={},this.elementDetection=[],this.Element=L.Element,this.KeyValuePair=L.KeyValuePair,o&&o.noDefault||this.useDefault(),this._attributeElementKeys=[],this._attributeElementArrayKeys=[]}use(o){return o.namespace&&o.namespace({base:this}),o.load&&o.load({base:this}),this}useDefault(){return this.register(\"null\",L.NullElement).register(\"string\",L.StringElement).register(\"number\",L.NumberElement).register(\"boolean\",L.BooleanElement).register(\"array\",L.ArrayElement).register(\"object\",L.ObjectElement).register(\"member\",L.MemberElement).register(\"ref\",L.RefElement).register(\"link\",L.LinkElement),this.detect(u,L.NullElement,!1).detect(_,L.StringElement,!1).detect(w,L.NumberElement,!1).detect(x,L.BooleanElement,!1).detect(Array.isArray,L.ArrayElement,!1).detect(C,L.ObjectElement,!1),this}register(o,s){return this._elements=void 0,this.elementMap[o]=s,this}unregister(o){return this._elements=void 0,delete this.elementMap[o],this}detect(o,s,i){return void 0===i||i?this.elementDetection.unshift([o,s]):this.elementDetection.push([o,s]),this}toElement(o){if(o instanceof this.Element)return o;let s;for(let i=0;i<this.elementDetection.length;i+=1){const u=this.elementDetection[i][0],_=this.elementDetection[i][1];if(u(o)){s=new _(o);break}}return s}getElementClass(o){const s=this.elementMap[o];return void 0===s?this.Element:s}fromRefract(o){return this.serialiser.deserialise(o)}toRefract(o){return this.serialiser.serialise(o)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach((o=>{const s=o[0].toUpperCase()+o.substr(1);this._elements[s]=this.elementMap[o]}))),this._elements}get serialiser(){return new j(this)}}j.prototype.Namespace=Namespace,o.exports=Namespace},10866:(o,s,i)=>{const u=i(6048),_=i(92340);class ObjectSlice extends _{map(o,s){return this.elements.map((i=>o.bind(s)(i.value,i.key,i)))}filter(o,s){return new ObjectSlice(this.elements.filter((i=>o.bind(s)(i.value,i.key,i))))}reject(o,s){return this.filter(u(o.bind(s)))}forEach(o,s){return this.elements.forEach(((i,u)=>{o.bind(s)(i.value,i.key,i,u)}))}keys(){return this.map(((o,s)=>s.toValue()))}values(){return this.map((o=>o.toValue()))}}o.exports=ObjectSlice},86804:(o,s,i)=>{const u=i(10316),_=i(41067),w=i(71167),x=i(40239),C=i(12242),j=i(6233),L=i(87726),B=i(61045),$=i(86303),V=i(14540),U=i(92340),z=i(10866),Y=i(55973);function refract(o){if(o instanceof u)return o;if(\"string\"==typeof o)return new w(o);if(\"number\"==typeof o)return new x(o);if(\"boolean\"==typeof o)return new C(o);if(null===o)return new _;if(Array.isArray(o))return new j(o.map(refract));if(\"object\"==typeof o){return new B(o)}return o}u.prototype.ObjectElement=B,u.prototype.RefElement=V,u.prototype.MemberElement=L,u.prototype.refract=refract,U.prototype.refract=refract,o.exports={Element:u,NullElement:_,StringElement:w,NumberElement:x,BooleanElement:C,ArrayElement:j,MemberElement:L,ObjectElement:B,LinkElement:$,RefElement:V,refract,ArraySlice:U,ObjectSlice:z,KeyValuePair:Y}},86303:(o,s,i)=>{const u=i(10316);o.exports=class LinkElement extends u{constructor(o,s,i){super(o||[],s,i),this.element=\"link\"}get relation(){return this.attributes.get(\"relation\")}set relation(o){this.attributes.set(\"relation\",o)}get href(){return this.attributes.get(\"href\")}set href(o){this.attributes.set(\"href\",o)}}},14540:(o,s,i)=>{const u=i(10316);o.exports=class RefElement extends u{constructor(o,s,i){super(o||[],s,i),this.element=\"ref\",this.path||(this.path=\"element\")}get path(){return this.attributes.get(\"path\")}set path(o){this.attributes.set(\"path\",o)}}},34035:(o,s,i)=>{const u=i(3110),_=i(86804);s.g$=u,s.KeyValuePair=i(55973),s.G6=_.ArraySlice,s.ot=_.ObjectSlice,s.Hg=_.Element,s.Om=_.StringElement,s.kT=_.NumberElement,s.bd=_.BooleanElement,s.Os=_.NullElement,s.wE=_.ArrayElement,s.Sh=_.ObjectElement,s.Pr=_.MemberElement,s.sI=_.RefElement,s.Ft=_.LinkElement,s.e=_.refract,i(85105),i(75147)},6233:(o,s,i)=>{const u=i(6048),_=i(10316),w=i(92340);class ArrayElement extends _{constructor(o,s,i){super(o||[],s,i),this.element=\"array\"}primitive(){return\"array\"}get(o){return this.content[o]}getValue(o){const s=this.get(o);if(s)return s.toValue()}getIndex(o){return this.content[o]}set(o,s){return this.content[o]=this.refract(s),this}remove(o){const s=this.content.splice(o,1);return s.length?s[0]:null}map(o,s){return this.content.map(o,s)}flatMap(o,s){return this.map(o,s).reduce(((o,s)=>o.concat(s)),[])}compactMap(o,s){const i=[];return this.forEach((u=>{const _=o.bind(s)(u);_&&i.push(_)})),i}filter(o,s){return new w(this.content.filter(o,s))}reject(o,s){return this.filter(u(o),s)}reduce(o,s){let i,u;void 0!==s?(i=0,u=this.refract(s)):(i=1,u=\"object\"===this.primitive()?this.first.value:this.first);for(let s=i;s<this.length;s+=1){const i=this.content[s];u=\"object\"===this.primitive()?this.refract(o(u,i.value,i.key,i,this)):this.refract(o(u,i,s,this))}return u}forEach(o,s){this.content.forEach(((i,u)=>{o.bind(s)(i,this.refract(u))}))}shift(){return this.content.shift()}unshift(o){this.content.unshift(this.refract(o))}push(o){return this.content.push(this.refract(o)),this}add(o){this.push(o)}findElements(o,s){const i=s||{},u=!!i.recursive,_=void 0===i.results?[]:i.results;return this.forEach(((s,i,w)=>{u&&void 0!==s.findElements&&s.findElements(o,{results:_,recursive:u}),o(s,i,w)&&_.push(s)})),_}find(o){return new w(this.findElements(o,{recursive:!0}))}findByElement(o){return this.find((s=>s.element===o))}findByClass(o){return this.find((s=>s.classes.includes(o)))}getById(o){return this.find((s=>s.id.toValue()===o)).first}includes(o){return this.content.some((s=>s.equals(o)))}contains(o){return this.includes(o)}empty(){return new this.constructor([])}\"fantasy-land/empty\"(){return this.empty()}concat(o){return new this.constructor(this.content.concat(o.content))}\"fantasy-land/concat\"(o){return this.concat(o)}\"fantasy-land/map\"(o){return new this.constructor(this.map(o))}\"fantasy-land/chain\"(o){return this.map((s=>o(s)),this).reduce(((o,s)=>o.concat(s)),this.empty())}\"fantasy-land/filter\"(o){return new this.constructor(this.content.filter(o))}\"fantasy-land/reduce\"(o,s){return this.content.reduce(o,s)}get length(){return this.content.length}get isEmpty(){return 0===this.content.length}get first(){return this.getIndex(0)}get second(){return this.getIndex(1)}get last(){return this.getIndex(this.length-1)}}ArrayElement.empty=function empty(){return new this},ArrayElement[\"fantasy-land/empty\"]=ArrayElement.empty,\"undefined\"!=typeof Symbol&&(ArrayElement.prototype[Symbol.iterator]=function symbol(){return this.content[Symbol.iterator]()}),o.exports=ArrayElement},12242:(o,s,i)=>{const u=i(10316);o.exports=class BooleanElement extends u{constructor(o,s,i){super(o,s,i),this.element=\"boolean\"}primitive(){return\"boolean\"}}},10316:(o,s,i)=>{const u=i(2404),_=i(55973),w=i(92340);class Element{constructor(o,s,i){s&&(this.meta=s),i&&(this.attributes=i),this.content=o}freeze(){Object.isFrozen(this)||(this._meta&&(this.meta.parent=this,this.meta.freeze()),this._attributes&&(this.attributes.parent=this,this.attributes.freeze()),this.children.forEach((o=>{o.parent=this,o.freeze()}),this),this.content&&Array.isArray(this.content)&&Object.freeze(this.content),Object.freeze(this))}primitive(){}clone(){const o=new this.constructor;return o.element=this.element,this.meta.length&&(o._meta=this.meta.clone()),this.attributes.length&&(o._attributes=this.attributes.clone()),this.content?this.content.clone?o.content=this.content.clone():Array.isArray(this.content)?o.content=this.content.map((o=>o.clone())):o.content=this.content:o.content=this.content,o}toValue(){return this.content instanceof Element?this.content.toValue():this.content instanceof _?{key:this.content.key.toValue(),value:this.content.value?this.content.value.toValue():void 0}:this.content&&this.content.map?this.content.map((o=>o.toValue()),this):this.content}toRef(o){if(\"\"===this.id.toValue())throw Error(\"Cannot create reference to an element that does not contain an ID\");const s=new this.RefElement(this.id.toValue());return o&&(s.path=o),s}findRecursive(...o){if(arguments.length>1&&!this.isFrozen)throw new Error(\"Cannot find recursive with multiple element names without first freezing the element. Call `element.freeze()`\");const s=o.pop();let i=new w;const append=(o,s)=>(o.push(s),o),checkElement=(o,i)=>{i.element===s&&o.push(i);const u=i.findRecursive(s);return u&&u.reduce(append,o),i.content instanceof _&&(i.content.key&&checkElement(o,i.content.key),i.content.value&&checkElement(o,i.content.value)),o};return this.content&&(this.content.element&&checkElement(i,this.content),Array.isArray(this.content)&&this.content.reduce(checkElement,i)),o.isEmpty||(i=i.filter((s=>{let i=s.parents.map((o=>o.element));for(const s in o){const u=o[s],_=i.indexOf(u);if(-1===_)return!1;i=i.splice(0,_)}return!0}))),i}set(o){return this.content=o,this}equals(o){return u(this.toValue(),o)}getMetaProperty(o,s){if(!this.meta.hasKey(o)){if(this.isFrozen){const o=this.refract(s);return o.freeze(),o}this.meta.set(o,s)}return this.meta.get(o)}setMetaProperty(o,s){this.meta.set(o,s)}get element(){return this._storedElement||\"element\"}set element(o){this._storedElement=o}get content(){return this._content}set content(o){if(o instanceof Element)this._content=o;else if(o instanceof w)this.content=o.elements;else if(\"string\"==typeof o||\"number\"==typeof o||\"boolean\"==typeof o||\"null\"===o||null==o)this._content=o;else if(o instanceof _)this._content=o;else if(Array.isArray(o))this._content=o.map(this.refract);else{if(\"object\"!=typeof o)throw new Error(\"Cannot set content to given value\");this._content=Object.keys(o).map((s=>new this.MemberElement(s,o[s])))}}get meta(){if(!this._meta){if(this.isFrozen){const o=new this.ObjectElement;return o.freeze(),o}this._meta=new this.ObjectElement}return this._meta}set meta(o){o instanceof this.ObjectElement?this._meta=o:this.meta.set(o||{})}get attributes(){if(!this._attributes){if(this.isFrozen){const o=new this.ObjectElement;return o.freeze(),o}this._attributes=new this.ObjectElement}return this._attributes}set attributes(o){o instanceof this.ObjectElement?this._attributes=o:this.attributes.set(o||{})}get id(){return this.getMetaProperty(\"id\",\"\")}set id(o){this.setMetaProperty(\"id\",o)}get classes(){return this.getMetaProperty(\"classes\",[])}set classes(o){this.setMetaProperty(\"classes\",o)}get title(){return this.getMetaProperty(\"title\",\"\")}set title(o){this.setMetaProperty(\"title\",o)}get description(){return this.getMetaProperty(\"description\",\"\")}set description(o){this.setMetaProperty(\"description\",o)}get links(){return this.getMetaProperty(\"links\",[])}set links(o){this.setMetaProperty(\"links\",o)}get isFrozen(){return Object.isFrozen(this)}get parents(){let{parent:o}=this;const s=new w;for(;o;)s.push(o),o=o.parent;return s}get children(){if(Array.isArray(this.content))return new w(this.content);if(this.content instanceof _){const o=new w([this.content.key]);return this.content.value&&o.push(this.content.value),o}return this.content instanceof Element?new w([this.content]):new w}get recursiveChildren(){const o=new w;return this.children.forEach((s=>{o.push(s),s.recursiveChildren.forEach((s=>{o.push(s)}))})),o}}o.exports=Element},87726:(o,s,i)=>{const u=i(55973),_=i(10316);o.exports=class MemberElement extends _{constructor(o,s,i,_){super(new u,i,_),this.element=\"member\",this.key=o,this.value=s}get key(){return this.content.key}set key(o){this.content.key=this.refract(o)}get value(){return this.content.value}set value(o){this.content.value=this.refract(o)}}},41067:(o,s,i)=>{const u=i(10316);o.exports=class NullElement extends u{constructor(o,s,i){super(o||null,s,i),this.element=\"null\"}primitive(){return\"null\"}set(){return new Error(\"Cannot set the value of null\")}}},40239:(o,s,i)=>{const u=i(10316);o.exports=class NumberElement extends u{constructor(o,s,i){super(o,s,i),this.element=\"number\"}primitive(){return\"number\"}}},61045:(o,s,i)=>{const u=i(6048),_=i(23805),w=i(6233),x=i(87726),C=i(10866);o.exports=class ObjectElement extends w{constructor(o,s,i){super(o||[],s,i),this.element=\"object\"}primitive(){return\"object\"}toValue(){return this.content.reduce(((o,s)=>(o[s.key.toValue()]=s.value?s.value.toValue():void 0,o)),{})}get(o){const s=this.getMember(o);if(s)return s.value}getMember(o){if(void 0!==o)return this.content.find((s=>s.key.toValue()===o))}remove(o){let s=null;return this.content=this.content.filter((i=>i.key.toValue()!==o||(s=i,!1))),s}getKey(o){const s=this.getMember(o);if(s)return s.key}set(o,s){if(_(o))return Object.keys(o).forEach((s=>{this.set(s,o[s])})),this;const i=o,u=this.getMember(i);return u?u.value=s:this.content.push(new x(i,s)),this}keys(){return this.content.map((o=>o.key.toValue()))}values(){return this.content.map((o=>o.value.toValue()))}hasKey(o){return this.content.some((s=>s.key.equals(o)))}items(){return this.content.map((o=>[o.key.toValue(),o.value.toValue()]))}map(o,s){return this.content.map((i=>o.bind(s)(i.value,i.key,i)))}compactMap(o,s){const i=[];return this.forEach(((u,_,w)=>{const x=o.bind(s)(u,_,w);x&&i.push(x)})),i}filter(o,s){return new C(this.content).filter(o,s)}reject(o,s){return this.filter(u(o),s)}forEach(o,s){return this.content.forEach((i=>o.bind(s)(i.value,i.key,i)))}}},71167:(o,s,i)=>{const u=i(10316);o.exports=class StringElement extends u{constructor(o,s,i){super(o,s,i),this.element=\"string\"}primitive(){return\"string\"}get length(){return this.content.length}}},75147:(o,s,i)=>{const u=i(85105);o.exports=class JSON06Serialiser extends u{serialise(o){if(!(o instanceof this.namespace.elements.Element))throw new TypeError(`Given element \\`${o}\\` is not an Element instance`);let s;o._attributes&&o.attributes.get(\"variable\")&&(s=o.attributes.get(\"variable\"));const i={element:o.element};o._meta&&o._meta.length>0&&(i.meta=this.serialiseObject(o.meta));const u=\"enum\"===o.element||-1!==o.attributes.keys().indexOf(\"enumerations\");if(u){const s=this.enumSerialiseAttributes(o);s&&(i.attributes=s)}else if(o._attributes&&o._attributes.length>0){let{attributes:u}=o;u.get(\"metadata\")&&(u=u.clone(),u.set(\"meta\",u.get(\"metadata\")),u.remove(\"metadata\")),\"member\"===o.element&&s&&(u=u.clone(),u.remove(\"variable\")),u.length>0&&(i.attributes=this.serialiseObject(u))}if(u)i.content=this.enumSerialiseContent(o,i);else if(this[`${o.element}SerialiseContent`])i.content=this[`${o.element}SerialiseContent`](o,i);else if(void 0!==o.content){let u;s&&o.content.key?(u=o.content.clone(),u.key.attributes.set(\"variable\",s),u=this.serialiseContent(u)):u=this.serialiseContent(o.content),this.shouldSerialiseContent(o,u)&&(i.content=u)}else this.shouldSerialiseContent(o,o.content)&&o instanceof this.namespace.elements.Array&&(i.content=[]);return i}shouldSerialiseContent(o,s){return\"parseResult\"===o.element||\"httpRequest\"===o.element||\"httpResponse\"===o.element||\"category\"===o.element||\"link\"===o.element||void 0!==s&&(!Array.isArray(s)||0!==s.length)}refSerialiseContent(o,s){return delete s.attributes,{href:o.toValue(),path:o.path.toValue()}}sourceMapSerialiseContent(o){return o.toValue()}dataStructureSerialiseContent(o){return[this.serialiseContent(o.content)]}enumSerialiseAttributes(o){const s=o.attributes.clone(),i=s.remove(\"enumerations\")||new this.namespace.elements.Array([]),u=s.get(\"default\");let _=s.get(\"samples\")||new this.namespace.elements.Array([]);if(u&&u.content&&(u.content.attributes&&u.content.attributes.remove(\"typeAttributes\"),s.set(\"default\",new this.namespace.elements.Array([u.content]))),_.forEach((o=>{o.content&&o.content.element&&o.content.attributes.remove(\"typeAttributes\")})),o.content&&0!==i.length&&_.unshift(o.content),_=_.map((o=>o instanceof this.namespace.elements.Array?[o]:new this.namespace.elements.Array([o.content]))),_.length&&s.set(\"samples\",_),s.length>0)return this.serialiseObject(s)}enumSerialiseContent(o){if(o._attributes){const s=o.attributes.get(\"enumerations\");if(s&&s.length>0)return s.content.map((o=>{const s=o.clone();return s.attributes.remove(\"typeAttributes\"),this.serialise(s)}))}if(o.content){const s=o.content.clone();return s.attributes.remove(\"typeAttributes\"),[this.serialise(s)]}return[]}deserialise(o){if(\"string\"==typeof o)return new this.namespace.elements.String(o);if(\"number\"==typeof o)return new this.namespace.elements.Number(o);if(\"boolean\"==typeof o)return new this.namespace.elements.Boolean(o);if(null===o)return new this.namespace.elements.Null;if(Array.isArray(o))return new this.namespace.elements.Array(o.map(this.deserialise,this));const s=this.namespace.getElementClass(o.element),i=new s;i.element!==o.element&&(i.element=o.element),o.meta&&this.deserialiseObject(o.meta,i.meta),o.attributes&&this.deserialiseObject(o.attributes,i.attributes);const u=this.deserialiseContent(o.content);if(void 0===u&&null!==i.content||(i.content=u),\"enum\"===i.element){i.content&&i.attributes.set(\"enumerations\",i.content);let o=i.attributes.get(\"samples\");if(i.attributes.remove(\"samples\"),o){const u=o;o=new this.namespace.elements.Array,u.forEach((u=>{u.forEach((u=>{const _=new s(u);_.element=i.element,o.push(_)}))}));const _=o.shift();i.content=_?_.content:void 0,i.attributes.set(\"samples\",o)}else i.content=void 0;let u=i.attributes.get(\"default\");if(u&&u.length>0){u=u.get(0);const o=new s(u);o.element=i.element,i.attributes.set(\"default\",o)}}else if(\"dataStructure\"===i.element&&Array.isArray(i.content))[i.content]=i.content;else if(\"category\"===i.element){const o=i.attributes.get(\"meta\");o&&(i.attributes.set(\"metadata\",o),i.attributes.remove(\"meta\"))}else\"member\"===i.element&&i.key&&i.key._attributes&&i.key._attributes.getValue(\"variable\")&&(i.attributes.set(\"variable\",i.key.attributes.get(\"variable\")),i.key.attributes.remove(\"variable\"));return i}serialiseContent(o){if(o instanceof this.namespace.elements.Element)return this.serialise(o);if(o instanceof this.namespace.KeyValuePair){const s={key:this.serialise(o.key)};return o.value&&(s.value=this.serialise(o.value)),s}return o&&o.map?o.map(this.serialise,this):o}deserialiseContent(o){if(o){if(o.element)return this.deserialise(o);if(o.key){const s=new this.namespace.KeyValuePair(this.deserialise(o.key));return o.value&&(s.value=this.deserialise(o.value)),s}if(o.map)return o.map(this.deserialise,this)}return o}shouldRefract(o){return!!(o._attributes&&o.attributes.keys().length||o._meta&&o.meta.keys().length)||\"enum\"!==o.element&&(o.element!==o.primitive()||\"member\"===o.element)}convertKeyToRefract(o,s){return this.shouldRefract(s)?this.serialise(s):\"enum\"===s.element?this.serialiseEnum(s):\"array\"===s.element?s.map((s=>this.shouldRefract(s)||\"default\"===o?this.serialise(s):\"array\"===s.element||\"object\"===s.element||\"enum\"===s.element?s.children.map((o=>this.serialise(o))):s.toValue())):\"object\"===s.element?(s.content||[]).map(this.serialise,this):s.toValue()}serialiseEnum(o){return o.children.map((o=>this.serialise(o)))}serialiseObject(o){const s={};return o.forEach(((o,i)=>{if(o){const u=i.toValue();s[u]=this.convertKeyToRefract(u,o)}})),s}deserialiseObject(o,s){Object.keys(o).forEach((i=>{s.set(i,this.deserialise(o[i]))}))}}},85105:o=>{o.exports=class JSONSerialiser{constructor(o){this.namespace=o||new this.Namespace}serialise(o){if(!(o instanceof this.namespace.elements.Element))throw new TypeError(`Given element \\`${o}\\` is not an Element instance`);const s={element:o.element};o._meta&&o._meta.length>0&&(s.meta=this.serialiseObject(o.meta)),o._attributes&&o._attributes.length>0&&(s.attributes=this.serialiseObject(o.attributes));const i=this.serialiseContent(o.content);return void 0!==i&&(s.content=i),s}deserialise(o){if(!o.element)throw new Error(\"Given value is not an object containing an element name\");const s=new(this.namespace.getElementClass(o.element));s.element!==o.element&&(s.element=o.element),o.meta&&this.deserialiseObject(o.meta,s.meta),o.attributes&&this.deserialiseObject(o.attributes,s.attributes);const i=this.deserialiseContent(o.content);return void 0===i&&null!==s.content||(s.content=i),s}serialiseContent(o){if(o instanceof this.namespace.elements.Element)return this.serialise(o);if(o instanceof this.namespace.KeyValuePair){const s={key:this.serialise(o.key)};return o.value&&(s.value=this.serialise(o.value)),s}if(o&&o.map){if(0===o.length)return;return o.map(this.serialise,this)}return o}deserialiseContent(o){if(o){if(o.element)return this.deserialise(o);if(o.key){const s=new this.namespace.KeyValuePair(this.deserialise(o.key));return o.value&&(s.value=this.deserialise(o.value)),s}if(o.map)return o.map(this.deserialise,this)}return o}serialiseObject(o){const s={};if(o.forEach(((o,i)=>{o&&(s[i.toValue()]=this.serialise(o))})),0!==Object.keys(s).length)return s}deserialiseObject(o,s){Object.keys(o).forEach((i=>{s.set(i,this.deserialise(o[i]))}))}}},58859:(o,s,i)=>{var u=\"function\"==typeof Map&&Map.prototype,_=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Map.prototype,\"size\"):null,w=u&&_&&\"function\"==typeof _.get?_.get:null,x=u&&Map.prototype.forEach,C=\"function\"==typeof Set&&Set.prototype,j=Object.getOwnPropertyDescriptor&&C?Object.getOwnPropertyDescriptor(Set.prototype,\"size\"):null,L=C&&j&&\"function\"==typeof j.get?j.get:null,B=C&&Set.prototype.forEach,$=\"function\"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,V=\"function\"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,U=\"function\"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,z=Boolean.prototype.valueOf,Y=Object.prototype.toString,Z=Function.prototype.toString,ee=String.prototype.match,ie=String.prototype.slice,ae=String.prototype.replace,ce=String.prototype.toUpperCase,le=String.prototype.toLowerCase,pe=RegExp.prototype.test,de=Array.prototype.concat,fe=Array.prototype.join,ye=Array.prototype.slice,be=Math.floor,_e=\"function\"==typeof BigInt?BigInt.prototype.valueOf:null,we=Object.getOwnPropertySymbols,Se=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?Symbol.prototype.toString:null,xe=\"function\"==typeof Symbol&&\"object\"==typeof Symbol.iterator,Pe=\"function\"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===xe||\"symbol\")?Symbol.toStringTag:null,Te=Object.prototype.propertyIsEnumerable,Re=(\"function\"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(o){return o.__proto__}:null);function addNumericSeparator(o,s){if(o===1/0||o===-1/0||o!=o||o&&o>-1e3&&o<1e3||pe.call(/e/,s))return s;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(\"number\"==typeof o){var u=o<0?-be(-o):be(o);if(u!==o){var _=String(u),w=ie.call(s,_.length+1);return ae.call(_,i,\"$&_\")+\".\"+ae.call(ae.call(w,/([0-9]{3})/g,\"$&_\"),/_$/,\"\")}}return ae.call(s,i,\"$&_\")}var qe=i(42634),$e=qe.custom,ze=isSymbol($e)?$e:null;function wrapQuotes(o,s,i){var u=\"double\"===(i.quoteStyle||s)?'\"':\"'\";return u+o+u}function quote(o){return ae.call(String(o),/\"/g,\"&quot;\")}function isArray(o){return!(\"[object Array]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}function isRegExp(o){return!(\"[object RegExp]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}function isSymbol(o){if(xe)return o&&\"object\"==typeof o&&o instanceof Symbol;if(\"symbol\"==typeof o)return!0;if(!o||\"object\"!=typeof o||!Se)return!1;try{return Se.call(o),!0}catch(o){}return!1}o.exports=function inspect_(o,s,u,_){var C=s||{};if(has(C,\"quoteStyle\")&&\"single\"!==C.quoteStyle&&\"double\"!==C.quoteStyle)throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');if(has(C,\"maxStringLength\")&&(\"number\"==typeof C.maxStringLength?C.maxStringLength<0&&C.maxStringLength!==1/0:null!==C.maxStringLength))throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');var j=!has(C,\"customInspect\")||C.customInspect;if(\"boolean\"!=typeof j&&\"symbol\"!==j)throw new TypeError(\"option \\\"customInspect\\\", if provided, must be `true`, `false`, or `'symbol'`\");if(has(C,\"indent\")&&null!==C.indent&&\"\\t\"!==C.indent&&!(parseInt(C.indent,10)===C.indent&&C.indent>0))throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');if(has(C,\"numericSeparator\")&&\"boolean\"!=typeof C.numericSeparator)throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');var Y=C.numericSeparator;if(void 0===o)return\"undefined\";if(null===o)return\"null\";if(\"boolean\"==typeof o)return o?\"true\":\"false\";if(\"string\"==typeof o)return inspectString(o,C);if(\"number\"==typeof o){if(0===o)return 1/0/o>0?\"0\":\"-0\";var ce=String(o);return Y?addNumericSeparator(o,ce):ce}if(\"bigint\"==typeof o){var pe=String(o)+\"n\";return Y?addNumericSeparator(o,pe):pe}var be=void 0===C.depth?5:C.depth;if(void 0===u&&(u=0),u>=be&&be>0&&\"object\"==typeof o)return isArray(o)?\"[Array]\":\"[Object]\";var we=function getIndent(o,s){var i;if(\"\\t\"===o.indent)i=\"\\t\";else{if(!(\"number\"==typeof o.indent&&o.indent>0))return null;i=fe.call(Array(o.indent+1),\" \")}return{base:i,prev:fe.call(Array(s+1),i)}}(C,u);if(void 0===_)_=[];else if(indexOf(_,o)>=0)return\"[Circular]\";function inspect(o,s,i){if(s&&(_=ye.call(_)).push(s),i){var w={depth:C.depth};return has(C,\"quoteStyle\")&&(w.quoteStyle=C.quoteStyle),inspect_(o,w,u+1,_)}return inspect_(o,C,u+1,_)}if(\"function\"==typeof o&&!isRegExp(o)){var $e=function nameOf(o){if(o.name)return o.name;var s=ee.call(Z.call(o),/^function\\s*([\\w$]+)/);if(s)return s[1];return null}(o),We=arrObjKeys(o,inspect);return\"[Function\"+($e?\": \"+$e:\" (anonymous)\")+\"]\"+(We.length>0?\" { \"+fe.call(We,\", \")+\" }\":\"\")}if(isSymbol(o)){var He=xe?ae.call(String(o),/^(Symbol\\(.*\\))_[^)]*$/,\"$1\"):Se.call(o);return\"object\"!=typeof o||xe?He:markBoxed(He)}if(function isElement(o){if(!o||\"object\"!=typeof o)return!1;if(\"undefined\"!=typeof HTMLElement&&o instanceof HTMLElement)return!0;return\"string\"==typeof o.nodeName&&\"function\"==typeof o.getAttribute}(o)){for(var Ye=\"<\"+le.call(String(o.nodeName)),Xe=o.attributes||[],Qe=0;Qe<Xe.length;Qe++)Ye+=\" \"+Xe[Qe].name+\"=\"+wrapQuotes(quote(Xe[Qe].value),\"double\",C);return Ye+=\">\",o.childNodes&&o.childNodes.length&&(Ye+=\"...\"),Ye+=\"</\"+le.call(String(o.nodeName))+\">\"}if(isArray(o)){if(0===o.length)return\"[]\";var et=arrObjKeys(o,inspect);return we&&!function singleLineValues(o){for(var s=0;s<o.length;s++)if(indexOf(o[s],\"\\n\")>=0)return!1;return!0}(et)?\"[\"+indentedJoin(et,we)+\"]\":\"[ \"+fe.call(et,\", \")+\" ]\"}if(function isError(o){return!(\"[object Error]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o)){var tt=arrObjKeys(o,inspect);return\"cause\"in Error.prototype||!(\"cause\"in o)||Te.call(o,\"cause\")?0===tt.length?\"[\"+String(o)+\"]\":\"{ [\"+String(o)+\"] \"+fe.call(tt,\", \")+\" }\":\"{ [\"+String(o)+\"] \"+fe.call(de.call(\"[cause]: \"+inspect(o.cause),tt),\", \")+\" }\"}if(\"object\"==typeof o&&j){if(ze&&\"function\"==typeof o[ze]&&qe)return qe(o,{depth:be-u});if(\"symbol\"!==j&&\"function\"==typeof o.inspect)return o.inspect()}if(function isMap(o){if(!w||!o||\"object\"!=typeof o)return!1;try{w.call(o);try{L.call(o)}catch(o){return!0}return o instanceof Map}catch(o){}return!1}(o)){var rt=[];return x&&x.call(o,(function(s,i){rt.push(inspect(i,o,!0)+\" => \"+inspect(s,o))})),collectionOf(\"Map\",w.call(o),rt,we)}if(function isSet(o){if(!L||!o||\"object\"!=typeof o)return!1;try{L.call(o);try{w.call(o)}catch(o){return!0}return o instanceof Set}catch(o){}return!1}(o)){var nt=[];return B&&B.call(o,(function(s){nt.push(inspect(s,o))})),collectionOf(\"Set\",L.call(o),nt,we)}if(function isWeakMap(o){if(!$||!o||\"object\"!=typeof o)return!1;try{$.call(o,$);try{V.call(o,V)}catch(o){return!0}return o instanceof WeakMap}catch(o){}return!1}(o))return weakCollectionOf(\"WeakMap\");if(function isWeakSet(o){if(!V||!o||\"object\"!=typeof o)return!1;try{V.call(o,V);try{$.call(o,$)}catch(o){return!0}return o instanceof WeakSet}catch(o){}return!1}(o))return weakCollectionOf(\"WeakSet\");if(function isWeakRef(o){if(!U||!o||\"object\"!=typeof o)return!1;try{return U.call(o),!0}catch(o){}return!1}(o))return weakCollectionOf(\"WeakRef\");if(function isNumber(o){return!(\"[object Number]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o))return markBoxed(inspect(Number(o)));if(function isBigInt(o){if(!o||\"object\"!=typeof o||!_e)return!1;try{return _e.call(o),!0}catch(o){}return!1}(o))return markBoxed(inspect(_e.call(o)));if(function isBoolean(o){return!(\"[object Boolean]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o))return markBoxed(z.call(o));if(function isString(o){return!(\"[object String]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o))return markBoxed(inspect(String(o)));if(\"undefined\"!=typeof window&&o===window)return\"{ [object Window] }\";if(o===i.g)return\"{ [object globalThis] }\";if(!function isDate(o){return!(\"[object Date]\"!==toStr(o)||Pe&&\"object\"==typeof o&&Pe in o)}(o)&&!isRegExp(o)){var ot=arrObjKeys(o,inspect),st=Re?Re(o)===Object.prototype:o instanceof Object||o.constructor===Object,it=o instanceof Object?\"\":\"null prototype\",at=!st&&Pe&&Object(o)===o&&Pe in o?ie.call(toStr(o),8,-1):it?\"Object\":\"\",ct=(st||\"function\"!=typeof o.constructor?\"\":o.constructor.name?o.constructor.name+\" \":\"\")+(at||it?\"[\"+fe.call(de.call([],at||[],it||[]),\": \")+\"] \":\"\");return 0===ot.length?ct+\"{}\":we?ct+\"{\"+indentedJoin(ot,we)+\"}\":ct+\"{ \"+fe.call(ot,\", \")+\" }\"}return String(o)};var We=Object.prototype.hasOwnProperty||function(o){return o in this};function has(o,s){return We.call(o,s)}function toStr(o){return Y.call(o)}function indexOf(o,s){if(o.indexOf)return o.indexOf(s);for(var i=0,u=o.length;i<u;i++)if(o[i]===s)return i;return-1}function inspectString(o,s){if(o.length>s.maxStringLength){var i=o.length-s.maxStringLength,u=\"... \"+i+\" more character\"+(i>1?\"s\":\"\");return inspectString(ie.call(o,0,s.maxStringLength),s)+u}return wrapQuotes(ae.call(ae.call(o,/(['\\\\])/g,\"\\\\$1\"),/[\\x00-\\x1f]/g,lowbyte),\"single\",s)}function lowbyte(o){var s=o.charCodeAt(0),i={8:\"b\",9:\"t\",10:\"n\",12:\"f\",13:\"r\"}[s];return i?\"\\\\\"+i:\"\\\\x\"+(s<16?\"0\":\"\")+ce.call(s.toString(16))}function markBoxed(o){return\"Object(\"+o+\")\"}function weakCollectionOf(o){return o+\" { ? }\"}function collectionOf(o,s,i,u){return o+\" (\"+s+\") {\"+(u?indentedJoin(i,u):fe.call(i,\", \"))+\"}\"}function indentedJoin(o,s){if(0===o.length)return\"\";var i=\"\\n\"+s.prev+s.base;return i+fe.call(o,\",\"+i)+\"\\n\"+s.prev}function arrObjKeys(o,s){var i=isArray(o),u=[];if(i){u.length=o.length;for(var _=0;_<o.length;_++)u[_]=has(o,_)?s(o[_],o):\"\"}var w,x=\"function\"==typeof we?we(o):[];if(xe){w={};for(var C=0;C<x.length;C++)w[\"$\"+x[C]]=x[C]}for(var j in o)has(o,j)&&(i&&String(Number(j))===j&&j<o.length||xe&&w[\"$\"+j]instanceof Symbol||(pe.call(/[^\\w$]/,j)?u.push(s(j,o)+\": \"+s(o[j],o)):u.push(j+\": \"+s(o[j],o))));if(\"function\"==typeof we)for(var L=0;L<x.length;L++)Te.call(o,x[L])&&u.push(\"[\"+s(x[L])+\"]: \"+s(o[x[L]],o));return u}},65606:o=>{var s,i,u=o.exports={};function defaultSetTimout(){throw new Error(\"setTimeout has not been defined\")}function defaultClearTimeout(){throw new Error(\"clearTimeout has not been defined\")}function runTimeout(o){if(s===setTimeout)return setTimeout(o,0);if((s===defaultSetTimout||!s)&&setTimeout)return s=setTimeout,setTimeout(o,0);try{return s(o,0)}catch(i){try{return s.call(null,o,0)}catch(i){return s.call(this,o,0)}}}!function(){try{s=\"function\"==typeof setTimeout?setTimeout:defaultSetTimout}catch(o){s=defaultSetTimout}try{i=\"function\"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(o){i=defaultClearTimeout}}();var _,w=[],x=!1,C=-1;function cleanUpNextTick(){x&&_&&(x=!1,_.length?w=_.concat(w):C=-1,w.length&&drainQueue())}function drainQueue(){if(!x){var o=runTimeout(cleanUpNextTick);x=!0;for(var s=w.length;s;){for(_=w,w=[];++C<s;)_&&_[C].run();C=-1,s=w.length}_=null,x=!1,function runClearTimeout(o){if(i===clearTimeout)return clearTimeout(o);if((i===defaultClearTimeout||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(o);try{return i(o)}catch(s){try{return i.call(null,o)}catch(s){return i.call(this,o)}}}(o)}}function Item(o,s){this.fun=o,this.array=s}function noop(){}u.nextTick=function(o){var s=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)s[i-1]=arguments[i];w.push(new Item(o,s)),1!==w.length||x||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},u.title=\"browser\",u.browser=!0,u.env={},u.argv=[],u.version=\"\",u.versions={},u.on=noop,u.addListener=noop,u.once=noop,u.off=noop,u.removeListener=noop,u.removeAllListeners=noop,u.emit=noop,u.prependListener=noop,u.prependOnceListener=noop,u.listeners=function(o){return[]},u.binding=function(o){throw new Error(\"process.binding is not supported\")},u.cwd=function(){return\"/\"},u.chdir=function(o){throw new Error(\"process.chdir is not supported\")},u.umask=function(){return 0}},2694:(o,s,i)=>{\"use strict\";var u=i(6925);function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction,o.exports=function(){function shim(o,s,i,_,w,x){if(x!==u){var C=new Error(\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types\");throw C.name=\"Invariant Violation\",C}}function getShim(){return shim}shim.isRequired=shim;var o={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return o.PropTypes=o,o}},5556:(o,s,i)=>{o.exports=i(2694)()},6925:o=>{\"use strict\";o.exports=\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\"},74765:o=>{\"use strict\";var s=String.prototype.replace,i=/%20/g,u=\"RFC1738\",_=\"RFC3986\";o.exports={default:_,formatters:{RFC1738:function(o){return s.call(o,i,\"+\")},RFC3986:function(o){return String(o)}},RFC1738:u,RFC3986:_}},55373:(o,s,i)=>{\"use strict\";var u=i(98636),_=i(62642),w=i(74765);o.exports={formats:w,parse:_,stringify:u}},62642:(o,s,i)=>{\"use strict\";var u=i(37720),_=Object.prototype.hasOwnProperty,w=Array.isArray,x={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:\"utf-8\",charsetSentinel:!1,comma:!1,decoder:u.decode,delimiter:\"&\",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(o){return o.replace(/&#(\\d+);/g,(function(o,s){return String.fromCharCode(parseInt(s,10))}))},parseArrayValue=function(o,s){return o&&\"string\"==typeof o&&s.comma&&o.indexOf(\",\")>-1?o.split(\",\"):o},C=function parseQueryStringKeys(o,s,i,u){if(o){var w=i.allowDots?o.replace(/\\.([^.[]+)/g,\"[$1]\"):o,x=/(\\[[^[\\]]*])/g,C=i.depth>0&&/(\\[[^[\\]]*])/.exec(w),j=C?w.slice(0,C.index):w,L=[];if(j){if(!i.plainObjects&&_.call(Object.prototype,j)&&!i.allowPrototypes)return;L.push(j)}for(var B=0;i.depth>0&&null!==(C=x.exec(w))&&B<i.depth;){if(B+=1,!i.plainObjects&&_.call(Object.prototype,C[1].slice(1,-1))&&!i.allowPrototypes)return;L.push(C[1])}return C&&L.push(\"[\"+w.slice(C.index)+\"]\"),function(o,s,i,u){for(var _=u?s:parseArrayValue(s,i),w=o.length-1;w>=0;--w){var x,C=o[w];if(\"[]\"===C&&i.parseArrays)x=[].concat(_);else{x=i.plainObjects?Object.create(null):{};var j=\"[\"===C.charAt(0)&&\"]\"===C.charAt(C.length-1)?C.slice(1,-1):C,L=parseInt(j,10);i.parseArrays||\"\"!==j?!isNaN(L)&&C!==j&&String(L)===j&&L>=0&&i.parseArrays&&L<=i.arrayLimit?(x=[])[L]=_:\"__proto__\"!==j&&(x[j]=_):x={0:_}}_=x}return _}(L,s,i,u)}};o.exports=function(o,s){var i=function normalizeParseOptions(o){if(!o)return x;if(null!==o.decoder&&void 0!==o.decoder&&\"function\"!=typeof o.decoder)throw new TypeError(\"Decoder has to be a function.\");if(void 0!==o.charset&&\"utf-8\"!==o.charset&&\"iso-8859-1\"!==o.charset)throw new TypeError(\"The charset option must be either utf-8, iso-8859-1, or undefined\");var s=void 0===o.charset?x.charset:o.charset;return{allowDots:void 0===o.allowDots?x.allowDots:!!o.allowDots,allowPrototypes:\"boolean\"==typeof o.allowPrototypes?o.allowPrototypes:x.allowPrototypes,allowSparse:\"boolean\"==typeof o.allowSparse?o.allowSparse:x.allowSparse,arrayLimit:\"number\"==typeof o.arrayLimit?o.arrayLimit:x.arrayLimit,charset:s,charsetSentinel:\"boolean\"==typeof o.charsetSentinel?o.charsetSentinel:x.charsetSentinel,comma:\"boolean\"==typeof o.comma?o.comma:x.comma,decoder:\"function\"==typeof o.decoder?o.decoder:x.decoder,delimiter:\"string\"==typeof o.delimiter||u.isRegExp(o.delimiter)?o.delimiter:x.delimiter,depth:\"number\"==typeof o.depth||!1===o.depth?+o.depth:x.depth,ignoreQueryPrefix:!0===o.ignoreQueryPrefix,interpretNumericEntities:\"boolean\"==typeof o.interpretNumericEntities?o.interpretNumericEntities:x.interpretNumericEntities,parameterLimit:\"number\"==typeof o.parameterLimit?o.parameterLimit:x.parameterLimit,parseArrays:!1!==o.parseArrays,plainObjects:\"boolean\"==typeof o.plainObjects?o.plainObjects:x.plainObjects,strictNullHandling:\"boolean\"==typeof o.strictNullHandling?o.strictNullHandling:x.strictNullHandling}}(s);if(\"\"===o||null==o)return i.plainObjects?Object.create(null):{};for(var j=\"string\"==typeof o?function parseQueryStringValues(o,s){var i,C={},j=s.ignoreQueryPrefix?o.replace(/^\\?/,\"\"):o,L=s.parameterLimit===1/0?void 0:s.parameterLimit,B=j.split(s.delimiter,L),$=-1,V=s.charset;if(s.charsetSentinel)for(i=0;i<B.length;++i)0===B[i].indexOf(\"utf8=\")&&(\"utf8=%E2%9C%93\"===B[i]?V=\"utf-8\":\"utf8=%26%2310003%3B\"===B[i]&&(V=\"iso-8859-1\"),$=i,i=B.length);for(i=0;i<B.length;++i)if(i!==$){var U,z,Y=B[i],Z=Y.indexOf(\"]=\"),ee=-1===Z?Y.indexOf(\"=\"):Z+1;-1===ee?(U=s.decoder(Y,x.decoder,V,\"key\"),z=s.strictNullHandling?null:\"\"):(U=s.decoder(Y.slice(0,ee),x.decoder,V,\"key\"),z=u.maybeMap(parseArrayValue(Y.slice(ee+1),s),(function(o){return s.decoder(o,x.decoder,V,\"value\")}))),z&&s.interpretNumericEntities&&\"iso-8859-1\"===V&&(z=interpretNumericEntities(z)),Y.indexOf(\"[]=\")>-1&&(z=w(z)?[z]:z),_.call(C,U)?C[U]=u.combine(C[U],z):C[U]=z}return C}(o,i):o,L=i.plainObjects?Object.create(null):{},B=Object.keys(j),$=0;$<B.length;++$){var V=B[$],U=C(V,j[V],i,\"string\"==typeof o);L=u.merge(L,U,i)}return!0===i.allowSparse?L:u.compact(L)}},98636:(o,s,i)=>{\"use strict\";var u=i(920),_=i(37720),w=i(74765),x=Object.prototype.hasOwnProperty,C={brackets:function brackets(o){return o+\"[]\"},comma:\"comma\",indices:function indices(o,s){return o+\"[\"+s+\"]\"},repeat:function repeat(o){return o}},j=Array.isArray,L=String.prototype.split,B=Array.prototype.push,pushToArray=function(o,s){B.apply(o,j(s)?s:[s])},$=Date.prototype.toISOString,V=w.default,U={addQueryPrefix:!1,allowDots:!1,charset:\"utf-8\",charsetSentinel:!1,delimiter:\"&\",encode:!0,encoder:_.encode,encodeValuesOnly:!1,format:V,formatter:w.formatters[V],indices:!1,serializeDate:function serializeDate(o){return $.call(o)},skipNulls:!1,strictNullHandling:!1},z={},Y=function stringify(o,s,i,w,x,C,B,$,V,Y,Z,ee,ie,ae,ce,le){for(var pe=o,de=le,fe=0,ye=!1;void 0!==(de=de.get(z))&&!ye;){var be=de.get(o);if(fe+=1,void 0!==be){if(be===fe)throw new RangeError(\"Cyclic object value\");ye=!0}void 0===de.get(z)&&(fe=0)}if(\"function\"==typeof $?pe=$(s,pe):pe instanceof Date?pe=Z(pe):\"comma\"===i&&j(pe)&&(pe=_.maybeMap(pe,(function(o){return o instanceof Date?Z(o):o}))),null===pe){if(x)return B&&!ae?B(s,U.encoder,ce,\"key\",ee):s;pe=\"\"}if(function isNonNullishPrimitive(o){return\"string\"==typeof o||\"number\"==typeof o||\"boolean\"==typeof o||\"symbol\"==typeof o||\"bigint\"==typeof o}(pe)||_.isBuffer(pe)){if(B){var _e=ae?s:B(s,U.encoder,ce,\"key\",ee);if(\"comma\"===i&&ae){for(var we=L.call(String(pe),\",\"),Se=\"\",xe=0;xe<we.length;++xe)Se+=(0===xe?\"\":\",\")+ie(B(we[xe],U.encoder,ce,\"value\",ee));return[ie(_e)+(w&&j(pe)&&1===we.length?\"[]\":\"\")+\"=\"+Se]}return[ie(_e)+\"=\"+ie(B(pe,U.encoder,ce,\"value\",ee))]}return[ie(s)+\"=\"+ie(String(pe))]}var Pe,Te=[];if(void 0===pe)return Te;if(\"comma\"===i&&j(pe))Pe=[{value:pe.length>0?pe.join(\",\")||null:void 0}];else if(j($))Pe=$;else{var Re=Object.keys(pe);Pe=V?Re.sort(V):Re}for(var qe=w&&j(pe)&&1===pe.length?s+\"[]\":s,$e=0;$e<Pe.length;++$e){var ze=Pe[$e],We=\"object\"==typeof ze&&void 0!==ze.value?ze.value:pe[ze];if(!C||null!==We){var He=j(pe)?\"function\"==typeof i?i(qe,ze):qe:qe+(Y?\".\"+ze:\"[\"+ze+\"]\");le.set(o,fe);var Ye=u();Ye.set(z,le),pushToArray(Te,stringify(We,He,i,w,x,C,B,$,V,Y,Z,ee,ie,ae,ce,Ye))}}return Te};o.exports=function(o,s){var i,_=o,L=function normalizeStringifyOptions(o){if(!o)return U;if(null!==o.encoder&&void 0!==o.encoder&&\"function\"!=typeof o.encoder)throw new TypeError(\"Encoder has to be a function.\");var s=o.charset||U.charset;if(void 0!==o.charset&&\"utf-8\"!==o.charset&&\"iso-8859-1\"!==o.charset)throw new TypeError(\"The charset option must be either utf-8, iso-8859-1, or undefined\");var i=w.default;if(void 0!==o.format){if(!x.call(w.formatters,o.format))throw new TypeError(\"Unknown format option provided.\");i=o.format}var u=w.formatters[i],_=U.filter;return(\"function\"==typeof o.filter||j(o.filter))&&(_=o.filter),{addQueryPrefix:\"boolean\"==typeof o.addQueryPrefix?o.addQueryPrefix:U.addQueryPrefix,allowDots:void 0===o.allowDots?U.allowDots:!!o.allowDots,charset:s,charsetSentinel:\"boolean\"==typeof o.charsetSentinel?o.charsetSentinel:U.charsetSentinel,delimiter:void 0===o.delimiter?U.delimiter:o.delimiter,encode:\"boolean\"==typeof o.encode?o.encode:U.encode,encoder:\"function\"==typeof o.encoder?o.encoder:U.encoder,encodeValuesOnly:\"boolean\"==typeof o.encodeValuesOnly?o.encodeValuesOnly:U.encodeValuesOnly,filter:_,format:i,formatter:u,serializeDate:\"function\"==typeof o.serializeDate?o.serializeDate:U.serializeDate,skipNulls:\"boolean\"==typeof o.skipNulls?o.skipNulls:U.skipNulls,sort:\"function\"==typeof o.sort?o.sort:null,strictNullHandling:\"boolean\"==typeof o.strictNullHandling?o.strictNullHandling:U.strictNullHandling}}(s);\"function\"==typeof L.filter?_=(0,L.filter)(\"\",_):j(L.filter)&&(i=L.filter);var B,$=[];if(\"object\"!=typeof _||null===_)return\"\";B=s&&s.arrayFormat in C?s.arrayFormat:s&&\"indices\"in s?s.indices?\"indices\":\"repeat\":\"indices\";var V=C[B];if(s&&\"commaRoundTrip\"in s&&\"boolean\"!=typeof s.commaRoundTrip)throw new TypeError(\"`commaRoundTrip` must be a boolean, or absent\");var z=\"comma\"===V&&s&&s.commaRoundTrip;i||(i=Object.keys(_)),L.sort&&i.sort(L.sort);for(var Z=u(),ee=0;ee<i.length;++ee){var ie=i[ee];L.skipNulls&&null===_[ie]||pushToArray($,Y(_[ie],ie,V,z,L.strictNullHandling,L.skipNulls,L.encode?L.encoder:null,L.filter,L.sort,L.allowDots,L.serializeDate,L.format,L.formatter,L.encodeValuesOnly,L.charset,Z))}var ae=$.join(L.delimiter),ce=!0===L.addQueryPrefix?\"?\":\"\";return L.charsetSentinel&&(\"iso-8859-1\"===L.charset?ce+=\"utf8=%26%2310003%3B&\":ce+=\"utf8=%E2%9C%93&\"),ae.length>0?ce+ae:\"\"}},37720:(o,s,i)=>{\"use strict\";var u=i(74765),_=Object.prototype.hasOwnProperty,w=Array.isArray,x=function(){for(var o=[],s=0;s<256;++s)o.push(\"%\"+((s<16?\"0\":\"\")+s.toString(16)).toUpperCase());return o}(),C=function arrayToObject(o,s){for(var i=s&&s.plainObjects?Object.create(null):{},u=0;u<o.length;++u)void 0!==o[u]&&(i[u]=o[u]);return i};o.exports={arrayToObject:C,assign:function assignSingleSource(o,s){return Object.keys(s).reduce((function(o,i){return o[i]=s[i],o}),o)},combine:function combine(o,s){return[].concat(o,s)},compact:function compact(o){for(var s=[{obj:{o},prop:\"o\"}],i=[],u=0;u<s.length;++u)for(var _=s[u],x=_.obj[_.prop],C=Object.keys(x),j=0;j<C.length;++j){var L=C[j],B=x[L];\"object\"==typeof B&&null!==B&&-1===i.indexOf(B)&&(s.push({obj:x,prop:L}),i.push(B))}return function compactQueue(o){for(;o.length>1;){var s=o.pop(),i=s.obj[s.prop];if(w(i)){for(var u=[],_=0;_<i.length;++_)void 0!==i[_]&&u.push(i[_]);s.obj[s.prop]=u}}}(s),o},decode:function(o,s,i){var u=o.replace(/\\+/g,\" \");if(\"iso-8859-1\"===i)return u.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(u)}catch(o){return u}},encode:function encode(o,s,i,_,w){if(0===o.length)return o;var C=o;if(\"symbol\"==typeof o?C=Symbol.prototype.toString.call(o):\"string\"!=typeof o&&(C=String(o)),\"iso-8859-1\"===i)return escape(C).replace(/%u[0-9a-f]{4}/gi,(function(o){return\"%26%23\"+parseInt(o.slice(2),16)+\"%3B\"}));for(var j=\"\",L=0;L<C.length;++L){var B=C.charCodeAt(L);45===B||46===B||95===B||126===B||B>=48&&B<=57||B>=65&&B<=90||B>=97&&B<=122||w===u.RFC1738&&(40===B||41===B)?j+=C.charAt(L):B<128?j+=x[B]:B<2048?j+=x[192|B>>6]+x[128|63&B]:B<55296||B>=57344?j+=x[224|B>>12]+x[128|B>>6&63]+x[128|63&B]:(L+=1,B=65536+((1023&B)<<10|1023&C.charCodeAt(L)),j+=x[240|B>>18]+x[128|B>>12&63]+x[128|B>>6&63]+x[128|63&B])}return j},isBuffer:function isBuffer(o){return!(!o||\"object\"!=typeof o)&&!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))},isRegExp:function isRegExp(o){return\"[object RegExp]\"===Object.prototype.toString.call(o)},maybeMap:function maybeMap(o,s){if(w(o)){for(var i=[],u=0;u<o.length;u+=1)i.push(s(o[u]));return i}return s(o)},merge:function merge(o,s,i){if(!s)return o;if(\"object\"!=typeof s){if(w(o))o.push(s);else{if(!o||\"object\"!=typeof o)return[o,s];(i&&(i.plainObjects||i.allowPrototypes)||!_.call(Object.prototype,s))&&(o[s]=!0)}return o}if(!o||\"object\"!=typeof o)return[o].concat(s);var u=o;return w(o)&&!w(s)&&(u=C(o,i)),w(o)&&w(s)?(s.forEach((function(s,u){if(_.call(o,u)){var w=o[u];w&&\"object\"==typeof w&&s&&\"object\"==typeof s?o[u]=merge(w,s,i):o.push(s)}else o[u]=s})),o):Object.keys(s).reduce((function(o,u){var w=s[u];return _.call(o,u)?o[u]=merge(o[u],w,i):o[u]=w,o}),u)}}},73992:(o,s)=>{\"use strict\";var i=Object.prototype.hasOwnProperty;function decode(o){try{return decodeURIComponent(o.replace(/\\+/g,\" \"))}catch(o){return null}}function encode(o){try{return encodeURIComponent(o)}catch(o){return null}}s.stringify=function querystringify(o,s){s=s||\"\";var u,_,w=[];for(_ in\"string\"!=typeof s&&(s=\"?\"),o)if(i.call(o,_)){if((u=o[_])||null!=u&&!isNaN(u)||(u=\"\"),_=encode(_),u=encode(u),null===_||null===u)continue;w.push(_+\"=\"+u)}return w.length?s+w.join(\"&\"):\"\"},s.parse=function querystring(o){for(var s,i=/([^=?#&]+)=?([^&]*)/g,u={};s=i.exec(o);){var _=decode(s[1]),w=decode(s[2]);null===_||null===w||_ in u||(u[_]=w)}return u}},41859:(o,s,i)=>{const u=i(27096),_=i(78004),w=u.types;o.exports=class RandExp{constructor(o,s){if(this._setDefaults(o),o instanceof RegExp)this.ignoreCase=o.ignoreCase,this.multiline=o.multiline,o=o.source;else{if(\"string\"!=typeof o)throw new Error(\"Expected a regexp or string\");this.ignoreCase=s&&-1!==s.indexOf(\"i\"),this.multiline=s&&-1!==s.indexOf(\"m\")}this.tokens=u(o)}_setDefaults(o){this.max=null!=o.max?o.max:null!=RandExp.prototype.max?RandExp.prototype.max:100,this.defaultRange=o.defaultRange?o.defaultRange:this.defaultRange.clone(),o.randInt&&(this.randInt=o.randInt)}gen(){return this._gen(this.tokens,[])}_gen(o,s){var i,u,_,x,C;switch(o.type){case w.ROOT:case w.GROUP:if(o.followedBy||o.notFollowedBy)return\"\";for(o.remember&&void 0===o.groupNumber&&(o.groupNumber=s.push(null)-1),u=\"\",x=0,C=(i=o.options?this._randSelect(o.options):o.stack).length;x<C;x++)u+=this._gen(i[x],s);return o.remember&&(s[o.groupNumber]=u),u;case w.POSITION:return\"\";case w.SET:var j=this._expand(o);return j.length?String.fromCharCode(this._randSelect(j)):\"\";case w.REPETITION:for(_=this.randInt(o.min,o.max===1/0?o.min+this.max:o.max),u=\"\",x=0;x<_;x++)u+=this._gen(o.value,s);return u;case w.REFERENCE:return s[o.value-1]||\"\";case w.CHAR:var L=this.ignoreCase&&this._randBool()?this._toOtherCase(o.value):o.value;return String.fromCharCode(L)}}_toOtherCase(o){return o+(97<=o&&o<=122?-32:65<=o&&o<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(o){return o instanceof _?o.index(this.randInt(0,o.length-1)):o[this.randInt(0,o.length-1)]}_expand(o){if(o.type===u.types.CHAR)return new _(o.value);if(o.type===u.types.RANGE)return new _(o.from,o.to);{let s=new _;for(let i=0;i<o.set.length;i++){let u=this._expand(o.set[i]);if(s.add(u),this.ignoreCase)for(let o=0;o<u.length;o++){let i=u.index(o),_=this._toOtherCase(i);i!==_&&s.add(_)}}return o.not?this.defaultRange.clone().subtract(s):this.defaultRange.clone().intersect(s)}}randInt(o,s){return o+Math.floor(Math.random()*(1+s-o))}get defaultRange(){return this._range=this._range||new _(32,126)}set defaultRange(o){this._range=o}static randexp(o,s){var i;return\"string\"==typeof o&&(o=new RegExp(o,s)),void 0===o._randexp?(i=new RandExp(o,s),o._randexp=i):(i=o._randexp)._setDefaults(o),i.gen()}static sugar(){RegExp.prototype.gen=function(){return RandExp.randexp(this)}}}},53209:(o,s,i)=>{\"use strict\";var u=i(65606),_=65536,w=4294967295;var x=i(92861).Buffer,C=i.g.crypto||i.g.msCrypto;C&&C.getRandomValues?o.exports=function randomBytes(o,s){if(o>w)throw new RangeError(\"requested too many random bytes\");var i=x.allocUnsafe(o);if(o>0)if(o>_)for(var j=0;j<o;j+=_)C.getRandomValues(i.slice(j,j+_));else C.getRandomValues(i);if(\"function\"==typeof s)return u.nextTick((function(){s(null,i)}));return i}:o.exports=function oldBrowser(){throw new Error(\"Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11\")}},25264:(o,s,i)=>{\"use strict\";function _typeof(o){return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},_typeof(o)}Object.defineProperty(s,\"__esModule\",{value:!0}),s.CopyToClipboard=void 0;var u=_interopRequireDefault(i(96540)),_=_interopRequireDefault(i(17965)),w=[\"text\",\"onCopy\",\"options\",\"children\"];function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}function ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(i),!0).forEach((function(s){_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}function _objectWithoutProperties(o,s){if(null==o)return{};var i,u,_=function _objectWithoutPropertiesLoose(o,s){if(null==o)return{};var i,u,_={},w=Object.keys(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||(_[i]=o[i]);return _}(o,s);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(o,i)&&(_[i]=o[i])}return _}function _defineProperties(o,s){for(var i=0;i<s.length;i++){var u=s[i];u.enumerable=u.enumerable||!1,u.configurable=!0,\"value\"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function _setPrototypeOf(o,s){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,s){return o.__proto__=s,o},_setPrototypeOf(o,s)}function _createSuper(o){var s=function _isNativeReflectConstruct(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(o){return!1}}();return function _createSuperInternal(){var i,u=_getPrototypeOf(o);if(s){var _=_getPrototypeOf(this).constructor;i=Reflect.construct(u,arguments,_)}else i=u.apply(this,arguments);return function _possibleConstructorReturn(o,s){if(s&&(\"object\"===_typeof(s)||\"function\"==typeof s))return s;if(void 0!==s)throw new TypeError(\"Derived constructors may only return object or undefined\");return _assertThisInitialized(o)}(this,i)}}function _assertThisInitialized(o){if(void 0===o)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return o}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(o)}function _defineProperty(o,s,i){return s in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}var x=function(o){!function _inherits(o,s){if(\"function\"!=typeof s&&null!==s)throw new TypeError(\"Super expression must either be null or a function\");o.prototype=Object.create(s&&s.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,\"prototype\",{writable:!1}),s&&_setPrototypeOf(o,s)}(CopyToClipboard,o);var s=_createSuper(CopyToClipboard);function CopyToClipboard(){var o;!function _classCallCheck(o,s){if(!(o instanceof s))throw new TypeError(\"Cannot call a class as a function\")}(this,CopyToClipboard);for(var i=arguments.length,w=new Array(i),x=0;x<i;x++)w[x]=arguments[x];return _defineProperty(_assertThisInitialized(o=s.call.apply(s,[this].concat(w))),\"onClick\",(function(s){var i=o.props,w=i.text,x=i.onCopy,C=i.children,j=i.options,L=u.default.Children.only(C),B=(0,_.default)(w,j);x&&x(w,B),L&&L.props&&\"function\"==typeof L.props.onClick&&L.props.onClick(s)})),o}return function _createClass(o,s,i){return s&&_defineProperties(o.prototype,s),i&&_defineProperties(o,i),Object.defineProperty(o,\"prototype\",{writable:!1}),o}(CopyToClipboard,[{key:\"render\",value:function render(){var o=this.props,s=(o.text,o.onCopy,o.options,o.children),i=_objectWithoutProperties(o,w),_=u.default.Children.only(s);return u.default.cloneElement(_,_objectSpread(_objectSpread({},i),{},{onClick:this.onClick}))}}]),CopyToClipboard}(u.default.PureComponent);s.CopyToClipboard=x,_defineProperty(x,\"defaultProps\",{onCopy:void 0,options:void 0})},59399:(o,s,i)=>{\"use strict\";var u=i(25264).CopyToClipboard;u.CopyToClipboard=u,o.exports=u},81214:(o,s,i)=>{\"use strict\";function _typeof(o){return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},_typeof(o)}Object.defineProperty(s,\"__esModule\",{value:!0}),s.DebounceInput=void 0;var u=_interopRequireDefault(i(96540)),_=_interopRequireDefault(i(20181)),w=[\"element\",\"onChange\",\"value\",\"minLength\",\"debounceTimeout\",\"forceNotifyByEnter\",\"forceNotifyOnBlur\",\"onKeyDown\",\"onBlur\",\"inputRef\"];function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}function _objectWithoutProperties(o,s){if(null==o)return{};var i,u,_=function _objectWithoutPropertiesLoose(o,s){if(null==o)return{};var i,u,_={},w=Object.keys(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||(_[i]=o[i]);return _}(o,s);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(o,i)&&(_[i]=o[i])}return _}function ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(i),!0).forEach((function(s){_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}function _defineProperties(o,s){for(var i=0;i<s.length;i++){var u=s[i];u.enumerable=u.enumerable||!1,u.configurable=!0,\"value\"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function _setPrototypeOf(o,s){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,s){return o.__proto__=s,o},_setPrototypeOf(o,s)}function _createSuper(o){var s=function _isNativeReflectConstruct(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(o){return!1}}();return function _createSuperInternal(){var i,u=_getPrototypeOf(o);if(s){var _=_getPrototypeOf(this).constructor;i=Reflect.construct(u,arguments,_)}else i=u.apply(this,arguments);return function _possibleConstructorReturn(o,s){if(s&&(\"object\"===_typeof(s)||\"function\"==typeof s))return s;if(void 0!==s)throw new TypeError(\"Derived constructors may only return object or undefined\");return _assertThisInitialized(o)}(this,i)}}function _assertThisInitialized(o){if(void 0===o)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return o}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(o)}function _defineProperty(o,s,i){return s in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}var x=function(o){!function _inherits(o,s){if(\"function\"!=typeof s&&null!==s)throw new TypeError(\"Super expression must either be null or a function\");o.prototype=Object.create(s&&s.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,\"prototype\",{writable:!1}),s&&_setPrototypeOf(o,s)}(DebounceInput,o);var s=_createSuper(DebounceInput);function DebounceInput(o){var i;!function _classCallCheck(o,s){if(!(o instanceof s))throw new TypeError(\"Cannot call a class as a function\")}(this,DebounceInput),_defineProperty(_assertThisInitialized(i=s.call(this,o)),\"onChange\",(function(o){o.persist();var s=i.state.value,u=i.props.minLength;i.setState({value:o.target.value},(function(){var _=i.state.value;_.length>=u?i.notify(o):s.length>_.length&&i.notify(_objectSpread(_objectSpread({},o),{},{target:_objectSpread(_objectSpread({},o.target),{},{value:\"\"})}))}))})),_defineProperty(_assertThisInitialized(i),\"onKeyDown\",(function(o){\"Enter\"===o.key&&i.forceNotify(o);var s=i.props.onKeyDown;s&&(o.persist(),s(o))})),_defineProperty(_assertThisInitialized(i),\"onBlur\",(function(o){i.forceNotify(o);var s=i.props.onBlur;s&&(o.persist(),s(o))})),_defineProperty(_assertThisInitialized(i),\"createNotifier\",(function(o){if(o<0)i.notify=function(){return null};else if(0===o)i.notify=i.doNotify;else{var s=(0,_.default)((function(o){i.isDebouncing=!1,i.doNotify(o)}),o);i.notify=function(o){i.isDebouncing=!0,s(o)},i.flush=function(){return s.flush()},i.cancel=function(){i.isDebouncing=!1,s.cancel()}}})),_defineProperty(_assertThisInitialized(i),\"doNotify\",(function(){i.props.onChange.apply(void 0,arguments)})),_defineProperty(_assertThisInitialized(i),\"forceNotify\",(function(o){var s=i.props.debounceTimeout;if(i.isDebouncing||!(s>0)){i.cancel&&i.cancel();var u=i.state.value,_=i.props.minLength;u.length>=_?i.doNotify(o):i.doNotify(_objectSpread(_objectSpread({},o),{},{target:_objectSpread(_objectSpread({},o.target),{},{value:u})}))}})),i.isDebouncing=!1,i.state={value:void 0===o.value||null===o.value?\"\":o.value};var u=i.props.debounceTimeout;return i.createNotifier(u),i}return function _createClass(o,s,i){return s&&_defineProperties(o.prototype,s),i&&_defineProperties(o,i),Object.defineProperty(o,\"prototype\",{writable:!1}),o}(DebounceInput,[{key:\"componentDidUpdate\",value:function componentDidUpdate(o){if(!this.isDebouncing){var s=this.props,i=s.value,u=s.debounceTimeout,_=o.debounceTimeout,w=o.value,x=this.state.value;void 0!==i&&w!==i&&x!==i&&this.setState({value:i}),u!==_&&this.createNotifier(u)}}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){this.flush&&this.flush()}},{key:\"render\",value:function render(){var o,s,i=this.props,_=i.element,x=(i.onChange,i.value,i.minLength,i.debounceTimeout,i.forceNotifyByEnter),C=i.forceNotifyOnBlur,j=i.onKeyDown,L=i.onBlur,B=i.inputRef,$=_objectWithoutProperties(i,w),V=this.state.value;o=x?{onKeyDown:this.onKeyDown}:j?{onKeyDown:j}:{},s=C?{onBlur:this.onBlur}:L?{onBlur:L}:{};var U=B?{ref:B}:{};return u.default.createElement(_,_objectSpread(_objectSpread(_objectSpread(_objectSpread({},$),{},{onChange:this.onChange,value:V},o),s),U))}}]),DebounceInput}(u.default.PureComponent);s.DebounceInput=x,_defineProperty(x,\"defaultProps\",{element:\"input\",type:\"text\",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0})},24677:(o,s,i)=>{\"use strict\";var u=i(81214).DebounceInput;u.DebounceInput=u,o.exports=u},22551:(o,s,i)=>{\"use strict\";var u=i(96540),_=i(69982);function p(o){for(var s=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+o,i=1;i<arguments.length;i++)s+=\"&args[]=\"+encodeURIComponent(arguments[i]);return\"Minified React error #\"+o+\"; visit \"+s+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var w=new Set,x={};function fa(o,s){ha(o,s),ha(o+\"Capture\",s)}function ha(o,s){for(x[o]=s,o=0;o<s.length;o++)w.add(s[o])}var C=!(\"undefined\"==typeof window||void 0===window.document||void 0===window.document.createElement),j=Object.prototype.hasOwnProperty,L=/^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$/,B={},$={};function v(o,s,i,u,_,w,x){this.acceptsBooleans=2===s||3===s||4===s,this.attributeName=u,this.attributeNamespace=_,this.mustUseProperty=i,this.propertyName=o,this.type=s,this.sanitizeURL=w,this.removeEmptyString=x}var V={};\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach((function(o){V[o]=new v(o,0,!1,o,null,!1,!1)})),[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach((function(o){var s=o[0];V[s]=new v(s,1,!1,o[1],null,!1,!1)})),[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach((function(o){V[o]=new v(o,2,!1,o.toLowerCase(),null,!1,!1)})),[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach((function(o){V[o]=new v(o,2,!1,o,null,!1,!1)})),\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach((function(o){V[o]=new v(o,3,!1,o.toLowerCase(),null,!1,!1)})),[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach((function(o){V[o]=new v(o,3,!0,o,null,!1,!1)})),[\"capture\",\"download\"].forEach((function(o){V[o]=new v(o,4,!1,o,null,!1,!1)})),[\"cols\",\"rows\",\"size\",\"span\"].forEach((function(o){V[o]=new v(o,6,!1,o,null,!1,!1)})),[\"rowSpan\",\"start\"].forEach((function(o){V[o]=new v(o,5,!1,o.toLowerCase(),null,!1,!1)}));var U=/[\\-:]([a-z])/g;function sa(o){return o[1].toUpperCase()}function ta(o,s,i,u){var _=V.hasOwnProperty(s)?V[s]:null;(null!==_?0!==_.type:u||!(2<s.length)||\"o\"!==s[0]&&\"O\"!==s[0]||\"n\"!==s[1]&&\"N\"!==s[1])&&(function qa(o,s,i,u){if(null==s||function pa(o,s,i,u){if(null!==i&&0===i.type)return!1;switch(typeof s){case\"function\":case\"symbol\":return!0;case\"boolean\":return!u&&(null!==i?!i.acceptsBooleans:\"data-\"!==(o=o.toLowerCase().slice(0,5))&&\"aria-\"!==o);default:return!1}}(o,s,i,u))return!0;if(u)return!1;if(null!==i)switch(i.type){case 3:return!s;case 4:return!1===s;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}(s,i,_,u)&&(i=null),u||null===_?function oa(o){return!!j.call($,o)||!j.call(B,o)&&(L.test(o)?$[o]=!0:(B[o]=!0,!1))}(s)&&(null===i?o.removeAttribute(s):o.setAttribute(s,\"\"+i)):_.mustUseProperty?o[_.propertyName]=null===i?3!==_.type&&\"\":i:(s=_.attributeName,u=_.attributeNamespace,null===i?o.removeAttribute(s):(i=3===(_=_.type)||4===_&&!0===i?\"\":\"\"+i,u?o.setAttributeNS(u,s,i):o.setAttribute(s,i))))}\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach((function(o){var s=o.replace(U,sa);V[s]=new v(s,1,!1,o,null,!1,!1)})),\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach((function(o){var s=o.replace(U,sa);V[s]=new v(s,1,!1,o,\"http://www.w3.org/1999/xlink\",!1,!1)})),[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach((function(o){var s=o.replace(U,sa);V[s]=new v(s,1,!1,o,\"http://www.w3.org/XML/1998/namespace\",!1,!1)})),[\"tabIndex\",\"crossOrigin\"].forEach((function(o){V[o]=new v(o,1,!1,o.toLowerCase(),null,!1,!1)})),V.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1),[\"src\",\"href\",\"action\",\"formAction\"].forEach((function(o){V[o]=new v(o,1,!1,o.toLowerCase(),null,!0,!0)}));var z=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Y=Symbol.for(\"react.element\"),Z=Symbol.for(\"react.portal\"),ee=Symbol.for(\"react.fragment\"),ie=Symbol.for(\"react.strict_mode\"),ae=Symbol.for(\"react.profiler\"),ce=Symbol.for(\"react.provider\"),le=Symbol.for(\"react.context\"),pe=Symbol.for(\"react.forward_ref\"),de=Symbol.for(\"react.suspense\"),fe=Symbol.for(\"react.suspense_list\"),ye=Symbol.for(\"react.memo\"),be=Symbol.for(\"react.lazy\");Symbol.for(\"react.scope\"),Symbol.for(\"react.debug_trace_mode\");var _e=Symbol.for(\"react.offscreen\");Symbol.for(\"react.legacy_hidden\"),Symbol.for(\"react.cache\"),Symbol.for(\"react.tracing_marker\");var we=Symbol.iterator;function Ka(o){return null===o||\"object\"!=typeof o?null:\"function\"==typeof(o=we&&o[we]||o[\"@@iterator\"])?o:null}var Se,xe=Object.assign;function Ma(o){if(void 0===Se)try{throw Error()}catch(o){var s=o.stack.trim().match(/\\n( *(at )?)/);Se=s&&s[1]||\"\"}return\"\\n\"+Se+o}var Pe=!1;function Oa(o,s){if(!o||Pe)return\"\";Pe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,\"props\",{set:function(){throw Error()}}),\"object\"==typeof Reflect&&Reflect.construct){try{Reflect.construct(s,[])}catch(o){var u=o}Reflect.construct(o,[],s)}else{try{s.call()}catch(o){u=o}o.call(s.prototype)}else{try{throw Error()}catch(o){u=o}o()}}catch(s){if(s&&u&&\"string\"==typeof s.stack){for(var _=s.stack.split(\"\\n\"),w=u.stack.split(\"\\n\"),x=_.length-1,C=w.length-1;1<=x&&0<=C&&_[x]!==w[C];)C--;for(;1<=x&&0<=C;x--,C--)if(_[x]!==w[C]){if(1!==x||1!==C)do{if(x--,0>--C||_[x]!==w[C]){var j=\"\\n\"+_[x].replace(\" at new \",\" at \");return o.displayName&&j.includes(\"<anonymous>\")&&(j=j.replace(\"<anonymous>\",o.displayName)),j}}while(1<=x&&0<=C);break}}}finally{Pe=!1,Error.prepareStackTrace=i}return(o=o?o.displayName||o.name:\"\")?Ma(o):\"\"}function Pa(o){switch(o.tag){case 5:return Ma(o.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return o=Oa(o.type,!1);case 11:return o=Oa(o.type.render,!1);case 1:return o=Oa(o.type,!0);default:return\"\"}}function Qa(o){if(null==o)return null;if(\"function\"==typeof o)return o.displayName||o.name||null;if(\"string\"==typeof o)return o;switch(o){case ee:return\"Fragment\";case Z:return\"Portal\";case ae:return\"Profiler\";case ie:return\"StrictMode\";case de:return\"Suspense\";case fe:return\"SuspenseList\"}if(\"object\"==typeof o)switch(o.$$typeof){case le:return(o.displayName||\"Context\")+\".Consumer\";case ce:return(o._context.displayName||\"Context\")+\".Provider\";case pe:var s=o.render;return(o=o.displayName)||(o=\"\"!==(o=s.displayName||s.name||\"\")?\"ForwardRef(\"+o+\")\":\"ForwardRef\"),o;case ye:return null!==(s=o.displayName||null)?s:Qa(o.type)||\"Memo\";case be:s=o._payload,o=o._init;try{return Qa(o(s))}catch(o){}}return null}function Ra(o){var s=o.type;switch(o.tag){case 24:return\"Cache\";case 9:return(s.displayName||\"Context\")+\".Consumer\";case 10:return(s._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return o=(o=s.render).displayName||o.name||\"\",s.displayName||(\"\"!==o?\"ForwardRef(\"+o+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return s;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(s);case 8:return s===ie?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";case 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"==typeof s)return s.displayName||s.name||null;if(\"string\"==typeof s)return s}return null}function Sa(o){switch(typeof o){case\"boolean\":case\"number\":case\"string\":case\"undefined\":case\"object\":return o;default:return\"\"}}function Ta(o){var s=o.type;return(o=o.nodeName)&&\"input\"===o.toLowerCase()&&(\"checkbox\"===s||\"radio\"===s)}function Va(o){o._valueTracker||(o._valueTracker=function Ua(o){var s=Ta(o)?\"checked\":\"value\",i=Object.getOwnPropertyDescriptor(o.constructor.prototype,s),u=\"\"+o[s];if(!o.hasOwnProperty(s)&&void 0!==i&&\"function\"==typeof i.get&&\"function\"==typeof i.set){var _=i.get,w=i.set;return Object.defineProperty(o,s,{configurable:!0,get:function(){return _.call(this)},set:function(o){u=\"\"+o,w.call(this,o)}}),Object.defineProperty(o,s,{enumerable:i.enumerable}),{getValue:function(){return u},setValue:function(o){u=\"\"+o},stopTracking:function(){o._valueTracker=null,delete o[s]}}}}(o))}function Wa(o){if(!o)return!1;var s=o._valueTracker;if(!s)return!0;var i=s.getValue(),u=\"\";return o&&(u=Ta(o)?o.checked?\"true\":\"false\":o.value),(o=u)!==i&&(s.setValue(o),!0)}function Xa(o){if(void 0===(o=o||(\"undefined\"!=typeof document?document:void 0)))return null;try{return o.activeElement||o.body}catch(s){return o.body}}function Ya(o,s){var i=s.checked;return xe({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=i?i:o._wrapperState.initialChecked})}function Za(o,s){var i=null==s.defaultValue?\"\":s.defaultValue,u=null!=s.checked?s.checked:s.defaultChecked;i=Sa(null!=s.value?s.value:i),o._wrapperState={initialChecked:u,initialValue:i,controlled:\"checkbox\"===s.type||\"radio\"===s.type?null!=s.checked:null!=s.value}}function ab(o,s){null!=(s=s.checked)&&ta(o,\"checked\",s,!1)}function bb(o,s){ab(o,s);var i=Sa(s.value),u=s.type;if(null!=i)\"number\"===u?(0===i&&\"\"===o.value||o.value!=i)&&(o.value=\"\"+i):o.value!==\"\"+i&&(o.value=\"\"+i);else if(\"submit\"===u||\"reset\"===u)return void o.removeAttribute(\"value\");s.hasOwnProperty(\"value\")?cb(o,s.type,i):s.hasOwnProperty(\"defaultValue\")&&cb(o,s.type,Sa(s.defaultValue)),null==s.checked&&null!=s.defaultChecked&&(o.defaultChecked=!!s.defaultChecked)}function db(o,s,i){if(s.hasOwnProperty(\"value\")||s.hasOwnProperty(\"defaultValue\")){var u=s.type;if(!(\"submit\"!==u&&\"reset\"!==u||void 0!==s.value&&null!==s.value))return;s=\"\"+o._wrapperState.initialValue,i||s===o.value||(o.value=s),o.defaultValue=s}\"\"!==(i=o.name)&&(o.name=\"\"),o.defaultChecked=!!o._wrapperState.initialChecked,\"\"!==i&&(o.name=i)}function cb(o,s,i){\"number\"===s&&Xa(o.ownerDocument)===o||(null==i?o.defaultValue=\"\"+o._wrapperState.initialValue:o.defaultValue!==\"\"+i&&(o.defaultValue=\"\"+i))}var Te=Array.isArray;function fb(o,s,i,u){if(o=o.options,s){s={};for(var _=0;_<i.length;_++)s[\"$\"+i[_]]=!0;for(i=0;i<o.length;i++)_=s.hasOwnProperty(\"$\"+o[i].value),o[i].selected!==_&&(o[i].selected=_),_&&u&&(o[i].defaultSelected=!0)}else{for(i=\"\"+Sa(i),s=null,_=0;_<o.length;_++){if(o[_].value===i)return o[_].selected=!0,void(u&&(o[_].defaultSelected=!0));null!==s||o[_].disabled||(s=o[_])}null!==s&&(s.selected=!0)}}function gb(o,s){if(null!=s.dangerouslySetInnerHTML)throw Error(p(91));return xe({},s,{value:void 0,defaultValue:void 0,children:\"\"+o._wrapperState.initialValue})}function hb(o,s){var i=s.value;if(null==i){if(i=s.children,s=s.defaultValue,null!=i){if(null!=s)throw Error(p(92));if(Te(i)){if(1<i.length)throw Error(p(93));i=i[0]}s=i}null==s&&(s=\"\"),i=s}o._wrapperState={initialValue:Sa(i)}}function ib(o,s){var i=Sa(s.value),u=Sa(s.defaultValue);null!=i&&((i=\"\"+i)!==o.value&&(o.value=i),null==s.defaultValue&&o.defaultValue!==i&&(o.defaultValue=i)),null!=u&&(o.defaultValue=\"\"+u)}function jb(o){var s=o.textContent;s===o._wrapperState.initialValue&&\"\"!==s&&null!==s&&(o.value=s)}function kb(o){switch(o){case\"svg\":return\"http://www.w3.org/2000/svg\";case\"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function lb(o,s){return null==o||\"http://www.w3.org/1999/xhtml\"===o?kb(s):\"http://www.w3.org/2000/svg\"===o&&\"foreignObject\"===s?\"http://www.w3.org/1999/xhtml\":o}var Re,qe,$e=(qe=function(o,s){if(\"http://www.w3.org/2000/svg\"!==o.namespaceURI||\"innerHTML\"in o)o.innerHTML=s;else{for((Re=Re||document.createElement(\"div\")).innerHTML=\"<svg>\"+s.valueOf().toString()+\"</svg>\",s=Re.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;s.firstChild;)o.appendChild(s.firstChild)}},\"undefined\"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(o,s,i,u){MSApp.execUnsafeLocalFunction((function(){return qe(o,s)}))}:qe);function ob(o,s){if(s){var i=o.firstChild;if(i&&i===o.lastChild&&3===i.nodeType)return void(i.nodeValue=s)}o.textContent=s}var ze={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},We=[\"Webkit\",\"ms\",\"Moz\",\"O\"];function rb(o,s,i){return null==s||\"boolean\"==typeof s||\"\"===s?\"\":i||\"number\"!=typeof s||0===s||ze.hasOwnProperty(o)&&ze[o]?(\"\"+s).trim():s+\"px\"}function sb(o,s){for(var i in o=o.style,s)if(s.hasOwnProperty(i)){var u=0===i.indexOf(\"--\"),_=rb(i,s[i],u);\"float\"===i&&(i=\"cssFloat\"),u?o.setProperty(i,_):o[i]=_}}Object.keys(ze).forEach((function(o){We.forEach((function(s){s=s+o.charAt(0).toUpperCase()+o.substring(1),ze[s]=ze[o]}))}));var He=xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(o,s){if(s){if(He[o]&&(null!=s.children||null!=s.dangerouslySetInnerHTML))throw Error(p(137,o));if(null!=s.dangerouslySetInnerHTML){if(null!=s.children)throw Error(p(60));if(\"object\"!=typeof s.dangerouslySetInnerHTML||!(\"__html\"in s.dangerouslySetInnerHTML))throw Error(p(61))}if(null!=s.style&&\"object\"!=typeof s.style)throw Error(p(62))}}function vb(o,s){if(-1===o.indexOf(\"-\"))return\"string\"==typeof s.is;switch(o){case\"annotation-xml\":case\"color-profile\":case\"font-face\":case\"font-face-src\":case\"font-face-uri\":case\"font-face-format\":case\"font-face-name\":case\"missing-glyph\":return!1;default:return!0}}var Ye=null;function xb(o){return(o=o.target||o.srcElement||window).correspondingUseElement&&(o=o.correspondingUseElement),3===o.nodeType?o.parentNode:o}var Xe=null,Qe=null,et=null;function Bb(o){if(o=Cb(o)){if(\"function\"!=typeof Xe)throw Error(p(280));var s=o.stateNode;s&&(s=Db(s),Xe(o.stateNode,o.type,s))}}function Eb(o){Qe?et?et.push(o):et=[o]:Qe=o}function Fb(){if(Qe){var o=Qe,s=et;if(et=Qe=null,Bb(o),s)for(o=0;o<s.length;o++)Bb(s[o])}}function Gb(o,s){return o(s)}function Hb(){}var tt=!1;function Jb(o,s,i){if(tt)return o(s,i);tt=!0;try{return Gb(o,s,i)}finally{tt=!1,(null!==Qe||null!==et)&&(Hb(),Fb())}}function Kb(o,s){var i=o.stateNode;if(null===i)return null;var u=Db(i);if(null===u)return null;i=u[s];e:switch(s){case\"onClick\":case\"onClickCapture\":case\"onDoubleClick\":case\"onDoubleClickCapture\":case\"onMouseDown\":case\"onMouseDownCapture\":case\"onMouseMove\":case\"onMouseMoveCapture\":case\"onMouseUp\":case\"onMouseUpCapture\":case\"onMouseEnter\":(u=!u.disabled)||(u=!(\"button\"===(o=o.type)||\"input\"===o||\"select\"===o||\"textarea\"===o)),o=!u;break e;default:o=!1}if(o)return null;if(i&&\"function\"!=typeof i)throw Error(p(231,s,typeof i));return i}var rt=!1;if(C)try{var nt={};Object.defineProperty(nt,\"passive\",{get:function(){rt=!0}}),window.addEventListener(\"test\",nt,nt),window.removeEventListener(\"test\",nt,nt)}catch(qe){rt=!1}function Nb(o,s,i,u,_,w,x,C,j){var L=Array.prototype.slice.call(arguments,3);try{s.apply(i,L)}catch(o){this.onError(o)}}var ot=!1,st=null,it=!1,at=null,ct={onError:function(o){ot=!0,st=o}};function Tb(o,s,i,u,_,w,x,C,j){ot=!1,st=null,Nb.apply(ct,arguments)}function Vb(o){var s=o,i=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do{!!(4098&(s=o).flags)&&(i=s.return),o=s.return}while(o)}return 3===s.tag?i:null}function Wb(o){if(13===o.tag){var s=o.memoizedState;if(null===s&&(null!==(o=o.alternate)&&(s=o.memoizedState)),null!==s)return s.dehydrated}return null}function Xb(o){if(Vb(o)!==o)throw Error(p(188))}function Zb(o){return null!==(o=function Yb(o){var s=o.alternate;if(!s){if(null===(s=Vb(o)))throw Error(p(188));return s!==o?null:o}for(var i=o,u=s;;){var _=i.return;if(null===_)break;var w=_.alternate;if(null===w){if(null!==(u=_.return)){i=u;continue}break}if(_.child===w.child){for(w=_.child;w;){if(w===i)return Xb(_),o;if(w===u)return Xb(_),s;w=w.sibling}throw Error(p(188))}if(i.return!==u.return)i=_,u=w;else{for(var x=!1,C=_.child;C;){if(C===i){x=!0,i=_,u=w;break}if(C===u){x=!0,u=_,i=w;break}C=C.sibling}if(!x){for(C=w.child;C;){if(C===i){x=!0,i=w,u=_;break}if(C===u){x=!0,u=w,i=_;break}C=C.sibling}if(!x)throw Error(p(189))}}if(i.alternate!==u)throw Error(p(190))}if(3!==i.tag)throw Error(p(188));return i.stateNode.current===i?o:s}(o))?$b(o):null}function $b(o){if(5===o.tag||6===o.tag)return o;for(o=o.child;null!==o;){var s=$b(o);if(null!==s)return s;o=o.sibling}return null}var lt=_.unstable_scheduleCallback,ut=_.unstable_cancelCallback,pt=_.unstable_shouldYield,ht=_.unstable_requestPaint,dt=_.unstable_now,mt=_.unstable_getCurrentPriorityLevel,gt=_.unstable_ImmediatePriority,yt=_.unstable_UserBlockingPriority,vt=_.unstable_NormalPriority,bt=_.unstable_LowPriority,_t=_.unstable_IdlePriority,Et=null,wt=null;var St=Math.clz32?Math.clz32:function nc(o){return o>>>=0,0===o?32:31-(xt(o)/kt|0)|0},xt=Math.log,kt=Math.LN2;var Ot=64,Ct=4194304;function tc(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&o;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&o;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function uc(o,s){var i=o.pendingLanes;if(0===i)return 0;var u=0,_=o.suspendedLanes,w=o.pingedLanes,x=268435455&i;if(0!==x){var C=x&~_;0!==C?u=tc(C):0!==(w&=x)&&(u=tc(w))}else 0!==(x=i&~_)?u=tc(x):0!==w&&(u=tc(w));if(0===u)return 0;if(0!==s&&s!==u&&!(s&_)&&((_=u&-u)>=(w=s&-s)||16===_&&4194240&w))return s;if(4&u&&(u|=16&i),0!==(s=o.entangledLanes))for(o=o.entanglements,s&=u;0<s;)_=1<<(i=31-St(s)),u|=o[i],s&=~_;return u}function vc(o,s){switch(o){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;default:return-1}}function xc(o){return 0!==(o=-1073741825&o.pendingLanes)?o:1073741824&o?1073741824:0}function yc(){var o=Ot;return!(4194240&(Ot<<=1))&&(Ot=64),o}function zc(o){for(var s=[],i=0;31>i;i++)s.push(o);return s}function Ac(o,s,i){o.pendingLanes|=s,536870912!==s&&(o.suspendedLanes=0,o.pingedLanes=0),(o=o.eventTimes)[s=31-St(s)]=i}function Cc(o,s){var i=o.entangledLanes|=s;for(o=o.entanglements;i;){var u=31-St(i),_=1<<u;_&s|o[u]&s&&(o[u]|=s),i&=~_}}var At=0;function Dc(o){return 1<(o&=-o)?4<o?268435455&o?16:536870912:4:1}var jt,Pt,It,Mt,Nt,Tt=!1,Rt=[],Dt=null,Lt=null,Bt=null,Ft=new Map,qt=new Map,$t=[],Vt=\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit\".split(\" \");function Sc(o,s){switch(o){case\"focusin\":case\"focusout\":Dt=null;break;case\"dragenter\":case\"dragleave\":Lt=null;break;case\"mouseover\":case\"mouseout\":Bt=null;break;case\"pointerover\":case\"pointerout\":Ft.delete(s.pointerId);break;case\"gotpointercapture\":case\"lostpointercapture\":qt.delete(s.pointerId)}}function Tc(o,s,i,u,_,w){return null===o||o.nativeEvent!==w?(o={blockedOn:s,domEventName:i,eventSystemFlags:u,nativeEvent:w,targetContainers:[_]},null!==s&&(null!==(s=Cb(s))&&Pt(s)),o):(o.eventSystemFlags|=u,s=o.targetContainers,null!==_&&-1===s.indexOf(_)&&s.push(_),o)}function Vc(o){var s=Wc(o.target);if(null!==s){var i=Vb(s);if(null!==i)if(13===(s=i.tag)){if(null!==(s=Wb(i)))return o.blockedOn=s,void Nt(o.priority,(function(){It(i)}))}else if(3===s&&i.stateNode.current.memoizedState.isDehydrated)return void(o.blockedOn=3===i.tag?i.stateNode.containerInfo:null)}o.blockedOn=null}function Xc(o){if(null!==o.blockedOn)return!1;for(var s=o.targetContainers;0<s.length;){var i=Yc(o.domEventName,o.eventSystemFlags,s[0],o.nativeEvent);if(null!==i)return null!==(s=Cb(i))&&Pt(s),o.blockedOn=i,!1;var u=new(i=o.nativeEvent).constructor(i.type,i);Ye=u,i.target.dispatchEvent(u),Ye=null,s.shift()}return!0}function Zc(o,s,i){Xc(o)&&i.delete(s)}function $c(){Tt=!1,null!==Dt&&Xc(Dt)&&(Dt=null),null!==Lt&&Xc(Lt)&&(Lt=null),null!==Bt&&Xc(Bt)&&(Bt=null),Ft.forEach(Zc),qt.forEach(Zc)}function ad(o,s){o.blockedOn===s&&(o.blockedOn=null,Tt||(Tt=!0,_.unstable_scheduleCallback(_.unstable_NormalPriority,$c)))}function bd(o){function b(s){return ad(s,o)}if(0<Rt.length){ad(Rt[0],o);for(var s=1;s<Rt.length;s++){var i=Rt[s];i.blockedOn===o&&(i.blockedOn=null)}}for(null!==Dt&&ad(Dt,o),null!==Lt&&ad(Lt,o),null!==Bt&&ad(Bt,o),Ft.forEach(b),qt.forEach(b),s=0;s<$t.length;s++)(i=$t[s]).blockedOn===o&&(i.blockedOn=null);for(;0<$t.length&&null===(s=$t[0]).blockedOn;)Vc(s),null===s.blockedOn&&$t.shift()}var Ut=z.ReactCurrentBatchConfig,zt=!0;function ed(o,s,i,u){var _=At,w=Ut.transition;Ut.transition=null;try{At=1,fd(o,s,i,u)}finally{At=_,Ut.transition=w}}function gd(o,s,i,u){var _=At,w=Ut.transition;Ut.transition=null;try{At=4,fd(o,s,i,u)}finally{At=_,Ut.transition=w}}function fd(o,s,i,u){if(zt){var _=Yc(o,s,i,u);if(null===_)hd(o,s,u,Wt,i),Sc(o,u);else if(function Uc(o,s,i,u,_){switch(s){case\"focusin\":return Dt=Tc(Dt,o,s,i,u,_),!0;case\"dragenter\":return Lt=Tc(Lt,o,s,i,u,_),!0;case\"mouseover\":return Bt=Tc(Bt,o,s,i,u,_),!0;case\"pointerover\":var w=_.pointerId;return Ft.set(w,Tc(Ft.get(w)||null,o,s,i,u,_)),!0;case\"gotpointercapture\":return w=_.pointerId,qt.set(w,Tc(qt.get(w)||null,o,s,i,u,_)),!0}return!1}(_,o,s,i,u))u.stopPropagation();else if(Sc(o,u),4&s&&-1<Vt.indexOf(o)){for(;null!==_;){var w=Cb(_);if(null!==w&&jt(w),null===(w=Yc(o,s,i,u))&&hd(o,s,u,Wt,i),w===_)break;_=w}null!==_&&u.stopPropagation()}else hd(o,s,u,null,i)}}var Wt=null;function Yc(o,s,i,u){if(Wt=null,null!==(o=Wc(o=xb(u))))if(null===(s=Vb(o)))o=null;else if(13===(i=s.tag)){if(null!==(o=Wb(s)))return o;o=null}else if(3===i){if(s.stateNode.current.memoizedState.isDehydrated)return 3===s.tag?s.stateNode.containerInfo:null;o=null}else s!==o&&(o=null);return Wt=o,null}function jd(o){switch(o){case\"cancel\":case\"click\":case\"close\":case\"contextmenu\":case\"copy\":case\"cut\":case\"auxclick\":case\"dblclick\":case\"dragend\":case\"dragstart\":case\"drop\":case\"focusin\":case\"focusout\":case\"input\":case\"invalid\":case\"keydown\":case\"keypress\":case\"keyup\":case\"mousedown\":case\"mouseup\":case\"paste\":case\"pause\":case\"play\":case\"pointercancel\":case\"pointerdown\":case\"pointerup\":case\"ratechange\":case\"reset\":case\"resize\":case\"seeked\":case\"submit\":case\"touchcancel\":case\"touchend\":case\"touchstart\":case\"volumechange\":case\"change\":case\"selectionchange\":case\"textInput\":case\"compositionstart\":case\"compositionend\":case\"compositionupdate\":case\"beforeblur\":case\"afterblur\":case\"beforeinput\":case\"blur\":case\"fullscreenchange\":case\"focus\":case\"hashchange\":case\"popstate\":case\"select\":case\"selectstart\":return 1;case\"drag\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"mousemove\":case\"mouseout\":case\"mouseover\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"scroll\":case\"toggle\":case\"touchmove\":case\"wheel\":case\"mouseenter\":case\"mouseleave\":case\"pointerenter\":case\"pointerleave\":return 4;case\"message\":switch(mt()){case gt:return 1;case yt:return 4;case vt:case bt:return 16;case _t:return 536870912;default:return 16}default:return 16}}var Kt=null,Ht=null,Jt=null;function nd(){if(Jt)return Jt;var o,s,i=Ht,u=i.length,_=\"value\"in Kt?Kt.value:Kt.textContent,w=_.length;for(o=0;o<u&&i[o]===_[o];o++);var x=u-o;for(s=1;s<=x&&i[u-s]===_[w-s];s++);return Jt=_.slice(o,1<s?1-s:void 0)}function od(o){var s=o.keyCode;return\"charCode\"in o?0===(o=o.charCode)&&13===s&&(o=13):o=s,10===o&&(o=13),32<=o||13===o?o:0}function pd(){return!0}function qd(){return!1}function rd(o){function b(s,i,u,_,w){for(var x in this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=_,this.target=w,this.currentTarget=null,o)o.hasOwnProperty(x)&&(s=o[x],this[x]=s?s(_):_[x]);return this.isDefaultPrevented=(null!=_.defaultPrevented?_.defaultPrevented:!1===_.returnValue)?pd:qd,this.isPropagationStopped=qd,this}return xe(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():\"unknown\"!=typeof o.returnValue&&(o.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():\"unknown\"!=typeof o.cancelBubble&&(o.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd}),b}var Gt,Yt,Xt,Qt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zt=rd(Qt),er=xe({},Qt,{view:0,detail:0}),tr=rd(er),rr=xe({},er,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(o){return void 0===o.relatedTarget?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return\"movementX\"in o?o.movementX:(o!==Xt&&(Xt&&\"mousemove\"===o.type?(Gt=o.screenX-Xt.screenX,Yt=o.screenY-Xt.screenY):Yt=Gt=0,Xt=o),Gt)},movementY:function(o){return\"movementY\"in o?o.movementY:Yt}}),nr=rd(rr),sr=rd(xe({},rr,{dataTransfer:0})),ir=rd(xe({},er,{relatedTarget:0})),ar=rd(xe({},Qt,{animationName:0,elapsedTime:0,pseudoElement:0})),cr=xe({},Qt,{clipboardData:function(o){return\"clipboardData\"in o?o.clipboardData:window.clipboardData}}),lr=rd(cr),ur=rd(xe({},Qt,{data:0})),pr={Esc:\"Escape\",Spacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},dr={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",19:\"Pause\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"},fr={Alt:\"altKey\",Control:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};function Pd(o){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(o):!!(o=fr[o])&&!!s[o]}function zd(){return Pd}var mr=xe({},er,{key:function(o){if(o.key){var s=pr[o.key]||o.key;if(\"Unidentified\"!==s)return s}return\"keypress\"===o.type?13===(o=od(o))?\"Enter\":String.fromCharCode(o):\"keydown\"===o.type||\"keyup\"===o.type?dr[o.keyCode]||\"Unidentified\":\"\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(o){return\"keypress\"===o.type?od(o):0},keyCode:function(o){return\"keydown\"===o.type||\"keyup\"===o.type?o.keyCode:0},which:function(o){return\"keypress\"===o.type?od(o):\"keydown\"===o.type||\"keyup\"===o.type?o.keyCode:0}}),gr=rd(mr),yr=rd(xe({},rr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),vr=rd(xe({},er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd})),br=rd(xe({},Qt,{propertyName:0,elapsedTime:0,pseudoElement:0})),_r=xe({},rr,{deltaX:function(o){return\"deltaX\"in o?o.deltaX:\"wheelDeltaX\"in o?-o.wheelDeltaX:0},deltaY:function(o){return\"deltaY\"in o?o.deltaY:\"wheelDeltaY\"in o?-o.wheelDeltaY:\"wheelDelta\"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),Er=rd(_r),wr=[9,13,27,32],Sr=C&&\"CompositionEvent\"in window,xr=null;C&&\"documentMode\"in document&&(xr=document.documentMode);var kr=C&&\"TextEvent\"in window&&!xr,Or=C&&(!Sr||xr&&8<xr&&11>=xr),Cr=String.fromCharCode(32),Ar=!1;function ge(o,s){switch(o){case\"keyup\":return-1!==wr.indexOf(s.keyCode);case\"keydown\":return 229!==s.keyCode;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function he(o){return\"object\"==typeof(o=o.detail)&&\"data\"in o?o.data:null}var jr=!1;var Pr={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return\"input\"===s?!!Pr[o.type]:\"textarea\"===s}function ne(o,s,i,u){Eb(u),0<(s=oe(s,\"onChange\")).length&&(i=new Zt(\"onChange\",\"change\",null,i,u),o.push({event:i,listeners:s}))}var Ir=null,Mr=null;function re(o){se(o,0)}function te(o){if(Wa(ue(o)))return o}function ve(o,s){if(\"change\"===o)return s}var Nr=!1;if(C){var Tr;if(C){var Rr=\"oninput\"in document;if(!Rr){var Dr=document.createElement(\"div\");Dr.setAttribute(\"oninput\",\"return;\"),Rr=\"function\"==typeof Dr.oninput}Tr=Rr}else Tr=!1;Nr=Tr&&(!document.documentMode||9<document.documentMode)}function Ae(){Ir&&(Ir.detachEvent(\"onpropertychange\",Be),Mr=Ir=null)}function Be(o){if(\"value\"===o.propertyName&&te(Mr)){var s=[];ne(s,Mr,o,xb(o)),Jb(re,s)}}function Ce(o,s,i){\"focusin\"===o?(Ae(),Mr=i,(Ir=s).attachEvent(\"onpropertychange\",Be)):\"focusout\"===o&&Ae()}function De(o){if(\"selectionchange\"===o||\"keyup\"===o||\"keydown\"===o)return te(Mr)}function Ee(o,s){if(\"click\"===o)return te(s)}function Fe(o,s){if(\"input\"===o||\"change\"===o)return te(s)}var Lr=\"function\"==typeof Object.is?Object.is:function Ge(o,s){return o===s&&(0!==o||1/o==1/s)||o!=o&&s!=s};function Ie(o,s){if(Lr(o,s))return!0;if(\"object\"!=typeof o||null===o||\"object\"!=typeof s||null===s)return!1;var i=Object.keys(o),u=Object.keys(s);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var _=i[u];if(!j.call(s,_)||!Lr(o[_],s[_]))return!1}return!0}function Je(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Ke(o,s){var i,u=Je(o);for(o=0;u;){if(3===u.nodeType){if(i=o+u.textContent.length,o<=s&&i>=s)return{node:u,offset:s-o};o=i}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Je(u)}}function Le(o,s){return!(!o||!s)&&(o===s||(!o||3!==o.nodeType)&&(s&&3===s.nodeType?Le(o,s.parentNode):\"contains\"in o?o.contains(s):!!o.compareDocumentPosition&&!!(16&o.compareDocumentPosition(s))))}function Me(){for(var o=window,s=Xa();s instanceof o.HTMLIFrameElement;){try{var i=\"string\"==typeof s.contentWindow.location.href}catch(o){i=!1}if(!i)break;s=Xa((o=s.contentWindow).document)}return s}function Ne(o){var s=o&&o.nodeName&&o.nodeName.toLowerCase();return s&&(\"input\"===s&&(\"text\"===o.type||\"search\"===o.type||\"tel\"===o.type||\"url\"===o.type||\"password\"===o.type)||\"textarea\"===s||\"true\"===o.contentEditable)}function Oe(o){var s=Me(),i=o.focusedElem,u=o.selectionRange;if(s!==i&&i&&i.ownerDocument&&Le(i.ownerDocument.documentElement,i)){if(null!==u&&Ne(i))if(s=u.start,void 0===(o=u.end)&&(o=s),\"selectionStart\"in i)i.selectionStart=s,i.selectionEnd=Math.min(o,i.value.length);else if((o=(s=i.ownerDocument||document)&&s.defaultView||window).getSelection){o=o.getSelection();var _=i.textContent.length,w=Math.min(u.start,_);u=void 0===u.end?w:Math.min(u.end,_),!o.extend&&w>u&&(_=u,u=w,w=_),_=Ke(i,w);var x=Ke(i,u);_&&x&&(1!==o.rangeCount||o.anchorNode!==_.node||o.anchorOffset!==_.offset||o.focusNode!==x.node||o.focusOffset!==x.offset)&&((s=s.createRange()).setStart(_.node,_.offset),o.removeAllRanges(),w>u?(o.addRange(s),o.extend(x.node,x.offset)):(s.setEnd(x.node,x.offset),o.addRange(s)))}for(s=[],o=i;o=o.parentNode;)1===o.nodeType&&s.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(\"function\"==typeof i.focus&&i.focus(),i=0;i<s.length;i++)(o=s[i]).element.scrollLeft=o.left,o.element.scrollTop=o.top}}var Br=C&&\"documentMode\"in document&&11>=document.documentMode,Fr=null,qr=null,$r=null,Vr=!1;function Ue(o,s,i){var u=i.window===i?i.document:9===i.nodeType?i:i.ownerDocument;Vr||null==Fr||Fr!==Xa(u)||(\"selectionStart\"in(u=Fr)&&Ne(u)?u={start:u.selectionStart,end:u.selectionEnd}:u={anchorNode:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset},$r&&Ie($r,u)||($r=u,0<(u=oe(qr,\"onSelect\")).length&&(s=new Zt(\"onSelect\",\"select\",null,s,i),o.push({event:s,listeners:u}),s.target=Fr)))}function Ve(o,s){var i={};return i[o.toLowerCase()]=s.toLowerCase(),i[\"Webkit\"+o]=\"webkit\"+s,i[\"Moz\"+o]=\"moz\"+s,i}var Ur={animationend:Ve(\"Animation\",\"AnimationEnd\"),animationiteration:Ve(\"Animation\",\"AnimationIteration\"),animationstart:Ve(\"Animation\",\"AnimationStart\"),transitionend:Ve(\"Transition\",\"TransitionEnd\")},zr={},Wr={};function Ze(o){if(zr[o])return zr[o];if(!Ur[o])return o;var s,i=Ur[o];for(s in i)if(i.hasOwnProperty(s)&&s in Wr)return zr[o]=i[s];return o}C&&(Wr=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),\"TransitionEvent\"in window||delete Ur.transitionend.transition);var Kr=Ze(\"animationend\"),Hr=Ze(\"animationiteration\"),Jr=Ze(\"animationstart\"),Gr=Ze(\"transitionend\"),Yr=new Map,Xr=\"abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\".split(\" \");function ff(o,s){Yr.set(o,s),fa(s,[o])}for(var Qr=0;Qr<Xr.length;Qr++){var Zr=Xr[Qr];ff(Zr.toLowerCase(),\"on\"+(Zr[0].toUpperCase()+Zr.slice(1)))}ff(Kr,\"onAnimationEnd\"),ff(Hr,\"onAnimationIteration\"),ff(Jr,\"onAnimationStart\"),ff(\"dblclick\",\"onDoubleClick\"),ff(\"focusin\",\"onFocus\"),ff(\"focusout\",\"onBlur\"),ff(Gr,\"onTransitionEnd\"),ha(\"onMouseEnter\",[\"mouseout\",\"mouseover\"]),ha(\"onMouseLeave\",[\"mouseout\",\"mouseover\"]),ha(\"onPointerEnter\",[\"pointerout\",\"pointerover\"]),ha(\"onPointerLeave\",[\"pointerout\",\"pointerover\"]),fa(\"onChange\",\"change click focusin focusout input keydown keyup selectionchange\".split(\" \")),fa(\"onSelect\",\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\".split(\" \")),fa(\"onBeforeInput\",[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]),fa(\"onCompositionEnd\",\"compositionend focusout keydown keypress keyup mousedown\".split(\" \")),fa(\"onCompositionStart\",\"compositionstart focusout keydown keypress keyup mousedown\".split(\" \")),fa(\"onCompositionUpdate\",\"compositionupdate focusout keydown keypress keyup mousedown\".split(\" \"));var en=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),tn=new Set(\"cancel close invalid load scroll toggle\".split(\" \").concat(en));function nf(o,s,i){var u=o.type||\"unknown-event\";o.currentTarget=i,function Ub(o,s,i,u,_,w,x,C,j){if(Tb.apply(this,arguments),ot){if(!ot)throw Error(p(198));var L=st;ot=!1,st=null,it||(it=!0,at=L)}}(u,s,void 0,o),o.currentTarget=null}function se(o,s){s=!!(4&s);for(var i=0;i<o.length;i++){var u=o[i],_=u.event;u=u.listeners;e:{var w=void 0;if(s)for(var x=u.length-1;0<=x;x--){var C=u[x],j=C.instance,L=C.currentTarget;if(C=C.listener,j!==w&&_.isPropagationStopped())break e;nf(_,C,L),w=j}else for(x=0;x<u.length;x++){if(j=(C=u[x]).instance,L=C.currentTarget,C=C.listener,j!==w&&_.isPropagationStopped())break e;nf(_,C,L),w=j}}}if(it)throw o=at,it=!1,at=null,o}function D(o,s){var i=s[gn];void 0===i&&(i=s[gn]=new Set);var u=o+\"__bubble\";i.has(u)||(pf(s,o,2,!1),i.add(u))}function qf(o,s,i){var u=0;s&&(u|=4),pf(i,o,u,s)}var rn=\"_reactListening\"+Math.random().toString(36).slice(2);function sf(o){if(!o[rn]){o[rn]=!0,w.forEach((function(s){\"selectionchange\"!==s&&(tn.has(s)||qf(s,!1,o),qf(s,!0,o))}));var s=9===o.nodeType?o:o.ownerDocument;null===s||s[rn]||(s[rn]=!0,qf(\"selectionchange\",!1,s))}}function pf(o,s,i,u){switch(jd(s)){case 1:var _=ed;break;case 4:_=gd;break;default:_=fd}i=_.bind(null,s,i,o),_=void 0,!rt||\"touchstart\"!==s&&\"touchmove\"!==s&&\"wheel\"!==s||(_=!0),u?void 0!==_?o.addEventListener(s,i,{capture:!0,passive:_}):o.addEventListener(s,i,!0):void 0!==_?o.addEventListener(s,i,{passive:_}):o.addEventListener(s,i,!1)}function hd(o,s,i,u,_){var w=u;if(!(1&s||2&s||null===u))e:for(;;){if(null===u)return;var x=u.tag;if(3===x||4===x){var C=u.stateNode.containerInfo;if(C===_||8===C.nodeType&&C.parentNode===_)break;if(4===x)for(x=u.return;null!==x;){var j=x.tag;if((3===j||4===j)&&((j=x.stateNode.containerInfo)===_||8===j.nodeType&&j.parentNode===_))return;x=x.return}for(;null!==C;){if(null===(x=Wc(C)))return;if(5===(j=x.tag)||6===j){u=w=x;continue e}C=C.parentNode}}u=u.return}Jb((function(){var u=w,_=xb(i),x=[];e:{var C=Yr.get(o);if(void 0!==C){var j=Zt,L=o;switch(o){case\"keypress\":if(0===od(i))break e;case\"keydown\":case\"keyup\":j=gr;break;case\"focusin\":L=\"focus\",j=ir;break;case\"focusout\":L=\"blur\",j=ir;break;case\"beforeblur\":case\"afterblur\":j=ir;break;case\"click\":if(2===i.button)break e;case\"auxclick\":case\"dblclick\":case\"mousedown\":case\"mousemove\":case\"mouseup\":case\"mouseout\":case\"mouseover\":case\"contextmenu\":j=nr;break;case\"drag\":case\"dragend\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"dragstart\":case\"drop\":j=sr;break;case\"touchcancel\":case\"touchend\":case\"touchmove\":case\"touchstart\":j=vr;break;case Kr:case Hr:case Jr:j=ar;break;case Gr:j=br;break;case\"scroll\":j=tr;break;case\"wheel\":j=Er;break;case\"copy\":case\"cut\":case\"paste\":j=lr;break;case\"gotpointercapture\":case\"lostpointercapture\":case\"pointercancel\":case\"pointerdown\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"pointerup\":j=yr}var B=!!(4&s),$=!B&&\"scroll\"===o,V=B?null!==C?C+\"Capture\":null:C;B=[];for(var U,z=u;null!==z;){var Y=(U=z).stateNode;if(5===U.tag&&null!==Y&&(U=Y,null!==V&&(null!=(Y=Kb(z,V))&&B.push(tf(z,Y,U)))),$)break;z=z.return}0<B.length&&(C=new j(C,L,null,i,_),x.push({event:C,listeners:B}))}}if(!(7&s)){if(j=\"mouseout\"===o||\"pointerout\"===o,(!(C=\"mouseover\"===o||\"pointerover\"===o)||i===Ye||!(L=i.relatedTarget||i.fromElement)||!Wc(L)&&!L[mn])&&(j||C)&&(C=_.window===_?_:(C=_.ownerDocument)?C.defaultView||C.parentWindow:window,j?(j=u,null!==(L=(L=i.relatedTarget||i.toElement)?Wc(L):null)&&(L!==($=Vb(L))||5!==L.tag&&6!==L.tag)&&(L=null)):(j=null,L=u),j!==L)){if(B=nr,Y=\"onMouseLeave\",V=\"onMouseEnter\",z=\"mouse\",\"pointerout\"!==o&&\"pointerover\"!==o||(B=yr,Y=\"onPointerLeave\",V=\"onPointerEnter\",z=\"pointer\"),$=null==j?C:ue(j),U=null==L?C:ue(L),(C=new B(Y,z+\"leave\",j,i,_)).target=$,C.relatedTarget=U,Y=null,Wc(_)===u&&((B=new B(V,z+\"enter\",L,i,_)).target=U,B.relatedTarget=$,Y=B),$=Y,j&&L)e:{for(V=L,z=0,U=B=j;U;U=vf(U))z++;for(U=0,Y=V;Y;Y=vf(Y))U++;for(;0<z-U;)B=vf(B),z--;for(;0<U-z;)V=vf(V),U--;for(;z--;){if(B===V||null!==V&&B===V.alternate)break e;B=vf(B),V=vf(V)}B=null}else B=null;null!==j&&wf(x,C,j,B,!1),null!==L&&null!==$&&wf(x,$,L,B,!0)}if(\"select\"===(j=(C=u?ue(u):window).nodeName&&C.nodeName.toLowerCase())||\"input\"===j&&\"file\"===C.type)var Z=ve;else if(me(C))if(Nr)Z=Fe;else{Z=De;var ee=Ce}else(j=C.nodeName)&&\"input\"===j.toLowerCase()&&(\"checkbox\"===C.type||\"radio\"===C.type)&&(Z=Ee);switch(Z&&(Z=Z(o,u))?ne(x,Z,i,_):(ee&&ee(o,C,u),\"focusout\"===o&&(ee=C._wrapperState)&&ee.controlled&&\"number\"===C.type&&cb(C,\"number\",C.value)),ee=u?ue(u):window,o){case\"focusin\":(me(ee)||\"true\"===ee.contentEditable)&&(Fr=ee,qr=u,$r=null);break;case\"focusout\":$r=qr=Fr=null;break;case\"mousedown\":Vr=!0;break;case\"contextmenu\":case\"mouseup\":case\"dragend\":Vr=!1,Ue(x,i,_);break;case\"selectionchange\":if(Br)break;case\"keydown\":case\"keyup\":Ue(x,i,_)}var ie;if(Sr)e:{switch(o){case\"compositionstart\":var ae=\"onCompositionStart\";break e;case\"compositionend\":ae=\"onCompositionEnd\";break e;case\"compositionupdate\":ae=\"onCompositionUpdate\";break e}ae=void 0}else jr?ge(o,i)&&(ae=\"onCompositionEnd\"):\"keydown\"===o&&229===i.keyCode&&(ae=\"onCompositionStart\");ae&&(Or&&\"ko\"!==i.locale&&(jr||\"onCompositionStart\"!==ae?\"onCompositionEnd\"===ae&&jr&&(ie=nd()):(Ht=\"value\"in(Kt=_)?Kt.value:Kt.textContent,jr=!0)),0<(ee=oe(u,ae)).length&&(ae=new ur(ae,o,null,i,_),x.push({event:ae,listeners:ee}),ie?ae.data=ie:null!==(ie=he(i))&&(ae.data=ie))),(ie=kr?function je(o,s){switch(o){case\"compositionend\":return he(s);case\"keypress\":return 32!==s.which?null:(Ar=!0,Cr);case\"textInput\":return(o=s.data)===Cr&&Ar?null:o;default:return null}}(o,i):function ke(o,s){if(jr)return\"compositionend\"===o||!Sr&&ge(o,s)?(o=nd(),Jt=Ht=Kt=null,jr=!1,o):null;switch(o){case\"paste\":default:return null;case\"keypress\":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case\"compositionend\":return Or&&\"ko\"!==s.locale?null:s.data}}(o,i))&&(0<(u=oe(u,\"onBeforeInput\")).length&&(_=new ur(\"onBeforeInput\",\"beforeinput\",null,i,_),x.push({event:_,listeners:u}),_.data=ie))}se(x,s)}))}function tf(o,s,i){return{instance:o,listener:s,currentTarget:i}}function oe(o,s){for(var i=s+\"Capture\",u=[];null!==o;){var _=o,w=_.stateNode;5===_.tag&&null!==w&&(_=w,null!=(w=Kb(o,i))&&u.unshift(tf(o,w,_)),null!=(w=Kb(o,s))&&u.push(tf(o,w,_))),o=o.return}return u}function vf(o){if(null===o)return null;do{o=o.return}while(o&&5!==o.tag);return o||null}function wf(o,s,i,u,_){for(var w=s._reactName,x=[];null!==i&&i!==u;){var C=i,j=C.alternate,L=C.stateNode;if(null!==j&&j===u)break;5===C.tag&&null!==L&&(C=L,_?null!=(j=Kb(i,w))&&x.unshift(tf(i,j,C)):_||null!=(j=Kb(i,w))&&x.push(tf(i,j,C))),i=i.return}0!==x.length&&o.push({event:s,listeners:x})}var nn=/\\r\\n?/g,on=/\\u0000|\\uFFFD/g;function zf(o){return(\"string\"==typeof o?o:\"\"+o).replace(nn,\"\\n\").replace(on,\"\")}function Af(o,s,i){if(s=zf(s),zf(o)!==s&&i)throw Error(p(425))}function Bf(){}var sn=null,an=null;function Ef(o,s){return\"textarea\"===o||\"noscript\"===o||\"string\"==typeof s.children||\"number\"==typeof s.children||\"object\"==typeof s.dangerouslySetInnerHTML&&null!==s.dangerouslySetInnerHTML&&null!=s.dangerouslySetInnerHTML.__html}var cn=\"function\"==typeof setTimeout?setTimeout:void 0,ln=\"function\"==typeof clearTimeout?clearTimeout:void 0,un=\"function\"==typeof Promise?Promise:void 0,pn=\"function\"==typeof queueMicrotask?queueMicrotask:void 0!==un?function(o){return un.resolve(null).then(o).catch(If)}:cn;function If(o){setTimeout((function(){throw o}))}function Kf(o,s){var i=s,u=0;do{var _=i.nextSibling;if(o.removeChild(i),_&&8===_.nodeType)if(\"/$\"===(i=_.data)){if(0===u)return o.removeChild(_),void bd(s);u--}else\"$\"!==i&&\"$?\"!==i&&\"$!\"!==i||u++;i=_}while(i);bd(s)}function Lf(o){for(;null!=o;o=o.nextSibling){var s=o.nodeType;if(1===s||3===s)break;if(8===s){if(\"$\"===(s=o.data)||\"$!\"===s||\"$?\"===s)break;if(\"/$\"===s)return null}}return o}function Mf(o){o=o.previousSibling;for(var s=0;o;){if(8===o.nodeType){var i=o.data;if(\"$\"===i||\"$!\"===i||\"$?\"===i){if(0===s)return o;s--}else\"/$\"===i&&s++}o=o.previousSibling}return null}var hn=Math.random().toString(36).slice(2),dn=\"__reactFiber$\"+hn,fn=\"__reactProps$\"+hn,mn=\"__reactContainer$\"+hn,gn=\"__reactEvents$\"+hn,yn=\"__reactListeners$\"+hn,vn=\"__reactHandles$\"+hn;function Wc(o){var s=o[dn];if(s)return s;for(var i=o.parentNode;i;){if(s=i[mn]||i[dn]){if(i=s.alternate,null!==s.child||null!==i&&null!==i.child)for(o=Mf(o);null!==o;){if(i=o[dn])return i;o=Mf(o)}return s}i=(o=i).parentNode}return null}function Cb(o){return!(o=o[dn]||o[mn])||5!==o.tag&&6!==o.tag&&13!==o.tag&&3!==o.tag?null:o}function ue(o){if(5===o.tag||6===o.tag)return o.stateNode;throw Error(p(33))}function Db(o){return o[fn]||null}var bn=[],_n=-1;function Uf(o){return{current:o}}function E(o){0>_n||(o.current=bn[_n],bn[_n]=null,_n--)}function G(o,s){_n++,bn[_n]=o.current,o.current=s}var En={},wn=Uf(En),Sn=Uf(!1),xn=En;function Yf(o,s){var i=o.type.contextTypes;if(!i)return En;var u=o.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===s)return u.__reactInternalMemoizedMaskedChildContext;var _,w={};for(_ in i)w[_]=s[_];return u&&((o=o.stateNode).__reactInternalMemoizedUnmaskedChildContext=s,o.__reactInternalMemoizedMaskedChildContext=w),w}function Zf(o){return null!=(o=o.childContextTypes)}function $f(){E(Sn),E(wn)}function ag(o,s,i){if(wn.current!==En)throw Error(p(168));G(wn,s),G(Sn,i)}function bg(o,s,i){var u=o.stateNode;if(s=s.childContextTypes,\"function\"!=typeof u.getChildContext)return i;for(var _ in u=u.getChildContext())if(!(_ in s))throw Error(p(108,Ra(o)||\"Unknown\",_));return xe({},i,u)}function cg(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||En,xn=wn.current,G(wn,o),G(Sn,Sn.current),!0}function dg(o,s,i){var u=o.stateNode;if(!u)throw Error(p(169));i?(o=bg(o,s,xn),u.__reactInternalMemoizedMergedChildContext=o,E(Sn),E(wn),G(wn,o)):E(Sn),G(Sn,i)}var kn=null,On=!1,Cn=!1;function hg(o){null===kn?kn=[o]:kn.push(o)}function jg(){if(!Cn&&null!==kn){Cn=!0;var o=0,s=At;try{var i=kn;for(At=1;o<i.length;o++){var u=i[o];do{u=u(!0)}while(null!==u)}kn=null,On=!1}catch(s){throw null!==kn&&(kn=kn.slice(o+1)),lt(gt,jg),s}finally{At=s,Cn=!1}}return null}var An=[],jn=0,Pn=null,In=0,Mn=[],Nn=0,Tn=null,Rn=1,Dn=\"\";function tg(o,s){An[jn++]=In,An[jn++]=Pn,Pn=o,In=s}function ug(o,s,i){Mn[Nn++]=Rn,Mn[Nn++]=Dn,Mn[Nn++]=Tn,Tn=o;var u=Rn;o=Dn;var _=32-St(u)-1;u&=~(1<<_),i+=1;var w=32-St(s)+_;if(30<w){var x=_-_%5;w=(u&(1<<x)-1).toString(32),u>>=x,_-=x,Rn=1<<32-St(s)+_|i<<_|u,Dn=w+o}else Rn=1<<w|i<<_|u,Dn=o}function vg(o){null!==o.return&&(tg(o,1),ug(o,1,0))}function wg(o){for(;o===Pn;)Pn=An[--jn],An[jn]=null,In=An[--jn],An[jn]=null;for(;o===Tn;)Tn=Mn[--Nn],Mn[Nn]=null,Dn=Mn[--Nn],Mn[Nn]=null,Rn=Mn[--Nn],Mn[Nn]=null}var Ln=null,Bn=null,Fn=!1,qn=null;function Ag(o,s){var i=Bg(5,null,null,0);i.elementType=\"DELETED\",i.stateNode=s,i.return=o,null===(s=o.deletions)?(o.deletions=[i],o.flags|=16):s.push(i)}function Cg(o,s){switch(o.tag){case 5:var i=o.type;return null!==(s=1!==s.nodeType||i.toLowerCase()!==s.nodeName.toLowerCase()?null:s)&&(o.stateNode=s,Ln=o,Bn=Lf(s.firstChild),!0);case 6:return null!==(s=\"\"===o.pendingProps||3!==s.nodeType?null:s)&&(o.stateNode=s,Ln=o,Bn=null,!0);case 13:return null!==(s=8!==s.nodeType?null:s)&&(i=null!==Tn?{id:Rn,overflow:Dn}:null,o.memoizedState={dehydrated:s,treeContext:i,retryLane:1073741824},(i=Bg(18,null,null,0)).stateNode=s,i.return=o,o.child=i,Ln=o,Bn=null,!0);default:return!1}}function Dg(o){return!(!(1&o.mode)||128&o.flags)}function Eg(o){if(Fn){var s=Bn;if(s){var i=s;if(!Cg(o,s)){if(Dg(o))throw Error(p(418));s=Lf(i.nextSibling);var u=Ln;s&&Cg(o,s)?Ag(u,i):(o.flags=-4097&o.flags|2,Fn=!1,Ln=o)}}else{if(Dg(o))throw Error(p(418));o.flags=-4097&o.flags|2,Fn=!1,Ln=o}}}function Fg(o){for(o=o.return;null!==o&&5!==o.tag&&3!==o.tag&&13!==o.tag;)o=o.return;Ln=o}function Gg(o){if(o!==Ln)return!1;if(!Fn)return Fg(o),Fn=!0,!1;var s;if((s=3!==o.tag)&&!(s=5!==o.tag)&&(s=\"head\"!==(s=o.type)&&\"body\"!==s&&!Ef(o.type,o.memoizedProps)),s&&(s=Bn)){if(Dg(o))throw Hg(),Error(p(418));for(;s;)Ag(o,s),s=Lf(s.nextSibling)}if(Fg(o),13===o.tag){if(!(o=null!==(o=o.memoizedState)?o.dehydrated:null))throw Error(p(317));e:{for(o=o.nextSibling,s=0;o;){if(8===o.nodeType){var i=o.data;if(\"/$\"===i){if(0===s){Bn=Lf(o.nextSibling);break e}s--}else\"$\"!==i&&\"$!\"!==i&&\"$?\"!==i||s++}o=o.nextSibling}Bn=null}}else Bn=Ln?Lf(o.stateNode.nextSibling):null;return!0}function Hg(){for(var o=Bn;o;)o=Lf(o.nextSibling)}function Ig(){Bn=Ln=null,Fn=!1}function Jg(o){null===qn?qn=[o]:qn.push(o)}var $n=z.ReactCurrentBatchConfig;function Lg(o,s,i){if(null!==(o=i.ref)&&\"function\"!=typeof o&&\"object\"!=typeof o){if(i._owner){if(i=i._owner){if(1!==i.tag)throw Error(p(309));var u=i.stateNode}if(!u)throw Error(p(147,o));var _=u,w=\"\"+o;return null!==s&&null!==s.ref&&\"function\"==typeof s.ref&&s.ref._stringRef===w?s.ref:(s=function(o){var s=_.refs;null===o?delete s[w]:s[w]=o},s._stringRef=w,s)}if(\"string\"!=typeof o)throw Error(p(284));if(!i._owner)throw Error(p(290,o))}return o}function Mg(o,s){throw o=Object.prototype.toString.call(s),Error(p(31,\"[object Object]\"===o?\"object with keys {\"+Object.keys(s).join(\", \")+\"}\":o))}function Ng(o){return(0,o._init)(o._payload)}function Og(o){function b(s,i){if(o){var u=s.deletions;null===u?(s.deletions=[i],s.flags|=16):u.push(i)}}function c(s,i){if(!o)return null;for(;null!==i;)b(s,i),i=i.sibling;return null}function d(o,s){for(o=new Map;null!==s;)null!==s.key?o.set(s.key,s):o.set(s.index,s),s=s.sibling;return o}function e(o,s){return(o=Pg(o,s)).index=0,o.sibling=null,o}function f(s,i,u){return s.index=u,o?null!==(u=s.alternate)?(u=u.index)<i?(s.flags|=2,i):u:(s.flags|=2,i):(s.flags|=1048576,i)}function g(s){return o&&null===s.alternate&&(s.flags|=2),s}function h(o,s,i,u){return null===s||6!==s.tag?((s=Qg(i,o.mode,u)).return=o,s):((s=e(s,i)).return=o,s)}function k(o,s,i,u){var _=i.type;return _===ee?m(o,s,i.props.children,u,i.key):null!==s&&(s.elementType===_||\"object\"==typeof _&&null!==_&&_.$$typeof===be&&Ng(_)===s.type)?((u=e(s,i.props)).ref=Lg(o,s,i),u.return=o,u):((u=Rg(i.type,i.key,i.props,null,o.mode,u)).ref=Lg(o,s,i),u.return=o,u)}function l(o,s,i,u){return null===s||4!==s.tag||s.stateNode.containerInfo!==i.containerInfo||s.stateNode.implementation!==i.implementation?((s=Sg(i,o.mode,u)).return=o,s):((s=e(s,i.children||[])).return=o,s)}function m(o,s,i,u,_){return null===s||7!==s.tag?((s=Tg(i,o.mode,u,_)).return=o,s):((s=e(s,i)).return=o,s)}function q(o,s,i){if(\"string\"==typeof s&&\"\"!==s||\"number\"==typeof s)return(s=Qg(\"\"+s,o.mode,i)).return=o,s;if(\"object\"==typeof s&&null!==s){switch(s.$$typeof){case Y:return(i=Rg(s.type,s.key,s.props,null,o.mode,i)).ref=Lg(o,null,s),i.return=o,i;case Z:return(s=Sg(s,o.mode,i)).return=o,s;case be:return q(o,(0,s._init)(s._payload),i)}if(Te(s)||Ka(s))return(s=Tg(s,o.mode,i,null)).return=o,s;Mg(o,s)}return null}function r(o,s,i,u){var _=null!==s?s.key:null;if(\"string\"==typeof i&&\"\"!==i||\"number\"==typeof i)return null!==_?null:h(o,s,\"\"+i,u);if(\"object\"==typeof i&&null!==i){switch(i.$$typeof){case Y:return i.key===_?k(o,s,i,u):null;case Z:return i.key===_?l(o,s,i,u):null;case be:return r(o,s,(_=i._init)(i._payload),u)}if(Te(i)||Ka(i))return null!==_?null:m(o,s,i,u,null);Mg(o,i)}return null}function y(o,s,i,u,_){if(\"string\"==typeof u&&\"\"!==u||\"number\"==typeof u)return h(s,o=o.get(i)||null,\"\"+u,_);if(\"object\"==typeof u&&null!==u){switch(u.$$typeof){case Y:return k(s,o=o.get(null===u.key?i:u.key)||null,u,_);case Z:return l(s,o=o.get(null===u.key?i:u.key)||null,u,_);case be:return y(o,s,i,(0,u._init)(u._payload),_)}if(Te(u)||Ka(u))return m(s,o=o.get(i)||null,u,_,null);Mg(s,u)}return null}function n(s,i,u,_){for(var w=null,x=null,C=i,j=i=0,L=null;null!==C&&j<u.length;j++){C.index>j?(L=C,C=null):L=C.sibling;var B=r(s,C,u[j],_);if(null===B){null===C&&(C=L);break}o&&C&&null===B.alternate&&b(s,C),i=f(B,i,j),null===x?w=B:x.sibling=B,x=B,C=L}if(j===u.length)return c(s,C),Fn&&tg(s,j),w;if(null===C){for(;j<u.length;j++)null!==(C=q(s,u[j],_))&&(i=f(C,i,j),null===x?w=C:x.sibling=C,x=C);return Fn&&tg(s,j),w}for(C=d(s,C);j<u.length;j++)null!==(L=y(C,s,j,u[j],_))&&(o&&null!==L.alternate&&C.delete(null===L.key?j:L.key),i=f(L,i,j),null===x?w=L:x.sibling=L,x=L);return o&&C.forEach((function(o){return b(s,o)})),Fn&&tg(s,j),w}function t(s,i,u,_){var w=Ka(u);if(\"function\"!=typeof w)throw Error(p(150));if(null==(u=w.call(u)))throw Error(p(151));for(var x=w=null,C=i,j=i=0,L=null,B=u.next();null!==C&&!B.done;j++,B=u.next()){C.index>j?(L=C,C=null):L=C.sibling;var $=r(s,C,B.value,_);if(null===$){null===C&&(C=L);break}o&&C&&null===$.alternate&&b(s,C),i=f($,i,j),null===x?w=$:x.sibling=$,x=$,C=L}if(B.done)return c(s,C),Fn&&tg(s,j),w;if(null===C){for(;!B.done;j++,B=u.next())null!==(B=q(s,B.value,_))&&(i=f(B,i,j),null===x?w=B:x.sibling=B,x=B);return Fn&&tg(s,j),w}for(C=d(s,C);!B.done;j++,B=u.next())null!==(B=y(C,s,j,B.value,_))&&(o&&null!==B.alternate&&C.delete(null===B.key?j:B.key),i=f(B,i,j),null===x?w=B:x.sibling=B,x=B);return o&&C.forEach((function(o){return b(s,o)})),Fn&&tg(s,j),w}return function J(o,s,i,u){if(\"object\"==typeof i&&null!==i&&i.type===ee&&null===i.key&&(i=i.props.children),\"object\"==typeof i&&null!==i){switch(i.$$typeof){case Y:e:{for(var _=i.key,w=s;null!==w;){if(w.key===_){if((_=i.type)===ee){if(7===w.tag){c(o,w.sibling),(s=e(w,i.props.children)).return=o,o=s;break e}}else if(w.elementType===_||\"object\"==typeof _&&null!==_&&_.$$typeof===be&&Ng(_)===w.type){c(o,w.sibling),(s=e(w,i.props)).ref=Lg(o,w,i),s.return=o,o=s;break e}c(o,w);break}b(o,w),w=w.sibling}i.type===ee?((s=Tg(i.props.children,o.mode,u,i.key)).return=o,o=s):((u=Rg(i.type,i.key,i.props,null,o.mode,u)).ref=Lg(o,s,i),u.return=o,o=u)}return g(o);case Z:e:{for(w=i.key;null!==s;){if(s.key===w){if(4===s.tag&&s.stateNode.containerInfo===i.containerInfo&&s.stateNode.implementation===i.implementation){c(o,s.sibling),(s=e(s,i.children||[])).return=o,o=s;break e}c(o,s);break}b(o,s),s=s.sibling}(s=Sg(i,o.mode,u)).return=o,o=s}return g(o);case be:return J(o,s,(w=i._init)(i._payload),u)}if(Te(i))return n(o,s,i,u);if(Ka(i))return t(o,s,i,u);Mg(o,i)}return\"string\"==typeof i&&\"\"!==i||\"number\"==typeof i?(i=\"\"+i,null!==s&&6===s.tag?(c(o,s.sibling),(s=e(s,i)).return=o,o=s):(c(o,s),(s=Qg(i,o.mode,u)).return=o,o=s),g(o)):c(o,s)}}var Vn=Og(!0),Un=Og(!1),zn=Uf(null),Wn=null,Kn=null,Hn=null;function $g(){Hn=Kn=Wn=null}function ah(o){var s=zn.current;E(zn),o._currentValue=s}function bh(o,s,i){for(;null!==o;){var u=o.alternate;if((o.childLanes&s)!==s?(o.childLanes|=s,null!==u&&(u.childLanes|=s)):null!==u&&(u.childLanes&s)!==s&&(u.childLanes|=s),o===i)break;o=o.return}}function ch(o,s){Wn=o,Hn=Kn=null,null!==(o=o.dependencies)&&null!==o.firstContext&&(!!(o.lanes&s)&&(_o=!0),o.firstContext=null)}function eh(o){var s=o._currentValue;if(Hn!==o)if(o={context:o,memoizedValue:s,next:null},null===Kn){if(null===Wn)throw Error(p(308));Kn=o,Wn.dependencies={lanes:0,firstContext:o}}else Kn=Kn.next=o;return s}var Jn=null;function gh(o){null===Jn?Jn=[o]:Jn.push(o)}function hh(o,s,i,u){var _=s.interleaved;return null===_?(i.next=i,gh(s)):(i.next=_.next,_.next=i),s.interleaved=i,ih(o,u)}function ih(o,s){o.lanes|=s;var i=o.alternate;for(null!==i&&(i.lanes|=s),i=o,o=o.return;null!==o;)o.childLanes|=s,null!==(i=o.alternate)&&(i.childLanes|=s),i=o,o=o.return;return 3===i.tag?i.stateNode:null}var Gn=!1;function kh(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(o,s){o=o.updateQueue,s.updateQueue===o&&(s.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function mh(o,s){return{eventTime:o,lane:s,tag:0,payload:null,callback:null,next:null}}function nh(o,s,i){var u=o.updateQueue;if(null===u)return null;if(u=u.shared,2&Bo){var _=u.pending;return null===_?s.next=s:(s.next=_.next,_.next=s),u.pending=s,ih(o,i)}return null===(_=u.interleaved)?(s.next=s,gh(u)):(s.next=_.next,_.next=s),u.interleaved=s,ih(o,i)}function oh(o,s,i){if(null!==(s=s.updateQueue)&&(s=s.shared,4194240&i)){var u=s.lanes;i|=u&=o.pendingLanes,s.lanes=i,Cc(o,i)}}function ph(o,s){var i=o.updateQueue,u=o.alternate;if(null!==u&&i===(u=u.updateQueue)){var _=null,w=null;if(null!==(i=i.firstBaseUpdate)){do{var x={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};null===w?_=w=x:w=w.next=x,i=i.next}while(null!==i);null===w?_=w=s:w=w.next=s}else _=w=s;return i={baseState:u.baseState,firstBaseUpdate:_,lastBaseUpdate:w,shared:u.shared,effects:u.effects},void(o.updateQueue=i)}null===(o=i.lastBaseUpdate)?i.firstBaseUpdate=s:o.next=s,i.lastBaseUpdate=s}function qh(o,s,i,u){var _=o.updateQueue;Gn=!1;var w=_.firstBaseUpdate,x=_.lastBaseUpdate,C=_.shared.pending;if(null!==C){_.shared.pending=null;var j=C,L=j.next;j.next=null,null===x?w=L:x.next=L,x=j;var B=o.alternate;null!==B&&((C=(B=B.updateQueue).lastBaseUpdate)!==x&&(null===C?B.firstBaseUpdate=L:C.next=L,B.lastBaseUpdate=j))}if(null!==w){var $=_.baseState;for(x=0,B=L=j=null,C=w;;){var V=C.lane,U=C.eventTime;if((u&V)===V){null!==B&&(B=B.next={eventTime:U,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var z=o,Y=C;switch(V=s,U=i,Y.tag){case 1:if(\"function\"==typeof(z=Y.payload)){$=z.call(U,$,V);break e}$=z;break e;case 3:z.flags=-65537&z.flags|128;case 0:if(null==(V=\"function\"==typeof(z=Y.payload)?z.call(U,$,V):z))break e;$=xe({},$,V);break e;case 2:Gn=!0}}null!==C.callback&&0!==C.lane&&(o.flags|=64,null===(V=_.effects)?_.effects=[C]:V.push(C))}else U={eventTime:U,lane:V,tag:C.tag,payload:C.payload,callback:C.callback,next:null},null===B?(L=B=U,j=$):B=B.next=U,x|=V;if(null===(C=C.next)){if(null===(C=_.shared.pending))break;C=(V=C).next,V.next=null,_.lastBaseUpdate=V,_.shared.pending=null}}if(null===B&&(j=$),_.baseState=j,_.firstBaseUpdate=L,_.lastBaseUpdate=B,null!==(s=_.shared.interleaved)){_=s;do{x|=_.lane,_=_.next}while(_!==s)}else null===w&&(_.shared.lanes=0);Ko|=x,o.lanes=x,o.memoizedState=$}}function sh(o,s,i){if(o=s.effects,s.effects=null,null!==o)for(s=0;s<o.length;s++){var u=o[s],_=u.callback;if(null!==_){if(u.callback=null,u=i,\"function\"!=typeof _)throw Error(p(191,_));_.call(u)}}}var Yn={},Xn=Uf(Yn),Qn=Uf(Yn),Zn=Uf(Yn);function xh(o){if(o===Yn)throw Error(p(174));return o}function yh(o,s){switch(G(Zn,s),G(Qn,o),G(Xn,Yn),o=s.nodeType){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:lb(null,\"\");break;default:s=lb(s=(o=8===o?s.parentNode:s).namespaceURI||null,o=o.tagName)}E(Xn),G(Xn,s)}function zh(){E(Xn),E(Qn),E(Zn)}function Ah(o){xh(Zn.current);var s=xh(Xn.current),i=lb(s,o.type);s!==i&&(G(Qn,o),G(Xn,i))}function Bh(o){Qn.current===o&&(E(Xn),E(Qn))}var eo=Uf(0);function Ch(o){for(var s=o;null!==s;){if(13===s.tag){var i=s.memoizedState;if(null!==i&&(null===(i=i.dehydrated)||\"$?\"===i.data||\"$!\"===i.data))return s}else if(19===s.tag&&void 0!==s.memoizedProps.revealOrder){if(128&s.flags)return s}else if(null!==s.child){s.child.return=s,s=s.child;continue}if(s===o)break;for(;null===s.sibling;){if(null===s.return||s.return===o)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var to=[];function Eh(){for(var o=0;o<to.length;o++)to[o]._workInProgressVersionPrimary=null;to.length=0}var ro=z.ReactCurrentDispatcher,no=z.ReactCurrentBatchConfig,oo=0,so=null,io=null,ao=null,co=!1,lo=!1,uo=0,po=0;function P(){throw Error(p(321))}function Mh(o,s){if(null===s)return!1;for(var i=0;i<s.length&&i<o.length;i++)if(!Lr(o[i],s[i]))return!1;return!0}function Nh(o,s,i,u,_,w){if(oo=w,so=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,ro.current=null===o||null===o.memoizedState?fo:mo,o=i(u,_),lo){w=0;do{if(lo=!1,uo=0,25<=w)throw Error(p(301));w+=1,ao=io=null,s.updateQueue=null,ro.current=go,o=i(u,_)}while(lo)}if(ro.current=ho,s=null!==io&&null!==io.next,oo=0,ao=io=so=null,co=!1,s)throw Error(p(300));return o}function Sh(){var o=0!==uo;return uo=0,o}function Th(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ao?so.memoizedState=ao=o:ao=ao.next=o,ao}function Uh(){if(null===io){var o=so.alternate;o=null!==o?o.memoizedState:null}else o=io.next;var s=null===ao?so.memoizedState:ao.next;if(null!==s)ao=s,io=o;else{if(null===o)throw Error(p(310));o={memoizedState:(io=o).memoizedState,baseState:io.baseState,baseQueue:io.baseQueue,queue:io.queue,next:null},null===ao?so.memoizedState=ao=o:ao=ao.next=o}return ao}function Vh(o,s){return\"function\"==typeof s?s(o):s}function Wh(o){var s=Uh(),i=s.queue;if(null===i)throw Error(p(311));i.lastRenderedReducer=o;var u=io,_=u.baseQueue,w=i.pending;if(null!==w){if(null!==_){var x=_.next;_.next=w.next,w.next=x}u.baseQueue=_=w,i.pending=null}if(null!==_){w=_.next,u=u.baseState;var C=x=null,j=null,L=w;do{var B=L.lane;if((oo&B)===B)null!==j&&(j=j.next={lane:0,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),u=L.hasEagerState?L.eagerState:o(u,L.action);else{var $={lane:B,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null};null===j?(C=j=$,x=u):j=j.next=$,so.lanes|=B,Ko|=B}L=L.next}while(null!==L&&L!==w);null===j?x=u:j.next=C,Lr(u,s.memoizedState)||(_o=!0),s.memoizedState=u,s.baseState=x,s.baseQueue=j,i.lastRenderedState=u}if(null!==(o=i.interleaved)){_=o;do{w=_.lane,so.lanes|=w,Ko|=w,_=_.next}while(_!==o)}else null===_&&(i.lanes=0);return[s.memoizedState,i.dispatch]}function Xh(o){var s=Uh(),i=s.queue;if(null===i)throw Error(p(311));i.lastRenderedReducer=o;var u=i.dispatch,_=i.pending,w=s.memoizedState;if(null!==_){i.pending=null;var x=_=_.next;do{w=o(w,x.action),x=x.next}while(x!==_);Lr(w,s.memoizedState)||(_o=!0),s.memoizedState=w,null===s.baseQueue&&(s.baseState=w),i.lastRenderedState=w}return[w,u]}function Yh(){}function Zh(o,s){var i=so,u=Uh(),_=s(),w=!Lr(u.memoizedState,_);if(w&&(u.memoizedState=_,_o=!0),u=u.queue,$h(ai.bind(null,i,u,o),[o]),u.getSnapshot!==s||w||null!==ao&&1&ao.memoizedState.tag){if(i.flags|=2048,bi(9,ci.bind(null,i,u,_,s),void 0,null),null===Fo)throw Error(p(349));30&oo||di(i,s,_)}return _}function di(o,s,i){o.flags|=16384,o={getSnapshot:s,value:i},null===(s=so.updateQueue)?(s={lastEffect:null,stores:null},so.updateQueue=s,s.stores=[o]):null===(i=s.stores)?s.stores=[o]:i.push(o)}function ci(o,s,i,u){s.value=i,s.getSnapshot=u,ei(s)&&fi(o)}function ai(o,s,i){return i((function(){ei(s)&&fi(o)}))}function ei(o){var s=o.getSnapshot;o=o.value;try{var i=s();return!Lr(o,i)}catch(o){return!0}}function fi(o){var s=ih(o,1);null!==s&&gi(s,o,1,-1)}function hi(o){var s=Th();return\"function\"==typeof o&&(o=o()),s.memoizedState=s.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vh,lastRenderedState:o},s.queue=o,o=o.dispatch=ii.bind(null,so,o),[s.memoizedState,o]}function bi(o,s,i,u){return o={tag:o,create:s,destroy:i,deps:u,next:null},null===(s=so.updateQueue)?(s={lastEffect:null,stores:null},so.updateQueue=s,s.lastEffect=o.next=o):null===(i=s.lastEffect)?s.lastEffect=o.next=o:(u=i.next,i.next=o,o.next=u,s.lastEffect=o),o}function ji(){return Uh().memoizedState}function ki(o,s,i,u){var _=Th();so.flags|=o,_.memoizedState=bi(1|s,i,void 0,void 0===u?null:u)}function li(o,s,i,u){var _=Uh();u=void 0===u?null:u;var w=void 0;if(null!==io){var x=io.memoizedState;if(w=x.destroy,null!==u&&Mh(u,x.deps))return void(_.memoizedState=bi(s,i,w,u))}so.flags|=o,_.memoizedState=bi(1|s,i,w,u)}function mi(o,s){return ki(8390656,8,o,s)}function $h(o,s){return li(2048,8,o,s)}function ni(o,s){return li(4,2,o,s)}function oi(o,s){return li(4,4,o,s)}function pi(o,s){return\"function\"==typeof s?(o=o(),s(o),function(){s(null)}):null!=s?(o=o(),s.current=o,function(){s.current=null}):void 0}function qi(o,s,i){return i=null!=i?i.concat([o]):null,li(4,4,pi.bind(null,s,o),i)}function ri(){}function si(o,s){var i=Uh();s=void 0===s?null:s;var u=i.memoizedState;return null!==u&&null!==s&&Mh(s,u[1])?u[0]:(i.memoizedState=[o,s],o)}function ti(o,s){var i=Uh();s=void 0===s?null:s;var u=i.memoizedState;return null!==u&&null!==s&&Mh(s,u[1])?u[0]:(o=o(),i.memoizedState=[o,s],o)}function ui(o,s,i){return 21&oo?(Lr(i,s)||(i=yc(),so.lanes|=i,Ko|=i,o.baseState=!0),s):(o.baseState&&(o.baseState=!1,_o=!0),o.memoizedState=i)}function vi(o,s){var i=At;At=0!==i&&4>i?i:4,o(!0);var u=no.transition;no.transition={};try{o(!1),s()}finally{At=i,no.transition=u}}function wi(){return Uh().memoizedState}function xi(o,s,i){var u=yi(o);if(i={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null},zi(o))Ai(s,i);else if(null!==(i=hh(o,s,i,u))){gi(i,o,u,R()),Bi(i,s,u)}}function ii(o,s,i){var u=yi(o),_={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null};if(zi(o))Ai(s,_);else{var w=o.alternate;if(0===o.lanes&&(null===w||0===w.lanes)&&null!==(w=s.lastRenderedReducer))try{var x=s.lastRenderedState,C=w(x,i);if(_.hasEagerState=!0,_.eagerState=C,Lr(C,x)){var j=s.interleaved;return null===j?(_.next=_,gh(s)):(_.next=j.next,j.next=_),void(s.interleaved=_)}}catch(o){}null!==(i=hh(o,s,_,u))&&(gi(i,o,u,_=R()),Bi(i,s,u))}}function zi(o){var s=o.alternate;return o===so||null!==s&&s===so}function Ai(o,s){lo=co=!0;var i=o.pending;null===i?s.next=s:(s.next=i.next,i.next=s),o.pending=s}function Bi(o,s,i){if(4194240&i){var u=s.lanes;i|=u&=o.pendingLanes,s.lanes=i,Cc(o,i)}}var ho={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},fo={readContext:eh,useCallback:function(o,s){return Th().memoizedState=[o,void 0===s?null:s],o},useContext:eh,useEffect:mi,useImperativeHandle:function(o,s,i){return i=null!=i?i.concat([o]):null,ki(4194308,4,pi.bind(null,s,o),i)},useLayoutEffect:function(o,s){return ki(4194308,4,o,s)},useInsertionEffect:function(o,s){return ki(4,2,o,s)},useMemo:function(o,s){var i=Th();return s=void 0===s?null:s,o=o(),i.memoizedState=[o,s],o},useReducer:function(o,s,i){var u=Th();return s=void 0!==i?i(s):s,u.memoizedState=u.baseState=s,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:s},u.queue=o,o=o.dispatch=xi.bind(null,so,o),[u.memoizedState,o]},useRef:function(o){return o={current:o},Th().memoizedState=o},useState:hi,useDebugValue:ri,useDeferredValue:function(o){return Th().memoizedState=o},useTransition:function(){var o=hi(!1),s=o[0];return o=vi.bind(null,o[1]),Th().memoizedState=o,[s,o]},useMutableSource:function(){},useSyncExternalStore:function(o,s,i){var u=so,_=Th();if(Fn){if(void 0===i)throw Error(p(407));i=i()}else{if(i=s(),null===Fo)throw Error(p(349));30&oo||di(u,s,i)}_.memoizedState=i;var w={value:i,getSnapshot:s};return _.queue=w,mi(ai.bind(null,u,w,o),[o]),u.flags|=2048,bi(9,ci.bind(null,u,w,i,s),void 0,null),i},useId:function(){var o=Th(),s=Fo.identifierPrefix;if(Fn){var i=Dn;s=\":\"+s+\"R\"+(i=(Rn&~(1<<32-St(Rn)-1)).toString(32)+i),0<(i=uo++)&&(s+=\"H\"+i.toString(32)),s+=\":\"}else s=\":\"+s+\"r\"+(i=po++).toString(32)+\":\";return o.memoizedState=s},unstable_isNewReconciler:!1},mo={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Wh,useRef:ji,useState:function(){return Wh(Vh)},useDebugValue:ri,useDeferredValue:function(o){return ui(Uh(),io.memoizedState,o)},useTransition:function(){return[Wh(Vh)[0],Uh().memoizedState]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1},go={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Xh,useRef:ji,useState:function(){return Xh(Vh)},useDebugValue:ri,useDeferredValue:function(o){var s=Uh();return null===io?s.memoizedState=o:ui(s,io.memoizedState,o)},useTransition:function(){return[Xh(Vh)[0],Uh().memoizedState]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1};function Ci(o,s){if(o&&o.defaultProps){for(var i in s=xe({},s),o=o.defaultProps)void 0===s[i]&&(s[i]=o[i]);return s}return s}function Di(o,s,i,u){i=null==(i=i(u,s=o.memoizedState))?s:xe({},s,i),o.memoizedState=i,0===o.lanes&&(o.updateQueue.baseState=i)}var yo={isMounted:function(o){return!!(o=o._reactInternals)&&Vb(o)===o},enqueueSetState:function(o,s,i){o=o._reactInternals;var u=R(),_=yi(o),w=mh(u,_);w.payload=s,null!=i&&(w.callback=i),null!==(s=nh(o,w,_))&&(gi(s,o,_,u),oh(s,o,_))},enqueueReplaceState:function(o,s,i){o=o._reactInternals;var u=R(),_=yi(o),w=mh(u,_);w.tag=1,w.payload=s,null!=i&&(w.callback=i),null!==(s=nh(o,w,_))&&(gi(s,o,_,u),oh(s,o,_))},enqueueForceUpdate:function(o,s){o=o._reactInternals;var i=R(),u=yi(o),_=mh(i,u);_.tag=2,null!=s&&(_.callback=s),null!==(s=nh(o,_,u))&&(gi(s,o,u,i),oh(s,o,u))}};function Fi(o,s,i,u,_,w,x){return\"function\"==typeof(o=o.stateNode).shouldComponentUpdate?o.shouldComponentUpdate(u,w,x):!s.prototype||!s.prototype.isPureReactComponent||(!Ie(i,u)||!Ie(_,w))}function Gi(o,s,i){var u=!1,_=En,w=s.contextType;return\"object\"==typeof w&&null!==w?w=eh(w):(_=Zf(s)?xn:wn.current,w=(u=null!=(u=s.contextTypes))?Yf(o,_):En),s=new s(i,w),o.memoizedState=null!==s.state&&void 0!==s.state?s.state:null,s.updater=yo,o.stateNode=s,s._reactInternals=o,u&&((o=o.stateNode).__reactInternalMemoizedUnmaskedChildContext=_,o.__reactInternalMemoizedMaskedChildContext=w),s}function Hi(o,s,i,u){o=s.state,\"function\"==typeof s.componentWillReceiveProps&&s.componentWillReceiveProps(i,u),\"function\"==typeof s.UNSAFE_componentWillReceiveProps&&s.UNSAFE_componentWillReceiveProps(i,u),s.state!==o&&yo.enqueueReplaceState(s,s.state,null)}function Ii(o,s,i,u){var _=o.stateNode;_.props=i,_.state=o.memoizedState,_.refs={},kh(o);var w=s.contextType;\"object\"==typeof w&&null!==w?_.context=eh(w):(w=Zf(s)?xn:wn.current,_.context=Yf(o,w)),_.state=o.memoizedState,\"function\"==typeof(w=s.getDerivedStateFromProps)&&(Di(o,s,w,i),_.state=o.memoizedState),\"function\"==typeof s.getDerivedStateFromProps||\"function\"==typeof _.getSnapshotBeforeUpdate||\"function\"!=typeof _.UNSAFE_componentWillMount&&\"function\"!=typeof _.componentWillMount||(s=_.state,\"function\"==typeof _.componentWillMount&&_.componentWillMount(),\"function\"==typeof _.UNSAFE_componentWillMount&&_.UNSAFE_componentWillMount(),s!==_.state&&yo.enqueueReplaceState(_,_.state,null),qh(o,i,_,u),_.state=o.memoizedState),\"function\"==typeof _.componentDidMount&&(o.flags|=4194308)}function Ji(o,s){try{var i=\"\",u=s;do{i+=Pa(u),u=u.return}while(u);var _=i}catch(o){_=\"\\nError generating stack: \"+o.message+\"\\n\"+o.stack}return{value:o,source:s,stack:_,digest:null}}function Ki(o,s,i){return{value:o,source:null,stack:null!=i?i:null,digest:null!=s?s:null}}function Li(o,s){try{console.error(s.value)}catch(o){setTimeout((function(){throw o}))}}var vo=\"function\"==typeof WeakMap?WeakMap:Map;function Ni(o,s,i){(i=mh(-1,i)).tag=3,i.payload={element:null};var u=s.value;return i.callback=function(){es||(es=!0,ts=u),Li(0,s)},i}function Qi(o,s,i){(i=mh(-1,i)).tag=3;var u=o.type.getDerivedStateFromError;if(\"function\"==typeof u){var _=s.value;i.payload=function(){return u(_)},i.callback=function(){Li(0,s)}}var w=o.stateNode;return null!==w&&\"function\"==typeof w.componentDidCatch&&(i.callback=function(){Li(0,s),\"function\"!=typeof u&&(null===rs?rs=new Set([this]):rs.add(this));var o=s.stack;this.componentDidCatch(s.value,{componentStack:null!==o?o:\"\"})}),i}function Si(o,s,i){var u=o.pingCache;if(null===u){u=o.pingCache=new vo;var _=new Set;u.set(s,_)}else void 0===(_=u.get(s))&&(_=new Set,u.set(s,_));_.has(i)||(_.add(i),o=Ti.bind(null,o,s,i),s.then(o,o))}function Ui(o){do{var s;if((s=13===o.tag)&&(s=null===(s=o.memoizedState)||null!==s.dehydrated),s)return o;o=o.return}while(null!==o);return null}function Vi(o,s,i,u,_){return 1&o.mode?(o.flags|=65536,o.lanes=_,o):(o===s?o.flags|=65536:(o.flags|=128,i.flags|=131072,i.flags&=-52805,1===i.tag&&(null===i.alternate?i.tag=17:((s=mh(-1,1)).tag=2,nh(i,s,1))),i.lanes|=1),o)}var bo=z.ReactCurrentOwner,_o=!1;function Xi(o,s,i,u){s.child=null===o?Un(s,null,i,u):Vn(s,o.child,i,u)}function Yi(o,s,i,u,_){i=i.render;var w=s.ref;return ch(s,_),u=Nh(o,s,i,u,w,_),i=Sh(),null===o||_o?(Fn&&i&&vg(s),s.flags|=1,Xi(o,s,u,_),s.child):(s.updateQueue=o.updateQueue,s.flags&=-2053,o.lanes&=~_,Zi(o,s,_))}function $i(o,s,i,u,_){if(null===o){var w=i.type;return\"function\"!=typeof w||aj(w)||void 0!==w.defaultProps||null!==i.compare||void 0!==i.defaultProps?((o=Rg(i.type,null,u,s,s.mode,_)).ref=s.ref,o.return=s,s.child=o):(s.tag=15,s.type=w,bj(o,s,w,u,_))}if(w=o.child,!(o.lanes&_)){var x=w.memoizedProps;if((i=null!==(i=i.compare)?i:Ie)(x,u)&&o.ref===s.ref)return Zi(o,s,_)}return s.flags|=1,(o=Pg(w,u)).ref=s.ref,o.return=s,s.child=o}function bj(o,s,i,u,_){if(null!==o){var w=o.memoizedProps;if(Ie(w,u)&&o.ref===s.ref){if(_o=!1,s.pendingProps=u=w,!(o.lanes&_))return s.lanes=o.lanes,Zi(o,s,_);131072&o.flags&&(_o=!0)}}return cj(o,s,i,u,_)}function dj(o,s,i){var u=s.pendingProps,_=u.children,w=null!==o?o.memoizedState:null;if(\"hidden\"===u.mode)if(1&s.mode){if(!(1073741824&i))return o=null!==w?w.baseLanes|i:i,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:o,cachePool:null,transitions:null},s.updateQueue=null,G(Uo,Vo),Vo|=o,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=null!==w?w.baseLanes:i,G(Uo,Vo),Vo|=u}else s.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(Uo,Vo),Vo|=i;else null!==w?(u=w.baseLanes|i,s.memoizedState=null):u=i,G(Uo,Vo),Vo|=u;return Xi(o,s,_,i),s.child}function gj(o,s){var i=s.ref;(null===o&&null!==i||null!==o&&o.ref!==i)&&(s.flags|=512,s.flags|=2097152)}function cj(o,s,i,u,_){var w=Zf(i)?xn:wn.current;return w=Yf(s,w),ch(s,_),i=Nh(o,s,i,u,w,_),u=Sh(),null===o||_o?(Fn&&u&&vg(s),s.flags|=1,Xi(o,s,i,_),s.child):(s.updateQueue=o.updateQueue,s.flags&=-2053,o.lanes&=~_,Zi(o,s,_))}function hj(o,s,i,u,_){if(Zf(i)){var w=!0;cg(s)}else w=!1;if(ch(s,_),null===s.stateNode)ij(o,s),Gi(s,i,u),Ii(s,i,u,_),u=!0;else if(null===o){var x=s.stateNode,C=s.memoizedProps;x.props=C;var j=x.context,L=i.contextType;\"object\"==typeof L&&null!==L?L=eh(L):L=Yf(s,L=Zf(i)?xn:wn.current);var B=i.getDerivedStateFromProps,$=\"function\"==typeof B||\"function\"==typeof x.getSnapshotBeforeUpdate;$||\"function\"!=typeof x.UNSAFE_componentWillReceiveProps&&\"function\"!=typeof x.componentWillReceiveProps||(C!==u||j!==L)&&Hi(s,x,u,L),Gn=!1;var V=s.memoizedState;x.state=V,qh(s,u,x,_),j=s.memoizedState,C!==u||V!==j||Sn.current||Gn?(\"function\"==typeof B&&(Di(s,i,B,u),j=s.memoizedState),(C=Gn||Fi(s,i,C,u,V,j,L))?($||\"function\"!=typeof x.UNSAFE_componentWillMount&&\"function\"!=typeof x.componentWillMount||(\"function\"==typeof x.componentWillMount&&x.componentWillMount(),\"function\"==typeof x.UNSAFE_componentWillMount&&x.UNSAFE_componentWillMount()),\"function\"==typeof x.componentDidMount&&(s.flags|=4194308)):(\"function\"==typeof x.componentDidMount&&(s.flags|=4194308),s.memoizedProps=u,s.memoizedState=j),x.props=u,x.state=j,x.context=L,u=C):(\"function\"==typeof x.componentDidMount&&(s.flags|=4194308),u=!1)}else{x=s.stateNode,lh(o,s),C=s.memoizedProps,L=s.type===s.elementType?C:Ci(s.type,C),x.props=L,$=s.pendingProps,V=x.context,\"object\"==typeof(j=i.contextType)&&null!==j?j=eh(j):j=Yf(s,j=Zf(i)?xn:wn.current);var U=i.getDerivedStateFromProps;(B=\"function\"==typeof U||\"function\"==typeof x.getSnapshotBeforeUpdate)||\"function\"!=typeof x.UNSAFE_componentWillReceiveProps&&\"function\"!=typeof x.componentWillReceiveProps||(C!==$||V!==j)&&Hi(s,x,u,j),Gn=!1,V=s.memoizedState,x.state=V,qh(s,u,x,_);var z=s.memoizedState;C!==$||V!==z||Sn.current||Gn?(\"function\"==typeof U&&(Di(s,i,U,u),z=s.memoizedState),(L=Gn||Fi(s,i,L,u,V,z,j)||!1)?(B||\"function\"!=typeof x.UNSAFE_componentWillUpdate&&\"function\"!=typeof x.componentWillUpdate||(\"function\"==typeof x.componentWillUpdate&&x.componentWillUpdate(u,z,j),\"function\"==typeof x.UNSAFE_componentWillUpdate&&x.UNSAFE_componentWillUpdate(u,z,j)),\"function\"==typeof x.componentDidUpdate&&(s.flags|=4),\"function\"==typeof x.getSnapshotBeforeUpdate&&(s.flags|=1024)):(\"function\"!=typeof x.componentDidUpdate||C===o.memoizedProps&&V===o.memoizedState||(s.flags|=4),\"function\"!=typeof x.getSnapshotBeforeUpdate||C===o.memoizedProps&&V===o.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=z),x.props=u,x.state=z,x.context=j,u=L):(\"function\"!=typeof x.componentDidUpdate||C===o.memoizedProps&&V===o.memoizedState||(s.flags|=4),\"function\"!=typeof x.getSnapshotBeforeUpdate||C===o.memoizedProps&&V===o.memoizedState||(s.flags|=1024),u=!1)}return jj(o,s,i,u,w,_)}function jj(o,s,i,u,_,w){gj(o,s);var x=!!(128&s.flags);if(!u&&!x)return _&&dg(s,i,!1),Zi(o,s,w);u=s.stateNode,bo.current=s;var C=x&&\"function\"!=typeof i.getDerivedStateFromError?null:u.render();return s.flags|=1,null!==o&&x?(s.child=Vn(s,o.child,null,w),s.child=Vn(s,null,C,w)):Xi(o,s,C,w),s.memoizedState=u.state,_&&dg(s,i,!0),s.child}function kj(o){var s=o.stateNode;s.pendingContext?ag(0,s.pendingContext,s.pendingContext!==s.context):s.context&&ag(0,s.context,!1),yh(o,s.containerInfo)}function lj(o,s,i,u,_){return Ig(),Jg(_),s.flags|=256,Xi(o,s,i,u),s.child}var Eo,wo,So,xo,ko={dehydrated:null,treeContext:null,retryLane:0};function nj(o){return{baseLanes:o,cachePool:null,transitions:null}}function oj(o,s,i){var u,_=s.pendingProps,w=eo.current,x=!1,C=!!(128&s.flags);if((u=C)||(u=(null===o||null!==o.memoizedState)&&!!(2&w)),u?(x=!0,s.flags&=-129):null!==o&&null===o.memoizedState||(w|=1),G(eo,1&w),null===o)return Eg(s),null!==(o=s.memoizedState)&&null!==(o=o.dehydrated)?(1&s.mode?\"$!\"===o.data?s.lanes=8:s.lanes=1073741824:s.lanes=1,null):(C=_.children,o=_.fallback,x?(_=s.mode,x=s.child,C={mode:\"hidden\",children:C},1&_||null===x?x=pj(C,_,0,null):(x.childLanes=0,x.pendingProps=C),o=Tg(o,_,i,null),x.return=s,o.return=s,x.sibling=o,s.child=x,s.child.memoizedState=nj(i),s.memoizedState=ko,o):qj(s,C));if(null!==(w=o.memoizedState)&&null!==(u=w.dehydrated))return function rj(o,s,i,u,_,w,x){if(i)return 256&s.flags?(s.flags&=-257,sj(o,s,x,u=Ki(Error(p(422))))):null!==s.memoizedState?(s.child=o.child,s.flags|=128,null):(w=u.fallback,_=s.mode,u=pj({mode:\"visible\",children:u.children},_,0,null),(w=Tg(w,_,x,null)).flags|=2,u.return=s,w.return=s,u.sibling=w,s.child=u,1&s.mode&&Vn(s,o.child,null,x),s.child.memoizedState=nj(x),s.memoizedState=ko,w);if(!(1&s.mode))return sj(o,s,x,null);if(\"$!\"===_.data){if(u=_.nextSibling&&_.nextSibling.dataset)var C=u.dgst;return u=C,sj(o,s,x,u=Ki(w=Error(p(419)),u,void 0))}if(C=!!(x&o.childLanes),_o||C){if(null!==(u=Fo)){switch(x&-x){case 4:_=2;break;case 16:_=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:_=32;break;case 536870912:_=268435456;break;default:_=0}0!==(_=_&(u.suspendedLanes|x)?0:_)&&_!==w.retryLane&&(w.retryLane=_,ih(o,_),gi(u,o,_,-1))}return tj(),sj(o,s,x,u=Ki(Error(p(421))))}return\"$?\"===_.data?(s.flags|=128,s.child=o.child,s=uj.bind(null,o),_._reactRetry=s,null):(o=w.treeContext,Bn=Lf(_.nextSibling),Ln=s,Fn=!0,qn=null,null!==o&&(Mn[Nn++]=Rn,Mn[Nn++]=Dn,Mn[Nn++]=Tn,Rn=o.id,Dn=o.overflow,Tn=s),s=qj(s,u.children),s.flags|=4096,s)}(o,s,C,_,u,w,i);if(x){x=_.fallback,C=s.mode,u=(w=o.child).sibling;var j={mode:\"hidden\",children:_.children};return 1&C||s.child===w?(_=Pg(w,j)).subtreeFlags=14680064&w.subtreeFlags:((_=s.child).childLanes=0,_.pendingProps=j,s.deletions=null),null!==u?x=Pg(u,x):(x=Tg(x,C,i,null)).flags|=2,x.return=s,_.return=s,_.sibling=x,s.child=_,_=x,x=s.child,C=null===(C=o.child.memoizedState)?nj(i):{baseLanes:C.baseLanes|i,cachePool:null,transitions:C.transitions},x.memoizedState=C,x.childLanes=o.childLanes&~i,s.memoizedState=ko,_}return o=(x=o.child).sibling,_=Pg(x,{mode:\"visible\",children:_.children}),!(1&s.mode)&&(_.lanes=i),_.return=s,_.sibling=null,null!==o&&(null===(i=s.deletions)?(s.deletions=[o],s.flags|=16):i.push(o)),s.child=_,s.memoizedState=null,_}function qj(o,s){return(s=pj({mode:\"visible\",children:s},o.mode,0,null)).return=o,o.child=s}function sj(o,s,i,u){return null!==u&&Jg(u),Vn(s,o.child,null,i),(o=qj(s,s.pendingProps.children)).flags|=2,s.memoizedState=null,o}function vj(o,s,i){o.lanes|=s;var u=o.alternate;null!==u&&(u.lanes|=s),bh(o.return,s,i)}function wj(o,s,i,u,_){var w=o.memoizedState;null===w?o.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:_}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=i,w.tailMode=_)}function xj(o,s,i){var u=s.pendingProps,_=u.revealOrder,w=u.tail;if(Xi(o,s,u.children,i),2&(u=eo.current))u=1&u|2,s.flags|=128;else{if(null!==o&&128&o.flags)e:for(o=s.child;null!==o;){if(13===o.tag)null!==o.memoizedState&&vj(o,i,s);else if(19===o.tag)vj(o,i,s);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===s)break e;for(;null===o.sibling;){if(null===o.return||o.return===s)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}u&=1}if(G(eo,u),1&s.mode)switch(_){case\"forwards\":for(i=s.child,_=null;null!==i;)null!==(o=i.alternate)&&null===Ch(o)&&(_=i),i=i.sibling;null===(i=_)?(_=s.child,s.child=null):(_=i.sibling,i.sibling=null),wj(s,!1,_,i,w);break;case\"backwards\":for(i=null,_=s.child,s.child=null;null!==_;){if(null!==(o=_.alternate)&&null===Ch(o)){s.child=_;break}o=_.sibling,_.sibling=i,i=_,_=o}wj(s,!0,i,null,w);break;case\"together\":wj(s,!1,null,null,void 0);break;default:s.memoizedState=null}else s.memoizedState=null;return s.child}function ij(o,s){!(1&s.mode)&&null!==o&&(o.alternate=null,s.alternate=null,s.flags|=2)}function Zi(o,s,i){if(null!==o&&(s.dependencies=o.dependencies),Ko|=s.lanes,!(i&s.childLanes))return null;if(null!==o&&s.child!==o.child)throw Error(p(153));if(null!==s.child){for(i=Pg(o=s.child,o.pendingProps),s.child=i,i.return=s;null!==o.sibling;)o=o.sibling,(i=i.sibling=Pg(o,o.pendingProps)).return=s;i.sibling=null}return s.child}function Dj(o,s){if(!Fn)switch(o.tailMode){case\"hidden\":s=o.tail;for(var i=null;null!==s;)null!==s.alternate&&(i=s),s=s.sibling;null===i?o.tail=null:i.sibling=null;break;case\"collapsed\":i=o.tail;for(var u=null;null!==i;)null!==i.alternate&&(u=i),i=i.sibling;null===u?s||null===o.tail?o.tail=null:o.tail.sibling=null:u.sibling=null}}function S(o){var s=null!==o.alternate&&o.alternate.child===o.child,i=0,u=0;if(s)for(var _=o.child;null!==_;)i|=_.lanes|_.childLanes,u|=14680064&_.subtreeFlags,u|=14680064&_.flags,_.return=o,_=_.sibling;else for(_=o.child;null!==_;)i|=_.lanes|_.childLanes,u|=_.subtreeFlags,u|=_.flags,_.return=o,_=_.sibling;return o.subtreeFlags|=u,o.childLanes=i,s}function Ej(o,s,i){var u=s.pendingProps;switch(wg(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S(s),null;case 1:case 17:return Zf(s.type)&&$f(),S(s),null;case 3:return u=s.stateNode,zh(),E(Sn),E(wn),Eh(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),null!==o&&null!==o.child||(Gg(s)?s.flags|=4:null===o||o.memoizedState.isDehydrated&&!(256&s.flags)||(s.flags|=1024,null!==qn&&(Fj(qn),qn=null))),wo(o,s),S(s),null;case 5:Bh(s);var _=xh(Zn.current);if(i=s.type,null!==o&&null!=s.stateNode)So(o,s,i,u,_),o.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!u){if(null===s.stateNode)throw Error(p(166));return S(s),null}if(o=xh(Xn.current),Gg(s)){u=s.stateNode,i=s.type;var w=s.memoizedProps;switch(u[dn]=s,u[fn]=w,o=!!(1&s.mode),i){case\"dialog\":D(\"cancel\",u),D(\"close\",u);break;case\"iframe\":case\"object\":case\"embed\":D(\"load\",u);break;case\"video\":case\"audio\":for(_=0;_<en.length;_++)D(en[_],u);break;case\"source\":D(\"error\",u);break;case\"img\":case\"image\":case\"link\":D(\"error\",u),D(\"load\",u);break;case\"details\":D(\"toggle\",u);break;case\"input\":Za(u,w),D(\"invalid\",u);break;case\"select\":u._wrapperState={wasMultiple:!!w.multiple},D(\"invalid\",u);break;case\"textarea\":hb(u,w),D(\"invalid\",u)}for(var C in ub(i,w),_=null,w)if(w.hasOwnProperty(C)){var j=w[C];\"children\"===C?\"string\"==typeof j?u.textContent!==j&&(!0!==w.suppressHydrationWarning&&Af(u.textContent,j,o),_=[\"children\",j]):\"number\"==typeof j&&u.textContent!==\"\"+j&&(!0!==w.suppressHydrationWarning&&Af(u.textContent,j,o),_=[\"children\",\"\"+j]):x.hasOwnProperty(C)&&null!=j&&\"onScroll\"===C&&D(\"scroll\",u)}switch(i){case\"input\":Va(u),db(u,w,!0);break;case\"textarea\":Va(u),jb(u);break;case\"select\":case\"option\":break;default:\"function\"==typeof w.onClick&&(u.onclick=Bf)}u=_,s.updateQueue=u,null!==u&&(s.flags|=4)}else{C=9===_.nodeType?_:_.ownerDocument,\"http://www.w3.org/1999/xhtml\"===o&&(o=kb(i)),\"http://www.w3.org/1999/xhtml\"===o?\"script\"===i?((o=C.createElement(\"div\")).innerHTML=\"<script><\\/script>\",o=o.removeChild(o.firstChild)):\"string\"==typeof u.is?o=C.createElement(i,{is:u.is}):(o=C.createElement(i),\"select\"===i&&(C=o,u.multiple?C.multiple=!0:u.size&&(C.size=u.size))):o=C.createElementNS(o,i),o[dn]=s,o[fn]=u,Eo(o,s,!1,!1),s.stateNode=o;e:{switch(C=vb(i,u),i){case\"dialog\":D(\"cancel\",o),D(\"close\",o),_=u;break;case\"iframe\":case\"object\":case\"embed\":D(\"load\",o),_=u;break;case\"video\":case\"audio\":for(_=0;_<en.length;_++)D(en[_],o);_=u;break;case\"source\":D(\"error\",o),_=u;break;case\"img\":case\"image\":case\"link\":D(\"error\",o),D(\"load\",o),_=u;break;case\"details\":D(\"toggle\",o),_=u;break;case\"input\":Za(o,u),_=Ya(o,u),D(\"invalid\",o);break;case\"option\":default:_=u;break;case\"select\":o._wrapperState={wasMultiple:!!u.multiple},_=xe({},u,{value:void 0}),D(\"invalid\",o);break;case\"textarea\":hb(o,u),_=gb(o,u),D(\"invalid\",o)}for(w in ub(i,_),j=_)if(j.hasOwnProperty(w)){var L=j[w];\"style\"===w?sb(o,L):\"dangerouslySetInnerHTML\"===w?null!=(L=L?L.__html:void 0)&&$e(o,L):\"children\"===w?\"string\"==typeof L?(\"textarea\"!==i||\"\"!==L)&&ob(o,L):\"number\"==typeof L&&ob(o,\"\"+L):\"suppressContentEditableWarning\"!==w&&\"suppressHydrationWarning\"!==w&&\"autoFocus\"!==w&&(x.hasOwnProperty(w)?null!=L&&\"onScroll\"===w&&D(\"scroll\",o):null!=L&&ta(o,w,L,C))}switch(i){case\"input\":Va(o),db(o,u,!1);break;case\"textarea\":Va(o),jb(o);break;case\"option\":null!=u.value&&o.setAttribute(\"value\",\"\"+Sa(u.value));break;case\"select\":o.multiple=!!u.multiple,null!=(w=u.value)?fb(o,!!u.multiple,w,!1):null!=u.defaultValue&&fb(o,!!u.multiple,u.defaultValue,!0);break;default:\"function\"==typeof _.onClick&&(o.onclick=Bf)}switch(i){case\"button\":case\"input\":case\"select\":case\"textarea\":u=!!u.autoFocus;break e;case\"img\":u=!0;break e;default:u=!1}}u&&(s.flags|=4)}null!==s.ref&&(s.flags|=512,s.flags|=2097152)}return S(s),null;case 6:if(o&&null!=s.stateNode)xo(o,s,o.memoizedProps,u);else{if(\"string\"!=typeof u&&null===s.stateNode)throw Error(p(166));if(i=xh(Zn.current),xh(Xn.current),Gg(s)){if(u=s.stateNode,i=s.memoizedProps,u[dn]=s,(w=u.nodeValue!==i)&&null!==(o=Ln))switch(o.tag){case 3:Af(u.nodeValue,i,!!(1&o.mode));break;case 5:!0!==o.memoizedProps.suppressHydrationWarning&&Af(u.nodeValue,i,!!(1&o.mode))}w&&(s.flags|=4)}else(u=(9===i.nodeType?i:i.ownerDocument).createTextNode(u))[dn]=s,s.stateNode=u}return S(s),null;case 13:if(E(eo),u=s.memoizedState,null===o||null!==o.memoizedState&&null!==o.memoizedState.dehydrated){if(Fn&&null!==Bn&&1&s.mode&&!(128&s.flags))Hg(),Ig(),s.flags|=98560,w=!1;else if(w=Gg(s),null!==u&&null!==u.dehydrated){if(null===o){if(!w)throw Error(p(318));if(!(w=null!==(w=s.memoizedState)?w.dehydrated:null))throw Error(p(317));w[dn]=s}else Ig(),!(128&s.flags)&&(s.memoizedState=null),s.flags|=4;S(s),w=!1}else null!==qn&&(Fj(qn),qn=null),w=!0;if(!w)return 65536&s.flags?s:null}return 128&s.flags?(s.lanes=i,s):((u=null!==u)!==(null!==o&&null!==o.memoizedState)&&u&&(s.child.flags|=8192,1&s.mode&&(null===o||1&eo.current?0===zo&&(zo=3):tj())),null!==s.updateQueue&&(s.flags|=4),S(s),null);case 4:return zh(),wo(o,s),null===o&&sf(s.stateNode.containerInfo),S(s),null;case 10:return ah(s.type._context),S(s),null;case 19:if(E(eo),null===(w=s.memoizedState))return S(s),null;if(u=!!(128&s.flags),null===(C=w.rendering))if(u)Dj(w,!1);else{if(0!==zo||null!==o&&128&o.flags)for(o=s.child;null!==o;){if(null!==(C=Ch(o))){for(s.flags|=128,Dj(w,!1),null!==(u=C.updateQueue)&&(s.updateQueue=u,s.flags|=4),s.subtreeFlags=0,u=i,i=s.child;null!==i;)o=u,(w=i).flags&=14680066,null===(C=w.alternate)?(w.childLanes=0,w.lanes=o,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=C.childLanes,w.lanes=C.lanes,w.child=C.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=C.memoizedProps,w.memoizedState=C.memoizedState,w.updateQueue=C.updateQueue,w.type=C.type,o=C.dependencies,w.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),i=i.sibling;return G(eo,1&eo.current|2),s.child}o=o.sibling}null!==w.tail&&dt()>Qo&&(s.flags|=128,u=!0,Dj(w,!1),s.lanes=4194304)}else{if(!u)if(null!==(o=Ch(C))){if(s.flags|=128,u=!0,null!==(i=o.updateQueue)&&(s.updateQueue=i,s.flags|=4),Dj(w,!0),null===w.tail&&\"hidden\"===w.tailMode&&!C.alternate&&!Fn)return S(s),null}else 2*dt()-w.renderingStartTime>Qo&&1073741824!==i&&(s.flags|=128,u=!0,Dj(w,!1),s.lanes=4194304);w.isBackwards?(C.sibling=s.child,s.child=C):(null!==(i=w.last)?i.sibling=C:s.child=C,w.last=C)}return null!==w.tail?(s=w.tail,w.rendering=s,w.tail=s.sibling,w.renderingStartTime=dt(),s.sibling=null,i=eo.current,G(eo,u?1&i|2:1&i),s):(S(s),null);case 22:case 23:return Hj(),u=null!==s.memoizedState,null!==o&&null!==o.memoizedState!==u&&(s.flags|=8192),u&&1&s.mode?!!(1073741824&Vo)&&(S(s),6&s.subtreeFlags&&(s.flags|=8192)):S(s),null;case 24:case 25:return null}throw Error(p(156,s.tag))}function Ij(o,s){switch(wg(s),s.tag){case 1:return Zf(s.type)&&$f(),65536&(o=s.flags)?(s.flags=-65537&o|128,s):null;case 3:return zh(),E(Sn),E(wn),Eh(),65536&(o=s.flags)&&!(128&o)?(s.flags=-65537&o|128,s):null;case 5:return Bh(s),null;case 13:if(E(eo),null!==(o=s.memoizedState)&&null!==o.dehydrated){if(null===s.alternate)throw Error(p(340));Ig()}return 65536&(o=s.flags)?(s.flags=-65537&o|128,s):null;case 19:return E(eo),null;case 4:return zh(),null;case 10:return ah(s.type._context),null;case 22:case 23:return Hj(),null;default:return null}}Eo=function(o,s){for(var i=s.child;null!==i;){if(5===i.tag||6===i.tag)o.appendChild(i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===s)break;for(;null===i.sibling;){if(null===i.return||i.return===s)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},wo=function(){},So=function(o,s,i,u){var _=o.memoizedProps;if(_!==u){o=s.stateNode,xh(Xn.current);var w,C=null;switch(i){case\"input\":_=Ya(o,_),u=Ya(o,u),C=[];break;case\"select\":_=xe({},_,{value:void 0}),u=xe({},u,{value:void 0}),C=[];break;case\"textarea\":_=gb(o,_),u=gb(o,u),C=[];break;default:\"function\"!=typeof _.onClick&&\"function\"==typeof u.onClick&&(o.onclick=Bf)}for(B in ub(i,u),i=null,_)if(!u.hasOwnProperty(B)&&_.hasOwnProperty(B)&&null!=_[B])if(\"style\"===B){var j=_[B];for(w in j)j.hasOwnProperty(w)&&(i||(i={}),i[w]=\"\")}else\"dangerouslySetInnerHTML\"!==B&&\"children\"!==B&&\"suppressContentEditableWarning\"!==B&&\"suppressHydrationWarning\"!==B&&\"autoFocus\"!==B&&(x.hasOwnProperty(B)?C||(C=[]):(C=C||[]).push(B,null));for(B in u){var L=u[B];if(j=null!=_?_[B]:void 0,u.hasOwnProperty(B)&&L!==j&&(null!=L||null!=j))if(\"style\"===B)if(j){for(w in j)!j.hasOwnProperty(w)||L&&L.hasOwnProperty(w)||(i||(i={}),i[w]=\"\");for(w in L)L.hasOwnProperty(w)&&j[w]!==L[w]&&(i||(i={}),i[w]=L[w])}else i||(C||(C=[]),C.push(B,i)),i=L;else\"dangerouslySetInnerHTML\"===B?(L=L?L.__html:void 0,j=j?j.__html:void 0,null!=L&&j!==L&&(C=C||[]).push(B,L)):\"children\"===B?\"string\"!=typeof L&&\"number\"!=typeof L||(C=C||[]).push(B,\"\"+L):\"suppressContentEditableWarning\"!==B&&\"suppressHydrationWarning\"!==B&&(x.hasOwnProperty(B)?(null!=L&&\"onScroll\"===B&&D(\"scroll\",o),C||j===L||(C=[])):(C=C||[]).push(B,L))}i&&(C=C||[]).push(\"style\",i);var B=C;(s.updateQueue=B)&&(s.flags|=4)}},xo=function(o,s,i,u){i!==u&&(s.flags|=4)};var Oo=!1,Co=!1,Ao=\"function\"==typeof WeakSet?WeakSet:Set,jo=null;function Lj(o,s){var i=o.ref;if(null!==i)if(\"function\"==typeof i)try{i(null)}catch(i){W(o,s,i)}else i.current=null}function Mj(o,s,i){try{i()}catch(i){W(o,s,i)}}var Po=!1;function Pj(o,s,i){var u=s.updateQueue;if(null!==(u=null!==u?u.lastEffect:null)){var _=u=u.next;do{if((_.tag&o)===o){var w=_.destroy;_.destroy=void 0,void 0!==w&&Mj(s,i,w)}_=_.next}while(_!==u)}}function Qj(o,s){if(null!==(s=null!==(s=s.updateQueue)?s.lastEffect:null)){var i=s=s.next;do{if((i.tag&o)===o){var u=i.create;i.destroy=u()}i=i.next}while(i!==s)}}function Rj(o){var s=o.ref;if(null!==s){var i=o.stateNode;o.tag,o=i,\"function\"==typeof s?s(o):s.current=o}}function Sj(o){var s=o.alternate;null!==s&&(o.alternate=null,Sj(s)),o.child=null,o.deletions=null,o.sibling=null,5===o.tag&&(null!==(s=o.stateNode)&&(delete s[dn],delete s[fn],delete s[gn],delete s[yn],delete s[vn])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Tj(o){return 5===o.tag||3===o.tag||4===o.tag}function Uj(o){e:for(;;){for(;null===o.sibling;){if(null===o.return||Tj(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;5!==o.tag&&6!==o.tag&&18!==o.tag;){if(2&o.flags)continue e;if(null===o.child||4===o.tag)continue e;o.child.return=o,o=o.child}if(!(2&o.flags))return o.stateNode}}function Vj(o,s,i){var u=o.tag;if(5===u||6===u)o=o.stateNode,s?8===i.nodeType?i.parentNode.insertBefore(o,s):i.insertBefore(o,s):(8===i.nodeType?(s=i.parentNode).insertBefore(o,i):(s=i).appendChild(o),null!=(i=i._reactRootContainer)||null!==s.onclick||(s.onclick=Bf));else if(4!==u&&null!==(o=o.child))for(Vj(o,s,i),o=o.sibling;null!==o;)Vj(o,s,i),o=o.sibling}function Wj(o,s,i){var u=o.tag;if(5===u||6===u)o=o.stateNode,s?i.insertBefore(o,s):i.appendChild(o);else if(4!==u&&null!==(o=o.child))for(Wj(o,s,i),o=o.sibling;null!==o;)Wj(o,s,i),o=o.sibling}var Io=null,Mo=!1;function Yj(o,s,i){for(i=i.child;null!==i;)Zj(o,s,i),i=i.sibling}function Zj(o,s,i){if(wt&&\"function\"==typeof wt.onCommitFiberUnmount)try{wt.onCommitFiberUnmount(Et,i)}catch(o){}switch(i.tag){case 5:Co||Lj(i,s);case 6:var u=Io,_=Mo;Io=null,Yj(o,s,i),Mo=_,null!==(Io=u)&&(Mo?(o=Io,i=i.stateNode,8===o.nodeType?o.parentNode.removeChild(i):o.removeChild(i)):Io.removeChild(i.stateNode));break;case 18:null!==Io&&(Mo?(o=Io,i=i.stateNode,8===o.nodeType?Kf(o.parentNode,i):1===o.nodeType&&Kf(o,i),bd(o)):Kf(Io,i.stateNode));break;case 4:u=Io,_=Mo,Io=i.stateNode.containerInfo,Mo=!0,Yj(o,s,i),Io=u,Mo=_;break;case 0:case 11:case 14:case 15:if(!Co&&(null!==(u=i.updateQueue)&&null!==(u=u.lastEffect))){_=u=u.next;do{var w=_,x=w.destroy;w=w.tag,void 0!==x&&(2&w||4&w)&&Mj(i,s,x),_=_.next}while(_!==u)}Yj(o,s,i);break;case 1:if(!Co&&(Lj(i,s),\"function\"==typeof(u=i.stateNode).componentWillUnmount))try{u.props=i.memoizedProps,u.state=i.memoizedState,u.componentWillUnmount()}catch(o){W(i,s,o)}Yj(o,s,i);break;case 21:Yj(o,s,i);break;case 22:1&i.mode?(Co=(u=Co)||null!==i.memoizedState,Yj(o,s,i),Co=u):Yj(o,s,i);break;default:Yj(o,s,i)}}function ak(o){var s=o.updateQueue;if(null!==s){o.updateQueue=null;var i=o.stateNode;null===i&&(i=o.stateNode=new Ao),s.forEach((function(s){var u=bk.bind(null,o,s);i.has(s)||(i.add(s),s.then(u,u))}))}}function ck(o,s){var i=s.deletions;if(null!==i)for(var u=0;u<i.length;u++){var _=i[u];try{var w=o,x=s,C=x;e:for(;null!==C;){switch(C.tag){case 5:Io=C.stateNode,Mo=!1;break e;case 3:case 4:Io=C.stateNode.containerInfo,Mo=!0;break e}C=C.return}if(null===Io)throw Error(p(160));Zj(w,x,_),Io=null,Mo=!1;var j=_.alternate;null!==j&&(j.return=null),_.return=null}catch(o){W(_,s,o)}}if(12854&s.subtreeFlags)for(s=s.child;null!==s;)dk(s,o),s=s.sibling}function dk(o,s){var i=o.alternate,u=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(ck(s,o),ek(o),4&u){try{Pj(3,o,o.return),Qj(3,o)}catch(s){W(o,o.return,s)}try{Pj(5,o,o.return)}catch(s){W(o,o.return,s)}}break;case 1:ck(s,o),ek(o),512&u&&null!==i&&Lj(i,i.return);break;case 5:if(ck(s,o),ek(o),512&u&&null!==i&&Lj(i,i.return),32&o.flags){var _=o.stateNode;try{ob(_,\"\")}catch(s){W(o,o.return,s)}}if(4&u&&null!=(_=o.stateNode)){var w=o.memoizedProps,x=null!==i?i.memoizedProps:w,C=o.type,j=o.updateQueue;if(o.updateQueue=null,null!==j)try{\"input\"===C&&\"radio\"===w.type&&null!=w.name&&ab(_,w),vb(C,x);var L=vb(C,w);for(x=0;x<j.length;x+=2){var B=j[x],$=j[x+1];\"style\"===B?sb(_,$):\"dangerouslySetInnerHTML\"===B?$e(_,$):\"children\"===B?ob(_,$):ta(_,B,$,L)}switch(C){case\"input\":bb(_,w);break;case\"textarea\":ib(_,w);break;case\"select\":var V=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!w.multiple;var U=w.value;null!=U?fb(_,!!w.multiple,U,!1):V!==!!w.multiple&&(null!=w.defaultValue?fb(_,!!w.multiple,w.defaultValue,!0):fb(_,!!w.multiple,w.multiple?[]:\"\",!1))}_[fn]=w}catch(s){W(o,o.return,s)}}break;case 6:if(ck(s,o),ek(o),4&u){if(null===o.stateNode)throw Error(p(162));_=o.stateNode,w=o.memoizedProps;try{_.nodeValue=w}catch(s){W(o,o.return,s)}}break;case 3:if(ck(s,o),ek(o),4&u&&null!==i&&i.memoizedState.isDehydrated)try{bd(s.containerInfo)}catch(s){W(o,o.return,s)}break;case 4:default:ck(s,o),ek(o);break;case 13:ck(s,o),ek(o),8192&(_=o.child).flags&&(w=null!==_.memoizedState,_.stateNode.isHidden=w,!w||null!==_.alternate&&null!==_.alternate.memoizedState||(Xo=dt())),4&u&&ak(o);break;case 22:if(B=null!==i&&null!==i.memoizedState,1&o.mode?(Co=(L=Co)||B,ck(s,o),Co=L):ck(s,o),ek(o),8192&u){if(L=null!==o.memoizedState,(o.stateNode.isHidden=L)&&!B&&1&o.mode)for(jo=o,B=o.child;null!==B;){for($=jo=B;null!==jo;){switch(U=(V=jo).child,V.tag){case 0:case 11:case 14:case 15:Pj(4,V,V.return);break;case 1:Lj(V,V.return);var z=V.stateNode;if(\"function\"==typeof z.componentWillUnmount){u=V,i=V.return;try{s=u,z.props=s.memoizedProps,z.state=s.memoizedState,z.componentWillUnmount()}catch(o){W(u,i,o)}}break;case 5:Lj(V,V.return);break;case 22:if(null!==V.memoizedState){gk($);continue}}null!==U?(U.return=V,jo=U):gk($)}B=B.sibling}e:for(B=null,$=o;;){if(5===$.tag){if(null===B){B=$;try{_=$.stateNode,L?\"function\"==typeof(w=_.style).setProperty?w.setProperty(\"display\",\"none\",\"important\"):w.display=\"none\":(C=$.stateNode,x=null!=(j=$.memoizedProps.style)&&j.hasOwnProperty(\"display\")?j.display:null,C.style.display=rb(\"display\",x))}catch(s){W(o,o.return,s)}}}else if(6===$.tag){if(null===B)try{$.stateNode.nodeValue=L?\"\":$.memoizedProps}catch(s){W(o,o.return,s)}}else if((22!==$.tag&&23!==$.tag||null===$.memoizedState||$===o)&&null!==$.child){$.child.return=$,$=$.child;continue}if($===o)break e;for(;null===$.sibling;){if(null===$.return||$.return===o)break e;B===$&&(B=null),$=$.return}B===$&&(B=null),$.sibling.return=$.return,$=$.sibling}}break;case 19:ck(s,o),ek(o),4&u&&ak(o);case 21:}}function ek(o){var s=o.flags;if(2&s){try{e:{for(var i=o.return;null!==i;){if(Tj(i)){var u=i;break e}i=i.return}throw Error(p(160))}switch(u.tag){case 5:var _=u.stateNode;32&u.flags&&(ob(_,\"\"),u.flags&=-33),Wj(o,Uj(o),_);break;case 3:case 4:var w=u.stateNode.containerInfo;Vj(o,Uj(o),w);break;default:throw Error(p(161))}}catch(s){W(o,o.return,s)}o.flags&=-3}4096&s&&(o.flags&=-4097)}function hk(o,s,i){jo=o,ik(o,s,i)}function ik(o,s,i){for(var u=!!(1&o.mode);null!==jo;){var _=jo,w=_.child;if(22===_.tag&&u){var x=null!==_.memoizedState||Oo;if(!x){var C=_.alternate,j=null!==C&&null!==C.memoizedState||Co;C=Oo;var L=Co;if(Oo=x,(Co=j)&&!L)for(jo=_;null!==jo;)j=(x=jo).child,22===x.tag&&null!==x.memoizedState?jk(_):null!==j?(j.return=x,jo=j):jk(_);for(;null!==w;)jo=w,ik(w,s,i),w=w.sibling;jo=_,Oo=C,Co=L}kk(o)}else 8772&_.subtreeFlags&&null!==w?(w.return=_,jo=w):kk(o)}}function kk(o){for(;null!==jo;){var s=jo;if(8772&s.flags){var i=s.alternate;try{if(8772&s.flags)switch(s.tag){case 0:case 11:case 15:Co||Qj(5,s);break;case 1:var u=s.stateNode;if(4&s.flags&&!Co)if(null===i)u.componentDidMount();else{var _=s.elementType===s.type?i.memoizedProps:Ci(s.type,i.memoizedProps);u.componentDidUpdate(_,i.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var w=s.updateQueue;null!==w&&sh(s,w,u);break;case 3:var x=s.updateQueue;if(null!==x){if(i=null,null!==s.child)switch(s.child.tag){case 5:case 1:i=s.child.stateNode}sh(s,x,i)}break;case 5:var C=s.stateNode;if(null===i&&4&s.flags){i=C;var j=s.memoizedProps;switch(s.type){case\"button\":case\"input\":case\"select\":case\"textarea\":j.autoFocus&&i.focus();break;case\"img\":j.src&&(i.src=j.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===s.memoizedState){var L=s.alternate;if(null!==L){var B=L.memoizedState;if(null!==B){var $=B.dehydrated;null!==$&&bd($)}}}break;default:throw Error(p(163))}Co||512&s.flags&&Rj(s)}catch(o){W(s,s.return,o)}}if(s===o){jo=null;break}if(null!==(i=s.sibling)){i.return=s.return,jo=i;break}jo=s.return}}function gk(o){for(;null!==jo;){var s=jo;if(s===o){jo=null;break}var i=s.sibling;if(null!==i){i.return=s.return,jo=i;break}jo=s.return}}function jk(o){for(;null!==jo;){var s=jo;try{switch(s.tag){case 0:case 11:case 15:var i=s.return;try{Qj(4,s)}catch(o){W(s,i,o)}break;case 1:var u=s.stateNode;if(\"function\"==typeof u.componentDidMount){var _=s.return;try{u.componentDidMount()}catch(o){W(s,_,o)}}var w=s.return;try{Rj(s)}catch(o){W(s,w,o)}break;case 5:var x=s.return;try{Rj(s)}catch(o){W(s,x,o)}}}catch(o){W(s,s.return,o)}if(s===o){jo=null;break}var C=s.sibling;if(null!==C){C.return=s.return,jo=C;break}jo=s.return}}var No,To=Math.ceil,Ro=z.ReactCurrentDispatcher,Do=z.ReactCurrentOwner,Lo=z.ReactCurrentBatchConfig,Bo=0,Fo=null,qo=null,$o=0,Vo=0,Uo=Uf(0),zo=0,Wo=null,Ko=0,Ho=0,Jo=0,Go=null,Yo=null,Xo=0,Qo=1/0,Zo=null,es=!1,ts=null,rs=null,ns=!1,os=null,ss=0,as=0,cs=null,ls=-1,us=0;function R(){return 6&Bo?dt():-1!==ls?ls:ls=dt()}function yi(o){return 1&o.mode?2&Bo&&0!==$o?$o&-$o:null!==$n.transition?(0===us&&(us=yc()),us):0!==(o=At)?o:o=void 0===(o=window.event)?16:jd(o.type):1}function gi(o,s,i,u){if(50<as)throw as=0,cs=null,Error(p(185));Ac(o,i,u),2&Bo&&o===Fo||(o===Fo&&(!(2&Bo)&&(Ho|=i),4===zo&&Ck(o,$o)),Dk(o,u),1===i&&0===Bo&&!(1&s.mode)&&(Qo=dt()+500,On&&jg()))}function Dk(o,s){var i=o.callbackNode;!function wc(o,s){for(var i=o.suspendedLanes,u=o.pingedLanes,_=o.expirationTimes,w=o.pendingLanes;0<w;){var x=31-St(w),C=1<<x,j=_[x];-1===j?C&i&&!(C&u)||(_[x]=vc(C,s)):j<=s&&(o.expiredLanes|=C),w&=~C}}(o,s);var u=uc(o,o===Fo?$o:0);if(0===u)null!==i&&ut(i),o.callbackNode=null,o.callbackPriority=0;else if(s=u&-u,o.callbackPriority!==s){if(null!=i&&ut(i),1===s)0===o.tag?function ig(o){On=!0,hg(o)}(Ek.bind(null,o)):hg(Ek.bind(null,o)),pn((function(){!(6&Bo)&&jg()})),i=null;else{switch(Dc(u)){case 1:i=gt;break;case 4:i=yt;break;case 16:default:i=vt;break;case 536870912:i=_t}i=Fk(i,Gk.bind(null,o))}o.callbackPriority=s,o.callbackNode=i}}function Gk(o,s){if(ls=-1,us=0,6&Bo)throw Error(p(327));var i=o.callbackNode;if(Hk()&&o.callbackNode!==i)return null;var u=uc(o,o===Fo?$o:0);if(0===u)return null;if(30&u||u&o.expiredLanes||s)s=Ik(o,u);else{s=u;var _=Bo;Bo|=2;var w=Jk();for(Fo===o&&$o===s||(Zo=null,Qo=dt()+500,Kk(o,s));;)try{Lk();break}catch(s){Mk(o,s)}$g(),Ro.current=w,Bo=_,null!==qo?s=0:(Fo=null,$o=0,s=zo)}if(0!==s){if(2===s&&(0!==(_=xc(o))&&(u=_,s=Nk(o,_))),1===s)throw i=Wo,Kk(o,0),Ck(o,u),Dk(o,dt()),i;if(6===s)Ck(o,u);else{if(_=o.current.alternate,!(30&u||function Ok(o){for(var s=o;;){if(16384&s.flags){var i=s.updateQueue;if(null!==i&&null!==(i=i.stores))for(var u=0;u<i.length;u++){var _=i[u],w=_.getSnapshot;_=_.value;try{if(!Lr(w(),_))return!1}catch(o){return!1}}}if(i=s.child,16384&s.subtreeFlags&&null!==i)i.return=s,s=i;else{if(s===o)break;for(;null===s.sibling;){if(null===s.return||s.return===o)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}(_)||(s=Ik(o,u),2===s&&(w=xc(o),0!==w&&(u=w,s=Nk(o,w))),1!==s)))throw i=Wo,Kk(o,0),Ck(o,u),Dk(o,dt()),i;switch(o.finishedWork=_,o.finishedLanes=u,s){case 0:case 1:throw Error(p(345));case 2:case 5:Pk(o,Yo,Zo);break;case 3:if(Ck(o,u),(130023424&u)===u&&10<(s=Xo+500-dt())){if(0!==uc(o,0))break;if(((_=o.suspendedLanes)&u)!==u){R(),o.pingedLanes|=o.suspendedLanes&_;break}o.timeoutHandle=cn(Pk.bind(null,o,Yo,Zo),s);break}Pk(o,Yo,Zo);break;case 4:if(Ck(o,u),(4194240&u)===u)break;for(s=o.eventTimes,_=-1;0<u;){var x=31-St(u);w=1<<x,(x=s[x])>_&&(_=x),u&=~w}if(u=_,10<(u=(120>(u=dt()-u)?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*To(u/1960))-u)){o.timeoutHandle=cn(Pk.bind(null,o,Yo,Zo),u);break}Pk(o,Yo,Zo);break;default:throw Error(p(329))}}}return Dk(o,dt()),o.callbackNode===i?Gk.bind(null,o):null}function Nk(o,s){var i=Go;return o.current.memoizedState.isDehydrated&&(Kk(o,s).flags|=256),2!==(o=Ik(o,s))&&(s=Yo,Yo=i,null!==s&&Fj(s)),o}function Fj(o){null===Yo?Yo=o:Yo.push.apply(Yo,o)}function Ck(o,s){for(s&=~Jo,s&=~Ho,o.suspendedLanes|=s,o.pingedLanes&=~s,o=o.expirationTimes;0<s;){var i=31-St(s),u=1<<i;o[i]=-1,s&=~u}}function Ek(o){if(6&Bo)throw Error(p(327));Hk();var s=uc(o,0);if(!(1&s))return Dk(o,dt()),null;var i=Ik(o,s);if(0!==o.tag&&2===i){var u=xc(o);0!==u&&(s=u,i=Nk(o,u))}if(1===i)throw i=Wo,Kk(o,0),Ck(o,s),Dk(o,dt()),i;if(6===i)throw Error(p(345));return o.finishedWork=o.current.alternate,o.finishedLanes=s,Pk(o,Yo,Zo),Dk(o,dt()),null}function Qk(o,s){var i=Bo;Bo|=1;try{return o(s)}finally{0===(Bo=i)&&(Qo=dt()+500,On&&jg())}}function Rk(o){null!==os&&0===os.tag&&!(6&Bo)&&Hk();var s=Bo;Bo|=1;var i=Lo.transition,u=At;try{if(Lo.transition=null,At=1,o)return o()}finally{At=u,Lo.transition=i,!(6&(Bo=s))&&jg()}}function Hj(){Vo=Uo.current,E(Uo)}function Kk(o,s){o.finishedWork=null,o.finishedLanes=0;var i=o.timeoutHandle;if(-1!==i&&(o.timeoutHandle=-1,ln(i)),null!==qo)for(i=qo.return;null!==i;){var u=i;switch(wg(u),u.tag){case 1:null!=(u=u.type.childContextTypes)&&$f();break;case 3:zh(),E(Sn),E(wn),Eh();break;case 5:Bh(u);break;case 4:zh();break;case 13:case 19:E(eo);break;case 10:ah(u.type._context);break;case 22:case 23:Hj()}i=i.return}if(Fo=o,qo=o=Pg(o.current,null),$o=Vo=s,zo=0,Wo=null,Jo=Ho=Ko=0,Yo=Go=null,null!==Jn){for(s=0;s<Jn.length;s++)if(null!==(u=(i=Jn[s]).interleaved)){i.interleaved=null;var _=u.next,w=i.pending;if(null!==w){var x=w.next;w.next=_,u.next=x}i.pending=u}Jn=null}return o}function Mk(o,s){for(;;){var i=qo;try{if($g(),ro.current=ho,co){for(var u=so.memoizedState;null!==u;){var _=u.queue;null!==_&&(_.pending=null),u=u.next}co=!1}if(oo=0,ao=io=so=null,lo=!1,uo=0,Do.current=null,null===i||null===i.return){zo=1,Wo=s,qo=null;break}e:{var w=o,x=i.return,C=i,j=s;if(s=$o,C.flags|=32768,null!==j&&\"object\"==typeof j&&\"function\"==typeof j.then){var L=j,B=C,$=B.tag;if(!(1&B.mode||0!==$&&11!==$&&15!==$)){var V=B.alternate;V?(B.updateQueue=V.updateQueue,B.memoizedState=V.memoizedState,B.lanes=V.lanes):(B.updateQueue=null,B.memoizedState=null)}var U=Ui(x);if(null!==U){U.flags&=-257,Vi(U,x,C,0,s),1&U.mode&&Si(w,L,s),j=L;var z=(s=U).updateQueue;if(null===z){var Y=new Set;Y.add(j),s.updateQueue=Y}else z.add(j);break e}if(!(1&s)){Si(w,L,s),tj();break e}j=Error(p(426))}else if(Fn&&1&C.mode){var Z=Ui(x);if(null!==Z){!(65536&Z.flags)&&(Z.flags|=256),Vi(Z,x,C,0,s),Jg(Ji(j,C));break e}}w=j=Ji(j,C),4!==zo&&(zo=2),null===Go?Go=[w]:Go.push(w),w=x;do{switch(w.tag){case 3:w.flags|=65536,s&=-s,w.lanes|=s,ph(w,Ni(0,j,s));break e;case 1:C=j;var ee=w.type,ie=w.stateNode;if(!(128&w.flags||\"function\"!=typeof ee.getDerivedStateFromError&&(null===ie||\"function\"!=typeof ie.componentDidCatch||null!==rs&&rs.has(ie)))){w.flags|=65536,s&=-s,w.lanes|=s,ph(w,Qi(w,C,s));break e}}w=w.return}while(null!==w)}Sk(i)}catch(o){s=o,qo===i&&null!==i&&(qo=i=i.return);continue}break}}function Jk(){var o=Ro.current;return Ro.current=ho,null===o?ho:o}function tj(){0!==zo&&3!==zo&&2!==zo||(zo=4),null===Fo||!(268435455&Ko)&&!(268435455&Ho)||Ck(Fo,$o)}function Ik(o,s){var i=Bo;Bo|=2;var u=Jk();for(Fo===o&&$o===s||(Zo=null,Kk(o,s));;)try{Tk();break}catch(s){Mk(o,s)}if($g(),Bo=i,Ro.current=u,null!==qo)throw Error(p(261));return Fo=null,$o=0,zo}function Tk(){for(;null!==qo;)Uk(qo)}function Lk(){for(;null!==qo&&!pt();)Uk(qo)}function Uk(o){var s=No(o.alternate,o,Vo);o.memoizedProps=o.pendingProps,null===s?Sk(o):qo=s,Do.current=null}function Sk(o){var s=o;do{var i=s.alternate;if(o=s.return,32768&s.flags){if(null!==(i=Ij(i,s)))return i.flags&=32767,void(qo=i);if(null===o)return zo=6,void(qo=null);o.flags|=32768,o.subtreeFlags=0,o.deletions=null}else if(null!==(i=Ej(i,s,Vo)))return void(qo=i);if(null!==(s=s.sibling))return void(qo=s);qo=s=o}while(null!==s);0===zo&&(zo=5)}function Pk(o,s,i){var u=At,_=Lo.transition;try{Lo.transition=null,At=1,function Wk(o,s,i,u){do{Hk()}while(null!==os);if(6&Bo)throw Error(p(327));i=o.finishedWork;var _=o.finishedLanes;if(null===i)return null;if(o.finishedWork=null,o.finishedLanes=0,i===o.current)throw Error(p(177));o.callbackNode=null,o.callbackPriority=0;var w=i.lanes|i.childLanes;if(function Bc(o,s){var i=o.pendingLanes&~s;o.pendingLanes=s,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=s,o.mutableReadLanes&=s,o.entangledLanes&=s,s=o.entanglements;var u=o.eventTimes;for(o=o.expirationTimes;0<i;){var _=31-St(i),w=1<<_;s[_]=0,u[_]=-1,o[_]=-1,i&=~w}}(o,w),o===Fo&&(qo=Fo=null,$o=0),!(2064&i.subtreeFlags)&&!(2064&i.flags)||ns||(ns=!0,Fk(vt,(function(){return Hk(),null}))),w=!!(15990&i.flags),!!(15990&i.subtreeFlags)||w){w=Lo.transition,Lo.transition=null;var x=At;At=1;var C=Bo;Bo|=4,Do.current=null,function Oj(o,s){if(sn=zt,Ne(o=Me())){if(\"selectionStart\"in o)var i={start:o.selectionStart,end:o.selectionEnd};else e:{var u=(i=(i=o.ownerDocument)&&i.defaultView||window).getSelection&&i.getSelection();if(u&&0!==u.rangeCount){i=u.anchorNode;var _=u.anchorOffset,w=u.focusNode;u=u.focusOffset;try{i.nodeType,w.nodeType}catch(o){i=null;break e}var x=0,C=-1,j=-1,L=0,B=0,$=o,V=null;t:for(;;){for(var U;$!==i||0!==_&&3!==$.nodeType||(C=x+_),$!==w||0!==u&&3!==$.nodeType||(j=x+u),3===$.nodeType&&(x+=$.nodeValue.length),null!==(U=$.firstChild);)V=$,$=U;for(;;){if($===o)break t;if(V===i&&++L===_&&(C=x),V===w&&++B===u&&(j=x),null!==(U=$.nextSibling))break;V=($=V).parentNode}$=U}i=-1===C||-1===j?null:{start:C,end:j}}else i=null}i=i||{start:0,end:0}}else i=null;for(an={focusedElem:o,selectionRange:i},zt=!1,jo=s;null!==jo;)if(o=(s=jo).child,1028&s.subtreeFlags&&null!==o)o.return=s,jo=o;else for(;null!==jo;){s=jo;try{var z=s.alternate;if(1024&s.flags)switch(s.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==z){var Y=z.memoizedProps,Z=z.memoizedState,ee=s.stateNode,ie=ee.getSnapshotBeforeUpdate(s.elementType===s.type?Y:Ci(s.type,Y),Z);ee.__reactInternalSnapshotBeforeUpdate=ie}break;case 3:var ae=s.stateNode.containerInfo;1===ae.nodeType?ae.textContent=\"\":9===ae.nodeType&&ae.documentElement&&ae.removeChild(ae.documentElement);break;default:throw Error(p(163))}}catch(o){W(s,s.return,o)}if(null!==(o=s.sibling)){o.return=s.return,jo=o;break}jo=s.return}return z=Po,Po=!1,z}(o,i),dk(i,o),Oe(an),zt=!!sn,an=sn=null,o.current=i,hk(i,o,_),ht(),Bo=C,At=x,Lo.transition=w}else o.current=i;if(ns&&(ns=!1,os=o,ss=_),w=o.pendingLanes,0===w&&(rs=null),function mc(o){if(wt&&\"function\"==typeof wt.onCommitFiberRoot)try{wt.onCommitFiberRoot(Et,o,void 0,!(128&~o.current.flags))}catch(o){}}(i.stateNode),Dk(o,dt()),null!==s)for(u=o.onRecoverableError,i=0;i<s.length;i++)_=s[i],u(_.value,{componentStack:_.stack,digest:_.digest});if(es)throw es=!1,o=ts,ts=null,o;return!!(1&ss)&&0!==o.tag&&Hk(),w=o.pendingLanes,1&w?o===cs?as++:(as=0,cs=o):as=0,jg(),null}(o,s,i,u)}finally{Lo.transition=_,At=u}return null}function Hk(){if(null!==os){var o=Dc(ss),s=Lo.transition,i=At;try{if(Lo.transition=null,At=16>o?16:o,null===os)var u=!1;else{if(o=os,os=null,ss=0,6&Bo)throw Error(p(331));var _=Bo;for(Bo|=4,jo=o.current;null!==jo;){var w=jo,x=w.child;if(16&jo.flags){var C=w.deletions;if(null!==C){for(var j=0;j<C.length;j++){var L=C[j];for(jo=L;null!==jo;){var B=jo;switch(B.tag){case 0:case 11:case 15:Pj(8,B,w)}var $=B.child;if(null!==$)$.return=B,jo=$;else for(;null!==jo;){var V=(B=jo).sibling,U=B.return;if(Sj(B),B===L){jo=null;break}if(null!==V){V.return=U,jo=V;break}jo=U}}}var z=w.alternate;if(null!==z){var Y=z.child;if(null!==Y){z.child=null;do{var Z=Y.sibling;Y.sibling=null,Y=Z}while(null!==Y)}}jo=w}}if(2064&w.subtreeFlags&&null!==x)x.return=w,jo=x;else e:for(;null!==jo;){if(2048&(w=jo).flags)switch(w.tag){case 0:case 11:case 15:Pj(9,w,w.return)}var ee=w.sibling;if(null!==ee){ee.return=w.return,jo=ee;break e}jo=w.return}}var ie=o.current;for(jo=ie;null!==jo;){var ae=(x=jo).child;if(2064&x.subtreeFlags&&null!==ae)ae.return=x,jo=ae;else e:for(x=ie;null!==jo;){if(2048&(C=jo).flags)try{switch(C.tag){case 0:case 11:case 15:Qj(9,C)}}catch(o){W(C,C.return,o)}if(C===x){jo=null;break e}var ce=C.sibling;if(null!==ce){ce.return=C.return,jo=ce;break e}jo=C.return}}if(Bo=_,jg(),wt&&\"function\"==typeof wt.onPostCommitFiberRoot)try{wt.onPostCommitFiberRoot(Et,o)}catch(o){}u=!0}return u}finally{At=i,Lo.transition=s}}return!1}function Xk(o,s,i){o=nh(o,s=Ni(0,s=Ji(i,s),1),1),s=R(),null!==o&&(Ac(o,1,s),Dk(o,s))}function W(o,s,i){if(3===o.tag)Xk(o,o,i);else for(;null!==s;){if(3===s.tag){Xk(s,o,i);break}if(1===s.tag){var u=s.stateNode;if(\"function\"==typeof s.type.getDerivedStateFromError||\"function\"==typeof u.componentDidCatch&&(null===rs||!rs.has(u))){s=nh(s,o=Qi(s,o=Ji(i,o),1),1),o=R(),null!==s&&(Ac(s,1,o),Dk(s,o));break}}s=s.return}}function Ti(o,s,i){var u=o.pingCache;null!==u&&u.delete(s),s=R(),o.pingedLanes|=o.suspendedLanes&i,Fo===o&&($o&i)===i&&(4===zo||3===zo&&(130023424&$o)===$o&&500>dt()-Xo?Kk(o,0):Jo|=i),Dk(o,s)}function Yk(o,s){0===s&&(1&o.mode?(s=Ct,!(130023424&(Ct<<=1))&&(Ct=4194304)):s=1);var i=R();null!==(o=ih(o,s))&&(Ac(o,s,i),Dk(o,i))}function uj(o){var s=o.memoizedState,i=0;null!==s&&(i=s.retryLane),Yk(o,i)}function bk(o,s){var i=0;switch(o.tag){case 13:var u=o.stateNode,_=o.memoizedState;null!==_&&(i=_.retryLane);break;case 19:u=o.stateNode;break;default:throw Error(p(314))}null!==u&&u.delete(s),Yk(o,i)}function Fk(o,s){return lt(o,s)}function $k(o,s,i,u){this.tag=o,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(o,s,i,u){return new $k(o,s,i,u)}function aj(o){return!(!(o=o.prototype)||!o.isReactComponent)}function Pg(o,s){var i=o.alternate;return null===i?((i=Bg(o.tag,s,o.key,o.mode)).elementType=o.elementType,i.type=o.type,i.stateNode=o.stateNode,i.alternate=o,o.alternate=i):(i.pendingProps=s,i.type=o.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=14680064&o.flags,i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,s=o.dependencies,i.dependencies=null===s?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=o.sibling,i.index=o.index,i.ref=o.ref,i}function Rg(o,s,i,u,_,w){var x=2;if(u=o,\"function\"==typeof o)aj(o)&&(x=1);else if(\"string\"==typeof o)x=5;else e:switch(o){case ee:return Tg(i.children,_,w,s);case ie:x=8,_|=8;break;case ae:return(o=Bg(12,i,s,2|_)).elementType=ae,o.lanes=w,o;case de:return(o=Bg(13,i,s,_)).elementType=de,o.lanes=w,o;case fe:return(o=Bg(19,i,s,_)).elementType=fe,o.lanes=w,o;case _e:return pj(i,_,w,s);default:if(\"object\"==typeof o&&null!==o)switch(o.$$typeof){case ce:x=10;break e;case le:x=9;break e;case pe:x=11;break e;case ye:x=14;break e;case be:x=16,u=null;break e}throw Error(p(130,null==o?o:typeof o,\"\"))}return(s=Bg(x,i,s,_)).elementType=o,s.type=u,s.lanes=w,s}function Tg(o,s,i,u){return(o=Bg(7,o,u,s)).lanes=i,o}function pj(o,s,i,u){return(o=Bg(22,o,u,s)).elementType=_e,o.lanes=i,o.stateNode={isHidden:!1},o}function Qg(o,s,i){return(o=Bg(6,o,null,s)).lanes=i,o}function Sg(o,s,i){return(s=Bg(4,null!==o.children?o.children:[],o.key,s)).lanes=i,s.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},s}function al(o,s,i,u,_){this.tag=s,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=u,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function bl(o,s,i,u,_,w,x,C,j){return o=new al(o,s,i,C,j),1===s?(s=1,!0===w&&(s|=8)):s=0,w=Bg(3,null,null,s),o.current=w,w.stateNode=o,w.memoizedState={element:u,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(w),o}function dl(o){if(!o)return En;e:{if(Vb(o=o._reactInternals)!==o||1!==o.tag)throw Error(p(170));var s=o;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(Zf(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(null!==s);throw Error(p(171))}if(1===o.tag){var i=o.type;if(Zf(i))return bg(o,i,s)}return s}function el(o,s,i,u,_,w,x,C,j){return(o=bl(i,u,!0,o,0,w,0,C,j)).context=dl(null),i=o.current,(w=mh(u=R(),_=yi(i))).callback=null!=s?s:null,nh(i,w,_),o.current.lanes=_,Ac(o,_,u),Dk(o,u),o}function fl(o,s,i,u){var _=s.current,w=R(),x=yi(_);return i=dl(i),null===s.context?s.context=i:s.pendingContext=i,(s=mh(w,x)).payload={element:o},null!==(u=void 0===u?null:u)&&(s.callback=u),null!==(o=nh(_,s,x))&&(gi(o,_,x,w),oh(o,_,x)),x}function gl(o){return(o=o.current).child?(o.child.tag,o.child.stateNode):null}function hl(o,s){if(null!==(o=o.memoizedState)&&null!==o.dehydrated){var i=o.retryLane;o.retryLane=0!==i&&i<s?i:s}}function il(o,s){hl(o,s),(o=o.alternate)&&hl(o,s)}No=function(o,s,i){if(null!==o)if(o.memoizedProps!==s.pendingProps||Sn.current)_o=!0;else{if(!(o.lanes&i||128&s.flags))return _o=!1,function yj(o,s,i){switch(s.tag){case 3:kj(s),Ig();break;case 5:Ah(s);break;case 1:Zf(s.type)&&cg(s);break;case 4:yh(s,s.stateNode.containerInfo);break;case 10:var u=s.type._context,_=s.memoizedProps.value;G(zn,u._currentValue),u._currentValue=_;break;case 13:if(null!==(u=s.memoizedState))return null!==u.dehydrated?(G(eo,1&eo.current),s.flags|=128,null):i&s.child.childLanes?oj(o,s,i):(G(eo,1&eo.current),null!==(o=Zi(o,s,i))?o.sibling:null);G(eo,1&eo.current);break;case 19:if(u=!!(i&s.childLanes),128&o.flags){if(u)return xj(o,s,i);s.flags|=128}if(null!==(_=s.memoizedState)&&(_.rendering=null,_.tail=null,_.lastEffect=null),G(eo,eo.current),u)break;return null;case 22:case 23:return s.lanes=0,dj(o,s,i)}return Zi(o,s,i)}(o,s,i);_o=!!(131072&o.flags)}else _o=!1,Fn&&1048576&s.flags&&ug(s,In,s.index);switch(s.lanes=0,s.tag){case 2:var u=s.type;ij(o,s),o=s.pendingProps;var _=Yf(s,wn.current);ch(s,i),_=Nh(null,s,u,o,_,i);var w=Sh();return s.flags|=1,\"object\"==typeof _&&null!==_&&\"function\"==typeof _.render&&void 0===_.$$typeof?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Zf(u)?(w=!0,cg(s)):w=!1,s.memoizedState=null!==_.state&&void 0!==_.state?_.state:null,kh(s),_.updater=yo,s.stateNode=_,_._reactInternals=s,Ii(s,u,o,i),s=jj(null,s,u,!0,w,i)):(s.tag=0,Fn&&w&&vg(s),Xi(null,s,_,i),s=s.child),s;case 16:u=s.elementType;e:{switch(ij(o,s),o=s.pendingProps,u=(_=u._init)(u._payload),s.type=u,_=s.tag=function Zk(o){if(\"function\"==typeof o)return aj(o)?1:0;if(null!=o){if((o=o.$$typeof)===pe)return 11;if(o===ye)return 14}return 2}(u),o=Ci(u,o),_){case 0:s=cj(null,s,u,o,i);break e;case 1:s=hj(null,s,u,o,i);break e;case 11:s=Yi(null,s,u,o,i);break e;case 14:s=$i(null,s,u,Ci(u.type,o),i);break e}throw Error(p(306,u,\"\"))}return s;case 0:return u=s.type,_=s.pendingProps,cj(o,s,u,_=s.elementType===u?_:Ci(u,_),i);case 1:return u=s.type,_=s.pendingProps,hj(o,s,u,_=s.elementType===u?_:Ci(u,_),i);case 3:e:{if(kj(s),null===o)throw Error(p(387));u=s.pendingProps,_=(w=s.memoizedState).element,lh(o,s),qh(s,u,null,i);var x=s.memoizedState;if(u=x.element,w.isDehydrated){if(w={element:u,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},s.updateQueue.baseState=w,s.memoizedState=w,256&s.flags){s=lj(o,s,u,i,_=Ji(Error(p(423)),s));break e}if(u!==_){s=lj(o,s,u,i,_=Ji(Error(p(424)),s));break e}for(Bn=Lf(s.stateNode.containerInfo.firstChild),Ln=s,Fn=!0,qn=null,i=Un(s,null,u,i),s.child=i;i;)i.flags=-3&i.flags|4096,i=i.sibling}else{if(Ig(),u===_){s=Zi(o,s,i);break e}Xi(o,s,u,i)}s=s.child}return s;case 5:return Ah(s),null===o&&Eg(s),u=s.type,_=s.pendingProps,w=null!==o?o.memoizedProps:null,x=_.children,Ef(u,_)?x=null:null!==w&&Ef(u,w)&&(s.flags|=32),gj(o,s),Xi(o,s,x,i),s.child;case 6:return null===o&&Eg(s),null;case 13:return oj(o,s,i);case 4:return yh(s,s.stateNode.containerInfo),u=s.pendingProps,null===o?s.child=Vn(s,null,u,i):Xi(o,s,u,i),s.child;case 11:return u=s.type,_=s.pendingProps,Yi(o,s,u,_=s.elementType===u?_:Ci(u,_),i);case 7:return Xi(o,s,s.pendingProps,i),s.child;case 8:case 12:return Xi(o,s,s.pendingProps.children,i),s.child;case 10:e:{if(u=s.type._context,_=s.pendingProps,w=s.memoizedProps,x=_.value,G(zn,u._currentValue),u._currentValue=x,null!==w)if(Lr(w.value,x)){if(w.children===_.children&&!Sn.current){s=Zi(o,s,i);break e}}else for(null!==(w=s.child)&&(w.return=s);null!==w;){var C=w.dependencies;if(null!==C){x=w.child;for(var j=C.firstContext;null!==j;){if(j.context===u){if(1===w.tag){(j=mh(-1,i&-i)).tag=2;var L=w.updateQueue;if(null!==L){var B=(L=L.shared).pending;null===B?j.next=j:(j.next=B.next,B.next=j),L.pending=j}}w.lanes|=i,null!==(j=w.alternate)&&(j.lanes|=i),bh(w.return,i,s),C.lanes|=i;break}j=j.next}}else if(10===w.tag)x=w.type===s.type?null:w.child;else if(18===w.tag){if(null===(x=w.return))throw Error(p(341));x.lanes|=i,null!==(C=x.alternate)&&(C.lanes|=i),bh(x,i,s),x=w.sibling}else x=w.child;if(null!==x)x.return=w;else for(x=w;null!==x;){if(x===s){x=null;break}if(null!==(w=x.sibling)){w.return=x.return,x=w;break}x=x.return}w=x}Xi(o,s,_.children,i),s=s.child}return s;case 9:return _=s.type,u=s.pendingProps.children,ch(s,i),u=u(_=eh(_)),s.flags|=1,Xi(o,s,u,i),s.child;case 14:return _=Ci(u=s.type,s.pendingProps),$i(o,s,u,_=Ci(u.type,_),i);case 15:return bj(o,s,s.type,s.pendingProps,i);case 17:return u=s.type,_=s.pendingProps,_=s.elementType===u?_:Ci(u,_),ij(o,s),s.tag=1,Zf(u)?(o=!0,cg(s)):o=!1,ch(s,i),Gi(s,u,_),Ii(s,u,_,i),jj(null,s,u,!0,o,i);case 19:return xj(o,s,i);case 22:return dj(o,s,i)}throw Error(p(156,s.tag))};var ps=\"function\"==typeof reportError?reportError:function(o){console.error(o)};function ll(o){this._internalRoot=o}function ml(o){this._internalRoot=o}function nl(o){return!(!o||1!==o.nodeType&&9!==o.nodeType&&11!==o.nodeType)}function ol(o){return!(!o||1!==o.nodeType&&9!==o.nodeType&&11!==o.nodeType&&(8!==o.nodeType||\" react-mount-point-unstable \"!==o.nodeValue))}function pl(){}function rl(o,s,i,u,_){var w=i._reactRootContainer;if(w){var x=w;if(\"function\"==typeof _){var C=_;_=function(){var o=gl(x);C.call(o)}}fl(s,x,o,_)}else x=function ql(o,s,i,u,_){if(_){if(\"function\"==typeof u){var w=u;u=function(){var o=gl(x);w.call(o)}}var x=el(s,u,o,0,null,!1,0,\"\",pl);return o._reactRootContainer=x,o[mn]=x.current,sf(8===o.nodeType?o.parentNode:o),Rk(),x}for(;_=o.lastChild;)o.removeChild(_);if(\"function\"==typeof u){var C=u;u=function(){var o=gl(j);C.call(o)}}var j=bl(o,0,!1,null,0,!1,0,\"\",pl);return o._reactRootContainer=j,o[mn]=j.current,sf(8===o.nodeType?o.parentNode:o),Rk((function(){fl(s,j,i,u)})),j}(i,s,o,_,u);return gl(x)}ml.prototype.render=ll.prototype.render=function(o){var s=this._internalRoot;if(null===s)throw Error(p(409));fl(o,s,null,null)},ml.prototype.unmount=ll.prototype.unmount=function(){var o=this._internalRoot;if(null!==o){this._internalRoot=null;var s=o.containerInfo;Rk((function(){fl(null,o,null,null)})),s[mn]=null}},ml.prototype.unstable_scheduleHydration=function(o){if(o){var s=Mt();o={blockedOn:null,target:o,priority:s};for(var i=0;i<$t.length&&0!==s&&s<$t[i].priority;i++);$t.splice(i,0,o),0===i&&Vc(o)}},jt=function(o){switch(o.tag){case 3:var s=o.stateNode;if(s.current.memoizedState.isDehydrated){var i=tc(s.pendingLanes);0!==i&&(Cc(s,1|i),Dk(s,dt()),!(6&Bo)&&(Qo=dt()+500,jg()))}break;case 13:Rk((function(){var s=ih(o,1);if(null!==s){var i=R();gi(s,o,1,i)}})),il(o,1)}},Pt=function(o){if(13===o.tag){var s=ih(o,134217728);if(null!==s)gi(s,o,134217728,R());il(o,134217728)}},It=function(o){if(13===o.tag){var s=yi(o),i=ih(o,s);if(null!==i)gi(i,o,s,R());il(o,s)}},Mt=function(){return At},Nt=function(o,s){var i=At;try{return At=o,s()}finally{At=i}},Xe=function(o,s,i){switch(s){case\"input\":if(bb(o,i),s=i.name,\"radio\"===i.type&&null!=s){for(i=o;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll(\"input[name=\"+JSON.stringify(\"\"+s)+'][type=\"radio\"]'),s=0;s<i.length;s++){var u=i[s];if(u!==o&&u.form===o.form){var _=Db(u);if(!_)throw Error(p(90));Wa(u),bb(u,_)}}}break;case\"textarea\":ib(o,i);break;case\"select\":null!=(s=i.value)&&fb(o,!!i.multiple,s,!1)}},Gb=Qk,Hb=Rk;var hs={usingClientEntryPoint:!1,Events:[Cb,ue,Db,Eb,Fb,Qk]},ds={findFiberByHostInstance:Wc,bundleType:0,version:\"18.3.1\",rendererPackageName:\"react-dom\"},fs={bundleType:ds.bundleType,version:ds.version,rendererPackageName:ds.rendererPackageName,rendererConfig:ds.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:z.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return null===(o=Zb(o))?null:o.stateNode},findFiberByHostInstance:ds.findFiberByHostInstance||function jl(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:\"18.3.1-next-f1338f8080-20240426\"};if(\"undefined\"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ms=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ms.isDisabled&&ms.supportsFiber)try{Et=ms.inject(fs),wt=ms}catch(qe){}}s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hs,s.createPortal=function(o,s){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nl(s))throw Error(p(200));return function cl(o,s,i){var u=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Z,key:null==u?null:\"\"+u,children:o,containerInfo:s,implementation:i}}(o,s,null,i)},s.createRoot=function(o,s){if(!nl(o))throw Error(p(299));var i=!1,u=\"\",_=ps;return null!=s&&(!0===s.unstable_strictMode&&(i=!0),void 0!==s.identifierPrefix&&(u=s.identifierPrefix),void 0!==s.onRecoverableError&&(_=s.onRecoverableError)),s=bl(o,1,!1,null,0,i,0,u,_),o[mn]=s.current,sf(8===o.nodeType?o.parentNode:o),new ll(s)},s.findDOMNode=function(o){if(null==o)return null;if(1===o.nodeType)return o;var s=o._reactInternals;if(void 0===s){if(\"function\"==typeof o.render)throw Error(p(188));throw o=Object.keys(o).join(\",\"),Error(p(268,o))}return o=null===(o=Zb(s))?null:o.stateNode},s.flushSync=function(o){return Rk(o)},s.hydrate=function(o,s,i){if(!ol(s))throw Error(p(200));return rl(null,o,s,!0,i)},s.hydrateRoot=function(o,s,i){if(!nl(o))throw Error(p(405));var u=null!=i&&i.hydratedSources||null,_=!1,w=\"\",x=ps;if(null!=i&&(!0===i.unstable_strictMode&&(_=!0),void 0!==i.identifierPrefix&&(w=i.identifierPrefix),void 0!==i.onRecoverableError&&(x=i.onRecoverableError)),s=el(s,null,o,1,null!=i?i:null,_,0,w,x),o[mn]=s.current,sf(o),u)for(o=0;o<u.length;o++)_=(_=(i=u[o])._getVersion)(i._source),null==s.mutableSourceEagerHydrationData?s.mutableSourceEagerHydrationData=[i,_]:s.mutableSourceEagerHydrationData.push(i,_);return new ml(s)},s.render=function(o,s,i){if(!ol(s))throw Error(p(200));return rl(null,o,s,!1,i)},s.unmountComponentAtNode=function(o){if(!ol(o))throw Error(p(40));return!!o._reactRootContainer&&(Rk((function(){rl(null,null,o,!1,(function(){o._reactRootContainer=null,o[mn]=null}))})),!0)},s.unstable_batchedUpdates=Qk,s.unstable_renderSubtreeIntoContainer=function(o,s,i,u){if(!ol(i))throw Error(p(200));if(null==o||void 0===o._reactInternals)throw Error(p(38));return rl(o,s,i,!1,u)},s.version=\"18.3.1-next-f1338f8080-20240426\"},40961:(o,s,i)=>{\"use strict\";!function checkDCE(){if(\"undefined\"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&\"function\"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(o){console.error(o)}}(),o.exports=i(22551)},2209:(o,s,i)=>{\"use strict\";var u,_=i(9404),w=\"<<anonymous>>\",x=function productionTypeChecker(){invariant(!1,\"ImmutablePropTypes type checking code is stripped in production.\")};x.isRequired=x;var C=function getProductionTypeChecker(){return x};function getPropType(o){var s=typeof o;return Array.isArray(o)?\"array\":o instanceof RegExp?\"object\":o instanceof _.Iterable?\"Immutable.\"+o.toSource().split(\" \")[0]:s}function createChainableTypeChecker(o){function checkType(s,i,u,_,x,C){for(var j=arguments.length,L=Array(j>6?j-6:0),B=6;B<j;B++)L[B-6]=arguments[B];return C=C||u,_=_||w,null!=i[u]?o.apply(void 0,[i,u,_,x,C].concat(L)):s?new Error(\"Required \"+x+\" `\"+C+\"` was not specified in `\"+_+\"`.\"):void 0}var s=checkType.bind(null,!1);return s.isRequired=checkType.bind(null,!0),s}function createIterableSubclassTypeChecker(o,s){return function createImmutableTypeChecker(o,s){return createChainableTypeChecker((function validate(i,u,_,w,x){var C=i[u];if(!s(C)){var j=getPropType(C);return new Error(\"Invalid \"+w+\" `\"+x+\"` of type `\"+j+\"` supplied to `\"+_+\"`, expected `\"+o+\"`.\")}return null}))}(\"Iterable.\"+o,(function(o){return _.Iterable.isIterable(o)&&s(o)}))}(u={listOf:C,mapOf:C,orderedMapOf:C,setOf:C,orderedSetOf:C,stackOf:C,iterableOf:C,recordOf:C,shape:C,contains:C,mapContains:C,orderedMapContains:C,list:x,map:x,orderedMap:x,set:x,orderedSet:x,stack:x,seq:x,record:x,iterable:x}).iterable.indexed=createIterableSubclassTypeChecker(\"Indexed\",_.Iterable.isIndexed),u.iterable.keyed=createIterableSubclassTypeChecker(\"Keyed\",_.Iterable.isKeyed),o.exports=u},15287:(o,s)=>{\"use strict\";var i=Symbol.for(\"react.element\"),u=Symbol.for(\"react.portal\"),_=Symbol.for(\"react.fragment\"),w=Symbol.for(\"react.strict_mode\"),x=Symbol.for(\"react.profiler\"),C=Symbol.for(\"react.provider\"),j=Symbol.for(\"react.context\"),L=Symbol.for(\"react.forward_ref\"),B=Symbol.for(\"react.suspense\"),$=Symbol.for(\"react.memo\"),V=Symbol.for(\"react.lazy\"),U=Symbol.iterator;var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,Z={};function E(o,s,i){this.props=o,this.context=s,this.refs=Z,this.updater=i||z}function F(){}function G(o,s,i){this.props=o,this.context=s,this.refs=Z,this.updater=i||z}E.prototype.isReactComponent={},E.prototype.setState=function(o,s){if(\"object\"!=typeof o&&\"function\"!=typeof o&&null!=o)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,o,s,\"setState\")},E.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,\"forceUpdate\")},F.prototype=E.prototype;var ee=G.prototype=new F;ee.constructor=G,Y(ee,E.prototype),ee.isPureReactComponent=!0;var ie=Array.isArray,ae=Object.prototype.hasOwnProperty,ce={current:null},le={key:!0,ref:!0,__self:!0,__source:!0};function M(o,s,u){var _,w={},x=null,C=null;if(null!=s)for(_ in void 0!==s.ref&&(C=s.ref),void 0!==s.key&&(x=\"\"+s.key),s)ae.call(s,_)&&!le.hasOwnProperty(_)&&(w[_]=s[_]);var j=arguments.length-2;if(1===j)w.children=u;else if(1<j){for(var L=Array(j),B=0;B<j;B++)L[B]=arguments[B+2];w.children=L}if(o&&o.defaultProps)for(_ in j=o.defaultProps)void 0===w[_]&&(w[_]=j[_]);return{$$typeof:i,type:o,key:x,ref:C,props:w,_owner:ce.current}}function O(o){return\"object\"==typeof o&&null!==o&&o.$$typeof===i}var pe=/\\/+/g;function Q(o,s){return\"object\"==typeof o&&null!==o&&null!=o.key?function escape(o){var s={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+o.replace(/[=:]/g,(function(o){return s[o]}))}(\"\"+o.key):s.toString(36)}function R(o,s,_,w,x){var C=typeof o;\"undefined\"!==C&&\"boolean\"!==C||(o=null);var j=!1;if(null===o)j=!0;else switch(C){case\"string\":case\"number\":j=!0;break;case\"object\":switch(o.$$typeof){case i:case u:j=!0}}if(j)return x=x(j=o),o=\"\"===w?\".\"+Q(j,0):w,ie(x)?(_=\"\",null!=o&&(_=o.replace(pe,\"$&/\")+\"/\"),R(x,s,_,\"\",(function(o){return o}))):null!=x&&(O(x)&&(x=function N(o,s){return{$$typeof:i,type:o.type,key:s,ref:o.ref,props:o.props,_owner:o._owner}}(x,_+(!x.key||j&&j.key===x.key?\"\":(\"\"+x.key).replace(pe,\"$&/\")+\"/\")+o)),s.push(x)),1;if(j=0,w=\"\"===w?\".\":w+\":\",ie(o))for(var L=0;L<o.length;L++){var B=w+Q(C=o[L],L);j+=R(C,s,_,B,x)}else if(B=function A(o){return null===o||\"object\"!=typeof o?null:\"function\"==typeof(o=U&&o[U]||o[\"@@iterator\"])?o:null}(o),\"function\"==typeof B)for(o=B.call(o),L=0;!(C=o.next()).done;)j+=R(C=C.value,s,_,B=w+Q(C,L++),x);else if(\"object\"===C)throw s=String(o),Error(\"Objects are not valid as a React child (found: \"+(\"[object Object]\"===s?\"object with keys {\"+Object.keys(o).join(\", \")+\"}\":s)+\"). If you meant to render a collection of children, use an array instead.\");return j}function S(o,s,i){if(null==o)return o;var u=[],_=0;return R(o,u,\"\",\"\",(function(o){return s.call(i,o,_++)})),u}function T(o){if(-1===o._status){var s=o._result;(s=s()).then((function(s){0!==o._status&&-1!==o._status||(o._status=1,o._result=s)}),(function(s){0!==o._status&&-1!==o._status||(o._status=2,o._result=s)})),-1===o._status&&(o._status=0,o._result=s)}if(1===o._status)return o._result.default;throw o._result}var de={current:null},fe={transition:null},ye={ReactCurrentDispatcher:de,ReactCurrentBatchConfig:fe,ReactCurrentOwner:ce};function X(){throw Error(\"act(...) is not supported in production builds of React.\")}s.Children={map:S,forEach:function(o,s,i){S(o,(function(){s.apply(this,arguments)}),i)},count:function(o){var s=0;return S(o,(function(){s++})),s},toArray:function(o){return S(o,(function(o){return o}))||[]},only:function(o){if(!O(o))throw Error(\"React.Children.only expected to receive a single React element child.\");return o}},s.Component=E,s.Fragment=_,s.Profiler=x,s.PureComponent=G,s.StrictMode=w,s.Suspense=B,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ye,s.act=X,s.cloneElement=function(o,s,u){if(null==o)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+o+\".\");var _=Y({},o.props),w=o.key,x=o.ref,C=o._owner;if(null!=s){if(void 0!==s.ref&&(x=s.ref,C=ce.current),void 0!==s.key&&(w=\"\"+s.key),o.type&&o.type.defaultProps)var j=o.type.defaultProps;for(L in s)ae.call(s,L)&&!le.hasOwnProperty(L)&&(_[L]=void 0===s[L]&&void 0!==j?j[L]:s[L])}var L=arguments.length-2;if(1===L)_.children=u;else if(1<L){j=Array(L);for(var B=0;B<L;B++)j[B]=arguments[B+2];_.children=j}return{$$typeof:i,type:o.type,key:w,ref:x,props:_,_owner:C}},s.createContext=function(o){return(o={$$typeof:j,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:C,_context:o},o.Consumer=o},s.createElement=M,s.createFactory=function(o){var s=M.bind(null,o);return s.type=o,s},s.createRef=function(){return{current:null}},s.forwardRef=function(o){return{$$typeof:L,render:o}},s.isValidElement=O,s.lazy=function(o){return{$$typeof:V,_payload:{_status:-1,_result:o},_init:T}},s.memo=function(o,s){return{$$typeof:$,type:o,compare:void 0===s?null:s}},s.startTransition=function(o){var s=fe.transition;fe.transition={};try{o()}finally{fe.transition=s}},s.unstable_act=X,s.useCallback=function(o,s){return de.current.useCallback(o,s)},s.useContext=function(o){return de.current.useContext(o)},s.useDebugValue=function(){},s.useDeferredValue=function(o){return de.current.useDeferredValue(o)},s.useEffect=function(o,s){return de.current.useEffect(o,s)},s.useId=function(){return de.current.useId()},s.useImperativeHandle=function(o,s,i){return de.current.useImperativeHandle(o,s,i)},s.useInsertionEffect=function(o,s){return de.current.useInsertionEffect(o,s)},s.useLayoutEffect=function(o,s){return de.current.useLayoutEffect(o,s)},s.useMemo=function(o,s){return de.current.useMemo(o,s)},s.useReducer=function(o,s,i){return de.current.useReducer(o,s,i)},s.useRef=function(o){return de.current.useRef(o)},s.useState=function(o){return de.current.useState(o)},s.useSyncExternalStore=function(o,s,i){return de.current.useSyncExternalStore(o,s,i)},s.useTransition=function(){return de.current.useTransition()},s.version=\"18.3.1\"},96540:(o,s,i)=>{\"use strict\";o.exports=i(15287)},86048:o=>{\"use strict\";var s={};function createErrorType(o,i,u){u||(u=Error);var _=function(o){function NodeError(s,u,_){return o.call(this,function getMessage(o,s,u){return\"string\"==typeof i?i:i(o,s,u)}(s,u,_))||this}return function _inheritsLoose(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.__proto__=s}(NodeError,o),NodeError}(u);_.prototype.name=u.name,_.prototype.code=o,s[o]=_}function oneOf(o,s){if(Array.isArray(o)){var i=o.length;return o=o.map((function(o){return String(o)})),i>2?\"one of \".concat(s,\" \").concat(o.slice(0,i-1).join(\", \"),\", or \")+o[i-1]:2===i?\"one of \".concat(s,\" \").concat(o[0],\" or \").concat(o[1]):\"of \".concat(s,\" \").concat(o[0])}return\"of \".concat(s,\" \").concat(String(o))}createErrorType(\"ERR_INVALID_OPT_VALUE\",(function(o,s){return'The value \"'+s+'\" is invalid for option \"'+o+'\"'}),TypeError),createErrorType(\"ERR_INVALID_ARG_TYPE\",(function(o,s,i){var u,_;if(\"string\"==typeof s&&function startsWith(o,s,i){return o.substr(!i||i<0?0:+i,s.length)===s}(s,\"not \")?(u=\"must not be\",s=s.replace(/^not /,\"\")):u=\"must be\",function endsWith(o,s,i){return(void 0===i||i>o.length)&&(i=o.length),o.substring(i-s.length,i)===s}(o,\" argument\"))_=\"The \".concat(o,\" \").concat(u,\" \").concat(oneOf(s,\"type\"));else{var w=function includes(o,s,i){return\"number\"!=typeof i&&(i=0),!(i+s.length>o.length)&&-1!==o.indexOf(s,i)}(o,\".\")?\"property\":\"argument\";_='The \"'.concat(o,'\" ').concat(w,\" \").concat(u,\" \").concat(oneOf(s,\"type\"))}return _+=\". Received type \".concat(typeof i)}),TypeError),createErrorType(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),createErrorType(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(o){return\"The \"+o+\" method is not implemented\"})),createErrorType(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),createErrorType(\"ERR_STREAM_DESTROYED\",(function(o){return\"Cannot call \"+o+\" after a stream was destroyed\"})),createErrorType(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),createErrorType(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),createErrorType(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),createErrorType(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),createErrorType(\"ERR_UNKNOWN_ENCODING\",(function(o){return\"Unknown encoding: \"+o}),TypeError),createErrorType(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),o.exports.F=s},25382:(o,s,i)=>{\"use strict\";var u=i(65606),_=Object.keys||function(o){var s=[];for(var i in o)s.push(i);return s};o.exports=Duplex;var w=i(45412),x=i(16708);i(56698)(Duplex,w);for(var C=_(x.prototype),j=0;j<C.length;j++){var L=C[j];Duplex.prototype[L]||(Duplex.prototype[L]=x.prototype[L])}function Duplex(o){if(!(this instanceof Duplex))return new Duplex(o);w.call(this,o),x.call(this,o),this.allowHalfOpen=!0,o&&(!1===o.readable&&(this.readable=!1),!1===o.writable&&(this.writable=!1),!1===o.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(\"end\",onend)))}function onend(){this._writableState.ended||u.nextTick(onEndNT,this)}function onEndNT(o){o.end()}Object.defineProperty(Duplex.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,\"writableBuffer\",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Duplex.prototype,\"writableLength\",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Duplex.prototype,\"destroyed\",{enumerable:!1,get:function get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function set(o){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=o,this._writableState.destroyed=o)}})},63600:(o,s,i)=>{\"use strict\";o.exports=PassThrough;var u=i(74610);function PassThrough(o){if(!(this instanceof PassThrough))return new PassThrough(o);u.call(this,o)}i(56698)(PassThrough,u),PassThrough.prototype._transform=function(o,s,i){i(null,o)}},45412:(o,s,i)=>{\"use strict\";var u,_=i(65606);o.exports=Readable,Readable.ReadableState=ReadableState;i(37007).EventEmitter;var w=function EElistenerCount(o,s){return o.listeners(s).length},x=i(40345),C=i(48287).Buffer,j=(void 0!==i.g?i.g:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var L,B=i(79838);L=B&&B.debuglog?B.debuglog(\"stream\"):function debug(){};var $,V,U,z=i(80345),Y=i(75896),Z=i(65291).getHighWaterMark,ee=i(86048).F,ie=ee.ERR_INVALID_ARG_TYPE,ae=ee.ERR_STREAM_PUSH_AFTER_EOF,ce=ee.ERR_METHOD_NOT_IMPLEMENTED,le=ee.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;i(56698)(Readable,x);var pe=Y.errorOrDestroy,de=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function ReadableState(o,s,_){u=u||i(25382),o=o||{},\"boolean\"!=typeof _&&(_=s instanceof u),this.objectMode=!!o.objectMode,_&&(this.objectMode=this.objectMode||!!o.readableObjectMode),this.highWaterMark=Z(this,o,\"readableHighWaterMark\",_),this.buffer=new z,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=!1!==o.emitClose,this.autoDestroy=!!o.autoDestroy,this.destroyed=!1,this.defaultEncoding=o.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,o.encoding&&($||($=i(83141).I),this.decoder=new $(o.encoding),this.encoding=o.encoding)}function Readable(o){if(u=u||i(25382),!(this instanceof Readable))return new Readable(o);var s=this instanceof u;this._readableState=new ReadableState(o,this,s),this.readable=!0,o&&(\"function\"==typeof o.read&&(this._read=o.read),\"function\"==typeof o.destroy&&(this._destroy=o.destroy)),x.call(this)}function readableAddChunk(o,s,i,u,_){L(\"readableAddChunk\",s);var w,x=o._readableState;if(null===s)x.reading=!1,function onEofChunk(o,s){if(L(\"onEofChunk\"),s.ended)return;if(s.decoder){var i=s.decoder.end();i&&i.length&&(s.buffer.push(i),s.length+=s.objectMode?1:i.length)}s.ended=!0,s.sync?emitReadable(o):(s.needReadable=!1,s.emittedReadable||(s.emittedReadable=!0,emitReadable_(o)))}(o,x);else if(_||(w=function chunkInvalid(o,s){var i;(function _isUint8Array(o){return C.isBuffer(o)||o instanceof j})(s)||\"string\"==typeof s||void 0===s||o.objectMode||(i=new ie(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],s));return i}(x,s)),w)pe(o,w);else if(x.objectMode||s&&s.length>0)if(\"string\"==typeof s||x.objectMode||Object.getPrototypeOf(s)===C.prototype||(s=function _uint8ArrayToBuffer(o){return C.from(o)}(s)),u)x.endEmitted?pe(o,new le):addChunk(o,x,s,!0);else if(x.ended)pe(o,new ae);else{if(x.destroyed)return!1;x.reading=!1,x.decoder&&!i?(s=x.decoder.write(s),x.objectMode||0!==s.length?addChunk(o,x,s,!1):maybeReadMore(o,x)):addChunk(o,x,s,!1)}else u||(x.reading=!1,maybeReadMore(o,x));return!x.ended&&(x.length<x.highWaterMark||0===x.length)}function addChunk(o,s,i,u){s.flowing&&0===s.length&&!s.sync?(s.awaitDrain=0,o.emit(\"data\",i)):(s.length+=s.objectMode?1:i.length,u?s.buffer.unshift(i):s.buffer.push(i),s.needReadable&&emitReadable(o)),maybeReadMore(o,s)}Object.defineProperty(Readable.prototype,\"destroyed\",{enumerable:!1,get:function get(){return void 0!==this._readableState&&this._readableState.destroyed},set:function set(o){this._readableState&&(this._readableState.destroyed=o)}}),Readable.prototype.destroy=Y.destroy,Readable.prototype._undestroy=Y.undestroy,Readable.prototype._destroy=function(o,s){s(o)},Readable.prototype.push=function(o,s){var i,u=this._readableState;return u.objectMode?i=!0:\"string\"==typeof o&&((s=s||u.defaultEncoding)!==u.encoding&&(o=C.from(o,s),s=\"\"),i=!0),readableAddChunk(this,o,s,!1,i)},Readable.prototype.unshift=function(o){return readableAddChunk(this,o,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(o){$||($=i(83141).I);var s=new $(o);this._readableState.decoder=s,this._readableState.encoding=this._readableState.decoder.encoding;for(var u=this._readableState.buffer.head,_=\"\";null!==u;)_+=s.write(u.data),u=u.next;return this._readableState.buffer.clear(),\"\"!==_&&this._readableState.buffer.push(_),this._readableState.length=_.length,this};var fe=1073741824;function howMuchToRead(o,s){return o<=0||0===s.length&&s.ended?0:s.objectMode?1:o!=o?s.flowing&&s.length?s.buffer.head.data.length:s.length:(o>s.highWaterMark&&(s.highWaterMark=function computeNewHighWaterMark(o){return o>=fe?o=fe:(o--,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o++),o}(o)),o<=s.length?o:s.ended?s.length:(s.needReadable=!0,0))}function emitReadable(o){var s=o._readableState;L(\"emitReadable\",s.needReadable,s.emittedReadable),s.needReadable=!1,s.emittedReadable||(L(\"emitReadable\",s.flowing),s.emittedReadable=!0,_.nextTick(emitReadable_,o))}function emitReadable_(o){var s=o._readableState;L(\"emitReadable_\",s.destroyed,s.length,s.ended),s.destroyed||!s.length&&!s.ended||(o.emit(\"readable\"),s.emittedReadable=!1),s.needReadable=!s.flowing&&!s.ended&&s.length<=s.highWaterMark,flow(o)}function maybeReadMore(o,s){s.readingMore||(s.readingMore=!0,_.nextTick(maybeReadMore_,o,s))}function maybeReadMore_(o,s){for(;!s.reading&&!s.ended&&(s.length<s.highWaterMark||s.flowing&&0===s.length);){var i=s.length;if(L(\"maybeReadMore read 0\"),o.read(0),i===s.length)break}s.readingMore=!1}function updateReadableListening(o){var s=o._readableState;s.readableListening=o.listenerCount(\"readable\")>0,s.resumeScheduled&&!s.paused?s.flowing=!0:o.listenerCount(\"data\")>0&&o.resume()}function nReadingNextTick(o){L(\"readable nexttick read 0\"),o.read(0)}function resume_(o,s){L(\"resume\",s.reading),s.reading||o.read(0),s.resumeScheduled=!1,o.emit(\"resume\"),flow(o),s.flowing&&!s.reading&&o.read(0)}function flow(o){var s=o._readableState;for(L(\"flow\",s.flowing);s.flowing&&null!==o.read(););}function fromList(o,s){return 0===s.length?null:(s.objectMode?i=s.buffer.shift():!o||o>=s.length?(i=s.decoder?s.buffer.join(\"\"):1===s.buffer.length?s.buffer.first():s.buffer.concat(s.length),s.buffer.clear()):i=s.buffer.consume(o,s.decoder),i);var i}function endReadable(o){var s=o._readableState;L(\"endReadable\",s.endEmitted),s.endEmitted||(s.ended=!0,_.nextTick(endReadableNT,s,o))}function endReadableNT(o,s){if(L(\"endReadableNT\",o.endEmitted,o.length),!o.endEmitted&&0===o.length&&(o.endEmitted=!0,s.readable=!1,s.emit(\"end\"),o.autoDestroy)){var i=s._writableState;(!i||i.autoDestroy&&i.finished)&&s.destroy()}}function indexOf(o,s){for(var i=0,u=o.length;i<u;i++)if(o[i]===s)return i;return-1}Readable.prototype.read=function(o){L(\"read\",o),o=parseInt(o,10);var s=this._readableState,i=o;if(0!==o&&(s.emittedReadable=!1),0===o&&s.needReadable&&((0!==s.highWaterMark?s.length>=s.highWaterMark:s.length>0)||s.ended))return L(\"read: emitReadable\",s.length,s.ended),0===s.length&&s.ended?endReadable(this):emitReadable(this),null;if(0===(o=howMuchToRead(o,s))&&s.ended)return 0===s.length&&endReadable(this),null;var u,_=s.needReadable;return L(\"need readable\",_),(0===s.length||s.length-o<s.highWaterMark)&&L(\"length less than watermark\",_=!0),s.ended||s.reading?L(\"reading or ended\",_=!1):_&&(L(\"do read\"),s.reading=!0,s.sync=!0,0===s.length&&(s.needReadable=!0),this._read(s.highWaterMark),s.sync=!1,s.reading||(o=howMuchToRead(i,s))),null===(u=o>0?fromList(o,s):null)?(s.needReadable=s.length<=s.highWaterMark,o=0):(s.length-=o,s.awaitDrain=0),0===s.length&&(s.ended||(s.needReadable=!0),i!==o&&s.ended&&endReadable(this)),null!==u&&this.emit(\"data\",u),u},Readable.prototype._read=function(o){pe(this,new ce(\"_read()\"))},Readable.prototype.pipe=function(o,s){var i=this,u=this._readableState;switch(u.pipesCount){case 0:u.pipes=o;break;case 1:u.pipes=[u.pipes,o];break;default:u.pipes.push(o)}u.pipesCount+=1,L(\"pipe count=%d opts=%j\",u.pipesCount,s);var x=(!s||!1!==s.end)&&o!==_.stdout&&o!==_.stderr?onend:unpipe;function onunpipe(s,_){L(\"onunpipe\"),s===i&&_&&!1===_.hasUnpiped&&(_.hasUnpiped=!0,function cleanup(){L(\"cleanup\"),o.removeListener(\"close\",onclose),o.removeListener(\"finish\",onfinish),o.removeListener(\"drain\",C),o.removeListener(\"error\",onerror),o.removeListener(\"unpipe\",onunpipe),i.removeListener(\"end\",onend),i.removeListener(\"end\",unpipe),i.removeListener(\"data\",ondata),j=!0,!u.awaitDrain||o._writableState&&!o._writableState.needDrain||C()}())}function onend(){L(\"onend\"),o.end()}u.endEmitted?_.nextTick(x):i.once(\"end\",x),o.on(\"unpipe\",onunpipe);var C=function pipeOnDrain(o){return function pipeOnDrainFunctionResult(){var s=o._readableState;L(\"pipeOnDrain\",s.awaitDrain),s.awaitDrain&&s.awaitDrain--,0===s.awaitDrain&&w(o,\"data\")&&(s.flowing=!0,flow(o))}}(i);o.on(\"drain\",C);var j=!1;function ondata(s){L(\"ondata\");var _=o.write(s);L(\"dest.write\",_),!1===_&&((1===u.pipesCount&&u.pipes===o||u.pipesCount>1&&-1!==indexOf(u.pipes,o))&&!j&&(L(\"false write response, pause\",u.awaitDrain),u.awaitDrain++),i.pause())}function onerror(s){L(\"onerror\",s),unpipe(),o.removeListener(\"error\",onerror),0===w(o,\"error\")&&pe(o,s)}function onclose(){o.removeListener(\"finish\",onfinish),unpipe()}function onfinish(){L(\"onfinish\"),o.removeListener(\"close\",onclose),unpipe()}function unpipe(){L(\"unpipe\"),i.unpipe(o)}return i.on(\"data\",ondata),function prependListener(o,s,i){if(\"function\"==typeof o.prependListener)return o.prependListener(s,i);o._events&&o._events[s]?Array.isArray(o._events[s])?o._events[s].unshift(i):o._events[s]=[i,o._events[s]]:o.on(s,i)}(o,\"error\",onerror),o.once(\"close\",onclose),o.once(\"finish\",onfinish),o.emit(\"pipe\",i),u.flowing||(L(\"pipe resume\"),i.resume()),o},Readable.prototype.unpipe=function(o){var s=this._readableState,i={hasUnpiped:!1};if(0===s.pipesCount)return this;if(1===s.pipesCount)return o&&o!==s.pipes||(o||(o=s.pipes),s.pipes=null,s.pipesCount=0,s.flowing=!1,o&&o.emit(\"unpipe\",this,i)),this;if(!o){var u=s.pipes,_=s.pipesCount;s.pipes=null,s.pipesCount=0,s.flowing=!1;for(var w=0;w<_;w++)u[w].emit(\"unpipe\",this,{hasUnpiped:!1});return this}var x=indexOf(s.pipes,o);return-1===x||(s.pipes.splice(x,1),s.pipesCount-=1,1===s.pipesCount&&(s.pipes=s.pipes[0]),o.emit(\"unpipe\",this,i)),this},Readable.prototype.on=function(o,s){var i=x.prototype.on.call(this,o,s),u=this._readableState;return\"data\"===o?(u.readableListening=this.listenerCount(\"readable\")>0,!1!==u.flowing&&this.resume()):\"readable\"===o&&(u.endEmitted||u.readableListening||(u.readableListening=u.needReadable=!0,u.flowing=!1,u.emittedReadable=!1,L(\"on readable\",u.length,u.reading),u.length?emitReadable(this):u.reading||_.nextTick(nReadingNextTick,this))),i},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.removeListener=function(o,s){var i=x.prototype.removeListener.call(this,o,s);return\"readable\"===o&&_.nextTick(updateReadableListening,this),i},Readable.prototype.removeAllListeners=function(o){var s=x.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==o&&void 0!==o||_.nextTick(updateReadableListening,this),s},Readable.prototype.resume=function(){var o=this._readableState;return o.flowing||(L(\"resume\"),o.flowing=!o.readableListening,function resume(o,s){s.resumeScheduled||(s.resumeScheduled=!0,_.nextTick(resume_,o,s))}(this,o)),o.paused=!1,this},Readable.prototype.pause=function(){return L(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(L(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},Readable.prototype.wrap=function(o){var s=this,i=this._readableState,u=!1;for(var _ in o.on(\"end\",(function(){if(L(\"wrapped end\"),i.decoder&&!i.ended){var o=i.decoder.end();o&&o.length&&s.push(o)}s.push(null)})),o.on(\"data\",(function(_){(L(\"wrapped data\"),i.decoder&&(_=i.decoder.write(_)),i.objectMode&&null==_)||(i.objectMode||_&&_.length)&&(s.push(_)||(u=!0,o.pause()))})),o)void 0===this[_]&&\"function\"==typeof o[_]&&(this[_]=function methodWrap(s){return function methodWrapReturnFunction(){return o[s].apply(o,arguments)}}(_));for(var w=0;w<de.length;w++)o.on(de[w],this.emit.bind(this,de[w]));return this._read=function(s){L(\"wrapped _read\",s),u&&(u=!1,o.resume())},this},\"function\"==typeof Symbol&&(Readable.prototype[Symbol.asyncIterator]=function(){return void 0===V&&(V=i(2955)),V(this)}),Object.defineProperty(Readable.prototype,\"readableHighWaterMark\",{enumerable:!1,get:function get(){return this._readableState.highWaterMark}}),Object.defineProperty(Readable.prototype,\"readableBuffer\",{enumerable:!1,get:function get(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Readable.prototype,\"readableFlowing\",{enumerable:!1,get:function get(){return this._readableState.flowing},set:function set(o){this._readableState&&(this._readableState.flowing=o)}}),Readable._fromList=fromList,Object.defineProperty(Readable.prototype,\"readableLength\",{enumerable:!1,get:function get(){return this._readableState.length}}),\"function\"==typeof Symbol&&(Readable.from=function(o,s){return void 0===U&&(U=i(55157)),U(Readable,o,s)})},74610:(o,s,i)=>{\"use strict\";o.exports=Transform;var u=i(86048).F,_=u.ERR_METHOD_NOT_IMPLEMENTED,w=u.ERR_MULTIPLE_CALLBACK,x=u.ERR_TRANSFORM_ALREADY_TRANSFORMING,C=u.ERR_TRANSFORM_WITH_LENGTH_0,j=i(25382);function afterTransform(o,s){var i=this._transformState;i.transforming=!1;var u=i.writecb;if(null===u)return this.emit(\"error\",new w);i.writechunk=null,i.writecb=null,null!=s&&this.push(s),u(o);var _=this._readableState;_.reading=!1,(_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}function Transform(o){if(!(this instanceof Transform))return new Transform(o);j.call(this,o),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,o&&(\"function\"==typeof o.transform&&(this._transform=o.transform),\"function\"==typeof o.flush&&(this._flush=o.flush)),this.on(\"prefinish\",prefinish)}function prefinish(){var o=this;\"function\"!=typeof this._flush||this._readableState.destroyed?done(this,null,null):this._flush((function(s,i){done(o,s,i)}))}function done(o,s,i){if(s)return o.emit(\"error\",s);if(null!=i&&o.push(i),o._writableState.length)throw new C;if(o._transformState.transforming)throw new x;return o.push(null)}i(56698)(Transform,j),Transform.prototype.push=function(o,s){return this._transformState.needTransform=!1,j.prototype.push.call(this,o,s)},Transform.prototype._transform=function(o,s,i){i(new _(\"_transform()\"))},Transform.prototype._write=function(o,s,i){var u=this._transformState;if(u.writecb=i,u.writechunk=o,u.writeencoding=s,!u.transforming){var _=this._readableState;(u.needTransform||_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}},Transform.prototype._read=function(o){var s=this._transformState;null===s.writechunk||s.transforming?s.needTransform=!0:(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform))},Transform.prototype._destroy=function(o,s){j.prototype._destroy.call(this,o,(function(o){s(o)}))}},16708:(o,s,i)=>{\"use strict\";var u,_=i(65606);function CorkedRequest(o){var s=this;this.next=null,this.entry=null,this.finish=function(){!function onCorkedFinish(o,s,i){var u=o.entry;o.entry=null;for(;u;){var _=u.callback;s.pendingcb--,_(i),u=u.next}s.corkedRequestsFree.next=o}(s,o)}}o.exports=Writable,Writable.WritableState=WritableState;var w={deprecate:i(94643)},x=i(40345),C=i(48287).Buffer,j=(void 0!==i.g?i.g:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var L,B=i(75896),$=i(65291).getHighWaterMark,V=i(86048).F,U=V.ERR_INVALID_ARG_TYPE,z=V.ERR_METHOD_NOT_IMPLEMENTED,Y=V.ERR_MULTIPLE_CALLBACK,Z=V.ERR_STREAM_CANNOT_PIPE,ee=V.ERR_STREAM_DESTROYED,ie=V.ERR_STREAM_NULL_VALUES,ae=V.ERR_STREAM_WRITE_AFTER_END,ce=V.ERR_UNKNOWN_ENCODING,le=B.errorOrDestroy;function nop(){}function WritableState(o,s,w){u=u||i(25382),o=o||{},\"boolean\"!=typeof w&&(w=s instanceof u),this.objectMode=!!o.objectMode,w&&(this.objectMode=this.objectMode||!!o.writableObjectMode),this.highWaterMark=$(this,o,\"writableHighWaterMark\",w),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var x=!1===o.decodeStrings;this.decodeStrings=!x,this.defaultEncoding=o.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){!function onwrite(o,s){var i=o._writableState,u=i.sync,w=i.writecb;if(\"function\"!=typeof w)throw new Y;if(function onwriteStateUpdate(o){o.writing=!1,o.writecb=null,o.length-=o.writelen,o.writelen=0}(i),s)!function onwriteError(o,s,i,u,w){--s.pendingcb,i?(_.nextTick(w,u),_.nextTick(finishMaybe,o,s),o._writableState.errorEmitted=!0,le(o,u)):(w(u),o._writableState.errorEmitted=!0,le(o,u),finishMaybe(o,s))}(o,i,u,s,w);else{var x=needFinish(i)||o.destroyed;x||i.corked||i.bufferProcessing||!i.bufferedRequest||clearBuffer(o,i),u?_.nextTick(afterWrite,o,i,x,w):afterWrite(o,i,x,w)}}(s,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==o.emitClose,this.autoDestroy=!!o.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(o){var s=this instanceof(u=u||i(25382));if(!s&&!L.call(Writable,this))return new Writable(o);this._writableState=new WritableState(o,this,s),this.writable=!0,o&&(\"function\"==typeof o.write&&(this._write=o.write),\"function\"==typeof o.writev&&(this._writev=o.writev),\"function\"==typeof o.destroy&&(this._destroy=o.destroy),\"function\"==typeof o.final&&(this._final=o.final)),x.call(this)}function doWrite(o,s,i,u,_,w,x){s.writelen=u,s.writecb=x,s.writing=!0,s.sync=!0,s.destroyed?s.onwrite(new ee(\"write\")):i?o._writev(_,s.onwrite):o._write(_,w,s.onwrite),s.sync=!1}function afterWrite(o,s,i,u){i||function onwriteDrain(o,s){0===s.length&&s.needDrain&&(s.needDrain=!1,o.emit(\"drain\"))}(o,s),s.pendingcb--,u(),finishMaybe(o,s)}function clearBuffer(o,s){s.bufferProcessing=!0;var i=s.bufferedRequest;if(o._writev&&i&&i.next){var u=s.bufferedRequestCount,_=new Array(u),w=s.corkedRequestsFree;w.entry=i;for(var x=0,C=!0;i;)_[x]=i,i.isBuf||(C=!1),i=i.next,x+=1;_.allBuffers=C,doWrite(o,s,!0,s.length,_,\"\",w.finish),s.pendingcb++,s.lastBufferedRequest=null,w.next?(s.corkedRequestsFree=w.next,w.next=null):s.corkedRequestsFree=new CorkedRequest(s),s.bufferedRequestCount=0}else{for(;i;){var j=i.chunk,L=i.encoding,B=i.callback;if(doWrite(o,s,!1,s.objectMode?1:j.length,j,L,B),i=i.next,s.bufferedRequestCount--,s.writing)break}null===i&&(s.lastBufferedRequest=null)}s.bufferedRequest=i,s.bufferProcessing=!1}function needFinish(o){return o.ending&&0===o.length&&null===o.bufferedRequest&&!o.finished&&!o.writing}function callFinal(o,s){o._final((function(i){s.pendingcb--,i&&le(o,i),s.prefinished=!0,o.emit(\"prefinish\"),finishMaybe(o,s)}))}function finishMaybe(o,s){var i=needFinish(s);if(i&&(function prefinish(o,s){s.prefinished||s.finalCalled||(\"function\"!=typeof o._final||s.destroyed?(s.prefinished=!0,o.emit(\"prefinish\")):(s.pendingcb++,s.finalCalled=!0,_.nextTick(callFinal,o,s)))}(o,s),0===s.pendingcb&&(s.finished=!0,o.emit(\"finish\"),s.autoDestroy))){var u=o._readableState;(!u||u.autoDestroy&&u.endEmitted)&&o.destroy()}return i}i(56698)(Writable,x),WritableState.prototype.getBuffer=function getBuffer(){for(var o=this.bufferedRequest,s=[];o;)s.push(o),o=o.next;return s},function(){try{Object.defineProperty(WritableState.prototype,\"buffer\",{get:w.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch(o){}}(),\"function\"==typeof Symbol&&Symbol.hasInstance&&\"function\"==typeof Function.prototype[Symbol.hasInstance]?(L=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(o){return!!L.call(this,o)||this===Writable&&(o&&o._writableState instanceof WritableState)}})):L=function realHasInstance(o){return o instanceof this},Writable.prototype.pipe=function(){le(this,new Z)},Writable.prototype.write=function(o,s,i){var u=this._writableState,w=!1,x=!u.objectMode&&function _isUint8Array(o){return C.isBuffer(o)||o instanceof j}(o);return x&&!C.isBuffer(o)&&(o=function _uint8ArrayToBuffer(o){return C.from(o)}(o)),\"function\"==typeof s&&(i=s,s=null),x?s=\"buffer\":s||(s=u.defaultEncoding),\"function\"!=typeof i&&(i=nop),u.ending?function writeAfterEnd(o,s){var i=new ae;le(o,i),_.nextTick(s,i)}(this,i):(x||function validChunk(o,s,i,u){var w;return null===i?w=new ie:\"string\"==typeof i||s.objectMode||(w=new U(\"chunk\",[\"string\",\"Buffer\"],i)),!w||(le(o,w),_.nextTick(u,w),!1)}(this,u,o,i))&&(u.pendingcb++,w=function writeOrBuffer(o,s,i,u,_,w){if(!i){var x=function decodeChunk(o,s,i){o.objectMode||!1===o.decodeStrings||\"string\"!=typeof s||(s=C.from(s,i));return s}(s,u,_);u!==x&&(i=!0,_=\"buffer\",u=x)}var j=s.objectMode?1:u.length;s.length+=j;var L=s.length<s.highWaterMark;L||(s.needDrain=!0);if(s.writing||s.corked){var B=s.lastBufferedRequest;s.lastBufferedRequest={chunk:u,encoding:_,isBuf:i,callback:w,next:null},B?B.next=s.lastBufferedRequest:s.bufferedRequest=s.lastBufferedRequest,s.bufferedRequestCount+=1}else doWrite(o,s,!1,j,u,_,w);return L}(this,u,x,o,s,i)),w},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var o=this._writableState;o.corked&&(o.corked--,o.writing||o.corked||o.bufferProcessing||!o.bufferedRequest||clearBuffer(this,o))},Writable.prototype.setDefaultEncoding=function setDefaultEncoding(o){if(\"string\"==typeof o&&(o=o.toLowerCase()),!([\"hex\",\"utf8\",\"utf-8\",\"ascii\",\"binary\",\"base64\",\"ucs2\",\"ucs-2\",\"utf16le\",\"utf-16le\",\"raw\"].indexOf((o+\"\").toLowerCase())>-1))throw new ce(o);return this._writableState.defaultEncoding=o,this},Object.defineProperty(Writable.prototype,\"writableBuffer\",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Writable.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(o,s,i){i(new z(\"_write()\"))},Writable.prototype._writev=null,Writable.prototype.end=function(o,s,i){var u=this._writableState;return\"function\"==typeof o?(i=o,o=null,s=null):\"function\"==typeof s&&(i=s,s=null),null!=o&&this.write(o,s),u.corked&&(u.corked=1,this.uncork()),u.ending||function endWritable(o,s,i){s.ending=!0,finishMaybe(o,s),i&&(s.finished?_.nextTick(i):o.once(\"finish\",i));s.ended=!0,o.writable=!1}(this,u,i),this},Object.defineProperty(Writable.prototype,\"writableLength\",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Writable.prototype,\"destroyed\",{enumerable:!1,get:function get(){return void 0!==this._writableState&&this._writableState.destroyed},set:function set(o){this._writableState&&(this._writableState.destroyed=o)}}),Writable.prototype.destroy=B.destroy,Writable.prototype._undestroy=B.undestroy,Writable.prototype._destroy=function(o,s){s(o)}},2955:(o,s,i)=>{\"use strict\";var u,_=i(65606);function _defineProperty(o,s,i){return(s=function _toPropertyKey(o){var s=function _toPrimitive(o,s){if(\"object\"!=typeof o||null===o)return o;var i=o[Symbol.toPrimitive];if(void 0!==i){var u=i.call(o,s||\"default\");if(\"object\"!=typeof u)return u;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===s?String:Number)(o)}(o,\"string\");return\"symbol\"==typeof s?s:String(s)}(s))in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}var w=i(86238),x=Symbol(\"lastResolve\"),C=Symbol(\"lastReject\"),j=Symbol(\"error\"),L=Symbol(\"ended\"),B=Symbol(\"lastPromise\"),$=Symbol(\"handlePromise\"),V=Symbol(\"stream\");function createIterResult(o,s){return{value:o,done:s}}function readAndResolve(o){var s=o[x];if(null!==s){var i=o[V].read();null!==i&&(o[B]=null,o[x]=null,o[C]=null,s(createIterResult(i,!1)))}}function onReadable(o){_.nextTick(readAndResolve,o)}var U=Object.getPrototypeOf((function(){})),z=Object.setPrototypeOf((_defineProperty(u={get stream(){return this[V]},next:function next(){var o=this,s=this[j];if(null!==s)return Promise.reject(s);if(this[L])return Promise.resolve(createIterResult(void 0,!0));if(this[V].destroyed)return new Promise((function(s,i){_.nextTick((function(){o[j]?i(o[j]):s(createIterResult(void 0,!0))}))}));var i,u=this[B];if(u)i=new Promise(function wrapForNext(o,s){return function(i,u){o.then((function(){s[L]?i(createIterResult(void 0,!0)):s[$](i,u)}),u)}}(u,this));else{var w=this[V].read();if(null!==w)return Promise.resolve(createIterResult(w,!1));i=new Promise(this[$])}return this[B]=i,i}},Symbol.asyncIterator,(function(){return this})),_defineProperty(u,\"return\",(function _return(){var o=this;return new Promise((function(s,i){o[V].destroy(null,(function(o){o?i(o):s(createIterResult(void 0,!0))}))}))})),u),U);o.exports=function createReadableStreamAsyncIterator(o){var s,i=Object.create(z,(_defineProperty(s={},V,{value:o,writable:!0}),_defineProperty(s,x,{value:null,writable:!0}),_defineProperty(s,C,{value:null,writable:!0}),_defineProperty(s,j,{value:null,writable:!0}),_defineProperty(s,L,{value:o._readableState.endEmitted,writable:!0}),_defineProperty(s,$,{value:function value(o,s){var u=i[V].read();u?(i[B]=null,i[x]=null,i[C]=null,o(createIterResult(u,!1))):(i[x]=o,i[C]=s)},writable:!0}),s));return i[B]=null,w(o,(function(o){if(o&&\"ERR_STREAM_PREMATURE_CLOSE\"!==o.code){var s=i[C];return null!==s&&(i[B]=null,i[x]=null,i[C]=null,s(o)),void(i[j]=o)}var u=i[x];null!==u&&(i[B]=null,i[x]=null,i[C]=null,u(createIterResult(void 0,!0))),i[L]=!0})),o.on(\"readable\",onReadable.bind(null,i)),i}},80345:(o,s,i)=>{\"use strict\";function ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(Object(i),!0).forEach((function(s){_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}function _defineProperty(o,s,i){return(s=_toPropertyKey(s))in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}function _defineProperties(o,s){for(var i=0;i<s.length;i++){var u=s[i];u.enumerable=u.enumerable||!1,u.configurable=!0,\"value\"in u&&(u.writable=!0),Object.defineProperty(o,_toPropertyKey(u.key),u)}}function _toPropertyKey(o){var s=function _toPrimitive(o,s){if(\"object\"!=typeof o||null===o)return o;var i=o[Symbol.toPrimitive];if(void 0!==i){var u=i.call(o,s||\"default\");if(\"object\"!=typeof u)return u;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===s?String:Number)(o)}(o,\"string\");return\"symbol\"==typeof s?s:String(s)}var u=i(48287).Buffer,_=i(15340).inspect,w=_&&_.custom||\"inspect\";o.exports=function(){function BufferList(){!function _classCallCheck(o,s){if(!(o instanceof s))throw new TypeError(\"Cannot call a class as a function\")}(this,BufferList),this.head=null,this.tail=null,this.length=0}return function _createClass(o,s,i){return s&&_defineProperties(o.prototype,s),i&&_defineProperties(o,i),Object.defineProperty(o,\"prototype\",{writable:!1}),o}(BufferList,[{key:\"push\",value:function push(o){var s={data:o,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length}},{key:\"unshift\",value:function unshift(o){var s={data:o,next:this.head};0===this.length&&(this.tail=s),this.head=s,++this.length}},{key:\"shift\",value:function shift(){if(0!==this.length){var o=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,o}}},{key:\"clear\",value:function clear(){this.head=this.tail=null,this.length=0}},{key:\"join\",value:function join(o){if(0===this.length)return\"\";for(var s=this.head,i=\"\"+s.data;s=s.next;)i+=o+s.data;return i}},{key:\"concat\",value:function concat(o){if(0===this.length)return u.alloc(0);for(var s,i,_,w=u.allocUnsafe(o>>>0),x=this.head,C=0;x;)s=x.data,i=w,_=C,u.prototype.copy.call(s,i,_),C+=x.data.length,x=x.next;return w}},{key:\"consume\",value:function consume(o,s){var i;return o<this.head.data.length?(i=this.head.data.slice(0,o),this.head.data=this.head.data.slice(o)):i=o===this.head.data.length?this.shift():s?this._getString(o):this._getBuffer(o),i}},{key:\"first\",value:function first(){return this.head.data}},{key:\"_getString\",value:function _getString(o){var s=this.head,i=1,u=s.data;for(o-=u.length;s=s.next;){var _=s.data,w=o>_.length?_.length:o;if(w===_.length?u+=_:u+=_.slice(0,o),0===(o-=w)){w===_.length?(++i,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=_.slice(w));break}++i}return this.length-=i,u}},{key:\"_getBuffer\",value:function _getBuffer(o){var s=u.allocUnsafe(o),i=this.head,_=1;for(i.data.copy(s),o-=i.data.length;i=i.next;){var w=i.data,x=o>w.length?w.length:o;if(w.copy(s,s.length-o,0,x),0===(o-=x)){x===w.length?(++_,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=w.slice(x));break}++_}return this.length-=_,s}},{key:w,value:function value(o,s){return _(this,_objectSpread(_objectSpread({},s),{},{depth:0,customInspect:!1}))}}]),BufferList}()},75896:(o,s,i)=>{\"use strict\";var u=i(65606);function emitErrorAndCloseNT(o,s){emitErrorNT(o,s),emitCloseNT(o)}function emitCloseNT(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit(\"close\")}function emitErrorNT(o,s){o.emit(\"error\",s)}o.exports={destroy:function destroy(o,s){var i=this,_=this._readableState&&this._readableState.destroyed,w=this._writableState&&this._writableState.destroyed;return _||w?(s?s(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u.nextTick(emitErrorNT,this,o)):u.nextTick(emitErrorNT,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,(function(o){!s&&o?i._writableState?i._writableState.errorEmitted?u.nextTick(emitCloseNT,i):(i._writableState.errorEmitted=!0,u.nextTick(emitErrorAndCloseNT,i,o)):u.nextTick(emitErrorAndCloseNT,i,o):s?(u.nextTick(emitCloseNT,i),s(o)):u.nextTick(emitCloseNT,i)})),this)},undestroy:function undestroy(){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)},errorOrDestroy:function errorOrDestroy(o,s){var i=o._readableState,u=o._writableState;i&&i.autoDestroy||u&&u.autoDestroy?o.destroy(s):o.emit(\"error\",s)}}},86238:(o,s,i)=>{\"use strict\";var u=i(86048).F.ERR_STREAM_PREMATURE_CLOSE;function noop(){}o.exports=function eos(o,s,i){if(\"function\"==typeof s)return eos(o,null,s);s||(s={}),i=function once(o){var s=!1;return function(){if(!s){s=!0;for(var i=arguments.length,u=new Array(i),_=0;_<i;_++)u[_]=arguments[_];o.apply(this,u)}}}(i||noop);var _=s.readable||!1!==s.readable&&o.readable,w=s.writable||!1!==s.writable&&o.writable,x=function onlegacyfinish(){o.writable||j()},C=o._writableState&&o._writableState.finished,j=function onfinish(){w=!1,C=!0,_||i.call(o)},L=o._readableState&&o._readableState.endEmitted,B=function onend(){_=!1,L=!0,w||i.call(o)},$=function onerror(s){i.call(o,s)},V=function onclose(){var s;return _&&!L?(o._readableState&&o._readableState.ended||(s=new u),i.call(o,s)):w&&!C?(o._writableState&&o._writableState.ended||(s=new u),i.call(o,s)):void 0},U=function onrequest(){o.req.on(\"finish\",j)};return!function isRequest(o){return o.setHeader&&\"function\"==typeof o.abort}(o)?w&&!o._writableState&&(o.on(\"end\",x),o.on(\"close\",x)):(o.on(\"complete\",j),o.on(\"abort\",V),o.req?U():o.on(\"request\",U)),o.on(\"end\",B),o.on(\"finish\",j),!1!==s.error&&o.on(\"error\",$),o.on(\"close\",V),function(){o.removeListener(\"complete\",j),o.removeListener(\"abort\",V),o.removeListener(\"request\",U),o.req&&o.req.removeListener(\"finish\",j),o.removeListener(\"end\",x),o.removeListener(\"close\",x),o.removeListener(\"finish\",j),o.removeListener(\"end\",B),o.removeListener(\"error\",$),o.removeListener(\"close\",V)}}},55157:o=>{o.exports=function(){throw new Error(\"Readable.from is not available in the browser\")}},57758:(o,s,i)=>{\"use strict\";var u;var _=i(86048).F,w=_.ERR_MISSING_ARGS,x=_.ERR_STREAM_DESTROYED;function noop(o){if(o)throw o}function call(o){o()}function pipe(o,s){return o.pipe(s)}o.exports=function pipeline(){for(var o=arguments.length,s=new Array(o),_=0;_<o;_++)s[_]=arguments[_];var C,j=function popCallback(o){return o.length?\"function\"!=typeof o[o.length-1]?noop:o.pop():noop}(s);if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new w(\"streams\");var L=s.map((function(o,_){var w=_<s.length-1;return function destroyer(o,s,_,w){w=function once(o){var s=!1;return function(){s||(s=!0,o.apply(void 0,arguments))}}(w);var C=!1;o.on(\"close\",(function(){C=!0})),void 0===u&&(u=i(86238)),u(o,{readable:s,writable:_},(function(o){if(o)return w(o);C=!0,w()}));var j=!1;return function(s){if(!C&&!j)return j=!0,function isRequest(o){return o.setHeader&&\"function\"==typeof o.abort}(o)?o.abort():\"function\"==typeof o.destroy?o.destroy():void w(s||new x(\"pipe\"))}}(o,w,_>0,(function(o){C||(C=o),o&&L.forEach(call),w||(L.forEach(call),j(C))}))}));return s.reduce(pipe)}},65291:(o,s,i)=>{\"use strict\";var u=i(86048).F.ERR_INVALID_OPT_VALUE;o.exports={getHighWaterMark:function getHighWaterMark(o,s,i,_){var w=function highWaterMarkFrom(o,s,i){return null!=o.highWaterMark?o.highWaterMark:s?o[i]:null}(s,_,i);if(null!=w){if(!isFinite(w)||Math.floor(w)!==w||w<0)throw new u(_?i:\"highWaterMark\",w);return Math.floor(w)}return o.objectMode?16:16384}}},40345:(o,s,i)=>{o.exports=i(37007).EventEmitter},84977:(o,s,i)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0});var u=function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}(i(9404)),_=i(55674);s.default=function(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.Map,i=Object.keys(o);return function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s(),w=arguments[1];return u.withMutations((function(s){i.forEach((function(i){var u=(0,o[i])(s.get(i),w);(0,_.validateNextState)(u,i,w),s.set(i,u)}))}))}},o.exports=s.default},89593:(o,s,i)=>{\"use strict\";s.H=void 0;var u=function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}(i(84977));s.H=u.default},48590:(o,s)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0}),s.default=function(o){return o&&\"@@redux/INIT\"===o.type?\"initialState argument passed to createStore\":\"previous state received by the reducer\"},o.exports=s.default},82261:(o,s,i)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0});var u=_interopRequireDefault(i(9404)),_=_interopRequireDefault(i(48590));function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}s.default=function(o,s,i){var w=Object.keys(s);if(!w.length)return\"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";var x=(0,_.default)(i);if(u.default.isImmutable?!u.default.isImmutable(o):!u.default.Iterable.isIterable(o))return\"The \"+x+' is of unexpected type. Expected argument to be an instance of Immutable.Collection or Immutable.Record with the following properties: \"'+w.join('\", \"')+'\".';var C=o.toSeq().keySeq().toArray().filter((function(o){return!s.hasOwnProperty(o)}));return C.length>0?\"Unexpected \"+(1===C.length?\"property\":\"properties\")+' \"'+C.join('\", \"')+'\" found in '+x+'. Expected to find one of the known reducer property names instead: \"'+w.join('\", \"')+'\". Unexpected properties will be ignored.':null},o.exports=s.default},55674:(o,s,i)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0}),s.validateNextState=s.getUnexpectedInvocationParameterMessage=s.getStateName=void 0;var u=_interopRequireDefault(i(48590)),_=_interopRequireDefault(i(82261)),w=_interopRequireDefault(i(27374));function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}s.getStateName=u.default,s.getUnexpectedInvocationParameterMessage=_.default,s.validateNextState=w.default},27374:(o,s)=>{\"use strict\";Object.defineProperty(s,\"__esModule\",{value:!0}),s.default=function(o,s,i){if(void 0===o)throw new Error('Reducer \"'+s+'\" returned undefined when handling \"'+i.type+'\" action. To ignore an action, you must explicitly return the previous state.')},o.exports=s.default},75208:o=>{\"use strict\";var s,i=\"\";o.exports=function repeat(o,u){if(\"string\"!=typeof o)throw new TypeError(\"expected a string\");if(1===u)return o;if(2===u)return o+o;var _=o.length*u;if(s!==o||void 0===s)s=o,i=\"\";else if(i.length>=_)return i.substr(0,_);for(;_>i.length&&u>1;)1&u&&(i+=o),u>>=1,o+=o;return i=(i+=o).substr(0,_)}},92063:o=>{\"use strict\";o.exports=function required(o,s){if(s=s.split(\":\")[0],!(o=+o))return!1;switch(s){case\"http\":case\"ws\":return 80!==o;case\"https\":case\"wss\":return 443!==o;case\"ftp\":return 21!==o;case\"gopher\":return 70!==o;case\"file\":return!1}return 0!==o}},27096:(o,s,i)=>{const u=i(87586),_=i(6205),w=i(10023),x=i(8048);o.exports=o=>{var s,i,C=0,j={type:_.ROOT,stack:[]},L=j,B=j.stack,$=[],repeatErr=s=>{u.error(o,\"Nothing to repeat at column \"+(s-1))},V=u.strToChars(o);for(s=V.length;C<s;)switch(i=V[C++]){case\"\\\\\":switch(i=V[C++]){case\"b\":B.push(x.wordBoundary());break;case\"B\":B.push(x.nonWordBoundary());break;case\"w\":B.push(w.words());break;case\"W\":B.push(w.notWords());break;case\"d\":B.push(w.ints());break;case\"D\":B.push(w.notInts());break;case\"s\":B.push(w.whitespace());break;case\"S\":B.push(w.notWhitespace());break;default:/\\d/.test(i)?B.push({type:_.REFERENCE,value:parseInt(i,10)}):B.push({type:_.CHAR,value:i.charCodeAt(0)})}break;case\"^\":B.push(x.begin());break;case\"$\":B.push(x.end());break;case\"[\":var U;\"^\"===V[C]?(U=!0,C++):U=!1;var z=u.tokenizeClass(V.slice(C),o);C+=z[1],B.push({type:_.SET,set:z[0],not:U});break;case\".\":B.push(w.anyChar());break;case\"(\":var Y={type:_.GROUP,stack:[],remember:!0};\"?\"===(i=V[C])&&(i=V[C+1],C+=2,\"=\"===i?Y.followedBy=!0:\"!\"===i?Y.notFollowedBy=!0:\":\"!==i&&u.error(o,`Invalid group, character '${i}' after '?' at column `+(C-1)),Y.remember=!1),B.push(Y),$.push(L),L=Y,B=Y.stack;break;case\")\":0===$.length&&u.error(o,\"Unmatched ) at column \"+(C-1)),B=(L=$.pop()).options?L.options[L.options.length-1]:L.stack;break;case\"|\":L.options||(L.options=[L.stack],delete L.stack);var Z=[];L.options.push(Z),B=Z;break;case\"{\":var ee,ie,ae=/^(\\d+)(,(\\d+)?)?\\}/.exec(V.slice(C));null!==ae?(0===B.length&&repeatErr(C),ee=parseInt(ae[1],10),ie=ae[2]?ae[3]?parseInt(ae[3],10):1/0:ee,C+=ae[0].length,B.push({type:_.REPETITION,min:ee,max:ie,value:B.pop()})):B.push({type:_.CHAR,value:123});break;case\"?\":0===B.length&&repeatErr(C),B.push({type:_.REPETITION,min:0,max:1,value:B.pop()});break;case\"+\":0===B.length&&repeatErr(C),B.push({type:_.REPETITION,min:1,max:1/0,value:B.pop()});break;case\"*\":0===B.length&&repeatErr(C),B.push({type:_.REPETITION,min:0,max:1/0,value:B.pop()});break;default:B.push({type:_.CHAR,value:i.charCodeAt(0)})}return 0!==$.length&&u.error(o,\"Unterminated group\"),j},o.exports.types=_},8048:(o,s,i)=>{const u=i(6205);s.wordBoundary=()=>({type:u.POSITION,value:\"b\"}),s.nonWordBoundary=()=>({type:u.POSITION,value:\"B\"}),s.begin=()=>({type:u.POSITION,value:\"^\"}),s.end=()=>({type:u.POSITION,value:\"$\"})},10023:(o,s,i)=>{const u=i(6205),INTS=()=>[{type:u.RANGE,from:48,to:57}],WORDS=()=>[{type:u.CHAR,value:95},{type:u.RANGE,from:97,to:122},{type:u.RANGE,from:65,to:90}].concat(INTS()),WHITESPACE=()=>[{type:u.CHAR,value:9},{type:u.CHAR,value:10},{type:u.CHAR,value:11},{type:u.CHAR,value:12},{type:u.CHAR,value:13},{type:u.CHAR,value:32},{type:u.CHAR,value:160},{type:u.CHAR,value:5760},{type:u.RANGE,from:8192,to:8202},{type:u.CHAR,value:8232},{type:u.CHAR,value:8233},{type:u.CHAR,value:8239},{type:u.CHAR,value:8287},{type:u.CHAR,value:12288},{type:u.CHAR,value:65279}];s.words=()=>({type:u.SET,set:WORDS(),not:!1}),s.notWords=()=>({type:u.SET,set:WORDS(),not:!0}),s.ints=()=>({type:u.SET,set:INTS(),not:!1}),s.notInts=()=>({type:u.SET,set:INTS(),not:!0}),s.whitespace=()=>({type:u.SET,set:WHITESPACE(),not:!1}),s.notWhitespace=()=>({type:u.SET,set:WHITESPACE(),not:!0}),s.anyChar=()=>({type:u.SET,set:[{type:u.CHAR,value:10},{type:u.CHAR,value:13},{type:u.CHAR,value:8232},{type:u.CHAR,value:8233}],not:!0})},6205:o=>{o.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}},87586:(o,s,i)=>{const u=i(6205),_=i(10023),w={0:0,t:9,n:10,v:11,f:12,r:13};s.strToChars=function(o){return o=o.replace(/(\\[\\\\b\\])|(\\\\)?\\\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\\\\]^?])|([0tnvfr]))/g,(function(o,s,i,u,_,x,C,j){if(i)return o;var L=s?8:u?parseInt(u,16):_?parseInt(_,16):x?parseInt(x,8):C?\"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^ ?\".indexOf(C):w[j],B=String.fromCharCode(L);return/[[\\]{}^$.|?*+()]/.test(B)&&(B=\"\\\\\"+B),B}))},s.tokenizeClass=(o,i)=>{for(var w,x,C=[],j=/\\\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\\\)(.)|([^\\]\\\\]))-(?:\\\\)?([^\\]]))|(\\])|(?:\\\\)?([^])/g;null!=(w=j.exec(o));)if(w[1])C.push(_.words());else if(w[2])C.push(_.ints());else if(w[3])C.push(_.whitespace());else if(w[4])C.push(_.notWords());else if(w[5])C.push(_.notInts());else if(w[6])C.push(_.notWhitespace());else if(w[7])C.push({type:u.RANGE,from:(w[8]||w[9]).charCodeAt(0),to:w[10].charCodeAt(0)});else{if(!(x=w[12]))return[C,j.lastIndex];C.push({type:u.CHAR,value:x.charCodeAt(0)})}s.error(i,\"Unterminated character class\")},s.error=(o,s)=>{throw new SyntaxError(\"Invalid regular expression: /\"+o+\"/: \"+s)}},92861:(o,s,i)=>{var u=i(48287),_=u.Buffer;function copyProps(o,s){for(var i in o)s[i]=o[i]}function SafeBuffer(o,s,i){return _(o,s,i)}_.from&&_.alloc&&_.allocUnsafe&&_.allocUnsafeSlow?o.exports=u:(copyProps(u,s),s.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(_.prototype),copyProps(_,SafeBuffer),SafeBuffer.from=function(o,s,i){if(\"number\"==typeof o)throw new TypeError(\"Argument must not be a number\");return _(o,s,i)},SafeBuffer.alloc=function(o,s,i){if(\"number\"!=typeof o)throw new TypeError(\"Argument must be a number\");var u=_(o);return void 0!==s?\"string\"==typeof i?u.fill(s,i):u.fill(s):u.fill(0),u},SafeBuffer.allocUnsafe=function(o){if(\"number\"!=typeof o)throw new TypeError(\"Argument must be a number\");return _(o)},SafeBuffer.allocUnsafeSlow=function(o){if(\"number\"!=typeof o)throw new TypeError(\"Argument must be a number\");return u.SlowBuffer(o)}},29844:(o,s)=>{\"use strict\";function f(o,s){var i=o.length;o.push(s);e:for(;0<i;){var u=i-1>>>1,_=o[u];if(!(0<g(_,s)))break e;o[u]=s,o[i]=_,i=u}}function h(o){return 0===o.length?null:o[0]}function k(o){if(0===o.length)return null;var s=o[0],i=o.pop();if(i!==s){o[0]=i;e:for(var u=0,_=o.length,w=_>>>1;u<w;){var x=2*(u+1)-1,C=o[x],j=x+1,L=o[j];if(0>g(C,i))j<_&&0>g(L,C)?(o[u]=L,o[j]=i,u=j):(o[u]=C,o[x]=i,u=x);else{if(!(j<_&&0>g(L,i)))break e;o[u]=L,o[j]=i,u=j}}}return s}function g(o,s){var i=o.sortIndex-s.sortIndex;return 0!==i?i:o.id-s.id}if(\"object\"==typeof performance&&\"function\"==typeof performance.now){var i=performance;s.unstable_now=function(){return i.now()}}else{var u=Date,_=u.now();s.unstable_now=function(){return u.now()-_}}var w=[],x=[],C=1,j=null,L=3,B=!1,$=!1,V=!1,U=\"function\"==typeof setTimeout?setTimeout:null,z=\"function\"==typeof clearTimeout?clearTimeout:null,Y=\"undefined\"!=typeof setImmediate?setImmediate:null;function G(o){for(var s=h(x);null!==s;){if(null===s.callback)k(x);else{if(!(s.startTime<=o))break;k(x),s.sortIndex=s.expirationTime,f(w,s)}s=h(x)}}function H(o){if(V=!1,G(o),!$)if(null!==h(w))$=!0,I(J);else{var s=h(x);null!==s&&K(H,s.startTime-o)}}function J(o,i){$=!1,V&&(V=!1,z(ae),ae=-1),B=!0;var u=L;try{for(G(i),j=h(w);null!==j&&(!(j.expirationTime>i)||o&&!M());){var _=j.callback;if(\"function\"==typeof _){j.callback=null,L=j.priorityLevel;var C=_(j.expirationTime<=i);i=s.unstable_now(),\"function\"==typeof C?j.callback=C:j===h(w)&&k(w),G(i)}else k(w);j=h(w)}if(null!==j)var U=!0;else{var Y=h(x);null!==Y&&K(H,Y.startTime-i),U=!1}return U}finally{j=null,L=u,B=!1}}\"undefined\"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var Z,ee=!1,ie=null,ae=-1,ce=5,le=-1;function M(){return!(s.unstable_now()-le<ce)}function R(){if(null!==ie){var o=s.unstable_now();le=o;var i=!0;try{i=ie(!0,o)}finally{i?Z():(ee=!1,ie=null)}}else ee=!1}if(\"function\"==typeof Y)Z=function(){Y(R)};else if(\"undefined\"!=typeof MessageChannel){var pe=new MessageChannel,de=pe.port2;pe.port1.onmessage=R,Z=function(){de.postMessage(null)}}else Z=function(){U(R,0)};function I(o){ie=o,ee||(ee=!0,Z())}function K(o,i){ae=U((function(){o(s.unstable_now())}),i)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(o){o.callback=null},s.unstable_continueExecution=function(){$||B||($=!0,I(J))},s.unstable_forceFrameRate=function(o){0>o||125<o?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):ce=0<o?Math.floor(1e3/o):5},s.unstable_getCurrentPriorityLevel=function(){return L},s.unstable_getFirstCallbackNode=function(){return h(w)},s.unstable_next=function(o){switch(L){case 1:case 2:case 3:var s=3;break;default:s=L}var i=L;L=s;try{return o()}finally{L=i}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(o,s){switch(o){case 1:case 2:case 3:case 4:case 5:break;default:o=3}var i=L;L=o;try{return s()}finally{L=i}},s.unstable_scheduleCallback=function(o,i,u){var _=s.unstable_now();switch(\"object\"==typeof u&&null!==u?u=\"number\"==typeof(u=u.delay)&&0<u?_+u:_:u=_,o){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return o={id:C++,callback:i,priorityLevel:o,startTime:u,expirationTime:j=u+j,sortIndex:-1},u>_?(o.sortIndex=u,f(x,o),null===h(w)&&o===h(x)&&(V?(z(ae),ae=-1):V=!0,K(H,u-_))):(o.sortIndex=j,f(w,o),$||B||($=!0,I(J))),o},s.unstable_shouldYield=M,s.unstable_wrapCallback=function(o){var s=L;return function(){var i=L;L=s;try{return o.apply(this,arguments)}finally{L=i}}}},69982:(o,s,i)=>{\"use strict\";o.exports=i(29844)},20334:(o,s,i)=>{\"use strict\";var u=i(48287).Buffer;class NonError extends Error{constructor(o){super(NonError._prepareSuperMessage(o)),Object.defineProperty(this,\"name\",{value:\"NonError\",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,NonError)}static _prepareSuperMessage(o){try{return JSON.stringify(o)}catch{return String(o)}}}const _=[{property:\"name\",enumerable:!1},{property:\"message\",enumerable:!1},{property:\"stack\",enumerable:!1},{property:\"code\",enumerable:!0}],w=Symbol(\".toJSON called\"),destroyCircular=({from:o,seen:s,to_:i,forceEnumerable:x,maxDepth:C,depth:j})=>{const L=i||(Array.isArray(o)?[]:{});if(s.push(o),j>=C)return L;if(\"function\"==typeof o.toJSON&&!0!==o[w])return(o=>{o[w]=!0;const s=o.toJSON();return delete o[w],s})(o);for(const[i,_]of Object.entries(o))\"function\"==typeof u&&u.isBuffer(_)?L[i]=\"[object Buffer]\":\"function\"!=typeof _&&(_&&\"object\"==typeof _?s.includes(o[i])?L[i]=\"[Circular]\":(j++,L[i]=destroyCircular({from:o[i],seen:s.slice(),forceEnumerable:x,maxDepth:C,depth:j})):L[i]=_);for(const{property:s,enumerable:i}of _)\"string\"==typeof o[s]&&Object.defineProperty(L,s,{value:o[s],enumerable:!!x||i,configurable:!0,writable:!0});return L};o.exports={serializeError:(o,s={})=>{const{maxDepth:i=Number.POSITIVE_INFINITY}=s;return\"object\"==typeof o&&null!==o?destroyCircular({from:o,seen:[],forceEnumerable:!0,maxDepth:i,depth:0}):\"function\"==typeof o?`[Function: ${o.name||\"anonymous\"}]`:o},deserializeError:(o,s={})=>{const{maxDepth:i=Number.POSITIVE_INFINITY}=s;if(o instanceof Error)return o;if(\"object\"==typeof o&&null!==o&&!Array.isArray(o)){const s=new Error;return destroyCircular({from:o,seen:[],to_:s,maxDepth:i,depth:0}),s}return new NonError(o)}}},96897:(o,s,i)=>{\"use strict\";var u=i(70453),_=i(30041),w=i(30592)(),x=i(75795),C=i(69675),j=u(\"%Math.floor%\");o.exports=function setFunctionLength(o,s){if(\"function\"!=typeof o)throw new C(\"`fn` is not a function\");if(\"number\"!=typeof s||s<0||s>4294967295||j(s)!==s)throw new C(\"`length` must be a positive 32-bit integer\");var i=arguments.length>2&&!!arguments[2],u=!0,L=!0;if(\"length\"in o&&x){var B=x(o,\"length\");B&&!B.configurable&&(u=!1),B&&!B.writable&&(L=!1)}return(u||L||!i)&&(w?_(o,\"length\",s,!0,!0):_(o,\"length\",s)),o}},90392:(o,s,i)=>{var u=i(92861).Buffer;function Hash(o,s){this._block=u.alloc(o),this._finalSize=s,this._blockSize=o,this._len=0}Hash.prototype.update=function(o,s){\"string\"==typeof o&&(s=s||\"utf8\",o=u.from(o,s));for(var i=this._block,_=this._blockSize,w=o.length,x=this._len,C=0;C<w;){for(var j=x%_,L=Math.min(w-C,_-j),B=0;B<L;B++)i[j+B]=o[C+B];C+=L,(x+=L)%_==0&&this._update(i)}return this._len+=w,this},Hash.prototype.digest=function(o){var s=this._len%this._blockSize;this._block[s]=128,this._block.fill(0,s+1),s>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var u=(4294967295&i)>>>0,_=(i-u)/4294967296;this._block.writeUInt32BE(_,this._blockSize-8),this._block.writeUInt32BE(u,this._blockSize-4)}this._update(this._block);var w=this._hash();return o?w.toString(o):w},Hash.prototype._update=function(){throw new Error(\"_update must be implemented by subclass\")},o.exports=Hash},62802:(o,s,i)=>{var u=o.exports=function SHA(o){o=o.toLowerCase();var s=u[o];if(!s)throw new Error(o+\" is not supported (we accept pull requests)\");return new s};u.sha=i(27816),u.sha1=i(63737),u.sha224=i(26710),u.sha256=i(24107),u.sha384=i(32827),u.sha512=i(82890)},27816:(o,s,i)=>{var u=i(56698),_=i(90392),w=i(92861).Buffer,x=[1518500249,1859775393,-1894007588,-899497514],C=new Array(80);function Sha(){this.init(),this._w=C,_.call(this,64,56)}function rotl30(o){return o<<30|o>>>2}function ft(o,s,i,u){return 0===o?s&i|~s&u:2===o?s&i|s&u|i&u:s^i^u}u(Sha,_),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(o){for(var s,i=this._w,u=0|this._a,_=0|this._b,w=0|this._c,C=0|this._d,j=0|this._e,L=0;L<16;++L)i[L]=o.readInt32BE(4*L);for(;L<80;++L)i[L]=i[L-3]^i[L-8]^i[L-14]^i[L-16];for(var B=0;B<80;++B){var $=~~(B/20),V=0|((s=u)<<5|s>>>27)+ft($,_,w,C)+j+i[B]+x[$];j=C,C=w,w=rotl30(_),_=u,u=V}this._a=u+this._a|0,this._b=_+this._b|0,this._c=w+this._c|0,this._d=C+this._d|0,this._e=j+this._e|0},Sha.prototype._hash=function(){var o=w.allocUnsafe(20);return o.writeInt32BE(0|this._a,0),o.writeInt32BE(0|this._b,4),o.writeInt32BE(0|this._c,8),o.writeInt32BE(0|this._d,12),o.writeInt32BE(0|this._e,16),o},o.exports=Sha},63737:(o,s,i)=>{var u=i(56698),_=i(90392),w=i(92861).Buffer,x=[1518500249,1859775393,-1894007588,-899497514],C=new Array(80);function Sha1(){this.init(),this._w=C,_.call(this,64,56)}function rotl5(o){return o<<5|o>>>27}function rotl30(o){return o<<30|o>>>2}function ft(o,s,i,u){return 0===o?s&i|~s&u:2===o?s&i|s&u|i&u:s^i^u}u(Sha1,_),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(o){for(var s,i=this._w,u=0|this._a,_=0|this._b,w=0|this._c,C=0|this._d,j=0|this._e,L=0;L<16;++L)i[L]=o.readInt32BE(4*L);for(;L<80;++L)i[L]=(s=i[L-3]^i[L-8]^i[L-14]^i[L-16])<<1|s>>>31;for(var B=0;B<80;++B){var $=~~(B/20),V=rotl5(u)+ft($,_,w,C)+j+i[B]+x[$]|0;j=C,C=w,w=rotl30(_),_=u,u=V}this._a=u+this._a|0,this._b=_+this._b|0,this._c=w+this._c|0,this._d=C+this._d|0,this._e=j+this._e|0},Sha1.prototype._hash=function(){var o=w.allocUnsafe(20);return o.writeInt32BE(0|this._a,0),o.writeInt32BE(0|this._b,4),o.writeInt32BE(0|this._c,8),o.writeInt32BE(0|this._d,12),o.writeInt32BE(0|this._e,16),o},o.exports=Sha1},26710:(o,s,i)=>{var u=i(56698),_=i(24107),w=i(90392),x=i(92861).Buffer,C=new Array(64);function Sha224(){this.init(),this._w=C,w.call(this,64,56)}u(Sha224,_),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var o=x.allocUnsafe(28);return o.writeInt32BE(this._a,0),o.writeInt32BE(this._b,4),o.writeInt32BE(this._c,8),o.writeInt32BE(this._d,12),o.writeInt32BE(this._e,16),o.writeInt32BE(this._f,20),o.writeInt32BE(this._g,24),o},o.exports=Sha224},24107:(o,s,i)=>{var u=i(56698),_=i(90392),w=i(92861).Buffer,x=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],C=new Array(64);function Sha256(){this.init(),this._w=C,_.call(this,64,56)}function ch(o,s,i){return i^o&(s^i)}function maj(o,s,i){return o&s|i&(o|s)}function sigma0(o){return(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10)}function sigma1(o){return(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7)}function gamma0(o){return(o>>>7|o<<25)^(o>>>18|o<<14)^o>>>3}u(Sha256,_),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(o){for(var s,i=this._w,u=0|this._a,_=0|this._b,w=0|this._c,C=0|this._d,j=0|this._e,L=0|this._f,B=0|this._g,$=0|this._h,V=0;V<16;++V)i[V]=o.readInt32BE(4*V);for(;V<64;++V)i[V]=0|(((s=i[V-2])>>>17|s<<15)^(s>>>19|s<<13)^s>>>10)+i[V-7]+gamma0(i[V-15])+i[V-16];for(var U=0;U<64;++U){var z=$+sigma1(j)+ch(j,L,B)+x[U]+i[U]|0,Y=sigma0(u)+maj(u,_,w)|0;$=B,B=L,L=j,j=C+z|0,C=w,w=_,_=u,u=z+Y|0}this._a=u+this._a|0,this._b=_+this._b|0,this._c=w+this._c|0,this._d=C+this._d|0,this._e=j+this._e|0,this._f=L+this._f|0,this._g=B+this._g|0,this._h=$+this._h|0},Sha256.prototype._hash=function(){var o=w.allocUnsafe(32);return o.writeInt32BE(this._a,0),o.writeInt32BE(this._b,4),o.writeInt32BE(this._c,8),o.writeInt32BE(this._d,12),o.writeInt32BE(this._e,16),o.writeInt32BE(this._f,20),o.writeInt32BE(this._g,24),o.writeInt32BE(this._h,28),o},o.exports=Sha256},32827:(o,s,i)=>{var u=i(56698),_=i(82890),w=i(90392),x=i(92861).Buffer,C=new Array(160);function Sha384(){this.init(),this._w=C,w.call(this,128,112)}u(Sha384,_),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){var o=x.allocUnsafe(48);function writeInt64BE(s,i,u){o.writeInt32BE(s,u),o.writeInt32BE(i,u+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),o},o.exports=Sha384},82890:(o,s,i)=>{var u=i(56698),_=i(90392),w=i(92861).Buffer,x=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],C=new Array(160);function Sha512(){this.init(),this._w=C,_.call(this,128,112)}function Ch(o,s,i){return i^o&(s^i)}function maj(o,s,i){return o&s|i&(o|s)}function sigma0(o,s){return(o>>>28|s<<4)^(s>>>2|o<<30)^(s>>>7|o<<25)}function sigma1(o,s){return(o>>>14|s<<18)^(o>>>18|s<<14)^(s>>>9|o<<23)}function Gamma0(o,s){return(o>>>1|s<<31)^(o>>>8|s<<24)^o>>>7}function Gamma0l(o,s){return(o>>>1|s<<31)^(o>>>8|s<<24)^(o>>>7|s<<25)}function Gamma1(o,s){return(o>>>19|s<<13)^(s>>>29|o<<3)^o>>>6}function Gamma1l(o,s){return(o>>>19|s<<13)^(s>>>29|o<<3)^(o>>>6|s<<26)}function getCarry(o,s){return o>>>0<s>>>0?1:0}u(Sha512,_),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(o){for(var s=this._w,i=0|this._ah,u=0|this._bh,_=0|this._ch,w=0|this._dh,C=0|this._eh,j=0|this._fh,L=0|this._gh,B=0|this._hh,$=0|this._al,V=0|this._bl,U=0|this._cl,z=0|this._dl,Y=0|this._el,Z=0|this._fl,ee=0|this._gl,ie=0|this._hl,ae=0;ae<32;ae+=2)s[ae]=o.readInt32BE(4*ae),s[ae+1]=o.readInt32BE(4*ae+4);for(;ae<160;ae+=2){var ce=s[ae-30],le=s[ae-30+1],pe=Gamma0(ce,le),de=Gamma0l(le,ce),fe=Gamma1(ce=s[ae-4],le=s[ae-4+1]),ye=Gamma1l(le,ce),be=s[ae-14],_e=s[ae-14+1],we=s[ae-32],Se=s[ae-32+1],xe=de+_e|0,Pe=pe+be+getCarry(xe,de)|0;Pe=(Pe=Pe+fe+getCarry(xe=xe+ye|0,ye)|0)+we+getCarry(xe=xe+Se|0,Se)|0,s[ae]=Pe,s[ae+1]=xe}for(var Te=0;Te<160;Te+=2){Pe=s[Te],xe=s[Te+1];var Re=maj(i,u,_),qe=maj($,V,U),$e=sigma0(i,$),ze=sigma0($,i),We=sigma1(C,Y),He=sigma1(Y,C),Ye=x[Te],Xe=x[Te+1],Qe=Ch(C,j,L),et=Ch(Y,Z,ee),tt=ie+He|0,rt=B+We+getCarry(tt,ie)|0;rt=(rt=(rt=rt+Qe+getCarry(tt=tt+et|0,et)|0)+Ye+getCarry(tt=tt+Xe|0,Xe)|0)+Pe+getCarry(tt=tt+xe|0,xe)|0;var nt=ze+qe|0,ot=$e+Re+getCarry(nt,ze)|0;B=L,ie=ee,L=j,ee=Z,j=C,Z=Y,C=w+rt+getCarry(Y=z+tt|0,z)|0,w=_,z=U,_=u,U=V,u=i,V=$,i=rt+ot+getCarry($=tt+nt|0,tt)|0}this._al=this._al+$|0,this._bl=this._bl+V|0,this._cl=this._cl+U|0,this._dl=this._dl+z|0,this._el=this._el+Y|0,this._fl=this._fl+Z|0,this._gl=this._gl+ee|0,this._hl=this._hl+ie|0,this._ah=this._ah+i+getCarry(this._al,$)|0,this._bh=this._bh+u+getCarry(this._bl,V)|0,this._ch=this._ch+_+getCarry(this._cl,U)|0,this._dh=this._dh+w+getCarry(this._dl,z)|0,this._eh=this._eh+C+getCarry(this._el,Y)|0,this._fh=this._fh+j+getCarry(this._fl,Z)|0,this._gh=this._gh+L+getCarry(this._gl,ee)|0,this._hh=this._hh+B+getCarry(this._hl,ie)|0},Sha512.prototype._hash=function(){var o=w.allocUnsafe(64);function writeInt64BE(s,i,u){o.writeInt32BE(s,u),o.writeInt32BE(i,u+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),o},o.exports=Sha512},8068:o=>{\"use strict\";var s=(()=>{var o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,__defNormalProp=(s,i,u)=>i in s?o(s,i,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[i]=u,__spreadValues=(o,s)=>{for(var i in s||(s={}))_.call(s,i)&&__defNormalProp(o,i,s[i]);if(u)for(var i of u(s))w.call(s,i)&&__defNormalProp(o,i,s[i]);return o},__publicField=(o,s,i)=>(__defNormalProp(o,\"symbol\"!=typeof s?s+\"\":s,i),i),x={};((s,i)=>{for(var u in i)o(s,u,{get:i[u],enumerable:!0})})(x,{DEFAULT_OPTIONS:()=>j,DEFAULT_UUID_LENGTH:()=>C,default:()=>$});var C=6,j={dictionary:\"alphanum\",shuffle:!0,debug:!1,length:C,counter:0},L=class _ShortUniqueId{constructor(o={}){__publicField(this,\"counter\"),__publicField(this,\"debug\"),__publicField(this,\"dict\"),__publicField(this,\"version\"),__publicField(this,\"dictIndex\",0),__publicField(this,\"dictRange\",[]),__publicField(this,\"lowerBound\",0),__publicField(this,\"upperBound\",0),__publicField(this,\"dictLength\",0),__publicField(this,\"uuidLength\"),__publicField(this,\"_digit_first_ascii\",48),__publicField(this,\"_digit_last_ascii\",58),__publicField(this,\"_alpha_lower_first_ascii\",97),__publicField(this,\"_alpha_lower_last_ascii\",123),__publicField(this,\"_hex_last_ascii\",103),__publicField(this,\"_alpha_upper_first_ascii\",65),__publicField(this,\"_alpha_upper_last_ascii\",91),__publicField(this,\"_number_dict_ranges\",{digits:[this._digit_first_ascii,this._digit_last_ascii]}),__publicField(this,\"_alpha_dict_ranges\",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),__publicField(this,\"_alpha_lower_dict_ranges\",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),__publicField(this,\"_alpha_upper_dict_ranges\",{upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),__publicField(this,\"_alphanum_dict_ranges\",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),__publicField(this,\"_alphanum_lower_dict_ranges\",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),__publicField(this,\"_alphanum_upper_dict_ranges\",{digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),__publicField(this,\"_hex_dict_ranges\",{decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]}),__publicField(this,\"_dict_ranges\",{_number_dict_ranges:this._number_dict_ranges,_alpha_dict_ranges:this._alpha_dict_ranges,_alpha_lower_dict_ranges:this._alpha_lower_dict_ranges,_alpha_upper_dict_ranges:this._alpha_upper_dict_ranges,_alphanum_dict_ranges:this._alphanum_dict_ranges,_alphanum_lower_dict_ranges:this._alphanum_lower_dict_ranges,_alphanum_upper_dict_ranges:this._alphanum_upper_dict_ranges,_hex_dict_ranges:this._hex_dict_ranges}),__publicField(this,\"log\",((...o)=>{const s=[...o];if(s[0]=`[short-unique-id] ${o[0]}`,!0===this.debug&&\"undefined\"!=typeof console&&null!==console)return console.log(...s)})),__publicField(this,\"_normalizeDictionary\",((o,s)=>{let i;if(o&&Array.isArray(o)&&o.length>1)i=o;else{let s;i=[],this.dictIndex=s=0;const u=`_${o}_dict_ranges`,_=this._dict_ranges[u];Object.keys(_).forEach((o=>{const u=o;for(this.dictRange=_[u],this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1],this.dictIndex=s=this.lowerBound;this.lowerBound<=this.upperBound?s<this.upperBound:s>this.upperBound;this.dictIndex=this.lowerBound<=this.upperBound?s+=1:s-=1)i.push(String.fromCharCode(this.dictIndex))}))}if(s){const o=.5;i=i.sort((()=>Math.random()-o))}return i})),__publicField(this,\"setDictionary\",((o,s)=>{this.dict=this._normalizeDictionary(o,s),this.dictLength=this.dict.length,this.setCounter(0)})),__publicField(this,\"seq\",(()=>this.sequentialUUID())),__publicField(this,\"sequentialUUID\",(()=>{let o,s,i=\"\";o=this.counter;do{s=o%this.dictLength,o=Math.trunc(o/this.dictLength),i+=this.dict[s]}while(0!==o);return this.counter+=1,i})),__publicField(this,\"rnd\",((o=this.uuidLength||C)=>this.randomUUID(o))),__publicField(this,\"randomUUID\",((o=this.uuidLength||C)=>{let s,i,u;if(null==o||o<1)throw new Error(\"Invalid UUID Length Provided\");for(s=\"\",u=0;u<o;u+=1)i=parseInt((Math.random()*this.dictLength).toFixed(0),10)%this.dictLength,s+=this.dict[i];return s})),__publicField(this,\"fmt\",((o,s)=>this.formattedUUID(o,s))),__publicField(this,\"formattedUUID\",((o,s)=>{const i={$r:this.randomUUID,$s:this.sequentialUUID,$t:this.stamp};return o.replace(/\\$[rs]\\d{0,}|\\$t0|\\$t[1-9]\\d{1,}/g,(o=>{const u=o.slice(0,2),_=parseInt(o.slice(2),10);return\"$s\"===u?i[u]().padStart(_,\"0\"):\"$t\"===u&&s?i[u](_,s):i[u](_)}))})),__publicField(this,\"availableUUIDs\",((o=this.uuidLength)=>parseFloat(Math.pow([...new Set(this.dict)].length,o).toFixed(0)))),__publicField(this,\"approxMaxBeforeCollision\",((o=this.availableUUIDs(this.uuidLength))=>parseFloat(Math.sqrt(Math.PI/2*o).toFixed(20)))),__publicField(this,\"collisionProbability\",((o=this.availableUUIDs(this.uuidLength),s=this.uuidLength)=>parseFloat((this.approxMaxBeforeCollision(o)/this.availableUUIDs(s)).toFixed(20)))),__publicField(this,\"uniqueness\",((o=this.availableUUIDs(this.uuidLength))=>{const s=parseFloat((1-this.approxMaxBeforeCollision(o)/o).toFixed(20));return s>1?1:s<0?0:s})),__publicField(this,\"getVersion\",(()=>this.version)),__publicField(this,\"stamp\",((o,s)=>{const i=Math.floor(+(s||new Date)/1e3).toString(16);if(\"number\"==typeof o&&0===o)return i;if(\"number\"!=typeof o||o<10)throw new Error([\"Param finalLength must be a number greater than or equal to 10,\",\"or 0 if you want the raw hexadecimal timestamp\"].join(\"\\n\"));const u=o-9,_=Math.round(Math.random()*(u>15?15:u)),w=this.randomUUID(u);return`${w.substring(0,_)}${i}${w.substring(_)}${_.toString(16)}`})),__publicField(this,\"parseStamp\",((o,s)=>{if(s&&!/t0|t[1-9]\\d{1,}/.test(s))throw new Error(\"Cannot extract date from a formated UUID with no timestamp in the format\");const i=s?s.replace(/\\$[rs]\\d{0,}|\\$t0|\\$t[1-9]\\d{1,}/g,(o=>{const s={$r:o=>[...Array(o)].map((()=>\"r\")).join(\"\"),$s:o=>[...Array(o)].map((()=>\"s\")).join(\"\"),$t:o=>[...Array(o)].map((()=>\"t\")).join(\"\")},i=o.slice(0,2),u=parseInt(o.slice(2),10);return s[i](u)})).replace(/^(.*?)(t{8,})(.*)$/g,((s,i,u)=>o.substring(i.length,i.length+u.length))):o;if(8===i.length)return new Date(1e3*parseInt(i,16));if(i.length<10)throw new Error(\"Stamp length invalid\");const u=parseInt(i.substring(i.length-1),16);return new Date(1e3*parseInt(i.substring(u,u+8),16))})),__publicField(this,\"setCounter\",(o=>{this.counter=o})),__publicField(this,\"validate\",((o,s)=>{const i=s?this._normalizeDictionary(s):this.dict;return o.split(\"\").every((o=>i.includes(o)))}));const s=__spreadValues(__spreadValues({},j),o);this.counter=0,this.debug=!1,this.dict=[],this.version=\"5.2.0\";const{dictionary:i,shuffle:u,length:_,counter:w}=s;return this.uuidLength=_,this.setDictionary(i,u),this.setCounter(w),this.debug=s.debug,this.log(this.dict),this.log(`Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this),this}};__publicField(L,\"default\",L);var B,$=L;return B=x,((u,w,x,C)=>{if(w&&\"object\"==typeof w||\"function\"==typeof w)for(let j of i(w))_.call(u,j)||j===x||o(u,j,{get:()=>w[j],enumerable:!(C=s(w,j))||C.enumerable});return u})(o({},\"__esModule\",{value:!0}),B)})();o.exports=s.default,\"undefined\"!=typeof window&&(s=s.default)},920:(o,s,i)=>{\"use strict\";var u=i(70453),_=i(38075),w=i(58859),x=i(69675),C=u(\"%WeakMap%\",!0),j=u(\"%Map%\",!0),L=_(\"WeakMap.prototype.get\",!0),B=_(\"WeakMap.prototype.set\",!0),$=_(\"WeakMap.prototype.has\",!0),V=_(\"Map.prototype.get\",!0),U=_(\"Map.prototype.set\",!0),z=_(\"Map.prototype.has\",!0),listGetNode=function(o,s){for(var i,u=o;null!==(i=u.next);u=i)if(i.key===s)return u.next=i.next,i.next=o.next,o.next=i,i};o.exports=function getSideChannel(){var o,s,i,u={assert:function(o){if(!u.has(o))throw new x(\"Side channel does not contain \"+w(o))},get:function(u){if(C&&u&&(\"object\"==typeof u||\"function\"==typeof u)){if(o)return L(o,u)}else if(j){if(s)return V(s,u)}else if(i)return function(o,s){var i=listGetNode(o,s);return i&&i.value}(i,u)},has:function(u){if(C&&u&&(\"object\"==typeof u||\"function\"==typeof u)){if(o)return $(o,u)}else if(j){if(s)return z(s,u)}else if(i)return function(o,s){return!!listGetNode(o,s)}(i,u);return!1},set:function(u,_){C&&u&&(\"object\"==typeof u||\"function\"==typeof u)?(o||(o=new C),B(o,u,_)):j?(s||(s=new j),U(s,u,_)):(i||(i={key:{},next:null}),function(o,s,i){var u=listGetNode(o,s);u?u.value=i:o.next={key:s,next:o.next,value:i}}(i,u,_))}};return u}},88310:(o,s,i)=>{o.exports=Stream;var u=i(37007).EventEmitter;function Stream(){u.call(this)}i(56698)(Stream,u),Stream.Readable=i(45412),Stream.Writable=i(16708),Stream.Duplex=i(25382),Stream.Transform=i(74610),Stream.PassThrough=i(63600),Stream.finished=i(86238),Stream.pipeline=i(57758),Stream.Stream=Stream,Stream.prototype.pipe=function(o,s){var i=this;function ondata(s){o.writable&&!1===o.write(s)&&i.pause&&i.pause()}function ondrain(){i.readable&&i.resume&&i.resume()}i.on(\"data\",ondata),o.on(\"drain\",ondrain),o._isStdio||s&&!1===s.end||(i.on(\"end\",onend),i.on(\"close\",onclose));var _=!1;function onend(){_||(_=!0,o.end())}function onclose(){_||(_=!0,\"function\"==typeof o.destroy&&o.destroy())}function onerror(o){if(cleanup(),0===u.listenerCount(this,\"error\"))throw o}function cleanup(){i.removeListener(\"data\",ondata),o.removeListener(\"drain\",ondrain),i.removeListener(\"end\",onend),i.removeListener(\"close\",onclose),i.removeListener(\"error\",onerror),o.removeListener(\"error\",onerror),i.removeListener(\"end\",cleanup),i.removeListener(\"close\",cleanup),o.removeListener(\"close\",cleanup)}return i.on(\"error\",onerror),o.on(\"error\",onerror),i.on(\"end\",cleanup),i.on(\"close\",cleanup),o.on(\"close\",cleanup),o.emit(\"pipe\",i),o}},83141:(o,s,i)=>{\"use strict\";var u=i(92861).Buffer,_=u.isEncoding||function(o){switch((o=\"\"+o)&&o.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 StringDecoder(o){var s;switch(this.encoding=function normalizeEncoding(o){var s=function _normalizeEncoding(o){if(!o)return\"utf8\";for(var s;;)switch(o){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 o;default:if(s)return;o=(\"\"+o).toLowerCase(),s=!0}}(o);if(\"string\"!=typeof s&&(u.isEncoding===_||!_(o)))throw new Error(\"Unknown encoding: \"+o);return s||o}(o),this.encoding){case\"utf16le\":this.text=utf16Text,this.end=utf16End,s=4;break;case\"utf8\":this.fillLast=utf8FillLast,s=4;break;case\"base64\":this.text=base64Text,this.end=base64End,s=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=u.allocUnsafe(s)}function utf8CheckByte(o){return o<=127?0:o>>5==6?2:o>>4==14?3:o>>3==30?4:o>>6==2?-1:-2}function utf8FillLast(o){var s=this.lastTotal-this.lastNeed,i=function utf8CheckExtraBytes(o,s,i){if(128!=(192&s[0]))return o.lastNeed=0,\"�\";if(o.lastNeed>1&&s.length>1){if(128!=(192&s[1]))return o.lastNeed=1,\"�\";if(o.lastNeed>2&&s.length>2&&128!=(192&s[2]))return o.lastNeed=2,\"�\"}}(this,o);return void 0!==i?i:this.lastNeed<=o.length?(o.copy(this.lastChar,s,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(o.copy(this.lastChar,s,0,o.length),void(this.lastNeed-=o.length))}function utf16Text(o,s){if((o.length-s)%2==0){var i=o.toString(\"utf16le\",s);if(i){var u=i.charCodeAt(i.length-1);if(u>=55296&&u<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=o[o.length-2],this.lastChar[1]=o[o.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=o[o.length-1],o.toString(\"utf16le\",s,o.length-1)}function utf16End(o){var s=o&&o.length?this.write(o):\"\";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return s+this.lastChar.toString(\"utf16le\",0,i)}return s}function base64Text(o,s){var i=(o.length-s)%3;return 0===i?o.toString(\"base64\",s):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=o[o.length-1]:(this.lastChar[0]=o[o.length-2],this.lastChar[1]=o[o.length-1]),o.toString(\"base64\",s,o.length-i))}function base64End(o){var s=o&&o.length?this.write(o):\"\";return this.lastNeed?s+this.lastChar.toString(\"base64\",0,3-this.lastNeed):s}function simpleWrite(o){return o.toString(this.encoding)}function simpleEnd(o){return o&&o.length?this.write(o):\"\"}s.I=StringDecoder,StringDecoder.prototype.write=function(o){if(0===o.length)return\"\";var s,i;if(this.lastNeed){if(void 0===(s=this.fillLast(o)))return\"\";i=this.lastNeed,this.lastNeed=0}else i=0;return i<o.length?s?s+this.text(o,i):this.text(o,i):s||\"\"},StringDecoder.prototype.end=function utf8End(o){var s=o&&o.length?this.write(o):\"\";return this.lastNeed?s+\"�\":s},StringDecoder.prototype.text=function utf8Text(o,s){var i=function utf8CheckIncomplete(o,s,i){var u=s.length-1;if(u<i)return 0;var _=utf8CheckByte(s[u]);if(_>=0)return _>0&&(o.lastNeed=_-1),_;if(--u<i||-2===_)return 0;if(_=utf8CheckByte(s[u]),_>=0)return _>0&&(o.lastNeed=_-2),_;if(--u<i||-2===_)return 0;if(_=utf8CheckByte(s[u]),_>=0)return _>0&&(2===_?_=0:o.lastNeed=_-3),_;return 0}(this,o,s);if(!this.lastNeed)return o.toString(\"utf8\",s);this.lastTotal=i;var u=o.length-(i-this.lastNeed);return o.copy(this.lastChar,0,u),o.toString(\"utf8\",s,u)},StringDecoder.prototype.fillLast=function(o){if(this.lastNeed<=o.length)return o.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);o.copy(this.lastChar,this.lastTotal-this.lastNeed,0,o.length),this.lastNeed-=o.length}},16426:o=>{o.exports=function(){var o=document.getSelection();if(!o.rangeCount)return function(){};for(var s=document.activeElement,i=[],u=0;u<o.rangeCount;u++)i.push(o.getRangeAt(u));switch(s.tagName.toUpperCase()){case\"INPUT\":case\"TEXTAREA\":s.blur();break;default:s=null}return o.removeAllRanges(),function(){\"Caret\"===o.type&&o.removeAllRanges(),o.rangeCount||i.forEach((function(s){o.addRange(s)})),s&&s.focus()}}},36623:o=>{\"use strict\";function toS(o){return Object.prototype.toString.call(o)}var s=Array.isArray||function isArray(o){return\"[object Array]\"===Object.prototype.toString.call(o)};function forEach(o,s){if(o.forEach)return o.forEach(s);for(var i=0;i<o.length;i++)s(o[i],i,o)}var i=Object.keys||function keys(o){var s=[];for(var i in o)s.push(i);return s},u=Object.prototype.propertyIsEnumerable,_=Object.getOwnPropertySymbols;function ownEnumerableKeys(o){var s=i(o);if(_)for(var w=_(o),x=0;x<w.length;x++)u.call(o,w[x])&&s.push(w[x]);return s}var w=Object.prototype.hasOwnProperty||function(o,s){return s in o};function copy(o){if(\"object\"==typeof o&&null!==o){var i;if(s(o))i=[];else if(function isDate(o){return\"[object Date]\"===toS(o)}(o))i=new Date(o.getTime?o.getTime():o);else if(function isRegExp(o){return\"[object RegExp]\"===toS(o)}(o))i=new RegExp(o);else if(function isError(o){return\"[object Error]\"===toS(o)}(o))i={message:o.message};else if(function isBoolean(o){return\"[object Boolean]\"===toS(o)}(o)||function isNumber(o){return\"[object Number]\"===toS(o)}(o)||function isString(o){return\"[object String]\"===toS(o)}(o))i=Object(o);else if(Object.create&&Object.getPrototypeOf)i=Object.create(Object.getPrototypeOf(o));else if(o.constructor===Object)i={};else{var u=o.constructor&&o.constructor.prototype||o.__proto__||{},_=function T(){};_.prototype=u,i=new _}return forEach(ownEnumerableKeys(o),(function(s){i[s]=o[s]})),i}return o}function walk(o,i,u){var _=[],x=[],C=!0;return function walker(o){var j=u?copy(o):o,L={},B=!0,$={node:j,node_:o,path:[].concat(_),parent:x[x.length-1],parents:x,key:_[_.length-1],isRoot:0===_.length,level:_.length,circular:null,update:function(o,s){$.isRoot||($.parent.node[$.key]=o),$.node=o,s&&(B=!1)},delete:function(o){delete $.parent.node[$.key],o&&(B=!1)},remove:function(o){s($.parent.node)?$.parent.node.splice($.key,1):delete $.parent.node[$.key],o&&(B=!1)},keys:null,before:function(o){L.before=o},after:function(o){L.after=o},pre:function(o){L.pre=o},post:function(o){L.post=o},stop:function(){C=!1},block:function(){B=!1}};if(!C)return $;function updateState(){if(\"object\"==typeof $.node&&null!==$.node){$.keys&&$.node_===$.node||($.keys=ownEnumerableKeys($.node)),$.isLeaf=0===$.keys.length;for(var s=0;s<x.length;s++)if(x[s].node_===o){$.circular=x[s];break}}else $.isLeaf=!0,$.keys=null;$.notLeaf=!$.isLeaf,$.notRoot=!$.isRoot}updateState();var V=i.call($,$.node);return void 0!==V&&$.update&&$.update(V),L.before&&L.before.call($,$.node),B?(\"object\"!=typeof $.node||null===$.node||$.circular||(x.push($),updateState(),forEach($.keys,(function(o,s){_.push(o),L.pre&&L.pre.call($,$.node[o],o);var i=walker($.node[o]);u&&w.call($.node,o)&&($.node[o]=i.node),i.isLast=s===$.keys.length-1,i.isFirst=0===s,L.post&&L.post.call($,i),_.pop()})),x.pop()),L.after&&L.after.call($,$.node),$):$}(o).node}function Traverse(o){this.value=o}function traverse(o){return new Traverse(o)}Traverse.prototype.get=function(o){for(var s=this.value,i=0;i<o.length;i++){var u=o[i];if(!s||!w.call(s,u))return;s=s[u]}return s},Traverse.prototype.has=function(o){for(var s=this.value,i=0;i<o.length;i++){var u=o[i];if(!s||!w.call(s,u))return!1;s=s[u]}return!0},Traverse.prototype.set=function(o,s){for(var i=this.value,u=0;u<o.length-1;u++){var _=o[u];w.call(i,_)||(i[_]={}),i=i[_]}return i[o[u]]=s,s},Traverse.prototype.map=function(o){return walk(this.value,o,!0)},Traverse.prototype.forEach=function(o){return this.value=walk(this.value,o,!1),this.value},Traverse.prototype.reduce=function(o,s){var i=1===arguments.length,u=i?this.value:s;return this.forEach((function(s){this.isRoot&&i||(u=o.call(this,u,s))})),u},Traverse.prototype.paths=function(){var o=[];return this.forEach((function(){o.push(this.path)})),o},Traverse.prototype.nodes=function(){var o=[];return this.forEach((function(){o.push(this.node)})),o},Traverse.prototype.clone=function(){var o=[],s=[];return function clone(i){for(var u=0;u<o.length;u++)if(o[u]===i)return s[u];if(\"object\"==typeof i&&null!==i){var _=copy(i);return o.push(i),s.push(_),forEach(ownEnumerableKeys(i),(function(o){_[o]=clone(i[o])})),o.pop(),s.pop(),_}return i}(this.value)},forEach(ownEnumerableKeys(Traverse.prototype),(function(o){traverse[o]=function(s){var i=[].slice.call(arguments,1),u=new Traverse(s);return u[o].apply(u,i)}})),o.exports=traverse},61160:(o,s,i)=>{\"use strict\";var u=i(92063),_=i(73992),w=/^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/,x=/[\\n\\r\\t]/g,C=/^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//,j=/:\\d+$/,L=/^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i,B=/^[a-zA-Z]:/;function trimLeft(o){return(o||\"\").toString().replace(w,\"\")}var $=[[\"#\",\"hash\"],[\"?\",\"query\"],function sanitize(o,s){return isSpecial(s.protocol)?o.replace(/\\\\/g,\"/\"):o},[\"/\",\"pathname\"],[\"@\",\"auth\",1],[NaN,\"host\",void 0,1,1],[/:(\\d*)$/,\"port\",void 0,1],[NaN,\"hostname\",void 0,1,1]],V={hash:1,query:1};function lolcation(o){var s,u=(\"undefined\"!=typeof window?window:void 0!==i.g?i.g:\"undefined\"!=typeof self?self:{}).location||{},_={},w=typeof(o=o||u);if(\"blob:\"===o.protocol)_=new Url(unescape(o.pathname),{});else if(\"string\"===w)for(s in _=new Url(o,{}),V)delete _[s];else if(\"object\"===w){for(s in o)s in V||(_[s]=o[s]);void 0===_.slashes&&(_.slashes=C.test(o.href))}return _}function isSpecial(o){return\"file:\"===o||\"ftp:\"===o||\"http:\"===o||\"https:\"===o||\"ws:\"===o||\"wss:\"===o}function extractProtocol(o,s){o=(o=trimLeft(o)).replace(x,\"\"),s=s||{};var i,u=L.exec(o),_=u[1]?u[1].toLowerCase():\"\",w=!!u[2],C=!!u[3],j=0;return w?C?(i=u[2]+u[3]+u[4],j=u[2].length+u[3].length):(i=u[2]+u[4],j=u[2].length):C?(i=u[3]+u[4],j=u[3].length):i=u[4],\"file:\"===_?j>=2&&(i=i.slice(2)):isSpecial(_)?i=u[4]:_?w&&(i=i.slice(2)):j>=2&&isSpecial(s.protocol)&&(i=u[4]),{protocol:_,slashes:w||isSpecial(_),slashesCount:j,rest:i}}function Url(o,s,i){if(o=(o=trimLeft(o)).replace(x,\"\"),!(this instanceof Url))return new Url(o,s,i);var w,C,j,L,V,U,z=$.slice(),Y=typeof s,Z=this,ee=0;for(\"object\"!==Y&&\"string\"!==Y&&(i=s,s=null),i&&\"function\"!=typeof i&&(i=_.parse),w=!(C=extractProtocol(o||\"\",s=lolcation(s))).protocol&&!C.slashes,Z.slashes=C.slashes||w&&s.slashes,Z.protocol=C.protocol||s.protocol||\"\",o=C.rest,(\"file:\"===C.protocol&&(2!==C.slashesCount||B.test(o))||!C.slashes&&(C.protocol||C.slashesCount<2||!isSpecial(Z.protocol)))&&(z[3]=[/(.*)/,\"pathname\"]);ee<z.length;ee++)\"function\"!=typeof(L=z[ee])?(j=L[0],U=L[1],j!=j?Z[U]=o:\"string\"==typeof j?~(V=\"@\"===j?o.lastIndexOf(j):o.indexOf(j))&&(\"number\"==typeof L[2]?(Z[U]=o.slice(0,V),o=o.slice(V+L[2])):(Z[U]=o.slice(V),o=o.slice(0,V))):(V=j.exec(o))&&(Z[U]=V[1],o=o.slice(0,V.index)),Z[U]=Z[U]||w&&L[3]&&s[U]||\"\",L[4]&&(Z[U]=Z[U].toLowerCase())):o=L(o,Z);i&&(Z.query=i(Z.query)),w&&s.slashes&&\"/\"!==Z.pathname.charAt(0)&&(\"\"!==Z.pathname||\"\"!==s.pathname)&&(Z.pathname=function resolve(o,s){if(\"\"===o)return s;for(var i=(s||\"/\").split(\"/\").slice(0,-1).concat(o.split(\"/\")),u=i.length,_=i[u-1],w=!1,x=0;u--;)\".\"===i[u]?i.splice(u,1):\"..\"===i[u]?(i.splice(u,1),x++):x&&(0===u&&(w=!0),i.splice(u,1),x--);return w&&i.unshift(\"\"),\".\"!==_&&\"..\"!==_||i.push(\"\"),i.join(\"/\")}(Z.pathname,s.pathname)),\"/\"!==Z.pathname.charAt(0)&&isSpecial(Z.protocol)&&(Z.pathname=\"/\"+Z.pathname),u(Z.port,Z.protocol)||(Z.host=Z.hostname,Z.port=\"\"),Z.username=Z.password=\"\",Z.auth&&(~(V=Z.auth.indexOf(\":\"))?(Z.username=Z.auth.slice(0,V),Z.username=encodeURIComponent(decodeURIComponent(Z.username)),Z.password=Z.auth.slice(V+1),Z.password=encodeURIComponent(decodeURIComponent(Z.password))):Z.username=encodeURIComponent(decodeURIComponent(Z.auth)),Z.auth=Z.password?Z.username+\":\"+Z.password:Z.username),Z.origin=\"file:\"!==Z.protocol&&isSpecial(Z.protocol)&&Z.host?Z.protocol+\"//\"+Z.host:\"null\",Z.href=Z.toString()}Url.prototype={set:function set(o,s,i){var w=this;switch(o){case\"query\":\"string\"==typeof s&&s.length&&(s=(i||_.parse)(s)),w[o]=s;break;case\"port\":w[o]=s,u(s,w.protocol)?s&&(w.host=w.hostname+\":\"+s):(w.host=w.hostname,w[o]=\"\");break;case\"hostname\":w[o]=s,w.port&&(s+=\":\"+w.port),w.host=s;break;case\"host\":w[o]=s,j.test(s)?(s=s.split(\":\"),w.port=s.pop(),w.hostname=s.join(\":\")):(w.hostname=s,w.port=\"\");break;case\"protocol\":w.protocol=s.toLowerCase(),w.slashes=!i;break;case\"pathname\":case\"hash\":if(s){var x=\"pathname\"===o?\"/\":\"#\";w[o]=s.charAt(0)!==x?x+s:s}else w[o]=s;break;case\"username\":case\"password\":w[o]=encodeURIComponent(s);break;case\"auth\":var C=s.indexOf(\":\");~C?(w.username=s.slice(0,C),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=s.slice(C+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(s))}for(var L=0;L<$.length;L++){var B=$[L];B[4]&&(w[B[1]]=w[B[1]].toLowerCase())}return w.auth=w.password?w.username+\":\"+w.password:w.username,w.origin=\"file:\"!==w.protocol&&isSpecial(w.protocol)&&w.host?w.protocol+\"//\"+w.host:\"null\",w.href=w.toString(),w},toString:function toString(o){o&&\"function\"==typeof o||(o=_.stringify);var s,i=this,u=i.host,w=i.protocol;w&&\":\"!==w.charAt(w.length-1)&&(w+=\":\");var x=w+(i.protocol&&i.slashes||isSpecial(i.protocol)?\"//\":\"\");return i.username?(x+=i.username,i.password&&(x+=\":\"+i.password),x+=\"@\"):i.password?(x+=\":\"+i.password,x+=\"@\"):\"file:\"!==i.protocol&&isSpecial(i.protocol)&&!u&&\"/\"!==i.pathname&&(x+=\"@\"),(\":\"===u[u.length-1]||j.test(i.hostname)&&!i.port)&&(u+=\":\"),x+=u+i.pathname,(s=\"object\"==typeof i.query?o(i.query):i.query)&&(x+=\"?\"!==s.charAt(0)?\"?\"+s:s),i.hash&&(x+=i.hash),x}},Url.extractProtocol=extractProtocol,Url.location=lolcation,Url.trimLeft=trimLeft,Url.qs=_,o.exports=Url},77154:(o,s,i)=>{\"use strict\";var u=i(96540);var _=\"function\"==typeof Object.is?Object.is:function n(o,s){return o===s&&(0!==o||1/o==1/s)||o!=o&&s!=s},w=u.useSyncExternalStore,x=u.useRef,C=u.useEffect,j=u.useMemo,L=u.useDebugValue;s.useSyncExternalStoreWithSelector=function(o,s,i,u,B){var $=x(null);if(null===$.current){var V={hasValue:!1,value:null};$.current=V}else V=$.current;$=j((function(){function a(s){if(!x){if(x=!0,o=s,s=u(s),void 0!==B&&V.hasValue){var i=V.value;if(B(i,s))return w=i}return w=s}if(i=w,_(o,s))return i;var C=u(s);return void 0!==B&&B(i,C)?i:(o=s,w=C)}var o,w,x=!1,C=void 0===i?null:i;return[function(){return a(s())},null===C?void 0:function(){return a(C())}]}),[s,i,u,B]);var U=w(o,$[0],$[1]);return C((function(){V.hasValue=!0,V.value=U}),[U]),L(U),U}},78418:(o,s,i)=>{\"use strict\";o.exports=i(77154)},94643:(o,s,i)=>{function config(o){try{if(!i.g.localStorage)return!1}catch(o){return!1}var s=i.g.localStorage[o];return null!=s&&\"true\"===String(s).toLowerCase()}o.exports=function deprecate(o,s){if(config(\"noDeprecation\"))return o;var i=!1;return function deprecated(){if(!i){if(config(\"throwDeprecation\"))throw new Error(s);config(\"traceDeprecation\")?console.trace(s):console.warn(s),i=!0}return o.apply(this,arguments)}}},26657:(o,s,i)=>{\"use strict\";var u=i(75208),_=function isClosingTag(o){return/<\\/+[^>]+>/.test(o)},w=function isSelfClosingTag(o){return/<[^>]+\\/>/.test(o)},x=function isOpeningTag(o){return function isTag(o){return/<[^>!]+>/.test(o)}(o)&&!_(o)&&!w(o)};function getType(o){return _(o)?\"ClosingTag\":x(o)?\"OpeningTag\":w(o)?\"SelfClosingTag\":\"Text\"}o.exports=function(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=s.indentor,_=s.textNodesOnSameLine,w=0,x=[];i=i||\"    \";var C=function lexer(o){return function splitOnTags(o){return o.split(/(<\\/?[^>]+>)/g).filter((function(o){return\"\"!==o.trim()}))}(o).map((function(o){return{value:o,type:getType(o)}}))}(o).map((function(o,s,C){var j=o.value,L=o.type;\"ClosingTag\"===L&&w--;var B=u(i,w),$=B+j;if(\"OpeningTag\"===L&&w++,_){var V=C[s-1],U=C[s-2];\"ClosingTag\"===L&&\"Text\"===V.type&&\"OpeningTag\"===U.type&&($=\"\"+B+U.value+V.value+j,x.push(s-2,s-1))}return $}));return x.forEach((function(o){return C[o]=null})),C.filter((function(o){return!!o})).join(\"\\n\")}},31499:o=>{var s={\"&\":\"&amp;\",'\"':\"&quot;\",\"'\":\"&apos;\",\"<\":\"&lt;\",\">\":\"&gt;\"};o.exports=function escapeForXML(o){return o&&o.replace?o.replace(/([&\"<>'])/g,(function(o,i){return s[i]})):o}},19123:(o,s,i)=>{var u=i(65606),_=i(31499),w=i(88310).Stream;function resolve(o,s,i){var u,w=function create_indent(o,s){return new Array(s||0).join(o||\"\")}(s,i=i||0),x=o;if(\"object\"==typeof o&&((x=o[u=Object.keys(o)[0]])&&x._elem))return x._elem.name=u,x._elem.icount=i,x._elem.indent=s,x._elem.indents=w,x._elem.interrupt=x,x._elem;var C,j=[],L=[];function get_attributes(o){Object.keys(o).forEach((function(s){j.push(function attribute(o,s){return o+'=\"'+_(s)+'\"'}(s,o[s]))}))}switch(typeof x){case\"object\":if(null===x)break;x._attr&&get_attributes(x._attr),x._cdata&&L.push((\"<![CDATA[\"+x._cdata).replace(/\\]\\]>/g,\"]]]]><![CDATA[>\")+\"]]>\"),x.forEach&&(C=!1,L.push(\"\"),x.forEach((function(o){\"object\"==typeof o?\"_attr\"==Object.keys(o)[0]?get_attributes(o._attr):L.push(resolve(o,s,i+1)):(L.pop(),C=!0,L.push(_(o)))})),C||L.push(\"\"));break;default:L.push(_(x))}return{name:u,interrupt:!1,attributes:j,content:L,icount:i,indents:w,indent:s}}function format(o,s,i){if(\"object\"!=typeof s)return o(!1,s);var u=s.interrupt?1:s.content.length;function proceed(){for(;s.content.length;){var _=s.content.shift();if(void 0!==_){if(interrupt(_))return;format(o,_)}}o(!1,(u>1?s.indents:\"\")+(s.name?\"</\"+s.name+\">\":\"\")+(s.indent&&!i?\"\\n\":\"\")),i&&i()}function interrupt(s){return!!s.interrupt&&(s.interrupt.append=o,s.interrupt.end=proceed,s.interrupt=!1,o(!0),!0)}if(o(!1,s.indents+(s.name?\"<\"+s.name:\"\")+(s.attributes.length?\" \"+s.attributes.join(\" \"):\"\")+(u?s.name?\">\":\"\":s.name?\"/>\":\"\")+(s.indent&&u>1?\"\\n\":\"\")),!u)return o(!1,s.indent?\"\\n\":\"\");interrupt(s)||proceed()}o.exports=function xml(o,s){\"object\"!=typeof s&&(s={indent:s});var i=s.stream?new w:null,_=\"\",x=!1,C=s.indent?!0===s.indent?\"    \":s.indent:\"\",j=!0;function delay(o){j?u.nextTick(o):o()}function append(o,s){if(void 0!==s&&(_+=s),o&&!x&&(i=i||new w,x=!0),o&&x){var u=_;delay((function(){i.emit(\"data\",u)})),_=\"\"}}function add(o,s){format(append,resolve(o,C,C?1:0),s)}function end(){if(i){var o=_;delay((function(){i.emit(\"data\",o),i.emit(\"end\"),i.readable=!1,i.emit(\"close\")}))}}return delay((function(){j=!1})),s.declaration&&function addXmlDeclaration(o){var s={version:\"1.0\",encoding:o.encoding||\"UTF-8\"};o.standalone&&(s.standalone=o.standalone),add({\"?xml\":{_attr:s}}),_=_.replace(\"/>\",\"?>\")}(s.declaration),o&&o.forEach?o.forEach((function(s,i){var u;i+1===o.length&&(u=end),add(s,u)})):add(o,end),i?(i.readable=!0,i):_},o.exports.element=o.exports.Element=function element(){var o={_elem:resolve(Array.prototype.slice.call(arguments)),push:function(o){if(!this.append)throw new Error(\"not assigned to a parent!\");var s=this,i=this._elem.indent;format(this.append,resolve(o,i,this._elem.icount+(i?1:0)),(function(){s.append(!0)}))},close:function(o){void 0!==o&&this.push(o),this.end&&this.end()}};return o}},86215:function(o,s){var i,u,_;u=[],i=function(){\"use strict\";var isNativeSmoothScrollEnabledOn=function(o){return o&&\"getComputedStyle\"in window&&\"smooth\"===window.getComputedStyle(o)[\"scroll-behavior\"]};if(\"undefined\"==typeof window||!(\"document\"in window))return{};var makeScroller=function(o,s,i){var u;s=s||999,i||0===i||(i=9);var setScrollTimeoutId=function(o){u=o},stopScroll=function(){clearTimeout(u),setScrollTimeoutId(0)},getTopWithEdgeOffset=function(s){return Math.max(0,o.getTopOf(s)-i)},scrollToY=function(i,u,_){if(stopScroll(),0===u||u&&u<0||isNativeSmoothScrollEnabledOn(o.body))o.toY(i),_&&_();else{var w=o.getY(),x=Math.max(0,i)-w,C=(new Date).getTime();u=u||Math.min(Math.abs(x),s),function loopScroll(){setScrollTimeoutId(setTimeout((function(){var s=Math.min(1,((new Date).getTime()-C)/u),i=Math.max(0,Math.floor(w+x*(s<.5?2*s*s:s*(4-2*s)-1)));o.toY(i),s<1&&o.getHeight()+i<o.body.scrollHeight?loopScroll():(setTimeout(stopScroll,99),_&&_())}),9))}()}},scrollToElem=function(o,s,i){scrollToY(getTopWithEdgeOffset(o),s,i)},scrollIntoView=function(s,u,_){var w=s.getBoundingClientRect().height,x=o.getTopOf(s)+w,C=o.getHeight(),j=o.getY(),L=j+C;getTopWithEdgeOffset(s)<j||w+i>C?scrollToElem(s,u,_):x+i>L?scrollToY(x-C+i,u,_):_&&_()},scrollToCenterOf=function(s,i,u,_){scrollToY(Math.max(0,o.getTopOf(s)-o.getHeight()/2+(u||s.getBoundingClientRect().height/2)),i,_)};return{setup:function(o,u){return(0===o||o)&&(s=o),(0===u||u)&&(i=u),{defaultDuration:s,edgeOffset:i}},to:scrollToElem,toY:scrollToY,intoView:scrollIntoView,center:scrollToCenterOf,stop:stopScroll,moving:function(){return!!u},getY:o.getY,getTopOf:o.getTopOf}},o=document.documentElement,getDocY=function(){return window.scrollY||o.scrollTop},s=makeScroller({body:document.scrollingElement||document.body,toY:function(o){window.scrollTo(0,o)},getY:getDocY,getHeight:function(){return window.innerHeight||o.clientHeight},getTopOf:function(s){return s.getBoundingClientRect().top+getDocY()-o.offsetTop}});if(s.createScroller=function(s,i,u){return makeScroller({body:s,toY:function(o){s.scrollTop=o},getY:function(){return s.scrollTop},getHeight:function(){return Math.min(s.clientHeight,window.innerHeight||o.clientHeight)},getTopOf:function(o){return o.offsetTop}},i,u)},\"addEventListener\"in window&&!window.noZensmooth&&!isNativeSmoothScrollEnabledOn(document.body)){var i=\"history\"in window&&\"pushState\"in history,u=i&&\"scrollRestoration\"in history;u&&(history.scrollRestoration=\"auto\"),window.addEventListener(\"load\",(function(){u&&(setTimeout((function(){history.scrollRestoration=\"manual\"}),9),window.addEventListener(\"popstate\",(function(o){o.state&&\"zenscrollY\"in o.state&&s.toY(o.state.zenscrollY)}),!1)),window.location.hash&&setTimeout((function(){var o=s.setup().edgeOffset;if(o){var i=document.getElementById(window.location.href.split(\"#\")[1]);if(i){var u=Math.max(0,s.getTopOf(i)-o),_=s.getY()-u;0<=_&&_<9&&window.scrollTo(0,u)}}}),9)}),!1);var _=new RegExp(\"(^|\\\\s)noZensmooth(\\\\s|$)\");window.addEventListener(\"click\",(function(o){for(var w=o.target;w&&\"A\"!==w.tagName;)w=w.parentNode;if(!(!w||1!==o.which||o.shiftKey||o.metaKey||o.ctrlKey||o.altKey)){if(u){var x=history.state&&\"object\"==typeof history.state?history.state:{};x.zenscrollY=s.getY();try{history.replaceState(x,\"\")}catch(o){}}var C=w.getAttribute(\"href\")||\"\";if(0===C.indexOf(\"#\")&&!_.test(w.className)){var j=0,L=document.getElementById(C.substring(1));if(\"#\"!==C){if(!L)return;j=s.getTopOf(L)}o.preventDefault();var onDone=function(){window.location=C},B=s.setup().edgeOffset;B&&(j=Math.max(0,j-B),i&&(onDone=function(){history.pushState({},\"\",C)})),s.toY(j,null,onDone)}}}),!1)}return s}(),void 0===(_=\"function\"==typeof i?i.apply(s,u):i)||(o.exports=_)},42634:()=>{},15340:()=>{},79838:()=>{},48675:(o,s,i)=>{o.exports=i(20850)},39584:(o,s,i)=>{o.exports=i(92983)},7666:(o,s,i)=>{var u=i(84851),_=i(953);function _extends(){var s;return o.exports=_extends=u?_(s=u).call(s):function(o){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(o[u]=i[u])}return o},o.exports.__esModule=!0,o.exports.default=o.exports,_extends.apply(this,arguments)}o.exports=_extends,o.exports.__esModule=!0,o.exports.default=o.exports},46942:(o,s)=>{var i;!function(){\"use strict\";var u={}.hasOwnProperty;function classNames(){for(var o=\"\",s=0;s<arguments.length;s++){var i=arguments[s];i&&(o=appendClass(o,parseValue(i)))}return o}function parseValue(o){if(\"string\"==typeof o||\"number\"==typeof o)return o;if(\"object\"!=typeof o)return\"\";if(Array.isArray(o))return classNames.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes(\"[native code]\"))return o.toString();var s=\"\";for(var i in o)u.call(o,i)&&o[i]&&(s=appendClass(s,i));return s}function appendClass(o,s){return s?o?o+\" \"+s:o+s:o}o.exports?(classNames.default=classNames,o.exports=classNames):void 0===(i=function(){return classNames}.apply(s,[]))||(o.exports=i)}()},68623:(o,s,i)=>{\"use strict\";var u=i(694);o.exports=u},93700:(o,s,i)=>{\"use strict\";var u=i(19709);o.exports=u},4588:(o,s,i)=>{\"use strict\";var u=i(96203);o.exports=u},462:(o,s,i)=>{\"use strict\";var u=i(40975);o.exports=u},37257:(o,s,i)=>{\"use strict\";i(96605),i(64502),i(36371),i(99363),i(7057);var u=i(92046);o.exports=u.AggregateError},32567:(o,s,i)=>{\"use strict\";i(79307);var u=i(61747);o.exports=u(\"Function\",\"bind\")},23034:(o,s,i)=>{\"use strict\";var u=i(88280),_=i(32567),w=Function.prototype;o.exports=function(o){var s=o.bind;return o===w||u(w,o)&&s===w.bind?_:s}},3258:(o,s,i)=>{\"use strict\";var u=i(88280),_=i(16768),w=String.prototype;o.exports=function(o){var s=o.matchAll;return\"string\"==typeof o||o===w||u(w,o)&&s===w.matchAll?_:s}},9748:(o,s,i)=>{\"use strict\";i(71340);var u=i(92046);o.exports=u.Object.assign},16768:(o,s,i)=>{\"use strict\";i(86024),i(51398),i(79104);var u=i(61747);o.exports=u(\"String\",\"matchAll\")},20850:(o,s,i)=>{\"use strict\";o.exports=i(46076)},953:(o,s,i)=>{\"use strict\";o.exports=i(53375)},92983:(o,s,i)=>{\"use strict\";o.exports=i(5077)},84851:(o,s,i)=>{\"use strict\";o.exports=i(85401)},46076:(o,s,i)=>{\"use strict\";i(91599);var u=i(68623);o.exports=u},53375:(o,s,i)=>{\"use strict\";var u=i(93700);o.exports=u},5077:(o,s,i)=>{\"use strict\";i(37347);var u=i(4588);o.exports=u},85401:(o,s,i)=>{\"use strict\";var u=i(462);o.exports=u},82159:(o,s,i)=>{\"use strict\";var u=i(62250),_=i(4640),w=TypeError;o.exports=function(o){if(u(o))return o;throw new w(_(o)+\" is not a function\")}},82235:(o,s,i)=>{\"use strict\";var u=i(25468),_=i(4640),w=TypeError;o.exports=function(o){if(u(o))return o;throw new w(_(o)+\" is not a constructor\")}},10043:(o,s,i)=>{\"use strict\";var u=i(54018),_=String,w=TypeError;o.exports=function(o){if(u(o))return o;throw new w(\"Can't set \"+_(o)+\" as a prototype\")}},42156:o=>{\"use strict\";o.exports=function(){}},25592:(o,s,i)=>{\"use strict\";var u=i(11470).charAt;o.exports=function(o,s,i){return s+(i?u(o,s).length:1)}},36624:(o,s,i)=>{\"use strict\";var u=i(46285),_=String,w=TypeError;o.exports=function(o){if(u(o))return o;throw new w(_(o)+\" is not an object\")}},74436:(o,s,i)=>{\"use strict\";var u=i(4993),_=i(34849),w=i(20575),createMethod=function(o){return function(s,i,x){var C=u(s),j=w(C);if(0===j)return!o&&-1;var L,B=_(x,j);if(o&&i!=i){for(;j>B;)if((L=C[B++])!=L)return!0}else for(;j>B;B++)if((o||B in C)&&C[B]===i)return o||B||0;return!o&&-1}};o.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},93427:(o,s,i)=>{\"use strict\";var u=i(1907);o.exports=u([].slice)},45807:(o,s,i)=>{\"use strict\";var u=i(1907),_=u({}.toString),w=u(\"\".slice);o.exports=function(o){return w(_(o),8,-1)}},73948:(o,s,i)=>{\"use strict\";var u=i(52623),_=i(62250),w=i(45807),x=i(76264)(\"toStringTag\"),C=Object,j=\"Arguments\"===w(function(){return arguments}());o.exports=u?w:function(o){var s,i,u;return void 0===o?\"Undefined\":null===o?\"Null\":\"string\"==typeof(i=function(o,s){try{return o[s]}catch(o){}}(s=C(o),x))?i:j?w(s):\"Object\"===(u=w(s))&&_(s.callee)?\"Arguments\":u}},19595:(o,s,i)=>{\"use strict\";var u=i(49724),_=i(11042),w=i(13846),x=i(74284);o.exports=function(o,s,i){for(var C=_(s),j=x.f,L=w.f,B=0;B<C.length;B++){var $=C[B];u(o,$)||i&&u(i,$)||j(o,$,L(s,$))}}},57382:(o,s,i)=>{\"use strict\";var u=i(98828);o.exports=!u((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))},59550:o=>{\"use strict\";o.exports=function(o,s){return{value:o,done:s}}},61626:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(74284),w=i(75817);o.exports=u?function(o,s,i){return _.f(o,s,w(1,i))}:function(o,s,i){return o[s]=i,o}},75817:o=>{\"use strict\";o.exports=function(o,s){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:s}}},68055:(o,s,i)=>{\"use strict\";var u=i(61626);o.exports=function(o,s,i,_){return _&&_.enumerable?o[s]=i:u(o,s,i),o}},2532:(o,s,i)=>{\"use strict\";var u=i(41010),_=Object.defineProperty;o.exports=function(o,s){try{_(u,o,{value:s,configurable:!0,writable:!0})}catch(i){u[o]=s}return s}},39447:(o,s,i)=>{\"use strict\";var u=i(98828);o.exports=!u((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},49552:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(46285),w=u.document,x=_(w)&&_(w.createElement);o.exports=function(o){return x?w.createElement(o):{}}},19287:o=>{\"use strict\";o.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},64723:o=>{\"use strict\";o.exports=\"undefined\"!=typeof navigator&&String(navigator.userAgent)||\"\"},15683:(o,s,i)=>{\"use strict\";var u,_,w=i(41010),x=i(64723),C=w.process,j=w.Deno,L=C&&C.versions||j&&j.version,B=L&&L.v8;B&&(_=(u=B.split(\".\"))[0]>0&&u[0]<4?1:+(u[0]+u[1])),!_&&x&&(!(u=x.match(/Edge\\/(\\d+)/))||u[1]>=74)&&(u=x.match(/Chrome\\/(\\d+)/))&&(_=+u[1]),o.exports=_},80376:o=>{\"use strict\";o.exports=[\"constructor\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toLocaleString\",\"toString\",\"valueOf\"]},85762:(o,s,i)=>{\"use strict\";var u=i(1907),_=Error,w=u(\"\".replace),x=String(new _(\"zxcasd\").stack),C=/\\n\\s*at [^:]*:[^\\n]*/,j=C.test(x);o.exports=function(o,s){if(j&&\"string\"==typeof o&&!_.prepareStackTrace)for(;s--;)o=w(o,C,\"\");return o}},85884:(o,s,i)=>{\"use strict\";var u=i(61626),_=i(85762),w=i(23888),x=Error.captureStackTrace;o.exports=function(o,s,i,C){w&&(x?x(o,s):u(o,\"stack\",_(i,C)))}},23888:(o,s,i)=>{\"use strict\";var u=i(98828),_=i(75817);o.exports=!u((function(){var o=new Error(\"a\");return!(\"stack\"in o)||(Object.defineProperty(o,\"stack\",_(1,7)),7!==o.stack)}))},11091:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(76024),w=i(92361),x=i(62250),C=i(13846).f,j=i(7463),L=i(92046),B=i(28311),$=i(61626),V=i(49724);i(36128);var wrapConstructor=function(o){var Wrapper=function(s,i,u){if(this instanceof Wrapper){switch(arguments.length){case 0:return new o;case 1:return new o(s);case 2:return new o(s,i)}return new o(s,i,u)}return _(o,this,arguments)};return Wrapper.prototype=o.prototype,Wrapper};o.exports=function(o,s){var i,_,U,z,Y,Z,ee,ie,ae,ce=o.target,le=o.global,pe=o.stat,de=o.proto,fe=le?u:pe?u[ce]:u[ce]&&u[ce].prototype,ye=le?L:L[ce]||$(L,ce,{})[ce],be=ye.prototype;for(z in s)_=!(i=j(le?z:ce+(pe?\".\":\"#\")+z,o.forced))&&fe&&V(fe,z),Z=ye[z],_&&(ee=o.dontCallGetSet?(ae=C(fe,z))&&ae.value:fe[z]),Y=_&&ee?ee:s[z],(i||de||typeof Z!=typeof Y)&&(ie=o.bind&&_?B(Y,u):o.wrap&&_?wrapConstructor(Y):de&&x(Y)?w(Y):Y,(o.sham||Y&&Y.sham||Z&&Z.sham)&&$(ie,\"sham\",!0),$(ye,z,ie),de&&(V(L,U=ce+\"Prototype\")||$(L,U,{}),$(L[U],z,Y),o.real&&be&&(i||!be[z])&&$(be,z,Y)))}},98828:o=>{\"use strict\";o.exports=function(o){try{return!!o()}catch(o){return!0}}},76024:(o,s,i)=>{\"use strict\";var u=i(41505),_=Function.prototype,w=_.apply,x=_.call;o.exports=\"object\"==typeof Reflect&&Reflect.apply||(u?x.bind(w):function(){return x.apply(w,arguments)})},28311:(o,s,i)=>{\"use strict\";var u=i(92361),_=i(82159),w=i(41505),x=u(u.bind);o.exports=function(o,s){return _(o),void 0===s?o:w?x(o,s):function(){return o.apply(s,arguments)}}},41505:(o,s,i)=>{\"use strict\";var u=i(98828);o.exports=!u((function(){var o=function(){}.bind();return\"function\"!=typeof o||o.hasOwnProperty(\"prototype\")}))},44673:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(82159),w=i(46285),x=i(49724),C=i(93427),j=i(41505),L=Function,B=u([].concat),$=u([].join),V={};o.exports=j?L.bind:function bind(o){var s=_(this),i=s.prototype,u=C(arguments,1),j=function bound(){var i=B(u,C(arguments));return this instanceof j?function(o,s,i){if(!x(V,s)){for(var u=[],_=0;_<s;_++)u[_]=\"a[\"+_+\"]\";V[s]=L(\"C,a\",\"return new C(\"+$(u,\",\")+\")\")}return V[s](o,i)}(s,i.length,i):s.apply(o,i)};return w(i)&&(j.prototype=i),j}},13930:(o,s,i)=>{\"use strict\";var u=i(41505),_=Function.prototype.call;o.exports=u?_.bind(_):function(){return _.apply(_,arguments)}},36833:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(49724),w=Function.prototype,x=u&&Object.getOwnPropertyDescriptor,C=_(w,\"name\"),j=C&&\"something\"===function something(){}.name,L=C&&(!u||u&&x(w,\"name\").configurable);o.exports={EXISTS:C,PROPER:j,CONFIGURABLE:L}},51871:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(82159);o.exports=function(o,s,i){try{return u(_(Object.getOwnPropertyDescriptor(o,s)[i]))}catch(o){}}},92361:(o,s,i)=>{\"use strict\";var u=i(45807),_=i(1907);o.exports=function(o){if(\"Function\"===u(o))return _(o)}},1907:(o,s,i)=>{\"use strict\";var u=i(41505),_=Function.prototype,w=_.call,x=u&&_.bind.bind(w,w);o.exports=u?x:function(o){return function(){return w.apply(o,arguments)}}},61747:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(92046);o.exports=function(o,s){var i=_[o+\"Prototype\"],w=i&&i[s];if(w)return w;var x=u[o],C=x&&x.prototype;return C&&C[s]}},85582:(o,s,i)=>{\"use strict\";var u=i(92046),_=i(41010),w=i(62250),aFunction=function(o){return w(o)?o:void 0};o.exports=function(o,s){return arguments.length<2?aFunction(u[o])||aFunction(_[o]):u[o]&&u[o][s]||_[o]&&_[o][s]}},73448:(o,s,i)=>{\"use strict\";var u=i(73948),_=i(29367),w=i(87136),x=i(93742),C=i(76264)(\"iterator\");o.exports=function(o){if(!w(o))return _(o,C)||_(o,\"@@iterator\")||x[u(o)]}},10300:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(82159),w=i(36624),x=i(4640),C=i(73448),j=TypeError;o.exports=function(o,s){var i=arguments.length<2?C(o):s;if(_(i))return w(u(i,o));throw new j(x(o)+\" is not iterable\")}},29367:(o,s,i)=>{\"use strict\";var u=i(82159),_=i(87136);o.exports=function(o,s){var i=o[s];return _(i)?void 0:u(i)}},41010:function(o,s,i){\"use strict\";var check=function(o){return o&&o.Math===Math&&o};o.exports=check(\"object\"==typeof globalThis&&globalThis)||check(\"object\"==typeof window&&window)||check(\"object\"==typeof self&&self)||check(\"object\"==typeof i.g&&i.g)||check(\"object\"==typeof this&&this)||function(){return this}()||Function(\"return this\")()},49724:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(39298),w=u({}.hasOwnProperty);o.exports=Object.hasOwn||function hasOwn(o,s){return w(_(o),s)}},38530:o=>{\"use strict\";o.exports={}},62416:(o,s,i)=>{\"use strict\";var u=i(85582);o.exports=u(\"document\",\"documentElement\")},73648:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(98828),w=i(49552);o.exports=!u&&!_((function(){return 7!==Object.defineProperty(w(\"div\"),\"a\",{get:function(){return 7}}).a}))},16946:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(98828),w=i(45807),x=Object,C=u(\"\".split);o.exports=_((function(){return!x(\"z\").propertyIsEnumerable(0)}))?function(o){return\"String\"===w(o)?C(o,\"\"):x(o)}:x},34084:(o,s,i)=>{\"use strict\";var u=i(62250),_=i(46285),w=i(79192);o.exports=function(o,s,i){var x,C;return w&&u(x=s.constructor)&&x!==i&&_(C=x.prototype)&&C!==i.prototype&&w(o,C),o}},12647:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(62250),w=i(36128),x=u(Function.toString);_(w.inspectSource)||(w.inspectSource=function(o){return x(o)}),o.exports=w.inspectSource},39259:(o,s,i)=>{\"use strict\";var u=i(46285),_=i(61626);o.exports=function(o,s){u(s)&&\"cause\"in s&&_(o,\"cause\",s.cause)}},64932:(o,s,i)=>{\"use strict\";var u,_,w,x=i(40551),C=i(41010),j=i(46285),L=i(61626),B=i(49724),$=i(36128),V=i(92522),U=i(38530),z=\"Object already initialized\",Y=C.TypeError,Z=C.WeakMap;if(x||$.state){var ee=$.state||($.state=new Z);ee.get=ee.get,ee.has=ee.has,ee.set=ee.set,u=function(o,s){if(ee.has(o))throw new Y(z);return s.facade=o,ee.set(o,s),s},_=function(o){return ee.get(o)||{}},w=function(o){return ee.has(o)}}else{var ie=V(\"state\");U[ie]=!0,u=function(o,s){if(B(o,ie))throw new Y(z);return s.facade=o,L(o,ie,s),s},_=function(o){return B(o,ie)?o[ie]:{}},w=function(o){return B(o,ie)}}o.exports={set:u,get:_,has:w,enforce:function(o){return w(o)?_(o):u(o,{})},getterFor:function(o){return function(s){var i;if(!j(s)||(i=_(s)).type!==o)throw new Y(\"Incompatible receiver, \"+o+\" required\");return i}}}},37812:(o,s,i)=>{\"use strict\";var u=i(76264),_=i(93742),w=u(\"iterator\"),x=Array.prototype;o.exports=function(o){return void 0!==o&&(_.Array===o||x[w]===o)}},62250:o=>{\"use strict\";var s=\"object\"==typeof document&&document.all;o.exports=void 0===s&&void 0!==s?function(o){return\"function\"==typeof o||o===s}:function(o){return\"function\"==typeof o}},25468:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(98828),w=i(62250),x=i(73948),C=i(85582),j=i(12647),noop=function(){},L=C(\"Reflect\",\"construct\"),B=/^\\s*(?:class|function)\\b/,$=u(B.exec),V=!B.test(noop),U=function isConstructor(o){if(!w(o))return!1;try{return L(noop,[],o),!0}catch(o){return!1}},z=function isConstructor(o){if(!w(o))return!1;switch(x(o)){case\"AsyncFunction\":case\"GeneratorFunction\":case\"AsyncGeneratorFunction\":return!1}try{return V||!!$(B,j(o))}catch(o){return!0}};z.sham=!0,o.exports=!L||_((function(){var o;return U(U.call)||!U(Object)||!U((function(){o=!0}))||o}))?z:U},7463:(o,s,i)=>{\"use strict\";var u=i(98828),_=i(62250),w=/#|\\.prototype\\./,isForced=function(o,s){var i=C[x(o)];return i===L||i!==j&&(_(s)?u(s):!!s)},x=isForced.normalize=function(o){return String(o).replace(w,\".\").toLowerCase()},C=isForced.data={},j=isForced.NATIVE=\"N\",L=isForced.POLYFILL=\"P\";o.exports=isForced},87136:o=>{\"use strict\";o.exports=function(o){return null==o}},46285:(o,s,i)=>{\"use strict\";var u=i(62250);o.exports=function(o){return\"object\"==typeof o?null!==o:u(o)}},54018:(o,s,i)=>{\"use strict\";var u=i(46285);o.exports=function(o){return u(o)||null===o}},7376:o=>{\"use strict\";o.exports=!0},72087:(o,s,i)=>{\"use strict\";var u=i(46285),_=i(45807),w=i(76264)(\"match\");o.exports=function(o){var s;return u(o)&&(void 0!==(s=o[w])?!!s:\"RegExp\"===_(o))}},25594:(o,s,i)=>{\"use strict\";var u=i(85582),_=i(62250),w=i(88280),x=i(51175),C=Object;o.exports=x?function(o){return\"symbol\"==typeof o}:function(o){var s=u(\"Symbol\");return _(s)&&w(s.prototype,C(o))}},24823:(o,s,i)=>{\"use strict\";var u=i(28311),_=i(13930),w=i(36624),x=i(4640),C=i(37812),j=i(20575),L=i(88280),B=i(10300),$=i(73448),V=i(40154),U=TypeError,Result=function(o,s){this.stopped=o,this.result=s},z=Result.prototype;o.exports=function(o,s,i){var Y,Z,ee,ie,ae,ce,le,pe=i&&i.that,de=!(!i||!i.AS_ENTRIES),fe=!(!i||!i.IS_RECORD),ye=!(!i||!i.IS_ITERATOR),be=!(!i||!i.INTERRUPTED),_e=u(s,pe),stop=function(o){return Y&&V(Y,\"normal\",o),new Result(!0,o)},callFn=function(o){return de?(w(o),be?_e(o[0],o[1],stop):_e(o[0],o[1])):be?_e(o,stop):_e(o)};if(fe)Y=o.iterator;else if(ye)Y=o;else{if(!(Z=$(o)))throw new U(x(o)+\" is not iterable\");if(C(Z)){for(ee=0,ie=j(o);ie>ee;ee++)if((ae=callFn(o[ee]))&&L(z,ae))return ae;return new Result(!1)}Y=B(o,Z)}for(ce=fe?o.next:Y.next;!(le=_(ce,Y)).done;){try{ae=callFn(le.value)}catch(o){V(Y,\"throw\",o)}if(\"object\"==typeof ae&&ae&&L(z,ae))return ae}return new Result(!1)}},40154:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(36624),w=i(29367);o.exports=function(o,s,i){var x,C;_(o);try{if(!(x=w(o,\"return\"))){if(\"throw\"===s)throw i;return i}x=u(x,o)}catch(o){C=!0,x=o}if(\"throw\"===s)throw i;if(C)throw x;return _(x),i}},47181:(o,s,i)=>{\"use strict\";var u=i(95116).IteratorPrototype,_=i(58075),w=i(75817),x=i(14840),C=i(93742),returnThis=function(){return this};o.exports=function(o,s,i,j){var L=s+\" Iterator\";return o.prototype=_(u,{next:w(+!j,i)}),x(o,L,!1,!0),C[L]=returnThis,o}},60183:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(13930),w=i(7376),x=i(36833),C=i(62250),j=i(47181),L=i(15972),B=i(79192),$=i(14840),V=i(61626),U=i(68055),z=i(76264),Y=i(93742),Z=i(95116),ee=x.PROPER,ie=x.CONFIGURABLE,ae=Z.IteratorPrototype,ce=Z.BUGGY_SAFARI_ITERATORS,le=z(\"iterator\"),pe=\"keys\",de=\"values\",fe=\"entries\",returnThis=function(){return this};o.exports=function(o,s,i,x,z,Z,ye){j(i,s,x);var be,_e,we,getIterationMethod=function(o){if(o===z&&Re)return Re;if(!ce&&o&&o in Pe)return Pe[o];switch(o){case pe:return function keys(){return new i(this,o)};case de:return function values(){return new i(this,o)};case fe:return function entries(){return new i(this,o)}}return function(){return new i(this)}},Se=s+\" Iterator\",xe=!1,Pe=o.prototype,Te=Pe[le]||Pe[\"@@iterator\"]||z&&Pe[z],Re=!ce&&Te||getIterationMethod(z),qe=\"Array\"===s&&Pe.entries||Te;if(qe&&(be=L(qe.call(new o)))!==Object.prototype&&be.next&&(w||L(be)===ae||(B?B(be,ae):C(be[le])||U(be,le,returnThis)),$(be,Se,!0,!0),w&&(Y[Se]=returnThis)),ee&&z===de&&Te&&Te.name!==de&&(!w&&ie?V(Pe,\"name\",de):(xe=!0,Re=function values(){return _(Te,this)})),z)if(_e={values:getIterationMethod(de),keys:Z?Re:getIterationMethod(pe),entries:getIterationMethod(fe)},ye)for(we in _e)(ce||xe||!(we in Pe))&&U(Pe,we,_e[we]);else u({target:s,proto:!0,forced:ce||xe},_e);return w&&!ye||Pe[le]===Re||U(Pe,le,Re,{name:z}),Y[s]=Re,_e}},95116:(o,s,i)=>{\"use strict\";var u,_,w,x=i(98828),C=i(62250),j=i(46285),L=i(58075),B=i(15972),$=i(68055),V=i(76264),U=i(7376),z=V(\"iterator\"),Y=!1;[].keys&&(\"next\"in(w=[].keys())?(_=B(B(w)))!==Object.prototype&&(u=_):Y=!0),!j(u)||x((function(){var o={};return u[z].call(o)!==o}))?u={}:U&&(u=L(u)),C(u[z])||$(u,z,(function(){return this})),o.exports={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:Y}},93742:o=>{\"use strict\";o.exports={}},20575:(o,s,i)=>{\"use strict\";var u=i(3121);o.exports=function(o){return u(o.length)}},41176:o=>{\"use strict\";var s=Math.ceil,i=Math.floor;o.exports=Math.trunc||function trunc(o){var u=+o;return(u>0?i:s)(u)}},32096:(o,s,i)=>{\"use strict\";var u=i(90160);o.exports=function(o,s){return void 0===o?arguments.length<2?\"\":s:u(o)}},29538:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(1907),w=i(13930),x=i(98828),C=i(2875),j=i(87170),L=i(22574),B=i(39298),$=i(16946),V=Object.assign,U=Object.defineProperty,z=_([].concat);o.exports=!V||x((function(){if(u&&1!==V({b:1},V(U({},\"a\",{enumerable:!0,get:function(){U(this,\"b\",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var o={},s={},i=Symbol(\"assign detection\"),_=\"abcdefghijklmnopqrst\";return o[i]=7,_.split(\"\").forEach((function(o){s[o]=o})),7!==V({},o)[i]||C(V({},s)).join(\"\")!==_}))?function assign(o,s){for(var i=B(o),_=arguments.length,x=1,V=j.f,U=L.f;_>x;)for(var Y,Z=$(arguments[x++]),ee=V?z(C(Z),V(Z)):C(Z),ie=ee.length,ae=0;ie>ae;)Y=ee[ae++],u&&!w(U,Z,Y)||(i[Y]=Z[Y]);return i}:V},58075:(o,s,i)=>{\"use strict\";var u,_=i(36624),w=i(42220),x=i(80376),C=i(38530),j=i(62416),L=i(49552),B=i(92522),$=\"prototype\",V=\"script\",U=B(\"IE_PROTO\"),EmptyConstructor=function(){},scriptTag=function(o){return\"<\"+V+\">\"+o+\"</\"+V+\">\"},NullProtoObjectViaActiveX=function(o){o.write(scriptTag(\"\")),o.close();var s=o.parentWindow.Object;return o=null,s},NullProtoObject=function(){try{u=new ActiveXObject(\"htmlfile\")}catch(o){}var o,s,i;NullProtoObject=\"undefined\"!=typeof document?document.domain&&u?NullProtoObjectViaActiveX(u):(s=L(\"iframe\"),i=\"java\"+V+\":\",s.style.display=\"none\",j.appendChild(s),s.src=String(i),(o=s.contentWindow.document).open(),o.write(scriptTag(\"document.F=Object\")),o.close(),o.F):NullProtoObjectViaActiveX(u);for(var _=x.length;_--;)delete NullProtoObject[$][x[_]];return NullProtoObject()};C[U]=!0,o.exports=Object.create||function create(o,s){var i;return null!==o?(EmptyConstructor[$]=_(o),i=new EmptyConstructor,EmptyConstructor[$]=null,i[U]=o):i=NullProtoObject(),void 0===s?i:w.f(i,s)}},42220:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(58661),w=i(74284),x=i(36624),C=i(4993),j=i(2875);s.f=u&&!_?Object.defineProperties:function defineProperties(o,s){x(o);for(var i,u=C(s),_=j(s),L=_.length,B=0;L>B;)w.f(o,i=_[B++],u[i]);return o}},74284:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(73648),w=i(58661),x=i(36624),C=i(70470),j=TypeError,L=Object.defineProperty,B=Object.getOwnPropertyDescriptor,$=\"enumerable\",V=\"configurable\",U=\"writable\";s.f=u?w?function defineProperty(o,s,i){if(x(o),s=C(s),x(i),\"function\"==typeof o&&\"prototype\"===s&&\"value\"in i&&U in i&&!i[U]){var u=B(o,s);u&&u[U]&&(o[s]=i.value,i={configurable:V in i?i[V]:u[V],enumerable:$ in i?i[$]:u[$],writable:!1})}return L(o,s,i)}:L:function defineProperty(o,s,i){if(x(o),s=C(s),x(i),_)try{return L(o,s,i)}catch(o){}if(\"get\"in i||\"set\"in i)throw new j(\"Accessors not supported\");return\"value\"in i&&(o[s]=i.value),o}},13846:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(13930),w=i(22574),x=i(75817),C=i(4993),j=i(70470),L=i(49724),B=i(73648),$=Object.getOwnPropertyDescriptor;s.f=u?$:function getOwnPropertyDescriptor(o,s){if(o=C(o),s=j(s),B)try{return $(o,s)}catch(o){}if(L(o,s))return x(!_(w.f,o,s),o[s])}},24443:(o,s,i)=>{\"use strict\";var u=i(23045),_=i(80376).concat(\"length\",\"prototype\");s.f=Object.getOwnPropertyNames||function getOwnPropertyNames(o){return u(o,_)}},87170:(o,s)=>{\"use strict\";s.f=Object.getOwnPropertySymbols},15972:(o,s,i)=>{\"use strict\";var u=i(49724),_=i(62250),w=i(39298),x=i(92522),C=i(57382),j=x(\"IE_PROTO\"),L=Object,B=L.prototype;o.exports=C?L.getPrototypeOf:function(o){var s=w(o);if(u(s,j))return s[j];var i=s.constructor;return _(i)&&s instanceof i?i.prototype:s instanceof L?B:null}},88280:(o,s,i)=>{\"use strict\";var u=i(1907);o.exports=u({}.isPrototypeOf)},23045:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(49724),w=i(4993),x=i(74436).indexOf,C=i(38530),j=u([].push);o.exports=function(o,s){var i,u=w(o),L=0,B=[];for(i in u)!_(C,i)&&_(u,i)&&j(B,i);for(;s.length>L;)_(u,i=s[L++])&&(~x(B,i)||j(B,i));return B}},2875:(o,s,i)=>{\"use strict\";var u=i(23045),_=i(80376);o.exports=Object.keys||function keys(o){return u(o,_)}},22574:(o,s)=>{\"use strict\";var i={}.propertyIsEnumerable,u=Object.getOwnPropertyDescriptor,_=u&&!i.call({1:2},1);s.f=_?function propertyIsEnumerable(o){var s=u(this,o);return!!s&&s.enumerable}:i},79192:(o,s,i)=>{\"use strict\";var u=i(51871),_=i(46285),w=i(74239),x=i(10043);o.exports=Object.setPrototypeOf||(\"__proto__\"in{}?function(){var o,s=!1,i={};try{(o=u(Object.prototype,\"__proto__\",\"set\"))(i,[]),s=i instanceof Array}catch(o){}return function setPrototypeOf(i,u){return w(i),x(u),_(i)?(s?o(i,u):i.__proto__=u,i):i}}():void 0)},54878:(o,s,i)=>{\"use strict\";var u=i(52623),_=i(73948);o.exports=u?{}.toString:function toString(){return\"[object \"+_(this)+\"]\"}},60581:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(62250),w=i(46285),x=TypeError;o.exports=function(o,s){var i,C;if(\"string\"===s&&_(i=o.toString)&&!w(C=u(i,o)))return C;if(_(i=o.valueOf)&&!w(C=u(i,o)))return C;if(\"string\"!==s&&_(i=o.toString)&&!w(C=u(i,o)))return C;throw new x(\"Can't convert object to primitive value\")}},11042:(o,s,i)=>{\"use strict\";var u=i(85582),_=i(1907),w=i(24443),x=i(87170),C=i(36624),j=_([].concat);o.exports=u(\"Reflect\",\"ownKeys\")||function ownKeys(o){var s=w.f(C(o)),i=x.f;return i?j(s,i(o)):s}},92046:o=>{\"use strict\";o.exports={}},54829:(o,s,i)=>{\"use strict\";var u=i(74284).f;o.exports=function(o,s,i){i in o||u(o,i,{configurable:!0,get:function(){return s[i]},set:function(o){s[i]=o}})}},70971:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(36624),w=i(62250),x=i(45807),C=i(16820),j=TypeError;o.exports=function(o,s){var i=o.exec;if(w(i)){var L=u(i,o,s);return null!==L&&_(L),L}if(\"RegExp\"===x(o))return u(C,o,s);throw new j(\"RegExp#exec called on incompatible receiver\")}},16820:o=>{\"use strict\";o.exports=/./.exec},85606:(o,s,i)=>{\"use strict\";var u=i(36624);o.exports=function(){var o=u(this),s=\"\";return o.hasIndices&&(s+=\"d\"),o.global&&(s+=\"g\"),o.ignoreCase&&(s+=\"i\"),o.multiline&&(s+=\"m\"),o.dotAll&&(s+=\"s\"),o.unicode&&(s+=\"u\"),o.unicodeSets&&(s+=\"v\"),o.sticky&&(s+=\"y\"),s}},40663:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(49724),w=i(88280),x=i(85606),C=RegExp.prototype;o.exports=function(o){var s=o.flags;return void 0!==s||\"flags\"in C||_(o,\"flags\")||!w(C,o)?s:u(x,o)}},74239:(o,s,i)=>{\"use strict\";var u=i(87136),_=TypeError;o.exports=function(o){if(u(o))throw new _(\"Can't call method on \"+o);return o}},14840:(o,s,i)=>{\"use strict\";var u=i(52623),_=i(74284).f,w=i(61626),x=i(49724),C=i(54878),j=i(76264)(\"toStringTag\");o.exports=function(o,s,i,L){var B=i?o:o&&o.prototype;B&&(x(B,j)||_(B,j,{configurable:!0,value:s}),L&&!u&&w(B,\"toString\",C))}},92522:(o,s,i)=>{\"use strict\";var u=i(85816),_=i(6499),w=u(\"keys\");o.exports=function(o){return w[o]||(w[o]=_(o))}},36128:(o,s,i)=>{\"use strict\";var u=i(7376),_=i(41010),w=i(2532),x=\"__core-js_shared__\",C=o.exports=_[x]||w(x,{});(C.versions||(C.versions=[])).push({version:\"3.37.1\",mode:u?\"pure\":\"global\",copyright:\"© 2014-2024 Denis Pushkarev (zloirock.ru)\",license:\"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE\",source:\"https://github.com/zloirock/core-js\"})},85816:(o,s,i)=>{\"use strict\";var u=i(36128);o.exports=function(o,s){return u[o]||(u[o]=s||{})}},28450:(o,s,i)=>{\"use strict\";var u=i(36624),_=i(82235),w=i(87136),x=i(76264)(\"species\");o.exports=function(o,s){var i,C=u(o).constructor;return void 0===C||w(i=u(C)[x])?s:_(i)}},11470:(o,s,i)=>{\"use strict\";var u=i(1907),_=i(65482),w=i(90160),x=i(74239),C=u(\"\".charAt),j=u(\"\".charCodeAt),L=u(\"\".slice),createMethod=function(o){return function(s,i){var u,B,$=w(x(s)),V=_(i),U=$.length;return V<0||V>=U?o?\"\":void 0:(u=j($,V))<55296||u>56319||V+1===U||(B=j($,V+1))<56320||B>57343?o?C($,V):u:o?L($,V,V+2):B-56320+(u-55296<<10)+65536}};o.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},19846:(o,s,i)=>{\"use strict\";var u=i(15683),_=i(98828),w=i(41010).String;o.exports=!!Object.getOwnPropertySymbols&&!_((function(){var o=Symbol(\"symbol detection\");return!w(o)||!(Object(o)instanceof Symbol)||!Symbol.sham&&u&&u<41}))},34849:(o,s,i)=>{\"use strict\";var u=i(65482),_=Math.max,w=Math.min;o.exports=function(o,s){var i=u(o);return i<0?_(i+s,0):w(i,s)}},4993:(o,s,i)=>{\"use strict\";var u=i(16946),_=i(74239);o.exports=function(o){return u(_(o))}},65482:(o,s,i)=>{\"use strict\";var u=i(41176);o.exports=function(o){var s=+o;return s!=s||0===s?0:u(s)}},3121:(o,s,i)=>{\"use strict\";var u=i(65482),_=Math.min;o.exports=function(o){var s=u(o);return s>0?_(s,9007199254740991):0}},39298:(o,s,i)=>{\"use strict\";var u=i(74239),_=Object;o.exports=function(o){return _(u(o))}},46028:(o,s,i)=>{\"use strict\";var u=i(13930),_=i(46285),w=i(25594),x=i(29367),C=i(60581),j=i(76264),L=TypeError,B=j(\"toPrimitive\");o.exports=function(o,s){if(!_(o)||w(o))return o;var i,j=x(o,B);if(j){if(void 0===s&&(s=\"default\"),i=u(j,o,s),!_(i)||w(i))return i;throw new L(\"Can't convert object to primitive value\")}return void 0===s&&(s=\"number\"),C(o,s)}},70470:(o,s,i)=>{\"use strict\";var u=i(46028),_=i(25594);o.exports=function(o){var s=u(o,\"string\");return _(s)?s:s+\"\"}},52623:(o,s,i)=>{\"use strict\";var u={};u[i(76264)(\"toStringTag\")]=\"z\",o.exports=\"[object z]\"===String(u)},90160:(o,s,i)=>{\"use strict\";var u=i(73948),_=String;o.exports=function(o){if(\"Symbol\"===u(o))throw new TypeError(\"Cannot convert a Symbol value to a string\");return _(o)}},4640:o=>{\"use strict\";var s=String;o.exports=function(o){try{return s(o)}catch(o){return\"Object\"}}},6499:(o,s,i)=>{\"use strict\";var u=i(1907),_=0,w=Math.random(),x=u(1..toString);o.exports=function(o){return\"Symbol(\"+(void 0===o?\"\":o)+\")_\"+x(++_+w,36)}},51175:(o,s,i)=>{\"use strict\";var u=i(19846);o.exports=u&&!Symbol.sham&&\"symbol\"==typeof Symbol.iterator},58661:(o,s,i)=>{\"use strict\";var u=i(39447),_=i(98828);o.exports=u&&_((function(){return 42!==Object.defineProperty((function(){}),\"prototype\",{value:42,writable:!1}).prototype}))},40551:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(62250),w=u.WeakMap;o.exports=_(w)&&/native code/.test(String(w))},76264:(o,s,i)=>{\"use strict\";var u=i(41010),_=i(85816),w=i(49724),x=i(6499),C=i(19846),j=i(51175),L=u.Symbol,B=_(\"wks\"),$=j?L.for||L:L&&L.withoutSetter||x;o.exports=function(o){return w(B,o)||(B[o]=C&&w(L,o)?L[o]:$(\"Symbol.\"+o)),B[o]}},19358:(o,s,i)=>{\"use strict\";var u=i(85582),_=i(49724),w=i(61626),x=i(88280),C=i(79192),j=i(19595),L=i(54829),B=i(34084),$=i(32096),V=i(39259),U=i(85884),z=i(39447),Y=i(7376);o.exports=function(o,s,i,Z){var ee=\"stackTraceLimit\",ie=Z?2:1,ae=o.split(\".\"),ce=ae[ae.length-1],le=u.apply(null,ae);if(le){var pe=le.prototype;if(!Y&&_(pe,\"cause\")&&delete pe.cause,!i)return le;var de=u(\"Error\"),fe=s((function(o,s){var i=$(Z?s:o,void 0),u=Z?new le(o):new le;return void 0!==i&&w(u,\"message\",i),U(u,fe,u.stack,2),this&&x(pe,this)&&B(u,this,fe),arguments.length>ie&&V(u,arguments[ie]),u}));if(fe.prototype=pe,\"Error\"!==ce?C?C(fe,de):j(fe,de,{name:!0}):z&&ee in le&&(L(fe,le,ee),L(fe,le,\"prepareStackTrace\")),j(fe,le),!Y)try{pe.name!==ce&&w(pe,\"name\",ce),pe.constructor=fe}catch(o){}return fe}}},36371:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(85582),w=i(76024),x=i(98828),C=i(19358),j=\"AggregateError\",L=_(j),B=!x((function(){return 1!==L([1]).errors[0]}))&&x((function(){return 7!==L([1],j,{cause:7}).cause}));u({global:!0,constructor:!0,arity:2,forced:B},{AggregateError:C(j,(function(o){return function AggregateError(s,i){return w(o,this,arguments)}}),B,!0)})},82048:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(88280),w=i(15972),x=i(79192),C=i(19595),j=i(58075),L=i(61626),B=i(75817),$=i(39259),V=i(85884),U=i(24823),z=i(32096),Y=i(76264)(\"toStringTag\"),Z=Error,ee=[].push,ie=function AggregateError(o,s){var i,u=_(ae,this);x?i=x(new Z,u?w(this):ae):(i=u?this:j(ae),L(i,Y,\"Error\")),void 0!==s&&L(i,\"message\",z(s)),V(i,ie,i.stack,1),arguments.length>2&&$(i,arguments[2]);var C=[];return U(o,ee,{that:C}),L(i,\"errors\",C),i};x?x(ie,Z):C(ie,Z,{name:!0});var ae=ie.prototype=j(Z.prototype,{constructor:B(1,ie),message:B(1,\"\"),name:B(1,\"AggregateError\")});u({global:!0,constructor:!0,arity:2},{AggregateError:ie})},64502:(o,s,i)=>{\"use strict\";i(82048)},99363:(o,s,i)=>{\"use strict\";var u=i(4993),_=i(42156),w=i(93742),x=i(64932),C=i(74284).f,j=i(60183),L=i(59550),B=i(7376),$=i(39447),V=\"Array Iterator\",U=x.set,z=x.getterFor(V);o.exports=j(Array,\"Array\",(function(o,s){U(this,{type:V,target:u(o),index:0,kind:s})}),(function(){var o=z(this),s=o.target,i=o.index++;if(!s||i>=s.length)return o.target=void 0,L(void 0,!0);switch(o.kind){case\"keys\":return L(i,!1);case\"values\":return L(s[i],!1)}return L([i,s[i]],!1)}),\"values\");var Y=w.Arguments=w.Array;if(_(\"keys\"),_(\"values\"),_(\"entries\"),!B&&$&&\"values\"!==Y.name)try{C(Y,\"name\",{value:\"values\"})}catch(o){}},96605:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(41010),w=i(76024),x=i(19358),C=\"WebAssembly\",j=_[C],L=7!==new Error(\"e\",{cause:7}).cause,exportGlobalErrorCauseWrapper=function(o,s){var i={};i[o]=x(o,s,L),u({global:!0,constructor:!0,arity:1,forced:L},i)},exportWebAssemblyErrorCauseWrapper=function(o,s){if(j&&j[o]){var i={};i[o]=x(C+\".\"+o,s,L),u({target:C,stat:!0,constructor:!0,arity:1,forced:L},i)}};exportGlobalErrorCauseWrapper(\"Error\",(function(o){return function Error(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"EvalError\",(function(o){return function EvalError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"RangeError\",(function(o){return function RangeError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"ReferenceError\",(function(o){return function ReferenceError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"SyntaxError\",(function(o){return function SyntaxError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"TypeError\",(function(o){return function TypeError(s){return w(o,this,arguments)}})),exportGlobalErrorCauseWrapper(\"URIError\",(function(o){return function URIError(s){return w(o,this,arguments)}})),exportWebAssemblyErrorCauseWrapper(\"CompileError\",(function(o){return function CompileError(s){return w(o,this,arguments)}})),exportWebAssemblyErrorCauseWrapper(\"LinkError\",(function(o){return function LinkError(s){return w(o,this,arguments)}})),exportWebAssemblyErrorCauseWrapper(\"RuntimeError\",(function(o){return function RuntimeError(s){return w(o,this,arguments)}}))},79307:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(44673);u({target:\"Function\",proto:!0,forced:Function.bind!==_},{bind:_})},71340:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(29538);u({target:\"Object\",stat:!0,arity:2,forced:Object.assign!==_},{assign:_})},86024:()=>{},51398:()=>{},7057:(o,s,i)=>{\"use strict\";var u=i(11470).charAt,_=i(90160),w=i(64932),x=i(60183),C=i(59550),j=\"String Iterator\",L=w.set,B=w.getterFor(j);x(String,\"String\",(function(o){L(this,{type:j,string:_(o),index:0})}),(function next(){var o,s=B(this),i=s.string,_=s.index;return _>=i.length?C(void 0,!0):(o=u(i,_),s.index+=o.length,C(o,!1))}))},79104:(o,s,i)=>{\"use strict\";var u=i(11091),_=i(13930),w=i(92361),x=i(47181),C=i(59550),j=i(74239),L=i(3121),B=i(90160),$=i(36624),V=i(87136),U=i(45807),z=i(72087),Y=i(40663),Z=i(29367),ee=i(68055),ie=i(98828),ae=i(76264),ce=i(28450),le=i(25592),pe=i(70971),de=i(64932),fe=i(7376),ye=ae(\"matchAll\"),be=\"RegExp String\",_e=be+\" Iterator\",we=de.set,Se=de.getterFor(_e),xe=RegExp.prototype,Pe=TypeError,Te=w(\"\".indexOf),Re=w(\"\".matchAll),qe=!!Re&&!ie((function(){Re(\"a\",/./)})),$e=x((function RegExpStringIterator(o,s,i,u){we(this,{type:_e,regexp:o,string:s,global:i,unicode:u,done:!1})}),be,(function next(){var o=Se(this);if(o.done)return C(void 0,!0);var s=o.regexp,i=o.string,u=pe(s,i);return null===u?(o.done=!0,C(void 0,!0)):o.global?(\"\"===B(u[0])&&(s.lastIndex=le(i,L(s.lastIndex),o.unicode)),C(u,!1)):(o.done=!0,C(u,!1))})),$matchAll=function(o){var s,i,u,_=$(this),w=B(o),x=ce(_,RegExp),C=B(Y(_));return s=new x(x===RegExp?_.source:_,C),i=!!~Te(C,\"g\"),u=!!~Te(C,\"u\"),s.lastIndex=L(_.lastIndex),new $e(s,w,i,u)};u({target:\"String\",proto:!0,forced:qe},{matchAll:function matchAll(o){var s,i,u,w,x=j(this);if(V(o)){if(qe)return Re(x,o)}else{if(z(o)&&(s=B(j(Y(o))),!~Te(s,\"g\")))throw new Pe(\"`.matchAll` does not allow non-global regexes\");if(qe)return Re(x,o);if(void 0===(u=Z(o,ye))&&fe&&\"RegExp\"===U(o)&&(u=$matchAll),u)return _(u,o,x)}return i=B(x),w=new RegExp(o,\"g\"),fe?_($matchAll,w,i):w[ye](i)}}),fe||ye in xe||ee(xe,ye,$matchAll)},91599:(o,s,i)=>{\"use strict\";i(64502)},37347:(o,s,i)=>{\"use strict\";i(79104)},12560:(o,s,i)=>{\"use strict\";i(99363);var u=i(19287),_=i(41010),w=i(14840),x=i(93742);for(var C in u)w(_[C],C),x[C]=x.Array},694:(o,s,i)=>{\"use strict\";i(91599);var u=i(37257);i(12560),o.exports=u},19709:(o,s,i)=>{\"use strict\";var u=i(23034);o.exports=u},96203:(o,s,i)=>{\"use strict\";var u=i(3258);o.exports=u},40975:(o,s,i)=>{\"use strict\";var u=i(9748);o.exports=u}},u={};function __webpack_require__(o){var s=u[o];if(void 0!==s)return s.exports;var _=u[o]={id:o,loaded:!1,exports:{}};return i[o].call(_.exports,_,_.exports,__webpack_require__),_.loaded=!0,_.exports}__webpack_require__.n=o=>{var s=o&&o.__esModule?()=>o.default:()=>o;return __webpack_require__.d(s,{a:s}),s},s=Object.getPrototypeOf?o=>Object.getPrototypeOf(o):o=>o.__proto__,__webpack_require__.t=function(i,u){if(1&u&&(i=this(i)),8&u)return i;if(\"object\"==typeof i&&i){if(4&u&&i.__esModule)return i;if(16&u&&\"function\"==typeof i.then)return i}var _=Object.create(null);__webpack_require__.r(_);var w={};o=o||[null,s({}),s([]),s(s)];for(var x=2&u&&i;\"object\"==typeof x&&!~o.indexOf(x);x=s(x))Object.getOwnPropertyNames(x).forEach((o=>w[o]=()=>i[o]));return w.default=()=>i,__webpack_require__.d(_,w),_},__webpack_require__.d=(o,s)=>{for(var i in s)__webpack_require__.o(s,i)&&!__webpack_require__.o(o,i)&&Object.defineProperty(o,i,{enumerable:!0,get:s[i]})},__webpack_require__.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(o){if(\"object\"==typeof window)return window}}(),__webpack_require__.o=(o,s)=>Object.prototype.hasOwnProperty.call(o,s),__webpack_require__.r=o=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(o,\"__esModule\",{value:!0})},__webpack_require__.nmd=o=>(o.paths=[],o.children||(o.children=[]),o);var _={};(()=>{\"use strict\";__webpack_require__.d(_,{default:()=>kI});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{CLEAR:()=>st,CLEAR_BY:()=>it,NEW_AUTH_ERR:()=>ot,NEW_SPEC_ERR:()=>rt,NEW_SPEC_ERR_BATCH:()=>nt,NEW_THROWN_ERR:()=>et,NEW_THROWN_ERR_BATCH:()=>tt,clear:()=>clear,clearBy:()=>clearBy,newAuthErr:()=>newAuthErr,newSpecErr:()=>newSpecErr,newSpecErrBatch:()=>newSpecErrBatch,newThrownErr:()=>newThrownErr,newThrownErrBatch:()=>newThrownErrBatch});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{AUTHORIZE:()=>Tt,AUTHORIZE_OAUTH2:()=>Lt,CONFIGURE_AUTH:()=>Ft,LOGOUT:()=>Rt,PRE_AUTHORIZE_OAUTH2:()=>Dt,RESTORE_AUTHORIZATION:()=>qt,SHOW_AUTH_POPUP:()=>Nt,VALIDATE:()=>Bt,authPopup:()=>authPopup,authorize:()=>authorize,authorizeAccessCodeWithBasicAuthentication:()=>authorizeAccessCodeWithBasicAuthentication,authorizeAccessCodeWithFormParams:()=>authorizeAccessCodeWithFormParams,authorizeApplication:()=>authorizeApplication,authorizeOauth2:()=>authorizeOauth2,authorizeOauth2WithPersistOption:()=>authorizeOauth2WithPersistOption,authorizePassword:()=>authorizePassword,authorizeRequest:()=>authorizeRequest,authorizeWithPersistOption:()=>authorizeWithPersistOption,configureAuth:()=>configureAuth,logout:()=>logout,logoutWithPersistOption:()=>logoutWithPersistOption,persistAuthorizationIfNeeded:()=>persistAuthorizationIfNeeded,preAuthorizeImplicit:()=>preAuthorizeImplicit,restoreAuthorization:()=>restoreAuthorization,showDefinitions:()=>showDefinitions});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{authorized:()=>Gt,definitionsForRequirements:()=>definitionsForRequirements,definitionsToAuthorize:()=>Jt,getConfigs:()=>Yt,getDefinitionsByNames:()=>getDefinitionsByNames,isAuthorized:()=>isAuthorized,shownDefinitions:()=>Ht});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{TOGGLE_CONFIGS:()=>no,UPDATE_CONFIGS:()=>ro,downloadConfig:()=>downloadConfig,getConfigByUrl:()=>getConfigByUrl,loaded:()=>actions_loaded,toggle:()=>toggle,update:()=>update});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{get:()=>get});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{transform:()=>transform});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{transform:()=>parameter_oneof_transform});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{allErrors:()=>bo,lastError:()=>_o});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{SHOW:()=>Oo,UPDATE_FILTER:()=>xo,UPDATE_LAYOUT:()=>So,UPDATE_MODE:()=>ko,changeMode:()=>changeMode,show:()=>actions_show,updateFilter:()=>updateFilter,updateLayout:()=>updateLayout});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{current:()=>current,currentFilter:()=>currentFilter,isShown:()=>isShown,showSummary:()=>Ao,whatMode:()=>whatMode});var $={};__webpack_require__.r($),__webpack_require__.d($,{taggedOperations:()=>taggedOperations});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{requestSnippetGenerator_curl_bash:()=>requestSnippetGenerator_curl_bash,requestSnippetGenerator_curl_cmd:()=>requestSnippetGenerator_curl_cmd,requestSnippetGenerator_curl_powershell:()=>requestSnippetGenerator_curl_powershell});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{getActiveLanguage:()=>Io,getDefaultExpanded:()=>Mo,getGenerators:()=>Po,getSnippetGenerators:()=>getSnippetGenerators});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{JsonSchemaArrayItemFile:()=>JsonSchemaArrayItemFile,JsonSchemaArrayItemText:()=>JsonSchemaArrayItemText,JsonSchemaForm:()=>JsonSchemaForm,JsonSchema_array:()=>JsonSchema_array,JsonSchema_boolean:()=>JsonSchema_boolean,JsonSchema_object:()=>JsonSchema_object,JsonSchema_string:()=>JsonSchema_string});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{allowTryItOutFor:()=>allowTryItOutFor,basePath:()=>Ns,canExecuteScheme:()=>canExecuteScheme,consumes:()=>As,consumesOptionsFor:()=>consumesOptionsFor,contentTypeValues:()=>contentTypeValues,currentProducesFor:()=>currentProducesFor,definitions:()=>Ms,externalDocs:()=>ws,findDefinition:()=>findDefinition,getOAS3RequiredRequestBodyContentType:()=>getOAS3RequiredRequestBodyContentType,getParameter:()=>getParameter,hasHost:()=>Vs,host:()=>Ts,info:()=>Es,isMediaTypeSchemaPropertiesEqual:()=>isMediaTypeSchemaPropertiesEqual,isOAS3:()=>_s,lastError:()=>hs,mutatedRequestFor:()=>mutatedRequestFor,mutatedRequests:()=>$s,operationScheme:()=>operationScheme,operationWithMeta:()=>operationWithMeta,operations:()=>Cs,operationsWithRootInherited:()=>Ds,operationsWithTags:()=>Bs,parameterInclusionSettingFor:()=>parameterInclusionSettingFor,parameterValues:()=>parameterValues,parameterWithMeta:()=>parameterWithMeta,parameterWithMetaByIdentity:()=>parameterWithMetaByIdentity,parametersIncludeIn:()=>parametersIncludeIn,parametersIncludeType:()=>parametersIncludeType,paths:()=>ks,produces:()=>js,producesOptionsFor:()=>producesOptionsFor,requestFor:()=>requestFor,requests:()=>qs,responseFor:()=>responseFor,responses:()=>Fs,schemes:()=>Rs,security:()=>Ps,securityDefinitions:()=>Is,semver:()=>xs,spec:()=>spec,specJS:()=>ys,specJson:()=>gs,specJsonWithResolvedSubtrees:()=>bs,specResolved:()=>vs,specResolvedSubtree:()=>specResolvedSubtree,specSource:()=>ms,specStr:()=>fs,tagDetails:()=>tagDetails,taggedOperations:()=>selectors_taggedOperations,tags:()=>Ls,url:()=>ds,validOperationMethods:()=>Os,validateBeforeExecute:()=>validateBeforeExecute,validationErrors:()=>validationErrors,version:()=>Ss});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{CLEAR_REQUEST:()=>ra,CLEAR_RESPONSE:()=>ea,CLEAR_VALIDATE_PARAMS:()=>na,LOG_REQUEST:()=>Wi,SET_MUTATED_REQUEST:()=>Ri,SET_REQUEST:()=>Mi,SET_RESPONSE:()=>Pi,SET_SCHEME:()=>la,UPDATE_EMPTY_PARAM_INCLUSION:()=>Ei,UPDATE_JSON:()=>Zs,UPDATE_OPERATION_META_VALUE:()=>ia,UPDATE_PARAM:()=>_i,UPDATE_RESOLVED:()=>aa,UPDATE_RESOLVED_SUBTREE:()=>ca,UPDATE_SPEC:()=>Xs,UPDATE_URL:()=>Qs,VALIDATE_PARAMS:()=>Oi,changeConsumesValue:()=>changeConsumesValue,changeParam:()=>changeParam,changeParamByIdentity:()=>changeParamByIdentity,changeProducesValue:()=>changeProducesValue,clearRequest:()=>clearRequest,clearResponse:()=>clearResponse,clearValidateParams:()=>clearValidateParams,execute:()=>actions_execute,executeRequest:()=>executeRequest,invalidateResolvedSubtreeCache:()=>invalidateResolvedSubtreeCache,logRequest:()=>logRequest,parseToJson:()=>parseToJson,requestResolvedSubtree:()=>requestResolvedSubtree,resolveSpec:()=>resolveSpec,setMutatedRequest:()=>setMutatedRequest,setRequest:()=>setRequest,setResponse:()=>setResponse,setScheme:()=>setScheme,updateEmptyParamInclusion:()=>updateEmptyParamInclusion,updateJsonSpec:()=>updateJsonSpec,updateResolved:()=>updateResolved,updateResolvedSubtree:()=>updateResolvedSubtree,updateSpec:()=>updateSpec,updateUrl:()=>updateUrl,validateParams:()=>validateParams});var ee={};__webpack_require__.r(ee),__webpack_require__.d(ee,{executeRequest:()=>wrap_actions_executeRequest,updateJsonSpec:()=>wrap_actions_updateJsonSpec,updateSpec:()=>wrap_actions_updateSpec,validateParams:()=>wrap_actions_validateParams});var ie={};__webpack_require__.r(ie),__webpack_require__.d(ie,{JsonPatchError:()=>_a,_areEquals:()=>_areEquals,applyOperation:()=>applyOperation,applyPatch:()=>applyPatch,applyReducer:()=>applyReducer,deepClone:()=>Ea,getValueByPointer:()=>getValueByPointer,validate:()=>validate,validator:()=>validator});var ae={};__webpack_require__.r(ae),__webpack_require__.d(ae,{compare:()=>compare,generate:()=>generate,observe:()=>observe,unobserve:()=>unobserve});var ce={};__webpack_require__.r(ce),__webpack_require__.d(ce,{hasElementSourceMap:()=>hasElementSourceMap,includesClasses:()=>includesClasses,includesSymbols:()=>includesSymbols,isAnnotationElement:()=>gp,isArrayElement:()=>hp,isBooleanElement:()=>up,isCommentElement:()=>yp,isElement:()=>sp,isLinkElement:()=>fp,isMemberElement:()=>dp,isNullElement:()=>lp,isNumberElement:()=>cp,isObjectElement:()=>pp,isParseResultElement:()=>vp,isPrimitiveElement:()=>isPrimitiveElement,isRefElement:()=>mp,isSourceMapElement:()=>bp,isStringElement:()=>ip});var le={};__webpack_require__.r(le),__webpack_require__.d(le,{isJSONReferenceElement:()=>xm,isJSONSchemaElement:()=>Sm,isLinkDescriptionElement:()=>Om,isMediaElement:()=>km});var pe={};__webpack_require__.r(pe),__webpack_require__.d(pe,{isBooleanJsonSchemaElement:()=>isBooleanJsonSchemaElement,isCallbackElement:()=>_g,isComponentsElement:()=>xg,isContactElement:()=>kg,isExampleElement:()=>qg,isExternalDocumentationElement:()=>Vg,isHeaderElement:()=>Ug,isInfoElement:()=>zg,isLicenseElement:()=>Wg,isLinkElement:()=>Kg,isMediaTypeElement:()=>hy,isOpenApi3_0Element:()=>Xg,isOpenapiElement:()=>Yg,isOperationElement:()=>Zg,isParameterElement:()=>ey,isPathItemElement:()=>ty,isPathsElement:()=>ry,isReferenceElement:()=>ny,isRequestBodyElement:()=>oy,isResponseElement:()=>sy,isResponsesElement:()=>iy,isSchemaElement:()=>ay,isSecurityRequirementElement:()=>cy,isSecuritySchemeElement:()=>ly,isServerElement:()=>uy,isServerVariableElement:()=>py,isServersElement:()=>dy});var de={};__webpack_require__.r(de),__webpack_require__.d(de,{isBooleanJsonSchemaElement:()=>predicates_isBooleanJsonSchemaElement,isCallbackElement:()=>fE,isComponentsElement:()=>mE,isContactElement:()=>gE,isExampleElement:()=>yE,isExternalDocumentationElement:()=>vE,isHeaderElement:()=>bE,isInfoElement:()=>_E,isJsonSchemaDialectElement:()=>EE,isLicenseElement:()=>wE,isLinkElement:()=>SE,isMediaTypeElement:()=>FE,isOpenApi3_1Element:()=>kE,isOpenapiElement:()=>xE,isOperationElement:()=>OE,isParameterElement:()=>CE,isPathItemElement:()=>AE,isPathItemElementExternal:()=>isPathItemElementExternal,isPathsElement:()=>jE,isReferenceElement:()=>PE,isReferenceElementExternal:()=>isReferenceElementExternal,isRequestBodyElement:()=>IE,isResponseElement:()=>ME,isResponsesElement:()=>NE,isSchemaElement:()=>TE,isSecurityRequirementElement:()=>RE,isSecuritySchemeElement:()=>DE,isServerElement:()=>LE,isServerVariableElement:()=>BE});var fe={};__webpack_require__.r(fe),__webpack_require__.d(fe,{cookie:()=>parameter_builders_cookie,header:()=>parameter_builders_header,path:()=>parameter_builders_path,query:()=>parameter_builders_query});var ye={};__webpack_require__.r(ye),__webpack_require__.d(ye,{Button:()=>Button,Col:()=>Col,Collapse:()=>Collapse,Container:()=>Container,Input:()=>Input,Link:()=>layout_utils_Link,Row:()=>Row,Select:()=>Select,TextArea:()=>TextArea});var be={};__webpack_require__.r(be),__webpack_require__.d(be,{basePath:()=>OA,consumes:()=>CA,definitions:()=>wA,findDefinition:()=>EA,hasHost:()=>SA,host:()=>kA,produces:()=>AA,schemes:()=>jA,securityDefinitions:()=>xA,validOperationMethods:()=>wrap_selectors_validOperationMethods});var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{definitionsToAuthorize:()=>PA});var we={};__webpack_require__.r(we),__webpack_require__.d(we,{callbacksOperations:()=>NA,findSchema:()=>findSchema,isOAS3:()=>selectors_isOAS3,isOAS30:()=>selectors_isOAS30,isSwagger2:()=>selectors_isSwagger2,servers:()=>MA});var Se={};__webpack_require__.r(Se),__webpack_require__.d(Se,{CLEAR_REQUEST_BODY_VALIDATE_ERROR:()=>ZA,CLEAR_REQUEST_BODY_VALUE:()=>ej,SET_REQUEST_BODY_VALIDATE_ERROR:()=>QA,UPDATE_ACTIVE_EXAMPLES_MEMBER:()=>JA,UPDATE_REQUEST_BODY_INCLUSION:()=>HA,UPDATE_REQUEST_BODY_VALUE:()=>WA,UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG:()=>KA,UPDATE_REQUEST_CONTENT_TYPE:()=>GA,UPDATE_RESPONSE_CONTENT_TYPE:()=>YA,UPDATE_SELECTED_SERVER:()=>zA,UPDATE_SERVER_VARIABLE_VALUE:()=>XA,clearRequestBodyValidateError:()=>clearRequestBodyValidateError,clearRequestBodyValue:()=>clearRequestBodyValue,initRequestBodyValidateError:()=>initRequestBodyValidateError,setActiveExamplesMember:()=>setActiveExamplesMember,setRequestBodyInclusion:()=>setRequestBodyInclusion,setRequestBodyValidateError:()=>setRequestBodyValidateError,setRequestBodyValue:()=>setRequestBodyValue,setRequestContentType:()=>setRequestContentType,setResponseContentType:()=>setResponseContentType,setRetainRequestBodyValueFlag:()=>setRetainRequestBodyValueFlag,setSelectedServer:()=>setSelectedServer,setServerVariableValue:()=>setServerVariableValue});var xe={};__webpack_require__.r(xe),__webpack_require__.d(xe,{activeExamplesMember:()=>zj,hasUserEditedBody:()=>Nj,requestBodyErrors:()=>$j,requestBodyInclusionSetting:()=>Bj,requestBodyValue:()=>Cj,requestContentType:()=>Kj,responseContentType:()=>Jj,selectDefaultRequestBodyValue:()=>selectDefaultRequestBodyValue,selectedServer:()=>_j,serverEffectiveValue:()=>eP,serverVariableValue:()=>Gj,serverVariables:()=>Xj,shouldRetainRequestBodyValue:()=>Aj,validOperationMethods:()=>rP,validateBeforeExecute:()=>tP,validateShallowRequired:()=>validateShallowRequired});var Pe=__webpack_require__(96540);function formatProdErrorMessage(o){return`Minified Redux error #${o}; visit https://redux.js.org/Errors?code=${o} for the full message or use the non-minified dev environment for full errors. `}var Te=(()=>\"function\"==typeof Symbol&&Symbol.observable||\"@@observable\")(),randomString=()=>Math.random().toString(36).substring(7).split(\"\").join(\".\"),Re={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`};function isPlainObject(o){if(\"object\"!=typeof o||null===o)return!1;let s=o;for(;null!==Object.getPrototypeOf(s);)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(o)===s||null===Object.getPrototypeOf(o)}function createStore(o,s,i){if(\"function\"!=typeof o)throw new Error(formatProdErrorMessage(2));if(\"function\"==typeof s&&\"function\"==typeof i||\"function\"==typeof i&&\"function\"==typeof arguments[3])throw new Error(formatProdErrorMessage(0));if(\"function\"==typeof s&&void 0===i&&(i=s,s=void 0),void 0!==i){if(\"function\"!=typeof i)throw new Error(formatProdErrorMessage(1));return i(createStore)(o,s)}let u=o,_=s,w=new Map,x=w,C=0,j=!1;function ensureCanMutateNextListeners(){x===w&&(x=new Map,w.forEach(((o,s)=>{x.set(s,o)})))}function getState(){if(j)throw new Error(formatProdErrorMessage(3));return _}function subscribe(o){if(\"function\"!=typeof o)throw new Error(formatProdErrorMessage(4));if(j)throw new Error(formatProdErrorMessage(5));let s=!0;ensureCanMutateNextListeners();const i=C++;return x.set(i,o),function unsubscribe(){if(s){if(j)throw new Error(formatProdErrorMessage(6));s=!1,ensureCanMutateNextListeners(),x.delete(i),w=null}}}function dispatch(o){if(!isPlainObject(o))throw new Error(formatProdErrorMessage(7));if(void 0===o.type)throw new Error(formatProdErrorMessage(8));if(\"string\"!=typeof o.type)throw new Error(formatProdErrorMessage(17));if(j)throw new Error(formatProdErrorMessage(9));try{j=!0,_=u(_,o)}finally{j=!1}return(w=x).forEach((o=>{o()})),o}dispatch({type:Re.INIT});return{dispatch,subscribe,getState,replaceReducer:function replaceReducer(o){if(\"function\"!=typeof o)throw new Error(formatProdErrorMessage(10));u=o,dispatch({type:Re.REPLACE})},[Te]:function observable(){const o=subscribe;return{subscribe(s){if(\"object\"!=typeof s||null===s)throw new Error(formatProdErrorMessage(11));function observeState(){const o=s;o.next&&o.next(getState())}observeState();return{unsubscribe:o(observeState)}},[Te](){return this}}}}}function bindActionCreator(o,s){return function(...i){return s(o.apply(this,i))}}function compose(...o){return 0===o.length?o=>o:1===o.length?o[0]:o.reduce(((o,s)=>(...i)=>o(s(...i))))}var qe=__webpack_require__(9404),$e=__webpack_require__.n(qe),ze=__webpack_require__(81919),We=__webpack_require__.n(ze),He=__webpack_require__(89593),Ye=__webpack_require__(20334),Xe=__webpack_require__(55364),Qe=__webpack_require__.n(Xe);const et=\"err_new_thrown_err\",tt=\"err_new_thrown_err_batch\",rt=\"err_new_spec_err\",nt=\"err_new_spec_err_batch\",ot=\"err_new_auth_err\",st=\"err_clear\",it=\"err_clear_by\";function newThrownErr(o){return{type:et,payload:(0,Ye.serializeError)(o)}}function newThrownErrBatch(o){return{type:tt,payload:o}}function newSpecErr(o){return{type:rt,payload:o}}function newSpecErrBatch(o){return{type:nt,payload:o}}function newAuthErr(o){return{type:ot,payload:o}}function clear(o={}){return{type:st,payload:o}}function clearBy(o=(()=>!0)){return{type:it,payload:o}}const at=function makeWindow(){var o={location:{},history:{},open:()=>{},close:()=>{},File:function(){},FormData:function(){}};if(\"undefined\"==typeof window)return o;try{o=window;for(var s of[\"File\",\"Blob\",\"FormData\"])s in window&&(o[s]=window[s])}catch(o){console.error(o)}return o}();var ct=__webpack_require__(16750),lt=(__webpack_require__(84058),__webpack_require__(55808),__webpack_require__(50104)),ut=__webpack_require__.n(lt),pt=__webpack_require__(7309),ht=__webpack_require__.n(pt),dt=__webpack_require__(42426),mt=__webpack_require__.n(dt),gt=__webpack_require__(75288),yt=__webpack_require__.n(gt),vt=__webpack_require__(1882),bt=__webpack_require__.n(vt),_t=__webpack_require__(2205),Et=__webpack_require__.n(_t),wt=__webpack_require__(53209),St=__webpack_require__.n(wt),xt=__webpack_require__(62802),kt=__webpack_require__.n(xt);const Ot=$e().Set.of(\"type\",\"format\",\"items\",\"default\",\"maximum\",\"exclusiveMaximum\",\"minimum\",\"exclusiveMinimum\",\"maxLength\",\"minLength\",\"pattern\",\"maxItems\",\"minItems\",\"uniqueItems\",\"enum\",\"multipleOf\");function getParameterSchema(o,{isOAS3:s}={}){if(!$e().Map.isMap(o))return{schema:$e().Map(),parameterContentMediaType:null};if(!s)return\"body\"===o.get(\"in\")?{schema:o.get(\"schema\",$e().Map()),parameterContentMediaType:null}:{schema:o.filter(((o,s)=>Ot.includes(s))),parameterContentMediaType:null};if(o.get(\"content\")){const s=o.get(\"content\",$e().Map({})).keySeq().first();return{schema:o.getIn([\"content\",s,\"schema\"],$e().Map()),parameterContentMediaType:s}}return{schema:o.get(\"schema\")?o.get(\"schema\",$e().Map()):$e().Map(),parameterContentMediaType:null}}var Ct=__webpack_require__(48287).Buffer;const At=\"default\",isImmutable=o=>$e().Iterable.isIterable(o);function objectify(o){return isObject(o)?isImmutable(o)?o.toJS():o:{}}function fromJSOrdered(o){if(isImmutable(o))return o;if(o instanceof at.File)return o;if(!isObject(o))return o;if(Array.isArray(o))return $e().Seq(o).map(fromJSOrdered).toList();if(bt()(o.entries)){const s=function createObjWithHashedKeys(o){if(!bt()(o.entries))return o;const s={},i=\"_**[]\",u={};for(let _ of o.entries())if(s[_[0]]||u[_[0]]&&u[_[0]].containsMultiple){if(!u[_[0]]){u[_[0]]={containsMultiple:!0,length:1},s[`${_[0]}${i}${u[_[0]].length}`]=s[_[0]],delete s[_[0]]}u[_[0]].length+=1,s[`${_[0]}${i}${u[_[0]].length}`]=_[1]}else s[_[0]]=_[1];return s}(o);return $e().OrderedMap(s).map(fromJSOrdered)}return $e().OrderedMap(o).map(fromJSOrdered)}function normalizeArray(o){return Array.isArray(o)?o:[o]}function isFn(o){return\"function\"==typeof o}function isObject(o){return!!o&&\"object\"==typeof o}function isFunc(o){return\"function\"==typeof o}function isArray(o){return Array.isArray(o)}const jt=ut();function objMap(o,s){return Object.keys(o).reduce(((i,u)=>(i[u]=s(o[u],u),i)),{})}function objReduce(o,s){return Object.keys(o).reduce(((i,u)=>{let _=s(o[u],u);return _&&\"object\"==typeof _&&Object.assign(i,_),i}),{})}function systemThunkMiddleware(o){return({dispatch:s,getState:i})=>s=>i=>\"function\"==typeof i?i(o()):s(i)}function validateValueBySchema(o,s,i,u,_){if(!s)return[];let w=[],x=s.get(\"nullable\"),C=s.get(\"required\"),j=s.get(\"maximum\"),L=s.get(\"minimum\"),B=s.get(\"type\"),$=s.get(\"format\"),V=s.get(\"maxLength\"),U=s.get(\"minLength\"),z=s.get(\"uniqueItems\"),Y=s.get(\"maxItems\"),Z=s.get(\"minItems\"),ee=s.get(\"pattern\");const ie=i||!0===C,ae=null!=o,ce=ie||ae&&\"array\"===B||!(!ie&&!ae),le=x&&null===o;if(ie&&!ae&&!le&&!u&&!B)return w.push(\"Required field is not provided\"),w;if(le||!B||!ce)return[];let pe=\"string\"===B&&o,de=\"array\"===B&&Array.isArray(o)&&o.length,fe=\"array\"===B&&$e().List.isList(o)&&o.count();const ye=[pe,de,fe,\"array\"===B&&\"string\"==typeof o&&o,\"file\"===B&&o instanceof at.File,\"boolean\"===B&&(o||!1===o),\"number\"===B&&(o||0===o),\"integer\"===B&&(o||0===o),\"object\"===B&&\"object\"==typeof o&&null!==o,\"object\"===B&&\"string\"==typeof o&&o].some((o=>!!o));if(ie&&!ye&&!u)return w.push(\"Required field is not provided\"),w;if(\"object\"===B&&(null===_||\"application/json\"===_)){let i=o;if(\"string\"==typeof o)try{i=JSON.parse(o)}catch(o){return w.push(\"Parameter string value must be valid JSON\"),w}s&&s.has(\"required\")&&isFunc(C.isList)&&C.isList()&&C.forEach((o=>{void 0===i[o]&&w.push({propKey:o,error:\"Required property not found\"})})),s&&s.has(\"properties\")&&s.get(\"properties\").forEach(((o,s)=>{const x=validateValueBySchema(i[s],o,!1,u,_);w.push(...x.map((o=>({propKey:s,error:o}))))}))}if(ee){let s=((o,s)=>{if(!new RegExp(s).test(o))return\"Value must follow pattern \"+s})(o,ee);s&&w.push(s)}if(Z&&\"array\"===B){let s=((o,s)=>{if(!o&&s>=1||o&&o.length<s)return`Array must contain at least ${s} item${1===s?\"\":\"s\"}`})(o,Z);s&&w.push(s)}if(Y&&\"array\"===B){let s=((o,s)=>{if(o&&o.length>s)return`Array must not contain more then ${s} item${1===s?\"\":\"s\"}`})(o,Y);s&&w.push({needRemove:!0,error:s})}if(z&&\"array\"===B){let s=((o,s)=>{if(o&&(\"true\"===s||!0===s)){const s=(0,qe.fromJS)(o),i=s.toSet();if(o.length>i.size){let o=(0,qe.Set)();if(s.forEach(((i,u)=>{s.filter((o=>isFunc(o.equals)?o.equals(i):o===i)).size>1&&(o=o.add(u))})),0!==o.size)return o.map((o=>({index:o,error:\"No duplicates allowed.\"}))).toArray()}}})(o,z);s&&w.push(...s)}if(V||0===V){let s=((o,s)=>{if(o.length>s)return`Value must be no longer than ${s} character${1!==s?\"s\":\"\"}`})(o,V);s&&w.push(s)}if(U){let s=((o,s)=>{if(o.length<s)return`Value must be at least ${s} character${1!==s?\"s\":\"\"}`})(o,U);s&&w.push(s)}if(j||0===j){let s=((o,s)=>{if(o>s)return`Value must be less than ${s}`})(o,j);s&&w.push(s)}if(L||0===L){let s=((o,s)=>{if(o<s)return`Value must be greater than ${s}`})(o,L);s&&w.push(s)}if(\"string\"===B){let s;if(s=\"date-time\"===$?(o=>{if(isNaN(Date.parse(o)))return\"Value must be a DateTime\"})(o):\"uuid\"===$?(o=>{if(o=o.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(o))return\"Value must be a Guid\"})(o):(o=>{if(o&&\"string\"!=typeof o)return\"Value must be a string\"})(o),!s)return w;w.push(s)}else if(\"boolean\"===B){let s=(o=>{if(\"true\"!==o&&\"false\"!==o&&!0!==o&&!1!==o)return\"Value must be a boolean\"})(o);if(!s)return w;w.push(s)}else if(\"number\"===B){let s=(o=>{if(!/^-?\\d+(\\.?\\d+)?$/.test(o))return\"Value must be a number\"})(o);if(!s)return w;w.push(s)}else if(\"integer\"===B){let s=(o=>{if(!/^-?\\d+$/.test(o))return\"Value must be an integer\"})(o);if(!s)return w;w.push(s)}else if(\"array\"===B){if(!de&&!fe)return w;o&&o.forEach(((o,i)=>{const x=validateValueBySchema(o,s.get(\"items\"),!1,u,_);w.push(...x.map((o=>({index:i,error:o}))))}))}else if(\"file\"===B){let s=(o=>{if(o&&!(o instanceof at.File))return\"Value must be a file\"})(o);if(!s)return w;w.push(s)}return w}const utils_btoa=o=>{let s;return s=o instanceof Ct?o:Ct.from(o.toString(),\"utf-8\"),s.toString(\"base64\")},Pt={operationsSorter:{alpha:(o,s)=>o.get(\"path\").localeCompare(s.get(\"path\")),method:(o,s)=>o.get(\"method\").localeCompare(s.get(\"method\"))},tagsSorter:{alpha:(o,s)=>o.localeCompare(s)}},buildFormData=o=>{let s=[];for(let i in o){let u=o[i];void 0!==u&&\"\"!==u&&s.push([i,\"=\",encodeURIComponent(u).replace(/%20/g,\"+\")].join(\"\"))}return s.join(\"&\")},shallowEqualKeys=(o,s,i)=>!!ht()(i,(i=>yt()(o[i],s[i])));function sanitizeUrl(o){return\"string\"!=typeof o||\"\"===o?\"\":(0,ct.J)(o)}function requiresValidationURL(o){return!(!o||o.indexOf(\"localhost\")>=0||o.indexOf(\"127.0.0.1\")>=0||\"none\"===o)}const createDeepLinkPath=o=>\"string\"==typeof o||o instanceof String?o.trim().replace(/\\s/g,\"%20\"):\"\",escapeDeepLinkPath=o=>Et()(createDeepLinkPath(o).replace(/%20/g,\"_\")),getExtensions=o=>o.filter(((o,s)=>/^x-/.test(s))),getCommonExtensions=o=>o.filter(((o,s)=>/^pattern|maxLength|minLength|maximum|minimum/.test(s)));function deeplyStripKey(o,s,i=(()=>!0)){if(\"object\"!=typeof o||Array.isArray(o)||null===o||!s)return o;const u=Object.assign({},o);return Object.keys(u).forEach((o=>{o===s&&i(u[o],o)?delete u[o]:u[o]=deeplyStripKey(u[o],s,i)})),u}function stringify(o){if(\"string\"==typeof o)return o;if(o&&o.toJS&&(o=o.toJS()),\"object\"==typeof o&&null!==o)try{return JSON.stringify(o,null,2)}catch(s){return String(o)}return null==o?\"\":o.toString()}function paramToIdentifier(o,{returnAll:s=!1,allowHashes:i=!0}={}){if(!$e().Map.isMap(o))throw new Error(\"paramToIdentifier: received a non-Im.Map parameter as input\");const u=o.get(\"name\"),_=o.get(\"in\");let w=[];return o&&o.hashCode&&_&&u&&i&&w.push(`${_}.${u}.hash-${o.hashCode()}`),_&&u&&w.push(`${_}.${u}`),w.push(u),s?w:w[0]||\"\"}function paramToValue(o,s){return paramToIdentifier(o,{returnAll:!0}).map((o=>s[o])).filter((o=>void 0!==o))[0]}function b64toB64UrlEncoded(o){return o.replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=/g,\"\")}const isEmptyValue=o=>!o||!(!isImmutable(o)||!o.isEmpty()),idFn=o=>o;function createStoreWithMiddleware(o,s,i){let u=[systemThunkMiddleware(i)];return createStore(o,s,(at.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||compose)(function applyMiddleware(...o){return s=>(i,u)=>{const _=s(i,u);let dispatch=()=>{throw new Error(formatProdErrorMessage(15))};const w={getState:_.getState,dispatch:(o,...s)=>dispatch(o,...s)},x=o.map((o=>o(w)));return dispatch=compose(...x)(_.dispatch),{..._,dispatch}}}(...u)))}class Store{constructor(o={}){We()(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},o),this.getSystem=this._getSystem.bind(this),this.store=function configureStore(o,s,i){return createStoreWithMiddleware(o,s,i)}(idFn,(0,qe.fromJS)(this.state),this.getSystem),this.buildSystem(!1),this.register(this.plugins)}getStore(){return this.store}register(o,s=!0){var i=combinePlugins(o,this.getSystem());systemExtend(this.system,i),s&&this.buildSystem();callAfterLoad.call(this.system,o,this.getSystem())&&this.buildSystem()}buildSystem(o=!0){let s=this.getStore().dispatch,i=this.getStore().getState;this.boundSystem=Object.assign({},this.getRootInjects(),this.getWrappedAndBoundActions(s),this.getWrappedAndBoundSelectors(i,this.getSystem),this.getStateThunks(i),this.getFn(),this.getConfigs()),o&&this.rebuildReducer()}_getSystem(){return this.boundSystem}getRootInjects(){return Object.assign({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:$e(),React:Pe},this.system.rootInjects||{})}_getConfigs(){return this.system.configs}getConfigs(){return{configs:this.system.configs}}setConfigs(o){this.system.configs=o}rebuildReducer(){this.store.replaceReducer(function buildReducer(o){return function allReducers(o){let s=Object.keys(o).reduce(((s,i)=>(s[i]=function makeReducer(o){return(s=new qe.Map,i)=>{if(!o)return s;let u=o[i.type];if(u){const o=wrapWithTryCatch(u)(s,i);return null===o?s:o}return s}}(o[i]),s)),{});if(!Object.keys(s).length)return idFn;return(0,He.H)(s)}(objMap(o,(o=>o.reducers)))}(this.system.statePlugins))}getType(o){let s=o[0].toUpperCase()+o.slice(1);return objReduce(this.system.statePlugins,((i,u)=>{let _=i[o];if(_)return{[u+s]:_}}))}getSelectors(){return this.getType(\"selectors\")}getActions(){return objMap(this.getType(\"actions\"),(o=>objReduce(o,((o,s)=>{if(isFn(o))return{[s]:o}}))))}getWrappedAndBoundActions(o){return objMap(this.getBoundActions(o),((o,s)=>{let i=this.system.statePlugins[s.slice(0,-7)].wrapActions;return i?objMap(o,((o,s)=>{let u=i[s];return u?(Array.isArray(u)||(u=[u]),u.reduce(((o,s)=>{let newAction=(...i)=>s(o,this.getSystem())(...i);if(!isFn(newAction))throw new TypeError(\"wrapActions needs to return a function that returns a new function (ie the wrapped action)\");return wrapWithTryCatch(newAction)}),o||Function.prototype)):o})):o}))}getWrappedAndBoundSelectors(o,s){return objMap(this.getBoundSelectors(o,s),((s,i)=>{let u=[i.slice(0,-9)],_=this.system.statePlugins[u].wrapSelectors;return _?objMap(s,((s,i)=>{let w=_[i];return w?(Array.isArray(w)||(w=[w]),w.reduce(((s,i)=>{let wrappedSelector=(..._)=>i(s,this.getSystem())(o().getIn(u),..._);if(!isFn(wrappedSelector))throw new TypeError(\"wrapSelector needs to return a function that returns a new function (ie the wrapped action)\");return wrappedSelector}),s||Function.prototype)):s})):s}))}getStates(o){return Object.keys(this.system.statePlugins).reduce(((s,i)=>(s[i]=o.get(i),s)),{})}getStateThunks(o){return Object.keys(this.system.statePlugins).reduce(((s,i)=>(s[i]=()=>o().get(i),s)),{})}getFn(){return{fn:this.system.fn}}getComponents(o){const s=this.system.components[o];return Array.isArray(s)?s.reduce(((o,s)=>s(o,this.getSystem()))):void 0!==o?this.system.components[o]:this.system.components}getBoundSelectors(o,s){return objMap(this.getSelectors(),((i,u)=>{let _=[u.slice(0,-9)];return objMap(i,(i=>(...u)=>{let w=wrapWithTryCatch(i).apply(null,[o().getIn(_),...u]);return\"function\"==typeof w&&(w=wrapWithTryCatch(w)(s())),w}))}))}getBoundActions(o){o=o||this.getStore().dispatch;const s=this.getActions(),process=o=>\"function\"!=typeof o?objMap(o,(o=>process(o))):(...s)=>{var i=null;try{i=o(...s)}catch(o){i={type:et,error:!0,payload:(0,Ye.serializeError)(o)}}finally{return i}};return objMap(s,(s=>function bindActionCreators(o,s){if(\"function\"==typeof o)return bindActionCreator(o,s);if(\"object\"!=typeof o||null===o)throw new Error(formatProdErrorMessage(16));const i={};for(const u in o){const _=o[u];\"function\"==typeof _&&(i[u]=bindActionCreator(_,s))}return i}(process(s),o)))}getMapStateToProps(){return()=>Object.assign({},this.getSystem())}getMapDispatchToProps(o){return s=>We()({},this.getWrappedAndBoundActions(s),this.getFn(),o)}}function combinePlugins(o,s){return isObject(o)&&!isArray(o)?Qe()({},o):isFunc(o)?combinePlugins(o(s),s):isArray(o)?o.map((o=>combinePlugins(o,s))).reduce(systemExtend,{components:s.getComponents()}):{}}function callAfterLoad(o,s,{hasLoaded:i}={}){let u=i;return isObject(o)&&!isArray(o)&&\"function\"==typeof o.afterLoad&&(u=!0,wrapWithTryCatch(o.afterLoad).call(this,s)),isFunc(o)?callAfterLoad.call(this,o(s),s,{hasLoaded:u}):isArray(o)?o.map((o=>callAfterLoad.call(this,o,s,{hasLoaded:u}))):u}function systemExtend(o={},s={}){if(!isObject(o))return{};if(!isObject(s))return o;s.wrapComponents&&(objMap(s.wrapComponents,((i,u)=>{const _=o.components&&o.components[u];_&&Array.isArray(_)?(o.components[u]=_.concat([i]),delete s.wrapComponents[u]):_&&(o.components[u]=[_,i],delete s.wrapComponents[u])})),Object.keys(s.wrapComponents).length||delete s.wrapComponents);const{statePlugins:i}=o;if(isObject(i))for(let o in i){const u=i[o];if(!isObject(u))continue;const{wrapActions:_,wrapSelectors:w}=u;if(isObject(_))for(let i in _){let u=_[i];Array.isArray(u)||(u=[u],_[i]=u),s&&s.statePlugins&&s.statePlugins[o]&&s.statePlugins[o].wrapActions&&s.statePlugins[o].wrapActions[i]&&(s.statePlugins[o].wrapActions[i]=_[i].concat(s.statePlugins[o].wrapActions[i]))}if(isObject(w))for(let i in w){let u=w[i];Array.isArray(u)||(u=[u],w[i]=u),s&&s.statePlugins&&s.statePlugins[o]&&s.statePlugins[o].wrapSelectors&&s.statePlugins[o].wrapSelectors[i]&&(s.statePlugins[o].wrapSelectors[i]=w[i].concat(s.statePlugins[o].wrapSelectors[i]))}}return We()(o,s)}function wrapWithTryCatch(o,{logErrors:s=!0}={}){return\"function\"!=typeof o?o:function(...i){try{return o.call(this,...i)}catch(o){return s&&console.error(o),null}}}var It=__webpack_require__(61160),Mt=__webpack_require__.n(It);const Nt=\"show_popup\",Tt=\"authorize\",Rt=\"logout\",Dt=\"pre_authorize_oauth2\",Lt=\"authorize_oauth2\",Bt=\"validate\",Ft=\"configure_auth\",qt=\"restore_authorization\";function showDefinitions(o){return{type:Nt,payload:o}}function authorize(o){return{type:Tt,payload:o}}const authorizeWithPersistOption=o=>({authActions:s})=>{s.authorize(o),s.persistAuthorizationIfNeeded()};function logout(o){return{type:Rt,payload:o}}const logoutWithPersistOption=o=>({authActions:s})=>{s.logout(o),s.persistAuthorizationIfNeeded()},preAuthorizeImplicit=o=>({authActions:s,errActions:i})=>{let{auth:u,token:_,isValid:w}=o,{schema:x,name:C}=u,j=x.get(\"flow\");delete at.swaggerUIRedirectOauth2,\"accessCode\"===j||w||i.newAuthErr({authId:C,source:\"auth\",level:\"warning\",message:\"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server\"}),_.error?i.newAuthErr({authId:C,source:\"auth\",level:\"error\",message:JSON.stringify(_)}):s.authorizeOauth2WithPersistOption({auth:u,token:_})};function authorizeOauth2(o){return{type:Lt,payload:o}}const authorizeOauth2WithPersistOption=o=>({authActions:s})=>{s.authorizeOauth2(o),s.persistAuthorizationIfNeeded()},authorizePassword=o=>({authActions:s})=>{let{schema:i,name:u,username:_,password:w,passwordType:x,clientId:C,clientSecret:j}=o,L={grant_type:\"password\",scope:o.scopes.join(\" \"),username:_,password:w},B={};switch(x){case\"request-body\":!function setClientIdAndSecret(o,s,i){s&&Object.assign(o,{client_id:s});i&&Object.assign(o,{client_secret:i})}(L,C,j);break;case\"basic\":B.Authorization=\"Basic \"+utils_btoa(C+\":\"+j);break;default:console.warn(`Warning: invalid passwordType ${x} was passed, not including client id and secret`)}return s.authorizeRequest({body:buildFormData(L),url:i.get(\"tokenUrl\"),name:u,headers:B,query:{},auth:o})};const authorizeApplication=o=>({authActions:s})=>{let{schema:i,scopes:u,name:_,clientId:w,clientSecret:x}=o,C={Authorization:\"Basic \"+utils_btoa(w+\":\"+x)},j={grant_type:\"client_credentials\",scope:u.join(\" \")};return s.authorizeRequest({body:buildFormData(j),name:_,url:i.get(\"tokenUrl\"),auth:o,headers:C})},authorizeAccessCodeWithFormParams=({auth:o,redirectUrl:s})=>({authActions:i})=>{let{schema:u,name:_,clientId:w,clientSecret:x,codeVerifier:C}=o,j={grant_type:\"authorization_code\",code:o.code,client_id:w,client_secret:x,redirect_uri:s,code_verifier:C};return i.authorizeRequest({body:buildFormData(j),name:_,url:u.get(\"tokenUrl\"),auth:o})},authorizeAccessCodeWithBasicAuthentication=({auth:o,redirectUrl:s})=>({authActions:i})=>{let{schema:u,name:_,clientId:w,clientSecret:x,codeVerifier:C}=o,j={Authorization:\"Basic \"+utils_btoa(w+\":\"+x)},L={grant_type:\"authorization_code\",code:o.code,client_id:w,redirect_uri:s,code_verifier:C};return i.authorizeRequest({body:buildFormData(L),name:_,url:u.get(\"tokenUrl\"),auth:o,headers:j})},authorizeRequest=o=>({fn:s,getConfigs:i,authActions:u,errActions:_,oas3Selectors:w,specSelectors:x,authSelectors:C})=>{let j,{body:L,query:B={},headers:$={},name:V,url:U,auth:z}=o,{additionalQueryStringParams:Y}=C.getConfigs()||{};if(x.isOAS3()){let o=w.serverEffectiveValue(w.selectedServer());j=Mt()(U,o,!0)}else j=Mt()(U,x.url(),!0);\"object\"==typeof Y&&(j.query=Object.assign({},j.query,Y));const Z=j.toString();let ee=Object.assign({Accept:\"application/json, text/plain, */*\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"X-Requested-With\":\"XMLHttpRequest\"},$);s.fetch({url:Z,method:\"post\",headers:ee,query:B,body:L,requestInterceptor:i().requestInterceptor,responseInterceptor:i().responseInterceptor}).then((function(o){let s=JSON.parse(o.data),i=s&&(s.error||\"\"),w=s&&(s.parseError||\"\");o.ok?i||w?_.newAuthErr({authId:V,level:\"error\",source:\"auth\",message:JSON.stringify(s)}):u.authorizeOauth2WithPersistOption({auth:z,token:s}):_.newAuthErr({authId:V,level:\"error\",source:\"auth\",message:o.statusText})})).catch((o=>{let s=new Error(o).message;if(o.response&&o.response.data){const i=o.response.data;try{const o=\"string\"==typeof i?JSON.parse(i):i;o.error&&(s+=`, error: ${o.error}`),o.error_description&&(s+=`, description: ${o.error_description}`)}catch(o){}}_.newAuthErr({authId:V,level:\"error\",source:\"auth\",message:s})}))};function configureAuth(o){return{type:Ft,payload:o}}function restoreAuthorization(o){return{type:qt,payload:o}}const persistAuthorizationIfNeeded=()=>({authSelectors:o,getConfigs:s})=>{if(!s().persistAuthorization)return;const i=o.authorized().toJS();localStorage.setItem(\"authorized\",JSON.stringify(i))},authPopup=(o,s)=>()=>{at.swaggerUIRedirectOauth2=s,at.open(o)},$t={[Nt]:(o,{payload:s})=>o.set(\"showDefinitions\",s),[Tt]:(o,{payload:s})=>{let i=(0,qe.fromJS)(s),u=o.get(\"authorized\")||(0,qe.Map)();return i.entrySeq().forEach((([s,i])=>{if(!isFunc(i.getIn))return o.set(\"authorized\",u);let _=i.getIn([\"schema\",\"type\"]);if(\"apiKey\"===_||\"http\"===_)u=u.set(s,i);else if(\"basic\"===_){let o=i.getIn([\"value\",\"username\"]),_=i.getIn([\"value\",\"password\"]);u=u.setIn([s,\"value\"],{username:o,header:\"Basic \"+utils_btoa(o+\":\"+_)}),u=u.setIn([s,\"schema\"],i.get(\"schema\"))}})),o.set(\"authorized\",u)},[Lt]:(o,{payload:s})=>{let i,{auth:u,token:_}=s;u.token=Object.assign({},_),i=(0,qe.fromJS)(u);let w=o.get(\"authorized\")||(0,qe.Map)();return w=w.set(i.get(\"name\"),i),o.set(\"authorized\",w)},[Rt]:(o,{payload:s})=>{let i=o.get(\"authorized\").withMutations((o=>{s.forEach((s=>{o.delete(s)}))}));return o.set(\"authorized\",i)},[Ft]:(o,{payload:s})=>o.set(\"configs\",s),[qt]:(o,{payload:s})=>o.set(\"authorized\",(0,qe.fromJS)(s.authorized))};function assertIsFunction(o,s=\"expected a function, instead received \"+typeof o){if(\"function\"!=typeof o)throw new TypeError(s)}var ensureIsArray=o=>Array.isArray(o)?o:[o];function getDependencies(o){const s=Array.isArray(o[0])?o[0]:o;return function assertIsArrayOfFunctions(o,s=\"expected all items to be functions, instead received the following types: \"){if(!o.every((o=>\"function\"==typeof o))){const i=o.map((o=>\"function\"==typeof o?`function ${o.name||\"unnamed\"}()`:typeof o)).join(\", \");throw new TypeError(`${s}[${i}]`)}}(s,\"createSelector expects all input-selectors to be functions, but received the following types: \"),s}Symbol(),Object.getPrototypeOf({});var Vt=\"undefined\"!=typeof WeakRef?WeakRef:class{constructor(o){this.value=o}deref(){return this.value}},Ut=0,zt=1;function createCacheNode(){return{s:Ut,v:void 0,o:null,p:null}}function weakMapMemoize(o,s={}){let i=createCacheNode();const{resultEqualityCheck:u}=s;let _,w=0;function memoized(){let s=i;const{length:x}=arguments;for(let o=0,i=x;o<i;o++){const i=arguments[o];if(\"function\"==typeof i||\"object\"==typeof i&&null!==i){let o=s.o;null===o&&(s.o=o=new WeakMap);const u=o.get(i);void 0===u?(s=createCacheNode(),o.set(i,s)):s=u}else{let o=s.p;null===o&&(s.p=o=new Map);const u=o.get(i);void 0===u?(s=createCacheNode(),o.set(i,s)):s=u}}const C=s;let j;if(s.s===zt?j=s.v:(j=o.apply(null,arguments),w++),C.s=zt,u){const o=_?.deref?.()??_;null!=o&&u(o,j)&&(j=o,0!==w&&w--);_=\"object\"==typeof j&&null!==j||\"function\"==typeof j?new Vt(j):j}return C.v=j,j}return memoized.clearCache=()=>{i=createCacheNode(),memoized.resetResultsCount()},memoized.resultsCount=()=>w,memoized.resetResultsCount=()=>{w=0},memoized}function createSelectorCreator(o,...s){const i=\"function\"==typeof o?{memoize:o,memoizeOptions:s}:o,createSelector2=(...o)=>{let s,u=0,_=0,w={},x=o.pop();\"object\"==typeof x&&(w=x,x=o.pop()),assertIsFunction(x,`createSelector expects an output function after the inputs, but received: [${typeof x}]`);const C={...i,...w},{memoize:j,memoizeOptions:L=[],argsMemoize:B=weakMapMemoize,argsMemoizeOptions:$=[],devModeChecks:V={}}=C,U=ensureIsArray(L),z=ensureIsArray($),Y=getDependencies(o),Z=j((function recomputationWrapper(){return u++,x.apply(null,arguments)}),...U);const ee=B((function dependenciesChecker(){_++;const o=function collectInputSelectorResults(o,s){const i=[],{length:u}=o;for(let _=0;_<u;_++)i.push(o[_].apply(null,s));return i}(Y,arguments);return s=Z.apply(null,o),s}),...z);return Object.assign(ee,{resultFunc:x,memoizedResultFunc:Z,dependencies:Y,dependencyRecomputations:()=>_,resetDependencyRecomputations:()=>{_=0},lastResult:()=>s,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:j,argsMemoize:B})};return Object.assign(createSelector2,{withTypes:()=>createSelector2}),createSelector2}var Wt=createSelectorCreator(weakMapMemoize),Kt=Object.assign(((o,s=Wt)=>{!function assertIsObject(o,s=\"expected an object, instead received \"+typeof o){if(\"object\"!=typeof o)throw new TypeError(s)}(o,\"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a \"+typeof o);const i=Object.keys(o);return s(i.map((s=>o[s])),((...o)=>o.reduce(((o,s,u)=>(o[i[u]]=s,o)),{})))}),{withTypes:()=>Kt});const state=o=>o,Ht=Wt(state,(o=>o.get(\"showDefinitions\"))),Jt=Wt(state,(()=>({specSelectors:o})=>{let s=o.securityDefinitions()||(0,qe.Map)({}),i=(0,qe.List)();return s.entrySeq().forEach((([o,s])=>{let u=(0,qe.Map)();u=u.set(o,s),i=i.push(u)})),i})),getDefinitionsByNames=(o,s)=>({specSelectors:o})=>{console.warn(\"WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.\");let i=o.securityDefinitions(),u=(0,qe.List)();return s.valueSeq().forEach((o=>{let s=(0,qe.Map)();o.entrySeq().forEach((([o,u])=>{let _,w=i.get(o);\"oauth2\"===w.get(\"type\")&&u.size&&(_=w.get(\"scopes\"),_.keySeq().forEach((o=>{u.contains(o)||(_=_.delete(o))})),w=w.set(\"allowedScopes\",_)),s=s.set(o,w)})),u=u.push(s)})),u},definitionsForRequirements=(o,s=(0,qe.List)())=>({authSelectors:o})=>{const i=o.definitionsToAuthorize()||(0,qe.List)();let u=(0,qe.List)();return i.forEach((o=>{let i=s.find((s=>s.get(o.keySeq().first())));i&&(o.forEach(((s,u)=>{if(\"oauth2\"===s.get(\"type\")){const _=i.get(u);let w=s.get(\"scopes\");qe.List.isList(_)&&qe.Map.isMap(w)&&(w.keySeq().forEach((o=>{_.contains(o)||(w=w.delete(o))})),o=o.set(u,s.set(\"scopes\",w)))}})),u=u.push(o))})),u},Gt=Wt(state,(o=>o.get(\"authorized\")||(0,qe.Map)())),isAuthorized=(o,s)=>({authSelectors:o})=>{let i=o.authorized();return qe.List.isList(s)?!!s.toJS().filter((o=>-1===Object.keys(o).map((o=>!!i.get(o))).indexOf(!1))).length:null},Yt=Wt(state,(o=>o.get(\"configs\"))),execute=(o,{authSelectors:s,specSelectors:i})=>({path:u,method:_,operation:w,extras:x})=>{let C={authorized:s.authorized()&&s.authorized().toJS(),definitions:i.securityDefinitions()&&i.securityDefinitions().toJS(),specSecurity:i.security()&&i.security().toJS()};return o({path:u,method:_,operation:w,securities:C,...x})},loaded=(o,s)=>i=>{const{getConfigs:u,authActions:_}=s,w=u();if(o(i),w.persistAuthorization){const o=localStorage.getItem(\"authorized\");o&&_.restoreAuthorization({authorized:JSON.parse(o)})}},wrap_actions_authorize=(o,s)=>i=>{o(i);if(s.getConfigs().persistAuthorization)try{const[{schema:o,value:s}]=Object.values(i),u=\"apiKey\"===o.get(\"type\"),_=\"cookie\"===o.get(\"in\");u&&_&&(document.cookie=`${o.get(\"name\")}=${s}; SameSite=None; Secure`)}catch(o){console.error(\"Error persisting cookie based apiKey in document.cookie.\",o)}},wrap_actions_logout=(o,s)=>i=>{const u=s.getConfigs(),_=s.authSelectors.authorized();try{u.persistAuthorization&&Array.isArray(i)&&i.forEach((o=>{const s=_.get(o,{}),i=\"apiKey\"===s.getIn([\"schema\",\"type\"]),u=\"cookie\"===s.getIn([\"schema\",\"in\"]);if(i&&u){const o=s.getIn([\"schema\",\"name\"]);document.cookie=`${o}=; Max-Age=-99999999`}}))}catch(o){console.error(\"Error deleting cookie based apiKey from document.cookie.\",o)}o(i)};var Xt=__webpack_require__(90179),Qt=__webpack_require__.n(Xt);class LockAuthIcon extends Pe.Component{mapStateToProps(o,s){return{state:o,ownProps:Qt()(s,Object.keys(s.getSystem()))}}render(){const{getComponent:o,ownProps:s}=this.props,i=o(\"LockIcon\");return Pe.createElement(i,s)}}const Zt=LockAuthIcon;class UnlockAuthIcon extends Pe.Component{mapStateToProps(o,s){return{state:o,ownProps:Qt()(s,Object.keys(s.getSystem()))}}render(){const{getComponent:o,ownProps:s}=this.props,i=o(\"UnlockIcon\");return Pe.createElement(i,s)}}const er=UnlockAuthIcon;function auth(){return{afterLoad(o){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=o.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=preauthorizeApiKey.bind(null,o),this.rootInjects.preauthorizeBasic=preauthorizeBasic.bind(null,o)},components:{LockAuthIcon:Zt,UnlockAuthIcon:er,LockAuthOperationIcon:Zt,UnlockAuthOperationIcon:er},statePlugins:{auth:{reducers:$t,actions:s,selectors:i,wrapActions:{authorize:wrap_actions_authorize,logout:wrap_actions_logout}},configs:{wrapActions:{loaded}},spec:{wrapActions:{execute}}}}}function preauthorizeBasic(o,s,i,u){const{authActions:{authorize:_},specSelectors:{specJson:w,isOAS3:x}}=o,C=x()?[\"components\",\"securitySchemes\"]:[\"securityDefinitions\"],j=w().getIn([...C,s]);return j?_({[s]:{value:{username:i,password:u},schema:j.toJS()}}):null}function preauthorizeApiKey(o,s,i){const{authActions:{authorize:u},specSelectors:{specJson:_,isOAS3:w}}=o,x=w()?[\"components\",\"securitySchemes\"]:[\"securityDefinitions\"],C=_().getIn([...x,s]);return C?u({[s]:{value:i,schema:C.toJS()}}):null}function isNothing(o){return null==o}var tr=function repeat(o,s){var i,u=\"\";for(i=0;i<s;i+=1)u+=o;return u},rr=function isNegativeZero(o){return 0===o&&Number.NEGATIVE_INFINITY===1/o},nr={isNothing,isObject:function js_yaml_isObject(o){return\"object\"==typeof o&&null!==o},toArray:function toArray(o){return Array.isArray(o)?o:isNothing(o)?[]:[o]},repeat:tr,isNegativeZero:rr,extend:function extend(o,s){var i,u,_,w;if(s)for(i=0,u=(w=Object.keys(s)).length;i<u;i+=1)o[_=w[i]]=s[_];return o}};function formatError(o,s){var i=\"\",u=o.reason||\"(unknown reason)\";return o.mark?(o.mark.name&&(i+='in \"'+o.mark.name+'\" '),i+=\"(\"+(o.mark.line+1)+\":\"+(o.mark.column+1)+\")\",!s&&o.mark.snippet&&(i+=\"\\n\\n\"+o.mark.snippet),u+\" \"+i):u}function YAMLException$1(o,s){Error.call(this),this.name=\"YAMLException\",this.reason=o,this.mark=s,this.message=formatError(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||\"\"}YAMLException$1.prototype=Object.create(Error.prototype),YAMLException$1.prototype.constructor=YAMLException$1,YAMLException$1.prototype.toString=function toString(o){return this.name+\": \"+formatError(this,o)};var sr=YAMLException$1;function getLine(o,s,i,u,_){var w=\"\",x=\"\",C=Math.floor(_/2)-1;return u-s>C&&(s=u-C+(w=\" ... \").length),i-u>C&&(i=u+C-(x=\" ...\").length),{str:w+o.slice(s,i).replace(/\\t/g,\"→\")+x,pos:u-s+w.length}}function padStart(o,s){return nr.repeat(\" \",s-o.length)+o}var ir=function makeSnippet(o,s){if(s=Object.create(s||null),!o.buffer)return null;s.maxLength||(s.maxLength=79),\"number\"!=typeof s.indent&&(s.indent=1),\"number\"!=typeof s.linesBefore&&(s.linesBefore=3),\"number\"!=typeof s.linesAfter&&(s.linesAfter=2);for(var i,u=/\\r?\\n|\\r|\\0/g,_=[0],w=[],x=-1;i=u.exec(o.buffer);)w.push(i.index),_.push(i.index+i[0].length),o.position<=i.index&&x<0&&(x=_.length-2);x<0&&(x=_.length-1);var C,j,L=\"\",B=Math.min(o.line+s.linesAfter,w.length).toString().length,$=s.maxLength-(s.indent+B+3);for(C=1;C<=s.linesBefore&&!(x-C<0);C++)j=getLine(o.buffer,_[x-C],w[x-C],o.position-(_[x]-_[x-C]),$),L=nr.repeat(\" \",s.indent)+padStart((o.line-C+1).toString(),B)+\" | \"+j.str+\"\\n\"+L;for(j=getLine(o.buffer,_[x],w[x],o.position,$),L+=nr.repeat(\" \",s.indent)+padStart((o.line+1).toString(),B)+\" | \"+j.str+\"\\n\",L+=nr.repeat(\"-\",s.indent+B+3+j.pos)+\"^\\n\",C=1;C<=s.linesAfter&&!(x+C>=w.length);C++)j=getLine(o.buffer,_[x+C],w[x+C],o.position-(_[x]-_[x+C]),$),L+=nr.repeat(\" \",s.indent)+padStart((o.line+C+1).toString(),B)+\" | \"+j.str+\"\\n\";return L.replace(/\\n$/,\"\")},ar=[\"kind\",\"multi\",\"resolve\",\"construct\",\"instanceOf\",\"predicate\",\"represent\",\"representName\",\"defaultStyle\",\"styleAliases\"],cr=[\"scalar\",\"sequence\",\"mapping\"];var lr=function Type$1(o,s){if(s=s||{},Object.keys(s).forEach((function(s){if(-1===ar.indexOf(s))throw new sr('Unknown option \"'+s+'\" is met in definition of \"'+o+'\" YAML type.')})),this.options=s,this.tag=o,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(o){return o},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=function compileStyleAliases(o){var s={};return null!==o&&Object.keys(o).forEach((function(i){o[i].forEach((function(o){s[String(o)]=i}))})),s}(s.styleAliases||null),-1===cr.indexOf(this.kind))throw new sr('Unknown kind \"'+this.kind+'\" is specified for \"'+o+'\" YAML type.')};function compileList(o,s){var i=[];return o[s].forEach((function(o){var s=i.length;i.forEach((function(i,u){i.tag===o.tag&&i.kind===o.kind&&i.multi===o.multi&&(s=u)})),i[s]=o})),i}function Schema$1(o){return this.extend(o)}Schema$1.prototype.extend=function extend(o){var s=[],i=[];if(o instanceof lr)i.push(o);else if(Array.isArray(o))i=i.concat(o);else{if(!o||!Array.isArray(o.implicit)&&!Array.isArray(o.explicit))throw new sr(\"Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })\");o.implicit&&(s=s.concat(o.implicit)),o.explicit&&(i=i.concat(o.explicit))}s.forEach((function(o){if(!(o instanceof lr))throw new sr(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\");if(o.loadKind&&\"scalar\"!==o.loadKind)throw new sr(\"There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.\");if(o.multi)throw new sr(\"There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.\")})),i.forEach((function(o){if(!(o instanceof lr))throw new sr(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\")}));var u=Object.create(Schema$1.prototype);return u.implicit=(this.implicit||[]).concat(s),u.explicit=(this.explicit||[]).concat(i),u.compiledImplicit=compileList(u,\"implicit\"),u.compiledExplicit=compileList(u,\"explicit\"),u.compiledTypeMap=function compileMap(){var o,s,i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function collectType(o){o.multi?(i.multi[o.kind].push(o),i.multi.fallback.push(o)):i[o.kind][o.tag]=i.fallback[o.tag]=o}for(o=0,s=arguments.length;o<s;o+=1)arguments[o].forEach(collectType);return i}(u.compiledImplicit,u.compiledExplicit),u};var ur=Schema$1,pr=new lr(\"tag:yaml.org,2002:str\",{kind:\"scalar\",construct:function(o){return null!==o?o:\"\"}}),dr=new lr(\"tag:yaml.org,2002:seq\",{kind:\"sequence\",construct:function(o){return null!==o?o:[]}}),fr=new lr(\"tag:yaml.org,2002:map\",{kind:\"mapping\",construct:function(o){return null!==o?o:{}}}),mr=new ur({explicit:[pr,dr,fr]});var gr=new lr(\"tag:yaml.org,2002:null\",{kind:\"scalar\",resolve:function resolveYamlNull(o){if(null===o)return!0;var s=o.length;return 1===s&&\"~\"===o||4===s&&(\"null\"===o||\"Null\"===o||\"NULL\"===o)},construct:function constructYamlNull(){return null},predicate:function isNull(o){return null===o},represent:{canonical:function(){return\"~\"},lowercase:function(){return\"null\"},uppercase:function(){return\"NULL\"},camelcase:function(){return\"Null\"},empty:function(){return\"\"}},defaultStyle:\"lowercase\"});var yr=new lr(\"tag:yaml.org,2002:bool\",{kind:\"scalar\",resolve:function resolveYamlBoolean(o){if(null===o)return!1;var s=o.length;return 4===s&&(\"true\"===o||\"True\"===o||\"TRUE\"===o)||5===s&&(\"false\"===o||\"False\"===o||\"FALSE\"===o)},construct:function constructYamlBoolean(o){return\"true\"===o||\"True\"===o||\"TRUE\"===o},predicate:function isBoolean(o){return\"[object Boolean]\"===Object.prototype.toString.call(o)},represent:{lowercase:function(o){return o?\"true\":\"false\"},uppercase:function(o){return o?\"TRUE\":\"FALSE\"},camelcase:function(o){return o?\"True\":\"False\"}},defaultStyle:\"lowercase\"});function isOctCode(o){return 48<=o&&o<=55}function isDecCode(o){return 48<=o&&o<=57}var vr=new lr(\"tag:yaml.org,2002:int\",{kind:\"scalar\",resolve:function resolveYamlInteger(o){if(null===o)return!1;var s,i,u=o.length,_=0,w=!1;if(!u)return!1;if(\"-\"!==(s=o[_])&&\"+\"!==s||(s=o[++_]),\"0\"===s){if(_+1===u)return!0;if(\"b\"===(s=o[++_])){for(_++;_<u;_++)if(\"_\"!==(s=o[_])){if(\"0\"!==s&&\"1\"!==s)return!1;w=!0}return w&&\"_\"!==s}if(\"x\"===s){for(_++;_<u;_++)if(\"_\"!==(s=o[_])){if(!(48<=(i=o.charCodeAt(_))&&i<=57||65<=i&&i<=70||97<=i&&i<=102))return!1;w=!0}return w&&\"_\"!==s}if(\"o\"===s){for(_++;_<u;_++)if(\"_\"!==(s=o[_])){if(!isOctCode(o.charCodeAt(_)))return!1;w=!0}return w&&\"_\"!==s}}if(\"_\"===s)return!1;for(;_<u;_++)if(\"_\"!==(s=o[_])){if(!isDecCode(o.charCodeAt(_)))return!1;w=!0}return!(!w||\"_\"===s)},construct:function constructYamlInteger(o){var s,i=o,u=1;if(-1!==i.indexOf(\"_\")&&(i=i.replace(/_/g,\"\")),\"-\"!==(s=i[0])&&\"+\"!==s||(\"-\"===s&&(u=-1),s=(i=i.slice(1))[0]),\"0\"===i)return 0;if(\"0\"===s){if(\"b\"===i[1])return u*parseInt(i.slice(2),2);if(\"x\"===i[1])return u*parseInt(i.slice(2),16);if(\"o\"===i[1])return u*parseInt(i.slice(2),8)}return u*parseInt(i,10)},predicate:function isInteger(o){return\"[object Number]\"===Object.prototype.toString.call(o)&&o%1==0&&!nr.isNegativeZero(o)},represent:{binary:function(o){return o>=0?\"0b\"+o.toString(2):\"-0b\"+o.toString(2).slice(1)},octal:function(o){return o>=0?\"0o\"+o.toString(8):\"-0o\"+o.toString(8).slice(1)},decimal:function(o){return o.toString(10)},hexadecimal:function(o){return o>=0?\"0x\"+o.toString(16).toUpperCase():\"-0x\"+o.toString(16).toUpperCase().slice(1)}},defaultStyle:\"decimal\",styleAliases:{binary:[2,\"bin\"],octal:[8,\"oct\"],decimal:[10,\"dec\"],hexadecimal:[16,\"hex\"]}}),br=new RegExp(\"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))$\");var _r=/^[-+]?[0-9]+e/;var Er=new lr(\"tag:yaml.org,2002:float\",{kind:\"scalar\",resolve:function resolveYamlFloat(o){return null!==o&&!(!br.test(o)||\"_\"===o[o.length-1])},construct:function constructYamlFloat(o){var s,i;return i=\"-\"===(s=o.replace(/_/g,\"\").toLowerCase())[0]?-1:1,\"+-\".indexOf(s[0])>=0&&(s=s.slice(1)),\".inf\"===s?1===i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:\".nan\"===s?NaN:i*parseFloat(s,10)},predicate:function isFloat(o){return\"[object Number]\"===Object.prototype.toString.call(o)&&(o%1!=0||nr.isNegativeZero(o))},represent:function representYamlFloat(o,s){var i;if(isNaN(o))switch(s){case\"lowercase\":return\".nan\";case\"uppercase\":return\".NAN\";case\"camelcase\":return\".NaN\"}else if(Number.POSITIVE_INFINITY===o)switch(s){case\"lowercase\":return\".inf\";case\"uppercase\":return\".INF\";case\"camelcase\":return\".Inf\"}else if(Number.NEGATIVE_INFINITY===o)switch(s){case\"lowercase\":return\"-.inf\";case\"uppercase\":return\"-.INF\";case\"camelcase\":return\"-.Inf\"}else if(nr.isNegativeZero(o))return\"-0.0\";return i=o.toString(10),_r.test(i)?i.replace(\"e\",\".e\"):i},defaultStyle:\"lowercase\"}),wr=mr.extend({implicit:[gr,yr,vr,Er]}),Sr=wr,xr=new RegExp(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$\"),kr=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]))?))?$\");var Or=new lr(\"tag:yaml.org,2002:timestamp\",{kind:\"scalar\",resolve:function resolveYamlTimestamp(o){return null!==o&&(null!==xr.exec(o)||null!==kr.exec(o))},construct:function constructYamlTimestamp(o){var s,i,u,_,w,x,C,j,L=0,B=null;if(null===(s=xr.exec(o))&&(s=kr.exec(o)),null===s)throw new Error(\"Date resolve error\");if(i=+s[1],u=+s[2]-1,_=+s[3],!s[4])return new Date(Date.UTC(i,u,_));if(w=+s[4],x=+s[5],C=+s[6],s[7]){for(L=s[7].slice(0,3);L.length<3;)L+=\"0\";L=+L}return s[9]&&(B=6e4*(60*+s[10]+ +(s[11]||0)),\"-\"===s[9]&&(B=-B)),j=new Date(Date.UTC(i,u,_,w,x,C,L)),B&&j.setTime(j.getTime()-B),j},instanceOf:Date,represent:function representYamlTimestamp(o){return o.toISOString()}});var Cr=new lr(\"tag:yaml.org,2002:merge\",{kind:\"scalar\",resolve:function resolveYamlMerge(o){return\"<<\"===o||null===o}}),Ar=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r\";var jr=new lr(\"tag:yaml.org,2002:binary\",{kind:\"scalar\",resolve:function resolveYamlBinary(o){if(null===o)return!1;var s,i,u=0,_=o.length,w=Ar;for(i=0;i<_;i++)if(!((s=w.indexOf(o.charAt(i)))>64)){if(s<0)return!1;u+=6}return u%8==0},construct:function constructYamlBinary(o){var s,i,u=o.replace(/[\\r\\n=]/g,\"\"),_=u.length,w=Ar,x=0,C=[];for(s=0;s<_;s++)s%4==0&&s&&(C.push(x>>16&255),C.push(x>>8&255),C.push(255&x)),x=x<<6|w.indexOf(u.charAt(s));return 0===(i=_%4*6)?(C.push(x>>16&255),C.push(x>>8&255),C.push(255&x)):18===i?(C.push(x>>10&255),C.push(x>>2&255)):12===i&&C.push(x>>4&255),new Uint8Array(C)},predicate:function isBinary(o){return\"[object Uint8Array]\"===Object.prototype.toString.call(o)},represent:function representYamlBinary(o){var s,i,u=\"\",_=0,w=o.length,x=Ar;for(s=0;s<w;s++)s%3==0&&s&&(u+=x[_>>18&63],u+=x[_>>12&63],u+=x[_>>6&63],u+=x[63&_]),_=(_<<8)+o[s];return 0===(i=w%3)?(u+=x[_>>18&63],u+=x[_>>12&63],u+=x[_>>6&63],u+=x[63&_]):2===i?(u+=x[_>>10&63],u+=x[_>>4&63],u+=x[_<<2&63],u+=x[64]):1===i&&(u+=x[_>>2&63],u+=x[_<<4&63],u+=x[64],u+=x[64]),u}}),Pr=Object.prototype.hasOwnProperty,Ir=Object.prototype.toString;var Mr=new lr(\"tag:yaml.org,2002:omap\",{kind:\"sequence\",resolve:function resolveYamlOmap(o){if(null===o)return!0;var s,i,u,_,w,x=[],C=o;for(s=0,i=C.length;s<i;s+=1){if(u=C[s],w=!1,\"[object Object]\"!==Ir.call(u))return!1;for(_ in u)if(Pr.call(u,_)){if(w)return!1;w=!0}if(!w)return!1;if(-1!==x.indexOf(_))return!1;x.push(_)}return!0},construct:function constructYamlOmap(o){return null!==o?o:[]}}),Nr=Object.prototype.toString;var Tr=new lr(\"tag:yaml.org,2002:pairs\",{kind:\"sequence\",resolve:function resolveYamlPairs(o){if(null===o)return!0;var s,i,u,_,w,x=o;for(w=new Array(x.length),s=0,i=x.length;s<i;s+=1){if(u=x[s],\"[object Object]\"!==Nr.call(u))return!1;if(1!==(_=Object.keys(u)).length)return!1;w[s]=[_[0],u[_[0]]]}return!0},construct:function constructYamlPairs(o){if(null===o)return[];var s,i,u,_,w,x=o;for(w=new Array(x.length),s=0,i=x.length;s<i;s+=1)u=x[s],_=Object.keys(u),w[s]=[_[0],u[_[0]]];return w}}),Rr=Object.prototype.hasOwnProperty;var Dr=new lr(\"tag:yaml.org,2002:set\",{kind:\"mapping\",resolve:function resolveYamlSet(o){if(null===o)return!0;var s,i=o;for(s in i)if(Rr.call(i,s)&&null!==i[s])return!1;return!0},construct:function constructYamlSet(o){return null!==o?o:{}}}),Lr=Sr.extend({implicit:[Or,Cr],explicit:[jr,Mr,Tr,Dr]}),Br=Object.prototype.hasOwnProperty,Fr=1,qr=2,$r=3,Vr=4,Ur=1,zr=2,Wr=3,Kr=/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/,Hr=/[\\x85\\u2028\\u2029]/,Jr=/[,\\[\\]\\{\\}]/,Gr=/^(?:!|!!|![a-z\\-]+!)$/i,Yr=/^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;function _class(o){return Object.prototype.toString.call(o)}function is_EOL(o){return 10===o||13===o}function is_WHITE_SPACE(o){return 9===o||32===o}function is_WS_OR_EOL(o){return 9===o||32===o||10===o||13===o}function is_FLOW_INDICATOR(o){return 44===o||91===o||93===o||123===o||125===o}function fromHexCode(o){var s;return 48<=o&&o<=57?o-48:97<=(s=32|o)&&s<=102?s-97+10:-1}function simpleEscapeSequence(o){return 48===o?\"\\0\":97===o?\"\u0007\":98===o?\"\\b\":116===o||9===o?\"\\t\":110===o?\"\\n\":118===o?\"\\v\":102===o?\"\\f\":114===o?\"\\r\":101===o?\"\u001b\":32===o?\" \":34===o?'\"':47===o?\"/\":92===o?\"\\\\\":78===o?\"\":95===o?\" \":76===o?\"\\u2028\":80===o?\"\\u2029\":\"\"}function charFromCodepoint(o){return o<=65535?String.fromCharCode(o):String.fromCharCode(55296+(o-65536>>10),56320+(o-65536&1023))}for(var Xr=new Array(256),Qr=new Array(256),Zr=0;Zr<256;Zr++)Xr[Zr]=simpleEscapeSequence(Zr)?1:0,Qr[Zr]=simpleEscapeSequence(Zr);function State$1(o,s){this.input=o,this.filename=s.filename||null,this.schema=s.schema||Lr,this.onWarning=s.onWarning||null,this.legacy=s.legacy||!1,this.json=s.json||!1,this.listener=s.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=o.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function generateError(o,s){var i={name:o.filename,buffer:o.input.slice(0,-1),position:o.position,line:o.line,column:o.position-o.lineStart};return i.snippet=ir(i),new sr(s,i)}function throwError(o,s){throw generateError(o,s)}function throwWarning(o,s){o.onWarning&&o.onWarning.call(null,generateError(o,s))}var en={YAML:function handleYamlDirective(o,s,i){var u,_,w;null!==o.version&&throwError(o,\"duplication of %YAML directive\"),1!==i.length&&throwError(o,\"YAML directive accepts exactly one argument\"),null===(u=/^([0-9]+)\\.([0-9]+)$/.exec(i[0]))&&throwError(o,\"ill-formed argument of the YAML directive\"),_=parseInt(u[1],10),w=parseInt(u[2],10),1!==_&&throwError(o,\"unacceptable YAML version of the document\"),o.version=i[0],o.checkLineBreaks=w<2,1!==w&&2!==w&&throwWarning(o,\"unsupported YAML version of the document\")},TAG:function handleTagDirective(o,s,i){var u,_;2!==i.length&&throwError(o,\"TAG directive accepts exactly two arguments\"),u=i[0],_=i[1],Gr.test(u)||throwError(o,\"ill-formed tag handle (first argument) of the TAG directive\"),Br.call(o.tagMap,u)&&throwError(o,'there is a previously declared suffix for \"'+u+'\" tag handle'),Yr.test(_)||throwError(o,\"ill-formed tag prefix (second argument) of the TAG directive\");try{_=decodeURIComponent(_)}catch(s){throwError(o,\"tag prefix is malformed: \"+_)}o.tagMap[u]=_}};function captureSegment(o,s,i,u){var _,w,x,C;if(s<i){if(C=o.input.slice(s,i),u)for(_=0,w=C.length;_<w;_+=1)9===(x=C.charCodeAt(_))||32<=x&&x<=1114111||throwError(o,\"expected valid JSON character\");else Kr.test(C)&&throwError(o,\"the stream contains non-printable characters\");o.result+=C}}function mergeMappings(o,s,i,u){var _,w,x,C;for(nr.isObject(i)||throwError(o,\"cannot merge mappings; the provided source object is unacceptable\"),x=0,C=(_=Object.keys(i)).length;x<C;x+=1)w=_[x],Br.call(s,w)||(s[w]=i[w],u[w]=!0)}function storeMappingPair(o,s,i,u,_,w,x,C,j){var L,B;if(Array.isArray(_))for(L=0,B=(_=Array.prototype.slice.call(_)).length;L<B;L+=1)Array.isArray(_[L])&&throwError(o,\"nested arrays are not supported inside keys\"),\"object\"==typeof _&&\"[object Object]\"===_class(_[L])&&(_[L]=\"[object Object]\");if(\"object\"==typeof _&&\"[object Object]\"===_class(_)&&(_=\"[object Object]\"),_=String(_),null===s&&(s={}),\"tag:yaml.org,2002:merge\"===u)if(Array.isArray(w))for(L=0,B=w.length;L<B;L+=1)mergeMappings(o,s,w[L],i);else mergeMappings(o,s,w,i);else o.json||Br.call(i,_)||!Br.call(s,_)||(o.line=x||o.line,o.lineStart=C||o.lineStart,o.position=j||o.position,throwError(o,\"duplicated mapping key\")),\"__proto__\"===_?Object.defineProperty(s,_,{configurable:!0,enumerable:!0,writable:!0,value:w}):s[_]=w,delete i[_];return s}function readLineBreak(o){var s;10===(s=o.input.charCodeAt(o.position))?o.position++:13===s?(o.position++,10===o.input.charCodeAt(o.position)&&o.position++):throwError(o,\"a line break is expected\"),o.line+=1,o.lineStart=o.position,o.firstTabInLine=-1}function skipSeparationSpace(o,s,i){for(var u=0,_=o.input.charCodeAt(o.position);0!==_;){for(;is_WHITE_SPACE(_);)9===_&&-1===o.firstTabInLine&&(o.firstTabInLine=o.position),_=o.input.charCodeAt(++o.position);if(s&&35===_)do{_=o.input.charCodeAt(++o.position)}while(10!==_&&13!==_&&0!==_);if(!is_EOL(_))break;for(readLineBreak(o),_=o.input.charCodeAt(o.position),u++,o.lineIndent=0;32===_;)o.lineIndent++,_=o.input.charCodeAt(++o.position)}return-1!==i&&0!==u&&o.lineIndent<i&&throwWarning(o,\"deficient indentation\"),u}function testDocumentSeparator(o){var s,i=o.position;return!(45!==(s=o.input.charCodeAt(i))&&46!==s||s!==o.input.charCodeAt(i+1)||s!==o.input.charCodeAt(i+2)||(i+=3,0!==(s=o.input.charCodeAt(i))&&!is_WS_OR_EOL(s)))}function writeFoldedLines(o,s){1===s?o.result+=\" \":s>1&&(o.result+=nr.repeat(\"\\n\",s-1))}function readBlockSequence(o,s){var i,u,_=o.tag,w=o.anchor,x=[],C=!1;if(-1!==o.firstTabInLine)return!1;for(null!==o.anchor&&(o.anchorMap[o.anchor]=x),u=o.input.charCodeAt(o.position);0!==u&&(-1!==o.firstTabInLine&&(o.position=o.firstTabInLine,throwError(o,\"tab characters must not be used in indentation\")),45===u)&&is_WS_OR_EOL(o.input.charCodeAt(o.position+1));)if(C=!0,o.position++,skipSeparationSpace(o,!0,-1)&&o.lineIndent<=s)x.push(null),u=o.input.charCodeAt(o.position);else if(i=o.line,composeNode(o,s,$r,!1,!0),x.push(o.result),skipSeparationSpace(o,!0,-1),u=o.input.charCodeAt(o.position),(o.line===i||o.lineIndent>s)&&0!==u)throwError(o,\"bad indentation of a sequence entry\");else if(o.lineIndent<s)break;return!!C&&(o.tag=_,o.anchor=w,o.kind=\"sequence\",o.result=x,!0)}function readTagProperty(o){var s,i,u,_,w=!1,x=!1;if(33!==(_=o.input.charCodeAt(o.position)))return!1;if(null!==o.tag&&throwError(o,\"duplication of a tag property\"),60===(_=o.input.charCodeAt(++o.position))?(w=!0,_=o.input.charCodeAt(++o.position)):33===_?(x=!0,i=\"!!\",_=o.input.charCodeAt(++o.position)):i=\"!\",s=o.position,w){do{_=o.input.charCodeAt(++o.position)}while(0!==_&&62!==_);o.position<o.length?(u=o.input.slice(s,o.position),_=o.input.charCodeAt(++o.position)):throwError(o,\"unexpected end of the stream within a verbatim tag\")}else{for(;0!==_&&!is_WS_OR_EOL(_);)33===_&&(x?throwError(o,\"tag suffix cannot contain exclamation marks\"):(i=o.input.slice(s-1,o.position+1),Gr.test(i)||throwError(o,\"named tag handle cannot contain such characters\"),x=!0,s=o.position+1)),_=o.input.charCodeAt(++o.position);u=o.input.slice(s,o.position),Jr.test(u)&&throwError(o,\"tag suffix cannot contain flow indicator characters\")}u&&!Yr.test(u)&&throwError(o,\"tag name cannot contain such characters: \"+u);try{u=decodeURIComponent(u)}catch(s){throwError(o,\"tag name is malformed: \"+u)}return w?o.tag=u:Br.call(o.tagMap,i)?o.tag=o.tagMap[i]+u:\"!\"===i?o.tag=\"!\"+u:\"!!\"===i?o.tag=\"tag:yaml.org,2002:\"+u:throwError(o,'undeclared tag handle \"'+i+'\"'),!0}function readAnchorProperty(o){var s,i;if(38!==(i=o.input.charCodeAt(o.position)))return!1;for(null!==o.anchor&&throwError(o,\"duplication of an anchor property\"),i=o.input.charCodeAt(++o.position),s=o.position;0!==i&&!is_WS_OR_EOL(i)&&!is_FLOW_INDICATOR(i);)i=o.input.charCodeAt(++o.position);return o.position===s&&throwError(o,\"name of an anchor node must contain at least one character\"),o.anchor=o.input.slice(s,o.position),!0}function composeNode(o,s,i,u,_){var w,x,C,j,L,B,$,V,U,z=1,Y=!1,Z=!1;if(null!==o.listener&&o.listener(\"open\",o),o.tag=null,o.anchor=null,o.kind=null,o.result=null,w=x=C=Vr===i||$r===i,u&&skipSeparationSpace(o,!0,-1)&&(Y=!0,o.lineIndent>s?z=1:o.lineIndent===s?z=0:o.lineIndent<s&&(z=-1)),1===z)for(;readTagProperty(o)||readAnchorProperty(o);)skipSeparationSpace(o,!0,-1)?(Y=!0,C=w,o.lineIndent>s?z=1:o.lineIndent===s?z=0:o.lineIndent<s&&(z=-1)):C=!1;if(C&&(C=Y||_),1!==z&&Vr!==i||(V=Fr===i||qr===i?s:s+1,U=o.position-o.lineStart,1===z?C&&(readBlockSequence(o,U)||function readBlockMapping(o,s,i){var u,_,w,x,C,j,L,B=o.tag,$=o.anchor,V={},U=Object.create(null),z=null,Y=null,Z=null,ee=!1,ie=!1;if(-1!==o.firstTabInLine)return!1;for(null!==o.anchor&&(o.anchorMap[o.anchor]=V),L=o.input.charCodeAt(o.position);0!==L;){if(ee||-1===o.firstTabInLine||(o.position=o.firstTabInLine,throwError(o,\"tab characters must not be used in indentation\")),u=o.input.charCodeAt(o.position+1),w=o.line,63!==L&&58!==L||!is_WS_OR_EOL(u)){if(x=o.line,C=o.lineStart,j=o.position,!composeNode(o,i,qr,!1,!0))break;if(o.line===w){for(L=o.input.charCodeAt(o.position);is_WHITE_SPACE(L);)L=o.input.charCodeAt(++o.position);if(58===L)is_WS_OR_EOL(L=o.input.charCodeAt(++o.position))||throwError(o,\"a whitespace character is expected after the key-value separator within a block mapping\"),ee&&(storeMappingPair(o,V,U,z,Y,null,x,C,j),z=Y=Z=null),ie=!0,ee=!1,_=!1,z=o.tag,Y=o.result;else{if(!ie)return o.tag=B,o.anchor=$,!0;throwError(o,\"can not read an implicit mapping pair; a colon is missed\")}}else{if(!ie)return o.tag=B,o.anchor=$,!0;throwError(o,\"can not read a block mapping entry; a multiline key may not be an implicit key\")}}else 63===L?(ee&&(storeMappingPair(o,V,U,z,Y,null,x,C,j),z=Y=Z=null),ie=!0,ee=!0,_=!0):ee?(ee=!1,_=!0):throwError(o,\"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line\"),o.position+=1,L=u;if((o.line===w||o.lineIndent>s)&&(ee&&(x=o.line,C=o.lineStart,j=o.position),composeNode(o,s,Vr,!0,_)&&(ee?Y=o.result:Z=o.result),ee||(storeMappingPair(o,V,U,z,Y,Z,x,C,j),z=Y=Z=null),skipSeparationSpace(o,!0,-1),L=o.input.charCodeAt(o.position)),(o.line===w||o.lineIndent>s)&&0!==L)throwError(o,\"bad indentation of a mapping entry\");else if(o.lineIndent<s)break}return ee&&storeMappingPair(o,V,U,z,Y,null,x,C,j),ie&&(o.tag=B,o.anchor=$,o.kind=\"mapping\",o.result=V),ie}(o,U,V))||function readFlowCollection(o,s){var i,u,_,w,x,C,j,L,B,$,V,U,z=!0,Y=o.tag,Z=o.anchor,ee=Object.create(null);if(91===(U=o.input.charCodeAt(o.position)))x=93,L=!1,w=[];else{if(123!==U)return!1;x=125,L=!0,w={}}for(null!==o.anchor&&(o.anchorMap[o.anchor]=w),U=o.input.charCodeAt(++o.position);0!==U;){if(skipSeparationSpace(o,!0,s),(U=o.input.charCodeAt(o.position))===x)return o.position++,o.tag=Y,o.anchor=Z,o.kind=L?\"mapping\":\"sequence\",o.result=w,!0;z?44===U&&throwError(o,\"expected the node content, but found ','\"):throwError(o,\"missed comma between flow collection entries\"),V=null,C=j=!1,63===U&&is_WS_OR_EOL(o.input.charCodeAt(o.position+1))&&(C=j=!0,o.position++,skipSeparationSpace(o,!0,s)),i=o.line,u=o.lineStart,_=o.position,composeNode(o,s,Fr,!1,!0),$=o.tag,B=o.result,skipSeparationSpace(o,!0,s),U=o.input.charCodeAt(o.position),!j&&o.line!==i||58!==U||(C=!0,U=o.input.charCodeAt(++o.position),skipSeparationSpace(o,!0,s),composeNode(o,s,Fr,!1,!0),V=o.result),L?storeMappingPair(o,w,ee,$,B,V,i,u,_):C?w.push(storeMappingPair(o,null,ee,$,B,V,i,u,_)):w.push(B),skipSeparationSpace(o,!0,s),44===(U=o.input.charCodeAt(o.position))?(z=!0,U=o.input.charCodeAt(++o.position)):z=!1}throwError(o,\"unexpected end of the stream within a flow collection\")}(o,V)?Z=!0:(x&&function readBlockScalar(o,s){var i,u,_,w,x,C=Ur,j=!1,L=!1,B=s,$=0,V=!1;if(124===(w=o.input.charCodeAt(o.position)))u=!1;else{if(62!==w)return!1;u=!0}for(o.kind=\"scalar\",o.result=\"\";0!==w;)if(43===(w=o.input.charCodeAt(++o.position))||45===w)Ur===C?C=43===w?Wr:zr:throwError(o,\"repeat of a chomping mode identifier\");else{if(!((_=48<=(x=w)&&x<=57?x-48:-1)>=0))break;0===_?throwError(o,\"bad explicit indentation width of a block scalar; it cannot be less than one\"):L?throwError(o,\"repeat of an indentation width identifier\"):(B=s+_-1,L=!0)}if(is_WHITE_SPACE(w)){do{w=o.input.charCodeAt(++o.position)}while(is_WHITE_SPACE(w));if(35===w)do{w=o.input.charCodeAt(++o.position)}while(!is_EOL(w)&&0!==w)}for(;0!==w;){for(readLineBreak(o),o.lineIndent=0,w=o.input.charCodeAt(o.position);(!L||o.lineIndent<B)&&32===w;)o.lineIndent++,w=o.input.charCodeAt(++o.position);if(!L&&o.lineIndent>B&&(B=o.lineIndent),is_EOL(w))$++;else{if(o.lineIndent<B){C===Wr?o.result+=nr.repeat(\"\\n\",j?1+$:$):C===Ur&&j&&(o.result+=\"\\n\");break}for(u?is_WHITE_SPACE(w)?(V=!0,o.result+=nr.repeat(\"\\n\",j?1+$:$)):V?(V=!1,o.result+=nr.repeat(\"\\n\",$+1)):0===$?j&&(o.result+=\" \"):o.result+=nr.repeat(\"\\n\",$):o.result+=nr.repeat(\"\\n\",j?1+$:$),j=!0,L=!0,$=0,i=o.position;!is_EOL(w)&&0!==w;)w=o.input.charCodeAt(++o.position);captureSegment(o,i,o.position,!1)}}return!0}(o,V)||function readSingleQuotedScalar(o,s){var i,u,_;if(39!==(i=o.input.charCodeAt(o.position)))return!1;for(o.kind=\"scalar\",o.result=\"\",o.position++,u=_=o.position;0!==(i=o.input.charCodeAt(o.position));)if(39===i){if(captureSegment(o,u,o.position,!0),39!==(i=o.input.charCodeAt(++o.position)))return!0;u=o.position,o.position++,_=o.position}else is_EOL(i)?(captureSegment(o,u,_,!0),writeFoldedLines(o,skipSeparationSpace(o,!1,s)),u=_=o.position):o.position===o.lineStart&&testDocumentSeparator(o)?throwError(o,\"unexpected end of the document within a single quoted scalar\"):(o.position++,_=o.position);throwError(o,\"unexpected end of the stream within a single quoted scalar\")}(o,V)||function readDoubleQuotedScalar(o,s){var i,u,_,w,x,C,j;if(34!==(C=o.input.charCodeAt(o.position)))return!1;for(o.kind=\"scalar\",o.result=\"\",o.position++,i=u=o.position;0!==(C=o.input.charCodeAt(o.position));){if(34===C)return captureSegment(o,i,o.position,!0),o.position++,!0;if(92===C){if(captureSegment(o,i,o.position,!0),is_EOL(C=o.input.charCodeAt(++o.position)))skipSeparationSpace(o,!1,s);else if(C<256&&Xr[C])o.result+=Qr[C],o.position++;else if((x=120===(j=C)?2:117===j?4:85===j?8:0)>0){for(_=x,w=0;_>0;_--)(x=fromHexCode(C=o.input.charCodeAt(++o.position)))>=0?w=(w<<4)+x:throwError(o,\"expected hexadecimal character\");o.result+=charFromCodepoint(w),o.position++}else throwError(o,\"unknown escape sequence\");i=u=o.position}else is_EOL(C)?(captureSegment(o,i,u,!0),writeFoldedLines(o,skipSeparationSpace(o,!1,s)),i=u=o.position):o.position===o.lineStart&&testDocumentSeparator(o)?throwError(o,\"unexpected end of the document within a double quoted scalar\"):(o.position++,u=o.position)}throwError(o,\"unexpected end of the stream within a double quoted scalar\")}(o,V)?Z=!0:!function readAlias(o){var s,i,u;if(42!==(u=o.input.charCodeAt(o.position)))return!1;for(u=o.input.charCodeAt(++o.position),s=o.position;0!==u&&!is_WS_OR_EOL(u)&&!is_FLOW_INDICATOR(u);)u=o.input.charCodeAt(++o.position);return o.position===s&&throwError(o,\"name of an alias node must contain at least one character\"),i=o.input.slice(s,o.position),Br.call(o.anchorMap,i)||throwError(o,'unidentified alias \"'+i+'\"'),o.result=o.anchorMap[i],skipSeparationSpace(o,!0,-1),!0}(o)?function readPlainScalar(o,s,i){var u,_,w,x,C,j,L,B,$=o.kind,V=o.result;if(is_WS_OR_EOL(B=o.input.charCodeAt(o.position))||is_FLOW_INDICATOR(B)||35===B||38===B||42===B||33===B||124===B||62===B||39===B||34===B||37===B||64===B||96===B)return!1;if((63===B||45===B)&&(is_WS_OR_EOL(u=o.input.charCodeAt(o.position+1))||i&&is_FLOW_INDICATOR(u)))return!1;for(o.kind=\"scalar\",o.result=\"\",_=w=o.position,x=!1;0!==B;){if(58===B){if(is_WS_OR_EOL(u=o.input.charCodeAt(o.position+1))||i&&is_FLOW_INDICATOR(u))break}else if(35===B){if(is_WS_OR_EOL(o.input.charCodeAt(o.position-1)))break}else{if(o.position===o.lineStart&&testDocumentSeparator(o)||i&&is_FLOW_INDICATOR(B))break;if(is_EOL(B)){if(C=o.line,j=o.lineStart,L=o.lineIndent,skipSeparationSpace(o,!1,-1),o.lineIndent>=s){x=!0,B=o.input.charCodeAt(o.position);continue}o.position=w,o.line=C,o.lineStart=j,o.lineIndent=L;break}}x&&(captureSegment(o,_,w,!1),writeFoldedLines(o,o.line-C),_=w=o.position,x=!1),is_WHITE_SPACE(B)||(w=o.position+1),B=o.input.charCodeAt(++o.position)}return captureSegment(o,_,w,!1),!!o.result||(o.kind=$,o.result=V,!1)}(o,V,Fr===i)&&(Z=!0,null===o.tag&&(o.tag=\"?\")):(Z=!0,null===o.tag&&null===o.anchor||throwError(o,\"alias node should not have any properties\")),null!==o.anchor&&(o.anchorMap[o.anchor]=o.result)):0===z&&(Z=C&&readBlockSequence(o,U))),null===o.tag)null!==o.anchor&&(o.anchorMap[o.anchor]=o.result);else if(\"?\"===o.tag){for(null!==o.result&&\"scalar\"!==o.kind&&throwError(o,'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"'+o.kind+'\"'),j=0,L=o.implicitTypes.length;j<L;j+=1)if(($=o.implicitTypes[j]).resolve(o.result)){o.result=$.construct(o.result),o.tag=$.tag,null!==o.anchor&&(o.anchorMap[o.anchor]=o.result);break}}else if(\"!\"!==o.tag){if(Br.call(o.typeMap[o.kind||\"fallback\"],o.tag))$=o.typeMap[o.kind||\"fallback\"][o.tag];else for($=null,j=0,L=(B=o.typeMap.multi[o.kind||\"fallback\"]).length;j<L;j+=1)if(o.tag.slice(0,B[j].tag.length)===B[j].tag){$=B[j];break}$||throwError(o,\"unknown tag !<\"+o.tag+\">\"),null!==o.result&&$.kind!==o.kind&&throwError(o,\"unacceptable node kind for !<\"+o.tag+'> tag; it should be \"'+$.kind+'\", not \"'+o.kind+'\"'),$.resolve(o.result,o.tag)?(o.result=$.construct(o.result,o.tag),null!==o.anchor&&(o.anchorMap[o.anchor]=o.result)):throwError(o,\"cannot resolve a node with !<\"+o.tag+\"> explicit tag\")}return null!==o.listener&&o.listener(\"close\",o),null!==o.tag||null!==o.anchor||Z}function readDocument(o){var s,i,u,_,w=o.position,x=!1;for(o.version=null,o.checkLineBreaks=o.legacy,o.tagMap=Object.create(null),o.anchorMap=Object.create(null);0!==(_=o.input.charCodeAt(o.position))&&(skipSeparationSpace(o,!0,-1),_=o.input.charCodeAt(o.position),!(o.lineIndent>0||37!==_));){for(x=!0,_=o.input.charCodeAt(++o.position),s=o.position;0!==_&&!is_WS_OR_EOL(_);)_=o.input.charCodeAt(++o.position);for(u=[],(i=o.input.slice(s,o.position)).length<1&&throwError(o,\"directive name must not be less than one character in length\");0!==_;){for(;is_WHITE_SPACE(_);)_=o.input.charCodeAt(++o.position);if(35===_){do{_=o.input.charCodeAt(++o.position)}while(0!==_&&!is_EOL(_));break}if(is_EOL(_))break;for(s=o.position;0!==_&&!is_WS_OR_EOL(_);)_=o.input.charCodeAt(++o.position);u.push(o.input.slice(s,o.position))}0!==_&&readLineBreak(o),Br.call(en,i)?en[i](o,i,u):throwWarning(o,'unknown document directive \"'+i+'\"')}skipSeparationSpace(o,!0,-1),0===o.lineIndent&&45===o.input.charCodeAt(o.position)&&45===o.input.charCodeAt(o.position+1)&&45===o.input.charCodeAt(o.position+2)?(o.position+=3,skipSeparationSpace(o,!0,-1)):x&&throwError(o,\"directives end mark is expected\"),composeNode(o,o.lineIndent-1,Vr,!1,!0),skipSeparationSpace(o,!0,-1),o.checkLineBreaks&&Hr.test(o.input.slice(w,o.position))&&throwWarning(o,\"non-ASCII line breaks are interpreted as content\"),o.documents.push(o.result),o.position===o.lineStart&&testDocumentSeparator(o)?46===o.input.charCodeAt(o.position)&&(o.position+=3,skipSeparationSpace(o,!0,-1)):o.position<o.length-1&&throwError(o,\"end of the stream or a document separator is expected\")}function loadDocuments(o,s){s=s||{},0!==(o=String(o)).length&&(10!==o.charCodeAt(o.length-1)&&13!==o.charCodeAt(o.length-1)&&(o+=\"\\n\"),65279===o.charCodeAt(0)&&(o=o.slice(1)));var i=new State$1(o,s),u=o.indexOf(\"\\0\");for(-1!==u&&(i.position=u,throwError(i,\"null byte is not allowed in input\")),i.input+=\"\\0\";32===i.input.charCodeAt(i.position);)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)readDocument(i);return i.documents}var tn={loadAll:function loadAll$1(o,s,i){null!==s&&\"object\"==typeof s&&void 0===i&&(i=s,s=null);var u=loadDocuments(o,i);if(\"function\"!=typeof s)return u;for(var _=0,w=u.length;_<w;_+=1)s(u[_])},load:function load$1(o,s){var i=loadDocuments(o,s);if(0!==i.length){if(1===i.length)return i[0];throw new sr(\"expected a single document in the stream, but found more\")}}},rn=Object.prototype.toString,nn=Object.prototype.hasOwnProperty,on=65279,sn=9,an=10,cn=13,ln=32,un=33,pn=34,hn=35,dn=37,fn=38,mn=39,gn=42,yn=44,vn=45,bn=58,_n=61,En=62,wn=63,Sn=64,xn=91,kn=93,On=96,Cn=123,An=124,jn=125,Pn={0:\"\\\\0\",7:\"\\\\a\",8:\"\\\\b\",9:\"\\\\t\",10:\"\\\\n\",11:\"\\\\v\",12:\"\\\\f\",13:\"\\\\r\",27:\"\\\\e\",34:'\\\\\"',92:\"\\\\\\\\\",133:\"\\\\N\",160:\"\\\\_\",8232:\"\\\\L\",8233:\"\\\\P\"},In=[\"y\",\"Y\",\"yes\",\"Yes\",\"YES\",\"on\",\"On\",\"ON\",\"n\",\"N\",\"no\",\"No\",\"NO\",\"off\",\"Off\",\"OFF\"],Mn=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;function encodeHex(o){var s,i,u;if(s=o.toString(16).toUpperCase(),o<=255)i=\"x\",u=2;else if(o<=65535)i=\"u\",u=4;else{if(!(o<=4294967295))throw new sr(\"code point within a string may not be greater than 0xFFFFFFFF\");i=\"U\",u=8}return\"\\\\\"+i+nr.repeat(\"0\",u-s.length)+s}var Nn=1,Tn=2;function State(o){this.schema=o.schema||Lr,this.indent=Math.max(1,o.indent||2),this.noArrayIndent=o.noArrayIndent||!1,this.skipInvalid=o.skipInvalid||!1,this.flowLevel=nr.isNothing(o.flowLevel)?-1:o.flowLevel,this.styleMap=function compileStyleMap(o,s){var i,u,_,w,x,C,j;if(null===s)return{};for(i={},_=0,w=(u=Object.keys(s)).length;_<w;_+=1)x=u[_],C=String(s[x]),\"!!\"===x.slice(0,2)&&(x=\"tag:yaml.org,2002:\"+x.slice(2)),(j=o.compiledTypeMap.fallback[x])&&nn.call(j.styleAliases,C)&&(C=j.styleAliases[C]),i[x]=C;return i}(this.schema,o.styles||null),this.sortKeys=o.sortKeys||!1,this.lineWidth=o.lineWidth||80,this.noRefs=o.noRefs||!1,this.noCompatMode=o.noCompatMode||!1,this.condenseFlow=o.condenseFlow||!1,this.quotingType='\"'===o.quotingType?Tn:Nn,this.forceQuotes=o.forceQuotes||!1,this.replacer=\"function\"==typeof o.replacer?o.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=\"\",this.duplicates=[],this.usedDuplicates=null}function indentString(o,s){for(var i,u=nr.repeat(\" \",s),_=0,w=-1,x=\"\",C=o.length;_<C;)-1===(w=o.indexOf(\"\\n\",_))?(i=o.slice(_),_=C):(i=o.slice(_,w+1),_=w+1),i.length&&\"\\n\"!==i&&(x+=u),x+=i;return x}function generateNextLine(o,s){return\"\\n\"+nr.repeat(\" \",o.indent*s)}function isWhitespace(o){return o===ln||o===sn}function isPrintable(o){return 32<=o&&o<=126||161<=o&&o<=55295&&8232!==o&&8233!==o||57344<=o&&o<=65533&&o!==on||65536<=o&&o<=1114111}function isNsCharOrWhitespace(o){return isPrintable(o)&&o!==on&&o!==cn&&o!==an}function isPlainSafe(o,s,i){var u=isNsCharOrWhitespace(o),_=u&&!isWhitespace(o);return(i?u:u&&o!==yn&&o!==xn&&o!==kn&&o!==Cn&&o!==jn)&&o!==hn&&!(s===bn&&!_)||isNsCharOrWhitespace(s)&&!isWhitespace(s)&&o===hn||s===bn&&_}function codePointAt(o,s){var i,u=o.charCodeAt(s);return u>=55296&&u<=56319&&s+1<o.length&&(i=o.charCodeAt(s+1))>=56320&&i<=57343?1024*(u-55296)+i-56320+65536:u}function needIndentIndicator(o){return/^\\n* /.test(o)}var Rn=1,Dn=2,Ln=3,Bn=4,Fn=5;function chooseScalarStyle(o,s,i,u,_,w,x,C){var j,L=0,B=null,$=!1,V=!1,U=-1!==u,z=-1,Y=function isPlainSafeFirst(o){return isPrintable(o)&&o!==on&&!isWhitespace(o)&&o!==vn&&o!==wn&&o!==bn&&o!==yn&&o!==xn&&o!==kn&&o!==Cn&&o!==jn&&o!==hn&&o!==fn&&o!==gn&&o!==un&&o!==An&&o!==_n&&o!==En&&o!==mn&&o!==pn&&o!==dn&&o!==Sn&&o!==On}(codePointAt(o,0))&&function isPlainSafeLast(o){return!isWhitespace(o)&&o!==bn}(codePointAt(o,o.length-1));if(s||x)for(j=0;j<o.length;L>=65536?j+=2:j++){if(!isPrintable(L=codePointAt(o,j)))return Fn;Y=Y&&isPlainSafe(L,B,C),B=L}else{for(j=0;j<o.length;L>=65536?j+=2:j++){if((L=codePointAt(o,j))===an)$=!0,U&&(V=V||j-z-1>u&&\" \"!==o[z+1],z=j);else if(!isPrintable(L))return Fn;Y=Y&&isPlainSafe(L,B,C),B=L}V=V||U&&j-z-1>u&&\" \"!==o[z+1]}return $||V?i>9&&needIndentIndicator(o)?Fn:x?w===Tn?Fn:Dn:V?Bn:Ln:!Y||x||_(o)?w===Tn?Fn:Dn:Rn}function writeScalar(o,s,i,u,_){o.dump=function(){if(0===s.length)return o.quotingType===Tn?'\"\"':\"''\";if(!o.noCompatMode&&(-1!==In.indexOf(s)||Mn.test(s)))return o.quotingType===Tn?'\"'+s+'\"':\"'\"+s+\"'\";var w=o.indent*Math.max(1,i),x=-1===o.lineWidth?-1:Math.max(Math.min(o.lineWidth,40),o.lineWidth-w),C=u||o.flowLevel>-1&&i>=o.flowLevel;switch(chooseScalarStyle(s,C,o.indent,x,(function testAmbiguity(s){return function testImplicitResolving(o,s){var i,u;for(i=0,u=o.implicitTypes.length;i<u;i+=1)if(o.implicitTypes[i].resolve(s))return!0;return!1}(o,s)}),o.quotingType,o.forceQuotes&&!u,_)){case Rn:return s;case Dn:return\"'\"+s.replace(/'/g,\"''\")+\"'\";case Ln:return\"|\"+blockHeader(s,o.indent)+dropEndingNewline(indentString(s,w));case Bn:return\">\"+blockHeader(s,o.indent)+dropEndingNewline(indentString(function foldString(o,s){var i,u,_=/(\\n+)([^\\n]*)/g,w=(C=o.indexOf(\"\\n\"),C=-1!==C?C:o.length,_.lastIndex=C,foldLine(o.slice(0,C),s)),x=\"\\n\"===o[0]||\" \"===o[0];var C;for(;u=_.exec(o);){var j=u[1],L=u[2];i=\" \"===L[0],w+=j+(x||i||\"\"===L?\"\":\"\\n\")+foldLine(L,s),x=i}return w}(s,x),w));case Fn:return'\"'+function escapeString(o){for(var s,i=\"\",u=0,_=0;_<o.length;u>=65536?_+=2:_++)u=codePointAt(o,_),!(s=Pn[u])&&isPrintable(u)?(i+=o[_],u>=65536&&(i+=o[_+1])):i+=s||encodeHex(u);return i}(s)+'\"';default:throw new sr(\"impossible error: invalid scalar style\")}}()}function blockHeader(o,s){var i=needIndentIndicator(o)?String(s):\"\",u=\"\\n\"===o[o.length-1];return i+(u&&(\"\\n\"===o[o.length-2]||\"\\n\"===o)?\"+\":u?\"\":\"-\")+\"\\n\"}function dropEndingNewline(o){return\"\\n\"===o[o.length-1]?o.slice(0,-1):o}function foldLine(o,s){if(\"\"===o||\" \"===o[0])return o;for(var i,u,_=/ [^ ]/g,w=0,x=0,C=0,j=\"\";i=_.exec(o);)(C=i.index)-w>s&&(u=x>w?x:C,j+=\"\\n\"+o.slice(w,u),w=u+1),x=C;return j+=\"\\n\",o.length-w>s&&x>w?j+=o.slice(w,x)+\"\\n\"+o.slice(x+1):j+=o.slice(w),j.slice(1)}function writeBlockSequence(o,s,i,u){var _,w,x,C=\"\",j=o.tag;for(_=0,w=i.length;_<w;_+=1)x=i[_],o.replacer&&(x=o.replacer.call(i,String(_),x)),(writeNode(o,s+1,x,!0,!0,!1,!0)||void 0===x&&writeNode(o,s+1,null,!0,!0,!1,!0))&&(u&&\"\"===C||(C+=generateNextLine(o,s)),o.dump&&an===o.dump.charCodeAt(0)?C+=\"-\":C+=\"- \",C+=o.dump);o.tag=j,o.dump=C||\"[]\"}function detectType(o,s,i){var u,_,w,x,C,j;for(w=0,x=(_=i?o.explicitTypes:o.implicitTypes).length;w<x;w+=1)if(((C=_[w]).instanceOf||C.predicate)&&(!C.instanceOf||\"object\"==typeof s&&s instanceof C.instanceOf)&&(!C.predicate||C.predicate(s))){if(i?C.multi&&C.representName?o.tag=C.representName(s):o.tag=C.tag:o.tag=\"?\",C.represent){if(j=o.styleMap[C.tag]||C.defaultStyle,\"[object Function]\"===rn.call(C.represent))u=C.represent(s,j);else{if(!nn.call(C.represent,j))throw new sr(\"!<\"+C.tag+'> tag resolver accepts not \"'+j+'\" style');u=C.represent[j](s,j)}o.dump=u}return!0}return!1}function writeNode(o,s,i,u,_,w,x){o.tag=null,o.dump=i,detectType(o,i,!1)||detectType(o,i,!0);var C,j=rn.call(o.dump),L=u;u&&(u=o.flowLevel<0||o.flowLevel>s);var B,$,V=\"[object Object]\"===j||\"[object Array]\"===j;if(V&&($=-1!==(B=o.duplicates.indexOf(i))),(null!==o.tag&&\"?\"!==o.tag||$||2!==o.indent&&s>0)&&(_=!1),$&&o.usedDuplicates[B])o.dump=\"*ref_\"+B;else{if(V&&$&&!o.usedDuplicates[B]&&(o.usedDuplicates[B]=!0),\"[object Object]\"===j)u&&0!==Object.keys(o.dump).length?(!function writeBlockMapping(o,s,i,u){var _,w,x,C,j,L,B=\"\",$=o.tag,V=Object.keys(i);if(!0===o.sortKeys)V.sort();else if(\"function\"==typeof o.sortKeys)V.sort(o.sortKeys);else if(o.sortKeys)throw new sr(\"sortKeys must be a boolean or a function\");for(_=0,w=V.length;_<w;_+=1)L=\"\",u&&\"\"===B||(L+=generateNextLine(o,s)),C=i[x=V[_]],o.replacer&&(C=o.replacer.call(i,x,C)),writeNode(o,s+1,x,!0,!0,!0)&&((j=null!==o.tag&&\"?\"!==o.tag||o.dump&&o.dump.length>1024)&&(o.dump&&an===o.dump.charCodeAt(0)?L+=\"?\":L+=\"? \"),L+=o.dump,j&&(L+=generateNextLine(o,s)),writeNode(o,s+1,C,!0,j)&&(o.dump&&an===o.dump.charCodeAt(0)?L+=\":\":L+=\": \",B+=L+=o.dump));o.tag=$,o.dump=B||\"{}\"}(o,s,o.dump,_),$&&(o.dump=\"&ref_\"+B+o.dump)):(!function writeFlowMapping(o,s,i){var u,_,w,x,C,j=\"\",L=o.tag,B=Object.keys(i);for(u=0,_=B.length;u<_;u+=1)C=\"\",\"\"!==j&&(C+=\", \"),o.condenseFlow&&(C+='\"'),x=i[w=B[u]],o.replacer&&(x=o.replacer.call(i,w,x)),writeNode(o,s,w,!1,!1)&&(o.dump.length>1024&&(C+=\"? \"),C+=o.dump+(o.condenseFlow?'\"':\"\")+\":\"+(o.condenseFlow?\"\":\" \"),writeNode(o,s,x,!1,!1)&&(j+=C+=o.dump));o.tag=L,o.dump=\"{\"+j+\"}\"}(o,s,o.dump),$&&(o.dump=\"&ref_\"+B+\" \"+o.dump));else if(\"[object Array]\"===j)u&&0!==o.dump.length?(o.noArrayIndent&&!x&&s>0?writeBlockSequence(o,s-1,o.dump,_):writeBlockSequence(o,s,o.dump,_),$&&(o.dump=\"&ref_\"+B+o.dump)):(!function writeFlowSequence(o,s,i){var u,_,w,x=\"\",C=o.tag;for(u=0,_=i.length;u<_;u+=1)w=i[u],o.replacer&&(w=o.replacer.call(i,String(u),w)),(writeNode(o,s,w,!1,!1)||void 0===w&&writeNode(o,s,null,!1,!1))&&(\"\"!==x&&(x+=\",\"+(o.condenseFlow?\"\":\" \")),x+=o.dump);o.tag=C,o.dump=\"[\"+x+\"]\"}(o,s,o.dump),$&&(o.dump=\"&ref_\"+B+\" \"+o.dump));else{if(\"[object String]\"!==j){if(\"[object Undefined]\"===j)return!1;if(o.skipInvalid)return!1;throw new sr(\"unacceptable kind of an object to dump \"+j)}\"?\"!==o.tag&&writeScalar(o,o.dump,s,w,L)}null!==o.tag&&\"?\"!==o.tag&&(C=encodeURI(\"!\"===o.tag[0]?o.tag.slice(1):o.tag).replace(/!/g,\"%21\"),C=\"!\"===o.tag[0]?\"!\"+C:\"tag:yaml.org,2002:\"===C.slice(0,18)?\"!!\"+C.slice(18):\"!<\"+C+\">\",o.dump=C+\" \"+o.dump)}return!0}function getDuplicateReferences(o,s){var i,u,_=[],w=[];for(inspectNode(o,_,w),i=0,u=w.length;i<u;i+=1)s.duplicates.push(_[w[i]]);s.usedDuplicates=new Array(u)}function inspectNode(o,s,i){var u,_,w;if(null!==o&&\"object\"==typeof o)if(-1!==(_=s.indexOf(o)))-1===i.indexOf(_)&&i.push(_);else if(s.push(o),Array.isArray(o))for(_=0,w=o.length;_<w;_+=1)inspectNode(o[_],s,i);else for(_=0,w=(u=Object.keys(o)).length;_<w;_+=1)inspectNode(o[u[_]],s,i)}var qn=function dump$1(o,s){var i=new State(s=s||{});i.noRefs||getDuplicateReferences(o,i);var u=o;return i.replacer&&(u=i.replacer.call({\"\":u},\"\",u)),writeNode(i,0,u,!0,!0)?i.dump+\"\\n\":\"\"};function renamed(o,s){return function(){throw new Error(\"Function yaml.\"+o+\" is removed in js-yaml 4. Use yaml.\"+s+\" instead, which is now safe by default.\")}}var $n=lr,Vn=ur,Un=mr,zn=wr,Wn=Sr,Kn=Lr,Hn=tn.load,Jn=tn.loadAll,Gn={dump:qn}.dump,Yn=sr,Xn={binary:jr,float:Er,map:fr,null:gr,pairs:Tr,set:Dr,timestamp:Or,bool:yr,int:vr,merge:Cr,omap:Mr,seq:dr,str:pr},Qn=renamed(\"safeLoad\",\"load\"),Zn=renamed(\"safeLoadAll\",\"loadAll\"),eo=renamed(\"safeDump\",\"dump\");const to={Type:$n,Schema:Vn,FAILSAFE_SCHEMA:Un,JSON_SCHEMA:zn,CORE_SCHEMA:Wn,DEFAULT_SCHEMA:Kn,load:Hn,loadAll:Jn,dump:Gn,YAMLException:Yn,types:Xn,safeLoad:Qn,safeLoadAll:Zn,safeDump:eo},ro=\"configs_update\",no=\"configs_toggle\";function update(o,s){return{type:ro,payload:{[o]:s}}}function toggle(o){return{type:no,payload:o}}const actions_loaded=()=>()=>{},downloadConfig=o=>s=>{const{fn:{fetch:i}}=s;return i(o)},getConfigByUrl=(o,s)=>i=>{const{specActions:u,configsActions:_}=i;if(o)return _.downloadConfig(o).then(next,next);function next(_){_ instanceof Error||_.status>=400?(u.updateLoadingStatus(\"failedConfig\"),u.updateLoadingStatus(\"failedConfig\"),u.updateUrl(\"\"),console.error(_.statusText+\" \"+o.url),s(null)):s(((o,s)=>{try{return to.load(o)}catch(o){return s&&s.errActions.newThrownErr(new Error(o)),{}}})(_.text,i))}},get=(o,s)=>o.getIn(Array.isArray(s)?s:[s]),oo={[ro]:(o,s)=>o.merge((0,qe.fromJS)(s.payload)),[no]:(o,s)=>{const i=s.payload,u=o.get(i);return o.set(i,!u)}};function configsPlugin(){return{statePlugins:{configs:{reducers:oo,actions:u,selectors:w}}}}const setHash=o=>o?history.pushState(null,null,`#${o}`):window.location.hash=\"\";var so=__webpack_require__(86215),io=__webpack_require__.n(so);const ao=\"layout_scroll_to\",co=\"layout_clear_scroll\";const lo={fn:{getScrollParent:function getScrollParent(o,s){const i=document.documentElement;let u=getComputedStyle(o);const _=\"absolute\"===u.position,w=s?/(auto|scroll|hidden)/:/(auto|scroll)/;if(\"fixed\"===u.position)return i;for(let s=o;s=s.parentElement;)if(u=getComputedStyle(s),(!_||\"static\"!==u.position)&&w.test(u.overflow+u.overflowY+u.overflowX))return s;return i}},statePlugins:{layout:{actions:{scrollToElement:(o,s)=>i=>{try{s=s||i.fn.getScrollParent(o),io().createScroller(s).to(o)}catch(o){console.error(o)}},scrollTo:o=>({type:ao,payload:Array.isArray(o)?o:[o]}),clearScrollTo:()=>({type:co}),readyToScroll:(o,s)=>i=>{const u=i.layoutSelectors.getScrollToKey();$e().is(u,(0,qe.fromJS)(o))&&(i.layoutActions.scrollToElement(s),i.layoutActions.clearScrollTo())},parseDeepLinkHash:o=>({layoutActions:s,layoutSelectors:i,getConfigs:u})=>{if(u().deepLinking&&o){let u=o.slice(1);\"!\"===u[0]&&(u=u.slice(1)),\"/\"===u[0]&&(u=u.slice(1));const _=u.split(\"/\").map((o=>o||\"\")),w=i.isShownKeyFromUrlHashArray(_),[x,C=\"\",j=\"\"]=w;if(\"operations\"===x){const o=i.isShownKeyFromUrlHashArray([C]);C.indexOf(\"_\")>-1&&(console.warn(\"Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.\"),s.show(o.map((o=>o.replace(/_/g,\" \"))),!0)),s.show(o,!0)}(C.indexOf(\"_\")>-1||j.indexOf(\"_\")>-1)&&(console.warn(\"Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.\"),s.show(w.map((o=>o.replace(/_/g,\" \"))),!0)),s.show(w,!0),s.scrollTo(w)}}},selectors:{getScrollToKey:o=>o.get(\"scrollToKey\"),isShownKeyFromUrlHashArray(o,s){const[i,u]=s;return u?[\"operations\",i,u]:i?[\"operations-tag\",i]:[]},urlHashArrayFromIsShownKey(o,s){let[i,u,_]=s;return\"operations\"==i?[u,_]:\"operations-tag\"==i?[u]:[]}},reducers:{[ao]:(o,s)=>o.set(\"scrollToKey\",$e().fromJS(s.payload)),[co]:o=>o.delete(\"scrollToKey\")},wrapActions:{show:(o,{getConfigs:s,layoutSelectors:i})=>(...u)=>{if(o(...u),s().deepLinking)try{let[o,s]=u;o=Array.isArray(o)?o:[o];const _=i.urlHashArrayFromIsShownKey(o);if(!_.length)return;const[w,x]=_;if(!s)return setHash(\"/\");2===_.length?setHash(createDeepLinkPath(`/${encodeURIComponent(w)}/${encodeURIComponent(x)}`)):1===_.length&&setHash(createDeepLinkPath(`/${encodeURIComponent(w)}`))}catch(o){console.error(o)}}}}}};var uo=__webpack_require__(2209),po=__webpack_require__.n(uo);const operation_wrapper=(o,s)=>class OperationWrapper extends Pe.Component{onLoad=o=>{const{operation:i}=this.props,{tag:u,operationId:_}=i.toObject();let{isShownKey:w}=i.toObject();w=w||[\"operations\",u,_],s.layoutActions.readyToScroll(w,o)};render(){return Pe.createElement(\"span\",{ref:this.onLoad},Pe.createElement(o,this.props))}},operation_tag_wrapper=(o,s)=>class OperationTagWrapper extends Pe.Component{onLoad=o=>{const{tag:i}=this.props,u=[\"operations-tag\",i];s.layoutActions.readyToScroll(u,o)};render(){return Pe.createElement(\"span\",{ref:this.onLoad},Pe.createElement(o,this.props))}};function deep_linking(){return[lo,{statePlugins:{configs:{wrapActions:{loaded:(o,s)=>(...i)=>{o(...i);const u=decodeURIComponent(window.location.hash);s.layoutActions.parseDeepLinkHash(u)}}}},wrapComponents:{operation:operation_wrapper,OperationTag:operation_tag_wrapper}}]}var ho=__webpack_require__(40860),fo=__webpack_require__.n(ho);function transform(o){return o.map((o=>{let s=\"is not of a type(s)\",i=o.get(\"message\").indexOf(s);if(i>-1){let s=o.get(\"message\").slice(i+19).split(\",\");return o.set(\"message\",o.get(\"message\").slice(0,i)+function makeNewMessage(o){return o.reduce(((o,s,i,u)=>i===u.length-1&&u.length>1?o+\"or \"+s:u[i+1]&&u.length>2?o+s+\", \":u[i+1]?o+s+\" \":o+s),\"should be a\")}(s))}return o}))}var mo=__webpack_require__(58156),go=__webpack_require__.n(mo);function parameter_oneof_transform(o,{jsSpec:s}){return o}const yo=[x,C];function transformErrors(o){let s={jsSpec:{}},i=fo()(yo,((o,i)=>{try{return i.transform(o,s).filter((o=>!!o))}catch(s){return console.error(\"Transformer error:\",s),o}}),o);return i.filter((o=>!!o)).map((o=>(!o.get(\"line\")&&o.get(\"path\"),o)))}let vo={line:0,level:\"error\",message:\"Unknown error\"};const bo=Wt((o=>o),(o=>o.get(\"errors\",(0,qe.List)()))),_o=Wt(bo,(o=>o.last()));function err(s){return{statePlugins:{err:{reducers:{[et]:(o,{payload:s})=>{let i=Object.assign(vo,s,{type:\"thrown\"});return o.update(\"errors\",(o=>(o||(0,qe.List)()).push((0,qe.fromJS)(i)))).update(\"errors\",(o=>transformErrors(o)))},[tt]:(o,{payload:s})=>(s=s.map((o=>(0,qe.fromJS)(Object.assign(vo,o,{type:\"thrown\"})))),o.update(\"errors\",(o=>(o||(0,qe.List)()).concat((0,qe.fromJS)(s)))).update(\"errors\",(o=>transformErrors(o)))),[rt]:(o,{payload:s})=>{let i=(0,qe.fromJS)(s);return i=i.set(\"type\",\"spec\"),o.update(\"errors\",(o=>(o||(0,qe.List)()).push((0,qe.fromJS)(i)).sortBy((o=>o.get(\"line\"))))).update(\"errors\",(o=>transformErrors(o)))},[nt]:(o,{payload:s})=>(s=s.map((o=>(0,qe.fromJS)(Object.assign(vo,o,{type:\"spec\"})))),o.update(\"errors\",(o=>(o||(0,qe.List)()).concat((0,qe.fromJS)(s)))).update(\"errors\",(o=>transformErrors(o)))),[ot]:(o,{payload:s})=>{let i=(0,qe.fromJS)(Object.assign({},s));return i=i.set(\"type\",\"auth\"),o.update(\"errors\",(o=>(o||(0,qe.List)()).push((0,qe.fromJS)(i)))).update(\"errors\",(o=>transformErrors(o)))},[st]:(o,{payload:s})=>{if(!s||!o.get(\"errors\"))return o;let i=o.get(\"errors\").filter((o=>o.keySeq().every((i=>{const u=o.get(i),_=s[i];return!_||u!==_}))));return o.merge({errors:i})},[it]:(o,{payload:s})=>{if(!s||\"function\"!=typeof s)return o;let i=o.get(\"errors\").filter((o=>s(o)));return o.merge({errors:i})}},actions:o,selectors:j}}}}function opsFilter(o,s){return o.filter(((o,i)=>-1!==i.indexOf(s)))}function filter(){return{fn:{opsFilter}}}var Eo=__webpack_require__(7666),wo=__webpack_require__.n(Eo);const arrow_up=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z\"})),arrow_down=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z\"})),arrow=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z\"})),components_close=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z\"})),copy=({className:o=null,width:s=15,height:i=16,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 15 16\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"g\",{transform:\"translate(2, -1)\"},Pe.createElement(\"path\",{fill:\"#ffffff\",fillRule:\"evenodd\",d:\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"}))),lock=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z\"})),unlock=({className:o=null,width:s=20,height:i=20,...u})=>Pe.createElement(\"svg\",wo()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:o,width:s,height:i,\"aria-hidden\":\"true\",focusable:\"false\"},u),Pe.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z\"})),icons=()=>({components:{ArrowUpIcon:arrow_up,ArrowDownIcon:arrow_down,ArrowIcon:arrow,CloseIcon:components_close,CopyIcon:copy,LockIcon:lock,UnlockIcon:unlock}}),So=\"layout_update_layout\",xo=\"layout_update_filter\",ko=\"layout_update_mode\",Oo=\"layout_show\";function updateLayout(o){return{type:So,payload:o}}function updateFilter(o){return{type:xo,payload:o}}function actions_show(o,s=!0){return o=normalizeArray(o),{type:Oo,payload:{thing:o,shown:s}}}function changeMode(o,s=\"\"){return o=normalizeArray(o),{type:ko,payload:{thing:o,mode:s}}}const Co={[So]:(o,s)=>o.set(\"layout\",s.payload),[xo]:(o,s)=>o.set(\"filter\",s.payload),[Oo]:(o,s)=>{const i=s.payload.shown,u=(0,qe.fromJS)(s.payload.thing);return o.update(\"shown\",(0,qe.fromJS)({}),(o=>o.set(u,i)))},[ko]:(o,s)=>{let i=s.payload.thing,u=s.payload.mode;return o.setIn([\"modes\"].concat(i),(u||\"\")+\"\")}},current=o=>o.get(\"layout\"),currentFilter=o=>o.get(\"filter\"),isShown=(o,s,i)=>(s=normalizeArray(s),o.get(\"shown\",(0,qe.fromJS)({})).get((0,qe.fromJS)(s),i)),whatMode=(o,s,i=\"\")=>(s=normalizeArray(s),o.getIn([\"modes\",...s],i)),Ao=Wt((o=>o),(o=>!isShown(o,\"editor\"))),taggedOperations=(o,s)=>(i,...u)=>{let _=o(i,...u);const{fn:w,layoutSelectors:x,getConfigs:C}=s.getSystem(),j=C(),{maxDisplayedTags:L}=j;let B=x.currentFilter();return B&&!0!==B&&(_=w.opsFilter(_,B)),L>=0&&(_=_.slice(0,L)),_};function plugins_layout(){return{statePlugins:{layout:{reducers:Co,actions:L,selectors:B},spec:{wrapSelectors:$}}}}function logs({configs:o}){const s={debug:0,info:1,log:2,warn:3,error:4},getLevel=o=>s[o]||-1;let{logLevel:i}=o,u=getLevel(i);function log(o,...s){getLevel(o)>=u&&console[o](...s)}return log.warn=log.bind(null,\"warn\"),log.error=log.bind(null,\"error\"),log.info=log.bind(null,\"info\"),log.debug=log.bind(null,\"debug\"),{rootInjects:{log}}}let jo=!1;function on_complete(){return{statePlugins:{spec:{wrapActions:{updateSpec:o=>(...s)=>(jo=!0,o(...s)),updateJsonSpec:(o,s)=>(...i)=>{const u=s.getConfigs().onComplete;return jo&&\"function\"==typeof u&&(setTimeout(u,0),jo=!1),o(...i)}}}}}}const extractKey=o=>{const s=\"_**[]\";return o.indexOf(s)<0?o:o.split(s)[0].trim()},escapeShell=o=>\"-d \"===o||/^[_\\/-]/g.test(o)?o:\"'\"+o.replace(/'/g,\"'\\\\''\")+\"'\",escapeCMD=o=>\"-d \"===(o=o.replace(/\\^/g,\"^^\").replace(/\\\\\"/g,'\\\\\\\\\"').replace(/\"/g,'\"\"').replace(/\\n/g,\"^\\n\"))?o.replace(/-d /g,\"-d ^\\n\"):/^[_\\/-]/g.test(o)?o:'\"'+o+'\"',escapePowershell=o=>{if(\"-d \"===o)return o;if(/\\n/.test(o)){return`@\"\\n${o.replace(/`/g,\"``\").replace(/\\$/g,\"`$\")}\\n\"@`}if(!/^[_\\/-]/.test(o)){return`'${o.replace(/'/g,\"''\")}'`}return o};const curlify=(o,s,i,u=\"\")=>{let _=!1,w=\"\";const addWords=(...o)=>w+=\" \"+o.map(s).join(\" \"),addWordsWithoutLeadingSpace=(...o)=>w+=o.map(s).join(\" \"),addNewLine=()=>w+=` ${i}`,addIndent=(o=1)=>w+=\"  \".repeat(o);let x=o.get(\"headers\");w+=\"curl\"+u;const C=o.get(\"curlOptions\");if(qe.List.isList(C)&&!C.isEmpty()&&addWords(...o.get(\"curlOptions\")),addWords(\"-X\",o.get(\"method\")),addNewLine(),addIndent(),addWordsWithoutLeadingSpace(`${o.get(\"url\")}`),x&&x.size)for(let s of o.get(\"headers\").entries()){addNewLine(),addIndent();let[o,i]=s;addWordsWithoutLeadingSpace(\"-H\",`${o}: ${i}`),_=_||/^content-type$/i.test(o)&&/^multipart\\/form-data$/i.test(i)}const j=o.get(\"body\");if(j)if(_&&[\"POST\",\"PUT\",\"PATCH\"].includes(o.get(\"method\")))for(let[o,s]of j.entrySeq()){let i=extractKey(o);addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-F\"),s instanceof at.File&&\"string\"==typeof s.valueOf()?addWords(`${i}=${s.data}${s.type?`;type=${s.type}`:\"\"}`):s instanceof at.File?addWords(`${i}=@${s.name}${s.type?`;type=${s.type}`:\"\"}`):addWords(`${i}=${s}`)}else if(j instanceof at.File)addNewLine(),addIndent(),addWordsWithoutLeadingSpace(`--data-binary '@${j.name}'`);else{addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-d \");let s=j;qe.Map.isMap(s)?addWordsWithoutLeadingSpace(function getStringBodyOfMap(o){let s=[];for(let[i,u]of o.get(\"body\").entrySeq()){let o=extractKey(i);u instanceof at.File?s.push(`  \"${o}\": {\\n    \"name\": \"${u.name}\"${u.type?`,\\n    \"type\": \"${u.type}\"`:\"\"}\\n  }`):s.push(`  \"${o}\": ${JSON.stringify(u,null,2).replace(/(\\r\\n|\\r|\\n)/g,\"\\n  \")}`)}return`{\\n${s.join(\",\\n\")}\\n}`}(o)):(\"string\"!=typeof s&&(s=JSON.stringify(s)),addWordsWithoutLeadingSpace(s))}else j||\"POST\"!==o.get(\"method\")||(addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-d ''\"));return w},requestSnippetGenerator_curl_powershell=o=>curlify(o,escapePowershell,\"`\\n\",\".exe\"),requestSnippetGenerator_curl_bash=o=>curlify(o,escapeShell,\"\\\\\\n\"),requestSnippetGenerator_curl_cmd=o=>curlify(o,escapeCMD,\"^\\n\"),request_snippets_selectors_state=o=>o||(0,qe.Map)(),Po=Wt(request_snippets_selectors_state,(o=>{const s=o.get(\"languages\"),i=o.get(\"generators\",(0,qe.Map)());return!s||s.isEmpty()?i:i.filter(((o,i)=>s.includes(i)))})),getSnippetGenerators=o=>({fn:s})=>Po(o).map(((o,i)=>{const u=(o=>s[`requestSnippetGenerator_${o}`])(i);return\"function\"!=typeof u?null:o.set(\"fn\",u)})).filter((o=>o)),Io=Wt(request_snippets_selectors_state,(o=>o.get(\"activeLanguage\"))),Mo=Wt(request_snippets_selectors_state,(o=>o.get(\"defaultExpanded\")));var No=__webpack_require__(46942),To=__webpack_require__.n(No),Ro=__webpack_require__(59399);const Do={cursor:\"pointer\",lineHeight:1,display:\"inline-flex\",backgroundColor:\"rgb(250, 250, 250)\",paddingBottom:\"0\",paddingTop:\"0\",border:\"1px solid rgb(51, 51, 51)\",borderRadius:\"4px 4px 0 0\",boxShadow:\"none\",borderBottom:\"none\"},Lo={cursor:\"pointer\",lineHeight:1,display:\"inline-flex\",backgroundColor:\"rgb(51, 51, 51)\",boxShadow:\"none\",border:\"1px solid rgb(51, 51, 51)\",paddingBottom:\"0\",paddingTop:\"0\",borderRadius:\"4px 4px 0 0\",marginTop:\"-5px\",marginRight:\"-5px\",marginLeft:\"-5px\",zIndex:\"9999\",borderBottom:\"none\"},request_snippets=({request:o,requestSnippetsSelectors:s,getComponent:i})=>{const u=(0,Pe.useRef)(null),_=i(\"ArrowUpIcon\"),w=i(\"ArrowDownIcon\"),x=i(\"SyntaxHighlighter\",!0),[C,j]=(0,Pe.useState)(s.getSnippetGenerators()?.keySeq().first()),[L,B]=(0,Pe.useState)(s?.getDefaultExpanded()),$=s.getSnippetGenerators(),V=$.get(C),U=V.get(\"fn\")(o),handleSetIsExpanded=()=>{B(!L)},handleGetBtnStyle=o=>o===C?Lo:Do,handlePreventYScrollingBeyondElement=o=>{const{target:s,deltaY:i}=o,{scrollHeight:u,offsetHeight:_,scrollTop:w}=s;u>_&&(0===w&&i<0||_+w>=u&&i>0)&&o.preventDefault()};return(0,Pe.useEffect)((()=>{}),[]),(0,Pe.useEffect)((()=>{const o=Array.from(u.current.childNodes).filter((o=>!!o.nodeType&&o.classList?.contains(\"curl-command\")));return o.forEach((o=>o.addEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement,{passive:!1}))),()=>{o.forEach((o=>o.removeEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement)))}}),[o]),Pe.createElement(\"div\",{className:\"request-snippets\",ref:u},Pe.createElement(\"div\",{style:{width:\"100%\",display:\"flex\",justifyContent:\"flex-start\",alignItems:\"center\",marginBottom:\"15px\"}},Pe.createElement(\"h4\",{onClick:()=>handleSetIsExpanded(),style:{cursor:\"pointer\"}},\"Snippets\"),Pe.createElement(\"button\",{onClick:()=>handleSetIsExpanded(),style:{border:\"none\",background:\"none\"},title:L?\"Collapse operation\":\"Expand operation\"},L?Pe.createElement(w,{className:\"arrow\",width:\"10\",height:\"10\"}):Pe.createElement(_,{className:\"arrow\",width:\"10\",height:\"10\"}))),L&&Pe.createElement(\"div\",{className:\"curl-command\"},Pe.createElement(\"div\",{style:{paddingLeft:\"15px\",paddingRight:\"10px\",width:\"100%\",display:\"flex\"}},$.entrySeq().map((([o,s])=>Pe.createElement(\"div\",{className:To()(\"btn\",{active:o===C}),style:handleGetBtnStyle(o),key:o,onClick:()=>(o=>{C!==o&&j(o)})(o)},Pe.createElement(\"h4\",{style:o===C?{color:\"white\"}:{}},s.get(\"title\")))))),Pe.createElement(\"div\",{className:\"copy-to-clipboard\"},Pe.createElement(Ro.CopyToClipboard,{text:U},Pe.createElement(\"button\",null))),Pe.createElement(\"div\",null,Pe.createElement(x,{language:V.get(\"syntax\"),className:\"curl microlight\",renderPlainText:({children:o,PlainTextViewer:s})=>Pe.createElement(s,{className:\"curl\"},o)},U))))},plugins_request_snippets=()=>({components:{RequestSnippets:request_snippets},fn:V,statePlugins:{requestSnippets:{selectors:U}}});class ModelCollapse extends Pe.Component{static defaultProps={collapsedContent:\"{...}\",expanded:!1,title:null,onToggle:()=>{},hideSelfOnExpand:!1,specPath:$e().List([])};constructor(o,s){super(o,s);let{expanded:i,collapsedContent:u}=this.props;this.state={expanded:i,collapsedContent:u||ModelCollapse.defaultProps.collapsedContent}}componentDidMount(){const{hideSelfOnExpand:o,expanded:s,modelName:i}=this.props;o&&s&&this.props.onToggle(i,s)}UNSAFE_componentWillReceiveProps(o){this.props.expanded!==o.expanded&&this.setState({expanded:o.expanded})}toggleCollapsed=()=>{this.props.onToggle&&this.props.onToggle(this.props.modelName,!this.state.expanded),this.setState({expanded:!this.state.expanded})};onLoad=o=>{if(o&&this.props.layoutSelectors){const s=this.props.layoutSelectors.getScrollToKey();$e().is(s,this.props.specPath)&&this.toggleCollapsed(),this.props.layoutActions.readyToScroll(this.props.specPath,o.parentElement)}};render(){const{title:o,classes:s}=this.props;return this.state.expanded&&this.props.hideSelfOnExpand?Pe.createElement(\"span\",{className:s||\"\"},this.props.children):Pe.createElement(\"span\",{className:s||\"\",ref:this.onLoad},Pe.createElement(\"button\",{\"aria-expanded\":this.state.expanded,className:\"model-box-control\",onClick:this.toggleCollapsed},o&&Pe.createElement(\"span\",{className:\"pointer\"},o),Pe.createElement(\"span\",{className:\"model-toggle\"+(this.state.expanded?\"\":\" collapsed\")}),!this.state.expanded&&Pe.createElement(\"span\",null,this.state.collapsedContent)),this.state.expanded&&this.props.children)}}const useTabs=({initialTab:o,isExecute:s,schema:i,example:u})=>{const _=(0,Pe.useMemo)((()=>({example:\"example\",model:\"model\"})),[]),w=(0,Pe.useMemo)((()=>Object.keys(_)),[_]).includes(o)&&i&&!s?o:_.example,x=(o=>{const s=(0,Pe.useRef)();return(0,Pe.useEffect)((()=>{s.current=o})),s.current})(s),[C,j]=(0,Pe.useState)(w),L=(0,Pe.useCallback)((o=>{j(o.target.dataset.name)}),[]);return(0,Pe.useEffect)((()=>{x&&!s&&u&&j(_.example)}),[x,s,u]),{activeTab:C,onTabChange:L,tabs:_}},model_example=({schema:o,example:s,isExecute:i=!1,specPath:u,includeWriteOnly:_=!1,includeReadOnly:w=!1,getComponent:x,getConfigs:C,specSelectors:j})=>{const{defaultModelRendering:L,defaultModelExpandDepth:B}=C(),$=x(\"ModelWrapper\"),V=x(\"HighlightCode\",!0),U=St()(5).toString(\"base64\"),z=St()(5).toString(\"base64\"),Y=St()(5).toString(\"base64\"),Z=St()(5).toString(\"base64\"),ee=j.isOAS3(),{activeTab:ie,tabs:ae,onTabChange:ce}=useTabs({initialTab:L,isExecute:i,schema:o,example:s});return Pe.createElement(\"div\",{className:\"model-example\"},Pe.createElement(\"ul\",{className:\"tab\",role:\"tablist\"},Pe.createElement(\"li\",{className:To()(\"tabitem\",{active:ie===ae.example}),role:\"presentation\"},Pe.createElement(\"button\",{\"aria-controls\":z,\"aria-selected\":ie===ae.example,className:\"tablinks\",\"data-name\":\"example\",id:U,onClick:ce,role:\"tab\"},i?\"Edit Value\":\"Example Value\")),o&&Pe.createElement(\"li\",{className:To()(\"tabitem\",{active:ie===ae.model}),role:\"presentation\"},Pe.createElement(\"button\",{\"aria-controls\":Z,\"aria-selected\":ie===ae.model,className:To()(\"tablinks\",{inactive:i}),\"data-name\":\"model\",id:Y,onClick:ce,role:\"tab\"},ee?\"Schema\":\"Model\"))),ie===ae.example&&Pe.createElement(\"div\",{\"aria-hidden\":ie!==ae.example,\"aria-labelledby\":U,\"data-name\":\"examplePanel\",id:z,role:\"tabpanel\",tabIndex:\"0\"},s||Pe.createElement(V,null,\"(no example available\")),ie===ae.model&&Pe.createElement(\"div\",{\"aria-hidden\":ie===ae.example,\"aria-labelledby\":Y,\"data-name\":\"modelPanel\",id:Z,role:\"tabpanel\",tabIndex:\"0\"},Pe.createElement($,{schema:o,getComponent:x,getConfigs:C,specSelectors:j,expandDepth:B,specPath:u,includeReadOnly:w,includeWriteOnly:_})))};class ModelWrapper extends Pe.Component{onToggle=(o,s)=>{this.props.layoutActions&&this.props.layoutActions.show(this.props.fullPath,s)};render(){let{getComponent:o,getConfigs:s}=this.props;const i=o(\"Model\");let u;return this.props.layoutSelectors&&(u=this.props.layoutSelectors.isShown(this.props.fullPath)),Pe.createElement(\"div\",{className:\"model-box\"},Pe.createElement(i,wo()({},this.props,{getConfigs:s,expanded:u,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}function _typeof(o){return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},_typeof(o)}function _defineProperties(o,s){for(var i=0;i<s.length;i++){var u=s[i];u.enumerable=u.enumerable||!1,u.configurable=!0,\"value\"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function _defineProperty(o,s,i){return s in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}function ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(o)}function _setPrototypeOf(o,s){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,s){return o.__proto__=s,o},_setPrototypeOf(o,s)}function _possibleConstructorReturn(o,s){return!s||\"object\"!=typeof s&&\"function\"!=typeof s?function _assertThisInitialized(o){if(void 0===o)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return o}(o):s}var Bo={};function react_immutable_pure_component_es_get(o,s,i){return function isInvalid(o){return null==o}(o)?i:function isMapLike(o){return null!==o&&\"object\"===_typeof(o)&&\"function\"==typeof o.get&&\"function\"==typeof o.has}(o)?o.has(s)?o.get(s):i:hasOwnProperty.call(o,s)?o[s]:i}function getIn(o,s,i){for(var u=0;u!==s.length;)if((o=react_immutable_pure_component_es_get(o,s[u++],Bo))===Bo)return i;return o}function check(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=function createChecker(o,s){return function(i){if(\"string\"==typeof i)return(0,qe.is)(s[i],o[i]);if(Array.isArray(i))return(0,qe.is)(getIn(s,i),getIn(o,i));throw new TypeError(\"Invalid key: expected Array or string: \"+i)}}(s,i),_=o||Object.keys(function _objectSpread2(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?ownKeys(i,!0).forEach((function(s){_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):ownKeys(i).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}({},i,{},s));return _.every(u)}const Fo=function(o){function ImmutablePureComponent(){return function _classCallCheck(o,s){if(!(o instanceof s))throw new TypeError(\"Cannot call a class as a function\")}(this,ImmutablePureComponent),_possibleConstructorReturn(this,_getPrototypeOf(ImmutablePureComponent).apply(this,arguments))}return function _inherits(o,s){if(\"function\"!=typeof s&&null!==s)throw new TypeError(\"Super expression must either be null or a function\");o.prototype=Object.create(s&&s.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),s&&_setPrototypeOf(o,s)}(ImmutablePureComponent,o),function _createClass(o,s,i){return s&&_defineProperties(o.prototype,s),i&&_defineProperties(o,i),o}(ImmutablePureComponent,[{key:\"shouldComponentUpdate\",value:function shouldComponentUpdate(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!check(this.updateOnProps,this.props,o,\"updateOnProps\")||!check(this.updateOnStates,this.state,s,\"updateOnStates\")}}]),ImmutablePureComponent}(Pe.Component);var qo,$o=__webpack_require__(5556),Vo=__webpack_require__.n($o);function _extends(){return _extends=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(o[u]=i[u])}return o},_extends.apply(this,arguments)}const rolling_load=o=>Pe.createElement(\"svg\",_extends({xmlns:\"http://www.w3.org/2000/svg\",width:200,height:200,className:\"rolling-load_svg__lds-rolling\",preserveAspectRatio:\"xMidYMid\",style:{backgroundImage:\"none\",backgroundPosition:\"initial initial\",backgroundRepeat:\"initial initial\"},viewBox:\"0 0 100 100\"},o),qo||(qo=Pe.createElement(\"circle\",{cx:50,cy:50,r:35,fill:\"none\",stroke:\"#555\",strokeDasharray:\"164.93361431346415 56.97787143782138\",strokeWidth:10},Pe.createElement(\"animateTransform\",{attributeName:\"transform\",begin:\"0s\",calcMode:\"linear\",dur:\"1s\",keyTimes:\"0;1\",repeatCount:\"indefinite\",type:\"rotate\",values:\"0 50 50;360 50 50\"})))),decodeRefName=o=>{const s=o.replace(/~1/g,\"/\").replace(/~0/g,\"~\");try{return decodeURIComponent(s)}catch{return s}};class Model extends Fo{static propTypes={schema:po().map.isRequired,getComponent:Vo().func.isRequired,getConfigs:Vo().func.isRequired,specSelectors:Vo().object.isRequired,name:Vo().string,displayName:Vo().string,isRef:Vo().bool,required:Vo().bool,expandDepth:Vo().number,depth:Vo().number,specPath:po().list.isRequired,includeReadOnly:Vo().bool,includeWriteOnly:Vo().bool};getModelName=o=>-1!==o.indexOf(\"#/definitions/\")?decodeRefName(o.replace(/^.*#\\/definitions\\//,\"\")):-1!==o.indexOf(\"#/components/schemas/\")?decodeRefName(o.replace(/^.*#\\/components\\/schemas\\//,\"\")):void 0;getRefSchema=o=>{let{specSelectors:s}=this.props;return s.findDefinition(o)};render(){let{getComponent:o,getConfigs:s,specSelectors:i,schema:u,required:_,name:w,isRef:x,specPath:C,displayName:j,includeReadOnly:L,includeWriteOnly:B}=this.props;const $=o(\"ObjectModel\"),V=o(\"ArrayModel\"),U=o(\"PrimitiveModel\");let z=\"object\",Y=u&&u.get(\"$$ref\"),Z=u&&u.get(\"$ref\");if(!w&&Y&&(w=this.getModelName(Y)),Z){const o=this.getModelName(Z),s=this.getRefSchema(o);qe.Map.isMap(s)?(u=s.mergeDeep(u),Y||(u=u.set(\"$$ref\",Z),Y=Z)):qe.Map.isMap(u)&&1===u.size&&(u=null,w=Z)}if(!u)return Pe.createElement(\"span\",{className:\"model model-title\"},Pe.createElement(\"span\",{className:\"model-title__text\"},j||w),!Z&&Pe.createElement(rolling_load,{height:\"20px\",width:\"20px\"}));const ee=i.isOAS3()&&u.get(\"deprecated\");switch(x=void 0!==x?x:!!Y,z=u&&u.get(\"type\")||z,z){case\"object\":return Pe.createElement($,wo()({className:\"object\"},this.props,{specPath:C,getConfigs:s,schema:u,name:w,deprecated:ee,isRef:x,includeReadOnly:L,includeWriteOnly:B}));case\"array\":return Pe.createElement(V,wo()({className:\"array\"},this.props,{getConfigs:s,schema:u,name:w,deprecated:ee,required:_,includeReadOnly:L,includeWriteOnly:B}));default:return Pe.createElement(U,wo()({},this.props,{getComponent:o,getConfigs:s,schema:u,name:w,deprecated:ee,required:_}))}}}class Models extends Pe.Component{getSchemaBasePath=()=>this.props.specSelectors.isOAS3()?[\"components\",\"schemas\"]:[\"definitions\"];getCollapsedContent=()=>\" \";handleToggle=(o,s)=>{const{layoutActions:i}=this.props;i.show([...this.getSchemaBasePath(),o],s),s&&this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(),o])};onLoadModels=o=>{o&&this.props.layoutActions.readyToScroll(this.getSchemaBasePath(),o)};onLoadModel=o=>{if(o){const s=o.getAttribute(\"data-name\");this.props.layoutActions.readyToScroll([...this.getSchemaBasePath(),s],o)}};render(){let{specSelectors:o,getComponent:s,layoutSelectors:i,layoutActions:u,getConfigs:_}=this.props,w=o.definitions(),{docExpansion:x,defaultModelsExpandDepth:C}=_();if(!w.size||C<0)return null;const j=this.getSchemaBasePath();let L=i.isShown(j,C>0&&\"none\"!==x);const B=o.isOAS3(),$=s(\"ModelWrapper\"),V=s(\"Collapse\"),U=s(\"ModelCollapse\"),z=s(\"JumpToPath\",!0),Y=s(\"ArrowUpIcon\"),Z=s(\"ArrowDownIcon\");return Pe.createElement(\"section\",{className:L?\"models is-open\":\"models\",ref:this.onLoadModels},Pe.createElement(\"h4\",null,Pe.createElement(\"button\",{\"aria-expanded\":L,className:\"models-control\",onClick:()=>u.show(j,!L)},Pe.createElement(\"span\",null,B?\"Schemas\":\"Models\"),L?Pe.createElement(Y,null):Pe.createElement(Z,null))),Pe.createElement(V,{isOpened:L},w.entrySeq().map((([w])=>{const x=[...j,w],L=$e().List(x),B=o.specResolvedSubtree(x),V=o.specJson().getIn(x),Y=qe.Map.isMap(B)?B:$e().Map(),Z=qe.Map.isMap(V)?V:$e().Map(),ee=Y.get(\"title\")||Z.get(\"title\")||w,ie=i.isShown(x,!1);ie&&0===Y.size&&Z.size>0&&this.props.specActions.requestResolvedSubtree(x);const ae=Pe.createElement($,{name:w,expandDepth:C,schema:Y||$e().Map(),displayName:ee,fullPath:x,specPath:L,getComponent:s,specSelectors:o,getConfigs:_,layoutSelectors:i,layoutActions:u,includeReadOnly:!0,includeWriteOnly:!0}),ce=Pe.createElement(\"span\",{className:\"model-box\"},Pe.createElement(\"span\",{className:\"model model-title\"},ee));return Pe.createElement(\"div\",{id:`model-${w}`,className:\"model-container\",key:`models-section-${w}`,\"data-name\":w,ref:this.onLoadModel},Pe.createElement(\"span\",{className:\"models-jump-to-path\"},Pe.createElement(z,{specPath:L})),Pe.createElement(U,{classes:\"model-box\",collapsedContent:this.getCollapsedContent(w),onToggle:this.handleToggle,title:ce,displayName:ee,modelName:w,specPath:L,layoutSelectors:i,layoutActions:u,hideSelfOnExpand:!0,expanded:C>0&&ie},ae))})).toArray()))}}const enum_model=({value:o,getComponent:s})=>{let i=s(\"ModelCollapse\"),u=Pe.createElement(\"span\",null,\"Array [ \",o.count(),\" ]\");return Pe.createElement(\"span\",{className:\"prop-enum\"},\"Enum:\",Pe.createElement(\"br\",null),Pe.createElement(i,{collapsedContent:u},\"[ \",o.map(String).join(\", \"),\" ]\"))};class ObjectModel extends Pe.Component{render(){let{schema:o,name:s,displayName:i,isRef:u,getComponent:_,getConfigs:w,depth:x,onToggle:C,expanded:j,specPath:L,...B}=this.props,{specSelectors:$,expandDepth:V,includeReadOnly:U,includeWriteOnly:z}=B;const{isOAS3:Y}=$;if(!o)return null;const{showExtensions:Z}=w();let ee=o.get(\"description\"),ie=o.get(\"properties\"),ae=o.get(\"additionalProperties\"),ce=o.get(\"title\")||i||s,le=o.get(\"required\"),pe=o.filter(((o,s)=>-1!==[\"maxProperties\",\"minProperties\",\"nullable\",\"example\"].indexOf(s))),de=o.get(\"deprecated\"),fe=o.getIn([\"externalDocs\",\"url\"]),ye=o.getIn([\"externalDocs\",\"description\"]);const be=_(\"JumpToPath\",!0),_e=_(\"Markdown\",!0),we=_(\"Model\"),Se=_(\"ModelCollapse\"),xe=_(\"Property\"),Te=_(\"Link\"),JumpToPathSection=()=>Pe.createElement(\"span\",{className:\"model-jump-to-path\"},Pe.createElement(be,{specPath:L})),Re=Pe.createElement(\"span\",null,Pe.createElement(\"span\",null,\"{\"),\"...\",Pe.createElement(\"span\",null,\"}\"),u?Pe.createElement(JumpToPathSection,null):\"\"),$e=$.isOAS3()?o.get(\"allOf\"):null,ze=$.isOAS3()?o.get(\"anyOf\"):null,We=$.isOAS3()?o.get(\"oneOf\"):null,He=$.isOAS3()?o.get(\"not\"):null,Ye=ce&&Pe.createElement(\"span\",{className:\"model-title\"},u&&o.get(\"$$ref\")&&Pe.createElement(\"span\",{className:\"model-hint\"},o.get(\"$$ref\")),Pe.createElement(\"span\",{className:\"model-title__text\"},ce));return Pe.createElement(\"span\",{className:\"model\"},Pe.createElement(Se,{modelName:s,title:Ye,onToggle:C,expanded:!!j||x<=V,collapsedContent:Re},Pe.createElement(\"span\",{className:\"brace-open object\"},\"{\"),u?Pe.createElement(JumpToPathSection,null):null,Pe.createElement(\"span\",{className:\"inner-object\"},Pe.createElement(\"table\",{className:\"model\"},Pe.createElement(\"tbody\",null,ee?Pe.createElement(\"tr\",{className:\"description\"},Pe.createElement(\"td\",null,\"description:\"),Pe.createElement(\"td\",null,Pe.createElement(_e,{source:ee}))):null,fe&&Pe.createElement(\"tr\",{className:\"external-docs\"},Pe.createElement(\"td\",null,\"externalDocs:\"),Pe.createElement(\"td\",null,Pe.createElement(Te,{target:\"_blank\",href:sanitizeUrl(fe)},ye||fe))),de?Pe.createElement(\"tr\",{className:\"property\"},Pe.createElement(\"td\",null,\"deprecated:\"),Pe.createElement(\"td\",null,\"true\")):null,ie&&ie.size?ie.entrySeq().filter((([,o])=>(!o.get(\"readOnly\")||U)&&(!o.get(\"writeOnly\")||z))).map((([o,i])=>{let u=Y()&&i.get(\"deprecated\"),C=qe.List.isList(le)&&le.contains(o),j=[\"property-row\"];return u&&j.push(\"deprecated\"),C&&j.push(\"required\"),Pe.createElement(\"tr\",{key:o,className:j.join(\" \")},Pe.createElement(\"td\",null,o,C&&Pe.createElement(\"span\",{className:\"star\"},\"*\")),Pe.createElement(\"td\",null,Pe.createElement(we,wo()({key:`object-${s}-${o}_${i}`},B,{required:C,getComponent:_,specPath:L.push(\"properties\",o),getConfigs:w,schema:i,depth:x+1}))))})).toArray():null,Z?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\" \")):null,Z?o.entrySeq().map((([o,s])=>{if(\"x-\"!==o.slice(0,2))return;const i=s?s.toJS?s.toJS():s:null;return Pe.createElement(\"tr\",{key:o,className:\"extension\"},Pe.createElement(\"td\",null,o),Pe.createElement(\"td\",null,JSON.stringify(i)))})).toArray():null,ae&&ae.size?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"< * >:\"),Pe.createElement(\"td\",null,Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"additionalProperties\"),getConfigs:w,schema:ae,depth:x+1})))):null,$e?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"allOf ->\"),Pe.createElement(\"td\",null,$e.map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"allOf\",s),getConfigs:w,schema:o,depth:x+1}))))))):null,ze?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"anyOf ->\"),Pe.createElement(\"td\",null,ze.map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"anyOf\",s),getConfigs:w,schema:o,depth:x+1}))))))):null,We?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"oneOf ->\"),Pe.createElement(\"td\",null,We.map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"oneOf\",s),getConfigs:w,schema:o,depth:x+1}))))))):null,He?Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,\"not ->\"),Pe.createElement(\"td\",null,Pe.createElement(\"div\",null,Pe.createElement(we,wo()({},B,{required:!1,getComponent:_,specPath:L.push(\"not\"),getConfigs:w,schema:He,depth:x+1}))))):null))),Pe.createElement(\"span\",{className:\"brace-close\"},\"}\")),pe.size?pe.entrySeq().map((([o,s])=>Pe.createElement(xe,{key:`${o}-${s}`,propKey:o,propVal:s,propClass:\"property\"}))):null)}}class ArrayModel extends Pe.Component{render(){let{getComponent:o,getConfigs:s,schema:i,depth:u,expandDepth:_,name:w,displayName:x,specPath:C}=this.props,j=i.get(\"description\"),L=i.get(\"items\"),B=i.get(\"title\")||x||w,$=i.filter(((o,s)=>-1===[\"type\",\"items\",\"description\",\"$$ref\",\"externalDocs\"].indexOf(s))),V=i.getIn([\"externalDocs\",\"url\"]),U=i.getIn([\"externalDocs\",\"description\"]);const z=o(\"Markdown\",!0),Y=o(\"ModelCollapse\"),Z=o(\"Model\"),ee=o(\"Property\"),ie=o(\"Link\"),ae=B&&Pe.createElement(\"span\",{className:\"model-title\"},Pe.createElement(\"span\",{className:\"model-title__text\"},B));return Pe.createElement(\"span\",{className:\"model\"},Pe.createElement(Y,{title:ae,expanded:u<=_,collapsedContent:\"[...]\"},\"[\",$.size?$.entrySeq().map((([o,s])=>Pe.createElement(ee,{key:`${o}-${s}`,propKey:o,propVal:s,propClass:\"property\"}))):null,j?Pe.createElement(z,{source:j}):$.size?Pe.createElement(\"div\",{className:\"markdown\"}):null,V&&Pe.createElement(\"div\",{className:\"external-docs\"},Pe.createElement(ie,{target:\"_blank\",href:sanitizeUrl(V)},U||V)),Pe.createElement(\"span\",null,Pe.createElement(Z,wo()({},this.props,{getConfigs:s,specPath:C.push(\"items\"),name:null,schema:L,required:!1,depth:u+1}))),\"]\"))}}const Uo=\"property primitive\";class Primitive extends Pe.Component{render(){let{schema:o,getComponent:s,getConfigs:i,name:u,displayName:_,depth:w,expandDepth:x}=this.props;const{showExtensions:C}=i();if(!o||!o.get)return Pe.createElement(\"div\",null);let j=o.get(\"type\"),L=o.get(\"format\"),B=o.get(\"xml\"),$=o.get(\"enum\"),V=o.get(\"title\")||_||u,U=o.get(\"description\"),z=getExtensions(o),Y=o.filter(((o,s)=>-1===[\"enum\",\"type\",\"format\",\"description\",\"$$ref\",\"externalDocs\"].indexOf(s))).filterNot(((o,s)=>z.has(s))),Z=o.getIn([\"externalDocs\",\"url\"]),ee=o.getIn([\"externalDocs\",\"description\"]);const ie=s(\"Markdown\",!0),ae=s(\"EnumModel\"),ce=s(\"Property\"),le=s(\"ModelCollapse\"),pe=s(\"Link\"),de=V&&Pe.createElement(\"span\",{className:\"model-title\"},Pe.createElement(\"span\",{className:\"model-title__text\"},V));return Pe.createElement(\"span\",{className:\"model\"},Pe.createElement(le,{title:de,expanded:w<=x,collapsedContent:\"[...]\"},Pe.createElement(\"span\",{className:\"prop\"},u&&w>1&&Pe.createElement(\"span\",{className:\"prop-name\"},V),Pe.createElement(\"span\",{className:\"prop-type\"},j),L&&Pe.createElement(\"span\",{className:\"prop-format\"},\"($\",L,\")\"),Y.size?Y.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,propKey:o,propVal:s,propClass:Uo}))):null,C&&z.size?z.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,propKey:o,propVal:s,propClass:Uo}))):null,U?Pe.createElement(ie,{source:U}):null,Z&&Pe.createElement(\"div\",{className:\"external-docs\"},Pe.createElement(pe,{target:\"_blank\",href:sanitizeUrl(Z)},ee||Z)),B&&B.size?Pe.createElement(\"span\",null,Pe.createElement(\"br\",null),Pe.createElement(\"span\",{className:Uo},\"xml:\"),B.entrySeq().map((([o,s])=>Pe.createElement(\"span\",{key:`${o}-${s}`,className:Uo},Pe.createElement(\"br\",null),\"   \",o,\": \",String(s)))).toArray()):null,$&&Pe.createElement(ae,{value:$,getComponent:s}))))}}class Schemes extends Pe.Component{UNSAFE_componentWillMount(){let{schemes:o}=this.props;this.setScheme(o.first())}UNSAFE_componentWillReceiveProps(o){this.props.currentScheme&&o.schemes.includes(this.props.currentScheme)||this.setScheme(o.schemes.first())}onChange=o=>{this.setScheme(o.target.value)};setScheme=o=>{let{path:s,method:i,specActions:u}=this.props;u.setScheme(o,s,i)};render(){let{schemes:o,currentScheme:s}=this.props;return Pe.createElement(\"label\",{htmlFor:\"schemes\"},Pe.createElement(\"span\",{className:\"schemes-title\"},\"Schemes\"),Pe.createElement(\"select\",{onChange:this.onChange,value:s,id:\"schemes\"},o.valueSeq().map((o=>Pe.createElement(\"option\",{value:o,key:o},o))).toArray()))}}class SchemesContainer extends Pe.Component{render(){const{specActions:o,specSelectors:s,getComponent:i}=this.props,u=s.operationScheme(),_=s.schemes(),w=i(\"schemes\");return _&&_.size?Pe.createElement(w,{currentScheme:u,schemes:_,specActions:o}):null}}var zo=__webpack_require__(24677),Wo=__webpack_require__.n(zo);const Ko={value:\"\",onChange:()=>{},schema:{},keyName:\"\",required:!1,errors:(0,qe.List)()};class JsonSchemaForm extends Pe.Component{static defaultProps=Ko;componentDidMount(){const{dispatchInitialValue:o,value:s,onChange:i}=this.props;o?i(s):!1===o&&i(\"\")}render(){let{schema:o,errors:s,value:i,onChange:u,getComponent:_,fn:w,disabled:x}=this.props;const C=o&&o.get?o.get(\"format\"):null,j=o&&o.get?o.get(\"type\"):null;let getComponentSilently=o=>_(o,!1,{failSilently:!0}),L=j?getComponentSilently(C?`JsonSchema_${j}_${C}`:`JsonSchema_${j}`):_(\"JsonSchema_string\");return L||(L=_(\"JsonSchema_string\")),Pe.createElement(L,wo()({},this.props,{errors:s,fn:w,getComponent:_,value:i,onChange:u,schema:o,disabled:x}))}}class JsonSchema_string extends Pe.Component{static defaultProps=Ko;onChange=o=>{const s=this.props.schema&&\"file\"===this.props.schema.get(\"type\")?o.target.files[0]:o.target.value;this.props.onChange(s,this.props.keyName)};onEnumChange=o=>this.props.onChange(o);render(){let{getComponent:o,value:s,schema:i,errors:u,required:_,description:w,disabled:x}=this.props;const C=i&&i.get?i.get(\"enum\"):null,j=i&&i.get?i.get(\"format\"):null,L=i&&i.get?i.get(\"type\"):null,B=i&&i.get?i.get(\"in\"):null;if(s||(s=\"\"),u=u.toJS?u.toJS():[],C){const i=o(\"Select\");return Pe.createElement(i,{className:u.length?\"invalid\":\"\",title:u.length?u:\"\",allowedValues:[...C],value:s,allowEmptyValue:!_,disabled:x,onChange:this.onEnumChange})}const $=x||B&&\"formData\"===B&&!(\"FormData\"in window),V=o(\"Input\");return L&&\"file\"===L?Pe.createElement(V,{type:\"file\",className:u.length?\"invalid\":\"\",title:u.length?u:\"\",onChange:this.onChange,disabled:$}):Pe.createElement(Wo(),{type:j&&\"password\"===j?\"password\":\"text\",className:u.length?\"invalid\":\"\",title:u.length?u:\"\",value:s,minLength:0,debounceTimeout:350,placeholder:w,onChange:this.onChange,disabled:$})}}class JsonSchema_array extends Pe.PureComponent{static defaultProps=Ko;constructor(o,s){super(o,s),this.state={value:valueOrEmptyList(o.value),schema:o.schema}}UNSAFE_componentWillReceiveProps(o){const s=valueOrEmptyList(o.value);s!==this.state.value&&this.setState({value:s}),o.schema!==this.state.schema&&this.setState({schema:o.schema})}onChange=()=>{this.props.onChange(this.state.value)};onItemChange=(o,s)=>{this.setState((({value:i})=>({value:i.set(s,o)})),this.onChange)};removeItem=o=>{this.setState((({value:s})=>({value:s.delete(o)})),this.onChange)};addItem=()=>{const{fn:o}=this.props;let s=valueOrEmptyList(this.state.value);this.setState((()=>({value:s.push(o.getSampleSchema(this.state.schema.get(\"items\"),!1,{includeWriteOnly:!0}))})),this.onChange)};onEnumChange=o=>{this.setState((()=>({value:o})),this.onChange)};render(){let{getComponent:o,required:s,schema:i,errors:u,fn:_,disabled:w}=this.props;u=u.toJS?u.toJS():Array.isArray(u)?u:[];const x=u.filter((o=>\"string\"==typeof o)),C=u.filter((o=>void 0!==o.needRemove)).map((o=>o.error)),j=this.state.value,L=!!(j&&j.count&&j.count()>0),B=i.getIn([\"items\",\"enum\"]),$=i.getIn([\"items\",\"type\"]),V=i.getIn([\"items\",\"format\"]),U=i.get(\"items\");let z,Y=!1,Z=\"file\"===$||\"string\"===$&&\"binary\"===V;if($&&V?z=o(`JsonSchema_${$}_${V}`):\"boolean\"!==$&&\"array\"!==$&&\"object\"!==$||(z=o(`JsonSchema_${$}`)),z||Z||(Y=!0),B){const i=o(\"Select\");return Pe.createElement(i,{className:u.length?\"invalid\":\"\",title:u.length?u:\"\",multiple:!0,value:j,disabled:w,allowedValues:B,allowEmptyValue:!s,onChange:this.onEnumChange})}const ee=o(\"Button\");return Pe.createElement(\"div\",{className:\"json-schema-array\"},L?j.map(((s,i)=>{const x=(0,qe.fromJS)([...u.filter((o=>o.index===i)).map((o=>o.error))]);return Pe.createElement(\"div\",{key:i,className:\"json-schema-form-item\"},Z?Pe.createElement(JsonSchemaArrayItemFile,{value:s,onChange:o=>this.onItemChange(o,i),disabled:w,errors:x,getComponent:o}):Y?Pe.createElement(JsonSchemaArrayItemText,{value:s,onChange:o=>this.onItemChange(o,i),disabled:w,errors:x}):Pe.createElement(z,wo()({},this.props,{value:s,onChange:o=>this.onItemChange(o,i),disabled:w,errors:x,schema:U,getComponent:o,fn:_})),w?null:Pe.createElement(ee,{className:`btn btn-sm json-schema-form-item-remove ${C.length?\"invalid\":null}`,title:C.length?C:\"\",onClick:()=>this.removeItem(i)},\" - \"))})):null,w?null:Pe.createElement(ee,{className:`btn btn-sm json-schema-form-item-add ${x.length?\"invalid\":null}`,title:x.length?x:\"\",onClick:this.addItem},\"Add \",$?`${$} `:\"\",\"item\"))}}class JsonSchemaArrayItemText extends Pe.Component{static defaultProps=Ko;onChange=o=>{const s=o.target.value;this.props.onChange(s,this.props.keyName)};render(){let{value:o,errors:s,description:i,disabled:u}=this.props;return o||(o=\"\"),s=s.toJS?s.toJS():[],Pe.createElement(Wo(),{type:\"text\",className:s.length?\"invalid\":\"\",title:s.length?s:\"\",value:o,minLength:0,debounceTimeout:350,placeholder:i,onChange:this.onChange,disabled:u})}}class JsonSchemaArrayItemFile extends Pe.Component{static defaultProps=Ko;onFileChange=o=>{const s=o.target.files[0];this.props.onChange(s,this.props.keyName)};render(){let{getComponent:o,errors:s,disabled:i}=this.props;const u=o(\"Input\"),_=i||!(\"FormData\"in window);return Pe.createElement(u,{type:\"file\",className:s.length?\"invalid\":\"\",title:s.length?s:\"\",onChange:this.onFileChange,disabled:_})}}class JsonSchema_boolean extends Pe.Component{static defaultProps=Ko;onEnumChange=o=>this.props.onChange(o);render(){let{getComponent:o,value:s,errors:i,schema:u,required:_,disabled:w}=this.props;i=i.toJS?i.toJS():[];let x=u&&u.get?u.get(\"enum\"):null,C=!x||!_,j=!x&&[\"true\",\"false\"];const L=o(\"Select\");return Pe.createElement(L,{className:i.length?\"invalid\":\"\",title:i.length?i:\"\",value:String(s),disabled:w,allowedValues:x?[...x]:j,allowEmptyValue:C,onChange:this.onEnumChange})}}const stringifyObjectErrors=o=>o.map((o=>{const s=void 0!==o.propKey?o.propKey:o.index;let i=\"string\"==typeof o?o:\"string\"==typeof o.error?o.error:null;if(!s&&i)return i;let u=o.error,_=`/${o.propKey}`;for(;\"object\"==typeof u;){const o=void 0!==u.propKey?u.propKey:u.index;if(void 0===o)break;if(_+=`/${o}`,!u.error)break;u=u.error}return`${_}: ${u}`}));class JsonSchema_object extends Pe.PureComponent{constructor(){super()}static defaultProps=Ko;onChange=o=>{this.props.onChange(o)};handleOnChange=o=>{const s=o.target.value;this.onChange(s)};render(){let{getComponent:o,value:s,errors:i,disabled:u}=this.props;const _=o(\"TextArea\");return i=i.toJS?i.toJS():Array.isArray(i)?i:[],Pe.createElement(\"div\",null,Pe.createElement(_,{className:To()({invalid:i.length}),title:i.length?stringifyObjectErrors(i).join(\", \"):\"\",value:stringify(s),disabled:u,onChange:this.handleOnChange}))}}function valueOrEmptyList(o){return qe.List.isList(o)?o:Array.isArray(o)?(0,qe.fromJS)(o):(0,qe.List)()}const json_schema_5=()=>({components:{modelExample:model_example,ModelWrapper,ModelCollapse,Model,Models,EnumModel:enum_model,ObjectModel,ArrayModel,PrimitiveModel:Primitive,schemes:Schemes,SchemesContainer,...z}});var Ho=__webpack_require__(19123),Jo=__webpack_require__.n(Ho),Go=__webpack_require__(41859),Yo=__webpack_require__.n(Go),Xo=__webpack_require__(62193),Qo=__webpack_require__.n(Xo);const shallowArrayEquals=o=>s=>Array.isArray(o)&&Array.isArray(s)&&o.length===s.length&&o.every(((o,i)=>o===s[i])),list=(...o)=>o;class Cache extends Map{delete(o){const s=Array.from(this.keys()).find(shallowArrayEquals(o));return super.delete(s)}get(o){const s=Array.from(this.keys()).find(shallowArrayEquals(o));return super.get(s)}has(o){return-1!==Array.from(this.keys()).findIndex(shallowArrayEquals(o))}}const utils_memoizeN=(o,s=list)=>{const{Cache:i}=ut();ut().Cache=Cache;const u=ut()(o,s);return ut().Cache=i,u},Zo={string:o=>o.pattern?(o=>{try{return new(Yo())(o).gen()}catch(o){return\"string\"}})(o.pattern):\"string\",string_email:()=>\"user@example.com\",\"string_date-time\":()=>(new Date).toISOString(),string_date:()=>(new Date).toISOString().substring(0,10),string_uuid:()=>\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",string_hostname:()=>\"example.com\",string_ipv4:()=>\"198.51.100.42\",string_ipv6:()=>\"2001:0db8:5b96:0000:0000:426f:8e17:642a\",number:()=>0,number_float:()=>0,integer:()=>0,boolean:o=>\"boolean\"!=typeof o.default||o.default},primitive=o=>{o=objectify(o);let{type:s,format:i}=o,u=Zo[`${s}_${i}`]||Zo[s];return isFunc(u)?u(o):\"Unknown Type: \"+o.type},sanitizeRef=o=>deeplyStripKey(o,\"$$ref\",(o=>\"string\"==typeof o&&o.indexOf(\"#\")>-1)),es=[\"maxProperties\",\"minProperties\"],ts=[\"minItems\",\"maxItems\"],rs=[\"minimum\",\"maximum\",\"exclusiveMinimum\",\"exclusiveMaximum\"],ns=[\"minLength\",\"maxLength\"],mergeJsonSchema=(o,s,i={})=>{const u={...o};if([\"example\",\"default\",\"enum\",\"xml\",\"type\",...es,...ts,...rs,...ns].forEach((o=>(o=>{void 0===u[o]&&void 0!==s[o]&&(u[o]=s[o])})(o))),void 0!==s.required&&Array.isArray(s.required)&&(void 0!==u.required&&u.required.length||(u.required=[]),s.required.forEach((o=>{u.required.includes(o)||u.required.push(o)}))),s.properties){u.properties||(u.properties={});let o=objectify(s.properties);for(let _ in o)Object.prototype.hasOwnProperty.call(o,_)&&(o[_]&&o[_].deprecated||o[_]&&o[_].readOnly&&!i.includeReadOnly||o[_]&&o[_].writeOnly&&!i.includeWriteOnly||u.properties[_]||(u.properties[_]=o[_],!s.required&&Array.isArray(s.required)&&-1!==s.required.indexOf(_)&&(u.required?u.required.push(_):u.required=[_])))}return s.items&&(u.items||(u.items={}),u.items=mergeJsonSchema(u.items,s.items,i)),u},sampleFromSchemaGeneric=(o,s={},i=void 0,u=!1)=>{o&&isFunc(o.toJS)&&(o=o.toJS());let _=void 0!==i||o&&void 0!==o.example||o&&void 0!==o.default;const w=!_&&o&&o.oneOf&&o.oneOf.length>0,x=!_&&o&&o.anyOf&&o.anyOf.length>0;if(!_&&(w||x)){const i=objectify(w?o.oneOf[0]:o.anyOf[0]);if(!(o=mergeJsonSchema(o,i,s)).xml&&i.xml&&(o.xml=i.xml),void 0!==o.example&&void 0!==i.example)_=!0;else if(i.properties){o.properties||(o.properties={});let u=objectify(i.properties);for(let _ in u)Object.prototype.hasOwnProperty.call(u,_)&&(u[_]&&u[_].deprecated||u[_]&&u[_].readOnly&&!s.includeReadOnly||u[_]&&u[_].writeOnly&&!s.includeWriteOnly||o.properties[_]||(o.properties[_]=u[_],!i.required&&Array.isArray(i.required)&&-1!==i.required.indexOf(_)&&(o.required?o.required.push(_):o.required=[_])))}}const C={};let{xml:j,type:L,example:B,properties:$,additionalProperties:V,items:U}=o||{},{includeReadOnly:z,includeWriteOnly:Y}=s;j=j||{};let Z,{name:ee,prefix:ie,namespace:ae}=j,ce={};if(u&&(ee=ee||\"notagname\",Z=(ie?ie+\":\":\"\")+ee,ae)){C[ie?\"xmlns:\"+ie:\"xmlns\"]=ae}u&&(ce[Z]=[]);const schemaHasAny=s=>s.some((s=>Object.prototype.hasOwnProperty.call(o,s)));o&&!L&&($||V||schemaHasAny(es)?L=\"object\":U||schemaHasAny(ts)?L=\"array\":schemaHasAny(rs)?(L=\"number\",o.type=\"number\"):_||o.enum||(L=\"string\",o.type=\"string\"));const handleMinMaxItems=s=>{if(null!=o?.maxItems&&(s=s.slice(0,o?.maxItems)),null!=o?.minItems){let i=0;for(;s.length<o?.minItems;)s.push(s[i++%s.length])}return s},le=objectify($);let pe,de=0;const hasExceededMaxProperties=()=>o&&null!==o.maxProperties&&void 0!==o.maxProperties&&de>=o.maxProperties,canAddProperty=s=>!o||null===o.maxProperties||void 0===o.maxProperties||!hasExceededMaxProperties()&&(!(s=>!(o&&o.required&&o.required.length&&o.required.includes(s)))(s)||o.maxProperties-de-(()=>{if(!o||!o.required)return 0;let s=0;return u?o.required.forEach((o=>s+=void 0===ce[o]?0:1)):o.required.forEach((o=>s+=void 0===ce[Z]?.find((s=>void 0!==s[o]))?0:1)),o.required.length-s})()>0);if(pe=u?(i,_=void 0)=>{if(o&&le[i]){if(le[i].xml=le[i].xml||{},le[i].xml.attribute){const o=Array.isArray(le[i].enum)?le[i].enum[0]:void 0,s=le[i].example,u=le[i].default;return void(C[le[i].xml.name||i]=void 0!==s?s:void 0!==u?u:void 0!==o?o:primitive(le[i]))}le[i].xml.name=le[i].xml.name||i}else le[i]||!1===V||(le[i]={xml:{name:i}});let w=sampleFromSchemaGeneric(o&&le[i]||void 0,s,_,u);canAddProperty(i)&&(de++,Array.isArray(w)?ce[Z]=ce[Z].concat(w):ce[Z].push(w))}:(i,_)=>{if(canAddProperty(i)){if(Object.prototype.hasOwnProperty.call(o,\"discriminator\")&&o.discriminator&&Object.prototype.hasOwnProperty.call(o.discriminator,\"mapping\")&&o.discriminator.mapping&&Object.prototype.hasOwnProperty.call(o,\"$$ref\")&&o.$$ref&&o.discriminator.propertyName===i){for(let s in o.discriminator.mapping)if(-1!==o.$$ref.search(o.discriminator.mapping[s])){ce[i]=s;break}}else ce[i]=sampleFromSchemaGeneric(le[i],s,_,u);de++}},_){let _;if(_=sanitizeRef(void 0!==i?i:void 0!==B?B:o.default),!u){if(\"number\"==typeof _&&\"string\"===L)return`${_}`;if(\"string\"!=typeof _||\"string\"===L)return _;try{return JSON.parse(_)}catch(o){return _}}if(o||(L=Array.isArray(_)?\"array\":typeof _),\"array\"===L){if(!Array.isArray(_)){if(\"string\"==typeof _)return _;_=[_]}const i=o?o.items:void 0;i&&(i.xml=i.xml||j||{},i.xml.name=i.xml.name||j.name);let w=_.map((o=>sampleFromSchemaGeneric(i,s,o,u)));return w=handleMinMaxItems(w),j.wrapped?(ce[Z]=w,Qo()(C)||ce[Z].push({_attr:C})):ce=w,ce}if(\"object\"===L){if(\"string\"==typeof _)return _;for(let s in _)Object.prototype.hasOwnProperty.call(_,s)&&(o&&le[s]&&le[s].readOnly&&!z||o&&le[s]&&le[s].writeOnly&&!Y||(o&&le[s]&&le[s].xml&&le[s].xml.attribute?C[le[s].xml.name||s]=_[s]:pe(s,_[s])));return Qo()(C)||ce[Z].push({_attr:C}),ce}return ce[Z]=Qo()(C)?_:[{_attr:C},_],ce}if(\"object\"===L){for(let o in le)Object.prototype.hasOwnProperty.call(le,o)&&(le[o]&&le[o].deprecated||le[o]&&le[o].readOnly&&!z||le[o]&&le[o].writeOnly&&!Y||pe(o));if(u&&C&&ce[Z].push({_attr:C}),hasExceededMaxProperties())return ce;if(!0===V)u?ce[Z].push({additionalProp:\"Anything can be here\"}):ce.additionalProp1={},de++;else if(V){const i=objectify(V),_=sampleFromSchemaGeneric(i,s,void 0,u);if(u&&i.xml&&i.xml.name&&\"notagname\"!==i.xml.name)ce[Z].push(_);else{const s=null!==o.minProperties&&void 0!==o.minProperties&&de<o.minProperties?o.minProperties-de:3;for(let o=1;o<=s;o++){if(hasExceededMaxProperties())return ce;if(u){const s={};s[\"additionalProp\"+o]=_.notagname,ce[Z].push(s)}else ce[\"additionalProp\"+o]=_;de++}}}return ce}if(\"array\"===L){if(!U)return;let i;if(u&&(U.xml=U.xml||o?.xml||{},U.xml.name=U.xml.name||j.name),Array.isArray(U.anyOf))i=U.anyOf.map((o=>sampleFromSchemaGeneric(mergeJsonSchema(o,U,s),s,void 0,u)));else if(Array.isArray(U.oneOf))i=U.oneOf.map((o=>sampleFromSchemaGeneric(mergeJsonSchema(o,U,s),s,void 0,u)));else{if(!(!u||u&&j.wrapped))return sampleFromSchemaGeneric(U,s,void 0,u);i=[sampleFromSchemaGeneric(U,s,void 0,u)]}return i=handleMinMaxItems(i),u&&j.wrapped?(ce[Z]=i,Qo()(C)||ce[Z].push({_attr:C}),ce):i}let fe;if(o&&Array.isArray(o.enum))fe=normalizeArray(o.enum)[0];else{if(!o)return;if(fe=primitive(o),\"number\"==typeof fe){let s=o.minimum;null!=s&&(o.exclusiveMinimum&&s++,fe=s);let i=o.maximum;null!=i&&(o.exclusiveMaximum&&i--,fe=i)}if(\"string\"==typeof fe&&(null!==o.maxLength&&void 0!==o.maxLength&&(fe=fe.slice(0,o.maxLength)),null!==o.minLength&&void 0!==o.minLength)){let s=0;for(;fe.length<o.minLength;)fe+=fe[s++%fe.length]}}if(\"file\"!==L)return u?(ce[Z]=Qo()(C)?fe:[{_attr:C},fe],ce):fe},inferSchema=o=>(o.schema&&(o=o.schema),o.properties&&(o.type=\"object\"),o),createXMLExample=(o,s,i)=>{const u=sampleFromSchemaGeneric(o,s,i,!0);if(u)return\"string\"==typeof u?u:Jo()(u,{declaration:!0,indent:\"\\t\"})},sampleFromSchema=(o,s,i)=>sampleFromSchemaGeneric(o,s,i,!1),resolver=(o,s,i)=>[o,JSON.stringify(s),JSON.stringify(i)],os=utils_memoizeN(createXMLExample,resolver),ss=utils_memoizeN(sampleFromSchema,resolver),as=[{when:/json/,shouldStringifyTypes:[\"string\"]}],cs=[\"object\"],get_json_sample_schema=o=>(s,i,u,_)=>{const{fn:w}=o(),x=w.memoizedSampleFromSchema(s,i,_),C=typeof x,j=as.reduce(((o,s)=>s.when.test(u)?[...o,...s.shouldStringifyTypes]:o),cs);return mt()(j,(o=>o===C))?JSON.stringify(x,null,2):x},get_yaml_sample_schema=o=>(s,i,u,_)=>{const{fn:w}=o(),x=w.getJsonSampleSchema(s,i,u,_);let C;try{C=to.dump(to.load(x),{lineWidth:-1},{schema:zn}),\"\\n\"===C[C.length-1]&&(C=C.slice(0,C.length-1))}catch(o){return console.error(o),\"error: could not generate yaml example\"}return C.replace(/\\t/g,\"  \")},get_xml_sample_schema=o=>(s,i,u)=>{const{fn:_}=o();if(s&&!s.xml&&(s.xml={}),s&&!s.xml.name){if(!s.$$ref&&(s.type||s.items||s.properties||s.additionalProperties))return'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n\\x3c!-- XML example cannot be generated; root element name is undefined --\\x3e';if(s.$$ref){let o=s.$$ref.match(/\\S*\\/(\\S+)$/);s.xml.name=o[1]}}return _.memoizedCreateXMLExample(s,i,u)},get_sample_schema=o=>(s,i=\"\",u={},_=void 0)=>{const{fn:w}=o();return\"function\"==typeof s?.toJS&&(s=s.toJS()),\"function\"==typeof _?.toJS&&(_=_.toJS()),/xml/.test(i)?w.getXmlSampleSchema(s,u,_):/(yaml|yml)/.test(i)?w.getYamlSampleSchema(s,u,i,_):w.getJsonSampleSchema(s,u,i,_)},json_schema_5_samples=({getSystem:o})=>{const s=get_json_sample_schema(o),i=get_yaml_sample_schema(o),u=get_xml_sample_schema(o),_=get_sample_schema(o);return{fn:{jsonSchema5:{inferSchema,sampleFromSchema,sampleFromSchemaGeneric,createXMLExample,memoizedSampleFromSchema:ss,memoizedCreateXMLExample:os,getJsonSampleSchema:s,getYamlSampleSchema:i,getXmlSampleSchema:u,getSampleSchema:_,mergeJsonSchema},inferSchema,sampleFromSchema,sampleFromSchemaGeneric,createXMLExample,memoizedSampleFromSchema:ss,memoizedCreateXMLExample:os,getJsonSampleSchema:s,getYamlSampleSchema:i,getXmlSampleSchema:u,getSampleSchema:_,mergeJsonSchema}}};var ls=__webpack_require__(37334),us=__webpack_require__.n(ls);const ps=[\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"],spec_selectors_state=o=>o||(0,qe.Map)(),hs=Wt(spec_selectors_state,(o=>o.get(\"lastError\"))),ds=Wt(spec_selectors_state,(o=>o.get(\"url\"))),fs=Wt(spec_selectors_state,(o=>o.get(\"spec\")||\"\")),ms=Wt(spec_selectors_state,(o=>o.get(\"specSource\")||\"not-editor\")),gs=Wt(spec_selectors_state,(o=>o.get(\"json\",(0,qe.Map)()))),ys=Wt(gs,(o=>o.toJS())),vs=Wt(spec_selectors_state,(o=>o.get(\"resolved\",(0,qe.Map)()))),specResolvedSubtree=(o,s)=>o.getIn([\"resolvedSubtrees\",...s],void 0),mergerFn=(o,s)=>qe.Map.isMap(o)&&qe.Map.isMap(s)?s.get(\"$$ref\")?s:(0,qe.OrderedMap)().mergeWith(mergerFn,o,s):s,bs=Wt(spec_selectors_state,(o=>(0,qe.OrderedMap)().mergeWith(mergerFn,o.get(\"json\"),o.get(\"resolvedSubtrees\")))),spec=o=>gs(o),_s=Wt(spec,(()=>!1)),Es=Wt(spec,(o=>returnSelfOrNewMap(o&&o.get(\"info\")))),ws=Wt(spec,(o=>returnSelfOrNewMap(o&&o.get(\"externalDocs\")))),Ss=Wt(Es,(o=>o&&o.get(\"version\"))),xs=Wt(Ss,(o=>/v?([0-9]*)\\.([0-9]*)\\.([0-9]*)/i.exec(o).slice(1))),ks=Wt(bs,(o=>o.get(\"paths\"))),Os=us()([\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\"]),Cs=Wt(ks,(o=>{if(!o||o.size<1)return(0,qe.List)();let s=(0,qe.List)();return o&&o.forEach?(o.forEach(((o,i)=>{if(!o||!o.forEach)return{};o.forEach(((o,u)=>{ps.indexOf(u)<0||(s=s.push((0,qe.fromJS)({path:i,method:u,operation:o,id:`${u}-${i}`})))}))})),s):(0,qe.List)()})),As=Wt(spec,(o=>(0,qe.Set)(o.get(\"consumes\")))),js=Wt(spec,(o=>(0,qe.Set)(o.get(\"produces\")))),Ps=Wt(spec,(o=>o.get(\"security\",(0,qe.List)()))),Is=Wt(spec,(o=>o.get(\"securityDefinitions\"))),findDefinition=(o,s)=>{const i=o.getIn([\"resolvedSubtrees\",\"definitions\",s],null),u=o.getIn([\"json\",\"definitions\",s],null);return i||u||null},Ms=Wt(spec,(o=>{const s=o.get(\"definitions\");return qe.Map.isMap(s)?s:(0,qe.Map)()})),Ns=Wt(spec,(o=>o.get(\"basePath\"))),Ts=Wt(spec,(o=>o.get(\"host\"))),Rs=Wt(spec,(o=>o.get(\"schemes\",(0,qe.Map)()))),Ds=Wt([Cs,As,js],((o,s,i)=>o.map((o=>o.update(\"operation\",(o=>{if(o){if(!qe.Map.isMap(o))return;return o.withMutations((o=>(o.get(\"consumes\")||o.update(\"consumes\",(o=>(0,qe.Set)(o).merge(s))),o.get(\"produces\")||o.update(\"produces\",(o=>(0,qe.Set)(o).merge(i))),o)))}return(0,qe.Map)()})))))),Ls=Wt(spec,(o=>{const s=o.get(\"tags\",(0,qe.List)());return qe.List.isList(s)?s.filter((o=>qe.Map.isMap(o))):(0,qe.List)()})),tagDetails=(o,s)=>(Ls(o)||(0,qe.List)()).filter(qe.Map.isMap).find((o=>o.get(\"name\")===s),(0,qe.Map)()),Bs=Wt(Ds,Ls,((o,s)=>o.reduce(((o,s)=>{let i=(0,qe.Set)(s.getIn([\"operation\",\"tags\"]));return i.count()<1?o.update(\"default\",(0,qe.List)(),(o=>o.push(s))):i.reduce(((o,i)=>o.update(i,(0,qe.List)(),(o=>o.push(s)))),o)}),s.reduce(((o,s)=>o.set(s.get(\"name\"),(0,qe.List)())),(0,qe.OrderedMap)())))),selectors_taggedOperations=o=>({getConfigs:s})=>{let{tagsSorter:i,operationsSorter:u}=s();return Bs(o).sortBy(((o,s)=>s),((o,s)=>{let u=\"function\"==typeof i?i:Pt.tagsSorter[i];return u?u(o,s):null})).map(((s,i)=>{let _=\"function\"==typeof u?u:Pt.operationsSorter[u],w=_?s.sort(_):s;return(0,qe.Map)({tagDetails:tagDetails(o,i),operations:w})}))},Fs=Wt(spec_selectors_state,(o=>o.get(\"responses\",(0,qe.Map)()))),qs=Wt(spec_selectors_state,(o=>o.get(\"requests\",(0,qe.Map)()))),$s=Wt(spec_selectors_state,(o=>o.get(\"mutatedRequests\",(0,qe.Map)()))),responseFor=(o,s,i)=>Fs(o).getIn([s,i],null),requestFor=(o,s,i)=>qs(o).getIn([s,i],null),mutatedRequestFor=(o,s,i)=>$s(o).getIn([s,i],null),allowTryItOutFor=()=>!0,parameterWithMetaByIdentity=(o,s,i)=>{const u=bs(o).getIn([\"paths\",...s,\"parameters\"],(0,qe.OrderedMap)()),_=o.getIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.OrderedMap)());return u.map((o=>{const s=_.get(`${i.get(\"in\")}.${i.get(\"name\")}`),u=_.get(`${i.get(\"in\")}.${i.get(\"name\")}.hash-${i.hashCode()}`);return(0,qe.OrderedMap)().merge(o,s,u)})).find((o=>o.get(\"in\")===i.get(\"in\")&&o.get(\"name\")===i.get(\"name\")),(0,qe.OrderedMap)())},parameterInclusionSettingFor=(o,s,i,u)=>{const _=`${u}.${i}`;return o.getIn([\"meta\",\"paths\",...s,\"parameter_inclusions\",_],!1)},parameterWithMeta=(o,s,i,u)=>{const _=bs(o).getIn([\"paths\",...s,\"parameters\"],(0,qe.OrderedMap)()).find((o=>o.get(\"in\")===u&&o.get(\"name\")===i),(0,qe.OrderedMap)());return parameterWithMetaByIdentity(o,s,_)},operationWithMeta=(o,s,i)=>{const u=bs(o).getIn([\"paths\",s,i],(0,qe.OrderedMap)()),_=o.getIn([\"meta\",\"paths\",s,i],(0,qe.OrderedMap)()),w=u.get(\"parameters\",(0,qe.List)()).map((u=>parameterWithMetaByIdentity(o,[s,i],u)));return(0,qe.OrderedMap)().merge(u,_).set(\"parameters\",w)};function getParameter(o,s,i,u){return s=s||[],o.getIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.fromJS)([])).find((o=>qe.Map.isMap(o)&&o.get(\"name\")===i&&o.get(\"in\")===u))||(0,qe.Map)()}const Vs=Wt(spec,(o=>{const s=o.get(\"host\");return\"string\"==typeof s&&s.length>0&&\"/\"!==s[0]}));function parameterValues(o,s,i){return s=s||[],operationWithMeta(o,...s).get(\"parameters\",(0,qe.List)()).reduce(((o,s)=>{let u=i&&\"body\"===s.get(\"in\")?s.get(\"value_xml\"):s.get(\"value\");return qe.List.isList(u)&&(u=u.filter((o=>\"\"!==o))),o.set(paramToIdentifier(s,{allowHashes:!1}),u)}),(0,qe.fromJS)({}))}function parametersIncludeIn(o,s=\"\"){if(qe.List.isList(o))return o.some((o=>qe.Map.isMap(o)&&o.get(\"in\")===s))}function parametersIncludeType(o,s=\"\"){if(qe.List.isList(o))return o.some((o=>qe.Map.isMap(o)&&o.get(\"type\")===s))}function contentTypeValues(o,s){s=s||[];let i=bs(o).getIn([\"paths\",...s],(0,qe.fromJS)({})),u=o.getIn([\"meta\",\"paths\",...s],(0,qe.fromJS)({})),_=currentProducesFor(o,s);const w=i.get(\"parameters\")||new qe.List,x=u.get(\"consumes_value\")?u.get(\"consumes_value\"):parametersIncludeType(w,\"file\")?\"multipart/form-data\":parametersIncludeType(w,\"formData\")?\"application/x-www-form-urlencoded\":void 0;return(0,qe.fromJS)({requestContentType:x,responseContentType:_})}function currentProducesFor(o,s){s=s||[];const i=bs(o).getIn([\"paths\",...s],null);if(null===i)return;const u=o.getIn([\"meta\",\"paths\",...s,\"produces_value\"],null),_=i.getIn([\"produces\",0],null);return u||_||\"application/json\"}function producesOptionsFor(o,s){s=s||[];const i=bs(o),u=i.getIn([\"paths\",...s],null);if(null===u)return;const[_]=s,w=u.get(\"produces\",null),x=i.getIn([\"paths\",_,\"produces\"],null),C=i.getIn([\"produces\"],null);return w||x||C}function consumesOptionsFor(o,s){s=s||[];const i=bs(o),u=i.getIn([\"paths\",...s],null);if(null===u)return;const[_]=s,w=u.get(\"consumes\",null),x=i.getIn([\"paths\",_,\"consumes\"],null),C=i.getIn([\"consumes\"],null);return w||x||C}const operationScheme=(o,s,i)=>{let u=o.get(\"url\").match(/^([a-z][a-z0-9+\\-.]*):/),_=Array.isArray(u)?u[1]:null;return o.getIn([\"scheme\",s,i])||o.getIn([\"scheme\",\"_defaultScheme\"])||_||\"\"},canExecuteScheme=(o,s,i)=>[\"http\",\"https\"].indexOf(operationScheme(o,s,i))>-1,validationErrors=(o,s)=>{s=s||[];const i=o.getIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.fromJS)([])),u=[];if(0===i.length)return u;const getErrorsWithPaths=(o,s=[])=>{const getNestedErrorsWithPaths=(o,s)=>{const i=[...s,o.get(\"propKey\")||o.get(\"index\")];return qe.Map.isMap(o.get(\"error\"))?getErrorsWithPaths(o.get(\"error\"),i):{error:o.get(\"error\"),path:i}};return qe.List.isList(o)?o.map((o=>qe.Map.isMap(o)?getNestedErrorsWithPaths(o,s):{error:o,path:s})):getNestedErrorsWithPaths(o,s)};return i.forEach(((o,s)=>{const i=s.split(\".\").slice(1,-1).join(\".\"),_=o.get(\"errors\");if(_&&_.count()){getErrorsWithPaths(_).forEach((({error:o,path:s})=>{u.push(((o,s,i)=>`For '${i}'${(s=s.reduce(((o,s)=>\"number\"==typeof s?`${o}[${s}]`:o?`${o}.${s}`:s),\"\"))?` at path '${s}'`:\"\"}: ${o}.`)(o,s,i))}))}})),u},validateBeforeExecute=(o,s)=>0===validationErrors(o,s).length,getOAS3RequiredRequestBodyContentType=(o,s)=>{let i={requestBody:!1,requestContentType:{}},u=o.getIn([\"resolvedSubtrees\",\"paths\",...s,\"requestBody\"],(0,qe.fromJS)([]));return u.size<1||(u.getIn([\"required\"])&&(i.requestBody=u.getIn([\"required\"])),u.getIn([\"content\"]).entrySeq().forEach((o=>{const s=o[0];if(o[1].getIn([\"schema\",\"required\"])){const u=o[1].getIn([\"schema\",\"required\"]).toJS();i.requestContentType[s]=u}}))),i},isMediaTypeSchemaPropertiesEqual=(o,s,i,u)=>{if((i||u)&&i===u)return!0;let _=o.getIn([\"resolvedSubtrees\",\"paths\",...s,\"requestBody\",\"content\"],(0,qe.fromJS)([]));if(_.size<2||!i||!u)return!1;let w=_.getIn([i,\"schema\",\"properties\"],(0,qe.fromJS)([])),x=_.getIn([u,\"schema\",\"properties\"],(0,qe.fromJS)([]));return!!w.equals(x)};function returnSelfOrNewMap(o){return qe.Map.isMap(o)?o:new qe.Map}var Us=__webpack_require__(85015),zs=__webpack_require__.n(Us),Ws=__webpack_require__(38221),Ks=__webpack_require__.n(Ws),Hs=__webpack_require__(63560),Js=__webpack_require__.n(Hs),Gs=__webpack_require__(56367),Ys=__webpack_require__.n(Gs);const Xs=\"spec_update_spec\",Qs=\"spec_update_url\",Zs=\"spec_update_json\",_i=\"spec_update_param\",Ei=\"spec_update_empty_param_inclusion\",Oi=\"spec_validate_param\",Pi=\"spec_set_response\",Mi=\"spec_set_request\",Ri=\"spec_set_mutated_request\",Wi=\"spec_log_request\",ea=\"spec_clear_response\",ra=\"spec_clear_request\",na=\"spec_clear_validate_param\",ia=\"spec_update_operation_meta_value\",aa=\"spec_update_resolved\",ca=\"spec_update_resolved_subtree\",la=\"set_scheme\",toStr=o=>zs()(o)?o:\"\";function updateSpec(o){const s=toStr(o).replace(/\\t/g,\"  \");if(\"string\"==typeof o)return{type:Xs,payload:s}}function updateResolved(o){return{type:aa,payload:o}}function updateUrl(o){return{type:Qs,payload:o}}function updateJsonSpec(o){return{type:Zs,payload:o}}const parseToJson=o=>({specActions:s,specSelectors:i,errActions:u})=>{let{specStr:_}=i,w=null;try{o=o||_(),u.clear({source:\"parser\"}),w=to.load(o,{schema:zn})}catch(o){return console.error(o),u.newSpecErr({source:\"parser\",level:\"error\",message:o.reason,line:o.mark&&o.mark.line?o.mark.line+1:void 0})}return w&&\"object\"==typeof w?s.updateJsonSpec(w):{}};let ua=!1;const resolveSpec=(o,s)=>({specActions:i,specSelectors:u,errActions:_,fn:{fetch:w,resolve:x,AST:C={}},getConfigs:j})=>{ua||(console.warn(\"specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!\"),ua=!0);const{modelPropertyMacro:L,parameterMacro:B,requestInterceptor:$,responseInterceptor:V}=j();void 0===o&&(o=u.specJson()),void 0===s&&(s=u.url());let U=C.getLineNumberForPath?C.getLineNumberForPath:()=>{},z=u.specStr();return x({fetch:w,spec:o,baseDoc:String(new URL(s,document.baseURI)),modelPropertyMacro:L,parameterMacro:B,requestInterceptor:$,responseInterceptor:V}).then((({spec:o,errors:s})=>{if(_.clear({type:\"thrown\"}),Array.isArray(s)&&s.length>0){let o=s.map((o=>(console.error(o),o.line=o.fullPath?U(z,o.fullPath):null,o.path=o.fullPath?o.fullPath.join(\".\"):null,o.level=\"error\",o.type=\"thrown\",o.source=\"resolver\",Object.defineProperty(o,\"message\",{enumerable:!0,value:o.message}),o)));_.newThrownErrBatch(o)}return i.updateResolved(o)}))};let da=[];const ma=Ks()((()=>{const o=da.reduce(((o,{path:s,system:i})=>(o.has(i)||o.set(i,[]),o.get(i).push(s),o)),new Map);da=[],o.forEach((async(o,s)=>{if(!s)return void console.error(\"debResolveSubtrees: don't have a system to operate on, aborting.\");if(!s.fn.resolveSubtree)return void console.error(\"Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing.\");const{errActions:i,errSelectors:u,fn:{resolveSubtree:_,fetch:w,AST:x={}},specSelectors:C,specActions:j}=s,L=x.getLineNumberForPath??us()(void 0),B=C.specStr(),{modelPropertyMacro:$,parameterMacro:V,requestInterceptor:U,responseInterceptor:z}=s.getConfigs();try{const s=await o.reduce((async(o,s)=>{let{resultMap:x,specWithCurrentSubtrees:j}=await o;const{errors:Y,spec:Z}=await _(j,s,{baseDoc:String(new URL(C.url(),document.baseURI)),modelPropertyMacro:$,parameterMacro:V,requestInterceptor:U,responseInterceptor:z});if(u.allErrors().size&&i.clearBy((o=>\"thrown\"!==o.get(\"type\")||\"resolver\"!==o.get(\"source\")||!o.get(\"fullPath\").every(((o,i)=>o===s[i]||void 0===s[i])))),Array.isArray(Y)&&Y.length>0){let o=Y.map((o=>(o.line=o.fullPath?L(B,o.fullPath):null,o.path=o.fullPath?o.fullPath.join(\".\"):null,o.level=\"error\",o.type=\"thrown\",o.source=\"resolver\",Object.defineProperty(o,\"message\",{enumerable:!0,value:o.message}),o)));i.newThrownErrBatch(o)}return Z&&C.isOAS3()&&\"components\"===s[0]&&\"securitySchemes\"===s[1]&&await Promise.all(Object.values(Z).filter((o=>\"openIdConnect\"===o.type)).map((async o=>{const s={url:o.openIdConnectUrl,requestInterceptor:U,responseInterceptor:z};try{const i=await w(s);i instanceof Error||i.status>=400?console.error(i.statusText+\" \"+s.url):o.openIdConnectData=JSON.parse(i.text)}catch(o){console.error(o)}}))),Js()(x,s,Z),j=Ys()(s,Z,j),{resultMap:x,specWithCurrentSubtrees:j}}),Promise.resolve({resultMap:(C.specResolvedSubtree([])||(0,qe.Map)()).toJS(),specWithCurrentSubtrees:C.specJS()}));j.updateResolvedSubtree([],s.resultMap)}catch(o){console.error(o)}}))}),35),requestResolvedSubtree=o=>s=>{da.find((({path:i,system:u})=>u===s&&i.toString()===o.toString()))||(da.push({path:o,system:s}),ma())};function changeParam(o,s,i,u,_){return{type:_i,payload:{path:o,value:u,paramName:s,paramIn:i,isXml:_}}}function changeParamByIdentity(o,s,i,u){return{type:_i,payload:{path:o,param:s,value:i,isXml:u}}}const updateResolvedSubtree=(o,s)=>({type:ca,payload:{path:o,value:s}}),invalidateResolvedSubtreeCache=()=>({type:ca,payload:{path:[],value:(0,qe.Map)()}}),validateParams=(o,s)=>({type:Oi,payload:{pathMethod:o,isOAS3:s}}),updateEmptyParamInclusion=(o,s,i,u)=>({type:Ei,payload:{pathMethod:o,paramName:s,paramIn:i,includeEmptyValue:u}});function clearValidateParams(o){return{type:na,payload:{pathMethod:o}}}function changeConsumesValue(o,s){return{type:ia,payload:{path:o,value:s,key:\"consumes_value\"}}}function changeProducesValue(o,s){return{type:ia,payload:{path:o,value:s,key:\"produces_value\"}}}const setResponse=(o,s,i)=>({payload:{path:o,method:s,res:i},type:Pi}),setRequest=(o,s,i)=>({payload:{path:o,method:s,req:i},type:Mi}),setMutatedRequest=(o,s,i)=>({payload:{path:o,method:s,req:i},type:Ri}),logRequest=o=>({payload:o,type:Wi}),executeRequest=o=>({fn:s,specActions:i,specSelectors:u,getConfigs:_,oas3Selectors:w})=>{let{pathName:x,method:C,operation:j}=o,{requestInterceptor:L,responseInterceptor:B}=_(),$=j.toJS();if(j&&j.get(\"parameters\")&&j.get(\"parameters\").filter((o=>o&&!0===o.get(\"allowEmptyValue\"))).forEach((s=>{if(u.parameterInclusionSettingFor([x,C],s.get(\"name\"),s.get(\"in\"))){o.parameters=o.parameters||{};const i=paramToValue(s,o.parameters);(!i||i&&0===i.size)&&(o.parameters[s.get(\"name\")]=\"\")}})),o.contextUrl=Mt()(u.url()).toString(),$&&$.operationId?o.operationId=$.operationId:$&&x&&C&&(o.operationId=s.opId($,x,C)),u.isOAS3()){const s=`${x}:${C}`;o.server=w.selectedServer(s)||w.selectedServer();const i=w.serverVariables({server:o.server,namespace:s}).toJS(),u=w.serverVariables({server:o.server}).toJS();o.serverVariables=Object.keys(i).length?i:u,o.requestContentType=w.requestContentType(x,C),o.responseContentType=w.responseContentType(x,C)||\"*/*\";const _=w.requestBodyValue(x,C),j=w.requestBodyInclusionSetting(x,C);_&&_.toJS?o.requestBody=_.map((o=>qe.Map.isMap(o)?o.get(\"value\"):o)).filter(((o,s)=>(Array.isArray(o)?0!==o.length:!isEmptyValue(o))||j.get(s))).toJS():o.requestBody=_}let V=Object.assign({},o);V=s.buildRequest(V),i.setRequest(o.pathName,o.method,V);o.requestInterceptor=async s=>{let u=await L.apply(void 0,[s]),_=Object.assign({},u);return i.setMutatedRequest(o.pathName,o.method,_),u},o.responseInterceptor=B;const U=Date.now();return s.execute(o).then((s=>{s.duration=Date.now()-U,i.setResponse(o.pathName,o.method,s)})).catch((s=>{\"Failed to fetch\"===s.message&&(s.name=\"\",s.message='**Failed to fetch.**  \\n**Possible Reasons:** \\n  - CORS \\n  - Network Failure \\n  - URL scheme must be \"http\" or \"https\" for CORS request.'),i.setResponse(o.pathName,o.method,{error:!0,err:s})}))},actions_execute=({path:o,method:s,...i}={})=>u=>{let{fn:{fetch:_},specSelectors:w,specActions:x}=u,C=w.specJsonWithResolvedSubtrees().toJS(),j=w.operationScheme(o,s),{requestContentType:L,responseContentType:B}=w.contentTypeValues([o,s]).toJS(),$=/xml/i.test(L),V=w.parameterValues([o,s],$).toJS();return x.executeRequest({...i,fetch:_,spec:C,pathName:o,method:s,parameters:V,requestContentType:L,scheme:j,responseContentType:B})};function clearResponse(o,s){return{type:ea,payload:{path:o,method:s}}}function clearRequest(o,s){return{type:ra,payload:{path:o,method:s}}}function setScheme(o,s,i){return{type:la,payload:{scheme:o,path:s,method:i}}}const ga={[Xs]:(o,s)=>\"string\"==typeof s.payload?o.set(\"spec\",s.payload):o,[Qs]:(o,s)=>o.set(\"url\",s.payload+\"\"),[Zs]:(o,s)=>o.set(\"json\",fromJSOrdered(s.payload)),[aa]:(o,s)=>o.setIn([\"resolved\"],fromJSOrdered(s.payload)),[ca]:(o,s)=>{const{value:i,path:u}=s.payload;return o.setIn([\"resolvedSubtrees\",...u],fromJSOrdered(i))},[_i]:(o,{payload:s})=>{let{path:i,paramName:u,paramIn:_,param:w,value:x,isXml:C}=s,j=w?paramToIdentifier(w):`${_}.${u}`;const L=C?\"value_xml\":\"value\";return o.setIn([\"meta\",\"paths\",...i,\"parameters\",j,L],(0,qe.fromJS)(x))},[Ei]:(o,{payload:s})=>{let{pathMethod:i,paramName:u,paramIn:_,includeEmptyValue:w}=s;if(!u||!_)return console.warn(\"Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey.\"),o;const x=`${_}.${u}`;return o.setIn([\"meta\",\"paths\",...i,\"parameter_inclusions\",x],w)},[Oi]:(o,{payload:{pathMethod:s,isOAS3:i}})=>{const u=bs(o).getIn([\"paths\",...s]),_=parameterValues(o,s).toJS();return o.updateIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.fromJS)({}),(w=>u.get(\"parameters\",(0,qe.List)()).reduce(((u,w)=>{const x=paramToValue(w,_),C=parameterInclusionSettingFor(o,s,w.get(\"name\"),w.get(\"in\")),j=((o,s,{isOAS3:i=!1,bypassRequiredCheck:u=!1}={})=>{let _=o.get(\"required\"),{schema:w,parameterContentMediaType:x}=getParameterSchema(o,{isOAS3:i});return validateValueBySchema(s,w,_,u,x)})(w,x,{bypassRequiredCheck:C,isOAS3:i});return u.setIn([paramToIdentifier(w),\"errors\"],(0,qe.fromJS)(j))}),w)))},[na]:(o,{payload:{pathMethod:s}})=>o.updateIn([\"meta\",\"paths\",...s,\"parameters\"],(0,qe.fromJS)([]),(o=>o.map((o=>o.set(\"errors\",(0,qe.fromJS)([])))))),[Pi]:(o,{payload:{res:s,path:i,method:u}})=>{let _;_=s.error?Object.assign({error:!0,name:s.err.name,message:s.err.message,statusCode:s.err.statusCode},s.err.response):s,_.headers=_.headers||{};let w=o.setIn([\"responses\",i,u],fromJSOrdered(_));return at.Blob&&_.data instanceof at.Blob&&(w=w.setIn([\"responses\",i,u,\"text\"],_.data)),w},[Mi]:(o,{payload:{req:s,path:i,method:u}})=>o.setIn([\"requests\",i,u],fromJSOrdered(s)),[Ri]:(o,{payload:{req:s,path:i,method:u}})=>o.setIn([\"mutatedRequests\",i,u],fromJSOrdered(s)),[ia]:(o,{payload:{path:s,value:i,key:u}})=>{let _=[\"paths\",...s],w=[\"meta\",\"paths\",...s];return o.getIn([\"json\",..._])||o.getIn([\"resolved\",..._])||o.getIn([\"resolvedSubtrees\",..._])?o.setIn([...w,u],(0,qe.fromJS)(i)):o},[ea]:(o,{payload:{path:s,method:i}})=>o.deleteIn([\"responses\",s,i]),[ra]:(o,{payload:{path:s,method:i}})=>o.deleteIn([\"requests\",s,i]),[la]:(o,{payload:{scheme:s,path:i,method:u}})=>i&&u?o.setIn([\"scheme\",i,u],s):i||u?void 0:o.setIn([\"scheme\",\"_defaultScheme\"],s)},wrap_actions_updateSpec=(o,{specActions:s})=>(...i)=>{o(...i),s.parseToJson(...i)},wrap_actions_updateJsonSpec=(o,{specActions:s})=>(...i)=>{o(...i),s.invalidateResolvedSubtreeCache();const[u]=i,_=go()(u,[\"paths\"])||{};Object.keys(_).forEach((o=>{go()(_,[o]).$ref&&s.requestResolvedSubtree([\"paths\",o])})),s.requestResolvedSubtree([\"components\",\"securitySchemes\"])},wrap_actions_executeRequest=(o,{specActions:s})=>i=>(s.logRequest(i),o(i)),wrap_actions_validateParams=(o,{specSelectors:s})=>i=>o(i,s.isOAS3()),plugins_spec=()=>({statePlugins:{spec:{wrapActions:{...ee},reducers:{...ga},actions:{...Z},selectors:{...Y}}}});var ya=function(){var extendStatics=function(o,s){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var i in s)s.hasOwnProperty(i)&&(o[i]=s[i])},extendStatics(o,s)};return function(o,s){function __(){this.constructor=o}extendStatics(o,s),o.prototype=null===s?Object.create(s):(__.prototype=s.prototype,new __)}}(),va=Object.prototype.hasOwnProperty;function module_helpers_hasOwnProperty(o,s){return va.call(o,s)}function _objectKeys(o){if(Array.isArray(o)){for(var s=new Array(o.length),i=0;i<s.length;i++)s[i]=\"\"+i;return s}if(Object.keys)return Object.keys(o);var u=[];for(var _ in o)module_helpers_hasOwnProperty(o,_)&&u.push(_);return u}function _deepClone(o){switch(typeof o){case\"object\":return JSON.parse(JSON.stringify(o));case\"undefined\":return null;default:return o}}function helpers_isInteger(o){for(var s,i=0,u=o.length;i<u;){if(!((s=o.charCodeAt(i))>=48&&s<=57))return!1;i++}return!0}function escapePathComponent(o){return-1===o.indexOf(\"/\")&&-1===o.indexOf(\"~\")?o:o.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")}function unescapePathComponent(o){return o.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}function hasUndefined(o){if(void 0===o)return!0;if(o)if(Array.isArray(o)){for(var s=0,i=o.length;s<i;s++)if(hasUndefined(o[s]))return!0}else if(\"object\"==typeof o)for(var u=_objectKeys(o),_=u.length,w=0;w<_;w++)if(hasUndefined(o[u[w]]))return!0;return!1}function patchErrorMessageFormatter(o,s){var i=[o];for(var u in s){var _=\"object\"==typeof s[u]?JSON.stringify(s[u],null,2):s[u];void 0!==_&&i.push(u+\": \"+_)}return i.join(\"\\n\")}var ba=function(o){function PatchError(s,i,u,_,w){var x=this.constructor,C=o.call(this,patchErrorMessageFormatter(s,{name:i,index:u,operation:_,tree:w}))||this;return C.name=i,C.index=u,C.operation=_,C.tree=w,Object.setPrototypeOf(C,x.prototype),C.message=patchErrorMessageFormatter(s,{name:i,index:u,operation:_,tree:w}),C}return ya(PatchError,o),PatchError}(Error),_a=ba,Ea=_deepClone,wa={add:function(o,s,i){return o[s]=this.value,{newDocument:i}},remove:function(o,s,i){var u=o[s];return delete o[s],{newDocument:i,removed:u}},replace:function(o,s,i){var u=o[s];return o[s]=this.value,{newDocument:i,removed:u}},move:function(o,s,i){var u=getValueByPointer(i,this.path);u&&(u=_deepClone(u));var _=applyOperation(i,{op:\"remove\",path:this.from}).removed;return applyOperation(i,{op:\"add\",path:this.path,value:_}),{newDocument:i,removed:u}},copy:function(o,s,i){var u=getValueByPointer(i,this.from);return applyOperation(i,{op:\"add\",path:this.path,value:_deepClone(u)}),{newDocument:i}},test:function(o,s,i){return{newDocument:i,test:_areEquals(o[s],this.value)}},_get:function(o,s,i){return this.value=o[s],{newDocument:i}}},xa={add:function(o,s,i){return helpers_isInteger(s)?o.splice(s,0,this.value):o[s]=this.value,{newDocument:i,index:s}},remove:function(o,s,i){return{newDocument:i,removed:o.splice(s,1)[0]}},replace:function(o,s,i){var u=o[s];return o[s]=this.value,{newDocument:i,removed:u}},move:wa.move,copy:wa.copy,test:wa.test,_get:wa._get};function getValueByPointer(o,s){if(\"\"==s)return o;var i={op:\"_get\",path:s};return applyOperation(o,i),i.value}function applyOperation(o,s,i,u,_,w){if(void 0===i&&(i=!1),void 0===u&&(u=!0),void 0===_&&(_=!0),void 0===w&&(w=0),i&&(\"function\"==typeof i?i(s,0,o,s.path):validator(s,0)),\"\"===s.path){var x={newDocument:o};if(\"add\"===s.op)return x.newDocument=s.value,x;if(\"replace\"===s.op)return x.newDocument=s.value,x.removed=o,x;if(\"move\"===s.op||\"copy\"===s.op)return x.newDocument=getValueByPointer(o,s.from),\"move\"===s.op&&(x.removed=o),x;if(\"test\"===s.op){if(x.test=_areEquals(o,s.value),!1===x.test)throw new _a(\"Test operation failed\",\"TEST_OPERATION_FAILED\",w,s,o);return x.newDocument=o,x}if(\"remove\"===s.op)return x.removed=o,x.newDocument=null,x;if(\"_get\"===s.op)return s.value=o,x;if(i)throw new _a(\"Operation `op` property is not one of operations defined in RFC-6902\",\"OPERATION_OP_INVALID\",w,s,o);return x}u||(o=_deepClone(o));var C=(s.path||\"\").split(\"/\"),j=o,L=1,B=C.length,$=void 0,V=void 0,U=void 0;for(U=\"function\"==typeof i?i:validator;;){if((V=C[L])&&-1!=V.indexOf(\"~\")&&(V=unescapePathComponent(V)),_&&(\"__proto__\"==V||\"prototype\"==V&&L>0&&\"constructor\"==C[L-1]))throw new TypeError(\"JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README\");if(i&&void 0===$&&(void 0===j[V]?$=C.slice(0,L).join(\"/\"):L==B-1&&($=s.path),void 0!==$&&U(s,0,o,$)),L++,Array.isArray(j)){if(\"-\"===V)V=j.length;else{if(i&&!helpers_isInteger(V))throw new _a(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\",\"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\",w,s,o);helpers_isInteger(V)&&(V=~~V)}if(L>=B){if(i&&\"add\"===s.op&&V>j.length)throw new _a(\"The specified index MUST NOT be greater than the number of elements in the array\",\"OPERATION_VALUE_OUT_OF_BOUNDS\",w,s,o);if(!1===(x=xa[s.op].call(s,j,V,o)).test)throw new _a(\"Test operation failed\",\"TEST_OPERATION_FAILED\",w,s,o);return x}}else if(L>=B){if(!1===(x=wa[s.op].call(s,j,V,o)).test)throw new _a(\"Test operation failed\",\"TEST_OPERATION_FAILED\",w,s,o);return x}if(j=j[V],i&&L<B&&(!j||\"object\"!=typeof j))throw new _a(\"Cannot perform operation at the desired path\",\"OPERATION_PATH_UNRESOLVABLE\",w,s,o)}}function applyPatch(o,s,i,u,_){if(void 0===u&&(u=!0),void 0===_&&(_=!0),i&&!Array.isArray(s))throw new _a(\"Patch sequence must be an array\",\"SEQUENCE_NOT_AN_ARRAY\");u||(o=_deepClone(o));for(var w=new Array(s.length),x=0,C=s.length;x<C;x++)w[x]=applyOperation(o,s[x],i,!0,_,x),o=w[x].newDocument;return w.newDocument=o,w}function applyReducer(o,s,i){var u=applyOperation(o,s);if(!1===u.test)throw new _a(\"Test operation failed\",\"TEST_OPERATION_FAILED\",i,s,o);return u.newDocument}function validator(o,s,i,u){if(\"object\"!=typeof o||null===o||Array.isArray(o))throw new _a(\"Operation is not an object\",\"OPERATION_NOT_AN_OBJECT\",s,o,i);if(!wa[o.op])throw new _a(\"Operation `op` property is not one of operations defined in RFC-6902\",\"OPERATION_OP_INVALID\",s,o,i);if(\"string\"!=typeof o.path)throw new _a(\"Operation `path` property is not a string\",\"OPERATION_PATH_INVALID\",s,o,i);if(0!==o.path.indexOf(\"/\")&&o.path.length>0)throw new _a('Operation `path` property must start with \"/\"',\"OPERATION_PATH_INVALID\",s,o,i);if((\"move\"===o.op||\"copy\"===o.op)&&\"string\"!=typeof o.from)throw new _a(\"Operation `from` property is not present (applicable in `move` and `copy` operations)\",\"OPERATION_FROM_REQUIRED\",s,o,i);if((\"add\"===o.op||\"replace\"===o.op||\"test\"===o.op)&&void 0===o.value)throw new _a(\"Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)\",\"OPERATION_VALUE_REQUIRED\",s,o,i);if((\"add\"===o.op||\"replace\"===o.op||\"test\"===o.op)&&hasUndefined(o.value))throw new _a(\"Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)\",\"OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED\",s,o,i);if(i)if(\"add\"==o.op){var _=o.path.split(\"/\").length,w=u.split(\"/\").length;if(_!==w+1&&_!==w)throw new _a(\"Cannot perform an `add` operation at the desired path\",\"OPERATION_PATH_CANNOT_ADD\",s,o,i)}else if(\"replace\"===o.op||\"remove\"===o.op||\"_get\"===o.op){if(o.path!==u)throw new _a(\"Cannot perform the operation at a path that does not exist\",\"OPERATION_PATH_UNRESOLVABLE\",s,o,i)}else if(\"move\"===o.op||\"copy\"===o.op){var x=validate([{op:\"_get\",path:o.from,value:void 0}],i);if(x&&\"OPERATION_PATH_UNRESOLVABLE\"===x.name)throw new _a(\"Cannot perform the operation from a path that does not exist\",\"OPERATION_FROM_UNRESOLVABLE\",s,o,i)}}function validate(o,s,i){try{if(!Array.isArray(o))throw new _a(\"Patch sequence must be an array\",\"SEQUENCE_NOT_AN_ARRAY\");if(s)applyPatch(_deepClone(s),_deepClone(o),i||!0);else{i=i||validator;for(var u=0;u<o.length;u++)i(o[u],u,s,void 0)}}catch(o){if(o instanceof _a)return o;throw o}}function _areEquals(o,s){if(o===s)return!0;if(o&&s&&\"object\"==typeof o&&\"object\"==typeof s){var i,u,_,w=Array.isArray(o),x=Array.isArray(s);if(w&&x){if((u=o.length)!=s.length)return!1;for(i=u;0!=i--;)if(!_areEquals(o[i],s[i]))return!1;return!0}if(w!=x)return!1;var C=Object.keys(o);if((u=C.length)!==Object.keys(s).length)return!1;for(i=u;0!=i--;)if(!s.hasOwnProperty(C[i]))return!1;for(i=u;0!=i--;)if(!_areEquals(o[_=C[i]],s[_]))return!1;return!0}return o!=o&&s!=s}var ka=new WeakMap,Ca=function Ca(o){this.observers=new Map,this.obj=o},Aa=function Aa(o,s){this.callback=o,this.observer=s};function unobserve(o,s){s.unobserve()}function observe(o,s){var i,u=function getMirror(o){return ka.get(o)}(o);if(u){var _=function getObserverFromMirror(o,s){return o.observers.get(s)}(u,s);i=_&&_.observer}else u=new Ca(o),ka.set(o,u);if(i)return i;if(i={},u.value=_deepClone(o),s){i.callback=s,i.next=null;var dirtyCheck=function(){generate(i)},fastCheck=function(){clearTimeout(i.next),i.next=setTimeout(dirtyCheck)};\"undefined\"!=typeof window&&(window.addEventListener(\"mouseup\",fastCheck),window.addEventListener(\"keyup\",fastCheck),window.addEventListener(\"mousedown\",fastCheck),window.addEventListener(\"keydown\",fastCheck),window.addEventListener(\"change\",fastCheck))}return i.patches=[],i.object=o,i.unobserve=function(){generate(i),clearTimeout(i.next),function removeObserverFromMirror(o,s){o.observers.delete(s.callback)}(u,i),\"undefined\"!=typeof window&&(window.removeEventListener(\"mouseup\",fastCheck),window.removeEventListener(\"keyup\",fastCheck),window.removeEventListener(\"mousedown\",fastCheck),window.removeEventListener(\"keydown\",fastCheck),window.removeEventListener(\"change\",fastCheck))},u.observers.set(s,new Aa(s,i)),i}function generate(o,s){void 0===s&&(s=!1);var i=ka.get(o.object);_generate(i.value,o.object,o.patches,\"\",s),o.patches.length&&applyPatch(i.value,o.patches);var u=o.patches;return u.length>0&&(o.patches=[],o.callback&&o.callback(u)),u}function _generate(o,s,i,u,_){if(s!==o){\"function\"==typeof s.toJSON&&(s=s.toJSON());for(var w=_objectKeys(s),x=_objectKeys(o),C=!1,j=x.length-1;j>=0;j--){var L=o[$=x[j]];if(!module_helpers_hasOwnProperty(s,$)||void 0===s[$]&&void 0!==L&&!1===Array.isArray(s))Array.isArray(o)===Array.isArray(s)?(_&&i.push({op:\"test\",path:u+\"/\"+escapePathComponent($),value:_deepClone(L)}),i.push({op:\"remove\",path:u+\"/\"+escapePathComponent($)}),C=!0):(_&&i.push({op:\"test\",path:u,value:o}),i.push({op:\"replace\",path:u,value:s}),!0);else{var B=s[$];\"object\"==typeof L&&null!=L&&\"object\"==typeof B&&null!=B&&Array.isArray(L)===Array.isArray(B)?_generate(L,B,i,u+\"/\"+escapePathComponent($),_):L!==B&&(!0,_&&i.push({op:\"test\",path:u+\"/\"+escapePathComponent($),value:_deepClone(L)}),i.push({op:\"replace\",path:u+\"/\"+escapePathComponent($),value:_deepClone(B)}))}}if(C||w.length!=x.length)for(j=0;j<w.length;j++){var $;module_helpers_hasOwnProperty(o,$=w[j])||void 0===s[$]||i.push({op:\"add\",path:u+\"/\"+escapePathComponent($),value:_deepClone(s[$])})}}}function compare(o,s,i){void 0===i&&(i=!1);var u=[];return _generate(o,s,u,\"\",i),u}Object.assign({},ie,ae,{JsonPatchError:ba,deepClone:_deepClone,escapePathComponent,unescapePathComponent});var ja=__webpack_require__(14744),Ia=__webpack_require__.n(ja);const Na={add:function add(o,s){return{op:\"add\",path:o,value:s}},replace,remove:function remove(o){return{op:\"remove\",path:o}},merge:function lib_merge(o,s){return{type:\"mutation\",op:\"merge\",path:o,value:s}},mergeDeep:function mergeDeep(o,s){return{type:\"mutation\",op:\"mergeDeep\",path:o,value:s}},context:function context(o,s){return{type:\"context\",path:o,value:s}},getIn:function lib_getIn(o,s){return s.reduce(((o,s)=>void 0!==s&&o?o[s]:o),o)},applyPatch:function lib_applyPatch(o,s,i){if(i=i||{},\"merge\"===(s={...s,path:s.path&&normalizeJSONPath(s.path)}).op){const i=getInByJsonPath(o,s.path);Object.assign(i,s.value),applyPatch(o,[replace(s.path,i)])}else if(\"mergeDeep\"===s.op){const i=getInByJsonPath(o,s.path),u=Ia()(i,s.value);o=applyPatch(o,[replace(s.path,u)]).newDocument}else if(\"add\"===s.op&&\"\"===s.path&&lib_isObject(s.value)){applyPatch(o,Object.keys(s.value).reduce(((o,i)=>(o.push({op:\"add\",path:`/${normalizeJSONPath(i)}`,value:s.value[i]}),o)),[]))}else if(\"replace\"===s.op&&\"\"===s.path){let{value:u}=s;i.allowMetaPatches&&s.meta&&isAdditiveMutation(s)&&(Array.isArray(s.value)||lib_isObject(s.value))&&(u={...u,...s.meta}),o=u}else if(applyPatch(o,[s]),i.allowMetaPatches&&s.meta&&isAdditiveMutation(s)&&(Array.isArray(s.value)||lib_isObject(s.value))){const i={...getInByJsonPath(o,s.path),...s.meta};applyPatch(o,[replace(s.path,i)])}return o},parentPathMatch:function parentPathMatch(o,s){if(!Array.isArray(s))return!1;for(let i=0,u=s.length;i<u;i+=1)if(s[i]!==o[i])return!1;return!0},flatten,fullyNormalizeArray:function fullyNormalizeArray(o){return cleanArray(flatten(lib_normalizeArray(o)))},normalizeArray:lib_normalizeArray,isPromise:function isPromise(o){return lib_isObject(o)&&lib_isFunction(o.then)},forEachNew:function forEachNew(o,s){try{return forEachNewPatch(o,forEach,s)}catch(o){return o}},forEachNewPrimitive:function forEachNewPrimitive(o,s){try{return forEachNewPatch(o,forEachPrimitive,s)}catch(o){return o}},isJsonPatch,isContextPatch:function isContextPatch(o){return isPatch(o)&&\"context\"===o.type},isPatch,isMutation,isAdditiveMutation,isGenerator:function isGenerator(o){return\"[object GeneratorFunction]\"===Object.prototype.toString.call(o)},isFunction:lib_isFunction,isObject:lib_isObject,isError:function lib_isError(o){return o instanceof Error}};function normalizeJSONPath(o){return Array.isArray(o)?o.length<1?\"\":`/${o.map((o=>(o+\"\").replace(/~/g,\"~0\").replace(/\\//g,\"~1\"))).join(\"/\")}`:o}function replace(o,s,i){return{op:\"replace\",path:o,value:s,meta:i}}function forEachNewPatch(o,s,i){return cleanArray(flatten(o.filter(isAdditiveMutation).map((o=>s(o.value,i,o.path)))||[]))}function forEachPrimitive(o,s,i){return i=i||[],Array.isArray(o)?o.map(((o,u)=>forEachPrimitive(o,s,i.concat(u)))):lib_isObject(o)?Object.keys(o).map((u=>forEachPrimitive(o[u],s,i.concat(u)))):s(o,i[i.length-1],i)}function forEach(o,s,i){let u=[];if((i=i||[]).length>0){const _=s(o,i[i.length-1],i);_&&(u=u.concat(_))}if(Array.isArray(o)){const _=o.map(((o,u)=>forEach(o,s,i.concat(u))));_&&(u=u.concat(_))}else if(lib_isObject(o)){const _=Object.keys(o).map((u=>forEach(o[u],s,i.concat(u))));_&&(u=u.concat(_))}return u=flatten(u),u}function lib_normalizeArray(o){return Array.isArray(o)?o:[o]}function flatten(o){return[].concat(...o.map((o=>Array.isArray(o)?flatten(o):o)))}function cleanArray(o){return o.filter((o=>void 0!==o))}function lib_isObject(o){return o&&\"object\"==typeof o}function lib_isFunction(o){return o&&\"function\"==typeof o}function isJsonPatch(o){if(isPatch(o)){const{op:s}=o;return\"add\"===s||\"remove\"===s||\"replace\"===s}return!1}function isMutation(o){return isJsonPatch(o)||isPatch(o)&&\"mutation\"===o.type}function isAdditiveMutation(o){return isMutation(o)&&(\"add\"===o.op||\"replace\"===o.op||\"merge\"===o.op||\"mergeDeep\"===o.op)}function isPatch(o){return o&&\"object\"==typeof o}function getInByJsonPath(o,s){try{return getValueByPointer(o,s)}catch(o){return console.error(o),{}}}var Da=__webpack_require__(48675);const La=class ApiDOMAggregateError extends Da{constructor(o,s,i){if(super(o,s,i),this.name=this.constructor.name,\"string\"==typeof s&&(this.message=s),\"function\"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(s).stack,null!=i&&\"object\"==typeof i&&Object.hasOwn(i,\"cause\")&&!(\"cause\"in this)){const{cause:o}=i;this.cause=o,o instanceof Error&&\"stack\"in o&&(this.stack=`${this.stack}\\nCAUSE: ${o.stack}`)}}};class ApiDOMError extends Error{static[Symbol.hasInstance](o){return super[Symbol.hasInstance](o)||Function.prototype[Symbol.hasInstance].call(La,o)}constructor(o,s){if(super(o,s),this.name=this.constructor.name,\"string\"==typeof o&&(this.message=o),\"function\"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(o).stack,null!=s&&\"object\"==typeof s&&Object.hasOwn(s,\"cause\")&&!(\"cause\"in this)){const{cause:o}=s;this.cause=o,o instanceof Error&&\"stack\"in o&&(this.stack=`${this.stack}\\nCAUSE: ${o.stack}`)}}}const Ba=ApiDOMError;const Fa=class ApiDOMStructuredError extends Ba{constructor(o,s){if(super(o,s),null!=s&&\"object\"==typeof s){const{cause:o,...i}=s;Object.assign(this,i)}}};var $a=__webpack_require__(65606);const za={\"@@functional/placeholder\":!0};function _isPlaceholder(o){return o===za}function _curry1(o){return function f1(s){return 0===arguments.length||_isPlaceholder(s)?f1:o.apply(this,arguments)}}function _curry2(o){return function f2(s,i){switch(arguments.length){case 0:return f2;case 1:return _isPlaceholder(s)?f2:_curry1((function(i){return o(s,i)}));default:return _isPlaceholder(s)&&_isPlaceholder(i)?f2:_isPlaceholder(s)?_curry1((function(s){return o(s,i)})):_isPlaceholder(i)?_curry1((function(i){return o(s,i)})):o(s,i)}}}function _curry3(o){return function f3(s,i,u){switch(arguments.length){case 0:return f3;case 1:return _isPlaceholder(s)?f3:_curry2((function(i,u){return o(s,i,u)}));case 2:return _isPlaceholder(s)&&_isPlaceholder(i)?f3:_isPlaceholder(s)?_curry2((function(s,u){return o(s,i,u)})):_isPlaceholder(i)?_curry2((function(i,u){return o(s,i,u)})):_curry1((function(u){return o(s,i,u)}));default:return _isPlaceholder(s)&&_isPlaceholder(i)&&_isPlaceholder(u)?f3:_isPlaceholder(s)&&_isPlaceholder(i)?_curry2((function(s,i){return o(s,i,u)})):_isPlaceholder(s)&&_isPlaceholder(u)?_curry2((function(s,u){return o(s,i,u)})):_isPlaceholder(i)&&_isPlaceholder(u)?_curry2((function(i,u){return o(s,i,u)})):_isPlaceholder(s)?_curry1((function(s){return o(s,i,u)})):_isPlaceholder(i)?_curry1((function(i){return o(s,i,u)})):_isPlaceholder(u)?_curry1((function(u){return o(s,i,u)})):o(s,i,u)}}}const Ha=Number.isInteger||function _isInteger(o){return(o|0)===o};function _isString(o){return\"[object String]\"===Object.prototype.toString.call(o)}function _nth(o,s){var i=o<0?s.length+o:o;return _isString(s)?s.charAt(i):s[i]}function _path(o,s){for(var i=s,u=0;u<o.length;u+=1){if(null==i)return;var _=o[u];i=Ha(_)?_nth(_,i):i[_]}return i}const Ja=_curry3((function pathSatisfies(o,s,i){return o(_path(s,i))}));function _cloneRegExp(o){return new RegExp(o.source,o.flags?o.flags:(o.global?\"g\":\"\")+(o.ignoreCase?\"i\":\"\")+(o.multiline?\"m\":\"\")+(o.sticky?\"y\":\"\")+(o.unicode?\"u\":\"\")+(o.dotAll?\"s\":\"\"))}function _arrayFromIterator(o){for(var s,i=[];!(s=o.next()).done;)i.push(s.value);return i}function _includesWith(o,s,i){for(var u=0,_=i.length;u<_;){if(o(s,i[u]))return!0;u+=1}return!1}function _has(o,s){return Object.prototype.hasOwnProperty.call(s,o)}const Ga=\"function\"==typeof Object.is?Object.is:function _objectIs(o,s){return o===s?0!==o||1/o==1/s:o!=o&&s!=s};var ec=Object.prototype.toString;const rc=function(){return\"[object Arguments]\"===ec.call(arguments)?function _isArguments(o){return\"[object Arguments]\"===ec.call(o)}:function _isArguments(o){return _has(\"callee\",o)}}();var oc=!{toString:null}.propertyIsEnumerable(\"toString\"),sc=[\"constructor\",\"valueOf\",\"isPrototypeOf\",\"toString\",\"propertyIsEnumerable\",\"hasOwnProperty\",\"toLocaleString\"],ic=function(){return arguments.propertyIsEnumerable(\"length\")}(),ac=function contains(o,s){for(var i=0;i<o.length;){if(o[i]===s)return!0;i+=1}return!1},cc=\"function\"!=typeof Object.keys||ic?_curry1((function keys(o){if(Object(o)!==o)return[];var s,i,u=[],_=ic&&rc(o);for(s in o)!_has(s,o)||_&&\"length\"===s||(u[u.length]=s);if(oc)for(i=sc.length-1;i>=0;)_has(s=sc[i],o)&&!ac(u,s)&&(u[u.length]=s),i-=1;return u})):_curry1((function keys(o){return Object(o)!==o?[]:Object.keys(o)}));const lc=cc;const pc=_curry1((function type(o){return null===o?\"Null\":void 0===o?\"Undefined\":Object.prototype.toString.call(o).slice(8,-1)}));function _uniqContentEquals(o,s,i,u){var _=_arrayFromIterator(o);function eq(o,s){return _equals(o,s,i.slice(),u.slice())}return!_includesWith((function(o,s){return!_includesWith(eq,s,o)}),_arrayFromIterator(s),_)}function _equals(o,s,i,u){if(Ga(o,s))return!0;var _=pc(o);if(_!==pc(s))return!1;if(\"function\"==typeof o[\"fantasy-land/equals\"]||\"function\"==typeof s[\"fantasy-land/equals\"])return\"function\"==typeof o[\"fantasy-land/equals\"]&&o[\"fantasy-land/equals\"](s)&&\"function\"==typeof s[\"fantasy-land/equals\"]&&s[\"fantasy-land/equals\"](o);if(\"function\"==typeof o.equals||\"function\"==typeof s.equals)return\"function\"==typeof o.equals&&o.equals(s)&&\"function\"==typeof s.equals&&s.equals(o);switch(_){case\"Arguments\":case\"Array\":case\"Object\":if(\"function\"==typeof o.constructor&&\"Promise\"===function _functionName(o){var s=String(o).match(/^function (\\w*)/);return null==s?\"\":s[1]}(o.constructor))return o===s;break;case\"Boolean\":case\"Number\":case\"String\":if(typeof o!=typeof s||!Ga(o.valueOf(),s.valueOf()))return!1;break;case\"Date\":if(!Ga(o.valueOf(),s.valueOf()))return!1;break;case\"Error\":return o.name===s.name&&o.message===s.message;case\"RegExp\":if(o.source!==s.source||o.global!==s.global||o.ignoreCase!==s.ignoreCase||o.multiline!==s.multiline||o.sticky!==s.sticky||o.unicode!==s.unicode)return!1}for(var w=i.length-1;w>=0;){if(i[w]===o)return u[w]===s;w-=1}switch(_){case\"Map\":return o.size===s.size&&_uniqContentEquals(o.entries(),s.entries(),i.concat([o]),u.concat([s]));case\"Set\":return o.size===s.size&&_uniqContentEquals(o.values(),s.values(),i.concat([o]),u.concat([s]));case\"Arguments\":case\"Array\":case\"Object\":case\"Boolean\":case\"Number\":case\"String\":case\"Date\":case\"Error\":case\"RegExp\":case\"Int8Array\":case\"Uint8Array\":case\"Uint8ClampedArray\":case\"Int16Array\":case\"Uint16Array\":case\"Int32Array\":case\"Uint32Array\":case\"Float32Array\":case\"Float64Array\":case\"ArrayBuffer\":break;default:return!1}var x=lc(o);if(x.length!==lc(s).length)return!1;var C=i.concat([o]),j=u.concat([s]);for(w=x.length-1;w>=0;){var L=x[w];if(!_has(L,s)||!_equals(s[L],o[L],C,j))return!1;w-=1}return!0}const hc=_curry2((function equals(o,s){return _equals(o,s,[],[])}));function _includes(o,s){return function _indexOf(o,s,i){var u,_;if(\"function\"==typeof o.indexOf)switch(typeof s){case\"number\":if(0===s){for(u=1/s;i<o.length;){if(0===(_=o[i])&&1/_===u)return i;i+=1}return-1}if(s!=s){for(;i<o.length;){if(\"number\"==typeof(_=o[i])&&_!=_)return i;i+=1}return-1}return o.indexOf(s,i);case\"string\":case\"boolean\":case\"function\":case\"undefined\":return o.indexOf(s,i);case\"object\":if(null===s)return o.indexOf(s,i)}for(;i<o.length;){if(hc(o[i],s))return i;i+=1}return-1}(s,o,0)>=0}function _map(o,s){for(var i=0,u=s.length,_=Array(u);i<u;)_[i]=o(s[i]),i+=1;return _}function _quote(o){return'\"'+o.replace(/\\\\/g,\"\\\\\\\\\").replace(/[\\b]/g,\"\\\\b\").replace(/\\f/g,\"\\\\f\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/\\t/g,\"\\\\t\").replace(/\\v/g,\"\\\\v\").replace(/\\0/g,\"\\\\0\").replace(/\"/g,'\\\\\"')+'\"'}var dc=function pad(o){return(o<10?\"0\":\"\")+o};const fc=\"function\"==typeof Date.prototype.toISOString?function _toISOString(o){return o.toISOString()}:function _toISOString(o){return o.getUTCFullYear()+\"-\"+dc(o.getUTCMonth()+1)+\"-\"+dc(o.getUTCDate())+\"T\"+dc(o.getUTCHours())+\":\"+dc(o.getUTCMinutes())+\":\"+dc(o.getUTCSeconds())+\".\"+(o.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+\"Z\"};function _complement(o){return function(){return!o.apply(this,arguments)}}function _arrayReduce(o,s,i){for(var u=0,_=i.length;u<_;)s=o(s,i[u]),u+=1;return s}const gc=Array.isArray||function _isArray(o){return null!=o&&o.length>=0&&\"[object Array]\"===Object.prototype.toString.call(o)};function _dispatchable(o,s,i){return function(){if(0===arguments.length)return i();var u=arguments[arguments.length-1];if(!gc(u)){for(var _=0;_<o.length;){if(\"function\"==typeof u[o[_]])return u[o[_]].apply(u,Array.prototype.slice.call(arguments,0,-1));_+=1}if(function _isTransformer(o){return null!=o&&\"function\"==typeof o[\"@@transducer/step\"]}(u))return s.apply(null,Array.prototype.slice.call(arguments,0,-1))(u)}return i.apply(this,arguments)}}function _isObject(o){return\"[object Object]\"===Object.prototype.toString.call(o)}const _xfBase_init=function(){return this.xf[\"@@transducer/init\"]()},_xfBase_result=function(o){return this.xf[\"@@transducer/result\"](o)};var bc=function(){function XFilter(o,s){this.xf=s,this.f=o}return XFilter.prototype[\"@@transducer/init\"]=_xfBase_init,XFilter.prototype[\"@@transducer/result\"]=_xfBase_result,XFilter.prototype[\"@@transducer/step\"]=function(o,s){return this.f(s)?this.xf[\"@@transducer/step\"](o,s):o},XFilter}();function _xfilter(o){return function(s){return new bc(o,s)}}var _c=_curry2(_dispatchable([\"fantasy-land/filter\",\"filter\"],_xfilter,(function(o,s){return _isObject(s)?_arrayReduce((function(i,u){return o(s[u])&&(i[u]=s[u]),i}),{},lc(s)):function _filter(o,s){for(var i=0,u=s.length,_=[];i<u;)o(s[i])&&(_[_.length]=s[i]),i+=1;return _}(o,s)})));const Ec=_c;const kc=_curry2((function reject(o,s){return Ec(_complement(o),s)}));function _toString_toString(o,s){var i=function recur(i){var u=s.concat([o]);return _includes(i,u)?\"<Circular>\":_toString_toString(i,u)},mapPairs=function(o,s){return _map((function(s){return _quote(s)+\": \"+i(o[s])}),s.slice().sort())};switch(Object.prototype.toString.call(o)){case\"[object Arguments]\":return\"(function() { return arguments; }(\"+_map(i,o).join(\", \")+\"))\";case\"[object Array]\":return\"[\"+_map(i,o).concat(mapPairs(o,kc((function(o){return/^\\d+$/.test(o)}),lc(o)))).join(\", \")+\"]\";case\"[object Boolean]\":return\"object\"==typeof o?\"new Boolean(\"+i(o.valueOf())+\")\":o.toString();case\"[object Date]\":return\"new Date(\"+(isNaN(o.valueOf())?i(NaN):_quote(fc(o)))+\")\";case\"[object Map]\":return\"new Map(\"+i(Array.from(o))+\")\";case\"[object Null]\":return\"null\";case\"[object Number]\":return\"object\"==typeof o?\"new Number(\"+i(o.valueOf())+\")\":1/o==-1/0?\"-0\":o.toString(10);case\"[object Set]\":return\"new Set(\"+i(Array.from(o).sort())+\")\";case\"[object String]\":return\"object\"==typeof o?\"new String(\"+i(o.valueOf())+\")\":_quote(o);case\"[object Undefined]\":return\"undefined\";default:if(\"function\"==typeof o.toString){var u=o.toString();if(\"[object Object]\"!==u)return u}return\"{\"+mapPairs(o,lc(o)).join(\", \")+\"}\"}}const Oc=_curry1((function toString(o){return _toString_toString(o,[])}));var jc=_curry2((function test(o,s){if(!function _isRegExp(o){return\"[object RegExp]\"===Object.prototype.toString.call(o)}(o))throw new TypeError(\"‘test’ requires a value of type RegExp as its first argument; received \"+Oc(o));return _cloneRegExp(o).test(s)}));const Pc=jc;function _arity(o,s){switch(o){case 0:return function(){return s.apply(this,arguments)};case 1:return function(o){return s.apply(this,arguments)};case 2:return function(o,i){return s.apply(this,arguments)};case 3:return function(o,i,u){return s.apply(this,arguments)};case 4:return function(o,i,u,_){return s.apply(this,arguments)};case 5:return function(o,i,u,_,w){return s.apply(this,arguments)};case 6:return function(o,i,u,_,w,x){return s.apply(this,arguments)};case 7:return function(o,i,u,_,w,x,C){return s.apply(this,arguments)};case 8:return function(o,i,u,_,w,x,C,j){return s.apply(this,arguments)};case 9:return function(o,i,u,_,w,x,C,j,L){return s.apply(this,arguments)};case 10:return function(o,i,u,_,w,x,C,j,L,B){return s.apply(this,arguments)};default:throw new Error(\"First argument to _arity must be a non-negative integer no greater than ten\")}}function _pipe(o,s){return function(){return s.call(this,o.apply(this,arguments))}}const Ic=_curry1((function isArrayLike(o){return!!gc(o)||!!o&&(\"object\"==typeof o&&(!_isString(o)&&(0===o.length||o.length>0&&(o.hasOwnProperty(0)&&o.hasOwnProperty(o.length-1)))))}));var Mc=\"undefined\"!=typeof Symbol?Symbol.iterator:\"@@iterator\";function _createReduce(o,s,i){return function _reduce(u,_,w){if(Ic(w))return o(u,_,w);if(null==w)return _;if(\"function\"==typeof w[\"fantasy-land/reduce\"])return s(u,_,w,\"fantasy-land/reduce\");if(null!=w[Mc])return i(u,_,w[Mc]());if(\"function\"==typeof w.next)return i(u,_,w);if(\"function\"==typeof w.reduce)return s(u,_,w,\"reduce\");throw new TypeError(\"reduce: list must be array or iterable\")}}function _xArrayReduce(o,s,i){for(var u=0,_=i.length;u<_;){if((s=o[\"@@transducer/step\"](s,i[u]))&&s[\"@@transducer/reduced\"]){s=s[\"@@transducer/value\"];break}u+=1}return o[\"@@transducer/result\"](s)}var Nc=_curry2((function bind(o,s){return _arity(o.length,(function(){return o.apply(s,arguments)}))}));const Rc=Nc;function _xIterableReduce(o,s,i){for(var u=i.next();!u.done;){if((s=o[\"@@transducer/step\"](s,u.value))&&s[\"@@transducer/reduced\"]){s=s[\"@@transducer/value\"];break}u=i.next()}return o[\"@@transducer/result\"](s)}function _xMethodReduce(o,s,i,u){return o[\"@@transducer/result\"](i[u](Rc(o[\"@@transducer/step\"],o),s))}const Lc=_createReduce(_xArrayReduce,_xMethodReduce,_xIterableReduce);var Fc=function(){function XWrap(o){this.f=o}return XWrap.prototype[\"@@transducer/init\"]=function(){throw new Error(\"init not implemented on XWrap\")},XWrap.prototype[\"@@transducer/result\"]=function(o){return o},XWrap.prototype[\"@@transducer/step\"]=function(o,s){return this.f(o,s)},XWrap}();function _xwrap(o){return new Fc(o)}var qc=_curry3((function(o,s,i){return Lc(\"function\"==typeof o?_xwrap(o):o,s,i)}));const Kc=qc;function _checkForMethod(o,s){return function(){var i=arguments.length;if(0===i)return s();var u=arguments[i-1];return gc(u)||\"function\"!=typeof u[o]?s.apply(this,arguments):u[o].apply(u,Array.prototype.slice.call(arguments,0,i-1))}}var Hc=_curry3(_checkForMethod(\"slice\",(function slice(o,s,i){return Array.prototype.slice.call(i,o,s)})));const Jc=Hc;const Gc=_curry1(_checkForMethod(\"tail\",Jc(1,1/0)));function pipe(){if(0===arguments.length)throw new Error(\"pipe requires at least one argument\");return _arity(arguments[0].length,Kc(_pipe,arguments[0],Gc(arguments)))}const Qc=_curry2((function defaultTo(o,s){return null==s||s!=s?o:s}));const tl=_curry2((function prop(o,s){if(null!=s)return Ha(o)?_nth(o,s):s[o]}));const sl=_curry3((function propOr(o,s,i){return Qc(o,tl(s,i))}));var ul=_curry1((function(o){return _nth(-1,o)}));const yl=ul;function _curryN(o,s,i){return function(){for(var u=[],_=0,w=o,x=0,C=!1;x<s.length||_<arguments.length;){var j;x<s.length&&(!_isPlaceholder(s[x])||_>=arguments.length)?j=s[x]:(j=arguments[_],_+=1),u[x]=j,_isPlaceholder(j)?C=!0:w-=1,x+=1}return!C&&w<=0?i.apply(this,u):_arity(Math.max(0,w),_curryN(o,u,i))}}var vl=_curry2((function curryN(o,s){return 1===o?_curry1(s):_arity(o,_curryN(o,[],s))}));const _l=vl;var El=_curry1((function curry(o){return _l(o.length,o)}));const wl=El;function _isFunction(o){var s=Object.prototype.toString.call(o);return\"[object Function]\"===s||\"[object AsyncFunction]\"===s||\"[object GeneratorFunction]\"===s||\"[object AsyncGeneratorFunction]\"===s}const Sl=_curry2((function invoker(o,s){return _l(o+1,(function(){var i=arguments[o];if(null!=i&&_isFunction(i[s]))return i[s].apply(i,Array.prototype.slice.call(arguments,0,o));throw new TypeError(Oc(i)+' does not have a method named \"'+s+'\"')}))}));const xl=Sl(1,\"split\");function dropLastWhile(o,s){for(var i=s.length-1;i>=0&&o(s[i]);)i-=1;return Jc(0,i+1,s)}var kl=function(){function XDropLastWhile(o,s){this.f=o,this.retained=[],this.xf=s}return XDropLastWhile.prototype[\"@@transducer/init\"]=_xfBase_init,XDropLastWhile.prototype[\"@@transducer/result\"]=function(o){return this.retained=null,this.xf[\"@@transducer/result\"](o)},XDropLastWhile.prototype[\"@@transducer/step\"]=function(o,s){return this.f(s)?this.retain(o,s):this.flush(o,s)},XDropLastWhile.prototype.flush=function(o,s){return o=Lc(this.xf,o,this.retained),this.retained=[],this.xf[\"@@transducer/step\"](o,s)},XDropLastWhile.prototype.retain=function(o,s){return this.retained.push(s),o},XDropLastWhile}();function _xdropLastWhile(o){return function(s){return new kl(o,s)}}const Ol=_curry2(_dispatchable([],_xdropLastWhile,dropLastWhile));const Cl=Sl(1,\"join\");var Al=_curry1((function flip(o){return _l(o.length,(function(s,i){var u=Array.prototype.slice.call(arguments,0);return u[0]=i,u[1]=s,o.apply(this,u)}))}));const Pl=Al(_curry2(_includes));const Il=wl((function(o,s){return pipe(xl(\"\"),Ol(Pl(o)),Cl(\"\"))(s)}));function _iterableReduce(o,s,i){for(var u=i.next();!u.done;)s=o(s,u.value),u=i.next();return s}function _methodReduce(o,s,i,u){return i[u](o,s)}const Ml=_createReduce(_arrayReduce,_methodReduce,_iterableReduce);var Nl=function(){function XMap(o,s){this.xf=s,this.f=o}return XMap.prototype[\"@@transducer/init\"]=_xfBase_init,XMap.prototype[\"@@transducer/result\"]=_xfBase_result,XMap.prototype[\"@@transducer/step\"]=function(o,s){return this.xf[\"@@transducer/step\"](o,this.f(s))},XMap}();var Tl=_curry2(_dispatchable([\"fantasy-land/map\",\"map\"],(function _xmap(o){return function(s){return new Nl(o,s)}}),(function map(o,s){switch(Object.prototype.toString.call(s)){case\"[object Function]\":return _l(s.length,(function(){return o.call(this,s.apply(this,arguments))}));case\"[object Object]\":return _arrayReduce((function(i,u){return i[u]=o(s[u]),i}),{},lc(s));default:return _map(o,s)}})));const Rl=Tl;const Dl=_curry2((function ap(o,s){return\"function\"==typeof s[\"fantasy-land/ap\"]?s[\"fantasy-land/ap\"](o):\"function\"==typeof o.ap?o.ap(s):\"function\"==typeof o?function(i){return o(i)(s(i))}:Ml((function(o,i){return function _concat(o,s){var i;s=s||[];var u=(o=o||[]).length,_=s.length,w=[];for(i=0;i<u;)w[w.length]=o[i],i+=1;for(i=0;i<_;)w[w.length]=s[i],i+=1;return w}(o,Rl(i,s))}),[],o)}));var Ll=_curry2((function liftN(o,s){var i=_l(o,s);return _l(o,(function(){return _arrayReduce(Dl,Rl(i,arguments[0]),Array.prototype.slice.call(arguments,1))}))}));const Bl=Ll;var Fl=_curry1((function lift(o){return Bl(o.length,o)}));const $l=Fl;const Vl=$l(_curry1((function not(o){return!o})));const Ul=_curry1((function always(o){return function(){return o}}));const zl=Ul(void 0);const Wl=hc(zl());const Kl=Vl(Wl);const Hl=_curry2((function max(o,s){if(o===s)return s;function safeMax(o,s){if(o>s!=s>o)return s>o?s:o}var i=safeMax(o,s);if(void 0!==i)return i;var u=safeMax(typeof o,typeof s);if(void 0!==u)return u===typeof o?o:s;var _=Oc(o),w=safeMax(_,Oc(s));return void 0!==w&&w===_?o:s}));var Jl=_curry2((function pluck(o,s){return Rl(tl(o),s)}));const Gl=Jl;const Yl=_curry1((function anyPass(o){return _l(Kc(Hl,0,Gl(\"length\",o)),(function(){for(var s=0,i=o.length;s<i;){if(o[s].apply(this,arguments))return!0;s+=1}return!1}))}));var identical=function(o,s){switch(arguments.length){case 0:return identical;case 1:return function unaryIdentical(s){return 0===arguments.length?unaryIdentical:Ga(o,s)};default:return Ga(o,s)}};const Xl=identical;const Ql=_l(1,pipe(pc,Xl(\"GeneratorFunction\")));const Zl=_l(1,pipe(pc,Xl(\"AsyncFunction\")));const eu=Yl([pipe(pc,Xl(\"Function\")),Ql,Zl]);var tu=_curry3((function replace(o,s,i){return i.replace(o,s)}));const ru=tu;const nu=_l(1,pipe(pc,Xl(\"RegExp\")));const ou=_curry3((function when(o,s,i){return o(i)?s(i):i}));const su=_l(1,pipe(pc,Xl(\"String\")));const iu=ou(su,ru(/[.*+?^${}()|[\\]\\\\-]/g,\"\\\\$&\"));var au=function checkValue(o,s){if(\"string\"!=typeof o&&!(o instanceof String))throw TypeError(\"`\".concat(s,\"` must be a string\"))};const cu=function replaceAll(o,s,i){!function checkArguments(o,s,i){if(null==i||null==o||null==s)throw TypeError(\"Input values must not be `null` or `undefined`\")}(o,s,i),au(i,\"str\"),au(s,\"replaceValue\"),function checkSearchValue(o){if(!(\"string\"==typeof o||o instanceof String||o instanceof RegExp))throw TypeError(\"`searchValue` must be a string or an regexp\")}(o);var u=new RegExp(nu(o)?o:iu(o),\"g\");return ru(u,s,i)};var lu=_l(3,cu),uu=Sl(2,\"replaceAll\");const pu=eu(String.prototype.replaceAll)?uu:lu,isWindows=()=>Ja(Pc(/^win/),[\"platform\"],$a),getProtocol=o=>{try{const s=new URL(o);return Il(\":\",s.protocol)}catch{return}},hu=(pipe(getProtocol,Kl),o=>{if($a.browser)return!1;const s=getProtocol(o);return Wl(s)||\"file\"===s||/^[a-zA-Z]$/.test(s)}),isHttpUrl=o=>{const s=getProtocol(o);return\"http\"===s||\"https\"===s},toFileSystemPath=(o,s)=>{const i=[/%23/g,\"#\",/%24/g,\"$\",/%26/g,\"&\",/%2C/g,\",\",/%40/g,\"@\"],u=sl(!1,\"keepFileProtocol\",s),_=sl(isWindows,\"isWindows\",s);let w=decodeURI(o);for(let o=0;o<i.length;o+=2)w=w.replace(i[o],i[o+1]);let x=\"file://\"===w.substring(0,7).toLowerCase();return x&&(w=\"/\"===w[7]?w.substring(8):w.substring(7),_()&&\"/\"===w[1]&&(w=`${w[0]}:${w.substring(1)}`),u?w=`file:///${w}`:(x=!1,w=_()?w:`/${w}`)),_()&&!x&&(w=pu(\"/\",\"\\\\\",w),\":\\\\\"===w.substring(1,3)&&(w=w[0].toUpperCase()+w.substring(1))),w},getHash=o=>{const s=o.indexOf(\"#\");return-1!==s?o.substring(s):\"#\"},stripHash=o=>{const s=o.indexOf(\"#\");let i=o;return s>=0&&(i=o.substring(0,s)),i},url_cwd=()=>{if($a.browser)return stripHash(globalThis.location.href);const o=$a.cwd(),s=yl(o);return[\"/\",\"\\\\\"].includes(s)?o:o+(isWindows()?\"\\\\\":\"/\")},resolve=(o,s)=>{const i=new URL(s,new URL(o,\"resolve://\"));if(\"resolve:\"===i.protocol){const{pathname:o,search:s,hash:u}=i;return o+s+u}return i.toString()},sanitize=o=>{if(hu(o))return(o=>{const s=[/\\?/g,\"%3F\",/#/g,\"%23\"];let i=o;isWindows()&&(i=i.replace(/\\\\/g,\"/\")),i=encodeURI(i);for(let o=0;o<s.length;o+=2)i=i.replace(s[o],s[o+1]);return i})(toFileSystemPath(o));try{return new URL(o).toString()}catch{return encodeURI(decodeURI(o)).replace(/%5B/g,\"[\").replace(/%5D/g,\"]\")}},unsanitize=o=>hu(o)?toFileSystemPath(o):decodeURI(o),{fetch:du,Response:fu,Headers:mu,Request:gu,FormData:yu,File:vu,Blob:bu}=globalThis;void 0===globalThis.fetch&&(globalThis.fetch=du),void 0===globalThis.Headers&&(globalThis.Headers=mu),void 0===globalThis.Request&&(globalThis.Request=gu),void 0===globalThis.Response&&(globalThis.Response=fu),void 0===globalThis.FormData&&(globalThis.FormData=yu),void 0===globalThis.File&&(globalThis.File=vu),void 0===globalThis.Blob&&(globalThis.Blob=bu);var _u=__webpack_require__(36623),Eu=__webpack_require__.n(_u);const wu=\"application/json, application/yaml\",Su=\"https://swagger.io\",xu=Object.freeze({url:\"/\"}),ku=[\"properties\"],Ou=[\"properties\"],Cu=[\"definitions\",\"parameters\",\"responses\",\"securityDefinitions\",\"components/schemas\",\"components/responses\",\"components/parameters\",\"components/securitySchemes\"],Au=[\"schema/example\",\"items/example\"];function isFreelyNamed(o){const s=o[o.length-1],i=o[o.length-2],u=o.join(\"/\");return ku.indexOf(s)>-1&&-1===Ou.indexOf(i)||Cu.indexOf(u)>-1||Au.some((o=>u.indexOf(o)>-1))}function absolutifyPointer(o,s){const[i,u]=o.split(\"#\"),_=null!=s?s:\"\",w=null!=i?i:\"\";let x;if(isHttpUrl(_))x=resolve(_,w);else{const o=resolve(Su,_),s=resolve(o,w).replace(Su,\"\");x=w.startsWith(\"/\")?s:s.substring(1)}return u?`${x}#${u}`:x}const ju=/^([a-z]+:\\/\\/|\\/\\/)/i;class JSONRefError extends Fa{}const Pu={},Iu=new WeakMap,Mu=[o=>\"paths\"===o[0]&&\"responses\"===o[3]&&\"examples\"===o[5],o=>\"paths\"===o[0]&&\"responses\"===o[3]&&\"content\"===o[5]&&\"example\"===o[7],o=>\"paths\"===o[0]&&\"responses\"===o[3]&&\"content\"===o[5]&&\"examples\"===o[7]&&\"value\"===o[9],o=>\"paths\"===o[0]&&\"requestBody\"===o[3]&&\"content\"===o[4]&&\"example\"===o[6],o=>\"paths\"===o[0]&&\"requestBody\"===o[3]&&\"content\"===o[4]&&\"examples\"===o[6]&&\"value\"===o[8],o=>\"paths\"===o[0]&&\"parameters\"===o[2]&&\"example\"===o[4],o=>\"paths\"===o[0]&&\"parameters\"===o[3]&&\"example\"===o[5],o=>\"paths\"===o[0]&&\"parameters\"===o[2]&&\"examples\"===o[4]&&\"value\"===o[6],o=>\"paths\"===o[0]&&\"parameters\"===o[3]&&\"examples\"===o[5]&&\"value\"===o[7],o=>\"paths\"===o[0]&&\"parameters\"===o[2]&&\"content\"===o[4]&&\"example\"===o[6],o=>\"paths\"===o[0]&&\"parameters\"===o[2]&&\"content\"===o[4]&&\"examples\"===o[6]&&\"value\"===o[8],o=>\"paths\"===o[0]&&\"parameters\"===o[3]&&\"content\"===o[4]&&\"example\"===o[7],o=>\"paths\"===o[0]&&\"parameters\"===o[3]&&\"content\"===o[5]&&\"examples\"===o[7]&&\"value\"===o[9]],Nu={key:\"$ref\",plugin:(o,s,i,u)=>{const _=u.getInstance(),w=i.slice(0,-1);if(isFreelyNamed(w)||(o=>Mu.some((s=>s(o))))(w))return;const{baseDoc:x}=u.getContext(i);if(\"string\"!=typeof o)return new JSONRefError(\"$ref: must be a string (JSON-Ref)\",{$ref:o,baseDoc:x,fullPath:i});const C=refs_split(o),j=C[0],L=C[1]||\"\";let B,$,V;try{B=x||j?absoluteify(j,x):null}catch(s){return wrapError(s,{pointer:L,$ref:o,basePath:B,fullPath:i})}if(function pointerAlreadyInPath(o,s,i,u){let _=Iu.get(u);_||(_={},Iu.set(u,_));const w=function arrayToJsonPointer(o){if(0===o.length)return\"\";return`/${o.map(escapeJsonPointerToken).join(\"/\")}`}(i),x=`${s||\"<specmap-base>\"}#${o}`,C=w.replace(/allOf\\/\\d+\\/?/g,\"\"),j=u.contextTree.get([]).baseDoc;if(s===j&&pointerIsAParent(C,o))return!0;let L=\"\";const B=i.some((o=>(L=`${L}/${escapeJsonPointerToken(o)}`,_[L]&&_[L].some((o=>pointerIsAParent(o,x)||pointerIsAParent(x,o))))));if(B)return!0;return void(_[C]=(_[C]||[]).concat(x))}(L,B,w,u)&&!_.useCircularStructures){const s=absolutifyPointer(o,B);return o===s?null:Na.replace(i,s)}if(null==B?(V=jsonPointerToArray(L),$=u.get(V),void 0===$&&($=new JSONRefError(`Could not resolve reference: ${o}`,{pointer:L,$ref:o,baseDoc:x,fullPath:i}))):($=extractFromDoc(B,L),$=null!=$.__value?$.__value:$.catch((s=>{throw wrapError(s,{pointer:L,$ref:o,baseDoc:x,fullPath:i})}))),$ instanceof Error)return[Na.remove(i),$];const U=absolutifyPointer(o,B),z=Na.replace(w,$,{$$ref:U});if(B&&B!==x)return[z,Na.context(w,{baseDoc:B})];try{if(!function patchValueAlreadyInPath(o,s){const i=[o];return s.path.reduce(((o,s)=>(i.push(o[s]),o[s])),o),pointToAncestor(s.value);function pointToAncestor(o){return Na.isObject(o)&&(i.indexOf(o)>=0||Object.keys(o).some((s=>pointToAncestor(o[s]))))}}(u.state,z)||_.useCircularStructures)return z}catch(o){return null}}},Tu=Object.assign(Nu,{docCache:Pu,absoluteify,clearCache:function clearCache(o){void 0!==o?delete Pu[o]:Object.keys(Pu).forEach((o=>{delete Pu[o]}))},JSONRefError,wrapError,getDoc,split:refs_split,extractFromDoc,fetchJSON:function fetchJSON(o){return fetch(o,{headers:{Accept:wu},loadSpec:!0}).then((o=>o.text())).then((o=>to.load(o)))},extract,jsonPointerToArray,unescapeJsonPointerToken}),Ru=Tu;function absoluteify(o,s){if(!ju.test(o)){if(!s)throw new JSONRefError(`Tried to resolve a relative URL, without having a basePath. path: '${o}' basePath: '${s}'`);return resolve(s,o)}return o}function wrapError(o,s){let i;return i=o&&o.response&&o.response.body?`${o.response.body.code} ${o.response.body.message}`:o.message,new JSONRefError(`Could not resolve reference: ${i}`,{...s,cause:o})}function refs_split(o){return(o+\"\").split(\"#\")}function extractFromDoc(o,s){const i=Pu[o];if(i&&!Na.isPromise(i))try{const o=extract(s,i);return Object.assign(Promise.resolve(o),{__value:o})}catch(o){return Promise.reject(o)}return getDoc(o).then((o=>extract(s,o)))}function getDoc(o){const s=Pu[o];return s?Na.isPromise(s)?s:Promise.resolve(s):(Pu[o]=Tu.fetchJSON(o).then((s=>(Pu[o]=s,s))),Pu[o])}function extract(o,s){const i=jsonPointerToArray(o);if(i.length<1)return s;const u=Na.getIn(s,i);if(void 0===u)throw new JSONRefError(`Could not resolve pointer: ${o} does not exist in document`,{pointer:o});return u}function jsonPointerToArray(o){if(\"string\"!=typeof o)throw new TypeError(\"Expected a string, got a \"+typeof o);return\"/\"===o[0]&&(o=o.substr(1)),\"\"===o?[]:o.split(\"/\").map(unescapeJsonPointerToken)}function unescapeJsonPointerToken(o){if(\"string\"!=typeof o)return o;return new URLSearchParams(`=${o.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}`).get(\"\")}function escapeJsonPointerToken(o){return new URLSearchParams([[\"\",o.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")]]).toString().slice(1)}const pointerBoundaryChar=o=>!o||\"/\"===o||\"#\"===o;function pointerIsAParent(o,s){if(pointerBoundaryChar(s))return!0;const i=o.charAt(s.length),u=s.slice(-1);return 0===o.indexOf(s)&&(!i||\"/\"===i||\"#\"===i)&&\"#\"!==u}const Du={key:\"allOf\",plugin:(o,s,i,u,_)=>{if(_.meta&&_.meta.$$ref)return;const w=i.slice(0,-1);if(isFreelyNamed(w))return;if(!Array.isArray(o)){const o=new TypeError(\"allOf must be an array\");return o.fullPath=i,o}let x=!1,C=_.value;if(w.forEach((o=>{C&&(C=C[o])})),C={...C},0===Object.keys(C).length)return;delete C.allOf;const j=[];return j.push(u.replace(w,{})),o.forEach(((o,s)=>{if(!u.isObject(o)){if(x)return null;x=!0;const o=new TypeError(\"Elements in allOf must be objects\");return o.fullPath=i,j.push(o)}j.push(u.mergeDeep(w,o));const _=function generateAbsoluteRefPatches(o,s,{specmap:i,getBaseUrlForNodePath:u=(o=>i.getContext([...s,...o]).baseDoc),targetKeys:_=[\"$ref\",\"$$ref\"]}={}){const w=[];return Eu()(o).forEach((function callback(){if(_.includes(this.key)&&\"string\"==typeof this.node){const o=this.path,_=s.concat(this.path),x=absolutifyPointer(this.node,u(o));w.push(i.replace(_,x))}})),w}(o,i.slice(0,-1),{getBaseUrlForNodePath:o=>u.getContext([...i,s,...o]).baseDoc,specmap:u});j.push(..._)})),C.example&&j.push(u.remove([].concat(w,\"example\"))),j.push(u.mergeDeep(w,C)),C.$$ref||j.push(u.remove([].concat(w,\"$$ref\"))),j}},Lu={key:\"parameters\",plugin:(o,s,i,u)=>{if(Array.isArray(o)&&o.length){const s=Object.assign([],o),_=i.slice(0,-1),w={...Na.getIn(u.spec,_)};for(let _=0;_<o.length;_+=1){const x=o[_];try{s[_].default=u.parameterMacro(w,x)}catch(o){const s=new Error(o);return s.fullPath=i,s}}return Na.replace(i,s)}return Na.replace(i,o)}},Bu={key:\"properties\",plugin:(o,s,i,u)=>{const _={...o};for(const s in o)try{_[s].default=u.modelPropertyMacro(_[s])}catch(o){const s=new Error(o);return s.fullPath=i,s}return Na.replace(i,_)}};class ContextTree{constructor(o){this.root=context_tree_createNode(o||{})}set(o,s){const i=this.getParent(o,!0);if(!i)return void context_tree_updateNode(this.root,s,null);const u=o[o.length-1],{children:_}=i;_[u]?context_tree_updateNode(_[u],s,i):_[u]=context_tree_createNode(s,i)}get(o){if((o=o||[]).length<1)return this.root.value;let s,i,u=this.root;for(let _=0;_<o.length&&(i=o[_],s=u.children,s[i]);_+=1)u=s[i];return u&&u.protoValue}getParent(o,s){return!o||o.length<1?null:o.length<2?this.root:o.slice(0,-1).reduce(((o,i)=>{if(!o)return o;const{children:u}=o;return!u[i]&&s&&(u[i]=context_tree_createNode(null,o)),u[i]}),this.root)}}function context_tree_createNode(o,s){return context_tree_updateNode({children:{}},o,s)}function context_tree_updateNode(o,s,i){return o.value=s||{},o.protoValue=i?{...i.protoValue,...o.value}:o.value,Object.keys(o.children).forEach((s=>{const i=o.children[s];o.children[s]=context_tree_updateNode(i,i.value,o)})),o}const specmap_noop=()=>{};class SpecMap{static getPluginName(o){return o.pluginName}static getPatchesOfType(o,s){return o.filter(s)}constructor(o){Object.assign(this,{spec:\"\",debugLevel:\"info\",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new ContextTree,showDebug:!1,allPatches:[],pluginProp:\"specMap\",libMethods:Object.assign(Object.create(this),Na,{getInstance:()=>this}),allowMetaPatches:!1},o),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(Na.isFunction),this.patches.push(Na.add([],this.spec)),this.patches.push(Na.context([],this.context)),this.updatePatches(this.patches)}debug(o,...s){this.debugLevel===o&&console.log(...s)}verbose(o,...s){\"verbose\"===this.debugLevel&&console.log(`[${o}]   `,...s)}wrapPlugin(o,s){const{pathDiscriminator:i}=this;let u,_=null;return o[this.pluginProp]?(_=o,u=o[this.pluginProp]):Na.isFunction(o)?u=o:Na.isObject(o)&&(u=function createKeyBasedPlugin(o){const isSubPath=(o,s)=>!Array.isArray(o)||o.every(((o,i)=>o===s[i]));return function*generator(s,u){const _={};for(const[o,i]of s.filter(Na.isAdditiveMutation).entries()){if(!(o<3e3))return;yield*traverse(i.value,i.path,i)}function*traverse(s,w,x){if(Na.isObject(s)){const C=w.length-1,j=w[C],L=w.indexOf(\"properties\"),B=\"properties\"===j&&C===L,$=u.allowMetaPatches&&_[s.$$ref];for(const C of Object.keys(s)){const j=s[C],L=w.concat(C),V=Na.isObject(j),U=s.$$ref;if($||V&&(u.allowMetaPatches&&U&&(_[U]=!0),yield*traverse(j,L,x)),!B&&C===o.key){const s=isSubPath(i,w);i&&!s||(yield o.plugin(j,C,L,u,x))}}}else o.key===w[w.length-1]&&(yield o.plugin(s,o.key,w,u))}}}(o)),Object.assign(u.bind(_),{pluginName:o.name||s,isGenerator:Na.isGenerator(u)})}nextPlugin(){return this.wrappedPlugins.find((o=>this.getMutationsForPlugin(o).length>0))}nextPromisedPatch(){if(this.promisedPatches.length>0)return Promise.race(this.promisedPatches.map((o=>o.value)))}getPluginHistory(o){const s=this.constructor.getPluginName(o);return this.pluginHistory[s]||[]}getPluginRunCount(o){return this.getPluginHistory(o).length}getPluginHistoryTip(o){const s=this.getPluginHistory(o);return s&&s[s.length-1]||{}}getPluginMutationIndex(o){const s=this.getPluginHistoryTip(o).mutationIndex;return\"number\"!=typeof s?-1:s}updatePluginHistory(o,s){const i=this.constructor.getPluginName(o);this.pluginHistory[i]=this.pluginHistory[i]||[],this.pluginHistory[i].push(s)}updatePatches(o){Na.normalizeArray(o).forEach((o=>{if(o instanceof Error)this.errors.push(o);else try{if(!Na.isObject(o))return void this.debug(\"updatePatches\",\"Got a non-object patch\",o);if(this.showDebug&&this.allPatches.push(o),Na.isPromise(o.value))return this.promisedPatches.push(o),void this.promisedPatchThen(o);if(Na.isContextPatch(o))return void this.setContext(o.path,o.value);Na.isMutation(o)&&this.updateMutations(o)}catch(o){console.error(o),this.errors.push(o)}}))}updateMutations(o){\"object\"==typeof o.value&&!Array.isArray(o.value)&&this.allowMetaPatches&&(o.value={...o.value});const s=Na.applyPatch(this.state,o,{allowMetaPatches:this.allowMetaPatches});s&&(this.mutations.push(o),this.state=s)}removePromisedPatch(o){const s=this.promisedPatches.indexOf(o);s<0?this.debug(\"Tried to remove a promisedPatch that isn't there!\"):this.promisedPatches.splice(s,1)}promisedPatchThen(o){return o.value=o.value.then((s=>{const i={...o,value:s};this.removePromisedPatch(o),this.updatePatches(i)})).catch((s=>{this.removePromisedPatch(o),this.updatePatches(s)})),o.value}getMutations(o,s){return o=o||0,\"number\"!=typeof s&&(s=this.mutations.length),this.mutations.slice(o,s)}getCurrentMutations(){return this.getMutationsForPlugin(this.getCurrentPlugin())}getMutationsForPlugin(o){const s=this.getPluginMutationIndex(o);return this.getMutations(s+1)}getCurrentPlugin(){return this.currentPlugin}getLib(){return this.libMethods}_get(o){return Na.getIn(this.state,o)}_getContext(o){return this.contextTree.get(o)}setContext(o,s){return this.contextTree.set(o,s)}_hasRun(o){return this.getPluginRunCount(this.getCurrentPlugin())>(o||0)}dispatch(){const o=this,s=this.nextPlugin();if(!s){const o=this.nextPromisedPatch();if(o)return o.then((()=>this.dispatch())).catch((()=>this.dispatch()));const s={spec:this.state,errors:this.errors};return this.showDebug&&(s.patches=this.allPatches),Promise.resolve(s)}if(o.pluginCount=o.pluginCount||new WeakMap,o.pluginCount.set(s,(o.pluginCount.get(s)||0)+1),o.pluginCount[s]>100)return Promise.resolve({spec:o.state,errors:o.errors.concat(new Error(\"We've reached a hard limit of 100 plugin runs\"))});if(s!==this.currentPlugin&&this.promisedPatches.length){const o=this.promisedPatches.map((o=>o.value));return Promise.all(o.map((o=>o.then(specmap_noop,specmap_noop)))).then((()=>this.dispatch()))}return function executePlugin(){o.currentPlugin=s;const i=o.getCurrentMutations(),u=o.mutations.length-1;try{if(s.isGenerator)for(const u of s(i,o.getLib()))updatePatches(u);else{updatePatches(s(i,o.getLib()))}}catch(o){console.error(o),updatePatches([Object.assign(Object.create(o),{plugin:s})])}finally{o.updatePluginHistory(s,{mutationIndex:u})}return o.dispatch()}();function updatePatches(i){i&&(i=Na.fullyNormalizeArray(i),o.updatePatches(i,s))}}}const Fu={refs:Ru,allOf:Du,parameters:Lu,properties:Bu},replace_special_chars_with_underscore=o=>o.replace(/\\W/gi,\"_\");function opId(o,s,i=\"\",{v2OperationIdCompatibilityMode:u}={}){if(!o||\"object\"!=typeof o)return null;return(o.operationId||\"\").replace(/\\s/g,\"\").length?replace_special_chars_with_underscore(o.operationId):function idFromPathMethod(o,s,{v2OperationIdCompatibilityMode:i}={}){if(i){let i=`${s.toLowerCase()}_${o}`.replace(/[\\s!@#$%^&*()_+=[{\\]};:<>|./?,\\\\'\"\"-]/g,\"_\");return i=i||`${o.substring(1)}_${s}`,i.replace(/((_){2,})/g,\"_\").replace(/^(_)*/g,\"\").replace(/([_])*$/g,\"\")}return`${s.toLowerCase()}${replace_special_chars_with_underscore(o)}`}(s,i,{v2OperationIdCompatibilityMode:u})}function normalize(o){const{spec:s}=o,{paths:i}=s,u={};if(!i||s.$$normalized)return o;for(const o in i){const _=i[o];if(null==_||![\"object\",\"function\"].includes(typeof _))continue;const w=_.parameters;for(const i in _){const x=_[i];if(null==x||![\"object\",\"function\"].includes(typeof x))continue;const C=opId(x,o,i);if(C){u[C]?u[C].push(x):u[C]=[x];const o=u[C];if(o.length>1)o.forEach(((o,s)=>{o.__originalOperationId=o.__originalOperationId||o.operationId,o.operationId=`${C}${s+1}`}));else if(void 0!==x.operationId){const s=o[0];s.__originalOperationId=s.__originalOperationId||x.operationId,s.operationId=C}}if(\"parameters\"!==i){const o=[],i={};for(const u in s)\"produces\"!==u&&\"consumes\"!==u&&\"security\"!==u||(i[u]=s[u],o.push(i));if(w&&(i.parameters=w,o.push(i)),o.length)for(const s of o)for(const o in s)if(x[o]){if(\"parameters\"===o)for(const i of s[o]){x[o].some((o=>o.name&&o.name===i.name||o.$ref&&o.$ref===i.$ref||o.$$ref&&o.$$ref===i.$$ref||o===i))||x[o].push(i)}}else x[o]=s[o]}}}return s.$$normalized=!0,o}function makeFetchJSON(o,s={}){const{requestInterceptor:i,responseInterceptor:u}=s,_=o.withCredentials?\"include\":\"same-origin\";return s=>o({url:s,loadSpec:!0,requestInterceptor:i,responseInterceptor:u,headers:{Accept:wu},credentials:_}).then((o=>o.body))}var qu=__webpack_require__(55373),$u=__webpack_require__.n(qu);function isFile(o,s){return s||\"undefined\"==typeof navigator||(s=navigator),s&&\"ReactNative\"===s.product?!(!o||\"object\"!=typeof o||\"string\"!=typeof o.uri):\"undefined\"!=typeof File&&o instanceof File||(\"undefined\"!=typeof Blob&&o instanceof Blob||(!!ArrayBuffer.isView(o)||null!==o&&\"object\"==typeof o&&\"function\"==typeof o.pipe))}function isArrayOfFile(o,s){return Array.isArray(o)&&o.some((o=>isFile(o,s)))}class FileWithData extends File{constructor(o,s=\"\",i={}){super([o],s,i),this.data=o}valueOf(){return this.data}toString(){return this.valueOf()}}const isRfc3986Reserved=o=>\":/?#[]@!$&'()*+,;=\".indexOf(o)>-1,isRfc3986Unreserved=o=>/^[a-z0-9\\-._~]+$/i.test(o);function encodeCharacters(o,s=\"reserved\"){return[...o].map((o=>{if(isRfc3986Unreserved(o))return o;if(isRfc3986Reserved(o)&&\"unsafe\"===s)return o;const i=new TextEncoder;return Array.from(i.encode(o)).map((o=>`0${o.toString(16).toUpperCase()}`.slice(-2))).map((o=>`%${o}`)).join(\"\")})).join(\"\")}function stylize(o){const{value:s}=o;return Array.isArray(s)?function encodeArray({key:o,value:s,style:i,explode:u,escape:_}){if(\"simple\"===i)return s.map((o=>valueEncoder(o,_))).join(\",\");if(\"label\"===i)return`.${s.map((o=>valueEncoder(o,_))).join(\".\")}`;if(\"matrix\"===i)return s.map((o=>valueEncoder(o,_))).reduce(((s,i)=>!s||u?`${s||\"\"};${o}=${i}`:`${s},${i}`),\"\");if(\"form\"===i){const i=u?`&${o}=`:\",\";return s.map((o=>valueEncoder(o,_))).join(i)}if(\"spaceDelimited\"===i){const i=u?`${o}=`:\"\";return s.map((o=>valueEncoder(o,_))).join(` ${i}`)}if(\"pipeDelimited\"===i){const i=u?`${o}=`:\"\";return s.map((o=>valueEncoder(o,_))).join(`|${i}`)}return}(o):\"object\"==typeof s?function encodeObject({key:o,value:s,style:i,explode:u,escape:_}){const w=Object.keys(s);if(\"simple\"===i)return w.reduce(((o,i)=>{const w=valueEncoder(s[i],_);return`${o?`${o},`:\"\"}${i}${u?\"=\":\",\"}${w}`}),\"\");if(\"label\"===i)return w.reduce(((o,i)=>{const w=valueEncoder(s[i],_);return`${o?`${o}.`:\".\"}${i}${u?\"=\":\".\"}${w}`}),\"\");if(\"matrix\"===i&&u)return w.reduce(((o,i)=>`${o?`${o};`:\";\"}${i}=${valueEncoder(s[i],_)}`),\"\");if(\"matrix\"===i)return w.reduce(((i,u)=>{const w=valueEncoder(s[u],_);return`${i?`${i},`:`;${o}=`}${u},${w}`}),\"\");if(\"form\"===i)return w.reduce(((o,i)=>{const w=valueEncoder(s[i],_);return`${o?`${o}${u?\"&\":\",\"}`:\"\"}${i}${u?\"=\":\",\"}${w}`}),\"\");return}(o):function encodePrimitive({key:o,value:s,style:i,escape:u}){if(\"simple\"===i)return valueEncoder(s,u);if(\"label\"===i)return`.${valueEncoder(s,u)}`;if(\"matrix\"===i)return`;${o}=${valueEncoder(s,u)}`;if(\"form\"===i)return valueEncoder(s,u);if(\"deepObject\"===i)return valueEncoder(s,u);return}(o)}function valueEncoder(o,s=!1){return Array.isArray(o)||null!==o&&\"object\"==typeof o?o=JSON.stringify(o):\"number\"!=typeof o&&\"boolean\"!=typeof o||(o=String(o)),s&&o.length>0?encodeCharacters(o,s):o}const Vu={form:\",\",spaceDelimited:\"%20\",pipeDelimited:\"|\"},Uu={csv:\",\",ssv:\"%20\",tsv:\"%09\",pipes:\"|\"};function formatKeyValue(o,s,i=!1){const{collectionFormat:u,allowEmptyValue:_,serializationOption:w,encoding:x}=s,C=\"object\"!=typeof s||Array.isArray(s)?s:s.value,j=i?o=>o.toString():o=>encodeURIComponent(o),L=j(o);if(void 0===C&&_)return[[L,\"\"]];if(isFile(C)||isArrayOfFile(C))return[[L,C]];if(w)return formatKeyValueBySerializationOption(o,C,i,w);if(x){if([typeof x.style,typeof x.explode,typeof x.allowReserved].some((o=>\"undefined\"!==o))){const{style:s,explode:u,allowReserved:_}=x;return formatKeyValueBySerializationOption(o,C,i,{style:s,explode:u,allowReserved:_})}if(\"string\"==typeof x.contentType){if(x.contentType.startsWith(\"application/json\")){const o=j(\"string\"==typeof C?C:JSON.stringify(C));return[[L,new FileWithData(o,\"blob\",{type:x.contentType})]]}const o=j(String(C));return[[L,new FileWithData(o,\"blob\",{type:x.contentType})]]}return\"object\"!=typeof C?[[L,j(C)]]:Array.isArray(C)&&C.every((o=>\"object\"!=typeof o))?[[L,C.map(j).join(\",\")]]:[[L,j(JSON.stringify(C))]]}return\"object\"!=typeof C?[[L,j(C)]]:Array.isArray(C)?\"multi\"===u?[[L,C.map(j)]]:[[L,C.map(j).join(Uu[u||\"csv\"])]]:[[L,\"\"]]}function formatKeyValueBySerializationOption(o,s,i,u){const _=u.style||\"form\",w=void 0===u.explode?\"form\"===_:u.explode,x=!i&&(u&&u.allowReserved?\"unsafe\":\"reserved\"),encodeFn=o=>valueEncoder(o,x),C=i?o=>o:o=>encodeFn(o);return\"object\"!=typeof s?[[C(o),encodeFn(s)]]:Array.isArray(s)?w?[[C(o),s.map(encodeFn)]]:[[C(o),s.map(encodeFn).join(Vu[_])]]:\"deepObject\"===_?Object.keys(s).map((i=>[C(`${o}[${i}]`),encodeFn(s[i])])):w?Object.keys(s).map((o=>[C(o),encodeFn(s[o])])):[[C(o),Object.keys(s).map((o=>[`${C(o)},${encodeFn(s[o])}`])).join(\",\")]]}function encodeFormOrQuery(o){const s=Object.keys(o).reduce(((s,i)=>{for(const[u,_]of formatKeyValue(i,o[i]))s[u]=_ instanceof FileWithData?_.valueOf():_;return s}),{});return $u().stringify(s,{encode:!1,indices:!1})||\"\"}function serializeRequest(o={}){const{url:s=\"\",query:i,form:u}=o;if(u){const s=Object.keys(u).some((o=>{const{value:s}=u[o];return isFile(s)||isArrayOfFile(s)})),i=o.headers[\"content-type\"]||o.headers[\"Content-Type\"];if(s||/multipart\\/form-data/i.test(i)){const s=function request_buildFormData(o){return Object.entries(o).reduce(((o,[s,i])=>{for(const[u,_]of formatKeyValue(s,i,!0))if(Array.isArray(_))for(const s of _)if(ArrayBuffer.isView(s)){const i=new Blob([s]);o.append(u,i)}else o.append(u,s);else if(ArrayBuffer.isView(_)){const s=new Blob([_]);o.append(u,s)}else o.append(u,_);return o}),new FormData)}(o.form);o.formdata=s,o.body=s}else o.body=encodeFormOrQuery(u);delete o.form}if(i){const[u,_]=s.split(\"?\");let w=\"\";if(_){const o=$u().parse(_);Object.keys(i).forEach((s=>delete o[s])),w=$u().stringify(o,{encode:!0})}const x=((...o)=>{const s=o.filter((o=>o)).join(\"&\");return s?`?${s}`:\"\"})(w,encodeFormOrQuery(i));o.url=u+x,delete o.query}return o}const shouldDownloadAsText=(o=\"\")=>/(json|xml|yaml|text)\\b/.test(o);function serializeHeaders(o={}){return\"function\"!=typeof o.entries?{}:Array.from(o.entries()).reduce(((o,[s,i])=>(o[s]=function serializeHeaderValue(o){return o.includes(\", \")?o.split(\", \"):o}(i),o)),{})}function serializeResponse(o,s,{loadSpec:i=!1}={}){const u={ok:o.ok,url:o.url||s,status:o.status,statusText:o.statusText,headers:serializeHeaders(o.headers)},_=u.headers[\"content-type\"],w=i||shouldDownloadAsText(_);return(w?o.text:o.blob||o.buffer).call(o).then((o=>{if(u.text=o,u.data=o,w)try{const s=function parseBody(o,s){return s&&(0===s.indexOf(\"application/json\")||s.indexOf(\"+json\")>0)?JSON.parse(o):to.load(o)}(o,_);u.body=s,u.obj=s}catch(o){u.parseError=o}return u}))}async function http_http(o,s={}){\"object\"==typeof o&&(o=(s=o).url),s.headers=s.headers||{},(s=serializeRequest(s)).headers&&Object.keys(s.headers).forEach((o=>{const i=s.headers[o];\"string\"==typeof i&&(s.headers[o]=i.replace(/\\n+/g,\" \"))})),s.requestInterceptor&&(s=await s.requestInterceptor(s)||s);const i=s.headers[\"content-type\"]||s.headers[\"Content-Type\"];let u;/multipart\\/form-data/i.test(i)&&(delete s.headers[\"content-type\"],delete s.headers[\"Content-Type\"]);try{u=await(s.userFetch||fetch)(s.url,s),u=await serializeResponse(u,o,s),s.responseInterceptor&&(u=await s.responseInterceptor(u)||u)}catch(o){if(!u)throw o;const s=new Error(u.statusText||`response status is ${u.status}`);throw s.status=u.status,s.statusCode=u.status,s.responseError=o,s}if(!u.ok){const o=new Error(u.statusText||`response status is ${u.status}`);throw o.status=u.status,o.statusCode=u.status,o.response=u,o}return u}const options_retrievalURI=o=>{var s,i;const{baseDoc:u,url:_}=o,w=null!==(s=null!=u?u:_)&&void 0!==s?s:\"\";return\"string\"==typeof(null===(i=globalThis.document)||void 0===i?void 0:i.baseURI)?String(new URL(w,globalThis.document.baseURI)):w},options_httpClient=o=>{const{fetch:s,http:i}=o;return s||i||http_http};async function resolveGenericStrategy(o){const{spec:s,mode:i,allowMetaPatches:u=!0,pathDiscriminator:_,modelPropertyMacro:w,parameterMacro:x,requestInterceptor:C,responseInterceptor:j,skipNormalization:L,useCircularStructures:B}=o,$=options_retrievalURI(o),V=options_httpClient(o);return function doResolve(o){$&&(Fu.refs.docCache[$]=o);Fu.refs.fetchJSON=makeFetchJSON(V,{requestInterceptor:C,responseInterceptor:j});const s=[Fu.refs];\"function\"==typeof x&&s.push(Fu.parameters);\"function\"==typeof w&&s.push(Fu.properties);\"strict\"!==i&&s.push(Fu.allOf);return function mapSpec(o){return new SpecMap(o).dispatch()}({spec:o,context:{baseDoc:$},plugins:s,allowMetaPatches:u,pathDiscriminator:_,parameterMacro:x,modelPropertyMacro:w,useCircularStructures:B}).then(L?async o=>o:normalize)}(s)}const zu={name:\"generic\",match:()=>!0,normalize({spec:o}){const{spec:s}=normalize({spec:o});return s},resolve:async o=>resolveGenericStrategy(o)},Wu=zu;const isOpenAPI30=o=>{try{const{openapi:s}=o;return\"string\"==typeof s&&/^3\\.0\\.([0123])(?:-rc[012])?$/.test(s)}catch{return!1}},isOpenAPI31=o=>{try{const{openapi:s}=o;return\"string\"==typeof s&&/^3\\.1\\.(?:[1-9]\\d*|0)$/.test(s)}catch{return!1}},isOpenAPI3=o=>isOpenAPI30(o)||isOpenAPI31(o),Ku={name:\"openapi-2\",match:({spec:o})=>(o=>{try{const{swagger:s}=o;return\"2.0\"===s}catch{return!1}})(o),normalize({spec:o}){const{spec:s}=normalize({spec:o});return s},resolve:async o=>async function resolveOpenAPI2Strategy(o){return resolveGenericStrategy(o)}(o)},Hu=Ku;const Ju={name:\"openapi-3-0\",match:({spec:o})=>isOpenAPI30(o),normalize({spec:o}){const{spec:s}=normalize({spec:o});return s},resolve:async o=>async function resolveOpenAPI30Strategy(o){return resolveGenericStrategy(o)}(o)},Gu=Ju;const es_T=function(){return!0};const es_F=function(){return!1},getVisitFn=(o,s,i)=>{const u=o[s];if(null!=u){if(!i&&\"function\"==typeof u)return u;const o=i?u.leave:u.enter;if(\"function\"==typeof o)return o}else{const u=i?o.leave:o.enter;if(null!=u){if(\"function\"==typeof u)return u;const o=u[s];if(\"function\"==typeof o)return o}}return null},Yu={},getNodeType=o=>null==o?void 0:o.type,isNode=o=>\"string\"==typeof getNodeType(o),cloneNode=o=>Object.create(Object.getPrototypeOf(o),Object.getOwnPropertyDescriptors(o)),mergeAll=(o,{visitFnGetter:s=getVisitFn,nodeTypeGetter:i=getNodeType,breakSymbol:u=Yu,deleteNodeSymbol:_=null,skipVisitingNodeSymbol:w=!1,exposeEdits:x=!1}={})=>{const C=Symbol(\"skip\"),j=new Array(o.length).fill(C);return{enter(L,B,$,V,U,z){let Y=L,Z=!1;const ee={...z,replaceWith(o,s){z.replaceWith(o,s),Y=o}};for(let L=0;L<o.length;L+=1)if(j[L]===C){const C=s(o[L],i(Y),!1);if(\"function\"==typeof C){const s=C.call(o[L],Y,B,$,V,U,ee);if(\"function\"==typeof(null==s?void 0:s.then))throw new Fa(\"Async visitor not supported in sync mode\",{visitor:o[L],visitFn:C});if(s===w)j[L]=Y;else if(s===u)j[L]=u;else{if(s===_)return s;if(void 0!==s){if(!x)return s;Y=s,Z=!0}}}}return Z?Y:void 0},leave(_,x,L,B,$,V){let U=_;const z={...V,replaceWith(o,s){V.replaceWith(o,s),U=o}};for(let _=0;_<o.length;_+=1)if(j[_]===C){const C=s(o[_],i(U),!0);if(\"function\"==typeof C){const s=C.call(o[_],U,x,L,B,$,z);if(\"function\"==typeof(null==s?void 0:s.then))throw new Fa(\"Async visitor not supported in sync mode\",{visitor:o[_],visitFn:C});if(s===u)j[_]=u;else if(void 0!==s&&s!==w)return s}}else j[_]===U&&(j[_]=C)}}};mergeAll[Symbol.for(\"nodejs.util.promisify.custom\")]=(o,{visitFnGetter:s=getVisitFn,nodeTypeGetter:i=getNodeType,breakSymbol:u=Yu,deleteNodeSymbol:_=null,skipVisitingNodeSymbol:w=!1,exposeEdits:x=!1}={})=>{const C=Symbol(\"skip\"),j=new Array(o.length).fill(C);return{async enter(L,B,$,V,U,z){let Y=L,Z=!1;const ee={...z,replaceWith(o,s){z.replaceWith(o,s),Y=o}};for(let L=0;L<o.length;L+=1)if(j[L]===C){const C=s(o[L],i(Y),!1);if(\"function\"==typeof C){const s=await C.call(o[L],Y,B,$,V,U,ee);if(s===w)j[L]=Y;else if(s===u)j[L]=u;else{if(s===_)return s;if(void 0!==s){if(!x)return s;Y=s,Z=!0}}}}return Z?Y:void 0},async leave(_,x,L,B,$,V){let U=_;const z={...V,replaceWith(o,s){V.replaceWith(o,s),U=o}};for(let _=0;_<o.length;_+=1)if(j[_]===C){const C=s(o[_],i(U),!0);if(\"function\"==typeof C){const s=await C.call(o[_],U,x,L,B,$,z);if(s===u)j[_]=u;else if(void 0!==s&&s!==w)return s}}else j[_]===U&&(j[_]=C)}}};const visit=(o,s,{keyMap:i=null,state:u={},breakSymbol:_=Yu,deleteNodeSymbol:w=null,skipVisitingNodeSymbol:x=!1,visitFnGetter:C=getVisitFn,nodeTypeGetter:j=getNodeType,nodePredicate:L=isNode,nodeCloneFn:B=cloneNode,detectCycles:$=!0}={})=>{const V=i||{};let U,z,Y=Array.isArray(o),Z=[o],ee=-1,ie=[],ae=o;const ce=[],le=[];do{ee+=1;const o=ee===Z.length;let i;const fe=o&&0!==ie.length;if(o){if(i=0===le.length?void 0:ce.pop(),ae=z,z=le.pop(),fe)if(Y){ae=ae.slice();let o=0;for(const[s,i]of ie){const u=s-o;i===w?(ae.splice(u,1),o+=1):ae[u]=i}}else{ae=B(ae);for(const[o,s]of ie)ae[o]=s}ee=U.index,Z=U.keys,ie=U.edits,Y=U.inArray,U=U.prev}else if(z!==w&&void 0!==z){if(i=Y?ee:Z[ee],ae=z[i],ae===w||void 0===ae)continue;ce.push(i)}let ye;if(!Array.isArray(ae)){var pe;if(!L(ae))throw new Fa(`Invalid AST Node:  ${String(ae)}`,{node:ae});if($&&le.includes(ae)){ce.pop();continue}const w=C(s,j(ae),o);if(w){for(const[o,i]of Object.entries(u))s[o]=i;const _={replaceWith(s,u){\"function\"==typeof u?u(s,ae,i,z,ce,le):z&&(z[i]=s),o||(ae=s)}};ye=w.call(s,ae,i,z,ce,le,_)}if(\"function\"==typeof(null===(pe=ye)||void 0===pe?void 0:pe.then))throw new Fa(\"Async visitor not supported in sync mode\",{visitor:s,visitFn:w});if(ye===_)break;if(ye===x){if(!o){ce.pop();continue}}else if(void 0!==ye&&(ie.push([i,ye]),!o)){if(!L(ye)){ce.pop();continue}ae=ye}}var de;if(void 0===ye&&fe&&ie.push([i,ae]),!o)U={inArray:Y,index:ee,keys:Z,edits:ie,prev:U},Y=Array.isArray(ae),Z=Y?ae:null!==(de=V[j(ae)])&&void 0!==de?de:[],ee=-1,ie=[],z!==w&&void 0!==z&&le.push(z),z=ae}while(void 0!==U);return 0!==ie.length?ie[ie.length-1][1]:o};visit[Symbol.for(\"nodejs.util.promisify.custom\")]=async(o,s,{keyMap:i=null,state:u={},breakSymbol:_=Yu,deleteNodeSymbol:w=null,skipVisitingNodeSymbol:x=!1,visitFnGetter:C=getVisitFn,nodeTypeGetter:j=getNodeType,nodePredicate:L=isNode,nodeCloneFn:B=cloneNode,detectCycles:$=!0}={})=>{const V=i||{};let U,z,Y=Array.isArray(o),Z=[o],ee=-1,ie=[],ae=o;const ce=[],le=[];do{ee+=1;const o=ee===Z.length;let i;const de=o&&0!==ie.length;if(o){if(i=0===le.length?void 0:ce.pop(),ae=z,z=le.pop(),de)if(Y){ae=ae.slice();let o=0;for(const[s,i]of ie){const u=s-o;i===w?(ae.splice(u,1),o+=1):ae[u]=i}}else{ae=B(ae);for(const[o,s]of ie)ae[o]=s}ee=U.index,Z=U.keys,ie=U.edits,Y=U.inArray,U=U.prev}else if(z!==w&&void 0!==z){if(i=Y?ee:Z[ee],ae=z[i],ae===w||void 0===ae)continue;ce.push(i)}let fe;if(!Array.isArray(ae)){if(!L(ae))throw new Fa(`Invalid AST Node: ${String(ae)}`,{node:ae});if($&&le.includes(ae)){ce.pop();continue}const w=C(s,j(ae),o);if(w){for(const[o,i]of Object.entries(u))s[o]=i;const _={replaceWith(s,u){\"function\"==typeof u?u(s,ae,i,z,ce,le):z&&(z[i]=s),o||(ae=s)}};fe=await w.call(s,ae,i,z,ce,le,_)}if(fe===_)break;if(fe===x){if(!o){ce.pop();continue}}else if(void 0!==fe&&(ie.push([i,fe]),!o)){if(!L(fe)){ce.pop();continue}ae=fe}}var pe;if(void 0===fe&&de&&ie.push([i,ae]),!o)U={inArray:Y,index:ee,keys:Z,edits:ie,prev:U},Y=Array.isArray(ae),Z=Y?ae:null!==(pe=V[j(ae)])&&void 0!==pe?pe:[],ee=-1,ie=[],z!==w&&void 0!==z&&le.push(z),z=ae}while(void 0!==U);return 0!==ie.length?ie[ie.length-1][1]:o};var Xu=__webpack_require__(34035);function _reduced(o){return o&&o[\"@@transducer/reduced\"]?o:{\"@@transducer/value\":o,\"@@transducer/reduced\":!0}}var Qu=function(){function XAll(o,s){this.xf=s,this.f=o,this.all=!0}return XAll.prototype[\"@@transducer/init\"]=_xfBase_init,XAll.prototype[\"@@transducer/result\"]=function(o){return this.all&&(o=this.xf[\"@@transducer/step\"](o,!0)),this.xf[\"@@transducer/result\"](o)},XAll.prototype[\"@@transducer/step\"]=function(o,s){return this.f(s)||(this.all=!1,o=_reduced(this.xf[\"@@transducer/step\"](o,!1))),o},XAll}();function _xall(o){return function(s){return new Qu(o,s)}}var Zu=_curry2(_dispatchable([\"all\"],_xall,(function all(o,s){for(var i=0;i<s.length;){if(!o(s[i]))return!1;i+=1}return!0})));const ep=Zu;class Annotation extends Xu.Om{constructor(o,s,i){super(o,s,i),this.element=\"annotation\"}get code(){return this.attributes.get(\"code\")}set code(o){this.attributes.set(\"code\",o)}}const tp=Annotation;class Comment extends Xu.Om{constructor(o,s,i){super(o,s,i),this.element=\"comment\"}}const rp=Comment;class ParseResult extends Xu.wE{constructor(o,s,i){super(o,s,i),this.element=\"parseResult\"}get api(){return this.children.filter((o=>o.classes.contains(\"api\"))).first}get results(){return this.children.filter((o=>o.classes.contains(\"result\")))}get result(){return this.results.first}get annotations(){return this.children.filter((o=>\"annotation\"===o.element))}get warnings(){return this.children.filter((o=>\"annotation\"===o.element&&o.classes.contains(\"warning\")))}get errors(){return this.children.filter((o=>\"annotation\"===o.element&&o.classes.contains(\"error\")))}get isEmpty(){return this.children.reject((o=>\"annotation\"===o.element)).isEmpty}replaceResult(o){const{result:s}=this;if(Wl(s))return!1;const i=this.content.findIndex((o=>o===s));return-1!==i&&(this.content[i]=o,!0)}}const np=ParseResult;class SourceMap extends Xu.wE{constructor(o,s,i){super(o,s,i),this.element=\"sourceMap\"}get positionStart(){return this.children.filter((o=>o.classes.contains(\"position\"))).get(0)}get positionEnd(){return this.children.filter((o=>o.classes.contains(\"position\"))).get(1)}set position(o){if(void 0===o)return;const s=new Xu.wE([o.start.row,o.start.column,o.start.char]),i=new Xu.wE([o.end.row,o.end.column,o.end.char]);s.classes.push(\"position\"),i.classes.push(\"position\"),this.push(s).push(i)}}const op=SourceMap,hasMethod=(o,s)=>\"object\"==typeof s&&null!==s&&o in s&&\"function\"==typeof s[o],hasBasicElementProps=o=>\"object\"==typeof o&&null!=o&&\"_storedElement\"in o&&\"string\"==typeof o._storedElement&&\"_content\"in o,primitiveEq=(o,s)=>\"object\"==typeof s&&null!==s&&\"primitive\"in s&&(\"function\"==typeof s.primitive&&s.primitive()===o),hasClass=(o,s)=>\"object\"==typeof s&&null!==s&&\"classes\"in s&&(Array.isArray(s.classes)||s.classes instanceof Xu.wE)&&s.classes.includes(o),isElementType=(o,s)=>\"object\"==typeof s&&null!==s&&\"element\"in s&&s.element===o,helpers=o=>o({hasMethod,hasBasicElementProps,primitiveEq,isElementType,hasClass}),sp=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.Hg||o(i)&&s(void 0,i))),ip=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.Om||o(i)&&s(\"string\",i))),cp=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.kT||o(i)&&s(\"number\",i))),lp=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.Os||o(i)&&s(\"null\",i))),up=helpers((({hasBasicElementProps:o,primitiveEq:s})=>i=>i instanceof Xu.bd||o(i)&&s(\"boolean\",i))),pp=helpers((({hasBasicElementProps:o,primitiveEq:s,hasMethod:i})=>u=>u instanceof Xu.Sh||o(u)&&s(\"object\",u)&&i(\"keys\",u)&&i(\"values\",u)&&i(\"items\",u))),hp=helpers((({hasBasicElementProps:o,primitiveEq:s,hasMethod:i})=>u=>u instanceof Xu.wE&&!(u instanceof Xu.Sh)||o(u)&&s(\"array\",u)&&i(\"push\",u)&&i(\"unshift\",u)&&i(\"map\",u)&&i(\"reduce\",u))),dp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Xu.Pr||o(u)&&s(\"member\",u)&&i(void 0,u))),fp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Xu.Ft||o(u)&&s(\"link\",u)&&i(void 0,u))),mp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Xu.sI||o(u)&&s(\"ref\",u)&&i(void 0,u))),gp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof tp||o(u)&&s(\"annotation\",u)&&i(\"array\",u))),yp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof rp||o(u)&&s(\"comment\",u)&&i(\"string\",u))),vp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof np||o(u)&&s(\"parseResult\",u)&&i(\"array\",u))),bp=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof op||o(u)&&s(\"sourceMap\",u)&&i(\"array\",u))),isPrimitiveElement=o=>isElementType(\"object\",o)||isElementType(\"array\",o)||isElementType(\"boolean\",o)||isElementType(\"number\",o)||isElementType(\"string\",o)||isElementType(\"null\",o)||isElementType(\"member\",o),hasElementSourceMap=o=>bp(o.meta.get(\"sourceMap\")),includesSymbols=(o,s)=>{if(0===o.length)return!0;const i=s.attributes.get(\"symbols\");return!!hp(i)&&ep(Pl(i.toValue()),o)},includesClasses=(o,s)=>0===o.length||ep(Pl(s.classes.toValue()),o);const _p=class CloneError extends Fa{value;constructor(o,s){super(o,s),void 0!==s&&(this.value=s.value)}};const Ep=class DeepCloneError extends _p{};const wp=class ShallowCloneError extends _p{},cloneDeep=(o,s={})=>{const{visited:i=new WeakMap}=s,u={...s,visited:i};if(i.has(o))return i.get(o);if(o instanceof Xu.KeyValuePair){const{key:s,value:_}=o,w=sp(s)?cloneDeep(s,u):s,x=sp(_)?cloneDeep(_,u):_,C=new Xu.KeyValuePair(w,x);return i.set(o,C),C}if(o instanceof Xu.ot){const mapper=o=>cloneDeep(o,u),s=[...o].map(mapper),_=new Xu.ot(s);return i.set(o,_),_}if(o instanceof Xu.G6){const mapper=o=>cloneDeep(o,u),s=[...o].map(mapper),_=new Xu.G6(s);return i.set(o,_),_}if(sp(o)){const s=cloneShallow(o);if(i.set(o,s),o.content)if(sp(o.content))s.content=cloneDeep(o.content,u);else if(o.content instanceof Xu.KeyValuePair)s.content=cloneDeep(o.content,u);else if(Array.isArray(o.content)){const mapper=o=>cloneDeep(o,u);s.content=o.content.map(mapper)}else s.content=o.content;else s.content=o.content;return s}throw new Ep(\"Value provided to cloneDeep function couldn't be cloned\",{value:o})};cloneDeep.safe=o=>{try{return cloneDeep(o)}catch{return o}};const cloneShallowKeyValuePair=o=>{const{key:s,value:i}=o;return new Xu.KeyValuePair(s,i)},cloneShallowElement=o=>{const s=new o.constructor;if(s.element=o.element,o.meta.length>0&&(s._meta=cloneDeep(o.meta)),o.attributes.length>0&&(s._attributes=cloneDeep(o.attributes)),sp(o.content)){const i=o.content;s.content=cloneShallowElement(i)}else Array.isArray(o.content)?s.content=[...o.content]:o.content instanceof Xu.KeyValuePair?s.content=cloneShallowKeyValuePair(o.content):s.content=o.content;return s},cloneShallow=o=>{if(o instanceof Xu.KeyValuePair)return cloneShallowKeyValuePair(o);if(o instanceof Xu.ot)return(o=>{const s=[...o];return new Xu.ot(s)})(o);if(o instanceof Xu.G6)return(o=>{const s=[...o];return new Xu.G6(s)})(o);if(sp(o))return cloneShallowElement(o);throw new wp(\"Value provided to cloneShallow function couldn't be cloned\",{value:o})};cloneShallow.safe=o=>{try{return cloneShallow(o)}catch{return o}};const visitor_getNodeType=o=>pp(o)?\"ObjectElement\":hp(o)?\"ArrayElement\":dp(o)?\"MemberElement\":ip(o)?\"StringElement\":up(o)?\"BooleanElement\":cp(o)?\"NumberElement\":lp(o)?\"NullElement\":fp(o)?\"LinkElement\":mp(o)?\"RefElement\":void 0,visitor_cloneNode=o=>sp(o)?cloneShallow(o):cloneNode(o),Sp=pipe(visitor_getNodeType,su),xp={ObjectElement:[\"content\"],ArrayElement:[\"content\"],MemberElement:[\"key\",\"value\"],StringElement:[],BooleanElement:[],NumberElement:[],NullElement:[],RefElement:[],LinkElement:[],Annotation:[],Comment:[],ParseResultElement:[\"content\"],SourceMap:[\"content\"]};class PredicateVisitor{result;predicate;returnOnTrue;returnOnFalse;constructor({predicate:o=es_F,returnOnTrue:s,returnOnFalse:i}={}){this.result=[],this.predicate=o,this.returnOnTrue=s,this.returnOnFalse=i}enter(o){return this.predicate(o)?(this.result.push(o),this.returnOnTrue):this.returnOnFalse}}const visitor_visit=(o,s,{keyMap:i=xp,...u}={})=>visit(o,s,{keyMap:i,nodeTypeGetter:visitor_getNodeType,nodePredicate:Sp,nodeCloneFn:visitor_cloneNode,...u});visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")]=async(o,s,{keyMap:i=xp,...u}={})=>visit[Symbol.for(\"nodejs.util.promisify.custom\")](o,s,{keyMap:i,nodeTypeGetter:visitor_getNodeType,nodePredicate:Sp,nodeCloneFn:visitor_cloneNode,...u});const nodeTypeGetter=o=>\"string\"==typeof(null==o?void 0:o.type)?o.type:visitor_getNodeType(o),kp={EphemeralObject:[\"content\"],EphemeralArray:[\"content\"],...xp},value_visitor_visit=(o,s,{keyMap:i=kp,...u}={})=>visitor_visit(o,s,{keyMap:i,nodeTypeGetter,nodePredicate:es_T,detectCycles:!1,deleteNodeSymbol:Symbol.for(\"delete-node\"),skipVisitingNodeSymbol:Symbol.for(\"skip-visiting-node\"),...u});value_visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")]=async(o,{keyMap:s=kp,...i}={})=>visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")](o,visitor,{keyMap:s,nodeTypeGetter,nodePredicate:es_T,detectCycles:!1,deleteNodeSymbol:Symbol.for(\"delete-node\"),skipVisitingNodeSymbol:Symbol.for(\"skip-visiting-node\"),...i});const Op=class EphemeralArray{type=\"EphemeralArray\";content=[];reference=void 0;constructor(o){this.content=o,this.reference=[]}toReference(){return this.reference}toArray(){return this.reference.push(...this.content),this.reference}};const Cp=class EphemeralObject{type=\"EphemeralObject\";content=[];reference=void 0;constructor(o){this.content=o,this.reference={}}toReference(){return this.reference}toObject(){return Object.assign(this.reference,Object.fromEntries(this.content))}};class Visitor{ObjectElement={enter:o=>{if(this.references.has(o))return this.references.get(o).toReference();const s=new Cp(o.content);return this.references.set(o,s),s}};EphemeralObject={leave:o=>o.toObject()};MemberElement={enter:o=>[o.key,o.value]};ArrayElement={enter:o=>{if(this.references.has(o))return this.references.get(o).toReference();const s=new Op(o.content);return this.references.set(o,s),s}};EphemeralArray={leave:o=>o.toArray()};references=new WeakMap;BooleanElement(o){return o.toValue()}NumberElement(o){return o.toValue()}StringElement(o){return o.toValue()}NullElement(){return null}RefElement(o,...s){var i;const u=s[3];return\"EphemeralObject\"===(null===(i=u[u.length-1])||void 0===i?void 0:i.type)?Symbol.for(\"delete-node\"):String(o.toValue())}LinkElement(o){return ip(o.href)?o.href.toValue():\"\"}}const serializers_value=o=>sp(o)?ip(o)||cp(o)||up(o)||lp(o)?o.toValue():value_visitor_visit(o,new Visitor):o;var Ap=_curry3((function mergeWithKey(o,s,i){var u,_={};for(u in i=i||{},s=s||{})_has(u,s)&&(_[u]=_has(u,i)?o(u,s[u],i[u]):s[u]);for(u in i)_has(u,i)&&!_has(u,_)&&(_[u]=i[u]);return _}));const jp=Ap;var Pp=_curry3((function mergeDeepWithKey(o,s,i){return jp((function(s,i,u){return _isObject(i)&&_isObject(u)?mergeDeepWithKey(o,i,u):o(s,i,u)}),s,i)}));const Ip=Pp;const Mp=_curry2((function mergeDeepRight(o,s){return Ip((function(o,s,i){return i}),o,s)}));const Np=_curry2(_path);const Tp=Jc(0,-1);var Rp=_curry2((function apply(o,s){return o.apply(this,s)}));const Dp=Rp;const Lp=Vl(eu);const Bp=_curry2((function and(o,s){return o&&s}));const Fp=_curry2((function both(o,s){return _isFunction(o)?function _both(){return o.apply(this,arguments)&&s.apply(this,arguments)}:$l(Bp)(o,s)}));var qp=_curry1((function empty(o){return null!=o&&\"function\"==typeof o[\"fantasy-land/empty\"]?o[\"fantasy-land/empty\"]():null!=o&&null!=o.constructor&&\"function\"==typeof o.constructor[\"fantasy-land/empty\"]?o.constructor[\"fantasy-land/empty\"]():null!=o&&\"function\"==typeof o.empty?o.empty():null!=o&&null!=o.constructor&&\"function\"==typeof o.constructor.empty?o.constructor.empty():gc(o)?[]:_isString(o)?\"\":_isObject(o)?{}:rc(o)?function(){return arguments}():function _isTypedArray(o){var s=Object.prototype.toString.call(o);return\"[object Uint8ClampedArray]\"===s||\"[object Int8Array]\"===s||\"[object Uint8Array]\"===s||\"[object Int16Array]\"===s||\"[object Uint16Array]\"===s||\"[object Int32Array]\"===s||\"[object Uint32Array]\"===s||\"[object Float32Array]\"===s||\"[object Float64Array]\"===s||\"[object BigInt64Array]\"===s||\"[object BigUint64Array]\"===s}(o)?o.constructor.from(\"\"):void 0}));const $p=qp;const Vp=_curry1((function isEmpty(o){return null!=o&&hc(o,$p(o))}));const Up=_l(1,eu(Array.isArray)?Array.isArray:pipe(pc,Xl(\"Array\")));const zp=Fp(Up,Vp);var Wp=_l(3,(function(o,s,i){var u=Np(o,i),_=Np(Tp(o),i);if(!Lp(u)&&!zp(o)){var w=Rc(u,_);return Dp(w,s)}}));const Kp=Wp;const Hp=hc(null);const Jp=Vl(Hp);function isOfTypeObject_typeof(o){return isOfTypeObject_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},isOfTypeObject_typeof(o)}const Gp=function isOfTypeObject(o){return\"object\"===isOfTypeObject_typeof(o)};const Yp=_l(1,Fp(Jp,Gp));var Xp=pipe(pc,Xl(\"Object\")),Qp=pipe(Oc,hc(Oc(Object))),Zp=Ja(Fp(eu,Qp),[\"constructor\"]),th=_l(1,(function(o){if(!Yp(o)||!Xp(o))return!1;var s=Object.getPrototypeOf(o);return!!Hp(s)||Zp(s)}));const rh=th;class Namespace extends Xu.g${constructor(){super(),this.register(\"annotation\",tp),this.register(\"comment\",rp),this.register(\"parseResult\",np),this.register(\"sourceMap\",op)}}const uh=new Namespace,createNamespace=o=>{const s=new Namespace;return rh(o)&&s.use(o),s},dh=uh,toolbox=()=>({predicates:{...ce},namespace:dh}),fh={toolboxCreator:toolbox,visitorOptions:{nodeTypeGetter:visitor_getNodeType,exposeEdits:!0}},dispatchPluginsSync=(o,s,i={})=>{if(0===s.length)return o;const u=Mp(fh,i),{toolboxCreator:_,visitorOptions:w}=u,x=_(),C=s.map((o=>o(x))),j=mergeAll(C.map(sl({},\"visitor\")),{...w});C.forEach(Kp([\"pre\"],[]));const L=visitor_visit(o,j,w);return C.forEach(Kp([\"post\"],[])),L};dispatchPluginsSync[Symbol.for(\"nodejs.util.promisify.custom\")]=async(o,s,i={})=>{if(0===s.length)return o;const u=Mp(fh,i),{toolboxCreator:_,visitorOptions:w}=u,x=_(),C=s.map((o=>o(x))),j=mergeAll[Symbol.for(\"nodejs.util.promisify.custom\")],L=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")],B=j(C.map(sl({},\"visitor\")),{...w});await Promise.allSettled(C.map(Kp([\"pre\"],[])));const $=await L(o,B,w);return await Promise.allSettled(C.map(Kp([\"post\"],[]))),$};const refract=(o,{Type:s,plugins:i=[]})=>{const u=new s(o);return sp(o)&&(o.meta.length>0&&(u.meta=cloneDeep(o.meta)),o.attributes.length>0&&(u.attributes=cloneDeep(o.attributes))),dispatchPluginsSync(u,i,{toolboxCreator:toolbox,visitorOptions:{nodeTypeGetter:visitor_getNodeType}})},createRefractor=o=>(s,i={})=>refract(s,{...i,Type:o});Xu.Sh.refract=createRefractor(Xu.Sh),Xu.wE.refract=createRefractor(Xu.wE),Xu.Om.refract=createRefractor(Xu.Om),Xu.bd.refract=createRefractor(Xu.bd),Xu.Os.refract=createRefractor(Xu.Os),Xu.kT.refract=createRefractor(Xu.kT),Xu.Ft.refract=createRefractor(Xu.Ft),Xu.sI.refract=createRefractor(Xu.sI),tp.refract=createRefractor(tp),rp.refract=createRefractor(rp),np.refract=createRefractor(np),op.refract=createRefractor(op);const computeEdges=(o,s=new WeakMap)=>(dp(o)?(s.set(o.key,o),computeEdges(o.key,s),s.set(o.value,o),computeEdges(o.value,s)):o.children.forEach((i=>{s.set(i,o),computeEdges(i,s)})),s);const vh=class Transcluder_Transcluder{element;edges;constructor({element:o}){this.element=o}transclude(o,s){var i;if(o===this.element)return s;if(o===s)return this.element;this.edges=null!==(i=this.edges)&&void 0!==i?i:computeEdges(this.element);const u=this.edges.get(o);return Wl(u)?void 0:(pp(u)?((o,s,i)=>{const u=i.get(o);pp(u)&&(u.content=u.map(((_,w,x)=>x===o?(i.delete(o),i.set(s,u),s):x)))})(o,s,this.edges):hp(u)?((o,s,i)=>{const u=i.get(o);hp(u)&&(u.content=u.map((_=>_===o?(i.delete(o),i.set(s,u),s):_)))})(o,s,this.edges):dp(u)&&((o,s,i)=>{const u=i.get(o);dp(u)&&(u.key===o&&(u.key=s,i.delete(o),i.set(s,u)),u.value===o&&(u.value=s,i.delete(o),i.set(s,u)))})(o,s,this.edges),this.element)}},_h=pipe(ru(/~/g,\"~0\"),ru(/\\//g,\"~1\"),encodeURIComponent);const wh=class JsonPointerError extends Fa{};const Oh=class CompilationJsonPointerError extends wh{tokens;constructor(o,s){super(o,s),void 0!==s&&(this.tokens=[...s.tokens])}},es_compile=o=>{try{return 0===o.length?\"\":`/${o.map(_h).join(\"/\")}`}catch(s){throw new Oh(\"JSON Pointer compilation of tokens encountered an error.\",{tokens:o,cause:s})}};var jh=_curry2((function converge(o,s){return _l(Kc(Hl,0,Gl(\"length\",s)),(function(){var i=arguments,u=this;return o.apply(u,_map((function(o){return o.apply(u,i)}),s))}))}));const Ph=jh;function _identity(o){return o}const Ih=_curry1(_identity);var Rh=Fp(_l(1,pipe(pc,Xl(\"Number\"))),isFinite);var Dh=_l(1,Rh);var Lh=Fp(eu(Number.isFinite)?_l(1,Rc(Number.isFinite,Number)):Dh,Ph(hc,[Math.floor,Ih]));var Fh=_l(1,Lh);const Kh=eu(Number.isInteger)?_l(1,Rc(Number.isInteger,Number)):Fh;var Hh=function(){function XTake(o,s){this.xf=s,this.n=o,this.i=0}return XTake.prototype[\"@@transducer/init\"]=_xfBase_init,XTake.prototype[\"@@transducer/result\"]=_xfBase_result,XTake.prototype[\"@@transducer/step\"]=function(o,s){this.i+=1;var i=0===this.n?o:this.xf[\"@@transducer/step\"](o,s);return this.n>=0&&this.i>=this.n?_reduced(i):i},XTake}();function _xtake(o){return function(s){return new Hh(o,s)}}const Jh=_curry2(_dispatchable([\"take\"],_xtake,(function take(o,s){return Jc(0,o<0?1/0:o,s)})));var Gh=_curry2((function(o,s){return hc(Jh(o.length,s),o)}));const Qh=Gh;const td=hc(\"\");var sd=function(){function XDropWhile(o,s){this.xf=s,this.f=o}return XDropWhile.prototype[\"@@transducer/init\"]=_xfBase_init,XDropWhile.prototype[\"@@transducer/result\"]=_xfBase_result,XDropWhile.prototype[\"@@transducer/step\"]=function(o,s){if(this.f){if(this.f(s))return o;this.f=null}return this.xf[\"@@transducer/step\"](o,s)},XDropWhile}();function _xdropWhile(o){return function(s){return new sd(o,s)}}const id=_curry2(_dispatchable([\"dropWhile\"],_xdropWhile,(function dropWhile(o,s){for(var i=0,u=s.length;i<u&&o(s[i]);)i+=1;return Jc(i,1/0,s)})));const cd=wl((function(o,s){return pipe(xl(\"\"),id(Pl(o)),Cl(\"\"))(s)})),ld=pipe(ru(/~1/g,\"/\"),ru(/~0/g,\"~\"),(o=>{try{return decodeURIComponent(o)}catch{return o}}));const ud=class InvalidJsonPointerError extends wh{pointer;constructor(o,s){super(o,s),void 0!==s&&(this.pointer=s.pointer)}},uriToPointer=o=>{const s=(o=>{const s=o.indexOf(\"#\");return-1!==s?o.substring(s):\"#\"})(o);return cd(\"#\",s)},es_parse=o=>{if(td(o))return[];if(!Qh(\"/\",o))throw new ud(`Invalid JSON Pointer \"${o}\". JSON Pointers must begin with \"/\"`,{pointer:o});try{const s=pipe(xl(\"/\"),Rl(ld))(o);return Gc(s)}catch(s){throw new ud(`JSON Pointer parsing of \"${o}\" encountered an error.`,{pointer:o,cause:s})}};const dd=class EvaluationJsonPointerError extends wh{pointer;tokens;failedToken;failedTokenPosition;element;constructor(o,s){super(o,s),void 0!==s&&(this.pointer=s.pointer,Array.isArray(s.tokens)&&(this.tokens=[...s.tokens]),this.failedToken=s.failedToken,this.failedTokenPosition=s.failedTokenPosition,this.element=s.element)}},es_evaluate=(o,s)=>{let i;try{i=es_parse(o)}catch(i){throw new dd(`JSON Pointer evaluation failed while parsing the pointer \"${o}\".`,{pointer:o,element:cloneDeep(s),cause:i})}return i.reduce(((s,u,_)=>{if(pp(s)){if(!s.hasKey(u))throw new dd(`JSON Pointer evaluation failed while evaluating token \"${u}\" against an ObjectElement`,{pointer:o,tokens:i,failedToken:u,failedTokenPosition:_,element:cloneDeep(s)});return s.get(u)}if(hp(s)){if(!(u in s.content)||!Kh(Number(u)))throw new dd(`JSON Pointer evaluation failed while evaluating token \"${u}\" against an ArrayElement`,{pointer:o,tokens:i,failedToken:u,failedTokenPosition:_,element:cloneDeep(s)});return s.get(Number(u))}throw new dd(`JSON Pointer evaluation failed while evaluating token \"${u}\" against an unexpected Element`,{pointer:o,tokens:i,failedToken:u,failedTokenPosition:_,element:cloneDeep(s)})}),s)};class Callback extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"callback\"}}const md=Callback;class Components extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"components\"}get schemas(){return this.get(\"schemas\")}set schemas(o){this.set(\"schemas\",o)}get responses(){return this.get(\"responses\")}set responses(o){this.set(\"responses\",o)}get parameters(){return this.get(\"parameters\")}set parameters(o){this.set(\"parameters\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get requestBodies(){return this.get(\"requestBodies\")}set requestBodies(o){this.set(\"requestBodies\",o)}get headers(){return this.get(\"headers\")}set headers(o){this.set(\"headers\",o)}get securitySchemes(){return this.get(\"securitySchemes\")}set securitySchemes(o){this.set(\"securitySchemes\",o)}get links(){return this.get(\"links\")}set links(o){this.set(\"links\",o)}get callbacks(){return this.get(\"callbacks\")}set callbacks(o){this.set(\"callbacks\",o)}}const yd=Components;class Contact extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"contact\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get url(){return this.get(\"url\")}set url(o){this.set(\"url\",o)}get email(){return this.get(\"email\")}set email(o){this.set(\"email\",o)}}const vd=Contact;class Discriminator extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"discriminator\"}get propertyName(){return this.get(\"propertyName\")}set propertyName(o){this.set(\"propertyName\",o)}get mapping(){return this.get(\"mapping\")}set mapping(o){this.set(\"mapping\",o)}}const _d=Discriminator;class Encoding extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"encoding\"}get contentType(){return this.get(\"contentType\")}set contentType(o){this.set(\"contentType\",o)}get headers(){return this.get(\"headers\")}set headers(o){this.set(\"headers\",o)}get style(){return this.get(\"style\")}set style(o){this.set(\"style\",o)}get explode(){return this.get(\"explode\")}set explode(o){this.set(\"explode\",o)}get allowedReserved(){return this.get(\"allowedReserved\")}set allowedReserved(o){this.set(\"allowedReserved\",o)}}const Ed=Encoding;class Example extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"example\"}get summary(){return this.get(\"summary\")}set summary(o){this.set(\"summary\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get value(){return this.get(\"value\")}set value(o){this.set(\"value\",o)}get externalValue(){return this.get(\"externalValue\")}set externalValue(o){this.set(\"externalValue\",o)}}const wd=Example;class ExternalDocumentation extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"externalDocumentation\"}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get url(){return this.get(\"url\")}set url(o){this.set(\"url\",o)}}const Sd=ExternalDocumentation;class Header extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"header\"}get required(){return this.hasKey(\"required\")?this.get(\"required\"):new Xu.bd(!1)}set required(o){this.set(\"required\",o)}get deprecated(){return this.hasKey(\"deprecated\")?this.get(\"deprecated\"):new Xu.bd(!1)}set deprecated(o){this.set(\"deprecated\",o)}get allowEmptyValue(){return this.get(\"allowEmptyValue\")}set allowEmptyValue(o){this.set(\"allowEmptyValue\",o)}get style(){return this.get(\"style\")}set style(o){this.set(\"style\",o)}get explode(){return this.get(\"explode\")}set explode(o){this.set(\"explode\",o)}get allowReserved(){return this.get(\"allowReserved\")}set allowReserved(o){this.set(\"allowReserved\",o)}get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get contentProp(){return this.get(\"content\")}set contentProp(o){this.set(\"content\",o)}}Object.defineProperty(Header.prototype,\"description\",{get(){return this.get(\"description\")},set(o){this.set(\"description\",o)},enumerable:!0});const xd=Header;class Info extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"info\",this.classes.push(\"info\")}get title(){return this.get(\"title\")}set title(o){this.set(\"title\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get termsOfService(){return this.get(\"termsOfService\")}set termsOfService(o){this.set(\"termsOfService\",o)}get contact(){return this.get(\"contact\")}set contact(o){this.set(\"contact\",o)}get license(){return this.get(\"license\")}set license(o){this.set(\"license\",o)}get version(){return this.get(\"version\")}set version(o){this.set(\"version\",o)}}const kd=Info;class License extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"license\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get url(){return this.get(\"url\")}set url(o){this.set(\"url\",o)}}const Od=License;class Link extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"link\"}get operationRef(){return this.get(\"operationRef\")}set operationRef(o){this.set(\"operationRef\",o)}get operationId(){return this.get(\"operationId\")}set operationId(o){this.set(\"operationId\",o)}get operation(){var o,s;return ip(this.operationRef)?null===(o=this.operationRef)||void 0===o?void 0:o.meta.get(\"operation\"):ip(this.operationId)?null===(s=this.operationId)||void 0===s?void 0:s.meta.get(\"operation\"):void 0}set operation(o){this.set(\"operation\",o)}get parameters(){return this.get(\"parameters\")}set parameters(o){this.set(\"parameters\",o)}get requestBody(){return this.get(\"requestBody\")}set requestBody(o){this.set(\"requestBody\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get server(){return this.get(\"server\")}set server(o){this.set(\"server\",o)}}const Cd=Link;class MediaType extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"mediaType\"}get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get encoding(){return this.get(\"encoding\")}set encoding(o){this.set(\"encoding\",o)}}const Ad=MediaType;class OAuthFlow extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"oAuthFlow\"}get authorizationUrl(){return this.get(\"authorizationUrl\")}set authorizationUrl(o){this.set(\"authorizationUrl\",o)}get tokenUrl(){return this.get(\"tokenUrl\")}set tokenUrl(o){this.set(\"tokenUrl\",o)}get refreshUrl(){return this.get(\"refreshUrl\")}set refreshUrl(o){this.set(\"refreshUrl\",o)}get scopes(){return this.get(\"scopes\")}set scopes(o){this.set(\"scopes\",o)}}const Id=OAuthFlow;class OAuthFlows extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"oAuthFlows\"}get implicit(){return this.get(\"implicit\")}set implicit(o){this.set(\"implicit\",o)}get password(){return this.get(\"password\")}set password(o){this.set(\"password\",o)}get clientCredentials(){return this.get(\"clientCredentials\")}set clientCredentials(o){this.set(\"clientCredentials\",o)}get authorizationCode(){return this.get(\"authorizationCode\")}set authorizationCode(o){this.set(\"authorizationCode\",o)}}const Md=OAuthFlows;class Openapi extends Xu.Om{constructor(o,s,i){super(o,s,i),this.element=\"openapi\",this.classes.push(\"spec-version\"),this.classes.push(\"version\")}}const Nd=Openapi;class OpenApi3_0 extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"openApi3_0\",this.classes.push(\"api\")}get openapi(){return this.get(\"openapi\")}set openapi(o){this.set(\"openapi\",o)}get info(){return this.get(\"info\")}set info(o){this.set(\"info\",o)}get servers(){return this.get(\"servers\")}set servers(o){this.set(\"servers\",o)}get paths(){return this.get(\"paths\")}set paths(o){this.set(\"paths\",o)}get components(){return this.get(\"components\")}set components(o){this.set(\"components\",o)}get security(){return this.get(\"security\")}set security(o){this.set(\"security\",o)}get tags(){return this.get(\"tags\")}set tags(o){this.set(\"tags\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}}const Td=OpenApi3_0;class Operation extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"operation\"}get tags(){return this.get(\"tags\")}set tags(o){this.set(\"tags\",o)}get summary(){return this.get(\"summary\")}set summary(o){this.set(\"summary\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}set externalDocs(o){this.set(\"externalDocs\",o)}get externalDocs(){return this.get(\"externalDocs\")}get operationId(){return this.get(\"operationId\")}set operationId(o){this.set(\"operationId\",o)}get parameters(){return this.get(\"parameters\")}set parameters(o){this.set(\"parameters\",o)}get requestBody(){return this.get(\"requestBody\")}set requestBody(o){this.set(\"requestBody\",o)}get responses(){return this.get(\"responses\")}set responses(o){this.set(\"responses\",o)}get callbacks(){return this.get(\"callbacks\")}set callbacks(o){this.set(\"callbacks\",o)}get deprecated(){return this.hasKey(\"deprecated\")?this.get(\"deprecated\"):new Xu.bd(!1)}set deprecated(o){this.set(\"deprecated\",o)}get security(){return this.get(\"security\")}set security(o){this.set(\"security\",o)}get servers(){return this.get(\"severs\")}set servers(o){this.set(\"servers\",o)}}const Rd=Operation;class Parameter extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"parameter\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get in(){return this.get(\"in\")}set in(o){this.set(\"in\",o)}get required(){return this.hasKey(\"required\")?this.get(\"required\"):new Xu.bd(!1)}set required(o){this.set(\"required\",o)}get deprecated(){return this.hasKey(\"deprecated\")?this.get(\"deprecated\"):new Xu.bd(!1)}set deprecated(o){this.set(\"deprecated\",o)}get allowEmptyValue(){return this.get(\"allowEmptyValue\")}set allowEmptyValue(o){this.set(\"allowEmptyValue\",o)}get style(){return this.get(\"style\")}set style(o){this.set(\"style\",o)}get explode(){return this.get(\"explode\")}set explode(o){this.set(\"explode\",o)}get allowReserved(){return this.get(\"allowReserved\")}set allowReserved(o){this.set(\"allowReserved\",o)}get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get contentProp(){return this.get(\"content\")}set contentProp(o){this.set(\"content\",o)}}Object.defineProperty(Parameter.prototype,\"description\",{get(){return this.get(\"description\")},set(o){this.set(\"description\",o)},enumerable:!0});const Dd=Parameter;class PathItem extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"pathItem\"}get $ref(){return this.get(\"$ref\")}set $ref(o){this.set(\"$ref\",o)}get summary(){return this.get(\"summary\")}set summary(o){this.set(\"summary\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get GET(){return this.get(\"get\")}set GET(o){this.set(\"GET\",o)}get PUT(){return this.get(\"put\")}set PUT(o){this.set(\"PUT\",o)}get POST(){return this.get(\"post\")}set POST(o){this.set(\"POST\",o)}get DELETE(){return this.get(\"delete\")}set DELETE(o){this.set(\"DELETE\",o)}get OPTIONS(){return this.get(\"options\")}set OPTIONS(o){this.set(\"OPTIONS\",o)}get HEAD(){return this.get(\"head\")}set HEAD(o){this.set(\"HEAD\",o)}get PATCH(){return this.get(\"patch\")}set PATCH(o){this.set(\"PATCH\",o)}get TRACE(){return this.get(\"trace\")}set TRACE(o){this.set(\"TRACE\",o)}get servers(){return this.get(\"servers\")}set servers(o){this.set(\"servers\",o)}get parameters(){return this.get(\"parameters\")}set parameters(o){this.set(\"parameters\",o)}}const Ld=PathItem;class Paths extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"paths\"}}const Bd=Paths;class Reference extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"reference\",this.classes.push(\"openapi-reference\")}get $ref(){return this.get(\"$ref\")}set $ref(o){this.set(\"$ref\",o)}}const Fd=Reference;class RequestBody extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"requestBody\"}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get contentProp(){return this.get(\"content\")}set contentProp(o){this.set(\"content\",o)}get required(){return this.hasKey(\"required\")?this.get(\"required\"):new Xu.bd(!1)}set required(o){this.set(\"required\",o)}}const $d=RequestBody;class Response_Response extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"response\"}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get headers(){return this.get(\"headers\")}set headers(o){this.set(\"headers\",o)}get contentProp(){return this.get(\"content\")}set contentProp(o){this.set(\"content\",o)}get links(){return this.get(\"links\")}set links(o){this.set(\"links\",o)}}const Vd=Response_Response;class Responses extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"responses\"}get default(){return this.get(\"default\")}set default(o){this.set(\"default\",o)}}const Ud=Responses;const Wd=class UnsupportedOperationError extends Ba{};class JSONSchema extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"JSONSchemaDraft4\"}get idProp(){return this.get(\"id\")}set idProp(o){this.set(\"id\",o)}get $schema(){return this.get(\"$schema\")}set $schema(o){this.set(\"$schema\",o)}get multipleOf(){return this.get(\"multipleOf\")}set multipleOf(o){this.set(\"multipleOf\",o)}get maximum(){return this.get(\"maximum\")}set maximum(o){this.set(\"maximum\",o)}get exclusiveMaximum(){return this.get(\"exclusiveMaximum\")}set exclusiveMaximum(o){this.set(\"exclusiveMaximum\",o)}get minimum(){return this.get(\"minimum\")}set minimum(o){this.set(\"minimum\",o)}get exclusiveMinimum(){return this.get(\"exclusiveMinimum\")}set exclusiveMinimum(o){this.set(\"exclusiveMinimum\",o)}get maxLength(){return this.get(\"maxLength\")}set maxLength(o){this.set(\"maxLength\",o)}get minLength(){return this.get(\"minLength\")}set minLength(o){this.set(\"minLength\",o)}get pattern(){return this.get(\"pattern\")}set pattern(o){this.set(\"pattern\",o)}get additionalItems(){return this.get(\"additionalItems\")}set additionalItems(o){this.set(\"additionalItems\",o)}get items(){return this.get(\"items\")}set items(o){this.set(\"items\",o)}get maxItems(){return this.get(\"maxItems\")}set maxItems(o){this.set(\"maxItems\",o)}get minItems(){return this.get(\"minItems\")}set minItems(o){this.set(\"minItems\",o)}get uniqueItems(){return this.get(\"uniqueItems\")}set uniqueItems(o){this.set(\"uniqueItems\",o)}get maxProperties(){return this.get(\"maxProperties\")}set maxProperties(o){this.set(\"maxProperties\",o)}get minProperties(){return this.get(\"minProperties\")}set minProperties(o){this.set(\"minProperties\",o)}get required(){return this.get(\"required\")}set required(o){this.set(\"required\",o)}get properties(){return this.get(\"properties\")}set properties(o){this.set(\"properties\",o)}get additionalProperties(){return this.get(\"additionalProperties\")}set additionalProperties(o){this.set(\"additionalProperties\",o)}get patternProperties(){return this.get(\"patternProperties\")}set patternProperties(o){this.set(\"patternProperties\",o)}get dependencies(){return this.get(\"dependencies\")}set dependencies(o){this.set(\"dependencies\",o)}get enum(){return this.get(\"enum\")}set enum(o){this.set(\"enum\",o)}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}get allOf(){return this.get(\"allOf\")}set allOf(o){this.set(\"allOf\",o)}get anyOf(){return this.get(\"anyOf\")}set anyOf(o){this.set(\"anyOf\",o)}get oneOf(){return this.get(\"oneOf\")}set oneOf(o){this.set(\"oneOf\",o)}get not(){return this.get(\"not\")}set not(o){this.set(\"not\",o)}get definitions(){return this.get(\"definitions\")}set definitions(o){this.set(\"definitions\",o)}get title(){return this.get(\"title\")}set title(o){this.set(\"title\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get default(){return this.get(\"default\")}set default(o){this.set(\"default\",o)}get format(){return this.get(\"format\")}set format(o){this.set(\"format\",o)}get base(){return this.get(\"base\")}set base(o){this.set(\"base\",o)}get links(){return this.get(\"links\")}set links(o){this.set(\"links\",o)}get media(){return this.get(\"media\")}set media(o){this.set(\"media\",o)}get readOnly(){return this.get(\"readOnly\")}set readOnly(o){this.set(\"readOnly\",o)}}const Kd=JSONSchema;class JSONReference extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"JSONReference\",this.classes.push(\"json-reference\")}get $ref(){return this.get(\"$ref\")}set $ref(o){this.set(\"$ref\",o)}}const Hd=JSONReference;class Media extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"media\"}get binaryEncoding(){return this.get(\"binaryEncoding\")}set binaryEncoding(o){this.set(\"binaryEncoding\",o)}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}}const Jd=Media;class LinkDescription extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"linkDescription\"}get href(){return this.get(\"href\")}set href(o){this.set(\"href\",o)}get rel(){return this.get(\"rel\")}set rel(o){this.set(\"rel\",o)}get title(){return this.get(\"title\")}set title(o){this.set(\"title\",o)}get targetSchema(){return this.get(\"targetSchema\")}set targetSchema(o){this.set(\"targetSchema\",o)}get mediaType(){return this.get(\"mediaType\")}set mediaType(o){this.set(\"mediaType\",o)}get method(){return this.get(\"method\")}set method(o){this.set(\"method\",o)}get encType(){return this.get(\"encType\")}set encType(o){this.set(\"encType\",o)}get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}}const Gd=LinkDescription;var Yd=_curry2((function mapObjIndexed(o,s){return _arrayReduce((function(i,u){return i[u]=o(s[u],u,s),i}),{},lc(s))}));const Xd=Yd;const Qd=_curry1((function isNil(o){return null==o}));var Zd=_curry2((function hasPath(o,s){if(0===o.length||Qd(s))return!1;for(var i=s,u=0;u<o.length;){if(Qd(i)||!_has(o[u],i))return!1;i=i[o[u]],u+=1}return!0}));const ef=Zd;var rf=_curry2((function has(o,s){return ef([o],s)}));const of=rf;const af=_curry3((function propSatisfies(o,s,i){return o(tl(s,i))})),dereference=(o,s)=>{const i=Qc(o,s);return Xd((o=>{if(rh(o)&&of(\"$ref\",o)&&af(su,\"$ref\",o)){const s=Np([\"$ref\"],o),u=cd(\"#/\",s);return Np(u.split(\"/\"),i)}return rh(o)?dereference(o,i):o}),o)},emptyElement=o=>{const s=o.meta.length>0?cloneDeep(o.meta):void 0,i=o.attributes.length>0?cloneDeep(o.attributes):void 0;return new o.constructor(void 0,s,i)},cloneUnlessOtherwiseSpecified=(o,s)=>s.clone&&s.isMergeableElement(o)?deepmerge(emptyElement(o),o,s):o,getMetaMergeFunction=o=>\"function\"!=typeof o.customMetaMerge?o=>cloneDeep(o):o.customMetaMerge,getAttributesMergeFunction=o=>\"function\"!=typeof o.customAttributesMerge?o=>cloneDeep(o):o.customAttributesMerge,cf={clone:!0,isMergeableElement:o=>pp(o)||hp(o),arrayElementMerge:(o,s,i)=>o.concat(s)[\"fantasy-land/map\"]((o=>cloneUnlessOtherwiseSpecified(o,i))),objectElementMerge:(o,s,i)=>{const u=pp(o)?emptyElement(o):emptyElement(s);return pp(o)&&o.forEach(((o,s,_)=>{const w=cloneShallow(_);w.value=cloneUnlessOtherwiseSpecified(o,i),u.content.push(w)})),s.forEach(((s,_,w)=>{const x=serializers_value(_);let C;if(pp(o)&&o.hasKey(x)&&i.isMergeableElement(s)){const u=o.get(x);C=cloneShallow(w),C.value=((o,s)=>{if(\"function\"!=typeof s.customMerge)return deepmerge;const i=s.customMerge(o,s);return\"function\"==typeof i?i:deepmerge})(_,i)(u,s)}else C=cloneShallow(w),C.value=cloneUnlessOtherwiseSpecified(s,i);u.remove(x),u.content.push(C)})),u},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0};function deepmerge(o,s,i){var u,_,w;const x={...cf,...i};x.isMergeableElement=null!==(u=x.isMergeableElement)&&void 0!==u?u:cf.isMergeableElement,x.arrayElementMerge=null!==(_=x.arrayElementMerge)&&void 0!==_?_:cf.arrayElementMerge,x.objectElementMerge=null!==(w=x.objectElementMerge)&&void 0!==w?w:cf.objectElementMerge;const C=hp(s);if(!(C===hp(o)))return cloneUnlessOtherwiseSpecified(s,x);const j=C&&\"function\"==typeof x.arrayElementMerge?x.arrayElementMerge(o,s,x):x.objectElementMerge(o,s,x);return j.meta=getMetaMergeFunction(x)(o.meta,s.meta),j.attributes=getAttributesMergeFunction(x)(o.attributes,s.attributes),j}deepmerge.all=(o,s)=>{if(!Array.isArray(o))throw new TypeError(\"First argument of deepmerge should be an array.\");return 0===o.length?new Xu.Sh:o.reduce(((o,i)=>deepmerge(o,i,s)),emptyElement(o[0]))};const lf=class Visitor_Visitor{element;constructor(o){Object.assign(this,o)}copyMetaAndAttributes(o,s){(o.meta.length>0||s.meta.length>0)&&(s.meta=deepmerge(s.meta,o.meta),hasElementSourceMap(o)&&s.meta.set(\"sourceMap\",o.meta.get(\"sourceMap\"))),(o.attributes.length>0||o.meta.length>0)&&(s.attributes=deepmerge(s.attributes,o.attributes))}};const uf=class FallbackVisitor extends lf{enter(o){return this.element=cloneDeep(o),Yu}},copyProps=(o,s,i=[])=>{const u=Object.getOwnPropertyDescriptors(s);for(let o of i)delete u[o];Object.defineProperties(o,u)},protoChain=(o,s=[o])=>{const i=Object.getPrototypeOf(o);return null===i?s:protoChain(i,[...s,i])},hardMixProtos=(o,s,i=[])=>{var u;const _=null!==(u=((...o)=>{if(0===o.length)return;let s;const i=o.map((o=>protoChain(o)));for(;i.every((o=>o.length>0));){const o=i.map((o=>o.pop())),u=o[0];if(!o.every((o=>o===u)))break;s=u}return s})(...o))&&void 0!==u?u:Object.prototype,w=Object.create(_),x=protoChain(_);for(let s of o){let o=protoChain(s);for(let s=o.length-1;s>=0;s--){let u=o[s];-1===x.indexOf(u)&&(copyProps(w,u,[\"constructor\",...i]),x.push(u))}}return w.constructor=s,w},unique=o=>o.filter(((s,i)=>o.indexOf(s)==i)),getIngredientWithProp=(o,s)=>{const i=s.map((o=>protoChain(o)));let u=0,_=!0;for(;_;){_=!1;for(let w=s.length-1;w>=0;w--){const s=i[w][u];if(null!=s&&(_=!0,null!=Object.getOwnPropertyDescriptor(s,o)))return i[w][0]}u++}},proxyMix=(o,s=Object.prototype)=>new Proxy({},{getPrototypeOf:()=>s,setPrototypeOf(){throw Error(\"Cannot set prototype of Proxies created by ts-mixer\")},getOwnPropertyDescriptor:(s,i)=>Object.getOwnPropertyDescriptor(getIngredientWithProp(i,o)||{},i),defineProperty(){throw new Error(\"Cannot define new properties on Proxies created by ts-mixer\")},has:(i,u)=>void 0!==getIngredientWithProp(u,o)||void 0!==s[u],get:(i,u)=>(getIngredientWithProp(u,o)||s)[u],set(s,i,u){const _=getIngredientWithProp(i,o);if(void 0===_)throw new Error(\"Cannot set new properties on Proxies created by ts-mixer\");return _[i]=u,!0},deleteProperty(){throw new Error(\"Cannot delete properties on Proxies created by ts-mixer\")},ownKeys:()=>o.map(Object.getOwnPropertyNames).reduce(((o,s)=>s.concat(o.filter((o=>s.indexOf(o)<0)))))}),hf=null,df=\"copy\",mf=\"copy\",gf=\"deep\",yf=new WeakMap,getMixinsForClass=o=>yf.get(o),mergeObjectsOfDecorators=(o,s)=>{var i,u;const _=unique([...Object.getOwnPropertyNames(o),...Object.getOwnPropertyNames(s)]),w={};for(let x of _)w[x]=unique([...null!==(i=null==o?void 0:o[x])&&void 0!==i?i:[],...null!==(u=null==s?void 0:s[x])&&void 0!==u?u:[]]);return w},mergePropertyAndMethodDecorators=(o,s)=>{var i,u,_,w;return{property:mergeObjectsOfDecorators(null!==(i=null==o?void 0:o.property)&&void 0!==i?i:{},null!==(u=null==s?void 0:s.property)&&void 0!==u?u:{}),method:mergeObjectsOfDecorators(null!==(_=null==o?void 0:o.method)&&void 0!==_?_:{},null!==(w=null==s?void 0:s.method)&&void 0!==w?w:{})}},mergeDecorators=(o,s)=>{var i,u,_,w,x,C;return{class:unique([...null!==(i=null==o?void 0:o.class)&&void 0!==i?i:[],...null!==(u=null==s?void 0:s.class)&&void 0!==u?u:[]]),static:mergePropertyAndMethodDecorators(null!==(_=null==o?void 0:o.static)&&void 0!==_?_:{},null!==(w=null==s?void 0:s.static)&&void 0!==w?w:{}),instance:mergePropertyAndMethodDecorators(null!==(x=null==o?void 0:o.instance)&&void 0!==x?x:{},null!==(C=null==s?void 0:s.instance)&&void 0!==C?C:{})}},bf=new Map,deepDecoratorSearch=(...o)=>{const s=((...o)=>{var s;const i=new Set,u=new Set([...o]);for(;u.size>0;)for(let o of u){const _=protoChain(o.prototype).map((o=>o.constructor)),w=[..._,...null!==(s=getMixinsForClass(o))&&void 0!==s?s:[]].filter((o=>!i.has(o)));for(let o of w)u.add(o);i.add(o),u.delete(o)}return[...i]})(...o).map((o=>bf.get(o))).filter((o=>!!o));return 0==s.length?{}:1==s.length?s[0]:s.reduce(((o,s)=>mergeDecorators(o,s)))},getDecoratorsForClass=o=>{let s=bf.get(o);return s||(s={},bf.set(o,s)),s};function Mixin(...o){var s,i,u;const _=o.map((o=>o.prototype)),w=hf;if(null!==w){const o=_.map((o=>o[w])).filter((o=>\"function\"==typeof o)),combinedInitFunction=function(...s){for(let i of o)i.apply(this,s)},s={[w]:combinedInitFunction};_.push(s)}function MixedClass(...s){for(const i of o)copyProps(this,new i(...s));null!==w&&\"function\"==typeof this[w]&&this[w].apply(this,s)}var x,C;MixedClass.prototype=\"copy\"===mf?hardMixProtos(_,MixedClass):(x=_,C=MixedClass,proxyMix([...x,{constructor:C}])),Object.setPrototypeOf(MixedClass,\"copy\"===df?hardMixProtos(o,null,[\"prototype\"]):proxyMix(o,Function.prototype));let j=MixedClass;if(\"none\"!==gf){const _=\"deep\"===gf?deepDecoratorSearch(...o):((...o)=>{const s=o.map((o=>getDecoratorsForClass(o)));return 0===s.length?{}:1===s.length?s[0]:s.reduce(((o,s)=>mergeDecorators(o,s)))})(...o);for(let o of null!==(s=null==_?void 0:_.class)&&void 0!==s?s:[]){const s=o(j);s&&(j=s)}applyPropAndMethodDecorators(null!==(i=null==_?void 0:_.static)&&void 0!==i?i:{},j),applyPropAndMethodDecorators(null!==(u=null==_?void 0:_.instance)&&void 0!==u?u:{},j.prototype)}var L,B;return L=j,B=o,yf.set(L,B),j}const applyPropAndMethodDecorators=(o,s)=>{const i=o.property,u=o.method;if(i)for(let o in i)for(let u of i[o])u(s,o);if(u)for(let o in u)for(let i of u[o])i(s,o,Object.getOwnPropertyDescriptor(s,o))};const _f=_curry2((function pick(o,s){for(var i={},u=0;u<o.length;)o[u]in s&&(i[o[u]]=s[o[u]]),u+=1;return i}));const Sf=class SpecificationVisitor extends lf{specObj;passingOptionsNames=[\"specObj\"];constructor({specObj:o,...s}){super({...s}),this.specObj=o}retrievePassingOptions(){return _f(this.passingOptionsNames,this)}retrieveFixedFields(o){const s=Np([\"visitors\",...o,\"fixedFields\"],this.specObj);return\"object\"==typeof s&&null!==s?Object.keys(s):[]}retrieveVisitor(o){return Ja(eu,[\"visitors\",...o],this.specObj)?Np([\"visitors\",...o],this.specObj):Np([\"visitors\",...o,\"$visitor\"],this.specObj)}retrieveVisitorInstance(o,s={}){const i=this.retrievePassingOptions();return new(this.retrieveVisitor(o))({...i,...s})}toRefractedElement(o,s,i={}){const u=this.retrieveVisitorInstance(o,i);return u instanceof uf&&(null==u?void 0:u.constructor)===uf?cloneDeep(s):(visitor_visit(s,u,i),u.element)}};const xf=class FixedFieldsVisitor extends Sf{specPath;ignoredFields;constructor({specPath:o,ignoredFields:s,...i}){super({...i}),this.specPath=o,this.ignoredFields=s||[]}ObjectElement(o){const s=this.specPath(o),i=this.retrieveFixedFields(s);return o.forEach(((o,u,_)=>{if(ip(u)&&i.includes(serializers_value(u))&&!this.ignoredFields.includes(serializers_value(u))){const i=this.toRefractedElement([...s,\"fixedFields\",serializers_value(u)],o),w=new Xu.Pr(cloneDeep(u),i);this.copyMetaAndAttributes(_,w),w.classes.push(\"fixed-field\"),this.element.content.push(w)}else this.ignoredFields.includes(serializers_value(u))||this.element.content.push(cloneDeep(_))})),this.copyMetaAndAttributes(o,this.element),Yu}};class JSONSchemaVisitor extends(Mixin(xf,uf)){constructor(o){super(o),this.element=new Kd,this.specPath=Ul([\"document\",\"objects\",\"JSONSchema\"])}}const kf=JSONSchemaVisitor;const Of=class ParentSchemaAwareVisitor{parent;constructor({parent:o}){this.parent=o}},isJSONReferenceLikeElement=o=>pp(o)&&o.hasKey(\"$ref\");class ItemsVisitor extends(Mixin(Sf,Of,uf)){ObjectElement(o){const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"];return this.element=this.toRefractedElement(s,o),Yu}ArrayElement(o){return this.element=new Xu.wE,this.element.classes.push(\"json-schema-items\"),o.forEach((o=>{const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const Cf=ItemsVisitor;const jf=class RequiredVisitor extends uf{ArrayElement(o){const s=this.enter(o);return this.element.classes.push(\"json-schema-required\"),s}};const Pf=_curry1((function allPass(o){return _l(Kc(Hl,0,Gl(\"length\",o)),(function(){for(var s=0,i=o.length;s<i;){if(!o[s].apply(this,arguments))return!1;s+=1}return!0}))}));const Nf=_curry1((function isNotEmpty(o){return!Vp(o)}));const Tf=_curry2((function or(o,s){return o||s}));var Rf=Vl(_l(1,Fp(Jp,_curry2((function either(o,s){return _isFunction(o)?function _either(){return o.apply(this,arguments)||s.apply(this,arguments)}:$l(Tf)(o,s)}))(Gp,eu))));const Df=Pf([su,Rf,Nf]);const Ff=class PatternedFieldsVisitor extends Sf{specPath;ignoredFields;fieldPatternPredicate=es_F;constructor({specPath:o,ignoredFields:s,fieldPatternPredicate:i,...u}){super({...u}),this.specPath=o,this.ignoredFields=s||[],\"function\"==typeof i&&(this.fieldPatternPredicate=i)}ObjectElement(o){return o.forEach(((o,s,i)=>{if(!this.ignoredFields.includes(serializers_value(s))&&this.fieldPatternPredicate(serializers_value(s))){const u=this.specPath(o),_=this.toRefractedElement(u,o),w=new Xu.Pr(cloneDeep(s),_);this.copyMetaAndAttributes(i,w),w.classes.push(\"patterned-field\"),this.element.content.push(w)}else this.ignoredFields.includes(serializers_value(s))||this.element.content.push(cloneDeep(i))})),this.copyMetaAndAttributes(o,this.element),Yu}};const Vf=class MapVisitor extends Ff{constructor(o){super(o),this.fieldPatternPredicate=Df}};class PropertiesVisitor extends(Mixin(Vf,Of,uf)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-properties\"),this.specPath=o=>isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"]}}const Wf=PropertiesVisitor;class PatternPropertiesVisitor extends(Mixin(Vf,Of,uf)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-patternProperties\"),this.specPath=o=>isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"]}}const Hf=PatternPropertiesVisitor;class DependenciesVisitor extends(Mixin(Vf,Of,uf)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-dependencies\"),this.specPath=o=>isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"]}}const Jf=DependenciesVisitor;const Gf=class EnumVisitor extends uf{ArrayElement(o){const s=this.enter(o);return this.element.classes.push(\"json-schema-enum\"),s}};const Xf=class TypeVisitor extends uf{StringElement(o){const s=this.enter(o);return this.element.classes.push(\"json-schema-type\"),s}ArrayElement(o){const s=this.enter(o);return this.element.classes.push(\"json-schema-type\"),s}};class AllOfVisitor extends(Mixin(Sf,Of,uf)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-allOf\")}ArrayElement(o){return o.forEach((o=>{const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const Qf=AllOfVisitor;class AnyOfVisitor extends(Mixin(Sf,Of,uf)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-anyOf\")}ArrayElement(o){return o.forEach((o=>{const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const em=AnyOfVisitor;class OneOfVisitor extends(Mixin(Sf,Of,uf)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-oneOf\")}ArrayElement(o){return o.forEach((o=>{const s=isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const tm=OneOfVisitor;class DefinitionsVisitor extends(Mixin(Vf,Of,uf)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-definitions\"),this.specPath=o=>isJSONReferenceLikeElement(o)?[\"document\",\"objects\",\"JSONReference\"]:[\"document\",\"objects\",\"JSONSchema\"]}}const rm=DefinitionsVisitor;class LinksVisitor extends(Mixin(Sf,Of,uf)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-links\")}ArrayElement(o){return o.forEach((o=>{const s=this.toRefractedElement([\"document\",\"objects\",\"LinkDescription\"],o);this.element.push(s)})),this.copyMetaAndAttributes(o,this.element),Yu}}const nm=LinksVisitor;class JSONReferenceVisitor extends(Mixin(xf,uf)){constructor(o){super(o),this.element=new Hd,this.specPath=Ul([\"document\",\"objects\",\"JSONReference\"])}ObjectElement(o){const s=xf.prototype.ObjectElement.call(this,o);return ip(this.element.$ref)&&this.element.classes.push(\"reference-element\"),s}}const om=JSONReferenceVisitor;const sm=class $RefVisitor extends uf{StringElement(o){const s=this.enter(o);return this.element.classes.push(\"reference-value\"),s}};const im=_curry3((function ifElse(o,s,i){return _l(Math.max(o.length,s.length,i.length),(function _ifElse(){return o.apply(this,arguments)?s.apply(this,arguments):i.apply(this,arguments)}))}));const am=_curry1((function comparator(o){return function(s,i){return o(s,i)?-1:o(i,s)?1:0}}));var cm=_curry2((function sort(o,s){return Array.prototype.slice.call(s,0).sort(o)}));const lm=cm;var um=_curry1((function(o){return _nth(0,o)}));const pm=um;const hm=_curry1(_reduced);const dm=Vl(Qd);const fm=Fp(Up,Nf);function _toConsumableArray(o){return function _arrayWithoutHoles(o){if(Array.isArray(o))return _arrayLikeToArray(o)}(o)||function _iterableToArray(o){if(\"undefined\"!=typeof Symbol&&null!=o[Symbol.iterator]||null!=o[\"@@iterator\"])return Array.from(o)}(o)||function _unsupportedIterableToArray(o,s){if(!o)return;if(\"string\"==typeof o)return _arrayLikeToArray(o,s);var i=Object.prototype.toString.call(o).slice(8,-1);\"Object\"===i&&o.constructor&&(i=o.constructor.name);if(\"Map\"===i||\"Set\"===i)return Array.from(o);if(\"Arguments\"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(o,s)}(o)||function _nonIterableSpread(){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 _arrayLikeToArray(o,s){(null==s||s>o.length)&&(s=o.length);for(var i=0,u=new Array(s);i<s;i++)u[i]=o[i];return u}var mm=pipe(lm(am((function(o,s){return o.length>s.length}))),pm,tl(\"length\")),gm=wl((function(o,s,i){var u=i.apply(void 0,_toConsumableArray(o));return dm(u)?hm(u):s}));const ym=im(fm,(function dispatchImpl(o){var s=mm(o);return _l(s,(function(){for(var s=arguments.length,i=new Array(s),u=0;u<s;u++)i[u]=arguments[u];return Kc(gm(i),void 0,o)}))}),zl);const vm=class AlternatingVisitor extends Sf{alternator;constructor({alternator:o,...s}){super({...s}),this.alternator=o}enter(o){const s=this.alternator.map((({predicate:o,specPath:s})=>im(o,Ul(s),zl))),i=ym(s)(o);return this.element=this.toRefractedElement(i,o),Yu}};const bm=class SchemaOrReferenceVisitor extends vm{constructor(o){super(o),this.alternator=[{predicate:isJSONReferenceLikeElement,specPath:[\"document\",\"objects\",\"JSONReference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"JSONSchema\"]}]}};class MediaVisitor extends(Mixin(xf,uf)){constructor(o){super(o),this.element=new Jd,this.specPath=Ul([\"document\",\"objects\",\"Media\"])}}const _m=MediaVisitor;class LinkDescriptionVisitor extends(Mixin(xf,uf)){constructor(o){super(o),this.element=new Gd,this.specPath=Ul([\"document\",\"objects\",\"LinkDescription\"])}}const Em={visitors:{value:uf,JSONSchemaOrJSONReferenceVisitor:bm,document:{objects:{JSONSchema:{$visitor:kf,fixedFields:{id:{$ref:\"#/visitors/value\"},$schema:{$ref:\"#/visitors/value\"},multipleOf:{$ref:\"#/visitors/value\"},maximum:{$ref:\"#/visitors/value\"},exclusiveMaximum:{$ref:\"#/visitors/value\"},minimum:{$ref:\"#/visitors/value\"},exclusiveMinimum:{$ref:\"#/visitors/value\"},maxLength:{$ref:\"#/visitors/value\"},minLength:{$ref:\"#/visitors/value\"},pattern:{$ref:\"#/visitors/value\"},additionalItems:bm,items:Cf,maxItems:{$ref:\"#/visitors/value\"},minItems:{$ref:\"#/visitors/value\"},uniqueItems:{$ref:\"#/visitors/value\"},maxProperties:{$ref:\"#/visitors/value\"},minProperties:{$ref:\"#/visitors/value\"},required:jf,properties:Wf,additionalProperties:bm,patternProperties:Hf,dependencies:Jf,enum:Gf,type:Xf,allOf:Qf,anyOf:em,oneOf:tm,not:bm,definitions:rm,title:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},default:{$ref:\"#/visitors/value\"},format:{$ref:\"#/visitors/value\"},base:{$ref:\"#/visitors/value\"},links:nm,media:{$ref:\"#/visitors/document/objects/Media\"},readOnly:{$ref:\"#/visitors/value\"}}},JSONReference:{$visitor:om,fixedFields:{$ref:sm}},Media:{$visitor:_m,fixedFields:{binaryEncoding:{$ref:\"#/visitors/value\"},type:{$ref:\"#/visitors/value\"}}},LinkDescription:{$visitor:LinkDescriptionVisitor,fixedFields:{href:{$ref:\"#/visitors/value\"},rel:{$ref:\"#/visitors/value\"},title:{$ref:\"#/visitors/value\"},targetSchema:bm,mediaType:{$ref:\"#/visitors/value\"},method:{$ref:\"#/visitors/value\"},encType:{$ref:\"#/visitors/value\"},schema:bm}}}}}},traversal_visitor_getNodeType=o=>{if(sp(o))return`${o.element.charAt(0).toUpperCase()+o.element.slice(1)}Element`},wm={JSONSchemaDraft4Element:[\"content\"],JSONReferenceElement:[\"content\"],MediaElement:[\"content\"],LinkDescriptionElement:[\"content\"],...xp},Sm=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Kd||o(u)&&s(\"JSONSchemaDraft4\",u)&&i(\"object\",u))),xm=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Hd||o(u)&&s(\"JSONReference\",u)&&i(\"object\",u))),km=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Jd||o(u)&&s(\"media\",u)&&i(\"object\",u))),Om=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Gd||o(u)&&s(\"linkDescription\",u)&&i(\"object\",u))),Cm={namespace:o=>{const{base:s}=o;return s.register(\"jSONSchemaDraft4\",Kd),s.register(\"jSONReference\",Hd),s.register(\"media\",Jd),s.register(\"linkDescription\",Gd),s}},Am=Cm,refractor_toolbox=()=>{const o=createNamespace(Am);return{predicates:{...le,isStringElement:ip},namespace:o}},refractor_refract=(o,{specPath:s=[\"visitors\",\"document\",\"objects\",\"JSONSchema\",\"$visitor\"],plugins:i=[],specificationObj:u=Em}={})=>{const _=(0,Xu.e)(o),w=dereference(u),x=new(Np(s,w))({specObj:w});return visitor_visit(_,x),dispatchPluginsSync(x.element,i,{toolboxCreator:refractor_toolbox,visitorOptions:{keyMap:wm,nodeTypeGetter:traversal_visitor_getNodeType}})},refractor_createRefractor=o=>(s,i={})=>refractor_refract(s,{specPath:o,...i});Kd.refract=refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"JSONSchema\",\"$visitor\"]),Hd.refract=refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"JSONReference\",\"$visitor\"]),Jd.refract=refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Media\",\"$visitor\"]),Gd.refract=refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"LinkDescription\",\"$visitor\"]);const jm=class Schema_Schema extends Kd{constructor(o,s,i){super(o,s,i),this.element=\"schema\",this.classes.push(\"json-schema-draft-4\")}get idProp(){throw new Wd(\"idProp getter in Schema class is not not supported.\")}set idProp(o){throw new Wd(\"idProp setter in Schema class is not not supported.\")}get $schema(){throw new Wd(\"$schema getter in Schema class is not not supported.\")}set $schema(o){throw new Wd(\"$schema setter in Schema class is not not supported.\")}get additionalItems(){return this.get(\"additionalItems\")}set additionalItems(o){this.set(\"additionalItems\",o)}get items(){return this.get(\"items\")}set items(o){this.set(\"items\",o)}get additionalProperties(){return this.get(\"additionalProperties\")}set additionalProperties(o){this.set(\"additionalProperties\",o)}get patternProperties(){throw new Wd(\"patternProperties getter in Schema class is not not supported.\")}set patternProperties(o){throw new Wd(\"patternProperties setter in Schema class is not not supported.\")}get dependencies(){throw new Wd(\"dependencies getter in Schema class is not not supported.\")}set dependencies(o){throw new Wd(\"dependencies setter in Schema class is not not supported.\")}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}get not(){return this.get(\"not\")}set not(o){this.set(\"not\",o)}get definitions(){throw new Wd(\"definitions getter in Schema class is not not supported.\")}set definitions(o){throw new Wd(\"definitions setter in Schema class is not not supported.\")}get base(){throw new Wd(\"base getter in Schema class is not not supported.\")}set base(o){throw new Wd(\"base setter in Schema class is not not supported.\")}get links(){throw new Wd(\"links getter in Schema class is not not supported.\")}set links(o){throw new Wd(\"links setter in Schema class is not not supported.\")}get media(){throw new Wd(\"media getter in Schema class is not not supported.\")}set media(o){throw new Wd(\"media setter in Schema class is not not supported.\")}get nullable(){return this.get(\"nullable\")}set nullable(o){this.set(\"nullable\",o)}get discriminator(){return this.get(\"discriminator\")}set discriminator(o){this.set(\"discriminator\",o)}get writeOnly(){return this.get(\"writeOnly\")}set writeOnly(o){this.set(\"writeOnly\",o)}get xml(){return this.get(\"xml\")}set xml(o){this.set(\"xml\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}get deprecated(){return this.get(\"deprecated\")}set deprecated(o){this.set(\"deprecated\",o)}};class SecurityRequirement extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"securityRequirement\"}}const Pm=SecurityRequirement;class SecurityScheme extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"securityScheme\"}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get in(){return this.get(\"in\")}set in(o){this.set(\"in\",o)}get scheme(){return this.get(\"scheme\")}set scheme(o){this.set(\"scheme\",o)}get bearerFormat(){return this.get(\"bearerFormat\")}set bearerFormat(o){this.set(\"bearerFormat\",o)}get flows(){return this.get(\"flows\")}set flows(o){this.set(\"flows\",o)}get openIdConnectUrl(){return this.get(\"openIdConnectUrl\")}set openIdConnectUrl(o){this.set(\"openIdConnectUrl\",o)}}const Im=SecurityScheme;class Server extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"server\"}get url(){return this.get(\"url\")}set url(o){this.set(\"url\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get variables(){return this.get(\"variables\")}set variables(o){this.set(\"variables\",o)}}const Mm=Server;class ServerVariable extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"serverVariable\"}get enum(){return this.get(\"enum\")}set enum(o){this.set(\"enum\",o)}get default(){return this.get(\"default\")}set default(o){this.set(\"default\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}}const Nm=ServerVariable;class Tag extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"tag\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}}const Tm=Tag;class Xml extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"xml\"}get name(){return this.get(\"name\")}set name(o){this.set(\"name\",o)}get namespace(){return this.get(\"namespace\")}set namespace(o){this.set(\"namespace\",o)}get prefix(){return this.get(\"prefix\")}set prefix(o){this.set(\"prefix\",o)}get attribute(){return this.get(\"attribute\")}set attribute(o){this.set(\"attribute\",o)}get wrapped(){return this.get(\"wrapped\")}set wrapped(o){this.set(\"wrapped\",o)}}const Rm=Xml;const Dm=class visitors_Visitor_Visitor{element;constructor(o={}){Object.assign(this,o)}copyMetaAndAttributes(o,s){(o.meta.length>0||s.meta.length>0)&&(s.meta=deepmerge(s.meta,o.meta),hasElementSourceMap(o)&&s.meta.set(\"sourceMap\",o.meta.get(\"sourceMap\"))),(o.attributes.length>0||o.meta.length>0)&&(s.attributes=deepmerge(s.attributes,o.attributes))}};const Lm=class FallbackVisitor_FallbackVisitor extends Dm{enter(o){return this.element=cloneDeep(o),Yu}};const Bm=class SpecificationVisitor_SpecificationVisitor extends Dm{specObj;passingOptionsNames=[\"specObj\",\"openApiGenericElement\",\"openApiSemanticElement\"];openApiGenericElement;openApiSemanticElement;constructor({specObj:o,passingOptionsNames:s,openApiGenericElement:i,openApiSemanticElement:u,..._}){super({..._}),this.specObj=o,this.openApiGenericElement=i,this.openApiSemanticElement=u,Array.isArray(s)&&(this.passingOptionsNames=s)}retrievePassingOptions(){return _f(this.passingOptionsNames,this)}retrieveFixedFields(o){const s=Np([\"visitors\",...o,\"fixedFields\"],this.specObj);return\"object\"==typeof s&&null!==s?Object.keys(s):[]}retrieveVisitor(o){return Ja(eu,[\"visitors\",...o],this.specObj)?Np([\"visitors\",...o],this.specObj):Np([\"visitors\",...o,\"$visitor\"],this.specObj)}retrieveVisitorInstance(o,s={}){const i=this.retrievePassingOptions();return new(this.retrieveVisitor(o))({...i,...s})}toRefractedElement(o,s,i={}){const u=this.retrieveVisitorInstance(o,i);return u instanceof Lm&&(null==u?void 0:u.constructor)===Lm?cloneDeep(s):(visitor_visit(s,u,i),u.element)}},isReferenceLikeElement=o=>pp(o)&&o.hasKey(\"$ref\"),Fm=pp,qm=pp,isOpenApiExtension=o=>ip(o.key)&&Qh(\"x-\",serializers_value(o.key));const $m=class FixedFieldsVisitor_FixedFieldsVisitor extends Bm{specPath;ignoredFields;canSupportSpecificationExtensions=!0;specificationExtensionPredicate=isOpenApiExtension;constructor({specPath:o,ignoredFields:s,canSupportSpecificationExtensions:i,specificationExtensionPredicate:u,..._}){super({..._}),this.specPath=o,this.ignoredFields=s||[],\"boolean\"==typeof i&&(this.canSupportSpecificationExtensions=i),\"function\"==typeof u&&(this.specificationExtensionPredicate=u)}ObjectElement(o){const s=this.specPath(o),i=this.retrieveFixedFields(s);return o.forEach(((o,u,_)=>{if(ip(u)&&i.includes(serializers_value(u))&&!this.ignoredFields.includes(serializers_value(u))){const i=this.toRefractedElement([...s,\"fixedFields\",serializers_value(u)],o),w=new Xu.Pr(cloneDeep(u),i);this.copyMetaAndAttributes(_,w),w.classes.push(\"fixed-field\"),this.element.content.push(w)}else if(this.canSupportSpecificationExtensions&&this.specificationExtensionPredicate(_)){const o=this.toRefractedElement([\"document\",\"extension\"],_);this.element.content.push(o)}else this.ignoredFields.includes(serializers_value(u))||this.element.content.push(cloneDeep(_))})),this.copyMetaAndAttributes(o,this.element),Yu}};class OpenApi3_0Visitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Td,this.specPath=Ul([\"document\",\"objects\",\"OpenApi\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){return $m.prototype.ObjectElement.call(this,o)}}const Vm=OpenApi3_0Visitor;class OpenapiVisitor extends(Mixin(Bm,Lm)){StringElement(o){const s=new Nd(serializers_value(o));return this.copyMetaAndAttributes(o,s),this.element=s,Yu}}const Um=OpenapiVisitor;const zm=class SpecificationExtensionVisitor extends Bm{MemberElement(o){return this.element=cloneDeep(o),this.element.classes.push(\"specification-extension\"),Yu}};class InfoVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new kd,this.specPath=Ul([\"document\",\"objects\",\"Info\"]),this.canSupportSpecificationExtensions=!0}}const Wm=InfoVisitor;const Km=class VersionVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"api-version\"),this.element.classes.push(\"version\"),s}};class ContactVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new vd,this.specPath=Ul([\"document\",\"objects\",\"Contact\"]),this.canSupportSpecificationExtensions=!0}}const Hm=ContactVisitor;class LicenseVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Od,this.specPath=Ul([\"document\",\"objects\",\"License\"]),this.canSupportSpecificationExtensions=!0}}const Jm=LicenseVisitor;class LinkVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Cd,this.specPath=Ul([\"document\",\"objects\",\"Link\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return(ip(this.element.operationId)||ip(this.element.operationRef))&&this.element.classes.push(\"reference-element\"),s}}const Gm=LinkVisitor;const Ym=class OperationRefVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};const Xm=class OperationIdVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};const Qm=class PatternedFieldsVisitor_PatternedFieldsVisitor extends Bm{specPath;ignoredFields;fieldPatternPredicate=es_F;canSupportSpecificationExtensions=!1;specificationExtensionPredicate=isOpenApiExtension;constructor({specPath:o,ignoredFields:s,fieldPatternPredicate:i,canSupportSpecificationExtensions:u,specificationExtensionPredicate:_,...w}){super({...w}),this.specPath=o,this.ignoredFields=s||[],\"function\"==typeof i&&(this.fieldPatternPredicate=i),\"boolean\"==typeof u&&(this.canSupportSpecificationExtensions=u),\"function\"==typeof _&&(this.specificationExtensionPredicate=_)}ObjectElement(o){return o.forEach(((o,s,i)=>{if(this.canSupportSpecificationExtensions&&this.specificationExtensionPredicate(i)){const o=this.toRefractedElement([\"document\",\"extension\"],i);this.element.content.push(o)}else if(!this.ignoredFields.includes(serializers_value(s))&&this.fieldPatternPredicate(serializers_value(s))){const u=this.specPath(o),_=this.toRefractedElement(u,o),w=new Xu.Pr(cloneDeep(s),_);this.copyMetaAndAttributes(i,w),w.classes.push(\"patterned-field\"),this.element.content.push(w)}else this.ignoredFields.includes(serializers_value(s))||this.element.content.push(cloneDeep(i))})),this.copyMetaAndAttributes(o,this.element),Yu}};const Zm=class MapVisitor_MapVisitor extends Qm{constructor(o){super(o),this.fieldPatternPredicate=Df}};class LinkParameters extends Xu.Sh{static primaryClass=\"link-parameters\";constructor(o,s,i){super(o,s,i),this.classes.push(LinkParameters.primaryClass)}}const eg=LinkParameters;class ParametersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new eg,this.specPath=Ul([\"value\"])}}const rg=ParametersVisitor;class ServerVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Mm,this.specPath=Ul([\"document\",\"objects\",\"Server\"]),this.canSupportSpecificationExtensions=!0}}const ng=ServerVisitor;const og=class UrlVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"server-url\"),s}};class Servers extends Xu.wE{static primaryClass=\"servers\";constructor(o,s,i){super(o,s,i),this.classes.push(Servers.primaryClass)}}const sg=Servers;class ServersVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new sg}ArrayElement(o){return o.forEach((o=>{const s=Fm(o)?[\"document\",\"objects\",\"Server\"]:[\"value\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const lg=ServersVisitor;class ServerVariableVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Nm,this.specPath=Ul([\"document\",\"objects\",\"ServerVariable\"]),this.canSupportSpecificationExtensions=!0}}const pg=ServerVariableVisitor;class ServerVariables extends Xu.Sh{static primaryClass=\"server-variables\";constructor(o,s,i){super(o,s,i),this.classes.push(ServerVariables.primaryClass)}}const fg=ServerVariables;class VariablesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new fg,this.specPath=Ul([\"document\",\"objects\",\"ServerVariable\"])}}const mg=VariablesVisitor;class MediaTypeVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Ad,this.specPath=Ul([\"document\",\"objects\",\"MediaType\"]),this.canSupportSpecificationExtensions=!0}}const gg=MediaTypeVisitor;const yg=class AlternatingVisitor_AlternatingVisitor extends Bm{alternator;constructor({alternator:o,...s}){super({...s}),this.alternator=o||[]}enter(o){const s=this.alternator.map((({predicate:o,specPath:s})=>im(o,Ul(s),zl))),i=ym(s)(o);return this.element=this.toRefractedElement(i,o),Yu}},_g=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof md||o(u)&&s(\"callback\",u)&&i(\"object\",u))),xg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof yd||o(u)&&s(\"components\",u)&&i(\"object\",u))),kg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof vd||o(u)&&s(\"contact\",u)&&i(\"object\",u))),qg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof wd||o(u)&&s(\"example\",u)&&i(\"object\",u))),Vg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Sd||o(u)&&s(\"externalDocumentation\",u)&&i(\"object\",u))),Ug=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof xd||o(u)&&s(\"header\",u)&&i(\"object\",u))),zg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof kd||o(u)&&s(\"info\",u)&&i(\"object\",u))),Wg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Od||o(u)&&s(\"license\",u)&&i(\"object\",u))),Kg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Cd||o(u)&&s(\"link\",u)&&i(\"object\",u))),Yg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Nd||o(u)&&s(\"openapi\",u)&&i(\"string\",u))),Xg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i,hasClass:u})=>_=>_ instanceof Td||o(_)&&s(\"openApi3_0\",_)&&i(\"object\",_)&&u(\"api\",_))),Zg=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Rd||o(u)&&s(\"operation\",u)&&i(\"object\",u))),ey=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Dd||o(u)&&s(\"parameter\",u)&&i(\"object\",u))),ty=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Ld||o(u)&&s(\"pathItem\",u)&&i(\"object\",u))),ry=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Bd||o(u)&&s(\"paths\",u)&&i(\"object\",u))),ny=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Fd||o(u)&&s(\"reference\",u)&&i(\"object\",u))),oy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof $d||o(u)&&s(\"requestBody\",u)&&i(\"object\",u))),sy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Vd||o(u)&&s(\"response\",u)&&i(\"object\",u))),iy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Ud||o(u)&&s(\"responses\",u)&&i(\"object\",u))),ay=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof jm||o(u)&&s(\"schema\",u)&&i(\"object\",u))),isBooleanJsonSchemaElement=o=>up(o)&&o.classes.includes(\"boolean-json-schema\"),cy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Pm||o(u)&&s(\"securityRequirement\",u)&&i(\"object\",u))),ly=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Im||o(u)&&s(\"securityScheme\",u)&&i(\"object\",u))),uy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Mm||o(u)&&s(\"server\",u)&&i(\"object\",u))),py=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Nm||o(u)&&s(\"serverVariable\",u)&&i(\"object\",u))),hy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof Ad||o(u)&&s(\"mediaType\",u)&&i(\"object\",u))),dy=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i,hasClass:u})=>_=>_ instanceof sg||o(_)&&s(\"array\",_)&&i(\"array\",_)&&u(\"servers\",_)));class SchemaVisitor extends(Mixin(yg,Lm)){constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"Schema\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}}const fy=SchemaVisitor;class ExamplesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"examples\"),this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Example\"],this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"example\")})),s}}const my=ExamplesVisitor;class MediaTypeExamples extends Xu.Sh{static primaryClass=\"media-type-examples\";constructor(o,s,i){super(o,s,i),this.classes.push(MediaTypeExamples.primaryClass),this.classes.push(\"examples\")}}const gy=MediaTypeExamples;const yy=class ExamplesVisitor_ExamplesVisitor extends my{constructor(o){super(o),this.element=new gy}};class MediaTypeEncoding extends Xu.Sh{static primaryClass=\"media-type-encoding\";constructor(o,s,i){super(o,s,i),this.classes.push(MediaTypeEncoding.primaryClass)}}const vy=MediaTypeEncoding;class EncodingVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new vy,this.specPath=Ul([\"document\",\"objects\",\"Encoding\"])}}const by=EncodingVisitor;class SecurityRequirementVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Pm,this.specPath=Ul([\"value\"])}}const _y=SecurityRequirementVisitor;class Security extends Xu.wE{static primaryClass=\"security\";constructor(o,s,i){super(o,s,i),this.classes.push(Security.primaryClass)}}const Ey=Security;class SecurityVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new Ey}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"SecurityRequirement\"],o);this.element.push(s)}else this.element.push(cloneDeep(o))})),this.copyMetaAndAttributes(o,this.element),Yu}}const wy=SecurityVisitor;class ComponentsVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new yd,this.specPath=Ul([\"document\",\"objects\",\"Components\"]),this.canSupportSpecificationExtensions=!0}}const Sy=ComponentsVisitor;class TagVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Tm,this.specPath=Ul([\"document\",\"objects\",\"Tag\"]),this.canSupportSpecificationExtensions=!0}}const xy=TagVisitor;class ReferenceVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Fd,this.specPath=Ul([\"document\",\"objects\",\"Reference\"]),this.canSupportSpecificationExtensions=!1}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return ip(this.element.$ref)&&this.element.classes.push(\"reference-element\"),s}}const ky=ReferenceVisitor;const Oy=class $RefVisitor_$RefVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};class ParameterVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Dd,this.specPath=Ul([\"document\",\"objects\",\"Parameter\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return pp(this.element.contentProp)&&this.element.contentProp.filter(hy).forEach(((o,s)=>{o.setMetaProperty(\"media-type\",serializers_value(s))})),s}}const Cy=ParameterVisitor;class SchemaVisitor_SchemaVisitor extends(Mixin(yg,Lm)){constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"Schema\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}}const Ay=SchemaVisitor_SchemaVisitor;class HeaderVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new xd,this.specPath=Ul([\"document\",\"objects\",\"Header\"]),this.canSupportSpecificationExtensions=!0}}const jy=HeaderVisitor;class header_SchemaVisitor_SchemaVisitor extends(Mixin(yg,Lm)){constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"Schema\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}}const Py=header_SchemaVisitor_SchemaVisitor;class HeaderExamples extends Xu.Sh{static primaryClass=\"header-examples\";constructor(o,s,i){super(o,s,i),this.classes.push(HeaderExamples.primaryClass),this.classes.push(\"examples\")}}const Iy=HeaderExamples;const My=class header_ExamplesVisitor_ExamplesVisitor extends my{constructor(o){super(o),this.element=new Iy}};class ContentVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"content\"),this.specPath=Ul([\"document\",\"objects\",\"MediaType\"])}}const Ny=ContentVisitor;class HeaderContent extends Xu.Sh{static primaryClass=\"header-content\";constructor(o,s,i){super(o,s,i),this.classes.push(HeaderContent.primaryClass),this.classes.push(\"content\")}}const Ty=HeaderContent;const Ry=class ContentVisitor_ContentVisitor extends Ny{constructor(o){super(o),this.element=new Ty}};class schema_SchemaVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new jm,this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.canSupportSpecificationExtensions=!0}}const Dy=schema_SchemaVisitor,{allOf:Ly}=Em.visitors.document.objects.JSONSchema.fixedFields;const By=class AllOfVisitor_AllOfVisitor extends Ly{ArrayElement(o){const s=Ly.prototype.ArrayElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}},{anyOf:Fy}=Em.visitors.document.objects.JSONSchema.fixedFields;const qy=class AnyOfVisitor_AnyOfVisitor extends Fy{ArrayElement(o){const s=Fy.prototype.ArrayElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}},{oneOf:$y}=Em.visitors.document.objects.JSONSchema.fixedFields;const Vy=class OneOfVisitor_OneOfVisitor extends $y{ArrayElement(o){const s=$y.prototype.ArrayElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}},{items:Uy}=Em.visitors.document.objects.JSONSchema.fixedFields;const zy=class ItemsVisitor_ItemsVisitor extends Uy{ObjectElement(o){const s=Uy.prototype.ObjectElement.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}ArrayElement(o){return this.enter(o)}},{properties:Wy}=Em.visitors.document.objects.JSONSchema.fixedFields;const Ky=class PropertiesVisitor_PropertiesVisitor extends Wy{ObjectElement(o){const s=Wy.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}},{type:Hy}=Em.visitors.document.objects.JSONSchema.fixedFields;const Jy=class TypeVisitor_TypeVisitor extends Hy{ArrayElement(o){return this.enter(o)}},{JSONSchemaOrJSONReferenceVisitor:Gy}=Em.visitors;const Yy=class SchemaOrReferenceVisitor_SchemaOrReferenceVisitor extends Gy{ObjectElement(o){const s=Gy.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"schema\"),s}};class DiscriminatorVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new _d,this.specPath=Ul([\"document\",\"objects\",\"Discriminator\"]),this.canSupportSpecificationExtensions=!1}}const Xy=DiscriminatorVisitor;class DiscriminatorMapping extends Xu.Sh{static primaryClass=\"discriminator-mapping\";constructor(o,s,i){super(o,s,i),this.classes.push(DiscriminatorMapping.primaryClass)}}const Qy=DiscriminatorMapping;class MappingVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Qy,this.specPath=Ul([\"value\"])}}const Zy=MappingVisitor;class XmlVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Rm,this.specPath=Ul([\"document\",\"objects\",\"XML\"]),this.canSupportSpecificationExtensions=!0}}const ev=XmlVisitor;class ParameterExamples extends Xu.Sh{static primaryClass=\"parameter-examples\";constructor(o,s,i){super(o,s,i),this.classes.push(ParameterExamples.primaryClass),this.classes.push(\"examples\")}}const tv=ParameterExamples;const rv=class parameter_ExamplesVisitor_ExamplesVisitor extends my{constructor(o){super(o),this.element=new tv}};class ParameterContent extends Xu.Sh{static primaryClass=\"parameter-content\";constructor(o,s,i){super(o,s,i),this.classes.push(ParameterContent.primaryClass),this.classes.push(\"content\")}}const nv=ParameterContent;const ov=class parameter_ContentVisitor_ContentVisitor extends Ny{constructor(o){super(o),this.element=new nv}};class ComponentsSchemas extends Xu.Sh{static primaryClass=\"components-schemas\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsSchemas.primaryClass)}}const sv=ComponentsSchemas;class SchemasVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new sv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Schema\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"schema\")})),s}}const iv=SchemasVisitor;class ComponentsResponses extends Xu.Sh{static primaryClass=\"components-responses\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsResponses.primaryClass)}}const av=ComponentsResponses;class ResponsesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new av,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Response\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"response\")})),this.element.filter(sy).forEach(((o,s)=>{o.setMetaProperty(\"http-status-code\",serializers_value(s))})),s}}const cv=ResponsesVisitor;class ComponentsParameters extends Xu.Sh{static primaryClass=\"components-parameters\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsParameters.primaryClass),this.classes.push(\"parameters\")}}const lv=ComponentsParameters;class ParametersVisitor_ParametersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new lv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Parameter\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"parameter\")})),s}}const uv=ParametersVisitor_ParametersVisitor;class ComponentsExamples extends Xu.Sh{static primaryClass=\"components-examples\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsExamples.primaryClass),this.classes.push(\"examples\")}}const pv=ComponentsExamples;class components_ExamplesVisitor_ExamplesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new pv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Example\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"example\")})),s}}const hv=components_ExamplesVisitor_ExamplesVisitor;class ComponentsRequestBodies extends Xu.Sh{static primaryClass=\"components-request-bodies\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsRequestBodies.primaryClass)}}const dv=ComponentsRequestBodies;class RequestBodiesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new dv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"RequestBody\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"requestBody\")})),s}}const fv=RequestBodiesVisitor;class ComponentsHeaders extends Xu.Sh{static primaryClass=\"components-headers\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsHeaders.primaryClass)}}const mv=ComponentsHeaders;class HeadersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new mv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Header\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"header\")})),this.element.filter(Ug).forEach(((o,s)=>{o.setMetaProperty(\"header-name\",serializers_value(s))})),s}}const gv=HeadersVisitor;class ComponentsSecuritySchemes extends Xu.Sh{static primaryClass=\"components-security-schemes\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsSecuritySchemes.primaryClass)}}const yv=ComponentsSecuritySchemes;class SecuritySchemesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new yv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"SecurityScheme\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"securityScheme\")})),s}}const vv=SecuritySchemesVisitor;class ComponentsLinks extends Xu.Sh{static primaryClass=\"components-links\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsLinks.primaryClass)}}const bv=ComponentsLinks;class LinksVisitor_LinksVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new bv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Link\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"link\")})),s}}const _v=LinksVisitor_LinksVisitor;class ComponentsCallbacks extends Xu.Sh{static primaryClass=\"components-callbacks\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsCallbacks.primaryClass)}}const Ev=ComponentsCallbacks;class CallbacksVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Ev,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Callback\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"callback\")})),s}}const wv=CallbacksVisitor;class ExampleVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new wd,this.specPath=Ul([\"document\",\"objects\",\"Example\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return ip(this.element.externalValue)&&this.element.classes.push(\"reference-element\"),s}}const Sv=ExampleVisitor;const xv=class ExternalValueVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};class ExternalDocumentationVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Sd,this.specPath=Ul([\"document\",\"objects\",\"ExternalDocumentation\"]),this.canSupportSpecificationExtensions=!0}}const kv=ExternalDocumentationVisitor;class encoding_EncodingVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Ed,this.specPath=Ul([\"document\",\"objects\",\"Encoding\"]),this.canSupportSpecificationExtensions=!0}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return pp(this.element.headers)&&this.element.headers.filter(Ug).forEach(((o,s)=>{o.setMetaProperty(\"header-name\",serializers_value(s))})),s}}const Ov=encoding_EncodingVisitor;class EncodingHeaders extends Xu.Sh{static primaryClass=\"encoding-headers\";constructor(o,s,i){super(o,s,i),this.classes.push(EncodingHeaders.primaryClass)}}const Cv=EncodingHeaders;class HeadersVisitor_HeadersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Cv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Header\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"header\")})),this.element.forEach(((o,s)=>{if(!Ug(o))return;const i=serializers_value(s);o.setMetaProperty(\"headerName\",i)})),s}}const Av=HeadersVisitor_HeadersVisitor;class PathsVisitor extends(Mixin(Qm,Lm)){constructor(o){super(o),this.element=new Bd,this.specPath=Ul([\"document\",\"objects\",\"PathItem\"]),this.canSupportSpecificationExtensions=!0,this.fieldPatternPredicate=es_T}ObjectElement(o){const s=Qm.prototype.ObjectElement.call(this,o);return this.element.filter(ty).forEach(((o,s)=>{s.classes.push(\"openapi-path-template\"),s.classes.push(\"path-template\"),o.setMetaProperty(\"path\",cloneDeep(s))})),s}}const jv=PathsVisitor;class RequestBodyVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new $d,this.specPath=Ul([\"document\",\"objects\",\"RequestBody\"])}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return pp(this.element.contentProp)&&this.element.contentProp.filter(hy).forEach(((o,s)=>{o.setMetaProperty(\"media-type\",serializers_value(s))})),s}}const Pv=RequestBodyVisitor;class RequestBodyContent extends Xu.Sh{static primaryClass=\"request-body-content\";constructor(o,s,i){super(o,s,i),this.classes.push(RequestBodyContent.primaryClass),this.classes.push(\"content\")}}const Iv=RequestBodyContent;const Mv=class request_body_ContentVisitor_ContentVisitor extends Ny{constructor(o){super(o),this.element=new Iv}};class CallbackVisitor extends(Mixin(Qm,Lm)){constructor(o){super(o),this.element=new md,this.specPath=Ul([\"document\",\"objects\",\"PathItem\"]),this.canSupportSpecificationExtensions=!0,this.fieldPatternPredicate=o=>/{(?<expression>[^}]{1,2083})}/.test(String(o))}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ty).forEach(((o,s)=>{o.setMetaProperty(\"runtime-expression\",serializers_value(s))})),s}}const Nv=CallbackVisitor;class ResponseVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Vd,this.specPath=Ul([\"document\",\"objects\",\"Response\"])}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return pp(this.element.contentProp)&&this.element.contentProp.filter(hy).forEach(((o,s)=>{o.setMetaProperty(\"media-type\",serializers_value(s))})),pp(this.element.headers)&&this.element.headers.filter(Ug).forEach(((o,s)=>{o.setMetaProperty(\"header-name\",serializers_value(s))})),s}}const Tv=ResponseVisitor;class ResponseHeaders extends Xu.Sh{static primaryClass=\"response-headers\";constructor(o,s,i){super(o,s,i),this.classes.push(ResponseHeaders.primaryClass)}}const Rv=ResponseHeaders;class response_HeadersVisitor_HeadersVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Rv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Header\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"header\")})),this.element.forEach(((o,s)=>{if(!Ug(o))return;const i=serializers_value(s);o.setMetaProperty(\"header-name\",i)})),s}}const Dv=response_HeadersVisitor_HeadersVisitor;class ResponseContent extends Xu.Sh{static primaryClass=\"response-content\";constructor(o,s,i){super(o,s,i),this.classes.push(ResponseContent.primaryClass),this.classes.push(\"content\")}}const Lv=ResponseContent;const Bv=class response_ContentVisitor_ContentVisitor extends Ny{constructor(o){super(o),this.element=new Lv}};class ResponseLinks extends Xu.Sh{static primaryClass=\"response-links\";constructor(o,s,i){super(o,s,i),this.classes.push(ResponseLinks.primaryClass)}}const Fv=ResponseLinks;class response_LinksVisitor_LinksVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Fv,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Link\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"link\")})),s}}const qv=response_LinksVisitor_LinksVisitor;function _isNumber(o){return\"[object Number]\"===Object.prototype.toString.call(o)}var $v=_curry2((function range(o,s){if(!_isNumber(o)||!_isNumber(s))throw new TypeError(\"Both arguments to range must be numbers\");for(var i=Array(o<s?s-o:0),u=o<0?s+Math.abs(o):s-o,_=0;_<u;)i[_]=_+o,_+=1;return i}));const Vv=$v;function hasOrAdd(o,s,i){var u,_=typeof o;switch(_){case\"string\":case\"number\":return 0===o&&1/o==-1/0?!!i._items[\"-0\"]||(s&&(i._items[\"-0\"]=!0),!1):null!==i._nativeSet?s?(u=i._nativeSet.size,i._nativeSet.add(o),i._nativeSet.size===u):i._nativeSet.has(o):_ in i._items?o in i._items[_]||(s&&(i._items[_][o]=!0),!1):(s&&(i._items[_]={},i._items[_][o]=!0),!1);case\"boolean\":if(_ in i._items){var w=o?1:0;return!!i._items[_][w]||(s&&(i._items[_][w]=!0),!1)}return s&&(i._items[_]=o?[!1,!0]:[!0,!1]),!1;case\"function\":return null!==i._nativeSet?s?(u=i._nativeSet.size,i._nativeSet.add(o),i._nativeSet.size===u):i._nativeSet.has(o):_ in i._items?!!_includes(o,i._items[_])||(s&&i._items[_].push(o),!1):(s&&(i._items[_]=[o]),!1);case\"undefined\":return!!i._items[_]||(s&&(i._items[_]=!0),!1);case\"object\":if(null===o)return!!i._items.null||(s&&(i._items.null=!0),!1);default:return(_=Object.prototype.toString.call(o))in i._items?!!_includes(o,i._items[_])||(s&&i._items[_].push(o),!1):(s&&(i._items[_]=[o]),!1)}}const Uv=function(){function _Set(){this._nativeSet=\"function\"==typeof Set?new Set:null,this._items={}}return _Set.prototype.add=function(o){return!hasOrAdd(o,!0,this)},_Set.prototype.has=function(o){return hasOrAdd(o,!1,this)},_Set}();var zv=_curry2((function difference(o,s){for(var i=[],u=0,_=o.length,w=s.length,x=new Uv,C=0;C<w;C+=1)x.add(s[C]);for(;u<_;)x.add(o[u])&&(i[i.length]=o[u]),u+=1;return i}));const Wv=zv;class MixedFieldsVisitor extends(Mixin($m,Qm)){specPathFixedFields;specPathPatternedFields;constructor({specPathFixedFields:o,specPathPatternedFields:s,...i}){super({...i}),this.specPathFixedFields=o,this.specPathPatternedFields=s}ObjectElement(o){const{specPath:s,ignoredFields:i}=this;try{this.specPath=this.specPathFixedFields;const s=this.retrieveFixedFields(this.specPath(o));this.ignoredFields=[...i,...Wv(o.keys(),s)],$m.prototype.ObjectElement.call(this,o),this.specPath=this.specPathPatternedFields,this.ignoredFields=s,Qm.prototype.ObjectElement.call(this,o)}catch(o){throw this.specPath=s,o}return Yu}}const Kv=MixedFieldsVisitor;class responses_ResponsesVisitor extends(Mixin(Kv,Lm)){constructor(o){super(o),this.element=new Ud,this.specPathFixedFields=Ul([\"document\",\"objects\",\"Responses\"]),this.canSupportSpecificationExtensions=!0,this.specPathPatternedFields=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Response\"],this.fieldPatternPredicate=o=>new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${Vv(100,600).join(\"|\")})$`).test(String(o))}ObjectElement(o){const s=Kv.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"response\")})),this.element.filter(sy).forEach(((o,s)=>{const i=cloneDeep(s);this.fieldPatternPredicate(serializers_value(i))&&o.setMetaProperty(\"http-status-code\",i)})),s}}const Hv=responses_ResponsesVisitor;class DefaultVisitor extends(Mixin(yg,Lm)){constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"Response\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)?this.element.setMetaProperty(\"referenced-element\",\"response\"):sy(this.element)&&this.element.setMetaProperty(\"http-status-code\",\"default\"),s}}const Jv=DefaultVisitor;class OperationVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Rd,this.specPath=Ul([\"document\",\"objects\",\"Operation\"])}}const Gv=OperationVisitor;class OperationTags extends Xu.wE{static primaryClass=\"operation-tags\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationTags.primaryClass)}}const Yv=OperationTags;const Xv=class TagsVisitor extends Lm{constructor(o){super(o),this.element=new Yv}ArrayElement(o){return this.element=this.element.concat(cloneDeep(o)),Yu}};class OperationParameters extends Xu.wE{static primaryClass=\"operation-parameters\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationParameters.primaryClass),this.classes.push(\"parameters\")}}const Qv=OperationParameters;class open_api_3_0_ParametersVisitor_ParametersVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"parameters\")}ArrayElement(o){return o.forEach((o=>{const s=isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Parameter\"],i=this.toRefractedElement(s,o);ny(i)&&i.setMetaProperty(\"referenced-element\",\"parameter\"),this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const Zv=open_api_3_0_ParametersVisitor_ParametersVisitor;const eb=class operation_ParametersVisitor_ParametersVisitor extends Zv{constructor(o){super(o),this.element=new Qv}};const tb=class RequestBodyVisitor_RequestBodyVisitor extends yg{constructor(o){super(o),this.alternator=[{predicate:isReferenceLikeElement,specPath:[\"document\",\"objects\",\"Reference\"]},{predicate:es_T,specPath:[\"document\",\"objects\",\"RequestBody\"]}]}ObjectElement(o){const s=yg.prototype.enter.call(this,o);return ny(this.element)&&this.element.setMetaProperty(\"referenced-element\",\"requestBody\"),s}};class OperationCallbacks extends Xu.Sh{static primaryClass=\"operation-callbacks\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationCallbacks.primaryClass)}}const nb=OperationCallbacks;class CallbacksVisitor_CallbacksVisitor extends(Mixin(Zm,Lm)){specPath;constructor(o){super(o),this.element=new nb,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"Callback\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(ny).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"callback\")})),s}}const pb=CallbacksVisitor_CallbacksVisitor;class OperationSecurity extends Xu.wE{static primaryClass=\"operation-security\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationSecurity.primaryClass),this.classes.push(\"security\")}}const mb=OperationSecurity;class SecurityVisitor_SecurityVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new mb}ArrayElement(o){return o.forEach((o=>{const s=pp(o)?[\"document\",\"objects\",\"SecurityRequirement\"]:[\"value\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const yb=SecurityVisitor_SecurityVisitor;class OperationServers extends Xu.wE{static primaryClass=\"operation-servers\";constructor(o,s,i){super(o,s,i),this.classes.push(OperationServers.primaryClass),this.classes.push(\"servers\")}}const _b=OperationServers;const wb=class ServersVisitor_ServersVisitor extends lg{constructor(o){super(o),this.element=new _b}};class PathItemVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Ld,this.specPath=Ul([\"document\",\"objects\",\"PathItem\"])}ObjectElement(o){const s=$m.prototype.ObjectElement.call(this,o);return this.element.filter(Zg).forEach(((o,s)=>{const i=cloneDeep(s);i.content=serializers_value(i).toUpperCase(),o.setMetaProperty(\"http-method\",i)})),ip(this.element.$ref)&&this.element.classes.push(\"reference-element\"),s}}const Sb=PathItemVisitor;const Ob=class path_item_$RefVisitor_$RefVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};class PathItemServers extends Xu.wE{static primaryClass=\"path-item-servers\";constructor(o,s,i){super(o,s,i),this.classes.push(PathItemServers.primaryClass),this.classes.push(\"servers\")}}const Ab=PathItemServers;const Pb=class path_item_ServersVisitor_ServersVisitor extends lg{constructor(o){super(o),this.element=new Ab}};class PathItemParameters extends Xu.wE{static primaryClass=\"path-item-parameters\";constructor(o,s,i){super(o,s,i),this.classes.push(PathItemParameters.primaryClass),this.classes.push(\"parameters\")}}const Ib=PathItemParameters;const Mb=class path_item_ParametersVisitor_ParametersVisitor extends Zv{constructor(o){super(o),this.element=new Ib}};class SecuritySchemeVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Im,this.specPath=Ul([\"document\",\"objects\",\"SecurityScheme\"]),this.canSupportSpecificationExtensions=!0}}const Rb=SecuritySchemeVisitor;class OAuthFlowsVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Md,this.specPath=Ul([\"document\",\"objects\",\"OAuthFlows\"]),this.canSupportSpecificationExtensions=!0}}const Lb=OAuthFlowsVisitor;class OAuthFlowVisitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new Id,this.specPath=Ul([\"document\",\"objects\",\"OAuthFlow\"]),this.canSupportSpecificationExtensions=!0}}const qb=OAuthFlowVisitor;class OAuthFlowScopes extends Xu.Sh{static primaryClass=\"oauth-flow-scopes\";constructor(o,s,i){super(o,s,i),this.classes.push(OAuthFlowScopes.primaryClass)}}const zb=OAuthFlowScopes;class ScopesVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new zb,this.specPath=Ul([\"value\"])}}const Qb=ScopesVisitor;class Tags extends Xu.wE{static primaryClass=\"tags\";constructor(o,s,i){super(o,s,i),this.classes.push(Tags.primaryClass)}}const e_=Tags;class TagsVisitor_TagsVisitor extends(Mixin(Bm,Lm)){constructor(o){super(o),this.element=new e_}ArrayElement(o){return o.forEach((o=>{const s=qm(o)?[\"document\",\"objects\",\"Tag\"]:[\"value\"],i=this.toRefractedElement(s,o);this.element.push(i)})),this.copyMetaAndAttributes(o,this.element),Yu}}const t_=TagsVisitor_TagsVisitor,{fixedFields:r_}=Em.visitors.document.objects.JSONSchema,n_={visitors:{value:Lm,document:{objects:{OpenApi:{$visitor:Vm,fixedFields:{openapi:Um,info:{$ref:\"#/visitors/document/objects/Info\"},servers:lg,paths:{$ref:\"#/visitors/document/objects/Paths\"},components:{$ref:\"#/visitors/document/objects/Components\"},security:wy,tags:t_,externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"}}},Info:{$visitor:Wm,fixedFields:{title:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},termsOfService:{$ref:\"#/visitors/value\"},contact:{$ref:\"#/visitors/document/objects/Contact\"},license:{$ref:\"#/visitors/document/objects/License\"},version:Km}},Contact:{$visitor:Hm,fixedFields:{name:{$ref:\"#/visitors/value\"},url:{$ref:\"#/visitors/value\"},email:{$ref:\"#/visitors/value\"}}},License:{$visitor:Jm,fixedFields:{name:{$ref:\"#/visitors/value\"},url:{$ref:\"#/visitors/value\"}}},Server:{$visitor:ng,fixedFields:{url:og,description:{$ref:\"#/visitors/value\"},variables:mg}},ServerVariable:{$visitor:pg,fixedFields:{enum:{$ref:\"#/visitors/value\"},default:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"}}},Components:{$visitor:Sy,fixedFields:{schemas:iv,responses:cv,parameters:uv,examples:hv,requestBodies:fv,headers:gv,securitySchemes:vv,links:_v,callbacks:wv}},Paths:{$visitor:jv},PathItem:{$visitor:Sb,fixedFields:{$ref:Ob,summary:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},get:{$ref:\"#/visitors/document/objects/Operation\"},put:{$ref:\"#/visitors/document/objects/Operation\"},post:{$ref:\"#/visitors/document/objects/Operation\"},delete:{$ref:\"#/visitors/document/objects/Operation\"},options:{$ref:\"#/visitors/document/objects/Operation\"},head:{$ref:\"#/visitors/document/objects/Operation\"},patch:{$ref:\"#/visitors/document/objects/Operation\"},trace:{$ref:\"#/visitors/document/objects/Operation\"},servers:Pb,parameters:Mb}},Operation:{$visitor:Gv,fixedFields:{tags:Xv,summary:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"},operationId:{$ref:\"#/visitors/value\"},parameters:eb,requestBody:tb,responses:{$ref:\"#/visitors/document/objects/Responses\"},callbacks:pb,deprecated:{$ref:\"#/visitors/value\"},security:yb,servers:wb}},ExternalDocumentation:{$visitor:kv,fixedFields:{description:{$ref:\"#/visitors/value\"},url:{$ref:\"#/visitors/value\"}}},Parameter:{$visitor:Cy,fixedFields:{name:{$ref:\"#/visitors/value\"},in:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},required:{$ref:\"#/visitors/value\"},deprecated:{$ref:\"#/visitors/value\"},allowEmptyValue:{$ref:\"#/visitors/value\"},style:{$ref:\"#/visitors/value\"},explode:{$ref:\"#/visitors/value\"},allowReserved:{$ref:\"#/visitors/value\"},schema:Ay,example:{$ref:\"#/visitors/value\"},examples:rv,content:ov}},RequestBody:{$visitor:Pv,fixedFields:{description:{$ref:\"#/visitors/value\"},content:Mv,required:{$ref:\"#/visitors/value\"}}},MediaType:{$visitor:gg,fixedFields:{schema:fy,example:{$ref:\"#/visitors/value\"},examples:yy,encoding:by}},Encoding:{$visitor:Ov,fixedFields:{contentType:{$ref:\"#/visitors/value\"},headers:Av,style:{$ref:\"#/visitors/value\"},explode:{$ref:\"#/visitors/value\"},allowReserved:{$ref:\"#/visitors/value\"}}},Responses:{$visitor:Hv,fixedFields:{default:Jv}},Response:{$visitor:Tv,fixedFields:{description:{$ref:\"#/visitors/value\"},headers:Dv,content:Bv,links:qv}},Callback:{$visitor:Nv},Example:{$visitor:Sv,fixedFields:{summary:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},value:{$ref:\"#/visitors/value\"},externalValue:xv}},Link:{$visitor:Gm,fixedFields:{operationRef:Ym,operationId:Xm,parameters:rg,requestBody:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},server:{$ref:\"#/visitors/document/objects/Server\"}}},Header:{$visitor:jy,fixedFields:{description:{$ref:\"#/visitors/value\"},required:{$ref:\"#/visitors/value\"},deprecated:{$ref:\"#/visitors/value\"},allowEmptyValue:{$ref:\"#/visitors/value\"},style:{$ref:\"#/visitors/value\"},explode:{$ref:\"#/visitors/value\"},allowReserved:{$ref:\"#/visitors/value\"},schema:Py,example:{$ref:\"#/visitors/value\"},examples:My,content:Ry}},Tag:{$visitor:xy,fixedFields:{name:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"}}},Reference:{$visitor:ky,fixedFields:{$ref:Oy}},JSONSchema:{$ref:\"#/visitors/document/objects/Schema\"},JSONReference:{$ref:\"#/visitors/document/objects/Reference\"},Schema:{$visitor:Dy,fixedFields:{title:r_.title,multipleOf:r_.multipleOf,maximum:r_.maximum,exclusiveMaximum:r_.exclusiveMaximum,minimum:r_.minimum,exclusiveMinimum:r_.exclusiveMinimum,maxLength:r_.maxLength,minLength:r_.minLength,pattern:r_.pattern,maxItems:r_.maxItems,minItems:r_.minItems,uniqueItems:r_.uniqueItems,maxProperties:r_.maxProperties,minProperties:r_.minProperties,required:r_.required,enum:r_.enum,type:Jy,allOf:By,anyOf:qy,oneOf:Vy,not:Yy,items:zy,properties:Ky,additionalProperties:Yy,description:r_.description,format:r_.format,default:r_.default,nullable:{$ref:\"#/visitors/value\"},discriminator:{$ref:\"#/visitors/document/objects/Discriminator\"},writeOnly:{$ref:\"#/visitors/value\"},xml:{$ref:\"#/visitors/document/objects/XML\"},externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"},example:{$ref:\"#/visitors/value\"},deprecated:{$ref:\"#/visitors/value\"}}},Discriminator:{$visitor:Xy,fixedFields:{propertyName:{$ref:\"#/visitors/value\"},mapping:Zy}},XML:{$visitor:ev,fixedFields:{name:{$ref:\"#/visitors/value\"},namespace:{$ref:\"#/visitors/value\"},prefix:{$ref:\"#/visitors/value\"},attribute:{$ref:\"#/visitors/value\"},wrapped:{$ref:\"#/visitors/value\"}}},SecurityScheme:{$visitor:Rb,fixedFields:{type:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},name:{$ref:\"#/visitors/value\"},in:{$ref:\"#/visitors/value\"},scheme:{$ref:\"#/visitors/value\"},bearerFormat:{$ref:\"#/visitors/value\"},flows:{$ref:\"#/visitors/document/objects/OAuthFlows\"},openIdConnectUrl:{$ref:\"#/visitors/value\"}}},OAuthFlows:{$visitor:Lb,fixedFields:{implicit:{$ref:\"#/visitors/document/objects/OAuthFlow\"},password:{$ref:\"#/visitors/document/objects/OAuthFlow\"},clientCredentials:{$ref:\"#/visitors/document/objects/OAuthFlow\"},authorizationCode:{$ref:\"#/visitors/document/objects/OAuthFlow\"}}},OAuthFlow:{$visitor:qb,fixedFields:{authorizationUrl:{$ref:\"#/visitors/value\"},tokenUrl:{$ref:\"#/visitors/value\"},refreshUrl:{$ref:\"#/visitors/value\"},scopes:Qb}},SecurityRequirement:{$visitor:_y}},extension:{$visitor:zm}}}},es_traversal_visitor_getNodeType=o=>{if(sp(o))return`${o.element.charAt(0).toUpperCase()+o.element.slice(1)}Element`},o_={CallbackElement:[\"content\"],ComponentsElement:[\"content\"],ContactElement:[\"content\"],DiscriminatorElement:[\"content\"],Encoding:[\"content\"],Example:[\"content\"],ExternalDocumentationElement:[\"content\"],HeaderElement:[\"content\"],InfoElement:[\"content\"],LicenseElement:[\"content\"],MediaTypeElement:[\"content\"],OAuthFlowElement:[\"content\"],OAuthFlowsElement:[\"content\"],OpenApi3_0Element:[\"content\"],OperationElement:[\"content\"],ParameterElement:[\"content\"],PathItemElement:[\"content\"],PathsElement:[\"content\"],ReferenceElement:[\"content\"],RequestBodyElement:[\"content\"],ResponseElement:[\"content\"],ResponsesElement:[\"content\"],SchemaElement:[\"content\"],SecurityRequirementElement:[\"content\"],SecuritySchemeElement:[\"content\"],ServerElement:[\"content\"],ServerVariableElement:[\"content\"],TagElement:[\"content\"],...xp},s_={namespace:o=>{const{base:s}=o;return s.register(\"callback\",md),s.register(\"components\",yd),s.register(\"contact\",vd),s.register(\"discriminator\",_d),s.register(\"encoding\",Ed),s.register(\"example\",wd),s.register(\"externalDocumentation\",Sd),s.register(\"header\",xd),s.register(\"info\",kd),s.register(\"license\",Od),s.register(\"link\",Cd),s.register(\"mediaType\",Ad),s.register(\"oAuthFlow\",Id),s.register(\"oAuthFlows\",Md),s.register(\"openapi\",Nd),s.register(\"openApi3_0\",Td),s.register(\"operation\",Rd),s.register(\"parameter\",Dd),s.register(\"pathItem\",Ld),s.register(\"paths\",Bd),s.register(\"reference\",Fd),s.register(\"requestBody\",$d),s.register(\"response\",Vd),s.register(\"responses\",Ud),s.register(\"schema\",jm),s.register(\"securityRequirement\",Pm),s.register(\"securityScheme\",Im),s.register(\"server\",Mm),s.register(\"serverVariable\",Nm),s.register(\"tag\",Tm),s.register(\"xml\",Rm),s}},i_=s_,es_refractor_toolbox=()=>{const o=createNamespace(i_);return{predicates:{...pe,isElement:sp,isStringElement:ip,isArrayElement:hp,isObjectElement:pp,isMemberElement:dp,includesClasses,hasElementSourceMap},namespace:o}},es_refractor_refract=(o,{specPath:s=[\"visitors\",\"document\",\"objects\",\"OpenApi\",\"$visitor\"],plugins:i=[]}={})=>{const u=(0,Xu.e)(o),_=dereference(n_),w=new(Np(s,_))({specObj:_});return visitor_visit(u,w),dispatchPluginsSync(w.element,i,{toolboxCreator:es_refractor_toolbox,visitorOptions:{keyMap:o_,nodeTypeGetter:es_traversal_visitor_getNodeType}})},es_refractor_createRefractor=o=>(s,i={})=>es_refractor_refract(s,{specPath:o,...i});md.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Callback\",\"$visitor\"]),yd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Components\",\"$visitor\"]),vd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Contact\",\"$visitor\"]),wd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Example\",\"$visitor\"]),_d.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Discriminator\",\"$visitor\"]),Ed.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Encoding\",\"$visitor\"]),Sd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"ExternalDocumentation\",\"$visitor\"]),xd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Header\",\"$visitor\"]),kd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Info\",\"$visitor\"]),Od.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"License\",\"$visitor\"]),Cd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Link\",\"$visitor\"]),Ad.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"MediaType\",\"$visitor\"]),Id.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OAuthFlow\",\"$visitor\"]),Md.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OAuthFlows\",\"$visitor\"]),Nd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"fixedFields\",\"openapi\"]),Td.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"$visitor\"]),Rd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Operation\",\"$visitor\"]),Dd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Parameter\",\"$visitor\"]),Ld.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"PathItem\",\"$visitor\"]),Bd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Paths\",\"$visitor\"]),Fd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Reference\",\"$visitor\"]),$d.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"RequestBody\",\"$visitor\"]),Vd.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Response\",\"$visitor\"]),Ud.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Responses\",\"$visitor\"]),jm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Schema\",\"$visitor\"]),Pm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"SecurityRequirement\",\"$visitor\"]),Im.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"SecurityScheme\",\"$visitor\"]),Mm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Server\",\"$visitor\"]),Nm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"ServerVariable\",\"$visitor\"]),Tm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Tag\",\"$visitor\"]),Rm.refract=es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"XML\",\"$visitor\"]);const a_=class Callback_Callback extends md{};const c_=class Components_Components extends yd{get pathItems(){return this.get(\"pathItems\")}set pathItems(o){this.set(\"pathItems\",o)}};const l_=class Contact_Contact extends vd{};const u_=class Discriminator_Discriminator extends _d{};const p_=class Encoding_Encoding extends Ed{};const h_=class Example_Example extends wd{};const d_=class ExternalDocumentation_ExternalDocumentation extends Sd{};const f_=class Header_Header extends xd{get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}};const m_=class Info_Info extends kd{get license(){return this.get(\"license\")}set license(o){this.set(\"license\",o)}get summary(){return this.get(\"summary\")}set summary(o){this.set(\"summary\",o)}};class JsonSchemaDialect extends Xu.Om{static default=new JsonSchemaDialect(\"https://spec.openapis.org/oas/3.1/dialect/base\");constructor(o,s,i){super(o,s,i),this.element=\"jsonSchemaDialect\"}}const g_=JsonSchemaDialect;const y_=class License_License extends Od{get identifier(){return this.get(\"identifier\")}set identifier(o){this.set(\"identifier\",o)}};const v_=class Link_Link extends Cd{};const b_=class MediaType_MediaType extends Ad{get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}};const E_=class OAuthFlow_OAuthFlow extends Id{};const w_=class OAuthFlows_OAuthFlows extends Md{};const S_=class Openapi_Openapi extends Nd{};class OpenApi3_1 extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"openApi3_1\",this.classes.push(\"api\")}get openapi(){return this.get(\"openapi\")}set openapi(o){this.set(\"openapi\",o)}get info(){return this.get(\"info\")}set info(o){this.set(\"info\",o)}get jsonSchemaDialect(){return this.get(\"jsonSchemaDialect\")}set jsonSchemaDialect(o){this.set(\"jsonSchemaDialect\",o)}get servers(){return this.get(\"servers\")}set servers(o){this.set(\"servers\",o)}get paths(){return this.get(\"paths\")}set paths(o){this.set(\"paths\",o)}get components(){return this.get(\"components\")}set components(o){this.set(\"components\",o)}get security(){return this.get(\"security\")}set security(o){this.set(\"security\",o)}get tags(){return this.get(\"tags\")}set tags(o){this.set(\"tags\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}get webhooks(){return this.get(\"webhooks\")}set webhooks(o){this.set(\"webhooks\",o)}}const x_=OpenApi3_1;const k_=class Operation_Operation extends Rd{get requestBody(){return this.get(\"requestBody\")}set requestBody(o){this.set(\"requestBody\",o)}};const O_=class Parameter_Parameter extends Dd{get schema(){return this.get(\"schema\")}set schema(o){this.set(\"schema\",o)}};const C_=class PathItem_PathItem extends Ld{get GET(){return this.get(\"get\")}set GET(o){this.set(\"GET\",o)}get PUT(){return this.get(\"put\")}set PUT(o){this.set(\"PUT\",o)}get POST(){return this.get(\"post\")}set POST(o){this.set(\"POST\",o)}get DELETE(){return this.get(\"delete\")}set DELETE(o){this.set(\"DELETE\",o)}get OPTIONS(){return this.get(\"options\")}set OPTIONS(o){this.set(\"OPTIONS\",o)}get HEAD(){return this.get(\"head\")}set HEAD(o){this.set(\"HEAD\",o)}get PATCH(){return this.get(\"patch\")}set PATCH(o){this.set(\"PATCH\",o)}get TRACE(){return this.get(\"trace\")}set TRACE(o){this.set(\"TRACE\",o)}};const A_=class Paths_Paths extends Bd{};class Reference_Reference extends Fd{}Object.defineProperty(Reference_Reference.prototype,\"description\",{get(){return this.get(\"description\")},set(o){this.set(\"description\",o)},enumerable:!0}),Object.defineProperty(Reference_Reference.prototype,\"summary\",{get(){return this.get(\"summary\")},set(o){this.set(\"summary\",o)},enumerable:!0});const j_=Reference_Reference;const P_=class RequestBody_RequestBody extends $d{};const I_=class elements_Response_Response extends Vd{};const M_=class Responses_Responses extends Ud{};class elements_Schema_Schema extends Xu.Sh{constructor(o,s,i){super(o,s,i),this.element=\"schema\"}get $schema(){return this.get(\"$schema\")}set $schema(o){this.set(\"$schema\",o)}get $vocabulary(){return this.get(\"$vocabulary\")}set $vocabulary(o){this.set(\"$vocabulary\",o)}get $id(){return this.get(\"$id\")}set $id(o){this.set(\"$id\",o)}get $anchor(){return this.get(\"$anchor\")}set $anchor(o){this.set(\"$anchor\",o)}get $dynamicAnchor(){return this.get(\"$dynamicAnchor\")}set $dynamicAnchor(o){this.set(\"$dynamicAnchor\",o)}get $dynamicRef(){return this.get(\"$dynamicRef\")}set $dynamicRef(o){this.set(\"$dynamicRef\",o)}get $ref(){return this.get(\"$ref\")}set $ref(o){this.set(\"$ref\",o)}get $defs(){return this.get(\"$defs\")}set $defs(o){this.set(\"$defs\",o)}get $comment(){return this.get(\"$comment\")}set $comment(o){this.set(\"$comment\",o)}get allOf(){return this.get(\"allOf\")}set allOf(o){this.set(\"allOf\",o)}get anyOf(){return this.get(\"anyOf\")}set anyOf(o){this.set(\"anyOf\",o)}get oneOf(){return this.get(\"oneOf\")}set oneOf(o){this.set(\"oneOf\",o)}get not(){return this.get(\"not\")}set not(o){this.set(\"not\",o)}get if(){return this.get(\"if\")}set if(o){this.set(\"if\",o)}get then(){return this.get(\"then\")}set then(o){this.set(\"then\",o)}get else(){return this.get(\"else\")}set else(o){this.set(\"else\",o)}get dependentSchemas(){return this.get(\"dependentSchemas\")}set dependentSchemas(o){this.set(\"dependentSchemas\",o)}get prefixItems(){return this.get(\"prefixItems\")}set prefixItems(o){this.set(\"prefixItems\",o)}get items(){return this.get(\"items\")}set items(o){this.set(\"items\",o)}get containsProp(){return this.get(\"contains\")}set containsProp(o){this.set(\"contains\",o)}get properties(){return this.get(\"properties\")}set properties(o){this.set(\"properties\",o)}get patternProperties(){return this.get(\"patternProperties\")}set patternProperties(o){this.set(\"patternProperties\",o)}get additionalProperties(){return this.get(\"additionalProperties\")}set additionalProperties(o){this.set(\"additionalProperties\",o)}get propertyNames(){return this.get(\"propertyNames\")}set propertyNames(o){this.set(\"propertyNames\",o)}get unevaluatedItems(){return this.get(\"unevaluatedItems\")}set unevaluatedItems(o){this.set(\"unevaluatedItems\",o)}get unevaluatedProperties(){return this.get(\"unevaluatedProperties\")}set unevaluatedProperties(o){this.set(\"unevaluatedProperties\",o)}get type(){return this.get(\"type\")}set type(o){this.set(\"type\",o)}get enum(){return this.get(\"enum\")}set enum(o){this.set(\"enum\",o)}get const(){return this.get(\"const\")}set const(o){this.set(\"const\",o)}get multipleOf(){return this.get(\"multipleOf\")}set multipleOf(o){this.set(\"multipleOf\",o)}get maximum(){return this.get(\"maximum\")}set maximum(o){this.set(\"maximum\",o)}get exclusiveMaximum(){return this.get(\"exclusiveMaximum\")}set exclusiveMaximum(o){this.set(\"exclusiveMaximum\",o)}get minimum(){return this.get(\"minimum\")}set minimum(o){this.set(\"minimum\",o)}get exclusiveMinimum(){return this.get(\"exclusiveMinimum\")}set exclusiveMinimum(o){this.set(\"exclusiveMinimum\",o)}get maxLength(){return this.get(\"maxLength\")}set maxLength(o){this.set(\"maxLength\",o)}get minLength(){return this.get(\"minLength\")}set minLength(o){this.set(\"minLength\",o)}get pattern(){return this.get(\"pattern\")}set pattern(o){this.set(\"pattern\",o)}get maxItems(){return this.get(\"maxItems\")}set maxItems(o){this.set(\"maxItems\",o)}get minItems(){return this.get(\"minItems\")}set minItems(o){this.set(\"minItems\",o)}get uniqueItems(){return this.get(\"uniqueItems\")}set uniqueItems(o){this.set(\"uniqueItems\",o)}get maxContains(){return this.get(\"maxContains\")}set maxContains(o){this.set(\"maxContains\",o)}get minContains(){return this.get(\"minContains\")}set minContains(o){this.set(\"minContains\",o)}get maxProperties(){return this.get(\"maxProperties\")}set maxProperties(o){this.set(\"maxProperties\",o)}get minProperties(){return this.get(\"minProperties\")}set minProperties(o){this.set(\"minProperties\",o)}get required(){return this.get(\"required\")}set required(o){this.set(\"required\",o)}get dependentRequired(){return this.get(\"dependentRequired\")}set dependentRequired(o){this.set(\"dependentRequired\",o)}get title(){return this.get(\"title\")}set title(o){this.set(\"title\",o)}get description(){return this.get(\"description\")}set description(o){this.set(\"description\",o)}get default(){return this.get(\"default\")}set default(o){this.set(\"default\",o)}get deprecated(){return this.get(\"deprecated\")}set deprecated(o){this.set(\"deprecated\",o)}get readOnly(){return this.get(\"readOnly\")}set readOnly(o){this.set(\"readOnly\",o)}get writeOnly(){return this.get(\"writeOnly\")}set writeOnly(o){this.set(\"writeOnly\",o)}get examples(){return this.get(\"examples\")}set examples(o){this.set(\"examples\",o)}get format(){return this.get(\"format\")}set format(o){this.set(\"format\",o)}get contentEncoding(){return this.get(\"contentEncoding\")}set contentEncoding(o){this.set(\"contentEncoding\",o)}get contentMediaType(){return this.get(\"contentMediaType\")}set contentMediaType(o){this.set(\"contentMediaType\",o)}get contentSchema(){return this.get(\"contentSchema\")}set contentSchema(o){this.set(\"contentSchema\",o)}get discriminator(){return this.get(\"discriminator\")}set discriminator(o){this.set(\"discriminator\",o)}get xml(){return this.get(\"xml\")}set xml(o){this.set(\"xml\",o)}get externalDocs(){return this.get(\"externalDocs\")}set externalDocs(o){this.set(\"externalDocs\",o)}get example(){return this.get(\"example\")}set example(o){this.set(\"example\",o)}}const N_=elements_Schema_Schema;const T_=class SecurityRequirement_SecurityRequirement extends Pm{};const R_=class SecurityScheme_SecurityScheme extends Im{};const D_=class Server_Server extends Mm{};const L_=class ServerVariable_ServerVariable extends Nm{};const B_=class Tag_Tag extends Tm{};const F_=class Xml_Xml extends Rm{};class OpenApi3_1Visitor extends(Mixin($m,Lm)){constructor(o){super(o),this.element=new x_,this.specPath=Ul([\"document\",\"objects\",\"OpenApi\"]),this.canSupportSpecificationExtensions=!0,this.openApiSemanticElement=this.element}ObjectElement(o){return this.openApiGenericElement=o,$m.prototype.ObjectElement.call(this,o)}}const q_=OpenApi3_1Visitor,{visitors:{document:{objects:{Info:{$visitor:$_}}}}}=n_;const V_=class info_InfoVisitor extends $_{constructor(o){super(o),this.element=new m_}},{visitors:{document:{objects:{Contact:{$visitor:U_}}}}}=n_;const z_=class contact_ContactVisitor extends U_{constructor(o){super(o),this.element=new l_}},{visitors:{document:{objects:{License:{$visitor:W_}}}}}=n_;const K_=class license_LicenseVisitor extends W_{constructor(o){super(o),this.element=new y_}},{visitors:{document:{objects:{Link:{$visitor:H_}}}}}=n_;const J_=class link_LinkVisitor extends H_{constructor(o){super(o),this.element=new v_}};class JsonSchemaDialectVisitor extends(Mixin(Bm,Lm)){StringElement(o){const s=new g_(serializers_value(o));return this.copyMetaAndAttributes(o,s),this.element=s,Yu}}const G_=JsonSchemaDialectVisitor,{visitors:{document:{objects:{Server:{$visitor:Y_}}}}}=n_;const X_=class server_ServerVisitor extends Y_{constructor(o){super(o),this.element=new D_}},{visitors:{document:{objects:{ServerVariable:{$visitor:Q_}}}}}=n_;const Z_=class server_variable_ServerVariableVisitor extends Q_{constructor(o){super(o),this.element=new L_}},{visitors:{document:{objects:{MediaType:{$visitor:eE}}}}}=n_;const tE=class media_type_MediaTypeVisitor extends eE{constructor(o){super(o),this.element=new b_}},{visitors:{document:{objects:{SecurityRequirement:{$visitor:rE}}}}}=n_;const nE=class security_requirement_SecurityRequirementVisitor extends rE{constructor(o){super(o),this.element=new T_}},{visitors:{document:{objects:{Components:{$visitor:oE}}}}}=n_;const sE=class components_ComponentsVisitor extends oE{constructor(o){super(o),this.element=new c_}},{visitors:{document:{objects:{Tag:{$visitor:iE}}}}}=n_;const aE=class tag_TagVisitor extends iE{constructor(o){super(o),this.element=new B_}},{visitors:{document:{objects:{Reference:{$visitor:cE}}}}}=n_;const lE=class reference_ReferenceVisitor extends cE{constructor(o){super(o),this.element=new j_}},{visitors:{document:{objects:{Parameter:{$visitor:uE}}}}}=n_;const pE=class parameter_ParameterVisitor extends uE{constructor(o){super(o),this.element=new O_}},{visitors:{document:{objects:{Header:{$visitor:hE}}}}}=n_;const dE=class header_HeaderVisitor extends hE{constructor(o){super(o),this.element=new f_}},fE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof a_||o(u)&&s(\"callback\",u)&&i(\"object\",u))),mE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof c_||o(u)&&s(\"components\",u)&&i(\"object\",u))),gE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof l_||o(u)&&s(\"contact\",u)&&i(\"object\",u))),yE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof h_||o(u)&&s(\"example\",u)&&i(\"object\",u))),vE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof d_||o(u)&&s(\"externalDocumentation\",u)&&i(\"object\",u))),bE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof f_||o(u)&&s(\"header\",u)&&i(\"object\",u))),_E=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof m_||o(u)&&s(\"info\",u)&&i(\"object\",u))),EE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof g_||o(u)&&s(\"jsonSchemaDialect\",u)&&i(\"string\",u))),wE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof y_||o(u)&&s(\"license\",u)&&i(\"object\",u))),SE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof v_||o(u)&&s(\"link\",u)&&i(\"object\",u))),xE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof S_||o(u)&&s(\"openapi\",u)&&i(\"string\",u))),kE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i,hasClass:u})=>_=>_ instanceof x_||o(_)&&s(\"openApi3_1\",_)&&i(\"object\",_)&&u(\"api\",_))),OE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof k_||o(u)&&s(\"operation\",u)&&i(\"object\",u))),CE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof O_||o(u)&&s(\"parameter\",u)&&i(\"object\",u))),AE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof C_||o(u)&&s(\"pathItem\",u)&&i(\"object\",u))),isPathItemElementExternal=o=>{if(!AE(o))return!1;if(!ip(o.$ref))return!1;const s=serializers_value(o.$ref);return\"string\"==typeof s&&s.length>0&&!s.startsWith(\"#\")},jE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof A_||o(u)&&s(\"paths\",u)&&i(\"object\",u))),PE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof j_||o(u)&&s(\"reference\",u)&&i(\"object\",u))),isReferenceElementExternal=o=>{if(!PE(o))return!1;if(!ip(o.$ref))return!1;const s=serializers_value(o.$ref);return\"string\"==typeof s&&s.length>0&&!s.startsWith(\"#\")},IE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof P_||o(u)&&s(\"requestBody\",u)&&i(\"object\",u))),ME=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof I_||o(u)&&s(\"response\",u)&&i(\"object\",u))),NE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof M_||o(u)&&s(\"responses\",u)&&i(\"object\",u))),TE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof N_||o(u)&&s(\"schema\",u)&&i(\"object\",u))),predicates_isBooleanJsonSchemaElement=o=>up(o)&&o.classes.includes(\"boolean-json-schema\"),RE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof T_||o(u)&&s(\"securityRequirement\",u)&&i(\"object\",u))),DE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof R_||o(u)&&s(\"securityScheme\",u)&&i(\"object\",u))),LE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof D_||o(u)&&s(\"server\",u)&&i(\"object\",u))),BE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof L_||o(u)&&s(\"serverVariable\",u)&&i(\"object\",u))),FE=helpers((({hasBasicElementProps:o,isElementType:s,primitiveEq:i})=>u=>u instanceof b_||o(u)&&s(\"mediaType\",u)&&i(\"object\",u)));const qE=class ParentSchemaAwareVisitor_ParentSchemaAwareVisitor{parent;constructor({parent:o}){this.parent=o}};class open_api_3_1_schema_SchemaVisitor extends(Mixin($m,qE,Lm)){constructor(o){super(o),this.element=new N_,this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.canSupportSpecificationExtensions=!0,this.jsonSchemaDefaultDialect=g_.default,this.passingOptionsNames.push(\"parent\")}ObjectElement(o){this.handle$schema(o),this.handle$id(o),this.parent=this.element;const s=$m.prototype.ObjectElement.call(this,o);return ip(this.element.$ref)&&(this.element.classes.push(\"reference-element\"),this.element.setMetaProperty(\"referenced-element\",\"schema\")),s}BooleanElement(o){const s=super.enter(o);return this.element.classes.push(\"boolean-json-schema\"),s}getJsonSchemaDialect(){let o;return o=void 0!==this.openApiSemanticElement&&EE(this.openApiSemanticElement.jsonSchemaDialect)?serializers_value(this.openApiSemanticElement.jsonSchemaDialect):void 0!==this.openApiGenericElement&&ip(this.openApiGenericElement.get(\"jsonSchemaDialect\"))?serializers_value(this.openApiGenericElement.get(\"jsonSchemaDialect\")):serializers_value(this.jsonSchemaDefaultDialect),o}handle$schema(o){if(Wl(this.parent)&&!ip(o.get(\"$schema\")))this.element.setMetaProperty(\"inherited$schema\",this.getJsonSchemaDialect());else if(TE(this.parent)&&!ip(o.get(\"$schema\"))){const o=Qc(serializers_value(this.parent.meta.get(\"inherited$schema\")),serializers_value(this.parent.$schema));this.element.setMetaProperty(\"inherited$schema\",o)}}handle$id(o){const s=void 0!==this.parent?cloneDeep(this.parent.getMetaProperty(\"inherited$id\",[])):new Xu.wE,i=serializers_value(o.get(\"$id\"));Df(i)&&s.push(i),this.element.setMetaProperty(\"inherited$id\",s)}}const $E=open_api_3_1_schema_SchemaVisitor;const VE=class $vocabularyVisitor extends Lm{ObjectElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-$vocabulary\"),s}};const UE=class $refVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"reference-value\"),s}};class $defsVisitor extends(Mixin(Zm,qE,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-$defs\"),this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.passingOptionsNames.push(\"parent\")}}const zE=$defsVisitor;class schema_AllOfVisitor_AllOfVisitor extends(Mixin(Bm,qE,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-allOf\"),this.passingOptionsNames.push(\"parent\")}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"Schema\"],o);this.element.push(s)}else{const s=cloneDeep(o);this.element.push(s)}})),this.copyMetaAndAttributes(o,this.element),Yu}}const WE=schema_AllOfVisitor_AllOfVisitor;class schema_AnyOfVisitor_AnyOfVisitor extends(Mixin(Bm,qE,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-anyOf\"),this.passingOptionsNames.push(\"parent\")}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"Schema\"],o);this.element.push(s)}else{const s=cloneDeep(o);this.element.push(s)}})),this.copyMetaAndAttributes(o,this.element),Yu}}const KE=schema_AnyOfVisitor_AnyOfVisitor;class schema_OneOfVisitor_OneOfVisitor extends(Mixin(Bm,qE,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-oneOf\"),this.passingOptionsNames.push(\"parent\")}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"Schema\"],o);this.element.push(s)}else{const s=cloneDeep(o);this.element.push(s)}})),this.copyMetaAndAttributes(o,this.element),Yu}}const HE=schema_OneOfVisitor_OneOfVisitor;class DependentSchemasVisitor extends(Mixin(Zm,qE,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-dependentSchemas\"),this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.passingOptionsNames.push(\"parent\")}}const JE=DependentSchemasVisitor;class PrefixItemsVisitor extends(Mixin(Bm,qE,Lm)){constructor(o){super(o),this.element=new Xu.wE,this.element.classes.push(\"json-schema-prefixItems\"),this.passingOptionsNames.push(\"parent\")}ArrayElement(o){return o.forEach((o=>{if(pp(o)){const s=this.toRefractedElement([\"document\",\"objects\",\"Schema\"],o);this.element.push(s)}else{const s=cloneDeep(o);this.element.push(s)}})),this.copyMetaAndAttributes(o,this.element),Yu}}const GE=PrefixItemsVisitor;class schema_PropertiesVisitor_PropertiesVisitor extends(Mixin(Zm,qE,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-properties\"),this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.passingOptionsNames.push(\"parent\")}}const YE=schema_PropertiesVisitor_PropertiesVisitor;class PatternPropertiesVisitor_PatternPropertiesVisitor extends(Mixin(Zm,qE,Lm)){constructor(o){super(o),this.element=new Xu.Sh,this.element.classes.push(\"json-schema-patternProperties\"),this.specPath=Ul([\"document\",\"objects\",\"Schema\"]),this.passingOptionsNames.push(\"parent\")}}const XE=PatternPropertiesVisitor_PatternPropertiesVisitor;const QE=class schema_TypeVisitor_TypeVisitor extends Lm{StringElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-type\"),s}ArrayElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-type\"),s}};const ZE=class EnumVisitor_EnumVisitor extends Lm{ArrayElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-enum\"),s}};const ew=class DependentRequiredVisitor extends Lm{ObjectElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-dependentRequired\"),s}};const tw=class schema_ExamplesVisitor_ExamplesVisitor extends Lm{ArrayElement(o){const s=super.enter(o);return this.element.classes.push(\"json-schema-examples\"),s}},{visitors:{document:{objects:{Discriminator:{$visitor:rw}}}}}=n_;const nw=class distriminator_DiscriminatorVisitor extends rw{constructor(o){super(o),this.element=new u_,this.canSupportSpecificationExtensions=!0}},{visitors:{document:{objects:{XML:{$visitor:ow}}}}}=n_;const sw=class xml_XmlVisitor extends ow{constructor(o){super(o),this.element=new F_}};class SchemasVisitor_SchemasVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new sv,this.specPath=Ul([\"document\",\"objects\",\"Schema\"])}}const iw=SchemasVisitor_SchemasVisitor;class ComponentsPathItems extends Xu.Sh{static primaryClass=\"components-path-items\";constructor(o,s,i){super(o,s,i),this.classes.push(ComponentsPathItems.primaryClass)}}const aw=ComponentsPathItems;class PathItemsVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new aw,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"PathItem\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(PE).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"pathItem\")})),s}}const cw=PathItemsVisitor,{visitors:{document:{objects:{Example:{$visitor:lw}}}}}=n_;const uw=class example_ExampleVisitor extends lw{constructor(o){super(o),this.element=new h_}},{visitors:{document:{objects:{ExternalDocumentation:{$visitor:pw}}}}}=n_;const hw=class external_documentation_ExternalDocumentationVisitor extends pw{constructor(o){super(o),this.element=new d_}},{visitors:{document:{objects:{Encoding:{$visitor:dw}}}}}=n_;const fw=class open_api_3_1_encoding_EncodingVisitor extends dw{constructor(o){super(o),this.element=new p_}},{visitors:{document:{objects:{Paths:{$visitor:mw}}}}}=n_;const gw=class paths_PathsVisitor extends mw{constructor(o){super(o),this.element=new A_}},{visitors:{document:{objects:{RequestBody:{$visitor:yw}}}}}=n_;const vw=class request_body_RequestBodyVisitor extends yw{constructor(o){super(o),this.element=new P_}},{visitors:{document:{objects:{Callback:{$visitor:bw}}}}}=n_;const _w=class callback_CallbackVisitor extends bw{constructor(o){super(o),this.element=new a_,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"PathItem\"]}ObjectElement(o){const s=bw.prototype.ObjectElement.call(this,o);return this.element.filter(PE).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"pathItem\")})),s}},{visitors:{document:{objects:{Response:{$visitor:Ew}}}}}=n_;const ww=class response_ResponseVisitor extends Ew{constructor(o){super(o),this.element=new I_}},{visitors:{document:{objects:{Responses:{$visitor:Sw}}}}}=n_;const xw=class open_api_3_1_responses_ResponsesVisitor extends Sw{constructor(o){super(o),this.element=new M_}},{visitors:{document:{objects:{Operation:{$visitor:kw}}}}}=n_;const Ow=class operation_OperationVisitor extends kw{constructor(o){super(o),this.element=new k_}},{visitors:{document:{objects:{PathItem:{$visitor:Cw}}}}}=n_;const Aw=class path_item_PathItemVisitor extends Cw{constructor(o){super(o),this.element=new C_}},{visitors:{document:{objects:{SecurityScheme:{$visitor:jw}}}}}=n_;const Pw=class security_scheme_SecuritySchemeVisitor extends jw{constructor(o){super(o),this.element=new R_}},{visitors:{document:{objects:{OAuthFlows:{$visitor:Iw}}}}}=n_;const Mw=class oauth_flows_OAuthFlowsVisitor extends Iw{constructor(o){super(o),this.element=new w_}},{visitors:{document:{objects:{OAuthFlow:{$visitor:Nw}}}}}=n_;const Tw=class oauth_flow_OAuthFlowVisitor extends Nw{constructor(o){super(o),this.element=new E_}};class Webhooks extends Xu.Sh{static primaryClass=\"webhooks\";constructor(o,s,i){super(o,s,i),this.classes.push(Webhooks.primaryClass)}}const Rw=Webhooks;class WebhooksVisitor extends(Mixin(Zm,Lm)){constructor(o){super(o),this.element=new Rw,this.specPath=o=>isReferenceLikeElement(o)?[\"document\",\"objects\",\"Reference\"]:[\"document\",\"objects\",\"PathItem\"]}ObjectElement(o){const s=Zm.prototype.ObjectElement.call(this,o);return this.element.filter(PE).forEach((o=>{o.setMetaProperty(\"referenced-element\",\"pathItem\")})),this.element.filter(AE).forEach(((o,s)=>{o.setMetaProperty(\"webhook-name\",serializers_value(s))})),s}}const Dw=WebhooksVisitor,Lw={visitors:{value:n_.visitors.value,document:{objects:{OpenApi:{$visitor:q_,fixedFields:{openapi:n_.visitors.document.objects.OpenApi.fixedFields.openapi,info:{$ref:\"#/visitors/document/objects/Info\"},jsonSchemaDialect:G_,servers:n_.visitors.document.objects.OpenApi.fixedFields.servers,paths:{$ref:\"#/visitors/document/objects/Paths\"},webhooks:Dw,components:{$ref:\"#/visitors/document/objects/Components\"},security:n_.visitors.document.objects.OpenApi.fixedFields.security,tags:n_.visitors.document.objects.OpenApi.fixedFields.tags,externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"}}},Info:{$visitor:V_,fixedFields:{title:n_.visitors.document.objects.Info.fixedFields.title,description:n_.visitors.document.objects.Info.fixedFields.description,summary:{$ref:\"#/visitors/value\"},termsOfService:n_.visitors.document.objects.Info.fixedFields.termsOfService,contact:{$ref:\"#/visitors/document/objects/Contact\"},license:{$ref:\"#/visitors/document/objects/License\"},version:n_.visitors.document.objects.Info.fixedFields.version}},Contact:{$visitor:z_,fixedFields:{name:n_.visitors.document.objects.Contact.fixedFields.name,url:n_.visitors.document.objects.Contact.fixedFields.url,email:n_.visitors.document.objects.Contact.fixedFields.email}},License:{$visitor:K_,fixedFields:{name:n_.visitors.document.objects.License.fixedFields.name,identifier:{$ref:\"#/visitors/value\"},url:n_.visitors.document.objects.License.fixedFields.url}},Server:{$visitor:X_,fixedFields:{url:n_.visitors.document.objects.Server.fixedFields.url,description:n_.visitors.document.objects.Server.fixedFields.description,variables:n_.visitors.document.objects.Server.fixedFields.variables}},ServerVariable:{$visitor:Z_,fixedFields:{enum:n_.visitors.document.objects.ServerVariable.fixedFields.enum,default:n_.visitors.document.objects.ServerVariable.fixedFields.default,description:n_.visitors.document.objects.ServerVariable.fixedFields.description}},Components:{$visitor:sE,fixedFields:{schemas:iw,responses:n_.visitors.document.objects.Components.fixedFields.responses,parameters:n_.visitors.document.objects.Components.fixedFields.parameters,examples:n_.visitors.document.objects.Components.fixedFields.examples,requestBodies:n_.visitors.document.objects.Components.fixedFields.requestBodies,headers:n_.visitors.document.objects.Components.fixedFields.headers,securitySchemes:n_.visitors.document.objects.Components.fixedFields.securitySchemes,links:n_.visitors.document.objects.Components.fixedFields.links,callbacks:n_.visitors.document.objects.Components.fixedFields.callbacks,pathItems:cw}},Paths:{$visitor:gw},PathItem:{$visitor:Aw,fixedFields:{$ref:n_.visitors.document.objects.PathItem.fixedFields.$ref,summary:n_.visitors.document.objects.PathItem.fixedFields.summary,description:n_.visitors.document.objects.PathItem.fixedFields.description,get:{$ref:\"#/visitors/document/objects/Operation\"},put:{$ref:\"#/visitors/document/objects/Operation\"},post:{$ref:\"#/visitors/document/objects/Operation\"},delete:{$ref:\"#/visitors/document/objects/Operation\"},options:{$ref:\"#/visitors/document/objects/Operation\"},head:{$ref:\"#/visitors/document/objects/Operation\"},patch:{$ref:\"#/visitors/document/objects/Operation\"},trace:{$ref:\"#/visitors/document/objects/Operation\"},servers:n_.visitors.document.objects.PathItem.fixedFields.servers,parameters:n_.visitors.document.objects.PathItem.fixedFields.parameters}},Operation:{$visitor:Ow,fixedFields:{tags:n_.visitors.document.objects.Operation.fixedFields.tags,summary:n_.visitors.document.objects.Operation.fixedFields.summary,description:n_.visitors.document.objects.Operation.fixedFields.description,externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"},operationId:n_.visitors.document.objects.Operation.fixedFields.operationId,parameters:n_.visitors.document.objects.Operation.fixedFields.parameters,requestBody:n_.visitors.document.objects.Operation.fixedFields.requestBody,responses:{$ref:\"#/visitors/document/objects/Responses\"},callbacks:n_.visitors.document.objects.Operation.fixedFields.callbacks,deprecated:n_.visitors.document.objects.Operation.fixedFields.deprecated,security:n_.visitors.document.objects.Operation.fixedFields.security,servers:n_.visitors.document.objects.Operation.fixedFields.servers}},ExternalDocumentation:{$visitor:hw,fixedFields:{description:n_.visitors.document.objects.ExternalDocumentation.fixedFields.description,url:n_.visitors.document.objects.ExternalDocumentation.fixedFields.url}},Parameter:{$visitor:pE,fixedFields:{name:n_.visitors.document.objects.Parameter.fixedFields.name,in:n_.visitors.document.objects.Parameter.fixedFields.in,description:n_.visitors.document.objects.Parameter.fixedFields.description,required:n_.visitors.document.objects.Parameter.fixedFields.required,deprecated:n_.visitors.document.objects.Parameter.fixedFields.deprecated,allowEmptyValue:n_.visitors.document.objects.Parameter.fixedFields.allowEmptyValue,style:n_.visitors.document.objects.Parameter.fixedFields.style,explode:n_.visitors.document.objects.Parameter.fixedFields.explode,allowReserved:n_.visitors.document.objects.Parameter.fixedFields.allowReserved,schema:{$ref:\"#/visitors/document/objects/Schema\"},example:n_.visitors.document.objects.Parameter.fixedFields.example,examples:n_.visitors.document.objects.Parameter.fixedFields.examples,content:n_.visitors.document.objects.Parameter.fixedFields.content}},RequestBody:{$visitor:vw,fixedFields:{description:n_.visitors.document.objects.RequestBody.fixedFields.description,content:n_.visitors.document.objects.RequestBody.fixedFields.content,required:n_.visitors.document.objects.RequestBody.fixedFields.required}},MediaType:{$visitor:tE,fixedFields:{schema:{$ref:\"#/visitors/document/objects/Schema\"},example:n_.visitors.document.objects.MediaType.fixedFields.example,examples:n_.visitors.document.objects.MediaType.fixedFields.examples,encoding:n_.visitors.document.objects.MediaType.fixedFields.encoding}},Encoding:{$visitor:fw,fixedFields:{contentType:n_.visitors.document.objects.Encoding.fixedFields.contentType,headers:n_.visitors.document.objects.Encoding.fixedFields.headers,style:n_.visitors.document.objects.Encoding.fixedFields.style,explode:n_.visitors.document.objects.Encoding.fixedFields.explode,allowReserved:n_.visitors.document.objects.Encoding.fixedFields.allowReserved}},Responses:{$visitor:xw,fixedFields:{default:n_.visitors.document.objects.Responses.fixedFields.default}},Response:{$visitor:ww,fixedFields:{description:n_.visitors.document.objects.Response.fixedFields.description,headers:n_.visitors.document.objects.Response.fixedFields.headers,content:n_.visitors.document.objects.Response.fixedFields.content,links:n_.visitors.document.objects.Response.fixedFields.links}},Callback:{$visitor:_w},Example:{$visitor:uw,fixedFields:{summary:n_.visitors.document.objects.Example.fixedFields.summary,description:n_.visitors.document.objects.Example.fixedFields.description,value:n_.visitors.document.objects.Example.fixedFields.value,externalValue:n_.visitors.document.objects.Example.fixedFields.externalValue}},Link:{$visitor:J_,fixedFields:{operationRef:n_.visitors.document.objects.Link.fixedFields.operationRef,operationId:n_.visitors.document.objects.Link.fixedFields.operationId,parameters:n_.visitors.document.objects.Link.fixedFields.parameters,requestBody:n_.visitors.document.objects.Link.fixedFields.requestBody,description:n_.visitors.document.objects.Link.fixedFields.description,server:{$ref:\"#/visitors/document/objects/Server\"}}},Header:{$visitor:dE,fixedFields:{description:n_.visitors.document.objects.Header.fixedFields.description,required:n_.visitors.document.objects.Header.fixedFields.required,deprecated:n_.visitors.document.objects.Header.fixedFields.deprecated,allowEmptyValue:n_.visitors.document.objects.Header.fixedFields.allowEmptyValue,style:n_.visitors.document.objects.Header.fixedFields.style,explode:n_.visitors.document.objects.Header.fixedFields.explode,allowReserved:n_.visitors.document.objects.Header.fixedFields.allowReserved,schema:{$ref:\"#/visitors/document/objects/Schema\"},example:n_.visitors.document.objects.Header.fixedFields.example,examples:n_.visitors.document.objects.Header.fixedFields.examples,content:n_.visitors.document.objects.Header.fixedFields.content}},Tag:{$visitor:aE,fixedFields:{name:n_.visitors.document.objects.Tag.fixedFields.name,description:n_.visitors.document.objects.Tag.fixedFields.description,externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"}}},Reference:{$visitor:lE,fixedFields:{$ref:n_.visitors.document.objects.Reference.fixedFields.$ref,summary:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"}}},Schema:{$visitor:$E,fixedFields:{$schema:{$ref:\"#/visitors/value\"},$vocabulary:VE,$id:{$ref:\"#/visitors/value\"},$anchor:{$ref:\"#/visitors/value\"},$dynamicAnchor:{$ref:\"#/visitors/value\"},$dynamicRef:{$ref:\"#/visitors/value\"},$ref:UE,$defs:zE,$comment:{$ref:\"#/visitors/value\"},allOf:WE,anyOf:KE,oneOf:HE,not:{$ref:\"#/visitors/document/objects/Schema\"},if:{$ref:\"#/visitors/document/objects/Schema\"},then:{$ref:\"#/visitors/document/objects/Schema\"},else:{$ref:\"#/visitors/document/objects/Schema\"},dependentSchemas:JE,prefixItems:GE,items:{$ref:\"#/visitors/document/objects/Schema\"},contains:{$ref:\"#/visitors/document/objects/Schema\"},properties:YE,patternProperties:XE,additionalProperties:{$ref:\"#/visitors/document/objects/Schema\"},propertyNames:{$ref:\"#/visitors/document/objects/Schema\"},unevaluatedItems:{$ref:\"#/visitors/document/objects/Schema\"},unevaluatedProperties:{$ref:\"#/visitors/document/objects/Schema\"},type:QE,enum:ZE,const:{$ref:\"#/visitors/value\"},multipleOf:{$ref:\"#/visitors/value\"},maximum:{$ref:\"#/visitors/value\"},exclusiveMaximum:{$ref:\"#/visitors/value\"},minimum:{$ref:\"#/visitors/value\"},exclusiveMinimum:{$ref:\"#/visitors/value\"},maxLength:{$ref:\"#/visitors/value\"},minLength:{$ref:\"#/visitors/value\"},pattern:{$ref:\"#/visitors/value\"},maxItems:{$ref:\"#/visitors/value\"},minItems:{$ref:\"#/visitors/value\"},uniqueItems:{$ref:\"#/visitors/value\"},maxContains:{$ref:\"#/visitors/value\"},minContains:{$ref:\"#/visitors/value\"},maxProperties:{$ref:\"#/visitors/value\"},minProperties:{$ref:\"#/visitors/value\"},required:{$ref:\"#/visitors/value\"},dependentRequired:ew,title:{$ref:\"#/visitors/value\"},description:{$ref:\"#/visitors/value\"},default:{$ref:\"#/visitors/value\"},deprecated:{$ref:\"#/visitors/value\"},readOnly:{$ref:\"#/visitors/value\"},writeOnly:{$ref:\"#/visitors/value\"},examples:tw,format:{$ref:\"#/visitors/value\"},contentEncoding:{$ref:\"#/visitors/value\"},contentMediaType:{$ref:\"#/visitors/value\"},contentSchema:{$ref:\"#/visitors/document/objects/Schema\"},discriminator:{$ref:\"#/visitors/document/objects/Discriminator\"},xml:{$ref:\"#/visitors/document/objects/XML\"},externalDocs:{$ref:\"#/visitors/document/objects/ExternalDocumentation\"},example:{$ref:\"#/visitors/value\"}}},Discriminator:{$visitor:nw,fixedFields:{propertyName:n_.visitors.document.objects.Discriminator.fixedFields.propertyName,mapping:n_.visitors.document.objects.Discriminator.fixedFields.mapping}},XML:{$visitor:sw,fixedFields:{name:n_.visitors.document.objects.XML.fixedFields.name,namespace:n_.visitors.document.objects.XML.fixedFields.namespace,prefix:n_.visitors.document.objects.XML.fixedFields.prefix,attribute:n_.visitors.document.objects.XML.fixedFields.attribute,wrapped:n_.visitors.document.objects.XML.fixedFields.wrapped}},SecurityScheme:{$visitor:Pw,fixedFields:{type:n_.visitors.document.objects.SecurityScheme.fixedFields.type,description:n_.visitors.document.objects.SecurityScheme.fixedFields.description,name:n_.visitors.document.objects.SecurityScheme.fixedFields.name,in:n_.visitors.document.objects.SecurityScheme.fixedFields.in,scheme:n_.visitors.document.objects.SecurityScheme.fixedFields.scheme,bearerFormat:n_.visitors.document.objects.SecurityScheme.fixedFields.bearerFormat,flows:{$ref:\"#/visitors/document/objects/OAuthFlows\"},openIdConnectUrl:n_.visitors.document.objects.SecurityScheme.fixedFields.openIdConnectUrl}},OAuthFlows:{$visitor:Mw,fixedFields:{implicit:{$ref:\"#/visitors/document/objects/OAuthFlow\"},password:{$ref:\"#/visitors/document/objects/OAuthFlow\"},clientCredentials:{$ref:\"#/visitors/document/objects/OAuthFlow\"},authorizationCode:{$ref:\"#/visitors/document/objects/OAuthFlow\"}}},OAuthFlow:{$visitor:Tw,fixedFields:{authorizationUrl:n_.visitors.document.objects.OAuthFlow.fixedFields.authorizationUrl,tokenUrl:n_.visitors.document.objects.OAuthFlow.fixedFields.tokenUrl,refreshUrl:n_.visitors.document.objects.OAuthFlow.fixedFields.refreshUrl,scopes:n_.visitors.document.objects.OAuthFlow.fixedFields.scopes}},SecurityRequirement:{$visitor:nE}},extension:{$visitor:n_.visitors.document.extension.$visitor}}}},apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType=o=>{if(sp(o))return`${o.element.charAt(0).toUpperCase()+o.element.slice(1)}Element`},Bw={CallbackElement:[\"content\"],ComponentsElement:[\"content\"],ContactElement:[\"content\"],DiscriminatorElement:[\"content\"],Encoding:[\"content\"],Example:[\"content\"],ExternalDocumentationElement:[\"content\"],HeaderElement:[\"content\"],InfoElement:[\"content\"],LicenseElement:[\"content\"],MediaTypeElement:[\"content\"],OAuthFlowElement:[\"content\"],OAuthFlowsElement:[\"content\"],OpenApi3_1Element:[\"content\"],OperationElement:[\"content\"],ParameterElement:[\"content\"],PathItemElement:[\"content\"],PathsElement:[\"content\"],ReferenceElement:[\"content\"],RequestBodyElement:[\"content\"],ResponseElement:[\"content\"],ResponsesElement:[\"content\"],SchemaElement:[\"content\"],SecurityRequirementElement:[\"content\"],SecuritySchemeElement:[\"content\"],ServerElement:[\"content\"],ServerVariableElement:[\"content\"],TagElement:[\"content\"],...xp},Fw={namespace:o=>{const{base:s}=o;return s.register(\"callback\",a_),s.register(\"components\",c_),s.register(\"contact\",l_),s.register(\"discriminator\",u_),s.register(\"encoding\",p_),s.register(\"example\",h_),s.register(\"externalDocumentation\",d_),s.register(\"header\",f_),s.register(\"info\",m_),s.register(\"jsonSchemaDialect\",g_),s.register(\"license\",y_),s.register(\"link\",v_),s.register(\"mediaType\",b_),s.register(\"oAuthFlow\",E_),s.register(\"oAuthFlows\",w_),s.register(\"openapi\",S_),s.register(\"openApi3_1\",x_),s.register(\"operation\",k_),s.register(\"parameter\",O_),s.register(\"pathItem\",C_),s.register(\"paths\",A_),s.register(\"reference\",j_),s.register(\"requestBody\",P_),s.register(\"response\",I_),s.register(\"responses\",M_),s.register(\"schema\",N_),s.register(\"securityRequirement\",T_),s.register(\"securityScheme\",R_),s.register(\"server\",D_),s.register(\"serverVariable\",L_),s.register(\"tag\",B_),s.register(\"xml\",F_),s}},qw=Fw,apidom_ns_openapi_3_1_es_refractor_toolbox=()=>{const o=createNamespace(qw);return{predicates:{...de,isElement:sp,isStringElement:ip,isArrayElement:hp,isObjectElement:pp,isMemberElement:dp,isServersElement:dy,includesClasses,hasElementSourceMap},namespace:o}},apidom_ns_openapi_3_1_es_refractor_refract=(o,{specPath:s=[\"visitors\",\"document\",\"objects\",\"OpenApi\",\"$visitor\"],plugins:i=[]}={})=>{const u=(0,Xu.e)(o),_=dereference(Lw),w=new(Np(s,_))({specObj:_});return visitor_visit(u,w),dispatchPluginsSync(w.element,i,{toolboxCreator:apidom_ns_openapi_3_1_es_refractor_toolbox,visitorOptions:{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}})},apidom_ns_openapi_3_1_es_refractor_createRefractor=o=>(s,i={})=>apidom_ns_openapi_3_1_es_refractor_refract(s,{specPath:o,...i});a_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Callback\",\"$visitor\"]),c_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Components\",\"$visitor\"]),l_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Contact\",\"$visitor\"]),h_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Example\",\"$visitor\"]),u_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Discriminator\",\"$visitor\"]),p_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Encoding\",\"$visitor\"]),d_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"ExternalDocumentation\",\"$visitor\"]),f_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Header\",\"$visitor\"]),m_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Info\",\"$visitor\"]),g_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"fixedFields\",\"jsonSchemaDialect\"]),y_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"License\",\"$visitor\"]),v_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Link\",\"$visitor\"]),b_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"MediaType\",\"$visitor\"]),E_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OAuthFlow\",\"$visitor\"]),w_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OAuthFlows\",\"$visitor\"]),S_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"fixedFields\",\"openapi\"]),x_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"OpenApi\",\"$visitor\"]),k_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Operation\",\"$visitor\"]),O_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Parameter\",\"$visitor\"]),C_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"PathItem\",\"$visitor\"]),A_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Paths\",\"$visitor\"]),j_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Reference\",\"$visitor\"]),P_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"RequestBody\",\"$visitor\"]),I_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Response\",\"$visitor\"]),M_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Responses\",\"$visitor\"]),N_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Schema\",\"$visitor\"]),T_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"SecurityRequirement\",\"$visitor\"]),R_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"SecurityScheme\",\"$visitor\"]),D_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Server\",\"$visitor\"]),L_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"ServerVariable\",\"$visitor\"]),B_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"Tag\",\"$visitor\"]),F_.refract=apidom_ns_openapi_3_1_es_refractor_createRefractor([\"visitors\",\"document\",\"objects\",\"XML\",\"$visitor\"]);const $w=class NotImplementedError extends Wd{};const Vw=class MediaTypes extends Array{unknownMediaType=\"application/octet-stream\";filterByFormat(){throw new $w(\"filterByFormat method in MediaTypes class is not yet implemented.\")}findBy(){throw new $w(\"findBy method in MediaTypes class is not yet implemented.\")}latest(){throw new $w(\"latest method in MediaTypes class is not yet implemented.\")}};class OpenAPIMediaTypes extends Vw{filterByFormat(o=\"generic\"){const s=\"generic\"===o?\"openapi;version\":o;return this.filter((o=>o.includes(s)))}findBy(o=\"3.1.0\",s=\"generic\"){const i=\"generic\"===s?`vnd.oai.openapi;version=${o}`:`vnd.oai.openapi+${s};version=${o}`;return this.find((o=>o.includes(i)))||this.unknownMediaType}latest(o=\"generic\"){return yl(this.filterByFormat(o))}}const Uw=new OpenAPIMediaTypes(\"application/vnd.oai.openapi;version=3.1.0\",\"application/vnd.oai.openapi+json;version=3.1.0\",\"application/vnd.oai.openapi+yaml;version=3.1.0\");const zw=class es_Reference_Reference{uri;depth;value;refSet;errors;constructor({uri:o,depth:s=0,refSet:i,value:u}){this.uri=o,this.value=u,this.depth=s,this.refSet=i,this.errors=[]}};const Ww=class ReferenceSet{rootRef;refs;circular;constructor({refs:o=[],circular:s=!1}={}){this.refs=[],this.circular=s,o.forEach(this.add.bind(this))}get size(){return this.refs.length}add(o){return this.has(o)||(this.refs.push(o),this.rootRef=void 0===this.rootRef?o:this.rootRef,o.refSet=this),this}merge(o){for(const s of o.values())this.add(s);return this}has(o){const s=su(o)?o:o.uri;return Kl(this.find((o=>o.uri===s)))}find(o){return this.refs.find(o)}*values(){yield*this.refs}clean(){this.refs.forEach((o=>{o.refSet=void 0})),this.rootRef=void 0,this.refs.length=0}},Kw={parse:{mediaType:\"text/plain\",parsers:[],parserOpts:{}},resolve:{baseURI:\"\",resolvers:[],resolverOpts:{},strategies:[],strategyOpts:{},internal:!0,external:!0,maxDepth:1/0},dereference:{strategies:[],strategyOpts:{},refSet:null,maxDepth:1/0,circular:\"ignore\",circularReplacer:Ih,immutable:!0},bundle:{strategies:[],refSet:null,maxDepth:1/0}};const Hw=_curry2((function lens(o,s){return function(i){return function(u){return Rl((function(o){return s(o,u)}),i(o(u)))}}}));var Jw=_curry3((function assocPath(o,s,i){if(0===o.length)return s;var u=o[0];if(o.length>1){var _=!Qd(i)&&_has(u,i)&&\"object\"==typeof i[u]?i[u]:Ha(o[1])?[]:{};s=assocPath(Array.prototype.slice.call(o,1),s,_)}return function _assoc(o,s,i){if(Ha(o)&&gc(i)){var u=[].concat(i);return u[o]=s,u}var _={};for(var w in i)_[w]=i[w];return _[o]=s,_}(u,s,i)}));const Gw=Jw;var Identity=function(o){return{value:o,map:function(s){return Identity(s(o))}}},Yw=_curry3((function over(o,s,i){return o((function(o){return Identity(s(o))}))(i).value}));const Xw=Yw,Qw=Hw(Np([\"resolve\",\"baseURI\"]),Gw([\"resolve\",\"baseURI\"])),baseURIDefault=o=>td(o)?url_cwd():o,util_merge=(o,s)=>{const i=Mp(o,s);return Xw(Qw,baseURIDefault,i)};const Zw=class File_File{uri;mediaType;data;parseResult;constructor({uri:o,mediaType:s=\"text/plain\",data:i,parseResult:u}){this.uri=o,this.mediaType=s,this.data=i,this.parseResult=u}get extension(){return su(this.uri)?(o=>{const s=o.lastIndexOf(\".\");return s>=0?o.substring(s).toLowerCase():\"\"})(this.uri):\"\"}toString(){if(\"string\"==typeof this.data)return this.data;if(this.data instanceof ArrayBuffer||[\"ArrayBuffer\"].includes(pc(this.data))||ArrayBuffer.isView(this.data)){return new TextDecoder(\"utf-8\").decode(this.data)}return String(this.data)}};const eS=class PluginError extends Ba{plugin;constructor(o,s){super(o,{cause:s.cause}),this.plugin=s.plugin}},plugins_filter=async(o,s,i)=>{const u=await Promise.all(i.map(Kp([o],s)));return i.filter(((o,s)=>u[s]))},run=async(o,s,i)=>{let u;for(const _ of i)try{const i=await _[o].call(_,...s);return{plugin:_,result:i}}catch(o){u=new eS(\"Error while running plugin\",{cause:o,plugin:_})}return Promise.reject(u)};const tS=class DereferenceError extends Ba{};const rS=class UnmatchedDereferenceStrategyError extends tS{},dereferenceApiDOM=async(o,s)=>{let i=o,u=!1;if(!vp(o)){const s=cloneShallow(o);s.classes.push(\"result\"),i=new np([s]),u=!0}const _=new Zw({uri:s.resolve.baseURI,parseResult:i,mediaType:s.parse.mediaType}),w=await plugins_filter(\"canDereference\",[_,s],s.dereference.strategies);if(Vp(w))throw new rS(_.uri);try{const{result:o}=await run(\"dereference\",[_,s],w);return u?o.get(0):o}catch(o){throw new tS(`Error while dereferencing file \"${_.uri}\"`,{cause:o})}};const nS=class ParseError extends Ba{};const oS=class ParserError extends nS{};const sS=class Parser{name;allowEmpty;sourceMap;fileExtensions;mediaTypes;constructor({name:o,allowEmpty:s=!0,sourceMap:i=!1,fileExtensions:u=[],mediaTypes:_=[]}){this.name=o,this.allowEmpty=s,this.sourceMap=i,this.fileExtensions=u,this.mediaTypes=_}};const iS=class BinaryParser extends sS{constructor(o){super({...null!=o?o:{},name:\"binary\"})}canParse(o){return 0===this.fileExtensions.length||this.fileExtensions.includes(o.extension)}parse(o){try{const s=unescape(encodeURIComponent(o.toString())),i=btoa(s),u=new np;if(0!==i.length){const o=new Xu.Om(i);o.classes.push(\"result\"),u.push(o)}return u}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const aS=class ResolveStrategy{name;constructor({name:o}){this.name=o}};const cS=class OpenAPI3_1ResolveStrategy extends aS{constructor(o){super({...null!=o?o:{},name:\"openapi-3-1\"})}canResolve(o,s){const i=s.dereference.strategies.find((o=>\"openapi-3-1\"===o.name));return void 0!==i&&i.canDereference(o,s)}async resolve(o,s){const i=s.dereference.strategies.find((o=>\"openapi-3-1\"===o.name));if(void 0===i)throw new rS('\"openapi-3-1\" dereference strategy is not available.');const u=new Ww,_=util_merge(s,{resolve:{internal:!1},dereference:{refSet:u}});return await i.dereference(o,_),u}};function _clone(o,s,i){if(i||(i=new lS),function _isPrimitive(o){var s=typeof o;return null==o||\"object\"!=s&&\"function\"!=s}(o))return o;var u=function copy(u){var _=i.get(o);if(_)return _;for(var w in i.set(o,u),o)Object.prototype.hasOwnProperty.call(o,w)&&(u[w]=s?_clone(o[w],!0,i):o[w]);return u};switch(pc(o)){case\"Object\":return u(Object.create(Object.getPrototypeOf(o)));case\"Array\":return u(Array(o.length));case\"Date\":return new Date(o.valueOf());case\"RegExp\":return _cloneRegExp(o);case\"Int8Array\":case\"Uint8Array\":case\"Uint8ClampedArray\":case\"Int16Array\":case\"Uint16Array\":case\"Int32Array\":case\"Uint32Array\":case\"Float32Array\":case\"Float64Array\":case\"BigInt64Array\":case\"BigUint64Array\":return o.slice();default:return o}}var lS=function(){function _ObjectMap(){this.map={},this.length=0}return _ObjectMap.prototype.set=function(o,s){var i=this.hash(o),u=this.map[i];u||(this.map[i]=u=[]),u.push([o,s]),this.length+=1},_ObjectMap.prototype.hash=function(o){var s=[];for(var i in o)s.push(Object.prototype.toString.call(o[i]));return s.join()},_ObjectMap.prototype.get=function(o){if(this.length<=180)for(var s in this.map)for(var i=this.map[s],u=0;u<i.length;u+=1){if((w=i[u])[0]===o)return w[1]}else{var _=this.hash(o);if(i=this.map[_])for(u=0;u<i.length;u+=1){var w;if((w=i[u])[0]===o)return w[1]}}},_ObjectMap}(),uS=function(){function XReduceBy(o,s,i,u){this.valueFn=o,this.valueAcc=s,this.keyFn=i,this.xf=u,this.inputs={}}return XReduceBy.prototype[\"@@transducer/init\"]=_xfBase_init,XReduceBy.prototype[\"@@transducer/result\"]=function(o){var s;for(s in this.inputs)if(_has(s,this.inputs)&&(o=this.xf[\"@@transducer/step\"](o,this.inputs[s]))[\"@@transducer/reduced\"]){o=o[\"@@transducer/value\"];break}return this.inputs=null,this.xf[\"@@transducer/result\"](o)},XReduceBy.prototype[\"@@transducer/step\"]=function(o,s){var i=this.keyFn(s);return this.inputs[i]=this.inputs[i]||[i,_clone(this.valueAcc,!1)],this.inputs[i][1]=this.valueFn(this.inputs[i][1],s),o},XReduceBy}();function _xreduceBy(o,s,i){return function(u){return new uS(o,s,i,u)}}var pS=_curryN(4,[],_dispatchable([],_xreduceBy,(function reduceBy(o,s,i,u){var _=_xwrap((function(u,_){var w=i(_),x=o(_has(w,u)?u[w]:_clone(s,!1),_);return x&&x[\"@@transducer/reduced\"]?_reduced(u):(u[w]=x,u)}));return Lc(_,{},u)})));const hS=_curry2(_checkForMethod(\"groupBy\",pS((function(o,s){return o.push(s),o}),[]))),removeSpaces=o=>o.replace(/\\s/g,\"\"),normalize_operation_ids_replaceSpecialCharsWithUnderscore=o=>o.replace(/\\W/gi,\"_\"),normalizeOperationId=(o,s,i)=>{const u=removeSpaces(o);return u.length>0?normalize_operation_ids_replaceSpecialCharsWithUnderscore(u):((o,s)=>`${normalize_operation_ids_replaceSpecialCharsWithUnderscore(removeSpaces(s.toLowerCase()))}${normalize_operation_ids_replaceSpecialCharsWithUnderscore(removeSpaces(o))}`)(s,i)},normalize_operation_ids=({operationIdNormalizer:o=normalizeOperationId}={})=>({predicates:s,namespace:i})=>{const u=[],_=[],w=[];return{visitor:{OpenApi3_1Element:{leave(){const o=hS((o=>serializers_value(o.operationId)),_);Object.entries(o).forEach((([o,s])=>{Array.isArray(s)&&(s.length<=1||s.forEach(((s,u)=>{const _=`${o}${u+1}`;s.operationId=new i.elements.String(_)})))})),w.forEach((o=>{if(void 0===o.operationId)return;const s=String(serializers_value(o.operationId)),i=_.find((o=>serializers_value(o.meta.get(\"originalOperationId\"))===s));void 0!==i&&(o.operationId=cloneDeep.safe(i.operationId),o.meta.set(\"originalOperationId\",s),o.set(\"__originalOperationId\",s))})),_.length=0,w.length=0}},PathItemElement:{enter(o){const s=Qc(\"path\",serializers_value(o.meta.get(\"path\")));u.push(s)},leave(){u.pop()}},OperationElement:{enter(s){if(void 0===s.operationId)return;const w=String(serializers_value(s.operationId)),x=yl(u),C=Qc(\"method\",serializers_value(s.meta.get(\"http-method\"))),j=o(w,x,C);w!==j&&(s.operationId=new i.elements.String(j),s.set(\"__originalOperationId\",w),s.meta.set(\"originalOperationId\",w),_.push(s))}},LinkElement:{leave(o){s.isLinkElement(o)&&void 0!==o.operationId&&w.push(o)}}}}};const dS=_curry3((function pathOr(o,s,i){return Qc(o,_path(s,i))}));var fS=function(){function XUniqWith(o,s){this.xf=s,this.pred=o,this.items=[]}return XUniqWith.prototype[\"@@transducer/init\"]=_xfBase_init,XUniqWith.prototype[\"@@transducer/result\"]=_xfBase_result,XUniqWith.prototype[\"@@transducer/step\"]=function(o,s){return _includesWith(this.pred,s,this.items)?o:(this.items.push(s),this.xf[\"@@transducer/step\"](o,s))},XUniqWith}();function _xuniqWith(o){return function(s){return new fS(o,s)}}var mS=_curry2(_dispatchable([],_xuniqWith,(function(o,s){for(var i,u=0,_=s.length,w=[];u<_;)_includesWith(o,i=s[u],w)||(w[w.length]=i),u+=1;return w})));const gS=mS,normalize_parameters=()=>({predicates:o})=>{const parameterEquals=(s,i)=>!!o.isParameterElement(s)&&(!!o.isParameterElement(i)&&(!!o.isStringElement(s.name)&&(!!o.isStringElement(s.in)&&(!!o.isStringElement(i.name)&&(!!o.isStringElement(i.in)&&(serializers_value(s.name)===serializers_value(i.name)&&serializers_value(s.in)===serializers_value(i.in))))))),s=[];return{visitor:{PathItemElement:{enter(i,u,_,w,x){if(x.some(o.isComponentsElement))return;const{parameters:C}=i;o.isArrayElement(C)?s.push([...C.content]):s.push([])},leave(){s.pop()}},OperationElement:{leave(o){const i=yl(s);if(!Array.isArray(i)||0===i.length)return;const u=dS([],[\"parameters\",\"content\"],o),_=gS(parameterEquals,[...u,...i]);o.parameters=new Qv(_)}}}}},normalize_security_requirements=()=>({predicates:o})=>{let s;return{visitor:{OpenApi3_1Element:{enter(i){o.isArrayElement(i.security)&&(s=i.security)},leave(){s=void 0}},OperationElement:{leave(i,u,_,w,x){if(x.some(o.isComponentsElement))return;var C;void 0===i.security&&void 0!==s&&(i.security=new mb(null===(C=s)||void 0===C?void 0:C.content))}}}}},normalize_servers=()=>({predicates:o,namespace:s})=>({visitor:{OpenApi3_1Element(i){const u=void 0===i.servers,_=o.isArrayElement(i.servers),w=_&&0===i.servers.length,x=s.elements.Server.refract({url:\"/\"});u||!_?i.servers=new sg([x]):_&&w&&i.servers.push(x)},PathItemElement(s,i,u,_,w){if(w.some(o.isComponentsElement))return;if(!w.some(o.isOpenApi3_1Element))return;const x=w.find(o.isOpenApi3_1Element),C=void 0===s.servers,j=o.isArrayElement(s.servers),L=j&&0===s.servers.length;if(o.isOpenApi3_1Element(x)){var B;const o=null===(B=x.servers)||void 0===B?void 0:B.content,i=null!=o?o:[];C||!j?s.servers=new Ab(i):j&&L&&i.forEach((o=>{s.servers.push(o)}))}},OperationElement(s,i,u,_,w){if(w.some(o.isComponentsElement))return;if(!w.some(o.isOpenApi3_1Element))return;const x=[...w].reverse().find(o.isPathItemElement),C=void 0===s.servers,j=o.isArrayElement(s.servers),L=j&&0===s.servers.length;if(o.isPathItemElement(x)){var B;const o=null===(B=x.servers)||void 0===B?void 0:B.content,i=null!=o?o:[];C||!j?s.servers=new _b(i):j&&L&&i.forEach((o=>{s.servers.push(o)}))}}}}),normalize_parameter_examples=()=>({predicates:o})=>({visitor:{ParameterElement:{leave(s,i,u,_,w){var x,C;if(!w.some(o.isComponentsElement)&&void 0!==s.schema&&o.isSchemaElement(s.schema)&&(void 0!==(null===(x=s.schema)||void 0===x?void 0:x.example)||void 0!==(null===(C=s.schema)||void 0===C?void 0:C.examples))){if(void 0!==s.examples&&o.isObjectElement(s.examples)){const o=s.examples.map((o=>cloneDeep.safe(o.value)));return void 0!==s.schema.examples&&s.schema.set(\"examples\",o),void(void 0!==s.schema.example&&s.schema.set(\"example\",o))}void 0!==s.example&&(void 0!==s.schema.examples&&s.schema.set(\"examples\",[cloneDeep(s.example)]),void 0!==s.schema.example&&s.schema.set(\"example\",cloneDeep(s.example)))}}}}}),normalize_header_examples=()=>({predicates:o})=>({visitor:{HeaderElement:{leave(s,i,u,_,w){var x,C;if(!w.some(o.isComponentsElement)&&void 0!==s.schema&&o.isSchemaElement(s.schema)&&(void 0!==(null===(x=s.schema)||void 0===x?void 0:x.example)||void 0!==(null===(C=s.schema)||void 0===C?void 0:C.examples))){if(void 0!==s.examples&&o.isObjectElement(s.examples)){const o=s.examples.map((o=>cloneDeep.safe(o.value)));return void 0!==s.schema.examples&&s.schema.set(\"examples\",o),void(void 0!==s.schema.example&&s.schema.set(\"example\",o))}void 0!==s.example&&(void 0!==s.schema.examples&&s.schema.set(\"examples\",[cloneDeep(s.example)]),void 0!==s.schema.example&&s.schema.set(\"example\",cloneDeep(s.example)))}}}}}),pojoAdapter=o=>s=>{if(null!=s&&s.$$normalized)return s;if(pojoAdapter.cache.has(s))return pojoAdapter.cache.get(s);const i=x_.refract(s),u=o(i),_=serializers_value(u);return pojoAdapter.cache.set(s,_),_};pojoAdapter.cache=new WeakMap;const openapi_3_1_apidom_normalize=o=>{if(!pp(o))return o;if(o.hasKey(\"$$normalized\"))return o;const s=[normalize_operation_ids({operationIdNormalizer:(o,s,i)=>opId({operationId:o},s,i,{v2OperationIdCompatibilityMode:!1})}),normalize_parameters(),normalize_security_requirements(),normalize_servers(),normalize_parameter_examples(),normalize_header_examples()],i=dispatchPluginsSync(o,s,{toolboxCreator:apidom_ns_openapi_3_1_es_refractor_toolbox,visitorOptions:{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}});return i.set(\"$$normalized\",!0),i};const yS=class Resolver{name;constructor({name:o}){this.name=o}};const vS=class HTTPResolver extends yS{timeout;redirects;withCredentials;constructor(o){const{name:s=\"http-resolver\",timeout:i=5e3,redirects:u=5,withCredentials:_=!1}=null!=o?o:{};super({name:s}),this.timeout=i,this.redirects=u,this.withCredentials=_}canRead(o){return isHttpUrl(o.uri)}};const bS=class ResolveError extends Ba{};const _S=class ResolverError extends bS{},{AbortController:ES,AbortSignal:wS}=globalThis;void 0===globalThis.AbortController&&(globalThis.AbortController=ES),void 0===globalThis.AbortSignal&&(globalThis.AbortSignal=wS);const SS=class HTTPResolverSwaggerClient extends vS{swaggerHTTPClient=http_http;swaggerHTTPClientConfig;constructor({swaggerHTTPClient:o=http_http,swaggerHTTPClientConfig:s={},...i}={}){super({...i,name:\"http-swagger-client\"}),this.swaggerHTTPClient=o,this.swaggerHTTPClientConfig=s}getHttpClient(){return this.swaggerHTTPClient}async read(o){const s=this.getHttpClient(),i=new AbortController,{signal:u}=i,_=setTimeout((()=>{i.abort()}),this.timeout),w=this.getHttpClient().withCredentials||this.withCredentials?\"include\":\"same-origin\",x=0===this.redirects?\"error\":\"follow\",C=this.redirects>0?this.redirects:void 0;try{return(await s({url:o.uri,signal:u,userFetch:async(o,s)=>{let i=await fetch(o,s);try{i.headers.delete(\"Content-Type\")}catch{i=new Response(i.body,{...i,headers:new Headers(i.headers)}),i.headers.delete(\"Content-Type\")}return i},credentials:w,redirect:x,follow:C,...this.swaggerHTTPClientConfig})).text.arrayBuffer()}catch(s){throw new _S(`Error downloading \"${o.uri}\"`,{cause:s})}finally{clearTimeout(_)}}},from=(o,s=dh)=>{if(su(o))try{return s.fromRefract(JSON.parse(o))}catch{}return rh(o)&&of(\"element\",o)?s.fromRefract(o):s.toElement(o)};const xS=class JSONParser extends sS{constructor(o={}){super({...o,name:\"json-swagger-client\",fileExtensions:[\".json\"],mediaTypes:[\"application/json\"]})}async canParse(o){const s=0===this.fileExtensions.length||this.fileExtensions.includes(o.extension),i=this.mediaTypes.includes(o.mediaType);if(!s)return!1;if(i)return!0;if(!i)try{return JSON.parse(o.toString()),!0}catch(o){return!1}return!1}async parse(o){if(this.sourceMap)throw new oS(\"json-swagger-client parser plugin doesn't support sourceMaps option\");const s=new np,i=o.toString();if(this.allowEmpty&&\"\"===i.trim())return s;try{const o=from(JSON.parse(i));return o.classes.push(\"result\"),s.push(o),s}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const kS=class YAMLParser extends sS{constructor(o={}){super({...o,name:\"yaml-1-2-swagger-client\",fileExtensions:[\".yaml\",\".yml\"],mediaTypes:[\"text/yaml\",\"application/yaml\"]})}async canParse(o){const s=0===this.fileExtensions.length||this.fileExtensions.includes(o.extension),i=this.mediaTypes.includes(o.mediaType);if(!s)return!1;if(i)return!0;if(!i)try{return to.load(o.toString(),{schema:zn}),!0}catch(o){return!1}return!1}async parse(o){if(this.sourceMap)throw new oS(\"yaml-1-2-swagger-client parser plugin doesn't support sourceMaps option\");const s=new np,i=o.toString();try{const o=to.load(i,{schema:zn});if(this.allowEmpty&&void 0===o)return s;const u=from(o);return u.classes.push(\"result\"),s.push(u),s}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const OS=class OpenAPIJSON3_1Parser extends sS{detectionRegExp=/\"openapi\"\\s*:\\s*\"(?<version_json>3\\.1\\.(?:[1-9]\\d*|0))\"/;constructor(o={}){super({...o,name:\"openapi-json-3-1-swagger-client\",fileExtensions:[\".json\"],mediaTypes:new OpenAPIMediaTypes(...Uw.filterByFormat(\"generic\"),...Uw.filterByFormat(\"json\"))})}async canParse(o){const s=0===this.fileExtensions.length||this.fileExtensions.includes(o.extension),i=this.mediaTypes.includes(o.mediaType);if(!s)return!1;if(i)return!0;if(!i)try{const s=o.toString();return JSON.parse(s),this.detectionRegExp.test(s)}catch(o){return!1}return!1}async parse(o){if(this.sourceMap)throw new oS(\"openapi-json-3-1-swagger-client parser plugin doesn't support sourceMaps option\");const s=new np,i=o.toString();if(this.allowEmpty&&\"\"===i.trim())return s;try{const o=JSON.parse(i),u=x_.refract(o,this.refractorOpts);return u.classes.push(\"result\"),s.push(u),s}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const CS=class OpenAPIYAML31Parser extends sS{detectionRegExp=/(?<YAML>^([\"']?)openapi\\2\\s*:\\s*([\"']?)(?<version_yaml>3\\.1\\.(?:[1-9]\\d*|0))\\3(?:\\s+|$))|(?<JSON>\"openapi\"\\s*:\\s*\"(?<version_json>3\\.1\\.(?:[1-9]\\d*|0))\")/m;constructor(o={}){super({name:\"openapi-yaml-3-1-swagger-client\",...o,fileExtensions:[\".yaml\",\".yml\"],mediaTypes:new OpenAPIMediaTypes(...Uw.filterByFormat(\"generic\"),...Uw.filterByFormat(\"yaml\"))})}async canParse(o){const s=0===this.fileExtensions.length||this.fileExtensions.includes(o.extension),i=this.mediaTypes.includes(o.mediaType);if(!s)return!1;if(i)return!0;if(!i)try{const s=o.toString();return to.load(s),this.detectionRegExp.test(s)}catch(o){return!1}return!1}async parse(o){if(this.sourceMap)throw new oS(\"openapi-yaml-3-1-swagger-client parser plugin doesn't support sourceMaps option\");const s=new np,i=o.toString();try{const o=to.load(i,{schema:zn});if(this.allowEmpty&&void 0===o)return s;const u=x_.refract(o,this.refractorOpts);return u.classes.push(\"result\"),s.push(u),s}catch(s){throw new oS(`Error parsing \"${o.uri}\"`,{cause:s})}}};const AS=_curry3((function propEq(o,s,i){return hc(o,tl(s,i))}));const jS=class DereferenceStrategy{name;constructor({name:o}){this.name=o}};var PS=_curry2((function none(o,s){return ep(_complement(o),s)}));const IS=PS;var MS=__webpack_require__(8068);const NS=class ElementIdentityError extends Fa{value;constructor(o,s){super(o,s),void 0!==s&&(this.value=s.value)}};class IdentityManager{uuid;identityMap;constructor({length:o=6}={}){this.uuid=new MS({length:o}),this.identityMap=new WeakMap}identify(o){if(!sp(o))throw new NS(\"Cannot not identify the element. `element` is neither structurally compatible nor a subclass of an Element class.\",{value:o});if(o.meta.hasKey(\"id\")&&ip(o.meta.get(\"id\"))&&!o.meta.get(\"id\").equals(\"\"))return o.id;if(this.identityMap.has(o))return this.identityMap.get(o);const s=new Xu.Om(this.generateId());return this.identityMap.set(o,s),s}forget(o){return!!this.identityMap.has(o)&&(this.identityMap.delete(o),!0)}generateId(){return this.uuid.randomUUID()}}new IdentityManager;const traversal_find=(o,s)=>{const i=new PredicateVisitor({predicate:o,returnOnTrue:Yu});return visitor_visit(s,i),dS(void 0,[0],i.result)};const TS=class JsonSchema$anchorError extends Ba{};const RS=class EvaluationJsonSchema$anchorError extends TS{};const DS=class InvalidJsonSchema$anchorError extends TS{constructor(o){super(`Invalid JSON Schema $anchor \"${o}\".`)}},isAnchor=o=>/^[A-Za-z_][A-Za-z_0-9.-]*$/.test(o),uriToAnchor=o=>{const s=getHash(o);return cd(\"#\",s)},$anchor_evaluate=(o,s)=>{const i=(o=>{if(!isAnchor(o))throw new DS(o);return o})(o),u=traversal_find((o=>TE(o)&&serializers_value(o.$anchor)===i),s);if(Wl(u))throw new RS(`Evaluation failed on token: \"${i}\"`);return u},traversal_filter=(o,s)=>{const i=new PredicateVisitor({predicate:o});return visitor_visit(s,i),new Xu.G6(i.result)};const LS=class JsonSchemaUriError extends Ba{};const BS=class EvaluationJsonSchemaUriError extends LS{},resolveSchema$refField=(o,s)=>{if(void 0===s.$ref)return;const i=getHash(serializers_value(s.$ref)),u=serializers_value(s.meta.get(\"inherited$id\")),_=Kc(((o,s)=>resolve(o,sanitize(stripHash(s)))),o,[...u,serializers_value(s.$ref)]);return`${_}${\"#\"===i?\"\":i}`},refractToSchemaElement=o=>{if(refractToSchemaElement.cache.has(o))return refractToSchemaElement.cache.get(o);const s=N_.refract(o);return refractToSchemaElement.cache.set(o,s),s};refractToSchemaElement.cache=new WeakMap;const maybeRefractToSchemaElement=o=>isPrimitiveElement(o)?refractToSchemaElement(o):o,uri_evaluate=(o,s)=>{const{cache:i}=uri_evaluate,u=stripHash(o),isSchemaElementWith$id=o=>TE(o)&&void 0!==o.$id;if(!i.has(s)){const o=traversal_filter(isSchemaElementWith$id,s);i.set(s,Array.from(o))}const _=i.get(s).find((o=>{const s=((o,s)=>{if(void 0===s.$id)return;const i=serializers_value(s.meta.get(\"inherited$id\"));return Kc(((o,s)=>resolve(o,sanitize(stripHash(s)))),o,[...i,serializers_value(s.$id)])})(u,o);return s===u}));if(Wl(_))throw new BS(`Evaluation failed on URI: \"${o}\"`);let w,x;return isAnchor(uriToAnchor(o))?(w=$anchor_evaluate,x=uriToAnchor(o)):(w=es_evaluate,x=uriToPointer(o)),w(x,_)};uri_evaluate.cache=new WeakMap;const FS=class MaximumDereferenceDepthError extends tS{};const qS=class MaximumResolveDepthError extends bS{};const $S=class UnmatchedResolverError extends _S{},_swagger_api_apidom_reference_es_parse=async(o,s)=>{const i=new Zw({uri:sanitize(stripHash(o)),mediaType:s.parse.mediaType}),u=await(async(o,s)=>{const i=s.resolve.resolvers.map((o=>{const i=Object.create(o);return Object.assign(i,s.resolve.resolverOpts)})),u=await plugins_filter(\"canRead\",[o,s],i);if(Vp(u))throw new $S(o.uri);try{const{result:s}=await run(\"read\",[o],u);return s}catch(s){throw new bS(`Error while reading file \"${o.uri}\"`,{cause:s})}})(i,s);return(async(o,s)=>{const i=s.parse.parsers.map((o=>{const i=Object.create(o);return Object.assign(i,s.parse.parserOpts)})),u=await plugins_filter(\"canParse\",[o,s],i);if(Vp(u))throw new $S(o.uri);try{const{plugin:i,result:_}=await run(\"parse\",[o,s],u);return!i.allowEmpty&&_.isEmpty?Promise.reject(new nS(`Error while parsing file \"${o.uri}\". File is empty.`)):_}catch(s){throw new nS(`Error while parsing file \"${o.uri}\"`,{cause:s})}})(new Zw({...i,data:u}),s)};class AncestorLineage extends Array{includesCycle(o){return this.filter((s=>s.has(o))).length>1}includes(o,s){return o instanceof Set?super.includes(o,s):this.some((s=>s.has(o)))}findItem(o){for(const s of this)for(const i of s)if(sp(i)&&o(i))return i}}const VS=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")],US=new IdentityManager,mutationReplacer=(o,s,i,u)=>{dp(u)?u.value=o:Array.isArray(u)&&(u[i]=o)};class OpenAPI3_1DereferenceVisitor{indirections;namespace;reference;options;ancestors;refractCache;constructor({reference:o,namespace:s,options:i,indirections:u=[],ancestors:_=new AncestorLineage,refractCache:w=new Map}){this.indirections=u,this.namespace=s,this.reference=o,this.options=i,this.ancestors=new AncestorLineage(..._),this.refractCache=w}toBaseURI(o){return resolve(this.reference.uri,sanitize(stripHash(o)))}async toReference(o){if(this.reference.depth>=this.options.resolve.maxDepth)throw new qS(`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file \"${this.reference.uri}\"`);const s=this.toBaseURI(o),{refSet:i}=this.reference;if(i.has(s))return i.find(AS(s,\"uri\"));const u=await _swagger_api_apidom_reference_es_parse(unsanitize(s),{...this.options,parse:{...this.options.parse,mediaType:\"text/plain\"}}),_=new zw({uri:s,value:cloneDeep(u),depth:this.reference.depth+1});if(i.add(_),this.options.dereference.immutable){const o=new zw({uri:`immutable://${s}`,value:u,depth:this.reference.depth+1});i.add(o)}return _}toAncestorLineage(o){const s=new Set(o.filter(sp));return[new AncestorLineage(...this.ancestors,s),s]}async ReferenceElement(o,s,i,u,_,w){if(this.indirections.includes(o))return!1;const[x,C]=this.toAncestorLineage([..._,i]),j=this.toBaseURI(serializers_value(o.$ref)),L=stripHash(this.reference.uri)===j,B=!L;if(!this.options.resolve.internal&&L)return!1;if(!this.options.resolve.external&&B)return!1;const $=await this.toReference(serializers_value(o.$ref)),V=resolve(j,serializers_value(o.$ref));this.indirections.push(o);const U=uriToPointer(V);let z=es_evaluate(U,$.value.result);if(z.id=US.identify(z),isPrimitiveElement(z)){const s=serializers_value(o.meta.get(\"referenced-element\")),i=`${s}-${serializers_value(US.identify(z))}`;if(this.refractCache.has(i))z=this.refractCache.get(i);else if(isReferenceLikeElement(z))z=j_.refract(z),z.setMetaProperty(\"referenced-element\",s),this.refractCache.set(i,z);else{z=this.namespace.getElementClass(s).refract(z),this.refractCache.set(i,z)}}if(o===z)throw new Ba(\"Recursive Reference Object detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(x.includes(z)){if($.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var Y,Z;const s=new Xu.sI(z.id,{type:\"reference\",uri:$.uri,$ref:serializers_value(o.$ref)}),u=(null!==(Y=null===(Z=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===Z?void 0:Z.circularReplacer)&&void 0!==Y?Y:this.options.dereference.circularReplacer)(s);return w.replaceWith(u,mutationReplacer),!i&&u}}const ee=stripHash($.refSet.rootRef.uri)!==$.uri,ie=[\"error\",\"replace\"].includes(this.options.dereference.circular);if((B||ee||PE(z)||ie)&&!x.includesCycle(z)){C.add(o);const s=new OpenAPI3_1DereferenceVisitor({reference:$,namespace:this.namespace,indirections:[...this.indirections],options:this.options,refractCache:this.refractCache,ancestors:x});z=await VS(z,s,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),C.delete(o)}this.indirections.pop();const ae=cloneShallow(z);return ae.setMetaProperty(\"id\",US.generateId()),ae.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref),description:serializers_value(o.description),summary:serializers_value(o.summary)}),ae.setMetaProperty(\"ref-origin\",$.uri),ae.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(US.identify(o))),pp(z)&&pp(ae)&&(o.hasKey(\"description\")&&\"description\"in z&&(ae.remove(\"description\"),ae.set(\"description\",o.get(\"description\"))),o.hasKey(\"summary\")&&\"summary\"in z&&(ae.remove(\"summary\"),ae.set(\"summary\",o.get(\"summary\")))),w.replaceWith(ae,mutationReplacer),!i&&ae}async PathItemElement(o,s,i,u,_,w){if(!ip(o.$ref))return;if(this.indirections.includes(o))return!1;const[x,C]=this.toAncestorLineage([..._,i]),j=this.toBaseURI(serializers_value(o.$ref)),L=stripHash(this.reference.uri)===j,B=!L;if(!this.options.resolve.internal&&L)return;if(!this.options.resolve.external&&B)return;const $=await this.toReference(serializers_value(o.$ref)),V=resolve(j,serializers_value(o.$ref));this.indirections.push(o);const U=uriToPointer(V);let z=es_evaluate(U,$.value.result);if(z.id=US.identify(z),isPrimitiveElement(z)){const o=`path-item-${serializers_value(US.identify(z))}`;this.refractCache.has(o)?z=this.refractCache.get(o):(z=C_.refract(z),this.refractCache.set(o,z))}if(o===z)throw new Ba(\"Recursive Path Item Object reference detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(x.includes(z)){if($.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var Y,Z;const s=new Xu.sI(z.id,{type:\"path-item\",uri:$.uri,$ref:serializers_value(o.$ref)}),u=(null!==(Y=null===(Z=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===Z?void 0:Z.circularReplacer)&&void 0!==Y?Y:this.options.dereference.circularReplacer)(s);return w.replaceWith(u,mutationReplacer),!i&&u}}const ee=stripHash($.refSet.rootRef.uri)!==$.uri,ie=[\"error\",\"replace\"].includes(this.options.dereference.circular);if((B||ee||AE(z)&&ip(z.$ref)||ie)&&!x.includesCycle(z)){C.add(o);const s=new OpenAPI3_1DereferenceVisitor({reference:$,namespace:this.namespace,indirections:[...this.indirections],options:this.options,refractCache:this.refractCache,ancestors:x});z=await VS(z,s,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),C.delete(o)}if(this.indirections.pop(),AE(z)){const s=new C_([...z.content],cloneDeep(z.meta),cloneDeep(z.attributes));s.setMetaProperty(\"id\",US.generateId()),o.forEach(((o,i,u)=>{s.remove(serializers_value(i)),s.content.push(u)})),s.remove(\"$ref\"),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",$.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(US.identify(o))),z=s}return w.replaceWith(z,mutationReplacer),i?void 0:z}async LinkElement(o,s,i,u,_,w){if(!ip(o.operationRef)&&!ip(o.operationId))return;if(ip(o.operationRef)&&ip(o.operationId))throw new Ba(\"LinkElement operationRef and operationId fields are mutually exclusive.\");let x;if(ip(o.operationRef)){var C;const s=uriToPointer(serializers_value(o.operationRef)),u=this.toBaseURI(serializers_value(o.operationRef)),_=stripHash(this.reference.uri)===u,j=!_;if(!this.options.resolve.internal&&_)return;if(!this.options.resolve.external&&j)return;const L=await this.toReference(serializers_value(o.operationRef));if(x=es_evaluate(s,L.value.result),isPrimitiveElement(x)){const o=`operation-${serializers_value(US.identify(x))}`;this.refractCache.has(o)?x=this.refractCache.get(o):(x=k_.refract(x),this.refractCache.set(o,x))}x=cloneShallow(x),x.setMetaProperty(\"ref-origin\",L.uri);const B=cloneShallow(o);return null===(C=B.operationRef)||void 0===C||C.meta.set(\"operation\",x),w.replaceWith(B,mutationReplacer),i?void 0:B}if(ip(o.operationId)){var j;const s=serializers_value(o.operationId),u=await this.toReference(unsanitize(this.reference.uri));if(x=traversal_find((o=>OE(o)&&sp(o.operationId)&&o.operationId.equals(s)),u.value.result),Wl(x))throw new Ba(`OperationElement(operationId=${s}) not found.`);const _=cloneShallow(o);return null===(j=_.operationId)||void 0===j||j.meta.set(\"operation\",x),w.replaceWith(_,mutationReplacer),i?void 0:_}}async ExampleElement(o,s,i,u,_,w){if(!ip(o.externalValue))return;if(o.hasKey(\"value\")&&ip(o.externalValue))throw new Ba(\"ExampleElement value and externalValue fields are mutually exclusive.\");const x=this.toBaseURI(serializers_value(o.externalValue)),C=stripHash(this.reference.uri)===x,j=!C;if(!this.options.resolve.internal&&C)return;if(!this.options.resolve.external&&j)return;const L=await this.toReference(serializers_value(o.externalValue)),B=cloneShallow(L.value.result);B.setMetaProperty(\"ref-origin\",L.uri);const $=cloneShallow(o);return $.value=B,w.replaceWith($,mutationReplacer),i?void 0:$}async SchemaElement(o,s,i,u,_,w){if(!ip(o.$ref))return;if(this.indirections.includes(o))return!1;const[x,C]=this.toAncestorLineage([..._,i]);let j=await this.toReference(unsanitize(this.reference.uri)),{uri:L}=j;const B=resolveSchema$refField(L,o),$=stripHash(B),V=new Zw({uri:$}),U=IS((o=>o.canRead(V)),this.options.resolve.resolvers),z=!U;let Y,Z=stripHash(this.reference.uri)===B,ee=!Z;this.indirections.push(o);try{if(U||z){L=this.toBaseURI(B);const o=B,s=maybeRefractToSchemaElement(j.value.result);if(Y=uri_evaluate(o,s),Y=maybeRefractToSchemaElement(Y),Y.id=US.identify(Y),!this.options.resolve.internal&&Z)return;if(!this.options.resolve.external&&ee)return}else{if(L=this.toBaseURI(B),Z=stripHash(this.reference.uri)===L,ee=!Z,!this.options.resolve.internal&&Z)return;if(!this.options.resolve.external&&ee)return;j=await this.toReference(unsanitize(B));const o=uriToPointer(B),s=maybeRefractToSchemaElement(j.value.result);Y=es_evaluate(o,s),Y=maybeRefractToSchemaElement(Y),Y.id=US.identify(Y)}}catch(o){if(!(z&&o instanceof BS))throw o;if(isAnchor(uriToAnchor(B))){if(Z=stripHash(this.reference.uri)===L,ee=!Z,!this.options.resolve.internal&&Z)return;if(!this.options.resolve.external&&ee)return;j=await this.toReference(unsanitize(B));const o=uriToAnchor(B),s=maybeRefractToSchemaElement(j.value.result);Y=$anchor_evaluate(o,s),Y=maybeRefractToSchemaElement(Y),Y.id=US.identify(Y)}else{if(L=this.toBaseURI(B),Z=stripHash(this.reference.uri)===L,ee=!Z,!this.options.resolve.internal&&Z)return;if(!this.options.resolve.external&&ee)return;j=await this.toReference(unsanitize(B));const o=uriToPointer(B),s=maybeRefractToSchemaElement(j.value.result);Y=es_evaluate(o,s),Y=maybeRefractToSchemaElement(Y),Y.id=US.identify(Y)}}if(o===Y)throw new Ba(\"Recursive Schema Object reference detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(x.includes(Y)){if(j.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var ie,ae;const s=new Xu.sI(Y.id,{type:\"json-schema\",uri:j.uri,$ref:serializers_value(o.$ref)}),u=(null!==(ie=null===(ae=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===ae?void 0:ae.circularReplacer)&&void 0!==ie?ie:this.options.dereference.circularReplacer)(s);return w.replaceWith(u,mutationReplacer),!i&&u}}const ce=stripHash(j.refSet.rootRef.uri)!==j.uri,le=[\"error\",\"replace\"].includes(this.options.dereference.circular);if((ee||ce||TE(Y)&&ip(Y.$ref)||le)&&!x.includesCycle(Y)){C.add(o);const s=new OpenAPI3_1DereferenceVisitor({reference:j,namespace:this.namespace,indirections:[...this.indirections],options:this.options,refractCache:this.refractCache,ancestors:x});Y=await VS(Y,s,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),C.delete(o)}if(this.indirections.pop(),predicates_isBooleanJsonSchemaElement(Y)){const s=cloneDeep(Y);return s.setMetaProperty(\"id\",US.generateId()),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",j.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(US.identify(o))),w.replaceWith(s,mutationReplacer),!i&&s}if(TE(Y)){const s=new N_([...Y.content],cloneDeep(Y.meta),cloneDeep(Y.attributes));s.setMetaProperty(\"id\",US.generateId()),o.forEach(((o,i,u)=>{s.remove(serializers_value(i)),s.content.push(u)})),s.remove(\"$ref\"),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",j.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(US.identify(o))),Y=s}return w.replaceWith(Y,mutationReplacer),i?void 0:Y}}const zS=OpenAPI3_1DereferenceVisitor,WS=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")];const KS=class OpenAPI3_1DereferenceStrategy extends jS{constructor(o){super({...null!=o?o:{},name:\"openapi-3-1\"})}canDereference(o){var s;return\"text/plain\"!==o.mediaType?Uw.includes(o.mediaType):kE(null===(s=o.parseResult)||void 0===s?void 0:s.result)}async dereference(o,s){var i;const u=createNamespace(qw),_=null!==(i=s.dereference.refSet)&&void 0!==i?i:new Ww,w=new Ww;let x,C=_;_.has(o.uri)?x=_.find(AS(o.uri,\"uri\")):(x=new zw({uri:o.uri,value:o.parseResult}),_.add(x)),s.dereference.immutable&&(_.refs.map((o=>new zw({...o,value:cloneDeep(o.value)}))).forEach((o=>w.add(o))),x=w.find((s=>s.uri===o.uri)),C=w);const j=new zS({reference:x,namespace:u,options:s}),L=await WS(C.rootRef.value,j,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType});return s.dereference.immutable&&w.refs.filter((o=>o.uri.startsWith(\"immutable://\"))).map((o=>new zw({...o,uri:o.uri.replace(/^immutable:\\/\\//,\"\")}))).forEach((o=>_.add(o))),null===s.dereference.refSet&&_.clean(),w.clean(),L}},to_path=o=>{const s=(o=>o.slice(2))(o);return s.reduce(((o,i,u)=>{if(dp(i)){const s=String(serializers_value(i.key));o.push(s)}else if(hp(s[u-2])){const _=s[u-2].content.indexOf(i);o.push(_)}return o}),[])};const HS=class ModelPropertyMacroVisitor{modelPropertyMacro;options;SchemaElement={leave:(o,s,i,u,_)=>{void 0!==o.properties&&pp(o.properties)&&o.properties.forEach((s=>{if(pp(s))try{const o=this.modelPropertyMacro(serializers_value(s));s.set(\"default\",o)}catch(s){var u,w;const x=new Error(s,{cause:s});x.fullPath=[...to_path([..._,i,o]),\"properties\"],null===(u=this.options.dereference.dereferenceOpts)||void 0===u||null===(u=u.errors)||void 0===u||null===(w=u.push)||void 0===w||w.call(u,x)}}))}};constructor({modelPropertyMacro:o,options:s}){this.modelPropertyMacro=o,this.options=s}};const JS=class all_of_AllOfVisitor{options;SchemaElement={leave(o,s,i,u,_){if(void 0===o.allOf)return;if(!hp(o.allOf)){var w,x;const s=new TypeError(\"allOf must be an array\");return s.fullPath=[...to_path([..._,i,o]),\"allOf\"],void(null===(w=this.options.dereference.dereferenceOpts)||void 0===w||null===(w=w.errors)||void 0===w||null===(x=w.push)||void 0===x||x.call(w,s))}if(o.allOf.isEmpty)return void o.remove(\"allOf\");if(!o.allOf.content.every(TE)){var C,j;const s=new TypeError(\"Elements in allOf must be objects\");return s.fullPath=[...to_path([..._,i,o]),\"allOf\"],void(null===(C=this.options.dereference.dereferenceOpts)||void 0===C||null===(C=C.errors)||void 0===C||null===(j=C.push)||void 0===j||j.call(C,s))}for(;o.hasKey(\"allOf\");){const{allOf:s}=o;o.remove(\"allOf\");const i=deepmerge.all([...s.content,o]);if(o.hasKey(\"$$ref\")||i.remove(\"$$ref\"),o.hasKey(\"example\")){const s=i.getMember(\"example\");s&&(s.value=o.get(\"example\"))}if(o.hasKey(\"examples\")){const s=i.getMember(\"examples\");s&&(s.value=o.get(\"examples\"))}o.content=i.content}}};constructor({options:o}){this.options=o}};const GS=class ParameterMacroVisitor{parameterMacro;options;#e;OperationElement={enter:o=>{this.#e=o},leave:()=>{this.#e=void 0}};ParameterElement={leave:(o,s,i,u,_)=>{const w=this.#e?serializers_value(this.#e):null,x=serializers_value(o);try{const s=this.parameterMacro(w,x);o.set(\"default\",s)}catch(o){var C,j;const s=new Error(o,{cause:o});s.fullPath=to_path([..._,i]),null===(C=this.options.dereference.dereferenceOpts)||void 0===C||null===(C=C.errors)||void 0===C||null===(j=C.push)||void 0===j||j.call(C,s)}}};constructor({parameterMacro:o,options:s}){this.parameterMacro=o,this.options=s}},get_root_cause=o=>{if(null==o.cause)return o;let{cause:s}=o;for(;null!=s.cause;)s=s.cause;return s};const YS=class SchemaRefError extends Fa{},{wrapError:XS}=Ru,QS=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")],ZS=new IdentityManager,dereference_mutationReplacer=(o,s,i,u)=>{dp(u)?u.value=o:Array.isArray(u)&&(u[i]=o)};class OpenAPI3_1SwaggerClientDereferenceVisitor extends zS{useCircularStructures;allowMetaPatches;basePath;constructor({allowMetaPatches:o=!0,useCircularStructures:s=!1,basePath:i=null,...u}){super(u),this.allowMetaPatches=o,this.useCircularStructures=s,this.basePath=i}async ReferenceElement(o,s,i,u,_,w){try{if(this.indirections.includes(o))return!1;const[s,u]=this.toAncestorLineage([..._,i]),L=this.toBaseURI(serializers_value(o.$ref)),B=stripHash(this.reference.uri)===L,$=!B;if(!this.options.resolve.internal&&B)return!1;if(!this.options.resolve.external&&$)return!1;const V=await this.toReference(serializers_value(o.$ref)),U=resolve(L,serializers_value(o.$ref));this.indirections.push(o);const z=uriToPointer(U);let Y=es_evaluate(z,V.value.result);if(Y.id=ZS.identify(Y),isPrimitiveElement(Y)){const s=serializers_value(o.meta.get(\"referenced-element\")),i=`${s}-${serializers_value(ZS.identify(Y))}`;if(this.refractCache.has(i))Y=this.refractCache.get(i);else if(isReferenceLikeElement(Y))Y=j_.refract(Y),Y.setMetaProperty(\"referenced-element\",s),this.refractCache.set(i,Y);else{Y=this.namespace.getElementClass(s).refract(Y),this.refractCache.set(i,Y)}}if(o===Y)throw new Ba(\"Recursive Reference Object detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(s.includes(Y)){if(V.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var x,C;const s=new Xu.sI(Y.id,{type:\"reference\",uri:V.uri,$ref:serializers_value(o.$ref),baseURI:U,referencingElement:o}),u=(null!==(x=null===(C=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===C?void 0:C.circularReplacer)&&void 0!==x?x:this.options.dereference.circularReplacer)(s);return w.replaceWith(s,dereference_mutationReplacer),!i&&u}}const Z=stripHash(V.refSet.rootRef.uri)!==V.uri,ee=[\"error\",\"replace\"].includes(this.options.dereference.circular);if(($||Z||PE(Y)||ee)&&!s.includesCycle(Y)){var j;u.add(o);const w=new OpenAPI3_1SwaggerClientDereferenceVisitor({reference:V,namespace:this.namespace,indirections:[...this.indirections],options:this.options,refractCache:this.refractCache,ancestors:s,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,basePath:null!==(j=this.basePath)&&void 0!==j?j:[...to_path([..._,i,o]),\"$ref\"]});Y=await QS(Y,w,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),u.delete(o)}this.indirections.pop();const ie=cloneShallow(Y);if(ie.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref),description:serializers_value(o.description),summary:serializers_value(o.summary)}),ie.setMetaProperty(\"ref-origin\",V.uri),ie.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(ZS.identify(o))),pp(Y)&&(o.hasKey(\"description\")&&\"description\"in Y&&(ie.remove(\"description\"),ie.set(\"description\",o.get(\"description\"))),o.hasKey(\"summary\")&&\"summary\"in Y&&(ie.remove(\"summary\"),ie.set(\"summary\",o.get(\"summary\")))),this.allowMetaPatches&&pp(ie)&&!ie.hasKey(\"$$ref\")){const o=resolve(L,U);ie.set(\"$$ref\",o)}return w.replaceWith(ie,dereference_mutationReplacer),!i&&ie}catch(s){var L,B,$;const u=get_root_cause(s),w=XS(u,{baseDoc:this.reference.uri,$ref:serializers_value(o.$ref),pointer:uriToPointer(serializers_value(o.$ref)),fullPath:null!==(L=this.basePath)&&void 0!==L?L:[...to_path([..._,i,o]),\"$ref\"]});return void(null===(B=this.options.dereference.dereferenceOpts)||void 0===B||null===(B=B.errors)||void 0===B||null===($=B.push)||void 0===$||$.call(B,w))}}async PathItemElement(o,s,i,u,_,w){try{if(!ip(o.$ref))return;if(this.indirections.includes(o))return!1;if(includesClasses([\"cycle\"],o.$ref))return!1;const[s,u]=this.toAncestorLineage([..._,i]),L=this.toBaseURI(serializers_value(o.$ref)),B=stripHash(this.reference.uri)===L,$=!B;if(!this.options.resolve.internal&&B)return;if(!this.options.resolve.external&&$)return;const V=await this.toReference(serializers_value(o.$ref)),U=resolve(L,serializers_value(o.$ref));this.indirections.push(o);const z=uriToPointer(U);let Y=es_evaluate(z,V.value.result);if(Y.id=ZS.identify(Y),isPrimitiveElement(Y)){const o=`path-item-${serializers_value(ZS.identify(Y))}`;this.refractCache.has(o)?Y=this.refractCache.get(o):(Y=C_.refract(Y),this.refractCache.set(o,Y))}if(o===Y)throw new Ba(\"Recursive Path Item Object reference detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(s.includes(Y)){if(V.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var x,C;const s=new Xu.sI(Y.id,{type:\"path-item\",uri:V.uri,$ref:serializers_value(o.$ref),baseURI:U,referencingElement:o}),u=(null!==(x=null===(C=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===C?void 0:C.circularReplacer)&&void 0!==x?x:this.options.dereference.circularReplacer)(s);return w.replaceWith(s,dereference_mutationReplacer),!i&&u}}const Z=stripHash(V.refSet.rootRef.uri)!==V.uri,ee=[\"error\",\"replace\"].includes(this.options.dereference.circular);if(($||Z||AE(Y)&&ip(Y.$ref)||ee)&&!s.includesCycle(Y)){var j;u.add(o);const w=new OpenAPI3_1SwaggerClientDereferenceVisitor({reference:V,namespace:this.namespace,indirections:[...this.indirections],options:this.options,ancestors:s,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,basePath:null!==(j=this.basePath)&&void 0!==j?j:[...to_path([..._,i,o]),\"$ref\"]});Y=await QS(Y,w,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),u.delete(o)}if(this.indirections.pop(),AE(Y)){const s=new C_([...Y.content],cloneDeep(Y.meta),cloneDeep(Y.attributes));if(o.forEach(((o,i,u)=>{s.remove(serializers_value(i)),s.content.push(u)})),s.remove(\"$ref\"),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",V.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(ZS.identify(o))),this.allowMetaPatches&&void 0===s.get(\"$$ref\")){const o=resolve(L,U);s.set(\"$$ref\",o)}Y=s}return w.replaceWith(Y,dereference_mutationReplacer),i?void 0:Y}catch(s){var L,B,$;const u=get_root_cause(s),w=XS(u,{baseDoc:this.reference.uri,$ref:serializers_value(o.$ref),pointer:uriToPointer(serializers_value(o.$ref)),fullPath:null!==(L=this.basePath)&&void 0!==L?L:[...to_path([..._,i,o]),\"$ref\"]});return void(null===(B=this.options.dereference.dereferenceOpts)||void 0===B||null===(B=B.errors)||void 0===B||null===($=B.push)||void 0===$||$.call(B,w))}}async SchemaElement(o,s,i,u,_,w){try{if(!ip(o.$ref))return;if(this.indirections.includes(o))return!1;const[s,u]=this.toAncestorLineage([..._,i]);let L=await this.toReference(unsanitize(this.reference.uri)),{uri:B}=L;const $=resolveSchema$refField(B,o),V=stripHash($),U=new Zw({uri:V}),z=!this.options.resolve.resolvers.some((o=>o.canRead(U))),Y=!z;let Z,ee=stripHash(this.reference.uri)===$,ie=!ee;this.indirections.push(o);try{if(z||Y){B=this.toBaseURI($);const o=$,s=maybeRefractToSchemaElement(L.value.result);if(Z=uri_evaluate(o,s),Z=maybeRefractToSchemaElement(Z),Z.id=ZS.identify(Z),!this.options.resolve.internal&&ee)return;if(!this.options.resolve.external&&ie)return}else{if(B=this.toBaseURI($),ee=stripHash(this.reference.uri)===B,ie=!ee,!this.options.resolve.internal&&ee)return;if(!this.options.resolve.external&&ie)return;L=await this.toReference(unsanitize($));const o=uriToPointer($),s=maybeRefractToSchemaElement(L.value.result);Z=es_evaluate(o,s),Z=maybeRefractToSchemaElement(Z),Z.id=ZS.identify(Z)}}catch(o){if(!(Y&&o instanceof BS))throw o;if(isAnchor(uriToAnchor($))){if(ee=stripHash(this.reference.uri)===B,ie=!ee,!this.options.resolve.internal&&ee)return;if(!this.options.resolve.external&&ie)return;L=await this.toReference(unsanitize($));const o=uriToAnchor($),s=maybeRefractToSchemaElement(L.value.result);Z=$anchor_evaluate(o,s),Z=maybeRefractToSchemaElement(Z),Z.id=ZS.identify(Z)}else{if(B=this.toBaseURI(serializers_value($)),ee=stripHash(this.reference.uri)===B,ie=!ee,!this.options.resolve.internal&&ee)return;if(!this.options.resolve.external&&ie)return;L=await this.toReference(unsanitize($));const o=uriToPointer($),s=maybeRefractToSchemaElement(L.value.result);Z=es_evaluate(o,s),Z=maybeRefractToSchemaElement(Z),Z.id=ZS.identify(Z)}}if(o===Z)throw new Ba(\"Recursive Schema Object reference detected\");if(this.indirections.length>this.options.dereference.maxDepth)throw new FS(`Maximum dereference depth of \"${this.options.dereference.maxDepth}\" has been exceeded in file \"${this.reference.uri}\"`);if(s.includes(Z)){if(L.refSet.circular=!0,\"error\"===this.options.dereference.circular)throw new Ba(\"Circular reference detected\");if(\"replace\"===this.options.dereference.circular){var x,C;const s=new Xu.sI(Z.id,{type:\"json-schema\",uri:L.uri,$ref:serializers_value(o.$ref),baseURI:resolve(B,$),referencingElement:o}),u=(null!==(x=null===(C=this.options.dereference.strategyOpts[\"openapi-3-1\"])||void 0===C?void 0:C.circularReplacer)&&void 0!==x?x:this.options.dereference.circularReplacer)(s);return w.replaceWith(u,dereference_mutationReplacer),!i&&u}}const ae=stripHash(L.refSet.rootRef.uri)!==L.uri,ce=[\"error\",\"replace\"].includes(this.options.dereference.circular);if((ie||ae||TE(Z)&&ip(Z.$ref)||ce)&&!s.includesCycle(Z)){var j;u.add(o);const w=new OpenAPI3_1SwaggerClientDereferenceVisitor({reference:L,namespace:this.namespace,indirections:[...this.indirections],options:this.options,useCircularStructures:this.useCircularStructures,allowMetaPatches:this.allowMetaPatches,ancestors:s,basePath:null!==(j=this.basePath)&&void 0!==j?j:[...to_path([..._,i,o]),\"$ref\"]});Z=await QS(Z,w,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType}),u.delete(o)}if(this.indirections.pop(),predicates_isBooleanJsonSchemaElement(Z)){const s=cloneDeep(Z);return s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",L.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(ZS.identify(o))),w.replaceWith(s,dereference_mutationReplacer),!i&&s}if(TE(Z)){const s=new N_([...Z.content],cloneDeep(Z.meta),cloneDeep(Z.attributes));if(o.forEach(((o,i,u)=>{s.remove(serializers_value(i)),s.content.push(u)})),s.remove(\"$ref\"),s.setMetaProperty(\"ref-fields\",{$ref:serializers_value(o.$ref)}),s.setMetaProperty(\"ref-origin\",L.uri),s.setMetaProperty(\"ref-referencing-element-id\",cloneDeep(ZS.identify(o))),this.allowMetaPatches&&void 0===s.get(\"$$ref\")){const o=resolve(B,$);s.set(\"$$ref\",o)}Z=s}return w.replaceWith(Z,dereference_mutationReplacer),i?void 0:Z}catch(s){var L,B,$;const u=get_root_cause(s),w=new YS(`Could not resolve reference: ${u.message}`,{baseDoc:this.reference.uri,$ref:serializers_value(o.$ref),fullPath:null!==(L=this.basePath)&&void 0!==L?L:[...to_path([..._,i,o]),\"$ref\"],cause:u});return void(null===(B=this.options.dereference.dereferenceOpts)||void 0===B||null===(B=B.errors)||void 0===B||null===($=B.push)||void 0===$||$.call(B,w))}}async LinkElement(){}async ExampleElement(o,s,i,u,_,w){try{return await super.ExampleElement(o,s,i,u,_,w)}catch(s){var x,C,j;const u=get_root_cause(s),w=XS(u,{baseDoc:this.reference.uri,externalValue:serializers_value(o.externalValue),fullPath:null!==(x=this.basePath)&&void 0!==x?x:[...to_path([..._,i,o]),\"externalValue\"]});return void(null===(C=this.options.dereference.dereferenceOpts)||void 0===C||null===(C=C.errors)||void 0===C||null===(j=C.push)||void 0===j||j.call(C,w))}}}const ex=OpenAPI3_1SwaggerClientDereferenceVisitor,tx=mergeAll[Symbol.for(\"nodejs.util.promisify.custom\")];const rx=class RootVisitor{constructor({parameterMacro:o,modelPropertyMacro:s,mode:i,options:u,..._}){const w=[];w.push(new ex({..._,options:u})),\"function\"==typeof s&&w.push(new HS({modelPropertyMacro:s,options:u})),\"strict\"!==i&&w.push(new JS({options:u})),\"function\"==typeof o&&w.push(new GS({parameterMacro:o,options:u}));const x=tx(w,{nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType});Object.assign(this,x)}},nx=visitor_visit[Symbol.for(\"nodejs.util.promisify.custom\")];const ox=class OpenAPI3_1SwaggerClientDereferenceStrategy extends KS{allowMetaPatches;parameterMacro;modelPropertyMacro;mode;ancestors;constructor({allowMetaPatches:o=!1,parameterMacro:s=null,modelPropertyMacro:i=null,mode:u=\"non-strict\",ancestors:_=[],...w}={}){super({...w}),this.name=\"openapi-3-1-swagger-client\",this.allowMetaPatches=o,this.parameterMacro=s,this.modelPropertyMacro=i,this.mode=u,this.ancestors=[..._]}async dereference(o,s){var i;const u=createNamespace(qw),_=null!==(i=s.dereference.refSet)&&void 0!==i?i:new Ww,w=new Ww;let x,C=_;_.has(o.uri)?x=_.find((s=>s.uri===o.uri)):(x=new zw({uri:o.uri,value:o.parseResult}),_.add(x)),s.dereference.immutable&&(_.refs.map((o=>new zw({...o,value:cloneDeep(o.value)}))).forEach((o=>w.add(o))),x=w.find((s=>s.uri===o.uri)),C=w);const j=new rx({reference:x,namespace:u,options:s,allowMetaPatches:this.allowMetaPatches,ancestors:this.ancestors,modelPropertyMacro:this.modelPropertyMacro,mode:this.mode,parameterMacro:this.parameterMacro}),L=await nx(C.rootRef.value,j,{keyMap:Bw,nodeTypeGetter:apidom_ns_openapi_3_1_es_traversal_visitor_getNodeType});return s.dereference.immutable&&w.refs.filter((o=>o.uri.startsWith(\"immutable://\"))).map((o=>new zw({...o,uri:o.uri.replace(/^immutable:\\/\\//,\"\")}))).forEach((o=>_.add(o))),null===s.dereference.refSet&&_.clean(),w.clean(),L}},circularReplacer=o=>{const s=serializers_value(o.meta.get(\"baseURI\")),i=o.meta.get(\"referencingElement\");return new Xu.Sh({$ref:s},cloneDeep(i.meta),cloneDeep(i.attributes))},resolveOpenAPI31Strategy=async o=>{const{spec:s,timeout:i,redirects:u,requestInterceptor:_,responseInterceptor:w,pathDiscriminator:x=[],allowMetaPatches:C=!1,useCircularStructures:j=!1,skipNormalization:L=!1,parameterMacro:B=null,modelPropertyMacro:$=null,mode:V=\"non-strict\"}=o;try{const{cache:U}=resolveOpenAPI31Strategy,z=isHttpUrl(url_cwd())?url_cwd():Su,Y=options_retrievalURI(o),Z=resolve(z,Y);let ee;U.has(s)?ee=U.get(s):(ee=x_.refract(s),ee.classes.push(\"result\"),U.set(s,ee));const ie=new np([ee]),ae=es_compile(x),ce=\"\"===ae?\"\":`#${ae}`,le=es_evaluate(ae,ee),pe=new zw({uri:Z,value:ie}),de=new Ww({refs:[pe]});\"\"!==ae&&(de.rootRef=void 0);const fe=[new Set([le])],ye=[],be=await(async(o,s={})=>{const i=util_merge(Kw,s);return dereferenceApiDOM(o,i)})(le,{resolve:{baseURI:`${Z}${ce}`,resolvers:[new SS({timeout:i||1e4,redirects:u||10})],resolverOpts:{swaggerHTTPClientConfig:{requestInterceptor:_,responseInterceptor:w}},strategies:[new cS]},parse:{mediaType:Uw.latest(),parsers:[new OS({allowEmpty:!1,sourceMap:!1}),new CS({allowEmpty:!1,sourceMap:!1}),new xS({allowEmpty:!1,sourceMap:!1}),new kS({allowEmpty:!1,sourceMap:!1}),new iS({allowEmpty:!1,sourceMap:!1})]},dereference:{maxDepth:100,strategies:[new ox({allowMetaPatches:C,useCircularStructures:j,parameterMacro:B,modelPropertyMacro:$,mode:V,ancestors:fe})],refSet:de,dereferenceOpts:{errors:ye},immutable:!1,circular:j?\"ignore\":\"replace\",circularReplacer:j?Kw.dereference.circularReplacer:circularReplacer}}),_e=((o,s,i)=>new vh({element:i}).transclude(o,s))(le,be,ee),we=L?_e:openapi_3_1_apidom_normalize(_e);return{spec:serializers_value(we),errors:ye}}catch(o){if(o instanceof ud||o instanceof dd)return{spec:null,errors:[]};throw o}};resolveOpenAPI31Strategy.cache=new WeakMap;const sx=resolveOpenAPI31Strategy,ix={name:\"openapi-3-1-apidom\",match:({spec:o})=>isOpenAPI31(o),normalize:({spec:o})=>pojoAdapter(openapi_3_1_apidom_normalize)(o),resolve:async o=>sx(o)},ax=ix,makeResolve=o=>async s=>(async o=>{const{spec:s,requestInterceptor:i,responseInterceptor:u}=o,_=options_retrievalURI(o),w=options_httpClient(o),x=s||await makeFetchJSON(w,{requestInterceptor:i,responseInterceptor:u})(_),C={...o,spec:x};return o.strategies.find((o=>o.match(C))).resolve(C)})({...o,...s}),cx=makeResolve({strategies:[Gu,Hu,Wu]});var lx=__webpack_require__(39584),ux=__webpack_require__.n(lx),px=__webpack_require__(57427);function is_plain_object_isObject(o){return\"[object Object]\"===Object.prototype.toString.call(o)}function is_plain_object_isPlainObject(o){var s,i;return!1!==is_plain_object_isObject(o)&&(void 0===(s=o.constructor)||!1!==is_plain_object_isObject(i=s.prototype)&&!1!==i.hasOwnProperty(\"isPrototypeOf\"))}const hx=function fnparser(){const o=mx,s=fx,i=this,u=\"parser.js: Parser(): \";i.ast=void 0,i.stats=void 0,i.trace=void 0,i.callbacks=[];let _,w,x,C,j,L,B,$=0,V=0,U=0,z=0,Y=0,Z=new function systemData(){this.state=o.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=o.ACTIVE,this.phraseLength=0}};i.parse=(ee,ie,ae,ce)=>{const le=`${u}parse(): `;$=0,V=0,U=0,z=0,Y=0,_=void 0,w=void 0,x=void 0,C=void 0,Z.refresh(),j=void 0,L=void 0,B=void 0,C=s.stringToChars(ae),_=ee.rules,w=ee.udts;const pe=ie.toLowerCase();let de;for(const o in _)if(pe===_[o].lower){de=_[o].index;break}if(void 0===de)throw new Error(`${le}start rule name '${startRule}' not recognized`);(()=>{const o=`${u}initializeCallbacks(): `;let s,x;for(j=[],L=[],s=0;s<_.length;s+=1)j[s]=void 0;for(s=0;s<w.length;s+=1)L[s]=void 0;const C=[];for(s=0;s<_.length;s+=1)C.push(_[s].lower);for(s=0;s<w.length;s+=1)C.push(w[s].lower);for(const u in i.callbacks){if(s=C.indexOf(u.toLowerCase()),s<0)throw new Error(`${o}syntax callback '${u}' not a rule or udt name`);if(x=i.callbacks[u]?i.callbacks[u]:void 0,\"function\"!=typeof x&&void 0!==x)throw new Error(`${o}syntax callback[${u}] must be function reference or falsy)`);s<_.length?j[s]=x:L[s-_.length]=x}})(),i.trace&&i.trace.init(_,w,C),i.stats&&i.stats.init(_,w),i.ast&&i.ast.init(_,w,C),B=ce,x=[{type:o.RNM,index:de}],opExecute(0,0),x=void 0;let fe=!1;switch(Z.state){case o.ACTIVE:throw new Error(`${le}final state should never be 'ACTIVE'`);case o.NOMATCH:fe=!1;break;case o.EMPTY:case o.MATCH:fe=Z.phraseLength===C.length;break;default:throw new Error(\"unrecognized state\")}return{success:fe,state:Z.state,stateName:o.idName(Z.state),length:C.length,matched:Z.phraseLength,maxMatched:Y,maxTreeDepth:U,nodeHits:z}};const validateRnmCallbackResult=(s,i,_,w)=>{if(i.phraseLength>_){let o=`${u}opRNM(${s.name}): callback function error: `;throw o+=`sysData.phraseLength: ${i.phraseLength}`,o+=` must be <= remaining chars: ${_}`,new Error(o)}switch(i.state){case o.ACTIVE:if(!w)throw new Error(`${u}opRNM(${s.name}): callback function return error. ACTIVE state not allowed.`);break;case o.EMPTY:i.phraseLength=0;break;case o.MATCH:0===i.phraseLength&&(i.state=o.EMPTY);break;case o.NOMATCH:i.phraseLength=0;break;default:throw new Error(`${u}opRNM(${s.name}): callback function return error. Unrecognized return state: ${i.state}`)}},opUDT=(s,j)=>{let V,U,z;const Y=x[s],ee=w[Y.index];Z.UdtIndex=ee.index,$||(z=i.ast&&i.ast.udtDefined(Y.index),z&&(U=_.length+Y.index,V=i.ast.getLength(),i.ast.down(U,ee.name)));const ie=C.length-j;L[Y.index](Z,C,j,B),((s,i,_)=>{if(i.phraseLength>_){let o=`${u}opUDT(${s.name}): callback function error: `;throw o+=`sysData.phraseLength: ${i.phraseLength}`,o+=` must be <= remaining chars: ${_}`,new Error(o)}switch(i.state){case o.ACTIVE:throw new Error(`${u}opUDT(${s.name}) ACTIVE state return not allowed.`);case o.EMPTY:if(!s.empty)throw new Error(`${u}opUDT(${s.name}) may not return EMPTY.`);i.phraseLength=0;break;case o.MATCH:if(0===i.phraseLength){if(!s.empty)throw new Error(`${u}opUDT(${s.name}) may not return EMPTY.`);i.state=o.EMPTY}break;case o.NOMATCH:i.phraseLength=0;break;default:throw new Error(`${u}opUDT(${s.name}): callback function return error. Unrecognized return state: ${i.state}`)}})(ee,Z,ie),$||z&&(Z.state===o.NOMATCH?i.ast.setLength(V):i.ast.up(U,ee.name,j,Z.phraseLength))},opExecute=(s,w)=>{const L=`${u}opExecute(): `,ee=x[s];switch(z+=1,V>U&&(U=V),V+=1,Z.refresh(),i.trace&&i.trace.down(ee,w),ee.type){case o.ALT:((s,i)=>{const u=x[s];for(let s=0;s<u.children.length&&(opExecute(u.children[s],i),Z.state===o.NOMATCH);s+=1);})(s,w);break;case o.CAT:((s,u)=>{let _,w,C,j;const L=x[s];i.ast&&(w=i.ast.getLength()),_=!0,C=u,j=0;for(let s=0;s<L.children.length;s+=1){if(opExecute(L.children[s],C),Z.state===o.NOMATCH){_=!1;break}C+=Z.phraseLength,j+=Z.phraseLength}_?(Z.state=0===j?o.EMPTY:o.MATCH,Z.phraseLength=j):(Z.state=o.NOMATCH,Z.phraseLength=0,i.ast&&i.ast.setLength(w))})(s,w);break;case o.REP:((s,u)=>{let _,w,j,L;const B=x[s];if(0===B.max)return Z.state=o.EMPTY,void(Z.phraseLength=0);for(w=u,j=0,L=0,i.ast&&(_=i.ast.getLength());!(w>=C.length)&&(opExecute(s+1,w),Z.state!==o.NOMATCH)&&Z.state!==o.EMPTY&&(L+=1,j+=Z.phraseLength,w+=Z.phraseLength,L!==B.max););Z.state===o.EMPTY||L>=B.min?(Z.state=0===j?o.EMPTY:o.MATCH,Z.phraseLength=j):(Z.state=o.NOMATCH,Z.phraseLength=0,i.ast&&i.ast.setLength(_))})(s,w);break;case o.RNM:((s,u)=>{let w,L,V;const U=x[s],z=_[U.index],Y=j[z.index];if($||(L=i.ast&&i.ast.ruleDefined(U.index),L&&(w=i.ast.getLength(),i.ast.down(U.index,_[U.index].name))),Y){const s=C.length-u;Y(Z,C,u,B),validateRnmCallbackResult(z,Z,s,!0),Z.state===o.ACTIVE&&(V=x,x=z.opcodes,opExecute(0,u),x=V,Y(Z,C,u,B),validateRnmCallbackResult(z,Z,s,!1))}else V=x,x=z.opcodes,opExecute(0,u,Z),x=V;$||L&&(Z.state===o.NOMATCH?i.ast.setLength(w):i.ast.up(U.index,z.name,u,Z.phraseLength))})(s,w);break;case o.TRG:((s,i)=>{const u=x[s];Z.state=o.NOMATCH,i<C.length&&u.min<=C[i]&&C[i]<=u.max&&(Z.state=o.MATCH,Z.phraseLength=1)})(s,w);break;case o.TBS:((s,i)=>{const u=x[s],_=u.string.length;if(Z.state=o.NOMATCH,i+_<=C.length){for(let o=0;o<_;o+=1)if(C[i+o]!==u.string[o])return;Z.state=o.MATCH,Z.phraseLength=_}})(s,w);break;case o.TLS:((s,i)=>{let u;const _=x[s];Z.state=o.NOMATCH;const w=_.string.length;if(0!==w){if(i+w<=C.length){for(let o=0;o<w;o+=1)if(u=C[i+o],u>=65&&u<=90&&(u+=32),u!==_.string[o])return;Z.state=o.MATCH,Z.phraseLength=w}}else Z.state=o.EMPTY})(s,w);break;case o.UDT:opUDT(s,w);break;case o.AND:((s,i)=>{switch($+=1,opExecute(s+1,i),$-=1,Z.phraseLength=0,Z.state){case o.EMPTY:case o.MATCH:Z.state=o.EMPTY;break;case o.NOMATCH:Z.state=o.NOMATCH;break;default:throw new Error(`opAND: invalid state ${Z.state}`)}})(s,w);break;case o.NOT:((s,i)=>{switch($+=1,opExecute(s+1,i),$-=1,Z.phraseLength=0,Z.state){case o.EMPTY:case o.MATCH:Z.state=o.NOMATCH;break;case o.NOMATCH:Z.state=o.EMPTY;break;default:throw new Error(`opNOT: invalid state ${Z.state}`)}})(s,w);break;default:throw new Error(`${L}unrecognized operator`)}$||w+Z.phraseLength>Y&&(Y=w+Z.phraseLength),i.stats&&i.stats.collect(ee,Z),i.trace&&i.trace.up(ee,Z.state,w,Z.phraseLength),V-=1}},dx=function fnast(){const o=mx,s=fx,i=this;let u,_,w,x=0;const C=[],j=[],L=[];function indent(o){let s=\"\";for(;o-- >0;)s+=\" \";return s}i.callbacks=[],i.init=(o,s,B)=>{let $;j.length=0,L.length=0,x=0,u=o,_=s,w=B;const V=[];for($=0;$<u.length;$+=1)V.push(u[$].lower);for($=0;$<_.length;$+=1)V.push(_[$].lower);for(x=u.length+_.length,$=0;$<x;$+=1)C[$]=void 0;for(const o in i.callbacks){const s=o.toLowerCase();if($=V.indexOf(s),$<0)throw new Error(`parser.js: Ast()): init: node '${o}' not a rule or udt name`);C[$]=i.callbacks[o]}},i.ruleDefined=o=>!!C[o],i.udtDefined=o=>!!C[u.length+o],i.down=(s,i)=>{const u=L.length;return j.push(u),L.push({name:i,thisIndex:u,thatIndex:void 0,state:o.SEM_PRE,callbackIndex:s,phraseIndex:void 0,phraseLength:void 0,stack:j.length}),u},i.up=(s,i,u,_)=>{const w=L.length,x=j.pop();return L.push({name:i,thisIndex:w,thatIndex:x,state:o.SEM_POST,callbackIndex:s,phraseIndex:u,phraseLength:_,stack:j.length}),L[x].thatIndex=w,L[x].phraseIndex=u,L[x].phraseLength=_,w},i.translate=s=>{let i,u;for(let _=0;_<L.length;_+=1)u=L[_],i=C[u.callbackIndex],i&&(u.state===o.SEM_PRE?i(o.SEM_PRE,w,u.phraseIndex,u.phraseLength,s):i&&i(o.SEM_POST,w,u.phraseIndex,u.phraseLength,s))},i.setLength=o=>{L.length=o,j.length=o>0?L[o-1].stack:0},i.getLength=()=>L.length,i.toXml=()=>{let i=\"\",u=0;return i+='<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n',i+=`<root nodes=\"${L.length/2}\" characters=\"${w.length}\">\\n`,i+=\"\\x3c!-- input string --\\x3e\\n\",i+=indent(u+2),i+=s.charsToString(w),i+=\"\\n\",L.forEach((_=>{_.state===o.SEM_PRE?(u+=1,i+=indent(u),i+=`<node name=\"${_.name}\" index=\"${_.phraseIndex}\" length=\"${_.phraseLength}\">\\n`,i+=indent(u+2),i+=s.charsToString(w,_.phraseIndex,_.phraseLength),i+=\"\\n\"):(i+=indent(u),i+=`</node>\\x3c!-- name=\"${_.name}\" --\\x3e\\n`,u-=1)})),i+=\"</root>\\n\",i}},fx={stringToChars:o=>[...o].map((o=>o.codePointAt(0))),charsToString:(o,s,i)=>{let u=o;for(;!(void 0===s||s<0);){if(void 0===i){u=o.slice(s);break}if(i<=0)return\"\";u=o.slice(s,s+i);break}return String.fromCodePoint(...u)}},mx={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,idName:o=>{switch(o){case mx.ALT:return\"ALT\";case mx.CAT:return\"CAT\";case mx.REP:return\"REP\";case mx.RNM:return\"RNM\";case mx.TRG:return\"TRG\";case mx.TBS:return\"TBS\";case mx.TLS:return\"TLS\";case mx.UDT:return\"UDT\";case mx.AND:return\"AND\";case mx.NOT:return\"NOT\";case mx.ACTIVE:return\"ACTIVE\";case mx.EMPTY:return\"EMPTY\";case mx.MATCH:return\"MATCH\";case mx.NOMATCH:return\"NOMATCH\";case mx.SEM_PRE:return\"SEM_PRE\";case mx.SEM_POST:return\"SEM_POST\";case mx.SEM_OK:return\"SEM_OK\";default:return\"UNRECOGNIZED STATE\"}}};const callbacks_slash=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"slash\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),path_template=(o,s,i,u,_)=>{if(o===mx.SEM_PRE){if(!1===Array.isArray(_))throw new Error(\"parser's user data must be an array\");_.push([\"path-template\",fx.charsToString(s,i,u)])}return mx.SEM_OK},callbacks_path=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"path\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),path_literal=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"path-literal\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),callbacks_query=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"query\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),query_marker=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"query-marker\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),callbacks_fragment=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"fragment\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),fragment_marker=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"fragment-marker\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),template_expression=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"template-expression\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),template_expression_param_name=(o,s,i,u,_)=>(o===mx.SEM_PRE?_.push([\"template-expression-param-name\",fx.charsToString(s,i,u)]):mx.SEM_POST,mx.SEM_OK),gx=new function grammar(){this.grammarObject=\"grammarObject\",this.rules=[],this.rules[0]={name:\"path-template\",lower:\"path-template\",index:0,isBkr:!1},this.rules[1]={name:\"path\",lower:\"path\",index:1,isBkr:!1},this.rules[2]={name:\"path-segment\",lower:\"path-segment\",index:2,isBkr:!1},this.rules[3]={name:\"query\",lower:\"query\",index:3,isBkr:!1},this.rules[4]={name:\"query-literal\",lower:\"query-literal\",index:4,isBkr:!1},this.rules[5]={name:\"query-marker\",lower:\"query-marker\",index:5,isBkr:!1},this.rules[6]={name:\"fragment\",lower:\"fragment\",index:6,isBkr:!1},this.rules[7]={name:\"fragment-literal\",lower:\"fragment-literal\",index:7,isBkr:!1},this.rules[8]={name:\"fragment-marker\",lower:\"fragment-marker\",index:8,isBkr:!1},this.rules[9]={name:\"slash\",lower:\"slash\",index:9,isBkr:!1},this.rules[10]={name:\"path-literal\",lower:\"path-literal\",index:10,isBkr:!1},this.rules[11]={name:\"template-expression\",lower:\"template-expression\",index:11,isBkr:!1},this.rules[12]={name:\"template-expression-param-name\",lower:\"template-expression-param-name\",index:12,isBkr:!1},this.rules[13]={name:\"unreserved\",lower:\"unreserved\",index:13,isBkr:!1},this.rules[14]={name:\"pct-encoded\",lower:\"pct-encoded\",index:14,isBkr:!1},this.rules[15]={name:\"sub-delims\",lower:\"sub-delims\",index:15,isBkr:!1},this.rules[16]={name:\"sub-delims-no-slash\",lower:\"sub-delims-no-slash\",index:16,isBkr:!1},this.rules[17]={name:\"ALPHA\",lower:\"alpha\",index:17,isBkr:!1},this.rules[18]={name:\"DIGIT\",lower:\"digit\",index:18,isBkr:!1},this.rules[19]={name:\"HEXDIG\",lower:\"hexdig\",index:19,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,2,6]},this.rules[0].opcodes[1]={type:4,index:1},this.rules[0].opcodes[2]={type:3,min:0,max:1},this.rules[0].opcodes[3]={type:2,children:[4,5]},this.rules[0].opcodes[4]={type:4,index:5},this.rules[0].opcodes[5]={type:4,index:3},this.rules[0].opcodes[6]={type:3,min:0,max:1},this.rules[0].opcodes[7]={type:2,children:[8,9]},this.rules[0].opcodes[8]={type:4,index:8},this.rules[0].opcodes[9]={type:4,index:6},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2,6]},this.rules[1].opcodes[1]={type:4,index:9},this.rules[1].opcodes[2]={type:3,min:0,max:1/0},this.rules[1].opcodes[3]={type:2,children:[4,5]},this.rules[1].opcodes[4]={type:4,index:2},this.rules[1].opcodes[5]={type:4,index:9},this.rules[1].opcodes[6]={type:3,min:0,max:1},this.rules[1].opcodes[7]={type:4,index:2},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:1,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:10},this.rules[2].opcodes[3]={type:4,index:11},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:0,max:1/0},this.rules[3].opcodes[1]={type:4,index:4},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:3,min:1,max:1/0},this.rules[4].opcodes[1]={type:1,children:[2,3,4,5,6,7,8,9,10]},this.rules[4].opcodes[2]={type:4,index:13},this.rules[4].opcodes[3]={type:4,index:14},this.rules[4].opcodes[4]={type:4,index:15},this.rules[4].opcodes[5]={type:7,string:[58]},this.rules[4].opcodes[6]={type:7,string:[64]},this.rules[4].opcodes[7]={type:7,string:[47]},this.rules[4].opcodes[8]={type:7,string:[63]},this.rules[4].opcodes[9]={type:7,string:[38]},this.rules[4].opcodes[10]={type:7,string:[61]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:7,string:[63]},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:0,max:1/0},this.rules[6].opcodes[1]={type:4,index:7},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:3,min:1,max:1/0},this.rules[7].opcodes[1]={type:1,children:[2,3,4,5,6,7,8]},this.rules[7].opcodes[2]={type:4,index:13},this.rules[7].opcodes[3]={type:4,index:14},this.rules[7].opcodes[4]={type:4,index:15},this.rules[7].opcodes[5]={type:7,string:[58]},this.rules[7].opcodes[6]={type:7,string:[64]},this.rules[7].opcodes[7]={type:7,string:[47]},this.rules[7].opcodes[8]={type:7,string:[63]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:7,string:[35]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:7,string:[47]},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:3,min:1,max:1/0},this.rules[10].opcodes[1]={type:1,children:[2,3,4,5,6]},this.rules[10].opcodes[2]={type:4,index:13},this.rules[10].opcodes[3]={type:4,index:14},this.rules[10].opcodes[4]={type:4,index:16},this.rules[10].opcodes[5]={type:7,string:[58]},this.rules[10].opcodes[6]={type:7,string:[64]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:2,children:[1,2,3]},this.rules[11].opcodes[1]={type:7,string:[123]},this.rules[11].opcodes[2]={type:4,index:12},this.rules[11].opcodes[3]={type:7,string:[125]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:3,min:1,max:1/0},this.rules[12].opcodes[1]={type:1,children:[2,3,4,5,6]},this.rules[12].opcodes[2]={type:4,index:13},this.rules[12].opcodes[3]={type:4,index:14},this.rules[12].opcodes[4]={type:4,index:16},this.rules[12].opcodes[5]={type:7,string:[58]},this.rules[12].opcodes[6]={type:7,string:[64]},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:1,children:[1,2,3,4,5,6]},this.rules[13].opcodes[1]={type:4,index:17},this.rules[13].opcodes[2]={type:4,index:18},this.rules[13].opcodes[3]={type:7,string:[45]},this.rules[13].opcodes[4]={type:7,string:[46]},this.rules[13].opcodes[5]={type:7,string:[95]},this.rules[13].opcodes[6]={type:7,string:[126]},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2,3]},this.rules[14].opcodes[1]={type:7,string:[37]},this.rules[14].opcodes[2]={type:4,index:19},this.rules[14].opcodes[3]={type:4,index:19},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10,11]},this.rules[15].opcodes[1]={type:7,string:[33]},this.rules[15].opcodes[2]={type:7,string:[36]},this.rules[15].opcodes[3]={type:7,string:[38]},this.rules[15].opcodes[4]={type:7,string:[39]},this.rules[15].opcodes[5]={type:7,string:[40]},this.rules[15].opcodes[6]={type:7,string:[41]},this.rules[15].opcodes[7]={type:7,string:[42]},this.rules[15].opcodes[8]={type:7,string:[43]},this.rules[15].opcodes[9]={type:7,string:[44]},this.rules[15].opcodes[10]={type:7,string:[59]},this.rules[15].opcodes[11]={type:7,string:[61]},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[16].opcodes[1]={type:7,string:[33]},this.rules[16].opcodes[2]={type:7,string:[36]},this.rules[16].opcodes[3]={type:7,string:[38]},this.rules[16].opcodes[4]={type:7,string:[39]},this.rules[16].opcodes[5]={type:7,string:[40]},this.rules[16].opcodes[6]={type:7,string:[41]},this.rules[16].opcodes[7]={type:7,string:[42]},this.rules[16].opcodes[8]={type:7,string:[43]},this.rules[16].opcodes[9]={type:7,string:[44]},this.rules[16].opcodes[10]={type:7,string:[59]},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,2]},this.rules[17].opcodes[1]={type:5,min:65,max:90},this.rules[17].opcodes[2]={type:5,min:97,max:122},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:5,min:48,max:57},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7]},this.rules[19].opcodes[1]={type:4,index:18},this.rules[19].opcodes[2]={type:7,string:[97]},this.rules[19].opcodes[3]={type:7,string:[98]},this.rules[19].opcodes[4]={type:7,string:[99]},this.rules[19].opcodes[5]={type:7,string:[100]},this.rules[19].opcodes[6]={type:7,string:[101]},this.rules[19].opcodes[7]={type:7,string:[102]},this.toString=function toString(){let o=\"\";return o+=\"; OpenAPI Path Templating ABNF syntax\\n\",o+=\"path-template                  = path [ query-marker query ] [ fragment-marker fragment ]\\n\",o+=\"path                           = slash *( path-segment slash ) [ path-segment ]\\n\",o+=\"path-segment                   = 1*( path-literal / template-expression )\\n\",o+=\"query                          = *( query-literal )\\n\",o+='query-literal                  = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" / \"/\" / \"?\" / \"&\" / \"=\" )\\n',o+='query-marker                   = \"?\"\\n',o+=\"fragment                       = *( fragment-literal )\\n\",o+='fragment-literal               = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" / \"/\" / \"?\" )\\n',o+='fragment-marker                = \"#\"\\n',o+='slash                          = \"/\"\\n',o+='path-literal                   = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\\n',o+='template-expression            = \"{\" template-expression-param-name \"}\"\\n',o+='template-expression-param-name = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\\n',o+=\"\\n\",o+=\"; Characters definitions (from RFC 3986)\\n\",o+='unreserved          = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\\n',o+='pct-encoded         = \"%\" HEXDIG HEXDIG\\n',o+='sub-delims          = \"!\" / \"$\" / \"&\" / \"\\'\" / \"(\" / \")\"\\n',o+='                    / \"*\" / \"+\" / \",\" / \";\" / \"=\"\\n',o+='sub-delims-no-slash = \"!\" / \"$\" / \"&\" / \"\\'\" / \"(\" / \")\"\\n',o+='                    / \"*\" / \"+\" / \",\" / \";\"\\n',o+=\"ALPHA               = %x41-5A / %x61-7A   ; A-Z / a-z\\n\",o+=\"DIGIT               = %x30-39            ; 0-9\\n\",o+='HEXDIG              = DIGIT / \"A\" / \"B\" / \"C\" / \"D\" / \"E\" / \"F\"\\n','; OpenAPI Path Templating ABNF syntax\\npath-template                  = path [ query-marker query ] [ fragment-marker fragment ]\\npath                           = slash *( path-segment slash ) [ path-segment ]\\npath-segment                   = 1*( path-literal / template-expression )\\nquery                          = *( query-literal )\\nquery-literal                  = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" / \"/\" / \"?\" / \"&\" / \"=\" )\\nquery-marker                   = \"?\"\\nfragment                       = *( fragment-literal )\\nfragment-literal               = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" / \"/\" / \"?\" )\\nfragment-marker                = \"#\"\\nslash                          = \"/\"\\npath-literal                   = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\\ntemplate-expression            = \"{\" template-expression-param-name \"}\"\\ntemplate-expression-param-name = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\\n\\n; Characters definitions (from RFC 3986)\\nunreserved          = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\\npct-encoded         = \"%\" HEXDIG HEXDIG\\nsub-delims          = \"!\" / \"$\" / \"&\" / \"\\'\" / \"(\" / \")\"\\n                    / \"*\" / \"+\" / \",\" / \";\" / \"=\"\\nsub-delims-no-slash = \"!\" / \"$\" / \"&\" / \"\\'\" / \"(\" / \")\"\\n                    / \"*\" / \"+\" / \",\" / \";\"\\nALPHA               = %x41-5A / %x61-7A   ; A-Z / a-z\\nDIGIT               = %x30-39            ; 0-9\\nHEXDIG              = DIGIT / \"A\" / \"B\" / \"C\" / \"D\" / \"E\" / \"F\"\\n'}},openapi_path_templating_es_parse=o=>{const s=new hx;s.ast=new dx,s.ast.callbacks[\"path-template\"]=path_template,s.ast.callbacks.path=callbacks_path,s.ast.callbacks.query=callbacks_query,s.ast.callbacks[\"query-marker\"]=query_marker,s.ast.callbacks.fragment=callbacks_fragment,s.ast.callbacks[\"fragment-marker\"]=fragment_marker,s.ast.callbacks.slash=callbacks_slash,s.ast.callbacks[\"path-literal\"]=path_literal,s.ast.callbacks[\"template-expression\"]=template_expression,s.ast.callbacks[\"template-expression-param-name\"]=template_expression_param_name;return{result:s.parse(gx,\"path-template\",o),ast:s.ast}},encodePathComponent=o=>(o=>{try{return\"string\"==typeof o&&decodeURIComponent(o)!==o}catch(o){return!1}})(o)?o:encodeURIComponent(o),yx=[\"slash\",\"path-literal\",\"query-marker\",\"query-literal\",\"template-expression-param-name\"],openapi_path_templating_es_resolve=(o,s={},i={})=>{const u={...{encoder:encodePathComponent},...i},_=openapi_path_templating_es_parse(o);if(!_.result.success)return o;const w=[];_.ast.translate(w);const x=w.filter((([o])=>yx.includes(o))).map((([o,i])=>\"template-expression-param-name\"===o?Object.hasOwn(s,i)?u.encoder(s[i]):`{${i}}`:i));return x.join(\"\")},vx={body:function bodyBuilder({req:o,value:s}){void 0!==s&&(o.body=s)},header:function headerBuilder({req:o,parameter:s,value:i}){o.headers=o.headers||{},void 0!==i&&(o.headers[s.name]=i)},query:function queryBuilder({req:o,value:s,parameter:i}){o.query=o.query||{},!1===s&&\"boolean\"===i.type&&(s=\"false\");0===s&&[\"number\",\"integer\"].indexOf(i.type)>-1&&(s=\"0\");if(s)o.query[i.name]={collectionFormat:i.collectionFormat,value:s};else if(i.allowEmptyValue&&void 0!==s){const s=i.name;o.query[s]=o.query[s]||{},o.query[s].allowEmptyValue=!0}},path:function pathBuilder({req:o,value:s,parameter:i,baseURL:u}){if(void 0!==s){const _=o.url.replace(u,\"\"),w=openapi_path_templating_es_resolve(_,{[i.name]:s});o.url=u+w}},formData:function formDataBuilder({req:o,value:s,parameter:i}){!1===s&&\"boolean\"===i.type&&(s=\"false\");0===s&&[\"number\",\"integer\"].indexOf(i.type)>-1&&(s=\"0\");if(s)o.form=o.form||{},o.form[i.name]={collectionFormat:i.collectionFormat,value:s};else if(i.allowEmptyValue&&void 0!==s){o.form=o.form||{};const s=i.name;o.form[s]=o.form[s]||{},o.form[s].allowEmptyValue=!0}}};function serialize(o,s){return s.includes(\"application/json\")?\"string\"==typeof o?o:(Array.isArray(o)&&(o=o.map((o=>{try{return JSON.parse(o)}catch(s){return o}}))),JSON.stringify(o)):String(o)}function parameter_builders_path({req:o,value:s,parameter:i,baseURL:u}){const{name:_,style:w,explode:x,content:C}=i;if(void 0===s)return;const j=o.url.replace(u,\"\");let L;if(C){const o=Object.keys(C)[0];L=openapi_path_templating_es_resolve(j,{[_]:s},{encoder:s=>encodeCharacters(serialize(s,o))})}else L=openapi_path_templating_es_resolve(j,{[_]:s},{encoder:o=>stylize({key:i.name,value:o,style:w||\"simple\",explode:x||!1,escape:\"reserved\"})});o.url=u+L}function parameter_builders_query({req:o,value:s,parameter:i}){if(o.query=o.query||{},void 0!==s&&i.content){const u=serialize(s,Object.keys(i.content)[0]);if(u)o.query[i.name]=u;else if(i.allowEmptyValue){const s=i.name;o.query[s]=o.query[s]||{},o.query[s].allowEmptyValue=!0}}else if(!1===s&&(s=\"false\"),0===s&&(s=\"0\"),s){const{style:u,explode:_,allowReserved:w}=i;o.query[i.name]={value:s,serializationOption:{style:u,explode:_,allowReserved:w}}}else if(i.allowEmptyValue&&void 0!==s){const s=i.name;o.query[s]=o.query[s]||{},o.query[s].allowEmptyValue=!0}}const bx=[\"accept\",\"authorization\",\"content-type\"];function parameter_builders_header({req:o,parameter:s,value:i}){if(o.headers=o.headers||{},!(bx.indexOf(s.name.toLowerCase())>-1))if(void 0!==i&&s.content){const u=Object.keys(s.content)[0];o.headers[s.name]=serialize(i,u)}else void 0===i||Array.isArray(i)&&0===i.length||(o.headers[s.name]=stylize({key:s.name,value:i,style:s.style||\"simple\",explode:void 0!==s.explode&&s.explode,escape:!1}))}function parameter_builders_cookie({req:o,parameter:s,value:i}){o.headers=o.headers||{};const u=typeof i;if(void 0!==i&&s.content){const u=Object.keys(s.content)[0];o.headers.Cookie=`${s.name}=${serialize(i,u)}`}else if(void 0!==i&&(!Array.isArray(i)||0!==i.length)){const _=\"object\"===u&&!Array.isArray(i)&&s.explode?\"\":`${s.name}=`;o.headers.Cookie=_+stylize({key:s.name,value:i,escape:!1,style:s.style||\"form\",explode:void 0!==s.explode&&s.explode})}}const _x=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof self?self:window,{btoa:Ex}=_x,wx=Ex;function buildRequest(o,s){const{operation:i,requestBody:u,securities:_,spec:w,attachContentTypeForEmptyPayload:x}=o;let{requestContentType:C}=o;s=function applySecurities({request:o,securities:s={},operation:i={},spec:u}){var _;const w={...o},{authorized:x={}}=s,C=i.security||u.security||[],j=x&&!!Object.keys(x).length,L=(null==u||null===(_=u.components)||void 0===_?void 0:_.securitySchemes)||{};if(w.headers=w.headers||{},w.query=w.query||{},!Object.keys(s).length||!j||!C||Array.isArray(i.security)&&!i.security.length)return o;return C.forEach((o=>{Object.keys(o).forEach((o=>{const s=x[o],i=L[o];if(!s)return;const u=s.value||s,{type:_}=i;if(s)if(\"apiKey\"===_)\"query\"===i.in&&(w.query[i.name]=u),\"header\"===i.in&&(w.headers[i.name]=u),\"cookie\"===i.in&&(w.cookies[i.name]=u);else if(\"http\"===_){if(/^basic$/i.test(i.scheme)){const o=u.username||\"\",s=u.password||\"\",i=wx(`${o}:${s}`);w.headers.Authorization=`Basic ${i}`}/^bearer$/i.test(i.scheme)&&(w.headers.Authorization=`Bearer ${u}`)}else if(\"oauth2\"===_||\"openIdConnect\"===_){const o=s.token||{},u=o[i[\"x-tokenName\"]||\"access_token\"];let _=o.token_type;_&&\"bearer\"!==_.toLowerCase()||(_=\"Bearer\"),w.headers.Authorization=`${_} ${u}`}}))})),w}({request:s,securities:_,operation:i,spec:w});const j=i.requestBody||{},L=Object.keys(j.content||{}),B=C&&L.indexOf(C)>-1;if(u||x){if(C&&B)s.headers[\"Content-Type\"]=C;else if(!C){const o=L[0];o&&(s.headers[\"Content-Type\"]=o,C=o)}}else C&&B&&(s.headers[\"Content-Type\"]=C);if(!o.responseContentType&&i.responses){const o=Object.entries(i.responses).filter((([o,s])=>{const i=parseInt(o,10);return i>=200&&i<300&&is_plain_object_isPlainObject(s.content)})).reduce(((o,[,s])=>o.concat(Object.keys(s.content))),[]);o.length>0&&(s.headers.accept=o.join(\", \"))}if(u)if(C){if(L.indexOf(C)>-1)if(\"application/x-www-form-urlencoded\"===C||\"multipart/form-data\"===C)if(\"object\"==typeof u){var $,V;const o=null!==($=null===(V=j.content[C])||void 0===V?void 0:V.encoding)&&void 0!==$?$:{};s.form={},Object.keys(u).forEach((i=>{let _;try{_=JSON.parse(u[i])}catch{_=u[i]}s.form[i]={value:_,encoding:o[i]||{}}}))}else if(\"string\"==typeof u){var U,z;const o=null!==(U=null===(z=j.content[C])||void 0===z?void 0:z.encoding)&&void 0!==U?U:{};try{s.form={};const i=JSON.parse(u);Object.entries(i).forEach((([i,u])=>{s.form[i]={value:u,encoding:o[i]||{}}}))}catch{s.form=u}}else s.form=u;else s.body=u}else s.body=u;return s}function build_request_buildRequest(o,s){const{spec:i,operation:u,securities:_,requestContentType:w,responseContentType:x,attachContentTypeForEmptyPayload:C}=o;if(s=function build_request_applySecurities({request:o,securities:s={},operation:i={},spec:u}){const _={...o},{authorized:w={},specSecurity:x=[]}=s,C=i.security||x,j=w&&!!Object.keys(w).length,L=u.securityDefinitions;if(_.headers=_.headers||{},_.query=_.query||{},!Object.keys(s).length||!j||!C||Array.isArray(i.security)&&!i.security.length)return o;return C.forEach((o=>{Object.keys(o).forEach((o=>{const s=w[o];if(!s)return;const{token:i}=s,u=s.value||s,x=L[o],{type:C}=x,j=x[\"x-tokenName\"]||\"access_token\",B=i&&i[j];let $=i&&i.token_type;if(s)if(\"apiKey\"===C){const o=\"query\"===x.in?\"query\":\"headers\";_[o]=_[o]||{},_[o][x.name]=u}else if(\"basic\"===C)if(u.header)_.headers.authorization=u.header;else{const o=u.username||\"\",s=u.password||\"\";u.base64=wx(`${o}:${s}`),_.headers.authorization=`Basic ${u.base64}`}else\"oauth2\"===C&&B&&($=$&&\"bearer\"!==$.toLowerCase()?$:\"Bearer\",_.headers.authorization=`${$} ${B}`)}))})),_}({request:s,securities:_,operation:u,spec:i}),s.body||s.form||C)w?s.headers[\"Content-Type\"]=w:Array.isArray(u.consumes)?[s.headers[\"Content-Type\"]]=u.consumes:Array.isArray(i.consumes)?[s.headers[\"Content-Type\"]]=i.consumes:u.parameters&&u.parameters.filter((o=>\"file\"===o.type)).length?s.headers[\"Content-Type\"]=\"multipart/form-data\":u.parameters&&u.parameters.filter((o=>\"formData\"===o.in)).length&&(s.headers[\"Content-Type\"]=\"application/x-www-form-urlencoded\");else if(w){const o=u.parameters&&u.parameters.filter((o=>\"body\"===o.in)).length>0,i=u.parameters&&u.parameters.filter((o=>\"formData\"===o.in)).length>0;(o||i)&&(s.headers[\"Content-Type\"]=w)}return!x&&Array.isArray(u.produces)&&u.produces.length>0&&(s.headers.accept=u.produces.join(\", \")),s}function idFromPathMethodLegacy(o,s){return`${s.toLowerCase()}-${o}`}const arrayOrEmpty=o=>Array.isArray(o)?o:[],parseURIReference=o=>{try{return new URL(o)}catch{const s=new URL(o,Su),i=String(o).startsWith(\"/\")?s.pathname:s.pathname.substring(1);return{hash:s.hash,host:\"\",hostname:\"\",href:\"\",origin:\"\",password:\"\",pathname:i,port:\"\",protocol:\"\",search:s.search,searchParams:s.searchParams}}};class OperationNotFoundError extends Fa{}const findParametersWithName=(o,s)=>s.filter((s=>s.name===o)),deduplicateParameters=o=>{const s={};o.forEach((o=>{s[o.in]||(s[o.in]={}),s[o.in][o.name]=o}));const i=[];return Object.keys(s).forEach((o=>{Object.keys(s[o]).forEach((u=>{i.push(s[o][u])}))})),i},Sx={buildRequest:execute_buildRequest};function execute_execute({http:o,fetch:s,spec:i,operationId:u,pathName:_,method:w,parameters:x,securities:C,...j}){const L=o||s||http_http;_&&w&&!u&&(u=idFromPathMethodLegacy(_,w));const B=Sx.buildRequest({spec:i,operationId:u,parameters:x,securities:C,http:L,...j});return B.body&&(is_plain_object_isPlainObject(B.body)||Array.isArray(B.body))&&(B.body=JSON.stringify(B.body)),L(B)}function execute_buildRequest(o){const{spec:s,operationId:i,responseContentType:u,scheme:_,requestInterceptor:w,responseInterceptor:x,contextUrl:C,userFetch:j,server:L,serverVariables:B,http:$,signal:V}=o;let{parameters:U,parameterBuilders:z}=o;const Y=isOpenAPI3(s);z||(z=Y?fe:vx);let Z={url:\"\",credentials:$&&$.withCredentials?\"include\":\"same-origin\",headers:{},cookies:{}};V&&(Z.signal=V),w&&(Z.requestInterceptor=w),x&&(Z.responseInterceptor=x),j&&(Z.userFetch=j);const ee=function getOperationRaw(o,s){return o&&o.paths?function findOperation(o,s){return function eachOperation(o,s,i){if(!o||\"object\"!=typeof o||!o.paths||\"object\"!=typeof o.paths)return null;const{paths:u}=o;for(const _ in u)for(const w in u[_]){if(\"PARAMETERS\"===w.toUpperCase())continue;const x=u[_][w];if(!x||\"object\"!=typeof x)continue;const C={spec:o,pathName:_,method:w.toUpperCase(),operation:x},j=s(C);if(i&&j)return C}}(o,s,!0)||null}(o,(({pathName:o,method:i,operation:u})=>{if(!u||\"object\"!=typeof u)return!1;const _=u.operationId;return[opId(u,o,i),idFromPathMethodLegacy(o,i),_].some((o=>o&&o===s))})):null}(s,i);if(!ee)throw new OperationNotFoundError(`Operation ${i} not found`);const{operation:ie={},method:ae,pathName:ce}=ee,le=function baseUrl(o){const s=isOpenAPI3(o.spec);return s?function oas3BaseUrl({spec:o,pathName:s,method:i,server:u,contextUrl:_,serverVariables:w={}}){var x,C;let j,L=[],B=\"\";const $=null==o||null===(x=o.paths)||void 0===x||null===(x=x[s])||void 0===x||null===(x=x[(i||\"\").toLowerCase()])||void 0===x?void 0:x.servers,V=null==o||null===(C=o.paths)||void 0===C||null===(C=C[s])||void 0===C?void 0:C.servers,U=null==o?void 0:o.servers;L=isNonEmptyServerList($)?$:isNonEmptyServerList(V)?V:isNonEmptyServerList(U)?U:[xu],u&&(j=L.find((o=>o.url===u)),j&&(B=u));B||([j]=L,B=j.url);if(B.includes(\"{\")){(function extractServerVariableNames(o){const s=ux()(o).call(o,/\\{([^{}]+)}|([^{}]+)/g);return Array.from(s,(([,o])=>o)).filter(Boolean)})(B).forEach((o=>{if(j.variables&&j.variables[o]){const s=j.variables[o],i=w[o]||s.default,u=new RegExp(`{${iu(o)}}`,\"g\");B=B.replace(u,i)}}))}return function buildOas3UrlWithContext(o=\"\",s=\"\"){const i=parseURIReference(o&&s?resolve(s,o):o),u=parseURIReference(s),_=stripNonAlpha(i.protocol)||stripNonAlpha(u.protocol),w=i.host||u.host,x=i.pathname;let C;C=_&&w?`${_}://${w+x}`:x;return\"/\"===C[C.length-1]?C.slice(0,-1):C}(B,_)}(o):function swagger2BaseUrl({spec:o,scheme:s,contextUrl:i=\"\"}){const u=parseURIReference(i),_=Array.isArray(o.schemes)?o.schemes[0]:null,w=s||_||stripNonAlpha(u.protocol)||\"http\",x=o.host||u.host||\"\",C=o.basePath||\"\";let j;j=w&&x?`${w}://${x+C}`:C;return\"/\"===j[j.length-1]?j.slice(0,-1):j}(o)}({spec:s,scheme:_,contextUrl:C,server:L,serverVariables:B,pathName:ce,method:ae});if(Z.url+=le,!i)return delete Z.cookies,Z;Z.url+=ce,Z.method=`${ae}`.toUpperCase(),U=U||{};const pe=s.paths[ce]||{};u&&(Z.headers.accept=u);const de=deduplicateParameters([].concat(arrayOrEmpty(ie.parameters)).concat(arrayOrEmpty(pe.parameters)));de.forEach((o=>{const i=z[o.in];let u;if(\"body\"===o.in&&o.schema&&o.schema.properties&&(u=U),u=o&&o.name&&U[o.name],void 0===u?u=o&&o.name&&U[`${o.in}.${o.name}`]:findParametersWithName(o.name,de).length>1&&console.warn(`Parameter '${o.name}' is ambiguous because the defined spec has more than one parameter with the name: '${o.name}' and the passed-in parameter values did not define an 'in' value.`),null!==u){if(void 0!==o.default&&void 0===u&&(u=o.default),void 0===u&&o.required&&!o.allowEmptyValue)throw new Error(`Required parameter ${o.name} is not provided`);if(Y&&o.schema&&\"object\"===o.schema.type&&\"string\"==typeof u)try{u=JSON.parse(u)}catch(o){throw new Error(\"Could not parse object parameter value string as JSON\")}i&&i({req:Z,parameter:o,value:u,operation:ie,spec:s,baseURL:le})}}));const ye={...o,operation:ie};if(Z=Y?buildRequest(ye,Z):build_request_buildRequest(ye,Z),Z.cookies&&Object.keys(Z.cookies).length){const o=Object.keys(Z.cookies).reduce(((o,s)=>{const i=Z.cookies[s];return o+(o?\"&\":\"\")+px.serialize(s,i)}),\"\");Z.headers.Cookie=o}return Z.cookies&&delete Z.cookies,serializeRequest(Z)}const stripNonAlpha=o=>o?o.replace(/\\W/g,\"\"):null;const isNonEmptyServerList=o=>Array.isArray(o)&&o.length>0;const makeResolveSubtree=o=>async(s,i,u={})=>(async(o,s,i={})=>{const{returnEntireTree:u,baseDoc:_,requestInterceptor:w,responseInterceptor:x,parameterMacro:C,modelPropertyMacro:j,useCircularStructures:L,strategies:B}=i,$={spec:o,pathDiscriminator:s,baseDoc:_,requestInterceptor:w,responseInterceptor:x,parameterMacro:C,modelPropertyMacro:j,useCircularStructures:L,strategies:B},V=B.find((o=>o.match($))).normalize($),U=await cx({...$,spec:V,allowMetaPatches:!0,skipNormalization:!0});return!u&&Array.isArray(s)&&s.length&&(U.spec=s.reduce(((o,s)=>null==o?void 0:o[s]),U.spec)||null),U})(s,i,{...o,...u}),xx=(makeResolveSubtree({strategies:[Gu,Hu,Wu]}),(o,s)=>(...i)=>{o(...i);const u=s.getConfigs().withCredentials;s.fn.fetch.withCredentials=u});function swagger_client({configs:o,getConfigs:s}){return{fn:{fetch:(i=http_http,u=o.preFetch,_=o.postFetch,_=_||(o=>o),u=u||(o=>o),o=>(\"string\"==typeof o&&(o={url:o}),o=serializeRequest(o),o=u(o),_(i(o)))),buildRequest:execute_buildRequest,execute:execute_execute,resolve:makeResolve({strategies:[ax,Gu,Hu,Wu]}),resolveSubtree:async(o,i,u={})=>{const _=s(),w={modelPropertyMacro:_.modelPropertyMacro,parameterMacro:_.parameterMacro,requestInterceptor:_.requestInterceptor,responseInterceptor:_.responseInterceptor,strategies:[ax,Gu,Hu,Wu]};return makeResolveSubtree(w)(o,i,u)},serializeRes:serializeResponse,opId},statePlugins:{configs:{wrapActions:{loaded:xx}}}};var i,u,_}function util(){return{fn:{shallowEqualKeys}}}var kx=__webpack_require__(40961),Ox=__webpack_require__(78418),Cx=Pe,Ax=Symbol.for(\"react-redux-context\"),jx=\"undefined\"!=typeof globalThis?globalThis:{};function getContext(){if(!Cx.createContext)return{};const o=jx[Ax]??(jx[Ax]=new Map);let s=o.get(Cx.createContext);return s||(s=Cx.createContext(null),o.set(Cx.createContext,s)),s}var Px=getContext(),notInitialized=()=>{throw new Error(\"uSES not initialized!\")};var Ix=Symbol.for(\"react.element\"),Mx=Symbol.for(\"react.portal\"),Nx=Symbol.for(\"react.fragment\"),Tx=Symbol.for(\"react.strict_mode\"),Rx=Symbol.for(\"react.profiler\"),Dx=Symbol.for(\"react.provider\"),Lx=Symbol.for(\"react.context\"),Bx=Symbol.for(\"react.server_context\"),Fx=Symbol.for(\"react.forward_ref\"),qx=Symbol.for(\"react.suspense\"),$x=Symbol.for(\"react.suspense_list\"),Vx=Symbol.for(\"react.memo\"),Ux=Symbol.for(\"react.lazy\"),zx=(Symbol.for(\"react.offscreen\"),Symbol.for(\"react.client.reference\"),Fx),Wx=Vx;function typeOf(o){if(\"object\"==typeof o&&null!==o){const s=o.$$typeof;switch(s){case Ix:{const i=o.type;switch(i){case Nx:case Rx:case Tx:case qx:case $x:return i;default:{const o=i&&i.$$typeof;switch(o){case Bx:case Lx:case Fx:case Ux:case Vx:case Dx:return o;default:return s}}}}case Mx:return s}}}function pureFinalPropsSelectorFactory(o,s,i,u,{areStatesEqual:_,areOwnPropsEqual:w,areStatePropsEqual:x}){let C,j,L,B,$,V=!1;function handleSubsequentCalls(V,U){const z=!w(U,j),Y=!_(V,C,U,j);return C=V,j=U,z&&Y?function handleNewPropsAndNewState(){return L=o(C,j),s.dependsOnOwnProps&&(B=s(u,j)),$=i(L,B,j),$}():z?function handleNewProps(){return o.dependsOnOwnProps&&(L=o(C,j)),s.dependsOnOwnProps&&(B=s(u,j)),$=i(L,B,j),$}():Y?function handleNewState(){const s=o(C,j),u=!x(s,L);return L=s,u&&($=i(L,B,j)),$}():$}return function pureFinalPropsSelector(_,w){return V?handleSubsequentCalls(_,w):function handleFirstCall(_,w){return C=_,j=w,L=o(C,j),B=s(u,j),$=i(L,B,j),V=!0,$}(_,w)}}function wrapMapToPropsConstant(o){return function initConstantSelector(s){const i=o(s);function constantSelector(){return i}return constantSelector.dependsOnOwnProps=!1,constantSelector}}function getDependsOnOwnProps(o){return o.dependsOnOwnProps?Boolean(o.dependsOnOwnProps):1!==o.length}function wrapMapToPropsFunc(o,s){return function initProxySelector(s,{displayName:i}){const u=function mapToPropsProxy(o,s){return u.dependsOnOwnProps?u.mapToProps(o,s):u.mapToProps(o,void 0)};return u.dependsOnOwnProps=!0,u.mapToProps=function detectFactoryAndVerify(s,i){u.mapToProps=o,u.dependsOnOwnProps=getDependsOnOwnProps(o);let _=u(s,i);return\"function\"==typeof _&&(u.mapToProps=_,u.dependsOnOwnProps=getDependsOnOwnProps(_),_=u(s,i)),_},u}}function createInvalidArgFactory(o,s){return(i,u)=>{throw new Error(`Invalid value of type ${typeof o} for ${s} argument when connecting component ${u.wrappedComponentName}.`)}}function defaultMergeProps(o,s,i){return{...i,...o,...s}}function defaultNoopBatch(o){o()}var Kx={notify(){},get:()=>[]};function createSubscription(o,s){let i,u=Kx,_=0,w=!1;function handleChangeWrapper(){x.onStateChange&&x.onStateChange()}function trySubscribe(){_++,i||(i=s?s.addNestedSub(handleChangeWrapper):o.subscribe(handleChangeWrapper),u=function createListenerCollection(){let o=null,s=null;return{clear(){o=null,s=null},notify(){defaultNoopBatch((()=>{let s=o;for(;s;)s.callback(),s=s.next}))},get(){const s=[];let i=o;for(;i;)s.push(i),i=i.next;return s},subscribe(i){let u=!0;const _=s={callback:i,next:null,prev:s};return _.prev?_.prev.next=_:o=_,function unsubscribe(){u&&null!==o&&(u=!1,_.next?_.next.prev=_.prev:s=_.prev,_.prev?_.prev.next=_.next:o=_.next)}}}}())}function tryUnsubscribe(){_--,i&&0===_&&(i(),i=void 0,u.clear(),u=Kx)}const x={addNestedSub:function addNestedSub(o){trySubscribe();const s=u.subscribe(o);let i=!1;return()=>{i||(i=!0,s(),tryUnsubscribe())}},notifyNestedSubs:function notifyNestedSubs(){u.notify()},handleChangeWrapper,isSubscribed:function isSubscribed(){return w},trySubscribe:function trySubscribeSelf(){w||(w=!0,trySubscribe())},tryUnsubscribe:function tryUnsubscribeSelf(){w&&(w=!1,tryUnsubscribe())},getListeners:()=>u};return x}var Hx=!(\"undefined\"==typeof window||void 0===window.document||void 0===window.document.createElement),Jx=\"undefined\"!=typeof navigator&&\"ReactNative\"===navigator.product,Gx=Hx||Jx?Cx.useLayoutEffect:Cx.useEffect;function is(o,s){return o===s?0!==o||0!==s||1/o==1/s:o!=o&&s!=s}function shallowEqual(o,s){if(is(o,s))return!0;if(\"object\"!=typeof o||null===o||\"object\"!=typeof s||null===s)return!1;const i=Object.keys(o),u=Object.keys(s);if(i.length!==u.length)return!1;for(let u=0;u<i.length;u++)if(!Object.prototype.hasOwnProperty.call(s,i[u])||!is(o[i[u]],s[i[u]]))return!1;return!0}var Yx={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Xx={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Qx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Zx={[zx]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[Wx]:Qx};function getStatics(o){return function isMemo(o){return typeOf(o)===Vx}(o)?Qx:Zx[o.$$typeof]||Yx}var tk=Object.defineProperty,rk=Object.getOwnPropertyNames,nk=Object.getOwnPropertySymbols,ok=Object.getOwnPropertyDescriptor,sk=Object.getPrototypeOf,lk=Object.prototype;function hoistNonReactStatics(o,s){if(\"string\"!=typeof s){if(lk){const i=sk(s);i&&i!==lk&&hoistNonReactStatics(o,i)}let i=rk(s);nk&&(i=i.concat(nk(s)));const u=getStatics(o),_=getStatics(s);for(let w=0;w<i.length;++w){const x=i[w];if(!(Xx[x]||_&&_[x]||u&&u[x])){const i=ok(s,x);try{tk(o,x,i)}catch(o){}}}}return o}var uk=notInitialized,pk=[null,null];function captureWrapperProps(o,s,i,u,_,w){o.current=u,i.current=!1,_.current&&(_.current=null,w())}function strictEqual(o,s){return o===s}var fk=function connect(o,s,i,{pure:u,areStatesEqual:_=strictEqual,areOwnPropsEqual:w=shallowEqual,areStatePropsEqual:x=shallowEqual,areMergedPropsEqual:C=shallowEqual,forwardRef:j=!1,context:L=Px}={}){const B=L,$=function mapStateToPropsFactory(o){return o?\"function\"==typeof o?wrapMapToPropsFunc(o):createInvalidArgFactory(o,\"mapStateToProps\"):wrapMapToPropsConstant((()=>({})))}(o),V=function mapDispatchToPropsFactory(o){return o&&\"object\"==typeof o?wrapMapToPropsConstant((s=>function react_redux_bindActionCreators(o,s){const i={};for(const u in o){const _=o[u];\"function\"==typeof _&&(i[u]=(...o)=>s(_(...o)))}return i}(o,s))):o?\"function\"==typeof o?wrapMapToPropsFunc(o):createInvalidArgFactory(o,\"mapDispatchToProps\"):wrapMapToPropsConstant((o=>({dispatch:o})))}(s),U=function mergePropsFactory(o){return o?\"function\"==typeof o?function wrapMergePropsFunc(o){return function initMergePropsProxy(s,{displayName:i,areMergedPropsEqual:u}){let _,w=!1;return function mergePropsProxy(s,i,x){const C=o(s,i,x);return w?u(C,_)||(_=C):(w=!0,_=C),_}}}(o):createInvalidArgFactory(o,\"mergeProps\"):()=>defaultMergeProps}(i),z=Boolean(o);return o=>{const s=o.displayName||o.name||\"Component\",i=`Connect(${s})`,u={shouldHandleStateChanges:z,displayName:i,wrappedComponentName:s,WrappedComponent:o,initMapStateToProps:$,initMapDispatchToProps:V,initMergeProps:U,areStatesEqual:_,areStatePropsEqual:x,areOwnPropsEqual:w,areMergedPropsEqual:C};function ConnectFunction(s){const[i,_,w]=Cx.useMemo((()=>{const{reactReduxForwardedRef:o,...i}=s;return[s.context,o,i]}),[s]),x=Cx.useMemo((()=>B),[i,B]),C=Cx.useContext(x),j=Boolean(s.store)&&Boolean(s.store.getState)&&Boolean(s.store.dispatch),L=Boolean(C)&&Boolean(C.store);const $=j?s.store:C.store,V=L?C.getServerState:$.getState,U=Cx.useMemo((()=>function finalPropsSelectorFactory(o,{initMapStateToProps:s,initMapDispatchToProps:i,initMergeProps:u,..._}){return pureFinalPropsSelectorFactory(s(o,_),i(o,_),u(o,_),o,_)}($.dispatch,u)),[$]),[Y,Z]=Cx.useMemo((()=>{if(!z)return pk;const o=createSubscription($,j?void 0:C.subscription),s=o.notifyNestedSubs.bind(o);return[o,s]}),[$,j,C]),ee=Cx.useMemo((()=>j?C:{...C,subscription:Y}),[j,C,Y]),ie=Cx.useRef(void 0),ae=Cx.useRef(w),ce=Cx.useRef(void 0),le=Cx.useRef(!1),pe=Cx.useRef(!1),de=Cx.useRef(void 0);Gx((()=>(pe.current=!0,()=>{pe.current=!1})),[]);const fe=Cx.useMemo((()=>()=>ce.current&&w===ae.current?ce.current:U($.getState(),w)),[$,w]),ye=Cx.useMemo((()=>o=>Y?function subscribeUpdates(o,s,i,u,_,w,x,C,j,L,B){if(!o)return()=>{};let $=!1,V=null;const checkForUpdates=()=>{if($||!C.current)return;const o=s.getState();let i,U;try{i=u(o,_.current)}catch(o){U=o,V=o}U||(V=null),i===w.current?x.current||L():(w.current=i,j.current=i,x.current=!0,B())};return i.onStateChange=checkForUpdates,i.trySubscribe(),checkForUpdates(),()=>{if($=!0,i.tryUnsubscribe(),i.onStateChange=null,V)throw V}}(z,$,Y,U,ae,ie,le,pe,ce,Z,o):()=>{}),[Y]);let be;!function useIsomorphicLayoutEffectWithArgs(o,s,i){Gx((()=>o(...s)),i)}(captureWrapperProps,[ae,ie,le,w,ce,Z]);try{be=uk(ye,fe,V?()=>U(V(),w):fe)}catch(o){throw de.current&&(o.message+=`\\nThe error may be correlated with this previous error:\\n${de.current.stack}\\n\\n`),o}Gx((()=>{de.current=void 0,ce.current=void 0,ie.current=be}));const _e=Cx.useMemo((()=>Cx.createElement(o,{...be,ref:_})),[_,o,be]);return Cx.useMemo((()=>z?Cx.createElement(x.Provider,{value:ee},_e):_e),[x,_e,ee])}const L=Cx.memo(ConnectFunction);if(L.WrappedComponent=o,L.displayName=ConnectFunction.displayName=i,j){const s=Cx.forwardRef((function forwardConnectRef(o,s){return Cx.createElement(L,{...o,reactReduxForwardedRef:s})}));return s.displayName=i,s.WrappedComponent=o,hoistNonReactStatics(s,o)}return hoistNonReactStatics(L,o)}};var mk=function Provider({store:o,context:s,children:i,serverState:u,stabilityCheck:_=\"once\",identityFunctionCheck:w=\"once\"}){const x=Cx.useMemo((()=>{const s=createSubscription(o);return{store:o,subscription:s,getServerState:u?()=>u:void 0,stabilityCheck:_,identityFunctionCheck:w}}),[o,u,_,w]),C=Cx.useMemo((()=>o.getState()),[o]);Gx((()=>{const{subscription:s}=x;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),C!==o.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}}),[x,C]);const j=s||Px;return Cx.createElement(j.Provider,{value:x},i)};var yk;yk=Ox.useSyncExternalStoreWithSelector,(o=>{uk=o})(Pe.useSyncExternalStore);var vk=__webpack_require__(83488),_k=__webpack_require__.n(vk);const withSystem=o=>s=>{const{fn:i}=o();class WithSystem extends Pe.Component{render(){return Pe.createElement(s,wo()({},o(),this.props,this.context))}}return WithSystem.displayName=`WithSystem(${i.getDisplayName(s)})`,WithSystem},withRoot=(o,s)=>i=>{const{fn:u}=o();class WithRoot extends Pe.Component{render(){return Pe.createElement(mk,{store:s},Pe.createElement(i,wo()({},this.props,this.context)))}}return WithRoot.displayName=`WithRoot(${u.getDisplayName(i)})`,WithRoot},withConnect=(o,s,i)=>compose(i?withRoot(o,i):_k(),fk(((i,u)=>{const _={...u,...o()},w=s.prototype?.mapStateToProps||(o=>({state:o}));return w(i,_)})),withSystem(o))(s),handleProps=(o,s,i,u)=>{for(const _ in s){const w=s[_];\"function\"==typeof w&&w(i[_],u[_],o())}},withMappedContainer=(o,s,i)=>(s,u)=>{const{fn:_}=o(),w=i(s,\"root\");class WithMappedContainer extends Pe.Component{constructor(s,i){super(s,i),handleProps(o,u,s,{})}UNSAFE_componentWillReceiveProps(s){handleProps(o,u,s,this.props)}render(){const o=Qt()(this.props,u?Object.keys(u):[]);return Pe.createElement(w,o)}}return WithMappedContainer.displayName=`WithMappedContainer(${_.getDisplayName(w)})`,WithMappedContainer},render=(o,s,i,u)=>_=>{const w=i(o,s,u)(\"App\",\"root\"),{createRoot:x}=kx;x(_).render(Pe.createElement(w,null))},getComponent=(o,s,i)=>(u,_,w={})=>{if(\"string\"!=typeof u)throw new TypeError(\"Need a string, to fetch a component. Was given a \"+typeof u);const x=i(u);return x?_?\"root\"===_?withConnect(o,x,s()):withConnect(o,x):x:(w.failSilently||o().log.warn(\"Could not find component:\",u),null)},getDisplayName=o=>o.displayName||o.name||\"Component\",view=({getComponents:o,getStore:s,getSystem:i})=>{const u=(o=>jt(o,((...o)=>JSON.stringify(o))))(getComponent(i,s,o)),_=(o=>utils_memoizeN(o,((...o)=>o)))(withMappedContainer(i,0,u));return{rootInjects:{getComponent:u,makeMappedContainer:_,render:render(i,s,getComponent,o)},fn:{getDisplayName}}},view_legacy=({React:o,getSystem:s,getStore:i,getComponents:u})=>{const _={},w=parseInt(o?.version,10);return w>=16&&w<18&&(_.render=((o,s,i,u)=>_=>{const w=i(o,s,u)(\"App\",\"root\");kx.render(Pe.createElement(w,null),_)})(s,i,getComponent,u)),{rootInjects:_}};function downloadUrlPlugin(o){let{fn:s}=o;const i={download:o=>({errActions:i,specSelectors:u,specActions:_,getConfigs:w})=>{let{fetch:x}=s;const C=w();function next(s){if(s instanceof Error||s.status>=400)return _.updateLoadingStatus(\"failed\"),i.newThrownErr(Object.assign(new Error((s.message||s.statusText)+\" \"+o),{source:\"fetch\"})),void(!s.status&&s instanceof Error&&function checkPossibleFailReasons(){try{let s;if(\"URL\"in at?s=new URL(o):(s=document.createElement(\"a\"),s.href=o),\"https:\"!==s.protocol&&\"https:\"===at.location.protocol){const o=Object.assign(new Error(`Possible mixed-content issue? The page was loaded over https:// but a ${s.protocol}// URL was specified. Check that you are not attempting to load mixed content.`),{source:\"fetch\"});return void i.newThrownErr(o)}if(s.origin!==at.location.origin){const o=Object.assign(new Error(`Possible cross-origin (CORS) issue? The URL origin (${s.origin}) does not match the page (${at.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`),{source:\"fetch\"});i.newThrownErr(o)}}catch(o){return}}());_.updateLoadingStatus(\"success\"),_.updateSpec(s.text),u.url()!==o&&_.updateUrl(o)}o=o||u.url(),_.updateLoadingStatus(\"loading\"),i.clear({source:\"fetch\"}),x({url:o,loadSpec:!0,requestInterceptor:C.requestInterceptor||(o=>o),responseInterceptor:C.responseInterceptor||(o=>o),credentials:\"same-origin\",headers:{Accept:\"application/json,*/*\"}}).then(next,next)},updateLoadingStatus:o=>{let s=[null,\"loading\",\"failed\",\"success\",\"failedConfig\"];return-1===s.indexOf(o)&&console.error(`Error: ${o} is not one of ${JSON.stringify(s)}`),{type:\"spec_update_loading_status\",payload:o}}};let u={loadingStatus:Wt((o=>o||(0,qe.Map)()),(o=>o.get(\"loadingStatus\")||null))};return{statePlugins:{spec:{actions:i,reducers:{spec_update_loading_status:(o,s)=>\"string\"==typeof s.payload?o.set(\"loadingStatus\",s.payload):o},selectors:u}}}}function _objectWithoutProperties(o,s){if(null==o)return{};var i,u,_=function _objectWithoutPropertiesLoose(o,s){if(null==o)return{};var i={};for(var u in o)if(Object.prototype.hasOwnProperty.call(o,u)){if(s.indexOf(u)>=0)continue;i[u]=o[u]}return i}(o,s);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(o);for(u=0;u<w.length;u++)i=w[u],s.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(o,i)&&(_[i]=o[i])}return _}function arrayLikeToArray_arrayLikeToArray(o,s){(null==s||s>o.length)&&(s=o.length);for(var i=0,u=new Array(s);i<s;i++)u[i]=o[i];return u}function toConsumableArray_toConsumableArray(o){return function arrayWithoutHoles_arrayWithoutHoles(o){if(Array.isArray(o))return arrayLikeToArray_arrayLikeToArray(o)}(o)||function iterableToArray_iterableToArray(o){if(\"undefined\"!=typeof Symbol&&null!=o[Symbol.iterator]||null!=o[\"@@iterator\"])return Array.from(o)}(o)||function unsupportedIterableToArray_unsupportedIterableToArray(o,s){if(o){if(\"string\"==typeof o)return arrayLikeToArray_arrayLikeToArray(o,s);var i=Object.prototype.toString.call(o).slice(8,-1);return\"Object\"===i&&o.constructor&&(i=o.constructor.name),\"Map\"===i||\"Set\"===i?Array.from(o):\"Arguments\"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?arrayLikeToArray_arrayLikeToArray(o,s):void 0}}(o)||function nonIterableSpread_nonIterableSpread(){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 typeof_typeof(o){return typeof_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},typeof_typeof(o)}function toPropertyKey(o){var s=function toPrimitive(o,s){if(\"object\"!=typeof_typeof(o)||!o)return o;var i=o[Symbol.toPrimitive];if(void 0!==i){var u=i.call(o,s||\"default\");if(\"object\"!=typeof_typeof(u))return u;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===s?String:Number)(o)}(o,\"string\");return\"symbol\"==typeof_typeof(s)?s:s+\"\"}function defineProperty_defineProperty(o,s,i){return(s=toPropertyKey(s))in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}function extends_extends(){return extends_extends=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(o[u]=i[u])}return o},extends_extends.apply(this,arguments)}function create_element_ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?create_element_ownKeys(Object(i),!0).forEach((function(s){defineProperty_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):create_element_ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}var wk={};function createStyleObject(o){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return function getClassNameCombinations(o){if(0===o.length||1===o.length)return o;var s=o.join(\".\");return wk[s]||(wk[s]=function powerSetPermutations(o){var s=o.length;return 0===s||1===s?o:2===s?[o[0],o[1],\"\".concat(o[0],\".\").concat(o[1]),\"\".concat(o[1],\".\").concat(o[0])]:3===s?[o[0],o[1],o[2],\"\".concat(o[0],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[2]),\"\".concat(o[2],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[0])]:s>=4?[o[0],o[1],o[2],o[3],\"\".concat(o[0],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[3]),\"\".concat(o[3],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[3]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[3]),\"\".concat(o[0],\".\").concat(o[3],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[3],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[3],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[3],\".\").concat(o[2]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[3],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[3],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[3],\".\").concat(o[1],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[3],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[2],\".\").concat(o[3]),\"\".concat(o[0],\".\").concat(o[1],\".\").concat(o[3],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[1],\".\").concat(o[3]),\"\".concat(o[0],\".\").concat(o[2],\".\").concat(o[3],\".\").concat(o[1]),\"\".concat(o[0],\".\").concat(o[3],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[0],\".\").concat(o[3],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[2],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[0],\".\").concat(o[3],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[0],\".\").concat(o[3]),\"\".concat(o[1],\".\").concat(o[2],\".\").concat(o[3],\".\").concat(o[0]),\"\".concat(o[1],\".\").concat(o[3],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[1],\".\").concat(o[3],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[1],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[0],\".\").concat(o[3],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[0],\".\").concat(o[3]),\"\".concat(o[2],\".\").concat(o[1],\".\").concat(o[3],\".\").concat(o[0]),\"\".concat(o[2],\".\").concat(o[3],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[2],\".\").concat(o[3],\".\").concat(o[1],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[0],\".\").concat(o[1],\".\").concat(o[2]),\"\".concat(o[3],\".\").concat(o[0],\".\").concat(o[2],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[1],\".\").concat(o[0],\".\").concat(o[2]),\"\".concat(o[3],\".\").concat(o[1],\".\").concat(o[2],\".\").concat(o[0]),\"\".concat(o[3],\".\").concat(o[2],\".\").concat(o[0],\".\").concat(o[1]),\"\".concat(o[3],\".\").concat(o[2],\".\").concat(o[1],\".\").concat(o[0])]:void 0}(o)),wk[s]}(o.filter((function(o){return\"token\"!==o}))).reduce((function(o,s){return _objectSpread(_objectSpread({},o),i[s])}),s)}function createClassNameString(o){return o.join(\" \")}function createElement(o){var s=o.node,i=o.stylesheet,u=o.style,_=void 0===u?{}:u,w=o.useInlineStyles,x=o.key,C=s.properties,j=s.type,L=s.tagName,B=s.value;if(\"text\"===j)return B;if(L){var $,V=function createChildren(o,s){var i=0;return function(u){return i+=1,u.map((function(u,_){return createElement({node:u,stylesheet:o,useInlineStyles:s,key:\"code-segment-\".concat(i,\"-\").concat(_)})}))}}(i,w);if(w){var U=Object.keys(i).reduce((function(o,s){return s.split(\".\").forEach((function(s){o.includes(s)||o.push(s)})),o}),[]),z=C.className&&C.className.includes(\"token\")?[\"token\"]:[],Y=C.className&&z.concat(C.className.filter((function(o){return!U.includes(o)})));$=_objectSpread(_objectSpread({},C),{},{className:createClassNameString(Y)||void 0,style:createStyleObject(C.className,Object.assign({},C.style,_),i)})}else $=_objectSpread(_objectSpread({},C),{},{className:createClassNameString(C.className)});var Z=V(s.children);return Pe.createElement(L,extends_extends({key:x},$),Z)}}const checkForListedLanguage=function(o,s){return-1!==o.listLanguages().indexOf(s)};var xk=[\"language\",\"children\",\"style\",\"customStyle\",\"codeTagProps\",\"useInlineStyles\",\"showLineNumbers\",\"showInlineLineNumbers\",\"startingLineNumber\",\"lineNumberContainerStyle\",\"lineNumberStyle\",\"wrapLines\",\"wrapLongLines\",\"lineProps\",\"renderer\",\"PreTag\",\"CodeTag\",\"code\",\"astGenerator\"];function highlight_ownKeys(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),i.push.apply(i,u)}return i}function highlight_objectSpread(o){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?highlight_ownKeys(Object(i),!0).forEach((function(s){defineProperty_defineProperty(o,s,i[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):highlight_ownKeys(Object(i)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(i,s))}))}return o}var Ak=/\\n/g;function AllLineNumbers(o){var s=o.codeString,i=o.codeStyle,u=o.containerStyle,_=void 0===u?{float:\"left\",paddingRight:\"10px\"}:u,w=o.numberStyle,x=void 0===w?{}:w,C=o.startingLineNumber;return Pe.createElement(\"code\",{style:Object.assign({},i,_)},function getAllLineNumbers(o){var s=o.lines,i=o.startingLineNumber,u=o.style;return s.map((function(o,s){var _=s+i;return Pe.createElement(\"span\",{key:\"line-\".concat(s),className:\"react-syntax-highlighter-line-number\",style:\"function\"==typeof u?u(_):u},\"\".concat(_,\"\\n\"))}))}({lines:s.replace(/\\n$/,\"\").split(\"\\n\"),style:x,startingLineNumber:C}))}function getInlineLineNumber(o,s){return{type:\"element\",tagName:\"span\",properties:{key:\"line-number--\".concat(o),className:[\"comment\",\"linenumber\",\"react-syntax-highlighter-line-number\"],style:s},children:[{type:\"text\",value:o}]}}function assembleLineNumberStyles(o,s,i){var u,_={display:\"inline-block\",minWidth:(u=i,\"\".concat(u.toString().length,\".25em\")),paddingRight:\"1em\",textAlign:\"right\",userSelect:\"none\"},w=\"function\"==typeof o?o(s):o;return highlight_objectSpread(highlight_objectSpread({},_),w)}function createLineElement(o){var s=o.children,i=o.lineNumber,u=o.lineNumberStyle,_=o.largestLineNumber,w=o.showInlineLineNumbers,x=o.lineProps,C=void 0===x?{}:x,j=o.className,L=void 0===j?[]:j,B=o.showLineNumbers,$=o.wrapLongLines,V=\"function\"==typeof C?C(i):C;if(V.className=L,i&&w){var U=assembleLineNumberStyles(u,i,_);s.unshift(getInlineLineNumber(i,U))}return $&B&&(V.style=highlight_objectSpread(highlight_objectSpread({},V.style),{},{display:\"flex\"})),{type:\"element\",tagName:\"span\",properties:V,children:s}}function flattenCodeTree(o){for(var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],u=0;u<o.length;u++){var _=o[u];if(\"text\"===_.type)i.push(createLineElement({children:[_],className:toConsumableArray_toConsumableArray(new Set(s))}));else if(_.children){var w=s.concat(_.properties.className);flattenCodeTree(_.children,w).forEach((function(o){return i.push(o)}))}}return i}function processLines(o,s,i,u,_,w,x,C,j){var L,B=flattenCodeTree(o.value),$=[],V=-1,U=0;function createLine(o,w){var L=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return s||L.length>0?function createWrappedLine(o,s){return createLineElement({children:o,lineNumber:s,lineNumberStyle:C,largestLineNumber:x,showInlineLineNumbers:_,lineProps:i,className:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],showLineNumbers:u,wrapLongLines:j})}(o,w,L):function createUnwrappedLine(o,s){if(u&&s&&_){var i=assembleLineNumberStyles(C,s,x);o.unshift(getInlineLineNumber(s,i))}return o}(o,w)}for(var z=function _loop(){var o=B[U],s=o.children[0].value,i=function getNewLines(o){return o.match(Ak)}(s);if(i){var _=s.split(\"\\n\");_.forEach((function(s,i){var x=u&&$.length+w,C={type:\"text\",value:\"\".concat(s,\"\\n\")};if(0===i){var j=createLine(B.slice(V+1,U).concat(createLineElement({children:[C],className:o.properties.className})),x);$.push(j)}else if(i===_.length-1){var L=B[U+1]&&B[U+1].children&&B[U+1].children[0],z={type:\"text\",value:\"\".concat(s)};if(L){var Y=createLineElement({children:[z],className:o.properties.className});B.splice(U+1,0,Y)}else{var Z=createLine([z],x,o.properties.className);$.push(Z)}}else{var ee=createLine([C],x,o.properties.className);$.push(ee)}})),V=U}U++};U<B.length;)z();if(V!==B.length-1){var Y=B.slice(V+1,B.length);if(Y&&Y.length){var Z=createLine(Y,u&&$.length+w);$.push(Z)}}return s?$:(L=[]).concat.apply(L,$)}function defaultRenderer(o){var s=o.rows,i=o.stylesheet,u=o.useInlineStyles;return s.map((function(o,s){return createElement({node:o,stylesheet:i,useInlineStyles:u,key:\"code-segement\".concat(s)})}))}function isHighlightJs(o){return o&&void 0!==o.highlightAuto}var Bk=__webpack_require__(43768),qk=function highlight(o,s){return function SyntaxHighlighter(i){var u=i.language,_=i.children,w=i.style,x=void 0===w?s:w,C=i.customStyle,j=void 0===C?{}:C,L=i.codeTagProps,B=void 0===L?{className:u?\"language-\".concat(u):void 0,style:highlight_objectSpread(highlight_objectSpread({},x['code[class*=\"language-\"]']),x['code[class*=\"language-'.concat(u,'\"]')])}:L,$=i.useInlineStyles,V=void 0===$||$,U=i.showLineNumbers,z=void 0!==U&&U,Y=i.showInlineLineNumbers,Z=void 0===Y||Y,ee=i.startingLineNumber,ie=void 0===ee?1:ee,ae=i.lineNumberContainerStyle,ce=i.lineNumberStyle,le=void 0===ce?{}:ce,pe=i.wrapLines,de=i.wrapLongLines,fe=void 0!==de&&de,ye=i.lineProps,be=void 0===ye?{}:ye,_e=i.renderer,we=i.PreTag,Se=void 0===we?\"pre\":we,xe=i.CodeTag,Te=void 0===xe?\"code\":xe,Re=i.code,qe=void 0===Re?(Array.isArray(_)?_[0]:_)||\"\":Re,$e=i.astGenerator,ze=_objectWithoutProperties(i,xk);$e=$e||o;var We=z?Pe.createElement(AllLineNumbers,{containerStyle:ae,codeStyle:B.style||{},numberStyle:le,startingLineNumber:ie,codeString:qe}):null,He=x.hljs||x['pre[class*=\"language-\"]']||{backgroundColor:\"#fff\"},Ye=isHighlightJs($e)?\"hljs\":\"prismjs\",Xe=V?Object.assign({},ze,{style:Object.assign({},He,j)}):Object.assign({},ze,{className:ze.className?\"\".concat(Ye,\" \").concat(ze.className):Ye,style:Object.assign({},j)});if(B.style=highlight_objectSpread(highlight_objectSpread({},B.style),{},fe?{whiteSpace:\"pre-wrap\"}:{whiteSpace:\"pre\"}),!$e)return Pe.createElement(Se,Xe,We,Pe.createElement(Te,B,qe));(void 0===pe&&_e||fe)&&(pe=!0),_e=_e||defaultRenderer;var Qe=[{type:\"text\",value:qe}],et=function getCodeTree(o){var s=o.astGenerator,i=o.language,u=o.code,_=o.defaultCodeValue;if(isHighlightJs(s)){var w=checkForListedLanguage(s,i);return\"text\"===i?{value:_,language:\"text\"}:w?s.highlight(i,u):s.highlightAuto(u)}try{return i&&\"text\"!==i?{value:s.highlight(u,i)}:{value:_}}catch(o){return{value:_}}}({astGenerator:$e,language:u,code:qe,defaultCodeValue:Qe});null===et.language&&(et.value=Qe);var tt=processLines(et,pe,be,z,Z,ie,et.value.length+ie,le,fe);return Pe.createElement(Se,Xe,Pe.createElement(Te,B,!Z&&We,_e({rows:tt,stylesheet:x,useInlineStyles:V})))}}(Bk,{});qk.registerLanguage=Bk.registerLanguage;const Vk=qk;var zk=__webpack_require__(95089);const eO=__webpack_require__.n(zk)();var tO=__webpack_require__(65772);const rO=__webpack_require__.n(tO)();var nO=__webpack_require__(17285);const oO=__webpack_require__.n(nO)();var sO=__webpack_require__(35344);const iO=__webpack_require__.n(sO)();var aO=__webpack_require__(17533);const cO=__webpack_require__.n(aO)();var lO=__webpack_require__(73402);const uO=__webpack_require__.n(lO)();var pO=__webpack_require__(26571);const hO=__webpack_require__.n(pO)(),after_load=()=>{Vk.registerLanguage(\"json\",rO),Vk.registerLanguage(\"js\",eO),Vk.registerLanguage(\"xml\",oO),Vk.registerLanguage(\"yaml\",cO),Vk.registerLanguage(\"http\",uO),Vk.registerLanguage(\"bash\",iO),Vk.registerLanguage(\"powershell\",hO),Vk.registerLanguage(\"javascript\",eO)},dO={hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#333\",color:\"white\"},\"hljs-name\":{fontWeight:\"bold\"},\"hljs-strong\":{fontWeight:\"bold\"},\"hljs-code\":{fontStyle:\"italic\",color:\"#888\"},\"hljs-emphasis\":{fontStyle:\"italic\"},\"hljs-tag\":{color:\"#62c8f3\"},\"hljs-variable\":{color:\"#ade5fc\"},\"hljs-template-variable\":{color:\"#ade5fc\"},\"hljs-selector-id\":{color:\"#ade5fc\"},\"hljs-selector-class\":{color:\"#ade5fc\"},\"hljs-string\":{color:\"#a2fca2\"},\"hljs-bullet\":{color:\"#d36363\"},\"hljs-type\":{color:\"#ffa\"},\"hljs-title\":{color:\"#ffa\"},\"hljs-section\":{color:\"#ffa\"},\"hljs-attribute\":{color:\"#ffa\"},\"hljs-quote\":{color:\"#ffa\"},\"hljs-built_in\":{color:\"#ffa\"},\"hljs-builtin-name\":{color:\"#ffa\"},\"hljs-number\":{color:\"#d36363\"},\"hljs-symbol\":{color:\"#d36363\"},\"hljs-keyword\":{color:\"#fcc28c\"},\"hljs-selector-tag\":{color:\"#fcc28c\"},\"hljs-literal\":{color:\"#fcc28c\"},\"hljs-comment\":{color:\"#888\"},\"hljs-deletion\":{color:\"#333\",backgroundColor:\"#fc9b9b\"},\"hljs-regexp\":{color:\"#c6b4f0\"},\"hljs-link\":{color:\"#c6b4f0\"},\"hljs-meta\":{color:\"#fc9b9b\"},\"hljs-addition\":{backgroundColor:\"#a2fca2\",color:\"#333\"}},fO={agate:dO,arta:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#222\",color:\"#aaa\"},\"hljs-subst\":{color:\"#aaa\"},\"hljs-section\":{color:\"#fff\",fontWeight:\"bold\"},\"hljs-comment\":{color:\"#444\"},\"hljs-quote\":{color:\"#444\"},\"hljs-meta\":{color:\"#444\"},\"hljs-string\":{color:\"#ffcc33\"},\"hljs-symbol\":{color:\"#ffcc33\"},\"hljs-bullet\":{color:\"#ffcc33\"},\"hljs-regexp\":{color:\"#ffcc33\"},\"hljs-number\":{color:\"#00cc66\"},\"hljs-addition\":{color:\"#00cc66\"},\"hljs-built_in\":{color:\"#32aaee\"},\"hljs-builtin-name\":{color:\"#32aaee\"},\"hljs-literal\":{color:\"#32aaee\"},\"hljs-type\":{color:\"#32aaee\"},\"hljs-template-variable\":{color:\"#32aaee\"},\"hljs-attribute\":{color:\"#32aaee\"},\"hljs-link\":{color:\"#32aaee\"},\"hljs-keyword\":{color:\"#6644aa\"},\"hljs-selector-tag\":{color:\"#6644aa\"},\"hljs-name\":{color:\"#6644aa\"},\"hljs-selector-id\":{color:\"#6644aa\"},\"hljs-selector-class\":{color:\"#6644aa\"},\"hljs-title\":{color:\"#bb1166\"},\"hljs-variable\":{color:\"#bb1166\"},\"hljs-deletion\":{color:\"#bb1166\"},\"hljs-template-tag\":{color:\"#bb1166\"},\"hljs-doctag\":{fontWeight:\"bold\"},\"hljs-strong\":{fontWeight:\"bold\"},\"hljs-emphasis\":{fontStyle:\"italic\"}},monokai:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#272822\",color:\"#ddd\"},\"hljs-tag\":{color:\"#f92672\"},\"hljs-keyword\":{color:\"#f92672\",fontWeight:\"bold\"},\"hljs-selector-tag\":{color:\"#f92672\",fontWeight:\"bold\"},\"hljs-literal\":{color:\"#f92672\",fontWeight:\"bold\"},\"hljs-strong\":{color:\"#f92672\"},\"hljs-name\":{color:\"#f92672\"},\"hljs-code\":{color:\"#66d9ef\"},\"hljs-class .hljs-title\":{color:\"white\"},\"hljs-attribute\":{color:\"#bf79db\"},\"hljs-symbol\":{color:\"#bf79db\"},\"hljs-regexp\":{color:\"#bf79db\"},\"hljs-link\":{color:\"#bf79db\"},\"hljs-string\":{color:\"#a6e22e\"},\"hljs-bullet\":{color:\"#a6e22e\"},\"hljs-subst\":{color:\"#a6e22e\"},\"hljs-title\":{color:\"#a6e22e\",fontWeight:\"bold\"},\"hljs-section\":{color:\"#a6e22e\",fontWeight:\"bold\"},\"hljs-emphasis\":{color:\"#a6e22e\"},\"hljs-type\":{color:\"#a6e22e\",fontWeight:\"bold\"},\"hljs-built_in\":{color:\"#a6e22e\"},\"hljs-builtin-name\":{color:\"#a6e22e\"},\"hljs-selector-attr\":{color:\"#a6e22e\"},\"hljs-selector-pseudo\":{color:\"#a6e22e\"},\"hljs-addition\":{color:\"#a6e22e\"},\"hljs-variable\":{color:\"#a6e22e\"},\"hljs-template-tag\":{color:\"#a6e22e\"},\"hljs-template-variable\":{color:\"#a6e22e\"},\"hljs-comment\":{color:\"#75715e\"},\"hljs-quote\":{color:\"#75715e\"},\"hljs-deletion\":{color:\"#75715e\"},\"hljs-meta\":{color:\"#75715e\"},\"hljs-doctag\":{fontWeight:\"bold\"},\"hljs-selector-id\":{fontWeight:\"bold\"}},nord:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#2E3440\",color:\"#D8DEE9\"},\"hljs-subst\":{color:\"#D8DEE9\"},\"hljs-selector-tag\":{color:\"#81A1C1\"},\"hljs-selector-id\":{color:\"#8FBCBB\",fontWeight:\"bold\"},\"hljs-selector-class\":{color:\"#8FBCBB\"},\"hljs-selector-attr\":{color:\"#8FBCBB\"},\"hljs-selector-pseudo\":{color:\"#88C0D0\"},\"hljs-addition\":{backgroundColor:\"rgba(163, 190, 140, 0.5)\"},\"hljs-deletion\":{backgroundColor:\"rgba(191, 97, 106, 0.5)\"},\"hljs-built_in\":{color:\"#8FBCBB\"},\"hljs-type\":{color:\"#8FBCBB\"},\"hljs-class\":{color:\"#8FBCBB\"},\"hljs-function\":{color:\"#88C0D0\"},\"hljs-function > .hljs-title\":{color:\"#88C0D0\"},\"hljs-keyword\":{color:\"#81A1C1\"},\"hljs-literal\":{color:\"#81A1C1\"},\"hljs-symbol\":{color:\"#81A1C1\"},\"hljs-number\":{color:\"#B48EAD\"},\"hljs-regexp\":{color:\"#EBCB8B\"},\"hljs-string\":{color:\"#A3BE8C\"},\"hljs-title\":{color:\"#8FBCBB\"},\"hljs-params\":{color:\"#D8DEE9\"},\"hljs-bullet\":{color:\"#81A1C1\"},\"hljs-code\":{color:\"#8FBCBB\"},\"hljs-emphasis\":{fontStyle:\"italic\"},\"hljs-formula\":{color:\"#8FBCBB\"},\"hljs-strong\":{fontWeight:\"bold\"},\"hljs-link:hover\":{textDecoration:\"underline\"},\"hljs-quote\":{color:\"#4C566A\"},\"hljs-comment\":{color:\"#4C566A\"},\"hljs-doctag\":{color:\"#8FBCBB\"},\"hljs-meta\":{color:\"#5E81AC\"},\"hljs-meta-keyword\":{color:\"#5E81AC\"},\"hljs-meta-string\":{color:\"#A3BE8C\"},\"hljs-attr\":{color:\"#8FBCBB\"},\"hljs-attribute\":{color:\"#D8DEE9\"},\"hljs-builtin-name\":{color:\"#81A1C1\"},\"hljs-name\":{color:\"#81A1C1\"},\"hljs-section\":{color:\"#88C0D0\"},\"hljs-tag\":{color:\"#81A1C1\"},\"hljs-variable\":{color:\"#D8DEE9\"},\"hljs-template-variable\":{color:\"#D8DEE9\"},\"hljs-template-tag\":{color:\"#5E81AC\"},\"abnf .hljs-attribute\":{color:\"#88C0D0\"},\"abnf .hljs-symbol\":{color:\"#EBCB8B\"},\"apache .hljs-attribute\":{color:\"#88C0D0\"},\"apache .hljs-section\":{color:\"#81A1C1\"},\"arduino .hljs-built_in\":{color:\"#88C0D0\"},\"aspectj .hljs-meta\":{color:\"#D08770\"},\"aspectj > .hljs-title\":{color:\"#88C0D0\"},\"bnf .hljs-attribute\":{color:\"#8FBCBB\"},\"clojure .hljs-name\":{color:\"#88C0D0\"},\"clojure .hljs-symbol\":{color:\"#EBCB8B\"},\"coq .hljs-built_in\":{color:\"#88C0D0\"},\"cpp .hljs-meta-string\":{color:\"#8FBCBB\"},\"css .hljs-built_in\":{color:\"#88C0D0\"},\"css .hljs-keyword\":{color:\"#D08770\"},\"diff .hljs-meta\":{color:\"#8FBCBB\"},\"ebnf .hljs-attribute\":{color:\"#8FBCBB\"},\"glsl .hljs-built_in\":{color:\"#88C0D0\"},\"groovy .hljs-meta:not(:first-child)\":{color:\"#D08770\"},\"haxe .hljs-meta\":{color:\"#D08770\"},\"java .hljs-meta\":{color:\"#D08770\"},\"ldif .hljs-attribute\":{color:\"#8FBCBB\"},\"lisp .hljs-name\":{color:\"#88C0D0\"},\"lua .hljs-built_in\":{color:\"#88C0D0\"},\"moonscript .hljs-built_in\":{color:\"#88C0D0\"},\"nginx .hljs-attribute\":{color:\"#88C0D0\"},\"nginx .hljs-section\":{color:\"#5E81AC\"},\"pf .hljs-built_in\":{color:\"#88C0D0\"},\"processing .hljs-built_in\":{color:\"#88C0D0\"},\"scss .hljs-keyword\":{color:\"#81A1C1\"},\"stylus .hljs-keyword\":{color:\"#81A1C1\"},\"swift .hljs-meta\":{color:\"#D08770\"},\"vim .hljs-built_in\":{color:\"#88C0D0\",fontStyle:\"italic\"},\"yaml .hljs-meta\":{color:\"#D08770\"}},obsidian:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",background:\"#282b2e\",color:\"#e0e2e4\"},\"hljs-keyword\":{color:\"#93c763\",fontWeight:\"bold\"},\"hljs-selector-tag\":{color:\"#93c763\",fontWeight:\"bold\"},\"hljs-literal\":{color:\"#93c763\",fontWeight:\"bold\"},\"hljs-selector-id\":{color:\"#93c763\"},\"hljs-number\":{color:\"#ffcd22\"},\"hljs-attribute\":{color:\"#668bb0\"},\"hljs-code\":{color:\"white\"},\"hljs-class .hljs-title\":{color:\"white\"},\"hljs-section\":{color:\"white\",fontWeight:\"bold\"},\"hljs-regexp\":{color:\"#d39745\"},\"hljs-link\":{color:\"#d39745\"},\"hljs-meta\":{color:\"#557182\"},\"hljs-tag\":{color:\"#8cbbad\"},\"hljs-name\":{color:\"#8cbbad\",fontWeight:\"bold\"},\"hljs-bullet\":{color:\"#8cbbad\"},\"hljs-subst\":{color:\"#8cbbad\"},\"hljs-emphasis\":{color:\"#8cbbad\"},\"hljs-type\":{color:\"#8cbbad\",fontWeight:\"bold\"},\"hljs-built_in\":{color:\"#8cbbad\"},\"hljs-selector-attr\":{color:\"#8cbbad\"},\"hljs-selector-pseudo\":{color:\"#8cbbad\"},\"hljs-addition\":{color:\"#8cbbad\"},\"hljs-variable\":{color:\"#8cbbad\"},\"hljs-template-tag\":{color:\"#8cbbad\"},\"hljs-template-variable\":{color:\"#8cbbad\"},\"hljs-string\":{color:\"#ec7600\"},\"hljs-symbol\":{color:\"#ec7600\"},\"hljs-comment\":{color:\"#818e96\"},\"hljs-quote\":{color:\"#818e96\"},\"hljs-deletion\":{color:\"#818e96\"},\"hljs-selector-class\":{color:\"#A082BD\"},\"hljs-doctag\":{fontWeight:\"bold\"},\"hljs-title\":{fontWeight:\"bold\"},\"hljs-strong\":{fontWeight:\"bold\"}},\"tomorrow-night\":{\"hljs-comment\":{color:\"#969896\"},\"hljs-quote\":{color:\"#969896\"},\"hljs-variable\":{color:\"#cc6666\"},\"hljs-template-variable\":{color:\"#cc6666\"},\"hljs-tag\":{color:\"#cc6666\"},\"hljs-name\":{color:\"#cc6666\"},\"hljs-selector-id\":{color:\"#cc6666\"},\"hljs-selector-class\":{color:\"#cc6666\"},\"hljs-regexp\":{color:\"#cc6666\"},\"hljs-deletion\":{color:\"#cc6666\"},\"hljs-number\":{color:\"#de935f\"},\"hljs-built_in\":{color:\"#de935f\"},\"hljs-builtin-name\":{color:\"#de935f\"},\"hljs-literal\":{color:\"#de935f\"},\"hljs-type\":{color:\"#de935f\"},\"hljs-params\":{color:\"#de935f\"},\"hljs-meta\":{color:\"#de935f\"},\"hljs-link\":{color:\"#de935f\"},\"hljs-attribute\":{color:\"#f0c674\"},\"hljs-string\":{color:\"#b5bd68\"},\"hljs-symbol\":{color:\"#b5bd68\"},\"hljs-bullet\":{color:\"#b5bd68\"},\"hljs-addition\":{color:\"#b5bd68\"},\"hljs-title\":{color:\"#81a2be\"},\"hljs-section\":{color:\"#81a2be\"},\"hljs-keyword\":{color:\"#b294bb\"},\"hljs-selector-tag\":{color:\"#b294bb\"},hljs:{display:\"block\",overflowX:\"auto\",background:\"#1d1f21\",color:\"#c5c8c6\",padding:\"0.5em\"},\"hljs-emphasis\":{fontStyle:\"italic\"},\"hljs-strong\":{fontWeight:\"bold\"}},idea:{hljs:{display:\"block\",overflowX:\"auto\",padding:\"0.5em\",color:\"#000\",background:\"#fff\"},\"hljs-subst\":{fontWeight:\"normal\",color:\"#000\"},\"hljs-title\":{fontWeight:\"normal\",color:\"#000\"},\"hljs-comment\":{color:\"#808080\",fontStyle:\"italic\"},\"hljs-quote\":{color:\"#808080\",fontStyle:\"italic\"},\"hljs-meta\":{color:\"#808000\"},\"hljs-tag\":{background:\"#efefef\"},\"hljs-section\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-name\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-literal\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-keyword\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-selector-tag\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-type\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-selector-id\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-selector-class\":{fontWeight:\"bold\",color:\"#000080\"},\"hljs-attribute\":{fontWeight:\"bold\",color:\"#0000ff\"},\"hljs-number\":{fontWeight:\"normal\",color:\"#0000ff\"},\"hljs-regexp\":{fontWeight:\"normal\",color:\"#0000ff\"},\"hljs-link\":{fontWeight:\"normal\",color:\"#0000ff\"},\"hljs-string\":{color:\"#008000\",fontWeight:\"bold\"},\"hljs-symbol\":{color:\"#000\",background:\"#d0eded\",fontStyle:\"italic\"},\"hljs-bullet\":{color:\"#000\",background:\"#d0eded\",fontStyle:\"italic\"},\"hljs-formula\":{color:\"#000\",background:\"#d0eded\",fontStyle:\"italic\"},\"hljs-doctag\":{textDecoration:\"underline\"},\"hljs-variable\":{color:\"#660e7a\"},\"hljs-template-variable\":{color:\"#660e7a\"},\"hljs-addition\":{background:\"#baeeba\"},\"hljs-deletion\":{background:\"#ffc8bd\"},\"hljs-emphasis\":{fontStyle:\"italic\"},\"hljs-strong\":{fontWeight:\"bold\"}}},mO=dO,components_SyntaxHighlighter=({language:o,className:s=\"\",getConfigs:i,syntaxHighlighting:u={},children:_=\"\"})=>{const w=i().syntaxHighlight.theme,{styles:x,defaultStyle:C}=u,j=x?.[w]??C;return Pe.createElement(Vk,{language:o,className:s,style:j},_)};var gO=__webpack_require__(5419),yO=__webpack_require__.n(gO);const components_HighlightCode=({fileName:o=\"response.txt\",className:s,downloadable:i,getComponent:u,canCopy:_,language:w,children:x})=>{const C=(0,Pe.useRef)(null),j=u(\"SyntaxHighlighter\",!0),handlePreventYScrollingBeyondElement=o=>{const{target:s,deltaY:i}=o,{scrollHeight:u,offsetHeight:_,scrollTop:w}=s;u>_&&(0===w&&i<0||_+w>=u&&i>0)&&o.preventDefault()};return(0,Pe.useEffect)((()=>{const o=Array.from(C.current.childNodes).filter((o=>!!o.nodeType&&o.classList.contains(\"microlight\")));return o.forEach((o=>o.addEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement,{passive:!1}))),()=>{o.forEach((o=>o.removeEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement)))}}),[x,s,w]),Pe.createElement(\"div\",{className:\"highlight-code\",ref:C},_&&Pe.createElement(\"div\",{className:\"copy-to-clipboard\"},Pe.createElement(Ro.CopyToClipboard,{text:x},Pe.createElement(\"button\",null))),i?Pe.createElement(\"button\",{className:\"download-contents\",onClick:()=>{yO()(x,o)}},\"Download\"):null,Pe.createElement(j,{language:w,className:To()(s,\"microlight\"),renderPlainText:({children:o,PlainTextViewer:i})=>Pe.createElement(i,{className:s},o)},x))},components_PlainTextViewer=({className:o=\"\",children:s})=>Pe.createElement(\"pre\",{className:To()(\"microlight\",o)},s),wrap_components_SyntaxHighlighter=(o,s)=>({renderPlainText:i,children:u,..._})=>{const w=s.getConfigs().syntaxHighlight.activated,x=s.getComponent(\"PlainTextViewer\");return w||\"function\"!=typeof i?w?Pe.createElement(o,_,u):Pe.createElement(x,null,u):i({children:u,PlainTextViewer:x})},SyntaxHighlightingPlugin1=()=>({afterLoad:after_load,rootInjects:{syntaxHighlighting:{styles:fO,defaultStyle:mO}},components:{SyntaxHighlighter:components_SyntaxHighlighter,HighlightCode:components_HighlightCode,PlainTextViewer:components_PlainTextViewer}}),SyntaxHighlightingPlugin2=()=>({wrapComponents:{SyntaxHighlighter:wrap_components_SyntaxHighlighter}}),syntax_highlighting=()=>[SyntaxHighlightingPlugin1,SyntaxHighlightingPlugin2],versions_after_load=()=>{const{GIT_DIRTY:o,GIT_COMMIT:s,PACKAGE_VERSION:i,BUILD_TIME:u}={PACKAGE_VERSION:\"5.17.14\",GIT_COMMIT:\"g8aa52920\",GIT_DIRTY:!0,BUILD_TIME:\"Tue, 28 May 2024 05:23:41 GMT\"};at.versions=at.versions||{},at.versions.swaggerUI={version:i,gitRevision:s,gitDirty:o,buildTimestamp:u}},versions=()=>({afterLoad:versions_after_load});var vO=__webpack_require__(47248),bO=__webpack_require__.n(vO);const _O=console.error,withErrorBoundary=o=>s=>{const{getComponent:i,fn:u}=o(),_=i(\"ErrorBoundary\"),w=u.getDisplayName(s);class WithErrorBoundary extends Pe.Component{render(){return Pe.createElement(_,{targetName:w,getComponent:i,fn:u},Pe.createElement(s,wo()({},this.props,this.context)))}}var x;return WithErrorBoundary.displayName=`WithErrorBoundary(${w})`,(x=s).prototype&&x.prototype.isReactComponent&&(WithErrorBoundary.prototype.mapStateToProps=s.prototype.mapStateToProps),WithErrorBoundary},fallback=({name:o})=>Pe.createElement(\"div\",{className:\"fallback\"},\"😱 \",Pe.createElement(\"i\",null,\"Could not render \",\"t\"===o?\"this component\":o,\", see the console.\"));class ErrorBoundary extends Pe.Component{static defaultProps={targetName:\"this component\",getComponent:()=>fallback,fn:{componentDidCatch:_O},children:null};static getDerivedStateFromError(o){return{hasError:!0,error:o}}constructor(...o){super(...o),this.state={hasError:!1,error:null}}componentDidCatch(o,s){this.props.fn.componentDidCatch(o,s)}render(){const{getComponent:o,targetName:s,children:i}=this.props;if(this.state.hasError){const i=o(\"Fallback\");return Pe.createElement(i,{name:s})}return i}}const EO=ErrorBoundary,safe_render=({componentList:o=[],fullOverride:s=!1}={})=>({getSystem:i})=>{const u=s?o:[\"App\",\"BaseLayout\",\"VersionPragmaFilter\",\"InfoContainer\",\"ServersContainer\",\"SchemesContainer\",\"AuthorizeBtnContainer\",\"FilterContainer\",\"Operations\",\"OperationContainer\",\"parameters\",\"responses\",\"OperationServers\",\"Models\",\"ModelWrapper\",...o],_=bO()(u,Array(u.length).fill(((o,{fn:s})=>s.withErrorBoundary(o))));return{fn:{componentDidCatch:_O,withErrorBoundary:withErrorBoundary(i)},components:{ErrorBoundary:EO,Fallback:fallback},wrapComponents:_}};class App extends Pe.Component{getLayout(){const{getComponent:o,layoutSelectors:s}=this.props,i=s.current(),u=o(i,!0);return u||(()=>Pe.createElement(\"h1\",null,' No layout defined for \"',i,'\" '))}render(){const o=this.getLayout();return Pe.createElement(o,null)}}const wO=App;class AuthorizationPopup extends Pe.Component{close=()=>{let{authActions:o}=this.props;o.showDefinitions(!1)};render(){let{authSelectors:o,authActions:s,getComponent:i,errSelectors:u,specSelectors:_,fn:{AST:w={}}}=this.props,x=o.shownDefinitions();const C=i(\"auths\"),j=i(\"CloseIcon\");return Pe.createElement(\"div\",{className:\"dialog-ux\"},Pe.createElement(\"div\",{className:\"backdrop-ux\"}),Pe.createElement(\"div\",{className:\"modal-ux\"},Pe.createElement(\"div\",{className:\"modal-dialog-ux\"},Pe.createElement(\"div\",{className:\"modal-ux-inner\"},Pe.createElement(\"div\",{className:\"modal-ux-header\"},Pe.createElement(\"h3\",null,\"Available authorizations\"),Pe.createElement(\"button\",{type:\"button\",className:\"close-modal\",onClick:this.close},Pe.createElement(j,null))),Pe.createElement(\"div\",{className:\"modal-ux-content\"},x.valueSeq().map(((x,j)=>Pe.createElement(C,{key:j,AST:w,definitions:x,getComponent:i,errSelectors:u,authSelectors:o,authActions:s,specSelectors:_}))))))))}}class AuthorizeBtn extends Pe.Component{render(){let{isAuthorized:o,showPopup:s,onClick:i,getComponent:u}=this.props;const _=u(\"authorizationPopup\",!0),w=u(\"LockAuthIcon\",!0),x=u(\"UnlockAuthIcon\",!0);return Pe.createElement(\"div\",{className:\"auth-wrapper\"},Pe.createElement(\"button\",{className:o?\"btn authorize locked\":\"btn authorize unlocked\",onClick:i},Pe.createElement(\"span\",null,\"Authorize\"),o?Pe.createElement(w,null):Pe.createElement(x,null)),s&&Pe.createElement(_,null))}}class AuthorizeBtnContainer extends Pe.Component{render(){const{authActions:o,authSelectors:s,specSelectors:i,getComponent:u}=this.props,_=i.securityDefinitions(),w=s.definitionsToAuthorize(),x=u(\"authorizeBtn\");return _?Pe.createElement(x,{onClick:()=>o.showDefinitions(w),isAuthorized:!!s.authorized().size,showPopup:!!s.shownDefinitions(),getComponent:u}):null}}class AuthorizeOperationBtn extends Pe.Component{onClick=o=>{o.stopPropagation();let{onClick:s}=this.props;s&&s()};render(){let{isAuthorized:o,getComponent:s}=this.props;const i=s(\"LockAuthOperationIcon\",!0),u=s(\"UnlockAuthOperationIcon\",!0);return Pe.createElement(\"button\",{className:\"authorization__btn\",\"aria-label\":o?\"authorization button locked\":\"authorization button unlocked\",onClick:this.onClick},o?Pe.createElement(i,{className:\"locked\"}):Pe.createElement(u,{className:\"unlocked\"}))}}class Auths extends Pe.Component{constructor(o,s){super(o,s),this.state={}}onAuthChange=o=>{let{name:s}=o;this.setState({[s]:o})};submitAuth=o=>{o.preventDefault();let{authActions:s}=this.props;s.authorizeWithPersistOption(this.state)};logoutClick=o=>{o.preventDefault();let{authActions:s,definitions:i}=this.props,u=i.map(((o,s)=>s)).toArray();this.setState(u.reduce(((o,s)=>(o[s]=\"\",o)),{})),s.logoutWithPersistOption(u)};close=o=>{o.preventDefault();let{authActions:s}=this.props;s.showDefinitions(!1)};render(){let{definitions:o,getComponent:s,authSelectors:i,errSelectors:u}=this.props;const _=s(\"AuthItem\"),w=s(\"oauth2\",!0),x=s(\"Button\");let C=i.authorized(),j=o.filter(((o,s)=>!!C.get(s))),L=o.filter((o=>\"oauth2\"!==o.get(\"type\"))),B=o.filter((o=>\"oauth2\"===o.get(\"type\")));return Pe.createElement(\"div\",{className:\"auth-container\"},!!L.size&&Pe.createElement(\"form\",{onSubmit:this.submitAuth},L.map(((o,i)=>Pe.createElement(_,{key:i,schema:o,name:i,getComponent:s,onAuthChange:this.onAuthChange,authorized:C,errSelectors:u}))).toArray(),Pe.createElement(\"div\",{className:\"auth-btn-wrapper\"},L.size===j.size?Pe.createElement(x,{className:\"btn modal-btn auth\",onClick:this.logoutClick,\"aria-label\":\"Remove authorization\"},\"Logout\"):Pe.createElement(x,{type:\"submit\",className:\"btn modal-btn auth authorize\",\"aria-label\":\"Apply credentials\"},\"Authorize\"),Pe.createElement(x,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\"))),B&&B.size?Pe.createElement(\"div\",null,Pe.createElement(\"div\",{className:\"scope-def\"},Pe.createElement(\"p\",null,\"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\"),Pe.createElement(\"p\",null,\"API requires the following scopes. Select which ones you want to grant to Swagger UI.\")),o.filter((o=>\"oauth2\"===o.get(\"type\"))).map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(w,{authorized:C,schema:o,name:s})))).toArray()):null)}}class auth_item_Auths extends Pe.Component{render(){let{schema:o,name:s,getComponent:i,onAuthChange:u,authorized:_,errSelectors:w}=this.props;const x=i(\"apiKeyAuth\"),C=i(\"basicAuth\");let j;const L=o.get(\"type\");switch(L){case\"apiKey\":j=Pe.createElement(x,{key:s,schema:o,name:s,errSelectors:w,authorized:_,getComponent:i,onChange:u});break;case\"basic\":j=Pe.createElement(C,{key:s,schema:o,name:s,errSelectors:w,authorized:_,getComponent:i,onChange:u});break;default:j=Pe.createElement(\"div\",{key:s},\"Unknown security definition type \",L)}return Pe.createElement(\"div\",{key:`${s}-jump`},j)}}class AuthError extends Pe.Component{render(){let{error:o}=this.props,s=o.get(\"level\"),i=o.get(\"message\"),u=o.get(\"source\");return Pe.createElement(\"div\",{className:\"errors\"},Pe.createElement(\"b\",null,u,\" \",s),Pe.createElement(\"span\",null,i))}}class ApiKeyAuth extends Pe.Component{constructor(o,s){super(o,s);let{name:i,schema:u}=this.props,_=this.getValue();this.state={name:i,schema:u,value:_}}getValue(){let{name:o,authorized:s}=this.props;return s&&s.getIn([o,\"value\"])}onChange=o=>{let{onChange:s}=this.props,i=o.target.value,u=Object.assign({},this.state,{value:i});this.setState(u),s(u)};render(){let{schema:o,getComponent:s,errSelectors:i,name:u}=this.props;const _=s(\"Input\"),w=s(\"Row\"),x=s(\"Col\"),C=s(\"authError\"),j=s(\"Markdown\",!0),L=s(\"JumpToPath\",!0);let B=this.getValue(),$=i.allErrors().filter((o=>o.get(\"authId\")===u));return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,Pe.createElement(\"code\",null,u||o.get(\"name\")),\" (apiKey)\",Pe.createElement(L,{path:[\"securityDefinitions\",u]})),B&&Pe.createElement(\"h6\",null,\"Authorized\"),Pe.createElement(w,null,Pe.createElement(j,{source:o.get(\"description\")})),Pe.createElement(w,null,Pe.createElement(\"p\",null,\"Name: \",Pe.createElement(\"code\",null,o.get(\"name\")))),Pe.createElement(w,null,Pe.createElement(\"p\",null,\"In: \",Pe.createElement(\"code\",null,o.get(\"in\")))),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"api_key_value\"},\"Value:\"),B?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"api_key_value\",type:\"text\",onChange:this.onChange,autoFocus:!0}))),$.valueSeq().map(((o,s)=>Pe.createElement(C,{error:o,key:s}))))}}class BasicAuth extends Pe.Component{constructor(o,s){super(o,s);let{schema:i,name:u}=this.props,_=this.getValue().username;this.state={name:u,schema:i,value:_?{username:_}:{}}}getValue(){let{authorized:o,name:s}=this.props;return o&&o.getIn([s,\"value\"])||{}}onChange=o=>{let{onChange:s}=this.props,{value:i,name:u}=o.target,_=this.state.value;_[u]=i,this.setState({value:_}),s(this.state)};render(){let{schema:o,getComponent:s,name:i,errSelectors:u}=this.props;const _=s(\"Input\"),w=s(\"Row\"),x=s(\"Col\"),C=s(\"authError\"),j=s(\"JumpToPath\",!0),L=s(\"Markdown\",!0);let B=this.getValue().username,$=u.allErrors().filter((o=>o.get(\"authId\")===i));return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,\"Basic authorization\",Pe.createElement(j,{path:[\"securityDefinitions\",i]})),B&&Pe.createElement(\"h6\",null,\"Authorized\"),Pe.createElement(w,null,Pe.createElement(L,{source:o.get(\"description\")})),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth_username\"},\"Username:\"),B?Pe.createElement(\"code\",null,\" \",B,\" \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth_username\",type:\"text\",required:\"required\",name:\"username\",onChange:this.onChange,autoFocus:!0}))),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth_password\"},\"Password:\"),B?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth_password\",autoComplete:\"new-password\",name:\"password\",type:\"password\",onChange:this.onChange}))),$.valueSeq().map(((o,s)=>Pe.createElement(C,{error:o,key:s}))))}}function example_Example(o){const{example:s,showValue:i,getComponent:u}=o,_=u(\"Markdown\",!0),w=u(\"HighlightCode\",!0);return s?Pe.createElement(\"div\",{className:\"example\"},s.get(\"description\")?Pe.createElement(\"section\",{className:\"example__section\"},Pe.createElement(\"div\",{className:\"example__section-header\"},\"Example Description\"),Pe.createElement(\"p\",null,Pe.createElement(_,{source:s.get(\"description\")}))):null,i&&s.has(\"value\")?Pe.createElement(\"section\",{className:\"example__section\"},Pe.createElement(\"div\",{className:\"example__section-header\"},\"Example Value\"),Pe.createElement(w,null,stringify(s.get(\"value\")))):null):null}class ExamplesSelect extends Pe.PureComponent{static defaultProps={examples:$e().Map({}),onSelect:(...o)=>console.log(\"DEBUG: ExamplesSelect was not given an onSelect callback\",...o),currentExampleKey:null,showLabels:!0};_onSelect=(o,{isSyntheticChange:s=!1}={})=>{\"function\"==typeof this.props.onSelect&&this.props.onSelect(o,{isSyntheticChange:s})};_onDomSelect=o=>{if(\"function\"==typeof this.props.onSelect){const s=o.target.selectedOptions[0].getAttribute(\"value\");this._onSelect(s,{isSyntheticChange:!1})}};getCurrentExample=()=>{const{examples:o,currentExampleKey:s}=this.props,i=o.get(s),u=o.keySeq().first(),_=o.get(u);return i||_||Map({})};componentDidMount(){const{onSelect:o,examples:s}=this.props;if(\"function\"==typeof o){const o=s.first(),i=s.keyOf(o);this._onSelect(i,{isSyntheticChange:!0})}}UNSAFE_componentWillReceiveProps(o){const{currentExampleKey:s,examples:i}=o;if(i!==this.props.examples&&!i.has(s)){const o=i.first(),s=i.keyOf(o);this._onSelect(s,{isSyntheticChange:!0})}}render(){const{examples:o,currentExampleKey:s,isValueModified:i,isModifiedValueAvailable:u,showLabels:_}=this.props;return Pe.createElement(\"div\",{className:\"examples-select\"},_?Pe.createElement(\"span\",{className:\"examples-select__section-label\"},\"Examples: \"):null,Pe.createElement(\"select\",{className:\"examples-select-element\",onChange:this._onDomSelect,value:u&&i?\"__MODIFIED__VALUE__\":s||\"\"},u?Pe.createElement(\"option\",{value:\"__MODIFIED__VALUE__\"},\"[Modified value]\"):null,o.map(((o,s)=>Pe.createElement(\"option\",{key:s,value:s},o.get(\"summary\")||s))).valueSeq()))}}const stringifyUnlessList=o=>qe.List.isList(o)?o:stringify(o);class ExamplesSelectValueRetainer extends Pe.PureComponent{static defaultProps={userHasEditedBody:!1,examples:(0,qe.Map)({}),currentNamespace:\"__DEFAULT__NAMESPACE__\",setRetainRequestBodyValueFlag:()=>{},onSelect:(...o)=>console.log(\"ExamplesSelectValueRetainer: no `onSelect` function was provided\",...o),updateValue:(...o)=>console.log(\"ExamplesSelectValueRetainer: no `updateValue` function was provided\",...o)};constructor(o){super(o);const s=this._getCurrentExampleValue();this.state={[o.currentNamespace]:(0,qe.Map)({lastUserEditedValue:this.props.currentUserInputValue,lastDownstreamValue:s,isModifiedValueSelected:this.props.userHasEditedBody||this.props.currentUserInputValue!==s})}}componentWillUnmount(){this.props.setRetainRequestBodyValueFlag(!1)}_getStateForCurrentNamespace=()=>{const{currentNamespace:o}=this.props;return(this.state[o]||(0,qe.Map)()).toObject()};_setStateForCurrentNamespace=o=>{const{currentNamespace:s}=this.props;return this._setStateForNamespace(s,o)};_setStateForNamespace=(o,s)=>{const i=(this.state[o]||(0,qe.Map)()).mergeDeep(s);return this.setState({[o]:i})};_isCurrentUserInputSameAsExampleValue=()=>{const{currentUserInputValue:o}=this.props;return this._getCurrentExampleValue()===o};_getValueForExample=(o,s)=>{const{examples:i}=s||this.props;return stringifyUnlessList((i||(0,qe.Map)({})).getIn([o,\"value\"]))};_getCurrentExampleValue=o=>{const{currentKey:s}=o||this.props;return this._getValueForExample(s,o||this.props)};_onExamplesSelect=(o,{isSyntheticChange:s}={},...i)=>{const{onSelect:u,updateValue:_,currentUserInputValue:w,userHasEditedBody:x}=this.props,{lastUserEditedValue:C}=this._getStateForCurrentNamespace(),j=this._getValueForExample(o);if(\"__MODIFIED__VALUE__\"===o)return _(stringifyUnlessList(C)),this._setStateForCurrentNamespace({isModifiedValueSelected:!0});\"function\"==typeof u&&u(o,{isSyntheticChange:s},...i),this._setStateForCurrentNamespace({lastDownstreamValue:j,isModifiedValueSelected:s&&x||!!w&&w!==j}),s||\"function\"==typeof _&&_(stringifyUnlessList(j))};UNSAFE_componentWillReceiveProps(o){const{currentUserInputValue:s,examples:i,onSelect:u,userHasEditedBody:_}=o,{lastUserEditedValue:w,lastDownstreamValue:x}=this._getStateForCurrentNamespace(),C=this._getValueForExample(o.currentKey,o),j=i.filter((o=>o.get(\"value\")===s||stringify(o.get(\"value\"))===s));if(j.size){let s;s=j.has(o.currentKey)?o.currentKey:j.keySeq().first(),u(s,{isSyntheticChange:!0})}else s!==this.props.currentUserInputValue&&s!==w&&s!==x&&(this.props.setRetainRequestBodyValueFlag(!0),this._setStateForNamespace(o.currentNamespace,{lastUserEditedValue:o.currentUserInputValue,isModifiedValueSelected:_||s!==C}))}render(){const{currentUserInputValue:o,examples:s,currentKey:i,getComponent:u,userHasEditedBody:_}=this.props,{lastDownstreamValue:w,lastUserEditedValue:x,isModifiedValueSelected:C}=this._getStateForCurrentNamespace(),j=u(\"ExamplesSelect\");return Pe.createElement(j,{examples:s,currentExampleKey:i,onSelect:this._onExamplesSelect,isModifiedValueAvailable:!!x&&x!==w,isValueModified:void 0!==o&&C&&o!==this._getCurrentExampleValue()||_})}}function oauth2_authorize_authorize({auth:o,authActions:s,errActions:i,configs:u,authConfigs:_={},currentServer:w}){let{schema:x,scopes:C,name:j,clientId:L}=o,B=x.get(\"flow\"),$=[];switch(B){case\"password\":return void s.authorizePassword(o);case\"application\":case\"clientCredentials\":case\"client_credentials\":return void s.authorizeApplication(o);case\"accessCode\":case\"authorizationCode\":case\"authorization_code\":$.push(\"response_type=code\");break;case\"implicit\":$.push(\"response_type=token\")}\"string\"==typeof L&&$.push(\"client_id=\"+encodeURIComponent(L));let V=u.oauth2RedirectUrl;if(void 0===V)return void i.newAuthErr({authId:j,source:\"validation\",level:\"error\",message:\"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed.\"});$.push(\"redirect_uri=\"+encodeURIComponent(V));let U=[];if(Array.isArray(C)?U=C:$e().List.isList(C)&&(U=C.toArray()),U.length>0){let o=_.scopeSeparator||\" \";$.push(\"scope=\"+encodeURIComponent(U.join(o)))}let z=utils_btoa(new Date);if($.push(\"state=\"+encodeURIComponent(z)),void 0!==_.realm&&$.push(\"realm=\"+encodeURIComponent(_.realm)),(\"authorizationCode\"===B||\"authorization_code\"===B||\"accessCode\"===B)&&_.usePkceWithAuthorizationCodeGrant){const s=function generateCodeVerifier(){return b64toB64UrlEncoded(St()(32).toString(\"base64\"))}(),i=function createCodeChallenge(o){return b64toB64UrlEncoded(kt()(\"sha256\").update(o).digest(\"base64\"))}(s);$.push(\"code_challenge=\"+i),$.push(\"code_challenge_method=S256\"),o.codeVerifier=s}let{additionalQueryStringParams:Y}=_;for(let o in Y)void 0!==Y[o]&&$.push([o,Y[o]].map(encodeURIComponent).join(\"=\"));const Z=x.get(\"authorizationUrl\");let ee;ee=w?Mt()(sanitizeUrl(Z),w,!0).toString():sanitizeUrl(Z);let ie,ae=[ee,$.join(\"&\")].join(-1===Z.indexOf(\"?\")?\"?\":\"&\");ie=\"implicit\"===B?s.preAuthorizeImplicit:_.useBasicAuthenticationWithAccessCodeGrant?s.authorizeAccessCodeWithBasicAuthentication:s.authorizeAccessCodeWithFormParams,s.authPopup(ae,{auth:o,state:z,redirectUrl:V,callback:ie,errCb:i.newAuthErr})}class Oauth2 extends Pe.Component{constructor(o,s){super(o,s);let{name:i,schema:u,authorized:_,authSelectors:w}=this.props,x=_&&_.get(i),C=w.getConfigs()||{},j=x&&x.get(\"username\")||\"\",L=x&&x.get(\"clientId\")||C.clientId||\"\",B=x&&x.get(\"clientSecret\")||C.clientSecret||\"\",$=x&&x.get(\"passwordType\")||\"basic\",V=x&&x.get(\"scopes\")||C.scopes||[];\"string\"==typeof V&&(V=V.split(C.scopeSeparator||\" \")),this.state={appName:C.appName,name:i,schema:u,scopes:V,clientId:L,clientSecret:B,username:j,password:\"\",passwordType:$}}close=o=>{o.preventDefault();let{authActions:s}=this.props;s.showDefinitions(!1)};authorize=()=>{let{authActions:o,errActions:s,getConfigs:i,authSelectors:u,oas3Selectors:_}=this.props,w=i(),x=u.getConfigs();s.clear({authId:name,type:\"auth\",source:\"auth\"}),oauth2_authorize_authorize({auth:this.state,currentServer:_.serverEffectiveValue(_.selectedServer()),authActions:o,errActions:s,configs:w,authConfigs:x})};onScopeChange=o=>{let{target:s}=o,{checked:i}=s,u=s.dataset.value;if(i&&-1===this.state.scopes.indexOf(u)){let o=this.state.scopes.concat([u]);this.setState({scopes:o})}else!i&&this.state.scopes.indexOf(u)>-1&&this.setState({scopes:this.state.scopes.filter((o=>o!==u))})};onInputChange=o=>{let{target:{dataset:{name:s},value:i}}=o,u={[s]:i};this.setState(u)};selectScopes=o=>{o.target.dataset.all?this.setState({scopes:Array.from((this.props.schema.get(\"allowedScopes\")||this.props.schema.get(\"scopes\")).keys())}):this.setState({scopes:[]})};logout=o=>{o.preventDefault();let{authActions:s,errActions:i,name:u}=this.props;i.clear({authId:u,type:\"auth\",source:\"auth\"}),s.logoutWithPersistOption([u])};render(){let{schema:o,getComponent:s,authSelectors:i,errSelectors:u,name:_,specSelectors:w}=this.props;const x=s(\"Input\"),C=s(\"Row\"),j=s(\"Col\"),L=s(\"Button\"),B=s(\"authError\"),$=s(\"JumpToPath\",!0),V=s(\"Markdown\",!0),U=s(\"InitializedInput\"),{isOAS3:z}=w;let Y=z()?o.get(\"openIdConnectUrl\"):null;const Z=\"implicit\",ee=\"password\",ie=z()?Y?\"authorization_code\":\"authorizationCode\":\"accessCode\",ae=z()?Y?\"client_credentials\":\"clientCredentials\":\"application\";let ce=!!(i.getConfigs()||{}).usePkceWithAuthorizationCodeGrant,le=o.get(\"flow\"),pe=le===ie&&ce?le+\" with PKCE\":le,de=o.get(\"allowedScopes\")||o.get(\"scopes\"),fe=!!i.authorized().get(_),ye=u.allErrors().filter((o=>o.get(\"authId\")===_)),be=!ye.filter((o=>\"validation\"===o.get(\"source\"))).size,_e=o.get(\"description\");return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,_,\" (OAuth2, \",pe,\") \",Pe.createElement($,{path:[\"securityDefinitions\",_]})),this.state.appName?Pe.createElement(\"h5\",null,\"Application: \",this.state.appName,\" \"):null,_e&&Pe.createElement(V,{source:o.get(\"description\")}),fe&&Pe.createElement(\"h6\",null,\"Authorized\"),Y&&Pe.createElement(\"p\",null,\"OpenID Connect URL: \",Pe.createElement(\"code\",null,Y)),(le===Z||le===ie)&&Pe.createElement(\"p\",null,\"Authorization URL: \",Pe.createElement(\"code\",null,o.get(\"authorizationUrl\"))),(le===ee||le===ie||le===ae)&&Pe.createElement(\"p\",null,\"Token URL:\",Pe.createElement(\"code\",null,\" \",o.get(\"tokenUrl\"))),Pe.createElement(\"p\",{className:\"flow\"},\"Flow: \",Pe.createElement(\"code\",null,pe)),le!==ee?null:Pe.createElement(C,null,Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:\"oauth_username\"},\"username:\"),fe?Pe.createElement(\"code\",null,\" \",this.state.username,\" \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(\"input\",{id:\"oauth_username\",type:\"text\",\"data-name\":\"username\",onChange:this.onInputChange,autoFocus:!0}))),Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:\"oauth_password\"},\"password:\"),fe?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(\"input\",{id:\"oauth_password\",type:\"password\",\"data-name\":\"password\",onChange:this.onInputChange}))),Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:\"password_type\"},\"Client credentials location:\"),fe?Pe.createElement(\"code\",null,\" \",this.state.passwordType,\" \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(\"select\",{id:\"password_type\",\"data-name\":\"passwordType\",onChange:this.onInputChange},Pe.createElement(\"option\",{value:\"basic\"},\"Authorization header\"),Pe.createElement(\"option\",{value:\"request-body\"},\"Request body\"))))),(le===ae||le===Z||le===ie||le===ee)&&(!fe||fe&&this.state.clientId)&&Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:`client_id_${le}`},\"client_id:\"),fe?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(U,{id:`client_id_${le}`,type:\"text\",required:le===ee,initialValue:this.state.clientId,\"data-name\":\"clientId\",onChange:this.onInputChange}))),(le===ae||le===ie||le===ee)&&Pe.createElement(C,null,Pe.createElement(\"label\",{htmlFor:`client_secret_${le}`},\"client_secret:\"),fe?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(j,{tablet:10,desktop:10},Pe.createElement(U,{id:`client_secret_${le}`,initialValue:this.state.clientSecret,type:\"password\",\"data-name\":\"clientSecret\",onChange:this.onInputChange}))),!fe&&de&&de.size?Pe.createElement(\"div\",{className:\"scopes\"},Pe.createElement(\"h2\",null,\"Scopes:\",Pe.createElement(\"a\",{onClick:this.selectScopes,\"data-all\":!0},\"select all\"),Pe.createElement(\"a\",{onClick:this.selectScopes},\"select none\")),de.map(((o,s)=>Pe.createElement(C,{key:s},Pe.createElement(\"div\",{className:\"checkbox\"},Pe.createElement(x,{\"data-value\":s,id:`${s}-${le}-checkbox-${this.state.name}`,disabled:fe,checked:this.state.scopes.includes(s),type:\"checkbox\",onChange:this.onScopeChange}),Pe.createElement(\"label\",{htmlFor:`${s}-${le}-checkbox-${this.state.name}`},Pe.createElement(\"span\",{className:\"item\"}),Pe.createElement(\"div\",{className:\"text\"},Pe.createElement(\"p\",{className:\"name\"},s),Pe.createElement(\"p\",{className:\"description\"},o))))))).toArray()):null,ye.valueSeq().map(((o,s)=>Pe.createElement(B,{error:o,key:s}))),Pe.createElement(\"div\",{className:\"auth-btn-wrapper\"},be&&(fe?Pe.createElement(L,{className:\"btn modal-btn auth authorize\",onClick:this.logout,\"aria-label\":\"Remove authorization\"},\"Logout\"):Pe.createElement(L,{className:\"btn modal-btn auth authorize\",onClick:this.authorize,\"aria-label\":\"Apply given OAuth2 credentials\"},\"Authorize\")),Pe.createElement(L,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\")))}}class Clear extends Pe.Component{onClick=()=>{let{specActions:o,path:s,method:i}=this.props;o.clearResponse(s,i),o.clearRequest(s,i)};render(){return Pe.createElement(\"button\",{className:\"btn btn-clear opblock-control__btn\",onClick:this.onClick},\"Clear\")}}const live_response_Headers=({headers:o})=>Pe.createElement(\"div\",null,Pe.createElement(\"h5\",null,\"Response headers\"),Pe.createElement(\"pre\",{className:\"microlight\"},o)),Duration=({duration:o})=>Pe.createElement(\"div\",null,Pe.createElement(\"h5\",null,\"Request duration\"),Pe.createElement(\"pre\",{className:\"microlight\"},o,\" ms\"));class LiveResponse extends Pe.Component{shouldComponentUpdate(o){return this.props.response!==o.response||this.props.path!==o.path||this.props.method!==o.method||this.props.displayRequestDuration!==o.displayRequestDuration}render(){const{response:o,getComponent:s,getConfigs:i,displayRequestDuration:u,specSelectors:_,path:w,method:x}=this.props,{showMutatedRequest:C,requestSnippetsEnabled:j}=i(),L=C?_.mutatedRequestFor(w,x):_.requestFor(w,x),B=o.get(\"status\"),$=L.get(\"url\"),V=o.get(\"headers\").toJS(),U=o.get(\"notDocumented\"),z=o.get(\"error\"),Y=o.get(\"text\"),Z=o.get(\"duration\"),ee=Object.keys(V),ie=V[\"content-type\"]||V[\"Content-Type\"],ae=s(\"responseBody\"),ce=ee.map((o=>{var s=Array.isArray(V[o])?V[o].join():V[o];return Pe.createElement(\"span\",{className:\"headerline\",key:o},\" \",o,\": \",s,\" \")})),le=0!==ce.length,pe=s(\"Markdown\",!0),de=s(\"RequestSnippets\",!0),fe=s(\"curl\",!0);return Pe.createElement(\"div\",null,L&&j?Pe.createElement(de,{request:L}):Pe.createElement(fe,{request:L}),$&&Pe.createElement(\"div\",null,Pe.createElement(\"div\",{className:\"request-url\"},Pe.createElement(\"h4\",null,\"Request URL\"),Pe.createElement(\"pre\",{className:\"microlight\"},$))),Pe.createElement(\"h4\",null,\"Server response\"),Pe.createElement(\"table\",{className:\"responses-table live-responses-table\"},Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",{className:\"responses-header\"},Pe.createElement(\"td\",{className:\"col_header response-col_status\"},\"Code\"),Pe.createElement(\"td\",{className:\"col_header response-col_description\"},\"Details\"))),Pe.createElement(\"tbody\",null,Pe.createElement(\"tr\",{className:\"response\"},Pe.createElement(\"td\",{className:\"response-col_status\"},B,U?Pe.createElement(\"div\",{className:\"response-undocumented\"},Pe.createElement(\"i\",null,\" Undocumented \")):null),Pe.createElement(\"td\",{className:\"response-col_description\"},z?Pe.createElement(pe,{source:`${\"\"!==o.get(\"name\")?`${o.get(\"name\")}: `:\"\"}${o.get(\"message\")}`}):null,Y?Pe.createElement(ae,{content:Y,contentType:ie,url:$,headers:V,getConfigs:i,getComponent:s}):null,le?Pe.createElement(live_response_Headers,{headers:ce}):null,u&&Z?Pe.createElement(Duration,{duration:Z}):null)))))}}class OnlineValidatorBadge extends Pe.Component{constructor(o,s){super(o,s);let{getConfigs:i}=o,{validatorUrl:u}=i();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===u?\"https://validator.swagger.io/validator\":u}}getDefinitionUrl=()=>{let{specSelectors:o}=this.props;return new(Mt())(o.url(),at.location).toString()};UNSAFE_componentWillReceiveProps(o){let{getConfigs:s}=o,{validatorUrl:i}=s();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===i?\"https://validator.swagger.io/validator\":i})}render(){let{getConfigs:o}=this.props,{spec:s}=o(),i=sanitizeUrl(this.state.validatorUrl);return\"object\"==typeof s&&Object.keys(s).length?null:this.state.url&&requiresValidationURL(this.state.validatorUrl)&&requiresValidationURL(this.state.url)?Pe.createElement(\"span\",{className:\"float-right\"},Pe.createElement(\"a\",{target:\"_blank\",rel:\"noopener noreferrer\",href:`${i}/debug?url=${encodeURIComponent(this.state.url)}`},Pe.createElement(ValidatorImage,{src:`${i}?url=${encodeURIComponent(this.state.url)}`,alt:\"Online validator badge\"}))):null}}class ValidatorImage extends Pe.Component{constructor(o){super(o),this.state={loaded:!1,error:!1}}componentDidMount(){const o=new Image;o.onload=()=>{this.setState({loaded:!0})},o.onerror=()=>{this.setState({error:!0})},o.src=this.props.src}UNSAFE_componentWillReceiveProps(o){if(o.src!==this.props.src){const s=new Image;s.onload=()=>{this.setState({loaded:!0})},s.onerror=()=>{this.setState({error:!0})},s.src=o.src}}render(){return this.state.error?Pe.createElement(\"img\",{alt:\"Error\"}):this.state.loaded?Pe.createElement(\"img\",{src:this.props.src,alt:this.props.alt}):null}}class Operations extends Pe.Component{render(){let{specSelectors:o}=this.props;const s=o.taggedOperations();return 0===s.size?Pe.createElement(\"h3\",null,\" No operations defined in spec!\"):Pe.createElement(\"div\",null,s.map(this.renderOperationTag).toArray(),s.size<1?Pe.createElement(\"h3\",null,\" No operations defined in spec! \"):null)}renderOperationTag=(o,s)=>{const{specSelectors:i,getComponent:u,oas3Selectors:_,layoutSelectors:w,layoutActions:x,getConfigs:C}=this.props,j=i.validOperationMethods(),L=u(\"OperationContainer\",!0),B=u(\"OperationTag\"),$=o.get(\"operations\");return Pe.createElement(B,{key:\"operation-\"+s,tagObj:o,tag:s,oas3Selectors:_,layoutSelectors:w,layoutActions:x,getConfigs:C,getComponent:u,specUrl:i.url()},Pe.createElement(\"div\",{className:\"operation-tag-content\"},$.map((o=>{const i=o.get(\"path\"),u=o.get(\"method\"),_=$e().List([\"paths\",i,u]);return-1===j.indexOf(u)?null:Pe.createElement(L,{key:`${i}-${u}`,specPath:_,op:o,path:i,method:u,tag:s})})).toArray()))}}function isAbsoluteUrl(o){return o.match(/^(?:[a-z]+:)?\\/\\//i)}function buildBaseUrl(o,s){return o?isAbsoluteUrl(o)?function addProtocol(o){return o.match(/^\\/\\//i)?`${window.location.protocol}${o}`:o}(o):new URL(o,s).href:s}function safeBuildUrl(o,s,{selectedServer:i=\"\"}={}){try{return function buildUrl(o,s,{selectedServer:i=\"\"}={}){if(!o)return;if(isAbsoluteUrl(o))return o;const u=buildBaseUrl(i,s);return isAbsoluteUrl(u)?new URL(o,u).href:new URL(o,window.location.href).href}(o,s,{selectedServer:i})}catch{return}}class OperationTag extends Pe.Component{static defaultProps={tagObj:$e().fromJS({}),tag:\"\"};render(){const{tagObj:o,tag:s,children:i,oas3Selectors:u,layoutSelectors:_,layoutActions:w,getConfigs:x,getComponent:C,specUrl:j}=this.props;let{docExpansion:L,deepLinking:B}=x();const $=C(\"Collapse\"),V=C(\"Markdown\",!0),U=C(\"DeepLink\"),z=C(\"Link\"),Y=C(\"ArrowUpIcon\"),Z=C(\"ArrowDownIcon\");let ee,ie=o.getIn([\"tagDetails\",\"description\"],null),ae=o.getIn([\"tagDetails\",\"externalDocs\",\"description\"]),ce=o.getIn([\"tagDetails\",\"externalDocs\",\"url\"]);ee=isFunc(u)&&isFunc(u.selectedServer)?safeBuildUrl(ce,j,{selectedServer:u.selectedServer()}):ce;let le=[\"operations-tag\",s],pe=_.isShown(le,\"full\"===L||\"list\"===L);return Pe.createElement(\"div\",{className:pe?\"opblock-tag-section is-open\":\"opblock-tag-section\"},Pe.createElement(\"h3\",{onClick:()=>w.show(le,!pe),className:ie?\"opblock-tag\":\"opblock-tag no-desc\",id:le.map((o=>escapeDeepLinkPath(o))).join(\"-\"),\"data-tag\":s,\"data-is-open\":pe},Pe.createElement(U,{enabled:B,isShown:pe,path:createDeepLinkPath(s),text:s}),ie?Pe.createElement(\"small\",null,Pe.createElement(V,{source:ie})):Pe.createElement(\"small\",null),ee?Pe.createElement(\"div\",{className:\"info__externaldocs\"},Pe.createElement(\"small\",null,Pe.createElement(z,{href:sanitizeUrl(ee),onClick:o=>o.stopPropagation(),target:\"_blank\"},ae||ee))):null,Pe.createElement(\"button\",{\"aria-expanded\":pe,className:\"expand-operation\",title:pe?\"Collapse operation\":\"Expand operation\",onClick:()=>w.show(le,!pe)},pe?Pe.createElement(Y,{className:\"arrow\"}):Pe.createElement(Z,{className:\"arrow\"}))),Pe.createElement($,{isOpened:pe},i))}}class operation_Operation extends Pe.PureComponent{static defaultProps={operation:null,response:null,request:null,specPath:(0,qe.List)(),summary:\"\"};render(){let{specPath:o,response:s,request:i,toggleShown:u,onTryoutClick:_,onResetClick:w,onCancelClick:x,onExecute:C,fn:j,getComponent:L,getConfigs:B,specActions:$,specSelectors:V,authActions:U,authSelectors:z,oas3Actions:Y,oas3Selectors:Z}=this.props,ee=this.props.operation,{deprecated:ie,isShown:ae,path:ce,method:le,op:pe,tag:de,operationId:fe,allowTryItOut:ye,displayRequestDuration:be,tryItOutEnabled:_e,executeInProgress:we}=ee.toJS(),{description:Se,externalDocs:xe,schemes:Te}=pe;const Re=xe?safeBuildUrl(xe.url,V.url(),{selectedServer:Z.selectedServer()}):\"\";let qe=ee.getIn([\"op\"]),ze=qe.get(\"responses\"),We=function getList(o,s){if(!$e().Iterable.isIterable(o))return $e().List();let i=o.getIn(Array.isArray(s)?s:[s]);return $e().List.isList(i)?i:$e().List()}(qe,[\"parameters\"]),He=V.operationScheme(ce,le),Ye=[\"operations\",de,fe],Xe=getExtensions(qe);const Qe=L(\"responses\"),et=L(\"parameters\"),tt=L(\"execute\"),rt=L(\"clear\"),nt=L(\"Collapse\"),ot=L(\"Markdown\",!0),st=L(\"schemes\"),it=L(\"OperationServers\"),at=L(\"OperationExt\"),ct=L(\"OperationSummary\"),lt=L(\"Link\"),{showExtensions:ut}=B();if(ze&&s&&s.size>0){let o=!ze.get(String(s.get(\"status\")))&&!ze.get(\"default\");s=s.set(\"notDocumented\",o)}let pt=[ce,le];const ht=V.validationErrors([ce,le]);return Pe.createElement(\"div\",{className:ie?\"opblock opblock-deprecated\":ae?`opblock opblock-${le} is-open`:`opblock opblock-${le}`,id:escapeDeepLinkPath(Ye.join(\"-\"))},Pe.createElement(ct,{operationProps:ee,isShown:ae,toggleShown:u,getComponent:L,authActions:U,authSelectors:z,specPath:o}),Pe.createElement(nt,{isOpened:ae},Pe.createElement(\"div\",{className:\"opblock-body\"},qe&&qe.size||null===qe?null:Pe.createElement(rolling_load,{height:\"32px\",width:\"32px\",className:\"opblock-loading-animation\"}),ie&&Pe.createElement(\"h4\",{className:\"opblock-title_normal\"},\" Warning: Deprecated\"),Se&&Pe.createElement(\"div\",{className:\"opblock-description-wrapper\"},Pe.createElement(\"div\",{className:\"opblock-description\"},Pe.createElement(ot,{source:Se}))),Re?Pe.createElement(\"div\",{className:\"opblock-external-docs-wrapper\"},Pe.createElement(\"h4\",{className:\"opblock-title_normal\"},\"Find more details\"),Pe.createElement(\"div\",{className:\"opblock-external-docs\"},xe.description&&Pe.createElement(\"span\",{className:\"opblock-external-docs__description\"},Pe.createElement(ot,{source:xe.description})),Pe.createElement(lt,{target:\"_blank\",className:\"opblock-external-docs__link\",href:sanitizeUrl(Re)},Re))):null,qe&&qe.size?Pe.createElement(et,{parameters:We,specPath:o.push(\"parameters\"),operation:qe,onChangeKey:pt,onTryoutClick:_,onResetClick:w,onCancelClick:x,tryItOutEnabled:_e,allowTryItOut:ye,fn:j,getComponent:L,specActions:$,specSelectors:V,pathMethod:[ce,le],getConfigs:B,oas3Actions:Y,oas3Selectors:Z}):null,_e?Pe.createElement(it,{getComponent:L,path:ce,method:le,operationServers:qe.get(\"servers\"),pathServers:V.paths().getIn([ce,\"servers\"]),getSelectedServer:Z.selectedServer,setSelectedServer:Y.setSelectedServer,setServerVariableValue:Y.setServerVariableValue,getServerVariable:Z.serverVariableValue,getEffectiveServerValue:Z.serverEffectiveValue}):null,_e&&ye&&Te&&Te.size?Pe.createElement(\"div\",{className:\"opblock-schemes\"},Pe.createElement(st,{schemes:Te,path:ce,method:le,specActions:$,currentScheme:He})):null,!_e||!ye||ht.length<=0?null:Pe.createElement(\"div\",{className:\"validation-errors errors-wrapper\"},\"Please correct the following validation errors and try again.\",Pe.createElement(\"ul\",null,ht.map(((o,s)=>Pe.createElement(\"li\",{key:s},\" \",o,\" \"))))),Pe.createElement(\"div\",{className:_e&&s&&ye?\"btn-group\":\"execute-wrapper\"},_e&&ye?Pe.createElement(tt,{operation:qe,specActions:$,specSelectors:V,oas3Selectors:Z,oas3Actions:Y,path:ce,method:le,onExecute:C,disabled:we}):null,_e&&s&&ye?Pe.createElement(rt,{specActions:$,path:ce,method:le}):null),we?Pe.createElement(\"div\",{className:\"loading-container\"},Pe.createElement(\"div\",{className:\"loading\"})):null,ze?Pe.createElement(Qe,{responses:ze,request:i,tryItOutResponse:s,getComponent:L,getConfigs:B,specSelectors:V,oas3Actions:Y,oas3Selectors:Z,specActions:$,produces:V.producesOptionsFor([ce,le]),producesValue:V.currentProducesFor([ce,le]),specPath:o.push(\"responses\"),path:ce,method:le,displayRequestDuration:be,fn:j}):null,ut&&Xe.size?Pe.createElement(at,{extensions:Xe,getComponent:L}):null)))}}class OperationContainer extends Pe.PureComponent{constructor(o,s){super(o,s);const{tryItOutEnabled:i}=o.getConfigs();this.state={tryItOutEnabled:i,executeInProgress:!1}}static defaultProps={showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1};mapStateToProps(o,s){const{op:i,layoutSelectors:u,getConfigs:_}=s,{docExpansion:w,deepLinking:x,displayOperationId:C,displayRequestDuration:j,supportedSubmitMethods:L}=_(),B=u.showSummary(),$=i.getIn([\"operation\",\"__originalOperationId\"])||i.getIn([\"operation\",\"operationId\"])||opId(i.get(\"operation\"),s.path,s.method)||i.get(\"id\"),V=[\"operations\",s.tag,$],U=L.indexOf(s.method)>=0&&(void 0===s.allowTryItOut?s.specSelectors.allowTryItOutFor(s.path,s.method):s.allowTryItOut),z=i.getIn([\"operation\",\"security\"])||s.specSelectors.security();return{operationId:$,isDeepLinkingEnabled:x,showSummary:B,displayOperationId:C,displayRequestDuration:j,allowTryItOut:U,security:z,isAuthorized:s.authSelectors.isAuthorized(z),isShown:u.isShown(V,\"full\"===w),jumpToKey:`paths.${s.path}.${s.method}`,response:s.specSelectors.responseFor(s.path,s.method),request:s.specSelectors.requestFor(s.path,s.method)}}componentDidMount(){const{isShown:o}=this.props,s=this.getResolvedSubtree();o&&void 0===s&&this.requestResolvedSubtree()}UNSAFE_componentWillReceiveProps(o){const{response:s,isShown:i}=o,u=this.getResolvedSubtree();s!==this.props.response&&this.setState({executeInProgress:!1}),i&&void 0===u&&this.requestResolvedSubtree()}toggleShown=()=>{let{layoutActions:o,tag:s,operationId:i,isShown:u}=this.props;const _=this.getResolvedSubtree();u||void 0!==_||this.requestResolvedSubtree(),o.show([\"operations\",s,i],!u)};onCancelClick=()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})};onTryoutClick=()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})};onResetClick=o=>{const s=this.props.oas3Selectors.selectDefaultRequestBodyValue(...o);this.props.oas3Actions.setRequestBodyValue({value:s,pathMethod:o})};onExecute=()=>{this.setState({executeInProgress:!0})};getResolvedSubtree=()=>{const{specSelectors:o,path:s,method:i,specPath:u}=this.props;return u?o.specResolvedSubtree(u.toJS()):o.specResolvedSubtree([\"paths\",s,i])};requestResolvedSubtree=()=>{const{specActions:o,path:s,method:i,specPath:u}=this.props;return u?o.requestResolvedSubtree(u.toJS()):o.requestResolvedSubtree([\"paths\",s,i])};render(){let{op:o,tag:s,path:i,method:u,security:_,isAuthorized:w,operationId:x,showSummary:C,isShown:j,jumpToKey:L,allowTryItOut:B,response:$,request:V,displayOperationId:U,displayRequestDuration:z,isDeepLinkingEnabled:Y,specPath:Z,specSelectors:ee,specActions:ie,getComponent:ae,getConfigs:ce,layoutSelectors:le,layoutActions:pe,authActions:de,authSelectors:fe,oas3Actions:ye,oas3Selectors:be,fn:_e}=this.props;const we=ae(\"operation\"),Se=this.getResolvedSubtree()||(0,qe.Map)(),xe=(0,qe.fromJS)({op:Se,tag:s,path:i,summary:o.getIn([\"operation\",\"summary\"])||\"\",deprecated:Se.get(\"deprecated\")||o.getIn([\"operation\",\"deprecated\"])||!1,method:u,security:_,isAuthorized:w,operationId:x,originalOperationId:Se.getIn([\"operation\",\"__originalOperationId\"]),showSummary:C,isShown:j,jumpToKey:L,allowTryItOut:B,request:V,displayOperationId:U,displayRequestDuration:z,isDeepLinkingEnabled:Y,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return Pe.createElement(we,{operation:xe,response:$,request:V,isShown:j,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onResetClick:this.onResetClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:Z,specActions:ie,specSelectors:ee,oas3Actions:ye,oas3Selectors:be,layoutActions:pe,layoutSelectors:le,authActions:de,authSelectors:fe,getComponent:ae,getConfigs:ce,fn:_e})}}var SO=__webpack_require__(13222),xO=__webpack_require__.n(SO);class OperationSummary extends Pe.PureComponent{static defaultProps={operationProps:null,specPath:(0,qe.List)(),summary:\"\"};render(){let{isShown:o,toggleShown:s,getComponent:i,authActions:u,authSelectors:_,operationProps:w,specPath:x}=this.props,{summary:C,isAuthorized:j,method:L,op:B,showSummary:$,path:V,operationId:U,originalOperationId:z,displayOperationId:Y}=w.toJS(),{summary:Z}=B,ee=w.get(\"security\");const ie=i(\"authorizeOperationBtn\",!0),ae=i(\"OperationSummaryMethod\"),ce=i(\"OperationSummaryPath\"),le=i(\"JumpToPath\",!0),pe=i(\"CopyToClipboardBtn\",!0),de=i(\"ArrowUpIcon\"),fe=i(\"ArrowDownIcon\"),ye=ee&&!!ee.count(),be=ye&&1===ee.size&&ee.first().isEmpty(),_e=!ye||be;return Pe.createElement(\"div\",{className:`opblock-summary opblock-summary-${L}`},Pe.createElement(\"button\",{\"aria-expanded\":o,className:\"opblock-summary-control\",onClick:s},Pe.createElement(ae,{method:L}),Pe.createElement(\"div\",{className:\"opblock-summary-path-description-wrapper\"},Pe.createElement(ce,{getComponent:i,operationProps:w,specPath:x}),$?Pe.createElement(\"div\",{className:\"opblock-summary-description\"},xO()(Z||C)):null),Y&&(z||U)?Pe.createElement(\"span\",{className:\"opblock-summary-operation-id\"},z||U):null),Pe.createElement(pe,{textToCopy:`${x.get(1)}`}),_e?null:Pe.createElement(ie,{isAuthorized:j,onClick:()=>{const o=_.definitionsForRequirements(ee);u.showDefinitions(o)}}),Pe.createElement(le,{path:x}),Pe.createElement(\"button\",{\"aria-label\":`${L} ${V.replace(/\\//g,\"​/\")}`,className:\"opblock-control-arrow\",\"aria-expanded\":o,tabIndex:\"-1\",onClick:s},o?Pe.createElement(de,{className:\"arrow\"}):Pe.createElement(fe,{className:\"arrow\"})))}}class OperationSummaryMethod extends Pe.PureComponent{static defaultProps={operationProps:null};render(){let{method:o}=this.props;return Pe.createElement(\"span\",{className:\"opblock-summary-method\"},o.toUpperCase())}}class OperationSummaryPath extends Pe.PureComponent{render(){let{getComponent:o,operationProps:s}=this.props,{deprecated:i,isShown:u,path:_,tag:w,operationId:x,isDeepLinkingEnabled:C}=s.toJS();const j=_.split(/(?=\\/)/g);for(let o=1;o<j.length;o+=2)j.splice(o,0,Pe.createElement(\"wbr\",{key:o}));const L=o(\"DeepLink\");return Pe.createElement(\"span\",{className:i?\"opblock-summary-path__deprecated\":\"opblock-summary-path\",\"data-path\":_},Pe.createElement(L,{enabled:C,isShown:u,path:createDeepLinkPath(`${w}/${x}`),text:j}))}}const operation_extensions=({extensions:o,getComponent:s})=>{let i=s(\"OperationExtRow\");return Pe.createElement(\"div\",{className:\"opblock-section\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},Pe.createElement(\"h4\",null,\"Extensions\")),Pe.createElement(\"div\",{className:\"table-container\"},Pe.createElement(\"table\",null,Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",null,Pe.createElement(\"td\",{className:\"col_header\"},\"Field\"),Pe.createElement(\"td\",{className:\"col_header\"},\"Value\"))),Pe.createElement(\"tbody\",null,o.entrySeq().map((([o,s])=>Pe.createElement(i,{key:`${o}-${s}`,xKey:o,xVal:s})))))))},operation_extension_row=({xKey:o,xVal:s})=>{const i=s?s.toJS?s.toJS():s:null;return Pe.createElement(\"tr\",null,Pe.createElement(\"td\",null,o),Pe.createElement(\"td\",null,JSON.stringify(i)))};function createHtmlReadyId(o,s=\"_\"){return o.replace(/[^\\w-]/g,s)}class responses_Responses extends Pe.Component{static defaultProps={tryItOutResponse:null,produces:(0,qe.fromJS)([\"application/json\"]),displayRequestDuration:!1};onChangeProducesWrapper=o=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],o);onResponseContentTypeChange=({controlsAcceptHeader:o,value:s})=>{const{oas3Actions:i,path:u,method:_}=this.props;o&&i.setResponseContentType({value:s,path:u,method:_})};render(){let{responses:o,tryItOutResponse:s,getComponent:i,getConfigs:u,specSelectors:_,fn:w,producesValue:x,displayRequestDuration:C,specPath:j,path:L,method:B,oas3Selectors:$,oas3Actions:V}=this.props,U=function defaultStatusCode(o){let s=o.keySeq();return s.contains(At)?At:s.filter((o=>\"2\"===(o+\"\")[0])).sort().first()}(o);const z=i(\"contentType\"),Y=i(\"liveResponse\"),Z=i(\"response\");let ee=this.props.produces&&this.props.produces.size?this.props.produces:responses_Responses.defaultProps.produces;const ie=_.isOAS3()?function getAcceptControllingResponse(o){if(!$e().OrderedMap.isOrderedMap(o))return null;if(!o.size)return null;const s=o.find(((o,s)=>s.startsWith(\"2\")&&Object.keys(o.get(\"content\")||{}).length>0)),i=o.get(\"default\")||$e().OrderedMap(),u=(i.get(\"content\")||$e().OrderedMap()).keySeq().toJS().length?i:null;return s||u}(o):null,ae=createHtmlReadyId(`${B}${L}_responses`),ce=`${ae}_select`;return Pe.createElement(\"div\",{className:\"responses-wrapper\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},Pe.createElement(\"h4\",null,\"Responses\"),_.isOAS3()?null:Pe.createElement(\"label\",{htmlFor:ce},Pe.createElement(\"span\",null,\"Response content type\"),Pe.createElement(z,{value:x,ariaControls:ae,ariaLabel:\"Response content type\",className:\"execute-content-type\",contentTypes:ee,controlId:ce,onChange:this.onChangeProducesWrapper}))),Pe.createElement(\"div\",{className:\"responses-inner\"},s?Pe.createElement(\"div\",null,Pe.createElement(Y,{response:s,getComponent:i,getConfigs:u,specSelectors:_,path:this.props.path,method:this.props.method,displayRequestDuration:C}),Pe.createElement(\"h4\",null,\"Responses\")):null,Pe.createElement(\"table\",{\"aria-live\":\"polite\",className:\"responses-table\",id:ae,role:\"region\"},Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",{className:\"responses-header\"},Pe.createElement(\"td\",{className:\"col_header response-col_status\"},\"Code\"),Pe.createElement(\"td\",{className:\"col_header response-col_description\"},\"Description\"),_.isOAS3()?Pe.createElement(\"td\",{className:\"col col_header response-col_links\"},\"Links\"):null)),Pe.createElement(\"tbody\",null,o.entrySeq().map((([o,C])=>{let z=s&&s.get(\"status\")==o?\"response_current\":\"\";return Pe.createElement(Z,{key:o,path:L,method:B,specPath:j.push(o),isDefault:U===o,fn:w,className:z,code:o,response:C,specSelectors:_,controlsAcceptHeader:C===ie,onContentTypeChange:this.onResponseContentTypeChange,contentType:x,getConfigs:u,activeExamplesKey:$.activeExamplesMember(L,B,\"responses\",o),oas3Actions:V,getComponent:i})})).toArray()))))}}function getKnownSyntaxHighlighterLanguage(o){const s=function canJsonParse(o){try{return!!JSON.parse(o)}catch(o){return null}}(o);return s?\"json\":null}class response_Response extends Pe.Component{constructor(o,s){super(o,s),this.state={responseContentType:\"\"}}static defaultProps={response:(0,qe.fromJS)({}),onContentTypeChange:()=>{}};_onContentTypeChange=o=>{const{onContentTypeChange:s,controlsAcceptHeader:i}=this.props;this.setState({responseContentType:o}),s({value:o,controlsAcceptHeader:i})};getTargetExamplesKey=()=>{const{response:o,contentType:s,activeExamplesKey:i}=this.props,u=this.state.responseContentType||s,_=o.getIn([\"content\",u],(0,qe.Map)({})).get(\"examples\",null).keySeq().first();return i||_};render(){let{path:o,method:s,code:i,response:u,className:_,specPath:w,fn:x,getComponent:C,getConfigs:j,specSelectors:L,contentType:B,controlsAcceptHeader:$,oas3Actions:V}=this.props,{inferSchema:U,getSampleSchema:z}=x,Y=L.isOAS3();const{showExtensions:Z}=j();let ee=Z?getExtensions(u):null,ie=u.get(\"headers\"),ae=u.get(\"links\");const ce=C(\"ResponseExtension\"),le=C(\"headers\"),pe=C(\"HighlightCode\",!0),de=C(\"modelExample\"),fe=C(\"Markdown\",!0),ye=C(\"operationLink\"),be=C(\"contentType\"),_e=C(\"ExamplesSelect\"),we=C(\"Example\");var Se,xe;const Te=this.state.responseContentType||B,Re=u.getIn([\"content\",Te],(0,qe.Map)({})),$e=Re.get(\"examples\",null);if(Y){const o=Re.get(\"schema\");Se=o?U(o.toJS()):null,xe=o?(0,qe.List)([\"content\",this.state.responseContentType,\"schema\"]):w}else Se=u.get(\"schema\"),xe=u.has(\"schema\")?w.push(\"schema\"):w;let ze,We,He=!1,Ye={includeReadOnly:!0};if(Y)if(We=Re.get(\"schema\")?.toJS(),qe.Map.isMap($e)&&!$e.isEmpty()){const o=this.getTargetExamplesKey(),getMediaTypeExample=o=>o.get(\"value\");ze=getMediaTypeExample($e.get(o,(0,qe.Map)({}))),void 0===ze&&(ze=getMediaTypeExample($e.values().next().value)),He=!0}else void 0!==Re.get(\"example\")&&(ze=Re.get(\"example\"),He=!0);else{We=Se,Ye={...Ye,includeWriteOnly:!0};const o=u.getIn([\"examples\",Te]);o&&(ze=o,He=!0)}const Xe=((o,s)=>{if(null==o)return null;const i=getKnownSyntaxHighlighterLanguage(o)?\"json\":null;return Pe.createElement(\"div\",null,Pe.createElement(s,{className:\"example\",language:i},stringify(o)))})(z(We,Te,Ye,He?ze:void 0),pe);return Pe.createElement(\"tr\",{className:\"response \"+(_||\"\"),\"data-code\":i},Pe.createElement(\"td\",{className:\"response-col_status\"},i),Pe.createElement(\"td\",{className:\"response-col_description\"},Pe.createElement(\"div\",{className:\"response-col_description__inner\"},Pe.createElement(fe,{source:u.get(\"description\")})),Z&&ee.size?ee.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,xKey:o,xVal:s}))):null,Y&&u.get(\"content\")?Pe.createElement(\"section\",{className:\"response-controls\"},Pe.createElement(\"div\",{className:To()(\"response-control-media-type\",{\"response-control-media-type--accept-controller\":$})},Pe.createElement(\"small\",{className:\"response-control-media-type__title\"},\"Media type\"),Pe.createElement(be,{value:this.state.responseContentType,contentTypes:u.get(\"content\")?u.get(\"content\").keySeq():(0,qe.Seq)(),onChange:this._onContentTypeChange,ariaLabel:\"Media Type\"}),$?Pe.createElement(\"small\",{className:\"response-control-media-type__accept-message\"},\"Controls \",Pe.createElement(\"code\",null,\"Accept\"),\" header.\"):null),qe.Map.isMap($e)&&!$e.isEmpty()?Pe.createElement(\"div\",{className:\"response-control-examples\"},Pe.createElement(\"small\",{className:\"response-control-examples__title\"},\"Examples\"),Pe.createElement(_e,{examples:$e,currentExampleKey:this.getTargetExamplesKey(),onSelect:u=>V.setActiveExamplesMember({name:u,pathMethod:[o,s],contextType:\"responses\",contextName:i}),showLabels:!1})):null):null,Xe||Se?Pe.createElement(de,{specPath:xe,getComponent:C,getConfigs:j,specSelectors:L,schema:fromJSOrdered(Se),example:Xe,includeReadOnly:!0}):null,Y&&$e?Pe.createElement(we,{example:$e.get(this.getTargetExamplesKey(),(0,qe.Map)({})),getComponent:C,getConfigs:j,omitValue:!0}):null,ie?Pe.createElement(le,{headers:ie,getComponent:C}):null),Y?Pe.createElement(\"td\",{className:\"response-col_links\"},ae?ae.toSeq().entrySeq().map((([o,s])=>Pe.createElement(ye,{key:o,name:o,link:s,getComponent:C}))):Pe.createElement(\"i\",null,\"No links\")):null)}}const response_extension=({xKey:o,xVal:s})=>Pe.createElement(\"div\",{className:\"response__extension\"},o,\": \",String(s));var kO=__webpack_require__(26657),OO=__webpack_require__.n(kO),CO=__webpack_require__(80218),AO=__webpack_require__.n(CO);class ResponseBody extends Pe.PureComponent{state={parsedContent:null};updateParsedContent=o=>{const{content:s}=this.props;if(o!==s)if(s&&s instanceof Blob){var i=new FileReader;i.onload=()=>{this.setState({parsedContent:i.result})},i.readAsText(s)}else this.setState({parsedContent:s.toString()})};componentDidMount(){this.updateParsedContent(null)}componentDidUpdate(o){this.updateParsedContent(o.content)}render(){let{content:o,contentType:s,url:i,headers:u={},getComponent:_}=this.props;const{parsedContent:w}=this.state,x=_(\"HighlightCode\",!0),C=\"response_\"+(new Date).getTime();let j,L;if(i=i||\"\",(/^application\\/octet-stream/i.test(s)||u[\"Content-Disposition\"]&&/attachment/i.test(u[\"Content-Disposition\"])||u[\"content-disposition\"]&&/attachment/i.test(u[\"content-disposition\"])||u[\"Content-Description\"]&&/File Transfer/i.test(u[\"Content-Description\"])||u[\"content-description\"]&&/File Transfer/i.test(u[\"content-description\"]))&&(o.size>0||o.length>0))if(\"Blob\"in window){let _=s||\"text/html\",w=o instanceof Blob?o:new Blob([o],{type:_}),x=window.URL.createObjectURL(w),C=[_,i.substr(i.lastIndexOf(\"/\")+1),x].join(\":\"),j=u[\"content-disposition\"]||u[\"Content-Disposition\"];if(void 0!==j){let o=function extractFileNameFromContentDispositionHeader(o){let s;if([/filename\\*=[^']+'\\w*'\"([^\"]+)\";?/i,/filename\\*=[^']+'\\w*'([^;]+);?/i,/filename=\"([^;]*);?\"/i,/filename=([^;]*);?/i].some((i=>(s=i.exec(o),null!==s))),null!==s&&s.length>1)try{return decodeURIComponent(s[1])}catch(o){console.error(o)}return null}(j);null!==o&&(C=o)}L=at.navigator&&at.navigator.msSaveOrOpenBlob?Pe.createElement(\"div\",null,Pe.createElement(\"a\",{href:x,onClick:()=>at.navigator.msSaveOrOpenBlob(w,C)},\"Download file\")):Pe.createElement(\"div\",null,Pe.createElement(\"a\",{href:x,download:C},\"Download file\"))}else L=Pe.createElement(\"pre\",{className:\"microlight\"},\"Download headers detected but your browser does not support downloading binary via XHR (Blob).\");else if(/json/i.test(s)){let s=null;getKnownSyntaxHighlighterLanguage(o)&&(s=\"json\");try{j=JSON.stringify(JSON.parse(o),null,\"  \")}catch(s){j=\"can't parse JSON.  Raw result:\\n\\n\"+o}L=Pe.createElement(x,{language:s,downloadable:!0,fileName:`${C}.json`,canCopy:!0},j)}else/xml/i.test(s)?(j=OO()(o,{textNodesOnSameLine:!0,indentor:\"  \"}),L=Pe.createElement(x,{downloadable:!0,fileName:`${C}.xml`,canCopy:!0},j)):L=\"text/html\"===AO()(s)||/text\\/plain/.test(s)?Pe.createElement(x,{downloadable:!0,fileName:`${C}.html`,canCopy:!0},o):\"text/csv\"===AO()(s)||/text\\/csv/.test(s)?Pe.createElement(x,{downloadable:!0,fileName:`${C}.csv`,canCopy:!0},o):/^image\\//i.test(s)?s.includes(\"svg\")?Pe.createElement(\"div\",null,\" \",o,\" \"):Pe.createElement(\"img\",{src:window.URL.createObjectURL(o)}):/^audio\\//i.test(s)?Pe.createElement(\"pre\",{className:\"microlight\"},Pe.createElement(\"audio\",{controls:!0,key:i},Pe.createElement(\"source\",{src:i,type:s}))):\"string\"==typeof o?Pe.createElement(x,{downloadable:!0,fileName:`${C}.txt`,canCopy:!0},o):o.size>0?w?Pe.createElement(\"div\",null,Pe.createElement(\"p\",{className:\"i\"},\"Unrecognized response type; displaying content as text.\"),Pe.createElement(x,{downloadable:!0,fileName:`${C}.txt`,canCopy:!0},w)):Pe.createElement(\"p\",{className:\"i\"},\"Unrecognized response type; unable to display.\"):null;return L?Pe.createElement(\"div\",null,Pe.createElement(\"h5\",null,\"Response body\"),L):null}}class Parameters extends Pe.Component{constructor(o){super(o),this.state={callbackVisible:!1,parametersVisible:!0}}static defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]};onChange=(o,s,i)=>{let{specActions:{changeParamByIdentity:u},onChangeKey:_}=this.props;u(_,o,s,i)};onChangeConsumesWrapper=o=>{let{specActions:{changeConsumesValue:s},onChangeKey:i}=this.props;s(i,o)};toggleTab=o=>\"parameters\"===o?this.setState({parametersVisible:!0,callbackVisible:!1}):\"callbacks\"===o?this.setState({callbackVisible:!0,parametersVisible:!1}):void 0;onChangeMediaType=({value:o,pathMethod:s})=>{let{specActions:i,oas3Selectors:u,oas3Actions:_}=this.props;const w=u.hasUserEditedBody(...s),x=u.shouldRetainRequestBodyValue(...s);_.setRequestContentType({value:o,pathMethod:s}),_.initRequestBodyValidateError({pathMethod:s}),w||(x||_.setRequestBodyValue({value:void 0,pathMethod:s}),i.clearResponse(...s),i.clearRequest(...s),i.clearValidateParams(s))};render(){let{onTryoutClick:o,onResetClick:s,parameters:i,allowTryItOut:u,tryItOutEnabled:_,specPath:w,fn:x,getComponent:C,getConfigs:j,specSelectors:L,specActions:B,pathMethod:$,oas3Actions:V,oas3Selectors:U,operation:z}=this.props;const Y=C(\"parameterRow\"),Z=C(\"TryItOutButton\"),ee=C(\"contentType\"),ie=C(\"Callbacks\",!0),ae=C(\"RequestBody\",!0),ce=_&&u,le=L.isOAS3(),pe=`${createHtmlReadyId(`${$[1]}${$[0]}_requests`)}_select`,de=z.get(\"requestBody\"),fe=Object.values(i.reduce(((o,s)=>{const i=s.get(\"in\");return o[i]??=[],o[i].push(s),o}),{})).reduce(((o,s)=>o.concat(s)),[]);return Pe.createElement(\"div\",{className:\"opblock-section\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},le?Pe.createElement(\"div\",{className:\"tab-header\"},Pe.createElement(\"div\",{onClick:()=>this.toggleTab(\"parameters\"),className:`tab-item ${this.state.parametersVisible&&\"active\"}`},Pe.createElement(\"h4\",{className:\"opblock-title\"},Pe.createElement(\"span\",null,\"Parameters\"))),z.get(\"callbacks\")?Pe.createElement(\"div\",{onClick:()=>this.toggleTab(\"callbacks\"),className:`tab-item ${this.state.callbackVisible&&\"active\"}`},Pe.createElement(\"h4\",{className:\"opblock-title\"},Pe.createElement(\"span\",null,\"Callbacks\"))):null):Pe.createElement(\"div\",{className:\"tab-header\"},Pe.createElement(\"h4\",{className:\"opblock-title\"},\"Parameters\")),u?Pe.createElement(Z,{isOAS3:L.isOAS3(),hasUserEditedBody:U.hasUserEditedBody(...$),enabled:_,onCancelClick:this.props.onCancelClick,onTryoutClick:o,onResetClick:()=>s($)}):null),this.state.parametersVisible?Pe.createElement(\"div\",{className:\"parameters-container\"},fe.length?Pe.createElement(\"div\",{className:\"table-container\"},Pe.createElement(\"table\",{className:\"parameters\"},Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",null,Pe.createElement(\"th\",{className:\"col_header parameters-col_name\"},\"Name\"),Pe.createElement(\"th\",{className:\"col_header parameters-col_description\"},\"Description\"))),Pe.createElement(\"tbody\",null,fe.map(((o,s)=>Pe.createElement(Y,{fn:x,specPath:w.push(s.toString()),getComponent:C,getConfigs:j,rawParam:o,param:L.parameterWithMetaByIdentity($,o),key:`${o.get(\"in\")}.${o.get(\"name\")}`,onChange:this.onChange,onChangeConsumes:this.onChangeConsumesWrapper,specSelectors:L,specActions:B,oas3Actions:V,oas3Selectors:U,pathMethod:$,isExecute:ce})))))):Pe.createElement(\"div\",{className:\"opblock-description-wrapper\"},Pe.createElement(\"p\",null,\"No parameters\"))):null,this.state.callbackVisible?Pe.createElement(\"div\",{className:\"callbacks-container opblock-description-wrapper\"},Pe.createElement(ie,{callbacks:(0,qe.Map)(z.get(\"callbacks\")),specPath:w.slice(0,-1).push(\"callbacks\")})):null,le&&de&&this.state.parametersVisible&&Pe.createElement(\"div\",{className:\"opblock-section opblock-section-request-body\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},Pe.createElement(\"h4\",{className:`opblock-title parameter__name ${de.get(\"required\")&&\"required\"}`},\"Request body\"),Pe.createElement(\"label\",{id:pe},Pe.createElement(ee,{value:U.requestContentType(...$),contentTypes:de.get(\"content\",(0,qe.List)()).keySeq(),onChange:o=>{this.onChangeMediaType({value:o,pathMethod:$})},className:\"body-param-content-type\",ariaLabel:\"Request content type\",controlId:pe}))),Pe.createElement(\"div\",{className:\"opblock-description-wrapper\"},Pe.createElement(ae,{setRetainRequestBodyValueFlag:o=>V.setRetainRequestBodyValueFlag({value:o,pathMethod:$}),userHasEditedBody:U.hasUserEditedBody(...$),specPath:w.slice(0,-1).push(\"requestBody\"),requestBody:de,requestBodyValue:U.requestBodyValue(...$),requestBodyInclusionSetting:U.requestBodyInclusionSetting(...$),requestBodyErrors:U.requestBodyErrors(...$),isExecute:ce,getConfigs:j,activeExamplesKey:U.activeExamplesMember(...$,\"requestBody\",\"requestBody\"),updateActiveExamplesKey:o=>{this.props.oas3Actions.setActiveExamplesMember({name:o,pathMethod:this.props.pathMethod,contextType:\"requestBody\",contextName:\"requestBody\"})},onChange:(o,s)=>{if(s){const i=U.requestBodyValue(...$),u=qe.Map.isMap(i)?i:(0,qe.Map)();return V.setRequestBodyValue({pathMethod:$,value:u.setIn(s,o)})}V.setRequestBodyValue({value:o,pathMethod:$})},onChangeIncludeEmpty:(o,s)=>{V.setRequestBodyInclusion({pathMethod:$,value:s,name:o})},contentType:U.requestContentType(...$)}))))}}const parameter_extension=({xKey:o,xVal:s})=>Pe.createElement(\"div\",{className:\"parameter__extension\"},o,\": \",String(s)),jO={onChange:()=>{},isIncludedOptions:{}};class ParameterIncludeEmpty extends Pe.Component{static defaultProps=jO;componentDidMount(){const{isIncludedOptions:o,onChange:s}=this.props,{shouldDispatchInit:i,defaultValue:u}=o;i&&s(u)}onCheckboxChange=o=>{const{onChange:s}=this.props;s(o.target.checked)};render(){let{isIncluded:o,isDisabled:s}=this.props;return Pe.createElement(\"div\",null,Pe.createElement(\"label\",{htmlFor:\"include_empty_value\",className:To()(\"parameter__empty_value_toggle\",{disabled:s})},Pe.createElement(\"input\",{id:\"include_empty_value\",type:\"checkbox\",disabled:s,checked:!s&&o,onChange:this.onCheckboxChange}),\"Send empty value\"))}}class ParameterRow extends Pe.Component{constructor(o,s){super(o,s),this.setDefaultValue()}UNSAFE_componentWillReceiveProps(o){let s,{specSelectors:i,pathMethod:u,rawParam:_}=o,w=i.isOAS3(),x=i.parameterWithMetaByIdentity(u,_)||new qe.Map;if(x=x.isEmpty()?_:x,w){let{schema:o}=getParameterSchema(x,{isOAS3:w});s=o?o.get(\"enum\"):void 0}else s=x?x.get(\"enum\"):void 0;let C,j=x?x.get(\"value\"):void 0;void 0!==j?C=j:_.get(\"required\")&&s&&s.size&&(C=s.first()),void 0!==C&&C!==j&&this.onChangeWrapper(function numberToString(o){return\"number\"==typeof o?o.toString():o}(C)),this.setDefaultValue()}onChangeWrapper=(o,s=!1)=>{let i,{onChange:u,rawParam:_}=this.props;return i=\"\"===o||o&&0===o.size?null:o,u(_,i,s)};_onExampleSelect=o=>{this.props.oas3Actions.setActiveExamplesMember({name:o,pathMethod:this.props.pathMethod,contextType:\"parameters\",contextName:this.getParamKey()})};onChangeIncludeEmpty=o=>{let{specActions:s,param:i,pathMethod:u}=this.props;const _=i.get(\"name\"),w=i.get(\"in\");return s.updateEmptyParamInclusion(u,_,w,o)};setDefaultValue=()=>{let{specSelectors:o,pathMethod:s,rawParam:i,oas3Selectors:u,fn:_}=this.props;const w=o.parameterWithMetaByIdentity(s,i)||(0,qe.Map)();let{schema:x}=getParameterSchema(w,{isOAS3:o.isOAS3()});const C=w.get(\"content\",(0,qe.Map)()).keySeq().first(),j=x?_.getSampleSchema(x.toJS(),C,{includeWriteOnly:!0}):null;if(w&&void 0===w.get(\"value\")&&\"body\"!==w.get(\"in\")){let i;if(o.isSwagger2())i=void 0!==w.get(\"x-example\")?w.get(\"x-example\"):void 0!==w.getIn([\"schema\",\"example\"])?w.getIn([\"schema\",\"example\"]):x&&x.getIn([\"default\"]);else if(o.isOAS3()){x=this.composeJsonSchema(x);const o=u.activeExamplesMember(...s,\"parameters\",this.getParamKey());i=void 0!==w.getIn([\"examples\",o,\"value\"])?w.getIn([\"examples\",o,\"value\"]):void 0!==w.getIn([\"content\",C,\"example\"])?w.getIn([\"content\",C,\"example\"]):void 0!==w.get(\"example\")?w.get(\"example\"):void 0!==(x&&x.get(\"example\"))?x&&x.get(\"example\"):void 0!==(x&&x.get(\"default\"))?x&&x.get(\"default\"):w.get(\"default\")}void 0===i||qe.List.isList(i)||(i=stringify(i)),void 0!==i?this.onChangeWrapper(i):x&&\"object\"===x.get(\"type\")&&j&&!w.get(\"examples\")&&this.onChangeWrapper(qe.List.isList(j)?j:stringify(j))}};getParamKey(){const{param:o}=this.props;return o?`${o.get(\"name\")}-${o.get(\"in\")}`:null}composeJsonSchema(o){const{fn:s}=this.props,i=o.get(\"oneOf\")?.get(0)?.toJS(),u=o.get(\"anyOf\")?.get(0)?.toJS();return(0,qe.fromJS)(s.mergeJsonSchema(o.toJS(),i??u??{}))}render(){let{param:o,rawParam:s,getComponent:i,getConfigs:u,isExecute:_,fn:w,onChangeConsumes:x,specSelectors:C,pathMethod:j,specPath:L,oas3Selectors:B}=this.props,$=C.isOAS3();const{showExtensions:V,showCommonExtensions:U}=u();if(o||(o=s),!s)return null;const z=i(\"JsonSchemaForm\"),Y=i(\"ParamBody\");let Z=o.get(\"in\"),ee=\"body\"!==Z?null:Pe.createElement(Y,{getComponent:i,getConfigs:u,fn:w,param:o,consumes:C.consumesOptionsFor(j),consumesValue:C.contentTypeValues(j).get(\"requestContentType\"),onChange:this.onChangeWrapper,onChangeConsumes:x,isExecute:_,specSelectors:C,pathMethod:j});const ie=i(\"modelExample\"),ae=i(\"Markdown\",!0),ce=i(\"ParameterExt\"),le=i(\"ParameterIncludeEmpty\"),pe=i(\"ExamplesSelectValueRetainer\"),de=i(\"Example\");let{schema:fe}=getParameterSchema(o,{isOAS3:$}),ye=C.parameterWithMetaByIdentity(j,s)||(0,qe.Map)();$&&(fe=this.composeJsonSchema(fe));let be,_e,we,Se,xe=fe?fe.get(\"format\"):null,Te=fe?fe.get(\"type\"):null,Re=fe?fe.getIn([\"items\",\"type\"]):null,$e=\"formData\"===Z,ze=\"FormData\"in at,We=o.get(\"required\"),He=ye?ye.get(\"value\"):\"\",Ye=U?getCommonExtensions(fe):null,Xe=V?getExtensions(o):null,Qe=!1;return void 0!==o&&fe&&(be=fe.get(\"items\")),void 0!==be?(_e=be.get(\"enum\"),we=be.get(\"default\")):fe&&(_e=fe.get(\"enum\")),_e&&_e.size&&_e.size>0&&(Qe=!0),void 0!==o&&(fe&&(we=fe.get(\"default\")),void 0===we&&(we=o.get(\"default\")),Se=o.get(\"example\"),void 0===Se&&(Se=o.get(\"x-example\"))),Pe.createElement(\"tr\",{\"data-param-name\":o.get(\"name\"),\"data-param-in\":o.get(\"in\")},Pe.createElement(\"td\",{className:\"parameters-col_name\"},Pe.createElement(\"div\",{className:We?\"parameter__name required\":\"parameter__name\"},o.get(\"name\"),We?Pe.createElement(\"span\",null,\" *\"):null),Pe.createElement(\"div\",{className:\"parameter__type\"},Te,Re&&`[${Re}]`,xe&&Pe.createElement(\"span\",{className:\"prop-format\"},\"($\",xe,\")\")),Pe.createElement(\"div\",{className:\"parameter__deprecated\"},$&&o.get(\"deprecated\")?\"deprecated\":null),Pe.createElement(\"div\",{className:\"parameter__in\"},\"(\",o.get(\"in\"),\")\")),Pe.createElement(\"td\",{className:\"parameters-col_description\"},o.get(\"description\")?Pe.createElement(ae,{source:o.get(\"description\")}):null,!ee&&_||!Qe?null:Pe.createElement(ae,{className:\"parameter__enum\",source:\"<i>Available values</i> : \"+_e.map((function(o){return o})).toArray().map(String).join(\", \")}),!ee&&_||void 0===we?null:Pe.createElement(ae,{className:\"parameter__default\",source:\"<i>Default value</i> : \"+we}),!ee&&_||void 0===Se?null:Pe.createElement(ae,{source:\"<i>Example</i> : \"+Se}),$e&&!ze&&Pe.createElement(\"div\",null,\"Error: your browser does not support FormData\"),$&&o.get(\"examples\")?Pe.createElement(\"section\",{className:\"parameter-controls\"},Pe.createElement(pe,{examples:o.get(\"examples\"),onSelect:this._onExampleSelect,updateValue:this.onChangeWrapper,getComponent:i,defaultToFirstExample:!0,currentKey:B.activeExamplesMember(...j,\"parameters\",this.getParamKey()),currentUserInputValue:He})):null,ee?null:Pe.createElement(z,{fn:w,getComponent:i,value:He,required:We,disabled:!_,description:o.get(\"name\"),onChange:this.onChangeWrapper,errors:ye.get(\"errors\"),schema:fe}),ee&&fe?Pe.createElement(ie,{getComponent:i,specPath:L.push(\"schema\"),getConfigs:u,isExecute:_,specSelectors:C,schema:fe,example:ee,includeWriteOnly:!0}):null,!ee&&_&&o.get(\"allowEmptyValue\")?Pe.createElement(le,{onChange:this.onChangeIncludeEmpty,isIncluded:C.parameterInclusionSettingFor(j,o.get(\"name\"),o.get(\"in\")),isDisabled:!isEmptyValue(He)}):null,$&&o.get(\"examples\")?Pe.createElement(de,{example:o.getIn([\"examples\",B.activeExamplesMember(...j,\"parameters\",this.getParamKey())]),getComponent:i,getConfigs:u}):null,U&&Ye.size?Ye.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,xKey:o,xVal:s}))):null,V&&Xe.size?Xe.entrySeq().map((([o,s])=>Pe.createElement(ce,{key:`${o}-${s}`,xKey:o,xVal:s}))):null))}}class Execute extends Pe.Component{handleValidateParameters=()=>{let{specSelectors:o,specActions:s,path:i,method:u}=this.props;return s.validateParams([i,u]),o.validateBeforeExecute([i,u])};handleValidateRequestBody=()=>{let{path:o,method:s,specSelectors:i,oas3Selectors:u,oas3Actions:_}=this.props,w={missingBodyValue:!1,missingRequiredKeys:[]};_.clearRequestBodyValidateError({path:o,method:s});let x=i.getOAS3RequiredRequestBodyContentType([o,s]),C=u.requestBodyValue(o,s),j=u.validateBeforeExecute([o,s]),L=u.requestContentType(o,s);if(!j)return w.missingBodyValue=!0,_.setRequestBodyValidateError({path:o,method:s,validationErrors:w}),!1;if(!x)return!0;let B=u.validateShallowRequired({oas3RequiredRequestBodyContentType:x,oas3RequestContentType:L,oas3RequestBodyValue:C});return!B||B.length<1||(B.forEach((o=>{w.missingRequiredKeys.push(o)})),_.setRequestBodyValidateError({path:o,method:s,validationErrors:w}),!1)};handleValidationResultPass=()=>{let{specActions:o,operation:s,path:i,method:u}=this.props;this.props.onExecute&&this.props.onExecute(),o.execute({operation:s,path:i,method:u})};handleValidationResultFail=()=>{let{specActions:o,path:s,method:i}=this.props;o.clearValidateParams([s,i]),setTimeout((()=>{o.validateParams([s,i])}),40)};handleValidationResult=o=>{o?this.handleValidationResultPass():this.handleValidationResultFail()};onClick=()=>{let o=this.handleValidateParameters(),s=this.handleValidateRequestBody(),i=o&&s;this.handleValidationResult(i)};onChangeProducesWrapper=o=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],o);render(){const{disabled:o}=this.props;return Pe.createElement(\"button\",{className:\"btn execute opblock-control__btn\",onClick:this.onClick,disabled:o},\"Execute\")}}class headers_Headers extends Pe.Component{render(){let{headers:o,getComponent:s}=this.props;const i=s(\"Property\"),u=s(\"Markdown\",!0);return o&&o.size?Pe.createElement(\"div\",{className:\"headers-wrapper\"},Pe.createElement(\"h4\",{className:\"headers__title\"},\"Headers:\"),Pe.createElement(\"table\",{className:\"headers\"},Pe.createElement(\"thead\",null,Pe.createElement(\"tr\",{className:\"header-row\"},Pe.createElement(\"th\",{className:\"header-col\"},\"Name\"),Pe.createElement(\"th\",{className:\"header-col\"},\"Description\"),Pe.createElement(\"th\",{className:\"header-col\"},\"Type\"))),Pe.createElement(\"tbody\",null,o.entrySeq().map((([o,s])=>{if(!$e().Map.isMap(s))return null;const _=s.get(\"description\"),w=s.getIn([\"schema\"])?s.getIn([\"schema\",\"type\"]):s.getIn([\"type\"]),x=s.getIn([\"schema\",\"example\"]);return Pe.createElement(\"tr\",{key:o},Pe.createElement(\"td\",{className:\"header-col\"},o),Pe.createElement(\"td\",{className:\"header-col\"},_?Pe.createElement(u,{source:_}):null),Pe.createElement(\"td\",{className:\"header-col\"},w,\" \",x?Pe.createElement(i,{propKey:\"Example\",propVal:x,propClass:\"header-example\"}):null))})).toArray()))):null}}class Errors extends Pe.Component{render(){let{editorActions:o,errSelectors:s,layoutSelectors:i,layoutActions:u,getComponent:_}=this.props;const w=_(\"Collapse\");if(o&&o.jumpToLine)var x=o.jumpToLine;let C=s.allErrors().filter((o=>\"thrown\"===o.get(\"type\")||\"error\"===o.get(\"level\")));if(!C||C.count()<1)return null;let j=i.isShown([\"errorPane\"],!0),L=C.sortBy((o=>o.get(\"line\")));return Pe.createElement(\"pre\",{className:\"errors-wrapper\"},Pe.createElement(\"hgroup\",{className:\"error\"},Pe.createElement(\"h4\",{className:\"errors__title\"},\"Errors\"),Pe.createElement(\"button\",{className:\"btn errors__clear-btn\",onClick:()=>u.show([\"errorPane\"],!j)},j?\"Hide\":\"Show\")),Pe.createElement(w,{isOpened:j,animated:!0},Pe.createElement(\"div\",{className:\"errors\"},L.map(((o,s)=>{let i=o.get(\"type\");return\"thrown\"===i||\"auth\"===i?Pe.createElement(ThrownErrorItem,{key:s,error:o.get(\"error\")||o,jumpToLine:x}):\"spec\"===i?Pe.createElement(SpecErrorItem,{key:s,error:o,jumpToLine:x}):void 0})))))}}const ThrownErrorItem=({error:o,jumpToLine:s})=>{if(!o)return null;let i=o.get(\"line\");return Pe.createElement(\"div\",{className:\"error-wrapper\"},o?Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,o.get(\"source\")&&o.get(\"level\")?toTitleCase(o.get(\"source\"))+\" \"+o.get(\"level\"):\"\",o.get(\"path\")?Pe.createElement(\"small\",null,\" at \",o.get(\"path\")):null),Pe.createElement(\"span\",{className:\"message thrown\"},o.get(\"message\")),Pe.createElement(\"div\",{className:\"error-line\"},i&&s?Pe.createElement(\"a\",{onClick:s.bind(null,i)},\"Jump to line \",i):null)):null)},SpecErrorItem=({error:o,jumpToLine:s=null})=>{let i=null;return o.get(\"path\")?i=qe.List.isList(o.get(\"path\"))?Pe.createElement(\"small\",null,\"at \",o.get(\"path\").join(\".\")):Pe.createElement(\"small\",null,\"at \",o.get(\"path\")):o.get(\"line\")&&!s&&(i=Pe.createElement(\"small\",null,\"on line \",o.get(\"line\"))),Pe.createElement(\"div\",{className:\"error-wrapper\"},o?Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,toTitleCase(o.get(\"source\"))+\" \"+o.get(\"level\"),\" \",i),Pe.createElement(\"span\",{className:\"message\"},o.get(\"message\")),Pe.createElement(\"div\",{className:\"error-line\"},s?Pe.createElement(\"a\",{onClick:s.bind(null,o.get(\"line\"))},\"Jump to line \",o.get(\"line\")):null)):null)};function toTitleCase(o){return(o||\"\").split(\" \").map((o=>o[0].toUpperCase()+o.slice(1))).join(\" \")}const content_type_noop=()=>{};class ContentType extends Pe.Component{static defaultProps={onChange:content_type_noop,value:null,contentTypes:(0,qe.fromJS)([\"application/json\"])};componentDidMount(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}UNSAFE_componentWillReceiveProps(o){o.contentTypes&&o.contentTypes.size&&(o.contentTypes.includes(o.value)||o.onChange(o.contentTypes.first()))}onChangeWrapper=o=>this.props.onChange(o.target.value);render(){let{ariaControls:o,ariaLabel:s,className:i,contentTypes:u,controlId:_,value:w}=this.props;return u&&u.size?Pe.createElement(\"div\",{className:\"content-type-wrapper \"+(i||\"\")},Pe.createElement(\"select\",{\"aria-controls\":o,\"aria-label\":s,className:\"content-type\",id:_,onChange:this.onChangeWrapper,value:w||\"\"},u.map((o=>Pe.createElement(\"option\",{key:o,value:o},o))).toArray())):null}}function xclass(...o){return o.filter((o=>!!o)).join(\" \").trim()}class Container extends Pe.Component{render(){let{fullscreen:o,full:s,...i}=this.props;if(o)return Pe.createElement(\"section\",i);let u=\"swagger-container\"+(s?\"-full\":\"\");return Pe.createElement(\"section\",wo()({},i,{className:xclass(i.className,u)}))}}const PO={mobile:\"\",tablet:\"-tablet\",desktop:\"-desktop\",large:\"-hd\"};class Col extends Pe.Component{render(){const{hide:o,keepContents:s,mobile:i,tablet:u,desktop:_,large:w,...x}=this.props;if(o&&!s)return Pe.createElement(\"span\",null);let C=[];for(let o in PO){if(!Object.prototype.hasOwnProperty.call(PO,o))continue;let s=PO[o];if(o in this.props){let i=this.props[o];if(i<1){C.push(\"none\"+s);continue}C.push(\"block\"+s),C.push(\"col-\"+i+s)}}o&&C.push(\"hidden\");let j=xclass(x.className,...C);return Pe.createElement(\"section\",wo()({},x,{className:j}))}}class Row extends Pe.Component{render(){return Pe.createElement(\"div\",wo()({},this.props,{className:xclass(this.props.className,\"wrapper\")}))}}class Button extends Pe.Component{static defaultProps={className:\"\"};render(){return Pe.createElement(\"button\",wo()({},this.props,{className:xclass(this.props.className,\"button\")}))}}const TextArea=o=>Pe.createElement(\"textarea\",o),Input=o=>Pe.createElement(\"input\",o);class Select extends Pe.Component{static defaultProps={multiple:!1,allowEmptyValue:!0};constructor(o,s){let i;super(o,s),i=o.value?o.value:o.multiple?[\"\"]:\"\",this.state={value:i}}onChange=o=>{let s,{onChange:i,multiple:u}=this.props,_=[].slice.call(o.target.options);s=u?_.filter((function(o){return o.selected})).map((function(o){return o.value})):o.target.value,this.setState({value:s}),i&&i(s)};UNSAFE_componentWillReceiveProps(o){o.value!==this.props.value&&this.setState({value:o.value})}render(){let{allowedValues:o,multiple:s,allowEmptyValue:i,disabled:u}=this.props,_=this.state.value?.toJS?.()||this.state.value;return Pe.createElement(\"select\",{className:this.props.className,multiple:s,value:_,onChange:this.onChange,disabled:u},i?Pe.createElement(\"option\",{value:\"\"},\"--\"):null,o.map((function(o,s){return Pe.createElement(\"option\",{key:s,value:String(o)},String(o))})))}}class layout_utils_Link extends Pe.Component{render(){return Pe.createElement(\"a\",wo()({},this.props,{rel:\"noopener noreferrer\",className:xclass(this.props.className,\"link\")}))}}const NoMargin=({children:o})=>Pe.createElement(\"div\",{className:\"no-margin\"},\" \",o,\" \");class Collapse extends Pe.Component{static defaultProps={isOpened:!1,animated:!1};renderNotAnimated(){return this.props.isOpened?Pe.createElement(NoMargin,null,this.props.children):Pe.createElement(\"noscript\",null)}render(){let{animated:o,isOpened:s,children:i}=this.props;return o?(i=s?i:null,Pe.createElement(NoMargin,null,i)):this.renderNotAnimated()}}class Overview extends Pe.Component{constructor(...o){super(...o),this.setTagShown=this._setTagShown.bind(this)}_setTagShown(o,s){this.props.layoutActions.show(o,s)}showOp(o,s){let{layoutActions:i}=this.props;i.show(o,s)}render(){let{specSelectors:o,layoutSelectors:s,layoutActions:i,getComponent:u}=this.props,_=o.taggedOperations();const w=u(\"Collapse\");return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",{className:\"overview-title\"},\"Overview\"),_.map(((o,u)=>{let _=o.get(\"operations\"),x=[\"overview-tags\",u],C=s.isShown(x,!0);return Pe.createElement(\"div\",{key:\"overview-\"+u},Pe.createElement(\"h4\",{onClick:()=>i.show(x,!C),className:\"link overview-tag\"},\" \",C?\"-\":\"+\",u),Pe.createElement(w,{isOpened:C,animated:!0},_.map((o=>{let{path:u,method:_,id:w}=o.toObject(),x=\"operations\",C=w,j=s.isShown([x,C]);return Pe.createElement(OperationLink,{key:w,path:u,method:_,id:u+\"-\"+_,shown:j,showOpId:C,showOpIdPrefix:x,href:`#operation-${C}`,onClick:i.show})})).toArray()))})).toArray(),_.size<1&&Pe.createElement(\"h3\",null,\" No operations defined in spec! \"))}}class OperationLink extends Pe.Component{constructor(o){super(o),this.onClick=this._onClick.bind(this)}_onClick(){let{showOpId:o,showOpIdPrefix:s,onClick:i,shown:u}=this.props;i([s,o],!u)}render(){let{id:o,method:s,shown:i,href:u}=this.props;return Pe.createElement(layout_utils_Link,{href:u,onClick:this.onClick,className:\"block opblock-link \"+(i?\"shown\":\"\")},Pe.createElement(\"div\",null,Pe.createElement(\"small\",{className:`bold-label-${s}`},s.toUpperCase()),Pe.createElement(\"span\",{className:\"bold-label\"},o)))}}class InitializedInput extends Pe.Component{componentDidMount(){this.props.initialValue&&(this.inputRef.value=this.props.initialValue)}render(){const{value:o,defaultValue:s,initialValue:i,...u}=this.props;return Pe.createElement(\"input\",wo()({},u,{ref:o=>this.inputRef=o}))}}class InfoBasePath extends Pe.Component{render(){const{host:o,basePath:s}=this.props;return Pe.createElement(\"pre\",{className:\"base-url\"},\"[ Base URL: \",o,s,\" ]\")}}class InfoUrl extends Pe.PureComponent{render(){const{url:o,getComponent:s}=this.props,i=s(\"Link\");return Pe.createElement(i,{target:\"_blank\",href:sanitizeUrl(o)},Pe.createElement(\"span\",{className:\"url\"},\" \",o))}}class info_Info extends Pe.Component{render(){const{info:o,url:s,host:i,basePath:u,getComponent:_,externalDocs:w,selectedServer:x,url:C}=this.props,j=o.get(\"version\"),L=o.get(\"description\"),B=o.get(\"title\"),$=safeBuildUrl(o.get(\"termsOfService\"),C,{selectedServer:x}),V=o.get(\"contact\"),U=o.get(\"license\"),z=safeBuildUrl(w&&w.get(\"url\"),C,{selectedServer:x}),Y=w&&w.get(\"description\"),Z=_(\"Markdown\",!0),ee=_(\"Link\"),ie=_(\"VersionStamp\"),ae=_(\"OpenAPIVersion\"),ce=_(\"InfoUrl\"),le=_(\"InfoBasePath\"),pe=_(\"License\"),de=_(\"Contact\");return Pe.createElement(\"div\",{className:\"info\"},Pe.createElement(\"hgroup\",{className:\"main\"},Pe.createElement(\"h2\",{className:\"title\"},B,Pe.createElement(\"span\",null,j&&Pe.createElement(ie,{version:j}),Pe.createElement(ae,{oasVersion:\"2.0\"}))),i||u?Pe.createElement(le,{host:i,basePath:u}):null,s&&Pe.createElement(ce,{getComponent:_,url:s})),Pe.createElement(\"div\",{className:\"description\"},Pe.createElement(Z,{source:L})),$&&Pe.createElement(\"div\",{className:\"info__tos\"},Pe.createElement(ee,{target:\"_blank\",href:sanitizeUrl($)},\"Terms of service\")),V?.size>0&&Pe.createElement(de,{getComponent:_,data:V,selectedServer:x,url:s}),U?.size>0&&Pe.createElement(pe,{getComponent:_,license:U,selectedServer:x,url:s}),z?Pe.createElement(ee,{className:\"info__extdocs\",target:\"_blank\",href:sanitizeUrl(z)},Y||z):null)}}const IO=info_Info;class InfoContainer extends Pe.Component{render(){const{specSelectors:o,getComponent:s,oas3Selectors:i}=this.props,u=o.info(),_=o.url(),w=o.basePath(),x=o.host(),C=o.externalDocs(),j=i.selectedServer(),L=s(\"info\");return Pe.createElement(\"div\",null,u&&u.count()?Pe.createElement(L,{info:u,url:_,host:x,basePath:w,externalDocs:C,getComponent:s,selectedServer:j}):null)}}class contact_Contact extends Pe.Component{render(){const{data:o,getComponent:s,selectedServer:i,url:u}=this.props,_=o.get(\"name\",\"the developer\"),w=safeBuildUrl(o.get(\"url\"),u,{selectedServer:i}),x=o.get(\"email\"),C=s(\"Link\");return Pe.createElement(\"div\",{className:\"info__contact\"},w&&Pe.createElement(\"div\",null,Pe.createElement(C,{href:sanitizeUrl(w),target:\"_blank\"},_,\" - Website\")),x&&Pe.createElement(C,{href:sanitizeUrl(`mailto:${x}`)},w?`Send email to ${_}`:`Contact ${_}`))}}const MO=contact_Contact;class license_License extends Pe.Component{render(){const{license:o,getComponent:s,selectedServer:i,url:u}=this.props,_=o.get(\"name\",\"License\"),w=safeBuildUrl(o.get(\"url\"),u,{selectedServer:i}),x=s(\"Link\");return Pe.createElement(\"div\",{className:\"info__license\"},w?Pe.createElement(\"div\",{className:\"info__license__url\"},Pe.createElement(x,{target:\"_blank\",href:sanitizeUrl(w)},_)):Pe.createElement(\"span\",null,_))}}const NO=license_License;class JumpToPath extends Pe.Component{render(){return null}}class CopyToClipboardBtn extends Pe.Component{render(){let{getComponent:o}=this.props;const s=o(\"CopyIcon\");return Pe.createElement(\"div\",{className:\"view-line-link copy-to-clipboard\",title:\"Copy to clipboard\"},Pe.createElement(Ro.CopyToClipboard,{text:this.props.textToCopy},Pe.createElement(s,null)))}}class Footer extends Pe.Component{render(){return Pe.createElement(\"div\",{className:\"footer\"})}}class FilterContainer extends Pe.Component{onFilterChange=o=>{const{target:{value:s}}=o;this.props.layoutActions.updateFilter(s)};render(){const{specSelectors:o,layoutSelectors:s,getComponent:i}=this.props,u=i(\"Col\"),_=\"loading\"===o.loadingStatus(),w=\"failed\"===o.loadingStatus(),x=s.currentFilter(),C=[\"operation-filter-input\"];return w&&C.push(\"failed\"),_&&C.push(\"loading\"),Pe.createElement(\"div\",null,!1===x?null:Pe.createElement(\"div\",{className:\"filter-container\"},Pe.createElement(u,{className:\"filter wrapper\",mobile:12},Pe.createElement(\"input\",{className:C.join(\" \"),placeholder:\"Filter by tag\",type:\"text\",onChange:this.onFilterChange,value:\"string\"==typeof x?x:\"\",disabled:_}))))}}const TO=Function.prototype;class ParamBody extends Pe.PureComponent{static defaultProp={consumes:(0,qe.fromJS)([\"application/json\"]),param:(0,qe.fromJS)({}),onChange:TO,onChangeConsumes:TO};constructor(o,s){super(o,s),this.state={isEditBox:!1,value:\"\"}}componentDidMount(){this.updateValues.call(this,this.props)}UNSAFE_componentWillReceiveProps(o){this.updateValues.call(this,o)}updateValues=o=>{let{param:s,isExecute:i,consumesValue:u=\"\"}=o,_=/xml/i.test(u),w=/json/i.test(u),x=_?s.get(\"value_xml\"):s.get(\"value\");if(void 0!==x){let o=!x&&w?\"{}\":x;this.setState({value:o}),this.onChange(o,{isXml:_,isEditBox:i})}else _?this.onChange(this.sample(\"xml\"),{isXml:_,isEditBox:i}):this.onChange(this.sample(),{isEditBox:i})};sample=o=>{let{param:s,fn:i}=this.props,u=i.inferSchema(s.toJS());return i.getSampleSchema(u,o,{includeWriteOnly:!0})};onChange=(o,{isEditBox:s,isXml:i})=>{this.setState({value:o,isEditBox:s}),this._onChange(o,i)};_onChange=(o,s)=>{(this.props.onChange||TO)(o,s)};handleOnChange=o=>{const{consumesValue:s}=this.props,i=/xml/i.test(s),u=o.target.value;this.onChange(u,{isXml:i,isEditBox:this.state.isEditBox})};toggleIsEditBox=()=>this.setState((o=>({isEditBox:!o.isEditBox})));render(){let{onChangeConsumes:o,param:s,isExecute:i,specSelectors:u,pathMethod:_,getComponent:w}=this.props;const x=w(\"Button\"),C=w(\"TextArea\"),j=w(\"HighlightCode\",!0),L=w(\"contentType\");let B=(u?u.parameterWithMetaByIdentity(_,s):s).get(\"errors\",(0,qe.List)()),$=u.contentTypeValues(_).get(\"requestContentType\"),V=this.props.consumes&&this.props.consumes.size?this.props.consumes:ParamBody.defaultProp.consumes,{value:U,isEditBox:z}=this.state,Y=null;getKnownSyntaxHighlighterLanguage(U)&&(Y=\"json\");const Z=`${createHtmlReadyId(`${_[1]}${_[0]}_parameters`)}_select`;return Pe.createElement(\"div\",{className:\"body-param\",\"data-param-name\":s.get(\"name\"),\"data-param-in\":s.get(\"in\")},z&&i?Pe.createElement(C,{className:\"body-param__text\"+(B.count()?\" invalid\":\"\"),value:U,onChange:this.handleOnChange}):U&&Pe.createElement(j,{className:\"body-param__example\",language:Y},U),Pe.createElement(\"div\",{className:\"body-param-options\"},i?Pe.createElement(\"div\",{className:\"body-param-edit\"},Pe.createElement(x,{className:z?\"btn cancel body-param__example-edit\":\"btn edit body-param__example-edit\",onClick:this.toggleIsEditBox},z?\"Cancel\":\"Edit\")):null,Pe.createElement(\"label\",{htmlFor:Z},Pe.createElement(\"span\",null,\"Parameter content type\"),Pe.createElement(L,{value:$,contentTypes:V,onChange:o,className:\"body-param-content-type\",ariaLabel:\"Parameter content type\",controlId:Z}))))}}class Curl extends Pe.Component{render(){const{request:o,getComponent:s}=this.props,i=requestSnippetGenerator_curl_bash(o),u=s(\"SyntaxHighlighter\",!0);return Pe.createElement(\"div\",{className:\"curl-command\"},Pe.createElement(\"h4\",null,\"Curl\"),Pe.createElement(\"div\",{className:\"copy-to-clipboard\"},Pe.createElement(Ro.CopyToClipboard,{text:i},Pe.createElement(\"button\",null))),Pe.createElement(\"div\",null,Pe.createElement(u,{language:\"bash\",className:\"curl microlight\",renderPlainText:({children:o,PlainTextViewer:s})=>Pe.createElement(s,{className:\"curl\"},o)},i)))}}const property=({propKey:o,propVal:s,propClass:i})=>Pe.createElement(\"span\",{className:i},Pe.createElement(\"br\",null),o,\": \",String(s));class TryItOutButton extends Pe.Component{static defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,onResetClick:Function.prototype,enabled:!1,hasUserEditedBody:!1,isOAS3:!1};render(){const{onTryoutClick:o,onCancelClick:s,onResetClick:i,enabled:u,hasUserEditedBody:_,isOAS3:w}=this.props,x=w&&_;return Pe.createElement(\"div\",{className:x?\"try-out btn-group\":\"try-out\"},u?Pe.createElement(\"button\",{className:\"btn try-out__btn cancel\",onClick:s},\"Cancel\"):Pe.createElement(\"button\",{className:\"btn try-out__btn\",onClick:o},\"Try it out \"),x&&Pe.createElement(\"button\",{className:\"btn try-out__btn reset\",onClick:i},\"Reset\"))}}class VersionPragmaFilter extends Pe.PureComponent{static defaultProps={alsoShow:null,children:null,bypass:!1};render(){const{bypass:o,isSwagger2:s,isOAS3:i,alsoShow:u}=this.props;return o?Pe.createElement(\"div\",null,this.props.children):s&&i?Pe.createElement(\"div\",{className:\"version-pragma\"},u,Pe.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--ambiguous\"},Pe.createElement(\"div\",null,Pe.createElement(\"h3\",null,\"Unable to render this definition\"),Pe.createElement(\"p\",null,Pe.createElement(\"code\",null,\"swagger\"),\" and \",Pe.createElement(\"code\",null,\"openapi\"),\" fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields.\"),Pe.createElement(\"p\",null,\"Supported version fields are \",Pe.createElement(\"code\",null,\"swagger: \",'\"2.0\"'),\" and those that match \",Pe.createElement(\"code\",null,\"openapi: 3.0.n\"),\" (for example, \",Pe.createElement(\"code\",null,\"openapi: 3.0.0\"),\").\")))):s||i?Pe.createElement(\"div\",null,this.props.children):Pe.createElement(\"div\",{className:\"version-pragma\"},u,Pe.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--missing\"},Pe.createElement(\"div\",null,Pe.createElement(\"h3\",null,\"Unable to render this definition\"),Pe.createElement(\"p\",null,\"The provided definition does not specify a valid version field.\"),Pe.createElement(\"p\",null,\"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are \",Pe.createElement(\"code\",null,\"swagger: \",'\"2.0\"'),\" and those that match \",Pe.createElement(\"code\",null,\"openapi: 3.0.n\"),\" (for example, \",Pe.createElement(\"code\",null,\"openapi: 3.0.0\"),\").\"))))}}const version_stamp=({version:o})=>Pe.createElement(\"small\",null,Pe.createElement(\"pre\",{className:\"version\"},\" \",o,\" \")),openapi_version=({oasVersion:o})=>Pe.createElement(\"small\",{className:\"version-stamp\"},Pe.createElement(\"pre\",{className:\"version\"},\"OAS \",o)),deep_link=({enabled:o,path:s,text:i})=>Pe.createElement(\"a\",{className:\"nostyle\",onClick:o?o=>o.preventDefault():null,href:o?`#/${s}`:null},Pe.createElement(\"span\",null,i)),svg_assets=()=>Pe.createElement(\"div\",null,Pe.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",xmlnsXlink:\"http://www.w3.org/1999/xlink\",className:\"svg-assets\"},Pe.createElement(\"defs\",null,Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"unlocked\"},Pe.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"locked\"},Pe.createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"close\"},Pe.createElement(\"path\",{d:\"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow\"},Pe.createElement(\"path\",{d:\"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow-down\"},Pe.createElement(\"path\",{d:\"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow-up\"},Pe.createElement(\"path\",{d:\"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 24 24\",id:\"jump-to\"},Pe.createElement(\"path\",{d:\"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 24 24\",id:\"expand\"},Pe.createElement(\"path\",{d:\"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z\"})),Pe.createElement(\"symbol\",{viewBox:\"0 0 15 16\",id:\"copy\"},Pe.createElement(\"g\",{transform:\"translate(2, -1)\"},Pe.createElement(\"path\",{fill:\"#ffffff\",fillRule:\"evenodd\",d:\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"}))))));var RO;function decodeEntity(o){return(RO=RO||document.createElement(\"textarea\")).innerHTML=\"&\"+o+\";\",RO.value}var DO=Object.prototype.hasOwnProperty;function index_browser_has(o,s){return!!o&&DO.call(o,s)}function index_browser_assign(o){return[].slice.call(arguments,1).forEach((function(s){if(s){if(\"object\"!=typeof s)throw new TypeError(s+\"must be object\");Object.keys(s).forEach((function(i){o[i]=s[i]}))}})),o}var LO=/\\\\([\\\\!\"#$%&'()*+,.\\/:;<=>?@[\\]^_`{|}~-])/g;function unescapeMd(o){return o.indexOf(\"\\\\\")<0?o:o.replace(LO,\"$1\")}function isValidEntityCode(o){return!(o>=55296&&o<=57343)&&(!(o>=64976&&o<=65007)&&(!!(65535&~o&&65534!=(65535&o))&&(!(o>=0&&o<=8)&&(11!==o&&(!(o>=14&&o<=31)&&(!(o>=127&&o<=159)&&!(o>1114111)))))))}function fromCodePoint(o){if(o>65535){var s=55296+((o-=65536)>>10),i=56320+(1023&o);return String.fromCharCode(s,i)}return String.fromCharCode(o)}var BO=/&([a-z#][a-z0-9]{1,31});/gi,FO=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function replaceEntityPattern(o,s){var i=0,u=decodeEntity(s);return s!==u?u:35===s.charCodeAt(0)&&FO.test(s)&&isValidEntityCode(i=\"x\"===s[1].toLowerCase()?parseInt(s.slice(2),16):parseInt(s.slice(1),10))?fromCodePoint(i):o}function replaceEntities(o){return o.indexOf(\"&\")<0?o:o.replace(BO,replaceEntityPattern)}var qO=/[&<>\"]/,$O=/[&<>\"]/g,VO={\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\"};function replaceUnsafeChar(o){return VO[o]}function escapeHtml(o){return qO.test(o)?o.replace($O,replaceUnsafeChar):o}var UO={};function nextToken(o,s){return++s>=o.length-2?s:\"paragraph_open\"===o[s].type&&o[s].tight&&\"inline\"===o[s+1].type&&0===o[s+1].content.length&&\"paragraph_close\"===o[s+2].type&&o[s+2].tight?nextToken(o,s+2):s}UO.blockquote_open=function(){return\"<blockquote>\\n\"},UO.blockquote_close=function(o,s){return\"</blockquote>\"+zO(o,s)},UO.code=function(o,s){return o[s].block?\"<pre><code>\"+escapeHtml(o[s].content)+\"</code></pre>\"+zO(o,s):\"<code>\"+escapeHtml(o[s].content)+\"</code>\"},UO.fence=function(o,s,i,u,_){var w,x,C=o[s],j=\"\",L=i.langPrefix;if(C.params){if(x=(w=C.params.split(/\\s+/g)).join(\" \"),index_browser_has(_.rules.fence_custom,w[0]))return _.rules.fence_custom[w[0]](o,s,i,u,_);j=' class=\"'+L+escapeHtml(replaceEntities(unescapeMd(x)))+'\"'}return\"<pre><code\"+j+\">\"+(i.highlight&&i.highlight.apply(i.highlight,[C.content].concat(w))||escapeHtml(C.content))+\"</code></pre>\"+zO(o,s)},UO.fence_custom={},UO.heading_open=function(o,s){return\"<h\"+o[s].hLevel+\">\"},UO.heading_close=function(o,s){return\"</h\"+o[s].hLevel+\">\\n\"},UO.hr=function(o,s,i){return(i.xhtmlOut?\"<hr />\":\"<hr>\")+zO(o,s)},UO.bullet_list_open=function(){return\"<ul>\\n\"},UO.bullet_list_close=function(o,s){return\"</ul>\"+zO(o,s)},UO.list_item_open=function(){return\"<li>\"},UO.list_item_close=function(){return\"</li>\\n\"},UO.ordered_list_open=function(o,s){var i=o[s];return\"<ol\"+(i.order>1?' start=\"'+i.order+'\"':\"\")+\">\\n\"},UO.ordered_list_close=function(o,s){return\"</ol>\"+zO(o,s)},UO.paragraph_open=function(o,s){return o[s].tight?\"\":\"<p>\"},UO.paragraph_close=function(o,s){var i=!(o[s].tight&&s&&\"inline\"===o[s-1].type&&!o[s-1].content);return(o[s].tight?\"\":\"</p>\")+(i?zO(o,s):\"\")},UO.link_open=function(o,s,i){var u=o[s].title?' title=\"'+escapeHtml(replaceEntities(o[s].title))+'\"':\"\",_=i.linkTarget?' target=\"'+i.linkTarget+'\"':\"\";return'<a href=\"'+escapeHtml(o[s].href)+'\"'+u+_+\">\"},UO.link_close=function(){return\"</a>\"},UO.image=function(o,s,i){var u=' src=\"'+escapeHtml(o[s].src)+'\"',_=o[s].title?' title=\"'+escapeHtml(replaceEntities(o[s].title))+'\"':\"\";return\"<img\"+u+(' alt=\"'+(o[s].alt?escapeHtml(replaceEntities(unescapeMd(o[s].alt))):\"\")+'\"')+_+(i.xhtmlOut?\" /\":\"\")+\">\"},UO.table_open=function(){return\"<table>\\n\"},UO.table_close=function(){return\"</table>\\n\"},UO.thead_open=function(){return\"<thead>\\n\"},UO.thead_close=function(){return\"</thead>\\n\"},UO.tbody_open=function(){return\"<tbody>\\n\"},UO.tbody_close=function(){return\"</tbody>\\n\"},UO.tr_open=function(){return\"<tr>\"},UO.tr_close=function(){return\"</tr>\\n\"},UO.th_open=function(o,s){var i=o[s];return\"<th\"+(i.align?' style=\"text-align:'+i.align+'\"':\"\")+\">\"},UO.th_close=function(){return\"</th>\"},UO.td_open=function(o,s){var i=o[s];return\"<td\"+(i.align?' style=\"text-align:'+i.align+'\"':\"\")+\">\"},UO.td_close=function(){return\"</td>\"},UO.strong_open=function(){return\"<strong>\"},UO.strong_close=function(){return\"</strong>\"},UO.em_open=function(){return\"<em>\"},UO.em_close=function(){return\"</em>\"},UO.del_open=function(){return\"<del>\"},UO.del_close=function(){return\"</del>\"},UO.ins_open=function(){return\"<ins>\"},UO.ins_close=function(){return\"</ins>\"},UO.mark_open=function(){return\"<mark>\"},UO.mark_close=function(){return\"</mark>\"},UO.sub=function(o,s){return\"<sub>\"+escapeHtml(o[s].content)+\"</sub>\"},UO.sup=function(o,s){return\"<sup>\"+escapeHtml(o[s].content)+\"</sup>\"},UO.hardbreak=function(o,s,i){return i.xhtmlOut?\"<br />\\n\":\"<br>\\n\"},UO.softbreak=function(o,s,i){return i.breaks?i.xhtmlOut?\"<br />\\n\":\"<br>\\n\":\"\\n\"},UO.text=function(o,s){return escapeHtml(o[s].content)},UO.htmlblock=function(o,s){return o[s].content},UO.htmltag=function(o,s){return o[s].content},UO.abbr_open=function(o,s){return'<abbr title=\"'+escapeHtml(replaceEntities(o[s].title))+'\">'},UO.abbr_close=function(){return\"</abbr>\"},UO.footnote_ref=function(o,s){var i=Number(o[s].id+1).toString(),u=\"fnref\"+i;return o[s].subId>0&&(u+=\":\"+o[s].subId),'<sup class=\"footnote-ref\"><a href=\"#fn'+i+'\" id=\"'+u+'\">['+i+\"]</a></sup>\"},UO.footnote_block_open=function(o,s,i){return(i.xhtmlOut?'<hr class=\"footnotes-sep\" />\\n':'<hr class=\"footnotes-sep\">\\n')+'<section class=\"footnotes\">\\n<ol class=\"footnotes-list\">\\n'},UO.footnote_block_close=function(){return\"</ol>\\n</section>\\n\"},UO.footnote_open=function(o,s){return'<li id=\"fn'+Number(o[s].id+1).toString()+'\"  class=\"footnote-item\">'},UO.footnote_close=function(){return\"</li>\\n\"},UO.footnote_anchor=function(o,s){var i=\"fnref\"+Number(o[s].id+1).toString();return o[s].subId>0&&(i+=\":\"+o[s].subId),' <a href=\"#'+i+'\" class=\"footnote-backref\">↩</a>'},UO.dl_open=function(){return\"<dl>\\n\"},UO.dt_open=function(){return\"<dt>\"},UO.dd_open=function(){return\"<dd>\"},UO.dl_close=function(){return\"</dl>\\n\"},UO.dt_close=function(){return\"</dt>\\n\"},UO.dd_close=function(){return\"</dd>\\n\"};var zO=UO.getBreak=function getBreak(o,s){return(s=nextToken(o,s))<o.length&&\"list_item_close\"===o[s].type?\"\":\"\\n\"};function Renderer(){this.rules=index_browser_assign({},UO),this.getBreak=UO.getBreak}function Ruler(){this.__rules__=[],this.__cache__=null}function StateInline(o,s,i,u,_){this.src=o,this.env=u,this.options=i,this.parser=s,this.tokens=_,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=\"\",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent=\"\",this.labelUnmatchedScopes=0}function parseLinkLabel(o,s){var i,u,_,w=-1,x=o.posMax,C=o.pos,j=o.isInLabel;if(o.isInLabel)return-1;if(o.labelUnmatchedScopes)return o.labelUnmatchedScopes--,-1;for(o.pos=s+1,o.isInLabel=!0,i=1;o.pos<x;){if(91===(_=o.src.charCodeAt(o.pos)))i++;else if(93===_&&0===--i){u=!0;break}o.parser.skipToken(o)}return u?(w=o.pos,o.labelUnmatchedScopes=0):o.labelUnmatchedScopes=i-1,o.pos=C,o.isInLabel=j,w}function parseAbbr(o,s,i,u){var _,w,x,C,j,L;if(42!==o.charCodeAt(0))return-1;if(91!==o.charCodeAt(1))return-1;if(-1===o.indexOf(\"]:\"))return-1;if((w=parseLinkLabel(_=new StateInline(o,s,i,u,[]),1))<0||58!==o.charCodeAt(w+1))return-1;for(C=_.posMax,x=w+2;x<C&&10!==_.src.charCodeAt(x);x++);return j=o.slice(2,w),0===(L=o.slice(w+2,x).trim()).length?-1:(u.abbreviations||(u.abbreviations={}),void 0===u.abbreviations[\":\"+j]&&(u.abbreviations[\":\"+j]=L),x)}function normalizeLink(o){var s=replaceEntities(o);try{s=decodeURI(s)}catch(o){}return encodeURI(s)}function parseLinkDestination(o,s){var i,u,_,w=s,x=o.posMax;if(60===o.src.charCodeAt(s)){for(s++;s<x;){if(10===(i=o.src.charCodeAt(s)))return!1;if(62===i)return _=normalizeLink(unescapeMd(o.src.slice(w+1,s))),!!o.parser.validateLink(_)&&(o.pos=s+1,o.linkContent=_,!0);92===i&&s+1<x?s+=2:s++}return!1}for(u=0;s<x&&32!==(i=o.src.charCodeAt(s))&&!(i<32||127===i);)if(92===i&&s+1<x)s+=2;else{if(40===i&&++u>1)break;if(41===i&&--u<0)break;s++}return w!==s&&(_=unescapeMd(o.src.slice(w,s)),!!o.parser.validateLink(_)&&(o.linkContent=_,o.pos=s,!0))}function parseLinkTitle(o,s){var i,u=s,_=o.posMax,w=o.src.charCodeAt(s);if(34!==w&&39!==w&&40!==w)return!1;for(s++,40===w&&(w=41);s<_;){if((i=o.src.charCodeAt(s))===w)return o.pos=s+1,o.linkContent=unescapeMd(o.src.slice(u+1,s)),!0;92===i&&s+1<_?s+=2:s++}return!1}function normalizeReference(o){return o.trim().replace(/\\s+/g,\" \").toUpperCase()}function parseReference(o,s,i,u){var _,w,x,C,j,L,B,$,V;if(91!==o.charCodeAt(0))return-1;if(-1===o.indexOf(\"]:\"))return-1;if((w=parseLinkLabel(_=new StateInline(o,s,i,u,[]),0))<0||58!==o.charCodeAt(w+1))return-1;for(C=_.posMax,x=w+2;x<C&&(32===(j=_.src.charCodeAt(x))||10===j);x++);if(!parseLinkDestination(_,x))return-1;for(B=_.linkContent,L=x=_.pos,x+=1;x<C&&(32===(j=_.src.charCodeAt(x))||10===j);x++);for(x<C&&L!==x&&parseLinkTitle(_,x)?($=_.linkContent,x=_.pos):($=\"\",x=L);x<C&&32===_.src.charCodeAt(x);)x++;return x<C&&10!==_.src.charCodeAt(x)?-1:(V=normalizeReference(o.slice(1,w)),void 0===u.references[V]&&(u.references[V]={title:$,href:B}),x)}Renderer.prototype.renderInline=function(o,s,i){for(var u=this.rules,_=o.length,w=0,x=\"\";_--;)x+=u[o[w].type](o,w++,s,i,this);return x},Renderer.prototype.render=function(o,s,i){for(var u=this.rules,_=o.length,w=-1,x=\"\";++w<_;)\"inline\"===o[w].type?x+=this.renderInline(o[w].children,s,i):x+=u[o[w].type](o,w,s,i,this);return x},Ruler.prototype.__find__=function(o){for(var s=this.__rules__.length,i=-1;s--;)if(this.__rules__[++i].name===o)return i;return-1},Ruler.prototype.__compile__=function(){var o=this,s=[\"\"];o.__rules__.forEach((function(o){o.enabled&&o.alt.forEach((function(o){s.indexOf(o)<0&&s.push(o)}))})),o.__cache__={},s.forEach((function(s){o.__cache__[s]=[],o.__rules__.forEach((function(i){i.enabled&&(s&&i.alt.indexOf(s)<0||o.__cache__[s].push(i.fn))}))}))},Ruler.prototype.at=function(o,s,i){var u=this.__find__(o),_=i||{};if(-1===u)throw new Error(\"Parser rule not found: \"+o);this.__rules__[u].fn=s,this.__rules__[u].alt=_.alt||[],this.__cache__=null},Ruler.prototype.before=function(o,s,i,u){var _=this.__find__(o),w=u||{};if(-1===_)throw new Error(\"Parser rule not found: \"+o);this.__rules__.splice(_,0,{name:s,enabled:!0,fn:i,alt:w.alt||[]}),this.__cache__=null},Ruler.prototype.after=function(o,s,i,u){var _=this.__find__(o),w=u||{};if(-1===_)throw new Error(\"Parser rule not found: \"+o);this.__rules__.splice(_+1,0,{name:s,enabled:!0,fn:i,alt:w.alt||[]}),this.__cache__=null},Ruler.prototype.push=function(o,s,i){var u=i||{};this.__rules__.push({name:o,enabled:!0,fn:s,alt:u.alt||[]}),this.__cache__=null},Ruler.prototype.enable=function(o,s){o=Array.isArray(o)?o:[o],s&&this.__rules__.forEach((function(o){o.enabled=!1})),o.forEach((function(o){var s=this.__find__(o);if(s<0)throw new Error(\"Rules manager: invalid rule name \"+o);this.__rules__[s].enabled=!0}),this),this.__cache__=null},Ruler.prototype.disable=function(o){(o=Array.isArray(o)?o:[o]).forEach((function(o){var s=this.__find__(o);if(s<0)throw new Error(\"Rules manager: invalid rule name \"+o);this.__rules__[s].enabled=!1}),this),this.__cache__=null},Ruler.prototype.getRules=function(o){return null===this.__cache__&&this.__compile__(),this.__cache__[o]||[]},StateInline.prototype.pushPending=function(){this.tokens.push({type:\"text\",content:this.pending,level:this.pendingLevel}),this.pending=\"\"},StateInline.prototype.push=function(o){this.pending&&this.pushPending(),this.tokens.push(o),this.pendingLevel=this.level},StateInline.prototype.cacheSet=function(o,s){for(var i=this.cache.length;i<=o;i++)this.cache.push(0);this.cache[o]=s},StateInline.prototype.cacheGet=function(o){return o<this.cache.length?this.cache[o]:0};var WO=\" \\n()[]'\\\".,!?-\";function regEscape(o){return o.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g,\"\\\\$1\")}var KO=/\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/,HO=/\\((c|tm|r|p)\\)/gi,JO={c:\"©\",r:\"®\",p:\"§\",tm:\"™\"};function replaceScopedAbbr(o){return o.indexOf(\"(\")<0?o:o.replace(HO,(function(o,s){return JO[s.toLowerCase()]}))}var GO=/['\"]/,YO=/['\"]/g,XO=/[-\\s()\\[\\]]/;function isLetter(o,s){return!(s<0||s>=o.length)&&!XO.test(o[s])}function replaceAt(o,s,i){return o.substr(0,s)+i+o.substr(s+1)}var QO=[[\"block\",function block(o){o.inlineMode?o.tokens.push({type:\"inline\",content:o.src.replace(/\\n/g,\" \").trim(),level:0,lines:[0,1],children:[]}):o.block.parse(o.src,o.options,o.env,o.tokens)}],[\"abbr\",function abbr(o){var s,i,u,_,w=o.tokens;if(!o.inlineMode)for(s=1,i=w.length-1;s<i;s++)if(\"paragraph_open\"===w[s-1].type&&\"inline\"===w[s].type&&\"paragraph_close\"===w[s+1].type){for(u=w[s].content;u.length&&!((_=parseAbbr(u,o.inline,o.options,o.env))<0);)u=u.slice(_).trim();w[s].content=u,u.length||(w[s-1].tight=!0,w[s+1].tight=!0)}}],[\"references\",function references(o){var s,i,u,_,w=o.tokens;if(o.env.references=o.env.references||{},!o.inlineMode)for(s=1,i=w.length-1;s<i;s++)if(\"inline\"===w[s].type&&\"paragraph_open\"===w[s-1].type&&\"paragraph_close\"===w[s+1].type){for(u=w[s].content;u.length&&!((_=parseReference(u,o.inline,o.options,o.env))<0);)u=u.slice(_).trim();w[s].content=u,u.length||(w[s-1].tight=!0,w[s+1].tight=!0)}}],[\"inline\",function inline(o){var s,i,u,_=o.tokens;for(i=0,u=_.length;i<u;i++)\"inline\"===(s=_[i]).type&&o.inline.parse(s.content,o.options,o.env,s.children)}],[\"footnote_tail\",function footnote_block(o){var s,i,u,_,w,x,C,j,L,B=0,$=!1,V={};if(o.env.footnotes&&(o.tokens=o.tokens.filter((function(o){return\"footnote_reference_open\"===o.type?($=!0,j=[],L=o.label,!1):\"footnote_reference_close\"===o.type?($=!1,V[\":\"+L]=j,!1):($&&j.push(o),!$)})),o.env.footnotes.list)){for(x=o.env.footnotes.list,o.tokens.push({type:\"footnote_block_open\",level:B++}),s=0,i=x.length;s<i;s++){for(o.tokens.push({type:\"footnote_open\",id:s,level:B++}),x[s].tokens?((C=[]).push({type:\"paragraph_open\",tight:!1,level:B++}),C.push({type:\"inline\",content:\"\",level:B,children:x[s].tokens}),C.push({type:\"paragraph_close\",tight:!1,level:--B})):x[s].label&&(C=V[\":\"+x[s].label]),o.tokens=o.tokens.concat(C),w=\"paragraph_close\"===o.tokens[o.tokens.length-1].type?o.tokens.pop():null,_=x[s].count>0?x[s].count:1,u=0;u<_;u++)o.tokens.push({type:\"footnote_anchor\",id:s,subId:u,level:B});w&&o.tokens.push(w),o.tokens.push({type:\"footnote_close\",level:--B})}o.tokens.push({type:\"footnote_block_close\",level:--B})}}],[\"abbr2\",function abbr2(o){var s,i,u,_,w,x,C,j,L,B,$,V,U=o.tokens;if(o.env.abbreviations)for(o.env.abbrRegExp||(V=\"(^|[\"+WO.split(\"\").map(regEscape).join(\"\")+\"])(\"+Object.keys(o.env.abbreviations).map((function(o){return o.substr(1)})).sort((function(o,s){return s.length-o.length})).map(regEscape).join(\"|\")+\")($|[\"+WO.split(\"\").map(regEscape).join(\"\")+\"])\",o.env.abbrRegExp=new RegExp(V,\"g\")),B=o.env.abbrRegExp,i=0,u=U.length;i<u;i++)if(\"inline\"===U[i].type)for(s=(_=U[i].children).length-1;s>=0;s--)if(\"text\"===(w=_[s]).type){for(j=0,x=w.content,B.lastIndex=0,L=w.level,C=[];$=B.exec(x);)B.lastIndex>j&&C.push({type:\"text\",content:x.slice(j,$.index+$[1].length),level:L}),C.push({type:\"abbr_open\",title:o.env.abbreviations[\":\"+$[2]],level:L++}),C.push({type:\"text\",content:$[2],level:L}),C.push({type:\"abbr_close\",level:--L}),j=B.lastIndex-$[3].length;C.length&&(j<x.length&&C.push({type:\"text\",content:x.slice(j),level:L}),U[i].children=_=[].concat(_.slice(0,s),C,_.slice(s+1)))}}],[\"replacements\",function index_browser_replace(o){var s,i,u,_,w;if(o.options.typographer)for(w=o.tokens.length-1;w>=0;w--)if(\"inline\"===o.tokens[w].type)for(s=(_=o.tokens[w].children).length-1;s>=0;s--)\"text\"===(i=_[s]).type&&(u=replaceScopedAbbr(u=i.content),KO.test(u)&&(u=u.replace(/\\+-/g,\"±\").replace(/\\.{2,}/g,\"…\").replace(/([?!])…/g,\"$1..\").replace(/([?!]){4,}/g,\"$1$1$1\").replace(/,{2,}/g,\",\").replace(/(^|[^-])---([^-]|$)/gm,\"$1—$2\").replace(/(^|\\s)--(\\s|$)/gm,\"$1–$2\").replace(/(^|[^-\\s])--([^-\\s]|$)/gm,\"$1–$2\")),i.content=u)}],[\"smartquotes\",function smartquotes(o){var s,i,u,_,w,x,C,j,L,B,$,V,U,z,Y,Z,ee;if(o.options.typographer)for(ee=[],Y=o.tokens.length-1;Y>=0;Y--)if(\"inline\"===o.tokens[Y].type)for(Z=o.tokens[Y].children,ee.length=0,s=0;s<Z.length;s++)if(\"text\"===(i=Z[s]).type&&!GO.test(i.text)){for(C=Z[s].level,U=ee.length-1;U>=0&&!(ee[U].level<=C);U--);ee.length=U+1,w=0,x=(u=i.content).length;e:for(;w<x&&(YO.lastIndex=w,_=YO.exec(u));)if(j=!isLetter(u,_.index-1),w=_.index+1,z=\"'\"===_[0],(L=!isLetter(u,w))||j){if($=!L,V=!j)for(U=ee.length-1;U>=0&&(B=ee[U],!(ee[U].level<C));U--)if(B.single===z&&ee[U].level===C){B=ee[U],z?(Z[B.token].content=replaceAt(Z[B.token].content,B.pos,o.options.quotes[2]),i.content=replaceAt(i.content,_.index,o.options.quotes[3])):(Z[B.token].content=replaceAt(Z[B.token].content,B.pos,o.options.quotes[0]),i.content=replaceAt(i.content,_.index,o.options.quotes[1])),ee.length=U;continue e}$?ee.push({token:s,pos:_.index,single:z,level:C}):V&&z&&(i.content=replaceAt(i.content,_.index,\"’\"))}else z&&(i.content=replaceAt(i.content,_.index,\"’\"))}}]];function Core(){this.options={},this.ruler=new Ruler;for(var o=0;o<QO.length;o++)this.ruler.push(QO[o][0],QO[o][1])}function StateBlock(o,s,i,u,_){var w,x,C,j,L,B,$;for(this.src=o,this.parser=s,this.options=i,this.env=u,this.tokens=_,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType=\"root\",this.ddIndent=-1,this.level=0,this.result=\"\",B=0,$=!1,C=j=B=0,L=(x=this.src).length;j<L;j++){if(w=x.charCodeAt(j),!$){if(32===w){B++;continue}$=!0}10!==w&&j!==L-1||(10!==w&&j++,this.bMarks.push(C),this.eMarks.push(j),this.tShift.push(B),$=!1,B=0,C=j+1)}this.bMarks.push(x.length),this.eMarks.push(x.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function skipBulletListMarker(o,s){var i,u,_;return(u=o.bMarks[s]+o.tShift[s])>=(_=o.eMarks[s])||42!==(i=o.src.charCodeAt(u++))&&45!==i&&43!==i||u<_&&32!==o.src.charCodeAt(u)?-1:u}function skipOrderedListMarker(o,s){var i,u=o.bMarks[s]+o.tShift[s],_=o.eMarks[s];if(u+1>=_)return-1;if((i=o.src.charCodeAt(u++))<48||i>57)return-1;for(;;){if(u>=_)return-1;if(!((i=o.src.charCodeAt(u++))>=48&&i<=57)){if(41===i||46===i)break;return-1}}return u<_&&32!==o.src.charCodeAt(u)?-1:u}Core.prototype.process=function(o){var s,i,u;for(s=0,i=(u=this.ruler.getRules(\"\")).length;s<i;s++)u[s](o)},StateBlock.prototype.isEmpty=function isEmpty(o){return this.bMarks[o]+this.tShift[o]>=this.eMarks[o]},StateBlock.prototype.skipEmptyLines=function skipEmptyLines(o){for(var s=this.lineMax;o<s&&!(this.bMarks[o]+this.tShift[o]<this.eMarks[o]);o++);return o},StateBlock.prototype.skipSpaces=function skipSpaces(o){for(var s=this.src.length;o<s&&32===this.src.charCodeAt(o);o++);return o},StateBlock.prototype.skipChars=function skipChars(o,s){for(var i=this.src.length;o<i&&this.src.charCodeAt(o)===s;o++);return o},StateBlock.prototype.skipCharsBack=function skipCharsBack(o,s,i){if(o<=i)return o;for(;o>i;)if(s!==this.src.charCodeAt(--o))return o+1;return o},StateBlock.prototype.getLines=function getLines(o,s,i,u){var _,w,x,C,j,L=o;if(o>=s)return\"\";if(L+1===s)return w=this.bMarks[L]+Math.min(this.tShift[L],i),x=u?this.eMarks[L]+1:this.eMarks[L],this.src.slice(w,x);for(C=new Array(s-o),_=0;L<s;L++,_++)(j=this.tShift[L])>i&&(j=i),j<0&&(j=0),w=this.bMarks[L]+j,x=L+1<s||u?this.eMarks[L]+1:this.eMarks[L],C[_]=this.src.slice(w,x);return C.join(\"\")};var ZO={};[\"article\",\"aside\",\"button\",\"blockquote\",\"body\",\"canvas\",\"caption\",\"col\",\"colgroup\",\"dd\",\"div\",\"dl\",\"dt\",\"embed\",\"fieldset\",\"figcaption\",\"figure\",\"footer\",\"form\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"header\",\"hgroup\",\"hr\",\"iframe\",\"li\",\"map\",\"object\",\"ol\",\"output\",\"p\",\"pre\",\"progress\",\"script\",\"section\",\"style\",\"table\",\"tbody\",\"td\",\"textarea\",\"tfoot\",\"th\",\"tr\",\"thead\",\"ul\",\"video\"].forEach((function(o){ZO[o]=!0}));var eC=/^<([a-zA-Z]{1,15})[\\s\\/>]/,tC=/^<\\/([a-zA-Z]{1,15})[\\s>]/;function index_browser_getLine(o,s){var i=o.bMarks[s]+o.blkIndent,u=o.eMarks[s];return o.src.substr(i,u-i)}function skipMarker(o,s){var i,u,_=o.bMarks[s]+o.tShift[s],w=o.eMarks[s];return _>=w||126!==(u=o.src.charCodeAt(_++))&&58!==u||_===(i=o.skipSpaces(_))||i>=w?-1:i}var rC=[[\"code\",function code(o,s,i){var u,_;if(o.tShift[s]-o.blkIndent<4)return!1;for(_=u=s+1;u<i;)if(o.isEmpty(u))u++;else{if(!(o.tShift[u]-o.blkIndent>=4))break;_=++u}return o.line=u,o.tokens.push({type:\"code\",content:o.getLines(s,_,4+o.blkIndent,!0),block:!0,lines:[s,o.line],level:o.level}),!0}],[\"fences\",function fences(o,s,i,u){var _,w,x,C,j,L=!1,B=o.bMarks[s]+o.tShift[s],$=o.eMarks[s];if(B+3>$)return!1;if(126!==(_=o.src.charCodeAt(B))&&96!==_)return!1;if(j=B,(w=(B=o.skipChars(B,_))-j)<3)return!1;if((x=o.src.slice(B,$).trim()).indexOf(\"`\")>=0)return!1;if(u)return!0;for(C=s;!(++C>=i)&&!((B=j=o.bMarks[C]+o.tShift[C])<($=o.eMarks[C])&&o.tShift[C]<o.blkIndent);)if(o.src.charCodeAt(B)===_&&!(o.tShift[C]-o.blkIndent>=4||(B=o.skipChars(B,_))-j<w||(B=o.skipSpaces(B))<$)){L=!0;break}return w=o.tShift[s],o.line=C+(L?1:0),o.tokens.push({type:\"fence\",params:x,content:o.getLines(s+1,C,w,!0),lines:[s,o.line],level:o.level}),!0},[\"paragraph\",\"blockquote\",\"list\"]],[\"blockquote\",function blockquote(o,s,i,u){var _,w,x,C,j,L,B,$,V,U,z,Y=o.bMarks[s]+o.tShift[s],Z=o.eMarks[s];if(Y>Z)return!1;if(62!==o.src.charCodeAt(Y++))return!1;if(o.level>=o.options.maxNesting)return!1;if(u)return!0;for(32===o.src.charCodeAt(Y)&&Y++,j=o.blkIndent,o.blkIndent=0,C=[o.bMarks[s]],o.bMarks[s]=Y,w=(Y=Y<Z?o.skipSpaces(Y):Y)>=Z,x=[o.tShift[s]],o.tShift[s]=Y-o.bMarks[s],$=o.parser.ruler.getRules(\"blockquote\"),_=s+1;_<i&&!((Y=o.bMarks[_]+o.tShift[_])>=(Z=o.eMarks[_]));_++)if(62!==o.src.charCodeAt(Y++)){if(w)break;for(z=!1,V=0,U=$.length;V<U;V++)if($[V](o,_,i,!0)){z=!0;break}if(z)break;C.push(o.bMarks[_]),x.push(o.tShift[_]),o.tShift[_]=-1337}else 32===o.src.charCodeAt(Y)&&Y++,C.push(o.bMarks[_]),o.bMarks[_]=Y,w=(Y=Y<Z?o.skipSpaces(Y):Y)>=Z,x.push(o.tShift[_]),o.tShift[_]=Y-o.bMarks[_];for(L=o.parentType,o.parentType=\"blockquote\",o.tokens.push({type:\"blockquote_open\",lines:B=[s,0],level:o.level++}),o.parser.tokenize(o,s,_),o.tokens.push({type:\"blockquote_close\",level:--o.level}),o.parentType=L,B[1]=o.line,V=0;V<x.length;V++)o.bMarks[V+s]=C[V],o.tShift[V+s]=x[V];return o.blkIndent=j,!0},[\"paragraph\",\"blockquote\",\"list\"]],[\"hr\",function hr(o,s,i,u){var _,w,x,C=o.bMarks[s],j=o.eMarks[s];if((C+=o.tShift[s])>j)return!1;if(42!==(_=o.src.charCodeAt(C++))&&45!==_&&95!==_)return!1;for(w=1;C<j;){if((x=o.src.charCodeAt(C++))!==_&&32!==x)return!1;x===_&&w++}return!(w<3)&&(u||(o.line=s+1,o.tokens.push({type:\"hr\",lines:[s,o.line],level:o.level})),!0)},[\"paragraph\",\"blockquote\",\"list\"]],[\"list\",function index_browser_list(o,s,i,u){var _,w,x,C,j,L,B,$,V,U,z,Y,Z,ee,ie,ae,ce,le,pe,de,fe,ye=!0;if(($=skipOrderedListMarker(o,s))>=0)Y=!0;else{if(!(($=skipBulletListMarker(o,s))>=0))return!1;Y=!1}if(o.level>=o.options.maxNesting)return!1;if(z=o.src.charCodeAt($-1),u)return!0;for(ee=o.tokens.length,Y?(B=o.bMarks[s]+o.tShift[s],U=Number(o.src.substr(B,$-B-1)),o.tokens.push({type:\"ordered_list_open\",order:U,lines:ae=[s,0],level:o.level++})):o.tokens.push({type:\"bullet_list_open\",lines:ae=[s,0],level:o.level++}),_=s,ie=!1,le=o.parser.ruler.getRules(\"list\");!(!(_<i)||((V=(Z=o.skipSpaces($))>=o.eMarks[_]?1:Z-$)>4&&(V=1),V<1&&(V=1),w=$-o.bMarks[_]+V,o.tokens.push({type:\"list_item_open\",lines:ce=[s,0],level:o.level++}),C=o.blkIndent,j=o.tight,x=o.tShift[s],L=o.parentType,o.tShift[s]=Z-o.bMarks[s],o.blkIndent=w,o.tight=!0,o.parentType=\"list\",o.parser.tokenize(o,s,i,!0),o.tight&&!ie||(ye=!1),ie=o.line-s>1&&o.isEmpty(o.line-1),o.blkIndent=C,o.tShift[s]=x,o.tight=j,o.parentType=L,o.tokens.push({type:\"list_item_close\",level:--o.level}),_=s=o.line,ce[1]=_,Z=o.bMarks[s],_>=i)||o.isEmpty(_)||o.tShift[_]<o.blkIndent);){for(fe=!1,pe=0,de=le.length;pe<de;pe++)if(le[pe](o,_,i,!0)){fe=!0;break}if(fe)break;if(Y){if(($=skipOrderedListMarker(o,_))<0)break}else if(($=skipBulletListMarker(o,_))<0)break;if(z!==o.src.charCodeAt($-1))break}return o.tokens.push({type:Y?\"ordered_list_close\":\"bullet_list_close\",level:--o.level}),ae[1]=_,o.line=_,ye&&function markTightParagraphs(o,s){var i,u,_=o.level+2;for(i=s+2,u=o.tokens.length-2;i<u;i++)o.tokens[i].level===_&&\"paragraph_open\"===o.tokens[i].type&&(o.tokens[i+2].tight=!0,o.tokens[i].tight=!0,i+=2)}(o,ee),!0},[\"paragraph\",\"blockquote\"]],[\"footnote\",function footnote(o,s,i,u){var _,w,x,C,j,L=o.bMarks[s]+o.tShift[s],B=o.eMarks[s];if(L+4>B)return!1;if(91!==o.src.charCodeAt(L))return!1;if(94!==o.src.charCodeAt(L+1))return!1;if(o.level>=o.options.maxNesting)return!1;for(C=L+2;C<B;C++){if(32===o.src.charCodeAt(C))return!1;if(93===o.src.charCodeAt(C))break}return C!==L+2&&(!(C+1>=B||58!==o.src.charCodeAt(++C))&&(u||(C++,o.env.footnotes||(o.env.footnotes={}),o.env.footnotes.refs||(o.env.footnotes.refs={}),j=o.src.slice(L+2,C-2),o.env.footnotes.refs[\":\"+j]=-1,o.tokens.push({type:\"footnote_reference_open\",label:j,level:o.level++}),_=o.bMarks[s],w=o.tShift[s],x=o.parentType,o.tShift[s]=o.skipSpaces(C)-C,o.bMarks[s]=C,o.blkIndent+=4,o.parentType=\"footnote\",o.tShift[s]<o.blkIndent&&(o.tShift[s]+=o.blkIndent,o.bMarks[s]-=o.blkIndent),o.parser.tokenize(o,s,i,!0),o.parentType=x,o.blkIndent-=4,o.tShift[s]=w,o.bMarks[s]=_,o.tokens.push({type:\"footnote_reference_close\",level:--o.level})),!0))},[\"paragraph\"]],[\"heading\",function heading(o,s,i,u){var _,w,x,C=o.bMarks[s]+o.tShift[s],j=o.eMarks[s];if(C>=j)return!1;if(35!==(_=o.src.charCodeAt(C))||C>=j)return!1;for(w=1,_=o.src.charCodeAt(++C);35===_&&C<j&&w<=6;)w++,_=o.src.charCodeAt(++C);return!(w>6||C<j&&32!==_)&&(u||(j=o.skipCharsBack(j,32,C),(x=o.skipCharsBack(j,35,C))>C&&32===o.src.charCodeAt(x-1)&&(j=x),o.line=s+1,o.tokens.push({type:\"heading_open\",hLevel:w,lines:[s,o.line],level:o.level}),C<j&&o.tokens.push({type:\"inline\",content:o.src.slice(C,j).trim(),level:o.level+1,lines:[s,o.line],children:[]}),o.tokens.push({type:\"heading_close\",hLevel:w,level:o.level})),!0)},[\"paragraph\",\"blockquote\"]],[\"lheading\",function lheading(o,s,i){var u,_,w,x=s+1;return!(x>=i)&&(!(o.tShift[x]<o.blkIndent)&&(!(o.tShift[x]-o.blkIndent>3)&&(!((_=o.bMarks[x]+o.tShift[x])>=(w=o.eMarks[x]))&&((45===(u=o.src.charCodeAt(_))||61===u)&&(_=o.skipChars(_,u),!((_=o.skipSpaces(_))<w)&&(_=o.bMarks[s]+o.tShift[s],o.line=x+1,o.tokens.push({type:\"heading_open\",hLevel:61===u?1:2,lines:[s,o.line],level:o.level}),o.tokens.push({type:\"inline\",content:o.src.slice(_,o.eMarks[s]).trim(),level:o.level+1,lines:[s,o.line-1],children:[]}),o.tokens.push({type:\"heading_close\",hLevel:61===u?1:2,level:o.level}),!0))))))}],[\"htmlblock\",function htmlblock(o,s,i,u){var _,w,x,C=o.bMarks[s],j=o.eMarks[s],L=o.tShift[s];if(C+=L,!o.options.html)return!1;if(L>3||C+2>=j)return!1;if(60!==o.src.charCodeAt(C))return!1;if(33===(_=o.src.charCodeAt(C+1))||63===_){if(u)return!0}else{if(47!==_&&!function isLetter$1(o){var s=32|o;return s>=97&&s<=122}(_))return!1;if(47===_){if(!(w=o.src.slice(C,j).match(tC)))return!1}else if(!(w=o.src.slice(C,j).match(eC)))return!1;if(!0!==ZO[w[1].toLowerCase()])return!1;if(u)return!0}for(x=s+1;x<o.lineMax&&!o.isEmpty(x);)x++;return o.line=x,o.tokens.push({type:\"htmlblock\",level:o.level,lines:[s,o.line],content:o.getLines(s,x,0,!0)}),!0},[\"paragraph\",\"blockquote\"]],[\"table\",function table(o,s,i,u){var _,w,x,C,j,L,B,$,V,U,z;if(s+2>i)return!1;if(j=s+1,o.tShift[j]<o.blkIndent)return!1;if((x=o.bMarks[j]+o.tShift[j])>=o.eMarks[j])return!1;if(124!==(_=o.src.charCodeAt(x))&&45!==_&&58!==_)return!1;if(w=index_browser_getLine(o,s+1),!/^[-:| ]+$/.test(w))return!1;if((L=w.split(\"|\"))<=2)return!1;for($=[],C=0;C<L.length;C++){if(!(V=L[C].trim())){if(0===C||C===L.length-1)continue;return!1}if(!/^:?-+:?$/.test(V))return!1;58===V.charCodeAt(V.length-1)?$.push(58===V.charCodeAt(0)?\"center\":\"right\"):58===V.charCodeAt(0)?$.push(\"left\"):$.push(\"\")}if(-1===(w=index_browser_getLine(o,s).trim()).indexOf(\"|\"))return!1;if(L=w.replace(/^\\||\\|$/g,\"\").split(\"|\"),$.length!==L.length)return!1;if(u)return!0;for(o.tokens.push({type:\"table_open\",lines:U=[s,0],level:o.level++}),o.tokens.push({type:\"thead_open\",lines:[s,s+1],level:o.level++}),o.tokens.push({type:\"tr_open\",lines:[s,s+1],level:o.level++}),C=0;C<L.length;C++)o.tokens.push({type:\"th_open\",align:$[C],lines:[s,s+1],level:o.level++}),o.tokens.push({type:\"inline\",content:L[C].trim(),lines:[s,s+1],level:o.level,children:[]}),o.tokens.push({type:\"th_close\",level:--o.level});for(o.tokens.push({type:\"tr_close\",level:--o.level}),o.tokens.push({type:\"thead_close\",level:--o.level}),o.tokens.push({type:\"tbody_open\",lines:z=[s+2,0],level:o.level++}),j=s+2;j<i&&!(o.tShift[j]<o.blkIndent)&&-1!==(w=index_browser_getLine(o,j).trim()).indexOf(\"|\");j++){for(L=w.replace(/^\\||\\|$/g,\"\").split(\"|\"),o.tokens.push({type:\"tr_open\",level:o.level++}),C=0;C<L.length;C++)o.tokens.push({type:\"td_open\",align:$[C],level:o.level++}),B=L[C].substring(124===L[C].charCodeAt(0)?1:0,124===L[C].charCodeAt(L[C].length-1)?L[C].length-1:L[C].length).trim(),o.tokens.push({type:\"inline\",content:B,level:o.level,children:[]}),o.tokens.push({type:\"td_close\",level:--o.level});o.tokens.push({type:\"tr_close\",level:--o.level})}return o.tokens.push({type:\"tbody_close\",level:--o.level}),o.tokens.push({type:\"table_close\",level:--o.level}),U[1]=z[1]=j,o.line=j,!0},[\"paragraph\"]],[\"deflist\",function deflist(o,s,i,u){var _,w,x,C,j,L,B,$,V,U,z,Y,Z,ee;if(u)return!(o.ddIndent<0)&&skipMarker(o,s)>=0;if(B=s+1,o.isEmpty(B)&&++B>i)return!1;if(o.tShift[B]<o.blkIndent)return!1;if((_=skipMarker(o,B))<0)return!1;if(o.level>=o.options.maxNesting)return!1;L=o.tokens.length,o.tokens.push({type:\"dl_open\",lines:j=[s,0],level:o.level++}),x=s,w=B;e:for(;;){for(ee=!0,Z=!1,o.tokens.push({type:\"dt_open\",lines:[x,x],level:o.level++}),o.tokens.push({type:\"inline\",content:o.getLines(x,x+1,o.blkIndent,!1).trim(),level:o.level+1,lines:[x,x],children:[]}),o.tokens.push({type:\"dt_close\",level:--o.level});;){if(o.tokens.push({type:\"dd_open\",lines:C=[B,0],level:o.level++}),Y=o.tight,V=o.ddIndent,$=o.blkIndent,z=o.tShift[w],U=o.parentType,o.blkIndent=o.ddIndent=o.tShift[w]+2,o.tShift[w]=_-o.bMarks[w],o.tight=!0,o.parentType=\"deflist\",o.parser.tokenize(o,w,i,!0),o.tight&&!Z||(ee=!1),Z=o.line-w>1&&o.isEmpty(o.line-1),o.tShift[w]=z,o.tight=Y,o.parentType=U,o.blkIndent=$,o.ddIndent=V,o.tokens.push({type:\"dd_close\",level:--o.level}),C[1]=B=o.line,B>=i)break e;if(o.tShift[B]<o.blkIndent)break e;if((_=skipMarker(o,B))<0)break;w=B}if(B>=i)break;if(x=B,o.isEmpty(x))break;if(o.tShift[x]<o.blkIndent)break;if((w=x+1)>=i)break;if(o.isEmpty(w)&&w++,w>=i)break;if(o.tShift[w]<o.blkIndent)break;if((_=skipMarker(o,w))<0)break}return o.tokens.push({type:\"dl_close\",level:--o.level}),j[1]=B,o.line=B,ee&&function markTightParagraphs$1(o,s){var i,u,_=o.level+2;for(i=s+2,u=o.tokens.length-2;i<u;i++)o.tokens[i].level===_&&\"paragraph_open\"===o.tokens[i].type&&(o.tokens[i+2].tight=!0,o.tokens[i].tight=!0,i+=2)}(o,L),!0},[\"paragraph\"]],[\"paragraph\",function paragraph(o,s){var i,u,_,w,x,C,j=s+1;if(j<(i=o.lineMax)&&!o.isEmpty(j))for(C=o.parser.ruler.getRules(\"paragraph\");j<i&&!o.isEmpty(j);j++)if(!(o.tShift[j]-o.blkIndent>3)){for(_=!1,w=0,x=C.length;w<x;w++)if(C[w](o,j,i,!0)){_=!0;break}if(_)break}return u=o.getLines(s,j,o.blkIndent,!1).trim(),o.line=j,u.length&&(o.tokens.push({type:\"paragraph_open\",tight:!1,lines:[s,o.line],level:o.level}),o.tokens.push({type:\"inline\",content:u,level:o.level+1,lines:[s,o.line],children:[]}),o.tokens.push({type:\"paragraph_close\",tight:!1,level:o.level})),!0}]];function ParserBlock(){this.ruler=new Ruler;for(var o=0;o<rC.length;o++)this.ruler.push(rC[o][0],rC[o][1],{alt:(rC[o][2]||[]).slice()})}ParserBlock.prototype.tokenize=function(o,s,i){for(var u,_=this.ruler.getRules(\"\"),w=_.length,x=s,C=!1;x<i&&(o.line=x=o.skipEmptyLines(x),!(x>=i))&&!(o.tShift[x]<o.blkIndent);){for(u=0;u<w&&!_[u](o,x,i,!1);u++);if(o.tight=!C,o.isEmpty(o.line-1)&&(C=!0),(x=o.line)<i&&o.isEmpty(x)){if(C=!0,++x<i&&\"list\"===o.parentType&&o.isEmpty(x))break;o.line=x}}};var nC=/[\\n\\t]/g,oC=/\\r[\\n\\u0085]|[\\u2424\\u2028\\u0085]/g,sC=/\\u00a0/g;function isTerminatorChar(o){switch(o){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}ParserBlock.prototype.parse=function(o,s,i,u){var _,w=0,x=0;if(!o)return[];(o=(o=o.replace(sC,\" \")).replace(oC,\"\\n\")).indexOf(\"\\t\")>=0&&(o=o.replace(nC,(function(s,i){var u;return 10===o.charCodeAt(i)?(w=i+1,x=0,s):(u=\"    \".slice((i-w-x)%4),x=i-w+1,u)}))),_=new StateBlock(o,this,s,i,u),this.tokenize(_,_.line,_.lineMax)};for(var iC=[],aC=0;aC<256;aC++)iC.push(0);function isAlphaNum(o){return o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122}function scanDelims(o,s){var i,u,_,w=s,x=!0,C=!0,j=o.posMax,L=o.src.charCodeAt(s);for(i=s>0?o.src.charCodeAt(s-1):-1;w<j&&o.src.charCodeAt(w)===L;)w++;return w>=j&&(x=!1),(_=w-s)>=4?x=C=!1:(32!==(u=w<j?o.src.charCodeAt(w):-1)&&10!==u||(x=!1),32!==i&&10!==i||(C=!1),95===L&&(isAlphaNum(i)&&(x=!1),isAlphaNum(u)&&(C=!1))),{can_open:x,can_close:C,delims:_}}\"\\\\!\\\"#$%&'()*+,./:;<=>?@[]^_`{|}~-\".split(\"\").forEach((function(o){iC[o.charCodeAt(0)]=1}));var cC=/\\\\([ \\\\!\"#$%&'()*+,.\\/:;<=>?@[\\]^_`{|}~-])/g;var lC=/\\\\([ \\\\!\"#$%&'()*+,.\\/:;<=>?@[\\]^_`{|}~-])/g;var uC=[\"coap\",\"doi\",\"javascript\",\"aaa\",\"aaas\",\"about\",\"acap\",\"cap\",\"cid\",\"crid\",\"data\",\"dav\",\"dict\",\"dns\",\"file\",\"ftp\",\"geo\",\"go\",\"gopher\",\"h323\",\"http\",\"https\",\"iax\",\"icap\",\"im\",\"imap\",\"info\",\"ipp\",\"iris\",\"iris.beep\",\"iris.xpc\",\"iris.xpcs\",\"iris.lwz\",\"ldap\",\"mailto\",\"mid\",\"msrp\",\"msrps\",\"mtqp\",\"mupdate\",\"news\",\"nfs\",\"ni\",\"nih\",\"nntp\",\"opaquelocktoken\",\"pop\",\"pres\",\"rtsp\",\"service\",\"session\",\"shttp\",\"sieve\",\"sip\",\"sips\",\"sms\",\"snmp\",\"soap.beep\",\"soap.beeps\",\"tag\",\"tel\",\"telnet\",\"tftp\",\"thismessage\",\"tn3270\",\"tip\",\"tv\",\"urn\",\"vemmi\",\"ws\",\"wss\",\"xcon\",\"xcon-userid\",\"xmlrpc.beep\",\"xmlrpc.beeps\",\"xmpp\",\"z39.50r\",\"z39.50s\",\"adiumxtra\",\"afp\",\"afs\",\"aim\",\"apt\",\"attachment\",\"aw\",\"beshare\",\"bitcoin\",\"bolo\",\"callto\",\"chrome\",\"chrome-extension\",\"com-eventbrite-attendee\",\"content\",\"cvs\",\"dlna-playsingle\",\"dlna-playcontainer\",\"dtn\",\"dvb\",\"ed2k\",\"facetime\",\"feed\",\"finger\",\"fish\",\"gg\",\"git\",\"gizmoproject\",\"gtalk\",\"hcp\",\"icon\",\"ipn\",\"irc\",\"irc6\",\"ircs\",\"itms\",\"jar\",\"jms\",\"keyparc\",\"lastfm\",\"ldaps\",\"magnet\",\"maps\",\"market\",\"message\",\"mms\",\"ms-help\",\"msnim\",\"mumble\",\"mvn\",\"notes\",\"oid\",\"palm\",\"paparazzi\",\"platform\",\"proxy\",\"psyc\",\"query\",\"res\",\"resource\",\"rmi\",\"rsync\",\"rtmp\",\"secondlife\",\"sftp\",\"sgn\",\"skype\",\"smb\",\"soldat\",\"spotify\",\"ssh\",\"steam\",\"svn\",\"teamspeak\",\"things\",\"udp\",\"unreal\",\"ut2004\",\"ventrilo\",\"view-source\",\"webcal\",\"wtai\",\"wyciwyg\",\"xfire\",\"xri\",\"ymsgr\"],pC=/^<([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])?)*)>/,hC=/^<([a-zA-Z.\\-]{1,25}):([^<>\\x00-\\x20]*)>/;function replace$1(o,s){return o=o.source,s=s||\"\",function self(i,u){return i?(u=u.source||u,o=o.replace(i,u),self):new RegExp(o,s)}}var dC=replace$1(/(?:unquoted|single_quoted|double_quoted)/)(\"unquoted\",/[^\"'=<>`\\x00-\\x20]+/)(\"single_quoted\",/'[^']*'/)(\"double_quoted\",/\"[^\"]*\"/)(),fC=replace$1(/(?:\\s+attr_name(?:\\s*=\\s*attr_value)?)/)(\"attr_name\",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)(\"attr_value\",dC)(),mC=replace$1(/<[A-Za-z][A-Za-z0-9]*attribute*\\s*\\/?>/)(\"attribute\",fC)(),gC=replace$1(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)(\"open_tag\",mC)(\"close_tag\",/<\\/[A-Za-z][A-Za-z0-9]*\\s*>/)(\"comment\",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)(\"processing\",/<[?].*?[?]>/)(\"declaration\",/<![A-Z]+\\s+[^>]*>/)(\"cdata\",/<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/)();var yC=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,vC=/^&([a-z][a-z0-9]{1,31});/i;var bC=[[\"text\",function index_browser_text(o,s){for(var i=o.pos;i<o.posMax&&!isTerminatorChar(o.src.charCodeAt(i));)i++;return i!==o.pos&&(s||(o.pending+=o.src.slice(o.pos,i)),o.pos=i,!0)}],[\"newline\",function newline(o,s){var i,u,_=o.pos;if(10!==o.src.charCodeAt(_))return!1;if(i=o.pending.length-1,u=o.posMax,!s)if(i>=0&&32===o.pending.charCodeAt(i))if(i>=1&&32===o.pending.charCodeAt(i-1)){for(var w=i-2;w>=0;w--)if(32!==o.pending.charCodeAt(w)){o.pending=o.pending.substring(0,w+1);break}o.push({type:\"hardbreak\",level:o.level})}else o.pending=o.pending.slice(0,-1),o.push({type:\"softbreak\",level:o.level});else o.push({type:\"softbreak\",level:o.level});for(_++;_<u&&32===o.src.charCodeAt(_);)_++;return o.pos=_,!0}],[\"escape\",function index_browser_escape(o,s){var i,u=o.pos,_=o.posMax;if(92!==o.src.charCodeAt(u))return!1;if(++u<_){if((i=o.src.charCodeAt(u))<256&&0!==iC[i])return s||(o.pending+=o.src[u]),o.pos+=2,!0;if(10===i){for(s||o.push({type:\"hardbreak\",level:o.level}),u++;u<_&&32===o.src.charCodeAt(u);)u++;return o.pos=u,!0}}return s||(o.pending+=\"\\\\\"),o.pos++,!0}],[\"backticks\",function backticks(o,s){var i,u,_,w,x,C=o.pos;if(96!==o.src.charCodeAt(C))return!1;for(i=C,C++,u=o.posMax;C<u&&96===o.src.charCodeAt(C);)C++;for(_=o.src.slice(i,C),w=x=C;-1!==(w=o.src.indexOf(\"`\",x));){for(x=w+1;x<u&&96===o.src.charCodeAt(x);)x++;if(x-w===_.length)return s||o.push({type:\"code\",content:o.src.slice(C,w).replace(/[ \\n]+/g,\" \").trim(),block:!1,level:o.level}),o.pos=x,!0}return s||(o.pending+=_),o.pos+=_.length,!0}],[\"del\",function del(o,s){var i,u,_,w,x,C=o.posMax,j=o.pos;if(126!==o.src.charCodeAt(j))return!1;if(s)return!1;if(j+4>=C)return!1;if(126!==o.src.charCodeAt(j+1))return!1;if(o.level>=o.options.maxNesting)return!1;if(w=j>0?o.src.charCodeAt(j-1):-1,x=o.src.charCodeAt(j+2),126===w)return!1;if(126===x)return!1;if(32===x||10===x)return!1;for(u=j+2;u<C&&126===o.src.charCodeAt(u);)u++;if(u>j+3)return o.pos+=u-j,s||(o.pending+=o.src.slice(j,u)),!0;for(o.pos=j+2,_=1;o.pos+1<C;){if(126===o.src.charCodeAt(o.pos)&&126===o.src.charCodeAt(o.pos+1)&&(w=o.src.charCodeAt(o.pos-1),126!==(x=o.pos+2<C?o.src.charCodeAt(o.pos+2):-1)&&126!==w&&(32!==w&&10!==w?_--:32!==x&&10!==x&&_++,_<=0))){i=!0;break}o.parser.skipToken(o)}return i?(o.posMax=o.pos,o.pos=j+2,s||(o.push({type:\"del_open\",level:o.level++}),o.parser.tokenize(o),o.push({type:\"del_close\",level:--o.level})),o.pos=o.posMax+2,o.posMax=C,!0):(o.pos=j,!1)}],[\"ins\",function ins(o,s){var i,u,_,w,x,C=o.posMax,j=o.pos;if(43!==o.src.charCodeAt(j))return!1;if(s)return!1;if(j+4>=C)return!1;if(43!==o.src.charCodeAt(j+1))return!1;if(o.level>=o.options.maxNesting)return!1;if(w=j>0?o.src.charCodeAt(j-1):-1,x=o.src.charCodeAt(j+2),43===w)return!1;if(43===x)return!1;if(32===x||10===x)return!1;for(u=j+2;u<C&&43===o.src.charCodeAt(u);)u++;if(u!==j+2)return o.pos+=u-j,s||(o.pending+=o.src.slice(j,u)),!0;for(o.pos=j+2,_=1;o.pos+1<C;){if(43===o.src.charCodeAt(o.pos)&&43===o.src.charCodeAt(o.pos+1)&&(w=o.src.charCodeAt(o.pos-1),43!==(x=o.pos+2<C?o.src.charCodeAt(o.pos+2):-1)&&43!==w&&(32!==w&&10!==w?_--:32!==x&&10!==x&&_++,_<=0))){i=!0;break}o.parser.skipToken(o)}return i?(o.posMax=o.pos,o.pos=j+2,s||(o.push({type:\"ins_open\",level:o.level++}),o.parser.tokenize(o),o.push({type:\"ins_close\",level:--o.level})),o.pos=o.posMax+2,o.posMax=C,!0):(o.pos=j,!1)}],[\"mark\",function mark(o,s){var i,u,_,w,x,C=o.posMax,j=o.pos;if(61!==o.src.charCodeAt(j))return!1;if(s)return!1;if(j+4>=C)return!1;if(61!==o.src.charCodeAt(j+1))return!1;if(o.level>=o.options.maxNesting)return!1;if(w=j>0?o.src.charCodeAt(j-1):-1,x=o.src.charCodeAt(j+2),61===w)return!1;if(61===x)return!1;if(32===x||10===x)return!1;for(u=j+2;u<C&&61===o.src.charCodeAt(u);)u++;if(u!==j+2)return o.pos+=u-j,s||(o.pending+=o.src.slice(j,u)),!0;for(o.pos=j+2,_=1;o.pos+1<C;){if(61===o.src.charCodeAt(o.pos)&&61===o.src.charCodeAt(o.pos+1)&&(w=o.src.charCodeAt(o.pos-1),61!==(x=o.pos+2<C?o.src.charCodeAt(o.pos+2):-1)&&61!==w&&(32!==w&&10!==w?_--:32!==x&&10!==x&&_++,_<=0))){i=!0;break}o.parser.skipToken(o)}return i?(o.posMax=o.pos,o.pos=j+2,s||(o.push({type:\"mark_open\",level:o.level++}),o.parser.tokenize(o),o.push({type:\"mark_close\",level:--o.level})),o.pos=o.posMax+2,o.posMax=C,!0):(o.pos=j,!1)}],[\"emphasis\",function emphasis(o,s){var i,u,_,w,x,C,j,L=o.posMax,B=o.pos,$=o.src.charCodeAt(B);if(95!==$&&42!==$)return!1;if(s)return!1;if(i=(j=scanDelims(o,B)).delims,!j.can_open)return o.pos+=i,s||(o.pending+=o.src.slice(B,o.pos)),!0;if(o.level>=o.options.maxNesting)return!1;for(o.pos=B+i,C=[i];o.pos<L;)if(o.src.charCodeAt(o.pos)!==$)o.parser.skipToken(o);else{if(u=(j=scanDelims(o,o.pos)).delims,j.can_close){for(w=C.pop(),x=u;w!==x;){if(x<w){C.push(w-x);break}if(x-=w,0===C.length)break;o.pos+=w,w=C.pop()}if(0===C.length){i=w,_=!0;break}o.pos+=u;continue}j.can_open&&C.push(u),o.pos+=u}return _?(o.posMax=o.pos,o.pos=B+i,s||(2!==i&&3!==i||o.push({type:\"strong_open\",level:o.level++}),1!==i&&3!==i||o.push({type:\"em_open\",level:o.level++}),o.parser.tokenize(o),1!==i&&3!==i||o.push({type:\"em_close\",level:--o.level}),2!==i&&3!==i||o.push({type:\"strong_close\",level:--o.level})),o.pos=o.posMax+i,o.posMax=L,!0):(o.pos=B,!1)}],[\"sub\",function sub(o,s){var i,u,_=o.posMax,w=o.pos;if(126!==o.src.charCodeAt(w))return!1;if(s)return!1;if(w+2>=_)return!1;if(o.level>=o.options.maxNesting)return!1;for(o.pos=w+1;o.pos<_;){if(126===o.src.charCodeAt(o.pos)){i=!0;break}o.parser.skipToken(o)}return i&&w+1!==o.pos?(u=o.src.slice(w+1,o.pos)).match(/(^|[^\\\\])(\\\\\\\\)*\\s/)?(o.pos=w,!1):(o.posMax=o.pos,o.pos=w+1,s||o.push({type:\"sub\",level:o.level,content:u.replace(cC,\"$1\")}),o.pos=o.posMax+1,o.posMax=_,!0):(o.pos=w,!1)}],[\"sup\",function sup(o,s){var i,u,_=o.posMax,w=o.pos;if(94!==o.src.charCodeAt(w))return!1;if(s)return!1;if(w+2>=_)return!1;if(o.level>=o.options.maxNesting)return!1;for(o.pos=w+1;o.pos<_;){if(94===o.src.charCodeAt(o.pos)){i=!0;break}o.parser.skipToken(o)}return i&&w+1!==o.pos?(u=o.src.slice(w+1,o.pos)).match(/(^|[^\\\\])(\\\\\\\\)*\\s/)?(o.pos=w,!1):(o.posMax=o.pos,o.pos=w+1,s||o.push({type:\"sup\",level:o.level,content:u.replace(lC,\"$1\")}),o.pos=o.posMax+1,o.posMax=_,!0):(o.pos=w,!1)}],[\"links\",function links(o,s){var i,u,_,w,x,C,j,L,B=!1,$=o.pos,V=o.posMax,U=o.pos,z=o.src.charCodeAt(U);if(33===z&&(B=!0,z=o.src.charCodeAt(++U)),91!==z)return!1;if(o.level>=o.options.maxNesting)return!1;if(i=U+1,(u=parseLinkLabel(o,U))<0)return!1;if((C=u+1)<V&&40===o.src.charCodeAt(C)){for(C++;C<V&&(32===(L=o.src.charCodeAt(C))||10===L);C++);if(C>=V)return!1;for(U=C,parseLinkDestination(o,C)?(w=o.linkContent,C=o.pos):w=\"\",U=C;C<V&&(32===(L=o.src.charCodeAt(C))||10===L);C++);if(C<V&&U!==C&&parseLinkTitle(o,C))for(x=o.linkContent,C=o.pos;C<V&&(32===(L=o.src.charCodeAt(C))||10===L);C++);else x=\"\";if(C>=V||41!==o.src.charCodeAt(C))return o.pos=$,!1;C++}else{if(o.linkLevel>0)return!1;for(;C<V&&(32===(L=o.src.charCodeAt(C))||10===L);C++);if(C<V&&91===o.src.charCodeAt(C)&&(U=C+1,(C=parseLinkLabel(o,C))>=0?_=o.src.slice(U,C++):C=U-1),_||(void 0===_&&(C=u+1),_=o.src.slice(i,u)),!(j=o.env.references[normalizeReference(_)]))return o.pos=$,!1;w=j.href,x=j.title}return s||(o.pos=i,o.posMax=u,B?o.push({type:\"image\",src:w,title:x,alt:o.src.substr(i,u-i),level:o.level}):(o.push({type:\"link_open\",href:w,title:x,level:o.level++}),o.linkLevel++,o.parser.tokenize(o),o.linkLevel--,o.push({type:\"link_close\",level:--o.level}))),o.pos=C,o.posMax=V,!0}],[\"footnote_inline\",function footnote_inline(o,s){var i,u,_,w,x=o.posMax,C=o.pos;return!(C+2>=x)&&(94===o.src.charCodeAt(C)&&(91===o.src.charCodeAt(C+1)&&(!(o.level>=o.options.maxNesting)&&(i=C+2,!((u=parseLinkLabel(o,C+1))<0)&&(s||(o.env.footnotes||(o.env.footnotes={}),o.env.footnotes.list||(o.env.footnotes.list=[]),_=o.env.footnotes.list.length,o.pos=i,o.posMax=u,o.push({type:\"footnote_ref\",id:_,level:o.level}),o.linkLevel++,w=o.tokens.length,o.parser.tokenize(o),o.env.footnotes.list[_]={tokens:o.tokens.splice(w)},o.linkLevel--),o.pos=u+1,o.posMax=x,!0)))))}],[\"footnote_ref\",function footnote_ref(o,s){var i,u,_,w,x=o.posMax,C=o.pos;if(C+3>x)return!1;if(!o.env.footnotes||!o.env.footnotes.refs)return!1;if(91!==o.src.charCodeAt(C))return!1;if(94!==o.src.charCodeAt(C+1))return!1;if(o.level>=o.options.maxNesting)return!1;for(u=C+2;u<x;u++){if(32===o.src.charCodeAt(u))return!1;if(10===o.src.charCodeAt(u))return!1;if(93===o.src.charCodeAt(u))break}return u!==C+2&&(!(u>=x)&&(u++,i=o.src.slice(C+2,u-1),void 0!==o.env.footnotes.refs[\":\"+i]&&(s||(o.env.footnotes.list||(o.env.footnotes.list=[]),o.env.footnotes.refs[\":\"+i]<0?(_=o.env.footnotes.list.length,o.env.footnotes.list[_]={label:i,count:0},o.env.footnotes.refs[\":\"+i]=_):_=o.env.footnotes.refs[\":\"+i],w=o.env.footnotes.list[_].count,o.env.footnotes.list[_].count++,o.push({type:\"footnote_ref\",id:_,subId:w,level:o.level})),o.pos=u,o.posMax=x,!0)))}],[\"autolink\",function autolink(o,s){var i,u,_,w,x,C=o.pos;return 60===o.src.charCodeAt(C)&&(!((i=o.src.slice(C)).indexOf(\">\")<0)&&((u=i.match(hC))?!(uC.indexOf(u[1].toLowerCase())<0)&&(x=normalizeLink(w=u[0].slice(1,-1)),!!o.parser.validateLink(w)&&(s||(o.push({type:\"link_open\",href:x,level:o.level}),o.push({type:\"text\",content:w,level:o.level+1}),o.push({type:\"link_close\",level:o.level})),o.pos+=u[0].length,!0)):!!(_=i.match(pC))&&(x=normalizeLink(\"mailto:\"+(w=_[0].slice(1,-1))),!!o.parser.validateLink(x)&&(s||(o.push({type:\"link_open\",href:x,level:o.level}),o.push({type:\"text\",content:w,level:o.level+1}),o.push({type:\"link_close\",level:o.level})),o.pos+=_[0].length,!0))))}],[\"htmltag\",function htmltag(o,s){var i,u,_,w=o.pos;return!!o.options.html&&(_=o.posMax,!(60!==o.src.charCodeAt(w)||w+2>=_)&&(!(33!==(i=o.src.charCodeAt(w+1))&&63!==i&&47!==i&&!function isLetter$2(o){var s=32|o;return s>=97&&s<=122}(i))&&(!!(u=o.src.slice(w).match(gC))&&(s||o.push({type:\"htmltag\",content:o.src.slice(w,w+u[0].length),level:o.level}),o.pos+=u[0].length,!0))))}],[\"entity\",function entity(o,s){var i,u,_=o.pos,w=o.posMax;if(38!==o.src.charCodeAt(_))return!1;if(_+1<w)if(35===o.src.charCodeAt(_+1)){if(u=o.src.slice(_).match(yC))return s||(i=\"x\"===u[1][0].toLowerCase()?parseInt(u[1].slice(1),16):parseInt(u[1],10),o.pending+=isValidEntityCode(i)?fromCodePoint(i):fromCodePoint(65533)),o.pos+=u[0].length,!0}else if(u=o.src.slice(_).match(vC)){var x=decodeEntity(u[1]);if(u[1]!==x)return s||(o.pending+=x),o.pos+=u[0].length,!0}return s||(o.pending+=\"&\"),o.pos++,!0}]];function ParserInline(){this.ruler=new Ruler;for(var o=0;o<bC.length;o++)this.ruler.push(bC[o][0],bC[o][1]);this.validateLink=validateLink}function validateLink(o){var s=o.trim().toLowerCase();return-1===(s=replaceEntities(s)).indexOf(\":\")||-1===[\"vbscript\",\"javascript\",\"file\",\"data\"].indexOf(s.split(\":\")[0])}ParserInline.prototype.skipToken=function(o){var s,i,u=this.ruler.getRules(\"\"),_=u.length,w=o.pos;if((i=o.cacheGet(w))>0)o.pos=i;else{for(s=0;s<_;s++)if(u[s](o,!0))return void o.cacheSet(w,o.pos);o.pos++,o.cacheSet(w,o.pos)}},ParserInline.prototype.tokenize=function(o){for(var s,i,u=this.ruler.getRules(\"\"),_=u.length,w=o.posMax;o.pos<w;){for(i=0;i<_&&!(s=u[i](o,!1));i++);if(s){if(o.pos>=w)break}else o.pending+=o.src[o.pos++]}o.pending&&o.pushPending()},ParserInline.prototype.parse=function(o,s,i,u){var _=new StateInline(o,this,s,i,u);this.tokenize(_)};var _C={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:\"language-\",linkTarget:\"\",typographer:!1,quotes:\"“”‘’\",highlight:null,maxNesting:20},components:{core:{rules:[\"block\",\"inline\",\"references\",\"replacements\",\"smartquotes\",\"references\",\"abbr2\",\"footnote_tail\"]},block:{rules:[\"blockquote\",\"code\",\"fences\",\"footnote\",\"heading\",\"hr\",\"htmlblock\",\"lheading\",\"list\",\"paragraph\",\"table\"]},inline:{rules:[\"autolink\",\"backticks\",\"del\",\"emphasis\",\"entity\",\"escape\",\"footnote_ref\",\"htmltag\",\"links\",\"newline\",\"text\"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:\"language-\",linkTarget:\"\",typographer:!1,quotes:\"“”‘’\",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:\"language-\",linkTarget:\"\",typographer:!1,quotes:\"“”‘’\",highlight:null,maxNesting:20},components:{core:{rules:[\"block\",\"inline\",\"references\",\"abbr2\"]},block:{rules:[\"blockquote\",\"code\",\"fences\",\"heading\",\"hr\",\"htmlblock\",\"lheading\",\"list\",\"paragraph\"]},inline:{rules:[\"autolink\",\"backticks\",\"emphasis\",\"entity\",\"escape\",\"htmltag\",\"links\",\"newline\",\"text\"]}}}};function StateCore(o,s,i){this.src=s,this.env=i,this.options=o.options,this.tokens=[],this.inlineMode=!1,this.inline=o.inline,this.block=o.block,this.renderer=o.renderer,this.typographer=o.typographer}function Remarkable(o,s){\"string\"!=typeof o&&(s=o,o=\"default\"),s&&null!=s.linkify&&console.warn(\"linkify option is removed. Use linkify plugin instead:\\n\\nimport Remarkable from 'remarkable';\\nimport linkify from 'remarkable/linkify';\\nnew Remarkable().use(linkify)\\n\"),this.inline=new ParserInline,this.block=new ParserBlock,this.core=new Core,this.renderer=new Renderer,this.ruler=new Ruler,this.options={},this.configure(_C[o]),this.set(s||{})}Remarkable.prototype.set=function(o){index_browser_assign(this.options,o)},Remarkable.prototype.configure=function(o){var s=this;if(!o)throw new Error(\"Wrong `remarkable` preset, check name/content\");o.options&&s.set(o.options),o.components&&Object.keys(o.components).forEach((function(i){o.components[i].rules&&s[i].ruler.enable(o.components[i].rules,!0)}))},Remarkable.prototype.use=function(o,s){return o(this,s),this},Remarkable.prototype.parse=function(o,s){var i=new StateCore(this,o,s);return this.core.process(i),i.tokens},Remarkable.prototype.render=function(o,s){return s=s||{},this.renderer.render(this.parse(o,s),this.options,s)},Remarkable.prototype.parseInline=function(o,s){var i=new StateCore(this,o,s);return i.inlineMode=!0,this.core.process(i),i.tokens},Remarkable.prototype.renderInline=function(o,s){return s=s||{},this.renderer.render(this.parseInline(o,s),this.options,s)};function indexOf(o,s){if(Array.prototype.indexOf)return o.indexOf(s);for(var i=0,u=o.length;i<u;i++)if(o[i]===s)return i;return-1}function utils_remove(o,s){for(var i=o.length-1;i>=0;i--)!0===s(o[i])&&o.splice(i,1)}function throwUnhandledCaseError(o){throw new Error(\"Unhandled case for value: '\".concat(o,\"'\"))}var EC=function(){function HtmlTag(o){void 0===o&&(o={}),this.tagName=\"\",this.attrs={},this.innerHTML=\"\",this.whitespaceRegex=/\\s+/,this.tagName=o.tagName||\"\",this.attrs=o.attrs||{},this.innerHTML=o.innerHtml||o.innerHTML||\"\"}return HtmlTag.prototype.setTagName=function(o){return this.tagName=o,this},HtmlTag.prototype.getTagName=function(){return this.tagName||\"\"},HtmlTag.prototype.setAttr=function(o,s){return this.getAttrs()[o]=s,this},HtmlTag.prototype.getAttr=function(o){return this.getAttrs()[o]},HtmlTag.prototype.setAttrs=function(o){return Object.assign(this.getAttrs(),o),this},HtmlTag.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},HtmlTag.prototype.setClass=function(o){return this.setAttr(\"class\",o)},HtmlTag.prototype.addClass=function(o){for(var s,i=this.getClass(),u=this.whitespaceRegex,_=i?i.split(u):[],w=o.split(u);s=w.shift();)-1===indexOf(_,s)&&_.push(s);return this.getAttrs().class=_.join(\" \"),this},HtmlTag.prototype.removeClass=function(o){for(var s,i=this.getClass(),u=this.whitespaceRegex,_=i?i.split(u):[],w=o.split(u);_.length&&(s=w.shift());){var x=indexOf(_,s);-1!==x&&_.splice(x,1)}return this.getAttrs().class=_.join(\" \"),this},HtmlTag.prototype.getClass=function(){return this.getAttrs().class||\"\"},HtmlTag.prototype.hasClass=function(o){return-1!==(\" \"+this.getClass()+\" \").indexOf(\" \"+o+\" \")},HtmlTag.prototype.setInnerHTML=function(o){return this.innerHTML=o,this},HtmlTag.prototype.setInnerHtml=function(o){return this.setInnerHTML(o)},HtmlTag.prototype.getInnerHTML=function(){return this.innerHTML||\"\"},HtmlTag.prototype.getInnerHtml=function(){return this.getInnerHTML()},HtmlTag.prototype.toAnchorString=function(){var o=this.getTagName(),s=this.buildAttrsStr();return[\"<\",o,s=s?\" \"+s:\"\",\">\",this.getInnerHtml(),\"</\",o,\">\"].join(\"\")},HtmlTag.prototype.buildAttrsStr=function(){if(!this.attrs)return\"\";var o=this.getAttrs(),s=[];for(var i in o)o.hasOwnProperty(i)&&s.push(i+'=\"'+o[i]+'\"');return s.join(\" \")},HtmlTag}();var wC=function(){function AnchorTagBuilder(o){void 0===o&&(o={}),this.newWindow=!1,this.truncate={},this.className=\"\",this.newWindow=o.newWindow||!1,this.truncate=o.truncate||{},this.className=o.className||\"\"}return AnchorTagBuilder.prototype.build=function(o){return new EC({tagName:\"a\",attrs:this.createAttrs(o),innerHtml:this.processAnchorText(o.getAnchorText())})},AnchorTagBuilder.prototype.createAttrs=function(o){var s={href:o.getAnchorHref()},i=this.createCssClass(o);return i&&(s.class=i),this.newWindow&&(s.target=\"_blank\",s.rel=\"noopener noreferrer\"),this.truncate&&this.truncate.length&&this.truncate.length<o.getAnchorText().length&&(s.title=o.getAnchorHref()),s},AnchorTagBuilder.prototype.createCssClass=function(o){var s=this.className;if(s){for(var i=[s],u=o.getCssClassSuffixes(),_=0,w=u.length;_<w;_++)i.push(s+\"-\"+u[_]);return i.join(\" \")}return\"\"},AnchorTagBuilder.prototype.processAnchorText=function(o){return o=this.doTruncate(o)},AnchorTagBuilder.prototype.doTruncate=function(o){var s=this.truncate;if(!s||!s.length)return o;var i=s.length,u=s.location;return\"smart\"===u?function truncateSmart(o,s,i){var u,_;null==i?(i=\"&hellip;\",_=3,u=8):(_=i.length,u=i.length);var buildUrl=function(o){var s=\"\";return o.scheme&&o.host&&(s+=o.scheme+\"://\"),o.host&&(s+=o.host),o.path&&(s+=\"/\"+o.path),o.query&&(s+=\"?\"+o.query),o.fragment&&(s+=\"#\"+o.fragment),s},buildSegment=function(o,s){var u=s/2,_=Math.ceil(u),w=-1*Math.floor(u),x=\"\";return w<0&&(x=o.substr(w)),o.substr(0,_)+i+x};if(o.length<=s)return o;var w=s-_,x=function(o){var s={},i=o,u=i.match(/^([a-z]+):\\/\\//i);return u&&(s.scheme=u[1],i=i.substr(u[0].length)),(u=i.match(/^(.*?)(?=(\\?|#|\\/|$))/i))&&(s.host=u[1],i=i.substr(u[0].length)),(u=i.match(/^\\/(.*?)(?=(\\?|#|$))/i))&&(s.path=u[1],i=i.substr(u[0].length)),(u=i.match(/^\\?(.*?)(?=(#|$))/i))&&(s.query=u[1],i=i.substr(u[0].length)),(u=i.match(/^#(.*?)$/i))&&(s.fragment=u[1]),s}(o);if(x.query){var C=x.query.match(/^(.*?)(?=(\\?|\\#))(.*?)$/i);C&&(x.query=x.query.substr(0,C[1].length),o=buildUrl(x))}if(o.length<=s)return o;if(x.host&&(x.host=x.host.replace(/^www\\./,\"\"),o=buildUrl(x)),o.length<=s)return o;var j=\"\";if(x.host&&(j+=x.host),j.length>=w)return x.host.length==s?(x.host.substr(0,s-_)+i).substr(0,w+u):buildSegment(j,w).substr(0,w+u);var L=\"\";if(x.path&&(L+=\"/\"+x.path),x.query&&(L+=\"?\"+x.query),L){if((j+L).length>=w)return(j+L).length==s?(j+L).substr(0,s):(j+buildSegment(L,w-j.length)).substr(0,w+u);j+=L}if(x.fragment){var B=\"#\"+x.fragment;if((j+B).length>=w)return(j+B).length==s?(j+B).substr(0,s):(j+buildSegment(B,w-j.length)).substr(0,w+u);j+=B}if(x.scheme&&x.host){var $=x.scheme+\"://\";if((j+$).length<w)return($+j).substr(0,s)}if(j.length<=s)return j;var V=\"\";return w>0&&(V=j.substr(-1*Math.floor(w/2))),(j.substr(0,Math.ceil(w/2))+i+V).substr(0,w+u)}(o,i):\"middle\"===u?function truncateMiddle(o,s,i){if(o.length<=s)return o;var u,_;null==i?(i=\"&hellip;\",u=8,_=3):(u=i.length,_=i.length);var w=s-_,x=\"\";return w>0&&(x=o.substr(-1*Math.floor(w/2))),(o.substr(0,Math.ceil(w/2))+i+x).substr(0,w+u)}(o,i):function truncateEnd(o,s,i){return function ellipsis(o,s,i){var u;return o.length>s&&(null==i?(i=\"&hellip;\",u=3):u=i.length,o=o.substring(0,s-u)+i),o}(o,s,i)}(o,i)},AnchorTagBuilder}(),SC=function(){function Match(o){this.__jsduckDummyDocProp=null,this.matchedText=\"\",this.offset=0,this.tagBuilder=o.tagBuilder,this.matchedText=o.matchedText,this.offset=o.offset}return Match.prototype.getMatchedText=function(){return this.matchedText},Match.prototype.setOffset=function(o){this.offset=o},Match.prototype.getOffset=function(){return this.offset},Match.prototype.getCssClassSuffixes=function(){return[this.getType()]},Match.prototype.buildTag=function(){return this.tagBuilder.build(this)},Match}(),extendStatics=function(o,s){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(o[i]=s[i])},extendStatics(o,s)};function tslib_es6_extends(o,s){if(\"function\"!=typeof s&&null!==s)throw new TypeError(\"Class extends value \"+String(s)+\" is not a constructor or null\");function __(){this.constructor=o}extendStatics(o,s),o.prototype=null===s?Object.create(s):(__.prototype=s.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(o){for(var s,i=1,u=arguments.length;i<u;i++)for(var _ in s=arguments[i])Object.prototype.hasOwnProperty.call(s,_)&&(o[_]=s[_]);return o},__assign.apply(this,arguments)};Object.create;Object.create;\"function\"==typeof SuppressedError&&SuppressedError;var xC,kC=function(o){function EmailMatch(s){var i=o.call(this,s)||this;return i.email=\"\",i.email=s.email,i}return tslib_es6_extends(EmailMatch,o),EmailMatch.prototype.getType=function(){return\"email\"},EmailMatch.prototype.getEmail=function(){return this.email},EmailMatch.prototype.getAnchorHref=function(){return\"mailto:\"+this.email},EmailMatch.prototype.getAnchorText=function(){return this.email},EmailMatch}(SC),OC=function(o){function HashtagMatch(s){var i=o.call(this,s)||this;return i.serviceName=\"\",i.hashtag=\"\",i.serviceName=s.serviceName,i.hashtag=s.hashtag,i}return tslib_es6_extends(HashtagMatch,o),HashtagMatch.prototype.getType=function(){return\"hashtag\"},HashtagMatch.prototype.getServiceName=function(){return this.serviceName},HashtagMatch.prototype.getHashtag=function(){return this.hashtag},HashtagMatch.prototype.getAnchorHref=function(){var o=this.serviceName,s=this.hashtag;switch(o){case\"twitter\":return\"https://twitter.com/hashtag/\"+s;case\"facebook\":return\"https://www.facebook.com/hashtag/\"+s;case\"instagram\":return\"https://instagram.com/explore/tags/\"+s;case\"tiktok\":return\"https://www.tiktok.com/tag/\"+s;default:throw new Error(\"Unknown service name to point hashtag to: \"+o)}},HashtagMatch.prototype.getAnchorText=function(){return\"#\"+this.hashtag},HashtagMatch}(SC),CC=function(o){function MentionMatch(s){var i=o.call(this,s)||this;return i.serviceName=\"twitter\",i.mention=\"\",i.mention=s.mention,i.serviceName=s.serviceName,i}return tslib_es6_extends(MentionMatch,o),MentionMatch.prototype.getType=function(){return\"mention\"},MentionMatch.prototype.getMention=function(){return this.mention},MentionMatch.prototype.getServiceName=function(){return this.serviceName},MentionMatch.prototype.getAnchorHref=function(){switch(this.serviceName){case\"twitter\":return\"https://twitter.com/\"+this.mention;case\"instagram\":return\"https://instagram.com/\"+this.mention;case\"soundcloud\":return\"https://soundcloud.com/\"+this.mention;case\"tiktok\":return\"https://www.tiktok.com/@\"+this.mention;default:throw new Error(\"Unknown service name to point mention to: \"+this.serviceName)}},MentionMatch.prototype.getAnchorText=function(){return\"@\"+this.mention},MentionMatch.prototype.getCssClassSuffixes=function(){var s=o.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&s.push(i),s},MentionMatch}(SC),AC=function(o){function PhoneMatch(s){var i=o.call(this,s)||this;return i.number=\"\",i.plusSign=!1,i.number=s.number,i.plusSign=s.plusSign,i}return tslib_es6_extends(PhoneMatch,o),PhoneMatch.prototype.getType=function(){return\"phone\"},PhoneMatch.prototype.getPhoneNumber=function(){return this.number},PhoneMatch.prototype.getNumber=function(){return this.getPhoneNumber()},PhoneMatch.prototype.getAnchorHref=function(){return\"tel:\"+(this.plusSign?\"+\":\"\")+this.number},PhoneMatch.prototype.getAnchorText=function(){return this.matchedText},PhoneMatch}(SC),jC=function(o){function UrlMatch(s){var i=o.call(this,s)||this;return i.url=\"\",i.urlMatchType=\"scheme\",i.protocolUrlMatch=!1,i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.schemePrefixRegex=/^(https?:\\/\\/)?/i,i.wwwPrefixRegex=/^(https?:\\/\\/)?(www\\.)?/i,i.protocolRelativeRegex=/^\\/\\//,i.protocolPrepended=!1,i.urlMatchType=s.urlMatchType,i.url=s.url,i.protocolUrlMatch=s.protocolUrlMatch,i.protocolRelativeMatch=s.protocolRelativeMatch,i.stripPrefix=s.stripPrefix,i.stripTrailingSlash=s.stripTrailingSlash,i.decodePercentEncoding=s.decodePercentEncoding,i}return tslib_es6_extends(UrlMatch,o),UrlMatch.prototype.getType=function(){return\"url\"},UrlMatch.prototype.getUrlMatchType=function(){return this.urlMatchType},UrlMatch.prototype.getUrl=function(){var o=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(o=this.url=\"http://\"+o,this.protocolPrepended=!0),o},UrlMatch.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,\"&\")},UrlMatch.prototype.getAnchorText=function(){var o=this.getMatchedText();return this.protocolRelativeMatch&&(o=this.stripProtocolRelativePrefix(o)),this.stripPrefix.scheme&&(o=this.stripSchemePrefix(o)),this.stripPrefix.www&&(o=this.stripWwwPrefix(o)),this.stripTrailingSlash&&(o=this.removeTrailingSlash(o)),this.decodePercentEncoding&&(o=this.removePercentEncoding(o)),o},UrlMatch.prototype.stripSchemePrefix=function(o){return o.replace(this.schemePrefixRegex,\"\")},UrlMatch.prototype.stripWwwPrefix=function(o){return o.replace(this.wwwPrefixRegex,\"$1\")},UrlMatch.prototype.stripProtocolRelativePrefix=function(o){return o.replace(this.protocolRelativeRegex,\"\")},UrlMatch.prototype.removeTrailingSlash=function(o){return\"/\"===o.charAt(o.length-1)&&(o=o.slice(0,-1)),o},UrlMatch.prototype.removePercentEncoding=function(o){var s=o.replace(/%22/gi,\"&quot;\").replace(/%26/gi,\"&amp;\").replace(/%27/gi,\"&#39;\").replace(/%3C/gi,\"&lt;\").replace(/%3E/gi,\"&gt;\");try{return decodeURIComponent(s)}catch(o){return s}},UrlMatch}(SC),PC=function PC(o){this.__jsduckDummyDocProp=null,this.tagBuilder=o.tagBuilder},IC=/[A-Za-z]/,MC=/[\\d]/,NC=/[\\D]/,TC=/\\s/,RC=/['\"]/,DC=/[\\x00-\\x1F\\x7F]/,LC=/A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC/.source,BC=LC+/\\u2700-\\u27bf\\udde6-\\uddff\\ud800-\\udbff\\udc00-\\udfff\\ufe0e\\ufe0f\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ud83c\\udffb-\\udfff\\u200d\\u3299\\u3297\\u303d\\u3030\\u24c2\\ud83c\\udd70-\\udd71\\udd7e-\\udd7f\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01-\\ude02\\ude1a\\ude2f\\ude32-\\ude3a\\ude50-\\ude51\\u203c\\u2049\\u25aa-\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u00a9\\u00ae\\u2122\\u2139\\udc04\\u2600-\\u26FF\\u2b05\\u2b06\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u231a\\u231b\\u2328\\u23cf\\u23e9-\\u23f3\\u23f8-\\u23fa\\udccf\\u2935\\u2934\\u2190-\\u21ff/.source+/\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D4-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFB-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F/.source,FC=/0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0DE6-\\u0DEF\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uA9F0-\\uA9F9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19/.source,qC=BC+FC,$C=BC+FC,VC=new RegExp(\"[\".concat($C,\"]\")),UC=\"(?:[\"+FC+\"]{1,3}\\\\.){3}[\"+FC+\"]{1,3}\",zC=\"[\"+$C+\"](?:[\"+$C+\"\\\\-_]{0,61}[\"+$C+\"])?\",getDomainLabelStr=function(o){return\"(?=(\"+zC+\"))\\\\\"+o},getDomainNameStr=function(o){return\"(?:\"+getDomainLabelStr(o)+\"(?:\\\\.\"+getDomainLabelStr(o+1)+\"){0,126}|\"+UC+\")\"},WC=(new RegExp(\"[\"+$C+\".\\\\-]*[\"+$C+\"\\\\-]\"),VC),KC=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,HC=new RegExp(\"[\".concat($C,\"!#$%&'*+/=?^_`{|}~-]\")),JC=new RegExp(\"^\".concat(KC.source,\"$\")),GC=function(o){function EmailMatcher(){var s=null!==o&&o.apply(this,arguments)||this;return s.localPartCharRegex=HC,s.strictTldRegex=JC,s}return tslib_es6_extends(EmailMatcher,o),EmailMatcher.prototype.parseMatches=function(o){for(var s=this.tagBuilder,i=this.localPartCharRegex,u=this.strictTldRegex,_=[],w=o.length,x=new YC,C={m:\"a\",a:\"i\",i:\"l\",l:\"t\",t:\"o\",o:\":\"},j=0,L=0,B=x;j<w;){var $=o.charAt(j);switch(L){case 0:stateNonEmailAddress($);break;case 1:stateMailTo(o.charAt(j-1),$);break;case 2:stateLocalPart($);break;case 3:stateLocalPartDot($);break;case 4:stateAtSign($);break;case 5:stateDomainChar($);break;case 6:stateDomainHyphen($);break;case 7:stateDomainDot($);break;default:throwUnhandledCaseError(L)}j++}return captureMatchIfValidAndReset(),_;function stateNonEmailAddress(o){\"m\"===o?beginEmailMatch(1):i.test(o)&&beginEmailMatch()}function stateMailTo(o,s){\":\"===o?i.test(s)?(L=2,B=new YC(__assign(__assign({},B),{hasMailtoPrefix:!0}))):resetToNonEmailMatchState():C[o]===s||(i.test(s)?L=2:\".\"===s?L=3:\"@\"===s?L=4:resetToNonEmailMatchState())}function stateLocalPart(o){\".\"===o?L=3:\"@\"===o?L=4:i.test(o)||resetToNonEmailMatchState()}function stateLocalPartDot(o){\".\"===o||\"@\"===o?resetToNonEmailMatchState():i.test(o)?L=2:resetToNonEmailMatchState()}function stateAtSign(o){WC.test(o)?L=5:resetToNonEmailMatchState()}function stateDomainChar(o){\".\"===o?L=7:\"-\"===o?L=6:WC.test(o)||captureMatchIfValidAndReset()}function stateDomainHyphen(o){\"-\"===o||\".\"===o?captureMatchIfValidAndReset():WC.test(o)?L=5:captureMatchIfValidAndReset()}function stateDomainDot(o){\".\"===o||\"-\"===o?captureMatchIfValidAndReset():WC.test(o)?(L=5,B=new YC(__assign(__assign({},B),{hasDomainDot:!0}))):captureMatchIfValidAndReset()}function beginEmailMatch(o){void 0===o&&(o=2),L=o,B=new YC({idx:j})}function resetToNonEmailMatchState(){L=0,B=x}function captureMatchIfValidAndReset(){if(B.hasDomainDot){var i=o.slice(B.idx,j);/[-.]$/.test(i)&&(i=i.slice(0,-1));var w=B.hasMailtoPrefix?i.slice(7):i;(function doesEmailHaveValidTld(o){var s=o.split(\".\").pop()||\"\",i=s.toLowerCase();return u.test(i)})(w)&&_.push(new kC({tagBuilder:s,matchedText:i,offset:B.idx,email:w}))}resetToNonEmailMatchState()}},EmailMatcher}(PC),YC=function YC(o){void 0===o&&(o={}),this.idx=void 0!==o.idx?o.idx:-1,this.hasMailtoPrefix=!!o.hasMailtoPrefix,this.hasDomainDot=!!o.hasDomainDot},XC=function(){function UrlMatchValidator(){}return UrlMatchValidator.isValid=function(o,s){return!(s&&!this.isValidUriScheme(s)||this.urlMatchDoesNotHaveProtocolOrDot(o,s)||this.urlMatchDoesNotHaveAtLeastOneWordChar(o,s)&&!this.isValidIpAddress(o)||this.containsMultipleDots(o))},UrlMatchValidator.isValidIpAddress=function(o){var s=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==o.match(s)},UrlMatchValidator.containsMultipleDots=function(o){var s=o;return this.hasFullProtocolRegex.test(o)&&(s=o.split(\"://\")[1]),s.split(\"/\")[0].indexOf(\"..\")>-1},UrlMatchValidator.isValidUriScheme=function(o){var s=o.match(this.uriSchemeRegex),i=s&&s[0].toLowerCase();return\"javascript:\"!==i&&\"vbscript:\"!==i},UrlMatchValidator.urlMatchDoesNotHaveProtocolOrDot=function(o,s){return!(!o||s&&this.hasFullProtocolRegex.test(s)||-1!==o.indexOf(\".\"))},UrlMatchValidator.urlMatchDoesNotHaveAtLeastOneWordChar=function(o,s){return!(!o||!s)&&(!this.hasFullProtocolRegex.test(s)&&!this.hasWordCharAfterProtocolRegex.test(o))},UrlMatchValidator.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\\/\\//,UrlMatchValidator.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,UrlMatchValidator.hasWordCharAfterProtocolRegex=new RegExp(\":[^\\\\s]*?[\"+LC+\"]\"),UrlMatchValidator.ipRegex=/[0-9][0-9]?[0-9]?\\.[0-9][0-9]?[0-9]?\\.[0-9][0-9]?[0-9]?\\.[0-9][0-9]?[0-9]?(:[0-9]*)?\\/?$/,UrlMatchValidator}(),QC=(xC=new RegExp(\"[/?#](?:[\"+$C+\"\\\\-+&@#/%=~_()|'$*\\\\[\\\\]{}?!:,.;^✓]*[\"+$C+\"\\\\-+&@#/%=~_()|'$*\\\\[\\\\]{}✓])?\"),new RegExp([\"(?:\",\"(\",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\\/\\/)(?!\\d+\\/?)(?:\\/\\/)?)/.source,getDomainNameStr(2),\")\",\"|\",\"(\",\"(//)?\",/(?:www\\.)/.source,getDomainNameStr(6),\")\",\"|\",\"(\",\"(//)?\",getDomainNameStr(10)+\"\\\\.\",KC.source,\"(?![-\"+qC+\"])\",\")\",\")\",\"(?::[0-9]+)?\",\"(?:\"+xC.source+\")?\"].join(\"\"),\"gi\")),ZC=new RegExp(\"[\"+$C+\"]\"),eA=function(o){function UrlMatcher(s){var i=o.call(this,s)||this;return i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.matcherRegex=QC,i.wordCharRegExp=ZC,i.stripPrefix=s.stripPrefix,i.stripTrailingSlash=s.stripTrailingSlash,i.decodePercentEncoding=s.decodePercentEncoding,i}return tslib_es6_extends(UrlMatcher,o),UrlMatcher.prototype.parseMatches=function(o){for(var s,i=this.matcherRegex,u=this.stripPrefix,_=this.stripTrailingSlash,w=this.decodePercentEncoding,x=this.tagBuilder,C=[],_loop_1=function(){var i=s[0],L=s[1],B=s[4],$=s[5],V=s[9],U=s.index,z=$||V,Y=o.charAt(U-1);if(!XC.isValid(i,L))return\"continue\";if(U>0&&\"@\"===Y)return\"continue\";if(U>0&&z&&j.wordCharRegExp.test(Y))return\"continue\";if(/\\?$/.test(i)&&(i=i.substr(0,i.length-1)),j.matchHasUnbalancedClosingParen(i))i=i.substr(0,i.length-1);else{var Z=j.matchHasInvalidCharAfterTld(i,L);Z>-1&&(i=i.substr(0,Z))}var ee=[\"http://\",\"https://\"].find((function(o){return!!L&&-1!==L.indexOf(o)}));if(ee){var ie=i.indexOf(ee);i=i.substr(ie),L=L.substr(ie),U+=ie}var ae=L?\"scheme\":B?\"www\":\"tld\",ce=!!L;C.push(new jC({tagBuilder:x,matchedText:i,offset:U,urlMatchType:ae,url:i,protocolUrlMatch:ce,protocolRelativeMatch:!!z,stripPrefix:u,stripTrailingSlash:_,decodePercentEncoding:w}))},j=this;null!==(s=i.exec(o));)_loop_1();return C},UrlMatcher.prototype.matchHasUnbalancedClosingParen=function(o){var s,i=o.charAt(o.length-1);if(\")\"===i)s=\"(\";else if(\"]\"===i)s=\"[\";else{if(\"}\"!==i)return!1;s=\"{\"}for(var u=0,_=0,w=o.length-1;_<w;_++){var x=o.charAt(_);x===s?u++:x===i&&(u=Math.max(u-1,0))}return 0===u},UrlMatcher.prototype.matchHasInvalidCharAfterTld=function(o,s){if(!o)return-1;var i=0;s&&(i=o.indexOf(\":\"),o=o.slice(i));var u=new RegExp(\"^((.?//)?[-.\"+$C+\"]*[-\"+$C+\"]\\\\.[-\"+$C+\"]+)\").exec(o);return null===u?-1:(i+=u[1].length,o=o.slice(u[1].length),/^[^-.A-Za-z0-9:\\/?#]/.test(o)?i:-1)},UrlMatcher}(PC),tA=new RegExp(\"[_\".concat($C,\"]\")),rA=function(o){function HashtagMatcher(s){var i=o.call(this,s)||this;return i.serviceName=\"twitter\",i.serviceName=s.serviceName,i}return tslib_es6_extends(HashtagMatcher,o),HashtagMatcher.prototype.parseMatches=function(o){for(var s=this.tagBuilder,i=this.serviceName,u=[],_=o.length,w=0,x=-1,C=0;w<_;){var j=o.charAt(w);switch(C){case 0:stateNone(j);break;case 1:stateNonHashtagWordChar(j);break;case 2:stateHashtagHashChar(j);break;case 3:stateHashtagTextChar(j);break;default:throwUnhandledCaseError(C)}w++}return captureMatchIfValid(),u;function stateNone(o){\"#\"===o?(C=2,x=w):VC.test(o)&&(C=1)}function stateNonHashtagWordChar(o){VC.test(o)||(C=0)}function stateHashtagHashChar(o){C=tA.test(o)?3:VC.test(o)?1:0}function stateHashtagTextChar(o){tA.test(o)||(captureMatchIfValid(),x=-1,C=VC.test(o)?1:0)}function captureMatchIfValid(){if(x>-1&&w-x<=140){var _=o.slice(x,w),C=new OC({tagBuilder:s,matchedText:_,offset:x,serviceName:i,hashtag:_.slice(1)});u.push(C)}}},HashtagMatcher}(PC),nA=[\"twitter\",\"facebook\",\"instagram\",\"tiktok\"],oA=new RegExp(\"\".concat(/(?:(?:(?:(\\+)?\\d{1,3}[-\\040.]?)?\\(?\\d{3}\\)?[-\\040.]?\\d{3}[-\\040.]?\\d{4})|(?:(\\+)(?:9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\\040.]?(?:\\d[-\\040.]?){6,12}\\d+))([,;]+[0-9]+#?)*/.source,\"|\").concat(/(0([1-9]{1}-?[1-9]\\d{3}|[1-9]{2}-?\\d{3}|[1-9]{2}\\d{1}-?\\d{2}|[1-9]{2}\\d{2}-?\\d{1})-?\\d{4}|0[789]0-?\\d{4}-?\\d{4}|050-?\\d{4}-?\\d{4})/.source),\"g\"),sA=function(o){function PhoneMatcher(){var s=null!==o&&o.apply(this,arguments)||this;return s.matcherRegex=oA,s}return tslib_es6_extends(PhoneMatcher,o),PhoneMatcher.prototype.parseMatches=function(o){for(var s,i=this.matcherRegex,u=this.tagBuilder,_=[];null!==(s=i.exec(o));){var w=s[0],x=w.replace(/[^0-9,;#]/g,\"\"),C=!(!s[1]&&!s[2]),j=0==s.index?\"\":o.substr(s.index-1,1),L=o.substr(s.index+w.length,1),B=!j.match(/\\d/)&&!L.match(/\\d/);this.testMatch(s[3])&&this.testMatch(w)&&B&&_.push(new AC({tagBuilder:u,matchedText:w,offset:s.index,number:x,plusSign:C}))}return _},PhoneMatcher.prototype.testMatch=function(o){return NC.test(o)},PhoneMatcher}(PC),iA=new RegExp(\"@[_\".concat($C,\"]{1,50}(?![_\").concat($C,\"])\"),\"g\"),aA=new RegExp(\"@[_.\".concat($C,\"]{1,30}(?![_\").concat($C,\"])\"),\"g\"),cA=new RegExp(\"@[-_.\".concat($C,\"]{1,50}(?![-_\").concat($C,\"])\"),\"g\"),lA=new RegExp(\"@[_.\".concat($C,\"]{1,23}[_\").concat($C,\"](?![_\").concat($C,\"])\"),\"g\"),uA=new RegExp(\"[^\"+$C+\"]\"),pA=function(o){function MentionMatcher(s){var i=o.call(this,s)||this;return i.serviceName=\"twitter\",i.matcherRegexes={twitter:iA,instagram:aA,soundcloud:cA,tiktok:lA},i.nonWordCharRegex=uA,i.serviceName=s.serviceName,i}return tslib_es6_extends(MentionMatcher,o),MentionMatcher.prototype.parseMatches=function(o){var s,i=this.serviceName,u=this.matcherRegexes[this.serviceName],_=this.nonWordCharRegex,w=this.tagBuilder,x=[];if(!u)return x;for(;null!==(s=u.exec(o));){var C=s.index,j=o.charAt(C-1);if(0===C||_.test(j)){var L=s[0].replace(/\\.+$/g,\"\"),B=L.slice(1);x.push(new CC({tagBuilder:w,matchedText:L,offset:C,serviceName:i,mention:B}))}}return x},MentionMatcher}(PC);function parseHtml(o,s){for(var i=s.onOpenTag,u=s.onCloseTag,_=s.onText,w=s.onComment,x=s.onDoctype,C=new hA,j=0,L=o.length,B=0,$=0,V=C;j<L;){var U=o.charAt(j);switch(B){case 0:stateData(U);break;case 1:stateTagOpen(U);break;case 2:stateEndTagOpen(U);break;case 3:stateTagName(U);break;case 4:stateBeforeAttributeName(U);break;case 5:stateAttributeName(U);break;case 6:stateAfterAttributeName(U);break;case 7:stateBeforeAttributeValue(U);break;case 8:stateAttributeValueDoubleQuoted(U);break;case 9:stateAttributeValueSingleQuoted(U);break;case 10:stateAttributeValueUnquoted(U);break;case 11:stateAfterAttributeValueQuoted(U);break;case 12:stateSelfClosingStartTag(U);break;case 13:stateMarkupDeclarationOpen(U);break;case 14:stateCommentStart(U);break;case 15:stateCommentStartDash(U);break;case 16:stateComment(U);break;case 17:stateCommentEndDash(U);break;case 18:stateCommentEnd(U);break;case 19:stateCommentEndBang(U);break;case 20:stateDoctype(U);break;default:throwUnhandledCaseError(B)}j++}function stateData(o){\"<\"===o&&startNewTag()}function stateTagOpen(o){\"!\"===o?B=13:\"/\"===o?(B=2,V=new hA(__assign(__assign({},V),{isClosing:!0}))):\"<\"===o?startNewTag():IC.test(o)?(B=3,V=new hA(__assign(__assign({},V),{isOpening:!0}))):(B=0,V=C)}function stateTagName(o){TC.test(o)?(V=new hA(__assign(__assign({},V),{name:captureTagName()})),B=4):\"<\"===o?startNewTag():\"/\"===o?(V=new hA(__assign(__assign({},V),{name:captureTagName()})),B=12):\">\"===o?(V=new hA(__assign(__assign({},V),{name:captureTagName()})),emitTagAndPreviousTextNode()):IC.test(o)||MC.test(o)||\":\"===o||resetToDataState()}function stateEndTagOpen(o){\">\"===o?resetToDataState():IC.test(o)?B=3:resetToDataState()}function stateBeforeAttributeName(o){TC.test(o)||(\"/\"===o?B=12:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o?startNewTag():\"=\"===o||RC.test(o)||DC.test(o)?resetToDataState():B=5)}function stateAttributeName(o){TC.test(o)?B=6:\"/\"===o?B=12:\"=\"===o?B=7:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o?startNewTag():RC.test(o)&&resetToDataState()}function stateAfterAttributeName(o){TC.test(o)||(\"/\"===o?B=12:\"=\"===o?B=7:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o?startNewTag():RC.test(o)?resetToDataState():B=5)}function stateBeforeAttributeValue(o){TC.test(o)||('\"'===o?B=8:\"'\"===o?B=9:/[>=`]/.test(o)?resetToDataState():\"<\"===o?startNewTag():B=10)}function stateAttributeValueDoubleQuoted(o){'\"'===o&&(B=11)}function stateAttributeValueSingleQuoted(o){\"'\"===o&&(B=11)}function stateAttributeValueUnquoted(o){TC.test(o)?B=4:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o&&startNewTag()}function stateAfterAttributeValueQuoted(o){TC.test(o)?B=4:\"/\"===o?B=12:\">\"===o?emitTagAndPreviousTextNode():\"<\"===o?startNewTag():(B=4,function reconsumeCurrentCharacter(){j--}())}function stateSelfClosingStartTag(o){\">\"===o?(V=new hA(__assign(__assign({},V),{isClosing:!0})),emitTagAndPreviousTextNode()):B=4}function stateMarkupDeclarationOpen(s){\"--\"===o.substr(j,2)?(j+=2,V=new hA(__assign(__assign({},V),{type:\"comment\"})),B=14):\"DOCTYPE\"===o.substr(j,7).toUpperCase()?(j+=7,V=new hA(__assign(__assign({},V),{type:\"doctype\"})),B=20):resetToDataState()}function stateCommentStart(o){\"-\"===o?B=15:\">\"===o?resetToDataState():B=16}function stateCommentStartDash(o){\"-\"===o?B=18:\">\"===o?resetToDataState():B=16}function stateComment(o){\"-\"===o&&(B=17)}function stateCommentEndDash(o){B=\"-\"===o?18:16}function stateCommentEnd(o){\">\"===o?emitTagAndPreviousTextNode():\"!\"===o?B=19:\"-\"===o||(B=16)}function stateCommentEndBang(o){\"-\"===o?B=17:\">\"===o?emitTagAndPreviousTextNode():B=16}function stateDoctype(o){\">\"===o?emitTagAndPreviousTextNode():\"<\"===o&&startNewTag()}function resetToDataState(){B=0,V=C}function startNewTag(){B=1,V=new hA({idx:j})}function emitTagAndPreviousTextNode(){var s=o.slice($,V.idx);s&&_(s,$),\"comment\"===V.type?w(V.idx):\"doctype\"===V.type?x(V.idx):(V.isOpening&&i(V.name,V.idx),V.isClosing&&u(V.name,V.idx)),resetToDataState(),$=j+1}function captureTagName(){var s=V.idx+(V.isClosing?2:1);return o.slice(s,j).toLowerCase()}$<j&&function emitText(){var s=o.slice($,j);_(s,$),$=j+1}()}var hA=function hA(o){void 0===o&&(o={}),this.idx=void 0!==o.idx?o.idx:-1,this.type=o.type||\"tag\",this.name=o.name||\"\",this.isOpening=!!o.isOpening,this.isClosing=!!o.isClosing},dA=function(){function Autolinker(o){void 0===o&&(o={}),this.version=Autolinker.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:\"end\"},this.className=\"\",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(o.urls),this.email=\"boolean\"==typeof o.email?o.email:this.email,this.phone=\"boolean\"==typeof o.phone?o.phone:this.phone,this.hashtag=o.hashtag||this.hashtag,this.mention=o.mention||this.mention,this.newWindow=\"boolean\"==typeof o.newWindow?o.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(o.stripPrefix),this.stripTrailingSlash=\"boolean\"==typeof o.stripTrailingSlash?o.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=\"boolean\"==typeof o.decodePercentEncoding?o.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=o.sanitizeHtml||!1;var s=this.mention;if(!1!==s&&-1===[\"twitter\",\"instagram\",\"soundcloud\",\"tiktok\"].indexOf(s))throw new Error(\"invalid `mention` cfg '\".concat(s,\"' - see docs\"));var i=this.hashtag;if(!1!==i&&-1===nA.indexOf(i))throw new Error(\"invalid `hashtag` cfg '\".concat(i,\"' - see docs\"));this.truncate=this.normalizeTruncateCfg(o.truncate),this.className=o.className||this.className,this.replaceFn=o.replaceFn||this.replaceFn,this.context=o.context||this}return Autolinker.link=function(o,s){return new Autolinker(s).link(o)},Autolinker.parse=function(o,s){return new Autolinker(s).parse(o)},Autolinker.prototype.normalizeUrlsCfg=function(o){return null==o&&(o=!0),\"boolean\"==typeof o?{schemeMatches:o,wwwMatches:o,tldMatches:o}:{schemeMatches:\"boolean\"!=typeof o.schemeMatches||o.schemeMatches,wwwMatches:\"boolean\"!=typeof o.wwwMatches||o.wwwMatches,tldMatches:\"boolean\"!=typeof o.tldMatches||o.tldMatches}},Autolinker.prototype.normalizeStripPrefixCfg=function(o){return null==o&&(o=!0),\"boolean\"==typeof o?{scheme:o,www:o}:{scheme:\"boolean\"!=typeof o.scheme||o.scheme,www:\"boolean\"!=typeof o.www||o.www}},Autolinker.prototype.normalizeTruncateCfg=function(o){return\"number\"==typeof o?{length:o,location:\"end\"}:function defaults(o,s){for(var i in s)s.hasOwnProperty(i)&&void 0===o[i]&&(o[i]=s[i]);return o}(o||{},{length:Number.POSITIVE_INFINITY,location:\"end\"})},Autolinker.prototype.parse=function(o){var s=this,i=[\"a\",\"style\",\"script\"],u=0,_=[];return parseHtml(o,{onOpenTag:function(o){i.indexOf(o)>=0&&u++},onText:function(o,i){if(0===u){var w=function splitAndCapture(o,s){if(!s.global)throw new Error(\"`splitRegex` must have the 'g' flag set\");for(var i,u=[],_=0;i=s.exec(o);)u.push(o.substring(_,i.index)),u.push(i[0]),_=i.index+i[0].length;return u.push(o.substring(_)),u}(o,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),x=i;w.forEach((function(o,i){if(i%2==0){var u=s.parseText(o,x);_.push.apply(_,u)}x+=o.length}))}},onCloseTag:function(o){i.indexOf(o)>=0&&(u=Math.max(u-1,0))},onComment:function(o){},onDoctype:function(o){}}),_=this.compactMatches(_),_=this.removeUnwantedMatches(_)},Autolinker.prototype.compactMatches=function(o){o.sort((function(o,s){return o.getOffset()-s.getOffset()}));for(var s=0;s<o.length-1;){var i=o[s],u=i.getOffset(),_=i.getMatchedText().length,w=u+_;if(s+1<o.length){if(o[s+1].getOffset()===u){var x=o[s+1].getMatchedText().length>_?s:s+1;o.splice(x,1);continue}if(o[s+1].getOffset()<w){o.splice(s+1,1);continue}}s++}return o},Autolinker.prototype.removeUnwantedMatches=function(o){return this.hashtag||utils_remove(o,(function(o){return\"hashtag\"===o.getType()})),this.email||utils_remove(o,(function(o){return\"email\"===o.getType()})),this.phone||utils_remove(o,(function(o){return\"phone\"===o.getType()})),this.mention||utils_remove(o,(function(o){return\"mention\"===o.getType()})),this.urls.schemeMatches||utils_remove(o,(function(o){return\"url\"===o.getType()&&\"scheme\"===o.getUrlMatchType()})),this.urls.wwwMatches||utils_remove(o,(function(o){return\"url\"===o.getType()&&\"www\"===o.getUrlMatchType()})),this.urls.tldMatches||utils_remove(o,(function(o){return\"url\"===o.getType()&&\"tld\"===o.getUrlMatchType()})),o},Autolinker.prototype.parseText=function(o,s){void 0===s&&(s=0),s=s||0;for(var i=this.getMatchers(),u=[],_=0,w=i.length;_<w;_++){for(var x=i[_].parseMatches(o),C=0,j=x.length;C<j;C++)x[C].setOffset(s+x[C].getOffset());u.push.apply(u,x)}return u},Autolinker.prototype.link=function(o){if(!o)return\"\";this.sanitizeHtml&&(o=o.replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\"));for(var s=this.parse(o),i=[],u=0,_=0,w=s.length;_<w;_++){var x=s[_];i.push(o.substring(u,x.getOffset())),i.push(this.createMatchReturnVal(x)),u=x.getOffset()+x.getMatchedText().length}return i.push(o.substring(u)),i.join(\"\")},Autolinker.prototype.createMatchReturnVal=function(o){var s;return this.replaceFn&&(s=this.replaceFn.call(this.context,o)),\"string\"==typeof s?s:!1===s?o.getMatchedText():s instanceof EC?s.toAnchorString():o.buildTag().toAnchorString()},Autolinker.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var o=this.getTagBuilder(),s=[new rA({tagBuilder:o,serviceName:this.hashtag}),new GC({tagBuilder:o}),new sA({tagBuilder:o}),new pA({tagBuilder:o,serviceName:this.mention}),new eA({tagBuilder:o,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=s},Autolinker.prototype.getTagBuilder=function(){var o=this.tagBuilder;return o||(o=this.tagBuilder=new wC({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),o},Autolinker.version=\"3.16.2\",Autolinker.AnchorTagBuilder=wC,Autolinker.HtmlTag=EC,Autolinker.matcher={Email:GC,Hashtag:rA,Matcher:PC,Mention:pA,Phone:sA,Url:eA},Autolinker.match={Email:kC,Hashtag:OC,Match:SC,Mention:CC,Phone:AC,Url:jC},Autolinker}();const fA=dA;var mA=/www|@|\\:\\/\\//;function isLinkOpen(o){return/^<a[>\\s]/i.test(o)}function isLinkClose(o){return/^<\\/a\\s*>/i.test(o)}function createLinkifier(){var o=[],s=new fA({stripPrefix:!1,url:!0,email:!0,replaceFn:function(s){switch(s.getType()){case\"url\":o.push({text:s.matchedText,url:s.getUrl()});break;case\"email\":o.push({text:s.matchedText,url:\"mailto:\"+s.getEmail().replace(/^mailto:/i,\"\")})}return!1}});return{links:o,autolinker:s}}function parseTokens(o){var s,i,u,_,w,x,C,j,L,B,$,V,U,z=o.tokens,Y=null;for(i=0,u=z.length;i<u;i++)if(\"inline\"===z[i].type)for($=0,s=(_=z[i].children).length-1;s>=0;s--)if(\"link_close\"!==(w=_[s]).type){if(\"htmltag\"===w.type&&(isLinkOpen(w.content)&&$>0&&$--,isLinkClose(w.content)&&$++),!($>0)&&\"text\"===w.type&&mA.test(w.content)){if(Y||(V=(Y=createLinkifier()).links,U=Y.autolinker),x=w.content,V.length=0,U.link(x),!V.length)continue;for(C=[],B=w.level,j=0;j<V.length;j++)o.inline.validateLink(V[j].url)&&((L=x.indexOf(V[j].text))&&C.push({type:\"text\",content:x.slice(0,L),level:B}),C.push({type:\"link_open\",href:V[j].url,title:\"\",level:B++}),C.push({type:\"text\",content:V[j].text,level:B}),C.push({type:\"link_close\",level:--B}),x=x.slice(L+V[j].text.length));x.length&&C.push({type:\"text\",content:x,level:B}),z[i].children=_=[].concat(_.slice(0,s),C,_.slice(s+1))}}else for(s--;_[s].level!==w.level&&\"link_open\"!==_[s].type;)s--}function linkify(o){o.core.ruler.push(\"linkify\",parseTokens)}var gA=__webpack_require__(42838),yA=__webpack_require__.n(gA);yA().addHook&&yA().addHook(\"beforeSanitizeElements\",(function(o){return o.href&&o.setAttribute(\"rel\",\"noopener noreferrer\"),o}));const vA=function Markdown({source:o,className:s=\"\",getConfigs:i=(()=>({useUnsafeMarkdown:!1}))}){if(\"string\"!=typeof o)return null;const u=new Remarkable({html:!0,typographer:!0,breaks:!0,linkTarget:\"_blank\"}).use(linkify);u.core.ruler.disable([\"replacements\",\"smartquotes\"]);const{useUnsafeMarkdown:_}=i(),w=u.render(o),x=sanitizer(w,{useUnsafeMarkdown:_});return o&&w&&x?Pe.createElement(\"div\",{className:To()(s,\"markdown\"),dangerouslySetInnerHTML:{__html:x}}):null};function sanitizer(o,{useUnsafeMarkdown:s=!1}={}){const i=s,u=s?[]:[\"style\",\"class\"];return s&&!sanitizer.hasWarnedAboutDeprecation&&(console.warn(\"useUnsafeMarkdown display configuration parameter is deprecated since >3.26.0 and will be removed in v4.0.0.\"),sanitizer.hasWarnedAboutDeprecation=!0),yA().sanitize(o,{ADD_ATTR:[\"target\"],FORBID_TAGS:[\"style\",\"form\"],ALLOW_DATA_ATTR:i,FORBID_ATTR:u})}sanitizer.hasWarnedAboutDeprecation=!1;class BaseLayout extends Pe.Component{render(){const{errSelectors:o,specSelectors:s,getComponent:i}=this.props,u=i(\"SvgAssets\"),_=i(\"InfoContainer\",!0),w=i(\"VersionPragmaFilter\"),x=i(\"operations\",!0),C=i(\"Models\",!0),j=i(\"Webhooks\",!0),L=i(\"Row\"),B=i(\"Col\"),$=i(\"errors\",!0),V=i(\"ServersContainer\",!0),U=i(\"SchemesContainer\",!0),z=i(\"AuthorizeBtnContainer\",!0),Y=i(\"FilterContainer\",!0),Z=s.isSwagger2(),ee=s.isOAS3(),ie=s.isOAS31(),ae=!s.specStr(),ce=s.loadingStatus();let le=null;if(\"loading\"===ce&&(le=Pe.createElement(\"div\",{className:\"info\"},Pe.createElement(\"div\",{className:\"loading-container\"},Pe.createElement(\"div\",{className:\"loading\"})))),\"failed\"===ce&&(le=Pe.createElement(\"div\",{className:\"info\"},Pe.createElement(\"div\",{className:\"loading-container\"},Pe.createElement(\"h4\",{className:\"title\"},\"Failed to load API definition.\"),Pe.createElement($,null)))),\"failedConfig\"===ce){const s=o.lastError(),i=s?s.get(\"message\"):\"\";le=Pe.createElement(\"div\",{className:\"info failed-config\"},Pe.createElement(\"div\",{className:\"loading-container\"},Pe.createElement(\"h4\",{className:\"title\"},\"Failed to load remote configuration.\"),Pe.createElement(\"p\",null,i)))}if(!le&&ae&&(le=Pe.createElement(\"h4\",null,\"No API definition provided.\")),le)return Pe.createElement(\"div\",{className:\"swagger-ui\"},Pe.createElement(\"div\",{className:\"loading-container\"},le));const pe=s.servers(),de=s.schemes(),fe=pe&&pe.size,ye=de&&de.size,be=!!s.securityDefinitions();return Pe.createElement(\"div\",{className:\"swagger-ui\"},Pe.createElement(u,null),Pe.createElement(w,{isSwagger2:Z,isOAS3:ee,alsoShow:Pe.createElement($,null)},Pe.createElement($,null),Pe.createElement(L,{className:\"information-container\"},Pe.createElement(B,{mobile:12},Pe.createElement(_,null))),fe||ye||be?Pe.createElement(\"div\",{className:\"scheme-container\"},Pe.createElement(B,{className:\"schemes wrapper\",mobile:12},fe||ye?Pe.createElement(\"div\",{className:\"schemes-server-container\"},fe?Pe.createElement(V,null):null,ye?Pe.createElement(U,null):null):null,be?Pe.createElement(z,null):null)):null,Pe.createElement(Y,null),Pe.createElement(L,null,Pe.createElement(B,{mobile:12,desktop:12},Pe.createElement(x,null))),ie&&Pe.createElement(L,{className:\"webhooks-container\"},Pe.createElement(B,{mobile:12,desktop:12},Pe.createElement(j,null))),Pe.createElement(L,null,Pe.createElement(B,{mobile:12,desktop:12},Pe.createElement(C,null)))))}}const core_components=()=>({components:{App:wO,authorizationPopup:AuthorizationPopup,authorizeBtn:AuthorizeBtn,AuthorizeBtnContainer,authorizeOperationBtn:AuthorizeOperationBtn,auths:Auths,AuthItem:auth_item_Auths,authError:AuthError,oauth2:Oauth2,apiKeyAuth:ApiKeyAuth,basicAuth:BasicAuth,clear:Clear,liveResponse:LiveResponse,InitializedInput,info:IO,InfoContainer,InfoUrl,InfoBasePath,Contact:MO,License:NO,JumpToPath,CopyToClipboardBtn,onlineValidatorBadge:OnlineValidatorBadge,operations:Operations,operation:operation_Operation,OperationSummary,OperationSummaryMethod,OperationSummaryPath,responses:responses_Responses,response:response_Response,ResponseExtension:response_extension,responseBody:ResponseBody,parameters:Parameters,parameterRow:ParameterRow,execute:Execute,headers:headers_Headers,errors:Errors,contentType:ContentType,overview:Overview,footer:Footer,FilterContainer,ParamBody,curl:Curl,Property:property,TryItOutButton,Markdown:vA,BaseLayout,VersionPragmaFilter,VersionStamp:version_stamp,OperationExt:operation_extensions,OperationExtRow:operation_extension_row,ParameterExt:parameter_extension,ParameterIncludeEmpty,OperationTag,OperationContainer,OpenAPIVersion:openapi_version,DeepLink:deep_link,SvgAssets:svg_assets,Example:example_Example,ExamplesSelect,ExamplesSelectValueRetainer}}),form_components=()=>({components:{...ye}}),base=()=>[configsPlugin,util,logs,view,view_legacy,plugins_spec,err,icons,plugins_layout,json_schema_5,json_schema_5_samples,core_components,form_components,swagger_client,auth,downloadUrlPlugin,deep_linking,filter,on_complete,plugins_request_snippets,syntax_highlighting,versions,safe_render()],bA=(0,qe.Map)();function onlyOAS3(o){return(s,i)=>(...u)=>{if(i.getSystem().specSelectors.isOAS3()){const s=o(...u);return\"function\"==typeof s?s(i):s}return s(...u)}}const _A=onlyOAS3(us()(null)),EA=onlyOAS3(((o,s)=>o=>o.getSystem().specSelectors.findSchema(s))),wA=onlyOAS3((()=>o=>{const s=o.getSystem().specSelectors.specJson().getIn([\"components\",\"schemas\"]);return qe.Map.isMap(s)?s:bA})),SA=onlyOAS3((()=>o=>o.getSystem().specSelectors.specJson().hasIn([\"servers\",0]))),xA=onlyOAS3(Wt(bs,(o=>o.getIn([\"components\",\"securitySchemes\"])||null))),wrap_selectors_validOperationMethods=(o,s)=>(i,...u)=>s.specSelectors.isOAS3()?s.oas3Selectors.validOperationMethods():o(...u),kA=_A,OA=_A,CA=_A,AA=_A,jA=_A;const PA=function wrap_selectors_onlyOAS3(o){return(s,i)=>(...u)=>{if(i.getSystem().specSelectors.isOAS3()){let s=i.getState().getIn([\"spec\",\"resolvedSubtrees\",\"components\",\"securitySchemes\"]);return o(i,s,...u)}return s(...u)}}(Wt((o=>o),(({specSelectors:o})=>o.securityDefinitions()),((o,s)=>{let i=(0,qe.List)();return s?(s.entrySeq().forEach((([o,s])=>{const u=s.get(\"type\");if(\"oauth2\"===u&&s.get(\"flows\").entrySeq().forEach((([u,_])=>{let w=(0,qe.fromJS)({flow:u,authorizationUrl:_.get(\"authorizationUrl\"),tokenUrl:_.get(\"tokenUrl\"),scopes:_.get(\"scopes\"),type:s.get(\"type\"),description:s.get(\"description\")});i=i.push(new qe.Map({[o]:w.filter((o=>void 0!==o))}))})),\"http\"!==u&&\"apiKey\"!==u||(i=i.push(new qe.Map({[o]:s}))),\"openIdConnect\"===u&&s.get(\"openIdConnectData\")){let u=s.get(\"openIdConnectData\");(u.get(\"grant_types_supported\")||[\"authorization_code\",\"implicit\"]).forEach((_=>{let w=u.get(\"scopes_supported\")&&u.get(\"scopes_supported\").reduce(((o,s)=>o.set(s,\"\")),new qe.Map),x=(0,qe.fromJS)({flow:_,authorizationUrl:u.get(\"authorization_endpoint\"),tokenUrl:u.get(\"token_endpoint\"),scopes:w,type:\"oauth2\",openIdConnectUrl:s.get(\"openIdConnectUrl\")});i=i.push(new qe.Map({[o]:x.filter((o=>void 0!==o))}))}))}})),i):i})));function OAS3ComponentWrapFactory(o){return(s,i)=>u=>\"function\"==typeof i.specSelectors?.isOAS3?i.specSelectors.isOAS3()?Pe.createElement(o,wo()({},u,i,{Ori:s})):Pe.createElement(s,u):(console.warn(\"OAS3 wrapper: couldn't get spec\"),null)}const IA=(0,qe.Map)(),selectors_isSwagger2=()=>o=>function isSwagger2(o){const s=o.get(\"swagger\");return\"string\"==typeof s&&\"2.0\"===s}(o.getSystem().specSelectors.specJson()),selectors_isOAS30=()=>o=>function isOAS30(o){const s=o.get(\"openapi\");return\"string\"==typeof s&&/^3\\.0\\.([0123])(?:-rc[012])?$/.test(s)}(o.getSystem().specSelectors.specJson()),selectors_isOAS3=()=>o=>o.getSystem().specSelectors.isOAS30();function selectors_onlyOAS3(o){return(s,...i)=>u=>{if(u.specSelectors.isOAS3()){const _=o(s,...i);return\"function\"==typeof _?_(u):_}return null}}const MA=selectors_onlyOAS3((()=>o=>o.specSelectors.specJson().get(\"servers\",IA))),findSchema=(o,s)=>{const i=o.getIn([\"resolvedSubtrees\",\"components\",\"schemas\",s],null),u=o.getIn([\"json\",\"components\",\"schemas\",s],null);return i||u||null},NA=selectors_onlyOAS3(((o,{callbacks:s,specPath:i})=>o=>{const u=o.specSelectors.validOperationMethods();return qe.Map.isMap(s)?s.reduce(((o,s,_)=>{if(!qe.Map.isMap(s))return o;const w=s.reduce(((o,s,w)=>{if(!qe.Map.isMap(s))return o;const x=s.entrySeq().filter((([o])=>u.includes(o))).map((([o,s])=>({operation:(0,qe.Map)({operation:s}),method:o,path:w,callbackName:_,specPath:i.concat([_,w,o])})));return o.concat(x)}),(0,qe.List)());return o.concat(w)}),(0,qe.List)()).groupBy((o=>o.callbackName)).map((o=>o.toArray())).toObject():{}})),callbacks=({callbacks:o,specPath:s,specSelectors:i,getComponent:u})=>{const _=i.callbacksOperations({callbacks:o,specPath:s}),w=Object.keys(_),x=u(\"OperationContainer\",!0);return 0===w.length?Pe.createElement(\"span\",null,\"No callbacks\"):Pe.createElement(\"div\",null,w.map((o=>Pe.createElement(\"div\",{key:`${o}`},Pe.createElement(\"h2\",null,o),_[o].map((s=>Pe.createElement(x,{key:`${o}-${s.path}-${s.method}`,op:s.operation,tag:\"callbacks\",method:s.method,path:s.path,specPath:s.specPath,allowTryItOut:!1})))))))},getDefaultRequestBodyValue=(o,s,i,u)=>{const _=o.getIn([\"content\",s])??(0,qe.OrderedMap)(),w=_.get(\"schema\",(0,qe.OrderedMap)()).toJS(),x=void 0!==_.get(\"examples\"),C=_.get(\"example\"),j=x?_.getIn([\"examples\",i,\"value\"]):C;return stringify(u.getSampleSchema(w,s,{includeWriteOnly:!0},j))},components_request_body=({userHasEditedBody:o,requestBody:s,requestBodyValue:i,requestBodyInclusionSetting:u,requestBodyErrors:_,getComponent:w,getConfigs:x,specSelectors:C,fn:j,contentType:L,isExecute:B,specPath:$,onChange:V,onChangeIncludeEmpty:U,activeExamplesKey:z,updateActiveExamplesKey:Y,setRetainRequestBodyValueFlag:Z})=>{const handleFile=o=>{V(o.target.files[0])},setIsIncludedOptions=o=>{let s={key:o,shouldDispatchInit:!1,defaultValue:!0};return\"no value\"===u.get(o,\"no value\")&&(s.shouldDispatchInit=!0),s},ee=w(\"Markdown\",!0),ie=w(\"modelExample\"),ae=w(\"RequestBodyEditor\"),ce=w(\"HighlightCode\",!0),le=w(\"ExamplesSelectValueRetainer\"),pe=w(\"Example\"),de=w(\"ParameterIncludeEmpty\"),{showCommonExtensions:fe}=x(),ye=s?.get(\"description\")??null,be=s?.get(\"content\")??new qe.OrderedMap;L=L||be.keySeq().first()||\"\";const _e=be.get(L)??(0,qe.OrderedMap)(),we=_e.get(\"schema\",(0,qe.OrderedMap)()),Se=_e.get(\"examples\",null),xe=Se?.map(((o,i)=>{const u=o?.get(\"value\",null);return u&&(o=o.set(\"value\",getDefaultRequestBodyValue(s,L,i,j),u)),o}));if(_=qe.List.isList(_)?_:(0,qe.List)(),!_e.size)return null;const Te=\"object\"===_e.getIn([\"schema\",\"type\"]),Re=\"binary\"===_e.getIn([\"schema\",\"format\"]),$e=\"base64\"===_e.getIn([\"schema\",\"format\"]);if(\"application/octet-stream\"===L||0===L.indexOf(\"image/\")||0===L.indexOf(\"audio/\")||0===L.indexOf(\"video/\")||Re||$e){const o=w(\"Input\");return B?Pe.createElement(o,{type:\"file\",onChange:handleFile}):Pe.createElement(\"i\",null,\"Example values are not available for \",Pe.createElement(\"code\",null,L),\" media types.\")}if(Te&&(\"application/x-www-form-urlencoded\"===L||0===L.indexOf(\"multipart/\"))&&we.get(\"properties\",(0,qe.OrderedMap)()).size>0){const o=w(\"JsonSchemaForm\"),s=w(\"ParameterExt\"),x=we.get(\"properties\",(0,qe.OrderedMap)());return i=qe.Map.isMap(i)?i:(0,qe.OrderedMap)(),Pe.createElement(\"div\",{className:\"table-container\"},ye&&Pe.createElement(ee,{source:ye}),Pe.createElement(\"table\",null,Pe.createElement(\"tbody\",null,qe.Map.isMap(x)&&x.entrySeq().map((([x,C])=>{if(C.get(\"readOnly\"))return;const L=C.get(\"oneOf\")?.get(0)?.toJS(),$=C.get(\"anyOf\")?.get(0)?.toJS();C=(0,qe.fromJS)(j.mergeJsonSchema(C.toJS(),L??$??{}));let z=fe?getCommonExtensions(C):null;const Y=we.get(\"required\",(0,qe.List)()).includes(x),Z=C.get(\"type\"),ie=C.get(\"format\"),ae=C.get(\"description\"),ce=i.getIn([x,\"value\"]),le=i.getIn([x,\"errors\"])||_,pe=u.get(x)||!1;let ye=j.getSampleSchema(C,!1,{includeWriteOnly:!0});!1===ye&&(ye=\"false\"),0===ye&&(ye=\"0\"),\"string\"!=typeof ye&&\"object\"===Z&&(ye=stringify(ye)),\"string\"==typeof ye&&\"array\"===Z&&(ye=JSON.parse(ye));const be=\"string\"===Z&&(\"binary\"===ie||\"base64\"===ie);return Pe.createElement(\"tr\",{key:x,className:\"parameters\",\"data-property-name\":x},Pe.createElement(\"td\",{className:\"parameters-col_name\"},Pe.createElement(\"div\",{className:Y?\"parameter__name required\":\"parameter__name\"},x,Y?Pe.createElement(\"span\",null,\" *\"):null),Pe.createElement(\"div\",{className:\"parameter__type\"},Z,ie&&Pe.createElement(\"span\",{className:\"prop-format\"},\"($\",ie,\")\"),fe&&z.size?z.entrySeq().map((([o,i])=>Pe.createElement(s,{key:`${o}-${i}`,xKey:o,xVal:i}))):null),Pe.createElement(\"div\",{className:\"parameter__deprecated\"},C.get(\"deprecated\")?\"deprecated\":null)),Pe.createElement(\"td\",{className:\"parameters-col_description\"},Pe.createElement(ee,{source:ae}),B?Pe.createElement(\"div\",null,Pe.createElement(o,{fn:j,dispatchInitialValue:!be,schema:C,description:x,getComponent:w,value:void 0===ce?ye:ce,required:Y,errors:le,onChange:o=>{V(o,[x])}}),Y?null:Pe.createElement(de,{onChange:o=>U(x,o),isIncluded:pe,isIncludedOptions:setIsIncludedOptions(x),isDisabled:Array.isArray(ce)?0!==ce.length:!isEmptyValue(ce)})):null))})))))}const ze=getDefaultRequestBodyValue(s,L,z,j);let We=null;return getKnownSyntaxHighlighterLanguage(ze)&&(We=\"json\"),Pe.createElement(\"div\",null,ye&&Pe.createElement(ee,{source:ye}),xe?Pe.createElement(le,{userHasEditedBody:o,examples:xe,currentKey:z,currentUserInputValue:i,onSelect:o=>{Y(o)},updateValue:V,defaultToFirstExample:!0,getComponent:w,setRetainRequestBodyValueFlag:Z}):null,B?Pe.createElement(\"div\",null,Pe.createElement(ae,{value:i,errors:_,defaultValue:ze,onChange:V,getComponent:w})):Pe.createElement(ie,{getComponent:w,getConfigs:x,specSelectors:C,expandDepth:1,isExecute:B,schema:_e.get(\"schema\"),specPath:$.push(\"content\",L),example:Pe.createElement(ce,{className:\"body-param__example\",language:We},stringify(i)||ze),includeWriteOnly:!0}),xe?Pe.createElement(pe,{example:xe.get(z),getComponent:w,getConfigs:x}):null)};class operation_link_OperationLink extends Pe.Component{render(){const{link:o,name:s,getComponent:i}=this.props,u=i(\"Markdown\",!0);let _=o.get(\"operationId\")||o.get(\"operationRef\"),w=o.get(\"parameters\")&&o.get(\"parameters\").toJS(),x=o.get(\"description\");return Pe.createElement(\"div\",{className:\"operation-link\"},Pe.createElement(\"div\",{className:\"description\"},Pe.createElement(\"b\",null,Pe.createElement(\"code\",null,s)),x?Pe.createElement(u,{source:x}):null),Pe.createElement(\"pre\",null,\"Operation `\",_,\"`\",Pe.createElement(\"br\",null),Pe.createElement(\"br\",null),\"Parameters \",function padString(o,s){if(\"string\"!=typeof s)return\"\";return s.split(\"\\n\").map(((s,i)=>i>0?Array(o+1).join(\" \")+s:s)).join(\"\\n\")}(0,JSON.stringify(w,null,2))||\"{}\",Pe.createElement(\"br\",null)))}}const TA=operation_link_OperationLink,components_servers=({servers:o,currentServer:s,setSelectedServer:i,setServerVariableValue:u,getServerVariable:_,getEffectiveServerValue:w})=>{const x=(o.find((o=>o.get(\"url\")===s))||(0,qe.OrderedMap)()).get(\"variables\")||(0,qe.OrderedMap)(),C=0!==x.size;(0,Pe.useEffect)((()=>{s||i(o.first()?.get(\"url\"))}),[]),(0,Pe.useEffect)((()=>{const _=o.find((o=>o.get(\"url\")===s));if(!_)return void i(o.first().get(\"url\"));(_.get(\"variables\")||(0,qe.OrderedMap)()).map(((o,i)=>{u({server:s,key:i,val:o.get(\"default\")||\"\"})}))}),[s,o]);const j=(0,Pe.useCallback)((o=>{i(o.target.value)}),[i]),L=(0,Pe.useCallback)((o=>{const i=o.target.getAttribute(\"data-variable\"),_=o.target.value;u({server:s,key:i,val:_})}),[u,s]);return Pe.createElement(\"div\",{className:\"servers\"},Pe.createElement(\"label\",{htmlFor:\"servers\"},Pe.createElement(\"select\",{onChange:j,value:s,id:\"servers\"},o.valueSeq().map((o=>Pe.createElement(\"option\",{value:o.get(\"url\"),key:o.get(\"url\")},o.get(\"url\"),o.get(\"description\")&&` - ${o.get(\"description\")}`))).toArray())),C&&Pe.createElement(\"div\",null,Pe.createElement(\"div\",{className:\"computed-url\"},\"Computed URL:\",Pe.createElement(\"code\",null,w(s))),Pe.createElement(\"h4\",null,\"Server variables\"),Pe.createElement(\"table\",null,Pe.createElement(\"tbody\",null,x.entrySeq().map((([o,i])=>Pe.createElement(\"tr\",{key:o},Pe.createElement(\"td\",null,o),Pe.createElement(\"td\",null,i.get(\"enum\")?Pe.createElement(\"select\",{\"data-variable\":o,onChange:L},i.get(\"enum\").map((i=>Pe.createElement(\"option\",{selected:i===_(s,o),key:i,value:i},i)))):Pe.createElement(\"input\",{type:\"text\",value:_(s,o)||\"\",onChange:L,\"data-variable\":o})))))))))};class ServersContainer extends Pe.Component{render(){const{specSelectors:o,oas3Selectors:s,oas3Actions:i,getComponent:u}=this.props,_=o.servers(),w=u(\"Servers\");return _&&_.size?Pe.createElement(\"div\",null,Pe.createElement(\"span\",{className:\"servers-title\"},\"Servers\"),Pe.createElement(w,{servers:_,currentServer:s.selectedServer(),setSelectedServer:i.setSelectedServer,setServerVariableValue:i.setServerVariableValue,getServerVariable:s.serverVariableValue,getEffectiveServerValue:s.serverEffectiveValue})):null}}const RA=Function.prototype;class RequestBodyEditor extends Pe.PureComponent{static defaultProps={onChange:RA,userHasEditedBody:!1};constructor(o,s){super(o,s),this.state={value:stringify(o.value)||o.defaultValue},o.onChange(o.value)}applyDefaultValue=o=>{const{onChange:s,defaultValue:i}=o||this.props;return this.setState({value:i}),s(i)};onChange=o=>{this.props.onChange(stringify(o))};onDomChange=o=>{const s=o.target.value;this.setState({value:s},(()=>this.onChange(s)))};UNSAFE_componentWillReceiveProps(o){this.props.value!==o.value&&o.value!==this.state.value&&this.setState({value:stringify(o.value)}),!o.value&&o.defaultValue&&this.state.value&&this.applyDefaultValue(o)}render(){let{getComponent:o,errors:s}=this.props,{value:i}=this.state,u=s.size>0;const _=o(\"TextArea\");return Pe.createElement(\"div\",{className:\"body-param\"},Pe.createElement(_,{className:To()(\"body-param__text\",{invalid:u}),title:s.size?s.join(\", \"):\"\",value:i,onChange:this.onDomChange}))}}class HttpAuth extends Pe.Component{constructor(o,s){super(o,s);let{name:i,schema:u}=this.props,_=this.getValue();this.state={name:i,schema:u,value:_}}getValue(){let{name:o,authorized:s}=this.props;return s&&s.getIn([o,\"value\"])}onChange=o=>{let{onChange:s}=this.props,{value:i,name:u}=o.target,_=Object.assign({},this.state.value);u?_[u]=i:_=i,this.setState({value:_},(()=>s(this.state)))};render(){let{schema:o,getComponent:s,errSelectors:i,name:u}=this.props;const _=s(\"Input\"),w=s(\"Row\"),x=s(\"Col\"),C=s(\"authError\"),j=s(\"Markdown\",!0),L=s(\"JumpToPath\",!0),B=(o.get(\"scheme\")||\"\").toLowerCase();let $=this.getValue(),V=i.allErrors().filter((o=>o.get(\"authId\")===u));if(\"basic\"===B){let s=$?$.get(\"username\"):null;return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,Pe.createElement(\"code\",null,u||o.get(\"name\")),\"  (http, Basic)\",Pe.createElement(L,{path:[\"securityDefinitions\",u]})),s&&Pe.createElement(\"h6\",null,\"Authorized\"),Pe.createElement(w,null,Pe.createElement(j,{source:o.get(\"description\")})),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth-basic-username\"},\"Username:\"),s?Pe.createElement(\"code\",null,\" \",s,\" \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth-basic-username\",type:\"text\",required:\"required\",name:\"username\",\"aria-label\":\"auth-basic-username\",onChange:this.onChange,autoFocus:!0}))),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth-basic-password\"},\"Password:\"),s?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth-basic-password\",autoComplete:\"new-password\",name:\"password\",type:\"password\",\"aria-label\":\"auth-basic-password\",onChange:this.onChange}))),V.valueSeq().map(((o,s)=>Pe.createElement(C,{error:o,key:s}))))}return\"bearer\"===B?Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,Pe.createElement(\"code\",null,u||o.get(\"name\")),\"  (http, Bearer)\",Pe.createElement(L,{path:[\"securityDefinitions\",u]})),$&&Pe.createElement(\"h6\",null,\"Authorized\"),Pe.createElement(w,null,Pe.createElement(j,{source:o.get(\"description\")})),Pe.createElement(w,null,Pe.createElement(\"label\",{htmlFor:\"auth-bearer-value\"},\"Value:\"),$?Pe.createElement(\"code\",null,\" ****** \"):Pe.createElement(x,null,Pe.createElement(_,{id:\"auth-bearer-value\",type:\"text\",\"aria-label\":\"auth-bearer-value\",onChange:this.onChange,autoFocus:!0}))),V.valueSeq().map(((o,s)=>Pe.createElement(C,{error:o,key:s})))):Pe.createElement(\"div\",null,Pe.createElement(\"em\",null,Pe.createElement(\"b\",null,u),\" HTTP authentication: unsupported scheme \",`'${B}'`))}}class operation_servers_OperationServers extends Pe.Component{setSelectedServer=o=>{const{path:s,method:i}=this.props;return this.forceUpdate(),this.props.setSelectedServer(o,`${s}:${i}`)};setServerVariableValue=o=>{const{path:s,method:i}=this.props;return this.forceUpdate(),this.props.setServerVariableValue({...o,namespace:`${s}:${i}`})};getSelectedServer=()=>{const{path:o,method:s}=this.props;return this.props.getSelectedServer(`${o}:${s}`)};getServerVariable=(o,s)=>{const{path:i,method:u}=this.props;return this.props.getServerVariable({namespace:`${i}:${u}`,server:o},s)};getEffectiveServerValue=o=>{const{path:s,method:i}=this.props;return this.props.getEffectiveServerValue({server:o,namespace:`${s}:${i}`})};render(){const{operationServers:o,pathServers:s,getComponent:i}=this.props;if(!o&&!s)return null;const u=i(\"Servers\"),_=o||s,w=o?\"operation\":\"path\";return Pe.createElement(\"div\",{className:\"opblock-section operation-servers\"},Pe.createElement(\"div\",{className:\"opblock-section-header\"},Pe.createElement(\"div\",{className:\"tab-header\"},Pe.createElement(\"h4\",{className:\"opblock-title\"},\"Servers\"))),Pe.createElement(\"div\",{className:\"opblock-description-wrapper\"},Pe.createElement(\"h4\",{className:\"message\"},\"These \",w,\"-level options override the global server options.\"),Pe.createElement(u,{servers:_,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}const DA={Callbacks:callbacks,HttpAuth,RequestBody:components_request_body,Servers:components_servers,ServersContainer,RequestBodyEditor,OperationServers:operation_servers_OperationServers,operationLink:TA},LA=new Remarkable(\"commonmark\");LA.block.ruler.enable([\"table\"]),LA.set({linkTarget:\"_blank\"});const BA=OAS3ComponentWrapFactory((({source:o,className:s=\"\",getConfigs:i=(()=>({useUnsafeMarkdown:!1}))})=>{if(\"string\"!=typeof o)return null;if(o){const{useUnsafeMarkdown:u}=i(),_=sanitizer(LA.render(o),{useUnsafeMarkdown:u});let w;return\"string\"==typeof _&&(w=_.trim()),Pe.createElement(\"div\",{dangerouslySetInnerHTML:{__html:w},className:To()(s,\"renderedMarkdown\")})}return null})),FA=OAS3ComponentWrapFactory((({Ori:o,...s})=>{const{schema:i,getComponent:u,errSelectors:_,authorized:w,onAuthChange:x,name:C}=s,j=u(\"HttpAuth\");return\"http\"===i.get(\"type\")?Pe.createElement(j,{key:C,schema:i,name:C,errSelectors:_,authorized:w,getComponent:u,onChange:x}):Pe.createElement(o,s)})),qA=OAS3ComponentWrapFactory(OnlineValidatorBadge);class ModelComponent extends Pe.Component{render(){let{getConfigs:o,schema:s,Ori:i}=this.props,u=[\"model-box\"],_=null;return!0===s.get(\"deprecated\")&&(u.push(\"deprecated\"),_=Pe.createElement(\"span\",{className:\"model-deprecated-warning\"},\"Deprecated:\")),Pe.createElement(\"div\",{className:u.join(\" \")},_,Pe.createElement(i,wo()({},this.props,{getConfigs:o,depth:1,expandDepth:this.props.expandDepth||0})))}}const $A=OAS3ComponentWrapFactory(ModelComponent),VA=OAS3ComponentWrapFactory((({Ori:o,...s})=>{const{schema:i,getComponent:u,errors:_,onChange:w}=s,x=i&&i.get?i.get(\"format\"):null,C=i&&i.get?i.get(\"type\"):null,j=u(\"Input\");return C&&\"string\"===C&&x&&(\"binary\"===x||\"base64\"===x)?Pe.createElement(j,{type:\"file\",className:_.length?\"invalid\":\"\",title:_.length?_:\"\",onChange:o=>{w(o.target.files[0])},disabled:o.isDisabled}):Pe.createElement(o,s)})),UA={Markdown:BA,AuthItem:FA,OpenAPIVersion:function OAS30ComponentWrapFactory(o){return(s,i)=>u=>\"function\"==typeof i.specSelectors?.isOAS30?i.specSelectors.isOAS30()?Pe.createElement(o,wo()({},u,i,{Ori:s})):Pe.createElement(s,u):(console.warn(\"OAS30 wrapper: couldn't get spec\"),null)}((o=>{const{Ori:s}=o;return Pe.createElement(s,{oasVersion:\"3.0\"})})),JsonSchema_string:VA,model:$A,onlineValidatorBadge:qA},zA=\"oas3_set_servers\",WA=\"oas3_set_request_body_value\",KA=\"oas3_set_request_body_retain_flag\",HA=\"oas3_set_request_body_inclusion\",JA=\"oas3_set_active_examples_member\",GA=\"oas3_set_request_content_type\",YA=\"oas3_set_response_content_type\",XA=\"oas3_set_server_variable_value\",QA=\"oas3_set_request_body_validate_error\",ZA=\"oas3_clear_request_body_validate_error\",ej=\"oas3_clear_request_body_value\";function setSelectedServer(o,s){return{type:zA,payload:{selectedServerUrl:o,namespace:s}}}function setRequestBodyValue({value:o,pathMethod:s}){return{type:WA,payload:{value:o,pathMethod:s}}}const setRetainRequestBodyValueFlag=({value:o,pathMethod:s})=>({type:KA,payload:{value:o,pathMethod:s}});function setRequestBodyInclusion({value:o,pathMethod:s,name:i}){return{type:HA,payload:{value:o,pathMethod:s,name:i}}}function setActiveExamplesMember({name:o,pathMethod:s,contextType:i,contextName:u}){return{type:JA,payload:{name:o,pathMethod:s,contextType:i,contextName:u}}}function setRequestContentType({value:o,pathMethod:s}){return{type:GA,payload:{value:o,pathMethod:s}}}function setResponseContentType({value:o,path:s,method:i}){return{type:YA,payload:{value:o,path:s,method:i}}}function setServerVariableValue({server:o,namespace:s,key:i,val:u}){return{type:XA,payload:{server:o,namespace:s,key:i,val:u}}}const setRequestBodyValidateError=({path:o,method:s,validationErrors:i})=>({type:QA,payload:{path:o,method:s,validationErrors:i}}),clearRequestBodyValidateError=({path:o,method:s})=>({type:ZA,payload:{path:o,method:s}}),initRequestBodyValidateError=({pathMethod:o})=>({type:ZA,payload:{path:o[0],method:o[1]}}),clearRequestBodyValue=({pathMethod:o})=>({type:ej,payload:{pathMethod:o}});var fj=__webpack_require__(60680),mj=__webpack_require__.n(fj);const oas3_selectors_onlyOAS3=o=>(s,...i)=>u=>{if(u.getSystem().specSelectors.isOAS3()){const _=o(s,...i);return\"function\"==typeof _?_(u):_}return null};const _j=oas3_selectors_onlyOAS3(((o,s)=>{const i=s?[s,\"selectedServer\"]:[\"selectedServer\"];return o.getIn(i)||\"\"})),Cj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"bodyValue\"])||null)),Aj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"retainBodyValue\"])||!1)),selectDefaultRequestBodyValue=(o,s,i)=>o=>{const{oas3Selectors:u,specSelectors:_,fn:w}=o.getSystem();if(_.isOAS3()){const o=u.requestContentType(s,i);if(o)return getDefaultRequestBodyValue(_.specResolvedSubtree([\"paths\",s,i,\"requestBody\"]),o,u.activeExamplesMember(s,i,\"requestBody\",\"requestBody\"),w)}return null},Nj=oas3_selectors_onlyOAS3(((o,s,i)=>o=>{const{oas3Selectors:u,specSelectors:_,fn:w}=o;let x=!1;const C=u.requestContentType(s,i);let j=u.requestBodyValue(s,i);const L=_.specResolvedSubtree([\"paths\",s,i,\"requestBody\"]);if(!L)return!1;if(qe.Map.isMap(j)&&(j=stringify(j.mapEntries((o=>qe.Map.isMap(o[1])?[o[0],o[1].get(\"value\")]:o)).toJS())),qe.List.isList(j)&&(j=stringify(j)),C){const o=getDefaultRequestBodyValue(L,C,u.activeExamplesMember(s,i,\"requestBody\",\"requestBody\"),w);x=!!j&&j!==o}return x})),Bj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"bodyInclusion\"])||(0,qe.Map)())),$j=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"errors\"])||null)),zj=oas3_selectors_onlyOAS3(((o,s,i,u,_)=>o.getIn([\"examples\",s,i,u,_,\"activeExample\"])||null)),Kj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"requestContentType\"])||null)),Jj=oas3_selectors_onlyOAS3(((o,s,i)=>o.getIn([\"requestData\",s,i,\"responseContentType\"])||null)),Gj=oas3_selectors_onlyOAS3(((o,s,i)=>{let u;if(\"string\"!=typeof s){const{server:o,namespace:_}=s;u=_?[_,\"serverVariableValues\",o,i]:[\"serverVariableValues\",o,i]}else{u=[\"serverVariableValues\",s,i]}return o.getIn(u)||null})),Xj=oas3_selectors_onlyOAS3(((o,s)=>{let i;if(\"string\"!=typeof s){const{server:o,namespace:u}=s;i=u?[u,\"serverVariableValues\",o]:[\"serverVariableValues\",o]}else{i=[\"serverVariableValues\",s]}return o.getIn(i)||(0,qe.OrderedMap)()})),eP=oas3_selectors_onlyOAS3(((o,s)=>{var i,u;if(\"string\"!=typeof s){const{server:_,namespace:w}=s;u=_,i=w?o.getIn([w,\"serverVariableValues\",u]):o.getIn([\"serverVariableValues\",u])}else u=s,i=o.getIn([\"serverVariableValues\",u]);i=i||(0,qe.OrderedMap)();let _=u;return i.map(((o,s)=>{_=_.replace(new RegExp(`{${mj()(s)}}`,\"g\"),o)})),_})),tP=function validateRequestBodyIsRequired(o){return(...s)=>i=>{const u=i.getSystem().specSelectors.specJson();let _=[...s][1]||[];return!u.getIn([\"paths\",..._,\"requestBody\",\"required\"])||o(...s)}}(((o,s)=>((o,s)=>(s=s||[],!!o.getIn([\"requestData\",...s,\"bodyValue\"])))(o,s))),validateShallowRequired=(o,{oas3RequiredRequestBodyContentType:s,oas3RequestContentType:i,oas3RequestBodyValue:u})=>{let _=[];if(!qe.Map.isMap(u))return _;let w=[];return Object.keys(s.requestContentType).forEach((o=>{if(o===i){s.requestContentType[o].forEach((o=>{w.indexOf(o)<0&&w.push(o)}))}})),w.forEach((o=>{u.getIn([o,\"value\"])||_.push(o)})),_},rP=us()([\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"]),nP={[zA]:(o,{payload:{selectedServerUrl:s,namespace:i}})=>{const u=i?[i,\"selectedServer\"]:[\"selectedServer\"];return o.setIn(u,s)},[WA]:(o,{payload:{value:s,pathMethod:i}})=>{let[u,_]=i;if(!qe.Map.isMap(s))return o.setIn([\"requestData\",u,_,\"bodyValue\"],s);let w,x=o.getIn([\"requestData\",u,_,\"bodyValue\"])||(0,qe.Map)();qe.Map.isMap(x)||(x=(0,qe.Map)());const[...C]=s.keys();return C.forEach((o=>{let i=s.getIn([o]);x.has(o)&&qe.Map.isMap(i)||(w=x.setIn([o,\"value\"],i))})),o.setIn([\"requestData\",u,_,\"bodyValue\"],w)},[KA]:(o,{payload:{value:s,pathMethod:i}})=>{let[u,_]=i;return o.setIn([\"requestData\",u,_,\"retainBodyValue\"],s)},[HA]:(o,{payload:{value:s,pathMethod:i,name:u}})=>{let[_,w]=i;return o.setIn([\"requestData\",_,w,\"bodyInclusion\",u],s)},[JA]:(o,{payload:{name:s,pathMethod:i,contextType:u,contextName:_}})=>{let[w,x]=i;return o.setIn([\"examples\",w,x,u,_,\"activeExample\"],s)},[GA]:(o,{payload:{value:s,pathMethod:i}})=>{let[u,_]=i;return o.setIn([\"requestData\",u,_,\"requestContentType\"],s)},[YA]:(o,{payload:{value:s,path:i,method:u}})=>o.setIn([\"requestData\",i,u,\"responseContentType\"],s),[XA]:(o,{payload:{server:s,namespace:i,key:u,val:_}})=>{const w=i?[i,\"serverVariableValues\",s,u]:[\"serverVariableValues\",s,u];return o.setIn(w,_)},[QA]:(o,{payload:{path:s,method:i,validationErrors:u}})=>{let _=[];if(_.push(\"Required field is not provided\"),u.missingBodyValue)return o.setIn([\"requestData\",s,i,\"errors\"],(0,qe.fromJS)(_));if(u.missingRequiredKeys&&u.missingRequiredKeys.length>0){const{missingRequiredKeys:w}=u;return o.updateIn([\"requestData\",s,i,\"bodyValue\"],(0,qe.fromJS)({}),(o=>w.reduce(((o,s)=>o.setIn([s,\"errors\"],(0,qe.fromJS)(_))),o)))}return console.warn(\"unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR\"),o},[ZA]:(o,{payload:{path:s,method:i}})=>{const u=o.getIn([\"requestData\",s,i,\"bodyValue\"]);if(!qe.Map.isMap(u))return o.setIn([\"requestData\",s,i,\"errors\"],(0,qe.fromJS)([]));const[..._]=u.keys();return _?o.updateIn([\"requestData\",s,i,\"bodyValue\"],(0,qe.fromJS)({}),(o=>_.reduce(((o,s)=>o.setIn([s,\"errors\"],(0,qe.fromJS)([]))),o))):o},[ej]:(o,{payload:{pathMethod:s}})=>{let[i,u]=s;const _=o.getIn([\"requestData\",i,u,\"bodyValue\"]);return _?qe.Map.isMap(_)?o.setIn([\"requestData\",i,u,\"bodyValue\"],(0,qe.Map)()):o.setIn([\"requestData\",i,u,\"bodyValue\"],\"\"):o}};function oas3(){return{components:DA,wrapComponents:UA,statePlugins:{spec:{wrapSelectors:be,selectors:we},auth:{wrapSelectors:_e},oas3:{actions:{...Se},reducers:nP,selectors:{...xe}}}}}const webhooks=({specSelectors:o,getComponent:s})=>{const i=o.selectWebhooksOperations(),u=Object.keys(i),_=s(\"OperationContainer\",!0);return 0===u.length?null:Pe.createElement(\"div\",{className:\"webhooks\"},Pe.createElement(\"h2\",null,\"Webhooks\"),u.map((o=>Pe.createElement(\"div\",{key:`${o}-webhook`},i[o].map((s=>Pe.createElement(_,{key:`${o}-${s.method}-webhook`,op:s.operation,tag:\"webhooks\",method:s.method,path:o,specPath:(0,qe.List)(s.specPath),allowTryItOut:!1})))))))},oas31_components_license=({getComponent:o,specSelectors:s})=>{const i=s.selectLicenseNameField(),u=s.selectLicenseUrl(),_=o(\"Link\");return Pe.createElement(\"div\",{className:\"info__license\"},u?Pe.createElement(\"div\",{className:\"info__license__url\"},Pe.createElement(_,{target:\"_blank\",href:sanitizeUrl(u)},i)):Pe.createElement(\"span\",null,i))},oas31_components_contact=({getComponent:o,specSelectors:s})=>{const i=s.selectContactNameField(),u=s.selectContactUrl(),_=s.selectContactEmailField(),w=o(\"Link\");return Pe.createElement(\"div\",{className:\"info__contact\"},u&&Pe.createElement(\"div\",null,Pe.createElement(w,{href:sanitizeUrl(u),target:\"_blank\"},i,\" - Website\")),_&&Pe.createElement(w,{href:sanitizeUrl(`mailto:${_}`)},u?`Send email to ${i}`:`Contact ${i}`))},oas31_components_info=({getComponent:o,specSelectors:s})=>{const i=s.version(),u=s.url(),_=s.basePath(),w=s.host(),x=s.selectInfoSummaryField(),C=s.selectInfoDescriptionField(),j=s.selectInfoTitleField(),L=s.selectInfoTermsOfServiceUrl(),B=s.selectExternalDocsUrl(),$=s.selectExternalDocsDescriptionField(),V=s.contact(),U=s.license(),z=o(\"Markdown\",!0),Y=o(\"Link\"),Z=o(\"VersionStamp\"),ee=o(\"OpenAPIVersion\"),ie=o(\"InfoUrl\"),ae=o(\"InfoBasePath\"),ce=o(\"License\",!0),le=o(\"Contact\",!0),pe=o(\"JsonSchemaDialect\",!0);return Pe.createElement(\"div\",{className:\"info\"},Pe.createElement(\"hgroup\",{className:\"main\"},Pe.createElement(\"h2\",{className:\"title\"},j,Pe.createElement(\"span\",null,i&&Pe.createElement(Z,{version:i}),Pe.createElement(ee,{oasVersion:\"3.1\"}))),(w||_)&&Pe.createElement(ae,{host:w,basePath:_}),u&&Pe.createElement(ie,{getComponent:o,url:u})),x&&Pe.createElement(\"p\",{className:\"info__summary\"},x),Pe.createElement(\"div\",{className:\"info__description description\"},Pe.createElement(z,{source:C})),L&&Pe.createElement(\"div\",{className:\"info__tos\"},Pe.createElement(Y,{target:\"_blank\",href:sanitizeUrl(L)},\"Terms of service\")),V.size>0&&Pe.createElement(le,null),U.size>0&&Pe.createElement(ce,null),B&&Pe.createElement(Y,{className:\"info__extdocs\",target:\"_blank\",href:sanitizeUrl(B)},$||B),Pe.createElement(pe,null))},json_schema_dialect=({getComponent:o,specSelectors:s})=>{const i=s.selectJsonSchemaDialectField(),u=s.selectJsonSchemaDialectDefault(),_=o(\"Link\");return Pe.createElement(Pe.Fragment,null,i&&i===u&&Pe.createElement(\"p\",{className:\"info__jsonschemadialect\"},\"JSON Schema dialect:\",\" \",Pe.createElement(_,{target:\"_blank\",href:sanitizeUrl(i)},i)),i&&i!==u&&Pe.createElement(\"div\",{className:\"error-wrapper\"},Pe.createElement(\"div\",{className:\"no-margin\"},Pe.createElement(\"div\",{className:\"errors\"},Pe.createElement(\"div\",{className:\"errors-wrapper\"},Pe.createElement(\"h4\",{className:\"center\"},\"Warning\"),Pe.createElement(\"p\",{className:\"message\"},Pe.createElement(\"strong\",null,\"OpenAPI.jsonSchemaDialect\"),\" field contains a value different from the default value of\",\" \",Pe.createElement(_,{target:\"_blank\",href:u},u),\". Values different from the default one are currently not supported. Please either omit the field or provide it with the default value.\"))))))},version_pragma_filter=({bypass:o,isSwagger2:s,isOAS3:i,isOAS31:u,alsoShow:_,children:w})=>o?Pe.createElement(\"div\",null,w):s&&(i||u)?Pe.createElement(\"div\",{className:\"version-pragma\"},_,Pe.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--ambiguous\"},Pe.createElement(\"div\",null,Pe.createElement(\"h3\",null,\"Unable to render this definition\"),Pe.createElement(\"p\",null,Pe.createElement(\"code\",null,\"swagger\"),\" and \",Pe.createElement(\"code\",null,\"openapi\"),\" fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields.\"),Pe.createElement(\"p\",null,\"Supported version fields are \",Pe.createElement(\"code\",null,'swagger: \"2.0\"'),\" and those that match \",Pe.createElement(\"code\",null,\"openapi: 3.x.y\"),\" (for example,\",\" \",Pe.createElement(\"code\",null,\"openapi: 3.1.0\"),\").\")))):s||i||u?Pe.createElement(\"div\",null,w):Pe.createElement(\"div\",{className:\"version-pragma\"},_,Pe.createElement(\"div\",{className:\"version-pragma__message version-pragma__message--missing\"},Pe.createElement(\"div\",null,Pe.createElement(\"h3\",null,\"Unable to render this definition\"),Pe.createElement(\"p\",null,\"The provided definition does not specify a valid version field.\"),Pe.createElement(\"p\",null,\"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are \",Pe.createElement(\"code\",null,'swagger: \"2.0\"'),\" and those that match \",Pe.createElement(\"code\",null,\"openapi: 3.x.y\"),\" (for example,\",\" \",Pe.createElement(\"code\",null,\"openapi: 3.1.0\"),\").\")))),getModelName=o=>\"string\"==typeof o&&o.includes(\"#/components/schemas/\")?(o=>{const s=o.replace(/~1/g,\"/\").replace(/~0/g,\"~\");try{return decodeURIComponent(s)}catch{return s}})(o.replace(/^.*#\\/components\\/schemas\\//,\"\")):null,oP=(0,Pe.forwardRef)((({schema:o,getComponent:s,onToggle:i=(()=>{})},u)=>{const _=s(\"JSONSchema202012\"),w=getModelName(o.get(\"$$ref\")),x=(0,Pe.useCallback)(((o,s)=>{i(w,s)}),[w,i]);return Pe.createElement(_,{name:w,schema:o.toJS(),ref:u,onExpand:x})})),sP=oP,models=({specActions:o,specSelectors:s,layoutSelectors:i,layoutActions:u,getComponent:_,getConfigs:w,fn:x})=>{const C=s.selectSchemas(),j=Object.keys(C).length>0,L=[\"components\",\"schemas\"],{docExpansion:B,defaultModelsExpandDepth:$}=w(),V=$>0&&\"none\"!==B,U=i.isShown(L,V),z=_(\"Collapse\"),Y=_(\"JSONSchema202012\"),Z=_(\"ArrowUpIcon\"),ee=_(\"ArrowDownIcon\"),{getTitle:ie}=x.jsonSchema202012.useFn();(0,Pe.useEffect)((()=>{const i=U&&$>1,u=null!=s.specResolvedSubtree(L);i&&!u&&o.requestResolvedSubtree(L)}),[U,$]);const ae=(0,Pe.useCallback)((()=>{u.show(L,!U)}),[U]),ce=(0,Pe.useCallback)((o=>{null!==o&&u.readyToScroll(L,o)}),[]),handleJSONSchema202012Ref=o=>s=>{null!==s&&u.readyToScroll([...L,o],s)},handleJSONSchema202012Expand=i=>(u,_)=>{if(_){const u=[...L,i];null!=s.specResolvedSubtree(u)||o.requestResolvedSubtree([...L,i])}};return!j||$<0?null:Pe.createElement(\"section\",{className:To()(\"models\",{\"is-open\":U}),ref:ce},Pe.createElement(\"h4\",null,Pe.createElement(\"button\",{\"aria-expanded\":U,className:\"models-control\",onClick:ae},Pe.createElement(\"span\",null,\"Schemas\"),U?Pe.createElement(Z,null):Pe.createElement(ee,null))),Pe.createElement(z,{isOpened:U},Object.entries(C).map((([o,s])=>{const i=ie(s,{lookup:\"basic\"})||o;return Pe.createElement(Y,{key:o,ref:handleJSONSchema202012Ref(o),schema:s,name:i,onExpand:handleJSONSchema202012Expand(o)})}))))},mutual_tls_auth=({schema:o,getComponent:s})=>{const i=s(\"JumpToPath\",!0);return Pe.createElement(\"div\",null,Pe.createElement(\"h4\",null,o.get(\"name\"),\" (mutualTLS)\",\" \",Pe.createElement(i,{path:[\"securityDefinitions\",o.get(\"name\")]})),Pe.createElement(\"p\",null,\"Mutual TLS is required by this API/Operation. Certificates are managed via your Operating System and/or your browser.\"),Pe.createElement(\"p\",null,o.get(\"description\")))};class auths_Auths extends Pe.Component{constructor(o,s){super(o,s),this.state={}}onAuthChange=o=>{let{name:s}=o;this.setState({[s]:o})};submitAuth=o=>{o.preventDefault();let{authActions:s}=this.props;s.authorizeWithPersistOption(this.state)};logoutClick=o=>{o.preventDefault();let{authActions:s,definitions:i}=this.props,u=i.map(((o,s)=>s)).toArray();this.setState(u.reduce(((o,s)=>(o[s]=\"\",o)),{})),s.logoutWithPersistOption(u)};close=o=>{o.preventDefault();let{authActions:s}=this.props;s.showDefinitions(!1)};render(){let{definitions:o,getComponent:s,authSelectors:i,errSelectors:u}=this.props;const _=s(\"AuthItem\"),w=s(\"oauth2\",!0),x=s(\"Button\"),C=i.authorized(),j=o.filter(((o,s)=>!!C.get(s))),L=o.filter((o=>\"oauth2\"!==o.get(\"type\")&&\"mutualTLS\"!==o.get(\"type\"))),B=o.filter((o=>\"oauth2\"===o.get(\"type\"))),$=o.filter((o=>\"mutualTLS\"===o.get(\"type\")));return Pe.createElement(\"div\",{className:\"auth-container\"},L.size>0&&Pe.createElement(\"form\",{onSubmit:this.submitAuth},L.map(((o,i)=>Pe.createElement(_,{key:i,schema:o,name:i,getComponent:s,onAuthChange:this.onAuthChange,authorized:C,errSelectors:u}))).toArray(),Pe.createElement(\"div\",{className:\"auth-btn-wrapper\"},L.size===j.size?Pe.createElement(x,{className:\"btn modal-btn auth\",onClick:this.logoutClick,\"aria-label\":\"Remove authorization\"},\"Logout\"):Pe.createElement(x,{type:\"submit\",className:\"btn modal-btn auth authorize\",\"aria-label\":\"Apply credentials\"},\"Authorize\"),Pe.createElement(x,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\"))),B.size>0?Pe.createElement(\"div\",null,Pe.createElement(\"div\",{className:\"scope-def\"},Pe.createElement(\"p\",null,\"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\"),Pe.createElement(\"p\",null,\"API requires the following scopes. Select which ones you want to grant to Swagger UI.\")),o.filter((o=>\"oauth2\"===o.get(\"type\"))).map(((o,s)=>Pe.createElement(\"div\",{key:s},Pe.createElement(w,{authorized:C,schema:o,name:s})))).toArray()):null,$.size>0&&Pe.createElement(\"div\",null,$.map(((o,i)=>Pe.createElement(_,{key:i,schema:o,name:i,getComponent:s,onAuthChange:this.onAuthChange,authorized:C,errSelectors:u}))).toArray()))}}const iP=auths_Auths,isOAS31=o=>{const s=o.get(\"openapi\");return\"string\"==typeof s&&/^3\\.1\\.(?:[1-9]\\d*|0)$/.test(s)},fn_createOnlyOAS31Selector=o=>(s,...i)=>u=>{if(u.getSystem().specSelectors.isOAS31()){const _=o(s,...i);return\"function\"==typeof _?_(u):_}return null},createOnlyOAS31SelectorWrapper=o=>(s,i)=>(u,..._)=>{if(i.getSystem().specSelectors.isOAS31()){const w=o(u,..._);return\"function\"==typeof w?w(s,i):w}return s(..._)},fn_createSystemSelector=o=>(s,...i)=>u=>{const _=o(s,u,...i);return\"function\"==typeof _?_(u):_},createOnlyOAS31ComponentWrapper=o=>(s,i)=>u=>i.specSelectors.isOAS31()?Pe.createElement(o,wo()({},u,{originalComponent:s,getSystem:i.getSystem})):Pe.createElement(s,u),aP=createOnlyOAS31ComponentWrapper((({getSystem:o})=>{const s=o().getComponent(\"OAS31License\",!0);return Pe.createElement(s,null)})),cP=createOnlyOAS31ComponentWrapper((({getSystem:o})=>{const s=o().getComponent(\"OAS31Contact\",!0);return Pe.createElement(s,null)})),lP=createOnlyOAS31ComponentWrapper((({getSystem:o})=>{const s=o().getComponent(\"OAS31Info\",!0);return Pe.createElement(s,null)})),uP=createOnlyOAS31ComponentWrapper((({getSystem:o,...s})=>{const i=o(),{getComponent:u,fn:_,getConfigs:w}=i,x=w(),C=u(\"OAS31Model\"),j=u(\"JSONSchema202012\"),L=u(\"JSONSchema202012Keyword$schema\"),B=u(\"JSONSchema202012Keyword$vocabulary\"),$=u(\"JSONSchema202012Keyword$id\"),V=u(\"JSONSchema202012Keyword$anchor\"),U=u(\"JSONSchema202012Keyword$dynamicAnchor\"),z=u(\"JSONSchema202012Keyword$ref\"),Y=u(\"JSONSchema202012Keyword$dynamicRef\"),Z=u(\"JSONSchema202012Keyword$defs\"),ee=u(\"JSONSchema202012Keyword$comment\"),ie=u(\"JSONSchema202012KeywordAllOf\"),ae=u(\"JSONSchema202012KeywordAnyOf\"),ce=u(\"JSONSchema202012KeywordOneOf\"),le=u(\"JSONSchema202012KeywordNot\"),pe=u(\"JSONSchema202012KeywordIf\"),de=u(\"JSONSchema202012KeywordThen\"),fe=u(\"JSONSchema202012KeywordElse\"),ye=u(\"JSONSchema202012KeywordDependentSchemas\"),be=u(\"JSONSchema202012KeywordPrefixItems\"),_e=u(\"JSONSchema202012KeywordItems\"),we=u(\"JSONSchema202012KeywordContains\"),Se=u(\"JSONSchema202012KeywordProperties\"),xe=u(\"JSONSchema202012KeywordPatternProperties\"),Te=u(\"JSONSchema202012KeywordAdditionalProperties\"),Re=u(\"JSONSchema202012KeywordPropertyNames\"),qe=u(\"JSONSchema202012KeywordUnevaluatedItems\"),$e=u(\"JSONSchema202012KeywordUnevaluatedProperties\"),ze=u(\"JSONSchema202012KeywordType\"),We=u(\"JSONSchema202012KeywordEnum\"),He=u(\"JSONSchema202012KeywordConst\"),Ye=u(\"JSONSchema202012KeywordConstraint\"),Xe=u(\"JSONSchema202012KeywordDependentRequired\"),Qe=u(\"JSONSchema202012KeywordContentSchema\"),et=u(\"JSONSchema202012KeywordTitle\"),tt=u(\"JSONSchema202012KeywordDescription\"),rt=u(\"JSONSchema202012KeywordDefault\"),nt=u(\"JSONSchema202012KeywordDeprecated\"),ot=u(\"JSONSchema202012KeywordReadOnly\"),st=u(\"JSONSchema202012KeywordWriteOnly\"),it=u(\"JSONSchema202012Accordion\"),at=u(\"JSONSchema202012ExpandDeepButton\"),ct=u(\"JSONSchema202012ChevronRightIcon\"),lt=u(\"withJSONSchema202012Context\")(C,{config:{default$schema:\"https://spec.openapis.org/oas/3.1/dialect/base\",defaultExpandedLevels:x.defaultModelExpandDepth,includeReadOnly:Boolean(s.includeReadOnly),includeWriteOnly:Boolean(s.includeWriteOnly)},components:{JSONSchema:j,Keyword$schema:L,Keyword$vocabulary:B,Keyword$id:$,Keyword$anchor:V,Keyword$dynamicAnchor:U,Keyword$ref:z,Keyword$dynamicRef:Y,Keyword$defs:Z,Keyword$comment:ee,KeywordAllOf:ie,KeywordAnyOf:ae,KeywordOneOf:ce,KeywordNot:le,KeywordIf:pe,KeywordThen:de,KeywordElse:fe,KeywordDependentSchemas:ye,KeywordPrefixItems:be,KeywordItems:_e,KeywordContains:we,KeywordProperties:Se,KeywordPatternProperties:xe,KeywordAdditionalProperties:Te,KeywordPropertyNames:Re,KeywordUnevaluatedItems:qe,KeywordUnevaluatedProperties:$e,KeywordType:ze,KeywordEnum:We,KeywordConst:He,KeywordConstraint:Ye,KeywordDependentRequired:Xe,KeywordContentSchema:Qe,KeywordTitle:et,KeywordDescription:tt,KeywordDefault:rt,KeywordDeprecated:nt,KeywordReadOnly:ot,KeywordWriteOnly:st,Accordion:it,ExpandDeepButton:at,ChevronRightIcon:ct},fn:{upperFirst:_.upperFirst,isExpandable:_.jsonSchema202012.isExpandable,getProperties:_.jsonSchema202012.getProperties}});return Pe.createElement(lt,s)})),pP=uP,hP=createOnlyOAS31ComponentWrapper((({getSystem:o})=>{const{getComponent:s,fn:i,getConfigs:u}=o(),_=u();if(hP.ModelsWithJSONSchemaContext)return Pe.createElement(hP.ModelsWithJSONSchemaContext,null);const w=s(\"OAS31Models\",!0),x=s(\"JSONSchema202012\"),C=s(\"JSONSchema202012Keyword$schema\"),j=s(\"JSONSchema202012Keyword$vocabulary\"),L=s(\"JSONSchema202012Keyword$id\"),B=s(\"JSONSchema202012Keyword$anchor\"),$=s(\"JSONSchema202012Keyword$dynamicAnchor\"),V=s(\"JSONSchema202012Keyword$ref\"),U=s(\"JSONSchema202012Keyword$dynamicRef\"),z=s(\"JSONSchema202012Keyword$defs\"),Y=s(\"JSONSchema202012Keyword$comment\"),Z=s(\"JSONSchema202012KeywordAllOf\"),ee=s(\"JSONSchema202012KeywordAnyOf\"),ie=s(\"JSONSchema202012KeywordOneOf\"),ae=s(\"JSONSchema202012KeywordNot\"),ce=s(\"JSONSchema202012KeywordIf\"),le=s(\"JSONSchema202012KeywordThen\"),pe=s(\"JSONSchema202012KeywordElse\"),de=s(\"JSONSchema202012KeywordDependentSchemas\"),fe=s(\"JSONSchema202012KeywordPrefixItems\"),ye=s(\"JSONSchema202012KeywordItems\"),be=s(\"JSONSchema202012KeywordContains\"),_e=s(\"JSONSchema202012KeywordProperties\"),we=s(\"JSONSchema202012KeywordPatternProperties\"),Se=s(\"JSONSchema202012KeywordAdditionalProperties\"),xe=s(\"JSONSchema202012KeywordPropertyNames\"),Te=s(\"JSONSchema202012KeywordUnevaluatedItems\"),Re=s(\"JSONSchema202012KeywordUnevaluatedProperties\"),qe=s(\"JSONSchema202012KeywordType\"),$e=s(\"JSONSchema202012KeywordEnum\"),ze=s(\"JSONSchema202012KeywordConst\"),We=s(\"JSONSchema202012KeywordConstraint\"),He=s(\"JSONSchema202012KeywordDependentRequired\"),Ye=s(\"JSONSchema202012KeywordContentSchema\"),Xe=s(\"JSONSchema202012KeywordTitle\"),Qe=s(\"JSONSchema202012KeywordDescription\"),et=s(\"JSONSchema202012KeywordDefault\"),tt=s(\"JSONSchema202012KeywordDeprecated\"),rt=s(\"JSONSchema202012KeywordReadOnly\"),nt=s(\"JSONSchema202012KeywordWriteOnly\"),ot=s(\"JSONSchema202012Accordion\"),st=s(\"JSONSchema202012ExpandDeepButton\"),it=s(\"JSONSchema202012ChevronRightIcon\"),at=s(\"withJSONSchema202012Context\");return hP.ModelsWithJSONSchemaContext=at(w,{config:{default$schema:\"https://spec.openapis.org/oas/3.1/dialect/base\",defaultExpandedLevels:_.defaultModelsExpandDepth-1,includeReadOnly:!0,includeWriteOnly:!0},components:{JSONSchema:x,Keyword$schema:C,Keyword$vocabulary:j,Keyword$id:L,Keyword$anchor:B,Keyword$dynamicAnchor:$,Keyword$ref:V,Keyword$dynamicRef:U,Keyword$defs:z,Keyword$comment:Y,KeywordAllOf:Z,KeywordAnyOf:ee,KeywordOneOf:ie,KeywordNot:ae,KeywordIf:ce,KeywordThen:le,KeywordElse:pe,KeywordDependentSchemas:de,KeywordPrefixItems:fe,KeywordItems:ye,KeywordContains:be,KeywordProperties:_e,KeywordPatternProperties:we,KeywordAdditionalProperties:Se,KeywordPropertyNames:xe,KeywordUnevaluatedItems:Te,KeywordUnevaluatedProperties:Re,KeywordType:qe,KeywordEnum:$e,KeywordConst:ze,KeywordConstraint:We,KeywordDependentRequired:He,KeywordContentSchema:Ye,KeywordTitle:Xe,KeywordDescription:Qe,KeywordDefault:et,KeywordDeprecated:tt,KeywordReadOnly:rt,KeywordWriteOnly:nt,Accordion:ot,ExpandDeepButton:st,ChevronRightIcon:it},fn:{upperFirst:i.upperFirst,isExpandable:i.jsonSchema202012.isExpandable,getProperties:i.jsonSchema202012.getProperties}}),Pe.createElement(hP.ModelsWithJSONSchemaContext,null)}));hP.ModelsWithJSONSchemaContext=null;const dP=hP,wrap_components_version_pragma_filter=(o,s)=>o=>{const i=s.specSelectors.isOAS31(),u=s.getComponent(\"OAS31VersionPragmaFilter\");return Pe.createElement(u,wo()({isOAS31:i},o))},fP=createOnlyOAS31ComponentWrapper((({originalComponent:o,...s})=>{const{getComponent:i,schema:u}=s,_=i(\"MutualTLSAuth\",!0);return\"mutualTLS\"===u.get(\"type\")?Pe.createElement(_,{schema:u}):Pe.createElement(o,s)})),mP=fP,gP=createOnlyOAS31ComponentWrapper((({getSystem:o,...s})=>{const i=o().getComponent(\"OAS31Auths\",!0);return Pe.createElement(i,s)})),yP=(0,qe.Map)(),vP=Wt(((o,s)=>s.specSelectors.specJson()),isOAS31),selectors_webhooks=()=>o=>{const s=o.specSelectors.specJson().get(\"webhooks\");return qe.Map.isMap(s)?s:yP},bP=Wt([(o,s)=>s.specSelectors.webhooks(),(o,s)=>s.specSelectors.validOperationMethods(),(o,s)=>s.specSelectors.specResolvedSubtree([\"webhooks\"])],((o,s)=>o.reduce(((o,i,u)=>{if(!qe.Map.isMap(i))return o;const _=i.entrySeq().filter((([o])=>s.includes(o))).map((([o,s])=>({operation:(0,qe.Map)({operation:s}),method:o,path:u,specPath:[\"webhooks\",u,o]})));return o.concat(_)}),(0,qe.List)()).groupBy((o=>o.path)).map((o=>o.toArray())).toObject())),selectors_license=()=>o=>{const s=o.specSelectors.info().get(\"license\");return qe.Map.isMap(s)?s:yP},selectLicenseNameField=()=>o=>o.specSelectors.license().get(\"name\",\"License\"),selectLicenseUrlField=()=>o=>o.specSelectors.license().get(\"url\"),_P=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectLicenseUrlField()],((o,s,i)=>{if(i)return safeBuildUrl(i,o,{selectedServer:s})})),selectLicenseIdentifierField=()=>o=>o.specSelectors.license().get(\"identifier\"),selectors_contact=()=>o=>{const s=o.specSelectors.info().get(\"contact\");return qe.Map.isMap(s)?s:yP},selectContactNameField=()=>o=>o.specSelectors.contact().get(\"name\",\"the developer\"),selectContactEmailField=()=>o=>o.specSelectors.contact().get(\"email\"),selectContactUrlField=()=>o=>o.specSelectors.contact().get(\"url\"),EP=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectContactUrlField()],((o,s,i)=>{if(i)return safeBuildUrl(i,o,{selectedServer:s})})),selectInfoTitleField=()=>o=>o.specSelectors.info().get(\"title\"),selectInfoSummaryField=()=>o=>o.specSelectors.info().get(\"summary\"),selectInfoDescriptionField=()=>o=>o.specSelectors.info().get(\"description\"),selectInfoTermsOfServiceField=()=>o=>o.specSelectors.info().get(\"termsOfService\"),wP=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectInfoTermsOfServiceField()],((o,s,i)=>{if(i)return safeBuildUrl(i,o,{selectedServer:s})})),selectExternalDocsDescriptionField=()=>o=>o.specSelectors.externalDocs().get(\"description\"),selectExternalDocsUrlField=()=>o=>o.specSelectors.externalDocs().get(\"url\"),SP=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectExternalDocsUrlField()],((o,s,i)=>{if(i)return safeBuildUrl(i,o,{selectedServer:s})})),selectJsonSchemaDialectField=()=>o=>o.specSelectors.specJson().get(\"jsonSchemaDialect\"),selectJsonSchemaDialectDefault=()=>\"https://spec.openapis.org/oas/3.1/dialect/base\",xP=Wt(((o,s)=>s.specSelectors.definitions()),((o,s)=>s.specSelectors.specResolvedSubtree([\"components\",\"schemas\"])),((o,s)=>qe.Map.isMap(o)?qe.Map.isMap(s)?Object.entries(o.toJS()).reduce(((o,[i,u])=>{const _=s.get(i);return o[i]=_?.toJS()||u,o}),{}):o.toJS():{})),wrap_selectors_isOAS3=(o,s)=>(i,...u)=>s.specSelectors.isOAS31()||o(...u),kP=createOnlyOAS31SelectorWrapper((()=>(o,s)=>s.oas31Selectors.selectLicenseUrl())),OP=createOnlyOAS31SelectorWrapper((()=>(o,s)=>{const i=s.specSelectors.securityDefinitions();let u=o();return i?(i.entrySeq().forEach((([o,s])=>{\"mutualTLS\"===s.get(\"type\")&&(u=u.push(new qe.Map({[o]:s})))})),u):u})),CP=Wt([(o,s)=>s.specSelectors.url(),(o,s)=>s.oas3Selectors.selectedServer(),(o,s)=>s.specSelectors.selectLicenseUrlField(),(o,s)=>s.specSelectors.selectLicenseIdentifierField()],((o,s,i,u)=>i?safeBuildUrl(i,o,{selectedServer:s}):u?`https://spdx.org/licenses/${u}.html`:void 0)),keywords_Example=({schema:o,getSystem:s})=>{const{fn:i}=s(),{hasKeyword:u,stringify:_}=i.jsonSchema202012.useFn();return u(o,\"example\")?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--example\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Example\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},_(o.example))):null},keywords_Xml=({schema:o,getSystem:s})=>{const i=o?.xml||{},{fn:u,getComponent:_}=s(),{useIsExpandedDeeply:w,useComponent:x}=u.jsonSchema202012,C=w(),j=!!(i.name||i.namespace||i.prefix),[L,B]=(0,Pe.useState)(C),[$,V]=(0,Pe.useState)(!1),U=x(\"Accordion\"),z=x(\"ExpandDeepButton\"),Y=_(\"JSONSchema202012DeepExpansionContext\")(),Z=(0,Pe.useCallback)((()=>{B((o=>!o))}),[]),ee=(0,Pe.useCallback)(((o,s)=>{B(s),V(s)}),[]);return 0===Object.keys(i).length?null:Pe.createElement(Y.Provider,{value:$},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--xml\"},j?Pe.createElement(Pe.Fragment,null,Pe.createElement(U,{expanded:L,onChange:Z},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"XML\")),Pe.createElement(z,{expanded:L,onClick:ee})):Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"XML\"),!0===i.attribute&&Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"attribute\"),!0===i.wrapped&&Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"wrapped\"),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!L})},L&&Pe.createElement(Pe.Fragment,null,i.name&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"name\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},i.name))),i.namespace&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"namespace\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},i.namespace))),i.prefix&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"prefix\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},i.prefix)))))))},Discriminator_DiscriminatorMapping=({discriminator:o})=>{const s=o?.mapping||{};return 0===Object.keys(s).length?null:Object.entries(s).map((([o,s])=>Pe.createElement(\"div\",{key:`${o}-${s}`,className:\"json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},o),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},s))))},keywords_Discriminator_Discriminator=({schema:o,getSystem:s})=>{const i=o?.discriminator||{},{fn:u,getComponent:_}=s(),{useIsExpandedDeeply:w,useComponent:x}=u.jsonSchema202012,C=w(),j=!!i.mapping,[L,B]=(0,Pe.useState)(C),[$,V]=(0,Pe.useState)(!1),U=x(\"Accordion\"),z=x(\"ExpandDeepButton\"),Y=_(\"JSONSchema202012DeepExpansionContext\")(),Z=(0,Pe.useCallback)((()=>{B((o=>!o))}),[]),ee=(0,Pe.useCallback)(((o,s)=>{B(s),V(s)}),[]);return 0===Object.keys(i).length?null:Pe.createElement(Y.Provider,{value:$},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--discriminator\"},j?Pe.createElement(Pe.Fragment,null,Pe.createElement(U,{expanded:L,onChange:Z},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Discriminator\")),Pe.createElement(z,{expanded:L,onClick:ee})):Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Discriminator\"),i.propertyName&&Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},i.propertyName),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!L})},L&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(Discriminator_DiscriminatorMapping,{discriminator:i})))))},keywords_ExternalDocs=({schema:o,getSystem:s})=>{const i=o?.externalDocs||{},{fn:u,getComponent:_}=s(),{useIsExpandedDeeply:w,useComponent:x}=u.jsonSchema202012,C=w(),j=!(!i.description&&!i.url),[L,B]=(0,Pe.useState)(C),[$,V]=(0,Pe.useState)(!1),U=x(\"Accordion\"),z=x(\"ExpandDeepButton\"),Y=_(\"JSONSchema202012KeywordDescription\"),Z=_(\"Link\"),ee=_(\"JSONSchema202012DeepExpansionContext\")(),ie=(0,Pe.useCallback)((()=>{B((o=>!o))}),[]),ae=(0,Pe.useCallback)(((o,s)=>{B(s),V(s)}),[]);return 0===Object.keys(i).length?null:Pe.createElement(ee.Provider,{value:$},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--externalDocs\"},j?Pe.createElement(Pe.Fragment,null,Pe.createElement(U,{expanded:L,onChange:ie},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"External documentation\")),Pe.createElement(z,{expanded:L,onClick:ae})):Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"External documentation\"),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!L})},L&&Pe.createElement(Pe.Fragment,null,i.description&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(Y,{schema:i,getSystem:s})),i.url&&Pe.createElement(\"li\",{className:\"json-schema-2020-12-property\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"url\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},Pe.createElement(Z,{target:\"_blank\",href:sanitizeUrl(i.url)},i.url))))))))},keywords_Description=({schema:o,getSystem:s})=>{if(!o?.description)return null;const{getComponent:i}=s(),u=i(\"Markdown\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--description\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary\"},Pe.createElement(u,{source:o.description})))},AP=createOnlyOAS31ComponentWrapper(keywords_Description),jP=createOnlyOAS31ComponentWrapper((({schema:o,getSystem:s,originalComponent:i})=>{const{getComponent:u}=s(),_=u(\"JSONSchema202012KeywordDiscriminator\"),w=u(\"JSONSchema202012KeywordXml\"),x=u(\"JSONSchema202012KeywordExample\"),C=u(\"JSONSchema202012KeywordExternalDocs\");return Pe.createElement(Pe.Fragment,null,Pe.createElement(i,{schema:o}),Pe.createElement(_,{schema:o,getSystem:s}),Pe.createElement(w,{schema:o,getSystem:s}),Pe.createElement(C,{schema:o,getSystem:s}),Pe.createElement(x,{schema:o,getSystem:s}))})),PP=jP,keywords_Properties=({schema:o,getSystem:s})=>{const{fn:i}=s(),{useComponent:u}=i.jsonSchema202012,{getDependentRequired:_,getProperties:w}=i.jsonSchema202012.useFn(),x=i.jsonSchema202012.useConfig(),C=Array.isArray(o?.required)?o.required:[],j=u(\"JSONSchema\"),L=w(o,x);return 0===Object.keys(L).length?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties\"},Pe.createElement(\"ul\",null,Object.entries(L).map((([s,i])=>{const u=C.includes(s),w=_(s,o);return Pe.createElement(\"li\",{key:s,className:To()(\"json-schema-2020-12-property\",{\"json-schema-2020-12-property--required\":u})},Pe.createElement(j,{name:s,schema:i,dependentRequired:w}))}))))},IP=createOnlyOAS31ComponentWrapper(keywords_Properties),getProperties=(o,{includeReadOnly:s,includeWriteOnly:i})=>{if(!o?.properties)return{};const u=Object.entries(o.properties).filter((([,o])=>(!(!0===o?.readOnly)||s)&&(!(!0===o?.writeOnly)||i)));return Object.fromEntries(u)};const MP=function oas31_after_load_afterLoad({fn:o,getSystem:s}){if(o.jsonSchema202012){const i=((o,s)=>{const{fn:i}=s();if(\"function\"!=typeof o)return null;const{hasKeyword:u}=i.jsonSchema202012;return s=>o(s)||u(s,\"example\")||s?.xml||s?.discriminator||s?.externalDocs})(o.jsonSchema202012.isExpandable,s);Object.assign(this.fn.jsonSchema202012,{isExpandable:i,getProperties})}if(\"function\"==typeof o.sampleFromSchema&&o.jsonSchema202012){const i=((o,s)=>{const{fn:i,specSelectors:u}=s;return Object.fromEntries(Object.entries(o).map((([o,s])=>{const _=i[o];return[o,(...o)=>u.isOAS31()?s(...o):\"function\"==typeof _?_(...o):void 0]})))})({sampleFromSchema:o.jsonSchema202012.sampleFromSchema,sampleFromSchemaGeneric:o.jsonSchema202012.sampleFromSchemaGeneric,createXMLExample:o.jsonSchema202012.createXMLExample,memoizedSampleFromSchema:o.jsonSchema202012.memoizedSampleFromSchema,memoizedCreateXMLExample:o.jsonSchema202012.memoizedCreateXMLExample,getJsonSampleSchema:o.jsonSchema202012.getJsonSampleSchema,getYamlSampleSchema:o.jsonSchema202012.getYamlSampleSchema,getXmlSampleSchema:o.jsonSchema202012.getXmlSampleSchema,getSampleSchema:o.jsonSchema202012.getSampleSchema,mergeJsonSchema:o.jsonSchema202012.mergeJsonSchema},s());Object.assign(this.fn,i)}},oas31=({fn:o})=>{const s=o.createSystemSelector||fn_createSystemSelector,i=o.createOnlyOAS31Selector||fn_createOnlyOAS31Selector;return{afterLoad:MP,fn:{isOAS31,createSystemSelector:fn_createSystemSelector,createOnlyOAS31Selector:fn_createOnlyOAS31Selector},components:{Webhooks:webhooks,JsonSchemaDialect:json_schema_dialect,MutualTLSAuth:mutual_tls_auth,OAS31Info:oas31_components_info,OAS31License:oas31_components_license,OAS31Contact:oas31_components_contact,OAS31VersionPragmaFilter:version_pragma_filter,OAS31Model:sP,OAS31Models:models,OAS31Auths:iP,JSONSchema202012KeywordExample:keywords_Example,JSONSchema202012KeywordXml:keywords_Xml,JSONSchema202012KeywordDiscriminator:keywords_Discriminator_Discriminator,JSONSchema202012KeywordExternalDocs:keywords_ExternalDocs},wrapComponents:{InfoContainer:lP,License:aP,Contact:cP,VersionPragmaFilter:wrap_components_version_pragma_filter,Model:pP,Models:dP,AuthItem:mP,auths:gP,JSONSchema202012KeywordDescription:AP,JSONSchema202012KeywordDefault:PP,JSONSchema202012KeywordProperties:IP},statePlugins:{auth:{wrapSelectors:{definitionsToAuthorize:OP}},spec:{selectors:{isOAS31:s(vP),license:selectors_license,selectLicenseNameField,selectLicenseUrlField,selectLicenseIdentifierField:i(selectLicenseIdentifierField),selectLicenseUrl:s(_P),contact:selectors_contact,selectContactNameField,selectContactEmailField,selectContactUrlField,selectContactUrl:s(EP),selectInfoTitleField,selectInfoSummaryField:i(selectInfoSummaryField),selectInfoDescriptionField,selectInfoTermsOfServiceField,selectInfoTermsOfServiceUrl:s(wP),selectExternalDocsDescriptionField,selectExternalDocsUrlField,selectExternalDocsUrl:s(SP),webhooks:i(selectors_webhooks),selectWebhooksOperations:i(s(bP)),selectJsonSchemaDialectField,selectJsonSchemaDialectDefault,selectSchemas:s(xP)},wrapSelectors:{isOAS3:wrap_selectors_isOAS3,selectLicenseUrl:kP}},oas31:{selectors:{selectLicenseUrl:i(s(CP))}}}}},NP=Vo().object,TP=Vo().bool,RP=(Vo().oneOfType([NP,TP]),(0,Pe.createContext)(null));RP.displayName=\"JSONSchemaContext\";const DP=(0,Pe.createContext)(0);DP.displayName=\"JSONSchemaLevelContext\";const LP=(0,Pe.createContext)(!1);LP.displayName=\"JSONSchemaDeepExpansionContext\";const BP=(0,Pe.createContext)(new Set),useConfig=()=>{const{config:o}=(0,Pe.useContext)(RP);return o},useComponent=o=>{const{components:s}=(0,Pe.useContext)(RP);return s[o]||null},useFn=(o=void 0)=>{const{fn:s}=(0,Pe.useContext)(RP);return void 0!==o?s[o]:s},useLevel=()=>{const o=(0,Pe.useContext)(DP);return[o,o+1]},useIsExpanded=()=>{const[o]=useLevel(),{defaultExpandedLevels:s}=useConfig();return s-o>0},useIsExpandedDeeply=()=>(0,Pe.useContext)(LP),useRenderedSchemas=(o=void 0)=>{if(void 0===o)return(0,Pe.useContext)(BP);const s=(0,Pe.useContext)(BP);return new Set([...s,o])},FP=(0,Pe.forwardRef)((({schema:o,name:s=\"\",dependentRequired:i=[],onExpand:u=(()=>{})},_)=>{const w=useFn(),x=useIsExpanded(),C=useIsExpandedDeeply(),[j,L]=(0,Pe.useState)(x||C),[B,$]=(0,Pe.useState)(C),[V,U]=useLevel(),z=(()=>{const[o]=useLevel();return o>0})(),Y=w.isExpandable(o)||i.length>0,Z=(o=>useRenderedSchemas().has(o))(o),ee=useRenderedSchemas(o),ie=w.stringifyConstraints(o),ae=useComponent(\"Accordion\"),ce=useComponent(\"Keyword$schema\"),le=useComponent(\"Keyword$vocabulary\"),pe=useComponent(\"Keyword$id\"),de=useComponent(\"Keyword$anchor\"),fe=useComponent(\"Keyword$dynamicAnchor\"),ye=useComponent(\"Keyword$ref\"),be=useComponent(\"Keyword$dynamicRef\"),_e=useComponent(\"Keyword$defs\"),we=useComponent(\"Keyword$comment\"),Se=useComponent(\"KeywordAllOf\"),xe=useComponent(\"KeywordAnyOf\"),Te=useComponent(\"KeywordOneOf\"),Re=useComponent(\"KeywordNot\"),qe=useComponent(\"KeywordIf\"),$e=useComponent(\"KeywordThen\"),ze=useComponent(\"KeywordElse\"),We=useComponent(\"KeywordDependentSchemas\"),He=useComponent(\"KeywordPrefixItems\"),Ye=useComponent(\"KeywordItems\"),Xe=useComponent(\"KeywordContains\"),Qe=useComponent(\"KeywordProperties\"),et=useComponent(\"KeywordPatternProperties\"),tt=useComponent(\"KeywordAdditionalProperties\"),rt=useComponent(\"KeywordPropertyNames\"),nt=useComponent(\"KeywordUnevaluatedItems\"),ot=useComponent(\"KeywordUnevaluatedProperties\"),st=useComponent(\"KeywordType\"),it=useComponent(\"KeywordEnum\"),at=useComponent(\"KeywordConst\"),ct=useComponent(\"KeywordConstraint\"),lt=useComponent(\"KeywordDependentRequired\"),ut=useComponent(\"KeywordContentSchema\"),pt=useComponent(\"KeywordTitle\"),ht=useComponent(\"KeywordDescription\"),dt=useComponent(\"KeywordDefault\"),mt=useComponent(\"KeywordDeprecated\"),gt=useComponent(\"KeywordReadOnly\"),yt=useComponent(\"KeywordWriteOnly\"),vt=useComponent(\"ExpandDeepButton\");(0,Pe.useEffect)((()=>{$(C)}),[C]),(0,Pe.useEffect)((()=>{$(B)}),[B]);const bt=(0,Pe.useCallback)(((o,s)=>{L(s),!s&&$(!1),u(o,s,!1)}),[u]),_t=(0,Pe.useCallback)(((o,s)=>{L(s),$(s),u(o,s,!0)}),[u]);return Pe.createElement(DP.Provider,{value:U},Pe.createElement(LP.Provider,{value:B},Pe.createElement(BP.Provider,{value:ee},Pe.createElement(\"article\",{ref:_,\"data-json-schema-level\":V,className:To()(\"json-schema-2020-12\",{\"json-schema-2020-12--embedded\":z,\"json-schema-2020-12--circular\":Z})},Pe.createElement(\"div\",{className:\"json-schema-2020-12-head\"},Y&&!Z?Pe.createElement(Pe.Fragment,null,Pe.createElement(ae,{expanded:j,onChange:bt},Pe.createElement(pt,{title:s,schema:o})),Pe.createElement(vt,{expanded:j,onClick:_t})):Pe.createElement(pt,{title:s,schema:o}),Pe.createElement(mt,{schema:o}),Pe.createElement(gt,{schema:o}),Pe.createElement(yt,{schema:o}),Pe.createElement(st,{schema:o,isCircular:Z}),ie.length>0&&ie.map((o=>Pe.createElement(ct,{key:`${o.scope}-${o.value}`,constraint:o})))),Pe.createElement(\"div\",{className:To()(\"json-schema-2020-12-body\",{\"json-schema-2020-12-body--collapsed\":!j})},j&&Pe.createElement(Pe.Fragment,null,Pe.createElement(ht,{schema:o}),!Z&&Y&&Pe.createElement(Pe.Fragment,null,Pe.createElement(Qe,{schema:o}),Pe.createElement(et,{schema:o}),Pe.createElement(tt,{schema:o}),Pe.createElement(ot,{schema:o}),Pe.createElement(rt,{schema:o}),Pe.createElement(Se,{schema:o}),Pe.createElement(xe,{schema:o}),Pe.createElement(Te,{schema:o}),Pe.createElement(Re,{schema:o}),Pe.createElement(qe,{schema:o}),Pe.createElement($e,{schema:o}),Pe.createElement(ze,{schema:o}),Pe.createElement(We,{schema:o}),Pe.createElement(He,{schema:o}),Pe.createElement(Ye,{schema:o}),Pe.createElement(nt,{schema:o}),Pe.createElement(Xe,{schema:o}),Pe.createElement(ut,{schema:o})),Pe.createElement(it,{schema:o}),Pe.createElement(at,{schema:o}),Pe.createElement(lt,{schema:o,dependentRequired:i}),Pe.createElement(dt,{schema:o}),Pe.createElement(ce,{schema:o}),Pe.createElement(le,{schema:o}),Pe.createElement(pe,{schema:o}),Pe.createElement(de,{schema:o}),Pe.createElement(fe,{schema:o}),Pe.createElement(ye,{schema:o}),!Z&&Y&&Pe.createElement(_e,{schema:o}),Pe.createElement(be,{schema:o}),Pe.createElement(we,{schema:o})))))))})),qP=FP,keywords_$schema=({schema:o})=>o?.$schema?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$schema\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$schema\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$schema)):null,$vocabulary_$vocabulary=({schema:o})=>{const s=useIsExpanded(),i=useIsExpandedDeeply(),[u,_]=(0,Pe.useState)(s||i),w=useComponent(\"Accordion\"),x=(0,Pe.useCallback)((()=>{_((o=>!o))}),[]);return o?.$vocabulary?\"object\"!=typeof o.$vocabulary?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$vocabulary\"},Pe.createElement(w,{expanded:u,onChange:x},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$vocabulary\")),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",null,u&&Object.entries(o.$vocabulary).map((([o,s])=>Pe.createElement(\"li\",{key:o,className:To()(\"json-schema-2020-12-$vocabulary-uri\",{\"json-schema-2020-12-$vocabulary-uri--disabled\":!s})},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o)))))):null},keywords_$id=({schema:o})=>o?.$id?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$id\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$id\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$id)):null,keywords_$anchor=({schema:o})=>o?.$anchor?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$anchor\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$anchor\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$anchor)):null,keywords_$dynamicAnchor=({schema:o})=>o?.$dynamicAnchor?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicAnchor\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$dynamicAnchor\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$dynamicAnchor)):null,keywords_$ref=({schema:o})=>o?.$ref?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$ref\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$ref\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$ref)):null,keywords_$dynamicRef=({schema:o})=>o?.$dynamicRef?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicRef\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$dynamicRef\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$dynamicRef)):null,keywords_$defs=({schema:o})=>{const s=o?.$defs||{},i=useIsExpanded(),u=useIsExpandedDeeply(),[_,w]=(0,Pe.useState)(i||u),[x,C]=(0,Pe.useState)(!1),j=useComponent(\"Accordion\"),L=useComponent(\"ExpandDeepButton\"),B=useComponent(\"JSONSchema\"),$=(0,Pe.useCallback)((()=>{w((o=>!o))}),[]),V=(0,Pe.useCallback)(((o,s)=>{w(s),C(s)}),[]);return 0===Object.keys(s).length?null:Pe.createElement(LP.Provider,{value:x},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$defs\"},Pe.createElement(j,{expanded:_,onChange:$},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$defs\")),Pe.createElement(L,{expanded:_,onClick:V}),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!_})},_&&Pe.createElement(Pe.Fragment,null,Object.entries(s).map((([o,s])=>Pe.createElement(\"li\",{key:o,className:\"json-schema-2020-12-property\"},Pe.createElement(B,{name:o,schema:s}))))))))},keywords_$comment=({schema:o})=>o?.$comment?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$comment\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$comment\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},o.$comment)):null,keywords_AllOf=({schema:o})=>{const s=o?.allOf||[],i=useFn(),u=useIsExpanded(),_=useIsExpandedDeeply(),[w,x]=(0,Pe.useState)(u||_),[C,j]=(0,Pe.useState)(!1),L=useComponent(\"Accordion\"),B=useComponent(\"ExpandDeepButton\"),$=useComponent(\"JSONSchema\"),V=useComponent(\"KeywordType\"),U=(0,Pe.useCallback)((()=>{x((o=>!o))}),[]),z=(0,Pe.useCallback)(((o,s)=>{x(s),j(s)}),[]);return Array.isArray(s)&&0!==s.length?Pe.createElement(LP.Provider,{value:C},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--allOf\"},Pe.createElement(L,{expanded:w,onChange:U},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"All of\")),Pe.createElement(B,{expanded:w,onClick:z}),Pe.createElement(V,{schema:{allOf:s}}),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!w})},w&&Pe.createElement(Pe.Fragment,null,s.map(((o,s)=>Pe.createElement(\"li\",{key:`#${s}`,className:\"json-schema-2020-12-property\"},Pe.createElement($,{name:`#${s} ${i.getTitle(o)}`,schema:o})))))))):null},keywords_AnyOf=({schema:o})=>{const s=o?.anyOf||[],i=useFn(),u=useIsExpanded(),_=useIsExpandedDeeply(),[w,x]=(0,Pe.useState)(u||_),[C,j]=(0,Pe.useState)(!1),L=useComponent(\"Accordion\"),B=useComponent(\"ExpandDeepButton\"),$=useComponent(\"JSONSchema\"),V=useComponent(\"KeywordType\"),U=(0,Pe.useCallback)((()=>{x((o=>!o))}),[]),z=(0,Pe.useCallback)(((o,s)=>{x(s),j(s)}),[]);return Array.isArray(s)&&0!==s.length?Pe.createElement(LP.Provider,{value:C},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--anyOf\"},Pe.createElement(L,{expanded:w,onChange:U},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Any of\")),Pe.createElement(B,{expanded:w,onClick:z}),Pe.createElement(V,{schema:{anyOf:s}}),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!w})},w&&Pe.createElement(Pe.Fragment,null,s.map(((o,s)=>Pe.createElement(\"li\",{key:`#${s}`,className:\"json-schema-2020-12-property\"},Pe.createElement($,{name:`#${s} ${i.getTitle(o)}`,schema:o})))))))):null},keywords_OneOf=({schema:o})=>{const s=o?.oneOf||[],i=useFn(),u=useIsExpanded(),_=useIsExpandedDeeply(),[w,x]=(0,Pe.useState)(u||_),[C,j]=(0,Pe.useState)(!1),L=useComponent(\"Accordion\"),B=useComponent(\"ExpandDeepButton\"),$=useComponent(\"JSONSchema\"),V=useComponent(\"KeywordType\"),U=(0,Pe.useCallback)((()=>{x((o=>!o))}),[]),z=(0,Pe.useCallback)(((o,s)=>{x(s),j(s)}),[]);return Array.isArray(s)&&0!==s.length?Pe.createElement(LP.Provider,{value:C},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--oneOf\"},Pe.createElement(L,{expanded:w,onChange:U},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"One of\")),Pe.createElement(B,{expanded:w,onClick:z}),Pe.createElement(V,{schema:{oneOf:s}}),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!w})},w&&Pe.createElement(Pe.Fragment,null,s.map(((o,s)=>Pe.createElement(\"li\",{key:`#${s}`,className:\"json-schema-2020-12-property\"},Pe.createElement($,{name:`#${s} ${i.getTitle(o)}`,schema:o})))))))):null},keywords_Not=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"not\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Not\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--not\"},Pe.createElement(i,{name:u,schema:o.not}))},keywords_If=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"if\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"If\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--if\"},Pe.createElement(i,{name:u,schema:o.if}))},keywords_Then=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"then\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Then\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--then\"},Pe.createElement(i,{name:u,schema:o.then}))},keywords_Else=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"else\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Else\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--if\"},Pe.createElement(i,{name:u,schema:o.else}))},keywords_DependentSchemas=({schema:o})=>{const s=o?.dependentSchemas||[],i=useIsExpanded(),u=useIsExpandedDeeply(),[_,w]=(0,Pe.useState)(i||u),[x,C]=(0,Pe.useState)(!1),j=useComponent(\"Accordion\"),L=useComponent(\"ExpandDeepButton\"),B=useComponent(\"JSONSchema\"),$=(0,Pe.useCallback)((()=>{w((o=>!o))}),[]),V=(0,Pe.useCallback)(((o,s)=>{w(s),C(s)}),[]);return\"object\"!=typeof s||0===Object.keys(s).length?null:Pe.createElement(LP.Provider,{value:x},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentSchemas\"},Pe.createElement(j,{expanded:_,onChange:$},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Dependent schemas\")),Pe.createElement(L,{expanded:_,onClick:V}),Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!_})},_&&Pe.createElement(Pe.Fragment,null,Object.entries(s).map((([o,s])=>Pe.createElement(\"li\",{key:o,className:\"json-schema-2020-12-property\"},Pe.createElement(B,{name:o,schema:s}))))))))},keywords_PrefixItems=({schema:o})=>{const s=o?.prefixItems||[],i=useFn(),u=useIsExpanded(),_=useIsExpandedDeeply(),[w,x]=(0,Pe.useState)(u||_),[C,j]=(0,Pe.useState)(!1),L=useComponent(\"Accordion\"),B=useComponent(\"ExpandDeepButton\"),$=useComponent(\"JSONSchema\"),V=useComponent(\"KeywordType\"),U=(0,Pe.useCallback)((()=>{x((o=>!o))}),[]),z=(0,Pe.useCallback)(((o,s)=>{x(s),j(s)}),[]);return Array.isArray(s)&&0!==s.length?Pe.createElement(LP.Provider,{value:C},Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--prefixItems\"},Pe.createElement(L,{expanded:w,onChange:U},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Prefix items\")),Pe.createElement(B,{expanded:w,onClick:z}),Pe.createElement(V,{schema:{prefixItems:s}}),Pe.createElement(\"ul\",{className:To()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!w})},w&&Pe.createElement(Pe.Fragment,null,s.map(((o,s)=>Pe.createElement(\"li\",{key:`#${s}`,className:\"json-schema-2020-12-property\"},Pe.createElement($,{name:`#${s} ${i.getTitle(o)}`,schema:o})))))))):null},keywords_Items=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"items\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Items\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--items\"},Pe.createElement(i,{name:u,schema:o.items}))},keywords_Contains=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"contains\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Contains\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--contains\"},Pe.createElement(i,{name:u,schema:o.contains}))},keywords_Properties_Properties=({schema:o})=>{const s=useFn(),i=o?.properties||{},u=Array.isArray(o?.required)?o.required:[],_=useComponent(\"JSONSchema\");return 0===Object.keys(i).length?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties\"},Pe.createElement(\"ul\",null,Object.entries(i).map((([i,w])=>{const x=u.includes(i),C=s.getDependentRequired(i,o);return Pe.createElement(\"li\",{key:i,className:To()(\"json-schema-2020-12-property\",{\"json-schema-2020-12-property--required\":x})},Pe.createElement(_,{name:i,schema:w,dependentRequired:C}))}))))},PatternProperties_PatternProperties=({schema:o})=>{const s=o?.patternProperties||{},i=useComponent(\"JSONSchema\");return 0===Object.keys(s).length?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--patternProperties\"},Pe.createElement(\"ul\",null,Object.entries(s).map((([o,s])=>Pe.createElement(\"li\",{key:o,className:\"json-schema-2020-12-property\"},Pe.createElement(i,{name:o,schema:s}))))))},keywords_AdditionalProperties=({schema:o})=>{const s=useFn(),{additionalProperties:i}=o,u=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"additionalProperties\"))return null;const _=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Additional properties\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--additionalProperties\"},!0===i?Pe.createElement(Pe.Fragment,null,_,Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"allowed\")):!1===i?Pe.createElement(Pe.Fragment,null,_,Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"forbidden\")):Pe.createElement(u,{name:_,schema:i}))},keywords_PropertyNames=({schema:o})=>{const s=useFn(),{propertyNames:i}=o,u=useComponent(\"JSONSchema\"),_=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Property names\");return s.hasKeyword(o,\"propertyNames\")?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--propertyNames\"},Pe.createElement(u,{name:_,schema:i})):null},keywords_UnevaluatedItems=({schema:o})=>{const s=useFn(),{unevaluatedItems:i}=o,u=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"unevaluatedItems\"))return null;const _=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Unevaluated items\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedItems\"},Pe.createElement(u,{name:_,schema:i}))},keywords_UnevaluatedProperties=({schema:o})=>{const s=useFn(),{unevaluatedProperties:i}=o,u=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"unevaluatedProperties\"))return null;const _=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Unevaluated properties\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedProperties\"},Pe.createElement(u,{name:_,schema:i}))},keywords_Type=({schema:o,isCircular:s=!1})=>{const i=useFn().getType(o),u=s?\" [circular]\":\"\";return Pe.createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},`${i}${u}`)},Enum_Enum=({schema:o})=>{const s=useFn();return Array.isArray(o?.enum)?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--enum\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Allowed values\"),Pe.createElement(\"ul\",null,o.enum.map((o=>{const i=s.stringify(o);return Pe.createElement(\"li\",{key:i},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},i))})))):null},keywords_Const=({schema:o})=>{const s=useFn();return s.hasKeyword(o,\"const\")?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--const\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Const\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},s.stringify(o.const))):null},Constraint=({constraint:o})=>Pe.createElement(\"span\",{className:`json-schema-2020-12__constraint json-schema-2020-12__constraint--${o.scope}`},o.value),$P=Pe.memo(Constraint),DependentRequired_DependentRequired=({dependentRequired:o})=>0===o.length?null:Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentRequired\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Required when defined\"),Pe.createElement(\"ul\",null,o.map((o=>Pe.createElement(\"li\",{key:o},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--warning\"},o)))))),keywords_ContentSchema=({schema:o})=>{const s=useFn(),i=useComponent(\"JSONSchema\");if(!s.hasKeyword(o,\"contentSchema\"))return null;const u=Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Content schema\");return Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--contentSchema\"},Pe.createElement(i,{name:u,schema:o.contentSchema}))},Title_Title=({title:o=\"\",schema:s})=>{const i=useFn(),u=o||i.getTitle(s);return u?Pe.createElement(\"div\",{className:\"json-schema-2020-12__title\"},u):null},keywords_Description_Description=({schema:o})=>o?.description?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--description\"},Pe.createElement(\"div\",{className:\"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary\"},o.description)):null,keywords_Default=({schema:o})=>{const s=useFn();return s.hasKeyword(o,\"default\")?Pe.createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--default\"},Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Default\"),Pe.createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},s.stringify(o.default))):null},keywords_Deprecated=({schema:o})=>!0!==o?.deprecated?null:Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--warning\"},\"deprecated\"),keywords_ReadOnly=({schema:o})=>!0!==o?.readOnly?null:Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"read-only\"),keywords_WriteOnly=({schema:o})=>!0!==o?.writeOnly?null:Pe.createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"write-only\"),Accordion_Accordion=({expanded:o=!1,children:s,onChange:i})=>{const u=useComponent(\"ChevronRightIcon\"),_=(0,Pe.useCallback)((s=>{i(s,!o)}),[o,i]);return Pe.createElement(\"button\",{type:\"button\",className:\"json-schema-2020-12-accordion\",onClick:_},Pe.createElement(\"div\",{className:\"json-schema-2020-12-accordion__children\"},s),Pe.createElement(\"span\",{className:To()(\"json-schema-2020-12-accordion__icon\",{\"json-schema-2020-12-accordion__icon--expanded\":o,\"json-schema-2020-12-accordion__icon--collapsed\":!o})},Pe.createElement(u,null)))},ExpandDeepButton_ExpandDeepButton=({expanded:o,onClick:s})=>{const i=(0,Pe.useCallback)((i=>{s(i,!o)}),[o,s]);return Pe.createElement(\"button\",{type:\"button\",className:\"json-schema-2020-12-expand-deep-button\",onClick:i},o?\"Collapse all\":\"Expand all\")},icons_ChevronRight=()=>Pe.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\"},Pe.createElement(\"path\",{d:\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"})),fn_upperFirst=o=>\"string\"==typeof o?`${o.charAt(0).toUpperCase()}${o.slice(1)}`:o,getTitle=(o,{lookup:s=\"extended\"}={})=>{const i=useFn();if(null!=o?.title)return i.upperFirst(String(o.title));if(\"extended\"===s){if(null!=o?.$anchor)return i.upperFirst(String(o.$anchor));if(null!=o?.$id)return String(o.$id)}return\"\"},getType=(o,s=new WeakSet)=>{const i=useFn();if(null==o)return\"any\";if(i.isBooleanJSONSchema(o))return o?\"any\":\"never\";if(\"object\"!=typeof o)return\"any\";if(s.has(o))return\"any\";s.add(o);const{type:u,prefixItems:_,items:w}=o,getArrayType=()=>{if(Array.isArray(_)){const o=_.map((o=>getType(o,s))),i=w?getType(w,s):\"any\";return`array<[${o.join(\", \")}], ${i}>`}if(w){return`array<${getType(w,s)}>`}return\"array<any>\"};if(o.not&&\"any\"===getType(o.not))return\"never\";const handleCombiningKeywords=(i,u)=>{if(Array.isArray(o[i])){return`(${o[i].map((o=>getType(o,s))).join(u)})`}return null},x=[Array.isArray(u)?u.map((o=>\"array\"===o?getArrayType():o)).join(\" | \"):\"array\"===u?getArrayType():[\"null\",\"boolean\",\"object\",\"array\",\"number\",\"integer\",\"string\"].includes(u)?u:(()=>{if(Object.hasOwn(o,\"prefixItems\")||Object.hasOwn(o,\"items\")||Object.hasOwn(o,\"contains\"))return getArrayType();if(Object.hasOwn(o,\"properties\")||Object.hasOwn(o,\"additionalProperties\")||Object.hasOwn(o,\"patternProperties\"))return\"object\";if([\"int32\",\"int64\"].includes(o.format))return\"integer\";if([\"float\",\"double\"].includes(o.format))return\"number\";if(Object.hasOwn(o,\"minimum\")||Object.hasOwn(o,\"maximum\")||Object.hasOwn(o,\"exclusiveMinimum\")||Object.hasOwn(o,\"exclusiveMaximum\")||Object.hasOwn(o,\"multipleOf\"))return\"number | integer\";if(Object.hasOwn(o,\"pattern\")||Object.hasOwn(o,\"format\")||Object.hasOwn(o,\"minLength\")||Object.hasOwn(o,\"maxLength\"))return\"string\";if(void 0!==o.const){if(null===o.const)return\"null\";if(\"boolean\"==typeof o.const)return\"boolean\";if(\"number\"==typeof o.const)return Number.isInteger(o.const)?\"integer\":\"number\";if(\"string\"==typeof o.const)return\"string\";if(Array.isArray(o.const))return\"array<any>\";if(\"object\"==typeof o.const)return\"object\"}return null})(),handleCombiningKeywords(\"oneOf\",\" | \"),handleCombiningKeywords(\"anyOf\",\" | \"),handleCombiningKeywords(\"allOf\",\" & \")].filter(Boolean).join(\" | \");return s.delete(o),x||\"any\"},isBooleanJSONSchema=o=>\"boolean\"==typeof o,hasKeyword=(o,s)=>null!==o&&\"object\"==typeof o&&Object.hasOwn(o,s),isExpandable=o=>{const s=useFn();return o?.$schema||o?.$vocabulary||o?.$id||o?.$anchor||o?.$dynamicAnchor||o?.$ref||o?.$dynamicRef||o?.$defs||o?.$comment||o?.allOf||o?.anyOf||o?.oneOf||s.hasKeyword(o,\"not\")||s.hasKeyword(o,\"if\")||s.hasKeyword(o,\"then\")||s.hasKeyword(o,\"else\")||o?.dependentSchemas||o?.prefixItems||s.hasKeyword(o,\"items\")||s.hasKeyword(o,\"contains\")||o?.properties||o?.patternProperties||s.hasKeyword(o,\"additionalProperties\")||s.hasKeyword(o,\"propertyNames\")||s.hasKeyword(o,\"unevaluatedItems\")||s.hasKeyword(o,\"unevaluatedProperties\")||o?.description||o?.enum||s.hasKeyword(o,\"const\")||s.hasKeyword(o,\"contentSchema\")||s.hasKeyword(o,\"default\")},fn_stringify=o=>null===o||[\"number\",\"bigint\",\"boolean\"].includes(typeof o)?String(o):Array.isArray(o)?`[${o.map(fn_stringify).join(\", \")}]`:JSON.stringify(o),stringifyConstraintRange=(o,s,i)=>{const u=\"number\"==typeof s,_=\"number\"==typeof i;return u&&_?s===i?`${s} ${o}`:`[${s}, ${i}] ${o}`:u?`>= ${s} ${o}`:_?`<= ${i} ${o}`:null},stringifyConstraints=o=>{const s=[],i=(o=>{if(\"number\"!=typeof o?.multipleOf)return null;if(o.multipleOf<=0)return null;if(1===o.multipleOf)return null;const{multipleOf:s}=o;if(Number.isInteger(s))return`multiple of ${s}`;const i=10**s.toString().split(\".\")[1].length;return`multiple of ${s*i}/${i}`})(o);null!==i&&s.push({scope:\"number\",value:i});const u=(o=>{const s=o?.minimum,i=o?.maximum,u=o?.exclusiveMinimum,_=o?.exclusiveMaximum,w=\"number\"==typeof s,x=\"number\"==typeof i,C=\"number\"==typeof u,j=\"number\"==typeof _,L=C&&(!w||s<u),B=j&&(!x||i>_);if((w||C)&&(x||j))return`${L?\"(\":\"[\"}${L?u:s}, ${B?_:i}${B?\")\":\"]\"}`;if(w||C)return`${L?\">\":\"≥\"} ${L?u:s}`;if(x||j)return`${B?\"<\":\"≤\"} ${B?_:i}`;return null})(o);null!==u&&s.push({scope:\"number\",value:u}),o?.format&&s.push({scope:\"string\",value:o.format});const _=stringifyConstraintRange(\"characters\",o?.minLength,o?.maxLength);null!==_&&s.push({scope:\"string\",value:_}),o?.pattern&&s.push({scope:\"string\",value:`matches ${o?.pattern}`}),o?.contentMediaType&&s.push({scope:\"string\",value:`media type: ${o.contentMediaType}`}),o?.contentEncoding&&s.push({scope:\"string\",value:`encoding: ${o.contentEncoding}`});const w=stringifyConstraintRange(o?.hasUniqueItems?\"unique items\":\"items\",o?.minItems,o?.maxItems);null!==w&&s.push({scope:\"array\",value:w});const x=stringifyConstraintRange(\"contained items\",o?.minContains,o?.maxContains);null!==x&&s.push({scope:\"array\",value:x});const C=stringifyConstraintRange(\"properties\",o?.minProperties,o?.maxProperties);return null!==C&&s.push({scope:\"object\",value:C}),s},getDependentRequired=(o,s)=>s?.dependentRequired?Array.from(Object.entries(s.dependentRequired).reduce(((s,[i,u])=>Array.isArray(u)&&u.includes(o)?(s.add(i),s):s),new Set)):[],withJSONSchemaContext=(o,s={})=>{const i={components:{JSONSchema:qP,Keyword$schema:keywords_$schema,Keyword$vocabulary:$vocabulary_$vocabulary,Keyword$id:keywords_$id,Keyword$anchor:keywords_$anchor,Keyword$dynamicAnchor:keywords_$dynamicAnchor,Keyword$ref:keywords_$ref,Keyword$dynamicRef:keywords_$dynamicRef,Keyword$defs:keywords_$defs,Keyword$comment:keywords_$comment,KeywordAllOf:keywords_AllOf,KeywordAnyOf:keywords_AnyOf,KeywordOneOf:keywords_OneOf,KeywordNot:keywords_Not,KeywordIf:keywords_If,KeywordThen:keywords_Then,KeywordElse:keywords_Else,KeywordDependentSchemas:keywords_DependentSchemas,KeywordPrefixItems:keywords_PrefixItems,KeywordItems:keywords_Items,KeywordContains:keywords_Contains,KeywordProperties:keywords_Properties_Properties,KeywordPatternProperties:PatternProperties_PatternProperties,KeywordAdditionalProperties:keywords_AdditionalProperties,KeywordPropertyNames:keywords_PropertyNames,KeywordUnevaluatedItems:keywords_UnevaluatedItems,KeywordUnevaluatedProperties:keywords_UnevaluatedProperties,KeywordType:keywords_Type,KeywordEnum:Enum_Enum,KeywordConst:keywords_Const,KeywordConstraint:$P,KeywordDependentRequired:DependentRequired_DependentRequired,KeywordContentSchema:keywords_ContentSchema,KeywordTitle:Title_Title,KeywordDescription:keywords_Description_Description,KeywordDefault:keywords_Default,KeywordDeprecated:keywords_Deprecated,KeywordReadOnly:keywords_ReadOnly,KeywordWriteOnly:keywords_WriteOnly,Accordion:Accordion_Accordion,ExpandDeepButton:ExpandDeepButton_ExpandDeepButton,ChevronRightIcon:icons_ChevronRight,...s.components},config:{default$schema:\"https://json-schema.org/draft/2020-12/schema\",defaultExpandedLevels:0,...s.config},fn:{upperFirst:fn_upperFirst,getTitle,getType,isBooleanJSONSchema,hasKeyword,isExpandable,stringify:fn_stringify,stringifyConstraints,getDependentRequired,...s.fn}},HOC=s=>Pe.createElement(RP.Provider,{value:i},Pe.createElement(o,s));return HOC.contexts={JSONSchemaContext:RP},HOC.displayName=o.displayName,HOC},json_schema_2020_12=()=>({components:{JSONSchema202012:qP,JSONSchema202012Keyword$schema:keywords_$schema,JSONSchema202012Keyword$vocabulary:$vocabulary_$vocabulary,JSONSchema202012Keyword$id:keywords_$id,JSONSchema202012Keyword$anchor:keywords_$anchor,JSONSchema202012Keyword$dynamicAnchor:keywords_$dynamicAnchor,JSONSchema202012Keyword$ref:keywords_$ref,JSONSchema202012Keyword$dynamicRef:keywords_$dynamicRef,JSONSchema202012Keyword$defs:keywords_$defs,JSONSchema202012Keyword$comment:keywords_$comment,JSONSchema202012KeywordAllOf:keywords_AllOf,JSONSchema202012KeywordAnyOf:keywords_AnyOf,JSONSchema202012KeywordOneOf:keywords_OneOf,JSONSchema202012KeywordNot:keywords_Not,JSONSchema202012KeywordIf:keywords_If,JSONSchema202012KeywordThen:keywords_Then,JSONSchema202012KeywordElse:keywords_Else,JSONSchema202012KeywordDependentSchemas:keywords_DependentSchemas,JSONSchema202012KeywordPrefixItems:keywords_PrefixItems,JSONSchema202012KeywordItems:keywords_Items,JSONSchema202012KeywordContains:keywords_Contains,JSONSchema202012KeywordProperties:keywords_Properties_Properties,JSONSchema202012KeywordPatternProperties:PatternProperties_PatternProperties,JSONSchema202012KeywordAdditionalProperties:keywords_AdditionalProperties,JSONSchema202012KeywordPropertyNames:keywords_PropertyNames,JSONSchema202012KeywordUnevaluatedItems:keywords_UnevaluatedItems,JSONSchema202012KeywordUnevaluatedProperties:keywords_UnevaluatedProperties,JSONSchema202012KeywordType:keywords_Type,JSONSchema202012KeywordEnum:Enum_Enum,JSONSchema202012KeywordConst:keywords_Const,JSONSchema202012KeywordConstraint:$P,JSONSchema202012KeywordDependentRequired:DependentRequired_DependentRequired,JSONSchema202012KeywordContentSchema:keywords_ContentSchema,JSONSchema202012KeywordTitle:Title_Title,JSONSchema202012KeywordDescription:keywords_Description_Description,JSONSchema202012KeywordDefault:keywords_Default,JSONSchema202012KeywordDeprecated:keywords_Deprecated,JSONSchema202012KeywordReadOnly:keywords_ReadOnly,JSONSchema202012KeywordWriteOnly:keywords_WriteOnly,JSONSchema202012Accordion:Accordion_Accordion,JSONSchema202012ExpandDeepButton:ExpandDeepButton_ExpandDeepButton,JSONSchema202012ChevronRightIcon:icons_ChevronRight,withJSONSchema202012Context:withJSONSchemaContext,JSONSchema202012DeepExpansionContext:()=>LP},fn:{upperFirst:fn_upperFirst,jsonSchema202012:{isExpandable,hasKeyword,useFn,useConfig,useComponent,useIsExpandedDeeply}}});var VP=__webpack_require__(11331),UP=__webpack_require__.n(VP);const array=(o,{sample:s})=>((o,s={})=>{const{minItems:i,maxItems:u,uniqueItems:_}=s,{contains:w,minContains:x,maxContains:C}=s;let j=[...o];if(null!=w&&\"object\"==typeof w){if(Number.isInteger(x)&&x>1){const o=j.at(0);for(let s=1;s<x;s+=1)j.unshift(o)}Number.isInteger(C)}if(Number.isInteger(u)&&u>0&&(j=o.slice(0,u)),Number.isInteger(i)&&i>0)for(let o=0;j.length<i;o+=1)j.push(j[o%j.length]);return!0===_&&(j=Array.from(new Set(j))),j})(s,o),object=()=>{throw new Error(\"Not implemented\")},bytes=o=>St()(o),random_pick=o=>o.at(0),predicates_isBooleanJSONSchema=o=>\"boolean\"==typeof o,isJSONSchemaObject=o=>UP()(o),isJSONSchema=o=>predicates_isBooleanJSONSchema(o)||isJSONSchemaObject(o);const zP=class Registry{data={};register(o,s){this.data[o]=s}unregister(o){void 0===o?this.data={}:delete this.data[o]}get(o){return this.data[o]}},int32=()=>2**30>>>0,int64=()=>2**53-1,generators_float=()=>.1,generators_double=()=>.1,email=()=>\"user@example.com\",idn_email=()=>\"실례@example.com\",hostname=()=>\"example.com\",idn_hostname=()=>\"실례.com\",ipv4=()=>\"198.51.100.42\",ipv6=()=>\"2001:0db8:5b96:0000:0000:426f:8e17:642a\",uri=()=>\"https://example.com/\",uri_reference=()=>\"path/index.html\",iri=()=>\"https://실례.com/\",iri_reference=()=>\"path/실례.html\",uuid=()=>\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",uri_template=()=>\"https://example.com/dictionary/{term:1}/{term}\",json_pointer=()=>\"/a/b/c\",relative_json_pointer=()=>\"1/0\",date_time=()=>(new Date).toISOString(),date=()=>(new Date).toISOString().substring(0,10),time=()=>(new Date).toISOString().substring(11),duration=()=>\"P3D\",generators_password=()=>\"********\",regex=()=>\"^[a-z]+$\";const WP=new class FormatRegistry extends zP{#t={int32,int64,float:generators_float,double:generators_double,email,\"idn-email\":idn_email,hostname,\"idn-hostname\":idn_hostname,ipv4,ipv6,uri,\"uri-reference\":uri_reference,iri,\"iri-reference\":iri_reference,uuid,\"uri-template\":uri_template,\"json-pointer\":json_pointer,\"relative-json-pointer\":relative_json_pointer,\"date-time\":date_time,date,time,duration,password:generators_password,regex};data={...this.#t};get defaults(){return{...this.#t}}},formatAPI=(o,s)=>\"function\"==typeof s?WP.register(o,s):null===s?WP.unregister(o):WP.get(o);formatAPI.getDefaults=()=>WP.defaults;const KP=formatAPI;var HP=__webpack_require__(48287).Buffer;const _7bit=o=>HP.from(o).toString(\"ascii\");var JP=__webpack_require__(48287).Buffer;const _8bit=o=>JP.from(o).toString(\"utf8\");var GP=__webpack_require__(48287).Buffer;const encoders_binary=o=>GP.from(o).toString(\"binary\"),quoted_printable=o=>{let s=\"\";for(let i=0;i<o.length;i++){const u=o.charCodeAt(i);if(61===u)s+=\"=3D\";else if(u>=33&&u<=60||u>=62&&u<=126||9===u||32===u)s+=o.charAt(i);else if(13===u||10===u)s+=\"\\r\\n\";else if(u>126){const u=unescape(encodeURIComponent(o.charAt(i)));for(let o=0;o<u.length;o++)s+=\"=\"+(\"0\"+u.charCodeAt(o).toString(16)).slice(-2).toUpperCase()}else s+=\"=\"+(\"0\"+u.toString(16)).slice(-2).toUpperCase()}return s};var YP=__webpack_require__(48287).Buffer;const base16=o=>YP.from(o).toString(\"hex\");var XP=__webpack_require__(48287).Buffer;const base32=o=>{const s=XP.from(o).toString(\"utf8\"),i=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\";let u=0,_=\"\",w=0,x=0;for(let o=0;o<s.length;o++)for(w=w<<8|s.charCodeAt(o),x+=8;x>=5;)_+=i.charAt(w>>>x-5&31),x-=5;x>0&&(_+=i.charAt(w<<5-x&31),u=(8-8*s.length%5)%5);for(let o=0;o<u;o++)_+=\"=\";return _};var QP=__webpack_require__(48287).Buffer;const base64=o=>QP.from(o).toString(\"base64\");var ZP=__webpack_require__(48287).Buffer;const base64url=o=>ZP.from(o).toString(\"base64url\");const eI=new class EncoderRegistry extends zP{#t={\"7bit\":_7bit,\"8bit\":_8bit,binary:encoders_binary,\"quoted-printable\":quoted_printable,base16,base32,base64,base64url};data={...this.#t};get defaults(){return{...this.#t}}},encoderAPI=(o,s)=>\"function\"==typeof s?eI.register(o,s):null===s?eI.unregister(o):eI.get(o);encoderAPI.getDefaults=()=>eI.defaults;const tI=encoderAPI,rI={\"text/plain\":()=>\"string\",\"text/css\":()=>\".selector { border: 1px solid red }\",\"text/csv\":()=>\"value1,value2,value3\",\"text/html\":()=>\"<p>content</p>\",\"text/calendar\":()=>\"BEGIN:VCALENDAR\",\"text/javascript\":()=>\"console.dir('Hello world!');\",\"text/xml\":()=>'<person age=\"30\">John Doe</person>',\"text/*\":()=>\"string\"},nI={\"image/*\":()=>bytes(25).toString(\"binary\")},oI={\"audio/*\":()=>bytes(25).toString(\"binary\")},sI={\"video/*\":()=>bytes(25).toString(\"binary\")},iI={\"application/json\":()=>'{\"key\":\"value\"}',\"application/ld+json\":()=>'{\"name\": \"John Doe\"}',\"application/x-httpd-php\":()=>\"<?php echo '<p>Hello World!</p>'; ?>\",\"application/rtf\":()=>String.raw`{\\rtf1\\adeflang1025\\ansi\\ansicpg1252\\uc1`,\"application/x-sh\":()=>'echo \"Hello World!\"',\"application/xhtml+xml\":()=>\"<p>content</p>\",\"application/*\":()=>bytes(25).toString(\"binary\")};const aI=new class MediaTypeRegistry extends zP{#t={...rI,...nI,...oI,...sI,...iI};data={...this.#t};get defaults(){return{...this.#t}}},mediaTypeAPI=(o,s)=>{if(\"function\"==typeof s)return aI.register(o,s);if(null===s)return aI.unregister(o);const i=o.split(\";\").at(0),u=`${i.split(\"/\").at(0)}/*`;return aI.get(o)||aI.get(i)||aI.get(u)};mediaTypeAPI.getDefaults=()=>aI.defaults;const cI=mediaTypeAPI,applyStringConstraints=(o,s={})=>{const{maxLength:i,minLength:u}=s;let _=o;if(Number.isInteger(i)&&i>0&&(_=_.slice(0,i)),Number.isInteger(u)&&u>0){let o=0;for(;_.length<u;)_+=_[o++%_.length]}return _},types_string=(o,{sample:s}={})=>{const{contentEncoding:i,contentMediaType:u,contentSchema:_}=o,{pattern:w,format:x}=o,C=tI(i)||_k();let j;return j=\"string\"==typeof w?applyStringConstraints((o=>{try{return new(Yo())(o).gen()}catch{return\"string\"}})(w),o):\"string\"==typeof x?(o=>{const{format:s}=o,i=KP(s);return\"function\"==typeof i?i(o):\"string\"})(o):isJSONSchema(_)&&\"string\"==typeof u&&void 0!==s?Array.isArray(s)||\"object\"==typeof s?JSON.stringify(s):applyStringConstraints(String(s),o):\"string\"==typeof u?(o=>{const{contentMediaType:s}=o,i=cI(s);return\"function\"==typeof i?i(o):\"string\"})(o):applyStringConstraints(\"string\",o),C(j)},applyNumberConstraints=(o,s={})=>{const{minimum:i,maximum:u,exclusiveMinimum:_,exclusiveMaximum:w}=s,{multipleOf:x}=s,C=Number.isInteger(o)?1:Number.EPSILON;let j=\"number\"==typeof i?i:null,L=\"number\"==typeof u?u:null,B=o;if(\"number\"==typeof _&&(j=null!==j?Math.max(j,_+C):_+C),\"number\"==typeof w&&(L=null!==L?Math.min(L,w-C):w-C),B=j>L&&o||j||L||B,\"number\"==typeof x&&x>0){const o=B%x;B=0===o?B:B+x-o}return B},types_number=o=>{const{format:s}=o;let i;return i=\"string\"==typeof s?(o=>{const{format:s}=o,i=KP(s);return\"function\"==typeof i?i(o):0})(o):0,applyNumberConstraints(i,o)},types_integer=o=>{const{format:s}=o;let i;return i=\"string\"==typeof s?(o=>{const{format:s}=o,i=KP(s);if(\"function\"==typeof i)return i(o);switch(s){case\"int32\":return int32();case\"int64\":return int64()}return 0})(o):0,applyNumberConstraints(i,o)},types_boolean=o=>\"boolean\"!=typeof o.default||o.default,lI=new Proxy({array,object,string:types_string,number:types_number,integer:types_integer,boolean:types_boolean,null:()=>null},{get:(o,s)=>\"string\"==typeof s&&Object.hasOwn(o,s)?o[s]:()=>`Unknown Type: ${s}`}),uI=[\"array\",\"object\",\"number\",\"integer\",\"string\",\"boolean\",\"null\"],hasExample=o=>{if(!isJSONSchemaObject(o))return!1;const{examples:s,example:i,default:u}=o;return!!(Array.isArray(s)&&s.length>=1)||(void 0!==u||void 0!==i)},extractExample=o=>{if(!isJSONSchemaObject(o))return null;const{examples:s,example:i,default:u}=o;return Array.isArray(s)&&s.length>=1?s.at(0):void 0!==u?u:void 0!==i?i:void 0},pI={array:[\"items\",\"prefixItems\",\"contains\",\"maxContains\",\"minContains\",\"maxItems\",\"minItems\",\"uniqueItems\",\"unevaluatedItems\"],object:[\"properties\",\"additionalProperties\",\"patternProperties\",\"propertyNames\",\"minProperties\",\"maxProperties\",\"required\",\"dependentSchemas\",\"dependentRequired\",\"unevaluatedProperties\"],string:[\"pattern\",\"format\",\"minLength\",\"maxLength\",\"contentEncoding\",\"contentMediaType\",\"contentSchema\"],integer:[\"minimum\",\"maximum\",\"exclusiveMinimum\",\"exclusiveMaximum\",\"multipleOf\"]};pI.number=pI.integer;const hI=\"string\",inferTypeFromValue=o=>void 0===o?null:null===o?\"null\":Array.isArray(o)?\"array\":Number.isInteger(o)?\"integer\":typeof o,foldType=o=>{if(Array.isArray(o)&&o.length>=1){if(o.includes(\"array\"))return\"array\";if(o.includes(\"object\"))return\"object\";{const s=random_pick(o);if(uI.includes(s))return s}}return uI.includes(o)?o:null},inferType=(o,s=new WeakSet)=>{if(!isJSONSchemaObject(o))return hI;if(s.has(o))return hI;s.add(o);let{type:i,const:u}=o;if(i=foldType(i),\"string\"!=typeof i){const s=Object.keys(pI);e:for(let u=0;u<s.length;u+=1){const _=s[u],w=pI[_];for(let s=0;s<w.length;s+=1){const u=w[s];if(Object.hasOwn(o,u)){i=_;break e}}}}if(\"string\"!=typeof i&&void 0!==u){const o=inferTypeFromValue(u);i=\"string\"==typeof o?o:i}if(\"string\"!=typeof i){const combineTypes=i=>{if(Array.isArray(o[i])){const u=o[i].map((o=>inferType(o,s)));return foldType(u)}return null},u=combineTypes(\"allOf\"),_=combineTypes(\"anyOf\"),w=combineTypes(\"oneOf\"),x=o.not?inferType(o.not,s):null;(u||_||w||x)&&(i=foldType([u,_,w,x].filter(Boolean)))}if(\"string\"!=typeof i&&hasExample(o)){const s=extractExample(o),u=inferTypeFromValue(s);i=\"string\"==typeof u?u:i}return s.delete(o),i||hI},type_getType=o=>inferType(o),typeCast=o=>predicates_isBooleanJSONSchema(o)?(o=>!1===o?{not:{}}:{})(o):isJSONSchemaObject(o)?o:{},merge_merge=(o,s,i={})=>{if(predicates_isBooleanJSONSchema(o)&&!0===o)return!0;if(predicates_isBooleanJSONSchema(o)&&!1===o)return!1;if(predicates_isBooleanJSONSchema(s)&&!0===s)return!0;if(predicates_isBooleanJSONSchema(s)&&!1===s)return!1;if(!isJSONSchema(o))return s;if(!isJSONSchema(s))return o;const u={...s,...o};if(s.type&&o.type&&Array.isArray(s.type)&&\"string\"==typeof s.type){const i=normalizeArray(s.type).concat(o.type);u.type=Array.from(new Set(i))}if(Array.isArray(s.required)&&Array.isArray(o.required)&&(u.required=[...new Set([...o.required,...s.required])]),s.properties&&o.properties){const _=new Set([...Object.keys(s.properties),...Object.keys(o.properties)]);u.properties={};for(const w of _){const _=s.properties[w]||{},x=o.properties[w]||{};_.readOnly&&!i.includeReadOnly||_.writeOnly&&!i.includeWriteOnly?u.required=(u.required||[]).filter((o=>o!==w)):u.properties[w]=merge_merge(x,_,i)}}return isJSONSchema(s.items)&&isJSONSchema(o.items)&&(u.items=merge_merge(o.items,s.items,i)),isJSONSchema(s.contains)&&isJSONSchema(o.contains)&&(u.contains=merge_merge(o.contains,s.contains,i)),isJSONSchema(s.contentSchema)&&isJSONSchema(o.contentSchema)&&(u.contentSchema=merge_merge(o.contentSchema,s.contentSchema,i)),u},dI=merge_merge,main_sampleFromSchemaGeneric=(o,s={},i=void 0,u=!1)=>{if(null==o&&void 0===i)return;\"function\"==typeof o?.toJS&&(o=o.toJS()),o=typeCast(o);let _=void 0!==i||hasExample(o);const w=!_&&Array.isArray(o.oneOf)&&o.oneOf.length>0,x=!_&&Array.isArray(o.anyOf)&&o.anyOf.length>0;if(!_&&(w||x)){const i=typeCast(random_pick(w?o.oneOf:o.anyOf));!(o=dI(o,i,s)).xml&&i.xml&&(o.xml=i.xml),hasExample(o)&&hasExample(i)&&(_=!0)}const C={};let{xml:j,properties:L,additionalProperties:B,items:$,contains:V}=o||{},U=type_getType(o),{includeReadOnly:z,includeWriteOnly:Y}=s;j=j||{};let Z,{name:ee,prefix:ie,namespace:ae}=j,ce={};if(Object.hasOwn(o,\"type\")||(o.type=U),u&&(ee=ee||\"notagname\",Z=(ie?`${ie}:`:\"\")+ee,ae)){C[ie?`xmlns:${ie}`:\"xmlns\"]=ae}u&&(ce[Z]=[]);const le=objectify(L);let pe,de=0;const hasExceededMaxProperties=()=>Number.isInteger(o.maxProperties)&&o.maxProperties>0&&de>=o.maxProperties,canAddProperty=s=>!(Number.isInteger(o.maxProperties)&&o.maxProperties>0)||!hasExceededMaxProperties()&&(!(s=>!Array.isArray(o.required)||0===o.required.length||!o.required.includes(s))(s)||o.maxProperties-de-(()=>{if(!Array.isArray(o.required)||0===o.required.length)return 0;let s=0;return u?o.required.forEach((o=>s+=void 0===ce[o]?0:1)):o.required.forEach((o=>{s+=void 0===ce[Z]?.find((s=>void 0!==s[o]))?0:1})),o.required.length-s})()>0);if(pe=u?(i,_=void 0)=>{if(o&&le[i]){if(le[i].xml=le[i].xml||{},le[i].xml.attribute){const o=Array.isArray(le[i].enum)?random_pick(le[i].enum):void 0;if(hasExample(le[i]))C[le[i].xml.name||i]=extractExample(le[i]);else if(void 0!==o)C[le[i].xml.name||i]=o;else{const o=typeCast(le[i]),s=type_getType(o),u=le[i].xml.name||i;C[u]=lI[s](o)}return}le[i].xml.name=le[i].xml.name||i}else le[i]||!1===B||(le[i]={xml:{name:i}});let w=main_sampleFromSchemaGeneric(le[i],s,_,u);canAddProperty(i)&&(de++,Array.isArray(w)?ce[Z]=ce[Z].concat(w):ce[Z].push(w))}:(i,_)=>{if(canAddProperty(i)){if(UP()(o.discriminator?.mapping)&&o.discriminator.propertyName===i&&\"string\"==typeof o.$$ref){for(const s in o.discriminator.mapping)if(-1!==o.$$ref.search(o.discriminator.mapping[s])){ce[i]=s;break}}else ce[i]=main_sampleFromSchemaGeneric(le[i],s,_,u);de++}},_){let _;if(_=void 0!==i?i:extractExample(o),!u){if(\"number\"==typeof _&&\"string\"===U)return`${_}`;if(\"string\"!=typeof _||\"string\"===U)return _;try{return JSON.parse(_)}catch{return _}}if(\"array\"===U){if(!Array.isArray(_)){if(\"string\"==typeof _)return _;_=[_]}let i=[];return isJSONSchemaObject($)&&($.xml=$.xml||j||{},$.xml.name=$.xml.name||j.name,i=_.map((o=>main_sampleFromSchemaGeneric($,s,o,u)))),isJSONSchemaObject(V)&&(V.xml=V.xml||j||{},V.xml.name=V.xml.name||j.name,i=[main_sampleFromSchemaGeneric(V,s,void 0,u),...i]),i=lI.array(o,{sample:i}),j.wrapped?(ce[Z]=i,Qo()(C)||ce[Z].push({_attr:C})):ce=i,ce}if(\"object\"===U){if(\"string\"==typeof _)return _;for(const o in _)Object.hasOwn(_,o)&&(le[o]?.readOnly&&!z||le[o]?.writeOnly&&!Y||(le[o]?.xml?.attribute?C[le[o].xml.name||o]=_[o]:pe(o,_[o])));return Qo()(C)||ce[Z].push({_attr:C}),ce}return ce[Z]=Qo()(C)?_:[{_attr:C},_],ce}if(\"array\"===U){let i=[];if(isJSONSchemaObject(V))if(u&&(V.xml=V.xml||o.xml||{},V.xml.name=V.xml.name||j.name),Array.isArray(V.anyOf)){const{anyOf:o,..._}=$;i.push(...V.anyOf.map((o=>main_sampleFromSchemaGeneric(dI(o,_,s),s,void 0,u))))}else if(Array.isArray(V.oneOf)){const{oneOf:o,..._}=$;i.push(...V.oneOf.map((o=>main_sampleFromSchemaGeneric(dI(o,_,s),s,void 0,u))))}else{if(!(!u||u&&j.wrapped))return main_sampleFromSchemaGeneric(V,s,void 0,u);i.push(main_sampleFromSchemaGeneric(V,s,void 0,u))}if(isJSONSchemaObject($))if(u&&($.xml=$.xml||o.xml||{},$.xml.name=$.xml.name||j.name),Array.isArray($.anyOf)){const{anyOf:o,..._}=$;i.push(...$.anyOf.map((o=>main_sampleFromSchemaGeneric(dI(o,_,s),s,void 0,u))))}else if(Array.isArray($.oneOf)){const{oneOf:o,..._}=$;i.push(...$.oneOf.map((o=>main_sampleFromSchemaGeneric(dI(o,_,s),s,void 0,u))))}else{if(!(!u||u&&j.wrapped))return main_sampleFromSchemaGeneric($,s,void 0,u);i.push(main_sampleFromSchemaGeneric($,s,void 0,u))}return i=lI.array(o,{sample:i}),u&&j.wrapped?(ce[Z]=i,Qo()(C)||ce[Z].push({_attr:C}),ce):i}if(\"object\"===U){for(let o in le)Object.hasOwn(le,o)&&(le[o]?.deprecated||le[o]?.readOnly&&!z||le[o]?.writeOnly&&!Y||pe(o));if(u&&C&&ce[Z].push({_attr:C}),hasExceededMaxProperties())return ce;if(predicates_isBooleanJSONSchema(B)&&B)u?ce[Z].push({additionalProp:\"Anything can be here\"}):ce.additionalProp1={},de++;else if(isJSONSchemaObject(B)){const i=B,_=main_sampleFromSchemaGeneric(i,s,void 0,u);if(u&&\"string\"==typeof i?.xml?.name&&\"notagname\"!==i?.xml?.name)ce[Z].push(_);else{const s=Number.isInteger(o.minProperties)&&o.minProperties>0&&de<o.minProperties?o.minProperties-de:3;for(let o=1;o<=s;o++){if(hasExceededMaxProperties())return ce;if(u){const s={};s[\"additionalProp\"+o]=_.notagname,ce[Z].push(s)}else ce[\"additionalProp\"+o]=_;de++}}}return ce}let fe;if(void 0!==o.const)fe=o.const;else if(o&&Array.isArray(o.enum))fe=random_pick(normalizeArray(o.enum));else{const i=isJSONSchemaObject(o.contentSchema)?main_sampleFromSchemaGeneric(o.contentSchema,s,void 0,u):void 0;fe=lI[U](o,{sample:i})}return u?(ce[Z]=Qo()(C)?fe:[{_attr:C},fe],ce):fe},main_createXMLExample=(o,s,i)=>{const u=main_sampleFromSchemaGeneric(o,s,i,!0);if(u)return\"string\"==typeof u?u:Jo()(u,{declaration:!0,indent:\"\\t\"})},main_sampleFromSchema=(o,s,i)=>main_sampleFromSchemaGeneric(o,s,i,!1),main_resolver=(o,s,i)=>[o,JSON.stringify(s),JSON.stringify(i)],fI=utils_memoizeN(main_createXMLExample,main_resolver),mI=utils_memoizeN(main_sampleFromSchema,main_resolver);const gI=new class OptionRegistry extends zP{#t={};data={...this.#t};get defaults(){return{...this.#t}}},api_optionAPI=(o,s)=>(void 0!==s&&gI.register(o,s),gI.get(o)),yI=[{when:/json/,shouldStringifyTypes:[\"string\"]}],vI=[\"object\"],fn_get_json_sample_schema=o=>(s,i,u,_)=>{const{fn:w}=o(),x=w.jsonSchema202012.memoizedSampleFromSchema(s,i,_),C=typeof x,j=yI.reduce(((o,s)=>s.when.test(u)?[...o,...s.shouldStringifyTypes]:o),vI);return mt()(j,(o=>o===C))?JSON.stringify(x,null,2):x},fn_get_yaml_sample_schema=o=>(s,i,u,_)=>{const{fn:w}=o(),x=w.jsonSchema202012.getJsonSampleSchema(s,i,u,_);let C;try{C=to.dump(to.load(x),{lineWidth:-1},{schema:zn}),\"\\n\"===C[C.length-1]&&(C=C.slice(0,C.length-1))}catch(o){return console.error(o),\"error: could not generate yaml example\"}return C.replace(/\\t/g,\"  \")},fn_get_xml_sample_schema=o=>(s,i,u)=>{const{fn:_}=o();if(s&&!s.xml&&(s.xml={}),s&&!s.xml.name){if(!s.$$ref&&(s.type||s.items||s.properties||s.additionalProperties))return'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n\\x3c!-- XML example cannot be generated; root element name is undefined --\\x3e';if(s.$$ref){let o=s.$$ref.match(/\\S*\\/(\\S+)$/);s.xml.name=o[1]}}return _.jsonSchema202012.memoizedCreateXMLExample(s,i,u)},fn_get_sample_schema=o=>(s,i=\"\",u={},_=void 0)=>{const{fn:w}=o();return\"function\"==typeof s?.toJS&&(s=s.toJS()),\"function\"==typeof _?.toJS&&(_=_.toJS()),/xml/.test(i)?w.jsonSchema202012.getXmlSampleSchema(s,u,_):/(yaml|yml)/.test(i)?w.jsonSchema202012.getYamlSampleSchema(s,u,i,_):w.jsonSchema202012.getJsonSampleSchema(s,u,i,_)},json_schema_2020_12_samples=({getSystem:o})=>{const s=fn_get_json_sample_schema(o),i=fn_get_yaml_sample_schema(o),u=fn_get_xml_sample_schema(o),_=fn_get_sample_schema(o);return{fn:{jsonSchema202012:{sampleFromSchema:main_sampleFromSchema,sampleFromSchemaGeneric:main_sampleFromSchemaGeneric,sampleOptionAPI:api_optionAPI,sampleEncoderAPI:tI,sampleFormatAPI:KP,sampleMediaTypeAPI:cI,createXMLExample:main_createXMLExample,memoizedSampleFromSchema:mI,memoizedCreateXMLExample:fI,getJsonSampleSchema:s,getYamlSampleSchema:i,getXmlSampleSchema:u,getSampleSchema:_,mergeJsonSchema:dI}}}};function PresetApis(){return[base,oas3,json_schema_2020_12,json_schema_2020_12_samples,oas31]}const inline_plugin=o=>()=>({fn:o.fn,components:o.components}),factorization_system=o=>{const s=We()({layout:{layout:o.layout,filter:o.filter},spec:{spec:\"\",url:o.url},requestSnippets:o.requestSnippets},o.initialState);if(o.initialState)for(const[i,u]of Object.entries(o.initialState))void 0===u&&delete s[i];return{system:{configs:o.configs},plugins:o.presets,state:s}},sources_query=()=>o=>{const s=o.queryConfigEnabled?(()=>{const o=new URLSearchParams(at.location.search);return Object.fromEntries(o)})():{};return Object.entries(s).reduce(((o,[s,i])=>(\"config\"===s?o.configUrl=i:\"urls.primaryName\"===s?o[s]=i:o=Js()(o,s,i),o)),{})},sources_url=({url:o,system:s})=>async i=>{if(!o)return{};if(\"function\"!=typeof s.configsActions?.getConfigByUrl)return{};const u=(()=>{const o={};return o.promise=new Promise(((s,i)=>{o.resolve=s,o.reject=i})),o})();return s.configsActions.getConfigByUrl({url:o,loadRemoteConfig:!0,requestInterceptor:i.requestInterceptor,responseInterceptor:i.responseInterceptor},(o=>{u.resolve(o)})),u.promise},runtime=()=>()=>{const o={};return globalThis.location&&(o.oauth2RedirectUrl=`${globalThis.location.protocol}//${globalThis.location.host}${globalThis.location.pathname.substring(0,globalThis.location.pathname.lastIndexOf(\"/\"))}/oauth2-redirect.html`),o},bI=Object.freeze({dom_id:null,domNode:null,spec:{},url:\"\",urls:null,configUrl:null,layout:\"BaseLayout\",docExpansion:\"list\",maxDisplayedTags:-1,filter:!1,validatorUrl:\"https://validator.swagger.io/validator\",oauth2RedirectUrl:void 0,persistAuthorization:!1,configs:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,tryItOutEnabled:!1,requestInterceptor:o=>(o.curlOptions=[],o),responseInterceptor:o=>o,showMutatedRequest:!0,defaultModelRendering:\"example\",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:!1,requestSnippetsEnabled:!1,requestSnippets:{generators:{curl_bash:{title:\"cURL (bash)\",syntax:\"bash\"},curl_powershell:{title:\"cURL (PowerShell)\",syntax:\"powershell\"},curl_cmd:{title:\"cURL (CMD)\",syntax:\"bash\"}},defaultExpanded:!0,languages:null},supportedSubmitMethods:[\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"],queryConfigEnabled:!1,presets:[PresetApis],plugins:[],initialState:{},fn:{},components:{},syntaxHighlight:{activated:!0,theme:\"agate\"},operationsSorter:null,tagsSorter:null,onComplete:null,modelPropertyMacro:null,parameterMacro:null});var _I=__webpack_require__(61448),EI=__webpack_require__.n(_I),wI=__webpack_require__(77731),SI=__webpack_require__.n(wI);const type_casters_array=(o,s=[])=>Array.isArray(o)?o:s,type_casters_boolean=(o,s=!1)=>!0===o||\"true\"===o||1===o||\"1\"===o||!1!==o&&\"false\"!==o&&0!==o&&\"0\"!==o&&s,dom_node=o=>null===o||\"null\"===o?null:o,type_casters_filter=o=>{const s=String(o);return type_casters_boolean(o,s)},type_casters_function=(o,s)=>\"function\"==typeof o?o:s,nullable_array=o=>Array.isArray(o)?o:null,nullable_function=o=>\"function\"==typeof o?o:null,nullable_string=o=>null===o||\"null\"===o?null:String(o),type_casters_number=(o,s=-1)=>{const i=parseInt(o,10);return Number.isNaN(i)?s:i},type_casters_object=(o,s={})=>UP()(o)?o:s,sorter=o=>\"function\"==typeof o||\"string\"==typeof o?o:null,type_casters_string=o=>String(o),syntax_highlight=(o,s)=>UP()(o)?o:!1===o||\"false\"===o||0===o||\"0\"===o?{activated:!1}:s,undefined_string=o=>void 0===o||\"undefined\"===o?void 0:String(o),xI={components:{typeCaster:type_casters_object},configs:{typeCaster:type_casters_object},configUrl:{typeCaster:nullable_string},deepLinking:{typeCaster:type_casters_boolean,defaultValue:bI.deepLinking},defaultModelExpandDepth:{typeCaster:type_casters_number,defaultValue:bI.defaultModelExpandDepth},defaultModelRendering:{typeCaster:type_casters_string},defaultModelsExpandDepth:{typeCaster:type_casters_number,defaultValue:bI.defaultModelsExpandDepth},displayOperationId:{typeCaster:type_casters_boolean,defaultValue:bI.displayOperationId},displayRequestDuration:{typeCaster:type_casters_boolean,defaultValue:bI.displayRequestDuration},docExpansion:{typeCaster:type_casters_string},dom_id:{typeCaster:nullable_string},domNode:{typeCaster:dom_node},filter:{typeCaster:type_casters_filter},fn:{typeCaster:type_casters_object},initialState:{typeCaster:type_casters_object},layout:{typeCaster:type_casters_string},maxDisplayedTags:{typeCaster:type_casters_number,defaultValue:bI.maxDisplayedTags},modelPropertyMacro:{typeCaster:nullable_function},oauth2RedirectUrl:{typeCaster:undefined_string},onComplete:{typeCaster:nullable_function},operationsSorter:{typeCaster:sorter},paramaterMacro:{typeCaster:nullable_function},persistAuthorization:{typeCaster:type_casters_boolean,defaultValue:bI.persistAuthorization},plugins:{typeCaster:type_casters_array,defaultValue:bI.plugins},presets:{typeCaster:type_casters_array,defaultValue:bI.presets},requestInterceptor:{typeCaster:type_casters_function,defaultValue:bI.requestInterceptor},requestSnippets:{typeCaster:type_casters_object,defaultValue:bI.requestSnippets},requestSnippetsEnabled:{typeCaster:type_casters_boolean,defaultValue:bI.requestSnippetsEnabled},responseInterceptor:{typeCaster:type_casters_function,defaultValue:bI.responseInterceptor},showCommonExtensions:{typeCaster:type_casters_boolean,defaultValue:bI.showCommonExtensions},showExtensions:{typeCaster:type_casters_boolean,defaultValue:bI.showExtensions},showMutatedRequest:{typeCaster:type_casters_boolean,defaultValue:bI.showMutatedRequest},spec:{typeCaster:type_casters_object,defaultValue:bI.spec},supportedSubmitMethods:{typeCaster:type_casters_array,defaultValue:bI.supportedSubmitMethods},syntaxHighlight:{typeCaster:syntax_highlight,defaultValue:bI.syntaxHighlight},\"syntaxHighlight.activated\":{typeCaster:type_casters_boolean,defaultValue:bI.syntaxHighlight.activated},\"syntaxHighlight.theme\":{typeCaster:type_casters_string},tagsSorter:{typeCaster:sorter},tryItOutEnabled:{typeCaster:type_casters_boolean,defaultValue:bI.tryItOutEnabled},url:{typeCaster:type_casters_string},urls:{typeCaster:nullable_array},\"urls.primaryName\":{typeCaster:type_casters_string},validatorUrl:{typeCaster:nullable_string},withCredentials:{typeCaster:type_casters_boolean,defaultValue:bI.withCredentials}},type_cast=o=>Object.entries(xI).reduce(((o,[s,{typeCaster:i,defaultValue:u}])=>{if(EI()(o,s)){const _=i(go()(o,s),u);o=SI()(s,_,o)}return o}),{...o}),config_merge=(o,...s)=>{let i=Symbol.for(\"domNode\"),u=Symbol.for(\"primaryName\");const _=[];for(const o of s){const s={...o};Object.hasOwn(s,\"domNode\")&&(i=s.domNode,delete s.domNode),Object.hasOwn(s,\"urls.primaryName\")?(u=s[\"urls.primaryName\"],delete s[\"urls.primaryName\"]):Array.isArray(s.urls)&&Object.hasOwn(s.urls,\"primaryName\")&&(u=s.urls.primaryName,delete s.urls.primaryName),_.push(s)}const w=We()(o,..._);return i!==Symbol.for(\"domNode\")&&(w.domNode=i),u!==Symbol.for(\"primaryName\")&&Array.isArray(w.urls)&&(w.urls.primaryName=u),type_cast(w)};function SwaggerUI(o){const s=sources_query()(o),i=runtime()(),u=SwaggerUI.config.merge({},SwaggerUI.config.defaults,i,o,s),_=factorization_system(u),w=inline_plugin(u),x=new Store(_);x.register([u.plugins,w]);const C=x.getSystem(),persistConfigs=o=>{x.setConfigs(o),C.configsActions.loaded()},updateSpec=o=>{!s.url&&\"object\"==typeof o.spec&&Object.keys(o.spec).length>0?(C.specActions.updateUrl(\"\"),C.specActions.updateLoadingStatus(\"success\"),C.specActions.updateSpec(JSON.stringify(o.spec))):\"function\"==typeof C.specActions.download&&o.url&&!o.urls&&(C.specActions.updateUrl(o.url),C.specActions.download(o.url))},render=o=>{if(o.domNode)C.render(o.domNode,\"App\");else if(o.dom_id){const s=document.querySelector(o.dom_id);C.render(s,\"App\")}else null===o.dom_id||null===o.domNode||console.error(\"Skipped rendering: no `dom_id` or `domNode` was specified\")};return u.configUrl?((async()=>{const{configUrl:o}=u,i=await sources_url({url:o,system:C})(u),_=SwaggerUI.config.merge({},u,i,s);persistConfigs(_),null!==i&&updateSpec(_),render(_)})(),C):(persistConfigs(u),updateSpec(u),render(u),C)}SwaggerUI.System=Store,SwaggerUI.config={defaults:bI,merge:config_merge,typeCast:type_cast,typeCastMappings:xI},SwaggerUI.presets={base,apis:PresetApis},SwaggerUI.plugins={Auth:auth,Configs:configsPlugin,DeepLining:deep_linking,Err:err,Filter:filter,Icons:icons,JSONSchema5:json_schema_5,JSONSchema5Samples:json_schema_5_samples,JSONSchema202012:json_schema_2020_12,JSONSchema202012Samples:json_schema_2020_12_samples,Layout:plugins_layout,Logs:logs,OpenAPI30:oas3,OpenAPI31:oas3,OnComplete:on_complete,RequestSnippets:plugins_request_snippets,Spec:plugins_spec,SwaggerClient:swagger_client,Util:util,View:view,ViewLegacy:view_legacy,DownloadUrl:downloadUrlPlugin,SyntaxHighlighting:syntax_highlighting,Versions:versions,SafeRender:safe_render};const kI=SwaggerUI})(),module.exports=_.default})();"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui-es-bundle.js.LICENSE.txt",
    "content": "/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n\n/*!\n * @description Recursive object extending\n * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>\n * @license MIT\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2013-2018 Viacheslav Lotsmanov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * 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, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author   Feross Aboukhadijeh <https://feross.org>\n * @license  MIT\n */\n\n/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2021 Joachim Wester\n * MIT license\n */\n\n/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2022 Joachim Wester\n * MIT licensed\n */\n\n/*!\n * repeat-string <https://github.com/jonschlinkert/repeat-string>\n *\n * Copyright (c) 2014-2015, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\n/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */\n\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\n\n/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */\n\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n\n/**\n * @license React\n * react-dom.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\n/**\n * @license React\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\n/**\n * @license React\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\n/**\n * @license React\n * use-sync-external-store-with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and 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"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui-standalone-preset.js",
    "content": "/*! For license information please see swagger-ui-standalone-preset.js.LICENSE.txt */\n!function webpackUniversalModuleDefinition(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.SwaggerUIStandalonePreset=t():e.SwaggerUIStandalonePreset=t()}(this,(()=>(()=>{var e={9119:(e,t)=>{\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.BLANK_URL=t.relativeFirstCharacters=t.whitespaceEscapeCharsRegex=t.urlSchemeRegex=t.ctrlCharactersRegex=t.htmlCtrlEntityRegex=t.htmlEntitiesRegex=t.invalidProtocolRegex=void 0,t.invalidProtocolRegex=/^([^\\w]*)(javascript|data|vbscript)/im,t.htmlEntitiesRegex=/&#(\\w+)(^\\w|;)?/g,t.htmlCtrlEntityRegex=/&(newline|tab);/gi,t.ctrlCharactersRegex=/[\\u0000-\\u001F\\u007F-\\u009F\\u2000-\\u200D\\uFEFF]/gim,t.urlSchemeRegex=/^.+(:|&colon;)/gim,t.whitespaceEscapeCharsRegex=/(\\\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,t.relativeFirstCharacters=[\".\",\"/\"],t.BLANK_URL=\"about:blank\"},6750:(e,t,r)=>{\"use strict\";var n=r(9119);function decodeURI(e){try{return decodeURIComponent(e)}catch(t){return e}}},7526:(e,t)=>{\"use strict\";t.byteLength=function byteLength(e){var t=getLens(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function toByteArray(e){var t,r,o=getLens(e),a=o[0],s=o[1],u=new i(function _byteLength(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function fromByteArray(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;s<u;s+=a)o.push(encodeChunk(e,s,s+a>u?u:s+a));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+\"==\")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+\"=\"));return o.join(\"\")};for(var r=[],n=[],i=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function getLens(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=e.indexOf(\"=\");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function encodeChunk(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join(\"\")}n[\"-\".charCodeAt(0)]=62,n[\"_\".charCodeAt(0)]=63},8287:(e,t,r)=>{\"use strict\";const n=r(7526),i=r(251),o=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function createBuffer(e){if(e>a)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if(\"string\"==typeof e)return function fromString(e,t){\"string\"==typeof t&&\"\"!==t||(t=\"utf8\");if(!Buffer.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const r=0|byteLength(e,t);let n=createBuffer(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function fromArrayView(e){if(isInstance(e,Uint8Array)){const t=new Uint8Array(e);return fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength)}return fromArrayLike(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if(\"undefined\"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,r);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);const i=function fromObject(e){if(Buffer.isBuffer(e)){const t=0|checked(e.length),r=createBuffer(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return\"number\"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e);if(\"Buffer\"===e.type&&Array.isArray(e.data))return fromArrayLike(e.data)}(e);if(i)return i;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive](\"string\"),t,r);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function assertSize(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){const t=e.length<0?0:0|checked(e.length),r=createBuffer(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('\"length\" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,Buffer.prototype),n}function checked(e){if(e>=a)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+a.toString(16)+\" bytes\");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":return utf8ToBytes(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return base64ToBytes(e).length;default:if(i)return n?-1:utf8ToBytes(e).length;t=(\"\"+t).toLowerCase(),i=!0}}function slowToString(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return hexSlice(this,t,r);case\"utf8\":case\"utf-8\":return utf8Slice(this,t,r);case\"ascii\":return asciiSlice(this,t,r);case\"latin1\":case\"binary\":return latin1Slice(this,t,r);case\"base64\":return base64Slice(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return utf16leSlice(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function swap(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),numberIsNaN(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function arrayIndexOf(e,t,r,n,i){let o,a=1,s=e.length,u=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function read(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(read(e,o)===read(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(read(e,o+n)!==read(t,n)){r=!1;break}if(r)return o}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(numberIsNaN(n))return a;e[r+a]=n}return a}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(function asciiToBytes(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(function utf16leToBytes(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function decodeCodePointsArray(e){const t=e.length;if(t<=s)return String.fromCharCode.apply(String,e);let r=\"\",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=s));return r}(n)}t.kMaxLength=a,Buffer.TYPED_ARRAY_SUPPORT=function typedArraySupport(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),Buffer.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(Buffer.prototype,\"parent\",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,\"offset\",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(e,t,r){return function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?\"string\"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function isBuffer(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function compare(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function isEncoding(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},Buffer.concat=function concat(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=Buffer.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(isInstance(t,Uint8Array))i+t.length>n.length?(Buffer.isBuffer(t)||(t=Buffer.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!Buffer.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function swap32(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function swap64(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function toString(){const e=this.length;return 0===e?\"\":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function equals(e){if(!Buffer.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function inspect(){let e=\"\";const r=t.INSPECT_MAX_BYTES;return e=this.toString(\"hex\",0,r).replace(/(.{2})/g,\"$1 \").trim(),this.length>r&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(e,t,r,n,i){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<s;++e)if(u[e]!==c[e]){o=u[e],a=c[e];break}return o<a?-1:a<o?1:0},Buffer.prototype.includes=function includes(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function indexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function lastIndexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.prototype.write=function write(e,t,r,n){if(void 0===t)n=\"utf8\",r=this.length,t=0;else if(void 0===r&&\"string\"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n=\"utf8\")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");let o=!1;for(;;)switch(n){case\"hex\":return hexWrite(this,e,t,r);case\"utf8\":case\"utf-8\":return utf8Write(this,e,t,r);case\"ascii\":case\"latin1\":case\"binary\":return asciiWrite(this,e,t,r);case\"base64\":return base64Write(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return ucs2Write(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const s=4096;function asciiSlice(e,t,r){let n=\"\";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function latin1Slice(e,t,r){let n=\"\";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function hexSlice(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i=\"\";for(let n=t;n<r;++n)i+=f[e[n]];return i}function utf16leSlice(e,t,r){const n=e.slice(t,r);let i=\"\";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function checkOffset(e,t,r){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>r)throw new RangeError(\"Trying to access beyond buffer length\")}function checkInt(e,t,r,n,i,o){if(!Buffer.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('\"value\" argument is out of bounds');if(r+n>e.length)throw new RangeError(\"Index out of range\")}function wrtBigUInt64LE(e,t,r,n,i){checkIntBI(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function wrtBigUInt64BE(e,t,r,n,i){checkIntBI(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function checkIEEE754(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function writeFloat(e,t,r,n,o){return t=+t,r>>>=0,o||checkIEEE754(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,o){return t=+t,r>>>=0,o||checkIEEE754(e,0,r,8),i.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function slice(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,Buffer.prototype),n},Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},Buffer.prototype.readUintBE=Buffer.prototype.readUIntBE=function readUIntBE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readBigUInt64LE=defineBigIntMethod((function readBigUInt64LE(e){validateNumber(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||boundsError(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),Buffer.prototype.readBigUInt64BE=defineBigIntMethod((function readBigUInt64BE(e){validateNumber(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||boundsError(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),Buffer.prototype.readIntLE=function readIntLE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function readIntBE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function readInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){e>>>=0,t||checkOffset(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function readInt16BE(e,t){e>>>=0,t||checkOffset(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readBigInt64LE=defineBigIntMethod((function readBigInt64LE(e){validateNumber(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||boundsError(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),Buffer.prototype.readBigInt64BE=defineBigIntMethod((function readBigInt64BE(e){validateNumber(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||boundsError(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),Buffer.prototype.readFloatLE=function readFloatLE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),i.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),i.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),i.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),i.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){checkInt(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},Buffer.prototype.writeUintBE=Buffer.prototype.writeUIntBE=function writeUIntBE(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){checkInt(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigUInt64LE=defineBigIntMethod((function writeBigUInt64LE(e,t=0){return wrtBigUInt64LE(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),Buffer.prototype.writeBigUInt64BE=defineBigIntMethod((function writeBigUInt64BE(e,t=0){return wrtBigUInt64BE(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),Buffer.prototype.writeIntLE=function writeIntLE(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);checkInt(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},Buffer.prototype.writeIntBE=function writeIntBE(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);checkInt(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},Buffer.prototype.writeInt8=function writeInt8(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigInt64LE=defineBigIntMethod((function writeBigInt64LE(e,t=0){return wrtBigUInt64LE(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),Buffer.prototype.writeBigInt64BE=defineBigIntMethod((function writeBigInt64BE(e,t=0){return wrtBigUInt64BE(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function copy(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(r<0||r>=this.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},Buffer.prototype.fill=function fill(e,t,r,n){if(\"string\"==typeof e){if(\"string\"==typeof t?(n=t,t=0,r=this.length):\"string\"==typeof r&&(n=r,r=this.length),void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!Buffer.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===n&&t<128||\"latin1\"===n)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError(\"Out of range index\");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=Buffer.isBuffer(e)?e:Buffer.from(e,n),a=o.length;if(0===a)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const u={};function E(e,t,r){u[e]=class NodeError extends r{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function addNumericalSeparator(e){let t=\"\",r=e.length;const n=\"-\"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function checkIntBI(e,t,r,n,i,o){if(e>r||e<t){const n=\"bigint\"==typeof t?\"n\":\"\";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new u.ERR_OUT_OF_RANGE(\"value\",i,e)}!function checkBounds(e,t,r){validateNumber(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+r]||boundsError(t,e.length-(r+1))}(n,i,o)}function validateNumber(e,t){if(\"number\"!=typeof e)throw new u.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function boundsError(e,t,r){if(Math.floor(e)!==e)throw validateNumber(e,r),new u.ERR_OUT_OF_RANGE(r||\"offset\",\"an integer\",e);if(t<0)throw new u.ERR_BUFFER_OUT_OF_BOUNDS;throw new u.ERR_OUT_OF_RANGE(r||\"offset\",`>= ${r?1:0} and <= ${t}`,e)}E(\"ERR_BUFFER_OUT_OF_BOUNDS\",(function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"}),RangeError),E(\"ERR_INVALID_ARG_TYPE\",(function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`}),TypeError),E(\"ERR_OUT_OF_RANGE\",(function(e,t,r){let n=`The value of \"${e}\" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=addNumericalSeparator(String(r)):\"bigint\"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=addNumericalSeparator(i)),i+=\"n\"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const c=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function base64ToBytes(e){return n.toByteArray(function base64clean(e){if((e=(e=e.split(\"=\")[0]).trim().replace(c,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function blitBuffer(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}const f=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function defineBigIntMethod(e){return\"undefined\"==typeof BigInt?BufferBigIntNotDefined:e}function BufferBigIntNotDefined(){throw new Error(\"BigInt not supported\")}},2205:function(e,t,r){var n;n=void 0!==r.g?r.g:this,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var cssEscape=function(e){if(0==arguments.length)throw new TypeError(\"`CSS.escape` requires an argument.\");for(var t,r=String(e),n=r.length,i=-1,o=\"\",a=r.charCodeAt(0);++i<n;)0!=(t=r.charCodeAt(i))?o+=t>=1&&t<=31||127==t||0==i&&t>=48&&t<=57||1==i&&t>=48&&t<=57&&45==a?\"\\\\\"+t.toString(16)+\" \":0==i&&1==n&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?\"\\\\\"+r.charAt(i):r.charAt(i):o+=\"�\";return o};return e.CSS||(e.CSS={}),e.CSS.escape=cssEscape,cssEscape}(n)},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+p]=255&a,p+=d,a/=256,c-=8);e[r+p-d]|=128*_}},9404:function(e){e.exports=function(){\"use strict\";var e=Array.prototype.slice;function createClass(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function Iterable(e){return isIterable(e)?e:Seq(e)}function KeyedIterable(e){return isKeyed(e)?e:KeyedSeq(e)}function IndexedIterable(e){return isIndexed(e)?e:IndexedSeq(e)}function SetIterable(e){return isIterable(e)&&!isAssociative(e)?e:SetSeq(e)}function isIterable(e){return!(!e||!e[t])}function isKeyed(e){return!(!e||!e[r])}function isIndexed(e){return!(!e||!e[n])}function isAssociative(e){return isKeyed(e)||isIndexed(e)}function isOrdered(e){return!(!e||!e[i])}createClass(KeyedIterable,Iterable),createClass(IndexedIterable,Iterable),createClass(SetIterable,Iterable),Iterable.isIterable=isIterable,Iterable.isKeyed=isKeyed,Iterable.isIndexed=isIndexed,Iterable.isAssociative=isAssociative,Iterable.isOrdered=isOrdered,Iterable.Keyed=KeyedIterable,Iterable.Indexed=IndexedIterable,Iterable.Set=SetIterable;var t=\"@@__IMMUTABLE_ITERABLE__@@\",r=\"@@__IMMUTABLE_KEYED__@@\",n=\"@@__IMMUTABLE_INDEXED__@@\",i=\"@@__IMMUTABLE_ORDERED__@@\",o=\"delete\",a=5,s=1<<a,u=s-1,c={},f={value:!1},l={value:!1};function MakeRef(e){return e.value=!1,e}function SetRef(e){e&&(e.value=!0)}function OwnerID(){}function arrCopy(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),i=0;i<r;i++)n[i]=e[i+t];return n}function ensureSize(e){return void 0===e.size&&(e.size=e.__iterate(returnTrue)),e.size}function wrapIndex(e,t){if(\"number\"!=typeof t){var r=t>>>0;if(\"\"+r!==t||4294967295===r)return NaN;t=r}return t<0?ensureSize(e)+t:t}function returnTrue(){return!0}function wholeSlice(e,t,r){return(0===e||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function resolveBegin(e,t){return resolveIndex(e,t,0)}function resolveEnd(e,t){return resolveIndex(e,t,t)}function resolveIndex(e,t,r){return void 0===e?r:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var h=0,p=1,d=2,_=\"function\"==typeof Symbol&&Symbol.iterator,y=\"@@iterator\",m=_||y;function Iterator(e){this.next=e}function iteratorValue(e,t,r,n){var i=0===e?t:1===e?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(e){return!!getIteratorFn(e)}function isIterator(e){return e&&\"function\"==typeof e.next}function getIterator(e){var t=getIteratorFn(e);return t&&t.call(e)}function getIteratorFn(e){var t=e&&(_&&e[_]||e[y]);if(\"function\"==typeof t)return t}function isArrayLike(e){return e&&\"number\"==typeof e.length}function Seq(e){return null==e?emptySequence():isIterable(e)?e.toSeq():seqFromValue(e)}function KeyedSeq(e){return null==e?emptySequence().toKeyedSeq():isIterable(e)?isKeyed(e)?e.toSeq():e.fromEntrySeq():keyedSeqFromValue(e)}function IndexedSeq(e){return null==e?emptySequence():isIterable(e)?isKeyed(e)?e.entrySeq():e.toIndexedSeq():indexedSeqFromValue(e)}function SetSeq(e){return(null==e?emptySequence():isIterable(e)?isKeyed(e)?e.entrySeq():e:indexedSeqFromValue(e)).toSetSeq()}Iterator.prototype.toString=function(){return\"[Iterator]\"},Iterator.KEYS=h,Iterator.VALUES=p,Iterator.ENTRIES=d,Iterator.prototype.inspect=Iterator.prototype.toSource=function(){return this.toString()},Iterator.prototype[m]=function(){return this},createClass(Seq,Iterable),Seq.of=function(){return Seq(arguments)},Seq.prototype.toSeq=function(){return this},Seq.prototype.toString=function(){return this.__toString(\"Seq {\",\"}\")},Seq.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Seq.prototype.__iterate=function(e,t){return seqIterate(this,e,t,!0)},Seq.prototype.__iterator=function(e,t){return seqIterator(this,e,t,!0)},createClass(KeyedSeq,Seq),KeyedSeq.prototype.toKeyedSeq=function(){return this},createClass(IndexedSeq,Seq),IndexedSeq.of=function(){return IndexedSeq(arguments)},IndexedSeq.prototype.toIndexedSeq=function(){return this},IndexedSeq.prototype.toString=function(){return this.__toString(\"Seq [\",\"]\")},IndexedSeq.prototype.__iterate=function(e,t){return seqIterate(this,e,t,!1)},IndexedSeq.prototype.__iterator=function(e,t){return seqIterator(this,e,t,!1)},createClass(SetSeq,Seq),SetSeq.of=function(){return SetSeq(arguments)},SetSeq.prototype.toSetSeq=function(){return this},Seq.isSeq=isSeq,Seq.Keyed=KeyedSeq,Seq.Set=SetSeq,Seq.Indexed=IndexedSeq;var g,v,b,w=\"@@__IMMUTABLE_SEQ__@@\";function ArraySeq(e){this._array=e,this.size=e.length}function ObjectSeq(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function IterableSeq(e){this._iterable=e,this.size=e.length||e.size}function IteratorSeq(e){this._iterator=e,this._iteratorCache=[]}function isSeq(e){return!(!e||!e[w])}function emptySequence(){return g||(g=new ArraySeq([]))}function keyedSeqFromValue(e){var t=Array.isArray(e)?new ArraySeq(e).fromEntrySeq():isIterator(e)?new IteratorSeq(e).fromEntrySeq():hasIterator(e)?new IterableSeq(e).fromEntrySeq():\"object\"==typeof e?new ObjectSeq(e):void 0;if(!t)throw new TypeError(\"Expected Array or iterable object of [k, v] entries, or keyed object: \"+e);return t}function indexedSeqFromValue(e){var t=maybeIndexedSeqFromValue(e);if(!t)throw new TypeError(\"Expected Array or iterable object of values: \"+e);return t}function seqFromValue(e){var t=maybeIndexedSeqFromValue(e)||\"object\"==typeof e&&new ObjectSeq(e);if(!t)throw new TypeError(\"Expected Array or iterable object of values, or keyed object: \"+e);return t}function maybeIndexedSeqFromValue(e){return isArrayLike(e)?new ArraySeq(e):isIterator(e)?new IteratorSeq(e):hasIterator(e)?new IterableSeq(e):void 0}function seqIterate(e,t,r,n){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[r?o-a:a];if(!1===t(s[1],n?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,r)}function seqIterator(e,t,r,n){var i=e._cache;if(i){var o=i.length-1,a=0;return new Iterator((function(){var e=i[r?o-a:a];return a++>o?iteratorDone():iteratorValue(t,n?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,r)}function fromJS(e,t){return t?fromJSWith(t,e,\"\",{\"\":e}):fromJSDefault(e)}function fromJSWith(e,t,r,n){return Array.isArray(t)?e.call(n,r,IndexedSeq(t).map((function(r,n){return fromJSWith(e,r,n,t)}))):isPlainObj(t)?e.call(n,r,KeyedSeq(t).map((function(r,n){return fromJSWith(e,r,n,t)}))):t}function fromJSDefault(e){return Array.isArray(e)?IndexedSeq(e).map(fromJSDefault).toList():isPlainObj(e)?KeyedSeq(e).map(fromJSDefault).toMap():e}function isPlainObj(e){return e&&(e.constructor===Object||void 0===e.constructor)}function is(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if(\"function\"==typeof e.valueOf&&\"function\"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!(\"function\"!=typeof e.equals||\"function\"!=typeof t.equals||!e.equals(t))}function deepEqual(e,t){if(e===t)return!0;if(!isIterable(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||isKeyed(e)!==isKeyed(t)||isIndexed(e)!==isIndexed(t)||isOrdered(e)!==isOrdered(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!isAssociative(e);if(isOrdered(e)){var n=e.entries();return t.every((function(e,t){var i=n.next().value;return i&&is(i[1],e)&&(r||is(i[0],t))}))&&n.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)\"function\"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var a=!0,s=t.__iterate((function(t,n){if(r?!e.has(t):i?!is(t,e.get(n,c)):!is(e.get(n,c),t))return a=!1,!1}));return a&&e.size===s}function Repeat(e,t){if(!(this instanceof Repeat))return new Repeat(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(v)return v;v=this}}function invariant(e,t){if(!e)throw new Error(t)}function Range(e,t,r){if(!(this instanceof Range))return new Range(e,t,r);if(invariant(0!==r,\"Cannot step a Range by 0\"),e=e||0,void 0===t&&(t=1/0),r=void 0===r?1:Math.abs(r),t<e&&(r=-r),this._start=e,this._end=t,this._step=r,this.size=Math.max(0,Math.ceil((t-e)/r-1)+1),0===this.size){if(b)return b;b=this}}function Collection(){throw TypeError(\"Abstract\")}function KeyedCollection(){}function IndexedCollection(){}function SetCollection(){}Seq.prototype[w]=!0,createClass(ArraySeq,IndexedSeq),ArraySeq.prototype.get=function(e,t){return this.has(e)?this._array[wrapIndex(this,e)]:t},ArraySeq.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length-1,i=0;i<=n;i++)if(!1===e(r[t?n-i:i],i,this))return i+1;return i},ArraySeq.prototype.__iterator=function(e,t){var r=this._array,n=r.length-1,i=0;return new Iterator((function(){return i>n?iteratorDone():iteratorValue(e,i,r[t?n-i++:i++])}))},createClass(ObjectSeq,KeyedSeq),ObjectSeq.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ObjectSeq.prototype.has=function(e){return this._object.hasOwnProperty(e)},ObjectSeq.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,i=n.length-1,o=0;o<=i;o++){var a=n[t?i-o:o];if(!1===e(r[a],a,this))return o+1}return o},ObjectSeq.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,i=n.length-1,o=0;return new Iterator((function(){var a=n[t?i-o:o];return o++>i?iteratorDone():iteratorValue(e,a,r[a])}))},ObjectSeq.prototype[i]=!0,createClass(IterableSeq,IndexedSeq),IterableSeq.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=getIterator(this._iterable),n=0;if(isIterator(r))for(var i;!(i=r.next()).done&&!1!==e(i.value,n++,this););return n},IterableSeq.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=getIterator(this._iterable);if(!isIterator(r))return new Iterator(iteratorDone);var n=0;return new Iterator((function(){var t=r.next();return t.done?t:iteratorValue(e,n++,t.value)}))},createClass(IteratorSeq,IndexedSeq),IteratorSeq.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var r,n=this._iterator,i=this._iteratorCache,o=0;o<i.length;)if(!1===e(i[o],o++,this))return o;for(;!(r=n.next()).done;){var a=r.value;if(i[o]=a,!1===e(a,o++,this))break}return o},IteratorSeq.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=this._iterator,n=this._iteratorCache,i=0;return new Iterator((function(){if(i>=n.length){var t=r.next();if(t.done)return t;n[i]=t.value}return iteratorValue(e,i,n[i++])}))},createClass(Repeat,IndexedSeq),Repeat.prototype.toString=function(){return 0===this.size?\"Repeat []\":\"Repeat [ \"+this._value+\" \"+this.size+\" times ]\"},Repeat.prototype.get=function(e,t){return this.has(e)?this._value:t},Repeat.prototype.includes=function(e){return is(this._value,e)},Repeat.prototype.slice=function(e,t){var r=this.size;return wholeSlice(e,t,r)?this:new Repeat(this._value,resolveEnd(t,r)-resolveBegin(e,r))},Repeat.prototype.reverse=function(){return this},Repeat.prototype.indexOf=function(e){return is(this._value,e)?0:-1},Repeat.prototype.lastIndexOf=function(e){return is(this._value,e)?this.size:-1},Repeat.prototype.__iterate=function(e,t){for(var r=0;r<this.size;r++)if(!1===e(this._value,r,this))return r+1;return r},Repeat.prototype.__iterator=function(e,t){var r=this,n=0;return new Iterator((function(){return n<r.size?iteratorValue(e,n++,r._value):iteratorDone()}))},Repeat.prototype.equals=function(e){return e instanceof Repeat?is(this._value,e._value):deepEqual(e)},createClass(Range,IndexedSeq),Range.prototype.toString=function(){return 0===this.size?\"Range []\":\"Range [ \"+this._start+\"...\"+this._end+(1!==this._step?\" by \"+this._step:\"\")+\" ]\"},Range.prototype.get=function(e,t){return this.has(e)?this._start+wrapIndex(this,e)*this._step:t},Range.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},Range.prototype.slice=function(e,t){return wholeSlice(e,t,this.size)?this:(e=resolveBegin(e,this.size),(t=resolveEnd(t,this.size))<=e?new Range(0,0):new Range(this.get(e,this._end),this.get(t,this._end),this._step))},Range.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var r=t/this._step;if(r>=0&&r<this.size)return r}return-1},Range.prototype.lastIndexOf=function(e){return this.indexOf(e)},Range.prototype.__iterate=function(e,t){for(var r=this.size-1,n=this._step,i=t?this._start+r*n:this._start,o=0;o<=r;o++){if(!1===e(i,o,this))return o+1;i+=t?-n:n}return o},Range.prototype.__iterator=function(e,t){var r=this.size-1,n=this._step,i=t?this._start+r*n:this._start,o=0;return new Iterator((function(){var a=i;return i+=t?-n:n,o>r?iteratorDone():iteratorValue(e,o++,a)}))},Range.prototype.equals=function(e){return e instanceof Range?this._start===e._start&&this._end===e._end&&this._step===e._step:deepEqual(this,e)},createClass(Collection,Iterable),createClass(KeyedCollection,Collection),createClass(IndexedCollection,Collection),createClass(SetCollection,Collection),Collection.Keyed=KeyedCollection,Collection.Indexed=IndexedCollection,Collection.Set=SetCollection;var I=\"function\"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function imul(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function smi(e){return e>>>1&1073741824|3221225471&e}function hash(e){if(!1===e||null==e)return 0;if(\"function\"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if(\"number\"===t){if(e!=e||e===1/0)return 0;var r=0|e;for(r!==e&&(r^=4294967295*e);e>4294967295;)r^=e/=4294967295;return smi(r)}if(\"string\"===t)return e.length>j?cachedHashString(e):hashString(e);if(\"function\"==typeof e.hashCode)return e.hashCode();if(\"object\"===t)return hashJSObj(e);if(\"function\"==typeof e.toString)return hashString(e.toString());throw new Error(\"Value type \"+t+\" cannot be hashed.\")}function cachedHashString(e){var t=D[e];return void 0===t&&(t=hashString(e),P===z&&(P=0,D={}),P++,D[e]=t),t}function hashString(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return smi(t)}function hashJSObj(e){var t;if(C&&void 0!==(t=k.get(e)))return t;if(void 0!==(t=e[L]))return t;if(!B){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[L]))return t;if(void 0!==(t=getIENodeHash(e)))return t}if(t=++q,1073741824&q&&(q=0),C)k.set(e,t);else{if(void 0!==x&&!1===x(e))throw new Error(\"Non-extensible objects are not allowed as keys.\");if(B)Object.defineProperty(e,L,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[L]=t;else{if(void 0===e.nodeType)throw new Error(\"Unable to set a non-enumerable property on object.\");e[L]=t}}return t}var x=Object.isExtensible,B=function(){try{return Object.defineProperty({},\"@\",{}),!0}catch(e){return!1}}();function getIENodeHash(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}var k,C=\"function\"==typeof WeakMap;C&&(k=new WeakMap);var q=0,L=\"__immutablehash__\";\"function\"==typeof Symbol&&(L=Symbol(L));var j=16,z=255,P=0,D={};function assertNotInfinite(e){invariant(e!==1/0,\"Cannot perform this action with an infinite size.\")}function Map(e){return null==e?emptyMap():isMap(e)&&!isOrdered(e)?e:emptyMap().withMutations((function(t){var r=KeyedIterable(e);assertNotInfinite(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}function isMap(e){return!(!e||!e[W])}createClass(Map,KeyedCollection),Map.of=function(){var t=e.call(arguments,0);return emptyMap().withMutations((function(e){for(var r=0;r<t.length;r+=2){if(r+1>=t.length)throw new Error(\"Missing value for key: \"+t[r]);e.set(t[r],t[r+1])}}))},Map.prototype.toString=function(){return this.__toString(\"Map {\",\"}\")},Map.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Map.prototype.set=function(e,t){return updateMap(this,e,t)},Map.prototype.setIn=function(e,t){return this.updateIn(e,c,(function(){return t}))},Map.prototype.remove=function(e){return updateMap(this,e,c)},Map.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return c}))},Map.prototype.update=function(e,t,r){return 1===arguments.length?e(this):this.updateIn([e],t,r)},Map.prototype.updateIn=function(e,t,r){r||(r=t,t=void 0);var n=updateInDeepMap(this,forceIterator(e),t,r);return n===c?void 0:n},Map.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},Map.prototype.merge=function(){return mergeIntoMapWith(this,void 0,arguments)},Map.prototype.mergeWith=function(t){return mergeIntoMapWith(this,t,e.call(arguments,1))},Map.prototype.mergeIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,emptyMap(),(function(e){return\"function\"==typeof e.merge?e.merge.apply(e,r):r[r.length-1]}))},Map.prototype.mergeDeep=function(){return mergeIntoMapWith(this,deepMerger,arguments)},Map.prototype.mergeDeepWith=function(t){var r=e.call(arguments,1);return mergeIntoMapWith(this,deepMergerWith(t),r)},Map.prototype.mergeDeepIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,emptyMap(),(function(e){return\"function\"==typeof e.mergeDeep?e.mergeDeep.apply(e,r):r[r.length-1]}))},Map.prototype.sort=function(e){return OrderedMap(sortFactory(this,e))},Map.prototype.sortBy=function(e,t){return OrderedMap(sortFactory(this,t,e))},Map.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Map.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)},Map.prototype.asImmutable=function(){return this.__ensureOwner()},Map.prototype.wasAltered=function(){return this.__altered},Map.prototype.__iterator=function(e,t){return new MapIterator(this,e,t)},Map.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},Map.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?makeMap(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Map.isMap=isMap;var U,W=\"@@__IMMUTABLE_MAP__@@\",K=Map.prototype;function ArrayMapNode(e,t){this.ownerID=e,this.entries=t}function BitmapIndexedNode(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r}function HashArrayMapNode(e,t,r){this.ownerID=e,this.count=t,this.nodes=r}function HashCollisionNode(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r}function ValueNode(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r}function MapIterator(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&mapIteratorFrame(e._root)}function mapIteratorValue(e,t){return iteratorValue(e,t[0],t[1])}function mapIteratorFrame(e,t){return{node:e,index:0,__prev:t}}function makeMap(e,t,r,n){var i=Object.create(K);return i.size=e,i._root=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function emptyMap(){return U||(U=makeMap(0))}function updateMap(e,t,r){var n,i;if(e._root){var o=MakeRef(f),a=MakeRef(l);if(n=updateNode(e._root,e.__ownerID,0,void 0,t,r,o,a),!a.value)return e;i=e.size+(o.value?r===c?-1:1:0)}else{if(r===c)return e;i=1,n=new ArrayMapNode(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=i,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?makeMap(i,n):emptyMap()}function updateNode(e,t,r,n,i,o,a,s){return e?e.update(t,r,n,i,o,a,s):o===c?e:(SetRef(s),SetRef(a),new ValueNode(t,n,[i,o]))}function isLeafNode(e){return e.constructor===ValueNode||e.constructor===HashCollisionNode}function mergeIntoNode(e,t,r,n,i){if(e.keyHash===n)return new HashCollisionNode(t,n,[e.entry,i]);var o,s=(0===r?e.keyHash:e.keyHash>>>r)&u,c=(0===r?n:n>>>r)&u;return new BitmapIndexedNode(t,1<<s|1<<c,s===c?[mergeIntoNode(e,t,r+a,n,i)]:(o=new ValueNode(t,n,i),s<c?[e,o]:[o,e]))}function createNodes(e,t,r,n){e||(e=new OwnerID);for(var i=new ValueNode(e,hash(r),[r,n]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}function packNodes(e,t,r,n){for(var i=0,o=0,a=new Array(r),s=0,u=1,c=t.length;s<c;s++,u<<=1){var f=t[s];void 0!==f&&s!==n&&(i|=u,a[o++]=f)}return new BitmapIndexedNode(e,i,a)}function expandNodes(e,t,r,n,i){for(var o=0,a=new Array(s),u=0;0!==r;u++,r>>>=1)a[u]=1&r?t[o++]:void 0;return a[n]=i,new HashArrayMapNode(e,o+1,a)}function mergeIntoMapWith(e,t,r){for(var n=[],i=0;i<r.length;i++){var o=r[i],a=KeyedIterable(o);isIterable(o)||(a=a.map((function(e){return fromJS(e)}))),n.push(a)}return mergeIntoCollectionWith(e,t,n)}function deepMerger(e,t,r){return e&&e.mergeDeep&&isIterable(t)?e.mergeDeep(t):is(e,t)?e:t}function deepMergerWith(e){return function(t,r,n){if(t&&t.mergeDeepWith&&isIterable(r))return t.mergeDeepWith(e,r);var i=e(t,r,n);return is(t,i)?t:i}}function mergeIntoCollectionWith(e,t,r){return 0===(r=r.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==r.length?e.withMutations((function(e){for(var n=t?function(r,n){e.update(n,c,(function(e){return e===c?r:t(e,r,n)}))}:function(t,r){e.set(r,t)},i=0;i<r.length;i++)r[i].forEach(n)})):e.constructor(r[0])}function updateInDeepMap(e,t,r,n){var i=e===c,o=t.next();if(o.done){var a=i?r:e,s=n(a);return s===a?e:s}invariant(i||e&&e.set,\"invalid keyPath\");var u=o.value,f=i?c:e.get(u,c),l=updateInDeepMap(f,t,r,n);return l===f?e:l===c?e.remove(u):(i?emptyMap():e).set(u,l)}function popCount(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function setIn(e,t,r,n){var i=n?e:arrCopy(e);return i[t]=r,i}function spliceIn(e,t,r,n){var i=e.length+1;if(n&&t+1===i)return e[t]=r,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=r,a=-1):o[s]=e[s+a];return o}function spliceOut(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),o=0,a=0;a<n;a++)a===t&&(o=1),i[a]=e[a+o];return i}K[W]=!0,K[o]=K.remove,K.removeIn=K.deleteIn,ArrayMapNode.prototype.get=function(e,t,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(is(r,i[o][0]))return i[o][1];return n},ArrayMapNode.prototype.update=function(e,t,r,n,i,o,a){for(var s=i===c,u=this.entries,f=0,l=u.length;f<l&&!is(n,u[f][0]);f++);var h=f<l;if(h?u[f][1]===i:s)return this;if(SetRef(a),(s||!h)&&SetRef(o),!s||1!==u.length){if(!h&&!s&&u.length>=V)return createNodes(e,u,n,i);var p=e&&e===this.ownerID,d=p?u:arrCopy(u);return h?s?f===l-1?d.pop():d[f]=d.pop():d[f]=[n,i]:d.push([n,i]),p?(this.entries=d,this):new ArrayMapNode(e,d)}},BitmapIndexedNode.prototype.get=function(e,t,r,n){void 0===t&&(t=hash(r));var i=1<<((0===e?t:t>>>e)&u),o=this.bitmap;return o&i?this.nodes[popCount(o&i-1)].get(e+a,t,r,n):n},BitmapIndexedNode.prototype.update=function(e,t,r,n,i,o,s){void 0===r&&(r=hash(n));var f=(0===t?r:r>>>t)&u,l=1<<f,h=this.bitmap,p=!!(h&l);if(!p&&i===c)return this;var d=popCount(h&l-1),_=this.nodes,y=p?_[d]:void 0,m=updateNode(y,e,t+a,r,n,i,o,s);if(m===y)return this;if(!p&&m&&_.length>=$)return expandNodes(e,_,h,f,m);if(p&&!m&&2===_.length&&isLeafNode(_[1^d]))return _[1^d];if(p&&m&&1===_.length&&isLeafNode(m))return m;var g=e&&e===this.ownerID,v=p?m?h:h^l:h|l,b=p?m?setIn(_,d,m,g):spliceOut(_,d,g):spliceIn(_,d,m,g);return g?(this.bitmap=v,this.nodes=b,this):new BitmapIndexedNode(e,v,b)},HashArrayMapNode.prototype.get=function(e,t,r,n){void 0===t&&(t=hash(r));var i=(0===e?t:t>>>e)&u,o=this.nodes[i];return o?o.get(e+a,t,r,n):n},HashArrayMapNode.prototype.update=function(e,t,r,n,i,o,s){void 0===r&&(r=hash(n));var f=(0===t?r:r>>>t)&u,l=i===c,h=this.nodes,p=h[f];if(l&&!p)return this;var d=updateNode(p,e,t+a,r,n,i,o,s);if(d===p)return this;var _=this.count;if(p){if(!d&&--_<H)return packNodes(e,h,_,f)}else _++;var y=e&&e===this.ownerID,m=setIn(h,f,d,y);return y?(this.count=_,this.nodes=m,this):new HashArrayMapNode(e,_,m)},HashCollisionNode.prototype.get=function(e,t,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(is(r,i[o][0]))return i[o][1];return n},HashCollisionNode.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=hash(n));var s=i===c;if(r!==this.keyHash)return s?this:(SetRef(a),SetRef(o),mergeIntoNode(this,e,t,r,[n,i]));for(var u=this.entries,f=0,l=u.length;f<l&&!is(n,u[f][0]);f++);var h=f<l;if(h?u[f][1]===i:s)return this;if(SetRef(a),(s||!h)&&SetRef(o),s&&2===l)return new ValueNode(e,this.keyHash,u[1^f]);var p=e&&e===this.ownerID,d=p?u:arrCopy(u);return h?s?f===l-1?d.pop():d[f]=d.pop():d[f]=[n,i]:d.push([n,i]),p?(this.entries=d,this):new HashCollisionNode(e,this.keyHash,d)},ValueNode.prototype.get=function(e,t,r,n){return is(r,this.entry[0])?this.entry[1]:n},ValueNode.prototype.update=function(e,t,r,n,i,o,a){var s=i===c,u=is(n,this.entry[0]);return(u?i===this.entry[1]:s)?this:(SetRef(a),s?void SetRef(o):u?e&&e===this.ownerID?(this.entry[1]=i,this):new ValueNode(e,this.keyHash,[n,i]):(SetRef(o),mergeIntoNode(this,e,t,hash(n),[n,i])))},ArrayMapNode.prototype.iterate=HashCollisionNode.prototype.iterate=function(e,t){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===e(r[t?i-n:n]))return!1},BitmapIndexedNode.prototype.iterate=HashArrayMapNode.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[t?i-n:n];if(o&&!1===o.iterate(e,t))return!1}},ValueNode.prototype.iterate=function(e,t){return e(this.entry)},createClass(MapIterator,Iterator),MapIterator.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var r,n=t.node,i=t.index++;if(n.entry){if(0===i)return mapIteratorValue(e,n.entry)}else if(n.entries){if(i<=(r=n.entries.length-1))return mapIteratorValue(e,n.entries[this._reverse?r-i:i])}else if(i<=(r=n.nodes.length-1)){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return mapIteratorValue(e,o.entry);t=this._stack=mapIteratorFrame(o,t)}continue}t=this._stack=this._stack.__prev}return iteratorDone()};var V=s/4,$=s/2,H=s/4;function List(e){var t=emptyList();if(null==e)return t;if(isList(e))return e;var r=IndexedIterable(e),n=r.size;return 0===n?t:(assertNotInfinite(n),n>0&&n<s?makeList(0,n,a,null,new VNode(r.toArray())):t.withMutations((function(e){e.setSize(n),r.forEach((function(t,r){return e.set(r,t)}))})))}function isList(e){return!(!e||!e[Y])}createClass(List,IndexedCollection),List.of=function(){return this(arguments)},List.prototype.toString=function(){return this.__toString(\"List [\",\"]\")},List.prototype.get=function(e,t){if((e=wrapIndex(this,e))>=0&&e<this.size){var r=listNodeFor(this,e+=this._origin);return r&&r.array[e&u]}return t},List.prototype.set=function(e,t){return updateList(this,e,t)},List.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},List.prototype.insert=function(e,t){return this.splice(e,0,t)},List.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=a,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):emptyList()},List.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){setListBounds(r,0,t+e.length);for(var n=0;n<e.length;n++)r.set(t+n,e[n])}))},List.prototype.pop=function(){return setListBounds(this,0,-1)},List.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){setListBounds(t,-e.length);for(var r=0;r<e.length;r++)t.set(r,e[r])}))},List.prototype.shift=function(){return setListBounds(this,1)},List.prototype.merge=function(){return mergeIntoListWith(this,void 0,arguments)},List.prototype.mergeWith=function(t){return mergeIntoListWith(this,t,e.call(arguments,1))},List.prototype.mergeDeep=function(){return mergeIntoListWith(this,deepMerger,arguments)},List.prototype.mergeDeepWith=function(t){var r=e.call(arguments,1);return mergeIntoListWith(this,deepMergerWith(t),r)},List.prototype.setSize=function(e){return setListBounds(this,0,e)},List.prototype.slice=function(e,t){var r=this.size;return wholeSlice(e,t,r)?this:setListBounds(this,resolveBegin(e,r),resolveEnd(t,r))},List.prototype.__iterator=function(e,t){var r=0,n=iterateList(this,t);return new Iterator((function(){var t=n();return t===te?iteratorDone():iteratorValue(e,r++,t)}))},List.prototype.__iterate=function(e,t){for(var r,n=0,i=iterateList(this,t);(r=i())!==te&&!1!==e(r,n++,this););return n},List.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?makeList(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},List.isList=isList;var Y=\"@@__IMMUTABLE_LIST__@@\",Z=List.prototype;function VNode(e,t){this.array=e,this.ownerID=t}Z[Y]=!0,Z[o]=Z.remove,Z.setIn=K.setIn,Z.deleteIn=Z.removeIn=K.removeIn,Z.update=K.update,Z.updateIn=K.updateIn,Z.mergeIn=K.mergeIn,Z.mergeDeepIn=K.mergeDeepIn,Z.withMutations=K.withMutations,Z.asMutable=K.asMutable,Z.asImmutable=K.asImmutable,Z.wasAltered=K.wasAltered,VNode.prototype.removeBefore=function(e,t,r){if(r===t?1<<t:0===this.array.length)return this;var n=r>>>t&u;if(n>=this.array.length)return new VNode([],e);var i,o=0===n;if(t>0){var s=this.array[n];if((i=s&&s.removeBefore(e,t-a,r))===s&&o)return this}if(o&&!i)return this;var c=editableVNode(this,e);if(!o)for(var f=0;f<n;f++)c.array[f]=void 0;return i&&(c.array[n]=i),c},VNode.prototype.removeAfter=function(e,t,r){if(r===(t?1<<t:0)||0===this.array.length)return this;var n,i=r-1>>>t&u;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((n=o&&o.removeAfter(e,t-a,r))===o&&i===this.array.length-1)return this}var s=editableVNode(this,e);return s.array.splice(i+1),n&&(s.array[i]=n),s};var J,ee,te={};function iterateList(e,t){var r=e._origin,n=e._capacity,i=getTailOffset(n),o=e._tail;return iterateNodeOrLeaf(e._root,e._level,0);function iterateNodeOrLeaf(e,t,r){return 0===t?iterateLeaf(e,r):iterateNode(e,t,r)}function iterateLeaf(e,a){var u=a===i?o&&o.array:e&&e.array,c=a>r?0:r-a,f=n-a;return f>s&&(f=s),function(){if(c===f)return te;var e=t?--f:c++;return u&&u[e]}}function iterateNode(e,i,o){var u,c=e&&e.array,f=o>r?0:r-o>>i,l=1+(n-o>>i);return l>s&&(l=s),function(){for(;;){if(u){var e=u();if(e!==te)return e;u=null}if(f===l)return te;var r=t?--l:f++;u=iterateNodeOrLeaf(c&&c[r],i-a,o+(r<<i))}}}}function makeList(e,t,r,n,i,o,a){var s=Object.create(Z);return s.size=t-e,s._origin=e,s._capacity=t,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function emptyList(){return J||(J=makeList(0,0,a))}function updateList(e,t,r){if((t=wrapIndex(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?setListBounds(e,t).set(0,r):setListBounds(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,i=e._root,o=MakeRef(l);return t>=getTailOffset(e._capacity)?n=updateVNode(n,e.__ownerID,0,t,r,o):i=updateVNode(i,e.__ownerID,e._level,t,r,o),o.value?e.__ownerID?(e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e):makeList(e._origin,e._capacity,e._level,i,n):e}function updateVNode(e,t,r,n,i,o){var s,c=n>>>r&u,f=e&&c<e.array.length;if(!f&&void 0===i)return e;if(r>0){var l=e&&e.array[c],h=updateVNode(l,t,r-a,n,i,o);return h===l?e:((s=editableVNode(e,t)).array[c]=h,s)}return f&&e.array[c]===i?e:(SetRef(o),s=editableVNode(e,t),void 0===i&&c===s.array.length-1?s.array.pop():s.array[c]=i,s)}function editableVNode(e,t){return t&&e&&t===e.ownerID?e:new VNode(e?e.array.slice():[],t)}function listNodeFor(e,t){if(t>=getTailOffset(e._capacity))return e._tail;if(t<1<<e._level+a){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&u],n-=a;return r}}function setListBounds(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new OwnerID,i=e._origin,o=e._capacity,s=i+t,c=void 0===r?o:r<0?o+r:i+r;if(s===i&&c===o)return e;if(s>=c)return e.clear();for(var f=e._level,l=e._root,h=0;s+h<0;)l=new VNode(l&&l.array.length?[void 0,l]:[],n),h+=1<<(f+=a);h&&(s+=h,i+=h,c+=h,o+=h);for(var p=getTailOffset(o),d=getTailOffset(c);d>=1<<f+a;)l=new VNode(l&&l.array.length?[l]:[],n),f+=a;var _=e._tail,y=d<p?listNodeFor(e,c-1):d>p?new VNode([],n):_;if(_&&d>p&&s<o&&_.array.length){for(var m=l=editableVNode(l,n),g=f;g>a;g-=a){var v=p>>>g&u;m=m.array[v]=editableVNode(m.array[v],n)}m.array[p>>>a&u]=_}if(c<o&&(y=y&&y.removeAfter(n,0,c)),s>=d)s-=d,c-=d,f=a,l=null,y=y&&y.removeBefore(n,0,s);else if(s>i||d<p){for(h=0;l;){var b=s>>>f&u;if(b!==d>>>f&u)break;b&&(h+=(1<<f)*b),f-=a,l=l.array[b]}l&&s>i&&(l=l.removeBefore(n,f,s-h)),l&&d<p&&(l=l.removeAfter(n,f,d-h)),h&&(s-=h,c-=h)}return e.__ownerID?(e.size=c-s,e._origin=s,e._capacity=c,e._level=f,e._root=l,e._tail=y,e.__hash=void 0,e.__altered=!0,e):makeList(s,c,f,l,y)}function mergeIntoListWith(e,t,r){for(var n=[],i=0,o=0;o<r.length;o++){var a=r[o],s=IndexedIterable(a);s.size>i&&(i=s.size),isIterable(a)||(s=s.map((function(e){return fromJS(e)}))),n.push(s)}return i>e.size&&(e=e.setSize(i)),mergeIntoCollectionWith(e,t,n)}function getTailOffset(e){return e<s?0:e-1>>>a<<a}function OrderedMap(e){return null==e?emptyOrderedMap():isOrderedMap(e)?e:emptyOrderedMap().withMutations((function(t){var r=KeyedIterable(e);assertNotInfinite(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}function isOrderedMap(e){return isMap(e)&&isOrdered(e)}function makeOrderedMap(e,t,r,n){var i=Object.create(OrderedMap.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=r,i.__hash=n,i}function emptyOrderedMap(){return ee||(ee=makeOrderedMap(emptyMap(),emptyList()))}function updateOrderedMap(e,t,r){var n,i,o=e._map,a=e._list,u=o.get(t),f=void 0!==u;if(r===c){if(!f)return e;a.size>=s&&a.size>=2*o.size?(n=(i=a.filter((function(e,t){return void 0!==e&&u!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=i.__ownerID=e.__ownerID)):(n=o.remove(t),i=u===a.size-1?a.pop():a.set(u,void 0))}else if(f){if(r===a.get(u)[1])return e;n=o,i=a.set(u,[t,r])}else n=o.set(t,a.size),i=a.set(a.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=i,e.__hash=void 0,e):makeOrderedMap(n,i)}function ToKeyedSequence(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function ToIndexedSequence(e){this._iter=e,this.size=e.size}function ToSetSequence(e){this._iter=e,this.size=e.size}function FromEntriesSequence(e){this._iter=e,this.size=e.size}function flipFactory(e){var t=makeSequence(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=cacheResultThrough,t.__iterateUncached=function(t,r){var n=this;return e.__iterate((function(e,r){return!1!==t(r,e,n)}),r)},t.__iteratorUncached=function(t,r){if(t===d){var n=e.__iterator(t,r);return new Iterator((function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(t===p?h:p,r)},t}function mapFactory(e,t,r){var n=makeSequence(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,i){var o=e.get(n,c);return o===c?i:t.call(r,o,n,e)},n.__iterateUncached=function(n,i){var o=this;return e.__iterate((function(e,i,a){return!1!==n(t.call(r,e,i,a),i,o)}),i)},n.__iteratorUncached=function(n,i){var o=e.__iterator(d,i);return new Iterator((function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return iteratorValue(n,s,t.call(r,a[1],s,e),i)}))},n}function reverseFactory(e,t){var r=makeSequence(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var t=flipFactory(e);return t.reverse=function(){return e.flip()},t}),r.get=function(r,n){return e.get(t?r:-1-r,n)},r.has=function(r){return e.has(t?r:-1-r)},r.includes=function(t){return e.includes(t)},r.cacheResult=cacheResultThrough,r.__iterate=function(t,r){var n=this;return e.__iterate((function(e,r){return t(e,r,n)}),!r)},r.__iterator=function(t,r){return e.__iterator(t,!r)},r}function filterFactory(e,t,r,n){var i=makeSequence(e);return n&&(i.has=function(n){var i=e.get(n,c);return i!==c&&!!t.call(r,i,n,e)},i.get=function(n,i){var o=e.get(n,c);return o!==c&&t.call(r,o,n,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate((function(e,o,u){if(t.call(r,e,o,u))return s++,i(e,n?o:s-1,a)}),o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(d,o),s=0;return new Iterator((function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,c=u[0],f=u[1];if(t.call(r,f,c,e))return iteratorValue(i,n?c:s++,f,o)}}))},i}function countByFactory(e,t,r){var n=Map().asMutable();return e.__iterate((function(i,o){n.update(t.call(r,i,o,e),0,(function(e){return e+1}))})),n.asImmutable()}function groupByFactory(e,t,r){var n=isKeyed(e),i=(isOrdered(e)?OrderedMap():Map()).asMutable();e.__iterate((function(o,a){i.update(t.call(r,o,a,e),(function(e){return(e=e||[]).push(n?[a,o]:o),e}))}));var o=iterableClass(e);return i.map((function(t){return reify(e,o(t))}))}function sliceFactory(e,t,r,n){var i=e.size;if(void 0!==t&&(t|=0),void 0!==r&&(r===1/0?r=i:r|=0),wholeSlice(t,r,i))return e;var o=resolveBegin(t,i),a=resolveEnd(r,i);if(o!=o||a!=a)return sliceFactory(e.toSeq().cacheResult(),t,r,n);var s,u=a-o;u==u&&(s=u<0?0:u);var c=makeSequence(e);return c.size=0===s?s:e.size&&s||void 0,!n&&isSeq(e)&&s>=0&&(c.get=function(t,r){return(t=wrapIndex(this,t))>=0&&t<s?e.get(t+o,r):r}),c.__iterateUncached=function(t,r){var i=this;if(0===s)return 0;if(r)return this.cacheResult().__iterate(t,r);var a=0,u=!0,c=0;return e.__iterate((function(e,r){if(!u||!(u=a++<o))return c++,!1!==t(e,n?r:c-1,i)&&c!==s})),c},c.__iteratorUncached=function(t,r){if(0!==s&&r)return this.cacheResult().__iterator(t,r);var i=0!==s&&e.__iterator(t,r),a=0,u=0;return new Iterator((function(){for(;a++<o;)i.next();if(++u>s)return iteratorDone();var e=i.next();return n||t===p?e:iteratorValue(t,u-1,t===h?void 0:e.value[1],e)}))},c}function takeWhileFactory(e,t,r){var n=makeSequence(e);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var a=0;return e.__iterate((function(e,i,s){return t.call(r,e,i,s)&&++a&&n(e,i,o)})),a},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var a=e.__iterator(d,i),s=!0;return new Iterator((function(){if(!s)return iteratorDone();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],c=i[1];return t.call(r,c,u,o)?n===d?e:iteratorValue(n,u,c,e):(s=!1,iteratorDone())}))},n}function skipWhileFactory(e,t,r,n){var i=makeSequence(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate((function(e,o,c){if(!s||!(s=t.call(r,e,o,c)))return u++,i(e,n?o:u-1,a)})),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(d,o),u=!0,c=0;return new Iterator((function(){var e,o,f;do{if((e=s.next()).done)return n||i===p?e:iteratorValue(i,c++,i===h?void 0:e.value[1],e);var l=e.value;o=l[0],f=l[1],u&&(u=t.call(r,f,o,a))}while(u);return i===d?e:iteratorValue(i,o,f,e)}))},i}function concatFactory(e,t){var r=isKeyed(e),n=[e].concat(t).map((function(e){return isIterable(e)?r&&(e=KeyedIterable(e)):e=r?keyedSeqFromValue(e):indexedSeqFromValue(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===n.length)return e;if(1===n.length){var i=n[0];if(i===e||r&&isKeyed(i)||isIndexed(e)&&isIndexed(i))return i}var o=new ArraySeq(n);return r?o=o.toKeyedSeq():isIndexed(e)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=n.reduce((function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}}),0),o}function flattenFactory(e,t,r){var n=makeSequence(e);return n.__iterateUncached=function(n,i){var o=0,a=!1;function flatDeep(e,s){var u=this;e.__iterate((function(e,i){return(!t||s<t)&&isIterable(e)?flatDeep(e,s+1):!1===n(e,r?i:o++,u)&&(a=!0),!a}),i)}return flatDeep(e,0),o},n.__iteratorUncached=function(n,i){var o=e.__iterator(n,i),a=[],s=0;return new Iterator((function(){for(;o;){var e=o.next();if(!1===e.done){var u=e.value;if(n===d&&(u=u[1]),t&&!(a.length<t)||!isIterable(u))return r?e:iteratorValue(n,s++,u,e);a.push(o),o=u.__iterator(n,i)}else o=a.pop()}return iteratorDone()}))},n}function flatMapFactory(e,t,r){var n=iterableClass(e);return e.toSeq().map((function(i,o){return n(t.call(r,i,o,e))})).flatten(!0)}function interposeFactory(e,t){var r=makeSequence(e);return r.size=e.size&&2*e.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return e.__iterate((function(e,n){return(!o||!1!==r(t,o++,i))&&!1!==r(e,o++,i)}),n),o},r.__iteratorUncached=function(r,n){var i,o=e.__iterator(p,n),a=0;return new Iterator((function(){return(!i||a%2)&&(i=o.next()).done?i:a%2?iteratorValue(r,a++,t):iteratorValue(r,a++,i.value,i)}))},r}function sortFactory(e,t,r){t||(t=defaultComparator);var n=isKeyed(e),i=0,o=e.toSeq().map((function(t,n){return[n,t,i++,r?r(t,n,e):t]})).toArray();return o.sort((function(e,r){return t(e[3],r[3])||e[2]-r[2]})).forEach(n?function(e,t){o[t].length=2}:function(e,t){o[t]=e[1]}),n?KeyedSeq(o):isIndexed(e)?IndexedSeq(o):SetSeq(o)}function maxFactory(e,t,r){if(t||(t=defaultComparator),r){var n=e.toSeq().map((function(t,n){return[t,r(t,n,e)]})).reduce((function(e,r){return maxCompare(t,e[1],r[1])?r:e}));return n&&n[0]}return e.reduce((function(e,r){return maxCompare(t,e,r)?r:e}))}function maxCompare(e,t,r){var n=e(r,t);return 0===n&&r!==t&&(null==r||r!=r)||n>0}function zipWithFactory(e,t,r){var n=makeSequence(e);return n.size=new ArraySeq(r).map((function(e){return e.size})).min(),n.__iterate=function(e,t){for(var r,n=this.__iterator(p,t),i=0;!(r=n.next()).done&&!1!==e(r.value,i++,this););return i},n.__iteratorUncached=function(e,n){var i=r.map((function(e){return e=Iterable(e),getIterator(n?e.reverse():e)})),o=0,a=!1;return new Iterator((function(){var r;return a||(r=i.map((function(e){return e.next()})),a=r.some((function(e){return e.done}))),a?iteratorDone():iteratorValue(e,o++,t.apply(null,r.map((function(e){return e.value}))))}))},n}function reify(e,t){return isSeq(e)?t:e.constructor(t)}function validateEntry(e){if(e!==Object(e))throw new TypeError(\"Expected [K, V] tuple: \"+e)}function resolveSize(e){return assertNotInfinite(e.size),ensureSize(e)}function iterableClass(e){return isKeyed(e)?KeyedIterable:isIndexed(e)?IndexedIterable:SetIterable}function makeSequence(e){return Object.create((isKeyed(e)?KeyedSeq:isIndexed(e)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Seq.prototype.cacheResult.call(this)}function defaultComparator(e,t){return e>t?1:e<t?-1:0}function forceIterator(e){var t=getIterator(e);if(!t){if(!isArrayLike(e))throw new TypeError(\"Expected iterable or array-like: \"+e);t=getIterator(Iterable(e))}return t}function Record(e,t){var r,n=function Record(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var a=Object.keys(e);setProps(i,a),i.size=a.length,i._name=t,i._keys=a,i._defaultValues=e}this._map=Map(o)},i=n.prototype=Object.create(re);return i.constructor=n,n}createClass(OrderedMap,Map),OrderedMap.of=function(){return this(arguments)},OrderedMap.prototype.toString=function(){return this.__toString(\"OrderedMap {\",\"}\")},OrderedMap.prototype.get=function(e,t){var r=this._map.get(e);return void 0!==r?this._list.get(r)[1]:t},OrderedMap.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):emptyOrderedMap()},OrderedMap.prototype.set=function(e,t){return updateOrderedMap(this,e,t)},OrderedMap.prototype.remove=function(e){return updateOrderedMap(this,e,c)},OrderedMap.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},OrderedMap.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],r)}),t)},OrderedMap.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},OrderedMap.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),r=this._list.__ensureOwner(e);return e?makeOrderedMap(t,r,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=r,this)},OrderedMap.isOrderedMap=isOrderedMap,OrderedMap.prototype[i]=!0,OrderedMap.prototype[o]=OrderedMap.prototype.remove,createClass(ToKeyedSequence,KeyedSeq),ToKeyedSequence.prototype.get=function(e,t){return this._iter.get(e,t)},ToKeyedSequence.prototype.has=function(e){return this._iter.has(e)},ToKeyedSequence.prototype.valueSeq=function(){return this._iter.valueSeq()},ToKeyedSequence.prototype.reverse=function(){var e=this,t=reverseFactory(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},ToKeyedSequence.prototype.map=function(e,t){var r=this,n=mapFactory(this,e,t);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(e,t)}),n},ToKeyedSequence.prototype.__iterate=function(e,t){var r,n=this;return this._iter.__iterate(this._useKeys?function(t,r){return e(t,r,n)}:(r=t?resolveSize(this):0,function(i){return e(i,t?--r:r++,n)}),t)},ToKeyedSequence.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var r=this._iter.__iterator(p,t),n=t?resolveSize(this):0;return new Iterator((function(){var i=r.next();return i.done?i:iteratorValue(e,t?--n:n++,i.value,i)}))},ToKeyedSequence.prototype[i]=!0,createClass(ToIndexedSequence,IndexedSeq),ToIndexedSequence.prototype.includes=function(e){return this._iter.includes(e)},ToIndexedSequence.prototype.__iterate=function(e,t){var r=this,n=0;return this._iter.__iterate((function(t){return e(t,n++,r)}),t)},ToIndexedSequence.prototype.__iterator=function(e,t){var r=this._iter.__iterator(p,t),n=0;return new Iterator((function(){var t=r.next();return t.done?t:iteratorValue(e,n++,t.value,t)}))},createClass(ToSetSequence,SetSeq),ToSetSequence.prototype.has=function(e){return this._iter.includes(e)},ToSetSequence.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){return e(t,t,r)}),t)},ToSetSequence.prototype.__iterator=function(e,t){var r=this._iter.__iterator(p,t);return new Iterator((function(){var t=r.next();return t.done?t:iteratorValue(e,t.value,t.value,t)}))},createClass(FromEntriesSequence,KeyedSeq),FromEntriesSequence.prototype.entrySeq=function(){return this._iter.toSeq()},FromEntriesSequence.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){if(t){validateEntry(t);var n=isIterable(t);return e(n?t.get(1):t[1],n?t.get(0):t[0],r)}}),t)},FromEntriesSequence.prototype.__iterator=function(e,t){var r=this._iter.__iterator(p,t);return new Iterator((function(){for(;;){var t=r.next();if(t.done)return t;var n=t.value;if(n){validateEntry(n);var i=isIterable(n);return iteratorValue(e,i?n.get(0):n[0],i?n.get(1):n[1],t)}}}))},ToIndexedSequence.prototype.cacheResult=ToKeyedSequence.prototype.cacheResult=ToSetSequence.prototype.cacheResult=FromEntriesSequence.prototype.cacheResult=cacheResultThrough,createClass(Record,KeyedCollection),Record.prototype.toString=function(){return this.__toString(recordName(this)+\" {\",\"}\")},Record.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Record.prototype.get=function(e,t){if(!this.has(e))return t;var r=this._defaultValues[e];return this._map?this._map.get(e,r):r},Record.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=makeRecord(this,emptyMap()))},Record.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key \"'+e+'\" on '+recordName(this));if(this._map&&!this._map.has(e)&&t===this._defaultValues[e])return this;var r=this._map&&this._map.set(e,t);return this.__ownerID||r===this._map?this:makeRecord(this,r)},Record.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:makeRecord(this,t)},Record.prototype.wasAltered=function(){return this._map.wasAltered()},Record.prototype.__iterator=function(e,t){var r=this;return KeyedIterable(this._defaultValues).map((function(e,t){return r.get(t)})).__iterator(e,t)},Record.prototype.__iterate=function(e,t){var r=this;return KeyedIterable(this._defaultValues).map((function(e,t){return r.get(t)})).__iterate(e,t)},Record.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?makeRecord(this,t,e):(this.__ownerID=e,this._map=t,this)};var re=Record.prototype;function makeRecord(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._map=t,n.__ownerID=r,n}function recordName(e){return e._name||e.constructor.name||\"Record\"}function setProps(e,t){try{t.forEach(setProp.bind(void 0,e))}catch(e){}}function setProp(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){invariant(this.__ownerID,\"Cannot set on an immutable record.\"),this.set(t,e)}})}function Set(e){return null==e?emptySet():isSet(e)&&!isOrdered(e)?e:emptySet().withMutations((function(t){var r=SetIterable(e);assertNotInfinite(r.size),r.forEach((function(e){return t.add(e)}))}))}function isSet(e){return!(!e||!e[ie])}re[o]=re.remove,re.deleteIn=re.removeIn=K.removeIn,re.merge=K.merge,re.mergeWith=K.mergeWith,re.mergeIn=K.mergeIn,re.mergeDeep=K.mergeDeep,re.mergeDeepWith=K.mergeDeepWith,re.mergeDeepIn=K.mergeDeepIn,re.setIn=K.setIn,re.update=K.update,re.updateIn=K.updateIn,re.withMutations=K.withMutations,re.asMutable=K.asMutable,re.asImmutable=K.asImmutable,createClass(Set,SetCollection),Set.of=function(){return this(arguments)},Set.fromKeys=function(e){return this(KeyedIterable(e).keySeq())},Set.prototype.toString=function(){return this.__toString(\"Set {\",\"}\")},Set.prototype.has=function(e){return this._map.has(e)},Set.prototype.add=function(e){return updateSet(this,this._map.set(e,!0))},Set.prototype.remove=function(e){return updateSet(this,this._map.remove(e))},Set.prototype.clear=function(){return updateSet(this,this._map.clear())},Set.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(e){for(var r=0;r<t.length;r++)SetIterable(t[r]).forEach((function(t){return e.add(t)}))})):this.constructor(t[0])},Set.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return SetIterable(e)}));var r=this;return this.withMutations((function(e){r.forEach((function(r){t.every((function(e){return e.includes(r)}))||e.remove(r)}))}))},Set.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return SetIterable(e)}));var r=this;return this.withMutations((function(e){r.forEach((function(r){t.some((function(e){return e.includes(r)}))&&e.remove(r)}))}))},Set.prototype.merge=function(){return this.union.apply(this,arguments)},Set.prototype.mergeWith=function(t){var r=e.call(arguments,1);return this.union.apply(this,r)},Set.prototype.sort=function(e){return OrderedSet(sortFactory(this,e))},Set.prototype.sortBy=function(e,t){return OrderedSet(sortFactory(this,t,e))},Set.prototype.wasAltered=function(){return this._map.wasAltered()},Set.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate((function(t,n){return e(n,n,r)}),t)},Set.prototype.__iterator=function(e,t){return this._map.map((function(e,t){return t})).__iterator(e,t)},Set.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},Set.isSet=isSet;var ne,ie=\"@@__IMMUTABLE_SET__@@\",oe=Set.prototype;function updateSet(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function makeSet(e,t){var r=Object.create(oe);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function emptySet(){return ne||(ne=makeSet(emptyMap()))}function OrderedSet(e){return null==e?emptyOrderedSet():isOrderedSet(e)?e:emptyOrderedSet().withMutations((function(t){var r=SetIterable(e);assertNotInfinite(r.size),r.forEach((function(e){return t.add(e)}))}))}function isOrderedSet(e){return isSet(e)&&isOrdered(e)}oe[ie]=!0,oe[o]=oe.remove,oe.mergeDeep=oe.merge,oe.mergeDeepWith=oe.mergeWith,oe.withMutations=K.withMutations,oe.asMutable=K.asMutable,oe.asImmutable=K.asImmutable,oe.__empty=emptySet,oe.__make=makeSet,createClass(OrderedSet,Set),OrderedSet.of=function(){return this(arguments)},OrderedSet.fromKeys=function(e){return this(KeyedIterable(e).keySeq())},OrderedSet.prototype.toString=function(){return this.__toString(\"OrderedSet {\",\"}\")},OrderedSet.isOrderedSet=isOrderedSet;var ae,se=OrderedSet.prototype;function makeOrderedSet(e,t){var r=Object.create(se);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function emptyOrderedSet(){return ae||(ae=makeOrderedSet(emptyOrderedMap()))}function Stack(e){return null==e?emptyStack():isStack(e)?e:emptyStack().unshiftAll(e)}function isStack(e){return!(!e||!e[ce])}se[i]=!0,se.__empty=emptyOrderedSet,se.__make=makeOrderedSet,createClass(Stack,IndexedCollection),Stack.of=function(){return this(arguments)},Stack.prototype.toString=function(){return this.__toString(\"Stack [\",\"]\")},Stack.prototype.get=function(e,t){var r=this._head;for(e=wrapIndex(this,e);r&&e--;)r=r.next;return r?r.value:t},Stack.prototype.peek=function(){return this._head&&this._head.value},Stack.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,r=arguments.length-1;r>=0;r--)t={value:arguments[r],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):makeStack(e,t)},Stack.prototype.pushAll=function(e){if(0===(e=IndexedIterable(e)).size)return this;assertNotInfinite(e.size);var t=this.size,r=this._head;return e.reverse().forEach((function(e){t++,r={value:e,next:r}})),this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):makeStack(t,r)},Stack.prototype.pop=function(){return this.slice(1)},Stack.prototype.unshift=function(){return this.push.apply(this,arguments)},Stack.prototype.unshiftAll=function(e){return this.pushAll(e)},Stack.prototype.shift=function(){return this.pop.apply(this,arguments)},Stack.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},Stack.prototype.slice=function(e,t){if(wholeSlice(e,t,this.size))return this;var r=resolveBegin(e,this.size);if(resolveEnd(t,this.size)!==this.size)return IndexedCollection.prototype.slice.call(this,e,t);for(var n=this.size-r,i=this._head;r--;)i=i.next;return this.__ownerID?(this.size=n,this._head=i,this.__hash=void 0,this.__altered=!0,this):makeStack(n,i)},Stack.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?makeStack(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Stack.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var r=0,n=this._head;n&&!1!==e(n.value,r++,this);)n=n.next;return r},Stack.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var r=0,n=this._head;return new Iterator((function(){if(n){var t=n.value;return n=n.next,iteratorValue(e,r++,t)}return iteratorDone()}))},Stack.isStack=isStack;var ue,ce=\"@@__IMMUTABLE_STACK__@@\",fe=Stack.prototype;function makeStack(e,t,r,n){var i=Object.create(fe);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function emptyStack(){return ue||(ue=makeStack(0))}function mixin(e,t){var keyCopier=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(keyCopier),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(keyCopier),e}fe[ce]=!0,fe.withMutations=K.withMutations,fe.asMutable=K.asMutable,fe.asImmutable=K.asImmutable,fe.wasAltered=K.wasAltered,Iterable.Iterator=Iterator,mixin(Iterable,{toArray:function(){assertNotInfinite(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,r){e[r]=t})),e},toIndexedSeq:function(){return new ToIndexedSequence(this)},toJS:function(){return this.toSeq().map((function(e){return e&&\"function\"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&\"function\"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new ToKeyedSequence(this,!0)},toMap:function(){return Map(this.toKeyedSeq())},toObject:function(){assertNotInfinite(this.size);var e={};return this.__iterate((function(t,r){e[r]=t})),e},toOrderedMap:function(){return OrderedMap(this.toKeyedSeq())},toOrderedSet:function(){return OrderedSet(isKeyed(this)?this.valueSeq():this)},toSet:function(){return Set(isKeyed(this)?this.valueSeq():this)},toSetSeq:function(){return new ToSetSequence(this)},toSeq:function(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Stack(isKeyed(this)?this.valueSeq():this)},toList:function(){return List(isKeyed(this)?this.valueSeq():this)},toString:function(){return\"[Iterable]\"},__toString:function(e,t){return 0===this.size?e+t:e+\" \"+this.toSeq().map(this.__toStringMapper).join(\", \")+\" \"+t},concat:function(){return reify(this,concatFactory(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return is(t,e)}))},entries:function(){return this.__iterator(d)},every:function(e,t){assertNotInfinite(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!e.call(t,n,i,o))return r=!1,!1})),r},filter:function(e,t){return reify(this,filterFactory(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return assertNotInfinite(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){assertNotInfinite(this.size),e=void 0!==e?\"\"+e:\",\";var t=\"\",r=!0;return this.__iterate((function(n){r?r=!1:t+=e,t+=null!=n?n.toString():\"\"})),t},keys:function(){return this.__iterator(h)},map:function(e,t){return reify(this,mapFactory(this,e,t))},reduce:function(e,t,r){var n,i;return assertNotInfinite(this.size),arguments.length<2?i=!0:n=t,this.__iterate((function(t,o,a){i?(i=!1,n=t):n=e.call(r,n,t,o,a)})),n},reduceRight:function(e,t,r){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return reify(this,reverseFactory(this,!0))},slice:function(e,t){return reify(this,sliceFactory(this,e,t,!0))},some:function(e,t){return!this.every(not(e),t)},sort:function(e){return reify(this,sortFactory(this,e))},values:function(){return this.__iterator(p)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return ensureSize(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return countByFactory(this,e,t)},equals:function(e){return deepEqual(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ArraySeq(e._cache);var t=e.toSeq().map(entryMapper).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(not(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate((function(r,i,o){if(e.call(t,r,i,o))return n=[i,r],!1})),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(returnTrue)},flatMap:function(e,t){return reify(this,flatMapFactory(this,e,t))},flatten:function(e){return reify(this,flattenFactory(this,e,!0))},fromEntrySeq:function(){return new FromEntriesSequence(this)},get:function(e,t){return this.find((function(t,r){return is(r,e)}),void 0,t)},getIn:function(e,t){for(var r,n=this,i=forceIterator(e);!(r=i.next()).done;){var o=r.value;if((n=n&&n.get?n.get(o,c):c)===c)return t}return n},groupBy:function(e,t){return groupByFactory(this,e,t)},has:function(e){return this.get(e,c)!==c},hasIn:function(e){return this.getIn(e,c)!==c},isSubset:function(e){return e=\"function\"==typeof e.includes?e:Iterable(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e=\"function\"==typeof e.isSubset?e:Iterable(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return is(t,e)}))},keySeq:function(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return maxFactory(this,e)},maxBy:function(e,t){return maxFactory(this,t,e)},min:function(e){return maxFactory(this,e?neg(e):defaultNegComparator)},minBy:function(e,t){return maxFactory(this,t?neg(t):defaultNegComparator,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return reify(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return reify(this,skipWhileFactory(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(not(e),t)},sortBy:function(e,t){return reify(this,sortFactory(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return reify(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return reify(this,takeWhileFactory(this,e,t))},takeUntil:function(e,t){return this.takeWhile(not(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=hashIterable(this))}});var le=Iterable.prototype;le[t]=!0,le[m]=le.values,le.__toJS=le.toArray,le.__toStringMapper=quoteString,le.inspect=le.toSource=function(){return this.toString()},le.chain=le.flatMap,le.contains=le.includes,mixin(KeyedIterable,{flip:function(){return reify(this,flipFactory(this))},mapEntries:function(e,t){var r=this,n=0;return reify(this,this.toSeq().map((function(i,o){return e.call(t,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return reify(this,this.toSeq().flip().map((function(n,i){return e.call(t,n,i,r)})).flip())}});var he=KeyedIterable.prototype;function keyMapper(e,t){return t}function entryMapper(e,t){return[t,e]}function not(e){return function(){return!e.apply(this,arguments)}}function neg(e){return function(){return-e.apply(this,arguments)}}function quoteString(e){return\"string\"==typeof e?JSON.stringify(e):String(e)}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(e,t){return e<t?1:e>t?-1:0}function hashIterable(e){if(e.size===1/0)return 0;var t=isOrdered(e),r=isKeyed(e),n=t?1:0;return murmurHashOfSize(e.__iterate(r?t?function(e,t){n=31*n+hashMerge(hash(e),hash(t))|0}:function(e,t){n=n+hashMerge(hash(e),hash(t))|0}:t?function(e){n=31*n+hash(e)|0}:function(e){n=n+hash(e)|0}),n)}function murmurHashOfSize(e,t){return t=I(t,3432918353),t=I(t<<15|t>>>-15,461845907),t=I(t<<13|t>>>-13,5),t=I((t=t+3864292196^e)^t>>>16,2246822507),t=smi((t=I(t^t>>>13,3266489909))^t>>>16)}function hashMerge(e,t){return e^t+2654435769+(e<<6)+(e>>2)}return he[r]=!0,he[m]=le.entries,he.__toJS=le.toObject,he.__toStringMapper=function(e,t){return JSON.stringify(t)+\": \"+quoteString(e)},mixin(IndexedIterable,{toKeyedSeq:function(){return new ToKeyedSequence(this,!1)},filter:function(e,t){return reify(this,filterFactory(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return reify(this,reverseFactory(this,!1))},slice:function(e,t){return reify(this,sliceFactory(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(0|t,0),0===r||2===r&&!t)return this;e=resolveBegin(e,e<0?this.count():this.size);var n=this.slice(0,e);return reify(this,1===r?n:n.concat(arrCopy(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(){return this.get(0)},flatten:function(e){return reify(this,flattenFactory(this,e,!1))},get:function(e,t){return(e=wrapIndex(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=wrapIndex(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return reify(this,interposeFactory(this,e))},interleave:function(){var e=[this].concat(arrCopy(arguments)),t=zipWithFactory(this.toSeq(),IndexedSeq.of,e),r=t.flatten(!0);return t.size&&(r.size=t.size*e.length),reify(this,r)},keySeq:function(){return Range(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return reify(this,skipWhileFactory(this,e,t,!1))},zip:function(){return reify(this,zipWithFactory(this,defaultZipper,[this].concat(arrCopy(arguments))))},zipWith:function(e){var t=arrCopy(arguments);return t[0]=this,reify(this,zipWithFactory(this,e,t))}}),IndexedIterable.prototype[n]=!0,IndexedIterable.prototype[i]=!0,mixin(SetIterable,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),SetIterable.prototype.has=le.includes,SetIterable.prototype.contains=SetIterable.prototype.includes,mixin(KeyedSeq,KeyedIterable.prototype),mixin(IndexedSeq,IndexedIterable.prototype),mixin(SetSeq,SetIterable.prototype),mixin(KeyedCollection,KeyedIterable.prototype),mixin(IndexedCollection,IndexedIterable.prototype),mixin(SetCollection,SetIterable.prototype),{Iterable,Seq,Collection,Map,OrderedMap,List,Stack,Set,OrderedSet,Record,Range,Repeat,is,fromJS}}()},6698:e=>{\"function\"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},5580:(e,t,r)=>{var n=r(6110)(r(9325),\"DataView\");e.exports=n},1549:(e,t,r)=>{var n=r(2032),i=r(3862),o=r(6721),a=r(2749),s=r(5749);function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Hash.prototype.clear=n,Hash.prototype.delete=i,Hash.prototype.get=o,Hash.prototype.has=a,Hash.prototype.set=s,e.exports=Hash},79:(e,t,r)=>{var n=r(3702),i=r(80),o=r(4739),a=r(8655),s=r(1175);function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ListCache.prototype.clear=n,ListCache.prototype.delete=i,ListCache.prototype.get=o,ListCache.prototype.has=a,ListCache.prototype.set=s,e.exports=ListCache},8223:(e,t,r)=>{var n=r(6110)(r(9325),\"Map\");e.exports=n},3661:(e,t,r)=>{var n=r(3040),i=r(7670),o=r(289),a=r(4509),s=r(2949);function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}MapCache.prototype.clear=n,MapCache.prototype.delete=i,MapCache.prototype.get=o,MapCache.prototype.has=a,MapCache.prototype.set=s,e.exports=MapCache},2804:(e,t,r)=>{var n=r(6110)(r(9325),\"Promise\");e.exports=n},6545:(e,t,r)=>{var n=r(6110)(r(9325),\"Set\");e.exports=n},8859:(e,t,r)=>{var n=r(3661),i=r(1380),o=r(1459);function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}SetCache.prototype.add=SetCache.prototype.push=i,SetCache.prototype.has=o,e.exports=SetCache},7217:(e,t,r)=>{var n=r(79),i=r(1420),o=r(938),a=r(3605),s=r(9817),u=r(945);function Stack(e){var t=this.__data__=new n(e);this.size=t.size}Stack.prototype.clear=i,Stack.prototype.delete=o,Stack.prototype.get=a,Stack.prototype.has=s,Stack.prototype.set=u,e.exports=Stack},1873:(e,t,r)=>{var n=r(9325).Symbol;e.exports=n},7828:(e,t,r)=>{var n=r(9325).Uint8Array;e.exports=n},8303:(e,t,r)=>{var n=r(6110)(r(9325),\"WeakMap\");e.exports=n},9770:e=>{e.exports=function arrayFilter(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}},695:(e,t,r)=>{var n=r(8096),i=r(2428),o=r(6449),a=r(3656),s=r(361),u=r(7167),c=Object.prototype.hasOwnProperty;e.exports=function arrayLikeKeys(e,t){var r=o(e),f=!r&&i(e),l=!r&&!f&&a(e),h=!r&&!f&&!l&&u(e),p=r||f||l||h,d=p?n(e.length,String):[],_=d.length;for(var y in e)!t&&!c.call(e,y)||p&&(\"length\"==y||l&&(\"offset\"==y||\"parent\"==y)||h&&(\"buffer\"==y||\"byteLength\"==y||\"byteOffset\"==y)||s(y,_))||d.push(y);return d}},4932:e=>{e.exports=function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},4528:e=>{e.exports=function arrayPush(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},882:e=>{e.exports=function arrayReduce(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}},4248:e=>{e.exports=function arraySome(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},1074:e=>{e.exports=function asciiToArray(e){return e.split(\"\")}},1733:e=>{var t=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;e.exports=function asciiWords(e){return e.match(t)||[]}},6547:(e,t,r)=>{var n=r(3360),i=r(5288),o=Object.prototype.hasOwnProperty;e.exports=function assignValue(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},6025:(e,t,r)=>{var n=r(5288);e.exports=function assocIndexOf(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},3360:(e,t,r)=>{var n=r(3243);e.exports=function baseAssignValue(e,t,r){\"__proto__\"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},909:(e,t,r)=>{var n=r(641),i=r(8329)(n);e.exports=i},2523:e=>{e.exports=function baseFindIndex(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},6649:(e,t,r)=>{var n=r(3221)();e.exports=n},641:(e,t,r)=>{var n=r(6649),i=r(5950);e.exports=function baseForOwn(e,t){return e&&n(e,t,i)}},7422:(e,t,r)=>{var n=r(1769),i=r(7797);e.exports=function baseGet(e,t){for(var r=0,o=(t=n(t,e)).length;null!=e&&r<o;)e=e[i(t[r++])];return r&&r==o?e:void 0}},2199:(e,t,r)=>{var n=r(4528),i=r(6449);e.exports=function baseGetAllKeys(e,t,r){var o=t(e);return i(e)?o:n(o,r(e))}},2552:(e,t,r)=>{var n=r(1873),i=r(659),o=r(9350),a=n?n.toStringTag:void 0;e.exports=function baseGetTag(e){return null==e?void 0===e?\"[object Undefined]\":\"[object Null]\":a&&a in Object(e)?i(e):o(e)}},8077:e=>{e.exports=function baseHasIn(e,t){return null!=e&&t in Object(e)}},7534:(e,t,r)=>{var n=r(2552),i=r(346);e.exports=function baseIsArguments(e){return i(e)&&\"[object Arguments]\"==n(e)}},270:(e,t,r)=>{var n=r(7068),i=r(346);e.exports=function baseIsEqual(e,t,r,o,a){return e===t||(null==e||null==t||!i(e)&&!i(t)?e!=e&&t!=t:n(e,t,r,o,baseIsEqual,a))}},7068:(e,t,r)=>{var n=r(7217),i=r(5911),o=r(1986),a=r(689),s=r(5861),u=r(6449),c=r(3656),f=r(7167),l=\"[object Arguments]\",h=\"[object Array]\",p=\"[object Object]\",d=Object.prototype.hasOwnProperty;e.exports=function baseIsEqualDeep(e,t,r,_,y,m){var g=u(e),v=u(t),b=g?h:s(e),w=v?h:s(t),I=(b=b==l?p:b)==p,x=(w=w==l?p:w)==p,B=b==w;if(B&&c(e)){if(!c(t))return!1;g=!0,I=!1}if(B&&!I)return m||(m=new n),g||f(e)?i(e,t,r,_,y,m):o(e,t,b,r,_,y,m);if(!(1&r)){var k=I&&d.call(e,\"__wrapped__\"),C=x&&d.call(t,\"__wrapped__\");if(k||C){var q=k?e.value():e,L=C?t.value():t;return m||(m=new n),y(q,L,r,_,m)}}return!!B&&(m||(m=new n),a(e,t,r,_,y,m))}},1799:(e,t,r)=>{var n=r(7217),i=r(270);e.exports=function baseIsMatch(e,t,r,o){var a=r.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=r[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var f=(c=r[a])[0],l=e[f],h=c[1];if(u&&c[2]){if(void 0===l&&!(f in e))return!1}else{var p=new n;if(o)var d=o(l,h,f,e,t,p);if(!(void 0===d?i(h,l,3,o,p):d))return!1}}return!0}},5083:(e,t,r)=>{var n=r(1882),i=r(7296),o=r(3805),a=r(7473),s=/^\\[object .+?Constructor\\]$/,u=Function.prototype,c=Object.prototype,f=u.toString,l=c.hasOwnProperty,h=RegExp(\"^\"+f.call(l).replace(/[\\\\^$.*+?()[\\]{}|]/g,\"\\\\$&\").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\");e.exports=function baseIsNative(e){return!(!o(e)||i(e))&&(n(e)?h:s).test(a(e))}},4901:(e,t,r)=>{var n=r(2552),i=r(294),o=r(346),a={};a[\"[object Float32Array]\"]=a[\"[object Float64Array]\"]=a[\"[object Int8Array]\"]=a[\"[object Int16Array]\"]=a[\"[object Int32Array]\"]=a[\"[object Uint8Array]\"]=a[\"[object Uint8ClampedArray]\"]=a[\"[object Uint16Array]\"]=a[\"[object Uint32Array]\"]=!0,a[\"[object Arguments]\"]=a[\"[object Array]\"]=a[\"[object ArrayBuffer]\"]=a[\"[object Boolean]\"]=a[\"[object DataView]\"]=a[\"[object Date]\"]=a[\"[object Error]\"]=a[\"[object Function]\"]=a[\"[object Map]\"]=a[\"[object Number]\"]=a[\"[object Object]\"]=a[\"[object RegExp]\"]=a[\"[object Set]\"]=a[\"[object String]\"]=a[\"[object WeakMap]\"]=!1,e.exports=function baseIsTypedArray(e){return o(e)&&i(e.length)&&!!a[n(e)]}},5389:(e,t,r)=>{var n=r(3663),i=r(7978),o=r(3488),a=r(6449),s=r(583);e.exports=function baseIteratee(e){return\"function\"==typeof e?e:null==e?o:\"object\"==typeof e?a(e)?i(e[0],e[1]):n(e):s(e)}},8984:(e,t,r)=>{var n=r(5527),i=r(3650),o=Object.prototype.hasOwnProperty;e.exports=function baseKeys(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&\"constructor\"!=r&&t.push(r);return t}},3663:(e,t,r)=>{var n=r(1799),i=r(776),o=r(7197);e.exports=function baseMatches(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},7978:(e,t,r)=>{var n=r(270),i=r(8156),o=r(631),a=r(8586),s=r(756),u=r(7197),c=r(7797);e.exports=function baseMatchesProperty(e,t){return a(e)&&s(t)?u(c(e),t):function(r){var a=i(r,e);return void 0===a&&a===t?o(r,e):n(t,a,3)}}},7237:e=>{e.exports=function baseProperty(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,r)=>{var n=r(7422);e.exports=function basePropertyDeep(e){return function(t){return n(t,e)}}},4552:e=>{e.exports=function basePropertyOf(e){return function(t){return null==e?void 0:e[t]}}},5160:e=>{e.exports=function baseSlice(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}},916:(e,t,r)=>{var n=r(909);e.exports=function baseSome(e,t){var r;return n(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}},8096:e=>{e.exports=function baseTimes(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},7556:(e,t,r)=>{var n=r(1873),i=r(4932),o=r(6449),a=r(4394),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function baseToString(e){if(\"string\"==typeof e)return e;if(o(e))return i(e,baseToString)+\"\";if(a(e))return u?u.call(e):\"\";var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}},4128:(e,t,r)=>{var n=r(1800),i=/^\\s+/;e.exports=function baseTrim(e){return e?e.slice(0,n(e)+1).replace(i,\"\"):e}},7301:e=>{e.exports=function baseUnary(e){return function(t){return e(t)}}},1234:e=>{e.exports=function baseZipObject(e,t,r){for(var n=-1,i=e.length,o=t.length,a={};++n<i;){var s=n<o?t[n]:void 0;r(a,e[n],s)}return a}},9219:e=>{e.exports=function cacheHas(e,t){return e.has(t)}},1769:(e,t,r)=>{var n=r(6449),i=r(8586),o=r(1802),a=r(3222);e.exports=function castPath(e,t){return n(e)?e:i(e,t)?[e]:o(a(e))}},8754:(e,t,r)=>{var n=r(5160);e.exports=function castSlice(e,t,r){var i=e.length;return r=void 0===r?i:r,!t&&r>=i?e:n(e,t,r)}},5481:(e,t,r)=>{var n=r(9325)[\"__core-js_shared__\"];e.exports=n},8329:(e,t,r)=>{var n=r(4894);e.exports=function createBaseEach(e,t){return function(r,i){if(null==r)return r;if(!n(r))return e(r,i);for(var o=r.length,a=t?o:-1,s=Object(r);(t?a--:++a<o)&&!1!==i(s[a],a,s););return r}}},3221:e=>{e.exports=function createBaseFor(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===r(o[u],u,o))break}return t}}},2507:(e,t,r)=>{var n=r(8754),i=r(9698),o=r(3912),a=r(3222);e.exports=function createCaseFirst(e){return function(t){t=a(t);var r=i(t)?o(t):void 0,s=r?r[0]:t.charAt(0),u=r?n(r,1).join(\"\"):t.slice(1);return s[e]()+u}}},5539:(e,t,r)=>{var n=r(882),i=r(828),o=r(6645),a=RegExp(\"['’]\",\"g\");e.exports=function createCompounder(e){return function(t){return n(o(i(t).replace(a,\"\")),e,\"\")}}},2006:(e,t,r)=>{var n=r(5389),i=r(4894),o=r(5950);e.exports=function createFind(e){return function(t,r,a){var s=Object(t);if(!i(t)){var u=n(r,3);t=o(t),r=function(e){return u(s[e],e,s)}}var c=e(t,r,a);return c>-1?s[u?t[c]:c]:void 0}}},4647:(e,t,r)=>{var n=r(4552)({À:\"A\",Á:\"A\",Â:\"A\",Ã:\"A\",Ä:\"A\",Å:\"A\",à:\"a\",á:\"a\",â:\"a\",ã:\"a\",ä:\"a\",å:\"a\",Ç:\"C\",ç:\"c\",Ð:\"D\",ð:\"d\",È:\"E\",É:\"E\",Ê:\"E\",Ë:\"E\",è:\"e\",é:\"e\",ê:\"e\",ë:\"e\",Ì:\"I\",Í:\"I\",Î:\"I\",Ï:\"I\",ì:\"i\",í:\"i\",î:\"i\",ï:\"i\",Ñ:\"N\",ñ:\"n\",Ò:\"O\",Ó:\"O\",Ô:\"O\",Õ:\"O\",Ö:\"O\",Ø:\"O\",ò:\"o\",ó:\"o\",ô:\"o\",õ:\"o\",ö:\"o\",ø:\"o\",Ù:\"U\",Ú:\"U\",Û:\"U\",Ü:\"U\",ù:\"u\",ú:\"u\",û:\"u\",ü:\"u\",Ý:\"Y\",ý:\"y\",ÿ:\"y\",Æ:\"Ae\",æ:\"ae\",Þ:\"Th\",þ:\"th\",ß:\"ss\",Ā:\"A\",Ă:\"A\",Ą:\"A\",ā:\"a\",ă:\"a\",ą:\"a\",Ć:\"C\",Ĉ:\"C\",Ċ:\"C\",Č:\"C\",ć:\"c\",ĉ:\"c\",ċ:\"c\",č:\"c\",Ď:\"D\",Đ:\"D\",ď:\"d\",đ:\"d\",Ē:\"E\",Ĕ:\"E\",Ė:\"E\",Ę:\"E\",Ě:\"E\",ē:\"e\",ĕ:\"e\",ė:\"e\",ę:\"e\",ě:\"e\",Ĝ:\"G\",Ğ:\"G\",Ġ:\"G\",Ģ:\"G\",ĝ:\"g\",ğ:\"g\",ġ:\"g\",ģ:\"g\",Ĥ:\"H\",Ħ:\"H\",ĥ:\"h\",ħ:\"h\",Ĩ:\"I\",Ī:\"I\",Ĭ:\"I\",Į:\"I\",İ:\"I\",ĩ:\"i\",ī:\"i\",ĭ:\"i\",į:\"i\",ı:\"i\",Ĵ:\"J\",ĵ:\"j\",Ķ:\"K\",ķ:\"k\",ĸ:\"k\",Ĺ:\"L\",Ļ:\"L\",Ľ:\"L\",Ŀ:\"L\",Ł:\"L\",ĺ:\"l\",ļ:\"l\",ľ:\"l\",ŀ:\"l\",ł:\"l\",Ń:\"N\",Ņ:\"N\",Ň:\"N\",Ŋ:\"N\",ń:\"n\",ņ:\"n\",ň:\"n\",ŋ:\"n\",Ō:\"O\",Ŏ:\"O\",Ő:\"O\",ō:\"o\",ŏ:\"o\",ő:\"o\",Ŕ:\"R\",Ŗ:\"R\",Ř:\"R\",ŕ:\"r\",ŗ:\"r\",ř:\"r\",Ś:\"S\",Ŝ:\"S\",Ş:\"S\",Š:\"S\",ś:\"s\",ŝ:\"s\",ş:\"s\",š:\"s\",Ţ:\"T\",Ť:\"T\",Ŧ:\"T\",ţ:\"t\",ť:\"t\",ŧ:\"t\",Ũ:\"U\",Ū:\"U\",Ŭ:\"U\",Ů:\"U\",Ű:\"U\",Ų:\"U\",ũ:\"u\",ū:\"u\",ŭ:\"u\",ů:\"u\",ű:\"u\",ų:\"u\",Ŵ:\"W\",ŵ:\"w\",Ŷ:\"Y\",ŷ:\"y\",Ÿ:\"Y\",Ź:\"Z\",Ż:\"Z\",Ž:\"Z\",ź:\"z\",ż:\"z\",ž:\"z\",Ĳ:\"IJ\",ĳ:\"ij\",Œ:\"Oe\",œ:\"oe\",ŉ:\"'n\",ſ:\"s\"});e.exports=n},3243:(e,t,r)=>{var n=r(6110),i=function(){try{var e=n(Object,\"defineProperty\");return e({},\"\",{}),e}catch(e){}}();e.exports=i},5911:(e,t,r)=>{var n=r(8859),i=r(4248),o=r(9219);e.exports=function equalArrays(e,t,r,a,s,u){var c=1&r,f=e.length,l=t.length;if(f!=l&&!(c&&l>f))return!1;var h=u.get(e),p=u.get(t);if(h&&p)return h==t&&p==e;var d=-1,_=!0,y=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++d<f;){var m=e[d],g=t[d];if(a)var v=c?a(g,m,d,t,e,u):a(m,g,d,e,t,u);if(void 0!==v){if(v)continue;_=!1;break}if(y){if(!i(t,(function(e,t){if(!o(y,t)&&(m===e||s(m,e,r,a,u)))return y.push(t)}))){_=!1;break}}else if(m!==g&&!s(m,g,r,a,u)){_=!1;break}}return u.delete(e),u.delete(t),_}},1986:(e,t,r)=>{var n=r(1873),i=r(7828),o=r(5288),a=r(5911),s=r(317),u=r(4247),c=n?n.prototype:void 0,f=c?c.valueOf:void 0;e.exports=function equalByTag(e,t,r,n,c,l,h){switch(r){case\"[object DataView]\":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case\"[object ArrayBuffer]\":return!(e.byteLength!=t.byteLength||!l(new i(e),new i(t)));case\"[object Boolean]\":case\"[object Date]\":case\"[object Number]\":return o(+e,+t);case\"[object Error]\":return e.name==t.name&&e.message==t.message;case\"[object RegExp]\":case\"[object String]\":return e==t+\"\";case\"[object Map]\":var p=s;case\"[object Set]\":var d=1&n;if(p||(p=u),e.size!=t.size&&!d)return!1;var _=h.get(e);if(_)return _==t;n|=2,h.set(e,t);var y=a(p(e),p(t),n,c,l,h);return h.delete(e),y;case\"[object Symbol]\":if(f)return f.call(e)==f.call(t)}return!1}},689:(e,t,r)=>{var n=r(2),i=Object.prototype.hasOwnProperty;e.exports=function equalObjects(e,t,r,o,a,s){var u=1&r,c=n(e),f=c.length;if(f!=n(t).length&&!u)return!1;for(var l=f;l--;){var h=c[l];if(!(u?h in t:i.call(t,h)))return!1}var p=s.get(e),d=s.get(t);if(p&&d)return p==t&&d==e;var _=!0;s.set(e,t),s.set(t,e);for(var y=u;++l<f;){var m=e[h=c[l]],g=t[h];if(o)var v=u?o(g,m,h,t,e,s):o(m,g,h,e,t,s);if(!(void 0===v?m===g||a(m,g,r,o,s):v)){_=!1;break}y||(y=\"constructor\"==h)}if(_&&!y){var b=e.constructor,w=t.constructor;b==w||!(\"constructor\"in e)||!(\"constructor\"in t)||\"function\"==typeof b&&b instanceof b&&\"function\"==typeof w&&w instanceof w||(_=!1)}return s.delete(e),s.delete(t),_}},4840:(e,t,r)=>{var n=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},2:(e,t,r)=>{var n=r(2199),i=r(4664),o=r(5950);e.exports=function getAllKeys(e){return n(e,o,i)}},2651:(e,t,r)=>{var n=r(4218);e.exports=function getMapData(e,t){var r=e.__data__;return n(t)?r[\"string\"==typeof t?\"string\":\"hash\"]:r.map}},776:(e,t,r)=>{var n=r(756),i=r(5950);e.exports=function getMatchData(e){for(var t=i(e),r=t.length;r--;){var o=t[r],a=e[o];t[r]=[o,a,n(a)]}return t}},6110:(e,t,r)=>{var n=r(5083),i=r(392);e.exports=function getNative(e,t){var r=i(e,t);return n(r)?r:void 0}},659:(e,t,r)=>{var n=r(1873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function getRawTag(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},4664:(e,t,r)=>{var n=r(9770),i=r(3345),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},5861:(e,t,r)=>{var n=r(5580),i=r(8223),o=r(2804),a=r(6545),s=r(8303),u=r(2552),c=r(7473),f=\"[object Map]\",l=\"[object Promise]\",h=\"[object Set]\",p=\"[object WeakMap]\",d=\"[object DataView]\",_=c(n),y=c(i),m=c(o),g=c(a),v=c(s),b=u;(n&&b(new n(new ArrayBuffer(1)))!=d||i&&b(new i)!=f||o&&b(o.resolve())!=l||a&&b(new a)!=h||s&&b(new s)!=p)&&(b=function(e){var t=u(e),r=\"[object Object]\"==t?e.constructor:void 0,n=r?c(r):\"\";if(n)switch(n){case _:return d;case y:return f;case m:return l;case g:return h;case v:return p}return t}),e.exports=b},392:e=>{e.exports=function getValue(e,t){return null==e?void 0:e[t]}},9326:(e,t,r)=>{var n=r(1769),i=r(2428),o=r(6449),a=r(361),s=r(294),u=r(7797);e.exports=function hasPath(e,t,r){for(var c=-1,f=(t=n(t,e)).length,l=!1;++c<f;){var h=u(t[c]);if(!(l=null!=e&&r(e,h)))break;e=e[h]}return l||++c!=f?l:!!(f=null==e?0:e.length)&&s(f)&&a(h,f)&&(o(e)||i(e))}},9698:e=>{var t=RegExp(\"[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]\");e.exports=function hasUnicode(e){return t.test(e)}},5434:e=>{var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function hasUnicodeWord(e){return t.test(e)}},2032:(e,t,r)=>{var n=r(1042);e.exports=function hashClear(){this.__data__=n?n(null):{},this.size=0}},3862:e=>{e.exports=function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,r)=>{var n=r(1042),i=Object.prototype.hasOwnProperty;e.exports=function hashGet(e){var t=this.__data__;if(n){var r=t[e];return\"__lodash_hash_undefined__\"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},2749:(e,t,r)=>{var n=r(1042),i=Object.prototype.hasOwnProperty;e.exports=function hashHas(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},5749:(e,t,r)=>{var n=r(1042);e.exports=function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?\"__lodash_hash_undefined__\":t,this}},361:e=>{var t=/^(?:0|[1-9]\\d*)$/;e.exports=function isIndex(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&(\"number\"==n||\"symbol\"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},6800:(e,t,r)=>{var n=r(5288),i=r(4894),o=r(361),a=r(3805);e.exports=function isIterateeCall(e,t,r){if(!a(r))return!1;var s=typeof t;return!!(\"number\"==s?i(r)&&o(t,r.length):\"string\"==s&&t in r)&&n(r[t],e)}},8586:(e,t,r)=>{var n=r(6449),i=r(4394),o=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,a=/^\\w*$/;e.exports=function isKey(e,t){if(n(e))return!1;var r=typeof e;return!(\"number\"!=r&&\"symbol\"!=r&&\"boolean\"!=r&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},4218:e=>{e.exports=function isKeyable(e){var t=typeof e;return\"string\"==t||\"number\"==t||\"symbol\"==t||\"boolean\"==t?\"__proto__\"!==e:null===e}},7296:(e,t,r)=>{var n,i=r(5481),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||\"\"))?\"Symbol(src)_1.\"+n:\"\";e.exports=function isMasked(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function isPrototype(e){var r=e&&e.constructor;return e===(\"function\"==typeof r&&r.prototype||t)}},756:(e,t,r)=>{var n=r(3805);e.exports=function isStrictComparable(e){return e==e&&!n(e)}},3702:e=>{e.exports=function listCacheClear(){this.__data__=[],this.size=0}},80:(e,t,r)=>{var n=r(6025),i=Array.prototype.splice;e.exports=function listCacheDelete(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},4739:(e,t,r)=>{var n=r(6025);e.exports=function listCacheGet(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},8655:(e,t,r)=>{var n=r(6025);e.exports=function listCacheHas(e){return n(this.__data__,e)>-1}},1175:(e,t,r)=>{var n=r(6025);e.exports=function listCacheSet(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},3040:(e,t,r)=>{var n=r(1549),i=r(79),o=r(8223);e.exports=function mapCacheClear(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},7670:(e,t,r)=>{var n=r(2651);e.exports=function mapCacheDelete(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,r)=>{var n=r(2651);e.exports=function mapCacheGet(e){return n(this,e).get(e)}},4509:(e,t,r)=>{var n=r(2651);e.exports=function mapCacheHas(e){return n(this,e).has(e)}},2949:(e,t,r)=>{var n=r(2651);e.exports=function mapCacheSet(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},317:e=>{e.exports=function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},7197:e=>{e.exports=function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}},2224:(e,t,r)=>{var n=r(104);e.exports=function memoizeCapped(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},1042:(e,t,r)=>{var n=r(6110)(Object,\"create\");e.exports=n},3650:(e,t,r)=>{var n=r(4335)(Object.keys,Object);e.exports=n},6009:(e,t,r)=>{e=r.nmd(e);var n=r(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&n.process,s=function(){try{var e=o&&o.require&&o.require(\"util\").types;return e||a&&a.binding&&a.binding(\"util\")}catch(e){}}();e.exports=s},9350:e=>{var t=Object.prototype.toString;e.exports=function objectToString(e){return t.call(e)}},4335:e=>{e.exports=function overArg(e,t){return function(r){return e(t(r))}}},9325:(e,t,r)=>{var n=r(4840),i=\"object\"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function(\"return this\")();e.exports=o},1380:e=>{e.exports=function setCacheAdd(e){return this.__data__.set(e,\"__lodash_hash_undefined__\"),this}},1459:e=>{e.exports=function setCacheHas(e){return this.__data__.has(e)}},4247:e=>{e.exports=function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},1420:(e,t,r)=>{var n=r(79);e.exports=function stackClear(){this.__data__=new n,this.size=0}},938:e=>{e.exports=function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605:e=>{e.exports=function stackGet(e){return this.__data__.get(e)}},9817:e=>{e.exports=function stackHas(e){return this.__data__.has(e)}},945:(e,t,r)=>{var n=r(79),i=r(8223),o=r(3661);e.exports=function stackSet(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(e,t),this.size=r.size,this}},3912:(e,t,r)=>{var n=r(1074),i=r(9698),o=r(2054);e.exports=function stringToArray(e){return i(e)?o(e):n(e)}},1802:(e,t,r)=>{var n=r(2224),i=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,o=/\\\\(\\\\)?/g,a=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(\"\"),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(o,\"$1\"):r||e)})),t}));e.exports=a},7797:(e,t,r)=>{var n=r(4394);e.exports=function toKey(e){if(\"string\"==typeof e||n(e))return e;var t=e+\"\";return\"0\"==t&&1/e==-1/0?\"-0\":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function toSource(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+\"\"}catch(e){}}return\"\"}},1800:e=>{var t=/\\s/;e.exports=function trimmedEndIndex(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},2054:e=>{var t=\"\\\\ud800-\\\\udfff\",r=\"[\"+t+\"]\",n=\"[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]\",i=\"\\\\ud83c[\\\\udffb-\\\\udfff]\",o=\"[^\"+t+\"]\",a=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",s=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",u=\"(?:\"+n+\"|\"+i+\")\"+\"?\",c=\"[\\\\ufe0e\\\\ufe0f]?\",f=c+u+(\"(?:\\\\u200d(?:\"+[o,a,s].join(\"|\")+\")\"+c+u+\")*\"),l=\"(?:\"+[o+n+\"?\",n,a,s,r].join(\"|\")+\")\",h=RegExp(i+\"(?=\"+i+\")|\"+l+f,\"g\");e.exports=function unicodeToArray(e){return e.match(h)||[]}},2225:e=>{var t=\"\\\\ud800-\\\\udfff\",r=\"\\\\u2700-\\\\u27bf\",n=\"a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff\",i=\"A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\",o=\"\\\\xac\\\\xb1\\\\xd7\\\\xf7\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf\\\\u2000-\\\\u206f \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000\",a=\"[\"+o+\"]\",s=\"\\\\d+\",u=\"[\"+r+\"]\",c=\"[\"+n+\"]\",f=\"[^\"+t+o+s+r+n+i+\"]\",l=\"(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}\",h=\"[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]\",p=\"[\"+i+\"]\",d=\"(?:\"+c+\"|\"+f+\")\",_=\"(?:\"+p+\"|\"+f+\")\",y=\"(?:['’](?:d|ll|m|re|s|t|ve))?\",m=\"(?:['’](?:D|LL|M|RE|S|T|VE))?\",g=\"(?:[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]|\\\\ud83c[\\\\udffb-\\\\udfff])?\",v=\"[\\\\ufe0e\\\\ufe0f]?\",b=v+g+(\"(?:\\\\u200d(?:\"+[\"[^\"+t+\"]\",l,h].join(\"|\")+\")\"+v+g+\")*\"),w=\"(?:\"+[u,l,h].join(\"|\")+\")\"+b,I=RegExp([p+\"?\"+c+\"+\"+y+\"(?=\"+[a,p,\"$\"].join(\"|\")+\")\",_+\"+\"+m+\"(?=\"+[a,p+d,\"$\"].join(\"|\")+\")\",p+\"?\"+d+\"+\"+y,p+\"+\"+m,\"\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])\",\"\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])\",s,w].join(\"|\"),\"g\");e.exports=function unicodeWords(e){return e.match(I)||[]}},4058:(e,t,r)=>{var n=r(4792),i=r(5539)((function(e,t,r){return t=t.toLowerCase(),e+(r?n(t):t)}));e.exports=i},4792:(e,t,r)=>{var n=r(3222),i=r(5808);e.exports=function capitalize(e){return i(n(e).toLowerCase())}},828:(e,t,r)=>{var n=r(4647),i=r(3222),o=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,a=RegExp(\"[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]\",\"g\");e.exports=function deburr(e){return(e=i(e))&&e.replace(o,n).replace(a,\"\")}},5288:e=>{e.exports=function eq(e,t){return e===t||e!=e&&t!=t}},7309:(e,t,r)=>{var n=r(2006)(r(4713));e.exports=n},4713:(e,t,r)=>{var n=r(2523),i=r(5389),o=r(1489),a=Math.max;e.exports=function findIndex(e,t,r){var s=null==e?0:e.length;if(!s)return-1;var u=null==r?0:o(r);return u<0&&(u=a(s+u,0)),n(e,i(t,3),u)}},8156:(e,t,r)=>{var n=r(7422);e.exports=function get(e,t,r){var i=null==e?void 0:n(e,t);return void 0===i?r:i}},631:(e,t,r)=>{var n=r(8077),i=r(9326);e.exports=function hasIn(e,t){return null!=e&&i(e,t,n)}},3488:e=>{e.exports=function identity(e){return e}},2428:(e,t,r)=>{var n=r(7534),i=r(346),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,\"callee\")&&!s.call(e,\"callee\")};e.exports=u},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,r)=>{var n=r(1882),i=r(294);e.exports=function isArrayLike(e){return null!=e&&i(e.length)&&!n(e)}},3656:(e,t,r)=>{e=r.nmd(e);var n=r(9325),i=r(9935),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},1882:(e,t,r)=>{var n=r(2552),i=r(3805);e.exports=function isFunction(e){if(!i(e))return!1;var t=n(e);return\"[object Function]\"==t||\"[object GeneratorFunction]\"==t||\"[object AsyncFunction]\"==t||\"[object Proxy]\"==t}},294:e=>{e.exports=function isLength(e){return\"number\"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3805:e=>{e.exports=function isObject(e){var t=typeof e;return null!=e&&(\"object\"==t||\"function\"==t)}},346:e=>{e.exports=function isObjectLike(e){return null!=e&&\"object\"==typeof e}},4394:(e,t,r)=>{var n=r(2552),i=r(346);e.exports=function isSymbol(e){return\"symbol\"==typeof e||i(e)&&\"[object Symbol]\"==n(e)}},7167:(e,t,r)=>{var n=r(4901),i=r(7301),o=r(6009),a=o&&o.isTypedArray,s=a?i(a):n;e.exports=s},5950:(e,t,r)=>{var n=r(695),i=r(8984),o=r(4894);e.exports=function keys(e){return o(e)?n(e):i(e)}},104:(e,t,r)=>{var n=r(3661);function memoize(e,t){if(\"function\"!=typeof e||null!=t&&\"function\"!=typeof t)throw new TypeError(\"Expected a function\");var memoized=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=memoized.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return memoized.cache=i.set(n,o)||i,o};return memoized.cache=new(memoize.Cache||n),memoized}memoize.Cache=n,e.exports=memoize},583:(e,t,r)=>{var n=r(7237),i=r(7255),o=r(8586),a=r(7797);e.exports=function property(e){return o(e)?n(a(e)):i(e)}},2426:(e,t,r)=>{var n=r(4248),i=r(5389),o=r(916),a=r(6449),s=r(6800);e.exports=function some(e,t,r){var u=a(e)?n:o;return r&&s(e,t,r)&&(t=void 0),u(e,i(t,3))}},3345:e=>{e.exports=function stubArray(){return[]}},9935:e=>{e.exports=function stubFalse(){return!1}},7400:(e,t,r)=>{var n=r(9374),i=1/0;e.exports=function toFinite(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,r)=>{var n=r(7400);e.exports=function toInteger(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},9374:(e,t,r)=>{var n=r(4128),i=r(3805),o=r(4394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function toNumber(e){if(\"number\"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):a.test(e)?NaN:+e}},3222:(e,t,r)=>{var n=r(7556);e.exports=function toString(e){return null==e?\"\":n(e)}},5808:(e,t,r)=>{var n=r(2507)(\"toUpperCase\");e.exports=n},6645:(e,t,r)=>{var n=r(1733),i=r(5434),o=r(3222),a=r(2225);e.exports=function words(e,t,r){return e=o(e),void 0===(t=r?void 0:t)?i(e)?a(e):n(e):e.match(t)||[]}},7248:(e,t,r)=>{var n=r(6547),i=r(1234);e.exports=function zipObject(e,t){return i(e||[],t||[],n)}},5606:e=>{var t,r,n=e.exports={};function defaultSetTimout(){throw new Error(\"setTimeout has not been defined\")}function defaultClearTimeout(){throw new Error(\"clearTimeout has not been defined\")}function runTimeout(e){if(t===setTimeout)return setTimeout(e,0);if((t===defaultSetTimout||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t=\"function\"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){t=defaultSetTimout}try{r=\"function\"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){r=defaultClearTimeout}}();var i,o=[],a=!1,s=-1;function cleanUpNextTick(){a&&i&&(a=!1,i.length?o=i.concat(o):s=-1,o.length&&drainQueue())}function drainQueue(){if(!a){var e=runTimeout(cleanUpNextTick);a=!0;for(var t=o.length;t;){for(i=o,o=[];++s<t;)i&&i[s].run();s=-1,t=o.length}i=null,a=!1,function runClearTimeout(e){if(r===clearTimeout)return clearTimeout(e);if((r===defaultClearTimeout||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];o.push(new Item(e,t)),1!==o.length||a||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},n.title=\"browser\",n.browser=!0,n.env={},n.argv=[],n.version=\"\",n.versions={},n.on=noop,n.addListener=noop,n.once=noop,n.off=noop,n.removeListener=noop,n.removeAllListeners=noop,n.emit=noop,n.prependListener=noop,n.prependOnceListener=noop,n.listeners=function(e){return[]},n.binding=function(e){throw new Error(\"process.binding is not supported\")},n.cwd=function(){return\"/\"},n.chdir=function(e){throw new Error(\"process.chdir is not supported\")},n.umask=function(){return 0}},3209:(e,t,r)=>{\"use strict\";var n=r(5606),i=65536,o=4294967295;var a=r(2861).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?e.exports=function randomBytes(e,t){if(e>o)throw new RangeError(\"requested too many random bytes\");var r=a.allocUnsafe(e);if(e>0)if(e>i)for(var u=0;u<e;u+=i)s.getRandomValues(r.slice(u,u+i));else s.getRandomValues(r);if(\"function\"==typeof t)return n.nextTick((function(){t(null,r)}));return r}:e.exports=function oldBrowser(){throw new Error(\"Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11\")}},5287:(e,t)=>{\"use strict\";var r=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),i=Symbol.for(\"react.fragment\"),o=Symbol.for(\"react.strict_mode\"),a=Symbol.for(\"react.profiler\"),s=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),c=Symbol.for(\"react.forward_ref\"),f=Symbol.for(\"react.suspense\"),l=Symbol.for(\"react.memo\"),h=Symbol.for(\"react.lazy\"),p=Symbol.iterator;var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,y={};function E(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||d}function F(){}function G(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||d}E.prototype.isReactComponent={},E.prototype.setState=function(e,t){if(\"object\"!=typeof e&&\"function\"!=typeof e&&null!=e)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")},E.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")},F.prototype=E.prototype;var m=G.prototype=new F;m.constructor=G,_(m,E.prototype),m.isPureReactComponent=!0;var g=Array.isArray,v=Object.prototype.hasOwnProperty,b={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function M(e,t,n){var i,o={},a=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=\"\"+t.key),t)v.call(t,i)&&!w.hasOwnProperty(i)&&(o[i]=t[i]);var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){for(var c=Array(u),f=0;f<u;f++)c[f]=arguments[f+2];o.children=c}if(e&&e.defaultProps)for(i in u=e.defaultProps)void 0===o[i]&&(o[i]=u[i]);return{$$typeof:r,type:e,key:a,ref:s,props:o,_owner:b.current}}function O(e){return\"object\"==typeof e&&null!==e&&e.$$typeof===r}var I=/\\/+/g;function Q(e,t){return\"object\"==typeof e&&null!==e&&null!=e.key?function escape(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,(function(e){return t[e]}))}(\"\"+e.key):t.toString(36)}function R(e,t,i,o,a){var s=typeof e;\"undefined\"!==s&&\"boolean\"!==s||(e=null);var u=!1;if(null===e)u=!0;else switch(s){case\"string\":case\"number\":u=!0;break;case\"object\":switch(e.$$typeof){case r:case n:u=!0}}if(u)return a=a(u=e),e=\"\"===o?\".\"+Q(u,0):o,g(a)?(i=\"\",null!=e&&(i=e.replace(I,\"$&/\")+\"/\"),R(a,t,i,\"\",(function(e){return e}))):null!=a&&(O(a)&&(a=function N(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,i+(!a.key||u&&u.key===a.key?\"\":(\"\"+a.key).replace(I,\"$&/\")+\"/\")+e)),t.push(a)),1;if(u=0,o=\"\"===o?\".\":o+\":\",g(e))for(var c=0;c<e.length;c++){var f=o+Q(s=e[c],c);u+=R(s,t,i,f,a)}else if(f=function A(e){return null===e||\"object\"!=typeof e?null:\"function\"==typeof(e=p&&e[p]||e[\"@@iterator\"])?e:null}(e),\"function\"==typeof f)for(e=f.call(e),c=0;!(s=e.next()).done;)u+=R(s=s.value,t,i,f=o+Q(s,c++),a);else if(\"object\"===s)throw t=String(e),Error(\"Objects are not valid as a React child (found: \"+(\"[object Object]\"===t?\"object with keys {\"+Object.keys(e).join(\", \")+\"}\":t)+\"). If you meant to render a collection of children, use an array instead.\");return u}function S(e,t,r){if(null==e)return e;var n=[],i=0;return R(e,n,\"\",\"\",(function(e){return t.call(r,e,i++)})),n}function T(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var x={current:null},B={transition:null},k={ReactCurrentDispatcher:x,ReactCurrentBatchConfig:B,ReactCurrentOwner:b};function X(){throw Error(\"act(...) is not supported in production builds of React.\")}t.Children={map:S,forEach:function(e,t,r){S(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return S(e,(function(){t++})),t},toArray:function(e){return S(e,(function(e){return e}))||[]},only:function(e){if(!O(e))throw Error(\"React.Children.only expected to receive a single React element child.\");return e}},t.Component=E,t.Fragment=i,t.Profiler=a,t.PureComponent=G,t.StrictMode=o,t.Suspense=f,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k,t.act=X,t.cloneElement=function(e,t,n){if(null==e)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+e+\".\");var i=_({},e.props),o=e.key,a=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,s=b.current),void 0!==t.key&&(o=\"\"+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)v.call(t,c)&&!w.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){u=Array(c);for(var f=0;f<c;f++)u[f]=arguments[f+2];i.children=u}return{$$typeof:r,type:e.type,key:o,ref:a,props:i,_owner:s}},t.createContext=function(e){return(e={$$typeof:u,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=M,t.createFactory=function(e){var t=M.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=O,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:T}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=B.transition;B.transition={};try{e()}finally{B.transition=t}},t.unstable_act=X,t.useCallback=function(e,t){return x.current.useCallback(e,t)},t.useContext=function(e){return x.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return x.current.useDeferredValue(e)},t.useEffect=function(e,t){return x.current.useEffect(e,t)},t.useId=function(){return x.current.useId()},t.useImperativeHandle=function(e,t,r){return x.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return x.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return x.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return x.current.useMemo(e,t)},t.useReducer=function(e,t,r){return x.current.useReducer(e,t,r)},t.useRef=function(e){return x.current.useRef(e)},t.useState=function(e){return x.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return x.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return x.current.useTransition()},t.version=\"18.3.1\"},6540:(e,t,r)=>{\"use strict\";e.exports=r(5287)},2861:(e,t,r)=>{var n=r(8287),i=n.Buffer;function copyProps(e,t){for(var r in e)t[r]=e[r]}function SafeBuffer(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(copyProps(n,t),t.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(i.prototype),copyProps(i,SafeBuffer),SafeBuffer.from=function(e,t,r){if(\"number\"==typeof e)throw new TypeError(\"Argument must not be a number\");return i(e,t,r)},SafeBuffer.alloc=function(e,t,r){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");var n=i(e);return void 0!==t?\"string\"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},SafeBuffer.allocUnsafe=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return i(e)},SafeBuffer.allocUnsafeSlow=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return n.SlowBuffer(e)}},8011:(e,t,r)=>{var n=r(2861).Buffer;function Hash(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hash.prototype.update=function(e,t){\"string\"==typeof e&&(t=t||\"utf8\",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,c=Math.min(o-s,i-u),f=0;f<c;f++)r[u+f]=e[s+f];s+=c,(a+=c)%i==0&&this._update(r)}return this._len+=o,this},Hash.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Hash.prototype._update=function(){throw new Error(\"_update must be implemented by subclass\")},e.exports=Hash},2802:(e,t,r)=>{var n=e.exports=function SHA(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+\" is not supported (we accept pull requests)\");return new t};n.sha=r(7816),n.sha1=r(3737),n.sha224=r(6710),n.sha256=r(4107),n.sha384=r(2827),n.sha512=r(2890)},7816:(e,t,r)=>{var n=r(6698),i=r(8011),o=r(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function Sha(){this.init(),this._w=s,i.call(this,64,56)}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(Sha,i),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var f=0;f<80;++f){var l=~~(f/20),h=0|((t=n)<<5|t>>>27)+ft(l,i,o,s)+u+r[f]+a[l];u=s,s=o,o=rotl30(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},Sha.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=Sha},3737:(e,t,r)=>{var n=r(6698),i=r(8011),o=r(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function Sha1(){this.init(),this._w=s,i.call(this,64,56)}function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(Sha1,i),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var f=0;f<80;++f){var l=~~(f/20),h=rotl5(n)+ft(l,i,o,s)+u+r[f]+a[l]|0;u=s,s=o,o=rotl30(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},Sha1.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=Sha1},6710:(e,t,r)=>{var n=r(6698),i=r(4107),o=r(8011),a=r(2861).Buffer,s=new Array(64);function Sha224(){this.init(),this._w=s,o.call(this,64,56)}n(Sha224,i),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=Sha224},4107:(e,t,r)=>{var n=r(6698),i=r(8011),o=r(2861).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function Sha256(){this.init(),this._w=s,i.call(this,64,56)}function ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function sigma1(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function gamma0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(Sha256,i),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,c=0|this._f,f=0|this._g,l=0|this._h,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<64;++h)r[h]=0|(((t=r[h-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[h-7]+gamma0(r[h-15])+r[h-16];for(var p=0;p<64;++p){var d=l+sigma1(u)+ch(u,c,f)+a[p]+r[p]|0,_=sigma0(n)+maj(n,i,o)|0;l=f,f=c,c=u,u=s+d|0,s=o,o=i,i=n,n=d+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=c+this._f|0,this._g=f+this._g|0,this._h=l+this._h|0},Sha256.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=Sha256},2827:(e,t,r)=>{var n=r(6698),i=r(2890),o=r(8011),a=r(2861).Buffer,s=new Array(160);function Sha384(){this.init(),this._w=s,o.call(this,128,112)}n(Sha384,i),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){var e=a.allocUnsafe(48);function writeInt64BE(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),e},e.exports=Sha384},2890:(e,t,r)=>{var n=r(6698),i=r(8011),o=r(2861).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function Sha512(){this.init(),this._w=s,i.call(this,128,112)}function Ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function sigma1(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Gamma0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Gamma0l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Gamma1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gamma1l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function getCarry(e,t){return e>>>0<t>>>0?1:0}n(Sha512,i),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,c=0|this._gh,f=0|this._hh,l=0|this._al,h=0|this._bl,p=0|this._cl,d=0|this._dl,_=0|this._el,y=0|this._fl,m=0|this._gl,g=0|this._hl,v=0;v<32;v+=2)t[v]=e.readInt32BE(4*v),t[v+1]=e.readInt32BE(4*v+4);for(;v<160;v+=2){var b=t[v-30],w=t[v-30+1],I=Gamma0(b,w),x=Gamma0l(w,b),B=Gamma1(b=t[v-4],w=t[v-4+1]),k=Gamma1l(w,b),C=t[v-14],q=t[v-14+1],L=t[v-32],j=t[v-32+1],z=x+q|0,P=I+C+getCarry(z,x)|0;P=(P=P+B+getCarry(z=z+k|0,k)|0)+L+getCarry(z=z+j|0,j)|0,t[v]=P,t[v+1]=z}for(var D=0;D<160;D+=2){P=t[D],z=t[D+1];var U=maj(r,n,i),W=maj(l,h,p),K=sigma0(r,l),V=sigma0(l,r),$=sigma1(s,_),H=sigma1(_,s),Y=a[D],Z=a[D+1],J=Ch(s,u,c),ee=Ch(_,y,m),te=g+H|0,re=f+$+getCarry(te,g)|0;re=(re=(re=re+J+getCarry(te=te+ee|0,ee)|0)+Y+getCarry(te=te+Z|0,Z)|0)+P+getCarry(te=te+z|0,z)|0;var ne=V+W|0,ie=K+U+getCarry(ne,V)|0;f=c,g=m,c=u,m=y,u=s,y=_,s=o+re+getCarry(_=d+te|0,d)|0,o=i,d=p,i=n,p=h,n=r,h=l,r=re+ie+getCarry(l=te+ne|0,te)|0}this._al=this._al+l|0,this._bl=this._bl+h|0,this._cl=this._cl+p|0,this._dl=this._dl+d|0,this._el=this._el+_|0,this._fl=this._fl+y|0,this._gl=this._gl+m|0,this._hl=this._hl+g|0,this._ah=this._ah+r+getCarry(this._al,l)|0,this._bh=this._bh+n+getCarry(this._bl,h)|0,this._ch=this._ch+i+getCarry(this._cl,p)|0,this._dh=this._dh+o+getCarry(this._dl,d)|0,this._eh=this._eh+s+getCarry(this._el,_)|0,this._fh=this._fh+u+getCarry(this._fl,y)|0,this._gh=this._gh+c+getCarry(this._gl,m)|0,this._hh=this._hh+f+getCarry(this._hl,g)|0},Sha512.prototype._hash=function(){var e=o.allocUnsafe(64);function writeInt64BE(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),e},e.exports=Sha512},7666:(e,t,r)=>{var n=r(4851),i=r(953);function _extends(){var t;return e.exports=_extends=n?i(t=n).call(t):function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,_extends.apply(this,arguments)}e.exports=_extends,e.exports.__esModule=!0,e.exports.default=e.exports},3700:(e,t,r)=>{\"use strict\";var n=r(9709);e.exports=n},462:(e,t,r)=>{\"use strict\";var n=r(975);e.exports=n},2567:(e,t,r)=>{\"use strict\";r(9307);var n=r(1747);e.exports=n(\"Function\",\"bind\")},3034:(e,t,r)=>{\"use strict\";var n=r(8280),i=r(2567),o=Function.prototype;e.exports=function(e){var t=e.bind;return e===o||n(o,e)&&t===o.bind?i:t}},9748:(e,t,r)=>{\"use strict\";r(1340);var n=r(2046);e.exports=n.Object.assign},953:(e,t,r)=>{\"use strict\";e.exports=r(3375)},4851:(e,t,r)=>{\"use strict\";e.exports=r(5401)},3375:(e,t,r)=>{\"use strict\";var n=r(3700);e.exports=n},5401:(e,t,r)=>{\"use strict\";var n=r(462);e.exports=n},2159:(e,t,r)=>{\"use strict\";var n=r(2250),i=r(4640),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(i(e)+\" is not a function\")}},6624:(e,t,r)=>{\"use strict\";var n=r(6285),i=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(i(e)+\" is not an object\")}},4436:(e,t,r)=>{\"use strict\";var n=r(7374),i=r(4849),o=r(575),createMethod=function(e){return function(t,r,a){var s=n(t),u=o(s);if(0===u)return!e&&-1;var c,f=i(a,u);if(e&&r!=r){for(;u>f;)if((c=s[f++])!=c)return!0}else for(;u>f;f++)if((e||f in s)&&s[f]===r)return e||f||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},3427:(e,t,r)=>{\"use strict\";var n=r(1907);e.exports=n([].slice)},5807:(e,t,r)=>{\"use strict\";var n=r(1907),i=n({}.toString),o=n(\"\".slice);e.exports=function(e){return o(i(e),8,-1)}},1626:(e,t,r)=>{\"use strict\";var n=r(9447),i=r(4284),o=r(5817);e.exports=n?function(e,t,r){return i.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},5817:e=>{\"use strict\";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},2532:(e,t,r)=>{\"use strict\";var n=r(1010),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},9447:(e,t,r)=>{\"use strict\";var n=r(8828);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9552:(e,t,r)=>{\"use strict\";var n=r(1010),i=r(6285),o=n.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},4723:e=>{\"use strict\";e.exports=\"undefined\"!=typeof navigator&&String(navigator.userAgent)||\"\"},5683:(e,t,r)=>{\"use strict\";var n,i,o=r(1010),a=r(4723),s=o.process,u=o.Deno,c=s&&s.versions||u&&u.version,f=c&&c.v8;f&&(i=(n=f.split(\".\"))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(!(n=a.match(/Edge\\/(\\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\\/(\\d+)/))&&(i=+n[1]),e.exports=i},376:e=>{\"use strict\";e.exports=[\"constructor\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toLocaleString\",\"toString\",\"valueOf\"]},1091:(e,t,r)=>{\"use strict\";var n=r(1010),i=r(6024),o=r(2361),a=r(2250),s=r(3846).f,u=r(7463),c=r(2046),f=r(8311),l=r(1626),h=r(9724);r(6128);var wrapConstructor=function(e){var Wrapper=function(t,r,n){if(this instanceof Wrapper){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return i(e,this,arguments)};return Wrapper.prototype=e.prototype,Wrapper};e.exports=function(e,t){var r,i,p,d,_,y,m,g,v,b=e.target,w=e.global,I=e.stat,x=e.proto,B=w?n:I?n[b]:n[b]&&n[b].prototype,k=w?c:c[b]||l(c,b,{})[b],C=k.prototype;for(d in t)i=!(r=u(w?d:b+(I?\".\":\"#\")+d,e.forced))&&B&&h(B,d),y=k[d],i&&(m=e.dontCallGetSet?(v=s(B,d))&&v.value:B[d]),_=i&&m?m:t[d],(r||x||typeof y!=typeof _)&&(g=e.bind&&i?f(_,n):e.wrap&&i?wrapConstructor(_):x&&a(_)?o(_):_,(e.sham||_&&_.sham||y&&y.sham)&&l(g,\"sham\",!0),l(k,d,g),x&&(h(c,p=b+\"Prototype\")||l(c,p,{}),l(c[p],d,_),e.real&&C&&(r||!C[d])&&l(C,d,_)))}},8828:e=>{\"use strict\";e.exports=function(e){try{return!!e()}catch(e){return!0}}},6024:(e,t,r)=>{\"use strict\";var n=r(1505),i=Function.prototype,o=i.apply,a=i.call;e.exports=\"object\"==typeof Reflect&&Reflect.apply||(n?a.bind(o):function(){return a.apply(o,arguments)})},8311:(e,t,r)=>{\"use strict\";var n=r(2361),i=r(2159),o=r(1505),a=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},1505:(e,t,r)=>{\"use strict\";var n=r(8828);e.exports=!n((function(){var e=function(){}.bind();return\"function\"!=typeof e||e.hasOwnProperty(\"prototype\")}))},4673:(e,t,r)=>{\"use strict\";var n=r(1907),i=r(2159),o=r(6285),a=r(9724),s=r(3427),u=r(1505),c=Function,f=n([].concat),l=n([].join),h={};e.exports=u?c.bind:function bind(e){var t=i(this),r=t.prototype,n=s(arguments,1),u=function bound(){var r=f(n,s(arguments));return this instanceof u?function(e,t,r){if(!a(h,t)){for(var n=[],i=0;i<t;i++)n[i]=\"a[\"+i+\"]\";h[t]=c(\"C,a\",\"return new C(\"+l(n,\",\")+\")\")}return h[t](e,r)}(t,r.length,r):t.apply(e,r)};return o(r)&&(u.prototype=r),u}},3930:(e,t,r)=>{\"use strict\";var n=r(1505),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},2361:(e,t,r)=>{\"use strict\";var n=r(5807),i=r(1907);e.exports=function(e){if(\"Function\"===n(e))return i(e)}},1907:(e,t,r)=>{\"use strict\";var n=r(1505),i=Function.prototype,o=i.call,a=n&&i.bind.bind(o,o);e.exports=n?a:function(e){return function(){return o.apply(e,arguments)}}},1747:(e,t,r)=>{\"use strict\";var n=r(1010),i=r(2046);e.exports=function(e,t){var r=i[e+\"Prototype\"],o=r&&r[t];if(o)return o;var a=n[e],s=a&&a.prototype;return s&&s[t]}},5582:(e,t,r)=>{\"use strict\";var n=r(2046),i=r(1010),o=r(2250),aFunction=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?aFunction(n[e])||aFunction(i[e]):n[e]&&n[e][t]||i[e]&&i[e][t]}},9367:(e,t,r)=>{\"use strict\";var n=r(2159),i=r(7136);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},1010:function(e,t,r){\"use strict\";var check=function(e){return e&&e.Math===Math&&e};e.exports=check(\"object\"==typeof globalThis&&globalThis)||check(\"object\"==typeof window&&window)||check(\"object\"==typeof self&&self)||check(\"object\"==typeof r.g&&r.g)||check(\"object\"==typeof this&&this)||function(){return this}()||Function(\"return this\")()},9724:(e,t,r)=>{\"use strict\";var n=r(1907),i=r(9298),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return o(i(e),t)}},8530:e=>{\"use strict\";e.exports={}},3648:(e,t,r)=>{\"use strict\";var n=r(9447),i=r(8828),o=r(9552);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(o(\"div\"),\"a\",{get:function(){return 7}}).a}))},6946:(e,t,r)=>{\"use strict\";var n=r(1907),i=r(8828),o=r(5807),a=Object,s=n(\"\".split);e.exports=i((function(){return!a(\"z\").propertyIsEnumerable(0)}))?function(e){return\"String\"===o(e)?s(e,\"\"):a(e)}:a},2250:e=>{\"use strict\";var t=\"object\"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return\"function\"==typeof e||e===t}:function(e){return\"function\"==typeof e}},7463:(e,t,r)=>{\"use strict\";var n=r(8828),i=r(2250),o=/#|\\.prototype\\./,isForced=function(e,t){var r=s[a(e)];return r===c||r!==u&&(i(t)?n(t):!!t)},a=isForced.normalize=function(e){return String(e).replace(o,\".\").toLowerCase()},s=isForced.data={},u=isForced.NATIVE=\"N\",c=isForced.POLYFILL=\"P\";e.exports=isForced},7136:e=>{\"use strict\";e.exports=function(e){return null==e}},6285:(e,t,r)=>{\"use strict\";var n=r(2250);e.exports=function(e){return\"object\"==typeof e?null!==e:n(e)}},7376:e=>{\"use strict\";e.exports=!0},5594:(e,t,r)=>{\"use strict\";var n=r(5582),i=r(2250),o=r(8280),a=r(3556),s=Object;e.exports=a?function(e){return\"symbol\"==typeof e}:function(e){var t=n(\"Symbol\");return i(t)&&o(t.prototype,s(e))}},575:(e,t,r)=>{\"use strict\";var n=r(3121);e.exports=function(e){return n(e.length)}},1176:e=>{\"use strict\";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function trunc(e){var n=+e;return(n>0?r:t)(n)}},9538:(e,t,r)=>{\"use strict\";var n=r(9447),i=r(1907),o=r(3930),a=r(8828),s=r(2875),u=r(7170),c=r(2574),f=r(9298),l=r(6946),h=Object.assign,p=Object.defineProperty,d=i([].concat);e.exports=!h||a((function(){if(n&&1!==h({b:1},h(p({},\"a\",{enumerable:!0,get:function(){p(this,\"b\",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(\"assign detection\"),i=\"abcdefghijklmnopqrst\";return e[r]=7,i.split(\"\").forEach((function(e){t[e]=e})),7!==h({},e)[r]||s(h({},t)).join(\"\")!==i}))?function assign(e,t){for(var r=f(e),i=arguments.length,a=1,h=u.f,p=c.f;i>a;)for(var _,y=l(arguments[a++]),m=h?d(s(y),h(y)):s(y),g=m.length,v=0;g>v;)_=m[v++],n&&!o(p,y,_)||(r[_]=y[_]);return r}:h},4284:(e,t,r)=>{\"use strict\";var n=r(9447),i=r(3648),o=r(8661),a=r(6624),s=r(470),u=TypeError,c=Object.defineProperty,f=Object.getOwnPropertyDescriptor,l=\"enumerable\",h=\"configurable\",p=\"writable\";t.f=n?o?function defineProperty(e,t,r){if(a(e),t=s(t),a(r),\"function\"==typeof e&&\"prototype\"===t&&\"value\"in r&&p in r&&!r[p]){var n=f(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:l in r?r[l]:n[l],writable:!1})}return c(e,t,r)}:c:function defineProperty(e,t,r){if(a(e),t=s(t),a(r),i)try{return c(e,t,r)}catch(e){}if(\"get\"in r||\"set\"in r)throw new u(\"Accessors not supported\");return\"value\"in r&&(e[t]=r.value),e}},3846:(e,t,r)=>{\"use strict\";var n=r(9447),i=r(3930),o=r(2574),a=r(5817),s=r(7374),u=r(470),c=r(9724),f=r(3648),l=Object.getOwnPropertyDescriptor;t.f=n?l:function getOwnPropertyDescriptor(e,t){if(e=s(e),t=u(t),f)try{return l(e,t)}catch(e){}if(c(e,t))return a(!i(o.f,e,t),e[t])}},7170:(e,t)=>{\"use strict\";t.f=Object.getOwnPropertySymbols},8280:(e,t,r)=>{\"use strict\";var n=r(1907);e.exports=n({}.isPrototypeOf)},3045:(e,t,r)=>{\"use strict\";var n=r(1907),i=r(9724),o=r(7374),a=r(4436).indexOf,s=r(8530),u=n([].push);e.exports=function(e,t){var r,n=o(e),c=0,f=[];for(r in n)!i(s,r)&&i(n,r)&&u(f,r);for(;t.length>c;)i(n,r=t[c++])&&(~a(f,r)||u(f,r));return f}},2875:(e,t,r)=>{\"use strict\";var n=r(3045),i=r(376);e.exports=Object.keys||function keys(e){return n(e,i)}},2574:(e,t)=>{\"use strict\";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:r},581:(e,t,r)=>{\"use strict\";var n=r(3930),i=r(2250),o=r(6285),a=TypeError;e.exports=function(e,t){var r,s;if(\"string\"===t&&i(r=e.toString)&&!o(s=n(r,e)))return s;if(i(r=e.valueOf)&&!o(s=n(r,e)))return s;if(\"string\"!==t&&i(r=e.toString)&&!o(s=n(r,e)))return s;throw new a(\"Can't convert object to primitive value\")}},2046:e=>{\"use strict\";e.exports={}},4239:(e,t,r)=>{\"use strict\";var n=r(7136),i=TypeError;e.exports=function(e){if(n(e))throw new i(\"Can't call method on \"+e);return e}},6128:(e,t,r)=>{\"use strict\";var n=r(7376),i=r(1010),o=r(2532),a=\"__core-js_shared__\",s=e.exports=i[a]||o(a,{});(s.versions||(s.versions=[])).push({version:\"3.37.1\",mode:n?\"pure\":\"global\",copyright:\"© 2014-2024 Denis Pushkarev (zloirock.ru)\",license:\"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE\",source:\"https://github.com/zloirock/core-js\"})},5816:(e,t,r)=>{\"use strict\";var n=r(6128);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},9846:(e,t,r)=>{\"use strict\";var n=r(5683),i=r(8828),o=r(1010).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol(\"symbol detection\");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4849:(e,t,r)=>{\"use strict\";var n=r(5482),i=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):o(r,t)}},7374:(e,t,r)=>{\"use strict\";var n=r(6946),i=r(4239);e.exports=function(e){return n(i(e))}},5482:(e,t,r)=>{\"use strict\";var n=r(1176);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},3121:(e,t,r)=>{\"use strict\";var n=r(5482),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},9298:(e,t,r)=>{\"use strict\";var n=r(4239),i=Object;e.exports=function(e){return i(n(e))}},6028:(e,t,r)=>{\"use strict\";var n=r(3930),i=r(6285),o=r(5594),a=r(9367),s=r(581),u=r(6264),c=TypeError,f=u(\"toPrimitive\");e.exports=function(e,t){if(!i(e)||o(e))return e;var r,u=a(e,f);if(u){if(void 0===t&&(t=\"default\"),r=n(u,e,t),!i(r)||o(r))return r;throw new c(\"Can't convert object to primitive value\")}return void 0===t&&(t=\"number\"),s(e,t)}},470:(e,t,r)=>{\"use strict\";var n=r(6028),i=r(5594);e.exports=function(e){var t=n(e,\"string\");return i(t)?t:t+\"\"}},4640:e=>{\"use strict\";var t=String;e.exports=function(e){try{return t(e)}catch(e){return\"Object\"}}},6499:(e,t,r)=>{\"use strict\";var n=r(1907),i=0,o=Math.random(),a=n(1..toString);e.exports=function(e){return\"Symbol(\"+(void 0===e?\"\":e)+\")_\"+a(++i+o,36)}},3556:(e,t,r)=>{\"use strict\";var n=r(9846);e.exports=n&&!Symbol.sham&&\"symbol\"==typeof Symbol.iterator},8661:(e,t,r)=>{\"use strict\";var n=r(9447),i=r(8828);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),\"prototype\",{value:42,writable:!1}).prototype}))},6264:(e,t,r)=>{\"use strict\";var n=r(1010),i=r(5816),o=r(9724),a=r(6499),s=r(9846),u=r(3556),c=n.Symbol,f=i(\"wks\"),l=u?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){return o(f,e)||(f[e]=s&&o(c,e)?c[e]:l(\"Symbol.\"+e)),f[e]}},9307:(e,t,r)=>{\"use strict\";var n=r(1091),i=r(4673);n({target:\"Function\",proto:!0,forced:Function.bind!==i},{bind:i})},1340:(e,t,r)=>{\"use strict\";var n=r(1091),i=r(9538);n({target:\"Object\",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},9709:(e,t,r)=>{\"use strict\";var n=r(3034);e.exports=n},975:(e,t,r)=>{\"use strict\";var n=r(9748);e.exports=n}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{\"use strict\";__webpack_require__.d(r,{default:()=>Kt});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{TOGGLE_CONFIGS:()=>Tt,UPDATE_CONFIGS:()=>jt,downloadConfig:()=>downloadConfig,getConfigByUrl:()=>getConfigByUrl,loaded:()=>loaded,toggle:()=>toggle,update:()=>update});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{get:()=>get});var n=__webpack_require__(6540);class StandaloneLayout extends n.Component{render(){const{getComponent:e}=this.props,t=e(\"Container\"),r=e(\"Row\"),i=e(\"Col\"),o=e(\"Topbar\",!0),a=e(\"BaseLayout\",!0),s=e(\"onlineValidatorBadge\",!0);return n.createElement(t,{className:\"swagger-ui\"},o?n.createElement(o,null):null,n.createElement(a,null),n.createElement(r,null,n.createElement(i,null,n.createElement(s,null))))}}const i=StandaloneLayout,stadalone_layout=()=>({components:{StandaloneLayout:i}});var o=__webpack_require__(9404),a=__webpack_require__.n(o);__webpack_require__(6750),__webpack_require__(4058),__webpack_require__(5808),__webpack_require__(104),__webpack_require__(7309),__webpack_require__(2426),__webpack_require__(5288),__webpack_require__(1882),__webpack_require__(2205),__webpack_require__(3209),__webpack_require__(2802);const s=function makeWindow(){var e={location:{},history:{},open:()=>{},close:()=>{},File:function(){},FormData:function(){}};if(\"undefined\"==typeof window)return e;try{e=window;for(var t of[\"File\",\"Blob\",\"FormData\"])t in window&&(e[t]=window[t])}catch(e){console.error(e)}return e}();a().Set.of(\"type\",\"format\",\"items\",\"default\",\"maximum\",\"exclusiveMaximum\",\"minimum\",\"exclusiveMinimum\",\"maxLength\",\"minLength\",\"pattern\",\"maxItems\",\"minItems\",\"uniqueItems\",\"enum\",\"multipleOf\");__webpack_require__(8287).Buffer;const parseSearch=()=>{const e=new URLSearchParams(s.location.search);return Object.fromEntries(e)};class TopBar extends n.Component{constructor(e,t){super(e,t),this.state={url:e.specSelectors.url(),selectedIndex:0}}UNSAFE_componentWillReceiveProps(e){this.setState({url:e.specSelectors.url()})}onUrlChange=e=>{let{target:{value:t}}=e;this.setState({url:t})};flushAuthData(){const{persistAuthorization:e}=this.props.getConfigs();e||this.props.authActions.restoreAuthorization({authorized:{}})}loadSpec=e=>{this.flushAuthData(),this.props.specActions.updateUrl(e),this.props.specActions.download(e)};onUrlSelect=e=>{let t=e.target.value||e.target.href;this.loadSpec(t),this.setSelectedUrl(t),e.preventDefault()};downloadUrl=e=>{this.loadSpec(this.state.url),e.preventDefault()};setSearch=e=>{let t=parseSearch();t[\"urls.primaryName\"]=e.name;const r=`${window.location.protocol}//${window.location.host}${window.location.pathname}`;window&&window.history&&window.history.pushState&&window.history.replaceState(null,\"\",`${r}?${(e=>{const t=new URLSearchParams(Object.entries(e));return String(t)})(t)}`)};setSelectedUrl=e=>{const t=this.props.getConfigs().urls||[];t&&t.length&&e&&t.forEach(((t,r)=>{t.url===e&&(this.setState({selectedIndex:r}),this.setSearch(t))}))};componentDidMount(){const e=this.props.getConfigs(),t=e.urls||[];if(t&&t.length){var r=this.state.selectedIndex;let n=parseSearch()[\"urls.primaryName\"]||e.urls.primaryName;n&&t.forEach(((e,t)=>{e.name===n&&(this.setState({selectedIndex:t}),r=t)})),this.loadSpec(t[r].url)}}onFilterChange=e=>{let{target:{value:t}}=e;this.props.layoutActions.updateFilter(t)};render(){let{getComponent:e,specSelectors:t,getConfigs:r}=this.props;const i=e(\"Button\"),o=e(\"Link\"),a=e(\"Logo\");let s=\"loading\"===t.loadingStatus();const u=[\"download-url-input\"];\"failed\"===t.loadingStatus()&&u.push(\"failed\"),s&&u.push(\"loading\");const{urls:c}=r();let f=[],l=null;if(c){let e=[];c.forEach(((t,r)=>{e.push(n.createElement(\"option\",{key:r,value:t.url},t.name))})),f.push(n.createElement(\"label\",{className:\"select-label\",htmlFor:\"select\"},n.createElement(\"span\",null,\"Select a definition\"),n.createElement(\"select\",{id:\"select\",disabled:s,onChange:this.onUrlSelect,value:c[this.state.selectedIndex].url},e)))}else l=this.downloadUrl,f.push(n.createElement(\"input\",{className:u.join(\" \"),type:\"text\",onChange:this.onUrlChange,value:this.state.url,disabled:s,id:\"download-url-input\"})),f.push(n.createElement(i,{className:\"download-url-button\",onClick:this.downloadUrl},\"Explore\"));return n.createElement(\"div\",{className:\"topbar\"},n.createElement(\"div\",{className:\"wrapper\"},n.createElement(\"div\",{className:\"topbar-wrapper\"},n.createElement(o,null,n.createElement(a,null)),n.createElement(\"form\",{className:\"download-url-wrapper\",onSubmit:l},f.map(((e,t)=>(0,n.cloneElement)(e,{key:t})))))))}}const u=TopBar;var c,f,l,h,p,d,_,y,m,g,v,b,w,I,x,B,k,C,q,L,j,z,P,D,U,W,K,V,$,H,Y,Z;function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(this,arguments)}const logo_small=e=>n.createElement(\"svg\",_extends({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 407 116\"},e),c||(c=n.createElement(\"defs\",null,n.createElement(\"clipPath\",{id:\"logo_small_svg__clip-SW_TM-logo-on-dark\"},n.createElement(\"path\",{d:\"M0 0h407v116H0z\"})),n.createElement(\"style\",null,\".logo_small_svg__cls-2{fill:#fff}.logo_small_svg__cls-3{fill:#85ea2d}\"))),n.createElement(\"g\",{id:\"logo_small_svg__SW_TM-logo-on-dark\",style:{clipPath:\"url(#logo_small_svg__clip-SW_TM-logo-on-dark)\"}},n.createElement(\"g\",{id:\"logo_small_svg__SW_In-Product\",transform:\"translate(-.301)\"},f||(f=n.createElement(\"path\",{id:\"logo_small_svg__Path_2936\",d:\"M359.15 70.674h-.7v-3.682h-1.26v-.6h3.219v.6h-1.259Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2936\"})),l||(l=n.createElement(\"path\",{id:\"logo_small_svg__Path_2937\",d:\"m363.217 70.674-1.242-3.574h-.023q.05.8.05 1.494v2.083h-.636v-4.286h.987l1.19 3.407h.017l1.225-3.407h.99v4.283h-.675v-2.118a30 30 0 0 1 .044-1.453h-.023l-1.286 3.571Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2937\"})),h||(h=n.createElement(\"path\",{id:\"logo_small_svg__Path_2938\",d:\"M50.328 97.669a47.642 47.642 0 1 1 47.643-47.642 47.64 47.64 0 0 1-47.643 47.642\",className:\"logo_small_svg__cls-3\",\"data-name\":\"Path 2938\"})),p||(p=n.createElement(\"path\",{id:\"logo_small_svg__Path_2939\",d:\"M50.328 4.769A45.258 45.258 0 1 1 5.07 50.027 45.26 45.26 0 0 1 50.328 4.769m0-4.769a50.027 50.027 0 1 0 50.027 50.027A50.027 50.027 0 0 0 50.328 0\",className:\"logo_small_svg__cls-3\",\"data-name\":\"Path 2939\"})),n.createElement(\"path\",{id:\"logo_small_svg__Path_2940\",d:\"M31.8 33.854c-.154 1.712.058 3.482-.057 5.213a43 43 0 0 1-.693 5.156 9.53 9.53 0 0 1-4.1 5.829c4.079 2.654 4.54 6.771 4.81 10.946.135 2.25.077 4.52.308 6.752.173 1.731.846 2.174 2.636 2.231.73.02 1.48 0 2.327 0v5.349c-5.29.9-9.657-.6-10.734-5.079a31 31 0 0 1-.654-5c-.117-1.789.076-3.578-.058-5.367-.386-4.906-1.02-6.56-5.713-6.791v-6.1a9 9 0 0 1 1.028-.173c2.577-.135 3.674-.924 4.231-3.463a29 29 0 0 0 .481-4.329 82 82 0 0 1 .6-8.406c.673-3.982 3.136-5.906 7.234-6.137 1.154-.057 2.327 0 3.655 0v5.464c-.558.038-1.039.115-1.539.115-3.336-.115-3.51 1.02-3.762 3.79m6.406 12.658h-.077a3.515 3.515 0 1 0-.346 7.021h.231a3.46 3.46 0 0 0 3.655-3.251v-.192a3.523 3.523 0 0 0-3.461-3.578Zm12.062 0a3.373 3.373 0 0 0-3.482 3.251 2 2 0 0 0 .02.327 3.3 3.3 0 0 0 3.578 3.443 3.263 3.263 0 0 0 3.443-3.558 3.308 3.308 0 0 0-3.557-3.463Zm12.351 0a3.59 3.59 0 0 0-3.655 3.482 3.53 3.53 0 0 0 3.536 3.539h.039c1.769.309 3.559-1.4 3.674-3.462a3.57 3.57 0 0 0-3.6-3.559Zm16.948.288c-2.232-.1-3.348-.846-3.9-2.962a21.5 21.5 0 0 1-.635-4.136c-.154-2.578-.135-5.175-.308-7.753-.4-6.117-4.828-8.252-11.254-7.195v5.31c1.019 0 1.808 0 2.6.019 1.366.019 2.4.539 2.539 2.059.135 1.385.135 2.789.27 4.193.269 2.79.422 5.618.9 8.369a8.72 8.72 0 0 0 3.921 5.348c-3.4 2.289-4.406 5.559-4.578 9.234-.1 2.52-.154 5.059-.289 7.6-.115 2.308-.923 3.058-3.251 3.116-.654.019-1.289.077-2.019.115v5.445c1.365 0 2.616.077 3.866 0 3.886-.231 6.233-2.117 7-5.887A49 49 0 0 0 75 63.4c.135-1.923.116-3.866.308-5.771.289-2.982 1.655-4.213 4.636-4.4a4 4 0 0 0 .828-.192v-6.1c-.5-.058-.843-.115-1.208-.135Z\",\"data-name\":\"Path 2940\",style:{fill:\"#173647\"}}),d||(d=n.createElement(\"path\",{id:\"logo_small_svg__Path_2941\",d:\"M152.273 58.122a11.23 11.23 0 0 1-4.384 9.424q-4.383 3.382-11.9 3.382-8.14 0-12.524-2.1V63.7a33 33 0 0 0 6.137 1.879 32.3 32.3 0 0 0 6.575.689q5.322 0 8.015-2.02a6.63 6.63 0 0 0 2.692-5.62 7.2 7.2 0 0 0-.954-3.9 8.9 8.9 0 0 0-3.194-2.8 44.6 44.6 0 0 0-6.81-2.911q-6.387-2.286-9.126-5.417a11.96 11.96 0 0 1-2.74-8.172A10.16 10.16 0 0 1 128.039 27q3.977-3.131 10.52-3.131a31 31 0 0 1 12.555 2.5L149.455 31a28.4 28.4 0 0 0-11.021-2.38 10.67 10.67 0 0 0-6.606 1.816 5.98 5.98 0 0 0-2.38 5.041 7.7 7.7 0 0 0 .877 3.9 8.24 8.24 0 0 0 2.959 2.786 36.7 36.7 0 0 0 6.371 2.8q7.2 2.566 9.91 5.51a10.84 10.84 0 0 1 2.708 7.649\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2941\"})),_||(_=n.createElement(\"path\",{id:\"logo_small_svg__Path_2942\",d:\"M185.288 70.3 179 50.17q-.594-1.848-2.222-8.391h-.251q-1.252 5.479-2.192 8.453L167.849 70.3h-6.011l-9.361-34.315h5.447q3.318 12.931 5.057 19.693a80 80 0 0 1 1.988 9.111h.25q.345-1.785 1.112-4.618t1.33-4.493l6.294-19.693h5.635l6.137 19.693a66 66 0 0 1 2.379 9.048h.251a33 33 0 0 1 .673-3.475q.548-2.347 6.528-25.266h5.385L191.456 70.3Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2942\"})),y||(y=n.createElement(\"path\",{id:\"logo_small_svg__Path_2943\",d:\"m225.115 70.3-1.033-4.885h-.25a14.45 14.45 0 0 1-5.119 4.368 15.6 15.6 0 0 1-6.372 1.143q-5.1 0-8-2.63t-2.9-7.483q0-10.4 16.626-10.9l5.823-.188V47.6q0-4.038-1.738-5.964t-5.552-1.923a22.6 22.6 0 0 0-9.706 2.63l-1.6-3.977a24.4 24.4 0 0 1 5.557-2.16 24 24 0 0 1 6.058-.783q6.136 0 9.1 2.724t2.959 8.735V70.3Zm-11.741-3.663a10.55 10.55 0 0 0 7.626-2.66 9.85 9.85 0 0 0 2.771-7.451v-3.1l-5.2.219q-6.2.219-8.939 1.926a5.8 5.8 0 0 0-2.74 5.306 5.35 5.35 0 0 0 1.707 4.29 7.08 7.08 0 0 0 4.775 1.472Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2943\"})),m||(m=n.createElement(\"path\",{id:\"logo_small_svg__Path_2944\",d:\"M264.6 35.987v3.287l-6.356.752a11.16 11.16 0 0 1 2.255 6.856 10.15 10.15 0 0 1-3.444 8.047q-3.444 3-9.456 3a15.7 15.7 0 0 1-2.88-.25Q241.4 59.438 241.4 62.1a2.24 2.24 0 0 0 1.159 2.082 8.46 8.46 0 0 0 3.976.673h6.074q5.573 0 8.563 2.348a8.16 8.16 0 0 1 2.99 6.825 9.74 9.74 0 0 1-4.571 8.688q-4.572 2.989-13.338 2.99-6.732 0-10.379-2.5a8.09 8.09 0 0 1-3.647-7.076 7.95 7.95 0 0 1 2-5.417 10.2 10.2 0 0 1 5.636-3.1 5.43 5.43 0 0 1-2.207-1.847 4.9 4.9 0 0 1-.893-2.912 5.53 5.53 0 0 1 1-3.288 10.5 10.5 0 0 1 3.162-2.723 9.28 9.28 0 0 1-4.336-3.726 10.95 10.95 0 0 1-1.675-6.012q0-5.634 3.382-8.688t9.58-3.052a17.4 17.4 0 0 1 4.853.626Zm-27.367 40.075a4.66 4.66 0 0 0 2.348 4.227 12.97 12.97 0 0 0 6.732 1.44q6.543 0 9.69-1.956a5.99 5.99 0 0 0 3.147-5.307q0-2.787-1.723-3.867t-6.481-1.08h-6.23a8.2 8.2 0 0 0-5.51 1.69 6.04 6.04 0 0 0-1.973 4.853m2.818-29.086a6.98 6.98 0 0 0 2.035 5.448 8.12 8.12 0 0 0 5.667 1.847q7.608 0 7.608-7.389 0-7.733-7.7-7.733a7.63 7.63 0 0 0-5.635 1.972q-1.976 1.973-1.975 5.855\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2944\"})),g||(g=n.createElement(\"path\",{id:\"logo_small_svg__Path_2945\",d:\"M299.136 35.987v3.287l-6.356.752a11.17 11.17 0 0 1 2.254 6.856 10.15 10.15 0 0 1-3.444 8.047q-3.444 3-9.455 3a15.7 15.7 0 0 1-2.88-.25q-3.32 1.754-3.319 4.415a2.24 2.24 0 0 0 1.158 2.082 8.46 8.46 0 0 0 3.976.673h6.074q5.574 0 8.563 2.348a8.16 8.16 0 0 1 2.99 6.825 9.74 9.74 0 0 1-4.571 8.688q-4.57 2.989-13.337 2.99-6.732 0-10.379-2.5a8.09 8.09 0 0 1-3.648-7.076 7.95 7.95 0 0 1 2-5.417 10.2 10.2 0 0 1 5.636-3.1 5.43 5.43 0 0 1-2.208-1.847 4.9 4.9 0 0 1-.892-2.912 5.53 5.53 0 0 1 1-3.288 10.5 10.5 0 0 1 3.162-2.723 9.27 9.27 0 0 1-4.336-3.726 10.95 10.95 0 0 1-1.675-6.012q0-5.634 3.381-8.688t9.581-3.052a17.4 17.4 0 0 1 4.853.626Zm-27.364 40.075a4.66 4.66 0 0 0 2.348 4.227 12.97 12.97 0 0 0 6.731 1.44q6.544 0 9.691-1.956a5.99 5.99 0 0 0 3.146-5.307q0-2.787-1.722-3.867t-6.481-1.08h-6.23a8.2 8.2 0 0 0-5.511 1.69 6.04 6.04 0 0 0-1.972 4.853m2.818-29.086a6.98 6.98 0 0 0 2.035 5.448 8.12 8.12 0 0 0 5.667 1.847q7.607 0 7.608-7.389 0-7.733-7.7-7.733a7.63 7.63 0 0 0-5.635 1.972q-1.975 1.973-1.975 5.855\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2945\"})),v||(v=n.createElement(\"path\",{id:\"logo_small_svg__Path_2946\",d:\"M316.778 70.928q-7.608 0-12.007-4.634t-4.4-12.868q0-8.3 4.086-13.181a13.57 13.57 0 0 1 10.974-4.884 12.94 12.94 0 0 1 10.207 4.239q3.762 4.247 3.762 11.2v3.287h-23.643q.156 6.044 3.053 9.174t8.156 3.131a27.6 27.6 0 0 0 10.958-2.317v4.634a27.5 27.5 0 0 1-5.213 1.706 29.3 29.3 0 0 1-5.933.513m-1.409-31.215a8.49 8.49 0 0 0-6.591 2.692 12.4 12.4 0 0 0-2.9 7.452h17.94q0-4.916-2.191-7.53a7.71 7.71 0 0 0-6.258-2.614\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2946\"})),b||(b=n.createElement(\"path\",{id:\"logo_small_svg__Path_2947\",d:\"M350.9 35.361a20.4 20.4 0 0 1 4.1.375l-.721 4.822a17.7 17.7 0 0 0-3.757-.47 9.14 9.14 0 0 0-7.122 3.382 12.33 12.33 0 0 0-2.959 8.422V70.3h-5.2V35.987h4.29l.6 6.356h.25a15.1 15.1 0 0 1 4.6-5.166 10.36 10.36 0 0 1 5.919-1.816\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2947\"})),w||(w=n.createElement(\"path\",{id:\"logo_small_svg__Path_2948\",d:\"M255.857 96.638s-3.43-.391-4.85-.391c-2.058 0-3.111.735-3.111 2.18 0 1.568.882 1.935 3.748 2.719 3.527.98 4.8 1.911 4.8 4.777 0 3.675-2.3 5.267-5.61 5.267a36 36 0 0 1-5.487-.662l.27-2.18s3.306.441 5.046.441c2.082 0 3.037-.931 3.037-2.7 0-1.421-.759-1.91-3.331-2.523-3.626-.93-5.193-2.033-5.193-4.948 0-3.381 2.229-4.776 5.585-4.776a37 37 0 0 1 5.315.587Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2948\"})),I||(I=n.createElement(\"path\",{id:\"logo_small_svg__Path_2949\",d:\"M262.967 94.14h4.733l3.748 13.106L275.2 94.14h4.752v16.78H277.2v-14.5h-.145l-4.191 13.816h-2.842l-4.191-13.816h-.145v14.5h-2.719Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2949\"})),x||(x=n.createElement(\"path\",{id:\"logo_small_svg__Path_2950\",d:\"M322.057 94.14H334.3v2.425h-4.728v14.355h-2.743V96.565h-4.777Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2950\"})),B||(B=n.createElement(\"path\",{id:\"logo_small_svg__Path_2951\",d:\"M346.137 94.14c3.332 0 5.12 1.249 5.12 4.361 0 2.033-.637 3.037-1.984 3.772 1.445.563 2.4 1.592 2.4 3.9 0 3.43-2.081 4.752-5.339 4.752h-6.566V94.14Zm-3.65 2.352v4.8h3.6c1.666 0 2.4-.832 2.4-2.474 0-1.617-.833-2.327-2.5-2.327Zm0 7.1v4.973h3.7c1.689 0 2.694-.539 2.694-2.548 0-1.911-1.421-2.425-2.744-2.425Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2951\"})),k||(k=n.createElement(\"path\",{id:\"logo_small_svg__Path_2952\",d:\"M358.414 94.14H369v2.377h-7.864v4.751h6.394v2.332h-6.394v4.924H369v2.4h-10.586Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2952\"})),C||(C=n.createElement(\"path\",{id:\"logo_small_svg__Path_2953\",d:\"M378.747 94.14h5.414l4.164 16.78h-2.744l-1.239-4.92h-5.777l-1.239 4.923h-2.719Zm.361 9.456h4.708l-1.737-7.178h-1.225Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2953\"})),q||(q=n.createElement(\"path\",{id:\"logo_small_svg__Path_2954\",d:\"M397.1 105.947v4.973h-2.719V94.14h6.37c3.7 0 5.683 2.12 5.683 5.843 0 2.376-.956 4.519-2.744 5.352l2.769 5.585h-2.989l-2.426-4.973Zm3.651-9.455H397.1v7.1h3.7c2.057 0 2.841-1.85 2.841-3.589 0-1.9-.934-3.511-2.894-3.511Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2954\"})),L||(L=n.createElement(\"path\",{id:\"logo_small_svg__Path_2955\",d:\"M290.013 94.14h5.413l4.164 16.78h-2.743l-1.239-4.92h-5.777l-1.239 4.923h-2.719Zm.361 9.456h4.707l-1.737-7.178h-1.225Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2955\"})),j||(j=n.createElement(\"path\",{id:\"logo_small_svg__Path_2956\",d:\"M308.362 105.947v4.973h-2.719V94.14h6.369c3.7 0 5.683 2.12 5.683 5.843 0 2.376-.955 4.519-2.743 5.352l2.768 5.585h-2.989l-2.425-4.973Zm3.65-9.455h-3.65v7.1h3.7c2.058 0 2.841-1.85 2.841-3.589-.003-1.903-.931-3.511-2.891-3.511\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2956\"})),z||(z=n.createElement(\"path\",{id:\"logo_small_svg__Path_2957\",d:\"M130.606 107.643a3.02 3.02 0 0 1-1.18 2.537 5.1 5.1 0 0 1-3.2.91 8 8 0 0 1-3.371-.564v-1.383a9 9 0 0 0 1.652.506 8.7 8.7 0 0 0 1.77.186 3.57 3.57 0 0 0 2.157-.544 1.78 1.78 0 0 0 .725-1.512 1.95 1.95 0 0 0-.257-1.05 2.4 2.4 0 0 0-.86-.754 12 12 0 0 0-1.833-.784 5.84 5.84 0 0 1-2.456-1.458 3.2 3.2 0 0 1-.738-2.2 2.74 2.74 0 0 1 1.071-2.267 4.44 4.44 0 0 1 2.831-.843 8.3 8.3 0 0 1 3.38.675l-.447 1.247a7.6 7.6 0 0 0-2.966-.641 2.88 2.88 0 0 0-1.779.489 1.61 1.61 0 0 0-.64 1.357 2.1 2.1 0 0 0 .236 1.049 2.2 2.2 0 0 0 .8.75 10 10 0 0 0 1.715.754 6.8 6.8 0 0 1 2.667 1.483 2.92 2.92 0 0 1 .723 2.057\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2957\"})),P||(P=n.createElement(\"path\",{id:\"logo_small_svg__Path_2958\",d:\"M134.447 101.686v5.991a2.4 2.4 0 0 0 .515 1.686 2.1 2.1 0 0 0 1.609.556 2.63 2.63 0 0 0 2.12-.792 4 4 0 0 0 .67-2.587v-4.854h1.4v9.236H139.6l-.2-1.239h-.075a2.8 2.8 0 0 1-1.193 1.045 4 4 0 0 1-1.74.362 3.53 3.53 0 0 1-2.524-.8 3.4 3.4 0 0 1-.839-2.562v-6.042Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2958\"})),D||(D=n.createElement(\"path\",{id:\"logo_small_svg__Path_2959\",d:\"M148.206 111.09a4 4 0 0 1-1.647-.333 3.1 3.1 0 0 1-1.252-1.023h-.1a12 12 0 0 1 .1 1.533v3.8h-1.4v-13.381h1.137l.194 1.264h.067a3.26 3.26 0 0 1 1.256-1.1 3.8 3.8 0 0 1 1.643-.337 3.41 3.41 0 0 1 2.836 1.256 6.68 6.68 0 0 1-.017 7.057 3.42 3.42 0 0 1-2.817 1.264m-.2-8.385a2.48 2.48 0 0 0-2.048.784 4.04 4.04 0 0 0-.649 2.494v.312a4.63 4.63 0 0 0 .649 2.785 2.47 2.47 0 0 0 2.082.839 2.16 2.16 0 0 0 1.875-.969 4.6 4.6 0 0 0 .678-2.671 4.43 4.43 0 0 0-.678-2.651 2.23 2.23 0 0 0-1.915-.923Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2959\"})),U||(U=n.createElement(\"path\",{id:\"logo_small_svg__Path_2960\",d:\"M159.039 111.09a4 4 0 0 1-1.647-.333 3.1 3.1 0 0 1-1.252-1.023h-.1a12 12 0 0 1 .1 1.533v3.8h-1.4v-13.381h1.137l.194 1.264h.067a3.26 3.26 0 0 1 1.256-1.1 3.8 3.8 0 0 1 1.643-.337 3.41 3.41 0 0 1 2.836 1.256 6.68 6.68 0 0 1-.017 7.057 3.42 3.42 0 0 1-2.817 1.264m-.2-8.385a2.48 2.48 0 0 0-2.048.784 4.04 4.04 0 0 0-.649 2.494v.312a4.63 4.63 0 0 0 .649 2.785 2.47 2.47 0 0 0 2.082.839 2.16 2.16 0 0 0 1.875-.969 4.6 4.6 0 0 0 .678-2.671 4.43 4.43 0 0 0-.678-2.651 2.23 2.23 0 0 0-1.911-.923Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2960\"})),W||(W=n.createElement(\"path\",{id:\"logo_small_svg__Path_2961\",d:\"M173.612 106.3a5.1 5.1 0 0 1-1.137 3.527 4 4 0 0 1-3.143 1.268 4.17 4.17 0 0 1-2.2-.581 3.84 3.84 0 0 1-1.483-1.669 5.8 5.8 0 0 1-.522-2.545 5.1 5.1 0 0 1 1.129-3.518 4 4 0 0 1 3.135-1.26 3.9 3.9 0 0 1 3.08 1.29 5.07 5.07 0 0 1 1.141 3.488m-7.036 0a4.4 4.4 0 0 0 .708 2.7 2.81 2.81 0 0 0 4.167 0 4.37 4.37 0 0 0 .712-2.7 4.3 4.3 0 0 0-.712-2.675 2.5 2.5 0 0 0-2.1-.915 2.46 2.46 0 0 0-2.072.9 4.33 4.33 0 0 0-.7 2.69Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2961\"})),K||(K=n.createElement(\"path\",{id:\"logo_small_svg__Path_2962\",d:\"M180.525 101.517a5.5 5.5 0 0 1 1.1.1l-.194 1.3a4.8 4.8 0 0 0-1.011-.127 2.46 2.46 0 0 0-1.917.911 3.32 3.32 0 0 0-.8 2.267v4.955h-1.4v-9.236h1.154l.16 1.71h.068a4.05 4.05 0 0 1 1.238-1.39 2.8 2.8 0 0 1 1.6-.49Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2962\"})),V||(V=n.createElement(\"path\",{id:\"logo_small_svg__Path_2963\",d:\"M187.363 109.936a4.5 4.5 0 0 0 .716-.055 4 4 0 0 0 .548-.114v1.07a2.5 2.5 0 0 1-.67.181 5 5 0 0 1-.8.072q-2.68 0-2.68-2.823v-5.494h-1.323v-.673l1.323-.582.59-1.972h.809v2.141h2.68v1.087h-2.68v5.435a1.87 1.87 0 0 0 .4 1.281 1.38 1.38 0 0 0 1.087.446\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2963\"})),$||($=n.createElement(\"path\",{id:\"logo_small_svg__Path_2964\",d:\"M194.538 111.09a4.24 4.24 0 0 1-3.231-1.247 4.82 4.82 0 0 1-1.184-3.463 5.36 5.36 0 0 1 1.1-3.548 3.65 3.65 0 0 1 2.954-1.315 3.48 3.48 0 0 1 2.747 1.142 4.38 4.38 0 0 1 1.011 3.013v.885h-6.362a3.66 3.66 0 0 0 .822 2.469 2.84 2.84 0 0 0 2.2.843 7.4 7.4 0 0 0 2.949-.624v1.247a7.4 7.4 0 0 1-1.4.459 8 8 0 0 1-1.6.139Zm-.379-8.4a2.29 2.29 0 0 0-1.774.725 3.34 3.34 0 0 0-.779 2.006h4.828a3.07 3.07 0 0 0-.59-2.027 2.08 2.08 0 0 0-1.685-.706Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2964\"})),H||(H=n.createElement(\"path\",{id:\"logo_small_svg__Path_2965\",d:\"M206.951 109.683h-.076a3.29 3.29 0 0 1-2.9 1.407 3.43 3.43 0 0 1-2.819-1.239 5.45 5.45 0 0 1-1.006-3.522 5.54 5.54 0 0 1 1.011-3.548 3.4 3.4 0 0 1 2.814-1.264 3.36 3.36 0 0 1 2.883 1.365h.109l-.059-.665-.034-.649v-3.759h1.4v13.113h-1.138Zm-2.8.236a2.55 2.55 0 0 0 2.078-.779 3.95 3.95 0 0 0 .644-2.516v-.3a4.64 4.64 0 0 0-.653-2.8 2.48 2.48 0 0 0-2.086-.839 2.14 2.14 0 0 0-1.883.957 4.76 4.76 0 0 0-.653 2.7 4.55 4.55 0 0 0 .649 2.671 2.2 2.2 0 0 0 1.906.906Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2965\"})),Y||(Y=n.createElement(\"path\",{id:\"logo_small_svg__Path_2966\",d:\"M220.712 101.534a3.44 3.44 0 0 1 2.827 1.243 6.65 6.65 0 0 1-.009 7.053 3.42 3.42 0 0 1-2.818 1.26 4 4 0 0 1-1.648-.333 3.1 3.1 0 0 1-1.251-1.023h-.1l-.295 1.188h-1V97.809h1.4V101q0 1.069-.068 1.921h.068a3.32 3.32 0 0 1 2.894-1.387m-.2 1.171a2.44 2.44 0 0 0-2.064.822 6.34 6.34 0 0 0 .017 5.553 2.46 2.46 0 0 0 2.081.839 2.16 2.16 0 0 0 1.922-.94 4.83 4.83 0 0 0 .632-2.7 4.64 4.64 0 0 0-.632-2.689 2.24 2.24 0 0 0-1.959-.885Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2966\"})),Z||(Z=n.createElement(\"path\",{id:\"logo_small_svg__Path_2967\",d:\"M225.758 101.686h1.5l2.023 5.267a20 20 0 0 1 .826 2.6h.067q.109-.431.459-1.471t2.288-6.4h1.5l-3.969 10.518a5.25 5.25 0 0 1-1.378 2.212 2.93 2.93 0 0 1-1.934.653 5.7 5.7 0 0 1-1.264-.143V113.8a5 5 0 0 0 1.037.1 2.136 2.136 0 0 0 2.056-1.618l.514-1.314Z\",className:\"logo_small_svg__cls-2\",\"data-name\":\"Path 2967\"}))))),components_Logo=()=>n.createElement(logo_small,{height:\"40\"}),top_bar=()=>({components:{Topbar:u,Logo:components_Logo}});function isNothing(e){return null==e}var J={isNothing,isObject:function js_yaml_isObject(e){return\"object\"==typeof e&&null!==e},toArray:function toArray(e){return Array.isArray(e)?e:isNothing(e)?[]:[e]},repeat:function repeat(e,t){var r,n=\"\";for(r=0;r<t;r+=1)n+=e;return n},isNegativeZero:function isNegativeZero(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function extend(e,t){var r,n,i,o;if(t)for(r=0,n=(o=Object.keys(t)).length;r<n;r+=1)e[i=o[r]]=t[i];return e}};function formatError(e,t){var r=\"\",n=e.reason||\"(unknown reason)\";return e.mark?(e.mark.name&&(r+='in \"'+e.mark.name+'\" '),r+=\"(\"+(e.mark.line+1)+\":\"+(e.mark.column+1)+\")\",!t&&e.mark.snippet&&(r+=\"\\n\\n\"+e.mark.snippet),n+\" \"+r):n}function YAMLException$1(e,t){Error.call(this),this.name=\"YAMLException\",this.reason=e,this.mark=t,this.message=formatError(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||\"\"}YAMLException$1.prototype=Object.create(Error.prototype),YAMLException$1.prototype.constructor=YAMLException$1,YAMLException$1.prototype.toString=function toString(e){return this.name+\": \"+formatError(this,e)};var ee=YAMLException$1;function getLine(e,t,r,n,i){var o=\"\",a=\"\",s=Math.floor(i/2)-1;return n-t>s&&(t=n-s+(o=\" ... \").length),r-n>s&&(r=n+s-(a=\" ...\").length),{str:o+e.slice(t,r).replace(/\\t/g,\"→\")+a,pos:n-t+o.length}}function padStart(e,t){return J.repeat(\" \",t-e.length)+e}var te=function makeSnippet(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),\"number\"!=typeof t.indent&&(t.indent=1),\"number\"!=typeof t.linesBefore&&(t.linesBefore=3),\"number\"!=typeof t.linesAfter&&(t.linesAfter=2);for(var r,n=/\\r?\\n|\\r|\\0/g,i=[0],o=[],a=-1;r=n.exec(e.buffer);)o.push(r.index),i.push(r.index+r[0].length),e.position<=r.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var s,u,c=\"\",f=Math.min(e.line+t.linesAfter,o.length).toString().length,l=t.maxLength-(t.indent+f+3);for(s=1;s<=t.linesBefore&&!(a-s<0);s++)u=getLine(e.buffer,i[a-s],o[a-s],e.position-(i[a]-i[a-s]),l),c=J.repeat(\" \",t.indent)+padStart((e.line-s+1).toString(),f)+\" | \"+u.str+\"\\n\"+c;for(u=getLine(e.buffer,i[a],o[a],e.position,l),c+=J.repeat(\" \",t.indent)+padStart((e.line+1).toString(),f)+\" | \"+u.str+\"\\n\",c+=J.repeat(\"-\",t.indent+f+3+u.pos)+\"^\\n\",s=1;s<=t.linesAfter&&!(a+s>=o.length);s++)u=getLine(e.buffer,i[a+s],o[a+s],e.position-(i[a]-i[a+s]),l),c+=J.repeat(\" \",t.indent)+padStart((e.line+s+1).toString(),f)+\" | \"+u.str+\"\\n\";return c.replace(/\\n$/,\"\")},re=[\"kind\",\"multi\",\"resolve\",\"construct\",\"instanceOf\",\"predicate\",\"represent\",\"representName\",\"defaultStyle\",\"styleAliases\"],ne=[\"scalar\",\"sequence\",\"mapping\"];var ie=function Type$1(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===re.indexOf(t))throw new ee('Unknown option \"'+t+'\" is met in definition of \"'+e+'\" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function compileStyleAliases(e){var t={};return null!==e&&Object.keys(e).forEach((function(r){e[r].forEach((function(e){t[String(e)]=r}))})),t}(t.styleAliases||null),-1===ne.indexOf(this.kind))throw new ee('Unknown kind \"'+this.kind+'\" is specified for \"'+e+'\" YAML type.')};function compileList(e,t){var r=[];return e[t].forEach((function(e){var t=r.length;r.forEach((function(r,n){r.tag===e.tag&&r.kind===e.kind&&r.multi===e.multi&&(t=n)})),r[t]=e})),r}function Schema$1(e){return this.extend(e)}Schema$1.prototype.extend=function extend(e){var t=[],r=[];if(e instanceof ie)r.push(e);else if(Array.isArray(e))r=r.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new ee(\"Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })\");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof ie))throw new ee(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\");if(e.loadKind&&\"scalar\"!==e.loadKind)throw new ee(\"There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.\");if(e.multi)throw new ee(\"There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.\")})),r.forEach((function(e){if(!(e instanceof ie))throw new ee(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\")}));var n=Object.create(Schema$1.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(r),n.compiledImplicit=compileList(n,\"implicit\"),n.compiledExplicit=compileList(n,\"explicit\"),n.compiledTypeMap=function compileMap(){var e,t,r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function collectType(e){e.multi?(r.multi[e.kind].push(e),r.multi.fallback.push(e)):r[e.kind][e.tag]=r.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(collectType);return r}(n.compiledImplicit,n.compiledExplicit),n};var oe=Schema$1,ae=new ie(\"tag:yaml.org,2002:str\",{kind:\"scalar\",construct:function(e){return null!==e?e:\"\"}}),se=new ie(\"tag:yaml.org,2002:seq\",{kind:\"sequence\",construct:function(e){return null!==e?e:[]}}),ue=new ie(\"tag:yaml.org,2002:map\",{kind:\"mapping\",construct:function(e){return null!==e?e:{}}}),ce=new oe({explicit:[ae,se,ue]});var fe=new ie(\"tag:yaml.org,2002:null\",{kind:\"scalar\",resolve:function resolveYamlNull(e){if(null===e)return!0;var t=e.length;return 1===t&&\"~\"===e||4===t&&(\"null\"===e||\"Null\"===e||\"NULL\"===e)},construct:function constructYamlNull(){return null},predicate:function isNull(e){return null===e},represent:{canonical:function(){return\"~\"},lowercase:function(){return\"null\"},uppercase:function(){return\"NULL\"},camelcase:function(){return\"Null\"},empty:function(){return\"\"}},defaultStyle:\"lowercase\"});var le=new ie(\"tag:yaml.org,2002:bool\",{kind:\"scalar\",resolve:function resolveYamlBoolean(e){if(null===e)return!1;var t=e.length;return 4===t&&(\"true\"===e||\"True\"===e||\"TRUE\"===e)||5===t&&(\"false\"===e||\"False\"===e||\"FALSE\"===e)},construct:function constructYamlBoolean(e){return\"true\"===e||\"True\"===e||\"TRUE\"===e},predicate:function isBoolean(e){return\"[object Boolean]\"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?\"true\":\"false\"},uppercase:function(e){return e?\"TRUE\":\"FALSE\"},camelcase:function(e){return e?\"True\":\"False\"}},defaultStyle:\"lowercase\"});function isOctCode(e){return 48<=e&&e<=55}function isDecCode(e){return 48<=e&&e<=57}var he=new ie(\"tag:yaml.org,2002:int\",{kind:\"scalar\",resolve:function resolveYamlInteger(e){if(null===e)return!1;var t,r,n=e.length,i=0,o=!1;if(!n)return!1;if(\"-\"!==(t=e[i])&&\"+\"!==t||(t=e[++i]),\"0\"===t){if(i+1===n)return!0;if(\"b\"===(t=e[++i])){for(i++;i<n;i++)if(\"_\"!==(t=e[i])){if(\"0\"!==t&&\"1\"!==t)return!1;o=!0}return o&&\"_\"!==t}if(\"x\"===t){for(i++;i<n;i++)if(\"_\"!==(t=e[i])){if(!(48<=(r=e.charCodeAt(i))&&r<=57||65<=r&&r<=70||97<=r&&r<=102))return!1;o=!0}return o&&\"_\"!==t}if(\"o\"===t){for(i++;i<n;i++)if(\"_\"!==(t=e[i])){if(!isOctCode(e.charCodeAt(i)))return!1;o=!0}return o&&\"_\"!==t}}if(\"_\"===t)return!1;for(;i<n;i++)if(\"_\"!==(t=e[i])){if(!isDecCode(e.charCodeAt(i)))return!1;o=!0}return!(!o||\"_\"===t)},construct:function constructYamlInteger(e){var t,r=e,n=1;if(-1!==r.indexOf(\"_\")&&(r=r.replace(/_/g,\"\")),\"-\"!==(t=r[0])&&\"+\"!==t||(\"-\"===t&&(n=-1),t=(r=r.slice(1))[0]),\"0\"===r)return 0;if(\"0\"===t){if(\"b\"===r[1])return n*parseInt(r.slice(2),2);if(\"x\"===r[1])return n*parseInt(r.slice(2),16);if(\"o\"===r[1])return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)},predicate:function isInteger(e){return\"[object Number]\"===Object.prototype.toString.call(e)&&e%1==0&&!J.isNegativeZero(e)},represent:{binary:function(e){return e>=0?\"0b\"+e.toString(2):\"-0b\"+e.toString(2).slice(1)},octal:function(e){return e>=0?\"0o\"+e.toString(8):\"-0o\"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?\"0x\"+e.toString(16).toUpperCase():\"-0x\"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:\"decimal\",styleAliases:{binary:[2,\"bin\"],octal:[8,\"oct\"],decimal:[10,\"dec\"],hexadecimal:[16,\"hex\"]}}),pe=new RegExp(\"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))$\");var de=/^[-+]?[0-9]+e/;var _e=new ie(\"tag:yaml.org,2002:float\",{kind:\"scalar\",resolve:function resolveYamlFloat(e){return null!==e&&!(!pe.test(e)||\"_\"===e[e.length-1])},construct:function constructYamlFloat(e){var t,r;return r=\"-\"===(t=e.replace(/_/g,\"\").toLowerCase())[0]?-1:1,\"+-\".indexOf(t[0])>=0&&(t=t.slice(1)),\".inf\"===t?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:\".nan\"===t?NaN:r*parseFloat(t,10)},predicate:function isFloat(e){return\"[object Number]\"===Object.prototype.toString.call(e)&&(e%1!=0||J.isNegativeZero(e))},represent:function representYamlFloat(e,t){var r;if(isNaN(e))switch(t){case\"lowercase\":return\".nan\";case\"uppercase\":return\".NAN\";case\"camelcase\":return\".NaN\"}else if(Number.POSITIVE_INFINITY===e)switch(t){case\"lowercase\":return\".inf\";case\"uppercase\":return\".INF\";case\"camelcase\":return\".Inf\"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case\"lowercase\":return\"-.inf\";case\"uppercase\":return\"-.INF\";case\"camelcase\":return\"-.Inf\"}else if(J.isNegativeZero(e))return\"-0.0\";return r=e.toString(10),de.test(r)?r.replace(\"e\",\".e\"):r},defaultStyle:\"lowercase\"}),ye=ce.extend({implicit:[fe,le,he,_e]}),me=ye,ge=new RegExp(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$\"),ve=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]))?))?$\");var be=new ie(\"tag:yaml.org,2002:timestamp\",{kind:\"scalar\",resolve:function resolveYamlTimestamp(e){return null!==e&&(null!==ge.exec(e)||null!==ve.exec(e))},construct:function constructYamlTimestamp(e){var t,r,n,i,o,a,s,u,c=0,f=null;if(null===(t=ge.exec(e))&&(t=ve.exec(e)),null===t)throw new Error(\"Date resolve error\");if(r=+t[1],n=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,n,i));if(o=+t[4],a=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+=\"0\";c=+c}return t[9]&&(f=6e4*(60*+t[10]+ +(t[11]||0)),\"-\"===t[9]&&(f=-f)),u=new Date(Date.UTC(r,n,i,o,a,s,c)),f&&u.setTime(u.getTime()-f),u},instanceOf:Date,represent:function representYamlTimestamp(e){return e.toISOString()}});var Se=new ie(\"tag:yaml.org,2002:merge\",{kind:\"scalar\",resolve:function resolveYamlMerge(e){return\"<<\"===e||null===e}}),we=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r\";var Ie=new ie(\"tag:yaml.org,2002:binary\",{kind:\"scalar\",resolve:function resolveYamlBinary(e){if(null===e)return!1;var t,r,n=0,i=e.length,o=we;for(r=0;r<i;r++)if(!((t=o.indexOf(e.charAt(r)))>64)){if(t<0)return!1;n+=6}return n%8==0},construct:function constructYamlBinary(e){var t,r,n=e.replace(/[\\r\\n=]/g,\"\"),i=n.length,o=we,a=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(n.charAt(t));return 0===(r=i%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===r?(s.push(a>>10&255),s.push(a>>2&255)):12===r&&s.push(a>>4&255),new Uint8Array(s)},predicate:function isBinary(e){return\"[object Uint8Array]\"===Object.prototype.toString.call(e)},represent:function representYamlBinary(e){var t,r,n=\"\",i=0,o=e.length,a=we;for(t=0;t<o;t++)t%3==0&&t&&(n+=a[i>>18&63],n+=a[i>>12&63],n+=a[i>>6&63],n+=a[63&i]),i=(i<<8)+e[t];return 0===(r=o%3)?(n+=a[i>>18&63],n+=a[i>>12&63],n+=a[i>>6&63],n+=a[63&i]):2===r?(n+=a[i>>10&63],n+=a[i>>4&63],n+=a[i<<2&63],n+=a[64]):1===r&&(n+=a[i>>2&63],n+=a[i<<4&63],n+=a[64],n+=a[64]),n}}),xe=Object.prototype.hasOwnProperty,Ee=Object.prototype.toString;var Oe=new ie(\"tag:yaml.org,2002:omap\",{kind:\"sequence\",resolve:function resolveYamlOmap(e){if(null===e)return!0;var t,r,n,i,o,a=[],s=e;for(t=0,r=s.length;t<r;t+=1){if(n=s[t],o=!1,\"[object Object]\"!==Ee.call(n))return!1;for(i in n)if(xe.call(n,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==a.indexOf(i))return!1;a.push(i)}return!0},construct:function constructYamlOmap(e){return null!==e?e:[]}}),Be=Object.prototype.toString;var ke=new ie(\"tag:yaml.org,2002:pairs\",{kind:\"sequence\",resolve:function resolveYamlPairs(e){if(null===e)return!0;var t,r,n,i,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(n=a[t],\"[object Object]\"!==Be.call(n))return!1;if(1!==(i=Object.keys(n)).length)return!1;o[t]=[i[0],n[i[0]]]}return!0},construct:function constructYamlPairs(e){if(null===e)return[];var t,r,n,i,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1)n=a[t],i=Object.keys(n),o[t]=[i[0],n[i[0]]];return o}}),Ae=Object.prototype.hasOwnProperty;var Ce=new ie(\"tag:yaml.org,2002:set\",{kind:\"mapping\",resolve:function resolveYamlSet(e){if(null===e)return!0;var t,r=e;for(t in r)if(Ae.call(r,t)&&null!==r[t])return!1;return!0},construct:function constructYamlSet(e){return null!==e?e:{}}}),Me=me.extend({implicit:[be,Se],explicit:[Ie,Oe,ke,Ce]}),qe=Object.prototype.hasOwnProperty,Le=1,Ne=2,je=3,Te=4,Re=1,ze=2,Pe=3,Fe=/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/,De=/[\\x85\\u2028\\u2029]/,Ue=/[,\\[\\]\\{\\}]/,We=/^(?:!|!!|![a-z\\-]+!)$/i,Ke=/^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;function _class(e){return Object.prototype.toString.call(e)}function is_EOL(e){return 10===e||13===e}function is_WHITE_SPACE(e){return 9===e||32===e}function is_WS_OR_EOL(e){return 9===e||32===e||10===e||13===e}function is_FLOW_INDICATOR(e){return 44===e||91===e||93===e||123===e||125===e}function fromHexCode(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function simpleEscapeSequence(e){return 48===e?\"\\0\":97===e?\"\u0007\":98===e?\"\\b\":116===e||9===e?\"\\t\":110===e?\"\\n\":118===e?\"\\v\":102===e?\"\\f\":114===e?\"\\r\":101===e?\"\u001b\":32===e?\" \":34===e?'\"':47===e?\"/\":92===e?\"\\\\\":78===e?\"\":95===e?\" \":76===e?\"\\u2028\":80===e?\"\\u2029\":\"\"}function charFromCodepoint(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var Ve=new Array(256),$e=new Array(256),He=0;He<256;He++)Ve[He]=simpleEscapeSequence(He)?1:0,$e[He]=simpleEscapeSequence(He);function State$1(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Me,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function generateError(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=te(r),new ee(t,r)}function throwError(e,t){throw generateError(e,t)}function throwWarning(e,t){e.onWarning&&e.onWarning.call(null,generateError(e,t))}var Ye={YAML:function handleYamlDirective(e,t,r){var n,i,o;null!==e.version&&throwError(e,\"duplication of %YAML directive\"),1!==r.length&&throwError(e,\"YAML directive accepts exactly one argument\"),null===(n=/^([0-9]+)\\.([0-9]+)$/.exec(r[0]))&&throwError(e,\"ill-formed argument of the YAML directive\"),i=parseInt(n[1],10),o=parseInt(n[2],10),1!==i&&throwError(e,\"unacceptable YAML version of the document\"),e.version=r[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&throwWarning(e,\"unsupported YAML version of the document\")},TAG:function handleTagDirective(e,t,r){var n,i;2!==r.length&&throwError(e,\"TAG directive accepts exactly two arguments\"),n=r[0],i=r[1],We.test(n)||throwError(e,\"ill-formed tag handle (first argument) of the TAG directive\"),qe.call(e.tagMap,n)&&throwError(e,'there is a previously declared suffix for \"'+n+'\" tag handle'),Ke.test(i)||throwError(e,\"ill-formed tag prefix (second argument) of the TAG directive\");try{i=decodeURIComponent(i)}catch(t){throwError(e,\"tag prefix is malformed: \"+i)}e.tagMap[n]=i}};function captureSegment(e,t,r,n){var i,o,a,s;if(t<r){if(s=e.input.slice(t,r),n)for(i=0,o=s.length;i<o;i+=1)9===(a=s.charCodeAt(i))||32<=a&&a<=1114111||throwError(e,\"expected valid JSON character\");else Fe.test(s)&&throwError(e,\"the stream contains non-printable characters\");e.result+=s}}function mergeMappings(e,t,r,n){var i,o,a,s;for(J.isObject(r)||throwError(e,\"cannot merge mappings; the provided source object is unacceptable\"),a=0,s=(i=Object.keys(r)).length;a<s;a+=1)o=i[a],qe.call(t,o)||(t[o]=r[o],n[o]=!0)}function storeMappingPair(e,t,r,n,i,o,a,s,u){var c,f;if(Array.isArray(i))for(c=0,f=(i=Array.prototype.slice.call(i)).length;c<f;c+=1)Array.isArray(i[c])&&throwError(e,\"nested arrays are not supported inside keys\"),\"object\"==typeof i&&\"[object Object]\"===_class(i[c])&&(i[c]=\"[object Object]\");if(\"object\"==typeof i&&\"[object Object]\"===_class(i)&&(i=\"[object Object]\"),i=String(i),null===t&&(t={}),\"tag:yaml.org,2002:merge\"===n)if(Array.isArray(o))for(c=0,f=o.length;c<f;c+=1)mergeMappings(e,t,o[c],r);else mergeMappings(e,t,o,r);else e.json||qe.call(r,i)||!qe.call(t,i)||(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=u||e.position,throwError(e,\"duplicated mapping key\")),\"__proto__\"===i?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[i]=o,delete r[i];return t}function readLineBreak(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):throwError(e,\"a line break is expected\"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function skipSeparationSpace(e,t,r){for(var n=0,i=e.input.charCodeAt(e.position);0!==i;){for(;is_WHITE_SPACE(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!is_EOL(i))break;for(readLineBreak(e),i=e.input.charCodeAt(e.position),n++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==r&&0!==n&&e.lineIndent<r&&throwWarning(e,\"deficient indentation\"),n}function testDocumentSeparator(e){var t,r=e.position;return!(45!==(t=e.input.charCodeAt(r))&&46!==t||t!==e.input.charCodeAt(r+1)||t!==e.input.charCodeAt(r+2)||(r+=3,0!==(t=e.input.charCodeAt(r))&&!is_WS_OR_EOL(t)))}function writeFoldedLines(e,t){1===t?e.result+=\" \":t>1&&(e.result+=J.repeat(\"\\n\",t-1))}function readBlockSequence(e,t){var r,n,i=e.tag,o=e.anchor,a=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),n=e.input.charCodeAt(e.position);0!==n&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,throwError(e,\"tab characters must not be used in indentation\")),45===n)&&is_WS_OR_EOL(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,skipSeparationSpace(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(r=e.line,composeNode(e,t,je,!1,!0),a.push(e.result),skipSeparationSpace(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&0!==n)throwError(e,\"bad indentation of a sequence entry\");else if(e.lineIndent<t)break;return!!s&&(e.tag=i,e.anchor=o,e.kind=\"sequence\",e.result=a,!0)}function readTagProperty(e){var t,r,n,i,o=!1,a=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&throwError(e,\"duplication of a tag property\"),60===(i=e.input.charCodeAt(++e.position))?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(a=!0,r=\"!!\",i=e.input.charCodeAt(++e.position)):r=\"!\",t=e.position,o){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(n=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):throwError(e,\"unexpected end of the stream within a verbatim tag\")}else{for(;0!==i&&!is_WS_OR_EOL(i);)33===i&&(a?throwError(e,\"tag suffix cannot contain exclamation marks\"):(r=e.input.slice(t-1,e.position+1),We.test(r)||throwError(e,\"named tag handle cannot contain such characters\"),a=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);n=e.input.slice(t,e.position),Ue.test(n)&&throwError(e,\"tag suffix cannot contain flow indicator characters\")}n&&!Ke.test(n)&&throwError(e,\"tag name cannot contain such characters: \"+n);try{n=decodeURIComponent(n)}catch(t){throwError(e,\"tag name is malformed: \"+n)}return o?e.tag=n:qe.call(e.tagMap,r)?e.tag=e.tagMap[r]+n:\"!\"===r?e.tag=\"!\"+n:\"!!\"===r?e.tag=\"tag:yaml.org,2002:\"+n:throwError(e,'undeclared tag handle \"'+r+'\"'),!0}function readAnchorProperty(e){var t,r;if(38!==(r=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&throwError(e,\"duplication of an anchor property\"),r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!is_WS_OR_EOL(r)&&!is_FLOW_INDICATOR(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&throwError(e,\"name of an anchor node must contain at least one character\"),e.anchor=e.input.slice(t,e.position),!0}function composeNode(e,t,r,n,i){var o,a,s,u,c,f,l,h,p,d=1,_=!1,y=!1;if(null!==e.listener&&e.listener(\"open\",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=Te===r||je===r,n&&skipSeparationSpace(e,!0,-1)&&(_=!0,e.lineIndent>t?d=1:e.lineIndent===t?d=0:e.lineIndent<t&&(d=-1)),1===d)for(;readTagProperty(e)||readAnchorProperty(e);)skipSeparationSpace(e,!0,-1)?(_=!0,s=o,e.lineIndent>t?d=1:e.lineIndent===t?d=0:e.lineIndent<t&&(d=-1)):s=!1;if(s&&(s=_||i),1!==d&&Te!==r||(h=Le===r||Ne===r?t:t+1,p=e.position-e.lineStart,1===d?s&&(readBlockSequence(e,p)||function readBlockMapping(e,t,r){var n,i,o,a,s,u,c,f=e.tag,l=e.anchor,h={},p=Object.create(null),d=null,_=null,y=null,m=!1,g=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=h),c=e.input.charCodeAt(e.position);0!==c;){if(m||-1===e.firstTabInLine||(e.position=e.firstTabInLine,throwError(e,\"tab characters must not be used in indentation\")),n=e.input.charCodeAt(e.position+1),o=e.line,63!==c&&58!==c||!is_WS_OR_EOL(n)){if(a=e.line,s=e.lineStart,u=e.position,!composeNode(e,r,Ne,!1,!0))break;if(e.line===o){for(c=e.input.charCodeAt(e.position);is_WHITE_SPACE(c);)c=e.input.charCodeAt(++e.position);if(58===c)is_WS_OR_EOL(c=e.input.charCodeAt(++e.position))||throwError(e,\"a whitespace character is expected after the key-value separator within a block mapping\"),m&&(storeMappingPair(e,h,p,d,_,null,a,s,u),d=_=y=null),g=!0,m=!1,i=!1,d=e.tag,_=e.result;else{if(!g)return e.tag=f,e.anchor=l,!0;throwError(e,\"can not read an implicit mapping pair; a colon is missed\")}}else{if(!g)return e.tag=f,e.anchor=l,!0;throwError(e,\"can not read a block mapping entry; a multiline key may not be an implicit key\")}}else 63===c?(m&&(storeMappingPair(e,h,p,d,_,null,a,s,u),d=_=y=null),g=!0,m=!0,i=!0):m?(m=!1,i=!0):throwError(e,\"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line\"),e.position+=1,c=n;if((e.line===o||e.lineIndent>t)&&(m&&(a=e.line,s=e.lineStart,u=e.position),composeNode(e,t,Te,!0,i)&&(m?_=e.result:y=e.result),m||(storeMappingPair(e,h,p,d,_,y,a,s,u),d=_=y=null),skipSeparationSpace(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==c)throwError(e,\"bad indentation of a mapping entry\");else if(e.lineIndent<t)break}return m&&storeMappingPair(e,h,p,d,_,null,a,s,u),g&&(e.tag=f,e.anchor=l,e.kind=\"mapping\",e.result=h),g}(e,p,h))||function readFlowCollection(e,t){var r,n,i,o,a,s,u,c,f,l,h,p,d=!0,_=e.tag,y=e.anchor,m=Object.create(null);if(91===(p=e.input.charCodeAt(e.position)))a=93,c=!1,o=[];else{if(123!==p)return!1;a=125,c=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),p=e.input.charCodeAt(++e.position);0!==p;){if(skipSeparationSpace(e,!0,t),(p=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=_,e.anchor=y,e.kind=c?\"mapping\":\"sequence\",e.result=o,!0;d?44===p&&throwError(e,\"expected the node content, but found ','\"):throwError(e,\"missed comma between flow collection entries\"),h=null,s=u=!1,63===p&&is_WS_OR_EOL(e.input.charCodeAt(e.position+1))&&(s=u=!0,e.position++,skipSeparationSpace(e,!0,t)),r=e.line,n=e.lineStart,i=e.position,composeNode(e,t,Le,!1,!0),l=e.tag,f=e.result,skipSeparationSpace(e,!0,t),p=e.input.charCodeAt(e.position),!u&&e.line!==r||58!==p||(s=!0,p=e.input.charCodeAt(++e.position),skipSeparationSpace(e,!0,t),composeNode(e,t,Le,!1,!0),h=e.result),c?storeMappingPair(e,o,m,l,f,h,r,n,i):s?o.push(storeMappingPair(e,null,m,l,f,h,r,n,i)):o.push(f),skipSeparationSpace(e,!0,t),44===(p=e.input.charCodeAt(e.position))?(d=!0,p=e.input.charCodeAt(++e.position)):d=!1}throwError(e,\"unexpected end of the stream within a flow collection\")}(e,h)?y=!0:(a&&function readBlockScalar(e,t){var r,n,i,o,a,s=Re,u=!1,c=!1,f=t,l=0,h=!1;if(124===(o=e.input.charCodeAt(e.position)))n=!1;else{if(62!==o)return!1;n=!0}for(e.kind=\"scalar\",e.result=\"\";0!==o;)if(43===(o=e.input.charCodeAt(++e.position))||45===o)Re===s?s=43===o?Pe:ze:throwError(e,\"repeat of a chomping mode identifier\");else{if(!((i=48<=(a=o)&&a<=57?a-48:-1)>=0))break;0===i?throwError(e,\"bad explicit indentation width of a block scalar; it cannot be less than one\"):c?throwError(e,\"repeat of an indentation width identifier\"):(f=t+i-1,c=!0)}if(is_WHITE_SPACE(o)){do{o=e.input.charCodeAt(++e.position)}while(is_WHITE_SPACE(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!is_EOL(o)&&0!==o)}for(;0!==o;){for(readLineBreak(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!c||e.lineIndent<f)&&32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>f&&(f=e.lineIndent),is_EOL(o))l++;else{if(e.lineIndent<f){s===Pe?e.result+=J.repeat(\"\\n\",u?1+l:l):s===Re&&u&&(e.result+=\"\\n\");break}for(n?is_WHITE_SPACE(o)?(h=!0,e.result+=J.repeat(\"\\n\",u?1+l:l)):h?(h=!1,e.result+=J.repeat(\"\\n\",l+1)):0===l?u&&(e.result+=\" \"):e.result+=J.repeat(\"\\n\",l):e.result+=J.repeat(\"\\n\",u?1+l:l),u=!0,c=!0,l=0,r=e.position;!is_EOL(o)&&0!==o;)o=e.input.charCodeAt(++e.position);captureSegment(e,r,e.position,!1)}}return!0}(e,h)||function readSingleQuotedScalar(e,t){var r,n,i;if(39!==(r=e.input.charCodeAt(e.position)))return!1;for(e.kind=\"scalar\",e.result=\"\",e.position++,n=i=e.position;0!==(r=e.input.charCodeAt(e.position));)if(39===r){if(captureSegment(e,n,e.position,!0),39!==(r=e.input.charCodeAt(++e.position)))return!0;n=e.position,e.position++,i=e.position}else is_EOL(r)?(captureSegment(e,n,i,!0),writeFoldedLines(e,skipSeparationSpace(e,!1,t)),n=i=e.position):e.position===e.lineStart&&testDocumentSeparator(e)?throwError(e,\"unexpected end of the document within a single quoted scalar\"):(e.position++,i=e.position);throwError(e,\"unexpected end of the stream within a single quoted scalar\")}(e,h)||function readDoubleQuotedScalar(e,t){var r,n,i,o,a,s,u;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind=\"scalar\",e.result=\"\",e.position++,r=n=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return captureSegment(e,r,e.position,!0),e.position++,!0;if(92===s){if(captureSegment(e,r,e.position,!0),is_EOL(s=e.input.charCodeAt(++e.position)))skipSeparationSpace(e,!1,t);else if(s<256&&Ve[s])e.result+=$e[s],e.position++;else if((a=120===(u=s)?2:117===u?4:85===u?8:0)>0){for(i=a,o=0;i>0;i--)(a=fromHexCode(s=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:throwError(e,\"expected hexadecimal character\");e.result+=charFromCodepoint(o),e.position++}else throwError(e,\"unknown escape sequence\");r=n=e.position}else is_EOL(s)?(captureSegment(e,r,n,!0),writeFoldedLines(e,skipSeparationSpace(e,!1,t)),r=n=e.position):e.position===e.lineStart&&testDocumentSeparator(e)?throwError(e,\"unexpected end of the document within a double quoted scalar\"):(e.position++,n=e.position)}throwError(e,\"unexpected end of the stream within a double quoted scalar\")}(e,h)?y=!0:!function readAlias(e){var t,r,n;if(42!==(n=e.input.charCodeAt(e.position)))return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!is_WS_OR_EOL(n)&&!is_FLOW_INDICATOR(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&throwError(e,\"name of an alias node must contain at least one character\"),r=e.input.slice(t,e.position),qe.call(e.anchorMap,r)||throwError(e,'unidentified alias \"'+r+'\"'),e.result=e.anchorMap[r],skipSeparationSpace(e,!0,-1),!0}(e)?function readPlainScalar(e,t,r){var n,i,o,a,s,u,c,f,l=e.kind,h=e.result;if(is_WS_OR_EOL(f=e.input.charCodeAt(e.position))||is_FLOW_INDICATOR(f)||35===f||38===f||42===f||33===f||124===f||62===f||39===f||34===f||37===f||64===f||96===f)return!1;if((63===f||45===f)&&(is_WS_OR_EOL(n=e.input.charCodeAt(e.position+1))||r&&is_FLOW_INDICATOR(n)))return!1;for(e.kind=\"scalar\",e.result=\"\",i=o=e.position,a=!1;0!==f;){if(58===f){if(is_WS_OR_EOL(n=e.input.charCodeAt(e.position+1))||r&&is_FLOW_INDICATOR(n))break}else if(35===f){if(is_WS_OR_EOL(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&testDocumentSeparator(e)||r&&is_FLOW_INDICATOR(f))break;if(is_EOL(f)){if(s=e.line,u=e.lineStart,c=e.lineIndent,skipSeparationSpace(e,!1,-1),e.lineIndent>=t){a=!0,f=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=u,e.lineIndent=c;break}}a&&(captureSegment(e,i,o,!1),writeFoldedLines(e,e.line-s),i=o=e.position,a=!1),is_WHITE_SPACE(f)||(o=e.position+1),f=e.input.charCodeAt(++e.position)}return captureSegment(e,i,o,!1),!!e.result||(e.kind=l,e.result=h,!1)}(e,h,Le===r)&&(y=!0,null===e.tag&&(e.tag=\"?\")):(y=!0,null===e.tag&&null===e.anchor||throwError(e,\"alias node should not have any properties\")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(y=s&&readBlockSequence(e,p))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if(\"?\"===e.tag){for(null!==e.result&&\"scalar\"!==e.kind&&throwError(e,'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"'+e.kind+'\"'),u=0,c=e.implicitTypes.length;u<c;u+=1)if((l=e.implicitTypes[u]).resolve(e.result)){e.result=l.construct(e.result),e.tag=l.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if(\"!\"!==e.tag){if(qe.call(e.typeMap[e.kind||\"fallback\"],e.tag))l=e.typeMap[e.kind||\"fallback\"][e.tag];else for(l=null,u=0,c=(f=e.typeMap.multi[e.kind||\"fallback\"]).length;u<c;u+=1)if(e.tag.slice(0,f[u].tag.length)===f[u].tag){l=f[u];break}l||throwError(e,\"unknown tag !<\"+e.tag+\">\"),null!==e.result&&l.kind!==e.kind&&throwError(e,\"unacceptable node kind for !<\"+e.tag+'> tag; it should be \"'+l.kind+'\", not \"'+e.kind+'\"'),l.resolve(e.result,e.tag)?(e.result=l.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):throwError(e,\"cannot resolve a node with !<\"+e.tag+\"> explicit tag\")}return null!==e.listener&&e.listener(\"close\",e),null!==e.tag||null!==e.anchor||y}function readDocument(e){var t,r,n,i,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(skipSeparationSpace(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(a=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!is_WS_OR_EOL(i);)i=e.input.charCodeAt(++e.position);for(n=[],(r=e.input.slice(t,e.position)).length<1&&throwError(e,\"directive name must not be less than one character in length\");0!==i;){for(;is_WHITE_SPACE(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!is_EOL(i));break}if(is_EOL(i))break;for(t=e.position;0!==i&&!is_WS_OR_EOL(i);)i=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==i&&readLineBreak(e),qe.call(Ye,r)?Ye[r](e,r,n):throwWarning(e,'unknown document directive \"'+r+'\"')}skipSeparationSpace(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,skipSeparationSpace(e,!0,-1)):a&&throwError(e,\"directives end mark is expected\"),composeNode(e,e.lineIndent-1,Te,!1,!0),skipSeparationSpace(e,!0,-1),e.checkLineBreaks&&De.test(e.input.slice(o,e.position))&&throwWarning(e,\"non-ASCII line breaks are interpreted as content\"),e.documents.push(e.result),e.position===e.lineStart&&testDocumentSeparator(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,skipSeparationSpace(e,!0,-1)):e.position<e.length-1&&throwError(e,\"end of the stream or a document separator is expected\")}function loadDocuments(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+=\"\\n\"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var r=new State$1(e,t),n=e.indexOf(\"\\0\");for(-1!==n&&(r.position=n,throwError(r,\"null byte is not allowed in input\")),r.input+=\"\\0\";32===r.input.charCodeAt(r.position);)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)readDocument(r);return r.documents}var Ze={loadAll:function loadAll$1(e,t,r){null!==t&&\"object\"==typeof t&&void 0===r&&(r=t,t=null);var n=loadDocuments(e,r);if(\"function\"!=typeof t)return n;for(var i=0,o=n.length;i<o;i+=1)t(n[i])},load:function load$1(e,t){var r=loadDocuments(e,t);if(0!==r.length){if(1===r.length)return r[0];throw new ee(\"expected a single document in the stream, but found more\")}}},Ge=Object.prototype.toString,Je=Object.prototype.hasOwnProperty,Qe=65279,Xe=9,et=10,tt=13,rt=32,nt=33,it=34,ot=35,at=37,st=38,ut=39,ct=42,lt=44,ht=45,pt=58,dt=61,_t=62,yt=63,mt=64,gt=91,vt=93,bt=96,St=123,wt=124,It=125,xt={0:\"\\\\0\",7:\"\\\\a\",8:\"\\\\b\",9:\"\\\\t\",10:\"\\\\n\",11:\"\\\\v\",12:\"\\\\f\",13:\"\\\\r\",27:\"\\\\e\",34:'\\\\\"',92:\"\\\\\\\\\",133:\"\\\\N\",160:\"\\\\_\",8232:\"\\\\L\",8233:\"\\\\P\"},Et=[\"y\",\"Y\",\"yes\",\"Yes\",\"YES\",\"on\",\"On\",\"ON\",\"n\",\"N\",\"no\",\"No\",\"NO\",\"off\",\"Off\",\"OFF\"],Ot=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;function encodeHex(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r=\"x\",n=2;else if(e<=65535)r=\"u\",n=4;else{if(!(e<=4294967295))throw new ee(\"code point within a string may not be greater than 0xFFFFFFFF\");r=\"U\",n=8}return\"\\\\\"+r+J.repeat(\"0\",n-t.length)+t}var Bt=1,kt=2;function State(e){this.schema=e.schema||Me,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=J.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function compileStyleMap(e,t){var r,n,i,o,a,s,u;if(null===t)return{};for(r={},i=0,o=(n=Object.keys(t)).length;i<o;i+=1)a=n[i],s=String(t[a]),\"!!\"===a.slice(0,2)&&(a=\"tag:yaml.org,2002:\"+a.slice(2)),(u=e.compiledTypeMap.fallback[a])&&Je.call(u.styleAliases,s)&&(s=u.styleAliases[s]),r[a]=s;return r}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='\"'===e.quotingType?kt:Bt,this.forceQuotes=e.forceQuotes||!1,this.replacer=\"function\"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=\"\",this.duplicates=[],this.usedDuplicates=null}function indentString(e,t){for(var r,n=J.repeat(\" \",t),i=0,o=-1,a=\"\",s=e.length;i<s;)-1===(o=e.indexOf(\"\\n\",i))?(r=e.slice(i),i=s):(r=e.slice(i,o+1),i=o+1),r.length&&\"\\n\"!==r&&(a+=n),a+=r;return a}function generateNextLine(e,t){return\"\\n\"+J.repeat(\" \",e.indent*t)}function isWhitespace(e){return e===rt||e===Xe}function isPrintable(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==Qe||65536<=e&&e<=1114111}function isNsCharOrWhitespace(e){return isPrintable(e)&&e!==Qe&&e!==tt&&e!==et}function isPlainSafe(e,t,r){var n=isNsCharOrWhitespace(e),i=n&&!isWhitespace(e);return(r?n:n&&e!==lt&&e!==gt&&e!==vt&&e!==St&&e!==It)&&e!==ot&&!(t===pt&&!i)||isNsCharOrWhitespace(t)&&!isWhitespace(t)&&e===ot||t===pt&&i}function codePointAt(e,t){var r,n=e.charCodeAt(t);return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1))>=56320&&r<=57343?1024*(n-55296)+r-56320+65536:n}function needIndentIndicator(e){return/^\\n* /.test(e)}var At=1,Ct=2,Mt=3,qt=4,Lt=5;function chooseScalarStyle(e,t,r,n,i,o,a,s){var u,c=0,f=null,l=!1,h=!1,p=-1!==n,d=-1,_=function isPlainSafeFirst(e){return isPrintable(e)&&e!==Qe&&!isWhitespace(e)&&e!==ht&&e!==yt&&e!==pt&&e!==lt&&e!==gt&&e!==vt&&e!==St&&e!==It&&e!==ot&&e!==st&&e!==ct&&e!==nt&&e!==wt&&e!==dt&&e!==_t&&e!==ut&&e!==it&&e!==at&&e!==mt&&e!==bt}(codePointAt(e,0))&&function isPlainSafeLast(e){return!isWhitespace(e)&&e!==pt}(codePointAt(e,e.length-1));if(t||a)for(u=0;u<e.length;c>=65536?u+=2:u++){if(!isPrintable(c=codePointAt(e,u)))return Lt;_=_&&isPlainSafe(c,f,s),f=c}else{for(u=0;u<e.length;c>=65536?u+=2:u++){if((c=codePointAt(e,u))===et)l=!0,p&&(h=h||u-d-1>n&&\" \"!==e[d+1],d=u);else if(!isPrintable(c))return Lt;_=_&&isPlainSafe(c,f,s),f=c}h=h||p&&u-d-1>n&&\" \"!==e[d+1]}return l||h?r>9&&needIndentIndicator(e)?Lt:a?o===kt?Lt:Ct:h?qt:Mt:!_||a||i(e)?o===kt?Lt:Ct:At}function writeScalar(e,t,r,n,i){e.dump=function(){if(0===t.length)return e.quotingType===kt?'\"\"':\"''\";if(!e.noCompatMode&&(-1!==Et.indexOf(t)||Ot.test(t)))return e.quotingType===kt?'\"'+t+'\"':\"'\"+t+\"'\";var o=e.indent*Math.max(1,r),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),s=n||e.flowLevel>-1&&r>=e.flowLevel;switch(chooseScalarStyle(t,s,e.indent,a,(function testAmbiguity(t){return function testImplicitResolving(e,t){var r,n;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(e.implicitTypes[r].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!n,i)){case At:return t;case Ct:return\"'\"+t.replace(/'/g,\"''\")+\"'\";case Mt:return\"|\"+blockHeader(t,e.indent)+dropEndingNewline(indentString(t,o));case qt:return\">\"+blockHeader(t,e.indent)+dropEndingNewline(indentString(function foldString(e,t){var r,n,i=/(\\n+)([^\\n]*)/g,o=(s=e.indexOf(\"\\n\"),s=-1!==s?s:e.length,i.lastIndex=s,foldLine(e.slice(0,s),t)),a=\"\\n\"===e[0]||\" \"===e[0];var s;for(;n=i.exec(e);){var u=n[1],c=n[2];r=\" \"===c[0],o+=u+(a||r||\"\"===c?\"\":\"\\n\")+foldLine(c,t),a=r}return o}(t,a),o));case Lt:return'\"'+function escapeString(e){for(var t,r=\"\",n=0,i=0;i<e.length;n>=65536?i+=2:i++)n=codePointAt(e,i),!(t=xt[n])&&isPrintable(n)?(r+=e[i],n>=65536&&(r+=e[i+1])):r+=t||encodeHex(n);return r}(t)+'\"';default:throw new ee(\"impossible error: invalid scalar style\")}}()}function blockHeader(e,t){var r=needIndentIndicator(e)?String(t):\"\",n=\"\\n\"===e[e.length-1];return r+(n&&(\"\\n\"===e[e.length-2]||\"\\n\"===e)?\"+\":n?\"\":\"-\")+\"\\n\"}function dropEndingNewline(e){return\"\\n\"===e[e.length-1]?e.slice(0,-1):e}function foldLine(e,t){if(\"\"===e||\" \"===e[0])return e;for(var r,n,i=/ [^ ]/g,o=0,a=0,s=0,u=\"\";r=i.exec(e);)(s=r.index)-o>t&&(n=a>o?a:s,u+=\"\\n\"+e.slice(o,n),o=n+1),a=s;return u+=\"\\n\",e.length-o>t&&a>o?u+=e.slice(o,a)+\"\\n\"+e.slice(a+1):u+=e.slice(o),u.slice(1)}function writeBlockSequence(e,t,r,n){var i,o,a,s=\"\",u=e.tag;for(i=0,o=r.length;i<o;i+=1)a=r[i],e.replacer&&(a=e.replacer.call(r,String(i),a)),(writeNode(e,t+1,a,!0,!0,!1,!0)||void 0===a&&writeNode(e,t+1,null,!0,!0,!1,!0))&&(n&&\"\"===s||(s+=generateNextLine(e,t)),e.dump&&et===e.dump.charCodeAt(0)?s+=\"-\":s+=\"- \",s+=e.dump);e.tag=u,e.dump=s||\"[]\"}function detectType(e,t,r){var n,i,o,a,s,u;for(o=0,a=(i=r?e.explicitTypes:e.implicitTypes).length;o<a;o+=1)if(((s=i[o]).instanceOf||s.predicate)&&(!s.instanceOf||\"object\"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(r?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=\"?\",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,\"[object Function]\"===Ge.call(s.represent))n=s.represent(t,u);else{if(!Je.call(s.represent,u))throw new ee(\"!<\"+s.tag+'> tag resolver accepts not \"'+u+'\" style');n=s.represent[u](t,u)}e.dump=n}return!0}return!1}function writeNode(e,t,r,n,i,o,a){e.tag=null,e.dump=r,detectType(e,r,!1)||detectType(e,r,!0);var s,u=Ge.call(e.dump),c=n;n&&(n=e.flowLevel<0||e.flowLevel>t);var f,l,h=\"[object Object]\"===u||\"[object Array]\"===u;if(h&&(l=-1!==(f=e.duplicates.indexOf(r))),(null!==e.tag&&\"?\"!==e.tag||l||2!==e.indent&&t>0)&&(i=!1),l&&e.usedDuplicates[f])e.dump=\"*ref_\"+f;else{if(h&&l&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),\"[object Object]\"===u)n&&0!==Object.keys(e.dump).length?(!function writeBlockMapping(e,t,r,n){var i,o,a,s,u,c,f=\"\",l=e.tag,h=Object.keys(r);if(!0===e.sortKeys)h.sort();else if(\"function\"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new ee(\"sortKeys must be a boolean or a function\");for(i=0,o=h.length;i<o;i+=1)c=\"\",n&&\"\"===f||(c+=generateNextLine(e,t)),s=r[a=h[i]],e.replacer&&(s=e.replacer.call(r,a,s)),writeNode(e,t+1,a,!0,!0,!0)&&((u=null!==e.tag&&\"?\"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&et===e.dump.charCodeAt(0)?c+=\"?\":c+=\"? \"),c+=e.dump,u&&(c+=generateNextLine(e,t)),writeNode(e,t+1,s,!0,u)&&(e.dump&&et===e.dump.charCodeAt(0)?c+=\":\":c+=\": \",f+=c+=e.dump));e.tag=l,e.dump=f||\"{}\"}(e,t,e.dump,i),l&&(e.dump=\"&ref_\"+f+e.dump)):(!function writeFlowMapping(e,t,r){var n,i,o,a,s,u=\"\",c=e.tag,f=Object.keys(r);for(n=0,i=f.length;n<i;n+=1)s=\"\",\"\"!==u&&(s+=\", \"),e.condenseFlow&&(s+='\"'),a=r[o=f[n]],e.replacer&&(a=e.replacer.call(r,o,a)),writeNode(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+=\"? \"),s+=e.dump+(e.condenseFlow?'\"':\"\")+\":\"+(e.condenseFlow?\"\":\" \"),writeNode(e,t,a,!1,!1)&&(u+=s+=e.dump));e.tag=c,e.dump=\"{\"+u+\"}\"}(e,t,e.dump),l&&(e.dump=\"&ref_\"+f+\" \"+e.dump));else if(\"[object Array]\"===u)n&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?writeBlockSequence(e,t-1,e.dump,i):writeBlockSequence(e,t,e.dump,i),l&&(e.dump=\"&ref_\"+f+e.dump)):(!function writeFlowSequence(e,t,r){var n,i,o,a=\"\",s=e.tag;for(n=0,i=r.length;n<i;n+=1)o=r[n],e.replacer&&(o=e.replacer.call(r,String(n),o)),(writeNode(e,t,o,!1,!1)||void 0===o&&writeNode(e,t,null,!1,!1))&&(\"\"!==a&&(a+=\",\"+(e.condenseFlow?\"\":\" \")),a+=e.dump);e.tag=s,e.dump=\"[\"+a+\"]\"}(e,t,e.dump),l&&(e.dump=\"&ref_\"+f+\" \"+e.dump));else{if(\"[object String]\"!==u){if(\"[object Undefined]\"===u)return!1;if(e.skipInvalid)return!1;throw new ee(\"unacceptable kind of an object to dump \"+u)}\"?\"!==e.tag&&writeScalar(e,e.dump,t,o,c)}null!==e.tag&&\"?\"!==e.tag&&(s=encodeURI(\"!\"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,\"%21\"),s=\"!\"===e.tag[0]?\"!\"+s:\"tag:yaml.org,2002:\"===s.slice(0,18)?\"!!\"+s.slice(18):\"!<\"+s+\">\",e.dump=s+\" \"+e.dump)}return!0}function getDuplicateReferences(e,t){var r,n,i=[],o=[];for(inspectNode(e,i,o),r=0,n=o.length;r<n;r+=1)t.duplicates.push(i[o[r]]);t.usedDuplicates=new Array(n)}function inspectNode(e,t,r){var n,i,o;if(null!==e&&\"object\"==typeof e)if(-1!==(i=t.indexOf(e)))-1===r.indexOf(i)&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)inspectNode(e[i],t,r);else for(i=0,o=(n=Object.keys(e)).length;i<o;i+=1)inspectNode(e[n[i]],t,r)}function renamed(e,t){return function(){throw new Error(\"Function yaml.\"+e+\" is removed in js-yaml 4. Use yaml.\"+t+\" instead, which is now safe by default.\")}}const Nt={Type:ie,Schema:oe,FAILSAFE_SCHEMA:ce,JSON_SCHEMA:ye,CORE_SCHEMA:me,DEFAULT_SCHEMA:Me,load:Ze.load,loadAll:Ze.loadAll,dump:{dump:function dump$1(e,t){var r=new State(t=t||{});r.noRefs||getDuplicateReferences(e,r);var n=e;return r.replacer&&(n=r.replacer.call({\"\":n},\"\",n)),writeNode(r,0,n,!0,!0)?r.dump+\"\\n\":\"\"}}.dump,YAMLException:ee,types:{binary:Ie,float:_e,map:ue,null:fe,pairs:ke,set:Ce,timestamp:be,bool:le,int:he,merge:Se,omap:Oe,seq:se,str:ae},safeLoad:renamed(\"safeLoad\",\"load\"),safeLoadAll:renamed(\"safeLoadAll\",\"loadAll\"),safeDump:renamed(\"safeDump\",\"dump\")},jt=\"configs_update\",Tt=\"configs_toggle\";function update(e,t){return{type:jt,payload:{[e]:t}}}function toggle(e){return{type:Tt,payload:e}}const loaded=()=>()=>{},downloadConfig=e=>t=>{const{fn:{fetch:r}}=t;return r(e)},getConfigByUrl=(e,t)=>r=>{const{specActions:n,configsActions:i}=r;if(e)return i.downloadConfig(e).then(next,next);function next(i){i instanceof Error||i.status>=400?(n.updateLoadingStatus(\"failedConfig\"),n.updateLoadingStatus(\"failedConfig\"),n.updateUrl(\"\"),console.error(i.statusText+\" \"+e.url),t(null)):t(((e,t)=>{try{return Nt.load(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}})(i.text,r))}},get=(e,t)=>e.getIn(Array.isArray(t)?t:[t]),Rt={[jt]:(e,t)=>e.merge((0,o.fromJS)(t.payload)),[Tt]:(e,t)=>{const r=t.payload,n=e.get(r);return e.set(r,!n)}};var zt=__webpack_require__(7248),Pt=__webpack_require__.n(zt),Ft=__webpack_require__(7666),Dt=__webpack_require__.n(Ft);const Ut=console.error,withErrorBoundary=e=>t=>{const{getComponent:r,fn:i}=e(),o=r(\"ErrorBoundary\"),a=i.getDisplayName(t);class WithErrorBoundary extends n.Component{render(){return n.createElement(o,{targetName:a,getComponent:r,fn:i},n.createElement(t,Dt()({},this.props,this.context)))}}var s;return WithErrorBoundary.displayName=`WithErrorBoundary(${a})`,(s=t).prototype&&s.prototype.isReactComponent&&(WithErrorBoundary.prototype.mapStateToProps=t.prototype.mapStateToProps),WithErrorBoundary},fallback=({name:e})=>n.createElement(\"div\",{className:\"fallback\"},\"😱 \",n.createElement(\"i\",null,\"Could not render \",\"t\"===e?\"this component\":e,\", see the console.\"));class ErrorBoundary extends n.Component{static defaultProps={targetName:\"this component\",getComponent:()=>fallback,fn:{componentDidCatch:Ut},children:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}constructor(...e){super(...e),this.state={hasError:!1,error:null}}componentDidCatch(e,t){this.props.fn.componentDidCatch(e,t)}render(){const{getComponent:e,targetName:t,children:r}=this.props;if(this.state.hasError){const r=e(\"Fallback\");return n.createElement(r,{name:t})}return r}}const Wt=ErrorBoundary,Kt=[top_bar,function configsPlugin(){return{statePlugins:{configs:{reducers:Rt,actions:e,selectors:t}}}},stadalone_layout,(({componentList:e=[],fullOverride:t=!1}={})=>({getSystem:r})=>{const n=t?e:[\"App\",\"BaseLayout\",\"VersionPragmaFilter\",\"InfoContainer\",\"ServersContainer\",\"SchemesContainer\",\"AuthorizeBtnContainer\",\"FilterContainer\",\"Operations\",\"OperationContainer\",\"parameters\",\"responses\",\"OperationServers\",\"Models\",\"ModelWrapper\",...e],i=Pt()(n,Array(n.length).fill(((e,{fn:t})=>t.withErrorBoundary(e))));return{fn:{componentDidCatch:Ut,withErrorBoundary:withErrorBoundary(r)},components:{ErrorBoundary:Wt,Fallback:fallback},wrapComponents:i}})({fullOverride:!0,componentList:[\"Topbar\",\"StandaloneLayout\",\"onlineValidatorBadge\"]})]})(),r=r.default})()));"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui-standalone-preset.js.LICENSE.txt",
    "content": "/*!\n * The buffer module from node.js, for the browser.\n *\n * @author   Feross Aboukhadijeh <https://feross.org>\n * @license  MIT\n */\n\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\n\n/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */\n\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n\n/**\n * @license React\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"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui.css",
    "content": ".swagger-ui{color:#3b4151;font-family:sans-serif/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */}.swagger-ui html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}.swagger-ui body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui footer,.swagger-ui header,.swagger-ui nav,.swagger-ui section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui figure{margin:1em 40px}.swagger-ui hr{box-sizing:content-box;height:0;overflow:visible}.swagger-ui pre{font-family:monospace,monospace;font-size:1em}.swagger-ui a{background-color:transparent;-webkit-text-decoration-skip:objects}.swagger-ui abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.swagger-ui b,.swagger-ui strong{font-weight:inherit;font-weight:bolder}.swagger-ui code,.swagger-ui kbd,.swagger-ui samp{font-family:monospace,monospace;font-size:1em}.swagger-ui dfn{font-style:italic}.swagger-ui mark{background-color:#ff0;color:#000}.swagger-ui small{font-size:80%}.swagger-ui sub,.swagger-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.swagger-ui sub{bottom:-.25em}.swagger-ui sup{top:-.5em}.swagger-ui audio,.swagger-ui video{display:inline-block}.swagger-ui audio:not([controls]){display:none;height:0}.swagger-ui img{border-style:none}.swagger-ui svg:not(:root){overflow:hidden}.swagger-ui button,.swagger-ui input,.swagger-ui optgroup,.swagger-ui select,.swagger-ui textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.swagger-ui button,.swagger-ui input{overflow:visible}.swagger-ui button,.swagger-ui select{text-transform:none}.swagger-ui [type=reset],.swagger-ui [type=submit],.swagger-ui button,.swagger-ui html [type=button]{-webkit-appearance:button}.swagger-ui [type=button]::-moz-focus-inner,.swagger-ui [type=reset]::-moz-focus-inner,.swagger-ui [type=submit]::-moz-focus-inner,.swagger-ui button::-moz-focus-inner{border-style:none;padding:0}.swagger-ui [type=button]:-moz-focusring,.swagger-ui [type=reset]:-moz-focusring,.swagger-ui [type=submit]:-moz-focusring,.swagger-ui button:-moz-focusring{outline:1px dotted ButtonText}.swagger-ui fieldset{padding:.35em .75em .625em}.swagger-ui legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.swagger-ui progress{display:inline-block;vertical-align:baseline}.swagger-ui textarea{overflow:auto}.swagger-ui [type=checkbox],.swagger-ui [type=radio]{box-sizing:border-box;padding:0}.swagger-ui [type=number]::-webkit-inner-spin-button,.swagger-ui [type=number]::-webkit-outer-spin-button{height:auto}.swagger-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.swagger-ui [type=search]::-webkit-search-cancel-button,.swagger-ui [type=search]::-webkit-search-decoration{-webkit-appearance:none}.swagger-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.swagger-ui details,.swagger-ui menu{display:block}.swagger-ui summary{display:list-item}.swagger-ui canvas{display:inline-block}.swagger-ui [hidden],.swagger-ui template{display:none}.swagger-ui .debug *{outline:1px solid gold}.swagger-ui .debug-white *{outline:1px solid #fff}.swagger-ui .debug-black *{outline:1px solid #000}.swagger-ui .debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0}.swagger-ui .debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODYyRjhERDU2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODYyRjhERDQ2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QTY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3QjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvCS01IAAABMSURBVHjaYmR4/5+BFPBfAMFm/MBgx8RAGWCn1AAmSg34Q6kBDKMGMDCwICeMIemF/5QawEipAWwUhwEjMDvbAWlWkvVBwu8vQIABAEwBCph8U6c0AAAAAElFTkSuQmCC) repeat 0 0}.swagger-ui .debug-grid-8-solid{background:#fff url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAAAAD/4QMxaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzExMSA3OS4xNTgzMjUsIDIwMTUvMDkvMTAtMDE6MTA6MjAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIxMjI0OTczNjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkIxMjI0OTc0NjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QjEyMjQ5NzE2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QjEyMjQ5NzI2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAbGhopHSlBJiZBQi8vL0JHPz4+P0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHAR0pKTQmND8oKD9HPzU/R0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAAIAAgDASIAAhEBAxEB/8QAWQABAQAAAAAAAAAAAAAAAAAAAAYBAQEAAAAAAAAAAAAAAAAAAAIEEAEBAAMBAAAAAAAAAAAAAAABADECA0ERAAEDBQAAAAAAAAAAAAAAAAARITFBUWESIv/aAAwDAQACEQMRAD8AoOnTV1QTD7JJshP3vSM3P//Z) repeat 0 0}.swagger-ui .debug-grid-16-solid{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzY3MkJEN0U2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzY3MkJEN0Y2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3RDY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pve6J3kAAAAzSURBVHjaYvz//z8D0UDsMwMjSRoYP5Gq4SPNbRjVMEQ1fCRDg+in/6+J1AJUxsgAEGAA31BAJMS0GYEAAAAASUVORK5CYII=) repeat 0 0}.swagger-ui .border-box,.swagger-ui a,.swagger-ui article,.swagger-ui body,.swagger-ui code,.swagger-ui dd,.swagger-ui div,.swagger-ui dl,.swagger-ui dt,.swagger-ui fieldset,.swagger-ui footer,.swagger-ui form,.swagger-ui h1,.swagger-ui h2,.swagger-ui h3,.swagger-ui h4,.swagger-ui h5,.swagger-ui h6,.swagger-ui header,.swagger-ui html,.swagger-ui input[type=email],.swagger-ui input[type=number],.swagger-ui input[type=password],.swagger-ui input[type=tel],.swagger-ui input[type=text],.swagger-ui input[type=url],.swagger-ui legend,.swagger-ui li,.swagger-ui main,.swagger-ui ol,.swagger-ui p,.swagger-ui pre,.swagger-ui section,.swagger-ui table,.swagger-ui td,.swagger-ui textarea,.swagger-ui th,.swagger-ui tr,.swagger-ui ul{box-sizing:border-box}.swagger-ui .aspect-ratio{height:0;position:relative}.swagger-ui .aspect-ratio--16x9{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1{padding-bottom:100%}.swagger-ui .aspect-ratio--object{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%;z-index:100}@media screen and (min-width:30em){.swagger-ui .aspect-ratio-ns{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-ns{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-ns{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-ns{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-ns{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-ns{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-ns{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-ns{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-ns{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-ns{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-ns{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-ns{padding-bottom:100%}.swagger-ui .aspect-ratio--object-ns{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%;z-index:100}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .aspect-ratio-m{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-m{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-m{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-m{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-m{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-m{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-m{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-m{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-m{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-m{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-m{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-m{padding-bottom:100%}.swagger-ui .aspect-ratio--object-m{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%;z-index:100}}@media screen and (min-width:60em){.swagger-ui .aspect-ratio-l{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-l{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-l{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-l{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-l{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-l{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-l{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-l{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-l{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-l{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-l{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-l{padding-bottom:100%}.swagger-ui .aspect-ratio--object-l{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%;z-index:100}}.swagger-ui img{max-width:100%}.swagger-ui .cover{background-size:cover!important}.swagger-ui .contain{background-size:contain!important}@media screen and (min-width:30em){.swagger-ui .cover-ns{background-size:cover!important}.swagger-ui .contain-ns{background-size:contain!important}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .cover-m{background-size:cover!important}.swagger-ui .contain-m{background-size:contain!important}}@media screen and (min-width:60em){.swagger-ui .cover-l{background-size:cover!important}.swagger-ui .contain-l{background-size:contain!important}}.swagger-ui .bg-center{background-position:50%;background-repeat:no-repeat}.swagger-ui .bg-top{background-position:top;background-repeat:no-repeat}.swagger-ui .bg-right{background-position:100%;background-repeat:no-repeat}.swagger-ui .bg-bottom{background-position:bottom;background-repeat:no-repeat}.swagger-ui .bg-left{background-position:0;background-repeat:no-repeat}@media screen and (min-width:30em){.swagger-ui .bg-center-ns{background-position:50%;background-repeat:no-repeat}.swagger-ui .bg-top-ns{background-position:top;background-repeat:no-repeat}.swagger-ui .bg-right-ns{background-position:100%;background-repeat:no-repeat}.swagger-ui .bg-bottom-ns{background-position:bottom;background-repeat:no-repeat}.swagger-ui .bg-left-ns{background-position:0;background-repeat:no-repeat}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .bg-center-m{background-position:50%;background-repeat:no-repeat}.swagger-ui .bg-top-m{background-position:top;background-repeat:no-repeat}.swagger-ui .bg-right-m{background-position:100%;background-repeat:no-repeat}.swagger-ui .bg-bottom-m{background-position:bottom;background-repeat:no-repeat}.swagger-ui .bg-left-m{background-position:0;background-repeat:no-repeat}}@media screen and (min-width:60em){.swagger-ui .bg-center-l{background-position:50%;background-repeat:no-repeat}.swagger-ui .bg-top-l{background-position:top;background-repeat:no-repeat}.swagger-ui .bg-right-l{background-position:100%;background-repeat:no-repeat}.swagger-ui .bg-bottom-l{background-position:bottom;background-repeat:no-repeat}.swagger-ui .bg-left-l{background-position:0;background-repeat:no-repeat}}.swagger-ui .outline{outline:1px solid}.swagger-ui .outline-transparent{outline:1px solid transparent}.swagger-ui .outline-0{outline:0}@media screen and (min-width:30em){.swagger-ui .outline-ns{outline:1px solid}.swagger-ui .outline-transparent-ns{outline:1px solid transparent}.swagger-ui .outline-0-ns{outline:0}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .outline-m{outline:1px solid}.swagger-ui .outline-transparent-m{outline:1px solid transparent}.swagger-ui .outline-0-m{outline:0}}@media screen and (min-width:60em){.swagger-ui .outline-l{outline:1px solid}.swagger-ui .outline-transparent-l{outline:1px solid transparent}.swagger-ui .outline-0-l{outline:0}}.swagger-ui .ba{border-style:solid;border-width:1px}.swagger-ui .bt{border-top-style:solid;border-top-width:1px}.swagger-ui .br{border-right-style:solid;border-right-width:1px}.swagger-ui .bb{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl{border-left-style:solid;border-left-width:1px}.swagger-ui .bn{border-style:none;border-width:0}@media screen and (min-width:30em){.swagger-ui .ba-ns{border-style:solid;border-width:1px}.swagger-ui .bt-ns{border-top-style:solid;border-top-width:1px}.swagger-ui .br-ns{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-ns{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-ns{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-ns{border-style:none;border-width:0}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .ba-m{border-style:solid;border-width:1px}.swagger-ui .bt-m{border-top-style:solid;border-top-width:1px}.swagger-ui .br-m{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-m{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-m{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-m{border-style:none;border-width:0}}@media screen and (min-width:60em){.swagger-ui .ba-l{border-style:solid;border-width:1px}.swagger-ui .bt-l{border-top-style:solid;border-top-width:1px}.swagger-ui .br-l{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-l{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-l{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-l{border-style:none;border-width:0}}.swagger-ui .b--black{border-color:#000}.swagger-ui .b--near-black{border-color:#111}.swagger-ui .b--dark-gray{border-color:#333}.swagger-ui .b--mid-gray{border-color:#555}.swagger-ui .b--gray{border-color:#777}.swagger-ui .b--silver{border-color:#999}.swagger-ui .b--light-silver{border-color:#aaa}.swagger-ui .b--moon-gray{border-color:#ccc}.swagger-ui .b--light-gray{border-color:#eee}.swagger-ui .b--near-white{border-color:#f4f4f4}.swagger-ui .b--white{border-color:#fff}.swagger-ui .b--white-90{border-color:hsla(0,0%,100%,.9)}.swagger-ui .b--white-80{border-color:hsla(0,0%,100%,.8)}.swagger-ui .b--white-70{border-color:hsla(0,0%,100%,.7)}.swagger-ui .b--white-60{border-color:hsla(0,0%,100%,.6)}.swagger-ui .b--white-50{border-color:hsla(0,0%,100%,.5)}.swagger-ui .b--white-40{border-color:hsla(0,0%,100%,.4)}.swagger-ui .b--white-30{border-color:hsla(0,0%,100%,.3)}.swagger-ui .b--white-20{border-color:hsla(0,0%,100%,.2)}.swagger-ui .b--white-10{border-color:hsla(0,0%,100%,.1)}.swagger-ui .b--white-05{border-color:hsla(0,0%,100%,.05)}.swagger-ui .b--white-025{border-color:hsla(0,0%,100%,.025)}.swagger-ui .b--white-0125{border-color:hsla(0,0%,100%,.013)}.swagger-ui .b--black-90{border-color:rgba(0,0,0,.9)}.swagger-ui .b--black-80{border-color:rgba(0,0,0,.8)}.swagger-ui .b--black-70{border-color:rgba(0,0,0,.7)}.swagger-ui .b--black-60{border-color:rgba(0,0,0,.6)}.swagger-ui .b--black-50{border-color:rgba(0,0,0,.5)}.swagger-ui .b--black-40{border-color:rgba(0,0,0,.4)}.swagger-ui .b--black-30{border-color:rgba(0,0,0,.3)}.swagger-ui .b--black-20{border-color:rgba(0,0,0,.2)}.swagger-ui .b--black-10{border-color:rgba(0,0,0,.1)}.swagger-ui .b--black-05{border-color:rgba(0,0,0,.05)}.swagger-ui .b--black-025{border-color:rgba(0,0,0,.025)}.swagger-ui .b--black-0125{border-color:rgba(0,0,0,.013)}.swagger-ui .b--dark-red{border-color:#e7040f}.swagger-ui .b--red{border-color:#ff4136}.swagger-ui .b--light-red{border-color:#ff725c}.swagger-ui .b--orange{border-color:#ff6300}.swagger-ui .b--gold{border-color:#ffb700}.swagger-ui .b--yellow{border-color:gold}.swagger-ui .b--light-yellow{border-color:#fbf1a9}.swagger-ui .b--purple{border-color:#5e2ca5}.swagger-ui .b--light-purple{border-color:#a463f2}.swagger-ui .b--dark-pink{border-color:#d5008f}.swagger-ui .b--hot-pink{border-color:#ff41b4}.swagger-ui .b--pink{border-color:#ff80cc}.swagger-ui .b--light-pink{border-color:#ffa3d7}.swagger-ui .b--dark-green{border-color:#137752}.swagger-ui .b--green{border-color:#19a974}.swagger-ui .b--light-green{border-color:#9eebcf}.swagger-ui .b--navy{border-color:#001b44}.swagger-ui .b--dark-blue{border-color:#00449e}.swagger-ui .b--blue{border-color:#357edd}.swagger-ui .b--light-blue{border-color:#96ccff}.swagger-ui .b--lightest-blue{border-color:#cdecff}.swagger-ui .b--washed-blue{border-color:#f6fffe}.swagger-ui .b--washed-green{border-color:#e8fdf5}.swagger-ui .b--washed-yellow{border-color:#fffceb}.swagger-ui .b--washed-red{border-color:#ffdfdf}.swagger-ui .b--transparent{border-color:transparent}.swagger-ui .b--inherit{border-color:inherit}.swagger-ui .br0{border-radius:0}.swagger-ui .br1{border-radius:.125rem}.swagger-ui .br2{border-radius:.25rem}.swagger-ui .br3{border-radius:.5rem}.swagger-ui .br4{border-radius:1rem}.swagger-ui .br-100{border-radius:100%}.swagger-ui .br-pill{border-radius:9999px}.swagger-ui .br--bottom{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right{border-bottom-left-radius:0;border-top-left-radius:0}.swagger-ui .br--left{border-bottom-right-radius:0;border-top-right-radius:0}@media screen and (min-width:30em){.swagger-ui .br0-ns{border-radius:0}.swagger-ui .br1-ns{border-radius:.125rem}.swagger-ui .br2-ns{border-radius:.25rem}.swagger-ui .br3-ns{border-radius:.5rem}.swagger-ui .br4-ns{border-radius:1rem}.swagger-ui .br-100-ns{border-radius:100%}.swagger-ui .br-pill-ns{border-radius:9999px}.swagger-ui .br--bottom-ns{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-ns{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-ns{border-bottom-left-radius:0;border-top-left-radius:0}.swagger-ui .br--left-ns{border-bottom-right-radius:0;border-top-right-radius:0}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .br0-m{border-radius:0}.swagger-ui .br1-m{border-radius:.125rem}.swagger-ui .br2-m{border-radius:.25rem}.swagger-ui .br3-m{border-radius:.5rem}.swagger-ui .br4-m{border-radius:1rem}.swagger-ui .br-100-m{border-radius:100%}.swagger-ui .br-pill-m{border-radius:9999px}.swagger-ui .br--bottom-m{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-m{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-m{border-bottom-left-radius:0;border-top-left-radius:0}.swagger-ui .br--left-m{border-bottom-right-radius:0;border-top-right-radius:0}}@media screen and (min-width:60em){.swagger-ui .br0-l{border-radius:0}.swagger-ui .br1-l{border-radius:.125rem}.swagger-ui .br2-l{border-radius:.25rem}.swagger-ui .br3-l{border-radius:.5rem}.swagger-ui .br4-l{border-radius:1rem}.swagger-ui .br-100-l{border-radius:100%}.swagger-ui .br-pill-l{border-radius:9999px}.swagger-ui .br--bottom-l{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-l{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-l{border-bottom-left-radius:0;border-top-left-radius:0}.swagger-ui .br--left-l{border-bottom-right-radius:0;border-top-right-radius:0}}.swagger-ui .b--dotted{border-style:dotted}.swagger-ui .b--dashed{border-style:dashed}.swagger-ui .b--solid{border-style:solid}.swagger-ui .b--none{border-style:none}@media screen and (min-width:30em){.swagger-ui .b--dotted-ns{border-style:dotted}.swagger-ui .b--dashed-ns{border-style:dashed}.swagger-ui .b--solid-ns{border-style:solid}.swagger-ui .b--none-ns{border-style:none}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .b--dotted-m{border-style:dotted}.swagger-ui .b--dashed-m{border-style:dashed}.swagger-ui .b--solid-m{border-style:solid}.swagger-ui .b--none-m{border-style:none}}@media screen and (min-width:60em){.swagger-ui .b--dotted-l{border-style:dotted}.swagger-ui .b--dashed-l{border-style:dashed}.swagger-ui .b--solid-l{border-style:solid}.swagger-ui .b--none-l{border-style:none}}.swagger-ui .bw0{border-width:0}.swagger-ui .bw1{border-width:.125rem}.swagger-ui .bw2{border-width:.25rem}.swagger-ui .bw3{border-width:.5rem}.swagger-ui .bw4{border-width:1rem}.swagger-ui .bw5{border-width:2rem}.swagger-ui .bt-0{border-top-width:0}.swagger-ui .br-0{border-right-width:0}.swagger-ui .bb-0{border-bottom-width:0}.swagger-ui .bl-0{border-left-width:0}@media screen and (min-width:30em){.swagger-ui .bw0-ns{border-width:0}.swagger-ui .bw1-ns{border-width:.125rem}.swagger-ui .bw2-ns{border-width:.25rem}.swagger-ui .bw3-ns{border-width:.5rem}.swagger-ui .bw4-ns{border-width:1rem}.swagger-ui .bw5-ns{border-width:2rem}.swagger-ui .bt-0-ns{border-top-width:0}.swagger-ui .br-0-ns{border-right-width:0}.swagger-ui .bb-0-ns{border-bottom-width:0}.swagger-ui .bl-0-ns{border-left-width:0}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .bw0-m{border-width:0}.swagger-ui .bw1-m{border-width:.125rem}.swagger-ui .bw2-m{border-width:.25rem}.swagger-ui .bw3-m{border-width:.5rem}.swagger-ui .bw4-m{border-width:1rem}.swagger-ui .bw5-m{border-width:2rem}.swagger-ui .bt-0-m{border-top-width:0}.swagger-ui .br-0-m{border-right-width:0}.swagger-ui .bb-0-m{border-bottom-width:0}.swagger-ui .bl-0-m{border-left-width:0}}@media screen and (min-width:60em){.swagger-ui .bw0-l{border-width:0}.swagger-ui .bw1-l{border-width:.125rem}.swagger-ui .bw2-l{border-width:.25rem}.swagger-ui .bw3-l{border-width:.5rem}.swagger-ui .bw4-l{border-width:1rem}.swagger-ui .bw5-l{border-width:2rem}.swagger-ui .bt-0-l{border-top-width:0}.swagger-ui .br-0-l{border-right-width:0}.swagger-ui .bb-0-l{border-bottom-width:0}.swagger-ui .bl-0-l{border-left-width:0}}.swagger-ui .shadow-1{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}@media screen and (min-width:30em){.swagger-ui .shadow-1-ns{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-ns{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-ns{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-ns{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-ns{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .shadow-1-m{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-m{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-m{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-m{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-m{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}@media screen and (min-width:60em){.swagger-ui .shadow-1-l{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-l{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-l{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-l{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-l{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}.swagger-ui .pre{overflow-x:auto;overflow-y:hidden;overflow:scroll}.swagger-ui .top-0{top:0}.swagger-ui .right-0{right:0}.swagger-ui .bottom-0{bottom:0}.swagger-ui .left-0{left:0}.swagger-ui .top-1{top:1rem}.swagger-ui .right-1{right:1rem}.swagger-ui .bottom-1{bottom:1rem}.swagger-ui .left-1{left:1rem}.swagger-ui .top-2{top:2rem}.swagger-ui .right-2{right:2rem}.swagger-ui .bottom-2{bottom:2rem}.swagger-ui .left-2{left:2rem}.swagger-ui .top--1{top:-1rem}.swagger-ui .right--1{right:-1rem}.swagger-ui .bottom--1{bottom:-1rem}.swagger-ui .left--1{left:-1rem}.swagger-ui .top--2{top:-2rem}.swagger-ui .right--2{right:-2rem}.swagger-ui .bottom--2{bottom:-2rem}.swagger-ui .left--2{left:-2rem}.swagger-ui .absolute--fill{bottom:0;left:0;right:0;top:0}@media screen and (min-width:30em){.swagger-ui .top-0-ns{top:0}.swagger-ui .left-0-ns{left:0}.swagger-ui .right-0-ns{right:0}.swagger-ui .bottom-0-ns{bottom:0}.swagger-ui .top-1-ns{top:1rem}.swagger-ui .left-1-ns{left:1rem}.swagger-ui .right-1-ns{right:1rem}.swagger-ui .bottom-1-ns{bottom:1rem}.swagger-ui .top-2-ns{top:2rem}.swagger-ui .left-2-ns{left:2rem}.swagger-ui .right-2-ns{right:2rem}.swagger-ui .bottom-2-ns{bottom:2rem}.swagger-ui .top--1-ns{top:-1rem}.swagger-ui .right--1-ns{right:-1rem}.swagger-ui .bottom--1-ns{bottom:-1rem}.swagger-ui .left--1-ns{left:-1rem}.swagger-ui .top--2-ns{top:-2rem}.swagger-ui .right--2-ns{right:-2rem}.swagger-ui .bottom--2-ns{bottom:-2rem}.swagger-ui .left--2-ns{left:-2rem}.swagger-ui .absolute--fill-ns{bottom:0;left:0;right:0;top:0}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .top-0-m{top:0}.swagger-ui .left-0-m{left:0}.swagger-ui .right-0-m{right:0}.swagger-ui .bottom-0-m{bottom:0}.swagger-ui .top-1-m{top:1rem}.swagger-ui .left-1-m{left:1rem}.swagger-ui .right-1-m{right:1rem}.swagger-ui .bottom-1-m{bottom:1rem}.swagger-ui .top-2-m{top:2rem}.swagger-ui .left-2-m{left:2rem}.swagger-ui .right-2-m{right:2rem}.swagger-ui .bottom-2-m{bottom:2rem}.swagger-ui .top--1-m{top:-1rem}.swagger-ui .right--1-m{right:-1rem}.swagger-ui .bottom--1-m{bottom:-1rem}.swagger-ui .left--1-m{left:-1rem}.swagger-ui .top--2-m{top:-2rem}.swagger-ui .right--2-m{right:-2rem}.swagger-ui .bottom--2-m{bottom:-2rem}.swagger-ui .left--2-m{left:-2rem}.swagger-ui .absolute--fill-m{bottom:0;left:0;right:0;top:0}}@media screen and (min-width:60em){.swagger-ui .top-0-l{top:0}.swagger-ui .left-0-l{left:0}.swagger-ui .right-0-l{right:0}.swagger-ui .bottom-0-l{bottom:0}.swagger-ui .top-1-l{top:1rem}.swagger-ui .left-1-l{left:1rem}.swagger-ui .right-1-l{right:1rem}.swagger-ui .bottom-1-l{bottom:1rem}.swagger-ui .top-2-l{top:2rem}.swagger-ui .left-2-l{left:2rem}.swagger-ui .right-2-l{right:2rem}.swagger-ui .bottom-2-l{bottom:2rem}.swagger-ui .top--1-l{top:-1rem}.swagger-ui .right--1-l{right:-1rem}.swagger-ui .bottom--1-l{bottom:-1rem}.swagger-ui .left--1-l{left:-1rem}.swagger-ui .top--2-l{top:-2rem}.swagger-ui .right--2-l{right:-2rem}.swagger-ui .bottom--2-l{bottom:-2rem}.swagger-ui .left--2-l{left:-2rem}.swagger-ui .absolute--fill-l{bottom:0;left:0;right:0;top:0}}.swagger-ui .cf:after,.swagger-ui .cf:before{content:\" \";display:table}.swagger-ui .cf:after{clear:both}.swagger-ui .cf{zoom:1}.swagger-ui .cl{clear:left}.swagger-ui .cr{clear:right}.swagger-ui .cb{clear:both}.swagger-ui .cn{clear:none}@media screen and (min-width:30em){.swagger-ui .cl-ns{clear:left}.swagger-ui .cr-ns{clear:right}.swagger-ui .cb-ns{clear:both}.swagger-ui .cn-ns{clear:none}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .cl-m{clear:left}.swagger-ui .cr-m{clear:right}.swagger-ui .cb-m{clear:both}.swagger-ui .cn-m{clear:none}}@media screen and (min-width:60em){.swagger-ui .cl-l{clear:left}.swagger-ui .cr-l{clear:right}.swagger-ui .cb-l{clear:both}.swagger-ui .cn-l{clear:none}}.swagger-ui .flex{display:flex}.swagger-ui .inline-flex{display:inline-flex}.swagger-ui .flex-auto{flex:1 1 auto;min-height:0;min-width:0}.swagger-ui .flex-none{flex:none}.swagger-ui .flex-column{flex-direction:column}.swagger-ui .flex-row{flex-direction:row}.swagger-ui .flex-wrap{flex-wrap:wrap}.swagger-ui .flex-nowrap{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse{flex-direction:column-reverse}.swagger-ui .flex-row-reverse{flex-direction:row-reverse}.swagger-ui .items-start{align-items:flex-start}.swagger-ui .items-end{align-items:flex-end}.swagger-ui .items-center{align-items:center}.swagger-ui .items-baseline{align-items:baseline}.swagger-ui .items-stretch{align-items:stretch}.swagger-ui .self-start{align-self:flex-start}.swagger-ui .self-end{align-self:flex-end}.swagger-ui .self-center{align-self:center}.swagger-ui .self-baseline{align-self:baseline}.swagger-ui .self-stretch{align-self:stretch}.swagger-ui .justify-start{justify-content:flex-start}.swagger-ui .justify-end{justify-content:flex-end}.swagger-ui .justify-center{justify-content:center}.swagger-ui .justify-between{justify-content:space-between}.swagger-ui .justify-around{justify-content:space-around}.swagger-ui .content-start{align-content:flex-start}.swagger-ui .content-end{align-content:flex-end}.swagger-ui .content-center{align-content:center}.swagger-ui .content-between{align-content:space-between}.swagger-ui .content-around{align-content:space-around}.swagger-ui .content-stretch{align-content:stretch}.swagger-ui .order-0{order:0}.swagger-ui .order-1{order:1}.swagger-ui .order-2{order:2}.swagger-ui .order-3{order:3}.swagger-ui .order-4{order:4}.swagger-ui .order-5{order:5}.swagger-ui .order-6{order:6}.swagger-ui .order-7{order:7}.swagger-ui .order-8{order:8}.swagger-ui .order-last{order:99999}.swagger-ui .flex-grow-0{flex-grow:0}.swagger-ui .flex-grow-1{flex-grow:1}.swagger-ui .flex-shrink-0{flex-shrink:0}.swagger-ui .flex-shrink-1{flex-shrink:1}@media screen and (min-width:30em){.swagger-ui .flex-ns{display:flex}.swagger-ui .inline-flex-ns{display:inline-flex}.swagger-ui .flex-auto-ns{flex:1 1 auto;min-height:0;min-width:0}.swagger-ui .flex-none-ns{flex:none}.swagger-ui .flex-column-ns{flex-direction:column}.swagger-ui .flex-row-ns{flex-direction:row}.swagger-ui .flex-wrap-ns{flex-wrap:wrap}.swagger-ui .flex-nowrap-ns{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-ns{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-ns{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-ns{flex-direction:row-reverse}.swagger-ui .items-start-ns{align-items:flex-start}.swagger-ui .items-end-ns{align-items:flex-end}.swagger-ui .items-center-ns{align-items:center}.swagger-ui .items-baseline-ns{align-items:baseline}.swagger-ui .items-stretch-ns{align-items:stretch}.swagger-ui .self-start-ns{align-self:flex-start}.swagger-ui .self-end-ns{align-self:flex-end}.swagger-ui .self-center-ns{align-self:center}.swagger-ui .self-baseline-ns{align-self:baseline}.swagger-ui .self-stretch-ns{align-self:stretch}.swagger-ui .justify-start-ns{justify-content:flex-start}.swagger-ui .justify-end-ns{justify-content:flex-end}.swagger-ui .justify-center-ns{justify-content:center}.swagger-ui .justify-between-ns{justify-content:space-between}.swagger-ui .justify-around-ns{justify-content:space-around}.swagger-ui .content-start-ns{align-content:flex-start}.swagger-ui .content-end-ns{align-content:flex-end}.swagger-ui .content-center-ns{align-content:center}.swagger-ui .content-between-ns{align-content:space-between}.swagger-ui .content-around-ns{align-content:space-around}.swagger-ui .content-stretch-ns{align-content:stretch}.swagger-ui .order-0-ns{order:0}.swagger-ui .order-1-ns{order:1}.swagger-ui .order-2-ns{order:2}.swagger-ui .order-3-ns{order:3}.swagger-ui .order-4-ns{order:4}.swagger-ui .order-5-ns{order:5}.swagger-ui .order-6-ns{order:6}.swagger-ui .order-7-ns{order:7}.swagger-ui .order-8-ns{order:8}.swagger-ui .order-last-ns{order:99999}.swagger-ui .flex-grow-0-ns{flex-grow:0}.swagger-ui .flex-grow-1-ns{flex-grow:1}.swagger-ui .flex-shrink-0-ns{flex-shrink:0}.swagger-ui .flex-shrink-1-ns{flex-shrink:1}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .flex-m{display:flex}.swagger-ui .inline-flex-m{display:inline-flex}.swagger-ui .flex-auto-m{flex:1 1 auto;min-height:0;min-width:0}.swagger-ui .flex-none-m{flex:none}.swagger-ui .flex-column-m{flex-direction:column}.swagger-ui .flex-row-m{flex-direction:row}.swagger-ui .flex-wrap-m{flex-wrap:wrap}.swagger-ui .flex-nowrap-m{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-m{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-m{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-m{flex-direction:row-reverse}.swagger-ui .items-start-m{align-items:flex-start}.swagger-ui .items-end-m{align-items:flex-end}.swagger-ui .items-center-m{align-items:center}.swagger-ui .items-baseline-m{align-items:baseline}.swagger-ui .items-stretch-m{align-items:stretch}.swagger-ui .self-start-m{align-self:flex-start}.swagger-ui .self-end-m{align-self:flex-end}.swagger-ui .self-center-m{align-self:center}.swagger-ui .self-baseline-m{align-self:baseline}.swagger-ui .self-stretch-m{align-self:stretch}.swagger-ui .justify-start-m{justify-content:flex-start}.swagger-ui .justify-end-m{justify-content:flex-end}.swagger-ui .justify-center-m{justify-content:center}.swagger-ui .justify-between-m{justify-content:space-between}.swagger-ui .justify-around-m{justify-content:space-around}.swagger-ui .content-start-m{align-content:flex-start}.swagger-ui .content-end-m{align-content:flex-end}.swagger-ui .content-center-m{align-content:center}.swagger-ui .content-between-m{align-content:space-between}.swagger-ui .content-around-m{align-content:space-around}.swagger-ui .content-stretch-m{align-content:stretch}.swagger-ui .order-0-m{order:0}.swagger-ui .order-1-m{order:1}.swagger-ui .order-2-m{order:2}.swagger-ui .order-3-m{order:3}.swagger-ui .order-4-m{order:4}.swagger-ui .order-5-m{order:5}.swagger-ui .order-6-m{order:6}.swagger-ui .order-7-m{order:7}.swagger-ui .order-8-m{order:8}.swagger-ui .order-last-m{order:99999}.swagger-ui .flex-grow-0-m{flex-grow:0}.swagger-ui .flex-grow-1-m{flex-grow:1}.swagger-ui .flex-shrink-0-m{flex-shrink:0}.swagger-ui .flex-shrink-1-m{flex-shrink:1}}@media screen and (min-width:60em){.swagger-ui .flex-l{display:flex}.swagger-ui .inline-flex-l{display:inline-flex}.swagger-ui .flex-auto-l{flex:1 1 auto;min-height:0;min-width:0}.swagger-ui .flex-none-l{flex:none}.swagger-ui .flex-column-l{flex-direction:column}.swagger-ui .flex-row-l{flex-direction:row}.swagger-ui .flex-wrap-l{flex-wrap:wrap}.swagger-ui .flex-nowrap-l{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-l{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-l{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-l{flex-direction:row-reverse}.swagger-ui .items-start-l{align-items:flex-start}.swagger-ui .items-end-l{align-items:flex-end}.swagger-ui .items-center-l{align-items:center}.swagger-ui .items-baseline-l{align-items:baseline}.swagger-ui .items-stretch-l{align-items:stretch}.swagger-ui .self-start-l{align-self:flex-start}.swagger-ui .self-end-l{align-self:flex-end}.swagger-ui .self-center-l{align-self:center}.swagger-ui .self-baseline-l{align-self:baseline}.swagger-ui .self-stretch-l{align-self:stretch}.swagger-ui .justify-start-l{justify-content:flex-start}.swagger-ui .justify-end-l{justify-content:flex-end}.swagger-ui .justify-center-l{justify-content:center}.swagger-ui .justify-between-l{justify-content:space-between}.swagger-ui .justify-around-l{justify-content:space-around}.swagger-ui .content-start-l{align-content:flex-start}.swagger-ui .content-end-l{align-content:flex-end}.swagger-ui .content-center-l{align-content:center}.swagger-ui .content-between-l{align-content:space-between}.swagger-ui .content-around-l{align-content:space-around}.swagger-ui .content-stretch-l{align-content:stretch}.swagger-ui .order-0-l{order:0}.swagger-ui .order-1-l{order:1}.swagger-ui .order-2-l{order:2}.swagger-ui .order-3-l{order:3}.swagger-ui .order-4-l{order:4}.swagger-ui .order-5-l{order:5}.swagger-ui .order-6-l{order:6}.swagger-ui .order-7-l{order:7}.swagger-ui .order-8-l{order:8}.swagger-ui .order-last-l{order:99999}.swagger-ui .flex-grow-0-l{flex-grow:0}.swagger-ui .flex-grow-1-l{flex-grow:1}.swagger-ui .flex-shrink-0-l{flex-shrink:0}.swagger-ui .flex-shrink-1-l{flex-shrink:1}}.swagger-ui .dn{display:none}.swagger-ui .di{display:inline}.swagger-ui .db{display:block}.swagger-ui .dib{display:inline-block}.swagger-ui .dit{display:inline-table}.swagger-ui .dt{display:table}.swagger-ui .dtc{display:table-cell}.swagger-ui .dt-row{display:table-row}.swagger-ui .dt-row-group{display:table-row-group}.swagger-ui .dt-column{display:table-column}.swagger-ui .dt-column-group{display:table-column-group}.swagger-ui .dt--fixed{table-layout:fixed;width:100%}@media screen and (min-width:30em){.swagger-ui .dn-ns{display:none}.swagger-ui .di-ns{display:inline}.swagger-ui .db-ns{display:block}.swagger-ui .dib-ns{display:inline-block}.swagger-ui .dit-ns{display:inline-table}.swagger-ui .dt-ns{display:table}.swagger-ui .dtc-ns{display:table-cell}.swagger-ui .dt-row-ns{display:table-row}.swagger-ui .dt-row-group-ns{display:table-row-group}.swagger-ui .dt-column-ns{display:table-column}.swagger-ui .dt-column-group-ns{display:table-column-group}.swagger-ui .dt--fixed-ns{table-layout:fixed;width:100%}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .dn-m{display:none}.swagger-ui .di-m{display:inline}.swagger-ui .db-m{display:block}.swagger-ui .dib-m{display:inline-block}.swagger-ui .dit-m{display:inline-table}.swagger-ui .dt-m{display:table}.swagger-ui .dtc-m{display:table-cell}.swagger-ui .dt-row-m{display:table-row}.swagger-ui .dt-row-group-m{display:table-row-group}.swagger-ui .dt-column-m{display:table-column}.swagger-ui .dt-column-group-m{display:table-column-group}.swagger-ui .dt--fixed-m{table-layout:fixed;width:100%}}@media screen and (min-width:60em){.swagger-ui .dn-l{display:none}.swagger-ui .di-l{display:inline}.swagger-ui .db-l{display:block}.swagger-ui .dib-l{display:inline-block}.swagger-ui .dit-l{display:inline-table}.swagger-ui .dt-l{display:table}.swagger-ui .dtc-l{display:table-cell}.swagger-ui .dt-row-l{display:table-row}.swagger-ui .dt-row-group-l{display:table-row-group}.swagger-ui .dt-column-l{display:table-column}.swagger-ui .dt-column-group-l{display:table-column-group}.swagger-ui .dt--fixed-l{table-layout:fixed;width:100%}}.swagger-ui .fl{_display:inline;float:left}.swagger-ui .fr{_display:inline;float:right}.swagger-ui .fn{float:none}@media screen and (min-width:30em){.swagger-ui .fl-ns{_display:inline;float:left}.swagger-ui .fr-ns{_display:inline;float:right}.swagger-ui .fn-ns{float:none}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .fl-m{_display:inline;float:left}.swagger-ui .fr-m{_display:inline;float:right}.swagger-ui .fn-m{float:none}}@media screen and (min-width:60em){.swagger-ui .fl-l{_display:inline;float:left}.swagger-ui .fr-l{_display:inline;float:right}.swagger-ui .fn-l{float:none}}.swagger-ui .sans-serif{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica,helvetica neue,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.swagger-ui .serif{font-family:georgia,serif}.swagger-ui .system-sans-serif{font-family:sans-serif}.swagger-ui .system-serif{font-family:serif}.swagger-ui .code,.swagger-ui code{font-family:Consolas,monaco,monospace}.swagger-ui .courier{font-family:Courier Next,courier,monospace}.swagger-ui .helvetica{font-family:helvetica neue,helvetica,sans-serif}.swagger-ui .avenir{font-family:avenir next,avenir,sans-serif}.swagger-ui .athelas{font-family:athelas,georgia,serif}.swagger-ui .georgia{font-family:georgia,serif}.swagger-ui .times{font-family:times,serif}.swagger-ui .bodoni{font-family:Bodoni MT,serif}.swagger-ui .calisto{font-family:Calisto MT,serif}.swagger-ui .garamond{font-family:garamond,serif}.swagger-ui .baskerville{font-family:baskerville,serif}.swagger-ui .i{font-style:italic}.swagger-ui .fs-normal{font-style:normal}@media screen and (min-width:30em){.swagger-ui .i-ns{font-style:italic}.swagger-ui .fs-normal-ns{font-style:normal}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .i-m{font-style:italic}.swagger-ui .fs-normal-m{font-style:normal}}@media screen and (min-width:60em){.swagger-ui .i-l{font-style:italic}.swagger-ui .fs-normal-l{font-style:normal}}.swagger-ui .normal{font-weight:400}.swagger-ui .b{font-weight:700}.swagger-ui .fw1{font-weight:100}.swagger-ui .fw2{font-weight:200}.swagger-ui .fw3{font-weight:300}.swagger-ui .fw4{font-weight:400}.swagger-ui .fw5{font-weight:500}.swagger-ui .fw6{font-weight:600}.swagger-ui .fw7{font-weight:700}.swagger-ui .fw8{font-weight:800}.swagger-ui .fw9{font-weight:900}@media screen and (min-width:30em){.swagger-ui .normal-ns{font-weight:400}.swagger-ui .b-ns{font-weight:700}.swagger-ui .fw1-ns{font-weight:100}.swagger-ui .fw2-ns{font-weight:200}.swagger-ui .fw3-ns{font-weight:300}.swagger-ui .fw4-ns{font-weight:400}.swagger-ui .fw5-ns{font-weight:500}.swagger-ui .fw6-ns{font-weight:600}.swagger-ui .fw7-ns{font-weight:700}.swagger-ui .fw8-ns{font-weight:800}.swagger-ui .fw9-ns{font-weight:900}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .normal-m{font-weight:400}.swagger-ui .b-m{font-weight:700}.swagger-ui .fw1-m{font-weight:100}.swagger-ui .fw2-m{font-weight:200}.swagger-ui .fw3-m{font-weight:300}.swagger-ui .fw4-m{font-weight:400}.swagger-ui .fw5-m{font-weight:500}.swagger-ui .fw6-m{font-weight:600}.swagger-ui .fw7-m{font-weight:700}.swagger-ui .fw8-m{font-weight:800}.swagger-ui .fw9-m{font-weight:900}}@media screen and (min-width:60em){.swagger-ui .normal-l{font-weight:400}.swagger-ui .b-l{font-weight:700}.swagger-ui .fw1-l{font-weight:100}.swagger-ui .fw2-l{font-weight:200}.swagger-ui .fw3-l{font-weight:300}.swagger-ui .fw4-l{font-weight:400}.swagger-ui .fw5-l{font-weight:500}.swagger-ui .fw6-l{font-weight:600}.swagger-ui .fw7-l{font-weight:700}.swagger-ui .fw8-l{font-weight:800}.swagger-ui .fw9-l{font-weight:900}}.swagger-ui .input-reset{-webkit-appearance:none;-moz-appearance:none}.swagger-ui .button-reset::-moz-focus-inner,.swagger-ui .input-reset::-moz-focus-inner{border:0;padding:0}.swagger-ui .h1{height:1rem}.swagger-ui .h2{height:2rem}.swagger-ui .h3{height:4rem}.swagger-ui .h4{height:8rem}.swagger-ui .h5{height:16rem}.swagger-ui .h-25{height:25%}.swagger-ui .h-50{height:50%}.swagger-ui .h-75{height:75%}.swagger-ui .h-100{height:100%}.swagger-ui .min-h-100{min-height:100%}.swagger-ui .vh-25{height:25vh}.swagger-ui .vh-50{height:50vh}.swagger-ui .vh-75{height:75vh}.swagger-ui .vh-100{height:100vh}.swagger-ui .min-vh-100{min-height:100vh}.swagger-ui .h-auto{height:auto}.swagger-ui .h-inherit{height:inherit}@media screen and (min-width:30em){.swagger-ui .h1-ns{height:1rem}.swagger-ui .h2-ns{height:2rem}.swagger-ui .h3-ns{height:4rem}.swagger-ui .h4-ns{height:8rem}.swagger-ui .h5-ns{height:16rem}.swagger-ui .h-25-ns{height:25%}.swagger-ui .h-50-ns{height:50%}.swagger-ui .h-75-ns{height:75%}.swagger-ui .h-100-ns{height:100%}.swagger-ui .min-h-100-ns{min-height:100%}.swagger-ui .vh-25-ns{height:25vh}.swagger-ui .vh-50-ns{height:50vh}.swagger-ui .vh-75-ns{height:75vh}.swagger-ui .vh-100-ns{height:100vh}.swagger-ui .min-vh-100-ns{min-height:100vh}.swagger-ui .h-auto-ns{height:auto}.swagger-ui .h-inherit-ns{height:inherit}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .h1-m{height:1rem}.swagger-ui .h2-m{height:2rem}.swagger-ui .h3-m{height:4rem}.swagger-ui .h4-m{height:8rem}.swagger-ui .h5-m{height:16rem}.swagger-ui .h-25-m{height:25%}.swagger-ui .h-50-m{height:50%}.swagger-ui .h-75-m{height:75%}.swagger-ui .h-100-m{height:100%}.swagger-ui .min-h-100-m{min-height:100%}.swagger-ui .vh-25-m{height:25vh}.swagger-ui .vh-50-m{height:50vh}.swagger-ui .vh-75-m{height:75vh}.swagger-ui .vh-100-m{height:100vh}.swagger-ui .min-vh-100-m{min-height:100vh}.swagger-ui .h-auto-m{height:auto}.swagger-ui .h-inherit-m{height:inherit}}@media screen and (min-width:60em){.swagger-ui .h1-l{height:1rem}.swagger-ui .h2-l{height:2rem}.swagger-ui .h3-l{height:4rem}.swagger-ui .h4-l{height:8rem}.swagger-ui .h5-l{height:16rem}.swagger-ui .h-25-l{height:25%}.swagger-ui .h-50-l{height:50%}.swagger-ui .h-75-l{height:75%}.swagger-ui .h-100-l{height:100%}.swagger-ui .min-h-100-l{min-height:100%}.swagger-ui .vh-25-l{height:25vh}.swagger-ui .vh-50-l{height:50vh}.swagger-ui .vh-75-l{height:75vh}.swagger-ui .vh-100-l{height:100vh}.swagger-ui .min-vh-100-l{min-height:100vh}.swagger-ui .h-auto-l{height:auto}.swagger-ui .h-inherit-l{height:inherit}}.swagger-ui .tracked{letter-spacing:.1em}.swagger-ui .tracked-tight{letter-spacing:-.05em}.swagger-ui .tracked-mega{letter-spacing:.25em}@media screen and (min-width:30em){.swagger-ui .tracked-ns{letter-spacing:.1em}.swagger-ui .tracked-tight-ns{letter-spacing:-.05em}.swagger-ui .tracked-mega-ns{letter-spacing:.25em}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .tracked-m{letter-spacing:.1em}.swagger-ui .tracked-tight-m{letter-spacing:-.05em}.swagger-ui .tracked-mega-m{letter-spacing:.25em}}@media screen and (min-width:60em){.swagger-ui .tracked-l{letter-spacing:.1em}.swagger-ui .tracked-tight-l{letter-spacing:-.05em}.swagger-ui .tracked-mega-l{letter-spacing:.25em}}.swagger-ui .lh-solid{line-height:1}.swagger-ui .lh-title{line-height:1.25}.swagger-ui .lh-copy{line-height:1.5}@media screen and (min-width:30em){.swagger-ui .lh-solid-ns{line-height:1}.swagger-ui .lh-title-ns{line-height:1.25}.swagger-ui .lh-copy-ns{line-height:1.5}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .lh-solid-m{line-height:1}.swagger-ui .lh-title-m{line-height:1.25}.swagger-ui .lh-copy-m{line-height:1.5}}@media screen and (min-width:60em){.swagger-ui .lh-solid-l{line-height:1}.swagger-ui .lh-title-l{line-height:1.25}.swagger-ui .lh-copy-l{line-height:1.5}}.swagger-ui .link{-webkit-text-decoration:none;text-decoration:none}.swagger-ui .link,.swagger-ui .link:active,.swagger-ui .link:focus,.swagger-ui .link:hover,.swagger-ui .link:link,.swagger-ui .link:visited{transition:color .15s ease-in}.swagger-ui .link:focus{outline:1px dotted currentColor}.swagger-ui .list{list-style-type:none}.swagger-ui .mw-100{max-width:100%}.swagger-ui .mw1{max-width:1rem}.swagger-ui .mw2{max-width:2rem}.swagger-ui .mw3{max-width:4rem}.swagger-ui .mw4{max-width:8rem}.swagger-ui .mw5{max-width:16rem}.swagger-ui .mw6{max-width:32rem}.swagger-ui .mw7{max-width:48rem}.swagger-ui .mw8{max-width:64rem}.swagger-ui .mw9{max-width:96rem}.swagger-ui .mw-none{max-width:none}@media screen and (min-width:30em){.swagger-ui .mw-100-ns{max-width:100%}.swagger-ui .mw1-ns{max-width:1rem}.swagger-ui .mw2-ns{max-width:2rem}.swagger-ui .mw3-ns{max-width:4rem}.swagger-ui .mw4-ns{max-width:8rem}.swagger-ui .mw5-ns{max-width:16rem}.swagger-ui .mw6-ns{max-width:32rem}.swagger-ui .mw7-ns{max-width:48rem}.swagger-ui .mw8-ns{max-width:64rem}.swagger-ui .mw9-ns{max-width:96rem}.swagger-ui .mw-none-ns{max-width:none}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .mw-100-m{max-width:100%}.swagger-ui .mw1-m{max-width:1rem}.swagger-ui .mw2-m{max-width:2rem}.swagger-ui .mw3-m{max-width:4rem}.swagger-ui .mw4-m{max-width:8rem}.swagger-ui .mw5-m{max-width:16rem}.swagger-ui .mw6-m{max-width:32rem}.swagger-ui .mw7-m{max-width:48rem}.swagger-ui .mw8-m{max-width:64rem}.swagger-ui .mw9-m{max-width:96rem}.swagger-ui .mw-none-m{max-width:none}}@media screen and (min-width:60em){.swagger-ui .mw-100-l{max-width:100%}.swagger-ui .mw1-l{max-width:1rem}.swagger-ui .mw2-l{max-width:2rem}.swagger-ui .mw3-l{max-width:4rem}.swagger-ui .mw4-l{max-width:8rem}.swagger-ui .mw5-l{max-width:16rem}.swagger-ui .mw6-l{max-width:32rem}.swagger-ui .mw7-l{max-width:48rem}.swagger-ui .mw8-l{max-width:64rem}.swagger-ui .mw9-l{max-width:96rem}.swagger-ui .mw-none-l{max-width:none}}.swagger-ui .w1{width:1rem}.swagger-ui .w2{width:2rem}.swagger-ui .w3{width:4rem}.swagger-ui .w4{width:8rem}.swagger-ui .w5{width:16rem}.swagger-ui .w-10{width:10%}.swagger-ui .w-20{width:20%}.swagger-ui .w-25{width:25%}.swagger-ui .w-30{width:30%}.swagger-ui .w-33{width:33%}.swagger-ui .w-34{width:34%}.swagger-ui .w-40{width:40%}.swagger-ui .w-50{width:50%}.swagger-ui .w-60{width:60%}.swagger-ui .w-70{width:70%}.swagger-ui .w-75{width:75%}.swagger-ui .w-80{width:80%}.swagger-ui .w-90{width:90%}.swagger-ui .w-100{width:100%}.swagger-ui .w-third{width:33.3333333333%}.swagger-ui .w-two-thirds{width:66.6666666667%}.swagger-ui .w-auto{width:auto}@media screen and (min-width:30em){.swagger-ui .w1-ns{width:1rem}.swagger-ui .w2-ns{width:2rem}.swagger-ui .w3-ns{width:4rem}.swagger-ui .w4-ns{width:8rem}.swagger-ui .w5-ns{width:16rem}.swagger-ui .w-10-ns{width:10%}.swagger-ui .w-20-ns{width:20%}.swagger-ui .w-25-ns{width:25%}.swagger-ui .w-30-ns{width:30%}.swagger-ui .w-33-ns{width:33%}.swagger-ui .w-34-ns{width:34%}.swagger-ui .w-40-ns{width:40%}.swagger-ui .w-50-ns{width:50%}.swagger-ui .w-60-ns{width:60%}.swagger-ui .w-70-ns{width:70%}.swagger-ui .w-75-ns{width:75%}.swagger-ui .w-80-ns{width:80%}.swagger-ui .w-90-ns{width:90%}.swagger-ui .w-100-ns{width:100%}.swagger-ui .w-third-ns{width:33.3333333333%}.swagger-ui .w-two-thirds-ns{width:66.6666666667%}.swagger-ui .w-auto-ns{width:auto}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .w1-m{width:1rem}.swagger-ui .w2-m{width:2rem}.swagger-ui .w3-m{width:4rem}.swagger-ui .w4-m{width:8rem}.swagger-ui .w5-m{width:16rem}.swagger-ui .w-10-m{width:10%}.swagger-ui .w-20-m{width:20%}.swagger-ui .w-25-m{width:25%}.swagger-ui .w-30-m{width:30%}.swagger-ui .w-33-m{width:33%}.swagger-ui .w-34-m{width:34%}.swagger-ui .w-40-m{width:40%}.swagger-ui .w-50-m{width:50%}.swagger-ui .w-60-m{width:60%}.swagger-ui .w-70-m{width:70%}.swagger-ui .w-75-m{width:75%}.swagger-ui .w-80-m{width:80%}.swagger-ui .w-90-m{width:90%}.swagger-ui .w-100-m{width:100%}.swagger-ui .w-third-m{width:33.3333333333%}.swagger-ui .w-two-thirds-m{width:66.6666666667%}.swagger-ui .w-auto-m{width:auto}}@media screen and (min-width:60em){.swagger-ui .w1-l{width:1rem}.swagger-ui .w2-l{width:2rem}.swagger-ui .w3-l{width:4rem}.swagger-ui .w4-l{width:8rem}.swagger-ui .w5-l{width:16rem}.swagger-ui .w-10-l{width:10%}.swagger-ui .w-20-l{width:20%}.swagger-ui .w-25-l{width:25%}.swagger-ui .w-30-l{width:30%}.swagger-ui .w-33-l{width:33%}.swagger-ui .w-34-l{width:34%}.swagger-ui .w-40-l{width:40%}.swagger-ui .w-50-l{width:50%}.swagger-ui .w-60-l{width:60%}.swagger-ui .w-70-l{width:70%}.swagger-ui .w-75-l{width:75%}.swagger-ui .w-80-l{width:80%}.swagger-ui .w-90-l{width:90%}.swagger-ui .w-100-l{width:100%}.swagger-ui .w-third-l{width:33.3333333333%}.swagger-ui .w-two-thirds-l{width:66.6666666667%}.swagger-ui .w-auto-l{width:auto}}.swagger-ui .overflow-visible{overflow:visible}.swagger-ui .overflow-hidden{overflow:hidden}.swagger-ui .overflow-scroll{overflow:scroll}.swagger-ui .overflow-auto{overflow:auto}.swagger-ui .overflow-x-visible{overflow-x:visible}.swagger-ui .overflow-x-hidden{overflow-x:hidden}.swagger-ui .overflow-x-scroll{overflow-x:scroll}.swagger-ui .overflow-x-auto{overflow-x:auto}.swagger-ui .overflow-y-visible{overflow-y:visible}.swagger-ui .overflow-y-hidden{overflow-y:hidden}.swagger-ui .overflow-y-scroll{overflow-y:scroll}.swagger-ui .overflow-y-auto{overflow-y:auto}@media screen and (min-width:30em){.swagger-ui .overflow-visible-ns{overflow:visible}.swagger-ui .overflow-hidden-ns{overflow:hidden}.swagger-ui .overflow-scroll-ns{overflow:scroll}.swagger-ui .overflow-auto-ns{overflow:auto}.swagger-ui .overflow-x-visible-ns{overflow-x:visible}.swagger-ui .overflow-x-hidden-ns{overflow-x:hidden}.swagger-ui .overflow-x-scroll-ns{overflow-x:scroll}.swagger-ui .overflow-x-auto-ns{overflow-x:auto}.swagger-ui .overflow-y-visible-ns{overflow-y:visible}.swagger-ui .overflow-y-hidden-ns{overflow-y:hidden}.swagger-ui .overflow-y-scroll-ns{overflow-y:scroll}.swagger-ui .overflow-y-auto-ns{overflow-y:auto}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .overflow-visible-m{overflow:visible}.swagger-ui .overflow-hidden-m{overflow:hidden}.swagger-ui .overflow-scroll-m{overflow:scroll}.swagger-ui .overflow-auto-m{overflow:auto}.swagger-ui .overflow-x-visible-m{overflow-x:visible}.swagger-ui .overflow-x-hidden-m{overflow-x:hidden}.swagger-ui .overflow-x-scroll-m{overflow-x:scroll}.swagger-ui .overflow-x-auto-m{overflow-x:auto}.swagger-ui .overflow-y-visible-m{overflow-y:visible}.swagger-ui .overflow-y-hidden-m{overflow-y:hidden}.swagger-ui .overflow-y-scroll-m{overflow-y:scroll}.swagger-ui .overflow-y-auto-m{overflow-y:auto}}@media screen and (min-width:60em){.swagger-ui .overflow-visible-l{overflow:visible}.swagger-ui .overflow-hidden-l{overflow:hidden}.swagger-ui .overflow-scroll-l{overflow:scroll}.swagger-ui .overflow-auto-l{overflow:auto}.swagger-ui .overflow-x-visible-l{overflow-x:visible}.swagger-ui .overflow-x-hidden-l{overflow-x:hidden}.swagger-ui .overflow-x-scroll-l{overflow-x:scroll}.swagger-ui .overflow-x-auto-l{overflow-x:auto}.swagger-ui .overflow-y-visible-l{overflow-y:visible}.swagger-ui .overflow-y-hidden-l{overflow-y:hidden}.swagger-ui .overflow-y-scroll-l{overflow-y:scroll}.swagger-ui .overflow-y-auto-l{overflow-y:auto}}.swagger-ui .static{position:static}.swagger-ui .relative{position:relative}.swagger-ui .absolute{position:absolute}.swagger-ui .fixed{position:fixed}@media screen and (min-width:30em){.swagger-ui .static-ns{position:static}.swagger-ui .relative-ns{position:relative}.swagger-ui .absolute-ns{position:absolute}.swagger-ui .fixed-ns{position:fixed}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .static-m{position:static}.swagger-ui .relative-m{position:relative}.swagger-ui .absolute-m{position:absolute}.swagger-ui .fixed-m{position:fixed}}@media screen and (min-width:60em){.swagger-ui .static-l{position:static}.swagger-ui .relative-l{position:relative}.swagger-ui .absolute-l{position:absolute}.swagger-ui .fixed-l{position:fixed}}.swagger-ui .o-100{opacity:1}.swagger-ui .o-90{opacity:.9}.swagger-ui .o-80{opacity:.8}.swagger-ui .o-70{opacity:.7}.swagger-ui .o-60{opacity:.6}.swagger-ui .o-50{opacity:.5}.swagger-ui .o-40{opacity:.4}.swagger-ui .o-30{opacity:.3}.swagger-ui .o-20{opacity:.2}.swagger-ui .o-10{opacity:.1}.swagger-ui .o-05{opacity:.05}.swagger-ui .o-025{opacity:.025}.swagger-ui .o-0{opacity:0}.swagger-ui .rotate-45{transform:rotate(45deg)}.swagger-ui .rotate-90{transform:rotate(90deg)}.swagger-ui .rotate-135{transform:rotate(135deg)}.swagger-ui .rotate-180{transform:rotate(180deg)}.swagger-ui .rotate-225{transform:rotate(225deg)}.swagger-ui .rotate-270{transform:rotate(270deg)}.swagger-ui .rotate-315{transform:rotate(315deg)}@media screen and (min-width:30em){.swagger-ui .rotate-45-ns{transform:rotate(45deg)}.swagger-ui .rotate-90-ns{transform:rotate(90deg)}.swagger-ui .rotate-135-ns{transform:rotate(135deg)}.swagger-ui .rotate-180-ns{transform:rotate(180deg)}.swagger-ui .rotate-225-ns{transform:rotate(225deg)}.swagger-ui .rotate-270-ns{transform:rotate(270deg)}.swagger-ui .rotate-315-ns{transform:rotate(315deg)}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .rotate-45-m{transform:rotate(45deg)}.swagger-ui .rotate-90-m{transform:rotate(90deg)}.swagger-ui .rotate-135-m{transform:rotate(135deg)}.swagger-ui .rotate-180-m{transform:rotate(180deg)}.swagger-ui .rotate-225-m{transform:rotate(225deg)}.swagger-ui .rotate-270-m{transform:rotate(270deg)}.swagger-ui .rotate-315-m{transform:rotate(315deg)}}@media screen and (min-width:60em){.swagger-ui .rotate-45-l{transform:rotate(45deg)}.swagger-ui .rotate-90-l{transform:rotate(90deg)}.swagger-ui .rotate-135-l{transform:rotate(135deg)}.swagger-ui .rotate-180-l{transform:rotate(180deg)}.swagger-ui .rotate-225-l{transform:rotate(225deg)}.swagger-ui .rotate-270-l{transform:rotate(270deg)}.swagger-ui .rotate-315-l{transform:rotate(315deg)}}.swagger-ui .black-90{color:rgba(0,0,0,.9)}.swagger-ui .black-80{color:rgba(0,0,0,.8)}.swagger-ui .black-70{color:rgba(0,0,0,.7)}.swagger-ui .black-60{color:rgba(0,0,0,.6)}.swagger-ui .black-50{color:rgba(0,0,0,.5)}.swagger-ui .black-40{color:rgba(0,0,0,.4)}.swagger-ui .black-30{color:rgba(0,0,0,.3)}.swagger-ui .black-20{color:rgba(0,0,0,.2)}.swagger-ui .black-10{color:rgba(0,0,0,.1)}.swagger-ui .black-05{color:rgba(0,0,0,.05)}.swagger-ui .white-90{color:hsla(0,0%,100%,.9)}.swagger-ui .white-80{color:hsla(0,0%,100%,.8)}.swagger-ui .white-70{color:hsla(0,0%,100%,.7)}.swagger-ui .white-60{color:hsla(0,0%,100%,.6)}.swagger-ui .white-50{color:hsla(0,0%,100%,.5)}.swagger-ui .white-40{color:hsla(0,0%,100%,.4)}.swagger-ui .white-30{color:hsla(0,0%,100%,.3)}.swagger-ui .white-20{color:hsla(0,0%,100%,.2)}.swagger-ui .white-10{color:hsla(0,0%,100%,.1)}.swagger-ui .black{color:#000}.swagger-ui .near-black{color:#111}.swagger-ui .dark-gray{color:#333}.swagger-ui .mid-gray{color:#555}.swagger-ui .gray{color:#777}.swagger-ui .silver{color:#999}.swagger-ui .light-silver{color:#aaa}.swagger-ui .moon-gray{color:#ccc}.swagger-ui .light-gray{color:#eee}.swagger-ui .near-white{color:#f4f4f4}.swagger-ui .white{color:#fff}.swagger-ui .dark-red{color:#e7040f}.swagger-ui .red{color:#ff4136}.swagger-ui .light-red{color:#ff725c}.swagger-ui .orange{color:#ff6300}.swagger-ui .gold{color:#ffb700}.swagger-ui .yellow{color:gold}.swagger-ui .light-yellow{color:#fbf1a9}.swagger-ui .purple{color:#5e2ca5}.swagger-ui .light-purple{color:#a463f2}.swagger-ui .dark-pink{color:#d5008f}.swagger-ui .hot-pink{color:#ff41b4}.swagger-ui .pink{color:#ff80cc}.swagger-ui .light-pink{color:#ffa3d7}.swagger-ui .dark-green{color:#137752}.swagger-ui .green{color:#19a974}.swagger-ui .light-green{color:#9eebcf}.swagger-ui .navy{color:#001b44}.swagger-ui .dark-blue{color:#00449e}.swagger-ui .blue{color:#357edd}.swagger-ui .light-blue{color:#96ccff}.swagger-ui .lightest-blue{color:#cdecff}.swagger-ui .washed-blue{color:#f6fffe}.swagger-ui .washed-green{color:#e8fdf5}.swagger-ui .washed-yellow{color:#fffceb}.swagger-ui .washed-red{color:#ffdfdf}.swagger-ui .color-inherit{color:inherit}.swagger-ui .bg-black-90{background-color:rgba(0,0,0,.9)}.swagger-ui .bg-black-80{background-color:rgba(0,0,0,.8)}.swagger-ui .bg-black-70{background-color:rgba(0,0,0,.7)}.swagger-ui .bg-black-60{background-color:rgba(0,0,0,.6)}.swagger-ui .bg-black-50{background-color:rgba(0,0,0,.5)}.swagger-ui .bg-black-40{background-color:rgba(0,0,0,.4)}.swagger-ui .bg-black-30{background-color:rgba(0,0,0,.3)}.swagger-ui .bg-black-20{background-color:rgba(0,0,0,.2)}.swagger-ui .bg-black-10{background-color:rgba(0,0,0,.1)}.swagger-ui .bg-black-05{background-color:rgba(0,0,0,.05)}.swagger-ui .bg-white-90{background-color:hsla(0,0%,100%,.9)}.swagger-ui .bg-white-80{background-color:hsla(0,0%,100%,.8)}.swagger-ui .bg-white-70{background-color:hsla(0,0%,100%,.7)}.swagger-ui .bg-white-60{background-color:hsla(0,0%,100%,.6)}.swagger-ui .bg-white-50{background-color:hsla(0,0%,100%,.5)}.swagger-ui .bg-white-40{background-color:hsla(0,0%,100%,.4)}.swagger-ui .bg-white-30{background-color:hsla(0,0%,100%,.3)}.swagger-ui .bg-white-20{background-color:hsla(0,0%,100%,.2)}.swagger-ui .bg-white-10{background-color:hsla(0,0%,100%,.1)}.swagger-ui .bg-black{background-color:#000}.swagger-ui .bg-near-black{background-color:#111}.swagger-ui .bg-dark-gray{background-color:#333}.swagger-ui .bg-mid-gray{background-color:#555}.swagger-ui .bg-gray{background-color:#777}.swagger-ui .bg-silver{background-color:#999}.swagger-ui .bg-light-silver{background-color:#aaa}.swagger-ui .bg-moon-gray{background-color:#ccc}.swagger-ui .bg-light-gray{background-color:#eee}.swagger-ui .bg-near-white{background-color:#f4f4f4}.swagger-ui .bg-white{background-color:#fff}.swagger-ui .bg-transparent{background-color:transparent}.swagger-ui .bg-dark-red{background-color:#e7040f}.swagger-ui .bg-red{background-color:#ff4136}.swagger-ui .bg-light-red{background-color:#ff725c}.swagger-ui .bg-orange{background-color:#ff6300}.swagger-ui .bg-gold{background-color:#ffb700}.swagger-ui .bg-yellow{background-color:gold}.swagger-ui .bg-light-yellow{background-color:#fbf1a9}.swagger-ui .bg-purple{background-color:#5e2ca5}.swagger-ui .bg-light-purple{background-color:#a463f2}.swagger-ui .bg-dark-pink{background-color:#d5008f}.swagger-ui .bg-hot-pink{background-color:#ff41b4}.swagger-ui .bg-pink{background-color:#ff80cc}.swagger-ui .bg-light-pink{background-color:#ffa3d7}.swagger-ui .bg-dark-green{background-color:#137752}.swagger-ui .bg-green{background-color:#19a974}.swagger-ui .bg-light-green{background-color:#9eebcf}.swagger-ui .bg-navy{background-color:#001b44}.swagger-ui .bg-dark-blue{background-color:#00449e}.swagger-ui .bg-blue{background-color:#357edd}.swagger-ui .bg-light-blue{background-color:#96ccff}.swagger-ui .bg-lightest-blue{background-color:#cdecff}.swagger-ui .bg-washed-blue{background-color:#f6fffe}.swagger-ui .bg-washed-green{background-color:#e8fdf5}.swagger-ui .bg-washed-yellow{background-color:#fffceb}.swagger-ui .bg-washed-red{background-color:#ffdfdf}.swagger-ui .bg-inherit{background-color:inherit}.swagger-ui .hover-black:focus,.swagger-ui .hover-black:hover{color:#000}.swagger-ui .hover-near-black:focus,.swagger-ui .hover-near-black:hover{color:#111}.swagger-ui .hover-dark-gray:focus,.swagger-ui .hover-dark-gray:hover{color:#333}.swagger-ui .hover-mid-gray:focus,.swagger-ui .hover-mid-gray:hover{color:#555}.swagger-ui .hover-gray:focus,.swagger-ui .hover-gray:hover{color:#777}.swagger-ui .hover-silver:focus,.swagger-ui .hover-silver:hover{color:#999}.swagger-ui .hover-light-silver:focus,.swagger-ui .hover-light-silver:hover{color:#aaa}.swagger-ui .hover-moon-gray:focus,.swagger-ui .hover-moon-gray:hover{color:#ccc}.swagger-ui .hover-light-gray:focus,.swagger-ui .hover-light-gray:hover{color:#eee}.swagger-ui .hover-near-white:focus,.swagger-ui .hover-near-white:hover{color:#f4f4f4}.swagger-ui .hover-white:focus,.swagger-ui .hover-white:hover{color:#fff}.swagger-ui .hover-black-90:focus,.swagger-ui .hover-black-90:hover{color:rgba(0,0,0,.9)}.swagger-ui .hover-black-80:focus,.swagger-ui .hover-black-80:hover{color:rgba(0,0,0,.8)}.swagger-ui .hover-black-70:focus,.swagger-ui .hover-black-70:hover{color:rgba(0,0,0,.7)}.swagger-ui .hover-black-60:focus,.swagger-ui .hover-black-60:hover{color:rgba(0,0,0,.6)}.swagger-ui .hover-black-50:focus,.swagger-ui .hover-black-50:hover{color:rgba(0,0,0,.5)}.swagger-ui .hover-black-40:focus,.swagger-ui .hover-black-40:hover{color:rgba(0,0,0,.4)}.swagger-ui .hover-black-30:focus,.swagger-ui .hover-black-30:hover{color:rgba(0,0,0,.3)}.swagger-ui .hover-black-20:focus,.swagger-ui .hover-black-20:hover{color:rgba(0,0,0,.2)}.swagger-ui .hover-black-10:focus,.swagger-ui .hover-black-10:hover{color:rgba(0,0,0,.1)}.swagger-ui .hover-white-90:focus,.swagger-ui .hover-white-90:hover{color:hsla(0,0%,100%,.9)}.swagger-ui .hover-white-80:focus,.swagger-ui .hover-white-80:hover{color:hsla(0,0%,100%,.8)}.swagger-ui .hover-white-70:focus,.swagger-ui .hover-white-70:hover{color:hsla(0,0%,100%,.7)}.swagger-ui .hover-white-60:focus,.swagger-ui .hover-white-60:hover{color:hsla(0,0%,100%,.6)}.swagger-ui .hover-white-50:focus,.swagger-ui .hover-white-50:hover{color:hsla(0,0%,100%,.5)}.swagger-ui .hover-white-40:focus,.swagger-ui .hover-white-40:hover{color:hsla(0,0%,100%,.4)}.swagger-ui .hover-white-30:focus,.swagger-ui .hover-white-30:hover{color:hsla(0,0%,100%,.3)}.swagger-ui .hover-white-20:focus,.swagger-ui .hover-white-20:hover{color:hsla(0,0%,100%,.2)}.swagger-ui .hover-white-10:focus,.swagger-ui .hover-white-10:hover{color:hsla(0,0%,100%,.1)}.swagger-ui .hover-inherit:focus,.swagger-ui .hover-inherit:hover{color:inherit}.swagger-ui .hover-bg-black:focus,.swagger-ui .hover-bg-black:hover{background-color:#000}.swagger-ui .hover-bg-near-black:focus,.swagger-ui .hover-bg-near-black:hover{background-color:#111}.swagger-ui .hover-bg-dark-gray:focus,.swagger-ui .hover-bg-dark-gray:hover{background-color:#333}.swagger-ui .hover-bg-mid-gray:focus,.swagger-ui .hover-bg-mid-gray:hover{background-color:#555}.swagger-ui .hover-bg-gray:focus,.swagger-ui .hover-bg-gray:hover{background-color:#777}.swagger-ui .hover-bg-silver:focus,.swagger-ui .hover-bg-silver:hover{background-color:#999}.swagger-ui .hover-bg-light-silver:focus,.swagger-ui .hover-bg-light-silver:hover{background-color:#aaa}.swagger-ui .hover-bg-moon-gray:focus,.swagger-ui .hover-bg-moon-gray:hover{background-color:#ccc}.swagger-ui .hover-bg-light-gray:focus,.swagger-ui .hover-bg-light-gray:hover{background-color:#eee}.swagger-ui .hover-bg-near-white:focus,.swagger-ui .hover-bg-near-white:hover{background-color:#f4f4f4}.swagger-ui .hover-bg-white:focus,.swagger-ui .hover-bg-white:hover{background-color:#fff}.swagger-ui .hover-bg-transparent:focus,.swagger-ui .hover-bg-transparent:hover{background-color:transparent}.swagger-ui .hover-bg-black-90:focus,.swagger-ui .hover-bg-black-90:hover{background-color:rgba(0,0,0,.9)}.swagger-ui .hover-bg-black-80:focus,.swagger-ui .hover-bg-black-80:hover{background-color:rgba(0,0,0,.8)}.swagger-ui .hover-bg-black-70:focus,.swagger-ui .hover-bg-black-70:hover{background-color:rgba(0,0,0,.7)}.swagger-ui .hover-bg-black-60:focus,.swagger-ui .hover-bg-black-60:hover{background-color:rgba(0,0,0,.6)}.swagger-ui .hover-bg-black-50:focus,.swagger-ui .hover-bg-black-50:hover{background-color:rgba(0,0,0,.5)}.swagger-ui .hover-bg-black-40:focus,.swagger-ui .hover-bg-black-40:hover{background-color:rgba(0,0,0,.4)}.swagger-ui .hover-bg-black-30:focus,.swagger-ui .hover-bg-black-30:hover{background-color:rgba(0,0,0,.3)}.swagger-ui .hover-bg-black-20:focus,.swagger-ui .hover-bg-black-20:hover{background-color:rgba(0,0,0,.2)}.swagger-ui .hover-bg-black-10:focus,.swagger-ui .hover-bg-black-10:hover{background-color:rgba(0,0,0,.1)}.swagger-ui .hover-bg-white-90:focus,.swagger-ui .hover-bg-white-90:hover{background-color:hsla(0,0%,100%,.9)}.swagger-ui .hover-bg-white-80:focus,.swagger-ui .hover-bg-white-80:hover{background-color:hsla(0,0%,100%,.8)}.swagger-ui .hover-bg-white-70:focus,.swagger-ui .hover-bg-white-70:hover{background-color:hsla(0,0%,100%,.7)}.swagger-ui .hover-bg-white-60:focus,.swagger-ui .hover-bg-white-60:hover{background-color:hsla(0,0%,100%,.6)}.swagger-ui .hover-bg-white-50:focus,.swagger-ui .hover-bg-white-50:hover{background-color:hsla(0,0%,100%,.5)}.swagger-ui .hover-bg-white-40:focus,.swagger-ui .hover-bg-white-40:hover{background-color:hsla(0,0%,100%,.4)}.swagger-ui .hover-bg-white-30:focus,.swagger-ui .hover-bg-white-30:hover{background-color:hsla(0,0%,100%,.3)}.swagger-ui .hover-bg-white-20:focus,.swagger-ui .hover-bg-white-20:hover{background-color:hsla(0,0%,100%,.2)}.swagger-ui .hover-bg-white-10:focus,.swagger-ui .hover-bg-white-10:hover{background-color:hsla(0,0%,100%,.1)}.swagger-ui .hover-dark-red:focus,.swagger-ui .hover-dark-red:hover{color:#e7040f}.swagger-ui .hover-red:focus,.swagger-ui .hover-red:hover{color:#ff4136}.swagger-ui .hover-light-red:focus,.swagger-ui .hover-light-red:hover{color:#ff725c}.swagger-ui .hover-orange:focus,.swagger-ui .hover-orange:hover{color:#ff6300}.swagger-ui .hover-gold:focus,.swagger-ui .hover-gold:hover{color:#ffb700}.swagger-ui .hover-yellow:focus,.swagger-ui .hover-yellow:hover{color:gold}.swagger-ui .hover-light-yellow:focus,.swagger-ui .hover-light-yellow:hover{color:#fbf1a9}.swagger-ui .hover-purple:focus,.swagger-ui .hover-purple:hover{color:#5e2ca5}.swagger-ui .hover-light-purple:focus,.swagger-ui .hover-light-purple:hover{color:#a463f2}.swagger-ui .hover-dark-pink:focus,.swagger-ui .hover-dark-pink:hover{color:#d5008f}.swagger-ui .hover-hot-pink:focus,.swagger-ui .hover-hot-pink:hover{color:#ff41b4}.swagger-ui .hover-pink:focus,.swagger-ui .hover-pink:hover{color:#ff80cc}.swagger-ui .hover-light-pink:focus,.swagger-ui .hover-light-pink:hover{color:#ffa3d7}.swagger-ui .hover-dark-green:focus,.swagger-ui .hover-dark-green:hover{color:#137752}.swagger-ui .hover-green:focus,.swagger-ui .hover-green:hover{color:#19a974}.swagger-ui .hover-light-green:focus,.swagger-ui .hover-light-green:hover{color:#9eebcf}.swagger-ui .hover-navy:focus,.swagger-ui .hover-navy:hover{color:#001b44}.swagger-ui .hover-dark-blue:focus,.swagger-ui .hover-dark-blue:hover{color:#00449e}.swagger-ui .hover-blue:focus,.swagger-ui .hover-blue:hover{color:#357edd}.swagger-ui .hover-light-blue:focus,.swagger-ui .hover-light-blue:hover{color:#96ccff}.swagger-ui .hover-lightest-blue:focus,.swagger-ui .hover-lightest-blue:hover{color:#cdecff}.swagger-ui .hover-washed-blue:focus,.swagger-ui .hover-washed-blue:hover{color:#f6fffe}.swagger-ui .hover-washed-green:focus,.swagger-ui .hover-washed-green:hover{color:#e8fdf5}.swagger-ui .hover-washed-yellow:focus,.swagger-ui .hover-washed-yellow:hover{color:#fffceb}.swagger-ui .hover-washed-red:focus,.swagger-ui .hover-washed-red:hover{color:#ffdfdf}.swagger-ui .hover-bg-dark-red:focus,.swagger-ui .hover-bg-dark-red:hover{background-color:#e7040f}.swagger-ui .hover-bg-red:focus,.swagger-ui .hover-bg-red:hover{background-color:#ff4136}.swagger-ui .hover-bg-light-red:focus,.swagger-ui .hover-bg-light-red:hover{background-color:#ff725c}.swagger-ui .hover-bg-orange:focus,.swagger-ui .hover-bg-orange:hover{background-color:#ff6300}.swagger-ui .hover-bg-gold:focus,.swagger-ui .hover-bg-gold:hover{background-color:#ffb700}.swagger-ui .hover-bg-yellow:focus,.swagger-ui .hover-bg-yellow:hover{background-color:gold}.swagger-ui .hover-bg-light-yellow:focus,.swagger-ui .hover-bg-light-yellow:hover{background-color:#fbf1a9}.swagger-ui .hover-bg-purple:focus,.swagger-ui .hover-bg-purple:hover{background-color:#5e2ca5}.swagger-ui .hover-bg-light-purple:focus,.swagger-ui .hover-bg-light-purple:hover{background-color:#a463f2}.swagger-ui .hover-bg-dark-pink:focus,.swagger-ui .hover-bg-dark-pink:hover{background-color:#d5008f}.swagger-ui .hover-bg-hot-pink:focus,.swagger-ui .hover-bg-hot-pink:hover{background-color:#ff41b4}.swagger-ui .hover-bg-pink:focus,.swagger-ui .hover-bg-pink:hover{background-color:#ff80cc}.swagger-ui .hover-bg-light-pink:focus,.swagger-ui .hover-bg-light-pink:hover{background-color:#ffa3d7}.swagger-ui .hover-bg-dark-green:focus,.swagger-ui .hover-bg-dark-green:hover{background-color:#137752}.swagger-ui .hover-bg-green:focus,.swagger-ui .hover-bg-green:hover{background-color:#19a974}.swagger-ui .hover-bg-light-green:focus,.swagger-ui .hover-bg-light-green:hover{background-color:#9eebcf}.swagger-ui .hover-bg-navy:focus,.swagger-ui .hover-bg-navy:hover{background-color:#001b44}.swagger-ui .hover-bg-dark-blue:focus,.swagger-ui .hover-bg-dark-blue:hover{background-color:#00449e}.swagger-ui .hover-bg-blue:focus,.swagger-ui .hover-bg-blue:hover{background-color:#357edd}.swagger-ui .hover-bg-light-blue:focus,.swagger-ui .hover-bg-light-blue:hover{background-color:#96ccff}.swagger-ui .hover-bg-lightest-blue:focus,.swagger-ui .hover-bg-lightest-blue:hover{background-color:#cdecff}.swagger-ui .hover-bg-washed-blue:focus,.swagger-ui .hover-bg-washed-blue:hover{background-color:#f6fffe}.swagger-ui .hover-bg-washed-green:focus,.swagger-ui .hover-bg-washed-green:hover{background-color:#e8fdf5}.swagger-ui .hover-bg-washed-yellow:focus,.swagger-ui .hover-bg-washed-yellow:hover{background-color:#fffceb}.swagger-ui .hover-bg-washed-red:focus,.swagger-ui .hover-bg-washed-red:hover{background-color:#ffdfdf}.swagger-ui .hover-bg-inherit:focus,.swagger-ui .hover-bg-inherit:hover{background-color:inherit}.swagger-ui .pa0{padding:0}.swagger-ui .pa1{padding:.25rem}.swagger-ui .pa2{padding:.5rem}.swagger-ui .pa3{padding:1rem}.swagger-ui .pa4{padding:2rem}.swagger-ui .pa5{padding:4rem}.swagger-ui .pa6{padding:8rem}.swagger-ui .pa7{padding:16rem}.swagger-ui .pl0{padding-left:0}.swagger-ui .pl1{padding-left:.25rem}.swagger-ui .pl2{padding-left:.5rem}.swagger-ui .pl3{padding-left:1rem}.swagger-ui .pl4{padding-left:2rem}.swagger-ui .pl5{padding-left:4rem}.swagger-ui .pl6{padding-left:8rem}.swagger-ui .pl7{padding-left:16rem}.swagger-ui .pr0{padding-right:0}.swagger-ui .pr1{padding-right:.25rem}.swagger-ui .pr2{padding-right:.5rem}.swagger-ui .pr3{padding-right:1rem}.swagger-ui .pr4{padding-right:2rem}.swagger-ui .pr5{padding-right:4rem}.swagger-ui .pr6{padding-right:8rem}.swagger-ui .pr7{padding-right:16rem}.swagger-ui .pb0{padding-bottom:0}.swagger-ui .pb1{padding-bottom:.25rem}.swagger-ui .pb2{padding-bottom:.5rem}.swagger-ui .pb3{padding-bottom:1rem}.swagger-ui .pb4{padding-bottom:2rem}.swagger-ui .pb5{padding-bottom:4rem}.swagger-ui .pb6{padding-bottom:8rem}.swagger-ui .pb7{padding-bottom:16rem}.swagger-ui .pt0{padding-top:0}.swagger-ui .pt1{padding-top:.25rem}.swagger-ui .pt2{padding-top:.5rem}.swagger-ui .pt3{padding-top:1rem}.swagger-ui .pt4{padding-top:2rem}.swagger-ui .pt5{padding-top:4rem}.swagger-ui .pt6{padding-top:8rem}.swagger-ui .pt7{padding-top:16rem}.swagger-ui .pv0{padding-bottom:0;padding-top:0}.swagger-ui .pv1{padding-bottom:.25rem;padding-top:.25rem}.swagger-ui .pv2{padding-bottom:.5rem;padding-top:.5rem}.swagger-ui .pv3{padding-bottom:1rem;padding-top:1rem}.swagger-ui .pv4{padding-bottom:2rem;padding-top:2rem}.swagger-ui .pv5{padding-bottom:4rem;padding-top:4rem}.swagger-ui .pv6{padding-bottom:8rem;padding-top:8rem}.swagger-ui .pv7{padding-bottom:16rem;padding-top:16rem}.swagger-ui .ph0{padding-left:0;padding-right:0}.swagger-ui .ph1{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0{margin:0}.swagger-ui .ma1{margin:.25rem}.swagger-ui .ma2{margin:.5rem}.swagger-ui .ma3{margin:1rem}.swagger-ui .ma4{margin:2rem}.swagger-ui .ma5{margin:4rem}.swagger-ui .ma6{margin:8rem}.swagger-ui .ma7{margin:16rem}.swagger-ui .ml0{margin-left:0}.swagger-ui .ml1{margin-left:.25rem}.swagger-ui .ml2{margin-left:.5rem}.swagger-ui .ml3{margin-left:1rem}.swagger-ui .ml4{margin-left:2rem}.swagger-ui .ml5{margin-left:4rem}.swagger-ui .ml6{margin-left:8rem}.swagger-ui .ml7{margin-left:16rem}.swagger-ui .mr0{margin-right:0}.swagger-ui .mr1{margin-right:.25rem}.swagger-ui .mr2{margin-right:.5rem}.swagger-ui .mr3{margin-right:1rem}.swagger-ui .mr4{margin-right:2rem}.swagger-ui .mr5{margin-right:4rem}.swagger-ui .mr6{margin-right:8rem}.swagger-ui .mr7{margin-right:16rem}.swagger-ui .mb0{margin-bottom:0}.swagger-ui .mb1{margin-bottom:.25rem}.swagger-ui .mb2{margin-bottom:.5rem}.swagger-ui .mb3{margin-bottom:1rem}.swagger-ui .mb4{margin-bottom:2rem}.swagger-ui .mb5{margin-bottom:4rem}.swagger-ui .mb6{margin-bottom:8rem}.swagger-ui .mb7{margin-bottom:16rem}.swagger-ui .mt0{margin-top:0}.swagger-ui .mt1{margin-top:.25rem}.swagger-ui .mt2{margin-top:.5rem}.swagger-ui .mt3{margin-top:1rem}.swagger-ui .mt4{margin-top:2rem}.swagger-ui .mt5{margin-top:4rem}.swagger-ui .mt6{margin-top:8rem}.swagger-ui .mt7{margin-top:16rem}.swagger-ui .mv0{margin-bottom:0;margin-top:0}.swagger-ui .mv1{margin-bottom:.25rem;margin-top:.25rem}.swagger-ui .mv2{margin-bottom:.5rem;margin-top:.5rem}.swagger-ui .mv3{margin-bottom:1rem;margin-top:1rem}.swagger-ui .mv4{margin-bottom:2rem;margin-top:2rem}.swagger-ui .mv5{margin-bottom:4rem;margin-top:4rem}.swagger-ui .mv6{margin-bottom:8rem;margin-top:8rem}.swagger-ui .mv7{margin-bottom:16rem;margin-top:16rem}.swagger-ui .mh0{margin-left:0;margin-right:0}.swagger-ui .mh1{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7{margin-left:16rem;margin-right:16rem}@media screen and (min-width:30em){.swagger-ui .pa0-ns{padding:0}.swagger-ui .pa1-ns{padding:.25rem}.swagger-ui .pa2-ns{padding:.5rem}.swagger-ui .pa3-ns{padding:1rem}.swagger-ui .pa4-ns{padding:2rem}.swagger-ui .pa5-ns{padding:4rem}.swagger-ui .pa6-ns{padding:8rem}.swagger-ui .pa7-ns{padding:16rem}.swagger-ui .pl0-ns{padding-left:0}.swagger-ui .pl1-ns{padding-left:.25rem}.swagger-ui .pl2-ns{padding-left:.5rem}.swagger-ui .pl3-ns{padding-left:1rem}.swagger-ui .pl4-ns{padding-left:2rem}.swagger-ui .pl5-ns{padding-left:4rem}.swagger-ui .pl6-ns{padding-left:8rem}.swagger-ui .pl7-ns{padding-left:16rem}.swagger-ui .pr0-ns{padding-right:0}.swagger-ui .pr1-ns{padding-right:.25rem}.swagger-ui .pr2-ns{padding-right:.5rem}.swagger-ui .pr3-ns{padding-right:1rem}.swagger-ui .pr4-ns{padding-right:2rem}.swagger-ui .pr5-ns{padding-right:4rem}.swagger-ui .pr6-ns{padding-right:8rem}.swagger-ui .pr7-ns{padding-right:16rem}.swagger-ui .pb0-ns{padding-bottom:0}.swagger-ui .pb1-ns{padding-bottom:.25rem}.swagger-ui .pb2-ns{padding-bottom:.5rem}.swagger-ui .pb3-ns{padding-bottom:1rem}.swagger-ui .pb4-ns{padding-bottom:2rem}.swagger-ui .pb5-ns{padding-bottom:4rem}.swagger-ui .pb6-ns{padding-bottom:8rem}.swagger-ui .pb7-ns{padding-bottom:16rem}.swagger-ui .pt0-ns{padding-top:0}.swagger-ui .pt1-ns{padding-top:.25rem}.swagger-ui .pt2-ns{padding-top:.5rem}.swagger-ui .pt3-ns{padding-top:1rem}.swagger-ui .pt4-ns{padding-top:2rem}.swagger-ui .pt5-ns{padding-top:4rem}.swagger-ui .pt6-ns{padding-top:8rem}.swagger-ui .pt7-ns{padding-top:16rem}.swagger-ui .pv0-ns{padding-bottom:0;padding-top:0}.swagger-ui .pv1-ns{padding-bottom:.25rem;padding-top:.25rem}.swagger-ui .pv2-ns{padding-bottom:.5rem;padding-top:.5rem}.swagger-ui .pv3-ns{padding-bottom:1rem;padding-top:1rem}.swagger-ui .pv4-ns{padding-bottom:2rem;padding-top:2rem}.swagger-ui .pv5-ns{padding-bottom:4rem;padding-top:4rem}.swagger-ui .pv6-ns{padding-bottom:8rem;padding-top:8rem}.swagger-ui .pv7-ns{padding-bottom:16rem;padding-top:16rem}.swagger-ui .ph0-ns{padding-left:0;padding-right:0}.swagger-ui .ph1-ns{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-ns{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-ns{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-ns{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-ns{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-ns{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-ns{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-ns{margin:0}.swagger-ui .ma1-ns{margin:.25rem}.swagger-ui .ma2-ns{margin:.5rem}.swagger-ui .ma3-ns{margin:1rem}.swagger-ui .ma4-ns{margin:2rem}.swagger-ui .ma5-ns{margin:4rem}.swagger-ui .ma6-ns{margin:8rem}.swagger-ui .ma7-ns{margin:16rem}.swagger-ui .ml0-ns{margin-left:0}.swagger-ui .ml1-ns{margin-left:.25rem}.swagger-ui .ml2-ns{margin-left:.5rem}.swagger-ui .ml3-ns{margin-left:1rem}.swagger-ui .ml4-ns{margin-left:2rem}.swagger-ui .ml5-ns{margin-left:4rem}.swagger-ui .ml6-ns{margin-left:8rem}.swagger-ui .ml7-ns{margin-left:16rem}.swagger-ui .mr0-ns{margin-right:0}.swagger-ui .mr1-ns{margin-right:.25rem}.swagger-ui .mr2-ns{margin-right:.5rem}.swagger-ui .mr3-ns{margin-right:1rem}.swagger-ui .mr4-ns{margin-right:2rem}.swagger-ui .mr5-ns{margin-right:4rem}.swagger-ui .mr6-ns{margin-right:8rem}.swagger-ui .mr7-ns{margin-right:16rem}.swagger-ui .mb0-ns{margin-bottom:0}.swagger-ui .mb1-ns{margin-bottom:.25rem}.swagger-ui .mb2-ns{margin-bottom:.5rem}.swagger-ui .mb3-ns{margin-bottom:1rem}.swagger-ui .mb4-ns{margin-bottom:2rem}.swagger-ui .mb5-ns{margin-bottom:4rem}.swagger-ui .mb6-ns{margin-bottom:8rem}.swagger-ui .mb7-ns{margin-bottom:16rem}.swagger-ui .mt0-ns{margin-top:0}.swagger-ui .mt1-ns{margin-top:.25rem}.swagger-ui .mt2-ns{margin-top:.5rem}.swagger-ui .mt3-ns{margin-top:1rem}.swagger-ui .mt4-ns{margin-top:2rem}.swagger-ui .mt5-ns{margin-top:4rem}.swagger-ui .mt6-ns{margin-top:8rem}.swagger-ui .mt7-ns{margin-top:16rem}.swagger-ui .mv0-ns{margin-bottom:0;margin-top:0}.swagger-ui .mv1-ns{margin-bottom:.25rem;margin-top:.25rem}.swagger-ui .mv2-ns{margin-bottom:.5rem;margin-top:.5rem}.swagger-ui .mv3-ns{margin-bottom:1rem;margin-top:1rem}.swagger-ui .mv4-ns{margin-bottom:2rem;margin-top:2rem}.swagger-ui .mv5-ns{margin-bottom:4rem;margin-top:4rem}.swagger-ui .mv6-ns{margin-bottom:8rem;margin-top:8rem}.swagger-ui .mv7-ns{margin-bottom:16rem;margin-top:16rem}.swagger-ui .mh0-ns{margin-left:0;margin-right:0}.swagger-ui .mh1-ns{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-ns{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-ns{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-ns{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-ns{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-ns{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-ns{margin-left:16rem;margin-right:16rem}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .pa0-m{padding:0}.swagger-ui .pa1-m{padding:.25rem}.swagger-ui .pa2-m{padding:.5rem}.swagger-ui .pa3-m{padding:1rem}.swagger-ui .pa4-m{padding:2rem}.swagger-ui .pa5-m{padding:4rem}.swagger-ui .pa6-m{padding:8rem}.swagger-ui .pa7-m{padding:16rem}.swagger-ui .pl0-m{padding-left:0}.swagger-ui .pl1-m{padding-left:.25rem}.swagger-ui .pl2-m{padding-left:.5rem}.swagger-ui .pl3-m{padding-left:1rem}.swagger-ui .pl4-m{padding-left:2rem}.swagger-ui .pl5-m{padding-left:4rem}.swagger-ui .pl6-m{padding-left:8rem}.swagger-ui .pl7-m{padding-left:16rem}.swagger-ui .pr0-m{padding-right:0}.swagger-ui .pr1-m{padding-right:.25rem}.swagger-ui .pr2-m{padding-right:.5rem}.swagger-ui .pr3-m{padding-right:1rem}.swagger-ui .pr4-m{padding-right:2rem}.swagger-ui .pr5-m{padding-right:4rem}.swagger-ui .pr6-m{padding-right:8rem}.swagger-ui .pr7-m{padding-right:16rem}.swagger-ui .pb0-m{padding-bottom:0}.swagger-ui .pb1-m{padding-bottom:.25rem}.swagger-ui .pb2-m{padding-bottom:.5rem}.swagger-ui .pb3-m{padding-bottom:1rem}.swagger-ui .pb4-m{padding-bottom:2rem}.swagger-ui .pb5-m{padding-bottom:4rem}.swagger-ui .pb6-m{padding-bottom:8rem}.swagger-ui .pb7-m{padding-bottom:16rem}.swagger-ui .pt0-m{padding-top:0}.swagger-ui .pt1-m{padding-top:.25rem}.swagger-ui .pt2-m{padding-top:.5rem}.swagger-ui .pt3-m{padding-top:1rem}.swagger-ui .pt4-m{padding-top:2rem}.swagger-ui .pt5-m{padding-top:4rem}.swagger-ui .pt6-m{padding-top:8rem}.swagger-ui .pt7-m{padding-top:16rem}.swagger-ui .pv0-m{padding-bottom:0;padding-top:0}.swagger-ui .pv1-m{padding-bottom:.25rem;padding-top:.25rem}.swagger-ui .pv2-m{padding-bottom:.5rem;padding-top:.5rem}.swagger-ui .pv3-m{padding-bottom:1rem;padding-top:1rem}.swagger-ui .pv4-m{padding-bottom:2rem;padding-top:2rem}.swagger-ui .pv5-m{padding-bottom:4rem;padding-top:4rem}.swagger-ui .pv6-m{padding-bottom:8rem;padding-top:8rem}.swagger-ui .pv7-m{padding-bottom:16rem;padding-top:16rem}.swagger-ui .ph0-m{padding-left:0;padding-right:0}.swagger-ui .ph1-m{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-m{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-m{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-m{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-m{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-m{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-m{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-m{margin:0}.swagger-ui .ma1-m{margin:.25rem}.swagger-ui .ma2-m{margin:.5rem}.swagger-ui .ma3-m{margin:1rem}.swagger-ui .ma4-m{margin:2rem}.swagger-ui .ma5-m{margin:4rem}.swagger-ui .ma6-m{margin:8rem}.swagger-ui .ma7-m{margin:16rem}.swagger-ui .ml0-m{margin-left:0}.swagger-ui .ml1-m{margin-left:.25rem}.swagger-ui .ml2-m{margin-left:.5rem}.swagger-ui .ml3-m{margin-left:1rem}.swagger-ui .ml4-m{margin-left:2rem}.swagger-ui .ml5-m{margin-left:4rem}.swagger-ui .ml6-m{margin-left:8rem}.swagger-ui .ml7-m{margin-left:16rem}.swagger-ui .mr0-m{margin-right:0}.swagger-ui .mr1-m{margin-right:.25rem}.swagger-ui .mr2-m{margin-right:.5rem}.swagger-ui .mr3-m{margin-right:1rem}.swagger-ui .mr4-m{margin-right:2rem}.swagger-ui .mr5-m{margin-right:4rem}.swagger-ui .mr6-m{margin-right:8rem}.swagger-ui .mr7-m{margin-right:16rem}.swagger-ui .mb0-m{margin-bottom:0}.swagger-ui .mb1-m{margin-bottom:.25rem}.swagger-ui .mb2-m{margin-bottom:.5rem}.swagger-ui .mb3-m{margin-bottom:1rem}.swagger-ui .mb4-m{margin-bottom:2rem}.swagger-ui .mb5-m{margin-bottom:4rem}.swagger-ui .mb6-m{margin-bottom:8rem}.swagger-ui .mb7-m{margin-bottom:16rem}.swagger-ui .mt0-m{margin-top:0}.swagger-ui .mt1-m{margin-top:.25rem}.swagger-ui .mt2-m{margin-top:.5rem}.swagger-ui .mt3-m{margin-top:1rem}.swagger-ui .mt4-m{margin-top:2rem}.swagger-ui .mt5-m{margin-top:4rem}.swagger-ui .mt6-m{margin-top:8rem}.swagger-ui .mt7-m{margin-top:16rem}.swagger-ui .mv0-m{margin-bottom:0;margin-top:0}.swagger-ui .mv1-m{margin-bottom:.25rem;margin-top:.25rem}.swagger-ui .mv2-m{margin-bottom:.5rem;margin-top:.5rem}.swagger-ui .mv3-m{margin-bottom:1rem;margin-top:1rem}.swagger-ui .mv4-m{margin-bottom:2rem;margin-top:2rem}.swagger-ui .mv5-m{margin-bottom:4rem;margin-top:4rem}.swagger-ui .mv6-m{margin-bottom:8rem;margin-top:8rem}.swagger-ui .mv7-m{margin-bottom:16rem;margin-top:16rem}.swagger-ui .mh0-m{margin-left:0;margin-right:0}.swagger-ui .mh1-m{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-m{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-m{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-m{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-m{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-m{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-m{margin-left:16rem;margin-right:16rem}}@media screen and (min-width:60em){.swagger-ui .pa0-l{padding:0}.swagger-ui .pa1-l{padding:.25rem}.swagger-ui .pa2-l{padding:.5rem}.swagger-ui .pa3-l{padding:1rem}.swagger-ui .pa4-l{padding:2rem}.swagger-ui .pa5-l{padding:4rem}.swagger-ui .pa6-l{padding:8rem}.swagger-ui .pa7-l{padding:16rem}.swagger-ui .pl0-l{padding-left:0}.swagger-ui .pl1-l{padding-left:.25rem}.swagger-ui .pl2-l{padding-left:.5rem}.swagger-ui .pl3-l{padding-left:1rem}.swagger-ui .pl4-l{padding-left:2rem}.swagger-ui .pl5-l{padding-left:4rem}.swagger-ui .pl6-l{padding-left:8rem}.swagger-ui .pl7-l{padding-left:16rem}.swagger-ui .pr0-l{padding-right:0}.swagger-ui .pr1-l{padding-right:.25rem}.swagger-ui .pr2-l{padding-right:.5rem}.swagger-ui .pr3-l{padding-right:1rem}.swagger-ui .pr4-l{padding-right:2rem}.swagger-ui .pr5-l{padding-right:4rem}.swagger-ui .pr6-l{padding-right:8rem}.swagger-ui .pr7-l{padding-right:16rem}.swagger-ui .pb0-l{padding-bottom:0}.swagger-ui .pb1-l{padding-bottom:.25rem}.swagger-ui .pb2-l{padding-bottom:.5rem}.swagger-ui .pb3-l{padding-bottom:1rem}.swagger-ui .pb4-l{padding-bottom:2rem}.swagger-ui .pb5-l{padding-bottom:4rem}.swagger-ui .pb6-l{padding-bottom:8rem}.swagger-ui .pb7-l{padding-bottom:16rem}.swagger-ui .pt0-l{padding-top:0}.swagger-ui .pt1-l{padding-top:.25rem}.swagger-ui .pt2-l{padding-top:.5rem}.swagger-ui .pt3-l{padding-top:1rem}.swagger-ui .pt4-l{padding-top:2rem}.swagger-ui .pt5-l{padding-top:4rem}.swagger-ui .pt6-l{padding-top:8rem}.swagger-ui .pt7-l{padding-top:16rem}.swagger-ui .pv0-l{padding-bottom:0;padding-top:0}.swagger-ui .pv1-l{padding-bottom:.25rem;padding-top:.25rem}.swagger-ui .pv2-l{padding-bottom:.5rem;padding-top:.5rem}.swagger-ui .pv3-l{padding-bottom:1rem;padding-top:1rem}.swagger-ui .pv4-l{padding-bottom:2rem;padding-top:2rem}.swagger-ui .pv5-l{padding-bottom:4rem;padding-top:4rem}.swagger-ui .pv6-l{padding-bottom:8rem;padding-top:8rem}.swagger-ui .pv7-l{padding-bottom:16rem;padding-top:16rem}.swagger-ui .ph0-l{padding-left:0;padding-right:0}.swagger-ui .ph1-l{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-l{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-l{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-l{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-l{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-l{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-l{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-l{margin:0}.swagger-ui .ma1-l{margin:.25rem}.swagger-ui .ma2-l{margin:.5rem}.swagger-ui .ma3-l{margin:1rem}.swagger-ui .ma4-l{margin:2rem}.swagger-ui .ma5-l{margin:4rem}.swagger-ui .ma6-l{margin:8rem}.swagger-ui .ma7-l{margin:16rem}.swagger-ui .ml0-l{margin-left:0}.swagger-ui .ml1-l{margin-left:.25rem}.swagger-ui .ml2-l{margin-left:.5rem}.swagger-ui .ml3-l{margin-left:1rem}.swagger-ui .ml4-l{margin-left:2rem}.swagger-ui .ml5-l{margin-left:4rem}.swagger-ui .ml6-l{margin-left:8rem}.swagger-ui .ml7-l{margin-left:16rem}.swagger-ui .mr0-l{margin-right:0}.swagger-ui .mr1-l{margin-right:.25rem}.swagger-ui .mr2-l{margin-right:.5rem}.swagger-ui .mr3-l{margin-right:1rem}.swagger-ui .mr4-l{margin-right:2rem}.swagger-ui .mr5-l{margin-right:4rem}.swagger-ui .mr6-l{margin-right:8rem}.swagger-ui .mr7-l{margin-right:16rem}.swagger-ui .mb0-l{margin-bottom:0}.swagger-ui .mb1-l{margin-bottom:.25rem}.swagger-ui .mb2-l{margin-bottom:.5rem}.swagger-ui .mb3-l{margin-bottom:1rem}.swagger-ui .mb4-l{margin-bottom:2rem}.swagger-ui .mb5-l{margin-bottom:4rem}.swagger-ui .mb6-l{margin-bottom:8rem}.swagger-ui .mb7-l{margin-bottom:16rem}.swagger-ui .mt0-l{margin-top:0}.swagger-ui .mt1-l{margin-top:.25rem}.swagger-ui .mt2-l{margin-top:.5rem}.swagger-ui .mt3-l{margin-top:1rem}.swagger-ui .mt4-l{margin-top:2rem}.swagger-ui .mt5-l{margin-top:4rem}.swagger-ui .mt6-l{margin-top:8rem}.swagger-ui .mt7-l{margin-top:16rem}.swagger-ui .mv0-l{margin-bottom:0;margin-top:0}.swagger-ui .mv1-l{margin-bottom:.25rem;margin-top:.25rem}.swagger-ui .mv2-l{margin-bottom:.5rem;margin-top:.5rem}.swagger-ui .mv3-l{margin-bottom:1rem;margin-top:1rem}.swagger-ui .mv4-l{margin-bottom:2rem;margin-top:2rem}.swagger-ui .mv5-l{margin-bottom:4rem;margin-top:4rem}.swagger-ui .mv6-l{margin-bottom:8rem;margin-top:8rem}.swagger-ui .mv7-l{margin-bottom:16rem;margin-top:16rem}.swagger-ui .mh0-l{margin-left:0;margin-right:0}.swagger-ui .mh1-l{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-l{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-l{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-l{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-l{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-l{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-l{margin-left:16rem;margin-right:16rem}}.swagger-ui .na1{margin:-.25rem}.swagger-ui .na2{margin:-.5rem}.swagger-ui .na3{margin:-1rem}.swagger-ui .na4{margin:-2rem}.swagger-ui .na5{margin:-4rem}.swagger-ui .na6{margin:-8rem}.swagger-ui .na7{margin:-16rem}.swagger-ui .nl1{margin-left:-.25rem}.swagger-ui .nl2{margin-left:-.5rem}.swagger-ui .nl3{margin-left:-1rem}.swagger-ui .nl4{margin-left:-2rem}.swagger-ui .nl5{margin-left:-4rem}.swagger-ui .nl6{margin-left:-8rem}.swagger-ui .nl7{margin-left:-16rem}.swagger-ui .nr1{margin-right:-.25rem}.swagger-ui .nr2{margin-right:-.5rem}.swagger-ui .nr3{margin-right:-1rem}.swagger-ui .nr4{margin-right:-2rem}.swagger-ui .nr5{margin-right:-4rem}.swagger-ui .nr6{margin-right:-8rem}.swagger-ui .nr7{margin-right:-16rem}.swagger-ui .nb1{margin-bottom:-.25rem}.swagger-ui .nb2{margin-bottom:-.5rem}.swagger-ui .nb3{margin-bottom:-1rem}.swagger-ui .nb4{margin-bottom:-2rem}.swagger-ui .nb5{margin-bottom:-4rem}.swagger-ui .nb6{margin-bottom:-8rem}.swagger-ui .nb7{margin-bottom:-16rem}.swagger-ui .nt1{margin-top:-.25rem}.swagger-ui .nt2{margin-top:-.5rem}.swagger-ui .nt3{margin-top:-1rem}.swagger-ui .nt4{margin-top:-2rem}.swagger-ui .nt5{margin-top:-4rem}.swagger-ui .nt6{margin-top:-8rem}.swagger-ui .nt7{margin-top:-16rem}@media screen and (min-width:30em){.swagger-ui .na1-ns{margin:-.25rem}.swagger-ui .na2-ns{margin:-.5rem}.swagger-ui .na3-ns{margin:-1rem}.swagger-ui .na4-ns{margin:-2rem}.swagger-ui .na5-ns{margin:-4rem}.swagger-ui .na6-ns{margin:-8rem}.swagger-ui .na7-ns{margin:-16rem}.swagger-ui .nl1-ns{margin-left:-.25rem}.swagger-ui .nl2-ns{margin-left:-.5rem}.swagger-ui .nl3-ns{margin-left:-1rem}.swagger-ui .nl4-ns{margin-left:-2rem}.swagger-ui .nl5-ns{margin-left:-4rem}.swagger-ui .nl6-ns{margin-left:-8rem}.swagger-ui .nl7-ns{margin-left:-16rem}.swagger-ui .nr1-ns{margin-right:-.25rem}.swagger-ui .nr2-ns{margin-right:-.5rem}.swagger-ui .nr3-ns{margin-right:-1rem}.swagger-ui .nr4-ns{margin-right:-2rem}.swagger-ui .nr5-ns{margin-right:-4rem}.swagger-ui .nr6-ns{margin-right:-8rem}.swagger-ui .nr7-ns{margin-right:-16rem}.swagger-ui .nb1-ns{margin-bottom:-.25rem}.swagger-ui .nb2-ns{margin-bottom:-.5rem}.swagger-ui .nb3-ns{margin-bottom:-1rem}.swagger-ui .nb4-ns{margin-bottom:-2rem}.swagger-ui .nb5-ns{margin-bottom:-4rem}.swagger-ui .nb6-ns{margin-bottom:-8rem}.swagger-ui .nb7-ns{margin-bottom:-16rem}.swagger-ui .nt1-ns{margin-top:-.25rem}.swagger-ui .nt2-ns{margin-top:-.5rem}.swagger-ui .nt3-ns{margin-top:-1rem}.swagger-ui .nt4-ns{margin-top:-2rem}.swagger-ui .nt5-ns{margin-top:-4rem}.swagger-ui .nt6-ns{margin-top:-8rem}.swagger-ui .nt7-ns{margin-top:-16rem}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .na1-m{margin:-.25rem}.swagger-ui .na2-m{margin:-.5rem}.swagger-ui .na3-m{margin:-1rem}.swagger-ui .na4-m{margin:-2rem}.swagger-ui .na5-m{margin:-4rem}.swagger-ui .na6-m{margin:-8rem}.swagger-ui .na7-m{margin:-16rem}.swagger-ui .nl1-m{margin-left:-.25rem}.swagger-ui .nl2-m{margin-left:-.5rem}.swagger-ui .nl3-m{margin-left:-1rem}.swagger-ui .nl4-m{margin-left:-2rem}.swagger-ui .nl5-m{margin-left:-4rem}.swagger-ui .nl6-m{margin-left:-8rem}.swagger-ui .nl7-m{margin-left:-16rem}.swagger-ui .nr1-m{margin-right:-.25rem}.swagger-ui .nr2-m{margin-right:-.5rem}.swagger-ui .nr3-m{margin-right:-1rem}.swagger-ui .nr4-m{margin-right:-2rem}.swagger-ui .nr5-m{margin-right:-4rem}.swagger-ui .nr6-m{margin-right:-8rem}.swagger-ui .nr7-m{margin-right:-16rem}.swagger-ui .nb1-m{margin-bottom:-.25rem}.swagger-ui .nb2-m{margin-bottom:-.5rem}.swagger-ui .nb3-m{margin-bottom:-1rem}.swagger-ui .nb4-m{margin-bottom:-2rem}.swagger-ui .nb5-m{margin-bottom:-4rem}.swagger-ui .nb6-m{margin-bottom:-8rem}.swagger-ui .nb7-m{margin-bottom:-16rem}.swagger-ui .nt1-m{margin-top:-.25rem}.swagger-ui .nt2-m{margin-top:-.5rem}.swagger-ui .nt3-m{margin-top:-1rem}.swagger-ui .nt4-m{margin-top:-2rem}.swagger-ui .nt5-m{margin-top:-4rem}.swagger-ui .nt6-m{margin-top:-8rem}.swagger-ui .nt7-m{margin-top:-16rem}}@media screen and (min-width:60em){.swagger-ui .na1-l{margin:-.25rem}.swagger-ui .na2-l{margin:-.5rem}.swagger-ui .na3-l{margin:-1rem}.swagger-ui .na4-l{margin:-2rem}.swagger-ui .na5-l{margin:-4rem}.swagger-ui .na6-l{margin:-8rem}.swagger-ui .na7-l{margin:-16rem}.swagger-ui .nl1-l{margin-left:-.25rem}.swagger-ui .nl2-l{margin-left:-.5rem}.swagger-ui .nl3-l{margin-left:-1rem}.swagger-ui .nl4-l{margin-left:-2rem}.swagger-ui .nl5-l{margin-left:-4rem}.swagger-ui .nl6-l{margin-left:-8rem}.swagger-ui .nl7-l{margin-left:-16rem}.swagger-ui .nr1-l{margin-right:-.25rem}.swagger-ui .nr2-l{margin-right:-.5rem}.swagger-ui .nr3-l{margin-right:-1rem}.swagger-ui .nr4-l{margin-right:-2rem}.swagger-ui .nr5-l{margin-right:-4rem}.swagger-ui .nr6-l{margin-right:-8rem}.swagger-ui .nr7-l{margin-right:-16rem}.swagger-ui .nb1-l{margin-bottom:-.25rem}.swagger-ui .nb2-l{margin-bottom:-.5rem}.swagger-ui .nb3-l{margin-bottom:-1rem}.swagger-ui .nb4-l{margin-bottom:-2rem}.swagger-ui .nb5-l{margin-bottom:-4rem}.swagger-ui .nb6-l{margin-bottom:-8rem}.swagger-ui .nb7-l{margin-bottom:-16rem}.swagger-ui .nt1-l{margin-top:-.25rem}.swagger-ui .nt2-l{margin-top:-.5rem}.swagger-ui .nt3-l{margin-top:-1rem}.swagger-ui .nt4-l{margin-top:-2rem}.swagger-ui .nt5-l{margin-top:-4rem}.swagger-ui .nt6-l{margin-top:-8rem}.swagger-ui .nt7-l{margin-top:-16rem}}.swagger-ui .collapse{border-collapse:collapse;border-spacing:0}.swagger-ui .striped--light-silver:nth-child(odd){background-color:#aaa}.swagger-ui .striped--moon-gray:nth-child(odd){background-color:#ccc}.swagger-ui .striped--light-gray:nth-child(odd){background-color:#eee}.swagger-ui .striped--near-white:nth-child(odd){background-color:#f4f4f4}.swagger-ui .stripe-light:nth-child(odd){background-color:hsla(0,0%,100%,.1)}.swagger-ui .stripe-dark:nth-child(odd){background-color:rgba(0,0,0,.1)}.swagger-ui .strike{-webkit-text-decoration:line-through;text-decoration:line-through}.swagger-ui .underline{-webkit-text-decoration:underline;text-decoration:underline}.swagger-ui .no-underline{-webkit-text-decoration:none;text-decoration:none}@media screen and (min-width:30em){.swagger-ui .strike-ns{-webkit-text-decoration:line-through;text-decoration:line-through}.swagger-ui .underline-ns{-webkit-text-decoration:underline;text-decoration:underline}.swagger-ui .no-underline-ns{-webkit-text-decoration:none;text-decoration:none}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .strike-m{-webkit-text-decoration:line-through;text-decoration:line-through}.swagger-ui .underline-m{-webkit-text-decoration:underline;text-decoration:underline}.swagger-ui .no-underline-m{-webkit-text-decoration:none;text-decoration:none}}@media screen and (min-width:60em){.swagger-ui .strike-l{-webkit-text-decoration:line-through;text-decoration:line-through}.swagger-ui .underline-l{-webkit-text-decoration:underline;text-decoration:underline}.swagger-ui .no-underline-l{-webkit-text-decoration:none;text-decoration:none}}.swagger-ui .tl{text-align:left}.swagger-ui .tr{text-align:right}.swagger-ui .tc{text-align:center}.swagger-ui .tj{text-align:justify}@media screen and (min-width:30em){.swagger-ui .tl-ns{text-align:left}.swagger-ui .tr-ns{text-align:right}.swagger-ui .tc-ns{text-align:center}.swagger-ui .tj-ns{text-align:justify}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .tl-m{text-align:left}.swagger-ui .tr-m{text-align:right}.swagger-ui .tc-m{text-align:center}.swagger-ui .tj-m{text-align:justify}}@media screen and (min-width:60em){.swagger-ui .tl-l{text-align:left}.swagger-ui .tr-l{text-align:right}.swagger-ui .tc-l{text-align:center}.swagger-ui .tj-l{text-align:justify}}.swagger-ui .ttc{text-transform:capitalize}.swagger-ui .ttl{text-transform:lowercase}.swagger-ui .ttu{text-transform:uppercase}.swagger-ui .ttn{text-transform:none}@media screen and (min-width:30em){.swagger-ui .ttc-ns{text-transform:capitalize}.swagger-ui .ttl-ns{text-transform:lowercase}.swagger-ui .ttu-ns{text-transform:uppercase}.swagger-ui .ttn-ns{text-transform:none}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .ttc-m{text-transform:capitalize}.swagger-ui .ttl-m{text-transform:lowercase}.swagger-ui .ttu-m{text-transform:uppercase}.swagger-ui .ttn-m{text-transform:none}}@media screen and (min-width:60em){.swagger-ui .ttc-l{text-transform:capitalize}.swagger-ui .ttl-l{text-transform:lowercase}.swagger-ui .ttu-l{text-transform:uppercase}.swagger-ui .ttn-l{text-transform:none}}.swagger-ui .f-6,.swagger-ui .f-headline{font-size:6rem}.swagger-ui .f-5,.swagger-ui .f-subheadline{font-size:5rem}.swagger-ui .f1{font-size:3rem}.swagger-ui .f2{font-size:2.25rem}.swagger-ui .f3{font-size:1.5rem}.swagger-ui .f4{font-size:1.25rem}.swagger-ui .f5{font-size:1rem}.swagger-ui .f6{font-size:.875rem}.swagger-ui .f7{font-size:.75rem}@media screen and (min-width:30em){.swagger-ui .f-6-ns,.swagger-ui .f-headline-ns{font-size:6rem}.swagger-ui .f-5-ns,.swagger-ui .f-subheadline-ns{font-size:5rem}.swagger-ui .f1-ns{font-size:3rem}.swagger-ui .f2-ns{font-size:2.25rem}.swagger-ui .f3-ns{font-size:1.5rem}.swagger-ui .f4-ns{font-size:1.25rem}.swagger-ui .f5-ns{font-size:1rem}.swagger-ui .f6-ns{font-size:.875rem}.swagger-ui .f7-ns{font-size:.75rem}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .f-6-m,.swagger-ui .f-headline-m{font-size:6rem}.swagger-ui .f-5-m,.swagger-ui .f-subheadline-m{font-size:5rem}.swagger-ui .f1-m{font-size:3rem}.swagger-ui .f2-m{font-size:2.25rem}.swagger-ui .f3-m{font-size:1.5rem}.swagger-ui .f4-m{font-size:1.25rem}.swagger-ui .f5-m{font-size:1rem}.swagger-ui .f6-m{font-size:.875rem}.swagger-ui .f7-m{font-size:.75rem}}@media screen and (min-width:60em){.swagger-ui .f-6-l,.swagger-ui .f-headline-l{font-size:6rem}.swagger-ui .f-5-l,.swagger-ui .f-subheadline-l{font-size:5rem}.swagger-ui .f1-l{font-size:3rem}.swagger-ui .f2-l{font-size:2.25rem}.swagger-ui .f3-l{font-size:1.5rem}.swagger-ui .f4-l{font-size:1.25rem}.swagger-ui .f5-l{font-size:1rem}.swagger-ui .f6-l{font-size:.875rem}.swagger-ui .f7-l{font-size:.75rem}}.swagger-ui .measure{max-width:30em}.swagger-ui .measure-wide{max-width:34em}.swagger-ui .measure-narrow{max-width:20em}.swagger-ui .indent{margin-bottom:0;margin-top:0;text-indent:1em}.swagger-ui .small-caps{font-feature-settings:\"smcp\";font-variant:small-caps}.swagger-ui .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media screen and (min-width:30em){.swagger-ui .measure-ns{max-width:30em}.swagger-ui .measure-wide-ns{max-width:34em}.swagger-ui .measure-narrow-ns{max-width:20em}.swagger-ui .indent-ns{margin-bottom:0;margin-top:0;text-indent:1em}.swagger-ui .small-caps-ns{font-feature-settings:\"smcp\";font-variant:small-caps}.swagger-ui .truncate-ns{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .measure-m{max-width:30em}.swagger-ui .measure-wide-m{max-width:34em}.swagger-ui .measure-narrow-m{max-width:20em}.swagger-ui .indent-m{margin-bottom:0;margin-top:0;text-indent:1em}.swagger-ui .small-caps-m{font-feature-settings:\"smcp\";font-variant:small-caps}.swagger-ui .truncate-m{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}@media screen and (min-width:60em){.swagger-ui .measure-l{max-width:30em}.swagger-ui .measure-wide-l{max-width:34em}.swagger-ui .measure-narrow-l{max-width:20em}.swagger-ui .indent-l{margin-bottom:0;margin-top:0;text-indent:1em}.swagger-ui .small-caps-l{font-feature-settings:\"smcp\";font-variant:small-caps}.swagger-ui .truncate-l{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}.swagger-ui .overflow-container{overflow-y:scroll}.swagger-ui .center{margin-left:auto;margin-right:auto}.swagger-ui .mr-auto{margin-right:auto}.swagger-ui .ml-auto{margin-left:auto}@media screen and (min-width:30em){.swagger-ui .center-ns{margin-left:auto;margin-right:auto}.swagger-ui .mr-auto-ns{margin-right:auto}.swagger-ui .ml-auto-ns{margin-left:auto}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .center-m{margin-left:auto;margin-right:auto}.swagger-ui .mr-auto-m{margin-right:auto}.swagger-ui .ml-auto-m{margin-left:auto}}@media screen and (min-width:60em){.swagger-ui .center-l{margin-left:auto;margin-right:auto}.swagger-ui .mr-auto-l{margin-right:auto}.swagger-ui .ml-auto-l{margin-left:auto}}.swagger-ui .clip{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}@media screen and (min-width:30em){.swagger-ui .clip-ns{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .clip-m{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}@media screen and (min-width:60em){.swagger-ui .clip-l{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}.swagger-ui .ws-normal{white-space:normal}.swagger-ui .nowrap{white-space:nowrap}.swagger-ui .pre{white-space:pre}@media screen and (min-width:30em){.swagger-ui .ws-normal-ns{white-space:normal}.swagger-ui .nowrap-ns{white-space:nowrap}.swagger-ui .pre-ns{white-space:pre}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .ws-normal-m{white-space:normal}.swagger-ui .nowrap-m{white-space:nowrap}.swagger-ui .pre-m{white-space:pre}}@media screen and (min-width:60em){.swagger-ui .ws-normal-l{white-space:normal}.swagger-ui .nowrap-l{white-space:nowrap}.swagger-ui .pre-l{white-space:pre}}.swagger-ui .v-base{vertical-align:baseline}.swagger-ui .v-mid{vertical-align:middle}.swagger-ui .v-top{vertical-align:top}.swagger-ui .v-btm{vertical-align:bottom}@media screen and (min-width:30em){.swagger-ui .v-base-ns{vertical-align:baseline}.swagger-ui .v-mid-ns{vertical-align:middle}.swagger-ui .v-top-ns{vertical-align:top}.swagger-ui .v-btm-ns{vertical-align:bottom}}@media screen and (min-width:30em)and (max-width:60em){.swagger-ui .v-base-m{vertical-align:baseline}.swagger-ui .v-mid-m{vertical-align:middle}.swagger-ui .v-top-m{vertical-align:top}.swagger-ui .v-btm-m{vertical-align:bottom}}@media screen and (min-width:60em){.swagger-ui .v-base-l{vertical-align:baseline}.swagger-ui .v-mid-l{vertical-align:middle}.swagger-ui .v-top-l{vertical-align:top}.swagger-ui .v-btm-l{vertical-align:bottom}}.swagger-ui .dim{opacity:1;transition:opacity .15s ease-in}.swagger-ui .dim:focus,.swagger-ui .dim:hover{opacity:.5;transition:opacity .15s ease-in}.swagger-ui .dim:active{opacity:.8;transition:opacity .15s ease-out}.swagger-ui .glow{transition:opacity .15s ease-in}.swagger-ui .glow:focus,.swagger-ui .glow:hover{opacity:1;transition:opacity .15s ease-in}.swagger-ui .hide-child .child{opacity:0;transition:opacity .15s ease-in}.swagger-ui .hide-child:active .child,.swagger-ui .hide-child:focus .child,.swagger-ui .hide-child:hover .child{opacity:1;transition:opacity .15s ease-in}.swagger-ui .underline-hover:focus,.swagger-ui .underline-hover:hover{-webkit-text-decoration:underline;text-decoration:underline}.swagger-ui .grow{-moz-osx-font-smoothing:grayscale;backface-visibility:hidden;transform:translateZ(0);transition:transform .25s ease-out}.swagger-ui .grow:focus,.swagger-ui .grow:hover{transform:scale(1.05)}.swagger-ui .grow:active{transform:scale(.9)}.swagger-ui .grow-large{-moz-osx-font-smoothing:grayscale;backface-visibility:hidden;transform:translateZ(0);transition:transform .25s ease-in-out}.swagger-ui .grow-large:focus,.swagger-ui .grow-large:hover{transform:scale(1.2)}.swagger-ui .grow-large:active{transform:scale(.95)}.swagger-ui .pointer:hover{cursor:pointer}.swagger-ui .shadow-hover{cursor:pointer;position:relative;transition:all .5s cubic-bezier(.165,.84,.44,1)}.swagger-ui .shadow-hover:after{border-radius:inherit;box-shadow:0 0 16px 2px rgba(0,0,0,.2);content:\"\";height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .5s cubic-bezier(.165,.84,.44,1);width:100%;z-index:-1}.swagger-ui .shadow-hover:focus:after,.swagger-ui .shadow-hover:hover:after{opacity:1}.swagger-ui .bg-animate,.swagger-ui .bg-animate:focus,.swagger-ui .bg-animate:hover{transition:background-color .15s ease-in-out}.swagger-ui .z-0{z-index:0}.swagger-ui .z-1{z-index:1}.swagger-ui .z-2{z-index:2}.swagger-ui .z-3{z-index:3}.swagger-ui .z-4{z-index:4}.swagger-ui .z-5{z-index:5}.swagger-ui .z-999{z-index:999}.swagger-ui .z-9999{z-index:9999}.swagger-ui .z-max{z-index:2147483647}.swagger-ui .z-inherit{z-index:inherit}.swagger-ui .z-initial,.swagger-ui .z-unset{z-index:auto}.swagger-ui .nested-copy-line-height ol,.swagger-ui .nested-copy-line-height p,.swagger-ui .nested-copy-line-height ul{line-height:1.5}.swagger-ui .nested-headline-line-height h1,.swagger-ui .nested-headline-line-height h2,.swagger-ui .nested-headline-line-height h3,.swagger-ui .nested-headline-line-height h4,.swagger-ui .nested-headline-line-height h5,.swagger-ui .nested-headline-line-height h6{line-height:1.25}.swagger-ui .nested-list-reset ol,.swagger-ui .nested-list-reset ul{list-style-type:none;margin-left:0;padding-left:0}.swagger-ui .nested-copy-indent p+p{margin-bottom:0;margin-top:0;text-indent:.1em}.swagger-ui .nested-copy-seperator p+p{margin-top:1.5em}.swagger-ui .nested-img img{display:block;max-width:100%;width:100%}.swagger-ui .nested-links a{color:#357edd;transition:color .15s ease-in}.swagger-ui .nested-links a:focus,.swagger-ui .nested-links a:hover{color:#96ccff;transition:color .15s ease-in}.swagger-ui .wrapper{box-sizing:border-box;margin:0 auto;max-width:1460px;padding:0 20px;width:100%}.swagger-ui .opblock-tag-section{display:flex;flex-direction:column}.swagger-ui .try-out.btn-group{display:flex;flex:.1 2 auto;padding:0}.swagger-ui .try-out__btn{margin-left:1.25rem}.swagger-ui .opblock-tag{align-items:center;border-bottom:1px solid rgba(59,65,81,.3);cursor:pointer;display:flex;padding:10px 20px 10px 10px;transition:all .2s}.swagger-ui .opblock-tag:hover{background:rgba(0,0,0,.02)}.swagger-ui .opblock-tag{color:#3b4151;font-family:sans-serif;font-size:24px;margin:0 0 5px}.swagger-ui .opblock-tag.no-desc span{flex:1}.swagger-ui .opblock-tag svg{transition:all .4s}.swagger-ui .opblock-tag small{color:#3b4151;flex:2;font-family:sans-serif;font-size:14px;font-weight:400;padding:0 10px}.swagger-ui .opblock-tag>div{flex:1 1 150px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(max-width:640px){.swagger-ui .opblock-tag small,.swagger-ui .opblock-tag>div{flex:1}}.swagger-ui .opblock-tag .info__externaldocs{text-align:right}.swagger-ui .parameter__type{color:#3b4151;font-family:monospace;font-size:12px;font-weight:600;padding:5px 0}.swagger-ui .parameter-controls{margin-top:.75em}.swagger-ui .examples__title{display:block;font-size:1.1em;font-weight:700;margin-bottom:.75em}.swagger-ui .examples__section{margin-top:1.5em}.swagger-ui .examples__section-header{font-size:.9rem;font-weight:700;margin-bottom:.5rem}.swagger-ui .examples-select{display:inline-block;margin-bottom:.75em}.swagger-ui .examples-select .examples-select-element{width:100%}.swagger-ui .examples-select__section-label{font-size:.9rem;font-weight:700;margin-right:.5rem}.swagger-ui .example__section{margin-top:1.5em}.swagger-ui .example__section-header{font-size:.9rem;font-weight:700;margin-bottom:.5rem}.swagger-ui .view-line-link{cursor:pointer;margin:0 5px;position:relative;top:3px;transition:all .5s;width:20px}.swagger-ui .opblock{border:1px solid #000;border-radius:4px;box-shadow:0 0 3px rgba(0,0,0,.19);margin:0 0 15px}.swagger-ui .opblock .tab-header{display:flex;flex:1}.swagger-ui .opblock .tab-header .tab-item{cursor:pointer;padding:0 40px}.swagger-ui .opblock .tab-header .tab-item:first-of-type{padding:0 40px 0 0}.swagger-ui .opblock .tab-header .tab-item.active h4 span{position:relative}.swagger-ui .opblock .tab-header .tab-item.active h4 span:after{background:gray;bottom:-15px;content:\"\";height:4px;left:50%;position:absolute;transform:translateX(-50%);width:120%}.swagger-ui .opblock.is-open .opblock-summary{border-bottom:1px solid #000}.swagger-ui .opblock .opblock-section-header{align-items:center;background:hsla(0,0%,100%,.8);box-shadow:0 1px 2px rgba(0,0,0,.1);display:flex;min-height:50px;padding:8px 20px}.swagger-ui .opblock .opblock-section-header>label{align-items:center;color:#3b4151;display:flex;font-family:sans-serif;font-size:12px;font-weight:700;margin:0 0 0 auto}.swagger-ui .opblock .opblock-section-header>label>span{padding:0 10px 0 0}.swagger-ui .opblock .opblock-section-header h4{color:#3b4151;flex:1;font-family:sans-serif;font-size:14px;margin:0}.swagger-ui .opblock .opblock-summary-method{background:#000;border-radius:3px;color:#fff;font-family:sans-serif;font-size:14px;font-weight:700;min-width:80px;padding:6px 0;text-align:center;text-shadow:0 1px 0 rgba(0,0,0,.1)}@media(max-width:768px){.swagger-ui .opblock .opblock-summary-method{font-size:12px}}.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{align-items:center;color:#3b4151;display:flex;font-family:monospace;font-size:16px;font-weight:600;word-break:break-word}@media(max-width:768px){.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:12px}}.swagger-ui .opblock .opblock-summary-path{flex-shrink:1}@media(max-width:640px){.swagger-ui .opblock .opblock-summary-path{max-width:100%}}.swagger-ui .opblock .opblock-summary-path__deprecated{-webkit-text-decoration:line-through;text-decoration:line-through}.swagger-ui .opblock .opblock-summary-operation-id{font-size:14px}.swagger-ui .opblock .opblock-summary-description{color:#3b4151;font-family:sans-serif;font-size:13px;word-break:break-word}.swagger-ui .opblock .opblock-summary-path-description-wrapper{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;gap:0 10px;padding:0 10px;width:100%}@media(max-width:550px){.swagger-ui .opblock .opblock-summary-path-description-wrapper{align-items:flex-start;flex-direction:column}}.swagger-ui .opblock .opblock-summary{align-items:center;cursor:pointer;display:flex;padding:5px}.swagger-ui .opblock .opblock-summary .view-line-link{cursor:pointer;margin:0;position:relative;top:2px;transition:all .5s;width:0}.swagger-ui .opblock .opblock-summary:hover .view-line-link{margin:0 5px;width:18px}.swagger-ui .opblock .opblock-summary:hover .view-line-link.copy-to-clipboard{width:24px}.swagger-ui .opblock.opblock-post{background:rgba(73,204,144,.1);border-color:#49cc90}.swagger-ui .opblock.opblock-post .opblock-summary-method{background:#49cc90}.swagger-ui .opblock.opblock-post .opblock-summary{border-color:#49cc90}.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after{background:#49cc90}.swagger-ui .opblock.opblock-put{background:rgba(252,161,48,.1);border-color:#fca130}.swagger-ui .opblock.opblock-put .opblock-summary-method{background:#fca130}.swagger-ui .opblock.opblock-put .opblock-summary{border-color:#fca130}.swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after{background:#fca130}.swagger-ui .opblock.opblock-delete{background:rgba(249,62,62,.1);border-color:#f93e3e}.swagger-ui .opblock.opblock-delete .opblock-summary-method{background:#f93e3e}.swagger-ui .opblock.opblock-delete .opblock-summary{border-color:#f93e3e}.swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after{background:#f93e3e}.swagger-ui .opblock.opblock-get{background:rgba(97,175,254,.1);border-color:#61affe}.swagger-ui .opblock.opblock-get .opblock-summary-method{background:#61affe}.swagger-ui .opblock.opblock-get .opblock-summary{border-color:#61affe}.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after{background:#61affe}.swagger-ui .opblock.opblock-patch{background:rgba(80,227,194,.1);border-color:#50e3c2}.swagger-ui .opblock.opblock-patch .opblock-summary-method{background:#50e3c2}.swagger-ui .opblock.opblock-patch .opblock-summary{border-color:#50e3c2}.swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after{background:#50e3c2}.swagger-ui .opblock.opblock-head{background:rgba(144,18,254,.1);border-color:#9012fe}.swagger-ui .opblock.opblock-head .opblock-summary-method{background:#9012fe}.swagger-ui .opblock.opblock-head .opblock-summary{border-color:#9012fe}.swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span:after{background:#9012fe}.swagger-ui .opblock.opblock-options{background:rgba(13,90,167,.1);border-color:#0d5aa7}.swagger-ui .opblock.opblock-options .opblock-summary-method{background:#0d5aa7}.swagger-ui .opblock.opblock-options .opblock-summary{border-color:#0d5aa7}.swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span:after{background:#0d5aa7}.swagger-ui .opblock.opblock-deprecated{background:hsla(0,0%,92%,.1);border-color:#ebebeb;opacity:.6}.swagger-ui .opblock.opblock-deprecated .opblock-summary-method{background:#ebebeb}.swagger-ui .opblock.opblock-deprecated .opblock-summary{border-color:#ebebeb}.swagger-ui .opblock.opblock-deprecated .tab-header .tab-item.active h4 span:after{background:#ebebeb}.swagger-ui .opblock .opblock-schemes{padding:8px 20px}.swagger-ui .opblock .opblock-schemes .schemes-title{padding:0 10px 0 0}.swagger-ui .filter .operation-filter-input{border:2px solid #d8dde7;margin:20px 0;padding:10px;width:100%}.swagger-ui .download-url-wrapper .failed,.swagger-ui .filter .failed{color:red}.swagger-ui .download-url-wrapper .loading,.swagger-ui .filter .loading{color:#aaa}.swagger-ui .model-example{margin-top:1em}.swagger-ui .tab{display:flex;list-style:none;padding:0}.swagger-ui .tab li{color:#3b4151;cursor:pointer;font-family:sans-serif;font-size:12px;min-width:60px;padding:0}.swagger-ui .tab li:first-of-type{padding-left:0;padding-right:12px;position:relative}.swagger-ui .tab li:first-of-type:after{background:rgba(0,0,0,.2);content:\"\";height:100%;position:absolute;right:6px;top:0;width:1px}.swagger-ui .tab li.active{font-weight:700}.swagger-ui .tab li button.tablinks{background:none;border:0;color:inherit;font-family:inherit;font-weight:inherit;padding:0}.swagger-ui .opblock-description-wrapper,.swagger-ui .opblock-external-docs-wrapper,.swagger-ui .opblock-title_normal{color:#3b4151;font-family:sans-serif;font-size:12px;margin:0 0 5px;padding:15px 20px}.swagger-ui .opblock-description-wrapper h4,.swagger-ui .opblock-external-docs-wrapper h4,.swagger-ui .opblock-title_normal h4{color:#3b4151;font-family:sans-serif;font-size:12px;margin:0 0 5px}.swagger-ui .opblock-description-wrapper p,.swagger-ui .opblock-external-docs-wrapper p,.swagger-ui .opblock-title_normal p{color:#3b4151;font-family:sans-serif;font-size:14px;margin:0}.swagger-ui .opblock-external-docs-wrapper h4{padding-left:0}.swagger-ui .execute-wrapper{padding:20px;text-align:right}.swagger-ui .execute-wrapper .btn{padding:8px 40px;width:100%}.swagger-ui .body-param-options{display:flex;flex-direction:column}.swagger-ui .body-param-options .body-param-edit{padding:10px 0}.swagger-ui .body-param-options label{padding:8px 0}.swagger-ui .body-param-options label select{margin:3px 0 0}.swagger-ui .responses-inner{padding:20px}.swagger-ui .responses-inner h4,.swagger-ui .responses-inner h5{color:#3b4151;font-family:sans-serif;font-size:12px;margin:10px 0 5px}.swagger-ui .responses-inner .curl{max-height:400px;min-height:6em;overflow-y:auto}.swagger-ui .response-col_status{color:#3b4151;font-family:sans-serif;font-size:14px}.swagger-ui .response-col_status .response-undocumented{color:#909090;font-family:monospace;font-size:11px;font-weight:600}.swagger-ui .response-col_links{color:#3b4151;font-family:sans-serif;font-size:14px;max-width:40em;padding-left:2em}.swagger-ui .response-col_links .response-undocumented{color:#909090;font-family:monospace;font-size:11px;font-weight:600}.swagger-ui .response-col_links .operation-link{margin-bottom:1.5em}.swagger-ui .response-col_links .operation-link .description{margin-bottom:.5em}.swagger-ui .opblock-body .opblock-loading-animation{display:block;margin:3em auto}.swagger-ui .opblock-body pre.microlight{background:#333;border-radius:4px;font-size:12px;-webkit-hyphens:auto;hyphens:auto;margin:0;padding:10px;white-space:pre-wrap;word-break:break-all;word-break:break-word;word-wrap:break-word;color:#fff;font-family:monospace;font-weight:600}.swagger-ui .opblock-body pre.microlight .headerline{display:block}.swagger-ui .highlight-code{position:relative}.swagger-ui .highlight-code>.microlight{max-height:400px;min-height:6em;overflow-y:auto}.swagger-ui .highlight-code>.microlight code{white-space:pre-wrap!important;word-break:break-all}.swagger-ui .curl-command{position:relative}.swagger-ui .download-contents{align-items:center;background:#7d8293;border:none;border-radius:4px;bottom:10px;color:#fff;display:flex;font-family:sans-serif;font-size:14px;font-weight:600;height:30px;justify-content:center;padding:5px;position:absolute;right:10px;text-align:center}.swagger-ui .scheme-container{background:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.15);margin:0 0 20px;padding:30px 0}.swagger-ui .scheme-container .schemes{align-items:flex-end;display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between}.swagger-ui .scheme-container .schemes>.schemes-server-container{display:flex;flex-wrap:wrap;gap:10px}.swagger-ui .scheme-container .schemes>.schemes-server-container>label{color:#3b4151;display:flex;flex-direction:column;font-family:sans-serif;font-size:12px;font-weight:700;margin:-20px 15px 0 0}.swagger-ui .scheme-container .schemes>.schemes-server-container>label select{min-width:130px;text-transform:uppercase}.swagger-ui .scheme-container .schemes:not(:has(.schemes-server-container)){justify-content:flex-end}.swagger-ui .scheme-container .schemes .auth-wrapper{flex:none;justify-content:start}.swagger-ui .scheme-container .schemes .auth-wrapper .authorize{display:flex;flex-wrap:nowrap;margin:0;padding-right:20px}.swagger-ui .loading-container{align-items:center;display:flex;flex-direction:column;justify-content:center;margin-top:1em;min-height:1px;padding:40px 0 60px}.swagger-ui .loading-container .loading{position:relative}.swagger-ui .loading-container .loading:after{color:#3b4151;content:\"loading\";font-family:sans-serif;font-size:10px;font-weight:700;left:50%;position:absolute;text-transform:uppercase;top:50%;transform:translate(-50%,-50%)}.swagger-ui .loading-container .loading:before{animation:rotation 1s linear infinite,opacity .5s;backface-visibility:hidden;border:2px solid rgba(85,85,85,.1);border-radius:100%;border-top-color:rgba(0,0,0,.6);content:\"\";display:block;height:60px;left:50%;margin:-30px;opacity:1;position:absolute;top:50%;width:60px}@keyframes rotation{to{transform:rotate(1turn)}}.swagger-ui .response-controls{display:flex;padding-top:1em}.swagger-ui .response-control-media-type{margin-right:1em}.swagger-ui .response-control-media-type--accept-controller select{border-color:green}.swagger-ui .response-control-media-type__accept-message{color:green;font-size:.7em}.swagger-ui .response-control-examples__title,.swagger-ui .response-control-media-type__title{display:block;font-size:.7em;margin-bottom:.2em}@keyframes blinker{50%{opacity:0}}.swagger-ui .hidden{display:none}.swagger-ui .no-margin{border:none;height:auto;margin:0;padding:0}.swagger-ui .float-right{float:right}.swagger-ui .svg-assets{height:0;position:absolute;width:0}.swagger-ui section h3{color:#3b4151;font-family:sans-serif}.swagger-ui a.nostyle{display:inline}.swagger-ui a.nostyle,.swagger-ui a.nostyle:visited{color:inherit;cursor:pointer;text-decoration:inherit}.swagger-ui .fallback{color:#aaa;padding:1em}.swagger-ui .version-pragma{height:100%;padding:5em 0}.swagger-ui .version-pragma__message{display:flex;font-size:1.2em;height:100%;justify-content:center;line-height:1.5em;padding:0 .6em;text-align:center}.swagger-ui .version-pragma__message>div{flex:1;max-width:55ch}.swagger-ui .version-pragma__message code{background-color:#dedede;padding:4px 4px 2px;white-space:pre}.swagger-ui .opblock-link{font-weight:400}.swagger-ui .opblock-link.shown{font-weight:700}.swagger-ui span.token-string{color:#555}.swagger-ui span.token-not-formatted{color:#555;font-weight:700}.swagger-ui .btn{background:transparent;border:2px solid gray;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.1);color:#3b4151;font-family:sans-serif;font-size:14px;font-weight:700;padding:5px 23px;transition:all .3s}.swagger-ui .btn.btn-sm{font-size:12px;padding:4px 23px}.swagger-ui .btn[disabled]{cursor:not-allowed;opacity:.3}.swagger-ui .btn:hover{box-shadow:0 0 5px rgba(0,0,0,.3)}.swagger-ui .btn.cancel{background-color:transparent;border-color:#ff6060;color:#ff6060;font-family:sans-serif}.swagger-ui .btn.authorize{background-color:transparent;border-color:#49cc90;color:#49cc90;display:inline;line-height:1}.swagger-ui .btn.authorize span{float:left;padding:4px 20px 0 0}.swagger-ui .btn.authorize svg{fill:#49cc90}.swagger-ui .btn.execute{background-color:#4990e2;border-color:#4990e2;color:#fff}.swagger-ui .btn-group{display:flex;padding:30px}.swagger-ui .btn-group .btn{flex:1}.swagger-ui .btn-group .btn:first-child{border-radius:4px 0 0 4px}.swagger-ui .btn-group .btn:last-child{border-radius:0 4px 4px 0}.swagger-ui .authorization__btn{background:none;border:none;padding:0 0 0 10px}.swagger-ui .authorization__btn .locked{opacity:1}.swagger-ui .authorization__btn .unlocked{opacity:.4}.swagger-ui .model-box-control,.swagger-ui .models-control,.swagger-ui .opblock-summary-control{all:inherit;border-bottom:0;cursor:pointer;flex:1;padding:0}.swagger-ui .model-box-control:focus,.swagger-ui .models-control:focus,.swagger-ui .opblock-summary-control:focus{outline:auto}.swagger-ui .expand-methods,.swagger-ui .expand-operation{background:none;border:none}.swagger-ui .expand-methods svg,.swagger-ui .expand-operation svg{height:20px;width:20px}.swagger-ui .expand-methods{padding:0 10px}.swagger-ui .expand-methods:hover svg{fill:#404040}.swagger-ui .expand-methods svg{transition:all .3s;fill:#707070}.swagger-ui button{cursor:pointer}.swagger-ui button.invalid{animation:shake .4s 1;background:#feebeb;border-color:#f93e3e}.swagger-ui .copy-to-clipboard{align-items:center;background:#7d8293;border:none;border-radius:4px;bottom:10px;display:flex;height:30px;justify-content:center;position:absolute;right:100px;width:30px}.swagger-ui .copy-to-clipboard button{background:url(\"data:image/svg+xml;charset=utf-8,<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"16\\\" height=\\\"15\\\" aria-hidden=\\\"true\\\"><path fill=\\\"%23fff\\\" fill-rule=\\\"evenodd\\\" d=\\\"M4 12h4v1H4zm5-6H4v1h5zm2 3V7l-3 3 3 3v-2h5V9zM6.5 8H4v1h2.5zM4 11h2.5v-1H4zm9 1h1v2c-.02.28-.11.52-.3.7s-.42.28-.7.3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3c0-1.11.89-2 2-2s2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V5H3v9h10zM4 4h8c0-.55-.45-1-1-1h-1c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H5c-.55 0-1 .45-1 1\\\"/></svg>\") 50% no-repeat;border:none;flex-grow:1;flex-shrink:1;height:25px}.swagger-ui .copy-to-clipboard:active{background:#5e626f}.swagger-ui .opblock-control-arrow{background:none;border:none;text-align:center}.swagger-ui .curl-command .copy-to-clipboard{bottom:5px;height:20px;right:10px;width:20px}.swagger-ui .curl-command .copy-to-clipboard button{height:18px}.swagger-ui .opblock .opblock-summary .view-line-link.copy-to-clipboard{height:26px;position:static}.swagger-ui select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#f7f7f7 url(\"data:image/svg+xml;charset=utf-8,<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M13.418 7.859a.695.695 0 0 1 .978 0 .68.68 0 0 1 0 .969l-3.908 3.83a.697.697 0 0 1-.979 0l-3.908-3.83a.68.68 0 0 1 0-.969.695.695 0 0 1 .978 0L10 11z\\\"/></svg>\") right 10px center no-repeat;background-size:20px;border:2px solid #41444e;border-radius:4px;box-shadow:0 1px 2px 0 rgba(0,0,0,.25);color:#3b4151;font-family:sans-serif;font-size:14px;font-weight:700;padding:5px 40px 5px 10px}.swagger-ui select[multiple]{background:#f7f7f7;margin:5px 0;padding:5px}.swagger-ui select.invalid{animation:shake .4s 1;background:#feebeb;border-color:#f93e3e}.swagger-ui .opblock-body select{min-width:230px}@media(max-width:768px){.swagger-ui .opblock-body select{min-width:180px}}@media(max-width:640px){.swagger-ui .opblock-body select{min-width:100%;width:100%}}.swagger-ui label{color:#3b4151;font-family:sans-serif;font-size:12px;font-weight:700;margin:0 0 5px}.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text]{line-height:1}@media(max-width:768px){.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text]{max-width:175px}}.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text],.swagger-ui textarea{background:#fff;border:1px solid #d9d9d9;border-radius:4px;margin:5px 0;min-width:100px;padding:8px 10px}.swagger-ui input[type=email].invalid,.swagger-ui input[type=file].invalid,.swagger-ui input[type=password].invalid,.swagger-ui input[type=search].invalid,.swagger-ui input[type=text].invalid,.swagger-ui textarea.invalid{animation:shake .4s 1;background:#feebeb;border-color:#f93e3e}.swagger-ui input[disabled],.swagger-ui select[disabled],.swagger-ui textarea[disabled]{background-color:#fafafa;color:#888;cursor:not-allowed}.swagger-ui select[disabled]{border-color:#888}.swagger-ui textarea[disabled]{background-color:#41444e;color:#fff}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}.swagger-ui textarea{background:hsla(0,0%,100%,.8);border:none;border-radius:4px;color:#3b4151;font-family:monospace;font-size:12px;font-weight:600;min-height:280px;outline:none;padding:10px;width:100%}.swagger-ui textarea:focus{border:2px solid #61affe}.swagger-ui textarea.curl{background:#41444e;border-radius:4px;color:#fff;font-family:monospace;font-size:12px;font-weight:600;margin:0;min-height:100px;padding:10px;resize:none}.swagger-ui .checkbox{color:#303030;padding:5px 0 10px;transition:opacity .5s}.swagger-ui .checkbox label{display:flex}.swagger-ui .checkbox p{color:#3b4151;font-family:monospace;font-style:italic;font-weight:400!important;font-weight:600;margin:0!important}.swagger-ui .checkbox input[type=checkbox]{display:none}.swagger-ui .checkbox input[type=checkbox]+label>.item{background:#e8e8e8;border-radius:1px;box-shadow:0 0 0 2px #e8e8e8;cursor:pointer;display:inline-block;flex:none;height:16px;margin:0 8px 0 0;padding:5px;position:relative;top:3px;width:16px}.swagger-ui .checkbox input[type=checkbox]+label>.item:active{transform:scale(.9)}.swagger-ui .checkbox input[type=checkbox]:checked+label>.item{background:#e8e8e8 url(\"data:image/svg+xml;charset=utf-8,<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"10\\\" height=\\\"8\\\" viewBox=\\\"3 7 10 8\\\"><path fill=\\\"%2341474E\\\" fill-rule=\\\"evenodd\\\" d=\\\"M6.333 15 3 11.667l1.333-1.334 2 2L11.667 7 13 8.333z\\\"/></svg>\") 50% no-repeat}.swagger-ui .dialog-ux{bottom:0;left:0;position:fixed;right:0;top:0;z-index:9999}.swagger-ui .dialog-ux .backdrop-ux{background:rgba(0,0,0,.8);bottom:0;left:0;position:fixed;right:0;top:0}.swagger-ui .dialog-ux .modal-ux{background:#fff;border:1px solid #ebebeb;border-radius:4px;box-shadow:0 10px 30px 0 rgba(0,0,0,.2);left:50%;max-width:650px;min-width:300px;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%;z-index:9999}.swagger-ui .dialog-ux .modal-ux-content{max-height:540px;overflow-y:auto;padding:20px}.swagger-ui .dialog-ux .modal-ux-content p{color:#41444e;color:#3b4151;font-family:sans-serif;font-size:12px;margin:0 0 5px}.swagger-ui .dialog-ux .modal-ux-content h4{color:#3b4151;font-family:sans-serif;font-size:18px;font-weight:600;margin:15px 0 0}.swagger-ui .dialog-ux .modal-ux-header{align-items:center;border-bottom:1px solid #ebebeb;display:flex;padding:12px 0}.swagger-ui .dialog-ux .modal-ux-header .close-modal{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;padding:0 10px}.swagger-ui .dialog-ux .modal-ux-header h3{color:#3b4151;flex:1;font-family:sans-serif;font-size:20px;font-weight:600;margin:0;padding:0 20px}.swagger-ui .model{color:#3b4151;font-family:monospace;font-size:12px;font-weight:300;font-weight:600}.swagger-ui .model .deprecated span,.swagger-ui .model .deprecated td{color:#a0a0a0!important}.swagger-ui .model .deprecated>td:first-of-type{-webkit-text-decoration:line-through;text-decoration:line-through}.swagger-ui .model-toggle{cursor:pointer;display:inline-block;font-size:10px;margin:auto .3em;position:relative;top:6px;transform:rotate(90deg);transform-origin:50% 50%;transition:transform .15s ease-in}.swagger-ui .model-toggle.collapsed{transform:rotate(0deg)}.swagger-ui .model-toggle:after{background:url(\"data:image/svg+xml;charset=utf-8,<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"24\\\" height=\\\"24\\\"><path d=\\\"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\\\"/></svg>\") 50% no-repeat;background-size:100%;content:\"\";display:block;height:20px;width:20px}.swagger-ui .model-jump-to-path{cursor:pointer;position:relative}.swagger-ui .model-jump-to-path .view-line-link{cursor:pointer;position:absolute;top:-.4em}.swagger-ui .model-title{position:relative}.swagger-ui .model-title:hover .model-hint{visibility:visible}.swagger-ui .model-hint{background:rgba(0,0,0,.7);border-radius:4px;color:#ebebeb;padding:.1em .5em;position:absolute;top:-1.8em;visibility:hidden;white-space:nowrap}.swagger-ui .model p{margin:0 0 1em}.swagger-ui .model .property{color:#999;font-style:italic}.swagger-ui .model .property.primitive{color:#6b6b6b}.swagger-ui .model .external-docs,.swagger-ui table.model tr.description{color:#666;font-weight:400}.swagger-ui table.model tr.description td:first-child,.swagger-ui table.model tr.property-row.required td:first-child{font-weight:700}.swagger-ui table.model tr.property-row td{vertical-align:top}.swagger-ui table.model tr.property-row td:first-child{padding-right:.2em}.swagger-ui table.model tr.property-row .star{color:red}.swagger-ui table.model tr.extension{color:#777}.swagger-ui table.model tr.extension td:last-child{vertical-align:top}.swagger-ui table.model tr.external-docs td:first-child{font-weight:700}.swagger-ui table.model tr .renderedMarkdown p:first-child{margin-top:0}.swagger-ui section.models{border:1px solid rgba(59,65,81,.3);border-radius:4px;margin:30px 0}.swagger-ui section.models .pointer{cursor:pointer}.swagger-ui section.models.is-open{padding:0 0 20px}.swagger-ui section.models.is-open h4{border-bottom:1px solid rgba(59,65,81,.3);margin:0 0 5px}.swagger-ui section.models h4{align-items:center;color:#606060;cursor:pointer;display:flex;font-family:sans-serif;font-size:16px;margin:0;padding:10px 20px 10px 10px;transition:all .2s}.swagger-ui section.models h4 svg{transition:all .4s}.swagger-ui section.models h4 span{flex:1}.swagger-ui section.models h4:hover{background:rgba(0,0,0,.02)}.swagger-ui section.models h5{color:#707070;font-family:sans-serif;font-size:16px;margin:0 0 10px}.swagger-ui section.models .model-jump-to-path{position:relative;top:5px}.swagger-ui section.models .model-container{background:rgba(0,0,0,.05);border-radius:4px;margin:0 20px 15px;position:relative;transition:all .5s}.swagger-ui section.models .model-container:hover{background:rgba(0,0,0,.07)}.swagger-ui section.models .model-container:first-of-type{margin:20px}.swagger-ui section.models .model-container:last-of-type{margin:0 20px}.swagger-ui section.models .model-container .models-jump-to-path{opacity:.65;position:absolute;right:5px;top:8px}.swagger-ui section.models .model-box{background:none}.swagger-ui .model-box{background:rgba(0,0,0,.1);border-radius:4px;display:inline-block;padding:10px}.swagger-ui .model-box .model-jump-to-path{position:relative;top:4px}.swagger-ui .model-box.deprecated{opacity:.5}.swagger-ui .model-title{color:#505050;font-family:sans-serif;font-size:16px}.swagger-ui .model-title img{bottom:0;margin-left:1em;position:relative}.swagger-ui .model-deprecated-warning{color:#f93e3e;font-family:sans-serif;font-size:16px;font-weight:600;margin-right:1em}.swagger-ui span>span.model .brace-close{padding:0 0 0 10px}.swagger-ui .prop-name{display:inline-block;margin-right:1em}.swagger-ui .prop-type{color:#55a}.swagger-ui .prop-enum{display:block}.swagger-ui .prop-format{color:#606060}.swagger-ui .servers>label{color:#3b4151;font-family:sans-serif;font-size:12px;margin:-20px 15px 0 0}.swagger-ui .servers>label select{max-width:100%;min-width:130px;width:100%}.swagger-ui .servers h4.message{padding-bottom:2em}.swagger-ui .servers table tr{width:30em}.swagger-ui .servers table td{display:inline-block;max-width:15em;padding-bottom:10px;padding-top:10px;vertical-align:middle}.swagger-ui .servers table td:first-of-type{padding-right:1em}.swagger-ui .servers table td input{height:100%;width:100%}.swagger-ui .servers .computed-url{margin:2em 0}.swagger-ui .servers .computed-url code{display:inline-block;font-size:16px;margin:0 1em;padding:4px}.swagger-ui .servers-title{font-size:12px;font-weight:700}.swagger-ui .operation-servers h4.message{margin-bottom:2em}.swagger-ui table{border-collapse:collapse;padding:0 10px;width:100%}.swagger-ui table.model tbody tr td{padding:0;vertical-align:top}.swagger-ui table.model tbody tr td:first-of-type{padding:0 0 0 2em;width:174px}.swagger-ui table.headers td{color:#3b4151;font-family:monospace;font-size:12px;font-weight:300;font-weight:600;vertical-align:middle}.swagger-ui table.headers .header-example{color:#999;font-style:italic}.swagger-ui table tbody tr td{padding:10px 0 0;vertical-align:top}.swagger-ui table tbody tr td:first-of-type{min-width:6em;padding:10px 0}.swagger-ui table thead tr td,.swagger-ui table thead tr th{border-bottom:1px solid rgba(59,65,81,.2);color:#3b4151;font-family:sans-serif;font-size:12px;font-weight:700;padding:12px 0;text-align:left}.swagger-ui .parameters-col_description{margin-bottom:2em;width:99%}.swagger-ui .parameters-col_description input{max-width:340px;width:100%}.swagger-ui .parameters-col_description select{border-width:1px}.swagger-ui .parameters-col_description .markdown p,.swagger-ui .parameters-col_description .renderedMarkdown p{margin:0}.swagger-ui .parameter__name{color:#3b4151;font-family:sans-serif;font-size:16px;font-weight:400;margin-right:.75em}.swagger-ui .parameter__name.required{font-weight:700}.swagger-ui .parameter__name.required span{color:red}.swagger-ui .parameter__name.required:after{color:rgba(255,0,0,.6);content:\"required\";font-size:10px;padding:5px;position:relative;top:-6px}.swagger-ui .parameter__extension,.swagger-ui .parameter__in{color:gray;font-family:monospace;font-size:12px;font-style:italic;font-weight:600}.swagger-ui .parameter__deprecated{color:red;font-family:monospace;font-size:12px;font-style:italic;font-weight:600}.swagger-ui .parameter__empty_value_toggle{display:block;font-size:13px;padding-bottom:12px;padding-top:5px}.swagger-ui .parameter__empty_value_toggle input{margin-right:7px;width:auto}.swagger-ui .parameter__empty_value_toggle.disabled{opacity:.7}.swagger-ui .table-container{padding:20px}.swagger-ui .response-col_description{width:99%}.swagger-ui .response-col_description .markdown p,.swagger-ui .response-col_description .renderedMarkdown p{margin:0}.swagger-ui .response-col_links{min-width:6em}.swagger-ui .response__extension{color:gray;font-family:monospace;font-size:12px;font-style:italic;font-weight:600}.swagger-ui .topbar{background-color:#1b1b1b;padding:10px 0}.swagger-ui .topbar .topbar-wrapper{align-items:center;display:flex;flex-wrap:wrap;gap:10px}@media(max-width:550px){.swagger-ui .topbar .topbar-wrapper{align-items:start;flex-direction:column}}.swagger-ui .topbar a{align-items:center;color:#fff;display:flex;flex:1;font-family:sans-serif;font-size:1.5em;font-weight:700;max-width:300px;-webkit-text-decoration:none;text-decoration:none}.swagger-ui .topbar a span{margin:0;padding:0 10px}.swagger-ui .topbar .download-url-wrapper{display:flex;flex:3;justify-content:flex-end}.swagger-ui .topbar .download-url-wrapper input[type=text]{border:2px solid #62a03f;border-radius:4px 0 0 4px;margin:0;max-width:100%;outline:none;width:100%}.swagger-ui .topbar .download-url-wrapper .select-label{align-items:center;color:#f0f0f0;display:flex;margin:0;max-width:600px;width:100%}.swagger-ui .topbar .download-url-wrapper .select-label span{flex:1;font-size:16px;padding:0 10px 0 0;text-align:right}.swagger-ui .topbar .download-url-wrapper .select-label select{border:2px solid #62a03f;box-shadow:none;flex:2;outline:none;width:100%}.swagger-ui .topbar .download-url-wrapper .download-url-button{background:#62a03f;border:none;border-radius:0 4px 4px 0;color:#fff;font-family:sans-serif;font-size:16px;font-weight:700;padding:4px 30px}@media(max-width:550px){.swagger-ui .topbar .download-url-wrapper{width:100%}}.swagger-ui .info{margin:50px 0}.swagger-ui .info.failed-config{margin-left:auto;margin-right:auto;max-width:880px;text-align:center}.swagger-ui .info hgroup.main{margin:0 0 20px}.swagger-ui .info hgroup.main a{font-size:12px}.swagger-ui .info pre{font-size:14px}.swagger-ui .info li,.swagger-ui .info p,.swagger-ui .info table{color:#3b4151;font-family:sans-serif;font-size:14px}.swagger-ui .info h1,.swagger-ui .info h2,.swagger-ui .info h3,.swagger-ui .info h4,.swagger-ui .info h5{color:#3b4151;font-family:sans-serif}.swagger-ui .info a{color:#4990e2;font-family:sans-serif;font-size:14px;transition:all .4s}.swagger-ui .info a:hover{color:#1f69c0}.swagger-ui .info>div{margin:0 0 5px}.swagger-ui .info .base-url{color:#3b4151;font-family:monospace;font-size:12px;font-weight:300!important;font-weight:600;margin:0}.swagger-ui .info .title{color:#3b4151;font-family:sans-serif;font-size:36px;margin:0}.swagger-ui .info .title small{background:#7d8492;border-radius:57px;display:inline-block;font-size:10px;margin:0 0 0 5px;padding:2px 4px;position:relative;top:-5px;vertical-align:super}.swagger-ui .info .title small.version-stamp{background-color:#89bf04}.swagger-ui .info .title small pre{color:#fff;font-family:sans-serif;margin:0;padding:0}.swagger-ui .auth-btn-wrapper{display:flex;justify-content:center;padding:10px 0}.swagger-ui .auth-btn-wrapper .btn-done{margin-right:1em}.swagger-ui .auth-wrapper{display:flex;flex:1;justify-content:flex-end}.swagger-ui .auth-wrapper .authorize{margin-left:10px;margin-right:10px;padding-right:20px}.swagger-ui .auth-container{border-bottom:1px solid #ebebeb;margin:0 0 10px;padding:10px 20px}.swagger-ui .auth-container:last-of-type{border:0;margin:0;padding:10px 20px}.swagger-ui .auth-container h4{margin:5px 0 15px!important}.swagger-ui .auth-container .wrapper{margin:0;padding:0}.swagger-ui .auth-container input[type=password],.swagger-ui .auth-container input[type=text]{min-width:230px}.swagger-ui .auth-container .errors{background-color:#fee;border-radius:4px;color:red;color:#3b4151;font-family:monospace;font-size:12px;font-weight:600;margin:1em;padding:10px}.swagger-ui .auth-container .errors b{margin-right:1em;text-transform:capitalize}.swagger-ui .scopes h2{color:#3b4151;font-family:sans-serif;font-size:14px}.swagger-ui .scopes h2 a{color:#4990e2;cursor:pointer;font-size:12px;padding-left:10px;-webkit-text-decoration:underline;text-decoration:underline}.swagger-ui .scope-def{padding:0 0 20px}.swagger-ui .errors-wrapper{animation:scaleUp .5s;background:rgba(249,62,62,.1);border:2px solid #f93e3e;border-radius:4px;margin:20px;padding:10px 20px}.swagger-ui .errors-wrapper .error-wrapper{margin:0 0 10px}.swagger-ui .errors-wrapper .errors h4{color:#3b4151;font-family:monospace;font-size:14px;font-weight:600;margin:0}.swagger-ui .errors-wrapper .errors small{color:#606060}.swagger-ui .errors-wrapper .errors .message{white-space:pre-line}.swagger-ui .errors-wrapper .errors .message.thrown{max-width:100%}.swagger-ui .errors-wrapper .errors .error-line{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline}.swagger-ui .errors-wrapper hgroup{align-items:center;display:flex}.swagger-ui .errors-wrapper hgroup h4{color:#3b4151;flex:1;font-family:sans-serif;font-size:20px;margin:0}@keyframes scaleUp{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}.swagger-ui .Resizer.vertical.disabled{display:none}.swagger-ui .markdown p,.swagger-ui .markdown pre,.swagger-ui .renderedMarkdown p,.swagger-ui .renderedMarkdown pre{margin:1em auto;word-break:break-all;word-break:break-word}.swagger-ui .markdown pre,.swagger-ui .renderedMarkdown pre{background:none;color:#000;font-weight:400;padding:0;white-space:pre-wrap}.swagger-ui .markdown code,.swagger-ui .renderedMarkdown code{background:rgba(0,0,0,.05);border-radius:4px;color:#9012fe;font-family:monospace;font-size:14px;font-weight:600;padding:5px 7px}.swagger-ui .markdown pre>code,.swagger-ui .renderedMarkdown pre>code{display:block}.swagger-ui .json-schema-2020-12{background-color:rgba(0,0,0,.05);border-radius:4px;margin:0 20px 15px;padding:12px 0 12px 20px}.swagger-ui .json-schema-2020-12:first-of-type{margin:20px}.swagger-ui .json-schema-2020-12:last-of-type{margin:0 20px}.swagger-ui .json-schema-2020-12--embedded{background-color:inherit;padding-bottom:0;padding-left:inherit;padding-right:inherit;padding-top:0}.swagger-ui .json-schema-2020-12-body{border-left:1px dashed rgba(0,0,0,.1);margin:2px 0}.swagger-ui .json-schema-2020-12-body--collapsed{display:none}.swagger-ui .json-schema-2020-12-accordion{border:none;outline:none;padding-left:0}.swagger-ui .json-schema-2020-12-accordion__children{display:inline-block}.swagger-ui .json-schema-2020-12-accordion__icon{display:inline-block;height:18px;vertical-align:bottom;width:18px}.swagger-ui .json-schema-2020-12-accordion__icon--expanded{transform:rotate(-90deg);transform-origin:50% 50%;transition:transform .15s ease-in}.swagger-ui .json-schema-2020-12-accordion__icon--collapsed{transform:rotate(0deg);transform-origin:50% 50%;transition:transform .15s ease-in}.swagger-ui .json-schema-2020-12-accordion__icon svg{height:20px;width:20px}.swagger-ui .json-schema-2020-12-expand-deep-button{border:none;color:#505050;color:#afaeae;font-family:sans-serif;font-size:12px;padding-right:0}.swagger-ui .json-schema-2020-12-keyword{margin:5px 0}.swagger-ui .json-schema-2020-12-keyword__children{border-left:1px dashed rgba(0,0,0,.1);margin:0 0 0 20px;padding:0}.swagger-ui .json-schema-2020-12-keyword__children--collapsed{display:none}.swagger-ui .json-schema-2020-12-keyword__name{font-size:12px;font-weight:700;margin-left:20px}.swagger-ui .json-schema-2020-12-keyword__name--primary{color:#3b4151;font-style:normal}.swagger-ui .json-schema-2020-12-keyword__name--secondary{color:#6b6b6b;font-style:italic}.swagger-ui .json-schema-2020-12-keyword__value{color:#6b6b6b;font-size:12px;font-style:italic;font-weight:400}.swagger-ui .json-schema-2020-12-keyword__value--primary{color:#3b4151;font-style:normal}.swagger-ui .json-schema-2020-12-keyword__value--secondary{color:#6b6b6b;font-style:italic}.swagger-ui .json-schema-2020-12-keyword__value--const,.swagger-ui .json-schema-2020-12-keyword__value--warning{border:1px dashed #6b6b6b;border-radius:4px;color:#3b4151;color:#6b6b6b;display:inline-block;font-family:monospace;font-style:normal;font-weight:600;line-height:1.5;margin-left:10px;padding:1px 4px}.swagger-ui .json-schema-2020-12-keyword__value--warning{border:1px dashed red;color:red}.swagger-ui .json-schema-2020-12-keyword__name--secondary+.json-schema-2020-12-keyword__value--secondary:before{content:\"=\"}.swagger-ui .json-schema-2020-12__attribute{color:#3b4151;font-family:monospace;font-size:12px;padding-left:10px;text-transform:lowercase}.swagger-ui .json-schema-2020-12__attribute--primary{color:#55a}.swagger-ui .json-schema-2020-12__attribute--muted{color:gray}.swagger-ui .json-schema-2020-12__attribute--warning{color:red}.swagger-ui .json-schema-2020-12-keyword--\\$vocabulary ul{border-left:1px dashed rgba(0,0,0,.1);margin:0 0 0 20px}.swagger-ui .json-schema-2020-12-\\$vocabulary-uri{margin-left:35px}.swagger-ui .json-schema-2020-12-\\$vocabulary-uri--disabled{-webkit-text-decoration:line-through;text-decoration:line-through}.swagger-ui .json-schema-2020-12-keyword--description{color:#6b6b6b;font-size:12px;margin-left:20px}.swagger-ui .json-schema-2020-12-keyword--description p{margin:0}.swagger-ui .json-schema-2020-12__title{color:#505050;display:inline-block;font-family:sans-serif;font-size:12px;font-weight:700;line-height:normal}.swagger-ui .json-schema-2020-12__title .json-schema-2020-12-keyword__name{margin:0}.swagger-ui .json-schema-2020-12-property{margin:7px 0}.swagger-ui .json-schema-2020-12-property .json-schema-2020-12__title{color:#3b4151;font-family:monospace;font-size:12px;font-weight:600;vertical-align:middle}.swagger-ui .json-schema-2020-12-keyword--properties>ul{border:none;margin:0;padding:0}.swagger-ui .json-schema-2020-12-property{list-style-type:none}.swagger-ui .json-schema-2020-12-property--required>.json-schema-2020-12:first-of-type>.json-schema-2020-12-head .json-schema-2020-12__title:after{color:red;content:\"*\";font-weight:700}.swagger-ui .json-schema-2020-12-keyword--patternProperties ul{border:none;margin:0;padding:0}.swagger-ui .json-schema-2020-12-keyword--patternProperties .json-schema-2020-12__title:first-of-type:after,.swagger-ui .json-schema-2020-12-keyword--patternProperties .json-schema-2020-12__title:first-of-type:before{color:#55a;content:\"/\"}.swagger-ui .json-schema-2020-12-keyword--enum>ul{display:inline-block;margin:0;padding:0}.swagger-ui .json-schema-2020-12-keyword--enum>ul li{display:inline;list-style-type:none}.swagger-ui .json-schema-2020-12__constraint{background-color:#805ad5;border-radius:4px;color:#3b4151;color:#fff;font-family:monospace;font-weight:600;line-height:1.5;margin-left:10px;padding:1px 3px}.swagger-ui .json-schema-2020-12__constraint--string{background-color:#d69e2e;color:#fff}.swagger-ui .json-schema-2020-12-keyword--dependentRequired>ul{display:inline-block;margin:0;padding:0}.swagger-ui .json-schema-2020-12-keyword--dependentRequired>ul li{display:inline;list-style-type:none}.swagger-ui .model-box .json-schema-2020-12:not(.json-schema-2020-12--embedded)>.json-schema-2020-12-head .json-schema-2020-12__title:first-of-type{font-size:16px}.swagger-ui .model-box>.json-schema-2020-12{margin:0}.swagger-ui .model-box .json-schema-2020-12{background-color:transparent;padding:0}.swagger-ui .model-box .json-schema-2020-12-accordion,.swagger-ui .model-box .json-schema-2020-12-expand-deep-button{background-color:transparent}.swagger-ui .models .json-schema-2020-12:not(.json-schema-2020-12--embedded)>.json-schema-2020-12-head .json-schema-2020-12__title:first-of-type{font-size:16px}\n\n/*# sourceMappingURL=swagger-ui.css.map*/"
  },
  {
    "path": "src/main/resources/assets/swagger-ui/swagger-ui-dist/swagger-ui.js",
    "content": "!function webpackUniversalModuleDefinition(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.SwaggerUICore=t():e.SwaggerUICore=t()}(this,(()=>(()=>{\"use strict\";var e={158:e=>{e.exports=require(\"buffer\")}},t={};function __webpack_require__(r){var a=t[r];if(void 0!==a)return a.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var r={};return(()=>{__webpack_require__.d(r,{default:()=>To});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{CLEAR:()=>D,CLEAR_BY:()=>K,NEW_AUTH_ERR:()=>V,NEW_SPEC_ERR:()=>J,NEW_SPEC_ERR_BATCH:()=>$,NEW_THROWN_ERR:()=>R,NEW_THROWN_ERR_BATCH:()=>T,clear:()=>clear,clearBy:()=>clearBy,newAuthErr:()=>newAuthErr,newSpecErr:()=>newSpecErr,newSpecErrBatch:()=>newSpecErrBatch,newThrownErr:()=>newThrownErr,newThrownErrBatch:()=>newThrownErrBatch});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{AUTHORIZE:()=>he,AUTHORIZE_OAUTH2:()=>fe,CONFIGURE_AUTH:()=>Ee,LOGOUT:()=>ge,PRE_AUTHORIZE_OAUTH2:()=>ye,RESTORE_AUTHORIZATION:()=>_e,SHOW_AUTH_POPUP:()=>de,VALIDATE:()=>Se,authPopup:()=>authPopup,authorize:()=>authorize,authorizeAccessCodeWithBasicAuthentication:()=>authorizeAccessCodeWithBasicAuthentication,authorizeAccessCodeWithFormParams:()=>authorizeAccessCodeWithFormParams,authorizeApplication:()=>authorizeApplication,authorizeOauth2:()=>authorizeOauth2,authorizeOauth2WithPersistOption:()=>authorizeOauth2WithPersistOption,authorizePassword:()=>authorizePassword,authorizeRequest:()=>authorizeRequest,authorizeWithPersistOption:()=>authorizeWithPersistOption,configureAuth:()=>configureAuth,logout:()=>logout,logoutWithPersistOption:()=>logoutWithPersistOption,persistAuthorizationIfNeeded:()=>persistAuthorizationIfNeeded,preAuthorizeImplicit:()=>preAuthorizeImplicit,restoreAuthorization:()=>restoreAuthorization,showDefinitions:()=>showDefinitions});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{authorized:()=>xe,definitionsForRequirements:()=>definitionsForRequirements,definitionsToAuthorize:()=>Ce,getConfigs:()=>Oe,getDefinitionsByNames:()=>getDefinitionsByNames,isAuthorized:()=>isAuthorized,shownDefinitions:()=>be});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{TOGGLE_CONFIGS:()=>Te,UPDATE_CONFIGS:()=>Re,downloadConfig:()=>downloadConfig,getConfigByUrl:()=>getConfigByUrl,loaded:()=>actions_loaded,toggle:()=>toggle,update:()=>update});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{get:()=>get});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{transform:()=>transform});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{transform:()=>parameter_oneof_transform});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{allErrors:()=>Ye,lastError:()=>Qe});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{SHOW:()=>nt,UPDATE_FILTER:()=>rt,UPDATE_LAYOUT:()=>tt,UPDATE_MODE:()=>at,changeMode:()=>changeMode,show:()=>actions_show,updateFilter:()=>updateFilter,updateLayout:()=>updateLayout});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{current:()=>current,currentFilter:()=>currentFilter,isShown:()=>isShown,showSummary:()=>ot,whatMode:()=>whatMode});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{taggedOperations:()=>taggedOperations});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{requestSnippetGenerator_curl_bash:()=>requestSnippetGenerator_curl_bash,requestSnippetGenerator_curl_cmd:()=>requestSnippetGenerator_curl_cmd,requestSnippetGenerator_curl_powershell:()=>requestSnippetGenerator_curl_powershell});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{getActiveLanguage:()=>it,getDefaultExpanded:()=>pt,getGenerators:()=>ct,getSnippetGenerators:()=>getSnippetGenerators});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{JsonSchemaArrayItemFile:()=>JsonSchemaArrayItemFile,JsonSchemaArrayItemText:()=>JsonSchemaArrayItemText,JsonSchemaForm:()=>JsonSchemaForm,JsonSchema_array:()=>JsonSchema_array,JsonSchema_boolean:()=>JsonSchema_boolean,JsonSchema_object:()=>JsonSchema_object,JsonSchema_string:()=>JsonSchema_string});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{allowTryItOutFor:()=>allowTryItOutFor,basePath:()=>cr,canExecuteScheme:()=>canExecuteScheme,consumes:()=>ar,consumesOptionsFor:()=>consumesOptionsFor,contentTypeValues:()=>contentTypeValues,currentProducesFor:()=>currentProducesFor,definitions:()=>lr,externalDocs:()=>Yt,findDefinition:()=>findDefinition,getOAS3RequiredRequestBodyContentType:()=>getOAS3RequiredRequestBodyContentType,getParameter:()=>getParameter,hasHost:()=>fr,host:()=>ir,info:()=>Gt,isMediaTypeSchemaPropertiesEqual:()=>isMediaTypeSchemaPropertiesEqual,isOAS3:()=>Xt,lastError:()=>Kt,mutatedRequestFor:()=>mutatedRequestFor,mutatedRequests:()=>yr,operationScheme:()=>operationScheme,operationWithMeta:()=>operationWithMeta,operations:()=>rr,operationsWithRootInherited:()=>mr,operationsWithTags:()=>dr,parameterInclusionSettingFor:()=>parameterInclusionSettingFor,parameterValues:()=>parameterValues,parameterWithMeta:()=>parameterWithMeta,parameterWithMetaByIdentity:()=>parameterWithMetaByIdentity,parametersIncludeIn:()=>parametersIncludeIn,parametersIncludeType:()=>parametersIncludeType,paths:()=>er,produces:()=>nr,producesOptionsFor:()=>producesOptionsFor,requestFor:()=>requestFor,requests:()=>gr,responseFor:()=>responseFor,responses:()=>hr,schemes:()=>pr,security:()=>sr,securityDefinitions:()=>or,semver:()=>Zt,spec:()=>spec,specJS:()=>Ft,specJson:()=>Bt,specJsonWithResolvedSubtrees:()=>Ht,specResolved:()=>Wt,specResolvedSubtree:()=>specResolvedSubtree,specSource:()=>zt,specStr:()=>Ut,tagDetails:()=>tagDetails,taggedOperations:()=>selectors_taggedOperations,tags:()=>ur,url:()=>Lt,validOperationMethods:()=>tr,validateBeforeExecute:()=>validateBeforeExecute,validationErrors:()=>validationErrors,version:()=>Qt});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{CLEAR_REQUEST:()=>Jr,CLEAR_RESPONSE:()=>Tr,CLEAR_VALIDATE_PARAMS:()=>$r,LOG_REQUEST:()=>Rr,SET_MUTATED_REQUEST:()=>Mr,SET_REQUEST:()=>Pr,SET_RESPONSE:()=>jr,SET_SCHEME:()=>Lr,UPDATE_EMPTY_PARAM_INCLUSION:()=>Ir,UPDATE_JSON:()=>kr,UPDATE_OPERATION_META_VALUE:()=>Vr,UPDATE_PARAM:()=>Ar,UPDATE_RESOLVED:()=>Dr,UPDATE_RESOLVED_SUBTREE:()=>Kr,UPDATE_SPEC:()=>Or,UPDATE_URL:()=>Nr,VALIDATE_PARAMS:()=>qr,changeConsumesValue:()=>changeConsumesValue,changeParam:()=>changeParam,changeParamByIdentity:()=>changeParamByIdentity,changeProducesValue:()=>changeProducesValue,clearRequest:()=>clearRequest,clearResponse:()=>clearResponse,clearValidateParams:()=>clearValidateParams,execute:()=>actions_execute,executeRequest:()=>executeRequest,invalidateResolvedSubtreeCache:()=>invalidateResolvedSubtreeCache,logRequest:()=>logRequest,parseToJson:()=>parseToJson,requestResolvedSubtree:()=>requestResolvedSubtree,resolveSpec:()=>resolveSpec,setMutatedRequest:()=>setMutatedRequest,setRequest:()=>setRequest,setResponse:()=>setResponse,setScheme:()=>setScheme,updateEmptyParamInclusion:()=>updateEmptyParamInclusion,updateJsonSpec:()=>updateJsonSpec,updateResolved:()=>updateResolved,updateResolvedSubtree:()=>updateResolvedSubtree,updateSpec:()=>updateSpec,updateUrl:()=>updateUrl,validateParams:()=>validateParams});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{executeRequest:()=>wrap_actions_executeRequest,updateJsonSpec:()=>wrap_actions_updateJsonSpec,updateSpec:()=>wrap_actions_updateSpec,validateParams:()=>wrap_actions_validateParams});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{Button:()=>Button,Col:()=>Col,Collapse:()=>Collapse,Container:()=>Container,Input:()=>Input,Link:()=>Link,Row:()=>Row,Select:()=>Select,TextArea:()=>TextArea});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{basePath:()=>wn,consumes:()=>bn,definitions:()=>Sn,findDefinition:()=>fn,hasHost:()=>En,host:()=>vn,produces:()=>Cn,schemes:()=>xn,securityDefinitions:()=>_n,validOperationMethods:()=>wrap_selectors_validOperationMethods});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{definitionsToAuthorize:()=>On});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{callbacksOperations:()=>An,findSchema:()=>findSchema,isOAS3:()=>selectors_isOAS3,isOAS30:()=>selectors_isOAS30,isSwagger2:()=>selectors_isSwagger2,servers:()=>kn});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{CLEAR_REQUEST_BODY_VALIDATE_ERROR:()=>Xn,CLEAR_REQUEST_BODY_VALUE:()=>Gn,SET_REQUEST_BODY_VALIDATE_ERROR:()=>Hn,UPDATE_ACTIVE_EXAMPLES_MEMBER:()=>zn,UPDATE_REQUEST_BODY_INCLUSION:()=>Un,UPDATE_REQUEST_BODY_VALUE:()=>Kn,UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG:()=>Ln,UPDATE_REQUEST_CONTENT_TYPE:()=>Bn,UPDATE_RESPONSE_CONTENT_TYPE:()=>Fn,UPDATE_SELECTED_SERVER:()=>Dn,UPDATE_SERVER_VARIABLE_VALUE:()=>Wn,clearRequestBodyValidateError:()=>clearRequestBodyValidateError,clearRequestBodyValue:()=>clearRequestBodyValue,initRequestBodyValidateError:()=>initRequestBodyValidateError,setActiveExamplesMember:()=>setActiveExamplesMember,setRequestBodyInclusion:()=>setRequestBodyInclusion,setRequestBodyValidateError:()=>setRequestBodyValidateError,setRequestBodyValue:()=>setRequestBodyValue,setRequestContentType:()=>setRequestContentType,setResponseContentType:()=>setResponseContentType,setRetainRequestBodyValueFlag:()=>setRetainRequestBodyValueFlag,setSelectedServer:()=>setSelectedServer,setServerVariableValue:()=>setServerVariableValue});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{activeExamplesMember:()=>ss,hasUserEditedBody:()=>rs,requestBodyErrors:()=>ns,requestBodyInclusionSetting:()=>as,requestBodyValue:()=>es,requestContentType:()=>os,responseContentType:()=>ls,selectDefaultRequestBodyValue:()=>selectDefaultRequestBodyValue,selectedServer:()=>Zn,serverEffectiveValue:()=>ps,serverVariableValue:()=>cs,serverVariables:()=>is,shouldRetainRequestBodyValue:()=>ts,validOperationMethods:()=>us,validateBeforeExecute:()=>ms,validateShallowRequired:()=>validateShallowRequired});const C=require(\"react\");var x=__webpack_require__.n(C);const O=require(\"redux\"),N=require(\"immutable\");var k=__webpack_require__.n(N);const A=require(\"deep-extend\");var I=__webpack_require__.n(A);const q=require(\"redux-immutable\"),j=require(\"serialize-error\"),P=require(\"lodash/merge\");var M=__webpack_require__.n(P);const R=\"err_new_thrown_err\",T=\"err_new_thrown_err_batch\",J=\"err_new_spec_err\",$=\"err_new_spec_err_batch\",V=\"err_new_auth_err\",D=\"err_clear\",K=\"err_clear_by\";function newThrownErr(e){return{type:R,payload:(0,j.serializeError)(e)}}function newThrownErrBatch(e){return{type:T,payload:e}}function newSpecErr(e){return{type:J,payload:e}}function newSpecErrBatch(e){return{type:$,payload:e}}function newAuthErr(e){return{type:V,payload:e}}function clear(e={}){return{type:D,payload:e}}function clearBy(e=(()=>!0)){return{type:K,payload:e}}const L=function makeWindow(){var e={location:{},history:{},open:()=>{},close:()=>{},File:function(){},FormData:function(){}};if(\"undefined\"==typeof window)return e;try{e=window;for(var t of[\"File\",\"Blob\",\"FormData\"])t in window&&(e[t]=window[t])}catch(e){console.error(e)}return e}(),U=require(\"@braintree/sanitize-url\"),z=(require(\"lodash/camelCase\"),require(\"lodash/upperFirst\"),require(\"lodash/memoize\"));var B=__webpack_require__.n(z);const F=require(\"lodash/find\");var W=__webpack_require__.n(F);const H=require(\"lodash/some\");var X=__webpack_require__.n(H);const G=require(\"lodash/eq\");var Y=__webpack_require__.n(G);const Q=require(\"lodash/isFunction\");var Z=__webpack_require__.n(Q);const ee=require(\"css.escape\");var te=__webpack_require__.n(ee);const re=require(\"randombytes\");var ae=__webpack_require__.n(re);const ne=require(\"sha.js\");var se=__webpack_require__.n(ne);const oe=k().Set.of(\"type\",\"format\",\"items\",\"default\",\"maximum\",\"exclusiveMaximum\",\"minimum\",\"exclusiveMinimum\",\"maxLength\",\"minLength\",\"pattern\",\"maxItems\",\"minItems\",\"uniqueItems\",\"enum\",\"multipleOf\");function getParameterSchema(e,{isOAS3:t}={}){if(!k().Map.isMap(e))return{schema:k().Map(),parameterContentMediaType:null};if(!t)return\"body\"===e.get(\"in\")?{schema:e.get(\"schema\",k().Map()),parameterContentMediaType:null}:{schema:e.filter(((e,t)=>oe.includes(t))),parameterContentMediaType:null};if(e.get(\"content\")){const t=e.get(\"content\",k().Map({})).keySeq().first();return{schema:e.getIn([\"content\",t,\"schema\"],k().Map()),parameterContentMediaType:t}}return{schema:e.get(\"schema\")?e.get(\"schema\",k().Map()):k().Map(),parameterContentMediaType:null}}var le=__webpack_require__(158).Buffer;const ce=\"default\",isImmutable=e=>k().Iterable.isIterable(e);function objectify(e){return isObject(e)?isImmutable(e)?e.toJS():e:{}}function fromJSOrdered(e){if(isImmutable(e))return e;if(e instanceof L.File)return e;if(!isObject(e))return e;if(Array.isArray(e))return k().Seq(e).map(fromJSOrdered).toList();if(Z()(e.entries)){const t=function createObjWithHashedKeys(e){if(!Z()(e.entries))return e;const t={},r=\"_**[]\",a={};for(let n of e.entries())if(t[n[0]]||a[n[0]]&&a[n[0]].containsMultiple){if(!a[n[0]]){a[n[0]]={containsMultiple:!0,length:1},t[`${n[0]}${r}${a[n[0]].length}`]=t[n[0]],delete t[n[0]]}a[n[0]].length+=1,t[`${n[0]}${r}${a[n[0]].length}`]=n[1]}else t[n[0]]=n[1];return t}(e);return k().OrderedMap(t).map(fromJSOrdered)}return k().OrderedMap(e).map(fromJSOrdered)}function normalizeArray(e){return Array.isArray(e)?e:[e]}function isFn(e){return\"function\"==typeof e}function isObject(e){return!!e&&\"object\"==typeof e}function isFunc(e){return\"function\"==typeof e}function isArray(e){return Array.isArray(e)}const ie=B();function objMap(e,t){return Object.keys(e).reduce(((r,a)=>(r[a]=t(e[a],a),r)),{})}function objReduce(e,t){return Object.keys(e).reduce(((r,a)=>{let n=t(e[a],a);return n&&\"object\"==typeof n&&Object.assign(r,n),r}),{})}function systemThunkMiddleware(e){return({dispatch:t,getState:r})=>t=>r=>\"function\"==typeof r?r(e()):t(r)}function validateValueBySchema(e,t,r,a,n){if(!t)return[];let s=[],o=t.get(\"nullable\"),l=t.get(\"required\"),c=t.get(\"maximum\"),i=t.get(\"minimum\"),p=t.get(\"type\"),m=t.get(\"format\"),u=t.get(\"maxLength\"),d=t.get(\"minLength\"),h=t.get(\"uniqueItems\"),g=t.get(\"maxItems\"),y=t.get(\"minItems\"),f=t.get(\"pattern\");const S=r||!0===l,E=null!=e,_=S||E&&\"array\"===p||!(!S&&!E),v=o&&null===e;if(S&&!E&&!v&&!a&&!p)return s.push(\"Required field is not provided\"),s;if(v||!p||!_)return[];let w=\"string\"===p&&e,b=\"array\"===p&&Array.isArray(e)&&e.length,C=\"array\"===p&&k().List.isList(e)&&e.count();const x=[w,b,C,\"array\"===p&&\"string\"==typeof e&&e,\"file\"===p&&e instanceof L.File,\"boolean\"===p&&(e||!1===e),\"number\"===p&&(e||0===e),\"integer\"===p&&(e||0===e),\"object\"===p&&\"object\"==typeof e&&null!==e,\"object\"===p&&\"string\"==typeof e&&e].some((e=>!!e));if(S&&!x&&!a)return s.push(\"Required field is not provided\"),s;if(\"object\"===p&&(null===n||\"application/json\"===n)){let r=e;if(\"string\"==typeof e)try{r=JSON.parse(e)}catch(e){return s.push(\"Parameter string value must be valid JSON\"),s}t&&t.has(\"required\")&&isFunc(l.isList)&&l.isList()&&l.forEach((e=>{void 0===r[e]&&s.push({propKey:e,error:\"Required property not found\"})})),t&&t.has(\"properties\")&&t.get(\"properties\").forEach(((e,t)=>{const o=validateValueBySchema(r[t],e,!1,a,n);s.push(...o.map((e=>({propKey:t,error:e}))))}))}if(f){let t=((e,t)=>{if(!new RegExp(t).test(e))return\"Value must follow pattern \"+t})(e,f);t&&s.push(t)}if(y&&\"array\"===p){let t=((e,t)=>{if(!e&&t>=1||e&&e.length<t)return`Array must contain at least ${t} item${1===t?\"\":\"s\"}`})(e,y);t&&s.push(t)}if(g&&\"array\"===p){let t=((e,t)=>{if(e&&e.length>t)return`Array must not contain more then ${t} item${1===t?\"\":\"s\"}`})(e,g);t&&s.push({needRemove:!0,error:t})}if(h&&\"array\"===p){let t=((e,t)=>{if(e&&(\"true\"===t||!0===t)){const t=(0,N.fromJS)(e),r=t.toSet();if(e.length>r.size){let e=(0,N.Set)();if(t.forEach(((r,a)=>{t.filter((e=>isFunc(e.equals)?e.equals(r):e===r)).size>1&&(e=e.add(a))})),0!==e.size)return e.map((e=>({index:e,error:\"No duplicates allowed.\"}))).toArray()}}})(e,h);t&&s.push(...t)}if(u||0===u){let t=((e,t)=>{if(e.length>t)return`Value must be no longer than ${t} character${1!==t?\"s\":\"\"}`})(e,u);t&&s.push(t)}if(d){let t=((e,t)=>{if(e.length<t)return`Value must be at least ${t} character${1!==t?\"s\":\"\"}`})(e,d);t&&s.push(t)}if(c||0===c){let t=((e,t)=>{if(e>t)return`Value must be less than ${t}`})(e,c);t&&s.push(t)}if(i||0===i){let t=((e,t)=>{if(e<t)return`Value must be greater than ${t}`})(e,i);t&&s.push(t)}if(\"string\"===p){let t;if(t=\"date-time\"===m?(e=>{if(isNaN(Date.parse(e)))return\"Value must be a DateTime\"})(e):\"uuid\"===m?(e=>{if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(e))return\"Value must be a Guid\"})(e):(e=>{if(e&&\"string\"!=typeof e)return\"Value must be a string\"})(e),!t)return s;s.push(t)}else if(\"boolean\"===p){let t=(e=>{if(\"true\"!==e&&\"false\"!==e&&!0!==e&&!1!==e)return\"Value must be a boolean\"})(e);if(!t)return s;s.push(t)}else if(\"number\"===p){let t=(e=>{if(!/^-?\\d+(\\.?\\d+)?$/.test(e))return\"Value must be a number\"})(e);if(!t)return s;s.push(t)}else if(\"integer\"===p){let t=(e=>{if(!/^-?\\d+$/.test(e))return\"Value must be an integer\"})(e);if(!t)return s;s.push(t)}else if(\"array\"===p){if(!b&&!C)return s;e&&e.forEach(((e,r)=>{const o=validateValueBySchema(e,t.get(\"items\"),!1,a,n);s.push(...o.map((e=>({index:r,error:e}))))}))}else if(\"file\"===p){let t=(e=>{if(e&&!(e instanceof L.File))return\"Value must be a file\"})(e);if(!t)return s;s.push(t)}return s}const btoa=e=>{let t;return t=e instanceof le?e:le.from(e.toString(),\"utf-8\"),t.toString(\"base64\")},pe={operationsSorter:{alpha:(e,t)=>e.get(\"path\").localeCompare(t.get(\"path\")),method:(e,t)=>e.get(\"method\").localeCompare(t.get(\"method\"))},tagsSorter:{alpha:(e,t)=>e.localeCompare(t)}},buildFormData=e=>{let t=[];for(let r in e){let a=e[r];void 0!==a&&\"\"!==a&&t.push([r,\"=\",encodeURIComponent(a).replace(/%20/g,\"+\")].join(\"\"))}return t.join(\"&\")},shallowEqualKeys=(e,t,r)=>!!W()(r,(r=>Y()(e[r],t[r])));function sanitizeUrl(e){return\"string\"!=typeof e||\"\"===e?\"\":(0,U.sanitizeUrl)(e)}function requiresValidationURL(e){return!(!e||e.indexOf(\"localhost\")>=0||e.indexOf(\"127.0.0.1\")>=0||\"none\"===e)}const createDeepLinkPath=e=>\"string\"==typeof e||e instanceof String?e.trim().replace(/\\s/g,\"%20\"):\"\",escapeDeepLinkPath=e=>te()(createDeepLinkPath(e).replace(/%20/g,\"_\")),getExtensions=e=>e.filter(((e,t)=>/^x-/.test(t))),getCommonExtensions=e=>e.filter(((e,t)=>/^pattern|maxLength|minLength|maximum|minimum/.test(t)));function deeplyStripKey(e,t,r=(()=>!0)){if(\"object\"!=typeof e||Array.isArray(e)||null===e||!t)return e;const a=Object.assign({},e);return Object.keys(a).forEach((e=>{e===t&&r(a[e],e)?delete a[e]:a[e]=deeplyStripKey(a[e],t,r)})),a}function stringify(e){if(\"string\"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS()),\"object\"==typeof e&&null!==e)try{return JSON.stringify(e,null,2)}catch(t){return String(e)}return null==e?\"\":e.toString()}function paramToIdentifier(e,{returnAll:t=!1,allowHashes:r=!0}={}){if(!k().Map.isMap(e))throw new Error(\"paramToIdentifier: received a non-Im.Map parameter as input\");const a=e.get(\"name\"),n=e.get(\"in\");let s=[];return e&&e.hashCode&&n&&a&&r&&s.push(`${n}.${a}.hash-${e.hashCode()}`),n&&a&&s.push(`${n}.${a}`),s.push(a),t?s:s[0]||\"\"}function paramToValue(e,t){return paramToIdentifier(e,{returnAll:!0}).map((e=>t[e])).filter((e=>void 0!==e))[0]}function b64toB64UrlEncoded(e){return e.replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=/g,\"\")}const isEmptyValue=e=>!e||!(!isImmutable(e)||!e.isEmpty()),idFn=e=>e;class Store{constructor(e={}){I()(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},e),this.getSystem=this._getSystem.bind(this),this.store=function configureStore(e,t,r){return function createStoreWithMiddleware(e,t,r){let a=[systemThunkMiddleware(r)];const n=L.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||O.compose;return(0,O.createStore)(e,t,n((0,O.applyMiddleware)(...a)))}(e,t,r)}(idFn,(0,N.fromJS)(this.state),this.getSystem),this.buildSystem(!1),this.register(this.plugins)}getStore(){return this.store}register(e,t=!0){var r=combinePlugins(e,this.getSystem());systemExtend(this.system,r),t&&this.buildSystem();callAfterLoad.call(this.system,e,this.getSystem())&&this.buildSystem()}buildSystem(e=!0){let t=this.getStore().dispatch,r=this.getStore().getState;this.boundSystem=Object.assign({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(r,this.getSystem),this.getStateThunks(r),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}_getSystem(){return this.boundSystem}getRootInjects(){return Object.assign({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:k(),React:x()},this.system.rootInjects||{})}_getConfigs(){return this.system.configs}getConfigs(){return{configs:this.system.configs}}setConfigs(e){this.system.configs=e}rebuildReducer(){this.store.replaceReducer(function buildReducer(e){return function allReducers(e){let t=Object.keys(e).reduce(((t,r)=>(t[r]=function makeReducer(e){return(t=new N.Map,r)=>{if(!e)return t;let a=e[r.type];if(a){const e=wrapWithTryCatch(a)(t,r);return null===e?t:e}return t}}(e[r]),t)),{});if(!Object.keys(t).length)return idFn;return(0,q.combineReducers)(t)}(objMap(e,(e=>e.reducers)))}(this.system.statePlugins))}getType(e){let t=e[0].toUpperCase()+e.slice(1);return objReduce(this.system.statePlugins,((r,a)=>{let n=r[e];if(n)return{[a+t]:n}}))}getSelectors(){return this.getType(\"selectors\")}getActions(){return objMap(this.getType(\"actions\"),(e=>objReduce(e,((e,t)=>{if(isFn(e))return{[t]:e}}))))}getWrappedAndBoundActions(e){return objMap(this.getBoundActions(e),((e,t)=>{let r=this.system.statePlugins[t.slice(0,-7)].wrapActions;return r?objMap(e,((e,t)=>{let a=r[t];return a?(Array.isArray(a)||(a=[a]),a.reduce(((e,t)=>{let newAction=(...r)=>t(e,this.getSystem())(...r);if(!isFn(newAction))throw new TypeError(\"wrapActions needs to return a function that returns a new function (ie the wrapped action)\");return wrapWithTryCatch(newAction)}),e||Function.prototype)):e})):e}))}getWrappedAndBoundSelectors(e,t){return objMap(this.getBoundSelectors(e,t),((t,r)=>{let a=[r.slice(0,-9)],n=this.system.statePlugins[a].wrapSelectors;return n?objMap(t,((t,r)=>{let s=n[r];return s?(Array.isArray(s)||(s=[s]),s.reduce(((t,r)=>{let wrappedSelector=(...n)=>r(t,this.getSystem())(e().getIn(a),...n);if(!isFn(wrappedSelector))throw new TypeError(\"wrapSelector needs to return a function that returns a new function (ie the wrapped action)\");return wrappedSelector}),t||Function.prototype)):t})):t}))}getStates(e){return Object.keys(this.system.statePlugins).reduce(((t,r)=>(t[r]=e.get(r),t)),{})}getStateThunks(e){return Object.keys(this.system.statePlugins).reduce(((t,r)=>(t[r]=()=>e().get(r),t)),{})}getFn(){return{fn:this.system.fn}}getComponents(e){const t=this.system.components[e];return Array.isArray(t)?t.reduce(((e,t)=>t(e,this.getSystem()))):void 0!==e?this.system.components[e]:this.system.components}getBoundSelectors(e,t){return objMap(this.getSelectors(),((r,a)=>{let n=[a.slice(0,-9)];return objMap(r,(r=>(...a)=>{let s=wrapWithTryCatch(r).apply(null,[e().getIn(n),...a]);return\"function\"==typeof s&&(s=wrapWithTryCatch(s)(t())),s}))}))}getBoundActions(e){e=e||this.getStore().dispatch;const t=this.getActions(),process=e=>\"function\"!=typeof e?objMap(e,(e=>process(e))):(...t)=>{var r=null;try{r=e(...t)}catch(e){r={type:R,error:!0,payload:(0,j.serializeError)(e)}}finally{return r}};return objMap(t,(t=>(0,O.bindActionCreators)(process(t),e)))}getMapStateToProps(){return()=>Object.assign({},this.getSystem())}getMapDispatchToProps(e){return t=>I()({},this.getWrappedAndBoundActions(t),this.getFn(),e)}}function combinePlugins(e,t){return isObject(e)&&!isArray(e)?M()({},e):isFunc(e)?combinePlugins(e(t),t):isArray(e)?e.map((e=>combinePlugins(e,t))).reduce(systemExtend,{components:t.getComponents()}):{}}function callAfterLoad(e,t,{hasLoaded:r}={}){let a=r;return isObject(e)&&!isArray(e)&&\"function\"==typeof e.afterLoad&&(a=!0,wrapWithTryCatch(e.afterLoad).call(this,t)),isFunc(e)?callAfterLoad.call(this,e(t),t,{hasLoaded:a}):isArray(e)?e.map((e=>callAfterLoad.call(this,e,t,{hasLoaded:a}))):a}function systemExtend(e={},t={}){if(!isObject(e))return{};if(!isObject(t))return e;t.wrapComponents&&(objMap(t.wrapComponents,((r,a)=>{const n=e.components&&e.components[a];n&&Array.isArray(n)?(e.components[a]=n.concat([r]),delete t.wrapComponents[a]):n&&(e.components[a]=[n,r],delete t.wrapComponents[a])})),Object.keys(t.wrapComponents).length||delete t.wrapComponents);const{statePlugins:r}=e;if(isObject(r))for(let e in r){const a=r[e];if(!isObject(a))continue;const{wrapActions:n,wrapSelectors:s}=a;if(isObject(n))for(let r in n){let a=n[r];Array.isArray(a)||(a=[a],n[r]=a),t&&t.statePlugins&&t.statePlugins[e]&&t.statePlugins[e].wrapActions&&t.statePlugins[e].wrapActions[r]&&(t.statePlugins[e].wrapActions[r]=n[r].concat(t.statePlugins[e].wrapActions[r]))}if(isObject(s))for(let r in s){let a=s[r];Array.isArray(a)||(a=[a],s[r]=a),t&&t.statePlugins&&t.statePlugins[e]&&t.statePlugins[e].wrapSelectors&&t.statePlugins[e].wrapSelectors[r]&&(t.statePlugins[e].wrapSelectors[r]=s[r].concat(t.statePlugins[e].wrapSelectors[r]))}}return I()(e,t)}function wrapWithTryCatch(e,{logErrors:t=!0}={}){return\"function\"!=typeof e?e:function(...r){try{return e.call(this,...r)}catch(e){return t&&console.error(e),null}}}const me=require(\"url-parse\");var ue=__webpack_require__.n(me);const de=\"show_popup\",he=\"authorize\",ge=\"logout\",ye=\"pre_authorize_oauth2\",fe=\"authorize_oauth2\",Se=\"validate\",Ee=\"configure_auth\",_e=\"restore_authorization\";function showDefinitions(e){return{type:de,payload:e}}function authorize(e){return{type:he,payload:e}}const authorizeWithPersistOption=e=>({authActions:t})=>{t.authorize(e),t.persistAuthorizationIfNeeded()};function logout(e){return{type:ge,payload:e}}const logoutWithPersistOption=e=>({authActions:t})=>{t.logout(e),t.persistAuthorizationIfNeeded()},preAuthorizeImplicit=e=>({authActions:t,errActions:r})=>{let{auth:a,token:n,isValid:s}=e,{schema:o,name:l}=a,c=o.get(\"flow\");delete L.swaggerUIRedirectOauth2,\"accessCode\"===c||s||r.newAuthErr({authId:l,source:\"auth\",level:\"warning\",message:\"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server\"}),n.error?r.newAuthErr({authId:l,source:\"auth\",level:\"error\",message:JSON.stringify(n)}):t.authorizeOauth2WithPersistOption({auth:a,token:n})};function authorizeOauth2(e){return{type:fe,payload:e}}const authorizeOauth2WithPersistOption=e=>({authActions:t})=>{t.authorizeOauth2(e),t.persistAuthorizationIfNeeded()},authorizePassword=e=>({authActions:t})=>{let{schema:r,name:a,username:n,password:s,passwordType:o,clientId:l,clientSecret:c}=e,i={grant_type:\"password\",scope:e.scopes.join(\" \"),username:n,password:s},p={};switch(o){case\"request-body\":!function setClientIdAndSecret(e,t,r){t&&Object.assign(e,{client_id:t});r&&Object.assign(e,{client_secret:r})}(i,l,c);break;case\"basic\":p.Authorization=\"Basic \"+btoa(l+\":\"+c);break;default:console.warn(`Warning: invalid passwordType ${o} was passed, not including client id and secret`)}return t.authorizeRequest({body:buildFormData(i),url:r.get(\"tokenUrl\"),name:a,headers:p,query:{},auth:e})};const authorizeApplication=e=>({authActions:t})=>{let{schema:r,scopes:a,name:n,clientId:s,clientSecret:o}=e,l={Authorization:\"Basic \"+btoa(s+\":\"+o)},c={grant_type:\"client_credentials\",scope:a.join(\" \")};return t.authorizeRequest({body:buildFormData(c),name:n,url:r.get(\"tokenUrl\"),auth:e,headers:l})},authorizeAccessCodeWithFormParams=({auth:e,redirectUrl:t})=>({authActions:r})=>{let{schema:a,name:n,clientId:s,clientSecret:o,codeVerifier:l}=e,c={grant_type:\"authorization_code\",code:e.code,client_id:s,client_secret:o,redirect_uri:t,code_verifier:l};return r.authorizeRequest({body:buildFormData(c),name:n,url:a.get(\"tokenUrl\"),auth:e})},authorizeAccessCodeWithBasicAuthentication=({auth:e,redirectUrl:t})=>({authActions:r})=>{let{schema:a,name:n,clientId:s,clientSecret:o,codeVerifier:l}=e,c={Authorization:\"Basic \"+btoa(s+\":\"+o)},i={grant_type:\"authorization_code\",code:e.code,client_id:s,redirect_uri:t,code_verifier:l};return r.authorizeRequest({body:buildFormData(i),name:n,url:a.get(\"tokenUrl\"),auth:e,headers:c})},authorizeRequest=e=>({fn:t,getConfigs:r,authActions:a,errActions:n,oas3Selectors:s,specSelectors:o,authSelectors:l})=>{let c,{body:i,query:p={},headers:m={},name:u,url:d,auth:h}=e,{additionalQueryStringParams:g}=l.getConfigs()||{};if(o.isOAS3()){let e=s.serverEffectiveValue(s.selectedServer());c=ue()(d,e,!0)}else c=ue()(d,o.url(),!0);\"object\"==typeof g&&(c.query=Object.assign({},c.query,g));const y=c.toString();let f=Object.assign({Accept:\"application/json, text/plain, */*\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"X-Requested-With\":\"XMLHttpRequest\"},m);t.fetch({url:y,method:\"post\",headers:f,query:p,body:i,requestInterceptor:r().requestInterceptor,responseInterceptor:r().responseInterceptor}).then((function(e){let t=JSON.parse(e.data),r=t&&(t.error||\"\"),s=t&&(t.parseError||\"\");e.ok?r||s?n.newAuthErr({authId:u,level:\"error\",source:\"auth\",message:JSON.stringify(t)}):a.authorizeOauth2WithPersistOption({auth:h,token:t}):n.newAuthErr({authId:u,level:\"error\",source:\"auth\",message:e.statusText})})).catch((e=>{let t=new Error(e).message;if(e.response&&e.response.data){const r=e.response.data;try{const e=\"string\"==typeof r?JSON.parse(r):r;e.error&&(t+=`, error: ${e.error}`),e.error_description&&(t+=`, description: ${e.error_description}`)}catch(e){}}n.newAuthErr({authId:u,level:\"error\",source:\"auth\",message:t})}))};function configureAuth(e){return{type:Ee,payload:e}}function restoreAuthorization(e){return{type:_e,payload:e}}const persistAuthorizationIfNeeded=()=>({authSelectors:e,getConfigs:t})=>{if(!t().persistAuthorization)return;const r=e.authorized().toJS();localStorage.setItem(\"authorized\",JSON.stringify(r))},authPopup=(e,t)=>()=>{L.swaggerUIRedirectOauth2=t,L.open(e)},ve={[de]:(e,{payload:t})=>e.set(\"showDefinitions\",t),[he]:(e,{payload:t})=>{let r=(0,N.fromJS)(t),a=e.get(\"authorized\")||(0,N.Map)();return r.entrySeq().forEach((([t,r])=>{if(!isFunc(r.getIn))return e.set(\"authorized\",a);let n=r.getIn([\"schema\",\"type\"]);if(\"apiKey\"===n||\"http\"===n)a=a.set(t,r);else if(\"basic\"===n){let e=r.getIn([\"value\",\"username\"]),n=r.getIn([\"value\",\"password\"]);a=a.setIn([t,\"value\"],{username:e,header:\"Basic \"+btoa(e+\":\"+n)}),a=a.setIn([t,\"schema\"],r.get(\"schema\"))}})),e.set(\"authorized\",a)},[fe]:(e,{payload:t})=>{let r,{auth:a,token:n}=t;a.token=Object.assign({},n),r=(0,N.fromJS)(a);let s=e.get(\"authorized\")||(0,N.Map)();return s=s.set(r.get(\"name\"),r),e.set(\"authorized\",s)},[ge]:(e,{payload:t})=>{let r=e.get(\"authorized\").withMutations((e=>{t.forEach((t=>{e.delete(t)}))}));return e.set(\"authorized\",r)},[Ee]:(e,{payload:t})=>e.set(\"configs\",t),[_e]:(e,{payload:t})=>e.set(\"authorized\",(0,N.fromJS)(t.authorized))},we=require(\"reselect\"),state=e=>e,be=(0,we.createSelector)(state,(e=>e.get(\"showDefinitions\"))),Ce=(0,we.createSelector)(state,(()=>({specSelectors:e})=>{let t=e.securityDefinitions()||(0,N.Map)({}),r=(0,N.List)();return t.entrySeq().forEach((([e,t])=>{let a=(0,N.Map)();a=a.set(e,t),r=r.push(a)})),r})),getDefinitionsByNames=(e,t)=>({specSelectors:e})=>{console.warn(\"WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.\");let r=e.securityDefinitions(),a=(0,N.List)();return t.valueSeq().forEach((e=>{let t=(0,N.Map)();e.entrySeq().forEach((([e,a])=>{let n,s=r.get(e);\"oauth2\"===s.get(\"type\")&&a.size&&(n=s.get(\"scopes\"),n.keySeq().forEach((e=>{a.contains(e)||(n=n.delete(e))})),s=s.set(\"allowedScopes\",n)),t=t.set(e,s)})),a=a.push(t)})),a},definitionsForRequirements=(e,t=(0,N.List)())=>({authSelectors:e})=>{const r=e.definitionsToAuthorize()||(0,N.List)();let a=(0,N.List)();return r.forEach((e=>{let r=t.find((t=>t.get(e.keySeq().first())));r&&(e.forEach(((t,a)=>{if(\"oauth2\"===t.get(\"type\")){const n=r.get(a);let s=t.get(\"scopes\");N.List.isList(n)&&N.Map.isMap(s)&&(s.keySeq().forEach((e=>{n.contains(e)||(s=s.delete(e))})),e=e.set(a,t.set(\"scopes\",s)))}})),a=a.push(e))})),a},xe=(0,we.createSelector)(state,(e=>e.get(\"authorized\")||(0,N.Map)())),isAuthorized=(e,t)=>({authSelectors:e})=>{let r=e.authorized();return N.List.isList(t)?!!t.toJS().filter((e=>-1===Object.keys(e).map((e=>!!r.get(e))).indexOf(!1))).length:null},Oe=(0,we.createSelector)(state,(e=>e.get(\"configs\"))),execute=(e,{authSelectors:t,specSelectors:r})=>({path:a,method:n,operation:s,extras:o})=>{let l={authorized:t.authorized()&&t.authorized().toJS(),definitions:r.securityDefinitions()&&r.securityDefinitions().toJS(),specSecurity:r.security()&&r.security().toJS()};return e({path:a,method:n,operation:s,securities:l,...o})},loaded=(e,t)=>r=>{const{getConfigs:a,authActions:n}=t,s=a();if(e(r),s.persistAuthorization){const e=localStorage.getItem(\"authorized\");e&&n.restoreAuthorization({authorized:JSON.parse(e)})}},wrap_actions_authorize=(e,t)=>r=>{e(r);if(t.getConfigs().persistAuthorization)try{const[{schema:e,value:t}]=Object.values(r),a=\"apiKey\"===e.get(\"type\"),n=\"cookie\"===e.get(\"in\");a&&n&&(document.cookie=`${e.get(\"name\")}=${t}; SameSite=None; Secure`)}catch(e){console.error(\"Error persisting cookie based apiKey in document.cookie.\",e)}},wrap_actions_logout=(e,t)=>r=>{const a=t.getConfigs(),n=t.authSelectors.authorized();try{a.persistAuthorization&&Array.isArray(r)&&r.forEach((e=>{const t=n.get(e,{}),r=\"apiKey\"===t.getIn([\"schema\",\"type\"]),a=\"cookie\"===t.getIn([\"schema\",\"in\"]);if(r&&a){const e=t.getIn([\"schema\",\"name\"]);document.cookie=`${e}=; Max-Age=-99999999`}}))}catch(e){console.error(\"Error deleting cookie based apiKey from document.cookie.\",e)}e(r)},Ne=require(\"prop-types\");var ke=__webpack_require__.n(Ne);const Ae=require(\"lodash/omit\");var Ie=__webpack_require__.n(Ae);class LockAuthIcon extends x().Component{mapStateToProps(e,t){return{state:e,ownProps:Ie()(t,Object.keys(t.getSystem()))}}render(){const{getComponent:e,ownProps:t}=this.props,r=e(\"LockIcon\");return x().createElement(r,t)}}const qe=LockAuthIcon;class UnlockAuthIcon extends x().Component{mapStateToProps(e,t){return{state:e,ownProps:Ie()(t,Object.keys(t.getSystem()))}}render(){const{getComponent:e,ownProps:t}=this.props,r=e(\"UnlockIcon\");return x().createElement(r,t)}}const je=UnlockAuthIcon;function auth(){return{afterLoad(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=preauthorizeApiKey.bind(null,e),this.rootInjects.preauthorizeBasic=preauthorizeBasic.bind(null,e)},components:{LockAuthIcon:qe,UnlockAuthIcon:je,LockAuthOperationIcon:qe,UnlockAuthOperationIcon:je},statePlugins:{auth:{reducers:ve,actions:t,selectors:a,wrapActions:{authorize:wrap_actions_authorize,logout:wrap_actions_logout}},configs:{wrapActions:{loaded}},spec:{wrapActions:{execute}}}}}function preauthorizeBasic(e,t,r,a){const{authActions:{authorize:n},specSelectors:{specJson:s,isOAS3:o}}=e,l=o()?[\"components\",\"securitySchemes\"]:[\"securityDefinitions\"],c=s().getIn([...l,t]);return c?n({[t]:{value:{username:r,password:a},schema:c.toJS()}}):null}function preauthorizeApiKey(e,t,r){const{authActions:{authorize:a},specSelectors:{specJson:n,isOAS3:s}}=e,o=s()?[\"components\",\"securitySchemes\"]:[\"securityDefinitions\"],l=n().getIn([...o,t]);return l?a({[t]:{value:r,schema:l.toJS()}}):null}const Pe=require(\"js-yaml\");var Me=__webpack_require__.n(Pe);const Re=\"configs_update\",Te=\"configs_toggle\";function update(e,t){return{type:Re,payload:{[e]:t}}}function toggle(e){return{type:Te,payload:e}}const actions_loaded=()=>()=>{},downloadConfig=e=>t=>{const{fn:{fetch:r}}=t;return r(e)},getConfigByUrl=(e,t)=>r=>{const{specActions:a,configsActions:n}=r;if(e)return n.downloadConfig(e).then(next,next);function next(n){n instanceof Error||n.status>=400?(a.updateLoadingStatus(\"failedConfig\"),a.updateLoadingStatus(\"failedConfig\"),a.updateUrl(\"\"),console.error(n.statusText+\" \"+e.url),t(null)):t(((e,t)=>{try{return Me().load(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}})(n.text,r))}},get=(e,t)=>e.getIn(Array.isArray(t)?t:[t]),Je={[Re]:(e,t)=>e.merge((0,N.fromJS)(t.payload)),[Te]:(e,t)=>{const r=t.payload,a=e.get(r);return e.set(r,!a)}};function configsPlugin(){return{statePlugins:{configs:{reducers:Je,actions:n,selectors:s}}}}const setHash=e=>e?history.pushState(null,null,`#${e}`):window.location.hash=\"\",$e=require(\"zenscroll\");var Ve=__webpack_require__.n($e);const De=\"layout_scroll_to\",Ke=\"layout_clear_scroll\";const Le={fn:{getScrollParent:function getScrollParent(e,t){const r=document.documentElement;let a=getComputedStyle(e);const n=\"absolute\"===a.position,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if(\"fixed\"===a.position)return r;for(let t=e;t=t.parentElement;)if(a=getComputedStyle(t),(!n||\"static\"!==a.position)&&s.test(a.overflow+a.overflowY+a.overflowX))return t;return r}},statePlugins:{layout:{actions:{scrollToElement:(e,t)=>r=>{try{t=t||r.fn.getScrollParent(e),Ve().createScroller(t).to(e)}catch(e){console.error(e)}},scrollTo:e=>({type:De,payload:Array.isArray(e)?e:[e]}),clearScrollTo:()=>({type:Ke}),readyToScroll:(e,t)=>r=>{const a=r.layoutSelectors.getScrollToKey();k().is(a,(0,N.fromJS)(e))&&(r.layoutActions.scrollToElement(t),r.layoutActions.clearScrollTo())},parseDeepLinkHash:e=>({layoutActions:t,layoutSelectors:r,getConfigs:a})=>{if(a().deepLinking&&e){let a=e.slice(1);\"!\"===a[0]&&(a=a.slice(1)),\"/\"===a[0]&&(a=a.slice(1));const n=a.split(\"/\").map((e=>e||\"\")),s=r.isShownKeyFromUrlHashArray(n),[o,l=\"\",c=\"\"]=s;if(\"operations\"===o){const e=r.isShownKeyFromUrlHashArray([l]);l.indexOf(\"_\")>-1&&(console.warn(\"Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.\"),t.show(e.map((e=>e.replace(/_/g,\" \"))),!0)),t.show(e,!0)}(l.indexOf(\"_\")>-1||c.indexOf(\"_\")>-1)&&(console.warn(\"Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead.\"),t.show(s.map((e=>e.replace(/_/g,\" \"))),!0)),t.show(s,!0),t.scrollTo(s)}}},selectors:{getScrollToKey:e=>e.get(\"scrollToKey\"),isShownKeyFromUrlHashArray(e,t){const[r,a]=t;return a?[\"operations\",r,a]:r?[\"operations-tag\",r]:[]},urlHashArrayFromIsShownKey(e,t){let[r,a,n]=t;return\"operations\"==r?[a,n]:\"operations-tag\"==r?[a]:[]}},reducers:{[De]:(e,t)=>e.set(\"scrollToKey\",k().fromJS(t.payload)),[Ke]:e=>e.delete(\"scrollToKey\")},wrapActions:{show:(e,{getConfigs:t,layoutSelectors:r})=>(...a)=>{if(e(...a),t().deepLinking)try{let[e,t]=a;e=Array.isArray(e)?e:[e];const n=r.urlHashArrayFromIsShownKey(e);if(!n.length)return;const[s,o]=n;if(!t)return setHash(\"/\");2===n.length?setHash(createDeepLinkPath(`/${encodeURIComponent(s)}/${encodeURIComponent(o)}`)):1===n.length&&setHash(createDeepLinkPath(`/${encodeURIComponent(s)}`))}catch(e){console.error(e)}}}}}},Ue=require(\"react-immutable-proptypes\");var ze=__webpack_require__.n(Ue);const operation_wrapper=(e,t)=>class OperationWrapper extends x().Component{onLoad=e=>{const{operation:r}=this.props,{tag:a,operationId:n}=r.toObject();let{isShownKey:s}=r.toObject();s=s||[\"operations\",a,n],t.layoutActions.readyToScroll(s,e)};render(){return x().createElement(\"span\",{ref:this.onLoad},x().createElement(e,this.props))}},operation_tag_wrapper=(e,t)=>class OperationTagWrapper extends x().Component{onLoad=e=>{const{tag:r}=this.props,a=[\"operations-tag\",r];t.layoutActions.readyToScroll(a,e)};render(){return x().createElement(\"span\",{ref:this.onLoad},x().createElement(e,this.props))}};function deep_linking(){return[Le,{statePlugins:{configs:{wrapActions:{loaded:(e,t)=>(...r)=>{e(...r);const a=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(a)}}}},wrapComponents:{operation:operation_wrapper,OperationTag:operation_tag_wrapper}}]}const Be=require(\"lodash/reduce\");var Fe=__webpack_require__.n(Be);function transform(e){return e.map((e=>{let t=\"is not of a type(s)\",r=e.get(\"message\").indexOf(t);if(r>-1){let t=e.get(\"message\").slice(r+19).split(\",\");return e.set(\"message\",e.get(\"message\").slice(0,r)+function makeNewMessage(e){return e.reduce(((e,t,r,a)=>r===a.length-1&&a.length>1?e+\"or \"+t:a[r+1]&&a.length>2?e+t+\", \":a[r+1]?e+t+\" \":e+t),\"should be a\")}(t))}return e}))}const We=require(\"lodash/get\");var He=__webpack_require__.n(We);function parameter_oneof_transform(e,{jsSpec:t}){return e}const Xe=[o,l];function transformErrors(e){let t={jsSpec:{}},r=Fe()(Xe,((e,r)=>{try{return r.transform(e,t).filter((e=>!!e))}catch(t){return console.error(\"Transformer error:\",t),e}}),e);return r.filter((e=>!!e)).map((e=>(!e.get(\"line\")&&e.get(\"path\"),e)))}let Ge={line:0,level:\"error\",message:\"Unknown error\"};const Ye=(0,we.createSelector)((e=>e),(e=>e.get(\"errors\",(0,N.List)()))),Qe=(0,we.createSelector)(Ye,(e=>e.last()));function err(t){return{statePlugins:{err:{reducers:{[R]:(e,{payload:t})=>{let r=Object.assign(Ge,t,{type:\"thrown\"});return e.update(\"errors\",(e=>(e||(0,N.List)()).push((0,N.fromJS)(r)))).update(\"errors\",(e=>transformErrors(e)))},[T]:(e,{payload:t})=>(t=t.map((e=>(0,N.fromJS)(Object.assign(Ge,e,{type:\"thrown\"})))),e.update(\"errors\",(e=>(e||(0,N.List)()).concat((0,N.fromJS)(t)))).update(\"errors\",(e=>transformErrors(e)))),[J]:(e,{payload:t})=>{let r=(0,N.fromJS)(t);return r=r.set(\"type\",\"spec\"),e.update(\"errors\",(e=>(e||(0,N.List)()).push((0,N.fromJS)(r)).sortBy((e=>e.get(\"line\"))))).update(\"errors\",(e=>transformErrors(e)))},[$]:(e,{payload:t})=>(t=t.map((e=>(0,N.fromJS)(Object.assign(Ge,e,{type:\"spec\"})))),e.update(\"errors\",(e=>(e||(0,N.List)()).concat((0,N.fromJS)(t)))).update(\"errors\",(e=>transformErrors(e)))),[V]:(e,{payload:t})=>{let r=(0,N.fromJS)(Object.assign({},t));return r=r.set(\"type\",\"auth\"),e.update(\"errors\",(e=>(e||(0,N.List)()).push((0,N.fromJS)(r)))).update(\"errors\",(e=>transformErrors(e)))},[D]:(e,{payload:t})=>{if(!t||!e.get(\"errors\"))return e;let r=e.get(\"errors\").filter((e=>e.keySeq().every((r=>{const a=e.get(r),n=t[r];return!n||a!==n}))));return e.merge({errors:r})},[K]:(e,{payload:t})=>{if(!t||\"function\"!=typeof t)return e;let r=e.get(\"errors\").filter((e=>t(e)));return e.merge({errors:r})}},actions:e,selectors:c}}}}function opsFilter(e,t){return e.filter(((e,r)=>-1!==r.indexOf(t)))}function filter(){return{fn:{opsFilter}}}const Ze=require(\"@babel/runtime-corejs3/helpers/extends\");var et=__webpack_require__.n(Ze);const arrow_up=({className:e=null,width:t=20,height:r=20,...a})=>x().createElement(\"svg\",et()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},a),x().createElement(\"path\",{d:\"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z\"})),arrow_down=({className:e=null,width:t=20,height:r=20,...a})=>x().createElement(\"svg\",et()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},a),x().createElement(\"path\",{d:\"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z\"})),arrow=({className:e=null,width:t=20,height:r=20,...a})=>x().createElement(\"svg\",et()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},a),x().createElement(\"path\",{d:\"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z\"})),components_close=({className:e=null,width:t=20,height:r=20,...a})=>x().createElement(\"svg\",et()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},a),x().createElement(\"path\",{d:\"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z\"})),copy=({className:e=null,width:t=15,height:r=16,...a})=>x().createElement(\"svg\",et()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 15 16\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},a),x().createElement(\"g\",{transform:\"translate(2, -1)\"},x().createElement(\"path\",{fill:\"#ffffff\",fillRule:\"evenodd\",d:\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"}))),lock=({className:e=null,width:t=20,height:r=20,...a})=>x().createElement(\"svg\",et()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},a),x().createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z\"})),unlock=({className:e=null,width:t=20,height:r=20,...a})=>x().createElement(\"svg\",et()({xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",className:e,width:t,height:r,\"aria-hidden\":\"true\",focusable:\"false\"},a),x().createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z\"})),icons=()=>({components:{ArrowUpIcon:arrow_up,ArrowDownIcon:arrow_down,ArrowIcon:arrow,CloseIcon:components_close,CopyIcon:copy,LockIcon:lock,UnlockIcon:unlock}}),tt=\"layout_update_layout\",rt=\"layout_update_filter\",at=\"layout_update_mode\",nt=\"layout_show\";function updateLayout(e){return{type:tt,payload:e}}function updateFilter(e){return{type:rt,payload:e}}function actions_show(e,t=!0){return e=normalizeArray(e),{type:nt,payload:{thing:e,shown:t}}}function changeMode(e,t=\"\"){return e=normalizeArray(e),{type:at,payload:{thing:e,mode:t}}}const st={[tt]:(e,t)=>e.set(\"layout\",t.payload),[rt]:(e,t)=>e.set(\"filter\",t.payload),[nt]:(e,t)=>{const r=t.payload.shown,a=(0,N.fromJS)(t.payload.thing);return e.update(\"shown\",(0,N.fromJS)({}),(e=>e.set(a,r)))},[at]:(e,t)=>{let r=t.payload.thing,a=t.payload.mode;return e.setIn([\"modes\"].concat(r),(a||\"\")+\"\")}},current=e=>e.get(\"layout\"),currentFilter=e=>e.get(\"filter\"),isShown=(e,t,r)=>(t=normalizeArray(t),e.get(\"shown\",(0,N.fromJS)({})).get((0,N.fromJS)(t),r)),whatMode=(e,t,r=\"\")=>(t=normalizeArray(t),e.getIn([\"modes\",...t],r)),ot=(0,we.createSelector)((e=>e),(e=>!isShown(e,\"editor\"))),taggedOperations=(e,t)=>(r,...a)=>{let n=e(r,...a);const{fn:s,layoutSelectors:o,getConfigs:l}=t.getSystem(),c=l(),{maxDisplayedTags:i}=c;let p=o.currentFilter();return p&&!0!==p&&(n=s.opsFilter(n,p)),i>=0&&(n=n.slice(0,i)),n};function plugins_layout(){return{statePlugins:{layout:{reducers:st,actions:i,selectors:p},spec:{wrapSelectors:m}}}}function logs({configs:e}){const t={debug:0,info:1,log:2,warn:3,error:4},getLevel=e=>t[e]||-1;let{logLevel:r}=e,a=getLevel(r);function log(e,...t){getLevel(e)>=a&&console[e](...t)}return log.warn=log.bind(null,\"warn\"),log.error=log.bind(null,\"error\"),log.info=log.bind(null,\"info\"),log.debug=log.bind(null,\"debug\"),{rootInjects:{log}}}let lt=!1;function on_complete(){return{statePlugins:{spec:{wrapActions:{updateSpec:e=>(...t)=>(lt=!0,e(...t)),updateJsonSpec:(e,t)=>(...r)=>{const a=t.getConfigs().onComplete;return lt&&\"function\"==typeof a&&(setTimeout(a,0),lt=!1),e(...r)}}}}}}const extractKey=e=>{const t=\"_**[]\";return e.indexOf(t)<0?e:e.split(t)[0].trim()},escapeShell=e=>\"-d \"===e||/^[_\\/-]/g.test(e)?e:\"'\"+e.replace(/'/g,\"'\\\\''\")+\"'\",escapeCMD=e=>\"-d \"===(e=e.replace(/\\^/g,\"^^\").replace(/\\\\\"/g,'\\\\\\\\\"').replace(/\"/g,'\"\"').replace(/\\n/g,\"^\\n\"))?e.replace(/-d /g,\"-d ^\\n\"):/^[_\\/-]/g.test(e)?e:'\"'+e+'\"',escapePowershell=e=>{if(\"-d \"===e)return e;if(/\\n/.test(e)){return`@\"\\n${e.replace(/`/g,\"``\").replace(/\\$/g,\"`$\")}\\n\"@`}if(!/^[_\\/-]/.test(e)){return`'${e.replace(/'/g,\"''\")}'`}return e};const curlify=(e,t,r,a=\"\")=>{let n=!1,s=\"\";const addWords=(...e)=>s+=\" \"+e.map(t).join(\" \"),addWordsWithoutLeadingSpace=(...e)=>s+=e.map(t).join(\" \"),addNewLine=()=>s+=` ${r}`,addIndent=(e=1)=>s+=\"  \".repeat(e);let o=e.get(\"headers\");s+=\"curl\"+a;const l=e.get(\"curlOptions\");if(N.List.isList(l)&&!l.isEmpty()&&addWords(...e.get(\"curlOptions\")),addWords(\"-X\",e.get(\"method\")),addNewLine(),addIndent(),addWordsWithoutLeadingSpace(`${e.get(\"url\")}`),o&&o.size)for(let t of e.get(\"headers\").entries()){addNewLine(),addIndent();let[e,r]=t;addWordsWithoutLeadingSpace(\"-H\",`${e}: ${r}`),n=n||/^content-type$/i.test(e)&&/^multipart\\/form-data$/i.test(r)}const c=e.get(\"body\");if(c)if(n&&[\"POST\",\"PUT\",\"PATCH\"].includes(e.get(\"method\")))for(let[e,t]of c.entrySeq()){let r=extractKey(e);addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-F\"),t instanceof L.File&&\"string\"==typeof t.valueOf()?addWords(`${r}=${t.data}${t.type?`;type=${t.type}`:\"\"}`):t instanceof L.File?addWords(`${r}=@${t.name}${t.type?`;type=${t.type}`:\"\"}`):addWords(`${r}=${t}`)}else if(c instanceof L.File)addNewLine(),addIndent(),addWordsWithoutLeadingSpace(`--data-binary '@${c.name}'`);else{addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-d \");let t=c;N.Map.isMap(t)?addWordsWithoutLeadingSpace(function getStringBodyOfMap(e){let t=[];for(let[r,a]of e.get(\"body\").entrySeq()){let e=extractKey(r);a instanceof L.File?t.push(`  \"${e}\": {\\n    \"name\": \"${a.name}\"${a.type?`,\\n    \"type\": \"${a.type}\"`:\"\"}\\n  }`):t.push(`  \"${e}\": ${JSON.stringify(a,null,2).replace(/(\\r\\n|\\r|\\n)/g,\"\\n  \")}`)}return`{\\n${t.join(\",\\n\")}\\n}`}(e)):(\"string\"!=typeof t&&(t=JSON.stringify(t)),addWordsWithoutLeadingSpace(t))}else c||\"POST\"!==e.get(\"method\")||(addNewLine(),addIndent(),addWordsWithoutLeadingSpace(\"-d ''\"));return s},requestSnippetGenerator_curl_powershell=e=>curlify(e,escapePowershell,\"`\\n\",\".exe\"),requestSnippetGenerator_curl_bash=e=>curlify(e,escapeShell,\"\\\\\\n\"),requestSnippetGenerator_curl_cmd=e=>curlify(e,escapeCMD,\"^\\n\"),request_snippets_selectors_state=e=>e||(0,N.Map)(),ct=(0,we.createSelector)(request_snippets_selectors_state,(e=>{const t=e.get(\"languages\"),r=e.get(\"generators\",(0,N.Map)());return!t||t.isEmpty()?r:r.filter(((e,r)=>t.includes(r)))})),getSnippetGenerators=e=>({fn:t})=>ct(e).map(((e,r)=>{const a=(e=>t[`requestSnippetGenerator_${e}`])(r);return\"function\"!=typeof a?null:e.set(\"fn\",a)})).filter((e=>e)),it=(0,we.createSelector)(request_snippets_selectors_state,(e=>e.get(\"activeLanguage\"))),pt=(0,we.createSelector)(request_snippets_selectors_state,(e=>e.get(\"defaultExpanded\"))),mt=require(\"classnames\");var ut=__webpack_require__.n(mt);const dt=require(\"react-copy-to-clipboard\"),ht={cursor:\"pointer\",lineHeight:1,display:\"inline-flex\",backgroundColor:\"rgb(250, 250, 250)\",paddingBottom:\"0\",paddingTop:\"0\",border:\"1px solid rgb(51, 51, 51)\",borderRadius:\"4px 4px 0 0\",boxShadow:\"none\",borderBottom:\"none\"},gt={cursor:\"pointer\",lineHeight:1,display:\"inline-flex\",backgroundColor:\"rgb(51, 51, 51)\",boxShadow:\"none\",border:\"1px solid rgb(51, 51, 51)\",paddingBottom:\"0\",paddingTop:\"0\",borderRadius:\"4px 4px 0 0\",marginTop:\"-5px\",marginRight:\"-5px\",marginLeft:\"-5px\",zIndex:\"9999\",borderBottom:\"none\"},request_snippets=({request:e,requestSnippetsSelectors:t,getComponent:r})=>{const a=(0,C.useRef)(null),n=r(\"ArrowUpIcon\"),s=r(\"ArrowDownIcon\"),o=r(\"SyntaxHighlighter\",!0),[l,c]=(0,C.useState)(t.getSnippetGenerators()?.keySeq().first()),[i,p]=(0,C.useState)(t?.getDefaultExpanded()),m=t.getSnippetGenerators(),u=m.get(l),d=u.get(\"fn\")(e),handleSetIsExpanded=()=>{p(!i)},handleGetBtnStyle=e=>e===l?gt:ht,handlePreventYScrollingBeyondElement=e=>{const{target:t,deltaY:r}=e,{scrollHeight:a,offsetHeight:n,scrollTop:s}=t;a>n&&(0===s&&r<0||n+s>=a&&r>0)&&e.preventDefault()};return(0,C.useEffect)((()=>{}),[]),(0,C.useEffect)((()=>{const e=Array.from(a.current.childNodes).filter((e=>!!e.nodeType&&e.classList?.contains(\"curl-command\")));return e.forEach((e=>e.addEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement,{passive:!1}))),()=>{e.forEach((e=>e.removeEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement)))}}),[e]),x().createElement(\"div\",{className:\"request-snippets\",ref:a},x().createElement(\"div\",{style:{width:\"100%\",display:\"flex\",justifyContent:\"flex-start\",alignItems:\"center\",marginBottom:\"15px\"}},x().createElement(\"h4\",{onClick:()=>handleSetIsExpanded(),style:{cursor:\"pointer\"}},\"Snippets\"),x().createElement(\"button\",{onClick:()=>handleSetIsExpanded(),style:{border:\"none\",background:\"none\"},title:i?\"Collapse operation\":\"Expand operation\"},i?x().createElement(s,{className:\"arrow\",width:\"10\",height:\"10\"}):x().createElement(n,{className:\"arrow\",width:\"10\",height:\"10\"}))),i&&x().createElement(\"div\",{className:\"curl-command\"},x().createElement(\"div\",{style:{paddingLeft:\"15px\",paddingRight:\"10px\",width:\"100%\",display:\"flex\"}},m.entrySeq().map((([e,t])=>x().createElement(\"div\",{className:ut()(\"btn\",{active:e===l}),style:handleGetBtnStyle(e),key:e,onClick:()=>(e=>{l!==e&&c(e)})(e)},x().createElement(\"h4\",{style:e===l?{color:\"white\"}:{}},t.get(\"title\")))))),x().createElement(\"div\",{className:\"copy-to-clipboard\"},x().createElement(dt.CopyToClipboard,{text:d},x().createElement(\"button\",null))),x().createElement(\"div\",null,x().createElement(o,{language:u.get(\"syntax\"),className:\"curl microlight\",renderPlainText:({children:e,PlainTextViewer:t})=>x().createElement(t,{className:\"curl\"},e)},d))))},plugins_request_snippets=()=>({components:{RequestSnippets:request_snippets},fn:u,statePlugins:{requestSnippets:{selectors:d}}});class ModelCollapse extends C.Component{static defaultProps={collapsedContent:\"{...}\",expanded:!1,title:null,onToggle:()=>{},hideSelfOnExpand:!1,specPath:k().List([])};constructor(e,t){super(e,t);let{expanded:r,collapsedContent:a}=this.props;this.state={expanded:r,collapsedContent:a||ModelCollapse.defaultProps.collapsedContent}}componentDidMount(){const{hideSelfOnExpand:e,expanded:t,modelName:r}=this.props;e&&t&&this.props.onToggle(r,t)}UNSAFE_componentWillReceiveProps(e){this.props.expanded!==e.expanded&&this.setState({expanded:e.expanded})}toggleCollapsed=()=>{this.props.onToggle&&this.props.onToggle(this.props.modelName,!this.state.expanded),this.setState({expanded:!this.state.expanded})};onLoad=e=>{if(e&&this.props.layoutSelectors){const t=this.props.layoutSelectors.getScrollToKey();k().is(t,this.props.specPath)&&this.toggleCollapsed(),this.props.layoutActions.readyToScroll(this.props.specPath,e.parentElement)}};render(){const{title:e,classes:t}=this.props;return this.state.expanded&&this.props.hideSelfOnExpand?x().createElement(\"span\",{className:t||\"\"},this.props.children):x().createElement(\"span\",{className:t||\"\",ref:this.onLoad},x().createElement(\"button\",{\"aria-expanded\":this.state.expanded,className:\"model-box-control\",onClick:this.toggleCollapsed},e&&x().createElement(\"span\",{className:\"pointer\"},e),x().createElement(\"span\",{className:\"model-toggle\"+(this.state.expanded?\"\":\" collapsed\")}),!this.state.expanded&&x().createElement(\"span\",null,this.state.collapsedContent)),this.state.expanded&&this.props.children)}}const useTabs=({initialTab:e,isExecute:t,schema:r,example:a})=>{const n=(0,C.useMemo)((()=>({example:\"example\",model:\"model\"})),[]),s=(0,C.useMemo)((()=>Object.keys(n)),[n]).includes(e)&&r&&!t?e:n.example,o=(e=>{const t=(0,C.useRef)();return(0,C.useEffect)((()=>{t.current=e})),t.current})(t),[l,c]=(0,C.useState)(s),i=(0,C.useCallback)((e=>{c(e.target.dataset.name)}),[]);return(0,C.useEffect)((()=>{o&&!t&&a&&c(n.example)}),[o,t,a]),{activeTab:l,onTabChange:i,tabs:n}},model_example=({schema:e,example:t,isExecute:r=!1,specPath:a,includeWriteOnly:n=!1,includeReadOnly:s=!1,getComponent:o,getConfigs:l,specSelectors:c})=>{const{defaultModelRendering:i,defaultModelExpandDepth:p}=l(),m=o(\"ModelWrapper\"),u=o(\"HighlightCode\",!0),d=ae()(5).toString(\"base64\"),h=ae()(5).toString(\"base64\"),g=ae()(5).toString(\"base64\"),y=ae()(5).toString(\"base64\"),f=c.isOAS3(),{activeTab:S,tabs:E,onTabChange:_}=useTabs({initialTab:i,isExecute:r,schema:e,example:t});return x().createElement(\"div\",{className:\"model-example\"},x().createElement(\"ul\",{className:\"tab\",role:\"tablist\"},x().createElement(\"li\",{className:ut()(\"tabitem\",{active:S===E.example}),role:\"presentation\"},x().createElement(\"button\",{\"aria-controls\":h,\"aria-selected\":S===E.example,className:\"tablinks\",\"data-name\":\"example\",id:d,onClick:_,role:\"tab\"},r?\"Edit Value\":\"Example Value\")),e&&x().createElement(\"li\",{className:ut()(\"tabitem\",{active:S===E.model}),role:\"presentation\"},x().createElement(\"button\",{\"aria-controls\":y,\"aria-selected\":S===E.model,className:ut()(\"tablinks\",{inactive:r}),\"data-name\":\"model\",id:g,onClick:_,role:\"tab\"},f?\"Schema\":\"Model\"))),S===E.example&&x().createElement(\"div\",{\"aria-hidden\":S!==E.example,\"aria-labelledby\":d,\"data-name\":\"examplePanel\",id:h,role:\"tabpanel\",tabIndex:\"0\"},t||x().createElement(u,null,\"(no example available\")),S===E.model&&x().createElement(\"div\",{\"aria-hidden\":S===E.example,\"aria-labelledby\":g,\"data-name\":\"modelPanel\",id:y,role:\"tabpanel\",tabIndex:\"0\"},x().createElement(m,{schema:e,getComponent:o,getConfigs:l,specSelectors:c,expandDepth:p,specPath:a,includeReadOnly:s,includeWriteOnly:n})))};class ModelWrapper extends C.Component{onToggle=(e,t)=>{this.props.layoutActions&&this.props.layoutActions.show(this.props.fullPath,t)};render(){let{getComponent:e,getConfigs:t}=this.props;const r=e(\"Model\");let a;return this.props.layoutSelectors&&(a=this.props.layoutSelectors.isShown(this.props.fullPath)),x().createElement(\"div\",{className:\"model-box\"},x().createElement(r,et()({},this.props,{getConfigs:t,expanded:a,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}const yt=require(\"react-immutable-pure-component\");var ft,St=__webpack_require__.n(yt);function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_extends.apply(this,arguments)}const rolling_load=e=>C.createElement(\"svg\",_extends({xmlns:\"http://www.w3.org/2000/svg\",width:200,height:200,className:\"rolling-load_svg__lds-rolling\",preserveAspectRatio:\"xMidYMid\",style:{backgroundImage:\"none\",backgroundPosition:\"initial initial\",backgroundRepeat:\"initial initial\"},viewBox:\"0 0 100 100\"},e),ft||(ft=C.createElement(\"circle\",{cx:50,cy:50,r:35,fill:\"none\",stroke:\"#555\",strokeDasharray:\"164.93361431346415 56.97787143782138\",strokeWidth:10},C.createElement(\"animateTransform\",{attributeName:\"transform\",begin:\"0s\",calcMode:\"linear\",dur:\"1s\",keyTimes:\"0;1\",repeatCount:\"indefinite\",type:\"rotate\",values:\"0 50 50;360 50 50\"})))),decodeRefName=e=>{const t=e.replace(/~1/g,\"/\").replace(/~0/g,\"~\");try{return decodeURIComponent(t)}catch{return t}};class Model extends(St()){static propTypes={schema:ze().map.isRequired,getComponent:ke().func.isRequired,getConfigs:ke().func.isRequired,specSelectors:ke().object.isRequired,name:ke().string,displayName:ke().string,isRef:ke().bool,required:ke().bool,expandDepth:ke().number,depth:ke().number,specPath:ze().list.isRequired,includeReadOnly:ke().bool,includeWriteOnly:ke().bool};getModelName=e=>-1!==e.indexOf(\"#/definitions/\")?decodeRefName(e.replace(/^.*#\\/definitions\\//,\"\")):-1!==e.indexOf(\"#/components/schemas/\")?decodeRefName(e.replace(/^.*#\\/components\\/schemas\\//,\"\")):void 0;getRefSchema=e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)};render(){let{getComponent:e,getConfigs:t,specSelectors:r,schema:a,required:n,name:s,isRef:o,specPath:l,displayName:c,includeReadOnly:i,includeWriteOnly:p}=this.props;const m=e(\"ObjectModel\"),u=e(\"ArrayModel\"),d=e(\"PrimitiveModel\");let h=\"object\",g=a&&a.get(\"$$ref\"),y=a&&a.get(\"$ref\");if(!s&&g&&(s=this.getModelName(g)),y){const e=this.getModelName(y),t=this.getRefSchema(e);N.Map.isMap(t)?(a=t.mergeDeep(a),g||(a=a.set(\"$$ref\",y),g=y)):N.Map.isMap(a)&&1===a.size&&(a=null,s=y)}if(!a)return x().createElement(\"span\",{className:\"model model-title\"},x().createElement(\"span\",{className:\"model-title__text\"},c||s),!y&&x().createElement(rolling_load,{height:\"20px\",width:\"20px\"}));const f=r.isOAS3()&&a.get(\"deprecated\");switch(o=void 0!==o?o:!!g,h=a&&a.get(\"type\")||h,h){case\"object\":return x().createElement(m,et()({className:\"object\"},this.props,{specPath:l,getConfigs:t,schema:a,name:s,deprecated:f,isRef:o,includeReadOnly:i,includeWriteOnly:p}));case\"array\":return x().createElement(u,et()({className:\"array\"},this.props,{getConfigs:t,schema:a,name:s,deprecated:f,required:n,includeReadOnly:i,includeWriteOnly:p}));default:return x().createElement(d,et()({},this.props,{getComponent:e,getConfigs:t,schema:a,name:s,deprecated:f,required:n}))}}}class Models extends C.Component{getSchemaBasePath=()=>this.props.specSelectors.isOAS3()?[\"components\",\"schemas\"]:[\"definitions\"];getCollapsedContent=()=>\" \";handleToggle=(e,t)=>{const{layoutActions:r}=this.props;r.show([...this.getSchemaBasePath(),e],t),t&&this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(),e])};onLoadModels=e=>{e&&this.props.layoutActions.readyToScroll(this.getSchemaBasePath(),e)};onLoadModel=e=>{if(e){const t=e.getAttribute(\"data-name\");this.props.layoutActions.readyToScroll([...this.getSchemaBasePath(),t],e)}};render(){let{specSelectors:e,getComponent:t,layoutSelectors:r,layoutActions:a,getConfigs:n}=this.props,s=e.definitions(),{docExpansion:o,defaultModelsExpandDepth:l}=n();if(!s.size||l<0)return null;const c=this.getSchemaBasePath();let i=r.isShown(c,l>0&&\"none\"!==o);const p=e.isOAS3(),m=t(\"ModelWrapper\"),u=t(\"Collapse\"),d=t(\"ModelCollapse\"),h=t(\"JumpToPath\",!0),g=t(\"ArrowUpIcon\"),y=t(\"ArrowDownIcon\");return x().createElement(\"section\",{className:i?\"models is-open\":\"models\",ref:this.onLoadModels},x().createElement(\"h4\",null,x().createElement(\"button\",{\"aria-expanded\":i,className:\"models-control\",onClick:()=>a.show(c,!i)},x().createElement(\"span\",null,p?\"Schemas\":\"Models\"),i?x().createElement(g,null):x().createElement(y,null))),x().createElement(u,{isOpened:i},s.entrySeq().map((([s])=>{const o=[...c,s],i=k().List(o),p=e.specResolvedSubtree(o),u=e.specJson().getIn(o),g=N.Map.isMap(p)?p:k().Map(),y=N.Map.isMap(u)?u:k().Map(),f=g.get(\"title\")||y.get(\"title\")||s,S=r.isShown(o,!1);S&&0===g.size&&y.size>0&&this.props.specActions.requestResolvedSubtree(o);const E=x().createElement(m,{name:s,expandDepth:l,schema:g||k().Map(),displayName:f,fullPath:o,specPath:i,getComponent:t,specSelectors:e,getConfigs:n,layoutSelectors:r,layoutActions:a,includeReadOnly:!0,includeWriteOnly:!0}),_=x().createElement(\"span\",{className:\"model-box\"},x().createElement(\"span\",{className:\"model model-title\"},f));return x().createElement(\"div\",{id:`model-${s}`,className:\"model-container\",key:`models-section-${s}`,\"data-name\":s,ref:this.onLoadModel},x().createElement(\"span\",{className:\"models-jump-to-path\"},x().createElement(h,{specPath:i})),x().createElement(d,{classes:\"model-box\",collapsedContent:this.getCollapsedContent(s),onToggle:this.handleToggle,title:_,displayName:f,modelName:s,specPath:i,layoutSelectors:r,layoutActions:a,hideSelfOnExpand:!0,expanded:l>0&&S},E))})).toArray()))}}const enum_model=({value:e,getComponent:t})=>{let r=t(\"ModelCollapse\"),a=x().createElement(\"span\",null,\"Array [ \",e.count(),\" ]\");return x().createElement(\"span\",{className:\"prop-enum\"},\"Enum:\",x().createElement(\"br\",null),x().createElement(r,{collapsedContent:a},\"[ \",e.map(String).join(\", \"),\" ]\"))};class ObjectModel extends C.Component{render(){let{schema:e,name:t,displayName:r,isRef:a,getComponent:n,getConfigs:s,depth:o,onToggle:l,expanded:c,specPath:i,...p}=this.props,{specSelectors:m,expandDepth:u,includeReadOnly:d,includeWriteOnly:h}=p;const{isOAS3:g}=m;if(!e)return null;const{showExtensions:y}=s();let f=e.get(\"description\"),S=e.get(\"properties\"),E=e.get(\"additionalProperties\"),_=e.get(\"title\")||r||t,v=e.get(\"required\"),w=e.filter(((e,t)=>-1!==[\"maxProperties\",\"minProperties\",\"nullable\",\"example\"].indexOf(t))),b=e.get(\"deprecated\"),C=e.getIn([\"externalDocs\",\"url\"]),O=e.getIn([\"externalDocs\",\"description\"]);const k=n(\"JumpToPath\",!0),A=n(\"Markdown\",!0),I=n(\"Model\"),q=n(\"ModelCollapse\"),j=n(\"Property\"),P=n(\"Link\"),JumpToPathSection=()=>x().createElement(\"span\",{className:\"model-jump-to-path\"},x().createElement(k,{specPath:i})),M=x().createElement(\"span\",null,x().createElement(\"span\",null,\"{\"),\"...\",x().createElement(\"span\",null,\"}\"),a?x().createElement(JumpToPathSection,null):\"\"),R=m.isOAS3()?e.get(\"allOf\"):null,T=m.isOAS3()?e.get(\"anyOf\"):null,J=m.isOAS3()?e.get(\"oneOf\"):null,$=m.isOAS3()?e.get(\"not\"):null,V=_&&x().createElement(\"span\",{className:\"model-title\"},a&&e.get(\"$$ref\")&&x().createElement(\"span\",{className:\"model-hint\"},e.get(\"$$ref\")),x().createElement(\"span\",{className:\"model-title__text\"},_));return x().createElement(\"span\",{className:\"model\"},x().createElement(q,{modelName:t,title:V,onToggle:l,expanded:!!c||o<=u,collapsedContent:M},x().createElement(\"span\",{className:\"brace-open object\"},\"{\"),a?x().createElement(JumpToPathSection,null):null,x().createElement(\"span\",{className:\"inner-object\"},x().createElement(\"table\",{className:\"model\"},x().createElement(\"tbody\",null,f?x().createElement(\"tr\",{className:\"description\"},x().createElement(\"td\",null,\"description:\"),x().createElement(\"td\",null,x().createElement(A,{source:f}))):null,C&&x().createElement(\"tr\",{className:\"external-docs\"},x().createElement(\"td\",null,\"externalDocs:\"),x().createElement(\"td\",null,x().createElement(P,{target:\"_blank\",href:sanitizeUrl(C)},O||C))),b?x().createElement(\"tr\",{className:\"property\"},x().createElement(\"td\",null,\"deprecated:\"),x().createElement(\"td\",null,\"true\")):null,S&&S.size?S.entrySeq().filter((([,e])=>(!e.get(\"readOnly\")||d)&&(!e.get(\"writeOnly\")||h))).map((([e,r])=>{let a=g()&&r.get(\"deprecated\"),l=N.List.isList(v)&&v.contains(e),c=[\"property-row\"];return a&&c.push(\"deprecated\"),l&&c.push(\"required\"),x().createElement(\"tr\",{key:e,className:c.join(\" \")},x().createElement(\"td\",null,e,l&&x().createElement(\"span\",{className:\"star\"},\"*\")),x().createElement(\"td\",null,x().createElement(I,et()({key:`object-${t}-${e}_${r}`},p,{required:l,getComponent:n,specPath:i.push(\"properties\",e),getConfigs:s,schema:r,depth:o+1}))))})).toArray():null,y?x().createElement(\"tr\",null,x().createElement(\"td\",null,\" \")):null,y?e.entrySeq().map((([e,t])=>{if(\"x-\"!==e.slice(0,2))return;const r=t?t.toJS?t.toJS():t:null;return x().createElement(\"tr\",{key:e,className:\"extension\"},x().createElement(\"td\",null,e),x().createElement(\"td\",null,JSON.stringify(r)))})).toArray():null,E&&E.size?x().createElement(\"tr\",null,x().createElement(\"td\",null,\"< * >:\"),x().createElement(\"td\",null,x().createElement(I,et()({},p,{required:!1,getComponent:n,specPath:i.push(\"additionalProperties\"),getConfigs:s,schema:E,depth:o+1})))):null,R?x().createElement(\"tr\",null,x().createElement(\"td\",null,\"allOf ->\"),x().createElement(\"td\",null,R.map(((e,t)=>x().createElement(\"div\",{key:t},x().createElement(I,et()({},p,{required:!1,getComponent:n,specPath:i.push(\"allOf\",t),getConfigs:s,schema:e,depth:o+1}))))))):null,T?x().createElement(\"tr\",null,x().createElement(\"td\",null,\"anyOf ->\"),x().createElement(\"td\",null,T.map(((e,t)=>x().createElement(\"div\",{key:t},x().createElement(I,et()({},p,{required:!1,getComponent:n,specPath:i.push(\"anyOf\",t),getConfigs:s,schema:e,depth:o+1}))))))):null,J?x().createElement(\"tr\",null,x().createElement(\"td\",null,\"oneOf ->\"),x().createElement(\"td\",null,J.map(((e,t)=>x().createElement(\"div\",{key:t},x().createElement(I,et()({},p,{required:!1,getComponent:n,specPath:i.push(\"oneOf\",t),getConfigs:s,schema:e,depth:o+1}))))))):null,$?x().createElement(\"tr\",null,x().createElement(\"td\",null,\"not ->\"),x().createElement(\"td\",null,x().createElement(\"div\",null,x().createElement(I,et()({},p,{required:!1,getComponent:n,specPath:i.push(\"not\"),getConfigs:s,schema:$,depth:o+1}))))):null))),x().createElement(\"span\",{className:\"brace-close\"},\"}\")),w.size?w.entrySeq().map((([e,t])=>x().createElement(j,{key:`${e}-${t}`,propKey:e,propVal:t,propClass:\"property\"}))):null)}}class ArrayModel extends C.Component{render(){let{getComponent:e,getConfigs:t,schema:r,depth:a,expandDepth:n,name:s,displayName:o,specPath:l}=this.props,c=r.get(\"description\"),i=r.get(\"items\"),p=r.get(\"title\")||o||s,m=r.filter(((e,t)=>-1===[\"type\",\"items\",\"description\",\"$$ref\",\"externalDocs\"].indexOf(t))),u=r.getIn([\"externalDocs\",\"url\"]),d=r.getIn([\"externalDocs\",\"description\"]);const h=e(\"Markdown\",!0),g=e(\"ModelCollapse\"),y=e(\"Model\"),f=e(\"Property\"),S=e(\"Link\"),E=p&&x().createElement(\"span\",{className:\"model-title\"},x().createElement(\"span\",{className:\"model-title__text\"},p));return x().createElement(\"span\",{className:\"model\"},x().createElement(g,{title:E,expanded:a<=n,collapsedContent:\"[...]\"},\"[\",m.size?m.entrySeq().map((([e,t])=>x().createElement(f,{key:`${e}-${t}`,propKey:e,propVal:t,propClass:\"property\"}))):null,c?x().createElement(h,{source:c}):m.size?x().createElement(\"div\",{className:\"markdown\"}):null,u&&x().createElement(\"div\",{className:\"external-docs\"},x().createElement(S,{target:\"_blank\",href:sanitizeUrl(u)},d||u)),x().createElement(\"span\",null,x().createElement(y,et()({},this.props,{getConfigs:t,specPath:l.push(\"items\"),name:null,schema:i,required:!1,depth:a+1}))),\"]\"))}}const Et=\"property primitive\";class Primitive extends C.Component{render(){let{schema:e,getComponent:t,getConfigs:r,name:a,displayName:n,depth:s,expandDepth:o}=this.props;const{showExtensions:l}=r();if(!e||!e.get)return x().createElement(\"div\",null);let c=e.get(\"type\"),i=e.get(\"format\"),p=e.get(\"xml\"),m=e.get(\"enum\"),u=e.get(\"title\")||n||a,d=e.get(\"description\"),h=getExtensions(e),g=e.filter(((e,t)=>-1===[\"enum\",\"type\",\"format\",\"description\",\"$$ref\",\"externalDocs\"].indexOf(t))).filterNot(((e,t)=>h.has(t))),y=e.getIn([\"externalDocs\",\"url\"]),f=e.getIn([\"externalDocs\",\"description\"]);const S=t(\"Markdown\",!0),E=t(\"EnumModel\"),_=t(\"Property\"),v=t(\"ModelCollapse\"),w=t(\"Link\"),b=u&&x().createElement(\"span\",{className:\"model-title\"},x().createElement(\"span\",{className:\"model-title__text\"},u));return x().createElement(\"span\",{className:\"model\"},x().createElement(v,{title:b,expanded:s<=o,collapsedContent:\"[...]\"},x().createElement(\"span\",{className:\"prop\"},a&&s>1&&x().createElement(\"span\",{className:\"prop-name\"},u),x().createElement(\"span\",{className:\"prop-type\"},c),i&&x().createElement(\"span\",{className:\"prop-format\"},\"($\",i,\")\"),g.size?g.entrySeq().map((([e,t])=>x().createElement(_,{key:`${e}-${t}`,propKey:e,propVal:t,propClass:Et}))):null,l&&h.size?h.entrySeq().map((([e,t])=>x().createElement(_,{key:`${e}-${t}`,propKey:e,propVal:t,propClass:Et}))):null,d?x().createElement(S,{source:d}):null,y&&x().createElement(\"div\",{className:\"external-docs\"},x().createElement(w,{target:\"_blank\",href:sanitizeUrl(y)},f||y)),p&&p.size?x().createElement(\"span\",null,x().createElement(\"br\",null),x().createElement(\"span\",{className:Et},\"xml:\"),p.entrySeq().map((([e,t])=>x().createElement(\"span\",{key:`${e}-${t}`,className:Et},x().createElement(\"br\",null),\"   \",e,\": \",String(t)))).toArray()):null,m&&x().createElement(E,{value:m,getComponent:t}))))}}class Schemes extends x().Component{UNSAFE_componentWillMount(){let{schemes:e}=this.props;this.setScheme(e.first())}UNSAFE_componentWillReceiveProps(e){this.props.currentScheme&&e.schemes.includes(this.props.currentScheme)||this.setScheme(e.schemes.first())}onChange=e=>{this.setScheme(e.target.value)};setScheme=e=>{let{path:t,method:r,specActions:a}=this.props;a.setScheme(e,t,r)};render(){let{schemes:e,currentScheme:t}=this.props;return x().createElement(\"label\",{htmlFor:\"schemes\"},x().createElement(\"span\",{className:\"schemes-title\"},\"Schemes\"),x().createElement(\"select\",{onChange:this.onChange,value:t,id:\"schemes\"},e.valueSeq().map((e=>x().createElement(\"option\",{value:e,key:e},e))).toArray()))}}class SchemesContainer extends x().Component{render(){const{specActions:e,specSelectors:t,getComponent:r}=this.props,a=t.operationScheme(),n=t.schemes(),s=r(\"schemes\");return n&&n.size?x().createElement(s,{currentScheme:a,schemes:n,specActions:e}):null}}const _t=require(\"react-debounce-input\");var vt=__webpack_require__.n(_t);const wt={value:\"\",onChange:()=>{},schema:{},keyName:\"\",required:!1,errors:(0,N.List)()};class JsonSchemaForm extends C.Component{static defaultProps=wt;componentDidMount(){const{dispatchInitialValue:e,value:t,onChange:r}=this.props;e?r(t):!1===e&&r(\"\")}render(){let{schema:e,errors:t,value:r,onChange:a,getComponent:n,fn:s,disabled:o}=this.props;const l=e&&e.get?e.get(\"format\"):null,c=e&&e.get?e.get(\"type\"):null;let getComponentSilently=e=>n(e,!1,{failSilently:!0}),i=c?getComponentSilently(l?`JsonSchema_${c}_${l}`:`JsonSchema_${c}`):n(\"JsonSchema_string\");return i||(i=n(\"JsonSchema_string\")),x().createElement(i,et()({},this.props,{errors:t,fn:s,getComponent:n,value:r,onChange:a,schema:e,disabled:o}))}}class JsonSchema_string extends C.Component{static defaultProps=wt;onChange=e=>{const t=this.props.schema&&\"file\"===this.props.schema.get(\"type\")?e.target.files[0]:e.target.value;this.props.onChange(t,this.props.keyName)};onEnumChange=e=>this.props.onChange(e);render(){let{getComponent:e,value:t,schema:r,errors:a,required:n,description:s,disabled:o}=this.props;const l=r&&r.get?r.get(\"enum\"):null,c=r&&r.get?r.get(\"format\"):null,i=r&&r.get?r.get(\"type\"):null,p=r&&r.get?r.get(\"in\"):null;if(t||(t=\"\"),a=a.toJS?a.toJS():[],l){const r=e(\"Select\");return x().createElement(r,{className:a.length?\"invalid\":\"\",title:a.length?a:\"\",allowedValues:[...l],value:t,allowEmptyValue:!n,disabled:o,onChange:this.onEnumChange})}const m=o||p&&\"formData\"===p&&!(\"FormData\"in window),u=e(\"Input\");return i&&\"file\"===i?x().createElement(u,{type:\"file\",className:a.length?\"invalid\":\"\",title:a.length?a:\"\",onChange:this.onChange,disabled:m}):x().createElement(vt(),{type:c&&\"password\"===c?\"password\":\"text\",className:a.length?\"invalid\":\"\",title:a.length?a:\"\",value:t,minLength:0,debounceTimeout:350,placeholder:s,onChange:this.onChange,disabled:m})}}class JsonSchema_array extends C.PureComponent{static defaultProps=wt;constructor(e,t){super(e,t),this.state={value:valueOrEmptyList(e.value),schema:e.schema}}UNSAFE_componentWillReceiveProps(e){const t=valueOrEmptyList(e.value);t!==this.state.value&&this.setState({value:t}),e.schema!==this.state.schema&&this.setState({schema:e.schema})}onChange=()=>{this.props.onChange(this.state.value)};onItemChange=(e,t)=>{this.setState((({value:r})=>({value:r.set(t,e)})),this.onChange)};removeItem=e=>{this.setState((({value:t})=>({value:t.delete(e)})),this.onChange)};addItem=()=>{const{fn:e}=this.props;let t=valueOrEmptyList(this.state.value);this.setState((()=>({value:t.push(e.getSampleSchema(this.state.schema.get(\"items\"),!1,{includeWriteOnly:!0}))})),this.onChange)};onEnumChange=e=>{this.setState((()=>({value:e})),this.onChange)};render(){let{getComponent:e,required:t,schema:r,errors:a,fn:n,disabled:s}=this.props;a=a.toJS?a.toJS():Array.isArray(a)?a:[];const o=a.filter((e=>\"string\"==typeof e)),l=a.filter((e=>void 0!==e.needRemove)).map((e=>e.error)),c=this.state.value,i=!!(c&&c.count&&c.count()>0),p=r.getIn([\"items\",\"enum\"]),m=r.getIn([\"items\",\"type\"]),u=r.getIn([\"items\",\"format\"]),d=r.get(\"items\");let h,g=!1,y=\"file\"===m||\"string\"===m&&\"binary\"===u;if(m&&u?h=e(`JsonSchema_${m}_${u}`):\"boolean\"!==m&&\"array\"!==m&&\"object\"!==m||(h=e(`JsonSchema_${m}`)),h||y||(g=!0),p){const r=e(\"Select\");return x().createElement(r,{className:a.length?\"invalid\":\"\",title:a.length?a:\"\",multiple:!0,value:c,disabled:s,allowedValues:p,allowEmptyValue:!t,onChange:this.onEnumChange})}const f=e(\"Button\");return x().createElement(\"div\",{className:\"json-schema-array\"},i?c.map(((t,r)=>{const o=(0,N.fromJS)([...a.filter((e=>e.index===r)).map((e=>e.error))]);return x().createElement(\"div\",{key:r,className:\"json-schema-form-item\"},y?x().createElement(JsonSchemaArrayItemFile,{value:t,onChange:e=>this.onItemChange(e,r),disabled:s,errors:o,getComponent:e}):g?x().createElement(JsonSchemaArrayItemText,{value:t,onChange:e=>this.onItemChange(e,r),disabled:s,errors:o}):x().createElement(h,et()({},this.props,{value:t,onChange:e=>this.onItemChange(e,r),disabled:s,errors:o,schema:d,getComponent:e,fn:n})),s?null:x().createElement(f,{className:`btn btn-sm json-schema-form-item-remove ${l.length?\"invalid\":null}`,title:l.length?l:\"\",onClick:()=>this.removeItem(r)},\" - \"))})):null,s?null:x().createElement(f,{className:`btn btn-sm json-schema-form-item-add ${o.length?\"invalid\":null}`,title:o.length?o:\"\",onClick:this.addItem},\"Add \",m?`${m} `:\"\",\"item\"))}}class JsonSchemaArrayItemText extends C.Component{static defaultProps=wt;onChange=e=>{const t=e.target.value;this.props.onChange(t,this.props.keyName)};render(){let{value:e,errors:t,description:r,disabled:a}=this.props;return e||(e=\"\"),t=t.toJS?t.toJS():[],x().createElement(vt(),{type:\"text\",className:t.length?\"invalid\":\"\",title:t.length?t:\"\",value:e,minLength:0,debounceTimeout:350,placeholder:r,onChange:this.onChange,disabled:a})}}class JsonSchemaArrayItemFile extends C.Component{static defaultProps=wt;onFileChange=e=>{const t=e.target.files[0];this.props.onChange(t,this.props.keyName)};render(){let{getComponent:e,errors:t,disabled:r}=this.props;const a=e(\"Input\"),n=r||!(\"FormData\"in window);return x().createElement(a,{type:\"file\",className:t.length?\"invalid\":\"\",title:t.length?t:\"\",onChange:this.onFileChange,disabled:n})}}class JsonSchema_boolean extends C.Component{static defaultProps=wt;onEnumChange=e=>this.props.onChange(e);render(){let{getComponent:e,value:t,errors:r,schema:a,required:n,disabled:s}=this.props;r=r.toJS?r.toJS():[];let o=a&&a.get?a.get(\"enum\"):null,l=!o||!n,c=!o&&[\"true\",\"false\"];const i=e(\"Select\");return x().createElement(i,{className:r.length?\"invalid\":\"\",title:r.length?r:\"\",value:String(t),disabled:s,allowedValues:o?[...o]:c,allowEmptyValue:l,onChange:this.onEnumChange})}}const stringifyObjectErrors=e=>e.map((e=>{const t=void 0!==e.propKey?e.propKey:e.index;let r=\"string\"==typeof e?e:\"string\"==typeof e.error?e.error:null;if(!t&&r)return r;let a=e.error,n=`/${e.propKey}`;for(;\"object\"==typeof a;){const e=void 0!==a.propKey?a.propKey:a.index;if(void 0===e)break;if(n+=`/${e}`,!a.error)break;a=a.error}return`${n}: ${a}`}));class JsonSchema_object extends C.PureComponent{constructor(){super()}static defaultProps=wt;onChange=e=>{this.props.onChange(e)};handleOnChange=e=>{const t=e.target.value;this.onChange(t)};render(){let{getComponent:e,value:t,errors:r,disabled:a}=this.props;const n=e(\"TextArea\");return r=r.toJS?r.toJS():Array.isArray(r)?r:[],x().createElement(\"div\",null,x().createElement(n,{className:ut()({invalid:r.length}),title:r.length?stringifyObjectErrors(r).join(\", \"):\"\",value:stringify(t),disabled:a,onChange:this.handleOnChange}))}}function valueOrEmptyList(e){return N.List.isList(e)?e:Array.isArray(e)?(0,N.fromJS)(e):(0,N.List)()}const json_schema_5=()=>({components:{modelExample:model_example,ModelWrapper,ModelCollapse,Model,Models,EnumModel:enum_model,ObjectModel,ArrayModel,PrimitiveModel:Primitive,schemes:Schemes,SchemesContainer,...h}}),bt=require(\"xml\");var Ct=__webpack_require__.n(bt);const xt=require(\"randexp\");var Ot=__webpack_require__.n(xt);const Nt=require(\"lodash/isEmpty\");var kt=__webpack_require__.n(Nt);const shallowArrayEquals=e=>t=>Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(((e,r)=>e===t[r])),list=(...e)=>e;class Cache extends Map{delete(e){const t=Array.from(this.keys()).find(shallowArrayEquals(e));return super.delete(t)}get(e){const t=Array.from(this.keys()).find(shallowArrayEquals(e));return super.get(t)}has(e){return-1!==Array.from(this.keys()).findIndex(shallowArrayEquals(e))}}const utils_memoizeN=(e,t=list)=>{const{Cache:r}=B();B().Cache=Cache;const a=B()(e,t);return B().Cache=r,a},At={string:e=>e.pattern?(e=>{try{return new(Ot())(e).gen()}catch(e){return\"string\"}})(e.pattern):\"string\",string_email:()=>\"user@example.com\",\"string_date-time\":()=>(new Date).toISOString(),string_date:()=>(new Date).toISOString().substring(0,10),string_uuid:()=>\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",string_hostname:()=>\"example.com\",string_ipv4:()=>\"198.51.100.42\",string_ipv6:()=>\"2001:0db8:5b96:0000:0000:426f:8e17:642a\",number:()=>0,number_float:()=>0,integer:()=>0,boolean:e=>\"boolean\"!=typeof e.default||e.default},primitive=e=>{e=objectify(e);let{type:t,format:r}=e,a=At[`${t}_${r}`]||At[t];return isFunc(a)?a(e):\"Unknown Type: \"+e.type},sanitizeRef=e=>deeplyStripKey(e,\"$$ref\",(e=>\"string\"==typeof e&&e.indexOf(\"#\")>-1)),It=[\"maxProperties\",\"minProperties\"],qt=[\"minItems\",\"maxItems\"],jt=[\"minimum\",\"maximum\",\"exclusiveMinimum\",\"exclusiveMaximum\"],Pt=[\"minLength\",\"maxLength\"],mergeJsonSchema=(e,t,r={})=>{const a={...e};if([\"example\",\"default\",\"enum\",\"xml\",\"type\",...It,...qt,...jt,...Pt].forEach((e=>(e=>{void 0===a[e]&&void 0!==t[e]&&(a[e]=t[e])})(e))),void 0!==t.required&&Array.isArray(t.required)&&(void 0!==a.required&&a.required.length||(a.required=[]),t.required.forEach((e=>{a.required.includes(e)||a.required.push(e)}))),t.properties){a.properties||(a.properties={});let e=objectify(t.properties);for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]&&e[n].deprecated||e[n]&&e[n].readOnly&&!r.includeReadOnly||e[n]&&e[n].writeOnly&&!r.includeWriteOnly||a.properties[n]||(a.properties[n]=e[n],!t.required&&Array.isArray(t.required)&&-1!==t.required.indexOf(n)&&(a.required?a.required.push(n):a.required=[n])))}return t.items&&(a.items||(a.items={}),a.items=mergeJsonSchema(a.items,t.items,r)),a},sampleFromSchemaGeneric=(e,t={},r=void 0,a=!1)=>{e&&isFunc(e.toJS)&&(e=e.toJS());let n=void 0!==r||e&&void 0!==e.example||e&&void 0!==e.default;const s=!n&&e&&e.oneOf&&e.oneOf.length>0,o=!n&&e&&e.anyOf&&e.anyOf.length>0;if(!n&&(s||o)){const r=objectify(s?e.oneOf[0]:e.anyOf[0]);if(!(e=mergeJsonSchema(e,r,t)).xml&&r.xml&&(e.xml=r.xml),void 0!==e.example&&void 0!==r.example)n=!0;else if(r.properties){e.properties||(e.properties={});let a=objectify(r.properties);for(let n in a)Object.prototype.hasOwnProperty.call(a,n)&&(a[n]&&a[n].deprecated||a[n]&&a[n].readOnly&&!t.includeReadOnly||a[n]&&a[n].writeOnly&&!t.includeWriteOnly||e.properties[n]||(e.properties[n]=a[n],!r.required&&Array.isArray(r.required)&&-1!==r.required.indexOf(n)&&(e.required?e.required.push(n):e.required=[n])))}}const l={};let{xml:c,type:i,example:p,properties:m,additionalProperties:u,items:d}=e||{},{includeReadOnly:h,includeWriteOnly:g}=t;c=c||{};let y,{name:f,prefix:S,namespace:E}=c,_={};if(a&&(f=f||\"notagname\",y=(S?S+\":\":\"\")+f,E)){l[S?\"xmlns:\"+S:\"xmlns\"]=E}a&&(_[y]=[]);const schemaHasAny=t=>t.some((t=>Object.prototype.hasOwnProperty.call(e,t)));e&&!i&&(m||u||schemaHasAny(It)?i=\"object\":d||schemaHasAny(qt)?i=\"array\":schemaHasAny(jt)?(i=\"number\",e.type=\"number\"):n||e.enum||(i=\"string\",e.type=\"string\"));const handleMinMaxItems=t=>{if(null!=e?.maxItems&&(t=t.slice(0,e?.maxItems)),null!=e?.minItems){let r=0;for(;t.length<e?.minItems;)t.push(t[r++%t.length])}return t},v=objectify(m);let w,b=0;const hasExceededMaxProperties=()=>e&&null!==e.maxProperties&&void 0!==e.maxProperties&&b>=e.maxProperties,canAddProperty=t=>!e||null===e.maxProperties||void 0===e.maxProperties||!hasExceededMaxProperties()&&(!(t=>!(e&&e.required&&e.required.length&&e.required.includes(t)))(t)||e.maxProperties-b-(()=>{if(!e||!e.required)return 0;let t=0;return a?e.required.forEach((e=>t+=void 0===_[e]?0:1)):e.required.forEach((e=>t+=void 0===_[y]?.find((t=>void 0!==t[e]))?0:1)),e.required.length-t})()>0);if(w=a?(r,n=void 0)=>{if(e&&v[r]){if(v[r].xml=v[r].xml||{},v[r].xml.attribute){const e=Array.isArray(v[r].enum)?v[r].enum[0]:void 0,t=v[r].example,a=v[r].default;return void(l[v[r].xml.name||r]=void 0!==t?t:void 0!==a?a:void 0!==e?e:primitive(v[r]))}v[r].xml.name=v[r].xml.name||r}else v[r]||!1===u||(v[r]={xml:{name:r}});let s=sampleFromSchemaGeneric(e&&v[r]||void 0,t,n,a);canAddProperty(r)&&(b++,Array.isArray(s)?_[y]=_[y].concat(s):_[y].push(s))}:(r,n)=>{if(canAddProperty(r)){if(Object.prototype.hasOwnProperty.call(e,\"discriminator\")&&e.discriminator&&Object.prototype.hasOwnProperty.call(e.discriminator,\"mapping\")&&e.discriminator.mapping&&Object.prototype.hasOwnProperty.call(e,\"$$ref\")&&e.$$ref&&e.discriminator.propertyName===r){for(let t in e.discriminator.mapping)if(-1!==e.$$ref.search(e.discriminator.mapping[t])){_[r]=t;break}}else _[r]=sampleFromSchemaGeneric(v[r],t,n,a);b++}},n){let n;if(n=sanitizeRef(void 0!==r?r:void 0!==p?p:e.default),!a){if(\"number\"==typeof n&&\"string\"===i)return`${n}`;if(\"string\"!=typeof n||\"string\"===i)return n;try{return JSON.parse(n)}catch(e){return n}}if(e||(i=Array.isArray(n)?\"array\":typeof n),\"array\"===i){if(!Array.isArray(n)){if(\"string\"==typeof n)return n;n=[n]}const r=e?e.items:void 0;r&&(r.xml=r.xml||c||{},r.xml.name=r.xml.name||c.name);let s=n.map((e=>sampleFromSchemaGeneric(r,t,e,a)));return s=handleMinMaxItems(s),c.wrapped?(_[y]=s,kt()(l)||_[y].push({_attr:l})):_=s,_}if(\"object\"===i){if(\"string\"==typeof n)return n;for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e&&v[t]&&v[t].readOnly&&!h||e&&v[t]&&v[t].writeOnly&&!g||(e&&v[t]&&v[t].xml&&v[t].xml.attribute?l[v[t].xml.name||t]=n[t]:w(t,n[t])));return kt()(l)||_[y].push({_attr:l}),_}return _[y]=kt()(l)?n:[{_attr:l},n],_}if(\"object\"===i){for(let e in v)Object.prototype.hasOwnProperty.call(v,e)&&(v[e]&&v[e].deprecated||v[e]&&v[e].readOnly&&!h||v[e]&&v[e].writeOnly&&!g||w(e));if(a&&l&&_[y].push({_attr:l}),hasExceededMaxProperties())return _;if(!0===u)a?_[y].push({additionalProp:\"Anything can be here\"}):_.additionalProp1={},b++;else if(u){const r=objectify(u),n=sampleFromSchemaGeneric(r,t,void 0,a);if(a&&r.xml&&r.xml.name&&\"notagname\"!==r.xml.name)_[y].push(n);else{const t=null!==e.minProperties&&void 0!==e.minProperties&&b<e.minProperties?e.minProperties-b:3;for(let e=1;e<=t;e++){if(hasExceededMaxProperties())return _;if(a){const t={};t[\"additionalProp\"+e]=n.notagname,_[y].push(t)}else _[\"additionalProp\"+e]=n;b++}}}return _}if(\"array\"===i){if(!d)return;let r;if(a&&(d.xml=d.xml||e?.xml||{},d.xml.name=d.xml.name||c.name),Array.isArray(d.anyOf))r=d.anyOf.map((e=>sampleFromSchemaGeneric(mergeJsonSchema(e,d,t),t,void 0,a)));else if(Array.isArray(d.oneOf))r=d.oneOf.map((e=>sampleFromSchemaGeneric(mergeJsonSchema(e,d,t),t,void 0,a)));else{if(!(!a||a&&c.wrapped))return sampleFromSchemaGeneric(d,t,void 0,a);r=[sampleFromSchemaGeneric(d,t,void 0,a)]}return r=handleMinMaxItems(r),a&&c.wrapped?(_[y]=r,kt()(l)||_[y].push({_attr:l}),_):r}let C;if(e&&Array.isArray(e.enum))C=normalizeArray(e.enum)[0];else{if(!e)return;if(C=primitive(e),\"number\"==typeof C){let t=e.minimum;null!=t&&(e.exclusiveMinimum&&t++,C=t);let r=e.maximum;null!=r&&(e.exclusiveMaximum&&r--,C=r)}if(\"string\"==typeof C&&(null!==e.maxLength&&void 0!==e.maxLength&&(C=C.slice(0,e.maxLength)),null!==e.minLength&&void 0!==e.minLength)){let t=0;for(;C.length<e.minLength;)C+=C[t++%C.length]}}if(\"file\"!==i)return a?(_[y]=kt()(l)?C:[{_attr:l},C],_):C},inferSchema=e=>(e.schema&&(e=e.schema),e.properties&&(e.type=\"object\"),e),createXMLExample=(e,t,r)=>{const a=sampleFromSchemaGeneric(e,t,r,!0);if(a)return\"string\"==typeof a?a:Ct()(a,{declaration:!0,indent:\"\\t\"})},sampleFromSchema=(e,t,r)=>sampleFromSchemaGeneric(e,t,r,!1),resolver=(e,t,r)=>[e,JSON.stringify(t),JSON.stringify(r)],Mt=utils_memoizeN(createXMLExample,resolver),Rt=utils_memoizeN(sampleFromSchema,resolver),Tt=[{when:/json/,shouldStringifyTypes:[\"string\"]}],Jt=[\"object\"],get_json_sample_schema=e=>(t,r,a,n)=>{const{fn:s}=e(),o=s.memoizedSampleFromSchema(t,r,n),l=typeof o,c=Tt.reduce(((e,t)=>t.when.test(a)?[...e,...t.shouldStringifyTypes]:e),Jt);return X()(c,(e=>e===l))?JSON.stringify(o,null,2):o},get_yaml_sample_schema=e=>(t,r,a,n)=>{const{fn:s}=e(),o=s.getJsonSampleSchema(t,r,a,n);let l;try{l=Me().dump(Me().load(o),{lineWidth:-1},{schema:Pe.JSON_SCHEMA}),\"\\n\"===l[l.length-1]&&(l=l.slice(0,l.length-1))}catch(e){return console.error(e),\"error: could not generate yaml example\"}return l.replace(/\\t/g,\"  \")},get_xml_sample_schema=e=>(t,r,a)=>{const{fn:n}=e();if(t&&!t.xml&&(t.xml={}),t&&!t.xml.name){if(!t.$$ref&&(t.type||t.items||t.properties||t.additionalProperties))return'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n\\x3c!-- XML example cannot be generated; root element name is undefined --\\x3e';if(t.$$ref){let e=t.$$ref.match(/\\S*\\/(\\S+)$/);t.xml.name=e[1]}}return n.memoizedCreateXMLExample(t,r,a)},get_sample_schema=e=>(t,r=\"\",a={},n=void 0)=>{const{fn:s}=e();return\"function\"==typeof t?.toJS&&(t=t.toJS()),\"function\"==typeof n?.toJS&&(n=n.toJS()),/xml/.test(r)?s.getXmlSampleSchema(t,a,n):/(yaml|yml)/.test(r)?s.getYamlSampleSchema(t,a,r,n):s.getJsonSampleSchema(t,a,r,n)},json_schema_5_samples=({getSystem:e})=>{const t=get_json_sample_schema(e),r=get_yaml_sample_schema(e),a=get_xml_sample_schema(e),n=get_sample_schema(e);return{fn:{jsonSchema5:{inferSchema,sampleFromSchema,sampleFromSchemaGeneric,createXMLExample,memoizedSampleFromSchema:Rt,memoizedCreateXMLExample:Mt,getJsonSampleSchema:t,getYamlSampleSchema:r,getXmlSampleSchema:a,getSampleSchema:n,mergeJsonSchema},inferSchema,sampleFromSchema,sampleFromSchemaGeneric,createXMLExample,memoizedSampleFromSchema:Rt,memoizedCreateXMLExample:Mt,getJsonSampleSchema:t,getYamlSampleSchema:r,getXmlSampleSchema:a,getSampleSchema:n,mergeJsonSchema}}},$t=require(\"lodash/constant\");var Vt=__webpack_require__.n($t);const Dt=[\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"],spec_selectors_state=e=>e||(0,N.Map)(),Kt=(0,we.createSelector)(spec_selectors_state,(e=>e.get(\"lastError\"))),Lt=(0,we.createSelector)(spec_selectors_state,(e=>e.get(\"url\"))),Ut=(0,we.createSelector)(spec_selectors_state,(e=>e.get(\"spec\")||\"\")),zt=(0,we.createSelector)(spec_selectors_state,(e=>e.get(\"specSource\")||\"not-editor\")),Bt=(0,we.createSelector)(spec_selectors_state,(e=>e.get(\"json\",(0,N.Map)()))),Ft=(0,we.createSelector)(Bt,(e=>e.toJS())),Wt=(0,we.createSelector)(spec_selectors_state,(e=>e.get(\"resolved\",(0,N.Map)()))),specResolvedSubtree=(e,t)=>e.getIn([\"resolvedSubtrees\",...t],void 0),mergerFn=(e,t)=>N.Map.isMap(e)&&N.Map.isMap(t)?t.get(\"$$ref\")?t:(0,N.OrderedMap)().mergeWith(mergerFn,e,t):t,Ht=(0,we.createSelector)(spec_selectors_state,(e=>(0,N.OrderedMap)().mergeWith(mergerFn,e.get(\"json\"),e.get(\"resolvedSubtrees\")))),spec=e=>Bt(e),Xt=(0,we.createSelector)(spec,(()=>!1)),Gt=(0,we.createSelector)(spec,(e=>returnSelfOrNewMap(e&&e.get(\"info\")))),Yt=(0,we.createSelector)(spec,(e=>returnSelfOrNewMap(e&&e.get(\"externalDocs\")))),Qt=(0,we.createSelector)(Gt,(e=>e&&e.get(\"version\"))),Zt=(0,we.createSelector)(Qt,(e=>/v?([0-9]*)\\.([0-9]*)\\.([0-9]*)/i.exec(e).slice(1))),er=(0,we.createSelector)(Ht,(e=>e.get(\"paths\"))),tr=Vt()([\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\"]),rr=(0,we.createSelector)(er,(e=>{if(!e||e.size<1)return(0,N.List)();let t=(0,N.List)();return e&&e.forEach?(e.forEach(((e,r)=>{if(!e||!e.forEach)return{};e.forEach(((e,a)=>{Dt.indexOf(a)<0||(t=t.push((0,N.fromJS)({path:r,method:a,operation:e,id:`${a}-${r}`})))}))})),t):(0,N.List)()})),ar=(0,we.createSelector)(spec,(e=>(0,N.Set)(e.get(\"consumes\")))),nr=(0,we.createSelector)(spec,(e=>(0,N.Set)(e.get(\"produces\")))),sr=(0,we.createSelector)(spec,(e=>e.get(\"security\",(0,N.List)()))),or=(0,we.createSelector)(spec,(e=>e.get(\"securityDefinitions\"))),findDefinition=(e,t)=>{const r=e.getIn([\"resolvedSubtrees\",\"definitions\",t],null),a=e.getIn([\"json\",\"definitions\",t],null);return r||a||null},lr=(0,we.createSelector)(spec,(e=>{const t=e.get(\"definitions\");return N.Map.isMap(t)?t:(0,N.Map)()})),cr=(0,we.createSelector)(spec,(e=>e.get(\"basePath\"))),ir=(0,we.createSelector)(spec,(e=>e.get(\"host\"))),pr=(0,we.createSelector)(spec,(e=>e.get(\"schemes\",(0,N.Map)()))),mr=(0,we.createSelector)([rr,ar,nr],((e,t,r)=>e.map((e=>e.update(\"operation\",(e=>{if(e){if(!N.Map.isMap(e))return;return e.withMutations((e=>(e.get(\"consumes\")||e.update(\"consumes\",(e=>(0,N.Set)(e).merge(t))),e.get(\"produces\")||e.update(\"produces\",(e=>(0,N.Set)(e).merge(r))),e)))}return(0,N.Map)()})))))),ur=(0,we.createSelector)(spec,(e=>{const t=e.get(\"tags\",(0,N.List)());return N.List.isList(t)?t.filter((e=>N.Map.isMap(e))):(0,N.List)()})),tagDetails=(e,t)=>(ur(e)||(0,N.List)()).filter(N.Map.isMap).find((e=>e.get(\"name\")===t),(0,N.Map)()),dr=(0,we.createSelector)(mr,ur,((e,t)=>e.reduce(((e,t)=>{let r=(0,N.Set)(t.getIn([\"operation\",\"tags\"]));return r.count()<1?e.update(\"default\",(0,N.List)(),(e=>e.push(t))):r.reduce(((e,r)=>e.update(r,(0,N.List)(),(e=>e.push(t)))),e)}),t.reduce(((e,t)=>e.set(t.get(\"name\"),(0,N.List)())),(0,N.OrderedMap)())))),selectors_taggedOperations=e=>({getConfigs:t})=>{let{tagsSorter:r,operationsSorter:a}=t();return dr(e).sortBy(((e,t)=>t),((e,t)=>{let a=\"function\"==typeof r?r:pe.tagsSorter[r];return a?a(e,t):null})).map(((t,r)=>{let n=\"function\"==typeof a?a:pe.operationsSorter[a],s=n?t.sort(n):t;return(0,N.Map)({tagDetails:tagDetails(e,r),operations:s})}))},hr=(0,we.createSelector)(spec_selectors_state,(e=>e.get(\"responses\",(0,N.Map)()))),gr=(0,we.createSelector)(spec_selectors_state,(e=>e.get(\"requests\",(0,N.Map)()))),yr=(0,we.createSelector)(spec_selectors_state,(e=>e.get(\"mutatedRequests\",(0,N.Map)()))),responseFor=(e,t,r)=>hr(e).getIn([t,r],null),requestFor=(e,t,r)=>gr(e).getIn([t,r],null),mutatedRequestFor=(e,t,r)=>yr(e).getIn([t,r],null),allowTryItOutFor=()=>!0,parameterWithMetaByIdentity=(e,t,r)=>{const a=Ht(e).getIn([\"paths\",...t,\"parameters\"],(0,N.OrderedMap)()),n=e.getIn([\"meta\",\"paths\",...t,\"parameters\"],(0,N.OrderedMap)());return a.map((e=>{const t=n.get(`${r.get(\"in\")}.${r.get(\"name\")}`),a=n.get(`${r.get(\"in\")}.${r.get(\"name\")}.hash-${r.hashCode()}`);return(0,N.OrderedMap)().merge(e,t,a)})).find((e=>e.get(\"in\")===r.get(\"in\")&&e.get(\"name\")===r.get(\"name\")),(0,N.OrderedMap)())},parameterInclusionSettingFor=(e,t,r,a)=>{const n=`${a}.${r}`;return e.getIn([\"meta\",\"paths\",...t,\"parameter_inclusions\",n],!1)},parameterWithMeta=(e,t,r,a)=>{const n=Ht(e).getIn([\"paths\",...t,\"parameters\"],(0,N.OrderedMap)()).find((e=>e.get(\"in\")===a&&e.get(\"name\")===r),(0,N.OrderedMap)());return parameterWithMetaByIdentity(e,t,n)},operationWithMeta=(e,t,r)=>{const a=Ht(e).getIn([\"paths\",t,r],(0,N.OrderedMap)()),n=e.getIn([\"meta\",\"paths\",t,r],(0,N.OrderedMap)()),s=a.get(\"parameters\",(0,N.List)()).map((a=>parameterWithMetaByIdentity(e,[t,r],a)));return(0,N.OrderedMap)().merge(a,n).set(\"parameters\",s)};function getParameter(e,t,r,a){return t=t||[],e.getIn([\"meta\",\"paths\",...t,\"parameters\"],(0,N.fromJS)([])).find((e=>N.Map.isMap(e)&&e.get(\"name\")===r&&e.get(\"in\")===a))||(0,N.Map)()}const fr=(0,we.createSelector)(spec,(e=>{const t=e.get(\"host\");return\"string\"==typeof t&&t.length>0&&\"/\"!==t[0]}));function parameterValues(e,t,r){return t=t||[],operationWithMeta(e,...t).get(\"parameters\",(0,N.List)()).reduce(((e,t)=>{let a=r&&\"body\"===t.get(\"in\")?t.get(\"value_xml\"):t.get(\"value\");return N.List.isList(a)&&(a=a.filter((e=>\"\"!==e))),e.set(paramToIdentifier(t,{allowHashes:!1}),a)}),(0,N.fromJS)({}))}function parametersIncludeIn(e,t=\"\"){if(N.List.isList(e))return e.some((e=>N.Map.isMap(e)&&e.get(\"in\")===t))}function parametersIncludeType(e,t=\"\"){if(N.List.isList(e))return e.some((e=>N.Map.isMap(e)&&e.get(\"type\")===t))}function contentTypeValues(e,t){t=t||[];let r=Ht(e).getIn([\"paths\",...t],(0,N.fromJS)({})),a=e.getIn([\"meta\",\"paths\",...t],(0,N.fromJS)({})),n=currentProducesFor(e,t);const s=r.get(\"parameters\")||new N.List,o=a.get(\"consumes_value\")?a.get(\"consumes_value\"):parametersIncludeType(s,\"file\")?\"multipart/form-data\":parametersIncludeType(s,\"formData\")?\"application/x-www-form-urlencoded\":void 0;return(0,N.fromJS)({requestContentType:o,responseContentType:n})}function currentProducesFor(e,t){t=t||[];const r=Ht(e).getIn([\"paths\",...t],null);if(null===r)return;const a=e.getIn([\"meta\",\"paths\",...t,\"produces_value\"],null),n=r.getIn([\"produces\",0],null);return a||n||\"application/json\"}function producesOptionsFor(e,t){t=t||[];const r=Ht(e),a=r.getIn([\"paths\",...t],null);if(null===a)return;const[n]=t,s=a.get(\"produces\",null),o=r.getIn([\"paths\",n,\"produces\"],null),l=r.getIn([\"produces\"],null);return s||o||l}function consumesOptionsFor(e,t){t=t||[];const r=Ht(e),a=r.getIn([\"paths\",...t],null);if(null===a)return;const[n]=t,s=a.get(\"consumes\",null),o=r.getIn([\"paths\",n,\"consumes\"],null),l=r.getIn([\"consumes\"],null);return s||o||l}const operationScheme=(e,t,r)=>{let a=e.get(\"url\").match(/^([a-z][a-z0-9+\\-.]*):/),n=Array.isArray(a)?a[1]:null;return e.getIn([\"scheme\",t,r])||e.getIn([\"scheme\",\"_defaultScheme\"])||n||\"\"},canExecuteScheme=(e,t,r)=>[\"http\",\"https\"].indexOf(operationScheme(e,t,r))>-1,validationErrors=(e,t)=>{t=t||[];const r=e.getIn([\"meta\",\"paths\",...t,\"parameters\"],(0,N.fromJS)([])),a=[];if(0===r.length)return a;const getErrorsWithPaths=(e,t=[])=>{const getNestedErrorsWithPaths=(e,t)=>{const r=[...t,e.get(\"propKey\")||e.get(\"index\")];return N.Map.isMap(e.get(\"error\"))?getErrorsWithPaths(e.get(\"error\"),r):{error:e.get(\"error\"),path:r}};return N.List.isList(e)?e.map((e=>N.Map.isMap(e)?getNestedErrorsWithPaths(e,t):{error:e,path:t})):getNestedErrorsWithPaths(e,t)};return r.forEach(((e,t)=>{const r=t.split(\".\").slice(1,-1).join(\".\"),n=e.get(\"errors\");if(n&&n.count()){getErrorsWithPaths(n).forEach((({error:e,path:t})=>{a.push(((e,t,r)=>`For '${r}'${(t=t.reduce(((e,t)=>\"number\"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t),\"\"))?` at path '${t}'`:\"\"}: ${e}.`)(e,t,r))}))}})),a},validateBeforeExecute=(e,t)=>0===validationErrors(e,t).length,getOAS3RequiredRequestBodyContentType=(e,t)=>{let r={requestBody:!1,requestContentType:{}},a=e.getIn([\"resolvedSubtrees\",\"paths\",...t,\"requestBody\"],(0,N.fromJS)([]));return a.size<1||(a.getIn([\"required\"])&&(r.requestBody=a.getIn([\"required\"])),a.getIn([\"content\"]).entrySeq().forEach((e=>{const t=e[0];if(e[1].getIn([\"schema\",\"required\"])){const a=e[1].getIn([\"schema\",\"required\"]).toJS();r.requestContentType[t]=a}}))),r},isMediaTypeSchemaPropertiesEqual=(e,t,r,a)=>{if((r||a)&&r===a)return!0;let n=e.getIn([\"resolvedSubtrees\",\"paths\",...t,\"requestBody\",\"content\"],(0,N.fromJS)([]));if(n.size<2||!r||!a)return!1;let s=n.getIn([r,\"schema\",\"properties\"],(0,N.fromJS)([])),o=n.getIn([a,\"schema\",\"properties\"],(0,N.fromJS)([]));return!!s.equals(o)};function returnSelfOrNewMap(e){return N.Map.isMap(e)?e:new N.Map}const Sr=require(\"lodash/isString\");var Er=__webpack_require__.n(Sr);const _r=require(\"lodash/debounce\");var vr=__webpack_require__.n(_r);const wr=require(\"lodash/set\");var br=__webpack_require__.n(wr);const Cr=require(\"lodash/fp/assocPath\");var xr=__webpack_require__.n(Cr);const Or=\"spec_update_spec\",Nr=\"spec_update_url\",kr=\"spec_update_json\",Ar=\"spec_update_param\",Ir=\"spec_update_empty_param_inclusion\",qr=\"spec_validate_param\",jr=\"spec_set_response\",Pr=\"spec_set_request\",Mr=\"spec_set_mutated_request\",Rr=\"spec_log_request\",Tr=\"spec_clear_response\",Jr=\"spec_clear_request\",$r=\"spec_clear_validate_param\",Vr=\"spec_update_operation_meta_value\",Dr=\"spec_update_resolved\",Kr=\"spec_update_resolved_subtree\",Lr=\"set_scheme\",toStr=e=>Er()(e)?e:\"\";function updateSpec(e){const t=toStr(e).replace(/\\t/g,\"  \");if(\"string\"==typeof e)return{type:Or,payload:t}}function updateResolved(e){return{type:Dr,payload:e}}function updateUrl(e){return{type:Nr,payload:e}}function updateJsonSpec(e){return{type:kr,payload:e}}const parseToJson=e=>({specActions:t,specSelectors:r,errActions:a})=>{let{specStr:n}=r,s=null;try{e=e||n(),a.clear({source:\"parser\"}),s=Me().load(e,{schema:Pe.JSON_SCHEMA})}catch(e){return console.error(e),a.newSpecErr({source:\"parser\",level:\"error\",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return s&&\"object\"==typeof s?t.updateJsonSpec(s):{}};let Ur=!1;const resolveSpec=(e,t)=>({specActions:r,specSelectors:a,errActions:n,fn:{fetch:s,resolve:o,AST:l={}},getConfigs:c})=>{Ur||(console.warn(\"specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!\"),Ur=!0);const{modelPropertyMacro:i,parameterMacro:p,requestInterceptor:m,responseInterceptor:u}=c();void 0===e&&(e=a.specJson()),void 0===t&&(t=a.url());let d=l.getLineNumberForPath?l.getLineNumberForPath:()=>{},h=a.specStr();return o({fetch:s,spec:e,baseDoc:String(new URL(t,document.baseURI)),modelPropertyMacro:i,parameterMacro:p,requestInterceptor:m,responseInterceptor:u}).then((({spec:e,errors:t})=>{if(n.clear({type:\"thrown\"}),Array.isArray(t)&&t.length>0){let e=t.map((e=>(console.error(e),e.line=e.fullPath?d(h,e.fullPath):null,e.path=e.fullPath?e.fullPath.join(\".\"):null,e.level=\"error\",e.type=\"thrown\",e.source=\"resolver\",Object.defineProperty(e,\"message\",{enumerable:!0,value:e.message}),e)));n.newThrownErrBatch(e)}return r.updateResolved(e)}))};let zr=[];const Br=vr()((()=>{const e=zr.reduce(((e,{path:t,system:r})=>(e.has(r)||e.set(r,[]),e.get(r).push(t),e)),new Map);zr=[],e.forEach((async(e,t)=>{if(!t)return void console.error(\"debResolveSubtrees: don't have a system to operate on, aborting.\");if(!t.fn.resolveSubtree)return void console.error(\"Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing.\");const{errActions:r,errSelectors:a,fn:{resolveSubtree:n,fetch:s,AST:o={}},specSelectors:l,specActions:c}=t,i=o.getLineNumberForPath??Vt()(void 0),p=l.specStr(),{modelPropertyMacro:m,parameterMacro:u,requestInterceptor:d,responseInterceptor:h}=t.getConfigs();try{const t=await e.reduce((async(e,t)=>{let{resultMap:o,specWithCurrentSubtrees:c}=await e;const{errors:g,spec:y}=await n(c,t,{baseDoc:String(new URL(l.url(),document.baseURI)),modelPropertyMacro:m,parameterMacro:u,requestInterceptor:d,responseInterceptor:h});if(a.allErrors().size&&r.clearBy((e=>\"thrown\"!==e.get(\"type\")||\"resolver\"!==e.get(\"source\")||!e.get(\"fullPath\").every(((e,r)=>e===t[r]||void 0===t[r])))),Array.isArray(g)&&g.length>0){let e=g.map((e=>(e.line=e.fullPath?i(p,e.fullPath):null,e.path=e.fullPath?e.fullPath.join(\".\"):null,e.level=\"error\",e.type=\"thrown\",e.source=\"resolver\",Object.defineProperty(e,\"message\",{enumerable:!0,value:e.message}),e)));r.newThrownErrBatch(e)}return y&&l.isOAS3()&&\"components\"===t[0]&&\"securitySchemes\"===t[1]&&await Promise.all(Object.values(y).filter((e=>\"openIdConnect\"===e.type)).map((async e=>{const t={url:e.openIdConnectUrl,requestInterceptor:d,responseInterceptor:h};try{const r=await s(t);r instanceof Error||r.status>=400?console.error(r.statusText+\" \"+t.url):e.openIdConnectData=JSON.parse(r.text)}catch(e){console.error(e)}}))),br()(o,t,y),c=xr()(t,y,c),{resultMap:o,specWithCurrentSubtrees:c}}),Promise.resolve({resultMap:(l.specResolvedSubtree([])||(0,N.Map)()).toJS(),specWithCurrentSubtrees:l.specJS()}));c.updateResolvedSubtree([],t.resultMap)}catch(e){console.error(e)}}))}),35),requestResolvedSubtree=e=>t=>{zr.find((({path:r,system:a})=>a===t&&r.toString()===e.toString()))||(zr.push({path:e,system:t}),Br())};function changeParam(e,t,r,a,n){return{type:Ar,payload:{path:e,value:a,paramName:t,paramIn:r,isXml:n}}}function changeParamByIdentity(e,t,r,a){return{type:Ar,payload:{path:e,param:t,value:r,isXml:a}}}const updateResolvedSubtree=(e,t)=>({type:Kr,payload:{path:e,value:t}}),invalidateResolvedSubtreeCache=()=>({type:Kr,payload:{path:[],value:(0,N.Map)()}}),validateParams=(e,t)=>({type:qr,payload:{pathMethod:e,isOAS3:t}}),updateEmptyParamInclusion=(e,t,r,a)=>({type:Ir,payload:{pathMethod:e,paramName:t,paramIn:r,includeEmptyValue:a}});function clearValidateParams(e){return{type:$r,payload:{pathMethod:e}}}function changeConsumesValue(e,t){return{type:Vr,payload:{path:e,value:t,key:\"consumes_value\"}}}function changeProducesValue(e,t){return{type:Vr,payload:{path:e,value:t,key:\"produces_value\"}}}const setResponse=(e,t,r)=>({payload:{path:e,method:t,res:r},type:jr}),setRequest=(e,t,r)=>({payload:{path:e,method:t,req:r},type:Pr}),setMutatedRequest=(e,t,r)=>({payload:{path:e,method:t,req:r},type:Mr}),logRequest=e=>({payload:e,type:Rr}),executeRequest=e=>({fn:t,specActions:r,specSelectors:a,getConfigs:n,oas3Selectors:s})=>{let{pathName:o,method:l,operation:c}=e,{requestInterceptor:i,responseInterceptor:p}=n(),m=c.toJS();if(c&&c.get(\"parameters\")&&c.get(\"parameters\").filter((e=>e&&!0===e.get(\"allowEmptyValue\"))).forEach((t=>{if(a.parameterInclusionSettingFor([o,l],t.get(\"name\"),t.get(\"in\"))){e.parameters=e.parameters||{};const r=paramToValue(t,e.parameters);(!r||r&&0===r.size)&&(e.parameters[t.get(\"name\")]=\"\")}})),e.contextUrl=ue()(a.url()).toString(),m&&m.operationId?e.operationId=m.operationId:m&&o&&l&&(e.operationId=t.opId(m,o,l)),a.isOAS3()){const t=`${o}:${l}`;e.server=s.selectedServer(t)||s.selectedServer();const r=s.serverVariables({server:e.server,namespace:t}).toJS(),a=s.serverVariables({server:e.server}).toJS();e.serverVariables=Object.keys(r).length?r:a,e.requestContentType=s.requestContentType(o,l),e.responseContentType=s.responseContentType(o,l)||\"*/*\";const n=s.requestBodyValue(o,l),c=s.requestBodyInclusionSetting(o,l);n&&n.toJS?e.requestBody=n.map((e=>N.Map.isMap(e)?e.get(\"value\"):e)).filter(((e,t)=>(Array.isArray(e)?0!==e.length:!isEmptyValue(e))||c.get(t))).toJS():e.requestBody=n}let u=Object.assign({},e);u=t.buildRequest(u),r.setRequest(e.pathName,e.method,u);e.requestInterceptor=async t=>{let a=await i.apply(void 0,[t]),n=Object.assign({},a);return r.setMutatedRequest(e.pathName,e.method,n),a},e.responseInterceptor=p;const d=Date.now();return t.execute(e).then((t=>{t.duration=Date.now()-d,r.setResponse(e.pathName,e.method,t)})).catch((t=>{\"Failed to fetch\"===t.message&&(t.name=\"\",t.message='**Failed to fetch.**  \\n**Possible Reasons:** \\n  - CORS \\n  - Network Failure \\n  - URL scheme must be \"http\" or \"https\" for CORS request.'),r.setResponse(e.pathName,e.method,{error:!0,err:t})}))},actions_execute=({path:e,method:t,...r}={})=>a=>{let{fn:{fetch:n},specSelectors:s,specActions:o}=a,l=s.specJsonWithResolvedSubtrees().toJS(),c=s.operationScheme(e,t),{requestContentType:i,responseContentType:p}=s.contentTypeValues([e,t]).toJS(),m=/xml/i.test(i),u=s.parameterValues([e,t],m).toJS();return o.executeRequest({...r,fetch:n,spec:l,pathName:e,method:t,parameters:u,requestContentType:i,scheme:c,responseContentType:p})};function clearResponse(e,t){return{type:Tr,payload:{path:e,method:t}}}function clearRequest(e,t){return{type:Jr,payload:{path:e,method:t}}}function setScheme(e,t,r){return{type:Lr,payload:{scheme:e,path:t,method:r}}}const Fr={[Or]:(e,t)=>\"string\"==typeof t.payload?e.set(\"spec\",t.payload):e,[Nr]:(e,t)=>e.set(\"url\",t.payload+\"\"),[kr]:(e,t)=>e.set(\"json\",fromJSOrdered(t.payload)),[Dr]:(e,t)=>e.setIn([\"resolved\"],fromJSOrdered(t.payload)),[Kr]:(e,t)=>{const{value:r,path:a}=t.payload;return e.setIn([\"resolvedSubtrees\",...a],fromJSOrdered(r))},[Ar]:(e,{payload:t})=>{let{path:r,paramName:a,paramIn:n,param:s,value:o,isXml:l}=t,c=s?paramToIdentifier(s):`${n}.${a}`;const i=l?\"value_xml\":\"value\";return e.setIn([\"meta\",\"paths\",...r,\"parameters\",c,i],(0,N.fromJS)(o))},[Ir]:(e,{payload:t})=>{let{pathMethod:r,paramName:a,paramIn:n,includeEmptyValue:s}=t;if(!a||!n)return console.warn(\"Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey.\"),e;const o=`${n}.${a}`;return e.setIn([\"meta\",\"paths\",...r,\"parameter_inclusions\",o],s)},[qr]:(e,{payload:{pathMethod:t,isOAS3:r}})=>{const a=Ht(e).getIn([\"paths\",...t]),n=parameterValues(e,t).toJS();return e.updateIn([\"meta\",\"paths\",...t,\"parameters\"],(0,N.fromJS)({}),(s=>a.get(\"parameters\",(0,N.List)()).reduce(((a,s)=>{const o=paramToValue(s,n),l=parameterInclusionSettingFor(e,t,s.get(\"name\"),s.get(\"in\")),c=((e,t,{isOAS3:r=!1,bypassRequiredCheck:a=!1}={})=>{let n=e.get(\"required\"),{schema:s,parameterContentMediaType:o}=getParameterSchema(e,{isOAS3:r});return validateValueBySchema(t,s,n,a,o)})(s,o,{bypassRequiredCheck:l,isOAS3:r});return a.setIn([paramToIdentifier(s),\"errors\"],(0,N.fromJS)(c))}),s)))},[$r]:(e,{payload:{pathMethod:t}})=>e.updateIn([\"meta\",\"paths\",...t,\"parameters\"],(0,N.fromJS)([]),(e=>e.map((e=>e.set(\"errors\",(0,N.fromJS)([])))))),[jr]:(e,{payload:{res:t,path:r,method:a}})=>{let n;n=t.error?Object.assign({error:!0,name:t.err.name,message:t.err.message,statusCode:t.err.statusCode},t.err.response):t,n.headers=n.headers||{};let s=e.setIn([\"responses\",r,a],fromJSOrdered(n));return L.Blob&&n.data instanceof L.Blob&&(s=s.setIn([\"responses\",r,a,\"text\"],n.data)),s},[Pr]:(e,{payload:{req:t,path:r,method:a}})=>e.setIn([\"requests\",r,a],fromJSOrdered(t)),[Mr]:(e,{payload:{req:t,path:r,method:a}})=>e.setIn([\"mutatedRequests\",r,a],fromJSOrdered(t)),[Vr]:(e,{payload:{path:t,value:r,key:a}})=>{let n=[\"paths\",...t],s=[\"meta\",\"paths\",...t];return e.getIn([\"json\",...n])||e.getIn([\"resolved\",...n])||e.getIn([\"resolvedSubtrees\",...n])?e.setIn([...s,a],(0,N.fromJS)(r)):e},[Tr]:(e,{payload:{path:t,method:r}})=>e.deleteIn([\"responses\",t,r]),[Jr]:(e,{payload:{path:t,method:r}})=>e.deleteIn([\"requests\",t,r]),[Lr]:(e,{payload:{scheme:t,path:r,method:a}})=>r&&a?e.setIn([\"scheme\",r,a],t):r||a?void 0:e.setIn([\"scheme\",\"_defaultScheme\"],t)},wrap_actions_updateSpec=(e,{specActions:t})=>(...r)=>{e(...r),t.parseToJson(...r)},wrap_actions_updateJsonSpec=(e,{specActions:t})=>(...r)=>{e(...r),t.invalidateResolvedSubtreeCache();const[a]=r,n=He()(a,[\"paths\"])||{};Object.keys(n).forEach((e=>{He()(n,[e]).$ref&&t.requestResolvedSubtree([\"paths\",e])})),t.requestResolvedSubtree([\"components\",\"securitySchemes\"])},wrap_actions_executeRequest=(e,{specActions:t})=>r=>(t.logRequest(r),e(r)),wrap_actions_validateParams=(e,{specSelectors:t})=>r=>e(r,t.isOAS3()),plugins_spec=()=>({statePlugins:{spec:{wrapActions:{...f},reducers:{...Fr},actions:{...y},selectors:{...g}}}}),Wr=require(\"swagger-client/es/resolver/strategies/generic\");var Hr=__webpack_require__.n(Wr);const Xr=require(\"swagger-client/es/resolver/strategies/openapi-2\");var Gr=__webpack_require__.n(Xr);const Yr=require(\"swagger-client/es/resolver/strategies/openapi-3-0\");var Qr=__webpack_require__.n(Yr);const Zr=require(\"swagger-client/es/resolver/strategies/openapi-3-1-apidom\");var ea=__webpack_require__.n(Zr);const ta=require(\"swagger-client/es/resolver\"),ra=require(\"swagger-client/es/execute\"),aa=require(\"swagger-client/es/http\");var na=__webpack_require__.n(aa);const sa=require(\"swagger-client/es/subtree-resolver\"),oa=require(\"swagger-client/es/helpers\"),configs_wrap_actions_loaded=(e,t)=>(...r)=>{e(...r);const a=t.getConfigs().withCredentials;t.fn.fetch.withCredentials=a};function swagger_client({configs:e,getConfigs:t}){return{fn:{fetch:(0,aa.makeHttp)(na(),e.preFetch,e.postFetch),buildRequest:ra.buildRequest,execute:ra.execute,resolve:(0,ta.makeResolve)({strategies:[ea(),Qr(),Gr(),Hr()]}),resolveSubtree:async(e,r,a={})=>{const n=t(),s={modelPropertyMacro:n.modelPropertyMacro,parameterMacro:n.parameterMacro,requestInterceptor:n.requestInterceptor,responseInterceptor:n.responseInterceptor,strategies:[ea(),Qr(),Gr(),Hr()]};return(0,sa.makeResolveSubtree)(s)(e,r,a)},serializeRes:aa.serializeRes,opId:oa.opId},statePlugins:{configs:{wrapActions:{loaded:configs_wrap_actions_loaded}}}}}function util(){return{fn:{shallowEqualKeys}}}const la=require(\"react-dom\");var ca=__webpack_require__.n(la);const ia=require(\"react-redux\"),pa=require(\"lodash/identity\");var ma=__webpack_require__.n(pa);const withSystem=e=>t=>{const{fn:r}=e();class WithSystem extends C.Component{render(){return x().createElement(t,et()({},e(),this.props,this.context))}}return WithSystem.displayName=`WithSystem(${r.getDisplayName(t)})`,WithSystem},withRoot=(e,t)=>r=>{const{fn:a}=e();class WithRoot extends C.Component{render(){return x().createElement(ia.Provider,{store:t},x().createElement(r,et()({},this.props,this.context)))}}return WithRoot.displayName=`WithRoot(${a.getDisplayName(r)})`,WithRoot},withConnect=(e,t,r)=>(0,O.compose)(r?withRoot(e,r):ma(),(0,ia.connect)(((r,a)=>{const n={...a,...e()},s=t.prototype?.mapStateToProps||(e=>({state:e}));return s(r,n)})),withSystem(e))(t),handleProps=(e,t,r,a)=>{for(const n in t){const s=t[n];\"function\"==typeof s&&s(r[n],a[n],e())}},withMappedContainer=(e,t,r)=>(t,a)=>{const{fn:n}=e(),s=r(t,\"root\");class WithMappedContainer extends C.Component{constructor(t,r){super(t,r),handleProps(e,a,t,{})}UNSAFE_componentWillReceiveProps(t){handleProps(e,a,t,this.props)}render(){const e=Ie()(this.props,a?Object.keys(a):[]);return x().createElement(s,e)}}return WithMappedContainer.displayName=`WithMappedContainer(${n.getDisplayName(s)})`,WithMappedContainer},render=(e,t,r,a)=>n=>{const s=r(e,t,a)(\"App\",\"root\"),{createRoot:o}=ca();o(n).render(x().createElement(s,null))},getComponent=(e,t,r)=>(a,n,s={})=>{if(\"string\"!=typeof a)throw new TypeError(\"Need a string, to fetch a component. Was given a \"+typeof a);const o=r(a);return o?n?\"root\"===n?withConnect(e,o,t()):withConnect(e,o):o:(s.failSilently||e().log.warn(\"Could not find component:\",a),null)},getDisplayName=e=>e.displayName||e.name||\"Component\",view=({getComponents:e,getStore:t,getSystem:r})=>{const a=(n=getComponent(r,t,e),ie(n,((...e)=>JSON.stringify(e))));var n;const s=(e=>utils_memoizeN(e,((...e)=>e)))(withMappedContainer(r,0,a));return{rootInjects:{getComponent:a,makeMappedContainer:s,render:render(r,t,getComponent,e)},fn:{getDisplayName}}},view_legacy=({React:e,getSystem:t,getStore:r,getComponents:a})=>{const n={},s=parseInt(e?.version,10);return s>=16&&s<18&&(n.render=((e,t,r,a)=>n=>{const s=r(e,t,a)(\"App\",\"root\");ca().render(x().createElement(s,null),n)})(t,r,getComponent,a)),{rootInjects:n}};function downloadUrlPlugin(e){let{fn:t}=e;const r={download:e=>({errActions:r,specSelectors:a,specActions:n,getConfigs:s})=>{let{fetch:o}=t;const l=s();function next(t){if(t instanceof Error||t.status>=400)return n.updateLoadingStatus(\"failed\"),r.newThrownErr(Object.assign(new Error((t.message||t.statusText)+\" \"+e),{source:\"fetch\"})),void(!t.status&&t instanceof Error&&function checkPossibleFailReasons(){try{let t;if(\"URL\"in L?t=new URL(e):(t=document.createElement(\"a\"),t.href=e),\"https:\"!==t.protocol&&\"https:\"===L.location.protocol){const e=Object.assign(new Error(`Possible mixed-content issue? The page was loaded over https:// but a ${t.protocol}// URL was specified. Check that you are not attempting to load mixed content.`),{source:\"fetch\"});return void r.newThrownErr(e)}if(t.origin!==L.location.origin){const e=Object.assign(new Error(`Possible cross-origin (CORS) issue? The URL origin (${t.origin}) does not match the page (${L.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`),{source:\"fetch\"});r.newThrownErr(e)}}catch(e){return}}());n.updateLoadingStatus(\"success\"),n.updateSpec(t.text),a.url()!==e&&n.updateUrl(e)}e=e||a.url(),n.updateLoadingStatus(\"loading\"),r.clear({source:\"fetch\"}),o({url:e,loadSpec:!0,requestInterceptor:l.requestInterceptor||(e=>e),responseInterceptor:l.responseInterceptor||(e=>e),credentials:\"same-origin\",headers:{Accept:\"application/json,*/*\"}}).then(next,next)},updateLoadingStatus:e=>{let t=[null,\"loading\",\"failed\",\"success\",\"failedConfig\"];return-1===t.indexOf(e)&&console.error(`Error: ${e} is not one of ${JSON.stringify(t)}`),{type:\"spec_update_loading_status\",payload:e}}};let a={loadingStatus:(0,we.createSelector)((e=>e||(0,N.Map)()),(e=>e.get(\"loadingStatus\")||null))};return{statePlugins:{spec:{actions:r,reducers:{spec_update_loading_status:(e,t)=>\"string\"==typeof t.payload?e.set(\"loadingStatus\",t.payload):e},selectors:a}}}}const ua=require(\"react-syntax-highlighter/dist/esm/light\");var da=__webpack_require__.n(ua);const ha=require(\"react-syntax-highlighter/dist/esm/languages/hljs/javascript\");var ga=__webpack_require__.n(ha);const ya=require(\"react-syntax-highlighter/dist/esm/languages/hljs/json\");var fa=__webpack_require__.n(ya);const Sa=require(\"react-syntax-highlighter/dist/esm/languages/hljs/xml\");var Ea=__webpack_require__.n(Sa);const _a=require(\"react-syntax-highlighter/dist/esm/languages/hljs/bash\");var va=__webpack_require__.n(_a);const wa=require(\"react-syntax-highlighter/dist/esm/languages/hljs/yaml\");var ba=__webpack_require__.n(wa);const Ca=require(\"react-syntax-highlighter/dist/esm/languages/hljs/http\");var xa=__webpack_require__.n(Ca);const Oa=require(\"react-syntax-highlighter/dist/esm/languages/hljs/powershell\");var Na=__webpack_require__.n(Oa);const after_load=()=>{da().registerLanguage(\"json\",fa()),da().registerLanguage(\"js\",ga()),da().registerLanguage(\"xml\",Ea()),da().registerLanguage(\"yaml\",ba()),da().registerLanguage(\"http\",xa()),da().registerLanguage(\"bash\",va()),da().registerLanguage(\"powershell\",Na()),da().registerLanguage(\"javascript\",ga())},ka=require(\"react-syntax-highlighter/dist/esm/styles/hljs/agate\");var Aa=__webpack_require__.n(ka);const Ia=require(\"react-syntax-highlighter/dist/esm/styles/hljs/arta\");var qa=__webpack_require__.n(Ia);const ja=require(\"react-syntax-highlighter/dist/esm/styles/hljs/monokai\");var Pa=__webpack_require__.n(ja);const Ma=require(\"react-syntax-highlighter/dist/esm/styles/hljs/nord\");var Ra=__webpack_require__.n(Ma);const Ta=require(\"react-syntax-highlighter/dist/esm/styles/hljs/obsidian\");var Ja=__webpack_require__.n(Ta);const $a=require(\"react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night\");var Va=__webpack_require__.n($a);const Da=require(\"react-syntax-highlighter/dist/esm/styles/hljs/idea\");var Ka=__webpack_require__.n(Da);const La={agate:Aa(),arta:qa(),monokai:Pa(),nord:Ra(),obsidian:Ja(),\"tomorrow-night\":Va(),idea:Ka()},Ua=Aa(),components_SyntaxHighlighter=({language:e,className:t=\"\",getConfigs:r,syntaxHighlighting:a={},children:n=\"\"})=>{const s=r().syntaxHighlight.theme,{styles:o,defaultStyle:l}=a,c=o?.[s]??l;return x().createElement(da(),{language:e,className:t,style:c},n)},za=require(\"js-file-download\");var Ba=__webpack_require__.n(za);const components_HighlightCode=({fileName:e=\"response.txt\",className:t,downloadable:r,getComponent:a,canCopy:n,language:s,children:o})=>{const l=(0,C.useRef)(null),c=a(\"SyntaxHighlighter\",!0),handlePreventYScrollingBeyondElement=e=>{const{target:t,deltaY:r}=e,{scrollHeight:a,offsetHeight:n,scrollTop:s}=t;a>n&&(0===s&&r<0||n+s>=a&&r>0)&&e.preventDefault()};return(0,C.useEffect)((()=>{const e=Array.from(l.current.childNodes).filter((e=>!!e.nodeType&&e.classList.contains(\"microlight\")));return e.forEach((e=>e.addEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement,{passive:!1}))),()=>{e.forEach((e=>e.removeEventListener(\"mousewheel\",handlePreventYScrollingBeyondElement)))}}),[o,t,s]),x().createElement(\"div\",{className:\"highlight-code\",ref:l},n&&x().createElement(\"div\",{className:\"copy-to-clipboard\"},x().createElement(dt.CopyToClipboard,{text:o},x().createElement(\"button\",null))),r?x().createElement(\"button\",{className:\"download-contents\",onClick:()=>{Ba()(o,e)}},\"Download\"):null,x().createElement(c,{language:s,className:ut()(t,\"microlight\"),renderPlainText:({children:e,PlainTextViewer:r})=>x().createElement(r,{className:t},e)},o))},components_PlainTextViewer=({className:e=\"\",children:t})=>x().createElement(\"pre\",{className:ut()(\"microlight\",e)},t),wrap_components_SyntaxHighlighter=(e,t)=>({renderPlainText:r,children:a,...n})=>{const s=t.getConfigs().syntaxHighlight.activated,o=t.getComponent(\"PlainTextViewer\");return s||\"function\"!=typeof r?s?x().createElement(e,n,a):x().createElement(o,null,a):r({children:a,PlainTextViewer:o})},SyntaxHighlightingPlugin1=()=>({afterLoad:after_load,rootInjects:{syntaxHighlighting:{styles:La,defaultStyle:Ua}},components:{SyntaxHighlighter:components_SyntaxHighlighter,HighlightCode:components_HighlightCode,PlainTextViewer:components_PlainTextViewer}}),SyntaxHighlightingPlugin2=()=>({wrapComponents:{SyntaxHighlighter:wrap_components_SyntaxHighlighter}}),syntax_highlighting=()=>[SyntaxHighlightingPlugin1,SyntaxHighlightingPlugin2],versions_after_load=()=>{const{GIT_DIRTY:e,GIT_COMMIT:t,PACKAGE_VERSION:r,BUILD_TIME:a}={PACKAGE_VERSION:\"5.17.14\",GIT_COMMIT:\"g8aa52920\",GIT_DIRTY:!0,BUILD_TIME:\"Tue, 28 May 2024 05:23:41 GMT\"};L.versions=L.versions||{},L.versions.swaggerUI={version:r,gitRevision:t,gitDirty:e,buildTimestamp:a}},versions=()=>({afterLoad:versions_after_load}),Fa=require(\"lodash/zipObject\");var Wa=__webpack_require__.n(Fa);const Ha=console.error,withErrorBoundary=e=>t=>{const{getComponent:r,fn:a}=e(),n=r(\"ErrorBoundary\"),s=a.getDisplayName(t);class WithErrorBoundary extends C.Component{render(){return x().createElement(n,{targetName:s,getComponent:r,fn:a},x().createElement(t,et()({},this.props,this.context)))}}var o;return WithErrorBoundary.displayName=`WithErrorBoundary(${s})`,(o=t).prototype&&o.prototype.isReactComponent&&(WithErrorBoundary.prototype.mapStateToProps=t.prototype.mapStateToProps),WithErrorBoundary},fallback=({name:e})=>x().createElement(\"div\",{className:\"fallback\"},\"😱 \",x().createElement(\"i\",null,\"Could not render \",\"t\"===e?\"this component\":e,\", see the console.\"));class ErrorBoundary extends C.Component{static defaultProps={targetName:\"this component\",getComponent:()=>fallback,fn:{componentDidCatch:Ha},children:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}constructor(...e){super(...e),this.state={hasError:!1,error:null}}componentDidCatch(e,t){this.props.fn.componentDidCatch(e,t)}render(){const{getComponent:e,targetName:t,children:r}=this.props;if(this.state.hasError){const r=e(\"Fallback\");return x().createElement(r,{name:t})}return r}}const Xa=ErrorBoundary,safe_render=({componentList:e=[],fullOverride:t=!1}={})=>({getSystem:r})=>{const a=t?e:[\"App\",\"BaseLayout\",\"VersionPragmaFilter\",\"InfoContainer\",\"ServersContainer\",\"SchemesContainer\",\"AuthorizeBtnContainer\",\"FilterContainer\",\"Operations\",\"OperationContainer\",\"parameters\",\"responses\",\"OperationServers\",\"Models\",\"ModelWrapper\",...e],n=Wa()(a,Array(a.length).fill(((e,{fn:t})=>t.withErrorBoundary(e))));return{fn:{componentDidCatch:Ha,withErrorBoundary:withErrorBoundary(r)},components:{ErrorBoundary:Xa,Fallback:fallback},wrapComponents:n}};class App extends x().Component{getLayout(){const{getComponent:e,layoutSelectors:t}=this.props,r=t.current(),a=e(r,!0);return a||(()=>x().createElement(\"h1\",null,' No layout defined for \"',r,'\" '))}render(){const e=this.getLayout();return x().createElement(e,null)}}const Ga=App;class AuthorizationPopup extends x().Component{close=()=>{let{authActions:e}=this.props;e.showDefinitions(!1)};render(){let{authSelectors:e,authActions:t,getComponent:r,errSelectors:a,specSelectors:n,fn:{AST:s={}}}=this.props,o=e.shownDefinitions();const l=r(\"auths\"),c=r(\"CloseIcon\");return x().createElement(\"div\",{className:\"dialog-ux\"},x().createElement(\"div\",{className:\"backdrop-ux\"}),x().createElement(\"div\",{className:\"modal-ux\"},x().createElement(\"div\",{className:\"modal-dialog-ux\"},x().createElement(\"div\",{className:\"modal-ux-inner\"},x().createElement(\"div\",{className:\"modal-ux-header\"},x().createElement(\"h3\",null,\"Available authorizations\"),x().createElement(\"button\",{type:\"button\",className:\"close-modal\",onClick:this.close},x().createElement(c,null))),x().createElement(\"div\",{className:\"modal-ux-content\"},o.valueSeq().map(((o,c)=>x().createElement(l,{key:c,AST:s,definitions:o,getComponent:r,errSelectors:a,authSelectors:e,authActions:t,specSelectors:n}))))))))}}class AuthorizeBtn extends x().Component{render(){let{isAuthorized:e,showPopup:t,onClick:r,getComponent:a}=this.props;const n=a(\"authorizationPopup\",!0),s=a(\"LockAuthIcon\",!0),o=a(\"UnlockAuthIcon\",!0);return x().createElement(\"div\",{className:\"auth-wrapper\"},x().createElement(\"button\",{className:e?\"btn authorize locked\":\"btn authorize unlocked\",onClick:r},x().createElement(\"span\",null,\"Authorize\"),e?x().createElement(s,null):x().createElement(o,null)),t&&x().createElement(n,null))}}class AuthorizeBtnContainer extends x().Component{render(){const{authActions:e,authSelectors:t,specSelectors:r,getComponent:a}=this.props,n=r.securityDefinitions(),s=t.definitionsToAuthorize(),o=a(\"authorizeBtn\");return n?x().createElement(o,{onClick:()=>e.showDefinitions(s),isAuthorized:!!t.authorized().size,showPopup:!!t.shownDefinitions(),getComponent:a}):null}}class AuthorizeOperationBtn extends x().Component{onClick=e=>{e.stopPropagation();let{onClick:t}=this.props;t&&t()};render(){let{isAuthorized:e,getComponent:t}=this.props;const r=t(\"LockAuthOperationIcon\",!0),a=t(\"UnlockAuthOperationIcon\",!0);return x().createElement(\"button\",{className:\"authorization__btn\",\"aria-label\":e?\"authorization button locked\":\"authorization button unlocked\",onClick:this.onClick},e?x().createElement(r,{className:\"locked\"}):x().createElement(a,{className:\"unlocked\"}))}}class Auths extends x().Component{constructor(e,t){super(e,t),this.state={}}onAuthChange=e=>{let{name:t}=e;this.setState({[t]:e})};submitAuth=e=>{e.preventDefault();let{authActions:t}=this.props;t.authorizeWithPersistOption(this.state)};logoutClick=e=>{e.preventDefault();let{authActions:t,definitions:r}=this.props,a=r.map(((e,t)=>t)).toArray();this.setState(a.reduce(((e,t)=>(e[t]=\"\",e)),{})),t.logoutWithPersistOption(a)};close=e=>{e.preventDefault();let{authActions:t}=this.props;t.showDefinitions(!1)};render(){let{definitions:e,getComponent:t,authSelectors:r,errSelectors:a}=this.props;const n=t(\"AuthItem\"),s=t(\"oauth2\",!0),o=t(\"Button\");let l=r.authorized(),c=e.filter(((e,t)=>!!l.get(t))),i=e.filter((e=>\"oauth2\"!==e.get(\"type\"))),p=e.filter((e=>\"oauth2\"===e.get(\"type\")));return x().createElement(\"div\",{className:\"auth-container\"},!!i.size&&x().createElement(\"form\",{onSubmit:this.submitAuth},i.map(((e,r)=>x().createElement(n,{key:r,schema:e,name:r,getComponent:t,onAuthChange:this.onAuthChange,authorized:l,errSelectors:a}))).toArray(),x().createElement(\"div\",{className:\"auth-btn-wrapper\"},i.size===c.size?x().createElement(o,{className:\"btn modal-btn auth\",onClick:this.logoutClick,\"aria-label\":\"Remove authorization\"},\"Logout\"):x().createElement(o,{type:\"submit\",className:\"btn modal-btn auth authorize\",\"aria-label\":\"Apply credentials\"},\"Authorize\"),x().createElement(o,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\"))),p&&p.size?x().createElement(\"div\",null,x().createElement(\"div\",{className:\"scope-def\"},x().createElement(\"p\",null,\"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\"),x().createElement(\"p\",null,\"API requires the following scopes. Select which ones you want to grant to Swagger UI.\")),e.filter((e=>\"oauth2\"===e.get(\"type\"))).map(((e,t)=>x().createElement(\"div\",{key:t},x().createElement(s,{authorized:l,schema:e,name:t})))).toArray()):null)}}class auth_item_Auths extends x().Component{render(){let{schema:e,name:t,getComponent:r,onAuthChange:a,authorized:n,errSelectors:s}=this.props;const o=r(\"apiKeyAuth\"),l=r(\"basicAuth\");let c;const i=e.get(\"type\");switch(i){case\"apiKey\":c=x().createElement(o,{key:t,schema:e,name:t,errSelectors:s,authorized:n,getComponent:r,onChange:a});break;case\"basic\":c=x().createElement(l,{key:t,schema:e,name:t,errSelectors:s,authorized:n,getComponent:r,onChange:a});break;default:c=x().createElement(\"div\",{key:t},\"Unknown security definition type \",i)}return x().createElement(\"div\",{key:`${t}-jump`},c)}}class AuthError extends x().Component{render(){let{error:e}=this.props,t=e.get(\"level\"),r=e.get(\"message\"),a=e.get(\"source\");return x().createElement(\"div\",{className:\"errors\"},x().createElement(\"b\",null,a,\" \",t),x().createElement(\"span\",null,r))}}class ApiKeyAuth extends x().Component{constructor(e,t){super(e,t);let{name:r,schema:a}=this.props,n=this.getValue();this.state={name:r,schema:a,value:n}}getValue(){let{name:e,authorized:t}=this.props;return t&&t.getIn([e,\"value\"])}onChange=e=>{let{onChange:t}=this.props,r=e.target.value,a=Object.assign({},this.state,{value:r});this.setState(a),t(a)};render(){let{schema:e,getComponent:t,errSelectors:r,name:a}=this.props;const n=t(\"Input\"),s=t(\"Row\"),o=t(\"Col\"),l=t(\"authError\"),c=t(\"Markdown\",!0),i=t(\"JumpToPath\",!0);let p=this.getValue(),m=r.allErrors().filter((e=>e.get(\"authId\")===a));return x().createElement(\"div\",null,x().createElement(\"h4\",null,x().createElement(\"code\",null,a||e.get(\"name\")),\" (apiKey)\",x().createElement(i,{path:[\"securityDefinitions\",a]})),p&&x().createElement(\"h6\",null,\"Authorized\"),x().createElement(s,null,x().createElement(c,{source:e.get(\"description\")})),x().createElement(s,null,x().createElement(\"p\",null,\"Name: \",x().createElement(\"code\",null,e.get(\"name\")))),x().createElement(s,null,x().createElement(\"p\",null,\"In: \",x().createElement(\"code\",null,e.get(\"in\")))),x().createElement(s,null,x().createElement(\"label\",{htmlFor:\"api_key_value\"},\"Value:\"),p?x().createElement(\"code\",null,\" ****** \"):x().createElement(o,null,x().createElement(n,{id:\"api_key_value\",type:\"text\",onChange:this.onChange,autoFocus:!0}))),m.valueSeq().map(((e,t)=>x().createElement(l,{error:e,key:t}))))}}class BasicAuth extends x().Component{constructor(e,t){super(e,t);let{schema:r,name:a}=this.props,n=this.getValue().username;this.state={name:a,schema:r,value:n?{username:n}:{}}}getValue(){let{authorized:e,name:t}=this.props;return e&&e.getIn([t,\"value\"])||{}}onChange=e=>{let{onChange:t}=this.props,{value:r,name:a}=e.target,n=this.state.value;n[a]=r,this.setState({value:n}),t(this.state)};render(){let{schema:e,getComponent:t,name:r,errSelectors:a}=this.props;const n=t(\"Input\"),s=t(\"Row\"),o=t(\"Col\"),l=t(\"authError\"),c=t(\"JumpToPath\",!0),i=t(\"Markdown\",!0);let p=this.getValue().username,m=a.allErrors().filter((e=>e.get(\"authId\")===r));return x().createElement(\"div\",null,x().createElement(\"h4\",null,\"Basic authorization\",x().createElement(c,{path:[\"securityDefinitions\",r]})),p&&x().createElement(\"h6\",null,\"Authorized\"),x().createElement(s,null,x().createElement(i,{source:e.get(\"description\")})),x().createElement(s,null,x().createElement(\"label\",{htmlFor:\"auth_username\"},\"Username:\"),p?x().createElement(\"code\",null,\" \",p,\" \"):x().createElement(o,null,x().createElement(n,{id:\"auth_username\",type:\"text\",required:\"required\",name:\"username\",onChange:this.onChange,autoFocus:!0}))),x().createElement(s,null,x().createElement(\"label\",{htmlFor:\"auth_password\"},\"Password:\"),p?x().createElement(\"code\",null,\" ****** \"):x().createElement(o,null,x().createElement(n,{id:\"auth_password\",autoComplete:\"new-password\",name:\"password\",type:\"password\",onChange:this.onChange}))),m.valueSeq().map(((e,t)=>x().createElement(l,{error:e,key:t}))))}}function Example(e){const{example:t,showValue:r,getComponent:a}=e,n=a(\"Markdown\",!0),s=a(\"HighlightCode\",!0);return t?x().createElement(\"div\",{className:\"example\"},t.get(\"description\")?x().createElement(\"section\",{className:\"example__section\"},x().createElement(\"div\",{className:\"example__section-header\"},\"Example Description\"),x().createElement(\"p\",null,x().createElement(n,{source:t.get(\"description\")}))):null,r&&t.has(\"value\")?x().createElement(\"section\",{className:\"example__section\"},x().createElement(\"div\",{className:\"example__section-header\"},\"Example Value\"),x().createElement(s,null,stringify(t.get(\"value\")))):null):null}class ExamplesSelect extends x().PureComponent{static defaultProps={examples:k().Map({}),onSelect:(...e)=>console.log(\"DEBUG: ExamplesSelect was not given an onSelect callback\",...e),currentExampleKey:null,showLabels:!0};_onSelect=(e,{isSyntheticChange:t=!1}={})=>{\"function\"==typeof this.props.onSelect&&this.props.onSelect(e,{isSyntheticChange:t})};_onDomSelect=e=>{if(\"function\"==typeof this.props.onSelect){const t=e.target.selectedOptions[0].getAttribute(\"value\");this._onSelect(t,{isSyntheticChange:!1})}};getCurrentExample=()=>{const{examples:e,currentExampleKey:t}=this.props,r=e.get(t),a=e.keySeq().first(),n=e.get(a);return r||n||Map({})};componentDidMount(){const{onSelect:e,examples:t}=this.props;if(\"function\"==typeof e){const e=t.first(),r=t.keyOf(e);this._onSelect(r,{isSyntheticChange:!0})}}UNSAFE_componentWillReceiveProps(e){const{currentExampleKey:t,examples:r}=e;if(r!==this.props.examples&&!r.has(t)){const e=r.first(),t=r.keyOf(e);this._onSelect(t,{isSyntheticChange:!0})}}render(){const{examples:e,currentExampleKey:t,isValueModified:r,isModifiedValueAvailable:a,showLabels:n}=this.props;return x().createElement(\"div\",{className:\"examples-select\"},n?x().createElement(\"span\",{className:\"examples-select__section-label\"},\"Examples: \"):null,x().createElement(\"select\",{className:\"examples-select-element\",onChange:this._onDomSelect,value:a&&r?\"__MODIFIED__VALUE__\":t||\"\"},a?x().createElement(\"option\",{value:\"__MODIFIED__VALUE__\"},\"[Modified value]\"):null,e.map(((e,t)=>x().createElement(\"option\",{key:t,value:t},e.get(\"summary\")||t))).valueSeq()))}}const stringifyUnlessList=e=>N.List.isList(e)?e:stringify(e);class ExamplesSelectValueRetainer extends x().PureComponent{static defaultProps={userHasEditedBody:!1,examples:(0,N.Map)({}),currentNamespace:\"__DEFAULT__NAMESPACE__\",setRetainRequestBodyValueFlag:()=>{},onSelect:(...e)=>console.log(\"ExamplesSelectValueRetainer: no `onSelect` function was provided\",...e),updateValue:(...e)=>console.log(\"ExamplesSelectValueRetainer: no `updateValue` function was provided\",...e)};constructor(e){super(e);const t=this._getCurrentExampleValue();this.state={[e.currentNamespace]:(0,N.Map)({lastUserEditedValue:this.props.currentUserInputValue,lastDownstreamValue:t,isModifiedValueSelected:this.props.userHasEditedBody||this.props.currentUserInputValue!==t})}}componentWillUnmount(){this.props.setRetainRequestBodyValueFlag(!1)}_getStateForCurrentNamespace=()=>{const{currentNamespace:e}=this.props;return(this.state[e]||(0,N.Map)()).toObject()};_setStateForCurrentNamespace=e=>{const{currentNamespace:t}=this.props;return this._setStateForNamespace(t,e)};_setStateForNamespace=(e,t)=>{const r=(this.state[e]||(0,N.Map)()).mergeDeep(t);return this.setState({[e]:r})};_isCurrentUserInputSameAsExampleValue=()=>{const{currentUserInputValue:e}=this.props;return this._getCurrentExampleValue()===e};_getValueForExample=(e,t)=>{const{examples:r}=t||this.props;return stringifyUnlessList((r||(0,N.Map)({})).getIn([e,\"value\"]))};_getCurrentExampleValue=e=>{const{currentKey:t}=e||this.props;return this._getValueForExample(t,e||this.props)};_onExamplesSelect=(e,{isSyntheticChange:t}={},...r)=>{const{onSelect:a,updateValue:n,currentUserInputValue:s,userHasEditedBody:o}=this.props,{lastUserEditedValue:l}=this._getStateForCurrentNamespace(),c=this._getValueForExample(e);if(\"__MODIFIED__VALUE__\"===e)return n(stringifyUnlessList(l)),this._setStateForCurrentNamespace({isModifiedValueSelected:!0});\"function\"==typeof a&&a(e,{isSyntheticChange:t},...r),this._setStateForCurrentNamespace({lastDownstreamValue:c,isModifiedValueSelected:t&&o||!!s&&s!==c}),t||\"function\"==typeof n&&n(stringifyUnlessList(c))};UNSAFE_componentWillReceiveProps(e){const{currentUserInputValue:t,examples:r,onSelect:a,userHasEditedBody:n}=e,{lastUserEditedValue:s,lastDownstreamValue:o}=this._getStateForCurrentNamespace(),l=this._getValueForExample(e.currentKey,e),c=r.filter((e=>e.get(\"value\")===t||stringify(e.get(\"value\"))===t));if(c.size){let t;t=c.has(e.currentKey)?e.currentKey:c.keySeq().first(),a(t,{isSyntheticChange:!0})}else t!==this.props.currentUserInputValue&&t!==s&&t!==o&&(this.props.setRetainRequestBodyValueFlag(!0),this._setStateForNamespace(e.currentNamespace,{lastUserEditedValue:e.currentUserInputValue,isModifiedValueSelected:n||t!==l}))}render(){const{currentUserInputValue:e,examples:t,currentKey:r,getComponent:a,userHasEditedBody:n}=this.props,{lastDownstreamValue:s,lastUserEditedValue:o,isModifiedValueSelected:l}=this._getStateForCurrentNamespace(),c=a(\"ExamplesSelect\");return x().createElement(c,{examples:t,currentExampleKey:r,onSelect:this._onExamplesSelect,isModifiedValueAvailable:!!o&&o!==s,isValueModified:void 0!==e&&l&&e!==this._getCurrentExampleValue()||n})}}function oauth2_authorize_authorize({auth:e,authActions:t,errActions:r,configs:a,authConfigs:n={},currentServer:s}){let{schema:o,scopes:l,name:c,clientId:i}=e,p=o.get(\"flow\"),m=[];switch(p){case\"password\":return void t.authorizePassword(e);case\"application\":case\"clientCredentials\":case\"client_credentials\":return void t.authorizeApplication(e);case\"accessCode\":case\"authorizationCode\":case\"authorization_code\":m.push(\"response_type=code\");break;case\"implicit\":m.push(\"response_type=token\")}\"string\"==typeof i&&m.push(\"client_id=\"+encodeURIComponent(i));let u=a.oauth2RedirectUrl;if(void 0===u)return void r.newAuthErr({authId:c,source:\"validation\",level:\"error\",message:\"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed.\"});m.push(\"redirect_uri=\"+encodeURIComponent(u));let d=[];if(Array.isArray(l)?d=l:k().List.isList(l)&&(d=l.toArray()),d.length>0){let e=n.scopeSeparator||\" \";m.push(\"scope=\"+encodeURIComponent(d.join(e)))}let h=btoa(new Date);if(m.push(\"state=\"+encodeURIComponent(h)),void 0!==n.realm&&m.push(\"realm=\"+encodeURIComponent(n.realm)),(\"authorizationCode\"===p||\"authorization_code\"===p||\"accessCode\"===p)&&n.usePkceWithAuthorizationCodeGrant){const t=function generateCodeVerifier(){return b64toB64UrlEncoded(ae()(32).toString(\"base64\"))}(),r=function createCodeChallenge(e){return b64toB64UrlEncoded(se()(\"sha256\").update(e).digest(\"base64\"))}(t);m.push(\"code_challenge=\"+r),m.push(\"code_challenge_method=S256\"),e.codeVerifier=t}let{additionalQueryStringParams:g}=n;for(let e in g)void 0!==g[e]&&m.push([e,g[e]].map(encodeURIComponent).join(\"=\"));const y=o.get(\"authorizationUrl\");let f;f=s?ue()(sanitizeUrl(y),s,!0).toString():sanitizeUrl(y);let S,E=[f,m.join(\"&\")].join(-1===y.indexOf(\"?\")?\"?\":\"&\");S=\"implicit\"===p?t.preAuthorizeImplicit:n.useBasicAuthenticationWithAccessCodeGrant?t.authorizeAccessCodeWithBasicAuthentication:t.authorizeAccessCodeWithFormParams,t.authPopup(E,{auth:e,state:h,redirectUrl:u,callback:S,errCb:r.newAuthErr})}class Oauth2 extends x().Component{constructor(e,t){super(e,t);let{name:r,schema:a,authorized:n,authSelectors:s}=this.props,o=n&&n.get(r),l=s.getConfigs()||{},c=o&&o.get(\"username\")||\"\",i=o&&o.get(\"clientId\")||l.clientId||\"\",p=o&&o.get(\"clientSecret\")||l.clientSecret||\"\",m=o&&o.get(\"passwordType\")||\"basic\",u=o&&o.get(\"scopes\")||l.scopes||[];\"string\"==typeof u&&(u=u.split(l.scopeSeparator||\" \")),this.state={appName:l.appName,name:r,schema:a,scopes:u,clientId:i,clientSecret:p,username:c,password:\"\",passwordType:m}}close=e=>{e.preventDefault();let{authActions:t}=this.props;t.showDefinitions(!1)};authorize=()=>{let{authActions:e,errActions:t,getConfigs:r,authSelectors:a,oas3Selectors:n}=this.props,s=r(),o=a.getConfigs();t.clear({authId:name,type:\"auth\",source:\"auth\"}),oauth2_authorize_authorize({auth:this.state,currentServer:n.serverEffectiveValue(n.selectedServer()),authActions:e,errActions:t,configs:s,authConfigs:o})};onScopeChange=e=>{let{target:t}=e,{checked:r}=t,a=t.dataset.value;if(r&&-1===this.state.scopes.indexOf(a)){let e=this.state.scopes.concat([a]);this.setState({scopes:e})}else!r&&this.state.scopes.indexOf(a)>-1&&this.setState({scopes:this.state.scopes.filter((e=>e!==a))})};onInputChange=e=>{let{target:{dataset:{name:t},value:r}}=e,a={[t]:r};this.setState(a)};selectScopes=e=>{e.target.dataset.all?this.setState({scopes:Array.from((this.props.schema.get(\"allowedScopes\")||this.props.schema.get(\"scopes\")).keys())}):this.setState({scopes:[]})};logout=e=>{e.preventDefault();let{authActions:t,errActions:r,name:a}=this.props;r.clear({authId:a,type:\"auth\",source:\"auth\"}),t.logoutWithPersistOption([a])};render(){let{schema:e,getComponent:t,authSelectors:r,errSelectors:a,name:n,specSelectors:s}=this.props;const o=t(\"Input\"),l=t(\"Row\"),c=t(\"Col\"),i=t(\"Button\"),p=t(\"authError\"),m=t(\"JumpToPath\",!0),u=t(\"Markdown\",!0),d=t(\"InitializedInput\"),{isOAS3:h}=s;let g=h()?e.get(\"openIdConnectUrl\"):null;const y=\"implicit\",f=\"password\",S=h()?g?\"authorization_code\":\"authorizationCode\":\"accessCode\",E=h()?g?\"client_credentials\":\"clientCredentials\":\"application\";let _=!!(r.getConfigs()||{}).usePkceWithAuthorizationCodeGrant,v=e.get(\"flow\"),w=v===S&&_?v+\" with PKCE\":v,b=e.get(\"allowedScopes\")||e.get(\"scopes\"),C=!!r.authorized().get(n),O=a.allErrors().filter((e=>e.get(\"authId\")===n)),N=!O.filter((e=>\"validation\"===e.get(\"source\"))).size,k=e.get(\"description\");return x().createElement(\"div\",null,x().createElement(\"h4\",null,n,\" (OAuth2, \",w,\") \",x().createElement(m,{path:[\"securityDefinitions\",n]})),this.state.appName?x().createElement(\"h5\",null,\"Application: \",this.state.appName,\" \"):null,k&&x().createElement(u,{source:e.get(\"description\")}),C&&x().createElement(\"h6\",null,\"Authorized\"),g&&x().createElement(\"p\",null,\"OpenID Connect URL: \",x().createElement(\"code\",null,g)),(v===y||v===S)&&x().createElement(\"p\",null,\"Authorization URL: \",x().createElement(\"code\",null,e.get(\"authorizationUrl\"))),(v===f||v===S||v===E)&&x().createElement(\"p\",null,\"Token URL:\",x().createElement(\"code\",null,\" \",e.get(\"tokenUrl\"))),x().createElement(\"p\",{className:\"flow\"},\"Flow: \",x().createElement(\"code\",null,w)),v!==f?null:x().createElement(l,null,x().createElement(l,null,x().createElement(\"label\",{htmlFor:\"oauth_username\"},\"username:\"),C?x().createElement(\"code\",null,\" \",this.state.username,\" \"):x().createElement(c,{tablet:10,desktop:10},x().createElement(\"input\",{id:\"oauth_username\",type:\"text\",\"data-name\":\"username\",onChange:this.onInputChange,autoFocus:!0}))),x().createElement(l,null,x().createElement(\"label\",{htmlFor:\"oauth_password\"},\"password:\"),C?x().createElement(\"code\",null,\" ****** \"):x().createElement(c,{tablet:10,desktop:10},x().createElement(\"input\",{id:\"oauth_password\",type:\"password\",\"data-name\":\"password\",onChange:this.onInputChange}))),x().createElement(l,null,x().createElement(\"label\",{htmlFor:\"password_type\"},\"Client credentials location:\"),C?x().createElement(\"code\",null,\" \",this.state.passwordType,\" \"):x().createElement(c,{tablet:10,desktop:10},x().createElement(\"select\",{id:\"password_type\",\"data-name\":\"passwordType\",onChange:this.onInputChange},x().createElement(\"option\",{value:\"basic\"},\"Authorization header\"),x().createElement(\"option\",{value:\"request-body\"},\"Request body\"))))),(v===E||v===y||v===S||v===f)&&(!C||C&&this.state.clientId)&&x().createElement(l,null,x().createElement(\"label\",{htmlFor:`client_id_${v}`},\"client_id:\"),C?x().createElement(\"code\",null,\" ****** \"):x().createElement(c,{tablet:10,desktop:10},x().createElement(d,{id:`client_id_${v}`,type:\"text\",required:v===f,initialValue:this.state.clientId,\"data-name\":\"clientId\",onChange:this.onInputChange}))),(v===E||v===S||v===f)&&x().createElement(l,null,x().createElement(\"label\",{htmlFor:`client_secret_${v}`},\"client_secret:\"),C?x().createElement(\"code\",null,\" ****** \"):x().createElement(c,{tablet:10,desktop:10},x().createElement(d,{id:`client_secret_${v}`,initialValue:this.state.clientSecret,type:\"password\",\"data-name\":\"clientSecret\",onChange:this.onInputChange}))),!C&&b&&b.size?x().createElement(\"div\",{className:\"scopes\"},x().createElement(\"h2\",null,\"Scopes:\",x().createElement(\"a\",{onClick:this.selectScopes,\"data-all\":!0},\"select all\"),x().createElement(\"a\",{onClick:this.selectScopes},\"select none\")),b.map(((e,t)=>x().createElement(l,{key:t},x().createElement(\"div\",{className:\"checkbox\"},x().createElement(o,{\"data-value\":t,id:`${t}-${v}-checkbox-${this.state.name}`,disabled:C,checked:this.state.scopes.includes(t),type:\"checkbox\",onChange:this.onScopeChange}),x().createElement(\"label\",{htmlFor:`${t}-${v}-checkbox-${this.state.name}`},x().createElement(\"span\",{className:\"item\"}),x().createElement(\"div\",{className:\"text\"},x().createElement(\"p\",{className:\"name\"},t),x().createElement(\"p\",{className:\"description\"},e))))))).toArray()):null,O.valueSeq().map(((e,t)=>x().createElement(p,{error:e,key:t}))),x().createElement(\"div\",{className:\"auth-btn-wrapper\"},N&&(C?x().createElement(i,{className:\"btn modal-btn auth authorize\",onClick:this.logout,\"aria-label\":\"Remove authorization\"},\"Logout\"):x().createElement(i,{className:\"btn modal-btn auth authorize\",onClick:this.authorize,\"aria-label\":\"Apply given OAuth2 credentials\"},\"Authorize\")),x().createElement(i,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\")))}}class Clear extends C.Component{onClick=()=>{let{specActions:e,path:t,method:r}=this.props;e.clearResponse(t,r),e.clearRequest(t,r)};render(){return x().createElement(\"button\",{className:\"btn btn-clear opblock-control__btn\",onClick:this.onClick},\"Clear\")}}const Headers=({headers:e})=>x().createElement(\"div\",null,x().createElement(\"h5\",null,\"Response headers\"),x().createElement(\"pre\",{className:\"microlight\"},e)),Duration=({duration:e})=>x().createElement(\"div\",null,x().createElement(\"h5\",null,\"Request duration\"),x().createElement(\"pre\",{className:\"microlight\"},e,\" ms\"));class LiveResponse extends x().Component{shouldComponentUpdate(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}render(){const{response:e,getComponent:t,getConfigs:r,displayRequestDuration:a,specSelectors:n,path:s,method:o}=this.props,{showMutatedRequest:l,requestSnippetsEnabled:c}=r(),i=l?n.mutatedRequestFor(s,o):n.requestFor(s,o),p=e.get(\"status\"),m=i.get(\"url\"),u=e.get(\"headers\").toJS(),d=e.get(\"notDocumented\"),h=e.get(\"error\"),g=e.get(\"text\"),y=e.get(\"duration\"),f=Object.keys(u),S=u[\"content-type\"]||u[\"Content-Type\"],E=t(\"responseBody\"),_=f.map((e=>{var t=Array.isArray(u[e])?u[e].join():u[e];return x().createElement(\"span\",{className:\"headerline\",key:e},\" \",e,\": \",t,\" \")})),v=0!==_.length,w=t(\"Markdown\",!0),b=t(\"RequestSnippets\",!0),C=t(\"curl\",!0);return x().createElement(\"div\",null,i&&c?x().createElement(b,{request:i}):x().createElement(C,{request:i}),m&&x().createElement(\"div\",null,x().createElement(\"div\",{className:\"request-url\"},x().createElement(\"h4\",null,\"Request URL\"),x().createElement(\"pre\",{className:\"microlight\"},m))),x().createElement(\"h4\",null,\"Server response\"),x().createElement(\"table\",{className:\"responses-table live-responses-table\"},x().createElement(\"thead\",null,x().createElement(\"tr\",{className:\"responses-header\"},x().createElement(\"td\",{className:\"col_header response-col_status\"},\"Code\"),x().createElement(\"td\",{className:\"col_header response-col_description\"},\"Details\"))),x().createElement(\"tbody\",null,x().createElement(\"tr\",{className:\"response\"},x().createElement(\"td\",{className:\"response-col_status\"},p,d?x().createElement(\"div\",{className:\"response-undocumented\"},x().createElement(\"i\",null,\" Undocumented \")):null),x().createElement(\"td\",{className:\"response-col_description\"},h?x().createElement(w,{source:`${\"\"!==e.get(\"name\")?`${e.get(\"name\")}: `:\"\"}${e.get(\"message\")}`}):null,g?x().createElement(E,{content:g,contentType:S,url:m,headers:u,getConfigs:r,getComponent:t}):null,v?x().createElement(Headers,{headers:_}):null,a&&y?x().createElement(Duration,{duration:y}):null)))))}}class OnlineValidatorBadge extends x().Component{constructor(e,t){super(e,t);let{getConfigs:r}=e,{validatorUrl:a}=r();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===a?\"https://validator.swagger.io/validator\":a}}getDefinitionUrl=()=>{let{specSelectors:e}=this.props;return new(ue())(e.url(),L.location).toString()};UNSAFE_componentWillReceiveProps(e){let{getConfigs:t}=e,{validatorUrl:r}=t();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===r?\"https://validator.swagger.io/validator\":r})}render(){let{getConfigs:e}=this.props,{spec:t}=e(),r=sanitizeUrl(this.state.validatorUrl);return\"object\"==typeof t&&Object.keys(t).length?null:this.state.url&&requiresValidationURL(this.state.validatorUrl)&&requiresValidationURL(this.state.url)?x().createElement(\"span\",{className:\"float-right\"},x().createElement(\"a\",{target:\"_blank\",rel:\"noopener noreferrer\",href:`${r}/debug?url=${encodeURIComponent(this.state.url)}`},x().createElement(ValidatorImage,{src:`${r}?url=${encodeURIComponent(this.state.url)}`,alt:\"Online validator badge\"}))):null}}class ValidatorImage extends x().Component{constructor(e){super(e),this.state={loaded:!1,error:!1}}componentDidMount(){const e=new Image;e.onload=()=>{this.setState({loaded:!0})},e.onerror=()=>{this.setState({error:!0})},e.src=this.props.src}UNSAFE_componentWillReceiveProps(e){if(e.src!==this.props.src){const t=new Image;t.onload=()=>{this.setState({loaded:!0})},t.onerror=()=>{this.setState({error:!0})},t.src=e.src}}render(){return this.state.error?x().createElement(\"img\",{alt:\"Error\"}):this.state.loaded?x().createElement(\"img\",{src:this.props.src,alt:this.props.alt}):null}}class Operations extends x().Component{render(){let{specSelectors:e}=this.props;const t=e.taggedOperations();return 0===t.size?x().createElement(\"h3\",null,\" No operations defined in spec!\"):x().createElement(\"div\",null,t.map(this.renderOperationTag).toArray(),t.size<1?x().createElement(\"h3\",null,\" No operations defined in spec! \"):null)}renderOperationTag=(e,t)=>{const{specSelectors:r,getComponent:a,oas3Selectors:n,layoutSelectors:s,layoutActions:o,getConfigs:l}=this.props,c=r.validOperationMethods(),i=a(\"OperationContainer\",!0),p=a(\"OperationTag\"),m=e.get(\"operations\");return x().createElement(p,{key:\"operation-\"+t,tagObj:e,tag:t,oas3Selectors:n,layoutSelectors:s,layoutActions:o,getConfigs:l,getComponent:a,specUrl:r.url()},x().createElement(\"div\",{className:\"operation-tag-content\"},m.map((e=>{const r=e.get(\"path\"),a=e.get(\"method\"),n=k().List([\"paths\",r,a]);return-1===c.indexOf(a)?null:x().createElement(i,{key:`${r}-${a}`,specPath:n,op:e,path:r,method:a,tag:t})})).toArray()))}}function isAbsoluteUrl(e){return e.match(/^(?:[a-z]+:)?\\/\\//i)}function buildBaseUrl(e,t){return e?isAbsoluteUrl(e)?function addProtocol(e){return e.match(/^\\/\\//i)?`${window.location.protocol}${e}`:e}(e):new URL(e,t).href:t}function safeBuildUrl(e,t,{selectedServer:r=\"\"}={}){try{return function buildUrl(e,t,{selectedServer:r=\"\"}={}){if(!e)return;if(isAbsoluteUrl(e))return e;const a=buildBaseUrl(r,t);return isAbsoluteUrl(a)?new URL(e,a).href:new URL(e,window.location.href).href}(e,t,{selectedServer:r})}catch{return}}class OperationTag extends x().Component{static defaultProps={tagObj:k().fromJS({}),tag:\"\"};render(){const{tagObj:e,tag:t,children:r,oas3Selectors:a,layoutSelectors:n,layoutActions:s,getConfigs:o,getComponent:l,specUrl:c}=this.props;let{docExpansion:i,deepLinking:p}=o();const m=l(\"Collapse\"),u=l(\"Markdown\",!0),d=l(\"DeepLink\"),h=l(\"Link\"),g=l(\"ArrowUpIcon\"),y=l(\"ArrowDownIcon\");let f,S=e.getIn([\"tagDetails\",\"description\"],null),E=e.getIn([\"tagDetails\",\"externalDocs\",\"description\"]),_=e.getIn([\"tagDetails\",\"externalDocs\",\"url\"]);f=isFunc(a)&&isFunc(a.selectedServer)?safeBuildUrl(_,c,{selectedServer:a.selectedServer()}):_;let v=[\"operations-tag\",t],w=n.isShown(v,\"full\"===i||\"list\"===i);return x().createElement(\"div\",{className:w?\"opblock-tag-section is-open\":\"opblock-tag-section\"},x().createElement(\"h3\",{onClick:()=>s.show(v,!w),className:S?\"opblock-tag\":\"opblock-tag no-desc\",id:v.map((e=>escapeDeepLinkPath(e))).join(\"-\"),\"data-tag\":t,\"data-is-open\":w},x().createElement(d,{enabled:p,isShown:w,path:createDeepLinkPath(t),text:t}),S?x().createElement(\"small\",null,x().createElement(u,{source:S})):x().createElement(\"small\",null),f?x().createElement(\"div\",{className:\"info__externaldocs\"},x().createElement(\"small\",null,x().createElement(h,{href:sanitizeUrl(f),onClick:e=>e.stopPropagation(),target:\"_blank\"},E||f))):null,x().createElement(\"button\",{\"aria-expanded\":w,className:\"expand-operation\",title:w?\"Collapse operation\":\"Expand operation\",onClick:()=>s.show(v,!w)},w?x().createElement(g,{className:\"arrow\"}):x().createElement(y,{className:\"arrow\"}))),x().createElement(m,{isOpened:w},r))}}class Operation extends C.PureComponent{static defaultProps={operation:null,response:null,request:null,specPath:(0,N.List)(),summary:\"\"};render(){let{specPath:e,response:t,request:r,toggleShown:a,onTryoutClick:n,onResetClick:s,onCancelClick:o,onExecute:l,fn:c,getComponent:i,getConfigs:p,specActions:m,specSelectors:u,authActions:d,authSelectors:h,oas3Actions:g,oas3Selectors:y}=this.props,f=this.props.operation,{deprecated:S,isShown:E,path:_,method:v,op:w,tag:b,operationId:C,allowTryItOut:O,displayRequestDuration:N,tryItOutEnabled:A,executeInProgress:I}=f.toJS(),{description:q,externalDocs:j,schemes:P}=w;const M=j?safeBuildUrl(j.url,u.url(),{selectedServer:y.selectedServer()}):\"\";let R=f.getIn([\"op\"]),T=R.get(\"responses\"),J=function getList(e,t){if(!k().Iterable.isIterable(e))return k().List();let r=e.getIn(Array.isArray(t)?t:[t]);return k().List.isList(r)?r:k().List()}(R,[\"parameters\"]),$=u.operationScheme(_,v),V=[\"operations\",b,C],D=getExtensions(R);const K=i(\"responses\"),L=i(\"parameters\"),U=i(\"execute\"),z=i(\"clear\"),B=i(\"Collapse\"),F=i(\"Markdown\",!0),W=i(\"schemes\"),H=i(\"OperationServers\"),X=i(\"OperationExt\"),G=i(\"OperationSummary\"),Y=i(\"Link\"),{showExtensions:Q}=p();if(T&&t&&t.size>0){let e=!T.get(String(t.get(\"status\")))&&!T.get(\"default\");t=t.set(\"notDocumented\",e)}let Z=[_,v];const ee=u.validationErrors([_,v]);return x().createElement(\"div\",{className:S?\"opblock opblock-deprecated\":E?`opblock opblock-${v} is-open`:`opblock opblock-${v}`,id:escapeDeepLinkPath(V.join(\"-\"))},x().createElement(G,{operationProps:f,isShown:E,toggleShown:a,getComponent:i,authActions:d,authSelectors:h,specPath:e}),x().createElement(B,{isOpened:E},x().createElement(\"div\",{className:\"opblock-body\"},R&&R.size||null===R?null:x().createElement(rolling_load,{height:\"32px\",width:\"32px\",className:\"opblock-loading-animation\"}),S&&x().createElement(\"h4\",{className:\"opblock-title_normal\"},\" Warning: Deprecated\"),q&&x().createElement(\"div\",{className:\"opblock-description-wrapper\"},x().createElement(\"div\",{className:\"opblock-description\"},x().createElement(F,{source:q}))),M?x().createElement(\"div\",{className:\"opblock-external-docs-wrapper\"},x().createElement(\"h4\",{className:\"opblock-title_normal\"},\"Find more details\"),x().createElement(\"div\",{className:\"opblock-external-docs\"},j.description&&x().createElement(\"span\",{className:\"opblock-external-docs__description\"},x().createElement(F,{source:j.description})),x().createElement(Y,{target:\"_blank\",className:\"opblock-external-docs__link\",href:sanitizeUrl(M)},M))):null,R&&R.size?x().createElement(L,{parameters:J,specPath:e.push(\"parameters\"),operation:R,onChangeKey:Z,onTryoutClick:n,onResetClick:s,onCancelClick:o,tryItOutEnabled:A,allowTryItOut:O,fn:c,getComponent:i,specActions:m,specSelectors:u,pathMethod:[_,v],getConfigs:p,oas3Actions:g,oas3Selectors:y}):null,A?x().createElement(H,{getComponent:i,path:_,method:v,operationServers:R.get(\"servers\"),pathServers:u.paths().getIn([_,\"servers\"]),getSelectedServer:y.selectedServer,setSelectedServer:g.setSelectedServer,setServerVariableValue:g.setServerVariableValue,getServerVariable:y.serverVariableValue,getEffectiveServerValue:y.serverEffectiveValue}):null,A&&O&&P&&P.size?x().createElement(\"div\",{className:\"opblock-schemes\"},x().createElement(W,{schemes:P,path:_,method:v,specActions:m,currentScheme:$})):null,!A||!O||ee.length<=0?null:x().createElement(\"div\",{className:\"validation-errors errors-wrapper\"},\"Please correct the following validation errors and try again.\",x().createElement(\"ul\",null,ee.map(((e,t)=>x().createElement(\"li\",{key:t},\" \",e,\" \"))))),x().createElement(\"div\",{className:A&&t&&O?\"btn-group\":\"execute-wrapper\"},A&&O?x().createElement(U,{operation:R,specActions:m,specSelectors:u,oas3Selectors:y,oas3Actions:g,path:_,method:v,onExecute:l,disabled:I}):null,A&&t&&O?x().createElement(z,{specActions:m,path:_,method:v}):null),I?x().createElement(\"div\",{className:\"loading-container\"},x().createElement(\"div\",{className:\"loading\"})):null,T?x().createElement(K,{responses:T,request:r,tryItOutResponse:t,getComponent:i,getConfigs:p,specSelectors:u,oas3Actions:g,oas3Selectors:y,specActions:m,produces:u.producesOptionsFor([_,v]),producesValue:u.currentProducesFor([_,v]),specPath:e.push(\"responses\"),path:_,method:v,displayRequestDuration:N,fn:c}):null,Q&&D.size?x().createElement(X,{extensions:D,getComponent:i}):null)))}}class OperationContainer extends C.PureComponent{constructor(e,t){super(e,t);const{tryItOutEnabled:r}=e.getConfigs();this.state={tryItOutEnabled:r,executeInProgress:!1}}static defaultProps={showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1};mapStateToProps(e,t){const{op:r,layoutSelectors:a,getConfigs:n}=t,{docExpansion:s,deepLinking:o,displayOperationId:l,displayRequestDuration:c,supportedSubmitMethods:i}=n(),p=a.showSummary(),m=r.getIn([\"operation\",\"__originalOperationId\"])||r.getIn([\"operation\",\"operationId\"])||(0,oa.opId)(r.get(\"operation\"),t.path,t.method)||r.get(\"id\"),u=[\"operations\",t.tag,m],d=i.indexOf(t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),h=r.getIn([\"operation\",\"security\"])||t.specSelectors.security();return{operationId:m,isDeepLinkingEnabled:o,showSummary:p,displayOperationId:l,displayRequestDuration:c,allowTryItOut:d,security:h,isAuthorized:t.authSelectors.isAuthorized(h),isShown:a.isShown(u,\"full\"===s),jumpToKey:`paths.${t.path}.${t.method}`,response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}componentDidMount(){const{isShown:e}=this.props,t=this.getResolvedSubtree();e&&void 0===t&&this.requestResolvedSubtree()}UNSAFE_componentWillReceiveProps(e){const{response:t,isShown:r}=e,a=this.getResolvedSubtree();t!==this.props.response&&this.setState({executeInProgress:!1}),r&&void 0===a&&this.requestResolvedSubtree()}toggleShown=()=>{let{layoutActions:e,tag:t,operationId:r,isShown:a}=this.props;const n=this.getResolvedSubtree();a||void 0!==n||this.requestResolvedSubtree(),e.show([\"operations\",t,r],!a)};onCancelClick=()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})};onTryoutClick=()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})};onResetClick=e=>{const t=this.props.oas3Selectors.selectDefaultRequestBodyValue(...e);this.props.oas3Actions.setRequestBodyValue({value:t,pathMethod:e})};onExecute=()=>{this.setState({executeInProgress:!0})};getResolvedSubtree=()=>{const{specSelectors:e,path:t,method:r,specPath:a}=this.props;return a?e.specResolvedSubtree(a.toJS()):e.specResolvedSubtree([\"paths\",t,r])};requestResolvedSubtree=()=>{const{specActions:e,path:t,method:r,specPath:a}=this.props;return a?e.requestResolvedSubtree(a.toJS()):e.requestResolvedSubtree([\"paths\",t,r])};render(){let{op:e,tag:t,path:r,method:a,security:n,isAuthorized:s,operationId:o,showSummary:l,isShown:c,jumpToKey:i,allowTryItOut:p,response:m,request:u,displayOperationId:d,displayRequestDuration:h,isDeepLinkingEnabled:g,specPath:y,specSelectors:f,specActions:S,getComponent:E,getConfigs:_,layoutSelectors:v,layoutActions:w,authActions:b,authSelectors:C,oas3Actions:O,oas3Selectors:k,fn:A}=this.props;const I=E(\"operation\"),q=this.getResolvedSubtree()||(0,N.Map)(),j=(0,N.fromJS)({op:q,tag:t,path:r,summary:e.getIn([\"operation\",\"summary\"])||\"\",deprecated:q.get(\"deprecated\")||e.getIn([\"operation\",\"deprecated\"])||!1,method:a,security:n,isAuthorized:s,operationId:o,originalOperationId:q.getIn([\"operation\",\"__originalOperationId\"]),showSummary:l,isShown:c,jumpToKey:i,allowTryItOut:p,request:u,displayOperationId:d,displayRequestDuration:h,isDeepLinkingEnabled:g,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return x().createElement(I,{operation:j,response:m,request:u,isShown:c,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onResetClick:this.onResetClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:y,specActions:S,specSelectors:f,oas3Actions:O,oas3Selectors:k,layoutActions:w,layoutSelectors:v,authActions:b,authSelectors:C,getComponent:E,getConfigs:_,fn:A})}}const Ya=require(\"lodash/toString\");var Qa=__webpack_require__.n(Ya);class OperationSummary extends C.PureComponent{static defaultProps={operationProps:null,specPath:(0,N.List)(),summary:\"\"};render(){let{isShown:e,toggleShown:t,getComponent:r,authActions:a,authSelectors:n,operationProps:s,specPath:o}=this.props,{summary:l,isAuthorized:c,method:i,op:p,showSummary:m,path:u,operationId:d,originalOperationId:h,displayOperationId:g}=s.toJS(),{summary:y}=p,f=s.get(\"security\");const S=r(\"authorizeOperationBtn\",!0),E=r(\"OperationSummaryMethod\"),_=r(\"OperationSummaryPath\"),v=r(\"JumpToPath\",!0),w=r(\"CopyToClipboardBtn\",!0),b=r(\"ArrowUpIcon\"),C=r(\"ArrowDownIcon\"),O=f&&!!f.count(),N=O&&1===f.size&&f.first().isEmpty(),k=!O||N;return x().createElement(\"div\",{className:`opblock-summary opblock-summary-${i}`},x().createElement(\"button\",{\"aria-expanded\":e,className:\"opblock-summary-control\",onClick:t},x().createElement(E,{method:i}),x().createElement(\"div\",{className:\"opblock-summary-path-description-wrapper\"},x().createElement(_,{getComponent:r,operationProps:s,specPath:o}),m?x().createElement(\"div\",{className:\"opblock-summary-description\"},Qa()(y||l)):null),g&&(h||d)?x().createElement(\"span\",{className:\"opblock-summary-operation-id\"},h||d):null),x().createElement(w,{textToCopy:`${o.get(1)}`}),k?null:x().createElement(S,{isAuthorized:c,onClick:()=>{const e=n.definitionsForRequirements(f);a.showDefinitions(e)}}),x().createElement(v,{path:o}),x().createElement(\"button\",{\"aria-label\":`${i} ${u.replace(/\\//g,\"​/\")}`,className:\"opblock-control-arrow\",\"aria-expanded\":e,tabIndex:\"-1\",onClick:t},e?x().createElement(b,{className:\"arrow\"}):x().createElement(C,{className:\"arrow\"})))}}class OperationSummaryMethod extends C.PureComponent{static defaultProps={operationProps:null};render(){let{method:e}=this.props;return x().createElement(\"span\",{className:\"opblock-summary-method\"},e.toUpperCase())}}class OperationSummaryPath extends C.PureComponent{render(){let{getComponent:e,operationProps:t}=this.props,{deprecated:r,isShown:a,path:n,tag:s,operationId:o,isDeepLinkingEnabled:l}=t.toJS();const c=n.split(/(?=\\/)/g);for(let e=1;e<c.length;e+=2)c.splice(e,0,x().createElement(\"wbr\",{key:e}));const i=e(\"DeepLink\");return x().createElement(\"span\",{className:r?\"opblock-summary-path__deprecated\":\"opblock-summary-path\",\"data-path\":n},x().createElement(i,{enabled:l,isShown:a,path:createDeepLinkPath(`${s}/${o}`),text:c}))}}const operation_extensions=({extensions:e,getComponent:t})=>{let r=t(\"OperationExtRow\");return x().createElement(\"div\",{className:\"opblock-section\"},x().createElement(\"div\",{className:\"opblock-section-header\"},x().createElement(\"h4\",null,\"Extensions\")),x().createElement(\"div\",{className:\"table-container\"},x().createElement(\"table\",null,x().createElement(\"thead\",null,x().createElement(\"tr\",null,x().createElement(\"td\",{className:\"col_header\"},\"Field\"),x().createElement(\"td\",{className:\"col_header\"},\"Value\"))),x().createElement(\"tbody\",null,e.entrySeq().map((([e,t])=>x().createElement(r,{key:`${e}-${t}`,xKey:e,xVal:t})))))))},operation_extension_row=({xKey:e,xVal:t})=>{const r=t?t.toJS?t.toJS():t:null;return x().createElement(\"tr\",null,x().createElement(\"td\",null,e),x().createElement(\"td\",null,JSON.stringify(r)))};function createHtmlReadyId(e,t=\"_\"){return e.replace(/[^\\w-]/g,t)}class Responses extends x().Component{static defaultProps={tryItOutResponse:null,produces:(0,N.fromJS)([\"application/json\"]),displayRequestDuration:!1};onChangeProducesWrapper=e=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],e);onResponseContentTypeChange=({controlsAcceptHeader:e,value:t})=>{const{oas3Actions:r,path:a,method:n}=this.props;e&&r.setResponseContentType({value:t,path:a,method:n})};render(){let{responses:e,tryItOutResponse:t,getComponent:r,getConfigs:a,specSelectors:n,fn:s,producesValue:o,displayRequestDuration:l,specPath:c,path:i,method:p,oas3Selectors:m,oas3Actions:u}=this.props,d=function defaultStatusCode(e){let t=e.keySeq();return t.contains(ce)?ce:t.filter((e=>\"2\"===(e+\"\")[0])).sort().first()}(e);const h=r(\"contentType\"),g=r(\"liveResponse\"),y=r(\"response\");let f=this.props.produces&&this.props.produces.size?this.props.produces:Responses.defaultProps.produces;const S=n.isOAS3()?function getAcceptControllingResponse(e){if(!k().OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;const t=e.find(((e,t)=>t.startsWith(\"2\")&&Object.keys(e.get(\"content\")||{}).length>0)),r=e.get(\"default\")||k().OrderedMap(),a=(r.get(\"content\")||k().OrderedMap()).keySeq().toJS().length?r:null;return t||a}(e):null,E=createHtmlReadyId(`${p}${i}_responses`),_=`${E}_select`;return x().createElement(\"div\",{className:\"responses-wrapper\"},x().createElement(\"div\",{className:\"opblock-section-header\"},x().createElement(\"h4\",null,\"Responses\"),n.isOAS3()?null:x().createElement(\"label\",{htmlFor:_},x().createElement(\"span\",null,\"Response content type\"),x().createElement(h,{value:o,ariaControls:E,ariaLabel:\"Response content type\",className:\"execute-content-type\",contentTypes:f,controlId:_,onChange:this.onChangeProducesWrapper}))),x().createElement(\"div\",{className:\"responses-inner\"},t?x().createElement(\"div\",null,x().createElement(g,{response:t,getComponent:r,getConfigs:a,specSelectors:n,path:this.props.path,method:this.props.method,displayRequestDuration:l}),x().createElement(\"h4\",null,\"Responses\")):null,x().createElement(\"table\",{\"aria-live\":\"polite\",className:\"responses-table\",id:E,role:\"region\"},x().createElement(\"thead\",null,x().createElement(\"tr\",{className:\"responses-header\"},x().createElement(\"td\",{className:\"col_header response-col_status\"},\"Code\"),x().createElement(\"td\",{className:\"col_header response-col_description\"},\"Description\"),n.isOAS3()?x().createElement(\"td\",{className:\"col col_header response-col_links\"},\"Links\"):null)),x().createElement(\"tbody\",null,e.entrySeq().map((([e,l])=>{let h=t&&t.get(\"status\")==e?\"response_current\":\"\";return x().createElement(y,{key:e,path:i,method:p,specPath:c.push(e),isDefault:d===e,fn:s,className:h,code:e,response:l,specSelectors:n,controlsAcceptHeader:l===S,onContentTypeChange:this.onResponseContentTypeChange,contentType:o,getConfigs:a,activeExamplesKey:m.activeExamplesMember(i,p,\"responses\",e),oas3Actions:u,getComponent:r})})).toArray()))))}}function getKnownSyntaxHighlighterLanguage(e){return function canJsonParse(e){try{return!!JSON.parse(e)}catch(e){return null}}(e)?\"json\":null}class Response extends x().Component{constructor(e,t){super(e,t),this.state={responseContentType:\"\"}}static defaultProps={response:(0,N.fromJS)({}),onContentTypeChange:()=>{}};_onContentTypeChange=e=>{const{onContentTypeChange:t,controlsAcceptHeader:r}=this.props;this.setState({responseContentType:e}),t({value:e,controlsAcceptHeader:r})};getTargetExamplesKey=()=>{const{response:e,contentType:t,activeExamplesKey:r}=this.props,a=this.state.responseContentType||t,n=e.getIn([\"content\",a],(0,N.Map)({})).get(\"examples\",null).keySeq().first();return r||n};render(){let{path:e,method:t,code:r,response:a,className:n,specPath:s,fn:o,getComponent:l,getConfigs:c,specSelectors:i,contentType:p,controlsAcceptHeader:m,oas3Actions:u}=this.props,{inferSchema:d,getSampleSchema:h}=o,g=i.isOAS3();const{showExtensions:y}=c();let f=y?getExtensions(a):null,S=a.get(\"headers\"),E=a.get(\"links\");const _=l(\"ResponseExtension\"),v=l(\"headers\"),w=l(\"HighlightCode\",!0),b=l(\"modelExample\"),C=l(\"Markdown\",!0),O=l(\"operationLink\"),k=l(\"contentType\"),A=l(\"ExamplesSelect\"),I=l(\"Example\");var q,j;const P=this.state.responseContentType||p,M=a.getIn([\"content\",P],(0,N.Map)({})),R=M.get(\"examples\",null);if(g){const e=M.get(\"schema\");q=e?d(e.toJS()):null,j=e?(0,N.List)([\"content\",this.state.responseContentType,\"schema\"]):s}else q=a.get(\"schema\"),j=a.has(\"schema\")?s.push(\"schema\"):s;let T,J,$=!1,V={includeReadOnly:!0};if(g)if(J=M.get(\"schema\")?.toJS(),N.Map.isMap(R)&&!R.isEmpty()){const e=this.getTargetExamplesKey(),getMediaTypeExample=e=>e.get(\"value\");T=getMediaTypeExample(R.get(e,(0,N.Map)({}))),void 0===T&&(T=getMediaTypeExample(R.values().next().value)),$=!0}else void 0!==M.get(\"example\")&&(T=M.get(\"example\"),$=!0);else{J=q,V={...V,includeWriteOnly:!0};const e=a.getIn([\"examples\",P]);e&&(T=e,$=!0)}const D=((e,t)=>{if(null==e)return null;const r=getKnownSyntaxHighlighterLanguage(e)?\"json\":null;return x().createElement(\"div\",null,x().createElement(t,{className:\"example\",language:r},stringify(e)))})(h(J,P,V,$?T:void 0),w);return x().createElement(\"tr\",{className:\"response \"+(n||\"\"),\"data-code\":r},x().createElement(\"td\",{className:\"response-col_status\"},r),x().createElement(\"td\",{className:\"response-col_description\"},x().createElement(\"div\",{className:\"response-col_description__inner\"},x().createElement(C,{source:a.get(\"description\")})),y&&f.size?f.entrySeq().map((([e,t])=>x().createElement(_,{key:`${e}-${t}`,xKey:e,xVal:t}))):null,g&&a.get(\"content\")?x().createElement(\"section\",{className:\"response-controls\"},x().createElement(\"div\",{className:ut()(\"response-control-media-type\",{\"response-control-media-type--accept-controller\":m})},x().createElement(\"small\",{className:\"response-control-media-type__title\"},\"Media type\"),x().createElement(k,{value:this.state.responseContentType,contentTypes:a.get(\"content\")?a.get(\"content\").keySeq():(0,N.Seq)(),onChange:this._onContentTypeChange,ariaLabel:\"Media Type\"}),m?x().createElement(\"small\",{className:\"response-control-media-type__accept-message\"},\"Controls \",x().createElement(\"code\",null,\"Accept\"),\" header.\"):null),N.Map.isMap(R)&&!R.isEmpty()?x().createElement(\"div\",{className:\"response-control-examples\"},x().createElement(\"small\",{className:\"response-control-examples__title\"},\"Examples\"),x().createElement(A,{examples:R,currentExampleKey:this.getTargetExamplesKey(),onSelect:a=>u.setActiveExamplesMember({name:a,pathMethod:[e,t],contextType:\"responses\",contextName:r}),showLabels:!1})):null):null,D||q?x().createElement(b,{specPath:j,getComponent:l,getConfigs:c,specSelectors:i,schema:fromJSOrdered(q),example:D,includeReadOnly:!0}):null,g&&R?x().createElement(I,{example:R.get(this.getTargetExamplesKey(),(0,N.Map)({})),getComponent:l,getConfigs:c,omitValue:!0}):null,S?x().createElement(v,{headers:S,getComponent:l}):null),g?x().createElement(\"td\",{className:\"response-col_links\"},E?E.toSeq().entrySeq().map((([e,t])=>x().createElement(O,{key:e,name:e,link:t,getComponent:l}))):x().createElement(\"i\",null,\"No links\")):null)}}const response_extension=({xKey:e,xVal:t})=>x().createElement(\"div\",{className:\"response__extension\"},e,\": \",String(t)),Za=require(\"xml-but-prettier\");var en=__webpack_require__.n(Za);const tn=require(\"lodash/toLower\");var rn=__webpack_require__.n(tn);class ResponseBody extends x().PureComponent{state={parsedContent:null};updateParsedContent=e=>{const{content:t}=this.props;if(e!==t)if(t&&t instanceof Blob){var r=new FileReader;r.onload=()=>{this.setState({parsedContent:r.result})},r.readAsText(t)}else this.setState({parsedContent:t.toString()})};componentDidMount(){this.updateParsedContent(null)}componentDidUpdate(e){this.updateParsedContent(e.content)}render(){let{content:e,contentType:t,url:r,headers:a={},getComponent:n}=this.props;const{parsedContent:s}=this.state,o=n(\"HighlightCode\",!0),l=\"response_\"+(new Date).getTime();let c,i;if(r=r||\"\",(/^application\\/octet-stream/i.test(t)||a[\"Content-Disposition\"]&&/attachment/i.test(a[\"Content-Disposition\"])||a[\"content-disposition\"]&&/attachment/i.test(a[\"content-disposition\"])||a[\"Content-Description\"]&&/File Transfer/i.test(a[\"Content-Description\"])||a[\"content-description\"]&&/File Transfer/i.test(a[\"content-description\"]))&&(e.size>0||e.length>0))if(\"Blob\"in window){let n=t||\"text/html\",s=e instanceof Blob?e:new Blob([e],{type:n}),o=window.URL.createObjectURL(s),l=[n,r.substr(r.lastIndexOf(\"/\")+1),o].join(\":\"),c=a[\"content-disposition\"]||a[\"Content-Disposition\"];if(void 0!==c){let e=function extractFileNameFromContentDispositionHeader(e){let t;if([/filename\\*=[^']+'\\w*'\"([^\"]+)\";?/i,/filename\\*=[^']+'\\w*'([^;]+);?/i,/filename=\"([^;]*);?\"/i,/filename=([^;]*);?/i].some((r=>(t=r.exec(e),null!==t))),null!==t&&t.length>1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null}(c);null!==e&&(l=e)}i=L.navigator&&L.navigator.msSaveOrOpenBlob?x().createElement(\"div\",null,x().createElement(\"a\",{href:o,onClick:()=>L.navigator.msSaveOrOpenBlob(s,l)},\"Download file\")):x().createElement(\"div\",null,x().createElement(\"a\",{href:o,download:l},\"Download file\"))}else i=x().createElement(\"pre\",{className:\"microlight\"},\"Download headers detected but your browser does not support downloading binary via XHR (Blob).\");else if(/json/i.test(t)){let t=null;getKnownSyntaxHighlighterLanguage(e)&&(t=\"json\");try{c=JSON.stringify(JSON.parse(e),null,\"  \")}catch(t){c=\"can't parse JSON.  Raw result:\\n\\n\"+e}i=x().createElement(o,{language:t,downloadable:!0,fileName:`${l}.json`,canCopy:!0},c)}else/xml/i.test(t)?(c=en()(e,{textNodesOnSameLine:!0,indentor:\"  \"}),i=x().createElement(o,{downloadable:!0,fileName:`${l}.xml`,canCopy:!0},c)):i=\"text/html\"===rn()(t)||/text\\/plain/.test(t)?x().createElement(o,{downloadable:!0,fileName:`${l}.html`,canCopy:!0},e):\"text/csv\"===rn()(t)||/text\\/csv/.test(t)?x().createElement(o,{downloadable:!0,fileName:`${l}.csv`,canCopy:!0},e):/^image\\//i.test(t)?t.includes(\"svg\")?x().createElement(\"div\",null,\" \",e,\" \"):x().createElement(\"img\",{src:window.URL.createObjectURL(e)}):/^audio\\//i.test(t)?x().createElement(\"pre\",{className:\"microlight\"},x().createElement(\"audio\",{controls:!0,key:r},x().createElement(\"source\",{src:r,type:t}))):\"string\"==typeof e?x().createElement(o,{downloadable:!0,fileName:`${l}.txt`,canCopy:!0},e):e.size>0?s?x().createElement(\"div\",null,x().createElement(\"p\",{className:\"i\"},\"Unrecognized response type; displaying content as text.\"),x().createElement(o,{downloadable:!0,fileName:`${l}.txt`,canCopy:!0},s)):x().createElement(\"p\",{className:\"i\"},\"Unrecognized response type; unable to display.\"):null;return i?x().createElement(\"div\",null,x().createElement(\"h5\",null,\"Response body\"),i):null}}class Parameters extends C.Component{constructor(e){super(e),this.state={callbackVisible:!1,parametersVisible:!0}}static defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]};onChange=(e,t,r)=>{let{specActions:{changeParamByIdentity:a},onChangeKey:n}=this.props;a(n,e,t,r)};onChangeConsumesWrapper=e=>{let{specActions:{changeConsumesValue:t},onChangeKey:r}=this.props;t(r,e)};toggleTab=e=>\"parameters\"===e?this.setState({parametersVisible:!0,callbackVisible:!1}):\"callbacks\"===e?this.setState({callbackVisible:!0,parametersVisible:!1}):void 0;onChangeMediaType=({value:e,pathMethod:t})=>{let{specActions:r,oas3Selectors:a,oas3Actions:n}=this.props;const s=a.hasUserEditedBody(...t),o=a.shouldRetainRequestBodyValue(...t);n.setRequestContentType({value:e,pathMethod:t}),n.initRequestBodyValidateError({pathMethod:t}),s||(o||n.setRequestBodyValue({value:void 0,pathMethod:t}),r.clearResponse(...t),r.clearRequest(...t),r.clearValidateParams(t))};render(){let{onTryoutClick:e,onResetClick:t,parameters:r,allowTryItOut:a,tryItOutEnabled:n,specPath:s,fn:o,getComponent:l,getConfigs:c,specSelectors:i,specActions:p,pathMethod:m,oas3Actions:u,oas3Selectors:d,operation:h}=this.props;const g=l(\"parameterRow\"),y=l(\"TryItOutButton\"),f=l(\"contentType\"),S=l(\"Callbacks\",!0),E=l(\"RequestBody\",!0),_=n&&a,v=i.isOAS3(),w=`${createHtmlReadyId(`${m[1]}${m[0]}_requests`)}_select`,b=h.get(\"requestBody\"),C=Object.values(r.reduce(((e,t)=>{const r=t.get(\"in\");return e[r]??=[],e[r].push(t),e}),{})).reduce(((e,t)=>e.concat(t)),[]);return x().createElement(\"div\",{className:\"opblock-section\"},x().createElement(\"div\",{className:\"opblock-section-header\"},v?x().createElement(\"div\",{className:\"tab-header\"},x().createElement(\"div\",{onClick:()=>this.toggleTab(\"parameters\"),className:`tab-item ${this.state.parametersVisible&&\"active\"}`},x().createElement(\"h4\",{className:\"opblock-title\"},x().createElement(\"span\",null,\"Parameters\"))),h.get(\"callbacks\")?x().createElement(\"div\",{onClick:()=>this.toggleTab(\"callbacks\"),className:`tab-item ${this.state.callbackVisible&&\"active\"}`},x().createElement(\"h4\",{className:\"opblock-title\"},x().createElement(\"span\",null,\"Callbacks\"))):null):x().createElement(\"div\",{className:\"tab-header\"},x().createElement(\"h4\",{className:\"opblock-title\"},\"Parameters\")),a?x().createElement(y,{isOAS3:i.isOAS3(),hasUserEditedBody:d.hasUserEditedBody(...m),enabled:n,onCancelClick:this.props.onCancelClick,onTryoutClick:e,onResetClick:()=>t(m)}):null),this.state.parametersVisible?x().createElement(\"div\",{className:\"parameters-container\"},C.length?x().createElement(\"div\",{className:\"table-container\"},x().createElement(\"table\",{className:\"parameters\"},x().createElement(\"thead\",null,x().createElement(\"tr\",null,x().createElement(\"th\",{className:\"col_header parameters-col_name\"},\"Name\"),x().createElement(\"th\",{className:\"col_header parameters-col_description\"},\"Description\"))),x().createElement(\"tbody\",null,C.map(((e,t)=>x().createElement(g,{fn:o,specPath:s.push(t.toString()),getComponent:l,getConfigs:c,rawParam:e,param:i.parameterWithMetaByIdentity(m,e),key:`${e.get(\"in\")}.${e.get(\"name\")}`,onChange:this.onChange,onChangeConsumes:this.onChangeConsumesWrapper,specSelectors:i,specActions:p,oas3Actions:u,oas3Selectors:d,pathMethod:m,isExecute:_})))))):x().createElement(\"div\",{className:\"opblock-description-wrapper\"},x().createElement(\"p\",null,\"No parameters\"))):null,this.state.callbackVisible?x().createElement(\"div\",{className:\"callbacks-container opblock-description-wrapper\"},x().createElement(S,{callbacks:(0,N.Map)(h.get(\"callbacks\")),specPath:s.slice(0,-1).push(\"callbacks\")})):null,v&&b&&this.state.parametersVisible&&x().createElement(\"div\",{className:\"opblock-section opblock-section-request-body\"},x().createElement(\"div\",{className:\"opblock-section-header\"},x().createElement(\"h4\",{className:`opblock-title parameter__name ${b.get(\"required\")&&\"required\"}`},\"Request body\"),x().createElement(\"label\",{id:w},x().createElement(f,{value:d.requestContentType(...m),contentTypes:b.get(\"content\",(0,N.List)()).keySeq(),onChange:e=>{this.onChangeMediaType({value:e,pathMethod:m})},className:\"body-param-content-type\",ariaLabel:\"Request content type\",controlId:w}))),x().createElement(\"div\",{className:\"opblock-description-wrapper\"},x().createElement(E,{setRetainRequestBodyValueFlag:e=>u.setRetainRequestBodyValueFlag({value:e,pathMethod:m}),userHasEditedBody:d.hasUserEditedBody(...m),specPath:s.slice(0,-1).push(\"requestBody\"),requestBody:b,requestBodyValue:d.requestBodyValue(...m),requestBodyInclusionSetting:d.requestBodyInclusionSetting(...m),requestBodyErrors:d.requestBodyErrors(...m),isExecute:_,getConfigs:c,activeExamplesKey:d.activeExamplesMember(...m,\"requestBody\",\"requestBody\"),updateActiveExamplesKey:e=>{this.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:this.props.pathMethod,contextType:\"requestBody\",contextName:\"requestBody\"})},onChange:(e,t)=>{if(t){const r=d.requestBodyValue(...m),a=N.Map.isMap(r)?r:(0,N.Map)();return u.setRequestBodyValue({pathMethod:m,value:a.setIn(t,e)})}u.setRequestBodyValue({value:e,pathMethod:m})},onChangeIncludeEmpty:(e,t)=>{u.setRequestBodyInclusion({pathMethod:m,value:t,name:e})},contentType:d.requestContentType(...m)}))))}}const parameter_extension=({xKey:e,xVal:t})=>x().createElement(\"div\",{className:\"parameter__extension\"},e,\": \",String(t)),an={onChange:()=>{},isIncludedOptions:{}};class ParameterIncludeEmpty extends C.Component{static defaultProps=an;componentDidMount(){const{isIncludedOptions:e,onChange:t}=this.props,{shouldDispatchInit:r,defaultValue:a}=e;r&&t(a)}onCheckboxChange=e=>{const{onChange:t}=this.props;t(e.target.checked)};render(){let{isIncluded:e,isDisabled:t}=this.props;return x().createElement(\"div\",null,x().createElement(\"label\",{htmlFor:\"include_empty_value\",className:ut()(\"parameter__empty_value_toggle\",{disabled:t})},x().createElement(\"input\",{id:\"include_empty_value\",type:\"checkbox\",disabled:t,checked:!t&&e,onChange:this.onCheckboxChange}),\"Send empty value\"))}}class ParameterRow extends C.Component{constructor(e,t){super(e,t),this.setDefaultValue()}UNSAFE_componentWillReceiveProps(e){let t,{specSelectors:r,pathMethod:a,rawParam:n}=e,s=r.isOAS3(),o=r.parameterWithMetaByIdentity(a,n)||new N.Map;if(o=o.isEmpty()?n:o,s){let{schema:e}=getParameterSchema(o,{isOAS3:s});t=e?e.get(\"enum\"):void 0}else t=o?o.get(\"enum\"):void 0;let l,c=o?o.get(\"value\"):void 0;void 0!==c?l=c:n.get(\"required\")&&t&&t.size&&(l=t.first()),void 0!==l&&l!==c&&this.onChangeWrapper(function numberToString(e){return\"number\"==typeof e?e.toString():e}(l)),this.setDefaultValue()}onChangeWrapper=(e,t=!1)=>{let r,{onChange:a,rawParam:n}=this.props;return r=\"\"===e||e&&0===e.size?null:e,a(n,r,t)};_onExampleSelect=e=>{this.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:this.props.pathMethod,contextType:\"parameters\",contextName:this.getParamKey()})};onChangeIncludeEmpty=e=>{let{specActions:t,param:r,pathMethod:a}=this.props;const n=r.get(\"name\"),s=r.get(\"in\");return t.updateEmptyParamInclusion(a,n,s,e)};setDefaultValue=()=>{let{specSelectors:e,pathMethod:t,rawParam:r,oas3Selectors:a,fn:n}=this.props;const s=e.parameterWithMetaByIdentity(t,r)||(0,N.Map)();let{schema:o}=getParameterSchema(s,{isOAS3:e.isOAS3()});const l=s.get(\"content\",(0,N.Map)()).keySeq().first(),c=o?n.getSampleSchema(o.toJS(),l,{includeWriteOnly:!0}):null;if(s&&void 0===s.get(\"value\")&&\"body\"!==s.get(\"in\")){let r;if(e.isSwagger2())r=void 0!==s.get(\"x-example\")?s.get(\"x-example\"):void 0!==s.getIn([\"schema\",\"example\"])?s.getIn([\"schema\",\"example\"]):o&&o.getIn([\"default\"]);else if(e.isOAS3()){o=this.composeJsonSchema(o);const e=a.activeExamplesMember(...t,\"parameters\",this.getParamKey());r=void 0!==s.getIn([\"examples\",e,\"value\"])?s.getIn([\"examples\",e,\"value\"]):void 0!==s.getIn([\"content\",l,\"example\"])?s.getIn([\"content\",l,\"example\"]):void 0!==s.get(\"example\")?s.get(\"example\"):void 0!==(o&&o.get(\"example\"))?o&&o.get(\"example\"):void 0!==(o&&o.get(\"default\"))?o&&o.get(\"default\"):s.get(\"default\")}void 0===r||N.List.isList(r)||(r=stringify(r)),void 0!==r?this.onChangeWrapper(r):o&&\"object\"===o.get(\"type\")&&c&&!s.get(\"examples\")&&this.onChangeWrapper(N.List.isList(c)?c:stringify(c))}};getParamKey(){const{param:e}=this.props;return e?`${e.get(\"name\")}-${e.get(\"in\")}`:null}composeJsonSchema(e){const{fn:t}=this.props,r=e.get(\"oneOf\")?.get(0)?.toJS(),a=e.get(\"anyOf\")?.get(0)?.toJS();return(0,N.fromJS)(t.mergeJsonSchema(e.toJS(),r??a??{}))}render(){let{param:e,rawParam:t,getComponent:r,getConfigs:a,isExecute:n,fn:s,onChangeConsumes:o,specSelectors:l,pathMethod:c,specPath:i,oas3Selectors:p}=this.props,m=l.isOAS3();const{showExtensions:u,showCommonExtensions:d}=a();if(e||(e=t),!t)return null;const h=r(\"JsonSchemaForm\"),g=r(\"ParamBody\");let y=e.get(\"in\"),f=\"body\"!==y?null:x().createElement(g,{getComponent:r,getConfigs:a,fn:s,param:e,consumes:l.consumesOptionsFor(c),consumesValue:l.contentTypeValues(c).get(\"requestContentType\"),onChange:this.onChangeWrapper,onChangeConsumes:o,isExecute:n,specSelectors:l,pathMethod:c});const S=r(\"modelExample\"),E=r(\"Markdown\",!0),_=r(\"ParameterExt\"),v=r(\"ParameterIncludeEmpty\"),w=r(\"ExamplesSelectValueRetainer\"),b=r(\"Example\");let{schema:C}=getParameterSchema(e,{isOAS3:m}),O=l.parameterWithMetaByIdentity(c,t)||(0,N.Map)();m&&(C=this.composeJsonSchema(C));let k,A,I,q,j=C?C.get(\"format\"):null,P=C?C.get(\"type\"):null,M=C?C.getIn([\"items\",\"type\"]):null,R=\"formData\"===y,T=\"FormData\"in L,J=e.get(\"required\"),$=O?O.get(\"value\"):\"\",V=d?getCommonExtensions(C):null,D=u?getExtensions(e):null,K=!1;return void 0!==e&&C&&(k=C.get(\"items\")),void 0!==k?(A=k.get(\"enum\"),I=k.get(\"default\")):C&&(A=C.get(\"enum\")),A&&A.size&&A.size>0&&(K=!0),void 0!==e&&(C&&(I=C.get(\"default\")),void 0===I&&(I=e.get(\"default\")),q=e.get(\"example\"),void 0===q&&(q=e.get(\"x-example\"))),x().createElement(\"tr\",{\"data-param-name\":e.get(\"name\"),\"data-param-in\":e.get(\"in\")},x().createElement(\"td\",{className:\"parameters-col_name\"},x().createElement(\"div\",{className:J?\"parameter__name required\":\"parameter__name\"},e.get(\"name\"),J?x().createElement(\"span\",null,\" *\"):null),x().createElement(\"div\",{className:\"parameter__type\"},P,M&&`[${M}]`,j&&x().createElement(\"span\",{className:\"prop-format\"},\"($\",j,\")\")),x().createElement(\"div\",{className:\"parameter__deprecated\"},m&&e.get(\"deprecated\")?\"deprecated\":null),x().createElement(\"div\",{className:\"parameter__in\"},\"(\",e.get(\"in\"),\")\")),x().createElement(\"td\",{className:\"parameters-col_description\"},e.get(\"description\")?x().createElement(E,{source:e.get(\"description\")}):null,!f&&n||!K?null:x().createElement(E,{className:\"parameter__enum\",source:\"<i>Available values</i> : \"+A.map((function(e){return e})).toArray().map(String).join(\", \")}),!f&&n||void 0===I?null:x().createElement(E,{className:\"parameter__default\",source:\"<i>Default value</i> : \"+I}),!f&&n||void 0===q?null:x().createElement(E,{source:\"<i>Example</i> : \"+q}),R&&!T&&x().createElement(\"div\",null,\"Error: your browser does not support FormData\"),m&&e.get(\"examples\")?x().createElement(\"section\",{className:\"parameter-controls\"},x().createElement(w,{examples:e.get(\"examples\"),onSelect:this._onExampleSelect,updateValue:this.onChangeWrapper,getComponent:r,defaultToFirstExample:!0,currentKey:p.activeExamplesMember(...c,\"parameters\",this.getParamKey()),currentUserInputValue:$})):null,f?null:x().createElement(h,{fn:s,getComponent:r,value:$,required:J,disabled:!n,description:e.get(\"name\"),onChange:this.onChangeWrapper,errors:O.get(\"errors\"),schema:C}),f&&C?x().createElement(S,{getComponent:r,specPath:i.push(\"schema\"),getConfigs:a,isExecute:n,specSelectors:l,schema:C,example:f,includeWriteOnly:!0}):null,!f&&n&&e.get(\"allowEmptyValue\")?x().createElement(v,{onChange:this.onChangeIncludeEmpty,isIncluded:l.parameterInclusionSettingFor(c,e.get(\"name\"),e.get(\"in\")),isDisabled:!isEmptyValue($)}):null,m&&e.get(\"examples\")?x().createElement(b,{example:e.getIn([\"examples\",p.activeExamplesMember(...c,\"parameters\",this.getParamKey())]),getComponent:r,getConfigs:a}):null,d&&V.size?V.entrySeq().map((([e,t])=>x().createElement(_,{key:`${e}-${t}`,xKey:e,xVal:t}))):null,u&&D.size?D.entrySeq().map((([e,t])=>x().createElement(_,{key:`${e}-${t}`,xKey:e,xVal:t}))):null))}}class Execute extends C.Component{handleValidateParameters=()=>{let{specSelectors:e,specActions:t,path:r,method:a}=this.props;return t.validateParams([r,a]),e.validateBeforeExecute([r,a])};handleValidateRequestBody=()=>{let{path:e,method:t,specSelectors:r,oas3Selectors:a,oas3Actions:n}=this.props,s={missingBodyValue:!1,missingRequiredKeys:[]};n.clearRequestBodyValidateError({path:e,method:t});let o=r.getOAS3RequiredRequestBodyContentType([e,t]),l=a.requestBodyValue(e,t),c=a.validateBeforeExecute([e,t]),i=a.requestContentType(e,t);if(!c)return s.missingBodyValue=!0,n.setRequestBodyValidateError({path:e,method:t,validationErrors:s}),!1;if(!o)return!0;let p=a.validateShallowRequired({oas3RequiredRequestBodyContentType:o,oas3RequestContentType:i,oas3RequestBodyValue:l});return!p||p.length<1||(p.forEach((e=>{s.missingRequiredKeys.push(e)})),n.setRequestBodyValidateError({path:e,method:t,validationErrors:s}),!1)};handleValidationResultPass=()=>{let{specActions:e,operation:t,path:r,method:a}=this.props;this.props.onExecute&&this.props.onExecute(),e.execute({operation:t,path:r,method:a})};handleValidationResultFail=()=>{let{specActions:e,path:t,method:r}=this.props;e.clearValidateParams([t,r]),setTimeout((()=>{e.validateParams([t,r])}),40)};handleValidationResult=e=>{e?this.handleValidationResultPass():this.handleValidationResultFail()};onClick=()=>{let e=this.handleValidateParameters(),t=this.handleValidateRequestBody(),r=e&&t;this.handleValidationResult(r)};onChangeProducesWrapper=e=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],e);render(){const{disabled:e}=this.props;return x().createElement(\"button\",{className:\"btn execute opblock-control__btn\",onClick:this.onClick,disabled:e},\"Execute\")}}class headers_Headers extends x().Component{render(){let{headers:e,getComponent:t}=this.props;const r=t(\"Property\"),a=t(\"Markdown\",!0);return e&&e.size?x().createElement(\"div\",{className:\"headers-wrapper\"},x().createElement(\"h4\",{className:\"headers__title\"},\"Headers:\"),x().createElement(\"table\",{className:\"headers\"},x().createElement(\"thead\",null,x().createElement(\"tr\",{className:\"header-row\"},x().createElement(\"th\",{className:\"header-col\"},\"Name\"),x().createElement(\"th\",{className:\"header-col\"},\"Description\"),x().createElement(\"th\",{className:\"header-col\"},\"Type\"))),x().createElement(\"tbody\",null,e.entrySeq().map((([e,t])=>{if(!k().Map.isMap(t))return null;const n=t.get(\"description\"),s=t.getIn([\"schema\"])?t.getIn([\"schema\",\"type\"]):t.getIn([\"type\"]),o=t.getIn([\"schema\",\"example\"]);return x().createElement(\"tr\",{key:e},x().createElement(\"td\",{className:\"header-col\"},e),x().createElement(\"td\",{className:\"header-col\"},n?x().createElement(a,{source:n}):null),x().createElement(\"td\",{className:\"header-col\"},s,\" \",o?x().createElement(r,{propKey:\"Example\",propVal:o,propClass:\"header-example\"}):null))})).toArray()))):null}}class Errors extends x().Component{render(){let{editorActions:e,errSelectors:t,layoutSelectors:r,layoutActions:a,getComponent:n}=this.props;const s=n(\"Collapse\");if(e&&e.jumpToLine)var o=e.jumpToLine;let l=t.allErrors().filter((e=>\"thrown\"===e.get(\"type\")||\"error\"===e.get(\"level\")));if(!l||l.count()<1)return null;let c=r.isShown([\"errorPane\"],!0),i=l.sortBy((e=>e.get(\"line\")));return x().createElement(\"pre\",{className:\"errors-wrapper\"},x().createElement(\"hgroup\",{className:\"error\"},x().createElement(\"h4\",{className:\"errors__title\"},\"Errors\"),x().createElement(\"button\",{className:\"btn errors__clear-btn\",onClick:()=>a.show([\"errorPane\"],!c)},c?\"Hide\":\"Show\")),x().createElement(s,{isOpened:c,animated:!0},x().createElement(\"div\",{className:\"errors\"},i.map(((e,t)=>{let r=e.get(\"type\");return\"thrown\"===r||\"auth\"===r?x().createElement(ThrownErrorItem,{key:t,error:e.get(\"error\")||e,jumpToLine:o}):\"spec\"===r?x().createElement(SpecErrorItem,{key:t,error:e,jumpToLine:o}):void 0})))))}}const ThrownErrorItem=({error:e,jumpToLine:t})=>{if(!e)return null;let r=e.get(\"line\");return x().createElement(\"div\",{className:\"error-wrapper\"},e?x().createElement(\"div\",null,x().createElement(\"h4\",null,e.get(\"source\")&&e.get(\"level\")?toTitleCase(e.get(\"source\"))+\" \"+e.get(\"level\"):\"\",e.get(\"path\")?x().createElement(\"small\",null,\" at \",e.get(\"path\")):null),x().createElement(\"span\",{className:\"message thrown\"},e.get(\"message\")),x().createElement(\"div\",{className:\"error-line\"},r&&t?x().createElement(\"a\",{onClick:t.bind(null,r)},\"Jump to line \",r):null)):null)},SpecErrorItem=({error:e,jumpToLine:t=null})=>{let r=null;return e.get(\"path\")?r=N.List.isList(e.get(\"path\"))?x().createElement(\"small\",null,\"at \",e.get(\"path\").join(\".\")):x().createElement(\"small\",null,\"at \",e.get(\"path\")):e.get(\"line\")&&!t&&(r=x().createElement(\"small\",null,\"on line \",e.get(\"line\"))),x().createElement(\"div\",{className:\"error-wrapper\"},e?x().createElement(\"div\",null,x().createElement(\"h4\",null,toTitleCase(e.get(\"source\"))+\" \"+e.get(\"level\"),\" \",r),x().createElement(\"span\",{className:\"message\"},e.get(\"message\")),x().createElement(\"div\",{className:\"error-line\"},t?x().createElement(\"a\",{onClick:t.bind(null,e.get(\"line\"))},\"Jump to line \",e.get(\"line\")):null)):null)};function toTitleCase(e){return(e||\"\").split(\" \").map((e=>e[0].toUpperCase()+e.slice(1))).join(\" \")}const content_type_noop=()=>{};class ContentType extends x().Component{static defaultProps={onChange:content_type_noop,value:null,contentTypes:(0,N.fromJS)([\"application/json\"])};componentDidMount(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}UNSAFE_componentWillReceiveProps(e){e.contentTypes&&e.contentTypes.size&&(e.contentTypes.includes(e.value)||e.onChange(e.contentTypes.first()))}onChangeWrapper=e=>this.props.onChange(e.target.value);render(){let{ariaControls:e,ariaLabel:t,className:r,contentTypes:a,controlId:n,value:s}=this.props;return a&&a.size?x().createElement(\"div\",{className:\"content-type-wrapper \"+(r||\"\")},x().createElement(\"select\",{\"aria-controls\":e,\"aria-label\":t,className:\"content-type\",id:n,onChange:this.onChangeWrapper,value:s||\"\"},a.map((e=>x().createElement(\"option\",{key:e,value:e},e))).toArray())):null}}function xclass(...e){return e.filter((e=>!!e)).join(\" \").trim()}class Container extends x().Component{render(){let{fullscreen:e,full:t,...r}=this.props;if(e)return x().createElement(\"section\",r);let a=\"swagger-container\"+(t?\"-full\":\"\");return x().createElement(\"section\",et()({},r,{className:xclass(r.className,a)}))}}const nn={mobile:\"\",tablet:\"-tablet\",desktop:\"-desktop\",large:\"-hd\"};class Col extends x().Component{render(){const{hide:e,keepContents:t,mobile:r,tablet:a,desktop:n,large:s,...o}=this.props;if(e&&!t)return x().createElement(\"span\",null);let l=[];for(let e in nn){if(!Object.prototype.hasOwnProperty.call(nn,e))continue;let t=nn[e];if(e in this.props){let r=this.props[e];if(r<1){l.push(\"none\"+t);continue}l.push(\"block\"+t),l.push(\"col-\"+r+t)}}e&&l.push(\"hidden\");let c=xclass(o.className,...l);return x().createElement(\"section\",et()({},o,{className:c}))}}class Row extends x().Component{render(){return x().createElement(\"div\",et()({},this.props,{className:xclass(this.props.className,\"wrapper\")}))}}class Button extends x().Component{static defaultProps={className:\"\"};render(){return x().createElement(\"button\",et()({},this.props,{className:xclass(this.props.className,\"button\")}))}}const TextArea=e=>x().createElement(\"textarea\",e),Input=e=>x().createElement(\"input\",e);class Select extends x().Component{static defaultProps={multiple:!1,allowEmptyValue:!0};constructor(e,t){let r;super(e,t),r=e.value?e.value:e.multiple?[\"\"]:\"\",this.state={value:r}}onChange=e=>{let t,{onChange:r,multiple:a}=this.props,n=[].slice.call(e.target.options);t=a?n.filter((function(e){return e.selected})).map((function(e){return e.value})):e.target.value,this.setState({value:t}),r&&r(t)};UNSAFE_componentWillReceiveProps(e){e.value!==this.props.value&&this.setState({value:e.value})}render(){let{allowedValues:e,multiple:t,allowEmptyValue:r,disabled:a}=this.props,n=this.state.value?.toJS?.()||this.state.value;return x().createElement(\"select\",{className:this.props.className,multiple:t,value:n,onChange:this.onChange,disabled:a},r?x().createElement(\"option\",{value:\"\"},\"--\"):null,e.map((function(e,t){return x().createElement(\"option\",{key:t,value:String(e)},String(e))})))}}class Link extends x().Component{render(){return x().createElement(\"a\",et()({},this.props,{rel:\"noopener noreferrer\",className:xclass(this.props.className,\"link\")}))}}const NoMargin=({children:e})=>x().createElement(\"div\",{className:\"no-margin\"},\" \",e,\" \");class Collapse extends x().Component{static defaultProps={isOpened:!1,animated:!1};renderNotAnimated(){return this.props.isOpened?x().createElement(NoMargin,null,this.props.children):x().createElement(\"noscript\",null)}render(){let{animated:e,isOpened:t,children:r}=this.props;return e?(r=t?r:null,x().createElement(NoMargin,null,r)):this.renderNotAnimated()}}class Overview extends x().Component{constructor(...e){super(...e),this.setTagShown=this._setTagShown.bind(this)}_setTagShown(e,t){this.props.layoutActions.show(e,t)}showOp(e,t){let{layoutActions:r}=this.props;r.show(e,t)}render(){let{specSelectors:e,layoutSelectors:t,layoutActions:r,getComponent:a}=this.props,n=e.taggedOperations();const s=a(\"Collapse\");return x().createElement(\"div\",null,x().createElement(\"h4\",{className:\"overview-title\"},\"Overview\"),n.map(((e,a)=>{let n=e.get(\"operations\"),o=[\"overview-tags\",a],l=t.isShown(o,!0);return x().createElement(\"div\",{key:\"overview-\"+a},x().createElement(\"h4\",{onClick:()=>r.show(o,!l),className:\"link overview-tag\"},\" \",l?\"-\":\"+\",a),x().createElement(s,{isOpened:l,animated:!0},n.map((e=>{let{path:a,method:n,id:s}=e.toObject(),o=\"operations\",l=s,c=t.isShown([o,l]);return x().createElement(OperationLink,{key:s,path:a,method:n,id:a+\"-\"+n,shown:c,showOpId:l,showOpIdPrefix:o,href:`#operation-${l}`,onClick:r.show})})).toArray()))})).toArray(),n.size<1&&x().createElement(\"h3\",null,\" No operations defined in spec! \"))}}class OperationLink extends x().Component{constructor(e){super(e),this.onClick=this._onClick.bind(this)}_onClick(){let{showOpId:e,showOpIdPrefix:t,onClick:r,shown:a}=this.props;r([t,e],!a)}render(){let{id:e,method:t,shown:r,href:a}=this.props;return x().createElement(Link,{href:a,onClick:this.onClick,className:\"block opblock-link \"+(r?\"shown\":\"\")},x().createElement(\"div\",null,x().createElement(\"small\",{className:`bold-label-${t}`},t.toUpperCase()),x().createElement(\"span\",{className:\"bold-label\"},e)))}}class InitializedInput extends x().Component{componentDidMount(){this.props.initialValue&&(this.inputRef.value=this.props.initialValue)}render(){const{value:e,defaultValue:t,initialValue:r,...a}=this.props;return x().createElement(\"input\",et()({},a,{ref:e=>this.inputRef=e}))}}class InfoBasePath extends x().Component{render(){const{host:e,basePath:t}=this.props;return x().createElement(\"pre\",{className:\"base-url\"},\"[ Base URL: \",e,t,\" ]\")}}class InfoUrl extends x().PureComponent{render(){const{url:e,getComponent:t}=this.props,r=t(\"Link\");return x().createElement(r,{target:\"_blank\",href:sanitizeUrl(e)},x().createElement(\"span\",{className:\"url\"},\" \",e))}}class Info extends x().Component{render(){const{info:e,url:t,host:r,basePath:a,getComponent:n,externalDocs:s,selectedServer:o,url:l}=this.props,c=e.get(\"version\"),i=e.get(\"description\"),p=e.get(\"title\"),m=safeBuildUrl(e.get(\"termsOfService\"),l,{selectedServer:o}),u=e.get(\"contact\"),d=e.get(\"license\"),h=safeBuildUrl(s&&s.get(\"url\"),l,{selectedServer:o}),g=s&&s.get(\"description\"),y=n(\"Markdown\",!0),f=n(\"Link\"),S=n(\"VersionStamp\"),E=n(\"OpenAPIVersion\"),_=n(\"InfoUrl\"),v=n(\"InfoBasePath\"),w=n(\"License\"),b=n(\"Contact\");return x().createElement(\"div\",{className:\"info\"},x().createElement(\"hgroup\",{className:\"main\"},x().createElement(\"h2\",{className:\"title\"},p,x().createElement(\"span\",null,c&&x().createElement(S,{version:c}),x().createElement(E,{oasVersion:\"2.0\"}))),r||a?x().createElement(v,{host:r,basePath:a}):null,t&&x().createElement(_,{getComponent:n,url:t})),x().createElement(\"div\",{className:\"description\"},x().createElement(y,{source:i})),m&&x().createElement(\"div\",{className:\"info__tos\"},x().createElement(f,{target:\"_blank\",href:sanitizeUrl(m)},\"Terms of service\")),u?.size>0&&x().createElement(b,{getComponent:n,data:u,selectedServer:o,url:t}),d?.size>0&&x().createElement(w,{getComponent:n,license:d,selectedServer:o,url:t}),h?x().createElement(f,{className:\"info__extdocs\",target:\"_blank\",href:sanitizeUrl(h)},g||h):null)}}const sn=Info;class InfoContainer extends x().Component{render(){const{specSelectors:e,getComponent:t,oas3Selectors:r}=this.props,a=e.info(),n=e.url(),s=e.basePath(),o=e.host(),l=e.externalDocs(),c=r.selectedServer(),i=t(\"info\");return x().createElement(\"div\",null,a&&a.count()?x().createElement(i,{info:a,url:n,host:o,basePath:s,externalDocs:l,getComponent:t,selectedServer:c}):null)}}class Contact extends x().Component{render(){const{data:e,getComponent:t,selectedServer:r,url:a}=this.props,n=e.get(\"name\",\"the developer\"),s=safeBuildUrl(e.get(\"url\"),a,{selectedServer:r}),o=e.get(\"email\"),l=t(\"Link\");return x().createElement(\"div\",{className:\"info__contact\"},s&&x().createElement(\"div\",null,x().createElement(l,{href:sanitizeUrl(s),target:\"_blank\"},n,\" - Website\")),o&&x().createElement(l,{href:sanitizeUrl(`mailto:${o}`)},s?`Send email to ${n}`:`Contact ${n}`))}}const on=Contact;class License extends x().Component{render(){const{license:e,getComponent:t,selectedServer:r,url:a}=this.props,n=e.get(\"name\",\"License\"),s=safeBuildUrl(e.get(\"url\"),a,{selectedServer:r}),o=t(\"Link\");return x().createElement(\"div\",{className:\"info__license\"},s?x().createElement(\"div\",{className:\"info__license__url\"},x().createElement(o,{target:\"_blank\",href:sanitizeUrl(s)},n)):x().createElement(\"span\",null,n))}}const ln=License;class JumpToPath extends x().Component{render(){return null}}class CopyToClipboardBtn extends x().Component{render(){let{getComponent:e}=this.props;const t=e(\"CopyIcon\");return x().createElement(\"div\",{className:\"view-line-link copy-to-clipboard\",title:\"Copy to clipboard\"},x().createElement(dt.CopyToClipboard,{text:this.props.textToCopy},x().createElement(t,null)))}}class Footer extends x().Component{render(){return x().createElement(\"div\",{className:\"footer\"})}}class FilterContainer extends x().Component{onFilterChange=e=>{const{target:{value:t}}=e;this.props.layoutActions.updateFilter(t)};render(){const{specSelectors:e,layoutSelectors:t,getComponent:r}=this.props,a=r(\"Col\"),n=\"loading\"===e.loadingStatus(),s=\"failed\"===e.loadingStatus(),o=t.currentFilter(),l=[\"operation-filter-input\"];return s&&l.push(\"failed\"),n&&l.push(\"loading\"),x().createElement(\"div\",null,!1===o?null:x().createElement(\"div\",{className:\"filter-container\"},x().createElement(a,{className:\"filter wrapper\",mobile:12},x().createElement(\"input\",{className:l.join(\" \"),placeholder:\"Filter by tag\",type:\"text\",onChange:this.onFilterChange,value:\"string\"==typeof o?o:\"\",disabled:n}))))}}const cn=Function.prototype;class ParamBody extends C.PureComponent{static defaultProp={consumes:(0,N.fromJS)([\"application/json\"]),param:(0,N.fromJS)({}),onChange:cn,onChangeConsumes:cn};constructor(e,t){super(e,t),this.state={isEditBox:!1,value:\"\"}}componentDidMount(){this.updateValues.call(this,this.props)}UNSAFE_componentWillReceiveProps(e){this.updateValues.call(this,e)}updateValues=e=>{let{param:t,isExecute:r,consumesValue:a=\"\"}=e,n=/xml/i.test(a),s=/json/i.test(a),o=n?t.get(\"value_xml\"):t.get(\"value\");if(void 0!==o){let e=!o&&s?\"{}\":o;this.setState({value:e}),this.onChange(e,{isXml:n,isEditBox:r})}else n?this.onChange(this.sample(\"xml\"),{isXml:n,isEditBox:r}):this.onChange(this.sample(),{isEditBox:r})};sample=e=>{let{param:t,fn:r}=this.props,a=r.inferSchema(t.toJS());return r.getSampleSchema(a,e,{includeWriteOnly:!0})};onChange=(e,{isEditBox:t,isXml:r})=>{this.setState({value:e,isEditBox:t}),this._onChange(e,r)};_onChange=(e,t)=>{(this.props.onChange||cn)(e,t)};handleOnChange=e=>{const{consumesValue:t}=this.props,r=/xml/i.test(t),a=e.target.value;this.onChange(a,{isXml:r,isEditBox:this.state.isEditBox})};toggleIsEditBox=()=>this.setState((e=>({isEditBox:!e.isEditBox})));render(){let{onChangeConsumes:e,param:t,isExecute:r,specSelectors:a,pathMethod:n,getComponent:s}=this.props;const o=s(\"Button\"),l=s(\"TextArea\"),c=s(\"HighlightCode\",!0),i=s(\"contentType\");let p=(a?a.parameterWithMetaByIdentity(n,t):t).get(\"errors\",(0,N.List)()),m=a.contentTypeValues(n).get(\"requestContentType\"),u=this.props.consumes&&this.props.consumes.size?this.props.consumes:ParamBody.defaultProp.consumes,{value:d,isEditBox:h}=this.state,g=null;getKnownSyntaxHighlighterLanguage(d)&&(g=\"json\");const y=`${createHtmlReadyId(`${n[1]}${n[0]}_parameters`)}_select`;return x().createElement(\"div\",{className:\"body-param\",\"data-param-name\":t.get(\"name\"),\"data-param-in\":t.get(\"in\")},h&&r?x().createElement(l,{className:\"body-param__text\"+(p.count()?\" invalid\":\"\"),value:d,onChange:this.handleOnChange}):d&&x().createElement(c,{className:\"body-param__example\",language:g},d),x().createElement(\"div\",{className:\"body-param-options\"},r?x().createElement(\"div\",{className:\"body-param-edit\"},x().createElement(o,{className:h?\"btn cancel body-param__example-edit\":\"btn edit body-param__example-edit\",onClick:this.toggleIsEditBox},h?\"Cancel\":\"Edit\")):null,x().createElement(\"label\",{htmlFor:y},x().createElement(\"span\",null,\"Parameter content type\"),x().createElement(i,{value:m,contentTypes:u,onChange:e,className:\"body-param-content-type\",ariaLabel:\"Parameter content type\",controlId:y}))))}}class Curl extends x().Component{render(){const{request:e,getComponent:t}=this.props,r=requestSnippetGenerator_curl_bash(e),a=t(\"SyntaxHighlighter\",!0);return x().createElement(\"div\",{className:\"curl-command\"},x().createElement(\"h4\",null,\"Curl\"),x().createElement(\"div\",{className:\"copy-to-clipboard\"},x().createElement(dt.CopyToClipboard,{text:r},x().createElement(\"button\",null))),x().createElement(\"div\",null,x().createElement(a,{language:\"bash\",className:\"curl microlight\",renderPlainText:({children:e,PlainTextViewer:t})=>x().createElement(t,{className:\"curl\"},e)},r)))}}const property=({propKey:e,propVal:t,propClass:r})=>x().createElement(\"span\",{className:r},x().createElement(\"br\",null),e,\": \",String(t));class TryItOutButton extends x().Component{static defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,onResetClick:Function.prototype,enabled:!1,hasUserEditedBody:!1,isOAS3:!1};render(){const{onTryoutClick:e,onCancelClick:t,onResetClick:r,enabled:a,hasUserEditedBody:n,isOAS3:s}=this.props,o=s&&n;return x().createElement(\"div\",{className:o?\"try-out btn-group\":\"try-out\"},a?x().createElement(\"button\",{className:\"btn try-out__btn cancel\",onClick:t},\"Cancel\"):x().createElement(\"button\",{className:\"btn try-out__btn\",onClick:e},\"Try it out \"),o&&x().createElement(\"button\",{className:\"btn try-out__btn reset\",onClick:r},\"Reset\"))}}class VersionPragmaFilter extends x().PureComponent{static defaultProps={alsoShow:null,children:null,bypass:!1};render(){const{bypass:e,isSwagger2:t,isOAS3:r,alsoShow:a}=this.props;return e?x().createElement(\"div\",null,this.props.children):t&&r?x().createElement(\"div\",{className:\"version-pragma\"},a,x().createElement(\"div\",{className:\"version-pragma__message version-pragma__message--ambiguous\"},x().createElement(\"div\",null,x().createElement(\"h3\",null,\"Unable to render this definition\"),x().createElement(\"p\",null,x().createElement(\"code\",null,\"swagger\"),\" and \",x().createElement(\"code\",null,\"openapi\"),\" fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields.\"),x().createElement(\"p\",null,\"Supported version fields are \",x().createElement(\"code\",null,\"swagger: \",'\"2.0\"'),\" and those that match \",x().createElement(\"code\",null,\"openapi: 3.0.n\"),\" (for example, \",x().createElement(\"code\",null,\"openapi: 3.0.0\"),\").\")))):t||r?x().createElement(\"div\",null,this.props.children):x().createElement(\"div\",{className:\"version-pragma\"},a,x().createElement(\"div\",{className:\"version-pragma__message version-pragma__message--missing\"},x().createElement(\"div\",null,x().createElement(\"h3\",null,\"Unable to render this definition\"),x().createElement(\"p\",null,\"The provided definition does not specify a valid version field.\"),x().createElement(\"p\",null,\"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are \",x().createElement(\"code\",null,\"swagger: \",'\"2.0\"'),\" and those that match \",x().createElement(\"code\",null,\"openapi: 3.0.n\"),\" (for example, \",x().createElement(\"code\",null,\"openapi: 3.0.0\"),\").\"))))}}const version_stamp=({version:e})=>x().createElement(\"small\",null,x().createElement(\"pre\",{className:\"version\"},\" \",e,\" \")),openapi_version=({oasVersion:e})=>x().createElement(\"small\",{className:\"version-stamp\"},x().createElement(\"pre\",{className:\"version\"},\"OAS \",e)),deep_link=({enabled:e,path:t,text:r})=>x().createElement(\"a\",{className:\"nostyle\",onClick:e?e=>e.preventDefault():null,href:e?`#/${t}`:null},x().createElement(\"span\",null,r)),svg_assets=()=>x().createElement(\"div\",null,x().createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",xmlnsXlink:\"http://www.w3.org/1999/xlink\",className:\"svg-assets\"},x().createElement(\"defs\",null,x().createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"unlocked\"},x().createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z\"})),x().createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"locked\"},x().createElement(\"path\",{d:\"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z\"})),x().createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"close\"},x().createElement(\"path\",{d:\"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z\"})),x().createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow\"},x().createElement(\"path\",{d:\"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z\"})),x().createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow-down\"},x().createElement(\"path\",{d:\"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z\"})),x().createElement(\"symbol\",{viewBox:\"0 0 20 20\",id:\"large-arrow-up\"},x().createElement(\"path\",{d:\"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z\"})),x().createElement(\"symbol\",{viewBox:\"0 0 24 24\",id:\"jump-to\"},x().createElement(\"path\",{d:\"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z\"})),x().createElement(\"symbol\",{viewBox:\"0 0 24 24\",id:\"expand\"},x().createElement(\"path\",{d:\"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z\"})),x().createElement(\"symbol\",{viewBox:\"0 0 15 16\",id:\"copy\"},x().createElement(\"g\",{transform:\"translate(2, -1)\"},x().createElement(\"path\",{fill:\"#ffffff\",fillRule:\"evenodd\",d:\"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z\"})))))),pn=require(\"remarkable\"),mn=require(\"remarkable/linkify\"),un=require(\"dompurify\");var dn=__webpack_require__.n(un);dn().addHook&&dn().addHook(\"beforeSanitizeElements\",(function(e){return e.href&&e.setAttribute(\"rel\",\"noopener noreferrer\"),e}));const hn=function Markdown({source:e,className:t=\"\",getConfigs:r=(()=>({useUnsafeMarkdown:!1}))}){if(\"string\"!=typeof e)return null;const a=new pn.Remarkable({html:!0,typographer:!0,breaks:!0,linkTarget:\"_blank\"}).use(mn.linkify);a.core.ruler.disable([\"replacements\",\"smartquotes\"]);const{useUnsafeMarkdown:n}=r(),s=a.render(e),o=sanitizer(s,{useUnsafeMarkdown:n});return e&&s&&o?x().createElement(\"div\",{className:ut()(t,\"markdown\"),dangerouslySetInnerHTML:{__html:o}}):null};function sanitizer(e,{useUnsafeMarkdown:t=!1}={}){const r=t,a=t?[]:[\"style\",\"class\"];return t&&!sanitizer.hasWarnedAboutDeprecation&&(console.warn(\"useUnsafeMarkdown display configuration parameter is deprecated since >3.26.0 and will be removed in v4.0.0.\"),sanitizer.hasWarnedAboutDeprecation=!0),dn().sanitize(e,{ADD_ATTR:[\"target\"],FORBID_TAGS:[\"style\",\"form\"],ALLOW_DATA_ATTR:r,FORBID_ATTR:a})}sanitizer.hasWarnedAboutDeprecation=!1;class BaseLayout extends x().Component{render(){const{errSelectors:e,specSelectors:t,getComponent:r}=this.props,a=r(\"SvgAssets\"),n=r(\"InfoContainer\",!0),s=r(\"VersionPragmaFilter\"),o=r(\"operations\",!0),l=r(\"Models\",!0),c=r(\"Webhooks\",!0),i=r(\"Row\"),p=r(\"Col\"),m=r(\"errors\",!0),u=r(\"ServersContainer\",!0),d=r(\"SchemesContainer\",!0),h=r(\"AuthorizeBtnContainer\",!0),g=r(\"FilterContainer\",!0),y=t.isSwagger2(),f=t.isOAS3(),S=t.isOAS31(),E=!t.specStr(),_=t.loadingStatus();let v=null;if(\"loading\"===_&&(v=x().createElement(\"div\",{className:\"info\"},x().createElement(\"div\",{className:\"loading-container\"},x().createElement(\"div\",{className:\"loading\"})))),\"failed\"===_&&(v=x().createElement(\"div\",{className:\"info\"},x().createElement(\"div\",{className:\"loading-container\"},x().createElement(\"h4\",{className:\"title\"},\"Failed to load API definition.\"),x().createElement(m,null)))),\"failedConfig\"===_){const t=e.lastError(),r=t?t.get(\"message\"):\"\";v=x().createElement(\"div\",{className:\"info failed-config\"},x().createElement(\"div\",{className:\"loading-container\"},x().createElement(\"h4\",{className:\"title\"},\"Failed to load remote configuration.\"),x().createElement(\"p\",null,r)))}if(!v&&E&&(v=x().createElement(\"h4\",null,\"No API definition provided.\")),v)return x().createElement(\"div\",{className:\"swagger-ui\"},x().createElement(\"div\",{className:\"loading-container\"},v));const w=t.servers(),b=t.schemes(),C=w&&w.size,O=b&&b.size,N=!!t.securityDefinitions();return x().createElement(\"div\",{className:\"swagger-ui\"},x().createElement(a,null),x().createElement(s,{isSwagger2:y,isOAS3:f,alsoShow:x().createElement(m,null)},x().createElement(m,null),x().createElement(i,{className:\"information-container\"},x().createElement(p,{mobile:12},x().createElement(n,null))),C||O||N?x().createElement(\"div\",{className:\"scheme-container\"},x().createElement(p,{className:\"schemes wrapper\",mobile:12},C||O?x().createElement(\"div\",{className:\"schemes-server-container\"},C?x().createElement(u,null):null,O?x().createElement(d,null):null):null,N?x().createElement(h,null):null)):null,x().createElement(g,null),x().createElement(i,null,x().createElement(p,{mobile:12,desktop:12},x().createElement(o,null))),S&&x().createElement(i,{className:\"webhooks-container\"},x().createElement(p,{mobile:12,desktop:12},x().createElement(c,null))),x().createElement(i,null,x().createElement(p,{mobile:12,desktop:12},x().createElement(l,null)))))}}const core_components=()=>({components:{App:Ga,authorizationPopup:AuthorizationPopup,authorizeBtn:AuthorizeBtn,AuthorizeBtnContainer,authorizeOperationBtn:AuthorizeOperationBtn,auths:Auths,AuthItem:auth_item_Auths,authError:AuthError,oauth2:Oauth2,apiKeyAuth:ApiKeyAuth,basicAuth:BasicAuth,clear:Clear,liveResponse:LiveResponse,InitializedInput,info:sn,InfoContainer,InfoUrl,InfoBasePath,Contact:on,License:ln,JumpToPath,CopyToClipboardBtn,onlineValidatorBadge:OnlineValidatorBadge,operations:Operations,operation:Operation,OperationSummary,OperationSummaryMethod,OperationSummaryPath,responses:Responses,response:Response,ResponseExtension:response_extension,responseBody:ResponseBody,parameters:Parameters,parameterRow:ParameterRow,execute:Execute,headers:headers_Headers,errors:Errors,contentType:ContentType,overview:Overview,footer:Footer,FilterContainer,ParamBody,curl:Curl,Property:property,TryItOutButton,Markdown:hn,BaseLayout,VersionPragmaFilter,VersionStamp:version_stamp,OperationExt:operation_extensions,OperationExtRow:operation_extension_row,ParameterExt:parameter_extension,ParameterIncludeEmpty,OperationTag,OperationContainer,OpenAPIVersion:openapi_version,DeepLink:deep_link,SvgAssets:svg_assets,Example,ExamplesSelect,ExamplesSelectValueRetainer}}),form_components=()=>({components:{...S}}),base=()=>[configsPlugin,util,logs,view,view_legacy,plugins_spec,err,icons,plugins_layout,json_schema_5,json_schema_5_samples,core_components,form_components,swagger_client,auth,downloadUrlPlugin,deep_linking,filter,on_complete,plugins_request_snippets,syntax_highlighting,versions,safe_render()],gn=(0,N.Map)();function onlyOAS3(e){return(t,r)=>(...a)=>{if(r.getSystem().specSelectors.isOAS3()){const t=e(...a);return\"function\"==typeof t?t(r):t}return t(...a)}}const yn=onlyOAS3(Vt()(null)),fn=onlyOAS3(((e,t)=>e=>e.getSystem().specSelectors.findSchema(t))),Sn=onlyOAS3((()=>e=>{const t=e.getSystem().specSelectors.specJson().getIn([\"components\",\"schemas\"]);return N.Map.isMap(t)?t:gn})),En=onlyOAS3((()=>e=>e.getSystem().specSelectors.specJson().hasIn([\"servers\",0]))),_n=onlyOAS3((0,we.createSelector)(Ht,(e=>e.getIn([\"components\",\"securitySchemes\"])||null))),wrap_selectors_validOperationMethods=(e,t)=>(r,...a)=>t.specSelectors.isOAS3()?t.oas3Selectors.validOperationMethods():e(...a),vn=yn,wn=yn,bn=yn,Cn=yn,xn=yn;const On=function wrap_selectors_onlyOAS3(e){return(t,r)=>(...a)=>{if(r.getSystem().specSelectors.isOAS3()){let t=r.getState().getIn([\"spec\",\"resolvedSubtrees\",\"components\",\"securitySchemes\"]);return e(r,t,...a)}return t(...a)}}((0,we.createSelector)((e=>e),(({specSelectors:e})=>e.securityDefinitions()),((e,t)=>{let r=(0,N.List)();return t?(t.entrySeq().forEach((([e,t])=>{const a=t.get(\"type\");if(\"oauth2\"===a&&t.get(\"flows\").entrySeq().forEach((([a,n])=>{let s=(0,N.fromJS)({flow:a,authorizationUrl:n.get(\"authorizationUrl\"),tokenUrl:n.get(\"tokenUrl\"),scopes:n.get(\"scopes\"),type:t.get(\"type\"),description:t.get(\"description\")});r=r.push(new N.Map({[e]:s.filter((e=>void 0!==e))}))})),\"http\"!==a&&\"apiKey\"!==a||(r=r.push(new N.Map({[e]:t}))),\"openIdConnect\"===a&&t.get(\"openIdConnectData\")){let a=t.get(\"openIdConnectData\");(a.get(\"grant_types_supported\")||[\"authorization_code\",\"implicit\"]).forEach((n=>{let s=a.get(\"scopes_supported\")&&a.get(\"scopes_supported\").reduce(((e,t)=>e.set(t,\"\")),new N.Map),o=(0,N.fromJS)({flow:n,authorizationUrl:a.get(\"authorization_endpoint\"),tokenUrl:a.get(\"token_endpoint\"),scopes:s,type:\"oauth2\",openIdConnectUrl:t.get(\"openIdConnectUrl\")});r=r.push(new N.Map({[e]:o.filter((e=>void 0!==e))}))}))}})),r):r})));function OAS3ComponentWrapFactory(e){return(t,r)=>a=>\"function\"==typeof r.specSelectors?.isOAS3?r.specSelectors.isOAS3()?x().createElement(e,et()({},a,r,{Ori:t})):x().createElement(t,a):(console.warn(\"OAS3 wrapper: couldn't get spec\"),null)}const Nn=(0,N.Map)(),selectors_isSwagger2=()=>e=>function isSwagger2(e){const t=e.get(\"swagger\");return\"string\"==typeof t&&\"2.0\"===t}(e.getSystem().specSelectors.specJson()),selectors_isOAS30=()=>e=>function isOAS30(e){const t=e.get(\"openapi\");return\"string\"==typeof t&&/^3\\.0\\.([0123])(?:-rc[012])?$/.test(t)}(e.getSystem().specSelectors.specJson()),selectors_isOAS3=()=>e=>e.getSystem().specSelectors.isOAS30();function selectors_onlyOAS3(e){return(t,...r)=>a=>{if(a.specSelectors.isOAS3()){const n=e(t,...r);return\"function\"==typeof n?n(a):n}return null}}const kn=selectors_onlyOAS3((()=>e=>e.specSelectors.specJson().get(\"servers\",Nn))),findSchema=(e,t)=>{const r=e.getIn([\"resolvedSubtrees\",\"components\",\"schemas\",t],null),a=e.getIn([\"json\",\"components\",\"schemas\",t],null);return r||a||null},An=selectors_onlyOAS3(((e,{callbacks:t,specPath:r})=>e=>{const a=e.specSelectors.validOperationMethods();return N.Map.isMap(t)?t.reduce(((e,t,n)=>{if(!N.Map.isMap(t))return e;const s=t.reduce(((e,t,s)=>{if(!N.Map.isMap(t))return e;const o=t.entrySeq().filter((([e])=>a.includes(e))).map((([e,t])=>({operation:(0,N.Map)({operation:t}),method:e,path:s,callbackName:n,specPath:r.concat([n,s,e])})));return e.concat(o)}),(0,N.List)());return e.concat(s)}),(0,N.List)()).groupBy((e=>e.callbackName)).map((e=>e.toArray())).toObject():{}})),callbacks=({callbacks:e,specPath:t,specSelectors:r,getComponent:a})=>{const n=r.callbacksOperations({callbacks:e,specPath:t}),s=Object.keys(n),o=a(\"OperationContainer\",!0);return 0===s.length?x().createElement(\"span\",null,\"No callbacks\"):x().createElement(\"div\",null,s.map((e=>x().createElement(\"div\",{key:`${e}`},x().createElement(\"h2\",null,e),n[e].map((t=>x().createElement(o,{key:`${e}-${t.path}-${t.method}`,op:t.operation,tag:\"callbacks\",method:t.method,path:t.path,specPath:t.specPath,allowTryItOut:!1})))))))},getDefaultRequestBodyValue=(e,t,r,a)=>{const n=e.getIn([\"content\",t])??(0,N.OrderedMap)(),s=n.get(\"schema\",(0,N.OrderedMap)()).toJS(),o=void 0!==n.get(\"examples\"),l=n.get(\"example\"),c=o?n.getIn([\"examples\",r,\"value\"]):l;return stringify(a.getSampleSchema(s,t,{includeWriteOnly:!0},c))},request_body=({userHasEditedBody:e,requestBody:t,requestBodyValue:r,requestBodyInclusionSetting:a,requestBodyErrors:n,getComponent:s,getConfigs:o,specSelectors:l,fn:c,contentType:i,isExecute:p,specPath:m,onChange:u,onChangeIncludeEmpty:d,activeExamplesKey:h,updateActiveExamplesKey:g,setRetainRequestBodyValueFlag:y})=>{const handleFile=e=>{u(e.target.files[0])},setIsIncludedOptions=e=>{let t={key:e,shouldDispatchInit:!1,defaultValue:!0};return\"no value\"===a.get(e,\"no value\")&&(t.shouldDispatchInit=!0),t},f=s(\"Markdown\",!0),S=s(\"modelExample\"),E=s(\"RequestBodyEditor\"),_=s(\"HighlightCode\",!0),v=s(\"ExamplesSelectValueRetainer\"),w=s(\"Example\"),b=s(\"ParameterIncludeEmpty\"),{showCommonExtensions:C}=o(),O=t?.get(\"description\")??null,k=t?.get(\"content\")??new N.OrderedMap;i=i||k.keySeq().first()||\"\";const A=k.get(i)??(0,N.OrderedMap)(),I=A.get(\"schema\",(0,N.OrderedMap)()),q=A.get(\"examples\",null),j=q?.map(((e,r)=>{const a=e?.get(\"value\",null);return a&&(e=e.set(\"value\",getDefaultRequestBodyValue(t,i,r,c),a)),e}));if(n=N.List.isList(n)?n:(0,N.List)(),!A.size)return null;const P=\"object\"===A.getIn([\"schema\",\"type\"]),M=\"binary\"===A.getIn([\"schema\",\"format\"]),R=\"base64\"===A.getIn([\"schema\",\"format\"]);if(\"application/octet-stream\"===i||0===i.indexOf(\"image/\")||0===i.indexOf(\"audio/\")||0===i.indexOf(\"video/\")||M||R){const e=s(\"Input\");return p?x().createElement(e,{type:\"file\",onChange:handleFile}):x().createElement(\"i\",null,\"Example values are not available for \",x().createElement(\"code\",null,i),\" media types.\")}if(P&&(\"application/x-www-form-urlencoded\"===i||0===i.indexOf(\"multipart/\"))&&I.get(\"properties\",(0,N.OrderedMap)()).size>0){const e=s(\"JsonSchemaForm\"),t=s(\"ParameterExt\"),o=I.get(\"properties\",(0,N.OrderedMap)());return r=N.Map.isMap(r)?r:(0,N.OrderedMap)(),x().createElement(\"div\",{className:\"table-container\"},O&&x().createElement(f,{source:O}),x().createElement(\"table\",null,x().createElement(\"tbody\",null,N.Map.isMap(o)&&o.entrySeq().map((([o,l])=>{if(l.get(\"readOnly\"))return;const i=l.get(\"oneOf\")?.get(0)?.toJS(),m=l.get(\"anyOf\")?.get(0)?.toJS();l=(0,N.fromJS)(c.mergeJsonSchema(l.toJS(),i??m??{}));let h=C?getCommonExtensions(l):null;const g=I.get(\"required\",(0,N.List)()).includes(o),y=l.get(\"type\"),S=l.get(\"format\"),E=l.get(\"description\"),_=r.getIn([o,\"value\"]),v=r.getIn([o,\"errors\"])||n,w=a.get(o)||!1;let O=c.getSampleSchema(l,!1,{includeWriteOnly:!0});!1===O&&(O=\"false\"),0===O&&(O=\"0\"),\"string\"!=typeof O&&\"object\"===y&&(O=stringify(O)),\"string\"==typeof O&&\"array\"===y&&(O=JSON.parse(O));const k=\"string\"===y&&(\"binary\"===S||\"base64\"===S);return x().createElement(\"tr\",{key:o,className:\"parameters\",\"data-property-name\":o},x().createElement(\"td\",{className:\"parameters-col_name\"},x().createElement(\"div\",{className:g?\"parameter__name required\":\"parameter__name\"},o,g?x().createElement(\"span\",null,\" *\"):null),x().createElement(\"div\",{className:\"parameter__type\"},y,S&&x().createElement(\"span\",{className:\"prop-format\"},\"($\",S,\")\"),C&&h.size?h.entrySeq().map((([e,r])=>x().createElement(t,{key:`${e}-${r}`,xKey:e,xVal:r}))):null),x().createElement(\"div\",{className:\"parameter__deprecated\"},l.get(\"deprecated\")?\"deprecated\":null)),x().createElement(\"td\",{className:\"parameters-col_description\"},x().createElement(f,{source:E}),p?x().createElement(\"div\",null,x().createElement(e,{fn:c,dispatchInitialValue:!k,schema:l,description:o,getComponent:s,value:void 0===_?O:_,required:g,errors:v,onChange:e=>{u(e,[o])}}),g?null:x().createElement(b,{onChange:e=>d(o,e),isIncluded:w,isIncludedOptions:setIsIncludedOptions(o),isDisabled:Array.isArray(_)?0!==_.length:!isEmptyValue(_)})):null))})))))}const T=getDefaultRequestBodyValue(t,i,h,c);let J=null;return getKnownSyntaxHighlighterLanguage(T)&&(J=\"json\"),x().createElement(\"div\",null,O&&x().createElement(f,{source:O}),j?x().createElement(v,{userHasEditedBody:e,examples:j,currentKey:h,currentUserInputValue:r,onSelect:e=>{g(e)},updateValue:u,defaultToFirstExample:!0,getComponent:s,setRetainRequestBodyValueFlag:y}):null,p?x().createElement(\"div\",null,x().createElement(E,{value:r,errors:n,defaultValue:T,onChange:u,getComponent:s})):x().createElement(S,{getComponent:s,getConfigs:o,specSelectors:l,expandDepth:1,isExecute:p,schema:A.get(\"schema\"),specPath:m.push(\"content\",i),example:x().createElement(_,{className:\"body-param__example\",language:J},stringify(r)||T),includeWriteOnly:!0}),j?x().createElement(w,{example:j.get(h),getComponent:s,getConfigs:o}):null)};class operation_link_OperationLink extends C.Component{render(){const{link:e,name:t,getComponent:r}=this.props,a=r(\"Markdown\",!0);let n=e.get(\"operationId\")||e.get(\"operationRef\"),s=e.get(\"parameters\")&&e.get(\"parameters\").toJS(),o=e.get(\"description\");return x().createElement(\"div\",{className:\"operation-link\"},x().createElement(\"div\",{className:\"description\"},x().createElement(\"b\",null,x().createElement(\"code\",null,t)),o?x().createElement(a,{source:o}):null),x().createElement(\"pre\",null,\"Operation `\",n,\"`\",x().createElement(\"br\",null),x().createElement(\"br\",null),\"Parameters \",function padString(e,t){if(\"string\"!=typeof t)return\"\";return t.split(\"\\n\").map(((t,r)=>r>0?Array(e+1).join(\" \")+t:t)).join(\"\\n\")}(0,JSON.stringify(s,null,2))||\"{}\",x().createElement(\"br\",null)))}}const In=operation_link_OperationLink,components_servers=({servers:e,currentServer:t,setSelectedServer:r,setServerVariableValue:a,getServerVariable:n,getEffectiveServerValue:s})=>{const o=(e.find((e=>e.get(\"url\")===t))||(0,N.OrderedMap)()).get(\"variables\")||(0,N.OrderedMap)(),l=0!==o.size;(0,C.useEffect)((()=>{t||r(e.first()?.get(\"url\"))}),[]),(0,C.useEffect)((()=>{const n=e.find((e=>e.get(\"url\")===t));if(!n)return void r(e.first().get(\"url\"));(n.get(\"variables\")||(0,N.OrderedMap)()).map(((e,r)=>{a({server:t,key:r,val:e.get(\"default\")||\"\"})}))}),[t,e]);const c=(0,C.useCallback)((e=>{r(e.target.value)}),[r]),i=(0,C.useCallback)((e=>{const r=e.target.getAttribute(\"data-variable\"),n=e.target.value;a({server:t,key:r,val:n})}),[a,t]);return x().createElement(\"div\",{className:\"servers\"},x().createElement(\"label\",{htmlFor:\"servers\"},x().createElement(\"select\",{onChange:c,value:t,id:\"servers\"},e.valueSeq().map((e=>x().createElement(\"option\",{value:e.get(\"url\"),key:e.get(\"url\")},e.get(\"url\"),e.get(\"description\")&&` - ${e.get(\"description\")}`))).toArray())),l&&x().createElement(\"div\",null,x().createElement(\"div\",{className:\"computed-url\"},\"Computed URL:\",x().createElement(\"code\",null,s(t))),x().createElement(\"h4\",null,\"Server variables\"),x().createElement(\"table\",null,x().createElement(\"tbody\",null,o.entrySeq().map((([e,r])=>x().createElement(\"tr\",{key:e},x().createElement(\"td\",null,e),x().createElement(\"td\",null,r.get(\"enum\")?x().createElement(\"select\",{\"data-variable\":e,onChange:i},r.get(\"enum\").map((r=>x().createElement(\"option\",{selected:r===n(t,e),key:r,value:r},r)))):x().createElement(\"input\",{type:\"text\",value:n(t,e)||\"\",onChange:i,\"data-variable\":e})))))))))};class ServersContainer extends x().Component{render(){const{specSelectors:e,oas3Selectors:t,oas3Actions:r,getComponent:a}=this.props,n=e.servers(),s=a(\"Servers\");return n&&n.size?x().createElement(\"div\",null,x().createElement(\"span\",{className:\"servers-title\"},\"Servers\"),x().createElement(s,{servers:n,currentServer:t.selectedServer(),setSelectedServer:r.setSelectedServer,setServerVariableValue:r.setServerVariableValue,getServerVariable:t.serverVariableValue,getEffectiveServerValue:t.serverEffectiveValue})):null}}const qn=Function.prototype;class RequestBodyEditor extends C.PureComponent{static defaultProps={onChange:qn,userHasEditedBody:!1};constructor(e,t){super(e,t),this.state={value:stringify(e.value)||e.defaultValue},e.onChange(e.value)}applyDefaultValue=e=>{const{onChange:t,defaultValue:r}=e||this.props;return this.setState({value:r}),t(r)};onChange=e=>{this.props.onChange(stringify(e))};onDomChange=e=>{const t=e.target.value;this.setState({value:t},(()=>this.onChange(t)))};UNSAFE_componentWillReceiveProps(e){this.props.value!==e.value&&e.value!==this.state.value&&this.setState({value:stringify(e.value)}),!e.value&&e.defaultValue&&this.state.value&&this.applyDefaultValue(e)}render(){let{getComponent:e,errors:t}=this.props,{value:r}=this.state,a=t.size>0;const n=e(\"TextArea\");return x().createElement(\"div\",{className:\"body-param\"},x().createElement(n,{className:ut()(\"body-param__text\",{invalid:a}),title:t.size?t.join(\", \"):\"\",value:r,onChange:this.onDomChange}))}}class HttpAuth extends x().Component{constructor(e,t){super(e,t);let{name:r,schema:a}=this.props,n=this.getValue();this.state={name:r,schema:a,value:n}}getValue(){let{name:e,authorized:t}=this.props;return t&&t.getIn([e,\"value\"])}onChange=e=>{let{onChange:t}=this.props,{value:r,name:a}=e.target,n=Object.assign({},this.state.value);a?n[a]=r:n=r,this.setState({value:n},(()=>t(this.state)))};render(){let{schema:e,getComponent:t,errSelectors:r,name:a}=this.props;const n=t(\"Input\"),s=t(\"Row\"),o=t(\"Col\"),l=t(\"authError\"),c=t(\"Markdown\",!0),i=t(\"JumpToPath\",!0),p=(e.get(\"scheme\")||\"\").toLowerCase();let m=this.getValue(),u=r.allErrors().filter((e=>e.get(\"authId\")===a));if(\"basic\"===p){let t=m?m.get(\"username\"):null;return x().createElement(\"div\",null,x().createElement(\"h4\",null,x().createElement(\"code\",null,a||e.get(\"name\")),\"  (http, Basic)\",x().createElement(i,{path:[\"securityDefinitions\",a]})),t&&x().createElement(\"h6\",null,\"Authorized\"),x().createElement(s,null,x().createElement(c,{source:e.get(\"description\")})),x().createElement(s,null,x().createElement(\"label\",{htmlFor:\"auth-basic-username\"},\"Username:\"),t?x().createElement(\"code\",null,\" \",t,\" \"):x().createElement(o,null,x().createElement(n,{id:\"auth-basic-username\",type:\"text\",required:\"required\",name:\"username\",\"aria-label\":\"auth-basic-username\",onChange:this.onChange,autoFocus:!0}))),x().createElement(s,null,x().createElement(\"label\",{htmlFor:\"auth-basic-password\"},\"Password:\"),t?x().createElement(\"code\",null,\" ****** \"):x().createElement(o,null,x().createElement(n,{id:\"auth-basic-password\",autoComplete:\"new-password\",name:\"password\",type:\"password\",\"aria-label\":\"auth-basic-password\",onChange:this.onChange}))),u.valueSeq().map(((e,t)=>x().createElement(l,{error:e,key:t}))))}return\"bearer\"===p?x().createElement(\"div\",null,x().createElement(\"h4\",null,x().createElement(\"code\",null,a||e.get(\"name\")),\"  (http, Bearer)\",x().createElement(i,{path:[\"securityDefinitions\",a]})),m&&x().createElement(\"h6\",null,\"Authorized\"),x().createElement(s,null,x().createElement(c,{source:e.get(\"description\")})),x().createElement(s,null,x().createElement(\"label\",{htmlFor:\"auth-bearer-value\"},\"Value:\"),m?x().createElement(\"code\",null,\" ****** \"):x().createElement(o,null,x().createElement(n,{id:\"auth-bearer-value\",type:\"text\",\"aria-label\":\"auth-bearer-value\",onChange:this.onChange,autoFocus:!0}))),u.valueSeq().map(((e,t)=>x().createElement(l,{error:e,key:t})))):x().createElement(\"div\",null,x().createElement(\"em\",null,x().createElement(\"b\",null,a),\" HTTP authentication: unsupported scheme \",`'${p}'`))}}class OperationServers extends x().Component{setSelectedServer=e=>{const{path:t,method:r}=this.props;return this.forceUpdate(),this.props.setSelectedServer(e,`${t}:${r}`)};setServerVariableValue=e=>{const{path:t,method:r}=this.props;return this.forceUpdate(),this.props.setServerVariableValue({...e,namespace:`${t}:${r}`})};getSelectedServer=()=>{const{path:e,method:t}=this.props;return this.props.getSelectedServer(`${e}:${t}`)};getServerVariable=(e,t)=>{const{path:r,method:a}=this.props;return this.props.getServerVariable({namespace:`${r}:${a}`,server:e},t)};getEffectiveServerValue=e=>{const{path:t,method:r}=this.props;return this.props.getEffectiveServerValue({server:e,namespace:`${t}:${r}`})};render(){const{operationServers:e,pathServers:t,getComponent:r}=this.props;if(!e&&!t)return null;const a=r(\"Servers\"),n=e||t,s=e?\"operation\":\"path\";return x().createElement(\"div\",{className:\"opblock-section operation-servers\"},x().createElement(\"div\",{className:\"opblock-section-header\"},x().createElement(\"div\",{className:\"tab-header\"},x().createElement(\"h4\",{className:\"opblock-title\"},\"Servers\"))),x().createElement(\"div\",{className:\"opblock-description-wrapper\"},x().createElement(\"h4\",{className:\"message\"},\"These \",s,\"-level options override the global server options.\"),x().createElement(a,{servers:n,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}const jn={Callbacks:callbacks,HttpAuth,RequestBody:request_body,Servers:components_servers,ServersContainer,RequestBodyEditor,OperationServers,operationLink:In},Pn=new pn.Remarkable(\"commonmark\");Pn.block.ruler.enable([\"table\"]),Pn.set({linkTarget:\"_blank\"});const Mn=OAS3ComponentWrapFactory((({source:e,className:t=\"\",getConfigs:r=(()=>({useUnsafeMarkdown:!1}))})=>{if(\"string\"!=typeof e)return null;if(e){const{useUnsafeMarkdown:a}=r(),n=sanitizer(Pn.render(e),{useUnsafeMarkdown:a});let s;return\"string\"==typeof n&&(s=n.trim()),x().createElement(\"div\",{dangerouslySetInnerHTML:{__html:s},className:ut()(t,\"renderedMarkdown\")})}return null})),Rn=OAS3ComponentWrapFactory((({Ori:e,...t})=>{const{schema:r,getComponent:a,errSelectors:n,authorized:s,onAuthChange:o,name:l}=t,c=a(\"HttpAuth\");return\"http\"===r.get(\"type\")?x().createElement(c,{key:l,schema:r,name:l,errSelectors:n,authorized:s,getComponent:a,onChange:o}):x().createElement(e,t)})),Tn=OAS3ComponentWrapFactory(OnlineValidatorBadge);class ModelComponent extends C.Component{render(){let{getConfigs:e,schema:t,Ori:r}=this.props,a=[\"model-box\"],n=null;return!0===t.get(\"deprecated\")&&(a.push(\"deprecated\"),n=x().createElement(\"span\",{className:\"model-deprecated-warning\"},\"Deprecated:\")),x().createElement(\"div\",{className:a.join(\" \")},n,x().createElement(r,et()({},this.props,{getConfigs:e,depth:1,expandDepth:this.props.expandDepth||0})))}}const Jn=OAS3ComponentWrapFactory(ModelComponent),$n=OAS3ComponentWrapFactory((({Ori:e,...t})=>{const{schema:r,getComponent:a,errors:n,onChange:s}=t,o=r&&r.get?r.get(\"format\"):null,l=r&&r.get?r.get(\"type\"):null,c=a(\"Input\");return l&&\"string\"===l&&o&&(\"binary\"===o||\"base64\"===o)?x().createElement(c,{type:\"file\",className:n.length?\"invalid\":\"\",title:n.length?n:\"\",onChange:e=>{s(e.target.files[0])},disabled:e.isDisabled}):x().createElement(e,t)})),Vn={Markdown:Mn,AuthItem:Rn,OpenAPIVersion:function OAS30ComponentWrapFactory(e){return(t,r)=>a=>\"function\"==typeof r.specSelectors?.isOAS30?r.specSelectors.isOAS30()?x().createElement(e,et()({},a,r,{Ori:t})):x().createElement(t,a):(console.warn(\"OAS30 wrapper: couldn't get spec\"),null)}((e=>{const{Ori:t}=e;return x().createElement(t,{oasVersion:\"3.0\"})})),JsonSchema_string:$n,model:Jn,onlineValidatorBadge:Tn},Dn=\"oas3_set_servers\",Kn=\"oas3_set_request_body_value\",Ln=\"oas3_set_request_body_retain_flag\",Un=\"oas3_set_request_body_inclusion\",zn=\"oas3_set_active_examples_member\",Bn=\"oas3_set_request_content_type\",Fn=\"oas3_set_response_content_type\",Wn=\"oas3_set_server_variable_value\",Hn=\"oas3_set_request_body_validate_error\",Xn=\"oas3_clear_request_body_validate_error\",Gn=\"oas3_clear_request_body_value\";function setSelectedServer(e,t){return{type:Dn,payload:{selectedServerUrl:e,namespace:t}}}function setRequestBodyValue({value:e,pathMethod:t}){return{type:Kn,payload:{value:e,pathMethod:t}}}const setRetainRequestBodyValueFlag=({value:e,pathMethod:t})=>({type:Ln,payload:{value:e,pathMethod:t}});function setRequestBodyInclusion({value:e,pathMethod:t,name:r}){return{type:Un,payload:{value:e,pathMethod:t,name:r}}}function setActiveExamplesMember({name:e,pathMethod:t,contextType:r,contextName:a}){return{type:zn,payload:{name:e,pathMethod:t,contextType:r,contextName:a}}}function setRequestContentType({value:e,pathMethod:t}){return{type:Bn,payload:{value:e,pathMethod:t}}}function setResponseContentType({value:e,path:t,method:r}){return{type:Fn,payload:{value:e,path:t,method:r}}}function setServerVariableValue({server:e,namespace:t,key:r,val:a}){return{type:Wn,payload:{server:e,namespace:t,key:r,val:a}}}const setRequestBodyValidateError=({path:e,method:t,validationErrors:r})=>({type:Hn,payload:{path:e,method:t,validationErrors:r}}),clearRequestBodyValidateError=({path:e,method:t})=>({type:Xn,payload:{path:e,method:t}}),initRequestBodyValidateError=({pathMethod:e})=>({type:Xn,payload:{path:e[0],method:e[1]}}),clearRequestBodyValue=({pathMethod:e})=>({type:Gn,payload:{pathMethod:e}}),Yn=require(\"lodash/escapeRegExp\");var Qn=__webpack_require__.n(Yn);const oas3_selectors_onlyOAS3=e=>(t,...r)=>a=>{if(a.getSystem().specSelectors.isOAS3()){const n=e(t,...r);return\"function\"==typeof n?n(a):n}return null};const Zn=oas3_selectors_onlyOAS3(((e,t)=>{const r=t?[t,\"selectedServer\"]:[\"selectedServer\"];return e.getIn(r)||\"\"})),es=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"bodyValue\"])||null)),ts=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"retainBodyValue\"])||!1)),selectDefaultRequestBodyValue=(e,t,r)=>e=>{const{oas3Selectors:a,specSelectors:n,fn:s}=e.getSystem();if(n.isOAS3()){const e=a.requestContentType(t,r);if(e)return getDefaultRequestBodyValue(n.specResolvedSubtree([\"paths\",t,r,\"requestBody\"]),e,a.activeExamplesMember(t,r,\"requestBody\",\"requestBody\"),s)}return null},rs=oas3_selectors_onlyOAS3(((e,t,r)=>e=>{const{oas3Selectors:a,specSelectors:n,fn:s}=e;let o=!1;const l=a.requestContentType(t,r);let c=a.requestBodyValue(t,r);const i=n.specResolvedSubtree([\"paths\",t,r,\"requestBody\"]);if(!i)return!1;if(N.Map.isMap(c)&&(c=stringify(c.mapEntries((e=>N.Map.isMap(e[1])?[e[0],e[1].get(\"value\")]:e)).toJS())),N.List.isList(c)&&(c=stringify(c)),l){const e=getDefaultRequestBodyValue(i,l,a.activeExamplesMember(t,r,\"requestBody\",\"requestBody\"),s);o=!!c&&c!==e}return o})),as=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"bodyInclusion\"])||(0,N.Map)())),ns=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"errors\"])||null)),ss=oas3_selectors_onlyOAS3(((e,t,r,a,n)=>e.getIn([\"examples\",t,r,a,n,\"activeExample\"])||null)),os=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"requestContentType\"])||null)),ls=oas3_selectors_onlyOAS3(((e,t,r)=>e.getIn([\"requestData\",t,r,\"responseContentType\"])||null)),cs=oas3_selectors_onlyOAS3(((e,t,r)=>{let a;if(\"string\"!=typeof t){const{server:e,namespace:n}=t;a=n?[n,\"serverVariableValues\",e,r]:[\"serverVariableValues\",e,r]}else{a=[\"serverVariableValues\",t,r]}return e.getIn(a)||null})),is=oas3_selectors_onlyOAS3(((e,t)=>{let r;if(\"string\"!=typeof t){const{server:e,namespace:a}=t;r=a?[a,\"serverVariableValues\",e]:[\"serverVariableValues\",e]}else{r=[\"serverVariableValues\",t]}return e.getIn(r)||(0,N.OrderedMap)()})),ps=oas3_selectors_onlyOAS3(((e,t)=>{var r,a;if(\"string\"!=typeof t){const{server:n,namespace:s}=t;a=n,r=s?e.getIn([s,\"serverVariableValues\",a]):e.getIn([\"serverVariableValues\",a])}else a=t,r=e.getIn([\"serverVariableValues\",a]);r=r||(0,N.OrderedMap)();let n=a;return r.map(((e,t)=>{n=n.replace(new RegExp(`{${Qn()(t)}}`,\"g\"),e)})),n})),ms=function validateRequestBodyIsRequired(e){return(...t)=>r=>{const a=r.getSystem().specSelectors.specJson();let n=[...t][1]||[];return!a.getIn([\"paths\",...n,\"requestBody\",\"required\"])||e(...t)}}(((e,t)=>((e,t)=>(t=t||[],!!e.getIn([\"requestData\",...t,\"bodyValue\"])))(e,t))),validateShallowRequired=(e,{oas3RequiredRequestBodyContentType:t,oas3RequestContentType:r,oas3RequestBodyValue:a})=>{let n=[];if(!N.Map.isMap(a))return n;let s=[];return Object.keys(t.requestContentType).forEach((e=>{if(e===r){t.requestContentType[e].forEach((e=>{s.indexOf(e)<0&&s.push(e)}))}})),s.forEach((e=>{a.getIn([e,\"value\"])||n.push(e)})),n},us=Vt()([\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"]),ds={[Dn]:(e,{payload:{selectedServerUrl:t,namespace:r}})=>{const a=r?[r,\"selectedServer\"]:[\"selectedServer\"];return e.setIn(a,t)},[Kn]:(e,{payload:{value:t,pathMethod:r}})=>{let[a,n]=r;if(!N.Map.isMap(t))return e.setIn([\"requestData\",a,n,\"bodyValue\"],t);let s,o=e.getIn([\"requestData\",a,n,\"bodyValue\"])||(0,N.Map)();N.Map.isMap(o)||(o=(0,N.Map)());const[...l]=t.keys();return l.forEach((e=>{let r=t.getIn([e]);o.has(e)&&N.Map.isMap(r)||(s=o.setIn([e,\"value\"],r))})),e.setIn([\"requestData\",a,n,\"bodyValue\"],s)},[Ln]:(e,{payload:{value:t,pathMethod:r}})=>{let[a,n]=r;return e.setIn([\"requestData\",a,n,\"retainBodyValue\"],t)},[Un]:(e,{payload:{value:t,pathMethod:r,name:a}})=>{let[n,s]=r;return e.setIn([\"requestData\",n,s,\"bodyInclusion\",a],t)},[zn]:(e,{payload:{name:t,pathMethod:r,contextType:a,contextName:n}})=>{let[s,o]=r;return e.setIn([\"examples\",s,o,a,n,\"activeExample\"],t)},[Bn]:(e,{payload:{value:t,pathMethod:r}})=>{let[a,n]=r;return e.setIn([\"requestData\",a,n,\"requestContentType\"],t)},[Fn]:(e,{payload:{value:t,path:r,method:a}})=>e.setIn([\"requestData\",r,a,\"responseContentType\"],t),[Wn]:(e,{payload:{server:t,namespace:r,key:a,val:n}})=>{const s=r?[r,\"serverVariableValues\",t,a]:[\"serverVariableValues\",t,a];return e.setIn(s,n)},[Hn]:(e,{payload:{path:t,method:r,validationErrors:a}})=>{let n=[];if(n.push(\"Required field is not provided\"),a.missingBodyValue)return e.setIn([\"requestData\",t,r,\"errors\"],(0,N.fromJS)(n));if(a.missingRequiredKeys&&a.missingRequiredKeys.length>0){const{missingRequiredKeys:s}=a;return e.updateIn([\"requestData\",t,r,\"bodyValue\"],(0,N.fromJS)({}),(e=>s.reduce(((e,t)=>e.setIn([t,\"errors\"],(0,N.fromJS)(n))),e)))}return console.warn(\"unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR\"),e},[Xn]:(e,{payload:{path:t,method:r}})=>{const a=e.getIn([\"requestData\",t,r,\"bodyValue\"]);if(!N.Map.isMap(a))return e.setIn([\"requestData\",t,r,\"errors\"],(0,N.fromJS)([]));const[...n]=a.keys();return n?e.updateIn([\"requestData\",t,r,\"bodyValue\"],(0,N.fromJS)({}),(e=>n.reduce(((e,t)=>e.setIn([t,\"errors\"],(0,N.fromJS)([]))),e))):e},[Gn]:(e,{payload:{pathMethod:t}})=>{let[r,a]=t;const n=e.getIn([\"requestData\",r,a,\"bodyValue\"]);return n?N.Map.isMap(n)?e.setIn([\"requestData\",r,a,\"bodyValue\"],(0,N.Map)()):e.setIn([\"requestData\",r,a,\"bodyValue\"],\"\"):e}};function oas3(){return{components:jn,wrapComponents:Vn,statePlugins:{spec:{wrapSelectors:E,selectors:v},auth:{wrapSelectors:_},oas3:{actions:{...w},reducers:ds,selectors:{...b}}}}}const webhooks=({specSelectors:e,getComponent:t})=>{const r=e.selectWebhooksOperations(),a=Object.keys(r),n=t(\"OperationContainer\",!0);return 0===a.length?null:x().createElement(\"div\",{className:\"webhooks\"},x().createElement(\"h2\",null,\"Webhooks\"),a.map((e=>x().createElement(\"div\",{key:`${e}-webhook`},r[e].map((t=>x().createElement(n,{key:`${e}-${t.method}-webhook`,op:t.operation,tag:\"webhooks\",method:t.method,path:e,specPath:(0,N.List)(t.specPath),allowTryItOut:!1})))))))},components_license=({getComponent:e,specSelectors:t})=>{const r=t.selectLicenseNameField(),a=t.selectLicenseUrl(),n=e(\"Link\");return x().createElement(\"div\",{className:\"info__license\"},a?x().createElement(\"div\",{className:\"info__license__url\"},x().createElement(n,{target:\"_blank\",href:sanitizeUrl(a)},r)):x().createElement(\"span\",null,r))},components_contact=({getComponent:e,specSelectors:t})=>{const r=t.selectContactNameField(),a=t.selectContactUrl(),n=t.selectContactEmailField(),s=e(\"Link\");return x().createElement(\"div\",{className:\"info__contact\"},a&&x().createElement(\"div\",null,x().createElement(s,{href:sanitizeUrl(a),target:\"_blank\"},r,\" - Website\")),n&&x().createElement(s,{href:sanitizeUrl(`mailto:${n}`)},a?`Send email to ${r}`:`Contact ${r}`))},oas31_components_info=({getComponent:e,specSelectors:t})=>{const r=t.version(),a=t.url(),n=t.basePath(),s=t.host(),o=t.selectInfoSummaryField(),l=t.selectInfoDescriptionField(),c=t.selectInfoTitleField(),i=t.selectInfoTermsOfServiceUrl(),p=t.selectExternalDocsUrl(),m=t.selectExternalDocsDescriptionField(),u=t.contact(),d=t.license(),h=e(\"Markdown\",!0),g=e(\"Link\"),y=e(\"VersionStamp\"),f=e(\"OpenAPIVersion\"),S=e(\"InfoUrl\"),E=e(\"InfoBasePath\"),_=e(\"License\",!0),v=e(\"Contact\",!0),w=e(\"JsonSchemaDialect\",!0);return x().createElement(\"div\",{className:\"info\"},x().createElement(\"hgroup\",{className:\"main\"},x().createElement(\"h2\",{className:\"title\"},c,x().createElement(\"span\",null,r&&x().createElement(y,{version:r}),x().createElement(f,{oasVersion:\"3.1\"}))),(s||n)&&x().createElement(E,{host:s,basePath:n}),a&&x().createElement(S,{getComponent:e,url:a})),o&&x().createElement(\"p\",{className:\"info__summary\"},o),x().createElement(\"div\",{className:\"info__description description\"},x().createElement(h,{source:l})),i&&x().createElement(\"div\",{className:\"info__tos\"},x().createElement(g,{target:\"_blank\",href:sanitizeUrl(i)},\"Terms of service\")),u.size>0&&x().createElement(v,null),d.size>0&&x().createElement(_,null),p&&x().createElement(g,{className:\"info__extdocs\",target:\"_blank\",href:sanitizeUrl(p)},m||p),x().createElement(w,null))},json_schema_dialect=({getComponent:e,specSelectors:t})=>{const r=t.selectJsonSchemaDialectField(),a=t.selectJsonSchemaDialectDefault(),n=e(\"Link\");return x().createElement(x().Fragment,null,r&&r===a&&x().createElement(\"p\",{className:\"info__jsonschemadialect\"},\"JSON Schema dialect:\",\" \",x().createElement(n,{target:\"_blank\",href:sanitizeUrl(r)},r)),r&&r!==a&&x().createElement(\"div\",{className:\"error-wrapper\"},x().createElement(\"div\",{className:\"no-margin\"},x().createElement(\"div\",{className:\"errors\"},x().createElement(\"div\",{className:\"errors-wrapper\"},x().createElement(\"h4\",{className:\"center\"},\"Warning\"),x().createElement(\"p\",{className:\"message\"},x().createElement(\"strong\",null,\"OpenAPI.jsonSchemaDialect\"),\" field contains a value different from the default value of\",\" \",x().createElement(n,{target:\"_blank\",href:a},a),\". Values different from the default one are currently not supported. Please either omit the field or provide it with the default value.\"))))))},version_pragma_filter=({bypass:e,isSwagger2:t,isOAS3:r,isOAS31:a,alsoShow:n,children:s})=>e?x().createElement(\"div\",null,s):t&&(r||a)?x().createElement(\"div\",{className:\"version-pragma\"},n,x().createElement(\"div\",{className:\"version-pragma__message version-pragma__message--ambiguous\"},x().createElement(\"div\",null,x().createElement(\"h3\",null,\"Unable to render this definition\"),x().createElement(\"p\",null,x().createElement(\"code\",null,\"swagger\"),\" and \",x().createElement(\"code\",null,\"openapi\"),\" fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields.\"),x().createElement(\"p\",null,\"Supported version fields are \",x().createElement(\"code\",null,'swagger: \"2.0\"'),\" and those that match \",x().createElement(\"code\",null,\"openapi: 3.x.y\"),\" (for example,\",\" \",x().createElement(\"code\",null,\"openapi: 3.1.0\"),\").\")))):t||r||a?x().createElement(\"div\",null,s):x().createElement(\"div\",{className:\"version-pragma\"},n,x().createElement(\"div\",{className:\"version-pragma__message version-pragma__message--missing\"},x().createElement(\"div\",null,x().createElement(\"h3\",null,\"Unable to render this definition\"),x().createElement(\"p\",null,\"The provided definition does not specify a valid version field.\"),x().createElement(\"p\",null,\"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are \",x().createElement(\"code\",null,'swagger: \"2.0\"'),\" and those that match \",x().createElement(\"code\",null,\"openapi: 3.x.y\"),\" (for example,\",\" \",x().createElement(\"code\",null,\"openapi: 3.1.0\"),\").\")))),getModelName=e=>\"string\"==typeof e&&e.includes(\"#/components/schemas/\")?(e=>{const t=e.replace(/~1/g,\"/\").replace(/~0/g,\"~\");try{return decodeURIComponent(t)}catch{return t}})(e.replace(/^.*#\\/components\\/schemas\\//,\"\")):null,hs=(0,C.forwardRef)((({schema:e,getComponent:t,onToggle:r=(()=>{})},a)=>{const n=t(\"JSONSchema202012\"),s=getModelName(e.get(\"$$ref\")),o=(0,C.useCallback)(((e,t)=>{r(s,t)}),[s,r]);return x().createElement(n,{name:s,schema:e.toJS(),ref:a,onExpand:o})})),gs=hs,models=({specActions:e,specSelectors:t,layoutSelectors:r,layoutActions:a,getComponent:n,getConfigs:s,fn:o})=>{const l=t.selectSchemas(),c=Object.keys(l).length>0,i=[\"components\",\"schemas\"],{docExpansion:p,defaultModelsExpandDepth:m}=s(),u=m>0&&\"none\"!==p,d=r.isShown(i,u),h=n(\"Collapse\"),g=n(\"JSONSchema202012\"),y=n(\"ArrowUpIcon\"),f=n(\"ArrowDownIcon\"),{getTitle:S}=o.jsonSchema202012.useFn();(0,C.useEffect)((()=>{const r=d&&m>1,a=null!=t.specResolvedSubtree(i);r&&!a&&e.requestResolvedSubtree(i)}),[d,m]);const E=(0,C.useCallback)((()=>{a.show(i,!d)}),[d]),_=(0,C.useCallback)((e=>{null!==e&&a.readyToScroll(i,e)}),[]),handleJSONSchema202012Ref=e=>t=>{null!==t&&a.readyToScroll([...i,e],t)},handleJSONSchema202012Expand=r=>(a,n)=>{if(n){const a=[...i,r];null!=t.specResolvedSubtree(a)||e.requestResolvedSubtree([...i,r])}};return!c||m<0?null:x().createElement(\"section\",{className:ut()(\"models\",{\"is-open\":d}),ref:_},x().createElement(\"h4\",null,x().createElement(\"button\",{\"aria-expanded\":d,className:\"models-control\",onClick:E},x().createElement(\"span\",null,\"Schemas\"),d?x().createElement(y,null):x().createElement(f,null))),x().createElement(h,{isOpened:d},Object.entries(l).map((([e,t])=>{const r=S(t,{lookup:\"basic\"})||e;return x().createElement(g,{key:e,ref:handleJSONSchema202012Ref(e),schema:t,name:r,onExpand:handleJSONSchema202012Expand(e)})}))))},mutual_tls_auth=({schema:e,getComponent:t})=>{const r=t(\"JumpToPath\",!0);return x().createElement(\"div\",null,x().createElement(\"h4\",null,e.get(\"name\"),\" (mutualTLS)\",\" \",x().createElement(r,{path:[\"securityDefinitions\",e.get(\"name\")]})),x().createElement(\"p\",null,\"Mutual TLS is required by this API/Operation. Certificates are managed via your Operating System and/or your browser.\"),x().createElement(\"p\",null,e.get(\"description\")))};class auths_Auths extends x().Component{constructor(e,t){super(e,t),this.state={}}onAuthChange=e=>{let{name:t}=e;this.setState({[t]:e})};submitAuth=e=>{e.preventDefault();let{authActions:t}=this.props;t.authorizeWithPersistOption(this.state)};logoutClick=e=>{e.preventDefault();let{authActions:t,definitions:r}=this.props,a=r.map(((e,t)=>t)).toArray();this.setState(a.reduce(((e,t)=>(e[t]=\"\",e)),{})),t.logoutWithPersistOption(a)};close=e=>{e.preventDefault();let{authActions:t}=this.props;t.showDefinitions(!1)};render(){let{definitions:e,getComponent:t,authSelectors:r,errSelectors:a}=this.props;const n=t(\"AuthItem\"),s=t(\"oauth2\",!0),o=t(\"Button\"),l=r.authorized(),c=e.filter(((e,t)=>!!l.get(t))),i=e.filter((e=>\"oauth2\"!==e.get(\"type\")&&\"mutualTLS\"!==e.get(\"type\"))),p=e.filter((e=>\"oauth2\"===e.get(\"type\"))),m=e.filter((e=>\"mutualTLS\"===e.get(\"type\")));return x().createElement(\"div\",{className:\"auth-container\"},i.size>0&&x().createElement(\"form\",{onSubmit:this.submitAuth},i.map(((e,r)=>x().createElement(n,{key:r,schema:e,name:r,getComponent:t,onAuthChange:this.onAuthChange,authorized:l,errSelectors:a}))).toArray(),x().createElement(\"div\",{className:\"auth-btn-wrapper\"},i.size===c.size?x().createElement(o,{className:\"btn modal-btn auth\",onClick:this.logoutClick,\"aria-label\":\"Remove authorization\"},\"Logout\"):x().createElement(o,{type:\"submit\",className:\"btn modal-btn auth authorize\",\"aria-label\":\"Apply credentials\"},\"Authorize\"),x().createElement(o,{className:\"btn modal-btn auth btn-done\",onClick:this.close},\"Close\"))),p.size>0?x().createElement(\"div\",null,x().createElement(\"div\",{className:\"scope-def\"},x().createElement(\"p\",null,\"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\"),x().createElement(\"p\",null,\"API requires the following scopes. Select which ones you want to grant to Swagger UI.\")),e.filter((e=>\"oauth2\"===e.get(\"type\"))).map(((e,t)=>x().createElement(\"div\",{key:t},x().createElement(s,{authorized:l,schema:e,name:t})))).toArray()):null,m.size>0&&x().createElement(\"div\",null,m.map(((e,r)=>x().createElement(n,{key:r,schema:e,name:r,getComponent:t,onAuthChange:this.onAuthChange,authorized:l,errSelectors:a}))).toArray()))}}const ys=auths_Auths,isOAS31=e=>{const t=e.get(\"openapi\");return\"string\"==typeof t&&/^3\\.1\\.(?:[1-9]\\d*|0)$/.test(t)},fn_createOnlyOAS31Selector=e=>(t,...r)=>a=>{if(a.getSystem().specSelectors.isOAS31()){const n=e(t,...r);return\"function\"==typeof n?n(a):n}return null},createOnlyOAS31SelectorWrapper=e=>(t,r)=>(a,...n)=>{if(r.getSystem().specSelectors.isOAS31()){const s=e(a,...n);return\"function\"==typeof s?s(t,r):s}return t(...n)},fn_createSystemSelector=e=>(t,...r)=>a=>{const n=e(t,a,...r);return\"function\"==typeof n?n(a):n},createOnlyOAS31ComponentWrapper=e=>(t,r)=>a=>r.specSelectors.isOAS31()?x().createElement(e,et()({},a,{originalComponent:t,getSystem:r.getSystem})):x().createElement(t,a),fs=createOnlyOAS31ComponentWrapper((({getSystem:e})=>{const t=e().getComponent(\"OAS31License\",!0);return x().createElement(t,null)})),Ss=createOnlyOAS31ComponentWrapper((({getSystem:e})=>{const t=e().getComponent(\"OAS31Contact\",!0);return x().createElement(t,null)})),Es=createOnlyOAS31ComponentWrapper((({getSystem:e})=>{const t=e().getComponent(\"OAS31Info\",!0);return x().createElement(t,null)})),_s=createOnlyOAS31ComponentWrapper((({getSystem:e,...t})=>{const r=e(),{getComponent:a,fn:n,getConfigs:s}=r,o=s(),l=a(\"OAS31Model\"),c=a(\"JSONSchema202012\"),i=a(\"JSONSchema202012Keyword$schema\"),p=a(\"JSONSchema202012Keyword$vocabulary\"),m=a(\"JSONSchema202012Keyword$id\"),u=a(\"JSONSchema202012Keyword$anchor\"),d=a(\"JSONSchema202012Keyword$dynamicAnchor\"),h=a(\"JSONSchema202012Keyword$ref\"),g=a(\"JSONSchema202012Keyword$dynamicRef\"),y=a(\"JSONSchema202012Keyword$defs\"),f=a(\"JSONSchema202012Keyword$comment\"),S=a(\"JSONSchema202012KeywordAllOf\"),E=a(\"JSONSchema202012KeywordAnyOf\"),_=a(\"JSONSchema202012KeywordOneOf\"),v=a(\"JSONSchema202012KeywordNot\"),w=a(\"JSONSchema202012KeywordIf\"),b=a(\"JSONSchema202012KeywordThen\"),C=a(\"JSONSchema202012KeywordElse\"),O=a(\"JSONSchema202012KeywordDependentSchemas\"),N=a(\"JSONSchema202012KeywordPrefixItems\"),k=a(\"JSONSchema202012KeywordItems\"),A=a(\"JSONSchema202012KeywordContains\"),I=a(\"JSONSchema202012KeywordProperties\"),q=a(\"JSONSchema202012KeywordPatternProperties\"),j=a(\"JSONSchema202012KeywordAdditionalProperties\"),P=a(\"JSONSchema202012KeywordPropertyNames\"),M=a(\"JSONSchema202012KeywordUnevaluatedItems\"),R=a(\"JSONSchema202012KeywordUnevaluatedProperties\"),T=a(\"JSONSchema202012KeywordType\"),J=a(\"JSONSchema202012KeywordEnum\"),$=a(\"JSONSchema202012KeywordConst\"),V=a(\"JSONSchema202012KeywordConstraint\"),D=a(\"JSONSchema202012KeywordDependentRequired\"),K=a(\"JSONSchema202012KeywordContentSchema\"),L=a(\"JSONSchema202012KeywordTitle\"),U=a(\"JSONSchema202012KeywordDescription\"),z=a(\"JSONSchema202012KeywordDefault\"),B=a(\"JSONSchema202012KeywordDeprecated\"),F=a(\"JSONSchema202012KeywordReadOnly\"),W=a(\"JSONSchema202012KeywordWriteOnly\"),H=a(\"JSONSchema202012Accordion\"),X=a(\"JSONSchema202012ExpandDeepButton\"),G=a(\"JSONSchema202012ChevronRightIcon\"),Y=a(\"withJSONSchema202012Context\")(l,{config:{default$schema:\"https://spec.openapis.org/oas/3.1/dialect/base\",defaultExpandedLevels:o.defaultModelExpandDepth,includeReadOnly:Boolean(t.includeReadOnly),includeWriteOnly:Boolean(t.includeWriteOnly)},components:{JSONSchema:c,Keyword$schema:i,Keyword$vocabulary:p,Keyword$id:m,Keyword$anchor:u,Keyword$dynamicAnchor:d,Keyword$ref:h,Keyword$dynamicRef:g,Keyword$defs:y,Keyword$comment:f,KeywordAllOf:S,KeywordAnyOf:E,KeywordOneOf:_,KeywordNot:v,KeywordIf:w,KeywordThen:b,KeywordElse:C,KeywordDependentSchemas:O,KeywordPrefixItems:N,KeywordItems:k,KeywordContains:A,KeywordProperties:I,KeywordPatternProperties:q,KeywordAdditionalProperties:j,KeywordPropertyNames:P,KeywordUnevaluatedItems:M,KeywordUnevaluatedProperties:R,KeywordType:T,KeywordEnum:J,KeywordConst:$,KeywordConstraint:V,KeywordDependentRequired:D,KeywordContentSchema:K,KeywordTitle:L,KeywordDescription:U,KeywordDefault:z,KeywordDeprecated:B,KeywordReadOnly:F,KeywordWriteOnly:W,Accordion:H,ExpandDeepButton:X,ChevronRightIcon:G},fn:{upperFirst:n.upperFirst,isExpandable:n.jsonSchema202012.isExpandable,getProperties:n.jsonSchema202012.getProperties}});return x().createElement(Y,t)})),vs=_s,ws=createOnlyOAS31ComponentWrapper((({getSystem:e})=>{const{getComponent:t,fn:r,getConfigs:a}=e(),n=a();if(ws.ModelsWithJSONSchemaContext)return x().createElement(ws.ModelsWithJSONSchemaContext,null);const s=t(\"OAS31Models\",!0),o=t(\"JSONSchema202012\"),l=t(\"JSONSchema202012Keyword$schema\"),c=t(\"JSONSchema202012Keyword$vocabulary\"),i=t(\"JSONSchema202012Keyword$id\"),p=t(\"JSONSchema202012Keyword$anchor\"),m=t(\"JSONSchema202012Keyword$dynamicAnchor\"),u=t(\"JSONSchema202012Keyword$ref\"),d=t(\"JSONSchema202012Keyword$dynamicRef\"),h=t(\"JSONSchema202012Keyword$defs\"),g=t(\"JSONSchema202012Keyword$comment\"),y=t(\"JSONSchema202012KeywordAllOf\"),f=t(\"JSONSchema202012KeywordAnyOf\"),S=t(\"JSONSchema202012KeywordOneOf\"),E=t(\"JSONSchema202012KeywordNot\"),_=t(\"JSONSchema202012KeywordIf\"),v=t(\"JSONSchema202012KeywordThen\"),w=t(\"JSONSchema202012KeywordElse\"),b=t(\"JSONSchema202012KeywordDependentSchemas\"),C=t(\"JSONSchema202012KeywordPrefixItems\"),O=t(\"JSONSchema202012KeywordItems\"),N=t(\"JSONSchema202012KeywordContains\"),k=t(\"JSONSchema202012KeywordProperties\"),A=t(\"JSONSchema202012KeywordPatternProperties\"),I=t(\"JSONSchema202012KeywordAdditionalProperties\"),q=t(\"JSONSchema202012KeywordPropertyNames\"),j=t(\"JSONSchema202012KeywordUnevaluatedItems\"),P=t(\"JSONSchema202012KeywordUnevaluatedProperties\"),M=t(\"JSONSchema202012KeywordType\"),R=t(\"JSONSchema202012KeywordEnum\"),T=t(\"JSONSchema202012KeywordConst\"),J=t(\"JSONSchema202012KeywordConstraint\"),$=t(\"JSONSchema202012KeywordDependentRequired\"),V=t(\"JSONSchema202012KeywordContentSchema\"),D=t(\"JSONSchema202012KeywordTitle\"),K=t(\"JSONSchema202012KeywordDescription\"),L=t(\"JSONSchema202012KeywordDefault\"),U=t(\"JSONSchema202012KeywordDeprecated\"),z=t(\"JSONSchema202012KeywordReadOnly\"),B=t(\"JSONSchema202012KeywordWriteOnly\"),F=t(\"JSONSchema202012Accordion\"),W=t(\"JSONSchema202012ExpandDeepButton\"),H=t(\"JSONSchema202012ChevronRightIcon\"),X=t(\"withJSONSchema202012Context\");return ws.ModelsWithJSONSchemaContext=X(s,{config:{default$schema:\"https://spec.openapis.org/oas/3.1/dialect/base\",defaultExpandedLevels:n.defaultModelsExpandDepth-1,includeReadOnly:!0,includeWriteOnly:!0},components:{JSONSchema:o,Keyword$schema:l,Keyword$vocabulary:c,Keyword$id:i,Keyword$anchor:p,Keyword$dynamicAnchor:m,Keyword$ref:u,Keyword$dynamicRef:d,Keyword$defs:h,Keyword$comment:g,KeywordAllOf:y,KeywordAnyOf:f,KeywordOneOf:S,KeywordNot:E,KeywordIf:_,KeywordThen:v,KeywordElse:w,KeywordDependentSchemas:b,KeywordPrefixItems:C,KeywordItems:O,KeywordContains:N,KeywordProperties:k,KeywordPatternProperties:A,KeywordAdditionalProperties:I,KeywordPropertyNames:q,KeywordUnevaluatedItems:j,KeywordUnevaluatedProperties:P,KeywordType:M,KeywordEnum:R,KeywordConst:T,KeywordConstraint:J,KeywordDependentRequired:$,KeywordContentSchema:V,KeywordTitle:D,KeywordDescription:K,KeywordDefault:L,KeywordDeprecated:U,KeywordReadOnly:z,KeywordWriteOnly:B,Accordion:F,ExpandDeepButton:W,ChevronRightIcon:H},fn:{upperFirst:r.upperFirst,isExpandable:r.jsonSchema202012.isExpandable,getProperties:r.jsonSchema202012.getProperties}}),x().createElement(ws.ModelsWithJSONSchemaContext,null)}));ws.ModelsWithJSONSchemaContext=null;const bs=ws,wrap_components_version_pragma_filter=(e,t)=>e=>{const r=t.specSelectors.isOAS31(),a=t.getComponent(\"OAS31VersionPragmaFilter\");return x().createElement(a,et()({isOAS31:r},e))},Cs=createOnlyOAS31ComponentWrapper((({originalComponent:e,...t})=>{const{getComponent:r,schema:a}=t,n=r(\"MutualTLSAuth\",!0);return\"mutualTLS\"===a.get(\"type\")?x().createElement(n,{schema:a}):x().createElement(e,t)})),xs=Cs,Os=createOnlyOAS31ComponentWrapper((({getSystem:e,...t})=>{const r=e().getComponent(\"OAS31Auths\",!0);return x().createElement(r,t)})),Ns=(0,N.Map)(),ks=(0,we.createSelector)(((e,t)=>t.specSelectors.specJson()),isOAS31),selectors_webhooks=()=>e=>{const t=e.specSelectors.specJson().get(\"webhooks\");return N.Map.isMap(t)?t:Ns},As=(0,we.createSelector)([(e,t)=>t.specSelectors.webhooks(),(e,t)=>t.specSelectors.validOperationMethods(),(e,t)=>t.specSelectors.specResolvedSubtree([\"webhooks\"])],((e,t)=>e.reduce(((e,r,a)=>{if(!N.Map.isMap(r))return e;const n=r.entrySeq().filter((([e])=>t.includes(e))).map((([e,t])=>({operation:(0,N.Map)({operation:t}),method:e,path:a,specPath:[\"webhooks\",a,e]})));return e.concat(n)}),(0,N.List)()).groupBy((e=>e.path)).map((e=>e.toArray())).toObject())),selectors_license=()=>e=>{const t=e.specSelectors.info().get(\"license\");return N.Map.isMap(t)?t:Ns},selectLicenseNameField=()=>e=>e.specSelectors.license().get(\"name\",\"License\"),selectLicenseUrlField=()=>e=>e.specSelectors.license().get(\"url\"),Is=(0,we.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectLicenseUrlField()],((e,t,r)=>{if(r)return safeBuildUrl(r,e,{selectedServer:t})})),selectLicenseIdentifierField=()=>e=>e.specSelectors.license().get(\"identifier\"),selectors_contact=()=>e=>{const t=e.specSelectors.info().get(\"contact\");return N.Map.isMap(t)?t:Ns},selectContactNameField=()=>e=>e.specSelectors.contact().get(\"name\",\"the developer\"),selectContactEmailField=()=>e=>e.specSelectors.contact().get(\"email\"),selectContactUrlField=()=>e=>e.specSelectors.contact().get(\"url\"),qs=(0,we.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectContactUrlField()],((e,t,r)=>{if(r)return safeBuildUrl(r,e,{selectedServer:t})})),selectInfoTitleField=()=>e=>e.specSelectors.info().get(\"title\"),selectInfoSummaryField=()=>e=>e.specSelectors.info().get(\"summary\"),selectInfoDescriptionField=()=>e=>e.specSelectors.info().get(\"description\"),selectInfoTermsOfServiceField=()=>e=>e.specSelectors.info().get(\"termsOfService\"),js=(0,we.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectInfoTermsOfServiceField()],((e,t,r)=>{if(r)return safeBuildUrl(r,e,{selectedServer:t})})),selectExternalDocsDescriptionField=()=>e=>e.specSelectors.externalDocs().get(\"description\"),selectExternalDocsUrlField=()=>e=>e.specSelectors.externalDocs().get(\"url\"),Ps=(0,we.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectExternalDocsUrlField()],((e,t,r)=>{if(r)return safeBuildUrl(r,e,{selectedServer:t})})),selectJsonSchemaDialectField=()=>e=>e.specSelectors.specJson().get(\"jsonSchemaDialect\"),selectJsonSchemaDialectDefault=()=>\"https://spec.openapis.org/oas/3.1/dialect/base\",Ms=(0,we.createSelector)(((e,t)=>t.specSelectors.definitions()),((e,t)=>t.specSelectors.specResolvedSubtree([\"components\",\"schemas\"])),((e,t)=>N.Map.isMap(e)?N.Map.isMap(t)?Object.entries(e.toJS()).reduce(((e,[r,a])=>{const n=t.get(r);return e[r]=n?.toJS()||a,e}),{}):e.toJS():{})),wrap_selectors_isOAS3=(e,t)=>(r,...a)=>t.specSelectors.isOAS31()||e(...a),Rs=createOnlyOAS31SelectorWrapper((()=>(e,t)=>t.oas31Selectors.selectLicenseUrl())),Ts=createOnlyOAS31SelectorWrapper((()=>(e,t)=>{const r=t.specSelectors.securityDefinitions();let a=e();return r?(r.entrySeq().forEach((([e,t])=>{\"mutualTLS\"===t.get(\"type\")&&(a=a.push(new N.Map({[e]:t})))})),a):a})),Js=(0,we.createSelector)([(e,t)=>t.specSelectors.url(),(e,t)=>t.oas3Selectors.selectedServer(),(e,t)=>t.specSelectors.selectLicenseUrlField(),(e,t)=>t.specSelectors.selectLicenseIdentifierField()],((e,t,r,a)=>r?safeBuildUrl(r,e,{selectedServer:t}):a?`https://spdx.org/licenses/${a}.html`:void 0)),keywords_Example=({schema:e,getSystem:t})=>{const{fn:r}=t(),{hasKeyword:a,stringify:n}=r.jsonSchema202012.useFn();return a(e,\"example\")?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--example\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Example\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},n(e.example))):null},keywords_Xml=({schema:e,getSystem:t})=>{const r=e?.xml||{},{fn:a,getComponent:n}=t(),{useIsExpandedDeeply:s,useComponent:o}=a.jsonSchema202012,l=s(),c=!!(r.name||r.namespace||r.prefix),[i,p]=(0,C.useState)(l),[m,u]=(0,C.useState)(!1),d=o(\"Accordion\"),h=o(\"ExpandDeepButton\"),g=n(\"JSONSchema202012DeepExpansionContext\")(),y=(0,C.useCallback)((()=>{p((e=>!e))}),[]),f=(0,C.useCallback)(((e,t)=>{p(t),u(t)}),[]);return 0===Object.keys(r).length?null:x().createElement(g.Provider,{value:m},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--xml\"},c?x().createElement(x().Fragment,null,x().createElement(d,{expanded:i,onChange:y},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"XML\")),x().createElement(h,{expanded:i,onClick:f})):x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"XML\"),!0===r.attribute&&x().createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"attribute\"),!0===r.wrapped&&x().createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"wrapped\"),x().createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),x().createElement(\"ul\",{className:ut()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!i})},i&&x().createElement(x().Fragment,null,r.name&&x().createElement(\"li\",{className:\"json-schema-2020-12-property\"},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"name\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},r.name))),r.namespace&&x().createElement(\"li\",{className:\"json-schema-2020-12-property\"},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"namespace\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},r.namespace))),r.prefix&&x().createElement(\"li\",{className:\"json-schema-2020-12-property\"},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"prefix\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},r.prefix)))))))},Discriminator_DiscriminatorMapping=({discriminator:e})=>{const t=e?.mapping||{};return 0===Object.keys(t).length?null:Object.entries(t).map((([e,t])=>x().createElement(\"div\",{key:`${e}-${t}`,className:\"json-schema-2020-12-keyword\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},e),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},t))))},Discriminator_Discriminator=({schema:e,getSystem:t})=>{const r=e?.discriminator||{},{fn:a,getComponent:n}=t(),{useIsExpandedDeeply:s,useComponent:o}=a.jsonSchema202012,l=s(),c=!!r.mapping,[i,p]=(0,C.useState)(l),[m,u]=(0,C.useState)(!1),d=o(\"Accordion\"),h=o(\"ExpandDeepButton\"),g=n(\"JSONSchema202012DeepExpansionContext\")(),y=(0,C.useCallback)((()=>{p((e=>!e))}),[]),f=(0,C.useCallback)(((e,t)=>{p(t),u(t)}),[]);return 0===Object.keys(r).length?null:x().createElement(g.Provider,{value:m},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--discriminator\"},c?x().createElement(x().Fragment,null,x().createElement(d,{expanded:i,onChange:y},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Discriminator\")),x().createElement(h,{expanded:i,onClick:f})):x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"Discriminator\"),r.propertyName&&x().createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},r.propertyName),x().createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),x().createElement(\"ul\",{className:ut()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!i})},i&&x().createElement(\"li\",{className:\"json-schema-2020-12-property\"},x().createElement(Discriminator_DiscriminatorMapping,{discriminator:r})))))},keywords_ExternalDocs=({schema:e,getSystem:t})=>{const r=e?.externalDocs||{},{fn:a,getComponent:n}=t(),{useIsExpandedDeeply:s,useComponent:o}=a.jsonSchema202012,l=s(),c=!(!r.description&&!r.url),[i,p]=(0,C.useState)(l),[m,u]=(0,C.useState)(!1),d=o(\"Accordion\"),h=o(\"ExpandDeepButton\"),g=n(\"JSONSchema202012KeywordDescription\"),y=n(\"Link\"),f=n(\"JSONSchema202012DeepExpansionContext\")(),S=(0,C.useCallback)((()=>{p((e=>!e))}),[]),E=(0,C.useCallback)(((e,t)=>{p(t),u(t)}),[]);return 0===Object.keys(r).length?null:x().createElement(f.Provider,{value:m},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--externalDocs\"},c?x().createElement(x().Fragment,null,x().createElement(d,{expanded:i,onChange:S},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"External documentation\")),x().createElement(h,{expanded:i,onClick:E})):x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"External documentation\"),x().createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),x().createElement(\"ul\",{className:ut()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!i})},i&&x().createElement(x().Fragment,null,r.description&&x().createElement(\"li\",{className:\"json-schema-2020-12-property\"},x().createElement(g,{schema:r,getSystem:t})),r.url&&x().createElement(\"li\",{className:\"json-schema-2020-12-property\"},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"url\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},x().createElement(y,{target:\"_blank\",href:sanitizeUrl(r.url)},r.url))))))))},keywords_Description=({schema:e,getSystem:t})=>{if(!e?.description)return null;const{getComponent:r}=t(),a=r(\"Markdown\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--description\"},x().createElement(\"div\",{className:\"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary\"},x().createElement(a,{source:e.description})))},$s=createOnlyOAS31ComponentWrapper(keywords_Description),Vs=createOnlyOAS31ComponentWrapper((({schema:e,getSystem:t,originalComponent:r})=>{const{getComponent:a}=t(),n=a(\"JSONSchema202012KeywordDiscriminator\"),s=a(\"JSONSchema202012KeywordXml\"),o=a(\"JSONSchema202012KeywordExample\"),l=a(\"JSONSchema202012KeywordExternalDocs\");return x().createElement(x().Fragment,null,x().createElement(r,{schema:e}),x().createElement(n,{schema:e,getSystem:t}),x().createElement(s,{schema:e,getSystem:t}),x().createElement(l,{schema:e,getSystem:t}),x().createElement(o,{schema:e,getSystem:t}))})),Ds=Vs,keywords_Properties=({schema:e,getSystem:t})=>{const{fn:r}=t(),{useComponent:a}=r.jsonSchema202012,{getDependentRequired:n,getProperties:s}=r.jsonSchema202012.useFn(),o=r.jsonSchema202012.useConfig(),l=Array.isArray(e?.required)?e.required:[],c=a(\"JSONSchema\"),i=s(e,o);return 0===Object.keys(i).length?null:x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties\"},x().createElement(\"ul\",null,Object.entries(i).map((([t,r])=>{const a=l.includes(t),s=n(t,e);return x().createElement(\"li\",{key:t,className:ut()(\"json-schema-2020-12-property\",{\"json-schema-2020-12-property--required\":a})},x().createElement(c,{name:t,schema:r,dependentRequired:s}))}))))},Ks=createOnlyOAS31ComponentWrapper(keywords_Properties),getProperties=(e,{includeReadOnly:t,includeWriteOnly:r})=>{if(!e?.properties)return{};const a=Object.entries(e.properties).filter((([,e])=>(!(!0===e?.readOnly)||t)&&(!(!0===e?.writeOnly)||r)));return Object.fromEntries(a)};const Ls=function oas31_after_load_afterLoad({fn:e,getSystem:t}){if(e.jsonSchema202012){const r=((e,t)=>{const{fn:r}=t();if(\"function\"!=typeof e)return null;const{hasKeyword:a}=r.jsonSchema202012;return t=>e(t)||a(t,\"example\")||t?.xml||t?.discriminator||t?.externalDocs})(e.jsonSchema202012.isExpandable,t);Object.assign(this.fn.jsonSchema202012,{isExpandable:r,getProperties})}if(\"function\"==typeof e.sampleFromSchema&&e.jsonSchema202012){const r=((e,t)=>{const{fn:r,specSelectors:a}=t;return Object.fromEntries(Object.entries(e).map((([e,t])=>{const n=r[e];return[e,(...e)=>a.isOAS31()?t(...e):\"function\"==typeof n?n(...e):void 0]})))})({sampleFromSchema:e.jsonSchema202012.sampleFromSchema,sampleFromSchemaGeneric:e.jsonSchema202012.sampleFromSchemaGeneric,createXMLExample:e.jsonSchema202012.createXMLExample,memoizedSampleFromSchema:e.jsonSchema202012.memoizedSampleFromSchema,memoizedCreateXMLExample:e.jsonSchema202012.memoizedCreateXMLExample,getJsonSampleSchema:e.jsonSchema202012.getJsonSampleSchema,getYamlSampleSchema:e.jsonSchema202012.getYamlSampleSchema,getXmlSampleSchema:e.jsonSchema202012.getXmlSampleSchema,getSampleSchema:e.jsonSchema202012.getSampleSchema,mergeJsonSchema:e.jsonSchema202012.mergeJsonSchema},t());Object.assign(this.fn,r)}},oas31=({fn:e})=>{const t=e.createSystemSelector||fn_createSystemSelector,r=e.createOnlyOAS31Selector||fn_createOnlyOAS31Selector;return{afterLoad:Ls,fn:{isOAS31,createSystemSelector:fn_createSystemSelector,createOnlyOAS31Selector:fn_createOnlyOAS31Selector},components:{Webhooks:webhooks,JsonSchemaDialect:json_schema_dialect,MutualTLSAuth:mutual_tls_auth,OAS31Info:oas31_components_info,OAS31License:components_license,OAS31Contact:components_contact,OAS31VersionPragmaFilter:version_pragma_filter,OAS31Model:gs,OAS31Models:models,OAS31Auths:ys,JSONSchema202012KeywordExample:keywords_Example,JSONSchema202012KeywordXml:keywords_Xml,JSONSchema202012KeywordDiscriminator:Discriminator_Discriminator,JSONSchema202012KeywordExternalDocs:keywords_ExternalDocs},wrapComponents:{InfoContainer:Es,License:fs,Contact:Ss,VersionPragmaFilter:wrap_components_version_pragma_filter,Model:vs,Models:bs,AuthItem:xs,auths:Os,JSONSchema202012KeywordDescription:$s,JSONSchema202012KeywordDefault:Ds,JSONSchema202012KeywordProperties:Ks},statePlugins:{auth:{wrapSelectors:{definitionsToAuthorize:Ts}},spec:{selectors:{isOAS31:t(ks),license:selectors_license,selectLicenseNameField,selectLicenseUrlField,selectLicenseIdentifierField:r(selectLicenseIdentifierField),selectLicenseUrl:t(Is),contact:selectors_contact,selectContactNameField,selectContactEmailField,selectContactUrlField,selectContactUrl:t(qs),selectInfoTitleField,selectInfoSummaryField:r(selectInfoSummaryField),selectInfoDescriptionField,selectInfoTermsOfServiceField,selectInfoTermsOfServiceUrl:t(js),selectExternalDocsDescriptionField,selectExternalDocsUrlField,selectExternalDocsUrl:t(Ps),webhooks:r(selectors_webhooks),selectWebhooksOperations:r(t(As)),selectJsonSchemaDialectField,selectJsonSchemaDialectDefault,selectSchemas:t(Ms)},wrapSelectors:{isOAS3:wrap_selectors_isOAS3,selectLicenseUrl:Rs}},oas31:{selectors:{selectLicenseUrl:r(t(Js))}}}}},Us=ke().object,zs=ke().bool,Bs=(ke().oneOfType([Us,zs]),(0,C.createContext)(null));Bs.displayName=\"JSONSchemaContext\";const Fs=(0,C.createContext)(0);Fs.displayName=\"JSONSchemaLevelContext\";const Ws=(0,C.createContext)(!1);Ws.displayName=\"JSONSchemaDeepExpansionContext\";const Hs=(0,C.createContext)(new Set),useConfig=()=>{const{config:e}=(0,C.useContext)(Bs);return e},useComponent=e=>{const{components:t}=(0,C.useContext)(Bs);return t[e]||null},useFn=(e=void 0)=>{const{fn:t}=(0,C.useContext)(Bs);return void 0!==e?t[e]:t},useLevel=()=>{const e=(0,C.useContext)(Fs);return[e,e+1]},useIsExpanded=()=>{const[e]=useLevel(),{defaultExpandedLevels:t}=useConfig();return t-e>0},useIsExpandedDeeply=()=>(0,C.useContext)(Ws),useRenderedSchemas=(e=void 0)=>{if(void 0===e)return(0,C.useContext)(Hs);const t=(0,C.useContext)(Hs);return new Set([...t,e])},Xs=(0,C.forwardRef)((({schema:e,name:t=\"\",dependentRequired:r=[],onExpand:a=(()=>{})},n)=>{const s=useFn(),o=useIsExpanded(),l=useIsExpandedDeeply(),[c,i]=(0,C.useState)(o||l),[p,m]=(0,C.useState)(l),[u,d]=useLevel(),h=(()=>{const[e]=useLevel();return e>0})(),g=s.isExpandable(e)||r.length>0,y=(e=>useRenderedSchemas().has(e))(e),f=useRenderedSchemas(e),S=s.stringifyConstraints(e),E=useComponent(\"Accordion\"),_=useComponent(\"Keyword$schema\"),v=useComponent(\"Keyword$vocabulary\"),w=useComponent(\"Keyword$id\"),b=useComponent(\"Keyword$anchor\"),O=useComponent(\"Keyword$dynamicAnchor\"),N=useComponent(\"Keyword$ref\"),k=useComponent(\"Keyword$dynamicRef\"),A=useComponent(\"Keyword$defs\"),I=useComponent(\"Keyword$comment\"),q=useComponent(\"KeywordAllOf\"),j=useComponent(\"KeywordAnyOf\"),P=useComponent(\"KeywordOneOf\"),M=useComponent(\"KeywordNot\"),R=useComponent(\"KeywordIf\"),T=useComponent(\"KeywordThen\"),J=useComponent(\"KeywordElse\"),$=useComponent(\"KeywordDependentSchemas\"),V=useComponent(\"KeywordPrefixItems\"),D=useComponent(\"KeywordItems\"),K=useComponent(\"KeywordContains\"),L=useComponent(\"KeywordProperties\"),U=useComponent(\"KeywordPatternProperties\"),z=useComponent(\"KeywordAdditionalProperties\"),B=useComponent(\"KeywordPropertyNames\"),F=useComponent(\"KeywordUnevaluatedItems\"),W=useComponent(\"KeywordUnevaluatedProperties\"),H=useComponent(\"KeywordType\"),X=useComponent(\"KeywordEnum\"),G=useComponent(\"KeywordConst\"),Y=useComponent(\"KeywordConstraint\"),Q=useComponent(\"KeywordDependentRequired\"),Z=useComponent(\"KeywordContentSchema\"),ee=useComponent(\"KeywordTitle\"),te=useComponent(\"KeywordDescription\"),re=useComponent(\"KeywordDefault\"),ae=useComponent(\"KeywordDeprecated\"),ne=useComponent(\"KeywordReadOnly\"),se=useComponent(\"KeywordWriteOnly\"),oe=useComponent(\"ExpandDeepButton\");(0,C.useEffect)((()=>{m(l)}),[l]),(0,C.useEffect)((()=>{m(p)}),[p]);const le=(0,C.useCallback)(((e,t)=>{i(t),!t&&m(!1),a(e,t,!1)}),[a]),ce=(0,C.useCallback)(((e,t)=>{i(t),m(t),a(e,t,!0)}),[a]);return x().createElement(Fs.Provider,{value:d},x().createElement(Ws.Provider,{value:p},x().createElement(Hs.Provider,{value:f},x().createElement(\"article\",{ref:n,\"data-json-schema-level\":u,className:ut()(\"json-schema-2020-12\",{\"json-schema-2020-12--embedded\":h,\"json-schema-2020-12--circular\":y})},x().createElement(\"div\",{className:\"json-schema-2020-12-head\"},g&&!y?x().createElement(x().Fragment,null,x().createElement(E,{expanded:c,onChange:le},x().createElement(ee,{title:t,schema:e})),x().createElement(oe,{expanded:c,onClick:ce})):x().createElement(ee,{title:t,schema:e}),x().createElement(ae,{schema:e}),x().createElement(ne,{schema:e}),x().createElement(se,{schema:e}),x().createElement(H,{schema:e,isCircular:y}),S.length>0&&S.map((e=>x().createElement(Y,{key:`${e.scope}-${e.value}`,constraint:e})))),x().createElement(\"div\",{className:ut()(\"json-schema-2020-12-body\",{\"json-schema-2020-12-body--collapsed\":!c})},c&&x().createElement(x().Fragment,null,x().createElement(te,{schema:e}),!y&&g&&x().createElement(x().Fragment,null,x().createElement(L,{schema:e}),x().createElement(U,{schema:e}),x().createElement(z,{schema:e}),x().createElement(W,{schema:e}),x().createElement(B,{schema:e}),x().createElement(q,{schema:e}),x().createElement(j,{schema:e}),x().createElement(P,{schema:e}),x().createElement(M,{schema:e}),x().createElement(R,{schema:e}),x().createElement(T,{schema:e}),x().createElement(J,{schema:e}),x().createElement($,{schema:e}),x().createElement(V,{schema:e}),x().createElement(D,{schema:e}),x().createElement(F,{schema:e}),x().createElement(K,{schema:e}),x().createElement(Z,{schema:e})),x().createElement(X,{schema:e}),x().createElement(G,{schema:e}),x().createElement(Q,{schema:e,dependentRequired:r}),x().createElement(re,{schema:e}),x().createElement(_,{schema:e}),x().createElement(v,{schema:e}),x().createElement(w,{schema:e}),x().createElement(b,{schema:e}),x().createElement(O,{schema:e}),x().createElement(N,{schema:e}),!y&&g&&x().createElement(A,{schema:e}),x().createElement(k,{schema:e}),x().createElement(I,{schema:e})))))))})),Gs=Xs,keywords_$schema=({schema:e})=>e?.$schema?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$schema\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$schema\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$schema)):null,$vocabulary_$vocabulary=({schema:e})=>{const t=useIsExpanded(),r=useIsExpandedDeeply(),[a,n]=(0,C.useState)(t||r),s=useComponent(\"Accordion\"),o=(0,C.useCallback)((()=>{n((e=>!e))}),[]);return e?.$vocabulary?\"object\"!=typeof e.$vocabulary?null:x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$vocabulary\"},x().createElement(s,{expanded:a,onChange:o},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$vocabulary\")),x().createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),x().createElement(\"ul\",null,a&&Object.entries(e.$vocabulary).map((([e,t])=>x().createElement(\"li\",{key:e,className:ut()(\"json-schema-2020-12-$vocabulary-uri\",{\"json-schema-2020-12-$vocabulary-uri--disabled\":!t})},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e)))))):null},keywords_$id=({schema:e})=>e?.$id?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$id\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$id\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$id)):null,keywords_$anchor=({schema:e})=>e?.$anchor?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$anchor\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$anchor\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$anchor)):null,keywords_$dynamicAnchor=({schema:e})=>e?.$dynamicAnchor?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicAnchor\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$dynamicAnchor\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$dynamicAnchor)):null,keywords_$ref=({schema:e})=>e?.$ref?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$ref\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$ref\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$ref)):null,keywords_$dynamicRef=({schema:e})=>e?.$dynamicRef?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicRef\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$dynamicRef\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$dynamicRef)):null,keywords_$defs=({schema:e})=>{const t=e?.$defs||{},r=useIsExpanded(),a=useIsExpandedDeeply(),[n,s]=(0,C.useState)(r||a),[o,l]=(0,C.useState)(!1),c=useComponent(\"Accordion\"),i=useComponent(\"ExpandDeepButton\"),p=useComponent(\"JSONSchema\"),m=(0,C.useCallback)((()=>{s((e=>!e))}),[]),u=(0,C.useCallback)(((e,t)=>{s(t),l(t)}),[]);return 0===Object.keys(t).length?null:x().createElement(Ws.Provider,{value:o},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$defs\"},x().createElement(c,{expanded:n,onChange:m},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$defs\")),x().createElement(i,{expanded:n,onClick:u}),x().createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),x().createElement(\"ul\",{className:ut()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!n})},n&&x().createElement(x().Fragment,null,Object.entries(t).map((([e,t])=>x().createElement(\"li\",{key:e,className:\"json-schema-2020-12-property\"},x().createElement(p,{name:e,schema:t}))))))))},keywords_$comment=({schema:e})=>e?.$comment?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--$comment\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary\"},\"$comment\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary\"},e.$comment)):null,keywords_AllOf=({schema:e})=>{const t=e?.allOf||[],r=useFn(),a=useIsExpanded(),n=useIsExpandedDeeply(),[s,o]=(0,C.useState)(a||n),[l,c]=(0,C.useState)(!1),i=useComponent(\"Accordion\"),p=useComponent(\"ExpandDeepButton\"),m=useComponent(\"JSONSchema\"),u=useComponent(\"KeywordType\"),d=(0,C.useCallback)((()=>{o((e=>!e))}),[]),h=(0,C.useCallback)(((e,t)=>{o(t),c(t)}),[]);return Array.isArray(t)&&0!==t.length?x().createElement(Ws.Provider,{value:l},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--allOf\"},x().createElement(i,{expanded:s,onChange:d},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"All of\")),x().createElement(p,{expanded:s,onClick:h}),x().createElement(u,{schema:{allOf:t}}),x().createElement(\"ul\",{className:ut()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!s})},s&&x().createElement(x().Fragment,null,t.map(((e,t)=>x().createElement(\"li\",{key:`#${t}`,className:\"json-schema-2020-12-property\"},x().createElement(m,{name:`#${t} ${r.getTitle(e)}`,schema:e})))))))):null},keywords_AnyOf=({schema:e})=>{const t=e?.anyOf||[],r=useFn(),a=useIsExpanded(),n=useIsExpandedDeeply(),[s,o]=(0,C.useState)(a||n),[l,c]=(0,C.useState)(!1),i=useComponent(\"Accordion\"),p=useComponent(\"ExpandDeepButton\"),m=useComponent(\"JSONSchema\"),u=useComponent(\"KeywordType\"),d=(0,C.useCallback)((()=>{o((e=>!e))}),[]),h=(0,C.useCallback)(((e,t)=>{o(t),c(t)}),[]);return Array.isArray(t)&&0!==t.length?x().createElement(Ws.Provider,{value:l},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--anyOf\"},x().createElement(i,{expanded:s,onChange:d},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Any of\")),x().createElement(p,{expanded:s,onClick:h}),x().createElement(u,{schema:{anyOf:t}}),x().createElement(\"ul\",{className:ut()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!s})},s&&x().createElement(x().Fragment,null,t.map(((e,t)=>x().createElement(\"li\",{key:`#${t}`,className:\"json-schema-2020-12-property\"},x().createElement(m,{name:`#${t} ${r.getTitle(e)}`,schema:e})))))))):null},keywords_OneOf=({schema:e})=>{const t=e?.oneOf||[],r=useFn(),a=useIsExpanded(),n=useIsExpandedDeeply(),[s,o]=(0,C.useState)(a||n),[l,c]=(0,C.useState)(!1),i=useComponent(\"Accordion\"),p=useComponent(\"ExpandDeepButton\"),m=useComponent(\"JSONSchema\"),u=useComponent(\"KeywordType\"),d=(0,C.useCallback)((()=>{o((e=>!e))}),[]),h=(0,C.useCallback)(((e,t)=>{o(t),c(t)}),[]);return Array.isArray(t)&&0!==t.length?x().createElement(Ws.Provider,{value:l},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--oneOf\"},x().createElement(i,{expanded:s,onChange:d},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"One of\")),x().createElement(p,{expanded:s,onClick:h}),x().createElement(u,{schema:{oneOf:t}}),x().createElement(\"ul\",{className:ut()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!s})},s&&x().createElement(x().Fragment,null,t.map(((e,t)=>x().createElement(\"li\",{key:`#${t}`,className:\"json-schema-2020-12-property\"},x().createElement(m,{name:`#${t} ${r.getTitle(e)}`,schema:e})))))))):null},keywords_Not=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"not\"))return null;const a=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Not\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--not\"},x().createElement(r,{name:a,schema:e.not}))},keywords_If=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"if\"))return null;const a=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"If\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--if\"},x().createElement(r,{name:a,schema:e.if}))},keywords_Then=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"then\"))return null;const a=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Then\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--then\"},x().createElement(r,{name:a,schema:e.then}))},keywords_Else=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"else\"))return null;const a=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Else\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--if\"},x().createElement(r,{name:a,schema:e.else}))},keywords_DependentSchemas=({schema:e})=>{const t=e?.dependentSchemas||[],r=useIsExpanded(),a=useIsExpandedDeeply(),[n,s]=(0,C.useState)(r||a),[o,l]=(0,C.useState)(!1),c=useComponent(\"Accordion\"),i=useComponent(\"ExpandDeepButton\"),p=useComponent(\"JSONSchema\"),m=(0,C.useCallback)((()=>{s((e=>!e))}),[]),u=(0,C.useCallback)(((e,t)=>{s(t),l(t)}),[]);return\"object\"!=typeof t||0===Object.keys(t).length?null:x().createElement(Ws.Provider,{value:o},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentSchemas\"},x().createElement(c,{expanded:n,onChange:m},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Dependent schemas\")),x().createElement(i,{expanded:n,onClick:u}),x().createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"object\"),x().createElement(\"ul\",{className:ut()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!n})},n&&x().createElement(x().Fragment,null,Object.entries(t).map((([e,t])=>x().createElement(\"li\",{key:e,className:\"json-schema-2020-12-property\"},x().createElement(p,{name:e,schema:t}))))))))},keywords_PrefixItems=({schema:e})=>{const t=e?.prefixItems||[],r=useFn(),a=useIsExpanded(),n=useIsExpandedDeeply(),[s,o]=(0,C.useState)(a||n),[l,c]=(0,C.useState)(!1),i=useComponent(\"Accordion\"),p=useComponent(\"ExpandDeepButton\"),m=useComponent(\"JSONSchema\"),u=useComponent(\"KeywordType\"),d=(0,C.useCallback)((()=>{o((e=>!e))}),[]),h=(0,C.useCallback)(((e,t)=>{o(t),c(t)}),[]);return Array.isArray(t)&&0!==t.length?x().createElement(Ws.Provider,{value:l},x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--prefixItems\"},x().createElement(i,{expanded:s,onChange:d},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Prefix items\")),x().createElement(p,{expanded:s,onClick:h}),x().createElement(u,{schema:{prefixItems:t}}),x().createElement(\"ul\",{className:ut()(\"json-schema-2020-12-keyword__children\",{\"json-schema-2020-12-keyword__children--collapsed\":!s})},s&&x().createElement(x().Fragment,null,t.map(((e,t)=>x().createElement(\"li\",{key:`#${t}`,className:\"json-schema-2020-12-property\"},x().createElement(m,{name:`#${t} ${r.getTitle(e)}`,schema:e})))))))):null},keywords_Items=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"items\"))return null;const a=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Items\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--items\"},x().createElement(r,{name:a,schema:e.items}))},keywords_Contains=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"contains\"))return null;const a=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Contains\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--contains\"},x().createElement(r,{name:a,schema:e.contains}))},keywords_Properties_Properties=({schema:e})=>{const t=useFn(),r=e?.properties||{},a=Array.isArray(e?.required)?e.required:[],n=useComponent(\"JSONSchema\");return 0===Object.keys(r).length?null:x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties\"},x().createElement(\"ul\",null,Object.entries(r).map((([r,s])=>{const o=a.includes(r),l=t.getDependentRequired(r,e);return x().createElement(\"li\",{key:r,className:ut()(\"json-schema-2020-12-property\",{\"json-schema-2020-12-property--required\":o})},x().createElement(n,{name:r,schema:s,dependentRequired:l}))}))))},PatternProperties_PatternProperties=({schema:e})=>{const t=e?.patternProperties||{},r=useComponent(\"JSONSchema\");return 0===Object.keys(t).length?null:x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--patternProperties\"},x().createElement(\"ul\",null,Object.entries(t).map((([e,t])=>x().createElement(\"li\",{key:e,className:\"json-schema-2020-12-property\"},x().createElement(r,{name:e,schema:t}))))))},keywords_AdditionalProperties=({schema:e})=>{const t=useFn(),{additionalProperties:r}=e,a=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"additionalProperties\"))return null;const n=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Additional properties\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--additionalProperties\"},!0===r?x().createElement(x().Fragment,null,n,x().createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"allowed\")):!1===r?x().createElement(x().Fragment,null,n,x().createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},\"forbidden\")):x().createElement(a,{name:n,schema:r}))},keywords_PropertyNames=({schema:e})=>{const t=useFn(),{propertyNames:r}=e,a=useComponent(\"JSONSchema\"),n=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Property names\");return t.hasKeyword(e,\"propertyNames\")?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--propertyNames\"},x().createElement(a,{name:n,schema:r})):null},keywords_UnevaluatedItems=({schema:e})=>{const t=useFn(),{unevaluatedItems:r}=e,a=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"unevaluatedItems\"))return null;const n=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Unevaluated items\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedItems\"},x().createElement(a,{name:n,schema:r}))},keywords_UnevaluatedProperties=({schema:e})=>{const t=useFn(),{unevaluatedProperties:r}=e,a=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"unevaluatedProperties\"))return null;const n=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Unevaluated properties\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedProperties\"},x().createElement(a,{name:n,schema:r}))},keywords_Type=({schema:e,isCircular:t=!1})=>{const r=useFn().getType(e),a=t?\" [circular]\":\"\";return x().createElement(\"strong\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary\"},`${r}${a}`)},Enum_Enum=({schema:e})=>{const t=useFn();return Array.isArray(e?.enum)?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--enum\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Allowed values\"),x().createElement(\"ul\",null,e.enum.map((e=>{const r=t.stringify(e);return x().createElement(\"li\",{key:r},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},r))})))):null},keywords_Const=({schema:e})=>{const t=useFn();return t.hasKeyword(e,\"const\")?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--const\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Const\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},t.stringify(e.const))):null},Constraint=({constraint:e})=>x().createElement(\"span\",{className:`json-schema-2020-12__constraint json-schema-2020-12__constraint--${e.scope}`},e.value),Ys=x().memo(Constraint),DependentRequired_DependentRequired=({dependentRequired:e})=>0===e.length?null:x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentRequired\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Required when defined\"),x().createElement(\"ul\",null,e.map((e=>x().createElement(\"li\",{key:e},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--warning\"},e)))))),keywords_ContentSchema=({schema:e})=>{const t=useFn(),r=useComponent(\"JSONSchema\");if(!t.hasKeyword(e,\"contentSchema\"))return null;const a=x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Content schema\");return x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--contentSchema\"},x().createElement(r,{name:a,schema:e.contentSchema}))},Title_Title=({title:e=\"\",schema:t})=>{const r=useFn(),a=e||r.getTitle(t);return a?x().createElement(\"div\",{className:\"json-schema-2020-12__title\"},a):null},keywords_Description_Description=({schema:e})=>e?.description?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--description\"},x().createElement(\"div\",{className:\"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary\"},e.description)):null,keywords_Default=({schema:e})=>{const t=useFn();return t.hasKeyword(e,\"default\")?x().createElement(\"div\",{className:\"json-schema-2020-12-keyword json-schema-2020-12-keyword--default\"},x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary\"},\"Default\"),x().createElement(\"span\",{className:\"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const\"},t.stringify(e.default))):null},keywords_Deprecated=({schema:e})=>!0!==e?.deprecated?null:x().createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--warning\"},\"deprecated\"),keywords_ReadOnly=({schema:e})=>!0!==e?.readOnly?null:x().createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"read-only\"),keywords_WriteOnly=({schema:e})=>!0!==e?.writeOnly?null:x().createElement(\"span\",{className:\"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted\"},\"write-only\"),Accordion_Accordion=({expanded:e=!1,children:t,onChange:r})=>{const a=useComponent(\"ChevronRightIcon\"),n=(0,C.useCallback)((t=>{r(t,!e)}),[e,r]);return x().createElement(\"button\",{type:\"button\",className:\"json-schema-2020-12-accordion\",onClick:n},x().createElement(\"div\",{className:\"json-schema-2020-12-accordion__children\"},t),x().createElement(\"span\",{className:ut()(\"json-schema-2020-12-accordion__icon\",{\"json-schema-2020-12-accordion__icon--expanded\":e,\"json-schema-2020-12-accordion__icon--collapsed\":!e})},x().createElement(a,null)))},ExpandDeepButton_ExpandDeepButton=({expanded:e,onClick:t})=>{const r=(0,C.useCallback)((r=>{t(r,!e)}),[e,t]);return x().createElement(\"button\",{type:\"button\",className:\"json-schema-2020-12-expand-deep-button\",onClick:r},e?\"Collapse all\":\"Expand all\")},icons_ChevronRight=()=>x().createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\"},x().createElement(\"path\",{d:\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"})),fn_upperFirst=e=>\"string\"==typeof e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:e,getTitle=(e,{lookup:t=\"extended\"}={})=>{const r=useFn();if(null!=e?.title)return r.upperFirst(String(e.title));if(\"extended\"===t){if(null!=e?.$anchor)return r.upperFirst(String(e.$anchor));if(null!=e?.$id)return String(e.$id)}return\"\"},getType=(e,t=new WeakSet)=>{const r=useFn();if(null==e)return\"any\";if(r.isBooleanJSONSchema(e))return e?\"any\":\"never\";if(\"object\"!=typeof e)return\"any\";if(t.has(e))return\"any\";t.add(e);const{type:a,prefixItems:n,items:s}=e,getArrayType=()=>{if(Array.isArray(n)){const e=n.map((e=>getType(e,t))),r=s?getType(s,t):\"any\";return`array<[${e.join(\", \")}], ${r}>`}if(s){return`array<${getType(s,t)}>`}return\"array<any>\"};if(e.not&&\"any\"===getType(e.not))return\"never\";const handleCombiningKeywords=(r,a)=>{if(Array.isArray(e[r])){return`(${e[r].map((e=>getType(e,t))).join(a)})`}return null},o=[Array.isArray(a)?a.map((e=>\"array\"===e?getArrayType():e)).join(\" | \"):\"array\"===a?getArrayType():[\"null\",\"boolean\",\"object\",\"array\",\"number\",\"integer\",\"string\"].includes(a)?a:(()=>{if(Object.hasOwn(e,\"prefixItems\")||Object.hasOwn(e,\"items\")||Object.hasOwn(e,\"contains\"))return getArrayType();if(Object.hasOwn(e,\"properties\")||Object.hasOwn(e,\"additionalProperties\")||Object.hasOwn(e,\"patternProperties\"))return\"object\";if([\"int32\",\"int64\"].includes(e.format))return\"integer\";if([\"float\",\"double\"].includes(e.format))return\"number\";if(Object.hasOwn(e,\"minimum\")||Object.hasOwn(e,\"maximum\")||Object.hasOwn(e,\"exclusiveMinimum\")||Object.hasOwn(e,\"exclusiveMaximum\")||Object.hasOwn(e,\"multipleOf\"))return\"number | integer\";if(Object.hasOwn(e,\"pattern\")||Object.hasOwn(e,\"format\")||Object.hasOwn(e,\"minLength\")||Object.hasOwn(e,\"maxLength\"))return\"string\";if(void 0!==e.const){if(null===e.const)return\"null\";if(\"boolean\"==typeof e.const)return\"boolean\";if(\"number\"==typeof e.const)return Number.isInteger(e.const)?\"integer\":\"number\";if(\"string\"==typeof e.const)return\"string\";if(Array.isArray(e.const))return\"array<any>\";if(\"object\"==typeof e.const)return\"object\"}return null})(),handleCombiningKeywords(\"oneOf\",\" | \"),handleCombiningKeywords(\"anyOf\",\" | \"),handleCombiningKeywords(\"allOf\",\" & \")].filter(Boolean).join(\" | \");return t.delete(e),o||\"any\"},isBooleanJSONSchema=e=>\"boolean\"==typeof e,hasKeyword=(e,t)=>null!==e&&\"object\"==typeof e&&Object.hasOwn(e,t),isExpandable=e=>{const t=useFn();return e?.$schema||e?.$vocabulary||e?.$id||e?.$anchor||e?.$dynamicAnchor||e?.$ref||e?.$dynamicRef||e?.$defs||e?.$comment||e?.allOf||e?.anyOf||e?.oneOf||t.hasKeyword(e,\"not\")||t.hasKeyword(e,\"if\")||t.hasKeyword(e,\"then\")||t.hasKeyword(e,\"else\")||e?.dependentSchemas||e?.prefixItems||t.hasKeyword(e,\"items\")||t.hasKeyword(e,\"contains\")||e?.properties||e?.patternProperties||t.hasKeyword(e,\"additionalProperties\")||t.hasKeyword(e,\"propertyNames\")||t.hasKeyword(e,\"unevaluatedItems\")||t.hasKeyword(e,\"unevaluatedProperties\")||e?.description||e?.enum||t.hasKeyword(e,\"const\")||t.hasKeyword(e,\"contentSchema\")||t.hasKeyword(e,\"default\")},fn_stringify=e=>null===e||[\"number\",\"bigint\",\"boolean\"].includes(typeof e)?String(e):Array.isArray(e)?`[${e.map(fn_stringify).join(\", \")}]`:JSON.stringify(e),stringifyConstraintRange=(e,t,r)=>{const a=\"number\"==typeof t,n=\"number\"==typeof r;return a&&n?t===r?`${t} ${e}`:`[${t}, ${r}] ${e}`:a?`>= ${t} ${e}`:n?`<= ${r} ${e}`:null},stringifyConstraints=e=>{const t=[],r=(e=>{if(\"number\"!=typeof e?.multipleOf)return null;if(e.multipleOf<=0)return null;if(1===e.multipleOf)return null;const{multipleOf:t}=e;if(Number.isInteger(t))return`multiple of ${t}`;const r=10**t.toString().split(\".\")[1].length;return`multiple of ${t*r}/${r}`})(e);null!==r&&t.push({scope:\"number\",value:r});const a=(e=>{const t=e?.minimum,r=e?.maximum,a=e?.exclusiveMinimum,n=e?.exclusiveMaximum,s=\"number\"==typeof t,o=\"number\"==typeof r,l=\"number\"==typeof a,c=\"number\"==typeof n,i=l&&(!s||t<a),p=c&&(!o||r>n);if((s||l)&&(o||c))return`${i?\"(\":\"[\"}${i?a:t}, ${p?n:r}${p?\")\":\"]\"}`;if(s||l)return`${i?\">\":\"≥\"} ${i?a:t}`;if(o||c)return`${p?\"<\":\"≤\"} ${p?n:r}`;return null})(e);null!==a&&t.push({scope:\"number\",value:a}),e?.format&&t.push({scope:\"string\",value:e.format});const n=stringifyConstraintRange(\"characters\",e?.minLength,e?.maxLength);null!==n&&t.push({scope:\"string\",value:n}),e?.pattern&&t.push({scope:\"string\",value:`matches ${e?.pattern}`}),e?.contentMediaType&&t.push({scope:\"string\",value:`media type: ${e.contentMediaType}`}),e?.contentEncoding&&t.push({scope:\"string\",value:`encoding: ${e.contentEncoding}`});const s=stringifyConstraintRange(e?.hasUniqueItems?\"unique items\":\"items\",e?.minItems,e?.maxItems);null!==s&&t.push({scope:\"array\",value:s});const o=stringifyConstraintRange(\"contained items\",e?.minContains,e?.maxContains);null!==o&&t.push({scope:\"array\",value:o});const l=stringifyConstraintRange(\"properties\",e?.minProperties,e?.maxProperties);return null!==l&&t.push({scope:\"object\",value:l}),t},getDependentRequired=(e,t)=>t?.dependentRequired?Array.from(Object.entries(t.dependentRequired).reduce(((t,[r,a])=>Array.isArray(a)&&a.includes(e)?(t.add(r),t):t),new Set)):[],withJSONSchemaContext=(e,t={})=>{const r={components:{JSONSchema:Gs,Keyword$schema:keywords_$schema,Keyword$vocabulary:$vocabulary_$vocabulary,Keyword$id:keywords_$id,Keyword$anchor:keywords_$anchor,Keyword$dynamicAnchor:keywords_$dynamicAnchor,Keyword$ref:keywords_$ref,Keyword$dynamicRef:keywords_$dynamicRef,Keyword$defs:keywords_$defs,Keyword$comment:keywords_$comment,KeywordAllOf:keywords_AllOf,KeywordAnyOf:keywords_AnyOf,KeywordOneOf:keywords_OneOf,KeywordNot:keywords_Not,KeywordIf:keywords_If,KeywordThen:keywords_Then,KeywordElse:keywords_Else,KeywordDependentSchemas:keywords_DependentSchemas,KeywordPrefixItems:keywords_PrefixItems,KeywordItems:keywords_Items,KeywordContains:keywords_Contains,KeywordProperties:keywords_Properties_Properties,KeywordPatternProperties:PatternProperties_PatternProperties,KeywordAdditionalProperties:keywords_AdditionalProperties,KeywordPropertyNames:keywords_PropertyNames,KeywordUnevaluatedItems:keywords_UnevaluatedItems,KeywordUnevaluatedProperties:keywords_UnevaluatedProperties,KeywordType:keywords_Type,KeywordEnum:Enum_Enum,KeywordConst:keywords_Const,KeywordConstraint:Ys,KeywordDependentRequired:DependentRequired_DependentRequired,KeywordContentSchema:keywords_ContentSchema,KeywordTitle:Title_Title,KeywordDescription:keywords_Description_Description,KeywordDefault:keywords_Default,KeywordDeprecated:keywords_Deprecated,KeywordReadOnly:keywords_ReadOnly,KeywordWriteOnly:keywords_WriteOnly,Accordion:Accordion_Accordion,ExpandDeepButton:ExpandDeepButton_ExpandDeepButton,ChevronRightIcon:icons_ChevronRight,...t.components},config:{default$schema:\"https://json-schema.org/draft/2020-12/schema\",defaultExpandedLevels:0,...t.config},fn:{upperFirst:fn_upperFirst,getTitle,getType,isBooleanJSONSchema,hasKeyword,isExpandable,stringify:fn_stringify,stringifyConstraints,getDependentRequired,...t.fn}},HOC=t=>x().createElement(Bs.Provider,{value:r},x().createElement(e,t));return HOC.contexts={JSONSchemaContext:Bs},HOC.displayName=e.displayName,HOC},json_schema_2020_12=()=>({components:{JSONSchema202012:Gs,JSONSchema202012Keyword$schema:keywords_$schema,JSONSchema202012Keyword$vocabulary:$vocabulary_$vocabulary,JSONSchema202012Keyword$id:keywords_$id,JSONSchema202012Keyword$anchor:keywords_$anchor,JSONSchema202012Keyword$dynamicAnchor:keywords_$dynamicAnchor,JSONSchema202012Keyword$ref:keywords_$ref,JSONSchema202012Keyword$dynamicRef:keywords_$dynamicRef,JSONSchema202012Keyword$defs:keywords_$defs,JSONSchema202012Keyword$comment:keywords_$comment,JSONSchema202012KeywordAllOf:keywords_AllOf,JSONSchema202012KeywordAnyOf:keywords_AnyOf,JSONSchema202012KeywordOneOf:keywords_OneOf,JSONSchema202012KeywordNot:keywords_Not,JSONSchema202012KeywordIf:keywords_If,JSONSchema202012KeywordThen:keywords_Then,JSONSchema202012KeywordElse:keywords_Else,JSONSchema202012KeywordDependentSchemas:keywords_DependentSchemas,JSONSchema202012KeywordPrefixItems:keywords_PrefixItems,JSONSchema202012KeywordItems:keywords_Items,JSONSchema202012KeywordContains:keywords_Contains,JSONSchema202012KeywordProperties:keywords_Properties_Properties,JSONSchema202012KeywordPatternProperties:PatternProperties_PatternProperties,JSONSchema202012KeywordAdditionalProperties:keywords_AdditionalProperties,JSONSchema202012KeywordPropertyNames:keywords_PropertyNames,JSONSchema202012KeywordUnevaluatedItems:keywords_UnevaluatedItems,JSONSchema202012KeywordUnevaluatedProperties:keywords_UnevaluatedProperties,JSONSchema202012KeywordType:keywords_Type,JSONSchema202012KeywordEnum:Enum_Enum,JSONSchema202012KeywordConst:keywords_Const,JSONSchema202012KeywordConstraint:Ys,JSONSchema202012KeywordDependentRequired:DependentRequired_DependentRequired,JSONSchema202012KeywordContentSchema:keywords_ContentSchema,JSONSchema202012KeywordTitle:Title_Title,JSONSchema202012KeywordDescription:keywords_Description_Description,JSONSchema202012KeywordDefault:keywords_Default,JSONSchema202012KeywordDeprecated:keywords_Deprecated,JSONSchema202012KeywordReadOnly:keywords_ReadOnly,JSONSchema202012KeywordWriteOnly:keywords_WriteOnly,JSONSchema202012Accordion:Accordion_Accordion,JSONSchema202012ExpandDeepButton:ExpandDeepButton_ExpandDeepButton,JSONSchema202012ChevronRightIcon:icons_ChevronRight,withJSONSchema202012Context:withJSONSchemaContext,JSONSchema202012DeepExpansionContext:()=>Ws},fn:{upperFirst:fn_upperFirst,jsonSchema202012:{isExpandable,hasKeyword,useFn,useConfig,useComponent,useIsExpandedDeeply}}}),Qs=require(\"lodash/isPlainObject\");var Zs=__webpack_require__.n(Qs);const array=(e,{sample:t})=>((e,t={})=>{const{minItems:r,maxItems:a,uniqueItems:n}=t,{contains:s,minContains:o,maxContains:l}=t;let c=[...e];if(null!=s&&\"object\"==typeof s){if(Number.isInteger(o)&&o>1){const e=c.at(0);for(let t=1;t<o;t+=1)c.unshift(e)}Number.isInteger(l)}if(Number.isInteger(a)&&a>0&&(c=e.slice(0,a)),Number.isInteger(r)&&r>0)for(let e=0;c.length<r;e+=1)c.push(c[e%c.length]);return!0===n&&(c=Array.from(new Set(c))),c})(t,e),object=()=>{throw new Error(\"Not implemented\")},bytes=e=>ae()(e),pick=e=>e.at(0),predicates_isBooleanJSONSchema=e=>\"boolean\"==typeof e,isJSONSchemaObject=e=>Zs()(e),isJSONSchema=e=>predicates_isBooleanJSONSchema(e)||isJSONSchemaObject(e);const eo=class Registry{data={};register(e,t){this.data[e]=t}unregister(e){void 0===e?this.data={}:delete this.data[e]}get(e){return this.data[e]}},int32=()=>2**30>>>0,int64=()=>2**53-1,generators_float=()=>.1,generators_double=()=>.1,email=()=>\"user@example.com\",idn_email=()=>\"실례@example.com\",hostname=()=>\"example.com\",idn_hostname=()=>\"실례.com\",ipv4=()=>\"198.51.100.42\",ipv6=()=>\"2001:0db8:5b96:0000:0000:426f:8e17:642a\",uri=()=>\"https://example.com/\",uri_reference=()=>\"path/index.html\",iri=()=>\"https://실례.com/\",iri_reference=()=>\"path/실례.html\",uuid=()=>\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",uri_template=()=>\"https://example.com/dictionary/{term:1}/{term}\",json_pointer=()=>\"/a/b/c\",relative_json_pointer=()=>\"1/0\",date_time=()=>(new Date).toISOString(),date=()=>(new Date).toISOString().substring(0,10),time=()=>(new Date).toISOString().substring(11),duration=()=>\"P3D\",generators_password=()=>\"********\",regex=()=>\"^[a-z]+$\";const to=new class FormatRegistry extends eo{#e={int32,int64,float:generators_float,double:generators_double,email,\"idn-email\":idn_email,hostname,\"idn-hostname\":idn_hostname,ipv4,ipv6,uri,\"uri-reference\":uri_reference,iri,\"iri-reference\":iri_reference,uuid,\"uri-template\":uri_template,\"json-pointer\":json_pointer,\"relative-json-pointer\":relative_json_pointer,\"date-time\":date_time,date,time,duration,password:generators_password,regex};data={...this.#e};get defaults(){return{...this.#e}}},formatAPI=(e,t)=>\"function\"==typeof t?to.register(e,t):null===t?to.unregister(e):to.get(e);formatAPI.getDefaults=()=>to.defaults;const ro=formatAPI;var ao=__webpack_require__(158).Buffer;const _7bit=e=>ao.from(e).toString(\"ascii\");var no=__webpack_require__(158).Buffer;const _8bit=e=>no.from(e).toString(\"utf8\");var so=__webpack_require__(158).Buffer;const binary=e=>so.from(e).toString(\"binary\"),quoted_printable=e=>{let t=\"\";for(let r=0;r<e.length;r++){const a=e.charCodeAt(r);if(61===a)t+=\"=3D\";else if(a>=33&&a<=60||a>=62&&a<=126||9===a||32===a)t+=e.charAt(r);else if(13===a||10===a)t+=\"\\r\\n\";else if(a>126){const a=unescape(encodeURIComponent(e.charAt(r)));for(let e=0;e<a.length;e++)t+=\"=\"+(\"0\"+a.charCodeAt(e).toString(16)).slice(-2).toUpperCase()}else t+=\"=\"+(\"0\"+a.toString(16)).slice(-2).toUpperCase()}return t};var oo=__webpack_require__(158).Buffer;const base16=e=>oo.from(e).toString(\"hex\");var lo=__webpack_require__(158).Buffer;const base32=e=>{const t=lo.from(e).toString(\"utf8\"),r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\";let a=0,n=\"\",s=0,o=0;for(let e=0;e<t.length;e++)for(s=s<<8|t.charCodeAt(e),o+=8;o>=5;)n+=r.charAt(s>>>o-5&31),o-=5;o>0&&(n+=r.charAt(s<<5-o&31),a=(8-8*t.length%5)%5);for(let e=0;e<a;e++)n+=\"=\";return n};var co=__webpack_require__(158).Buffer;const base64=e=>co.from(e).toString(\"base64\");var io=__webpack_require__(158).Buffer;const base64url=e=>io.from(e).toString(\"base64url\");const po=new class EncoderRegistry extends eo{#e={\"7bit\":_7bit,\"8bit\":_8bit,binary,\"quoted-printable\":quoted_printable,base16,base32,base64,base64url};data={...this.#e};get defaults(){return{...this.#e}}},encoderAPI=(e,t)=>\"function\"==typeof t?po.register(e,t):null===t?po.unregister(e):po.get(e);encoderAPI.getDefaults=()=>po.defaults;const mo=encoderAPI,uo={\"text/plain\":()=>\"string\",\"text/css\":()=>\".selector { border: 1px solid red }\",\"text/csv\":()=>\"value1,value2,value3\",\"text/html\":()=>\"<p>content</p>\",\"text/calendar\":()=>\"BEGIN:VCALENDAR\",\"text/javascript\":()=>\"console.dir('Hello world!');\",\"text/xml\":()=>'<person age=\"30\">John Doe</person>',\"text/*\":()=>\"string\"},ho={\"image/*\":()=>bytes(25).toString(\"binary\")},go={\"audio/*\":()=>bytes(25).toString(\"binary\")},yo={\"video/*\":()=>bytes(25).toString(\"binary\")},fo={\"application/json\":()=>'{\"key\":\"value\"}',\"application/ld+json\":()=>'{\"name\": \"John Doe\"}',\"application/x-httpd-php\":()=>\"<?php echo '<p>Hello World!</p>'; ?>\",\"application/rtf\":()=>String.raw`{\\rtf1\\adeflang1025\\ansi\\ansicpg1252\\uc1`,\"application/x-sh\":()=>'echo \"Hello World!\"',\"application/xhtml+xml\":()=>\"<p>content</p>\",\"application/*\":()=>bytes(25).toString(\"binary\")};const So=new class MediaTypeRegistry extends eo{#e={...uo,...ho,...go,...yo,...fo};data={...this.#e};get defaults(){return{...this.#e}}},mediaTypeAPI=(e,t)=>{if(\"function\"==typeof t)return So.register(e,t);if(null===t)return So.unregister(e);const r=e.split(\";\").at(0),a=`${r.split(\"/\").at(0)}/*`;return So.get(e)||So.get(r)||So.get(a)};mediaTypeAPI.getDefaults=()=>So.defaults;const Eo=mediaTypeAPI,applyStringConstraints=(e,t={})=>{const{maxLength:r,minLength:a}=t;let n=e;if(Number.isInteger(r)&&r>0&&(n=n.slice(0,r)),Number.isInteger(a)&&a>0){let e=0;for(;n.length<a;)n+=n[e++%n.length]}return n},types_string=(e,{sample:t}={})=>{const{contentEncoding:r,contentMediaType:a,contentSchema:n}=e,{pattern:s,format:o}=e,l=mo(r)||ma();let c;return c=\"string\"==typeof s?applyStringConstraints((e=>{try{return new(Ot())(e).gen()}catch{return\"string\"}})(s),e):\"string\"==typeof o?(e=>{const{format:t}=e,r=ro(t);return\"function\"==typeof r?r(e):\"string\"})(e):isJSONSchema(n)&&\"string\"==typeof a&&void 0!==t?Array.isArray(t)||\"object\"==typeof t?JSON.stringify(t):applyStringConstraints(String(t),e):\"string\"==typeof a?(e=>{const{contentMediaType:t}=e,r=Eo(t);return\"function\"==typeof r?r(e):\"string\"})(e):applyStringConstraints(\"string\",e),l(c)},applyNumberConstraints=(e,t={})=>{const{minimum:r,maximum:a,exclusiveMinimum:n,exclusiveMaximum:s}=t,{multipleOf:o}=t,l=Number.isInteger(e)?1:Number.EPSILON;let c=\"number\"==typeof r?r:null,i=\"number\"==typeof a?a:null,p=e;if(\"number\"==typeof n&&(c=null!==c?Math.max(c,n+l):n+l),\"number\"==typeof s&&(i=null!==i?Math.min(i,s-l):s-l),p=c>i&&e||c||i||p,\"number\"==typeof o&&o>0){const e=p%o;p=0===e?p:p+o-e}return p},types_number=e=>{const{format:t}=e;let r;return r=\"string\"==typeof t?(e=>{const{format:t}=e,r=ro(t);return\"function\"==typeof r?r(e):0})(e):0,applyNumberConstraints(r,e)},types_integer=e=>{const{format:t}=e;let r;return r=\"string\"==typeof t?(e=>{const{format:t}=e,r=ro(t);if(\"function\"==typeof r)return r(e);switch(t){case\"int32\":return int32();case\"int64\":return int64()}return 0})(e):0,applyNumberConstraints(r,e)},types_boolean=e=>\"boolean\"!=typeof e.default||e.default,_o=new Proxy({array,object,string:types_string,number:types_number,integer:types_integer,boolean:types_boolean,null:()=>null},{get:(e,t)=>\"string\"==typeof t&&Object.hasOwn(e,t)?e[t]:()=>`Unknown Type: ${t}`}),vo=[\"array\",\"object\",\"number\",\"integer\",\"string\",\"boolean\",\"null\"],hasExample=e=>{if(!isJSONSchemaObject(e))return!1;const{examples:t,example:r,default:a}=e;return!!(Array.isArray(t)&&t.length>=1)||(void 0!==a||void 0!==r)},extractExample=e=>{if(!isJSONSchemaObject(e))return null;const{examples:t,example:r,default:a}=e;return Array.isArray(t)&&t.length>=1?t.at(0):void 0!==a?a:void 0!==r?r:void 0},wo={array:[\"items\",\"prefixItems\",\"contains\",\"maxContains\",\"minContains\",\"maxItems\",\"minItems\",\"uniqueItems\",\"unevaluatedItems\"],object:[\"properties\",\"additionalProperties\",\"patternProperties\",\"propertyNames\",\"minProperties\",\"maxProperties\",\"required\",\"dependentSchemas\",\"dependentRequired\",\"unevaluatedProperties\"],string:[\"pattern\",\"format\",\"minLength\",\"maxLength\",\"contentEncoding\",\"contentMediaType\",\"contentSchema\"],integer:[\"minimum\",\"maximum\",\"exclusiveMinimum\",\"exclusiveMaximum\",\"multipleOf\"]};wo.number=wo.integer;const bo=\"string\",inferTypeFromValue=e=>void 0===e?null:null===e?\"null\":Array.isArray(e)?\"array\":Number.isInteger(e)?\"integer\":typeof e,foldType=e=>{if(Array.isArray(e)&&e.length>=1){if(e.includes(\"array\"))return\"array\";if(e.includes(\"object\"))return\"object\";{const t=pick(e);if(vo.includes(t))return t}}return vo.includes(e)?e:null},inferType=(e,t=new WeakSet)=>{if(!isJSONSchemaObject(e))return bo;if(t.has(e))return bo;t.add(e);let{type:r,const:a}=e;if(r=foldType(r),\"string\"!=typeof r){const t=Object.keys(wo);e:for(let a=0;a<t.length;a+=1){const n=t[a],s=wo[n];for(let t=0;t<s.length;t+=1){const a=s[t];if(Object.hasOwn(e,a)){r=n;break e}}}}if(\"string\"!=typeof r&&void 0!==a){const e=inferTypeFromValue(a);r=\"string\"==typeof e?e:r}if(\"string\"!=typeof r){const combineTypes=r=>{if(Array.isArray(e[r])){const a=e[r].map((e=>inferType(e,t)));return foldType(a)}return null},a=combineTypes(\"allOf\"),n=combineTypes(\"anyOf\"),s=combineTypes(\"oneOf\"),o=e.not?inferType(e.not,t):null;(a||n||s||o)&&(r=foldType([a,n,s,o].filter(Boolean)))}if(\"string\"!=typeof r&&hasExample(e)){const t=extractExample(e),a=inferTypeFromValue(t);r=\"string\"==typeof a?a:r}return t.delete(e),r||bo},type_getType=e=>inferType(e),typeCast=e=>predicates_isBooleanJSONSchema(e)?(e=>!1===e?{not:{}}:{})(e):isJSONSchemaObject(e)?e:{},merge=(e,t,r={})=>{if(predicates_isBooleanJSONSchema(e)&&!0===e)return!0;if(predicates_isBooleanJSONSchema(e)&&!1===e)return!1;if(predicates_isBooleanJSONSchema(t)&&!0===t)return!0;if(predicates_isBooleanJSONSchema(t)&&!1===t)return!1;if(!isJSONSchema(e))return t;if(!isJSONSchema(t))return e;const a={...t,...e};if(t.type&&e.type&&Array.isArray(t.type)&&\"string\"==typeof t.type){const r=normalizeArray(t.type).concat(e.type);a.type=Array.from(new Set(r))}if(Array.isArray(t.required)&&Array.isArray(e.required)&&(a.required=[...new Set([...e.required,...t.required])]),t.properties&&e.properties){const n=new Set([...Object.keys(t.properties),...Object.keys(e.properties)]);a.properties={};for(const s of n){const n=t.properties[s]||{},o=e.properties[s]||{};n.readOnly&&!r.includeReadOnly||n.writeOnly&&!r.includeWriteOnly?a.required=(a.required||[]).filter((e=>e!==s)):a.properties[s]=merge(o,n,r)}}return isJSONSchema(t.items)&&isJSONSchema(e.items)&&(a.items=merge(e.items,t.items,r)),isJSONSchema(t.contains)&&isJSONSchema(e.contains)&&(a.contains=merge(e.contains,t.contains,r)),isJSONSchema(t.contentSchema)&&isJSONSchema(e.contentSchema)&&(a.contentSchema=merge(e.contentSchema,t.contentSchema,r)),a},Co=merge,main_sampleFromSchemaGeneric=(e,t={},r=void 0,a=!1)=>{if(null==e&&void 0===r)return;\"function\"==typeof e?.toJS&&(e=e.toJS()),e=typeCast(e);let n=void 0!==r||hasExample(e);const s=!n&&Array.isArray(e.oneOf)&&e.oneOf.length>0,o=!n&&Array.isArray(e.anyOf)&&e.anyOf.length>0;if(!n&&(s||o)){const r=typeCast(pick(s?e.oneOf:e.anyOf));!(e=Co(e,r,t)).xml&&r.xml&&(e.xml=r.xml),hasExample(e)&&hasExample(r)&&(n=!0)}const l={};let{xml:c,properties:i,additionalProperties:p,items:m,contains:u}=e||{},d=type_getType(e),{includeReadOnly:h,includeWriteOnly:g}=t;c=c||{};let y,{name:f,prefix:S,namespace:E}=c,_={};if(Object.hasOwn(e,\"type\")||(e.type=d),a&&(f=f||\"notagname\",y=(S?`${S}:`:\"\")+f,E)){l[S?`xmlns:${S}`:\"xmlns\"]=E}a&&(_[y]=[]);const v=objectify(i);let w,b=0;const hasExceededMaxProperties=()=>Number.isInteger(e.maxProperties)&&e.maxProperties>0&&b>=e.maxProperties,canAddProperty=t=>!(Number.isInteger(e.maxProperties)&&e.maxProperties>0)||!hasExceededMaxProperties()&&(!(t=>!Array.isArray(e.required)||0===e.required.length||!e.required.includes(t))(t)||e.maxProperties-b-(()=>{if(!Array.isArray(e.required)||0===e.required.length)return 0;let t=0;return a?e.required.forEach((e=>t+=void 0===_[e]?0:1)):e.required.forEach((e=>{t+=void 0===_[y]?.find((t=>void 0!==t[e]))?0:1})),e.required.length-t})()>0);if(w=a?(r,n=void 0)=>{if(e&&v[r]){if(v[r].xml=v[r].xml||{},v[r].xml.attribute){const e=Array.isArray(v[r].enum)?pick(v[r].enum):void 0;if(hasExample(v[r]))l[v[r].xml.name||r]=extractExample(v[r]);else if(void 0!==e)l[v[r].xml.name||r]=e;else{const e=typeCast(v[r]),t=type_getType(e),a=v[r].xml.name||r;l[a]=_o[t](e)}return}v[r].xml.name=v[r].xml.name||r}else v[r]||!1===p||(v[r]={xml:{name:r}});let s=main_sampleFromSchemaGeneric(v[r],t,n,a);canAddProperty(r)&&(b++,Array.isArray(s)?_[y]=_[y].concat(s):_[y].push(s))}:(r,n)=>{if(canAddProperty(r)){if(Zs()(e.discriminator?.mapping)&&e.discriminator.propertyName===r&&\"string\"==typeof e.$$ref){for(const t in e.discriminator.mapping)if(-1!==e.$$ref.search(e.discriminator.mapping[t])){_[r]=t;break}}else _[r]=main_sampleFromSchemaGeneric(v[r],t,n,a);b++}},n){let n;if(n=void 0!==r?r:extractExample(e),!a){if(\"number\"==typeof n&&\"string\"===d)return`${n}`;if(\"string\"!=typeof n||\"string\"===d)return n;try{return JSON.parse(n)}catch{return n}}if(\"array\"===d){if(!Array.isArray(n)){if(\"string\"==typeof n)return n;n=[n]}let r=[];return isJSONSchemaObject(m)&&(m.xml=m.xml||c||{},m.xml.name=m.xml.name||c.name,r=n.map((e=>main_sampleFromSchemaGeneric(m,t,e,a)))),isJSONSchemaObject(u)&&(u.xml=u.xml||c||{},u.xml.name=u.xml.name||c.name,r=[main_sampleFromSchemaGeneric(u,t,void 0,a),...r]),r=_o.array(e,{sample:r}),c.wrapped?(_[y]=r,kt()(l)||_[y].push({_attr:l})):_=r,_}if(\"object\"===d){if(\"string\"==typeof n)return n;for(const e in n)Object.hasOwn(n,e)&&(v[e]?.readOnly&&!h||v[e]?.writeOnly&&!g||(v[e]?.xml?.attribute?l[v[e].xml.name||e]=n[e]:w(e,n[e])));return kt()(l)||_[y].push({_attr:l}),_}return _[y]=kt()(l)?n:[{_attr:l},n],_}if(\"array\"===d){let r=[];if(isJSONSchemaObject(u))if(a&&(u.xml=u.xml||e.xml||{},u.xml.name=u.xml.name||c.name),Array.isArray(u.anyOf)){const{anyOf:e,...n}=m;r.push(...u.anyOf.map((e=>main_sampleFromSchemaGeneric(Co(e,n,t),t,void 0,a))))}else if(Array.isArray(u.oneOf)){const{oneOf:e,...n}=m;r.push(...u.oneOf.map((e=>main_sampleFromSchemaGeneric(Co(e,n,t),t,void 0,a))))}else{if(!(!a||a&&c.wrapped))return main_sampleFromSchemaGeneric(u,t,void 0,a);r.push(main_sampleFromSchemaGeneric(u,t,void 0,a))}if(isJSONSchemaObject(m))if(a&&(m.xml=m.xml||e.xml||{},m.xml.name=m.xml.name||c.name),Array.isArray(m.anyOf)){const{anyOf:e,...n}=m;r.push(...m.anyOf.map((e=>main_sampleFromSchemaGeneric(Co(e,n,t),t,void 0,a))))}else if(Array.isArray(m.oneOf)){const{oneOf:e,...n}=m;r.push(...m.oneOf.map((e=>main_sampleFromSchemaGeneric(Co(e,n,t),t,void 0,a))))}else{if(!(!a||a&&c.wrapped))return main_sampleFromSchemaGeneric(m,t,void 0,a);r.push(main_sampleFromSchemaGeneric(m,t,void 0,a))}return r=_o.array(e,{sample:r}),a&&c.wrapped?(_[y]=r,kt()(l)||_[y].push({_attr:l}),_):r}if(\"object\"===d){for(let e in v)Object.hasOwn(v,e)&&(v[e]?.deprecated||v[e]?.readOnly&&!h||v[e]?.writeOnly&&!g||w(e));if(a&&l&&_[y].push({_attr:l}),hasExceededMaxProperties())return _;if(predicates_isBooleanJSONSchema(p)&&p)a?_[y].push({additionalProp:\"Anything can be here\"}):_.additionalProp1={},b++;else if(isJSONSchemaObject(p)){const r=p,n=main_sampleFromSchemaGeneric(r,t,void 0,a);if(a&&\"string\"==typeof r?.xml?.name&&\"notagname\"!==r?.xml?.name)_[y].push(n);else{const t=Number.isInteger(e.minProperties)&&e.minProperties>0&&b<e.minProperties?e.minProperties-b:3;for(let e=1;e<=t;e++){if(hasExceededMaxProperties())return _;if(a){const t={};t[\"additionalProp\"+e]=n.notagname,_[y].push(t)}else _[\"additionalProp\"+e]=n;b++}}}return _}let C;if(void 0!==e.const)C=e.const;else if(e&&Array.isArray(e.enum))C=pick(normalizeArray(e.enum));else{const r=isJSONSchemaObject(e.contentSchema)?main_sampleFromSchemaGeneric(e.contentSchema,t,void 0,a):void 0;C=_o[d](e,{sample:r})}return a?(_[y]=kt()(l)?C:[{_attr:l},C],_):C},main_createXMLExample=(e,t,r)=>{const a=main_sampleFromSchemaGeneric(e,t,r,!0);if(a)return\"string\"==typeof a?a:Ct()(a,{declaration:!0,indent:\"\\t\"})},main_sampleFromSchema=(e,t,r)=>main_sampleFromSchemaGeneric(e,t,r,!1),main_resolver=(e,t,r)=>[e,JSON.stringify(t),JSON.stringify(r)],xo=utils_memoizeN(main_createXMLExample,main_resolver),Oo=utils_memoizeN(main_sampleFromSchema,main_resolver);const No=new class OptionRegistry extends eo{#e={};data={...this.#e};get defaults(){return{...this.#e}}},api_optionAPI=(e,t)=>(void 0!==t&&No.register(e,t),No.get(e)),ko=[{when:/json/,shouldStringifyTypes:[\"string\"]}],Ao=[\"object\"],fn_get_json_sample_schema=e=>(t,r,a,n)=>{const{fn:s}=e(),o=s.jsonSchema202012.memoizedSampleFromSchema(t,r,n),l=typeof o,c=ko.reduce(((e,t)=>t.when.test(a)?[...e,...t.shouldStringifyTypes]:e),Ao);return X()(c,(e=>e===l))?JSON.stringify(o,null,2):o},fn_get_yaml_sample_schema=e=>(t,r,a,n)=>{const{fn:s}=e(),o=s.jsonSchema202012.getJsonSampleSchema(t,r,a,n);let l;try{l=Me().dump(Me().load(o),{lineWidth:-1},{schema:Pe.JSON_SCHEMA}),\"\\n\"===l[l.length-1]&&(l=l.slice(0,l.length-1))}catch(e){return console.error(e),\"error: could not generate yaml example\"}return l.replace(/\\t/g,\"  \")},fn_get_xml_sample_schema=e=>(t,r,a)=>{const{fn:n}=e();if(t&&!t.xml&&(t.xml={}),t&&!t.xml.name){if(!t.$$ref&&(t.type||t.items||t.properties||t.additionalProperties))return'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n\\x3c!-- XML example cannot be generated; root element name is undefined --\\x3e';if(t.$$ref){let e=t.$$ref.match(/\\S*\\/(\\S+)$/);t.xml.name=e[1]}}return n.jsonSchema202012.memoizedCreateXMLExample(t,r,a)},fn_get_sample_schema=e=>(t,r=\"\",a={},n=void 0)=>{const{fn:s}=e();return\"function\"==typeof t?.toJS&&(t=t.toJS()),\"function\"==typeof n?.toJS&&(n=n.toJS()),/xml/.test(r)?s.jsonSchema202012.getXmlSampleSchema(t,a,n):/(yaml|yml)/.test(r)?s.jsonSchema202012.getYamlSampleSchema(t,a,r,n):s.jsonSchema202012.getJsonSampleSchema(t,a,r,n)},json_schema_2020_12_samples=({getSystem:e})=>{const t=fn_get_json_sample_schema(e),r=fn_get_yaml_sample_schema(e),a=fn_get_xml_sample_schema(e),n=fn_get_sample_schema(e);return{fn:{jsonSchema202012:{sampleFromSchema:main_sampleFromSchema,sampleFromSchemaGeneric:main_sampleFromSchemaGeneric,sampleOptionAPI:api_optionAPI,sampleEncoderAPI:mo,sampleFormatAPI:ro,sampleMediaTypeAPI:Eo,createXMLExample:main_createXMLExample,memoizedSampleFromSchema:Oo,memoizedCreateXMLExample:xo,getJsonSampleSchema:t,getYamlSampleSchema:r,getXmlSampleSchema:a,getSampleSchema:n,mergeJsonSchema:Co}}}};function PresetApis(){return[base,oas3,json_schema_2020_12,json_schema_2020_12_samples,oas31]}const inline_plugin=e=>()=>({fn:e.fn,components:e.components}),factorization_system=e=>{const t=I()({layout:{layout:e.layout,filter:e.filter},spec:{spec:\"\",url:e.url},requestSnippets:e.requestSnippets},e.initialState);if(e.initialState)for(const[r,a]of Object.entries(e.initialState))void 0===a&&delete t[r];return{system:{configs:e.configs},plugins:e.presets,state:t}},query=()=>e=>{const t=e.queryConfigEnabled?(()=>{const e=new URLSearchParams(L.location.search);return Object.fromEntries(e)})():{};return Object.entries(t).reduce(((e,[t,r])=>(\"config\"===t?e.configUrl=r:\"urls.primaryName\"===t?e[t]=r:e=br()(e,t,r),e)),{})},sources_url=({url:e,system:t})=>async r=>{if(!e)return{};if(\"function\"!=typeof t.configsActions?.getConfigByUrl)return{};const a=(()=>{const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e})();return t.configsActions.getConfigByUrl({url:e,loadRemoteConfig:!0,requestInterceptor:r.requestInterceptor,responseInterceptor:r.responseInterceptor},(e=>{a.resolve(e)})),a.promise},runtime=()=>()=>{const e={};return globalThis.location&&(e.oauth2RedirectUrl=`${globalThis.location.protocol}//${globalThis.location.host}${globalThis.location.pathname.substring(0,globalThis.location.pathname.lastIndexOf(\"/\"))}/oauth2-redirect.html`),e},Io=Object.freeze({dom_id:null,domNode:null,spec:{},url:\"\",urls:null,configUrl:null,layout:\"BaseLayout\",docExpansion:\"list\",maxDisplayedTags:-1,filter:!1,validatorUrl:\"https://validator.swagger.io/validator\",oauth2RedirectUrl:void 0,persistAuthorization:!1,configs:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,tryItOutEnabled:!1,requestInterceptor:e=>(e.curlOptions=[],e),responseInterceptor:e=>e,showMutatedRequest:!0,defaultModelRendering:\"example\",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:!1,requestSnippetsEnabled:!1,requestSnippets:{generators:{curl_bash:{title:\"cURL (bash)\",syntax:\"bash\"},curl_powershell:{title:\"cURL (PowerShell)\",syntax:\"powershell\"},curl_cmd:{title:\"cURL (CMD)\",syntax:\"bash\"}},defaultExpanded:!0,languages:null},supportedSubmitMethods:[\"get\",\"put\",\"post\",\"delete\",\"options\",\"head\",\"patch\",\"trace\"],queryConfigEnabled:!1,presets:[PresetApis],plugins:[],initialState:{},fn:{},components:{},syntaxHighlight:{activated:!0,theme:\"agate\"},operationsSorter:null,tagsSorter:null,onComplete:null,modelPropertyMacro:null,parameterMacro:null}),qo=require(\"lodash/has\");var jo=__webpack_require__.n(qo);const Po=require(\"lodash/fp/set\");var Mo=__webpack_require__.n(Po);const type_casters_array=(e,t=[])=>Array.isArray(e)?e:t,type_casters_boolean=(e,t=!1)=>!0===e||\"true\"===e||1===e||\"1\"===e||!1!==e&&\"false\"!==e&&0!==e&&\"0\"!==e&&t,dom_node=e=>null===e||\"null\"===e?null:e,type_casters_filter=e=>{const t=String(e);return type_casters_boolean(e,t)},type_casters_function=(e,t)=>\"function\"==typeof e?e:t,nullable_array=e=>Array.isArray(e)?e:null,nullable_function=e=>\"function\"==typeof e?e:null,nullable_string=e=>null===e||\"null\"===e?null:String(e),type_casters_number=(e,t=-1)=>{const r=parseInt(e,10);return Number.isNaN(r)?t:r},type_casters_object=(e,t={})=>Zs()(e)?e:t,sorter=e=>\"function\"==typeof e||\"string\"==typeof e?e:null,type_casters_string=e=>String(e),syntax_highlight=(e,t)=>Zs()(e)?e:!1===e||\"false\"===e||0===e||\"0\"===e?{activated:!1}:t,undefined_string=e=>void 0===e||\"undefined\"===e?void 0:String(e),Ro={components:{typeCaster:type_casters_object},configs:{typeCaster:type_casters_object},configUrl:{typeCaster:nullable_string},deepLinking:{typeCaster:type_casters_boolean,defaultValue:Io.deepLinking},defaultModelExpandDepth:{typeCaster:type_casters_number,defaultValue:Io.defaultModelExpandDepth},defaultModelRendering:{typeCaster:type_casters_string},defaultModelsExpandDepth:{typeCaster:type_casters_number,defaultValue:Io.defaultModelsExpandDepth},displayOperationId:{typeCaster:type_casters_boolean,defaultValue:Io.displayOperationId},displayRequestDuration:{typeCaster:type_casters_boolean,defaultValue:Io.displayRequestDuration},docExpansion:{typeCaster:type_casters_string},dom_id:{typeCaster:nullable_string},domNode:{typeCaster:dom_node},filter:{typeCaster:type_casters_filter},fn:{typeCaster:type_casters_object},initialState:{typeCaster:type_casters_object},layout:{typeCaster:type_casters_string},maxDisplayedTags:{typeCaster:type_casters_number,defaultValue:Io.maxDisplayedTags},modelPropertyMacro:{typeCaster:nullable_function},oauth2RedirectUrl:{typeCaster:undefined_string},onComplete:{typeCaster:nullable_function},operationsSorter:{typeCaster:sorter},paramaterMacro:{typeCaster:nullable_function},persistAuthorization:{typeCaster:type_casters_boolean,defaultValue:Io.persistAuthorization},plugins:{typeCaster:type_casters_array,defaultValue:Io.plugins},presets:{typeCaster:type_casters_array,defaultValue:Io.presets},requestInterceptor:{typeCaster:type_casters_function,defaultValue:Io.requestInterceptor},requestSnippets:{typeCaster:type_casters_object,defaultValue:Io.requestSnippets},requestSnippetsEnabled:{typeCaster:type_casters_boolean,defaultValue:Io.requestSnippetsEnabled},responseInterceptor:{typeCaster:type_casters_function,defaultValue:Io.responseInterceptor},showCommonExtensions:{typeCaster:type_casters_boolean,defaultValue:Io.showCommonExtensions},showExtensions:{typeCaster:type_casters_boolean,defaultValue:Io.showExtensions},showMutatedRequest:{typeCaster:type_casters_boolean,defaultValue:Io.showMutatedRequest},spec:{typeCaster:type_casters_object,defaultValue:Io.spec},supportedSubmitMethods:{typeCaster:type_casters_array,defaultValue:Io.supportedSubmitMethods},syntaxHighlight:{typeCaster:syntax_highlight,defaultValue:Io.syntaxHighlight},\"syntaxHighlight.activated\":{typeCaster:type_casters_boolean,defaultValue:Io.syntaxHighlight.activated},\"syntaxHighlight.theme\":{typeCaster:type_casters_string},tagsSorter:{typeCaster:sorter},tryItOutEnabled:{typeCaster:type_casters_boolean,defaultValue:Io.tryItOutEnabled},url:{typeCaster:type_casters_string},urls:{typeCaster:nullable_array},\"urls.primaryName\":{typeCaster:type_casters_string},validatorUrl:{typeCaster:nullable_string},withCredentials:{typeCaster:type_casters_boolean,defaultValue:Io.withCredentials}},type_cast=e=>Object.entries(Ro).reduce(((e,[t,{typeCaster:r,defaultValue:a}])=>{if(jo()(e,t)){const n=r(He()(e,t),a);e=Mo()(t,n,e)}return e}),{...e}),config_merge=(e,...t)=>{let r=Symbol.for(\"domNode\"),a=Symbol.for(\"primaryName\");const n=[];for(const e of t){const t={...e};Object.hasOwn(t,\"domNode\")&&(r=t.domNode,delete t.domNode),Object.hasOwn(t,\"urls.primaryName\")?(a=t[\"urls.primaryName\"],delete t[\"urls.primaryName\"]):Array.isArray(t.urls)&&Object.hasOwn(t.urls,\"primaryName\")&&(a=t.urls.primaryName,delete t.urls.primaryName),n.push(t)}const s=I()(e,...n);return r!==Symbol.for(\"domNode\")&&(s.domNode=r),a!==Symbol.for(\"primaryName\")&&Array.isArray(s.urls)&&(s.urls.primaryName=a),type_cast(s)};function SwaggerUI(e){const t=query()(e),r=runtime()(),a=SwaggerUI.config.merge({},SwaggerUI.config.defaults,r,e,t),n=factorization_system(a),s=inline_plugin(a),o=new Store(n);o.register([a.plugins,s]);const l=o.getSystem(),persistConfigs=e=>{o.setConfigs(e),l.configsActions.loaded()},updateSpec=e=>{!t.url&&\"object\"==typeof e.spec&&Object.keys(e.spec).length>0?(l.specActions.updateUrl(\"\"),l.specActions.updateLoadingStatus(\"success\"),l.specActions.updateSpec(JSON.stringify(e.spec))):\"function\"==typeof l.specActions.download&&e.url&&!e.urls&&(l.specActions.updateUrl(e.url),l.specActions.download(e.url))},render=e=>{if(e.domNode)l.render(e.domNode,\"App\");else if(e.dom_id){const t=document.querySelector(e.dom_id);l.render(t,\"App\")}else null===e.dom_id||null===e.domNode||console.error(\"Skipped rendering: no `dom_id` or `domNode` was specified\")};return a.configUrl?((async()=>{const{configUrl:e}=a,r=await sources_url({url:e,system:l})(a),n=SwaggerUI.config.merge({},a,r,t);persistConfigs(n),null!==r&&updateSpec(n),render(n)})(),l):(persistConfigs(a),updateSpec(a),render(a),l)}SwaggerUI.System=Store,SwaggerUI.config={defaults:Io,merge:config_merge,typeCast:type_cast,typeCastMappings:Ro},SwaggerUI.presets={base,apis:PresetApis},SwaggerUI.plugins={Auth:auth,Configs:configsPlugin,DeepLining:deep_linking,Err:err,Filter:filter,Icons:icons,JSONSchema5:json_schema_5,JSONSchema5Samples:json_schema_5_samples,JSONSchema202012:json_schema_2020_12,JSONSchema202012Samples:json_schema_2020_12_samples,Layout:plugins_layout,Logs:logs,OpenAPI30:oas3,OpenAPI31:oas3,OnComplete:on_complete,RequestSnippets:plugins_request_snippets,Spec:plugins_spec,SwaggerClient:swagger_client,Util:util,View:view,ViewLegacy:view_legacy,DownloadUrl:downloadUrlPlugin,SyntaxHighlighting:syntax_highlighting,Versions:versions,SafeRender:safe_render};const To=SwaggerUI})(),r=r.default})()));\n//# sourceMappingURL=swagger-ui.js.map"
  },
  {
    "path": "src/main/resources/doc-index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>WireMock Documentation Index</title>\n</head>\n<body>\n    <a href=\"/__admin/docs/swagger\" title=\"OpenAPI 3.0 spec\">OpenAPI 3.0 spec</a><br />\n    <a href=\"/__admin/swagger-ui\" title=\"Swagger UI\">Swagger UI</a><br />\n</body>\n</html>\n"
  },
  {
    "path": "src/main/resources/wiremock/joptsimple/HelpFormatterMessages.properties",
    "content": "#\n# This is copied from joptsimple.\n# Properties prefixed with \"wiremock\" to match after relocation into standalone jar\n# Without this, the \"--help\" command will throw MissingResourceException\n#\nwiremock.joptsimple.BuiltinHelpFormatter.no.options.specified = No options specified\nwiremock.joptsimple.BuiltinHelpFormatter.non.option.arguments.header = Non-option arguments:\nwiremock.joptsimple.BuiltinHelpFormatter.option.header.with.required.indicator = Option (* = required)\nwiremock.joptsimple.BuiltinHelpFormatter.option.divider.with.required.indicator = ---------------------\nwiremock.joptsimple.BuiltinHelpFormatter.option.header = Option\nwiremock.joptsimple.BuiltinHelpFormatter.option.divider = ------\nwiremock.joptsimple.BuiltinHelpFormatter.description.header = Description\nwiremock.joptsimple.BuiltinHelpFormatter.description.divider = -----------\nwiremock.joptsimple.BuiltinHelpFormatter.default.value.header = default:\nwiremock.joptsimple.AlternativeLongOptionSpec.description = Alternative form of long options\nwiremock.joptsimple.AlternativeLongOptionSpec.arg.description = opt=value\n"
  },
  {
    "path": "src/test/java/benchmarks/HandlebarsOptimizedTemplateBenchmark.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage benchmarks;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.stubbing.ServeEventFactory.newPostMatchServeEvent;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.matching.MockRequest;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.ExtensionFactoryUtils;\nimport org.openjdk.jmh.annotations.*;\n\n@BenchmarkMode(Mode.Throughput)\n@Warmup(iterations = 2)\n@Fork(1)\n@Measurement(iterations = 5)\npublic class HandlebarsOptimizedTemplateBenchmark {\n\n  @State(Scope.Benchmark)\n  public static class HandlebarsOptimizedTemplateBenchmarkState {\n    private ResponseTemplateTransformer transformer;\n\n    @Setup\n    public void setup() {\n      transformer = ExtensionFactoryUtils.buildTemplateTransformer(true);\n    }\n  }\n\n  @Benchmark\n  @Threads(50)\n  public boolean transform(HandlebarsOptimizedTemplateBenchmarkState state) {\n\n    String result =\n        transform(\n            \"{{#each (range 100000 199999) as |index|}}Line {{index}}\\n{{/each}}\",\n            state.transformer);\n\n    boolean hasCorrectStart = result.startsWith(\"Line 100000\\nLine 100001\\nLine 100002\\n\");\n    boolean hasCorrectLength = result.length() == 1_200_000;\n    return hasCorrectStart && hasCorrectLength;\n  }\n\n  private String transform(String responseBodyTemplate, ResponseTemplateTransformer transformer) {\n    final ResponseDefinitionBuilder responseDefinitionBuilder =\n        aResponse().withBody(responseBodyTemplate);\n    final StubMapping stub = get(\"/\").willReturn(responseDefinitionBuilder).build();\n    final MockRequest request = mockRequest();\n    ServeEvent serveEvent = newPostMatchServeEvent(request, responseDefinitionBuilder, stub);\n    return transformer.transform(serveEvent).getBody();\n  }\n}\n"
  },
  {
    "path": "src/test/java/benchmarks/JsonPathAdvancedMatchingBenchmark.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage benchmarks;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.openjdk.jmh.annotations.*;\nimport org.openjdk.jmh.runner.Runner;\nimport org.openjdk.jmh.runner.options.Options;\nimport org.openjdk.jmh.runner.options.OptionsBuilder;\n\n@BenchmarkMode(Mode.Throughput)\n@Warmup(iterations = 2)\n@Fork(1)\n@Measurement(iterations = 5)\npublic class JsonPathAdvancedMatchingBenchmark {\n\n  public static final String[] TOPICS = {\n    \"topic-one\",\n    \"longer-topic-2\",\n    \"very-long-topic-3\",\n    \"four\",\n    \"five55555555\",\n    \"six\",\n    \"seven\",\n    \"eight\",\n    \"nine\",\n    \"ten\",\n    \"eleven\",\n    \"twelve\",\n    \"thirteen\",\n    \"fourteen\",\n    \"fifteen\",\n    \"sixteen\",\n    \"seventeen\",\n    \"eighteen\",\n    \"nineteen\",\n    \"twenty\"\n  };\n\n  @State(Scope.Benchmark)\n  public static class BenchmarkState {\n    private WireMockServer wm;\n    private WireMockTestClient client;\n\n    @Setup\n    public void setup() {\n      wm =\n          new WireMockServer(\n              wireMockConfig().dynamicPort().disableRequestJournal().containerThreads(100));\n      wm.start();\n      client = new WireMockTestClient(wm.port());\n\n      for (String topic : TOPICS) {\n        wm.stubFor(\n            post(\"/things\")\n                .withRequestBody(matchingJsonPath(\"$.[*].topic\", equalTo(topic)))\n                .willReturn(ok(topic)));\n      }\n    }\n\n    @TearDown\n    public void tearDown() {\n      wm.stop();\n    }\n  }\n\n  @Benchmark\n  @Threads(50)\n  public boolean matched(BenchmarkState state) {\n    final WireMockResponse response =\n        state.client.postJson(\"/things\", String.format(JSON_TEMPLATE, pickRandom(TOPICS)));\n    return response.content().equals(\"very-long-topic-3\");\n  }\n\n  private static String pickRandom(String[] values) {\n    return values[(int) (Math.random() * values.length)];\n  }\n\n  public static void main(String[] args) throws Exception {\n    Options opt =\n        new OptionsBuilder()\n            .include(JsonPathAdvancedMatchingBenchmark.class.getSimpleName())\n            .warmupIterations(2)\n            .forks(1)\n            .measurementIterations(5)\n            .build();\n\n    new Runner(opt).run();\n  }\n\n  static final String JSON_TEMPLATE =\n      \"[\\n\"\n          + \"  {\\\"topic\\\": \\\"A\\\", \\\"name\\\": \\\"John Doe\\\", \\\"age\\\": 30, \\\"occupation\\\": \\\"Engineer\\\", \\\"city\\\": \\\"New York\\\", \\\"interests\\\": [\\\"hiking\\\", \\\"reading\\\", \\\"cooking\\\"], \\\"email\\\": \\\"john.doe@example.com\\\", \\\"phone\\\": \\\"+1234567890\\\", \\\"address\\\": \\\"123 Main St\\\", \\\"member_since\\\": \\\"2020-01-15\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"B\\\", \\\"name\\\": \\\"Alice Smith\\\", \\\"age\\\": 25, \\\"occupation\\\": \\\"Graphic Designer\\\", \\\"city\\\": \\\"Los Angeles\\\", \\\"interests\\\": [\\\"painting\\\", \\\"yoga\\\", \\\"traveling\\\"], \\\"email\\\": \\\"alice.smith@example.com\\\", \\\"phone\\\": \\\"+1987654321\\\", \\\"address\\\": \\\"456 Elm St\\\", \\\"member_since\\\": \\\"2018-07-20\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"C\\\", \\\"name\\\": \\\"Michael Johnson\\\", \\\"age\\\": 35, \\\"occupation\\\": \\\"Doctor\\\", \\\"city\\\": \\\"Chicago\\\", \\\"interests\\\": [\\\"running\\\", \\\"photography\\\", \\\"music\\\"], \\\"email\\\": \\\"michael.johnson@example.com\\\", \\\"phone\\\": \\\"+1122334455\\\", \\\"address\\\": \\\"789 Oak St\\\", \\\"member_since\\\": \\\"2016-03-10\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"D\\\", \\\"name\\\": \\\"Emily Brown\\\", \\\"age\\\": 28, \\\"occupation\\\": \\\"Teacher\\\", \\\"city\\\": \\\"Houston\\\", \\\"interests\\\": [\\\"gardening\\\", \\\"volunteering\\\", \\\"movies\\\"], \\\"email\\\": \\\"emily.brown@example.com\\\", \\\"phone\\\": \\\"+1443322110\\\", \\\"address\\\": \\\"101 Pine St\\\", \\\"member_since\\\": \\\"2019-11-05\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"E\\\", \\\"name\\\": \\\"Christopher Lee\\\", \\\"age\\\": 40, \\\"occupation\\\": \\\"Software Developer\\\", \\\"city\\\": \\\"San Francisco\\\", \\\"interests\\\": [\\\"coding\\\", \\\"gaming\\\", \\\"hiking\\\"], \\\"email\\\": \\\"chris.lee@example.com\\\", \\\"phone\\\": \\\"+1555099887\\\", \\\"address\\\": \\\"234 Maple St\\\", \\\"member_since\\\": \\\"2015-05-30\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"F\\\", \\\"name\\\": \\\"Jessica Taylor\\\", \\\"age\\\": 32, \\\"occupation\\\": \\\"Marketing Manager\\\", \\\"city\\\": \\\"Seattle\\\", \\\"interests\\\": [\\\"writing\\\", \\\"biking\\\", \\\"cooking\\\"], \\\"email\\\": \\\"jessica.taylor@example.com\\\", \\\"phone\\\": \\\"+1662777999\\\", \\\"address\\\": \\\"567 Cedar St\\\", \\\"member_since\\\": \\\"2017-09-12\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"G\\\", \\\"name\\\": \\\"Daniel Martinez\\\", \\\"age\\\": 45, \\\"occupation\\\": \\\"Architect\\\", \\\"city\\\": \\\"Miami\\\", \\\"interests\\\": [\\\"traveling\\\", \\\"drawing\\\", \\\"surfing\\\"], \\\"email\\\": \\\"daniel.martinez@example.com\\\", \\\"phone\\\": \\\"+1777555666\\\", \\\"address\\\": \\\"890 Walnut St\\\", \\\"member_since\\\": \\\"2014-02-25\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"H\\\", \\\"name\\\": \\\"Sarah Wilson\\\", \\\"age\\\": 27, \\\"occupation\\\": \\\"Journalist\\\", \\\"city\\\": \\\"Boston\\\", \\\"interests\\\": [\\\"reading\\\", \\\"running\\\", \\\"photography\\\"], \\\"email\\\": \\\"sarah.wilson@example.com\\\", \\\"phone\\\": \\\"+1888444333\\\", \\\"address\\\": \\\"123 Pineapple St\\\", \\\"member_since\\\": \\\"2021-02-18\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"%s\\\", \\\"name\\\": \\\"David Thompson\\\", \\\"age\\\": 33, \\\"occupation\\\": \\\"Financial Analyst\\\", \\\"city\\\": \\\"Atlanta\\\", \\\"interests\\\": [\\\"investing\\\", \\\"basketball\\\", \\\"traveling\\\"], \\\"email\\\": \\\"david.thompson@example.com\\\", \\\"phone\\\": \\\"+1999777666\\\", \\\"address\\\": \\\"456 Peach St\\\", \\\"member_since\\\": \\\"2013-08-09\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"J\\\", \\\"name\\\": \\\"Rachel Garcia\\\", \\\"age\\\": 29, \\\"occupation\\\": \\\"Nurse\\\", \\\"city\\\": \\\"Dallas\\\", \\\"interests\\\": [\\\"painting\\\", \\\"yoga\\\", \\\"movies\\\"], \\\"email\\\": \\\"rachel.garcia@example.com\\\", \\\"phone\\\": \\\"+1444999888\\\", \\\"address\\\": \\\"789 Orange St\\\", \\\"member_since\\\": \\\"2019-04-27\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"K\\\", \\\"name\\\": \\\"Kevin Nguyen\\\", \\\"age\\\": 31, \\\"occupation\\\": \\\"Entrepreneur\\\", \\\"city\\\": \\\"Austin\\\", \\\"interests\\\": [\\\"coding\\\", \\\"startups\\\", \\\"traveling\\\"], \\\"email\\\": \\\"kevin.nguyen@example.com\\\", \\\"phone\\\": \\\"+1222333444\\\", \\\"address\\\": \\\"101 Lemon St\\\", \\\"member_since\\\": \\\"2016-11-14\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"L\\\", \\\"name\\\": \\\"Rebecca Kim\\\", \\\"age\\\": 26, \\\"occupation\\\": \\\"Graphic Designer\\\", \\\"city\\\": \\\"Denver\\\", \\\"interests\\\": [\\\"hiking\\\", \\\"photography\\\", \\\"music\\\"], \\\"email\\\": \\\"rebecca.kim@example.com\\\", \\\"phone\\\": \\\"+1666888999\\\", \\\"address\\\": \\\"234 Berry St\\\", \\\"member_since\\\": \\\"2020-08-03\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"M\\\", \\\"name\\\": \\\"Mark Hernandez\\\", \\\"age\\\": 38, \\\"occupation\\\": \\\"Lawyer\\\", \\\"city\\\": \\\"Phoenix\\\", \\\"interests\\\": [\\\"reading\\\", \\\"tennis\\\", \\\"cooking\\\"], \\\"email\\\": \\\"mark.hernandez@example.com\\\", \\\"phone\\\": \\\"+1777666555\\\", \\\"address\\\": \\\"567 Grape St\\\", \\\"member_since\\\": \\\"2015-12-21\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"N\\\", \\\"name\\\": \\\"Jennifer White\\\", \\\"age\\\": 34, \\\"occupation\\\": \\\"HR Manager\\\", \\\"city\\\": \\\"Philadelphia\\\", \\\"interests\\\": [\\\"painting\\\", \\\"running\\\", \\\"movies\\\"], \\\"email\\\": \\\"jennifer.white@example.com\\\", \\\"phone\\\": \\\"+1444333222\\\", \\\"address\\\": \\\"890 Cherry St\\\", \\\"member_since\\\": \\\"2017-06-08\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"O\\\", \\\"name\\\": \\\"Andrew Brown\\\", \\\"age\\\": 37, \\\"occupation\\\": \\\"Sales Manager\\\", \\\"city\\\": \\\"San Diego\\\", \\\"interests\\\": [\\\"golfing\\\", \\\"traveling\\\", \\\"cooking\\\"], \\\"email\\\": \\\"andrew.brown@example.com\\\", \\\"phone\\\": \\\"+1555888777\\\", \\\"address\\\": \\\"123 Plum St\\\", \\\"member_since\\\": \\\"2016-01-30\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"P\\\", \\\"name\\\": \\\"Lauren Rodriguez\\\", \\\"age\\\": 29, \\\"occupation\\\": \\\"Teacher\\\", \\\"city\\\": \\\"Orlando\\\", \\\"interests\\\": [\\\"writing\\\", \\\"yoga\\\", \\\"movies\\\"], \\\"email\\\": \\\"lauren.rodriguez@example.com\\\", \\\"phone\\\": \\\"+1666999888\\\", \\\"address\\\": \\\"456 Pine St\\\", \\\"member_since\\\": \\\"2018-10-17\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"Q\\\", \\\"name\\\": \\\"Jonathan Kim\\\", \\\"age\\\": 42, \\\"occupation\\\": \\\"Doctor\\\", \\\"city\\\": \\\"Portland\\\", \\\"interests\\\": [\\\"hiking\\\", \\\"painting\\\", \\\"music\\\"], \\\"email\\\": \\\"jonathan.kim@example.com\\\", \\\"phone\\\": \\\"+1222777666\\\", \\\"address\\\": \\\"789 Olive St\\\", \\\"member_since\\\": \\\"2014-05-12\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"R\\\", \\\"name\\\": \\\"Michelle Garcia\\\", \\\"age\\\": 30, \\\"occupation\\\": \\\"Software Engineer\\\", \\\"city\\\": \\\"San Antonio\\\", \\\"interests\\\": [\\\"coding\\\", \\\"gaming\\\", \\\"traveling\\\"], \\\"email\\\": \\\"michelle.garcia@example.com\\\", \\\"phone\\\": \\\"+1333444555\\\", \\\"address\\\": \\\"890 Walnut St\\\", \\\"member_since\\\": \\\"2019-02-14\\\"}\\n\"\n          + \"]\\n\";\n}\n\n/*\nLast result but one:\n\nBenchmark                           Mode  Cnt     Score      Error  Units\nJsonPathMatchingBenchmark.matched  thrpt    5  9326.701 ± 1291.559  ops/s\n\n\nLast result (pre-compiling JSONPath expression):\n\nBenchmark                           Mode  Cnt     Score     Error  Units\nJsonPathMatchingBenchmark.matched  thrpt    5  9600.253 ± 463.052  ops/s\n */\n"
  },
  {
    "path": "src/test/java/benchmarks/JsonPathMatchingBenchTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage benchmarks;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.openjdk.jmh.runner.Runner;\nimport org.openjdk.jmh.runner.options.Options;\nimport org.openjdk.jmh.runner.options.OptionsBuilder;\n\npublic class JsonPathMatchingBenchTest {\n\n  public static final String[] TOPICS = {\n    \"topic-one\", \"longer-topic-2\", \"very-long-topic-3\", \"four\", \"five55555555\"\n  };\n\n  private WireMockServer wm;\n  private WireMockTestClient client;\n\n  @BeforeEach\n  public void setup() {\n    wm = new WireMockServer(wireMockConfig().dynamicPort());\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  @Test\n  public void simple() {\n    for (String topic : TOPICS) {\n      wm.stubFor(\n          post(\"/things\")\n              .withRequestBody(matchingJsonPath(\"$.[?(@.topic == '\" + topic + \"')]\"))\n              .willReturn(ok(topic)));\n    }\n\n    final WireMockResponse response =\n        client.postJson(\"/things\", String.format(JSON_TEMPLATE, \"topic-one\"));\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"topic-one\"));\n  }\n\n  @Test\n  public void advanced() {\n    for (String topic : TOPICS) {\n      wm.stubFor(\n          post(\"/things\")\n              .withRequestBody(matchingJsonPath(\"$.[*].topic\", equalTo(topic)))\n              .willReturn(ok(topic)));\n    }\n\n    final WireMockResponse response =\n        client.postJson(\"/things\", String.format(JSON_TEMPLATE, \"topic-one\"));\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"topic-one\"));\n  }\n\n  public static void main(String[] args) throws Exception {\n    Options opt =\n        new OptionsBuilder()\n            .include(JsonPathMatchingBenchTest.class.getSimpleName())\n            .warmupIterations(3)\n            .forks(5)\n            .measurementIterations(10)\n            .build();\n\n    new Runner(opt).run();\n  }\n\n  static final String JSON_TEMPLATE =\n      \"[\\n\"\n          + \"    {\\n\"\n          + \"        \\\"topic\\\": \\\"%s\\\",\\n\"\n          + \"        \\\"key\\\": {\\n\"\n          + \"            \\\"orgId\\\": \\\"ORG001\\\",\\n\"\n          + \"            \\\"productId\\\": \\\"1266009\\\",\\n\"\n          + \"            \\\"uom\\\": \\\"EACH\\\",\\n\"\n          + \"            \\\"locationType\\\": \\\"STORE\\\",\\n\"\n          + \"            \\\"locationId\\\": \\\"S001\\\",\\n\"\n          + \"            \\\"sellingChannel\\\": \\\"dotcom\\\",\\n\"\n          + \"            \\\"fulfillmentType\\\": \\\"SHIP\\\"\\n\"\n          + \"        },\\n\"\n          + \"        \\\"value\\\": {\\n\"\n          + \"            \\\"orgId\\\": \\\"ORG001\\\",\\n\"\n          + \"            \\\"productId\\\": \\\"1266009\\\",\\n\"\n          + \"            \\\"uom\\\": \\\"EACH\\\",\\n\"\n          + \"            \\\"locationType\\\": \\\"STORE\\\",\\n\"\n          + \"            \\\"locationId\\\": \\\"S001\\\",\\n\"\n          + \"            \\\"sellingChannel\\\": \\\"dotcom\\\",\\n\"\n          + \"            \\\"fulfillmentType\\\": \\\"SHIP\\\",\\n\"\n          + \"            \\\"enabled\\\": true,\\n\"\n          + \"            \\\"systemProcessingTime\\\": {\\n\"\n          + \"                \\\"min\\\": 2,\\n\"\n          + \"                \\\"max\\\": 5\\n\"\n          + \"            },\\n\"\n          + \"            \\\"transactionalSystemProcessingTime\\\": {\\n\"\n          + \"                \\\"additionalProp1\\\": {\\n\"\n          + \"                    \\\"min\\\": 2,\\n\"\n          + \"                    \\\"max\\\": 5\\n\"\n          + \"                },\\n\"\n          + \"                \\\"additionalProp2\\\": {\\n\"\n          + \"                    \\\"min\\\": 2,\\n\"\n          + \"                    \\\"max\\\": 5\\n\"\n          + \"                },\\n\"\n          + \"                \\\"additionalProp3\\\": {\\n\"\n          + \"                    \\\"min\\\": 2,\\n\"\n          + \"                    \\\"max\\\": 5\\n\"\n          + \"                }\\n\"\n          + \"            },\\n\"\n          + \"            \\\"locationProcessingTime\\\": {\\n\"\n          + \"                \\\"min\\\": 2,\\n\"\n          + \"                \\\"max\\\": 5\\n\"\n          + \"            },\\n\"\n          + \"            \\\"safetyStock\\\": 2,\\n\"\n          + \"            \\\"shelfLife\\\": 5,\\n\"\n          + \"            \\\"temporaryDisableExpirationTime\\\": \\\"2018-06-26T23:24:08.255Z\\\",\\n\"\n          + \"            \\\"updateUser\\\": \\\"THOR\\\",\\n\"\n          + \"            \\\"updateTime\\\": \\\"2018-06-21T00:00:00Z\\\"\\n\"\n          + \"        },\\n\"\n          + \"        \\\"operation\\\": \\\"CREATE\\\",\\n\"\n          + \"        \\\"isFullyQualifiedTopicName\\\": false\\n\"\n          + \"    }\\n\"\n          + \"]\";\n}\n"
  },
  {
    "path": "src/test/java/benchmarks/JsonPathSimpleMatchingBenchmark.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage benchmarks;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.openjdk.jmh.annotations.*;\nimport org.openjdk.jmh.runner.Runner;\nimport org.openjdk.jmh.runner.options.Options;\nimport org.openjdk.jmh.runner.options.OptionsBuilder;\n\n@BenchmarkMode(Mode.Throughput)\n@Warmup(iterations = 2)\n@Fork(1)\n@Measurement(iterations = 5)\npublic class JsonPathSimpleMatchingBenchmark {\n\n  public static final String[] TOPICS = {\n    \"topic-one\",\n    \"longer-topic-2\",\n    \"very-long-topic-3\",\n    \"four\",\n    \"five55555555\",\n    \"six\",\n    \"seven\",\n    \"eight\",\n    \"nine\",\n    \"ten\",\n    \"eleven\",\n    \"twelve\",\n    \"thirteen\",\n    \"fourteen\",\n    \"fifteen\",\n    \"sixteen\",\n    \"seventeen\",\n    \"eighteen\",\n    \"nineteen\",\n    \"twenty\"\n  };\n\n  @State(Scope.Benchmark)\n  public static class BenchmarkState {\n    private WireMockServer wm;\n    private WireMockTestClient client;\n\n    @Setup\n    public void setup() {\n      wm =\n          new WireMockServer(\n              wireMockConfig().dynamicPort().disableRequestJournal().containerThreads(100));\n      wm.start();\n      client = new WireMockTestClient(wm.port());\n\n      for (String topic : TOPICS) {\n        wm.stubFor(\n            post(\"/things\")\n                .withRequestBody(matchingJsonPath(\"$.[?(@.topic == '\" + topic + \"')]\"))\n                .willReturn(ok(topic)));\n      }\n    }\n\n    @TearDown\n    public void tearDown() {\n      wm.stop();\n    }\n  }\n\n  @Benchmark\n  @Threads(50)\n  public boolean matched(BenchmarkState state) {\n    final WireMockResponse response =\n        state.client.postJson(\"/things\", String.format(JSON_TEMPLATE, pickRandom(TOPICS)));\n    return response.content().equals(\"very-long-topic-3\");\n  }\n\n  private static String pickRandom(String[] values) {\n    return values[(int) (Math.random() * values.length)];\n  }\n\n  public static void main(String[] args) throws Exception {\n    Options opt =\n        new OptionsBuilder()\n            .include(JsonPathSimpleMatchingBenchmark.class.getSimpleName())\n            .warmupIterations(2)\n            .forks(1)\n            .measurementIterations(5)\n            .build();\n\n    new Runner(opt).run();\n  }\n\n  static final String JSON_TEMPLATE =\n      \"[\\n\"\n          + \"  {\\\"topic\\\": \\\"A\\\", \\\"name\\\": \\\"John Doe\\\", \\\"age\\\": 30, \\\"occupation\\\": \\\"Engineer\\\", \\\"city\\\": \\\"New York\\\", \\\"interests\\\": [\\\"hiking\\\", \\\"reading\\\", \\\"cooking\\\"], \\\"email\\\": \\\"john.doe@example.com\\\", \\\"phone\\\": \\\"+1234567890\\\", \\\"address\\\": \\\"123 Main St\\\", \\\"member_since\\\": \\\"2020-01-15\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"B\\\", \\\"name\\\": \\\"Alice Smith\\\", \\\"age\\\": 25, \\\"occupation\\\": \\\"Graphic Designer\\\", \\\"city\\\": \\\"Los Angeles\\\", \\\"interests\\\": [\\\"painting\\\", \\\"yoga\\\", \\\"traveling\\\"], \\\"email\\\": \\\"alice.smith@example.com\\\", \\\"phone\\\": \\\"+1987654321\\\", \\\"address\\\": \\\"456 Elm St\\\", \\\"member_since\\\": \\\"2018-07-20\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"C\\\", \\\"name\\\": \\\"Michael Johnson\\\", \\\"age\\\": 35, \\\"occupation\\\": \\\"Doctor\\\", \\\"city\\\": \\\"Chicago\\\", \\\"interests\\\": [\\\"running\\\", \\\"photography\\\", \\\"music\\\"], \\\"email\\\": \\\"michael.johnson@example.com\\\", \\\"phone\\\": \\\"+1122334455\\\", \\\"address\\\": \\\"789 Oak St\\\", \\\"member_since\\\": \\\"2016-03-10\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"D\\\", \\\"name\\\": \\\"Emily Brown\\\", \\\"age\\\": 28, \\\"occupation\\\": \\\"Teacher\\\", \\\"city\\\": \\\"Houston\\\", \\\"interests\\\": [\\\"gardening\\\", \\\"volunteering\\\", \\\"movies\\\"], \\\"email\\\": \\\"emily.brown@example.com\\\", \\\"phone\\\": \\\"+1443322110\\\", \\\"address\\\": \\\"101 Pine St\\\", \\\"member_since\\\": \\\"2019-11-05\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"E\\\", \\\"name\\\": \\\"Christopher Lee\\\", \\\"age\\\": 40, \\\"occupation\\\": \\\"Software Developer\\\", \\\"city\\\": \\\"San Francisco\\\", \\\"interests\\\": [\\\"coding\\\", \\\"gaming\\\", \\\"hiking\\\"], \\\"email\\\": \\\"chris.lee@example.com\\\", \\\"phone\\\": \\\"+1555099887\\\", \\\"address\\\": \\\"234 Maple St\\\", \\\"member_since\\\": \\\"2015-05-30\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"F\\\", \\\"name\\\": \\\"Jessica Taylor\\\", \\\"age\\\": 32, \\\"occupation\\\": \\\"Marketing Manager\\\", \\\"city\\\": \\\"Seattle\\\", \\\"interests\\\": [\\\"writing\\\", \\\"biking\\\", \\\"cooking\\\"], \\\"email\\\": \\\"jessica.taylor@example.com\\\", \\\"phone\\\": \\\"+1662777999\\\", \\\"address\\\": \\\"567 Cedar St\\\", \\\"member_since\\\": \\\"2017-09-12\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"G\\\", \\\"name\\\": \\\"Daniel Martinez\\\", \\\"age\\\": 45, \\\"occupation\\\": \\\"Architect\\\", \\\"city\\\": \\\"Miami\\\", \\\"interests\\\": [\\\"traveling\\\", \\\"drawing\\\", \\\"surfing\\\"], \\\"email\\\": \\\"daniel.martinez@example.com\\\", \\\"phone\\\": \\\"+1777555666\\\", \\\"address\\\": \\\"890 Walnut St\\\", \\\"member_since\\\": \\\"2014-02-25\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"H\\\", \\\"name\\\": \\\"Sarah Wilson\\\", \\\"age\\\": 27, \\\"occupation\\\": \\\"Journalist\\\", \\\"city\\\": \\\"Boston\\\", \\\"interests\\\": [\\\"reading\\\", \\\"running\\\", \\\"photography\\\"], \\\"email\\\": \\\"sarah.wilson@example.com\\\", \\\"phone\\\": \\\"+1888444333\\\", \\\"address\\\": \\\"123 Pineapple St\\\", \\\"member_since\\\": \\\"2021-02-18\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"%s\\\", \\\"name\\\": \\\"David Thompson\\\", \\\"age\\\": 33, \\\"occupation\\\": \\\"Financial Analyst\\\", \\\"city\\\": \\\"Atlanta\\\", \\\"interests\\\": [\\\"investing\\\", \\\"basketball\\\", \\\"traveling\\\"], \\\"email\\\": \\\"david.thompson@example.com\\\", \\\"phone\\\": \\\"+1999777666\\\", \\\"address\\\": \\\"456 Peach St\\\", \\\"member_since\\\": \\\"2013-08-09\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"J\\\", \\\"name\\\": \\\"Rachel Garcia\\\", \\\"age\\\": 29, \\\"occupation\\\": \\\"Nurse\\\", \\\"city\\\": \\\"Dallas\\\", \\\"interests\\\": [\\\"painting\\\", \\\"yoga\\\", \\\"movies\\\"], \\\"email\\\": \\\"rachel.garcia@example.com\\\", \\\"phone\\\": \\\"+1444999888\\\", \\\"address\\\": \\\"789 Orange St\\\", \\\"member_since\\\": \\\"2019-04-27\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"K\\\", \\\"name\\\": \\\"Kevin Nguyen\\\", \\\"age\\\": 31, \\\"occupation\\\": \\\"Entrepreneur\\\", \\\"city\\\": \\\"Austin\\\", \\\"interests\\\": [\\\"coding\\\", \\\"startups\\\", \\\"traveling\\\"], \\\"email\\\": \\\"kevin.nguyen@example.com\\\", \\\"phone\\\": \\\"+1222333444\\\", \\\"address\\\": \\\"101 Lemon St\\\", \\\"member_since\\\": \\\"2016-11-14\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"L\\\", \\\"name\\\": \\\"Rebecca Kim\\\", \\\"age\\\": 26, \\\"occupation\\\": \\\"Graphic Designer\\\", \\\"city\\\": \\\"Denver\\\", \\\"interests\\\": [\\\"hiking\\\", \\\"photography\\\", \\\"music\\\"], \\\"email\\\": \\\"rebecca.kim@example.com\\\", \\\"phone\\\": \\\"+1666888999\\\", \\\"address\\\": \\\"234 Berry St\\\", \\\"member_since\\\": \\\"2020-08-03\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"M\\\", \\\"name\\\": \\\"Mark Hernandez\\\", \\\"age\\\": 38, \\\"occupation\\\": \\\"Lawyer\\\", \\\"city\\\": \\\"Phoenix\\\", \\\"interests\\\": [\\\"reading\\\", \\\"tennis\\\", \\\"cooking\\\"], \\\"email\\\": \\\"mark.hernandez@example.com\\\", \\\"phone\\\": \\\"+1777666555\\\", \\\"address\\\": \\\"567 Grape St\\\", \\\"member_since\\\": \\\"2015-12-21\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"N\\\", \\\"name\\\": \\\"Jennifer White\\\", \\\"age\\\": 34, \\\"occupation\\\": \\\"HR Manager\\\", \\\"city\\\": \\\"Philadelphia\\\", \\\"interests\\\": [\\\"painting\\\", \\\"running\\\", \\\"movies\\\"], \\\"email\\\": \\\"jennifer.white@example.com\\\", \\\"phone\\\": \\\"+1444333222\\\", \\\"address\\\": \\\"890 Cherry St\\\", \\\"member_since\\\": \\\"2017-06-08\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"O\\\", \\\"name\\\": \\\"Andrew Brown\\\", \\\"age\\\": 37, \\\"occupation\\\": \\\"Sales Manager\\\", \\\"city\\\": \\\"San Diego\\\", \\\"interests\\\": [\\\"golfing\\\", \\\"traveling\\\", \\\"cooking\\\"], \\\"email\\\": \\\"andrew.brown@example.com\\\", \\\"phone\\\": \\\"+1555888777\\\", \\\"address\\\": \\\"123 Plum St\\\", \\\"member_since\\\": \\\"2016-01-30\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"P\\\", \\\"name\\\": \\\"Lauren Rodriguez\\\", \\\"age\\\": 29, \\\"occupation\\\": \\\"Teacher\\\", \\\"city\\\": \\\"Orlando\\\", \\\"interests\\\": [\\\"writing\\\", \\\"yoga\\\", \\\"movies\\\"], \\\"email\\\": \\\"lauren.rodriguez@example.com\\\", \\\"phone\\\": \\\"+1666999888\\\", \\\"address\\\": \\\"456 Pine St\\\", \\\"member_since\\\": \\\"2018-10-17\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"Q\\\", \\\"name\\\": \\\"Jonathan Kim\\\", \\\"age\\\": 42, \\\"occupation\\\": \\\"Doctor\\\", \\\"city\\\": \\\"Portland\\\", \\\"interests\\\": [\\\"hiking\\\", \\\"painting\\\", \\\"music\\\"], \\\"email\\\": \\\"jonathan.kim@example.com\\\", \\\"phone\\\": \\\"+1222777666\\\", \\\"address\\\": \\\"789 Olive St\\\", \\\"member_since\\\": \\\"2014-05-12\\\"},\\n\"\n          + \"  {\\\"topic\\\": \\\"R\\\", \\\"name\\\": \\\"Michelle Garcia\\\", \\\"age\\\": 30, \\\"occupation\\\": \\\"Software Engineer\\\", \\\"city\\\": \\\"San Antonio\\\", \\\"interests\\\": [\\\"coding\\\", \\\"gaming\\\", \\\"traveling\\\"], \\\"email\\\": \\\"michelle.garcia@example.com\\\", \\\"phone\\\": \\\"+1333444555\\\", \\\"address\\\": \\\"890 Walnut St\\\", \\\"member_since\\\": \\\"2019-02-14\\\"}\\n\"\n          + \"]\\n\";\n}\n"
  },
  {
    "path": "src/test/java/benchmarks/PathAndMethodMatchingBenchmark.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage benchmarks;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static java.util.stream.Collectors.toUnmodifiableList;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Stream;\nimport org.openjdk.jmh.annotations.*;\n\n@BenchmarkMode(Mode.Throughput)\n@Warmup(iterations = 2)\n@Fork(1)\n@Measurement(iterations = 5)\npublic class PathAndMethodMatchingBenchmark {\n\n  static final List<String> IDS =\n      Stream.iterate((String) null, ignored -> UUID.randomUUID().toString())\n          .filter(Objects::nonNull)\n          .limit(1000)\n          .collect(toUnmodifiableList());\n\n  @State(Scope.Benchmark)\n  public static class PathAndMethodBenchmarkState {\n    private WireMockServer wm;\n    private WireMockTestClient client;\n\n    @Setup\n    public void setup() {\n      wm =\n          new WireMockServer(\n              wireMockConfig().dynamicPort().disableRequestJournal().containerThreads(100));\n      wm.start();\n      client = new WireMockTestClient(wm.port());\n\n      for (String id : IDS) {\n        wm.stubFor(get(\"/things/\" + id).willReturn(ok(\"GET \" + id)));\n        wm.stubFor(post(\"/things/\" + id).willReturn(ok(\"POST \" + id)));\n      }\n    }\n\n    @TearDown\n    public void tearDown() {\n      wm.stop();\n    }\n  }\n\n  @Benchmark\n  @Threads(50)\n  public boolean matched(PathAndMethodBenchmarkState state) {\n    final String id = pickRandom(IDS);\n    String get = state.client.get(\"/things/\" + id).content();\n    String post = state.client.postJson(\"/things/\" + id, \"{}\").content();\n    return get.equals(\"GET \" + id) && post.equals(\"POST \" + id);\n  }\n\n  private static String pickRandom(List<String> values) {\n    return values.get((int) (Math.random() * values.size()));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/AcceptanceTestBase.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.FILES_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MAPPINGS_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_ANY_METHOD;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_DELETE;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_GET;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_HEAD;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_OPTIONS;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_PATCH;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_POST;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_PUT;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_QUERY;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BASIC_TRACE;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.defaultTestFilesRoot;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.filePath;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.junit.Stubbing;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.util.Locale;\nimport java.util.Optional;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.AfterAll;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.params.provider.Arguments;\n\npublic class AcceptanceTestBase {\n\n  protected static WireMockServer wireMockServer;\n  protected static WireMockTestClient testClient;\n\n  protected static Stubbing wm;\n\n  @BeforeAll\n  public static void setupServer() {\n    setupServerWithEmptyFileRoot();\n\n    // We assert English XML parser error messages in some tests. So we set our default locale to\n    // English to make\n    // those tests succeed even for users with non-English default locales.\n    Locale.setDefault(Locale.ENGLISH);\n  }\n\n  @AfterAll\n  public static void serverShutdown() {\n    wireMockServer.stop();\n  }\n\n  public static void setupServerWithEmptyFileRoot() {\n    setupServer(wireMockConfig().withRootDirectory(filePath(\"empty\")));\n  }\n\n  public static File setupServerWithTempFileRoot() {\n    File tempFileRoot = setupTempFileRoot();\n    setupServer(wireMockConfig().withRootDirectory(tempFileRoot.getAbsolutePath()));\n    return tempFileRoot;\n  }\n\n  public static File setupTempFileRoot() {\n    try {\n      File root = Files.createTempDirectory(\"wiremock\").toFile();\n      new File(root, MAPPINGS_ROOT).mkdirs();\n      new File(root, FILES_ROOT).mkdirs();\n      return root;\n    } catch (IOException e) {\n      return throwUnchecked(e, File.class);\n    }\n  }\n\n  public static void setupServerWithMappingsInFileRoot() {\n    setupServer(wireMockConfig().withRootDirectory(defaultTestFilesRoot()));\n  }\n\n  public static void setupServer(WireMockConfiguration options) {\n    System.out.println(\n        \"Configuring WireMockServer with root directory: \" + options.filesRoot().getPath());\n\n    // SERVER_PORT + CLIENT PORT are here to support routing through an external proxy for e.g.\n    // validation\n    final String serverPort = System.getenv(\"SERVER_PORT\");\n    if (serverPort != null) {\n      options.port(Integer.parseInt(serverPort));\n    } else if (options.portNumber() == Options.DEFAULT_PORT) {\n      options.dynamicPort();\n    }\n\n    wireMockServer = new WireMockServer(options);\n    wireMockServer.start();\n    testClient = new WireMockTestClient(wireMockServer.port());\n\n    int clientPort =\n        Optional.ofNullable(System.getenv(\"CLIENT_PORT\"))\n            .map(Integer::parseInt)\n            .orElse(wireMockServer.port());\n\n    WireMock wireMockClient = new WireMock(clientPort);\n    WireMock.configureFor(wireMockClient);\n    wm = wireMockServer;\n  }\n\n  @BeforeEach\n  public void init() throws InterruptedException {\n    WireMock.resetToDefault();\n  }\n\n  public static Stream<Arguments> provideStubMappingJson() {\n    return Stream.of(\n        Arguments.of(BASIC_GET),\n        Arguments.of(BASIC_POST),\n        Arguments.of(BASIC_PUT),\n        Arguments.of(BASIC_DELETE),\n        Arguments.of(BASIC_PATCH),\n        Arguments.of(BASIC_HEAD),\n        Arguments.of(BASIC_OPTIONS),\n        Arguments.of(BASIC_TRACE),\n        Arguments.of(BASIC_ANY_METHOD),\n        Arguments.of(BASIC_QUERY));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/AdminApiTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.FILES_ROOT;\nimport static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalsMultiLine;\nimport static java.util.Arrays.asList;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonPartEquals;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonPartMatches;\nimport static org.awaitility.Awaitility.await;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.hamcrest.Matchers.not;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\n\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.UniformDistribution;\nimport com.github.tomakehurst.wiremock.junit.Stubbing;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.TestHttpHeader;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.toomuchcoding.jsonassert.JsonAssertion;\nimport com.toomuchcoding.jsonassert.JsonVerifiable;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.time.Duration;\nimport java.time.Instant;\nimport java.time.ZoneId;\nimport java.time.format.DateTimeFormatter;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.Matchers;\nimport org.hamcrest.TypeSafeMatcher;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.MethodSource;\nimport org.skyscreamer.jsonassert.JSONAssert;\n\nclass AdminApiTest extends AcceptanceTestBase {\n\n  static Stubbing dsl = wireMockServer;\n\n  @AfterEach\n  public void tearDown() throws Exception {\n    deleteAllBodyFiles();\n  }\n\n  private void deleteAllBodyFiles() throws IOException {\n    FileSource filesRoot = wireMockServer.getOptions().filesRoot().child(FILES_ROOT);\n    if (filesRoot.exists()) {\n      List<TextFile> textFiles = filesRoot.listFilesRecursively();\n      for (TextFile textFile : textFiles) {\n        Files.delete(Paths.get(textFile.getPath()));\n      }\n    }\n  }\n\n  @Test\n  void getAllStubMappings() throws Exception {\n    StubMapping stubMapping =\n        dsl.stubFor(get(urlEqualTo(\"/my-test-url\")).willReturn(aResponse().withStatus(418)));\n\n    String body = testClient.get(\"/__admin/mappings\").content();\n\n    JSONAssert.assertEquals(\n        \"{                                              \\n\"\n            + \"  \\\"mappings\\\" : [ {                           \\n\"\n            + \"    \\\"id\\\" : \\\"\"\n            + stubMapping.getId()\n            + \"\\\",\\n\"\n            + \"    \\\"request\\\" : {                            \\n\"\n            + \"      \\\"url\\\" : \\\"/my-test-url\\\",              \\n\"\n            + \"      \\\"method\\\" : \\\"GET\\\"                     \\n\"\n            + \"    },                                         \\n\"\n            + \"    \\\"response\\\" : {                           \\n\"\n            + \"      \\\"status\\\" : 418                         \\n\"\n            + \"    }                                          \\n\"\n            + \"  } ],                                         \\n\"\n            + \"                                               \\n\"\n            + \"  \\\"meta\\\": {                                  \\n\"\n            + \"    \\\"total\\\": 1                               \\n\"\n            + \"  }                                            \\n\"\n            + \"}\",\n        body,\n        true);\n  }\n\n  @Test\n  void getAllStubMappingsWithLimitedResults() {\n    for (int i = 1; i <= 20; i++) {\n      dsl.stubFor(get(urlEqualTo(\"/things/\" + i)).willReturn(aResponse().withStatus(418)));\n    }\n\n    String allBody = testClient.get(\"/__admin/mappings\").content();\n    String limitedBody = testClient.get(\"/__admin/mappings?limit=7\").content();\n\n    JsonAssertion.assertThat(allBody).field(\"mappings\").array().hasSize(20);\n    JsonAssertion.assertThat(limitedBody).field(\"mappings\").array().hasSize(7);\n  }\n\n  @Test\n  void getAllStubMappingsWithLimitedAndOffsetResults() {\n    for (int i = 1; i <= 20; i++) {\n      dsl.stubFor(get(urlEqualTo(\"/things/\" + i)).willReturn(aResponse().withStatus(418)));\n    }\n\n    String limitedBody = testClient.get(\"/__admin/mappings?limit=4&offset=3\").content();\n\n    JsonAssertion.assertThat(limitedBody).field(\"mappings\").array().hasSize(4);\n    JsonAssertion.assertThat(limitedBody)\n        .field(\"mappings\")\n        .elementWithIndex(0)\n        .field(\"request\")\n        .field(\"url\")\n        .isEqualTo(\"/things/17\");\n    JsonAssertion.assertThat(limitedBody)\n        .field(\"mappings\")\n        .elementWithIndex(3)\n        .field(\"request\")\n        .field(\"url\")\n        .isEqualTo(\"/things/14\");\n  }\n\n  @Test\n  void deprecatedGetAllStubMappings() throws Exception {\n    dsl.stubFor(get(urlEqualTo(\"/my-test-url\")).willReturn(aResponse().withStatus(418)));\n\n    String body = testClient.get(\"/__admin/\").content();\n    System.out.println(body);\n    JSONAssert.assertEquals(\n        \"{\\n\"\n            + \"  \\\"mappings\\\" : [ {\\n\"\n            + \"    \\\"request\\\" : {\\n\"\n            + \"      \\\"url\\\" : \\\"/my-test-url\\\",\\n\"\n            + \"      \\\"method\\\" : \\\"GET\\\"\\n\"\n            + \"    },\\n\"\n            + \"    \\\"response\\\" : {\\n\"\n            + \"      \\\"status\\\" : 418\\n\"\n            + \"    }\\n\"\n            + \"  } ]\\n\"\n            + \"}\",\n        body,\n        false);\n  }\n\n  @Test\n  void getStubMappingById() throws Exception {\n    UUID id = UUID.randomUUID();\n\n    dsl.stubFor(\n        trace(urlEqualTo(\"/my-addressable-stub\"))\n            .withId(id)\n            .willReturn(aResponse().withStatus(451)));\n\n    String body = testClient.get(\"/__admin/mappings/\" + id).content();\n\n    JSONAssert.assertEquals(\n        \"{                                          \\n\"\n            + \"    \\\"id\\\": \\\"\"\n            + id\n            + \"\\\",              \\n\"\n            + \"    \\\"request\\\" : {                        \\n\"\n            + \"      \\\"url\\\" : \\\"/my-addressable-stub\\\",  \\n\"\n            + \"      \\\"method\\\" : \\\"TRACE\\\"               \\n\"\n            + \"    },                                     \\n\"\n            + \"    \\\"response\\\" : {                       \\n\"\n            + \"      \\\"status\\\" : 451                     \\n\"\n            + \"    }                                      \\n\"\n            + \"}\",\n        body,\n        true);\n  }\n\n  @Test\n  void getLoggedRequests() {\n    dsl.stubFor(get(urlPathEqualTo(\"/received-request/4\")).willReturn(aResponse()));\n\n    for (int i = 1; i <= 5; i++) {\n      testClient.get(\"/received-request/\" + i);\n    }\n\n    String body = testClient.get(\"/__admin/requests\").content();\n\n    System.out.println(body);\n    JsonVerifiable check = JsonAssertion.assertThat(body);\n    check.field(\"meta\").field(\"total\").isEqualTo(5);\n    check\n        .field(\"requests\")\n        .elementWithIndex(2)\n        .field(\"request\")\n        .field(\"url\")\n        .isEqualTo(\"/received-request/3\");\n    check.field(\"requests\").hasSize(5);\n    check.field(\"requests\").elementWithIndex(1).field(\"wasMatched\").isEqualTo(true);\n    check.field(\"requests\").elementWithIndex(3).field(\"wasMatched\").isEqualTo(false);\n  }\n\n  @Test\n  void getLoggedRequestsWithLimit() {\n    dsl.stubFor(\n        get(urlPathEqualTo(\"/received-request/7\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"This was matched\")));\n\n    for (int i = 1; i <= 7; i++) {\n      testClient.get(\"/received-request/\" + i);\n    }\n\n    String body = testClient.get(\"/__admin/requests?limit=2\").content();\n\n    JsonVerifiable check = JsonAssertion.assertThat(body);\n    check.field(\"meta\").field(\"total\").isEqualTo(7);\n    check\n        .field(\"requests\")\n        .elementWithIndex(0)\n        .field(\"request\")\n        .field(\"url\")\n        .isEqualTo(\"/received-request/7\");\n    check\n        .field(\"requests\")\n        .elementWithIndex(1)\n        .field(\"request\")\n        .field(\"url\")\n        .isEqualTo(\"/received-request/6\");\n    check.field(\"requests\").hasSize(2);\n  }\n\n  @Test\n  void getLoggedRequestsWithLimitAndSinceDate() {\n    for (int i = 1; i <= 5; i++) {\n      testClient.get(\"/received-request/\" + i);\n    }\n\n    String midPoint =\n        DateTimeFormatter.ISO_ZONED_DATE_TIME.format(Instant.now().atZone(ZoneId.of(\"Z\")));\n\n    await().between(Duration.ofMillis(100), Duration.ofMillis(300));\n\n    for (int i = 6; i <= 9; i++) {\n      testClient.get(\"/received-request/\" + i);\n    }\n\n    String body = testClient.get(\"/__admin/requests?since=\" + midPoint + \"&limit=3\").content();\n\n    JsonVerifiable check = JsonAssertion.assertThat(body);\n    check.field(\"meta\").field(\"total\").isEqualTo(9);\n    check.field(\"requests\").hasSize(3);\n    check\n        .field(\"requests\")\n        .elementWithIndex(0)\n        .field(\"request\")\n        .field(\"url\")\n        .isEqualTo(\"/received-request/9\");\n    check\n        .field(\"requests\")\n        .elementWithIndex(2)\n        .field(\"request\")\n        .field(\"url\")\n        .isEqualTo(\"/received-request/7\");\n  }\n\n  @Test\n  void getLoggedRequestsWithInvalidSinceDateReturnsBadRequest() {\n    WireMockResponse response = testClient.get(\"/__admin/requests?since=foo\");\n\n    assertThat(response.statusCode(), is(400));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/json\"));\n    JsonVerifiable check = JsonAssertion.assertThat(response.content());\n    JsonVerifiable error = check.field(\"errors\").elementWithIndex(0);\n    error.field(\"code\").isEqualTo(10);\n    error.field(\"source\").field(\"pointer\").isEqualTo(\"since\");\n    error.field(\"title\").isEqualTo(\"foo is not a valid ISO8601 date\");\n  }\n\n  @Test\n  void getLoggedRequestsWithLimitLargerThanResults() {\n    for (int i = 1; i <= 3; i++) {\n      testClient.get(\"/received-request/\" + i);\n    }\n\n    String body = testClient.get(\"/__admin/requests?limit=3000\").content();\n\n    JsonVerifiable check = JsonAssertion.assertThat(body);\n    check.field(\"meta\").field(\"total\").isEqualTo(3);\n    check.field(\"requests\").hasSize(3);\n  }\n\n  @Test\n  void getLoggedRequestById() {\n    for (int i = 1; i <= 3; i++) {\n      testClient.get(\"/received-request/\" + i);\n    }\n\n    List<ServeEvent> serveEvents = dsl.getAllServeEvents();\n    UUID servedStubId = serveEvents.get(1).getId();\n\n    WireMockResponse response = testClient.get(\"/__admin/requests/\" + servedStubId);\n    String body = response.content();\n    System.out.println(\"BODY:\" + body);\n\n    assertThat(response.statusCode(), is(200));\n    JsonVerifiable check = JsonAssertion.assertThat(body);\n    check.field(\"id\").isEqualTo(servedStubId);\n    check.field(\"request\").field(\"url\").isEqualTo(\"/received-request/2\");\n  }\n\n  @Test\n  void deleteStubMappingById() {\n    StubMapping stubMapping =\n        dsl.stubFor(get(urlPathEqualTo(\"/delete/this\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(testClient.get(\"/delete/this\").statusCode(), is(200));\n\n    WireMockResponse response = testClient.delete(\"/__admin/mappings/\" + stubMapping.getId());\n\n    assertThat(response.content(), is(\"{}\"));\n    assertThat(testClient.get(\"/delete/this\").statusCode(), is(404));\n  }\n\n  @Test\n  void returns404WhenAttemptingToDeleteNonExistentStubMapping() {\n    assertThat(testClient.delete(\"/__admin/mappings/\" + UUID.randomUUID()).statusCode(), is(404));\n  }\n\n  @Test\n  void editStubMappingById() throws Exception {\n    StubMapping stubMapping =\n        dsl.stubFor(get(urlPathEqualTo(\"/put/this\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(testClient.get(\"/put/this\").statusCode(), is(200));\n\n    String requestBody =\n        \"{                                  \\n\"\n            + \"    \\\"request\\\": {                 \\n\"\n            + \"        \\\"method\\\": \\\"GET\\\",       \\n\"\n            + \"        \\\"url\\\": \\\"/put/this\\\"     \\n\"\n            + \"    },                             \\n\"\n            + \"    \\\"response\\\": {                \\n\"\n            + \"        \\\"status\\\": 418            \\n\"\n            + \"    }                              \\n\"\n            + \"}\";\n\n    WireMockResponse response =\n        testClient.putWithBody(\n            \"/__admin/mappings/\" + stubMapping.getId(), requestBody, \"application/json\");\n\n    JSONAssert.assertEquals(requestBody, response.content(), false);\n    assertThat(testClient.get(\"/put/this\").statusCode(), is(418));\n  }\n\n  @Test\n  void returns404WhenAttemptingToEditNonExistentStubMapping() {\n    assertThat(\n        testClient\n            .putWithBody(\"/__admin/mappings/\" + UUID.randomUUID(), \"{}\", \"application/json\")\n            .statusCode(),\n        is(404));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"provideStubMappingJson\")\n  void createStubMappingReturnsTheCreatedMapping(String stubJson) {\n    WireMockResponse response = testClient.postJson(\"/__admin/mappings\", stubJson);\n\n    assertThat(response.statusCode(), is(201));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/json\"));\n    String body = response.content();\n    JsonAssertion.assertThat(body).field(\"id\").matches(\"[a-z0-9\\\\-]{36}\");\n    JsonAssertion.assertThat(body).field(\"name\").isEqualTo(\"Basic Resource\");\n  }\n\n  @Test\n  void resetStubMappingsViaDELETE() {\n    dsl.stubFor(get(urlEqualTo(\"/reset-this\")).willReturn(aResponse().withStatus(200)));\n    dsl.stubFor(get(urlEqualTo(\"/reset-this/too\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(testClient.get(\"/reset-this\").statusCode(), is(200));\n    assertThat(testClient.get(\"/reset-this/too\").statusCode(), is(200));\n\n    WireMockResponse response = testClient.delete(\"/__admin/mappings\");\n\n    assertThat(response.content(), is(\"{}\"));\n    assertThat(testClient.get(\"/reset-this\").statusCode(), is(404));\n    assertThat(testClient.get(\"/reset-this/too\").statusCode(), is(404));\n  }\n\n  @Test\n  void resetRequestJournalViaDELETE() {\n    testClient.get(\"/one\");\n    testClient.get(\"/two\");\n    testClient.get(\"/three\");\n\n    assertThat(dsl.getAllServeEvents().size(), is(3));\n\n    WireMockResponse response = testClient.delete(\"/__admin/requests\");\n\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/json\"));\n    assertThat(response.content(), is(\"{}\"));\n    assertThat(response.statusCode(), is(200));\n    assertThat(dsl.getAllServeEvents().size(), is(0));\n  }\n\n  @Test\n  void resetScenariosViaPOST() {\n    dsl.stubFor(\n        get(urlEqualTo(\"/stateful\"))\n            .inScenario(\"changing-states\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"final\")\n            .willReturn(aResponse().withBody(\"Initial\")));\n\n    dsl.stubFor(\n        get(urlEqualTo(\"/stateful\"))\n            .inScenario(\"changing-states\")\n            .whenScenarioStateIs(\"final\")\n            .willReturn(aResponse().withBody(\"Final\")));\n\n    assertThat(testClient.get(\"/stateful\").content(), is(\"Initial\"));\n    assertThat(testClient.get(\"/stateful\").content(), is(\"Final\"));\n\n    WireMockResponse response = testClient.post(\"/__admin/scenarios/reset\");\n\n    assertThat(response.content(), is(\"{}\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/json\"));\n    assertThat(testClient.get(\"/stateful\").content(), is(\"Initial\"));\n  }\n\n  @Test\n  void getScenarios() {\n    dsl.stubFor(\n        get(\"/one\")\n            .inScenario(\"my-scenario\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"2\")\n            .willReturn(ok(\"started\")));\n\n    dsl.stubFor(\n        get(\"/one\")\n            .inScenario(\"my-scenario\")\n            .whenScenarioStateIs(\"2\")\n            .willSetStateTo(\"3\")\n            .willReturn(ok(\"2\")));\n    stubFor(get(\"/one\").inScenario(\"my-scenario\").whenScenarioStateIs(\"3\").willReturn(ok(\"3\")));\n\n    testClient.get(\"/one\");\n\n    String body = testClient.get(\"/__admin/scenarios\").content();\n    assertThat(body, jsonPartEquals(\"scenarios[0].id\", \"my-scenario\"));\n    assertThat(body, jsonPartEquals(\"scenarios[0].name\", \"my-scenario\"));\n    assertThat(body, jsonPartEquals(\"scenarios[0].state\", \"\\\"2\\\"\"));\n    assertThat(body, jsonPartEquals(\"scenarios[0].possibleStates\", asList(\"Started\", \"2\", \"3\")));\n    assertThat(body, jsonPartEquals(\"scenarios[0].mappings[0].request.url\", \"/one\"));\n  }\n\n  @Test\n  void returnsNotFoundWhenAttemptingToResetNonExistentScenario() {\n    WireMockResponse response = testClient.put(\"/__admin/scenarios/i-dont-exist/state\");\n    assertThat(response.statusCode(), is(404));\n    assertThat(\n        response.content(),\n        jsonPartEquals(\"errors[0].title\", \"Scenario i-dont-exist does not exist\"));\n  }\n\n  @Test\n  void returnsNotFoundWhenAttemptingToSetNonExistentScenarioState() {\n    WireMockResponse response =\n        testClient.putWithBody(\n            \"/__admin/scenarios/i-dont-exist/state\",\n            \"{\\\"state\\\":\\\"newstate\\\"}\",\n            \"application/json\");\n    assertThat(response.statusCode(), is(404));\n    assertThat(\n        response.content(),\n        jsonPartEquals(\"errors[0].title\", \"Scenario i-dont-exist does not exist\"));\n  }\n\n  @Test\n  void returnsBadEntityWhenAttemptingToSetNonExistentScenarioState() {\n    dsl.stubFor(\n        get(\"/one\")\n            .inScenario(\"my-scenario\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"2\")\n            .willReturn(ok(\"started\")));\n\n    dsl.stubFor(\n        get(\"/one\")\n            .inScenario(\"my-scenario\")\n            .whenScenarioStateIs(\"2\")\n            .willSetStateTo(STARTED)\n            .willReturn(ok(\"2\")));\n\n    WireMockResponse response =\n        testClient.putWithBody(\n            \"/__admin/scenarios/my-scenario/state\",\n            \"{\\\"state\\\":\\\"non-existent-state\\\"}\",\n            \"application/json\");\n\n    assertThat(response.statusCode(), is(422));\n    assertThat(\n        response.content(),\n        jsonPartEquals(\n            \"errors[0].title\", \"Scenario my-scenario does not support state non-existent-state\"));\n  }\n\n  @Test\n  void defaultsUnspecifiedStubMappingAttributes() {\n    WireMockResponse response = testClient.postJson(\"/__admin/mappings\", \"{}\");\n\n    assertThat(response.statusCode(), is(201));\n\n    String body = response.content();\n    JsonAssertion.assertThat(body).field(\"request\").field(\"method\").isEqualTo(\"ANY\");\n    JsonAssertion.assertThat(body).field(\"response\").field(\"status\").isEqualTo(200);\n\n    assertThat(testClient.get(\"/\").statusCode(), is(200));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenInvalidRegexUsedInUrl() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{                                      \\n\"\n                + \"    \\\"request\\\": {                            \\n\"\n                + \"        \\\"urlPattern\\\": \\\"/@$&%*[[^^£$&%\\\"    \\n\"\n                + \"    }                                         \\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(\n        errors.first().getDetail(),\n        equalsMultiLine(\n            \"Unclosed character class near index 13\\n\" + \"/@$&%*[[^^£$&%\\n\" + \"             ^\"));\n    assertThat(errors.first().getSource().getPointer(), is(\"/request\"));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenInvalidRegexUsedInHeader() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"headers\\\": {\\n\"\n                + \"            \\\"Accept\\\": {\\n\"\n                + \"                \\\"matches\\\": \\\"%[[json[[\\\"\\n\"\n                + \"            }\\n\"\n                + \"        }\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(\n        errors.first().getDetail(),\n        equalsMultiLine(\"Unclosed character class near index 8\\n\" + \"%[[json[[\\n\" + \"        ^\"));\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/headers/Accept\"));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenInvalidRegexUsedInBodyPattern() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"bodyPatterns\\\": [\\n\"\n                + \"            {\\n\"\n                + \"                \\\"equalTo\\\": \\\"fine\\\"\\n\"\n                + \"            },\\n\"\n                + \"            {\\n\"\n                + \"                \\\"matches\\\": \\\"somebad]]][[stuff\\\"\\n\"\n                + \"            }\\n\"\n                + \"        ]\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/bodyPatterns/1\"));\n    assertThat(errors.first().getTitle(), is(\"Error parsing JSON\"));\n    assertThat(\n        errors.first().getDetail(),\n        equalsMultiLine(\n            \"Unclosed character class near index 16\\n\"\n                + \"somebad]]][[stuff\\n\"\n                + \"                ^\"));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenInvalidMatchOperator() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"bodyPatterns\\\": [\\n\"\n                + \"            {\\n\"\n                + \"                \\\"matching\\\": \\\"somebad]]][[stuff\\\"\\n\"\n                + \"            }\\n\"\n                + \"        ]\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/bodyPatterns/0\"));\n    assertThat(\n        errors.first().getDetail(),\n        is(\"{\\\"matching\\\":\\\"somebad]]][[stuff\\\"} is not a valid match operation\"));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenInvalidMatchOperatorManyBodyPatterns() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"bodyPatterns\\\": [\\n\"\n                + \"            {\\n\"\n                + \"                \\\"equalTo\\\": \\\"fine\\\"\\n\"\n                + \"            },\\n\"\n                + \"            {\\n\"\n                + \"                \\\"matching\\\": \\\"somebad]]][[stuff\\\"\\n\"\n                + \"            }\\n\"\n                + \"        ]\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/bodyPatterns/1\"));\n    assertThat(\n        errors.first().getDetail(),\n        is(\"{\\\"matching\\\":\\\"somebad]]][[stuff\\\"} is not a valid match operation\"));\n  }\n\n  @Test\n  void returnsBadEntityStatusOnEqualToJsonOperand() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"bodyPatterns\\\": [\\n\"\n                + \"            {\\n\"\n                + \"                \\\"equalToJson\\\": \\\"(wrong)\\\"\\n\"\n                + \"            }\\n\"\n                + \"        ]\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/bodyPatterns/0\"));\n    assertThat(\n        errors.first().getDetail(),\n        allOf(\n            containsString(\n                \"Unexpected character ('(' (code 40)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\"),\n            containsString(\"line: 1, column: 1\")));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenInvalidEqualToXmlSpecified() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"bodyPatterns\\\": [\\n\"\n                + \"            {\\n\"\n                + \"                \\\"equalToXml\\\": \\\"(wrong)\\\"\\n\"\n                + \"            }\\n\"\n                + \"        ]\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/bodyPatterns/0\"));\n    assertThat(errors.first().getTitle(), is(\"Error parsing JSON\"));\n    assertThat(\n        errors.first().getDetail(), is(\"Content is not allowed in prolog.; line 1; column 1\"));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenContainsOperandIsNull() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"bodyPatterns\\\": [\\n\"\n                + \"            {\\n\"\n                + \"                \\\"contains\\\": null\\n\"\n                + \"            }\\n\"\n                + \"        ]\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/bodyPatterns/0\"));\n    assertThat(errors.first().getTitle(), is(\"Error parsing JSON\"));\n    assertThat(errors.first().getDetail(), is(\"contains operand must be a non-null string\"));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenEqualToOperandIsWrongType() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"bodyPatterns\\\": [\\n\"\n                + \"            {\\n\"\n                + \"                \\\"equalTo\\\": 12\\n\"\n                + \"            }\\n\"\n                + \"        ]\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/bodyPatterns/0\"));\n    assertThat(errors.first().getTitle(), is(\"Error parsing JSON\"));\n    assertThat(errors.first().getDetail(), is(\"equalTo operand must be a non-null string\"));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenContainsOperandIsWrongType() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"bodyPatterns\\\": [\\n\"\n                + \"            {\\n\"\n                + \"                \\\"contains\\\": 12\\n\"\n                + \"            }\\n\"\n                + \"        ]\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/bodyPatterns/0\"));\n    assertThat(errors.first().getTitle(), is(\"Error parsing JSON\"));\n    assertThat(errors.first().getDetail(), is(\"contains operand must be a non-null string\"));\n  }\n\n  @Test\n  void returnsBadEntityStatusWhenMatchesOperandIsWrongType() {\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"bodyPatterns\\\": [\\n\"\n                + \"            {\\n\"\n                + \"                \\\"matches\\\": 12\\n\"\n                + \"            }\\n\"\n                + \"        ]\\n\"\n                + \"    }\\n\"\n                + \"}\");\n\n    assertThat(response.statusCode(), is(422));\n\n    Errors errors = Json.read(response.content(), Errors.class);\n    assertThat(errors.first().getSource().getPointer(), is(\"/request/bodyPatterns/0\"));\n    assertThat(errors.first().getTitle(), is(\"Error parsing JSON\"));\n    assertThat(errors.first().getDetail(), is(\"matches operand must be a non-null string\"));\n  }\n\n  @Test\n  void servesSwaggerSpec() {\n    WireMockResponse response = testClient.get(\"/__admin/docs/swagger\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), containsString(\"\\\"openapi\\\": \\\"3.0.0\\\"\"));\n  }\n\n  @Test\n  void servesSwaggerUiHtml() {\n    WireMockResponse response = testClient.get(\"/__admin/swagger-ui/\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void servesDocIndex() {\n    WireMockResponse response = testClient.get(\"/__admin/docs\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), containsString(\"<html\"));\n  }\n\n  @Test\n  void deleteStubFile() {\n    String fileName = \"bar.txt\";\n    FileSource fileSource = wireMockServer.getOptions().filesRoot().child(FILES_ROOT);\n    fileSource.createIfNecessary();\n    fileSource.writeTextFile(fileName, \"contents\");\n\n    int statusCode = testClient.delete(\"/__admin/files/bar.txt\").statusCode();\n\n    assertEquals(200, statusCode);\n    assertFalse(\n        Paths.get(fileSource.getTextFileNamed(fileName).getPath()).toFile().exists(),\n        \"File should have been deleted\");\n  }\n\n  @Test\n  void deleteStubFileInTree() {\n    String fileName = \"foo/bar.txt\";\n    FileSource fileSource = wireMockServer.getOptions().filesRoot().child(FILES_ROOT);\n    fileSource.createIfNecessary();\n    fileSource.writeTextFile(fileName, \"contents\");\n\n    int statusCode = testClient.delete(\"/__admin/files/foo/bar.txt\").statusCode();\n\n    assertEquals(200, statusCode);\n    assertFalse(\n        Paths.get(fileSource.getTextFileNamed(fileName).getPath()).toFile().exists(),\n        \"File should have been deleted\");\n  }\n\n  @Test\n  void editStubFileContent() {\n    String fileName = \"bar.txt\";\n    FileSource fileSource = wireMockServer.getOptions().filesRoot().child(FILES_ROOT);\n    fileSource.createIfNecessary();\n    fileSource.writeTextFile(fileName, \"AAA\");\n\n    int statusCode =\n        testClient.putWithBody(\"/__admin/files/bar.txt\", \"BBB\", \"text/plain\").statusCode();\n\n    assertEquals(200, statusCode);\n    assertEquals(\n        \"BBB\",\n        fileSource.getTextFileNamed(fileName).readContentsAsString(),\n        \"File should have been changed\");\n  }\n\n  @Test\n  void createStubFileContentInTree() {\n    String fileName = \"foo/bar.txt\";\n    FileSource fileSource = wireMockServer.getOptions().filesRoot().child(FILES_ROOT);\n    fileSource.createIfNecessary();\n\n    int statusCode =\n        testClient.putWithBody(\"/__admin/files/foo/bar.txt\", \"BBB\", \"text/plain\").statusCode();\n\n    assertEquals(200, statusCode);\n    assertEquals(\n        \"BBB\",\n        fileSource.getTextFileNamed(fileName).readContentsAsString(),\n        \"File should have been changed\");\n  }\n\n  @Test\n  void getStubFileContent() {\n    String fileName = \"foo/bar.txt\";\n    FileSource fileSource = wireMockServer.getOptions().filesRoot().child(FILES_ROOT);\n    fileSource.createIfNecessary();\n    fileSource.writeTextFile(fileName, \"AAA\");\n\n    WireMockResponse response = testClient.get(\"/__admin/files/foo/bar.txt\");\n\n    assertEquals(200, response.statusCode());\n    assertEquals(\n        \"AAA\",\n        new String(response.binaryContent(), StandardCharsets.UTF_8),\n        \"File contents should be in file source\");\n  }\n\n  @Test\n  void listStubFiles() {\n    FileSource fileSource = wireMockServer.getOptions().filesRoot().child(FILES_ROOT);\n    fileSource.createIfNecessary();\n    fileSource.writeTextFile(\"bar.txt\", \"contents\");\n    fileSource.writeTextFile(\"zoo.txt\", \"contents\");\n\n    WireMockResponse response = testClient.get(\"/__admin/files\");\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"[ \\\"bar.txt\\\", \\\"zoo.txt\\\" ]\"));\n  }\n\n  @Test\n  void fetchStubWithMetadata() {\n    UUID id = UUID.randomUUID();\n    wireMockServer.stubFor(\n        get(\"/with-metadata\")\n            .withId(id)\n            .withMetadata(\n                Map.of(\"one\", 1, \"two\", \"2\", \"three\", true, \"four\", Map.of(\"five\", \"55555\"))));\n\n    WireMockResponse response = testClient.get(\"/__admin/mappings/\" + id);\n\n    JsonAssertion.assertThat(response.content()).field(\"metadata\").field(\"one\").isEqualTo(1);\n    JsonAssertion.assertThat(response.content()).field(\"metadata\").field(\"two\").isEqualTo(\"2\");\n    JsonAssertion.assertThat(response.content()).field(\"metadata\").field(\"three\").isEqualTo(true);\n    JsonAssertion.assertThat(response.content())\n        .field(\"metadata\")\n        .field(\"four\")\n        .field(\"five\")\n        .isEqualTo(\"55555\");\n  }\n\n  @Test\n  @SuppressWarnings(\"unchecked\")\n  void stubMetadataIsAbsentWhenNoneSpecified() {\n    UUID id = UUID.randomUUID();\n    wireMockServer.stubFor(get(\"/without-metadata\").withId(id));\n\n    WireMockResponse response = testClient.get(\"/__admin/mappings/\" + id);\n    Map<String, ?> data = Json.read(response.content(), Map.class);\n\n    assertThat(data, not(hasKey(\"metadata\")));\n  }\n\n  static final String IMPORT_JSON =\n      \"{\\n\"\n          + \"  \\\"mappings\\\": [\\n\"\n          + \"    {\\n\"\n          + \"      \\\"request\\\": {\\n\"\n          + \"        \\\"method\\\": \\\"GET\\\",\\n\"\n          + \"        \\\"url\\\": \\\"/one\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"response\\\": {\\n\"\n          + \"        \\\"status\\\": 200\\n\"\n          + \"      }\\n\"\n          + \"    },\\n\"\n          + \"    {\\n\"\n          + \"      \\\"id\\\": \\\"8c5db8b0-2db4-4ad7-a99f-38c9b00da3f7\\\",\\n\"\n          + \"      \\\"request\\\": {\\n\"\n          + \"        \\\"url\\\": \\\"/two\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"response\\\": {\\n\"\n          + \"        \\\"body\\\": \\\"Updated\\\"\\n\"\n          + \"      }\\n\"\n          + \"    }\\n\"\n          + \"  ],\\n\"\n          + \"  \\n\"\n          + \"  \\\"importOptions\\\": {\\n\"\n          + \"    \\\"duplicatePolicy\\\": \\\"IGNORE\\\",\\n\"\n          + \"    \\\"deleteAllNotInImport\\\": true\\n\"\n          + \"  }\\n\"\n          + \"}\";\n\n  @Test\n  void importStubs() {\n    UUID id2 = UUID.fromString(\"8c5db8b0-2db4-4ad7-a99f-38c9b00da3f7\");\n    wm.stubFor(get(\"/two\").withId(id2).willReturn(ok(\"Original\")));\n    wm.stubFor(get(\"/three\").willReturn(ok()));\n\n    testClient.postJson(\"/__admin/mappings/import\", IMPORT_JSON);\n\n    List<StubMapping> stubs = wireMockServer.listAllStubMappings().getMappings();\n    assertThat(stubs.get(1).getResponse().getBody(), is(\"Original\"));\n    assertThat(stubs.size(), is(2));\n  }\n\n  static final String EMPTY_ID_IMPORT_JSON =\n      \"{\\n\"\n          + \"  \\\"mappings\\\": [\\n\"\n          + \"    {\\n\"\n          + \"      \\\"id\\\": \\\"\\\",\\n\"\n          + \"      \\\"name\\\": \\\"Empty ID\\\",\\n\"\n          + \"      \\\"request\\\": {\\n\"\n          + \"        \\\"url\\\": \\\"/empty-id\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"response\\\": {\\n\"\n          + \"        \\\"status\\\": 204\\n\"\n          + \"      }\\n\"\n          + \"    },\\n\"\n          + \"    {\\n\"\n          + \"      \\\"id\\\": null,\\n\"\n          + \"      \\\"name\\\": \\\"Null ID\\\",\\n\"\n          + \"      \\\"request\\\": {\\n\"\n          + \"        \\\"url\\\": \\\"/null-id\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"response\\\": {\\n\"\n          + \"        \\\"status\\\": 204\\n\"\n          + \"      }\\n\"\n          + \"    }\\n\"\n          + \"  ]\\n\"\n          + \"}\";\n\n  @Test\n  void treatsEmptyOrNullIdFieldsAsNotPresent() {\n    WireMockResponse response =\n        testClient.postJson(\"/__admin/mappings/import\", EMPTY_ID_IMPORT_JSON);\n    assertThat(response.statusCode(), is(200));\n\n    List<StubMapping> stubs = wireMockServer.listAllStubMappings().getMappings();\n    assertThat(stubs, everyItem(hasIdAndUuid()));\n  }\n\n  static final String EMPTY_UUID_IMPORT_JSON =\n      \"{\\n\"\n          + \"  \\\"mappings\\\": [\\n\"\n          + \"    {\\n\"\n          + \"      \\\"id\\\": \\\"27d7818b-4df6-4630-a6ab-c50e87e384e1\\\",\\n\"\n          + \"      \\\"uuid\\\": \\\"\\\",\\n\"\n          + \"      \\\"name\\\": \\\"Empty UUID\\\",\\n\"\n          + \"      \\\"request\\\": {\\n\"\n          + \"        \\\"url\\\": \\\"/empty-id\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"response\\\": {\\n\"\n          + \"        \\\"status\\\": 204\\n\"\n          + \"      }\\n\"\n          + \"    },\\n\"\n          + \"    {\\n\"\n          + \"      \\\"id\\\": \\\"95b5c478-eb39-4bad-ba55-a336dbfeaa53\\\",\\n\"\n          + \"      \\\"uuid\\\": null,\\n\"\n          + \"      \\\"name\\\": \\\"Null ID\\\",\\n\"\n          + \"      \\\"request\\\": {\\n\"\n          + \"        \\\"url\\\": \\\"/null-id\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"response\\\": {\\n\"\n          + \"        \\\"status\\\": 204\\n\"\n          + \"      }\\n\"\n          + \"    }\\n\"\n          + \"  ]\\n\"\n          + \"}\";\n\n  @Test\n  void treatsEmptyOrNullUuidFieldsAsNotPresent() {\n    WireMockResponse response =\n        testClient.postJson(\"/__admin/mappings/import\", EMPTY_UUID_IMPORT_JSON);\n    assertThat(response.statusCode(), is(200));\n\n    List<StubMapping> stubs = wireMockServer.listAllStubMappings().getMappings();\n    assertThat(stubs, everyItem(hasIdAndUuid()));\n  }\n\n  private static Matcher<StubMapping> hasIdAndUuid() {\n    return new TypeSafeMatcher<>() {\n      @Override\n      protected boolean matchesSafely(StubMapping stub) {\n        return stub.getId() != null;\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"a stub with a non-null ID\");\n      }\n    };\n  }\n\n  final String SETTINGS_JSON =\n      \"{\\n\" + \"  \\\"extended\\\": {\\n\" + \"    \\\"mySetting\\\": 123\\n\" + \"  }\\n\" + \"}\";\n\n  @Test\n  void updateGlobalSettingsViaPut() {\n    WireMockResponse response =\n        testClient.putWithBody(\"/__admin/settings\", SETTINGS_JSON, \"application/json\");\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(\n        wireMockServer.getGlobalSettings().getSettings().getExtended().getInt(\"mySetting\"),\n        is(123));\n  }\n\n  final String WRAPPED_SETTINGS_JSON =\n      \"{\\n\"\n          + \"  \\\"settings\\\": {\\n\"\n          + \"    \\\"delayDistribution\\\": {\\n\"\n          + \"      \\\"type\\\": \\\"uniform\\\",\\n\"\n          + \"      \\\"lower\\\": 100,\\n\"\n          + \"      \\\"upper\\\": 300\\n\"\n          + \"    },\\n\"\n          + \"\\n\"\n          + \"    \\\"extended\\\": {\\n\"\n          + \"      \\\"one\\\": 1,\\n\"\n          + \"      \\\"two\\\": {\\n\"\n          + \"        \\\"name\\\": \\\"abc\\\"\\n\"\n          + \"      }\\n\"\n          + \"    }\\n\"\n          + \"  }\\n\"\n          + \"}\";\n\n  @Test\n  void updateGlobalSettingsViaPutWithWrapper() {\n    WireMockResponse response =\n        testClient.putWithBody(\"/__admin/settings\", WRAPPED_SETTINGS_JSON, \"application/json\");\n\n    assertThat(response.statusCode(), is(200));\n\n    GlobalSettings settings = wireMockServer.getGlobalSettings().getSettings();\n    assertThat(settings.getDelayDistribution(), Matchers.instanceOf(UniformDistribution.class));\n    assertThat(settings.getExtended().getInt(\"one\"), is(1));\n    assertThat(\n        settings.getExtended().getMetadata(\"two\").as(TestExtendedSettingsData.class).name,\n        is(\"abc\"));\n  }\n\n  final String EXTENDED_JSON =\n      \"{\\n\" + \"  \\\"extended\\\": {\\n\" + \"    \\\"one\\\": 11,\\n\" + \"    \\\"three\\\": 3\\n\" + \"  }\\n\" + \"}\";\n\n  @Test\n  void patchExtendedGlobalSettings() {\n    wireMockServer.updateGlobalSettings(\n        GlobalSettings.builder().extended(Parameters.one(\"two\", 2)).build());\n\n    WireMockResponse response =\n        testClient.patchWithBody(\"/__admin/settings/extended\", EXTENDED_JSON, \"application/json\");\n    assertThat(response.statusCode(), is(200));\n\n    Parameters extended = wireMockServer.getGlobalSettings().getSettings().getExtended();\n    assertThat(extended.getInt(\"one\"), is(11));\n    assertThat(extended.getInt(\"two\"), is(2));\n    assertThat(extended.getInt(\"three\"), is(3));\n  }\n\n  static final String STUB_IMPORT_JSON =\n      \"{\\n\"\n          + \"  \\\"mappings\\\": [\\n\"\n          + \"    {\\n\"\n          + \"      \\\"request\\\": {\\n\"\n          + \"        \\\"url\\\": \\\"/one\\\",\\n\"\n          + \"        \\\"method\\\": \\\"GET\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"response\\\": {\\n\"\n          + \"        \\\"status\\\": 200\\n\"\n          + \"      }\\n\"\n          + \"    },\\n\"\n          + \"    {\\n\"\n          + \"      \\\"request\\\": {\\n\"\n          + \"        \\\"url\\\": \\\"/two\\\",\\n\"\n          + \"        \\\"method\\\": \\\"GET\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"response\\\": {\\n\"\n          + \"        \\\"status\\\": 200\\n\"\n          + \"      }\\n\"\n          + \"    }\\n\"\n          + \"  ],\\n\"\n          + \"  \\\"meta\\\" : {\\n\"\n          + \"    \\\"total\\\" : 2\\n\"\n          + \"  }\\n\"\n          + \"}\";\n\n  @Test\n  void importMultipleStubsWithDefaultParameters() {\n    WireMockResponse response = testClient.postJson(\"/__admin/mappings/import\", STUB_IMPORT_JSON);\n\n    assertThat(response.statusCode(), is(200));\n\n    List<StubMapping> allStubs = wm.getStubMappings();\n    assertThat(allStubs.size(), is(2));\n    assertThat(allStubs.get(0).getRequest().getUrl(), is(\"/one\"));\n    assertThat(allStubs.get(1).getRequest().getUrl(), is(\"/two\"));\n  }\n\n  @Test\n  void findsNearMissesByRequest() {\n    wm.stubFor(post(\"/things\").willReturn(ok()));\n    testClient.postJson(\"/anything\", \"{}\");\n\n    String nearMissRequestJson =\n        \"{\\n\" + \"  \\\"method\\\": \\\"GET\\\",\\n\" + \"  \\\"url\\\": \\\"/thing\\\"\\n\" + \"}\";\n    WireMockResponse response =\n        testClient.postJson(\"/__admin/near-misses/request\", nearMissRequestJson);\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), jsonPartEquals(\"nearMisses[0].request.url\", \"/thing\"));\n  }\n\n  @Test\n  void getsAllUnmatchedServeEvents() {\n    wm.stubFor(get(\"/match\").willReturn(ok()));\n\n    testClient.get(\"/match\");\n    testClient.get(\"/no-match\");\n    testClient.get(\"/just-wrong\");\n    testClient.get(\"/match\");\n\n    WireMockResponse response = testClient.get(\"/__admin/requests?unmatched=true\");\n\n    assertThat(response.statusCode(), is(200));\n\n    String json = response.content();\n    assertThat(json, jsonPartEquals(\"requests[0].request.url\", \"/just-wrong\"));\n    assertThat(json, jsonPartEquals(\"requests[1].request.url\", \"/no-match\"));\n    assertThat(json, jsonPartMatches(\"requests\", hasSize(2)));\n  }\n\n  @Test\n  void getsAllServeEventsMatchingASpecificStub() {\n    wm.stubFor(get(\"/one\").willReturn(ok()));\n    StubMapping stub2 = wm.stubFor(get(\"/two\").willReturn(ok()));\n\n    testClient.get(\"/two\");\n    testClient.get(\"/one\");\n    testClient.get(\"/one\");\n    testClient.get(\"/two\");\n\n    WireMockResponse response = testClient.get(\"/__admin/requests?matchingStub=\" + stub2.getId());\n\n    assertThat(response.statusCode(), is(200));\n\n    String json = response.content();\n    assertThat(json, jsonPartEquals(\"requests[0].request.url\", \"/two\"));\n    assertThat(json, jsonPartEquals(\"requests[1].request.url\", \"/two\"));\n    assertThat(json, jsonPartMatches(\"requests\", hasSize(2)));\n  }\n\n  @Test\n  void returnsSensibleErrorIfStubIdNotValid() {\n    WireMockResponse response = testClient.get(\"/__admin/requests?matchingStub=not-a-valid-uuid\");\n\n    assertThat(response.statusCode(), is(400));\n    assertThat(\n        response.content(),\n        jsonPartEquals(\n            \"errors[0].title\",\n            \"Query parameter matchingStub value 'not-a-valid-uuid' is not a valid UUID\"));\n  }\n\n  @Test\n  void returnsSensibleErrorIfStubIdIsNull() {\n    WireMockResponse response = testClient.get(\"/__admin/requests?matchingStub=\");\n\n    assertThat(response.statusCode(), is(400));\n    assertThat(\n        response.content(),\n        jsonPartEquals(\n            \"errors[0].title\", \"Query parameter matchingStub value '' is not a valid UUID\"));\n  }\n\n  @Test\n  void returnsDefaultStubMappingInServeEventWhenRequestNotMatched() {\n    testClient.get(\"/wrong-request/1\");\n\n    WireMockResponse serveEventsResponse = testClient.get(\"/__admin/requests\");\n\n    String data = serveEventsResponse.content();\n    assertThat(data, jsonPartEquals(\"requests[0].stubMapping.id\", \"\\\"${json-unit.any-string}\\\"\"));\n    assertThat(data, jsonPartEquals(\"requests[0].stubMapping.response.status\", 404));\n  }\n\n  @Test\n  void returnsBadRequestWhenAttemptingToGetByNonUuid() {\n    WireMockResponse response = testClient.get(\"/__admin/mappings/not-a-uuid\");\n    assertThat(response.statusCode(), is(400));\n    assertThat(\n        response.content(), jsonPartEquals(\"errors[0].title\", \"not-a-uuid is not a valid UUID\"));\n  }\n\n  @Test\n  void returnsNotFoundWhenAttemptingToGetNonExistentStub() {\n    assertThat(testClient.get(\"/__admin/mappings/\" + UUID.randomUUID()).statusCode(), is(404));\n  }\n\n  @Test\n  void returnsBadRequestWhenAttemptingToEditByNonUuid() {\n    assertThat(testClient.putJson(\"/__admin/mappings/not-a-uuid\", \"{}\").statusCode(), is(400));\n  }\n\n  @Test\n  void returnsNotFoundWhenAttemptingToEditNonExistentStub() {\n    assertThat(testClient.put(\"/__admin/mappings/\" + UUID.randomUUID()).statusCode(), is(404));\n  }\n\n  @Test\n  void returnsBadRequestWhenAttemptingToRemoveByNonUuid() {\n    assertThat(testClient.delete(\"/__admin/mappings/not-a-uuid\").statusCode(), is(400));\n  }\n\n  @Test\n  void returnsNotFoundWhenAttemptingToRemoveNonExistentStub() {\n    assertThat(testClient.put(\"/__admin/mappings/\" + UUID.randomUUID()).statusCode(), is(404));\n  }\n\n  @Test\n  void returnsBadRequestWhenAttemptingToGetServeEventByNonUuid() {\n    WireMockResponse response = testClient.get(\"/__admin/requests/not-a-uuid\");\n    assertThat(response.statusCode(), is(400));\n    assertThat(\n        response.content(), jsonPartEquals(\"errors[0].title\", \"not-a-uuid is not a valid UUID\"));\n  }\n\n  @Test\n  void returnsNotFoundWhenAttemptingToGetServeEventByNonExistentId() {\n    assertThat(testClient.get(\"/__admin/requests/\" + UUID.randomUUID()).statusCode(), is(404));\n  }\n\n  @Test\n  void returnsBadRequestWhenAttemptingToRemoveServeEventByNonUuid() {\n    assertThat(testClient.delete(\"/__admin/requests/not-a-uuid\").statusCode(), is(400));\n  }\n\n  @Test\n  void getVersionRequestDefaultsToJson() throws Exception {\n    WireMockResponse response = testClient.get(\"/__admin/version\");\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/json\"));\n    JSONAssert.assertEquals(\n        \"{                                              \\n\"\n            + \"  \\\"version\\\" : \\\"X.X.X\\\"                          \\n\"\n            + \"}\",\n        response.content(),\n        true);\n  }\n\n  @Test\n  void getVersionRequestReturnsTextBodyWhenAcceptHeaderIsTextPlain() {\n    WireMockResponse response =\n        testClient.get(\"/__admin/version\", new TestHttpHeader(\"Accept\", \"text/plain\"));\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Content-Type\"), containsString(\"text/plain\"));\n    assertThat(response.content(), is(\"X.X.X\"));\n  }\n\n  @Test\n  void findUnmatchedStubMappingsWithNoMappings() {\n    WireMockResponse response = testClient.get(\"/__admin/mappings/unmatched\");\n    assertThat(response.statusCode(), is(200));\n    JsonVerifiable check = JsonAssertion.assertThat(response.content());\n    check.field(\"meta\").field(\"total\").isEqualTo(0);\n    check.field(\"mappings\").isEmpty();\n  }\n\n  @Test\n  void findUnmatchedStubMappingsWithMatchingMapping() {\n    wm.stubFor(get(\"/one\"));\n    assertThat(testClient.get(\"/one\").statusCode(), is(200));\n\n    WireMockResponse response = testClient.get(\"/__admin/mappings/unmatched\");\n    assertThat(response.statusCode(), is(200));\n    JsonVerifiable check = JsonAssertion.assertThat(response.content());\n    check.field(\"meta\").field(\"total\").isEqualTo(0);\n    check.field(\"mappings\").isEmpty();\n  }\n\n  @Test\n  void findUnmatchedStubMappingsWithMultipleMappings() {\n    wm.stubFor(get(\"/one\"));\n    StubMapping stub2 = wm.stubFor(get(\"/two\"));\n\n    assertThat(testClient.get(\"/one\").statusCode(), is(200));\n\n    WireMockResponse response = testClient.get(\"/__admin/mappings/unmatched\");\n    assertThat(response.statusCode(), is(200));\n    JsonVerifiable check = JsonAssertion.assertThat(response.content());\n    check.field(\"meta\").field(\"total\").isEqualTo(1);\n    check.field(\"mappings\").hasSize(1).elementWithIndex(0).field(\"id\").isEqualTo(stub2.getId());\n  }\n\n  @Test\n  void removeUnmatchedStubMappingsWithNoMappings() {\n    WireMockResponse response = testClient.delete(\"/__admin/mappings/unmatched\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void removeUnmatchedStubMappingsWithMatchingMapping() {\n    wm.stubFor(get(\"/one\"));\n    assertThat(testClient.get(\"/one\").statusCode(), is(200));\n\n    WireMockResponse response = testClient.delete(\"/__admin/mappings/unmatched\");\n    assertThat(response.statusCode(), is(200));\n\n    assertThat(testClient.get(\"/one\").statusCode(), is(200));\n  }\n\n  @Test\n  void removeUnmatchedStubMappingsWithMultipleMappings() {\n    wm.stubFor(get(\"/one\"));\n    wm.stubFor(get(\"/two\"));\n\n    assertThat(testClient.get(\"/one\").statusCode(), is(200));\n\n    WireMockResponse response = testClient.delete(\"/__admin/mappings/unmatched\");\n    assertThat(response.statusCode(), is(200));\n\n    assertThat(testClient.get(\"/one\").statusCode(), is(200));\n    assertThat(testClient.get(\"/two\").statusCode(), is(404));\n  }\n\n  @Test\n  void removeStubMappingsByIdAndRequestMatch() {\n    StubMapping stub1 = wm.stubFor(get(\"/one\"));\n    wm.stubFor(get(\"/two\"));\n    wm.stubFor(get(\"/three\"));\n\n    assertThat(testClient.get(\"/one\").statusCode(), is(200));\n    assertThat(testClient.get(\"/two\").statusCode(), is(200));\n    assertThat(testClient.get(\"/three\").statusCode(), is(200));\n\n    WireMockResponse response =\n        testClient.postJson(\n            \"/__admin/mappings/remove\",\n            \"\"\"\n            {\n              \"mappings\": [\n                {\n                  \"id\": \"%s\"\n                },\n                {\n                  \"request\": {\n                    \"method\": \"GET\",\n                    \"url\": \"/three\"\n                  }\n                }\n              ]\n            }\n            \"\"\"\n                .formatted(stub1.getId()));\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"\"));\n\n    assertThat(testClient.get(\"/one\").statusCode(), is(404));\n    assertThat(testClient.get(\"/two\").statusCode(), is(200));\n    assertThat(testClient.get(\"/three\").statusCode(), is(404));\n  }\n\n  public static class TestExtendedSettingsData {\n    public String name;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/AdvancedPathPatternSerializationTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matchingXPath;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport java.util.Map;\nimport org.json.JSONException;\nimport org.junit.jupiter.api.Test;\n\npublic class AdvancedPathPatternSerializationTest {\n\n  @Test\n  void matchesXpathWithOnlyAValueSerializesCorrectly() {\n    String expectedJson = \"{\\\"matchesXPath\\\" : \\\"//AccountId\\\"}\";\n    StringValuePattern pattern = matchingXPath(\"//AccountId\");\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void matchingXpathWithPatternSerializesCorrectly() throws JSONException {\n    String expectedJson =\n        \"{\\n\"\n            + \"        \\\"matchesXPath\\\" : {\\n\"\n            + \"            \\\"expression\\\" : \\\"//AccountId\\\",\\n\"\n            + \"            \\\"equalTo\\\" : \\\"123\\\"\\n\"\n            + \"        }\\n\"\n            + \"}\";\n    StringValuePattern pattern = matchingXPath(\"//AccountId\", equalTo(\"123\"));\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void matchingXpathWithNameSpacesSerializesCorrectly() {\n    String expectedJson =\n        \"{\\n\"\n            + \"           \\\"matchesXPath\\\" : \\\"//AccountId\\\",\\n\"\n            + \"           \\\"xPathNamespaces\\\" : {\\n\"\n            + \"               \\\"one\\\" : \\\"https://example.com/one\\\",\\n\"\n            + \"               \\\"two\\\" : \\\"https://example.com/two\\\"\\n\"\n            + \"            }\\n\"\n            + \"}\";\n    StringValuePattern pattern =\n        matchingXPath(\n            \"//AccountId\",\n            Map.of(\"one\", \"https://example.com/one\", \"two\", \"https://example.com/two\"));\n\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void nestedMatchingXpathWithPatternSerializesCorrectly() {\n    String expectedJson =\n        \"{\\n\"\n            + \"    \\\"matchesJsonPath\\\" : {\\n\"\n            + \"        \\\"expression\\\" : \\\"$.LinkageDetails.AccountId\\\",\\n\"\n            + \"        \\\"matchesXPath\\\" : {\\n\"\n            + \"            \\\"expression\\\" : \\\"//AccountId\\\",\\n\"\n            + \"            \\\"equalTo\\\" : \\\"123\\\"\\n\"\n            + \"        }\\n\"\n            + \"    }\\n\"\n            + \"}\";\n    StringValuePattern pattern =\n        matchingJsonPath(\n            \"$.LinkageDetails.AccountId\", matchingXPath(\"//AccountId\", equalTo(\"123\")));\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void nestedMatchingXpathWithNameSpacesSerializesCorrectly() {\n    String expectedJson =\n        \"{\\n\"\n            + \"    \\\"matchesJsonPath\\\" : {\\n\"\n            + \"        \\\"expression\\\" : \\\"$.LinkageDetails.AccountId\\\",\\n\"\n            + \"        \\\"matchesXPath\\\" : \\\"//AccountId\\\",\\n\"\n            + \"        \\\"xPathNamespaces\\\" : {\\n\"\n            + \"            \\\"one\\\" : \\\"https://example.com/one\\\",\\n\"\n            + \"            \\\"two\\\" : \\\"https://example.com/two\\\"\\n\"\n            + \"         }\\n\"\n            + \"    }\\n\"\n            + \"}\";\n    StringValuePattern pattern =\n        matchingJsonPath(\n            \"$.LinkageDetails.AccountId\",\n            matchingXPath(\n                \"//AccountId\",\n                Map.of(\"one\", \"https://example.com/one\", \"two\", \"https://example.com/two\")));\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void matchesJsonPathWithOnlyAValueSerializesCorrectly() {\n    String expectedJson = \"{\\\"matchesJsonPath\\\" : \\\"$.LinkageDetails.AccountId\\\"}\";\n    StringValuePattern pattern = matchingJsonPath(\"$.LinkageDetails.AccountId\");\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void matchingJsonPathSerializesCorrectly() {\n    String expectedJson =\n        \"{\\n\"\n            + \"        \\\"matchesJsonPath\\\" : {\\n\"\n            + \"            \\\"expression\\\" : \\\"$.LinkageDetails.AccountId\\\",\\n\"\n            + \"            \\\"equalTo\\\" : \\\"123\\\"\\n\"\n            + \"        }\\n\"\n            + \"}\";\n    StringValuePattern pattern = matchingJsonPath(\"$.LinkageDetails.AccountId\", equalTo(\"123\"));\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void nestedMatchingJsonPathWithOnlyValueSerializesCorrectly() {\n    String expectedJson =\n        \"{\\n\"\n            + \"    \\\"matchesXPath\\\" : {\\n\"\n            + \"        \\\"expression\\\" : \\\"//AccountId\\\",\\n\"\n            + \"        \\\"matchesJsonPath\\\" : \\\"$.LinkageDetails.AccountId\\\"\\n\"\n            + \"    }\\n\"\n            + \"}\";\n    StringValuePattern pattern =\n        matchingXPath(\"//AccountId\", matchingJsonPath(\"$.LinkageDetails.AccountId\"));\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void nestedMatchingJsonPathWithPatternSerializesCorrectly() {\n    String expectedJson =\n        \"{\\n\"\n            + \"    \\\"matchesXPath\\\" : {\\n\"\n            + \"        \\\"expression\\\" : \\\"//AccountId\\\",\\n\"\n            + \"        \\\"matchesJsonPath\\\" : {\\n\"\n            + \"            \\\"expression\\\" : \\\"$.LinkageDetails.AccountId\\\",\\n\"\n            + \"            \\\"equalTo\\\" : \\\"123\\\"\\n\"\n            + \"        }\\n\"\n            + \"    }\\n\"\n            + \"}\";\n    StringValuePattern pattern =\n        matchingXPath(\n            \"//AccountId\", matchingJsonPath(\"$.LinkageDetails.AccountId\", equalTo(\"123\")));\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void nestedMatchingJsonPathSerializesCorrectly() {\n    String expectedJson =\n        \"{\\n\"\n            + \"    \\\"matchesXPath\\\" : {\\n\"\n            + \"        \\\"expression\\\" : \\\"//AccountId\\\",\\n\"\n            + \"        \\\"matchesJsonPath\\\" : {\\n\"\n            + \"            \\\"expression\\\" : \\\"$.LinkageDetails.AccountId\\\",\\n\"\n            + \"            \\\"equalTo\\\" : \\\"123\\\"\\n\"\n            + \"        }\\n\"\n            + \"    }\\n\"\n            + \"}\";\n    StringValuePattern pattern =\n        matchingXPath(\n            \"//AccountId\", matchingJsonPath(\"$.LinkageDetails.AccountId\", equalTo(\"123\")));\n    assertThat(Json.write(pattern), jsonEquals(expectedJson));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/BasicAuthAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalToIgnoringCase;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.client.BasicCredentials;\nimport com.github.tomakehurst.wiremock.http.MultiValue;\nimport com.github.tomakehurst.wiremock.matching.MultiValuePattern;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class BasicAuthAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void matchesPreemptiveBasicAuthWhenCredentialAreCorrect() {\n    stubFor(\n        get(urlEqualTo(\"/basic/auth/preemptive\"))\n            .withBasicAuth(\"the-username\", \"thepassword\")\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.getWithPreemptiveCredentials(\n            \"/basic/auth/preemptive\", wireMockServer.port(), \"the-username\", \"thepassword\");\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void doesNotMatchPreemptiveBasicAuthWhenCredentialsAreIncorrect() {\n    stubFor(\n        get(urlEqualTo(\"/basic/auth/preemptive\"))\n            .withBasicAuth(\"the-username\", \"thepassword\")\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.getWithPreemptiveCredentials(\n            \"/basic/auth/preemptive\", wireMockServer.port(), \"the-username\", \"WRONG!!!\");\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  public void matcheswhenBASICInHeaderIsAllUpperCase() {\n    stubFor(\n        get(urlEqualTo(\"/basic/auth/case-insensitive\"))\n            .withBasicAuth(\"tom\", \"secret\")\n            .willReturn(aResponse().withStatus(200)));\n\n    assertThat(\n        testClient\n            .get(\n                \"/basic/auth/case-insensitive\",\n                withHeader(\"Authorization\", \"BASIC dG9tOnNlY3JldA==\"))\n            .statusCode(),\n        is(200));\n  }\n\n  @Test\n  public void doesNotMatchWhenBase64UsesIncorrectCase() {\n    MultiValuePattern matcher =\n        new BasicCredentials(\"tom\", \"my-secret\").asAuthorizationMultiValuePattern();\n\n    String goodCreds = \"dG9tOm15LXNlY3JldA==\";\n    String badCreds = \"dG9tom15LXNlY3JldA==\";\n\n    // expect\n    assertThat(goodCreds, not(badCreds));\n    assertThat(goodCreds, equalToIgnoringCase(badCreds));\n    assertTrue(\n        matcher\n            .match(new MultiValue(\"Authorization\", List.of(\"Basic \" + goodCreds)))\n            .isExactMatch());\n\n    assertFalse(\n        matcher\n            .match(new MultiValue(\"Authorization\", List.of(\"Basic \" + badCreds)))\n            .isExactMatch());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/BindAddressTest.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.fail;\nimport static org.junit.jupiter.api.Assumptions.assumeFalse;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.net.Inet4Address;\nimport java.net.InetAddress;\nimport java.net.NetworkInterface;\nimport java.net.SocketException;\nimport java.util.Collections;\nimport java.util.Enumeration;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.core5.http.ClassicHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.apache.hc.core5.http.io.support.ClassicRequestBuilder;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class BindAddressTest {\n\n  private String localhost = \"127.0.0.1\";\n  private String nonBindAddress;\n  private WireMockServer wireMockServer;\n\n  final CloseableHttpClient client = ApacheHttpClientFactory.createClient();\n\n  @BeforeEach\n  public void prepare() throws Exception {\n    nonBindAddress = getIpAddressOtherThan(localhost);\n\n    assumeFalse(\n        nonBindAddress == null,\n        \"Impossible to validate the binding address. This machine has only a one Ip address [\"\n            + localhost\n            + \"]\");\n\n    wireMockServer =\n        new WireMockServer(\n            wireMockConfig().bindAddress(localhost).dynamicPort().dynamicHttpsPort());\n    wireMockServer.start();\n\n    wireMockServer.stubFor(\n        get(urlPathEqualTo(\"/bind-test\")).willReturn(aResponse().withStatus(200)));\n  }\n\n  @AfterEach\n  public void stop() {\n    if (wireMockServer != null) {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  public void shouldRespondInTheBindAddressOnlyOnHttp() throws Exception {\n    executeGetIn(localhost);\n    try {\n      executeGetIn(nonBindAddress);\n      fail(\"Should not accept HTTP connection to [\" + nonBindAddress + \"]\");\n    } catch (Exception ex) {\n    }\n  }\n\n  @Test\n  public void shouldRespondInTheBindAddressOnlyOnHttps() throws Exception {\n    int localhostStatus = getStatusViaHttps(localhost);\n    assertThat(localhostStatus, is(200));\n\n    try {\n      getStatusViaHttps(nonBindAddress);\n      fail(\"Should not accept HTTPS connection to [\" + nonBindAddress + \"]\");\n    } catch (Exception e) {\n    }\n  }\n\n  private int getStatusViaHttps(String host) throws Exception {\n    ClassicHttpResponse localhostResponse =\n        client.execute(\n            ClassicRequestBuilder.get(\n                    \"https://\" + host + \":\" + wireMockServer.httpsPort() + \"/bind-test\")\n                .build());\n\n    int status = localhostResponse.getCode();\n    EntityUtils.consume(localhostResponse.getEntity());\n    return status;\n  }\n\n  private void executeGetIn(String address) {\n    WireMockTestClient wireMockClient = new WireMockTestClient(wireMockServer.port(), address);\n    WireMockResponse response = wireMockClient.get(\"/bind-test\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  private String getIpAddressOtherThan(String lopbackAddress) throws SocketException {\n    Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();\n    for (NetworkInterface netInterface : Collections.list(networkInterfaces)) {\n      Enumeration<InetAddress> inetAddresses = netInterface.getInetAddresses();\n      for (InetAddress address : Collections.list(inetAddresses)) {\n        if (address instanceof Inet4Address && !address.getHostAddress().equals(lopbackAddress)) {\n          return address.getHostAddress();\n        }\n      }\n    }\n    return null;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/BrowserProxyAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2013-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\nclass BrowserProxyAcceptanceTest {\n\n  @RegisterExtension\n  public static WireMockExtension target = WireMockExtension.newInstance().build();\n\n  private WireMockServer proxy;\n  private WireMockTestClient testClient;\n\n  @BeforeEach\n  public void init() {\n    testClient = new WireMockTestClient(target.getPort());\n\n    proxy = new WireMockServer(wireMockConfig().port(8111).enableBrowserProxying(true));\n    proxy.start();\n  }\n\n  @AfterEach\n  public void stopServer() {\n    if (proxy.isRunning()) {\n      proxy.stop();\n    }\n  }\n\n  @Test\n  public void canProxyHttp() {\n    target.stubFor(get(\"/whatever\").willReturn(aResponse().withBody(\"Got it\")));\n\n    assertThat(\n        testClient.getViaProxy(target.url(\"/whatever\"), proxy.port()).content(), is(\"Got it\"));\n  }\n\n  @Test\n  public void passesQueryParameters() {\n    target.stubFor(\n        get(urlEqualTo(\"/search?q=things&limit=10\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(\n        testClient.getViaProxy(target.url(\"/search?q=things&limit=10\"), proxy.port()).statusCode(),\n        is(200));\n  }\n\n  @Test\n  public void returnNotConfiguredResponseOnPassThroughDisabled() {\n    target.stubFor(get(\"/whatever\").willReturn(ok(\"Got it\")));\n\n    GlobalSettings newSettings =\n        target.getGlobalSettings().getSettings().copy().proxyPassThrough(false).build();\n    target.updateGlobalSettings(newSettings);\n\n    assertThat(\n        testClient.getViaProxy(target.url(\"/something\"), proxy.port()).statusCode(), is(404));\n  }\n\n  @Test\n  public void returnStubbedResponseOnPassThroughDisabled() {\n    proxy.updateGlobalSettings(\n        proxy.getGlobalSettings().getSettings().copy().proxyPassThrough(false).build());\n\n    proxy.stubFor(get(\"/whatever\").willReturn(ok(\"Default response\")));\n\n    WireMockResponse wireMockResponse =\n        testClient.getViaProxy(target.url(\"/whatever\"), proxy.port());\n\n    assertThat(wireMockResponse.statusCode(), is(200));\n    assertThat(wireMockResponse.content(), is(\"Default response\"));\n  }\n\n  @Test\n  public void returnStubbedResponseOnPassThroughEnabled() {\n    // by default, passProxyThrough is true/enabled\n    target.stubFor(get(\"/whatever\").willReturn(ok(\"Got it\")));\n\n    WireMockResponse wireMockResponse =\n        testClient.getViaProxy(target.url(\"/whatever\"), proxy.port());\n    assertThat(wireMockResponse.statusCode(), is(200));\n    assertThat(wireMockResponse.content(), is(\"Got it\"));\n  }\n\n  @Test\n  void disablingPassThroughDoesNotAffectReverseProxying() {\n    proxy.updateGlobalSettings(\n        proxy.getGlobalSettings().getSettings().copy().proxyPassThrough(false).build());\n\n    proxy.stubFor(proxyAllTo(target.baseUrl()));\n\n    target.stubFor(get(\"/whatever\").willReturn(ok(\"Got it\")));\n\n    WireMockTestClient testClient = new WireMockTestClient(proxy.port());\n\n    assertThat(testClient.get(\"/whatever\").content(), is(\"Got it\"));\n  }\n\n  @Nested\n  class Disabled {\n\n    @RegisterExtension\n    public WireMockExtension wmWithoutBrowserProxy = WireMockExtension.newInstance().build();\n\n    @Test\n    public void browserProxyIsReportedAsFalseInRequestLogWhenDisabled() {\n      int httpPort = wmWithoutBrowserProxy.getPort();\n      WireMockTestClient testClient = new WireMockTestClient(httpPort);\n\n      testClient.getViaProxy(\"http://whereever/whatever\", httpPort);\n\n      LoggedRequest request =\n          wmWithoutBrowserProxy\n              .findRequestsMatching(getRequestedFor(urlPathEqualTo(\"/whatever\")).build())\n              .getRequests()\n              .get(0);\n      assertThat(request.isBrowserProxyRequest(), is(false));\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ConcurrentProxyingTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.defaultTestFilesRoot;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.Future;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class ConcurrentProxyingTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort())\n          .failOnUnmatchedRequests(false)\n          .build();\n\n  @RegisterExtension\n  public WireMockExtension target =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort().usingFilesUnderDirectory(defaultTestFilesRoot()))\n          .failOnUnmatchedRequests(false)\n          .build();\n\n  private WireMockTestClient client;\n\n  @Test\n  public void concurrent() throws Exception {\n    client = new WireMockTestClient(wm.getPort());\n\n    wm.stubFor(any(anyUrl()).atPriority(10).willReturn(aResponse().proxiedFrom(target.baseUrl())));\n\n    ExecutorService executor = Executors.newFixedThreadPool(20);\n\n    List<Future<?>> results = new ArrayList<>();\n    for (int i = 0; i < 100; i++) {\n      results.add(\n          executor.submit(\n              () -> {\n                assertThat(client.get(\"/plain-example1.txt\").content(), is(\"Example 1\"));\n                assertThat(client.get(\"/plain-example2.txt\").content(), is(\"Example 2\"));\n                assertThat(client.get(\"/plain-example3.txt\").content(), is(\"Example 3\"));\n                assertThat(client.get(\"/plain-example4.txt\").content(), is(\"Example 4\"));\n                assertThat(client.get(\"/plain-example5.txt\").content(), is(\"Example 5\"));\n              }));\n    }\n\n    for (Future<?> result : results) {\n      result.get();\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ContentPatternsJsonValidityTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.client.WireMock.havingExactly;\nimport static com.github.tomakehurst.wiremock.common.DateTimeTruncation.FIRST_DAY_OF_MONTH;\nimport static com.github.tomakehurst.wiremock.common.DateTimeTruncation.LAST_DAY_OF_MONTH;\nimport static com.github.tomakehurst.wiremock.common.DateTimeUnit.DAYS;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.empty;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.testsupport.TestFiles;\nimport com.networknt.schema.*;\nimport java.util.Map;\nimport java.util.Set;\nimport org.apache.commons.lang3.RandomUtils;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\n\npublic class ContentPatternsJsonValidityTest {\n\n  static JsonSchemaFactory schemaFactory;\n  static SchemaValidatorsConfig config;\n  static JsonSchema schema;\n\n  @BeforeAll\n  static void init() {\n    config = SchemaValidatorsConfig.builder().build();\n\n    schemaFactory =\n        JsonSchemaFactory.getInstance(WireMock.JsonSchemaVersion.V202012.toVersionFlag());\n\n    schema =\n        schemaFactory.getSchema(\n            SchemaLocation.of(TestFiles.fileUri(\"swagger/schemas/content-pattern.yaml\").toString()),\n            config);\n  }\n\n  @Test\n  void equalToValidates() {\n    assertThat(validate(equalTo(\"abc\")), empty());\n    assertThat(\n        validate(\"{ \\\"equalTo\\\": \\\"thing\\\", \\\"caseInsensitive\\\": 3 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void binaryEqualToValidates() {\n    assertThat(validate(binaryEqualTo(\"abc\".getBytes())), empty());\n    assertThat(validate(\"{ \\\"binaryEqualTo\\\": \\\"not base 64\\\" }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void equalToJsonWithMinimalParametersValidates() {\n    assertThat(validate(equalToJson(\"{}\")), empty());\n    assertThat(validate(\"{ \\\"equalToJson\\\": 5 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void equalToJsonWithAllParametersValidates() {\n    assertThat(validate(equalToJson(\"{}\", false, true)), empty());\n    assertThat(\n        validate(\n            \"{ \\\"equalToJson\\\": \\\"{}\\\", \\\"ignoreExtraElements\\\": false, \\\"ignoreArrayOrder\\\": {} }\"),\n        Matchers.not(empty()));\n  }\n\n  @Test\n  void simpleMatchesJsonPathValidates() {\n    assertThat(validate(matchingJsonPath(\"$.id\")), empty());\n    assertThat(validate(\"{ \\\"matchesJsonPath\\\": 5 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void matchesJsonPathWithSubMatcherValidates() {\n    assertThat(validate(matchingJsonPath(\"$.id\", equalTo(\"123\"))), empty());\n    assertThat(validate(\"{ \\\"matchesJsonPath\\\": 5 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void equalToXmlWithMinimalParametersValidates() {\n    assertThat(validate(equalToXml(\"<thing/>\")), empty());\n    assertThat(validate(\"{ \\\"equalToXml\\\": 5 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void equalToXmlWithAllParametersValidates() {\n    assertThat(validate(equalToXml(\"<thing/>\", true, \"[\", \"]\", true)), empty());\n    assertThat(\n        validate(\n            \"{\\n\"\n                + \"  \\\"equalToXml\\\" : \\\"<thing/>\\\",\\n\"\n                + \"  \\\"enablePlaceholders\\\" : true,\\n\"\n                + \"  \\\"placeholderOpeningDelimiterRegex\\\" : 3,\\n\"\n                + \"  \\\"placeholderClosingDelimiterRegex\\\" : \\\"]\\\"\\n\"\n                + \"}\"),\n        Matchers.not(empty()));\n  }\n\n  @Test\n  void simpleMatchesXPathValidates() {\n    assertThat(validate(matchingXPath(\"//Order/Quantity\")), empty());\n    assertThat(validate(\"{ \\\"matchesXPath\\\": 5 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void matchesXPathWithSubMatcherValidates() {\n    assertThat(validate(matchingXPath(\"//Order/Quantity\", equalTo(\"123\"))), empty());\n    assertThat(\n        validate(\n            \"{\\n\"\n                + \"  \\\"matchesXPath\\\": {\\n\"\n                + \"    \\\"expression\\\": true,\\n\"\n                + \"    \\\"equalTo\\\": \\\"123\\\"\\n\"\n                + \"  }\\n\"\n                + \"}\"),\n        Matchers.not(empty()));\n  }\n\n  @Test\n  void matchesXPathWithNamespacesValidates() {\n    assertThat(\n        validate(\n            matchingXPath(\n                \"//Order/Quantity\",\n                Map.of(\"one\", \"https://example.com/one\", \"two\", \"https://example.com/two\"))),\n        empty());\n\n    assertThat(\n        validate(\n            \"{\\n\"\n                + \"  \\\"matchesXPath\\\" : \\\"//Order/Quantity\\\",\\n\"\n                + \"  \\\"xPathNamespaces\\\" : {\\n\"\n                + \"    \\\"one\\\": \\\"https://example.com/one\\\",\\n\"\n                + \"    \\\"two\\\": 543 \\n\"\n                + \"  }\\n\"\n                + \"}\"),\n        Matchers.not(empty()));\n  }\n\n  @Test\n  void matchesJsonSchemaValidates() {\n    assertThat(validate(matchingJsonSchema(\"{ \\\"type\\\": \\\"string\\\" }\")), empty());\n    assertThat(validate(\"{ \\\"matchesJsonSchema\\\": true }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void matchesJsonSchemaWithVersionValidates() {\n    assertThat(validate(matchingJsonSchema(\"{ \\\"type\\\": \\\"string\\\" }\")), empty());\n    assertThat(validate(\"{ \\\"matchesJsonSchema\\\": true }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void containsValidates() {\n    assertThat(validate(containing(\"abc\")), empty());\n    assertThat(validate(\"{ \\\"contains\\\": true }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void doesNotContainValidates() {\n    assertThat(validate(notContaining(\"abc\")), empty());\n    assertThat(validate(\"{ \\\"doesNotContain\\\": true }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void matchesValidates() {\n    assertThat(validate(matching(\"abc\")), empty());\n    assertThat(validate(\"{ \\\"matches\\\": true }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void not_equalToValidates() {\n    assertThat(validate(not(equalTo(\"abc\"))), empty());\n\n    assertThat(validate(\"{\\n\" + \"  \\\"not\\\": true\\n\" + \"}\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void doesNotMatchValidates() {\n    assertThat(validate(notMatching(\"abc\")), empty());\n    assertThat(validate(\"{ \\\"doesNotMatch\\\": true }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void beforeWithMinimalParametersValidates() {\n    assertThat(validate(before(\"2018-05-05T00:11:22Z\")), empty());\n    assertThat(validate(\"{ \\\"before\\\": 55 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void beforeWithAllParametersValidates() {\n    assertThat(\n        validate(\n            before(\"2018-05-05T00:11:22Z\")\n                .actualFormat(\"yyyy-MM-dd\")\n                .expectedOffset(3, DAYS)\n                .truncateExpected(FIRST_DAY_OF_MONTH)\n                .truncateActual(LAST_DAY_OF_MONTH)),\n        empty());\n\n    assertThat(\n        validate(\n            \"{\\n\"\n                + \"  \\\"before\\\" : \\\"now +3 days\\\",\\n\"\n                + \"  \\\"actualFormat\\\" : \\\"yyyy-MM-dd\\\",\\n\"\n                + \"  \\\"truncateExpected\\\" : true,\\n\"\n                + \"  \\\"truncateActual\\\" : \\\"last day of month\\\"\\n\"\n                + \"}\"),\n        Matchers.not(empty()));\n  }\n\n  @Test\n  void afterWithMinimalParametersValidates() {\n    assertThat(validate(after(\"2018-05-05T00:11:22Z\")), empty());\n    assertThat(validate(\"{ \\\"after\\\": 55 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void afterWithAllParametersValidates() {\n    assertThat(\n        validate(\n            after(\"2018-05-05T00:11:22Z\")\n                .actualFormat(\"yyyy-MM-dd\")\n                .expectedOffset(3, DAYS)\n                .truncateExpected(FIRST_DAY_OF_MONTH)\n                .truncateActual(LAST_DAY_OF_MONTH)),\n        empty());\n\n    assertThat(\n        validate(\n            \"{\\n\"\n                + \"  \\\"after\\\" : \\\"now +3 days\\\",\\n\"\n                + \"  \\\"actualFormat\\\" : \\\"yyyy-MM-dd\\\",\\n\"\n                + \"  \\\"truncateExpected\\\" : true,\\n\"\n                + \"  \\\"truncateActual\\\" : \\\"last day of month\\\"\\n\"\n                + \"}\"),\n        Matchers.not(empty()));\n  }\n\n  @Test\n  void equalToDateTimeWithMinimalParametersValidates() {\n    assertThat(validate(equalToDateTime(\"2018-05-05T00:11:22Z\")), empty());\n    assertThat(validate(\"{ \\\"equalToDateTime\\\": 55 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void equalToDateTimeWithAllParametersValidates() {\n    assertThat(\n        validate(\n            equalToDateTime(\"2018-05-05T00:11:22Z\")\n                .actualFormat(\"yyyy-MM-dd\")\n                .expectedOffset(3, DAYS)\n                .truncateExpected(FIRST_DAY_OF_MONTH)\n                .truncateActual(LAST_DAY_OF_MONTH)),\n        empty());\n\n    assertThat(\n        validate(\n            \"{\\n\"\n                + \"  \\\"equalToDateTime\\\" : \\\"now +3 days\\\",\\n\"\n                + \"  \\\"actualFormat\\\" : \\\"yyyy-MM-dd\\\",\\n\"\n                + \"  \\\"truncateExpected\\\" : true,\\n\"\n                + \"  \\\"truncateActual\\\" : \\\"last day of month\\\"\\n\"\n                + \"}\"),\n        Matchers.not(empty()));\n  }\n\n  @Test\n  void tmp() {\n    System.out.println(\n        Json.write(\n            matchingXPath(\n                \"//Order/Quantity\",\n                Map.of(\"one\", \"https://example.com/one\", \"two\", \"https://example.com/two\"))));\n  }\n\n  @Test\n  void afterValidates() {\n    assertThat(validate(after(\"2018-05-05T00:11:22Z\")), empty());\n    assertThat(validate(\"{ \\\"after\\\": 55 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void absentValidates() {\n    assertThat(validate(absent()), empty());\n    assertThat(validate(\"{ \\\"absent\\\": 11 }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void and_containsValidates() {\n    assertThat(validate(containing(\"abc\").and(containing(\"123\"))), empty());\n\n    assertThat(\n        validate(\n            \"{\\n\"\n                + \"  \\\"and\\\": [\\n\"\n                + \"    {\\n\"\n                + \"      \\\"contains\\\": \\\"abc\\\"\\n\"\n                + \"    },\\n\"\n                + \"    \\\"wrong\\\"\\n\"\n                + \"  ]\\n\"\n                + \"}\"),\n        Matchers.not(empty()));\n  }\n\n  @Test\n  void or_containsValidates() {\n    assertThat(validate(containing(\"abc\").or(containing(\"123\"))), empty());\n\n    assertThat(\n        validate(\n            \"{\\n\"\n                + \"  \\\"or\\\": [\\n\"\n                + \"    {\\n\"\n                + \"      \\\"contains\\\": \\\"abc\\\"\\n\"\n                + \"    },\\n\"\n                + \"    \\\"wrong\\\"\\n\"\n                + \"  ]\\n\"\n                + \"}\"),\n        Matchers.not(empty()));\n  }\n\n  @Test\n  void hasExactlyValidates() {\n    assertThat(validate(havingExactly(equalTo(\"1\"), containing(\"2\"))), empty());\n    assertThat(validate(\"{ \\\"hasExactly\\\": \\\"blah\\\" }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void includesExactlyValidates() {\n    assertThat(validate(including(equalTo(\"1\"), containing(\"2\"))), empty());\n    assertThat(validate(\"{ \\\"includes\\\": \\\"blah\\\" }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void equalToNumberValidates() {\n    assertThat(validate(equalToNumber(RandomUtils.insecure().randomDouble())), empty());\n    assertThat(validate(\"{ \\\"equalToNumber\\\": \\\"not a number\\\" }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void greaterThanNumberValidates() {\n    assertThat(validate(greaterThanNumber(RandomUtils.insecure().randomDouble())), empty());\n    assertThat(validate(\"{ \\\"greaterThanNumber\\\": \\\"not a number\\\" }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void greaterThanEqualNumberValidates() {\n    assertThat(validate(greaterThanEqualNumber(RandomUtils.insecure().randomDouble())), empty());\n    assertThat(validate(\"{ \\\"greaterThanEqualNumber\\\": \\\"not a number\\\" }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void lessThanNumberValidates() {\n    assertThat(validate(lessThanNumber(RandomUtils.insecure().randomDouble())), empty());\n    assertThat(validate(\"{ \\\"lessThanNumber\\\": \\\"not a number\\\" }\"), Matchers.not(empty()));\n  }\n\n  @Test\n  void lessThanEqualNumberValidates() {\n    assertThat(validate(lessThanEqualNumber(RandomUtils.insecure().randomDouble())), empty());\n    assertThat(validate(\"{ \\\"lessThanEqualNumber\\\": \\\"not a number\\\" }\"), Matchers.not(empty()));\n  }\n\n  private static Set<ValidationMessage> validate(Object obj) {\n    return schema.validate(Json.write(obj), InputFormat.JSON);\n  }\n\n  private static Set<ValidationMessage> validate(String json) {\n    return schema.validate(json, InputFormat.JSON);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/CookieMatchingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.COOKIE;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItem;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class CookieMatchingAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void matchesOnWellFormedCookie() {\n    stubFor(\n        get(urlEqualTo(\"/good/cookie\"))\n            .withCookie(\"my_cookie\", containing(\"mycookievalue\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.get(\"/good/cookie\", withHeader(COOKIE, \"my_cookie=xxx-mycookievalue-xxx\"));\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void matchesWhenMultipleCookiesAreSentAndRequired() {\n    stubFor(\n        get(urlEqualTo(\"/good/cookies\"))\n            .withCookie(\"my_cookie\", containing(\"mycookievalue\"))\n            .withCookie(\"my_other_cookie\", equalTo(\"exact-other-value\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.get(\n            \"/good/cookies\",\n            withHeader(\n                COOKIE,\n                \"my_cookie=xxx-mycookievalue-xxx; my_other_cookie=exact-other-value; irrelevant_cookie=whatever\"));\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void doesNotMatchWhenExpectedCookieIsAbsent() {\n    stubFor(\n        get(urlEqualTo(\"/missing/cookie\"))\n            .withCookie(\"my_cookie\", containing(\"mycookievalue\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.get(\n            \"/missing/cookie\", withHeader(COOKIE, \"the_wrong_cookie=xxx-mycookievalue-xxx\"));\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  public void doesNotMatchWhenExpectedCookieHasTheWrongValue() {\n    stubFor(\n        get(urlEqualTo(\"/bad/cookie\"))\n            .withCookie(\"my_cookie\", containing(\"mycookievalue\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.get(\"/bad/cookie\", withHeader(COOKIE, \"my_cookie=youwontfindthis\"));\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  public void doesNotMatchWhenExpectedCookieIsMalformed() {\n    stubFor(\n        get(urlEqualTo(\"/very-bad/cookie\"))\n            .withCookie(\"my_cookie\", containing(\"mycookievalue\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.get(\n            \"/very-bad/cookie\", withHeader(COOKIE, \"my_cookieyouwontfindthis;;sldfjskldjf%%\"));\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  public void matchesWhenRequiredAbsentCookieIsAbsent() {\n    stubFor(\n        get(urlEqualTo(\"/absent/cookie\"))\n            .withCookie(\"not_this_cookie\", absent())\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.get(\n            \"/absent/cookie\",\n            withHeader(\n                COOKIE,\n                \"my_cookie=xxx-mycookievalue-xxx; my_other_cookie=exact-other-value; irrelevant_cookie=whatever\"));\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void doesNotMatchWhenRequiredAbsentCookieIsPresent() {\n    stubFor(\n        get(urlEqualTo(\"/absent/cookie\"))\n            .withCookie(\"my_cookie\", absent())\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.get(\n            \"/absent/cookie\",\n            withHeader(\n                COOKIE,\n                \"my_cookie=xxx-mycookievalue-xxx; my_other_cookie=exact-other-value; irrelevant_cookie=whatever\"));\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  public void revealsCookiesInLoggedRequests() {\n    testClient.get(\n        \"/good/cookies\",\n        withHeader(\n            COOKIE,\n            \"my_cookie=xxx-mycookievalue-xxx; my_other_cookie=exact-other-value; irrelevant_cookie=whatever\"));\n\n    List<LoggedRequest> requests = findAll(getRequestedFor(urlEqualTo(\"/good/cookies\")));\n\n    assertThat(requests.size(), is(1));\n    assertThat(requests.get(0).getCookies().keySet(), hasItem(\"my_other_cookie\"));\n  }\n\n  @Test\n  public void matchesWhenRequiredCookieSentAsDuplicate() {\n    stubFor(\n        get(urlEqualTo(\"/duplicate/cookie\"))\n            .withCookie(\"my_cookie\", containing(\"mycookievalue\"))\n            .withCookie(\"my_other_cookie\", equalTo(\"value-2\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.get(\n            \"/duplicate/cookie\",\n            withHeader(\n                COOKIE,\n                \"my_cookie=xxx-mycookievalue-xxx; my_other_cookie=value-1; my_other_cookie=value-2\"));\n\n    assertThat(response.statusCode(), is(200));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/CrossOriginTest.java",
    "content": "/*\n * Copyright (C) 2016-2022 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.any;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.nullValue;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class CrossOriginTest {\n\n  @Nested\n  public static class Enabled {\n\n    @RegisterExtension\n    public WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(wireMockConfig().dynamicPort().stubCorsEnabled(true))\n            .build();\n\n    WireMockTestClient testClient;\n\n    @BeforeEach\n    public void init() {\n      testClient = new WireMockTestClient(wm.getPort());\n    }\n\n    @Test\n    public void sendsCorsHeadersInResponseToAdminOPTIONSQuery() {\n      WireMockResponse response =\n          testClient.options(\n              \"/__admin/\",\n              withHeader(\"Origin\", \"http://my.corp.com\"),\n              withHeader(\"Access-Control-Request-Method\", \"POST\"));\n\n      assertThat(response.statusCode(), is(200));\n      assertThat(response.firstHeader(\"Access-Control-Allow-Origin\"), is(\"http://my.corp.com\"));\n      assertThat(\n          response.firstHeader(\"Access-Control-Allow-Methods\"),\n          is(\"OPTIONS,GET,POST,PUT,PATCH,DELETE\"));\n    }\n\n    @Test\n    public void sendsCorsHeadersInResponseToStubOPTIONSQuery() {\n      wm.stubFor(any(urlEqualTo(\"/cors\")).willReturn(ok()));\n\n      WireMockResponse response =\n          testClient.options(\n              \"/cors\",\n              withHeader(\"Origin\", \"http://my.corp.com\"),\n              withHeader(\"Access-Control-Request-Method\", \"POST\"));\n\n      assertThat(response.statusCode(), is(200));\n      assertThat(response.firstHeader(\"Access-Control-Allow-Origin\"), is(\"http://my.corp.com\"));\n      assertThat(\n          response.firstHeader(\"Access-Control-Allow-Methods\"),\n          is(\"OPTIONS,GET,POST,PUT,PATCH,DELETE\"));\n    }\n  }\n\n  @Nested\n  public static class Disabled {\n\n    @RegisterExtension\n    public WireMockExtension wm =\n        WireMockExtension.newInstance().options(wireMockConfig().dynamicPort()).build();\n\n    WireMockTestClient testClient;\n\n    @BeforeEach\n    public void init() {\n      testClient = new WireMockTestClient(wm.getPort());\n    }\n\n    @Test\n    public void doesNotSendCorsHeadersInResponseToStubOPTIONSQuery() {\n      wm.stubFor(any(urlEqualTo(\"/cors\")).willReturn(ok()));\n\n      WireMockResponse response =\n          testClient.options(\n              \"/cors\",\n              withHeader(\"Origin\", \"http://my.corp.com\"),\n              withHeader(\"Access-Control-Request-Method\", \"POST\"));\n\n      assertThat(response.statusCode(), is(200));\n      assertThat(response.firstHeader(\"Access-Control-Allow-Origin\"), nullValue());\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/CustomMatchingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2015-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.AdminException;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.matching.CustomMatcherDefinition;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcher;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class CustomMatchingAcceptanceTest {\n\n  @SuppressWarnings(\"unchecked\")\n  @RegisterExtension\n  public WireMockExtension wmRule =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .extensions(\n                      MyExtensionRequestMatcher.class, MyPathParameterAwareRequestMatcher.class))\n          .failOnUnmatchedRequests(false)\n          .build();\n\n  WireMockTestClient client;\n  WireMock wm;\n\n  @BeforeEach\n  public void init() {\n    client = new WireMockTestClient(wmRule.getPort());\n    wm = WireMock.create().port(wmRule.getPort()).build();\n  }\n\n  @Test\n  public void customRequestMatcherCanBeDefinedAsClass() {\n    wmRule.stubFor(requestMatching(new MyRequestMatcher()).willReturn(aResponse().withStatus(200)));\n    assertThat(client.get(\"/correct\").statusCode(), is(200));\n    assertThat(client.get(\"/wrong\").statusCode(), is(404));\n  }\n\n  @Test\n  public void customRequestMatcherCanBeDefinedInline() {\n    wmRule.stubFor(\n        requestMatching(\n                new RequestMatcher() {\n                  @Override\n                  public MatchResult match(Request request) {\n                    return MatchResult.of(request.getUrl().contains(\"correct\"));\n                  }\n\n                  @Override\n                  public String getName() {\n                    return \"inline\";\n                  }\n                })\n            .willReturn(aResponse().withStatus(200)));\n\n    assertThat(client.get(\"/correct\").statusCode(), is(200));\n    assertThat(client.get(\"/wrong\").statusCode(), is(404));\n  }\n\n  @Test\n  public void customRequestMatcherCanBeSpecifiedAsNamedExtension() {\n    wm.register(\n        requestMatching(\"path-contains-param\", Parameters.one(\"path\", \"findthis\"))\n            .willReturn(aResponse().withStatus(200)));\n    assertThat(client.get(\"/findthis/thing\").statusCode(), is(200));\n  }\n\n  @Test\n  public void inlineCustomRequestMatcherCanBeCombinedWithStandardMatchers() {\n    wmRule.stubFor(\n        get(urlPathMatching(\"/the/.*/one\")).andMatching(new MyRequestMatcher()).willReturn(ok()));\n\n    assertThat(client.get(\"/the/correct/one\").statusCode(), is(200));\n    assertThat(client.get(\"/the/wrong/one\").statusCode(), is(404));\n    assertThat(client.postJson(\"/the/correct/one\", \"{}\").statusCode(), is(404));\n  }\n\n  @Test\n  public void namedCustomRequestMatcherCanBeCombinedWithStandardMatchers() {\n    wm.register(\n        get(urlPathMatching(\"/the/.*/one\"))\n            .andMatching(\"path-contains-param\", Parameters.one(\"path\", \"correct\"))\n            .willReturn(ok()));\n\n    assertThat(client.get(\"/the/correct/one\").statusCode(), is(200));\n    assertThat(client.get(\"/the/wrong/one\").statusCode(), is(404));\n    assertThat(client.postJson(\"/the/correct/one\", \"{}\").statusCode(), is(404));\n  }\n\n  @Test\n  public void customMatcherDefinitionCanBeCombinedWithStandardMatchers() {\n    wm.register(\n        get(urlPathMatching(\"/the/.*/one\"))\n            .andMatching(\n                new CustomMatcherDefinition(\n                    \"path-contains-param\", Parameters.one(\"path\", \"correct\")))\n            .willReturn(ok()));\n\n    assertThat(client.get(\"/the/correct/one\").statusCode(), is(200));\n    assertThat(client.get(\"/the/wrong/one\").statusCode(), is(404));\n    assertThat(client.postJson(\"/the/correct/one\", \"{}\").statusCode(), is(404));\n  }\n\n  @Test\n  void customMatcherCanMakeUseOfPathParameters() {\n    wm.register(\n        get(urlPathTemplate(\"/things/{thingId}\"))\n            .andMatching(\"path-aware-matcher\")\n            .willReturn(ok()));\n\n    assertThat(client.get(\"/things/123\").statusCode(), is(200));\n    assertThat(client.get(\"/things/456\").statusCode(), is(404));\n  }\n\n  @Test\n  void customMatcherCanBeUsedDuringVerification() {\n    client.get(\"/things/123\");\n    wm.verifyThat(\n        getRequestedFor(urlPathTemplate(\"/things/{thingId}\")).andMatching(\"path-aware-matcher\"));\n\n    wm.resetRequests();\n\n    client.get(\"/things/456\");\n    wm.verifyThat(\n        0, getRequestedFor(urlPathTemplate(\"/things/{thingId}\")).andMatching(\"path-aware-matcher\"));\n  }\n\n  @Test\n  public void throwsExceptionIfInlineCustomMatcherUsedWithRemote() {\n    assertThrows(\n        AdminException.class,\n        () ->\n            wm.register(\n                get(urlPathMatching(\"/the/.*/one\"))\n                    .andMatching(new MyRequestMatcher())\n                    .willReturn(ok())));\n  }\n\n  public static class MyRequestMatcher extends RequestMatcherExtension {\n\n    @Override\n    public MatchResult match(Request request, Parameters parameters) {\n      return MatchResult.of(request.getUrl().contains(\"correct\"));\n    }\n  }\n\n  public static class MyExtensionRequestMatcher extends RequestMatcherExtension {\n\n    @Override\n    public MatchResult match(Request request, Parameters parameters) {\n      String pathSegment = parameters.getString(\"path\");\n      return MatchResult.of(request.getUrl().contains(pathSegment));\n    }\n\n    @Override\n    public String getName() {\n      return \"path-contains-param\";\n    }\n  }\n\n  public static class MyPathParameterAwareRequestMatcher extends RequestMatcherExtension {\n\n    @Override\n    public String getName() {\n      return \"path-aware-matcher\";\n    }\n\n    @Override\n    public MatchResult match(Request request, Parameters parameters) {\n      return MatchResult.of(\"123\".equals(request.getPathParameters().get(\"thingId\")));\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/DateHeaderAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.contains;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.Test;\n\npublic class DateHeaderAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void returnsOnlyStubbedDateHeader() {\n\n    stubFor(\n        get(urlEqualTo(\"/stubbed/dateheader\"))\n            .willReturn(\n                aResponse().withStatus(200).withHeader(\"Date\", \"Sun, 06 Nov 1994 08:49:37 GMT\")));\n\n    WireMockResponse response = testClient.get(\"/stubbed/dateheader\");\n\n    assertThat(response.headers().get(\"Date\"), contains(\"Sun, 06 Nov 1994 08:49:37 GMT\"));\n  }\n\n  @Test\n  public void returnsNoDateHeaderIfNotStubbed() {\n\n    stubFor(get(urlEqualTo(\"/nodateheader\")).willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response = testClient.get(\"/nodateheader\");\n\n    assertThat(response.headers().get(\"Date\"), is(Matchers.empty()));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/DeadlockTest.java",
    "content": "/*\n * Copyright (C) 2019-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.fail;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.HttpURLConnection;\nimport java.net.SocketTimeoutException;\nimport java.net.URL;\nimport java.util.concurrent.TimeUnit;\nimport org.junit.jupiter.api.*;\nimport org.junit.jupiter.api.MethodOrderer.OrderAnnotation;\n\n@TestMethodOrder(OrderAnnotation.class)\npublic class DeadlockTest {\n\n  private static final int READ_TIMEOUT = 500;\n\n  private static WireMockServer wireMockServer;\n\n  @BeforeAll\n  public static void setUp() {\n    wireMockServer = new WireMockServer(options().dynamicPort().dynamicHttpsPort());\n    wireMockServer.start();\n  }\n\n  @AfterAll\n  public static void tearDown() {\n    wireMockServer.stop();\n  }\n\n  @BeforeEach\n  public void reset() {\n    wireMockServer.resetAll();\n  }\n\n  @Test\n  @Order(1)\n  public void test1Timeout() throws IOException {\n    System.out.println(\"test timeout start\");\n\n    wireMockServer.stubFor(\n        get(urlEqualTo(\"/timeout\"))\n            .willReturn(aResponse().withFixedDelay(2 * READ_TIMEOUT).withBody(\"body1\")));\n\n    downloadContentAndMeasure(\"/timeout\", null);\n\n    System.out.println(\"test timeout end\");\n  }\n\n  // This will fail with a timeout if acceptor count is < 3 and/or threads < 13\n  @Test\n  @Order(2)\n  public void test2GetContent() throws IOException {\n    System.out.println(\"test content start\");\n\n    wireMockServer.stubFor(get(urlEqualTo(\"/content\")).willReturn(aResponse().withBody(\"body2\")));\n    System.out.println(\"test content stub\");\n\n    downloadContentAndMeasure(\"/content\", \"body2\");\n\n    System.out.println(\"test content end\");\n  }\n\n  private void downloadContentAndMeasure(String urlDir, String expectedBody) throws IOException {\n    System.out.printf(\"downloadContentAndMeasure urlDir=%s\", urlDir);\n\n    final long start = System.currentTimeMillis();\n\n    boolean exceptionOccurred = false;\n    try {\n      final String url = \"http://localhost:\" + wireMockServer.port() + urlDir;\n      final HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();\n      connection.setConnectTimeout(2000);\n      connection.setReadTimeout(READ_TIMEOUT);\n      connection.setDoInput(true);\n      if (expectedBody == null) {\n        try {\n          httpGetContent(connection);\n          fail(\"Expected SocketTimeoutException\");\n        } catch (Exception e) {\n          assertThat(e, instanceOf(SocketTimeoutException.class));\n        }\n      } else {\n        final String body = httpGetContent(connection);\n        assertEquals(expectedBody, body);\n      }\n    } catch (Exception e) {\n      exceptionOccurred = true;\n      System.out.printf(\n          \"exception '%s' after ms %s\",\n          e.getMessage(), TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - start));\n      throw e;\n    } finally {\n      if (!exceptionOccurred) {\n        System.out.printf(\n            \"downloaded at ms %s\",\n            TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - start));\n      }\n    }\n  }\n\n  private String httpGetContent(HttpURLConnection connection) throws IOException {\n    try (InputStream is = connection.getInputStream()) {\n      StringBuilder sb = new StringBuilder();\n      for (int ch; (ch = is.read()) != -1; ) {\n        sb.append((char) ch);\n      }\n      return sb.toString();\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/DebugHeadersAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.any;\nimport static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.nullValue;\n\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\n\npublic class DebugHeadersAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void returnsMatchedStubIdHeaderWhenStubMatched() {\n    UUID stubId = UUID.randomUUID();\n    wireMockServer.stubFor(get(\"/the-match\").withId(stubId).willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/the-match\");\n\n    assertThat(response.firstHeader(\"Matched-Stub-Id\"), is(stubId.toString()));\n    assertThat(response.firstHeader(\"Matched-Stub-Name\"), nullValue());\n  }\n\n  @Test\n  public void returnsMatchedStubNameHeaderWhenNamedStubMatched() {\n    UUID stubId = UUID.randomUUID();\n    String name = \"My Stub\";\n\n    wireMockServer.stubFor(get(\"/the-match\").withId(stubId).withName(name).willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/the-match\");\n\n    assertThat(response.firstHeader(\"Matched-Stub-Id\"), is(stubId.toString()));\n    assertThat(response.firstHeader(\"Matched-Stub-Name\"), is(name));\n  }\n\n  @Test\n  public void doesNotReturnEitherHeaderIfNoStubMatched() {\n    WireMockResponse response = testClient.get(\"/the-non-match\");\n\n    assertThat(response.firstHeader(\"Matched-Stub-Id\"), nullValue());\n    assertThat(response.firstHeader(\"Matched-Stub-Name\"), nullValue());\n  }\n\n  @Test\n  public void nonAsciiCharactersAreReplacedByQuestionMarksInStubNameHeader() {\n    wireMockServer.stubFor(any(anyUrl()).withName(\"start Запрос ?? åéã end\").willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/the-match\");\n    assertThat(response.firstHeader(\"Matched-Stub-Name\"), is(\"start ?????? ?? ??? end\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/DelayAndCustomMatcherAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2022 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.greaterThanOrEqualTo;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformer;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport com.google.common.base.Stopwatch;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class DelayAndCustomMatcherAcceptanceTest {\n\n  @RegisterExtension\n  public WireMockExtension wireMockRule =\n      WireMockExtension.newInstance()\n          .configureStaticDsl(true)\n          .options(options().dynamicPort().extensions(BodyChanger.class))\n          .build();\n\n  @Test\n  public void delayIsAddedWhenCustomResponseTransformerPresent() {\n    stubFor(\n        get(urlEqualTo(\"/delay-this\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withTransformers(\"response-body-changer\")\n                    .withUniformRandomDelay(500, 1000)));\n\n    WireMockTestClient client = new WireMockTestClient(wireMockRule.getPort());\n\n    Stopwatch stopwatch = Stopwatch.createStarted();\n    WireMockResponse response = client.get(\"/delay-this\");\n    stopwatch.stop();\n\n    assertThat(stopwatch.elapsed(MILLISECONDS), greaterThanOrEqualTo(500L));\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"Transformed body\"));\n  }\n\n  public static class BodyChanger extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return ResponseDefinitionBuilder.like(responseDefinition)\n          .but()\n          .withBody(\"Transformed body\")\n          .build();\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return false;\n    }\n\n    @Override\n    public String getName() {\n      return \"response-body-changer\";\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/EditMappingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport org.junit.jupiter.api.Test;\n\npublic class EditMappingAcceptanceTest extends AcceptanceTestBase {\n\n  public static final String MAPPING_REQUEST_WITH_UUID =\n      \"{ \t\"\n          + \"\t\\\"id\\\":\\\"bff18359-a74e-4c3e-95f0-dab304cd3a5a\\\",\t\\n\"\n          + \"\t\\\"request\\\": {\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"url\\\": \\\"/a/registered/resource\\\"\t\t\t\t\\n\"\n          + \"\t},\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\\\"response\\\": {\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"status\\\": 401,\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"headers\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\t\\\"Content-Type\\\": \\\"text/plain\\\"\t\t\t\\n\"\n          + \"\t\t},\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"body\\\": \\\"Not allowed!\\\"\t\t\t\t\t\t\\n\"\n          + \"\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\";\n\n  public static final String MODIFY_MAPPING_REQUEST_WITH_UUID =\n      \"{ \t\"\n          + \"\t\\\"id\\\":\\\"bff18359-a74e-4c3e-95f0-dab304cd3a5a\\\",\t\\n\"\n          + \"\t\\\"request\\\": {\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"url\\\": \\\"/a/registered/resource\\\"\t\t\t\t\\n\"\n          + \"\t},\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\\\"response\\\": {\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"status\\\": 200,\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"headers\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\t\\\"Content-Type\\\": \\\"text/html\\\"\t\t\t\t\\n\"\n          + \"\t\t},\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"body\\\": \\\"OK\\\"\t\t\t\t\t\t\t\t\\n\"\n          + \"\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\";\n\n  @Test\n  public void editMappingViaTheJsonApi() {\n\n    testClient.addResponse(MAPPING_REQUEST_WITH_UUID);\n    WireMockResponse response = testClient.get(\"/a/registered/resource\");\n\n    assertThat(response.statusCode(), is(401));\n    assertThat(response.content(), is(\"Not allowed!\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n\n    testClient.editMapping(MODIFY_MAPPING_REQUEST_WITH_UUID);\n\n    response = testClient.get(\"/a/registered/resource\");\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"OK\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/html\"));\n  }\n\n  @Test\n  public void editMappingViaTheDsl() {\n    StubMapping stubMapping =\n        stubFor(get(urlEqualTo(\"/edit/this\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(testClient.get(\"/edit/this\").statusCode(), is(200));\n\n    editStub(\n        get(urlEqualTo(\"/edit/this\"))\n            .withId(stubMapping.getId())\n            .willReturn(aResponse().withStatus(418)));\n\n    assertThat(testClient.get(\"/edit/this\").statusCode(), is(418));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/EditStubMappingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.UUID;\nimport java.util.function.Predicate;\nimport org.junit.jupiter.api.Test;\n\npublic class EditStubMappingAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void canEditAnExistingStubMapping() {\n    UUID id = UUID.randomUUID();\n\n    wireMockServer.stubFor(\n        get(urlEqualTo(\"/edit-this\")).withId(id).willReturn(aResponse().withBody(\"Original\")));\n\n    assertThat(testClient.get(\"/edit-this\").content(), is(\"Original\"));\n\n    wireMockServer.editStub(\n        get(urlEqualTo(\"/edit-this\")).withId(id).willReturn(aResponse().withBody(\"Modified\")));\n\n    assertThat(testClient.get(\"/edit-this\").content(), is(\"Modified\"));\n\n    int editThisStubCount =\n        (int)\n            wireMockServer.listAllStubMappings().getMappings().stream()\n                .filter(withUrl(\"/edit-this\"))\n                .count();\n\n    assertThat(editThisStubCount, is(1));\n  }\n\n  private Predicate<StubMapping> withUrl(final String url) {\n    return mapping ->\n        (mapping.getRequest().getUrl() != null && mapping.getRequest().getUrl().equals(url));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ExtensionFactoryTest.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.defaultTestFilesRoot;\nimport static net.javacrumbs.jsonunit.JsonMatchers.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.endsWith;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.admin.Router;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.extension.*;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.File;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ExtensionFactoryTest {\n\n  WireMockServer wm;\n  WireMockTestClient client;\n\n  @AfterEach\n  void stopServer() {\n    if (wm != null) {\n      wm.stop();\n    }\n  }\n\n  @Test\n  void injectsCoreServicesOnConstructionByFactory() {\n    initialiseWireMockServer(\n        options()\n            .dynamicPort()\n            .withRootDirectory(defaultTestFilesRoot())\n            .stubCorsEnabled(true)\n            .templatingEnabled(false)\n            .extensionScanningEnabled(true)\n            .extensions(\n                services ->\n                    List.of(\n                        new MiscInfoApi(\n                            services.getAdmin(),\n                            services.getOptions(),\n                            services.getStores(),\n                            services.getFiles(),\n                            services.getExtensions()))));\n\n    client.get(\"/something\");\n    client.get(\"/something\");\n\n    String content = client.get(\"/__admin/misc-info\").content();\n\n    assertThat(content, jsonPartEquals(\"example1\", \"Example 1\"));\n    assertThat(\n        content,\n        jsonPartMatches(\"fileSourcePath\", endsWith(\"test-file-root\" + File.separator + \"__files\")));\n    assertThat(content, jsonPartEquals(\"requestCount\", 2));\n    assertThat(content, jsonPartEquals(\"stubCorsEnabled\", true));\n    assertThat(\n        content, jsonPartEquals(\"extensionCount\", 7)); // Includes the service loaded extensions\n  }\n\n  @Test\n  void usesExtensionFactoryLoadedViaServiceLoaderWhenEnabled() {\n    initialiseWireMockServer(\n        options()\n            .dynamicPort()\n            .extensionScanningEnabled(true)\n            .withRootDirectory(defaultTestFilesRoot())\n            .templatingEnabled(false));\n\n    wm.stubFor(get(\"/transform-this\").willReturn(noContent().withTransformers(\"loader-test\")));\n\n    client.get(\"/just-count-this\");\n\n    assertThat(client.get(\"/transform-this\").content(), is(\"Request count 1\"));\n  }\n\n  @Test\n  void doesNotUseExtensionFactoryLoadedViaServiceLoaderByDefault() {\n    initialiseWireMockServer(\n        options().dynamicPort().withRootDirectory(defaultTestFilesRoot()).templatingEnabled(false));\n\n    wm.stubFor(get(\"/transform-this\").willReturn(noContent().withTransformers(\"loader-test\")));\n\n    client.get(\"/just-count-this\");\n\n    assertThat(client.get(\"/transform-this\").statusCode(), is(204));\n  }\n\n  @Test\n  void usesExtensionInstanceLoadedViaServiceLoader() {\n    initialiseWireMockServer(\n        options()\n            .dynamicPort()\n            .extensionScanningEnabled(true)\n            .withRootDirectory(defaultTestFilesRoot())\n            .templatingEnabled(false));\n\n    wm.stubFor(\n        get(\"/transform-this\").willReturn(noContent().withTransformers(\"instance-loader-test\")));\n\n    assertThat(client.get(\"/transform-this\").content(), is(\"Expected stuff\"));\n  }\n\n  @Test\n  @SuppressWarnings(\"unchecked\")\n  void usesExtensionFactoryLoadedAsClass() {\n    initialiseWireMockServer(\n        options().dynamicPort().extensionFactories(HeaderAddingExtensionFactory.class));\n\n    wm.stubFor(any(anyUrl()).willReturn(ok()));\n\n    WireMockResponse response = client.get(\"/test\");\n\n    assertThat(response.firstHeader(\"added-header\"), is(\"present\"));\n  }\n\n  private void initialiseWireMockServer(WireMockConfiguration options) {\n    wm = new WireMockServer(options);\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  public static class MiscInfoApi implements AdminApiExtension {\n\n    private final Admin admin;\n    private final Options options;\n    private final Stores stores;\n    private final FileSource fileSource;\n\n    private final Extensions extensions;\n\n    public MiscInfoApi(\n        Admin admin, Options options, Stores stores, FileSource fileSource, Extensions extensions) {\n      this.admin = admin;\n      this.options = options;\n      this.stores = stores;\n      this.fileSource = fileSource;\n      this.extensions = extensions;\n    }\n\n    @Override\n    public String getName() {\n      return \"request-counter\";\n    }\n\n    @Override\n    public void contributeAdminApiRoutes(Router router) {\n      router.add(\n          GET,\n          \"/misc-info\",\n          (ignored, serveEvent, pathParams) -> {\n            String example1 =\n                Strings.stringFromBytes(stores.getFilesBlobStore().get(\"plain-example1.txt\").get());\n            String fileSourcePath = fileSource.getPath();\n            int requestCount = admin.getServeEvents().getRequests().size();\n            return ResponseDefinition.okForJson(\n                Map.of(\n                    \"example1\", example1,\n                    \"fileSourcePath\", fileSourcePath,\n                    \"requestCount\", requestCount,\n                    \"stubCorsEnabled\", options.getStubCorsEnabled(),\n                    \"extensionCount\", extensions.getCount()));\n          });\n    }\n  }\n\n  public static class HeaderAddingExtensionFactory implements ExtensionFactory {\n\n    @Override\n    public List<Extension> create(WireMockServices services) {\n      return List.of(\n          new ResponseDefinitionTransformerV2() {\n            @Override\n            public ResponseDefinition transform(ServeEvent serveEvent) {\n              return ResponseDefinitionBuilder.like(serveEvent.getResponseDefinition())\n                  .withHeader(\"added-header\", \"present\")\n                  .build();\n            }\n\n            @Override\n            public boolean applyGlobally() {\n              return true;\n            }\n\n            @Override\n            public String getName() {\n              return \"add-header\";\n            }\n          });\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/FailingWebhookTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.wiremock.webhooks.Webhooks.webhook;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.PostServeAction;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.github.tomakehurst.wiremock.testsupport.ThrowingWebhookTransformer;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.CountDownLatch;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class FailingWebhookTest extends WebhooksAcceptanceTest {\n\n  @RegisterExtension\n  public WireMockExtension targetServer =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .extensions(\n                      new PostServeAction() {\n                        @Override\n                        public void doGlobalAction(ServeEvent serveEvent, Admin admin) {\n                          if (serveEvent.getRequest().getUrl().startsWith(\"/callback\")) {\n                            latch.countDown();\n                          }\n                        }\n\n                        @Override\n                        public String getName() {\n                          return \"test-latch\";\n                        }\n                      }))\n          .build();\n\n  WireMockTestClient client;\n\n  @RegisterExtension\n  public WireMockExtension requestThrowingExtension =\n      WireMockExtension.newInstance()\n          .configureStaticDsl(true)\n          .options(\n              options()\n                  .dynamicPort()\n                  .notifier(testNotifier)\n                  .extensions(new ThrowingWebhookTransformer()))\n          .build();\n\n  @RegisterExtension\n  public WireMockExtension fakeHttpClientFactoryExtension =\n      WireMockExtension.newInstance()\n          .configureStaticDsl(true)\n          .options(\n              options()\n                  .dynamicPort()\n                  .notifier(testNotifier)\n                  .extensions(new FakeHttpClientFactory()))\n          .build();\n\n  @BeforeEach\n  public void init() {\n    testNotifier.reset();\n    targetServer.stubFor(post(\"/callback\").willReturn(ok()));\n    latch = new CountDownLatch(1);\n    client = new WireMockTestClient(requestThrowingExtension.getPort());\n    WireMock.configureFor(targetServer.getPort());\n  }\n\n  @Test\n  public void failWhenCreatingWebhookRequestAddsSubEvent() throws Exception {\n    requestThrowingExtension.stubFor(\n        post(urlPathEqualTo(\"/something-async\"))\n            .willReturn(ok())\n            .withPostServeAction(\n                \"webhook\",\n                webhook()\n                    .withMethod(POST)\n                    .withUrl(targetServer.url(\"/callback\"))\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withBody(\"{ \\\"result\\\": \\\"SUCCESS\\\" }\")));\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/something-async\");\n    assertFalse(latch.await(1, SECONDS));\n\n    printAllErrorNotifications();\n    assertThat(\"No webhook should have been made\", latch.getCount(), is(1L));\n\n    assertErrorMessage(\"Exception thrown while configuring webhook\");\n    List<SubEvent> subEvents =\n        new ArrayList<>(requestThrowingExtension.getAllServeEvents().get(0).getSubEvents());\n    assertThat(subEvents, hasSize(1));\n    assertSubEvent(\n        subEvents.get(0), SubEvent.ERROR, \"Exception thrown while configuring webhook: oh no\");\n  }\n\n  @Test\n  public void genericExceptionWhileMakingWebhookRequestAddsSubEvent() throws Exception {\n    fakeHttpClientFactoryExtension.stubFor(\n        post(urlPathEqualTo(\"/error\"))\n            .willReturn(ok())\n            .withPostServeAction(\n                \"webhook\",\n                webhook()\n                    .withMethod(POST)\n                    .withUrl(targetServer.url(\"/callback-errors\"))\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withBody(\"{ \\\"result\\\": \\\"ERROR\\\" }\")));\n\n    client = new WireMockTestClient(fakeHttpClientFactoryExtension.getPort());\n    client.post(\"/error\");\n    assertFalse(latch.await(1, SECONDS));\n\n    printAllErrorNotifications();\n    assertThat(\"No webhook should have been made\", latch.getCount(), is(1L));\n\n    assertErrorMessage(\"Failed to fire webhook POST \" + targetServer.url(\"/callback-errors\"));\n\n    // should be two sub events - the request and the error\n    List<SubEvent> subEvents =\n        new ArrayList<>(fakeHttpClientFactoryExtension.getAllServeEvents().get(0).getSubEvents());\n    assertThat(subEvents, hasSize(2));\n    Map<String, Object> expectedRequestEntries =\n        Map.of(\n            \"url\", \"/callback-errors\",\n            \"absoluteUrl\", targetServer.url(\"/callback-errors\"),\n            \"method\", \"POST\",\n            \"scheme\", \"http\",\n            \"body\", \"{ \\\"result\\\": \\\"ERROR\\\" }\");\n    assertSubEvent(subEvents.get(0), WEBHOOK_REQUEST_SUB_EVENT_NAME, expectedRequestEntries);\n    assertSubEvent(subEvents.get(1), SubEvent.ERROR, \"Connection refused\");\n  }\n\n  public static class FakeHttpClientFactory implements HttpClientFactory {\n\n    @Override\n    public HttpClient buildHttpClient(\n        Options options,\n        boolean trustAllCertificates,\n        List<String> trustedHosts,\n        boolean useSystemProperties) {\n      return new HttpClient() {\n        @Override\n        public Response execute(Request request) throws IOException {\n          throw new IOException(\"Connection refused\");\n        }\n      };\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/FaultsAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.http.Fault;\nimport java.net.SocketException;\nimport org.apache.hc.core5.http.MalformedChunkCodingException;\nimport org.apache.hc.core5.http.NoHttpResponseException;\nimport org.junit.jupiter.api.Test;\n\npublic class FaultsAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void connectionResetByPeerFault() {\n    stubFor(\n        get(urlEqualTo(\"/connection/reset\"))\n            .willReturn(aResponse().withFault(Fault.CONNECTION_RESET_BY_PEER)));\n\n    SocketException socketException =\n        assertThrows(SocketException.class, () -> testClient.get(\"/connection/reset\"));\n    assertThat(socketException.getMessage(), is(\"Connection reset\"));\n  }\n\n  @Test\n  public void emptyResponseFault() {\n    stubFor(\n        get(urlEqualTo(\"/empty/response\")).willReturn(aResponse().withFault(Fault.EMPTY_RESPONSE)));\n\n    assertThrows(NoHttpResponseException.class, () -> testClient.get(\"/empty/response\"));\n  }\n\n  @Test\n  public void malformedResponseChunkFault() {\n    stubFor(\n        get(urlEqualTo(\"/malformed/response\"))\n            .willReturn(aResponse().withFault(Fault.MALFORMED_RESPONSE_CHUNK)));\n\n    assertThrows(MalformedChunkCodingException.class, () -> testClient.get(\"/malformed/response\"));\n  }\n\n  @Test\n  public void randomDataOnSocketFault() {\n    stubFor(\n        get(urlEqualTo(\"/random/data\"))\n            .willReturn(aResponse().withFault(Fault.RANDOM_DATA_THEN_CLOSE)));\n\n    assertThrows(NoHttpResponseException.class, () -> testClient.get(\"/random/data\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/GlobalSettingsAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.givenThat;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.greaterThanOrEqualTo;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.LogNormal;\nimport org.junit.jupiter.api.Test;\n\npublic class GlobalSettingsAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void settingGlobalFixedResponseDelay() {\n    WireMock.setGlobalFixedDelay(500);\n    givenThat(\n        get(urlEqualTo(\"/globally/delayed/resource\")).willReturn(aResponse().withStatus(200)));\n\n    long start = System.currentTimeMillis();\n    testClient.get(\"/globally/delayed/resource\");\n    int duration = (int) (System.currentTimeMillis() - start);\n\n    assertThat(duration, greaterThanOrEqualTo(500));\n  }\n\n  @Test\n  public void settingGlobalRandomDistributionDelayCausesADelay() {\n    WireMock.setGlobalRandomDelay(new LogNormal(90, 0.1));\n    givenThat(\n        get(urlEqualTo(\"/globally/random/delayed/resource\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    long start = System.currentTimeMillis();\n    testClient.get(\"/globally/random/delayed/resource\");\n    int duration = (int) (System.currentTimeMillis() - start);\n\n    assertThat(duration, greaterThanOrEqualTo(60));\n  }\n\n  @Test\n  public void canCombineFixedAndRandomDelays() {\n    WireMock.setGlobalRandomDelay(new LogNormal(90, 0.1));\n    WireMock.setGlobalFixedDelay(30);\n    givenThat(\n        get(urlEqualTo(\"/globally/random/delayed/resource\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    long start = System.currentTimeMillis();\n    testClient.get(\"/globally/random/delayed/resource\");\n    int duration = (int) (System.currentTimeMillis() - start);\n\n    assertThat(duration, greaterThanOrEqualTo(90));\n  }\n\n  @Test\n  public void fetchSettings() {\n    WireMock.setGlobalFixedDelay(30);\n\n    GlobalSettings settings = WireMock.getSettings();\n\n    assertThat(settings.getFixedDelay(), is(30));\n  }\n\n  @Test\n  public void setAndRetrieveExtendedSettings() {\n    WireMock.updateSettings(\n        GlobalSettings.builder().extended(Parameters.one(\"mySetting\", \"setting-value\")).build());\n\n    GlobalSettings fetchedSettings = WireMock.getSettings();\n\n    assertThat(fetchedSettings.getExtended().getString(\"mySetting\"), is(\"setting-value\"));\n  }\n\n  @Test\n  public void setAndRetrieveProxyPassThroughSettings() {\n    WireMock.updateSettings(GlobalSettings.builder().proxyPassThrough(false).build());\n\n    GlobalSettings fetchedSettings = WireMock.getSettings();\n\n    assertFalse(fetchedSettings.getProxyPassThrough());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/GlobalSettingsListenerExtensionTest.java",
    "content": "/*\n * Copyright (C) 2019-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.nullValue;\nimport static org.junit.jupiter.api.Assertions.fail;\n\nimport com.github.tomakehurst.wiremock.common.ClientError;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport com.github.tomakehurst.wiremock.extension.GlobalSettingsListener;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class GlobalSettingsListenerExtensionTest {\n\n  @Nested\n  class Listening {\n\n    TestGlobalSettingsListener listener = new TestGlobalSettingsListener();\n\n    @RegisterExtension\n    public WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(options().dynamicPort().extensions(listener))\n            .build();\n\n    @BeforeEach\n    public void init() {\n      listener.events.clear();\n    }\n\n    @Test\n    public void callsListenerMethodWithBeforeAndAfterStatesWhenSettingsUpdated() {\n      wm.updateGlobalSettings(GlobalSettings.builder().fixedDelay(100).build());\n\n      listener.events.clear();\n\n      wm.updateGlobalSettings(GlobalSettings.builder().fixedDelay(200).build());\n\n      assertThat(listener.events.size(), is(2));\n      assertThat(listener.events.get(0), is(\"beforeGlobalSettingsUpdated, old: 100, new: 200\"));\n      assertThat(listener.events.get(1), is(\"afterGlobalSettingsUpdated, old: 100, new: 200\"));\n    }\n  }\n\n  public static class TestGlobalSettingsListener implements GlobalSettingsListener {\n\n    public List<String> events = new ArrayList<>();\n\n    @Override\n    public String getName() {\n      return \"test-settings-listener\";\n    }\n\n    @Override\n    public void beforeGlobalSettingsUpdated(\n        GlobalSettings oldSettings, GlobalSettings newSettings) {\n      events.add(\n          \"beforeGlobalSettingsUpdated, old: \"\n              + oldSettings.getFixedDelay()\n              + \", new: \"\n              + newSettings.getFixedDelay());\n    }\n\n    @Override\n    public void afterGlobalSettingsUpdated(GlobalSettings oldSettings, GlobalSettings newSettings) {\n      events.add(\n          \"afterGlobalSettingsUpdated, old: \"\n              + oldSettings.getFixedDelay()\n              + \", new: \"\n              + newSettings.getFixedDelay());\n    }\n  }\n\n  @Nested\n  class Vetoing {\n\n    @RegisterExtension\n    public WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(options().dynamicPort().extensions(new VetoingTestGlobalSettingsListener()))\n            .build();\n\n    @Test\n    public void settingsUpdateCanBeVetoedByThrowningAnException() {\n      try {\n        wm.updateGlobalSettings(GlobalSettings.builder().fixedDelay(100).build());\n        fail();\n      } catch (ClientError e) {\n        assertThat(e.getErrors().first().getTitle(), is(\"missing required element\"));\n        assertThat(wm.getGlobalSettings().getSettings().getFixedDelay(), nullValue());\n      }\n    }\n  }\n\n  public static class VetoingTestGlobalSettingsListener implements GlobalSettingsListener {\n\n    @Override\n    public String getName() {\n      return \"vetoing-settings-listener\";\n    }\n\n    @Override\n    public void beforeGlobalSettingsUpdated(\n        GlobalSettings oldSettings, GlobalSettings newSettings) {\n      throw JsonException.fromErrors(Errors.single(123, \"/one/two\", \"missing required element\"));\n    }\n\n    @Override\n    public void afterGlobalSettingsUpdated(\n        GlobalSettings oldSettings, GlobalSettings newSettings) {}\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/GzipAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.Gzip.gzip;\nimport static com.github.tomakehurst.wiremock.common.Gzip.unGzipToString;\nimport static com.github.tomakehurst.wiremock.common.Strings.randomAlphabetic;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assumptions.assumeTrue;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.apache.hc.client5.http.entity.GzipCompressingEntity;\nimport org.apache.hc.core5.http.ContentType;\nimport org.apache.hc.core5.http.HttpEntity;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\nimport org.eclipse.jetty.util.Jetty;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class GzipAcceptanceTest {\n\n  @Nested\n  class ChunkedTransferEncoding extends AcceptanceTestBase {\n\n    @Test\n    public void servesGzippedResponseForGet() {\n      wireMockServer.stubFor(\n          get(urlEqualTo(\"/gzip-response\")).willReturn(aResponse().withBody(\"body text\")));\n\n      WireMockResponse response =\n          testClient.get(\"/gzip-response\", withHeader(\"Accept-Encoding\", \"gzip,deflate\"));\n      assertThat(response.firstHeader(\"Content-Encoding\"), is(\"gzip\"));\n      assertThat(response.firstHeader(\"Transfer-Encoding\"), is(\"chunked\"));\n      assertThat(response.headers().containsKey(\"Content-Length\"), is(false));\n      assertThat(response.headers().containsKey(\"Vary\"), is(false));\n\n      byte[] gzippedContent = response.binaryContent();\n\n      String plainText = unGzipToString(gzippedContent);\n      assertThat(plainText, is(\"body text\"));\n    }\n\n    @Test\n    public void servesGzippedResponseForPost() {\n      wireMockServer.stubFor(post(\"/gzip-response\").willReturn(ok(\"body text\")));\n\n      WireMockResponse response =\n          testClient.post(\"/gzip-response\", withHeader(\"Accept-Encoding\", \"gzip,deflate\"));\n      assertThat(response.firstHeader(\"Content-Encoding\"), is(\"gzip\"));\n\n      byte[] gzippedContent = response.binaryContent();\n\n      String plainText = unGzipToString(gzippedContent);\n      assertThat(plainText, is(\"body text\"));\n    }\n\n    @Test\n    public void acceptsGzippedRequest() {\n      wireMockServer.stubFor(\n          any(urlEqualTo(\"/gzip-request\"))\n              .withRequestBody(equalTo(\"request body\"))\n              .willReturn(aResponse().withBody(\"response body\")));\n\n      HttpEntity compressedBody =\n          new GzipCompressingEntity(new StringEntity(\"request body\", ContentType.TEXT_PLAIN));\n      WireMockResponse response = testClient.post(\"/gzip-request\", compressedBody);\n\n      assertThat(response.content(), is(\"response body\"));\n    }\n  }\n\n  @Nested\n  class NoChunkedTransferEncoding {\n\n    @RegisterExtension\n    public WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(\n                wireMockConfig()\n                    .dynamicPort()\n                    .useChunkedTransferEncoding(Options.ChunkedEncodingPolicy.NEVER))\n            .build();\n\n    WireMockTestClient testClient;\n\n    @BeforeEach\n    public void init() {\n      testClient = new WireMockTestClient(wm.getPort());\n    }\n\n    @Test\n    public void returnsContentLengthHeaderWhenChunkedEncodingDisabled() {\n      assumeTrue(isNotOldJettyVersion());\n\n      String bodyText = randomAlphabetic(257); // 256 bytes is the minimum size for gzip to be used\n      wm.stubFor(get(\"/gzip-response\").willReturn(ok(bodyText)));\n\n      WireMockResponse response =\n          testClient.get(\"/gzip-response\", withHeader(\"Accept-Encoding\", \"gzip,deflate\"));\n      assertThat(response.firstHeader(\"Content-Encoding\"), is(\"gzip\"));\n      assertThat(response.headers().containsKey(\"Transfer-Encoding\"), is(false));\n      assertThat(response.firstHeader(\"Content-Length\"), is(String.valueOf(gzip(bodyText).length)));\n\n      byte[] gzippedContent = response.binaryContent();\n\n      String plainText = unGzipToString(gzippedContent);\n      assertThat(plainText, is(bodyText));\n    }\n\n    private boolean isNotOldJettyVersion() {\n      return !Jetty.VERSION.contains(\"9.2.\");\n    }\n  }\n\n  @Nested\n  class GzipDisabled {\n\n    @RegisterExtension\n    public WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(wireMockConfig().dynamicPort().gzipDisabled(true))\n            .build();\n\n    WireMockTestClient testClient;\n\n    @BeforeEach\n    public void init() {\n      testClient = new WireMockTestClient(wm.getPort());\n    }\n\n    @Test\n    public void doesNotGzipWhenDisabledInConfiguration() {\n      String url = \"/no-gzip-response\";\n      String bodyText = \"body text\";\n      wm.stubFor(get(urlEqualTo(url)).willReturn(ok(bodyText)));\n\n      WireMockResponse response =\n          testClient.get(url, withHeader(\"Accept-Encoding\", \"gzip,deflate\"));\n\n      assertThat(response.statusCode(), is(200));\n      assertThat(response.headers().containsKey(\"Content-Encoding\"), is(false));\n\n      String plainText = response.content();\n      assertThat(plainText, is(bodyText));\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/HeaderMatchingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static java.net.HttpURLConnection.HTTP_NOT_FOUND;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport org.junit.jupiter.api.Test;\n\npublic class HeaderMatchingAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void mappingWithExactUrlMethodAndHeaderMatchingIsCreatedAndReturned() {\n    testClient.addResponse(MappingJsonSamples.MAPPING_REQUEST_WITH_EXACT_HEADERS);\n\n    WireMockResponse response =\n        testClient.get(\n            \"/header/dependent\",\n            withHeader(\"Accept\", \"text/xml\"),\n            withHeader(\"If-None-Match\", \"abcd1234\"));\n\n    assertThat(response.statusCode(), is(304));\n  }\n\n  @Test\n  public void mappingMatchedWithRegexHeaders() {\n    testClient.addResponse(MappingJsonSamples.MAPPING_REQUEST_WITH_REGEX_HEADERS);\n\n    WireMockResponse response =\n        testClient.get(\n            \"/header/match/dependent\",\n            withHeader(\"Accept\", \"text/xml\"),\n            withHeader(\"If-None-Match\", \"abcd1234\"));\n\n    assertThat(response.statusCode(), is(304));\n  }\n\n  @Test\n  public void mappingMatchedWithNegativeRegexHeader() {\n    testClient.addResponse(MappingJsonSamples.MAPPING_REQUEST_WITH_NEGATIVE_REGEX_HEADERS);\n\n    WireMockResponse response =\n        testClient.get(\"/header/match/dependent\", withHeader(\"Accept\", \"text/xml\"));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response = testClient.get(\"/header/match/dependent\", withHeader(\"Accept\", \"application/json\"));\n    assertThat(response.statusCode(), is(200));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/HttpClientSubstitutionTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.assertj.core.api.AssertionsForClassTypes.assertThat;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.List;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class HttpClientSubstitutionTest {\n\n  WireMockServer wm;\n  WireMockTestClient client;\n\n  void startWireMockServer(WireMockConfiguration options) {\n    wm = new WireMockServer(options);\n    wm.start();\n\n    client = new WireMockTestClient(wm.port());\n\n    // Doesn't matter what the proxy URL is - we're faking the client\n    wm.stubFor(WireMock.proxyAllTo(\"http://localhost:1234\"));\n  }\n\n  @AfterEach\n  void cleanup() {\n    wm.stop();\n  }\n\n  @Test\n  void viaOptions() {\n    startWireMockServer(\n        wireMockConfig().dynamicPort().httpClientFactory(new FakeHttpClientFactory()));\n\n    assertThat(client.get(\"/whatever\").statusCode()).isEqualTo(418);\n  }\n\n  @Test\n  void viaExtension() {\n    startWireMockServer(wireMockConfig().dynamicPort().extensions(new FakeHttpClientFactory()));\n\n    assertThat(client.get(\"/whatever\").statusCode()).isEqualTo(418);\n  }\n\n  public static class FakeHttpClientFactory implements HttpClientFactory {\n\n    @Override\n    public HttpClient buildHttpClient(\n        Options options,\n        boolean trustAllCertificates,\n        List<String> trustedHosts,\n        boolean useSystemProperties) {\n      return new HttpClient() {\n        @Override\n        public Response execute(Request request) {\n          return Response.response().status(418).body(\"Teapot\").build();\n        }\n      };\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/HttpsAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResource;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.FatalStartupException;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.http.Fault;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.SocketException;\nimport java.security.KeyStore;\nimport java.security.KeyStoreException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.cert.CertificateException;\nimport javax.net.ssl.SSLContext;\nimport javax.net.ssl.SSLException;\nimport javax.net.ssl.SSLHandshakeException;\nimport org.apache.hc.client5.http.HttpHostConnectException;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.HttpClients;\nimport org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;\nimport org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;\nimport org.apache.hc.client5.http.ssl.NoopHostnameVerifier;\nimport org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;\nimport org.apache.hc.client5.http.ssl.TrustSelfSignedStrategy;\nimport org.apache.hc.core5.http.ClassicHttpResponse;\nimport org.apache.hc.core5.http.HttpResponse;\nimport org.apache.hc.core5.http.MalformedChunkCodingException;\nimport org.apache.hc.core5.http.NoHttpResponseException;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.apache.hc.core5.ssl.SSLContexts;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.OS;\n\nclass HttpsAcceptanceTest {\n\n  private WireMockServer wireMockServer;\n  private WireMockServer proxy;\n  private CloseableHttpClient httpClient;\n\n  @AfterEach\n  public void serverShutdown() {\n    if (wireMockServer != null) {\n      wireMockServer.stop();\n    }\n\n    if (proxy != null) {\n      proxy.shutdown();\n    }\n  }\n\n  @Test\n  void shouldReturnStubOnSpecifiedPort() throws Exception {\n    startServerWithDefaultKeystore();\n    stubFor(\n        get(urlEqualTo(\"/https-test\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"HTTPS content\")));\n\n    assertThat(contentFor(url(\"/https-test\")), is(\"HTTPS content\"));\n  }\n\n  @Test\n  void shouldReturnOnlyOnHttpsWhenHttpDisabled() throws Exception {\n    Throwable exception =\n        assertThrows(\n            IllegalStateException.class,\n            () -> {\n              // HTTPS\n              WireMockConfiguration config = wireMockConfig().httpDisabled(true).dynamicHttpsPort();\n              wireMockServer = new WireMockServer(config);\n              wireMockServer.start();\n              WireMock.configureFor(\"https\", \"localhost\", wireMockServer.httpsPort());\n              httpClient = ApacheHttpClientFactory.createClient();\n\n              stubFor(\n                  get(urlEqualTo(\"/https-test\"))\n                      .willReturn(aResponse().withStatus(200).withBody(\"HTTPS content\")));\n\n              wireMockServer.port();\n              assertThat(contentFor(url(\"/https-test\")), is(\"HTTPS content\"));\n            });\n    assertTrue(\n        exception\n            .getMessage()\n            .contains(\n                \"Not listening on HTTP port. Either HTTP is not enabled or the WireMock server is stopped.\"));\n  }\n\n  @Test\n  @DisabledOnOs(\n      value = OS.WINDOWS,\n      disabledReason =\n          \"This feature does not work on Windows \" + \"because of differing native socket behaviour\")\n  void connectionResetByPeerFault() throws IOException {\n    startServerWithDefaultKeystore();\n    stubFor(\n        get(urlEqualTo(\"/connection/reset\"))\n            .willReturn(aResponse().withFault(Fault.CONNECTION_RESET_BY_PEER)));\n\n    try {\n      httpClient.execute(new HttpGet(url(\"/connection/reset\"))).getEntity();\n      fail(\"Expected a SocketException or SSLException to be thrown\");\n    } catch (Exception e) {\n      assertThat(\n          e.getClass().getName(),\n          Matchers.anyOf(is(SocketException.class.getName()), is(SSLException.class.getName())));\n    }\n  }\n\n  @Test\n  void emptyResponseFault() {\n    startServerWithDefaultKeystore();\n    stubFor(\n        get(urlEqualTo(\"/empty/response\")).willReturn(aResponse().withFault(Fault.EMPTY_RESPONSE)));\n\n    getAndAssertUnderlyingExceptionInstanceClass(\n        url(\"/empty/response\"), NoHttpResponseException.class);\n  }\n\n  @Test\n  void malformedResponseChunkFault() {\n    startServerWithDefaultKeystore();\n    stubFor(\n        get(urlEqualTo(\"/malformed/response\"))\n            .willReturn(aResponse().withFault(Fault.MALFORMED_RESPONSE_CHUNK)));\n\n    getAndAssertUnderlyingExceptionInstanceClass(\n        url(\"/malformed/response\"), MalformedChunkCodingException.class);\n  }\n\n  @Test\n  void randomDataOnSocketFault() {\n    startServerWithDefaultKeystore();\n    stubFor(\n        get(urlEqualTo(\"/random/data\"))\n            .willReturn(aResponse().withFault(Fault.RANDOM_DATA_THEN_CLOSE)));\n\n    getAndAssertUnderlyingExceptionInstanceClass(\n        url(\"/random/data\"), NoHttpResponseException.class);\n  }\n\n  @Test\n  void throwsExceptionWhenBadAlternativeKeystore() {\n    assertThrows(\n        Exception.class,\n        () -> {\n          String testKeystorePath =\n              getResource(HttpsAcceptanceTest.class, \"bad-keystore\").toString();\n          startServerWithKeystore(testKeystorePath);\n        });\n  }\n\n  @Test\n  void acceptsAlternativeKeystore() throws Exception {\n    String testKeystorePath = getResource(HttpsAcceptanceTest.class, \"test-keystore\").toString();\n    startServerWithKeystore(testKeystorePath);\n    stubFor(\n        get(urlEqualTo(\"/https-test\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"HTTPS content\")));\n\n    assertThat(contentFor(url(\"/https-test\")), is(\"HTTPS content\"));\n  }\n\n  @Test\n  void acceptsAlternativeKeystoreWithNonDefaultPassword() throws Exception {\n    String testKeystorePath =\n        getResource(HttpsAcceptanceTest.class, \"test-keystore-pwd\").toString();\n    startServerWithKeystore(testKeystorePath, \"nondefaultpass\", \"password\");\n    stubFor(\n        get(urlEqualTo(\"/https-test\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"HTTPS content\")));\n\n    assertThat(contentFor(url(\"/https-test\")), is(\"HTTPS content\"));\n  }\n\n  @Test\n  void acceptsAlternativeKeystoreWithNonDefaultKeyManagerPassword() throws Exception {\n    String keystorePath =\n        getResource(HttpsAcceptanceTest.class, \"test-keystore-key-man-pwd\").toString();\n    startServerWithKeystore(keystorePath, \"password\", \"anotherpassword\");\n    stubFor(\n        get(urlEqualTo(\"/alt-password-https\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"HTTPS content\")));\n\n    assertThat(contentFor(url(\"/alt-password-https\")), is(\"HTTPS content\"));\n  }\n\n  @Test\n  void failsToStartWithAlternativeKeystoreWithWrongKeyManagerPassword() {\n    try {\n      String keystorePath =\n          getResource(HttpsAcceptanceTest.class, \"test-keystore-key-man-pwd\").toString();\n      startServerWithKeystore(keystorePath, \"password\", \"wrongpassword\");\n      fail(\"Expected a SocketException or SSLHandshakeException to be thrown\");\n    } catch (Exception e) {\n      assertThat(e.getClass().getName(), is(FatalStartupException.class.getName()));\n    }\n  }\n\n  @Test\n  void rejectsWithoutClientCertificate() {\n    startServerEnforcingClientCert(KEY_STORE_PATH, TRUST_STORE_PATH, TRUST_STORE_PASSWORD);\n    wireMockServer.stubFor(\n        get(urlEqualTo(\"/https-test\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"HTTPS content\")));\n\n    try {\n      contentFor(url(\"/https-test\")); // this lacks the required client certificate\n      fail(\"Expected a SocketException, SSLHandshakeException or SSLException to be thrown\");\n    } catch (Exception e) {\n      assertThat(\n          e.getClass().getName(),\n          Matchers.anyOf(\n              is(HttpHostConnectException.class.getName()),\n              is(SSLHandshakeException.class.getName()),\n              is(SSLException.class.getName()),\n              is(SocketException.class.getName())));\n    }\n  }\n\n  @Test\n  void acceptWithClientCertificate() throws Exception {\n    String testTrustStorePath = TRUST_STORE_PATH;\n    String testClientCertPath = TRUST_STORE_PATH;\n\n    startServerEnforcingClientCert(KEY_STORE_PATH, testTrustStorePath, TRUST_STORE_PASSWORD);\n    wireMockServer.stubFor(\n        get(urlEqualTo(\"/https-test\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"HTTPS content\")));\n\n    assertThat(\n        secureContentFor(url(\"/https-test\"), testClientCertPath, TRUST_STORE_PASSWORD),\n        is(\"HTTPS content\"));\n  }\n\n  @Test\n  void supportsProxyingWhenTargetRequiresClientCert() throws Exception {\n    startServerEnforcingClientCert(KEY_STORE_PATH, TRUST_STORE_PATH, TRUST_STORE_PASSWORD);\n    wireMockServer.stubFor(\n        get(urlEqualTo(\"/client-cert-proxy\")).willReturn(aResponse().withStatus(200)));\n\n    proxy =\n        new WireMockServer(\n            wireMockConfig()\n                .port(Options.DYNAMIC_PORT)\n                .trustStorePath(TRUST_STORE_PATH)\n                .trustStorePassword(TRUST_STORE_PASSWORD));\n    proxy.start();\n    proxy.stubFor(\n        get(urlEqualTo(\"/client-cert-proxy\"))\n            .willReturn(\n                aResponse().proxiedFrom(\"https://localhost:\" + wireMockServer.httpsPort())));\n\n    HttpGet get = new HttpGet(\"http://localhost:\" + proxy.port() + \"/client-cert-proxy\");\n    HttpResponse response = httpClient.execute(get);\n    assertThat(response.getCode(), is(200));\n  }\n\n  @Test\n  void proxyingFailsWhenTargetServiceRequiresClientCertificatesAndProxyDoesNotSend()\n      throws Exception {\n    startServerEnforcingClientCert(KEY_STORE_PATH, TRUST_STORE_PATH, TRUST_STORE_PASSWORD);\n    wireMockServer.stubFor(\n        get(urlEqualTo(\"/client-cert-proxy-fail\")).willReturn(aResponse().withStatus(200)));\n\n    proxy = new WireMockServer(wireMockConfig().port(Options.DYNAMIC_PORT));\n    proxy.start();\n    proxy.stubFor(\n        get(urlEqualTo(\"/client-cert-proxy-fail\"))\n            .willReturn(\n                aResponse().proxiedFrom(\"https://localhost:\" + wireMockServer.httpsPort())));\n\n    HttpGet get = new HttpGet(\"http://localhost:\" + proxy.port() + \"/client-cert-proxy-fail\");\n    HttpResponse response = httpClient.execute(get);\n    assertThat(response.getCode(), is(500));\n  }\n\n  @Test\n  void doesNotTreatPlainHttpsRequestAsBrowserProxyRequest() throws Exception {\n    proxy =\n        new WireMockServer(\n            wireMockConfig().dynamicPort().dynamicHttpsPort().enableBrowserProxying(true));\n    proxy.start();\n    proxy.stubFor(get(\"/no-proxying-thanks\").willReturn(ok(\"proxyless\")));\n\n    httpClient = ApacheHttpClientFactory.createClient();\n\n    String url = \"https://localhost:\" + proxy.httpsPort() + \"/no-proxying-thanks\";\n    HttpGet get = new HttpGet(url);\n    int status = httpClient.execute(get, HttpResponse::getCode);\n    assertThat(status, is(200));\n\n    ServeEvent serveEvent =\n        proxy.getAllServeEvents().stream()\n            .filter(event -> event.getRequest().getUrl().equals(\"/no-proxying-thanks\"))\n            .findFirst()\n            .get();\n    assertThat(serveEvent.getRequest().isBrowserProxyRequest(), is(false));\n  }\n\n  private String url(String path) {\n    return String.format(\"https://localhost:%d%s\", wireMockServer.httpsPort(), path);\n  }\n\n  private void getAndAssertUnderlyingExceptionInstanceClass(String url, Class<?> expectedClass) {\n    boolean thrown = false;\n    try {\n      contentFor(url);\n    } catch (Exception e) {\n      Throwable cause = e.getCause();\n      e.printStackTrace();\n      if (cause != null) {\n        assertThat(e.getCause(), instanceOf(expectedClass));\n      } else {\n        assertThat(e, instanceOf(expectedClass));\n      }\n\n      thrown = true;\n    }\n\n    assertTrue(thrown, \"No exception was thrown\");\n  }\n\n  private String contentFor(String url) throws Exception {\n    HttpGet get = new HttpGet(url);\n    ClassicHttpResponse response = httpClient.execute(get);\n    String content = EntityUtils.toString(response.getEntity());\n    return content;\n  }\n\n  private void startServerEnforcingClientCert(\n      String keystorePath, String truststorePath, String trustStorePassword) {\n    WireMockConfiguration config = wireMockConfig().dynamicPort().dynamicHttpsPort();\n    if (keystorePath != null) {\n      config.keystorePath(keystorePath);\n    }\n    if (truststorePath != null) {\n      config.trustStorePath(truststorePath);\n      config.trustStorePassword(trustStorePassword);\n      config.needClientAuth(true);\n    }\n    config.bindAddress(\"localhost\");\n\n    wireMockServer = new WireMockServer(config);\n    wireMockServer.start();\n    WireMock.configureFor(\"https\", \"localhost\", wireMockServer.httpsPort());\n\n    httpClient = ApacheHttpClientFactory.createClient();\n  }\n\n  private void startServerWithKeystore(\n      String keystorePath, String keystorePassword, String keyManagerPassword) {\n    WireMockConfiguration config = wireMockConfig().dynamicPort().dynamicHttpsPort();\n    if (keystorePath != null) {\n      config\n          .keystorePath(keystorePath)\n          .keystorePassword(keystorePassword)\n          .keyManagerPassword(keyManagerPassword);\n    }\n\n    wireMockServer = new WireMockServer(config);\n    wireMockServer.start();\n    WireMock.configureFor(wireMockServer.port());\n\n    httpClient = ApacheHttpClientFactory.createClient();\n  }\n\n  private void startServerWithKeystore(String keystorePath) {\n    startServerWithKeystore(keystorePath, \"password\", \"password\");\n  }\n\n  private void startServerWithDefaultKeystore() {\n    startServerWithKeystore(null);\n  }\n\n  static String secureContentFor(String url, String clientTrustStore, String trustStorePassword)\n      throws Exception {\n    KeyStore trustStore = readKeyStore(clientTrustStore, trustStorePassword);\n\n    SSLContext sslcontext =\n        SSLContexts.custom()\n            .loadTrustMaterial(null, new TrustSelfSignedStrategy())\n            .loadKeyMaterial(trustStore, trustStorePassword.toCharArray())\n            .setKeyStoreType(\"pkcs12\")\n            .setProtocol(\"TLS\")\n            .build();\n\n    SSLConnectionSocketFactory sslSocketFactory =\n        new SSLConnectionSocketFactory(\n            sslcontext,\n            null, // supported protocols\n            null, // supported cipher suites\n            NoopHostnameVerifier.INSTANCE);\n\n    PoolingHttpClientConnectionManager connectionManager =\n        PoolingHttpClientConnectionManagerBuilder.create()\n            .setSSLSocketFactory(sslSocketFactory)\n            .build();\n\n    CloseableHttpClient httpClient =\n        HttpClients.custom().setConnectionManager(connectionManager).build();\n\n    HttpGet get = new HttpGet(url);\n    ClassicHttpResponse response = httpClient.execute(get);\n    String content = EntityUtils.toString(response.getEntity());\n    return content;\n  }\n\n  static KeyStore readKeyStore(String path, String password)\n      throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {\n    KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());\n    try (FileInputStream instream = new FileInputStream(path)) {\n      trustStore.load(instream, password.toCharArray());\n    }\n    return trustStore;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/HttpsBrowserProxyAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2020-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.FILES_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MAPPINGS_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.TRUST_STORE_PASSWORD;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.TRUST_STORE_PATH;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.common.FatalStartupException;\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.http.ssl.HostVerifyingSSLSocketFactory;\nimport com.github.tomakehurst.wiremock.http.ssl.SSLContextBuilder;\nimport com.github.tomakehurst.wiremock.http.ssl.X509KeyStore;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.TestFiles;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.ByteArrayInputStream;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.security.KeyManagementException;\nimport java.security.KeyStore;\nimport java.security.KeyStoreException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.cert.Certificate;\nimport java.security.cert.CertificateException;\nimport java.security.cert.CertificateFactory;\nimport java.util.Base64;\nimport javax.net.ssl.SSLContext;\nimport org.apache.hc.client5.http.DnsResolver;\nimport org.apache.hc.client5.http.SystemDefaultDnsResolver;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.HttpClients;\nimport org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;\nimport org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;\nimport org.apache.hc.client5.http.ssl.NoopHostnameVerifier;\nimport org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;\nimport org.apache.hc.core5.http.HttpHost;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledForJreRange;\nimport org.junit.jupiter.api.condition.JRE;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class HttpsBrowserProxyAcceptanceTest {\n\n  private static final String TARGET_KEYSTORE_WITH_CUSTOM_CERT = TestFiles.KEY_STORE_PATH;\n  private static final String PROXY_KEYSTORE_WITH_CUSTOM_CA_CERT = TestFiles.KEY_STORE_WITH_CA_PATH;\n  private static final String NO_PREEXISTING_KEYSTORE_PATH =\n      tempNonExistingPath(\"wiremock-keystores\", \"ca-keystore.jks\");\n\n  @RegisterExtension\n  public static WireMockExtension target =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .httpDisabled(true)\n                  .keystorePath(TARGET_KEYSTORE_WITH_CUSTOM_CERT)\n                  .dynamicHttpsPort())\n          .build();\n\n  @RegisterExtension\n  public static WireMockExtension proxy =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .dynamicHttpsPort()\n                  .fileSource(new SingleRootFileSource(setupTempFileRoot()))\n                  .caKeystorePath(NO_PREEXISTING_KEYSTORE_PATH)\n                  .enableBrowserProxying(true)\n                  .trustAllProxyTargets(true))\n          .build();\n\n  private WireMockTestClient testClient;\n\n  @BeforeEach\n  public void addAResourceToProxy() {\n    testClient = new WireMockTestClient(target.getHttpsPort());\n  }\n\n  @Test\n  public void canProxyHttpsInBrowserProxyMode() throws Exception {\n    target.stubFor(get(urlEqualTo(\"/whatever\")).willReturn(aResponse().withBody(\"Got it\")));\n\n    assertThat(\n        testClient.getViaProxy(target.url(\"/whatever\"), proxy.getPort()).content(), is(\"Got it\"));\n  }\n\n  @Test\n  public void canProxyHttpsInBrowserHttpsProxyMode() throws Exception {\n    target.stubFor(get(urlEqualTo(\"/whatever\")).willReturn(aResponse().withBody(\"Got it\")));\n\n    WireMockResponse response =\n        testClient.getViaProxy(target.url(\"/whatever\"), proxy.getHttpsPort(), \"https\");\n    assertThat(response.content(), is(\"Got it\"));\n  }\n\n  @Test\n  public void canStubHttpsInBrowserProxyMode() throws Exception {\n    target.stubFor(\n        get(urlEqualTo(\"/stubbed\")).willReturn(aResponse().withBody(\"Should Not Be Returned\")));\n    proxy.stubFor(get(urlEqualTo(\"/stubbed\")).willReturn(aResponse().withBody(\"Stubbed Value\")));\n    target.stubFor(\n        get(urlEqualTo(\"/not_stubbed\"))\n            .willReturn(aResponse().withBody(\"Should be served from target\")));\n\n    assertThat(\n        testClient.getViaProxy(target.url(\"/stubbed\"), proxy.getPort()).content(),\n        is(\"Stubbed Value\"));\n    assertThat(\n        testClient.getViaProxy(target.url(\"/not_stubbed\"), proxy.getPort()).content(),\n        is(\"Should be served from target\"));\n  }\n\n  @Test\n  public void canRecordHttpsInBrowserProxyMode() throws Exception {\n\n    // given\n    proxy.startRecording(target.baseUrl());\n    String recordedEndpoint = target.url(\"/record_me\");\n\n    // and\n    target.stubFor(\n        get(urlEqualTo(\"/record_me\")).willReturn(aResponse().withBody(\"Target response\")));\n\n    // then\n    assertThat(\n        testClient.getViaProxy(recordedEndpoint, proxy.getPort()).content(), is(\"Target response\"));\n\n    // when\n    proxy.stopRecording();\n\n    // then\n    assertThat(\n        testClient.getViaProxy(recordedEndpoint, proxy.getPort()).content(), is(\"Target response\"));\n  }\n\n  @Test\n  public void rejectsUntrustedTarget() {\n\n    WireMockServer scepticalProxy =\n        new WireMockServer(wireMockConfig().dynamicPort().enableBrowserProxying(true));\n\n    try {\n      scepticalProxy.start();\n\n      target.stubFor(get(urlEqualTo(\"/whatever\")).willReturn(aResponse().withBody(\"Got it\")));\n\n      WireMockResponse response =\n          testClient.getViaProxy(target.url(\"/whatever\"), scepticalProxy.port());\n\n      assertThat(response.statusCode(), is(500));\n    } finally {\n      scepticalProxy.stop();\n    }\n  }\n\n  @Test\n  public void trustsTargetIfTrustStoreContainsItsCertificate() {\n\n    WireMockServer scepticalProxy =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .enableBrowserProxying(true)\n                .trustStorePath(TRUST_STORE_PATH)\n                .trustStorePassword(TRUST_STORE_PASSWORD));\n\n    try {\n      scepticalProxy.start();\n\n      target.stubFor(get(urlEqualTo(\"/whatever\")).willReturn(aResponse().withBody(\"Got it\")));\n\n      WireMockResponse response =\n          testClient.getViaProxy(target.url(\"/whatever\"), scepticalProxy.port());\n\n      assertThat(response.statusCode(), is(200));\n      assertThat(response.content(), is(\"Got it\"));\n    } finally {\n      scepticalProxy.stop();\n    }\n  }\n\n  @Test\n  public void canTrustSpecificTargetHosts() {\n\n    WireMockServer scepticalProxy =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .enableBrowserProxying(true)\n                .trustedProxyTargets(\"localhost\"));\n\n    try {\n      scepticalProxy.start();\n\n      target.stubFor(get(urlEqualTo(\"/whatever\")).willReturn(aResponse().withBody(\"Got it\")));\n\n      WireMockResponse response =\n          testClient.getViaProxy(target.url(\"/whatever\"), scepticalProxy.port());\n\n      assertThat(response.statusCode(), is(200));\n      assertThat(response.content(), is(\"Got it\"));\n    } finally {\n      scepticalProxy.stop();\n    }\n  }\n\n  @Test\n  @DisabledForJreRange(\n      min = JRE.JAVA_17,\n      disabledReason = \"does not support generating certificates at runtime\")\n  public void certificatesSignedWithUsersRootCertificate() throws Exception {\n    WireMockServer proxyWithCustomCaKeyStore =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .enableBrowserProxying(true)\n                .trustAllProxyTargets(true)\n                .caKeystorePath(PROXY_KEYSTORE_WITH_CUSTOM_CA_CERT));\n\n    try {\n      proxyWithCustomCaKeyStore.start();\n      KeyStore trustStore =\n          HttpsAcceptanceTest.readKeyStore(PROXY_KEYSTORE_WITH_CUSTOM_CA_CERT, \"password\");\n\n      // given\n      PoolingHttpClientConnectionManager connectionManager =\n          PoolingHttpClientConnectionManagerBuilder.create()\n              .setDnsResolver(new CustomLocalTldDnsResolver(\"internal\"))\n              .setSSLSocketFactory(sslSocketFactoryThatTrusts(trustStore))\n              .build();\n      CloseableHttpClient httpClient =\n          HttpClients.custom()\n              .setConnectionManager(connectionManager)\n              .setProxy(new HttpHost(\"localhost\", proxyWithCustomCaKeyStore.port()))\n              .build();\n\n      // when\n      httpClient.execute(\n          new HttpGet(\n              \"https://fake1.nowildcards1.internal:\" + target.getHttpsPort() + \"/whatever\"));\n\n      // then no exception is thrown\n\n      // when\n      httpClient.execute(\n          new HttpGet(\n              \"https://fake2.nowildcards2.internal:\" + target.getHttpsPort() + \"/whatever\"));\n\n      // then no exception is thrown\n    } finally {\n      proxyWithCustomCaKeyStore.stop();\n    }\n  }\n\n  @Test\n  @DisabledForJreRange(\n      min = JRE.JAVA_17,\n      disabledReason = \"does not support generating certificates at runtime\")\n  public void certificatesSignedWithGeneratedRootCertificate() throws Exception {\n    KeyStore trustStore =\n        HttpsAcceptanceTest.readKeyStore(NO_PREEXISTING_KEYSTORE_PATH, \"password\");\n\n    // given\n    PoolingHttpClientConnectionManager connectionManager =\n        PoolingHttpClientConnectionManagerBuilder.create()\n            .setDnsResolver(new CustomLocalTldDnsResolver(\"internal\"))\n            .setSSLSocketFactory(sslSocketFactoryThatTrusts(trustStore))\n            .build();\n    CloseableHttpClient httpClient =\n        HttpClients.custom()\n            .setConnectionManager(connectionManager)\n            .setProxy(new HttpHost(\"localhost\", proxy.getPort()))\n            .build();\n\n    // when\n    httpClient.execute(\n        new HttpGet(\"https://fake1.nowildcards1.internal:\" + target.getHttpsPort() + \"/whatever\"));\n\n    // then no exception is thrown\n\n    // when\n    httpClient.execute(\n        new HttpGet(\"https://fake2.nowildcards2.internal:\" + target.getHttpsPort() + \"/whatever\"));\n\n    // then no exception is thrown\n  }\n\n  @Test\n  public void failsIfCaKeystorePathIsNotAKeystore() throws IOException {\n    assertThrows(\n        IOException.class,\n        () ->\n            new WireMockServer(\n                options()\n                    .enableBrowserProxying(true)\n                    .caKeystorePath(Files.createTempFile(\"notakeystore\", \"jks\").toString())));\n  }\n\n  @Test\n  public void failsIfCaKeystoreDoesNotContainACaCertificate() throws Exception {\n    assertThrows(\n        FatalStartupException.class,\n        new WireMockServer(\n                options().enableBrowserProxying(true).caKeystorePath(emptyKeyStore().toString()))\n            ::start);\n  }\n\n  @Test\n  @DisabledForJreRange(\n      min = JRE.JAVA_17,\n      disabledReason = \"does not support generating certificates at runtime\")\n  public void certificateAuthorityCertCanBeDownloaded() throws Exception {\n    WireMockTestClient proxyTestClient = new WireMockTestClient(proxy.getPort());\n\n    WireMockResponse certResponse = proxyTestClient.get(\"/__admin/certs/wiremock-ca.crt\");\n    assertEquals(200, certResponse.statusCode());\n    assertEquals(\"application/x-pem-file\", certResponse.firstHeader(\"Content-Type\"));\n\n    Certificate cert = decode(certResponse.content());\n    X509KeyStore keyStore =\n        new X509KeyStore(\n            HttpsAcceptanceTest.readKeyStore(NO_PREEXISTING_KEYSTORE_PATH, \"password\"),\n            \"password\".toCharArray());\n\n    assertEquals(keyStore.getCertificateAuthority().certificateChain()[0], cert);\n  }\n\n  private Certificate decode(String body) throws Exception {\n    String base64 =\n        body.replace(\"-----BEGIN CERTIFICATE-----\", \"\").replace(\"-----END CERTIFICATE-----\", \"\");\n    byte[] certBytes = Base64.getMimeDecoder().decode(base64);\n    CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n    return cf.generateCertificate(new ByteArrayInputStream(certBytes));\n  }\n\n  private SSLConnectionSocketFactory sslSocketFactoryThatTrusts(KeyStore trustStore)\n      throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException {\n    SSLContext sslContext = SSLContextBuilder.create().loadTrustMaterial(trustStore).build();\n    return new SSLConnectionSocketFactory(\n        new HostVerifyingSSLSocketFactory(sslContext.getSocketFactory()),\n        new NoopHostnameVerifier() // using Java's hostname verification\n        );\n  }\n\n  private static File setupTempFileRoot() {\n    try {\n      File root = Files.createTempDirectory(\"wiremock\").toFile();\n      new File(root, MAPPINGS_ROOT).mkdirs();\n      new File(root, FILES_ROOT).mkdirs();\n      return root;\n    } catch (IOException e) {\n      return throwUnchecked(e, File.class);\n    }\n  }\n\n  private static class CustomLocalTldDnsResolver implements DnsResolver {\n\n    private final String tldToSendToLocalhost;\n\n    public CustomLocalTldDnsResolver(String tldToSendToLocalhost) {\n      this.tldToSendToLocalhost = tldToSendToLocalhost;\n    }\n\n    @Override\n    public InetAddress[] resolve(String host) throws UnknownHostException {\n      if (host.endsWith(\".\" + tldToSendToLocalhost)) {\n        return new InetAddress[] {InetAddress.getLocalHost()};\n      } else {\n        return new SystemDefaultDnsResolver().resolve(host);\n      }\n    }\n\n    @Override\n    public String resolveCanonicalHostname(String host) throws UnknownHostException {\n      final InetAddress[] resolvedAddresses = resolve(host);\n      if (resolvedAddresses.length > 0) {\n        return resolvedAddresses[0].getCanonicalHostName();\n      }\n      return host;\n    }\n  }\n\n  private static String tempNonExistingPath(String prefix, String filename) {\n    try {\n      Path tempDirectory = Files.createTempDirectory(prefix);\n      return tempDirectory.resolve(filename).toFile().getAbsolutePath();\n    } catch (IOException e) {\n      return throwUnchecked(e, null);\n    }\n  }\n\n  private static Path emptyKeyStore()\n      throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {\n    KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());\n    char[] password = \"password\".toCharArray();\n    keyStore.load(null, password);\n    Path keystoreNoCa = Files.createTempFile(\"keystore-with-no-ca\", \"jks\");\n    try (FileOutputStream fos = new FileOutputStream(keystoreNoCa.toFile())) {\n      keyStore.store(fos, password);\n    }\n    return keystoreNoCa;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/HttpsBrowserProxyClientAuthAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2020-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.HttpsAcceptanceTest.readKeyStore;\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.TRUST_STORE_PASSWORD;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.TRUST_STORE_PATH;\nimport static java.net.HttpURLConnection.HTTP_OK;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.security.KeyStore;\nimport javax.net.ssl.SSLContext;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.client5.http.impl.classic.HttpClientBuilder;\nimport org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;\nimport org.apache.hc.client5.http.ssl.NoopHostnameVerifier;\nimport org.apache.hc.client5.http.ssl.SSLConnectionSocketFactoryBuilder;\nimport org.apache.hc.client5.http.ssl.TrustSelfSignedStrategy;\nimport org.apache.hc.core5.http.HttpHost;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.apache.hc.core5.ssl.SSLContexts;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class HttpsBrowserProxyClientAuthAcceptanceTest {\n\n  private static final String NO_PREEXISTING_KEYSTORE_PATH =\n      tempNonExistingPath(\"wiremock-keystores\", \"ca-keystore.jks\");\n\n  @RegisterExtension\n  public static WireMockExtension target =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .httpDisabled(true)\n                  .dynamicHttpsPort()\n                  .needClientAuth(true)\n                  .trustStorePath(TRUST_STORE_PATH)\n                  .trustStorePassword(TRUST_STORE_PASSWORD))\n          .build();\n\n  @RegisterExtension\n  public WireMockExtension proxy =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .enableBrowserProxying(true)\n                  .caKeystorePath(NO_PREEXISTING_KEYSTORE_PATH)\n                  .trustedProxyTargets(\"localhost\")\n                  .needClientAuth(\n                      true) // fine to set this to false, but more \"realistic\" for it to be true\n                  .trustStorePath(TRUST_STORE_PATH)\n                  .trustStorePassword(TRUST_STORE_PASSWORD))\n          .build();\n\n  @Test\n  public void canDoClientAuthEndToEndWhenProxying() throws Exception {\n    target.stubFor(get(\"/whatever\").willReturn(aResponse().withBody(\"Success\")));\n\n    CloseableHttpClient testClient = buildHttpClient();\n    CloseableHttpResponse response = testClient.execute(new HttpGet(target.url(\"/whatever\")));\n\n    assertThat(response.getCode(), is(HTTP_OK));\n    assertThat(EntityUtils.toString(response.getEntity()), is(\"Success\"));\n  }\n\n  private static String tempNonExistingPath(String prefix, String filename) {\n    try {\n      Path tempDirectory = Files.createTempDirectory(prefix);\n      return tempDirectory.resolve(filename).toFile().getAbsolutePath();\n    } catch (IOException e) {\n      return throwUnchecked(e, null);\n    }\n  }\n\n  private CloseableHttpClient buildHttpClient() throws Exception {\n    KeyStore trustStore = readKeyStore(TRUST_STORE_PATH, TRUST_STORE_PASSWORD);\n\n    SSLContext sslcontext =\n        SSLContexts.custom()\n            .loadTrustMaterial(new TrustSelfSignedStrategy())\n            .loadKeyMaterial(trustStore, TRUST_STORE_PASSWORD.toCharArray())\n            .build();\n\n    HttpHost proxyInfo = new HttpHost(\"localhost\", proxy.getPort());\n    return HttpClientBuilder.create()\n        .disableAuthCaching()\n        .disableAutomaticRetries()\n        .disableCookieManagement()\n        .disableRedirectHandling()\n        .setConnectionManager(\n            PoolingHttpClientConnectionManagerBuilder.create()\n                .setSSLSocketFactory(\n                    SSLConnectionSocketFactoryBuilder.create()\n                        .setSslContext(sslcontext)\n                        .setHostnameVerifier(new NoopHostnameVerifier())\n                        .build())\n                .build())\n        .setProxy(proxyInfo)\n        .build();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/JsonSchemaMatchingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2023-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.file;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.empty;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.ValueSource;\n\npublic class JsonSchemaMatchingAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  void matchesStubWhenRequestBodyJsonValidatesAgainstSchema() {\n    String schema = file(\"schema-validation/new-pet.schema.json\");\n    String json = file(\"schema-validation/new-pet.json\");\n\n    stubFor(\n        post(urlPathEqualTo(\"/schema-match\"))\n            .withRequestBody(matchingJsonSchema(schema))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.postJson(\"/schema-match\", json);\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void doesNotMatchStubWhenRequestBodyJsonDoesNotValidateAgainstSchema() {\n    String schema = file(\"schema-validation/new-pet.schema.json\");\n    String json = file(\"schema-validation/new-pet.invalid.json\");\n\n    stubFor(\n        post(urlPathEqualTo(\"/schema-match\"))\n            .withRequestBody(matchingJsonSchema(schema))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.postJson(\"/schema-match\", json);\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void doesNotMatchStubWhenRequestBodyIsNotValidJson() {\n    String schema = file(\"schema-validation/new-pet.schema.json\");\n    String json = file(\"schema-validation/new-pet.unparseable.json\");\n\n    stubFor(\n        post(urlPathEqualTo(\"/schema-match\"))\n            .withRequestBody(matchingJsonSchema(schema))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.postJson(\"/schema-match\", json);\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"\",\n        \"not json\",\n        \"{\\\"type\\\": \\\"string\\\"\",\n      })\n  void doesNotAcceptStubWhenSchemaIsNotValidJson(String schema) {\n    InvalidInputException e =\n        assertThrows(\n            InvalidInputException.class,\n            () ->\n                stubFor(\n                    post(urlPathEqualTo(\"/schema-match\"))\n                        .withRequestBody(matchingJsonSchema(schema))\n                        .willReturn(ok())));\n\n    assertThat(wireMockServer.getStubMappings(), is(empty()));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"{\\\"id\\\": 1, \\\"name\\\": \\\"alice\\\"}\",\n        \"{\\\"type\\\": \\\"array\\\", \\\"items\\\": {\\\"$ref\\\": \\\"#/does/not/exist\\\"}}\",\n      })\n  void doesNotMatchStubWhenSchemaIsValidJsonButNotValidSchema(String schema) {\n    String json = \"{\\\"id\\\": 1, \\\"name\\\": \\\"alice\\\"}\";\n\n    stubFor(\n        post(urlPathEqualTo(\"/schema-match\"))\n            .withRequestBody(matchingJsonSchema(schema))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.postJson(\"/schema-match\", json);\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  // TODO: Diffs\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/JvmProxyConfigAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.JvmProxyConfigurer;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport java.io.InputStream;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\nimport org.junitpioneer.jupiter.ClearSystemProperty;\n\n@ClearSystemProperty(key = \"http.proxyHost\")\n@ClearSystemProperty(key = \"http.proxyPort\")\n@ClearSystemProperty(key = \"https.proxyHost\")\n@ClearSystemProperty(key = \"https.proxyPort\")\n@ClearSystemProperty(key = \"http.nonProxyHosts\")\npublic class JvmProxyConfigAcceptanceTest {\n\n  WireMockServer wireMockServer;\n\n  @AfterEach\n  public void cleanup() {\n    if (wireMockServer != null) {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  public void configuresHttpProxyingOnlyFromAWireMockServer() throws Exception {\n    wireMockServer = new WireMockServer(wireMockConfig().dynamicPort().enableBrowserProxying(true));\n    wireMockServer.start();\n\n    JvmProxyConfigurer.configureFor(wireMockServer);\n\n    wireMockServer.stubFor(\n        get(\"/stuff\").withHost(equalTo(\"example.com\")).willReturn(ok(\"Proxied stuff\")));\n\n    assertThat(\n        getContentUsingDefaultJvmHttpClient(\"http://example.com/stuff\"), is(\"Proxied stuff\"));\n  }\n\n  @Test\n  public void configuresHttpsProxyingOnlyFromAWireMockServer() throws Exception {\n    CloseableHttpClient httpClient = ApacheHttpClientFactory.createClient();\n\n    wireMockServer = new WireMockServer(wireMockConfig().dynamicPort().enableBrowserProxying(true));\n    wireMockServer.start();\n\n    JvmProxyConfigurer.configureFor(wireMockServer);\n\n    wireMockServer.stubFor(\n        get(\"/stuff\").withHost(equalTo(\"example.com\")).willReturn(ok(\"Proxied stuff\")));\n\n    try (CloseableHttpResponse response =\n        httpClient.execute(new HttpGet(\"https://example.com/stuff\"))) {\n      assertThat(EntityUtils.toString(response.getEntity()), is(\"Proxied stuff\"));\n    }\n  }\n\n  @Test\n  public void restoresPreviousSettings() {\n    String previousHttpProxyHost = \"prevhttpproxyhost\";\n    String previousHttpProxyPort = \"1234\";\n    String previousHttpsProxyHost = \"prevhttpsproxyhost\";\n    String previousHttpsProxyPort = \"4321\";\n    String previousNonProxyHosts = \"blah.com\";\n    System.setProperty(\"http.proxyHost\", previousHttpProxyHost);\n    System.setProperty(\"http.proxyPort\", previousHttpProxyPort);\n    System.setProperty(\"https.proxyHost\", previousHttpsProxyHost);\n    System.setProperty(\"https.proxyPort\", previousHttpsProxyPort);\n    System.setProperty(\"http.nonProxyHosts\", previousNonProxyHosts);\n\n    wireMockServer = new WireMockServer(wireMockConfig().dynamicPort());\n    wireMockServer.start();\n\n    JvmProxyConfigurer.configureFor(wireMockServer);\n\n    assertThat(System.getProperty(\"http.proxyHost\"), is(\"localhost\"));\n    assertThat(System.getProperty(\"http.proxyPort\"), is(String.valueOf(wireMockServer.port())));\n    assertThat(System.getProperty(\"https.proxyHost\"), is(\"localhost\"));\n    assertThat(System.getProperty(\"https.proxyPort\"), is(String.valueOf(wireMockServer.port())));\n    assertThat(System.getProperty(\"http.nonProxyHosts\"), is(\"localhost|127.*|[::1]\"));\n\n    JvmProxyConfigurer.restorePrevious();\n\n    assertThat(System.getProperty(\"http.proxyHost\"), is(previousHttpProxyHost));\n    assertThat(System.getProperty(\"http.proxyPort\"), is(previousHttpProxyPort));\n    assertThat(System.getProperty(\"https.proxyHost\"), is(previousHttpsProxyHost));\n    assertThat(System.getProperty(\"https.proxyPort\"), is(previousHttpsProxyPort));\n    assertThat(System.getProperty(\"http.nonProxyHosts\"), is(previousNonProxyHosts));\n  }\n\n  private String getContentUsingDefaultJvmHttpClient(String url) throws Exception {\n    final HttpURLConnection urlConnection = (HttpURLConnection) new URL(url).openConnection();\n    try (InputStream in = urlConnection.getInputStream()) {\n      return new String(in.readAllBytes());\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/LogTimingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2018-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.greaterThan;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.Timing;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Disabled;\nimport org.junit.jupiter.api.Test;\n\n@Disabled(\"Very slow and not likely to change any time soon\")\npublic class LogTimingAcceptanceTest extends AcceptanceTestBase {\n\n  @BeforeAll\n  public static void setupServer() {\n    setupServer(options().asynchronousResponseEnabled(true).asynchronousResponseThreads(5));\n  }\n\n  @Test\n  public void serveEventIncludesTotalAndServeDuration() {\n    stubFor(get(\"/time-me\").willReturn(ok()));\n\n    // Create some work\n    for (int i = 0; i < 2500; i++) {\n      stubFor(get(\"/time-me/\" + i).willReturn(ok()));\n    }\n\n    testClient.get(\"/time-me\");\n\n    ServeEvent serveEvent = getAllServeEvents().get(0);\n\n    assertThat(serveEvent.getTiming().getServeTime(), greaterThan(0));\n    assertThat(serveEvent.getTiming().getTotalTime(), greaterThan(0));\n  }\n\n  @Test\n  public void includesAddedDelayInTotalWhenAsync() {\n    final int DELAY = 500;\n\n    stubFor(\n        post(\"/time-me/async\")\n            .withRequestBody(equalToXml(\"<value>1111</value>\"))\n            .willReturn(ok().withFixedDelay(DELAY)));\n\n    // Create some work\n    for (int i = 0; i < 500; i++) {\n      stubFor(\n          post(\"/time-me/async\")\n              .withRequestBody(equalToXml(\"<value>123456\" + i + \" </value>\"))\n              .willReturn(ok()));\n    }\n\n    testClient.postXml(\"/time-me/async\", \"<value>1111</value>\");\n    ServeEvent serveEvent = getAllServeEvents().get(0);\n\n    Timing timing = serveEvent.getTiming();\n    assertThat(timing.getAddedDelay(), is(DELAY));\n    assertThat(timing.getProcessTime(), greaterThan(0));\n    //        assertThat(timing.getResponseSendTime(), greaterThan(0)); // Hard for this not to be\n    // flakey without some kind of throttling on the loopback adapter\n    assertThat(timing.getServeTime(), is(timing.getProcessTime() + timing.getResponseSendTime()));\n    assertThat(\n        timing.getTotalTime(), is(timing.getProcessTime() + timing.getResponseSendTime() + DELAY));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/LoggedResponseTruncationTest.java",
    "content": "/*\n * Copyright (C) 2022-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.Strings.randomAlphabetic;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class LoggedResponseTruncationTest {\n\n  static final int MAX_SIZE = 1400;\n\n  @RegisterExtension\n  static WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().dynamicPort().maxLoggedResponseSize(MAX_SIZE))\n          .build();\n\n  WireMockTestClient client;\n\n  @BeforeEach\n  void init() {\n    wm.resetAll();\n    client = new WireMockTestClient(wm.getPort());\n  }\n\n  @Test\n  void includesFullResponseBodyWhenBelowConfiguredThreshold() {\n    String bigBody = randomAlphabetic(MAX_SIZE - 1);\n    wm.stubFor(any(anyUrl()).willReturn(ok(bigBody)));\n    client.get(\"/big\");\n\n    assertThat(wm.getAllServeEvents().get(0).getResponse().getBodyAsString(), is(bigBody));\n  }\n\n  @Test\n  void includesFullResponseBodyWhenAtConfiguredThreshold() {\n    String bigBody = randomAlphabetic(MAX_SIZE - 1);\n    wm.stubFor(any(anyUrl()).willReturn(ok(bigBody)));\n    client.get(\"/big\");\n\n    assertThat(wm.getAllServeEvents().get(0).getResponse().getBodyAsString(), is(bigBody));\n  }\n\n  @Test\n  void truncatesResponseBodyWhenOverConfiguredThreshold() {\n    String bigBody = randomAlphabetic(MAX_SIZE + 1);\n    wm.stubFor(any(anyUrl()).willReturn(ok(bigBody)));\n    client.get(\"/big\");\n\n    String expectedLoggedBody = bigBody.substring(0, MAX_SIZE);\n    String loggedResponseBody = wm.getAllServeEvents().get(0).getResponse().getBodyAsString();\n    assertThat(loggedResponseBody, is(expectedLoggedBody));\n    assertThat(loggedResponseBody.length(), is(MAX_SIZE));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/LooseUrlAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.any;\nimport static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.proxyAllTo;\nimport static com.github.tomakehurst.wiremock.common.Metadata.metadata;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.util.List;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request.Builder;\nimport okhttp3.Response;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class LooseUrlAcceptanceTest extends AcceptanceTestBase {\n\n  private WireMockServer proxyingService;\n  private OkHttpClient client;\n  private String proxyTargetUrl;\n\n  private void proxyServerStart(WireMockConfiguration config) {\n    proxyingService = new WireMockServer(config.dynamicPort());\n    proxyingService.start();\n    proxyTargetUrl = \"http://localhost:\" + wireMockServer.port();\n    proxyingService.stubFor(\n        proxyAllTo(proxyTargetUrl).withMetadata(metadata().attr(\"proxy\", true)));\n\n    client = new OkHttpClient();\n    wireMockServer.stubFor(any(anyUrl()).willReturn(ok()));\n  }\n\n  @BeforeEach\n  public void clearTargetServerMappings() {\n    wireMockServer.resetMappings();\n  }\n\n  @AfterEach\n  public void proxyServerShutdown() {\n    // delete any persisted stub mappings to ensure test isolation\n    proxyingService.resetMappings();\n    proxyingService.stop();\n  }\n\n  @Test\n  void canRecordAUrlThatDoesNotConformToRfc3986() throws Exception {\n    proxyServerStart(wireMockConfig().withRootDirectory(setupTempFileRoot().getAbsolutePath()));\n    Response response =\n        client\n            .newCall(new Builder().url(proxyingService.baseUrl() + \"/foo/bar?q={}\").build())\n            .execute();\n    assertThat(response.code()).isEqualTo(200);\n    List<ServeEvent> proxyTargetServeEvents = wireMockServer.getAllServeEvents();\n    assertThat(proxyTargetServeEvents).hasSize(1);\n    LoggedRequest targetRequest = proxyTargetServeEvents.get(0).getRequest();\n    assertThat(targetRequest.getUrl()).isEqualTo(\"/foo/bar?q=%7B%7D\");\n    targetRequest.getQueryParams().get(\"q\").hasValueMatching(equalTo(\"{}\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/MappingsAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BINARY_COMPRESSED_CONTENT;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.MAPPING_REQUEST_FOR_BINARY_BYTE_BODY;\nimport static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.MAPPING_REQUEST_FOR_BYTE_BODY;\nimport static java.net.HttpURLConnection.HTTP_NOT_FOUND;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertNull;\n\nimport com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\n\npublic class MappingsAcceptanceTest extends AcceptanceTestBase {\n\n  @BeforeAll\n  public static void setupServer() {\n    setupServerWithMappingsInFileRoot();\n  }\n\n  @Test\n  public void basicMappingCheckNonUtf8() {\n    testClient.addResponse(MappingJsonSamples.MAPPING_REQUEST_FOR_NON_UTF8, \"GB2312\");\n\n    WireMockResponse response = testClient.get(\"/test/nonutf8/\");\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"国家标准\"));\n  }\n\n  @Test\n  public void basicMappingCheckCharsetMismatch() {\n    testClient.addResponse(MappingJsonSamples.MAPPING_REQUEST_FOR_NON_UTF8, \"ISO-8859-8\");\n\n    WireMockResponse response = testClient.get(\"/test/nonutf8/\");\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"????\")); // charset in request doesn't match body content\n  }\n\n  @Test\n  public void basicMappingWithExactUrlAndMethodMatchIsCreatedAndReturned() {\n    testClient.addResponse(MappingJsonSamples.BASIC_MAPPING_REQUEST_WITH_RESPONSE_HEADER);\n\n    WireMockResponse response = testClient.get(\"/a/registered/resource\");\n\n    assertThat(response.statusCode(), is(401));\n    assertThat(response.content(), is(\"Not allowed!\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n  }\n\n  @Test\n  public void basicMappingWithNoTrailingZerosMatchingOnDecimalsWithNoTrailingZeros() {\n    testClient.addResponse(MappingJsonSamples.MAPPING_REQUEST_JSON_BODY_DECIMALS_NO_TRAILING_ZEROS);\n\n    WireMockResponse noTrailingZerosResponse =\n        testClient.postJson(\"/body/decimals\", \"{\\\"float\\\": 1.2}\");\n\n    assertThat(noTrailingZerosResponse.statusCode(), is(200));\n  }\n\n  @Test\n  public void basicMappingWithNoTrailingZerosMatchingOnDecimalsWithTrailingZeros() {\n    testClient.addResponse(MappingJsonSamples.MAPPING_REQUEST_JSON_BODY_DECIMALS_NO_TRAILING_ZEROS);\n\n    WireMockResponse trailingZerosResponse =\n        testClient.postJson(\"/body/decimals\", \"{\\\"float\\\": 1.2000000}\");\n\n    assertThat(trailingZerosResponse.statusCode(), is(200));\n  }\n\n  @Test\n  public void basicMappingWithTrailingZerosMatchingOnDecimalsWithNoTrailingZeros() {\n    testClient.addResponse(MappingJsonSamples.MAPPING_REQUEST_JSON_BODY_DECIMALS_TRAILING_ZEROS);\n\n    WireMockResponse noTrailingZerosResponse =\n        testClient.postJson(\"/body/decimals\", \"{\\\"float\\\": 1.2}\");\n\n    assertThat(noTrailingZerosResponse.statusCode(), is(200));\n  }\n\n  @Test\n  public void basicMappingWithTrailingZerosMatchingOnDecimalsWithTrailingZeros() {\n    testClient.addResponse(MappingJsonSamples.MAPPING_REQUEST_JSON_BODY_DECIMALS_TRAILING_ZEROS);\n\n    WireMockResponse trailingZerosResponse =\n        testClient.postJson(\"/body/decimals\", \"{\\\"float\\\": 1.200}\");\n\n    assertThat(trailingZerosResponse.statusCode(), is(200));\n  }\n\n  @Test\n  public void mappingWithStatusOnlyResponseIsCreatedAndReturned() {\n    testClient.addResponse(MappingJsonSamples.STATUS_ONLY_MAPPING_REQUEST);\n\n    WireMockResponse response = testClient.put(\"/status/only\");\n\n    assertThat(response.statusCode(), is(204));\n    assertNull(response.content());\n  }\n\n  @Test\n  public void notFoundResponseIsReturnedForUnregisteredUrl() {\n    WireMockResponse response = testClient.get(\"/non-existent/resource\");\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n  }\n\n  @Test\n  public void multipleMappingsSupported() {\n    add200ResponseFor(\"/resource/1\");\n    add200ResponseFor(\"/resource/2\");\n    add200ResponseFor(\"/resource/3\");\n\n    getResponseAndAssert200Status(\"/resource/1\");\n    getResponseAndAssert200Status(\"/resource/2\");\n    getResponseAndAssert200Status(\"/resource/3\");\n  }\n\n  @Test\n  public void multipleInvocationsSupported() {\n    add200ResponseFor(\"/resource/100\");\n    getResponseAndAssert200Status(\"/resource/100\");\n    getResponseAndAssert200Status(\"/resource/100\");\n    getResponseAndAssert200Status(\"/resource/100\");\n  }\n\n  @Test\n  public void loadsDefaultMappingsOnStart() {\n    getResponseAndAssert200Status(\"/testmapping\");\n  }\n\n  @Test\n  public void resetToDefaultRemovesAllButDefault() {\n    add200ResponseFor(\"/resource/11\");\n\n    testClient.resetDefaultMappings();\n\n    WireMockResponse response = testClient.get(\"/resource/11\");\n    assertThat(response.statusCode(), is(404));\n    getResponseAndAssert200Status(\"/testmapping\");\n  }\n\n  @Test\n  public void resetToDefaultRestoresOldMeaningOfDefault() {\n    add200ResponseFor(\"/testmapping\");\n    WireMockResponse response1 = testClient.get(\"/testmapping\");\n    assertThat(response1.content(), is(\"\"));\n\n    testClient.resetDefaultMappings();\n\n    WireMockResponse response2 = testClient.get(\"/testmapping\");\n    assertThat(response2.content(), is(\"default test mapping\"));\n  }\n\n  @Test\n  public void readsMapppingForByteBody() {\n    testClient.addResponse(MAPPING_REQUEST_FOR_BYTE_BODY);\n    assertThat(testClient.get(\"/byte/resource/from/file\").content(), is(\"ABC\"));\n  }\n\n  @Test\n  public void readsMapppingForByteBodyReturnsByteArray() {\n    testClient.addResponse(MAPPING_REQUEST_FOR_BINARY_BYTE_BODY);\n    assertThat(\n        testClient.get(\"/bytecompressed/resource/from/file\").binaryContent(),\n        is(BINARY_COMPRESSED_CONTENT));\n  }\n\n  @Test\n  public void readsJsonMapping() {\n    WireMockResponse response = testClient.get(\"/testjsonmapping\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(\n        response.content(),\n        is(\n            \"{\\\"bignumber\\\":1234567890.12,\\\"integer_as_float\\\":2.0,\\\"array\\\":[1,2,3],\\\"integer\\\":2,\\\"key\\\":\\\"value\\\"}\"));\n  }\n\n  @Test\n  public void appendsTransferEncodingHeaderIfNoContentLengthHeaderIsPresentInMapping() {\n    testClient.addResponse(\n        \"\"\"\n            {\n            \t\"request\": {\n            \t\t\"method\": \"GET\",\n            \t\t\"url\": \"/with/body\"\n            \t},\n            \t\"response\": {\n            \t\t\"status\": 200,\n            \t\t\"body\": \"Some content\"\n            \t}\n            }\"\"\");\n\n    WireMockResponse response = testClient.get(\"/with/body\");\n\n    assertThat(response.firstHeader(\"Transfer-Encoding\"), is(\"chunked\"));\n  }\n\n  @Test\n  public void responseContainsContentLengthAndChunkedEncodingHeadersIfItIsDefinedInTheMapping() {\n    testClient.addResponse(\n        \"\"\"\n            {\n            \t\"request\": {\n            \t\t\"method\": \"GET\",\n            \t\t\"url\": \"/with/body\"\n            \t},\n            \t\"response\": {\n            \t\t\"status\": 200,\n            \t\t\"headers\": {\n            \t\t\t\"Content-Length\": \"12\"\n            \t\t},\n            \t\t\"body\": \"Some content\"\n            \t}\n            }\"\"\");\n    WireMockResponse response = testClient.get(\"/with/body\");\n\n    assertThat(response.firstHeader(\"Content-Length\"), is(\"12\"));\n    assertFalse(\n        response.headers().containsKey(\"Transfer-Encoding\"),\n        \"expected Transfer-Encoding head to be absent\");\n  }\n\n  private void getResponseAndAssert200Status(String url) {\n    WireMockResponse response = testClient.get(url);\n    assertThat(response.statusCode(), is(200));\n  }\n\n  private void add200ResponseFor(String url) {\n    testClient.addResponse(String.format(MappingJsonSamples.STATUS_ONLY_GET_MAPPING_TEMPLATE, url));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/MappingsLoaderAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.filePath;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.stubMappingWithUrl;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItem;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.List;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class MappingsLoaderAcceptanceTest {\n\n  private WireMockConfiguration configuration;\n  private WireMockServer wireMockServer;\n  private WireMockTestClient testClient;\n\n  @BeforeEach\n  public void init() {\n    configuration = wireMockConfig().dynamicPort();\n  }\n\n  @AfterEach\n  public void stopWireMock() {\n    wireMockServer.stop();\n  }\n\n  private void buildWireMock(Options options) {\n    wireMockServer = new WireMockServer(options);\n    wireMockServer.start();\n    testClient = new WireMockTestClient(wireMockServer.port());\n  }\n\n  @Test\n  public void mappingsLoadedFromJsonFiles() {\n    buildWireMock(configuration);\n    wireMockServer.loadMappingsUsing(\n        new JsonFileMappingsSource(\n            new SingleRootFileSource(filePath(\"test-requests\")), new FilenameMaker()));\n\n    WireMockResponse response = testClient.get(\"/canned/resource/1\");\n    assertThat(response.statusCode(), is(200));\n\n    response = testClient.get(\"/canned/resource/2\");\n    assertThat(response.statusCode(), is(401));\n  }\n\n  @Test\n  public void mappingsLoadedViaClasspath() {\n    buildWireMock(configuration.usingFilesUnderClasspath(\"classpath-filesource\"));\n    assertThat(testClient.get(\"/test\").content(), is(\"THINGS!\"));\n  }\n\n  @Test\n  public void loadsStubMappingsFromAMixtureOfSingleAndMultiStubFiles() {\n    buildWireMock(configuration);\n    wireMockServer.resetMappings();\n    wireMockServer.loadMappingsUsing(\n        new JsonFileMappingsSource(\n            new SingleRootFileSource(filePath(\"multi-stub\")), new FilenameMaker()));\n\n    List<StubMapping> stubs = wireMockServer.listAllStubMappings().getMappings();\n\n    assertThat(stubs.size(), is(4));\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/single/1\")));\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/multi/1\")));\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/multi/2\")));\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/multi/3\")));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/MessageActionTransformerAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.entity.EntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.StringEntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.TextEntityDefinition;\nimport com.github.tomakehurst.wiremock.extension.MessageActionTransformer;\nimport com.github.tomakehurst.wiremock.message.MessageAction;\nimport com.github.tomakehurst.wiremock.message.MessageActionContext;\nimport com.github.tomakehurst.wiremock.message.SendMessageAction;\nimport com.github.tomakehurst.wiremock.testsupport.WebsocketTestClient;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class MessageActionTransformerAcceptanceTest {\n\n  WireMockServer wm;\n\n  @AfterEach\n  void cleanup() {\n    if (wm != null) {\n      wm.stop();\n    }\n  }\n\n  @Test\n  void globalTransformerModifiesMessageAction() {\n    wm =\n        new WireMockServer(\n                wireMockConfig().dynamicPort().extensions(new PrefixingMessageActionTransformer()))\n            .startServer();\n\n    wm.addMessageStubMapping(\n        message()\n            .withName(\"Transformed stub\")\n            .withBody(equalTo(\"hello\"))\n            .willTriggerActions(sendMessage(\"world\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/transform-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"hello\");\n    assertThat(response, is(\"[TRANSFORMED] world\"));\n  }\n\n  @Test\n  void multipleTransformersAreAppliedInOrder() {\n    wm =\n        new WireMockServer(\n                wireMockConfig()\n                    .dynamicPort()\n                    .extensions(\n                        new SuffixingMessageActionTransformer(\"1\"),\n                        new SuffixingMessageActionTransformer(\"2\"),\n                        new SuffixingMessageActionTransformer(\"3\")))\n            .startServer();\n\n    wm.addMessageStubMapping(\n        message()\n            .withName(\"Multi-transform stub\")\n            .withBody(equalTo(\"test\"))\n            .willTriggerActions(sendMessage(\"message\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/multi-transform-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"test\");\n    assertThat(response, is(\"message 1 2 3\"));\n  }\n\n  @Test\n  void nonGlobalTransformerIsNotApplied() {\n    wm =\n        new WireMockServer(\n                wireMockConfig().dynamicPort().extensions(new NonGlobalMessageActionTransformer()))\n            .startServer();\n\n    wm.addMessageStubMapping(\n        message()\n            .withName(\"Non-global stub\")\n            .withBody(equalTo(\"ping\"))\n            .willTriggerActions(sendMessage(\"pong\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/non-global-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"ping\");\n    assertThat(response, is(\"pong\"));\n  }\n\n  @Test\n  void transformerHasAccessToIncomingMessageContext() {\n    wm =\n        new WireMockServer(\n                wireMockConfig().dynamicPort().extensions(new EchoingMessageActionTransformer()))\n            .startServer();\n\n    wm.addMessageStubMapping(\n        message()\n            .withName(\"Echo context stub\")\n            .withBody(matching(\".*\"))\n            .willTriggerActions(sendMessage(\"response\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/echo-context-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"my-input\");\n    assertThat(response, is(\"Echo: my-input\"));\n  }\n\n  @Test\n  void nonGlobalTransformerIsAppliedWhenSpecifiedOnAction() {\n    wm =\n        new WireMockServer(\n                wireMockConfig().dynamicPort().extensions(new NonGlobalMessageActionTransformer()))\n            .startServer();\n\n    wm.addMessageStubMapping(\n        message()\n            .withName(\"Selective transformer stub\")\n            .withBody(equalTo(\"apply\"))\n            .willTriggerActions(\n                sendMessage(\"original\").withTransformer(\"non-global\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/selective-transform-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"apply\");\n    assertThat(response, is(\"SHOULD NOT SEE THIS\"));\n  }\n\n  private String websocketUrl(String path) {\n    return \"ws://localhost:\" + wm.port() + path;\n  }\n\n  public static class PrefixingMessageActionTransformer implements MessageActionTransformer {\n    @Override\n    public MessageAction transform(MessageAction action, MessageActionContext context) {\n      if (action instanceof SendMessageAction sendAction) {\n        String originalBody = getMessageBody(sendAction);\n        return SendMessageAction.toOriginatingChannel(\"[TRANSFORMED] \" + originalBody);\n      }\n      return action;\n    }\n\n    @Override\n    public String getName() {\n      return \"prefixing\";\n    }\n  }\n\n  public static class SuffixingMessageActionTransformer implements MessageActionTransformer {\n\n    private final String suffix;\n\n    public SuffixingMessageActionTransformer(String suffix) {\n      this.suffix = suffix;\n    }\n\n    @Override\n    public MessageAction transform(MessageAction action, MessageActionContext context) {\n      if (action instanceof SendMessageAction sendAction) {\n        String originalBody = getMessageBody(sendAction);\n        return SendMessageAction.toOriginatingChannel(originalBody + \" \" + suffix);\n      }\n      return action;\n    }\n\n    @Override\n    public String getName() {\n      return \"suffixing \" + suffix;\n    }\n  }\n\n  public static class NonGlobalMessageActionTransformer implements MessageActionTransformer {\n    @Override\n    public MessageAction transform(MessageAction action, MessageActionContext context) {\n      if (action instanceof SendMessageAction sendAction) {\n        return SendMessageAction.toOriginatingChannel(\"SHOULD NOT SEE THIS\");\n      }\n      return action;\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return false;\n    }\n\n    @Override\n    public String getName() {\n      return \"non-global\";\n    }\n  }\n\n  public static class EchoingMessageActionTransformer implements MessageActionTransformer {\n    @Override\n    public MessageAction transform(MessageAction action, MessageActionContext context) {\n      if (action instanceof SendMessageAction && context.isTriggeredByMessage()) {\n        String incomingBody = context.getIncomingMessage().getBodyAsString();\n        return SendMessageAction.toOriginatingChannel(\"Echo: \" + incomingBody);\n      }\n      return action;\n    }\n\n    @Override\n    public String getName() {\n      return \"echoing\";\n    }\n  }\n\n  private static String getMessageBody(SendMessageAction action) {\n    EntityDefinition body = action.getBody();\n    if (body instanceof StringEntityDefinition stringDef) {\n      return stringDef.getValue();\n    }\n    if (body instanceof TextEntityDefinition textDef) {\n      Object data = textDef.getData();\n      return data != null ? data.toString() : \"\";\n    }\n    return \"\";\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/MessageMappingsLoaderAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.filePath;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.messageStubMappingWithId;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.messageStubMappingWithName;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItem;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.notNullValue;\n\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource;\nimport java.util.List;\nimport java.util.UUID;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class MessageMappingsLoaderAcceptanceTest {\n\n  private WireMockConfiguration configuration;\n  private WireMockServer wireMockServer;\n\n  @BeforeEach\n  public void init() {\n    configuration = wireMockConfig().dynamicPort();\n  }\n\n  @AfterEach\n  public void stopWireMock() {\n    if (wireMockServer != null && wireMockServer.isRunning()) {\n      wireMockServer.stop();\n    }\n  }\n\n  private void buildWireMock(Options options) {\n    wireMockServer = new WireMockServer(options);\n    wireMockServer.start();\n  }\n\n  @Test\n  public void messageMappingsLoadedFromJsonFiles() {\n    buildWireMock(configuration);\n    wireMockServer.loadMessageMappingsUsing(\n        new JsonFileMappingsSource(\n            new SingleRootFileSource(filePath(\"test-requests\")),\n            new SingleRootFileSource(filePath(\"message-stub-test\")),\n            new FilenameMaker()));\n\n    List<MessageStubMapping> stubs = wireMockServer.getMessageStubMappingsList();\n\n    assertThat(stubs.size(), is(4));\n    assertThat(stubs, hasItem(messageStubMappingWithName(\"Single message stub\")));\n    assertThat(stubs, hasItem(messageStubMappingWithName(\"Multi message stub 1\")));\n    assertThat(stubs, hasItem(messageStubMappingWithName(\"Multi message stub 2\")));\n    assertThat(stubs, hasItem(messageStubMappingWithName(\"Multi message stub 3\")));\n\n    assertThat(\n        stubs,\n        hasItem(messageStubMappingWithId(UUID.fromString(\"22222222-2222-2222-2222-222222222222\"))));\n\n    MessageStubMapping multiStub2 =\n        stubs.stream()\n            .filter(stub -> stub.getName().equals(\"Multi message stub 2\"))\n            .findFirst()\n            .get();\n    assertThat(multiStub2.getId(), is(notNullValue()));\n  }\n\n  @Test\n  public void loadsMessageStubMappingsFromAMixtureOfSingleAndMultiStubFiles() {\n    buildWireMock(configuration);\n    wireMockServer.resetMessageStubMappings();\n    wireMockServer.loadMessageMappingsUsing(\n        new JsonFileMappingsSource(\n            new SingleRootFileSource(filePath(\"test-requests\")),\n            new SingleRootFileSource(filePath(\"message-stub-test\")),\n            new FilenameMaker()));\n\n    List<MessageStubMapping> stubs = wireMockServer.getMessageStubMappingsList();\n\n    assertThat(stubs.size(), is(4));\n    assertThat(\n        stubs,\n        hasItem(messageStubMappingWithId(UUID.fromString(\"11111111-1111-1111-1111-111111111111\"))));\n    assertThat(\n        stubs,\n        hasItem(messageStubMappingWithId(UUID.fromString(\"22222222-2222-2222-2222-222222222222\"))));\n  }\n\n  @Test\n  public void noMessageMappingsLoadedWhenDirectoryDoesNotExist() {\n    buildWireMock(configuration);\n    wireMockServer.resetMessageStubMappings();\n    wireMockServer.loadMessageMappingsUsing(\n        new JsonFileMappingsSource(\n            new SingleRootFileSource(filePath(\"test-requests\")), new FilenameMaker()));\n\n    List<MessageStubMapping> stubs = wireMockServer.getMessageStubMappingsList();\n\n    assertThat(stubs.size(), is(0));\n  }\n\n  @Test\n  public void messageMappingsLoadedFromClasspath() {\n    buildWireMock(configuration.usingFilesUnderClasspath(\"classpath-filesource\"));\n\n    List<MessageStubMapping> stubs = wireMockServer.getMessageStubMappingsList();\n\n    assertThat(stubs.size(), is(1));\n    assertThat(stubs, hasItem(messageStubMappingWithName(\"Classpath message stub\")));\n    assertThat(\n        stubs,\n        hasItem(messageStubMappingWithId(UUID.fromString(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"))));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/MessageTemplatingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.testsupport.WebsocketTestClient;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class MessageTemplatingAcceptanceTest {\n\n  WireMockServer wm;\n\n  @AfterEach\n  void cleanup() {\n    if (wm != null) {\n      wm.stop();\n    }\n  }\n\n  @Test\n  void templatesMessageBodyWithIncomingMessageContent() {\n    wm = new WireMockServer(wireMockConfig().dynamicPort()).startServer();\n\n    wm.messageStubFor(\n        message()\n            .withName(\"Echo template stub\")\n            .withBody(matching(\".*\"))\n            .willTriggerActions(sendMessage(\"You said: {{message.body}}\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/template-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"hello world\");\n    assertThat(response, is(\"You said: hello world\"));\n  }\n\n  @Test\n  void templatesMessageBodyWithRandomValue() {\n    wm = new WireMockServer(wireMockConfig().dynamicPort()).startServer();\n\n    wm.messageStubFor(\n        message()\n            .withName(\"Random template stub\")\n            .withBody(equalTo(\"random\"))\n            .willTriggerActions(\n                sendMessage(\"Random: {{randomValue length=5 type='ALPHANUMERIC'}}\")\n                    .onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/random-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"random\");\n    assertThat(response.startsWith(\"Random: \"), is(true));\n    assertThat(response.length(), is(\"Random: \".length() + 5));\n  }\n\n  @Test\n  void templatesMessageBodyWithJsonPath() {\n    wm = new WireMockServer(wireMockConfig().dynamicPort()).startServer();\n\n    wm.messageStubFor(\n        message()\n            .withName(\"JsonPath template stub\")\n            .withBody(matchingJsonPath(\"$.name\"))\n            .willTriggerActions(\n                sendMessage(\"Hello {{jsonPath message.body '$.name'}}!\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/jsonpath-test\");\n\n    String response =\n        testClient.sendMessageAndWaitForResponse(url, \"{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}\");\n    assertThat(response, is(\"Hello Alice!\"));\n  }\n\n  @Test\n  void templatesMessageBodyWithInitiatingRequestData() {\n    wm = new WireMockServer(wireMockConfig().dynamicPort()).startServer();\n\n    wm.messageStubFor(\n        message()\n            .withName(\"Request data template stub\")\n            .onWebsocketChannelFromRequestMatching(\n                newRequestPattern().withUrl(urlPathMatching(\"/my.*\")))\n            .withBody(equalTo(\"info\"))\n            .willTriggerActions(sendMessage(\"Path: {{request.path}}\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/my-channel\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"info\");\n    assertThat(response, is(\"Path: /my-channel\"));\n  }\n\n  @Test\n  void templatesMessageBodyWithMultipleHelpers() {\n    wm = new WireMockServer(wireMockConfig().dynamicPort()).startServer();\n\n    wm.messageStubFor(\n        message()\n            .withName(\"Multi-helper template stub\")\n            .willTriggerActions(\n                sendMessage(\"Upper: {{upper message.body}}, Length: {{size message.body}}\")\n                    .onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/multi-helper-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"test\");\n    assertThat(response, is(\"Upper: TEST, Length: 4\"));\n  }\n\n  private String websocketUrl(String path) {\n    return \"ws://localhost:\" + wm.port() + path;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/MultipartBodyMatchingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.Strings.randomAlphanumeric;\nimport static com.github.tomakehurst.wiremock.testsupport.MultipartBody.part;\nimport static java.util.Collections.singletonList;\nimport static org.apache.hc.core5.http.ContentType.MULTIPART_FORM_DATA;\nimport static org.apache.hc.core5.http.ContentType.TEXT_PLAIN;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport java.io.OutputStream;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\nimport java.util.List;\nimport java.util.UUID;\nimport org.apache.hc.client5.http.entity.mime.*;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.core5.http.*;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\nimport org.apache.hc.core5.http.io.support.ClassicRequestBuilder;\nimport org.apache.hc.core5.http.message.BasicNameValuePair;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.Timeout;\n\npublic class MultipartBodyMatchingAcceptanceTest extends AcceptanceTestBase {\n\n  CloseableHttpClient httpClient = ApacheHttpClientFactory.createClient();\n\n  @Test\n  public void acceptsAMultipartRequestContainingATextAndAFilePart() throws Exception {\n    stubFor(\n        post(\"/multipart\")\n            .withMultipartRequestBody(aMultipart().withName(\"text\").withBody(containing(\"hello\")))\n            .withMultipartRequestBody(\n                aMultipart().withName(\"file\").withBody(binaryEqualTo(\"ABCD\".getBytes())))\n            .willReturn(ok()));\n\n    ClassicHttpRequest request =\n        ClassicRequestBuilder.post(wireMockServer.baseUrl() + \"/multipart\")\n            .setEntity(\n                MultipartEntityBuilder.create()\n                    .addTextBody(\"text\", \"hello\")\n                    .addBinaryBody(\"file\", \"ABCD\".getBytes())\n                    .build())\n            .build();\n\n    ClassicHttpResponse response = httpClient.execute(request);\n\n    assertThat(EntityUtils.toString(response.getEntity()), response.getCode(), is(200));\n  }\n\n  @Test\n  public void handlesAbsenceOfPartsInAMultipartRequest() throws Exception {\n    stubFor(\n        post(\"/empty-multipart\")\n            .withMultipartRequestBody(aMultipart().withName(\"bits\").withBody(matching(\".*\")))\n            .willReturn(ok()));\n\n    ClassicHttpRequest request =\n        ClassicRequestBuilder.post(wireMockServer.baseUrl() + \"/empty-multipart\")\n            .setHeader(\n                \"Content-Type\",\n                \"multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\")\n            .setEntity(new StringEntity(\"\", MULTIPART_FORM_DATA))\n            .build();\n\n    HttpResponse response = httpClient.execute(request);\n\n    assertThat(response.getCode(), is(404));\n  }\n\n  /**\n   * @see <a href=\"https://github.com/tomakehurst/wiremock/issues/1047\">#1047</a>\n   */\n  @Test\n  public void acceptsAMultipartMixedRequestContainingATextAndAFilePart() throws Exception {\n    stubFor(\n        post(\"/multipart-mixed\")\n            .withMultipartRequestBody(aMultipart().withName(\"text\").withBody(containing(\"hello\")))\n            .withMultipartRequestBody(\n                aMultipart().withName(\"file\").withBody(binaryEqualTo(\"ABCD\".getBytes())))\n            .willReturn(ok()));\n\n    ClassicHttpRequest request =\n        ClassicRequestBuilder.post(wireMockServer.baseUrl() + \"/multipart-mixed\")\n            .setEntity(\n                MultipartEntityBuilder.create()\n                    .setMimeSubtype(\"mixed\")\n                    .addTextBody(\"text\", \"hello\")\n                    .addBinaryBody(\"file\", \"ABCD\".getBytes())\n                    .build())\n            .build();\n\n    ClassicHttpResponse response = httpClient.execute(request);\n\n    assertThat(EntityUtils.toString(response.getEntity()), response.getCode(), is(200));\n  }\n\n  /**\n   * @see <a href=\"https://github.com/tomakehurst/wiremock/issues/1047\">#1047</a>\n   */\n  @Test\n  public void acceptsAMultipartRelatedRequestContainingATextAndAFilePart() throws Exception {\n    stubFor(\n        post(\"/multipart-related\")\n            .withMultipartRequestBody(aMultipart().withName(\"text\").withBody(containing(\"hello\")))\n            .withMultipartRequestBody(\n                aMultipart().withName(\"file\").withBody(binaryEqualTo(\"ABCD\".getBytes())))\n            .willReturn(ok()));\n\n    ClassicHttpRequest request =\n        ClassicRequestBuilder.post(wireMockServer.baseUrl() + \"/multipart-related\")\n            .setEntity(\n                MultipartEntityBuilder.create()\n                    .setMimeSubtype(\"related\")\n                    .addTextBody(\"text\", \"hello\")\n                    .addBinaryBody(\"file\", \"ABCD\".getBytes())\n                    .build())\n            .build();\n\n    ClassicHttpResponse response = httpClient.execute(request);\n\n    assertThat(EntityUtils.toString(response.getEntity()), response.getCode(), is(200));\n  }\n\n  // https://github.com/tomakehurst/wiremock/issues/1179\n  @Test\n  public void multipartBodiesCanBeMatchedWhenStubsWithOtherBodyMatchTypesArePresent() {\n    stubFor(\n        post(\"/multipart\")\n            .withMultipartRequestBody(\n                aMultipart().withHeader(\"Content-Disposition\", containing(\"wiremocktest\")))\n            .willReturn(ok()));\n\n    stubFor(post(\"/json\").withRequestBody(equalToJson(\"{ \\\"stuff\\\": 123 }\")).willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.postWithMultiparts(\n            \"/multipart\", singletonList(part(\"wiremocktest\", \"Whatever\", TEXT_PLAIN)));\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  @Timeout(2)\n  void handlesLargeMultipartBody() {\n    stubFor(\n        post(\"/multipart\")\n            .withMultipartRequestBody(\n                aMultipart().withHeader(\"Content-Disposition\", containing(\"vlarge\")))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.postWithMultiparts(\n            \"/multipart\", singletonList(part(\"vlarge\", randomAlphanumeric(300000), TEXT_PLAIN)));\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void acceptsAMultipartRequestWithCamelcasedContentTypeInformation() throws Exception {\n    stubFor(\n        post(\"/multipart-camelcased-content-type\")\n            .withMultipartRequestBody(aMultipart().withName(\"field1\").withBody(containing(\"hello\")))\n            .withMultipartRequestBody(aMultipart().withName(\"field2\").withBody(containing(\"world\")))\n            .willReturn(ok()));\n\n    final URL url = new URL(wireMockServer.baseUrl() + \"/multipart-camelcased-content-type\");\n\n    final String boundary = \"uuid:\" + UUID.randomUUID();\n\n    // Test without leading Spaces\n    HttpURLConnection connection = prepareUrlConnectionForCamelcasedContentTypeInformation(url);\n    connection.setRequestProperty(\n        \"Content-Type\", \"Multipart/Form-Data; boundary=\\\"\" + boundary + \"\\\"\");\n    try (final OutputStream contentStream = connection.getOutputStream()) {\n      contentStream.write(getRequestBodyForCamelcasedContentTypeInformationWithBoundary(boundary));\n    }\n    assertThat(connection.getResponseCode(), is(200));\n  }\n\n  private HttpURLConnection prepareUrlConnectionForCamelcasedContentTypeInformation(URL url)\n      throws Exception {\n    final HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n    connection.setDoInput(true);\n    connection.setDoOutput(true);\n    connection.setUseCaches(false);\n    connection.setRequestMethod(\"POST\");\n    connection.setRequestProperty(\"Accept\", \"*/*\");\n    return connection;\n  }\n\n  private byte[] getRequestBodyForCamelcasedContentTypeInformationWithBoundary(String boundary) {\n    return (\"--\"\n            + boundary\n            + \"\\r\\n\"\n            + \"Content-Disposition: form-data; name=\\\"field1\\\"\\r\\n\"\n            + \"\\r\\n\"\n            + \"hello\\r\\n\"\n            + \"--\"\n            + boundary\n            + \"\\r\\n\"\n            + \"Content-Disposition: form-data; name=\\\"field2\\\"\\r\\n\"\n            + \"\\r\\n\"\n            + \"world\\r\\n\"\n            + \"--\"\n            + boundary\n            + \"--\")\n        .getBytes();\n  }\n\n  @Test\n  void acceptsAMultipartRequestWithCamelcasedContentTypeInformationPrefixedWithSpaces()\n      throws Exception {\n    stubFor(\n        post(\"/multipart-camelcased-content-type\")\n            .withMultipartRequestBody(aMultipart().withName(\"field1\").withBody(containing(\"hello\")))\n            .withMultipartRequestBody(aMultipart().withName(\"field2\").withBody(containing(\"world\")))\n            .willReturn(ok()));\n\n    final URL url = new URL(wireMockServer.baseUrl() + \"/multipart-camelcased-content-type\");\n\n    final String boundary = \"uuid:\" + UUID.randomUUID();\n\n    // Test without leading Spaces\n    HttpURLConnection connection = prepareUrlConnectionForCamelcasedContentTypeInformation(url);\n    connection.setRequestProperty(\n        \"Content-Type\", \"    Multipart/Form-Data; boundary=\\\"\" + boundary + \"\\\"\");\n    try (final OutputStream contentStream = connection.getOutputStream()) {\n      contentStream.write(getRequestBodyForCamelcasedContentTypeInformationWithBoundary(boundary));\n    }\n    assertThat(connection.getResponseCode(), is(200));\n  }\n\n  @Test\n  void acceptsAMultipartRelatedSOAPWithAttachmentRequest() throws Exception {\n    final String soapBody =\n        \"\"\"\n            <soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\">\n              <soap:Header></soap:Header>\n              <soap:Body>\n                <ns1:Test xmlns:ns1=\"http://www.test.org/some-test-namespace\">\n                  <ns1:Attachment>\n                    <xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"ref-to-attachment%40some.domain.org\"/>\n                  </ns1:Attachment>\n                </ns1:Test>\n              </soap:Body>\n            </soap:Envelope>\"\"\";\n\n    stubFor(\n        post(\"/multipart-related\")\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withHeader(\n                        \"content-type\",\n                        equalTo(\"application/xop+xml; type=\\\"application/soap+xml\\\"\"))\n                    .withBody(equalTo(soapBody)))\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withHeader(\"content-type\", equalTo(\"text/plain\"))\n                    .withHeader(\"content-id\", equalTo(\"<ref-to-attachment@some.domain.org>\"))\n                    .withBody(equalTo(\"some text/plain content\")))\n            .willReturn(ok()));\n\n    final ClassicHttpRequest request =\n        ClassicRequestBuilder.post(wireMockServer.baseUrl() + \"/multipart-related\")\n            .setEntity(\n                MultipartEntityBuilder.create()\n                    .setMimeSubtype(\"related\")\n                    .addPart(\n                        MultipartPartBuilder.create()\n                            .setBody(\n                                new StringBody(\n                                    soapBody,\n                                    ContentType.create(\"application/xop+xml\")\n                                        .withParameters(\n                                            new BasicNameValuePair(\n                                                \"type\", \"application/soap+xml\"))))\n                            .build())\n                    .addPart(\n                        MultipartPartBuilder.create()\n                            .setHeader(\"content-id\", \"<ref-to-attachment@some.domain.org>\")\n                            .setBody(\n                                new StringBody(\n                                    \"some text/plain content\", ContentType.create(\"text/plain\")))\n                            .build())\n                    .build())\n            .build();\n\n    ClassicHttpResponse response = httpClient.execute(request);\n\n    assertThat(response.getCode(), is(200));\n  }\n\n  @Test\n  public void acceptsQueryMethodRequestWithMultipartBody() {\n    stubFor(\n        query(\"/search\")\n            .withMultipartRequestBody(\n                aMultipart().withName(\"filters\").withBody(containing(\"active\")))\n            .withMultipartRequestBody(aMultipart().withName(\"data\").withBody(containing(\"SEARCH\")))\n            .willReturn(ok().withBody(\"Search results\")));\n\n    WireMockResponse response =\n        testClient.queryWithMultiparts(\n            \"/search\",\n            List.of(\n                part(\"filters\", \"active users\", TEXT_PLAIN),\n                part(\"data\", \"SEARCH DATA\", TEXT_PLAIN)));\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"Search results\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/MultipartTemplatingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.TestHttpHeader;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;\nimport org.apache.hc.core5.http.ContentType;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class MultipartTemplatingAcceptanceTest {\n\n  WireMockTestClient client;\n\n  @RegisterExtension\n  public static WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort().templatingEnabled(true).globalTemplating(true))\n          .build();\n\n  @BeforeEach\n  void init() {\n    client = new WireMockTestClient(wm.getPort());\n  }\n\n  @Test\n  public void multipartRequestPartsAreAvailableViaTemplating() {\n    wm.stubFor(\n        post(\"/templated\")\n            .willReturn(\n                ok(\n                    \"\"\"\n                                multipart:{{request.multipart}}\n                                text:binary={{request.parts.text.binary}}:{{request.parts.text.headers.content-type}}:{{request.parts.text.body}}\n                                file:binary={{request.parts.file.binary}}:{{request.parts.file.headers.content-type}}:{{request.parts.file.bodyAsBase64}}\"\"\")));\n\n    WireMockResponse response =\n        client.post(\n            \"/templated\",\n            MultipartEntityBuilder.create()\n                .addTextBody(\"text\", \"hello\", ContentType.TEXT_PLAIN)\n                .addBinaryBody(\n                    \"file\", \"ABCD\".getBytes(), ContentType.APPLICATION_OCTET_STREAM, \"abcd.bin\")\n                .build());\n\n    assertThat(\n        response.content(),\n        is(\n            \"\"\"\n                        multipart:true\n                        text:binary=false:text/plain; charset=UTF-8:hello\n                        file:binary=true:application/octet-stream:QUJDRA==\"\"\"));\n  }\n\n  @Test\n  public void multipartRequestPartsHeadersAreCaseInsensitive() {\n    wm.stubFor(\n        post(\"/templated\")\n            .willReturn(\n                ok(\n                    \"\"\"\n                                multipart:{{request.multipart}}\n                                text:content-type={{request.parts.text.headers.CoNtEnT-TyPe}}\n                                file:content-type={{request.parts.file.headers.cOnTeNt-tYpE}}\"\"\")));\n\n    WireMockResponse response =\n        client.post(\n            \"/templated\",\n            MultipartEntityBuilder.create()\n                .addTextBody(\"text\", \"hello\", ContentType.TEXT_PLAIN)\n                .addBinaryBody(\n                    \"file\", \"ABCD\".getBytes(), ContentType.APPLICATION_OCTET_STREAM, \"abcd.bin\")\n                .build());\n\n    assertThat(\n        response.content(),\n        is(\n            \"\"\"\n                        multipart:true\n                        text:content-type=text/plain; charset=UTF-8\n                        file:content-type=application/octet-stream\"\"\"));\n  }\n\n  @Test\n  public void returnsEmptyPartsInTemplateWhenRequestIsNotMultipart() {\n    wm.stubFor(\n        post(\"/templated\")\n            .willReturn(\n                ok(\n                    \"multipart:{{request.multipart}}\\n\"\n                        + \"text:{{request.parts.text.headers.content-type}}:{{request.parts.text.body}}\")));\n\n    WireMockResponse response = client.postJson(\"/templated\", \"{}\");\n\n    assertThat(response.content(), is(\"multipart:false\\n\" + \"text::\"));\n  }\n\n  @Test\n  public void ableToReturnTheNumberOfParts() {\n    wm.stubFor(\n        post(\"/templated\")\n            .willReturn(\n                ok(\"multipart:{{request.multipart}}\\n\" + \"part count = {{size request.parts}}\")));\n    WireMockResponse response =\n        client.post(\n            \"/templated\",\n            MultipartEntityBuilder.create()\n                .addTextBody(\"text\", \"hello\", ContentType.TEXT_PLAIN)\n                .addBinaryBody(\n                    \"file\", \"ABCD\".getBytes(), ContentType.APPLICATION_OCTET_STREAM, \"abcd.bin\")\n                .build());\n\n    assertThat(response.content(), is(\"multipart:true\\n\" + \"part count = 2\"));\n  }\n\n  @Test\n  public void ableToIterateOverParts() {\n    wm.stubFor(\n        post(\"/templated\")\n            .willReturn(\n                ok(\n                    \"\"\"\n                                multipart:{{request.multipart}}\n                                {{#each request.parts as |part|}}{{part.name}}:{{part.headers.content-type}}:{{part.body}}/\n                                {{/each}}\"\"\")));\n    WireMockResponse response =\n        client.post(\n            \"/templated\",\n            MultipartEntityBuilder.create()\n                .addTextBody(\"text\", \"hello\", ContentType.TEXT_PLAIN)\n                .addBinaryBody(\n                    \"file\", \"ABCD\".getBytes(), ContentType.APPLICATION_OCTET_STREAM, \"abcd.bin\")\n                .build());\n\n    assertThat(\n        response.content(),\n        is(\n            \"\"\"\n                        multipart:true\n                        text:text/plain; charset=UTF-8:hello/\n                        file:application/octet-stream:ABCD/\n                        \"\"\"));\n  }\n\n  @Test\n  public void requestPartTemplateModelCanBeOutputInATemplate() {\n    wm.stubFor(\n        post(\"/templated\")\n            .willReturn(\n                ok(\n                    \"\"\"\n                                multipart:{{request.multipart}}\n                                {{#each request.parts as |part|}}{{part}}\n                                {{/each}}\"\"\")));\n    WireMockResponse response =\n        client.post(\n            \"/templated\",\n            MultipartEntityBuilder.create()\n                .addTextBody(\"text\", \"hello\", ContentType.TEXT_PLAIN)\n                .addBinaryBody(\n                    \"file\", \"ABCD\".getBytes(), ContentType.APPLICATION_OCTET_STREAM, \"abcd.bin\")\n                .build());\n\n    assertThat(\n        response.content(),\n        is(\n            \"\"\"\n                        multipart:true\n                        [name='text', headers={content-disposition=form-data; name=\"text\", content-type=text/plain; charset=UTF-8}, body=hello]\n                        [name='file', headers={content-disposition=form-data; name=\"file\"; filename=\"abcd.bin\", content-type=application/octet-stream}, body=ABCD]\n                        \"\"\"));\n  }\n\n  @Test\n  void acceptsAMultipartRelatedRFC2387Request() {\n    final String boundary = \"boundary_example\";\n\n    final String expectBody =\n        \"\"\"\n                    {\n                      \"error\": {\n                        \"code\": 404,\n                        \"message\": \"parent not found.\"\n                      }\n                    }\"\"\";\n\n    wm.stubFor(\n        post(urlPathMatching(\"/templated\"))\n            .withQueryParam(\"uploadType\", equalTo(\"multipart\"))\n            .withHeader(\"Authorization\", matching(\"^Bearer [a-zA-Z0-9_\\\\-.]+$\"))\n            .withHeader(\"Content-Type\", equalTo(\"multipart/related; boundary=\" + boundary))\n            .withHeader(\"Content-Length\", equalTo(\"255\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(404)\n                    .withHeader(\"Content-Type\", \"application/json; charset=UTF-8\")\n                    .withBody(expectBody)));\n\n    String rfc2387Body =\n        \"--\"\n            + boundary\n            + \"\\r\\n\"\n            + \"Content-Type: application/json; charset=UTF-8\\r\\n\\r\\n\"\n            + \"{\\\"parents\\\": [\\\"parents_example\\\"], \\\"name\\\": \\\"test_upload.txt\\\"}\\r\\n\"\n            + \"--\"\n            + boundary\n            + \"\\r\\n\"\n            + \"Content-Transfer-Encoding: base64\\r\\n\\r\\n\"\n            + \"VGhpcyBpcyBhbiBleGFtcGxlIGJpbmFyeSBkYXRhLg==\\r\\n\"\n            + \"--\"\n            + boundary\n            + \"--\\r\\n\";\n\n    TestHttpHeader[] headers =\n        new TestHttpHeader[] {\n          new TestHttpHeader(\"Authorization\", \"Bearer token\"),\n          new TestHttpHeader(\"Content-Type\", \"multipart/related; boundary=\" + boundary)\n        };\n\n    WireMockResponse response =\n        client.postWithBody(\n            \"/templated?uploadType=multipart\", rfc2387Body, \"multipart/related\", headers);\n\n    assertThat(response.content(), is(expectBody));\n    assertThat(response.statusCode(), is(404));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/MultithreadConfigurationInheritanceTest.java",
    "content": "/*\n * Copyright (C) 2018-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.AfterAll;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.Timeout;\n\npublic class MultithreadConfigurationInheritanceTest {\n\n  private static WireMockServer wireMockServer;\n  private static WireMockTestClient client;\n\n  @BeforeAll\n  public static void setup() {\n    wireMockServer = new WireMockServer(0);\n    wireMockServer.start();\n    WireMock.configureFor(wireMockServer.port());\n    client = new WireMockTestClient(wireMockServer.port());\n  }\n\n  @AfterAll\n  public static void shutdown() {\n    wireMockServer.shutdown();\n  }\n\n  @Test\n  @Timeout(5000) // Add a timeout so the test will execute in a new thread\n  public void verifyConfigurationInherited() {\n    // Make a call to the wiremock server. If this doesn't call to 8082 this will fail\n    // with an exception\n    stubFor(any(urlEqualTo(\"/foo/bar\")).willReturn(aResponse().withStatus(200)));\n\n    client.get(\"/foo/bar\");\n\n    verify(getRequestedFor(urlPathEqualTo(\"/foo/bar\")));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/NearMissesAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.github.tomakehurst.wiremock.verification.NearMiss;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\nclass NearMissesAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  void nearMisses() {\n    stubFor(\n        get(urlEqualTo(\"/mypath\"))\n            .withHeader(\"My-Header\", equalTo(\"matched\"))\n            .willReturn(aResponse().withStatus(200)));\n    stubFor(\n        get(urlEqualTo(\"/otherpath\"))\n            .withHeader(\"My-Header\", equalTo(\"otherheaderval\"))\n            .willReturn(aResponse().withStatus(200)));\n    stubFor(\n        get(urlEqualTo(\"/yet/another/path\"))\n            .withHeader(\"X-Alt-Header\", equalTo(\"matchonthis\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    testClient.get(\"/otherpath\", withHeader(\"My-Header\", \"notmatched\"));\n\n    List<NearMiss> nearMisses = WireMock.findNearMissesForAllUnmatched();\n\n    assertThat(nearMisses.get(0).getRequest().getUrl(), is(\"/otherpath\"));\n    assertThat(nearMisses.get(1).getRequest().getUrl(), is(\"/otherpath\"));\n    assertThat(nearMisses.get(2).getRequest().getUrl(), is(\"/otherpath\"));\n\n    assertThat(nearMisses.get(0).getStubMapping().getRequest().getUrl(), is(\"/otherpath\"));\n    assertThat(nearMisses.get(1).getStubMapping().getRequest().getUrl(), is(\"/yet/another/path\"));\n    assertThat(nearMisses.get(2).getStubMapping().getRequest().getUrl(), is(\"/mypath\"));\n  }\n\n  @Test\n  void returnsAllUnmatchedRequests() {\n    stubFor(\n        get(urlEqualTo(\"/mypath\"))\n            .withHeader(\"My-Header\", equalTo(\"matched\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    testClient.get(\"/unmatched/path\");\n\n    List<LoggedRequest> unmatched = WireMock.findUnmatchedRequests();\n\n    assertThat(unmatched.size(), is(1));\n    assertThat(unmatched.get(0).getUrl(), is(\"/unmatched/path\"));\n  }\n\n  @Test\n  void returnsStubMappingNearMissesForARequest() {\n    stubFor(\n        get(urlEqualTo(\"/mypath\"))\n            .withHeader(\"My-Header\", equalTo(\"matched\"))\n            .willReturn(aResponse().withStatus(200)));\n    stubFor(\n        get(urlEqualTo(\"/otherpath\"))\n            .withHeader(\"My-Header\", equalTo(\"otherheaderval\"))\n            .willReturn(aResponse().withStatus(200)));\n    stubFor(\n        get(urlEqualTo(\"/yet/another/path\"))\n            .withHeader(\"X-Alt-Header\", equalTo(\"matchonthis\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    List<NearMiss> nearMisses =\n        WireMock.findNearMissesFor(\n            LoggedRequest.createFrom(\n                mockRequest().url(\"/otherpath\").header(\"My-Header\", \"notmatched\")));\n\n    assertThat(nearMisses.get(0).getRequest().getUrl(), is(\"/otherpath\"));\n    assertThat(nearMisses.get(1).getRequest().getUrl(), is(\"/otherpath\"));\n    assertThat(nearMisses.get(2).getRequest().getUrl(), is(\"/otherpath\"));\n\n    assertThat(nearMisses.get(0).getStubMapping().getRequest().getUrl(), is(\"/otherpath\"));\n    assertThat(nearMisses.get(1).getStubMapping().getRequest().getUrl(), is(\"/yet/another/path\"));\n    assertThat(nearMisses.get(2).getStubMapping().getRequest().getUrl(), is(\"/mypath\"));\n  }\n\n  @Test\n  void returnsRequestNearMissesForARequestPattern() {\n    testClient.get(\"/actual11\");\n    testClient.get(\"/actual42\");\n\n    List<NearMiss> nearMisses =\n        WireMock.findNearMissesFor(\n            getRequestedFor(urlEqualTo(\"/actual4\")).withRequestBody(containing(\"thing\")));\n\n    assertThat(nearMisses.size(), is(2));\n    assertThat(nearMisses.get(0).getRequest().getUrl(), is(\"/actual42\"));\n    assertThat(nearMisses.get(1).getRequest().getUrl(), is(\"/actual11\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/NearMissesRuleAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.verification.diff.JUnitStyleDiffRenderer.junitStyleDiffMessage;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.allOf;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.hasItem;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass;\n\nimport com.github.tomakehurst.wiremock.client.VerificationException;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.testsupport.TestNotifier;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport ignored.ManyUnmatchedRequestsTest;\nimport ignored.SingleUnmatchedRequestTest;\nimport java.util.concurrent.atomic.AtomicReference;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.junit.platform.engine.TestExecutionResult;\nimport org.junit.platform.launcher.Launcher;\nimport org.junit.platform.launcher.LauncherDiscoveryRequest;\nimport org.junit.platform.launcher.TestExecutionListener;\nimport org.junit.platform.launcher.TestIdentifier;\nimport org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder;\nimport org.junit.platform.launcher.core.LauncherFactory;\n\npublic class NearMissesRuleAcceptanceTest {\n\n  @Nested\n  class NearMissesRuleTest {\n\n    private final TestNotifier testNotifier = new TestNotifier();\n\n    @RegisterExtension\n    public WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(\n                options()\n                    .dynamicPort()\n                    .notifier(testNotifier)\n                    .withRootDirectory(\"src/main/resources/empty\"))\n            .build();\n\n    WireMockTestClient client;\n\n    @BeforeEach\n    public void init() {\n      client = new WireMockTestClient(wm.getPort());\n      testNotifier.reset();\n    }\n\n    @Test\n    void logsUnmatchedRequestsAtErrorWithNearMisses() {\n      wm.stubFor(get(urlEqualTo(\"/near-miss\")).willReturn(aResponse().withStatus(200)));\n      wm.stubFor(get(urlEqualTo(\"/miss\")).willReturn(aResponse().withStatus(200)));\n\n      client.post(\"/a-near-mis\");\n\n      assertThat(\n          testNotifier.getErrorMessages(),\n          hasItem(\n              allOf(\n                  containsString(\"Request was not matched\"),\n                  containsString(\"/a-near-mis\"),\n                  containsString(\"/near-miss\"),\n                  containsString(\"HTTP method does not match\"),\n                  containsString(\"URL does not match\"))));\n    }\n\n    @Test\n    void throwsVerificationExceptionIfSomeRequestsWentUnmatched() {\n      String message = runTestAndGetMessage(ManyUnmatchedRequestsTest.class);\n\n      assertThat(message, containsString(\"2 requests were unmatched by any stub mapping\"));\n      assertThat(\n          message, containsString(junitStyleDiffMessage(\"GET\\n/hit\\n\", \"GET\\n/near-misssss\\n\")));\n      assertThat(\n          message, containsString(junitStyleDiffMessage(\"GET\\n/hit\\n\", \"GET\\n/a-near-mis\\n\")));\n    }\n\n    @Test\n    void throwsVerificationExceptionIfASingleRequestWentUnmatched() {\n      String message = runTestAndGetMessage(SingleUnmatchedRequestTest.class);\n      assertThat(\n          message,\n          containsString(\"A request was unmatched by any stub mapping. Closest stub mapping was:\"));\n      assertThat(\n          message, containsString(junitStyleDiffMessage(\"GET\\n/hit\\n\", \"GET\\n/near-misssss\\n\")));\n    }\n\n    @Test\n    void shouldFindNearMatch() {\n      Throwable exception =\n          assertThrows(\n              VerificationException.class,\n              () -> {\n                client.get(\"/123\");\n\n                wm.verify(getRequestedFor(urlPathEqualTo(\"/\")));\n              });\n      assertTrue(\n          exception\n              .getMessage()\n              .contains(\"No requests exactly matched. Most similar request was:\"));\n    }\n\n    private String runTestAndGetMessage(Class<?> testClass) {\n      final AtomicReference<String> message = new AtomicReference<>(\"\");\n\n      LauncherDiscoveryRequest request =\n          LauncherDiscoveryRequestBuilder.request().selectors(selectClass(testClass)).build();\n      Launcher launcher = LauncherFactory.create();\n      launcher.registerTestExecutionListeners(\n          new TestExecutionListener() {\n            @Override\n            public void executionFinished(\n                TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) {\n              testExecutionResult.getThrowable().map(Throwable::getMessage).ifPresent(message::set);\n            }\n          });\n      launcher.execute(request);\n\n      return message.get();\n    }\n  }\n\n  @Nested\n  class CustomMatcherWithNearMissesTest {\n\n    @RegisterExtension\n    public WireMockExtension wmeWithCustomMatcher =\n        WireMockExtension.newInstance()\n            .options(\n                options()\n                    .dynamicPort()\n                    .withRootDirectory(\"src/main/resources/empty\")\n                    .extensions(\n                        new RequestMatcherExtension() {\n                          @Override\n                          public MatchResult match(Request request, Parameters parameters) {\n                            return MatchResult.partialMatch(0.5);\n                          }\n\n                          @Override\n                          public String getName() {\n                            return \"always-match\";\n                          }\n                        }))\n            .build();\n\n    WireMockTestClient client;\n\n    @BeforeEach\n    public void init() {\n      client = new WireMockTestClient(wmeWithCustomMatcher.getPort());\n    }\n\n    @Test\n    void successfullyCalculatesNearMissesWhenACustomMatcherIsRegistered() {\n      wmeWithCustomMatcher.stubFor(requestMatching(\"always-match\").willReturn(aResponse()));\n\n      client.get(\"/\");\n\n      assertThat(wmeWithCustomMatcher.findNearMissesForAllUnmatchedRequests().size(), is(1));\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/NetworkTrafficListenerAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\n\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.CollectingNetworkTrafficListener;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\n\npublic class NetworkTrafficListenerAcceptanceTest extends AcceptanceTestBase {\n  private static final CollectingNetworkTrafficListener networkTrafficListener =\n      new CollectingNetworkTrafficListener();\n\n  @BeforeAll\n  public static void setupServer() {\n    setupServer(new WireMockConfiguration().networkTrafficListener(networkTrafficListener));\n  }\n\n  @Test\n  void capturesRawTraffic() {\n    testClient.get(\"/a/non-registered/resource\");\n\n    assertThat(\n        networkTrafficListener.getAllRequests(),\n        containsString(\"GET /a/non-registered/resource HTTP/1.1\\r\\n\"));\n    assertThat(networkTrafficListener.getAllRequests(), containsString(\"User-Agent: WireMock\"));\n    assertThat(\n        networkTrafficListener.getAllResponses(), containsString(\"HTTP/1.1 404 Not Found\\r\\n\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/NotMatchedPageAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_TYPE;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.file;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalsMultiLine;\nimport static com.github.tomakehurst.wiremock.verification.notmatched.PlainTextStubNotMatchedRenderer.CONSOLE_WIDTH_HEADER_KEY;\nimport static java.util.Collections.singletonList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Gzip;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestFilterAction;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestWrapper;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.StubRequestFilter;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport com.github.tomakehurst.wiremock.verification.notmatched.NotMatchedRenderer;\nimport org.apache.hc.core5.http.ContentType;\nimport org.apache.hc.core5.http.io.entity.ByteArrayEntity;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class NotMatchedPageAcceptanceTest {\n\n  WireMockServer wm;\n  WireMockTestClient testClient;\n\n  @AfterEach\n  public void stop() {\n    wm.stop();\n  }\n\n  @Test\n  public void rendersAPlainTextDiffWhenStubNotMatchedAndANearMissIsAvailable() {\n    configure();\n\n    stubFor(\n        post(\"/thing\")\n            .withName(\n                \"The post stub with a really long name that ought to wrap and let us see exactly how that looks when it is done\")\n            .withHeader(\"X-My-Header\", containing(\"correct value\"))\n            .withHeader(\"Accept\", matching(\"text/plain.*\"))\n            .withRequestBody(\n                equalToJson(\n                    \"{                              \\n\"\n                        + \"    \\\"thing\\\": {               \\n\"\n                        + \"        \\\"stuff\\\": [1, 2, 3]   \\n\"\n                        + \"    }                          \\n\"\n                        + \"}\"))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.postJson(\n            \"/thin\",\n            \"{                        \\n\"\n                + \"    \\\"thing\\\": {           \\n\"\n                + \"        \\\"nothing\\\": {}    \\n\"\n                + \"    }                      \\n\"\n                + \"}\",\n            withHeader(\"X-My-Header\", \"wrong value\"),\n            withHeader(\"Accept\", \"text/plain\"));\n\n    assertThat(response.content(), equalsMultiLine(file(\"not-found-diff-sample_ascii.txt\")));\n  }\n\n  @Test\n  public void adjustsWidthWhenConsoleWidthHeaderSpecified() {\n    configure();\n\n    stubFor(\n        post(\"/thing\")\n            .withName(\n                \"The post stub with a really long name that ought to wrap and let us see exactly how that looks when it is done\")\n            .withHeader(\"X-My-Header\", containing(\"correct value\"))\n            .withHeader(\"Accept\", matching(\"text/plain.*\"))\n            .withRequestBody(\n                equalToJson(\n                    \"{                              \\n\"\n                        + \"    \\\"thing\\\": {               \\n\"\n                        + \"        \\\"stuff\\\": [1, 2, 3]   \\n\"\n                        + \"    }                          \\n\"\n                        + \"}\"))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.postJson(\n            \"/thin\",\n            \"{                        \\n\"\n                + \"    \\\"thing\\\": {           \\n\"\n                + \"        \\\"nothing\\\": {}    \\n\"\n                + \"    }                      \\n\"\n                + \"}\",\n            withHeader(\"X-My-Header\", \"wrong value\"),\n            withHeader(\"Accept\", \"text/plain\"),\n            withHeader(CONSOLE_WIDTH_HEADER_KEY, \"69\"));\n\n    System.out.println(response.content());\n    assertThat(response.content(), equalsMultiLine(file(\"not-found-diff-sample_ascii-narrow.txt\")));\n  }\n\n  @Test\n  public void rendersAPlainTextDiffWhenRequestIsOnlyUrlAndMethod() {\n    configure();\n\n    stubFor(get(\"/another-url\").withRequestBody(absent()).willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/gettable\");\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  public void showsADefaultMessageWhenNoStubsWerePresent() {\n    configure();\n\n    WireMockResponse response = testClient.get(\"/no-stubs-to-match\");\n\n    assertThat(response.statusCode(), is(404));\n    assertThat(response.firstHeader(CONTENT_TYPE), startsWith(\"text/plain\"));\n    assertThat(\n        response.content(),\n        is(\"No response could be served as there are no stub mappings in this WireMock instance.\"));\n  }\n\n  @Test\n  public void supportsCustomNoMatchRenderer() {\n    configure(\n        wireMockConfig()\n            .notMatchedRendererFactory(\n                extensions ->\n                    new NotMatchedRenderer() {\n                      @Override\n                      protected ResponseDefinition render(Admin admin, ServeEvent serveEvent) {\n                        return ResponseDefinitionBuilder.responseDefinition()\n                            .withStatus(403)\n                            .withBody(\"No you don't!\")\n                            .build();\n                      }\n                    }));\n\n    WireMockResponse response = testClient.get(\"/should-not-match\");\n\n    assertThat(response.statusCode(), is(403));\n    assertThat(response.content(), is(\"No you don't!\"));\n  }\n\n  @Test\n  public void returns404AndDiffReportWhenPlusSymbolInQuery() {\n    configure();\n\n    WireMockResponse response =\n        testClient.get(\"/some/api/records?sort=updated+asc&filter_updated_gt=2019-01-02\");\n    System.err.println(response.content());\n\n    assertThat(response.statusCode(), is(404));\n    assertThat(response.content(), containsString(\"No response could be served\"));\n  }\n\n  @Test\n  public void indicatesWhenWrongScenarioStateIsTheReasonForNonMatch() {\n    configure();\n\n    stubFor(\n        post(\"/thing\")\n            .inScenario(\"thing states\")\n            .whenScenarioStateIs(\"first\")\n            .willReturn(ok(\"Done!\")));\n\n    WireMockResponse response = testClient.postJson(\"/thing\", \"{}\");\n\n    assertThat(\n        response.content(), equalsMultiLine(file(\"not-found-diff-sample_scenario-state.txt\")));\n  }\n\n  @Test\n  public void showsDescriptiveDiffLineForLogicalOrWithAbsent() {\n    configure();\n\n    stubFor(\n        get(urlPathEqualTo(\"/or\"))\n            .withHeader(\"X-Maybe\", equalTo(\"one\").or(absent()))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/or\", withHeader(\"X-Maybe\", \"wrong\"));\n\n    assertThat(response.statusCode(), is(404));\n    assertThat(response.content(), equalsMultiLine(file(\"not-found-diff-sample-logical-or.txt\")));\n  }\n\n  @Test\n  public void requestValuesTransformedByRequestFilterAreShownInDiff() {\n    configure(\n        wireMockConfig()\n            .extensions(\n                new StubRequestFilter() {\n                  @Override\n                  public RequestFilterAction filter(Request request) {\n                    Request wrappedRequest =\n                        RequestWrapper.create()\n                            .transformHeader(\n                                \"X-My-Header\", source -> singletonList(\"modified value\"))\n                            .wrap(request);\n                    return RequestFilterAction.continueWith(wrappedRequest);\n                  }\n\n                  @Override\n                  public String getName() {\n                    return \"thing-changer-filter\";\n                  }\n                }));\n\n    stubFor(get(\"/filter\").withHeader(\"X-My-Header\", equalTo(\"original value\")).willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.get(\"/filter\", withHeader(\"X-My-Header\", \"original value\"));\n\n    assertThat(response.statusCode(), is(404));\n    assertThat(response.content(), containsString(\"| X-My-Header: modified value\"));\n  }\n\n  @Test\n  public void showsNotFoundDiffMessageForNonStandardHttpMethods() {\n    configure();\n    stubFor(request(\"PAAARP\", urlPathEqualTo(\"/pip\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.request(\"PAAARP\", \"/pop\");\n\n    assertThat(response.statusCode(), is(404));\n    assertThat(response.content(), containsString(\"Request was not matched\"));\n  }\n\n  @Test\n  public void showsNotFoundDiffMessageWhenRequestBodyIsGZipped() {\n    configure();\n    stubFor(\n        post(urlPathEqualTo(\"/gzip\"))\n            .withHeader(\"Content-Encoding\", equalToIgnoreCase(\"gzip\"))\n            .withRequestBody(equalToJson(\"{\\\"id\\\":\\\"ok\\\"}\"))\n            .willReturn(ok()));\n\n    ByteArrayEntity entity =\n        new ByteArrayEntity(Gzip.gzip(\"{\\\"id\\\":\\\"wrong\\\"}\"), ContentType.DEFAULT_BINARY);\n    WireMockResponse response =\n        testClient.post(\"/gzip\", entity, withHeader(\"Content-Encoding\", \"gzip\"));\n\n    assertThat(response.statusCode(), is(404));\n    assertThat(response.content(), containsString(\"Request was not matched\"));\n  }\n\n  private void configure() {\n    configure(wireMockConfig().dynamicPort());\n  }\n\n  private void configure(WireMockConfiguration options) {\n    options.dynamicPort().withRootDirectory(\"src/test/resources/empty\");\n    wm = new WireMockServer(options);\n    wm.start();\n    testClient = new WireMockTestClient(wm.port());\n    WireMock.configureFor(wm.port());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/PortNumberTest.java",
    "content": "/*\n * Copyright (C) 2011-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.greaterThan;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples;\nimport com.github.tomakehurst.wiremock.testsupport.Network;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class PortNumberTest {\n\n  private List<WireMockServer> createdServers;\n\n  @BeforeEach\n  public void setup() {\n    createdServers = new ArrayList<WireMockServer>();\n  }\n\n  @AfterEach\n  public void stopServers() {\n    for (WireMockServer wireMockServer : createdServers) {\n      if (wireMockServer.isRunning()) {\n        wireMockServer.stop();\n      }\n    }\n  }\n\n  @Test\n  public void canRunOnAnotherPortThan8080() {\n    int port = Network.findFreePort();\n    WireMockServer wireMockServer = createServer(wireMockConfig().port(port));\n    wireMockServer.start();\n    WireMockTestClient wireMockClient = new WireMockTestClient(port);\n\n    wireMockClient.addResponse(MappingJsonSamples.BASIC_MAPPING_REQUEST_WITH_RESPONSE_HEADER);\n    WireMockResponse response = wireMockClient.get(\"/a/registered/resource\");\n    assertThat(response.statusCode(), is(401));\n  }\n\n  @Test\n  public void configuredPortIsReportedListeningPort() {\n    int port = Network.findFreePort();\n    int httpsPort = Network.findFreePort();\n    WireMockServer wireMockServer = createServer(wireMockConfig().port(port).httpsPort(httpsPort));\n    wireMockServer.start();\n\n    assertThat(wireMockServer.port(), is(port));\n    assertThat(wireMockServer.httpsPort(), is(httpsPort));\n  }\n\n  @Test\n  public void unstartedServerThrowsExceptionWhenAttemptingToRetrievePort() {\n    assertThrows(\n        IllegalStateException.class,\n        () -> createServer(wireMockConfig().port(Network.findFreePort())).port());\n  }\n\n  @Test\n  public void unstartedServerThrowsExceptionWhenAttemptingToRetrieveHttpsPort() {\n    assertThrows(\n        IllegalStateException.class,\n        () -> createServer(wireMockConfig().httpsPort(Network.findFreePort())).httpsPort());\n  }\n\n  @Test\n  public void serverWithoutHttpsThrowsExceptionWhenAttemptingToRetrieveHttpsPort() {\n    assertThrows(\n        IllegalStateException.class,\n        () -> {\n          WireMockServer wireMockServer =\n              createServer(wireMockConfig().port(Network.findFreePort()));\n          wireMockServer.start();\n          wireMockServer.httpsPort();\n        });\n  }\n\n  @Test\n  public void configuringPortZeroPicksArbitraryPort() {\n    WireMockServer wireMockServer = createServer(wireMockConfig().port(0).httpsPort(0));\n    wireMockServer.start();\n    assertThat(wireMockServer.port(), greaterThan(0));\n    assertThat(wireMockServer.httpsPort(), greaterThan(0));\n  }\n\n  private WireMockServer createServer(WireMockConfiguration configuration) {\n    final WireMockServer wireMockServer = new WireMockServer(configuration);\n    createdServers.add(wireMockServer);\n    return wireMockServer;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/PostServeActionExtensionTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.PostServeActionExtensionTest.CounterNameParameter.counterNameParameter;\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonPartEquals;\nimport static org.awaitility.Awaitility.await;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.admin.Router;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.AdminApiExtension;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.PostServeAction;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.concurrent.Callable;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class PostServeActionExtensionTest {\n\n  WireMockServer wm;\n  WireMockTestClient client;\n\n  void initWithOptions(Options options) {\n    wm = new WireMockServer(options);\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  @AfterEach\n  public void cleanup() {\n    if (wm != null) {\n      wm.stop();\n    }\n  }\n\n  @Test\n  public void triggersActionWhenAppliedToAStubMapping() throws Exception {\n    initWithOptions(options().dynamicPort().extensions(new NamedCounterAction()));\n\n    StubMapping stubMapping =\n        wm.stubFor(\n            get(urlPathEqualTo(\"/count-me\"))\n                .withPostServeAction(\"count-request\", counterNameParameter().withName(\"things\"))\n                .willReturn(aResponse()));\n\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/things\"), is(\"4\"));\n\n    // We should serialise out in array form\n    assertThat(\n        client.get(\"/__admin/mappings/\" + stubMapping.getId()).content(),\n        jsonPartEquals(\n            \"postServeActions\",\n            \"[\\n\"\n                + \"    {\\n\"\n                + \"      \\\"name\\\": \\\"count-request\\\",\\n\"\n                + \"      \\\"parameters\\\": {\\n\"\n                + \"        \\\"counterName\\\": \\\"things\\\"\\n\"\n                + \"      }\\n\"\n                + \"    }\\n\"\n                + \"  ]\"));\n  }\n\n  @Test\n  public void continuesWithNoEffectIfANonExistentActionIsReferenced() {\n    initWithOptions(options().dynamicPort());\n\n    wm.stubFor(\n        get(urlPathEqualTo(\"/as-normal\"))\n            .withPostServeAction(\"does-not-exist\", counterNameParameter().withName(\"things\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    assertThat(client.get(\"/as-normal\").statusCode(), is(200));\n  }\n\n  @Test\n  public void providesServeEventWithResponseFieldPopulated() throws InterruptedException {\n    final AtomicInteger finalStatus = new AtomicInteger();\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .extensions(\n                new PostServeAction() {\n                  @Override\n                  public String getName() {\n                    return \"response-field-test\";\n                  }\n\n                  @Override\n                  public void doGlobalAction(ServeEvent serveEvent, Admin admin) {\n                    if (serveEvent.getResponse() != null) {\n                      finalStatus.set(serveEvent.getResponse().getStatus());\n                    }\n                  }\n                }));\n\n    wm.stubFor(get(urlPathEqualTo(\"/response-status\")).willReturn(aResponse().withStatus(418)));\n\n    client.get(\"/response-status\");\n\n    await().atMost(5, SECONDS).until(getValue(finalStatus), is(418));\n  }\n\n  @Test\n  public void canBeSpecifiedAsAJsonObject() {\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .notifier(new ConsoleNotifier(true))\n            .extensions(new NamedCounterAction()));\n\n    WireMockResponse response =\n        client.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"  \\\"request\\\" : {\\n\"\n                + \"    \\\"urlPath\\\" : \\\"/count-me\\\",\\n\"\n                + \"    \\\"method\\\" : \\\"GET\\\"\\n\"\n                + \"  },\\n\"\n                + \"  \\\"response\\\" : {\\n\"\n                + \"    \\\"status\\\" : 200\\n\"\n                + \"  },\\n\"\n                + \"  \\\"postServeActions\\\": {\\n\"\n                + \"    \\\"count-request\\\": {\\n\"\n                + \"      \\\"counterName\\\": \\\"things\\\"\\n\"\n                + \"    } \\n\"\n                + \"  }\\n\"\n                + \"}\");\n\n    assertThat(response.content(), response.statusCode(), is(201));\n\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/things\"), is(\"2\"));\n  }\n\n  @Test\n  public void multipleActionsOfTheSameNameCanBeSpecifiedViaTheDSL() {\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .notifier(new ConsoleNotifier(true))\n            .extensions(new NamedCounterAction()));\n\n    wm.stubFor(\n        get(urlPathEqualTo(\"/count-me\"))\n            .willReturn(ok())\n            .withPostServeAction(\"count-request\", counterNameParameter().withName(\"one\"))\n            .withPostServeAction(\"count-request\", counterNameParameter().withName(\"two\")));\n\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/one\"), is(\"3\"));\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/two\"), is(\"3\"));\n  }\n\n  @Test\n  public void multipleActionsOfTheSameNameCanBeSpecifiedAsAJsonArray() {\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .notifier(new ConsoleNotifier(true))\n            .extensions(new NamedCounterAction()));\n\n    WireMockResponse response =\n        client.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"  \\\"request\\\": {\\n\"\n                + \"    \\\"urlPath\\\": \\\"/count-me\\\",\\n\"\n                + \"    \\\"method\\\": \\\"GET\\\"\\n\"\n                + \"  },\\n\"\n                + \"  \\\"response\\\": {\\n\"\n                + \"    \\\"status\\\": 200\\n\"\n                + \"  },\\n\"\n                + \"  \\\"postServeActions\\\": [\\n\"\n                + \"    {\\n\"\n                + \"      \\\"name\\\": \\\"count-request\\\",\\n\"\n                + \"      \\\"parameters\\\": {\\n\"\n                + \"        \\\"counterName\\\": \\\"one\\\"  \\n\"\n                + \"      }\\n\"\n                + \"    },\\n\"\n                + \"    {\\n\"\n                + \"      \\\"name\\\": \\\"count-request\\\",\\n\"\n                + \"      \\\"parameters\\\": {\\n\"\n                + \"        \\\"counterName\\\": \\\"two\\\"\\n\"\n                + \"      }\\n\"\n                + \"    }\\n\"\n                + \"  ]\\n\"\n                + \"}\");\n\n    assertThat(response.content(), response.statusCode(), is(201));\n\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/one\"), is(\"3\"));\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/two\"), is(\"3\"));\n  }\n\n  private Callable<Integer> getValue(final AtomicInteger value) {\n    return value::get;\n  }\n\n  private Callable<String> getContent(final String url) {\n    return () -> client.get(url).content();\n  }\n\n  public static class NamedCounterAction extends PostServeAction implements AdminApiExtension {\n\n    private final ConcurrentHashMap<String, Integer> counters = new ConcurrentHashMap<>();\n\n    @Override\n    public String getName() {\n      return \"count-request\";\n    }\n\n    @Override\n    public void contributeAdminApiRoutes(Router router) {\n      router.add(\n          GET,\n          \"/named-counter/{name}\",\n          (admin, serveEvent, pathParams) -> {\n            String name = pathParams.get(\"name\");\n            Integer count = getFirstNonNull(counters.get(name), 0);\n            return responseDefinition().withStatus(200).withBody(String.valueOf(count)).build();\n          });\n    }\n\n    @Override\n    public void doAction(ServeEvent serveEvent, Admin admin, Parameters parameters) {\n      CounterNameParameter counterNameParam = parameters.as(CounterNameParameter.class);\n\n      String counterName = counterNameParam.counterName;\n\n      counters.putIfAbsent(counterName, 0);\n      Integer oldValue;\n      Integer newValue;\n\n      do {\n        oldValue = counters.get(counterName);\n        newValue = oldValue + 1;\n      } while (!counters.replace(counterName, oldValue, newValue));\n    }\n  }\n\n  public static class CounterNameParameter {\n\n    public String counterName;\n\n    public CounterNameParameter(@JsonProperty(\"counterName\") String counterName) {\n      this.counterName = counterName;\n    }\n\n    public CounterNameParameter() {}\n\n    public static CounterNameParameter counterNameParameter() {\n      return new CounterNameParameter();\n    }\n\n    public CounterNameParameter withName(String name) {\n      this.counterName = name;\n      return this;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ProxyAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.client.WireMock.any;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_ENCODING;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getLast;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\nimport static org.apache.hc.core5.http.ContentType.TEXT_PLAIN;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.NetworkAddressRules;\nimport com.github.tomakehurst.wiremock.common.ProxySettings;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.testsupport.TestHttpHeader;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.google.common.base.Stopwatch;\nimport com.google.common.collect.Multimap;\nimport com.sun.net.httpserver.HttpServer;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.net.InetSocketAddress;\nimport java.util.Arrays;\nimport java.util.Base64;\nimport java.util.List;\nimport java.util.UUID;\nimport org.apache.hc.client5.http.classic.methods.HttpHead;\nimport org.apache.hc.client5.http.entity.GzipCompressingEntity;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.ContentType;\nimport org.apache.hc.core5.http.HttpEntity;\nimport org.apache.hc.core5.http.io.entity.ByteArrayEntity;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.ValueSource;\n\npublic class ProxyAcceptanceTest {\n\n  private String targetServiceBaseUrl;\n\n  WireMockServer targetService;\n  WireMock target;\n\n  WireMockServer proxyingService;\n  WireMock proxy;\n\n  WireMockTestClient testClient;\n\n  void init(WireMockConfiguration proxyingServiceOptions) {\n    targetService =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .dynamicHttpsPort()\n                .bindAddress(\"127.0.0.1\")\n                .stubCorsEnabled(true));\n    targetService.start();\n    target = WireMock.create().host(\"localhost\").port(targetService.port()).build();\n\n    targetServiceBaseUrl = \"http://localhost:\" + targetService.port();\n\n    proxyingServiceOptions.dynamicPort().bindAddress(\"127.0.0.1\");\n    proxyingService = new WireMockServer(proxyingServiceOptions);\n    proxyingService.start();\n    proxy = WireMock.create().port(proxyingService.port()).build();\n    testClient = new WireMockTestClient(proxyingService.port());\n\n    WireMock.configureFor(targetService.port());\n  }\n\n  void initWithDefaultConfig() {\n    init(wireMockConfig());\n  }\n\n  @AfterEach\n  public void stop() {\n    targetService.stop();\n    proxyingService.stop();\n  }\n\n  @Test\n  public void successfullyGetsResponseFromOtherServiceViaProxy() {\n    initWithDefaultConfig();\n\n    target.register(\n        get(urlEqualTo(\"/proxied/resource?param=value\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Proxied content\")));\n\n    proxy.register(\n        any(urlEqualTo(\"/proxied/resource?param=value\"))\n            .atPriority(10)\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    WireMockResponse response = testClient.get(\"/proxied/resource?param=value\");\n\n    assertThat(response.content(), is(\"Proxied content\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n  }\n\n  @Test\n  public void\n      successfullyGetsResponseFromOtherServiceViaProxyWhenInjectingAdditionalRequestHeaders() {\n    initWithDefaultConfig();\n\n    proxy.register(\n        any(urlEqualTo(\"/additional/headers\"))\n            .atPriority(10)\n            .willReturn(\n                aResponse()\n                    .proxiedFrom(targetServiceBaseUrl)\n                    .withAdditionalRequestHeader(\"a\", \"b\")\n                    .withAdditionalRequestHeader(\"c\", \"d\")));\n\n    testClient.get(\"/additional/headers\");\n\n    target.verifyThat(\n        getRequestedFor(urlEqualTo(\"/additional/headers\"))\n            .withHeader(\"a\", equalTo(\"b\"))\n            .withHeader(\"c\", equalTo(\"d\")));\n  }\n\n  @Test\n  public void\n      successfullyGetsResponseFromOtherServiceViaProxyInjectingHeadersOverridingSentHeaders() {\n    initWithDefaultConfig();\n\n    target.register(\n        get(urlEqualTo(\"/proxied/resource?param=value\"))\n            .withHeader(\"a\", equalTo(\"b\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"Proxied content\")));\n\n    proxy.register(\n        any(urlEqualTo(\"/proxied/resource?param=value\"))\n            .atPriority(10)\n            .willReturn(\n                aResponse()\n                    .proxiedFrom(targetServiceBaseUrl)\n                    .withAdditionalRequestHeader(\"a\", \"b\")));\n\n    WireMockResponse response =\n        testClient.get(\"/proxied/resource?param=value\", withHeader(\"a\", \"doh\"));\n\n    assertThat(response.content(), is(\"Proxied content\"));\n  }\n\n  @Test\n  public void successfullyPostsResponseToOtherServiceViaProxy() {\n    initWithDefaultConfig();\n\n    target.register(post(urlEqualTo(\"/proxied/resource\")).willReturn(aResponse().withStatus(204)));\n\n    proxy.register(\n        any(urlEqualTo(\"/proxied/resource\"))\n            .atPriority(10)\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    WireMockResponse response =\n        testClient.postWithBody(\"/proxied/resource\", \"Post content\", \"text/plain\", \"utf-8\");\n\n    assertThat(response.statusCode(), is(204));\n    target.verifyThat(\n        postRequestedFor(urlEqualTo(\"/proxied/resource\"))\n            .withRequestBody(matching(\"Post content\")));\n  }\n\n  @Test\n  public void successfullyGetsResponseFromOtherServiceViaProxyWithEscapeCharsInUrl() {\n    initWithDefaultConfig();\n\n    target.register(\n        get(urlEqualTo(\"/%26%26The%20Lord%20of%20the%20Rings%26%26\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    proxy.register(\n        any(urlEqualTo(\"/%26%26The%20Lord%20of%20the%20Rings%26%26\"))\n            .atPriority(10)\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    WireMockResponse response = testClient.get(\"/%26%26The%20Lord%20of%20the%20Rings%26%26\");\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void successfullyGetsResponseBinaryResponses() throws IOException {\n    initWithDefaultConfig();\n\n    final byte[] bytes =\n        new byte[] {\n          0x10, 0x49, 0x6e, (byte) 0xb7, 0x46, (byte) 0xe6, 0x52, (byte) 0x95, (byte) 0x95, 0x42\n        };\n    HttpServer server = HttpServer.create(new InetSocketAddress(0), 0);\n    server.createContext(\n        \"/binary\",\n        exchange -> {\n          InputStream request = exchange.getRequestBody();\n\n          byte[] buffy = new byte[10];\n          request.read(buffy);\n\n          if (Arrays.equals(buffy, bytes)) {\n            exchange.sendResponseHeaders(200, bytes.length);\n\n            OutputStream out = exchange.getResponseBody();\n            out.write(bytes);\n            out.close();\n          } else {\n            exchange.sendResponseHeaders(500, 0);\n            exchange.close();\n          }\n        });\n    server.start();\n\n    proxy.register(\n        post(urlEqualTo(\"/binary\"))\n            .willReturn(\n                aResponse()\n                    .proxiedFrom(\"http://localhost:\" + server.getAddress().getPort())\n                    .withBody(bytes)));\n\n    WireMockResponse post =\n        testClient.post(\"/binary\", new ByteArrayEntity(bytes, ContentType.DEFAULT_BINARY));\n    assertThat(post.statusCode(), is(200));\n    assertThat(post.binaryContent(), Matchers.equalTo(bytes));\n  }\n\n  @Test\n  public void sendsContentLengthHeaderInRequestWhenPostingIfPresentInOriginalRequest() {\n    initWithDefaultConfig();\n\n    target.register(post(urlEqualTo(\"/with/length\")).willReturn(aResponse().withStatus(201)));\n    proxy.register(\n        post(urlEqualTo(\"/with/length\")).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    testClient.postWithBody(\"/with/length\", \"TEST\", \"application/x-www-form-urlencoded\", \"utf-8\");\n\n    target.verifyThat(\n        postRequestedFor(urlEqualTo(\"/with/length\")).withHeader(\"Content-Length\", equalTo(\"4\")));\n  }\n\n  @Test\n  public void returnsContentLengthHeaderFromTargetResponseIfPresentAndChunkedEncodingEnabled()\n      throws Exception {\n    init(wireMockConfig().useChunkedTransferEncoding(Options.ChunkedEncodingPolicy.ALWAYS));\n\n    String path = \"/response/length\";\n    target.register(head(urlPathEqualTo(path)).willReturn(ok().withHeader(\"Content-Length\", \"4\")));\n    proxy.register(any(anyUrl()).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    CloseableHttpClient httpClient = ApacheHttpClientFactory.createClient();\n    HttpHead request = new HttpHead(proxyingService.baseUrl() + path);\n    try (CloseableHttpResponse response = httpClient.execute(request)) {\n      assertThat(response.getCode(), is(200));\n      assertThat(response.getFirstHeader(\"Content-Length\").getValue(), is(\"4\"));\n    }\n  }\n\n  @Test\n  public void returnsContentLengthHeaderFromTargetResponseIfPresentAndChunkedEncodingDisabled()\n      throws Exception {\n    init(wireMockConfig().useChunkedTransferEncoding(Options.ChunkedEncodingPolicy.NEVER));\n\n    String path = \"/response/length\";\n    target.register(head(urlPathEqualTo(path)).willReturn(ok().withHeader(\"Content-Length\", \"4\")));\n    proxy.register(any(anyUrl()).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    CloseableHttpClient httpClient = ApacheHttpClientFactory.createClient();\n    HttpHead request = new HttpHead(proxyingService.baseUrl() + path);\n    try (CloseableHttpResponse response = httpClient.execute(request)) {\n      assertThat(response.getCode(), is(200));\n      assertThat(response.getFirstHeader(\"Content-Length\").getValue(), is(\"4\"));\n    }\n  }\n\n  @Test\n  public void sendsTransferEncodingChunkedWhenPostingIfPresentInOriginalRequest() {\n    initWithDefaultConfig();\n\n    target.register(post(urlEqualTo(\"/chunked\")).willReturn(aResponse().withStatus(201)));\n    proxy.register(\n        post(urlEqualTo(\"/chunked\")).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    testClient.postWithChunkedBody(\"/chunked\", \"TEST\".getBytes());\n\n    List<LoggedRequest> loggedRequests = target.find(postRequestedFor(urlEqualTo(\"/chunked\")));\n    assertThat(loggedRequests.size(), is(1));\n    assertThat(loggedRequests.get(0).header(\"Transfer-Encoding\").firstValue(), is(\"chunked\"));\n  }\n\n  @Test\n  public void preservesHostHeaderWhenSpecified() {\n    init(wireMockConfig().preserveHostHeader(true));\n\n    target.register(\n        get(urlEqualTo(\"/preserve-host-header\")).willReturn(aResponse().withStatus(200)));\n    proxy.register(\n        get(urlEqualTo(\"/preserve-host-header\"))\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    testClient.get(\"/preserve-host-header\", withHeader(\"Host\", \"my.host\"));\n\n    proxy.verifyThat(\n        getRequestedFor(urlEqualTo(\"/preserve-host-header\"))\n            .withHeader(\"Host\", equalTo(\"my.host\")));\n    target.verifyThat(\n        getRequestedFor(urlEqualTo(\"/preserve-host-header\"))\n            .withHeader(\"Host\", equalTo(\"my.host\")));\n  }\n\n  @Test\n  public void usesProxyUrlBasedHostHeaderWhenPreserveHostHeaderNotSpecified() {\n    init(wireMockConfig().preserveHostHeader(false));\n\n    target.register(get(urlEqualTo(\"/host-header\")).willReturn(aResponse().withStatus(200)));\n    proxy.register(\n        get(urlEqualTo(\"/host-header\")).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    testClient.get(\"/host-header\", withHeader(\"Host\", \"my.host\"));\n\n    proxy.verifyThat(\n        getRequestedFor(urlEqualTo(\"/host-header\")).withHeader(\"Host\", equalTo(\"my.host\")));\n    target.verifyThat(\n        getRequestedFor(urlEqualTo(\"/host-header\"))\n            .withHeader(\"Host\", equalTo(\"localhost:\" + targetService.port())));\n  }\n\n  @Test\n  public void preservesUserAgentProxyHeaderWhenSpecified() {\n    init(wireMockConfig().preserveUserAgentProxyHeader(true));\n\n    target.register(\n        get(urlEqualTo(\"/preserve-user-agent-header\")).willReturn(aResponse().withStatus(200)));\n    proxy.register(\n        get(urlEqualTo(\"/preserve-user-agent-header\"))\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    testClient.get(\"/preserve-user-agent-header\", withHeader(\"User-Agent\", \"my-user-agent\"));\n\n    proxy.verifyThat(\n        getRequestedFor(urlEqualTo(\"/preserve-user-agent-header\"))\n            .withHeader(\"User-Agent\", equalTo(\"my-user-agent\")));\n    target.verifyThat(\n        getRequestedFor(urlEqualTo(\"/preserve-user-agent-header\"))\n            .withHeader(\"User-Agent\", equalTo(\"my-user-agent\")));\n  }\n\n  @Test\n  public void usesWireMockUserAgentProxyHeaderWhenPreserveUserAgentProxyHeaderNotSpecified() {\n    init(wireMockConfig());\n\n    target.register(\n        get(urlEqualTo(\"/preserve-user-agent-header\")).willReturn(aResponse().withStatus(200)));\n    proxy.register(\n        get(urlEqualTo(\"/preserve-user-agent-header\"))\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    testClient.get(\"/preserve-user-agent-header\", withHeader(\"User-Agent\", \"my-user-agent\"));\n\n    proxy.verifyThat(\n        getRequestedFor(urlEqualTo(\"/preserve-user-agent-header\"))\n            .withHeader(\"User-Agent\", equalTo(\"my-user-agent\")));\n    target.verifyThat(\n        getRequestedFor(urlEqualTo(\"/preserve-user-agent-header\"))\n            .withHeader(\"User-Agent\", matching(\"WireMock .*\")));\n  }\n\n  @Test\n  public void proxiesPatchRequestsWithBody() {\n    initWithDefaultConfig();\n\n    target.register(patch(urlEqualTo(\"/patch\")).willReturn(aResponse().withStatus(200)));\n    proxy.register(\n        patch(urlEqualTo(\"/patch\")).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    testClient.patchWithBody(\"/patch\", \"Patch body\", \"text/plain\", \"utf-8\");\n\n    target.verifyThat(\n        patchRequestedFor(urlEqualTo(\"/patch\")).withRequestBody(equalTo(\"Patch body\")));\n  }\n\n  @Test\n  public void addsSpecifiedHeadersToResponse() {\n    initWithDefaultConfig();\n\n    target.register(\n        get(urlEqualTo(\"/extra/headers\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Proxied content\")));\n\n    proxy.register(\n        any(urlEqualTo(\"/extra/headers\"))\n            .willReturn(\n                aResponse()\n                    .withHeader(\"X-Additional-Header\", \"Yep\")\n                    .proxiedFrom(targetServiceBaseUrl)));\n\n    WireMockResponse response = testClient.get(\"/extra/headers\");\n\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n    assertThat(response.firstHeader(\"X-Additional-Header\"), is(\"Yep\"));\n  }\n\n  @Test\n  public void doesNotDuplicateCookieHeaders() {\n    initWithDefaultConfig();\n\n    target.register(\n        get(urlEqualTo(\"/duplicate/cookies\"))\n            .willReturn(aResponse().withStatus(200).withHeader(\"Set-Cookie\", \"session=1234\")));\n    proxy.register(\n        get(urlEqualTo(\"/duplicate/cookies\"))\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    testClient.get(\"/duplicate/cookies\");\n    testClient.get(\"/duplicate/cookies\", withHeader(\"Cookie\", \"session=1234\"));\n\n    LoggedRequest lastRequest =\n        getLast(target.find(getRequestedFor(urlEqualTo(\"/duplicate/cookies\"))));\n    assertThat(lastRequest.getHeaders().getHeader(\"Cookie\").values().size(), is(1));\n  }\n\n  // TODO: This is passing even when it probably shouldn't - investigate\n  @Test\n  public void doesNotDuplicateConnectionHeader() {\n    initWithDefaultConfig();\n    register200StubOnProxyAndTarget(\"/duplicate/connection-header\");\n\n    testClient.get(\"/duplicate/connection-header\");\n    LoggedRequest lastRequest =\n        getLast(target.find(getRequestedFor(urlEqualTo(\"/duplicate/connection-header\"))));\n    assertThat(lastRequest.getHeaders().getHeader(\"Connection\").values(), hasItem(\"keep-alive\"));\n  }\n\n  @Test\n  public void acceptsSelfSignedSslCertFromProxyTarget() {\n    initWithDefaultConfig();\n    register200StubOnProxyAndTarget(\"/ssl-cert\");\n\n    assertThat(testClient.get(\"/ssl-cert\").statusCode(), is(200));\n  }\n\n  @Test\n  public void canProxyViaAForwardProxy() {\n    // Set a proxy host header on the forward proxy to a random value so we can verify the request\n    // that hit the target service came from the forward proxy.\n    String forwardProxyHost = UUID.randomUUID().toString();\n    WireMockServer forwardProxy =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .enableBrowserProxying(true)\n                .proxyHostHeader(forwardProxyHost));\n    forwardProxy.start();\n    init(wireMockConfig().proxyVia(new ProxySettings(\"localhost\", forwardProxy.port())));\n\n    register200StubOnProxyAndTarget(\"/proxy-via\");\n\n    assertThat(testClient.get(\"/proxy-via\").statusCode(), is(200));\n    List<ServeEvent> targetRequests = targetService.getAllServeEvents();\n    assertThat(targetRequests, hasSize(1));\n    assertThat(targetRequests.get(0).getRequest().getHeader(\"Host\"), is(forwardProxyHost));\n  }\n\n  @Test\n  public void canProxyViaAForwardProxyWithCredentials() {\n    // Set a proxy host header on the forward proxy to a random value so we can verify the request\n    // that hit the target service came from the forward proxy.\n    String forwardProxyHost = UUID.randomUUID().toString();\n    WireMockServer forwardProxy =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .enableBrowserProxying(true)\n                .proxyHostHeader(forwardProxyHost));\n    forwardProxy.start();\n\n    String username = UUID.randomUUID().toString();\n    String password = UUID.randomUUID().toString();\n    ProxySettings proxySettings = new ProxySettings(\"localhost\", forwardProxy.port());\n    proxySettings.setUsername(username);\n    proxySettings.setPassword(password);\n    init(wireMockConfig().proxyVia(proxySettings));\n\n    // Reject unauthenticated requests to the forward proxy to ensure the proxied request must be\n    // authenticated correctly.\n    String requiredAuthHeaderValue =\n        \"Basic \" + Base64.getEncoder().encodeToString((username + \":\" + password).getBytes());\n    forwardProxy.stubFor(\n        any(anyUrl())\n            .withHeader(\"Proxy-Authorization\", not(equalTo(requiredAuthHeaderValue)))\n            .willReturn(status(407).withHeader(\"Proxy-Authenticate\", \"Basic realm=\\\"whatever\\\"\")));\n    register200StubOnProxyAndTarget(\"/proxy-via\");\n\n    assertThat(testClient.get(\"/proxy-via\").statusCode(), is(200));\n    List<ServeEvent> targetRequests = targetService.getAllServeEvents();\n    assertThat(targetRequests, hasSize(1));\n    assertThat(targetRequests.get(0).getRequest().getHeader(\"Host\"), is(forwardProxyHost));\n  }\n\n  @Test\n  public void doesNotAddAcceptEncodingHeaderToProxyRequest() {\n    initWithDefaultConfig();\n    register200StubOnProxyAndTarget(\"/no-accept-encoding-header\");\n\n    testClient.get(\"/no-accept-encoding-header\");\n    LoggedRequest lastRequest =\n        getLast(target.find(getRequestedFor(urlEqualTo(\"/no-accept-encoding-header\"))));\n    assertFalse(\n        lastRequest.getHeaders().getHeader(\"Accept-Encoding\").isPresent(),\n        \"Accept-Encoding header should not be present\");\n  }\n\n  @Test\n  public void passesMultipleValuesOfTheSameHeaderToTheTarget() {\n    initWithDefaultConfig();\n    register200StubOnProxyAndTarget(\"/multi-value-header\");\n\n    testClient.get(\n        \"/multi-value-header\", withHeader(\"Accept\", \"accept1\"), withHeader(\"Accept\", \"accept2\"));\n\n    LoggedRequest lastRequest =\n        getLast(target.find(getRequestedFor(urlEqualTo(\"/multi-value-header\"))));\n\n    assertThat(lastRequest.header(\"Accept\").values(), hasItems(\"accept1\", \"accept2\"));\n  }\n\n  @Test\n  public void maintainsGZippedRequest() {\n    initWithDefaultConfig();\n\n    target.register(post(\"/gzipped\").willReturn(aResponse().withStatus(201)));\n    proxy.register(post(\"/gzipped\").willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    HttpEntity gzippedBody =\n        new GzipCompressingEntity(new StringEntity(\"gzipped body\", TEXT_PLAIN));\n    testClient.post(\"/gzipped\", gzippedBody);\n\n    target.verifyThat(\n        postRequestedFor(urlEqualTo(\"/gzipped\"))\n            .withHeader(CONTENT_ENCODING, containing(\"gzip\"))\n            .withRequestBody(equalTo(\"gzipped body\")));\n  }\n\n  @Test\n  public void contextPathsWithoutTrailingSlashesArePreserved() {\n    initWithDefaultConfig();\n\n    target.register(get(\"/example\").willReturn(ok()));\n    proxy.register(any(anyUrl()).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    WireMockResponse response =\n        testClient.getViaProxy(\"http://localhost:\" + proxyingService.port() + \"/example\");\n    assertThat(response.statusCode(), is(200));\n\n    target.verifyThat(1, getRequestedFor(urlEqualTo(\"/example\")));\n    target.verifyThat(0, getRequestedFor(urlEqualTo(\"/example/\")));\n  }\n\n  @Test\n  public void contextPathsWithTrailingSlashesArePreserved() {\n    initWithDefaultConfig();\n\n    target.register(get(\"/example/\").willReturn(ok()));\n    proxy.register(any(anyUrl()).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    WireMockResponse response =\n        testClient.getViaProxy(\"http://localhost:\" + proxyingService.port() + \"/example/\");\n    assertThat(response.statusCode(), is(200));\n\n    target.verifyThat(1, getRequestedFor(urlEqualTo(\"/example/\")));\n    target.verifyThat(0, getRequestedFor(urlEqualTo(\"/example\")));\n  }\n\n  /**\n   * NOTE: {@link org.apache.hc.core5.http.client.HttpClient} always has a / when the context path\n   * is empty. This is also the behaviour of curl (see e.g. <a\n   * href=\"https://curl.haxx.se/mail/archive-2016-08/0027.html\">here</a>)\n   */\n  @Test\n  public void clientLibrariesTendToAddTheTrailingSlashWhenTheContextPathIsEmpty() {\n    initWithDefaultConfig();\n\n    target.register(get(\"/\").willReturn(ok()));\n    proxy.register(any(anyUrl()).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    WireMockResponse responseToRequestWithoutSlash =\n        testClient.getViaProxy(\"http://localhost:\" + proxyingService.port());\n    assertThat(responseToRequestWithoutSlash.statusCode(), is(200));\n\n    WireMockResponse responseToRequestWithSlash =\n        testClient.getViaProxy(\"http://localhost:\" + proxyingService.port() + \"/\");\n    assertThat(responseToRequestWithSlash.statusCode(), is(200));\n\n    target.verifyThat(2, getRequestedFor(urlEqualTo(\"/\")));\n    target.verifyThat(0, getRequestedFor(urlEqualTo(\"\")));\n  }\n\n  @Test\n  public void fixedDelaysAreAddedToProxiedResponses() {\n    initWithDefaultConfig();\n\n    target.register(get(\"/delayed\").willReturn(ok()));\n    proxy.register(\n        any(anyUrl())\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl).withFixedDelay(300)));\n\n    Stopwatch stopwatch = Stopwatch.createStarted();\n    WireMockResponse response =\n        testClient.getViaProxy(\"http://localhost:\" + proxyingService.port() + \"/delayed\");\n    stopwatch.stop();\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(stopwatch.elapsed(MILLISECONDS), greaterThanOrEqualTo(300L));\n  }\n\n  @Test\n  public void chunkedDribbleDelayIsAddedToProxiedResponse() {\n    initWithDefaultConfig();\n\n    target.register(get(\"/chunk-delayed\").willReturn(ok()));\n    proxy.register(\n        any(anyUrl())\n            .willReturn(\n                aResponse().proxiedFrom(targetServiceBaseUrl).withChunkedDribbleDelay(10, 300)));\n\n    Stopwatch stopwatch = Stopwatch.createStarted();\n    WireMockResponse response =\n        testClient.getViaProxy(\"http://localhost:\" + proxyingService.port() + \"/chunk-delayed\");\n    stopwatch.stop();\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(stopwatch.elapsed(MILLISECONDS), greaterThanOrEqualTo(300L));\n  }\n\n  @Test\n  public void removesPrefixFromProxyRequestWhenMatching() {\n    initWithDefaultConfig();\n\n    proxy.register(\n        get(\"/other/service/doc/123\")\n            .willReturn(\n                aResponse()\n                    .proxiedFrom(targetServiceBaseUrl + \"/approot\")\n                    .withProxyUrlPrefixToRemove(\"/other/service\")));\n\n    target.register(get(\"/approot/doc/123\").willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/other/service/doc/123\");\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void removesPrefixFromProxyRequestWhenResponseTransformersAreUsed() {\n    init(wireMockConfig().templatingEnabled(true).globalTemplating(true));\n\n    proxy.register(\n        get(\"/other/service/doc/123\")\n            .willReturn(\n                aResponse()\n                    .proxiedFrom(targetServiceBaseUrl + \"/approot\")\n                    .withProxyUrlPrefixToRemove(\"/other/service\")));\n\n    target.register(get(\"/approot/doc/123\").willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/other/service/doc/123\");\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"GET\", \"HEAD\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\", \"QUERY\", \"BLAH\"})\n  void proxiesRequestBodyForAnyMethod(String method) {\n    initWithDefaultConfig();\n\n    target.register(any(anyUrl()).willReturn(ok()));\n\n    proxy.register(any(anyUrl()).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    testClient.request(method, \"/somewhere\", \"Proxied content\");\n\n    List<LoggedRequest> requests = target.find(anyRequestedFor(urlEqualTo(\"/somewhere\")));\n    assertThat(requests.size(), is(1));\n    assertThat(requests.get(0).getMethod().getName(), is(method));\n    assertThat(requests.get(0).getBodyAsString(), is(\"Proxied content\"));\n  }\n\n  @Test\n  void preventsProxyingToExcludedIpAddress() {\n    init(\n        wireMockConfig()\n            .limitProxyTargets(\n                NetworkAddressRules.builder()\n                    .deny(\"10.1.2.3\")\n                    .deny(\"192.168.10.1-192.168.11.254\")\n                    .build()));\n\n    proxy.register(proxyAllTo(\"https://10.1.2.3\"));\n    WireMockResponse response = testClient.get(\"/\");\n    assertThat(response.statusCode(), is(500));\n    assertThat(\n        response.content(), is(\"The target proxy address is denied in WireMock's configuration.\"));\n\n    proxy.register(proxyAllTo(\"https://192.168.10.255\"));\n    assertThat(testClient.get(\"/\").statusCode(), is(500));\n  }\n\n  @Test\n  void preventsProxyingToExcludedHostnames() {\n    init(\n        wireMockConfig()\n            .limitProxyTargets(NetworkAddressRules.builder().deny(\"*.wiremock.org\").build()));\n\n    proxy.register(proxyAllTo(\"http://noway.wiremock.org\"));\n    assertThat(\n        testClient.get(\"/\").content(),\n        is(\"The target proxy address is denied in WireMock's configuration.\"));\n  }\n\n  @Test\n  void preventsProxyingToNonIncludedHostnames() {\n    init(\n        wireMockConfig()\n            .limitProxyTargets(NetworkAddressRules.builder().allow(\"wiremock.org\").build()));\n\n    proxy.register(proxyAllTo(\"http://wiremock.io\"));\n    assertThat(\n        testClient.get(\"/\").content(),\n        is(\"The target proxy address is denied in WireMock's configuration.\"));\n  }\n\n  @Test\n  void preventsProxyingToIpResolvedFromHostname() {\n    init(\n        wireMockConfig()\n            .limitProxyTargets(NetworkAddressRules.builder().deny(\"127.0.0.1\").build()));\n\n    proxy.register(proxyAllTo(\"http://localhost\"));\n    assertThat(\n        testClient.get(\"/\").content(),\n        is(\"The target proxy address is denied in WireMock's configuration.\"));\n  }\n\n  @Test\n  void proxyRequestWillNotTimeoutIfProxyResponseIsFastEnough() {\n    init(wireMockConfig().proxyTimeout(1000));\n\n    target.register(\n        get(urlEqualTo(\"/proxied/resource?param=value\"))\n            .willReturn(\n                aResponse()\n                    .withFixedDelay(500)\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Proxied content\")));\n\n    proxy.register(\n        any(urlEqualTo(\"/proxied/resource?param=value\"))\n            .atPriority(10)\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    WireMockResponse response = testClient.get(\"/proxied/resource?param=value\");\n\n    assertThat(response.content(), is(\"Proxied content\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n  }\n\n  @Test\n  void proxyRequestWillTimeoutIfProxyResponseIsTooSlow() {\n    init(wireMockConfig().proxyTimeout(1000));\n\n    target.register(\n        get(urlEqualTo(\"/proxied/resource?param=value\"))\n            .willReturn(\n                aResponse()\n                    .withFixedDelay(1500)\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Proxied content\")));\n\n    proxy.register(\n        any(urlEqualTo(\"/proxied/resource?param=value\"))\n            .atPriority(10)\n            .willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n\n    WireMockResponse response = testClient.get(\"/proxied/resource?param=value\");\n\n    assertThat(\n        response.content(),\n        startsWith(\"Network failure trying to make a proxied request from WireMock\"));\n    assertThat(response.statusCode(), is(500));\n  }\n\n  @Test\n  void multiValueResponseHeadersWithDifferentCasesAreHandledCorrectly() {\n    initWithDefaultConfig();\n\n    target.register(\n        get(urlPathEqualTo(\"/multi-value-headers\"))\n            .willReturn(\n                ok().withHeader(\"Set-Cookie\", \"session=1234\")\n                    .withHeader(\"set-cookie\", \"ads_id=5678\")\n                    .withHeader(\"SET-COOKIE\", \"trk=t-9987\")));\n\n    proxy.register(proxyAllTo(targetServiceBaseUrl));\n\n    WireMockResponse response = testClient.get(\"/multi-value-headers\");\n    assertThat(response.statusCode(), is(200));\n\n    Multimap<String, String> headers = response.headers();\n    assertThat(headers.get(\"Set-Cookie\").size(), is(3));\n    assertThat(headers.get(\"Set-Cookie\"), hasItems(\"session=1234\", \"ads_id=5678\", \"trk=t-9987\"));\n  }\n\n  @Test\n  public void proxiedFromIllegalSource() {\n    initWithDefaultConfig();\n\n    target.register(\n        get(urlEqualTo(\"/proxied/resource?param=value\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Proxied content\")));\n\n    proxy.register(\n        any(urlEqualTo(\"/proxied/resource?param=value\"))\n            .atPriority(10)\n            .willReturn(aResponse().proxiedFrom(\"/not/an/absolute/url\")));\n\n    WireMockResponse response = testClient.get(\"/proxied/resource?param=value\");\n\n    assertThat(response.statusCode(), is(500));\n    assertThat(\n        response.content(),\n        is(\"The target proxy address `/not/an/absolute/url` is not an absolute URL.\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n  }\n\n  @Test\n  public void templatedProxiedFrom() {\n\n    initWithDefaultConfig();\n\n    target.register(\n        get(urlEqualTo(\"/proxied/resource?param=value\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Proxied content\")));\n\n    proxy.register(\n        any(urlEqualTo(\"/proxied/resource?param=value\"))\n            .atPriority(10)\n            .willReturn(\n                aResponse()\n                    .withTransformers(ResponseTemplateTransformer.NAME)\n                    .proxiedFrom(\"{{request.headers.X-WM-Uri}}\")));\n\n    WireMockResponse response =\n        testClient.get(\n            \"/proxied/resource?param=value\",\n            TestHttpHeader.withHeader(\"X-WM-Uri\", targetServiceBaseUrl));\n\n    assertThat(response.content(), is(\"Proxied content\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n  }\n\n  @Test\n  public void templatedProxiedFromWithIllegalTemplatedSource() {\n    initWithDefaultConfig();\n\n    target.register(\n        get(urlEqualTo(\"/proxied/resource?param=value\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Proxied content\")));\n\n    proxy.register(\n        any(urlEqualTo(\"/proxied/resource?param=value\"))\n            .atPriority(10)\n            .willReturn(\n                aResponse()\n                    .withTransformers(ResponseTemplateTransformer.NAME)\n                    .proxiedFrom(\"{{request.headers.X-WM-Uri}}\")));\n\n    WireMockResponse response =\n        testClient.get(\n            \"/proxied/resource?param=value\",\n            TestHttpHeader.withHeader(\"X-WM-Uri\", \"/not/an/absolute/url\"));\n\n    assertThat(response.statusCode(), is(500));\n    assertThat(\n        response.content(),\n        is(\"The target proxy address `/not/an/absolute/url` is not an absolute URL.\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n  }\n\n  @Test\n  public void requestLogFlagsProxiedResponses() {\n    initWithDefaultConfig();\n\n    target.register(any(anyUrl()).willReturn(ok(\"Proxied content\")));\n\n    proxy.register(\n        any(urlEqualTo(\"/proxied\")).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n    proxy.register(any(urlEqualTo(\"/not-proxied\")).willReturn(ok(\"Un-proxied content\")));\n\n    WireMockResponse proxiedResponse = testClient.get(\"/proxied\");\n    assertThat(proxiedResponse.statusCode(), is(200));\n    assertThat(proxiedResponse.content(), is(\"Proxied content\"));\n\n    var serveEvents = proxy.getServeEvents();\n    assertThat(serveEvents.size(), is(1));\n    assertThat(serveEvents.get(0).getResponse().getBodyAsString(), is(\"Proxied content\"));\n    assertThat(serveEvents.get(0).getResponse().isFromProxy(), is(true));\n\n    proxy.resetRequests();\n    WireMockResponse unProxiedResponse = testClient.get(\"/not-proxied\");\n    assertThat(unProxiedResponse.statusCode(), is(200));\n    assertThat(unProxiedResponse.content(), is(\"Un-proxied content\"));\n\n    serveEvents = proxy.getServeEvents();\n    assertThat(serveEvents.size(), is(1));\n    assertThat(serveEvents.get(0).getResponse().getBodyAsString(), is(\"Un-proxied content\"));\n    assertThat(serveEvents.get(0).getResponse().isFromProxy(), is(false));\n  }\n\n  private void register200StubOnProxyAndTarget(String url) {\n    target.register(get(urlEqualTo(url)).willReturn(aResponse().withStatus(200)));\n    proxy.register(get(urlEqualTo(url)).willReturn(aResponse().proxiedFrom(targetServiceBaseUrl)));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/QueuedThreadPoolAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2017-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.jetty.Jetty12HttpServer;\nimport com.github.tomakehurst.wiremock.jetty.JettySettings;\nimport org.eclipse.jetty.util.thread.QueuedThreadPool;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\n\npublic class QueuedThreadPoolAcceptanceTest extends AcceptanceTestBase {\n\n  @BeforeAll\n  public static void setupServer() {\n    setupServer(\n        new WireMockConfiguration()\n            .httpServerFactory(\n                (options, adminRequestHandler, stubRequestHandler, messageStubRequestHandler) ->\n                    new Jetty12HttpServer(\n                        options,\n                        adminRequestHandler,\n                        stubRequestHandler,\n                        JettySettings.Builder.aJettySettings().build(),\n                        new InstrumentedQueuedThreadPool(options.containerThreads()),\n                        messageStubRequestHandler)));\n  }\n\n  @Test\n  public void serverUseCustomInstrumentedQueuedThreadPool() {\n    assertThat(InstrumentedQueuedThreadPool.flag, is(true));\n  }\n\n  public static class InstrumentedQueuedThreadPool extends QueuedThreadPool {\n    public static boolean flag = false;\n\n    public InstrumentedQueuedThreadPool(int maxThreads) {\n      this(maxThreads, 8);\n    }\n\n    public InstrumentedQueuedThreadPool(int maxThreads, int minThreads) {\n      this(maxThreads, minThreads, 60000);\n    }\n\n    public InstrumentedQueuedThreadPool(int maxThreads, int minThreads, int idleTimeout) {\n      super(maxThreads, minThreads, idleTimeout, null);\n    }\n\n    @Override\n    protected void doStart() throws Exception {\n      super.doStart();\n      flag = true;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/RecordApiAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.Metadata.metadata;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalToJson;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.findMappingWithUrl;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.notNullValue;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.GlobalStubMappingTransformer;\nimport com.github.tomakehurst.wiremock.testsupport.NonGlobalStubMappingTransformer;\nimport com.github.tomakehurst.wiremock.testsupport.StubMappingTransformerWithFailure;\nimport com.github.tomakehurst.wiremock.testsupport.StubMappingTransformerWithServeEvent;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.List;\nimport java.util.UUID;\nimport net.javacrumbs.jsonunit.core.Option;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.skyscreamer.jsonassert.JSONCompareMode;\n\npublic class RecordApiAcceptanceTest extends AcceptanceTestBase {\n\n  private WireMockServer proxyingService;\n  private WireMockTestClient proxyingTestClient;\n  private String proxyTargetUrl;\n\n  private void proxyServerStart(WireMockConfiguration config) {\n    proxyingService = new WireMockServer(config.dynamicPort());\n    proxyingService.start();\n    proxyTargetUrl = \"http://localhost:\" + wireMockServer.port();\n    proxyingService.stubFor(\n        proxyAllTo(proxyTargetUrl).withMetadata(metadata().attr(\"proxy\", true)));\n\n    proxyingTestClient = new WireMockTestClient(proxyingService.port());\n    wireMockServer.stubFor(any(anyUrl()).willReturn(ok()));\n  }\n\n  private void proxyServerStartWithEmptyFileRoot() {\n    proxyServerStart(wireMockConfig().withRootDirectory(\"src/test/resources/empty\"));\n  }\n\n  @BeforeEach\n  public void clearTargetServerMappings() {\n    wireMockServer.resetMappings();\n  }\n\n  @AfterEach\n  public void proxyServerShutdown() {\n    // delete any persisted stub mappings to ensure test isolation\n    proxyingService.resetMappings();\n    proxyingService.stop();\n  }\n\n  private static final String DEFAULT_SNAPSHOT_RESPONSE =\n      \"{                                                           \\n\"\n          + \"    \\\"mappings\\\": [                                         \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo/bar/baz\\\",                 \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                        \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        },                                                  \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo/bar\\\",                     \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                        \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        }                                                   \\n\"\n          + \"    ]                                                       \\n\"\n          + \"}                                                             \";\n\n  @Test\n  public void returnsRequestsWithDefaultOptions() throws Exception {\n    proxyServerStart(wireMockConfig().withRootDirectory(setupTempFileRoot().getAbsolutePath()));\n    proxyingTestClient.get(\"/foo/bar\", withHeader(\"A\", \"B\"));\n    proxyingTestClient.get(\"/foo/bar/baz\", withHeader(\"A\", \"B\"));\n\n    assertThat(\n        proxyingTestClient.snapshot(\"\"),\n        equalToJson(DEFAULT_SNAPSHOT_RESPONSE, JSONCompareMode.STRICT_ORDER));\n\n    // Should have persisted both stub mappings. The 3 is to account for the proxy mapping\n    assertEquals(3, proxyingService.getStubMappings().size());\n  }\n\n  private static final String FILTER_BY_REQUEST_PATTERN_SNAPSHOT_REQUEST =\n      \"{                                                 \\n\"\n          + \"    \\\"outputFormat\\\": \\\"full\\\",                   \\n\"\n          + \"    \\\"persist\\\": \\\"false\\\",                       \\n\"\n          + \"    \\\"filters\\\": {                                \\n\"\n          + \"        \\\"urlPattern\\\": \\\"/foo.*\\\",               \\n\"\n          + \"        \\\"headers\\\": {                            \\n\"\n          + \"            \\\"A\\\": { \\\"equalTo\\\": \\\"B\\\" }         \\n\"\n          + \"        }                                         \\n\"\n          + \"    }                                             \\n\"\n          + \"}                                                   \";\n\n  private static final String FILTER_BY_REQUEST_PATTERN_SNAPSHOT_RESPONSE =\n      \"{                                                           \\n\"\n          + \"    \\\"mappings\\\": [                                         \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo/bar/baz\\\",                 \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                        \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        },                                                   \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo/bar\\\",                     \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                        \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        }                                                  \\n\"\n          + \"    ]                                                       \\n\"\n          + \"}                                                             \";\n\n  @Test\n  public void returnsFilteredRequestsWithJustRequestPatternsAndFullOutputFormat() throws Exception {\n    proxyServerStartWithEmptyFileRoot();\n\n    // Matches both\n    proxyingTestClient.get(\"/foo/bar\", withHeader(\"A\", \"B\"));\n    // Fails header match\n    proxyingTestClient.get(\"/foo\");\n    // Fails URL match\n    proxyingTestClient.get(\"/bar\", withHeader(\"A\", \"B\"));\n    // Fails header match\n    proxyingTestClient.get(\"/foo/\", withHeader(\"A\", \"C\"));\n    // Matches both\n    proxyingTestClient.get(\"/foo/bar/baz\", withHeader(\"A\", \"B\"));\n\n    assertThat(\n        proxyingTestClient.snapshot(FILTER_BY_REQUEST_PATTERN_SNAPSHOT_REQUEST),\n        equalToJson(FILTER_BY_REQUEST_PATTERN_SNAPSHOT_RESPONSE, JSONCompareMode.STRICT_ORDER));\n  }\n\n  private static final String FILTER_BY_REQUEST_PATTERN_AND_IDS_SNAPSHOT_REQUEST_TEMPLATE =\n      \"{                                                     \\n\"\n          + \"    \\\"outputFormat\\\": \\\"full\\\",                       \\n\"\n          + \"    \\\"persist\\\": \\\"false\\\",                           \\n\"\n          + \"    \\\"filters\\\": {                                    \\n\"\n          + \"        \\\"ids\\\": [ \\\"%s\\\", \\\"%s\\\" ],                  \\n\"\n          + \"        \\\"urlPattern\\\": \\\"/foo.*\\\"                    \\n\"\n          + \"    }                                                 \\n\"\n          + \"}                                                       \";\n\n  private static final String FILTER_BY_REQUEST_PATTERN_AND_IDS_SNAPSHOT_RESPONSE =\n      \"{                                                       \\n\"\n          + \"    \\\"mappings\\\": [                                     \\n\"\n          + \"        {                                               \\n\"\n          + \"            \\\"request\\\" : {                             \\n\"\n          + \"                \\\"url\\\" : \\\"/foo/bar\\\",                 \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                    \\n\"\n          + \"            },                                          \\n\"\n          + \"            \\\"response\\\" : {                            \\n\"\n          + \"                \\\"status\\\" : 200                        \\n\"\n          + \"            }                                           \\n\"\n          + \"        }                                               \\n\"\n          + \"    ]                                                   \\n\"\n          + \"}                                                         \";\n\n  @Test\n  public void returnsFilteredRequestsWithRequestPatternAndIdsWithFullOutputFormat() {\n    proxyServerStartWithEmptyFileRoot();\n\n    // Matches both\n    proxyingTestClient.get(\"/foo/bar\");\n    // Fails URL match\n    proxyingTestClient.get(\"/bar\");\n    // Fails ID match\n    proxyingTestClient.get(\"/foo\");\n\n    UUID fooBarId = findServeEventWithRequestUrl(\"/foo/bar\").getId();\n    UUID barId = findServeEventWithRequestUrl(\"/bar\").getId();\n\n    String request =\n        String.format(FILTER_BY_REQUEST_PATTERN_AND_IDS_SNAPSHOT_REQUEST_TEMPLATE, fooBarId, barId);\n\n    assertThat(\n        proxyingTestClient.snapshot(request),\n        equalToJson(\n            FILTER_BY_REQUEST_PATTERN_AND_IDS_SNAPSHOT_RESPONSE, JSONCompareMode.STRICT_ORDER));\n  }\n\n  private static final String FILTER_BY_WITH_NON_PROXIED_TRUE_SNAPSHOT_REQUEST =\n      \"{                                                 \\n\"\n          + \"    \\\"persist\\\": false,                           \\n\"\n          + \"    \\\"filters\\\": {                                \\n\"\n          + \"        \\\"allowNonProxied\\\": true                 \\n\"\n          + \"    }                                             \\n\"\n          + \"}                                                   \";\n\n  private static final String FILTER_BY_WITH_NON_PROXIED_TRUE_SNAPSHOT_RESPONSE =\n      \"{                                                       \\n\"\n          + \"    \\\"mappings\\\": [                                     \\n\"\n          + \"        {                                               \\n\"\n          + \"            \\\"request\\\" : {                             \\n\"\n          + \"                \\\"url\\\" : \\\"/record-anyway\\\",           \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                    \\n\"\n          + \"            },                                          \\n\"\n          + \"            \\\"response\\\" : {                            \\n\"\n          + \"                \\\"status\\\" : 404                        \\n\"\n          + \"            }                                           \\n\"\n          + \"        }                                               \\n\"\n          + \"    ]                                                   \\n\"\n          + \"}                                                         \";\n\n  @Test\n  public void returnsStubsFromNonProxiedRequestsWhenRequested() {\n    proxyServerStartWithEmptyFileRoot();\n    proxyingService.removeStubsByMetadata(matchingJsonPath(\"$.proxy\"));\n\n    proxyingTestClient.get(\"/record-anyway\");\n\n    assertThat(\n        proxyingTestClient.snapshot(FILTER_BY_WITH_NON_PROXIED_TRUE_SNAPSHOT_REQUEST),\n        equalToJson(FILTER_BY_WITH_NON_PROXIED_TRUE_SNAPSHOT_RESPONSE, JSONCompareMode.LENIENT));\n  }\n\n  private ServeEvent findServeEventWithRequestUrl(final String url) {\n    return proxyingService.getAllServeEvents().stream()\n        .filter(input -> url.equals(input.getRequest().getUrl()))\n        .findFirst()\n        .orElse(null);\n  }\n\n  private static final String CAPTURE_HEADERS_SNAPSHOT_REQUEST =\n      \"{                                      \\n\"\n          + \"    \\\"outputFormat\\\": \\\"full\\\",        \\n\"\n          + \"    \\\"persist\\\": \\\"false\\\",            \\n\"\n          + \"    \\\"captureHeaders\\\": {              \\n\"\n          + \"        \\\"Accept\\\": {                  \\n\"\n          + \"            \\\"caseInsensitive\\\": true  \\n\"\n          + \"        },                             \\n\"\n          + \"        \\\"X-Another\\\": {}              \\n\"\n          + \"    }                                  \\n\"\n          + \"}                                        \";\n\n  private static final String CAPTURE_HEADERS_SNAPSHOT_RESPONSE =\n      \"{                                                           \\n\"\n          + \"    \\\"mappings\\\": [                                         \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo/bar\\\",                     \\n\"\n          + \"                \\\"method\\\" : \\\"PUT\\\",                       \\n\"\n          + \"                \\\"headers\\\": {                              \\n\"\n          + \"                    \\\"Accept\\\": {                           \\n\"\n          + \"                        \\\"equalTo\\\": \\\"text/plain\\\",        \\n\"\n          + \"                        \\\"caseInsensitive\\\": true           \\n\"\n          + \"                    },                                      \\n\"\n          + \"                    \\\"X-Another\\\": {                        \\n\"\n          + \"                        \\\"equalTo\\\": \\\"blah\\\"               \\n\"\n          + \"                    }                                       \\n\"\n          + \"                }                                           \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        }                                                   \\n\"\n          + \"    ]                                                       \\n\"\n          + \"}                                                             \";\n\n  @Test\n  public void returnsStubMappingWithCapturedHeaders() {\n    proxyServerStartWithEmptyFileRoot();\n\n    proxyingTestClient.put(\n        \"/foo/bar\",\n        withHeader(\"Ignored\", \"whatever\"),\n        withHeader(\"Accept\", \"text/plain\"),\n        withHeader(\"X-Another\", \"blah\"));\n\n    String actual = proxyingTestClient.snapshot(CAPTURE_HEADERS_SNAPSHOT_REQUEST);\n    assertThat(\n        actual, equalToJson(CAPTURE_HEADERS_SNAPSHOT_RESPONSE, JSONCompareMode.STRICT_ORDER));\n  }\n\n  private static final String REPEATS_AS_SCENARIOS_SNAPSHOT_REQUEST =\n      \"{                                                 \\n\"\n          + \"    \\\"outputFormat\\\": \\\"full\\\",                   \\n\"\n          + \"    \\\"persist\\\": \\\"false\\\",                       \\n\"\n          + \"    \\\"repeatsAsScenarios\\\": \\\"true\\\"              \\n\"\n          + \"}                                                   \";\n\n  private static final String REPEATS_AS_SCENARIOS_SNAPSHOT_RESPONSE =\n      \"{\\n\"\n          + \"  \\\"mappings\\\": [\\n\"\n          + \"    {\\n\"\n          + \"      \\\"scenarioName\\\" : \\\"scenario-1-bar-baz\\\",\\n\"\n          + \"      \\\"requiredScenarioState\\\" : \\\"scenario-1-bar-baz-2\\\",\\n\"\n          + \"      \\\"request\\\" : {\\n\"\n          + \"        \\\"url\\\" : \\\"/bar/baz\\\",\\n\"\n          + \"        \\\"method\\\" : \\\"GET\\\"\\n\"\n          + \"      }\\n\"\n          + \"    },\\n\"\n          + \"    {\\n\"\n          + \"      \\\"request\\\" : {\\n\"\n          + \"        \\\"url\\\" : \\\"/foo\\\",\\n\"\n          + \"        \\\"method\\\" : \\\"GET\\\"\\n\"\n          + \"      }\\n\"\n          + \"    },\\n\"\n          + \"    {\\n\"\n          + \"      \\\"scenarioName\\\" : \\\"scenario-1-bar-baz\\\",\\n\"\n          + \"      \\\"requiredScenarioState\\\" : \\\"Started\\\",\\n\"\n          + \"      \\\"newScenarioState\\\" : \\\"scenario-1-bar-baz-2\\\",\\n\"\n          + \"      \\\"request\\\" : {\\n\"\n          + \"        \\\"url\\\" : \\\"/bar/baz\\\",\\n\"\n          + \"        \\\"method\\\" : \\\"GET\\\"\\n\"\n          + \"      }\\n\"\n          + \"    }\\n\"\n          + \"  ]\\n\"\n          + \"}\";\n\n  @Test\n  public void returnsStubMappingsWithScenariosForRepeatedRequests() {\n    proxyServerStartWithEmptyFileRoot();\n\n    proxyingTestClient.get(\"/bar/baz\");\n    proxyingTestClient.get(\"/foo\");\n    proxyingTestClient.get(\"/bar/baz\");\n\n    assertThat(\n        proxyingTestClient.snapshot(REPEATS_AS_SCENARIOS_SNAPSHOT_REQUEST),\n        equalToJson(REPEATS_AS_SCENARIOS_SNAPSHOT_RESPONSE, JSONCompareMode.STRICT_ORDER));\n  }\n\n  private static final String GLOBAL_TRANSFORMED_STUB_MAPPING_REQUEST =\n      \"{                                  \\n\"\n          + \"    \\\"outputFormat\\\": \\\"full\\\",    \\n\"\n          + \"    \\\"persist\\\": \\\"false\\\"         \\n\"\n          + \"}                                    \";\n\n  private static final String GLOBAL_TRANSFORMED_STUB_MAPPING_RESPONSE =\n      \"{                                                           \\n\"\n          + \"    \\\"mappings\\\": [                                         \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo?transformed=global\\\",      \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                        \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        },                                                  \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/?transformed=global\\\",         \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                        \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        }                                                  \\n\"\n          + \"    ]                                                       \\n\"\n          + \"}                                                             \";\n\n  @Test\n  public void returnsTransformedStubMappingWithGlobalTransformer() {\n    proxyServerStart(\n        wireMockConfig()\n            .withRootDirectory(\"src/test/resources/empty\")\n            .extensions(\n                GlobalStubMappingTransformer.class,\n                NonGlobalStubMappingTransformer.class // should ignore this one\n                ));\n\n    proxyingTestClient.get(\"/\");\n    proxyingTestClient.get(\"/foo\");\n\n    assertThat(\n        proxyingTestClient.snapshot(GLOBAL_TRANSFORMED_STUB_MAPPING_REQUEST),\n        equalToJson(GLOBAL_TRANSFORMED_STUB_MAPPING_RESPONSE, JSONCompareMode.STRICT_ORDER));\n  }\n\n  private static final String NONGLOBAL_TRANSFORMED_STUB_MAPPING_REQUEST =\n      \"{                                    \\n\"\n          + \"    \\\"outputFormat\\\": \\\"full\\\",      \\n\"\n          + \"    \\\"persist\\\": \\\"false\\\",          \\n\"\n          + \"    \\\"transformers\\\": [              \\n\"\n          + \"       \\\"nonglobal-transformer\\\"     \\n\"\n          + \"    ]                                \\n\"\n          + \"}                                      \";\n\n  private static final String NONGLOBAL_TRANSFORMED_STUB_MAPPING_RESPONSE =\n      \"{                                                           \\n\"\n          + \"    \\\"mappings\\\": [                                         \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo?transformed=nonglobal\\\",   \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\",                       \\n\"\n          + \"                \\\"headers\\\": {                              \\n\"\n          + \"                    \\\"Accept\\\": {                           \\n\"\n          + \"                        \\\"equalTo\\\": \\\"B\\\"                  \\n\"\n          + \"                    }                                       \\n\"\n          + \"                }                                           \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        },                                                   \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/?transformed=nonglobal\\\",      \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\",                       \\n\"\n          + \"                \\\"headers\\\": {                              \\n\"\n          + \"                    \\\"Accept\\\": {                           \\n\"\n          + \"                        \\\"equalTo\\\": \\\"B\\\"                  \\n\"\n          + \"                    }                                       \\n\"\n          + \"                }                                           \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        }                                                  \\n\"\n          + \"    ]                                                       \\n\"\n          + \"}                                                             \";\n\n  @Test\n  public void returnsTransformedStubMappingWithNonGlobalTransformer() {\n    proxyServerStart(\n        wireMockConfig()\n            .withRootDirectory(\"src/test/resources/empty\")\n            .extensions(NonGlobalStubMappingTransformer.class));\n\n    proxyingTestClient.get(\"/\");\n    proxyingTestClient.get(\"/foo\");\n\n    assertThat(\n        proxyingTestClient.snapshot(NONGLOBAL_TRANSFORMED_STUB_MAPPING_REQUEST),\n        equalToJson(NONGLOBAL_TRANSFORMED_STUB_MAPPING_RESPONSE, JSONCompareMode.STRICT_ORDER));\n  }\n\n  private static final String TRANSFORMED_STUB_MAPPING_REQUEST_WITH_SERVE_EVENT =\n      \"{                                    \\n\"\n          + \"    \\\"outputFormat\\\": \\\"full\\\",      \\n\"\n          + \"    \\\"persist\\\": \\\"false\\\",          \\n\"\n          + \"    \\\"transformers\\\": [              \\n\"\n          + \"       \\\"stub-transformer-with-serve-event\\\"     \\n\"\n          + \"    ]                                \\n\"\n          + \"}                                      \";\n\n  private static final String TRANSFORMED_STUB_MAPPING_RESPONSE_WITH_SERVE_EVENT =\n      \"{                                                           \\n\"\n          + \"    \\\"mappings\\\": [                                         \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo?transformed=first-value\\\", \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                        \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        },                                                   \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/?transformed=value-2\\\",        \\n\"\n          + \"                \\\"method\\\" : \\\"GET\\\"                        \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        }                                                  \\n\"\n          + \"    ]                                                       \\n\"\n          + \"}                                                             \";\n\n  @Test\n  public void returnsTransformedStubMappingWithTransformerWithServeEvent() {\n    proxyServerStart(\n        wireMockConfig()\n            .withRootDirectory(\"src/test/resources/empty\")\n            .extensions(StubMappingTransformerWithServeEvent.class));\n\n    proxyingTestClient.get(\"/?some-query=value-2\");\n    proxyingTestClient.get(\"/foo?some-query=first-value\");\n\n    assertThat(\n        proxyingTestClient.snapshot(TRANSFORMED_STUB_MAPPING_REQUEST_WITH_SERVE_EVENT),\n        equalToJson(\n            TRANSFORMED_STUB_MAPPING_RESPONSE_WITH_SERVE_EVENT, JSONCompareMode.STRICT_ORDER));\n  }\n\n  private static final String RECORD_WITH_CAPTURE_HEADERS_SNAPSHOT_REQUEST_TEMPLATE =\n      \"{                                      \\n\"\n          + \"    \\\"targetBaseUrl\\\": \\\"%s\\\",         \\n\"\n          + \"    \\\"outputFormat\\\": \\\"full\\\",        \\n\"\n          + \"    \\\"persist\\\": \\\"false\\\",            \\n\"\n          + \"    \\\"captureHeaders\\\": {              \\n\"\n          + \"        \\\"Accept\\\": {                  \\n\"\n          + \"            \\\"caseInsensitive\\\": true  \\n\"\n          + \"        },                             \\n\"\n          + \"        \\\"X-Another\\\": {}              \\n\"\n          + \"    }                                  \\n\"\n          + \"}                                        \";\n\n  private static final String RECORD_WITH_CAPTURE_HEADERS_RECORD_RESPONSE =\n      \"{                                                           \\n\"\n          + \"    \\\"mappings\\\": [                                         \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo/bar\\\",                     \\n\"\n          + \"                \\\"method\\\" : \\\"PUT\\\",                       \\n\"\n          + \"                \\\"headers\\\": {                              \\n\"\n          + \"                    \\\"Accept\\\": {                           \\n\"\n          + \"                        \\\"equalTo\\\": \\\"text/plain\\\",        \\n\"\n          + \"                        \\\"caseInsensitive\\\": true           \\n\"\n          + \"                    },                                      \\n\"\n          + \"                    \\\"X-Another\\\": {                        \\n\"\n          + \"                        \\\"equalTo\\\": \\\"blah\\\"               \\n\"\n          + \"                    }                                       \\n\"\n          + \"                }                                           \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        },                                                  \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/foo/bar\\\",                     \\n\"\n          + \"                \\\"method\\\" : \\\"PUT\\\",                       \\n\"\n          + \"                \\\"headers\\\": {                              \\n\"\n          + \"                    \\\"Accept\\\": {                           \\n\"\n          + \"                        \\\"equalTo\\\": \\\"text/plain\\\",        \\n\"\n          + \"                        \\\"caseInsensitive\\\": true           \\n\"\n          + \"                    },                                      \\n\"\n          + \"                    \\\"X-Another\\\": {                        \\n\"\n          + \"                        \\\"equalTo\\\": \\\"blah\\\"               \\n\"\n          + \"                    }                                       \\n\"\n          + \"                }                                           \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        }                                                   \\n\"\n          + \"    ]                                                       \\n\"\n          + \"}                                                             \";\n\n  @Test\n  public void startsAndStopsRecording() {\n    proxyServerStartWithEmptyFileRoot();\n\n    String requestJson =\n        String.format(RECORD_WITH_CAPTURE_HEADERS_SNAPSHOT_REQUEST_TEMPLATE, proxyTargetUrl);\n    proxyingTestClient.postJson(\"/__admin/recordings/start\", requestJson);\n\n    proxyingTestClient.put(\n        \"/foo/bar\",\n        withHeader(\"Ignored\", \"whatever\"),\n        withHeader(\"Accept\", \"text/plain\"),\n        withHeader(\"X-Another\", \"blah\"));\n    proxyingTestClient.put(\n        \"/foo/bar\", withHeader(\"Accept\", \"text/plain\"), withHeader(\"X-Another\", \"blah\"));\n\n    WireMockResponse response = proxyingTestClient.post(\"/__admin/recordings/stop\");\n    assertThat(\n        response.content(),\n        equalToJson(RECORD_WITH_CAPTURE_HEADERS_RECORD_RESPONSE, JSONCompareMode.STRICT_ORDER));\n\n    StubMapping createdMapping = findMappingWithUrl(proxyingService.getStubMappings(), \"/foo/bar\");\n    assertThat(createdMapping.getScenarioName(), notNullValue());\n  }\n\n  private static final String NOT_RECORDING_ERROR =\n      \"{                                                          \\n\"\n          + \"    \\\"errors\\\": [                                          \\n\"\n          + \"        {                                                  \\n\"\n          + \"            \\\"code\\\": 30,                                  \\n\"\n          + \"            \\\"title\\\": \\\"Not currently recording.\\\"        \\n\"\n          + \"        }                                                  \\n\"\n          + \"    ]                                                      \\n\"\n          + \"}\";\n\n  @Test\n  public void returnsErrorWhenAttemptingToStopRecordingWhenNotStarted() {\n    proxyServerStartWithEmptyFileRoot();\n\n    WireMockResponse response =\n        proxyingTestClient.postWithBody(\"/__admin/recordings/stop\", \"\", \"text/plain\", \"utf-8\");\n\n    assertThat(response.content(), equalToJson(NOT_RECORDING_ERROR));\n  }\n\n  @Test\n  public void returnsTransformedStubMappingWithTransformerWithFailures() {\n    proxyServerStart(\n        wireMockConfig()\n            .withRootDirectory(\"src/test/resources/empty\")\n            .extensions(StubMappingTransformerWithFailure.class));\n\n    proxyingTestClient.postJson(\"/\", \"{}\");\n    proxyingTestClient.get(\"/foo\");\n    proxyingTestClient.postJson(\"/foo\", \"{}\");\n\n    assertThat(\n        proxyingTestClient.snapshot(\n            \"\"\"\n            {\n              \"outputFormat\": \"full\",\n              \"persist\": \"false\",\n              \"transformers\": [\n                \"stub-transformer-with-failure\"\n              ]\n            }\n        \"\"\"),\n        equalToJson(\n            \"\"\"\n                {\n                  \"mappings\": [\n                    {\n                      \"request\" : {\n                        \"url\" : \"/foo?transformed=success\",\n                        \"method\" : \"GET\"\n                      },\n                      \"response\" : {\n                        \"status\" : 200\n                      }\n                    }\n                  ],\n                  \"errors\": [\n                    {\n                      \"errorType\": \"stub-generation-failure\",\n                      \"reason\": \"POST /foo not allowed\",\n                      \"originalServeEvent\": {\n                        \"request\": {\n                          \"url\": \"/foo\"\n                        }\n                      }\n                    },\n                    {\n                      \"errorType\": \"stub-generation-failure\",\n                      \"reason\": \"POST / not allowed\",\n                      \"originalServeEvent\": {\n                        \"request\": {\n                          \"url\": \"/\"\n                        }\n                      }\n                    }\n                  ]\n                }\n            \"\"\",\n            JSONCompareMode.STRICT_ORDER));\n  }\n\n  @Test\n  public void returnsTransformedStubMappingIdsWithTransformerWithFailures() {\n    proxyServerStart(\n        wireMockConfig()\n            .withRootDirectory(\"src/test/resources/empty\")\n            .extensions(StubMappingTransformerWithFailure.class));\n\n    proxyingTestClient.postJson(\"/\", \"{}\");\n    proxyingTestClient.get(\"/foo\");\n    proxyingTestClient.postJson(\"/foo\", \"{}\");\n\n    assertThat(\n        proxyingTestClient.snapshot(\n            \"\"\"\n            {\n              \"outputFormat\": \"ids\",\n              \"persist\": \"false\",\n              \"transformers\": [\n                \"stub-transformer-with-failure\"\n              ]\n            }\n        \"\"\"),\n        jsonEquals(\n                \"\"\"\n                {\n                  \"ids\": [\n                    \"${json-unit.any-string}\"\n                  ],\n                  \"errors\": [\n                    {\n                      \"errorType\": \"stub-generation-failure\",\n                      \"reason\": \"POST /foo not allowed\",\n                      \"originalServeEvent\": {\n                        \"request\": {\n                          \"url\": \"/foo\"\n                        }\n                      }\n                    },\n                    {\n                      \"errorType\": \"stub-generation-failure\",\n                      \"reason\": \"POST / not allowed\",\n                      \"originalServeEvent\": {\n                        \"request\": {\n                          \"url\": \"/\"\n                        }\n                      }\n                    }\n                  ]\n                }\n            \"\"\")\n            .withOptions(List.of(Option.IGNORING_EXTRA_FIELDS)));\n  }\n\n  private static final String QUERY_METHOD_SNAPSHOT_REQUEST =\n      \"{                                      \\n\"\n          + \"    \\\"outputFormat\\\": \\\"full\\\",        \\n\"\n          + \"    \\\"persist\\\": \\\"false\\\"             \\n\"\n          + \"}                                        \";\n\n  private static final String QUERY_METHOD_SNAPSHOT_RESPONSE =\n      \"{                                                           \\n\"\n          + \"    \\\"mappings\\\": [                                         \\n\"\n          + \"        {                                                   \\n\"\n          + \"            \\\"request\\\" : {                                 \\n\"\n          + \"                \\\"url\\\" : \\\"/search/users\\\",                \\n\"\n          + \"                \\\"method\\\" : \\\"QUERY\\\",                     \\n\"\n          + \"                \\\"bodyPatterns\\\" : [                        \\n\"\n          + \"                    {                                       \\n\"\n          + \"                        \\\"equalToJson\\\" : \\\"{\\\\\\\"name\\\\\\\":\\\\\\\"John\\\\\\\"}\\\",\\n\"\n          + \"                        \\\"ignoreArrayOrder\\\" : true,        \\n\"\n          + \"                        \\\"ignoreExtraElements\\\" : true      \\n\"\n          + \"                    }                                       \\n\"\n          + \"                ]                                           \\n\"\n          + \"            },                                              \\n\"\n          + \"            \\\"response\\\" : {                                \\n\"\n          + \"                \\\"status\\\" : 200                            \\n\"\n          + \"            }                                               \\n\"\n          + \"        }                                                   \\n\"\n          + \"    ]                                                       \\n\"\n          + \"}                                                             \";\n\n  @Test\n  public void recordsQueryMethodRequestsWithBody() {\n    proxyServerStartWithEmptyFileRoot();\n\n    // Make a QUERY request with a JSON body\n    proxyingTestClient.queryJson(\"/search/users\", \"{\\\"name\\\":\\\"John\\\"}\");\n\n    String actual = proxyingTestClient.snapshot(QUERY_METHOD_SNAPSHOT_REQUEST);\n    assertThat(actual, equalToJson(QUERY_METHOD_SNAPSHOT_RESPONSE, JSONCompareMode.LENIENT));\n\n    // Should have persisted the stub mapping (2 = 1 proxy + 1 recorded)\n    assertEquals(2, proxyingService.getStubMappings().size());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/RecordingDslAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_TYPE;\nimport static com.github.tomakehurst.wiremock.common.Gzip.gzip;\nimport static com.github.tomakehurst.wiremock.common.Strings.rightPad;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.findMappingWithUrl;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static org.apache.hc.core5.http.ContentType.APPLICATION_OCTET_STREAM;\nimport static org.apache.hc.core5.http.ContentType.TEXT_PLAIN;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.nullValue;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.matching.EqualToJsonPattern;\nimport com.github.tomakehurst.wiremock.matching.MultiValuePattern;\nimport com.github.tomakehurst.wiremock.matching.SingleMatchMultiValuePattern;\nimport com.github.tomakehurst.wiremock.recording.NotRecordingException;\nimport com.github.tomakehurst.wiremock.recording.RecordingStatus;\nimport com.github.tomakehurst.wiremock.recording.RecordingStatusResult;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.File;\nimport java.util.List;\nimport java.util.Map;\nimport org.apache.hc.client5.http.entity.GzipCompressingEntity;\nimport org.apache.hc.core5.http.HttpEntity;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class RecordingDslAcceptanceTest extends AcceptanceTestBase {\n\n  private WireMockServer targetService;\n  private WireMockServer proxyingService;\n  private WireMockTestClient client;\n  private WireMock adminClient;\n  private String targetBaseUrl;\n  private File fileRoot;\n\n  @BeforeEach\n  public void init() {\n    fileRoot = setupTempFileRoot();\n    proxyingService =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .withRootDirectory(fileRoot.getAbsolutePath())\n                .enableBrowserProxying(true)\n                .trustAllProxyTargets(true));\n    proxyingService.start();\n\n    targetService = wireMockServer;\n    targetBaseUrl = \"http://localhost:\" + targetService.port();\n\n    client = new WireMockTestClient(proxyingService.port());\n    WireMock.configureFor(proxyingService.port());\n    adminClient = WireMock.create().port(proxyingService.port()).build();\n  }\n\n  @AfterEach\n  public void proxyServerShutdown() {\n    proxyingService.resetMappings();\n    proxyingService.stop();\n  }\n\n  @Test\n  public void\n      startsRecordingWithDefaultSpecFromTheSpecifiedProxyBaseUrlWhenServeEventsAlreadyExist() {\n    targetService.stubFor(get(\"/record-this\").willReturn(okForContentType(\"text/plain\", \"Got it\")));\n    targetService.stubFor(get(urlPathMatching(\"/do-not-record-this/.*\")).willReturn(noContent()));\n\n    client.get(\"/do-not-record-this/1\");\n    client.get(\"/do-not-record-this/2\");\n    client.get(\"/do-not-record-this/3\");\n\n    startRecording(targetBaseUrl);\n\n    client.get(\"/record-this\");\n\n    List<StubMapping> returnedMappings = stopRecording().getStubMappings();\n    client.get(\"/do-not-record-this/4\");\n\n    assertThat(returnedMappings.size(), is(1));\n    assertThat(returnedMappings.get(0).getRequest().getUrl(), is(\"/record-this\"));\n\n    StubMapping mapping = findMappingWithUrl(proxyingService.getStubMappings(), \"/record-this\");\n    assertThat(mapping.getResponse().getBody(), is(\"Got it\"));\n  }\n\n  @Test\n  public void generatesStubNameFromUrlPath() {\n    targetService.stubFor(get(urlPathMatching(\"/record-this/.*\")).willReturn(ok(\"Fine\")));\n\n    startRecording(targetBaseUrl);\n\n    String url = \"/record-this/with$!/safe/ŃaMe?ignore=this\";\n    client.get(url);\n\n    List<StubMapping> mappings = stopRecording().getStubMappings();\n\n    StubMapping mapping = mappings.get(0);\n    assertThat(mapping.getName(), is(\"record-this_with_safe_name\"));\n  }\n\n  @Test\n  public void\n      startsRecordingWithDefaultSpecFromTheSpecifiedProxyBaseUrlWhenNoServeEventsAlreadyExist() {\n    targetService.stubFor(get(\"/record-this\").willReturn(okForContentType(\"text/plain\", \"Got it\")));\n\n    startRecording(targetBaseUrl);\n\n    client.get(\"/record-this\");\n\n    List<StubMapping> returnedMappings = stopRecording().getStubMappings();\n\n    assertThat(returnedMappings.size(), is(1));\n    assertThat(returnedMappings.get(0).getRequest().getUrl(), is(\"/record-this\"));\n\n    StubMapping mapping = findMappingWithUrl(proxyingService.getStubMappings(), \"/record-this\");\n    assertThat(mapping.getResponse().getBody(), is(\"Got it\"));\n  }\n\n  @Test\n  public void recordsNothingWhenNoServeEventsAreReceivedDuringRecording() {\n    targetService.stubFor(get(urlPathMatching(\"/do-not-record-this/.*\")).willReturn(noContent()));\n\n    client.get(\"/do-not-record-this/1\");\n    client.get(\"/do-not-record-this/2\");\n\n    startRecording(targetBaseUrl);\n    List<StubMapping> returnedMappings = stopRecording().getStubMappings();\n    client.get(\"/do-not-record-this/3\");\n\n    assertThat(returnedMappings.size(), is(0));\n    assertThat(proxyingService.getStubMappings(), Matchers.empty());\n  }\n\n  @Test\n  public void recordsNothingWhenNoServeEventsAreReceivedAtAll() {\n    startRecording(targetBaseUrl);\n    List<StubMapping> returnedMappings = stopRecording().getStubMappings();\n\n    assertThat(returnedMappings.size(), is(0));\n    assertThat(proxyingService.getStubMappings(), Matchers.empty());\n  }\n\n  @Test\n  public void honoursRecordSpecWhenPresent() {\n    targetService.stubFor(get(\"/record-this-with-header\").willReturn(ok()));\n\n    startRecording(recordSpec().forTarget(targetBaseUrl).captureHeader(\"Accept\"));\n\n    client.get(\"/record-this\", withHeader(\"Accept\", \"text/plain\"));\n\n    List<StubMapping> returnedMappings = stopRecording().getStubMappings();\n\n    assertThat(\n        returnedMappings.get(0).getRequest().getHeaders().get(\"Accept\").getExpected(),\n        is(\"text/plain\"));\n  }\n\n  @Test\n  public void supportsInstanceClientWithDefaultSpec() {\n    targetService.stubFor(get(\"/record-this\").willReturn(okForContentType(\"text/plain\", \"Got it\")));\n\n    adminClient.startStubRecording(targetBaseUrl);\n\n    client.get(\"/record-this\");\n\n    List<StubMapping> returnedMappings = adminClient.stopStubRecording().getStubMappings();\n\n    assertThat(returnedMappings.size(), is(1));\n    assertThat(returnedMappings.get(0).getRequest().getUrl(), is(\"/record-this\"));\n\n    StubMapping mapping = findMappingWithUrl(proxyingService.getStubMappings(), \"/record-this\");\n    assertThat(mapping.getResponse().getBody(), is(\"Got it\"));\n  }\n\n  @Test\n  public void supportsInstanceClientWithSpec() {\n    targetService.stubFor(post(\"/record-this-with-body\").willReturn(ok()));\n\n    adminClient.startStubRecording(\n        recordSpec().forTarget(targetBaseUrl).matchRequestBodyWithEqualToJson(true, true));\n\n    client.postJson(\"/record-this-with-body\", \"{}\");\n\n    List<StubMapping> returnedMappings = adminClient.stopStubRecording().getStubMappings();\n\n    EqualToJsonPattern bodyPattern =\n        (EqualToJsonPattern) returnedMappings.get(0).getRequest().getBodyPatterns().get(0);\n    assertThat(bodyPattern.isIgnoreArrayOrder(), is(true));\n    assertThat(bodyPattern.isIgnoreExtraElements(), is(true));\n  }\n\n  @Test\n  public void supportsDirectDslCallsWithSpec() {\n    targetService.stubFor(post(\"/record-this-with-body\").willReturn(ok()));\n\n    proxyingService.startRecording(\n        recordSpec().forTarget(targetBaseUrl).matchRequestBodyWithEqualToJson(true, true));\n\n    client.postJson(\"/record-this-with-body\", \"{}\");\n\n    List<StubMapping> returnedMappings = proxyingService.stopRecording().getStubMappings();\n\n    EqualToJsonPattern bodyPattern =\n        (EqualToJsonPattern) returnedMappings.get(0).getRequest().getBodyPatterns().get(0);\n    assertThat(bodyPattern.isIgnoreArrayOrder(), is(true));\n    assertThat(bodyPattern.isIgnoreExtraElements(), is(true));\n  }\n\n  @Test\n  public void returnsTheRecordingStatus() {\n    proxyingService.startRecording(targetBaseUrl);\n\n    RecordingStatusResult result = getRecordingStatus();\n\n    assertThat(result.getStatus(), is(RecordingStatus.Recording));\n  }\n\n  @Test\n  public void returnsTheRecordingStatusViaInstanceClient() {\n    proxyingService.startRecording(targetBaseUrl);\n    proxyingService.stopRecording();\n\n    RecordingStatusResult result = adminClient.getStubRecordingStatus();\n\n    assertThat(result.getStatus(), is(RecordingStatus.Stopped));\n  }\n\n  @Test\n  public void returnsTheRecordingStatusViaDirectDsl() {\n    proxyingService.startRecording(targetBaseUrl);\n\n    RecordingStatusResult result = proxyingService.getRecordingStatus();\n\n    assertThat(result.getStatus(), is(RecordingStatus.Recording));\n  }\n\n  @Test\n  public void recordsIntoPlainTextWhenRequestIsGZipped() {\n    proxyingService.startRecording(targetBaseUrl);\n    targetService.stubFor(post(\"/gzipped\").willReturn(ok(\"Zippy\")));\n\n    HttpEntity compressedBody =\n        new GzipCompressingEntity(new StringEntity(\"expected body\", TEXT_PLAIN));\n    client.post(\"/gzipped\", compressedBody);\n\n    StubMapping mapping = proxyingService.stopRecording().getStubMappings().get(0);\n    assertThat(mapping.getRequest().getBodyPatterns().get(0).getExpected(), is(\"expected body\"));\n  }\n\n  @Test\n  public void recordsIntoPlainTextWhenResponseIsGZipped() {\n    proxyingService.startRecording(targetBaseUrl);\n\n    byte[] gzippedBody = gzip(\"Zippy\");\n    targetService.stubFor(\n        get(\"/gzipped-response\")\n            .willReturn(\n                aResponse()\n                    .withHeader(\"Content-Encoding\", \"gzip\")\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(gzippedBody)));\n\n    client.get(\"/gzipped-response\");\n\n    StubMapping mapping = proxyingService.stopRecording().getStubMappings().get(0);\n    assertThat(mapping.getResponse().getBody(), is(\"Zippy\"));\n  }\n\n  @Test\n  public void recordsIntoPlainBinaryWhenResponseIsGZipped() {\n    proxyingService.startRecording(targetBaseUrl);\n\n    byte[] originalBody = \"sdkfnslkdjfsjdf\".getBytes(UTF_8);\n    byte[] gzippedBody = gzip(originalBody);\n    targetService.stubFor(\n        get(\"/gzipped-response\")\n            .willReturn(\n                aResponse()\n                    .withHeader(\"Content-Encoding\", \"gzip\")\n                    .withHeader(\"Content-Type\", APPLICATION_OCTET_STREAM.getMimeType())\n                    .withBody(gzippedBody)));\n\n    client.get(\"/gzipped-response\");\n\n    StubMapping mapping = proxyingService.stopRecording().getStubMappings().get(0);\n    assertThat(mapping.getResponse().getByteBody(), is(originalBody));\n  }\n\n  static final String IMAGE_CONTENT_BASE64 =\n      \"iVBORw0KGgoAAAANSUhEUgAAACAAAAAPCAYAAACFgM0XAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAABcSAAAXEgFnn9JSAAAAB3RJTUUH4AYeEQ8RFdqRVAAAA/VJREFUOMvFk9+LVHUYxj/v9/yYmbVVN1NKDVvDH6yBiuiWrG6LelG33lQQ1EVIUNA/YBARRNHVFgRWF93URV4VJGQm/l5KFNfaQNnN1a3NH+vOzM6cOed8v9+3i5mdGcLb6IUDhwfe532+D88D//PIpi8n3pIwDFAENPNp42huzMy0tdHauPBCjPYDihgkin/wNr8wdfxrYfvIcy6It7zoT8moOxLHWBfi0AVz+ePDh75/86NPwWgf8BLQiyBY+cPPmm8w5A99MAVAKGH4ikSFrQCoqnhfy4Pwc5fMrUniwjs9xSX9SFvv+sFt/WOTMzuXShQfliB6esD9Sa8keAx48HU5+/prn51DKUvIIPAhUALwVZnSRC4QMLXIaNTZb0G1yS8iQbD31t4nEZFttTxd61BAWh87r0zMPkJc2qAm2NTHAsP+alufWgHLFrPcD2hFAPYtHkdBG/K4FHVQIqUjIEuP4f29DhLs3Pjd2KMiMpQ5F6XWdgyAfuvsFoJwl5egb0Bvsllv4pGmvgwIWC5FHTar3TJguL1pASWUkh4INzhTe/eJ5jlXnRtX78bbJhuzLotLe4BBr0rd5nT00uOc3U8QDAPs9eMso9aKD2guSKxIUYfJZDewaXFRc0EChRK7fVUek0KT1fQOjlTU2p+6ctljlVdFdbMCSZ7htSMhz/ODxoRDS0kY1vGOO761XVAosR3hELC0veiAAkhR+yXWHVJQ5kfXYJJrE2iensT7KqqQ5eRODyCyQoDUWTJnmwqsJUuzzc6EqzfoDE/5G037AXV4CRSKIKGuAp6nW5w0xUmkBQz7I2OICTCuMoevV66qsxPkFl9PaDgXait1XrVsbX4e69B6gyTLUGDI/8oKKk37QRHOUaAqkYIgQNRV92lC7km8yMqeHL9SAJP9NUXfrqH7Wq+f1FqdvJaQtt8FCr8Fzo9qPam5WkKijh5SRvQKwaLvUJeAIxLrZHdiO8HmqMQ6hmkjG4GtAGb6vZeZPzuGmy+f8OWFJM0yrHRYBM6UGva4VmrXs6RBQwz9Oss2nWx2f/GFwo8IFx9wvgEcw3CqC+sBRgSaDHb2Fu7u7Ut+vnwtwaOd+wlw4lpl7q6Wq6cbLscZwzP6O6v0fpdP/CLCDHCmE8f23ACuAOeBhS78WYWHDYC7M8vk+wdv59WF043I0GXjdeDSykqKrSwcr4cmLZCxz18mwrUbBpxqFeVn4M6/BFxUuA1MAJNd+ACwIwSY/uIN+t4+Rlgpf2VFi2S5iGLUmPPau+ROKkpeii404uCTFfl83zr/t9aJfSwub1l8okU6CYwC6zvZ56iAV7gn8DGwo1VKAHlQZP7zSUbXtf//AaFX9LL7Nh3cAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE2LTA2LTMwVDE3OjE1OjE3KzAxOjAwsKT/BwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNi0wNi0zMFQxNzoxNToxNyswMTowMMH5R7sAAAAASUVORK5CYII=\";\n\n  @Test\n  public void defaultsToWritingBinaryResponseFilesOfAnySize() {\n    targetService.stubFor(\n        get(\"/myimage.png\").willReturn(aResponse().withBase64Body(IMAGE_CONTENT_BASE64)));\n\n    proxyingService.startRecording(recordSpec().forTarget(targetBaseUrl));\n\n    client.get(\"/myimage.png\");\n\n    List<StubMapping> mappings = proxyingService.stopRecording().getStubMappings();\n    StubMapping mapping = mappings.get(0);\n    String bodyFileName = mapping.getResponse().getBodyFileName();\n\n    assertThat(bodyFileName, is(\"myimage.png-\" + mapping.getId() + \".png\"));\n    File bodyFile = new File(fileRoot, \"__files/\" + bodyFileName);\n    assertThat(bodyFile.exists(), is(true));\n  }\n\n  @Test\n  public void defaultsToWritingTextResponseFilesOver1Kb() {\n    targetService.stubFor(\n        get(\"/large.txt\")\n            .willReturn(\n                aResponse()\n                    .withHeader(CONTENT_TYPE, \"text/plain\")\n                    .withBody(rightPad(\"\", 10241, 'a'))));\n\n    proxyingService.startRecording(recordSpec().forTarget(targetBaseUrl));\n\n    client.get(\"/large.txt\");\n\n    List<StubMapping> mappings = proxyingService.stopRecording().getStubMappings();\n    StubMapping mapping = mappings.get(0);\n    String bodyFileName = mapping.getResponse().getBodyFileName();\n\n    assertThat(bodyFileName, is(\"large.txt-\" + mapping.getId() + \".txt\"));\n    File bodyFile = new File(fileRoot, \"__files/\" + bodyFileName);\n    assertThat(bodyFile.exists(), is(true));\n  }\n\n  @Test\n  public void doesNotWriteTextResponseFilesUnder1KbByDefault() {\n    targetService.stubFor(\n        get(\"/small.txt\")\n            .willReturn(\n                aResponse()\n                    .withHeader(CONTENT_TYPE, \"text/plain\")\n                    .withBody(rightPad(\"\", 10239, 'a'))));\n\n    proxyingService.startRecording(recordSpec().forTarget(targetBaseUrl));\n\n    client.get(\"/small.txt\");\n\n    List<StubMapping> mappings = proxyingService.stopRecording().getStubMappings();\n    String bodyFileName = mappings.get(0).getResponse().getBodyFileName();\n\n    assertThat(bodyFileName, nullValue());\n  }\n\n  @Test\n  void recordsViaBrowserProxyingWhenNoTargetUrlSpecified() {\n    targetService.stubFor(get(urlPathMatching(\"/record-this/.*\")).willReturn(ok(\"Via proxy\")));\n\n    startRecording();\n\n    String url = targetService.baseUrl() + \"/record-this/123\";\n    client.getViaProxy(url, proxyingService.port());\n\n    List<StubMapping> mappings = stopRecording().getStubMappings();\n\n    StubMapping mapping = mappings.get(0);\n    assertThat(mapping.getRequest().getUrl(), is(\"/record-this/123\"));\n  }\n\n  @Test\n  void whenRepeatsAsScenariosIsEnabledResponsesAreReturnedInRecordedOrder() {\n    proxyingService.startRecording(targetService.baseUrl());\n    targetService.stubFor(get(\"/sequence\").willReturn(ok(\"1\")));\n    client.get(\"/sequence\");\n    targetService.stubFor(get(\"/sequence\").willReturn(ok(\"2\")));\n    client.get(\"/sequence\");\n    targetService.stubFor(get(\"/sequence\").willReturn(ok(\"3\")));\n    client.get(\"/sequence\");\n    proxyingService.stopRecording();\n\n    assertThat(client.get(\"/sequence\").content(), is(\"1\"));\n    assertThat(client.get(\"/sequence\").content(), is(\"2\"));\n    assertThat(client.get(\"/sequence\").content(), is(\"3\"));\n  }\n\n  @Test\n  public void throwsAnErrorIfAttemptingToStopViaStaticRemoteDslWhenNotRecording() {\n    assertThrows(NotRecordingException.class, WireMock::stopRecording);\n  }\n\n  @Test\n  public void throwsAnErrorIfAttemptingToStopViaInstanceRemoteDslWhenNotRecording() {\n    assertThrows(NotRecordingException.class, adminClient::stopStubRecording);\n  }\n\n  @Test\n  public void throwsAnErrorIfAttemptingToStopViaDirectDslWhenNotRecording() {\n    assertThrows(NotRecordingException.class, proxyingService::stopRecording);\n  }\n\n  @Test\n  void recordsQueryParametersToQueryParameterMatchers() {\n    targetService.stubFor(\n        get(urlPathEqualTo(\"/record-this\")).willReturn(okForContentType(\"text/plain\", \"Got it\")));\n\n    startRecording(targetBaseUrl);\n\n    client.get(\"/record-this?q1=my-value&second-q=another-value&q1=my-other-value\");\n\n    List<StubMapping> returnedMappings = stopRecording().getStubMappings();\n\n    assertThat(returnedMappings.size(), is(1));\n    assertThat(returnedMappings.get(0).getRequest().getUrl(), nullValue());\n    assertThat(returnedMappings.get(0).getRequest().getUrlPath(), is(\"/record-this\"));\n    Map<String, MultiValuePattern> queryParameters =\n        returnedMappings.get(0).getRequest().getQueryParameters();\n    assertThat(queryParameters.size(), is(2));\n    assertThat(queryParameters.get(\"q1\"), is(havingExactly(\"my-value\", \"my-other-value\")));\n    assertThat(\n        queryParameters.get(\"second-q\"),\n        is(new SingleMatchMultiValuePattern(equalTo(\"another-value\"))));\n\n    assertThat(\n        client\n            .get(\"/record-this?q1=my-other-value&q1=my-value&second-q=another-value\")\n            .statusCode(),\n        is(200));\n    assertThat(\n        client\n            .get(\n                \"/record-this?q1=my-other-value&q1=my-value&second-q=another-value&q1=a-third-value\")\n            .statusCode(),\n        is(404));\n  }\n\n  @Test\n  void canDetermineFileExtensionWhenRequestContainsQueryParameters() {\n    targetService.stubFor(\n        get(urlPathEqualTo(\"/myimage.png\"))\n            .willReturn(aResponse().withBase64Body(IMAGE_CONTENT_BASE64)));\n\n    proxyingService.startRecording(recordSpec().forTarget(targetBaseUrl));\n\n    client.get(\"/myimage.png?q1=my-value&q1=my-other-value\");\n\n    List<StubMapping> mappings = proxyingService.stopRecording().getStubMappings();\n    StubMapping mapping = mappings.get(0);\n    String bodyFileName = mapping.getResponse().getBodyFileName();\n\n    assertThat(bodyFileName, is(\"myimage.png-\" + mapping.getId() + \".png\"));\n    File bodyFile = new File(fileRoot, \"__files/\" + bodyFileName);\n    assertThat(bodyFile.exists(), is(true));\n  }\n\n  @Test\n  void canCreateScenarioStubsFromRequestsWithQueryParameters() {\n    proxyingService.startRecording(targetService.baseUrl());\n    targetService.stubFor(get(urlPathEqualTo(\"/sequence\")).willReturn(ok(\"1\")));\n    client.get(\"/sequence?q1=my-value&q2=another-value&q1=my-other-value\");\n    targetService.stubFor(get(urlPathEqualTo(\"/sequence\")).willReturn(ok(\"2\")));\n    client.get(\"/sequence?q1=my-value&q2=another-value&q1=my-other-value\");\n    targetService.stubFor(get(urlPathEqualTo(\"/sequence\")).willReturn(ok(\"3\")));\n    client.get(\"/sequence?q1=my-value&q2=another-value&q1=my-other-value\");\n    proxyingService.stopRecording();\n\n    assertThat(client.get(\"/sequence\").statusCode(), is(404));\n    assertThat(\n        client.get(\"/sequence?q1=my-value&q2=another-value&q1=my-other-value\").content(), is(\"1\"));\n    assertThat(\n        client.get(\"/sequence?q2=another-value&q1=my-value&q1=my-other-value\").content(), is(\"2\"));\n    assertThat(\n        client.get(\"/sequence?q1=my-value&q1=my-other-value&q2=another-value\").content(), is(\"3\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/RemoteMappingsLoaderAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResourceURI;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.admin.model.SingleStubMappingResult;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport java.io.File;\nimport java.util.UUID;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\n\npublic class RemoteMappingsLoaderAcceptanceTest extends AcceptanceTestBase {\n\n  static WireMock wmClient;\n  static File rootDir;\n\n  @BeforeAll\n  public static void initWithTempDir() throws Exception {\n    setupServerWithTempFileRoot();\n    wmClient = WireMock.create().port(wireMockServer.port()).build();\n    rootDir = new File(getResourceURI(RemoteMappingsLoaderAcceptanceTest.class, \"remoteloader\"));\n  }\n\n  @Test\n  public void loadsTheMappingsFromTheDirectorySpecifiedIntoTheRemoteWireMockServer() {\n    wmClient.loadMappingsFrom(rootDir);\n\n    assertThat(testClient.get(\"/remote-load/1\").content(), is(\"Remote load 1\"));\n    assertThat(\n        testClient.get(\"/remote-load/2\", withHeader(\"Accept\", \"text/plain\")).content(),\n        is(\"Remote load 2\"));\n  }\n\n  @Test\n  public void convertsBodyFileToStringBodyWhenAKnownTextTypeFromFileExtension() {\n    wmClient.loadMappingsFrom(rootDir);\n\n    SingleStubMappingResult stubMapping =\n        wmClient.getStubMapping(UUID.fromString(\"e7af68ed-ed7c-4f9f-9d34-344c88cca8b7\"));\n\n    assertThat(stubMapping.getItem().getResponse().specifiesBinaryBodyContent(), is(false));\n    assertThat(testClient.get(\"/text-file\").content(), is(\"Some text\"));\n  }\n\n  @Test\n  public void convertsBodyFileToStringBodyWhenAKnownImageTypeFromFileExtension() {\n    wmClient.loadMappingsFrom(rootDir);\n    SingleStubMappingResult stubMapping =\n        wmClient.getStubMapping(UUID.fromString(\"f7550b27-b544-4967-b7e8-f777eca68235\"));\n\n    assertThat(stubMapping.getItem().getResponse().specifiesBinaryBodyContent(), is(true));\n  }\n\n  @Test\n  public void convertsBodyFileToStringBodyWhenAKnownTextTypeFromContentTypeHeader() {\n    wmClient.loadMappingsFrom(rootDir);\n\n    SingleStubMappingResult stubMapping =\n        wmClient.getStubMapping(UUID.fromString(\"08851f9e-8b9a-4e32-a4f3-7befd9c72d4d\"));\n\n    assertThat(stubMapping.getItem().getResponse().specifiesBinaryBodyContent(), is(false));\n  }\n\n  @Test\n  public void convertsBodyFileToStringBodyWhenAKnownImageTypeFromContentTypeHeader() {\n    wmClient.loadMappingsFrom(rootDir);\n    SingleStubMappingResult stubMapping =\n        wmClient.getStubMapping(UUID.fromString(\"59179b2b-ce01-49cf-8381-280dcd559484\"));\n\n    assertThat(stubMapping.getItem().getResponse().specifiesBinaryBodyContent(), is(true));\n  }\n\n  @Test\n  public void loadMultipleMappingsFromOneFile() {\n    wmClient.loadMappingsFrom(rootDir);\n\n    assertThat(testClient.get(\"/todo/items\").content(), is(\"<items><item>Buy milk</item></items>\"));\n    assertThat(\n        testClient\n            .postWithBody(\n                \"/todo/items\",\n                \"{\\\"subscription\\\": \\\"Cancel newspaper subscription\\\"}\",\n                \"application/json\",\n                \"UTF-8\")\n            .statusCode(),\n        is(201));\n    assertThat(\n        testClient.get(\"/todo/items\").content(),\n        is(\"<items><item>Buy milk</item><item>Cancel newspaper subscription</item></items>\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/RemoveStubMappingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static java.util.Arrays.asList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.UUID;\nimport java.util.function.Predicate;\nimport org.junit.jupiter.api.Test;\n\npublic class RemoveStubMappingAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void removeStubThatExistsUsingUUID() {\n\n    UUID id1 = UUID.randomUUID();\n\n    stubFor(get(urlEqualTo(\"/stub-1\")).withId(id1).willReturn(aResponse().withBody(\"Stub-1-Body\")));\n\n    assertThat(testClient.get(\"/stub-1\").content(), is(\"Stub-1-Body\"));\n\n    UUID id2 = UUID.randomUUID();\n    stubFor(get(urlEqualTo(\"/stub-2\")).withId(id2).willReturn(aResponse().withBody(\"Stub-2-Body\")));\n\n    assertThat(testClient.get(\"/stub-2\").content(), is(\"Stub-2-Body\"));\n\n    assertThat(getMatchingStubCount(\"/stub-1\", \"/stub-2\"), is(2));\n\n    removeStub(\n        get(urlEqualTo(\"/stub-2\")).withId(id2).willReturn(aResponse().withBody(\"Stub-2-Body\")));\n\n    assertThat(getMatchingStubCount(\"/stub-1\", \"/stub-2\"), is(1));\n\n    removeStub(\n        get(urlEqualTo(\"/stub-1\")).withId(id1).willReturn(aResponse().withBody(\"Stub-1-Body\")));\n\n    assertThat(getMatchingStubCount(\"/stub-1\", \"/stub-2\"), is(0));\n  }\n\n  @Test\n  public void removeStubThatExistsUsingRequestMatchUUIDNotMatch() {\n\n    UUID id1 = UUID.randomUUID();\n\n    stubFor(\n        get(urlEqualTo(\"/stub-11\")).withId(id1).willReturn(aResponse().withBody(\"Stub-11-Body\")));\n\n    assertThat(testClient.get(\"/stub-11\").content(), is(\"Stub-11-Body\"));\n\n    UUID id2 = UUID.randomUUID();\n    stubFor(\n        get(urlEqualTo(\"/stub-22\")).withId(id2).willReturn(aResponse().withBody(\"Stub-22-Body\")));\n\n    assertThat(testClient.get(\"/stub-22\").content(), is(\"Stub-22-Body\"));\n\n    assertThat(getMatchingStubCount(\"/stub-11\", \"/stub-22\"), is(2));\n\n    UUID id3 = UUID.randomUUID();\n    removeStub(\n        get(urlEqualTo(\"/stub-22\")).withId(id3).willReturn(aResponse().withBody(\"Stub-22-Body\")));\n\n    assertThat(getMatchingStubCount(\"/stub-11\", \"/stub-22\"), is(1));\n\n    UUID id4 = UUID.randomUUID();\n    removeStub(\n        get(urlEqualTo(\"/stub-11\")).withId(id4).willReturn(aResponse().withBody(\"Stub-11-Body\")));\n\n    assertThat(getMatchingStubCount(\"/stub-11\", \"/stub-22\"), is(0));\n  }\n\n  @Test\n  public void removeStubThatExistsWithRequestMatchNoUUIDPresent() {\n\n    UUID id1 = UUID.randomUUID();\n\n    stubFor(\n        get(urlEqualTo(\"/stub-111\")).withId(id1).willReturn(aResponse().withBody(\"Stub-111-Body\")));\n\n    assertThat(testClient.get(\"/stub-111\").content(), is(\"Stub-111-Body\"));\n\n    UUID id2 = UUID.randomUUID();\n    stubFor(\n        get(urlEqualTo(\"/stub-222\")).withId(id2).willReturn(aResponse().withBody(\"Stub-222-Body\")));\n\n    assertThat(testClient.get(\"/stub-222\").content(), is(\"Stub-222-Body\"));\n\n    assertThat(getMatchingStubCount(\"/stub-111\", \"/stub-222\"), is(2));\n\n    removeStub(get(urlEqualTo(\"/stub-222\")).willReturn(aResponse().withBody(\"Stub-222-Body\")));\n\n    assertThat(getMatchingStubCount(\"/stub-111\", \"/stub-222\"), is(1));\n\n    removeStub(get(urlEqualTo(\"/stub-111\")).willReturn(aResponse().withBody(\"Stub-111-Body\")));\n\n    assertThat(getMatchingStubCount(\"/stub-111\", \"/stub-222\"), is(0));\n  }\n\n  @Test\n  public void removeStubThatDoesNotExists() {\n\n    UUID id1 = UUID.randomUUID();\n\n    stubFor(get(urlEqualTo(\"/stb-1\")).withId(id1).willReturn(aResponse().withBody(\"Stb-1-Body\")));\n\n    assertThat(testClient.get(\"/stb-1\").content(), is(\"Stb-1-Body\"));\n\n    UUID id2 = UUID.randomUUID();\n    stubFor(get(urlEqualTo(\"/stb-2\")).withId(id2).willReturn(aResponse().withBody(\"Stb-2-Body\")));\n\n    assertThat(testClient.get(\"/stb-2\").content(), is(\"Stb-2-Body\"));\n\n    assertThat(getMatchingStubCount(\"/stb-1\", \"/stb-2\"), is(2));\n\n    UUID id3 = UUID.randomUUID();\n    removeStub(\n        get(urlEqualTo(\"/stb-3\")).withId(id3).willReturn(aResponse().withBody(\"Stb-3-Body\")));\n\n    assertThat(getMatchingStubCount(\"/stb-1\", \"/stb-2\"), is(2));\n  }\n\n  @Test\n  public void removeStubWithUUIDThatExists() {\n\n    UUID id1 = UUID.randomUUID();\n\n    stubFor(get(urlEqualTo(\"/stub-1\")).withId(id1).willReturn(aResponse().withBody(\"Stub-1-Body\")));\n\n    assertThat(testClient.get(\"/stub-1\").content(), is(\"Stub-1-Body\"));\n\n    assertThat(getMatchingStubCount(\"/stub-1\", \"\"), is(1));\n\n    removeStub(id1);\n\n    assertThat(getMatchingStubCount(\"/stub-1\", \"\"), is(0));\n  }\n\n  @Test\n  public void removeStubWithUUIDThatDoesNotExists() {\n\n    UUID id1 = UUID.randomUUID();\n\n    stubFor(get(urlEqualTo(\"/stb-1\")).withId(id1).willReturn(aResponse().withBody(\"Stb-1-Body\")));\n\n    assertThat(testClient.get(\"/stb-1\").content(), is(\"Stb-1-Body\"));\n\n    removeStub(id1);\n\n    assertThat(getMatchingStubCount(\"/stb-1\", \"\"), is(0));\n  }\n\n  private Predicate<StubMapping> withAnyOf(final String... urls) {\n    return mapping ->\n        mapping.getRequest().getUrl() != null\n            && asList(urls).contains(mapping.getRequest().getUrl());\n  }\n\n  private synchronized int getMatchingStubCount(String url1, String url2) {\n    return (int) listAllStubMappings().getMappings().stream().filter(withAnyOf(url1, url2)).count();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/RemoveStubMappingsAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.listAllStubMappings;\nimport static com.github.tomakehurst.wiremock.client.WireMock.removeStubs;\nimport static com.github.tomakehurst.wiremock.client.WireMock.saveAllMappings;\nimport static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsInAnyOrder;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.core.WireMockApp;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.io.File;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.UUID;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\nclass RemoveStubMappingsAcceptanceTest extends AcceptanceTestBase {\n\n  File rootDir;\n\n  @BeforeEach\n  @Override\n  public void init() throws InterruptedException {\n    rootDir = setupServerWithTempFileRoot();\n  }\n\n  @AfterEach\n  void cleanup() {\n    serverShutdown();\n  }\n\n  @Test\n  void removeStubsThatExistUsingUUID() {\n    StubMapping stub1 =\n        stubFor(\n            get(urlEqualTo(\"/stub-1\")).withName(\"stub 1\").willReturn(aResponse().withStatus(200)));\n    StubMapping stub2 =\n        stubFor(\n            get(urlEqualTo(\"/stub-2\")).withName(\"stub 2\").willReturn(aResponse().withStatus(201)));\n    StubMapping stub3 =\n        stubFor(\n            get(urlEqualTo(\"/stub-3\")).withName(\"stub 3\").willReturn(aResponse().withStatus(202)));\n\n    saveAllMappings();\n\n    assertThat(testClient.get(\"/stub-1\").statusCode(), is(200));\n    assertThat(testClient.get(\"/stub-2\").statusCode(), is(201));\n    assertThat(testClient.get(\"/stub-3\").statusCode(), is(202));\n    assertEquals(1, matchingStubCount(\"/stub-1\"));\n    assertEquals(1, matchingStubCount(\"/stub-2\"));\n    assertEquals(1, matchingStubCount(\"/stub-3\"));\n    File mappingsDir = rootDir.toPath().resolve(WireMockApp.MAPPINGS_ROOT).toFile();\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(mappingsDir.listFiles())).toList(),\n        containsInAnyOrder(\n            new File(mappingsDir, \"stub-1-\" + stub1.getId() + \".json\"),\n            new File(mappingsDir, \"stub-2-\" + stub2.getId() + \".json\"),\n            new File(mappingsDir, \"stub-3-\" + stub3.getId() + \".json\")));\n\n    removeStubs(\n        List.of(\n            get(\"/whatever\").withId(stub1.getId()).build(),\n            get(\"/whatever\").withId(stub3.getId()).build()));\n\n    assertThat(testClient.get(\"/stub-1\").statusCode(), is(404));\n    assertThat(testClient.get(\"/stub-2\").statusCode(), is(201));\n    assertThat(testClient.get(\"/stub-3\").statusCode(), is(404));\n    assertEquals(0, matchingStubCount(\"/stub-1\"));\n    assertEquals(1, matchingStubCount(\"/stub-2\"));\n    assertEquals(0, matchingStubCount(\"/stub-3\"));\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(mappingsDir.listFiles())).toList(),\n        containsInAnyOrder(new File(mappingsDir, \"stub-2-\" + stub2.getId() + \".json\")));\n  }\n\n  @Test\n  void removeStubsThatExistUsingRequestMatch() {\n    StubMapping stub1 =\n        stubFor(\n            get(urlEqualTo(\"/stub-1\")).withName(\"stub 1\").willReturn(aResponse().withStatus(200)));\n    StubMapping stub2 =\n        stubFor(\n            get(urlEqualTo(\"/stub-2\")).withName(\"stub 2\").willReturn(aResponse().withStatus(201)));\n    StubMapping stub3 =\n        stubFor(\n            get(urlEqualTo(\"/stub-3\")).withName(\"stub 3\").willReturn(aResponse().withStatus(202)));\n\n    saveAllMappings();\n\n    assertThat(testClient.get(\"/stub-1\").statusCode(), is(200));\n    assertThat(testClient.get(\"/stub-2\").statusCode(), is(201));\n    assertThat(testClient.get(\"/stub-3\").statusCode(), is(202));\n    assertEquals(1, matchingStubCount(\"/stub-1\"));\n    assertEquals(1, matchingStubCount(\"/stub-2\"));\n    assertEquals(1, matchingStubCount(\"/stub-3\"));\n    File mappingsDir = rootDir.toPath().resolve(WireMockApp.MAPPINGS_ROOT).toFile();\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(mappingsDir.listFiles())).toList(),\n        containsInAnyOrder(\n            new File(mappingsDir, \"stub-1-\" + stub1.getId() + \".json\"),\n            new File(mappingsDir, \"stub-2-\" + stub2.getId() + \".json\"),\n            new File(mappingsDir, \"stub-3-\" + stub3.getId() + \".json\")));\n\n    removeStubs(\n        List.of(\n            get(urlEqualTo(\"/stub-1\")).withId(UUID.randomUUID()).build(),\n            get(urlEqualTo(\"/stub-3\")).withId(UUID.randomUUID()).build()));\n\n    assertThat(testClient.get(\"/stub-1\").statusCode(), is(404));\n    assertThat(testClient.get(\"/stub-2\").statusCode(), is(201));\n    assertThat(testClient.get(\"/stub-3\").statusCode(), is(404));\n    assertEquals(0, matchingStubCount(\"/stub-1\"));\n    assertEquals(1, matchingStubCount(\"/stub-2\"));\n    assertEquals(0, matchingStubCount(\"/stub-3\"));\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(mappingsDir.listFiles())).toList(),\n        containsInAnyOrder(new File(mappingsDir, \"stub-2-\" + stub2.getId() + \".json\")));\n  }\n\n  @Test\n  void removesNothingWhenNoneOfTheStubsExist() {\n    StubMapping stub1 =\n        stubFor(\n            get(urlEqualTo(\"/stub-1\")).withName(\"stub 1\").willReturn(aResponse().withStatus(200)));\n    StubMapping stub2 =\n        stubFor(\n            get(urlEqualTo(\"/stub-2\")).withName(\"stub 2\").willReturn(aResponse().withStatus(201)));\n\n    saveAllMappings();\n\n    assertThat(testClient.get(\"/stub-1\").statusCode(), is(200));\n    assertThat(testClient.get(\"/stub-2\").statusCode(), is(201));\n    assertEquals(1, matchingStubCount(\"/stub-1\"));\n    assertEquals(1, matchingStubCount(\"/stub-2\"));\n    File mappingsDir = rootDir.toPath().resolve(WireMockApp.MAPPINGS_ROOT).toFile();\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(mappingsDir.listFiles())).toList(),\n        containsInAnyOrder(\n            new File(mappingsDir, \"stub-1-\" + stub1.getId() + \".json\"),\n            new File(mappingsDir, \"stub-2-\" + stub2.getId() + \".json\")));\n\n    removeStubs(\n        List.of(\n            get(urlEqualTo(\"/whatever\")).withId(UUID.randomUUID()).build(),\n            get(urlEqualTo(\"/whatever\")).withId(UUID.randomUUID()).build()));\n\n    assertThat(testClient.get(\"/stub-1\").statusCode(), is(200));\n    assertThat(testClient.get(\"/stub-2\").statusCode(), is(201));\n    assertEquals(1, matchingStubCount(\"/stub-1\"));\n    assertEquals(1, matchingStubCount(\"/stub-2\"));\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(mappingsDir.listFiles())).toList(),\n        containsInAnyOrder(\n            new File(mappingsDir, \"stub-1-\" + stub1.getId() + \".json\"),\n            new File(mappingsDir, \"stub-2-\" + stub2.getId() + \".json\")));\n  }\n\n  @Test\n  void removesOnlyTheStubsThatExist() {\n    StubMapping stub1 =\n        stubFor(\n            get(urlEqualTo(\"/stub-1\")).withName(\"stub 1\").willReturn(aResponse().withStatus(200)));\n    StubMapping stub2 =\n        stubFor(\n            get(urlEqualTo(\"/stub-2\")).withName(\"stub 2\").willReturn(aResponse().withStatus(201)));\n    StubMapping stub3 =\n        stubFor(\n            get(urlEqualTo(\"/stub-3\")).withName(\"stub 3\").willReturn(aResponse().withStatus(202)));\n\n    saveAllMappings();\n\n    assertThat(testClient.get(\"/stub-1\").statusCode(), is(200));\n    assertThat(testClient.get(\"/stub-2\").statusCode(), is(201));\n    assertThat(testClient.get(\"/stub-3\").statusCode(), is(202));\n    assertEquals(1, matchingStubCount(\"/stub-1\"));\n    assertEquals(1, matchingStubCount(\"/stub-2\"));\n    assertEquals(1, matchingStubCount(\"/stub-3\"));\n    File mappingsDir = rootDir.toPath().resolve(WireMockApp.MAPPINGS_ROOT).toFile();\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(mappingsDir.listFiles())).toList(),\n        containsInAnyOrder(\n            new File(mappingsDir, \"stub-1-\" + stub1.getId() + \".json\"),\n            new File(mappingsDir, \"stub-2-\" + stub2.getId() + \".json\"),\n            new File(mappingsDir, \"stub-3-\" + stub3.getId() + \".json\")));\n\n    removeStubs(\n        List.of(\n            get(urlEqualTo(\"/whatever\")).withId(UUID.randomUUID()).build(),\n            get(urlEqualTo(\"/whatever\")).withId(stub3.getId()).build()));\n\n    assertThat(testClient.get(\"/stub-1\").statusCode(), is(200));\n    assertThat(testClient.get(\"/stub-2\").statusCode(), is(201));\n    assertThat(testClient.get(\"/stub-3\").statusCode(), is(404));\n    assertEquals(1, matchingStubCount(\"/stub-1\"));\n    assertEquals(1, matchingStubCount(\"/stub-2\"));\n    assertEquals(0, matchingStubCount(\"/stub-3\"));\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(mappingsDir.listFiles())).toList(),\n        containsInAnyOrder(\n            new File(mappingsDir, \"stub-1-\" + stub1.getId() + \".json\"),\n            new File(mappingsDir, \"stub-2-\" + stub2.getId() + \".json\")));\n  }\n\n  private synchronized long matchingStubCount(String url) {\n    return listAllStubMappings().getMappings().stream()\n        .filter(stub -> stub.getRequest().getUrl().equals(url))\n        .count();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/RequestFilterAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2019-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.Strings.randomAlphabetic;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.extension.requestfilter.*;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.Collections;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class RequestFilterAcceptanceTest {\n\n  private WireMockServer wm;\n  private WireMockTestClient client;\n  private String url;\n\n  @Test\n  public void filterCanContinueWithModifiedRequest() {\n    initialise(new RequestHeaderModifyingFilter());\n\n    wm.stubFor(get(url).withHeader(\"X-Modify-Me\", equalTo(\"modified\")).willReturn(ok()));\n\n    WireMockResponse response = client.get(url, withHeader(\"X-Modify-Me\", \"original\"));\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void filterCanStopWithResponse() {\n    initialise(new StubAuthenticatingFilter());\n\n    wm.stubFor(get(url).willReturn(ok()));\n\n    WireMockResponse good = client.get(url, withHeader(\"Authorization\", \"Token 123\"));\n    assertThat(good.statusCode(), is(200));\n\n    WireMockResponse bad = client.get(url);\n    assertThat(bad.statusCode(), is(401));\n  }\n\n  @Test\n  public void filtersAreChained() {\n    initialise(\n        new RequestHeaderAppendingFilter(\"A\"),\n        new RequestHeaderAppendingFilter(\"B\"),\n        new RequestHeaderAppendingFilter(\"C\"));\n\n    wm.stubFor(get(url).withHeader(\"X-Modify-Me\", matching(\"_[ABC]{3}\")).willReturn(ok()));\n\n    WireMockResponse response = client.get(url, withHeader(\"X-Modify-Me\", \"_\"));\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void filterCanBeAppliedToAdmin() {\n    initialise(new AdminAuthenticatingFilter());\n\n    wm.stubFor(get(url).willReturn(ok()));\n\n    String adminUrl = \"/__admin/mappings\";\n    WireMockResponse good = client.get(adminUrl, withHeader(\"Authorization\", \"Token 123\"));\n    assertThat(good.statusCode(), is(200));\n\n    WireMockResponse bad = client.get(adminUrl);\n    assertThat(bad.statusCode(), is(401));\n\n    // Stubs are unaffected\n    WireMockResponse stub = client.get(url);\n    assertThat(stub.statusCode(), is(200));\n  }\n\n  @Test\n  public void filterCanBeAppliedToStubs() {\n    initialise(new StubAuthenticatingFilter());\n\n    wm.stubFor(get(url).willReturn(ok()));\n\n    String adminUrl = \"/__admin/mappings\";\n    WireMockResponse good = client.get(url, withHeader(\"Authorization\", \"Token 123\"));\n    assertThat(good.statusCode(), is(200));\n\n    WireMockResponse bad = client.get(url);\n    assertThat(bad.statusCode(), is(401));\n\n    // Admin routes are unaffected\n    WireMockResponse stub = client.get(adminUrl);\n    assertThat(stub.statusCode(), is(200));\n  }\n\n  @Test\n  public void filterCanBeAppliedToStubsAndAdmin() {\n    initialise(new BothAuthenticatingFilter());\n\n    wm.stubFor(get(url).willReturn(ok()));\n\n    String adminUrl = \"/__admin/mappings\";\n\n    WireMockResponse stub = client.get(url);\n    assertThat(stub.statusCode(), is(401));\n\n    WireMockResponse admin = client.get(adminUrl);\n    assertThat(admin.statusCode(), is(401));\n  }\n\n  @Test\n  public void wrappedRequestsAreUsedWhenProxying() {\n    WireMockServer proxyTarget = new WireMockServer(wireMockConfig().dynamicPort());\n    proxyTarget.start();\n    initialise(new PathModifyingStubFilter());\n\n    wm.stubFor(\n        get(anyUrl())\n            .willReturn(aResponse().proxiedFrom(\"http://localhost:\" + proxyTarget.port())));\n    proxyTarget.stubFor(get(\"/prefix/subpath/item\").willReturn(ok(\"From the proxy\")));\n\n    assertThat(client.get(\"/subpath/item\").content(), is(\"From the proxy\"));\n\n    proxyTarget.stop();\n  }\n\n  @BeforeEach\n  public void init() {\n    url = \"/\" + randomAlphabetic(5);\n  }\n\n  @AfterEach\n  public void stopServer() {\n    wm.stop();\n  }\n\n  private void initialise(RequestFilter... filters) {\n    wm = new WireMockServer(wireMockConfig().dynamicPort().extensions(filters));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  public static class RequestHeaderModifyingFilter extends StubRequestFilter {\n\n    @Override\n    public RequestFilterAction filter(Request request) {\n      Request newRequest =\n          RequestWrapper.create()\n              .transformHeader(\"X-Modify-Me\", values -> Collections.singletonList(\"modified\"))\n              .wrap(request);\n\n      return RequestFilterAction.continueWith(newRequest);\n    }\n\n    @Override\n    public String getName() {\n      return \"request-header-modifier\";\n    }\n  }\n\n  public static class StubAuthenticatingFilter extends StubRequestFilter {\n\n    @Override\n    public RequestFilterAction filter(Request request) {\n      HttpHeader authHeader = request.header(\"Authorization\");\n      if (!authHeader.isPresent() || !authHeader.firstValue().equals(\"Token 123\")) {\n        return RequestFilterAction.stopWith(ResponseDefinition.notAuthorised());\n      }\n\n      return RequestFilterAction.continueWith(request);\n    }\n\n    @Override\n    public String getName() {\n      return \"stub-authenticator\";\n    }\n  }\n\n  public static class RequestHeaderAppendingFilter extends StubRequestFilter {\n\n    private final String value;\n\n    public RequestHeaderAppendingFilter(String value) {\n      this.value = value;\n    }\n\n    @Override\n    public RequestFilterAction filter(Request request) {\n      Request newRequest =\n          RequestWrapper.create()\n              .transformHeader(\n                  \"X-Modify-Me\",\n                  existingValue -> Collections.singletonList(existingValue.get(0) + value))\n              .wrap(request);\n\n      return RequestFilterAction.continueWith(newRequest);\n    }\n\n    @Override\n    public String getName() {\n      return \"request-header-appender-\" + value;\n    }\n  }\n\n  public static class AdminAuthenticatingFilter extends AdminRequestFilter {\n\n    @Override\n    public RequestFilterAction filter(Request request) {\n      HttpHeader authHeader = request.header(\"Authorization\");\n      if (!authHeader.isPresent() || !authHeader.firstValue().equals(\"Token 123\")) {\n        return RequestFilterAction.stopWith(ResponseDefinition.notAuthorised());\n      }\n\n      return RequestFilterAction.continueWith(request);\n    }\n\n    @Override\n    public String getName() {\n      return \"admin-authenticator\";\n    }\n  }\n\n  public static class BothAuthenticatingFilter implements RequestFilter {\n\n    @Override\n    public RequestFilterAction filter(Request request) {\n      HttpHeader authHeader = request.header(\"Authorization\");\n      if (!authHeader.isPresent() || !authHeader.firstValue().equals(\"Token 123\")) {\n        return RequestFilterAction.stopWith(ResponseDefinition.notAuthorised());\n      }\n\n      return RequestFilterAction.continueWith(request);\n    }\n\n    @Override\n    public boolean applyToAdmin() {\n      return true;\n    }\n\n    @Override\n    public boolean applyToStubs() {\n      return true;\n    }\n\n    @Override\n    public String getName() {\n      return \"both-authenticator\";\n    }\n  }\n\n  public static class PathModifyingStubFilter extends StubRequestFilter {\n\n    @Override\n    public RequestFilterAction filter(Request request) {\n      Request wrappedRequest =\n          RequestWrapper.create()\n              .transformAbsoluteUrl(url -> url.replace(\"/subpath\", \"/prefix/subpath\"))\n              .wrap(request);\n\n      return RequestFilterAction.continueWith(wrappedRequest);\n    }\n\n    @Override\n    public String getName() {\n      return \"path-mod-filter\";\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/RequestFilterV2AcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2019-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.Strings.randomAlphabetic;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.*;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.net.URI;\nimport java.util.Collections;\nimport java.util.Map;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class RequestFilterV2AcceptanceTest {\n\n  private WireMockServer wm;\n  private WireMockTestClient client;\n  private String url;\n\n  @Test\n  public void filterCanContinueWithModifiedRequest() {\n    initialise(new RequestHeaderModifyingFilter());\n\n    wm.stubFor(get(url).withHeader(\"X-Modify-Me\", equalTo(\"modified\")).willReturn(ok()));\n\n    WireMockResponse response = client.get(url, withHeader(\"X-Modify-Me\", \"original\"));\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void filterCanStopWithResponse() {\n    initialise(new StubAuthenticatingFilter());\n\n    wm.stubFor(get(url).willReturn(ok()));\n\n    WireMockResponse good = client.get(url, withHeader(\"Authorization\", \"Token 123\"));\n    assertThat(good.statusCode(), is(200));\n\n    WireMockResponse bad = client.get(url);\n    assertThat(bad.statusCode(), is(401));\n  }\n\n  @Test\n  public void filtersAreChained() {\n    initialise(\n        new RequestHeaderAppendingFilter(\"A\"),\n        new RequestHeaderAppendingFilter(\"B\"),\n        new RequestHeaderAppendingFilter(\"C\"));\n\n    wm.stubFor(get(url).withHeader(\"X-Modify-Me\", matching(\"_[ABC]{3}\")).willReturn(ok()));\n\n    WireMockResponse response = client.get(url, withHeader(\"X-Modify-Me\", \"_\"));\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  public void v1FilterCanStillStopExecution() {\n    initialise(\n        new RequestFilterAcceptanceTest.StubAuthenticatingFilter(),\n        new RequestHeaderAppendingFilter(\"A\"));\n\n    wm.stubFor(get(url).withHeader(\"X-Modify-Me\", equalTo(\"_A\")).willReturn(ok()));\n\n    WireMockResponse good =\n        client.get(url, withHeader(\"Authorization\", \"Token 123\"), withHeader(\"X-Modify-Me\", \"_\"));\n    assertThat(good.statusCode(), is(200));\n\n    WireMockResponse bad = client.get(url, withHeader(\"X-Modify-Me\", \"_\"));\n    assertThat(bad.statusCode(), is(401));\n  }\n\n  @Test\n  public void filterCanBeAppliedToAdmin() {\n    initialise(new AdminAuthenticatingFilter());\n\n    wm.stubFor(get(url).willReturn(ok()));\n\n    String adminUrl = \"/__admin/mappings\";\n    WireMockResponse good = client.get(adminUrl, withHeader(\"Authorization\", \"Token 123\"));\n    assertThat(good.statusCode(), is(200));\n\n    WireMockResponse bad = client.get(adminUrl);\n    assertThat(bad.statusCode(), is(401));\n\n    // Stubs are unaffected\n    WireMockResponse stub = client.get(url);\n    assertThat(stub.statusCode(), is(200));\n  }\n\n  @Test\n  public void filterCanBeAppliedToStubs() {\n    initialise(new StubAuthenticatingFilter());\n\n    wm.stubFor(get(url).willReturn(ok()));\n\n    String adminUrl = \"/__admin/mappings\";\n    WireMockResponse good = client.get(url, withHeader(\"Authorization\", \"Token 123\"));\n    assertThat(good.statusCode(), is(200));\n\n    WireMockResponse bad = client.get(url);\n    assertThat(bad.statusCode(), is(401));\n\n    // Admin routes are unaffected\n    WireMockResponse stub = client.get(adminUrl);\n    assertThat(stub.statusCode(), is(200));\n  }\n\n  @Test\n  public void filterCanBeAppliedToStubsAndAdmin() {\n    initialise(new BothAuthenticatingFilter());\n\n    wm.stubFor(get(url).willReturn(ok()));\n\n    String adminUrl = \"/__admin/mappings\";\n\n    WireMockResponse stub = client.get(url);\n    assertThat(stub.statusCode(), is(401));\n\n    WireMockResponse admin = client.get(adminUrl);\n    assertThat(admin.statusCode(), is(401));\n  }\n\n  @Test\n  public void wrappedRequestsAreUsedWhenProxying() {\n    WireMockServer proxyTarget = new WireMockServer(wireMockConfig().dynamicPort());\n    proxyTarget.start();\n    initialise(new PathModifyingStubFilter());\n\n    wm.stubFor(\n        get(anyUrl())\n            .willReturn(aResponse().proxiedFrom(\"http://localhost:\" + proxyTarget.port())));\n    proxyTarget.stubFor(get(\"/prefix/subpath/item\").willReturn(ok(\"From the proxy\")));\n\n    assertThat(client.get(\"/subpath/item\").content(), is(\"From the proxy\"));\n\n    proxyTarget.stop();\n  }\n\n  @Test\n  void stubRequestFilterCanAddSubEvents() {\n    initialise(\n        new StubRequestFilterV2() {\n          @Override\n          public RequestFilterAction filter(Request request, ServeEvent serveEvent) {\n            String path = URI.create(request.getUrl()).getPath();\n            serveEvent.appendSubEvent(\"REQ_PATH\", Map.of(\"path\", path));\n            return RequestFilterAction.continueWith(request);\n          }\n\n          @Override\n          public String getName() {\n            return \"sub-event-adding-filter\";\n          }\n        });\n\n    wm.stubFor(any(anyUrl()).willReturn(ok()));\n\n    client.get(\"/find-this-path\");\n\n    SubEvent subEvent = wm.getAllServeEvents().get(0).getSubEvents().stream().findFirst().get();\n    assertThat(subEvent.getType(), is(\"REQ_PATH\"));\n    assertThat(subEvent.getDataAs(Map.class).get(\"path\"), is(\"/find-this-path\"));\n  }\n\n  @BeforeEach\n  public void init() {\n    url = \"/\" + randomAlphabetic(5);\n  }\n\n  @AfterEach\n  public void stopServer() {\n    wm.stop();\n  }\n\n  private void initialise(Extension... filters) {\n    wm = new WireMockServer(wireMockConfig().dynamicPort().extensions(filters));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  public static class RequestHeaderModifyingFilter implements StubRequestFilterV2 {\n\n    @Override\n    public RequestFilterAction filter(Request request, ServeEvent serveEvent) {\n      Request newRequest =\n          RequestWrapper.create()\n              .transformHeader(\"X-Modify-Me\", values -> Collections.singletonList(\"modified\"))\n              .wrap(request);\n\n      return RequestFilterAction.continueWith(newRequest);\n    }\n\n    @Override\n    public String getName() {\n      return \"request-header-modifier\";\n    }\n  }\n\n  public static class StubAuthenticatingFilter implements StubRequestFilterV2 {\n\n    @Override\n    public RequestFilterAction filter(Request request, ServeEvent serveEvent) {\n      HttpHeader authHeader = request.header(\"Authorization\");\n      if (!authHeader.isPresent() || !authHeader.firstValue().equals(\"Token 123\")) {\n        return RequestFilterAction.stopWith(ResponseDefinition.notAuthorised());\n      }\n\n      return RequestFilterAction.continueWith(request);\n    }\n\n    @Override\n    public String getName() {\n      return \"stub-authenticator\";\n    }\n  }\n\n  public static class RequestHeaderAppendingFilter implements StubRequestFilterV2 {\n\n    private final String value;\n\n    public RequestHeaderAppendingFilter(String value) {\n      this.value = value;\n    }\n\n    @Override\n    public RequestFilterAction filter(Request request, ServeEvent serveEvent) {\n      Request newRequest =\n          RequestWrapper.create()\n              .transformHeader(\n                  \"X-Modify-Me\",\n                  existingValue -> Collections.singletonList(existingValue.get(0) + value))\n              .wrap(request);\n\n      return RequestFilterAction.continueWith(newRequest);\n    }\n\n    @Override\n    public String getName() {\n      return \"request-header-appender-\" + value;\n    }\n  }\n\n  public static class AdminAuthenticatingFilter implements AdminRequestFilterV2 {\n\n    @Override\n    public RequestFilterAction filter(Request request, ServeEvent serveEvent) {\n      HttpHeader authHeader = request.header(\"Authorization\");\n      if (!authHeader.isPresent() || !authHeader.firstValue().equals(\"Token 123\")) {\n        return RequestFilterAction.stopWith(ResponseDefinition.notAuthorised());\n      }\n\n      return RequestFilterAction.continueWith(request);\n    }\n\n    @Override\n    public String getName() {\n      return \"admin-authenticator\";\n    }\n  }\n\n  public static class BothAuthenticatingFilter implements RequestFilterV2 {\n\n    @Override\n    public RequestFilterAction filter(Request request, ServeEvent serveEvent) {\n      HttpHeader authHeader = request.header(\"Authorization\");\n      if (!authHeader.isPresent() || !authHeader.firstValue().equals(\"Token 123\")) {\n        return RequestFilterAction.stopWith(ResponseDefinition.notAuthorised());\n      }\n\n      return RequestFilterAction.continueWith(request);\n    }\n\n    @Override\n    public boolean applyToAdmin() {\n      return true;\n    }\n\n    @Override\n    public boolean applyToStubs() {\n      return true;\n    }\n\n    @Override\n    public String getName() {\n      return \"both-authenticator\";\n    }\n  }\n\n  public static class PathModifyingStubFilter implements StubRequestFilterV2 {\n\n    @Override\n    public RequestFilterAction filter(Request request, ServeEvent serveEvent) {\n      Request wrappedRequest =\n          RequestWrapper.create()\n              .transformAbsoluteUrl(url -> url.replace(\"/subpath\", \"/prefix/subpath\"))\n              .wrap(request);\n\n      return RequestFilterAction.continueWith(wrappedRequest);\n    }\n\n    @Override\n    public String getName() {\n      return \"path-mod-filter\";\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ResponseDefinitionBuilderAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.common.Gzip;\nimport com.github.tomakehurst.wiremock.testsupport.TestHttpHeader;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ResponseDefinitionBuilderAcceptanceTest {\n\n  private WireMockServer wm;\n  private WireMockTestClient client;\n\n  @AfterEach\n  public void stopServer() {\n    wm.stop();\n  }\n\n  private void initialise() {\n    wm = new WireMockServer(options().dynamicPort().dynamicHttpsPort());\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  @Test\n  void wireMockServerWithStubForWithGzipDisabledTrue() {\n    initialise();\n\n    wm.stubFor(\n        get(urlEqualTo(\"/todo/items\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withBody(\n                        \"Here is some kind of response body\"\n                            + \"Here is some kind of response body\"\n                            + \"Here is some kind of response body\")));\n\n    WireMockResponse compressedResponse =\n        client.get(\"/todo/items\", new TestHttpHeader(\"Accept-Encoding\", \"gzip\"));\n\n    wm.stubFor(\n        get(urlEqualTo(\"/todo/items\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withGzipDisabled(true)\n                    .withBody(\n                        \"Here is some kind of response body\"\n                            + \"Here is some kind of response body\"\n                            + \"Here is some kind of response body\")));\n\n    WireMockResponse ordinaryResponse =\n        client.get(\"/todo/items\", new TestHttpHeader(\"Accept-Encoding\", \"gzip\"));\n\n    assertTrue(compressedResponse.content().length() < ordinaryResponse.content().length());\n    assertTrue(Gzip.isGzipped(compressedResponse.binaryContent()));\n    assertFalse(Gzip.isGzipped(ordinaryResponse.binaryContent()));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ResponseDefinitionTransformerAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2014-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.defaultTestFilesRoot;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformer;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ResponseDefinitionTransformerAcceptanceTest {\n\n  WireMockServer wm;\n  WireMockTestClient client;\n\n  @Test\n  public void transformerSpecifiedByClassTransformsHeadersStatusAndBody() {\n    startWithExtensions(\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerAcceptanceTest$ExampleTransformer\");\n    createStub(\"/to-transform\");\n\n    WireMockResponse response = client.get(\"/to-transform\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"MyHeader\"), is(\"Transformed\"));\n    assertThat(response.content(), is(\"Transformed body\"));\n  }\n\n  @Test\n  public void supportsMultipleTransformers() {\n    startWithExtensions(\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerAcceptanceTest$MultiTransformer1\",\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerAcceptanceTest$MultiTransformer2\");\n    createStub(\"/to-multi-transform\");\n\n    WireMockResponse response = client.get(\"/to-multi-transform\");\n    assertThat(response.statusCode(), is(201));\n    assertThat(response.content(), is(\"Expect this\"));\n  }\n\n  @Test\n  public void supportsSpecifiyingExtensionsByClass() {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .extensions(ExampleTransformer.class, MultiTransformer1.class));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n    createStub(\"/to-class-transform\");\n\n    WireMockResponse response = client.get(\"/to-class-transform\");\n    assertThat(response.statusCode(), is(201));\n    assertThat(response.content(), is(\"Transformed body\"));\n  }\n\n  @Test\n  public void supportsSpecifiyingExtensionsByInstance() {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .extensions(new ExampleTransformer(), new MultiTransformer2()));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n    createStub(\"/to-instance-transform\");\n\n    WireMockResponse response = client.get(\"/to-instance-transform\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"Expect this\"));\n  }\n\n  @Test\n  public void doesNotApplyNonGlobalExtensionsWhenNotExplicitlySpecfiedByStub() {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .extensions(new ExampleTransformer(), new NonGlobalTransformer()));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n    createStub(\"/non-global-transform\");\n\n    WireMockResponse response = client.get(\"/non-global-transform\");\n    assertThat(response.content(), is(\"Transformed body\"));\n  }\n\n  @Test\n  public void appliesNonGlobalExtensionsWhenSpecifiedByStub() {\n    wm = new WireMockServer(wireMockConfig().dynamicPort().extensions(new NonGlobalTransformer()));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n\n    wm.stubFor(\n        get(urlEqualTo(\"/local-transform\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withBody(\"Should not see this\")\n                    .withTransformers(\"local\")));\n\n    WireMockResponse response = client.get(\"/local-transform\");\n    assertThat(response.content(), is(\"Non-global transformed body\"));\n  }\n\n  @Test\n  @SuppressWarnings(\"unchecked\")\n  public void preventsMoreThanOneExtensionWithTheSameNameFromBeingAdded() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () ->\n            new WireMockServer(\n                wireMockConfig()\n                    .dynamicPort()\n                    .extensions(ExampleTransformer.class, AnotherExampleTransformer.class)));\n  }\n\n  @Test\n  public void supportsAccessingTheFilesFileSource() {\n    startWithExtensions(\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerAcceptanceTest$FileAccessTransformer\");\n    createStub(\"/files-access-transform\");\n\n    WireMockResponse response = client.get(\"/files-access-transform\");\n    assertThat(response.content(), is(\"Some example test from a file\"));\n  }\n\n  @Test\n  public void supportsParameters() {\n    startWithExtensions(\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerAcceptanceTest$ParameterisedTransformer\");\n\n    wm.stubFor(\n        get(urlEqualTo(\"/transform-with-params\"))\n            .willReturn(\n                aResponse().withStatus(200).withTransformerParameter(\"newBody\", \"Use this body\")));\n\n    assertThat(client.get(\"/transform-with-params\").content(), is(\"Use this body\"));\n  }\n\n  private void startWithExtensions(String... extensions) {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .withRootDirectory(defaultTestFilesRoot())\n                .extensions(extensions));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  @AfterEach\n  public void cleanup() {\n    if (wm != null) {\n      wm.stop();\n    }\n  }\n\n  private void createStub(String url) {\n    wm.stubFor(\n        get(urlEqualTo(url))\n            .willReturn(\n                aResponse()\n                    .withHeader(\"MyHeader\", \"Initial\")\n                    .withStatus(300)\n                    .withBody(\"Should not see this\")));\n  }\n\n  public static class ExampleTransformer extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return new ResponseDefinitionBuilder()\n          .withHeader(\"MyHeader\", \"Transformed\")\n          .withStatus(200)\n          .withBody(\"Transformed body\")\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"example\";\n    }\n  }\n\n  public static class MultiTransformer1 extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return ResponseDefinitionBuilder.like(responseDefinition).but().withStatus(201).build();\n    }\n\n    @Override\n    public String getName() {\n      return \"multi1\";\n    }\n  }\n\n  public static class MultiTransformer2 extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return ResponseDefinitionBuilder.like(responseDefinition)\n          .but()\n          .withBody(\"Expect this\")\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"multi2\";\n    }\n  }\n\n  public static class NonGlobalTransformer extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return ResponseDefinitionBuilder.like(responseDefinition)\n          .but()\n          .withBody(\"Non-global transformed body\")\n          .build();\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return false;\n    }\n\n    @Override\n    public String getName() {\n      return \"local\";\n    }\n  }\n\n  public static class AnotherExampleTransformer extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return responseDefinition;\n    }\n\n    @Override\n    public String getName() {\n      return \"example\";\n    }\n  }\n\n  public static class FileAccessTransformer extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return ResponseDefinitionBuilder.like(responseDefinition)\n          .but()\n          .withBody(files.getBinaryFileNamed(\"plain-example.txt\").readContents())\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"filesource\";\n    }\n  }\n\n  public static class ParameterisedTransformer extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return ResponseDefinitionBuilder.like(responseDefinition)\n          .but()\n          .withBody(parameters.getString(\"newBody\"))\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"params\";\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ResponseDefinitionTransformerV2AcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2014-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.defaultTestFilesRoot;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformerV2;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.List;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ResponseDefinitionTransformerV2AcceptanceTest {\n\n  WireMockServer wm;\n  WireMockTestClient client;\n\n  @Test\n  public void transformerSpecifiedByClassTransformsHeadersStatusAndBody() {\n    startWithExtensions(\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerV2AcceptanceTest$ExampleTransformer\");\n    createStub(\"/to-transform\");\n\n    WireMockResponse response = client.get(\"/to-transform\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"MyHeader\"), is(\"Transformed\"));\n    assertThat(response.content(), is(\"Transformed body\"));\n  }\n\n  @Test\n  public void supportsMultipleTransformers() {\n    startWithExtensions(\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerV2AcceptanceTest$MultiTransformer1\",\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerV2AcceptanceTest$MultiTransformer2\");\n    createStub(\"/to-multi-transform\");\n\n    WireMockResponse response = client.get(\"/to-multi-transform\");\n    assertThat(response.statusCode(), is(201));\n    assertThat(response.content(), is(\"Expect this\"));\n  }\n\n  @Test\n  public void supportsSpecifiyingExtensionsByClass() {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .extensions(ExampleTransformer.class, MultiTransformer1.class));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n    createStub(\"/to-class-transform\");\n\n    WireMockResponse response = client.get(\"/to-class-transform\");\n    assertThat(response.statusCode(), is(201));\n    assertThat(response.content(), is(\"Transformed body\"));\n  }\n\n  @Test\n  public void supportsSpecifiyingExtensionsByInstance() {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .extensions(new ExampleTransformer(), new MultiTransformer2()));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n    createStub(\"/to-instance-transform\");\n\n    WireMockResponse response = client.get(\"/to-instance-transform\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"Expect this\"));\n  }\n\n  @Test\n  public void doesNotApplyNonGlobalExtensionsWhenNotExplicitlySpecfiedByStub() {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .extensions(new ExampleTransformer(), new NonGlobalTransformer()));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n    createStub(\"/non-global-transform\");\n\n    WireMockResponse response = client.get(\"/non-global-transform\");\n    assertThat(response.content(), is(\"Transformed body\"));\n  }\n\n  @Test\n  public void appliesNonGlobalExtensionsWhenSpecifiedByStub() {\n    wm = new WireMockServer(wireMockConfig().dynamicPort().extensions(new NonGlobalTransformer()));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n\n    wm.stubFor(\n        get(urlEqualTo(\"/local-transform\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withBody(\"Should not see this\")\n                    .withTransformers(\"local\")));\n\n    WireMockResponse response = client.get(\"/local-transform\");\n    assertThat(response.content(), is(\"Non-global transformed body\"));\n  }\n\n  @Test\n  @SuppressWarnings(\"unchecked\")\n  public void preventsMoreThanOneExtensionWithTheSameNameFromBeingAdded() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () ->\n            new WireMockServer(\n                    wireMockConfig()\n                        .dynamicPort()\n                        .extensions(ExampleTransformer.class)\n                        .extensions(\n                            \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerV2AcceptanceTest$AnotherExampleTransformer\"))\n                .start());\n  }\n\n  @Test\n  public void supportsAccessingTheFilesFileSource() {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .withRootDirectory(defaultTestFilesRoot())\n                .extensions(services -> List.of(new FileAccessTransformer(services.getFiles()))));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n    createStub(\"/files-access-transform\");\n\n    WireMockResponse response = client.get(\"/files-access-transform\");\n    assertThat(response.content(), is(\"Some example test from a file\"));\n  }\n\n  @Test\n  public void supportsParameters() {\n    startWithExtensions(\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerV2AcceptanceTest$ParameterisedTransformer\");\n\n    wm.stubFor(\n        get(urlEqualTo(\"/transform-with-params\"))\n            .willReturn(\n                aResponse().withStatus(200).withTransformerParameter(\"newBody\", \"Use this body\")));\n\n    assertThat(client.get(\"/transform-with-params\").content(), is(\"Use this body\"));\n  }\n\n  @Test\n  void pathParametersCanBeUsed() {\n    startWithExtensions(\n        \"com.github.tomakehurst.wiremock.ResponseDefinitionTransformerV2AcceptanceTest$PathParamUsingResponseDefinitionTransformer\");\n\n    wm.stubFor(\n        get(urlPathTemplate(\"/things/{thingId}\"))\n            .willReturn(ok().withTransformers(\"path-param-to-header\")));\n\n    WireMockResponse response = client.get(\"/things/123\");\n\n    assertThat(response.firstHeader(\"x-thing-id\"), is(\"123\"));\n  }\n\n  private void startWithExtensions(String... extensions) {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .withRootDirectory(defaultTestFilesRoot())\n                .extensions(extensions));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  @AfterEach\n  public void cleanup() {\n    if (wm != null) {\n      wm.stop();\n    }\n  }\n\n  private void createStub(String url) {\n    wm.stubFor(\n        get(urlEqualTo(url))\n            .willReturn(\n                aResponse()\n                    .withHeader(\"MyHeader\", \"Initial\")\n                    .withStatus(300)\n                    .withBody(\"Should not see this\")));\n  }\n\n  public static class ExampleTransformer implements ResponseDefinitionTransformerV2 {\n\n    @Override\n    public ResponseDefinition transform(ServeEvent serveEvent) {\n      return new ResponseDefinitionBuilder()\n          .withHeader(\"MyHeader\", \"Transformed\")\n          .withStatus(200)\n          .withBody(\"Transformed body\")\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"example\";\n    }\n  }\n\n  public static class MultiTransformer1 implements ResponseDefinitionTransformerV2 {\n\n    @Override\n    public ResponseDefinition transform(ServeEvent serveEvent) {\n      return ResponseDefinitionBuilder.like(serveEvent.getResponseDefinition())\n          .but()\n          .withStatus(201)\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"multi1\";\n    }\n  }\n\n  public static class MultiTransformer2 implements ResponseDefinitionTransformerV2 {\n\n    @Override\n    public ResponseDefinition transform(ServeEvent serveEvent) {\n      return ResponseDefinitionBuilder.like(serveEvent.getResponseDefinition())\n          .but()\n          .withBody(\"Expect this\")\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"multi2\";\n    }\n  }\n\n  public static class NonGlobalTransformer implements ResponseDefinitionTransformerV2 {\n\n    @Override\n    public ResponseDefinition transform(ServeEvent serveEvent) {\n      return ResponseDefinitionBuilder.like(serveEvent.getResponseDefinition())\n          .but()\n          .withBody(\"Non-global transformed body\")\n          .build();\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return false;\n    }\n\n    @Override\n    public String getName() {\n      return \"local\";\n    }\n  }\n\n  public static class AnotherExampleTransformer implements ResponseDefinitionTransformerV2 {\n\n    @Override\n    public ResponseDefinition transform(ServeEvent serveEvent) {\n      return serveEvent.getResponseDefinition();\n    }\n\n    @Override\n    public String getName() {\n      return \"example\";\n    }\n  }\n\n  public static class FileAccessTransformer implements ResponseDefinitionTransformerV2 {\n\n    private final FileSource files;\n\n    public FileAccessTransformer(FileSource files) {\n      this.files = files;\n    }\n\n    @Override\n    public ResponseDefinition transform(ServeEvent serveEvent) {\n      return ResponseDefinitionBuilder.like(serveEvent.getResponseDefinition())\n          .but()\n          .withBody(files.getBinaryFileNamed(\"plain-example.txt\").readContents())\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"filesource\";\n    }\n  }\n\n  public static class ParameterisedTransformer implements ResponseDefinitionTransformerV2 {\n\n    @Override\n    public ResponseDefinition transform(ServeEvent serveEvent) {\n      return ResponseDefinitionBuilder.like(serveEvent.getResponseDefinition())\n          .but()\n          .withBody(\n              serveEvent\n                  .getStubMapping()\n                  .getResponse()\n                  .getTransformerParameters()\n                  .getString(\"newBody\"))\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"params\";\n    }\n  }\n\n  public static class PathParamUsingResponseDefinitionTransformer\n      implements ResponseDefinitionTransformerV2 {\n\n    @Override\n    public String getName() {\n      return \"path-param-to-header\";\n    }\n\n    @Override\n    public ResponseDefinition transform(ServeEvent serveEvent) {\n      return ResponseDefinitionBuilder.like(serveEvent.getResponseDefinition())\n          .but()\n          .withHeader(\"x-thing-id\", serveEvent.getRequest().getPathParameters().get(\"thingId\"))\n          .build();\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ResponseDelayAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static java.lang.Thread.sleep;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.greaterThanOrEqualTo;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.matching.UrlPattern;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.IOException;\nimport java.net.SocketTimeoutException;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.TimeUnit;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.HttpResponse;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class ResponseDelayAcceptanceTest {\n\n  private static final int SOCKET_TIMEOUT_MILLISECONDS = 1000;\n  private static final int LONGER_THAN_SOCKET_TIMEOUT = SOCKET_TIMEOUT_MILLISECONDS * 2;\n  private static final int SHORTER_THAN_SOCKET_TIMEOUT = SOCKET_TIMEOUT_MILLISECONDS / 2;\n  private static final int BRIEF_DELAY_TO_ALLOW_CALL_TO_BE_MADE_MILLISECONDS = 300;\n\n  @RegisterExtension\n  public WireMockExtension wireMockRule =\n      WireMockExtension.newInstance()\n          .configureStaticDsl(true)\n          .options(\n              WireMockConfiguration.options()\n                  .port(Options.DYNAMIC_PORT)\n                  .httpsPort(Options.DYNAMIC_PORT))\n          .build();\n\n  private CloseableHttpClient httpClient;\n  private WireMockTestClient testClient;\n\n  @BeforeEach\n  public void init() {\n    httpClient = ApacheHttpClientFactory.createClient(SOCKET_TIMEOUT_MILLISECONDS);\n    testClient = new WireMockTestClient(wireMockRule.getPort());\n  }\n\n  @Test\n  public void responseWithFixedDelay() {\n    stubFor(\n        get(urlEqualTo(\"/delayed/resource\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"Content\").withFixedDelay(500)));\n\n    long start = System.currentTimeMillis();\n    testClient.get(\"/delayed/resource\");\n    int duration = (int) (System.currentTimeMillis() - start);\n\n    assertThat(duration, greaterThanOrEqualTo(500));\n  }\n\n  @Test\n  public void responseWithByteDribble() {\n    byte[] body = new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};\n    int numberOfChunks = body.length / 2;\n    int chunkedDuration = 1000;\n\n    stubFor(\n        get(urlEqualTo(\"/dribble\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withBody(body)\n                    .withChunkedDribbleDelay(numberOfChunks, chunkedDuration)));\n\n    long start = System.currentTimeMillis();\n    WireMockResponse response = testClient.get(\"/dribble\");\n    long timeTaken = System.currentTimeMillis() - start;\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(timeTaken, greaterThanOrEqualTo((long) chunkedDuration));\n\n    assertThat(body, is(response.binaryContent()));\n  }\n\n  @Test\n  public void responseWithByteDribbleAndFixedDelay() {\n    byte[] body = new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};\n    int numberOfChunks = body.length / 2;\n    int fixedDelay = 1000;\n    int chunkedDuration = 1000;\n    int totalDuration = fixedDelay + chunkedDuration;\n\n    stubFor(\n        get(urlEqualTo(\"/dribbleWithFixedDelay\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withBody(body)\n                    .withChunkedDribbleDelay(numberOfChunks, chunkedDuration)\n                    .withFixedDelay(fixedDelay)));\n\n    long start = System.currentTimeMillis();\n    WireMockResponse response = testClient.get(\"/dribbleWithFixedDelay\");\n    long timeTaken = System.currentTimeMillis() - start;\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(timeTaken, greaterThanOrEqualTo((long) totalDuration));\n\n    assertThat(body, is(response.binaryContent()));\n  }\n\n  @Test\n  public void responseWithLogNormalDistributedDelay() {\n    stubFor(\n        get(urlEqualTo(\"/lognormal/delayed/resource\"))\n            .willReturn(\n                aResponse().withStatus(200).withBody(\"Content\").withLogNormalRandomDelay(90, 0.1)));\n\n    long start = System.currentTimeMillis();\n    testClient.get(\"/lognormal/delayed/resource\");\n    int duration = (int) (System.currentTimeMillis() - start);\n\n    assertThat(duration, greaterThanOrEqualTo(60));\n  }\n\n  @Test\n  public void responseWithTruncatedLogNormalDistributedDelay() {\n    stubFor(\n        get(urlEqualTo(\"/truncatedlognormal/delayed/resource\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withBody(\"Content\")\n                    .withLogNormalRandomDelay(90, 0.1, 95.0)));\n\n    long start = System.currentTimeMillis();\n    testClient.get(\"/truncatedlognormal/delayed/resource\");\n    int duration = (int) (System.currentTimeMillis() - start);\n\n    assertThat(duration, greaterThanOrEqualTo(60));\n  }\n\n  @Test\n  public void responseWithUniformDistributedDelay() {\n    stubFor(\n        get(urlEqualTo(\"/uniform/delayed/resource\"))\n            .willReturn(\n                aResponse().withStatus(200).withBody(\"Content\").withUniformRandomDelay(50, 60)));\n\n    long start = System.currentTimeMillis();\n    testClient.get(\"/uniform/delayed/resource\");\n    int duration = (int) (System.currentTimeMillis() - start);\n\n    assertThat(duration, greaterThanOrEqualTo(50));\n  }\n\n  @Test\n  public void requestTimesOutWhenDelayIsLongerThanSocketTimeout() throws Exception {\n    assertThrows(\n        SocketTimeoutException.class,\n        () -> {\n          stubFor(\n              get(urlEqualTo(\"/delayed\"))\n                  .willReturn(\n                      aResponse().withStatus(200).withFixedDelay(LONGER_THAN_SOCKET_TIMEOUT)));\n          httpClient.execute(new HttpGet(wireMockRule.url(\"/delayed\")));\n        });\n  }\n\n  @Test\n  public void requestIsSuccessfulWhenDelayIsShorterThanSocketTimeout() throws Exception {\n    stubFor(\n        get(urlEqualTo(\"/delayed\"))\n            .willReturn(aResponse().withStatus(200).withFixedDelay(SHORTER_THAN_SOCKET_TIMEOUT)));\n\n    final HttpResponse execute = httpClient.execute(new HttpGet(wireMockRule.url(\"/delayed\")));\n    assertThat(execute.getCode(), is(200));\n  }\n\n  @Test\n  public void requestIsRecordedInJournalBeforePerformingDelay() throws Exception {\n    stubFor(get(\"/delayed\").willReturn(ok().withFixedDelay(SHORTER_THAN_SOCKET_TIMEOUT)));\n\n    ExecutorService executorService = Executors.newSingleThreadExecutor();\n    final AtomicBoolean callSucceeded = callDelayedEndpointAsynchronously(executorService);\n\n    sleep(BRIEF_DELAY_TO_ALLOW_CALL_TO_BE_MADE_MILLISECONDS);\n    verify(getRequestedFor(urlEqualTo(\"/delayed\")));\n\n    executorService.awaitTermination(SHORTER_THAN_SOCKET_TIMEOUT, TimeUnit.MILLISECONDS);\n    verify(getRequestedFor(urlEqualTo(\"/delayed\")));\n    assertTrue(callSucceeded.get());\n  }\n\n  @Test\n  public void inFlightDelayedRequestsAreNotRecordedInJournalAfterReset() throws Exception {\n    stubFor(\n        get(urlEqualTo(\"/delayed\")).willReturn(ok().withFixedDelay(SHORTER_THAN_SOCKET_TIMEOUT)));\n\n    ExecutorService executorService = Executors.newSingleThreadExecutor();\n    final AtomicBoolean callSucceeded = callDelayedEndpointAsynchronously(executorService);\n\n    sleep(BRIEF_DELAY_TO_ALLOW_CALL_TO_BE_MADE_MILLISECONDS);\n    assertExpectedCallCount(1, urlEqualTo(\"/delayed\"));\n\n    reset();\n\n    executorService.awaitTermination(SHORTER_THAN_SOCKET_TIMEOUT, TimeUnit.MILLISECONDS);\n    assertExpectedCallCount(0, urlEqualTo(\"/delayed\"));\n    assertTrue(callSucceeded.get());\n  }\n\n  private AtomicBoolean callDelayedEndpointAsynchronously(ExecutorService executorService) {\n    final AtomicBoolean success = new AtomicBoolean(false);\n    HttpGet request = new HttpGet(wireMockRule.url(\"/delayed\"));\n    executorService.submit(\n        () -> {\n          try (final CloseableHttpResponse response = httpClient.execute(request)) {\n            assertThat(response.getCode(), is(200));\n            success.set(true);\n          } catch (IOException e) {\n            Exceptions.throwUnchecked(e, AtomicBoolean.class);\n          }\n        });\n    return success;\n  }\n\n  private void assertExpectedCallCount(int expectedCount, UrlPattern urlPattern) {\n    int count = wireMockRule.countRequestsMatching(getRequestedFor(urlPattern).build()).getCount();\n    assertThat(count, is(expectedCount));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ResponseDelayAsynchronousAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.greaterThan;\n\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.jetty.JettyHttpServerFactory;\nimport com.github.tomakehurst.wiremock.jetty.JettySettings;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.google.common.base.Stopwatch;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.Callable;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.Future;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class ResponseDelayAsynchronousAcceptanceTest {\n\n  private static final int SOCKET_TIMEOUT_MILLISECONDS = 500;\n  private static final int SHORTER_THAN_SOCKET_TIMEOUT = SOCKET_TIMEOUT_MILLISECONDS / 2;\n\n  private ExecutorService httpClientExecutor = Executors.newCachedThreadPool();\n\n  @RegisterExtension\n  public WireMockExtension wireMockRule =\n      WireMockExtension.newInstance().configureStaticDsl(true).options(getOptions()).build();\n\n  private static WireMockConfiguration getOptions() {\n    WireMockConfiguration wireMockConfiguration = new WireMockConfiguration();\n    wireMockConfiguration\n        .httpServerFactory(\n            new JettyHttpServerFactory(\n                JettySettings.Builder.aJettySettings().withAcceptors(1).build()))\n        .containerThreads(8);\n    wireMockConfiguration.asynchronousResponseEnabled(true);\n    wireMockConfiguration.asynchronousResponseThreads(10);\n    wireMockConfiguration.dynamicPort();\n    return wireMockConfiguration;\n  }\n\n  @Test\n  public void addsFixedDelayAsynchronously() throws Exception {\n    stubFor(get(\"/delayed\").willReturn(ok().withFixedDelay(SHORTER_THAN_SOCKET_TIMEOUT)));\n\n    List<Future<TimedHttpResponse>> responses =\n        httpClientExecutor.invokeAll(getHttpRequestCallables(5));\n\n    for (Future<TimedHttpResponse> response : responses) {\n      TimedHttpResponse timedResponse = response.get();\n      assertThat(timedResponse.status, is(200));\n      assertThat(timedResponse.milliseconds, greaterThan((long) SHORTER_THAN_SOCKET_TIMEOUT));\n    }\n  }\n\n  @Test\n  public void addsRandomDelayAsynchronously() throws Exception {\n    stubFor(get(\"/delayed\").willReturn(ok().withUniformRandomDelay(100, 300)));\n\n    List<Future<TimedHttpResponse>> responses =\n        httpClientExecutor.invokeAll(getHttpRequestCallables(5));\n\n    for (Future<TimedHttpResponse> response : responses) {\n      TimedHttpResponse timedResponse = response.get();\n      assertThat(timedResponse.status, is(200));\n      assertThat(timedResponse.milliseconds, greaterThan(100L));\n    }\n  }\n\n  @Test\n  public void addsChunkedDribbleDelayAsynchronously() throws Exception {\n    String body = \"chunked-body-to-return\";\n    stubFor(\n        get(\"/delayed\")\n            .willReturn(\n                ok().withBody(body).withChunkedDribbleDelay(5, SHORTER_THAN_SOCKET_TIMEOUT)));\n\n    List<Future<TimedHttpResponse>> responses =\n        httpClientExecutor.invokeAll(getHttpRequestCallables(5));\n\n    for (Future<TimedHttpResponse> response : responses) {\n      TimedHttpResponse timedResponse = response.get();\n      assertThat(timedResponse.status, is(200));\n      assertThat(timedResponse.body, is(body));\n      assertThat(timedResponse.milliseconds, greaterThan((long) SHORTER_THAN_SOCKET_TIMEOUT));\n    }\n  }\n\n  private List<Callable<TimedHttpResponse>> getHttpRequestCallables(int requestCount) {\n    List<Callable<TimedHttpResponse>> requests = new ArrayList<>();\n    for (int i = 0; i < requestCount; i++) {\n      final Stopwatch stopwatch = Stopwatch.createStarted();\n      requests.add(\n          () -> {\n            CloseableHttpResponse response =\n                ApacheHttpClientFactory.createClient(SOCKET_TIMEOUT_MILLISECONDS)\n                    .execute(new HttpGet(wireMockRule.url(\"/delayed\")));\n            int status = response.getCode();\n            String body = EntityUtils.toString(response.getEntity());\n            long milliseconds = stopwatch.elapsed(MILLISECONDS);\n            return new TimedHttpResponse(status, body, milliseconds);\n          });\n    }\n    return requests;\n  }\n\n  private static class TimedHttpResponse {\n\n    public final int status;\n    public final String body;\n    public final long milliseconds;\n\n    public TimedHttpResponse(int status, String body, long milliseconds) {\n      this.status = status;\n      this.body = body;\n      this.milliseconds = milliseconds;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ResponseDribbleAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\nimport static com.github.tomakehurst.wiremock.core.Options.DYNAMIC_PORT;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.testsupport.Assumptions.doNotRunOnMacOSXInCI;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.closeTo;\nimport static org.hamcrest.Matchers.greaterThanOrEqualTo;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.lessThan;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport java.io.IOException;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.core5.http.ClassicHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.hamcrest.Matcher;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class ResponseDribbleAcceptanceTest {\n\n  private static final int SOCKET_TIMEOUT_MILLISECONDS = 500;\n  private static final int DOUBLE_THE_SOCKET_TIMEOUT = SOCKET_TIMEOUT_MILLISECONDS * 2;\n\n  private static final byte[] BODY_BYTES = \"the long sentence being sent\".getBytes();\n\n  public static final double TOLERANCE = 0.333; // Quite big, but this helps reduce CI failures\n\n  @RegisterExtension\n  public WireMockExtension wireMockRule =\n      WireMockExtension.newInstance()\n          .configureStaticDsl(true)\n          .options(options().port(DYNAMIC_PORT).httpsPort(DYNAMIC_PORT))\n          .build();\n\n  private CloseableHttpClient httpClient;\n\n  @BeforeEach\n  public void init() throws IOException {\n    stubFor(get(\"/warmup\").willReturn(ok()));\n    httpClient = ApacheHttpClientFactory.createClient(SOCKET_TIMEOUT_MILLISECONDS);\n    // Warm up the server\n    httpClient.execute(new HttpGet(wireMockRule.url(\"/warmup\")));\n  }\n\n  @Test\n  public void requestIsSuccessfulButTakesLongerThanSocketTimeoutWhenDribbleIsEnabled()\n      throws Exception {\n    doNotRunOnMacOSXInCI();\n\n    stubFor(\n        get(\"/delayedDribble\")\n            .willReturn(\n                ok().withBody(BODY_BYTES)\n                    .withChunkedDribbleDelay(BODY_BYTES.length, DOUBLE_THE_SOCKET_TIMEOUT)));\n\n    long start = System.currentTimeMillis();\n    ClassicHttpResponse response =\n        httpClient.execute(new HttpGet(wireMockRule.url(\"/delayedDribble\")));\n    byte[] responseBody = response.getEntity().getContent().readAllBytes();\n    int duration = (int) (System.currentTimeMillis() - start);\n\n    assertThat(response.getCode(), is(200));\n    assertThat(responseBody, is(BODY_BYTES));\n    assertThat(duration, greaterThanOrEqualTo(SOCKET_TIMEOUT_MILLISECONDS));\n    assertThat((double) duration, isWithinTolerance(DOUBLE_THE_SOCKET_TIMEOUT, TOLERANCE));\n  }\n\n  @Test\n  public void servesAStringBodyInChunks() throws Exception {\n    doNotRunOnMacOSXInCI();\n\n    final int TOTAL_TIME = 500;\n\n    stubFor(\n        get(\"/delayedDribble\")\n            .willReturn(\n                ok().withBody(\"Send this in many pieces please!!!\")\n                    .withChunkedDribbleDelay(2, TOTAL_TIME)));\n\n    long start = System.currentTimeMillis();\n    ClassicHttpResponse response =\n        httpClient.execute(new HttpGet(wireMockRule.url(\"/delayedDribble\")));\n    String responseBody = EntityUtils.toString(response.getEntity());\n    double duration = (double) (System.currentTimeMillis() - start);\n\n    assertThat(response.getCode(), is(200));\n    assertThat(responseBody, is(\"Send this in many pieces please!!!\"));\n    assertThat(duration, isWithinTolerance(TOTAL_TIME, TOLERANCE));\n  }\n\n  @Test\n  public void requestIsSuccessfulAndBelowSocketTimeoutWhenDribbleIsDisabled() throws Exception {\n    doNotRunOnMacOSXInCI();\n\n    stubFor(get(\"/nonDelayedDribble\").willReturn(ok().withBody(BODY_BYTES)));\n\n    long start = System.currentTimeMillis();\n    ClassicHttpResponse response =\n        httpClient.execute(new HttpGet(wireMockRule.url(\"/nonDelayedDribble\")));\n    byte[] responseBody = response.getEntity().getContent().readAllBytes();\n    int duration = (int) (System.currentTimeMillis() - start);\n\n    assertThat(response.getCode(), is(200));\n    assertThat(BODY_BYTES, is(responseBody));\n    assertThat(duration, lessThan(SOCKET_TIMEOUT_MILLISECONDS));\n  }\n\n  private static Matcher<Double> isWithinTolerance(double value, double tolerance) {\n    double maxDelta = value * tolerance;\n    return closeTo(value, maxDelta);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ResponseTemplatingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.testsupport.ServeEventChecks.assertMessageSubEventPresent;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.defaultTestFilesRoot;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.notNullValue;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMatchers;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.net.InetAddress;\nimport java.util.UUID;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.junitpioneer.jupiter.ClearSystemProperty;\n\npublic class ResponseTemplatingAcceptanceTest {\n\n  @SuppressWarnings(\"JsonStandardCompliance\")\n  @Nested\n  class Local {\n\n    WireMockTestClient client;\n\n    @RegisterExtension\n    public static WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(options().dynamicPort().templatingEnabled(true).globalTemplating(false))\n            .build();\n\n    @BeforeEach\n    public void init() {\n      client = new WireMockTestClient(wm.getPort());\n    }\n\n    @Test\n    public void appliesResponseTemplateWhenAddedToStubMapping() {\n      wm.stubFor(\n          get(urlPathEqualTo(\"/templated\"))\n              .willReturn(\n                  aResponse()\n                      .withBody(\"{{request.path.[0]}}\")\n                      .withTransformers(\"response-template\")));\n\n      assertThat(client.get(\"/templated\").content(), is(\"templated\"));\n    }\n\n    @Test\n    public void doesNotIncludeQueryParametersInPathVariableValue() {\n      wm.stubFor(\n          get(urlPathTemplate(\"/{template_param}\"))\n              .willReturn(\n                  aResponse()\n                      .withBody(\"{ \\\"key\\\": \\\"{{{ request.path.template_param }}}\\\" }\")\n                      .withTransformers(\"response-template\")));\n\n      String content = client.get(\"/foo?bar=1\").content();\n\n      assertThat(content, is(\"{ \\\"key\\\": \\\"foo\\\" }\"));\n    }\n\n    @Test\n    public void doesNotApplyResponseTemplateWhenNotAddedToStubMapping() {\n      wm.stubFor(\n          get(urlPathEqualTo(\"/not-templated\"))\n              .willReturn(aResponse().withBody(\"{{request.path.[0]}}\")));\n\n      assertThat(client.get(\"/not-templated\").content(), is(\"{{request.path.[0]}}\"));\n    }\n  }\n\n  @Nested\n  class Global {\n\n    WireMockTestClient client;\n\n    @RegisterExtension\n    public static WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(\n                options()\n                    .dynamicPort()\n                    .withRootDirectory(defaultTestFilesRoot())\n                    .templatingEnabled(true)\n                    .globalTemplating(true))\n            .build();\n\n    @BeforeEach\n    public void init() {\n      client = new WireMockTestClient(wm.getPort());\n    }\n\n    @Test\n    public void appliesResponseTemplate() {\n      wm.stubFor(\n          get(urlPathEqualTo(\"/templated\"))\n              .willReturn(aResponse().withBody(\"{{request.path.[0]}}\")));\n\n      assertThat(client.get(\"/templated\").content(), is(\"templated\"));\n    }\n\n    @Test\n    public void appliesToResponseBodyFromFile() {\n      wm.stubFor(\n          get(urlPathEqualTo(\"/templated\"))\n              .willReturn(aResponse().withBodyFile(\"templated-example-1.txt\")));\n\n      assertThat(client.get(\"/templated\").content(), is(\"templated\"));\n    }\n\n    @Test\n    public void copesWithBase64BodiesWithoutTemplateElements() {\n      wm.stubFor(\n          get(urlMatching(\"/documents/document/.+\"))\n              .willReturn(\n                  ok().withBase64Body(\n                          \"JVBERi0xLjEKJcKlwrHDqwoKMSAwIG9iagogIDw8IC9UeXBlIC9DYXRhbG9nCiAgICAgL1BhZ2VzIDIgMCBSCiAgPj4KZW5kb2JqCgoyIDAgb2JqCiAgPDwgL1R5cGUgL1BhZ2VzCiAgICAgL0tpZHMgWzMgMCBSXQogICAgIC9Db3VudCAxCiAgICAgL01lZGlhQm94IFswIDAgMzAwIDE0NF0KICA+PgplbmRvYmoKCjMgMCBvYmoKICA8PCAgL1R5cGUgL1BhZ2UKICAgICAgL1BhcmVudCAyIDAgUgogICAgICAvUmVzb3VyY2VzCiAgICAgICA8PCAvRm9udAogICAgICAgICAgIDw8IC9GMQogICAgICAgICAgICAgICA8PCAvVHlwZSAvRm9udAogICAgICAgICAgICAgICAgICAvU3VidHlwZSAvVHlwZTEKICAgICAgICAgICAgICAgICAgL0Jhc2VGb250IC9UaW1lcy1Sb21hbgogICAgICAgICAgICAgICA+PgogICAgICAgICAgID4+CiAgICAgICA+PgogICAgICAvQ29udGVudHMgNCAwIFIKICA+PgplbmRvYmoKCjQgMCBvYmoKICA8PCAvTGVuZ3RoIDU1ID4+CnN0cmVhbQogIEJUCiAgICAvRjEgMTggVGYKICAgIDAgMCBUZAogICAgKEhlbGxvIFdvcmxkKSBUagogIEVUCmVuZHN0cmVhbQplbmRvYmoKCnhyZWYKMCA1CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAxOCAwMDAwMCBuIAowMDAwMDAwMDc3IDAwMDAwIG4gCjAwMDAwMDAxNzggMDAwMDAgbiAKMDAwMDAwMDQ1NyAwMDAwMCBuIAp0cmFpbGVyCiAgPDwgIC9Sb290IDEgMCBSCiAgICAgIC9TaXplIDUKICA+PgpzdGFydHhyZWYKNTY1CiUlRU9GCg==\")));\n\n      WireMockResponse response = client.get(\"/documents/document/123\");\n\n      assertThat(response.statusCode(), is(200));\n    }\n\n    @Test\n    public void supportsSelectionResponseBodyTemplateViaTemplate() {\n      wm.stubFor(\n          get(urlPathMatching(\"/templated/.*\"))\n              .willReturn(aResponse().withBodyFile(\"templated-example-{{request.path.1}}.txt\")));\n\n      assertThat(client.get(\"/templated/2\").content(), is(\"templated\"));\n      assertThat(client.get(\"/templated/3\").content(), is(\"3\"));\n    }\n\n    @Test\n    public void cacheIsClearedWhenStubEdited() {\n      String url = \"/templated/one/two\";\n      UUID id = UUID.randomUUID();\n\n      wm.stubFor(\n          get(urlPathEqualTo(url))\n              .withId(id)\n              .willReturn(\n                  aResponse()\n                      .withHeader(\"X-Value\", \"{{request.path.1}}\")\n                      .withBody(\"{{request.path.1}}\")));\n\n      WireMockResponse response = client.get(url);\n      assertThat(response.content(), is(\"one\"));\n      assertThat(response.firstHeader(\"X-Value\"), is(\"one\"));\n\n      wm.editStub(\n          get(urlPathEqualTo(url))\n              .withId(id)\n              .willReturn(\n                  aResponse()\n                      .withHeader(\"X-Value\", \"{{request.path.2}}\")\n                      .withBody(\"{{request.path.2}}\")));\n\n      response = client.get(url);\n      assertThat(response.content(), is(\"two\"));\n      assertThat(response.firstHeader(\"X-Value\"), is(\"two\"));\n    }\n\n    @Test\n    public void supportsDisablingTemplatingOfBodyFilesPerStub() {\n      wm.stubFor(\n          get(urlPathEqualTo(\"/templated\"))\n              .willReturn(aResponse().withBodyFile(\"templated-example-1.txt\")));\n\n      assertThat(client.get(\"/templated\").content(), is(\"templated\"));\n\n      wm.stubFor(\n          get(urlPathEqualTo(\"/templated\"))\n              .willReturn(\n                  aResponse()\n                      .withBodyFile(\"templated-example-1.txt\")\n                      .withTransformerParameter(\"disableBodyFileTemplating\", true)));\n\n      assertThat(client.get(\"/templated\").content(), is(\"{{request.path.[0]}}\"));\n\n      wm.stubFor(\n          get(urlPathMatching(\"/templated/.*\"))\n              .willReturn(\n                  aResponse()\n                      .withBodyFile(\"templated-example-{{request.path.1}}.txt\")\n                      .withTransformerParameter(\"disableBodyFileTemplating\", true)));\n\n      assertThat(client.get(\"/templated/1\").content(), is(\"{{request.path.[0]}}\"));\n    }\n\n    @Test\n    public void supportsJsonBodiesWithTemplating() {\n      String stubJson =\n          \"\"\"\n              {\n                \"request\": {\n                  \"method\": \"POST\",\n                  \"url\" : \"/json-body-templating\"\n                },\n                \"response\": {\n                  \"status\": 200,\n                  \"jsonBody\": {\n                    \"modified\": \"{{jsonPath request.body '$.arrayprop.length()'}}\"\n                  },\n                  \"headers\": {\n                    \"Content-Type\": \"application/json\"\n                  }\n                }\n              }\n              \"\"\";\n\n      client.postJson(\"/__admin/mappings\", stubJson);\n\n      WireMockResponse response =\n          client.postJson(\"/json-body-templating\", \"{ \\\"arrayprop\\\": [1,2,3] }\");\n      assertThat(response.content(), response.statusCode(), is(200));\n\n      assertThat(response.content(), WireMatchers.equalToJson(\"{ \\\"modified\\\": \\\"3\\\" }\"));\n    }\n\n    @Test\n    public void jsonBodyTemplatesCanSpecifyRequestAttributes() {\n      String stubJson =\n          \"\"\"\n              {\n                \"request\": {\n                  \"method\": \"GET\",\n                  \"urlPath\": \"/jsonBody/template\"\n                },\n                \"response\": {\n                  \"jsonBody\": {\n                    \"Key\": \"Hello world {{request.query.qp}}!\"\n                  },\n                  \"status\": 200,\n                  \"transformers\": [\n                    \"response-template\"\n                  ]\n                }\n              }\n              \"\"\";\n      client.postJson(\"/__admin/mappings\", stubJson);\n\n      WireMockResponse response = client.get(\"/jsonBody/template?qp=2\");\n\n      assertThat(response.content(), is(\"{\\\"Key\\\":\\\"Hello world 2!\\\"}\"));\n    }\n\n    @Test\n    public void canLookupSquareBracketedQueryParameters() {\n      wm.stubFor(\n          get(urlPathEqualTo(\"/squares\"))\n              .willReturn(ok(\"ID: {{lookup request.query 'filter[id]'}}\")));\n\n      assertThat(client.get(\"/squares?filter[id]=321\").content(), is(\"ID: 321\"));\n      assertThat(client.get(\"/squares?filter%5Bid%5D=321\").content(), is(\"ID: 321\"));\n    }\n\n    @Test\n    void canReadPathParametersFromModelWhenStubUsesPathTemplate() {\n      wm.stubFor(\n          get(urlPathTemplate(\"/v1/contacts/{contactId}/addresses/{addressId}\"))\n              .willReturn(\n                  ok(\n                      \"contactId: {{request.path.contactId}}, addressId: {{request.path.addressId}}\")));\n\n      String content = client.get(\"/v1/contacts/12345/addresses/67890\").content();\n\n      assertThat(content, is(\"contactId: 12345, addressId: 67890\"));\n    }\n\n    @Test\n    void canReadPathSegmentsByIndexWhenStubUsesPathTemplate() {\n      wm.stubFor(\n          get(urlPathTemplate(\"/v1/contacts/{contactId}/addresses/{addressId}\"))\n              .willReturn(ok(\"1: {{request.path.1}}, 2: {{request.path.2}}\")));\n\n      String content = client.get(\"/v1/contacts/12345/addresses/67890\").content();\n\n      assertThat(content, is(\"1: contacts, 2: 12345\"));\n    }\n\n    @Test\n    void canReadNumericPathVariableValuesWhenUsingPathTemplate() {\n      wm.stubFor(\n          get(urlPathTemplate(\"/v1/first/{0}/second/{1}\"))\n              .willReturn(ok(\"1: {{request.path.0}}, 2: {{request.path.1}}\")));\n\n      String content = client.get(\"/v1/first/first1/second/second2\").content();\n\n      assertThat(content, is(\"1: first1, 2: second2\"));\n    }\n\n    @Test\n    void canLoopOverPathSegmentsWhenUsingPathTemplate() {\n      wm.stubFor(\n          get(urlPathTemplate(\"/v1/first/{0}/second/{1}\"))\n              .willReturn(ok(\"{{#each request.path as |segment|}}{{segment}} {{/each}}\")));\n\n      String content = client.get(\"/v1/first/first1/second/second2\").content();\n\n      assertThat(content, is(\" v1 first first1 second second2 \"));\n    }\n\n    @Test\n    void bodyAsBase64IsAvailableOnTheRequestModel() {\n      wm.stubFor(post(\"/v1/base64\").willReturn(ok(\"{{request.bodyAsBase64}}\")));\n\n      String content = client.postJson(\"/v1/base64\", \"{\\\"foo\\\":\\\"bar\\\"}\").content();\n\n      assertThat(content, is(\"eyJmb28iOiJiYXIifQ==\"));\n    }\n\n    @Test\n    void exceptionThrownWhileRenderingIsReportedViaSubEvent() {\n      wm.stubFor(get(\"/bad\").willReturn(ok(\"{{math '1' '/' 0}}\")));\n\n      WireMockResponse response = client.get(\"/bad\");\n\n      assertThat(response.statusCode(), is(500));\n      assertThat(response.content(), is(\"[ERROR] 1:2: java.lang.ArithmeticException: / by zero\"));\n\n      assertMessageSubEventPresent(\n          wm, \"ERROR\", \"[ERROR] 1:2: java.lang.ArithmeticException: / by zero\");\n    }\n\n    @Test\n    void uncheckedExceptionThrownWhileRenderingIsSurfacedAndReportedViaSubEvent() {\n      wm.stubFor(\n          get(\"/bad\")\n              .willReturn(\n                  ok(\"{{add (jsonPath request.body '$.num1') (jsonPath request.body '$.num2')}}\")));\n\n      WireMockResponse response = client.get(\"/bad\");\n\n      assertThat(response.statusCode(), is(500));\n      assertThat(\n          response.content(),\n          is(\n              \"\"\"\n              [ERROR] 1:2: could not find helper: 'add'\n              {{add (jsonPath request.body '$.num1') (jsonPath request.body '$.num2')}}\n                ^\n              \"\"\"));\n\n      assertMessageSubEventPresent(\n          wm,\n          \"ERROR\",\n          \"\"\"\n              [ERROR] 1:2: could not find helper: 'add'\n              {{add (jsonPath request.body '$.num1') (jsonPath request.body '$.num2')}}\n                ^\n              \"\"\");\n    }\n  }\n\n  @Nested\n  class RestrictedSystemPropertiesAndEnvVars {\n\n    WireMockTestClient client;\n\n    @RegisterExtension\n    public static WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(\n                options()\n                    .dynamicPort()\n                    .withRootDirectory(defaultTestFilesRoot())\n                    .withPermittedSystemKeys(\"allowed.*\")\n                    .globalTemplating(true))\n            .build();\n\n    @BeforeEach\n    public void init() {\n      client = new WireMockTestClient(wm.getPort());\n    }\n\n    @Test\n    public void appliesResponseTemplateWithHostname() throws Exception {\n      wm.stubFor(\n          get(urlPathEqualTo(\"/templated\")).willReturn(aResponse().withBody(\"{{hostname}}\")));\n\n      String expectedHostname = InetAddress.getLocalHost().getHostName();\n\n      assertThat(client.get(\"/templated\").content(), is(expectedHostname));\n    }\n\n    @Test\n    @ClearSystemProperty(key = \"allowed.thing\")\n    public void rendersPermittedSystemProperty() {\n      System.setProperty(\"allowed.thing\", \"123\");\n\n      wm.stubFor(\n          get(urlPathEqualTo(\"/templated\"))\n              .willReturn(\n                  aResponse().withBody(\"{{systemValue type='PROPERTY' key='allowed.thing'}}\")));\n\n      assertThat(client.get(\"/templated\").content(), is(\"123\"));\n    }\n\n    @Test\n    @ClearSystemProperty(key = \"forbidden.thing\")\n    public void refusesToRenderForbiddenSystemProperty() {\n      System.setProperty(\"forbidden.thing\", \"456\");\n\n      wm.stubFor(\n          get(urlPathEqualTo(\"/templated\"))\n              .willReturn(\n                  aResponse().withBody(\"{{systemValue type='PROPERTY' key='forbidden.thing'}}\")));\n\n      assertThat(\n          client.get(\"/templated\").content(), is(\"[ERROR: Access to forbidden.thing is denied]\"));\n    }\n\n    @Test\n    public void appliesResponseTemplateShouldNotEmptyWithExistingSystemValue() {\n      wm.stubFor(\n          get(urlPathEqualTo(\"/templated\"))\n              .willReturn(aResponse().withBody(\"{{systemValue type='ENVIRONMENT' key='PATH'}}\")));\n\n      assertThat(client.get(\"/templated\").content(), notNullValue());\n    }\n  }\n\n  @Nested\n  class NoEscaping {\n\n    WireMockTestClient client;\n\n    @RegisterExtension\n    public static WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(\n                options()\n                    .dynamicPort()\n                    .withRootDirectory(defaultTestFilesRoot())\n                    .templatingEnabled(true)\n                    .globalTemplating(true))\n            .build();\n\n    @BeforeEach\n    public void init() {\n      client = new WireMockTestClient(wm.getPort());\n    }\n\n    @Test\n    void escapingIsDisabledByDefault() {\n      wm.stubFor(\n          post(\"/noescape\").willReturn(ok(\"{\\\"test\\\": \\\"{{jsonPath request.body '$.a.test'}}\\\"}\")));\n\n      WireMockResponse response =\n          client.postJson(\"/noescape\", \"{\\\"a\\\": {\\\"test\\\": \\\"look at my 'single quotes'\\\"}}\");\n\n      assertThat(response.content(), is(\"{\\\"test\\\": \\\"look at my 'single quotes'\\\"}\"));\n    }\n  }\n\n  @Nested\n  class Escaping {\n\n    WireMockTestClient client;\n\n    @RegisterExtension\n    public static WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(\n                options()\n                    .dynamicPort()\n                    .withRootDirectory(defaultTestFilesRoot())\n                    .templatingEnabled(true)\n                    .globalTemplating(true)\n                    .withTemplateEscapingDisabled(false))\n            .build();\n\n    @BeforeEach\n    public void init() {\n      client = new WireMockTestClient(wm.getPort());\n    }\n\n    @Test\n    void escapingIsEnabled() {\n      wm.stubFor(\n          post(\"/noescape\").willReturn(ok(\"{\\\"test\\\": \\\"{{jsonPath request.body '$.a.test'}}\\\"}\")));\n\n      WireMockResponse response =\n          client.postJson(\"/noescape\", \"{\\\"a\\\": {\\\"test\\\": \\\"look at my 'single quotes'\\\"}}\");\n\n      assertThat(response.content(), is(\"{\\\"test\\\": \\\"look at my &#x27;single quotes&#x27;\\\"}\"));\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ResponseTransformerAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2014-2022 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.endsWith;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.ResponseTransformer;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.Test;\n\npublic class ResponseTransformerAcceptanceTest {\n\n  WireMockServer wm;\n  WireMockTestClient client;\n\n  @Test\n  public void transformsStubResponse() {\n    startWithExtensions(StubResponseTransformer.class);\n\n    wm.stubFor(\n        get(urlEqualTo(\"/response-transform\")).willReturn(aResponse().withBody(\"Original body\")));\n\n    assertThat(client.get(\"/response-transform\").content(), is(\"Modified body\"));\n  }\n\n  @Test\n  public void acceptsTransformerParameters() {\n    startWithExtensions(StubResponseTransformerWithParams.class);\n\n    wm.stubFor(\n        get(urlEqualTo(\"/response-transform-with-params\"))\n            .willReturn(\n                aResponse()\n                    .withTransformerParameter(\"name\", \"John\")\n                    .withTransformerParameter(\"number\", 66)\n                    .withTransformerParameter(\"flag\", true)\n                    .withBody(\"Original body\")));\n\n    assertThat(client.get(\"/response-transform-with-params\").content(), is(\"John, 66, true\"));\n  }\n\n  @Test\n  public void globalTransformAppliedWithLocalParameters() {\n    startWithExtensions(GlobalResponseTransformer.class);\n\n    wm.stubFor(get(urlEqualTo(\"/global-response-transform\")).willReturn(aResponse()));\n\n    assertThat(client.get(\"/global-response-transform\").firstHeader(\"X-Extra\"), is(\"extra val\"));\n  }\n\n  @Test\n  public void filesRootIsCorrectlyPassedToTransformer() {\n    startWithExtensions(FilesUsingResponseTransformer.class);\n\n    wm.stubFor(get(urlEqualTo(\"/response-transform-with-files\")).willReturn(ok()));\n\n    assertThat(\n        client.get(\"/response-transform-with-files\").content(), endsWith(\"plain-example.txt\"));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private void startWithExtensions(Class<? extends Extension> extensionClasses) {\n    wm = new WireMockServer(wireMockConfig().dynamicPort().extensions(extensionClasses));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  public static class StubResponseTransformer extends ResponseTransformer {\n\n    @Override\n    public Response transform(\n        Request request, Response response, FileSource files, Parameters parameters) {\n      return Response.Builder.like(response).but().body(\"Modified body\").build();\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return true;\n    }\n\n    @Override\n    public String getName() {\n      return \"stub-transformer\";\n    }\n  }\n\n  public static class StubResponseTransformerWithParams extends ResponseTransformer {\n\n    @Override\n    public Response transform(\n        Request request, Response response, FileSource files, Parameters parameters) {\n      return Response.Builder.like(response)\n          .but()\n          .body(\n              parameters.getString(\"name\")\n                  + \", \"\n                  + parameters.getInt(\"number\")\n                  + \", \"\n                  + parameters.getBoolean(\"flag\"))\n          .build();\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return true;\n    }\n\n    @Override\n    public String getName() {\n      return \"stub-transformer-with-params\";\n    }\n  }\n\n  public static class GlobalResponseTransformer extends ResponseTransformer {\n\n    @Override\n    public Response transform(\n        Request request, Response response, FileSource files, Parameters parameters) {\n      return Response.Builder.like(response)\n          .but()\n          .headers(response.getHeaders().plus(httpHeader(\"X-Extra\", \"extra val\")))\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"global-response-transformer\";\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return true;\n    }\n  }\n\n  public static class FilesUsingResponseTransformer extends ResponseTransformer {\n\n    @Override\n    public Response transform(\n        Request request, Response response, FileSource files, Parameters parameters) {\n      return Response.Builder.like(response)\n          .but()\n          .body(files.getTextFileNamed(\"plain-example.txt\").getPath())\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"files-using-response-transformer\";\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return true;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ResponseTransformerV2AcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2014-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.endsWith;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.extension.ExtensionFactory;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.ResponseTransformerV2;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class ResponseTransformerV2AcceptanceTest {\n\n  WireMockServer wm;\n  WireMockTestClient client;\n\n  @Test\n  public void transformsStubResponse() {\n    startWithExtensions(StubResponseTransformer.class);\n\n    wm.stubFor(\n        get(urlEqualTo(\"/response-transform\")).willReturn(aResponse().withBody(\"Original body\")));\n\n    assertThat(client.get(\"/response-transform\").content(), is(\"Modified body\"));\n  }\n\n  @Test\n  public void acceptsTransformerParameters() {\n    startWithExtensions(StubResponseTransformerWithParams.class);\n\n    wm.stubFor(\n        get(urlEqualTo(\"/response-transform-with-params\"))\n            .willReturn(\n                aResponse()\n                    .withTransformerParameter(\"name\", \"John\")\n                    .withTransformerParameter(\"number\", 66)\n                    .withTransformerParameter(\"flag\", true)\n                    .withBody(\"Original body\")));\n\n    assertThat(client.get(\"/response-transform-with-params\").content(), is(\"John, 66, true\"));\n  }\n\n  @Test\n  public void globalTransformAppliedWithLocalParameters() {\n    startWithExtensions(GlobalResponseTransformer.class);\n\n    wm.stubFor(get(urlEqualTo(\"/global-response-transform\")).willReturn(aResponse()));\n\n    assertThat(client.get(\"/global-response-transform\").firstHeader(\"X-Extra\"), is(\"extra val\"));\n  }\n\n  @Test\n  public void filesRootIsCorrectlyPassedToTransformer() {\n    startWithExtensions(\n        services -> List.of(new FilesUsingResponseTransformer(services.getFiles())));\n\n    wm.stubFor(get(urlEqualTo(\"/response-transform-with-files\")).willReturn(ok()));\n\n    assertThat(\n        client.get(\"/response-transform-with-files\").content(), endsWith(\"plain-example.txt\"));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private void startWithExtensions(Class<? extends Extension> extensionClasses) {\n    wm = new WireMockServer(wireMockConfig().dynamicPort().extensions(extensionClasses));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  private void startWithExtensions(ExtensionFactory... extensionFactories) {\n    wm = new WireMockServer(wireMockConfig().dynamicPort().extensions(extensionFactories));\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  public static class StubResponseTransformer implements ResponseTransformerV2 {\n\n    @Override\n    public Response transform(Response response, ServeEvent serveEvent) {\n      return Response.Builder.like(response).but().body(\"Modified body\").build();\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return true;\n    }\n\n    @Override\n    public String getName() {\n      return \"stub-transformer\";\n    }\n  }\n\n  public static class StubResponseTransformerWithParams implements ResponseTransformerV2 {\n\n    @Override\n    public Response transform(Response response, ServeEvent serveEvent) {\n      Parameters parameters = serveEvent.getTransformerParameters();\n      return Response.Builder.like(response)\n          .but()\n          .body(\n              parameters.getString(\"name\")\n                  + \", \"\n                  + parameters.getInt(\"number\")\n                  + \", \"\n                  + parameters.getBoolean(\"flag\"))\n          .build();\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return true;\n    }\n\n    @Override\n    public String getName() {\n      return \"stub-transformer-with-params\";\n    }\n  }\n\n  public static class GlobalResponseTransformer implements ResponseTransformerV2 {\n\n    @Override\n    public Response transform(Response response, ServeEvent serveEvent) {\n      return Response.Builder.like(response)\n          .but()\n          .headers(response.getHeaders().plus(httpHeader(\"X-Extra\", \"extra val\")))\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"global-response-transformer\";\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return true;\n    }\n  }\n\n  public static class FilesUsingResponseTransformer implements ResponseTransformerV2 {\n\n    private final FileSource fileSource;\n\n    public FilesUsingResponseTransformer(FileSource fileSource) {\n      this.fileSource = fileSource;\n    }\n\n    @Override\n    public Response transform(Response response, ServeEvent serveEvent) {\n      return Response.Builder.like(response)\n          .but()\n          .body(fileSource.getTextFileNamed(\"plain-example.txt\").getPath())\n          .build();\n    }\n\n    @Override\n    public String getName() {\n      return \"files-using-response-transformer\";\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return true;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/SavingMappingsAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMatchers;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.Arrays;\nimport java.util.Comparator;\nimport java.util.Objects;\nimport java.util.stream.Stream;\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.TypeSafeDiagnosingMatcher;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class SavingMappingsAcceptanceTest extends AcceptanceTestBase {\n  private static final File FILE_SOURCE_ROOT = new File(\"build/save-mappings-files\");\n  private static final File FILES_DIRECTORY = new File(FILE_SOURCE_ROOT, \"__files\");\n  private static final File MAPPINGS_DIRECTORY = new File(FILE_SOURCE_ROOT, \"mappings\");\n\n  private static void resetFileSourceRoot() {\n    try {\n      if (FILE_SOURCE_ROOT.exists()) {\n        try (Stream<Path> pathStream = Files.walk(FILE_SOURCE_ROOT.toPath().toAbsolutePath())) {\n          pathStream.sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);\n        }\n      }\n      if (!FILES_DIRECTORY.mkdirs()) {\n        throw new Exception(\"Could no create \" + FILES_DIRECTORY.getAbsolutePath());\n      }\n      if (!MAPPINGS_DIRECTORY.mkdirs()) {\n        throw new Exception(\"Could no create \" + MAPPINGS_DIRECTORY.getAbsolutePath());\n      }\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  @BeforeAll\n  public static void setupServer() {\n    resetFileSourceRoot();\n    setupServer(wireMockConfig().fileSource(new SingleRootFileSource(FILE_SOURCE_ROOT)));\n  }\n\n  @BeforeEach\n  public void setUp() {\n    resetFileSourceRoot();\n    reset();\n  }\n\n  @Test\n  void savesMappingsToMappingsDirectory() {\n    // Check the mapping we're about to add isn't already there\n    WireMockResponse response = testClient.get(\"/some/url\");\n    assertThat(response.statusCode(), is(404));\n\n    // Add a mapping and save it\n    stubFor(get(urlEqualTo(\"/some/url\")).willReturn(aResponse().withBody(\"Response to /some/url\")));\n    saveAllMappings();\n\n    // Reset, clearing in-memory mappings\n    resetToDefault();\n\n    // Check the mapping now exists\n    response = testClient.get(\"/some/url\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"Response to /some/url\"));\n\n    assertThat(listAllStubMappings().getMappings(), everyItem(WireMatchers.IS_PERSISTENT));\n  }\n\n  @Test\n  void savedMappingIsDeletedFromTheDiskOnRemove() {\n    StubMapping stubMapping = stubFor(get(\"/delete/me\").willReturn(ok()));\n    saveAllMappings();\n\n    assertThat(MAPPINGS_DIRECTORY, containsFileWithNameContaining(stubMapping.getId().toString()));\n\n    removeStub(stubMapping);\n\n    assertThat(\n        MAPPINGS_DIRECTORY, not(containsFileWithNameContaining(stubMapping.getId().toString())));\n  }\n\n  private static Matcher<File> containsFileWithNameContaining(final String namePart) {\n    return new TypeSafeDiagnosingMatcher<>() {\n      @Override\n      protected boolean matchesSafely(File directory, Description mismatchDescription) {\n        boolean found =\n            Arrays.stream(Objects.requireNonNull(directory.list()))\n                .anyMatch(filename -> filename.contains(namePart));\n\n        if (!found) {\n          mismatchDescription.appendText(\"file with name containing \" + namePart + \" not found\");\n        }\n\n        return found;\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"a file whose name contains \" + namePart);\n      }\n    };\n  }\n\n  @Test\n  void doesNotDuplicateMappingsAlreadyPersistedToFileSystem() {\n    // Check the mapping we're about to add isn't already there\n    WireMockResponse response = testClient.get(\"/some/url\");\n    assertThat(response.statusCode(), is(404));\n\n    // Add a mapping and save it\n    stubFor(get(urlEqualTo(\"/some/url\")).willReturn(aResponse().withBody(\"Response to /some/url\")));\n    saveAllMappings();\n\n    // Save a second time\n    saveAllMappings();\n\n    // Check only one file has been written\n    assertThat(Objects.requireNonNull(MAPPINGS_DIRECTORY.listFiles()).length, is(1));\n  }\n\n  @Test\n  void doesNotDuplicateMappingsAlreadyPersistedAfterReset() {\n    // Check the mapping we're about to add isn't already there\n    WireMockResponse response = testClient.get(\"/some/url\");\n    assertThat(response.statusCode(), is(404));\n\n    // Add a mapping and save it\n    stubFor(get(urlEqualTo(\"/some/url\")).willReturn(aResponse().withBody(\"Response to /some/url\")));\n    saveAllMappings();\n\n    // Reset to default to reload the just saved mappings, then save a second time\n    resetToDefault();\n    saveAllMappings();\n\n    // Check only one file has been written\n    assertThat(Objects.requireNonNull(MAPPINGS_DIRECTORY.listFiles()).length, is(1));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ScenarioAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2012-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;\nimport static com.github.tomakehurst.wiremock.stubbing.Scenario.withName;\nimport static java.net.HttpURLConnection.HTTP_OK;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.ClientError;\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport java.util.List;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\n\npublic class ScenarioAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void createMappingsInScenarioAndChangeResponseWithStateChange() {\n    givenThat(\n        get(urlEqualTo(\"/some/resource\"))\n            .willReturn(aResponse().withBody(\"Initial\"))\n            .inScenario(\"SomeResourceUpdate\")\n            .whenScenarioStateIs(STARTED));\n\n    givenThat(\n        put(urlEqualTo(\"/some/resource\"))\n            .willReturn(aResponse().withStatus(HTTP_OK))\n            .inScenario(\"SomeResourceUpdate\")\n            .willSetStateTo(\"BodyModified\")\n            .whenScenarioStateIs(STARTED));\n\n    givenThat(\n        get(urlEqualTo(\"/some/resource\"))\n            .willReturn(aResponse().withBody(\"Modified\"))\n            .inScenario(\"SomeResourceUpdate\")\n            .whenScenarioStateIs(\"BodyModified\"));\n\n    assertThat(testClient.get(\"/some/resource\").content(), is(\"Initial\"));\n    testClient.put(\"/some/resource\");\n    assertThat(testClient.get(\"/some/resource\").content(), is(\"Modified\"));\n  }\n\n  @Test\n  public void mappingInScenarioIndependentOfCurrentState() {\n    givenThat(\n        get(urlEqualTo(\"/state/independent/resource\"))\n            .willReturn(aResponse().withBody(\"Some content\"))\n            .inScenario(\"StateIndependent\"));\n\n    givenThat(\n        put(urlEqualTo(\"/state/modifying/resource\"))\n            .willReturn(aResponse().withStatus(HTTP_OK))\n            .inScenario(\"StateIndependent\")\n            .willSetStateTo(\"BodyModified\"));\n\n    WireMockResponse response = testClient.get(\"/state/independent/resource\");\n    assertThat(response.statusCode(), is(HTTP_OK));\n    assertThat(response.content(), is(\"Some content\"));\n\n    testClient.put(\"/state/modifying/resource\");\n\n    response = testClient.get(\"/state/independent/resource\");\n    assertThat(response.statusCode(), is(HTTP_OK));\n    assertThat(response.content(), is(\"Some content\"));\n  }\n\n  @Test\n  public void resetAllScenariosState() {\n    givenThat(\n        get(urlEqualTo(\"/stateful/resource\"))\n            .willReturn(aResponse().withBody(\"Expected content\"))\n            .inScenario(\"ResetScenario\")\n            .whenScenarioStateIs(STARTED));\n\n    givenThat(\n        put(urlEqualTo(\"/stateful/resource\"))\n            .willReturn(aResponse().withStatus(HTTP_OK))\n            .inScenario(\"ResetScenario\")\n            .willSetStateTo(\"Changed\"));\n\n    testClient.put(\"/stateful/resource\");\n    WireMock.resetAllScenarios();\n\n    assertThat(testClient.get(\"/stateful/resource\").content(), is(\"Expected content\"));\n  }\n\n  @Test\n  public void settingScenarioNameToNullCausesException() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> get(urlEqualTo(\"/some/resource\")).willReturn(aResponse()).inScenario(null));\n  }\n\n  @Test\n  public void canGetAllScenarios() {\n    stubFor(\n        get(\"/scenarios/1\")\n            .inScenario(\"scenario_one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"state_2\")\n            .willReturn(ok(\"1:1\")));\n\n    stubFor(\n        get(\"/scenarios/2\")\n            .inScenario(\"scenario_two\")\n            .whenScenarioStateIs(STARTED)\n            .willReturn(ok(\"2:1\")));\n\n    testClient.get(\"/scenarios/1\");\n\n    List<Scenario> scenarios = getAllScenarios();\n\n    Scenario scenario1 =\n        scenarios.stream().filter(withName(\"scenario_one\")).findAny().orElseThrow();\n    assertThat(scenario1.getPossibleStates(), hasItems(STARTED, \"state_2\"));\n    assertThat(scenario1.getState(), is(\"state_2\"));\n\n    Scenario scenario2 =\n        scenarios.stream().filter(withName(\"scenario_two\")).findAny().orElseThrow();\n    assertThat(scenario2.getState(), is(\"Started\"));\n  }\n\n  @Test\n  public void scenarioIsRemovedWhenLastMappingReferringToItIsRemoved() {\n    final String NAME = \"remove_this_scenario\";\n\n    StubMapping stub1 =\n        stubFor(\n            get(\"/scenarios/22\")\n                .inScenario(NAME)\n                .whenScenarioStateIs(STARTED)\n                .willSetStateTo(\"state_2\")\n                .willReturn(ok(\"1\")));\n\n    StubMapping stub2 =\n        stubFor(\n            get(\"/scenarios/22\")\n                .inScenario(NAME)\n                .whenScenarioStateIs(\"state_2\")\n                .willSetStateTo(\"state_2\")\n                .willReturn(ok(\"2\")));\n\n    StubMapping stub3 =\n        stubFor(\n            get(\"/scenarios/22\")\n                .inScenario(NAME)\n                .whenScenarioStateIs(\"state_2\")\n                .willSetStateTo(\"state_3\")\n                .willReturn(ok(\"3\")));\n\n    assertThat(getAllScenarios().size(), is(1));\n\n    removeStub(stub1);\n    removeStub(stub2);\n    removeStub(stub3);\n\n    assertThat(getAllScenarios().size(), is(0));\n  }\n\n  @Test\n  public void scenarioIsRemovedWhenLastMappingReferringToHasItsScenarioNameChanged() {\n    final UUID ID1 = UUID.randomUUID();\n    final UUID ID2 = UUID.randomUUID();\n    final String OLD_NAME = \"old_scenario\";\n    final String NEW_NAME = \"new_scenario\";\n\n    stubFor(\n        get(\"/scenarios/33\")\n            .withId(ID1)\n            .inScenario(OLD_NAME)\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"state_2\")\n            .willReturn(ok(\"1\")));\n\n    stubFor(\n        get(\"/scenarios/33\")\n            .withId(ID2)\n            .inScenario(OLD_NAME)\n            .whenScenarioStateIs(\"state_2\")\n            .willSetStateTo(\"state_2\")\n            .willReturn(ok(\"2\")));\n\n    assertThat(getAllScenarios().size(), is(1));\n    assertThat(getAllScenarios().get(0).getId(), is(OLD_NAME));\n\n    editStub(\n        get(\"/scenarios/33\")\n            .withId(ID1)\n            .inScenario(NEW_NAME)\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"state_2\")\n            .willReturn(ok(\"1\")));\n    editStub(\n        get(\"/scenarios/33\")\n            .withId(ID2)\n            .inScenario(NEW_NAME)\n            .whenScenarioStateIs(\"state_2\")\n            .willSetStateTo(\"state_2\")\n            .willReturn(ok(\"2\")));\n\n    assertThat(getAllScenarios().size(), is(1));\n    assertThat(getAllScenarios().get(0).getId(), is(NEW_NAME));\n  }\n\n  @Test\n  public void returnsEmptyMapOnGetAllScenariosWhenThereAreNone() {\n    assertThat(getAllScenarios().size(), is(0));\n  }\n\n  @Test\n  public void scenarioBuilderMethodsDoNotNeedToBeContiguous() {\n    // This test has no assertions, but is here to ensure that the following compiles - i.e. that\n    // whenScenarioStatesIs and willSetStateTo don't have to immediately follow inScenario() calls,\n    // but can have\n    // other builder calls in between them.\n    //\n    // It should *not* be possible to call either before inScenario is called, however. We can't add\n    // a test for that\n    // of course, as it doesn't compile!\n    get(urlEqualTo(\"/\"))\n        .inScenario(\"Scenario\")\n        .willReturn(aResponse())\n        .whenScenarioStateIs(\"Prior State\")\n        .atPriority(1)\n        .willSetStateTo(\"Next State\");\n  }\n\n  @Test\n  public void resetsASingleScenarioByName() {\n    stubFor(\n        get(\"/one\")\n            .inScenario(\"reset-me\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"2\")\n            .willReturn(ok(\"started\")));\n\n    stubFor(get(\"/one\").inScenario(\"reset-me\").whenScenarioStateIs(\"2\").willReturn(ok(\"2\")));\n\n    assertThat(testClient.get(\"/one\").content(), is(\"started\"));\n    assertThat(testClient.get(\"/one\").content(), is(\"2\"));\n\n    resetScenario(\"reset-me\");\n\n    assertThat(testClient.get(\"/one\").content(), is(\"started\"));\n  }\n\n  @Test\n  public void setsASingleScenarioStateByName() {\n    stubFor(\n        get(\"/one\")\n            .inScenario(\"set-me\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"2\")\n            .willReturn(ok(\"started\")));\n\n    stubFor(\n        get(\"/one\")\n            .inScenario(\"set-me\")\n            .whenScenarioStateIs(\"2\")\n            .willSetStateTo(\"3\")\n            .willReturn(ok(\"2\")));\n    stubFor(get(\"/one\").inScenario(\"set-me\").whenScenarioStateIs(\"3\").willReturn(ok(\"3\")));\n\n    assertThat(testClient.get(\"/one\").content(), is(\"started\"));\n    assertThat(testClient.get(\"/one\").content(), is(\"2\"));\n    assertThat(testClient.get(\"/one\").content(), is(\"3\"));\n\n    setScenarioState(\"set-me\", \"2\");\n    assertThat(testClient.get(\"/one\").content(), is(\"2\"));\n  }\n\n  @Test\n  void throwsClientErrorWhenAttemptingToResetNonExistentScenario() {\n    assertThrows(ClientError.class, () -> resetScenario(\"non-exist\"));\n  }\n\n  @Test\n  void throwsClientErrorWhenAttemptingToSetToNonExistentState() {\n    stubFor(\n        get(\"/one\")\n            .inScenario(\"set-me\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"2\")\n            .willReturn(ok(\"started\")));\n\n    stubFor(\n        get(\"/one\")\n            .inScenario(\"set-me\")\n            .whenScenarioStateIs(\"2\")\n            .willSetStateTo(\"3\")\n            .willReturn(ok(\"2\")));\n\n    assertThrows(ClientError.class, () -> setScenarioState(\"set-me\", \"non-exist\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ServeEventListenerExtensionTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.PostServeActionExtensionTest.CounterNameParameter.counterNameParameter;\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.extension.ServeEventListener.RequestPhase.*;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonPartEquals;\nimport static org.awaitility.Awaitility.await;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.admin.Router;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.AdminApiExtension;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListener;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.Callable;\nimport java.util.concurrent.CompletableFuture;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ServeEventListenerExtensionTest {\n\n  WireMockServer wm;\n  WireMockTestClient client;\n\n  void initWithOptions(Options options) {\n    wm = new WireMockServer(options);\n    wm.start();\n    client = new WireMockTestClient(wm.port());\n  }\n\n  @AfterEach\n  public void cleanup() {\n    if (wm != null) {\n      wm.stop();\n    }\n  }\n\n  @Test\n  void eventSynchronouslyTriggeredBeforeMatching() {\n    AtomicBoolean completed = new AtomicBoolean(false);\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .extensions(\n                new ServeEventListener() {\n\n                  @Override\n                  public void beforeMatch(ServeEvent serveEvent, Parameters parameters) {\n                    assertThat(serveEvent.getRequest().getUrl(), is(\"/get-this\"));\n                    assertThat(serveEvent.getResponseDefinition(), nullValue());\n                    assertThat(serveEvent.getStubMapping(), nullValue());\n                    assertThat(serveEvent.getResponse(), nullValue());\n\n                    completed.set(true);\n                  }\n\n                  @Override\n                  public String getName() {\n                    return \"before-match\";\n                  }\n                }));\n\n    wm.stubFor(any(anyUrl()).willReturn(ok()));\n\n    client.get(\"/get-this\");\n\n    assertTrue(completed.get());\n  }\n\n  @Test\n  void eventSynchronouslyTriggeredAfterMatching() {\n    AtomicBoolean completed = new AtomicBoolean(false);\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .extensions(\n                new ServeEventListener() {\n\n                  @Override\n                  public void afterMatch(ServeEvent serveEvent, Parameters parameters) {\n                    assertThat(serveEvent.getRequest().getUrl(), is(\"/get-this\"));\n                    assertThat(serveEvent.getResponseDefinition(), notNullValue());\n                    assertThat(serveEvent.getStubMapping(), notNullValue());\n                    assertThat(serveEvent.getResponse(), nullValue());\n\n                    completed.set(true);\n                  }\n\n                  @Override\n                  public String getName() {\n                    return \"after-match\";\n                  }\n                }));\n\n    wm.stubFor(any(anyUrl()).willReturn(ok()));\n\n    client.get(\"/get-this\");\n\n    assertTrue(completed.get());\n  }\n\n  @Test\n  void eventSynchronouslyTriggeredBeforeResponseSent() {\n    AtomicBoolean completed = new AtomicBoolean(false);\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .extensions(\n                new ServeEventListener() {\n\n                  @Override\n                  public void beforeResponseSent(ServeEvent serveEvent, Parameters parameters) {\n                    assertThat(serveEvent.getRequest().getUrl(), is(\"/get-this\"));\n                    assertThat(serveEvent.getResponseDefinition(), notNullValue());\n                    assertThat(serveEvent.getStubMapping(), notNullValue());\n                    assertThat(serveEvent.getResponse().getStatus(), is(200));\n\n                    completed.set(true);\n                  }\n\n                  @Override\n                  public String getName() {\n                    return \"before-resposnse-sent\";\n                  }\n                }));\n\n    wm.stubFor(any(anyUrl()).willReturn(ok()));\n\n    client.get(\"/get-this\");\n\n    assertTrue(completed.get());\n  }\n\n  @Test\n  void eventAsynchronouslyTriggeredAfterCompletion() throws Exception {\n    final CompletableFuture<Void> completed = new CompletableFuture<>();\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .extensions(\n                new ServeEventListener() {\n\n                  @Override\n                  public void afterComplete(ServeEvent serveEvent, Parameters parameters) {\n                    assertThat(serveEvent.getRequest().getUrl(), is(\"/get-this\"));\n                    assertThat(serveEvent.getResponseDefinition(), notNullValue());\n                    assertThat(serveEvent.getStubMapping(), notNullValue());\n                    assertThat(serveEvent.getResponse().getStatus(), is(200));\n\n                    completed.complete(null);\n                  }\n\n                  @Override\n                  public String getName() {\n                    return \"after-complete\";\n                  }\n                }));\n\n    wm.stubFor(any(anyUrl()).willReturn(ok()));\n\n    client.get(\"/get-this\");\n\n    completed.get(2, SECONDS);\n  }\n\n  @Test\n  void eventTriggeredWhenAppliedToAStubMapping() {\n    initWithOptions(options().dynamicPort().extensions(new NamedCounterAction()));\n\n    StubMapping stubMapping =\n        wm.stubFor(\n            get(urlPathEqualTo(\"/count-me\"))\n                .withServeEventListener(\"count-request\", counterNameParameter().withName(\"things\"))\n                .willReturn(aResponse()));\n\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/things\"), is(\"4\"));\n\n    // We should serialise out in array form\n    assertThat(\n        client.get(\"/__admin/mappings/\" + stubMapping.getId()).content(),\n        jsonPartEquals(\n            \"serveEventListeners\",\n            \"[\\n\"\n                + \"    {\\n\"\n                + \"      \\\"name\\\": \\\"count-request\\\",\\n\"\n                + \"      \\\"parameters\\\": {\\n\"\n                + \"        \\\"counterName\\\": \\\"things\\\"\\n\"\n                + \"      }\\n\"\n                + \"    }\\n\"\n                + \"  ]\"));\n  }\n\n  @Test\n  void eventSelectedPerStubWithVaryingParameters() {\n    final List<String> messages = new ArrayList<>();\n\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .extensions(\n                new ServeEventListener() {\n\n                  @Override\n                  public void onEvent(\n                      RequestPhase requestPhase, ServeEvent serveEvent, Parameters parameters) {\n                    messages.add(requestPhase.name() + \": \" + parameters.getString(\"phase\"));\n                  }\n\n                  @Override\n                  public boolean applyGlobally() {\n                    return false;\n                  }\n\n                  @Override\n                  public String getName() {\n                    return \"request-phase-reporter\";\n                  }\n                }));\n\n    wm.stubFor(\n        get(urlPathEqualTo(\"/report\"))\n            .withServeEventListener(\n                AFTER_MATCH, \"request-phase-reporter\", Parameters.one(\"phase\", \"after-match\"))\n            .withServeEventListener(\n                AFTER_COMPLETE, \"request-phase-reporter\", Parameters.one(\"phase\", \"after-complete\"))\n            .willReturn(aResponse()));\n\n    client.get(\"/report\");\n\n    await()\n        .atMost(2, SECONDS)\n        .until(\n            () -> messages, hasItems(\"AFTER_MATCH: after-match\", \"AFTER_COMPLETE: after-complete\"));\n  }\n\n  @Test\n  void globalOnEventListenerIsTriggeredInAllRequestPhases() {\n    final List<String> messages = new ArrayList<>();\n\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .extensions(\n                new ServeEventListener() {\n\n                  @Override\n                  public void onEvent(\n                      RequestPhase requestPhase, ServeEvent serveEvent, Parameters parameters) {\n                    messages.add(requestPhase.name());\n                  }\n\n                  @Override\n                  public boolean applyGlobally() {\n                    return true;\n                  }\n\n                  @Override\n                  public String getName() {\n                    return \"request-phase-reporter\";\n                  }\n                }));\n\n    wm.stubFor(get(urlPathEqualTo(\"/report\")).willReturn(aResponse()));\n\n    client.get(\"/report\");\n\n    await()\n        .atMost(2, SECONDS)\n        .until(() -> messages, hasItems(\"BEFORE_MATCH\", \"AFTER_MATCH\", \"AFTER_COMPLETE\"));\n  }\n\n  @Test\n  void continuesWithNoEffectIfANonExistentActionIsReferenced() {\n    initWithOptions(options().dynamicPort());\n\n    wm.stubFor(\n        get(urlPathEqualTo(\"/as-normal\"))\n            .withServeEventListener(\"does-not-exist\", counterNameParameter().withName(\"things\"))\n            .willReturn(aResponse().withStatus(200)));\n\n    assertThat(client.get(\"/as-normal\").statusCode(), is(200));\n  }\n\n  @Test\n  void providesServeEventWithResponseFieldPopulated() {\n    final AtomicInteger finalStatus = new AtomicInteger();\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .extensions(\n                new ServeEventListener() {\n                  @Override\n                  public String getName() {\n                    return \"response-field-test\";\n                  }\n\n                  @Override\n                  public boolean applyGlobally() {\n                    return true;\n                  }\n\n                  @Override\n                  public void afterComplete(ServeEvent serveEvent, Parameters parameters) {\n                    if (serveEvent.getResponse() != null) {\n                      finalStatus.set(serveEvent.getResponse().getStatus());\n                    }\n                  }\n                }));\n\n    wm.stubFor(get(urlPathEqualTo(\"/response-status\")).willReturn(aResponse().withStatus(418)));\n\n    client.get(\"/response-status\");\n\n    await().atMost(5, SECONDS).until(getValue(finalStatus), is(418));\n  }\n\n  @Test\n  public void multipleActionsOfTheSameNameCanBeSpecifiedAsAJsonArray() {\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .notifier(new ConsoleNotifier(true))\n            .extensions(new NamedCounterAction()));\n\n    WireMockResponse response =\n        client.postJson(\n            \"/__admin/mappings\",\n            \"{\\n\"\n                + \"  \\\"request\\\": {\\n\"\n                + \"    \\\"urlPath\\\": \\\"/count-me\\\",\\n\"\n                + \"    \\\"method\\\": \\\"GET\\\"\\n\"\n                + \"  },\\n\"\n                + \"  \\\"response\\\": {\\n\"\n                + \"    \\\"status\\\": 200\\n\"\n                + \"  },\\n\"\n                + \"  \\\"serveEventListeners\\\": [\\n\"\n                + \"    {\\n\"\n                + \"      \\\"name\\\": \\\"count-request\\\",\\n\"\n                + \"      \\\"parameters\\\": {\\n\"\n                + \"        \\\"counterName\\\": \\\"one\\\"  \\n\"\n                + \"      }\\n\"\n                + \"    },\\n\"\n                + \"    {\\n\"\n                + \"      \\\"name\\\": \\\"count-request\\\",\\n\"\n                + \"      \\\"parameters\\\": {\\n\"\n                + \"        \\\"counterName\\\": \\\"two\\\"\\n\"\n                + \"      }\\n\"\n                + \"    }\\n\"\n                + \"  ]\\n\"\n                + \"}\");\n\n    assertThat(response.content(), response.statusCode(), is(201));\n\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/one\"), is(\"3\"));\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/two\"), is(\"3\"));\n  }\n\n  @Test\n  void multipleActionsOfTheSameNameCanBeSpecifiedViaTheDSL() {\n    initWithOptions(\n        options()\n            .dynamicPort()\n            .notifier(new ConsoleNotifier(true))\n            .extensions(new NamedCounterAction()));\n\n    wm.stubFor(\n        get(urlPathEqualTo(\"/count-me\"))\n            .willReturn(ok())\n            .withServeEventListener(\"count-request\", counterNameParameter().withName(\"one\"))\n            .withServeEventListener(\"count-request\", counterNameParameter().withName(\"two\")));\n\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n    client.get(\"/count-me\");\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/one\"), is(\"3\"));\n\n    await().atMost(5, SECONDS).until(getContent(\"/__admin/named-counter/two\"), is(\"3\"));\n  }\n\n  private Callable<Integer> getValue(final AtomicInteger value) {\n    return value::get;\n  }\n\n  private Callable<String> getContent(final String url) {\n    return () -> client.get(url).content();\n  }\n\n  public static class NamedCounterAction implements ServeEventListener, AdminApiExtension {\n\n    private final ConcurrentHashMap<String, Integer> counters = new ConcurrentHashMap<>();\n\n    @Override\n    public String getName() {\n      return \"count-request\";\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return false;\n    }\n\n    @Override\n    public void contributeAdminApiRoutes(Router router) {\n      router.add(\n          GET,\n          \"/named-counter/{name}\",\n          (admin, serveEvent, pathParams) -> {\n            String name = pathParams.get(\"name\");\n            Integer count = getFirstNonNull(counters.get(name), 0);\n            return responseDefinition().withStatus(200).withBody(String.valueOf(count)).build();\n          });\n    }\n\n    @Override\n    public void afterComplete(ServeEvent serveEvent, Parameters parameters) {\n      CounterNameParameter counterNameParam = parameters.as(CounterNameParameter.class);\n\n      String counterName = counterNameParam.counterName;\n\n      counters.putIfAbsent(counterName, 0);\n      Integer oldValue;\n      Integer newValue;\n\n      do {\n        oldValue = counters.get(counterName);\n        newValue = oldValue + 1;\n      } while (!counters.replace(counterName, oldValue, newValue));\n    }\n  }\n\n  public static class CounterNameParameter {\n\n    public String counterName;\n\n    public CounterNameParameter(@JsonProperty(\"counterName\") String counterName) {\n      this.counterName = counterName;\n    }\n\n    public CounterNameParameter() {}\n\n    public static CounterNameParameter counterNameParameter() {\n      return new CounterNameParameter();\n    }\n\n    public CounterNameParameter withName(String name) {\n      this.counterName = name;\n      return this;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/ServeEventLogAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2012-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.admin.model.ServeEventQuery.ALL_UNMATCHED;\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.hasExactly;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.isToday;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItems;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.admin.model.ServeEventQuery;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Dates;\nimport com.github.tomakehurst.wiremock.common.Encoding;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.junit.Stubbing;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.text.ParseException;\nimport java.util.Date;\nimport java.util.List;\nimport org.apache.hc.core5.http.ContentType;\nimport org.apache.hc.core5.http.io.entity.ByteArrayEntity;\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.TypeSafeMatcher;\nimport org.junit.jupiter.api.Test;\n\npublic class ServeEventLogAcceptanceTest extends AcceptanceTestBase {\n\n  static Stubbing dsl = wireMockServer;\n\n  @Test\n  public void returnsRecordedRequestsMatchingOnMethodAndExactUrl() throws Exception {\n    testClient.get(\"/return/this\");\n    testClient.get(\"/but/not/this\");\n    testClient.get(\"/return/this\");\n    testClient.get(\"/return/this\");\n    testClient.get(\"/but/not/this\");\n\n    List<LoggedRequest> requests = findAll(getRequestedFor(urlEqualTo(\"/return/this\")));\n\n    assertThat(requests.size(), is(3));\n    LoggedRequest firstRequest = requests.get(0);\n    assertThat(firstRequest.getUrl(), is(\"/return/this\"));\n    assertThat(firstRequest.getMethod(), is(RequestMethod.GET));\n    assertThat(firstRequest.getLoggedDate(), isToday());\n    assertThat(parse(firstRequest.getLoggedDateString()), isToday());\n  }\n\n  @Test\n  public void returnsRecordedRequestsMatchingOnQueryMethodAndExactUrl() throws Exception {\n    testClient.query(\"/return/this\");\n    testClient.get(\"/but/not/this\");\n\n    List<LoggedRequest> requests = findAll(queryRequestedFor(urlEqualTo(\"/return/this\")));\n\n    assertThat(requests.size(), is(1));\n    LoggedRequest firstRequest = requests.get(0);\n    assertThat(firstRequest.getUrl(), is(\"/return/this\"));\n    assertThat(firstRequest.getMethod(), is(RequestMethod.QUERY));\n    assertThat(firstRequest.getLoggedDate(), isToday());\n    assertThat(parse(firstRequest.getLoggedDateString()), isToday());\n  }\n\n  @Test\n  @SuppressWarnings(\"unchecked\")\n  public void returnsRecordedRequestsMatchingOnMethodAndUrlRegex() {\n    testClient.put(\"/should/return/this/request\");\n    testClient.get(\"/donot/return/this/request\"); // Wrong method\n    testClient.put(\"/also/return/this\");\n    testClient.put(\"/not/this\");\n\n    List<LoggedRequest> requests = findAll(putRequestedFor(urlMatching(\".*return/this.*\")));\n\n    assertThat(requests.size(), is(2));\n    assertThat(\n        requests, hasItems(withUrl(\"/should/return/this/request\"), withUrl(\"/also/return/this\")));\n  }\n\n  @Test\n  public void returnsNoResultsAfterReset() {\n    testClient.get(\"/blah\");\n    testClient.get(\"/blah\");\n    testClient.get(\"/blah\");\n\n    WireMock.reset();\n    List<LoggedRequest> requests = findAll(getRequestedFor(urlEqualTo(\"/blah\")));\n\n    assertThat(requests.size(), is(0));\n  }\n\n  @Test\n  public void returnsNoResultsAfterRequestsReset() {\n    testClient.get(\"/blah\");\n    testClient.get(\"/blah\");\n    testClient.get(\"/blah\");\n\n    WireMock.resetAllRequests();\n    List<LoggedRequest> requests = findAll(getRequestedFor(urlEqualTo(\"/blah\")));\n\n    assertThat(requests.size(), is(0));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  public void resultsAreInOrderRequestsWereReceived() {\n    testClient.get(\"/use/1\");\n    testClient.get(\"/ignore/1\");\n    testClient.get(\"/ignore/2\");\n    testClient.get(\"/use/2\");\n    testClient.get(\"/use/3\");\n    testClient.get(\"/ignore/3\");\n    testClient.get(\"/use/4\");\n\n    List<LoggedRequest> requests = findAll(getRequestedFor(urlMatching(\"/use/.*\")));\n\n    assertThat(\n        requests,\n        hasExactly(withUrl(\"/use/1\"), withUrl(\"/use/2\"), withUrl(\"/use/3\"), withUrl(\"/use/4\")));\n  }\n\n  @Test\n  public void requestBodyEncodingRemainsUtf8() {\n    byte[] body = new byte[] {-38, -100}; // UTF-8 bytes for ڜ\n    testClient.post(\n        \"/encoding\", new ByteArrayEntity(body, ContentType.TEXT_PLAIN.withCharset(UTF_8)));\n\n    List<LoggedRequest> requests = findAll(postRequestedFor(urlEqualTo(\"/encoding\")));\n    LoggedRequest request = requests.get(0);\n    assertThat(request.getBodyAsString(), is(\"ڜ\"));\n  }\n\n  @Test\n  public void getsAllServeEvents() {\n    dsl.stubFor(\n        get(urlPathEqualTo(\"/two\")).willReturn(aResponse().withStatus(200).withBody(\"Exactly 2\")));\n\n    testClient.get(\"/one\");\n    testClient.get(\"/two\");\n    testClient.get(\"/three\");\n\n    List<ServeEvent> serveEvents = getAllServeEvents();\n\n    ServeEvent three = serveEvents.get(0);\n    assertThat(three.isNoExactMatch(), is(true));\n    assertThat(three.getRequest().getUrl(), is(\"/three\"));\n\n    ServeEvent two = serveEvents.get(1);\n    assertThat(two.isNoExactMatch(), is(false));\n    assertThat(two.getRequest().getUrl(), is(\"/two\"));\n    assertThat(two.getResponse().getBody(), is(\"Exactly 2\".getBytes()));\n    assertThat(two.getResponse().getBodyAsString(), is(\"Exactly 2\"));\n    assertThat(\n        two.getResponse().getBodyAsBase64(), is(Encoding.encodeBase64(\"Exactly 2\".getBytes())));\n    assertThat(two.getResponse().isFromProxy(), is(false));\n\n    assertThat(serveEvents.get(2).isNoExactMatch(), is(true));\n  }\n\n  @Test\n  public void getAllServeEventsPreservesBinaryBody() {\n    dsl.stubFor(\n        any(anyUrl())\n            .willReturn(aResponse().withBody(MappingJsonSamples.BINARY_COMPRESSED_CONTENT)));\n\n    testClient.get(\"/\");\n\n    List<ServeEvent> serveEvents = getAllServeEvents();\n    ServeEvent serveEvent = serveEvents.get(0);\n    assertThat(\n        serveEvent.getResponse().getBody(), is(MappingJsonSamples.BINARY_COMPRESSED_CONTENT));\n  }\n\n  @Test\n  public void getsAllServeEventsThatWereUnmatched() {\n    dsl.stubFor(get(\"/match\").willReturn(ok()));\n\n    testClient.get(\"/match\");\n    testClient.get(\"/no-match\");\n    testClient.get(\"/just-wrong\");\n    testClient.get(\"/match\");\n\n    List<ServeEvent> serveEvents = getAllServeEvents(ALL_UNMATCHED);\n\n    assertThat(serveEvents.size(), is(2));\n    assertThat(serveEvents.get(0).getRequest().getUrl(), is(\"/just-wrong\"));\n    assertThat(serveEvents.get(1).getRequest().getUrl(), is(\"/no-match\"));\n  }\n\n  @Test\n  public void getsAllServeEventsThatMatchedStubId() {\n    wm.stubFor(get(\"/one\").willReturn(ok()));\n    StubMapping stub2 = wm.stubFor(get(\"/two\").willReturn(ok()));\n\n    testClient.get(\"/two\");\n    testClient.get(\"/one\");\n    testClient.get(\"/one\");\n    testClient.get(\"/two\");\n\n    List<ServeEvent> serveEvents = getAllServeEvents(ServeEventQuery.forStubMapping(stub2));\n\n    assertThat(serveEvents.size(), is(2));\n    assertThat(serveEvents.get(0).getRequest().getUrl(), is(\"/two\"));\n    assertThat(serveEvents.get(1).getRequest().getUrl(), is(\"/two\"));\n  }\n\n  private Matcher<LoggedRequest> withUrl(final String url) {\n    return new TypeSafeMatcher<>() {\n      @Override\n      public boolean matchesSafely(LoggedRequest loggedRequest) {\n        return loggedRequest.getUrl().equals(url);\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"A logged request with url: \" + url);\n      }\n    };\n  }\n\n  private static Date parse(String dateString) throws ParseException {\n    return Dates.parse(dateString);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/SnapshotDslAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.client.WireMock.any;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static java.util.Collections.singletonList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.hamcrest.Matchers.anEmptyMap;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.StubMappingTransformer;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.*;\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMatchers;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.skyscreamer.jsonassert.JSONAssert;\n\npublic class SnapshotDslAcceptanceTest extends AcceptanceTestBase {\n\n  private WireMockServer targetService;\n  private WireMockServer proxyingService;\n  private WireMockTestClient client;\n  private WireMock adminClient;\n  private StubMapping proxyStub;\n\n  @BeforeEach\n  public void init() {\n    proxyingService =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .extensions(new TestParameterisedTransformer())\n                .withRootDirectory(setupTempFileRoot().getAbsolutePath()));\n    proxyingService.start();\n    proxyingService.stubFor(proxyAllTo(\"http://localhost:\" + wireMockServer.port()));\n\n    targetService = wireMockServer;\n    proxyStub = targetService.stubFor(any(anyUrl()).willReturn(ok()));\n\n    client = new WireMockTestClient(proxyingService.port());\n    WireMock.configureFor(proxyingService.port());\n    adminClient = WireMock.create().port(proxyingService.port()).build();\n  }\n\n  @AfterEach\n  public void proxyServerShutdown() {\n    proxyingService.resetMappings();\n    proxyingService.stop();\n  }\n\n  @Test\n  public void snapshotRecordsAllLoggedRequestsWhenNoParametersPassed() throws Exception {\n    targetService.stubFor(\n        get(\"/one\")\n            .willReturn(\n                aResponse().withHeader(\"Content-Type\", \"text/plain\").withBody(\"Number one\")));\n\n    client.get(\"/one\");\n    client.query(\"/two\");\n    client.postJson(\"/three\", \"{ \\\"counter\\\": 55 }\");\n\n    List<StubMapping> returnedMappings = proxyingService.snapshotRecord().getStubMappings();\n    List<StubMapping> serverMappings = proxyingService.getStubMappings();\n\n    assertTrue(\n        serverMappings.containsAll(returnedMappings),\n        \"All of the returned mappings should be present in the server\");\n    assertThat(returnedMappings.size(), is(3));\n\n    assertThat(returnedMappings.get(2).getRequest().getUrl(), is(\"/one\"));\n    assertThat(returnedMappings.get(2).getRequest().getHeaders(), anEmptyMap());\n    assertThat(returnedMappings.get(2).getRequest().getMethod(), is(RequestMethod.GET));\n    assertThat(\n        returnedMappings.get(2).getResponse().getHeaders().getHeader(\"Content-Type\").firstValue(),\n        is(\"text/plain\"));\n    assertThat(returnedMappings.get(2).getResponse().getBody(), is(\"Number one\"));\n\n    assertThat(returnedMappings.get(1).getRequest().getUrl(), is(\"/two\"));\n    assertThat(returnedMappings.get(1).getRequest().getMethod(), is(RequestMethod.QUERY));\n\n    assertThat(returnedMappings.get(0).getRequest().getUrl(), is(\"/three\"));\n\n    ContentPattern bodyPattern = returnedMappings.get(0).getRequest().getBodyPatterns().get(0);\n    assertThat(bodyPattern, instanceOf(EqualToJsonPattern.class));\n    JSONAssert.assertEquals(\"{ \\\"counter\\\": 55 }\", bodyPattern.getExpected(), true);\n\n    EqualToJsonPattern equalToJsonPattern = (EqualToJsonPattern) bodyPattern;\n    assertThat(equalToJsonPattern.isIgnoreArrayOrder(), is(true));\n    assertThat(equalToJsonPattern.isIgnoreExtraElements(), is(true));\n  }\n\n  @Test\n  public void supportsFilteringByCriteria() throws Exception {\n    client.get(\"/things/1\");\n    client.get(\"/things/2\");\n    client.get(\"/stuff/1\");\n    client.get(\"/things/3\");\n    client.get(\"/stuff/2\");\n\n    List<StubMapping> mappings =\n        proxyingService\n            .snapshotRecord(\n                recordSpec().onlyRequestsMatching(getRequestedFor(urlPathMatching(\"/things/.*\"))))\n            .getStubMappings();\n\n    assertThat(mappings.size(), is(3));\n    assertThat(mappings, everyItem(WireMatchers.stubMappingWithUrl(urlPathMatching(\"/things.*\"))));\n    assertThat(\n        mappings, not(hasItem(WireMatchers.stubMappingWithUrl(urlPathMatching(\"/stuff.*\")))));\n  }\n\n  @Test\n  public void supportsFilteringByServeEventId() throws Exception {\n    client.get(\"/1\");\n    client.get(\"/2\");\n    client.get(\"/3\");\n\n    UUID serveEventId =\n        WireMatchers.findServeEventWithUrl(proxyingService.getAllServeEvents(), \"/2\").getId();\n\n    List<StubMapping> mappings =\n        adminClient.takeSnapshotRecording(recordSpec().onlyRequestIds(singletonList(serveEventId)));\n\n    assertThat(mappings.size(), is(1));\n    assertThat(mappings.get(0).getRequest().getUrl(), is(\"/2\"));\n  }\n\n  @Test\n  public void willAllowNonProxiedEventsIfSpecified() throws Exception {\n    proxyingService.removeStub(proxyStub);\n\n    client.postJson(\"/record-this-anyway\", \"{ \\\"things\\\": 123 }\");\n\n    List<StubMapping> mappings =\n        adminClient.takeSnapshotRecording(recordSpec().allowNonProxied(true));\n\n    assertThat(mappings.size(), is(1));\n    assertThat(mappings.get(0).getRequest().getUrl(), is(\"/record-this-anyway\"));\n    assertThat(\n        mappings.get(0).getRequest().getBodyPatterns().get(0).getExpected(),\n        WireMatchers.equalToJson(\"{ \\\"things\\\": 123 }\"));\n  }\n\n  @Test\n  public void supportsRequestHeaderCriteria() {\n    client.get(\"/one\", withHeader(\"Yes\", \"1\"), withHeader(\"No\", \"1\"));\n    client.get(\"/two\", withHeader(\"Yes\", \"2\"), withHeader(\"Also-Yes\", \"BBB\"));\n\n    List<StubMapping> mappings =\n        snapshotRecord(recordSpec().captureHeader(\"Yes\").captureHeader(\"Also-Yes\", true));\n\n    StringValuePattern yesValuePattern =\n        ((SingleMatchMultiValuePattern) mappings.get(1).getRequest().getHeaders().get(\"Yes\"))\n            .getValuePattern();\n    assertThat(yesValuePattern, instanceOf(EqualToPattern.class));\n    assertThat(((EqualToPattern) yesValuePattern).getCaseInsensitive(), nullValue());\n    assertFalse(mappings.get(0).getRequest().getHeaders().containsKey(\"No\"));\n\n    StringValuePattern alsoYesValuePattern =\n        ((SingleMatchMultiValuePattern) mappings.get(0).getRequest().getHeaders().get(\"Also-Yes\"))\n            .getValuePattern();\n    assertThat(alsoYesValuePattern, instanceOf(EqualToPattern.class));\n    assertThat(((EqualToPattern) alsoYesValuePattern).getCaseInsensitive(), is(true));\n  }\n\n  @Test\n  public void supportsBodyExtractCriteria() {\n    targetService.stubFor(\n        get(\"/small/text\")\n            .willReturn(aResponse().withHeader(\"Content-Type\", \"text/plain\").withBody(\"123\")));\n    targetService.stubFor(\n        get(\"/large/text\")\n            .willReturn(\n                aResponse()\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"12345678901234567\")));\n    targetService.stubFor(\n        get(\"/small/binary\")\n            .willReturn(\n                aResponse()\n                    .withHeader(\"Content-Type\", \"application/octet-stream\")\n                    .withBody(new byte[] {1, 2, 3})));\n    targetService.stubFor(\n        get(\"/large/binary\")\n            .willReturn(\n                aResponse()\n                    .withHeader(\"Content-Type\", \"application/octet-stream\")\n                    .withBody(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9})));\n\n    client.get(\"/small/text\");\n    client.get(\"/large/text\");\n    client.get(\"/small/binary\");\n    client.get(\"/large/binary\");\n\n    List<StubMapping> mappings =\n        snapshotRecord(recordSpec().extractTextBodiesOver(10).extractBinaryBodiesOver(5));\n\n    assertThat(mappings.size(), is(4));\n    assertThat(\n        WireMatchers.findMappingWithUrl(mappings, \"/small/text\").getResponse().getBodyFileName(),\n        nullValue());\n    assertThat(\n        WireMatchers.findMappingWithUrl(mappings, \"/large/text\").getResponse().getBodyFileName(),\n        startsWith(\"large_text\"));\n    assertThat(\n        WireMatchers.findMappingWithUrl(mappings, \"/small/binary\").getResponse().getBodyFileName(),\n        nullValue());\n    assertThat(\n        WireMatchers.findMappingWithUrl(mappings, \"/large/binary\").getResponse().getBodyFileName(),\n        startsWith(\"large_binary\"));\n  }\n\n  @Test\n  public void supportsDisablingRecordedStubPersistence() {\n    client.get(\"/transient\");\n\n    List<StubMapping> mappings = snapshotRecord(recordSpec().makeStubsPersistent(false));\n\n    assertThat(WireMatchers.findMappingWithUrl(mappings, \"/transient\").isPersistent(), nullValue());\n  }\n\n  @Test\n  public void buildsAScenarioForRepeatedIdenticalRequests() {\n    targetService.stubFor(get(\"/stateful\").willReturn(ok(\"One\")));\n    client.get(\"/stateful\");\n\n    targetService.stubFor(get(\"/stateful\").willReturn(ok(\"Two\")));\n    client.get(\"/stateful\");\n\n    targetService.stubFor(get(\"/stateful\").willReturn(ok(\"Three\")));\n    client.get(\"/stateful\");\n\n    // Scenario creation is the default\n    List<StubMapping> mappings = snapshotRecord();\n\n    assertThat(client.get(\"/stateful\").content(), is(\"One\"));\n    assertThat(client.get(\"/stateful\").content(), is(\"Two\"));\n    assertThat(client.get(\"/stateful\").content(), is(\"Three\"));\n\n    assertThat(mappings, everyItem(WireMatchers.isInAScenario()));\n    assertThat(mappings.get(2).getRequiredScenarioState(), is(Scenario.STARTED));\n    assertThat(mappings.get(1).getRequiredScenarioState(), is(\"scenario-1-stateful-2\"));\n    assertThat(mappings.get(0).getRequiredScenarioState(), is(\"scenario-1-stateful-3\"));\n  }\n\n  @Test\n  public void appliesTransformerWithParameters() {\n    client.get(\"/transform-this\");\n\n    List<StubMapping> mappings =\n        snapshotRecord(\n            recordSpec()\n                .transformers(\"test-transformer\")\n                .transformerParameters(\n                    Parameters.from(Map.of(\"headerKey\", \"X-Key\", \"headerValue\", \"My value\"))));\n\n    assertThat(\n        mappings.get(0).getResponse().getHeaders().getHeader(\"X-Key\").firstValue(), is(\"My value\"));\n  }\n\n  @Test\n  public void supportsConfigurationOfAutoRequestBodyPatternFactory() {\n    client.postJson(\"/some-json\", \"{}\");\n    client.postWithBody(\"/some-json\", \"<foo/>\", \"application/xml\", \"utf-8\");\n    client.postWithBody(\"/some-json\", \"foo\", \"application/text\", \"utf-8\");\n\n    List<StubMapping> mappings =\n        snapshotRecord(recordSpec().chooseBodyMatchTypeAutomatically(false, false, true));\n\n    EqualToJsonPattern jsonBodyPattern =\n        (EqualToJsonPattern) mappings.get(2).getRequest().getBodyPatterns().get(0);\n    assertThat(jsonBodyPattern.getEqualToJson(), is(\"{}\"));\n    assertThat(jsonBodyPattern.isIgnoreArrayOrder(), is(false));\n    assertThat(jsonBodyPattern.isIgnoreExtraElements(), is(false));\n\n    EqualToXmlPattern xmlBodyPattern =\n        (EqualToXmlPattern) mappings.get(1).getRequest().getBodyPatterns().get(0);\n    assertThat(xmlBodyPattern.getEqualToXml(), is(\"<foo/>\"));\n\n    EqualToPattern textBodyPattern =\n        (EqualToPattern) mappings.get(0).getRequest().getBodyPatterns().get(0);\n    assertThat(textBodyPattern.getEqualTo(), is(\"foo\"));\n    assertThat(textBodyPattern.getCaseInsensitive(), is(true));\n  }\n\n  @Test\n  public void supportsConfigurationOfRequestBodyPatternFactoryWithEqualToJsonPattern() {\n    client.postJson(\"/some-json\", \"{}\");\n\n    List<StubMapping> mappings =\n        snapshotRecord(recordSpec().matchRequestBodyWithEqualToJson(false, true));\n\n    EqualToJsonPattern bodyPattern =\n        (EqualToJsonPattern) mappings.get(0).getRequest().getBodyPatterns().get(0);\n    assertThat(bodyPattern.isIgnoreArrayOrder(), is(false));\n    assertThat(bodyPattern.isIgnoreExtraElements(), is(true));\n  }\n\n  @Test\n  public void supportsConfigurationOfRequestBodyPatternFactoryWithEqualToXmlPattern() {\n    client.postWithBody(\"/some-json\", \"<foo/>\", \"application/xml\", \"utf-8\");\n\n    List<StubMapping> mappings = snapshotRecord(recordSpec().matchRequestBodyWithEqualToXml());\n\n    assertThat(\n        mappings.get(0).getRequest().getBodyPatterns().get(0), instanceOf(EqualToXmlPattern.class));\n  }\n\n  @Test\n  public void supportsConfigurationOfRequestBodyPatternFactoryWithEqualToPattern() {\n    client.postWithBody(\"/some-json\", \"foo\", \"application/text\", \"utf-8\");\n\n    List<StubMapping> mappings = snapshotRecord(recordSpec().matchRequestBodyWithEqualTo(true));\n\n    EqualToPattern bodyPattern =\n        (EqualToPattern) mappings.get(0).getRequest().getBodyPatterns().get(0);\n    assertThat(bodyPattern.getCaseInsensitive(), is(true));\n  }\n\n  @Test\n  public void defaultsToAutomaticRequestBodyPattern() {\n    client.postJson(\"/some-json\", \"{}\");\n\n    List<StubMapping> mappings = snapshotRecord(recordSpec());\n\n    EqualToJsonPattern bodyPattern =\n        (EqualToJsonPattern) mappings.get(0).getRequest().getBodyPatterns().get(0);\n    assertThat(bodyPattern, is(new EqualToJsonPattern(\"{}\", true, true)));\n  }\n\n  @Test\n  public void staticClientIsSupportedWithDefaultSpec() {\n    client.get(\"/get-this\");\n\n    snapshotRecord();\n\n    List<StubMapping> serverMappings = proxyingService.getStubMappings();\n    assertThat(serverMappings, hasItem(WireMatchers.stubMappingWithUrl(\"/get-this\")));\n  }\n\n  @Test\n  public void staticClientIsSupportedWithSpecProvided() {\n    client.get(\"/get-this\");\n    client.get(\"/but-not-this\");\n\n    snapshotRecord(recordSpec().onlyRequestsMatching(getRequestedFor(urlEqualTo(\"/get-this\"))));\n\n    List<StubMapping> serverMappings = proxyingService.getStubMappings();\n    assertThat(serverMappings, hasItem(WireMatchers.stubMappingWithUrl(\"/get-this\")));\n    assertThat(serverMappings, not(hasItem(WireMatchers.stubMappingWithUrl(\"/but-not-this\"))));\n  }\n\n  @Test\n  public void instanceClientIsSupportedWithDefaultSpec() {\n    client.get(\"/get-this-too\");\n    adminClient.takeSnapshotRecording();\n\n    List<StubMapping> serverMappings = proxyingService.getStubMappings();\n    assertThat(serverMappings, hasItem(WireMatchers.stubMappingWithUrl(\"/get-this-too\")));\n  }\n\n  @Test\n  public void instanceClientIsSupportedWithSpecProvided() {\n    client.get(\"/get-this\");\n    client.get(\"/but-not-this\");\n\n    adminClient.takeSnapshotRecording(\n        recordSpec().onlyRequestsMatching(getRequestedFor(urlEqualTo(\"/get-this\"))));\n\n    List<StubMapping> serverMappings = proxyingService.getStubMappings();\n    assertThat(serverMappings, hasItem(WireMatchers.stubMappingWithUrl(\"/get-this\")));\n    assertThat(serverMappings, not(hasItem(WireMatchers.stubMappingWithUrl(\"/but-not-this\"))));\n  }\n\n  public static class TestParameterisedTransformer extends StubMappingTransformer {\n\n    @Override\n    public StubMapping transform(StubMapping stubMapping, FileSource files, Parameters parameters) {\n      ResponseDefinition newResponse =\n          ResponseDefinitionBuilder.like(stubMapping.getResponse())\n              .but()\n              .withHeader(parameters.getString(\"headerKey\"), parameters.getString(\"headerValue\"))\n              .build();\n      return stubMapping.transform(b -> b.setResponse(newResponse));\n    }\n\n    @Override\n    public boolean applyGlobally() {\n      return false;\n    }\n\n    @Override\n    public String getName() {\n      return \"test-transformer\";\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StandaloneAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.testsupport.Network.findFreePort;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static java.io.File.separator;\nimport static java.net.HttpURLConnection.HTTP_OK;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static java.nio.file.Files.createDirectories;\nimport static java.nio.file.Files.write;\nimport static java.util.Arrays.asList;\nimport static java.util.Objects.requireNonNull;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.fail;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.junit5.EnabledIfJettyVersion;\nimport com.github.tomakehurst.wiremock.standalone.MappingFileException;\nimport com.github.tomakehurst.wiremock.standalone.WireMockServerRunner;\nimport com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.*;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.function.Predicate;\nimport java.util.zip.GZIPInputStream;\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.TypeSafeMatcher;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.io.TempDir;\n\npublic class StandaloneAcceptanceTest extends AcceptanceTestBase {\n  private static final String FILES = \"__files\";\n  private static final String MAPPINGS = \"mappings\";\n\n  private WireMockServerRunner runner;\n  private WireMockTestClient testClient;\n\n  private WireMockServer otherServer;\n\n  private final PrintStream stdOut = System.out;\n  private ByteArrayOutputStream out;\n  private final PrintStream stdErr = System.err;\n  private ByteArrayOutputStream err;\n\n  @TempDir public Path tempFileRoot;\n  private File mappingsDirectory;\n  private File filesDirectory;\n\n  @BeforeEach\n  public void init() {\n    mappingsDirectory = tempFileRoot.resolve(MAPPINGS).toFile();\n    filesDirectory = tempFileRoot.resolve(FILES).toFile();\n    mappingsDirectory.mkdirs();\n    filesDirectory.mkdirs();\n\n    runner = new WireMockServerRunner();\n\n    WireMock.configure();\n  }\n\n  @AfterEach\n  public void stopServerRunner() {\n    runner.stop();\n    if (otherServer != null) {\n      otherServer.stop();\n    }\n    System.setOut(stdOut);\n    System.setErr(stdErr);\n  }\n\n  @Test\n  void acceptsMappingRequestOnDefaultPort() {\n    startRunner();\n    givenThat(\n        get(urlEqualTo(\"/standalone/test/resource\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"Content\")));\n    assertThat(testClient.get(\"/standalone/test/resource\").content(), is(\"Content\"));\n  }\n\n  private static final String MAPPING_REQUEST =\n      \"{ \t\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\\\"request\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"url\\\": \\\"/resource/from/file\\\"\t\t\t\\n\"\n          + \"\t},\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\\\"response\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"status\\\": 200,\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"body\\\": \\\"Body from mapping file\\\"\t\t\\n\"\n          + \"\t}\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"}\t\t\t\t\t\t\t\t\t\t\t\t\t\";\n\n  @Test\n  void readsMappingFromMappingsDir() {\n    writeMappingFile(\"test-mapping-1.json\", MAPPING_REQUEST);\n    startRunner();\n    assertThat(testClient.get(\"/resource/from/file\").content(), is(\"Body from mapping file\"));\n  }\n\n  @Test\n  void readsQueryMappingFromMappingsDir() {\n    writeMappingFile(\"test-mapping-1.json\", MAPPING_REQUEST.replace(\"GET\", \"QUERY\"));\n    startRunner();\n    assertThat(testClient.query(\"/resource/from/file\").content(), is(\"Body from mapping file\"));\n  }\n\n  @Test\n  void readsMappingFromSpecifiedRecordingsPath() {\n    String differentRoot = tempFileRoot + separator + \"differentRoot\";\n    writeFile(differentRoot + separator + underMappings(\"test-mapping-1.json\"), MAPPING_REQUEST);\n    startRunner(\"--root-dir\", differentRoot);\n    assertThat(testClient.get(\"/resource/from/file\").content(), is(\"Body from mapping file\"));\n  }\n\n  @Test\n  void servesFileFromFilesDir() {\n    writeFileToFilesDir(\"test-1.xml\", \"<content>Blah</content>\");\n    startRunner();\n    WireMockResponse response = testClient.get(\"/test-1.xml\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"<content>Blah</content>\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/xml\"));\n  }\n\n  @Test\n  void servesFileFromSpecifiedRecordingsPath() {\n    String differentRoot = tempFileRoot.toString() + separator + \"differentRoot\";\n    writeFile(differentRoot + separator + underFiles(\"test-1.xml\"), \"<content>Blah</content>\");\n    startRunner(\"--root-dir\", differentRoot);\n    WireMockResponse response = testClient.get(\"/test-1.xml\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"<content>Blah</content>\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/xml\"));\n  }\n\n  @Test\n  void servesFileAsJsonWhenNoFileExtension() {\n    writeFileToFilesDir(\"json/12345\", \"{ \\\"key\\\": \\\"value\\\" }\");\n    startRunner();\n    WireMockResponse response = testClient.get(\"/json/12345\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"{ \\\"key\\\": \\\"value\\\" }\"));\n    // The \"Content-Type\" header may include charset, fe \"application/json;charset=utf-8\"\n    assertThat(response.firstHeader(\"Content-Type\"), startsWith(\"application/json\"));\n  }\n\n  @Test\n  void servesTheSwaggerUi() {\n    startRunner();\n\n    WireMockResponse response = testClient.get(\"/__admin/swagger-ui/\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Content-Type\"), startsWith(\"text/html\"));\n    assertThat(\n        response.content(), containsString(\"<title>WireMock Admin API | Swagger UI</title>\"));\n\n    response = testClient.get(\"/__admin/swagger-ui/swagger-ui-dist/swagger-ui-bundle.js\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Content-Type\"), startsWith(\"text/javascript\"));\n  }\n\n  @Test\n  void servesTheRecordingUi() {\n    startRunner();\n\n    WireMockResponse response = testClient.get(\"/__admin/recorder/\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Content-Type\"), startsWith(\"text/html\"));\n    assertThat(response.content(), containsString(\"<title>WireMock Recorder</title>\"));\n\n    response = testClient.get(\"/__admin/recorder/lib/jquery-3.6.0.min.js\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Content-Type\"), startsWith(\"text/javascript\"));\n  }\n\n  @Test\n  void servesTheAdminApi() {\n    startRunner();\n\n    WireMockResponse response = testClient.get(\"/__admin/mappings\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Content-Type\"), startsWith(\"application/json\"));\n    assertThat(response.content(), containsString(\"mappings\"));\n  }\n\n  @EnabledIfJettyVersion(\n      major = 11,\n      reason =\n          \"Jetty 12 and above always redirects when folder (without trailing slash) is accessed\")\n  @Test\n  void shouldNotSend302WhenPathIsDirAndTrailingSlashNotPresent() {\n    writeFileToFilesDir(\n        \"json/wire & mock directory/index.json\", \"{ \\\"key\\\": \\\"index page value\\\" }\");\n    startRunner();\n    WireMockResponse response = testClient.get(\"/json/wire%20&%20mock%20directory\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"{ \\\"key\\\": \\\"index page value\\\" }\"));\n  }\n\n  @EnabledIfJettyVersion(\n      major = 12,\n      reason =\n          \"Jetty 12 and above always redirects when folder (without trailing slash) is accessed\")\n  @Test\n  public void shouldSend302WhenPathIsDirAndTrailingSlashNotPresent() {\n    writeFileToFilesDir(\n        \"json/wire & mock directory/index.json\", \"{ \\\"key\\\": \\\"index page value\\\" }\");\n    startRunner();\n    WireMockResponse response = testClient.get(\"/json/wire%20&%20mock%20directory\");\n    assertThat(response.statusCode(), is(302));\n  }\n\n  @Test\n  void servesJsonIndexFileWhenTrailingSlashPresent() {\n    writeFileToFilesDir(\"json/23456/index.json\", \"{ \\\"key\\\": \\\"new value\\\" }\");\n    startRunner();\n    WireMockResponse response = testClient.get(\"/json/23456/\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"{ \\\"key\\\": \\\"new value\\\" }\"));\n    // The \"Content-Type\" header may include charset, fe \"application/json;charset=utf-8\"\n    assertThat(response.firstHeader(\"Content-Type\"), startsWith(\"application/json\"));\n  }\n\n  @Test\n  void servesXmlIndexFileWhenTrailingSlashPresent() {\n    writeFileToFilesDir(\"json/34567/index.xml\", \"<blob>BLAB</blob>\");\n    startRunner();\n    WireMockResponse response = testClient.get(\"/json/34567/\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"<blob>BLAB</blob>\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/xml\"));\n  }\n\n  @Test\n  void doesNotServeFileFromFilesDirWhenNotGET() {\n    writeFileToFilesDir(\"json/should-not-see-this.json\", \"{}\");\n    startRunner();\n    WireMockResponse response = testClient.put(\"/json/should-not-see-this.json\");\n    assertThat(\n        response.statusCode(), is(404)); // Default servlet returns 405 if PUT is forwarded to it\n  }\n\n  private static final String BODY_FILE_MAPPING_REQUEST =\n      \"{ \t\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\\\"request\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"url\\\": \\\"/body/file\\\"\t\t\t\t\t\t\\n\"\n          + \"\t},\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\\\"response\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"status\\\": 200,\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"bodyFileName\\\": \\\"body-test.xml\\\"\t\t\t\\n\"\n          + \"\t}\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"}\t\t\t\t\t\t\t\t\t\t\t\t\t\";\n\n  @Test\n  public void readsBodyFileFromFilesDir() {\n    writeMappingFile(\"test-mapping-2.json\", BODY_FILE_MAPPING_REQUEST);\n    writeFileToFilesDir(\"body-test.xml\", \"<body>Content</body>\");\n    startRunner();\n    assertThat(testClient.get(\"/body/file\").content(), is(\"<body>Content</body>\"));\n  }\n\n  @Test\n  public void readsBinaryBodyFileFromFilesDir() {\n    writeMappingFile(\"test-mapping-2.json\", BODY_FILE_MAPPING_REQUEST);\n    writeFileToFilesDir(\"body-test.xml\", MappingJsonSamples.BINARY_COMPRESSED_CONTENT);\n    startRunner();\n    byte[] returnedContent = testClient.get(\"/body/file\").binaryContent();\n    assertThat(returnedContent, is(MappingJsonSamples.BINARY_COMPRESSED_CONTENT));\n    assertThat(\n        decompress(returnedContent), is(MappingJsonSamples.BINARY_COMPRESSED_CONTENT_AS_STRING));\n  }\n\n  @Test\n  public void logsVerboselyWhenVerboseSetInCommandLine() {\n    startRecordingSystemOutAndErr();\n    startRunner(\"--verbose\");\n    assertThat(systemOutText(), containsString(\"Verbose logging enabled\"));\n  }\n\n  @Test\n  public void doesNotLogVerboselyWhenVerboseNotSetInCommandLine() {\n    startRecordingSystemOutAndErr();\n    startRunner();\n    assertThat(systemOutText(), not(containsString(\"Verbose logging enabled\")));\n  }\n\n  @Test\n  public void startsOnPortSpecifiedOnCommandLine() {\n    int port = findFreePort();\n    startRunner(\"--port\", \"\" + port);\n    WireMock client = WireMock.create().host(\"localhost\").port(port).build();\n    client.verifyThat(\n        0,\n        getRequestedFor(\n            urlEqualTo(\"/bling/blang/blong\"))); // Would throw an exception if couldn't connect\n  }\n\n  @Test\n  void proxiesToHostSpecifiedOnCommandLine() {\n    WireMock otherServerClient = startOtherServerAndClient();\n    otherServerClient.register(\n        get(urlEqualTo(\"/proxy/ok?working=yes\")).willReturn(aResponse().withStatus(HTTP_OK)));\n    startRunner(\"--proxy-all\", \"http://localhost:\" + otherServer.port());\n\n    WireMockResponse response = testClient.get(\"/proxy/ok?working=yes\");\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void respondsWithPreExistingRecordingInProxyMode() {\n    writeMappingFile(\"test-mapping-2.json\", BODY_FILE_MAPPING_REQUEST);\n    writeFileToFilesDir(\"body-test.xml\", \"Existing recorded body\");\n\n    WireMock otherServerClient = startOtherServerAndClient();\n    otherServerClient.register(\n        get(urlEqualTo(\"/body/file\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBody(\"Proxied body\")));\n\n    startRunner(\"--proxy-all\", \"http://localhost:\" + otherServer.port());\n\n    assertThat(testClient.get(\"/body/file\").content(), is(\"Existing recorded body\"));\n  }\n\n  @Test\n  void recordsProxiedRequestsWhenSpecifiedOnCommandLine() throws Exception {\n    WireMock otherServerClient = startOtherServerAndClient();\n    startRunner(\"--record-mappings\");\n    givenThat(\n        get(urlEqualTo(\"/please/record-this\"))\n            .willReturn(aResponse().proxiedFrom(\"http://localhost:\" + otherServer.port())));\n    otherServerClient.register(\n        get(urlEqualTo(\"/please/record-this\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBody(\"Proxied body\")));\n\n    testClient.get(\"/please/record-this\");\n\n    stopRunner();\n\n    assertThat(mappingsDirectory, containsAFileContaining(\"/please/record-this\"));\n    assertThat(\n        contentsOfFirstFileNamedLike(\"please_record-this\"),\n        containsString(\"bodyFileName\\\" : \\\"please_record-this\"));\n  }\n\n  @Test\n  void recordsRequestHeadersWhenSpecifiedOnCommandLineViaLegacyRecorder() throws Exception {\n    WireMock otherServerClient = startOtherServerAndClient();\n    startRunner(\"--record-mappings\", \"--match-headers\", \"Accept\");\n    givenThat(\n        get(urlEqualTo(\"/please/record-headers\"))\n            .willReturn(aResponse().proxiedFrom(\"http://localhost:\" + otherServer.port())));\n    otherServerClient.register(\n        get(urlEqualTo(\"/please/record-headers\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBody(\"Proxied body\")));\n\n    testClient.get(\"/please/record-headers\", withHeader(\"accept\", \"application/json\"));\n\n    stopRunner();\n\n    assertThat(mappingsDirectory, containsAFileContaining(\"/please/record-headers\"));\n    assertThat(\n        contentsOfFirstFileNamedLike(\"please_record-headers\"), containsString(\"\\\"Accept\\\" : {\"));\n  }\n\n  @Test\n  void recordsGzippedResponseBodiesDecompressedViaCLI() {\n    WireMock otherServerClient = startOtherServerAndClient();\n    startRunner(\"--record-mappings\");\n    givenThat(\n        get(urlEqualTo(\"/record-zip\"))\n            .willReturn(aResponse().proxiedFrom(\"http://localhost:\" + otherServer.port())));\n    otherServerClient.register(\n        get(urlEqualTo(\"/record-zip\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBody(\"gzipped body\")));\n\n    testClient.get(\"/record-zip\", withHeader(\"Accept-Encoding\", \"gzip,deflate\"));\n\n    stopRunner();\n\n    assertThat(mappingsDirectory, containsAFileContaining(\"/record-zip\"));\n    assertThat(filesDirectory, containsAFileContaining(\"gzipped body\"));\n  }\n\n  @Test\n  void recordsGzippedResponseBodiesDecompressedViaNewRecorder(@TempDir Path tempFileRoot) {\n    WireMock target = startOtherServerAndClient();\n\n    startRunner(\"--root-dir\", tempFileRoot.toString());\n\n    target.register(get(\"/record-this\").willReturn(ok(\"Recorded\")));\n\n    startRecording(otherServer.baseUrl());\n    testClient.get(\"/record-this\");\n    stopRecording();\n\n    assertThat(\n        Arrays.stream(requireNonNull(tempFileRoot.resolve(\"mappings\").toFile().list()))\n            .filter(name -> name.contains(\"record-this\"))\n            .findFirst()\n            .orElse(\"\"),\n        endsWith(\".json\"));\n  }\n\n  @Test\n  void matchesVeryLongHeader() {\n    startRunner(\"--jetty-header-buffer-size\", \"32678\");\n\n    String veryLongHeader = padRight(\"\", 16336).replace(' ', 'h');\n    givenThat(\n        get(urlEqualTo(\"/some/big/header\"))\n            .withHeader(\"ExpectedHeader\", equalTo(veryLongHeader))\n            .willReturn(aResponse().withStatus(200)));\n\n    WireMockResponse response =\n        testClient.get(\"/some/big/header\", withHeader(\"ExpectedHeader\", veryLongHeader));\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void performsBrowserProxyingWhenEnabled() {\n    WireMock otherServerClient = startOtherServerAndClient();\n    startRunner(\"--enable-browser-proxying\");\n    otherServerClient.register(\n        get(urlEqualTo(\"/from/browser/proxy\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBody(\"Proxied body\")));\n\n    assertThat(\n        testClient\n            .getViaProxy(\"http://localhost:\" + otherServer.port() + \"/from/browser/proxy\")\n            .content(),\n        is(\"Proxied body\"));\n  }\n\n  @Test\n  void doesNotRecordRequestWhenNotProxied() {\n    startRunner(\"--record-mappings\");\n    testClient.get(\"/try-to/record-this\");\n    assertThat(mappingsDirectory, doesNotContainAFileWithNameContaining(\"try-to-record\"));\n  }\n\n  @Test\n  void doesNotRecordRequestWhenAlreadySeen() {\n    WireMock otherServerClient = startOtherServerAndClient();\n    startRunner(\"--record-mappings\");\n    givenThat(\n        get(urlEqualTo(\"/try-to/record-this\"))\n            .willReturn(aResponse().proxiedFrom(\"http://localhost:\" + otherServer.port())));\n    otherServerClient.register(\n        get(urlEqualTo(\"/try-to/record-this\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBody(\"Proxied body\")));\n\n    testClient.get(\"/try-to/record-this\");\n    testClient.get(\"/try-to/record-this\");\n\n    stopRunner();\n\n    assertThat(mappingsDirectory, containsExactlyOneFileWithNameContaining(\"try-to_record-this\"));\n  }\n\n  @Test\n  void canBeShutDownRemotely() {\n    startRunner();\n\n    WireMock.shutdownServer();\n\n    // Keep trying the server until it shuts down.\n    long startTime = System.currentTimeMillis();\n    while (System.currentTimeMillis() - startTime < 5000) {\n      if (!runner.isRunning()) {\n        return;\n      }\n    }\n    fail(\"WireMock did not shut down\");\n  }\n\n  @Test\n  void canBeShutDownRemotelyWhenAsyncResponsesEnabled() {\n    startRunner(\"--async-response-enabled\");\n\n    stubFor(get(\"/delay-this\").willReturn(ok().withFixedDelay(50)));\n    testClient.get(\"/delay-this\");\n    testClient.get(\"/delay-this\");\n    testClient.get(\"/delay-this\");\n\n    WireMock.shutdownServer();\n\n    // Keep trying the server until it shuts down.\n    long startTime = System.currentTimeMillis();\n    while (System.currentTimeMillis() - startTime < 5000) {\n      if (!runner.isRunning()) {\n        return;\n      }\n    }\n    fail(\"WireMock did not shut down\");\n  }\n\n  @Test\n  void isRunningReturnsFalseBeforeRunMethodIsExecuted() {\n    runner = new WireMockServerRunner();\n    assertThat(runner.isRunning(), is(false));\n  }\n\n  private static final String BAD_MAPPING =\n      \"{ \t\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\\\"requesttttt\\\": {      \t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"url\\\": \\\"/resource/from/file\\\"\t\t\t\\n\"\n          + \"\t},\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\\\"response\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"status\\\": 200,\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"body\\\": \\\"Body from mapping file\\\"\t\t\\n\"\n          + \"\t}\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"}\t\t\t\t\t\t\t\t\t\t\t\t\t\";\n\n  @Test\n  void failsWithUsefulErrorMessageWhenMappingFileIsInvalid() {\n    writeMappingFile(\"bad-mapping.json\", BAD_MAPPING);\n\n    MappingFileException exception = assertThrows(MappingFileException.class, this::startRunner);\n    assertThat(\n        exception.getMessage(),\n        allOf(\n            containsString(\"Error loading file\"),\n            containsString(\"bad-mapping.json\"),\n            containsString(\"Unrecognized field \\\"requesttttt\\\"\"),\n            containsString(\"class com.github.tomakehurst.wiremock.stubbing.StubMapping\"),\n            containsString(\"not marked as ignorable\")));\n  }\n\n  @Test\n  void savesMappingFileOnCreationOfPersistentStub() {\n    startRunner();\n\n    stubFor(\n        get(urlPathEqualTo(\"/one/two/three\"))\n            .withName(\"Named stuff here __$$ things!\")\n            .persistent()\n            .willReturn(ok()));\n\n    assertThat(mappingsDirectory, containsExactlyOneFileWithNameContaining(\"named-stuff-here\"));\n  }\n\n  private String contentsOfFirstFileNamedLike(String namePart) throws IOException {\n    return Files.readString(\n        requireNonNull(firstFileWithNameLike(mappingsDirectory, namePart)).toPath());\n  }\n\n  private File firstFileWithNameLike(File directory, String namePart) {\n    for (File file : requireNonNull(directory.listFiles(namedLike(namePart)))) {\n      return file;\n    }\n\n    fail(\n        String.format(\n            \"Couldn't find a file under %s named like %s\", directory.getPath(), namePart));\n    return null;\n  }\n\n  private FilenameFilter namedLike(final String namePart) {\n    return (file, name) -> name.contains(namePart);\n  }\n\n  private WireMock startOtherServerAndClient() {\n    otherServer = new WireMockServer(Options.DYNAMIC_PORT);\n    otherServer.start();\n    return WireMock.create().port(otherServer.port()).build();\n  }\n\n  private void writeFileToFilesDir(String name, String contents) {\n    writeFile(underFileSourceRoot(underFiles(name)), contents);\n  }\n\n  private void writeFileToFilesDir(String name, byte[] contents) {\n    try {\n      String filePath = underFileSourceRoot(underFiles(name));\n      Path file = Paths.get(filePath);\n      createDirectories(file.getParent());\n      write(file, contents);\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private void writeMappingFile(String name, String contents) {\n    writeFile(underFileSourceRoot(underMappings(name)), contents);\n  }\n\n  private void writeFile(String absolutePath, String contents) {\n    try {\n      Path file = Paths.get(absolutePath);\n      createDirectories(file.getParent());\n      write(file, contents.getBytes(UTF_8));\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private String underFiles(String name) {\n    return FILES + separator + name;\n  }\n\n  private String underMappings(String name) {\n    return MAPPINGS + separator + name;\n  }\n\n  private String underFileSourceRoot(String relativePath) {\n    return tempFileRoot + separator + relativePath;\n  }\n\n  private void startRunner(String... args) {\n    runner = new WireMockServerRunner();\n    runner.run(argsWithPort(argsWithRecordingsPath(args)));\n\n    int port = runner.port();\n    testClient = new WireMockTestClient(port);\n    WireMock.configureFor(port);\n  }\n\n  private void stopRunner() {\n    runner.stop();\n  }\n\n  private String[] argsWithRecordingsPath(String[] args) {\n    List<String> argsAsList = new ArrayList<>(asList(args));\n    if (!argsAsList.contains(\"--root-dir\")) {\n      argsAsList.addAll(asList(\"--root-dir\", tempFileRoot.toFile().getAbsolutePath()));\n    }\n    return argsAsList.toArray(new String[] {});\n  }\n\n  private String[] argsWithPort(String[] args) {\n    List<String> argsAsList = new ArrayList<>(asList(args));\n    if (!argsAsList.contains(\"--port\")) {\n      argsAsList.addAll(asList(\"--port\", \"\" + Options.DYNAMIC_PORT));\n    }\n    return argsAsList.toArray(new String[] {});\n  }\n\n  private void startRecordingSystemOutAndErr() {\n    out = new ByteArrayOutputStream();\n    err = new ByteArrayOutputStream();\n\n    System.setOut(new PrintStream(out));\n    System.setErr(new PrintStream(err));\n  }\n\n  private String systemOutText() {\n    return out.toString();\n  }\n\n  private String systemErrText() {\n    return err.toString();\n  }\n\n  private Matcher<File> containsAFileContaining(final String expectedContents) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"a file containing \" + expectedContents);\n      }\n\n      @Override\n      public boolean matchesSafely(File dir) {\n        for (File file : requireNonNull(dir.listFiles())) {\n          try {\n            if (Files.readString(file.toPath()).contains(expectedContents)) {\n              return true;\n            }\n          } catch (IOException e) {\n            throw new RuntimeException(e);\n          }\n        }\n\n        return false;\n      }\n\n      @Override\n      protected void describeMismatchSafely(File dir, Description mismatchDescription) {\n        mismatchDescription\n            .appendText(\"directory contents were: \")\n            .appendValue(Arrays.toString(requireNonNull(dir.list())));\n      }\n    };\n  }\n\n  private Matcher<File> doesNotContainAFileWithNameContaining(final String namePart) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"no file named like \" + namePart);\n      }\n\n      @Override\n      public boolean matchesSafely(File dir) {\n        return Arrays.stream(requireNonNull(dir.list())).noneMatch(contains(namePart));\n      }\n\n      @Override\n      protected void describeMismatchSafely(File dir, Description mismatchDescription) {\n        mismatchDescription\n            .appendText(\"directory contents were: \")\n            .appendValue(Arrays.toString(requireNonNull(dir.list())));\n      }\n    };\n  }\n\n  private Matcher<File> containsExactlyOneFileWithNameContaining(final String namePart) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"exactly one file named like \" + namePart);\n      }\n\n      @Override\n      public boolean matchesSafely(File dir) {\n        return (int) Arrays.stream(requireNonNull(dir.list())).filter(contains(namePart)).count()\n            == 1;\n      }\n\n      @Override\n      protected void describeMismatchSafely(File dir, Description mismatchDescription) {\n        mismatchDescription\n            .appendText(\"directory contents were: \")\n            .appendValue(Arrays.toString(requireNonNull(dir.list())));\n      }\n    };\n  }\n\n  private static Predicate<String> contains(final String part) {\n    return s -> s.contains(part);\n  }\n\n  /**\n   * Decompress the binary gzipped content into a String.\n   *\n   * @param content the gzipped content to decompress\n   * @return decompressed String.\n   */\n  private String decompress(byte[] content) {\n    GZIPInputStream gin = null;\n    try {\n      gin = new GZIPInputStream(new ByteArrayInputStream(content));\n      ByteArrayOutputStream baos = new ByteArrayOutputStream();\n\n      byte[] buf = new byte[8192];\n\n      int read;\n      while ((read = gin.read(buf)) != -1) {\n        baos.write(buf, 0, read);\n      }\n\n      return baos.toString(UTF_8);\n\n    } catch (IOException e) {\n      return null;\n    } finally {\n      if (gin != null)\n        try {\n          gin.close();\n        } catch (IOException ignored) {\n          // ignored\n        }\n    }\n  }\n\n  public static String padRight(String s, int paddingLength) {\n    return String.format(\"%1$-\" + paddingLength + \"s\", s);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StubImportAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2019-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.stubbing.StubImport.stubImport;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.stubMappingWithUrl;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItem;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.UUID;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\n\npublic class StubImportAcceptanceTest extends AcceptanceTestBase {\n\n  private static Admin admin;\n\n  @BeforeAll\n  public static void setup() {\n    admin = wireMockServer;\n  }\n\n  @Test\n  public void importsAllStubsWhenNoneAreAlreadyPresent() {\n    admin.importStubs(\n        stubImport()\n            .stub(get(\"/one\").willReturn(ok()))\n            .stub(post(\"/two\").willReturn(ok()))\n            .stub(put(\"/three\").willReturn(ok()))\n            .build());\n\n    List<StubMapping> stubs = admin.listAllStubMappings().getMappings();\n\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/one\")));\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/two\")));\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/three\")));\n  }\n\n  @Test\n  public void overwritesExistingStubsByDefault() {\n    UUID id1 = UUID.randomUUID();\n    wm.stubFor(get(\"/one\").withId(id1).willReturn(ok(\"Original\")));\n\n    admin.importStubs(\n        stubImport()\n            .stub(get(\"/one\").withId(id1).willReturn(ok(\"Updated\")))\n            .stub(post(\"/two\").willReturn(ok()))\n            .stub(put(\"/three\").willReturn(ok()))\n            .build());\n\n    List<StubMapping> stubs = admin.listAllStubMappings().getMappings();\n    assertThat(stubs.size(), is(3));\n    assertThat(stubs.get(2).getResponse().getBody(), is(\"Updated\"));\n  }\n\n  @Test\n  public void ignoresExistingStubsIfConfigured() {\n    UUID id1 = UUID.randomUUID();\n    wm.stubFor(get(\"/one\").withId(id1).willReturn(ok(\"Original\")));\n\n    WireMock wireMock = new WireMock(wireMockServer.port());\n    wireMock.importStubMappings(\n        stubImport()\n            .stub(get(\"/one\").withId(id1).willReturn(ok(\"Updated\")))\n            .stub(post(\"/two\").willReturn(ok()))\n            .stub(put(\"/three\").willReturn(ok()))\n            .ignoreExisting());\n\n    List<StubMapping> stubs = admin.listAllStubMappings().getMappings();\n    assertThat(stubs.size(), is(3));\n    assertThat(stubs.get(2).getResponse().getBody(), is(\"Original\"));\n  }\n\n  @Test\n  public void deletesStubsNotInImportIfConfigured() {\n    UUID id1 = UUID.randomUUID();\n    wm.stubFor(get(\"/one\").withId(id1).willReturn(ok(\"Original\")));\n    wm.stubFor(get(\"/four\").willReturn(ok()));\n    wm.stubFor(get(\"/five\").willReturn(ok()));\n\n    WireMock.importStubs(\n        stubImport()\n            .stub(get(\"/one\").withId(id1).willReturn(ok(\"Updated\")))\n            .stub(post(\"/two\").willReturn(ok()))\n            .stub(put(\"/three\").willReturn(ok()))\n            .deleteAllExistingStubsNotInImport());\n\n    List<StubMapping> stubs = admin.listAllStubMappings().getMappings();\n    assertThat(stubs.size(), is(3));\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/one\")));\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/two\")));\n    assertThat(stubs, hasItem(stubMappingWithUrl(\"/three\")));\n    assertThat(stubs.get(2).getResponse().getBody(), is(\"Updated\"));\n  }\n\n  @Test\n  public void doesNotDeleteStubsNotInImportIfNotConfigured() {\n    UUID id1 = UUID.randomUUID();\n    wm.stubFor(get(\"/one\").withId(id1).willReturn(ok(\"Original\")));\n    wm.stubFor(get(\"/four\").willReturn(ok()));\n    wm.stubFor(get(\"/five\").willReturn(ok()));\n\n    WireMock.importStubs(\n        stubImport()\n            .stub(get(\"/one\").withId(id1).willReturn(ok(\"Updated\")))\n            .stub(post(\"/two\").willReturn(ok()))\n            .stub(put(\"/three\").willReturn(ok()))\n            .overwriteExisting()\n            .doNotDeleteExistingStubs());\n\n    List<StubMapping> stubs = admin.listAllStubMappings().getMappings();\n    assertThat(stubs.size(), is(5));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StubImportPeristenceAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.stubbing.StubImport.stubImport;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.IS_PERSISTENT;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.everyItem;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport.Options;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport.Options.DuplicatePolicy;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.UUID;\nimport org.jspecify.annotations.NullMarked;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.junit.jupiter.api.io.TempDir;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.CsvSource;\n\npublic class StubImportPeristenceAcceptanceTest {\n\n  public static final StubLifecycleListener PERSISTENT_SETTING_LISTENER =\n      new StubLifecycleListener() {\n\n        @Override\n        @NullMarked\n        public StubMapping beforeStubCreated(StubMapping stub) {\n          return stub.transform(b -> b.setPersistent(true));\n        }\n\n        @Override\n        @NullMarked\n        public StubMapping beforeStubEdited(StubMapping oldStub, StubMapping newStub) {\n          return newStub.transform(b -> b.setPersistent(true));\n        }\n\n        @Override\n        public String getName() {\n          return \"persist-flag-setter\";\n        }\n      };\n\n  @TempDir public static Path tempDir;\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(\n              wireMockConfig()\n                  .dynamicPort()\n                  .withRootDirectory(tempDir.toAbsolutePath().toString())\n                  .extensions(PERSISTENT_SETTING_LISTENER))\n          .build();\n\n  @ParameterizedTest\n  @CsvSource({\"false\", \"true\"})\n  void persistsStubsWhenPersistenceFlagSetByListener(boolean deleteExistingStubs) {\n    StubMapping existingStub1 = wm.stubFor(get(\"/1\").willReturn(ok()));\n    UUID stub2Id = UUID.randomUUID();\n    UUID stub3Id = UUID.randomUUID();\n\n    wm.importStubs(\n        new StubImport(\n            List.of(\n                get(\"/one\").withId(existingStub1.getId()).willReturn(ok()).build(),\n                post(\"/two\").withId(stub2Id).willReturn(ok()).build(),\n                put(\"/three\").withId(stub3Id).willReturn(ok()).build()),\n            new Options(DuplicatePolicy.OVERWRITE, deleteExistingStubs)));\n\n    wm.resetToDefaultMappings();\n    List<StubMapping> stubs = wm.listAllStubMappings().getMappings();\n    assertThat(stubs.size(), is(3));\n    assertThat(stubs, everyItem(IS_PERSISTENT));\n\n    wm.importStubs(\n        stubImport().stub(post(\"/two\").withId(stub2Id).willReturn(ok(\"Updated\"))).build());\n\n    wm.resetToDefaultMappings();\n    assertThat(wm.getStubMapping(stub2Id).getItem().getResponse().getBody(), is(\"Updated\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StubLifecycleListenerAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2019-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.contains;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.junit.jupiter.api.Assertions.fail;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.clearInvocations;\nimport static org.mockito.Mockito.doCallRealMethod;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.verify;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.NotPermittedException;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener.AlteredStubMapping;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener.StubMappingToAlter;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.stubbing.AbstractStubMappings.CreateStubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.AbstractStubMappings.EditStubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.AbstractStubMappings.RemoveStubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport.Options;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport.Options.DuplicatePolicy;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.io.File;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.UUID;\nimport org.hamcrest.Matchers;\nimport org.jspecify.annotations.NullMarked;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.junit.jupiter.api.io.TempDir;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.CsvSource;\nimport org.mockito.ArgumentCaptor;\n\npublic class StubLifecycleListenerAcceptanceTest {\n\n  TestStubLifecycleListener loggingListener = new TestStubLifecycleListener();\n  ExceptionThrowingStubLifecycleListener exceptionThrowingListener =\n      new ExceptionThrowingStubLifecycleListener();\n  StubLifecycleListener mockListener = mock();\n\n  @TempDir public static File tempDir;\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .withRootDirectory(tempDir.getAbsolutePath())\n                  .extensions(loggingListener, exceptionThrowingListener, mockListener))\n          .build();\n\n  @BeforeEach\n  public void init() {\n    loggingListener.events.clear();\n    exceptionThrowingListener.throwException = false;\n    doCallRealMethod().when(mockListener).beforeStubCreated(any());\n    doCallRealMethod().when(mockListener).beforeStubEdited(any(), any());\n  }\n\n  @Test\n  public void beforeAndAfterMethodsAreCalledForStubCreation() {\n    wm.stubFor(get(\"/test\").withName(\"Created\").willReturn(ok()));\n    assertThat(loggingListener.events.get(0), is(\"beforeStubCreated, name: Created\"));\n    assertThat(loggingListener.events.get(1), is(\"afterStubCreated, name: Created\"));\n  }\n\n  @Test\n  public void beforeAndAfterMethodsAreCalledForStubEdit() {\n    UUID id = UUID.randomUUID();\n    wm.stubFor(get(\"/test\").withId(id).withName(\"Created\").willReturn(ok()));\n    wm.editStub(get(\"/test\").withId(id).withName(\"Edited\").willReturn(ok()));\n    assertThat(\n        loggingListener.events.get(2), is(\"beforeStubEdited, old name: Created, new name: Edited\"));\n    assertThat(\n        loggingListener.events.get(3), is(\"afterStubEdited, old name: Created, new name: Edited\"));\n  }\n\n  @Test\n  public void beforeAndAfterMethodsAreCalledForStubRemove() {\n    StubMapping stub = wm.stubFor(get(\"/test\").withName(\"To remove\").willReturn(ok()));\n    wm.removeStub(stub);\n    assertThat(loggingListener.events.get(2), is(\"beforeStubRemoved, name: To remove\"));\n    assertThat(loggingListener.events.get(3), is(\"afterStubRemoved, name: To remove\"));\n  }\n\n  @Test\n  public void beforeAndAfterMethodsAreCalledForStubsReset() {\n    wm.stubFor(get(\"/test\").withName(\"To remove\").willReturn(ok()));\n    wm.resetMappings();\n    assertThat(loggingListener.events.get(2), is(\"beforeStubsReset\"));\n    assertThat(loggingListener.events.get(3), is(\"afterStubsReset\"));\n  }\n\n  @Test\n  public void stubCreationCanBeVetoedWhenExceptionIsThrown() {\n    exceptionThrowingListener.throwException = true;\n\n    assertTrue(wm.listAllStubMappings().getMappings().isEmpty());\n\n    try {\n      wm.stubFor(get(\"/test\").withName(\"Created\").willReturn(ok()));\n      fail(\"Expected an exception to be thrown\");\n    } catch (Exception e) {\n      assertThat(e, Matchers.instanceOf(NotPermittedException.class));\n    }\n\n    assertTrue(wm.listAllStubMappings().getMappings().isEmpty());\n  }\n\n  @Test\n  public void sensibleExceptionIsThrownWhenRemoteAndExceptionThrownFromListener() {\n    WireMock wmRemote = new WireMock(wm.getPort());\n    exceptionThrowingListener.throwException = true;\n\n    try {\n      wmRemote.register(get(\"/test\").withName(\"Created\").willReturn(ok()));\n      fail(\"Expected an exception to be thrown\");\n    } catch (Exception e) {\n      assertThat(e, Matchers.<Exception>instanceOf(NotPermittedException.class));\n      assertThat(((NotPermittedException) e).getErrors().first().getTitle(), is(\"quota exhausted\"));\n    }\n  }\n\n  @Test\n  void insertionIndexIsSetOnStubsByTheTimeTheyArePassedToAfterStubCreated() {\n    wm.stubFor(get(\"/1\").willReturn(ok()));\n    wm.stubFor(get(\"/2\").willReturn(ok()));\n    wm.stubFor(get(\"/3\").willReturn(ok()));\n\n    assertThat(loggingListener.afterCreatedStubs.get(0).getInsertionIndex(), is(0L));\n    assertThat(loggingListener.afterCreatedStubs.get(1).getInsertionIndex(), is(1L));\n    assertThat(loggingListener.afterCreatedStubs.get(2).getInsertionIndex(), is(2L));\n  }\n\n  @Test\n  void defaultBatchMethodsCallIndividualStubMethods() {\n    var existingStub1 = get(\"/1\").withName(\"/1\").willReturn(ok()).build();\n    var existingStub2 = get(\"/2\").withName(\"/2\").willReturn(ok()).build();\n    var existingStub3 = get(\"/3\").withName(\"/3\").willReturn(ok()).build();\n    wm.importStubs(\n        StubImport.stubImport()\n            .stub(existingStub1)\n            .stub(existingStub2)\n            .stub(existingStub3)\n            .build());\n    loggingListener.events.clear();\n\n    var stub1 =\n        get(\"/1-updated\")\n            .withName(\"/1-updated\")\n            .withId(existingStub1.getId())\n            .willReturn(ok())\n            .build();\n    var stub2 =\n        get(\"/2-updated\")\n            .withName(\"/2-updated\")\n            .withId(existingStub2.getId())\n            .willReturn(ok())\n            .build();\n    var stub3 = get(\"/3-new\").withName(\"/3-new\").willReturn(ok()).build();\n    wm.importStubs(\n        StubImport.stubImport()\n            .stub(stub1)\n            .stub(stub2)\n            .stub(stub3)\n            .deleteAllExistingStubsNotInImport()\n            .build());\n\n    assertThat(\n        loggingListener.events,\n        contains(\n            \"beforeStubCreated, name: /3-new\",\n            \"beforeStubEdited, old name: /2, new name: /2-updated\",\n            \"beforeStubEdited, old name: /1, new name: /1-updated\",\n            \"beforeStubRemoved, name: /3\",\n            \"afterStubCreated, name: /3-new\",\n            \"afterStubEdited, old name: /2, new name: /2-updated\",\n            \"afterStubEdited, old name: /1, new name: /1-updated\",\n            \"afterStubRemoved, name: /3\"));\n  }\n\n  @Test\n  void batchMethodsAreCalledForImportOfNewStubs() {\n    var stub1 = get(\"/1\").willReturn(ok()).build();\n    var stub2 = get(\"/2\").willReturn(ok()).build();\n    var stub3 = get(\"/3\").willReturn(ok()).build();\n    wm.importStubs(StubImport.stubImport().stub(stub1).stub(stub2).stub(stub3).build());\n\n    verify(mockListener)\n        .beforeStubsAltered(\n            List.of(\n                new CreateStubMapping(stub3),\n                new CreateStubMapping(stub2),\n                new CreateStubMapping(stub1)));\n    verify(mockListener)\n        .afterStubsAltered(\n            List.of(\n                new CreateStubMapping(stub3),\n                new CreateStubMapping(stub2),\n                new CreateStubMapping(stub1)));\n  }\n\n  @Test\n  void batchMethodsAreCalledForImportsOfExistingAndNewStubs() {\n    var existingStub1 = get(\"/1\").willReturn(ok()).build();\n    var existingStub2 = get(\"/2\").willReturn(ok()).build();\n    var existingStub3 = get(\"/3\").willReturn(ok()).build();\n    wm.importStubs(\n        StubImport.stubImport()\n            .stub(existingStub1)\n            .stub(existingStub2)\n            .stub(existingStub3)\n            .build());\n    clearInvocations(mockListener);\n\n    var stub1 = get(\"/1-updated\").withId(existingStub1.getId()).willReturn(ok()).build();\n    var stub2 = get(\"/2-updated\").withId(existingStub2.getId()).willReturn(ok()).build();\n    var stub3 = get(\"/3-new\").willReturn(ok()).build();\n    wm.importStubs(StubImport.stubImport().stub(stub1).stub(stub2).stub(stub3).build());\n\n    verify(mockListener)\n        .beforeStubsAltered(\n            List.of(\n                new CreateStubMapping(stub3),\n                new EditStubMapping(existingStub2, stub2),\n                new EditStubMapping(existingStub1, stub1)));\n    verify(mockListener)\n        .afterStubsAltered(\n            List.of(\n                new CreateStubMapping(stub3),\n                new EditStubMapping(existingStub2, stub2),\n                new EditStubMapping(existingStub1, stub1)));\n  }\n\n  @Test\n  void batchMethodsAreCalledForImportsOfExistingAndNewAndRemovedStubs() {\n    var existingStub1 = get(\"/1\").willReturn(ok()).build();\n    var existingStub2 = get(\"/2\").willReturn(ok()).build();\n    var existingStub3 = get(\"/3\").willReturn(ok()).build();\n    wm.importStubs(\n        StubImport.stubImport()\n            .stub(existingStub1)\n            .stub(existingStub2)\n            .stub(existingStub3)\n            .build());\n    clearInvocations(mockListener);\n\n    var stub1 = get(\"/1-updated\").withId(existingStub1.getId()).willReturn(ok()).build();\n    var stub2 = get(\"/2-updated\").withId(existingStub2.getId()).willReturn(ok()).build();\n    var stub3 = get(\"/3-new\").willReturn(ok()).build();\n    wm.importStubs(\n        StubImport.stubImport()\n            .stub(stub1)\n            .stub(stub2)\n            .stub(stub3)\n            .deleteAllExistingStubsNotInImport()\n            .build());\n\n    verify(mockListener)\n        .beforeStubsAltered(\n            List.of(\n                new CreateStubMapping(stub3),\n                new EditStubMapping(existingStub2, stub2),\n                new EditStubMapping(existingStub1, stub1),\n                new RemoveStubMapping(existingStub3)));\n    verify(mockListener)\n        .afterStubsAltered(\n            List.of(\n                new CreateStubMapping(stub3),\n                new EditStubMapping(existingStub2, stub2),\n                new EditStubMapping(existingStub1, stub1),\n                new RemoveStubMapping(existingStub3)));\n  }\n\n  @Test\n  void batchMethodsAreNotCalledForIgnoredImportStubs() {\n    var existingStub1 = get(\"/1\").willReturn(ok()).build();\n    var existingStub2 = get(\"/2\").willReturn(ok()).build();\n    var existingStub3 = get(\"/3\").willReturn(ok()).build();\n    wm.importStubs(\n        StubImport.stubImport()\n            .stub(existingStub1)\n            .stub(existingStub2)\n            .stub(existingStub3)\n            .build());\n    clearInvocations(mockListener);\n\n    var stub1 = get(\"/1-updated\").withId(existingStub1.getId()).willReturn(ok()).build();\n    var stub2 = get(\"/2-updated\").withId(existingStub2.getId()).willReturn(ok()).build();\n    var stub3 = get(\"/3-new\").willReturn(ok()).build();\n    wm.importStubs(\n        StubImport.stubImport().stub(stub1).stub(stub2).stub(stub3).ignoreExisting().build());\n\n    verify(mockListener).beforeStubsAltered(List.of(new CreateStubMapping(stub3)));\n    verify(mockListener).afterStubsAltered(List.of(new CreateStubMapping(stub3)));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\"false\", \"true\"})\n  void alteredStubListCannotBeModifiedByListenersOnImport(boolean deleteExistingStubs) {\n    var existingStub1 = wm.stubFor(get(\"/1\").willReturn(ok()));\n    wm.stubFor(get(\"/2\").willReturn(ok()));\n\n    var stub1 = get(\"/1-updated\").withId(existingStub1.getId()).willReturn(ok()).build();\n    var stub2 = get(\"/2-new\").willReturn(ok()).build();\n    wm.importStubs(\n        new StubImport(\n            List.of(stub1, stub2), new Options(DuplicatePolicy.OVERWRITE, deleteExistingStubs)));\n\n    ArgumentCaptor<List<StubMappingToAlter>> beforeListCaptor = ArgumentCaptor.captor();\n    ArgumentCaptor<List<AlteredStubMapping>> afterListCaptor = ArgumentCaptor.captor();\n    verify(mockListener).beforeStubsAltered(beforeListCaptor.capture());\n    assertThrows(UnsupportedOperationException.class, () -> beforeListCaptor.getValue().remove(0));\n    verify(mockListener).afterStubsAltered(afterListCaptor.capture());\n    assertThrows(UnsupportedOperationException.class, () -> afterListCaptor.getValue().remove(0));\n  }\n\n  @Test\n  void alteredStubListCannotBeModifiedByListenersOnRemoval() {\n    var existingStub1 = wm.stubFor(get(\"/1\").willReturn(ok()));\n    var existingStub2 = wm.stubFor(get(\"/2\").willReturn(ok()));\n\n    wm.removeStubMappings(List.of(existingStub1, existingStub2));\n\n    ArgumentCaptor<List<StubMappingToAlter>> beforeListCaptor = ArgumentCaptor.captor();\n    ArgumentCaptor<List<AlteredStubMapping>> afterListCaptor = ArgumentCaptor.captor();\n    verify(mockListener).beforeStubsAltered(beforeListCaptor.capture());\n    assertThrows(UnsupportedOperationException.class, () -> beforeListCaptor.getValue().remove(0));\n    verify(mockListener).afterStubsAltered(afterListCaptor.capture());\n    assertThrows(UnsupportedOperationException.class, () -> afterListCaptor.getValue().remove(0));\n  }\n\n  @Test\n  void ignoredExistingStubsAreNotHandedToListenersWhenAllNonImportedStubsAreDeleted() {\n    var existingStub1 = wm.stubFor(get(\"/1\").willReturn(ok()));\n    var existingStub2 = wm.stubFor(get(\"/2\").willReturn(ok()));\n    clearInvocations(mockListener);\n\n    var stub1 = get(\"/1-updated\").withId(existingStub1.getId()).willReturn(ok()).build();\n    var stub2 = get(\"/2-new\").willReturn(ok()).build();\n    wm.importStubs(\n        new StubImport(List.of(stub1, stub2), new Options(DuplicatePolicy.IGNORE, true)));\n\n    verify(mockListener)\n        .beforeStubsAltered(\n            List.of(new CreateStubMapping(stub2), new RemoveStubMapping(existingStub2)));\n    verify(mockListener)\n        .afterStubsAltered(\n            List.of(new CreateStubMapping(stub2), new RemoveStubMapping(existingStub2)));\n  }\n\n  @NullMarked\n  public static class TestStubLifecycleListener implements StubLifecycleListener {\n\n    public List<String> events = new ArrayList<>();\n    public List<StubMapping> afterCreatedStubs = new ArrayList<>();\n\n    @Override\n    public StubMapping beforeStubCreated(StubMapping stub) {\n      events.add(\"beforeStubCreated, name: \" + stub.getName());\n      return stub;\n    }\n\n    @Override\n    public void afterStubCreated(StubMapping stub) {\n      events.add(\"afterStubCreated, name: \" + stub.getName());\n      afterCreatedStubs.add(stub);\n    }\n\n    @Override\n    public StubMapping beforeStubEdited(StubMapping oldStub, StubMapping newStub) {\n      events.add(\n          \"beforeStubEdited, old name: \" + oldStub.getName() + \", new name: \" + newStub.getName());\n      return newStub;\n    }\n\n    @Override\n    public void afterStubEdited(StubMapping oldStub, StubMapping newStub) {\n      events.add(\n          \"afterStubEdited, old name: \" + oldStub.getName() + \", new name: \" + newStub.getName());\n    }\n\n    @Override\n    public void beforeStubRemoved(StubMapping stub) {\n      events.add(\"beforeStubRemoved, name: \" + stub.getName());\n    }\n\n    @Override\n    public void afterStubRemoved(StubMapping stub) {\n      events.add(\"afterStubRemoved, name: \" + stub.getName());\n    }\n\n    @Override\n    public void beforeStubsReset() {\n      events.add(\"beforeStubsReset\");\n    }\n\n    @Override\n    public void afterStubsReset() {\n      events.add(\"afterStubsReset\");\n    }\n\n    @Override\n    public String getName() {\n      return \"test-stub-lifecycle-listener\";\n    }\n  }\n\n  @NullMarked\n  public static class ExceptionThrowingStubLifecycleListener implements StubLifecycleListener {\n\n    public boolean throwException = false;\n\n    @Override\n    public StubMapping beforeStubCreated(StubMapping stub) {\n      throwIfRequired();\n      return stub;\n    }\n\n    @Override\n    public void afterStubCreated(StubMapping stub) {}\n\n    @Override\n    public StubMapping beforeStubEdited(StubMapping oldStub, StubMapping newStub) {\n      throwIfRequired();\n      return newStub;\n    }\n\n    @Override\n    public void afterStubEdited(StubMapping oldStub, StubMapping newStub) {}\n\n    @Override\n    public void beforeStubRemoved(StubMapping stub) {\n      throwIfRequired();\n    }\n\n    @Override\n    public void afterStubRemoved(StubMapping stub) {}\n\n    @Override\n    public void beforeStubsReset() {\n      throwIfRequired();\n    }\n\n    @Override\n    public void afterStubsReset() {}\n\n    @Override\n    public String getName() {\n      return \"exception-thrower\";\n    }\n\n    private void throwIfRequired() {\n      if (throwException) {\n        throw new NotPermittedException(Errors.notPermitted(\"quota exhausted\"));\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StubLifecycleListenerModifyingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2019-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport.Options;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport.Options.DuplicatePolicy;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.io.File;\nimport java.util.List;\nimport org.jspecify.annotations.NullMarked;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.junit.jupiter.api.io.TempDir;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.CsvSource;\n\npublic class StubLifecycleListenerModifyingAcceptanceTest {\n\n  @TempDir public static File tempDir;\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .withRootDirectory(tempDir.getAbsolutePath())\n                  .extensions(new ModifyingStubLifecycleListener()))\n          .build();\n\n  @Test\n  void stubCanBeModifiedBeforeCreationByListener() {\n    wm.stubFor(get(\"/test\").withName(\"Created\").willReturn(ok()));\n    assertThat(wm.listAllStubMappings().getMappings().get(0).getName(), is(\"Modified on create\"));\n  }\n\n  @Test\n  void stubCanBeModifiedBeforeEditingByListener() {\n    StubMapping initial = wm.stubFor(get(\"/test\").withName(\"Created\").willReturn(ok()));\n\n    wm.editStub(get(\"/test\").withId(initial.getId()).withName(\"Edited\").willReturn(ok()));\n\n    assertThat(wm.listAllStubMappings().getMappings().get(0).getName(), is(\"Modified on edit\"));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\"false,3,2\", \"true,2,1\"})\n  void stubsCanBeModifiedByListenerInBatch(\n      boolean deleteExistingStubs, int expectedTotalCount, int expectedUpdatedStubIndex) {\n    var existingStub1 = wm.stubFor(get(\"/1\").willReturn(ok()));\n    wm.stubFor(get(\"/2\").willReturn(ok()));\n\n    var stub1 = get(\"/1-updated\").withId(existingStub1.getId()).willReturn(ok()).build();\n    var stub2 = get(\"/2-new\").willReturn(ok()).build();\n    wm.importStubs(\n        new StubImport(\n            List.of(stub1, stub2), new Options(DuplicatePolicy.OVERWRITE, deleteExistingStubs)));\n\n    List<StubMapping> mappings = wm.listAllStubMappings().getMappings();\n    assertThat(mappings, hasSize(expectedTotalCount));\n    assertThat(mappings.get(0).getId(), is(stub2.getId()));\n    assertThat(mappings.get(0).getName(), is(\"Modified on create\"));\n    assertThat(mappings.get(expectedUpdatedStubIndex).getId(), is(stub1.getId()));\n    assertThat(mappings.get(expectedUpdatedStubIndex).getName(), is(\"Modified on edit\"));\n    assertThat(\n        mappings.get(expectedUpdatedStubIndex).getInsertionIndex(),\n        is(existingStub1.getInsertionIndex()));\n  }\n\n  @NullMarked\n  public static class ModifyingStubLifecycleListener implements StubLifecycleListener {\n\n    @Override\n    public StubMapping beforeStubCreated(StubMapping stub) {\n      return stub.transform(b -> b.setName(\"Modified on create\"));\n    }\n\n    @Override\n    public StubMapping beforeStubEdited(StubMapping oldStub, StubMapping newStub) {\n      return newStub.transform(b -> b.setName(\"Modified on edit\"));\n    }\n\n    @Override\n    public String getName() {\n      return \"modifying-listener\";\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StubMappingPersistenceAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.FILES_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MAPPINGS_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.hasFileContaining;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsInAnyOrder;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\nimport static org.hamcrest.Matchers.notNullValue;\n\nimport com.github.tomakehurst.wiremock.client.MappingBuilder;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.junit.Stubbing;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.UUID;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class StubMappingPersistenceAcceptanceTest {\n\n  Path rootDir;\n  Path mappingsDir;\n  WireMockServer wireMockServer;\n  WireMockTestClient testClient;\n  Stubbing wm;\n\n  @BeforeEach\n  public void init() throws Exception {\n    rootDir = Files.createTempDirectory(\"temp-filesource\");\n    mappingsDir = rootDir.resolve(\"mappings\");\n    FileSource fileSource = new SingleRootFileSource(rootDir.toAbsolutePath().toString());\n    fileSource.createIfNecessary();\n    FileSource filesFileSource = fileSource.child(FILES_ROOT);\n    filesFileSource.createIfNecessary();\n    FileSource mappingsFileSource = fileSource.child(MAPPINGS_ROOT);\n    mappingsFileSource.createIfNecessary();\n\n    wireMockServer = new WireMockServer(wireMockConfig().fileSource(fileSource).dynamicPort());\n    wireMockServer.start();\n    testClient = new WireMockTestClient(wireMockServer.port());\n    WireMock.configureFor(wireMockServer.port());\n    wm = wireMockServer;\n  }\n\n  @Test\n  public void savesAllInMemoryStubMappings() {\n    wm.stubFor(get(urlEqualTo(\"/1\")).willReturn(aResponse().withBody(\"one\")));\n    wm.stubFor(get(urlEqualTo(\"/2\")).willReturn(aResponse().withBody(\"two\")));\n    wm.stubFor(get(urlEqualTo(\"/3\")).willReturn(aResponse().withBody(\"three\")));\n\n    wireMockServer.saveMappings();\n\n    assertThat(mappingsDir, hasFileContaining(\"one\"));\n    assertThat(mappingsDir, hasFileContaining(\"two\"));\n    assertThat(mappingsDir, hasFileContaining(\"three\"));\n  }\n\n  @Test\n  public void savesEditedStubToTheFileItOriginatedFrom() throws Exception {\n    UUID stubId = UUID.randomUUID();\n\n    writeMappingFile(\n        \"mapping-to-edit.json\",\n        get(urlEqualTo(\"/edit\")).withId(stubId).willReturn(aResponse().withBody(\"initial\")));\n\n    wireMockServer.resetToDefaultMappings(); // Loads from the file system\n\n    assertThat(wm.getStubMappings().get(0).getId(), is(stubId));\n    assertThat(wm.getStubMappings().get(0).getResponse().getBody(), is(\"initial\"));\n\n    wm.editStub(\n        get(urlEqualTo(\"/edit\")).withId(stubId).willReturn(aResponse().withBody(\"modified\")));\n\n    wireMockServer.saveMappings();\n\n    assertMappingsDirContainsOneFile();\n    assertThat(mappingsDir, hasFileContaining(\"modified\"));\n  }\n\n  @Test\n  public void savesSingleStubOnCreationIfFlaggedPersistent() {\n    stubFor(get(urlEqualTo(\"/save-immediately\")).persistent());\n    assertThat(mappingsDir, hasFileContaining(\"/save-immediately\"));\n  }\n\n  @Test\n  public void doesNotSaveSingleStubOnCreationIfNotFlaggedPersistent() {\n    stubFor(get(urlEqualTo(\"/save-immediately\")));\n    assertMappingsDirIsEmpty();\n  }\n\n  @Test\n  public void savesSingleStubOnEditIfFlaggedPersistent() {\n    UUID stubId = UUID.randomUUID();\n    stubFor(\n        get(urlEqualTo(\"/save-immediately\"))\n            .persistent()\n            .withId(stubId)\n            .willReturn(aResponse().withBody(\"initial\")));\n\n    assertThat(mappingsDir, hasFileContaining(\"/save-immediately\", \"initial\"));\n\n    editStub(\n        get(urlEqualTo(\"/save-immediately\"))\n            .persistent()\n            .withId(stubId)\n            .willReturn(aResponse().withBody(\"modified\")));\n\n    assertMappingsDirContainsOneFile();\n    assertThat(mappingsDir, hasFileContaining(\"/save-immediately\", \"modified\"));\n  }\n\n  @Test\n  public void doesNotSaveSingleStubOnEditIfNotFlaggedPersistent() {\n    UUID stubId = UUID.randomUUID();\n    stubFor(get(urlEqualTo(\"/no-save\")).withId(stubId).willReturn(aResponse().withBody(\"initial\")));\n\n    editStub(\n        get(urlEqualTo(\"/no-save\")).withId(stubId).willReturn(aResponse().withBody(\"modified\")));\n\n    assertMappingsDirIsEmpty();\n  }\n\n  @Test\n  public void deletesPersistentStubMappingIfFlaggedPersistent() {\n    StubMapping stubMapping = stubFor(get(urlEqualTo(\"/to-delete\")).persistent());\n    assertMappingsDirContainsOneFile();\n\n    removeStub(stubMapping);\n    assertMappingsDirIsEmpty();\n  }\n\n  @Test\n  public void doesNotDeleteStubMappingFromDiskIfNotFlaggedPersistent() throws Exception {\n    UUID id = UUID.randomUUID();\n    StubMapping stubMapping = get(urlEqualTo(\"/do-not-delete\")).withId(id).build();\n    Files.write(mappingsDir.resolve(\"do-not-delete.json\"), Json.write(stubMapping).getBytes());\n    resetToDefault();\n\n    assertThat(getSingleStubMapping(id).getRequest().getUrl(), is(\"/do-not-delete\"));\n    assertMappingsDirContainsOneFile();\n\n    removeStub(stubMapping);\n    assertMappingsDirContainsOneFile();\n  }\n\n  @Test\n  public void deletesAllPersistentStubMappingsOnReset() {\n    stubFor(get(urlEqualTo(\"/to-delete/1\")).persistent());\n    stubFor(get(urlEqualTo(\"/to-delete/2\")).persistent());\n    stubFor(get(urlEqualTo(\"/to-delete/3\")).persistent());\n\n    assertMappingsDirSize(3);\n\n    removeAllMappings();\n\n    assertMappingsDirIsEmpty();\n  }\n\n  @Test\n  public void deletesNestedPersistentStubMapping() throws IOException {\n    UUID stubId = UUID.randomUUID();\n    Path subDirectoryUnderMappingsRoot = Files.createDirectory(mappingsDir.resolve(\"sub-dir\"));\n    Path mappingFilePath = subDirectoryUnderMappingsRoot.resolve(\"mapping-to-delete.json\");\n    writeMappingFile(\n        mappingFilePath.toString(), get(urlEqualTo(\"/to-delete\")).withId(stubId).persistent());\n\n    wireMockServer.resetToDefaultMappings(); // Loads from the file system\n    assertThat(mappingFilePath.toFile().exists(), is(true));\n\n    StubMapping stubMapping = wm.getStubMappings().get(0);\n    assertThat(stubMapping.getId(), is(stubId));\n\n    removeStub(stubMapping);\n    assertThat(mappingFilePath.toFile().exists(), is(false));\n  }\n\n  @Test\n  public void preservesPersistentFlagFalseValue() {\n    UUID id = wm.stubFor(get(\"/no-persist\").persistent(false)).getId();\n\n    StubMapping retrivedStub = wm.getSingleStubMapping(id);\n\n    assertThat(retrivedStub.isPersistent(), notNullValue());\n    assertThat(retrivedStub.isPersistent(), is(false));\n  }\n\n  @Test\n  public void deletesStubRemovedByRequestMatch() {\n    StubMapping stubToRemove = wm.stubFor(get(\"/to-delete\").persistent(true));\n    StubMapping otherStub = wm.stubFor(get(\"/other-stub\").persistent(true));\n\n    assertThat(wm.getStubMappings(), containsInAnyOrder(stubToRemove, otherStub));\n    assertThat(mappingsDir, hasFileContaining(\"/to-delete\"));\n    assertThat(mappingsDir, hasFileContaining(\"/other-stub\"));\n\n    wm.removeStub(get(\"/to-delete\").withId(UUID.randomUUID()));\n\n    assertThat(wm.getStubMappings(), containsInAnyOrder(otherStub));\n    assertThat(mappingsDir, not(hasFileContaining(\"/to-delete\")));\n    assertThat(mappingsDir, hasFileContaining(\"/other-stub\"));\n  }\n\n  private void writeMappingFile(String name, MappingBuilder stubBuilder) throws IOException {\n    byte[] json = Json.write(stubBuilder.build()).getBytes(UTF_8);\n    Files.write(mappingsDir.resolve(name), json);\n  }\n\n  private void assertMappingsDirIsEmpty() {\n    assertMappingsDirSize(0);\n  }\n\n  private void assertMappingsDirContainsOneFile() {\n    assertMappingsDirSize(1);\n  }\n\n  private void assertMappingsDirSize(int size) {\n    assertThat(mappingsDir.toFile().list().length, is(size));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StubMetadataAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2018-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.Metadata.metadata;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.stubMappingWithUrl;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItem;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\n\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\n\npublic class StubMetadataAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void createAndRetrieveStubMetadata() {\n    UUID id = UUID.randomUUID();\n    stubFor(\n        get(\"/with-metadata\")\n            .withId(id)\n            .withMetadata(\n                metadata()\n                    .attr(\"one\", 1)\n                    .attr(\"two\", \"2\")\n                    .attr(\"three\", true)\n                    .attr(\"four\", metadata().attr(\"five\", \"55555\"))\n                    .list(\"six\", 1, 2, 3)));\n\n    StubMapping retrievedStub = getSingleStubMapping(id);\n    Metadata metadata = retrievedStub.getMetadata();\n\n    assertThat(metadata.getInt(\"one\"), is(1));\n    assertThat(metadata.getString(\"two\"), is(\"2\"));\n    assertThat(metadata.getBoolean(\"three\"), is(true));\n\n    Metadata four = metadata.getMetadata(\"four\");\n\n    assertThat(four.getString(\"five\"), is(\"55555\"));\n\n    List<?> six = metadata.getList(\"six\");\n    assertThat((Integer) six.get(0), is(1));\n  }\n\n  @Test\n  public void canFindStubsByMetadata() {\n    UUID id = UUID.randomUUID();\n    stubFor(\n        get(\"/with-metadata\")\n            .withId(id)\n            .withMetadata(\n                metadata().attr(\"four\", metadata().attr(\"five\", \"55555\")).list(\"six\", 1, 2, 3)));\n    stubFor(get(\"/without-metadata\"));\n\n    List<StubMapping> stubs =\n        findStubsByMetadata(matchingJsonPath(\"$..four.five\", containing(\"55555\")));\n    StubMapping retrievedStub = stubs.get(0);\n    assertThat(retrievedStub.getId(), is(id));\n  }\n\n  @Test\n  public void canRemoveStubsByMetadata() {\n    UUID id = UUID.randomUUID();\n    stubFor(\n        get(\"/with-metadata\")\n            .withId(id)\n            .withMetadata(\n                metadata().attr(\"four\", metadata().attr(\"five\", \"55555\")).list(\"six\", 1, 2, 3)));\n    stubFor(get(\"/without-metadata\"));\n\n    removeStubsByMetadata(matchingJsonPath(\"$..four.five\", containing(\"55555\")));\n\n    assertThat(\n        listAllStubMappings().getMappings(), not(hasItem(stubMappingWithUrl(\"/with-metadata\"))));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StubRequestLoggingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2020-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class StubRequestLoggingAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void logsEventsToNotifierWhenNotDisabled() {\n    TestNotifier notifier = new TestNotifier();\n    WireMockServer wm = new WireMockServer(wireMockConfig().dynamicPort().notifier(notifier));\n    wm.start();\n    testClient = new WireMockTestClient(wm.port());\n\n    notifier.infoMessages.clear();\n\n    wm.stubFor(get(\"/log-me\").willReturn(ok(\"body text\")));\n\n    testClient.get(\"/log-me\");\n    assertThat(notifier.infoMessages.size(), is(1));\n    assertThat(\n        notifier.infoMessages.get(0),\n        allOf(\n            containsString(\"Request received:\"),\n            containsString(\"/log-me\"),\n            containsString(\"body text\")));\n  }\n\n  @Test\n  public void doesNotLogEventsToNotifierWhenDisabled() {\n    TestNotifier notifier = new TestNotifier();\n    WireMockServer wm =\n        new WireMockServer(\n            wireMockConfig().dynamicPort().stubRequestLoggingDisabled(true).notifier(notifier));\n    wm.start();\n    testClient = new WireMockTestClient(wm.port());\n\n    notifier.infoMessages.clear();\n\n    wm.stubFor(get(\"/log-me\").willReturn(ok(\"body\")));\n\n    testClient.get(\"/log-me\");\n    assertThat(notifier.infoMessages.size(), is(0));\n  }\n\n  public static class TestNotifier implements Notifier {\n\n    final List<String> infoMessages = new ArrayList<>();\n\n    @Override\n    public void info(String message) {\n      infoMessages.add(message);\n    }\n\n    @Override\n    public void error(String message) {}\n\n    @Override\n    public void error(String message, Throwable t) {}\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StubbingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.DateTimeTruncation.FIRST_MINUTE_OF_HOUR;\nimport static com.github.tomakehurst.wiremock.common.DateTimeUnit.HOURS;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.*;\nimport static com.github.tomakehurst.wiremock.testsupport.MultipartBody.part;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static java.net.HttpURLConnection.HTTP_NOT_FOUND;\nimport static java.net.HttpURLConnection.HTTP_OK;\nimport static java.util.Collections.singletonList;\nimport static org.apache.hc.core5.http.ContentType.APPLICATION_JSON;\nimport static org.apache.hc.core5.http.ContentType.APPLICATION_OCTET_STREAM;\nimport static org.apache.hc.core5.http.ContentType.APPLICATION_XML;\nimport static org.apache.hc.core5.http.ContentType.TEXT_PLAIN;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult;\nimport com.github.tomakehurst.wiremock.common.ClientError;\nimport com.github.tomakehurst.wiremock.junit5.EnabledIfJettyVersion;\nimport com.github.tomakehurst.wiremock.matching.MultiValuePattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.TestHttpHeader;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport java.io.IOException;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\nimport java.time.ZonedDateTime;\nimport java.time.temporal.ChronoUnit;\nimport java.util.*;\nimport java.util.stream.Stream;\nimport org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;\nimport org.apache.hc.core5.http.ContentType;\nimport org.apache.hc.core5.http.HttpHeaders;\nimport org.apache.hc.core5.http.io.entity.ByteArrayEntity;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.TypeSafeMatcher;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.BeforeAll;\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;\n\nclass StubbingAcceptanceTest extends AcceptanceTestBase {\n\n  @BeforeAll\n  public static void setupServer() {\n    setupServerWithMappingsInFileRoot();\n  }\n\n  @Test\n  void mappingWithExactUrlAndMethodMatch() {\n    stubFor(\n        get(urlEqualTo(\"/a/registered/resource\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(401)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Not allowed!\")));\n\n    WireMockResponse response = testClient.get(\"/a/registered/resource\");\n\n    assertThat(response.statusCode(), is(401));\n    assertThat(response.content(), is(\"Not allowed!\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n  }\n\n  @Test\n  void mappingWithExactUrlWithBodyAndQueryMethodMatch() {\n    stubFor(query(urlEqualTo(\"/a/resource\")).withRequestBody(containing(\"BODY\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.queryWithBody(\"/a/resource\", \"BODY\", \"text/plain\");\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void mappingWithExactUrlWithBodyAndHeadersAndQueryMethodMatch() {\n    stubFor(\n        query(urlEqualTo(\"/a/resource\"))\n            .withRequestBody(containing(\"BODY\"))\n            .withHeader(\"Some-Header\", equalTo(\"Some-Value\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Found\")));\n\n    WireMockResponse response =\n        testClient.queryWithBody(\n            \"/a/resource\",\n            \"BODY\",\n            \"text/plain\",\n            TestHttpHeader.withHeader(\"Some-Header\", \"Some-Value\"));\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"Found\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n  }\n\n  @Test\n  void mappingWithExactUrlWithNoBodyAndQueryMethodMatch() {\n    stubFor(\n        query(urlEqualTo(\"/a/resource\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"text/plain\")\n                    .withBody(\"Found\")));\n\n    WireMockResponse response = testClient.query(\"/a/resource\");\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"Found\"));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"text/plain\"));\n  }\n\n  @Test\n  void mappingWithUrlContainingQueryParameters() {\n    stubFor(\n        get(urlEqualTo(\"/search?name=John&postcode=N44LL\"))\n            .willReturn(aResponse().withHeader(\"Location\", \"/nowhere\").withStatus(302)));\n\n    WireMockResponse response = testClient.get(\"/search?name=John&postcode=N44LL\");\n\n    assertThat(response.statusCode(), is(302));\n  }\n\n  @Test\n  void mappingWithHeaderMatchers() {\n    stubFor(\n        put(urlEqualTo(\"/some/url\"))\n            .withHeader(\"One\", equalTo(\"abcd1234\"))\n            .withHeader(\"Two\", matching(\"[a-z]{5}\"))\n            .withHeader(\"Three\", notMatching(\"[A-Z]+\"))\n            .willReturn(aResponse().withStatus(204)));\n\n    WireMockResponse response =\n        testClient.put(\n            \"/some/url\",\n            withHeader(\"One\", \"abcd1234\"),\n            withHeader(\"Two\", \"thing\"),\n            withHeader(\"Three\", \"something\"));\n\n    assertThat(response.statusCode(), is(204));\n  }\n\n  @Test\n  void mappingWithCaseInsensitiveHeaderMatchers() {\n    stubFor(\n        put(urlEqualTo(\"/case/insensitive\"))\n            .withHeader(\"ONE\", equalTo(\"abcd1234\"))\n            .withHeader(\"two\", matching(\"[a-z]{5}\"))\n            .withHeader(\"Three\", notMatching(\"[A-Z]+\"))\n            .willReturn(aResponse().withStatus(204)));\n\n    WireMockResponse response =\n        testClient.put(\n            \"/case/insensitive\",\n            withHeader(\"one\", \"abcd1234\"),\n            withHeader(\"TWO\", \"thing\"),\n            withHeader(\"tHrEe\", \"something\"));\n\n    assertThat(response.statusCode(), is(204));\n  }\n\n  @Test\n  void doesNotMatchOnAbsentHeader() {\n    stubFor(\n        post(urlEqualTo(\"/some/url\"))\n            .withRequestBody(containing(\"BODY\"))\n            .withHeader(\"NoSuchHeader\", equalTo(\"This better not be here\"))\n            .willReturn(ok()));\n\n    assertThat(\n        testClient.postWithBody(\"/some/url\", \"BODY\", \"text/plain\", \"utf-8\").statusCode(), is(404));\n  }\n\n  @Test\n  void matchesIfRequestContainsHeaderNotSpecified() {\n    stubFor(\n        get(urlEqualTo(\"/some/extra/header\"))\n            .withHeader(\"ExpectedHeader\", equalTo(\"expected-value\"))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.get(\n            \"/some/extra/header\",\n            withHeader(\"ExpectedHeader\", \"expected-value\"),\n            withHeader(\"UnexpectedHeader\", \"unexpected-value\"));\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void matchesOnUrlPathAndQueryParameters() {\n    stubFor(\n        get(urlPathEqualTo(\"/path-and-query/match\"))\n            .withQueryParam(\"search\", containing(\"WireMock\"))\n            .withQueryParam(\"since\", equalTo(\"2014-10-14\"))\n            .willReturn(ok()));\n\n    assertThat(\n        testClient\n            .get(\"/path-and-query/match?since=2014-10-14&search=WireMock%20stubbing\")\n            .statusCode(),\n        is(200));\n  }\n\n  @Test\n  void matchesOnUrlPathAndMultipleQueryParameters() {\n    Map<String, StringValuePattern> queryParameters = new HashMap<>();\n    queryParameters.put(\"search\", containing(\"WireMock\"));\n    queryParameters.put(\"since\", equalTo(\"2018-03-02\"));\n\n    stubFor(\n        get(urlPathEqualTo(\"/path-and-query/match\"))\n            .withQueryParams(queryParameters)\n            .willReturn(ok()));\n\n    assertThat(\n        testClient\n            .get(\"/path-and-query/match?since=2018-03-02&search=WireMock%20stubbing\")\n            .statusCode(),\n        is(200));\n  }\n\n  @Test\n  void doesNotMatchOnUrlPathWhenExtraPathElementsPresent() {\n    stubFor(get(urlPathEqualTo(\"/matching-path\")).willReturn(ok()));\n\n    assertThat(testClient.get(\"/matching-path/extra\").statusCode(), is(404));\n  }\n\n  @Test\n  void doesNotMatchOnUrlPathWhenPathShorter() {\n    stubFor(get(urlPathEqualTo(\"/matching-path\")).willReturn(ok()));\n\n    assertThat(testClient.get(\"/matching\").statusCode(), is(404));\n  }\n\n  @Test\n  void matchesOnUrlPathPatternAndQueryParameters() {\n    stubFor(\n        get(urlPathMatching(\"/path(.*)/match\"))\n            .withQueryParam(\"search\", containing(\"WireMock\"))\n            .withQueryParam(\"since\", equalTo(\"2014-10-14\"))\n            .willReturn(ok()));\n\n    assertThat(\n        testClient\n            .get(\"/path-and-query/match?since=2014-10-14&search=WireMock%20stubbing\")\n            .statusCode(),\n        is(200));\n  }\n\n  @Test\n  void matchesOnUrlPathPatternAndMultipleQueryParameters() {\n    Map<String, StringValuePattern> queryParameters = new HashMap<>();\n    queryParameters.put(\"search\", containing(\"WireMock\"));\n    queryParameters.put(\"since\", equalTo(\"2018-03-02\"));\n\n    stubFor(\n        get(urlPathMatching(\"/path(.*)/match\")).withQueryParams(queryParameters).willReturn(ok()));\n\n    assertThat(\n        testClient\n            .get(\"/path-and-query/match?since=2018-03-02&search=WireMock%20stubbing\")\n            .statusCode(),\n        is(200));\n  }\n\n  @Test\n  void doesNotMatchOnUrlPathPatternWhenPathShorter() {\n    stubFor(get(urlPathMatching(\"/matching-path\")).willReturn(ok()));\n\n    assertThat(testClient.get(\"/matching\").statusCode(), is(404));\n  }\n\n  @Test\n  void doesNotMatchOnUrlPathPatternWhenExtraPathPresent() {\n    stubFor(get(urlPathMatching(\"/matching-path\")).willReturn(ok()));\n\n    assertThat(testClient.get(\"/matching-path/extra\").statusCode(), is(404));\n  }\n\n  @Test\n  void doesNotMatchIfSpecifiedQueryParameterNotInRequest() {\n    stubFor(\n        get(urlPathEqualTo(\"/path-and-query/match\"))\n            .withQueryParam(\"search\", containing(\"WireMock\"))\n            .willReturn(ok()));\n\n    assertThat(testClient.get(\"/path-and-query/match?wrongParam=wrongVal\").statusCode(), is(404));\n  }\n\n  @Test\n  void doesNotMatchIfSpecifiedAbsentQueryParameterIsPresentInRequest() {\n    stubFor(\n        get(urlPathEqualTo(\"/path-and-query/match\"))\n            .withQueryParam(\"search\", absent())\n            .willReturn(ok()));\n\n    assertThat(testClient.get(\"/path-and-query/match?search=presentwhoops\").statusCode(), is(404));\n  }\n\n  @Test\n  void matchesIfSpecifiedAbsentQueryParameterIsAbsentFromRequest() {\n    stubFor(\n        get(urlPathEqualTo(\"/path-and-query/match\"))\n            .withQueryParam(\"search\", absent())\n            .willReturn(ok()));\n\n    assertThat(testClient.get(\"/path-and-query/match?anotherparam=present\").statusCode(), is(200));\n  }\n\n  @Test\n  void matchesOnQueryParametersNotContaining() {\n    stubFor(\n        get(urlPathEqualTo(\"/query/match\"))\n            .withQueryParam(\"search\", notContaining(\"WireMock\"))\n            .willReturn(ok()));\n\n    assertThat(\n        testClient.get(\"/query/match?search=WireMock%20stubbing\").statusCode(), is(HTTP_NOT_FOUND));\n\n    assertThat(testClient.get(\"/query/match?search=Other%20stubbing\").statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void responseBodyLoadedFromFile() {\n    stubFor(\n        get(urlEqualTo(\"/my/file\"))\n            .willReturn(aResponse().withStatus(200).withBodyFile(\"plain-example.txt\")));\n\n    WireMockResponse response = testClient.get(\"/my/file\");\n\n    assertThat(response.content(), is(\"Some example test from a file\"));\n  }\n\n  @Test\n  void matchingOnRequestBodyWithTwoRegexes() {\n    stubFor(\n        put(urlEqualTo(\"/match/this/body\"))\n            .withRequestBody(matching(\".*Blah.*\"))\n            .withRequestBody(matching(\".*@[0-9]{5}@.*\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBodyFile(\"plain-example.txt\")));\n\n    WireMockResponse response =\n        testClient.putWithBody(\"/match/this/body\", \"Blah...but not the rest\", \"text/plain\");\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n    response =\n        testClient.putWithBody(\"/match/this/body\", \"@12345@...but not the rest\", \"text/plain\");\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response = testClient.putWithBody(\"/match/this/body\", \"BlahBlah@56565@Blah\", \"text/plain\");\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnRequestBodyWithAContainsAndANegativeRegex() {\n    stubFor(\n        put(urlEqualTo(\"/match/this/body/too\"))\n            .withRequestBody(containing(\"Blah\"))\n            .withRequestBody(notMatching(\".*[0-9]+.*\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBodyFile(\"plain-example.txt\")));\n\n    WireMockResponse response =\n        testClient.putWithBody(\"/match/this/body/too\", \"Blah12345\", \"text/plain\");\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response = testClient.putWithBody(\"/match/this/body/too\", \"BlahBlahBlah\", \"text/plain\");\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnRequestBodyWithNotContaining() {\n    stubFor(\n        put(urlEqualTo(\"/match/this/body/too\"))\n            .withRequestBody(notContaining(\"OtherBody\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBodyFile(\"plain-example.txt\")));\n\n    WireMockResponse response =\n        testClient.putWithBody(\"/match/this/body/too\", \"BlahOtherBody12345\", \"text/plain\");\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response = testClient.putWithBody(\"/match/this/body/too\", \"BlahBlahBlah\", \"text/plain\");\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnRequestBodyWithEqualTo() {\n    stubFor(\n        put(urlEqualTo(\"/match/this/body/too\"))\n            .withRequestBody(equalTo(\"BlahBlahBlah\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBodyFile(\"plain-example.txt\")));\n\n    WireMockResponse response =\n        testClient.putWithBody(\"/match/this/body/too\", \"Blah12345\", \"text/plain\");\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response = testClient.putWithBody(\"/match/this/body/too\", \"BlahBlahBlah\", \"text/plain\");\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnRequestBodyWithBinaryEqualTo() {\n    byte[] requestBody = new byte[] {1, 2, 3};\n\n    stubFor(\n        post(\"/match/binary\")\n            .withRequestBody(binaryEqualTo(requestBody))\n            .willReturn(ok(\"Matched binary\")));\n\n    WireMockResponse response =\n        testClient.post(\n            \"/match/binary\", new ByteArrayEntity(new byte[] {9}, APPLICATION_OCTET_STREAM));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response =\n        testClient.post(\n            \"/match/binary\", new ByteArrayEntity(requestBody, APPLICATION_OCTET_STREAM));\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnRequestBodyWithAdvancedJsonPath() {\n    stubFor(\n        post(\"/jsonpath/advanced\")\n            .withRequestBody(matchingJsonPath(\"$.counter\", equalTo(\"123\")))\n            .withRequestBody(matchingJsonPath(\"$.wrong\", absent()))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.postJson(\"/jsonpath/advanced\", \"{ \\\"counter\\\": 234 }\");\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response = testClient.postJson(\"/jsonpath/advanced\", \"{ \\\"counter\\\": 123 }\");\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnRequestBodyWithAdvancedXPath() {\n    stubFor(\n        post(\"/xpath/advanced\")\n            .withRequestBody(matchingXPath(\"//counter/text()\", equalTo(\"123\")))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.postXml(\"/xpath/advanced\", \"<counter>6666</counter>\");\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response = testClient.postXml(\"/xpath/advanced\", \"<counter>123</counter>\");\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void highPriorityMappingMatchedFirst() {\n    stubFor(\n        get(urlMatching(\"/priority/.*\")).atPriority(10).willReturn(aResponse().withStatus(500)));\n    stubFor(get(urlEqualTo(\"/priority/resource\")).atPriority(2).willReturn(ok()));\n\n    assertThat(testClient.get(\"/priority/resource\").statusCode(), is(200));\n  }\n\n  @Test\n  void matchingUrlsWithEscapeCharacters() {\n    stubFor(\n        get(urlEqualTo(\"/%26%26The%20Lord%20of%20the%20Rings%26%26\"))\n            .willReturn(aResponse().withStatus(HTTP_OK)));\n    assertThat(\n        testClient.get(\"/%26%26The%20Lord%20of%20the%20Rings%26%26\").statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingUrlPathsWithEscapeCharacters() {\n    stubFor(\n        get(urlPathEqualTo(\"/%26%26The%20Lord%20of%20the%20Rings%26%26\"))\n            .willReturn(aResponse().withStatus(HTTP_OK)));\n    assertThat(\n        testClient.get(\"/%26%26The%20Lord%20of%20the%20Rings%26%26\").statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void default200ResponseWhenStatusCodeNotSpecified() {\n    stubFor(get(urlEqualTo(\"/default/two-hundred\")).willReturn(aResponse()));\n    assertThat(testClient.get(\"/default/two-hundred\").statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void returningBinaryBody() {\n    byte[] bytes = new byte[] {65, 66, 67};\n    stubFor(get(urlEqualTo(\"/binary/content\")).willReturn(aResponse().withBody(bytes)));\n\n    assertThat(testClient.get(\"/binary/content\").binaryContent(), is(bytes));\n  }\n\n  @Test\n  void listingAllStubMappings() {\n    stubFor(get(urlEqualTo(\"/stub/one\")).willReturn(aResponse().withBody(\"One\")));\n    stubFor(post(urlEqualTo(\"/stub/two\")).willReturn(aResponse().withBody(\"Two\").withStatus(201)));\n\n    ListStubMappingsResult listingResult = listAllStubMappings();\n    StubMapping mapping1 = listingResult.getMappings().get(0);\n    assertThat(mapping1.getRequest().getMethod(), is(POST));\n    assertThat(mapping1.getRequest().getUrl(), is(\"/stub/two\"));\n    assertThat(mapping1.getResponse().getBody(), is(\"Two\"));\n    assertThat(mapping1.getResponse().getStatus(), is(201));\n\n    StubMapping mapping2 = listingResult.getMappings().get(1);\n    assertThat(mapping2.getRequest().getMethod(), is(GET));\n    assertThat(mapping2.getRequest().getUrl(), is(\"/stub/one\"));\n    assertThat(mapping2.getResponse().getBody(), is(\"One\"));\n  }\n\n  @Test\n  void stubbingPatch() {\n    stubFor(\n        patch(urlEqualTo(\"/a/registered/resource\"))\n            .withRequestBody(equalTo(\"some body\"))\n            .willReturn(aResponse().withStatus(204)));\n\n    WireMockResponse response =\n        testClient.patchWithBody(\"/a/registered/resource\", \"some body\", \"text/plain\");\n\n    assertThat(response.statusCode(), is(204));\n  }\n\n  @Test\n  void stubbingArbitraryMethod() {\n    stubFor(request(\"KILL\", urlEqualTo(\"/some/url\")).willReturn(aResponse().withStatus(204)));\n\n    WireMockResponse response = testClient.request(\"KILL\", \"/some/url\");\n\n    assertThat(response.statusCode(), is(204));\n  }\n\n  @Test\n  @EnabledIfJettyVersion(\n      major = 11,\n      reason = \"Jetty 12 and above does not allow setting the status message / reason\")\n  void settingStatusMessage() {\n    stubFor(\n        get(urlEqualTo(\"/status-message\"))\n            .willReturn(\n                aResponse().withStatus(500).withStatusMessage(\"The bees! They're in my eyes!\")));\n\n    assertThat(\n        testClient.get(\"/status-message\").statusMessage(), is(\"The bees! They're in my eyes!\"));\n  }\n\n  @Test\n  void doesNotAttemptToMatchXmlBodyWhenStubMappingDoesNotHaveOne() {\n    stubFor(options(urlEqualTo(\"/no-body\")).willReturn(ok()));\n    stubFor(\n        post(urlEqualTo(\"/no-body\"))\n            .withRequestBody(equalToXml(\"<some-xml />\"))\n            .willReturn(aResponse().withStatus(201)));\n\n    WireMockResponse response = testClient.options(\"/no-body\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void matchXmlBodyWhenTextNodeIsIgnored() {\n    String url = \"/ignore/my/xml\";\n\n    stubFor(\n        post(url)\n            .withRequestBody(equalToXml(\"<a>#{xmlunit.ignore}</a>\", true, \"#\\\\{\", \"}\"))\n            .willReturn(ok()));\n\n    assertThat(testClient.postXml(url, \"<a>123</a>\").statusCode(), is(200));\n  }\n\n  @Test\n  void doesNotIgnoreXmlWhenPlaceholderMatchingIsFalse() {\n    String url = \"/do-not-ignore/my/xml\";\n\n    stubFor(\n        post(url)\n            .withRequestBody(equalToXml(\"<a>#{xmlunit.ignore}</a>\", false, \"#\\\\{\", \"}\"))\n            .willReturn(ok()));\n\n    assertThat(testClient.postXml(url, \"<a>123</a>\").statusCode(), is(404));\n  }\n\n  @Test\n  void matchesQueryParamsUnencoded() {\n    stubFor(\n        get(urlPathEqualTo(\"/query\"))\n            .withQueryParam(\"param-one\", equalTo(\"one two three ?\"))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/query?param-one=one%20two%20three%20%3F\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void matchesQueryParamsWithUnencodedSpacesRequestedAsPluses() {\n    stubFor(\n        get(urlPathEqualTo(\"/query\"))\n            .withQueryParam(\"param-one\", equalTo(\"one two three ?\"))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/query?param-one=one+two+three+%3F\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void matchesPathWithSpacesAsPlusesRequestedAsPluses() {\n    stubFor(get(urlPathEqualTo(\"/path+with+spaces\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/path+with+spaces\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void doesNotMatchPathWithEncodedSpacesRequestedAsPluses() {\n    stubFor(get(urlPathEqualTo(\"/path%20with%20spaces\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/path+with+spaces\");\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void doesNotMatchPathWithSpacesRequestedAsPluses() {\n    stubFor(get(urlPathEqualTo(\"/path with spaces\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/path+with+spaces\");\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void matchesPathWithSpacesAsPlusesRequestedAsEncodedSpaces() {\n    stubFor(get(urlPathEqualTo(\"/path+with+spaces\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/path%20with%20spaces\");\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void doesNotMatchPathWithEncodedSpacesRequestedAsEncodedSpaces() {\n    stubFor(get(urlPathEqualTo(\"/path%20with%20spaces\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/path%20with%20spaces\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void doesNotMatchPathWithSpacesRequestedAsEncodedSpaces() {\n    stubFor(get(urlPathEqualTo(\"/path with spaces\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/path%20with%20spaces\");\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void matchesCookiesUnencoded() {\n    stubFor(\n        get(urlPathEqualTo(\"/query\"))\n            .withCookie(\"cookie-one\", equalTo(\"one two three ?\"))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/query?param-one=one%20two%20three%20%3F\");\n    response = testClient.get(\"/query\", withHeader(\"Cookie\", \"cookie-one=one%20two%20three%20%3F\"));\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void matchesFormParamUnencoded() {\n    stubFor(\n        put(urlPathEqualTo(\"/form\"))\n            .withFormParam(\"key-one\", equalTo(\"one two three ?\"))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.putWithBody(\n            \"/form\",\n            \"key-one=one%20two%20three%20%3F\",\n            \"application/x-www-form-urlencoded\",\n            TestHttpHeader.withHeader(\"Content-Type\", \"application/x-www-form-urlencoded\"));\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void matchesFormParamWithKeyInArrayStyle() {\n    stubFor(\n        put(urlPathEqualTo(\"/form\"))\n            .withFormParam(\"key[one]\", equalTo(\"firstValue\"))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.putWithBody(\n            \"/form\",\n            \"key[one]=firstValue\",\n            \"application/x-www-form-urlencoded\",\n            TestHttpHeader.withHeader(\"Content-Type\", \"application/x-www-form-urlencoded\"));\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void matchesFormParamForGet() {\n    stubFor(get(urlPathEqualTo(\"/form\")).withFormParam(\"key\", equalTo(\"value\")).willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.getWithBody(\n            \"/form\",\n            \"key=value\",\n            \"application/x-www-form-urlencoded\",\n            TestHttpHeader.withHeader(\"Content-Type\", \"application/x-www-form-urlencoded\"));\n    assertThat(response.statusCode(), is(200));\n\n    response = testClient.get(\"/form\");\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void matchesFormParamForDelete() {\n    stubFor(\n        delete(urlPathEqualTo(\"/form\")).withFormParam(\"key\", equalTo(\"value\")).willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.deleteWithBody(\n            \"/form\",\n            \"key=value\",\n            \"application/x-www-form-urlencoded\",\n            TestHttpHeader.withHeader(\"Content-Type\", \"application/x-www-form-urlencoded\"));\n    assertThat(response.statusCode(), is(200));\n\n    response = testClient.delete(\"/form\");\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void matchesWithMultipleFormParams() {\n    stubFor(\n        put(urlPathEqualTo(\"/form\"))\n            .withFormParams(\n                Map.of(\n                    \"key1\", MultiValuePattern.of(equalTo(\"value1\")),\n                    \"key2\", MultiValuePattern.of(equalTo(\"value2\")))));\n\n    WireMockResponse response =\n        testClient.putWithBody(\n            \"/form\",\n            \"key1=value1&key2=value2\",\n            \"application/x-www-form-urlencoded\",\n            TestHttpHeader.withHeader(\"Content-Type\", \"application/x-www-form-urlencoded\"));\n    assertThat(response.statusCode(), is(200));\n\n    response =\n        testClient.putWithBody(\n            \"/form\",\n            \"key1=value1\",\n            \"application/x-www-form-urlencoded\",\n            TestHttpHeader.withHeader(\"Content-Type\", \"application/x-www-form-urlencoded\"));\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void copesWithInvalidFormEncoding() {\n    stubFor(post(urlPathEqualTo(\"/form\")).willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.postWithBody(\"/form\", \"%}#\", \"application/x-www-form-urlencoded\", \"utf-8\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void copesWithEmptyRequestHeaderValueWhenMatchingOnEqualTo() {\n    stubFor(\n        get(urlPathEqualTo(\"/empty-header\"))\n            .withHeader(\"X-My-Header\", equalTo(\"\"))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/empty-header\", withHeader(\"X-My-Header\", \"\"));\n\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void assignsAnIdAndReturnsNewlyCreatedStubMapping() {\n    StubMapping stubMapping = stubFor(get(anyUrl()).willReturn(aResponse()));\n    assertThat(stubMapping.getId(), notNullValue());\n\n    StubMapping localStubMapping = wm.stubFor(get(anyUrl()).willReturn(aResponse()));\n    assertThat(localStubMapping.getId(), notNullValue());\n  }\n\n  @Test\n  void getsASingleStubMappingById() {\n    UUID id = UUID.randomUUID();\n    stubFor(get(anyUrl()).withId(id).willReturn(aResponse().withBody(\"identified!\")));\n\n    StubMapping fetchedMapping = getSingleStubMapping(id);\n\n    assertThat(fetchedMapping.getResponse().getBody(), is(\"identified!\"));\n  }\n\n  @Test\n  void defaultsResponseWhenUnspecifiied() {\n    stubFor(any(anyUrl()));\n\n    assertThat(testClient.get(\"/anything-is-matched\").statusCode(), is(200));\n  }\n\n  @Test\n  void stubMappingsCanOptionallyBeNamed() {\n    stubFor(\n        any(urlPathEqualTo(\"/things\"))\n            .withName(\"Get all the things\")\n            .willReturn(aResponse().withBody(\"Named stub\")));\n\n    assertThat(listAllStubMappings().getMappings(), hasItem(named(\"Get all the things\")));\n  }\n\n  @Test\n  void matchingOnMultipartRequestBodyWithTwoRegexes() {\n    stubFor(\n        post(urlEqualTo(\"/match/this/part\"))\n            .withMultipartRequestBody(aMultipart().withBody(matching(\".*Blah.*\")))\n            .withMultipartRequestBody(aMultipart().withBody(matching(\".*@[0-9]{5}@.*\")))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBodyFile(\"plain-example.txt\")));\n\n    WireMockResponse response =\n        testClient.postWithMultiparts(\n            \"/match/this/part\",\n            singletonList(part(\"part-1\", \"Blah...but not the rest\", TEXT_PLAIN)));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n    response =\n        testClient.postWithMultiparts(\n            \"/match/this/part\",\n            singletonList(part(\"part-1\", \"@12345@...but not the rest\", TEXT_PLAIN)));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response =\n        testClient.postWithMultiparts(\n            \"/match/this/part\",\n            singletonList(part(\"good-part\", \"BlahBlah@56565@Blah\", TEXT_PLAIN)));\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnMultipartRequestBodyWithAContainsAndANegativeRegex() {\n    stubFor(\n        post(urlEqualTo(\"/match/this/part/too\"))\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withName(\"part-name\")\n                    .withBody(containing(\"Blah\"))\n                    .withBody(notMatching(\".*[0-9]+.*\")))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBodyFile(\"plain-example.txt\")));\n\n    WireMockResponse response =\n        testClient.postWithMultiparts(\n            \"/match/this/part/too\", singletonList(part(\"part-name\", \"Blah12345\", TEXT_PLAIN)));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response =\n        testClient.postWithMultiparts(\n            \"/match/this/part/too\", singletonList(part(\"part-name\", \"BlahBlahBlah\", TEXT_PLAIN)));\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnMultipartRequestBodyWithNotContaining() {\n    stubFor(\n        post(urlEqualTo(\"/match/this/part/too\"))\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withHeader(\"Content-Type\", notContaining(\"application/json\"))\n                    .withBody(notContaining(\"OtherStuff\")))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBodyFile(\"plain-example.txt\")));\n\n    WireMockResponse response =\n        testClient.postWithMultiparts(\n            \"/match/this/part/too\", singletonList(part(\"part\", \"BlahOtherStuff12345\", TEXT_PLAIN)));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response =\n        testClient.postWithMultiparts(\n            \"/match/this/part/too\", singletonList(part(\"part\", \"BlahBlahBlah\", TEXT_PLAIN)));\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnMultipartRequestBodyWithFilename() {\n    stubFor(\n        post(urlEqualTo(\"/match/this/part/filename\"))\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withHeader(\"Content-Type\", containing(\"application/octet-stream\"))\n                    .withFileName(\"plain-example.txt\"))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.post(\n            \"/match/this/part/filename\",\n            MultipartEntityBuilder.create()\n                .addBinaryBody(\n                    \"file\",\n                    \"ABCD\".getBytes(),\n                    ContentType.APPLICATION_OCTET_STREAM,\n                    \"plain-example.txt\")\n                .build());\n    assertThat(response.statusCode(), is(HTTP_OK));\n\n    response =\n        testClient.post(\n            \"/match/this/part/filename\",\n            MultipartEntityBuilder.create()\n                .addBinaryBody(\n                    \"file\",\n                    \"ABCD\".getBytes(),\n                    ContentType.APPLICATION_OCTET_STREAM,\n                    \"plain-example1.txt\")\n                .build());\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n  }\n\n  @Test\n  void matchingOnMultipartRequestBodyWithFilenameWithMultipleParts() {\n    stubFor(\n        post(urlEqualTo(\"/match/this/part/filename\"))\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withHeader(\"Content-Type\", containing(\"application/octet-stream\"))\n                    .withFileName(\"plain-example.txt\"))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.post(\n            \"/match/this/part/filename\",\n            MultipartEntityBuilder.create()\n                .addBinaryBody(\n                    \"file\",\n                    \"ABCD\".getBytes(),\n                    ContentType.APPLICATION_OCTET_STREAM,\n                    \"plain-example.txt\")\n                .addBinaryBody(\n                    \"file1\",\n                    \"XYZ\".getBytes(),\n                    ContentType.APPLICATION_OCTET_STREAM,\n                    \"plain-example1.txt\")\n                .build());\n    assertThat(response.statusCode(), is(HTTP_OK));\n\n    response =\n        testClient.post(\n            \"/match/this/part/filename\",\n            MultipartEntityBuilder.create()\n                .addBinaryBody(\n                    \"file\",\n                    \"ABCD\".getBytes(),\n                    ContentType.APPLICATION_OCTET_STREAM,\n                    \"plain-example1.txt\")\n                .addBinaryBody(\n                    \"file\",\n                    \"XYZ\".getBytes(),\n                    ContentType.APPLICATION_OCTET_STREAM,\n                    \"plain-example2.txt\")\n                .build());\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n  }\n\n  @Test\n  void matchingOnMultipartRequestBodyWithEqualTo() {\n    stubFor(\n        post(urlEqualTo(\"/match/this/part/too\"))\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withHeader(\"Content-Type\", containing(\"text/plain\"))\n                    .withBody(equalTo(\"BlahBlahBlah\")))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBodyFile(\"plain-example.txt\")));\n\n    WireMockResponse response =\n        testClient.postWithMultiparts(\n            \"/match/this/part/too\", singletonList(part(\"part\", \"Blah12345\", TEXT_PLAIN)));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response =\n        testClient.postWithMultiparts(\n            \"/match/this/part/too\", singletonList(part(\"part\", \"BlahBlahBlah\", TEXT_PLAIN)));\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnMultipartRequestBodyWithBinaryEqualTo() {\n    byte[] requestBody = new byte[] {1, 2, 3};\n\n    stubFor(\n        post(\"/match/part/binary\")\n            .withMultipartRequestBody(\n                aMultipart().withBody(binaryEqualTo(requestBody)).withName(\"file\"))\n            .willReturn(ok(\"Matched binary\")));\n\n    WireMockResponse response =\n        testClient.postWithMultiparts(\n            \"/match/part/binary\", singletonList(part(\"file\", new byte[] {9})));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response =\n        testClient.postWithMultiparts(\n            \"/match/part/binary\", singletonList(part(\"file\", requestBody)));\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnMultipartRequestBodyWithAdvancedJsonPath() {\n    stubFor(\n        post(\"/jsonpath/advanced/part\")\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withName(\"json\")\n                    .withHeader(\"Content-Type\", containing(\"application/json\"))\n                    .withBody(matchingJsonPath(\"$.counter\", equalTo(\"123\"))))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.postWithMultiparts(\n            \"/jsonpath/advanced/part\",\n            singletonList(part(\"json\", \"{ \\\"counter\\\": 234 }\", APPLICATION_JSON)));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response =\n        testClient.postWithMultiparts(\n            \"/jsonpath/advanced/part\",\n            singletonList(part(\"json\", \"{ \\\"counter\\\": 123 }\", APPLICATION_JSON)));\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void matchingOnMultipartRequestBodyWithAdvancedXPath() {\n    stubFor(\n        post(\"/xpath/advanced/part\")\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withName(\"xml\")\n                    .withHeader(\"Content-Type\", containing(\"application/xml\"))\n                    .withBody(matchingXPath(\"//counter/text()\", equalTo(\"123\"))))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.postWithMultiparts(\n            \"/xpath/advanced/part\",\n            singletonList(part(\"xml\", \"<counter>6666</counter>\", APPLICATION_XML)));\n    assertThat(response.statusCode(), is(HTTP_NOT_FOUND));\n\n    response =\n        testClient.postWithMultiparts(\n            \"/xpath/advanced/part\",\n            singletonList(part(\"xml\", \"<counter>123</counter>\", APPLICATION_XML)));\n    assertThat(response.statusCode(), is(HTTP_OK));\n  }\n\n  @Test\n  void copesWithRequestCharactersThatReallyShouldBeEscapedWhenMatchingOnWholeUrlRegex()\n      throws Exception {\n    stubFor(get(urlMatching(\"/dodgy-chars.*\")).willReturn(ok()));\n\n    String url =\n        \"http://localhost:\" + wireMockServer.port() + \"/dodgy-chars?filter={\\\"accountid\\\":\\\"1\\\"}\";\n    int code = getStatusCodeUsingJavaUrlConnection(url);\n\n    assertThat(code, is(200));\n  }\n\n  @Test\n  void copesWithRequestCharactersThatReallyShouldBeEscapedWhenMatchingOnExactUrlPath()\n      throws Exception {\n    stubFor(get(urlPathEqualTo(\"/dodgy-chars\")).willReturn(ok()));\n\n    String url =\n        \"http://localhost:\" + wireMockServer.port() + \"/dodgy-chars?filter={\\\"accountid\\\":\\\"1\\\"}\";\n    int code = getStatusCodeUsingJavaUrlConnection(url);\n\n    assertThat(code, is(200));\n  }\n\n  @Test\n  void matchesQueryCharactersThatStriclyShouldBeEscapedInEitherForm() {\n    stubFor(\n        get(urlPathEqualTo(\"/test\")).withQueryParam(\"filter[id]\", equalTo(\"1\")).willReturn(ok()));\n\n    assertThat(testClient.get(\"/test?filter[id]=1\").statusCode(), is(200));\n    assertThat(testClient.get(\"/test?filter%5Bid%5D=1\").statusCode(), is(200));\n  }\n\n  /*\n  Note: this test case and the next one document a breaking change brought in by Jetty 12.1, whereby the content-type\n  header is normalised to lower case and without a space after the ; prior to being passed to WireMock's matchers.\n   */\n  @Test\n  void doesNotMatchUnnormalisedRequestContentTypeHeaderValue() {\n    String contentType = \"application/json; charset=UTF-8\";\n    String url = \"/request-content-type-case\";\n\n    stubFor(post(url).withHeader(\"Content-Type\", equalTo(contentType)).willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.post(url, new StringEntity(\"{}\"), withHeader(\"Content-Type\", contentType));\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void matchesNormalisedRequestContentTypeHeaderValue() {\n    String url = \"/request-content-type-case\";\n\n    stubFor(\n        post(url)\n            .withHeader(\"Content-Type\", equalTo(\"application/json;charset=utf-8\"))\n            .willReturn(ok()));\n\n    WireMockResponse response =\n        testClient.post(\n            url,\n            new StringEntity(\"{}\"),\n            withHeader(\"Content-Type\", \"application/json; charset=UTF-8\"));\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void returnsContentTypeResponseHeaderEncodingInCorrectCase() {\n    String contentType = \"application/json; charset=UTF-8\";\n    String url = \"/response-content-type-case\";\n\n    stubFor(get(url).willReturn(ok(\"{}\").withHeader(\"Content-Type\", contentType)));\n\n    assertThat(testClient.get(url).firstHeader(\"Content-Type\"), is(contentType));\n  }\n\n  @Test\n  void matchesInRequestBodyOnLiteralZonedDate() {\n    stubFor(\n        post(\"/date\")\n            .withRequestBody(matchingJsonPath(\"$.date\", before(\"2021-10-11T00:00:00Z\")))\n            .willReturn(ok()));\n\n    assertThat(\n        testClient\n            .postJson(\"/date\", \"{\\n\" + \"  \\\"date\\\": \\\"2021-06-22T23:59:59Z\\\"\\n\" + \"}\")\n            .statusCode(),\n        is(200));\n\n    assertThat(\n        testClient\n            .postJson(\"/date\", \"{\\n\" + \"  \\\"date\\\": \\\"2121-06-22T23:59:59Z\\\"\\n\" + \"}\")\n            .statusCode(),\n        is(404));\n  }\n\n  @Test\n  void matchesQueryParameterOnLiteralZonedDate() {\n    stubFor(\n        get(urlPathEqualTo(\"/match-query-parameter\"))\n            .withQueryParam(\"date\", before(\"2021-10-11T00:00:00Z\"))\n            .willReturn(ok()));\n\n    assertThat(\n        testClient.get(\"/match-query-parameter?date=2021-06-22T23%3A59%3A59Z\").statusCode(),\n        is(200));\n\n    assertThat(\n        testClient.get(\"/match-query-parameter?date=2121-06-22T23%3A59%3A59Z\").statusCode(),\n        is(404));\n\n    assertThat(testClient.get(\"/match-query-parameter\").statusCode(), is(404));\n  }\n\n  @Test\n  void matchesOnNowOffsetDate() {\n    stubFor(\n        post(\"/offset-date\")\n            .withRequestBody(\n                matchingJsonPath(\n                    \"$.date\",\n                    isNow()\n                        .expectedOffset(1, HOURS)\n                        .truncateActual(FIRST_MINUTE_OF_HOUR)\n                        .truncateExpected(FIRST_MINUTE_OF_HOUR)))\n            .willReturn(ok()));\n\n    String good = ZonedDateTime.now().truncatedTo(ChronoUnit.HOURS).plusHours(1).toString();\n    String bad =\n        ZonedDateTime.now().truncatedTo(ChronoUnit.HOURS).plusHours(1).minusMinutes(1).toString();\n\n    assertThat(\n        testClient\n            .postJson(\"/offset-date\", \"{\\n\" + \"  \\\"date\\\": \\\"\" + good + \"\\\"\\n\" + \"}\")\n            .statusCode(),\n        is(200));\n\n    assertThat(\n        testClient\n            .postJson(\"/offset-date\", \"{\\n\" + \"  \\\"date\\\": \\\"\" + bad + \"\\\"\\n\" + \"}\")\n            .statusCode(),\n        is(404));\n  }\n\n  @Test\n  void matchesWithLogicalAnd() {\n    stubFor(\n        post(\"/date\")\n            .withRequestBody(\n                matchingJsonPath(\n                    \"$.date\", after(\"2020-05-01T00:00:00Z\").and(before(\"2021-05-01T00:00:00Z\"))))\n            .willReturn(ok()));\n\n    assertThat(\n        testClient\n            .postJson(\"/date\", \"{\\n\" + \"  \\\"date\\\": \\\"2020-12-31T00:00:00Z\\\"\\n\" + \"}\")\n            .statusCode(),\n        is(200));\n\n    assertThat(\n        testClient\n            .postJson(\"/date\", \"{\\n\" + \"  \\\"date\\\": \\\"2011-12-31T00:00:00Z\\\"\\n\" + \"}\")\n            .statusCode(),\n        is(404));\n  }\n\n  @Test\n  void matchesQueryParametersWithLogicalOr() {\n    stubFor(\n        get(urlPathEqualTo(\"/or\"))\n            .withQueryParam(\"q\", equalTo(\"thingtofind\").or(absent()))\n            .willReturn(ok()));\n\n    assertThat(testClient.get(\"/or\").statusCode(), is(200));\n    assertThat(testClient.get(\"/or?q=thingtofind\").statusCode(), is(200));\n    assertThat(testClient.get(\"/or?q=wrong\").statusCode(), is(404));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"provideInputsForMultiValueQueryParamsForExactMatch\")\n  void matchesMultipleQueryParametersUsingExactMatch(\n      final String queryParams, final int statusCode) {\n    stubFor(\n        get(urlPathEqualTo(\"/match\"))\n            .withQueryParam(\"q\", havingExactly(\"1\", \"2\", \"3\"))\n            .willReturn(ok()));\n\n    assertThat(testClient.get(\"/match\" + queryParams).statusCode(), is(statusCode));\n  }\n\n  @Test\n  void matchesMultipleValuesForHeaderUsingExactMatch() {\n    stubFor(\n        get(urlPathEqualTo(\"/match\"))\n            .withHeader(\"q\", havingExactly(\"1\", \"2\", \"3\"))\n            .willReturn(ok()));\n\n    assertThat(\n        testClient\n            .get(\"/match\", withHeader(\"q\", \"1\"), withHeader(\"q\", \"2\"), withHeader(\"q\", \"3\"))\n            .statusCode(),\n        is(200));\n  }\n\n  @Test\n  void matchesMultipleValuesForHeaderUsingIncludesMatch() {\n    stubFor(\n        get(urlPathEqualTo(\"/match\")).withHeader(\"q\", including(\"1\", \"2\", \"3\")).willReturn(ok()));\n\n    assertThat(\n        testClient\n            .get(\n                \"/match\",\n                withHeader(\"q\", \"1\"),\n                withHeader(\"q\", \"2\"),\n                withHeader(\"q\", \"3\"),\n                withHeader(\"q\", \"4\"),\n                withHeader(\"q\", \"5\"))\n            .statusCode(),\n        is(200));\n  }\n\n  @Test\n  void matchesMultipleValuesForHeaderUsingIncludesMatchReturnsNotFound() {\n    stubFor(\n        get(urlPathEqualTo(\"/match\")).withHeader(\"q\", including(\"1\", \"8\", \"3\")).willReturn(ok()));\n\n    assertThat(\n        testClient\n            .get(\n                \"/match\",\n                withHeader(\"q\", \"1\"),\n                withHeader(\"q\", \"2\"),\n                withHeader(\"q\", \"3\"),\n                withHeader(\"q\", \"4\"),\n                withHeader(\"q\", \"5\"))\n            .statusCode(),\n        is(404));\n  }\n\n  @Test\n  void matchesMultipleValuesForHeaderUsingExactMatchReturnsNotFound() {\n    stubFor(\n        get(urlPathEqualTo(\"/match\"))\n            .withHeader(\"q\", havingExactly(\"1\", \"2\", \"3\"))\n            .willReturn(ok()));\n\n    assertThat(\n        testClient\n            .get(\n                \"/match\",\n                withHeader(\"q\", \"1\"),\n                withHeader(\"q\", \"4\"),\n                withHeader(\"q\", \"5\"),\n                withHeader(\"q\", \"6\"),\n                withHeader(\"q\", \"5\"))\n            .statusCode(),\n        is(404));\n  }\n\n  @Test\n  void matchesNoValuesForHeaders() {\n    stubFor(get(urlPathEqualTo(\"/match\")).withHeader(\"q\", noValues()).willReturn(ok()));\n    assertThat(testClient.get(\"/match\").statusCode(), is(200));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"provideInputsForMultiValueQueryParamsForExactMatch\")\n  void matchesMultipleQueryParametersUsingExactMatchWithMultipleValuePatterns(\n      final String queryParams, final int statusCode) {\n    stubFor(\n        get(urlPathEqualTo(\"/match\"))\n            .withQueryParam(\"q\", havingExactly(equalTo(\"1\"), notContaining(\"7\"), equalTo(\"3\")))\n            .willReturn(ok()));\n\n    assertThat(testClient.get(\"/match\" + queryParams).statusCode(), is(statusCode));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"provideInputsForMultiValueQueryParamsForIncludeMatch\")\n  void matchesMultipleQueryParametersUsingIncludeMatch(\n      final String queryParams, final int statusCode) {\n    stubFor(\n        get(urlPathEqualTo(\"/match\"))\n            .withQueryParam(\"q\", including(\"1\", \"2\", \"3\"))\n            .willReturn(ok()));\n\n    assertThat(testClient.get(\"/match\" + queryParams).statusCode(), is(statusCode));\n  }\n\n  public static Stream<Arguments> provideInputsForMultiValueQueryParamsForExactMatch() {\n\n    return Stream.of(\n        Arguments.of(\"?q=1&q=2&q=3\", 200),\n        Arguments.of(\"?q=1&q=3&q=2\", 200),\n        Arguments.of(\"?q=2&q=3&q=1\", 200),\n        Arguments.of(\"?q=2&q=1&q=3\", 200),\n        Arguments.of(\"?q=3&q=1&q=2\", 200),\n        Arguments.of(\"?q=3&q=2&q=1\", 200),\n        Arguments.of(\"?q=3&q=1&q=2\", 200),\n        Arguments.of(\"\", 404),\n        Arguments.of(\"?q=wrong\", 404),\n        Arguments.of(\"?q=1&q=2&q=3&q=4\", 404),\n        Arguments.of(\"?q=1&q=4&q=5&q=6\", 404),\n        Arguments.of(\"?q=1&q=1&q=1&q=1\", 404));\n  }\n\n  public static Stream<Arguments> provideInputsForMultiValueQueryParamsForIncludeMatch() {\n\n    return Stream.of(\n        Arguments.of(\"?q=1&q=2&q=3\", 200),\n        Arguments.of(\"?q=1&q=3&q=2\", 200),\n        Arguments.of(\"?q=2&q=3&q=1\", 200),\n        Arguments.of(\"?q=2&q=1&q=3\", 200),\n        Arguments.of(\"?q=3&q=1&q=2\", 200),\n        Arguments.of(\"?q=3&q=2&q=1\", 200),\n        Arguments.of(\"?q=3&q=1&q=2\", 200),\n        Arguments.of(\"?q=1&q=2&q=3&q=4\", 200),\n        Arguments.of(\"\", 404),\n        Arguments.of(\"?q=wrong\", 404),\n        Arguments.of(\"?q=1&q=4&q=5&q=6\", 404),\n        Arguments.of(\"?q=1&q=1&q=1&q=1\", 404));\n  }\n\n  @Test\n  void matchesHeadersWithLogicalOr() {\n    stubFor(\n        get(urlPathEqualTo(\"/or\"))\n            .withHeader(\n                \"X-Maybe\",\n                equalTo(\"one\").or(containing(\"two\").or(matching(\"thre{2}\")).or(absent())))\n            .willReturn(ok()));\n\n    assertThat(testClient.get(\"/or\").statusCode(), is(200));\n    assertThat(testClient.get(\"/or\", withHeader(\"X-Maybe\", \"one\")).statusCode(), is(200));\n    assertThat(testClient.get(\"/or\", withHeader(\"X-Maybe\", \"two222\")).statusCode(), is(200));\n    assertThat(testClient.get(\"/or\", withHeader(\"X-Maybe\", \"three\")).statusCode(), is(200));\n    assertThat(testClient.get(\"/or\", withHeader(\"X-Maybe\", \"wrong\")).statusCode(), is(404));\n  }\n\n  @Test\n  void jsonResponseWithStringValue() {\n    stubFor(\n        get(\"/json-from-string\")\n            .willReturn(jsonResponse(\"{ \\\"message\\\": \\\"Json From String\\\" }\", 200)));\n\n    WireMockResponse response = testClient.get(\"/json-from-string\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(HttpHeaders.CONTENT_TYPE), is(\"application/json\"));\n    assertThat(response.content(), containsString(\"\\\"Json From String\\\"\"));\n  }\n\n  @Test\n  void jsonResponseWithObjectValue() {\n    stubFor(\n        get(\"/json-from-object\")\n            .willReturn(jsonResponse(new MockResponse(\"Json From Object\"), 200)));\n\n    WireMockResponse response = testClient.get(\"/json-from-object\");\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(HttpHeaders.CONTENT_TYPE), is(\"application/json\"));\n    assertThat(response.content(), containsString(\"\\\"Json From Object\\\"\"));\n  }\n\n  @Test\n  void removesASingleStubMapping() {\n    final UUID id = UUID.randomUUID();\n    stubFor(get(\"/stub-to-remove\").withId(id).willReturn(aResponse()));\n\n    assertThat(testClient.get(\"/stub-to-remove\").statusCode(), is(200));\n\n    StubMapping stub = wireMockServer.getSingleStubMapping(id);\n    wireMockServer.removeStubMapping(stub);\n    assertThat(testClient.get(\"/stub-to-remove\").statusCode(), is(404));\n  }\n\n  @Test\n  void removesASingleStubMappingById() {\n    final UUID id = UUID.randomUUID();\n    stubFor(get(\"/stub-to-remove-by-id\").withId(id).willReturn(aResponse()));\n\n    assertThat(testClient.get(\"/stub-to-remove-by-id\").statusCode(), is(200));\n\n    wireMockServer.removeStubMapping(id);\n    assertThat(testClient.get(\"/stub-to-remove-by-id\").statusCode(), is(404));\n  }\n\n  @Test\n  void queryParamCanBeMatchedAsNotAbsent() {\n    stubFor(get(urlPathEqualTo(\"/search\")).withQueryParam(\"q\", not(absent())).willReturn(ok()));\n\n    assertThat(testClient.get(\"/search?q=something\").statusCode(), is(200));\n    assertThat(testClient.get(\"/search\").statusCode(), is(404));\n  }\n\n  @Test\n  void cannotCreateMultipleStubMappingsWithTheSameId() {\n    final UUID id = UUID.randomUUID();\n    stubFor(get(\"/first-stub-with-id\").withId(id).willReturn(ok()));\n\n    assertThat(testClient.get(\"/first-stub-with-id\").statusCode(), is(200));\n\n    ClientError exception =\n        Assertions.assertThrows(\n            ClientError.class,\n            () -> stubFor(post(\"/second-stub-with-id\").withId(id).willReturn(created())));\n    assertThat(exception.getErrors().getErrors().size(), is(1));\n    assertThat(exception.getErrors().first().getCode(), is(109));\n    assertThat(exception.getErrors().first().getTitle(), is(\"Duplicate stub mapping ID\"));\n    assertThat(\n        exception.getErrors().first().getDetail(),\n        is(\n            \"ID of the provided stub mapping '\"\n                + id\n                + \"' is already taken by another stub mapping\"));\n    assertThat(exception.getErrors().first().getSource(), nullValue());\n    assertThat(testClient.get(\"/second-stub-with-id\").statusCode(), is(404));\n    assertThat(testClient.get(\"/first-stub-with-id\").statusCode(), is(200));\n  }\n\n  @Test\n  void returnsConfiguredNumberOfContentTypeHeaders() {\n    stubFor(\n        get(urlPathEqualTo(\"/foo\"))\n            .willReturn(\n                aResponse()\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withStatus(200)\n                    .withBody(\"{}\")));\n\n    assertThat(\n        testClient.get(\"/foo\").headers().get(\"Content-Type\"),\n        is(List.of(\"application/json\", \"application/json\")));\n  }\n\n  @Test\n  void testStubWithIsOneOfRequestMethods() {\n    stubFor(request(isOneOf(PUT, POST), urlEqualTo(\"/some/url\")).willReturn(ok()));\n\n    WireMockResponse response1 = testClient.request(\"PUT\", \"/some/url\");\n    assertThat(response1.statusCode(), is(200));\n\n    WireMockResponse response2 = testClient.request(\"POST\", \"/some/url\");\n    assertThat(response2.statusCode(), is(200));\n\n    WireMockResponse response3 = testClient.request(\"GET\", \"/some/url\");\n    assertThat(response3.statusCode(), is(404));\n  }\n\n  @Test\n  void testStubWithIsNoneOfRequestMethods() {\n    stubFor(request(isNoneOf(PUT, POST), urlEqualTo(\"/some/url\")).willReturn(ok()));\n\n    WireMockResponse response1 = testClient.request(\"PUT\", \"/some/url\");\n    assertThat(response1.statusCode(), is(404));\n\n    WireMockResponse response2 = testClient.request(\"POST\", \"/some/url\");\n    assertThat(response2.statusCode(), is(404));\n\n    WireMockResponse response3 = testClient.request(\"GET\", \"/some/url\");\n    assertThat(response3.statusCode(), is(200));\n  }\n\n  @Test\n  void testStubWithInvalidIsOneOfRequestMethods() {\n    stubFor(request(isOneOf(PUT, POST), urlEqualTo(\"/some/url\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.request(\"GET\", \"/some/url\");\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void testStubWithInvalidIsNoneOfRequestMethods() {\n    stubFor(request(isNoneOf(PUT, POST), urlEqualTo(\"/some/url\")).willReturn(ok()));\n\n    WireMockResponse response = testClient.request(\"GET\", \"/some/url\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void testStubWithIsOneOfAndAnyRequestMethod() {\n    stubFor(request(isOneOf(PUT, POST, ANY), urlEqualTo(\"/some/url\")).willReturn(ok()));\n\n    WireMockResponse response1 = testClient.request(\"PUT\", \"/some/url\");\n    assertThat(response1.statusCode(), is(200));\n\n    WireMockResponse response2 = testClient.request(\"POST\", \"/some/url\");\n    assertThat(response2.statusCode(), is(200));\n\n    WireMockResponse response3 = testClient.request(\"GET\", \"/some/url\");\n    assertThat(response3.statusCode(), is(404));\n  }\n\n  @Test\n  void testStubWithIsNoneOfAndAnyRequestMethod() {\n    stubFor(request(isNoneOf(PUT, POST, ANY), urlEqualTo(\"/some/url\")).willReturn(ok()));\n\n    WireMockResponse response1 = testClient.request(\"PUT\", \"/some/url\");\n    assertThat(response1.statusCode(), is(404));\n\n    WireMockResponse response2 = testClient.request(\"POST\", \"/some/url\");\n    assertThat(response2.statusCode(), is(404));\n\n    WireMockResponse response3 = testClient.request(\"GET\", \"/some/url\");\n    assertThat(response3.statusCode(), is(200));\n  }\n\n  private int getStatusCodeUsingJavaUrlConnection(String url) throws IOException {\n    HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();\n    connection.setRequestMethod(\"GET\");\n    connection.connect();\n    int code = connection.getResponseCode();\n    connection.disconnect();\n    return code;\n  }\n\n  private Matcher<StubMapping> named(final String name) {\n    return new TypeSafeMatcher<>() {\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"named \" + name);\n      }\n\n      @Override\n      protected boolean matchesSafely(StubMapping item) {\n        return name.equals(item.getName());\n      }\n    };\n  }\n\n  public static class MockResponse {\n\n    private final String message;\n\n    public MockResponse(String message) {\n      this.message = message;\n    }\n\n    public String getMessage() {\n      return message;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/StubbingWithBrowserProxyAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\n\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\nimport org.apache.hc.client5.http.DnsResolver;\nimport org.apache.hc.client5.http.SystemDefaultDnsResolver;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.client5.http.impl.classic.HttpClientBuilder;\nimport org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.HttpHost;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.apache.hc.core5.http.io.support.ClassicRequestBuilder;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class StubbingWithBrowserProxyAcceptanceTest {\n\n  static final String EXPECTED_RESPONSE_BODY = \"Got it\";\n\n  @RegisterExtension\n  public static WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .enableBrowserProxying(true)\n                  .notifier(new ConsoleNotifier(true)))\n          .configureStaticDsl(true)\n          .build();\n\n  static CloseableHttpClient client;\n\n  @BeforeAll\n  public static void init() {\n    client =\n        HttpClientBuilder.create()\n            .setConnectionManager(\n                PoolingHttpClientConnectionManagerBuilder.create()\n                    .setDnsResolver(new CustomLocalTldDnsResolver(\"internal\"))\n                    .build())\n            .setProxy(new HttpHost(\"localhost\", wm.getPort()))\n            .build();\n  }\n\n  @Test\n  public void matchesOnHostname() throws Exception {\n    stubFor(\n        get(urlPathEqualTo(\"/mypath\"))\n            .withHost(equalTo(\"righthost.internal\"))\n            .willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request =\n        ClassicRequestBuilder.get(\"http://righthost.internal/mypath\").build();\n    makeRequestAndAssertOk(request);\n  }\n\n  @Test\n  public void doesNotMatchOnHostnameWhenIncorrect() throws Exception {\n    stubFor(\n        get(urlPathEqualTo(\"/mypath\"))\n            .withHost(equalTo(\"righthost.internal\"))\n            .willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request =\n        ClassicRequestBuilder.get(\"http://wronghost.internal/mypath\").build();\n    makeRequestAndAssertNotOk(request);\n  }\n\n  @Test\n  public void matchesAnyHostnameWhenNotSpecified() throws Exception {\n    stubFor(get(urlPathEqualTo(\"/mypath\")).willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request =\n        ClassicRequestBuilder.get(\"http://whatever.internal/mypath\").build();\n    makeRequestAndAssertOk(request);\n  }\n\n  @Test\n  public void matchesPortNumber() throws Exception {\n    stubFor(get(urlPathEqualTo(\"/mypath\")).withPort(1234).willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request = ClassicRequestBuilder.get(\"http://localhost:1234/mypath\").build();\n    makeRequestAndAssertOk(request);\n  }\n\n  @Test\n  public void doesNotMatchOnPortNumberWhenIncorrect() throws Exception {\n    stubFor(get(urlPathEqualTo(\"/mypath\")).withPort(1234).willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request = ClassicRequestBuilder.get(\"http://localhost:4321/mypath\").build();\n    makeRequestAndAssertNotOk(request);\n  }\n\n  @Test\n  public void matchesClientIp() throws Exception {\n    stubFor(\n        get(urlPathEqualTo(\"/mypath\"))\n            .withClientIp(equalTo(\"192.168.1.1\"))\n            .willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request =\n        ClassicRequestBuilder.get(\"http://localhost:1234/mypath\")\n            .addHeader(\"X-Forwarded-For\", \"192.168.1.1\")\n            .build();\n    makeRequestAndAssertOk(request);\n  }\n\n  @Test\n  public void doesNotMatchClientIpWhenItIsIncorrect() throws Exception {\n    stubFor(\n        get(urlPathEqualTo(\"/mypath\"))\n            .withClientIp(equalTo(\"192.168.1.1\"))\n            .willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request =\n        ClassicRequestBuilder.get(\"http://localhost:1234/mypath\")\n            .addHeader(\"X-Forwarded-For\", \"192.168.100.1\")\n            .build();\n    makeRequestAndAssertNotOk(request);\n  }\n\n  @Test\n  public void doesNotMatchClientIpWhenHeaderIsNotPresent() throws Exception {\n    stubFor(\n        get(urlPathEqualTo(\"/mypath\"))\n            .withClientIp(equalTo(\"5.5.5.5\"))\n            .willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request = ClassicRequestBuilder.get(\"http://localhost:1234/mypath\").build();\n    makeRequestAndAssertNotOk(request);\n  }\n\n  @Test\n  public void matchesOnScheme() throws Exception {\n    stubFor(\n        get(urlPathEqualTo(\"/mypath\")).withScheme(\"http\").willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request = ClassicRequestBuilder.get(\"http://whatever/mypath\").build();\n    makeRequestAndAssertOk(request);\n  }\n\n  @Test\n  public void doesNotMatchWhenSchemeIncorrect() throws Exception {\n    stubFor(\n        get(urlPathEqualTo(\"/mypath\")).withScheme(\"https\").willReturn(ok(EXPECTED_RESPONSE_BODY)));\n\n    ClassicHttpRequest request = ClassicRequestBuilder.get(\"http://whatever/mypath\").build();\n    makeRequestAndAssertNotOk(request);\n  }\n\n  private void makeRequestAndAssertOk(ClassicHttpRequest request) throws Exception {\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(EntityUtils.toString(response.getEntity()), is(EXPECTED_RESPONSE_BODY));\n    }\n  }\n\n  private void makeRequestAndAssertNotOk(ClassicHttpRequest request) throws Exception {\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(EntityUtils.toString(response.getEntity()), not(is(EXPECTED_RESPONSE_BODY)));\n    }\n  }\n\n  private static class CustomLocalTldDnsResolver implements DnsResolver {\n\n    private final String tldToSendToLocalhost;\n\n    public CustomLocalTldDnsResolver(String tldToSendToLocalhost) {\n      this.tldToSendToLocalhost = tldToSendToLocalhost;\n    }\n\n    @Override\n    public InetAddress[] resolve(String host) throws UnknownHostException {\n      if (host.endsWith(\".\" + tldToSendToLocalhost)) {\n        return new InetAddress[] {InetAddress.getLocalHost()};\n      } else {\n        return new SystemDefaultDnsResolver().resolve(host);\n      }\n    }\n\n    @Override\n    public String resolveCanonicalHostname(String host) throws UnknownHostException {\n      final InetAddress[] resolvedAddresses = resolve(host);\n      if (resolvedAddresses.length > 0) {\n        return resolvedAddresses[0].getCanonicalHostName();\n      }\n      return host;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/SubServeEventsAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2023-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.github.tomakehurst.wiremock.verification.diff.DiffEventData;\nimport org.junit.jupiter.api.Test;\n\npublic class SubServeEventsAcceptanceTest extends AcceptanceTestBase {\n\n  // Diffs are saved as sub events\n  @Test\n  void nonMatchDiffsAreSavedAsSubEvents() {\n    wm.stubFor(get(\"/right\").willReturn(ok()));\n\n    testClient.get(\"/wrong\");\n\n    ServeEvent serveEvent = wm.getAllServeEvents().get(0);\n    SubEvent subEvent = serveEvent.getSubEvents().stream().findFirst().get();\n    assertThat(subEvent.getType(), is(\"REQUEST_NOT_MATCHED\"));\n    assertThat(subEvent.getTimeOffsetNanos(), greaterThan(0L));\n    assertThat(subEvent.getDataAs(DiffEventData.class).getReport(), containsString(\"/wrong\"));\n  }\n\n  @Test\n  void errorsDuringMatchingAreCapturedInSubEvents() {\n    wm.stubFor(\n        post(\"/json\").withRequestBody(equalToJson(\"{ \\\"thing\\\": \\\"value\\\" }\")).willReturn(ok()));\n\n    testClient.postJson(\"/json\", \"{ \\\"thing\\\": \");\n\n    ServeEvent serveEvent = wm.getAllServeEvents().get(0);\n    SubEvent failedJsonParseWarning =\n        serveEvent.getSubEvents().stream()\n            .filter(sub -> sub.getType().equals(SubEvent.JSON_ERROR))\n            .findFirst()\n            .get();\n    Errors.Error error =\n        failedJsonParseWarning.getDataAs(Errors.class).getErrors().stream().findFirst().get();\n    assertThat(\n        error.getDetail(), containsString(\"Unexpected end-of-input within/between Object entries\"));\n  }\n\n  @Test\n  void onlyAppendsOneEqualToJsonErrorSubEventPerOccurance() {\n    wm.stubFor(post(\"/json\").withRequestBody(equalToJson(\"{ \\\"thing\\\": 1 }\")).willReturn(ok()));\n    wm.stubFor(post(\"/json\").withRequestBody(equalToJson(\"{ \\\"thing\\\": 2 }\")).willReturn(ok()));\n    wm.stubFor(post(\"/json\").withRequestBody(equalToJson(\"{ \\\"thing\\\": 3 }\")).willReturn(ok()));\n\n    testClient.postXml(\"/json\", \"<whoops />\");\n\n    ServeEvent serveEvent = wm.getAllServeEvents().get(0);\n    assertThat(\n        serveEvent.getSubEvents().stream()\n            .filter(sub -> sub.getType().equals(SubEvent.JSON_ERROR))\n            .count(),\n        is(1L));\n  }\n\n  @Test\n  void onlyAppendsOneXmlParsingSubEventPerOccurance() {\n    wm.stubFor(post(\"/xml\").withRequestBody(equalToXml(\"<some-xml id='1'/>\")).willReturn(ok()));\n    wm.stubFor(post(\"/xml\").withRequestBody(equalToXml(\"<some-xml id='2'/>\")).willReturn(ok()));\n    wm.stubFor(post(\"/xml\").withRequestBody(equalToXml(\"<some-xml id='3'/>\")).willReturn(ok()));\n\n    testClient.postXml(\"/xml\", \"{}\");\n\n    ServeEvent serveEvent = wm.getAllServeEvents().get(0);\n    assertThat(\n        serveEvent.getSubEvents().stream()\n            .filter(sub -> sub.getType().equals(SubEvent.WARNING))\n            .count(),\n        is(1L));\n  }\n\n  @Test\n  void onlyAppendsOneMatchesJsonPathErrorSubEventPerOccurance() {\n    wm.stubFor(post(\"/json\").withRequestBody(matchingJsonPath(\"$.thing\")).willReturn(ok()));\n    wm.stubFor(post(\"/json\").withRequestBody(matchingJsonPath(\"$.id\")).willReturn(ok()));\n    wm.stubFor(post(\"/json\").withRequestBody(matchingJsonPath(\"$.name\")).willReturn(ok()));\n\n    testClient.postXml(\"/json\", \"<whoops />\");\n\n    ServeEvent serveEvent = wm.getAllServeEvents().get(0);\n    assertThat(\n        serveEvent.getSubEvents().stream()\n            .filter(sub -> sub.getType().equals(SubEvent.WARNING))\n            .count(),\n        is(1L));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/TemplateHelperExtensionTest.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.post;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.tomakehurst.wiremock.extension.TemplateHelperProviderExtension;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class TemplateHelperExtensionTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(\n              wireMockConfig()\n                  .dynamicPort()\n                  .templatingEnabled(true)\n                  .globalTemplating(true)\n                  .extensions(\n                      new TemplateHelperProviderExtension() {\n                        @Override\n                        public String getName() {\n                          return \"custom-helpers\";\n                        }\n\n                        @Override\n                        public Map<String, Helper<?>> provideTemplateHelpers() {\n                          Helper<String> helper = (context, options) -> context.length();\n                          return Map.of(\"string-length\", helper);\n                        }\n                      }))\n          .build();\n\n  WireMockTestClient client;\n\n  @BeforeEach\n  void init() {\n    client = new WireMockTestClient(wm.getPort());\n  }\n\n  @Test\n  void appliesHelpersFromProvider() {\n    wm.stubFor(post(\"/things\").willReturn(ok(\"{{{ string-length request.body }}}\")));\n\n    WireMockResponse response = client.postWithBody(\"/things\", \"fiver\");\n\n    assertThat(response.content(), is(\"5\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/TemplateModelDataProviderExtensionTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.extension.TemplateModelDataProviderExtension;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class TemplateModelDataProviderExtensionTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(\n              wireMockConfig()\n                  .dynamicPort()\n                  .templatingEnabled(true)\n                  .globalTemplating(true)\n                  .extensions(\n                      new TemplateModelDataProviderExtension() {\n                        @Override\n                        public Map<String, Object> provideTemplateModelData(ServeEvent serveEvent) {\n                          return Map.of(\n                              \"customData\", Map.of(\"path\", serveEvent.getRequest().getUrl()));\n                        }\n\n                        @Override\n                        public String getName() {\n                          return \"custom-model-data\";\n                        }\n                      }))\n          .build();\n\n  WireMockTestClient client;\n\n  @BeforeEach\n  void init() {\n    client = new WireMockTestClient(wm.getPort());\n  }\n\n  @Test\n  void appliesHelpersFromProvider() {\n    wm.stubFor(get(\"/things\").willReturn(ok(\"{{{ customData.path }}}\")));\n\n    WireMockResponse response = client.get(\"/things\");\n\n    assertThat(response.content(), is(\"/things\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/TransferEncodingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.filePath;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.notNullValue;\nimport static org.hamcrest.Matchers.nullValue;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\npublic class TransferEncodingAcceptanceTest {\n\n  WireMockServer wm;\n  WireMockTestClient testClient;\n\n  @Test\n  public void sendsContentLengthWhenTransferEncodingChunkedPolicyIsNever() {\n    startWithChunkedEncodingPolicy(Options.ChunkedEncodingPolicy.NEVER);\n\n    final String url = \"/content-length-encoding\";\n    final String body = \"Body content\";\n\n    wm.stubFor(get(url).willReturn(ok(body)));\n\n    WireMockResponse response = testClient.get(url);\n    assertThat(response.statusCode(), is(200));\n\n    String expectedContentLength = String.valueOf(body.getBytes().length);\n    assertThat(response.firstHeader(\"Transfer-Encoding\"), nullValue());\n    assertThat(response.firstHeader(\"Content-Length\"), is(expectedContentLength));\n  }\n\n  @Test\n  public void sendsTransferEncodingChunkedWhenPolicyIsAlways() {\n    startWithChunkedEncodingPolicy(Options.ChunkedEncodingPolicy.ALWAYS);\n\n    final String url = \"/chunked-encoding-always\";\n    final String body = \"Body content\";\n\n    wm.stubFor(get(url).willReturn(ok(body)));\n\n    WireMockResponse response = testClient.get(url);\n    assertThat(response.statusCode(), is(200));\n\n    assertThat(response.firstHeader(\"Transfer-Encoding\"), is(\"chunked\"));\n    assertThat(response.firstHeader(\"Content-Length\"), nullValue());\n  }\n\n  @Test\n  public void sendsTransferEncodingChunkedWhenPolicyIsBodyFileAndBodyFileIsUsed() {\n    startWithChunkedEncodingPolicy(Options.ChunkedEncodingPolicy.BODY_FILE);\n\n    final String fileUrl = \"/chunked-encoding-body\";\n    final String inlineBodyUrl = \"/chunked-encoding-body-file\";\n\n    wm.stubFor(get(fileUrl).willReturn(ok().withBodyFile(\"plain-example.txt\")));\n    wm.stubFor(get(inlineBodyUrl).willReturn(ok(\"Body content\")));\n\n    WireMockResponse response = testClient.get(fileUrl);\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Transfer-Encoding\"), is(\"chunked\"));\n    assertThat(response.firstHeader(\"Content-Length\"), nullValue());\n\n    response = testClient.get(inlineBodyUrl);\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Transfer-Encoding\"), nullValue());\n    assertThat(response.firstHeader(\"Content-Length\"), notNullValue());\n  }\n\n  @Test\n  public void sendsContentLengthWhenTransferEncodingChunkedPolicyIsNeverAndDribbleDelayIsApplied() {\n    startWithChunkedEncodingPolicy(Options.ChunkedEncodingPolicy.NEVER);\n\n    final String url = \"/content-length-encoding\";\n    final String body = \"Slightly longer body content in this string\";\n\n    wm.stubFor(get(url).willReturn(ok(body).withChunkedDribbleDelay(5, 200)));\n\n    WireMockResponse response = testClient.get(url);\n    assertThat(response.statusCode(), is(200));\n\n    String expectedContentLength = String.valueOf(body.getBytes().length);\n    assertThat(response.firstHeader(\"Transfer-Encoding\"), nullValue());\n    assertThat(response.firstHeader(\"Content-Length\"), is(expectedContentLength));\n  }\n\n  @Test\n  public void sendsSpecifiedContentLengthInResponseWhenChunkedEncodingEnabled() throws Exception {\n    startWithChunkedEncodingPolicy(Options.ChunkedEncodingPolicy.ALWAYS);\n\n    String path = \"/length\";\n    wm.stubFor(\n        get(path)\n            .willReturn(ok(String.valueOf('a').repeat(1234)).withHeader(\"Content-Length\", \"1234\")));\n\n    CloseableHttpClient httpClient = ApacheHttpClientFactory.createClient();\n    HttpGet request = new HttpGet(wm.baseUrl() + path);\n    try (final CloseableHttpResponse response = httpClient.execute(request)) {\n      assertThat(response.getFirstHeader(\"Content-Length\").getValue(), is(\"1234\"));\n    }\n  }\n\n  @Test\n  public void sendsSpecifiedContentLengthInResponseWhenChunkedEncodingDisabled() throws Exception {\n    startWithChunkedEncodingPolicy(Options.ChunkedEncodingPolicy.NEVER);\n\n    String path = \"/length\";\n    wm.stubFor(\n        get(path)\n            .willReturn(ok(String.valueOf('a').repeat(1234)).withHeader(\"Content-Length\", \"1234\")));\n\n    CloseableHttpClient httpClient = ApacheHttpClientFactory.createClient();\n    HttpGet request = new HttpGet(wm.baseUrl() + path);\n    try (CloseableHttpResponse response = httpClient.execute(request)) {\n      assertThat(response.getFirstHeader(\"Content-Length\").getValue(), is(\"1234\"));\n    }\n  }\n\n  private void startWithChunkedEncodingPolicy(Options.ChunkedEncodingPolicy chunkedEncodingPolicy) {\n    wm =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .withRootDirectory(filePath(\"test-file-root\"))\n                .useChunkedTransferEncoding(chunkedEncodingPolicy));\n    wm.start();\n\n    testClient = new WireMockTestClient(wm.port());\n  }\n\n  @AfterEach\n  public void cleanup() {\n    wm.stop();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/UriComplianceTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class UriComplianceTest {\n\n  @RegisterExtension\n  public WireMockExtension wireMockServer =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort())\n          .configureStaticDsl(true)\n          .build();\n\n  private WireMockTestClient testClient;\n\n  @BeforeEach\n  public void init() {\n    testClient = new WireMockTestClient(wireMockServer.getPort());\n  }\n\n  @Test\n  public void buildsMappingWithEmptySegment() {\n    givenThat(get(urlEqualTo(\"/my//resource\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(testClient.get(\"/my//resource\").statusCode(), is(200));\n  }\n\n  @Test\n  public void buildsMappingWithAmbiguousSegment() {\n    givenThat(get(urlPathEqualTo(\"/my/%2e/resource\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(testClient.get(\"/my/%2e/resource\").statusCode(), is(200));\n  }\n\n  @Test\n  public void buildsMappingWithAmbiguousPathSeparator() {\n    givenThat(get(urlPathEqualTo(\"/foo/b%2fr\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(testClient.get(\"/foo/b%2fr\").statusCode(), is(200));\n  }\n\n  @Test\n  public void buildsMappingWithAmbiguousPathParameter() {\n    givenThat(get(urlPathEqualTo(\"/foo/..;/bar\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(testClient.get(\"/foo/..;/bar\").statusCode(), is(200));\n  }\n\n  @Test\n  public void buildsMappingWithAmbiguousPathEncoding() {\n    givenThat(get(urlPathEqualTo(\"/%2557EB-INF\")).willReturn(aResponse().withStatus(200)));\n\n    assertThat(testClient.get(\"/%2557EB-INF\").statusCode(), is(200));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/UrlMatchingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport org.junit.jupiter.api.Test;\n\npublic class UrlMatchingAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void mappingMatchedWithRegexUrl() {\n    String REGEX_URL_MAPPING_REQUEST =\n        \"{ \t\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n            + \"\t\\\"request\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n            + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\\n\"\n            + \"\t\t\\\"urlPattern\\\": \\\"/one/(.*?)/three\\\"\t\t\\n\"\n            + \"\t},\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n            + \"\t\\\"response\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n            + \"\t\t\\\"body\\\": \\\"Matched!\\\"\t\t\t\t\t\t\\n\"\n            + \"\t}\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n            + \"}\t\t\t\t\t\t\t\t\t\t\t\t\t  \";\n\n    testClient.addResponse(REGEX_URL_MAPPING_REQUEST);\n    WireMockResponse response = testClient.get(\"/one/two/three\");\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.content(), is(\"Matched!\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/UrlPathTemplateMatchingTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\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.assertThrows;\n\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport org.junit.jupiter.api.Test;\n\npublic class UrlPathTemplateMatchingTest extends AcceptanceTestBase {\n\n  @Test\n  void matches_path_template_without_bound_variable() {\n    stubFor(get(urlPathTemplate(\"/v1/contacts/{contactId}\")).willReturn(ok()));\n\n    assertThat(testClient.get(\"/v1/contacts/12345\").statusCode(), is(200));\n    assertThat(testClient.get(\"/v1/contacts/23456\").statusCode(), is(200));\n\n    assertThat(testClient.get(\"/v2/contacts/23456\").statusCode(), is(404));\n  }\n\n  @Test\n  void matches_path_template_with_single_bound_variable() {\n    stubFor(\n        get(urlPathTemplate(\"/v1/contacts/{contactId}/addresses/{addressId}\"))\n            .withPathParam(\"contactId\", equalTo(\"12345\"))\n            .withPathParam(\"addressId\", equalTo(\"99876\"))\n            .willReturn(ok()));\n\n    assertThat(testClient.get(\"/v1/contacts/12345/addresses/99876\").statusCode(), is(200));\n\n    assertThat(testClient.get(\"/v1/contacts/12345/addresses/55555\").statusCode(), is(404));\n    assertThat(testClient.get(\"/v1/contacts/23456/addresses/99876\").statusCode(), is(404));\n    assertThat(testClient.get(\"/v1/contacts/23456/addresses/55555\").statusCode(), is(404));\n  }\n\n  @Test\n  void returns_non_match_without_error_when_request_url_path_does_not_match_template() {\n    stubFor(\n        get(urlPathTemplate(\"/contacts/{contactId}/addresses/{addressId}\"))\n            .withPathParam(\"contactId\", equalTo(\"123\"))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/contacts/123/addresssssses/1\");\n    assertThat(response.content(), containsString(\"Request was not matched\"));\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void correctly_matches_when_query_parameters_present_in_request_and_last_path_node_is_variable() {\n    stubFor(\n        get(urlPathTemplate(\"/contacts/{contactId}\"))\n            .withPathParam(\"contactId\", equalTo(\"123\"))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/contacts/123?detail=summary\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void correctly_matches_when_query_parameters_present_in_request_and_last_path_node_is_constant() {\n    stubFor(\n        get(urlPathTemplate(\"/contacts/{contactId}/address\"))\n            .withPathParam(\"contactId\", equalTo(\"123\"))\n            .willReturn(ok()));\n\n    WireMockResponse response = testClient.get(\"/contacts/123/address?detail=summary\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void static_dsl_throws_error_when_attempting_to_use_path_param_matchers_without_path_template() {\n    assertThrows(\n        InvalidInputException.class,\n        () ->\n            stubFor(\n                get(urlPathEqualTo(\"/stuff\"))\n                    .withPathParam(\"wrong\", containing(\"things\"))\n                    .willReturn(ok())));\n  }\n\n  @Test\n  void\n      instance_dsl_throws_error_when_attempting_to_use_path_param_matchers_without_path_template() {\n    assertThrows(\n        InvalidInputException.class,\n        () ->\n            wm.stubFor(\n                get(urlPathEqualTo(\"/stuff\"))\n                    .withPathParam(\"wrong\", containing(\"things\"))\n                    .willReturn(ok())));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/VerificationAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.Metadata.metadata;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.forCustomMatcher;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.findServeEventWithUrl;\nimport static com.github.tomakehurst.wiremock.verification.diff.JUnitStyleDiffRenderer.junitStyleDiffMessage;\nimport static java.lang.System.lineSeparator;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.allOf;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.notNullValue;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.fail;\n\nimport com.github.tomakehurst.wiremock.client.VerificationException;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcher;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.github.tomakehurst.wiremock.verification.RequestJournalDisabledException;\nimport java.util.List;\nimport java.util.UUID;\nimport org.apache.hc.client5.http.entity.EntityBuilder;\nimport org.apache.hc.core5.http.HttpEntity;\nimport org.apache.hc.core5.http.message.BasicNameValuePair;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.ValueSource;\n\npublic class VerificationAcceptanceTest {\n\n  @Nested\n  class JournalEnabled extends AcceptanceTestBase {\n\n    @Test\n    void verifiesRequestBasedOnUrlOnly() {\n      testClient.get(\"/this/got/requested?query\");\n      verify(getRequestedFor(urlEqualTo(\"/this/got/requested?query\")));\n    }\n\n    @Test\n    void anyRequestedForMatchesAnyHttpMethod() {\n      testClient.get(\"/this/got/requested?query\");\n      verify(anyRequestedFor(urlEqualTo(\"/this/got/requested?query\")));\n    }\n\n    @Test\n    void queryRequestedForMatchesAnyHttpMethod() {\n      testClient.query(\"/this/got/requested?query\");\n      verify(anyRequestedFor(urlEqualTo(\"/this/got/requested?query\")));\n      verify(queryRequestedFor(urlEqualTo(\"/this/got/requested?query\")));\n    }\n\n    @Test\n    void throwsVerificationExceptionOnUrlEqualsWhenQueryMissing() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/this/got/requested?query\");\n            verify(getRequestedFor(urlEqualTo(\"/this/got/requested\")));\n          });\n    }\n\n    @Test\n    void throwsVerificationExceptionOnUrlEqualsWhenPathShorter() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/this/got/requested?query\");\n            verify(getRequestedFor(urlEqualTo(\"/this/got/requeste?query\")));\n          });\n    }\n\n    @Test\n    void throwsVerificationExceptionOnUrlEqualsWhenExtraPathPresent() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/this/got/requested?query\");\n            verify(getRequestedFor(urlEqualTo(\"/this/got/requested/?query\")));\n          });\n    }\n\n    @Test\n    void verifiesRequestBasedOnUrlPathOnly() {\n      testClient.get(\"/this/got/requested?query\");\n      verify(getRequestedFor(urlPathEqualTo(\"/this/got/requested\")));\n    }\n\n    @Test\n    void throwsVerificationExceptionOnUrlPathEqualsWhenPathShorter() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/this/got/requested?query\");\n            verify(getRequestedFor(urlPathEqualTo(\"/this/got/requeste\")));\n          });\n    }\n\n    @Test\n    void throwsVerificationExceptionOnUrlPathEqualsWhenExtraPathPresent() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/this/got/requested?query\");\n            verify(getRequestedFor(urlPathEqualTo(\"/this/got/requested/\")));\n          });\n    }\n\n    @Test\n    void verifiesRequestBasedOnUrlPathPatternOnly() {\n      testClient.get(\"/this/got/requested\");\n      verify(getRequestedFor(urlPathMatching(\"/(.*?)/got/.*\")));\n    }\n\n    @Test\n    void throwsVerificationExceptionOnUrlPathPatternWhenOnlyPrefixMatching() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/this/got/requested\");\n            verify(getRequestedFor(urlPathMatching(\"/(.*?)/got/\")));\n          });\n    }\n\n    @Test\n    void throwsVerificationExceptionOnUrlPathPatternWhenOnlySuffixMatching() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/this/got/requested\");\n            verify(getRequestedFor(urlPathMatching(\"/got/.*\")));\n          });\n    }\n\n    @Test\n    void throwsVerificationExceptionWhenNoMatch() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/this/got/requested\");\n            verify(getRequestedFor(urlEqualTo(\"/this/did/not\")));\n          });\n    }\n\n    @Test\n    void verifiesWithHeaders() {\n      testClient.put(\n          \"/update/this\",\n          withHeader(\"Content-Type\", \"application/json\"),\n          withHeader(\"Encoding\", \"UTF-8\"));\n      verify(\n          putRequestedFor(urlMatching(\"/[a-z]+/this\"))\n              .withHeader(\"Content-Type\", equalTo(\"application/json\"))\n              .withHeader(\"Encoding\", notMatching(\"LATIN-1\")));\n    }\n\n    @Test\n    void verifiesWithMultiValueHeaders() {\n      testClient.get(\n          \"/multi/value/header\",\n          withHeader(\"X-Thing\", \"One\"),\n          withHeader(\"X-Thing\", \"Two\"),\n          withHeader(\"X-Thing\", \"Three\"));\n\n      verify(\n          getRequestedFor(urlEqualTo(\"/multi/value/header\"))\n              .withHeader(\"X-Thing\", equalTo(\"Two\"))\n              .withHeader(\"X-Thing\", matching(\"Thr.*\")));\n\n      verify(\n          getRequestedFor(urlEqualTo(\"/multi/value/header\"))\n              .withHeader(\"X-Thing\", equalTo(\"Three\")));\n    }\n\n    @Test\n    void findsRequestsWithMultiValueHeaders() {\n      testClient.get(\n          \"/multi/value/header\",\n          withHeader(\"X-Thing\", \"One\"),\n          withHeader(\"X-Thing\", \"Two\"),\n          withHeader(\"X-Thing\", \"Three\"));\n\n      List<LoggedRequest> requests = findAll(getRequestedFor(urlEqualTo(\"/multi/value/header\")));\n\n      HttpHeaders headers = requests.get(0).getHeaders();\n      assertThat(headers.getHeader(\"X-Thing\").values().size(), is(3));\n      assertThat(headers.getHeader(\"X-Thing\").values().get(1), is(\"Two\"));\n    }\n\n    @Test\n    void throwsVerificationExceptionWhenHeadersDoNotMatch() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.put(\n                \"/to/modify\",\n                withHeader(\"Content-Type\", \"application/json\"),\n                withHeader(\"Encoding\", \"LATIN-1\"));\n            verify(\n                putRequestedFor(urlEqualTo(\"/to/modify\"))\n                    .withHeader(\"Content-Type\", equalTo(\"application/json\"))\n                    .withHeader(\"Encoding\", notMatching(\"LATIN-1\")));\n          });\n    }\n\n    private static final String SAMPLE_JSON =\n        \"{ \t\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n            + \"\t\\\"thing\\\": {\t\t\t\t\t\t\t\t\t\\n\"\n            + \"\t\t\\\"importantKey\\\": \\\"Important value\\\"\t\t\\n\"\n            + \"\t}\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n            + \"}\t\t\t\t\t\t\t\t\t\t\t\t\t\";\n\n    @Test\n    void verifiesWithBody() {\n      testClient.postWithBody(\"/add/this\", SAMPLE_JSON, \"application/json\", \"utf-8\");\n      verify(\n          postRequestedFor(urlEqualTo(\"/add/this\"))\n              .withRequestBody(matching(\".*\\\"importantKey\\\": \\\"Important value\\\".*\")));\n    }\n\n    @Test\n    void verifiesWithBodyContainingJson() {\n      testClient.postWithBody(\"/body/contains\", SAMPLE_JSON, \"application/json\", \"utf-8\");\n      verify(\n          postRequestedFor(urlEqualTo(\"/body/contains\"))\n              .withRequestBody(matchingJsonPath(\"$.thing\"))\n              .withRequestBody(\n                  matchingJsonPath(\"$..thing[?(@.importantKey == 'Important value')]\")));\n    }\n\n    @Test\n    void verifiesWithBodyEquallingJson() {\n      testClient.postWithBody(\"/body/json\", SAMPLE_JSON, \"application/json\", \"utf-8\");\n      verify(postRequestedFor(urlEqualTo(\"/body/json\")).withRequestBody(equalToJson(SAMPLE_JSON)));\n    }\n\n    @Test\n    void verifiesWithBodyEquallingJsonWithCompareMode() {\n      testClient.postWithBody(\n          \"/body/json/lenient\",\n          \"{ \\\"message\\\": \\\"Hello\\\", \\\"key\\\": \\\"welcome.message\\\" }\",\n          \"application/json\",\n          \"utf-8\");\n      verify(\n          postRequestedFor(urlEqualTo(\"/body/json/lenient\"))\n              .withRequestBody(equalToJson(\"{ \\\"message\\\": \\\"Hello\\\" }\", true, true)));\n    }\n\n    @Test\n    void verifiesWithBodyEquallingXml() {\n      testClient.postWithBody(\n          \"/body/xml\", \"<thing><subThing>The stuff</subThing></thing>\", \"application/xml\", \"utf-8\");\n      verify(\n          postRequestedFor(urlEqualTo(\"/body/xml\"))\n              .withRequestBody(\n                  equalToXml(\"<thing>     <subThing>The stuff\\n</subThing>\\n\\n    </thing>\")));\n    }\n\n    @Test\n    void verifiesWithBodyEquallingXpath() {\n      testClient.postWithBody(\n          \"/body/xml\", \"<thing><subThing>The stuff</subThing></thing>\", \"application/xml\", \"utf-8\");\n      verify(\n          postRequestedFor(urlEqualTo(\"/body/xml\"))\n              .withRequestBody(matchingXPath(\"//subThing[.='The stuff']\")));\n    }\n\n    @Test\n    void verifiesWithBodyEquallingNamespacedXpath() {\n      testClient.postWithBody(\n          \"/namespaced/xml\",\n          \"<t:thing xmlns:t='http://things' xmlns:s='http://subthings'><s:subThing>The stuff</s:subThing></t:thing>\",\n          \"application/xml\",\n          \"utf-8\");\n\n      verify(\n          postRequestedFor(urlEqualTo(\"/namespaced/xml\"))\n              .withRequestBody(\n                  matchingXPath(\"//s:subThing[.='The stuff']\")\n                      .withXPathNamespace(\"t\", \"http://things\")\n                      .withXPathNamespace(\"s\", \"http://subthings\")));\n    }\n\n    @Test\n    void verifiesWithBodyContainingString() {\n      testClient.postWithBody(\"/body/json\", SAMPLE_JSON, \"application/json\", \"utf-8\");\n      verify(\n          postRequestedFor(urlEqualTo(\"/body/json\"))\n              .withRequestBody(containing(\"Important value\")));\n    }\n\n    @Test\n    void throwsVerificitationExceptionWhenBodyMatches() {\n      testClient.postWithBody(\"/body/json\", SAMPLE_JSON, \"application/json\", \"utf-8\");\n      assertThrows(\n          VerificationException.class,\n          () ->\n              verify(\n                  postRequestedFor(urlEqualTo(\"/body/json\"))\n                      .withRequestBody(not(containing(\"Important value\")))));\n    }\n\n    @Test\n    void verifiesWithBodyDoesNotContainValue() {\n      testClient.postWithBody(\"/body/json\", SAMPLE_JSON, \"application/json\", \"utf-8\");\n      verify(postRequestedFor(urlEqualTo(\"/body/json\")).withRequestBody(not(containing(\"stuff\"))));\n    }\n\n    @Test\n    void verifiesWithHeaderDoesNotContainValue() {\n      testClient.get(\"/header/not\", withHeader(\"X-Thing\", \"One\"));\n      verify(\n          getRequestedFor(urlEqualTo(\"/header/not\"))\n              .withHeader(\"X-Thing\", not(containing(\"Four\"))));\n    }\n\n    @Test\n    void verifiesWithQueryParam() {\n      testClient.get(\"/query?param=my-value\");\n      verify(\n          getRequestedFor(urlPathEqualTo(\"/query\")).withQueryParam(\"param\", equalTo(\"my-value\")));\n    }\n\n    @Test\n    void queryParameterMatchingCopesWithSpaces() {\n      testClient.get(\"/spacey-query?param=My%20Value\");\n      verify(\n          getRequestedFor(urlPathEqualTo(\"/spacey-query\"))\n              .withQueryParam(\"param\", equalTo(\"My Value\")));\n    }\n\n    @Test\n    void verifyIsFalseWithQueryParamNotMatched() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/query?param=my-value\");\n            verify(\n                getRequestedFor(urlPathEqualTo(\"/query\"))\n                    .withQueryParam(\"param\", equalTo(\"wrong-value\")));\n          });\n    }\n\n    @Test\n    void verifyIsFalseWhenExpectedQueryParamMissing() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/query\");\n            verify(\n                getRequestedFor(urlPathEqualTo(\"/query\"))\n                    .withQueryParam(\"param\", equalTo(\"my-value\")));\n          });\n    }\n\n    @Test\n    void verifiesQueryParamAbsent() {\n      testClient.get(\"/without/queryParam?test-param=test-value\");\n      verify(\n          getRequestedFor(urlPathEqualTo(\"/without/queryParam\"))\n              .withQueryParam(\"test-param\", equalTo(\"test-value\"))\n              .withoutQueryParam(\"absent-param\"));\n    }\n\n    @Test\n    void failsVerificationWhenAbsentQueryParamPresent() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/without/queryParam?test-param=test-value\");\n            verify(\n                getRequestedFor(urlPathEqualTo(\"/without/queryParam\"))\n                    .withoutQueryParam(\"test-param\"));\n          });\n    }\n\n    @Test\n    void resetErasesCounters() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\"/count/this\");\n            testClient.get(\"/count/this\");\n            testClient.get(\"/count/this\");\n\n            WireMock.reset();\n\n            verify(getRequestedFor(urlEqualTo(\"/count/this\")));\n          });\n    }\n\n    @Test\n    void verifiesArbitraryRequestCount() {\n      testClient.get(\"/add/to/count\");\n      testClient.get(\"/add/to/count\");\n      testClient.get(\"/add/to/count\");\n      testClient.get(\"/add/to/count\");\n\n      verify(4, getRequestedFor(urlEqualTo(\"/add/to/count\")));\n    }\n\n    private void getCountableRequests(int count) {\n      for (int i = 0; i < count; i++) {\n        testClient.get(\"/add/to/count\");\n      }\n    }\n\n    @Test\n    void verifiesLessThanCountWithLessRequests() {\n      getCountableRequests(4);\n      verify(lessThan(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n    }\n\n    @Test\n    void doesNotVerifyLessThanCountWithEqualRequests() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            getCountableRequests(5);\n            verify(lessThan(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n          });\n    }\n\n    @Test\n    void doesNotVerifyLessThanCountWithMoreRequests() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            getCountableRequests(6);\n            verify(lessThan(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n          });\n    }\n\n    @Test\n    void verifiesLessThanOrExactlyCountWithLessRequests() {\n      getCountableRequests(4);\n      verify(lessThanOrExactly(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n    }\n\n    @Test\n    void verifiesLessThanOrExactlyCountWithEqualRequests() {\n      getCountableRequests(5);\n      verify(lessThanOrExactly(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n    }\n\n    @Test\n    void doesNotVerifyLessThanOrExactlyCountWithMoreRequests() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            getCountableRequests(6);\n            verify(lessThanOrExactly(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n          });\n    }\n\n    @Test\n    void doesNotVerifyExactCountWithLessRequests() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            getCountableRequests(4);\n            verify(exactly(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n          });\n    }\n\n    @Test\n    void verifiesExactlyThanCountWithExactRequests() {\n      getCountableRequests(5);\n      verify(exactly(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n    }\n\n    @Test\n    void doesNotVerifyExactCountWithMoreRequests() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            getCountableRequests(6);\n            verify(exactly(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n          });\n    }\n\n    @Test\n    void doesNotVerifyMoreThanOrExactlyCountWithLessRequests() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            getCountableRequests(4);\n            verify(moreThanOrExactly(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n          });\n    }\n\n    @Test\n    void verifiesMoreThanOrExactlyCountWithEqualRequests() {\n      getCountableRequests(5);\n      verify(moreThanOrExactly(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n    }\n\n    @Test\n    void verifiesMoreThanOrExactlyCountWithMoreRequests() {\n      getCountableRequests(6);\n      verify(moreThanOrExactly(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n    }\n\n    @Test\n    void doesNotVerifyMoreThanCountWithLessRequests() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            getCountableRequests(4);\n            verify(moreThan(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n          });\n    }\n\n    @Test\n    void doesNotVerifyMoreThanCountWithEqualRequests() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            getCountableRequests(5);\n            verify(moreThan(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n          });\n    }\n\n    @Test\n    void verifiesMoreThanCountWithMoreRequests() {\n      getCountableRequests(6);\n      verify(moreThan(5), getRequestedFor(urlEqualTo(\"/add/to/count\")));\n    }\n\n    @Test\n    void verifiesHeaderAbsent() {\n      testClient.get(\"/without/header\", withHeader(\"Content-Type\", \"application/json\"));\n      verify(\n          getRequestedFor(urlEqualTo(\"/without/header\"))\n              .withHeader(\"Content-Type\", equalTo(\"application/json\"))\n              .withoutHeader(\"Accept\"));\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"GET\", \"POST\", \"PUT\", \"HEAD\", \"TRACE\", \"PATCH\", \"OPTIONS\", \"DELETE\", \"ANY\", \"RANDOM\"\n        })\n    void verifyRequestedForSameMethodAsRequest(String method) {\n      testClient.request(method, \"/methods\");\n      verify(requestedFor(method, urlEqualTo(\"/methods\")));\n    }\n\n    @Test\n    void failsVerificationWhenAbsentHeaderPresent() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.get(\n                \"/without/another/header\", withHeader(\"Content-Type\", \"application/json\"));\n            verify(\n                getRequestedFor(urlEqualTo(\"/without/another/header\"))\n                    .withoutHeader(\"Content-Type\"));\n          });\n    }\n\n    @Test\n    void verifiesBodyAbsent() {\n      testClient.post(\"/no/body\");\n      verify(postRequestedFor(urlEqualTo(\"/no/body\")).withRequestBody(absent()));\n    }\n\n    @Test\n    void failsVerificationWhenAbsentBodyPresent() {\n      assertThrows(\n          VerificationException.class,\n          () -> {\n            testClient.postWithBody(\"/no/body\", \"not absent\");\n            verify(postRequestedFor(urlEqualTo(\"/no/body\")).withRequestBody(absent()));\n          });\n    }\n\n    @Test\n    void showsDiffWithNearestMissWhenNoRequestsMatchedAndNearMissesAreAvailable() {\n      testClient.get(\"/my-near-miss\");\n      testClient.get(\"/near-miss\");\n\n      try {\n        verify(getRequestedFor(urlEqualTo(\"/a-near-miss\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(\n            e.getMessage(),\n            containsString(\n                junitStyleDiffMessage(\"GET\\n\" + \"/a-near-miss\\n\", \"GET\\n\" + \"/my-near-miss\\n\")));\n      }\n    }\n\n    @Test\n    void showsExpectedRequestAndCountShortfallWhenNotEnoughMatchingRequestsAreReceived() {\n      testClient.get(\"/hit\");\n      testClient.get(\"/hit\");\n\n      try {\n        verify(3, getRequestedFor(urlEqualTo(\"/hit\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(\n            e.getMessage(),\n            is(\n                \"Expected exactly 3 requests matching the following pattern but received 2:\\n\"\n                    + \"{\"\n                    + lineSeparator()\n                    + \"  \\\"url\\\" : \\\"/hit\\\",\"\n                    + lineSeparator()\n                    + \"  \\\"method\\\" : \\\"GET\\\"\"\n                    + lineSeparator()\n                    + \"}\"));\n      }\n    }\n\n    @Test\n    void showsNearMissDiffWhenCountSpecifiedAndNoMatchingRequestsAreReceived() {\n      testClient.get(\"/miss\");\n      testClient.get(\"/miss\");\n\n      try {\n        verify(3, getRequestedFor(urlEqualTo(\"/hit\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(\n            e.getMessage(), containsString(junitStyleDiffMessage(\"GET\\n/hit\\n\", \"GET\\n/miss\\n\")));\n      }\n    }\n\n    @Test\n    void showsExpectedRequestAndCountShortfallWhenWrongNumberOfMatchingRequestsAreReceived() {\n      testClient.get(\"/hit\");\n      testClient.get(\"/hit\");\n      testClient.get(\"/hit\");\n      testClient.get(\"/hit\");\n\n      try {\n        verify(lessThan(2), getRequestedFor(urlEqualTo(\"/hit\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(\n            e.getMessage(),\n            is(\n                \"Expected less than 2 requests matching the following pattern but received 4:\\n\"\n                    + \"{\"\n                    + lineSeparator()\n                    + \"  \\\"url\\\" : \\\"/hit\\\",\"\n                    + lineSeparator()\n                    + \"  \\\"method\\\" : \\\"GET\\\"\"\n                    + lineSeparator()\n                    + \"}\"));\n      }\n    }\n\n    @Test\n    void showsNearMissDiffWhenCountMatchSpecifiedAndNoMatchingRequestsAreReceived() {\n      testClient.get(\"/miss\");\n      testClient.get(\"/miss\");\n\n      try {\n        verify(moreThanOrExactly(4), getRequestedFor(urlEqualTo(\"/hit\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(\n            e.getMessage(),\n            containsString(junitStyleDiffMessage(\"GET\\n\" + \"/hit\\n\", \"GET\\n\" + \"/miss\\n\")));\n      }\n    }\n\n    @Test\n    void showsExpectedAndReceivedRequestsOnVerificationExceptionForLessThan() {\n      testClient.get(\"/some/request\");\n      testClient.get(\"/some/request\");\n      testClient.get(\"/some/request\");\n\n      try {\n        verify(lessThan(2), getRequestedFor(urlEqualTo(\"/some/request\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(\n            e.getMessage(),\n            allOf(\n                containsString(\"Expected less than 2 requests matching\"),\n                containsString(\"/some/request\")));\n      }\n    }\n\n    @Test\n    void showsExpectedAndReceivedRequestsOnVerificationExceptionForLessThanOrExactly() {\n      testClient.get(\"/some/request\");\n      testClient.get(\"/some/request\");\n      testClient.get(\"/some/request\");\n\n      try {\n        verify(lessThanOrExactly(2), getRequestedFor(urlEqualTo(\"/some/request\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(\n            e.getMessage(),\n            allOf(\n                containsString(\"Expected less than or exactly 2 requests matching\"),\n                containsString(\"/some/request\")));\n      }\n    }\n\n    @Test\n    void showsExpectedAndReceivedRequestsOnVerificationExceptionForExactly() {\n      testClient.get(\"/some/request\");\n\n      try {\n        verify(exactly(12), getRequestedFor(urlEqualTo(\"/some/request\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(\n            e.getMessage(),\n            allOf(\n                containsString(\"Expected exactly 12 requests matching\"),\n                containsString(\"/some/request\")));\n      }\n    }\n\n    @Test\n    void showsExpectedAndReceivedRequestsOnVerificationExceptionForMoreThan() {\n      testClient.get(\"/some/request\");\n\n      try {\n        verify(moreThan(12), getRequestedFor(urlEqualTo(\"/some/request\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(\n            e.getMessage(),\n            allOf(\n                containsString(\"Expected more than 12 requests matching\"),\n                containsString(\"/some/request\")));\n      }\n    }\n\n    @Test\n    void verifiesPatchRequests() {\n      testClient.patchWithBody(\"/patch/this\", SAMPLE_JSON, \"application/json\");\n      verify(\n          patchRequestedFor(urlEqualTo(\"/patch/this\"))\n              .withRequestBody(matching(\".*\\\"importantKey\\\": \\\"Important value\\\".*\")));\n    }\n\n    @Test\n    void verifiesRequestsWithCountMatchingStrategy() {\n      testClient.get(\"/custom-match-this\");\n      testClient.get(\"/custom-match-this\");\n\n      wireMockServer.verify(exactly(2), getRequestedFor(urlEqualTo(\"/custom-match-this\")));\n    }\n\n    @Test\n    void verifiesRequestsViaCustomMatcher() {\n      testClient.get(\"/custom-match-this\");\n      testClient.get(\"/custom-match-that\");\n\n      wireMockServer.verify(\n          2,\n          requestMadeFor(\n              new RequestMatcher() {\n                @Override\n                public MatchResult match(Request request) {\n                  return MatchResult.of(request.getUrl().contains(\"custom-match\"));\n                }\n\n                @Override\n                public String getName() {\n                  return \"inline\";\n                }\n              }));\n    }\n\n    @Test\n    void verifiesRequestsViaCustomMatcherRemotely() {\n      testClient.get(\"/remote-custom-match-this\");\n      testClient.get(\"/remote-custom-match-that\");\n\n      verify(\n          2,\n          requestMadeFor(value -> MatchResult.of(value.getUrl().contains(\"remote-custom-match\"))));\n    }\n\n    @Test\n    void copesWithAttemptedXmlBodyMatchWhenRequestHasNoXmlBody() {\n      testClient.post(\"/missing-xml\");\n\n      try {\n        verify(\n            postRequestedFor(urlEqualTo(\"/missing-xml\"))\n                .withRequestBody(equalToXml(\"<my-stuff />\")));\n        fail();\n      } catch (VerificationException e) {\n        assertThat(e.getMessage(), containsString(\"No requests exactly matched.\"));\n      }\n    }\n\n    @Test\n    void verifiesWithCustomMatcherViaStaticDsl() {\n      testClient.get(\"/custom-verify\");\n\n      verify(\n          forCustomMatcher(\n              new RequestMatcherExtension() {\n                @Override\n                public MatchResult match(Request request, Parameters parameters) {\n                  return MatchResult.of(request.getUrl().equals(\"/custom-verify\"));\n                }\n              }));\n    }\n\n    @Test\n    void removesEventsById() {\n      stubFor(get(anyUrl()).willReturn(ok()));\n\n      testClient.get(\"/one\", withHeader(\"My-Header\", \"one\"));\n      testClient.get(\"/one\", withHeader(\"My-Header\", \"two\"));\n      testClient.get(\"/two\");\n\n      List<ServeEvent> initialServeEvents = getAllServeEvents();\n      assertThat(initialServeEvents.size(), is(3));\n\n      removeServeEvent(initialServeEvents.get(0).getId());\n      removeServeEvent(initialServeEvents.get(2).getId());\n\n      List<ServeEvent> finalServeEvents = getAllServeEvents();\n\n      assertThat(finalServeEvents.size(), is(1));\n      assertThat(finalServeEvents.get(0).getRequest().header(\"My-Header\").firstValue(), is(\"two\"));\n    }\n\n    @Test\n    void doesNothingWhenAttemptingToRemoveANonExistentServeEvent() {\n      stubFor(get(anyUrl()).willReturn(ok()));\n\n      testClient.get(\"/one\", withHeader(\"My-Header\", \"one\"));\n      testClient.get(\"/one\", withHeader(\"My-Header\", \"two\"));\n      testClient.get(\"/two\");\n\n      List<ServeEvent> initialServeEvents = getAllServeEvents();\n      assertThat(initialServeEvents.size(), is(3));\n\n      removeServeEvent(UUID.randomUUID());\n\n      List<ServeEvent> finalServeEvents = getAllServeEvents();\n\n      assertThat(finalServeEvents.size(), is(3));\n    }\n\n    @Test\n    void removesEventsPerSuppliedFilter() {\n      stubFor(get(anyUrl()).willReturn(ok()));\n\n      testClient.get(\"/one\", withHeader(\"My-Header\", \"one\"));\n      testClient.get(\"/one\", withHeader(\"My-Header\", \"two\"));\n      testClient.get(\"/two\");\n\n      List<ServeEvent> removedEvents =\n          removeServeEvents(\n              getRequestedFor(urlPathEqualTo(\"/one\")).withHeader(\"My-Header\", equalTo(\"two\")));\n\n      assertThat(removedEvents.size(), is(1));\n      assertThat(removedEvents.get(0).getRequest().header(\"My-Header\").firstValue(), is(\"two\"));\n\n      List<ServeEvent> serveEvents = getAllServeEvents();\n      assertThat(serveEvents.size(), is(2));\n\n      ServeEvent event1 = findServeEventWithUrl(serveEvents, \"/one\");\n      assertThat(event1.getRequest().header(\"My-Header\").firstValue(), is(\"one\"));\n\n      ServeEvent event2 = findServeEventWithUrl(serveEvents, \"/two\");\n      assertThat(event2, notNullValue());\n    }\n\n    @Test\n    void returnsEmptyListWhenNoEventsMatchedForRemoval() {\n      stubFor(get(anyUrl()).willReturn(ok()));\n\n      testClient.get(\"/one\", withHeader(\"My-Header\", \"one\"));\n      testClient.get(\"/one\", withHeader(\"My-Header\", \"two\"));\n      testClient.get(\"/two\");\n\n      List<ServeEvent> removedEvents =\n          removeServeEvents(\n              getRequestedFor(urlPathEqualTo(\"/one\")).withHeader(\"My-Header\", equalTo(\"wrong\")));\n\n      assertThat(removedEvents.size(), is(0));\n\n      List<ServeEvent> serveEvents = getAllServeEvents();\n      assertThat(serveEvents.size(), is(3));\n    }\n\n    @Test\n    void removesEventsAssociatedWithStubsMatchingMetadata() {\n      stubFor(get(\"/with-metadata\").withMetadata(metadata().list(\"tags\", \"delete-me\")));\n      stubFor(get(\"/without-metadata\"));\n\n      testClient.get(\"/with-metadata\");\n      testClient.get(\"/without-metadata\");\n\n      List<ServeEvent> removedServeEvents =\n          removeEventsByStubMetadata(matchingJsonPath(\"$.tags[0]\", equalTo(\"delete-me\")));\n\n      assertThat(removedServeEvents.size(), is(1));\n      assertThat(removedServeEvents.get(0).getRequest().getUrl(), is(\"/with-metadata\"));\n\n      List<ServeEvent> serveEvents = getAllServeEvents();\n      assertThat(serveEvents.size(), is(1));\n      assertThat(serveEvents.get(0).getRequest().getUrl(), is(\"/without-metadata\"));\n    }\n\n    @Test\n    void verifiesRequestsViaRequestMatcherExtension() {\n      setupServer(options().extensions(new PathContainsParamRequestMatcher()));\n\n      testClient.get(\"/local-request-matcher-ext-this\");\n      testClient.get(\"/local-request-matcher-ext-that\");\n\n      wireMockServer.verify(\n          2,\n          requestMadeFor(\n              \"path-contains-param\", Parameters.one(\"path\", \"local-request-matcher-ext\")));\n    }\n\n    @Test\n    void verifiesRequestsViaRequestMatcherExtensionRemotely() {\n      setupServer(options().extensions(new PathContainsParamRequestMatcher()));\n\n      testClient.get(\"/remote-request-matcher-ext-this\");\n      testClient.get(\"/remote-request-matcher-ext-that\");\n\n      verify(\n          2,\n          requestMadeFor(\n              \"path-contains-param\", Parameters.one(\"path\", \"remote-request-matcher-ext\")));\n    }\n\n    @Test\n    void verifiesFormParamAbsent() {\n      String testUrl = \"/without/formParam\";\n      String testFormParam = \"test-form-param\";\n      String testFormValue = \"test-form-value\";\n      HttpEntity requestEntity =\n          EntityBuilder.create()\n              .setParameters(new BasicNameValuePair(testFormParam, testFormValue))\n              .build();\n      stubFor(post(testUrl).withFormParam(testFormParam, equalTo(testFormValue)));\n      testClient.post(testUrl, requestEntity);\n      verify(\n          postRequestedFor(urlEqualTo(testUrl))\n              .withFormParam(testFormParam, equalTo(testFormValue))\n              .withoutFormParam(\"absent-form-param\"));\n    }\n\n    @Test\n    void failsVerificationWhenAbsentFormParamPresent() {\n      String testUrl = \"/without/formParam\";\n      String testFormParam = \"test-form-param\";\n      String testFormValue = \"test-form-value\";\n      HttpEntity requestEntity =\n          EntityBuilder.create()\n              .setParameters(new BasicNameValuePair(testFormParam, testFormValue))\n              .build();\n      stubFor(post(testUrl).withFormParam(testFormParam, equalTo(testFormValue)));\n      testClient.post(testUrl, requestEntity);\n      assertThrows(\n          VerificationException.class,\n          () -> verify(postRequestedFor(urlEqualTo(testUrl)).withoutFormParam(testFormParam)));\n    }\n  }\n\n  public static class PathContainsParamRequestMatcher extends RequestMatcherExtension {\n\n    @Override\n    public MatchResult match(Request request, Parameters parameters) {\n      String pathSegment = parameters.getString(\"path\");\n      return MatchResult.of(request.getUrl().contains(pathSegment));\n    }\n\n    @Override\n    public String getName() {\n      return \"path-contains-param\";\n    }\n  }\n\n  @Nested\n  class JournalDisabled {\n\n    @RegisterExtension\n    public WireMockExtension wireMockRule =\n        WireMockExtension.newInstance()\n            .options(wireMockConfig().dynamicPort().disableRequestJournal())\n            .configureStaticDsl(true)\n            .failOnUnmatchedRequests(false)\n            .build();\n\n    @Test\n    void verifyThrowsExceptionWhenVerificationAttemptedAndRequestJournalDisabled() {\n      assertThrows(\n          RequestJournalDisabledException.class,\n          () -> verify(getRequestedFor(urlEqualTo(\"/whatever\"))));\n    }\n\n    @Test\n    void findAllThrowsExceptionWhenVerificationAttemptedAndRequestJournalDisabled() {\n      assertThrows(\n          RequestJournalDisabledException.class,\n          () -> findAll(getRequestedFor(urlEqualTo(\"/whatever\"))));\n    }\n  }\n\n  @Nested\n  class JournalMaxEntriesRestricted {\n    @RegisterExtension\n    public WireMockExtension wireMockRule =\n        WireMockExtension.newInstance()\n            .options(options().dynamicPort().maxRequestJournalEntries(2))\n            .configureStaticDsl(true)\n            .failOnUnmatchedRequests(false)\n            .build();\n\n    @Test\n    void maxLengthIs2() {\n      WireMockTestClient testClient = new WireMockTestClient(wireMockRule.getPort());\n      testClient.get(\"/request1\");\n      testClient.get(\"/request2\");\n      testClient.get(\"/request3\");\n      verify(0, getRequestedFor(urlEqualTo(\"/request1\")));\n      verify(1, getRequestedFor(urlEqualTo(\"/request2\")));\n      verify(1, getRequestedFor(urlEqualTo(\"/request3\")));\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WebhooksAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static org.awaitility.Awaitility.await;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.greaterThanOrEqualTo;\nimport static org.hamcrest.Matchers.hasEntry;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.notNullValue;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.github.tomakehurst.wiremock.testsupport.TestNotifier;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.CountDownLatch;\nimport java.util.stream.Collectors;\n\npublic class WebhooksAcceptanceTest {\n\n  protected static final String WEBHOOK_REQUEST_SUB_EVENT_NAME = \"WEBHOOK_REQUEST\";\n  protected static final String WEBHOOK_RESPONSE_SUB_EVENT_NAME = \"WEBHOOK_RESPONSE\";\n  protected CountDownLatch latch;\n  protected TestNotifier testNotifier = new TestNotifier();\n\n  protected void assertSubEvent(SubEvent subEvent, String type, String message) {\n    assertSubEvent(subEvent, type, Map.of(\"message\", message));\n  }\n\n  protected void assertSubEvent(SubEvent subEvent, String type, Map<String, Object> data) {\n    assertThat(subEvent, notNullValue());\n    assertThat(subEvent.getType(), is(type));\n    for (Map.Entry<String, Object> entry : data.entrySet()) {\n      boolean hasEntry =\n          subEvent.getData().entrySet().stream()\n              .anyMatch(\n                  e ->\n                      e.getKey().equals(entry.getKey())\n                          && e.getValue().toString().contains(entry.getValue().toString()));\n      assertTrue(hasEntry);\n    }\n  }\n\n  protected void assertErrorMessage(String expectedErrorMessage) {\n    List<String> errorMessages =\n        await().until(() -> testNotifier.getErrorMessages(), hasSize(greaterThanOrEqualTo(1)));\n    assertThat(errorMessages.get(0), is(expectedErrorMessage));\n  }\n\n  protected void waitForRequestToTargetServer() throws Exception {\n    assertTrue(\n        latch.await(20, SECONDS), \"Timed out waiting for target server to receive a request\");\n  }\n\n  protected void printAllInfoNotifications() {\n    this.printAllNotifications(\"All info notifications\", testNotifier.getInfoMessages());\n  }\n\n  protected void printAllErrorNotifications() {\n    this.printAllNotifications(\"All error notifications\", testNotifier.getErrorMessages());\n  }\n\n  private void printAllNotifications(String msg, List<String> notifications) {\n    System.out.println(\n        msg\n            + \":\\n\"\n            + notifications.stream()\n                .map(message -> message.replace(\"\\n\", \"\\n>>> \"))\n                .collect(Collectors.joining(\"\\n>>> \")));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WebhooksAcceptanceViaPostServeActionTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.client.WireMock.any;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static org.awaitility.Awaitility.waitAtMost;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.wiremock.webhooks.Webhooks.webhook;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.NetworkAddressRules;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.PostServeAction;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.github.tomakehurst.wiremock.testsupport.CompositeNotifier;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.google.common.base.Stopwatch;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.CountDownLatch;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class WebhooksAcceptanceViaPostServeActionTest extends WebhooksAcceptanceTest {\n\n  @RegisterExtension\n  public WireMockExtension targetServer =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .extensions(\n                      new PostServeAction() {\n                        @Override\n                        public void doGlobalAction(ServeEvent serveEvent, Admin admin) {\n                          if (serveEvent.getRequest().getUrl().startsWith(\"/callback\")) {\n                            latch.countDown();\n                          }\n                        }\n\n                        @Override\n                        public String getName() {\n                          return \"test-latch\";\n                        }\n                      })\n                  .notifier(new ConsoleNotifier(\"Target\", true)))\n          .build();\n\n  CompositeNotifier notifier =\n      new CompositeNotifier(testNotifier, new ConsoleNotifier(\"Main\", true));\n  WireMockTestClient client;\n\n  @RegisterExtension\n  public WireMockExtension rule =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .notifier(notifier)\n                  .limitProxyTargets(\n                      NetworkAddressRules.builder().deny(\"169.254.0.0-169.254.255.255\").build()))\n          .configureStaticDsl(true)\n          .build();\n\n  @BeforeEach\n  public void init() {\n    testNotifier.reset();\n    targetServer.stubFor(any(anyUrl()).willReturn(ok()));\n    latch = new CountDownLatch(1);\n    client = new WireMockTestClient(rule.getPort());\n    WireMock.configureFor(targetServer.getPort());\n\n    System.out.println(\"Target server port: \" + targetServer.getPort());\n    System.out.println(\"Under test server port: \" + rule.getPort());\n  }\n\n  @Test\n  public void firesASingleWebhookWhenRequested() throws Exception {\n    rule.stubFor(\n        post(urlPathEqualTo(\"/something-async\"))\n            .willReturn(ok())\n            .withPostServeAction(\n                \"webhook\",\n                webhook()\n                    .withMethod(POST)\n                    .withUrl(targetServer.url(\"/callback\"))\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withHeader(\"X-Multi\", \"one\", \"two\")\n                    .withBody(\"{ \\\"result\\\": \\\"SUCCESS\\\" }\")));\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/something-async\");\n\n    waitForRequestToTargetServer();\n\n    targetServer.verify(\n        1,\n        postRequestedFor(urlEqualTo(\"/callback\"))\n            .withHeader(\"Content-Type\", equalTo(\"application/json\"))\n            .withRequestBody(equalToJson(\"{ \\\"result\\\": \\\"SUCCESS\\\" }\")));\n\n    List<String> multiHeaderValues =\n        targetServer\n            .findAll(postRequestedFor(urlEqualTo(\"/callback\")))\n            .get(0)\n            .header(\"X-Multi\")\n            .values();\n    assertThat(multiHeaderValues, hasItems(\"one\", \"two\"));\n\n    printAllInfoNotifications();\n\n    waitAtMost(5, SECONDS)\n        .until(\n            () -> testNotifier.getInfoMessages(),\n            hasItem(\n                allOf(\n                    containsString(\"Webhook POST request to\"),\n                    containsString(\"/callback returned status\"),\n                    containsString(\"200\"))));\n\n    // should be two sub events - the request and the response\n    List<SubEvent> subEvents = new ArrayList<>(rule.getAllServeEvents().get(0).getSubEvents());\n    assertThat(subEvents, hasSize(2));\n    Map<String, Object> expectedRequestEntries =\n        Map.of(\n            \"url\", \"/callback\",\n            \"method\", \"POST\",\n            \"host\", \"localhost\",\n            \"scheme\", \"http\",\n            \"body\", \"{ \\\"result\\\": \\\"SUCCESS\\\" }\");\n    assertSubEvent(subEvents.get(0), WEBHOOK_REQUEST_SUB_EVENT_NAME, expectedRequestEntries);\n    Map<String, Object> expectedResponseEntries = Map.of(\"status\", 200, \"body\", \"\");\n    assertSubEvent(subEvents.get(1), WEBHOOK_RESPONSE_SUB_EVENT_NAME, expectedResponseEntries);\n  }\n\n  @Test\n  public void webhookCanBeConfiguredFromJson() throws Exception {\n    latch = new CountDownLatch(2);\n\n    client.postJson(\n        \"/__admin/mappings\",\n        \"{\\n\"\n            + \"  \\\"request\\\": {\\n\"\n            + \"    \\\"urlPath\\\": \\\"/hook\\\",\\n\"\n            + \"    \\\"method\\\": \\\"POST\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"response\\\": {\\n\"\n            + \"    \\\"status\\\": 204\\n\"\n            + \"  },\\n\"\n            + \"  \\\"postServeActions\\\": [\\n\"\n            + \"    {\\n\"\n            + \"      \\\"name\\\": \\\"webhook\\\",\\n\"\n            + \"      \\\"parameters\\\": {\\n\"\n            + \"        \\\"headers\\\": {\\n\"\n            + \"          \\\"Content-Type\\\": \\\"application/json\\\"\\n\"\n            + \"        },\\n\"\n            + \"        \\\"method\\\": \\\"POST\\\",\\n\"\n            + \"        \\\"body\\\": \\\"{ \\\\\\\"result\\\\\\\": \\\\\\\"SUCCESS\\\\\\\" }\\\",\\n\"\n            + \"        \\\"url\\\" : \\\"\"\n            + targetServer.baseUrl()\n            + \"/callback1\\\"\\n\"\n            + \"      }\\n\"\n            + \"    },\\n\"\n            + \"    {\\n\"\n            + \"      \\\"name\\\": \\\"webhook\\\",\\n\"\n            + \"      \\\"parameters\\\": {\\n\"\n            + \"        \\\"method\\\": \\\"POST\\\",\\n\"\n            + \"        \\\"url\\\" : \\\"\"\n            + targetServer.baseUrl()\n            + \"/callback2\\\"\\n\"\n            + \"      }\\n\"\n            + \"    }\\n\"\n            + \"  ]\\n\"\n            + \"}\");\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/hook\");\n\n    waitForRequestToTargetServer();\n\n    verify(postRequestedFor(urlPathEqualTo(\"/callback1\")));\n    verify(postRequestedFor(urlPathEqualTo(\"/callback2\")));\n  }\n\n  @Test\n  public void appliesTemplatingToUrlMethodHeadersAndBodyViaDSL() throws Exception {\n    rule.stubFor(\n        post(urlPathEqualTo(\"/templating\"))\n            .willReturn(ok())\n            .withPostServeAction(\n                \"webhook\",\n                webhook()\n                    .withMethod(\"{{jsonPath originalRequest.body '$.method'}}\")\n                    .withUrl(\n                        targetServer.baseUrl()\n                            + \"{{{jsonPath originalRequest.body '$.callbackPath'}}}\")\n                    .withHeader(\"X-Single\", \"{{math 1 '+' 2}}\")\n                    .withHeader(\"X-Multi\", \"{{math 3 'x' 2}}\", \"{{parameters.one}}\")\n                    .withBody(\"{{jsonPath originalRequest.body '$.name'}}\")\n                    .withExtraParameter(\"one\", \"param-one-value\")));\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.postJson(\n        \"/templating\",\n        \"{\\n\"\n            + \"  \\\"callbackPath\\\": \\\"/callback/123\\\",\\n\"\n            + \"  \\\"method\\\": \\\"POST\\\",\\n\"\n            + \"  \\\"name\\\": \\\"Tom\\\"\\n\"\n            + \"}\");\n\n    waitForRequestToTargetServer();\n\n    LoggedRequest request =\n        targetServer.findAll(postRequestedFor(urlEqualTo(\"/callback/123\"))).get(0);\n\n    assertThat(request.header(\"X-Single\").firstValue(), is(\"3\"));\n    assertThat(request.header(\"X-Multi\").values(), hasItems(\"6\", \"param-one-value\"));\n    assertThat(request.getBodyAsString(), is(\"Tom\"));\n  }\n\n  @Test\n  public void appliesTemplatingToUrlMethodHeadersAndBodyViaJSON() throws Exception {\n    client.postJson(\n        \"/__admin/mappings\",\n        \"{\\n\"\n            + \"  \\\"id\\\" : \\\"8a58e190-4a83-4244-a064-265fcca46884\\\",\\n\"\n            + \"  \\\"request\\\" : {\\n\"\n            + \"    \\\"urlPath\\\" : \\\"/templating\\\",\\n\"\n            + \"    \\\"method\\\" : \\\"POST\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"response\\\" : {\\n\"\n            + \"    \\\"status\\\" : 200\\n\"\n            + \"  },\\n\"\n            + \"  \\\"uuid\\\" : \\\"8a58e190-4a83-4244-a064-265fcca46884\\\",\\n\"\n            + \"  \\\"postServeActions\\\" : [{\\n\"\n            + \"    \\\"name\\\" : \\\"webhook\\\",\\n\"\n            + \"    \\\"parameters\\\" : {\\n\"\n            + \"      \\\"method\\\" : \\\"{{jsonPath originalRequest.body '$.method'}}\\\",\\n\"\n            + \"      \\\"url\\\" : \\\"\"\n            + targetServer.baseUrl()\n            + \"{{{jsonPath originalRequest.body '$.callbackPath'}}}\\\",\\n\"\n            + \"      \\\"headers\\\" : {\\n\"\n            + \"        \\\"X-Single\\\" : \\\"{{math 1 '+' 2}}\\\",\\n\"\n            + \"        \\\"X-Multi\\\" : [ \\\"{{math 3 'x' 2}}\\\", \\\"{{parameters.one}}\\\" ]\\n\"\n            + \"      },\\n\"\n            + \"      \\\"body\\\" : \\\"{{jsonPath originalRequest.body '$.name'}}\\\",\\n\"\n            + \"      \\\"one\\\" : \\\"param-one-value\\\"\\n\"\n            + \"    }\\n\"\n            + \"  }]\\n\"\n            + \"}\\n\");\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.postJson(\n        \"/templating\",\n        \"{\\n\"\n            + \"  \\\"callbackPath\\\": \\\"/callback/123\\\",\\n\"\n            + \"  \\\"method\\\": \\\"POST\\\",\\n\"\n            + \"  \\\"name\\\": \\\"Tom\\\"\\n\"\n            + \"}\");\n\n    waitForRequestToTargetServer();\n\n    LoggedRequest request =\n        targetServer.findAll(postRequestedFor(urlEqualTo(\"/callback/123\"))).get(0);\n\n    assertThat(request.header(\"X-Single\").firstValue(), is(\"3\"));\n    assertThat(request.header(\"X-Multi\").values(), hasItems(\"6\", \"param-one-value\"));\n    assertThat(request.getBodyAsString(), is(\"Tom\"));\n  }\n\n  @Test\n  public void addsFixedDelayViaDSL() throws Exception {\n    final int DELAY_MILLISECONDS = 1_000;\n\n    rule.stubFor(\n        post(urlPathEqualTo(\"/delayed\"))\n            .willReturn(ok())\n            .withPostServeAction(\n                \"webhook\",\n                webhook()\n                    .withFixedDelay(DELAY_MILLISECONDS)\n                    .withMethod(RequestMethod.GET)\n                    .withUrl(targetServer.url(\"/callback\"))));\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/delayed\");\n\n    Stopwatch stopwatch = Stopwatch.createStarted();\n    waitForRequestToTargetServer();\n    stopwatch.stop();\n\n    double elapsedMilliseconds = stopwatch.elapsed(MILLISECONDS);\n    assertThat(elapsedMilliseconds, closeTo(DELAY_MILLISECONDS, 500.0));\n\n    verify(1, getRequestedFor(urlEqualTo(\"/callback\")));\n  }\n\n  @Test\n  public void addsRandomDelayViaJSON() throws Exception {\n    client.postJson(\n        \"/__admin/mappings\",\n        \"{\\n\"\n            + \"  \\\"request\\\" : {\\n\"\n            + \"    \\\"urlPath\\\" : \\\"/delayed\\\",\\n\"\n            + \"    \\\"method\\\" : \\\"POST\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"postServeActions\\\" : [{\\n\"\n            + \"    \\\"name\\\" : \\\"webhook\\\",\\n\"\n            + \"    \\\"parameters\\\" : {\\n\"\n            + \"      \\\"method\\\" : \\\"GET\\\",\\n\"\n            + \"      \\\"url\\\" : \\\"\"\n            + targetServer.baseUrl()\n            + \"/callback\\\",\\n\"\n            + \"      \\\"delay\\\" : {\\n\"\n            + \"        \\\"type\\\" : \\\"uniform\\\",\\n\"\n            + \"        \\\"lower\\\": 500,\\n\"\n            + \"        \\\"upper\\\": 1000\\n\"\n            + \"      }\\n\"\n            + \"    }\\n\"\n            + \"  }]\\n\"\n            + \"}\");\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/delayed\");\n\n    Stopwatch stopwatch = Stopwatch.createStarted();\n    waitForRequestToTargetServer();\n    stopwatch.stop();\n\n    long elapsedMilliseconds = stopwatch.elapsed(MILLISECONDS);\n    assertThat(elapsedMilliseconds, greaterThanOrEqualTo(500L));\n    assertThat(elapsedMilliseconds, lessThanOrEqualTo(1500L));\n\n    verify(1, getRequestedFor(urlEqualTo(\"/callback\")));\n  }\n\n  @Test\n  public void doesNotFireAWebhookWhenRequestedForDeniedTarget() {\n    StubMapping stub =\n        rule.stubFor(\n            post(urlPathEqualTo(\"/webhook\"))\n                .willReturn(ok())\n                .withPostServeAction(\n                    \"webhook\",\n                    webhook()\n                        .withMethod(POST)\n                        .withUrl(\"http://169.254.2.34/foo\")\n                        .withHeader(\"Content-Type\", \"application/json\")\n                        .withHeader(\"X-Multi\", \"one\", \"two\")\n                        .withBody(\"{ \\\"result\\\": \\\"SUCCESS\\\" }\")));\n\n    client.post(\"/webhook\");\n\n    printAllInfoNotifications();\n\n    final String expectedErrorMessage =\n        \"The target webhook address http://169.254.2.34/foo specified by stub \"\n            + stub.getId()\n            + \" is denied in WireMock's configuration.\";\n    assertErrorMessage(expectedErrorMessage);\n\n    // should be two sub events - the request and the error\n    List<SubEvent> subEvents = new ArrayList<>(rule.getAllServeEvents().get(0).getSubEvents());\n    assertThat(subEvents, hasSize(2));\n    Map<String, Object> expectedRequestEntries =\n        Map.of(\n            \"url\", \"/foo\",\n            \"absoluteUrl\", \"http://169.254.2.34/foo\",\n            \"method\", \"POST\",\n            \"scheme\", \"http\",\n            \"body\", \"{ \\\"result\\\": \\\"SUCCESS\\\" }\");\n    assertSubEvent(subEvents.get(0), WEBHOOK_REQUEST_SUB_EVENT_NAME, expectedRequestEntries);\n    assertSubEvent(subEvents.get(1), SubEvent.ERROR, expectedErrorMessage);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WebhooksAcceptanceViaServeEventTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.client.WireMock.any;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static org.awaitility.Awaitility.waitAtMost;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.wiremock.webhooks.Webhooks.webhook;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.NetworkAddressRules;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.PostServeAction;\nimport com.github.tomakehurst.wiremock.extension.TemplateModelDataProviderExtension;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.github.tomakehurst.wiremock.testsupport.CompositeNotifier;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.google.common.base.Stopwatch;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.CountDownLatch;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.MethodSource;\n\npublic class WebhooksAcceptanceViaServeEventTest extends WebhooksAcceptanceTest {\n\n  @RegisterExtension\n  public WireMockExtension targetServer =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .extensions(\n                      new PostServeAction() {\n                        @Override\n                        public void doGlobalAction(ServeEvent serveEvent, Admin admin) {\n                          if (serveEvent.getRequest().getUrl().startsWith(\"/callback\")) {\n                            latch.countDown();\n                          }\n                        }\n\n                        @Override\n                        public String getName() {\n                          return \"test-latch\";\n                        }\n                      })\n                  .notifier(new ConsoleNotifier(\"Target\", true)))\n          .build();\n\n  CompositeNotifier notifier =\n      new CompositeNotifier(testNotifier, new ConsoleNotifier(\"Main\", true));\n  WireMockTestClient client;\n\n  @RegisterExtension\n  public WireMockExtension rule =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .dynamicPort()\n                  .extensions(\n                      new TemplateModelDataProviderExtension() {\n                        @Override\n                        public Map<String, Object> provideTemplateModelData(ServeEvent serveEvent) {\n                          return Map.of(\n                              \"customData\", Map.of(\"path\", serveEvent.getRequest().getUrl()));\n                        }\n\n                        @Override\n                        public String getName() {\n                          return \"custom-model-data\";\n                        }\n                      })\n                  .notifier(notifier)\n                  .limitProxyTargets(\n                      NetworkAddressRules.builder().deny(\"169.254.0.0-169.254.255.255\").build()))\n          .configureStaticDsl(true)\n          .build();\n\n  @BeforeEach\n  public void init() {\n    testNotifier.reset();\n    targetServer.stubFor(any(anyUrl()).willReturn(ok()));\n    latch = new CountDownLatch(1);\n    client = new WireMockTestClient(rule.getPort());\n    WireMock.configureFor(targetServer.getPort());\n\n    System.out.println(\"Target server port: \" + targetServer.getPort());\n    System.out.println(\"Under test server port: \" + rule.getPort());\n  }\n\n  @Test\n  public void firesASingleWebhookWhenRequested() throws Exception {\n    rule.stubFor(\n        post(urlPathEqualTo(\"/something-async\"))\n            .willReturn(ok())\n            .withServeEventListener(\n                \"webhook\",\n                webhook()\n                    .withMethod(POST)\n                    .withUrl(targetServer.url(\"/callback\"))\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withHeader(\"X-Multi\", \"one\", \"two\")\n                    .withBody(\"{ \\\"result\\\": \\\"SUCCESS\\\" }\")));\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/something-async\");\n\n    waitForRequestToTargetServer();\n\n    targetServer.verify(\n        1,\n        postRequestedFor(urlEqualTo(\"/callback\"))\n            .withHeader(\"Content-Type\", equalTo(\"application/json\"))\n            .withRequestBody(equalToJson(\"{ \\\"result\\\": \\\"SUCCESS\\\" }\")));\n\n    List<String> multiHeaderValues =\n        targetServer\n            .findAll(postRequestedFor(urlEqualTo(\"/callback\")))\n            .get(0)\n            .header(\"X-Multi\")\n            .values();\n    assertThat(multiHeaderValues, hasItems(\"one\", \"two\"));\n\n    printAllInfoNotifications();\n\n    waitAtMost(5, SECONDS)\n        .until(\n            () -> testNotifier.getInfoMessages(),\n            hasItem(\n                allOf(\n                    containsString(\"Webhook POST request to\"),\n                    containsString(\"/callback returned status\"),\n                    containsString(\"200\"))));\n\n    // should be two sub events - the request and the response\n    List<SubEvent> subEvents = new ArrayList<>(rule.getAllServeEvents().get(0).getSubEvents());\n    assertThat(subEvents, hasSize(2));\n    Map<String, Object> expectedRequestEntries =\n        Map.of(\n            \"url\", \"/callback\",\n            \"method\", \"POST\",\n            \"host\", \"localhost\",\n            \"scheme\", \"http\",\n            \"body\", \"{ \\\"result\\\": \\\"SUCCESS\\\" }\");\n    assertSubEvent(subEvents.get(0), WEBHOOK_REQUEST_SUB_EVENT_NAME, expectedRequestEntries);\n    Map<String, Object> expectedResponseEntries = Map.of(\"status\", 200, \"body\", \"\");\n    assertSubEvent(subEvents.get(1), WEBHOOK_RESPONSE_SUB_EVENT_NAME, expectedResponseEntries);\n  }\n\n  @Test\n  public void originalRequestIdIsTheSameAsRequestId() throws Exception {\n    rule.stubFor(\n        post(\"/request-id\")\n            .willReturn(ok(\"{{request.id}}\").withTransformers(\"response-template\"))\n            .withServeEventListener(\n                \"webhook\",\n                webhook()\n                    .withMethod(POST)\n                    .withUrl(targetServer.url(\"/callback\"))\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withBody(\"{ \\\"requestId\\\": \\\"{{originalRequest.id}}\\\" }\")));\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    WireMockResponse response = client.post(\"/request-id\");\n    String requestId = response.content();\n\n    waitForRequestToTargetServer();\n\n    targetServer.verify(\n        1,\n        postRequestedFor(urlEqualTo(\"/callback\"))\n            .withHeader(\"Content-Type\", equalTo(\"application/json\"))\n            .withRequestBody(equalToJson(\"{ \\\"requestId\\\": \\\"\" + requestId + \"\\\" }\")));\n  }\n\n  @Test\n  public void webhooksHaveAccessToTemplateModelDataProviders() throws Exception {\n    rule.stubFor(\n        post(\"/helpers\")\n            .willReturn(ok(\"{{request.id}}\").withTransformers(\"response-template\"))\n            .withServeEventListener(\n                \"webhook\",\n                webhook()\n                    .withMethod(POST)\n                    .withUrl(targetServer.url(\"/callback\"))\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withBody(\"{ \\\"url\\\": \\\"{{ customData.path }}\\\" }\")));\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/helpers\");\n\n    waitForRequestToTargetServer();\n\n    targetServer.verify(\n        1,\n        postRequestedFor(urlEqualTo(\"/callback\"))\n            .withHeader(\"Content-Type\", equalTo(\"application/json\"))\n            .withRequestBody(equalToJson(\"{ \\\"url\\\": \\\"/helpers\\\" }\")));\n  }\n\n  @Test\n  public void webhookCanBeConfiguredFromJson() throws Exception {\n    latch = new CountDownLatch(2);\n\n    client.postJson(\n        \"/__admin/mappings\",\n        \"{\\n\"\n            + \"  \\\"request\\\": {\\n\"\n            + \"    \\\"urlPath\\\": \\\"/hook\\\",\\n\"\n            + \"    \\\"method\\\": \\\"POST\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"response\\\": {\\n\"\n            + \"    \\\"status\\\": 204\\n\"\n            + \"  },\\n\"\n            + \"  \\\"serveEventListeners\\\": [\\n\"\n            + \"    {\\n\"\n            + \"      \\\"name\\\": \\\"webhook\\\",\\n\"\n            + \"      \\\"parameters\\\": {\\n\"\n            + \"        \\\"headers\\\": {\\n\"\n            + \"          \\\"Content-Type\\\": \\\"application/json\\\"\\n\"\n            + \"        },\\n\"\n            + \"        \\\"method\\\": \\\"POST\\\",\\n\"\n            + \"        \\\"body\\\": \\\"{ \\\\\\\"result\\\\\\\": \\\\\\\"SUCCESS\\\\\\\" }\\\",\\n\"\n            + \"        \\\"url\\\" : \\\"\"\n            + targetServer.baseUrl()\n            + \"/callback1\\\"\\n\"\n            + \"      }\\n\"\n            + \"    },\\n\"\n            + \"    {\\n\"\n            + \"      \\\"name\\\": \\\"webhook\\\",\\n\"\n            + \"      \\\"parameters\\\": {\\n\"\n            + \"        \\\"method\\\": \\\"POST\\\",\\n\"\n            + \"        \\\"url\\\" : \\\"\"\n            + targetServer.baseUrl()\n            + \"/callback2\\\"\\n\"\n            + \"      }\\n\"\n            + \"    }\\n\"\n            + \"  ]\\n\"\n            + \"}\");\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/hook\");\n\n    waitForRequestToTargetServer();\n\n    verify(postRequestedFor(urlPathEqualTo(\"/callback1\")));\n    verify(postRequestedFor(urlPathEqualTo(\"/callback2\")));\n  }\n\n  @Test\n  public void appliesTemplatingToUrlMethodHeadersAndBodyViaDSL() throws Exception {\n    rule.stubFor(\n        post(urlPathEqualTo(\"/templating\"))\n            .willReturn(ok())\n            .withServeEventListener(\n                \"webhook\",\n                webhook()\n                    .withMethod(\"{{jsonPath originalRequest.body '$.method'}}\")\n                    .withUrl(\n                        targetServer.baseUrl()\n                            + \"{{{jsonPath originalRequest.body '$.callbackPath'}}}\")\n                    .withHeader(\"X-Single\", \"{{math 1 '+' 2}}\")\n                    .withHeader(\"X-Multi\", \"{{math 3 'x' 2}}\", \"{{parameters.one}}\")\n                    .withBody(\"{{jsonPath originalRequest.body '$.name'}}\")\n                    .withExtraParameter(\"one\", \"param-one-value\")));\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.postJson(\n        \"/templating\",\n        \"\"\"\n        {\n          \"callbackPath\": \"/callback/123\",\n          \"method\": \"POST\",\n          \"name\": \"Tom\"\n        }\"\"\");\n\n    waitForRequestToTargetServer();\n\n    // Ensure we only call it once, not once per API interface\n    verify(1, postRequestedFor(anyUrl()));\n\n    LoggedRequest request =\n        targetServer.findAll(postRequestedFor(urlEqualTo(\"/callback/123\"))).get(0);\n\n    assertThat(request.header(\"X-Single\").firstValue(), is(\"3\"));\n    assertThat(request.header(\"X-Multi\").values(), hasItems(\"6\", \"param-one-value\"));\n    assertThat(request.getBodyAsString(), is(\"Tom\"));\n  }\n\n  @Test\n  public void appliesTemplatingToUrlMethodHeadersAndBodyViaJSON() throws Exception {\n    client.postJson(\n        \"/__admin/mappings\",\n        \"{\\n\"\n            + \"  \\\"id\\\" : \\\"8a58e190-4a83-4244-a064-265fcca46884\\\",\\n\"\n            + \"  \\\"request\\\" : {\\n\"\n            + \"    \\\"urlPath\\\" : \\\"/templating\\\",\\n\"\n            + \"    \\\"method\\\" : \\\"POST\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"response\\\" : {\\n\"\n            + \"    \\\"status\\\" : 200\\n\"\n            + \"  },\\n\"\n            + \"  \\\"uuid\\\" : \\\"8a58e190-4a83-4244-a064-265fcca46884\\\",\\n\"\n            + \"  \\\"serveEventListeners\\\" : [{\\n\"\n            + \"    \\\"name\\\" : \\\"webhook\\\",\\n\"\n            + \"    \\\"parameters\\\" : {\\n\"\n            + \"      \\\"method\\\" : \\\"{{jsonPath originalRequest.body '$.method'}}\\\",\\n\"\n            + \"      \\\"url\\\" : \\\"\"\n            + targetServer.baseUrl()\n            + \"{{{jsonPath originalRequest.body '$.callbackPath'}}}\\\",\\n\"\n            + \"      \\\"headers\\\" : {\\n\"\n            + \"        \\\"X-Single\\\" : \\\"{{math 1 '+' 2}}\\\",\\n\"\n            + \"        \\\"X-Multi\\\" : [ \\\"{{math 3 'x' 2}}\\\", \\\"{{parameters.one}}\\\" ]\\n\"\n            + \"      },\\n\"\n            + \"      \\\"body\\\" : \\\"{{jsonPath originalRequest.body '$.name'}}\\\",\\n\"\n            + \"      \\\"one\\\" : \\\"param-one-value\\\"\\n\"\n            + \"    }\\n\"\n            + \"  }]\\n\"\n            + \"}\\n\");\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.postJson(\n        \"/templating\",\n        \"\"\"\n        {\n          \"callbackPath\": \"/callback/123\",\n          \"method\": \"POST\",\n          \"name\": \"Tom\"\n        }\"\"\");\n\n    waitForRequestToTargetServer();\n\n    // Ensure we only call it once, not once per API interface\n    verify(1, postRequestedFor(anyUrl()));\n\n    LoggedRequest request =\n        targetServer.findAll(postRequestedFor(urlEqualTo(\"/callback/123\"))).get(0);\n\n    assertThat(request.header(\"X-Single\").firstValue(), is(\"3\"));\n    assertThat(request.header(\"X-Multi\").values(), hasItems(\"6\", \"param-one-value\"));\n    assertThat(request.getBodyAsString(), is(\"Tom\"));\n  }\n\n  @Test\n  public void addsFixedDelayViaDSL() throws Exception {\n    final int DELAY_MILLISECONDS = 1_000;\n\n    rule.stubFor(\n        post(urlPathEqualTo(\"/delayed\"))\n            .willReturn(ok())\n            .withServeEventListener(\n                \"webhook\",\n                webhook()\n                    .withFixedDelay(DELAY_MILLISECONDS)\n                    .withMethod(RequestMethod.GET)\n                    .withUrl(targetServer.url(\"/callback\"))));\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/delayed\");\n\n    Stopwatch stopwatch = Stopwatch.createStarted();\n    waitForRequestToTargetServer();\n    stopwatch.stop();\n\n    // Ensure we only call it once, not once per API interface\n    verify(1, getRequestedFor(anyUrl()));\n\n    double elapsedMilliseconds = stopwatch.elapsed(MILLISECONDS);\n    assertThat(elapsedMilliseconds, closeTo(DELAY_MILLISECONDS, 500.0));\n\n    verify(1, getRequestedFor(urlEqualTo(\"/callback\")));\n  }\n\n  @Test\n  public void addsRandomDelayViaJSON() throws Exception {\n    client.postJson(\n        \"/__admin/mappings\",\n        \"{\\n\"\n            + \"  \\\"request\\\" : {\\n\"\n            + \"    \\\"urlPath\\\" : \\\"/delayed\\\",\\n\"\n            + \"    \\\"method\\\" : \\\"POST\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"serveEventListeners\\\" : [{\\n\"\n            + \"    \\\"name\\\" : \\\"webhook\\\",\\n\"\n            + \"    \\\"parameters\\\" : {\\n\"\n            + \"      \\\"method\\\" : \\\"GET\\\",\\n\"\n            + \"      \\\"url\\\" : \\\"\"\n            + targetServer.baseUrl()\n            + \"/callback\\\",\\n\"\n            + \"      \\\"delay\\\" : {\\n\"\n            + \"        \\\"type\\\" : \\\"uniform\\\",\\n\"\n            + \"        \\\"lower\\\": 500,\\n\"\n            + \"        \\\"upper\\\": 1000\\n\"\n            + \"      }\\n\"\n            + \"    }\\n\"\n            + \"  }]\\n\"\n            + \"}\");\n\n    verify(0, postRequestedFor(anyUrl()));\n\n    client.post(\"/delayed\");\n\n    Stopwatch stopwatch = Stopwatch.createStarted();\n    waitForRequestToTargetServer();\n    stopwatch.stop();\n\n    long elapsedMilliseconds = stopwatch.elapsed(MILLISECONDS);\n    assertThat(elapsedMilliseconds, greaterThanOrEqualTo(500L));\n    assertThat(elapsedMilliseconds, lessThanOrEqualTo(1500L));\n\n    verify(1, getRequestedFor(urlEqualTo(\"/callback\")));\n  }\n\n  @Test\n  public void doesNotFireAWebhookWhenRequestedForDeniedTarget() {\n    StubMapping stub =\n        rule.stubFor(\n            post(urlPathEqualTo(\"/webhook\"))\n                .willReturn(ok())\n                .withServeEventListener(\n                    \"webhook\",\n                    webhook()\n                        .withMethod(POST)\n                        .withUrl(\"http://169.254.2.34/foo\")\n                        .withHeader(\"Content-Type\", \"application/json\")\n                        .withHeader(\"X-Multi\", \"one\", \"two\")\n                        .withBody(\"{ \\\"result\\\": \\\"SUCCESS\\\" }\")));\n\n    client.post(\"/webhook\");\n\n    printAllInfoNotifications();\n\n    final String expectedErrorMessage =\n        \"The target webhook address http://169.254.2.34/foo specified by stub \"\n            + stub.getId()\n            + \" is denied in WireMock's configuration.\";\n    assertErrorMessage(expectedErrorMessage);\n\n    // should be two sub events - the request and the error\n    List<SubEvent> subEvents = new ArrayList<>(rule.getAllServeEvents().get(0).getSubEvents());\n    assertThat(subEvents, hasSize(2));\n    Map<String, Object> expectedRequestEntries =\n        Map.of(\n            \"url\", \"/foo\",\n            \"absoluteUrl\", \"http://169.254.2.34/foo\",\n            \"method\", \"POST\",\n            \"scheme\", \"http\",\n            \"body\", \"{ \\\"result\\\": \\\"SUCCESS\\\" }\");\n    assertSubEvent(subEvents.get(0), WEBHOOK_REQUEST_SUB_EVENT_NAME, expectedRequestEntries);\n    assertSubEvent(subEvents.get(1), SubEvent.ERROR, expectedErrorMessage);\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"allHttpMethodsForWebhooks\")\n  public void firesWebhookForAllHttpMethods(RequestMethod method) throws Exception {\n    String body = \"{ \\\"test\\\": \\\"data\\\" }\";\n    rule.stubFor(\n        post(urlPathEqualTo(\"/trigger-webhook\"))\n            .willReturn(ok())\n            .withServeEventListener(\n                \"webhook\",\n                webhook()\n                    .withMethod(method)\n                    .withUrl(targetServer.url(\"/callback\"))\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withBody(body)));\n\n    client.post(\"/trigger-webhook\");\n\n    waitForRequestToTargetServer();\n\n    // Verify the webhook was called with the correct method\n    List<LoggedRequest> requests = targetServer.findAll(anyRequestedFor(urlEqualTo(\"/callback\")));\n    assertThat(requests, hasSize(1));\n    assertThat(requests.get(0).getMethod(), is(method));\n    if (method.hasEntity()) {\n      assertThat(requests.get(0).getBodyAsString(), is(body));\n    }\n  }\n\n  private static Stream<RequestMethod> allHttpMethodsForWebhooks() {\n    return Arrays.stream(RequestMethod.values())\n        .filter(m -> !m.equals(RequestMethod.ANY) && !m.equals(RequestMethod.GET_OR_HEAD));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WebsocketAcceptanceTestBase.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.resetMessageStubs;\n\nimport org.junit.jupiter.api.AfterEach;\n\npublic abstract class WebsocketAcceptanceTestBase extends AcceptanceTestBase {\n\n  @AfterEach\n  void resetMessageStubsAfterTest() {\n    resetMessageStubs();\n  }\n\n  protected String websocketUrl(String path) {\n    return \"ws://localhost:\" + wireMockServer.port() + path;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WebsocketConnectionAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.filePath;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static org.awaitility.Awaitility.waitAtMost;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.admin.model.SendChannelMessageResult;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.testsupport.WebsocketTestClient;\nimport com.github.tomakehurst.wiremock.verification.LoggedMessageChannel;\nimport java.util.List;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class WebsocketConnectionAcceptanceTest extends WebsocketAcceptanceTestBase {\n\n  @Test\n  void websocketConnectionCanBeEstablished() {\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/notifications\");\n    testClient.withWebsocketSession(\n        url,\n        session -> {\n          assertThat(session.isOpen(), is(true));\n          return null;\n        });\n  }\n\n  @Test\n  void canSendMessageToWebsocketViaAdminApi() {\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/notifications\");\n    testClient.withWebsocketSession(\n        url,\n        session -> {\n          RequestPattern pattern = newRequestPattern().withUrl(\"/notifications\").build();\n          SendChannelMessageResult result1 =\n              wireMockServer.sendChannelMessage(ChannelType.WEBSOCKET, pattern, \"Hello WebSocket!\");\n          SendChannelMessageResult result2 =\n              wireMockServer.sendChannelMessage(ChannelType.WEBSOCKET, pattern, \"Second message\");\n\n          assertThat(result1.getChannelsMessaged(), is(1));\n          assertThat(result2.getChannelsMessaged(), is(1));\n\n          List<LoggedMessageChannel> channels = result1.getChannels();\n          assertThat(channels, hasSize(1));\n          LoggedMessageChannel channel = channels.get(0);\n          assertThat(channel.getType(), is(ChannelType.WEBSOCKET));\n          assertThat(channel.isOpen(), is(true));\n          assertThat(channel.getInitiatingRequest().getUrl(), is(\"/notifications\"));\n\n          return null;\n        });\n\n    waitAtMost(5, SECONDS).until(() -> testClient.getMessages().size() == 2);\n    waitAtMost(5, SECONDS).until(() -> testClient.getMessages().contains(\"Hello WebSocket!\"));\n    waitAtMost(5, SECONDS).until(() -> testClient.getMessages().contains(\"Second message\"));\n  }\n\n  @Test\n  void canSendMessageToMultipleWebsocketConnections() {\n    WebsocketTestClient testClient1 = new WebsocketTestClient();\n    WebsocketTestClient testClient2 = new WebsocketTestClient();\n    String url = websocketUrl(\"/broadcast\");\n\n    testClient1.withWebsocketSession(\n        url,\n        session1 ->\n            testClient2.withWebsocketSession(\n                url,\n                session2 -> {\n                  RequestPattern pattern = newRequestPattern().withUrl(\"/broadcast\").build();\n                  SendChannelMessageResult result =\n                      wireMockServer.sendChannelMessage(\n                          ChannelType.WEBSOCKET, pattern, \"Broadcast message\");\n\n                  assertThat(result.getChannelsMessaged(), is(2));\n\n                  List<LoggedMessageChannel> channels = result.getChannels();\n                  assertThat(channels, hasSize(2));\n                  for (LoggedMessageChannel channel : channels) {\n                    assertThat(channel.getType(), is(ChannelType.WEBSOCKET));\n                    assertThat(channel.isOpen(), is(true));\n                    assertThat(channel.getInitiatingRequest().getUrl(), is(\"/broadcast\"));\n                  }\n\n                  return null;\n                }));\n\n    waitAtMost(5, SECONDS).until(() -> testClient1.getMessages().contains(\"Broadcast message\"));\n    waitAtMost(5, SECONDS).until(() -> testClient2.getMessages().contains(\"Broadcast message\"));\n  }\n\n  @Test\n  void requestPatternMatchingFiltersWebsocketChannels() {\n    WebsocketTestClient testClientA = new WebsocketTestClient();\n    WebsocketTestClient testClientB = new WebsocketTestClient();\n    String urlA = websocketUrl(\"/channel-a\");\n    String urlB = websocketUrl(\"/channel-b\");\n\n    testClientA.withWebsocketSession(\n        urlA,\n        sessionA ->\n            testClientB.withWebsocketSession(\n                urlB,\n                sessionB -> {\n                  RequestPattern patternA = newRequestPattern().withUrl(\"/channel-a\").build();\n                  SendChannelMessageResult result =\n                      wireMockServer.sendChannelMessage(\n                          ChannelType.WEBSOCKET, patternA, \"Message for A\");\n\n                  assertThat(result.getChannelsMessaged(), is(1));\n\n                  return null;\n                }));\n\n    waitAtMost(5, SECONDS).until(() -> testClientA.getMessages().contains(\"Message for A\"));\n    assertThat(testClientB.getMessages().isEmpty(), is(true));\n  }\n\n  @Test\n  void urlPatternMatchingWorksForWebsocketChannels() {\n    WebsocketTestClient testClient1 = new WebsocketTestClient();\n    WebsocketTestClient testClient2 = new WebsocketTestClient();\n    String url1 = websocketUrl(\"/events/user1\");\n    String url2 = websocketUrl(\"/events/user2\");\n\n    testClient1.withWebsocketSession(\n        url1,\n        session1 ->\n            testClient2.withWebsocketSession(\n                url2,\n                session2 -> {\n                  RequestPattern pattern =\n                      newRequestPattern().withUrl(urlPathMatching(\"/events/.*\")).build();\n                  SendChannelMessageResult result =\n                      wireMockServer.sendChannelMessage(\n                          ChannelType.WEBSOCKET, pattern, \"Event notification\");\n\n                  assertThat(result.getChannelsMessaged(), is(2));\n\n                  return null;\n                }));\n\n    waitAtMost(5, SECONDS).until(() -> testClient1.getMessages().contains(\"Event notification\"));\n    waitAtMost(5, SECONDS).until(() -> testClient2.getMessages().contains(\"Event notification\"));\n  }\n\n  @Test\n  void channelIsRemovedWhenWebsocketCloses() throws Exception {\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/temp-channel\");\n\n    testClient.withWebsocketSession(\n        url,\n        session -> {\n          RequestPattern pattern = newRequestPattern().withUrl(\"/temp-channel\").build();\n          SendChannelMessageResult result1 =\n              wireMockServer.sendChannelMessage(ChannelType.WEBSOCKET, pattern, \"Before close\");\n          assertThat(result1.getChannelsMessaged(), is(1));\n          assertThat(result1.getChannels(), hasSize(1));\n          return null;\n        });\n\n    Thread.sleep(100);\n\n    RequestPattern pattern = newRequestPattern().withUrl(\"/temp-channel\").build();\n    SendChannelMessageResult result2 =\n        wireMockServer.sendChannelMessage(ChannelType.WEBSOCKET, pattern, \"After close\");\n    assertThat(result2.getChannelsMessaged(), is(0));\n    assertThat(result2.getChannels(), hasSize(0));\n  }\n\n  @Nested\n  class WebSocketIdleTimeoutTest {\n\n    @RegisterExtension\n    WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(\n                wireMockConfig()\n                    .dynamicPort()\n                    .withRootDirectory(filePath(\"empty\"))\n                    .webSocketIdleTimeout(1000))\n            .build();\n\n    @Test\n    void websocketConnectionClosesAfterIdleTimeout() throws Exception {\n      WebsocketTestClient testClient = new WebsocketTestClient();\n      String url = \"ws://localhost:\" + wm.getPort() + \"/idle-timeout-test\";\n\n      testClient.connect(url);\n      assertThat(testClient.isConnected(), is(true));\n\n      // Wait for the idle timeout to expire (1 second + buffer)\n      Thread.sleep(1500);\n\n      // The connection should be closed by the server due to idle timeout\n      assertThat(testClient.isConnected(), is(false));\n    }\n\n    @Test\n    void websocketConnectionStaysOpenWithActivity() throws Exception {\n      WebsocketTestClient testClient = new WebsocketTestClient();\n      String url = \"ws://localhost:\" + wm.getPort() + \"/active-connection\";\n\n      testClient.connect(url);\n      assertThat(testClient.isConnected(), is(true));\n\n      // Send messages to keep the connection active\n      for (int i = 0; i < 3; i++) {\n        Thread.sleep(500);\n        testClient.sendMessage(\"keep-alive-\" + i);\n        assertThat(testClient.isConnected(), is(true));\n      }\n\n      testClient.disconnect();\n    }\n  }\n\n  @Nested\n  class WebSocketMaxTextMessageSizeTest {\n\n    @RegisterExtension\n    WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(\n                wireMockConfig()\n                    .dynamicPort()\n                    .withRootDirectory(filePath(\"empty\"))\n                    .webSocketMaxTextMessageSize(1024))\n            .build();\n\n    @Test\n    void acceptsTextMessageWithinLimit() throws Exception {\n      WebsocketTestClient testClient = new WebsocketTestClient();\n      String url = \"ws://localhost:\" + wm.getPort() + \"/text-size-test\";\n\n      testClient.connect(url);\n      assertThat(testClient.isConnected(), is(true));\n\n      // Send a message within the limit (500 bytes)\n      String smallMessage = \"x\".repeat(500);\n      testClient.sendMessage(smallMessage);\n\n      // Connection should still be open\n      Thread.sleep(100);\n      assertThat(testClient.isConnected(), is(true));\n\n      testClient.disconnect();\n    }\n\n    @Test\n    void closesConnectionWhenTextMessageExceedsLimit() throws Exception {\n      WebsocketTestClient testClient = new WebsocketTestClient();\n      String url = \"ws://localhost:\" + wm.getPort() + \"/text-size-test\";\n\n      testClient.connect(url);\n      assertThat(testClient.isConnected(), is(true));\n\n      // Send a message exceeding the limit (2000 bytes > 1024 limit)\n      String largeMessage = \"x\".repeat(2000);\n      testClient.sendMessage(largeMessage);\n\n      // Connection should be closed due to message size violation\n      Thread.sleep(200);\n      assertThat(testClient.isConnected(), is(false));\n    }\n  }\n\n  @Nested\n  class WebSocketMaxBinaryMessageSizeTest {\n\n    @RegisterExtension\n    WireMockExtension wm =\n        WireMockExtension.newInstance()\n            .options(\n                wireMockConfig()\n                    .dynamicPort()\n                    .withRootDirectory(filePath(\"empty\"))\n                    .webSocketMaxBinaryMessageSize(1024))\n            .build();\n\n    @Test\n    void acceptsBinaryMessageWithinLimit() throws Exception {\n      WebsocketTestClient testClient = new WebsocketTestClient();\n      String url = \"ws://localhost:\" + wm.getPort() + \"/binary-size-test\";\n\n      testClient.connect(url);\n      assertThat(testClient.isConnected(), is(true));\n\n      // Send a binary message within the limit (500 bytes)\n      byte[] smallMessage = new byte[500];\n      testClient.sendBinaryMessage(smallMessage);\n\n      // Connection should still be open\n      Thread.sleep(100);\n      assertThat(testClient.isConnected(), is(true));\n\n      testClient.disconnect();\n    }\n\n    @Test\n    void closesConnectionWhenBinaryMessageExceedsLimit() throws Exception {\n      WebsocketTestClient testClient = new WebsocketTestClient();\n      String url = \"ws://localhost:\" + wm.getPort() + \"/binary-size-test\";\n\n      testClient.connect(url);\n      assertThat(testClient.isConnected(), is(true));\n\n      // Send a binary message exceeding the limit (2000 bytes > 1024 limit)\n      byte[] largeMessage = new byte[2000];\n      testClient.sendBinaryMessage(largeMessage);\n\n      // Connection should be closed due to message size violation\n      Thread.sleep(200);\n      assertThat(testClient.isConnected(), is(false));\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WebsocketEntityDefinitionAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.binaryEqualTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.message;\nimport static com.github.tomakehurst.wiremock.client.WireMock.messageStubFor;\nimport static com.github.tomakehurst.wiremock.client.WireMock.sendMessage;\nimport static com.github.tomakehurst.wiremock.common.entity.BinaryEntityDefinition.aBinaryMessage;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static java.nio.file.Files.write;\nimport static java.nio.file.Files.writeString;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.awaitility.Awaitility.waitAtMost;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WebsocketTestClient;\nimport java.io.File;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\n\npublic class WebsocketEntityDefinitionAcceptanceTest extends WebsocketAcceptanceTestBase {\n\n  @Test\n  void textEntityDefinitionWithStringDataResolvesToString() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"String data stub\")\n            .withBody(equalTo(\"trigger\"))\n            .triggersAction(sendMessage().withBody(\"hello world\").onOriginatingChannel())\n            .build();\n    wireMockServer.addMessageStubMapping(stub);\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/string-data-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"trigger\");\n    assertThat(response, is(\"hello world\"));\n  }\n\n  @Test\n  void textEntityDefinitionWithObjectDataSerializesToJson() {\n    Map<String, Object> objectData = Map.of(\"name\", \"John\", \"age\", 30);\n    messageStubFor(\n        message()\n            .withName(\"Object data stub\")\n            .withBody(equalTo(\"trigger\"))\n            .willTriggerActions(sendMessage().withBody(objectData).onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/object-data-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"trigger\");\n    assertThat(response, jsonEquals(\"{\\\"name\\\":\\\"John\\\",\\\"age\\\":30}\"));\n  }\n\n  @Test\n  void textEntityDefinitionWithDataStoreResolvesFromStore() {\n    wireMockServer\n        .getOptions()\n        .getStores()\n        .getObjectStore(\"testStore\")\n        .put(\"testKey\", \"stored value\");\n\n    messageStubFor(\n        message()\n            .withName(\"Store data stub\")\n            .withBody(equalTo(\"trigger\"))\n            .willTriggerActions(\n                sendMessage().withBodyFromStore(\"testStore\", \"testKey\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/store-data-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"trigger\");\n    assertThat(response, is(\"stored value\"));\n  }\n\n  @Test\n  void textEntityDefinitionWithDataStoreResolvesObjectFromStoreAsJson() {\n    Map<String, Object> storedObject = Map.of(\"key\", \"value\", \"number\", 42);\n    wireMockServer\n        .getOptions()\n        .getStores()\n        .getObjectStore(\"objectStore\")\n        .put(\"objectKey\", storedObject);\n\n    messageStubFor(\n        message()\n            .withName(\"Store object data stub\")\n            .withBody(equalTo(\"trigger\"))\n            .willTriggerActions(\n                sendMessage()\n                    .withBodyFromStore(\"objectStore\", \"objectKey\")\n                    .onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/store-object-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"trigger\");\n    assertThat(response, jsonEquals(\"{\\\"number\\\":42,\\\"key\\\":\\\"value\\\"}\"));\n  }\n\n  @Test\n  void binaryEqualToCanBeUsedToMatchMessageBody() {\n    byte[] expectedBytes = new byte[] {0x01, 0x02, 0x03, 0x04, 0x05};\n\n    messageStubFor(\n        message()\n            .withName(\"Binary matching stub\")\n            .withBody(binaryEqualTo(expectedBytes))\n            .willTriggerActions(sendMessage(\"binary matched!\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/binary-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendBinaryMessage(expectedBytes);\n\n    waitAtMost(5, SECONDS).until(() -> testClient.getMessages().contains(\"binary matched!\"));\n    assertThat(testClient.getMessages().contains(\"binary matched!\"), is(true));\n  }\n\n  @Test\n  void binaryMessageCanBeSentAsResponse() {\n    byte[] responseBytes = new byte[] {0x0A, 0x0B, 0x0C, 0x0D, 0x0E};\n\n    messageStubFor(\n        message()\n            .withName(\"Binary response stub\")\n            .withBody(equalTo(\"send-binary\"))\n            .willTriggerActions(\n                sendMessage()\n                    .toOriginatingChannel()\n                    .withMessage(aBinaryMessage().withBody(responseBytes))));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/binary-response-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"send-binary\");\n\n    waitAtMost(5, SECONDS).until(() -> !testClient.getBinaryMessages().isEmpty());\n    assertThat(testClient.getBinaryMessages().get(0), is(responseBytes));\n  }\n\n  @Test\n  void binaryMessageFromDataStoreCanBeSentAsResponse() {\n    byte[] storedBytes = new byte[] {0x10, 0x20, 0x30, 0x40, 0x50};\n    wireMockServer\n        .getOptions()\n        .getStores()\n        .getObjectStore(\"binaryStore\")\n        .put(\"binaryKey\", storedBytes);\n\n    messageStubFor(\n        message()\n            .withName(\"Binary from store stub\")\n            .withBody(equalTo(\"send-stored-binary\"))\n            .willTriggerActions(\n                sendMessage()\n                    .toOriginatingChannel()\n                    .withMessage(\n                        aBinaryMessage().withDataStore(\"binaryStore\").withDataRef(\"binaryKey\"))));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/binary-store-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"send-stored-binary\");\n\n    waitAtMost(5, SECONDS).until(() -> !testClient.getBinaryMessages().isEmpty());\n    assertThat(testClient.getBinaryMessages().get(0), is(storedBytes));\n  }\n\n  @Test\n  void textEntityDefinitionWithFilePathResolvesFromFilesStore() throws Exception {\n    wireMockServer.stop();\n    File tempRoot = setupTempFileRoot();\n    setupServer(wireMockConfig().withRootDirectory(tempRoot.getAbsolutePath()));\n\n    File messageFile = new File(tempRoot, \"__files/message-body.txt\");\n    writeString(messageFile.toPath(), \"Hello from file!\");\n\n    messageStubFor(\n        message()\n            .withName(\"File body stub\")\n            .withBody(equalTo(\"trigger\"))\n            .willTriggerActions(\n                sendMessage().withBodyFromFile(\"message-body.txt\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/file-body-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"trigger\");\n    assertThat(response, is(\"Hello from file!\"));\n  }\n\n  @Test\n  void binaryEntityDefinitionWithFilePathResolvesFromFilesStore() throws Exception {\n    File tempRoot = setupServerWithTempFileRoot();\n\n    byte[] binaryContent = new byte[] {0x01, 0x02, 0x03, 0x04, 0x05};\n    File binaryFile = new File(tempRoot, \"__files/binary-body.bin\");\n    write(binaryFile.toPath(), binaryContent);\n\n    messageStubFor(\n        message()\n            .withName(\"DSL broadcast stub\")\n            .withBody(equalTo(\"trigger\"))\n            .willTriggerActions(\n                sendMessage()\n                    .toOriginatingChannel()\n                    .withMessage(aBinaryMessage().withFilePath(\"binary-body.bin\"))));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/binary-file-body-test\");\n\n    byte[] response = testClient.sendMessageAndWaitForBinaryResponse(url, \"trigger\");\n    assertThat(response, is(binaryContent));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WebsocketHttpTriggerAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.message;\nimport static com.github.tomakehurst.wiremock.client.WireMock.messageStubFor;\nimport static com.github.tomakehurst.wiremock.client.WireMock.post;\nimport static com.github.tomakehurst.wiremock.client.WireMock.sendMessage;\nimport static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static org.awaitility.Awaitility.waitAtMost;\n\nimport com.github.tomakehurst.wiremock.testsupport.WebsocketTestClient;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\n\npublic class WebsocketHttpTriggerAcceptanceTest extends WebsocketAcceptanceTestBase {\n\n  @Test\n  void messageStubTriggeredByHttpStubSendsMessageToWebsocketChannel() {\n    stubFor(\n        get(urlPathEqualTo(\"/api/trigger-event\"))\n            .withId(UUID.fromString(\"11111111-2222-3333-4444-555555555555\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"OK\")));\n\n    wireMockServer.messageStubFor(\n        message()\n            .withName(\"HTTP stub triggered message\")\n            .triggeredByHttpStub(\"11111111-2222-3333-4444-555555555555\")\n            .willTriggerActions(\n                sendMessage(\"event triggered\")\n                    .onChannelsMatching(\n                        newRequestPattern().withUrl(urlPathEqualTo(\"/ws-events\")))));\n\n    WebsocketTestClient wsClient = new WebsocketTestClient();\n    String wsUrl = websocketUrl(\"/ws-events\");\n    wsClient.connect(wsUrl);\n    waitAtMost(5, SECONDS).until(wsClient::isConnected);\n\n    testClient.get(\"/api/trigger-event\");\n\n    waitAtMost(5, SECONDS).until(() -> wsClient.getMessages().contains(\"event triggered\"));\n  }\n\n  @Test\n  void messageStubTriggeredByHttpRequestPatternSendsMessageToWebsocketChannel() {\n    messageStubFor(\n        message()\n            .withName(\"HTTP request pattern triggered message\")\n            .triggeredByHttpRequest(newRequestPattern().withUrl(urlPathMatching(\"/api/notify/.*\")))\n            .willTriggerActions(\n                sendMessage()\n                    .withBody(\"notification received\")\n                    .onChannelsMatching(\n                        newRequestPattern().withUrl(urlPathEqualTo(\"/ws-notifications\")))));\n\n    stubFor(\n        get(urlPathMatching(\"/api/notify/.*\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"Notified\")));\n\n    WebsocketTestClient wsClient = new WebsocketTestClient();\n    String wsUrl = websocketUrl(\"/ws-notifications\");\n    wsClient.connect(wsUrl);\n    waitAtMost(5, SECONDS).until(wsClient::isConnected);\n\n    testClient.get(\"/api/notify/user123\");\n\n    waitAtMost(5, SECONDS).until(() -> wsClient.getMessages().contains(\"notification received\"));\n  }\n\n  @Test\n  void messageStubTriggeredByHttpRequestPatternWorksWithoutMatchingHttpStub() {\n    messageStubFor(\n        message()\n            .withName(\"HTTP request pattern triggered without stub\")\n            .triggeredByHttpRequest(newRequestPattern().withUrl(urlPathEqualTo(\"/api/no-stub\")))\n            .willTriggerActions(\n                sendMessage(\"request received\")\n                    .onChannelsMatching(\n                        newRequestPattern().withUrl(urlPathEqualTo(\"/ws-no-stub\")))));\n\n    WebsocketTestClient wsClient = new WebsocketTestClient();\n    String wsUrl = websocketUrl(\"/ws-no-stub\");\n    wsClient.connect(wsUrl);\n    waitAtMost(5, SECONDS).until(wsClient::isConnected);\n\n    testClient.get(\"/api/no-stub\");\n\n    waitAtMost(5, SECONDS).until(() -> wsClient.getMessages().contains(\"request received\"));\n  }\n\n  @Test\n  void multipleWebsocketClientsReceiveMessageWhenHttpStubIsTriggered() {\n    stubFor(\n        post(urlPathEqualTo(\"/api/broadcast\"))\n            .withId(UUID.fromString(\"22222222-3333-4444-5555-666666666666\"))\n            .willReturn(aResponse().withStatus(200).withBody(\"Broadcast sent\")));\n\n    messageStubFor(\n        message()\n            .withName(\"Broadcast on HTTP stub\")\n            .triggeredByHttpStub(\"22222222-3333-4444-5555-666666666666\")\n            .willTriggerActions(\n                sendMessage(\"broadcast message\")\n                    .onChannelsMatching(\n                        newRequestPattern().withUrl(urlPathMatching(\"/ws-broadcast.*\")))));\n\n    WebsocketTestClient wsClient1 = new WebsocketTestClient();\n    WebsocketTestClient wsClient2 = new WebsocketTestClient();\n    String wsUrl1 = websocketUrl(\"/ws-broadcast-1\");\n    String wsUrl2 = websocketUrl(\"/ws-broadcast-2\");\n    wsClient1.connect(wsUrl1);\n    wsClient2.connect(wsUrl2);\n    waitAtMost(5, SECONDS).until(wsClient1::isConnected);\n    waitAtMost(5, SECONDS).until(wsClient2::isConnected);\n\n    testClient.postWithBody(\"/api/broadcast\", \"trigger\", \"text/plain\");\n\n    waitAtMost(5, SECONDS).until(() -> wsClient1.getMessages().contains(\"broadcast message\"));\n    waitAtMost(5, SECONDS).until(() -> wsClient2.getMessages().contains(\"broadcast message\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WebsocketMessageJournalAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.exactly;\nimport static com.github.tomakehurst.wiremock.client.WireMock.findAllMessageEvents;\nimport static com.github.tomakehurst.wiremock.client.WireMock.getAllMessageServeEvents;\nimport static com.github.tomakehurst.wiremock.client.WireMock.getMessageServeEvent;\nimport static com.github.tomakehurst.wiremock.client.WireMock.lessThan;\nimport static com.github.tomakehurst.wiremock.client.WireMock.listAllMessageChannels;\nimport static com.github.tomakehurst.wiremock.client.WireMock.listAllMessageStubMappings;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matching;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath;\nimport static com.github.tomakehurst.wiremock.client.WireMock.message;\nimport static com.github.tomakehurst.wiremock.client.WireMock.messageStubFor;\nimport static com.github.tomakehurst.wiremock.client.WireMock.moreThanOrExactly;\nimport static com.github.tomakehurst.wiremock.client.WireMock.removeMessageServeEvent;\nimport static com.github.tomakehurst.wiremock.client.WireMock.removeMessageServeEventsForStubsMatchingMetadata;\nimport static com.github.tomakehurst.wiremock.client.WireMock.removeMessageServeEventsMatching;\nimport static com.github.tomakehurst.wiremock.client.WireMock.resetMessageJournal;\nimport static com.github.tomakehurst.wiremock.client.WireMock.sendMessage;\nimport static com.github.tomakehurst.wiremock.client.WireMock.verifyMessageEvent;\nimport static com.github.tomakehurst.wiremock.client.WireMock.waitForMessageEvent;\nimport static com.github.tomakehurst.wiremock.client.WireMock.waitForMessageEvents;\nimport static com.github.tomakehurst.wiremock.common.Metadata.metadata;\nimport static com.github.tomakehurst.wiremock.message.MessagePattern.messagePattern;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.messageStubMappingWithName;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static org.awaitility.Awaitility.waitAtMost;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.greaterThanOrEqualTo;\nimport static org.hamcrest.Matchers.hasItem;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.notNullValue;\n\nimport com.github.tomakehurst.wiremock.admin.model.ListMessageChannelsResult;\nimport com.github.tomakehurst.wiremock.admin.model.ListMessageStubMappingsResult;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.message.SendMessageAction;\nimport com.github.tomakehurst.wiremock.testsupport.WebsocketTestClient;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.time.Duration;\nimport java.util.List;\nimport java.util.Optional;\nimport org.junit.jupiter.api.Test;\n\npublic class WebsocketMessageJournalAcceptanceTest extends WebsocketAcceptanceTestBase {\n\n  @Test\n  void messageJournalRecordsReceivedMessages() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Journal test stub\")\n            .withBody(equalTo(\"journal-test\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"response\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/journal-test\");\n\n    testClient.sendMessageAndWaitForResponse(url, \"journal-test\");\n\n    var events = getAllMessageServeEvents();\n    assertThat(events.size(), is(1));\n\n    var event = events.get(0);\n    assertThat(event.getMessage().getBodyAsString(), is(\"journal-test\"));\n    assertThat(event.getWasMatched(), is(true));\n    assertThat(event.getStubMapping().getName(), is(\"Journal test stub\"));\n  }\n\n  @Test\n  void messageJournalRecordsUnmatchedMessages() {\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/unmatched-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n    testClient.sendMessage(\"unmatched-message\");\n\n    waitAtMost(5, SECONDS).until(() -> !getAllMessageServeEvents().isEmpty());\n\n    var events = getAllMessageServeEvents();\n    assertThat(events.size(), is(1));\n\n    var event = events.get(0);\n    assertThat(event.getMessage().getBodyAsString(), is(\"unmatched-message\"));\n    assertThat(event.getWasMatched(), is(false));\n  }\n\n  @Test\n  void canCountMessageEventsMatchingPredicate() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Count test stub\")\n            .withBody(matching(\"count-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"counted\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/count-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"count-1\");\n    testClient.sendMessage(\"count-2\");\n    testClient.sendMessage(\"count-3\");\n\n    waitAtMost(5, SECONDS).until(() -> findAllMessageEvents(MessagePattern.ANYTHING).size() >= 3);\n\n    int count =\n        findAllMessageEvents(messagePattern().withBody(matching(\"count-.*\")).build()).size();\n    assertThat(count, is(3));\n  }\n\n  @Test\n  void canFindMessageEventsMatchingPredicate() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Find test stub\")\n            .withBody(matching(\"find-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"found\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/find-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"find-alpha\");\n    testClient.sendMessage(\"find-beta\");\n\n    waitAtMost(5, SECONDS).until(() -> findAllMessageEvents(MessagePattern.ANYTHING).size() >= 2);\n\n    var events = findAllMessageEvents(messagePattern().withBody(equalTo(\"find-alpha\")).build());\n    assertThat(events.size(), is(1));\n    assertThat(events.get(0).getMessage().getBodyAsString(), is(\"find-alpha\"));\n  }\n\n  @Test\n  void canResetMessageJournal() {\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/reset-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n    testClient.sendMessage(\"before-reset\");\n\n    waitAtMost(5, SECONDS).until(() -> !getAllMessageServeEvents().isEmpty());\n\n    resetMessageJournal();\n\n    var events = getAllMessageServeEvents();\n    assertThat(events.size(), is(0));\n  }\n\n  @Test\n  void canVerifyAtLeastOneMessageEventMatchesPredicate() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Verify test stub\")\n            .withBody(matching(\"verify-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"verified\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/verify-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"verify-one\");\n    testClient.sendMessage(\"verify-two\");\n\n    waitAtMost(5, SECONDS).until(() -> findAllMessageEvents(MessagePattern.ANYTHING).size() >= 2);\n\n    verifyMessageEvent(messagePattern().withBody(equalTo(\"verify-one\")).build());\n    verifyMessageEvent(messagePattern().withBody(matching(\"verify-.*\")).build());\n  }\n\n  @Test\n  void canVerifyExactCountOfMessageEvents() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Verify count stub\")\n            .withBody(matching(\"count-verify-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"counted\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/verify-count-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"count-verify-1\");\n    testClient.sendMessage(\"count-verify-2\");\n    testClient.sendMessage(\"count-verify-3\");\n\n    waitAtMost(5, SECONDS).until(() -> findAllMessageEvents(MessagePattern.ANYTHING).size() >= 3);\n\n    verifyMessageEvent(3, messagePattern().withBody(matching(\"count-verify-.*\")).build());\n    verifyMessageEvent(1, messagePattern().withBody(equalTo(\"count-verify-2\")).build());\n  }\n\n  @Test\n  void canVerifyMessageEventsWithCountMatchingStrategy() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Verify strategy stub\")\n            .withBody(matching(\"strategy-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"strategized\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/verify-strategy-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"strategy-a\");\n    testClient.sendMessage(\"strategy-b\");\n\n    MessagePattern strategyPattern = messagePattern().withBody(matching(\"strategy-.*\")).build();\n\n    waitAtMost(5, SECONDS).until(() -> findAllMessageEvents(MessagePattern.ANYTHING).size() >= 2);\n\n    verifyMessageEvent(moreThanOrExactly(1), strategyPattern);\n    verifyMessageEvent(lessThan(5), strategyPattern);\n    verifyMessageEvent(exactly(2), strategyPattern);\n  }\n\n  @Test\n  void verifyMessageEventThrowsWhenNoMatchingEvents() {\n    resetMessageJournal();\n\n    org.junit.jupiter.api.Assertions.assertThrows(\n        com.github.tomakehurst.wiremock.client.VerificationException.class,\n        () -> verifyMessageEvent(messagePattern().withBody(equalTo(\"non-existent\")).build()));\n  }\n\n  @Test\n  void verifyMessageEventThrowsWhenCountDoesNotMatch() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Verify fail stub\")\n            .withBody(matching(\"fail-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"failed\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/verify-fail-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"fail-1\");\n    testClient.sendMessage(\"fail-2\");\n\n    waitAtMost(5, SECONDS).until(() -> findAllMessageEvents(MessagePattern.ANYTHING).size() >= 2);\n\n    org.junit.jupiter.api.Assertions.assertThrows(\n        com.github.tomakehurst.wiremock.client.VerificationException.class,\n        () -> verifyMessageEvent(5, messagePattern().withBody(matching(\"fail-.*\")).build()));\n  }\n\n  @Test\n  void canGetSingleMessageServeEventById() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Get single event stub\")\n            .withBody(matching(\"get-single-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"got it\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/get-single-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"get-single-event\");\n\n    waitAtMost(5, SECONDS).until(() -> !getAllMessageServeEvents().isEmpty());\n\n    MessageServeEvent event = getAllMessageServeEvents().get(0);\n    MessageServeEvent retrievedEvent = getMessageServeEvent(event.getId());\n\n    assertThat(retrievedEvent.getId(), is(event.getId()));\n    assertThat(retrievedEvent.getMessage(), is(event.getMessage()));\n  }\n\n  @Test\n  void canRemoveSingleMessageServeEventById() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Remove single event stub\")\n            .withBody(matching(\"remove-single-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"removed\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/remove-single-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"remove-single-1\");\n    testClient.sendMessage(\"remove-single-2\");\n\n    waitAtMost(5, SECONDS).until(() -> getAllMessageServeEvents().size() >= 2);\n\n    int initialCount = getAllMessageServeEvents().size();\n    MessageServeEvent eventToRemove = getAllMessageServeEvents().get(0);\n\n    removeMessageServeEvent(eventToRemove.getId());\n\n    assertThat(getAllMessageServeEvents().size(), is(initialCount - 1));\n  }\n\n  @Test\n  void canRemoveMessageServeEventsMatchingPattern() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Remove by pattern stub\")\n            .withBody(matching(\"remove-pattern-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"removed\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/remove-pattern-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"remove-pattern-1\");\n    testClient.sendMessage(\"remove-pattern-2\");\n    testClient.sendMessage(\"other-message\");\n\n    waitAtMost(5, SECONDS).until(() -> getAllMessageServeEvents().size() >= 3);\n\n    assertThat(getAllMessageServeEvents().size(), is(3));\n\n    var result =\n        removeMessageServeEventsMatching(\n            messagePattern().withBody(matching(\"remove-pattern-.*\")).build());\n\n    assertThat(result.getMessageServeEvents().size(), is(2));\n    assertThat(getAllMessageServeEvents().size(), is(1));\n    assertThat(\n        getAllMessageServeEvents().get(0).getMessage().getBodyAsString(), is(\"other-message\"));\n  }\n\n  @Test\n  void canRemoveMessageServeEventsForStubsMatchingMetadata() {\n    MessageStubMapping stubWithMetadata =\n        MessageStubMapping.builder()\n            .withName(\"Metadata stub\")\n            .withBody(matching(\"metadata-.*\"))\n            .withMetadata(metadata().attr(\"category\", \"test\").attr(\"priority\", \"high\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"response\"))\n            .build();\n    messageStubFor(stubWithMetadata);\n\n    MessageStubMapping stubWithoutMetadata =\n        MessageStubMapping.builder()\n            .withName(\"No metadata stub\")\n            .withBody(matching(\"other-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"other-response\"))\n            .build();\n    messageStubFor(stubWithoutMetadata);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/metadata-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"metadata-a\");\n    testClient.sendMessage(\"other-b\");\n\n    waitAtMost(5, SECONDS).until(() -> getAllMessageServeEvents().size() >= 2);\n\n    assertThat(getAllMessageServeEvents().size(), is(2));\n\n    var result =\n        removeMessageServeEventsForStubsMatchingMetadata(\n            matchingJsonPath(\"$.category\", equalTo(\"test\")));\n\n    assertThat(result.getMessageServeEvents().size(), is(1));\n    assertThat(getAllMessageServeEvents().size(), is(1));\n    assertThat(getAllMessageServeEvents().get(0).getMessage().getBodyAsString(), is(\"other-b\"));\n  }\n\n  @Test\n  void stubsAreNotRemovedViaMetadataWhenNoneMatch() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Metadata stub\")\n            .withBody(matching(\"metadata-.*\"))\n            .withMetadata(metadata().attr(\"category\", \"test\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"response\"))\n            .build();\n    messageStubFor(stub);\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/metadata-no-match-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"metadata-a\");\n\n    waitAtMost(5, SECONDS).until(() -> !getAllMessageServeEvents().isEmpty());\n\n    assertThat(getAllMessageServeEvents().size(), is(1));\n\n    var result =\n        removeMessageServeEventsForStubsMatchingMetadata(\n            matchingJsonPath(\"$.nonexistent\", equalTo(\"value\")));\n\n    assertThat(result.getMessageServeEvents().size(), is(0));\n    assertThat(getAllMessageServeEvents().size(), is(1));\n  }\n\n  @Test\n  void canListAllMessageStubMappingsViaHttpClient() {\n    messageStubFor(\n        message()\n            .withName(\"List stub 1\")\n            .withBody(equalTo(\"list-test-1\"))\n            .willTriggerActions(sendMessage(\"response1\").onOriginatingChannel()));\n\n    messageStubFor(\n        message()\n            .withName(\"List stub 2\")\n            .withBody(equalTo(\"list-test-2\"))\n            .willTriggerActions(sendMessage(\"response2\").onOriginatingChannel()));\n\n    ListMessageStubMappingsResult result = listAllMessageStubMappings();\n\n    assertThat(result.getMessageMappings().size(), is(greaterThanOrEqualTo(2)));\n    assertThat(result.getMessageMappings(), hasItem(messageStubMappingWithName(\"List stub 1\")));\n    assertThat(result.getMessageMappings(), hasItem(messageStubMappingWithName(\"List stub 2\")));\n  }\n\n  @Test\n  void canListAllMessageChannelsViaHttpClient() {\n    messageStubFor(\n        message()\n            .withName(\"Channel list stub\")\n            .withBody(equalTo(\"channel-list-test\"))\n            .willTriggerActions(sendMessage(\"response\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient1 = new WebsocketTestClient();\n    WebsocketTestClient testClient2 = new WebsocketTestClient();\n    String url1 = websocketUrl(\"/channel-list-1\");\n    String url2 = websocketUrl(\"/channel-list-2\");\n\n    testClient1.connect(url1);\n    testClient2.connect(url2);\n\n    waitAtMost(5, SECONDS).until(testClient1::isConnected);\n    waitAtMost(5, SECONDS).until(testClient2::isConnected);\n\n    ListMessageChannelsResult result = listAllMessageChannels();\n\n    assertThat(result, is(notNullValue()));\n    assertThat(result.getChannels().size(), is(greaterThanOrEqualTo(2)));\n\n    testClient1.disconnect();\n    testClient2.disconnect();\n  }\n\n  @Test\n  void canWaitForSingleMessageEventViaHttpClient() {\n    messageStubFor(\n        MessageStubMapping.builder()\n            .withName(\"Wait single stub\")\n            .withBody(equalTo(\"wait-single-test\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"response\"))\n            .build());\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/wait-single-test\");\n    testClient.sendMessageAndWaitForResponse(url, \"wait-single-test\");\n\n    Optional<MessageServeEvent> result =\n        waitForMessageEvent(\n            messagePattern().withBody(equalTo(\"wait-single-test\")).build(), Duration.ofSeconds(5));\n\n    assertThat(result.isPresent(), is(true));\n    assertThat(result.get().getMessage().getBodyAsString(), is(\"wait-single-test\"));\n  }\n\n  @Test\n  void waitForSingleMessageEventReturnsEmptyWhenNoMatch() {\n    resetMessageJournal();\n\n    Optional<MessageServeEvent> result =\n        waitForMessageEvent(\n            messagePattern().withBody(equalTo(\"non-existent-message\")).build(),\n            Duration.ofMillis(200));\n\n    assertThat(result.isPresent(), is(false));\n  }\n\n  @Test\n  void canWaitForMultipleMessageEventsViaHttpClient() {\n    messageStubFor(\n        MessageStubMapping.builder()\n            .withName(\"Wait multiple stub\")\n            .withBody(matching(\"wait-multi-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"response\"))\n            .build());\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/wait-multi-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"wait-multi-1\");\n    testClient.sendMessage(\"wait-multi-2\");\n    testClient.sendMessage(\"wait-multi-3\");\n\n    waitAtMost(5, SECONDS)\n        .until(\n            () ->\n                findAllMessageEvents(messagePattern().withBody(matching(\"wait-multi-.*\")).build())\n                        .size()\n                    >= 3);\n\n    List<MessageServeEvent> result =\n        waitForMessageEvents(\n            messagePattern().withBody(matching(\"wait-multi-.*\")).build(), 3, Duration.ofSeconds(5));\n\n    assertThat(result, hasSize(3));\n  }\n\n  @Test\n  void waitForMultipleMessageEventsReturnsPartialResultsOnTimeout() {\n    messageStubFor(\n        message()\n            .withName(\"Wait partial stub\")\n            .withBody(matching(\"wait-partial-.*\"))\n            .willTriggerActions(SendMessageAction.toOriginatingChannel(\"response\")));\n\n    resetMessageJournal();\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/wait-partial-test\");\n\n    testClient.connect(url);\n    waitAtMost(5, SECONDS).until(testClient::isConnected);\n\n    testClient.sendMessage(\"wait-partial-1\");\n\n    waitAtMost(5, SECONDS)\n        .until(\n            () ->\n                !findAllMessageEvents(\n                        messagePattern().withBody(matching(\"wait-partial-.*\")).build())\n                    .isEmpty());\n\n    List<MessageServeEvent> result =\n        waitForMessageEvents(\n            messagePattern().withBody(matching(\"wait-partial-.*\")).build(),\n            5,\n            Duration.ofMillis(200));\n\n    assertThat(result.size(), is(greaterThanOrEqualTo(1)));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WebsocketMessageStubAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;\nimport static com.github.tomakehurst.wiremock.client.WireMock.findMessageStubsByMetadata;\nimport static com.github.tomakehurst.wiremock.client.WireMock.listAllMessageStubMappings;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matching;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath;\nimport static com.github.tomakehurst.wiremock.client.WireMock.message;\nimport static com.github.tomakehurst.wiremock.client.WireMock.messageStubFor;\nimport static com.github.tomakehurst.wiremock.client.WireMock.removeMessageStubsByMetadata;\nimport static com.github.tomakehurst.wiremock.client.WireMock.sendMessage;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;\nimport static com.github.tomakehurst.wiremock.common.Metadata.metadata;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.messageStubMappingWithName;\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static org.awaitility.Awaitility.waitAtMost;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItem;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.message.SendMessageAction;\nimport com.github.tomakehurst.wiremock.testsupport.WebsocketTestClient;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class WebsocketMessageStubAcceptanceTest extends WebsocketAcceptanceTestBase {\n\n  @Test\n  void messageStubMappingRespondsToOriginatingChannel() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Echo stub\")\n            .withBody(equalTo(\"ping\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"pong\"))\n            .build();\n    wireMockServer.addMessageStubMapping(stub);\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/echo\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"ping\");\n    assertThat(response, is(\"pong\"));\n  }\n\n  @Test\n  void messageStubMappingMatchesWithRegexPattern() {\n    messageStubFor(\n        message()\n            .withName(\"Greeting stub\")\n            .withBody(matching(\"hello.*\"))\n            .willTriggerActions(sendMessage(\"hi there!\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/greet\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"hello world\");\n    assertThat(response, is(\"hi there!\"));\n  }\n\n  @Test\n  void messageStubMappingWithChannelPatternMatchesSpecificChannels() {\n    messageStubFor(\n        message()\n            .withName(\"VIP stub\")\n            .onWebsocketChannelFromRequestMatching(newRequestPattern().withUrl(\"/vip-channel\"))\n            .withBody(equalTo(\"request\"))\n            .willTriggerActions(sendMessage(\"VIP response\").onOriginatingChannel()));\n\n    WebsocketTestClient vipClient = new WebsocketTestClient();\n    WebsocketTestClient regularClient = new WebsocketTestClient();\n    String vipUrl = websocketUrl(\"/vip-channel\");\n    String regularUrl = websocketUrl(\"/regular-channel\");\n\n    String vipResponse = vipClient.sendMessageAndWaitForResponse(vipUrl, \"request\");\n    assertThat(vipResponse, is(\"VIP response\"));\n\n    regularClient.sendMessage(regularUrl, \"request\");\n    try {\n      Thread.sleep(200);\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n    }\n    assertThat(regularClient.getMessages().isEmpty(), is(true));\n  }\n\n  @Test\n  void messageStubMappingPriorityDeterminesMatchOrder() {\n    messageStubFor(\n        message()\n            .withName(\"Low priority stub\")\n            .withPriority(10)\n            .willTriggerActions(sendMessage(\"low priority\").onOriginatingChannel()));\n\n    messageStubFor(\n        message()\n            .withName(\"High priority stub\")\n            .withPriority(1)\n            .withBody(equalTo(\"test\"))\n            .willTriggerActions(sendMessage(\"high priority\").onOriginatingChannel()));\n\n    messageStubFor(\n        message()\n            .withName(\"Medium priority stub\")\n            .withPriority(4)\n            .withBody(equalTo(\"test\"))\n            .willTriggerActions(sendMessage(\"medium priority\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/priority-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"test\");\n    assertThat(response, is(\"high priority\"));\n  }\n\n  @Test\n  void messageStubMappingWithSamePriorityMatchesMostRecentlyAdded() {\n    messageStubFor(\n        message()\n            .withName(\"First stub\")\n            .withPriority(5)\n            .willTriggerActions(sendMessage(\"first\").onOriginatingChannel()));\n\n    messageStubFor(\n        message()\n            .withName(\"Second stub\")\n            .withPriority(5)\n            .willTriggerActions(sendMessage(\"second\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/same-priority-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"test\");\n    assertThat(response, is(\"second\"));\n  }\n\n  @Test\n  void messageStubMappingCanSendToMatchingChannels() {\n    messageStubFor(\n        message()\n            .withName(\"Broadcast stub\")\n            .withBody(equalTo(\"broadcast\"))\n            .willTriggerActions(\n                sendMessage(\"broadcast message\")\n                    .onChannelsMatching(\n                        newRequestPattern().withUrl(urlPathMatching(\"/broadcast/.*\")))));\n\n    WebsocketTestClient senderClient = new WebsocketTestClient();\n    WebsocketTestClient receiverClient1 = new WebsocketTestClient();\n    WebsocketTestClient receiverClient2 = new WebsocketTestClient();\n    String senderUrl = websocketUrl(\"/sender\");\n    String receiverUrl1 = websocketUrl(\"/broadcast/user1\");\n    String receiverUrl2 = websocketUrl(\"/broadcast/user2\");\n\n    receiverClient1.withWebsocketSession(\n        receiverUrl1,\n        session1 ->\n            receiverClient2.withWebsocketSession(\n                receiverUrl2,\n                session2 -> {\n                  senderClient.sendMessage(senderUrl, \"broadcast\");\n                  return null;\n                }));\n\n    waitAtMost(5, SECONDS).until(() -> receiverClient1.getMessages().contains(\"broadcast message\"));\n    waitAtMost(5, SECONDS).until(() -> receiverClient2.getMessages().contains(\"broadcast message\"));\n  }\n\n  @Test\n  void messageStubMappingCanBeRemoved() {\n    MessageStubMapping stub =\n        messageStubFor(\n            message()\n                .withName(\"Removable stub\")\n                .withBody(equalTo(\"test\"))\n                .willTriggerActions(sendMessage(\"response\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/remove-test\");\n\n    String response1 = testClient.sendMessageAndWaitForResponse(url, \"test\");\n    assertThat(response1, is(\"response\"));\n\n    wireMockServer.removeMessageStubMapping(stub.getId());\n    testClient.clearMessages();\n\n    testClient.sendMessage(url, \"test\");\n    try {\n      Thread.sleep(200);\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n    }\n    assertThat(testClient.getMessages().isEmpty(), is(true));\n  }\n\n  @Test\n  void messageStubMappingWithMultipleActions() {\n    messageStubFor(\n        message()\n            .withName(\"Multi-action stub\")\n            .withBody(equalTo(\"multi\"))\n            .willTriggerActions(\n                sendMessage(\"response1\").onOriginatingChannel(),\n                sendMessage(\"response2\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/multi-action\");\n\n    testClient.sendMessage(url, \"multi\");\n\n    waitAtMost(5, SECONDS).until(() -> testClient.getMessages().contains(\"response1\"));\n    waitAtMost(5, SECONDS).until(() -> testClient.getMessages().contains(\"response2\"));\n    assertThat(testClient.getMessages().size(), is(2));\n  }\n\n  @Test\n  void messageStubMappingCanBeCreatedUsingDsl() {\n    messageStubFor(\n        message()\n            .withName(\"DSL stub\")\n            .withBody(equalTo(\"hello\"))\n            .willTriggerActions(sendMessage(\"world\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/dsl-test\");\n\n    String response = testClient.sendMessageAndWaitForResponse(url, \"hello\");\n    assertThat(response, is(\"world\"));\n  }\n\n  @Test\n  void messageStubMappingDslSupportsMultipleActions() {\n    messageStubFor(\n        message()\n            .onWebsocketChannelFromRequestMatching(newRequestPattern().withUrl(\"/dsl-multi\"))\n            .withName(\"DSL multi-action stub\")\n            .withBody(equalTo(\"trigger\"))\n            .willTriggerActions(\n                sendMessage(\"first\").onOriginatingChannel(),\n                sendMessage(\"second\").onOriginatingChannel()));\n\n    WebsocketTestClient testClient = new WebsocketTestClient();\n    String url = websocketUrl(\"/dsl-multi\");\n\n    testClient.sendMessage(url, \"trigger\");\n\n    waitAtMost(5, SECONDS).until(() -> testClient.getMessages().contains(\"first\"));\n    waitAtMost(5, SECONDS).until(() -> testClient.getMessages().contains(\"second\"));\n    assertThat(testClient.getMessages().size(), is(2));\n  }\n\n  @Test\n  void messageStubMappingDslSupportsBroadcastToMatchingChannels() {\n    messageStubFor(\n        message()\n            .onWebsocketChannelFromRequestMatching(\"/dsl-broadcast\")\n            .withName(\"DSL broadcast stub\")\n            .withBody(equalTo(\"broadcast\"))\n            .willTriggerActions(\n                sendMessage(\"broadcasted\")\n                    .onChannelsMatching(newRequestPattern().withUrl(\"/dsl-broadcast\"))));\n\n    WebsocketTestClient client1 = new WebsocketTestClient();\n    WebsocketTestClient client2 = new WebsocketTestClient();\n    String url = websocketUrl(\"/dsl-broadcast\");\n\n    client1.connect(url);\n    client2.connect(url);\n\n    waitAtMost(5, SECONDS).until(client1::isConnected);\n    waitAtMost(5, SECONDS).until(client2::isConnected);\n\n    client1.sendMessage(\"broadcast\");\n\n    waitAtMost(5, SECONDS).until(() -> client1.getMessages().contains(\"broadcasted\"));\n    waitAtMost(5, SECONDS).until(() -> client2.getMessages().contains(\"broadcasted\"));\n  }\n\n  @Test\n  void canFindMessageStubsByMetadata() {\n    wireMockServer.resetMessageStubMappings();\n\n    messageStubFor(\n        message()\n            .withName(\"Stub with metadata 1\")\n            .withBody(equalTo(\"test1\"))\n            .withMetadata(metadata().attr(\"category\", \"important\").attr(\"version\", \"1\"))\n            .willTriggerActions(sendMessage(\"response1\").onOriginatingChannel()));\n\n    messageStubFor(\n        message()\n            .withName(\"Stub with metadata 2\")\n            .withBody(equalTo(\"test2\"))\n            .withMetadata(metadata().attr(\"category\", \"important\").attr(\"version\", \"2\"))\n            .willTriggerActions(sendMessage(\"response2\").onOriginatingChannel()));\n\n    messageStubFor(\n        message()\n            .withName(\"Stub without matching metadata\")\n            .withBody(equalTo(\"test3\"))\n            .withMetadata(metadata().attr(\"category\", \"unimportant\"))\n            .willTriggerActions(sendMessage(\"response3\").onOriginatingChannel()));\n\n    List<MessageStubMapping> found =\n        findMessageStubsByMetadata(matchingJsonPath(\"$.category\", equalTo(\"important\")));\n\n    assertThat(found, hasSize(2));\n    assertThat(found, hasItem(messageStubMappingWithName(\"Stub with metadata 1\")));\n    assertThat(found, hasItem(messageStubMappingWithName(\"Stub with metadata 2\")));\n  }\n\n  @Test\n  void canRemoveMessageStubsByMetadata() {\n    wireMockServer.resetMessageStubMappings();\n\n    messageStubFor(\n        message()\n            .withName(\"Stub to remove 1\")\n            .withBody(equalTo(\"remove1\"))\n            .withMetadata(metadata().attr(\"toRemove\", true))\n            .willTriggerActions(sendMessage(\"response1\").onOriginatingChannel()));\n\n    messageStubFor(\n        message()\n            .withName(\"Stub to remove 2\")\n            .withBody(equalTo(\"remove2\"))\n            .withMetadata(metadata().attr(\"toRemove\", true))\n            .willTriggerActions(sendMessage(\"response2\").onOriginatingChannel()));\n\n    messageStubFor(\n        message()\n            .withName(\"Stub to keep\")\n            .withBody(equalTo(\"keep\"))\n            .withMetadata(metadata().attr(\"toRemove\", false))\n            .willTriggerActions(sendMessage(\"response3\").onOriginatingChannel()));\n\n    assertThat(listAllMessageStubMappings().getMessageMappings(), hasSize(3));\n\n    removeMessageStubsByMetadata(equalToJson(\"{ \\\"toRemove\\\": true }\"));\n\n    assertThat(listAllMessageStubMappings().getMessageMappings(), hasSize(1));\n    assertThat(\n        listAllMessageStubMappings().getMessageMappings().get(0).getName(), is(\"Stub to keep\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WireMockClientWithProxyAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.Options.DYNAMIC_PORT;\nimport static java.net.Proxy.Type.HTTP;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\nimport org.junit.jupiter.api.AfterAll;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\n\npublic class WireMockClientWithProxyAcceptanceTest {\n\n  private static WireMockServer wireMockServer;\n  private static WireMockTestClient testClient;\n  private static Proxy proxyServer;\n\n  @BeforeAll\n  public static void init() {\n    wireMockServer = new WireMockServer(DYNAMIC_PORT);\n    wireMockServer.start();\n    proxyServer = new Proxy(HTTP, new InetSocketAddress(\"localhost\", wireMockServer.port()));\n\n    testClient = new WireMockTestClient(wireMockServer.port());\n  }\n\n  @AfterAll\n  public static void stopServer() {\n    wireMockServer.stop();\n  }\n\n  @Test\n  void supportsProxyingWithTheStaticClient() {\n    WireMock.configureFor(\n        \"http\",\n        \"localhost\",\n        wireMockServer.port(),\n        ((InetSocketAddress) proxyServer.address()).getHostString(),\n        ((InetSocketAddress) proxyServer.address()).getPort());\n\n    givenThat(get(urlEqualTo(\"/my/new/resource\")).willReturn(aResponse().withStatus(304)));\n\n    assertThat(testClient.get(\"/my/new/resource\").statusCode(), is(304));\n  }\n\n  @Test\n  void supportsProxyingWithTheInstanceClient() {\n    WireMock wireMock =\n        WireMock.create()\n            .scheme(\"http\")\n            .host(\"localhost\")\n            .port(wireMockServer.port())\n            .urlPathPrefix(\"\")\n            .hostHeader(null)\n            .proxyHost(((InetSocketAddress) proxyServer.address()).getHostString())\n            .proxyPort(((InetSocketAddress) proxyServer.address()).getPort())\n            .build();\n\n    wireMock.register(\n        get(urlEqualTo(\"/my/new/resource\"))\n            .willReturn(\n                aResponse().withBody(\"{\\\"address\\\":\\\"Puerto Banús, Málaga\\\"}\").withStatus(200)));\n\n    assertThat(\n        testClient.get(\"/my/new/resource\").content(), is(\"{\\\"address\\\":\\\"Puerto Banús, Málaga\\\"}\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/WireMockServerTests.java",
    "content": "/*\n * Copyright (C) 2013-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.File;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.io.TempDir;\n\npublic class WireMockServerTests {\n\n  @TempDir public File tempDir;\n\n  @Test\n  public void instantiationWithEmptyFileSource() {\n    Options options =\n        new WireMockConfiguration().dynamicPort().fileSource(new SingleRootFileSource(tempDir));\n\n    WireMockServer wireMockServer = null;\n    try {\n      wireMockServer = new WireMockServer(options);\n      wireMockServer.start();\n    } finally {\n      if (wireMockServer != null) {\n        wireMockServer.stop();\n      }\n    }\n  }\n\n  @Test\n  public void returnsOptionsWhenCallingGetOptions() {\n    Options options = new WireMockConfiguration();\n    WireMockServer wireMockServer = new WireMockServer(options);\n    assertThat(wireMockServer.getOptions(), is(options));\n  }\n\n  @Test\n  public void addFilenameTemplateAsOptionAndValidFormat() {\n    Options options =\n        options().dynamicPort().filenameTemplate(\"{{{request.url}}}-{{{request.url}}}.json\");\n    WireMockServer wireMockServer = new WireMockServer(options);\n    wireMockServer.start();\n    assertThat(wireMockServer.getOptions(), is(options));\n  }\n\n  @Test\n  public void buildsQualifiedHttpUrlFromPath() {\n    WireMockServer wireMockServer = new WireMockServer(options().dynamicPort());\n    wireMockServer.start();\n    int port = wireMockServer.port();\n\n    assertThat(\n        wireMockServer.url(\"/something\"), is(String.format(\"http://localhost:%d/something\", port)));\n    assertThat(\n        wireMockServer.url(\"something\"), is(String.format(\"http://localhost:%d/something\", port)));\n  }\n\n  @Test\n  public void buildsQualifiedHttpsUrlFromPath() {\n    WireMockServer wireMockServer = new WireMockServer(options().dynamicPort().dynamicHttpsPort());\n    wireMockServer.start();\n    int port = wireMockServer.httpsPort();\n\n    assertThat(\n        wireMockServer.url(\"/something\"),\n        is(String.format(\"https://localhost:%d/something\", port)));\n    assertThat(\n        wireMockServer.url(\"something\"), is(String.format(\"https://localhost:%d/something\", port)));\n  }\n\n  @Test\n  public void buildsBaseHttpUrl() {\n    WireMockServer wireMockServer = new WireMockServer(options().dynamicPort());\n    wireMockServer.start();\n    int port = wireMockServer.port();\n\n    assertThat(wireMockServer.baseUrl(), is(String.format(\"http://localhost:%d\", port)));\n  }\n\n  @Test\n  public void buildsBaseHttpsUrl() {\n    WireMockServer wireMockServer = new WireMockServer(options().dynamicPort().dynamicHttpsPort());\n    wireMockServer.start();\n    int port = wireMockServer.httpsPort();\n\n    assertThat(wireMockServer.baseUrl(), is(String.format(\"https://localhost:%d\", port)));\n  }\n\n  @Test\n  public void serverCanBeStartedFluently() {\n    WireMockServer wireMockServer = new WireMockServer(options().dynamicPort()).startServer();\n    try {\n      int port = wireMockServer.port();\n      assertThat(wireMockServer.baseUrl(), is(String.format(\"http://localhost:%d\", port)));\n      assertThat(new WireMockTestClient(port).get(\"/\").statusCode(), is(404));\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/XmlHandlingAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2018-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class XmlHandlingAcceptanceTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort().templatingEnabled(true))\n          .build();\n\n  @RegisterExtension\n  public WireMockExtension externalDtdServer =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort().notifier(new ConsoleNotifier(true)))\n          .build();\n\n  WireMockTestClient client;\n\n  @BeforeEach\n  public void init() {\n    client = new WireMockTestClient(wm.getPort());\n\n    externalDtdServer.stubFor(\n        get(\"/dodgy.dtd\")\n            .willReturn(\n                ok(\"<!ELEMENT shiftydata (#PCDATA)>\")\n                    .withHeader(\"Content-Type\", \"application/xml-dtd\")));\n  }\n\n  @Test\n  public void doesNotDownloadExternalDtdDocumentsWhenMatchingOnEqualToXml() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<!DOCTYPE things [\\n\"\n            + \"<!ENTITY % sp SYSTEM \\\"\"\n            + externalDtdServer.url(\"/dodgy.dtd\")\n            + \"\\\">\\n\"\n            + \"%sp;\\n\"\n            + \"]>\\n\"\n            + \"\\n\"\n            + \"<things><shiftydata>123</shiftydata></things>\";\n\n    wm.stubFor(post(\"/xml-match\").withRequestBody(equalToXml(xml)).willReturn(ok()));\n\n    assertThat(client.postXml(\"/xml-match\", xml).statusCode(), is(200));\n\n    externalDtdServer.verify(0, getRequestedFor(anyUrl()));\n  }\n\n  @Test\n  public void doesNotDownloadExternalDtdDocumentsWhenMatchingXPath() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<!DOCTYPE things [\\n\"\n            + \"<!ENTITY % sp SYSTEM \\\"\"\n            + externalDtdServer.url(\"/dodgy.dtd\")\n            + \"\\\">\\n\"\n            + \"%sp;\\n\"\n            + \"]>\\n\"\n            + \"\\n\"\n            + \"<things><shiftydata>123</shiftydata></things>\";\n\n    wm.stubFor(\n        post(\"/xpath-match\").withRequestBody(matchingXPath(\"//shiftydata\")).willReturn(ok()));\n\n    assertThat(client.postXml(\"/xpath-match\", xml).statusCode(), is(200));\n\n    externalDtdServer.verify(0, getRequestedFor(anyUrl()));\n  }\n\n  @Test\n  public void doesNotDownloadExternalDtdDocumentsWhenEvaluatingXPathInTemplate() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<!DOCTYPE things [\\n\"\n            + \"<!ENTITY % sp SYSTEM \\\"\"\n            + externalDtdServer.url(\"/dodgy.dtd\")\n            + \"\\\">\\n\"\n            + \"%sp;\\n\"\n            + \"]>\\n\"\n            + \"\\n\"\n            + \"<things><shiftydata>123</shiftydata></things>\";\n\n    wm.stubFor(\n        post(\"/xpath-template\")\n            .willReturn(\n                ok(\"{{xPath request.body '//shiftydata/text()'}}\")\n                    .withTransformers(ResponseTemplateTransformer.NAME)));\n\n    assertThat(client.postXml(\"/xpath-template\", xml).statusCode(), is(200));\n\n    externalDtdServer.verify(0, getRequestedFor(anyUrl()));\n  }\n\n  @Test\n  public void doesNotAttemptToValidateXmlAgainstDtdWhenMatchingOnEqualToXml() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<!DOCTYPE things [\\n\"\n            + \"<!ENTITY % sp SYSTEM \\\"\"\n            + externalDtdServer.url(\"/dodgy.dtd\")\n            + \"\\\">\\n\"\n            + \"%sp;\\n\"\n            + \"]>\\n\"\n            + \"\\n\"\n            + \"<badly-formed-things/>\";\n\n    wm.stubFor(post(\"/bad-xml-match\").withRequestBody(equalToXml(xml)).willReturn(ok()));\n\n    assertThat(client.postXml(\"/bad-xml-match\", xml).statusCode(), is(200));\n  }\n\n  @Test\n  public void doesNotAttemptToValidateXmlAgainstDtdWhenMatchingOnXPath() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<!DOCTYPE things [\\n\"\n            + \"<!ENTITY % sp SYSTEM \\\"\"\n            + externalDtdServer.url(\"/dodgy.dtd\")\n            + \"\\\">\\n\"\n            + \"%sp;\\n\"\n            + \"]>\\n\"\n            + \"\\n\"\n            + \"<badly-formed-things/>\";\n\n    wm.stubFor(\n        post(\"/bad-xpath-match\")\n            .withRequestBody(matchingXPath(\"/badly-formed-things\"))\n            .willReturn(ok()));\n\n    assertThat(client.postXml(\"/bad-xpath-match\", xml).statusCode(), is(200));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/admin/ConversionsTest.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport static org.assertj.core.api.AssertionsForClassTypes.assertThat;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport java.time.LocalDate;\nimport java.time.Month;\nimport java.time.ZoneId;\nimport java.util.Date;\nimport org.junit.jupiter.api.Test;\nimport org.wiremock.url.Query;\n\nclass ConversionsTest {\n\n  @Test\n  void mapsValidFirstParameterValueAsDate() {\n    // given\n    var query = Query.parse(\"since=2023-10-07T00:00:00Z\");\n    var expected =\n        Date.from(LocalDate.of(2023, Month.OCTOBER, 7).atStartOfDay(ZoneId.of(\"UTC\")).toInstant());\n\n    // when\n    var result = Conversions.toDate(query, \"since\");\n\n    // then\n    assertThat(result).isEqualTo(expected);\n  }\n\n  @Test\n  void throwsExceptionWhenFirstParameterValueIsInvalidDate() {\n    // given\n    var query = Query.parse(\"since=invalid\");\n\n    // when + then\n    assertThrows(InvalidInputException.class, () -> Conversions.toDate(query, \"since\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/admin/LimitAndOffsetPaginatorTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport static java.util.Collections.emptyList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport java.util.Collections;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\nclass LimitAndOffsetPaginatorTest {\n\n  @Test\n  void returnsWholeListWhenBothParametersAreNull() {\n    List<Integer> source = List.of(1, 2, 3, 4, 5);\n    LimitAndOffsetPaginator<Integer> paginator = new LimitAndOffsetPaginator<>(source, null, null);\n\n    List<Integer> result = paginator.select();\n\n    assertThat(result, is(List.of(1, 2, 3, 4, 5)));\n  }\n\n  @Test\n  void returnsEmptyListWhenSourceIsEmpty() {\n    List<Integer> source = emptyList();\n    LimitAndOffsetPaginator<Integer> paginator = new LimitAndOffsetPaginator<>(source, null, null);\n\n    List<Integer> result = paginator.select();\n\n    assertThat(result, is(Collections.emptyList()));\n  }\n\n  @Test\n  void returnsTruncatedListFromStartWhenOnlyLimitIsSpecified() {\n    List<Integer> source = List.of(1, 2, 3, 4, 5);\n    LimitAndOffsetPaginator<Integer> paginator = new LimitAndOffsetPaginator<>(source, 3, null);\n\n    List<Integer> result = paginator.select();\n\n    assertThat(result, is(List.of(1, 2, 3)));\n  }\n\n  @Test\n  void returnsFromOffSetToTheEndWhenOnlyOffsetIsSpecified() {\n    List<Integer> source = List.of(1, 2, 3, 4, 5);\n    LimitAndOffsetPaginator<Integer> paginator = new LimitAndOffsetPaginator<>(source, null, 2);\n\n    List<Integer> result = paginator.select();\n\n    assertThat(result, is(List.of(3, 4, 5)));\n  }\n\n  @Test\n  void returnsRangeWhenBothAreSpecified() {\n    List<Integer> source = List.of(1, 2, 3, 4, 5);\n    LimitAndOffsetPaginator<Integer> paginator = new LimitAndOffsetPaginator<>(source, 3, 1);\n\n    List<Integer> result = paginator.select();\n\n    assertThat(result, is(List.of(2, 3, 4)));\n  }\n\n  @Test\n  void returnsToEndOfListWhenTopBoundIsGreaterThanListSize() {\n    List<Integer> source = List.of(1, 2, 3, 4, 5);\n    LimitAndOffsetPaginator<Integer> paginator = new LimitAndOffsetPaginator<>(source, 7, 3);\n\n    List<Integer> result = paginator.select();\n\n    assertThat(result, is(List.of(4, 5)));\n  }\n\n  @Test\n  void rejectsNegativeLimit() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> new LimitAndOffsetPaginator<>(Collections.emptyList(), -1, 3));\n  }\n\n  @Test\n  void rejectsNegativeOffset() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> new LimitAndOffsetPaginator<>(Collections.emptyList(), 0, -10));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/admin/SaveMappingsTaskTest.java",
    "content": "/*\n * Copyright (C) 2013-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.mockito.Mockito.verify;\n\nimport com.github.tomakehurst.wiremock.admin.tasks.SaveMappingsTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.net.HttpURLConnection;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.Mockito;\n\nclass SaveMappingsTaskTest {\n\n  private Admin mockAdmin = Mockito.mock(Admin.class);\n  private Request mockRequest = mockRequest();\n\n  private SaveMappingsTask saveMappingsTask = new SaveMappingsTask();\n\n  @Test\n  void delegatesSavingMappingsToAdmin() {\n    saveMappingsTask.execute(mockAdmin, ServeEvent.of(mockRequest), PathParams.empty());\n\n    verify(mockAdmin).saveMappings();\n  }\n\n  @Test\n  void returnsOkResponse() {\n    ResponseDefinition response =\n        saveMappingsTask.execute(mockAdmin, ServeEvent.of(mockRequest), PathParams.empty());\n\n    assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));\n    verify(mockAdmin).saveMappings();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/admin/model/QueryParamsTest.java",
    "content": "/*\n * Copyright (C) 2013-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.singletonList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.url.QueryParams;\nimport org.junit.jupiter.api.Test;\n\nclass QueryParamsTest {\n\n  @Test\n  void returnsEmptyStringWhenNoParametersPresent() {\n    assertThat(QueryParams.EMPTY.toString(), is(\"\"));\n  }\n\n  @Test\n  void correctlyRendersASingleQueryParamWithSingleValueAsString() {\n    assertThat(QueryParams.single(\"param\", \"123\").toString(), is(\"?param=123\"));\n  }\n\n  @Test\n  void correctlyRendersASingleQueryParamWithMultipleValuesAsString() {\n    assertThat(\n        QueryParams.single(\"param\", \"123\", \"blah\", \"456\").toString(),\n        is(\"?param=123&param=blah&param=456\"));\n  }\n\n  @Test\n  void correctlyRendersMultipleQueryParamsWithMixedSingleAndMultipleValuesAsString() {\n    QueryParams queryParams = new QueryParams();\n    queryParams.put(\"one\", singletonList(\"1\"));\n    queryParams.put(\"two\", asList(\"2\", \"three\"));\n    assertThat(queryParams.toString(), is(\"?one=1&two=2&two=three\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/admin/tasks/HealthCheckTaskTest.java",
    "content": "/*\n * Copyright (C) 2023-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.net.HttpURLConnection;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.Mockito;\n\nclass HealthCheckTaskTest {\n\n  private final Admin mockAdmin = Mockito.mock(Admin.class);\n  private final Request mockRequest = mockRequest();\n  private final HealthCheckTask healthCheckTask = new HealthCheckTask();\n\n  @Test\n  void healthy() {\n    ResponseDefinition response =\n        healthCheckTask.execute(mockAdmin, ServeEvent.of(mockRequest), PathParams.empty());\n\n    assertThat(response.getStatus(), is(HttpURLConnection.HTTP_OK));\n    assertThat(response.getStatusMessage(), is(\"Wiremock is ok\"));\n    assertThat(\n        response.getStatusMessage(),\n        equalTo(response.getReponseBody().asJson().get(\"message\").asText()));\n    assertThat(response.getReponseBody().asJson().get(\"status\").asText(), is(\"healthy\"));\n    assertThat(response.getReponseBody().asJson().get(\"version\").asText(), is(\"X.X.X\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveMatchingStubMappingTaskTest.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.created;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.post;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.Mockito;\n\nclass RemoveMatchingStubMappingTaskTest {\n\n  private final Admin mockAdmin = Mockito.mock(Admin.class);\n\n  private final AdminTask task = new RemoveMatchingStubMappingTask();\n\n  @Test\n  void removesMultipleMappingsInASingleRequest() {\n    List<StubMapping> stubMappings =\n        List.of(get(\"/\").willReturn(ok()).build(), post(\"/create\").willReturn(created()).build());\n\n    task.execute(\n        mockAdmin,\n        ServeEvent.of(mockRequest().body(Json.write(Map.of(\"mappings\", stubMappings)))),\n        PathParams.empty());\n\n    verify(mockAdmin).removeStubMappings(stubMappings);\n    verifyNoMoreInteractions(mockAdmin);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveUnmatchedStubMappingsTaskTest.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.created;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.post;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult;\nimport com.github.tomakehurst.wiremock.admin.model.PaginatedResult;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.Mockito;\n\nclass RemoveUnmatchedStubMappingsTaskTest {\n\n  private final Admin mockAdmin = Mockito.mock(Admin.class);\n\n  private final AdminTask task = new RemoveUnmatchedStubMappingsTask();\n\n  @Test\n  void removesMappingsInASingleRequest() {\n    List<StubMapping> stubMappings =\n        List.of(get(\"/\").willReturn(ok()).build(), post(\"/create\").willReturn(created()).build());\n    when(mockAdmin.findUnmatchedStubs())\n        .thenReturn(\n            new ListStubMappingsResult(\n                stubMappings, new PaginatedResult.Meta(stubMappings.size())));\n\n    task.execute(mockAdmin, ServeEvent.of(mockRequest()), PathParams.empty());\n\n    verify(mockAdmin).findUnmatchedStubs();\n    verify(mockAdmin).removeStubMappings(stubMappings);\n    verifyNoMoreInteractions(mockAdmin);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/archunit/GeneralCodingRulesTest.java",
    "content": "/*\n * Copyright (C) 2021-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.archunit;\n\nimport static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;\nimport static com.tngtech.archunit.library.GeneralCodingRules.ACCESS_STANDARD_STREAMS;\nimport static com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_THROW_GENERIC_EXCEPTIONS;\nimport static com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_USE_JAVA_UTIL_LOGGING;\nimport static com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_USE_JODATIME;\nimport static com.tngtech.archunit.library.freeze.FreezingArchRule.freeze;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.standalone.WireMockServerRunner;\nimport com.tngtech.archunit.core.importer.ImportOption;\nimport com.tngtech.archunit.junit.AnalyzeClasses;\nimport com.tngtech.archunit.junit.ArchTest;\nimport com.tngtech.archunit.lang.ArchRule;\n\n@AnalyzeClasses(\n    packagesOf = WireMockServer.class,\n    importOptions = {\n      ImportOption.DoNotIncludeArchives.class,\n      ImportOption.DoNotIncludeJars.class,\n      ImportOption.DoNotIncludeTests.class\n    })\nclass GeneralCodingRulesTest {\n\n  @ArchTest\n  static ArchRule RULE_NO_CLASSES_SHOULD_ACCESS_STANDARD_STREAMS =\n      freeze(\n          noClasses()\n              .that()\n              .areNotAssignableTo(ConsoleNotifier.class)\n              .and()\n              .areNotAssignableTo(WireMockServerRunner.class)\n              .should(ACCESS_STANDARD_STREAMS)\n              .as(\"classes should not access standard streams\"));\n\n  @ArchTest\n  static ArchRule RULE_NO_CLASSES_SHOULD_THROW_GENERIC_EXCEPTIONS =\n      freeze(NO_CLASSES_SHOULD_THROW_GENERIC_EXCEPTIONS);\n\n  @ArchTest\n  static ArchRule RULE_NO_CLASSES_SHOULD_USE_JAVA_UTIL_LOGGING =\n      NO_CLASSES_SHOULD_USE_JAVA_UTIL_LOGGING;\n\n  @ArchTest static ArchRule RULE_NO_CLASSES_SHOULD_USE_JODATIME = NO_CLASSES_SHOULD_USE_JODATIME;\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/archunit/HttpClientTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.archunit;\n\nimport static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.client.HttpAdminClient;\nimport com.tngtech.archunit.core.importer.ImportOption;\nimport com.tngtech.archunit.junit.AnalyzeClasses;\nimport com.tngtech.archunit.junit.ArchTest;\nimport com.tngtech.archunit.lang.ArchRule;\n\n@AnalyzeClasses(\n    packagesOf = WireMockServer.class,\n    importOptions = {\n      ImportOption.DoNotIncludeArchives.class,\n      ImportOption.DoNotIncludeJars.class,\n      ImportOption.DoNotIncludeTests.class\n    })\nclass HttpClientTest {\n\n  @ArchTest\n  static ArchRule httpClientShouldNotLeak =\n      noClasses()\n          .that()\n          .resideOutsideOfPackage(\"..http..\")\n          .and()\n          .areNotAssignableTo(HttpAdminClient.class)\n          .should()\n          .dependOnClassesThat()\n          .resideInAPackage(\"org.apache.hc..\")\n          .as(\"Apache HttpClient should be limited to http package\")\n          .because(\"we want to make the third party dependency optional\");\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/archunit/README.md",
    "content": "Architecture Rules enforced by ArchUnit\n=======================================\n\n[ArchUnit](https://archunit.org) is used to enforce a variety of Architecture Rules, guiding the project towards\ngradual conformance.\n\nExamples of enforced rules are:\n - the gradual adoption of JUnit Jupiter\n - preventing unused classes and methods\n\nMore rules are to come as we refine our goal architecture.\nSee the individual test classes for further details.\n\nIn rare circumstances a ArchRule might result in a detected false positive or tolerated violation.\nIn those cases we've defined a\n[violation store](https://www.archunit.org/userguide/html/000_Index.html#_freezing_arch_rules)\nthat can be updated to reflect the accepted violation.\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/client/ClientAuthenticationAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.AUTHORIZATION;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static java.util.Collections.singletonList;\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.assertDoesNotThrow;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.security.*;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\nclass ClientAuthenticationAcceptanceTest {\n\n  private WireMockServer server;\n  private WireMock goodClient;\n  private WireMock badClient;\n\n  @AfterEach\n  public void stopServer() {\n    server.stop();\n  }\n\n  @Test\n  void supportsCustomAuthenticator() {\n    initialise(\n        request -> request.containsHeader(\"X-Magic-Header\"),\n        () -> singletonList(httpHeader(\"X-Magic-Header\", \"blah\")));\n\n    WireMockTestClient noAuthClient = new WireMockTestClient(server.port());\n\n    assertThat(noAuthClient.get(\"/__admin/mappings\").statusCode(), is(401));\n    assertThat(\n        noAuthClient\n            .get(\"/__admin/mappings\", withHeader(\"X-Magic-Header\", \"anything\"))\n            .statusCode(),\n        is(200));\n\n    goodClient.getServeEvents(); // Throws an exception on a non 2xx response\n  }\n\n  @Test\n  void supportsBasicAuthenticator() {\n    initialise(\n        new BasicAuthenticator(\n            new BasicCredentials(\"user1\", \"password1\"), new BasicCredentials(\"user2\", \"password2\")),\n        new ClientBasicAuthenticator(\"user1\", \"password1\"));\n\n    assertDoesNotThrow(() -> goodClient.getServeEvents());\n  }\n\n  @Test\n  void throwsNotAuthorisedExceptionWhenWrongBasicCredentialsProvided() {\n    initialise(\n        new BasicAuthenticator(\n            new BasicCredentials(\"user1\", \"password1\"), new BasicCredentials(\"user2\", \"password2\")),\n        new ClientBasicAuthenticator(\"user1\", \"password1\"));\n\n    badClient =\n        WireMock.create()\n            .port(server.port())\n            .authenticator(new ClientBasicAuthenticator(\"user1\", \"wrong_password\"))\n            .build();\n\n    assertThrows(NotAuthorisedException.class, () -> badClient.getServeEvents());\n  }\n\n  @Test\n  void supportsBasicAuthenticatorViaStaticDsl() {\n    initialise(\n        new BasicAuthenticator(\n            new BasicCredentials(\"user1\", \"password1\"), new BasicCredentials(\"user2\", \"password2\")),\n        new ClientBasicAuthenticator(\"user2\", \"password2\"));\n    WireMockTestClient client = new WireMockTestClient(server.port());\n\n    WireMock.configureFor(goodClient);\n\n    WireMock.getAllServeEvents(); // Expect no exception thrown\n    assertThat(client.get(\"/__admin/requests\").statusCode(), is(401));\n  }\n\n  @Test\n  void supportsShorthandBasicAuthWithHttps() {\n    server =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .dynamicHttpsPort()\n                .basicAdminAuthenticator(\"user\", \"password\"));\n    server.start();\n\n    goodClient =\n        WireMock.create()\n            .port(server.httpsPort())\n            .https()\n            .basicAuthenticator(\"user\", \"password\")\n            .build();\n\n    assertDoesNotThrow(() -> goodClient.getServeEvents());\n  }\n\n  @Test\n  void canRequireHttpsOnAdminApi() {\n    server =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .dynamicHttpsPort()\n                .basicAdminAuthenticator(\"user\", \"password\")\n                .requireHttpsForAdminApi());\n    server.start();\n    WireMockTestClient client = new WireMockTestClient(server.port());\n\n    String authHeader = new BasicCredentials(\"user\", \"password\").asAuthorizationHeaderValue();\n    WireMockResponse response =\n        client.get(\"/__admin/requests\", withHeader(AUTHORIZATION, authHeader));\n\n    assertThat(response.statusCode(), is(403));\n    assertThat(response.content(), containsString(\"HTTPS is required for accessing the admin API\"));\n  }\n\n  @Test\n  void supportsTokenAuthenticatorViaStaticDsl() {\n    final String TOKEN = \"my_token_123\";\n\n    initialise(new TokenAuthenticator(TOKEN), new ClientTokenAuthenticator(TOKEN));\n    WireMockTestClient client = new WireMockTestClient(server.port());\n\n    WireMock.configureFor(goodClient);\n\n    WireMock.getAllServeEvents(); // Expect no exception thrown\n    assertThat(client.get(\"/__admin/requests\").statusCode(), is(401));\n  }\n\n  private void initialise(\n      Authenticator adminAuthenticator, ClientAuthenticator clientAuthenticator) {\n    server =\n        new WireMockServer(wireMockConfig().dynamicPort().adminAuthenticator(adminAuthenticator));\n    server.start();\n\n    goodClient = WireMock.create().port(server.port()).authenticator(clientAuthenticator).build();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/client/CountMatchingStrategyTest.java",
    "content": "/*\n * Copyright (C) 2015-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport org.junit.jupiter.api.Test;\n\nclass CountMatchingStrategyTest {\n\n  @Test\n  void shouldMatchLessThanCorrectly() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.LESS_THAN, 5);\n\n    assertThat(countStrategy.match(3), is(true));\n    assertThat(countStrategy.match(5), is(false));\n    assertThat(countStrategy.match(7), is(false));\n  }\n\n  @Test\n  void shouldMatchLessThanOrEqualCorrectly() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.LESS_THAN_OR_EQUAL, 5);\n\n    assertThat(countStrategy.match(3), is(true));\n    assertThat(countStrategy.match(5), is(true));\n    assertThat(countStrategy.match(7), is(false));\n  }\n\n  @Test\n  void shouldMatchEqualToCorrectly() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.EQUAL_TO, 5);\n\n    assertThat(countStrategy.match(3), is(false));\n    assertThat(countStrategy.match(5), is(true));\n    assertThat(countStrategy.match(7), is(false));\n  }\n\n  @Test\n  void shouldMatchGreaterThanOrEqualCorrectly() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.GREATER_THAN_OR_EQUAL, 5);\n\n    assertThat(countStrategy.match(3), is(false));\n    assertThat(countStrategy.match(5), is(true));\n    assertThat(countStrategy.match(7), is(true));\n  }\n\n  @Test\n  void shouldMatchGreaterThanCorrectly() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.GREATER_THAN, 5);\n\n    assertThat(countStrategy.match(3), is(false));\n    assertThat(countStrategy.match(5), is(false));\n    assertThat(countStrategy.match(7), is(true));\n  }\n\n  @Test\n  void shouldCorrectlyObtainFriendlyNameForLessThanMode() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.LESS_THAN, 5);\n    assertThat(countStrategy.toString(), is(\"Less than 5\"));\n  }\n\n  @Test\n  void shouldCorrectlyObtainFriendlyNameForLessThanOrEqualMode() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.LESS_THAN_OR_EQUAL, 5);\n    assertThat(countStrategy.toString(), is(\"Less than or exactly 5\"));\n  }\n\n  @Test\n  void shouldCorrectlyObtainFriendlyNameForEqualMode() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.EQUAL_TO, 5);\n    assertThat(countStrategy.toString(), is(\"Exactly 5\"));\n  }\n\n  @Test\n  void shouldCorrectlyObtainFriendlyNameForGreaterThanOrEqualMode() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.GREATER_THAN_OR_EQUAL, 5);\n    assertThat(countStrategy.toString(), is(\"More than or exactly 5\"));\n  }\n\n  @Test\n  void shouldCorrectlyObtainFriendlyNameForGreaterThanMode() {\n    CountMatchingStrategy countStrategy =\n        new CountMatchingStrategy(CountMatchingStrategy.GREATER_THAN, 5);\n    assertThat(countStrategy.toString(), is(\"More than 5\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/client/HttpAdminClientTest.java",
    "content": "/*\n * Copyright (C) 2012-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.apache.hc.core5.http.HttpHeaders.HOST;\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.admin.model.GetScenariosResult;\nimport com.github.tomakehurst.wiremock.admin.model.ListMessageStubMappingsResult;\nimport com.github.tomakehurst.wiremock.common.ClientError;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.message.SendMessageAction;\nimport com.github.tomakehurst.wiremock.security.ClientAuthenticator;\nimport com.github.tomakehurst.wiremock.security.ClientTokenAuthenticator;\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport com.sun.net.httpserver.HttpServer;\nimport java.io.IOException;\nimport java.net.InetSocketAddress;\nimport java.time.Duration;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Optional;\nimport org.apache.hc.core5.http.HttpHeaders;\nimport org.apache.hc.core5.http.HttpStatus;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.Mockito;\n\nclass HttpAdminClientTest {\n  private static final String ADMIN_TEST_PREFIX = \"/admin-test\";\n\n  @Test\n  void returnsOptionsWhenCallingGetOptions() {\n    var client = buildHttpAdminClient(8080, \"\");\n    assertThat(client.getOptions().portNumber()).isEqualTo(8080);\n    assertThat(client.getOptions().bindAddress()).isEqualTo(\"localhost\");\n  }\n\n  @Test\n  void shouldSendEmptyRequestForResetToDefaultMappings() {\n    var server = new WireMockServer(options().dynamicPort());\n    server.start();\n    server.stubFor(\n        post(urlPathEqualTo(ADMIN_TEST_PREFIX + \"/__admin/mappings/reset\"))\n            .withHeader(HttpHeaders.CONTENT_LENGTH, equalTo(\"0\"))\n            .willReturn(ok()));\n    var client = buildHttpAdminClient(server);\n\n    client.resetToDefaultMappings();\n  }\n\n  @Test\n  void shouldSendEmptyRequestForResetAll() {\n    var server = new WireMockServer(options().dynamicPort()).startServer();\n\n    server.stubFor(\n        post(urlPathEqualTo(ADMIN_TEST_PREFIX + \"/__admin/reset\"))\n            .withHeader(HttpHeaders.CONTENT_LENGTH, equalTo(\"0\"))\n            .willReturn(ok()));\n    var client = buildHttpAdminClient(server);\n\n    client.resetAll();\n  }\n\n  @Test\n  void shouldBeAbleToContactWiremockIfPortIsNotSpecified() throws IOException {\n\n    HttpClient httpClient = mock(HttpClient.class);\n    ClientAuthenticator authenticator = mock(ClientAuthenticator.class);\n    when(authenticator.generateAuthHeaders()).thenReturn(Collections.emptyList());\n    ArgumentCaptor<Request> httpRequestSentCaptor = ArgumentCaptor.forClass(Request.class);\n    var scheme = \"https\";\n    var domain = \"my.domain.name\";\n    var client = new HttpAdminClient(scheme, domain, -1, \"\", \"\", authenticator, httpClient);\n\n    try {\n      client.getAllScenarios();\n    } catch (Exception e) {\n      // ignore\n    }\n    Mockito.verify(httpClient).execute(httpRequestSentCaptor.capture());\n    Request value = httpRequestSentCaptor.getValue();\n    assertThat(value.getAbsoluteUrl()).isEqualTo(scheme + \"://\" + domain + \"/__admin/scenarios\");\n  }\n\n  @Test\n  void shouldInjectCorrectHeaders() throws IOException {\n\n    HttpClient httpClient = mock(HttpClient.class);\n    ClientAuthenticator authenticator = new ClientTokenAuthenticator(\"my_token\");\n    ArgumentCaptor<Request> httpRequestSentCaptor = ArgumentCaptor.forClass(Request.class);\n    var scheme = \"https\";\n    var domain = \"my.domain.name\";\n    var client =\n        new HttpAdminClient(scheme, domain, -1, \"\", \"other.example.com\", authenticator, httpClient);\n\n    try {\n      client.getAllScenarios();\n    } catch (Exception e) {\n      // ignore\n    }\n    Mockito.verify(httpClient).execute(httpRequestSentCaptor.capture());\n    Request value = httpRequestSentCaptor.getValue();\n    assertThat(value.getHeader(HOST)).isEqualTo(\"other.example.com\");\n    assertThat(value.getHeader(HttpHeaders.AUTHORIZATION)).isEqualTo(\"Token my_token\");\n  }\n\n  @Test\n  void shouldNotSendEntityForGetAllScenarios() {\n    var server = new WireMockServer(options().dynamicPort()).startServer();\n\n    var expectedResponse = new GetScenariosResult(List.of(Scenario.inStartedState(\"scn1\")));\n    server.stubFor(\n        get(urlPathEqualTo(ADMIN_TEST_PREFIX + \"/__admin/scenarios\"))\n            .withHeader(HttpHeaders.CONTENT_LENGTH, absent())\n            .willReturn(jsonResponse(expectedResponse, HttpStatus.SC_OK)));\n    var client = buildHttpAdminClient(server);\n\n    assertThat(client.getAllScenarios()).usingRecursiveComparison().isEqualTo(expectedResponse);\n  }\n\n  @Test\n  void reuseConnections() throws InterruptedException, IOException {\n    var server = new SingleConnectionServer();\n    server.start();\n    var client = buildHttpAdminClient(server.getPort(), ADMIN_TEST_PREFIX);\n\n    client.resetAll();\n    client.resetAll();\n    server.stop();\n  }\n\n  @Test\n  void shouldThrowExceptionWithUrlForStubMappingFromNonWireMockServerPort() throws IOException {\n    var nonWireMockServer = HttpServer.create(new InetSocketAddress(0), 0);\n    nonWireMockServer.start();\n    var serverPort = nonWireMockServer.getAddress().getPort();\n    var client = buildHttpAdminClient(serverPort, ADMIN_TEST_PREFIX);\n    var mapping = post(urlPathMatching(\"/test\")).willReturn(ok()).build();\n    var thrown = assertThrows(InvalidInputException.class, () -> client.addStubMapping(mapping));\n    assertThat(thrown.getErrors().getErrors()).hasSize(1);\n    var thrownError = thrown.getErrors().first();\n    assertThat(thrownError.getCode()).isEqualTo(10);\n    assertThat(thrownError.getTitle()).isEqualTo(\"Error parsing JSON\");\n    assertThat(thrownError.getDetail())\n        .matches(\n            \"Error parsing response body '(.|\\n)*' with status code 404 for http://localhost:\"\n                + serverPort\n                + \"/admin-test/__admin/mappings. Error: (.|\\n)*\");\n\n    nonWireMockServer.stop(0);\n  }\n\n  @Test\n  void shouldParseErrorsLeniently() {\n    var clientError =\n        HttpAdminClient.parseClientError(\n            \"https://example.com\",\n            \"\"\"\n            {\n              \"errors\": [\n                {\n                  \"title\": \"Conflict\",\n                  \"source\": {}\n                }\n              ]\n            }\n            \"\"\",\n            409);\n\n    assertThat(clientError)\n        .isEqualTo(\n            ClientError.fromErrors(\n                new Errors(\n                    List.of(\n                        new Errors.Error(null, new Errors.Error.Source(null), \"Conflict\", null)))));\n  }\n\n  @Test\n  void shouldListAllMessageStubMappings() {\n    var server = new WireMockServer(options().dynamicPort()).startServer();\n\n    try {\n      MessageStubMapping stub1 =\n          MessageStubMapping.builder()\n              .withName(\"Test stub 1\")\n              .withBody(equalTo(\"test1\"))\n              .triggersAction(SendMessageAction.toOriginatingChannel(\"response1\"))\n              .build();\n      MessageStubMapping stub2 =\n          MessageStubMapping.builder()\n              .withName(\"Test stub 2\")\n              .withBody(equalTo(\"test2\"))\n              .triggersAction(SendMessageAction.toOriginatingChannel(\"response2\"))\n              .build();\n\n      server.addMessageStubMapping(stub1);\n      server.addMessageStubMapping(stub2);\n\n      var client = WireMock.create().port(server.port()).buildAdminClient();\n      ListMessageStubMappingsResult result = client.listAllMessageStubMappings();\n\n      assertThat(result.getMessageMappings()).hasSize(2);\n      assertThat(result.getMessageMappings())\n          .extracting(MessageStubMapping::getName)\n          .containsExactlyInAnyOrder(\"Test stub 1\", \"Test stub 2\");\n    } finally {\n      server.stop();\n    }\n  }\n\n  @Test\n  void shouldReturnEmptyListWhenNoMessageStubMappings() {\n    var server = new WireMockServer(options().dynamicPort()).startServer();\n\n    try {\n      var client = WireMock.create().port(server.port()).buildAdminClient();\n      ListMessageStubMappingsResult result = client.listAllMessageStubMappings();\n\n      assertThat(result.getMessageMappings()).isEmpty();\n    } finally {\n      server.stop();\n    }\n  }\n\n  @Test\n  void shouldWaitForMessageEventAndReturnEmptyWhenTimeout() {\n    var server = new WireMockServer(options().dynamicPort()).startServer();\n\n    try {\n      var client = WireMock.create().port(server.port()).buildAdminClient();\n      Optional<MessageServeEvent> result =\n          client.waitForMessageEvent(MessagePattern.ANYTHING, Duration.ofMillis(100));\n\n      assertThat(result).isEmpty();\n    } finally {\n      server.stop();\n    }\n  }\n\n  private static HttpAdminClient buildHttpAdminClient(WireMockServer server) {\n    return buildHttpAdminClient(server.port(), ADMIN_TEST_PREFIX);\n  }\n\n  private static HttpAdminClient buildHttpAdminClient(int port, String urlPathPrefix) {\n    return WireMock.create().port(port).urlPathPrefix(urlPathPrefix).buildAdminClient();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/client/ResponseDefinitionBuilderTest.java",
    "content": "/*\n * Copyright (C) 2012-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_ENCODING;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.empty;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.nullValue;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.http.Fault;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Base64;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.wiremock.url.Path;\n\nclass ResponseDefinitionBuilderTest {\n\n  @Test\n  void withTransformerParameterShouldNotChangeOriginalTransformerParametersValue() {\n    ResponseDefinition originalResponseDefinition =\n        ResponseDefinitionBuilder.responseDefinition()\n            .withTransformerParameter(\"name\", \"original\")\n            .build();\n\n    ResponseDefinition transformedResponseDefinition =\n        ResponseDefinitionBuilder.like(originalResponseDefinition)\n            .but()\n            .withTransformerParameter(\"name\", \"changed\")\n            .build();\n\n    assertThat(\n        originalResponseDefinition.getTransformerParameters().getString(\"name\"), is(\"original\"));\n    assertThat(\n        transformedResponseDefinition.getTransformerParameters().getString(\"name\"), is(\"changed\"));\n  }\n\n  @Test\n  void likeShouldCreateCompleteResponseDefinitionCopy() {\n    ResponseDefinition originalResponseDefinition =\n        ResponseDefinitionBuilder.responseDefinition()\n            .withStatus(200)\n            .withStatusMessage(\"OK\")\n            .withBody(\"some body\")\n            .withBase64Body(\n                Base64.getEncoder().encodeToString(\"some body\".getBytes(StandardCharsets.UTF_8)))\n            .withBodyFile(\"some_body.json\")\n            .withHeader(\"some header\", \"some value\")\n            .withFixedDelay(100)\n            .withUniformRandomDelay(1, 2)\n            .withChunkedDribbleDelay(1, 1000)\n            .withFault(Fault.EMPTY_RESPONSE)\n            .withTransformers(\"some transformer\")\n            .withTransformerParameter(\"some param\", \"some value\")\n            .build();\n\n    ResponseDefinition copiedResponseDefinition =\n        ResponseDefinitionBuilder.like(originalResponseDefinition).build();\n\n    assertThat(copiedResponseDefinition, is(originalResponseDefinition));\n  }\n\n  @Test\n  void proxyResponseDefinitionWithoutProxyInformationIsNotInResponseDefinition() {\n    ResponseDefinition proxyDefinition =\n        ResponseDefinitionBuilder.responseDefinition().proxiedFrom(\"http://my.domain\").build();\n\n    assertThat(proxyDefinition.getAdditionalProxyRequestHeaders().all(), empty());\n    assertThat(proxyDefinition.getRemoveProxyRequestHeaders(), empty());\n    assertThat(proxyDefinition.getProxyUrlPrefixToRemove(), nullValue());\n  }\n\n  @Test\n  void proxyResponseDefinitionWithoutProxyInformationIsNotInResponseDefinitionWithJsonBody() {\n    ResponseDefinition proxyDefinition =\n        ResponseDefinitionBuilder.responseDefinition()\n            .proxiedFrom(\"http://my.domain\")\n            .withJsonBody(Json.read(\"{}\", JsonNode.class))\n            .build();\n\n    assertThat(proxyDefinition.getAdditionalProxyRequestHeaders().all(), empty());\n    assertThat(proxyDefinition.getRemoveProxyRequestHeaders(), empty());\n    assertThat(proxyDefinition.getProxyUrlPrefixToRemove(), nullValue());\n  }\n\n  @Test\n  void proxyResponseDefinitionWithoutProxyInformationIsNotInResponseDefinitionWithBinaryBody() {\n    ResponseDefinition proxyDefinition =\n        ResponseDefinitionBuilder.responseDefinition()\n            .proxiedFrom(\"http://my.domain\")\n            .withBody(new byte[] {0x01})\n            .build();\n\n    assertThat(proxyDefinition.getAdditionalProxyRequestHeaders().all(), empty());\n    assertThat(proxyDefinition.getRemoveProxyRequestHeaders(), empty());\n    assertThat(proxyDefinition.getProxyUrlPrefixToRemove(), nullValue());\n  }\n\n  @Test\n  void proxyResponseDefinitionWithExtraInformationIsInResponseDefinition() {\n    ResponseDefinition proxyDefinition =\n        ResponseDefinitionBuilder.responseDefinition()\n            .proxiedFrom(\"http://my.domain\")\n            .withAdditionalRequestHeader(\"header\", \"value\")\n            .withRemoveRequestHeader(\"header\")\n            .withProxyUrlPrefixToRemove(\"/remove\")\n            .build();\n\n    assertThat(\n        proxyDefinition.getAdditionalProxyRequestHeaders(),\n        equalTo(new HttpHeaders(List.of(new HttpHeader(\"header\", \"value\")))));\n    assertThat(proxyDefinition.getRemoveProxyRequestHeaders(), equalTo(List.of(\"header\")));\n    assertThat(proxyDefinition.getProxyUrlPrefixToRemove(), equalTo(Path.parse(\"/remove\")));\n  }\n\n  @Test\n  void proxyResponseDefinitionWithExtraInformationIsInResponseDefinitionWithJsonBody() {\n    ResponseDefinition proxyDefinition =\n        ResponseDefinitionBuilder.responseDefinition()\n            .proxiedFrom(\"http://my.domain\")\n            .withAdditionalRequestHeader(\"header\", \"value\")\n            .withRemoveRequestHeader(\"header\")\n            .withProxyUrlPrefixToRemove(\"/remove\")\n            .withJsonBody(Json.read(\"{}\", JsonNode.class))\n            .build();\n\n    assertThat(\n        proxyDefinition.getAdditionalProxyRequestHeaders(),\n        equalTo(new HttpHeaders(List.of(new HttpHeader(\"header\", \"value\")))));\n    assertThat(proxyDefinition.getRemoveProxyRequestHeaders(), equalTo(List.of(\"header\")));\n    assertThat(proxyDefinition.getProxyUrlPrefixToRemove(), equalTo(Path.parse(\"/remove\")));\n  }\n\n  @Test\n  void proxyResponseDefinitionWithExtraInformationIsInResponseDefinitionWithBinaryBody() {\n    ResponseDefinition proxyDefinition =\n        ResponseDefinitionBuilder.responseDefinition()\n            .proxiedFrom(\"http://my.domain\")\n            .withAdditionalRequestHeader(\"header\", \"value\")\n            .withRemoveRequestHeader(\"header\")\n            .withProxyUrlPrefixToRemove(\"/remove\")\n            .withBody(new byte[] {0x01})\n            .build();\n\n    assertThat(\n        proxyDefinition.getAdditionalProxyRequestHeaders(),\n        equalTo(new HttpHeaders(List.of(new HttpHeader(\"header\", \"value\")))));\n    assertThat(proxyDefinition.getRemoveProxyRequestHeaders(), equalTo(List.of(\"header\")));\n    assertThat(proxyDefinition.getProxyUrlPrefixToRemove(), equalTo(Path.parse(\"/remove\")));\n  }\n\n  @Test\n  void responseDefinitionBuilderWithGzipDisabled() {\n    ResponseDefinition responseDefinition =\n        ResponseDefinitionBuilder.responseDefinition().withGzipDisabled(true).build();\n\n    assertNotNull(responseDefinition);\n    assertEquals(\n        \"none\", responseDefinition.getHeaders().getHeader(CONTENT_ENCODING).getValues().get(0));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/client/SingleConnectionServer.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.net.ServerSocket;\nimport java.net.Socket;\nimport java.net.SocketTimeoutException;\nimport java.nio.charset.StandardCharsets;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class SingleConnectionServer {\n\n  private static final Logger LOG = LoggerFactory.getLogger(SingleConnectionServer.class);\n\n  private final Thread thread;\n  private final ServerSocket serverSocket;\n\n  public SingleConnectionServer() throws IOException {\n    this.serverSocket = new ServerSocket(0);\n    this.thread =\n        new Thread(\n            () -> {\n              Socket socket = null;\n              try {\n                socket = serverSocket.accept();\n                socket.setSoTimeout(500);\n                handleClientConnection(socket);\n                serverSocket.close();\n              } catch (IOException e) {\n                throw new RuntimeException(e);\n              } finally {\n                try {\n                  serverSocket.close();\n                  if (socket != null) {\n                    socket.close();\n                  }\n                } catch (IOException e) {\n                  LOG.error(\"Error closing socket\", e);\n                }\n              }\n            });\n  }\n\n  public void start() {\n    thread.start();\n  }\n\n  public void stop() throws InterruptedException {\n    thread.interrupt();\n    thread.join();\n  }\n\n  public int getPort() {\n    return serverSocket.getLocalPort();\n  }\n\n  private void handleClientConnection(Socket clientSocket) throws IOException {\n    BufferedReader reader =\n        new BufferedReader(\n            new InputStreamReader(clientSocket.getInputStream(), StandardCharsets.UTF_8));\n    PrintWriter writer = new PrintWriter(clientSocket.getOutputStream(), true);\n\n    String requestLine;\n    try {\n      while ((requestLine = reader.readLine()) != null && !Thread.currentThread().isInterrupted()) {\n        if (requestLine.startsWith(\"POST /admin-test/__admin/reset\")) {\n          String line;\n          while (!(line = reader.readLine()).isBlank()) {\n            // Discard headers\n          }\n\n          // Send the response with status 200 OK\n          String response = \"HTTP/1.1 200 OK\\r\\nContent-Length: 0\\r\\n\\r\\n\";\n          writer.println(response);\n        }\n      }\n    } catch (SocketTimeoutException e) {\n      // Ignore\n    }\n\n    clientSocket.close();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/client/WireMockClientAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.emptyOrNullString;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\nclass WireMockClientAcceptanceTest {\n\n  private WireMockServer wireMockServer;\n  private WireMockTestClient testClient;\n\n  @BeforeEach\n  public void init() {\n    wireMockServer = new WireMockServer(Options.DYNAMIC_PORT);\n    wireMockServer.start();\n    WireMock.configureFor(wireMockServer.port());\n    testClient = new WireMockTestClient(wireMockServer.port());\n  }\n\n  @AfterEach\n  public void stopServer() {\n    wireMockServer.stop();\n  }\n\n  @Test\n  void buildsMappingWithUrlOnlyRequestAndStatusOnlyResponse() {\n    WireMock wireMock = WireMock.create().port(wireMockServer.port()).build();\n    wireMock.register(get(urlEqualTo(\"/my/new/resource\")).willReturn(aResponse().withStatus(304)));\n\n    assertThat(testClient.get(\"/my/new/resource\").statusCode(), is(304));\n  }\n\n  @Test\n  void buildsMappingFromStaticSyntax() {\n    givenThat(get(urlEqualTo(\"/my/new/resource\")).willReturn(aResponse().withStatus(304)));\n\n    assertThat(testClient.get(\"/my/new/resource\").statusCode(), is(304));\n  }\n\n  @Test\n  void buildsMappingWithUrlOnyRequestAndResponseWithJsonBodyWithDiacriticSigns() {\n    WireMock wireMock = WireMock.create().port(wireMockServer.port()).build();\n    wireMock.register(\n        get(urlEqualTo(\"/my/new/resource\"))\n            .willReturn(\n                aResponse().withBody(\"{\\\"address\\\":\\\"Puerto Banús, Málaga\\\"}\").withStatus(200)));\n\n    assertThat(\n        testClient.get(\"/my/new/resource\").content(), is(\"{\\\"address\\\":\\\"Puerto Banús, Málaga\\\"}\"));\n  }\n\n  @Test\n  void testGetOrHeadRequestWhenGetMatchesShouldReturnAResponseBody() {\n    String path = \"/get-or-head-test\";\n    WireMock wireMock = WireMock.create().port(wireMockServer.port()).build();\n    wireMock.register(\n        getOrHead(urlEqualTo(path))\n            .willReturn(okJson(\"{\\\"key\\\": \\\"value\\\"}\").withHeader(\"Content-Length\", \"16\")));\n\n    WireMockResponse response = testClient.get(path);\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/json\"));\n    assertThat(response.firstHeader(\"Content-Length\"), is(\"16\"));\n    assertThat(response.content(), not(emptyOrNullString()));\n  }\n\n  @Test\n  void testGetOrHeadRequestWhenHeadMatchesShouldNotReturnAResponseBody() {\n    String path = \"/get-or-head-test\";\n    WireMock wireMock = WireMock.create().port(wireMockServer.port()).build();\n\n    wireMock.register(\n        getOrHead(urlEqualTo(path))\n            .willReturn(\n                okJson(\"{\\\"key\\\": \\\"value\\\"}\")\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withHeader(\"Content-Length\", \"16\")));\n    WireMockResponse response = testClient.head(path);\n\n    assertThat(response.statusCode(), is(200));\n    assertThat(response.firstHeader(\"Content-Type\"), is(\"application/json\"));\n    assertThat(response.firstHeader(\"Content-Length\"), is(\"16\"));\n    assertThat(response.content(), is(emptyOrNullString()));\n  }\n\n  @Test\n  void testGetOrHeadRequestWhenNoMethodNotMatchesShouldReturn404() {\n    String path = \"/get-or-head-test\";\n    WireMock wireMock = WireMock.create().port(wireMockServer.port()).build();\n    wireMock.register(\n        getOrHead(urlEqualTo(path))\n            .willReturn(ok().withHeader(\"Content-Type\", \"application/json\")));\n    WireMockResponse response = testClient.delete(path);\n\n    assertThat(response.statusCode(), is(404));\n  }\n\n  @Test\n  void testGetOrHeadRequestWhenPathDoesNotMatchShouldReturn404() {\n    String correctPath = \"/get-or-head-path-correct\";\n    String incorrectPath = \"/get-or-head-path-incorrect\";\n    WireMock wireMock = WireMock.create().port(wireMockServer.port()).build();\n    wireMock.register(\n        getOrHead(urlEqualTo(correctPath))\n            .willReturn(ok().withHeader(\"Content-Type\", \"application/json\")));\n    WireMockResponse responseGet = testClient.get(incorrectPath);\n    WireMockResponse responseHead = testClient.head(incorrectPath);\n\n    assertThat(responseGet.statusCode(), is(404));\n    assertThat(responseHead.statusCode(), is(404));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/client/WireMockClientWithProxyAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2011-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.Options.DYNAMIC_PORT;\nimport static java.net.Proxy.Type.HTTP;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\nimport org.junit.jupiter.api.AfterAll;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\n\npublic class WireMockClientWithProxyAcceptanceTest {\n\n  private static WireMockServer wireMockServer;\n  private static WireMockTestClient testClient;\n  private static Proxy proxyServer;\n\n  @BeforeAll\n  public static void init() {\n    wireMockServer = new WireMockServer(DYNAMIC_PORT);\n    wireMockServer.start();\n    proxyServer = new Proxy(HTTP, new InetSocketAddress(\"localhost\", wireMockServer.port()));\n\n    testClient = new WireMockTestClient(wireMockServer.port());\n  }\n\n  @AfterAll\n  public static void stopServer() {\n    wireMockServer.stop();\n  }\n\n  @Test\n  void supportsProxyingWithTheStaticClient() {\n    WireMock.configureFor(\n        \"http\",\n        \"localhost\",\n        wireMockServer.port(),\n        ((InetSocketAddress) proxyServer.address()).getHostString(),\n        ((InetSocketAddress) proxyServer.address()).getPort());\n\n    givenThat(get(urlEqualTo(\"/my/new/resource\")).willReturn(aResponse().withStatus(304)));\n\n    assertThat(testClient.get(\"/my/new/resource\").statusCode(), is(304));\n  }\n\n  @Test\n  void supportsProxyingWithTheInstanceClient() {\n    WireMock wireMock =\n        WireMock.create()\n            .scheme(\"http\")\n            .host(\"localhost\")\n            .port(wireMockServer.port())\n            .urlPathPrefix(\"\")\n            .hostHeader(null)\n            .proxyHost(((InetSocketAddress) proxyServer.address()).getHostString())\n            .proxyPort(((InetSocketAddress) proxyServer.address()).getPort())\n            .build();\n\n    wireMock.register(\n        get(urlEqualTo(\"/my/new/resource\"))\n            .willReturn(\n                aResponse().withBody(\"{\\\"address\\\":\\\"Puerto Banús, Málaga\\\"}\").withStatus(200)));\n\n    assertThat(\n        testClient.get(\"/my/new/resource\").content(), is(\"{\\\"address\\\":\\\"Puerto Banús, Málaga\\\"}\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/ArrayFunctionsTest.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.ArrayFunctions.concat;\nimport static com.github.tomakehurst.wiremock.common.ArrayFunctions.prepend;\nimport static org.junit.jupiter.api.Assertions.assertArrayEquals;\n\nimport org.junit.jupiter.api.Test;\n\nclass ArrayFunctionsTest {\n\n  private final Integer[] empty = new Integer[0];\n\n  @Test\n  void concatEmptyAndEmpty() {\n    assertArrayEquals(empty, concat(empty, empty));\n  }\n\n  @Test\n  void concatNonEmptyAndEmpty() {\n    Integer[] first = {1, 2};\n\n    Integer[] result = concat(first, empty);\n    assertArrayEquals(new Integer[] {1, 2}, result);\n\n    first[0] = 10;\n    assertArrayEquals(new Integer[] {1, 2}, result);\n  }\n\n  @Test\n  void concatEmptyAndNonEmpty() {\n    Integer[] second = {1, 2};\n\n    Integer[] result = concat(empty, second);\n    assertArrayEquals(new Integer[] {1, 2}, result);\n\n    second[0] = 10;\n    assertArrayEquals(new Integer[] {1, 2}, result);\n  }\n\n  @Test\n  void concatNonEmptyAndNonEmpty() {\n    Integer[] first = {1, 2};\n    Integer[] second = {3, 4};\n\n    Integer[] result = concat(first, second);\n    assertArrayEquals(new Integer[] {1, 2, 3, 4}, result);\n\n    first[0] = 10;\n    second[0] = 30;\n    assertArrayEquals(new Integer[] {1, 2, 3, 4}, result);\n  }\n\n  @Test\n  void prependNullAndEmpty() {\n    assertArrayEquals(new Integer[] {null}, prepend(null, empty));\n  }\n\n  @Test\n  void prependSomeAndEmpty() {\n    Integer[] result = prepend(1, empty);\n    assertArrayEquals(new Integer[] {1}, result);\n  }\n\n  @Test\n  void prependNullAndNonEmpty() {\n    Integer[] second = {1, 2};\n\n    Integer[] result = prepend(null, second);\n    assertArrayEquals(new Integer[] {null, 1, 2}, result);\n\n    second[0] = 10;\n    assertArrayEquals(new Integer[] {null, 1, 2}, result);\n  }\n\n  @Test\n  void prependSomeAndNonEmpty() {\n    Integer[] second = {2, 3};\n\n    Integer[] result = prepend(1, second);\n    assertArrayEquals(new Integer[] {1, 2, 3}, result);\n\n    second[0] = 30;\n    assertArrayEquals(new Integer[] {1, 2, 3}, result);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/Base64EncoderTest.java",
    "content": "/*\n * Copyright (C) 2018-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport org.junit.jupiter.api.Test;\n\npublic class Base64EncoderTest {\n  public static final String INPUT = \"1234\";\n  public static final String OUTPUT = \"MTIzNA==\";\n\n  @Test\n  void testEncoder() {\n    var encoder = new JdkBase64Encoder();\n\n    String encoded = encoder.encode(INPUT.getBytes());\n    assertThat(encoded, is(OUTPUT));\n\n    String decoded = new String(encoder.decode(encoded));\n    assertThat(decoded, is(INPUT));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/ClasspathFileSourceTest.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.fileNamed;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.greaterThan;\nimport static org.hamcrest.Matchers.hasItems;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.startsWith;\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.junit.jupiter.api.Assertions.fail;\n\nimport java.io.File;\nimport java.net.*;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\nclass ClasspathFileSourceTest {\n\n  ClasspathFileSource classpathFileSource;\n\n  @Test\n  void listsFilesRecursivelyFromJar() {\n    initForJar();\n\n    List<TextFile> files = classpathFileSource.listFilesRecursively();\n\n    assertThat(files, hasItems(fileNamed(\"pom.properties\"), fileNamed(\"pom.xml\")));\n  }\n\n  @Test\n  void listsFilesRecursivelyFromFileSystem() {\n    initForFileSystem();\n\n    List<TextFile> files = classpathFileSource.listFilesRecursively();\n\n    assertThat(\n        files,\n        hasItems(\n            fileNamed(\"one\"),\n            fileNamed(\"two\"),\n            fileNamed(\"three\"),\n            fileNamed(\"four\"),\n            fileNamed(\"five\"),\n            fileNamed(\"six\")));\n  }\n\n  @Test\n  void readsBinaryFileFromJar() {\n    initForJar();\n\n    BinaryFile binaryFile = classpathFileSource.getBinaryFileNamed(\"guava/pom.xml\");\n\n    assertThat(\"Expected a non zero length file\", binaryFile.readContents().length, greaterThan(0));\n  }\n\n  @Test\n  void readsBinaryFileFromCustomClassLoader() throws MalformedURLException {\n    initForCustomClassLoader();\n\n    BinaryFile binaryFile = classpathFileSource.child(\"__files\").getBinaryFileNamed(\"stuff.txt\");\n\n    assertThat(\"Expected a non zero length file\", binaryFile.readContents().length, greaterThan(0));\n  }\n\n  @Test\n  void readsBinaryFileFromZip() {\n    classpathFileSource = new ClasspathFileSource(\"zippeddir\");\n\n    BinaryFile binaryFile = classpathFileSource.getBinaryFileNamed(\"zippedfile.txt\");\n\n    String contents = new String(binaryFile.readContents());\n    assertThat(contents, containsString(\"zip\"));\n  }\n\n  @Test\n  void readsBinaryFileFromZipWithoutMatch() {\n    classpathFileSource = new ClasspathFileSource(\"zippeddir\");\n    try {\n      classpathFileSource.getBinaryFileNamed(\"thisWillNotBeFound.txt\");\n      fail(\"Should have thrown exception.\");\n    } catch (Exception e) {\n      assertThat(\n          \"Informative error\",\n          e.getMessage(),\n          startsWith(\"Was unable to find entry: \\\"zippeddir/thisWillNotBeFound.txt\\\", found:\"));\n    }\n  }\n\n  @Test\n  void readsBinaryFileFromFileSystem() {\n    initForFileSystem();\n\n    BinaryFile binaryFile = classpathFileSource.getBinaryFileNamed(\"subdir/deepfile.json\");\n\n    assertThat(\"Expected a non zero length file\", binaryFile.readContents().length, greaterThan(0));\n  }\n\n  @Test\n  void createsChildSource() {\n    initForFileSystem();\n\n    FileSource child = classpathFileSource.child(\"subdir\");\n\n    assertThat(child.getPath(), is(\"filesource/subdir\"));\n  }\n\n  @Test\n  void correctlyReportsExistence() {\n    assertTrue(new ClasspathFileSource(\"filesource/subdir\").exists(), \"Expected to exist\");\n    assertTrue(\n        new ClasspathFileSource(\"META-INF/maven/com.google.guava\").exists(), \"Expected to exist\");\n    assertFalse(new ClasspathFileSource(\"not/exist\").exists(), \"Expected not to exist\");\n  }\n\n  @Test\n  void failsSilentlyOnWrites() {\n    assertDoesNotThrow(\n        () -> {\n          initForFileSystem();\n          classpathFileSource.deleteFile(\"one\");\n          classpathFileSource.writeBinaryFile(\"any-bytes\", new byte[] {});\n          classpathFileSource.writeTextFile(\"any-text\", \"things\");\n          classpathFileSource.createIfNecessary();\n        });\n  }\n\n  private void initForJar() {\n    classpathFileSource = new ClasspathFileSource(\"META-INF/maven/com.google.guava\");\n  }\n\n  private void initForFileSystem() {\n    classpathFileSource = new ClasspathFileSource(\"filesource\");\n  }\n\n  private void initForCustomClassLoader() throws MalformedURLException {\n    URL[] urls = {new File(\"src/main/resources/classpath-filesource.jar\").toURI().toURL()};\n    ClassLoader cl = new URLClassLoader(urls);\n    classpathFileSource = new ClasspathFileSource(cl, \"jar-filesource\");\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/ContentTypesTest.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.http.ContentTypeHeader;\nimport org.junit.jupiter.api.Test;\nimport org.wiremock.url.PathAndQuery;\n\nclass ContentTypesTest {\n\n  @Test\n  void detectsTextTypesCorrectlyFromFileExtension() {\n    assertTrue(ContentTypes.determineIsTextFromExtension(\"txt\"));\n    assertTrue(ContentTypes.determineIsTextFromExtension(\"json\"));\n    assertTrue(ContentTypes.determineIsTextFromExtension(\"xml\"));\n    assertTrue(ContentTypes.determineIsTextFromExtension(\"html\"));\n    assertTrue(ContentTypes.determineIsTextFromExtension(\"htm\"));\n    assertTrue(ContentTypes.determineIsTextFromExtension(\"yaml\"));\n    assertTrue(ContentTypes.determineIsTextFromExtension(\"csv\"));\n\n    assertFalse(ContentTypes.determineIsTextFromExtension(\"jpg\"));\n    assertFalse(ContentTypes.determineIsTextFromExtension(\"png\"));\n    assertFalse(ContentTypes.determineIsTextFromExtension(null));\n    assertFalse(ContentTypes.determineIsTextFromExtension(\"\"));\n  }\n\n  @Test\n  void detectsTextTypesCorrectlyFromMimeType() {\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"text/plain\"));\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"text/html\"));\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"application/json\"));\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"some-preamble; application/json\"));\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"application/blah.something+json\"));\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"application/xml\"));\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"text/xml\"));\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"text/xml; utf-8\"));\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"application/csv\"));\n    assertTrue(ContentTypes.determineIsTextFromMimeType(\"application/x-www-form-urlencoded\"));\n\n    assertFalse(ContentTypes.determineIsTextFromMimeType(\"application/octet-stream\"));\n    assertFalse(ContentTypes.determineIsTextFromMimeType(\"image/jpeg\"));\n    assertFalse(ContentTypes.determineIsTextFromMimeType(\"application/pdf\"));\n  }\n\n  @Test\n  void detectsTextTypesCorrectlyFromExtensionOrMimeType() {\n    assertTrue(ContentTypes.determineIsText(\"txt\", \"text/plain\"));\n    assertTrue(ContentTypes.determineIsText(\"xml\", \"\"));\n    assertTrue(ContentTypes.determineIsText(\"json\", null));\n\n    assertFalse(ContentTypes.determineIsText(\"png\", null));\n    assertFalse(ContentTypes.determineIsText(null, \"image/jpeg\"));\n  }\n\n  @Test\n  void correctlyDeterminesFileExtensionWhenDotsInPath() {\n    String fileExtension =\n        ContentTypes.determineFileExtension(\n            PathAndQuery.parse(\"/path.with.dots/and/several/segments\"),\n            ContentTypeHeader.absent(),\n            new byte[] {});\n\n    assertThat(fileExtension, is(\"txt\"));\n  }\n\n  @Test\n  void correctlyDeterminesFileExtensionFromUrl() {\n    String fileExtension =\n        ContentTypes.determineFileExtension(\n            PathAndQuery.parse(\"/path.with.dots/image.png\"),\n            ContentTypeHeader.absent(),\n            new byte[] {});\n\n    assertThat(fileExtension, is(\"png\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/DateTimeOffsetTest.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport java.time.ZoneId;\nimport java.time.ZonedDateTime;\nimport java.time.format.DateTimeFormatter;\nimport java.util.Date;\nimport org.junit.jupiter.api.Test;\n\nclass DateTimeOffsetTest {\n\n  @Test\n  void parsesSecondsOffset() {\n    DateTimeOffset offset = DateTimeOffset.fromString(\"7 seconds\");\n    assertThat(offset.getAmountUnit(), is(DateTimeUnit.SECONDS));\n    assertThat(offset.getAmount(), is(7));\n  }\n\n  @Test\n  void parsesMinutesOffset() {\n    DateTimeOffset offset = DateTimeOffset.fromString(\"78 minutes\");\n    assertThat(offset.getAmountUnit(), is(DateTimeUnit.MINUTES));\n    assertThat(offset.getAmount(), is(78));\n  }\n\n  @Test\n  void parsesHoursOffset() {\n    DateTimeOffset offset = DateTimeOffset.fromString(\"-12 hours\");\n    assertThat(offset.getAmountUnit(), is(DateTimeUnit.HOURS));\n    assertThat(offset.getAmount(), is(-12));\n  }\n\n  @Test\n  void parsesDaysOffset() {\n    DateTimeOffset offset = DateTimeOffset.fromString(\"1 days\");\n    assertThat(offset.getAmountUnit(), is(DateTimeUnit.DAYS));\n    assertThat(offset.getAmount(), is(1));\n  }\n\n  @Test\n  void parsesMonthsOffset() {\n    DateTimeOffset offset = DateTimeOffset.fromString(\"-12 months\");\n    assertThat(offset.getAmountUnit(), is(DateTimeUnit.MONTHS));\n    assertThat(offset.getAmount(), is(-12));\n  }\n\n  @Test\n  void parsesYearsOffset() {\n    DateTimeOffset offset = DateTimeOffset.fromString(\"101 years\");\n    assertThat(offset.getAmountUnit(), is(DateTimeUnit.YEARS));\n    assertThat(offset.getAmount(), is(101));\n  }\n\n  @Test\n  void parsesPositiveLongForm() {\n    DateTimeOffset offset = DateTimeOffset.fromString(\"now +101 years\");\n    assertThat(offset.getAmountUnit(), is(DateTimeUnit.YEARS));\n    assertThat(offset.getAmount(), is(101));\n  }\n\n  @Test\n  void parsesNegativeLongForm() {\n    DateTimeOffset offset = DateTimeOffset.fromString(\"now -5 months\");\n    assertThat(offset.getAmountUnit(), is(DateTimeUnit.MONTHS));\n    assertThat(offset.getAmount(), is(-5));\n  }\n\n  @Test\n  void returnsCorrectToString() {\n    assertThat(DateTimeOffset.fromString(\"123 minutes\").toString(), is(\"123 minutes\"));\n    assertThat(DateTimeOffset.fromString(\"-72 hours\").toString(), is(\"-72 hours\"));\n  }\n\n  @Test\n  void canBeConstructedFromParts() {\n    assertThat(new DateTimeOffset(67, DateTimeUnit.DAYS).toString(), is(\"67 days\"));\n    assertThat(new DateTimeOffset(-12, DateTimeUnit.SECONDS).toString(), is(\"-12 seconds\"));\n  }\n\n  @Test\n  void shiftsZonedDateTimes() {\n    DateTimeOffset positiveDateOffset = new DateTimeOffset(10, DateTimeUnit.DAYS);\n    assertThat(\n        positiveDateOffset.shift(ZonedDateTime.parse(\"2021-06-18T00:00:00Z\")),\n        is(ZonedDateTime.parse(\"2021-06-28T00:00:00Z\")));\n\n    DateTimeOffset negativeDateOffset = new DateTimeOffset(-4, DateTimeUnit.MONTHS);\n    assertThat(\n        negativeDateOffset.shift(ZonedDateTime.parse(\"2021-06-18T00:00:00Z\")),\n        is(ZonedDateTime.parse(\"2021-02-18T00:00:00Z\")));\n  }\n\n  @Test\n  void offsetsProvidedDateByConfiguredAmount() {\n    DateTimeOffset offset = DateTimeOffset.fromString(\"3 days\");\n    Date startingDate = Date.from(ZonedDateTime.parse(\"2018-04-16T12:01:01Z\").toInstant());\n    Date finalDate = offset.shift(startingDate);\n\n    assertThat(\n        DateTimeFormatter.ISO_ZONED_DATE_TIME.format(finalDate.toInstant().atZone(ZoneId.of(\"Z\"))),\n        is(\"2018-04-19T12:01:01Z\"));\n  }\n\n  @Test\n  void throwsExceptionWhenUnparseableStringProvided() {\n    assertThrows(IllegalArgumentException.class, () -> DateTimeOffset.fromString(\"101\"));\n  }\n\n  @Test\n  void throwsExceptionWhenUnparseableUnitProvided() {\n    assertThrows(IllegalArgumentException.class, () -> DateTimeOffset.fromString(\"101 squillions\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/DateTimeParserTest.java",
    "content": "/*\n * Copyright (C) 2021-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Pair.pair;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport java.time.*;\nimport java.time.format.DateTimeFormatter;\nimport java.time.format.DateTimeParseException;\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\n\nclass DateTimeParserTest {\n\n  @Test\n  void parsesFromDateTimeFormatter() {\n    DateTimeParser parser = DateTimeParser.forFormatter(DateTimeFormatter.ISO_DATE_TIME);\n    assertThat(\n        parser.parseZonedDateTime(\"2021-06-23T11:12:13Z\"),\n        is(ZonedDateTime.parse(\"2021-06-23T11:12:13Z\")));\n\n    assertThat(\n        parser.parseLocalDateTime(\"2021-06-23T11:12:13\"),\n        is(LocalDateTime.parse(\"2021-06-23T11:12:13\")));\n  }\n\n  @Test\n  void parsesZonedFromFormatString() {\n    DateTimeParser parser = DateTimeParser.forFormat(\"dd/MM/yyyy HH:mm:ss Z\");\n    assertThat(\n        parser.parseZonedDateTime(\"23/06/2021 11:22:33 +0000\"),\n        is(ZonedDateTime.parse(\"2021-06-23T11:22:33Z\")));\n  }\n\n  @Test\n  void parsesLocalDateTimeFromFormatString() {\n    DateTimeParser parser = DateTimeParser.forFormat(\"dd/MM/yyyy HH:mm:ss\");\n    assertThat(\n        parser.parseLocalDateTime(\"23/06/2021 11:12:13\"),\n        is(LocalDateTime.parse(\"2021-06-23T11:12:13\")));\n  }\n\n  @Test\n  void parsesLocalDateFromFormatString() {\n    DateTimeParser parser = DateTimeParser.forFormat(\"dd/MM/yyyy\");\n    assertThat(parser.parseLocalDate(\"23/06/2021\"), is(LocalDate.parse(\"2021-06-23\")));\n  }\n\n  @Test\n  void parsesYearMonthFromFormatString() {\n    DateTimeParser parser = DateTimeParser.forFormat(\"MM/yyyy\");\n    assertThat(parser.parseYearMonth(\"06/2021\"), is(YearMonth.parse(\"2021-06\")));\n  }\n\n  @Test\n  void parsesYearFromFormatString() {\n    DateTimeParser parser = DateTimeParser.forFormat(\"yy\");\n    assertThat(parser.parseYear(\"21\"), is(Year.parse(\"2021\")));\n  }\n\n  @Test\n  void parsesUnix() {\n    DateTimeParser parser = DateTimeParser.forFormat(\"unix\");\n    assertThat(\n        parser.parseZonedDateTime(\"1624447353\"), is(ZonedDateTime.parse(\"2021-06-23T11:22:33Z\")));\n\n    assertThat(\n        parser.parseLocalDateTime(\"1624447353\"), is(LocalDateTime.parse(\"2021-06-23T11:22:33\")));\n  }\n\n  @Test\n  void parsesEpoch() {\n    DateTimeParser parser = DateTimeParser.forFormat(\"epoch\");\n    assertThat(\n        parser.parseZonedDateTime(\"1624447353000\"),\n        is(ZonedDateTime.parse(\"2021-06-23T11:22:33Z\")));\n\n    assertThat(\n        parser.parseLocalDateTime(\"1624447353000\"), is(LocalDateTime.parse(\"2021-06-23T11:22:33\")));\n  }\n\n  private static final List<Pair<String, ZonedDateTime>> parseZonedDateTimeTestCases =\n      Stream.of(\n              pair(\"2021-06-23T11:12:13Z\", \"2021-06-23T11:12:13Z\"),\n              pair(\"2021-06-23T11:12:13+01:00\", \"2021-06-23T11:12:13+01:00\"),\n              pair(\"2021-06-23T11:12:13-01:00\", \"2021-06-23T11:12:13-01:00\"),\n              pair(\"2021-06-23T11:12:13 01:00\", \"2021-06-23T11:12:13+01:00\"),\n              pair(\"2021-06-23T11:12:13.000+01:00\", \"2021-06-23T11:12:13.000+01:00\"),\n              pair(\"2021-06-23T11:12:13.000 01:00\", \"2021-06-23T11:12:13.000+01:00\"),\n              pair(\"2021-06-23T11:12:13.000000000+01:00\", \"2021-06-23T11:12:13.000000000+01:00\"),\n              pair(\"2021-06-23T11:12:13.000000000 01:00\", \"2021-06-23T11:12:13.000000000+01:00\"))\n          .map(pair -> pair(pair.a, ZonedDateTime.parse(pair.b)))\n          .toList();\n\n  @ParameterizedTest\n  @FieldSource(\"parseZonedDateTimeTestCases\")\n  void acceptsSpaceForPlusInIsoDateTime(Pair<String, ZonedDateTime> testCase) {\n    DateTimeParser parser = DateTimeParser.forFormatter(DateTimeFormatter.ISO_DATE_TIME);\n    assertThat(parser.parseZonedDateTime(testCase.a), is(testCase.b));\n  }\n\n  @Test\n  void throwsDateTimeParseExceptionForFormatter() {\n    DateTimeParser parser = DateTimeParser.forFormatter(DateTimeFormatter.ISO_DATE_TIME);\n    assertThatExceptionOfType(DateTimeParseException.class)\n        .isThrownBy(() -> parser.parseZonedDateTime(\"2021-06-23T11:12:13 30:00\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/DateTimeTruncationTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport java.time.ZonedDateTime;\nimport org.junit.jupiter.api.Test;\n\nclass DateTimeTruncationTest {\n\n  @Test\n  void firstSecondOfMinute() {\n    ZonedDateTime input = ZonedDateTime.parse(\"2021-06-18T10:11:12Z\");\n    ZonedDateTime output = DateTimeTruncation.FIRST_SECOND_OF_MINUTE.truncate(input);\n    assertThat(output, is(ZonedDateTime.parse(\"2021-06-18T10:11:00Z\")));\n  }\n\n  @Test\n  void firstMinuteOfHour() {\n    ZonedDateTime input = ZonedDateTime.parse(\"2021-06-18T10:11:12Z\");\n    ZonedDateTime output = DateTimeTruncation.FIRST_MINUTE_OF_HOUR.truncate(input);\n    assertThat(output, is(ZonedDateTime.parse(\"2021-06-18T10:00:00Z\")));\n  }\n\n  @Test\n  void firstHourOfDay() {\n    ZonedDateTime input = ZonedDateTime.parse(\"2021-06-18T10:11:12Z\");\n    ZonedDateTime output = DateTimeTruncation.FIRST_HOUR_OF_DAY.truncate(input);\n    assertThat(output, is(ZonedDateTime.parse(\"2021-06-18T00:00:00Z\")));\n  }\n\n  @Test\n  void firstDayOfMonth() {\n    ZonedDateTime input = ZonedDateTime.parse(\"2021-06-18T10:11:12Z\");\n    ZonedDateTime output = DateTimeTruncation.FIRST_DAY_OF_MONTH.truncate(input);\n    assertThat(output, is(ZonedDateTime.parse(\"2021-06-01T00:00:00Z\")));\n  }\n\n  @Test\n  void firstDayOfNextMonth() {\n    ZonedDateTime input = ZonedDateTime.parse(\"2021-06-18T10:11:12Z\");\n    ZonedDateTime output = DateTimeTruncation.FIRST_DAY_OF_NEXT_MONTH.truncate(input);\n    assertThat(output, is(ZonedDateTime.parse(\"2021-07-01T00:00:00Z\")));\n  }\n\n  @Test\n  void lastDayOfMonth() {\n    ZonedDateTime input = ZonedDateTime.parse(\"2021-06-18T10:11:12Z\");\n    ZonedDateTime output = DateTimeTruncation.LAST_DAY_OF_MONTH.truncate(input);\n    assertThat(output, is(ZonedDateTime.parse(\"2021-06-30T00:00:00Z\")));\n  }\n\n  @Test\n  void firstDayOfYear() {\n    ZonedDateTime input = ZonedDateTime.parse(\"2021-06-18T10:11:12Z\");\n    ZonedDateTime output = DateTimeTruncation.FIRST_DAY_OF_YEAR.truncate(input);\n    assertThat(output, is(ZonedDateTime.parse(\"2021-01-01T00:00:00Z\")));\n  }\n\n  @Test\n  void firstDayOfNextYear() {\n    ZonedDateTime input = ZonedDateTime.parse(\"2021-06-18T10:11:12Z\");\n    ZonedDateTime output = DateTimeTruncation.FIRST_DAY_OF_NEXT_YEAR.truncate(input);\n    assertThat(output, is(ZonedDateTime.parse(\"2022-01-01T00:00:00Z\")));\n  }\n\n  @Test\n  void lastDayOfYear() {\n    ZonedDateTime input = ZonedDateTime.parse(\"2021-06-18T10:11:12Z\");\n    ZonedDateTime output = DateTimeTruncation.LAST_DAY_OF_YEAR.truncate(input);\n    assertThat(output, is(ZonedDateTime.parse(\"2021-12-31T00:00:00Z\")));\n  }\n\n  @Test\n  void parsesFromFriendlyString() {\n    assertThat(\n        DateTimeTruncation.fromString(\"last day of year\"), is(DateTimeTruncation.LAST_DAY_OF_YEAR));\n  }\n\n  @Test\n  void toStringReturnsFriendlyString() {\n    assertThat(DateTimeTruncation.FIRST_DAY_OF_MONTH.toString(), is(\"first day of month\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/DatesTest.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.assertj.core.api.AssertionsForClassTypes.assertThat;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport java.time.LocalDate;\nimport java.time.Month;\nimport java.time.ZoneId;\nimport java.time.format.DateTimeParseException;\nimport java.util.Date;\nimport org.junit.jupiter.api.Test;\n\nclass DatesTest {\n\n  @Test\n  void mapsValidInputAsDate() {\n    // given\n    var input = \"2023-10-07T00:00:00Z\";\n    var expected =\n        Date.from(LocalDate.of(2023, Month.OCTOBER, 7).atStartOfDay(ZoneId.of(\"UTC\")).toInstant());\n\n    // when\n    var result = Dates.parse(input);\n\n    // then\n    assertThat(result).isEqualTo(expected);\n  }\n\n  @Test\n  void throwsExceptionWhenMappingInvalidInput() {\n    // given\n    var input = \"invalid\";\n\n    // when + then\n    assertThrows(DateTimeParseException.class, () -> Dates.parse(input));\n  }\n\n  @Test\n  void parseDateToTextualDate() {\n    // given\n    var input = \"2023-10-07T00:00:00Z\";\n    var expected =\n        Date.from(LocalDate.of(2023, Month.OCTOBER, 7).atStartOfDay(ZoneId.of(\"UTC\")).toInstant());\n\n    // when\n    var result = Dates.parse(input);\n\n    // then\n    assertThat(result).isEqualTo(expected);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/FilenameMakerTest.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.startsWith;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.wiremock.url.Path;\n\nclass FilenameMakerTest {\n\n  private FilenameMaker filenameMaker;\n\n  @BeforeEach\n  public void init() {\n    filenameMaker = new FilenameMaker();\n  }\n\n  @Test\n  void generatesNameFromStubNameWhenPresent() {\n    StubMapping mapping =\n        WireMock.get(\"/named\").withName(\"This is a NAMED stub\").willReturn(ok()).build();\n\n    assertThat(\n        filenameMaker.filenameFor(mapping),\n        is(\"this-is-a-named-stub-\" + mapping.getId() + \".json\"));\n  }\n\n  @Test\n  void generatesNameFromStubUrlWhenNameNotPresent() {\n    FilenameMaker makerWithOwnFormat = new FilenameMaker(\"{{{method}}}-{{{url}}}.json\");\n    StubMapping mapping = WireMock.get(urlEqualTo(\"/named/123/things\")).willReturn(ok()).build();\n\n    assertThat(makerWithOwnFormat.filenameFor(mapping), is(\"get-named123things.json\"));\n  }\n\n  @Test\n  void generatesNameFromStubUrlPathWhenNameNotPresent() {\n    FilenameMaker makerWithOwnFormat = new FilenameMaker(\"{{{method}}}-{{{url}}}.json\");\n    StubMapping mapping =\n        WireMock.get(urlPathEqualTo(\"/named/123/things\")).willReturn(ok()).build();\n\n    assertThat(makerWithOwnFormat.filenameFor(mapping), is(\"get-named123things.json\"));\n  }\n\n  @Test\n  void generatesNameFromStubUrlPathTemplateWhenNameNotPresent() {\n    FilenameMaker makerWithOwnFormat = new FilenameMaker(\"{{{method}}}-{{{url}}}.json\");\n    StubMapping mapping =\n        WireMock.get(urlPathTemplate(\"/named/{id}/things\")).willReturn(ok()).build();\n\n    assertThat(makerWithOwnFormat.filenameFor(mapping), is(\"get-namedidthings.json\"));\n  }\n\n  @Test\n  void generatesNameFromStubUrlPatternWhenNameNotPresent() {\n    FilenameMaker makerWithOwnFormat = new FilenameMaker(\"{{{method}}}-{{{url}}}.json\");\n    StubMapping mapping =\n        WireMock.get(urlMatching(\"/named/([0-9]*)/things\")).willReturn(ok()).build();\n\n    assertThat(makerWithOwnFormat.filenameFor(mapping), is(\"get-named0-9things.json\"));\n  }\n\n  @Test\n  void generatesNameWhenStubUrlIsAnyAndNameNotPresent() {\n    StubMapping mapping = WireMock.get(anyUrl()).willReturn(ok()).build();\n\n    FilenameMaker makerWithOwnFormat = new FilenameMaker(\"{{{id}}}.json\");\n\n    assertThat(makerWithOwnFormat.filenameFor(mapping), is(mapping.getId() + \".json\"));\n  }\n\n  @Test\n  void sanitizesUrlWithCharactersSafeForFilenames() {\n    String output = filenameMaker.sanitizeUrl(Path.parse(\"/hello/1/2/3__!/ẮČĖ--ace/¥$$/$/and/¿\"));\n    assertThat(output, is(\"hello_1_2_3___ace--ace___and\"));\n  }\n\n  @Test\n  void generatesSanitizedFilename() {\n    String filename =\n        filenameMaker.filenameFor(\n            get(\"/hello/1/2/3__!/ẮČĖ--ace/¥$$/$/and/¿\").willReturn(ok()).build());\n    assertThat(filename, startsWith(\"get-hello123__--aceand-\"));\n  }\n\n  @Test\n  void truncatesWhenResultingNameOver200Chars() {\n    String output =\n        filenameMaker.sanitizeUrl(\n            Path.parse(\n                \"/hello/1/2/3__!/ẮČĖ--ace/¥$$/$/andverylongstuffandverylongstuffandverylongstuffandverylongstuffandverylongstuffandverylongstuffandverylongstuffandverylongstuffandverylongstuffandverylongstuffandverylongstuffandverylongstuffandverylongstuff/¿\"));\n    assertThat(output.length(), is(200));\n  }\n\n  @Test\n  void includesStubNameWhenPresent() {\n    StubMapping stub =\n        Json.read(\n            \"{\\n\"\n                + \"    \\\"name\\\": \\\"This is a NAMED stub\\\",\\n\"\n                + \"    \\\"persistent\\\": true,\\n\"\n                + \"    \\\"request\\\": {\\n\"\n                + \"        \\\"urlPath\\\": \\\"/one/two/three\\\",\\n\"\n                + \"        \\\"method\\\": \\\"GET\\\"\\n\"\n                + \"    },\\n\"\n                + \"\\n\"\n                + \"    \\\"response\\\": {\\n\"\n                + \"        \\\"status\\\": 200\\n\"\n                + \"    }\\n\"\n                + \"}\\n\",\n            StubMapping.class);\n    String filename = filenameMaker.filenameFor(stub);\n\n    assertThat(filename, is(\"this-is-a-named-stub-\" + stub.getId() + \".json\"));\n  }\n\n  @Test\n  void handlesAnAllDefaultsStub() {\n    StubMapping stubMapping = Json.read(\"{}\", StubMapping.class);\n\n    String filename = filenameMaker.filenameFor(stubMapping);\n\n    assertThat(filename, startsWith(\"any-always-\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/JettySettingsTest.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.jetty.JettySettings;\nimport java.util.Optional;\nimport org.junit.jupiter.api.Test;\n\nclass JettySettingsTest {\n\n  private static final int number = 1234;\n  private static final long longNumber = Long.MAX_VALUE;\n\n  @Test\n  void testBuilderWithValues() {\n    JettySettings.Builder builder = JettySettings.Builder.aJettySettings();\n    builder\n        .withAcceptors(number)\n        .withAcceptQueueSize(number)\n        .withRequestHeaderSize(number)\n        .withResponseHeaderSize(number)\n        .withStopTimeout(longNumber)\n        .withIdleTimeout(longNumber);\n\n    JettySettings jettySettings = builder.build();\n\n    ensurePresent(jettySettings.getAcceptors());\n    ensurePresent(jettySettings.getAcceptQueueSize());\n    ensurePresent(jettySettings.getRequestHeaderSize());\n    ensurePresent(jettySettings.getResponseHeaderSize());\n    ensureLongPresent(jettySettings.getStopTimeout());\n    ensureLongPresent(jettySettings.getIdleTimeout());\n  }\n\n  @Test\n  void testBuilderWithNoValues() {\n\n    JettySettings.Builder builder = JettySettings.Builder.aJettySettings();\n    JettySettings jettySettings = builder.build();\n\n    assertFalse(jettySettings.getAcceptors().isPresent());\n    assertFalse(jettySettings.getAcceptQueueSize().isPresent());\n    assertFalse(jettySettings.getRequestHeaderSize().isPresent());\n    assertFalse(jettySettings.getStopTimeout().isPresent());\n    assertFalse(jettySettings.getIdleTimeout().isPresent());\n  }\n\n  private void ensurePresent(Optional<Integer> optional) {\n    assertTrue(optional.isPresent());\n    assertEquals(Integer.valueOf(number), optional.get());\n  }\n\n  private void ensureLongPresent(Optional<Long> optional) {\n    assertTrue(optional.isPresent());\n    assertEquals(Long.valueOf(longNumber), optional.get());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/LazyTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Lazy.lazy;\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.concurrent.atomic.AtomicInteger;\nimport org.junit.jupiter.api.Test;\n\npublic class LazyTest {\n\n  @Test\n  void initialisesFromSupplierOnlyOnce() {\n    AtomicInteger count = new AtomicInteger(0);\n\n    Lazy<String> lazy =\n        lazy(\n            () -> {\n              count.incrementAndGet();\n              return \"Lazily\";\n            });\n\n    lazy.get();\n    lazy.get();\n\n    assertThat(lazy.get()).isEqualTo(\"Lazily\");\n    assertThat(count.get()).isEqualTo(1);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/LimitTest.java",
    "content": "/*\n * Copyright (C) 2022 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport org.junit.jupiter.api.Test;\n\npublic class LimitTest {\n\n  @Test\n  void indicates_value_exceeds_limit() {\n    Limit limit = new Limit(5);\n    assertThat(limit.isExceededBy(4), is(false));\n    assertThat(limit.isExceededBy(5), is(false));\n    assertThat(limit.isExceededBy(6), is(true));\n  }\n\n  @Test\n  void indicates_unlimited() {\n    assertTrue(Limit.UNLIMITED.isUnlimited());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/ListFunctionsTest.java",
    "content": "/*\n * Copyright (C) 2020-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.ListFunctions.splitByType;\nimport static com.github.tomakehurst.wiremock.common.Pair.pair;\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.singletonList;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport java.util.Collections;\nimport org.junit.jupiter.api.Test;\n\npublic class ListFunctionsTest {\n\n  @Test\n  public void emptyArrayReturnsTwoEmptyLists() {\n    Number[] input = new Number[0];\n\n    assertEquals(\n        pair(Collections.<Number>emptyList(), Collections.<Integer>emptyList()),\n        splitByType(input, Integer.class));\n  }\n\n  @Test\n  public void singletonArrayNonMatchingReturnsSingletonAndEmptyList() {\n    Number[] input = new Number[] {1L};\n\n    assertEquals(\n        pair(singletonList(1L), Collections.<Integer>emptyList()),\n        splitByType(input, Integer.class));\n  }\n\n  @Test\n  public void singletonArrayMatchingReturnsEmptyAndSingletonList() {\n    Number[] input = new Number[] {1};\n\n    assertEquals(\n        pair(Collections.<Number>emptyList(), singletonList(1)), splitByType(input, Integer.class));\n  }\n\n  @Test\n  public void splitsTheArrayAsExpected() {\n    Number[] input = new Number[] {1, 1L, 2, 2L, 3, 3L};\n\n    assertEquals(pair(asList(1L, 2L, 3L), asList(1, 2, 3)), splitByType(input, Integer.class));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/MetadataTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\n\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\n\npublic class MetadataTest {\n\n  @Test\n  void deserialisesStubWithMetadata() {\n    // language=json\n    String json =\n        \"\"\"\n                {\n                    \"request\": {\n                        \"method\": \"GET\",\n                        \"url\": \"/test\",\n                        \"customMatcher\": {\n                            \"parameters\": {\n                                \"name\": \"test-params\",\n                                \"key\": \"val\"\n                            }\n                        }\n                    },\n                    \"response\": {\n                        \"status\": 200\n                    },\n                    \"metadata\": {\n                        \"single\": \"value\",\n                        \"obj\": {\n                            \"a\": \"b\"\n                        }\n                    }\n                }\n                \"\"\";\n\n    StubMapping stub = Json.read(json, StubMapping.class);\n\n    Metadata metadata = stub.getMetadata();\n    assertThat(metadata.getString(\"single\"), is(\"value\"));\n    assertThat(metadata.getMetadata(\"obj\").getString(\"a\"), is(\"b\"));\n  }\n\n  @Test\n  void deepMergesMetadata() {\n    final Metadata initialMetadata =\n        Metadata.create(\n            builder ->\n                builder\n                    .attr(\"oneString\", \"abc\")\n                    .list(\"oneList\", \"a\", \"b\", \"c\")\n                    .list(\"oneListToBeReplaced\", \"1\", \"2\")\n                    .attr(\"oneInt\", 1)\n                    .attr(\"oneObjToBeReplaced\", innerBuilder -> innerBuilder.attr(\"inner\", \"to go\"))\n                    .attr(\"oneObj\", innerBuilder -> innerBuilder.attr(\"oneInner\", 123)));\n\n    Metadata toMerge =\n        Metadata.create(\n            builder ->\n                builder\n                    .attr(\"twoString\", \"def\")\n                    .list(\"oneList\", \"d\", \"e\")\n                    .attr(\"oneListToBeReplaced\", false)\n                    .attr(\"oneObjToBeReplaced\", 0)\n                    .attr(\"twoObj\", innerBuilder -> innerBuilder.attr(\"twoInner\", 456))\n                    .attr(\"oneInt\", 2)\n                    .attr(\"oneObj\", innerBuilder -> innerBuilder.attr(\"oneInner\", 789)));\n\n    Metadata merged = initialMetadata.deepMerge(toMerge);\n\n    // Unchanged\n    assertThat(merged.getString(\"oneString\"), is(\"abc\"));\n\n    // Added\n    assertThat(merged.getString(\"twoString\"), is(\"def\"));\n    assertThat(merged.getMetadata(\"twoObj\").getInt(\"twoInner\"), is(456));\n\n    // Overridden\n    assertThat(merged.getInt(\"oneInt\"), is(2));\n    assertThat(merged.getMetadata(\"oneObj\").getInt(\"oneInner\"), is(789));\n\n    // Replaced with different type\n    assertThat(merged.get(\"oneListToBeReplaced\"), is(false));\n    assertThat(merged.getInt(\"oneObjToBeReplaced\"), is(0));\n\n    // Inserted\n    assertThat(merged.getList(\"oneList\"), is(List.of(\"a\", \"b\", \"c\", \"d\", \"e\")));\n  }\n\n  @Test\n  void initialisesMetadataRecursivelyFromMap() {\n    var data =\n        Map.of(\n            \"one\",\n            1,\n            \"two\",\n            Map.of(\n                \"a\", \"b\",\n                \"c\", \"d\"));\n\n    var metadata = new Metadata(data);\n\n    assertThat(metadata.getInt(\"one\"), is(1));\n\n    Metadata two = metadata.getMetadata(\"two\");\n    assertThat(two.getString(\"a\"), is(\"b\"));\n  }\n\n  @Test\n  void initialisesParametersRecursivelyFromMap() {\n    var data =\n        Map.of(\n            \"one\",\n            1,\n            \"two\",\n            Map.of(\n                \"a\", \"b\",\n                \"c\", \"d\"));\n\n    var parameters = new Parameters(data);\n\n    assertThat(parameters.getInt(\"one\"), is(1));\n\n    Parameters two = parameters.getParameters(\"two\");\n    assertThat(two.getString(\"a\"), is(\"b\"));\n  }\n\n  @Test\n  void initialisesParametersRecursivelyFromJson() {\n    var json =\n        // language=json\n        \"\"\"\n        {\n          \"one\": 1,\n          \"two\": {\n            \"a\": \"b\",\n            \"c\": \"d\",\n            \"three\": {\n              \"e\": \"f\"\n            }\n          }\n        }\n        \"\"\";\n\n    var parameters = Json.read(json, Parameters.class);\n\n    assertThat(parameters.getInt(\"one\"), is(1));\n\n    Parameters two = parameters.getParameters(\"two\");\n    assertThat(two.getString(\"a\"), is(\"b\"));\n\n    Parameters three = (Parameters) two.get(\"three\");\n    assertThat(three.getString(\"e\"), is(\"f\"));\n  }\n\n  @Test\n  void transformBasedMetadataAttributeMethodPreservesExistingData() {\n    var metadata =\n        Metadata.create(\n            builder ->\n                builder.attr(\"one\", 1).attr(\"two\", attrBuilder -> attrBuilder.attr(\"three\", 3)));\n\n    var transformed =\n        metadata.transform(\n            builder -> builder.attr(\"two\", attrBuilder -> attrBuilder.attr(\"four\", 4)));\n\n    assertThat(transformed.getInt(\"one\"), is(1));\n\n    var two = transformed.getMetadata(\"two\");\n    assertThat(two.getInt(\"three\"), is(3));\n    assertThat(two.getInt(\"four\"), is(4));\n  }\n\n  @Test\n  void supportsInitialisationFromANullMap() {\n    assertDoesNotThrow(() -> new Metadata(null));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/NetworkAddressRangeTest.java",
    "content": "/*\n * Copyright (C) 2022 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport org.junit.jupiter.api.Test;\n\npublic class NetworkAddressRangeTest {\n\n  @Test\n  void singleIpAddress() {\n    NetworkAddressRange exclusion = NetworkAddressRange.of(\"10.1.2.3\");\n\n    assertThat(exclusion.isIncluded(\"10.1.2.3\"), is(true));\n    assertThat(exclusion.isIncluded(\"10.3.2.1\"), is(false));\n  }\n\n  @Test\n  void ipAddressRange() {\n    NetworkAddressRange exclusion = NetworkAddressRange.of(\"10.1.1.1-10.1.2.2\");\n\n    assertThat(exclusion.isIncluded(\"10.1.1.1\"), is(true));\n    assertThat(exclusion.isIncluded(\"10.1.2.2\"), is(true));\n    assertThat(exclusion.isIncluded(\"10.1.1.254\"), is(true));\n    assertThat(exclusion.isIncluded(\"10.1.2.1\"), is(true));\n\n    assertThat(exclusion.isIncluded(\"10.3.2.1\"), is(false));\n    assertThat(exclusion.isIncluded(\"10.1.1.0\"), is(false));\n    assertThat(exclusion.isIncluded(\"10.1.2.3\"), is(false));\n  }\n\n  @Test\n  void exactDomainName() {\n    NetworkAddressRange exclusion = NetworkAddressRange.of(\"my.stuff.wiremock.org\");\n\n    assertThat(exclusion.isIncluded(\"my.stuff.wiremock.org\"), is(true));\n    assertThat(exclusion.isIncluded(\"notmy.stuff.wiremock.org\"), is(false));\n  }\n\n  @Test\n  void domainNameWithWholeNameWildcard() {\n    NetworkAddressRange exclusion = NetworkAddressRange.of(\"*.stuff.wiremock.org\");\n\n    assertThat(exclusion.isIncluded(\"my.stuff.wiremock.org\"), is(true));\n    assertThat(exclusion.isIncluded(\"alsomy.stuff.wiremock.org\"), is(true));\n    assertThat(exclusion.isIncluded(\"notmy.things.wiremock.org\"), is(false));\n  }\n\n  @Test\n  void domainNameWithPartialNameWildcard() {\n    NetworkAddressRange exclusion = NetworkAddressRange.of(\"my.*uff.wiremock.org\");\n\n    assertThat(exclusion.isIncluded(\"my.stuff.wiremock.org\"), is(true));\n    assertThat(exclusion.isIncluded(\"my.fluff.wiremock.org\"), is(true));\n    assertThat(exclusion.isIncluded(\"notmy.stuff.wiremock.org\"), is(false));\n  }\n\n  @Test\n  void ipAddressResolvedFromDomainName() {\n    NetworkAddressRange exclusion = NetworkAddressRange.of(\"127.0.0.1\");\n    assertThat(exclusion.isIncluded(\"localhost\"), is(true));\n  }\n\n  @Test\n  void ipRangeResolvedFromDomainName() {\n    NetworkAddressRange exclusion = NetworkAddressRange.of(\"127.0.0.1-127.0.0.255\");\n    assertThat(exclusion.isIncluded(\"localhost\"), is(true));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/NetworkAddressRulesTest.java",
    "content": "/*\n * Copyright (C) 2022-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport org.junit.jupiter.api.Test;\n\npublic class NetworkAddressRulesTest {\n\n  @Test\n  void allowsAddressIncludedAndNotExcluded() {\n    NetworkAddressRules rules =\n        NetworkAddressRules.builder()\n            .allow(\"10.1.1.1-10.2.1.1\")\n            .allow(\"192.168.1.1-192.168.2.1\")\n            .deny(\"10.1.2.3\")\n            .deny(\"10.5.5.5\")\n            .build();\n\n    assertThat(rules.isAllowed(\"192.168.1.111\"), is(true));\n\n    assertThat(rules.isAllowed(\"10.1.2.1\"), is(true));\n    assertThat(rules.isAllowed(\"10.1.2.3\"), is(false));\n    assertThat(rules.isAllowed(\"10.5.5.5\"), is(false));\n  }\n\n  @Test\n  void onlyAllowSingleIp() {\n    NetworkAddressRules rules = NetworkAddressRules.builder().allow(\"10.1.1.1\").build();\n\n    assertThat(rules.isAllowed(\"10.1.1.1\"), is(true));\n    assertThat(rules.isAllowed(\"10.1.1.0\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.2\"), is(false));\n  }\n\n  @Test\n  void onlyDenySingleIp() {\n    NetworkAddressRules rules = NetworkAddressRules.builder().deny(\"10.1.1.1\").build();\n\n    assertThat(rules.isAllowed(\"10.1.1.1\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.0\"), is(true));\n    assertThat(rules.isAllowed(\"10.1.1.2\"), is(true));\n  }\n\n  @Test\n  void allowAndDenySingleIps() {\n    NetworkAddressRules rules =\n        NetworkAddressRules.builder().deny(\"10.1.1.1\").allow(\"10.1.1.3\").build();\n\n    assertThat(rules.isAllowed(\"10.1.1.0\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.1\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.2\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.3\"), is(true));\n    assertThat(rules.isAllowed(\"10.1.1.4\"), is(false));\n  }\n\n  @Test\n  void allowRangeAndDenySingleIp() {\n    NetworkAddressRules rules =\n        NetworkAddressRules.builder().allow(\"10.1.1.1-10.1.1.3\").deny(\"10.1.1.2\").build();\n\n    assertThat(rules.isAllowed(\"10.1.1.0\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.1\"), is(true));\n    assertThat(rules.isAllowed(\"10.1.1.2\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.3\"), is(true));\n    assertThat(rules.isAllowed(\"10.1.1.4\"), is(false));\n  }\n\n  @Test\n  void denyRangeAndAllowSingleIp() {\n    NetworkAddressRules rules =\n        NetworkAddressRules.builder().deny(\"10.1.1.1-10.1.1.3\").allow(\"10.1.1.2\").build();\n\n    assertThat(rules.isAllowed(\"10.1.1.0\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.1\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.2\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.3\"), is(false));\n    assertThat(rules.isAllowed(\"10.1.1.4\"), is(false));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/ProxySettingsTest.java",
    "content": "/*\n * Copyright (C) 2018-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.emptyOrNullString;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.ValueSource;\n\n@SuppressWarnings(\"HttpUrlsUsage\")\npublic class ProxySettingsTest {\n\n  public static final String PROXYVIA_URL = \"a.proxyvia.url\";\n  public static final int PROXYVIA_PORT = 8080;\n  public static final String PROXYVIA_URL_WITH_PORT = PROXYVIA_URL + \":\" + PROXYVIA_PORT;\n  public static final int DEFAULT_PORT = 80;\n  public static final String USER = \"user\";\n  public static final String PASSWORD = \"pass\";\n\n  @Test\n  public void shouldRetrieveProxySettingsFromString() {\n    ProxySettings proxySettings = ProxySettings.fromString(PROXYVIA_URL_WITH_PORT);\n    assertThat(proxySettings.host(), is(PROXYVIA_URL));\n    assertThat(proxySettings.port(), is(PROXYVIA_PORT));\n  }\n\n  @Test\n  public void shouldUse80AsDefaultPort() {\n    ProxySettings proxySettings = ProxySettings.fromString(PROXYVIA_URL);\n    assertThat(proxySettings.host(), is(PROXYVIA_URL));\n    assertThat(proxySettings.port(), is(DEFAULT_PORT));\n  }\n\n  @Test\n  public void shouldRecognizeUrlWithTrailingSlashIsPresent() {\n    ProxySettings proxySettings = ProxySettings.fromString(PROXYVIA_URL_WITH_PORT + \"/\");\n    assertThat(proxySettings.host(), is(PROXYVIA_URL));\n    assertThat(proxySettings.port(), is(PROXYVIA_PORT));\n  }\n\n  @Test\n  public void shouldThrowExceptionIfPortIsNotRecognized() {\n    var ex =\n        assertThrows(\n            IllegalArgumentException.class, () -> ProxySettings.fromString(PROXYVIA_URL + \":80a\"));\n    assertThat(\n        ex.getMessage(),\n        is(\n            \"'a.proxyvia.url:80a' could not be parsed as a proxy URL with or without an 'http://' prefix\"));\n    assertThat(ex.getCause().getMessage(), is(\"Illegal absolute url: `a.proxyvia.url:80a`\"));\n    assertThat(\n        ex.getSuppressed()[0].getCause().getMessage(),\n        is(\"Illegal authority: `a.proxyvia.url:80a`\"));\n  }\n\n  @Test\n  public void shouldRetrieveProxyCredsFromUrl() {\n    ProxySettings proxySettings =\n        ProxySettings.fromString(USER + \":\" + PASSWORD + \"@\" + PROXYVIA_URL);\n    assertThat(proxySettings.host(), is(PROXYVIA_URL));\n    assertThat(proxySettings.port(), is(DEFAULT_PORT));\n    assertThat(proxySettings.getUsername(), is(USER));\n    assertThat(proxySettings.getPassword(), is(PASSWORD));\n  }\n\n  @Test\n  public void shouldRetrieveProxyCredsAndPortFromUrl() {\n    ProxySettings proxySettings =\n        ProxySettings.fromString(USER + \":\" + PASSWORD + \"@\" + PROXYVIA_URL_WITH_PORT);\n    assertThat(proxySettings.host(), is(PROXYVIA_URL));\n    assertThat(proxySettings.port(), is(PROXYVIA_PORT));\n    assertThat(proxySettings.getUsername(), is(USER));\n    assertThat(proxySettings.getPassword(), is(PASSWORD));\n  }\n\n  @Test\n  public void shouldRetrieveProxyCredsWithOnlyUserFromUrl() {\n    ProxySettings proxySettings = ProxySettings.fromString(USER + \"@\" + PROXYVIA_URL);\n    assertThat(proxySettings.host(), is(PROXYVIA_URL));\n    assertThat(proxySettings.port(), is(DEFAULT_PORT));\n    assertThat(proxySettings.getUsername(), is(USER));\n    assertThat(proxySettings.getPassword(), is(emptyOrNullString()));\n  }\n\n  @Test\n  public void shouldAllowProtocol() {\n    ProxySettings proxySettings = ProxySettings.fromString(\"http://\" + PROXYVIA_URL_WITH_PORT);\n    assertThat(proxySettings.host(), is(PROXYVIA_URL));\n    assertThat(proxySettings.port(), is(PROXYVIA_PORT));\n  }\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"http\", \"https\"})\n  public void shouldRejectInvalidUrisWithHttpProtocol(String scheme) {\n    var ex =\n        assertThrows(\n            IllegalArgumentException.class,\n            () -> ProxySettings.fromString(scheme + \"://\" + PROXYVIA_URL + \":notanumber\"));\n    assertThat(\n        ex.getMessage(),\n        is(\"'\" + scheme + \"://a.proxyvia.url:notanumber' could not be parsed as a proxy URL\"));\n    assertThat(\n        ex.getCause().getMessage(),\n        is(\"Illegal uri: `\" + scheme + \"://a.proxyvia.url:notanumber`\"));\n  }\n\n  @Test\n  public void shouldNotAllowHttpsProtocol() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> ProxySettings.fromString(\"https://\" + PROXYVIA_URL_WITH_PORT));\n  }\n\n  @Test\n  public void shouldThrowExceptionIfUrlIsInvalid() {\n    assertThrows(IllegalArgumentException.class, () -> ProxySettings.fromString(\"ul:invalid:80\"));\n  }\n\n  @Test\n  public void shouldParseSchemelessUriWithUserInfoAndPort() {\n    ProxySettings proxySettings = ProxySettings.fromString(\"bob@doesnotexist.example.com:321\");\n    assertThat(proxySettings.getUsername(), is(\"bob\"));\n    assertThat(proxySettings.host(), is(\"doesnotexist.example.com\"));\n    assertThat(proxySettings.port(), is(321));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/SingleRootFileSourceTest.java",
    "content": "/*\n * Copyright (C) 2011-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.filePath;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.fileNamed;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.hasExactlyIgnoringOrder;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.security.NotAuthorisedException;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.io.TempDir;\n\npublic class SingleRootFileSourceTest {\n\n  public static final String EXIST_FILES_ROOT_PATH = filePath(\"filesource\");\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  void listsTextFilesRecursively() {\n    SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n\n    List<TextFile> files = fileSource.listFilesRecursively();\n\n    assertThat(\n        files,\n        hasExactlyIgnoringOrder(\n            fileNamed(\"one\"),\n            fileNamed(\"two\"),\n            fileNamed(\"three\"),\n            fileNamed(\"four\"),\n            fileNamed(\"five\"),\n            fileNamed(\"six\"),\n            fileNamed(\"seven\"),\n            fileNamed(\"eight\"),\n            fileNamed(\"deepfile.json\")));\n  }\n\n  @Test\n  void writesTextFileEvenWhenRootIsARelativePath() {\n    String relativeRootPath = \"./target/tmp/\";\n    new File(String.valueOf(Paths.get(relativeRootPath).toAbsolutePath())).mkdirs();\n    SingleRootFileSource fileSource = new SingleRootFileSource(relativeRootPath);\n    Path fileAbsolutePath = Paths.get(relativeRootPath).toAbsolutePath().resolve(\"myFile\");\n    fileSource.writeTextFile(fileAbsolutePath.toString(), \"stuff\");\n\n    assertThat(Files.exists(fileAbsolutePath), is(true));\n  }\n\n  @Test\n  void lazilyCreatesTheRootDirectorWhenTextWriteAttempted(@TempDir Path tempDir) {\n    SingleRootFileSource fileSource =\n        new SingleRootFileSource(new File(tempDir.toFile(), \"child-dir\"));\n\n    File childDir = tempDir.resolve(\"child-dir\").toFile();\n\n    assertFalse(childDir.exists(), \"The child directory shouldn't exist yet\");\n\n    fileSource.writeTextFile(\"my-file\", \"My text\");\n    assertTrue(childDir.exists(), \"The child directory should exist after write attempt\");\n  }\n\n  @Test\n  void lazilyCreatesTheRootDirectorWhenBinaryWriteAttempted(@TempDir Path tempDir) {\n    SingleRootFileSource fileSource =\n        new SingleRootFileSource(new File(tempDir.toFile(), \"child-dir\"));\n\n    File childDir = tempDir.resolve(\"child-dir\").toFile();\n\n    assertFalse(childDir.exists(), \"The child directory shouldn't exist yet\");\n\n    fileSource.writeBinaryFile(\"my-file\", \"My text\".getBytes());\n    assertTrue(childDir.exists(), \"The child directory should exist after write attempt\");\n  }\n\n  @Test\n  void listFilesRecursivelyThrowsExceptionWhenRootIsNotDir() {\n    assertThrows(\n        RuntimeException.class,\n        () -> {\n          SingleRootFileSource fileSource =\n              new SingleRootFileSource(\"src/test/resources/filesource/one\");\n          fileSource.listFilesRecursively();\n        });\n  }\n\n  @Test\n  void writeThrowsExceptionWhenRootIsNotDir() {\n    assertThrows(\n        RuntimeException.class,\n        () -> {\n          SingleRootFileSource fileSource =\n              new SingleRootFileSource(\"src/test/resources/filesource/one\");\n          fileSource.writeTextFile(\"thing\", \"stuff\");\n        });\n  }\n\n  @Test\n  void listFilesRecursivelyThrowsExceptionWhenLastPathNodeIsSimilarToRootButWithExtraCharacters() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource =\n              new SingleRootFileSource(\"src/test/resources/security-filesource/root\");\n          fileSource.getBinaryFileNamed(\"../rootdir/file.json\");\n        });\n  }\n\n  @Test\n  void writeTextFileThrowsExceptionWhenGivenRelativePathNotUnderRoot() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n          fileSource.writeTextFile(\"..\", \"stuff\");\n        });\n  }\n\n  @Test\n  void writeTextFileThrowsExceptionWhenGivenAbsolutePathNotUnderRoot() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n          String badPath = Paths.get(\"..\", \"not-under-root\").toAbsolutePath().toString();\n          fileSource.writeTextFile(badPath, \"stuff\");\n        });\n  }\n\n  @Test\n  void writeBinaryFileThrowsExceptionWhenGivenRelativePathNotUnderRoot() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n          fileSource.writeBinaryFile(\"..\", \"stuff\".getBytes());\n        });\n  }\n\n  @Test\n  void writeBinaryFileThrowsExceptionWhenGivenAbsolutePathNotUnderRoot() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n          String badPath = Paths.get(\"..\", \"not-under-root\").toAbsolutePath().toString();\n          fileSource.writeBinaryFile(badPath, \"stuff\".getBytes());\n        });\n  }\n\n  @Test\n  void deleteThrowsExceptionWhenGivenPathNotUnderRoot() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n          String badPath = Paths.get(\"..\", \"not-under-root\").toAbsolutePath().toString();\n          fileSource.deleteFile(badPath);\n        });\n  }\n\n  @Test\n  void readBinaryFileThrowsExceptionWhenRelativePathIsOutsideRoot() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n          fileSource.getBinaryFileNamed(\"../illegal.file\");\n        });\n  }\n\n  @Test\n  void readTextFileThrowsExceptionWhenRelativePathIsOutsideRoot() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n          fileSource.getTextFileNamed(\"../illegal.file\");\n        });\n  }\n\n  @Test\n  public void readBinaryFileThrowsExceptionWhenAbsolutePathIsOutsideRoot() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n          String badPath = new File(EXIST_FILES_ROOT_PATH, \"../illegal.file\").getCanonicalPath();\n          fileSource.getBinaryFileNamed(badPath);\n        });\n  }\n\n  @Test\n  void readTextFileThrowsExceptionWhenAbsolutePathIsOutsideRoot() {\n    assertThrows(\n        NotAuthorisedException.class,\n        () -> {\n          SingleRootFileSource fileSource = new SingleRootFileSource(EXIST_FILES_ROOT_PATH);\n          String badPath = new File(EXIST_FILES_ROOT_PATH, \"../illegal.file\").getCanonicalPath();\n          fileSource.getTextFileNamed(badPath);\n        });\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/SortedConcurrentPrioritisableSetTest.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.ANY;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.hasExactly;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.Iterator;\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.TypeSafeMatcher;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class SortedConcurrentPrioritisableSetTest {\n\n  private SortedConcurrentPrioritisableSet<StubMapping> mappingSet;\n\n  @BeforeEach\n  public void init() {\n    mappingSet = new SortedConcurrentPrioritisableSet<>();\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  public void returnsMappingsInPriorityThenInsertionOrder() {\n    mappingSet.add(aMapping(3, \"/priority3/1\"));\n    mappingSet.add(aMapping(3, \"/priority3/2\"));\n    mappingSet.add(aMapping(6, \"/priority6/1\"));\n    mappingSet.add(aMapping(1, \"/priority1/1\"));\n    mappingSet.add(aMapping(1, \"/priority1/2\"));\n    mappingSet.add(aMapping(1, \"/priority1/3\"));\n\n    assertThat(\n        mappingSet,\n        hasExactly(\n            requestUrlIs(\"/priority1/3\"),\n            requestUrlIs(\"/priority1/2\"),\n            requestUrlIs(\"/priority1/1\"),\n            requestUrlIs(\"/priority3/2\"),\n            requestUrlIs(\"/priority3/1\"),\n            requestUrlIs(\"/priority6/1\")));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  public void supportsNullPriority() {\n    mappingSet.add(aMapping(null, \"/1\"));\n    mappingSet.add(aMapping(null, \"/2\"));\n    mappingSet.add(aMapping(null, \"/3\"));\n    mappingSet.add(aMapping(null, \"/4\"));\n\n    assertThat(\n        mappingSet,\n        hasExactly(requestUrlIs(\"/4\"), requestUrlIs(\"/3\"), requestUrlIs(\"/2\"), requestUrlIs(\"/1\")));\n  }\n\n  @Test\n  public void clearsCorrectly() {\n    mappingSet.add(aMapping(3, \"/priority3/1\"));\n    mappingSet.add(aMapping(3, \"/priority3/2\"));\n    mappingSet.add(aMapping(6, \"/priority6/1\"));\n    mappingSet.add(aMapping(1, \"/priority1/1\"));\n\n    mappingSet.clear();\n\n    assertThat(\"Mapping set should be empty\", mappingSet.iterator().hasNext(), is(false));\n  }\n\n  @Test\n  public void testRemove() throws Exception {\n\n    StubMapping stubMapping = aMapping(1, \"/priority1/1\");\n\n    mappingSet.add(stubMapping);\n    assertThat(mappingSet.iterator().hasNext(), is(true));\n\n    mappingSet.remove(stubMapping.getId());\n    assertThat(mappingSet.iterator().hasNext(), is(false));\n  }\n\n  @Test\n  public void testReplace() throws Exception {\n\n    StubMapping existingMapping = aMapping(1, \"/priority1/1\");\n    mappingSet.add(existingMapping);\n\n    existingMapping = existingMapping.transform(b -> b.setNewScenarioState(\"New Scenario State\"));\n\n    StubMapping newMapping = aMapping(2, \"/priority2/1\");\n    mappingSet.replace(existingMapping, newMapping);\n\n    Iterator<StubMapping> it = mappingSet.iterator();\n\n    assertThat(it.hasNext(), is(true));\n    assertThat(it.next(), is(newMapping));\n    assertThat(it.hasNext(), is(false));\n  }\n\n  @Test\n  public void testReplaceNotExists() throws Exception {\n\n    StubMapping existingMapping = aMapping(1, \"/priority1/1\");\n    mappingSet.add(existingMapping);\n\n    StubMapping newMapping = aMapping(2, \"/priority2/1\");\n    mappingSet.replace(aMapping(2, \"/priority2/2\"), newMapping);\n\n    Iterator<StubMapping> it = mappingSet.iterator();\n\n    assertThat(it.hasNext(), is(true));\n    assertThat(it.next(), is(existingMapping));\n    assertThat(it.hasNext(), is(false));\n  }\n\n  private StubMapping aMapping(Integer priority, String url) {\n    RequestPattern requestPattern = newRequestPattern(ANY, urlEqualTo(url)).build();\n\n    return StubMapping.builder()\n        .setRequest(requestPattern)\n        .setResponse(responseDefinition().build())\n        .setPriority(priority)\n        .build();\n  }\n\n  private Matcher<StubMapping> requestUrlIs(final String expectedUrl) {\n    return new TypeSafeMatcher<StubMapping>() {\n\n      @Override\n      public void describeTo(Description desc) {}\n\n      @Override\n      public boolean matchesSafely(StubMapping actualMapping) {\n        return actualMapping.getRequest().getUrl().equals(expectedUrl);\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/TextFileTest.java",
    "content": "/*\n * Copyright (C) 2017-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport java.net.URI;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.EnabledOnOs;\nimport org.junit.jupiter.api.condition.OS;\n\npublic class TextFileTest {\n  @Test\n  @DisabledOnOs(\n      value = OS.WINDOWS,\n      disabledReason = \"This test can only be run on non-Windows \" + \"its behaviour is OS specific\")\n  public void returnsPathToFileOnLinuxSystems() throws Exception {\n    TextFile textFile = new TextFile(new URI(\"file://home/bob/myfile.txt\"));\n\n    String path = textFile.getPath();\n\n    assertEquals(\"/home/bob/myfile.txt\", path);\n  }\n\n  @Test\n  @EnabledOnOs(\n      value = OS.WINDOWS,\n      disabledReason =\n          \"This test can only be run on Windows \"\n              + \"because File uses FileSystem in its constructor \"\n              + \"and its behaviour is OS specific\")\n  public void returnsPathToFileOnWindowsSystems() throws Exception {\n    TextFile textFile = new TextFile(new URI(\"file:/C:/Users/bob/myfile.txt\"));\n\n    Path path = Paths.get(textFile.getPath());\n\n    assertEquals(Paths.get(\"C:/Users/bob/myfile.txt\"), path);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/UrlsTest.java",
    "content": "/*\n * Copyright (C) 2014-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.http.QueryParameter;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\nimport org.wiremock.url.Url;\n\npublic class UrlsTest {\n\n  private Map<String, QueryParameter> params;\n\n  @Test\n  public void copesWithEqualsInParamValues() {\n    params =\n        Urls.toQueryParameterMap(\n            Url.parse(\"/thing?param1=one&param2=one==two=three\").getQueryOrEmpty());\n    assertThat(params.get(\"param1\").firstValue(), is(\"one\"));\n    assertThat(params.get(\"param2\").firstValue(), is(\"one==two=three\"));\n  }\n\n  @Test\n  public void returnsEmptyStringsAsValuesWhenOnlyKeysArePresent() {\n    params = Urls.toQueryParameterMap(Url.parse(\"/thing?param1&param2&param3\").getQueryOrEmpty());\n    assertThat(params.get(\"param1\").firstValue(), is(\"\"));\n    assertThat(params.get(\"param2\").firstValue(), is(\"\"));\n    assertThat(params.get(\"param3\").firstValue(), is(\"\"));\n  }\n\n  @Test\n  public void supportsMultiValuedParameters() {\n    params =\n        Urls.toQueryParameterMap(\n            Url.parse(\"/thing?param1=1&param2=two&param1=2&param1=3\").getQueryOrEmpty());\n    assertThat(params.size(), is(2));\n    assertThat(params.get(\"param1\").isSingleValued(), is(false));\n    assertThat(params.get(\"param1\").values(), hasItems(\"1\", \"2\", \"3\"));\n  }\n\n  @Test\n  public void doesNotAttemptToDoubleDecodeSplitQueryString() {\n    Map<String, QueryParameter> query =\n        Urls.toQueryParameterMap(Url.parse(\"/thing?q=a%25b\").getQueryOrEmpty());\n    assertThat(query.get(\"q\").firstValue(), is(\"a%b\"));\n  }\n\n  @Test\n  public void splitsQueryFromUrl() {\n    Map<String, QueryParameter> query =\n        Urls.toQueryParameterMap(Url.parse(\"/a/b?one=1&one=11&two=2\").getQueryOrEmpty());\n\n    List<String> oneValues = query.get(\"one\").values();\n    assertThat(oneValues, hasItems(\"1\", \"11\"));\n    assertThat(oneValues, hasItem(\"11\"));\n    assertThat(query.get(\"two\").firstValue(), is(\"2\"));\n  }\n\n  @Test\n  public void splitsQueryFromUrlWithTrailingSlash() {\n    Map<String, QueryParameter> query =\n        Urls.toQueryParameterMap(Url.parse(\"/a/b/?one=1&one=11&two=2\").getQueryOrEmpty());\n\n    List<String> oneValues = query.get(\"one\").values();\n    assertThat(oneValues, hasItems(\"1\", \"11\"));\n    assertThat(oneValues, hasItem(\"11\"));\n    assertThat(query.get(\"two\").firstValue(), is(\"2\"));\n  }\n\n  @Test\n  public void splitQueryFromUrlHandlesUrlThatEndsWithQuestionMark() {\n    Map<String, QueryParameter> query =\n        Urls.toQueryParameterMap(Url.parse(\"/a/b/?\").getQueryOrEmpty());\n    assertThat(query.isEmpty(), is(true));\n  }\n\n  @Test\n  public void splitQueryFromUrlReturnsEmptyWhenNoQuery() {\n    Map<String, QueryParameter> query =\n        Urls.toQueryParameterMap(Url.parse(\"/a/b\").getQueryOrEmpty());\n    assertThat(query.isEmpty(), is(true));\n  }\n\n  @Test\n  public void splitQueryFromUrlReturnsEmptyWhenTrailingSlashAndNoQuery() {\n    Map<String, QueryParameter> query =\n        Urls.toQueryParameterMap(Url.parse(\"/a/b/\").getQueryOrEmpty());\n    assertThat(query.isEmpty(), is(true));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/VeryShortIdGeneratorTest.java",
    "content": "/*\n * Copyright (C) 2011-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.matches;\nimport static org.hamcrest.MatcherAssert.assertThat;\n\nimport org.junit.jupiter.api.Test;\n\npublic class VeryShortIdGeneratorTest {\n\n  @Test\n  public void IdsGeneratedContainOnlyLegalCharsAndAreRightLength() {\n    final IdGenerator generator = new VeryShortIdGenerator();\n\n    for (int i = 0; i < 1000; i++) {\n      final String id = generator.generate();\n      assertThat(id, matches(\"[A-Za-z0-9]{5}\"));\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/entity/EntityDefinitionSerializationTest.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport static com.github.tomakehurst.wiremock.common.entity.BinaryEntityDefinition.aBinaryMessage;\nimport static com.github.tomakehurst.wiremock.common.entity.TextEntityDefinition.aTextMessage;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.util.Base64;\nimport org.junit.jupiter.api.Test;\n\npublic class EntityDefinitionSerializationTest {\n\n  @Test\n  void stringEntityDefinitionSerializesCorrectly() {\n    StringEntityDefinition entity = new StringEntityDefinition(\"test message\");\n\n    String json = Json.write(entity);\n\n    assertThat(json, is(\"\\\"test message\\\"\"));\n  }\n\n  @Test\n  void stringEntityDefinitionDeserializesCorrectly() {\n    String json = \"\\\"test message\\\"\";\n\n    EntityDefinition entity = Json.read(json, EntityDefinition.class);\n\n    assertThat(entity, is(new StringEntityDefinition(\"test message\")));\n  }\n\n  @Test\n  void stringEntityDefinitionRoundTripSerialization() {\n    StringEntityDefinition original = new StringEntityDefinition(\"simple string\");\n\n    String json = Json.write(original);\n    EntityDefinition deserialized = Json.read(json, EntityDefinition.class);\n\n    assertEquals(original, deserialized);\n  }\n\n  @Test\n  void textEntityDefinitionSerializesWithLowercaseEnums() {\n    TextEntityDefinition entity =\n        aTextMessage()\n            .withFormat(FormatType.XML)\n            .withCompression(CompressionType.GZIP)\n            .withBody(\"test data\")\n            .build();\n\n    String json = Json.write(entity);\n\n    String expectedJson =\n        \"\"\"\n        {\n          \"format\" : \"xml\",\n          \"compression\" : \"gzip\",\n          \"data\" : \"test data\"\n        }\n        \"\"\";\n\n    assertThat(json, jsonEquals(expectedJson));\n  }\n\n  @Test\n  void textEntityDefinitionDeserializesWithLowercaseEnums() {\n    String json =\n        \"\"\"\n        {\n          \"format\" : \"yaml\",\n          \"compression\" : \"brotli\",\n          \"data\" : \"test data\"\n        }\n        \"\"\";\n\n    EntityDefinition entity = Json.read(json, EntityDefinition.class);\n\n    TextEntityDefinition textEntity = (TextEntityDefinition) entity;\n    assertThat(textEntity.getFormat(), is(FormatType.YAML));\n    assertThat(textEntity.getCompression(), is(CompressionType.BROTLI));\n    assertThat(textEntity.getData(), is(\"test data\"));\n  }\n\n  @Test\n  void textEntityDefinitionWithDefaultsOmitsEnums() {\n    TextEntityDefinition entity = aTextMessage().withBody(\"test data\").build();\n\n    String json = Json.write(entity);\n\n    String expectedJson = \"\"\"\n        {\n          \"data\" : \"test data\"\n        }\n        \"\"\";\n\n    assertThat(json, jsonEquals(expectedJson));\n  }\n\n  @Test\n  void textEntityDefinitionRoundTripSerialization() {\n    TextEntityDefinition original =\n        aTextMessage()\n            .withFormat(FormatType.JSON)\n            .withCompression(CompressionType.GZIP)\n            .withBody(\"{\\\"key\\\":\\\"value\\\"}\")\n            .build();\n\n    String json = Json.write(original);\n    EntityDefinition deserialized = Json.read(json, EntityDefinition.class);\n\n    assertEquals(original, deserialized);\n  }\n\n  @Test\n  void binaryEntityDefinitionSerializesWithLowercaseEnums() {\n    byte[] data = {1, 2, 3, 4, 5};\n    BinaryEntityDefinition entity =\n        aBinaryMessage().withCompression(CompressionType.DEFLATE).withBody(data).build();\n\n    String json = Json.write(entity);\n\n    String expectedJson =\n        \"\"\"\n        {\n          \"encoding\" : \"binary\",\n          \"compression\" : \"deflate\",\n          \"data\" : \"%s\"\n        }\n        \"\"\"\n            .formatted(Base64.getEncoder().encodeToString(data));\n\n    assertThat(json, jsonEquals(expectedJson));\n  }\n\n  @Test\n  void binaryEntityDefinitionDeserializesWithLowercaseEnums() {\n    byte[] data = {10, 20, 30};\n    String json =\n        \"\"\"\n        {\n          \"encoding\" : \"binary\",\n          \"compression\" : \"gzip\",\n          \"data\" : \"%s\"\n        }\n        \"\"\"\n            .formatted(Base64.getEncoder().encodeToString(data));\n\n    EntityDefinition entity = Json.read(json, EntityDefinition.class);\n\n    BinaryEntityDefinition binaryEntity = (BinaryEntityDefinition) entity;\n    assertThat(binaryEntity.getEncoding(), is(EncodingType.BINARY));\n    assertThat(binaryEntity.getCompression(), is(CompressionType.GZIP));\n    assertThat(binaryEntity.getDataAsBytes(), is(data));\n  }\n\n  @Test\n  void binaryEntityDefinitionRoundTripSerialization() {\n    byte[] data = {1, 2, 3, 4, 5, 6, 7, 8};\n    BinaryEntityDefinition original =\n        aBinaryMessage().withCompression(CompressionType.BROTLI).withBody(data).build();\n\n    String json = Json.write(original);\n    EntityDefinition deserialized = Json.read(json, EntityDefinition.class);\n\n    assertEquals(original, deserialized);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/ssl/KeyStoreSettingsTest.java",
    "content": "/*\n * Copyright (C) 2018-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.ssl;\n\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.*;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport java.security.KeyStore;\nimport org.junit.jupiter.api.Test;\n\nclass KeyStoreSettingsTest {\n\n  @Test\n  void loadsTrustStoreFromClasspath() {\n    KeyStoreSettings trustStoreSettings =\n        new KeyStoreSettings(TRUST_STORE_NAME, TRUST_STORE_PASSWORD, \"jks\");\n\n    KeyStore keyStore = trustStoreSettings.loadStore();\n    assertNotNull(keyStore);\n  }\n\n  @Test\n  void loadsTrustStoreOfTypeJCEKS() {\n    KeyStoreSettings trustStoreSettings =\n        new KeyStoreSettings(JCEKS_TRUST_STORE_NAME, TRUST_STORE_PASSWORD, \"jceks\");\n\n    KeyStore keyStore = trustStoreSettings.loadStore();\n    assertNotNull(keyStore);\n  }\n\n  @Test\n  void loadsTrustStoreFromFilesystem() {\n    KeyStoreSettings trustStoreSettings =\n        new KeyStoreSettings(TRUST_STORE_PATH, TRUST_STORE_PASSWORD, \"jks\");\n\n    KeyStore keyStore = trustStoreSettings.loadStore();\n    assertNotNull(keyStore);\n  }\n\n  @Test\n  void failsWhenTrustStoreNotFound() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> {\n          KeyStoreSettings trustStoreSettings =\n              new KeyStoreSettings(\"test-unknownstore\", \"\", \"jks\");\n          trustStoreSettings.loadStore();\n        });\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/ssl/KeyStoreSourceTest.java",
    "content": "/*\n * Copyright (C) 2020-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.ssl;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.notNullValue;\n\nimport java.security.Key;\nimport java.security.KeyStore;\nimport org.junit.jupiter.api.Test;\n\nclass KeyStoreSourceTest {\n\n  @Test\n  void loadsAPasswordProtectedJksKeyStore() throws Exception {\n    KeyStoreSource keyStoreSource =\n        new ReadOnlyFileOrClasspathKeyStoreSource(\n            \"test-keystore-pwd\", \"jks\", \"nondefaultpass\".toCharArray());\n\n    KeyStore keyStore = keyStoreSource.load();\n\n    Key key = keyStore.getKey(\"server\", \"password\".toCharArray());\n    assertThat(key, notNullValue());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/url/PathTemplateTest.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.url;\n\nimport static java.lang.String.format;\nimport static java.util.Arrays.asList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport java.util.ArrayList;\nimport java.util.LinkedHashSet;\nimport java.util.List;\nimport java.util.Set;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.CsvSource;\n\nclass PathTemplateTest {\n\n  @Test\n  void extractsSinglePathParameter() {\n    PathTemplate template = new PathTemplate(\"/things/{id}\");\n\n    PathParams pathParams = template.parse(\"/things/11-22-33\");\n\n    assertThat(pathParams.get(\"id\"), is(\"11-22-33\"));\n  }\n\n  @Test\n  void ignoresQueryParameterWhenParsing() {\n    PathTemplate template = new PathTemplate(\"/things/{id}\");\n\n    PathParams pathParams = template.parse(\"/things/11-22-33?a=b\");\n\n    assertThat(pathParams.get(\"id\"), is(\"11-22-33\"));\n  }\n\n  @Test\n  void throwsIllegalArgumentExceptionIfAttemptingParsingOnNonMatchingUrl() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> {\n          PathTemplate template = new PathTemplate(\"/things/{id}\");\n          template.parse(\"/things/stuff/11-22-33\");\n        });\n  }\n\n  @Test\n  void matchesWhenUrlIsEquivalentToTemplate() {\n    PathTemplate template = new PathTemplate(\"/things/{id}/otherthings/{subId}\");\n\n    assertThat(template.matches(\"/things/11-22-33/otherthings/12378\"), is(true));\n  }\n\n  @Test\n  void nonMatchWhenUrlIsShorterThanTemplate() {\n    PathTemplate template = new PathTemplate(\"/things/{id}/otherthings/{subId}\");\n\n    assertThat(template.matches(\"/things/11-22-33/otherthings\"), is(false));\n  }\n\n  @Test\n  void nonMatchWhenUrlPartIsMismatch() {\n    PathTemplate template = new PathTemplate(\"/things/{id}/otherthings/{subId}\");\n\n    assertThat(template.matches(\"/things/11-22-33/other-stuff/1234\"), is(false));\n  }\n\n  @Test\n  void rendersWithParameters() {\n    PathTemplate template = new PathTemplate(\"/things/{id}/otherthings/{subId}\");\n    PathParams pathParams = new PathParams().add(\"id\", \"123\").add(\"subId\", \"456\");\n\n    String path = template.render(pathParams);\n\n    assertThat(path, is(\"/things/123/otherthings/456\"));\n  }\n\n  @Test\n  void rendersWithoutParameters() {\n    PathTemplate template = new PathTemplate(\"/things/stuff\");\n\n    String path = template.render(PathParams.empty());\n\n    assertThat(path, is(\"/things/stuff\"));\n  }\n\n  @Test\n  void throwsErrorWhenNotAllParametersAreBound() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> {\n          PathTemplate template = new PathTemplate(\"/things/{id}/otherthings/{subId}\");\n          template.render(new PathParams().add(\"id\", \"123\"));\n        });\n  }\n\n  @Test\n  void parseWithWildcardAndOneDepthPath() {\n    PathTemplate template = new PathTemplate(\"/things/**\");\n\n    PathParams pathParams = template.parse(\"/things/stuff\");\n\n    assertThat(pathParams.get(\"0\"), is(\"stuff\"));\n  }\n\n  @Test\n  void parseWithWildcardAndTwoDepthPath() {\n    PathTemplate template = new PathTemplate(\"/things/**\");\n\n    PathParams pathParams = template.parse(\"/things/foo/bar\");\n\n    assertThat(pathParams.get(\"0\"), is(\"foo/bar\"));\n  }\n\n  @Test\n  void parseWithVariableAndWildcardAndTwoDepthPath() {\n    PathTemplate template = new PathTemplate(\"/things/{id}/**\");\n\n    PathParams pathParams = template.parse(\"/things/foo/bar\");\n\n    assertThat(pathParams.get(\"id\"), is(\"foo\"));\n    assertThat(pathParams.get(\"0\"), is(\"bar\"));\n  }\n\n  @Test\n  void renderWithWildcardAndOneDepth() {\n    PathTemplate template = new PathTemplate(\"/things/**\");\n    PathParams pathParams = new PathParams().add(\"0\", \"stuff\");\n\n    String path = template.render(pathParams);\n\n    assertThat(path, is(\"/things/stuff\"));\n  }\n\n  @Test\n  void renderWithWildcardAndTwoDepth() {\n    PathTemplate template = new PathTemplate(\"/things/**\");\n    PathParams pathParams = new PathParams().add(\"0\", \"foo/bar\");\n\n    String path = template.render(pathParams);\n\n    assertThat(path, is(\"/things/foo/bar\"));\n  }\n\n  @Test\n  void renderWithVariableAndWildcardAndTwoDepthPath() {\n    PathTemplate template = new PathTemplate(\"/things/{id}/**\");\n    PathParams pathParams = new PathParams().add(\"id\", \"foo\").add(\"0\", \"bar\");\n\n    String path = template.render(pathParams);\n\n    assertThat(path, is(\"/things/foo/bar\"));\n  }\n\n  @Test\n  void throwsErrorWhenNotWildcardParameterIsNotBound() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> {\n          PathTemplate template = new PathTemplate(\"/things/{id}/**\");\n          template.render(new PathParams().add(\"id\", \"123\"));\n        });\n  }\n\n  @Test\n  void checkHashAndEquality() {\n    List<String> templates =\n        asList(\n            \"/things\",\n            \"/things/\",\n            \"/things/**\",\n            \"/things/{id}\",\n            \"/things/{name}\",\n            \"/things/**/\",\n            \"/things/{id}/\",\n            \"/things/{name}/\");\n\n    Set<PathTemplate> uriTemplateSet = new LinkedHashSet<>();\n    for (String template : templates) {\n      PathTemplate uriTemplate = new PathTemplate(template);\n      if (!uriTemplateSet.add(uriTemplate)) {\n        fail(format(\"Can't add '%s' to '%s'\", template, uriTemplateSet));\n      }\n    }\n  }\n\n  @Test\n  void checkEquality() {\n    List<String> templates =\n        asList(\n            \"/things\",\n            \"/things/\",\n            \"/things/**\",\n            \"/things/{id}\",\n            \"/things/{name}\",\n            \"/things/**/\",\n            \"/things/{id}/\",\n            \"/things/{name}/\");\n\n    List<PathTemplate> uriTemplates = new ArrayList<>();\n    for (String template : templates) {\n      PathTemplate uriTemplate = new PathTemplate(template);\n      if (uriTemplates.contains(uriTemplate)) {\n        fail(format(\"Can't add '%s' to '%s'\", template, uriTemplates));\n      }\n      uriTemplates.add(uriTemplate);\n    }\n  }\n\n  @Test\n  void returnsPathTemplateWithVariablesStrippedOut() {\n    PathTemplate pathTemplate = new PathTemplate(\"/one/{first}/two/{second}/three\");\n    assertThat(pathTemplate.withoutVariables(), is(\"/one/_/two/_/three\"));\n  }\n\n  @Test\n  void indicatesWhetherAStringCouldBeAPathTemplate() {\n    assertTrue(PathTemplate.couldBePathTemplate(\"/things/{id}\"));\n    assertTrue(PathTemplate.couldBePathTemplate(\"/things/**\"));\n    assertTrue(PathTemplate.couldBePathTemplate(\"/things/{id}/stuff\"));\n\n    assertFalse(PathTemplate.couldBePathTemplate(\"/things/in/path\"));\n    assertFalse(PathTemplate.couldBePathTemplate(\"/thing\"));\n  }\n\n  @Test\n  void correctlyStripsFormatCharactersFromKeysWhenParsing() {\n    PathTemplate pathTemplate = new PathTemplate(\"/one/{.first}/two/{;second*}\");\n    PathParams pathParams = pathTemplate.parse(\"/one/.3,4,5/two/;second=1;second=2\");\n\n    assertThat(pathParams.get(\"first\"), is(\".3,4,5\"));\n    assertThat(pathParams.get(\"second\"), is(\";second=1;second=2\"));\n  }\n\n  @Test\n  void correctlyStripsFormatCharactersFromKeysWhenRendering() {\n    PathTemplate pathTemplate = new PathTemplate(\"/one/{.first}/two/{;second*}\");\n\n    PathParams pathParams =\n        new PathParams().add(\"first\", \".3,4,5\").add(\"second\", \";second=1;second=2\");\n\n    String renderedUrl = pathTemplate.render(pathParams);\n\n    assertThat(renderedUrl, is(\"/one/.3,4,5/two/;second=1;second=2\"));\n  }\n\n  @Test\n  void ignoresQueryParameterWhenMatching() {\n    PathTemplate pathTemplate = new PathTemplate(\"/things/{thingId}/stuff\");\n    assertTrue(pathTemplate.matches(\"/things/123/stuff?query=param\"));\n  }\n\n  @ParameterizedTest()\n  @CsvSource({\n    \"/things,0\",\n    \"/things/{id},1\",\n    \"/things/{id}/otherthings/{subId},2\",\n    \"/things/stuff,0\",\n    \"/things/**,1\",\n    \"/things/**/,1\",\n    \"/things/{id}/**,2\",\n    \"/things/**/{id},2\",\n    \"/one/{.first}/two/{;second*},2\",\n  })\n  void exposesNumberOfParameters(String template, int expectedNumberOfParameters) {\n    PathTemplate pathTemplate = new PathTemplate(template);\n    assertThat(pathTemplate.numberOfParameters(), is(expectedNumberOfParameters));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/common/xml/XmlTest.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalsMultiLine;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.notNullValue;\n\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport java.util.stream.IntStream;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledForJreRange;\nimport org.junit.jupiter.api.condition.JRE;\n\npublic class XmlTest {\n\n  @Test\n  public void findsSimpleXmlNodesByXPath() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<things>\\n\"\n            + \"    <thing>1</thing>\\n\"\n            + \"    <thing>2</thing>\\n\"\n            + \"</things>\";\n\n    XmlDocument xmlDocument = Xml.parse(xml);\n\n    ListOrSingle<XmlNode> nodes = xmlDocument.findNodes(\"//things/thing/text()\");\n\n    assertThat(nodes.size(), is(2));\n    assertThat(nodes.get(0).toString(), is(\"1\"));\n    assertThat(nodes.get(1).toString(), is(\"2\"));\n  }\n\n  @Test\n  public void findsNamespacedXmlNodeByXPath() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<things xmlns:s=\\\"https://stuff.biz\\\" id=\\\"1\\\">\\n\"\n            + \"    <stuff id=\\\"1\\\"/>\\n\"\n            + \"    <fl:fluff xmlns:fl=\\\"https://fluff.abc\\\" id=\\\"2\\\" fl:group=\\\"555\\\">\\n\"\n            + \"        <fl:inner id=\\\"123\\\" fl:code=\\\"D1\\\">Innards</fl:inner>\\n\"\n            + \"        <fl:inner>More Innards</fl:inner>\\n\"\n            + \"    </fl:fluff>\\n\"\n            + \"</things>\";\n\n    XmlDocument xmlDocument = Xml.parse(xml);\n\n    ListOrSingle<XmlNode> nodes = xmlDocument.findNodes(\"/things/fluff\");\n\n    assertThat(nodes.size(), is(1));\n    assertThat(nodes.get(0).getAttributes().get(\"id\"), is(\"2\"));\n    assertThat(nodes.get(0).getAttributes().get(\"fl:group\"), is(\"555\"));\n  }\n\n  @Test\n  public void prettyPrintsDocument() {\n    String xml = \"<one><two><three name='3'/></two></one>\";\n\n    XmlDocument xmlDocument = Xml.parse(xml);\n\n    assertThat(\n        xmlDocument.toString(),\n        equalsMultiLine(\n            \"<one>\\n\" + \"  <two>\\n\" + \"    <three name=\\\"3\\\"/>\\n\" + \"  </two>\\n\" + \"</one>\\n\"));\n  }\n\n  @Test\n  public void prettyPrintsNodeAttributeValue() {\n    String xml = \"<one><two><three name='3'/></two></one>\";\n\n    XmlDocument xmlDocument = Xml.parse(xml);\n    ListOrSingle<XmlNode> nodes = xmlDocument.findNodes(\"//three/@name\");\n\n    assertThat(nodes.getFirst().toString(), is(\"3\"));\n  }\n\n  @Test\n  public void prettyPrintsNodeTextValue() {\n    String xml = \"<one><two>2</two></one>\";\n\n    XmlDocument xmlDocument = Xml.parse(xml);\n    ListOrSingle<XmlNode> nodes = xmlDocument.findNodes(\"/one/two/text()\");\n\n    assertThat(nodes.getFirst().toString(), is(\"2\"));\n  }\n\n  @Test\n  public void prettyPrintsNodeXml() {\n    String xml = \"<one><two><three name=\\\"3\\\"/></two></one>\";\n\n    XmlDocument xmlDocument = Xml.parse(xml);\n    ListOrSingle<XmlNode> nodes = xmlDocument.findNodes(\"/one/two\");\n\n    assertThat(\n        nodes.getFirst().toString().trim(),\n        equalsMultiLine(\"<two>\\n\" + \"  <three name=\\\"3\\\"/>\\n\" + \"</two>\"));\n  }\n\n  @Test\n  @DisabledForJreRange(\n      min = JRE.JAVA_17,\n      disabledReason =\n          \"SaxSource unavailable to parse undeclared namespace prefix, due to \"\n              + \"IllegalAccessException: class com.github.tomakehurst.wiremock.common.xml.XmlNode cannot access class com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX (in module java.xml) because module java.xml does not export com.sun.org.apache.xalan.internal.xsltc.trax to unnamed module @2892dae4\")\n  public void printsNamespacedXmlWhenPrefixDeclarationNotInScope() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<things xmlns:s=\\\"https://stuff.biz\\\" id=\\\"1\\\">\\n\"\n            + \"    <stuff id=\\\"1\\\"/>\\n\"\n            + \"    <fl:fluff xmlns:fl=\\\"https://fluff.abc\\\" id=\\\"2\\\">\\n\"\n            + \"        <fl:inner id=\\\"123\\\" fl:code=\\\"D1\\\">Innards</fl:inner>\\n\"\n            + \"        <fl:inner>More Innards</fl:inner>\\n\"\n            + \"    </fl:fluff>\\n\"\n            + \"</things>\";\n\n    XmlDocument xmlDocument = Xml.parse(xml);\n    ListOrSingle<XmlNode> xmlNodes = xmlDocument.findNodes(\"/things/fluff/inner[@id=\\\"123\\\"]\");\n\n    assertThat(xmlNodes.toString(), is(\"<fl:inner fl:code=\\\"D1\\\" id=\\\"123\\\">Innards</fl:inner>\"));\n  }\n\n  @Test\n  void canReadConcurrently() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<things xmlns:s=\\\"https://stuff.biz\\\" id=\\\"1\\\">\\n\"\n            + \"    <stuff id=\\\"1\\\"/>\\n\"\n            + \"    <fl:fluff xmlns:fl=\\\"https://fluff.abc\\\" id=\\\"2\\\">\\n\"\n            + \"        <fl:inner id=\\\"123\\\" fl:code=\\\"D1\\\">Innards</fl:inner>\\n\"\n            + \"        <fl:inner>More Innards</fl:inner>\\n\"\n            + \"    </fl:fluff>\\n\"\n            + \"</things>\";\n    int iterations = 10000;\n    IntStream.range(0, iterations)\n        .parallel()\n        .mapToObj(i -> Xml.read(xml))\n        .forEach(document -> assertThat(document, notNullValue()));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/core/WireMockConfigurationTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\nimport static com.github.tomakehurst.wiremock.core.Options.DEFAULT_MAX_TEMPLATE_CACHE_ENTRIES;\nimport static com.github.tomakehurst.wiremock.core.Options.DEFAULT_WEBHOOK_THREADPOOL_SIZE;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\n\nimport org.junit.jupiter.api.Test;\n\npublic class WireMockConfigurationTest {\n\n  @Test\n  public void testProxyPassThroughSetAsFalse() {\n    WireMockConfiguration wireMockConfiguration =\n        WireMockConfiguration.wireMockConfig().proxyPassThrough(false);\n    assertFalse(wireMockConfiguration.getStores().getSettingsStore().get().getProxyPassThrough());\n  }\n\n  @Test\n  void setsMaxTemplateCacheEntries() {\n    Options config = WireMockConfiguration.wireMockConfig().withMaxTemplateCacheEntries(11L);\n    assertThat(config.getMaxTemplateCacheEntries(), is(11L));\n  }\n\n  @Test\n  void maxTemplateCacheEntriesDefaultsWhenNotSpecified() {\n    Options config = WireMockConfiguration.wireMockConfig();\n    assertThat(config.getMaxTemplateCacheEntries(), is(DEFAULT_MAX_TEMPLATE_CACHE_ENTRIES));\n  }\n\n  @Test\n  void setsWebhookThreadpoolSize() {\n    Options config = WireMockConfiguration.wireMockConfig().withWebhookThreadPoolSize(1000);\n    assertThat(config.getWebhookThreadPoolSize(), is(1000));\n  }\n\n  @Test\n  void webhookThreadpoolSizeWhenNotSpecified() {\n    Options config = WireMockConfiguration.wireMockConfig();\n    assertThat(config.getWebhookThreadPoolSize(), is(DEFAULT_WEBHOOK_THREADPOOL_SIZE));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/crypto/CertificateSpecification.java",
    "content": "/*\n * Copyright (C) 2020-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.crypto;\n\nimport java.security.InvalidKeyException;\nimport java.security.KeyPair;\nimport java.security.SignatureException;\nimport java.security.cert.CertificateException;\nimport java.security.cert.X509Certificate;\n\npublic interface CertificateSpecification {\n  X509Certificate certificateFor(KeyPair keyPair)\n      throws CertificateException, InvalidKeyException, SignatureException;\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/crypto/InMemoryKeyStore.java",
    "content": "/*\n * Copyright (C) 2020-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.crypto;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static java.util.Objects.requireNonNull;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.security.KeyPair;\nimport java.security.KeyStore;\nimport java.security.KeyStoreException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.cert.Certificate;\nimport java.security.cert.CertificateException;\n\npublic class InMemoryKeyStore {\n\n  public enum KeyStoreType {\n    JKS(\"jks\");\n\n    private final String type;\n\n    KeyStoreType(String type) {\n      this.type = type;\n    }\n  }\n\n  private final Secret password;\n  private final KeyStore keyStore;\n\n  public InMemoryKeyStore(KeyStoreType type, Secret password) {\n    this.password = requireNonNull(password, \"password\");\n    this.keyStore = initialise(requireNonNull(type, \"type\"));\n  }\n\n  private KeyStore initialise(KeyStoreType type) {\n    try {\n      KeyStore keyStore = KeyStore.getInstance(type.type);\n      keyStore.load(null, password.getValue());\n      return keyStore;\n    } catch (KeyStoreException | IOException | NoSuchAlgorithmException | CertificateException e) {\n      return throwUnchecked(e, null);\n    }\n  }\n\n  public void addPrivateKey(String alias, KeyPair keyPair, Certificate... certs)\n      throws KeyStoreException {\n    keyStore.setKeyEntry(alias, keyPair.getPrivate(), password.getValue(), certs);\n  }\n\n  public void addCertificate(String alias, Certificate cert) throws KeyStoreException {\n    keyStore.setCertificateEntry(alias, cert);\n  }\n\n  public void saveAs(File file) throws IOException {\n    try (FileOutputStream fos = new FileOutputStream(file)) {\n      try {\n        keyStore.store(fos, password.getValue());\n      } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException e) {\n        throwUnchecked(e);\n      }\n    }\n  }\n\n  public KeyStore getKeyStore() {\n    return keyStore;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/crypto/Secret.java",
    "content": "/*\n * Copyright (C) 2020-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.crypto;\n\nimport static java.util.Arrays.copyOf;\nimport static java.util.Arrays.fill;\nimport static java.util.Objects.requireNonNull;\n\nimport java.util.Arrays;\n\npublic class Secret implements AutoCloseable {\n\n  private static final char[] EMPTY_VALUE = new char[0];\n  private volatile char[] value;\n\n  public Secret(char[] value) {\n    requireNonNull(value, \"Secret value may not be null\");\n\n    this.value = copyOf(value, value.length);\n  }\n\n  public Secret(String value) {\n    this(null == value ? null : value.toCharArray());\n  }\n\n  public char[] getValue() {\n    return Arrays.copyOf(value, value.length);\n  }\n\n  @Override\n  public void close() {\n    if (EMPTY_VALUE == value) return;\n\n    char[] tempValue = value;\n    value = EMPTY_VALUE;\n\n    fill(tempValue, (char) 0x00);\n  }\n\n  public boolean compareTo(String password) {\n    if (password == null) {\n      return false;\n    }\n\n    return Arrays.equals(password.toCharArray(), value);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/crypto/X509CertificateSpecification.java",
    "content": "/*\n * Copyright (C) 2020-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.crypto;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static java.util.Objects.requireNonNull;\n\nimport java.io.IOException;\nimport java.math.BigInteger;\nimport java.security.InvalidKeyException;\nimport java.security.KeyPair;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.NoSuchProviderException;\nimport java.security.SecureRandom;\nimport java.security.SignatureException;\nimport java.security.cert.CertificateException;\nimport java.security.cert.X509Certificate;\nimport java.util.Date;\nimport sun.security.x509.AlgorithmId;\nimport sun.security.x509.CertificateAlgorithmId;\nimport sun.security.x509.CertificateIssuerName;\nimport sun.security.x509.CertificateSerialNumber;\nimport sun.security.x509.CertificateSubjectName;\nimport sun.security.x509.CertificateValidity;\nimport sun.security.x509.CertificateX509Key;\nimport sun.security.x509.X500Name;\nimport sun.security.x509.X509CertImpl;\nimport sun.security.x509.X509CertInfo;\n\n@SuppressWarnings(\"sunapi\")\npublic class X509CertificateSpecification implements CertificateSpecification {\n\n  private final X509CertificateVersion version;\n  private final X500Name subject;\n  private final X500Name issuer;\n  // java.time is JDK8 only\n  private final Date notBefore;\n  private final Date notAfter;\n\n  public X509CertificateSpecification(\n      X509CertificateVersion version, String subject, String issuer, Date notBefore, Date notAfter)\n      throws IOException {\n    this.version = requireNonNull(version);\n    this.subject = new X500Name(requireNonNull(subject));\n    this.issuer = new X500Name(requireNonNull(issuer));\n    this.notBefore = requireNonNull(notBefore);\n    this.notAfter = requireNonNull(notAfter);\n  }\n\n  @Override\n  public X509Certificate certificateFor(KeyPair keyPair)\n      throws CertificateException, InvalidKeyException, SignatureException {\n    try {\n      SecureRandom random = new SecureRandom();\n\n      X509CertInfo info = new X509CertInfo();\n      info.set(X509CertInfo.VERSION, version.getVersion());\n\n      // On Java <= 1.7 it has to be a `CertificateSubjectName`\n      // On Java >= 1.8 it has to be an `X500Name`\n      try {\n        info.set(X509CertInfo.SUBJECT, subject);\n      } catch (CertificateException ignore) {\n        info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(subject));\n      }\n\n      // On Java <= 1.7 it has to be a `CertificateIssuerName`\n      // On Java >= 1.8 it has to be an `X500Name`\n      try {\n        info.set(X509CertInfo.ISSUER, issuer);\n      } catch (CertificateException ignore) {\n        info.set(X509CertInfo.ISSUER, new CertificateIssuerName(issuer));\n      }\n\n      info.set(X509CertInfo.VALIDITY, new CertificateValidity(notBefore, notAfter));\n\n      info.set(X509CertInfo.KEY, new CertificateX509Key(keyPair.getPublic()));\n      info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(new BigInteger(64, random)));\n      info.set(\n          X509CertInfo.ALGORITHM_ID,\n          new CertificateAlgorithmId(new AlgorithmId(AlgorithmId.SHA256_oid)));\n\n      // Sign the cert to identify the algorithm that's used.\n      X509CertImpl cert = new X509CertImpl(info);\n      cert.sign(keyPair.getPrivate(), \"SHA256withRSA\");\n\n      // Update the algorithm and sign again.\n      info.set(\n          CertificateAlgorithmId.NAME + '.' + CertificateAlgorithmId.ALGORITHM,\n          cert.get(X509CertImpl.SIG_ALG));\n      cert = new X509CertImpl(info);\n      cert.sign(keyPair.getPrivate(), \"SHA256withRSA\");\n      cert.verify(keyPair.getPublic());\n\n      return cert;\n    } catch (IOException | NoSuchAlgorithmException | NoSuchProviderException e) {\n      return throwUnchecked(e, null);\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/crypto/X509CertificateVersion.java",
    "content": "/*\n * Copyright (C) 2020-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.crypto;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport java.io.IOException;\nimport sun.security.x509.CertificateVersion;\n\n@SuppressWarnings(\"sunapi\")\npublic enum X509CertificateVersion {\n  V1(CertificateVersion.V1),\n  V2(CertificateVersion.V2),\n  V3(CertificateVersion.V3);\n\n  private final CertificateVersion version;\n\n  X509CertificateVersion(int version) {\n    this.version = getVersion(version);\n  }\n\n  private static CertificateVersion getVersion(int version) {\n    try {\n      return new CertificateVersion(version);\n    } catch (IOException e) {\n      return throwUnchecked(e, null);\n    }\n  }\n\n  CertificateVersion getVersion() {\n    return version;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/direct/DirectCallHttpServerIntegrationTest.java",
    "content": "/*\n * Copyright (C) 2021-2022 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.direct;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.greaterThanOrEqualTo;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.matching.MockRequest;\nimport com.google.common.base.Stopwatch;\nimport org.junit.jupiter.api.Test;\n\nclass DirectCallHttpServerIntegrationTest {\n\n  @Test\n  void exampleUsage() {\n    DirectCallHttpServerFactory factory = new DirectCallHttpServerFactory();\n    WireMockServer wm = new WireMockServer(wireMockConfig().httpServerFactory(factory));\n    wm.start(); // no-op\n\n    DirectCallHttpServer server = factory.getHttpServer();\n\n    Response response = server.stubRequest(mockRequest());\n    assertEquals(404, response.getStatus());\n  }\n\n  @Test\n  void withDelay() {\n    DirectCallHttpServerFactory factory = new DirectCallHttpServerFactory();\n    WireMockServer wm =\n        new WireMockServer(\n            wireMockConfig()\n                .usingFilesUnderClasspath(\"classpath-filesource\")\n                .httpServerFactory(factory));\n    wm.start(); // no-op\n\n    DirectCallHttpServer server = factory.getHttpServer();\n\n    MockRequest mockRequest = mockRequest().url(\"/slow-response\").method(GET);\n\n    Stopwatch stopwatch = Stopwatch.createStarted();\n    Response response = server.stubRequest(mockRequest);\n    stopwatch.stop();\n\n    assertEquals(200, response.getStatus());\n    assertThat(stopwatch.elapsed(MILLISECONDS), greaterThanOrEqualTo(499L));\n  }\n\n  @Test\n  void withFileBody() {\n    DirectCallHttpServerFactory factory = new DirectCallHttpServerFactory();\n    WireMockServer wm =\n        new WireMockServer(\n            wireMockConfig()\n                .usingFilesUnderClasspath(\"classpath-filesource\")\n                .httpServerFactory(factory));\n    wm.start(); // no-op\n\n    DirectCallHttpServer server = factory.getHttpServer();\n\n    MockRequest mockRequest = mockRequest().url(\"/test\").method(GET);\n    Response response = server.stubRequest(mockRequest);\n    assertEquals(\"THINGS!\", response.getBodyAsString());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/direct/DirectCallHttpServerTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.direct;\n\nimport static java.util.Collections.emptyMap;\nimport static org.junit.jupiter.api.Assertions.*;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.*;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.util.concurrent.TimeoutException;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Disabled;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\nimport org.mockito.Mock;\nimport org.mockito.junit.jupiter.MockitoExtension;\n\n@ExtendWith(MockitoExtension.class)\nclass DirectCallHttpServerTest {\n  @Mock private SleepFacade sleepFacade;\n  @Mock private Options options;\n  @Mock private AdminRequestHandler adminRequestHandler;\n  @Mock private StubRequestHandler stubRequestHandler;\n\n  private DirectCallHttpServer server;\n\n  @BeforeEach\n  void setup() {\n    server =\n        new DirectCallHttpServer(sleepFacade, options, adminRequestHandler, stubRequestHandler);\n  }\n\n  @Nested\n  class Constructor {\n    @Test\n    void publicConstructor() {\n      assertDoesNotThrow(\n          () -> new DirectCallHttpServer(options, adminRequestHandler, stubRequestHandler));\n    }\n  }\n\n  @Nested\n  class Start {\n    @Test\n    void doesNothing() {\n      assertDoesNotThrow(server::start);\n    }\n  }\n\n  @Nested\n  class Stop {\n    @Test\n    void doesNothing() {\n      assertDoesNotThrow(server::start);\n    }\n  }\n\n  @Nested\n  class IsRunning {\n    @Test\n    void isAlwaysTrue() {\n      assertTrue(server.isRunning());\n    }\n\n    @Test\n    void isUnaffectedByStop() {\n      boolean isRunning = server.isRunning();\n\n      server.stop();\n\n      assertEquals(server.isRunning(), isRunning);\n    }\n  }\n\n  @Nested\n  class Port {\n    @Test\n    void isInvalidPortNumber() {\n      assertEquals(server.port(), -1);\n    }\n  }\n\n  @Nested\n  class HttpsPort {\n    @Test\n    void isInvalidPortNumber() {\n      assertEquals(server.httpsPort(), -2);\n    }\n  }\n\n  @Nested\n  class AdminRequest extends AbstractRequestHandlerTest {\n\n    @Override\n    AbstractRequestHandler handler() {\n      return adminRequestHandler;\n    }\n\n    @Override\n    Response handle(Request request) {\n      return server.adminRequest(request);\n    }\n  }\n\n  @Nested\n  class StubRequest extends AbstractRequestHandlerTest {\n\n    @Override\n    AbstractRequestHandler handler() {\n      return stubRequestHandler;\n    }\n\n    @Override\n    Response handle(Request request) {\n      return server.stubRequest(request);\n    }\n  }\n\n  abstract class AbstractRequestHandlerTest {\n\n    abstract AbstractRequestHandler handler();\n\n    abstract Response handle(Request request);\n\n    @Mock private Request request;\n    @Mock private Response response;\n    private Response actual;\n\n    @Nested\n    class HappyPath {\n\n      @BeforeEach\n      void setup() {\n        doAnswer(\n                (i) -> {\n                  HttpResponder responder = i.getArgument(1, HttpResponder.class);\n                  responder.respond(request, response, emptyMap());\n                  return null;\n                })\n            .when(handler())\n            .handle(any(), any(), any());\n\n        actual = handle(request);\n      }\n\n      @Test\n      void delegatesRequest() {\n        verify(handler()).handle(eq(request), any(), any());\n      }\n\n      @Test\n      void returnsResponse() {\n        assertEquals(response, actual);\n      }\n    }\n\n    @Nested\n    class WhenDelay {\n\n      @Nested\n      class WhenFixed {\n\n        @BeforeEach\n        void setup() {\n          when(response.getInitialDelay()).thenReturn(1000L);\n          doAnswer(\n                  (i) -> {\n                    HttpResponder responder = i.getArgument(1, HttpResponder.class);\n                    responder.respond(request, response, emptyMap());\n                    return null;\n                  })\n              .when(handler())\n              .handle(any(), any(), any());\n\n          actual = handle(request);\n        }\n\n        @Test\n        void delegatesRequest() {\n          verify(handler()).handle(eq(request), any(), any());\n        }\n\n        @Test\n        void delegatesDelays() {\n          verify(sleepFacade).sleep(1000L);\n        }\n\n        @Test\n        void returnsResponse() {\n          assertEquals(response, actual);\n        }\n      }\n\n      @Nested\n      class WhenRandomDelay {\n        @Disabled(\"Needs to be implemented\")\n        @Test\n        void todo() {\n          fail();\n        }\n      }\n\n      @Disabled(\"Is not implemented\")\n      @Nested\n      class ChunkedDribbleDelay {}\n    }\n\n    @Disabled(\"Is not implemented\")\n    @Nested\n    class Fault {}\n\n    @Nested\n    class AsyncTimeout {\n      @BeforeEach\n      void setup() {\n        when(options.timeout()).thenReturn(5L);\n        server = new DirectCallHttpServer(options, adminRequestHandler, stubRequestHandler);\n      }\n\n      @Test\n      void throwsIllegalStateExceptionWhenNoResponse() {\n        IllegalStateException actual =\n            assertThrows(IllegalStateException.class, () -> handle(request));\n\n        assertEquals(\"The request was not handled within the timeout of 5ms\", actual.getMessage());\n        assertTrue(actual.getCause() instanceof TimeoutException);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/ExtensionLifeCycleAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.AcceptanceTestBase;\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class ExtensionLifeCycleAcceptanceTest extends AcceptanceTestBase {\n\n  @Test\n  public void extensionStartIsCalledWhenTheServerIsInitialised() {\n    TestNotifier notifier = new TestNotifier();\n    setupServer(\n        wireMockConfig()\n            .dynamicPort()\n            .notifier(notifier)\n            .extensions(new StartStopLoggingExtension(notifier)));\n    assertThat(notifier.infoMessages.size(), greaterThanOrEqualTo(1));\n    assertThat(notifier.infoMessages, hasItem(containsString(\"Extension started\")));\n  }\n\n  @Test\n  public void extensionStopIsCalledWhenTheServerShutsDown() {\n    TestNotifier notifier = new TestNotifier();\n    setupServer(\n        wireMockConfig()\n            .dynamicPort()\n            .notifier(notifier)\n            .extensions(new StartStopLoggingExtension(notifier)));\n    notifier.reset();\n    testClient.post(\"/__admin/shutdown\");\n    // should contain the admin request log message and the stop message from our extension\n    assertThat(notifier.infoMessages.size(), is(2));\n    assertThat(notifier.infoMessages.get(1), containsString(\"Extension stopped\"));\n  }\n\n  public static class TestNotifier implements Notifier {\n\n    final List<String> infoMessages = new ArrayList<>();\n\n    public void reset() {\n      infoMessages.clear();\n    }\n\n    @Override\n    public void info(String message) {\n      infoMessages.add(message);\n    }\n\n    @Override\n    public void error(String message) {}\n\n    @Override\n    public void error(String message, Throwable t) {}\n  }\n\n  public static class StartStopLoggingExtension implements Extension {\n    private final Notifier notifier;\n\n    public StartStopLoggingExtension(Notifier notifier) {\n      this.notifier = notifier;\n    }\n\n    @Override\n    public String getName() {\n      return \"start-stop-logging\";\n    }\n\n    @Override\n    public void start() {\n      notifier.info(\"Extension started\");\n    }\n\n    @Override\n    public void stop() {\n      notifier.info(\"Extension stopped\");\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/ExtensionsTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.FILES_ROOT;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.admin.model.*;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.recording.RecordSpec;\nimport com.github.tomakehurst.wiremock.recording.RecordSpecBuilder;\nimport com.github.tomakehurst.wiremock.recording.RecordingStatusResult;\nimport com.github.tomakehurst.wiremock.recording.SnapshotRecordResult;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.verification.*;\nimport java.util.List;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\n\nclass ExtensionsTest {\n\n  @Test\n  void extensionsAreReturnedInRegistrationOrder() {\n\n    WireMockConfiguration options =\n        WireMockConfiguration.options()\n            .extensions(() -> \"e1\", () -> \"e2\")\n            .extensions(() -> \"e3\")\n            .extensions(() -> \"e4\", () -> \"e5\")\n            .extensions(\n                services -> List.of(() -> \"e6\", () -> \"e7\"), services -> List.of(() -> \"e8\"));\n\n    Extensions extensions =\n        new Extensions(\n            options.getDeclaredExtensions(),\n            new FakeAdmin(),\n            options,\n            options.getStores(),\n            options.filesRoot().child(FILES_ROOT));\n\n    extensions.load();\n\n    List<String> allExtensions = extensions.ofType(Extension.class).keySet().stream().toList();\n\n    assertEquals(\n        List.of(\n            \"e1\",\n            \"e2\",\n            \"e3\",\n            \"e4\",\n            \"e5\",\n            \"e6\",\n            \"e7\",\n            \"e8\",\n            \"response-template\",\n            \"message-template\",\n            \"webhook\",\n            \"proxied-hostname-rewrite\"),\n        allExtensions);\n  }\n\n  private static class FakeAdmin implements Admin {\n    @Override\n    public void addStubMapping(StubMapping stubMapping) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void editStubMapping(StubMapping stubMapping) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void removeStubMapping(StubMapping stubbMapping) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void removeStubMapping(UUID id) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public ListStubMappingsResult listAllStubMappings() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public SingleStubMappingResult getStubMapping(UUID id) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void saveMappings() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void resetRequests() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void resetScenarios() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void resetMappings() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void resetAll() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void resetToDefaultMappings() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public GetServeEventsResult getServeEvents() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public GetServeEventsResult getServeEvents(ServeEventQuery query) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public SingleServedStubResult getServedStub(UUID id) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public VerificationResult countRequestsMatching(RequestPattern requestPattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public FindRequestsResult findRequestsMatching(RequestPattern requestPattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public FindRequestsResult findUnmatchedRequests() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void removeServeEvent(UUID eventId) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public FindServeEventsResult removeServeEventsMatching(RequestPattern requestPattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public FindServeEventsResult removeServeEventsForStubsMatchingMetadata(\n        StringValuePattern pattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public FindNearMissesResult findTopNearMissesFor(LoggedRequest loggedRequest) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public FindNearMissesResult findTopNearMissesFor(RequestPattern requestPattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public FindNearMissesResult findNearMissesForUnmatchedRequests() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public GetScenariosResult getAllScenarios() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void resetScenario(String name) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void setScenarioState(String name, String state) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void updateGlobalSettings(GlobalSettings settings) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public SnapshotRecordResult snapshotRecord() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public SnapshotRecordResult snapshotRecord(RecordSpec spec) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public SnapshotRecordResult snapshotRecord(RecordSpecBuilder spec) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void startRecording(String targetBaseUrl) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void startRecording(RecordSpec spec) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void startRecording(RecordSpecBuilder recordSpec) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public SnapshotRecordResult stopRecording() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public RecordingStatusResult getRecordingStatus() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public Options getOptions() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void shutdownServer() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public ListStubMappingsResult findUnmatchedStubs() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public ListStubMappingsResult findAllStubsByMetadata(StringValuePattern pattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void removeStubsByMetadata(StringValuePattern pattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void importStubs(StubImport stubImport) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void removeStubMappings(List<StubMapping> stubMappings) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public GetGlobalSettingsResult getGlobalSettings() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public SendChannelMessageResult sendChannelMessage(\n        ChannelType type, RequestPattern requestPattern, MessageDefinition message) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void addMessageStubMapping(MessageStubMapping messageStubMapping) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void removeMessageStubMapping(UUID id) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void resetMessageStubMappings() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public ListMessageStubMappingsResult findAllMessageStubsByMetadata(StringValuePattern pattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void removeMessageStubsByMetadata(StringValuePattern pattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public ListMessageStubMappingsResult listAllMessageStubMappings() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public ListMessageChannelsResult listAllMessageChannels() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public GetMessageServeEventsResult getMessageServeEvents() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public SingleMessageServeEventResult getMessageServeEvent(UUID id) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public int countMessageEventsMatching(MessagePattern pattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public List<MessageServeEvent> findMessageEventsMatching(MessagePattern pattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void removeMessageServeEvent(UUID eventId) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public FindMessageServeEventsResult removeMessageServeEventsMatching(MessagePattern pattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public FindMessageServeEventsResult removeMessageServeEventsForStubsMatchingMetadata(\n        StringValuePattern pattern) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void resetMessageJournal() {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public java.util.Optional<MessageServeEvent> waitForMessageEvent(\n        MessagePattern pattern, java.time.Duration maxWait) {\n      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public List<MessageServeEvent> waitForMessageEvents(\n        MessagePattern pattern, int count, java.time.Duration maxWait) {\n      throw new UnsupportedOperationException();\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/ParametersTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.time.LocalDate;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\n\npublic class ParametersTest {\n\n  @Test\n  public void convertsParametersToAnObject() {\n    MyData myData =\n        Parameters.from(Map.of(\"name\", \"Tom\", \"num\", 27, \"date\", \"2023-01-01\")).as(MyData.class);\n\n    assertThat(myData.getName(), is(\"Tom\"));\n    assertThat(myData.getNum(), is(27));\n    assertThat(myData.getDate(), is(LocalDate.of(2023, 1, 1)));\n  }\n\n  @Test\n  public void convertsToParametersFromAnObject() {\n    MyData myData = new MyData(\"Mark\", 12, LocalDate.of(2023, 1, 1));\n\n    Parameters parameters = Parameters.of(myData);\n\n    assertThat(parameters.getString(\"name\"), is(\"Mark\"));\n    assertThat(parameters.getInt(\"num\"), is(12));\n    assertThat(parameters.getString(\"date\"), is(\"2023-01-01\"));\n  }\n\n  @Test\n  public void deepMergesParameters() {\n    final Parameters initialParameters =\n        Parameters.from(\n            Map.of(\n                \"one\", 1,\n                \"two\", 2));\n    final Parameters toMerge =\n        Parameters.from(\n            Map.of(\n                \"two\", 22,\n                \"three\", 3));\n\n    final Parameters merged = initialParameters.deepMerge(toMerge);\n\n    assertThat(merged.getInt(\"one\"), is(1));\n    assertThat(merged.getInt(\"two\"), is(22));\n    assertThat(merged.getInt(\"three\"), is(3));\n  }\n\n  public static class MyData {\n\n    private final String name;\n    private final Integer num;\n    private final LocalDate date;\n\n    @JsonCreator\n    public MyData(\n        @JsonProperty(\"name\") String name,\n        @JsonProperty(\"num\") Integer num,\n        @JsonProperty(\"date\") LocalDate date) {\n      this.name = name;\n      this.num = num;\n      this.date = date;\n    }\n\n    public String getName() {\n      return name;\n    }\n\n    public Integer getNum() {\n      return num;\n    }\n\n    public LocalDate getDate() {\n      return date;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/mappingssource/DummyMappingsLoaderExtension.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.mappingssource;\n\nimport static com.github.tomakehurst.wiremock.common.AbstractFileSource.byFileExtension;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.extension.MappingsLoaderExtension;\nimport com.github.tomakehurst.wiremock.standalone.MappingFileException;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.StubMappingOrMappings;\nimport com.github.tomakehurst.wiremock.stubbing.StubMappings;\nimport java.util.*;\n\npublic class DummyMappingsLoaderExtension implements MappingsLoaderExtension {\n\n  private final FileSource mappingsFileSource;\n  private final Map<UUID, StubMappingFileMetadata> fileNameMap;\n  private final FilenameMaker filenameMaker;\n\n  public DummyMappingsLoaderExtension(FileSource mappingsFileSource, FilenameMaker filenameMaker) {\n    this.mappingsFileSource = mappingsFileSource;\n    this.filenameMaker = Objects.requireNonNullElseGet(filenameMaker, FilenameMaker::new);\n    fileNameMap = new HashMap<>();\n  }\n\n  @Override\n  public String getName() {\n    return null;\n  }\n\n  @Override\n  public void loadMappingsInto(StubMappings stubMappings) {\n    {\n      if (!mappingsFileSource.exists()) {\n        return;\n      }\n\n      List<TextFile> mappingFiles =\n          mappingsFileSource.listFilesRecursively().stream()\n              .filter(byFileExtension(\"json\"))\n              .toList();\n      for (TextFile mappingFile : mappingFiles) {\n        try {\n          StubMappingOrMappings stubCollection =\n              Json.read(mappingFile.readContentsAsString(), StubMappingOrMappings.class);\n          for (StubMapping mapping : stubCollection.getMappingOrMappings()) {\n            stubMappings.addMapping(mapping);\n            StubMappingFileMetadata fileMetadata =\n                new StubMappingFileMetadata(mappingFile.getPath(), stubCollection.isMulti());\n            fileNameMap.put(mapping.getId(), fileMetadata);\n          }\n        } catch (JsonException e) {\n          throw new MappingFileException(mappingFile.getPath(), e.getErrors().first().getDetail());\n        }\n      }\n    }\n  }\n\n  private static class StubMappingFileMetadata {\n    final String path;\n    final boolean multi;\n\n    public StubMappingFileMetadata(String path, boolean multi) {\n      this.path = path;\n      this.multi = multi;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/mappingssource/MappingsLoaderExtensionTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.mappingssource;\n\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResourceURI;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.File;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class MappingsLoaderExtensionTest {\n\n  private WireMockConfiguration configuration;\n  private WireMockServer wireMockServer;\n  private WireMockTestClient testClient;\n\n  @BeforeEach\n  public void init() {\n    configuration = wireMockConfig().dynamicPort();\n  }\n\n  @AfterEach\n  public void stopWireMock() {\n    wireMockServer.stop();\n  }\n\n  private void buildWireMock(Options options) {\n    wireMockServer = new WireMockServer(options);\n    wireMockServer.start();\n    testClient = new WireMockTestClient(wireMockServer.port());\n  }\n\n  @Test\n  void mappingsLoadedFromJsonFilesWithMultipleMappingsSource() {\n    FileSource filesRoot = new SingleRootFileSource(filePath(\"extension-test-request\"));\n    buildWireMock(\n        configuration.extensions(new DummyMappingsLoaderExtension(filesRoot, new FilenameMaker())));\n\n    WireMockResponse response = testClient.get(\"/extension/resource/1\");\n    assertThat(response.statusCode(), is(200));\n  }\n\n  public static String filePath(String path) {\n    return new File(getResourceURI(MappingsLoaderExtensionTest.class, path)).getAbsolutePath();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/requestfilter/RequestWrapperTest.java",
    "content": "/*\n * Copyright (C) 2019-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.encodeBase64;\nimport static com.github.tomakehurst.wiremock.matching.MockMultipart.mockPart;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.matching.MockRequest;\nimport java.util.stream.Collectors;\nimport org.junit.jupiter.api.Test;\n\npublic class RequestWrapperTest {\n\n  @Test\n  public void changesTheRequestMethod() {\n    MockRequest request = mockRequest().method(RequestMethod.GET);\n\n    Request wrappedRequest = RequestWrapper.create().setMethod(RequestMethod.POST).wrap(request);\n\n    assertThat(wrappedRequest.getMethod(), is(RequestMethod.POST));\n  }\n\n  @Test\n  public void transformsTheUrl() {\n    MockRequest request = mockRequest().url(\"/original-path?one=1&two=2\");\n\n    Request wrappedRequest =\n        RequestWrapper.create()\n            .transformAbsoluteUrl(\n                existingUrl ->\n                    existingUrl\n                        .replace(\"my.domain\", \"wiremock.org\")\n                        .replace(\"/original-path\", \"/new-path\"))\n            .wrap(request);\n\n    assertThat(wrappedRequest.getUrl(), is(\"/new-path?one=1&two=2\"));\n    assertThat(wrappedRequest.getAbsoluteUrl(), is(\"http://wiremock.org/new-path?one=1&two=2\"));\n  }\n\n  @Test\n  public void transformsAUrlWithNoPath() {\n    MockRequest request = mockRequest().url(\"\");\n\n    Request wrappedRequest =\n        RequestWrapper.create()\n            .transformAbsoluteUrl(existingUrl -> existingUrl.replace(\"my.domain\", \"wiremock.org\"))\n            .wrap(request);\n\n    assertThat(wrappedRequest.getUrl(), is(\"\"));\n    assertThat(wrappedRequest.getAbsoluteUrl(), is(\"http://wiremock.org\"));\n  }\n\n  @Test\n  public void addsSpecifiedHeaders() {\n    MockRequest request = mockRequest().header(\"One\", \"1\");\n\n    Request wrappedRequest = RequestWrapper.create().addHeader(\"Two\", \"2\").wrap(request);\n\n    assertThat(wrappedRequest.getHeaders().size(), is(2));\n    assertThat(wrappedRequest.getHeader(\"Two\"), is(\"2\"));\n  }\n\n  @Test\n  public void removesSpecifiedHeaders() {\n    MockRequest request = mockRequest().header(\"One\", \"1\");\n\n    Request wrappedRequest = RequestWrapper.create().removeHeader(\"One\").wrap(request);\n\n    assertThat(wrappedRequest.getHeaders().size(), is(0));\n  }\n\n  @Test\n  public void transformsSpecifiedHeaders() {\n    MockRequest request = mockRequest().header(\"One\", \"1\").header(\"Two\", \"2\", \"3\");\n\n    Request wrappedRequest =\n        RequestWrapper.create()\n            .transformHeader(\n                \"One\",\n                headerValues ->\n                    headerValues.stream()\n                        .map(headerValue -> headerValue + \"1\")\n                        .collect(Collectors.toList()))\n            .transformHeader(\n                \"two\",\n                headerValues ->\n                    headerValues.stream()\n                        .map(headerValue -> headerValue + \"2\")\n                        .collect(Collectors.toList()))\n            .wrap(request);\n\n    assertThat(wrappedRequest.getHeader(\"One\"), is(\"11\"));\n    HttpHeader headerTwo = wrappedRequest.header(\"Two\");\n    assertThat(headerTwo.values().get(0), is(\"22\"));\n    assertThat(headerTwo.values().get(1), is(\"32\"));\n  }\n\n  @Test\n  public void containsHeaderChecksAreCaseInsensitive() {\n    MockRequest request = mockRequest().header(\"One\", \"1\");\n\n    RequestWrapper wrappedRequest = new RequestWrapper(request);\n\n    assertThat(wrappedRequest.containsHeader(\"one\"), is(true));\n    assertThat(wrappedRequest.containsHeader(\"onE\"), is(true));\n    assertThat(wrappedRequest.containsHeader(\"ONE\"), is(true));\n  }\n\n  @Test\n  public void addsSpecifiedCookies() {\n    MockRequest request = mockRequest().cookie(\"One\", \"1\");\n\n    Request wrappedRequest =\n        RequestWrapper.create()\n            .addCookie(\"Two\", new Cookie(\"2\"))\n            .addCookie(\"Three\", new Cookie(\"3\"))\n            .wrap(request);\n\n    assertThat(wrappedRequest.getCookies().size(), is(3));\n    assertThat(wrappedRequest.getCookies().get(\"Two\").firstValue(), is(\"2\"));\n    assertThat(wrappedRequest.getCookies().get(\"Three\").firstValue(), is(\"3\"));\n  }\n\n  @Test\n  public void removesSpecifiedCookies() {\n    MockRequest request = mockRequest().cookie(\"One\", \"1\").cookie(\"Two\", \"2\").cookie(\"Three\", \"3\");\n\n    Request wrappedRequest = RequestWrapper.create().removeCookie(\"Two\").wrap(request);\n\n    assertThat(wrappedRequest.getCookies().size(), is(2));\n    assertThat(wrappedRequest.getCookies().get(\"Two\"), nullValue());\n  }\n\n  @Test\n  public void transformsSpecifiedCookies() {\n    MockRequest request = mockRequest().cookie(\"One\", \"1\");\n\n    Request wrappedRequest =\n        RequestWrapper.create()\n            .transformCookie(\"One\", cookie -> new Cookie(cookie.firstValue() + \"1\"))\n            .wrap(request);\n\n    assertThat(wrappedRequest.getCookies().get(\"One\").firstValue(), is(\"11\"));\n  }\n\n  @Test\n  public void transformsAStringBody() {\n    MockRequest request = mockRequest().body(\"One\");\n\n    Request wrappedRequest =\n        RequestWrapper.create()\n            .transformBody(\n                existingBody -> {\n                  String newValue = existingBody.asString().replace(\"One\", \"Two\");\n                  return new Body(newValue);\n                })\n            .wrap(request);\n\n    assertThat(wrappedRequest.getBodyAsString(), is(\"Two\"));\n    assertThat(wrappedRequest.getBodyAsBase64(), is(encodeBase64(\"Two\".getBytes())));\n  }\n\n  @Test\n  public void transformsABinaryBody() {\n    final byte[] initialBytes = new byte[] {1, 2, 3};\n    final byte[] finalBytes = new byte[] {4, 5, 6};\n\n    MockRequest request = mockRequest().body(initialBytes);\n\n    Request wrappedRequest =\n        RequestWrapper.create().transformBody(existingBody -> new Body(finalBytes)).wrap(request);\n\n    assertThat(wrappedRequest.getBody(), is(finalBytes));\n    assertThat(wrappedRequest.getBodyAsBase64(), is(encodeBase64(finalBytes)));\n  }\n\n  @Test\n  public void transformsMultiparts() {\n    MockRequest request =\n        mockRequest()\n            .part(mockPart().name(\"one\").filename(\"text1.txt\").body(\"1\"))\n            .part(mockPart().name(\"two\").filename(\"text2.txt\").body(\"2\"));\n\n    Request wrappedRequest =\n        RequestWrapper.create()\n            .transformParts(\n                existingPart ->\n                    existingPart.getName().equals(\"one\")\n                        ? mockPart().name(\"one\").filename(\"text1.txt\").body(\"1111\")\n                        : mockPart().name(\"two\").filename(\"sample2.txt\").body(\"2222\"))\n            .wrap(request);\n\n    assertThat(wrappedRequest.getPart(\"one\").getBody().asString(), is(\"1111\"));\n    assertThat(wrappedRequest.getPart(\"two\").getBody().asString(), is(\"2222\"));\n    assertThat(\n        wrappedRequest.getParts(),\n        hasItem(mockPart().name(\"one\").filename(\"text1.txt\").body(\"1111\")));\n    assertThat(\n        wrappedRequest.getParts(),\n        hasItem(mockPart().name(\"two\").filename(\"sample2.txt\").body(\"2222\")));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/ResponseTemplateTransformerTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.stubbing.ServeEventFactory.newPostMatchServeEvent;\nimport static java.time.temporal.ChronoUnit.DAYS;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformerV2;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.MockRequest;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEventFactory;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.ExtensionFactoryUtils;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.time.YearMonth;\nimport java.time.ZonedDateTime;\nimport java.time.temporal.TemporalAdjusters;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.UUID;\nimport org.hamcrest.CoreMatchers;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.RepeatedTest;\nimport org.junit.jupiter.api.Test;\n\npublic class ResponseTemplateTransformerTest {\n\n  private ResponseTemplateTransformer transformer;\n\n  @BeforeEach\n  public void setup() {\n    transformer = ExtensionFactoryUtils.buildTemplateTransformer(true);\n  }\n\n  @Test\n  public void queryParameters() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things?multi_param=one&multi_param=two&single-param=1234\"),\n            aResponse()\n                .withBody(\n                    \"Multi 1: {{request.query.multi_param.[0]}}, Multi 2: {{request.query.multi_param.[1]}}, Single 1: {{request.query.single-param}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"Multi 1: one, Multi 2: two, Single 1: 1234\"));\n  }\n\n  @Test\n  public void showsNothingWhenNoQueryParamsPresent() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\"),\n            aResponse().withBody(\"{{request.query.multi_param.[0]}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"\"));\n  }\n\n  @Test\n  public void requestHeaders() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .url(\"/things\")\n                .header(\"X-Request-Id\", \"req-id-1234\")\n                .header(\"123$%$^&__why_o_why\", \"foundit\"),\n            aResponse()\n                .withBody(\n                    \"Request ID: {{request.headers.X-Request-Id}}, Awkward named header: {{request.headers.[123$%$^&__why_o_why]}}\"));\n\n    assertThat(\n        transformedResponseDef.getBody(),\n        is(\"Request ID: req-id-1234, Awkward named header: foundit\"));\n  }\n\n  @Test\n  public void requestHeadersCaseInsensitive() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").header(\"Case-KEY-123\", \"foundit\"),\n            aResponse()\n                .withBody(\n                    \"Case key header: {{request.headers.case-key-123}}, With brackets: {{request.headers.[case-key-123]}}\"));\n\n    assertThat(\n        transformedResponseDef.getBody(),\n        CoreMatchers.is(\"Case key header: foundit, With brackets: foundit\"));\n  }\n\n  @Test\n  public void cookies() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .url(\"/things\")\n                .cookie(\"session\", \"session-1234\")\n                .cookie(\")((**#$@#\", \"foundit\"),\n            aResponse()\n                .withBody(\n                    \"session: {{request.cookies.session}}, Awkward named cookie: {{request.cookies.[)((**#$@#]}}\"));\n\n    assertThat(\n        transformedResponseDef.getBody(),\n        is(\"session: session-1234, Awkward named cookie: foundit\"));\n  }\n\n  @Test\n  public void multiValueCookies() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").cookie(\"multi\", \"one\", \"two\"),\n            aResponse()\n                .withBody(\n                    \"{{request.cookies.multi}}, {{request.cookies.multi.[0]}}, {{request.cookies.multi.[1]}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"one, one, two\"));\n  }\n\n  @Test\n  public void urlPath() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/the/entire/path\"), aResponse().withBody(\"Path: {{request.path}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"Path: /the/entire/path\"));\n  }\n\n  @Test\n  public void urlPathNodes() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/the/entire/path\"),\n            aResponse().withBody(\"First: {{request.path.[0]}}, Last: {{request.path.[2]}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"First: the, Last: path\"));\n  }\n\n  @Test\n  public void urlPathNodesForRootPath() {\n    ResponseDefinition transformedResponseDef =\n        transform(mockRequest().url(\"/\"), aResponse().withBody(\"{{request.path.[0]}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"\"));\n  }\n\n  @Test\n  public void fullUrl() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"URL: {{{request.url}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"URL: /the/entire/path?query1=one&query2=two\"));\n  }\n\n  @Test\n  public void clientIp() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/\").clientIp(\"127.0.0.1\"),\n            aResponse().withBody(\"IP: {{{request.clientIp}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"IP: 127.0.0.1\"));\n  }\n\n  @Test\n  public void templatizeBodyFile() {\n    ResponseDefinition transformedResponseDef =\n        transformFromResponseFile(\n            mockRequest().url(\"/the/entire/path?name=Ram\"),\n            aResponse().withBodyFile(\"/greet-{{request.query.name}}.txt\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"Hello Ram\"));\n  }\n\n  @Test\n  public void requestBody() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").body(\"All of the body content\"),\n            aResponse().withBody(\"Body: {{{request.body}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"Body: All of the body content\"));\n  }\n\n  @Test\n  public void singleValueTemplatedResponseHeaders() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").header(\"X-Correlation-Id\", \"12345\"),\n            aResponse().withHeader(\"X-Correlation-Id\", \"{{request.headers.X-Correlation-Id}}\"));\n\n    assertThat(\n        transformedResponseDef.getHeaders().getHeader(\"X-Correlation-Id\").firstValue(),\n        is(\"12345\"));\n  }\n\n  @Test\n  public void multiValueTemplatedResponseHeaders() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .url(\"/things\")\n                .header(\"X-Correlation-Id-1\", \"12345\")\n                .header(\"X-Correlation-Id-2\", \"56789\"),\n            aResponse()\n                .withHeader(\n                    \"X-Correlation-Id\",\n                    \"{{request.headers.X-Correlation-Id-1}}\",\n                    \"{{request.headers.X-Correlation-Id-2}}\"));\n\n    List<String> headerValues =\n        transformedResponseDef.getHeaders().getHeader(\"X-Correlation-Id\").values();\n\n    assertThat(headerValues.get(0), is(\"12345\"));\n    assertThat(headerValues.get(1), is(\"56789\"));\n  }\n\n  @Test\n  public void stringHelper() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").body(\"some text\"),\n            aResponse().withBody(\"{{{ capitalize request.body }}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"Some Text\"));\n  }\n\n  @Test\n  public void conditionalHelper() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").header(\"X-Thing\", \"1\"),\n            aResponse().withBody(\"{{#eq request.headers.X-Thing.[0] '1'}}ONE{{else}}MANY{{/eq}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"ONE\"));\n  }\n\n  @Test\n  public void customHelper() {\n    Helper<String> helper = (context, options) -> context.length();\n\n    transformer = ExtensionFactoryUtils.buildTemplateTransformer(false, \"string-length\", helper);\n\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").body(\"fiver\"),\n            aResponse().withBody(\"{{{ string-length request.body }}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"5\"));\n  }\n\n  @Test\n  public void areConditionalHelpersLoaded() {\n\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").body(\"fiver\"),\n            aResponse().withBody(\"{{{eq 5 5 yes='y' no='n'}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"y\"));\n  }\n\n  @Test\n  public void proxyBaseUrlWithAdditionalRequestHeader() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").header(\"X-WM-Uri\", \"http://localhost:8000\"),\n            aResponse()\n                .proxiedFrom(\"{{request.headers.X-WM-Uri}}\")\n                .withAdditionalRequestHeader(\"X-Origin-Url\", \"{{request.url}}\"));\n\n    assertThat(transformedResponseDef.getProxyBaseUrl(), is(\"http://localhost:8000\"));\n    assertThat(transformedResponseDef.getAdditionalProxyRequestHeaders(), notNullValue());\n    assertThat(\n        transformedResponseDef\n            .getAdditionalProxyRequestHeaders()\n            .getHeader(\"X-Origin-Url\")\n            .firstValue(),\n        is(\"/things\"));\n  }\n\n  @Test\n  public void headersToRemoveFromProxyRequestAreUnchanged() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things\").header(\"X-WM-Uri\", \"http://localhost:8000\"),\n            aResponse()\n                .proxiedFrom(\"{{request.headers.X-WM-Uri}}\")\n                .withAdditionalRequestHeader(\"X-Origin-Url\", \"{{request.url}}\")\n                .withRemoveRequestHeader(\"remove-me\"));\n\n    assertThat(transformedResponseDef.getProxyBaseUrl(), is(\"http://localhost:8000\"));\n    assertThat(transformedResponseDef.getAdditionalProxyRequestHeaders(), notNullValue());\n    assertThat(\n        transformedResponseDef\n            .getAdditionalProxyRequestHeaders()\n            .getHeader(\"X-Origin-Url\")\n            .firstValue(),\n        is(\"/things\"));\n    assertThat(transformedResponseDef.getRemoveProxyRequestHeaders(), contains(\"remove-me\"));\n  }\n\n  @Test\n  public void jsonPathValueDefaultsToEmptyString() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            mockRequest().url(\"/json\").body(\"{\\\"a\\\": \\\"1\\\"}\"),\n            aResponse().withBody(\"{{jsonPath request.body '$.b'}}\"),\n            Parameters.empty());\n    assertThat(responseDefinition.getBody(), is(\"\"));\n  }\n\n  @Test\n  public void jsonPathValueDefaultCanBeProvided() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            mockRequest().url(\"/json\").body(\"{\\\"a\\\": \\\"1\\\"}\"),\n            aResponse().withBody(\"{{jsonPath request.body '$.b' default='foo'}}\"),\n            Parameters.empty());\n    assertThat(responseDefinition.getBody(), is(\"foo\"));\n  }\n\n  @Test\n  public void transformerParametersAreAppliedToTemplate() {\n    ResponseDefinition responseDefinition =\n        transform(\n            mockRequest().url(\"/json\").body(\"{\\\"a\\\": {\\\"test\\\": \\\"look at my 'single quotes'\\\"}}\"),\n            aResponse().withBody(\"{\\\"test\\\": \\\"{{parameters.variable}}\\\"}\"),\n            Parameters.one(\"variable\", \"some.value\"));\n\n    assertThat(responseDefinition.getBody(), is(\"{\\\"test\\\": \\\"some.value\\\"}\"));\n  }\n\n  private ResponseDefinition transform(\n      Request request, ResponseDefinitionBuilder responseDefinitionBuilder, Parameters parameters) {\n    return transform(this.transformer, request, responseDefinitionBuilder, parameters);\n  }\n\n  private ResponseDefinition transform(\n      ResponseDefinitionTransformerV2 transformer,\n      Request request,\n      ResponseDefinitionBuilder responseDefinitionBuilder,\n      Parameters parameters) {\n    StubMapping stubMapping =\n        get(\"/json\").willReturn(aResponse().withTransformerParameters(parameters)).build();\n    responseDefinitionBuilder.withTransformerParameters(parameters);\n    ServeEvent serveEvent =\n        newPostMatchServeEvent(\n            LoggedRequest.createFrom(request), responseDefinitionBuilder, stubMapping);\n    return transformer.transform(serveEvent);\n  }\n\n  @Test\n  public void unknownTransformerParametersAreNotCausingIssues() {\n    ResponseDefinition responseDefinition =\n        transform(\n            mockRequest().url(\"/json\").body(\"{\\\"a\\\": {\\\"test\\\": \\\"look at my 'single quotes'\\\"}}\"),\n            aResponse()\n                .withBody(\n                    \"{\\\"test1\\\": \\\"{{parameters.variable}}\\\", \\\"test2\\\": \\\"{{parameters.unknown}}\\\"}\"),\n            Parameters.one(\"variable\", \"some.value\"));\n\n    assertThat(responseDefinition.getBody(), is(\"{\\\"test1\\\": \\\"some.value\\\", \\\"test2\\\": \\\"\\\"}\"));\n  }\n\n  @Test\n  public void requestLineScheme() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(8080)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"scheme: {{{request.requestLine.scheme}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"scheme: https\"));\n  }\n\n  @Test\n  public void requestLineHost() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(8080)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"host: {{{request.requestLine.host}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"host: my.domain.io\"));\n  }\n\n  @Test\n  public void requestLinePort() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(8080)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"port: {{{request.requestLine.port}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"port: 8080\"));\n  }\n\n  @Test\n  public void requestLinePath() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(8080)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"path: {{{request.path}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"path: /the/entire/path\"));\n  }\n\n  @Test\n  public void requestLineUrl() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(8080)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"path: {{{request.url}}}\"));\n\n    assertThat(\n        transformedResponseDef.getBody(), is(\"path: /the/entire/path?query1=one&query2=two\"));\n  }\n\n  @Test\n  public void requestLineBaseUrlNonStandardPort() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(8080)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"baseUrl: {{{request.baseUrl}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"baseUrl: https://my.domain.io:8080\"));\n  }\n\n  @Test\n  public void requestLineBaseUrlHttp() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(80)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"baseUrl: {{{request.baseUrl}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"baseUrl: https://my.domain.io\"));\n  }\n\n  @Test\n  public void requestLineBaseUrlHttps() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(443)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"baseUrl: {{{request.baseUrl}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"baseUrl: https://my.domain.io\"));\n  }\n\n  @Test\n  public void requestLinePathSegment() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(8080)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"path segments: {{{request.pathSegments}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"path segments: /the/entire/path\"));\n  }\n\n  @Test\n  public void requestLinePathSegment0() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest()\n                .scheme(\"https\")\n                .host(\"my.domain.io\")\n                .port(8080)\n                .url(\"/the/entire/path?query1=one&query2=two\"),\n            aResponse().withBody(\"path segments 0: {{{request.pathSegments.[0]}}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"path segments 0: the\"));\n  }\n\n  @Test\n  public void requestLinequeryParameters() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things?multi_param=one&multi_param=two&single-param=1234\"),\n            aResponse()\n                .withBody(\n                    \"Multi 1: {{request.query.multi_param.[0]}}, Multi 2: {{request.query.multi_param.[1]}}, Single 1: {{request.query.single-param}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"Multi 1: one, Multi 2: two, Single 1: 1234\"));\n  }\n\n  @Test\n  public void requestIdIsAvailableIdInTheTemplateModel() {\n    final UUID id = UUID.randomUUID();\n\n    ResponseDefinition transformedResponseDef =\n        transform(mockRequest().url(\"/things\").id(id), aResponse().withBody(\"{{request.id}}\"));\n\n    String requestId = transformedResponseDef.getBody();\n    assertThat(requestId, notNullValue());\n    assertThat(requestId, is(id.toString()));\n  }\n\n  @Test\n  public void trimContent() {\n    String body =\n        transform(\n            \"\"\"\n            {{#trim}}\n            {\n              \"data\": \"spaced out JSON\"\n            }\n                 {{/trim}}\"\"\");\n\n    assertThat(\n        body, is(\"\"\"\n            {\n              \"data\": \"spaced out JSON\"\n            }\"\"\"));\n  }\n\n  @Test\n  public void trimValue() {\n    String body = transform(\"{{trim '   stuff  '}}\");\n    assertThat(body, is(\"stuff\"));\n  }\n\n  @Test\n  public void base64EncodeContent() {\n    String body = transform(\"{{#base64}}hello{{/base64}}\");\n    assertThat(body, is(\"aGVsbG8=\"));\n  }\n\n  @Test\n  public void base64EncodeValue() {\n    String body = transform(\"{{{base64 'hello'}}}\");\n    assertThat(body, is(\"aGVsbG8=\"));\n  }\n\n  @Test\n  public void base64EncodeValueWithoutPadding() {\n    String body = transform(\"{{{base64 'hello' padding=false}}}\");\n    assertThat(body, is(\"aGVsbG8\"));\n  }\n\n  @Test\n  public void base64DecodeValue() {\n    String body = transform(\"{{{base64 'aGVsbG8=' decode=true}}}\");\n    assertThat(body, is(\"hello\"));\n  }\n\n  @Test\n  public void base64DecodeValueWithoutPadding() {\n    String body = transform(\"{{{base64 'aGVsbG8' decode=true}}}\");\n    assertThat(body, is(\"hello\"));\n  }\n\n  @Test\n  public void urlEncodeValueInline() {\n    String body = transform(\"{{{urlEncode 'one two'}}}\");\n    assertThat(body, is(\"one+two\"));\n  }\n\n  @Test\n  public void urlEncodeValueBlock() {\n    String body = transform(\"{{#urlEncode}}Content to encode{{/urlEncode}}\");\n    assertThat(body, is(\"Content+to+encode\"));\n  }\n\n  @Test\n  public void urlDecodeValueInline() {\n    String body = transform(\"{{{urlEncode 'one+two' decode=true}}}\");\n    assertThat(body, is(\"one two\"));\n  }\n\n  @Test\n  public void urlDecodeValueBlock() {\n    String body = transform(\"{{#urlEncode decode=true}}Content%20to%20decode{{/urlEncode}}\");\n    assertThat(body, is(\"Content to decode\"));\n  }\n\n  @Test\n  public void extractFormValue() {\n    String body =\n        transform(\n            \"{{{formData request.body 'form'}}}{{{form.item2}}}\",\n            \"item1=one&item2=two%202&item3=three%203\");\n    assertThat(body, is(\"two%202\"));\n  }\n\n  @Test\n  public void extractFormMultiValue() {\n    String body =\n        transform(\n            \"{{{formData request.body 'form'}}}{{form.item.1}}\", \"item=1&item=two%202&item=3\");\n    assertThat(body, is(\"two%202\"));\n  }\n\n  @Test\n  public void extractFormValueWithUrlDecoding() {\n    String body =\n        transform(\n            \"{{{formData request.body 'form' urlDecode=true}}}{{{form.item2}}}\",\n            \"item1=one&item2=two%202&item3=three%203\");\n    assertThat(body, is(\"two 2\"));\n  }\n\n  @Test\n  public void extractSingleRegexValue() {\n    String body = transform(\"{{regexExtract request.body '[A-Z]+'}}\", \"abc-DEF-123\");\n    assertThat(body, is(\"DEF\"));\n  }\n\n  @Test\n  public void extractMultipleRegexValues() {\n    String body =\n        transform(\n            \"{{regexExtract request.body '([a-z]+)-([A-Z]+)-([0-9]+)' 'parts'}}{{parts.0}},{{parts.1}},{{parts.2}}\",\n            \"abc-DEF-123\");\n    assertThat(body, is(\"abc,DEF,123\"));\n  }\n\n  @Test\n  public void returnsReasonableDefaultWhenRegexExtractDoesNotMatchAnything() {\n    assertThat(transform(\"{{regexExtract 'abc' '[0-9]+'}}\"), is(\"[ERROR: Nothing matched [0-9]+]\"));\n  }\n\n  @Test\n  public void regexExtractSupportsSpecifyingADefaultForWhenNothingMatches() {\n    assertThat(\n        transform(\"{{regexExtract 'abc' '[0-9]+' default='my default value'}}\"),\n        is(\"my default value\"));\n  }\n\n  @Test\n  public void calculateStringSize() {\n    String body = transform(\"{{size 'abcde'}}\");\n    assertThat(body, is(\"5\"));\n  }\n\n  @Test\n  public void calculateListSize() {\n    String body =\n        transform(\n                mockRequest().url(\"/stuff?things=1&things=2&things=3&things=4\"),\n                ok(\"{{size request.query.things}}\"))\n            .getBody();\n\n    assertThat(body, is(\"4\"));\n  }\n\n  @Test\n  public void calculateMapSize() {\n    String body =\n        transform(mockRequest().url(\"/stuff?one=1&two=2&three=3\"), ok(\"{{size request.query}}\"))\n            .getBody();\n\n    assertThat(body, is(\"3\"));\n  }\n\n  @Test\n  public void firstListElement() {\n    String body =\n        transform(\n                mockRequest().url(\"/stuff?things=1&things=2&things=3&things=4\"),\n                ok(\"{{request.query.things.first}}\"))\n            .getBody();\n\n    assertThat(body, is(\"1\"));\n  }\n\n  @Test\n  public void lastListElement() {\n    String body =\n        transform(\n                mockRequest().url(\"/stuff?things=1&things=2&things=3&things=4\"),\n                ok(\"{{request.query.things.last}}\"))\n            .getBody();\n\n    assertThat(body, is(\"4\"));\n  }\n\n  @Test\n  public void listElementOffsetFromEnd() {\n    String body =\n        transform(\n                mockRequest().url(\"/stuff?things=1&things=2&things=3&things=4\"),\n                ok(\"{{request.query.things.[-2]}}\"))\n            .getBody();\n\n    assertThat(body, is(\"2\"));\n  }\n\n  @Test\n  public void listElementOffsetFromEnd2() {\n    String body =\n        transform(\n                mockRequest().url(\"/stuff?things=1&things=2&things=3&things=4\"),\n                ok(\"{{request.query.things.[-1]}}\"))\n            .getBody();\n\n    assertThat(body, is(\"3\"));\n  }\n\n  @Test\n  public void picksRandomElementFromLiteralList() {\n    Set<String> bodyValues = new HashSet<>();\n    for (int i = 0; i < 30; i++) {\n      String body = transform(\"{{{pickRandom '1' '2' '3'}}}\");\n      bodyValues.add(body);\n    }\n\n    assertThat(bodyValues, hasItem(\"1\"));\n    assertThat(bodyValues, hasItem(\"2\"));\n    assertThat(bodyValues, hasItem(\"3\"));\n  }\n\n  @Test\n  public void picksRandomElementFromListVariable() {\n    String body =\n        transform(\n            \"{{{pickRandom (jsonPath request.body '$.names')}}}\",\n            \"{ \\\"names\\\": [\\\"Rob\\\", \\\"Tom\\\", \\\"Gus\\\"] }\");\n    assertThat(body, anyOf(is(\"Gus\"), is(\"Tom\"), is(\"Rob\")));\n  }\n\n  @Test\n  void picksRandomObjectFromListVariable() {\n    String body =\n        transform(\n            \"\"\"\n            {{val (parseJson '{\"level\":1}') assign='one'}}\n            {{val (parseJson '{\"level\":2}') assign='two'}}\n            {{val (parseJson '{\"level\":3}') assign='three'}}\n            {{lookup (pickRandom (array one two three)) 'level'}}\"\"\");\n\n    assertThat(body.trim(), anyOf(is(\"1\"), is(\"2\"), is(\"3\")));\n  }\n\n  @RepeatedTest(10)\n  void picksMultipleRandomItemsFromListVariableWhenCountSpecified() {\n    String body =\n        transform(\n            \"{{val (pickRandom (array 1 2 3 4 5) count=3) assign='result'}}{{result.0}} {{result.1}} {{result.2}} size={{size result}}\");\n\n    assertThat(body, matchesRegex(\"\\\\d \\\\d \\\\d size=3\"));\n    assertThat(body.split(\" \")[0], not(body.split(\" \")[1]));\n  }\n\n  @Test\n  void picksAsManyRandomItemsAsPossibleFromListVariableWhenCountSpecifiedHigherThanItemCount() {\n    String body =\n        transform(\"{{val (pickRandom (array 1 2 3 4 5) count=8) assign='result'}}{{size result}}\");\n\n    assertThat(body, matchesRegex(\"5\"));\n  }\n\n  @Test\n  public void squareBracketedRequestParameters1() {\n    String body =\n        transform(\n                mockRequest().url(\"/stuff?things[1]=one&things[2]=two&things[3]=three\"),\n                ok(\"{{lookup request.query 'things[2]'}}\"))\n            .getBody();\n\n    assertThat(body, is(\"two\"));\n  }\n\n  @Test\n  public void squareBracketedRequestParameters2() {\n    String body =\n        transform(\n                mockRequest().url(\"/stuff?filter[order_id]=123\"),\n                ok(\"Order ID: {{lookup request.query 'filter[order_id]'}}\"))\n            .getBody();\n\n    assertThat(body, is(\"Order ID: 123\"));\n  }\n\n  @Test\n  public void correctlyRendersWhenContentExistsEitherSideOfTemplate() {\n    String body =\n        transform(\n                mockRequest().url(\"/stuff?one=1&two=2\"),\n                ok(\"Start \\n\\n {{request.query.one}} middle {{{request.query.two}}} end\\n\"))\n            .getBody();\n\n    assertThat(body, is(\"Start \\n\\n 1 middle 2 end\\n\"));\n  }\n\n  @Test\n  public void clearsTemplateCacheOnReset() {\n    transform(\"{{now}}\");\n    assertThat(transformer.getCacheSize(), greaterThan(0L));\n\n    transformer.afterStubsReset();\n\n    assertThat(transformer.getCacheSize(), is(0L));\n  }\n\n  @Test\n  public void clearsTemplateCacheWhenAnyStubRemovedReset() {\n    transform(\"{{now}}\");\n    assertThat(transformer.getCacheSize(), greaterThan(0L));\n\n    transformer.afterStubRemoved(get(anyUrl()).build());\n\n    assertThat(transformer.getCacheSize(), is(0L));\n  }\n\n  @Test\n  public void honoursCacheSizeLimit() {\n    transformer = ExtensionFactoryUtils.buildTemplateTransformer(3L);\n\n    transform(\"{{now}} 1\");\n    transform(\"{{now}} 2\");\n    transform(\"{{now}} 3\");\n    transform(\"{{now}} 4\");\n    transform(\"{{now}} 5\");\n\n    assertThat(transformer.getCacheSize(), is(3L));\n  }\n\n  @Test\n  public void honours0CacheSizeLimit() {\n    transformer = ExtensionFactoryUtils.buildTemplateTransformer(0L);\n\n    transform(\"{{now}} 1\");\n    transform(\"{{now}} 2\");\n    transform(\"{{now}} 3\");\n    transform(\"{{now}} 4\");\n    transform(\"{{now}} 5\");\n\n    assertThat(transformer.getCacheSize(), is(0L));\n  }\n\n  @Test\n  public void arrayStyleQueryParametersCanBeResolvedViaLookupHelper() {\n    ResponseDefinition transformedResponseDef =\n        transform(\n            mockRequest().url(\"/things?ids[]=111&ids[]=222&ids[]=333\"),\n            aResponse()\n                .withBody(\n                    \"1: {{lookup request.query 'ids[].0'}}, 2: {{lookup request.query 'ids[].1'}}, 3: {{lookup request.query 'ids[].2'}}\"));\n\n    assertThat(transformedResponseDef.getBody(), is(\"1: 111, 2: 222, 3: 333\"));\n  }\n\n  @Test\n  public void generatesARandomInt() {\n    assertThat(transform(\"{{randomInt}}\"), matchesPattern(\"[\\\\-0-9]+\"));\n    assertThat(transform(\"{{randomInt lower=5 upper=9}}\"), matchesPattern(\"[5-9]\"));\n    assertThat(transform(\"{{randomInt lower='5' upper='9'}}\"), matchesPattern(\"[5-9]\"));\n    assertThat(transformToInt(\"{{randomInt upper=54323}}\"), lessThanOrEqualTo(9));\n    assertThat(transformToInt(\"{{randomInt lower=-24}}\"), greaterThanOrEqualTo(-24));\n  }\n\n  @Test\n  public void generatesARandomDecimal() {\n    assertThat(transform(\"{{randomDecimal}}\"), matchesPattern(\"[\\\\-0-9.E]+\"));\n    assertThat(\n        transformToDouble(\"{{randomDecimal lower=-10.1 upper=-0.9}}\"),\n        allOf(greaterThanOrEqualTo(-10.1), lessThanOrEqualTo(-0.9)));\n    assertThat(\n        transformToDouble(\"{{randomDecimal lower='-10.1' upper='-0.9'}}\"),\n        allOf(greaterThanOrEqualTo(-10.1), lessThanOrEqualTo(-0.9)));\n    assertThat(transformToDouble(\"{{randomDecimal upper=12.5}}\"), lessThanOrEqualTo(12.5));\n    assertThat(transformToDouble(\"{{randomDecimal lower=-24.01}}\"), greaterThanOrEqualTo(-24.01));\n    assertThat(\n        transformToDouble(\"{{randomDecimal lower=-1 upper=1}}\"),\n        Matchers.allOf(greaterThanOrEqualTo(-1.0), lessThanOrEqualTo(1.0)));\n  }\n\n  @Test\n  public void generatesARangeOfNumbersInAnArray() {\n    assertThat(transform(\"{{range 3 8}}\"), is(\"[3, 4, 5, 6, 7, 8]\"));\n    assertThat(transform(\"{{range '3' '8'}}\"), is(\"[3, 4, 5, 6, 7, 8]\"));\n    assertThat(transform(\"{{range -2 2}}\"), is(\"[-2, -1, 0, 1, 2]\"));\n    assertThat(\n        transform(\"{{range 555}}\"),\n        is(\"[ERROR: The range helper requires both lower and upper bounds as integer parameters]\"));\n  }\n\n  @Test\n  public void generatesAnArrayLiteral() {\n    assertThat(transform(\"{{array 1 'two' true}}\"), is(\"[1, two, true]\"));\n    assertThat(transform(\"{{array}}\"), is(\"[]\"));\n  }\n\n  @Test\n  void addsArrayItemWthSpecifiedIntegerPosition() {\n    assertThat(transform(\"{{arrayAdd (array 1 'three') 2 position=1}}\"), is(\"[1, 2, three]\"));\n  }\n\n  @Test\n  void addsArrayItemWthSpecifiedStartPosition() {\n    assertThat(transform(\"{{arrayAdd (array 1 'three') 2 position='start'}}\"), is(\"[2, 1, three]\"));\n  }\n\n  @Test\n  void addsArrayItemWthSpecifiedEndPosition() {\n    assertThat(transform(\"{{arrayAdd (array 1 'three') 2 position='end'}}\"), is(\"[1, three, 2]\"));\n  }\n\n  @Test\n  void addsArrayItemWithNoPositionAddsToEnd() {\n    assertThat(transform(\"{{arrayAdd (array 1 'three') 2}}\"), is(\"[1, three, 2]\"));\n  }\n\n  @Test\n  void addsArrayItemWithNegativePositionThrowsAnError() {\n    assertThat(\n        transform(\"{{arrayAdd (array 1 'three') 2 position=-2}}\"),\n        is(\n            \"[ERROR: position must be greater than or equal to 0 and less than or equal to the size of the list]\"));\n  }\n\n  @Test\n  void addsArrayItemWithPositionGreaterThanTheArrayLengthThrowsAnError() {\n    assertThat(\n        transform(\"{{arrayAdd (array 1 'three') 2 position=3}}\"),\n        is(\n            \"[ERROR: position must be greater than or equal to 0 and less than or equal to the size of the list]\"));\n  }\n\n  @Test\n  void addsArrayItemWithMissingValueToAdd() {\n    assertThat(\n        transform(\"{{arrayAdd (array 1 'three') position=1}}\"),\n        is(\"[ERROR: Missing required parameter: additional value to add to list]\"));\n  }\n\n  @Test\n  void deletesArrayItemWthSpecifiedIntegerPosition() {\n    assertThat(transform(\"{{arrayRemove (array 1 2 'three') position=1}}\"), is(\"[1, three]\"));\n  }\n\n  @Test\n  void deletesArrayItemWthSpecifiedStartPosition() {\n    assertThat(transform(\"{{arrayRemove (array 1 2 'three') position='start'}}\"), is(\"[2, three]\"));\n  }\n\n  @Test\n  void deletesArrayItemWthSpecifiedEndPosition() {\n    assertThat(transform(\"{{arrayRemove (array 1 2 'three') position='end'}}\"), is(\"[1, 2]\"));\n  }\n\n  @Test\n  void deletesArrayItemWithNoPositionRemovesFromEnd() {\n    assertThat(transform(\"{{arrayRemove (array 1 2 'three') }}\"), is(\"[1, 2]\"));\n  }\n\n  @Test\n  void deletesArrayItemWithNegativePositionThrowsAnError() {\n    assertThat(\n        transform(\"{{arrayRemove (array 1 'three') position=-2}}\"),\n        is(\n            \"[ERROR: position must be greater than or equal to 0 and less than or equal to the size of the list]\"));\n  }\n\n  @Test\n  void deletesArrayItemWithPositionGreaterThanTheArrayLengthThrowsAnError() {\n    assertThat(\n        transform(\"{{arrayRemove (array 1 'three') position=3}}\"),\n        is(\n            \"[ERROR: position must be greater than or equal to 0 and less than or equal to the size of the list]\"));\n  }\n\n  @Test\n  public void parsesJsonLiteralToAMapOfMapsVariable() {\n    String result =\n        transform(\n            \"\"\"\n            {{#parseJson 'parsedObj'}}\n            {\n              \"name\": \"transformed\"\n            }\n            {{/parseJson}}\n            {{parsedObj.name}}\"\"\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"transformed\"));\n  }\n\n  @Test\n  public void parsesJsonVariableToAMapOfMapsVariable() {\n    String result =\n        transform(\n            \"\"\"\n            {{#assign 'json'}}\n            {\n              \"name\": \"transformed\"\n            }\n            {{/assign}}\n            {{parseJson json 'parsedObj'}}\n            {{parsedObj.name}}\n            \"\"\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"transformed\"));\n  }\n\n  @Test\n  public void parsesJsonVariableToAndReturns() {\n    String result =\n        transform(\n            \"\"\"\n            {{#assign 'json'}}\n            {\n              \"name\": \"transformed\"\n            }\n            {{/assign}}\n            {{lookup (parseJson json) 'name'}}\"\"\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"transformed\"));\n  }\n\n  @Test\n  public void parseJsonReportsInvalidParameterErrors() {\n    assertThat(transform(\"{{parseJson}}\"), is(\"[ERROR: Missing required JSON string parameter]\"));\n  }\n\n  @Test\n  public void parsesEmptyJsonLiteralToAnEmptyMap() {\n    String result =\n        transform(\n            \"\"\"\n            {{#parseJson 'parsedObj'}}\n            {\n            }\n            {{/parseJson}}\n            \"\"\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"\"));\n  }\n\n  @Test\n  public void parsesEmptyJsonVariableToAnEmptyMap() {\n    String result =\n        transform(\n            \"\"\"\n            {{#assign 'json'}}\n            {\n            }\n            {{/assign}}\n            {{parseJson json 'parsedObj'}}\n            \"\"\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"\"));\n  }\n\n  @Test\n  public void conditionalBranchingOnStringMatchesRegexInline() {\n    assertThat(transform(\"{{#if (matches '123' '[0-9]+')}}YES{{/if}}\"), is(\"YES\"));\n    assertThat(transform(\"{{#if (matches 'abc' '[0-9]+')}}YES{{/if}}\"), is(\"\"));\n  }\n\n  @Test\n  public void conditionalBranchingOnStringMatchesRegexBlock() {\n    assertThat(transform(\"{{#matches '123' '[0-9]+'}}YES{{/matches}}\"), is(\"YES\"));\n    assertThat(transform(\"{{#matches 'abc' '[0-9]+'}}YES{{/matches}}\"), is(\"\"));\n  }\n\n  @Test\n  public void matchesRegexReturnsErrorIfMissingParameter() {\n    assertThat(\n        transform(\"{{#matches '123'}}YES{{/matches}}\"),\n        is(\"[ERROR: You must specify the string to be matched and the regular expression]\"));\n  }\n\n  @Test\n  public void conditionalBranchingOnStringContainsInline() {\n    assertThat(transform(\"{{#if (contains 'abcde' 'abc')}}YES{{/if}}\"), is(\"YES\"));\n    assertThat(transform(\"{{#if (contains 'abcde' '123')}}YES{{/if}}\"), is(\"\"));\n  }\n\n  @Test\n  public void stringContainsCopesWithNullString() {\n    assertThat(transform(\"{{#if (contains 'abcde' request.query.nonexist)}}YES{{/if}}\"), is(\"\"));\n  }\n\n  @Test\n  public void conditionalBranchingOnStringContainsBlock() {\n    assertThat(transform(\"{{#contains 'abcde' 'abc'}}YES{{/contains}}\"), is(\"YES\"));\n    assertThat(transform(\"{{#contains 'abcde' '123'}}YES{{/contains}}\"), is(\"\"));\n  }\n\n  @Test\n  public void conditionalBranchingOnArrayContainsBlock() {\n    assertThat(transform(\"{{#contains (array 'a' 'b' 'c') 'a'}}YES{{/contains}}\"), is(\"YES\"));\n    assertThat(transform(\"{{#contains (array 'a' 'b' 'c') 'z'}}YES{{/contains}}\"), is(\"\"));\n  }\n\n  @Test\n  public void mathematicalOperations() {\n    assertThat(transform(\"{{math 1 '+' 2}}\"), is(\"3\"));\n    assertThat(transform(\"{{math 4 '-' 2}}\"), is(\"2\"));\n    assertThat(transform(\"{{math 2 '*' 3}}\"), is(\"6\"));\n    assertThat(transform(\"{{math 8 '/' 2}}\"), is(\"4\"));\n    assertThat(transform(\"{{math 10 '%' 3}}\"), is(\"1\"));\n  }\n\n  @Test\n  public void dateTruncation() {\n    assertThat(\n        transform(\"{{date (truncateDate (parseDate '2021-06-29T11:22:33Z') 'first hour of day')}}\"),\n        is(\"2021-06-29T00:00:00Z\"));\n  }\n\n  @Test\n  public void formatDecimalAsCurrencyWithLocale() {\n    assertThat(transform(\"{{{numberFormat 123.456 'currency' 'en_GB'}}}\"), is(\"£123.46\"));\n  }\n\n  @Test\n  public void canTruncateARenderableDateToFirstOfMonth() {\n    String result =\n        transform(\"{{date (truncateDate (now) 'first day of month') format='yyyy-MM-dd'}}\");\n\n    String expectedDate =\n        ZonedDateTime.now().with(TemporalAdjusters.firstDayOfMonth()).toLocalDate().toString();\n    assertThat(result, is(expectedDate));\n  }\n\n  @Test\n  public void canTruncateARenderableDateToFirstHourOfDay() {\n    String result =\n        transform(\n            \"{{date (truncateDate (now) 'first hour of day') format='yyyy-MM-dd\\\\'T\\\\'HH:mm'}}\");\n\n    String expectedDate = ZonedDateTime.now().truncatedTo(DAYS).toLocalDateTime().toString();\n\n    assertThat(result, is(expectedDate));\n  }\n\n  @Test\n  public void canParseLocalYearMonth() {\n    String result =\n        transform(\n            \"{{date (parseDate '2021-10' format='yyyy-MM') offset='+32 days' format='yyyy-MM'}}\");\n    String expected = YearMonth.of(2021, 11).toString();\n    assertThat(result, is(expected));\n  }\n\n  @Test\n  public void canParseLocalYear() {\n    String result = transform(\"{{date (parseDate '2021' format='yyyy') format='yyyy-MM'}}\");\n    String expected = YearMonth.of(2021, 1).toString();\n    assertThat(result, is(expected));\n  }\n\n  @Test\n  void valHelperReturnsDefaultsNullValue() {\n    assertThat(transform(\"{{val request.query.nonexist or='123'}}\"), is(\"123\"));\n    assertThat(transform(\"{{val request.query.nonexist default='123'}}\"), is(\"123\"));\n  }\n\n  @Test\n  void valHelperReturnsValueIfNotNullValue() {\n    assertThat(transform(\"{{val 'exists'}}\"), is(\"exists\"));\n    assertThat(transform(\"{{val null}}\"), is(\"\"));\n    assertThat(transform(\"{{val 'exists' or='123'}}\"), is(\"exists\"));\n    assertThat(transform(\"{{val 'exists' default='123'}}\"), is(\"exists\"));\n    assertThat(transform(\"{{val (array 1 2 3) default='123'}}\"), is(\"[1, 2, 3]\"));\n  }\n\n  @Test\n  void valHelperCanAssignValueToNamedVariable() {\n    assertThat(\n        transform(\"{{val 'value for myVar' assign='myVar'}}{{myVar}}\"), is(\"value for myVar\"));\n    assertThat(\n        transform(\"{{val null or='other value for myVar' assign='myVar'}}{{myVar}}\"),\n        is(\"other value for myVar\"));\n    assertThat(\n        transform(\"{{val null default='other value for myVar' assign='myVar'}}{{myVar}}\"),\n        is(\"other value for myVar\"));\n    assertThat(transform(\"{{val 12 assign='myVar'}}{{myVar}}\"), is(\"12\"));\n    assertThat(transform(\"{{val (array 1 2 3) assign='myVar'}}{{myVar}}\"), is(\"[1, 2, 3]\"));\n    assertThat(\n        transform(\"{{val (array 1 2 3) assign='myVar'}}{{arrayJoin '*' myVar}}\"), is(\"1*2*3\"));\n  }\n\n  @Test\n  void valHelperCanAssignValueToNamedVariableAndMaintainsType() {\n    assertThat(\n        transform(\"{{val 10 assign='myVar'}}{{#lt myVar 20}}Less Than{{else}}More Than{{/lt}}\"),\n        is(\"Less Than\"));\n  }\n\n  @Test\n  public void joinWithObjectBody() {\n    String result =\n        transform(\n            \"\"\"\n            {{#parseJson 'myThings'}}\n            [\n              { \"id\": 1, \"name\": \"One\" },\n              { \"id\": 2, \"name\": \"Two\" },\n              { \"id\": 3, \"name\": \"Three\" }\n            ]\n            {{/parseJson}}\\\n            [{{#arrayJoin ',' myThings as |item|}}\\\n            {\n            \"name{{item.id}}\": \"{{item.name}}\"\n            }\n            {{/arrayJoin}}]\"\"\");\n\n    assertThat(\n        result,\n        equalToCompressingWhiteSpace(\n            \"[{\\n\\\"name1\\\": \\\"One\\\"\\n}\\n,{\\n\\\"name2\\\": \\\"Two\\\"\\n}\\n,{\\n\\\"name3\\\": \\\"Three\\\"\\n}\\n]\"));\n  }\n\n  @Test\n  public void joinWithArrayOfStrings() {\n    String result = transform(\"{{arrayJoin ',' (array 'One\\n' 'Two' 'Three')}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"One\\n,Two,Three\"));\n  }\n\n  @Test\n  public void joinWithItemsListed() {\n    String result = transform(\"{{arrayJoin ',' 'One\\n' 'Two' 'Three'}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"One\\n,Two,Three\"));\n  }\n\n  @Test\n  public void joinWithNumbersListed() {\n    String result = transform(\"{{arrayJoin ',' 1 2 3}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"1,2,3\"));\n  }\n\n  @Test\n  public void joinWithEmptyArray() {\n    String result = transform(\"{{arrayJoin ',' (array )}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"\"));\n  }\n\n  @Test\n  public void joinWithNoSeparatorShouldReturnError() {\n    String result = transform(\"{{arrayJoin (array 'One' 'Two' 'Three')}}\");\n\n    assertThat(\n        result, equalToCompressingWhiteSpace(\"[ERROR: Separator parameter must be a String]\\n\"));\n  }\n\n  @Test\n  public void joinWithNoParameterShouldReturnError() {\n    String result = transform(\"{{arrayJoin ','}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"[ERROR: The parameter must be list]\\n\"));\n  }\n\n  @Test\n  public void jsonExceptionShouldReturnError() {\n    String result = transform(\"{{#parseJson 'json'}}{ \\\"thing{{/parseJson}}\");\n\n    assertEquals(\n        \"[ERROR] Unexpected end-of-input in field name\\n\"\n            + \" at [Source: (String)\\\"{ \\\"thing\\\"; line: 1, column: 9]\",\n        result);\n  }\n\n  @Test\n  public void nonExistentHelperShouldReturnError() {\n    String result = transform(\"{{nonExist thing=123}}\");\n\n    assertEquals(\n        \"\"\"\n              [ERROR] 1:2: could not find helper: 'nonExist'\n              {{nonExist thing=123}}\n                ^\n              \"\"\",\n        result);\n  }\n\n  @Test\n  public void joinWithStringAsParameterShouldReturnError() {\n    String result = transform(\"{{arrayJoin ',' \\\"blablabla\\\"}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"blablabla\"));\n  }\n\n  @Test\n  public void joinWithItemsListedAndPrefixAndSuffix() {\n    String result =\n        transform(\"{{arrayJoin ',' (array 'One\\n' 'Two' 'Three') prefix=\\\"p..\\\" suffix=\\\"..s\\\"}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"p..One\\n,Two,Three..s\"));\n  }\n\n  @Test\n  public void joinWithNumbersListedAndPrefix() {\n    String result = transform(\"{{arrayJoin ',' 1 2 3  prefix='p..'}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"p..1,2,3\"));\n  }\n\n  @Test\n  public void joinWithNumbersListedAndSuffix() {\n    String result = transform(\"{{arrayJoin ',' 1 2 3 suffix='..s'}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"1,2,3..s\"));\n  }\n\n  @Test\n  public void joinWithNumbersListedAndPrefixAndSuffix() {\n    String result = transform(\"{{arrayJoin ',' 1 2 3  prefix='p..' suffix='..s'}}\");\n\n    assertThat(result, equalToCompressingWhiteSpace(\"p..1,2,3..s\"));\n  }\n\n  @Test\n  public void joinWithDifferentSeparators() {\n    String result1 = transform(\"{{arrayJoin (pickRandom ':') (array 'One' 'Two' 'Three')}}\");\n    assertThat(result1, equalToCompressingWhiteSpace(\"One:Two:Three\"));\n\n    String result2 = transform(\"{{arrayJoin '*' (array 1 2 3)}}\");\n    assertThat(result2, equalToCompressingWhiteSpace(\"1*2*3\"));\n\n    String result3 = transform(\"{{arrayJoin ' ' (array 'WireMock' 'Rocks')}}\");\n    assertThat(result3, equalToCompressingWhiteSpace(\"WireMock Rocks\"));\n\n    String result4 =\n        transform(\n            \"{{arrayJoin '' (array 'W' 'i' 'r' 'e' 'M' 'o' 'c' 'k' ' ' 'R' 'o' 'c' 'k' 's')}}\");\n    assertThat(result4, equalToCompressingWhiteSpace(\"WireMock Rocks\"));\n\n    String result5 = transform(\"{{arrayJoin \\\" - * - \\\" (array 'One' 'Two' 'Three')}}\");\n    assertThat(result5, equalToCompressingWhiteSpace(\"One - * - Two - * - Three\"));\n  }\n\n  private Integer transformToInt(String responseBodyTemplate) {\n    return Integer.parseInt(transform(responseBodyTemplate));\n  }\n\n  private Double transformToDouble(String responseBodyTemplate) {\n    return Double.parseDouble(transform(responseBodyTemplate));\n  }\n\n  private String transform(String responseBodyTemplate) {\n    final ResponseDefinitionBuilder responseDefinitionBuilder =\n        aResponse().withBody(responseBodyTemplate);\n    final StubMapping stub = get(\"/\").willReturn(responseDefinitionBuilder).build();\n    final MockRequest request = mockRequest();\n    return transform(newPostMatchServeEvent(request, responseDefinitionBuilder, stub)).getBody();\n  }\n\n  private String transform(String responseBodyTemplate, String requestBody) {\n    return transform(mockRequest().body(requestBody), aResponse().withBody(responseBodyTemplate))\n        .getBody();\n  }\n\n  private ResponseDefinition transform(\n      Request request, ResponseDefinitionBuilder responseDefinitionBuilder) {\n    final StubMapping stub = get(\"/\").willReturn(responseDefinitionBuilder).build();\n    return transform(newPostMatchServeEvent(request, responseDefinitionBuilder, stub));\n  }\n\n  private ResponseDefinition transform(ServeEvent serveEvent) {\n    return transformer.transform(serveEvent);\n  }\n\n  private ResponseDefinition transformFromResponseFile(\n      Request request, ResponseDefinitionBuilder responseDefinitionBuilder) {\n\n    final StubMapping stub = get(\"/\").willReturn(responseDefinitionBuilder).build();\n    return transformer.transform(\n        ServeEventFactory.newPostMatchServeEvent(request, responseDefinitionBuilder, stub));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/SystemKeyAuthorisorTest.java",
    "content": "/*\n * Copyright (C) 2019-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport java.util.Set;\nimport org.junit.jupiter.api.Test;\n\npublic class SystemKeyAuthorisorTest {\n\n  @Test\n  public void permitsAllowedKeys() {\n    SystemKeyAuthoriser authoriser = new SystemKeyAuthoriser(Set.of(\"allowed_.*\", \"permitted_.*\"));\n\n    assertTrue(authoriser.isPermitted(\"allowed_key_1\"));\n    assertTrue(authoriser.isPermitted(\"ALLOWED_KEY_2\"));\n    assertTrue(authoriser.isPermitted(\"permitted_key_3\"));\n  }\n\n  @Test\n  public void forbidsNonAllowedKeys() {\n    SystemKeyAuthoriser authoriser = new SystemKeyAuthoriser(Set.of(\"allowed_.*\", \"permitted_.*\"));\n\n    assertFalse(authoriser.isPermitted(\"forbidden_key_1\"));\n    assertFalse(authoriser.isPermitted(\"notallowed_key_2\"));\n    assertFalse(authoriser.isPermitted(\"notpermitted_key_3\"));\n  }\n\n  @Test\n  public void defaultsToWireMockPrefixIfNoPatternsSpecified() {\n    SystemKeyAuthoriser authoriser = new SystemKeyAuthoriser(null);\n\n    assertTrue(authoriser.isPermitted(\"wiremock_key_1\"));\n    assertTrue(authoriser.isPermitted(\"wiremock.thing.2\"));\n    assertFalse(authoriser.isPermitted(\"notallowed_key_2\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ArrayAddHelperTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.emptyMap;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport com.github.jknack.handlebars.Template;\nimport java.io.IOException;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ArrayAddHelperTest extends HandlebarsHelperTestBase {\n\n  ArrayAddHelper helper;\n\n  @BeforeEach\n  void init() {\n    helper = new ArrayAddHelper();\n  }\n\n  @Test\n  void appendsValueWhenNoPositionSpecified() throws Exception {\n    List<String> originalList = List.of(\"one\", \"two\");\n\n    Object result = render(originalList, \"three\", emptyMap());\n\n    assertThat(result, instanceOf(List.class));\n    List<Object> resultingList = (List<Object>) result;\n    assertThat(resultingList, contains(\"one\", \"two\", \"three\"));\n  }\n\n  @Test\n  void appendsValueWhenEndPositionSpecified() throws Exception {\n    List<String> originalList = List.of(\"one\", \"two\");\n\n    Object result = render(originalList, \"three\", Map.of(\"position\", \"end\"));\n\n    assertThat(result, instanceOf(List.class));\n    List<Object> resultingList = (List<Object>) result;\n    assertThat(resultingList, contains(\"one\", \"two\", \"three\"));\n  }\n\n  @Test\n  void prependsValueWhenStartPositionSpecified() throws Exception {\n    List<String> originalList = List.of(\"one\", \"two\");\n\n    Object result = render(originalList, \"three\", Map.of(\"position\", \"start\"));\n\n    assertThat(result, instanceOf(List.class));\n    List<Object> resultingList = (List<Object>) result;\n    assertThat(resultingList, contains(\"three\", \"one\", \"two\"));\n  }\n\n  @Test\n  void insertsValueAtPositionSpecifiedAsInteger() throws Exception {\n    List<String> originalList = List.of(\"one\", \"two\");\n\n    Object result = render(originalList, \"three\", Map.of(\"position\", 1));\n\n    assertThat(result, instanceOf(List.class));\n    List<Object> resultingList = (List<Object>) result;\n    assertThat(resultingList, contains(\"one\", \"three\", \"two\"));\n  }\n\n  @Test\n  void insertsValueAtPositionSpecifiedAsString() throws Exception {\n    List<String> originalList = List.of(\"one\", \"two\");\n\n    Object result = render(originalList, \"three\", Map.of(\"position\", \"1\"));\n\n    assertThat(result, instanceOf(List.class));\n    List<Object> resultingList = (List<Object>) result;\n    assertThat(resultingList, contains(\"one\", \"three\", \"two\"));\n  }\n\n  @Test\n  void returnsAnErrorWhenPostionNotValidType() throws IOException {\n    Object result = render(emptyList(), \"three\", Map.of(\"position\", \"abc\"));\n    assertThat(result.toString(), is(\"[ERROR: position must be 'start', 'end' or an integer]\"));\n  }\n\n  private Object render(List<?> originalList, Object value, Map<String, Object> keyValueOptions)\n      throws IOException {\n    final Options options =\n        new Options.Builder(null, null, TagType.VAR, createContext(), Template.EMPTY)\n            .setParams(new Object[] {value})\n            .setHash(keyValueOptions)\n            .build();\n    return helper.apply(originalList, options);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ArrayRemoveHelperTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static java.util.Collections.emptyMap;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.contains;\nimport static org.hamcrest.Matchers.instanceOf;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport com.github.jknack.handlebars.Template;\nimport java.io.IOException;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ArrayRemoveHelperTest extends HandlebarsHelperTestBase {\n\n  ArrayRemoveHelper helper;\n\n  @BeforeEach\n  void init() {\n    helper = new ArrayRemoveHelper();\n  }\n\n  @Test\n  void deletesTheLastValueWhenNoPositionSpecified() throws Exception {\n    List<String> originalList = List.of(\"one\", \"two\", \"three\");\n\n    Object result = render(originalList, emptyMap());\n\n    assertThat(result, instanceOf(List.class));\n    List<Object> resultingList = (List<Object>) result;\n    assertThat(resultingList, contains(\"one\", \"two\"));\n  }\n\n  @Test\n  void deletesTheValueAtTheIntegerPositionSpecified() throws Exception {\n    List<String> originalList = List.of(\"one\", \"two\", \"three\");\n\n    Object result = render(originalList, Map.of(\"position\", \"1\"));\n\n    assertThat(result, instanceOf(List.class));\n    List<Object> resultingList = (List<Object>) result;\n    assertThat(resultingList, contains(\"one\", \"three\"));\n  }\n\n  private Object render(List<?> originalList, Map<String, Object> keyValueOptions)\n      throws IOException {\n    final Options options =\n        new Options.Builder(null, null, TagType.VAR, createContext(), Template.EMPTY)\n            .setHash(keyValueOptions)\n            .build();\n    return helper.apply(originalList, options);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/FormatJsonHelperTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.EnabledOnOs;\nimport org.junit.jupiter.api.condition.OS;\n\npublic class FormatJsonHelperTest extends HandlebarsHelperTestBase {\n\n  static String compactJson = \"{\\\"foo\\\":true,\\\"bar\\\":{\\\"baz\\\":false}}\";\n\n  static String prettyJson = \"{\\n  \\\"foo\\\" : true,\\n  \\\"bar\\\" : {\\n    \\\"baz\\\" : false\\n  }\\n}\";\n  static String prettyJsonWindows =\n      \"{\\r\\n  \\\"foo\\\" : true,\\r\\n  \\\"bar\\\" : {\\r\\n    \\\"baz\\\" : false\\r\\n  }\\r\\n}\";\n\n  @Test\n  @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatJsonDefaultsToPrettyFormatWhenNoFormatSpecified() {\n    String responseTemplate = \"{{#formatJson}} \" + compactJson + \" {{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(prettyJson));\n  }\n\n  @Test\n  @EnabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatJsonDefaultsToPrettyFormatWhenNoFormatSpecifiedWindows() {\n    String responseTemplate = \"{{#formatJson}} \" + compactJson + \" {{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(prettyJsonWindows));\n  }\n\n  @Test\n  @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatJsonPrettyFormatReturnsJsonPrettyPrinted() {\n    String responseTemplate = \"{{#formatJson format='pretty'}} \" + compactJson + \" {{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(prettyJson));\n  }\n\n  @Test\n  @EnabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatJsonPrettyFormatReturnsJsonPrettyPrintedWindows() {\n    String responseTemplate = \"{{#formatJson format='pretty'}} \" + compactJson + \" {{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(prettyJsonWindows));\n  }\n\n  @Test\n  void formatJsonCompactFormatReturnsJsonInCompactFormat() {\n    String responseTemplate = \"{{#formatJson format='compact'}} \" + prettyJson + \" {{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(compactJson));\n  }\n\n  @Test\n  void formatJsonFormatsJsonInAVariable() {\n    String responseTemplate =\n        \"{{~#assign 'someJson'~}} \"\n            + prettyJson\n            + \" {{/assign}}{{formatJson someJson format='compact'}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(compactJson));\n  }\n\n  @Test\n  void anInvalidFormatFieldResultsInAnError() {\n    String responseTemplate = \"{{#formatJson format='foo'}} \" + compactJson + \" {{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\"[ERROR: formatJson: format [foo] should be one of [pretty, compact]]\"));\n  }\n\n  @Test\n  void formatJsonReturnsAnErrorWhenJsonIsInvalid() {\n    String responseTemplate = \"{{#formatJson format=\\\"compact\\\"}} {\\\"foo\\\":true,} {{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\"[ERROR: There was an error parsing the json. Please make sure the json is valid]\"));\n  }\n\n  @Test\n  void emptyJsonPassedIntoTheFormatJsonHelper() {\n    String responseTemplate = \"{{#formatJson}}{{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"[ERROR: formatJson should take a block of JSON to format or a single parameter of type String]\"));\n  }\n\n  @Test\n  void noContentPassedIntoTheFormatJsonHelper() {\n    String responseTemplate = \"{{formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"[ERROR: formatJson should take a block of JSON to format or a single parameter of type String]\"));\n  }\n\n  @Test\n  void nullVariablePassedToTheFormatJsonHelper() {\n    String responseTemplate = \"{{formatJson nullVariable}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"[ERROR: formatJson should take a block of JSON to format or a single parameter of type String]\"));\n  }\n\n  @Test\n  void whitespacePassedIntoTheFormatJsonHelper() {\n    String responseTemplate = \"{{#formatJson}}                  {{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"[ERROR: formatJson should take a block of JSON to format or a single parameter of type String]\"));\n  }\n\n  @Test\n  void invalidFormatType() {\n    String responseTemplate = \"{{#formatJson format=1}} \" + prettyJson + \" {{/formatJson}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"[ERROR: formatJson: format [1] of type [java.lang.Integer should be a Format or a String and one of [pretty, compact]]]\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/FormatXmlHelperTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.EnabledOnOs;\nimport org.junit.jupiter.api.condition.OS;\n\npublic class FormatXmlHelperTest extends HandlebarsHelperTestBase {\n\n  @Test\n  @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatXmlHelperFormatsXmlPrettilyByDefault() {\n    String responseTemplate =\n        \"{{#formatXml}}\\n<foo><bar\\n    >wh</bar></foo\\n    >\\n{{/formatXml}}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"<foo>\\n  <bar>wh</bar>\\n</foo>\\n\"));\n  }\n\n  @Test\n  @EnabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatXmlHelperFormatsXmlPrettilyByDefaultWindows() {\n    String responseTemplate =\n        \"{{#formatXml}}\\n<foo><bar\\n    >wh</bar></foo\\n    >\\n{{/formatXml}}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"<foo>\\r\\n  <bar>wh</bar>\\r\\n</foo>\\r\\n\"));\n  }\n\n  @Test\n  @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatXmlHelperFormatsXmlInAVariable() {\n    String responseTemplate =\n        \"{{~#assign 'someXml'~}}\\n\"\n            + \"<foo><bar\\n\"\n            + \"    >wh</bar></foo\\n\"\n            + \"    >\\n\"\n            + \"{{/assign}}\\n\"\n            + \"{{~formatXml someXml format='pretty'~}}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"<foo>\\n  <bar>wh</bar>\\n</foo>\\n\"));\n  }\n\n  @Test\n  @EnabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatXmlHelperFormatsXmlInAVariableWindows() {\n    String responseTemplate =\n        \"{{~#assign 'someXml'~}}\\n\"\n            + \"<foo><bar\\n\"\n            + \"    >wh</bar></foo\\n\"\n            + \"    >\\n\"\n            + \"{{/assign}}\\n\"\n            + \"{{~formatXml someXml format='pretty'~}}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"<foo>\\r\\n  <bar>wh</bar>\\r\\n</foo>\\r\\n\"));\n  }\n\n  @Test\n  @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatXmlHelperFormatsXmlPrettily() {\n    String responseTemplate =\n        \"{{#formatXml format='pretty'}}\\n\"\n            + \"  <foo><bar\\n\"\n            + \">wh</bar></foo\\n\"\n            + \">\\n\"\n            + \"{{/formatXml}}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"<foo>\\n  <bar>wh</bar>\\n</foo>\\n\"));\n  }\n\n  @Test\n  @EnabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void formatXmlHelperFormatsXmlPrettilyWindows() {\n    String responseTemplate =\n        \"{{#formatXml format='pretty'}}\\n\"\n            + \"  <foo><bar\\n\"\n            + \">wh</bar></foo\\n\"\n            + \">\\n\"\n            + \"{{/formatXml}}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"<foo>\\r\\n  <bar>wh</bar>\\r\\n</foo>\\r\\n\"));\n  }\n\n  @Test\n  void formatXmlHelperGivesGoodErrorOnUnknownFormat() {\n    String responseTemplate =\n        \"{{#formatXml format='traditional'}}\\n\"\n            + \"<foo><bar\\n\"\n            + \"    >wh</bar></foo\\n\"\n            + \"    >\\n\"\n            + \"{{/formatXml}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\"[ERROR: formatXml: format [traditional] should be one of [pretty, compact]]\"));\n  }\n\n  @Test\n  void formatXmlHelperGivesGoodErrorOnNoInput() {\n    String responseTemplate = \"{{formatXml}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"[ERROR: formatXml should take a block of XML to format or a single parameter of type String]\"));\n  }\n\n  @Test\n  void formatXmlHelperGivesGoodErrorOnInvalidXml() {\n    String responseTemplate = \"{{#formatXml}}<foo>Not well formed!</bar>{{/formatXml}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"[ERROR: Input is not valid XML]\"));\n  }\n\n  @Test\n  void formatXmlHelperFormatsXmlCompact() {\n    String responseTemplate =\n        \"{{#formatXml format='compact'}}\\n\"\n            + \"<foo><bar\\n\"\n            + \"    >wh</bar></foo\\n\"\n            + \"    >\\n\"\n            + \"{{/formatXml}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"<foo><bar>wh</bar></foo>\"));\n  }\n\n  @Test\n  void formatXmlHelperFormatsPrettyXmlCompact() {\n    String responseTemplate =\n        \"{{#formatXml format='compact'}}\\n\"\n            + \"<foo>\\n\"\n            + \"  <bar>wh</bar>\\n\"\n            + \"</foo>\\n\"\n            + \"{{/formatXml}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"<foo><bar>wh</bar></foo>\"));\n  }\n\n  @Test\n  void invalidFormatType() {\n    String responseTemplate =\n        \"{{#formatXml format=1}}\\n\"\n            + \"<foo>\\n\"\n            + \"  <bar>wh</bar>\\n\"\n            + \"</foo>\\n\"\n            + \"{{/formatXml}}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"[ERROR: formatXml: format [1] of type [java.lang.Integer should be a Format or a String and one of [pretty, compact]]]\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsCurrentDateHelperTest.java",
    "content": "/*\n * Copyright (C) 2018-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HandlebarsHelperTestBase.transform;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.testsupport.ExtensionFactoryUtils.buildTemplateTransformer;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.LocalNotifier;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.testsupport.WireMatchers;\nimport java.io.IOException;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class HandlebarsCurrentDateHelperTest {\n\n  private HandlebarsCurrentDateHelper helper;\n  private ResponseTemplateTransformer transformer;\n\n  @BeforeEach\n  public void init() {\n    helper = new HandlebarsCurrentDateHelper();\n    transformer = buildTemplateTransformer(true);\n\n    LocalNotifier.set(new ConsoleNotifier(true));\n  }\n\n  @Test\n  public void rendersNowDateTime() throws Exception {\n    Map<String, Object> optionsHash = Map.of();\n\n    Object output = render(optionsHash);\n\n    assertThat(output, instanceOf(RenderableDate.class));\n    assertThat(output.toString(), WireMatchers.matches(\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:]+Z$\"));\n  }\n\n  @Test\n  public void rendersNowDateTimeWithCustomFormat() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"format\", \"yyyy/mm/dd\");\n\n    Object output = render(optionsHash);\n\n    assertThat(output, instanceOf(RenderableDate.class));\n    assertThat(output.toString(), WireMatchers.matches(\"^[0-9]{4}/[0-9]{2}/[0-9]{2}$\"));\n  }\n\n  @Test\n  public void rendersPassedDateTimeWithDayOffset() throws Exception {\n    String format = \"yyyy-MM-dd\";\n    SimpleDateFormat df = new SimpleDateFormat(format);\n    Map<String, Object> optionsHash = Map.of(\"format\", format, \"offset\", \"5 days\");\n\n    Object output = render(df.parse(\"2018-04-16\"), optionsHash);\n\n    assertThat(output.toString(), is(\"2018-04-21\"));\n  }\n\n  @Test\n  public void rendersNowWithDayOffset() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"offset\", \"6 months\");\n\n    Object output = render(optionsHash);\n\n    System.out.println(output);\n  }\n\n  @Test\n  public void rendersNowAsUnixEpochInMilliseconds() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"format\", \"epoch\");\n\n    Date date = new Date();\n    Object output = render(date, optionsHash);\n\n    assertThat(output.toString(), is(String.valueOf(date.getTime())));\n  }\n\n  @Test\n  public void rendersNowAsUnixEpochInSeconds() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"format\", \"unix\");\n\n    Date date = new Date();\n    Object output = render(date, optionsHash);\n\n    assertThat(output.toString(), is(String.valueOf(date.getTime() / 1000L)));\n  }\n\n  @Test\n  public void adjustsISO8601ToSpecifiedTimezone() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"offset\", \"3 days\", \"timezone\", \"Australia/Sydney\");\n\n    Date inputDate =\n        new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SS'Z'\").parse(\"2023-10-07T00:00:00.00Z\");\n    Object output = render(inputDate, optionsHash);\n\n    assertThat(output.toString(), is(\"2023-10-10T00:00:00+11:00\"));\n  }\n\n  @Test\n  public void adjustsCustomFormatToSpecifiedTimezone() throws Exception {\n    Map<String, Object> optionsHash =\n        Map.of(\n            \"offset\", \"3 days\", \"timezone\", \"Australia/Sydney\", \"format\", \"yyyy-MM-dd HH:mm:ssZ\");\n\n    Date inputDate =\n        new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SS'Z'\").parse(\"2023-10-07T00:00:00.00Z\");\n    Object output = render(inputDate, optionsHash);\n\n    assertThat(output.toString(), is(\"2023-10-10 00:00:00+1100\"));\n  }\n\n  @Test\n  public void helperIsIncludedInTemplateTransformerWithNowTagName() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/random-value\"),\n            aResponse().withBody(\"{{now offset='6 days'}}\"));\n\n    String body = responseDefinition.getBody().trim();\n    assertThat(body, WireMatchers.matches(\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:]+Z$\"));\n  }\n\n  @Test\n  public void helperIsIncludedInTemplateTransformerWithDateTagName() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/random-value\"),\n            aResponse().withBody(\"{{date offset='6 days'}}\"));\n\n    String body = responseDefinition.getBody().trim();\n    assertThat(body, WireMatchers.matches(\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:]+Z$\"));\n  }\n\n  @Test\n  public void acceptsDateParameterwithDateTagName() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/parsed-date\"),\n            aResponse().withBody(\"{{date (parseDate '2018-05-05T10:11:12Z') offset='-1 days'}}\"));\n\n    String body = responseDefinition.getBody().trim();\n    assertThat(body, is(\"2018-05-04T10:11:12Z\"));\n  }\n\n  private Object render(Map<String, Object> optionsHash) throws IOException {\n    return render(null, optionsHash);\n  }\n\n  private Object render(Date context, Map<String, Object> optionsHash) throws IOException {\n    return helper.apply(\n        context, new Options.Builder(null, null, null, null, null).setHash(optionsHash).build());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsHelperTestBase.java",
    "content": "/*\n * Copyright (C) 2017-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.stubbing.ServeEventFactory.newPostMatchServeEvent;\nimport static com.github.tomakehurst.wiremock.testsupport.ExtensionFactoryUtils.buildTemplateTransformer;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.jknack.handlebars.*;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.RequestCache;\nimport com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformerV2;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.hamcrest.Matcher;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.BeforeEach;\n\npublic abstract class HandlebarsHelperTestBase {\n\n  protected ResponseTemplateTransformer transformer;\n  protected RequestCache requestCache;\n\n  @BeforeEach\n  public void initRequestCache() {\n    transformer = buildTemplateTransformer(true);\n    requestCache = new RequestCache();\n  }\n\n  protected static final String FAIL_GRACEFULLY_MSG =\n      \"Handlebars helper should fail gracefully and show the issue directly in the response.\";\n\n  protected <T> void testHelperError(\n      Helper<T> helper, T content, String pathExpression, Matcher<String> expectation) {\n    try {\n      assertThat((String) renderHelperValue(helper, content, pathExpression), expectation);\n    } catch (final IOException e) {\n      Assertions.fail(FAIL_GRACEFULLY_MSG);\n    }\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  protected <R, C> R renderHelperValue(Helper<C> helper, C content, Object... parameters)\n      throws IOException {\n    return (R) helper.apply(content, createOptions(parameters));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  protected <R, C> R renderHelperValue(\n      Helper<C> helper, C value, Map<String, Object> keyValueOptions, Object... parameters)\n      throws IOException {\n    final Options options =\n        new Options.Builder(null, null, TagType.VAR, createContext(), Template.EMPTY)\n            .setParams(new Object[] {value})\n            .setHash(keyValueOptions)\n            .build();\n    return (R) helper.apply(value, options);\n  }\n\n  protected <T> void testHelper(Helper<T> helper, T content, String optionParam, String expected)\n      throws IOException {\n    testHelper(helper, content, optionParam, is(expected));\n  }\n\n  protected <T> void testHelper(\n      Helper<T> helper, T content, String optionParam, Matcher<String> expected)\n      throws IOException {\n    assertThat(helper.apply(content, createOptions(map(), optionParam)).toString(), expected);\n  }\n\n  protected Options createOptions(Object... optionParams) {\n    return createOptions(map(), optionParams);\n  }\n\n  protected Options createOptions(Map<String, Object> hash, Object... optionParams) {\n    return createOptions(requestCache, hash, optionParams);\n  }\n\n  protected Options createOptions(\n      RequestCache requestCache, Map<String, Object> hash, Object... optionParams) {\n    Context context = createContext(requestCache);\n\n    return new Options(\n        null, null, null, context, null, null, optionParams, hash, new ArrayList<String>(0));\n  }\n\n  protected Context createContext() {\n    return createContext(requestCache);\n  }\n\n  private Context createContext(RequestCache requestCache) {\n    return Context.newBuilder(null).combine(\"requestCache\", requestCache).build();\n  }\n\n  protected static Map<String, Object> map() {\n    return new HashMap<>();\n  }\n\n  protected static Map<String, Object> map(String key, Object value) {\n    final HashMap<String, Object> map = new HashMap<>();\n    map.put(key, value);\n    return map;\n  }\n\n  public static ResponseDefinition transform(\n      ResponseDefinitionTransformerV2 transformer,\n      Request request,\n      ResponseDefinitionBuilder responseDefinitionBuilder) {\n    return transformer.transform(newPostMatchServeEvent(request, responseDefinitionBuilder));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsJsonPathHelperTest.java",
    "content": "/*\n * Copyright (C) 2017-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.testsupport.ExtensionFactoryUtils.buildExtension;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalToJson;\nimport static java.util.Collections.emptyList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.jknack.handlebars.Context;\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.LocalNotifier;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.testsupport.MockWireMockServices;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.EnabledOnOs;\nimport org.junit.jupiter.api.condition.OS;\n\npublic class HandlebarsJsonPathHelperTest extends HandlebarsHelperTestBase {\n\n  private HandlebarsJsonPathHelper helper;\n\n  @BeforeEach\n  public void init() {\n    helper = new HandlebarsJsonPathHelper();\n    LocalNotifier.set(new ConsoleNotifier(true));\n  }\n\n  @Test\n  public void mergesASimpleValueFromRequestIntoResponseBody() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/json\").body(\"{\\\"a\\\": {\\\"test\\\": \\\"success\\\"}}\"),\n            aResponse().withBody(\"{\\\"test\\\": \\\"{{jsonPath request.body '$.a.test'}}\\\"}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"{\\\"test\\\": \\\"success\\\"}\"));\n  }\n\n  @Test\n  @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  public void mergesAnObjectValueFromRequestIntoResponseBody() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/json\").body(\"{\\\"a\\\": {\\\"test\\\": \\\"success\\\"}}\"),\n            aResponse().withBody(\"{\\\"check\\\": {{jsonPath request.body '$.a'}} }\"));\n\n    assertThat(responseDefinition.getBody(), is(\"{\\\"check\\\": {\\n  \\\"test\\\" : \\\"success\\\"\\n} }\"));\n  }\n\n  @Test\n  @EnabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  public void mergesAnObjectValueFromRequestIntoResponseBodyWindows() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/json\").body(\"{\\\"a\\\": {\\\"test\\\": \\\"success\\\"}}\"),\n            aResponse().withBody(\"{\\\"check\\\": {{jsonPath request.body '$.a'}} }\"));\n\n    assertThat(\n        responseDefinition.getBody(), is(\"{\\\"check\\\": {\\r\\n  \\\"test\\\" : \\\"success\\\"\\r\\n} }\"));\n  }\n\n  @Test\n  @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  public void mergesAnArrayValueFromRequestIntoResponseBody() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .url(\"/json\")\n                .body(\n                    \"{\\n\"\n                        + \"    \\\"items\\\": [\\n\"\n                        + \"        {\\n\"\n                        + \"            \\\"name\\\": \\\"One\\\"\\n\"\n                        + \"        },\\n\"\n                        + \"        {\\n\"\n                        + \"            \\\"name\\\": \\\"Two\\\"\\n\"\n                        + \"        },\\n\"\n                        + \"        {\\n\"\n                        + \"            \\\"name\\\": \\\"Three\\\"\\n\"\n                        + \"        }\\n\"\n                        + \"    ]\\n\"\n                        + \"}\"),\n            aResponse().withBody(\"{\\\"test\\\": {{jsonPath request.body '$.items'}} }\"));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"{\\\"test\\\": [ {\\n  \\\"name\\\" : \\\"One\\\"\\n}, {\\n  \\\"name\\\" : \\\"Two\\\"\\n}, {\\n  \\\"name\\\" : \\\"Three\\\"\\n} ] }\"));\n  }\n\n  @Test\n  @EnabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  public void mergesAnArrayValueFromRequestIntoResponseBodyWindows() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .url(\"/json\")\n                .body(\n                    \"{\\n\"\n                        + \"    \\\"items\\\": [\\n\"\n                        + \"        {\\n\"\n                        + \"            \\\"name\\\": \\\"One\\\"\\n\"\n                        + \"        },\\n\"\n                        + \"        {\\n\"\n                        + \"            \\\"name\\\": \\\"Two\\\"\\n\"\n                        + \"        },\\n\"\n                        + \"        {\\n\"\n                        + \"            \\\"name\\\": \\\"Three\\\"\\n\"\n                        + \"        }\\n\"\n                        + \"    ]\\n\"\n                        + \"}\"),\n            aResponse().withBody(\"{\\\"test\\\": {{jsonPath request.body '$.items'}} }\"));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"{\\\"test\\\": [ {\\r\\n  \\\"name\\\" : \\\"One\\\"\\r\\n}, {\\r\\n  \\\"name\\\" : \\\"Two\\\"\\r\\n}, {\\r\\n  \\\"name\\\" : \\\"Three\\\"\\r\\n} ] }\"));\n  }\n\n  @Test\n  public void includesAnErrorInTheResponseBodyWhenTheJsonPathIsInvalid() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/json\").body(\"{\\\"a\\\": {\\\"test\\\": \\\"success\\\"}}\"),\n            aResponse().withBody(\"{\\\"test\\\": \\\"{{jsonPath request.body '$![bbb'}}\\\"}\"));\n\n    assertThat(\n        responseDefinition.getBody(), startsWith(\"{\\\"test\\\": \\\"\" + HandlebarsHelper.ERROR_PREFIX));\n  }\n\n  @Test\n  public void listResultFromJsonPathQueryCanBeUsedByHandlebarsEachHelper() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .url(\"/json\")\n                .body(\n                    \"{\\n\"\n                        + \"    \\\"items\\\": [\\n\"\n                        + \"        {\\n\"\n                        + \"            \\\"name\\\": \\\"One\\\"\\n\"\n                        + \"        },\\n\"\n                        + \"        {\\n\"\n                        + \"            \\\"name\\\": \\\"Two\\\"\\n\"\n                        + \"        },\\n\"\n                        + \"        {\\n\"\n                        + \"            \\\"name\\\": \\\"Three\\\"\\n\"\n                        + \"        }\\n\"\n                        + \"    ]\\n\"\n                        + \"}\"),\n            aResponse()\n                .withBody(\n                    \"{{#each (jsonPath request.body '$.items') as |item|}}{{item.name}} {{/each}}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"One Two Three \"));\n  }\n\n  @Test\n  public void mapResultFromJsonPathQueryCanBeUsedByHandlebarsEachHelper() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .url(\"/json\")\n                .body(\n                    \"{\\n\"\n                        + \"    \\\"items\\\": {\\n\"\n                        + \"        \\\"one\\\": 1,\\n\"\n                        + \"        \\\"two\\\": 2,\\n\"\n                        + \"        \\\"three\\\": 3\\n\"\n                        + \"    }\\n\"\n                        + \"}\"),\n            aResponse()\n                .withBody(\n                    \"{{#each (jsonPath request.body '$.items') as |value key|}}{{key}}: {{value}} {{/each}}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"one: 1 two: 2 three: 3 \"));\n  }\n\n  @Test\n  public void singleValueResultFromJsonPathQueryCanBeUsedByHandlebarsIfHelper() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .url(\"/json\")\n                .body(\n                    \"{\\n\"\n                        + \"    \\\"items\\\": {\\n\"\n                        + \"        \\\"one\\\": true,\\n\"\n                        + \"        \\\"two\\\": false,\\n\"\n                        + \"        \\\"three\\\": true\\n\"\n                        + \"    }\\n\"\n                        + \"}\"),\n            aResponse()\n                .withBody(\n                    \"{{#if (jsonPath request.body '$.items.one')}}One{{/if}}\\n\"\n                        + \"{{#if (jsonPath request.body '$.items.two')}}Two{{/if}}\"));\n\n    assertThat(responseDefinition.getBody(), containsString(\"One\"));\n    assertThat(responseDefinition.getBody(), not(containsString(\"Two\")));\n  }\n\n  @Test\n  public void extractsASingleStringValueFromTheInputJson() throws IOException {\n    testHelper(helper, \"{\\\"test\\\":\\\"success\\\"}\", \"$.test\", \"success\");\n  }\n\n  @Test\n  public void extractsASingleNumberValueFromTheInputJson() throws IOException {\n    testHelper(helper, \"{\\\"test\\\": 1.2}\", \"$.test\", \"1.2\");\n  }\n\n  @Test\n  public void extractsASingleBooleanValueFromTheInputJson() throws IOException {\n    testHelper(helper, \"{\\\"test\\\": false}\", \"$.test\", \"false\");\n  }\n\n  @Test\n  public void extractsAJsonObjectFromTheInputJson() throws IOException {\n    testHelper(\n        helper,\n        \"{                          \\n\"\n            + \"    \\\"outer\\\": {               \\n\"\n            + \"        \\\"inner\\\": \\\"Sanctum\\\" \\n\"\n            + \"    }                          \\n\"\n            + \"}\",\n        \"$.outer\",\n        equalToJson(\n            \"{                         \\n\" + \"        \\\"inner\\\": \\\"Sanctum\\\" \\n\" + \"    }\"));\n  }\n\n  @Test\n  public void extractsAJsonArrayFromTheInputJson() throws IOException {\n    testHelper(\n        helper, \"{\\n\" + \"    \\\"things\\\": [1, 2, 3]\\n\" + \"}\", \"$.things\", equalToJson(\"[1, 2, 3]\"));\n  }\n\n  @Test\n  public void rendersAMeaningfulErrorWhenInputJsonIsInvalid() {\n    testHelperError(\n        helper,\n        \"{\\\"test\\\":\\\"success}\",\n        \"$.test\",\n        is(\"[ERROR: {\\\"test\\\":\\\"success} is not valid JSON]\"));\n  }\n\n  @Test\n  public void rendersAMeaningfulErrorWhenJsonPathIsInvalid() {\n    testHelperError(\n        helper,\n        \"{\\\"test\\\":\\\"success\\\"}\",\n        \"$==test\",\n        is(\"[ERROR: $==test is not a valid JSONPath expression]\"));\n  }\n\n  @Test\n  public void rendersAnEmptyStringWhenJsonValueUndefined() {\n    testHelperError(helper, \"{\\\"test\\\":\\\"success\\\"}\", \"$.test2\", is(\"\"));\n  }\n\n  @Test\n  public void rendersAnEmptyStringWhenJsonValueUndefinedAndOptionsEmpty() throws Exception {\n    Map<String, Object> options = Map.of();\n    String output = render(\"{\\\"test\\\":\\\"success\\\"}\", \"$.test2\", options);\n    assertThat(output, is(\"\"));\n  }\n\n  @Test\n  public void rendersDefaultValueWhenShallowJsonValueUndefined() throws Exception {\n    Map<String, Object> options = Map.of(\"default\", \"0\");\n    String output = render(\"{}\", \"$.test\", options);\n    assertThat(output, is(\"0\"));\n  }\n\n  @Test\n  public void rendersDefaultValueWhenDeepJsonValueUndefined() throws Exception {\n    Map<String, Object> options = Map.of(\"default\", \"0\");\n    String output = render(\"{}\", \"$.outer.inner[0]\", options);\n    assertThat(output, is(\"0\"));\n  }\n\n  @Test\n  public void rendersDefaultValueWhenJsonValueNull() throws Exception {\n    Map<String, Object> options = Map.of(\"default\", \"0\");\n    String output = render(\"{\\\"test\\\":null}\", \"$.test\", options);\n    assertThat(output, is(\"0\"));\n  }\n\n  @Test\n  public void ignoresDefaultWhenJsonValueEmpty() throws Exception {\n    Map<String, Object> options = Map.of(\"default\", \"0\");\n    String output = render(\"{\\\"test\\\":\\\"\\\"}\", \"$.test\", options);\n    assertThat(output, is(\"\"));\n  }\n\n  @Test\n  public void ignoresDefaultWhenJsonValueZero() throws Exception {\n    Map<String, Object> options = Map.of(\"default\", \"1\");\n    String output = render(\"{\\\"test\\\":0}\", \"$.test\", options);\n    assertThat(output, is(\"0\"));\n  }\n\n  private String render(String content, String path, Map<String, Object> options)\n      throws IOException {\n    return helper\n        .apply(\n            content,\n            new Options.Builder(null, null, null, createContext(), null)\n                .setParams(new Object[] {path})\n                .setHash(options)\n                .build())\n        .toString();\n  }\n\n  @Test\n  public void rendersAnEmptyStringWhenJsonIsNull() {\n    testHelperError(helper, null, \"$.test\", is(\"\"));\n  }\n\n  @Test\n  public void rendersAnEmptyStringWhenJsonIsEmptyString() {\n    testHelperError(helper, \"\", \"$.test\", is(\"\"));\n  }\n\n  @Test\n  public void rendersAMeaningfulErrorWhenJsonPathIsNull() {\n    testHelperError(\n        helper, \"{\\\"test\\\":\\\"success}\", null, is(\"[ERROR: The JSONPath cannot be empty]\"));\n  }\n\n  @Test\n  public void extractsValueFromAMap() {\n    ResponseTemplateTransformer transformer =\n        (ResponseTemplateTransformer)\n            buildExtension(\n                new MockWireMockServices(),\n                services ->\n                    List.of(\n                        new ResponseTemplateTransformer(\n                            services.getTemplateEngine(), true, services.getFiles(), emptyList()) {\n                          @Override\n                          protected Map<String, Object> addExtraModelElements(\n                              Request request,\n                              ResponseDefinition responseDefinition,\n                              FileSource files,\n                              Parameters parameters) {\n                            return Map.of(\"mapData\", Map.of(\"things\", \"abc\"));\n                          }\n                        }));\n\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer, mockRequest(), aResponse().withBody(\"{{jsonPath mapData '$.things'}}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"abc\"));\n  }\n\n  @Test\n  public void returnsCorrectResultWhenSameExpressionUsedTwiceOnIdenticalDocuments()\n      throws Exception {\n    String one = renderHelperValue(helper, \"{\\\"test\\\": \\\"one\\\"}\", \"$.test\");\n    String two = renderHelperValue(helper, \"{\\\"test\\\": \\\"one\\\"}\", \"$.test\");\n\n    assertThat(one, is(\"one\"));\n    assertThat(two, is(\"one\"));\n  }\n\n  @Test\n  public void returnsCorrectResultWhenSameExpressionUsedTwiceOnDifferentDocuments()\n      throws Exception {\n    String one = renderHelperValue(helper, \"{\\\"test\\\": \\\"one\\\"}\", \"$.test\");\n    String two = renderHelperValue(helper, \"{\\\"test\\\": \\\"two\\\"}\", \"$.test\");\n\n    assertThat(one, is(\"one\"));\n    assertThat(two, is(\"two\"));\n  }\n\n  @Test\n  public void returnsCorrectResultWhenDifferentExpressionsUsedOnSameDocument() throws Exception {\n    int one =\n        renderHelperValue(\n            helper,\n            \"{\\n\" + \"  \\\"test\\\": {\\n\" + \"    \\\"one\\\": 1,\\n\" + \"    \\\"two\\\": 2\\n\" + \"  }\\n\" + \"}\",\n            \"$.test.one\");\n    int two =\n        renderHelperValue(\n            helper,\n            \"{\\n\" + \"  \\\"test\\\": {\\n\" + \"    \\\"one\\\": 1,\\n\" + \"    \\\"two\\\": 2\\n\" + \"  }\\n\" + \"}\",\n            \"$.test.two\");\n\n    assertThat(one, is(1));\n    assertThat(two, is(2));\n  }\n\n  @Test\n  public void helperCanBeCalledDirectlyWithoutSupplyingRequestCache() throws Exception {\n    Context context = Context.newBuilder(null).build();\n    Options options =\n        new Options(\n            null,\n            null,\n            null,\n            context,\n            null,\n            null,\n            new Object[] {\"$.stuff\"},\n            null,\n            new ArrayList<>(0));\n\n    Object result = helper.apply(\"{\\\"stuff\\\":1}\", options);\n\n    assertThat(result, instanceOf(Integer.class));\n    assertThat((Integer) result, is(1));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsRandomValuesHelperTest.java",
    "content": "/*\n * Copyright (C) 2018-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.stubbing.ServeEventFactory.newPostMatchServeEvent;\nimport static com.github.tomakehurst.wiremock.testsupport.ExtensionFactoryUtils.buildTemplateTransformer;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.LocalNotifier;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.testsupport.WireMatchers;\nimport java.io.IOException;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class HandlebarsRandomValuesHelperTest {\n\n  private HandlebarsRandomValuesHelper helper;\n  private ResponseTemplateTransformer transformer;\n\n  @BeforeEach\n  public void init() {\n    helper = new HandlebarsRandomValuesHelper();\n    transformer = buildTemplateTransformer(true);\n\n    LocalNotifier.set(new ConsoleNotifier(true));\n  }\n\n  @Test\n  public void generatesRandomAlphaNumericOfSpecifiedLength() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"length\", 36);\n\n    String output = render(optionsHash);\n\n    assertThat(output.length(), is(36));\n    assertThat(output, WireMatchers.matches(\"^[a-z0-9]+$\"));\n  }\n\n  @Test\n  public void generatesUppercaseRandomAlphaNumericOfSpecifiedLength() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"length\", 36, \"uppercase\", true);\n\n    String output = render(optionsHash);\n\n    assertThat(output.length(), is(36));\n    assertThat(output, WireMatchers.matches(\"^[A-Z0-9]+$\"));\n  }\n\n  @Test\n  public void generatesRandomAlphabeticOfSpecifiedLength() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"length\", 43, \"type\", \"ALPHABETIC\", \"uppercase\", true);\n\n    String output = render(optionsHash);\n\n    assertThat(output.length(), is(43));\n    assertThat(output, WireMatchers.matches(\"^[A-Z]+$\"));\n  }\n\n  @Test\n  public void generatesRandomNumericOfSpecifiedLength() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"length\", 55, \"type\", \"NUMERIC\");\n\n    String output = render(optionsHash);\n\n    assertThat(output.length(), is(55));\n    assertThat(output, WireMatchers.matches(\"^[0-9]+$\"));\n  }\n\n  @Test\n  public void generatesRandomStringOfSpecifiedLength() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"length\", 67, \"type\", \"ALPHANUMERIC_AND_SYMBOLS\");\n\n    String output = render(optionsHash);\n\n    assertThat(output.length(), is(67));\n    assertThat(output, WireMatchers.matches(\"^.+$\"));\n  }\n\n  @Test\n  public void generatesRandomHexadecimalOfSpecifiedLength() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"length\", 64, \"type\", \"HEXADECIMAL\");\n\n    String output = render(optionsHash);\n\n    assertThat(output.length(), is(64));\n    assertThat(output, WireMatchers.matches(\"^[0-9a-f]+$\"));\n  }\n\n  @Test\n  public void randomValuesCanBeAssignedToVariables() {\n    ServeEvent serveEvent =\n        newPostMatchServeEvent(\n            mockRequest().url(\"/random-value\"),\n            aResponse()\n                .withBody(\n                    \"{{#assign 'paymentId'}}{{randomValue length=20 type='ALPHANUMERIC' uppercase=true}}{{/assign}}\\n\"\n                        + \"{{paymentId}}\\n\"\n                        + \"{{paymentId}}\"));\n\n    final ResponseDefinition responseDefinition = this.transformer.transform(serveEvent);\n\n    String[] bodyLines = responseDefinition.getBody().trim().split(\"\\n\");\n    assertThat(bodyLines[0], is(bodyLines[1]));\n    assertThat(bodyLines[0].length(), is(20));\n  }\n\n  @Test\n  public void generatesRandomUUID() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"type\", \"UUID\");\n\n    String output = render(optionsHash);\n\n    assertThat(output.length(), is(36));\n    assertThat(output, WireMatchers.matches(\"^[a-z0-9\\\\-]+$\"));\n  }\n\n  private String render(Map<String, Object> optionsHash) throws IOException {\n    return helper\n        .apply(null, new Options.Builder(null, null, null, null, null).setHash(optionsHash).build())\n        .toString();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsSoapHelperTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.testsupport.ExtensionFactoryUtils.buildTemplateTransformer;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.io.IOException;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class HandlebarsSoapHelperTest extends HandlebarsHelperTestBase {\n\n  private HandlebarsSoapHelper helper;\n  private ResponseTemplateTransformer transformer;\n\n  @BeforeEach\n  public void init() {\n    this.helper = new HandlebarsSoapHelper();\n    this.transformer = buildTemplateTransformer(true);\n  }\n\n  @Test\n  public void extractsASimpleBodyValue() throws IOException {\n    testHelper(\n        this.helper,\n        \"<Envelope><Body><test>success</test></Body></Envelope>\",\n        \"/test/text()\",\n        \"success\");\n  }\n\n  @Test\n  public void rendersASimpleValue() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .url(\"/soap\")\n                .body(\n                    \"<soap:Envelope xmlns:soap=\\\"http://www.w3.org/2003/05/soap-envelope/\\\"><soap:Body><m:a><m:test>success</m:test></m:a></soap:Body></soap:Envelope>\"),\n            aResponse().withBody(\"<test>{{soapXPath request.body '/a/test/text()'}}</test>\"));\n\n    assertThat(responseDefinition.getBody(), is(\"<test>success</test>\"));\n  }\n\n  @Test\n  public void negativeTestResponseTemplate() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .url(\"/soap\")\n                .body(\n                    \"<soap:Envelope xmlns:soap=\\\"http://www.w3.org/2003/05/soap-envelope/\\\"><soap:Body><m:a><m:test>success</m:test></m:a></soap:Body></soap:Envelope>\"),\n            aResponse().withBody(\"<test>{{soapXPath request.body '/b/test'}}</test>\"));\n\n    assertThat(responseDefinition.getBody(), is(\"<test></test>\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsXPathHelperTest.java",
    "content": "/*\n * Copyright (C) 2017-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalToXml;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalToCompressingWhiteSpace;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.startsWith;\n\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.io.IOException;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class HandlebarsXPathHelperTest extends HandlebarsHelperTestBase {\n\n  private HandlebarsXPathHelper helper;\n\n  @BeforeEach\n  public void init() {\n    helper = new HandlebarsXPathHelper();\n  }\n\n  @Test\n  public void rendersASimpleValue() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/xml\").body(\"<a><test>success</test></a>\"),\n            aResponse().withBody(\"<test>{{xPath request.body '/a/test/text()'}}</test>\"));\n\n    assertThat(responseDefinition.getBody(), is(\"<test>success</test>\"));\n  }\n\n  @Test\n  public void rendersNothingWhenTheXPathExpressionResolvesNoContent() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/xml\").body(\"<a><test>success</test></a>\"),\n            aResponse().withBody(\"<test>{{xPath request.body '/b/test'}}</test>\"));\n\n    assertThat(responseDefinition.getBody(), startsWith(\"<test></test>\"));\n  }\n\n  @Test\n  public void extractsASimpleValue() throws IOException {\n    testHelper(helper, \"<test>success</test>\", \"/test/text()\", \"success\");\n  }\n\n  @Test\n  public void extractsAnAttribute() throws IOException {\n    testHelper(helper, \"<test outcome=\\\"success\\\"/>\", \"/test/@outcome\", \"success\");\n  }\n\n  @Test\n  public void extractsASubElement() throws IOException {\n    testHelper(\n        helper,\n        \"<outer>\\n\" + \"    <inner>stuff</inner>\\n\" + \"</outer>\",\n        \"/outer/inner\",\n        equalToXml(\"<inner>stuff</inner>\"));\n  }\n\n  @Test\n  public void rendersAMeaningfulErrorWhenTheInputXmlIsInvalid() {\n    testHelperError(\n        helper,\n        \"<testsuccess</test>\",\n        \"/test\",\n        is(\"[ERROR: <testsuccess</test> is not valid XML]\"));\n  }\n\n  @Test\n  public void rendersAMeaningfulErrorWhenTheXPathExpressionIsInvalid() {\n    testHelperError(\n        helper,\n        \"<test>success</test>\",\n        \"/\\\\test\",\n        is(\"[ERROR: /\\\\test is not a valid XPath expression]\"));\n  }\n\n  @Test\n  public void rendersAMeaningfulErrorWhenTheXPathExpressionIsAbsent() {\n    testHelperError(\n        helper, \"<test>success</test>\", null, is(\"[ERROR: The XPath expression cannot be empty]\"));\n  }\n\n  @Test\n  public void rendersABlankWhenTheInputXmlIsAbsent() {\n    testHelperError(helper, null, \"/test\", is(\"\"));\n  }\n\n  @Test\n  public void returnsCorrectResultWhenSameExpressionUsedTwiceOnIdenticalDocuments()\n      throws Exception {\n    String one = renderHelperValue(helper, \"<test>one</test>\", \"/test/text()\").toString();\n    String two = renderHelperValue(helper, \"<test>one</test>\", \"/test/text()\").toString();\n\n    assertThat(one, is(\"one\"));\n    assertThat(two, is(\"one\"));\n  }\n\n  @Test\n  public void returnsCorrectResultWhenSameExpressionUsedTwiceOnDifferentDocuments()\n      throws Exception {\n    String one = renderHelperValue(helper, \"<test>one</test>\", \"/test/text()\").toString();\n    String two = renderHelperValue(helper, \"<test>two</test>\", \"/test/text()\").toString();\n\n    assertThat(one, is(\"one\"));\n    assertThat(two, is(\"two\"));\n  }\n\n  @Test\n  public void returnsCorrectResultWhenDifferentExpressionsUsedOnSameDocument() throws Exception {\n    String one =\n        renderHelperValue(helper, \"<test><one>1</one><two>2</two></test>\", \"/test/one/text()\")\n            .toString();\n    String two =\n        renderHelperValue(helper, \"<test><one>1</one><two>2</two></test>\", \"/test/two/text()\")\n            .toString();\n\n    assertThat(one, is(\"1\"));\n    assertThat(two, is(\"2\"));\n  }\n\n  @Test\n  public void rendersXmlWhenElementIsSelected() throws Exception {\n    String one =\n        renderHelperValue(helper, \"<test><one>1</one><two>2</two></test>\", \"/test/one\").toString();\n    assertThat(one.trim(), is(\"<one>1</one>\"));\n  }\n\n  @Test\n  public void supportsIterationOverNodeListWithEachHelper() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .body(\n                    \"<?xml version=\\\"1.0\\\"?>\\n\"\n                        + \"<stuff>\\n\"\n                        + \"    <thing>One</thing>\\n\"\n                        + \"    <thing>Two</thing>\\n\"\n                        + \"    <thing>Three</thing>\\n\"\n                        + \"</stuff>\"),\n            aResponse()\n                .withBody(\n                    \"{{#each (xPath request.body '/stuff/thing/text()') as |thing|}}{{thing}} {{/each}}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"One Two Three \"));\n  }\n\n  @Test\n  public void supportsIterationOverElementsWithAttributes() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .body(\n                    \"<?xml version=\\\"1.0\\\"?>\\n\"\n                        + \"<stuff>\\n\"\n                        + \"    <thing id=\\\"1\\\">One</thing>\\n\"\n                        + \"    <thing id=\\\"2\\\">Two</thing>\\n\"\n                        + \"    <thing id=\\\"3\\\">Three</thing>\\n\"\n                        + \"</stuff>\"),\n            aResponse()\n                .withBody(\n                    \"{{#each (xPath request.body '/stuff/thing') as |thing|}}{{{thing.attributes.id}}} {{/each}}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"1 2 3 \"));\n  }\n\n  @Test\n  public void supportsIterationOverNamespacedElements() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .body(\n                    \"<?xml version=\\\"1.0\\\"?>\\n\"\n                        + \"<stuff xmlns:th=\\\"https://thing.com\\\">\\n\"\n                        + \"    <th:thing>One</th:thing>\\n\"\n                        + \"    <th:thing>Two</th:thing>\\n\"\n                        + \"    <th:thing>Three</th:thing>\\n\"\n                        + \"</stuff>\"),\n            aResponse()\n                .withBody(\n                    \"{{#each (xPath request.body '/stuff/thing') as |thing|}}{{{thing.text}}} {{/each}}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"One Two Three \"));\n  }\n\n  @Test\n  public void rendersNamespacedElement() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .body(\n                    \"<?xml version=\\\"1.0\\\"?>\\n\"\n                        + \"<stuff xmlns:th=\\\"https://thing.com\\\">\\n\"\n                        + \"    <th:thing>One</th:thing>\\n\"\n                        + \"    <th:thing>Two</th:thing>\\n\"\n                        + \"    <th:thing>Three</th:thing>\\n\"\n                        + \"</stuff>\"),\n            aResponse().withBody(\"{{{xPath request.body '/stuff'}}}\"));\n\n    assertThat(\n        responseDefinition.getBody(),\n        equalToCompressingWhiteSpace(\n            \"<stuff xmlns:th=\\\"https://thing.com\\\">\\n\"\n                + \"    <th:thing>One</th:thing>\\n\"\n                + \"    <th:thing>Two</th:thing>\\n\"\n                + \"    <th:thing>Three</th:thing>\\n\"\n                + \"</stuff>\"));\n  }\n\n  @Test\n  public void rendersElementNames() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .body(\n                    \"<?xml version=\\\"1.0\\\"?>\\n\"\n                        + \"<stuff>\\n\"\n                        + \"    <one>1</one>\\n\"\n                        + \"    <two>2</two>\\n\"\n                        + \"    <three>3</three>\\n\"\n                        + \"</stuff>\"),\n            aResponse()\n                .withBody(\n                    \"{{#each (xPath request.body '/stuff/*') as |thing|}}{{{thing.name}}} {{/each}}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"one two three \"));\n  }\n\n  @Test\n  void rendersElementWhenXPathSelectorReturnsPrimitiveStringResult() {\n    ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().body(\"<one>\\n\" + \"    <two>value</two>\\n\" + \"</one>\"),\n            aResponse().withBody(\"{{xPath request.body 'local-name(/*/*[1])'}}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"two\"));\n  }\n\n  @Test\n  void rendersElementWhenXPathSelectorReturnsPrimitiveNumberResult() {\n    ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest()\n                .body(\n                    \"<wrap>\\n\"\n                        + \"    <one>value</one>\\n\"\n                        + \"    <two>value</two>\\n\"\n                        + \"    <three>value</three>\\n\"\n                        + \"    <four>value</four>\\n\"\n                        + \"</wrap>\"),\n            aResponse().withBody(\"{{xPath request.body 'count(/wrap/*)'}}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"4\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HostnameHelperTest.java",
    "content": "/*\n * Copyright (C) 2019-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalToCompressingWhiteSpace;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.LocalNotifier;\nimport java.io.IOException;\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class HostnameHelperTest {\n\n  private HostnameHelper helper;\n  private String hostname;\n\n  @BeforeEach\n  public void init() throws UnknownHostException {\n    helper = new HostnameHelper();\n    hostname = InetAddress.getLocalHost().getHostName();\n\n    LocalNotifier.set(new ConsoleNotifier(true));\n  }\n\n  @Test\n  public void generatesHostname() throws Exception {\n    Map<String, Object> optionsHash = Map.of();\n\n    String output = render(optionsHash);\n    assertThat(output, equalToCompressingWhiteSpace(hostname));\n  }\n\n  private String render(Map<String, Object> optionsHash) throws IOException {\n    return helper\n        .apply(null, new Options.Builder(null, null, null, null, null).setHash(optionsHash).build())\n        .toString();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JsonArrayAddHelperTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.jknack.handlebars.EscapingStrategy;\nimport com.github.jknack.handlebars.Handlebars;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.CsvSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.junitpioneer.jupiter.json.JsonSource;\n\npublic class JsonArrayAddHelperTest extends HandlebarsHelperTestBase {\n\n  @Test\n  void helperIsAccessibleFromResponseBody() {\n    String responseTemplate =\n        \"{{ jsonArrayAdd '[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]' '{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}' }}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\n            \"[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]\"));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'[]',\" + \"'{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}',\" + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'\\\"name\\\"',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},\\\"name\\\"]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'true',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},true]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'null',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},null]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'123',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},123]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]]'\",\n  })\n  void addsAnItemToAnArrayAndReturnsString(\n      String inputArray, String itemToAdd, String expectedOutput) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item }}\")\n            .apply(Map.of(\"array\", inputArray, \"item\", itemToAdd));\n    assertThat(output, is(expectedOutput));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]'\",\n    \"'[]',\"\n        + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]',\"\n        + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'[]',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]'\",\n    \"'[]',\" + \"'[]',\" + \"'[]'\",\n    \"'[]',\" + \"'[null]',\" + \"'[null]'\",\n  })\n  void addsMultipleItemsToAnArrayAndReturnsString(\n      String inputArray, String itemToAdd, String expectedOutput) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item flatten=true }}\")\n            .apply(Map.of(\"array\", inputArray, \"item\", itemToAdd));\n    assertThat(output, is(expectedOutput));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}]',\"\n        + \"'{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}',\"\n        + \"false,\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}',\"\n        + \"false,\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]',\"\n        + \"'{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}',\"\n        + \"false,\"\n        + \"'[{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"},{\\\"id\\\":789,\\\"name\\\":\\\"max\\\"}]',\"\n        + \"'{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}',\"\n        + \"false,\"\n        + \"'[{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"},{\\\"id\\\":789,\\\"name\\\":\\\"max\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]',\"\n        + \"true,\"\n        + \"'[{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"},{\\\"id\\\":789,\\\"name\\\":\\\"max\\\"}]',\"\n        + \"true,\"\n        + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"},{\\\"id\\\":789,\\\"name\\\":\\\"max\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\"\n        + \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"},{\\\"id\\\":789,\\\"name\\\":\\\"max\\\"},{\\\"id\\\":987,\\\"name\\\":\\\"sue\\\"}]',\"\n        + \"true,\"\n        + \"'[{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"},{\\\"id\\\":789,\\\"name\\\":\\\"max\\\"},{\\\"id\\\":987,\\\"name\\\":\\\"sue\\\"}]'\",\n  })\n  void theNumberOfItemsInTheOutputArrayCanBeLimited(\n      String inputArray, String itemToAdd, String flatten, String expectedOutput)\n      throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item flatten=\" + flatten + \" maxItems=3 }}\")\n            .apply(Map.of(\"array\", inputArray, \"item\", itemToAdd));\n    assertThat(output, is(expectedOutput));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\",\n        \"[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]\",\n      })\n  void theNumberOfItemsInTheOutputArrayCanBeLimitedTo0(String itemToAdd) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item maxItems=0 }}\")\n            .apply(Map.of(\"array\", \"[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}]\", \"item\", itemToAdd));\n    assertThat(output, is(\"[]\"));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[ { id: 456, name: 'bob' }, { id: 123, name: 'alice' }, { id: 321, name: 'sam' } ]]\",\n    \"{ id: 456, name: 'bob' }\",\n    \"true\",\n    \"null\",\n    \"123\",\n  })\n  void returnsAnErrorWhenInputJsonIsNotAString(Object inputJson) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    Map<String, Object> context = new HashMap<>();\n    context.put(\"array\", inputJson);\n    context.put(\"item\", \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\");\n    String output = handleBars.compileInline(\"{{ jsonArrayAdd array item }}\").apply(context);\n    assertThat(output, is(\"[ERROR: Base JSON must be a string]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"invalid json\",\n        \"[{\\\"id\\\":456}\",\n        \"\",\n        \" \",\n        // This is actually valid JSON but JSONPath library throws an exception and\n        // it's simpler to use that exception than handle the scenario ourselves.\n        \"null\",\n      })\n  void returnsAnErrorWhenInputJsonIsNotValidJson(String inputJson) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item }}\")\n            .apply(Map.of(\"array\", inputJson, \"item\", \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\"));\n    assertThat(output, is(\"[ERROR: Base JSON is not valid JSON ('\" + inputJson + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}\",\n        \"\\\"name\\\"\",\n        \"true\",\n        \"123\",\n      })\n  void returnsAnErrorWhenInputJsonIsNotJsonArray(String inputJson) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item }}\")\n            .apply(Map.of(\"array\", inputJson, \"item\", \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\"));\n    assertThat(output, is(\"[ERROR: Target JSON is not a JSON array ('\" + inputJson + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}',\"\n        + \"false,\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'\\\"name\\\"',\"\n        + \"false,\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},\\\"name\\\"]'\",\n    \"'true',\" + \"false,\" + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},true]'\",\n    \"'null',\" + \"false,\" + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},null]'\",\n    \"'123',\" + \"false,\" + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},123]'\",\n    \"'[{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]',\"\n        + \"true,\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"},{\\\"id\\\":666,\\\"name\\\":\\\"jason\\\"}]'\",\n  })\n  void itemToAddCanBeSpecifiedInAHandlebarsBlock(\n      String block, boolean flatten, String expectedOutput) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\n                \"{{#jsonArrayAdd array flatten=\" + flatten + \"}}\" + block + \"{{/jsonArrayAdd}}\")\n            .apply(\n                Map.of(\"array\", \"[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]\"));\n    assertThat(output, is(expectedOutput));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"invalid json\",\n        \"[ { \\\"id\\\": 456 }\",\n        \"\",\n        \" \",\n      })\n  void returnsAnErrorWhenItemToAddInAHandlebarsBlockDoesNotResolveToValidJson(String block)\n      throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{#jsonArrayAdd array}}\" + block + \"{{/jsonArrayAdd}}\")\n            .apply(\n                Map.of(\"array\", \"[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]\"));\n    assertThat(output, is(\"[ERROR: Item-to-add JSON is not valid JSON ('\" + block + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[ { id: 456, name: 'bob' } ]]\",\n    \"{ id: 456, name: 'bob' }\",\n    \"true\",\n    \"null\",\n    \"123\",\n  })\n  void returnsAnErrorWhenItemToAddIsNotAString(Object item) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    Map<String, Object> context = new HashMap<>();\n    context.put(\"array\", \"[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]\");\n    context.put(\"item\", item);\n    String output = handleBars.compileInline(\"{{ jsonArrayAdd array item }}\").apply(context);\n    assertThat(output, is(\"[ERROR: Item-to-add JSON must be a string]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"invalid json\",\n        \"[ { \\\"id\\\": 456 }\",\n        \"\",\n        \" \",\n      })\n  void returnsAnErrorWhenItemToAddIsNotValidJson(String item) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item }}\")\n            .apply(\n                Map.of(\n                    \"array\",\n                    \"[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]\",\n                    \"item\",\n                    item));\n    assertThat(output, is(\"[ERROR: Item-to-add JSON is not valid JSON ('\" + item + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    \"1.23\",\n    \"true\",\n    \"'not a number'\",\n    \"'1'\",\n    \"{}\",\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[]]\",\n  })\n  void returnsAnErrorWhenMaxItemsIsNotAnInteger(Object maxItems) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item maxItems=max }}\")\n            .apply(\n                Map.of(\n                    \"array\",\n                    \"[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]\",\n                    \"item\",\n                    \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\",\n                    \"max\",\n                    maxItems));\n    assertThat(output, is(\"[ERROR: maxItems option must be an integer]\"));\n  }\n\n  @Test\n  void returnsAnErrorWhenMaxItemsIsANegativeInteger() throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item maxItems=-1 }}\")\n            .apply(\n                Map.of(\n                    \"array\",\n                    \"[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]\",\n                    \"item\",\n                    \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\"));\n    assertThat(output, is(\"[ERROR: maxItems option integer must be positive]\"));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    \"1.23\",\n    \"'true'\",\n    \"'not a number'\",\n    \"1\",\n    \"{}\",\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[]]\",\n  })\n  void returnsAnErrorWhenFlattenOptionIsNotABoolean(Object flatten) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd array item flatten=flat }}\")\n            .apply(\n                Map.of(\n                    \"array\",\n                    \"[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]\",\n                    \"item\",\n                    \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\",\n                    \"flat\",\n                    flatten));\n    assertThat(output, is(\"[ERROR: flatten option must be a boolean]\"));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'{\\\"expired\\\":false,\\\"users\\\":[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]}',\"\n        + \"'{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}',\"\n        + \"'$.users',\"\n        + \"'{\\\"expired\\\":false,\\\"users\\\":[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]}'\",\n    \"'[{\\\"id\\\":456,\\\"names\\\":[\\\"bob\\\",\\\"jason\\\"]},{\\\"id\\\":123,\\\"names\\\":[\\\"alice\\\"]}]',\"\n        + \"'\\\"sam\\\"',\"\n        + \"'$[0].names',\"\n        + \"'[{\\\"id\\\":456,\\\"names\\\":[\\\"bob\\\",\\\"jason\\\",\\\"sam\\\"]},{\\\"id\\\":123,\\\"names\\\":[\\\"alice\\\"]}]'\",\n  })\n  void jsonPathCanBeProvidedToSspecifyANestedArrayToAddTheItemTo(\n      String inputJson, String itemToAdd, String jsonPath, String expectedOutput)\n      throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd inputJson item jsonPath=jPath }}\")\n            .apply(Map.of(\"inputJson\", inputJson, \"item\", itemToAdd, \"jPath\", jsonPath));\n    assertThat(output, is(expectedOutput));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    \"1\",\n    \"1.23\",\n    \"true\",\n    \"{}\",\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[]]\",\n  })\n  void returnsAnErrorWhenJsonpathOptionIsNotAString(Object jsonPath) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonArrayAdd inputJson item jsonPath=jPath }}\")\n            .apply(\n                Map.of(\n                    \"inputJson\",\n                    \"[{\\\"id\\\":456,\\\"names\\\":[\\\"bob\\\",\\\"jason\\\"]},{\\\"id\\\":123,\\\"names\\\":[\\\"alice\\\"]}]\",\n                    \"item\",\n                    \"\\\"sam\\\"\",\n                    \"jPath\",\n                    jsonPath));\n    assertThat(output, is(\"[ERROR: jsonPath option must be a string]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"invalid jsonpath\",\n        \"$.[\",\n        \"\",\n        \" \",\n      })\n  void returnsAnErrorWhenJsonpathOptionIsNotValidExpression(String jsonPath) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{jsonArrayAdd inputJson item jsonPath=jPath}}\")\n            .apply(\n                Map.of(\n                    \"inputJson\",\n                    \"[{\\\"id\\\":456,\\\"names\\\":[\\\"bob\\\",\\\"jason\\\"]},{\\\"id\\\":123,\\\"names\\\":[\\\"alice\\\"]}]\",\n                    \"item\",\n                    \"\\\"sam\\\"\",\n                    \"jPath\",\n                    jsonPath));\n    assertThat(\n        output,\n        is(\"[ERROR: jsonPath option is not valid JSONPath expression ('\" + jsonPath + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'[{\\\"id\\\":456,\\\"names\\\":[\\\"bob\\\",\\\"jason\\\"]},{\\\"id\\\":123,\\\"names\\\":[\\\"alice\\\"]}]',\"\n        + \"'$[0].doesNotExist'\",\n    \"'[{\\\"id\\\":456,\\\"names\\\":[\\\"bob\\\",\\\"jason\\\"]},{\\\"id\\\":123,\\\"names\\\":[\\\"alice\\\"]}]',\"\n        + \"'$[0].doesNotExist.myArray'\",\n    \"'[{\\\"id\\\":456,\\\"names\\\":[\\\"bob\\\",\\\"jason\\\"]},{\\\"id\\\":123,\\\"names\\\":[\\\"alice\\\"]}]',\"\n        + \"'$[0].id'\",\n    \"'{\\\"id\\\":\\\"a string\\\"}',\" + \"'$.id'\",\n    \"'{\\\"nullable\\\":null}',\" + \"'$.nullable'\",\n  })\n  void returnsAnErrorWhenJsonpathDoesNotResolveToAnArray(String inputJson, String jsonPath)\n      throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonArrayAdd\", new JsonArrayAddHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{jsonArrayAdd inputJson item jsonPath=jPath}}\")\n            .apply(Map.of(\"inputJson\", inputJson, \"item\", \"\\\"sam\\\"\", \"jPath\", jsonPath));\n    assertThat(\n        output,\n        is(\n            \"[ERROR: Target JSON is not a JSON array (root: '\"\n                + inputJson\n                + \"', jsonPath: '\"\n                + jsonPath\n                + \"')]\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JsonMergeHelperTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.*;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.jknack.handlebars.EscapingStrategy;\nimport com.github.jknack.handlebars.Handlebars;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.CsvSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.junitpioneer.jupiter.json.JsonSource;\n\npublic class JsonMergeHelperTest extends HandlebarsHelperTestBase {\n\n  private final Handlebars handlebars =\n      new Handlebars()\n          .with(EscapingStrategy.NOOP)\n          .registerHelper(\"jsonMerge\", new JsonMergeHelper());\n\n  private String resolveInlineMerge(Object baseJson, Object jsonToMerge) throws IOException {\n    return resolveInlineMerge(baseJson, jsonToMerge, false);\n  }\n\n  private String resolveInlineMerge(Object baseJson, Object jsonToMerge, boolean removeNulls)\n      throws IOException {\n    Map<String, Object> context = new HashMap<>();\n    context.put(\"baseJson\", baseJson);\n    context.put(\"jsonToMerge\", jsonToMerge);\n    return handlebars\n        .compileInline(\n            removeNulls\n                ? \"{{jsonMerge baseJson jsonToMerge removeNulls=true}}\"\n                : \"{{jsonMerge baseJson jsonToMerge}}\")\n        .apply(context);\n  }\n\n  private String resolveBlockMerge(Object baseJson, String block, boolean removeNulls)\n      throws IOException {\n    return handlebars\n        .compileInline(\n            (removeNulls ? \"{{#jsonMerge baseJson removeNulls=true}}\" : \"{{#jsonMerge baseJson}}\")\n                + block\n                + \"{{/jsonMerge}}\")\n        .apply(Map.of(\"baseJson\", baseJson));\n  }\n\n  @Test\n  void helperIsAccessibleFromResponseBody() {\n    String responseTemplate =\n        \"{{ jsonMerge '{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}' '{\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"],\\\"dob\\\":\\\"2024-06-18\\\"}' }}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\"{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"],\\\"dob\\\":\\\"2024-06-18\\\"}\"));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'{ \\\"id\\\": 456, \\\"name\\\": \\\"bob\\\" }',\"\n        + \"'{ \\\"roles\\\": [ \\\"admin\\\", \\\"user\\\" ], \\\"dob\\\": \\\"2024-06-18\\\" }',\"\n        + \"'{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"],\\\"dob\\\":\\\"2024-06-18\\\"}'\",\n    \"'{ \\\"id\\\": 456, \\\"name\\\": \\\"bob\\\", \\\"roles\\\": [ \\\"viewer\\\" ] }',\"\n        + \"'{ \\\"roles\\\": [ \\\"admin\\\", \\\"user\\\" ], \\\"dob\\\": \\\"2024-06-18\\\" }',\"\n        + \"'{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"],\\\"dob\\\":\\\"2024-06-18\\\"}'\",\n    \"'{}',\"\n        + \"'{ \\\"roles\\\": [ \\\"admin\\\", \\\"user\\\" ], \\\"dob\\\": \\\"2024-06-18\\\" }',\"\n        + \"'{\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"],\\\"dob\\\":\\\"2024-06-18\\\"}'\",\n    \"'{ \\\"id\\\": 456, \\\"name\\\": \\\"bob\\\" }',\" + \"'{}',\" + \"'{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}'\",\n    \"'{ \\\"id\\\": 456, \\\"name\\\": \\\"bob\\\", \\\"data\\\": { \\\"field\\\": \\\"value\\\" } }',\"\n        + \"'{ \\\"data\\\": [ 123, true ] }',\"\n        + \"'{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"data\\\":[123,true]}'\",\n  })\n  void mergesJsonObjects(String baseJson, String jsonToMerge, String expectedOutput)\n      throws IOException {\n    assertThat(resolveInlineMerge(baseJson, jsonToMerge), is(expectedOutput));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[ { \\\"id\\\": 456, \\\"name\\\": \\\"bob\\\" }, { \\\"id\\\": 123, \\\"name\\\": \\\"alice\\\" }, { \\\"id\\\": 321, \\\"name\\\": \\\"sam\\\" } ]]\",\n    \"{ \\\"id\\\": 456, \\\"name\\\": \\\"bob\\\" }\",\n    \"true\",\n    \"null\",\n    \"123\",\n  })\n  void returnsAnErrorWhenBaseJsonIsNotAString(Object baseJson) throws IOException {\n    assertThat(\n        resolveInlineMerge(baseJson, \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\"),\n        is(\"[ERROR: Base JSON parameter must be a string]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"invalid json\",\n        \"[ { \\\"id\\\": 456 }\",\n        \"\",\n        \" \",\n      })\n  void returnsAnErrorWhenBaseJsonIsNotValidJson(String baseJson) throws IOException {\n    assertThat(\n        resolveInlineMerge(baseJson, \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\"),\n        is(\"[ERROR: Base JSON is not valid JSON ('\" + baseJson + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"[ { \\\"id\\\": 123, \\\"name\\\": \\\"alice\\\" } ]\",\n        \"\\\"name\\\"\",\n        \"true\",\n        \"null\",\n        \"123\",\n      })\n  void returnsAnErrorWhenBaseJsonIsNotJsonObject(Object baseJson) throws IOException {\n    assertThat(\n        resolveInlineMerge(baseJson, \"{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}\"),\n        is(\"[ERROR: Base JSON is not a JSON object ('\" + baseJson + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'{\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"],\\\"dob\\\":\\\"2024-06-18\\\"}',\"\n        + \"'{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"],\\\"dob\\\":\\\"2024-06-18\\\"}'\",\n    \"'{}',\" + \"'{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"roles\\\":[\\\"viewer\\\"]}'\",\n    \"'{\\\"data\\\":[123, true]}',\"\n        + \"'{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"roles\\\":[\\\"viewer\\\"],\\\"data\\\":[123,true]}'\",\n  })\n  void jsonToMergeCanBeSpecifiedInAHandlebarsBlock(String block, String expectedOutput)\n      throws IOException {\n    assertThat(\n        resolveBlockMerge(\"{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"roles\\\":[\\\"viewer\\\"]}\", block, false),\n        is(expectedOutput));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"invalid json\",\n        \"[ { \\\"id\\\": 456 }\",\n        \"\",\n        \" \",\n      })\n  void returnsAnErrorWhenJsonToMergeInAHandlebarsBlockDoesNotResolveToValidJson(String block)\n      throws IOException {\n    assertThat(\n        resolveBlockMerge(\"{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}\", block, false),\n        is(\"[ERROR: JSON to merge is not valid JSON ('\" + block + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[ { id: 456, name: 'bob' } ]]\",\n    \"{ id: 456, name: 'bob' }\",\n    \"true\",\n    \"null\",\n    \"123\",\n  })\n  void returnsAnErrorWhenJsonToMergeIsNotAString(Object jsonToMerge) throws IOException {\n    assertThat(\n        resolveInlineMerge(\"{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}\", jsonToMerge),\n        is(\"[ERROR: JSON to merge must be a string]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"invalid json\",\n        \"[ { \\\"id\\\": 456 }\",\n        \"\",\n        \" \",\n      })\n  void returnsAnErrorWhenJsonToMergeIsNotValidJson(String jsonToMerge) throws IOException {\n    assertThat(\n        resolveInlineMerge(\"{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}\", jsonToMerge),\n        is(\"[ERROR: JSON to merge is not valid JSON ('\" + jsonToMerge + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"[{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]\",\n        \"\\\"name\\\"\",\n        \"true\",\n        \"null\",\n        \"123\",\n      })\n  void returnsAnErrorWhenJsonToMergeIsNotAnObject(String jsonToMerge) throws IOException {\n    assertThat(\n        resolveInlineMerge(\"{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}\", jsonToMerge),\n        is(\"[ERROR: JSON to merge is not a JSON object ('\" + jsonToMerge + \"')]\"));\n  }\n\n  @Test\n  void jsonObjectsAreMergedRecursively() throws IOException {\n    String baseJson =\n        \"{ \\\"id\\\": 456, \\\"name\\\": \\\"bob\\\", \\\"data\\\": { \\\"nestedObject\\\": { \\\"value\\\": \\\"my value\\\", \\\"veryNestedArray\\\": [ true, false, 123 ], \\\"anOldField\\\": \\\"with an old value\\\" }, \\\"someNumber\\\": 456 } }\";\n    String jsonToMerge =\n        \"{ \\\"data\\\": { \\\"nestedObject\\\": { \\\"value\\\": \\\"new value\\\", \\\"veryNestedArray\\\": [ \\\"newItem\\\" ], \\\"aNewField\\\": \\\"with a new value\\\" }, \\\"newNestedObject\\\": { \\\"someBoolean\\\": true } } }\";\n    String output = resolveInlineMerge(baseJson, jsonToMerge);\n    String expectedOutput =\n        \"{ \\\"id\\\": 456, \\\"name\\\": \\\"bob\\\", \\\"data\\\": { \\\"nestedObject\\\": { \\\"value\\\": \\\"new value\\\", \\\"veryNestedArray\\\": [ \\\"newItem\\\" ], \\\"anOldField\\\": \\\"with an old value\\\", \\\"aNewField\\\": \\\"with a new value\\\" }, \\\"someNumber\\\": 456, \\\"newNestedObject\\\": { \\\"someBoolean\\\": true } } }\";\n    assertThat(output, jsonEquals(expectedOutput));\n  }\n\n  @Test\n  void nullAttributesAreRemovedWhenRemoveNullsParameterIsSetInline() throws IOException {\n    String baseJson =\n        \"{\\n\"\n            + \"  \\\"simple1\\\": 0.1,\\n\"\n            + \"  \\\"simple2\\\": 5,\\n\"\n            + \"  \\\"list1\\\": [\\\"one\\\", \\\"two\\\", \\\"three\\\"],\\n\"\n            + \"  \\\"list2\\\": [\\\"four\\\", \\\"five\\\", \\\"six\\\"],\\n\"\n            + \"  \\\"shallowObject1\\\": {\\n\"\n            + \"    \\\"thing\\\": \\\"here\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"shallowObject2\\\": {\\n\"\n            + \"    \\\"thing\\\": \\\"gone\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"deepObject\\\": {\\n\"\n            + \"    \\\"nested1\\\": \\\"gone\\\",\\n\"\n            + \"    \\\"nested2\\\": \\\"here\\\"\\n\"\n            + \"  }\\n\"\n            + \"}\";\n\n    String jsonToMerge =\n        \"{\\n\"\n            + \"  \\\"simple2\\\": null,\\n\"\n            + \"  \\\"list2\\\": null,\\n\"\n            + \"  \\\"shallowObject1\\\": {\\n\"\n            + \"    \\\"thing\\\": \\\"here\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"shallowObject2\\\": null,\\n\"\n            + \"  \\\"deepObject\\\": {\\n\"\n            + \"    \\\"nested1\\\": null,\\n\"\n            + \"    \\\"nested2\\\": \\\"here\\\"\\n\"\n            + \"  }\\n\"\n            + \"}\";\n\n    String expectedJson =\n        \"{\\n\"\n            + \"  \\\"simple1\\\": 0.1,\\n\"\n            + \"  \\\"list1\\\": [\\\"one\\\", \\\"two\\\", \\\"three\\\"],\\n\"\n            + \"  \\\"shallowObject1\\\": {\\n\"\n            + \"    \\\"thing\\\": \\\"here\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"deepObject\\\": {\\n\"\n            + \"    \\\"nested2\\\": \\\"here\\\"\\n\"\n            + \"  }\\n\"\n            + \"}\";\n\n    assertThat(resolveInlineMerge(baseJson, jsonToMerge, true), jsonEquals(expectedJson));\n  }\n\n  @Test\n  void nullAttributesAreRemovedWhenRemoveNullsParameterIsSetBlock() throws IOException {\n    String baseJson =\n        \"{\\n\"\n            + \"  \\\"simple1\\\": 0.1,\\n\"\n            + \"  \\\"simple2\\\": 5,\\n\"\n            + \"  \\\"list1\\\": [\\\"one\\\", \\\"two\\\", \\\"three\\\"],\\n\"\n            + \"  \\\"list2\\\": [\\\"four\\\", \\\"five\\\", \\\"six\\\"],\\n\"\n            + \"  \\\"shallowObject1\\\": {\\n\"\n            + \"    \\\"thing\\\": \\\"here\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"shallowObject2\\\": {\\n\"\n            + \"    \\\"thing\\\": \\\"gone\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"deepObject\\\": {\\n\"\n            + \"    \\\"nested1\\\": \\\"gone\\\",\\n\"\n            + \"    \\\"nested2\\\": \\\"here\\\"\\n\"\n            + \"  }\\n\"\n            + \"}\";\n\n    String jsonToMerge =\n        \"{\\n\"\n            + \"  \\\"simple2\\\": null,\\n\"\n            + \"  \\\"list2\\\": null,\\n\"\n            + \"  \\\"shallowObject1\\\": {\\n\"\n            + \"    \\\"thing\\\": \\\"here\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"shallowObject2\\\": null,\\n\"\n            + \"  \\\"deepObject\\\": {\\n\"\n            + \"    \\\"nested1\\\": null,\\n\"\n            + \"    \\\"nested2\\\": \\\"here\\\"\\n\"\n            + \"  }\\n\"\n            + \"}\";\n\n    String expectedJson =\n        \"{\\n\"\n            + \"  \\\"simple1\\\": 0.1,\\n\"\n            + \"  \\\"list1\\\": [\\\"one\\\", \\\"two\\\", \\\"three\\\"],\\n\"\n            + \"  \\\"shallowObject1\\\": {\\n\"\n            + \"    \\\"thing\\\": \\\"here\\\"\\n\"\n            + \"  },\\n\"\n            + \"  \\\"deepObject\\\": {\\n\"\n            + \"    \\\"nested2\\\": \\\"here\\\"\\n\"\n            + \"  }\\n\"\n            + \"}\";\n\n    assertThat(resolveBlockMerge(baseJson, jsonToMerge, true), jsonEquals(expectedJson));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JsonRemoveHelperTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.jknack.handlebars.EscapingStrategy;\nimport com.github.jknack.handlebars.Handlebars;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.CsvSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.junitpioneer.jupiter.json.JsonSource;\n\npublic class JsonRemoveHelperTest extends HandlebarsHelperTestBase {\n\n  @Test\n  void helperIsAccessibleFromResponseBody() {\n    String responseTemplate = \"{{ jsonRemove '{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}' '$.name' }}\";\n    final ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"{\\\"id\\\":456}\"));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]',\"\n        + \"'$.[?(@.id == 123)]',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"sam\\\"}]',\"\n        + \"'$[?(@.id == 123)]',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]',\"\n        + \"'$.[?(@.id == 123)].name',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123},{\\\"id\\\":321,\\\"name\\\":\\\"sam\\\"}]'\",\n    \"'{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"}',\" + \"'$.name',\" + \"'{\\\"id\\\":456}'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"]},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\",\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"]}]',\"\n        + \"'$.[?(@.name == \\\"alice\\\")].roles[?(@ == \\\"admin\\\")]',\"\n        + \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\",\\\"roles\\\":[\\\"admin\\\",\\\"user\\\"]},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\",\\\"roles\\\":[\\\"user\\\"]}]'\",\n  })\n  void removesElementsFromStringInputAndReturnsString(\n      String inputJson, String jsonPath, String expectedOutput) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonRemove\", new JsonRemoveHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonRemove input '\" + jsonPath + \"' }}\")\n            .apply(Map.of(\"input\", inputJson));\n    assertThat(output, is(expectedOutput));\n  }\n\n  @ParameterizedTest\n  @CsvSource({\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\" + \"'$.[?(@.id == 321)]'\",\n    \"'[{\\\"id\\\":456,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"alice\\\"}]',\" + \"'$.name'\",\n    \"'{\\\"id\\\":456}',\" + \"'$.name'\",\n    \"'true',\" + \"'$.name'\",\n    \"'null',\" + \"'$.name'\",\n    \"'123',\" + \"'$.name'\",\n  })\n  void noOpIfJsonpathResultIsNotFoundForInputJson(String inputJson, String jsonPath)\n      throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonRemove\", new JsonRemoveHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonRemove input '\" + jsonPath + \"' }}\")\n            .apply(Map.of(\"input\", inputJson));\n    assertThat(output, is(inputJson));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"invalid json\",\n        \"[ { \\\"id\\\": 456 } \",\n        \"\",\n        \" \",\n      })\n  void errorsIfInputJsonStringIsNotValidJson(String inputJson) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonRemove\", new JsonRemoveHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonRemove input '$.name' }}\")\n            .apply(Map.of(\"input\", inputJson));\n    assertThat(output, is(\"[ERROR: Input JSON string is not valid JSON ('\" + inputJson + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[ { id: 456, name: 'bob' }, { id: 123, name: 'alice' }, { id: 321, name: 'sam' } ]]\",\n    \"{ id: 456, name: 'bob' }\",\n    \"true\",\n    \"null\",\n    \"123\",\n  })\n  void errorsIfInputJsonIsNotAString(Object inputJson) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonRemove\", new JsonRemoveHelper());\n    Map<String, Object> context = new HashMap<>();\n    context.put(\"input\", inputJson);\n    String output = handleBars.compileInline(\"{{ jsonRemove input '$.name' }}\").apply(context);\n    assertThat(output, is(\"[ERROR: Input JSON must be a string]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"$name\",\n        \"not json path\",\n        \"\",\n        \" \",\n      })\n  void errorsIfJsonpathExpressionIsNotAValidJsonpath(String jsonPath) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonRemove\", new JsonRemoveHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonRemove input '\" + jsonPath + \"' }}\")\n            .apply(Map.of(\"input\", \"{\\\"id\\\":123,\\\"name\\\":\\\"bob\\\"}\"));\n    assertThat(\n        output,\n        is(\"[ERROR: JSONPath parameter is not a valid JSONPath expression ('\" + jsonPath + \"')]\"));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    \"{}\",\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[]]\",\n    \"true\",\n    \"null\",\n    \"123\",\n  })\n  void errorsIfJsonpathExpressionIsNotAString(Object jsonPath) throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonRemove\", new JsonRemoveHelper());\n    Map<String, Object> context = new HashMap<>();\n    context.put(\"input\", \"{\\\"id\\\":123,\\\"name\\\":\\\"bob\\\"}\");\n    context.put(\"jsonPath\", jsonPath);\n    String output = handleBars.compileInline(\"{{ jsonRemove input jsonPath }}\").apply(context);\n    assertThat(output, is(\"[ERROR: JSONPath parameter must be a string]\"));\n  }\n\n  @Test\n  void errorsIfJsonpathExpressionCannotBeAppliedToADeleteOperation() throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonRemove\", new JsonRemoveHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonRemove input '$' }}\")\n            .apply(Map.of(\"input\", \"{\\\"id\\\":123,\\\"name\\\":\\\"bob\\\"}\"));\n    assertThat(\n        output, is(\"[ERROR: Delete operation cannot be applied to JSONPath expression ('$')]\"));\n  }\n\n  @Test\n  void errorsIfJsonpathIsNotProvided() throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonRemove\", new JsonRemoveHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonRemove input }}\")\n            .apply(Map.of(\"input\", \"{\\\"id\\\":123,\\\"name\\\":\\\"bob\\\"}\"));\n    assertThat(output, is(\"[ERROR: A single JSONPath expression parameter must be supplied]\"));\n  }\n\n  @Test\n  void errorsIfMoreThanOneParameterIsProvided() throws IOException {\n    Handlebars handleBars =\n        new Handlebars()\n            .with(EscapingStrategy.NOOP)\n            .registerHelper(\"jsonRemove\", new JsonRemoveHelper());\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonRemove input '$.name' '$.name' }}\")\n            .apply(Map.of(\"input\", \"{\\\"id\\\":123,\\\"name\\\":\\\"bob\\\"}\"));\n    assertThat(output, is(\"[ERROR: A single JSONPath expression parameter must be supplied]\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JsonSortHelperTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.jknack.handlebars.EscapingStrategy;\nimport com.github.jknack.handlebars.Handlebars;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.junitpioneer.jupiter.json.JsonSource;\n\npublic class JsonSortHelperTest extends HandlebarsHelperTestBase {\n\n  @ParameterizedTest\n  @JsonSource({\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[ { id: 456, name: 'bob' }, { id: 123, name: 'alice' }, { id: 321, name: 'sam' } ]]\",\n    \"{ id: 456, name: 'bob' }\",\n    \"true\",\n    \"null\",\n    \"123\",\n  })\n  void errorsIfInputJsonIsNotAString(Object inputJson) throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, Object> context = new HashMap<>();\n    context.put(\"input\", inputJson);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$.name' }}\").apply(context);\n    assertThat(output, is(\"[ERROR: Input JSON must be a string]\"));\n  }\n\n  @Test\n  void errorsIfJsonpathIsNotProvided() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              {\"id\":123,\"name\":\"bob\"}\"\"\");\n    String output = handleBars.compileInline(\"{{ jsonSort input }}\").apply(context);\n    assertThat(output, is(\"[ERROR: A single JSONPath expression parameter must be supplied]\"));\n  }\n\n  @Test\n  void errorsIfMoreThanOneParameterIsProvided() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              {\"id\":123,\"name\":\"bob\"}\"\"\");\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$.name' '$.name' }}\").apply(context);\n    assertThat(output, is(\"[ERROR: A single JSONPath expression parameter must be supplied]\"));\n  }\n\n  @ParameterizedTest\n  @JsonSource({\n    \"{}\",\n    // have to double wrap arrays because @JsonSource unwraps them.\n    \"[[]]\",\n    \"true\",\n    \"null\",\n    \"123\",\n  })\n  void errorsIfJsonpathExpressionIsNotAString(Object jsonPath) throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, Object> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n            {\"id\":123,\"name\":\"bob\"}\"\"\");\n    context.put(\"jsonPath\", jsonPath);\n    String output = handleBars.compileInline(\"{{ jsonSort input jsonPath }}\").apply(context);\n    assertThat(output, is(\"[ERROR: JSONPath parameter must be a string]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"invalid json\",\n        \"[ { \\\"id\\\": 456 } \",\n        \"\",\n        \" \",\n      })\n  void errorsIfInputJsonStringIsNotValidJson(String inputJson) throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", inputJson);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(\"[ERROR: Input JSON string is not valid JSON ('\" + inputJson + \"')]\"));\n  }\n\n  @Test\n  void errorsIfOrderParameterIsNotAString() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              [{\"id\":123,\"name\":\"bob\"}]\"\"\");\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].name' order=123 }}\").apply(context);\n    assertThat(output, is(\"[ERROR: order parameter must be a string]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\"invalid\", \"ascending\", \"descending\", \"up\", \"down\", \"ASC\", \"DESC\", \" \", \"\"})\n  void errorsIfOrderParameterIsNotAscOrDesc(String orderValue) throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              [{\"id\":123,\"name\":\"bob\"}]\"\"\");\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonSort input '$[*].name' order='\" + orderValue + \"' }}\")\n            .apply(context);\n    assertThat(output, is(\"[ERROR: order parameter must be 'asc' or 'desc']\"));\n  }\n\n  @Test\n  void orderParameterIsOptionalAndDefaultsToAscending() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              [{\"id\":123,\"name\":\"bob\"},{\"id\":456,\"name\":\"alice\"}]\"\"\");\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    // Should not error - order parameter is optional\n    assertThat(output, is(\"[{\\\"id\\\":456,\\\"name\\\":\\\"alice\\\"},{\\\"id\\\":123,\\\"name\\\":\\\"bob\\\"}]\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"$.name\", \"$.users.name\", \"$\", \"name\"})\n  void errorsIfJsonPathDoesNotIncludeArrayWildcard(String jsonPath) throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              [{\"id\":123,\"name\":\"bob\"}]\"\"\");\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '\" + jsonPath + \"' }}\").apply(context);\n    assertThat(\n        output,\n        is(\n            \"[ERROR: JSONPath must include [*] to specify array location (e.g., '$[*].name' or '$.users[*].name')]\"));\n  }\n\n  @Test\n  void acceptsValidJsonPathWithArrayWildcard() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              [{\"id\":123,\"name\":\"bob\"},{\"id\":456,\"name\":\"alice\"}]\"\"\");\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].id' }}\").apply(context);\n    // Should not error - order parameter is optional\n    assertThat(output, is(\"[{\\\"id\\\":123,\\\"name\\\":\\\"bob\\\"},{\\\"id\\\":456,\\\"name\\\":\\\"alice\\\"}]\"));\n  }\n\n  @Test\n  void errorsIfInputJsonIsNotAnArray() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              {\"id\":123,\"name\":\"bob\"}\"\"\");\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(\"[ERROR: JSONPath does not reference an array ('$')]\"));\n  }\n\n  @Test\n  void acceptsNestedArrayJsonPath() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n            {\"users\":[{\"name\":\"fred\"},{\"name\":\"bob\"}]}\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$.users[*].name' }}\").apply(context);\n    // Should not error - valid nested array path\n    assertThat(output, is(\"{\\\"users\\\":[{\\\"name\\\":\\\"bob\\\"},{\\\"name\\\":\\\"fred\\\"}]}\"));\n  }\n\n  @Test\n  void errorsIfJsonPathExpressionIsInvalid() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              [{\"id\":123,\"name\":\"bob\"}]\"\"\");\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].[' }}\").apply(context);\n    assertThat(output, is(\"[ERROR: Invalid JSONPath expression ('$[*].[')]\"));\n  }\n\n  @Test\n  void errorsIfJsonPathDoesNotMatchAnyValues() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // JsonPath $.users[*].name but input has no 'users' field\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              [{\"id\":123,\"name\":\"bob\"}]\"\"\");\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$.users[*].name' }}\").apply(context);\n    assertThat(\n        output, is(\"[ERROR: JSONPath expression did not match any values ('$.users[*].name')]\"));\n  }\n\n  @Test\n  void errorsIfJsonPathDoesNotReferenceAnArray() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Input has 'user' as an object, not an array\n    String input = \"\"\"\n            {\"user\":{\"name\":\"bob\"}}\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$.user[*].name' }}\").apply(context);\n    assertThat(output, is(\"[ERROR: JSONPath does not reference an array ('$.user')]\"));\n  }\n\n  @Test\n  void errorsIfRootIsNotAnArrayWhenUsingRootPath() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Root is an object, not an array\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n              {\"id\":123,\"name\":\"bob\"}\"\"\");\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(\"[ERROR: JSONPath does not reference an array ('$')]\"));\n  }\n\n  @Test\n  void handlesComplexJsonPathGracefully() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Just verify we don't crash with complex JSON\n    String input = \"\"\"\n            {\"data\":{\"nested\":{\"users\":[{\"name\":\"bob\"}]}}}\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars\n            .compileInline(\"{{ jsonSort input '$.data.nested.users[*].name' }}\")\n            .apply(context);\n    // Should work or give a clear error, not crash\n    assertThat(output, is(input));\n  }\n\n  @Test\n  void returnsEmptyArrayUnchanged() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"[]\");\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(\"[]\"));\n  }\n\n  @Test\n  void returnsSingleElementArrayUnchanged() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n            [{\"id\":123,\"name\":\"alice\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(input));\n  }\n\n  @Test\n  void sortsArrayWhenSortFieldIsMissingFromAllObjects() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n      [{\"id\":3},{\"id\":1},{\"id\":2}]\"\"\");\n    // Missing field returns null for all objects\n    // All nulls are equal, so stable sort maintains original order\n    String expected = \"\"\"\n      [{\"id\":3},{\"id\":1},{\"id\":2}]\"\"\";\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].missingField' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsArrayWithSomeObjectsMissingSortField() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n      [{\"id\":1,\"name\":\"alice\"},{\"id\":2},{\"id\":3,\"name\":\"bob\"}]\"\"\");\n    // Objects without 'name' sort first (nulls first is default)\n    String expected = \"\"\"\n      [{\"id\":2},{\"id\":1,\"name\":\"alice\"},{\"id\":3,\"name\":\"bob\"}]\"\"\";\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void errorsIfSortFieldIsUnsupportedType() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n            [{\"data\":{\"nested\":\"value\"}},{\"data\":{\"other\":\"value\"}}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].data' }}\").apply(context);\n    assertThat(\n        output,\n        is(\n            \"[ERROR: All sort field values must be of the same comparable type (Number, String, or Boolean)]\"));\n  }\n\n  @Test\n  void errorsIfSortFieldHasMixedTypes() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n            [{\"value\":\"text\"},{\"value\":123}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].value' }}\").apply(context);\n    assertThat(\n        output,\n        is(\n            \"[ERROR: All sort field values must be of the same comparable type (Number, String, or Boolean)]\"));\n  }\n\n  @Test\n  void errorsIfSortValuesDoNotMatchArraySize() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Input has 2 objects, but nested arrays contain 3 total names\n    // $[*].users[*].name will return 3 values for an array of size 2\n    String input =\n        \"\"\"\n              [{\"users\":[{\"name\":\"bob\"},{\"name\":\"alice\"}]},{\"users\":[{\"name\":\"charlie\"}]}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].users[*].name' }}\").apply(context);\n    assertThat(\n        output,\n        is(\n            \"[ERROR: Number of sort values (3) does not match array size (2). JSONPath contains 2 wildcards [*] but only single-level array sorting is supported]\"));\n  }\n\n  @Test\n  void sortsArrayByStringFieldAscending() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input =\n        \"\"\"\n            [{\"id\":456,\"name\":\"bob\"},{\"id\":123,\"name\":\"alice\"},{\"id\":789,\"name\":\"charlie\"}]\"\"\";\n    String expected =\n        \"\"\"\n            [{\"id\":123,\"name\":\"alice\"},{\"id\":456,\"name\":\"bob\"},{\"id\":789,\"name\":\"charlie\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsArrayByNumericFieldAscending() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n            [{\"id\":456},{\"id\":123},{\"id\":789},{\"id\":321}]\"\"\";\n    String expected = \"\"\"\n            [{\"id\":123},{\"id\":321},{\"id\":456},{\"id\":789}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].id' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsArrayByNumericFieldDescending() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n            [{\"id\":123},{\"id\":456},{\"id\":789}]\"\"\";\n    String expected = \"\"\"\n            [{\"id\":789},{\"id\":456},{\"id\":123}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].id' order='desc' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsArrayByBooleanField() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n            [{\"active\":true},{\"active\":false},{\"active\":true}]\"\"\";\n    String expected = \"\"\"\n            [{\"active\":false},{\"active\":true},{\"active\":true}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].active' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsNestedArrayByField() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input =\n        \"\"\"\n            {\"users\":[{\"name\":\"charlie\"},{\"name\":\"alice\"},{\"name\":\"bob\"}]}\"\"\";\n    String expected =\n        \"\"\"\n            {\"users\":[{\"name\":\"alice\"},{\"name\":\"bob\"},{\"name\":\"charlie\"}]}\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$.users[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsArrayByDateFieldInIso8601Format() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // ISO 8601 format dates (same as {{now}} helper output)\n    String input =\n        \"\"\"\n            [{\"id\":1,\"created\":\"2025-03-15T14:30:00Z\"},{\"id\":2,\"created\":\"2025-01-10T09:15:00Z\"},{\"id\":3,\"created\":\"2025-12-01T18:45:00Z\"}]\"\"\";\n    String expected =\n        \"\"\"\n            [{\"id\":2,\"created\":\"2025-01-10T09:15:00Z\"},{\"id\":1,\"created\":\"2025-03-15T14:30:00Z\"},{\"id\":3,\"created\":\"2025-12-01T18:45:00Z\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].created' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsArrayByDateFieldDescending() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // ISO 8601 format dates sorted in descending order (most recent first)\n    String input =\n        \"\"\"\n            [{\"id\":1,\"created\":\"2025-03-15T14:30:00Z\"},{\"id\":2,\"created\":\"2025-01-10T09:15:00Z\"},{\"id\":3,\"created\":\"2025-12-01T18:45:00Z\"}]\"\"\";\n    String expected =\n        \"\"\"\n            [{\"id\":3,\"created\":\"2025-12-01T18:45:00Z\"},{\"id\":1,\"created\":\"2025-03-15T14:30:00Z\"},{\"id\":2,\"created\":\"2025-01-10T09:15:00Z\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].created' order='desc' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsComplexObjectsByDateFieldWithMixedDataTypes() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Objects with mixed data types (string, number, boolean) and nested objects\n    String input =\n        \"\"\"\n            [{\"id\":1,\"name\":\"alice\",\"active\":true,\"score\":95.5,\"created\":\"2025-06-20T10:00:00Z\",\"metadata\":{\"department\":\"engineering\",\"level\":3}},{\"id\":2,\"name\":\"bob\",\"active\":false,\"score\":87.2,\"created\":\"2025-02-15T14:30:00Z\",\"metadata\":{\"department\":\"sales\",\"level\":2}},{\"id\":3,\"name\":\"charlie\",\"active\":true,\"score\":92.0,\"created\":\"2025-09-10T08:45:00Z\",\"metadata\":{\"department\":\"engineering\",\"level\":4}}]\"\"\";\n    String expected =\n        \"\"\"\n            [{\"id\":2,\"name\":\"bob\",\"active\":false,\"score\":87.2,\"created\":\"2025-02-15T14:30:00Z\",\"metadata\":{\"department\":\"sales\",\"level\":2}},{\"id\":1,\"name\":\"alice\",\"active\":true,\"score\":95.5,\"created\":\"2025-06-20T10:00:00Z\",\"metadata\":{\"department\":\"engineering\",\"level\":3}},{\"id\":3,\"name\":\"charlie\",\"active\":true,\"score\":92.0,\"created\":\"2025-09-10T08:45:00Z\",\"metadata\":{\"department\":\"engineering\",\"level\":4}}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].created' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsLargeIntegersCorrectly() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Values beyond double precision: 2^53 + 1, 2^53, 2^53 + 2\n    // With the old doubleValue() approach, these would sort INCORRECTLY\n    String input =\n        \"\"\"\n      [{\"id\":9007199254740993},{\"id\":9007199254740992},{\"id\":9007199254740994}]\"\"\";\n    String expected =\n        \"\"\"\n      [{\"id\":9007199254740992},{\"id\":9007199254740993},{\"id\":9007199254740994}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].id' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsMixedIntegerAndFloatNumbers() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n      [{\"val\":2},{\"val\":1.5},{\"val\":1},{\"val\":2.7}]\"\"\";\n    String expected = \"\"\"\n      [{\"val\":1},{\"val\":1.5},{\"val\":2},{\"val\":2.7}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].val' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsVeryLargeNegativeNumbers() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input =\n        \"\"\"\n      [{\"id\":-9007199254740993},{\"id\":-9007199254740992},{\"id\":-9007199254740994}]\"\"\";\n    String expected =\n        \"\"\"\n      [{\"id\":-9007199254740994},{\"id\":-9007199254740993},{\"id\":-9007199254740992}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].id' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void maintainsSortStabilityForEqualValues() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Multiple objects with same name - should maintain original order\n    String input =\n        \"\"\"\n      [{\"name\":\"alice\",\"id\":1},{\"name\":\"alice\",\"id\":2},{\"name\":\"alice\",\"id\":3}]\"\"\";\n    String expected =\n        \"\"\"\n      [{\"name\":\"alice\",\"id\":1},{\"name\":\"alice\",\"id\":2},{\"name\":\"alice\",\"id\":3}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsUnicodeStringsCorrectly() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n      [{\"name\":\"Zoë\"},{\"name\":\"Émilie\"},{\"name\":\"André\"}]\"\"\";\n    // Sorts by Unicode code point: A(U+0041) < Z(U+005A) < É(U+00C9)\n    String expected = \"\"\"\n      [{\"name\":\"André\"},{\"name\":\"Zoë\"},{\"name\":\"Émilie\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void errorsWhenInputIsJsonNull() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"null\");\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    // Should give a clear error that null cannot be sorted\n    assertThat(output, is(\"[ERROR: Cannot sort a JSON null value - input must be a JSON array]\"));\n  }\n\n  @Test\n  void providesHelpfulErrorMessageForMultipleWildcards() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Root array has 2 elements, but $[*].users[*].name returns 3 values (bob, alice, charlie)\n    // because of the TWO wildcards flattening nested arrays\n    String input =\n        \"\"\"\n      [{\"users\":[{\"name\":\"bob\"},{\"name\":\"alice\"}]},{\"users\":[{\"name\":\"charlie\"}]}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].users[*].name' }}\").apply(context);\n\n    // Should mention multiple wildcards in the error message\n    assertThat(\n        output,\n        is(\n            \"[ERROR: Number of sort values (3) does not match array size (2). JSONPath contains 2 wildcards [*] but only single-level array sorting is supported]\"));\n  }\n\n  @Test\n  void sortsSimpleArrayOfStrings() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n      [\"charlie\",\"alice\",\"bob\"]\"\"\";\n    String expected = \"\"\"\n      [\"alice\",\"bob\",\"charlie\"]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    // Note: $[*] gets the array elements themselves (not a field within objects)\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*]' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsSimpleArrayOfNumbers() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n      [456,123,789,321]\"\"\";\n    String expected = \"\"\"\n      [123,321,456,789]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*]' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsMixedPositiveAndNegativeNumbers() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n      [{\"val\":5},{\"val\":-3},{\"val\":0},{\"val\":-10},{\"val\":2}]\"\"\";\n    String expected = \"\"\"\n      [{\"val\":-10},{\"val\":-3},{\"val\":0},{\"val\":2},{\"val\":5}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].val' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsStringsByCaseSensitiveUnicodeOrder() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n      [{\"name\":\"zebra\"},{\"name\":\"Apple\"},{\"name\":\"banana\"}]\"\"\";\n    // Uppercase 'A' (U+0041) < lowercase 'b' (U+0062) < lowercase 'z' (U+007A)\n    String expected = \"\"\"\n      [{\"name\":\"Apple\"},{\"name\":\"banana\"},{\"name\":\"zebra\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsStringFieldDescending() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n      [{\"name\":\"alice\"},{\"name\":\"charlie\"},{\"name\":\"bob\"}]\"\"\";\n    String expected = \"\"\"\n      [{\"name\":\"charlie\"},{\"name\":\"bob\"},{\"name\":\"alice\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].name' order='desc' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsNestedArrayAtSpecificIndex() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input =\n        \"\"\"\n      [{\"items\":[{\"price\":30},{\"price\":10},{\"price\":20}]},{\"items\":[{\"price\":100},{\"price\":50}]}]\"\"\";\n    // Only sorts items[0], leaves items[1] unchanged\n    String expected =\n        \"\"\"\n      [{\"items\":[{\"price\":10},{\"price\":20},{\"price\":30}]},{\"items\":[{\"price\":100},{\"price\":50}]}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[0].items[*].price' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsArrayWithBracketNotationPropertyAccess() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input = \"\"\"\n      {\"my-key\":{\"items\":[{\"id\":3},{\"id\":1},{\"id\":2}]}}\"\"\";\n    String expected = \"\"\"\n      {\"my-key\":{\"items\":[{\"id\":1},{\"id\":2},{\"id\":3}]}}\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[\\\"my-key\\\"].items[*].id' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void errorsWhenJsonPathUsesFilterInsteadOfWildcard() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input =\n        \"\"\"\n      [{\"id\":1,\"name\":\"alice\"},{\"id\":2,\"name\":\"bob\"},{\"id\":3,\"name\":\"charlie\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    // Filter expressions are not supported - must use [*] wildcard\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[?(@.id > 2)].name' }}\").apply(context);\n\n    // Should error because filter syntax [?(...)] is not supported\n    assertThat(\n        output,\n        is(\n            \"[ERROR: JSONPath must include [*] to specify array location (e.g., '$[*].name' or '$.users[*].name')]\"));\n  }\n\n  @Test\n  void maintainsOrderForNestedFieldAccess() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Verify that nested field access maintains array order\n    String input =\n        \"\"\"\n      [{\"id\":1,\"data\":{\"value\":\"c\"}},{\"id\":2,\"data\":{\"value\":\"a\"}},{\"id\":3,\"data\":{\"value\":\"b\"}}]\"\"\";\n    String expected =\n        \"\"\"\n      [{\"id\":2,\"data\":{\"value\":\"a\"}},{\"id\":3,\"data\":{\"value\":\"b\"}},{\"id\":1,\"data\":{\"value\":\"c\"}}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].data.value' }}\").apply(context);\n\n    // If order is maintained, this should sort correctly\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsWithNullsFirstByDefault() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input =\n        \"\"\"\n      [{\"id\":5,\"name\":\"charlie\"},{\"id\":2,\"name\":null},{\"id\":4,\"name\":\"alice\"},{\"id\":1,\"name\":null},{\"id\":3,\"name\":\"bob\"}]\"\"\";\n    // Stable sort: nulls maintain original order (id:2 before id:1)\n    // Note: Jackson omits null field values in output\n    String expected =\n        \"\"\"\n      [{\"id\":2},{\"id\":1},{\"id\":4,\"name\":\"alice\"},{\"id\":3,\"name\":\"bob\"},{\"id\":5,\"name\":\"charlie\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsWithNullsLast() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input =\n        \"\"\"\n      [{\"id\":4,\"name\":\"charlie\"},{\"id\":2,\"name\":null},{\"id\":3,\"name\":\"alice\"},{\"id\":1,\"name\":\"bob\"}]\"\"\";\n    // Nulls sort last; note that null 'name' field is omitted in output\n    String expected =\n        \"\"\"\n      [{\"id\":3,\"name\":\"alice\"},{\"id\":1,\"name\":\"bob\"},{\"id\":4,\"name\":\"charlie\"},{\"id\":2}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].name' nulls='last' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsArrayWithAllNullValues() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // With all nulls, objects still have 'id' field to show they exist\n    String input = \"\"\"\n      [{\"id\":3,\"name\":null},{\"id\":1,\"name\":null},{\"id\":2,\"name\":null}]\"\"\";\n    // Objects maintain their other fields even though 'name' is null\n    String expected = \"\"\"\n      [{\"id\":3},{\"id\":1},{\"id\":2}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsNumbersWithNullsFirst() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    String input =\n        \"\"\"\n      [{\"id\":\"a\",\"score\":100},{\"id\":\"b\",\"score\":null},{\"id\":\"c\",\"score\":50},{\"id\":\"d\",\"score\":null}]\"\"\";\n    String expected =\n        \"\"\"\n      [{\"id\":\"b\"},{\"id\":\"d\"},{\"id\":\"c\",\"score\":50},{\"id\":\"a\",\"score\":100}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].score' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void errorsIfNullsParameterIsInvalid() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", \"\"\"\n      [{\"name\":\"alice\"}]\"\"\");\n    String output =\n        handleBars.compileInline(\"{{ jsonSort input '$[*].name' nulls='middle' }}\").apply(context);\n    assertThat(output, is(\"[ERROR: nulls parameter must be 'first' or 'last']\"));\n  }\n\n  @Test\n  void sortsStringsWithEmoji() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Emoji sorted by UTF-16 code units:\n    // 🎉(U+1F389) < 💻(U+1F4BB) < 😀(U+1F600) < 🚀(U+1F680)\n    String input =\n        \"\"\"\n      [{\"name\":\"😀 smile\"},{\"name\":\"🎉 party\"},{\"name\":\"💻 laptop\"},{\"name\":\"🚀 rocket\"}]\"\"\";\n    String expected =\n        \"\"\"\n      [{\"name\":\"🎉 party\"},{\"name\":\"💻 laptop\"},{\"name\":\"😀 smile\"},{\"name\":\"🚀 rocket\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsMixedAsciiAccentedAndEmoji() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Java String comparison: ASCII (a,b) < accented (Á,É) < emoji (😀)\n    // Order: a(U+0061) < b(U+0062) < Á(U+00C1) < É(U+00C9) < 😀(U+1F600)\n    String input =\n        \"\"\"\n      [{\"name\":\"😀\"},{\"name\":\"Álvaro\"},{\"name\":\"alice\"},{\"name\":\"Élodie\"},{\"name\":\"bob\"}]\"\"\";\n    String expected =\n        \"\"\"\n      [{\"name\":\"alice\"},{\"name\":\"bob\"},{\"name\":\"Álvaro\"},{\"name\":\"Élodie\"},{\"name\":\"😀\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsComplexEmoji() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Flag emoji use regional indicator symbols (U+1F1E6-1F1FF)\n    // 🇫🇷: U+1F1EB,U+1F1F7  🇬🇧: U+1F1EC,U+1F1E7  🇯🇵: U+1F1EF,U+1F1F5  🇺🇸: U+1F1FA,U+1F1F8\n    String input = \"\"\"\n      [{\"flag\":\"🇬🇧\"},{\"flag\":\"🇺🇸\"},{\"flag\":\"🇯🇵\"},{\"flag\":\"🇫🇷\"}]\"\"\";\n    String expected =\n        \"\"\"\n      [{\"flag\":\"🇫🇷\"},{\"flag\":\"🇬🇧\"},{\"flag\":\"🇯🇵\"},{\"flag\":\"🇺🇸\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].flag' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsRightToLeftText() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Arabic (U+0600-06FF), Hebrew (U+0590-05FF), ASCII (U+0041-007A)\n    // Order by first code point: hello(h=U+0068) < שלום(ש=U+05E9) < مرحبا(م=U+0645)\n    String input = \"\"\"\n      [{\"name\":\"مرحبا\"},{\"name\":\"שלום\"},{\"name\":\"hello\"}]\"\"\";\n    String expected = \"\"\"\n      [{\"name\":\"hello\"},{\"name\":\"שלום\"},{\"name\":\"مرحبا\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsArrayWithDuplicateValues() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // \"bob\" appears twice (id:1 and id:3), should maintain the original order\n    String input =\n        \"\"\"\n      [{\"id\":1,\"name\":\"bob\"},{\"id\":2,\"name\":\"alice\"},{\"id\":3,\"name\":\"bob\"},{\"id\":4,\"name\":\"charlie\"}]\"\"\";\n    // Stable sort: alice, bob(id:1), bob(id:3), charlie\n    String expected =\n        \"\"\"\n      [{\"id\":2,\"name\":\"alice\"},{\"id\":1,\"name\":\"bob\"},{\"id\":3,\"name\":\"bob\"},{\"id\":4,\"name\":\"charlie\"}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].name' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  @Test\n  void sortsNumbersWithDuplicateValues() throws IOException {\n    Handlebars handleBars = getHandlebarsWithJsonSort();\n    // Score 50 appears three times\n    String input =\n        \"\"\"\n      [{\"id\":\"a\",\"score\":100},{\"id\":\"b\",\"score\":50},{\"id\":\"c\",\"score\":50},{\"id\":\"d\",\"score\":25},{\"id\":\"e\",\"score\":50}]\"\"\";\n    // Stable sort: 25, 50(b), 50(c), 50(e), 100\n    String expected =\n        \"\"\"\n      [{\"id\":\"d\",\"score\":25},{\"id\":\"b\",\"score\":50},{\"id\":\"c\",\"score\":50},{\"id\":\"e\",\"score\":50},{\"id\":\"a\",\"score\":100}]\"\"\";\n    Map<String, String> context = new HashMap<>();\n    context.put(\"input\", input);\n    String output = handleBars.compileInline(\"{{ jsonSort input '$[*].score' }}\").apply(context);\n    assertThat(output, is(expected));\n  }\n\n  private Handlebars getHandlebarsWithJsonSort() {\n    return new Handlebars()\n        .with(EscapingStrategy.NOOP)\n        .registerHelper(\"jsonSort\", new JsonSortHelper());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/MathsHelperTest.java",
    "content": "/*\n * Copyright (C) 2021-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.closeTo;\nimport static org.hamcrest.Matchers.is;\n\nimport java.util.Date;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class MathsHelperTest extends HandlebarsHelperTestBase {\n\n  MathsHelper helper;\n\n  @BeforeEach\n  public void init() {\n    helper = new MathsHelper();\n  }\n\n  @Test\n  public void returnsAnErrorIfNotExactlyTwoParameters() throws Exception {\n    String expectedError =\n        \"[ERROR: All maths functions require two operands and an operator as parameters e.g. 3 '+' 2]\";\n\n    assertThat(renderHelperValue(helper, 5, \"+\"), is(expectedError));\n    assertThat(renderHelperValue(helper, 5, \"+\", \"6\", true, 1), is(expectedError));\n    assertThat(renderHelperValue(helper, 5), is(expectedError));\n  }\n\n  @Test\n  public void returnsAnErrorIfOperatorNotRecognised() throws Exception {\n    assertThat(\n        renderHelperValue(helper, 2, \"&\", 3),\n        is(\"[ERROR: & is not a valid mathematical operator]\"));\n  }\n\n  @Test\n  public void addsTwoIntegers() throws Exception {\n    assertThat(renderHelperValue(helper, 2, \"+\", 3), is(5));\n  }\n\n  @Test\n  public void addsTwoLongs() throws Exception {\n    long left = ((long) Integer.MAX_VALUE) + 1;\n    long right = ((long) Integer.MAX_VALUE) + 1;\n    long expected = (((long) Integer.MAX_VALUE) * 2) + 2;\n    assertThat(renderHelperValue(helper, left, \"+\", right), is(expected));\n  }\n\n  @Test\n  public void addsAStringAndInteger() throws Exception {\n    assertThat(renderHelperValue(helper, \"2\", \"+\", 3), is(5));\n  }\n\n  @Test\n  public void addsADoubleAndInteger() throws Exception {\n    assertThat(renderHelperValue(helper, 0.5, \"+\", 3), is(3.5));\n  }\n\n  @Test\n  public void addsAStringDoubleAndDouble() throws Exception {\n    assertThat(renderHelperValue(helper, \"0.25\", \"+\", \"0.34\"), is(0.59));\n  }\n\n  @Test\n  public void addsADoubleAndFloat() throws Exception {\n    assertThat(renderHelperValue(helper, 0.25f, \"+\", 0.34f), closeTo(0.59, 0.01));\n  }\n\n  @Test\n  public void subtractsTwoIntegers() throws Exception {\n    assertThat(renderHelperValue(helper, 10, \"-\", 3), is(7));\n  }\n\n  @Test\n  public void multipliesTwoIntegers() throws Exception {\n    assertThat(renderHelperValue(helper, 10, \"*\", 3), is(30));\n    assertThat(renderHelperValue(helper, 10, \"x\", 3), is(30));\n  }\n\n  @Test\n  public void dividesTwoIntegers() throws Exception {\n    assertThat(renderHelperValue(helper, 15, \"/\", 3), is(5));\n  }\n\n  @Test\n  public void modsTwoIntegers() throws Exception {\n    assertThat(renderHelperValue(helper, 11, \"%\", 3), is(2));\n  }\n\n  @Test\n  void coercesEpochFormattedRenderableDateParameterCorrectly() throws Exception {\n    Date date = new Date(1663258226792L);\n    assertThat(\n        renderHelperValue(helper, new RenderableDate(date, \"epoch\", null), \"+\", 0),\n        is(1663258226792L));\n  }\n\n  @Test\n  void handlesLargeNegativeIntegerResults() throws Exception {\n    assertThat(renderHelperValue(helper, Long.MIN_VALUE, \"+\", 1), is(Long.MIN_VALUE + 1));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ParseDateHelperTest.java",
    "content": "/*\n * Copyright (C) 2018-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.time.Instant;\nimport java.time.ZonedDateTime;\nimport java.time.format.DateTimeFormatter;\nimport java.util.Date;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ParseDateHelperTest {\n  private ParseDateHelper helper;\n\n  @BeforeEach\n  public void init() {\n    helper = new ParseDateHelper();\n  }\n\n  @Test\n  public void parsesAnISO8601DateWhenNoFormatSpecified() throws Exception {\n    Map<String, Object> optionsHash = Map.of();\n\n    String inputDate = \"2018-05-01T01:02:03Z\";\n    Object output = render(inputDate, optionsHash);\n\n    Date expectedDate = Date.from(ZonedDateTime.parse(inputDate).toInstant());\n    assertThat(output).isInstanceOf(Date.class);\n    assertThat(output).isEqualTo(expectedDate);\n  }\n\n  @Test\n  public void parsesAnRFC1123DateWhenNoFormatSpecified() throws Exception {\n    Map<String, Object> optionsHash = Map.of();\n\n    String inputDate = \"Tue, 01 Jun 2021 15:16:17 GMT\";\n    Object output = render(inputDate, optionsHash);\n\n    Date expectedDate =\n        Date.from(Instant.from(DateTimeFormatter.RFC_1123_DATE_TIME.parse(inputDate)));\n    assertThat(output).isInstanceOf(Date.class);\n    assertThat(output).isEqualTo(expectedDate);\n  }\n\n  @Test\n  public void parsesDateWithSuppliedFormat() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"format\", \"dd/MM/yyyy\");\n\n    String inputDate = \"01/02/2003\";\n    Object output = render(inputDate, optionsHash);\n\n    Date expectedDate = Date.from(Instant.parse(\"2003-02-01T00:00:00Z\"));\n    assertThat(output).isInstanceOf(Date.class);\n    assertThat(output).isEqualTo(expectedDate);\n  }\n\n  @Test\n  public void parsesLocalDateTimeWithSuppliedFormat() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"format\", \"dd/MM/yyyy HH:mm:ss\");\n\n    String inputDate = \"01/02/2003 05:06:07\";\n    Object output = render(inputDate, optionsHash);\n\n    Date expectedDate = Date.from(Instant.parse(\"2003-02-01T05:06:07Z\"));\n    assertThat(output).isInstanceOf(Date.class);\n    assertThat(output).isEqualTo(expectedDate);\n  }\n\n  @Test\n  public void parsesDateTimeWithEpochFormat() throws Exception {\n    Map<String, Object> optionsHash = Map.of(\"format\", \"epoch\");\n\n    String inputDate = \"1577964091000\";\n    Object output = render(inputDate, optionsHash);\n\n    Date expectedDate = Date.from(Instant.parse(\"2020-01-02T11:21:31Z\"));\n    assertThat(output).isInstanceOf(Date.class);\n    assertThat(output).isEqualTo(expectedDate);\n  }\n\n  private Object render(String context, Map<String, Object> optionsHash) throws IOException {\n    return helper.apply(\n        context, new Options.Builder(null, null, null, null, null).setHash(optionsHash).build());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ParseJsonHelperTest.java",
    "content": "/*\n * Copyright (C) 2021-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.aMapWithSize;\nimport static org.hamcrest.Matchers.hasEntry;\nimport static org.hamcrest.Matchers.hasKey;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.isA;\nimport static org.hamcrest.Matchers.nullValue;\n\nimport com.github.jknack.handlebars.Handlebars;\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport com.github.jknack.handlebars.Template;\nimport java.io.IOException;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ParseJsonHelperTest extends HandlebarsHelperTestBase {\n  private ParseJsonHelper helper;\n\n  @BeforeEach\n  public void init() {\n    helper = new ParseJsonHelper();\n  }\n\n  @Test\n  public void parsesASimpleJsonObject() throws Exception {\n    String inputJson = \"{\\\"testKey1\\\": \\\"val1\\\", \\\"testKey2\\\": \\\"val2\\\"}\";\n    Object output = render(inputJson, new Object[] {}, TagType.VAR);\n\n    assertThat(output, instanceOf(Map.class));\n    Map<String, Object> result = (Map<String, Object>) output;\n    assertThat(result, aMapWithSize(2));\n    assertThat(result, hasEntry(\"testKey1\", \"val1\"));\n    assertThat(result, hasEntry(\"testKey2\", \"val2\"));\n  }\n\n  @Test\n  public void parsesAJsonObjectContainingArray() throws Exception {\n    String inputJson = \"{\\\"arr\\\": [\\\"one\\\", \\\"two\\\", \\\"three\\\"]}\";\n    Object output = render(inputJson, new Object[] {}, TagType.VAR);\n\n    assertThat(output, instanceOf(Map.class));\n    Map<String, Object> result = (Map<String, Object>) output;\n    assertThat(result, aMapWithSize(1));\n    assertThat(result, hasKey(\"arr\"));\n    assertThat(result.get(\"arr\"), instanceOf(List.class));\n    assertThat(result, hasEntry(\"arr\", Arrays.asList(new String[] {\"one\", \"two\", \"three\"})));\n  }\n\n  @Test\n  public void parseANestedJsonObject() throws Exception {\n    String inputJson = \"{\\\"parent\\\": {\\\"child\\\": \\\"val\\\"}}\";\n    Object output = render(inputJson, new Object[] {}, TagType.VAR);\n\n    // Check parent level\n    assertThat(output, instanceOf(Map.class));\n    Map<String, Object> result = (Map<String, Object>) output;\n    assertThat(result, aMapWithSize(1));\n    assertThat(result, hasKey(\"parent\"));\n    // Check child level\n    assertThat(result.get(\"parent\"), instanceOf(Map.class));\n    Map<String, Object> parent = (Map<String, Object>) result.get(\"parent\");\n    assertThat(parent, hasEntry(\"child\", \"val\"));\n  }\n\n  @Test\n  public void parsesJsonWithTopLevelArray() throws Exception {\n    String inputJson = \"[{\\\"key\\\": \\\"val\\\"}]\";\n    Object output = render(inputJson, new Object[] {}, TagType.VAR);\n\n    // Check list returns\n    assertThat(output, instanceOf(List.class));\n    List<Object> result = (List<Object>) output;\n    assertThat(result, hasSize(1));\n    // Check inner is a map\n    assertThat(result.get(0), instanceOf(Map.class));\n    Map<String, Object> inner = (Map<String, Object>) result.get(0);\n    assertThat(inner, hasEntry(\"key\", \"val\"));\n  }\n\n  @Test\n  public void parsesNullJsonIfSection() throws Exception {\n    String inputJson = null;\n    Object output = render(inputJson, new Object[] {}, TagType.SECTION);\n\n    // Check that it returns empty object\n    assertThat(output, instanceOf(Map.class));\n    Map<String, Object> result = (Map<String, Object>) output;\n    assertThat(result, aMapWithSize(0));\n  }\n\n  @Test\n  public void parsesNullJsonIfNotSection() throws Exception {\n    String inputJson = null;\n    Object output = render(inputJson, new Object[] {}, TagType.VAR);\n\n    // Check that it returns empty object\n    assertThat(output, instanceOf(Map.class));\n    Map<String, Object> result = (Map<String, Object>) output;\n    assertThat(result, aMapWithSize(0));\n  }\n\n  @Test\n  public void parsesEmptyJsonIfSection() throws Exception {\n    String inputJson = \"\";\n    String variableName = \"parsedObject\";\n    Template template = new Handlebars().compileInline(inputJson);\n    Options options =\n        new Options.Builder(null, null, TagType.SECTION, createContext(), template)\n            .setParams(new Object[] {})\n            .build();\n    Object output = render(variableName, options);\n\n    // Check that it returns null\n    assertThat(output, is(nullValue()));\n\n    /* Check that it stores parsed json (an empty map in this case because json is empty)\n     * in given variable name */\n    Object storedData = options.data(variableName);\n    assertThat(storedData, isA(Map.class));\n    Map<String, Object> castedData = (Map<String, Object>) storedData;\n    assertThat(castedData, is(aMapWithSize(0)));\n  }\n\n  @Test\n  public void parsesEmptyJsonWithBracesIfSection() throws Exception {\n    String inputJson = \"{}\";\n    String variableName = \"parsedObject\";\n    Template template = new Handlebars().compileInline(inputJson);\n    Options options =\n        new Options.Builder(null, null, TagType.SECTION, createContext(), template)\n            .setParams(new Object[] {})\n            .build();\n    Object output = render(variableName, options);\n\n    // Check that it returns null\n    assertThat(output, is(nullValue()));\n\n    /* Check that it stores parsed json (an empty map in this case because json is empty)\n     * in given variable name */\n    Object storedData = options.data(variableName);\n    assertThat(storedData, isA(Map.class));\n    Map<String, Object> castedData = (Map<String, Object>) storedData;\n    assertThat(castedData, is(aMapWithSize(0)));\n  }\n\n  @Test\n  public void parsesEmptyJsonIfSectionIfVariableNameNull() throws Exception {\n    String variableName = null;\n    Object output = render(variableName, new Object[] {}, TagType.SECTION);\n\n    // Check that it returns empty object because variable name is null\n    assertThat(output, instanceOf(Map.class));\n    Map<String, Object> result = (Map<String, Object>) output;\n    assertThat(result, aMapWithSize(0));\n  }\n\n  @Test\n  public void parsesEmptyJsonIfNotSection() throws Exception {\n    String inputJson = \"\";\n    String variableName = \"parsedObject\";\n    Object[] params = {variableName};\n    Options options =\n        new Options.Builder(null, null, TagType.VAR, createContext(), Template.EMPTY)\n            .setParams(params)\n            .build();\n    Object output = render(inputJson, options);\n\n    // Check that it returns empty object\n    assertThat(output, is(nullValue()));\n\n    /* Check that it stores parsed json (an empty map in this case because json is empty)\n     * in given variable name */\n    Object storedData = options.data(variableName);\n    assertThat(storedData, isA(Map.class));\n    Map<String, Object> castedData = (Map<String, Object>) storedData;\n    assertThat(castedData, is(aMapWithSize(0)));\n  }\n\n  @Test\n  public void parsesEmptyJsonWithBracesIfNotSection() throws Exception {\n    String inputJson = \"{}\";\n    String variableName = \"parsedObject\";\n    Object[] params = {variableName};\n    Options options =\n        new Options.Builder(null, null, TagType.VAR, createContext(), Template.EMPTY)\n            .setParams(params)\n            .build();\n    Object output = render(inputJson, options);\n\n    // Check that it returns empty object\n    assertThat(output, is(nullValue()));\n\n    /* Check that it stores parsed json (an empty map in this case because json is empty)\n     * in given variable name */\n    Object storedData = options.data(variableName);\n    assertThat(storedData, isA(Map.class));\n    Map<String, Object> castedData = (Map<String, Object>) storedData;\n    assertThat(castedData, is(aMapWithSize(0)));\n  }\n\n  @Test\n  public void parsesEmptyJsonIfNotSectionIfVariableNameAbsent() throws Exception {\n    String inputJson = \"{}\";\n    Object output = render(inputJson, new Object[] {}, TagType.VAR);\n\n    // Check that it returns empty object because variable name is null\n    assertThat(output, instanceOf(Map.class));\n    Map<String, Object> result = (Map<String, Object>) output;\n    assertThat(result, aMapWithSize(0));\n  }\n\n  private Object render(Object context, Object[] params, TagType tagType) throws IOException {\n    return render(\n        context,\n        new Options.Builder(null, null, tagType, createContext(), Template.EMPTY)\n            .setParams(params)\n            .build());\n  }\n\n  private Object render(Object context, Options options) throws IOException {\n    return helper.apply(context, options);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/RegexExtractHelperTest.java",
    "content": "/*\n * Copyright (C) 2021-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.LocalNotifier;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class RegexExtractHelperTest extends HandlebarsHelperTestBase {\n\n  private RegexExtractHelper helper;\n\n  @BeforeEach\n  public void init() {\n    helper = new RegexExtractHelper();\n    LocalNotifier.set(new ConsoleNotifier(true));\n  }\n\n  @Test\n  public void canExtractSingleRegexMatch() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/api/abc,def,ghi\"),\n            aResponse()\n                .withBody(\"{\\\"test\\\": \\\"{{regexExtract request.path.[1] '([A-Za-z]+)'}}\\\"}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"{\\\"test\\\": \\\"abc\\\"}\"));\n  }\n\n  @Test\n  public void canExtractMultipleRegexMatches() {\n    final ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().url(\"/api/abc,def,ghi\"),\n            aResponse()\n                .withBody(\n                    \"{\\\"test\\\": \\\"{{regexExtract request.path.[1] '([A-Za-z]+)' 'parts'}}{{#each parts}}{{this}} {{/each}}\\\"}\"));\n\n    assertThat(responseDefinition.getBody(), is(\"{\\\"test\\\": \\\"abc def ghi \\\"}\"));\n  }\n\n  @Test\n  public void noMatchErrorWhenNoRegexMatch() {\n    testHelperError(\n        helper, \"/123/456,789,900\", \"([A-Za-z]+)\", is(\"[ERROR: Nothing matched ([A-Za-z]+)]\"));\n  }\n\n  @Test\n  public void invalidRegExErrorWhenRegexStringIsInvalid() {\n    testHelperError(\n        helper,\n        \"/123/456,789,900\",\n        \"(([A-Za-z]+)\",\n        is(\"[ERROR: Invalid regex string (([A-Za-z]+)]\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/RenderableDateTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.time.ZoneId;\nimport java.util.Date;\nimport org.junit.jupiter.api.Test;\n\npublic class RenderableDateTest {\n\n  @Test\n  void writesToJsonInStringFormat() {\n    RenderableDate renderableDate = new RenderableDate(new Date(1729266504010L), null, null);\n    assertThat(Json.write(renderableDate), is(\"\\\"2024-10-18T15:48:24Z\\\"\"));\n  }\n\n  @Test\n  void handlesCorrectlyFormatsExcessivePrecision() {\n    RenderableDate renderableDate =\n        new RenderableDate(\n            new Date(1729266504010L), \"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'\", ZoneId.of(\"UTC\"));\n    assertThat(Json.write(renderableDate), is(\"\\\"2024-10-18T15:48:24.010000Z\\\"\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/SystemValueHelperTest.java",
    "content": "/*\n * Copyright (C) 2019-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.LocalNotifier;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.SystemKeyAuthoriser;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport org.junit.jupiter.api.Assumptions;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junitpioneer.jupiter.ClearSystemProperty;\n\npublic class SystemValueHelperTest {\n\n  private SystemValueHelper helper;\n\n  @BeforeEach\n  public void init() {\n    helper = new SystemValueHelper(new SystemKeyAuthoriser(Set.of(\".*\")));\n    LocalNotifier.set(new ConsoleNotifier(true));\n  }\n\n  @Test\n  public void getExistingEnvironmentVariableShouldNotNull() {\n    Optional<String> key = System.getenv().keySet().stream().findFirst();\n    Assumptions.assumeTrue(key.isPresent());\n    Map<String, Object> optionsHash = Map.of(\"key\", key.get(), \"type\", \"ENVIRONMENT\");\n\n    String output = render(optionsHash);\n    assertEquals(System.getenv(key.get()), output);\n  }\n\n  @Test\n  public void getExistingEnvironmentVariableWithDefault() {\n    Optional<String> key = System.getenv().keySet().stream().findFirst();\n    Assumptions.assumeTrue(key.isPresent());\n    Map<String, Object> optionsHash =\n        Map.of(\"key\", key.get(), \"type\", \"ENVIRONMENT\", \"default\", \"DEFAULT\");\n\n    String output = render(optionsHash);\n    assertEquals(System.getenv(key.get()), output);\n  }\n\n  @Test\n  public void getNonExistingEnvironmentVariableShouldNull() {\n    Map<String, Object> optionsHash = Map.of(\"key\", \"NON_EXISTING_VAR\", \"type\", \"ENVIRONMENT\");\n\n    String output = render(optionsHash);\n    assertNull(output);\n  }\n\n  @Test\n  public void getNonExistingEnvironmentVariableWithDefault() {\n    Map<String, Object> optionsHash =\n        Map.of(\"key\", \"NON_EXISTING_VAR\", \"type\", \"ENVIRONMENT\", \"default\", \"DEFAULT\");\n\n    String output = render(optionsHash);\n    assertEquals(\"DEFAULT\", output);\n  }\n\n  @Test\n  public void getForbiddenEnvironmentVariableShouldReturnError() {\n    helper = new SystemValueHelper(new SystemKeyAuthoriser(Set.of(\"JAVA*\")));\n\n    Map<String, Object> optionsHash = Map.of(\"key\", \"TEST_VAR\", \"type\", \"ENVIRONMENT\");\n    String value = render(optionsHash);\n    assertEquals(\"[ERROR: Access to TEST_VAR is denied]\", value);\n  }\n\n  @Test\n  public void getEmptyKeyShouldReturnError() {\n    Map<String, Object> optionsHash = Map.of(\"key\", \"\", \"type\", \"PROPERTY\");\n    String value = render(optionsHash);\n    assertEquals(\"[ERROR: The key cannot be empty]\", value);\n  }\n\n  @Test\n  @ClearSystemProperty(key = \"test.key\")\n  public void getAllowedPropertyShouldSuccess() {\n    helper = new SystemValueHelper(new SystemKeyAuthoriser(Set.of(\"test.*\")));\n    System.setProperty(\"test.key\", \"aaa\");\n    assertEquals(\"aaa\", System.getProperty(\"test.key\"));\n    Map<String, Object> optionsHash = Map.of(\"key\", \"test.key\", \"type\", \"PROPERTY\");\n    String value = render(optionsHash);\n    assertEquals(\"aaa\", value);\n  }\n\n  @Test\n  @ClearSystemProperty(key = \"test.key\")\n  public void getAllowedPropertyWithDefault() {\n    helper = new SystemValueHelper(new SystemKeyAuthoriser(Set.of(\"test.*\")));\n    System.setProperty(\"test.key\", \"aaa\");\n    assertEquals(\"aaa\", System.getProperty(\"test.key\"));\n    Map<String, Object> optionsHash =\n        Map.of(\"key\", \"test.key\", \"type\", \"PROPERTY\", \"default\", \"DEFAULT\");\n    String value = render(optionsHash);\n    assertEquals(\"aaa\", value);\n  }\n\n  @Test\n  @ClearSystemProperty(key = \"test.key\")\n  public void getForbiddenPropertyShouldReturnError() {\n    helper = new SystemValueHelper(new SystemKeyAuthoriser(Set.of(\"JAVA.*\")));\n    System.setProperty(\"test.key\", \"aaa\");\n    Map<String, Object> optionsHash = Map.of(\"key\", \"test.key\", \"type\", \"PROPERTY\");\n    String value = render(optionsHash);\n    assertEquals(\"[ERROR: Access to test.key is denied]\", value);\n  }\n\n  @Test\n  public void getNonExistingSystemPropertyShouldNull() {\n    Map<String, Object> optionsHash = Map.of(\"key\", \"not.existing.prop\", \"type\", \"PROPERTY\");\n    String output = render(optionsHash);\n    assertNull(output);\n  }\n\n  @Test\n  public void getNonExistingSystemPropertyWithDefault() {\n    Map<String, Object> optionsHash =\n        Map.of(\"key\", \"not.existing.prop\", \"type\", \"PROPERTY\", \"default\", \"DEFAULT\");\n    String output = render(optionsHash);\n    assertEquals(\"DEFAULT\", output);\n  }\n\n  @Test\n  public void getDefaultType() {\n    Optional<String> key = System.getenv().keySet().stream().findFirst();\n    Assumptions.assumeTrue(key.isPresent());\n    Map<String, Object> optionsHash = Map.of(\"key\", key.get());\n\n    String output = render(optionsHash);\n    assertEquals(System.getenv(key.get()), output);\n  }\n\n  private String render(Map<String, Object> optionsHash) {\n    return helper.apply(\n        null, new Options.Builder(null, null, null, null, null).setHash(optionsHash).build());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ToJsonHelperTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.EnabledOnOs;\nimport org.junit.jupiter.api.condition.OS;\n\npublic class ToJsonHelperTest extends HandlebarsHelperTestBase {\n\n  @Test\n  void convertArrayToJson() {\n    String responseTemplate = \"{{ toJson (array 1 2 3) }}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"[ 1, 2, 3 ]\"));\n  }\n\n  @Test\n  void convertNullToJson() {\n    String responseTemplate = \"{{ toJson null }}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"\"));\n  }\n\n  @Test\n  void convertStringToJson() {\n    String responseTemplate = \"{{ toJson 'null' }}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"\\\"null\\\"\"));\n  }\n\n  @Test\n  @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void convertMapToJson() {\n    String responseTemplate = \"{{ toJson request.headers }}\";\n    ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().header(\"Authorization\", \"whatever\").header(\"Content-Type\", \"text/plain\"),\n            aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\"{\\n  \\\"Authorization\\\" : \\\"whatever\\\",\\n  \\\"Content-Type\\\" : \\\"text/plain\\\"\\n}\"));\n  }\n\n  @Test\n  @EnabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void convertMapToJsonWindows() {\n    String responseTemplate = \"{{ toJson request.headers }}\";\n    ResponseDefinition responseDefinition =\n        transform(\n            transformer,\n            mockRequest().header(\"Authorization\", \"whatever\").header(\"Content-Type\", \"text/plain\"),\n            aResponse().withBody(responseTemplate));\n\n    assertThat(\n        responseDefinition.getBody(),\n        is(\"{\\r\\n  \\\"Authorization\\\" : \\\"whatever\\\",\\r\\n  \\\"Content-Type\\\" : \\\"text/plain\\\"\\r\\n}\"));\n  }\n\n  @Test\n  void convertBooleanToJson() {\n    String responseTemplate = \"{{ toJson true }}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"true\"));\n  }\n\n  @Test\n  void convertNumberToJson() {\n    String responseTemplate = \"{{ toJson 123 }}\";\n    ResponseDefinition responseDefinition =\n        transform(transformer, mockRequest(), aResponse().withBody(responseTemplate));\n\n    assertThat(responseDefinition.getBody(), is(\"123\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/TruncateDateTimeHelperTest.java",
    "content": "/*\n * Copyright (C) 2017-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport java.io.IOException;\nimport java.time.Instant;\nimport java.time.ZonedDateTime;\nimport java.util.Date;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class TruncateDateTimeHelperTest extends HandlebarsHelperTestBase {\n\n  private TruncateDateTimeHelper helper;\n\n  @BeforeEach\n  public void init() {\n    helper = new TruncateDateTimeHelper();\n  }\n\n  @Test\n  public void truncatesDateObject() throws IOException {\n    Date date = Date.from(ZonedDateTime.parse(\"2020-03-27T11:22:33Z\").toInstant());\n\n    Object output = renderHelperValue(helper, date, \"last day of month\");\n\n    assertThat(output, Matchers.instanceOf(Date.class));\n\n    Date truncated = (Date) output;\n    assertThat(truncated.toInstant(), is(Instant.parse(\"2020-03-31T00:00:00Z\")));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ValHelperTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.nullValue;\n\nimport com.github.jknack.handlebars.Options;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ValHelperTest extends HandlebarsHelperTestBase {\n\n  ValHelper helper;\n\n  @BeforeEach\n  void init() {\n    helper = new ValHelper();\n  }\n\n  @Test\n  void returnsTheValuePassedInWhenNoOtherParameters() throws Exception {\n    assertThat(renderHelperValue(helper, \"some value\"), is(\"some value\"));\n\n    List<Integer> list = List.of(1, 2, 3);\n    assertThat(renderHelperValue(helper, list), is(list));\n  }\n\n  @Test\n  void returnsTheDefaultValueWhenValueIsNull() throws Exception {\n    assertThat(renderHelperValue(helper, null, Map.of(\"or\", \"other value\")), is(\"other value\"));\n    assertThat(\n        renderHelperValue(helper, null, Map.of(\"default\", \"other value\")), is(\"other value\"));\n  }\n\n  @Test\n  void returnsTheValueWhenNotNullAndDefaultIsSpecified() throws Exception {\n    assertThat(\n        renderHelperValue(helper, \"some value\", Map.of(\"or\", \"other value\")), is(\"some value\"));\n    assertThat(\n        renderHelperValue(helper, \"some value\", Map.of(\"default\", \"other value\")),\n        is(\"some value\"));\n  }\n\n  @Test\n  void assignsToTheNamedVariable() throws Exception {\n    Options options = createOptions(Map.of(\"assign\", \"myVar\"));\n\n    Object returnValue = helper.apply(\"some value\", options);\n\n    assertThat(options.context.data(\"myVar\"), is(\"some value\"));\n    assertThat(returnValue, nullValue());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/extension/webhooks/WebhooksRegistrationTest.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.webhooks;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.not;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.standalone.WireMockServerRunner;\nimport java.io.ByteArrayOutputStream;\nimport java.io.PrintStream;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.wiremock.webhooks.Webhooks;\n\nclass WebhooksRegistrationTest {\n  private static final String MESSAGE =\n      \"Passing webhooks in extensions is no longer required and\"\n          + \" may lead to compatibility issues in future\";\n  private WireMockServerRunner runner;\n  private WireMockServer server;\n\n  private final PrintStream stdOut = System.out;\n  private ByteArrayOutputStream out;\n\n  @BeforeEach\n  public void recordCommandLineMessages() {\n    startRecordingSystemOut();\n  }\n\n  @AfterEach\n  public void resetPrintStream() {\n    System.setOut(stdOut);\n    stopServer();\n  }\n\n  private void startRecordingSystemOut() {\n    out = new ByteArrayOutputStream();\n    System.setOut(new PrintStream(out));\n  }\n\n  private void stopServer() {\n    if (server != null && server.isRunning()) {\n      server.stop();\n    }\n  }\n\n  private void stopRunner() {\n    if (runner != null && runner.isRunning()) {\n      runner.stop();\n    }\n  }\n\n  private String getSystemOutText() {\n    return out.toString();\n  }\n\n  @Test\n  void shouldLogMessageWhenWebhooksAreAddedViaClassName() {\n    server =\n        new WireMockServer(\n            wireMockConfig().extensions(\"org.wiremock.webhooks.Webhooks\").dynamicPort());\n    server.start();\n    assertThat(getSystemOutText(), containsString(MESSAGE));\n  }\n\n  @Test\n  void shouldLogMessageWhenWebhooksAreAddedViaClass() {\n    server = new WireMockServer(wireMockConfig().extensions(Webhooks.class).dynamicPort());\n    server.start();\n    assertThat(getSystemOutText(), containsString(MESSAGE));\n  }\n\n  @Test\n  void shouldLogAMessageWhenWebhooksAreAddedViaCLI() {\n    runner = new WireMockServerRunner();\n    runner.run(\"--extensions\", \"org.wiremock.webhooks.Webhooks\", \"--port\", \"0\");\n    assertThat(getSystemOutText(), containsString(MESSAGE));\n    stopRunner();\n  }\n\n  @Test\n  void shouldNotLogAMessageWhenWebhooksAreNotAddedExplicitly() {\n    server = new WireMockServer(wireMockConfig().dynamicPort());\n    server.start();\n    assertThat(getSystemOutText(), not(containsString(MESSAGE)));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/AdminRequestHandlerTest.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.mockito.ArgumentMatchers.contains;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.verify;\n\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.io.UnsupportedEncodingException;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class AdminRequestHandlerTest {\n\n  private Notifier notifier = mock(Notifier.class);\n\n  @RegisterExtension\n  private WireMockExtension wm =\n      WireMockExtension.newInstance().options(options().dynamicPort().notifier(notifier)).build();\n\n  @Test\n  public void shouldLogInfoOnRequest() throws UnsupportedEncodingException {\n    WireMockTestClient client = new WireMockTestClient(wm.getPort());\n\n    String postHeaderABCName = \"ABC\";\n    String postHeaderABCValue = \"abc123\";\n    String postBody =\n        \"{\\n\"\n            + \"    \\\"request\\\": {\\n\"\n            + \"        \\\"method\\\": \\\"GET\\\",\\n\"\n            + \"        \\\"url\\\": \\\"/some/thing\\\"\\n\"\n            + \"    },\\n\"\n            + \"    \\\"response\\\": {\\n\"\n            + \"        \\\"status\\\": 200,\\n\"\n            + \"        \\\"body\\\": \\\"Hello world!\\\",\\n\"\n            + \"        \\\"headers\\\": {\\n\"\n            + \"            \\\"Content-Type\\\": \\\"text/plain\\\"\\n\"\n            + \"        }\\n\"\n            + \"    }\\n\"\n            + \"}\";\n\n    client.postWithBody(\n        \"/__admin/mappings\", postBody, withHeader(postHeaderABCName, postHeaderABCValue));\n\n    verify(notifier).info(contains(\"Admin request received:\\n127.0.0.1 - POST /mappings\\n\"));\n    verify(notifier).info(contains(postHeaderABCName + \": [\" + postHeaderABCValue + \"]\\n\"));\n    verify(notifier).info(contains(postBody));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/BodyTest.java",
    "content": "/*\n * Copyright (C) 2015-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.*;\nimport static com.github.tomakehurst.wiremock.common.Strings.bytesFromString;\nimport static com.github.tomakehurst.wiremock.common.Strings.stringFromBytes;\nimport static org.assertj.core.api.Assertions.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.node.IntNode;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport java.nio.charset.StandardCharsets;\nimport org.junit.jupiter.api.Test;\n\nclass BodyTest {\n\n  @Test\n  void constructsFromBytes() {\n    String content = \"this content\";\n    Body body =\n        Body.fromOneOf(content.getBytes(), \"not this content\", new IntNode(1), \"lskdjflsjdflks\");\n\n    assertThat(body.asString(), is(content));\n    assertThat(body.isBinary(), is(true));\n    assertThat(body.asBytes(), is(bytesFromString(content)));\n    assertThat(body.isJson(), is(false));\n    assertThatThrownBy(body::asJson).isInstanceOf(JsonException.class);\n    assertThat(body.asBase64(), is(encodeBase64(bytesFromString(content))));\n  }\n\n  @Test\n  void constructsFromBytesWhichIsUnknowinglyAJson() {\n    String content = \"{\\\"name\\\":\\\"wiremock\\\",\\\"isCool\\\":true}\";\n    Body body =\n        Body.fromOneOf(content.getBytes(), \"not this content\", new IntNode(1), \"lskdjflsjdflks\");\n\n    assertThat(body.asString(), is(content));\n    assertThat(body.isBinary(), is(true));\n    assertThat(body.asBytes(), is(bytesFromString(content)));\n    assertThat(body.isJson(), is(false));\n    assertThat(body.asJson(), is(Json.node(content)));\n    assertThat(body.asBase64(), is(encodeBase64(bytesFromString(content))));\n  }\n\n  @Test\n  void constructsFromString() {\n    String content = \"this content\";\n    Body body = Body.fromOneOf(null, content, new IntNode(1), \"lskdjflsjdflks\");\n\n    assertThat(body.asString(), is(content));\n    assertThat(body.isBinary(), is(false));\n    assertThat(body.asBytes(), is(bytesFromString(content)));\n    assertThat(body.isJson(), is(false));\n    assertThatThrownBy(body::asJson).isInstanceOf(JsonException.class);\n    assertThat(body.asBase64(), is(encodeBase64(bytesFromString(content))));\n  }\n\n  @Test\n  void constructsFromJson() {\n    IntNode jsonContent = new IntNode(1);\n    Body body = Body.fromOneOf(null, null, jsonContent, \"lskdjflsjdflks\");\n\n    assertThat(body.asString(), is(\"1\"));\n    assertThat(body.isBinary(), is(false));\n    assertThat(body.asBytes(), is(bytesFromString(\"1\")));\n    assertThat(body.isJson(), is(true));\n    assertThat(body.asJson(), is(jsonContent));\n    assertThat(body.asBase64(), is(encodeBase64(bytesFromString(\"1\"))));\n  }\n\n  @Test\n  void constructsFromBase64() {\n    String content = \"this content\";\n    byte[] base64Encoded = bytesFromString(encodeBase64(bytesFromString(content)));\n    String encodedText = stringFromBytes(base64Encoded);\n    Body body = Body.fromOneOf(null, null, null, encodedText);\n\n    assertThat(body.asString(), is(content));\n    assertThat(body.isBinary(), is(true));\n    assertThat(body.asBytes(), is(content.getBytes(StandardCharsets.UTF_8)));\n    assertThat(body.isJson(), is(false));\n    assertThatThrownBy(body::asJson).isInstanceOf(JsonException.class);\n    assertThat(body.asBase64(), is(encodedText));\n  }\n\n  @Test\n  void constructsFromJsonBytes() {\n    String jsonString = \"{\\\"name\\\":\\\"wiremock\\\",\\\"isCool\\\":true}\";\n    JsonNode jsonNode = Json.node(jsonString);\n    Body body = Body.fromJsonBytes(bytesFromString(jsonString));\n\n    assertThat(body.asString(), is(jsonString));\n    assertThat(body.isBinary(), is(false));\n    assertThat(body.asBytes(), is(bytesFromString(jsonString)));\n    assertThat(body.isJson(), is(true));\n    assertThat(body.asJson(), is(jsonNode));\n    assertThat(body.asBase64(), is(encodeBase64(bytesFromString(jsonString))));\n  }\n\n  @Test\n  void bodyAsJson() {\n    final JsonNode jsonContent = Json.node(\"{\\\"name\\\":\\\"wiremock\\\",\\\"isCool\\\":true}\");\n    Body body = Body.fromOneOf(null, null, jsonContent, \"lskdjflsjdflks\");\n\n    assertThat(body.asJson(), is(jsonContent));\n  }\n\n  @Test\n  void hashCorrectly() {\n    byte[] primes = {2, 3, 5, 7};\n    byte[] primes2 = {2, 3, 5, 7};\n\n    Body body = new Body(primes);\n    Body body2 = new Body(primes2);\n\n    assertEquals(body.hashCode(), body2.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/ContentTypeHeaderTest.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.nullValue;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.testsupport.MockRequestBuilder;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Optional;\nimport org.junit.jupiter.api.Test;\n\npublic class ContentTypeHeaderTest {\n  @Test\n  public void returnsMimeTypeAndCharsetWhenBothPresent() {\n    ContentTypeHeader header = new ContentTypeHeader(\"text/plain; charset=utf-8\");\n    assertThat(header.mimeTypePart(), is(\"text/plain\"));\n    Optional<String> encoding = header.encodingPart();\n    assertTrue(encoding.isPresent());\n    assertThat(encoding.get(), is(\"utf-8\"));\n  }\n\n  @Test\n  public void returnsMimeTypeWhenNoCharsetPresent() {\n    ContentTypeHeader header = new ContentTypeHeader(\"text/plain\");\n    assertThat(header.mimeTypePart(), is(\"text/plain\"));\n  }\n\n  @Test\n  public void returnsCharsetWhenNotFirstParameter() {\n    ContentTypeHeader header = new ContentTypeHeader(\"text/plain; param=value; charset=utf-8\");\n    Optional<String> encoding = header.encodingPart();\n    assertTrue(encoding.isPresent());\n    assertThat(encoding.get(), is(\"utf-8\"));\n  }\n\n  @Test\n  public void returnsAbsentOptionalEncodingPartWhenNotPresent() {\n    ContentTypeHeader header = new ContentTypeHeader(\"text/plain\");\n    assertFalse(header.encodingPart().isPresent());\n  }\n\n  @Test\n  public void stripsDoubleQuotesFromEncodingPart() {\n    ContentTypeHeader header = new ContentTypeHeader(\"application/json;charset=\\\"UTF-8\\\"\");\n    Optional<String> encoding = header.encodingPart();\n    assertTrue(encoding.isPresent());\n    assertThat(encoding.get(), is(\"UTF-8\"));\n  }\n\n  @Test\n  public void fetchesFromRequest() {\n    Request request = new MockRequestBuilder().withHeader(\"Content-Type\", \"text/xml\").build();\n\n    ContentTypeHeader contentTypeHeader = request.contentTypeHeader();\n    assertThat(contentTypeHeader.mimeTypePart(), is(\"text/xml\"));\n  }\n\n  @Test\n  public void throwsExceptionOnAttemptToSetNullHeaderValue() {\n    assertThrows(\n        NullPointerException.class,\n        () -> new MockRequestBuilder().withHeader(\"Content-Type\", null).build());\n  }\n\n  @Test\n  public void returnsNullFromMimeTypePartWhenContentTypeIsAbsent() {\n    ContentTypeHeader header = ContentTypeHeader.absent();\n    assertThat(header.mimeTypePart(), is(nullValue()));\n  }\n\n  @Test\n  public void returnsCharsetWhenPresent() {\n    ContentTypeHeader header = new ContentTypeHeader(\"text/plain; charset=iso-8859-1\");\n    assertThat(header.charset(), is(StandardCharsets.ISO_8859_1));\n  }\n\n  @Test\n  public void returnsDefaultCharsetWhenEncodingNotPresent() {\n    ContentTypeHeader header = new ContentTypeHeader(\"text/plain\");\n    assertThat(header.charset(), is(UTF_8));\n  }\n\n  @Test\n  public void returnsDefaultCharsetWhenAbsent() {\n    ContentTypeHeader header = ContentTypeHeader.absent();\n    assertThat(header.charset(), is(UTF_8));\n  }\n\n  @Test\n  public void returnsDefaultCharsetWhenIllegalEncoding() {\n    ContentTypeHeader header = new ContentTypeHeader(\"text/plain; charset=invalid\");\n    assertThat(header.charset(), is(UTF_8));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/CookieTest.java",
    "content": "/*\n * Copyright (C) 2017-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalToJson;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItems;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Test;\n\npublic class CookieTest {\n\n  @Test\n  public void serialisesCorrectlyWithSingleValue() {\n    Cookie cookie = new Cookie(\"my_cookie\", \"one\");\n    assertThat(Json.write(cookie), is(\"\\\"one\\\"\"));\n  }\n\n  @Test\n  public void serialisesCorrectlyWithManyValues() {\n    Cookie cookie = new Cookie(\"my_cookie\", \"one\", \"two\", \"three\");\n    assertThat(Json.write(cookie), equalToJson(\"[\\\"one\\\", \\\"two\\\", \\\"three\\\"]\"));\n  }\n\n  @Test\n  public void serialisesCorrectlyWithNoValues() {\n    Cookie cookie = new Cookie(\"my_cookie\", new String[] {});\n    assertThat(Json.write(cookie), equalToJson(\"[]\"));\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithSingleValue() {\n    String json = \"\\\"one\\\"\";\n\n    Cookie cookie = Json.read(json, Cookie.class);\n\n    assertThat(cookie.getValues().size(), is(1));\n    assertThat(cookie.getValue(), is(\"one\"));\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithManyValues() {\n    String json = \"[\\\"one\\\", \\\"two\\\", \\\"three\\\"]\";\n\n    Cookie cookie = Json.read(json, Cookie.class);\n\n    assertThat(cookie.getValues().size(), is(3));\n    assertThat(cookie.getValues(), hasItems(\"one\", \"two\", \"three\"));\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithNoValues() {\n    String json = \"[]\";\n\n    Cookie cookie = Json.read(json, Cookie.class);\n\n    assertThat(cookie.getValues().size(), is(0));\n    assertThat(cookie.isAbsent(), is(true));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/HttpClientFactoryAcceptsTrustedCertificatesTest.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.testsupport.HttpClientUtils.getEntityAsStringAndCloseStream;\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.singletonList;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport java.util.Collection;\nimport java.util.List;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.junit.jupiter.api.condition.DisabledForJreRange;\nimport org.junit.jupiter.api.condition.JRE;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.MethodSource;\n\n@DisabledForJreRange(\n    min = JRE.JAVA_17,\n    disabledReason = \"does not support generating certificates at runtime\")\npublic class HttpClientFactoryAcceptsTrustedCertificatesTest\n    extends HttpClientFactoryCertificateVerificationTest {\n\n  public static Collection<Object[]> data() {\n    return asList(\n        new Object[][] {\n          // trusted                     certificateCN validCertificate?\n          {TRUST_NOBODY, \"localhost\", true},\n          {singletonList(\"other.com\"), \"localhost\", true},\n          {singletonList(\"localhost\"), \"other.com\", true},\n          {singletonList(\"localhost\"), \"other.com\", false},\n          {singletonList(\"localhost\"), \"localhost\", true},\n          {singletonList(\"localhost\"), \"localhost\", false},\n        });\n  }\n\n  @MethodSource(\"data\")\n  @ParameterizedTest(name = \"{index}: trusted={0}, certificateCN={1}, validCertificate={2}\")\n  public void certificatesAreAccepted(\n      List<String> trustedHosts, String certificateCN, boolean validCertificate) throws Exception {\n\n    startServerAndBuildClient(trustedHosts, certificateCN, validCertificate);\n\n    server.stubFor(get(\"/whatever\").willReturn(aResponse().withBody(\"Hello World\")));\n\n    CloseableHttpResponse response = client.execute(new HttpGet(server.url(\"/whatever\")));\n\n    String result = getEntityAsStringAndCloseStream(response);\n\n    assertEquals(\"Hello World\", result);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/HttpClientFactoryCertificateVerificationTest.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.ProxySettings.NO_PROXY;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.crypto.InMemoryKeyStore.KeyStoreType.JKS;\nimport static com.github.tomakehurst.wiremock.crypto.X509CertificateVersion.V3;\nimport static java.util.Collections.emptyList;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.common.NetworkAddressRules;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport com.github.tomakehurst.wiremock.crypto.CertificateSpecification;\nimport com.github.tomakehurst.wiremock.crypto.InMemoryKeyStore;\nimport com.github.tomakehurst.wiremock.crypto.Secret;\nimport com.github.tomakehurst.wiremock.crypto.X509CertificateSpecification;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport java.io.File;\nimport java.security.KeyPair;\nimport java.security.KeyPairGenerator;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.cert.Certificate;\nimport java.util.Date;\nimport java.util.List;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.junit.jupiter.api.AfterEach;\n\npublic abstract class HttpClientFactoryCertificateVerificationTest {\n\n  protected static final List<String> TRUST_NOBODY = emptyList();\n\n  protected WireMockServer server = null;\n  protected CloseableHttpClient client;\n\n  public void startServerAndBuildClient(\n      List<String> trustedHosts, String certificateCN, boolean validCertificate) throws Exception {\n\n    InMemoryKeyStore ks = new InMemoryKeyStore(JKS, new Secret(\"password\"));\n\n    KeyPair keyPair = generateKeyPair();\n\n    CertificateSpecification certificateSpecification =\n        new X509CertificateSpecification(\n            /* version= */ V3,\n            /* subject= */ \"CN=\" + certificateCN,\n            /* issuer= */ \"CN=wiremock.org\",\n            /* notBefore= */ new Date(),\n            /* notAfter= */ new Date(System.currentTimeMillis() + (365L * 24 * 60 * 60 * 1000)));\n\n    Certificate certificate = certificateSpecification.certificateFor(keyPair);\n\n    ks.addPrivateKey(\"wiremock\", keyPair, certificate);\n\n    File serverKeyStoreFile = File.createTempFile(\"wiremock-server\", \"jks\");\n\n    ks.saveAs(serverKeyStoreFile);\n\n    server =\n        new WireMockServer(\n            options()\n                .httpDisabled(true)\n                .dynamicHttpsPort()\n                .keystorePath(serverKeyStoreFile.getAbsolutePath()));\n    server.start();\n\n    InMemoryKeyStore clientTrustStore = new InMemoryKeyStore(JKS, new Secret(\"password\"));\n    if (validCertificate) {\n      clientTrustStore.addCertificate(\"wiremock\", certificate);\n    }\n    File clientTrustStoreFile = File.createTempFile(\"wiremock-client\", \"jks\");\n    clientTrustStore.saveAs(clientTrustStoreFile);\n    KeyStoreSettings clientTrustStoreSettings =\n        new KeyStoreSettings(clientTrustStoreFile.getAbsolutePath(), \"password\", \"jks\");\n\n    client =\n        ApacheHttpClientFactory.createClient(\n            1000,\n            5 * 1000 * 60,\n            NO_PROXY,\n            clientTrustStoreSettings,\n            /* trustSelfSignedCertificates= */ false,\n            trustedHosts,\n            false,\n            NetworkAddressRules.ALLOW_ALL,\n            true,\n            null);\n  }\n\n  @AfterEach\n  public void stopServer() {\n    if (server != null) {\n      server.stop();\n    }\n  }\n\n  private KeyPair generateKeyPair() throws NoSuchAlgorithmException {\n    KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n    keyGen.initialize(1024);\n    return keyGen.generateKeyPair();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/HttpClientFactoryRejectsUntrustedCertificatesTest.java",
    "content": "/*\n * Copyright (C) 2020-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.singletonList;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport java.util.Collection;\nimport java.util.List;\nimport javax.net.ssl.SSLException;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.junit.jupiter.api.condition.DisabledForJreRange;\nimport org.junit.jupiter.api.condition.JRE;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.MethodSource;\n\n@DisabledForJreRange(\n    min = JRE.JAVA_17,\n    disabledReason = \"does not support generating certificates at runtime\")\npublic class HttpClientFactoryRejectsUntrustedCertificatesTest\n    extends HttpClientFactoryCertificateVerificationTest {\n  public static Collection<Object[]> data() {\n    return asList(\n        new Object[][] {\n          // trusted                     certificateCN validCertificate?\n          {TRUST_NOBODY, \"other.com\", true},\n          {TRUST_NOBODY, \"other.com\", false},\n          {TRUST_NOBODY, \"localhost\", false},\n          {singletonList(\"other.com\"), \"other.com\", true},\n          {singletonList(\"other.com\"), \"other.com\", false},\n          {singletonList(\"other.com\"), \"localhost\", false}\n        });\n  }\n\n  @MethodSource(\"data\")\n  @ParameterizedTest(name = \"{index}: trusted={0}, certificateCN={1}, validCertificate={2}\")\n  public void certificatesAreRejectedAsExpected(\n      List<String> trustedHosts, String certificateCN, boolean validCertificate) throws Exception {\n\n    startServerAndBuildClient(trustedHosts, certificateCN, validCertificate);\n\n    server.stubFor(get(\"/whatever\").willReturn(aResponse().withBody(\"Hello World\")));\n\n    assertThrows(SSLException.class, () -> client.execute(new HttpGet(server.url(\"/whatever\"))));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/HttpHeaderTest.java",
    "content": "/*\n * Copyright (C) 2012-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItems;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.core.IsEqual.equalTo;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport org.junit.jupiter.api.Test;\n\npublic class HttpHeaderTest {\n\n  @Test\n  public void returnsIsPresentFalseWhenNoValuesPresent() {\n    HttpHeader header = HttpHeader.absent(\"Test-Header\");\n    assertThat(header.isPresent(), is(false));\n  }\n\n  @Test\n  public void returnsIsPresentTrueWhenOneValuePresent() {\n    HttpHeader header = new HttpHeader(\"Test-Header\", \"value\");\n    assertThat(header.isPresent(), is(true));\n  }\n\n  @Test\n  public void returnsFirstValueWhenOneSpecified() {\n    HttpHeader header = new HttpHeader(\"Test-Header\", \"value\");\n    assertThat(header.firstValue(), is(\"value\"));\n  }\n\n  @Test\n  public void returnsAllValuesWhenManySpecified() {\n    HttpHeader header = new HttpHeader(\"Test-Header\", \"value1\", \"value2\", \"value3\");\n    assertThat(header.values(), hasItems(\"value1\", \"value2\", \"value3\"));\n  }\n\n  @Test\n  public void correctlyIndicatesWhenHeaderContainsValue() {\n    HttpHeader header = new HttpHeader(\"Test-Header\", \"value1\", \"value2\", \"value3\");\n    assertThat(header.containsValue(\"value2\"), is(true));\n    assertThat(header.containsValue(\"value72727\"), is(false));\n  }\n\n  @Test\n  public void throwsExceptionWhenAttemptingToAccessFirstValueWhenAbsent() {\n    assertThrows(IllegalStateException.class, () -> HttpHeader.absent(\"Something\").firstValue());\n  }\n\n  @Test\n  public void throwsExceptionWhenAttemptingToAccessValuesWhenAbsent() {\n    assertThrows(IllegalStateException.class, () -> HttpHeader.absent(\"Something\").values());\n  }\n\n  @Test\n  public void shouldMatchSingleValueToValuePattern() {\n    HttpHeader header = new HttpHeader(\"My-Header\", \"my-value\");\n\n    assertThat(header.hasValueMatching(WireMock.equalTo(\"my-value\")), is(true));\n    assertThat(header.hasValueMatching(WireMock.equalTo(\"other-value\")), is(false));\n  }\n\n  @Test\n  public void shouldMatchMultiValueToValuePattern() {\n    HttpHeader header = new HttpHeader(\"My-Header\", \"value1\", \"value2\", \"value3\");\n\n    assertThat(header.hasValueMatching(WireMock.matching(\"value.*\")), is(true));\n    assertThat(header.hasValueMatching(WireMock.equalTo(\"value2\")), is(true));\n    assertThat(header.hasValueMatching(WireMock.equalTo(\"value4\")), is(false));\n  }\n\n  @Test\n  public void shouldEqualWhenIdentical() throws Exception {\n    HttpHeader header1 = new HttpHeader(\"My-Header\", \"value1\");\n    HttpHeader header2 = new HttpHeader(\"My-Header\", \"value1\");\n\n    assertThat(header1.equals(header2), is(true));\n    assertThat(header1.hashCode(), equalTo(header2.hashCode()));\n  }\n\n  @Test\n  public void shouldEqualWhenKeysHaveDifferentCases() throws Exception {\n    HttpHeader header1 = new HttpHeader(\"MY-HEADER\", \"value1\", \"value2\");\n    HttpHeader header2 = new HttpHeader(\"my-header\", \"value1\", \"value2\");\n\n    assertThat(header1.equals(header2), is(true));\n    assertThat(header1.hashCode(), equalTo(header2.hashCode()));\n  }\n\n  @Test\n  public void shouldNotEqualWhenContentsAreDifferent() throws Exception {\n    HttpHeader header1 = new HttpHeader(\"My-Header\", \"value1\");\n    HttpHeader header2 = new HttpHeader(\"My-Header\", \"VALUE1\");\n\n    assertThat(header1.equals(header2), is(false));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/HttpHeadersTest.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders.Builder;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class HttpHeadersTest {\n\n  @Test\n  public void returnsAbsentHttpHeaderWhenHeaderNotPresent() {\n    HttpHeaders httpHeaders = new HttpHeaders();\n    HttpHeader header = httpHeaders.getHeader(\"Test-Header\");\n\n    assertThat(header.isPresent(), is(false));\n  }\n\n  @Test\n  public void returnsHeaderWhenPresent() {\n    HttpHeaders httpHeaders = new HttpHeaders(httpHeader(\"Test-Header\", \"value1\", \"value2\"));\n    HttpHeader header = httpHeaders.getHeader(\"Test-Header\");\n\n    assertThat(header.isPresent(), is(true));\n    assertThat(header.key(), is(\"Test-Header\"));\n    assertThat(header.containsValue(\"value2\"), is(true));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  public void createsCopy() {\n    HttpHeaders httpHeaders =\n        new HttpHeaders(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\"));\n\n    HttpHeaders copyOfHeaders = HttpHeaders.copyOf(httpHeaders);\n\n    assertThat(\n        copyOfHeaders.all(),\n        hasItems(\n            header(\"Header-1\", \"h1v1\"),\n            header(\"Header-1\", \"h1v2\"),\n            header(\"Header-2\", \"h2v1\"),\n            header(\"Header-2\", \"h2v2\")));\n  }\n\n  private static final String SINGLE_VALUE_HEADER =\n      \"{                \t    \t    \t\t        \\n\"\n          + \"\t\\\"Header-1\\\": \\\"only-value\\\"                \\n\"\n          + \"}                                               \";\n\n  @Test\n  public void correctlyDeserializesWithSingleValueHeader() {\n    HttpHeaders headers = Json.read(SINGLE_VALUE_HEADER, HttpHeaders.class);\n    HttpHeader header = headers.getHeader(\"Header-1\");\n\n    assertThat(header.key(), is(\"Header-1\"));\n    assertThat(header.firstValue(), is(\"only-value\"));\n    assertThat(header.values().size(), is(1));\n  }\n\n  @Test\n  public void correctlySerializesSingleValueHeader() {\n    HttpHeaders headers = new HttpHeaders(new HttpHeader(\"Header-1\", \"only-value\"));\n\n    String json = Json.write(headers);\n    assertThat(\"Actual: \" + json, json, equalToJson(SINGLE_VALUE_HEADER));\n  }\n\n  private static final String MULTI_VALUE_HEADER =\n      \"{    \t                         \t    \t\t        \\n\"\n          + \"\t\t    \\\"Header-1\\\": [                             \\n\"\n          + \"\t\t        \\\"value-1\\\",                            \\n\"\n          + \"               \\\"value-2\\\"                             \\n\"\n          + \"           ],                                          \\n\"\n          + \"\t\t    \\\"Header-2\\\": [                             \\n\"\n          + \"\t\t        \\\"value-3\\\",                            \\n\"\n          + \"               \\\"value-4\\\"                             \\n\"\n          + \"           ]                                           \\n\"\n          + \"}                                                        \";\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  public void correctlyDeserializesWithMultiValueHeader() {\n    HttpHeaders headers = Json.read(MULTI_VALUE_HEADER, HttpHeaders.class);\n\n    HttpHeader header = headers.getHeader(\"Header-1\");\n    assertThat(header.key(), is(\"Header-1\"));\n    assertThat(header.values(), hasExactly(equalTo(\"value-1\"), equalTo(\"value-2\")));\n    assertThat(header.values().size(), is(2));\n\n    header = headers.getHeader(\"Header-2\");\n    assertThat(header.key(), is(\"Header-2\"));\n    assertThat(header.values(), hasExactly(equalTo(\"value-3\"), equalTo(\"value-4\")));\n    assertThat(header.values().size(), is(2));\n\n    assertThat(headers.size(), is(2));\n  }\n\n  @Test\n  public void correctlySerializesMultiValueHeader() {\n    HttpHeaders headers =\n        new HttpHeaders(\n            new HttpHeader(\"Header-1\", \"value-1\", \"value-2\"),\n            new HttpHeader(\"Header-2\", \"value-3\", \"value-4\"));\n\n    String json = Json.write(headers);\n    assertThat(\"Actual: \" + json, json, equalToJson(MULTI_VALUE_HEADER));\n  }\n\n  @Test\n  public void keyMatchingIsCaseInsensitive() {\n    HttpHeaders headers = new HttpHeaders(new HttpHeader(\"Header-One\", \"value 1\"));\n\n    assertThat(headers.getHeader(\"header-one\").firstValue(), is(\"value 1\"));\n  }\n\n  @Test\n  public void toStringWhenHeadersPresent() {\n    HttpHeaders httpHeaders = new HttpHeaders(httpHeader(\"Test-Header\", \"value1\", \"value2\"));\n    assertThat(httpHeaders.toString().contains(\"Test-Header\"), is(true));\n  }\n\n  @Test\n  public void toStringWhenHeadersEmpty() {\n    HttpHeaders httpHeaders = new HttpHeaders();\n    assertThat(httpHeaders.toString().equals(\"(no headers)\\n\"), is(true));\n  }\n\n  @Test\n  public void shouldEqualWhenIdentical() throws Exception {\n    HttpHeaders httpHeaders =\n        new HttpHeaders(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\"));\n\n    HttpHeaders copyOfHeaders = HttpHeaders.copyOf(httpHeaders);\n\n    assertThat(httpHeaders.equals(copyOfHeaders), is(true));\n    assertThat(httpHeaders.hashCode(), equalTo(copyOfHeaders.hashCode()));\n  }\n\n  @Test\n  public void builderSetAllReplacesAllExistingHeaders() {\n    HttpHeaders initialHeaders =\n        new HttpHeaders(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\"));\n\n    HttpHeaders newHeaders1 =\n        initialHeaders.transform(builder -> builder.setAll(httpHeader(\"Header-2\", \"h2v3\", \"h2v4\")));\n    assertThat(newHeaders1.all(), contains(httpHeader(\"Header-2\", \"h2v3\", \"h2v4\")));\n\n    HttpHeaders newHeaders2 =\n        initialHeaders.transform(\n            builder -> builder.setAll(List.of(httpHeader(\"Header-2\", \"h2v3\", \"h2v4\"))));\n    assertThat(newHeaders2.all(), contains(httpHeader(\"Header-2\", \"h2v3\", \"h2v4\")));\n  }\n\n  @Test\n  public void builderAddAllAddsToExistingHeaders() {\n    HttpHeaders initialHeaders =\n        new HttpHeaders(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\"));\n\n    HttpHeaders newHeaders1 =\n        initialHeaders.transform(\n            builder ->\n                builder.addAll(\n                    httpHeader(\"Header-2\", \"h2v3\", \"h2v4\"),\n                    httpHeader(\"Header-3\", \"h3v1\", \"h3v2\")));\n    assertThat(\n        newHeaders1.all(),\n        contains(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"),\n            httpHeader(\"Header-2\", \"h2v1\", \"h2v2\", \"h2v3\", \"h2v4\"),\n            httpHeader(\"Header-3\", \"h3v1\", \"h3v2\")));\n\n    HttpHeaders newHeaders2 =\n        initialHeaders.transform(\n            builder ->\n                builder.addAll(\n                    List.of(\n                        httpHeader(\"Header-2\", \"h2v3\", \"h2v4\"),\n                        httpHeader(\"Header-3\", \"h3v1\", \"h3v2\"))));\n    assertThat(\n        newHeaders2.all(),\n        contains(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"),\n            httpHeader(\"Header-2\", \"h2v1\", \"h2v2\", \"h2v3\", \"h2v4\"),\n            httpHeader(\"Header-3\", \"h3v1\", \"h3v2\")));\n  }\n\n  @Test\n  public void builderSetReplacesExistingHeaderValues() {\n    HttpHeaders initialHeaders =\n        new HttpHeaders(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\"));\n\n    HttpHeaders newHeaders1 =\n        initialHeaders.transform(builder -> builder.set(\"Header-2\", \"h2v3\", \"h2v4\"));\n    assertThat(\n        newHeaders1.all(),\n        contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v3\", \"h2v4\")));\n\n    HttpHeaders newHeaders2 =\n        initialHeaders.transform(\n            builder -> builder.set(CaseInsensitiveKey.from(\"Header-2\"), \"h2v3\", \"h2v4\"));\n    assertThat(\n        newHeaders2.all(),\n        contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v3\", \"h2v4\")));\n\n    HttpHeaders newHeaders3 =\n        initialHeaders.transform(builder -> builder.set(\"Header-2\", List.of(\"h2v3\", \"h2v4\")));\n    assertThat(\n        newHeaders3.all(),\n        contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v3\", \"h2v4\")));\n\n    HttpHeaders newHeaders4 =\n        initialHeaders.transform(\n            builder -> builder.set(CaseInsensitiveKey.from(\"Header-2\"), List.of(\"h2v3\", \"h2v4\")));\n    assertThat(\n        newHeaders4.all(),\n        contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v3\", \"h2v4\")));\n  }\n\n  @Test\n  public void builderAddAddsToExistingHeaderValues() {\n    HttpHeaders initialHeaders =\n        new HttpHeaders(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\"));\n\n    HttpHeaders newHeaders1 =\n        initialHeaders.transform(builder -> builder.add(\"Header-2\", \"h2v3\", \"h2v4\"));\n    assertThat(\n        newHeaders1.all(),\n        contains(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"),\n            httpHeader(\"Header-2\", \"h2v1\", \"h2v2\", \"h2v3\", \"h2v4\")));\n\n    HttpHeaders newHeaders2 =\n        initialHeaders.transform(\n            builder -> builder.add(CaseInsensitiveKey.from(\"Header-2\"), \"h2v3\", \"h2v4\"));\n    assertThat(\n        newHeaders2.all(),\n        contains(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"),\n            httpHeader(\"Header-2\", \"h2v1\", \"h2v2\", \"h2v3\", \"h2v4\")));\n\n    HttpHeaders newHeaders3 =\n        initialHeaders.transform(builder -> builder.add(\"Header-2\", List.of(\"h2v3\", \"h2v4\")));\n    assertThat(\n        newHeaders3.all(),\n        contains(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"),\n            httpHeader(\"Header-2\", \"h2v1\", \"h2v2\", \"h2v3\", \"h2v4\")));\n\n    HttpHeaders newHeaders4 =\n        initialHeaders.transform(\n            builder -> builder.add(CaseInsensitiveKey.from(\"Header-2\"), List.of(\"h2v3\", \"h2v4\")));\n    assertThat(\n        newHeaders4.all(),\n        contains(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"),\n            httpHeader(\"Header-2\", \"h2v1\", \"h2v2\", \"h2v3\", \"h2v4\")));\n  }\n\n  @Test\n  public void builderRemoveRemovesExistingHeaderValues() {\n    HttpHeaders initialHeaders =\n        new HttpHeaders(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\"));\n\n    HttpHeaders newHeaders1 = initialHeaders.transform(builder -> builder.remove(\"Header-2\"));\n    assertThat(newHeaders1.all(), contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\")));\n\n    HttpHeaders newHeaders2 =\n        initialHeaders.transform(builder -> builder.remove(CaseInsensitiveKey.from(\"Header-2\")));\n    assertThat(newHeaders2.all(), contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\")));\n  }\n\n  @Test\n  public void builderRemoveAllRemovesAllExistingHeaders() {\n    HttpHeaders initialHeaders =\n        new HttpHeaders(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\"));\n\n    HttpHeaders newHeaders1 = initialHeaders.transform(Builder::removeAll);\n    assertThat(newHeaders1.all(), empty());\n\n    HttpHeaders newHeaders2 = initialHeaders.transform(Builder::removeAll);\n    assertThat(newHeaders2.all(), empty());\n  }\n\n  @Test\n  public void headersCannotBeMutatedByBuilder() {\n    HttpHeaders initialHeaders =\n        new HttpHeaders(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\"));\n    assertThat(\n        initialHeaders.all(),\n        contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\")));\n\n    var builder = new HttpHeaders.Builder(initialHeaders);\n    HttpHeaders newHeaders1 = builder.add(\"Header-2\", \"h2v3\", \"h2v4\").build();\n    assertThat(\n        initialHeaders.all(),\n        contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\")));\n    assertThat(\n        newHeaders1.all(),\n        contains(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"),\n            httpHeader(\"Header-2\", \"h2v1\", \"h2v2\", \"h2v3\", \"h2v4\")));\n\n    HttpHeaders newHeaders2 = builder.remove(\"Header-2\").build();\n    assertThat(\n        initialHeaders.all(),\n        contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"), httpHeader(\"Header-2\", \"h2v1\", \"h2v2\")));\n    assertThat(\n        newHeaders1.all(),\n        contains(\n            httpHeader(\"Header-1\", \"h1v1\", \"h1v2\"),\n            httpHeader(\"Header-2\", \"h2v1\", \"h2v2\", \"h2v3\", \"h2v4\")));\n    assertThat(newHeaders2.all(), contains(httpHeader(\"Header-1\", \"h1v1\", \"h1v2\")));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/HttpServerFactoryLoaderTest.java",
    "content": "/*\n * Copyright (C) 2024-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.common.FatalStartupException;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.Extensions;\nimport com.github.tomakehurst.wiremock.extension.StaticExtensionLoader;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Supplier;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.Test;\n\npublic class HttpServerFactoryLoaderTest {\n\n  Options options = wireMockConfig();\n  Extensions extensions = mock(Extensions.class);\n\n  @SuppressWarnings(\"unchecked\")\n  Supplier<Stream<HttpServerFactory>> serviceLoader = mock(Supplier.class);\n\n  @Test\n  void loadsExtensionWhenOneIsPresentAndOptionsHasNoHttpServerConfigured() {\n\n    serverFactoriesAsExtensions(List.of(new CustomHttpServerFactory()));\n    serverFactoriesFromServiceLoader(List.of(new CustomHttpServerFactory2()));\n\n    HttpServerFactory result = loadHttpServerFactory(options);\n\n    assertThat(result, instanceOf(CustomHttpServerFactory.class));\n  }\n\n  @Test\n  void loadsTheNonStandardExtensionWhenMoreThanOneIsPresent() {\n    options = wireMockConfig().extensionScanningEnabled(false);\n\n    serverFactoriesAsExtensions(\n        List.of(new DefaultHttpServerFactory(), new CustomHttpServerFactory()));\n\n    HttpServerFactory result = loadHttpServerFactory(options);\n\n    assertThat(result, instanceOf(CustomHttpServerFactory.class));\n  }\n\n  @Test\n  void usesTheServiceLoaderWhenNoExtensionsArePresentAndOptionsHasNoHttpServerConfigured() {\n    serverFactoriesFromServiceLoader(List.of(new CustomHttpServerFactory()));\n\n    HttpServerFactory result = loadHttpServerFactory(options);\n\n    assertThat(result, instanceOf(CustomHttpServerFactory.class));\n  }\n\n  @Test\n  void loadsTheNonStandardFactoryViaTheServiceLoaderWhenMoreThanOneIsPresent() {\n    serverFactoriesFromServiceLoader(\n        List.of(new DefaultHttpServerFactory(), new CustomHttpServerFactory()));\n\n    HttpServerFactory result = loadHttpServerFactory(options);\n\n    assertThat(result, instanceOf(CustomHttpServerFactory.class));\n  }\n\n  @Test\n  void usesTheFactoryFromTheOptionsEvenWhenExtensionsAndServicesArePresent() {\n    // expect\n    serverFactoriesFromServiceLoader(List.of(new CustomHttpServerFactory2()));\n    assertThat(loadHttpServerFactory(options), instanceOf(CustomHttpServerFactory2.class));\n\n    serverFactoriesAsExtensions(List.of(new CustomHttpServerFactory()));\n    assertThat(loadHttpServerFactory(options), instanceOf(CustomHttpServerFactory.class));\n\n    // when\n    Options config = wireMockConfig().httpServerFactory(new CustomHttpServerFactory());\n    HttpServerFactory result = loadHttpServerFactory(config);\n\n    // then\n    assertThat(result, instanceOf(CustomHttpServerFactory.class));\n  }\n\n  @Test\n  void throwsDescriptiveExceptionWhenNoSuitableServerFactoryIsFound() {\n    serverFactoriesAsExtensions(Collections.emptyList());\n    serverFactoriesFromServiceLoader(Collections.emptyList());\n\n    var exception = assertThrows(FatalStartupException.class, () -> loadHttpServerFactory(options));\n    assertThat(\n        exception.getMessage(),\n        equalTo(\n            \"No suitable HttpServerFactory was found. Please ensure that the classpath includes a WireMock extension that provides an HttpServerFactory implementation. See https://wiremock.org/docs/extending-wiremock/ for more information.\"));\n  }\n\n  private HttpServerFactory loadHttpServerFactory(Options options) {\n    return new StaticExtensionLoader<>(HttpServerFactory.class)\n        .setSpecificInstance(options.httpServerFactory())\n        .setExtensions(extensions)\n        .setServiceLoader(serviceLoader)\n        .load();\n  }\n\n  private void serverFactoriesAsExtensions(List<HttpServerFactory> extensionList) {\n    final Map<String, HttpServerFactory> extensionMap =\n        extensionList.stream()\n            .collect(Collectors.toMap(HttpServerFactory::getName, factory -> factory));\n    when(extensions.ofType(HttpServerFactory.class)).thenReturn(extensionMap);\n  }\n\n  private void serverFactoriesFromServiceLoader(List<HttpServerFactory> factories) {\n    when(serviceLoader.get()).thenReturn(factories.stream());\n  }\n\n  public static class CustomHttpServerFactory implements HttpServerFactory {\n\n    @Override\n    public HttpServer buildHttpServer(\n        Options options,\n        AdminRequestHandler adminRequestHandler,\n        StubRequestHandler stubRequestHandler,\n        MessageStubRequestHandler messageStubRequestHandler) {\n      return null;\n    }\n  }\n\n  public static class CustomHttpServerFactory2 implements HttpServerFactory {\n    @Override\n    public HttpServer buildHttpServer(\n        Options options,\n        AdminRequestHandler adminRequestHandler,\n        StubRequestHandler stubRequestHandler,\n        MessageStubRequestHandler messageStubRequestHandler) {\n      return null;\n    }\n  }\n\n  public static class DefaultHttpServerFactory implements HttpServerFactory, DefaultFactory {\n    @Override\n    public HttpServer buildHttpServer(\n        Options options,\n        AdminRequestHandler adminRequestHandler,\n        StubRequestHandler stubRequestHandler,\n        MessageStubRequestHandler messageStubRequestHandler) {\n      return null;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/ImmutableRequestTest.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport org.junit.jupiter.api.Test;\n\npublic class ImmutableRequestTest {\n\n  @Test\n  public void builderThrowsOnMissingAbsoluteUrl() {\n    ImmutableRequest.Builder builder = ImmutableRequest.create().withMethod(RequestMethod.ANY);\n\n    assertThrows(NullPointerException.class, builder::build);\n  }\n\n  @Test\n  public void builderThrowsOnMissingMethod() {\n    ImmutableRequest.Builder builder =\n        ImmutableRequest.create().withAbsoluteUrl(\"https://example.com\");\n\n    assertThrows(NullPointerException.class, builder::build);\n  }\n\n  @Test\n  public void builderCreatesMinimalRequest() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .build();\n\n    assertThat(request, notNullValue());\n  }\n\n  @Test\n  public void returnsNoCookiesByDefault() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .build();\n    assertThat(request.getCookies(), notNullValue());\n    assertThat(request.getCookies(), anEmptyMap());\n  }\n\n  @Test\n  public void returnsGivenMethod() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .build();\n    assertThat(request.getMethod(), is(RequestMethod.ANY));\n  }\n\n  @Test\n  public void returnsGivenUrlPieces() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .build();\n    assertThat(request.getAbsoluteUrl(), is(\"https://example.com/\"));\n    assertThat(request.getScheme(), is(\"https\"));\n    assertThat(request.getHost(), is(\"example.com\"));\n    assertThat(request.getPort(), is(-1));\n    assertThat(request.getUrl(), is(\"/\"));\n    assertThat(request.getPathParameters(), is(PathParams.empty()));\n  }\n\n  @Test\n  public void returnsNoProtocolByDefault() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .build();\n    assertThat(request.getProtocol(), nullValue());\n  }\n\n  @Test\n  public void returnsGivenProtocol() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .withProtocol(\"my-protocol\")\n            .build();\n    assertThat(request.getProtocol(), is(\"my-protocol\"));\n  }\n\n  @Test\n  public void returnsNoBrowserProxyRequestByDefault() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .build();\n    assertThat(request.isBrowserProxyRequest(), is(false));\n  }\n\n  @Test\n  public void returnsGivenBrowserProxyRequest() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .withBrowserProxyRequest(true)\n            .build();\n    assertThat(request.isBrowserProxyRequest(), is(true));\n  }\n\n  @Test\n  public void returnsNoMultipartByDefault() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .build();\n    assertThat(request.isMultipart(), is(false));\n  }\n\n  @Test\n  public void returnsGivenMultipart() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .withMultipart(true)\n            .build();\n    assertThat(request.isMultipart(), is(true));\n  }\n\n  @Test\n  public void returnsNoClientIpByDefault() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .build();\n    assertThat(request.getClientIp(), nullValue());\n  }\n\n  @Test\n  public void returnsGivenClientIp() {\n    ImmutableRequest request =\n        ImmutableRequest.create()\n            .withMethod(RequestMethod.ANY)\n            .withAbsoluteUrl(\"https://example.com/\")\n            .withClientIp(\"client-ip\")\n            .build();\n    assertThat(request.getClientIp(), is(\"client-ip\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/LogNormalTest.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\npublic class LogNormalTest {\n\n  private final double median = 90.0;\n  private final double sigma = 0.39;\n\n  @Test\n  public void samplingLogNormalHasExpectedMean() {\n    LogNormal distribution = new LogNormal(median, sigma);\n    samplingLogNormalHasExpectedMean(distribution, 97.1115);\n  }\n\n  @Test\n  public void samplingTruncatedLogNormalWithHighCapHasExpectedMean() {\n    samplingTruncatedLogNormalHasExpectedMean(150, 88.15);\n  }\n\n  @Test\n  public void samplingTruncatedLogNormalWithLowerCapHasExpectedMean() {\n    samplingTruncatedLogNormalHasExpectedMean(130, 83.6);\n  }\n\n  @Test\n  public void samplingTruncatedLogNormalWithCapSameAsMaxHasExpectedMean() {\n    // This test should, on occasion, exercise the resampling of the distribution value when the\n    // initial generated\n    // value(s) are higher than the max.\n    samplingTruncatedLogNormalHasExpectedMean(median, 67.82);\n  }\n\n  @Test\n  public void samplingTruncatedLogNormalFailsIfMaxLessThanMedian() {\n    try {\n      new LogNormal(median, sigma, median);\n    } catch (IllegalArgumentException ex) {\n      // Fail - max = median is okay\n      Assertions.fail(\"A maxValue matching median should not throw an exception\");\n    }\n\n    try {\n      new LogNormal(median, sigma, (median - 1));\n      Assertions.fail(\"A maxValue less than median should throw an exception\");\n    } catch (IllegalArgumentException ex) {\n      // Exception expected\n    }\n  }\n\n  private void samplingTruncatedLogNormalHasExpectedMean(double maxCapValue, double expectedMean) {\n    LogNormal distribution = new LogNormal(median, sigma, maxCapValue);\n    samplingLogNormalHasExpectedMean(distribution, expectedMean);\n  }\n\n  // To test properly we would need something like a normality test.\n  // For our purposes, a simple verification is sufficient.\n  private void samplingLogNormalHasExpectedMean(LogNormal distribution, double expectedMean) {\n\n    int n = 10000;\n\n    long sum = 0;\n    for (int i = 0; i < n; i++) {\n      long val = distribution.sampleMillis();\n      sum += val;\n    }\n\n    assertEquals(expectedMean, sum / (double) n, 5.0);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/ProxyResponseRendererTest.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.crypto.X509CertificateVersion.V3;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.stubbing.ServeEventFactory.newPostMatchServeEvent;\nimport static java.net.HttpURLConnection.HTTP_INTERNAL_ERROR;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.core.StringContains.containsString;\nimport static org.hamcrest.core.StringStartsWith.startsWith;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.mockito.ArgumentMatchers.argThat;\nimport static org.mockito.ArgumentMatchers.assertArg;\nimport static org.mockito.Mockito.spy;\n\nimport com.github.tomakehurst.wiremock.common.NetworkAddressRules;\nimport com.github.tomakehurst.wiremock.common.ProxySettings;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport com.github.tomakehurst.wiremock.crypto.CertificateSpecification;\nimport com.github.tomakehurst.wiremock.crypto.InMemoryKeyStore;\nimport com.github.tomakehurst.wiremock.crypto.Secret;\nimport com.github.tomakehurst.wiremock.crypto.X509CertificateSpecification;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheBackedHttpClient;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.store.InMemorySettingsStore;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.io.File;\nimport java.io.IOException;\nimport java.lang.reflect.Field;\nimport java.nio.charset.StandardCharsets;\nimport java.security.KeyPair;\nimport java.security.KeyPairGenerator;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport org.apache.hc.client5.http.config.RequestConfig;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.core5.http.NameValuePair;\nimport org.apache.hc.core5.http.io.HttpClientResponseHandler;\nimport org.assertj.core.api.Assertions;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledForJreRange;\nimport org.junit.jupiter.api.condition.JRE;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.mockito.ArgumentMatchers;\nimport org.mockito.Mockito;\n\n@DisabledForJreRange(\n    min = JRE.JAVA_17,\n    disabledReason = \"does not support generating certificates at runtime\")\npublic class ProxyResponseRendererTest {\n\n  private static final int PROXY_TIMEOUT = 200_000;\n\n  CloseableHttpClient reverseProxyApacheClient;\n  CloseableHttpClient forwardProxyApacheClient;\n\n  @RegisterExtension\n  public WireMockExtension origin =\n      WireMockExtension.newInstance()\n          .options(\n              options()\n                  .httpDisabled(true)\n                  .dynamicHttpsPort()\n                  .keystorePath(generateKeystore().getAbsolutePath()))\n          .build();\n\n  private final ProxyResponseRenderer proxyResponseRenderer = buildProxyResponseRenderer(false);\n\n  @Test\n  public void acceptsAnyCertificateForStandardProxying() {\n\n    origin.stubFor(get(\"/proxied\").willReturn(aResponse().withBody(\"Result\")));\n\n    ServeEvent serveEvent = reverseProxyServeEvent(\"/proxied\");\n\n    Response response = proxyResponseRenderer.render(serveEvent);\n\n    assertEquals(response.getBodyAsString(), \"Result\");\n  }\n\n  @Test\n  public void rejectsSelfSignedCertificateForForwardProxyingByDefault() {\n\n    origin.stubFor(get(\"/proxied\").willReturn(aResponse().withBody(\"Result\")));\n\n    final ServeEvent serveEvent = forwardProxyServeEvent(\"/proxied\");\n\n    Response response = proxyResponseRenderer.render(serveEvent);\n\n    assertEquals(HTTP_INTERNAL_ERROR, response.getStatus());\n    assertThat(\n        response.getBodyAsString(),\n        startsWith(\n            \"SSL failure trying to make a proxied request from WireMock to \"\n                + origin.url(\"/proxied\")));\n    assertThat(\n        response.getBodyAsString(),\n        containsString(\"unable to find valid certification path to requested target\"));\n  }\n\n  @Test\n  public void acceptsSelfSignedCertificateForForwardProxyingIfTrustAllProxyTargets() {\n    ProxyResponseRenderer trustAllProxyResponseRenderer = buildProxyResponseRenderer(true);\n\n    origin.stubFor(get(\"/proxied\").willReturn(aResponse().withBody(\"Result\")));\n\n    ServeEvent serveEvent = forwardProxyServeEvent(\"/proxied\");\n    Response response = trustAllProxyResponseRenderer.render(serveEvent);\n\n    assertEquals(response.getBodyAsString(), \"Result\");\n  }\n\n  @Test\n  void passesThroughCorsResponseHeadersWhenStubCorsDisabled() {\n    ProxyResponseRenderer responseRenderer = buildProxyResponseRenderer(true, false, null);\n\n    origin.stubFor(\n        get(\"/proxied\")\n            .willReturn(ok(\"Result\").withHeader(\"Access-Control-Allow-Headers\", \"X-Blah\")));\n\n    ServeEvent serveEvent = forwardProxyServeEvent(\"/proxied\");\n    Response response = responseRenderer.render(serveEvent);\n\n    HttpHeader corsHeader = response.getHeaders().getHeader(\"Access-Control-Allow-Headers\");\n    assertThat(\n        \"CORS response header sent from the origin is not present in the response\",\n        corsHeader.isPresent(),\n        is(true));\n    assertThat(corsHeader.firstValue(), is(\"X-Blah\"));\n  }\n\n  @Test\n  void doesNotPassThroughCorsResponseHeadersWhenStubCorsEnabled() {\n    ProxyResponseRenderer responseRenderer = buildProxyResponseRenderer(true, true, null);\n\n    origin.stubFor(\n        get(\"/proxied\")\n            .willReturn(ok(\"Result\").withHeader(\"Access-Control-Allow-Headers\", \"X-Blah\")));\n\n    ServeEvent serveEvent = forwardProxyServeEvent(\"/proxied\");\n    Response response = responseRenderer.render(serveEvent);\n\n    HttpHeader corsHeader = response.getHeaders().getHeader(\"Access-Control-Allow-Headers\");\n    assertThat(\n        \"CORS response header sent from the origin is present in the response\",\n        corsHeader.isPresent(),\n        is(false));\n  }\n\n  @Test\n  void doesNotAddEntityIfEmptyBodyReverseProxy() throws IOException {\n    ServeEvent serveEvent = reverseProxyServeEvent(\"/proxied\");\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            argThat(request -> request.getEntity() == null),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void doesNotAddEntityIfEmptyBodyForwardProxy() throws IOException {\n    ServeEvent serveEvent = forwardProxyServeEvent(\"/proxied\");\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(forwardProxyApacheClient)\n        .execute(\n            argThat(request -> request.getEntity() == null),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void addsEntityIfNotEmptyBodyReverseProxy() throws IOException {\n    ServeEvent serveEvent =\n        serveEvent(\"/proxied\", false, \"Text body\".getBytes(StandardCharsets.UTF_8));\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            argThat(request -> request.getEntity() != null),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void addsEntityIfNotEmptyBodyForwardProxy() throws IOException {\n    ServeEvent serveEvent =\n        serveEvent(\"/proxied\", true, \"Text body\".getBytes(StandardCharsets.UTF_8));\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(forwardProxyApacheClient)\n        .execute(\n            argThat(request -> request.getEntity() != null),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void addsEmptyEntityIfEmptyBodyForwardProxyPOST() throws IOException {\n    ProxyResponseRenderer trustAllProxyResponseRenderer = buildProxyResponseRenderer(true);\n    origin.stubFor(post(\"/proxied/empty-post\").willReturn(aResponse().withBody(\"Result\")));\n\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/proxied/empty-post\",\n            true,\n            new byte[0],\n            RequestMethod.POST,\n            new HttpHeaders(new HttpHeader(\"Content-Length\", \"0\")));\n\n    trustAllProxyResponseRenderer.render(serveEvent);\n    Mockito.verify(forwardProxyApacheClient)\n        .execute(\n            argThat(request -> request.getEntity() != null),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n    List<LoggedRequest> requests =\n        origin.findAll(postRequestedFor(urlPathMatching(\"/proxied/empty-post\")));\n    Assertions.assertThat(requests)\n        .hasSizeGreaterThan(0)\n        .allMatch(r -> \"0\".equals(r.getHeader(\"Content-Length\")))\n        .noneMatch(r -> r.containsHeader(\"Content-Type\"));\n  }\n\n  @Test\n  void addsEmptyEntityIfEmptyBodyForwardProxyGET() throws IOException {\n    ProxyResponseRenderer trustAllProxyResponseRenderer = buildProxyResponseRenderer(true);\n    origin.stubFor(get(\"/proxied/empty-get\").willReturn(aResponse().withBody(\"Result\")));\n\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/proxied/empty-get\",\n            true,\n            new byte[0],\n            GET,\n            new HttpHeaders(new HttpHeader(\"Content-Length\", \"0\")));\n\n    trustAllProxyResponseRenderer.render(serveEvent);\n    Mockito.verify(forwardProxyApacheClient)\n        .execute(\n            argThat(request -> request.getEntity() != null),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n    List<LoggedRequest> requests =\n        origin.findAll(getRequestedFor(urlPathMatching(\"/proxied/empty-get\")));\n    Assertions.assertThat(requests)\n        .hasSizeGreaterThan(0)\n        .allMatch(r -> \"0\".equals(r.getHeader(\"Content-Length\")))\n        .noneMatch(r -> r.containsHeader(\"Content-Type\"));\n  }\n\n  @Test\n  void usesCorrectProxyRequestTimeout() {\n    RequestConfig forwardProxyClientRequestConfig =\n        reflectiveSpyField(RequestConfig.class, \"defaultConfig\", forwardProxyApacheClient);\n    RequestConfig reverseProxyClientRequestConfig =\n        reflectiveSpyField(RequestConfig.class, \"defaultConfig\", reverseProxyApacheClient);\n\n    assertThat(\n        forwardProxyClientRequestConfig.getResponseTimeout().toMilliseconds(),\n        is((long) PROXY_TIMEOUT));\n    assertThat(\n        reverseProxyClientRequestConfig.getResponseTimeout().toMilliseconds(),\n        is((long) PROXY_TIMEOUT));\n  }\n\n  @Test\n  void additionalProxyRequestHeaders() throws IOException {\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/proxied\",\n            false,\n            null,\n            RequestMethod.GET,\n            new HttpHeaders(),\n            aResponse()\n                .proxiedFrom(origin.baseUrl())\n                .withAdditionalRequestHeader(\"header\", \"value\")\n                .build());\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            argThat(request -> request.getFirstHeader(\"header\").getValue().equals(\"value\")),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void removeProxyRequestHeaders() throws IOException {\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/proxied\",\n            false,\n            null,\n            RequestMethod.GET,\n            new HttpHeaders(new HttpHeader(\"header\", \"value\")),\n            aResponse().proxiedFrom(origin.baseUrl()).withRemoveRequestHeader(\"Header\").build());\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            argThat(request -> request.getHeaders().length == 0),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void maintainsAcceptEncodingIfNoSupportedEncodingsSpecified() throws IOException {\n\n    Set<String> supportedProxyEncodings = null;\n    ProxyResponseRenderer proxyResponseRenderer =\n        buildProxyResponseRenderer(false, false, supportedProxyEncodings);\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/proxied\",\n            false,\n            new byte[0],\n            GET,\n            new HttpHeaders(HttpHeader.httpHeader(\"Accept-Encoding\", \"gzip,br\")));\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            assertArg(\n                request ->\n                    assertThat(\n                        Arrays.stream(request.getHeaders(\"Accept-Encoding\"))\n                            .map(NameValuePair::getValue)\n                            .collect(Collectors.toList()),\n                        is(List.of(\"gzip,br\")))),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void limitsAcceptEncodingToSupportedEncodings() throws IOException {\n\n    Set<String> supportedProxyEncodings = Set.of(\"gzip\", \"br\");\n    ProxyResponseRenderer proxyResponseRenderer =\n        buildProxyResponseRenderer(false, false, supportedProxyEncodings);\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/proxied\",\n            false,\n            new byte[0],\n            GET,\n            new HttpHeaders(HttpHeader.httpHeader(\"Accept-Encoding\", \"gzip,deflate,br\")));\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            assertArg(\n                request ->\n                    assertThat(\n                        Arrays.stream(request.getHeaders(\"Accept-Encoding\"))\n                            .map(NameValuePair::getValue)\n                            .collect(Collectors.toList()),\n                        is(List.of(\"gzip,br\")))),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void removesAcceptEncodingIfNoneSupported() throws IOException {\n\n    Set<String> supportedProxyEncodings = Set.of(\"gzip\");\n    ProxyResponseRenderer proxyResponseRenderer =\n        buildProxyResponseRenderer(false, false, supportedProxyEncodings);\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/proxied\",\n            false,\n            new byte[0],\n            GET,\n            new HttpHeaders(HttpHeader.httpHeader(\"Accept-Encoding\", \"deflate,br\")));\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            assertArg(request -> assertFalse(request.containsHeader(\"Accept-Encoding\"))),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void removeProxyRequestHeadersCaseInsensitive() throws IOException {\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/proxied\",\n            false,\n            null,\n            RequestMethod.GET,\n            new HttpHeaders(\n                new HttpHeader(\"Header\", \"value1\"),\n                new HttpHeader(\"HEADER\", \"value2\"),\n                new HttpHeader(\"header\", \"value3\")),\n            aResponse().proxiedFrom(origin.baseUrl()).withRemoveRequestHeader(\"header\").build());\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            argThat(\n                request -> {\n                  // All variations of the header should be removed regardless of case\n                  return Arrays.stream(request.getHeaders())\n                      .noneMatch(header -> header.getName().equalsIgnoreCase(\"header\"));\n                }),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  @Test\n  void removeProxyRequestHeadersMixedCase() throws IOException {\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/proxied\",\n            false,\n            null,\n            RequestMethod.GET,\n            new HttpHeaders(\n                new HttpHeader(\"User-Agent\", \"TestAgent\"),\n                new HttpHeader(\"Authorization\", \"Bearer token\"),\n                new HttpHeader(\"content-type\", \"application/json\")),\n            aResponse()\n                .proxiedFrom(origin.baseUrl())\n                .withRemoveRequestHeader(\"User-Agent\")\n                .withRemoveRequestHeader(\"AUTHORIZATION\") // Uppercase\n                .withRemoveRequestHeader(\"Content-Type\") // Mixed case\n                .build());\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            argThat(\n                request -> {\n                  // All specified headers should be removed regardless of their original case\n                  // or the case used in the removal specification\n                  return Arrays.stream(request.getHeaders())\n                      .noneMatch(\n                          header ->\n                              header.getName().equalsIgnoreCase(\"User-Agent\")\n                                  || header.getName().equalsIgnoreCase(\"Authorization\")\n                                  || header.getName().equalsIgnoreCase(\"Content-Type\"));\n                }),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  private static <T> T reflectiveInnerSpyField(\n      Class<T> fieldType, String outerFieldName, String innerFieldName, Object object) {\n    try {\n      Field outerField = object.getClass().getDeclaredField(outerFieldName);\n      outerField.setAccessible(true);\n      Object outerFieldObject = outerField.get(object);\n      Field innerField = outerFieldObject.getClass().getDeclaredField(innerFieldName);\n      innerField.setAccessible(true);\n      T spy = spy(fieldType.cast(innerField.get(outerFieldObject)));\n      innerField.set(outerFieldObject, spy);\n      return spy;\n    } catch (NoSuchFieldException | IllegalAccessException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  @Test\n  void proxyUrlPrefixToRemove() throws IOException {\n    ServeEvent serveEvent =\n        serveEvent(\n            \"/prefix/proxied\",\n            false,\n            null,\n            RequestMethod.GET,\n            new HttpHeaders(new HttpHeader(\"header\", \"value\")),\n            aResponse()\n                .proxiedFrom(origin.baseUrl())\n                .withProxyUrlPrefixToRemove(\"/prefix\")\n                .build());\n\n    proxyResponseRenderer.render(serveEvent);\n    Mockito.verify(reverseProxyApacheClient)\n        .execute(\n            argThat(request -> request.getRequestUri().equals(\"/proxied\")),\n            ArgumentMatchers.any(HttpClientResponseHandler.class));\n  }\n\n  private static <T> T reflectiveSpyField(Class<T> fieldType, String fieldName, Object object) {\n    try {\n      Field field = object.getClass().getDeclaredField(fieldName);\n      field.setAccessible(true);\n      T spy = spy(fieldType.cast(field.get(object)));\n      field.set(object, spy);\n      return spy;\n    } catch (NoSuchFieldException | IllegalAccessException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private ServeEvent reverseProxyServeEvent(String path) {\n    return serveEvent(path, false, new byte[0]);\n  }\n\n  private ServeEvent forwardProxyServeEvent(String path) {\n    return serveEvent(path, true, new byte[0]);\n  }\n\n  private ServeEvent serveEvent(String path, boolean isBrowserProxyRequest, byte[] body) {\n    return serveEvent(path, isBrowserProxyRequest, body, GET, new HttpHeaders());\n  }\n\n  private ServeEvent serveEvent(\n      String path,\n      boolean isBrowserProxyRequest,\n      byte[] body,\n      RequestMethod method,\n      HttpHeaders headers) {\n    return serveEvent(\n        path,\n        isBrowserProxyRequest,\n        body,\n        method,\n        headers,\n        aResponse().proxiedFrom(origin.baseUrl()).build());\n  }\n\n  private ServeEvent serveEvent(\n      String path,\n      boolean isBrowserProxyRequest,\n      byte[] body,\n      RequestMethod method,\n      HttpHeaders headers,\n      ResponseDefinition responseDefinition) {\n\n    LoggedRequest loggedRequest =\n        LoggedRequest.createFrom(\n            mockRequest()\n                .url(path)\n                .absoluteUrl(origin.url(path))\n                .method(method)\n                .headers(headers)\n                .isBrowserProxyRequest(isBrowserProxyRequest)\n                .body(body)\n                .protocol(\"HTTP/1.1\"));\n\n    return newPostMatchServeEvent(loggedRequest, responseDefinition);\n  }\n\n  private File generateKeystore() throws Exception {\n\n    InMemoryKeyStore ks =\n        new InMemoryKeyStore(InMemoryKeyStore.KeyStoreType.JKS, new Secret(\"password\"));\n\n    CertificateSpecification certificateSpecification =\n        new X509CertificateSpecification(\n            /* version= */ V3,\n            /* subject= */ \"CN=localhost\",\n            /* issuer= */ \"CN=wiremock.org\",\n            /* notBefore= */ new Date(),\n            /* notAfter= */ new Date(System.currentTimeMillis() + (365L * 24 * 60 * 60 * 1000)));\n    KeyPair keyPair = generateKeyPair();\n    ks.addPrivateKey(\"wiremock\", keyPair, certificateSpecification.certificateFor(keyPair));\n\n    File keystoreFile = File.createTempFile(\"wiremock-test\", \"keystore\");\n\n    ks.saveAs(keystoreFile);\n\n    return keystoreFile;\n  }\n\n  private KeyPair generateKeyPair() throws NoSuchAlgorithmException {\n    KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n    keyGen.initialize(1024);\n    return keyGen.generateKeyPair();\n  }\n\n  private ProxyResponseRenderer buildProxyResponseRenderer(boolean trustAllProxyTargets) {\n    return buildProxyResponseRenderer(trustAllProxyTargets, false, null);\n  }\n\n  private ProxyResponseRenderer buildProxyResponseRenderer(\n      boolean trustAllProxyTargets, boolean stubCorsEnabled, Set<String> supportedProxyEncodings) {\n\n    reverseProxyApacheClient =\n        spy(\n            ApacheHttpClientFactory.createClient(\n                1000,\n                PROXY_TIMEOUT,\n                ProxySettings.NO_PROXY,\n                KeyStoreSettings.NO_STORE,\n                true,\n                Collections.emptyList(),\n                true,\n                NetworkAddressRules.ALLOW_ALL,\n                true,\n                null));\n    HttpClient reverseProxyClient = new ApacheBackedHttpClient(reverseProxyApacheClient, false);\n\n    forwardProxyApacheClient =\n        spy(\n            ApacheHttpClientFactory.createClient(\n                1000,\n                PROXY_TIMEOUT,\n                ProxySettings.NO_PROXY,\n                KeyStoreSettings.NO_STORE,\n                trustAllProxyTargets,\n                Collections.emptyList(),\n                false,\n                NetworkAddressRules.ALLOW_ALL,\n                true,\n                null));\n    HttpClient forwardProxyClient = new ApacheBackedHttpClient(forwardProxyApacheClient, false);\n\n    return new ProxyResponseRenderer(\n        /* preserveHostHeader= */ false,\n        /* hostHeaderValue= */ null,\n        new InMemorySettingsStore(),\n        stubCorsEnabled,\n        supportedProxyEncodings,\n        reverseProxyClient,\n        forwardProxyClient);\n  }\n\n  // Just exists to make the compiler happy by having the throws clause\n  public ProxyResponseRendererTest() throws Exception {}\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/RequestMethodTest.java",
    "content": "package com.github.tomakehurst.wiremock.http;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.matching.MultiRequestMethodPattern.IsNoneOf;\nimport com.github.tomakehurst.wiremock.matching.MultiRequestMethodPattern.IsOneOf;\nimport org.junit.jupiter.api.Test;\n\nimport java.util.Set;\n\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.*;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class RequestMethodTest {\n\n  @Test\n  void singleMethodSerializesToString() {\n      String json = Json.write(GET);\n\n    assertThat(json, is(\"\\\"GET\\\"\"));\n  }\n\n  @Test\n  void singleMethodDeserializesFromString() {\n    String json = \"\\\"POST\\\"\";\n\n    RequestMethod method = Json.read(json, RequestMethod.class);\n\n    assertThat(method, is(POST));\n  }\n\n  @Test\n  void oneOfSerializesToObject() {\n    RequestMethod method = isOneOf(GET, POST);\n\n    String json = Json.write(method);\n\n    assertThat(json, jsonEquals(//language=JSON\n            \"\"\"\n            {\n              \"oneOf\": [\"GET\", \"POST\"]\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void oneOfDeserializesFromObject() {\n    String json = \"{\\\"oneOf\\\": [\\\"GET\\\", \\\"POST\\\", \\\"PUT\\\"]}\";\n\n    RequestMethod method = Json.read(json, RequestMethod.class);\n\n    assertInstanceOf(IsOneOf.class, method);\n    IsOneOf oneOf = (IsOneOf) method;\n    assertEquals(3, oneOf.getMethods().size());\n    assertTrue(\n        oneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"GET\")),\n        \"Should contain GET\");\n    assertTrue(\n        oneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"POST\")),\n        \"Should contain POST\");\n    assertTrue(\n        oneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"PUT\")),\n        \"Should contain PUT\");\n  }\n\n  @Test\n  void noneOfSerializesToObject() {\n    RequestMethod method = isNoneOf(DELETE, PATCH);\n\n    String json = Json.write(method);\n\n    assertThat(json, jsonEquals(//language=JSON\n            \"\"\"\n            {\n              \"noneOf\": [\"DELETE\", \"PATCH\"]\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void noneOfDeserializesFromObject() {\n    String json = \"{\\\"noneOf\\\": [\\\"DELETE\\\", \\\"PATCH\\\", \\\"OPTIONS\\\"]}\";\n\n    RequestMethod method = Json.read(json, RequestMethod.class);\n\n    assertInstanceOf(IsNoneOf.class, method);\n    IsNoneOf noneOf = (IsNoneOf) method;\n    assertEquals(3, noneOf.getMethods().size());\n    assertTrue(\n        noneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"DELETE\")),\n        \"Should contain DELETE\");\n    assertTrue(\n        noneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"PATCH\")),\n        \"Should contain PATCH\");\n    assertTrue(\n        noneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"OPTIONS\")),\n        \"Should contain OPTIONS\");\n  }\n\n  @Test\n  void singleMethodRoundTripSerialization() {\n    RequestMethod original = RequestMethod.PUT;\n\n    String json = Json.write(original);\n    RequestMethod deserialized = Json.read(json, RequestMethod.class);\n\n    assertThat(deserialized.getName(), is(original.getName()));\n    assertThat(deserialized.value(), is(original.value()));\n  }\n\n  @Test\n  void oneOfRoundTripSerialization() {\n    IsOneOf original = new IsOneOf(Set.of(GET, RequestMethod.HEAD, RequestMethod.OPTIONS));\n\n    String json = Json.write(original);\n    RequestMethod deserialized = Json.read(json, RequestMethod.class);\n\n    assertInstanceOf(IsOneOf.class, deserialized);\n    IsOneOf deserializedOneOf = (IsOneOf) deserialized;\n    assertEquals(original.getMethods().size(), deserializedOneOf.getMethods().size());\n    assertTrue(\n        deserializedOneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"GET\")),\n        \"Should contain GET\");\n    assertTrue(\n        deserializedOneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"HEAD\")),\n        \"Should contain HEAD\");\n    assertTrue(\n        deserializedOneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"OPTIONS\")),\n        \"Should contain OPTIONS\");\n  }\n\n  @Test\n  void noneOfRoundTripSerialization() {\n    IsNoneOf original = new IsNoneOf(Set.of(POST, RequestMethod.PUT, PATCH));\n\n    String json = Json.write(original);\n    RequestMethod deserialized = Json.read(json, RequestMethod.class);\n\n    assertInstanceOf(IsNoneOf.class, deserialized);\n    IsNoneOf deserializedNoneOf = (IsNoneOf) deserialized;\n    assertEquals(original.getMethods().size(), deserializedNoneOf.getMethods().size());\n    assertTrue(\n        deserializedNoneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"POST\")),\n        \"Should contain POST\");\n    assertTrue(\n        deserializedNoneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"PUT\")),\n        \"Should contain PUT\");\n    assertTrue(\n        deserializedNoneOf.getMethods().stream().anyMatch(m -> m.getName().equals(\"PATCH\")),\n        \"Should contain PATCH\");\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/StubResponseRendererTest.java",
    "content": "/*\n * Copyright (C) 2017-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.stubbing.ServeEventFactory.newPostMatchServeEvent;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.extension.ResponseTransformer;\nimport com.github.tomakehurst.wiremock.extension.ResponseTransformerV2;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport com.github.tomakehurst.wiremock.store.InMemorySettingsStore;\nimport com.github.tomakehurst.wiremock.store.SettingsStore;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.Timeout;\nimport org.mockito.Mockito;\n\npublic class StubResponseRendererTest {\n  private static final int TEST_TIMEOUT = 500;\n\n  private BlobStore filesBlobStore;\n  private SettingsStore settingsStore;\n  private List<ResponseTransformer> responseTransformers;\n  private List<ResponseTransformerV2> v2ResponseTransformers;\n  private StubResponseRenderer stubResponseRenderer;\n\n  @BeforeEach\n  public void init() {\n    filesBlobStore = Mockito.mock(BlobStore.class);\n    settingsStore = new InMemorySettingsStore();\n    responseTransformers = new ArrayList<>();\n    v2ResponseTransformers = new ArrayList<>();\n    stubResponseRenderer =\n        new StubResponseRenderer(\n            filesBlobStore, settingsStore, null, responseTransformers, v2ResponseTransformers);\n  }\n\n  @Test\n  @Timeout(TEST_TIMEOUT)\n  public void endpointFixedDelayShouldOverrideGlobalDelay() throws Exception {\n    settingsStore.set(GlobalSettings.builder().fixedDelay(1000).build());\n\n    Response response = stubResponseRenderer.render(createServeEvent(100));\n\n    assertThat(response.getInitialDelay(), is(100L));\n  }\n\n  @Test\n  @Timeout(TEST_TIMEOUT)\n  public void globalFixedDelayShouldNotBeOverriddenIfNoEndpointDelaySpecified() throws Exception {\n    settingsStore.set(GlobalSettings.builder().fixedDelay(1000).build());\n\n    Response response = stubResponseRenderer.render(createServeEvent(null));\n\n    assertThat(response.getInitialDelay(), is(1000L));\n  }\n\n  @Test\n  @Timeout(TEST_TIMEOUT)\n  public void shouldSetGlobalFixedDelayOnResponse() throws Exception {\n    settingsStore.set(GlobalSettings.builder().fixedDelay(1000).build());\n\n    Response response = stubResponseRenderer.render(createServeEvent(null));\n\n    assertThat(response.getInitialDelay(), is(1000L));\n  }\n\n  @Test\n  public void shouldSetEndpointFixedDelayOnResponse() throws Exception {\n    Response response = stubResponseRenderer.render(createServeEvent(2000));\n\n    assertThat(response.getInitialDelay(), is(2000L));\n  }\n\n  @Test\n  @Timeout(TEST_TIMEOUT)\n  public void shouldSetEndpointDistributionDelayOnResponse() throws Exception {\n    settingsStore.set(GlobalSettings.builder().delayDistribution(() -> 123).build());\n\n    Response response = stubResponseRenderer.render(createServeEvent(null));\n\n    assertThat(response.getInitialDelay(), is(123L));\n  }\n\n  @Test\n  @Timeout(TEST_TIMEOUT)\n  public void shouldCombineFixedDelayDistributionDelay() throws Exception {\n    settingsStore.set(GlobalSettings.builder().delayDistribution(() -> 123).build());\n    Response response = stubResponseRenderer.render(createServeEvent(2000));\n    assertThat(response.getInitialDelay(), is(2123L));\n  }\n\n  private ServeEvent createServeEvent(Integer fixedDelayMillis) {\n    return newPostMatchServeEvent(\n        mockRequest(),\n        new ResponseDefinition(\n            0,\n            \"\",\n            \"\",\n            null,\n            \"\",\n            \"\",\n            null,\n            null,\n            null,\n            fixedDelayMillis,\n            null,\n            null,\n            null,\n            null,\n            null,\n            null,\n            null,\n            true));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/UniformDistributionTest.java",
    "content": "/*\n * Copyright (C) 2015-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.core.Is.is;\n\nimport java.util.Arrays;\nimport org.junit.jupiter.api.Test;\n\npublic class UniformDistributionTest {\n\n  @Test\n  public void shouldReturnAllValuesInTheRange() {\n    DelayDistribution distribution = new UniformDistribution(3, 4);\n\n    boolean[] found = new boolean[5];\n    Arrays.fill(found, false);\n\n    for (int i = 0; i < 100; i++) {\n      found[(int) distribution.sampleMillis()] = true;\n    }\n\n    assertThat(\"found 0\", found[0], is(false));\n    assertThat(\"found 1\", found[1], is(false));\n    assertThat(\"found 2\", found[2], is(false));\n    assertThat(\"found 3\", found[3], is(true));\n    assertThat(\"found 4\", found[4], is(true));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/ssl/CertificateGeneratingX509ExtendedKeyManagerChooseEngineServerAliasDefaultsTest.java",
    "content": "/*\n * Copyright (C) 2020-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static java.lang.System.lineSeparator;\nimport static java.util.Arrays.asList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.contains;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertNull;\nimport static org.mockito.BDDMockito.given;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.testsupport.TestNotifier;\nimport java.security.Principal;\nimport java.security.cert.X509Certificate;\nimport java.util.Collections;\nimport javax.net.ssl.*;\nimport javax.security.auth.x500.X500Principal;\nimport org.junit.jupiter.api.Test;\n\npublic class CertificateGeneratingX509ExtendedKeyManagerChooseEngineServerAliasDefaultsTest {\n\n  private final X509ExtendedKeyManager keyManagerMock = mock(X509ExtendedKeyManager.class);\n  private final SSLEngine sslEngineMock = mock(SSLEngine.class);\n  private final SSLEngine nullSslEngine = null;\n  private final SSLSession nonExtendedSslSessionMock = mock(SSLSession.class);\n  private final ExtendedSSLSession extendedSslSessionMock = mock(ExtendedSSLSession.class);\n  private final TestNotifier testNotifier = new TestNotifier();\n\n  private final CertificateGeneratingX509ExtendedKeyManager certificateGeneratingKeyManager =\n      new CertificateGeneratingX509ExtendedKeyManager(\n          keyManagerMock,\n          mock(DynamicKeyStore.class),\n          new ApacheHttpHostNameMatcher(),\n          testNotifier);\n  private final Principal[] nullPrincipals = null;\n\n  {\n    when(keyManagerMock.chooseEngineServerAlias(\"RSA\", nullPrincipals, sslEngineMock))\n        .thenReturn(\"default_alias\");\n    when(sslEngineMock.getHandshakeSession()).thenReturn(extendedSslSessionMock);\n  }\n\n  @Test\n  public void returnsNullIfDefaultAliasReturnsNull() {\n    given(keyManagerMock.chooseEngineServerAlias(\"RSA\", nullPrincipals, sslEngineMock))\n        .willReturn(null);\n\n    String alias =\n        certificateGeneratingKeyManager.chooseEngineServerAlias(\n            \"RSA\", nullPrincipals, sslEngineMock);\n\n    assertNull(alias);\n  }\n\n  @Test\n  public void returnsDefaultIfEngineIsNull() {\n    given(keyManagerMock.chooseEngineServerAlias(\"RSA\", nullPrincipals, nullSslEngine))\n        .willReturn(\"default_alias\");\n\n    String alias =\n        certificateGeneratingKeyManager.chooseEngineServerAlias(\n            \"RSA\", nullPrincipals, nullSslEngine);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  @Test\n  public void returnsDefaultIfHandshakeSessionIsNotSupported() {\n    given(sslEngineMock.getHandshakeSession()).willThrow(new UnsupportedOperationException());\n\n    String alias =\n        certificateGeneratingKeyManager.chooseEngineServerAlias(\n            \"RSA\", nullPrincipals, sslEngineMock);\n\n    assertEquals(\"default_alias\", alias);\n    assertThat(\n        testNotifier.getErrorMessages(),\n        contains(\n            \"Dynamic certificate generation is not supported because your SSL Provider does not support SSLEngine.getHandshakeSession()\"\n                + lineSeparator()\n                + \"All sites will be served using the normal WireMock HTTPS certificate.\"));\n  }\n\n  @Test\n  public void returnsDefaultIfHandshakeSessionIsNotAnAnExtendedSSLSession() {\n    given(sslEngineMock.getHandshakeSession()).willReturn(nonExtendedSslSessionMock);\n\n    String alias =\n        certificateGeneratingKeyManager.chooseEngineServerAlias(\n            \"RSA\", nullPrincipals, sslEngineMock);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  @Test\n  public void returnsDefaultIfGetRequestedServerNamesIsNotSupported() {\n    given(extendedSslSessionMock.getRequestedServerNames())\n        .willThrow(new UnsupportedOperationException());\n\n    String alias =\n        certificateGeneratingKeyManager.chooseEngineServerAlias(\n            \"RSA\", nullPrincipals, sslEngineMock);\n\n    assertEquals(\"default_alias\", alias);\n    assertThat(\n        testNotifier.getErrorMessages(),\n        contains(\n            \"Dynamic certificate generation is not supported because your SSL Provider does not support ExtendedSSLSession.getRequestedServerNames()\"\n                + lineSeparator()\n                + \"All sites will be served using the normal WireMock HTTPS certificate.\"));\n  }\n\n  @Test\n  public void returnsDefaultIfThereAreNoSNIServerNames() {\n    given(extendedSslSessionMock.getRequestedServerNames()).willReturn(Collections.emptyList());\n\n    String alias =\n        certificateGeneratingKeyManager.chooseEngineServerAlias(\n            \"RSA\", nullPrincipals, sslEngineMock);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  @Test\n  public void returnsDefaultIfThereAreNoSNIHostNames() {\n    SNIServerName notAnSIHostName = new SNIServerName(1, new byte[0]) {};\n    given(extendedSslSessionMock.getRequestedServerNames())\n        .willReturn(Collections.singletonList(notAnSIHostName));\n\n    String alias =\n        certificateGeneratingKeyManager.chooseEngineServerAlias(\n            \"RSA\", nullPrincipals, sslEngineMock);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  @Test\n  public void returnsDefaultIfAnSNIHostNameMatchesTheDefaultCertificate() {\n    SNIServerName hostName1 = new SNIHostName(\"example.com\");\n    SNIServerName hostName2 = new SNIHostName(\"wiremock.org\");\n    SNIServerName hostName3 = new SNIHostName(\"example.org\");\n    given(extendedSslSessionMock.getRequestedServerNames())\n        .willReturn(asList(hostName1, hostName2, hostName3));\n\n    X509Certificate matchingCertificate = certificateWithCn(\"CN=wiremock.org\");\n    given(keyManagerMock.getCertificateChain(\"default_alias\"))\n        .willReturn(new X509Certificate[] {matchingCertificate});\n\n    String alias =\n        certificateGeneratingKeyManager.chooseEngineServerAlias(\n            \"RSA\", nullPrincipals, sslEngineMock);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  private X509Certificate certificateWithCn(String cn) {\n    X509Certificate certificate = mock(X509Certificate.class);\n    when(certificate.getSubjectX500Principal()).thenReturn(new X500Principal(cn));\n    return certificate;\n  }\n\n  public CertificateGeneratingX509ExtendedKeyManagerChooseEngineServerAliasDefaultsTest()\n      throws Exception {}\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/ssl/CertificateGeneratingX509ExtendedKeyManagerChooseEngineServerAliasTest.java",
    "content": "/*\n * Copyright (C) 2020-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.KEY_STORE_WITH_CA_PATH;\nimport static java.util.Collections.singletonList;\nimport static org.junit.jupiter.api.Assertions.assertArrayEquals;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertNull;\nimport static org.mockito.BDDMockito.given;\nimport static org.mockito.Mockito.mock;\n\nimport com.github.tomakehurst.wiremock.testsupport.TestNotifier;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.security.*;\nimport java.security.cert.CertificateException;\nimport java.security.cert.X509Certificate;\nimport java.security.interfaces.RSAPrivateCrtKey;\nimport java.security.spec.InvalidKeySpecException;\nimport java.security.spec.RSAPublicKeySpec;\nimport javax.net.ssl.*;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledForJreRange;\nimport org.junit.jupiter.api.condition.JRE;\n\npublic class CertificateGeneratingX509ExtendedKeyManagerChooseEngineServerAliasTest {\n\n  @Test\n  @DisabledForJreRange(\n      min = JRE.JAVA_17,\n      disabledReason = \"does not support generating certificates at runtime\")\n  public void generatesAndReturnsNewAliasForWorkingPrivateKey() throws Exception {\n\n    KeyStore keyStore = readKeyStore(KEY_STORE_WITH_CA_PATH, \"password\");\n    String hostname = \"example.com\";\n\n    // given\n    CertificateGeneratingX509ExtendedKeyManager generatingKeyManager =\n        keyManagerFor(keyStore, \"password\".toCharArray());\n\n    // expect\n    assertNull(generatingKeyManager.getCertificateChain(hostname));\n    assertNull(generatingKeyManager.getPrivateKey(hostname));\n\n    // when\n    SSLEngine sslEngineMock = getSslEngineWithSessionFor(hostname);\n    String keyAlias = generatingKeyManager.chooseEngineServerAlias(\"RSA\", null, sslEngineMock);\n\n    // then\n    assertEquals(hostname, keyAlias);\n\n    // and\n    assertEquals(2, generatingKeyManager.getCertificateChain(keyAlias).length);\n    RSAPrivateCrtKey privateKey = (RSAPrivateCrtKey) generatingKeyManager.getPrivateKey(keyAlias);\n\n    PublicKey myPublicKey = getPublicKey(privateKey);\n    assertEquals(myPublicKey, generatingKeyManager.getCertificateChain(keyAlias)[0].getPublicKey());\n  }\n\n  @Test\n  public void returnsSameGeneratedPrivateKeyOnSubsequentCalls() throws Exception {\n\n    KeyStore keyStore = readKeyStore(KEY_STORE_WITH_CA_PATH, \"password\");\n    String hostname = \"example.com\";\n\n    // given\n    CertificateGeneratingX509ExtendedKeyManager generatingKeyManager =\n        keyManagerFor(keyStore, \"password\".toCharArray());\n\n    // when\n    SSLEngine sslEngineMock = getSslEngineWithSessionFor(hostname);\n    String keyAlias = generatingKeyManager.chooseEngineServerAlias(\"RSA\", null, sslEngineMock);\n\n    // and\n    X509Certificate[] certificateChain = generatingKeyManager.getCertificateChain(keyAlias);\n    PrivateKey privateKey = generatingKeyManager.getPrivateKey(keyAlias);\n\n    // when\n    String sameKeyAlias = generatingKeyManager.chooseEngineServerAlias(\"RSA\", null, sslEngineMock);\n\n    // then\n    assertEquals(keyAlias, sameKeyAlias);\n\n    // and same keys returned\n    assertEquals(privateKey, generatingKeyManager.getPrivateKey(sameKeyAlias));\n    assertArrayEquals(certificateChain, generatingKeyManager.getCertificateChain(sameKeyAlias));\n  }\n\n  private PublicKey getPublicKey(RSAPrivateCrtKey privateKey)\n      throws NoSuchAlgorithmException, InvalidKeySpecException {\n    RSAPublicKeySpec publicKeySpec =\n        new RSAPublicKeySpec(privateKey.getModulus(), privateKey.getPublicExponent());\n\n    KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n    return keyFactory.generatePublic(publicKeySpec);\n  }\n\n  private SSLEngine getSslEngineWithSessionFor(String hostname) {\n    SSLEngine sslEngineMock = mock(SSLEngine.class);\n    ExtendedSSLSession extendedSslSessionMock = mock(ExtendedSSLSession.class);\n    given(sslEngineMock.getHandshakeSession()).willReturn(extendedSslSessionMock);\n    SNIServerName hostName = new SNIHostName(hostname);\n    given(extendedSslSessionMock.getRequestedServerNames()).willReturn(singletonList(hostName));\n    return sslEngineMock;\n  }\n\n  private CertificateGeneratingX509ExtendedKeyManager keyManagerFor(\n      KeyStore keyStore, char[] keyStorePassword)\n      throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException {\n    KeyManagerFactory keyManagerFactory =\n        KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\n    keyManagerFactory.init(keyStore, keyStorePassword);\n    X509ExtendedKeyManager keyManager = findExtendedKeyManager(keyManagerFactory.getKeyManagers());\n    X509KeyStore x509KeyStore = new X509KeyStore(keyStore, keyStorePassword);\n\n    return new CertificateGeneratingX509ExtendedKeyManager(\n        keyManager,\n        new DynamicKeyStore(x509KeyStore),\n        new ApacheHttpHostNameMatcher(),\n        new TestNotifier());\n  }\n\n  private X509ExtendedKeyManager findExtendedKeyManager(KeyManager[] keyManagers) {\n    for (KeyManager manager : keyManagers) {\n      if (manager instanceof X509ExtendedKeyManager) {\n        return (X509ExtendedKeyManager) manager;\n      }\n    }\n    throw new AssertionError(\n        \"Can't run this test of the SSL provider does not create X509ExtendedKeyManager instances\");\n  }\n\n  private static KeyStore readKeyStore(String path, String password)\n      throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {\n    KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());\n    FileInputStream instream = new FileInputStream(path);\n    try {\n      trustStore.load(instream, password.toCharArray());\n    } finally {\n      instream.close();\n    }\n    return trustStore;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/ssl/CertificateGeneratingX509ExtendedKeyManagerChooseServerAliasDefaultsTest.java",
    "content": "/*\n * Copyright (C) 2020-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static java.lang.System.lineSeparator;\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.singletonList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.contains;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertNull;\nimport static org.mockito.BDDMockito.given;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.testsupport.TestNotifier;\nimport java.net.Socket;\nimport java.security.Principal;\nimport java.security.cert.X509Certificate;\nimport java.util.Collections;\nimport javax.net.ssl.*;\nimport javax.security.auth.x500.X500Principal;\nimport org.junit.jupiter.api.Test;\n\npublic class CertificateGeneratingX509ExtendedKeyManagerChooseServerAliasDefaultsTest {\n\n  private final X509ExtendedKeyManager keyManagerMock = mock(X509ExtendedKeyManager.class);\n  private final Socket nonSslSocketMock = mock(Socket.class);\n  private final Socket nullSocket = null;\n  private final SSLSocket sslSocketMock = mock(SSLSocket.class);\n  private final SSLSession nonExtendedSslSessionMock = mock(SSLSession.class);\n  private final ExtendedSSLSession extendedSslSessionMock = mock(ExtendedSSLSession.class);\n  private final TestNotifier testNotifier = new TestNotifier();\n\n  private final CertificateGeneratingX509ExtendedKeyManager certificateGeneratingKeyManager =\n      new CertificateGeneratingX509ExtendedKeyManager(\n          keyManagerMock,\n          mock(DynamicKeyStore.class),\n          new ApacheHttpHostNameMatcher(),\n          testNotifier);\n  private final Principal[] nullPrincipals = null;\n\n  {\n    when(keyManagerMock.chooseServerAlias(\"RSA\", nullPrincipals, sslSocketMock))\n        .thenReturn(\"default_alias\");\n    when(sslSocketMock.getHandshakeSession()).thenReturn(extendedSslSessionMock);\n  }\n\n  @Test\n  public void returnsNullIfDefaultAliasReturnsNull() {\n    given(keyManagerMock.chooseServerAlias(\"RSA\", nullPrincipals, nonSslSocketMock))\n        .willReturn(null);\n\n    String alias =\n        certificateGeneratingKeyManager.chooseServerAlias(\"RSA\", nullPrincipals, nonSslSocketMock);\n\n    assertNull(alias);\n  }\n\n  @Test\n  public void returnsDefaultIfSocketIsNull() {\n    given(keyManagerMock.chooseServerAlias(\"RSA\", nullPrincipals, nullSocket))\n        .willReturn(\"default_alias\");\n\n    String alias =\n        certificateGeneratingKeyManager.chooseServerAlias(\"RSA\", nullPrincipals, nullSocket);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  @Test\n  public void returnsDefaultIfSocketIsNotAnAnSSLSocket() {\n    given(keyManagerMock.chooseServerAlias(\"RSA\", nullPrincipals, nonSslSocketMock))\n        .willReturn(\"default_alias\");\n\n    String alias =\n        certificateGeneratingKeyManager.chooseServerAlias(\"RSA\", nullPrincipals, nonSslSocketMock);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  @Test\n  public void returnsDefaultIfHandshakeSessionIsNotSupported() {\n    given(sslSocketMock.getHandshakeSession()).willThrow(new UnsupportedOperationException());\n\n    String alias =\n        certificateGeneratingKeyManager.chooseServerAlias(\"RSA\", nullPrincipals, sslSocketMock);\n\n    assertEquals(\"default_alias\", alias);\n    assertThat(\n        testNotifier.getErrorMessages(),\n        contains(\n            \"Dynamic certificate generation is not supported because your SSL Provider does not support SSLSocket.getHandshakeSession()\"\n                + lineSeparator()\n                + \"All sites will be served using the normal WireMock HTTPS certificate.\"));\n  }\n\n  @Test\n  public void returnsDefaultIfHandshakeSessionIsNotAnAnExtendedSSLSession() {\n    given(sslSocketMock.getHandshakeSession()).willReturn(nonExtendedSslSessionMock);\n\n    String alias =\n        certificateGeneratingKeyManager.chooseServerAlias(\"RSA\", nullPrincipals, sslSocketMock);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  @Test\n  public void returnsDefaultIfGetRequestedServerNamesIsNotSupported() {\n    given(extendedSslSessionMock.getRequestedServerNames())\n        .willThrow(new UnsupportedOperationException());\n\n    String alias =\n        certificateGeneratingKeyManager.chooseServerAlias(\"RSA\", nullPrincipals, sslSocketMock);\n\n    assertEquals(\"default_alias\", alias);\n    assertThat(\n        testNotifier.getErrorMessages(),\n        contains(\n            \"Dynamic certificate generation is not supported because your SSL Provider does not support ExtendedSSLSession.getRequestedServerNames()\"\n                + lineSeparator()\n                + \"All sites will be served using the normal WireMock HTTPS certificate.\"));\n  }\n\n  @Test\n  public void returnsDefaultIfThereAreNoSNIServerNames() {\n    given(extendedSslSessionMock.getRequestedServerNames()).willReturn(Collections.emptyList());\n\n    String alias =\n        certificateGeneratingKeyManager.chooseServerAlias(\"RSA\", nullPrincipals, sslSocketMock);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  @Test\n  public void returnsDefaultIfThereAreNoSNIHostNames() {\n    SNIServerName notAnSIHostName = new SNIServerName(1, new byte[0]) {};\n    given(extendedSslSessionMock.getRequestedServerNames())\n        .willReturn(singletonList(notAnSIHostName));\n\n    String alias =\n        certificateGeneratingKeyManager.chooseServerAlias(\"RSA\", nullPrincipals, sslSocketMock);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  @Test\n  public void returnsDefaultIfAnSNIHostNameMatchesTheDefaultCertificate() {\n    SNIServerName hostName1 = new SNIHostName(\"example.com\");\n    SNIServerName hostName2 = new SNIHostName(\"wiremock.org\");\n    SNIServerName hostName3 = new SNIHostName(\"example.org\");\n    given(extendedSslSessionMock.getRequestedServerNames())\n        .willReturn(asList(hostName1, hostName2, hostName3));\n\n    X509Certificate matchingCertificate = certificateWithCn(\"CN=wiremock.org\");\n    given(keyManagerMock.getCertificateChain(\"default_alias\"))\n        .willReturn(new X509Certificate[] {matchingCertificate});\n\n    String alias =\n        certificateGeneratingKeyManager.chooseServerAlias(\"RSA\", nullPrincipals, sslSocketMock);\n\n    assertEquals(\"default_alias\", alias);\n  }\n\n  private X509Certificate certificateWithCn(String cn) {\n    X509Certificate certificate = mock(X509Certificate.class);\n    when(certificate.getSubjectX500Principal()).thenReturn(new X500Principal(cn));\n    return certificate;\n  }\n\n  public CertificateGeneratingX509ExtendedKeyManagerChooseServerAliasDefaultsTest()\n      throws Exception {}\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/ssl/CompositeTrustManagerTest.java",
    "content": "/*\n * Copyright (C) 2020-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.singletonList;\nimport static org.junit.jupiter.api.Assertions.*;\nimport static org.mockito.BDDMockito.given;\nimport static org.mockito.BDDMockito.willThrow;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport java.security.cert.CertificateException;\nimport java.security.cert.X509Certificate;\nimport javax.net.ssl.X509ExtendedTrustManager;\nimport org.junit.jupiter.api.Test;\n\npublic class CompositeTrustManagerTest {\n\n  private final X509ExtendedTrustManager trustManager1 = mockX509ExtendedTrustManager();\n  private final X509ExtendedTrustManager trustManager2 = mockX509ExtendedTrustManager();\n  private final X509Certificate[] chain = new X509Certificate[0];\n  private final String authType = \"AN_AUTH_TYPE\";\n\n  @Test\n  public void checkServerTrustedPassesForSingleTrustManager() throws CertificateException {\n\n    CompositeTrustManager compositeTrustManager =\n        new CompositeTrustManager(singletonList(trustManager1));\n\n    compositeTrustManager.checkServerTrusted(chain, authType);\n  }\n\n  @Test\n  public void checkServerTrustedFailsForSingleTrustManager() throws CertificateException {\n\n    final CertificateException invalidCertForTrustManager1 =\n        new CertificateException(\"Invalid cert for trustManager1\");\n\n    willThrow(invalidCertForTrustManager1).given(trustManager1).checkServerTrusted(chain, authType);\n\n    final CompositeTrustManager compositeTrustManager =\n        new CompositeTrustManager(singletonList(trustManager1));\n\n    CertificateException thrown =\n        assertThrows(\n            CertificateException.class,\n            () -> compositeTrustManager.checkServerTrusted(chain, authType));\n    assertEquals(invalidCertForTrustManager1, thrown);\n  }\n\n  @Test\n  public void checkServerTrustedIfBothWouldPass() throws CertificateException {\n\n    CompositeTrustManager compositeTrustManager =\n        new CompositeTrustManager(asList(trustManager1, trustManager2));\n\n    compositeTrustManager.checkServerTrusted(chain, authType);\n  }\n\n  @Test\n  public void checkServerTrustedIfFirstWouldPass() throws CertificateException {\n\n    willThrow(new CertificateException(\"Invalid cert for trustManager2\"))\n        .given(trustManager2)\n        .checkServerTrusted(chain, authType);\n\n    CompositeTrustManager compositeTrustManager =\n        new CompositeTrustManager(asList(trustManager1, trustManager2));\n\n    compositeTrustManager.checkServerTrusted(chain, authType);\n  }\n\n  @Test\n  public void checkServerTrustedIfSecondWouldPass() throws CertificateException {\n\n    willThrow(new CertificateException(\"Invalid cert for trustManager1\"))\n        .given(trustManager1)\n        .checkServerTrusted(chain, authType);\n\n    CompositeTrustManager compositeTrustManager =\n        new CompositeTrustManager(asList(trustManager1, trustManager2));\n\n    compositeTrustManager.checkServerTrusted(chain, authType);\n  }\n\n  @Test\n  public void checkServerNotTrustedIfNeitherPass() throws CertificateException {\n\n    final CertificateException invalidCertForTrustManager2 =\n        new CertificateException(\"Invalid cert for trustManager2\");\n\n    willThrow(new CertificateException(\"Invalid cert for trustManager1\"))\n        .given(trustManager1)\n        .checkServerTrusted(chain, authType);\n    willThrow(invalidCertForTrustManager2).given(trustManager2).checkServerTrusted(chain, authType);\n\n    final CompositeTrustManager compositeTrustManager =\n        new CompositeTrustManager(asList(trustManager1, trustManager2));\n\n    CertificateException thrown =\n        assertThrows(\n            CertificateException.class,\n            () -> compositeTrustManager.checkServerTrusted(chain, authType));\n\n    assertEquals(invalidCertForTrustManager2, thrown);\n  }\n\n  @Test\n  public void returnAllAcceptedIssuers() {\n\n    final X509Certificate cert1 = mock(X509Certificate.class, \"cert1\");\n    final X509Certificate cert2 = mock(X509Certificate.class, \"cert2\");\n    final X509Certificate cert3 = mock(X509Certificate.class, \"cert3\");\n    final X509Certificate cert4 = mock(X509Certificate.class, \"cert4\");\n\n    given(trustManager1.getAcceptedIssuers()).willReturn(new X509Certificate[] {cert1, cert2});\n    given(trustManager2.getAcceptedIssuers()).willReturn(new X509Certificate[] {cert3, cert4});\n\n    final CompositeTrustManager compositeTrustManager =\n        new CompositeTrustManager(asList(trustManager1, trustManager2));\n\n    X509Certificate[] acceptedIssuers = compositeTrustManager.getAcceptedIssuers();\n\n    assertArrayEquals(new X509Certificate[] {cert1, cert2, cert3, cert4}, acceptedIssuers);\n\n    acceptedIssuers[2] = mock(X509Certificate.class, \"cert5\");\n\n    assertArrayEquals(\n        new X509Certificate[] {cert1, cert2, cert3, cert4},\n        compositeTrustManager.getAcceptedIssuers());\n  }\n\n  private X509ExtendedTrustManager mockX509ExtendedTrustManager() {\n    final X509ExtendedTrustManager trustManager = mock(X509ExtendedTrustManager.class);\n    when(trustManager.getAcceptedIssuers()).thenReturn(new X509Certificate[0]);\n    return trustManager;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/trafficlistener/ConsoleNotifyingWiremockNetworkTrafficListenerTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.trafficlistener;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.PrintStream;\nimport java.net.Socket;\nimport java.nio.ByteBuffer;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport org.junit.jupiter.api.Test;\n\npublic class ConsoleNotifyingWiremockNetworkTrafficListenerTest {\n\n  @Test\n  public void defaultConstructor_notifiesToSystemOutAndUsesUTF8Charset() {\n    PrintStream originalOut = System.out;\n    ByteArrayOutputStream out = new ByteArrayOutputStream();\n    System.setOut(new PrintStream(out));\n\n    ConsoleNotifyingWiremockNetworkTrafficListener consoleNotifyingWiremockNetworkTrafficListener =\n        new ConsoleNotifyingWiremockNetworkTrafficListener();\n    Socket socket = new Socket();\n    ByteBuffer byteBuffer = stringToByteBuffer(\"Hello world\", StandardCharsets.UTF_8);\n\n    consoleNotifyingWiremockNetworkTrafficListener.outgoing(socket, byteBuffer);\n\n    assertThat(out.toString(), containsString(\"Hello world\"));\n\n    System.setOut(originalOut);\n  }\n\n  @Test\n  public void charsetConstructor_notifiesToSystemOutAndUsesSpecifiedCharset() {\n    PrintStream originalOut = System.out;\n    ByteArrayOutputStream out = new ByteArrayOutputStream();\n    System.setOut(new PrintStream(out));\n\n    ConsoleNotifyingWiremockNetworkTrafficListener consoleNotifyingWiremockNetworkTrafficListener =\n        new ConsoleNotifyingWiremockNetworkTrafficListener(StandardCharsets.UTF_16);\n    Socket socket = new Socket();\n    ByteBuffer byteBuffer = stringToByteBuffer(\"Hello world\", StandardCharsets.UTF_16);\n\n    consoleNotifyingWiremockNetworkTrafficListener.outgoing(socket, byteBuffer);\n\n    assertThat(out.toString(), containsString(\"Hello world\"));\n\n    System.setOut(originalOut);\n  }\n\n  public static ByteBuffer stringToByteBuffer(String msg, Charset charset) {\n    return ByteBuffer.wrap(msg.getBytes(charset));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/http/trafficlistener/NotifyingWiremockNetworkTrafficListenerTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.trafficlistener;\n\nimport static org.mockito.ArgumentMatchers.contains;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.verify;\n\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport java.net.Socket;\nimport java.nio.ByteBuffer;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport org.junit.jupiter.api.Test;\n\npublic class NotifyingWiremockNetworkTrafficListenerTest {\n  private final Notifier mockNotifier = mock(Notifier.class);\n\n  @Test\n  public void opened_withSocket_shouldNotifyAtInfo() {\n    NotifyingWiremockNetworkTrafficListener consoleNotifyingWiremockNetworkTrafficListener =\n        new NotifyingWiremockNetworkTrafficListener(mockNotifier, StandardCharsets.UTF_8);\n    Socket socket = new Socket();\n\n    consoleNotifyingWiremockNetworkTrafficListener.opened(socket);\n\n    verify(mockNotifier).info(contains(\"Opened \"));\n  }\n\n  @Test\n  public void closed_withSocket_shouldNotifyAtInfo() {\n    NotifyingWiremockNetworkTrafficListener consoleNotifyingWiremockNetworkTrafficListener =\n        new NotifyingWiremockNetworkTrafficListener(mockNotifier, StandardCharsets.UTF_8);\n    Socket socket = new Socket();\n\n    consoleNotifyingWiremockNetworkTrafficListener.closed(socket);\n\n    verify(mockNotifier).info(contains(\"Closed \"));\n  }\n\n  @Test\n  public void incoming_withBytebufferWithIncompatibleCharset_shouldNotifyBytesOmittedAtInfo() {\n    NotifyingWiremockNetworkTrafficListener consoleNotifyingWiremockNetworkTrafficListener =\n        new NotifyingWiremockNetworkTrafficListener(mockNotifier, StandardCharsets.UTF_8);\n    Socket socket = new Socket();\n    ByteBuffer byteBuffer = stringToByteBuffer(\"Hello world\", StandardCharsets.UTF_16);\n\n    consoleNotifyingWiremockNetworkTrafficListener.incoming(socket, byteBuffer);\n\n    verify(mockNotifier).error(contains(\"Incoming bytes omitted.\"));\n  }\n\n  @Test\n  public void incoming_withBytebufferWithCompatibleCharset_shouldNotifyWithIncomingBytes() {\n    NotifyingWiremockNetworkTrafficListener consoleNotifyingWiremockNetworkTrafficListener =\n        new NotifyingWiremockNetworkTrafficListener(mockNotifier, StandardCharsets.UTF_8);\n    Socket socket = new Socket();\n    ByteBuffer byteBuffer = stringToByteBuffer(\"Hello world\", StandardCharsets.UTF_8);\n\n    consoleNotifyingWiremockNetworkTrafficListener.incoming(socket, byteBuffer);\n\n    verify(mockNotifier).info(contains(\"Hello world\"));\n  }\n\n  @Test\n  public void outgoing_withBytebufferWithIncompatibleCharset_shouldNotifyBytesOmittedAtInfo() {\n    NotifyingWiremockNetworkTrafficListener consoleNotifyingWiremockNetworkTrafficListener =\n        new NotifyingWiremockNetworkTrafficListener(mockNotifier, StandardCharsets.UTF_8);\n    Socket socket = new Socket();\n    ByteBuffer byteBuffer = stringToByteBuffer(\"Hello world\", StandardCharsets.UTF_16);\n\n    consoleNotifyingWiremockNetworkTrafficListener.outgoing(socket, byteBuffer);\n\n    verify(mockNotifier).error(contains(\"Outgoing bytes omitted.\"));\n  }\n\n  @Test\n  public void outgoing_withBytebufferWithCompatibleCharset_shouldNotifyWithIncomingBytes() {\n    NotifyingWiremockNetworkTrafficListener consoleNotifyingWiremockNetworkTrafficListener =\n        new NotifyingWiremockNetworkTrafficListener(mockNotifier, StandardCharsets.UTF_8);\n    Socket socket = new Socket();\n    ByteBuffer byteBuffer = stringToByteBuffer(\"Hello world\", StandardCharsets.UTF_8);\n\n    consoleNotifyingWiremockNetworkTrafficListener.outgoing(socket, byteBuffer);\n\n    verify(mockNotifier).info(contains(\"Hello world\"));\n  }\n\n  public static ByteBuffer stringToByteBuffer(String msg, Charset charset) {\n    return ByteBuffer.wrap(msg.getBytes(charset));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/AltHttpServerFactory.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.ADMIN_CONTEXT_ROOT;\n\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport org.eclipse.jetty.ee11.servlet.ServletContextHandler;\nimport org.eclipse.jetty.ee11.servlet.ServletHolder;\nimport org.eclipse.jetty.server.Handler;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.server.ServerConnector;\n\npublic class AltHttpServerFactory implements HttpServerFactory {\n\n  @Override\n  public HttpServer buildHttpServer(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler,\n      MessageStubRequestHandler messageStubRequestHandler) {\n\n    final Server jettyServer = new Server(0);\n    ConsoleNotifier notifier = new ConsoleNotifier(false);\n    ServletContextHandler adminContext =\n        addAdminContext(jettyServer, adminRequestHandler, notifier);\n    ServletContextHandler mockServiceContext =\n        addMockServiceContext(jettyServer, stubRequestHandler, notifier);\n\n    Handler.Abstract handler = new Handler.Sequence(adminContext, mockServiceContext);\n    jettyServer.setHandler(handler);\n\n    return new HttpServer() {\n\n      @Override\n      public void start() {\n        try {\n          jettyServer.start();\n        } catch (Exception e) {\n          throwUnchecked(e);\n        }\n      }\n\n      @Override\n      public void stop() {\n        try {\n          jettyServer.stop();\n        } catch (Exception e) {\n          throwUnchecked(e);\n        }\n      }\n\n      @Override\n      public boolean isRunning() {\n        return jettyServer.isRunning();\n      }\n\n      @Override\n      public int port() {\n        return ((ServerConnector) jettyServer.getConnectors()[0]).getLocalPort();\n      }\n\n      @Override\n      public int httpsPort() {\n        return 0;\n      }\n    };\n  }\n\n  @SuppressWarnings({\"rawtypes\", \"unchecked\"})\n  private ServletContextHandler addMockServiceContext(\n      Server jettyServer, StubRequestHandler stubRequestHandler, Notifier notifier) {\n    ServletContextHandler mockServiceContext = new ServletContextHandler();\n    mockServiceContext.setServer(jettyServer);\n    mockServiceContext.setContextPath(\"/\");\n\n    mockServiceContext.setAttribute(StubRequestHandler.class.getName(), stubRequestHandler);\n    mockServiceContext.setAttribute(Notifier.KEY, notifier);\n    ServletHolder servletHolder =\n        mockServiceContext.addServlet(WireMockHandlerDispatchingServlet.class, \"/\");\n    servletHolder.setInitParameter(\n        RequestHandler.HANDLER_CLASS_KEY, StubRequestHandler.class.getName());\n    servletHolder.setInitParameter(\n        WireMockHandlerDispatchingServlet.SHOULD_FORWARD_TO_FILES_CONTEXT, \"false\");\n\n    return mockServiceContext;\n  }\n\n  private ServletContextHandler addAdminContext(\n      Server jettyServer, AdminRequestHandler adminRequestHandler, Notifier notifier) {\n    ServletContextHandler adminContext = new ServletContextHandler();\n    adminContext.setServer(jettyServer);\n    adminContext.setContextPath(ADMIN_CONTEXT_ROOT);\n    ServletHolder servletHolder =\n        adminContext.addServlet(WireMockHandlerDispatchingServlet.class, \"/\");\n    servletHolder.setInitParameter(\n        RequestHandler.HANDLER_CLASS_KEY, AdminRequestHandler.class.getName());\n    adminContext.setAttribute(AdminRequestHandler.class.getName(), adminRequestHandler);\n    adminContext.setAttribute(Notifier.KEY, notifier);\n    return adminContext;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/AlternativeServletContainerTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.http.Fault;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class AlternativeServletContainerTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort().httpServerFactory(new AltHttpServerFactory()))\n          .build();\n\n  private WireMockTestClient client;\n\n  @BeforeEach\n  public void init() {\n    client = new WireMockTestClient(wm.getPort());\n    WireMock.configureFor(wm.getPort());\n  }\n\n  @Test\n  public void supportsAlternativeHttpServerForBasicStub() {\n    stubFor(get(urlEqualTo(\"/alt-server\")).willReturn(aResponse().withStatus(204)));\n\n    assertThat(client.get(\"/alt-server\").statusCode(), is(204));\n  }\n\n  @Test\n  public void supportsAlternativeHttpServerForFaultInjection() {\n    stubFor(get(urlEqualTo(\"/alt-server\")).willReturn(aResponse().withFault(Fault.EMPTY_RESPONSE)));\n\n    WireMockResponse response = client.get(\"/alt-server\");\n\n    assertThat(response.statusCode(), is(418));\n    assertThat(response.content(), is(\"No fault injector is configured!\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/CustomHttpServer.java",
    "content": "/*\n * Copyright (C) 2024-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.http.AdminRequestHandler;\nimport com.github.tomakehurst.wiremock.http.StubRequestHandler;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport org.eclipse.jetty.util.thread.QueuedThreadPool;\n\npublic class CustomHttpServer extends Jetty12HttpServer {\n  public CustomHttpServer(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler,\n      MessageStubRequestHandler messageStubRequestHandler) {\n    super(\n        options,\n        adminRequestHandler,\n        stubRequestHandler,\n        JettySettings.Builder.aJettySettings().build(),\n        new QueuedThreadPool(options.containerThreads()),\n        messageStubRequestHandler);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/CustomHttpServerFactory.java",
    "content": "/*\n * Copyright (C) 2024-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.http.AdminRequestHandler;\nimport com.github.tomakehurst.wiremock.http.HttpServer;\nimport com.github.tomakehurst.wiremock.http.HttpServerFactory;\nimport com.github.tomakehurst.wiremock.http.StubRequestHandler;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\n\npublic class CustomHttpServerFactory implements HttpServerFactory {\n\n  @Override\n  public String getName() {\n    return HttpServerFactory.super.getName();\n  }\n\n  @Override\n  public HttpServer buildHttpServer(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler,\n      MessageStubRequestHandler messageStubRequestHandler) {\n    return new CustomHttpServer(\n        options, adminRequestHandler, stubRequestHandler, messageStubRequestHandler);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/FaultsTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.http.Fault;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.net.SocketException;\nimport org.apache.hc.core5.http.MalformedChunkCodingException;\nimport org.apache.hc.core5.http.NoHttpResponseException;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class FaultsTest {\n\n  @RegisterExtension\n  static WireMockExtension wm =\n      WireMockExtension.newInstance().options(wireMockConfig().dynamicPort()).build();\n\n  static WireMockTestClient testClient;\n\n  @BeforeAll\n  static void init() {\n    testClient = new WireMockTestClient(wm.getPort());\n    WireMock.configureFor(wm.getPort());\n  }\n\n  @Test\n  public void connectionResetByPeerFault() {\n    stubFor(\n        get(urlEqualTo(\"/connection/reset\"))\n            .willReturn(aResponse().withFault(Fault.CONNECTION_RESET_BY_PEER)));\n\n    SocketException socketException =\n        assertThrows(SocketException.class, () -> testClient.get(\"/connection/reset\"));\n    assertThat(socketException.getMessage(), is(\"Connection reset\"));\n  }\n\n  @Test\n  public void emptyResponseFault() {\n    stubFor(\n        get(urlEqualTo(\"/empty/response\")).willReturn(aResponse().withFault(Fault.EMPTY_RESPONSE)));\n\n    assertThrows(NoHttpResponseException.class, () -> testClient.get(\"/empty/response\"));\n  }\n\n  @Test\n  public void malformedResponseChunkFault() {\n    stubFor(\n        get(urlEqualTo(\"/malformed/response\"))\n            .willReturn(aResponse().withFault(Fault.MALFORMED_RESPONSE_CHUNK)));\n\n    assertThrows(MalformedChunkCodingException.class, () -> testClient.get(\"/malformed/response\"));\n  }\n\n  @Test\n  public void randomDataOnSocketFault() {\n    stubFor(\n        get(urlEqualTo(\"/random/data\"))\n            .willReturn(aResponse().withFault(Fault.RANDOM_DATA_THEN_CLOSE)));\n\n    assertThrows(NoHttpResponseException.class, () -> testClient.get(\"/random/data\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/Http2AcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.eclipse.jetty.http.HttpVersion.HTTP_2;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.fail;\n\nimport com.github.tomakehurst.wiremock.http.Fault;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport java.io.IOException;\nimport java.nio.channels.ClosedChannelException;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.eclipse.jetty.client.ContentResponse;\nimport org.eclipse.jetty.client.HttpClient;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class Http2AcceptanceTest {\n\n  @RegisterExtension\n  public static WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().dynamicPort().dynamicHttpsPort())\n          .build();\n\n  @Test\n  public void supportsHttp2Connections() throws Exception {\n    HttpClient client = Http2ClientFactory.create();\n\n    wm.stubFor(get(\"/thing\").willReturn(ok(\"HTTP/2 response\")));\n\n    ContentResponse response = client.GET(wm.getRuntimeInfo().getHttpsBaseUrl() + \"/thing\");\n    assertThat(response.getVersion(), is(HTTP_2));\n    assertThat(response.getStatus(), is(200));\n  }\n\n  @Test\n  public void supportsHttp2PlaintextConnections() throws Exception {\n    HttpClient client = Http2ClientFactory.create();\n\n    wm.stubFor(get(\"/thing\").willReturn(ok(\"HTTP/2 response\")));\n\n    ContentResponse response = client.GET(wm.getRuntimeInfo().getHttpBaseUrl() + \"/thing\");\n    assertThat(response.getVersion(), is(HTTP_2));\n    assertThat(response.getStatus(), is(200));\n  }\n\n  @Test\n  public void supportsHttp1_1Connections() throws Exception {\n    CloseableHttpClient client = ApacheHttpClientFactory.createClient();\n\n    wm.stubFor(get(\"/thing\").willReturn(ok(\"HTTP/1.1 response\")));\n\n    HttpGet get = new HttpGet(wm.getRuntimeInfo().getHttpsBaseUrl() + \"/thing\");\n    try (CloseableHttpResponse response = client.execute(get)) {\n      assertThat(response.getCode(), is(200));\n    }\n  }\n\n  @Test\n  void connectionResetByPeerFault() {\n    HttpClient client = Http2ClientFactory.create();\n\n    wm.stubFor(\n        get(urlEqualTo(\"/connection/reset\"))\n            .willReturn(aResponse().withFault(Fault.CONNECTION_RESET_BY_PEER)));\n\n    getAndAssertUnderlyingExceptionInstanceClass(\n        client,\n        wm.getRuntimeInfo().getHttpsBaseUrl() + \"/connection/reset\",\n        ClosedChannelException.class);\n  }\n\n  @Test\n  void emptyResponseFault() {\n    HttpClient client = Http2ClientFactory.create();\n\n    wm.stubFor(\n        get(urlEqualTo(\"/empty/response\")).willReturn(aResponse().withFault(Fault.EMPTY_RESPONSE)));\n\n    getAndAssertUnderlyingExceptionInstanceClass(\n        client,\n        wm.getRuntimeInfo().getHttpsBaseUrl() + \"/empty/response\",\n        ClosedChannelException.class);\n  }\n\n  @Test\n  void malformedResponseChunkFault() {\n    HttpClient client = Http2ClientFactory.create();\n\n    wm.stubFor(\n        get(urlEqualTo(\"/malformed/response\"))\n            .willReturn(aResponse().withFault(Fault.MALFORMED_RESPONSE_CHUNK)));\n\n    IOException e =\n        getAndAssertUnderlyingExceptionInstanceClass(\n            client,\n            wm.getRuntimeInfo().getHttpsBaseUrl() + \"/malformed/response\",\n            IOException.class);\n    assertThat(e.getMessage(), is(\"frame_size_error/invalid_frame_length\"));\n  }\n\n  @Test\n  void randomDataOnSocketFault() {\n    HttpClient client = Http2ClientFactory.create();\n\n    wm.stubFor(\n        get(urlEqualTo(\"/random/data\"))\n            .willReturn(aResponse().withFault(Fault.RANDOM_DATA_THEN_CLOSE)));\n\n    IOException e =\n        getAndAssertUnderlyingExceptionInstanceClass(\n            client, wm.getRuntimeInfo().getHttpsBaseUrl() + \"/random/data\", IOException.class);\n    assertThat(e.getMessage(), is(\"frame_size_error/invalid_frame_length\"));\n  }\n\n  private <T> T getAndAssertUnderlyingExceptionInstanceClass(\n      HttpClient httpClient, String url, Class<T> expectedClass) {\n    try {\n      contentFor(httpClient, url);\n    } catch (Exception e) {\n      Throwable cause = e.getCause();\n      if (cause != null) {\n        assertThat(e.getCause(), instanceOf(expectedClass));\n        //noinspection unchecked\n        return (T) e.getCause();\n      } else {\n        assertThat(e, instanceOf(expectedClass));\n        //noinspection unchecked\n        return (T) e;\n      }\n    }\n\n    return fail(\"No exception was thrown\");\n  }\n\n  private void contentFor(HttpClient httpClient, String url) throws Exception {\n    httpClient.GET(url).getContentAsString();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/Http2ClientFactory.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport org.eclipse.jetty.client.HttpClient;\nimport org.eclipse.jetty.client.HttpClientTransport;\nimport org.eclipse.jetty.http2.client.HTTP2Client;\nimport org.eclipse.jetty.http2.client.transport.HttpClientTransportOverHTTP2;\nimport org.eclipse.jetty.io.ClientConnector;\nimport org.eclipse.jetty.util.ssl.SslContextFactory;\n\nclass Http2ClientFactory {\n  public static HttpClient create() {\n    final SslContextFactory.Client sslContextFactory = new SslContextFactory.Client(true);\n    final ClientConnector connector = new ClientConnector();\n    connector.setSslContextFactory(sslContextFactory);\n    HttpClientTransport transport = new HttpClientTransportOverHTTP2(new HTTP2Client(connector));\n    HttpClient httpClient = new HttpClient(transport);\n\n    httpClient.setFollowRedirects(false);\n    try {\n      httpClient.start();\n    } catch (Exception e) {\n      return Exceptions.throwUnchecked(e, HttpClient.class);\n    }\n\n    return httpClient;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/Http2DisabledAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static java.net.http.HttpClient.Version.HTTP_1_1;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport java.net.Socket;\nimport java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.security.SecureRandom;\nimport java.security.cert.X509Certificate;\nimport javax.net.ssl.SSLContext;\nimport javax.net.ssl.SSLEngine;\nimport javax.net.ssl.TrustManager;\nimport javax.net.ssl.X509ExtendedTrustManager;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class Http2DisabledAcceptanceTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(\n              wireMockConfig()\n                  .dynamicPort()\n                  .dynamicHttpsPort()\n                  .http2PlainDisabled(true)\n                  .http2TlsDisabled(true))\n          .build();\n\n  HttpClient client;\n\n  @BeforeEach\n  void init() throws Exception {\n    client = HttpClient.newBuilder().sslContext(trustEverything()).build();\n  }\n\n  @Test\n  public void usesHttp1_1OverPlainText() throws Exception {\n    wm.stubFor(get(\"/thing\").willReturn(ok(\"HTTP/2 response\")));\n\n    URI uri = URI.create(wm.getRuntimeInfo().getHttpBaseUrl() + \"/thing\");\n\n    HttpResponse<String> response =\n        client.send(HttpRequest.newBuilder(uri).build(), HttpResponse.BodyHandlers.ofString());\n    assertThat(response.version(), is(HTTP_1_1));\n    assertThat(response.statusCode(), is(200));\n  }\n\n  @Test\n  void usesHttp1_1OverTls() throws Exception {\n    wm.stubFor(get(\"/thing\").willReturn(ok(\"HTTP/2 response\")));\n\n    URI uri = URI.create(wm.getRuntimeInfo().getHttpsBaseUrl() + \"/thing\");\n\n    HttpResponse<String> response =\n        client.send(HttpRequest.newBuilder(uri).build(), HttpResponse.BodyHandlers.ofString());\n    assertThat(response.version(), is(HTTP_1_1));\n    assertThat(response.statusCode(), is(200));\n  }\n\n  private SSLContext trustEverything() throws Exception {\n    X509ExtendedTrustManager trustManager =\n        new X509ExtendedTrustManager() {\n          @Override\n          public X509Certificate[] getAcceptedIssuers() {\n            return new X509Certificate[] {};\n          }\n\n          @Override\n          public void checkClientTrusted(X509Certificate[] chain, String authType) {}\n\n          @Override\n          public void checkServerTrusted(X509Certificate[] chain, String authType) {}\n\n          @Override\n          public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) {}\n\n          @Override\n          public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) {}\n\n          @Override\n          public void checkClientTrusted(\n              X509Certificate[] chain, String authType, SSLEngine engine) {}\n\n          @Override\n          public void checkServerTrusted(\n              X509Certificate[] chain, String authType, SSLEngine engine) {}\n        };\n    SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n    sslContext.init(null, new TrustManager[] {trustManager}, new SecureRandom());\n\n    return sslContext;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/Jetty12MultipartParser.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.jetty.servlet.WireMockHttpServletMultipartAdapter;\nimport jakarta.servlet.http.Part;\nimport java.io.File;\nimport java.util.Collection;\nimport java.util.concurrent.CompletableFuture;\nimport java.util.stream.Collectors;\nimport org.eclipse.jetty.client.BytesRequestContent;\nimport org.eclipse.jetty.ee11.servlet.ServletMultiPartFormData.Parts;\nimport org.eclipse.jetty.http.MultiPart;\nimport org.eclipse.jetty.http.MultiPartFormData;\nimport org.eclipse.jetty.io.Content;\nimport org.eclipse.jetty.util.Attributes;\n\npublic class Jetty12MultipartParser\n    implements com.github.tomakehurst.wiremock.MultipartParserLoader.MultipartParser {\n  @SuppressWarnings(\"unchecked\")\n  @Override\n  public Collection<Request.Part> parse(byte[] body, String contentType) {\n    String boundary = MultiPart.extractBoundary(contentType);\n\n    final File filesDirectory = new File(System.getProperty(\"java.io.tmpdir\"));\n    final CompletableFuture<Collection<Part>> parts =\n        MultiPartFormData.from(\n                Attributes.NULL,\n                boundary,\n                parser -> {\n                  try {\n                    // No existing core parts, so we need to configure the parser.\n\n                    Content.Source source = new BytesRequestContent(body);\n                    parser.setFilesDirectory(filesDirectory.toPath());\n                    return parser.parse(source);\n                  } catch (Throwable failure) {\n                    return CompletableFuture.failedFuture(failure);\n                  }\n                })\n            .thenApply(\n                formDataParts -> new Parts(filesDirectory.toPath(), formDataParts).getParts());\n\n    try {\n      return parts.get().stream()\n          .map(WireMockHttpServletMultipartAdapter::from)\n          .collect(Collectors.toList());\n    } catch (Exception e) {\n      return throwUnchecked(e, Collection.class);\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/Jetty12MultipartParserLoader.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport java.util.Optional;\n\npublic class Jetty12MultipartParserLoader\n    implements com.github.tomakehurst.wiremock.MultipartParserLoader {\n  private static final String JETTY_12 = \"12\"; /* Jetty 12 */\n\n  @Override\n  public Optional<MultipartParser> getMultipartParser(String jettyMajorVersion) {\n    if (JETTY_12.equalsIgnoreCase(jettyMajorVersion)) {\n      return Optional.of(new Jetty12MultipartParser());\n    } else {\n      return Optional.empty();\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/JettyHttpServerTest.java",
    "content": "/*\n * Copyright (C) 2017-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertNull;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.admin.AdminRoutes;\nimport com.github.tomakehurst.wiremock.common.DataTruncationSettings;\nimport com.github.tomakehurst.wiremock.common.FatalStartupException;\nimport com.github.tomakehurst.wiremock.common.Limit;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.StubServer;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.extension.Extensions;\nimport com.github.tomakehurst.wiremock.http.AdminRequestHandler;\nimport com.github.tomakehurst.wiremock.http.BasicResponseRenderer;\nimport com.github.tomakehurst.wiremock.http.ResponseRenderer;\nimport com.github.tomakehurst.wiremock.http.StubRequestHandler;\nimport com.github.tomakehurst.wiremock.message.MessageChannels;\nimport com.github.tomakehurst.wiremock.message.MessageStubMappings;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport com.github.tomakehurst.wiremock.security.NoAuthenticator;\nimport com.github.tomakehurst.wiremock.store.InMemoryMessageChannelStore;\nimport com.github.tomakehurst.wiremock.store.InMemoryMessageStubMappingStore;\nimport com.github.tomakehurst.wiremock.verification.InMemoryMessageJournal;\nimport com.github.tomakehurst.wiremock.verification.RequestJournal;\nimport com.github.tomakehurst.wiremock.verification.notmatched.PlainTextStubNotMatchedRenderer;\nimport java.lang.reflect.Field;\nimport java.util.Collections;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.server.ServerConnector;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.Mockito;\n\npublic class JettyHttpServerTest {\n\n  static final DataTruncationSettings NO_TRUNCATION = new DataTruncationSettings(Limit.UNLIMITED);\n\n  private AdminRequestHandler adminRequestHandler;\n  private StubRequestHandler stubRequestHandler;\n  private MessageChannels messageChannels = new MessageChannels(new InMemoryMessageChannelStore());\n  private MessageStubMappings messageStubMappings =\n      new MessageStubMappings(new InMemoryMessageStubMappingStore());\n  private MessageStubRequestHandler messageStubRequestHandler;\n  private JettyHttpServerFactory serverFactory = new JettyHttpServerFactory();\n\n  @BeforeEach\n  public void init() {\n    Admin admin = Mockito.mock(Admin.class);\n\n    adminRequestHandler =\n        new AdminRequestHandler(\n            AdminRoutes.forClient(),\n            admin,\n            new BasicResponseRenderer(),\n            new NoAuthenticator(),\n            false,\n            Collections.emptyList(),\n            Collections.emptyList(),\n            NO_TRUNCATION);\n    stubRequestHandler =\n        new StubRequestHandler(\n            Mockito.mock(StubServer.class),\n            Mockito.mock(ResponseRenderer.class),\n            admin,\n            Collections.emptyMap(),\n            Collections.emptyMap(),\n            Mockito.mock(RequestJournal.class),\n            Collections.emptyList(),\n            Collections.emptyList(),\n            false,\n            NO_TRUNCATION,\n            new PlainTextStubNotMatchedRenderer(Extensions.NONE));\n    messageStubRequestHandler =\n        new MessageStubRequestHandler(\n            messageStubMappings,\n            messageChannels,\n            new InMemoryMessageJournal(null),\n            null,\n            Collections.emptyList());\n  }\n\n  @Test\n  public void testStopTimeout() {\n    long expectedStopTimeout = 1000L;\n    WireMockConfiguration config =\n        WireMockConfiguration.wireMockConfig()\n            .httpServerFactory(\n                new JettyHttpServerFactory(\n                    JettySettings.Builder.aJettySettings()\n                        .withStopTimeout(expectedStopTimeout)\n                        .build()));\n\n    JettyHttpServer jettyHttpServer =\n        (JettyHttpServer)\n            serverFactory.buildHttpServer(\n                config, adminRequestHandler, stubRequestHandler, messageStubRequestHandler);\n\n    assertThat(jettyHttpServer.stopTimeout(), is(expectedStopTimeout));\n  }\n\n  @Test\n  public void testStopTimeoutNotSet() {\n    long expectedStopTimeout = 1000L;\n    WireMockConfiguration config = WireMockConfiguration.wireMockConfig();\n\n    JettyHttpServer jettyHttpServer =\n        (JettyHttpServer)\n            serverFactory.buildHttpServer(\n                config, adminRequestHandler, stubRequestHandler, messageStubRequestHandler);\n\n    assertThat(jettyHttpServer.stopTimeout(), is(expectedStopTimeout));\n  }\n\n  @Test\n  public void testHttpConnectorIsNullWhenHttpDisabled()\n      throws NoSuchFieldException, IllegalAccessException {\n    WireMockConfiguration config = WireMockConfiguration.wireMockConfig().httpDisabled(true);\n\n    JettyHttpServer jettyHttpServer =\n        (JettyHttpServer)\n            serverFactory.buildHttpServer(\n                config, adminRequestHandler, stubRequestHandler, messageStubRequestHandler);\n\n    Field httpConnectorField = JettyHttpServer.class.getDeclaredField(\"httpConnector\");\n    httpConnectorField.setAccessible(true);\n    ServerConnector httpConnector = (ServerConnector) httpConnectorField.get(jettyHttpServer);\n\n    assertNull(httpConnector);\n  }\n\n  @Test\n  public void testStartWithIOException() throws Exception {\n    Server testServer = new Server(0);\n    testServer.start();\n\n    ServerConnector serverConnector = (ServerConnector) testServer.getConnectors()[0];\n    int currentPort = serverConnector.getLocalPort();\n\n    WireMockConfiguration config = WireMockConfiguration.wireMockConfig().port(currentPort);\n    JettyHttpServer jettyHttpServer =\n        (JettyHttpServer)\n            serverFactory.buildHttpServer(\n                config, adminRequestHandler, stubRequestHandler, messageStubRequestHandler);\n\n    RuntimeException exception = assertThrows(RuntimeException.class, jettyHttpServer::start);\n    assertTrue(exception instanceof FatalStartupException);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/ProgrammaticHttpServerAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasItem;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.TestNotifier;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class ProgrammaticHttpServerAcceptanceTest {\n\n  static TestNotifier notifier = new TestNotifier();\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(\n              wireMockConfig()\n                  .dynamicPort()\n                  .dynamicHttpsPort()\n                  .httpServerFactory(new CustomHttpServerFactory())\n                  .notifier(notifier))\n          .build();\n\n  @BeforeAll\n  static void init() {\n    notifier.reset();\n  }\n\n  @Test\n  public void correctServerLoaded() {\n    assertThat(notifier.getInfoMessages(), hasItem(\"Using HTTP server impl: CustomHttpServer\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/WarDeploymentAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.sampleWarRootDir;\nimport static java.net.HttpURLConnection.HTTP_OK;\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.fail;\n\nimport com.github.tomakehurst.wiremock.client.VerificationException;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.testsupport.Network;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.eclipse.jetty.ee11.webapp.WebAppContext;\nimport org.eclipse.jetty.server.Server;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class WarDeploymentAcceptanceTest {\n\n  private Server jetty;\n\n  private WireMockTestClient testClient;\n\n  @BeforeEach\n  public void init() throws Exception {\n    String webAppRootPath = sampleWarRootDir() + \"/src/main/webapp\";\n    WebAppContext context = new WebAppContext(webAppRootPath, \"/wiremock\");\n\n    int port = attemptToStartOnRandomPort(context);\n\n    WireMock.configureFor(\"localhost\", port, \"/wiremock\");\n    testClient = new WireMockTestClient(port);\n  }\n\n  private int attemptToStartOnRandomPort(WebAppContext context) throws Exception {\n    int port;\n\n    int attemptsRemaining = 3;\n    while (true) {\n      port = Network.findFreePort();\n      jetty = new Server(port);\n      jetty.setHandler(context);\n      try {\n        jetty.start();\n        break;\n      } catch (Exception e) {\n        attemptsRemaining--;\n        if (attemptsRemaining > 0) {\n          continue;\n        }\n\n        throw e;\n      }\n    }\n    return port;\n  }\n\n  @AfterEach\n  public void cleanup() throws Exception {\n    jetty.stop();\n    WireMock.configure();\n  }\n\n  @Test\n  public void servesBakedInStubResponse() {\n    WireMockResponse response = testClient.get(\"/wiremock/api/mytest\");\n    assertThat(response.content(), containsString(\"YES\"));\n  }\n\n  @Test\n  public void acceptsAndReturnsStubMapping() {\n    givenThat(\n        get(urlEqualTo(\"/war/stub\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBody(\"War stub OK\")));\n\n    assertThat(testClient.get(\"/wiremock/war/stub\").content(), is(\"War stub OK\"));\n  }\n\n  @Test\n  public void tryingToShutDownGives500() {\n    try {\n      shutdownServer();\n      fail(\"Expected a VerificationException\");\n    } catch (VerificationException e) {\n      assertThat(e.getMessage(), containsString(\"500\"));\n    }\n  }\n\n  @Test\n  public void tryingToSaveMappingsGives500() {\n    try {\n      saveAllMappings();\n      fail(\"Expected a VerificationException\");\n    } catch (VerificationException e) {\n      assertThat(e.getMessage(), containsString(\"500\"));\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/WarDeploymentParameterAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.sampleWarRootDir;\nimport static java.net.HttpURLConnection.HTTP_OK;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.testsupport.Network;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.eclipse.jetty.ee11.webapp.WebAppContext;\nimport org.eclipse.jetty.server.Server;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\n/**\n * Tests that check if init parameters for servlets and the context of wiremock are passed on\n * correctly\n */\npublic class WarDeploymentParameterAcceptanceTest {\n  private Server jetty;\n  private WireMockTestClient testClient;\n\n  @AfterEach\n  public void cleanup() throws Exception {\n    jetty.stop();\n    WireMock.configure();\n  }\n\n  @Test\n  public void testCustomMapping() throws Exception {\n    // Test war deployment using a different servlet mapping path (see webappCustomMapping).\n    init(sampleWarRootDir() + \"/src/main/webappCustomMapping\", \"/mapping\");\n    givenThat(\n        get(urlEqualTo(\"/war/stub\"))\n            .willReturn(aResponse().withStatus(HTTP_OK).withBody(\"War stub OK\")));\n\n    assertThat(testClient.get(\"/wiremock/mapping/war/stub\").content(), is(\"War stub OK\"));\n  }\n\n  @Test\n  public void testLimitedRequestJournal() throws Exception {\n    // Test war deployment usint a request journal restricted to two entries\n    init(sampleWarRootDir() + \"/src/main/webappLimitedRequestJournal\", \"\");\n    // We don't have to create a stub since failed requests are also recorded\n    testClient.get(\"/wiremock/request1\");\n    testClient.get(\"/wiremock/request2\");\n    testClient.get(\"/wiremock/request3\");\n\n    // Only two requests are present since the oldest one is discarded\n    verify(0, getRequestedFor(urlEqualTo(\"/request1\")));\n    verify(1, getRequestedFor(urlEqualTo(\"/request2\")));\n    verify(1, getRequestedFor(urlEqualTo(\"/request3\")));\n  }\n\n  /**\n   * Start jetty and wiremock. This is not an @Before method since we need to pass a parameter\n   *\n   * @param webInfPath Path where the WEB-INF directory for jetty resides\n   * @param mappingPath Path where wiremock is mapped\n   */\n  private void init(String webInfPath, String mappingPath) throws Exception {\n    int port = Network.findFreePort();\n    jetty = new Server(port);\n    WebAppContext context = new WebAppContext(webInfPath, \"/wiremock\");\n    jetty.setHandler(context);\n    jetty.start();\n\n    WireMock.configureFor(\"localhost\", port, \"/wiremock\" + mappingPath);\n    testClient = new WireMockTestClient(port);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/archunit/UnusedCodeTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.archunit;\n\nimport static com.tngtech.archunit.base.DescribedPredicate.describe;\nimport static com.tngtech.archunit.base.DescribedPredicate.not;\nimport static com.tngtech.archunit.core.domain.JavaClass.Predicates.assignableTo;\nimport static com.tngtech.archunit.core.domain.JavaMember.Predicates.declaredIn;\nimport static com.tngtech.archunit.core.domain.properties.HasName.Utils.namesOf;\nimport static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;\nimport static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.methods;\nimport static com.tngtech.archunit.library.freeze.FreezingArchRule.freeze;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.tngtech.archunit.core.domain.JavaAccess;\nimport com.tngtech.archunit.core.domain.JavaClass;\nimport com.tngtech.archunit.core.domain.JavaMethod;\nimport com.tngtech.archunit.core.importer.ImportOption;\nimport com.tngtech.archunit.junit.AnalyzeClasses;\nimport com.tngtech.archunit.junit.ArchIgnore;\nimport com.tngtech.archunit.junit.ArchTest;\nimport com.tngtech.archunit.lang.ArchCondition;\nimport com.tngtech.archunit.lang.ArchRule;\nimport com.tngtech.archunit.lang.ConditionEvents;\nimport com.tngtech.archunit.lang.SimpleConditionEvent;\nimport java.util.HashSet;\nimport java.util.Set;\nimport java.util.function.Predicate;\n\n@AnalyzeClasses(\n    packagesOf = WireMockServer.class,\n    importOptions = {\n      ImportOption.DoNotIncludeArchives.class,\n      ImportOption.DoNotIncludeJars.class,\n      ImportOption.DoNotIncludeTests.class\n    })\nclass UnusedCodeTest {\n\n  private static final ArchCondition<? super JavaClass> beReferencedClass =\n      new ArchCondition<>(\"be referenced\") {\n        @Override\n        public void check(JavaClass javaClass, ConditionEvents events) {\n          Set<JavaAccess<?>> accesses = new HashSet<>(javaClass.getAccessesToSelf());\n          accesses.removeAll(javaClass.getAccessesFromSelf());\n          if (accesses.isEmpty() && javaClass.getDirectDependenciesToSelf().isEmpty()) {\n            events.add(\n                new SimpleConditionEvent(\n                    javaClass,\n                    false,\n                    String.format(\n                        \"%s is unreferenced in %s\",\n                        javaClass.getDescription(), javaClass.getSourceCodeLocation())));\n          }\n        }\n      };\n\n  @ArchTest\n  static ArchRule classesShouldNotBeUnused =\n      freeze(\n          classes()\n              .that(\n                  describe(\n                      \"do not implement interface\", clazz -> clazz.getAllRawInterfaces().isEmpty()))\n              .and(\n                  describe(\n                      \"do not extend class\", clazz -> 1 == clazz.getAllRawSuperclasses().size()))\n              .and(\n                  not(\n                      assignableTo(\n                          com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.class)))\n              .should(beReferencedClass)\n              .as(\"should use all classes\")\n              .because(\"unused classes should be removed\"));\n\n  private static final ArchCondition<? super JavaMethod> beReferencedMethod =\n      new ArchCondition<>(\"be referenced\") {\n        @Override\n        public void check(JavaMethod javaMethod, ConditionEvents events) {\n          Set<JavaAccess<?>> accesses = new HashSet<>(javaMethod.getAccessesToSelf());\n          accesses.removeAll(javaMethod.getAccessesFromSelf());\n          if (accesses.isEmpty()) {\n            events.add(\n                new SimpleConditionEvent(\n                    javaMethod,\n                    false,\n                    String.format(\n                        \"%s is unreferenced in %s\",\n                        javaMethod.getDescription(), javaMethod.getSourceCodeLocation())));\n          }\n        }\n      };\n\n  private static Predicate<JavaMethod> hasMatchingNameAndParameters(JavaMethod input) {\n    return m ->\n        m.getName().equals(input.getName())\n            && m.getRawParameterTypes().size() == input.getRawParameterTypes().size()\n            && (m.getDescriptor().equals(input.getDescriptor())\n                || namesOf(m.getRawParameterTypes())\n                    .containsAll(namesOf(input.getRawParameterTypes())));\n  }\n\n  /**\n   * Detect methods that are *likely* unused throughout this code base, and the code base of our\n   * users. Take care not to delete any classes or methods that users might have to come rely on.\n   */\n  @ArchTest\n  @ArchIgnore(\n      reason =\n          \"Disabled due to the potential for false positives in a public API; use to audit sporadically\")\n  static ArchRule methodsShouldNotBeUnused =\n      freeze(\n          methods()\n              .that(\n                  describe(\n                      \"are not declared in super type\",\n                      input ->\n                          input.getOwner().getAllRawSuperclasses().stream()\n                              .flatMap(c -> c.getMethods().stream())\n                              .noneMatch(hasMatchingNameAndParameters(input))))\n              .and(\n                  describe(\n                      \"are not declared in interface\",\n                      input ->\n                          input.getOwner().getAllRawInterfaces().stream()\n                              .flatMap(i -> i.getMethods().stream())\n                              .noneMatch(hasMatchingNameAndParameters(input))))\n              .and()\n              .doNotHaveName(\"main\")\n              .and()\n              .haveNameNotContaining(\"lambda\")\n              .and(not(declaredIn(JavaClass.Predicates.ENUMS.or(JavaClass.Predicates.ANNOTATIONS))))\n              .and(\n                  not(\n                      declaredIn(\n                          describe(\n                              \"are not declared in Builder\",\n                              input -> input.getName().endsWith(\"Builder\")))))\n              .and()\n              .areNotDeclaredIn(com.github.tomakehurst.wiremock.client.WireMock.class)\n              .and()\n              .areNotDeclaredIn(com.github.tomakehurst.wiremock.core.WireMockConfiguration.class)\n              .and()\n              .areNotDeclaredIn(com.github.tomakehurst.wiremock.junit5.WireMockExtension.class)\n              .and(\n                  not(\n                      describe(\n                          \"are not getters\",\n                          input ->\n                              input.getParameterTypes().isEmpty()\n                                  && (input.getName().startsWith(\"get\")\n                                      || input.getName().startsWith(\"is\")))))\n              .and(\n                  not(\n                      describe(\n                          \"are not builders\",\n                          input ->\n                              input.getParameterTypes().size() <= 1\n                                  && input.getOwner().tryGetField(input.getName()).isPresent())))\n              .should(beReferencedMethod)\n              .as(\"should use all methods\")\n              .because(\"unused methods should be removed\"));\n\n  @ArchTest\n  static ArchRule nonPublicMethodsShouldNotBeUnusedFrozen =\n      methods()\n          .that(\n              describe(\n                  \"are not declared in super type\",\n                  input ->\n                      input.getOwner().getAllRawSuperclasses().stream()\n                          .flatMap(c -> c.getMethods().stream())\n                          .noneMatch(hasMatchingNameAndParameters(input))))\n          .and(\n              describe(\n                  \"are not declared in interface\",\n                  input ->\n                      input.getOwner().getAllRawInterfaces().stream()\n                          .flatMap(i -> i.getMethods().stream())\n                          .noneMatch(hasMatchingNameAndParameters(input))))\n          .and()\n          .haveNameNotContaining(\"lambda\")\n          .and()\n          .areNotPublic()\n          .should(beReferencedMethod)\n          .as(\"should use all non public methods\")\n          .because(\"unused methods should be removed\");\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/jetty/servlet/ServletContextFileSourceTest.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.filePath;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.fileNamed;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.hasExactlyIgnoringOrder;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport jakarta.servlet.*;\nimport jakarta.servlet.ServletRegistration.Dynamic;\nimport jakarta.servlet.descriptor.JspConfigDescriptor;\nimport java.io.InputStream;\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.util.*;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ServletContextFileSourceTest {\n\n  private ServletContextFileSource fileSource;\n\n  @BeforeEach\n  public void init() {\n    fileSource = new ServletContextFileSource(new MockServletContext(), \"filesource\");\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  public void listsTextFilesRecursively() {\n    List<TextFile> files = fileSource.listFilesRecursively();\n\n    assertThat(\n        files,\n        hasExactlyIgnoringOrder(\n            fileNamed(\"one\"),\n            fileNamed(\"two\"),\n            fileNamed(\"three\"),\n            fileNamed(\"four\"),\n            fileNamed(\"five\"),\n            fileNamed(\"six\"),\n            fileNamed(\"seven\"),\n            fileNamed(\"eight\"),\n            fileNamed(\"deepfile.json\")));\n  }\n\n  @Test\n  public void throwsUnsupportedExceptionWhenAttemptingToWrite() {\n    assertThrows(\n        UnsupportedOperationException.class,\n        () -> fileSource.writeTextFile(\"filename\", \"filecontents\"));\n  }\n\n  private static class MockServletContext implements ServletContext {\n\n    @Override\n    public ServletContext getContext(String uripath) {\n      return null;\n    }\n\n    @Override\n    public int getMajorVersion() {\n      return 0;\n    }\n\n    @Override\n    public int getMinorVersion() {\n      return 0;\n    }\n\n    @Override\n    public int getEffectiveMajorVersion() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public int getEffectiveMinorVersion() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public String getMimeType(String file) {\n      return null;\n    }\n\n    @SuppressWarnings(\"rawtypes\")\n    @Override\n    public Set getResourcePaths(String path) {\n      return null;\n    }\n\n    @Override\n    public URL getResource(String path) throws MalformedURLException {\n      return null;\n    }\n\n    @Override\n    public InputStream getResourceAsStream(String path) {\n      return null;\n    }\n\n    @Override\n    public RequestDispatcher getRequestDispatcher(String path) {\n      return null;\n    }\n\n    @Override\n    public RequestDispatcher getNamedDispatcher(String name) {\n      return null;\n    }\n\n    @Override\n    public void log(String msg) {}\n\n    @Override\n    public void log(String message, Throwable throwable) {}\n\n    @Override\n    public String getRealPath(String path) {\n      return filePath(\"filesource\");\n    }\n\n    @Override\n    public String getServerInfo() {\n      return null;\n    }\n\n    @Override\n    public String getInitParameter(String name) {\n      return null;\n    }\n\n    @SuppressWarnings(\"rawtypes\")\n    @Override\n    public Enumeration getInitParameterNames() {\n      return null;\n    }\n\n    @Override\n    public boolean setInitParameter(String name, String value) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public Object getAttribute(String name) {\n      return null;\n    }\n\n    @SuppressWarnings(\"rawtypes\")\n    @Override\n    public Enumeration getAttributeNames() {\n      return null;\n    }\n\n    @Override\n    public void setAttribute(String name, Object object) {}\n\n    @Override\n    public void removeAttribute(String name) {}\n\n    @Override\n    public String getServletContextName() {\n      return null;\n    }\n\n    @Override\n    public ServletRegistration.Dynamic addServlet(String servletName, String className) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public ServletRegistration.Dynamic addServlet(\n        String servletName, Class<? extends Servlet> servletClass) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public <T extends Servlet> T createServlet(Class<T> clazz) throws ServletException {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public ServletRegistration getServletRegistration(String servletName) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public Map<String, ? extends ServletRegistration> getServletRegistrations() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public FilterRegistration.Dynamic addFilter(String filterName, String className) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public FilterRegistration.Dynamic addFilter(String filterName, Filter filter) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public FilterRegistration.Dynamic addFilter(\n        String filterName, Class<? extends Filter> filterClass) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public <T extends Filter> T createFilter(Class<T> clazz) throws ServletException {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public FilterRegistration getFilterRegistration(String filterName) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public Map<String, ? extends FilterRegistration> getFilterRegistrations() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public SessionCookieConfig getSessionCookieConfig() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public Set<SessionTrackingMode> getDefaultSessionTrackingModes() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public void addListener(String className) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public <T extends EventListener> void addListener(T t) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public void addListener(Class<? extends EventListener> listenerClass) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public <T extends EventListener> T createListener(Class<T> clazz) throws ServletException {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public JspConfigDescriptor getJspConfigDescriptor() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public ClassLoader getClassLoader() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public void declareRoles(String... roleNames) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public String getVirtualServerName() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public String getContextPath() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public Dynamic addJspFile(String servletName, String jspFile) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public int getSessionTimeout() {\n      return 0;\n    }\n\n    @Override\n    public void setSessionTimeout(int sessionTimeout) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public String getRequestCharacterEncoding() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public void setRequestCharacterEncoding(String encoding) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public String getResponseCharacterEncoding() {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n\n    @Override\n    public void setResponseCharacterEncoding(String encoding) {\n      throw new UnsupportedOperationException(\"not yet implemented\");\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/AbsentPatternTest.java",
    "content": "/*\n * Copyright (C) 2019-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Test;\n\npublic class AbsentPatternTest {\n\n  @Test\n  public void correctlyDeserializesFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\n            \"{                             \\n\" + \"  \\\"absent\\\": \\\"(absent)\\\"    \\n\" + \"}\",\n            StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(AbsentPattern.class));\n    assertThat(stringValuePattern.isAbsent(), is(true));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    AbsentPattern a = new AbsentPattern(\"someString\");\n    AbsentPattern b = new AbsentPattern(\"someString\");\n    AbsentPattern c = new AbsentPattern(\"someOtherString\");\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/AfterDateTimePatternTest.java",
    "content": "/*\n * Copyright (C) 2021-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.allOf;\nimport static org.hamcrest.Matchers.greaterThan;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.lessThan;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.DateTimeOffset;\nimport com.github.tomakehurst.wiremock.common.DateTimeTruncation;\nimport com.github.tomakehurst.wiremock.common.DateTimeUnit;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.time.LocalDateTime;\nimport java.time.ZonedDateTime;\nimport java.time.temporal.ChronoUnit;\nimport org.junit.jupiter.api.Test;\n\npublic class AfterDateTimePatternTest {\n\n  @Test\n  public void matchesZonedToZoned() {\n    StringValuePattern matcher = WireMock.after(\"2021-06-14T12:13:14Z\");\n\n    assertTrue(matcher.match(\"2022-06-14T12:13:14Z\").isExactMatch());\n    assertFalse(matcher.match(\"2020-06-14T12:13:14Z\").isExactMatch());\n  }\n\n  @Test\n  public void matchesLocalToLocal() {\n    StringValuePattern matcher = WireMock.after(\"2021-06-14T12:13:14\");\n\n    assertTrue(matcher.match(\"2022-06-14T12:13:14\").isExactMatch());\n    assertFalse(matcher.match(\"2020-06-14T12:13:14\").isExactMatch());\n  }\n\n  @Test\n  public void matchesLocalToZoned() {\n    StringValuePattern matcher = WireMock.after(\"2021-06-14T12:13:14\");\n\n    assertTrue(matcher.match(\"2022-06-14T12:13:14Z\").isExactMatch());\n    assertFalse(matcher.match(\"2020-06-14T12:13:14Z\").isExactMatch());\n  }\n\n  @Test\n  public void matchesZonedExpectedWithLocalActual() {\n    StringValuePattern matcher = WireMock.after(\"2021-06-14T15:15:15Z\");\n\n    assertTrue(matcher.match(\"2021-07-01T23:59:59\").isExactMatch());\n    assertFalse(matcher.match(\"2021-06-01T15:15:15\").isExactMatch());\n  }\n\n  @Test\n  public void matchesZonedToNowOffset() {\n    StringValuePattern matcher = WireMock.afterNow().expectedOffset(27, DateTimeUnit.MINUTES);\n\n    ZonedDateTime good = ZonedDateTime.now().plusHours(1);\n    ZonedDateTime bad = ZonedDateTime.now().minusMinutes(1);\n    assertTrue(matcher.match(good.toString()).isExactMatch());\n    assertFalse(matcher.match(bad.toString()).isExactMatch());\n  }\n\n  @Test\n  public void matchesNowWithExpectedAndActualTruncated() {\n    StringValuePattern matcher =\n        WireMock.afterNow()\n            .truncateExpected(DateTimeTruncation.FIRST_DAY_OF_MONTH)\n            .truncateActual(DateTimeTruncation.LAST_DAY_OF_MONTH);\n\n    ZonedDateTime good = ZonedDateTime.now();\n    ZonedDateTime bad = ZonedDateTime.now().minusMonths(1).minusHours(1);\n\n    assertTrue(matcher.match(good.toString()).isExactMatch());\n    assertFalse(matcher.match(bad.toString()).isExactMatch());\n  }\n\n  @Test\n  public void doesNotMatchWhenActualValueIsNull() {\n    StringValuePattern matcher = WireMock.after(\"2021-06-14T15:15:15Z\");\n    assertFalse(matcher.match(null).isExactMatch());\n  }\n\n  @Test\n  public void returnsAReasonableDistanceWhenNoMatchForLocalExpectedZonedActual() {\n    StringValuePattern matcher = WireMock.after(\"2021-01-01T00:00:00Z\");\n    assertThat(matcher.match(\"2023-01-01T00:00:00Z\").getDistance(), is(0.5));\n    assertThat(\n        matcher.match(\"1921-01-01T00:00:00Z\").getDistance(),\n        allOf(greaterThan(0.5), lessThan(1.0)));\n    assertThat(matcher.match(null).getDistance(), is(1.0));\n    assertThat(\n        matcher.match(\"2020-01-01T00:00:00Z\").getDistance(),\n        allOf(greaterThan(0.0), lessThan(0.5)));\n  }\n\n  @Test\n  public void serialisesToJson() {\n    AfterDateTimePattern matcher =\n        WireMock.afterNow()\n            .expectedOffset(DateTimeOffset.fromString(\"now -5 days\"))\n            .truncateExpected(DateTimeTruncation.LAST_DAY_OF_MONTH)\n            .truncateActual(DateTimeTruncation.FIRST_DAY_OF_YEAR);\n\n    assertThat(\n        Json.write(matcher),\n        jsonEquals(\n            \"{\\n\"\n                + \"  \\\"after\\\": \\\"now -5 days\\\",\\n\"\n                + \"  \\\"truncateExpected\\\": \\\"last day of month\\\",\\n\"\n                + \"  \\\"truncateActual\\\": \\\"first day of year\\\"\\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void deserialisesFromJson() {\n    AfterDateTimePattern matcher =\n        Json.read(\n            \"{\\n\"\n                + \"  \\\"after\\\": \\\"now\\\",\\n\"\n                + \"  \\\"truncateExpected\\\": \\\"first hour of day\\\",\\n\"\n                + \"  \\\"truncateActual\\\": \\\"last day of year\\\",\\n\"\n                + \"  \\\"applyTruncationLast\\\": true\\n\"\n                + \"}\",\n            AfterDateTimePattern.class);\n\n    assertThat(matcher.getExpected(), is(\"now +0 seconds\"));\n    assertThat(matcher.getTruncateExpected(), is(\"first hour of day\"));\n    assertThat(matcher.getTruncateActual(), is(\"last day of year\"));\n    assertTrue(matcher.getApplyTruncationLast());\n  }\n\n  @Test\n  public void deserialisesOffsetWithSeparateAmountAndUnitAttributesFromJson() {\n    AfterDateTimePattern matcher =\n        Json.read(\n            \"{\\n\"\n                + \"  \\\"after\\\": \\\"now\\\",\\n\"\n                + \"  \\\"expectedOffset\\\": -15,\\n\"\n                + \"  \\\"expectedOffsetUnit\\\": \\\"days\\\"\\n\"\n                + \"}\\n\",\n            AfterDateTimePattern.class);\n\n    ZonedDateTime good = ZonedDateTime.now().minus(14, ChronoUnit.DAYS);\n    ZonedDateTime bad = ZonedDateTime.now().minus(16, ChronoUnit.DAYS);\n\n    assertTrue(matcher.match(good.toString()).isExactMatch());\n    assertFalse(matcher.match(bad.toString()).isExactMatch());\n  }\n\n  @Test\n  public void acceptsJavaZonedDateTimeAsExpected() {\n    AfterDateTimePattern matcher = WireMock.after(ZonedDateTime.parse(\"2020-08-29T00:00:00Z\"));\n    assertTrue(matcher.match(\"2021-01-01T00:00:00Z\").isExactMatch());\n  }\n\n  @Test\n  public void acceptsJavaLocalDateTimeAsExpected() {\n    AfterDateTimePattern matcher = WireMock.after(LocalDateTime.parse(\"2020-08-29T00:00:00\"));\n    assertTrue(matcher.match(\"2021-01-01T00:00:00\").isExactMatch());\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    AfterDateTimePattern a = WireMock.after(LocalDateTime.parse(\"2020-08-29T00:00:00\"));\n    AfterDateTimePattern b = WireMock.after(LocalDateTime.parse(\"2020-08-29T00:00:00\"));\n    AfterDateTimePattern c = WireMock.after(LocalDateTime.parse(\"2022-01-01T10:10:10\"));\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/BeforeDateTimePatternTest.java",
    "content": "/*\n * Copyright (C) 2021-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.DateTimeTruncation.*;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.allOf;\nimport static org.hamcrest.Matchers.greaterThan;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.lessThan;\nimport static org.hamcrest.Matchers.nullValue;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.DateTimeUnit;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.time.LocalDateTime;\nimport java.time.ZonedDateTime;\nimport java.time.temporal.ChronoUnit;\nimport java.time.temporal.TemporalAdjuster;\nimport java.time.temporal.TemporalAdjusters;\nimport org.junit.jupiter.api.Test;\n\npublic class BeforeDateTimePatternTest {\n\n  @Test\n  public void matchesZonedISO8601BeforeZonedLiteralDateTime() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T15:15:15Z\");\n\n    assertTrue(matcher.match(\"2021-06-01T15:15:15Z\").isExactMatch());\n    assertFalse(matcher.match(\"2021-07-01T23:59:59Z\").isExactMatch());\n  }\n\n  @Test\n  public void matchesZonedExpectedWithLocalActual() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T15:15:15Z\");\n\n    assertTrue(matcher.match(\"2021-06-01T15:15:15\").isExactMatch());\n    assertFalse(matcher.match(\"2021-07-01T23:59:59\").isExactMatch());\n  }\n\n  @Test\n  public void matchesLocalISO8601BeforeLocalLiteralDateTime() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T15:15:15\");\n\n    assertTrue(matcher.match(\"2021-06-01T15:15:15\").isExactMatch());\n    assertFalse(matcher.match(\"2021-07-01T23:59:59\").isExactMatch());\n  }\n\n  @Test\n  public void matchesZonedISO8601BeforeLocalLiteralDateTime() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T15:15:15\");\n\n    assertTrue(matcher.match(\"2021-06-01T15:15:15Z\").isExactMatch());\n    assertFalse(matcher.match(\"2021-07-01T23:59:59Z\").isExactMatch());\n  }\n\n  @Test\n  public void doesNotMatchWhenActualValueUnparseable() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T15:15:15\");\n    assertFalse(matcher.match(\"2021-06-01T15:15:blahsdfj123\").isExactMatch());\n  }\n\n  @Test\n  public void doesNotMatchWhenActualValueIsNull() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T15:15:15\");\n    assertFalse(matcher.match(null).isExactMatch());\n  }\n\n  @Test\n  public void doesNotMatchWhenExpectedValueUnparseable() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-wrongstuff:15:15\");\n    assertFalse(matcher.match(\"2021-06-01T15:15:15Z\").isExactMatch());\n  }\n\n  @Test\n  public void returnsAReasonableDistanceWhenNoMatchForZonedExpectedZonedActual() {\n    StringValuePattern matcher = WireMock.before(\"2021-01-01T00:00:00Z\");\n    assertThat(matcher.match(\"2023-01-01T00:00:00Z\").getDistance(), is(0.5));\n    assertThat(\n        matcher.match(\"2121-01-01T00:00:00Z\").getDistance(),\n        allOf(greaterThan(0.5), lessThan(1.0)));\n    assertThat(matcher.match(null).getDistance(), is(1.0));\n    assertThat(\n        matcher.match(\"2022-01-01T00:00:00Z\").getDistance(),\n        allOf(greaterThan(0.0), lessThan(0.5)));\n  }\n\n  @Test\n  public void returnsAReasonableDistanceWhenNoMatchForLocalExpectedZonedActual() {\n    StringValuePattern matcher = WireMock.before(\"2021-01-01T00:00:00\");\n    assertThat(matcher.match(\"2023-01-01T00:00:00Z\").getDistance(), is(0.5));\n    assertThat(\n        matcher.match(\"2121-01-01T00:00:00Z\").getDistance(),\n        allOf(greaterThan(0.5), lessThan(1.0)));\n    assertThat(matcher.match(null).getDistance(), is(1.0));\n    assertThat(\n        matcher.match(\"2022-01-01T00:00:00Z\").getDistance(),\n        allOf(greaterThan(0.0), lessThan(0.5)));\n  }\n\n  @Test\n  public void returnsAReasonableDistanceWhenNoMatchForLocalExpectedLocalActual() {\n    StringValuePattern matcher = WireMock.before(\"2021-01-01T00:00:00\");\n    assertThat(matcher.match(\"2023-01-01T00:00:00\").getDistance(), is(0.5));\n    assertThat(\n        matcher.match(\"2121-01-01T00:00:00\").getDistance(), allOf(greaterThan(0.5), lessThan(1.0)));\n    assertThat(matcher.match(null).getDistance(), is(1.0));\n    assertThat(\n        matcher.match(\"2022-01-01T00:00:00\").getDistance(), allOf(greaterThan(0.0), lessThan(0.5)));\n  }\n\n  @Test\n  public void matchesZonedRFC1123ActualDate() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T15:15:15Z\");\n\n    assertTrue(matcher.match(\"Tue, 01 Jun 2021 15:16:17 GMT\").isExactMatch());\n    assertFalse(matcher.match(\"Thu, 01 Jul 2021 15:16:17 GMT\").isExactMatch());\n  }\n\n  @Test\n  public void matchesZonedRFC1036ActualDate() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T15:15:15Z\");\n\n    assertTrue(matcher.match(\"Tuesday, 01-Jun-21 14:14:14 GMT\").isExactMatch());\n    assertFalse(matcher.match(\"Thursday, 01-Jul-21 15:16:17 GMT\").isExactMatch());\n  }\n\n  @Test\n  public void matchesZonedSingleDigitDayAsctimeActualDate() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T01:01:01Z\");\n\n    assertTrue(matcher.match(\"Tue Jun  1 01:01:01 2021\").isExactMatch());\n    assertFalse(matcher.match(\"Thu Jul  1 01:01:01 2021\").isExactMatch());\n  }\n\n  @Test\n  public void matchesZonedDoubleDigitDayAsctimeActualDate() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T01:01:01Z\");\n\n    assertTrue(matcher.match(\"Thu Jun 10 01:01:01 2021\").isExactMatch());\n    assertFalse(matcher.match(\"Sat Jul 10 01:01:01 2021\").isExactMatch());\n  }\n\n  @Test\n  public void matchesNonUTCZonedISO8601ActualDate() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14T15:15:15Z\");\n\n    assertTrue(matcher.match(\"2021-06-14T15:15:15+01:00[Europe/London]\").isExactMatch());\n    assertFalse(matcher.match(\"2021-06-14T16:15:15+01:00[Europe/London]\").isExactMatch());\n  }\n\n  @Test\n  public void matchesActualDateAccordingToSpecifiedFormat() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-14\").actualFormat(\"dd/MM/yyyy\");\n\n    assertTrue(matcher.match(\"01/06/2021\").isExactMatch());\n    assertFalse(matcher.match(\"01/07/2021\").isExactMatch());\n  }\n\n  @Test\n  public void matchesAgainstNow() {\n    StringValuePattern matcher = WireMock.beforeNow();\n\n    String right = ZonedDateTime.now().minusDays(2).toString();\n    assertTrue(matcher.match(right).isExactMatch());\n\n    String wrong = ZonedDateTime.now().plusHours(4).toString();\n    assertFalse(matcher.match(wrong).isExactMatch());\n  }\n\n  @Test\n  public void matchesAgainstOffsetFromNow() {\n    StringValuePattern matcher = WireMock.before(\"now -5 days\");\n\n    String right = ZonedDateTime.now().minusDays(7).toString();\n    assertTrue(matcher.match(right).isExactMatch());\n\n    String wrong = ZonedDateTime.now().minusDays(4).toString();\n    assertFalse(matcher.match(wrong).isExactMatch());\n  }\n\n  @Test\n  public void truncatesExpectedDateToSpecifiedUnit() {\n    StringValuePattern matcher =\n        WireMock.before(\"15 days\")\n            .truncateExpected(FIRST_DAY_OF_MONTH); // Before the 15th of this month\n\n    TemporalAdjuster truncateToMonth = TemporalAdjusters.firstDayOfMonth();\n    ZonedDateTime good = ZonedDateTime.now().with(truncateToMonth).plus(14, ChronoUnit.DAYS);\n    ZonedDateTime bad = ZonedDateTime.now().with(truncateToMonth).plus(16, ChronoUnit.DAYS);\n\n    assertTrue(matcher.match(good.toString()).isExactMatch());\n    assertFalse(matcher.match(bad.toString()).isExactMatch());\n  }\n\n  @Test\n  public void truncatesActualDateToSpecifiedUnit() {\n    StringValuePattern matcher =\n        WireMock.before(\"15 days\")\n            .truncateExpected(FIRST_DAY_OF_MONTH)\n            .truncateActual(LAST_DAY_OF_MONTH);\n\n    ZonedDateTime good = ZonedDateTime.now().minusMonths(1); // A month ago from now\n    ZonedDateTime bad =\n        ZonedDateTime.now()\n            .with(TemporalAdjusters.lastDayOfMonth())\n            .minusDays(1); // Second-last day of this month\n\n    assertTrue(matcher.match(good.toString()).isExactMatch());\n    assertFalse(matcher.match(bad.toString()).isExactMatch());\n  }\n\n  @Test\n  public void serialisesLiteralDateTimeAndFormatFormToJson() {\n    StringValuePattern matcher = WireMock.before(\"2021-06-01T00:00:00\").actualFormat(\"dd/MM/yyyy\");\n\n    assertThat(\n        Json.write(matcher),\n        jsonEquals(\n            \"{\\n\"\n                + \"  \\\"before\\\": \\\"2021-06-01T00:00:00\\\",\\n\"\n                + \"  \\\"actualFormat\\\": \\\"dd/MM/yyyy\\\"\\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void serialisesOffsetWithActualTruncationFormToJson() {\n    StringValuePattern matcher =\n        WireMock.beforeNow()\n            .expectedOffset(15, DateTimeUnit.DAYS)\n            .truncateActual(FIRST_DAY_OF_MONTH);\n\n    assertThat(\n        Json.write(matcher),\n        jsonEquals(\n            \"{\\n\"\n                + \"  \\\"before\\\": \\\"now +15 days\\\",\\n\"\n                + \"  \\\"truncateActual\\\": \\\"first day of month\\\"\\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void serialisesOffsetWithExpectedAndActualTruncationFormToJson() {\n    StringValuePattern matcher =\n        WireMock.beforeNow()\n            .expectedOffset(15, DateTimeUnit.DAYS)\n            .truncateExpected(FIRST_HOUR_OF_DAY)\n            .truncateActual(FIRST_DAY_OF_MONTH);\n\n    assertThat(\n        Json.write(matcher),\n        jsonEquals(\n            \"{\\n\"\n                + \"  \\\"before\\\": \\\"now +15 days\\\",\\n\"\n                + \"  \\\"truncateExpected\\\": \\\"first hour of day\\\",\\n\"\n                + \"  \\\"truncateActual\\\": \\\"first day of month\\\"\\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void deserialisesLiteralDateAndTimeWithFormatFromJson() {\n    BeforeDateTimePattern matcher =\n        Json.read(\n            \"{\\n\"\n                + \"  \\\"before\\\": \\\"2021-06-15T00:00:00\\\",\\n\"\n                + \"  \\\"actualFormat\\\": \\\"dd/MM/yyyy\\\"\\n\"\n                + \"}\",\n            BeforeDateTimePattern.class);\n\n    assertThat(matcher.getExpected(), is(\"2021-06-15T00:00:00\"));\n    assertThat(matcher.getActualFormat(), is(\"dd/MM/yyyy\"));\n    assertNull(matcher.getApplyTruncationLast());\n  }\n\n  @Test\n  public void deserialisesPositiveOffsetAndTruncateFormFromJson() {\n    BeforeDateTimePattern matcher =\n        Json.read(\n            \"{\\n\"\n                + \"  \\\"before\\\": \\\"15 days\\\",\\n\"\n                + \"  \\\"truncateActual\\\": \\\"first day of year\\\",\\n\"\n                + \"  \\\"applyTruncationLast\\\": true\\n\"\n                + \"}\",\n            BeforeDateTimePattern.class);\n\n    assertThat(matcher.getTruncateExpected(), nullValue());\n    assertThat(matcher.getTruncateActual(), is(\"first day of year\"));\n    assertTrue(matcher.getApplyTruncationLast());\n  }\n\n  @Test\n  public void deserialisesNegativeOffsetFormFromJson() {\n    StringValuePattern matcher =\n        Json.read(\"{\\n\" + \"  \\\"before\\\": \\\"-15 days\\\"\\n\" + \"}\", BeforeDateTimePattern.class);\n\n    ZonedDateTime good = ZonedDateTime.now().minus(16, ChronoUnit.DAYS);\n    ZonedDateTime bad = ZonedDateTime.now().minus(14, ChronoUnit.DAYS);\n\n    assertTrue(matcher.match(good.toString()).isExactMatch());\n    assertFalse(matcher.match(bad.toString()).isExactMatch());\n  }\n\n  @Test\n  public void deserialisesOffsetWithSeparateAmountAndUnitAttributesFromJson() {\n    BeforeDateTimePattern matcher =\n        Json.read(\n            \"{\\n\"\n                + \"  \\\"before\\\": \\\"now\\\",\\n\"\n                + \"  \\\"expectedOffset\\\": -15,\\n\"\n                + \"  \\\"expectedOffsetUnit\\\": \\\"days\\\"\\n\"\n                + \"}\\n\",\n            BeforeDateTimePattern.class);\n\n    ZonedDateTime good = ZonedDateTime.now().minus(16, ChronoUnit.DAYS);\n    ZonedDateTime bad = ZonedDateTime.now().minus(14, ChronoUnit.DAYS);\n\n    assertTrue(matcher.match(good.toString()).isExactMatch());\n    assertFalse(matcher.match(bad.toString()).isExactMatch());\n  }\n\n  @Test\n  public void acceptsJavaZonedDateTimeAsExpected() {\n    BeforeDateTimePattern matcher = WireMock.before(ZonedDateTime.parse(\"2020-08-29T00:00:00Z\"));\n    assertTrue(matcher.match(\"2019-01-01T00:00:00Z\").isExactMatch());\n  }\n\n  @Test\n  public void acceptsJavaLocalDateTimeAsExpected() {\n    BeforeDateTimePattern matcher = WireMock.before(LocalDateTime.parse(\"2020-08-29T00:00:00\"));\n    assertTrue(matcher.match(\"2019-01-01T00:00:00\").isExactMatch());\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    BeforeDateTimePattern a = WireMock.before(LocalDateTime.parse(\"2020-08-29T00:00:00\"));\n    BeforeDateTimePattern b = WireMock.before(LocalDateTime.parse(\"2020-08-29T00:00:00\"));\n    BeforeDateTimePattern c = WireMock.before(LocalDateTime.parse(\"2022-01-01T10:10:10\"));\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/BinaryEqualToPatternPatternTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\nimport static org.skyscreamer.jsonassert.JSONAssert.assertEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.util.Base64;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\nclass BinaryEqualToPatternPatternTest {\n\n  @Test\n  void returns1ForNonMatch() {\n    ValueMatcher<byte[]> pattern = WireMock.binaryEqualTo(new byte[] {1, 2, 3});\n    byte[] actual = {4, 5, 6};\n\n    MatchResult match = pattern.match(actual);\n\n    assertThat(match.getDistance(), is(1.0));\n    assertThat(match.isExactMatch(), is(false));\n  }\n\n  @Test\n  void returns0WhenExactlyEqual() {\n    ValueMatcher<byte[]> pattern = WireMock.binaryEqualTo(new byte[] {1, 2, 3});\n    byte[] actual = {1, 2, 3};\n\n    MatchResult match = pattern.match(actual);\n\n    assertThat(match.getDistance(), is(0.0));\n    assertThat(match.isExactMatch(), is(true));\n  }\n\n  @Test\n  void returnsNonMatchWheActualIsNull() {\n    ValueMatcher<byte[]> pattern = WireMock.binaryEqualTo(new byte[] {1, 2, 3});\n    byte[] actual = null;\n\n    MatchResult match = pattern.match(actual);\n\n    assertThat(match.getDistance(), is(1.0));\n    assertThat(match.isExactMatch(), is(false));\n  }\n\n  @Test\n  void serialisesCorrectly() throws Exception {\n    byte[] expected = {5, 5, 5, 5};\n    String base64Expected = Base64.getEncoder().encodeToString(expected);\n    String expectedJson =\n        \"{                                                   \\n\"\n            + \"  \\\"binaryEqualTo\\\": \\\"\"\n            + base64Expected\n            + \"\\\"     \\n\"\n            + \"}\";\n    assertEquals(expectedJson, Json.write(new BinaryEqualToPattern(expected)), true);\n  }\n\n  @Test\n  @SuppressWarnings(\"unchecked\")\n  void deserializesCorrectly() {\n    String base64Expected = Base64.getEncoder().encodeToString(new byte[] {1, 2, 3});\n\n    ContentPattern<byte[]> pattern =\n        Json.read(\n            \"{                                              \\n\"\n                + \"  \\\"binaryEqualTo\\\": \\\"\"\n                + base64Expected\n                + \"\\\"    \\n\"\n                + \"}\",\n            ContentPattern.class);\n\n    assertThat(pattern, instanceOf(BinaryEqualToPattern.class));\n    assertThat(pattern.getExpected(), is(base64Expected));\n  }\n\n  @Test\n  void objectsShouldBeEqualOnSameExpectedValue() {\n    BinaryEqualToPattern a = new BinaryEqualToPattern(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10});\n    BinaryEqualToPattern b = new BinaryEqualToPattern(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10});\n    BinaryEqualToPattern c = new BinaryEqualToPattern(new byte[] {0, 8, 15});\n\n    Assertions.assertEquals(a, b);\n    Assertions.assertEquals(a.hashCode(), b.hashCode());\n    Assertions.assertEquals(b, a);\n    Assertions.assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/ContainsPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport org.junit.jupiter.api.Test;\n\npublic class ContainsPatternTest {\n\n  @Test\n  public void returnsExactMatchWhenExpectedValueWhollyContainedInTestValue() {\n    assertTrue(WireMock.containing(\"thing\").match(\"mythings\").isExactMatch());\n  }\n\n  @Test\n  public void returnsNoMatchWhenExpectedValueNotContainedInTestValue() {\n    MatchResult matchResult = WireMock.containing(\"thing\").match(\"otherstuff\");\n    assertFalse(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    ContainsPattern a = new ContainsPattern(\"someString\");\n    ContainsPattern b = new ContainsPattern(\"someString\");\n    ContainsPattern c = new ContainsPattern(\"someOtherString\");\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/EqualToDateTimePatternTest.java",
    "content": "/*\n * Copyright (C) 2021-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static java.time.temporal.ChronoUnit.DAYS;\nimport static java.time.temporal.ChronoUnit.HOURS;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.allOf;\nimport static org.hamcrest.Matchers.greaterThan;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.lessThan;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.DateTimeOffset;\nimport com.github.tomakehurst.wiremock.common.DateTimeTruncation;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.http.MultiValue;\nimport com.google.common.collect.Lists;\nimport java.time.*;\nimport java.time.format.DateTimeFormatter;\nimport java.time.temporal.TemporalAdjusters;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.MockedStatic;\nimport org.mockito.Mockito;\n\npublic class EqualToDateTimePatternTest {\n\n  @Test\n  public void matchesZonedToZoned() {\n    StringValuePattern matcher = WireMock.equalToDateTime(\"2021-06-14T12:13:14Z\");\n\n    assertTrue(matcher.match(\"2021-06-14T12:13:14Z\").isExactMatch());\n    assertFalse(matcher.match(\"1921-06-14T12:13:14Z\").isExactMatch());\n  }\n\n  @Test\n  public void matchesLiteralDateTimesWithDifferentZones() {\n    StringValuePattern matcher = WireMock.equalToDateTime(\"2021-06-24T13:40:27+01:00\");\n\n    assertTrue(matcher.match(\"2021-06-24T12:40:27Z\").isExactMatch());\n    assertFalse(matcher.match(\"2021-06-24T13:40:27Z\").isExactMatch());\n  }\n\n  @Test\n  public void matchesLocalToLocal() {\n    StringValuePattern matcher = WireMock.equalToDateTime(\"2021-06-14T12:13:14\");\n\n    assertTrue(matcher.match(\"2021-06-14T12:13:14\").isExactMatch());\n    assertFalse(matcher.match(\"1921-06-14T12:13:14\").isExactMatch());\n  }\n\n  @Test\n  public void matchesLocalToZoned() {\n    StringValuePattern matcher = WireMock.equalToDateTime(\"2021-06-14T12:13:14\");\n\n    assertTrue(matcher.match(\"2021-06-14T12:13:14Z\").isExactMatch());\n    assertFalse(matcher.match(\"1921-06-14T12:13:14Z\").isExactMatch());\n  }\n\n  @Test\n  public void matchesZonedToLocal() {\n    String localExpected = \"2021-06-14T12:13:14\";\n    String zonedExpected =\n        LocalDateTime.parse(localExpected).atZone(ZoneId.systemDefault()).toString();\n    StringValuePattern matcher = WireMock.equalToDateTime(zonedExpected);\n\n    String good = localExpected;\n    String bad = LocalDateTime.parse(localExpected).minusSeconds(1).toString();\n\n    assertTrue(matcher.match(good).isExactMatch());\n    assertFalse(matcher.match(bad).isExactMatch());\n  }\n\n  @Test\n  public void matchesNowToYearMonth() {\n    YearMonth currentYearMonth = YearMonth.now();\n    YearMonth previousYearMonth = currentYearMonth.minusMonths(1);\n    StringValuePattern matcher =\n        WireMock.isNow().truncateExpected(DateTimeTruncation.FIRST_DAY_OF_MONTH);\n\n    String good = currentYearMonth.toString();\n    String bad = previousYearMonth.toString();\n\n    assertTrue(matcher.match(good).isExactMatch());\n    assertFalse(matcher.match(bad).isExactMatch());\n  }\n\n  @Test\n  public void matchesNowToYearMonthInCustomFormat() {\n    YearMonth currentYearMonth = YearMonth.now();\n    StringValuePattern matcher =\n        WireMock.isNow()\n            .truncateExpected(DateTimeTruncation.FIRST_DAY_OF_MONTH)\n            .actualFormat(\"MM/yyyy\");\n\n    String good = currentYearMonth.format(DateTimeFormatter.ofPattern(\"MM/yyyy\"));\n    String bad = currentYearMonth.toString();\n\n    assertTrue(matcher.match(good).isExactMatch());\n    assertFalse(matcher.match(bad).isExactMatch());\n  }\n\n  @Test\n  public void matchesNowToYear() {\n    Year currentYear = Year.now();\n    Year previousYear = currentYear.minusYears(1);\n    StringValuePattern matcher =\n        WireMock.isNow().truncateExpected(DateTimeTruncation.FIRST_DAY_OF_YEAR);\n\n    String good = currentYear.toString();\n    String bad = previousYear.toString();\n\n    assertTrue(matcher.match(good).isExactMatch());\n    assertFalse(matcher.match(bad).isExactMatch());\n  }\n\n  @Test\n  public void matchesNowToYearInCustomFormat() {\n    Year currentYear = Year.now();\n    StringValuePattern matcher =\n        WireMock.isNow().truncateExpected(DateTimeTruncation.FIRST_DAY_OF_YEAR).actualFormat(\"yy\");\n\n    String good = currentYear.format(DateTimeFormatter.ofPattern(\"yy\"));\n    String bad = currentYear.toString();\n\n    assertTrue(matcher.match(good).isExactMatch());\n    assertFalse(matcher.match(bad).isExactMatch());\n  }\n\n  @Test\n  public void matchesActualInUnixTimeFormat() {\n    String dateTime = \"2021-06-14T12:13:14Z\";\n    StringValuePattern matcher = WireMock.equalToDateTime(dateTime).actualFormat(\"unix\");\n\n    String good = String.valueOf(Instant.parse(dateTime).getEpochSecond());\n    String bad = String.valueOf(Instant.parse(dateTime).minusMillis(10).getEpochSecond());\n\n    assertTrue(matcher.match(good).isExactMatch());\n    assertFalse(matcher.match(bad).isExactMatch());\n  }\n\n  @Test\n  public void matchesActualInEpochTimeFormat() {\n    String dateTime = \"2021-06-14T12:13:14Z\";\n    StringValuePattern matcher = WireMock.equalToDateTime(dateTime).actualFormat(\"epoch\");\n\n    String good = String.valueOf(Instant.parse(dateTime).toEpochMilli());\n    String bad = String.valueOf(Instant.parse(dateTime).minusMillis(10).toEpochMilli());\n\n    assertTrue(matcher.match(good).isExactMatch());\n    assertFalse(matcher.match(bad).isExactMatch());\n  }\n\n  @Test\n  public void doesNotMatchWhenActualValueIsNull() {\n    StringValuePattern matcher = WireMock.equalToDateTime(\"2021-06-14T12:13:14Z\");\n    assertFalse(matcher.match(null).isExactMatch());\n  }\n\n  @Test\n  public void returnsAReasonableDistanceWhenNoMatchForLocalExpectedZonedActual() {\n    StringValuePattern matcher = WireMock.equalToDateTime(\"2021-01-01T00:00:00Z\");\n    assertThat(matcher.match(\"2023-01-01T00:00:00Z\").getDistance(), is(0.5));\n    assertThat(\n        matcher.match(\"2121-01-01T00:00:00Z\").getDistance(),\n        allOf(greaterThan(0.5), lessThan(1.0)));\n    assertThat(matcher.match(null).getDistance(), is(1.0));\n    assertThat(\n        matcher.match(\"2022-01-01T00:00:00Z\").getDistance(),\n        allOf(greaterThan(0.0), lessThan(0.5)));\n  }\n\n  @Test\n  public void serialisesToJson() {\n    EqualToDateTimePattern matcher =\n        WireMock.isNow()\n            .expectedOffset(DateTimeOffset.fromString(\"now -5 days\"))\n            .truncateExpected(DateTimeTruncation.LAST_DAY_OF_MONTH)\n            .truncateActual(DateTimeTruncation.FIRST_DAY_OF_YEAR)\n            .applyTruncationLast(true);\n\n    assertThat(\n        Json.write(matcher),\n        jsonEquals(\n            \"{\\n\"\n                + \"  \\\"equalToDateTime\\\": \\\"now -5 days\\\",\\n\"\n                + \"  \\\"truncateExpected\\\": \\\"last day of month\\\",\\n\"\n                + \"  \\\"truncateActual\\\": \\\"first day of year\\\",\\n\"\n                + \"  \\\"applyTruncationLast\\\": true\\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void deserialisesFromJson() {\n    StringValuePattern matcher =\n        Json.read(\n            \"{\\n\"\n                + \"  \\\"equalToDateTime\\\": \\\"now\\\",\\n\"\n                + \"  \\\"truncateExpected\\\": \\\"first hour of day\\\",\\n\"\n                + \"  \\\"truncateActual\\\": \\\"first hour of day\\\"\\n\"\n                + \"}\",\n            EqualToDateTimePattern.class);\n\n    ZonedDateTime good = ZonedDateTime.now().truncatedTo(DAYS);\n    ZonedDateTime bad = ZonedDateTime.now().truncatedTo(DAYS).minus(5, HOURS);\n\n    assertTrue(matcher.match(good.toString()).isExactMatch());\n    assertFalse(matcher.match(bad.toString()).isExactMatch());\n  }\n\n  @Test\n  public void deserialisesFromJsonWithApplyTruncationLast() {\n    AbstractDateTimePattern matcher =\n        Json.read(\n            \"{\\n\"\n                + \"  \\\"equalToDateTime\\\": \\\"now\\\",\\n\"\n                + \"  \\\"expectedOffset\\\": 1,\\n\"\n                + \"  \\\"expectedOffsetUnit\\\": \\\"months\\\",\\n\"\n                + \"  \\\"truncateExpected\\\": \\\"last day of month\\\",\\n\"\n                + \"  \\\"applyTruncationLast\\\": true\\n\"\n                + \"}\",\n            EqualToDateTimePattern.class);\n\n    ZonedDateTime february1st = ZonedDateTime.parse(\"2024-02-01T00:00:00Z\");\n\n    ZonedDateTime march31st = february1st.plusMonths(1).with(TemporalAdjusters.lastDayOfMonth());\n\n    ZonedDateTime march29th = february1st.with(TemporalAdjusters.lastDayOfMonth()).plusMonths(1);\n\n    // Mock static method ZonedDateTime::now so that it always returns 2024-02-01\n    try (MockedStatic<ZonedDateTime> mockedZonedDateTime =\n        Mockito.mockStatic(ZonedDateTime.class, Mockito.CALLS_REAL_METHODS)) {\n      mockedZonedDateTime.when(ZonedDateTime::now).thenReturn(february1st);\n\n      // Matcher expects March 31st when applyTruncationLast is set to true\n      assertTrue(matcher.match(march31st.toString()).isExactMatch());\n\n      AbstractDateTimePattern matcherWithApplyTruncationLast = matcher.applyTruncationLast(false);\n\n      // Matcher expects March 29th when applyTruncationLast is set to false\n      assertTrue(matcherWithApplyTruncationLast.match(march29th.toString()).isExactMatch());\n    }\n  }\n\n  @Test\n  public void acceptsJavaZonedDateTimeAsExpected() {\n    EqualToDateTimePattern matcher =\n        WireMock.equalToDateTime(ZonedDateTime.parse(\"2020-08-29T00:00:00Z\"));\n    assertTrue(matcher.match(\"2020-08-29T00:00:00Z\").isExactMatch());\n  }\n\n  @Test\n  public void acceptsJavaLocalDateTimeAsExpected() {\n    EqualToDateTimePattern matcher =\n        WireMock.equalToDateTime(LocalDateTime.parse(\"2020-08-29T00:00:00\"));\n    assertTrue(matcher.match(\"2020-08-29T00:00:00\").isExactMatch());\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    EqualToDateTimePattern a = WireMock.equalToDateTime(LocalDateTime.parse(\"2020-08-29T00:00:00\"));\n    EqualToDateTimePattern b = WireMock.equalToDateTime(LocalDateTime.parse(\"2020-08-29T00:00:00\"));\n    EqualToDateTimePattern c = WireMock.equalToDateTime(LocalDateTime.parse(\"2022-01-10T10:10:10\"));\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n\n  @Test\n  public void matchesMultipleZonedToMultipleLocalUsingHavingExactly() {\n    String local1 = \"2024-03-27T00:00:00\";\n    String zoned1 = LocalDateTime.parse(local1).atZone(ZoneId.systemDefault()).toString();\n    String local2 = \"2024-03-28T00:00:00\";\n    String zoned2 = LocalDateTime.parse(local2).atZone(ZoneId.systemDefault()).toString();\n    MultiValuePattern matcher =\n        WireMock.havingExactly(WireMock.equalToDateTime(zoned1), WireMock.equalToDateTime(zoned2));\n\n    MultiValue good = new MultiValue(\"dateTimes\", Lists.newArrayList(local1, local2));\n    MultiValue bad =\n        new MultiValue(\n            \"dateTimes\",\n            Lists.newArrayList(local1, LocalDateTime.parse(local2).minusSeconds(1).toString()));\n\n    assertTrue(matcher.match(good).isExactMatch());\n    assertFalse(matcher.match(bad).isExactMatch());\n  }\n\n  @Test\n  public void matchesMultipleZonedToMultipleLocalUsingIncluding() {\n    String local1 = \"2024-03-27T00:00:00\";\n    String zoned1 = LocalDateTime.parse(local1).atZone(ZoneId.systemDefault()).toString();\n    String local2 = \"2024-03-28T00:00:00\";\n    String zoned2 = LocalDateTime.parse(local2).atZone(ZoneId.systemDefault()).toString();\n    MultiValuePattern matcher =\n        WireMock.including(WireMock.equalToDateTime(zoned1), WireMock.equalToDateTime(zoned2));\n    String local3 = \"2024-03-29T00:00:00\";\n\n    MultiValue good = new MultiValue(\"dateTimes\", Lists.newArrayList(local1, local2, local3));\n    MultiValue bad =\n        new MultiValue(\n            \"dateTimes\",\n            Lists.newArrayList(\n                local1, LocalDateTime.parse(local2).minusSeconds(1).toString(), local3));\n\n    assertTrue(matcher.match(good).isExactMatch());\n    assertFalse(matcher.match(bad).isExactMatch());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/EqualToJsonTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.json.JSONException;\nimport org.junit.jupiter.api.Test;\nimport org.skyscreamer.jsonassert.JSONAssert;\n\npublic class EqualToJsonTest {\n\n  @Test\n  public void returns0DistanceForExactMatchForSingleLevelObject() {\n    assertThat(\n        WireMock.equalToJson(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .match(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .getDistance(),\n        is(0.0));\n  }\n\n  @Test\n  public void returnsNon0DistanceForPartialMatchForSingleLevelObject() {\n    assertThat(\n        WireMock.equalToJson(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .match(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  7,  \\n\"\n                    + \"   \\\"four\\\":   8   \\n\"\n                    + \"}                  \\n\")\n            .getDistance(),\n        is(0.4));\n  }\n\n  @Test\n  public void returnsLargeDistanceForTotallyDifferentDocuments() {\n    assertThat(\n        WireMock.equalToJson(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .match(\"[1, 2, 3]\")\n            .getDistance(),\n        is(1.0));\n  }\n\n  @Test\n  public void returnsLargeDistanceWhenActualDocIsAnEmptyObject() {\n    assertThat(\n        WireMock.equalToJson(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .match(\"{}\")\n            .getDistance(),\n        is(0.8));\n  }\n\n  @Test\n  public void returnsLargeDistanceWhenActualDocIsAnEmptyArray() {\n    assertThat(\n        WireMock.equalToJson(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .match(\"[]\")\n            .getDistance(),\n        is(1.0));\n  }\n\n  @Test\n  public void returnsLargeDistanceWhenExpectedDocIsAnEmptyObject() {\n    assertThat(\n        WireMock.equalToJson(\"{}\")\n            .match(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .getDistance(),\n        is(0.8));\n  }\n\n  @Test\n  public void returnsLargeDistanceWhenExpectedDocIsAnEmptyArray() {\n    assertThat(\n        WireMock.equalToJson(\"[]\")\n            .match(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .getDistance(),\n        is(1.0));\n  }\n\n  @Test\n  public void returnsMediumDistanceWhenSubtreeIsMissingFromActual() {\n    assertThat(\n        WireMock.equalToJson(\n                \"{\\n\"\n                    + \"    \\\"one\\\": \\\"GET\\\",          \\n\"\n                    + \"    \\\"two\\\": 2,                \\n\"\n                    + \"    \\\"three\\\": {               \\n\"\n                    + \"        \\\"four\\\": \\\"FOUR\\\",    \\n\"\n                    + \"        \\\"five\\\": [            \\n\"\n                    + \"            {                  \\n\"\n                    + \"                \\\"six\\\": 6,    \\n\"\n                    + \"                \\\"seven\\\": 7   \\n\"\n                    + \"            },                 \\n\"\n                    + \"            {                  \\n\"\n                    + \"                \\\"eight\\\": 8,  \\n\"\n                    + \"                \\\"nine\\\": 9    \\n\"\n                    + \"            }                  \\n\"\n                    + \"        ]                      \\n\"\n                    + \"    }                          \\n\"\n                    + \"}\")\n            .match(\n                \"{                          \\n\"\n                    + \"   \\\"one\\\":    \\\"GET\\\",    \\n\"\n                    + \"   \\\"two\\\":    2,          \\n\"\n                    + \"   \\\"three\\\":  {           \\n\"\n                    + \"       \\\"four\\\":   \\\"FOUR\\\"\\n\"\n                    + \"   }                       \\n\"\n                    + \"}                          \\n\")\n            .getDistance(),\n        closeTo(0.56, 0.01));\n  }\n\n  @Test\n  public void returnsExactMatchWhenObjectPropertyOrderDiffers() {\n    assertTrue(\n        WireMock.equalToJson(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .match(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void returnsNonMatchWhenArrayOrderDiffers() {\n    assertFalse(WireMock.equalToJson(\"[1, 2, 3, 4]\").match(\"[1, 3, 2, 4]\").isExactMatch());\n  }\n\n  @Test\n  public void ignoresArrayOrderDifferenceWhenConfigured() {\n    assertTrue(\n        WireMock.equalToJson(\"[1, 2, 3, 4]\", true, false).match(\"[1, 3, 2, 4]\").isExactMatch());\n  }\n\n  @Test\n  public void ignoresNestedArrayOrderDifferenceWhenConfigured() {\n    assertTrue(\n        WireMock.equalToJson(\n                \"{\\n\"\n                    + \"    \\\"one\\\": 1,\\n\"\n                    + \"    \\\"two\\\": [\\n\"\n                    + \"        { \\\"val\\\": 1 },\\n\"\n                    + \"        { \\\"val\\\": 2 },\\n\"\n                    + \"        { \\\"val\\\": 3 }\\n\"\n                    + \"    ]\\n\"\n                    + \"}\",\n                true,\n                false)\n            .match(\n                \"{\\n\"\n                    + \"    \\\"one\\\": 1,\\n\"\n                    + \"    \\\"two\\\": [\\n\"\n                    + \"        { \\\"val\\\": 3 },\\n\"\n                    + \"        { \\\"val\\\": 2 },\\n\"\n                    + \"        { \\\"val\\\": 1 }\\n\"\n                    + \"    ]\\n\"\n                    + \"}\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void ignoresExtraObjectAttributesWhenConfigured() {\n    assertTrue(\n        WireMock.equalToJson(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"four\\\":   4   \\n\"\n                    + \"}                  \\n\",\n                false,\n                true)\n            .match(\n                \"{                  \\n\"\n                    + \"   \\\"one\\\":    1,  \\n\"\n                    + \"   \\\"three\\\":  3,  \\n\"\n                    + \"   \\\"two\\\":    2,  \\n\"\n                    + \"   \\\"four\\\":   4,  \\n\"\n                    + \"   \\\"five\\\":   5,  \\n\"\n                    + \"   \\\"six\\\":    6   \\n\"\n                    + \"}                  \\n\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void ignoresExtraObjectAttributesAndArrayOrderWhenConfigured() {\n    assertTrue(\n        WireMock.equalToJson(\n                \"{                          \\n\"\n                    + \"   \\\"one\\\":    1,          \\n\"\n                    + \"   \\\"two\\\":    2,          \\n\"\n                    + \"   \\\"three\\\":  3,          \\n\"\n                    + \"   \\\"four\\\":   [1, 2, 3]   \\n\"\n                    + \"}                  \\n\",\n                true,\n                true)\n            .match(\n                \"{                          \\n\"\n                    + \"   \\\"one\\\":    1,          \\n\"\n                    + \"   \\\"three\\\":  3,          \\n\"\n                    + \"   \\\"two\\\":    2,          \\n\"\n                    + \"   \\\"four\\\":   [2, 1, 3],  \\n\"\n                    + \"   \\\"five\\\":   5,          \\n\"\n                    + \"   \\\"six\\\":    6           \\n\"\n                    + \"}                          \\n\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void correctlyDeserialisesFromJsonStringWhenAdditionalParamsPresent() {\n    StringValuePattern pattern =\n        Json.read(\n            \"{\\n\"\n                + \"    \\\"equalToJson\\\": \\\"2\\\",\\n\"\n                + \"    \\\"ignoreArrayOrder\\\": true,\\n\"\n                + \"    \\\"ignoreExtraElements\\\": true\\n\"\n                + \"}\",\n            StringValuePattern.class);\n\n    assertThat(pattern, instanceOf(EqualToJsonPattern.class));\n    assertThat(((EqualToJsonPattern) pattern).isIgnoreArrayOrder(), is(true));\n    assertThat(((EqualToJsonPattern) pattern).isIgnoreExtraElements(), is(true));\n    assertThat(pattern.getExpected(), is(\"2\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesFromJsonValueWhenAdditionalParamsPresent() throws JSONException {\n    String expectedJson = \"{ \\\"someKey\\\": \\\"someValue\\\" }\";\n    String serializedJson =\n        \"{                                           \\n\"\n            + \"    \\\"equalToJson\\\": \"\n            + expectedJson\n            + \",  \\n\"\n            + \"    \\\"ignoreArrayOrder\\\": true,             \\n\"\n            + \"    \\\"ignoreExtraElements\\\": true           \\n\"\n            + \"}                                             \";\n    StringValuePattern pattern = Json.read(serializedJson, StringValuePattern.class);\n\n    assertThat(pattern, instanceOf(EqualToJsonPattern.class));\n    assertThat(((EqualToJsonPattern) pattern).isIgnoreArrayOrder(), is(true));\n    assertThat(((EqualToJsonPattern) pattern).isIgnoreExtraElements(), is(true));\n    JSONAssert.assertEquals(pattern.getExpected(), expectedJson, false);\n  }\n\n  @Test\n  public void correctlySerialisesToJsonValueWhenAdditionalParamsPresentAndConstructedWithJsonValue()\n      throws JSONException {\n    String expectedJson = \"{ \\\"someKey\\\": \\\"someValue\\\" }\";\n    EqualToJsonPattern pattern = new EqualToJsonPattern(Json.node(expectedJson), true, true);\n\n    String serialised = Json.write(pattern);\n    String expected =\n        \"{                                           \\n\"\n            + \"    \\\"equalToJson\\\": \"\n            + expectedJson\n            + \",  \\n\"\n            + \"    \\\"ignoreArrayOrder\\\": true,             \\n\"\n            + \"    \\\"ignoreExtraElements\\\": true           \\n\"\n            + \"}                                             \";\n    JSONAssert.assertEquals(expected, serialised, false);\n  }\n\n  @Test\n  public void correctlySerialisesToJsonWhenAdditionalParamsPresentAndConstructedWithString()\n      throws JSONException {\n    EqualToJsonPattern pattern = new EqualToJsonPattern(\"4444\", true, true);\n\n    String serialised = Json.write(pattern);\n    JSONAssert.assertEquals(\n        \"{\\n\"\n            + \"    \\\"equalToJson\\\": \\\"4444\\\",\\n\"\n            + \"    \\\"ignoreArrayOrder\\\": true,\\n\"\n            + \"    \\\"ignoreExtraElements\\\": true\\n\"\n            + \"}\",\n        serialised,\n        false);\n  }\n\n  @Test\n  public void correctlyDeserialisesFromJsonStringWhenAdditionalParamsAbsent() {\n    StringValuePattern pattern =\n        Json.read(\"{\\n\" + \"    \\\"equalToJson\\\": \\\"2\\\"\\n\" + \"}\", StringValuePattern.class);\n\n    assertThat(pattern, instanceOf(EqualToJsonPattern.class));\n    assertThat(((EqualToJsonPattern) pattern).isIgnoreArrayOrder(), is(nullValue()));\n    assertThat(((EqualToJsonPattern) pattern).isIgnoreExtraElements(), is(nullValue()));\n    assertThat(pattern.getExpected(), is(\"2\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesFromJsonValueWhenAdditionalParamsAbsent() throws JSONException {\n    String expectedJson = \"[ 1, 2, \\\"value\\\" ]\";\n    StringValuePattern pattern =\n        Json.read(\"{ \\\"equalToJson\\\": \" + expectedJson + \" }\", StringValuePattern.class);\n\n    assertThat(pattern, instanceOf(EqualToJsonPattern.class));\n    assertThat(((EqualToJsonPattern) pattern).isIgnoreArrayOrder(), is(nullValue()));\n    assertThat(((EqualToJsonPattern) pattern).isIgnoreExtraElements(), is(nullValue()));\n    JSONAssert.assertEquals(pattern.getExpected(), expectedJson, false);\n  }\n\n  @Test\n  public void correctlySerialisesToJsonWhenAdditionalParamsAbsentAndConstructedWithJsonValue()\n      throws JSONException {\n    String expectedJson = \"[ 1, 2, \\\"value\\\" ]\";\n    EqualToJsonPattern pattern = new EqualToJsonPattern(Json.node(expectedJson), null, null);\n\n    String serialised = Json.write(pattern);\n    JSONAssert.assertEquals(\"{ \\\"equalToJson\\\": \" + expectedJson + \" }\", serialised, false);\n  }\n\n  @Test\n  public void correctlySerialisesToJsonWhenAdditionalParamsAbsent() throws JSONException {\n    EqualToJsonPattern pattern = new EqualToJsonPattern(\"4444\", null, null);\n\n    String serialised = Json.write(pattern);\n    JSONAssert.assertEquals(\"{\\n\" + \"    \\\"equalToJson\\\": \\\"4444\\\"\\n\" + \"}\", serialised, false);\n  }\n\n  @Test\n  public void returnsNoExactMatchForVerySimilarNestedDocs() {\n    assertFalse(\n        new EqualToJsonPattern(\n                \"{\\n\"\n                    + \"    \\\"outer\\\": {\\n\"\n                    + \"        \\\"inner:\\\": {\\n\"\n                    + \"            \\\"wrong\\\": 1\\n\"\n                    + \"        }\\n\"\n                    + \"    }\\n\"\n                    + \"}\",\n                false,\n                false)\n            .match(\n                \"{\\n\"\n                    + \"    \\\"outer\\\": {\\n\"\n                    + \"        \\\"inner:\\\": {\\n\"\n                    + \"            \\\"thing\\\": 1\\n\"\n                    + \"        }\\n\"\n                    + \"    }\\n\"\n                    + \"}\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void doesNotMatchWhenValueIsNull() {\n    MatchResult match =\n        new EqualToJsonPattern(\n                \"{\\n\"\n                    + \"    \\\"outer\\\": {\\n\"\n                    + \"        \\\"inner:\\\": {\\n\"\n                    + \"            \\\"wrong\\\": 1\\n\"\n                    + \"        }\\n\"\n                    + \"    }\\n\"\n                    + \"}\",\n                false,\n                false)\n            .match(null);\n\n    assertFalse(match.isExactMatch());\n    assertThat(match.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void doesNotMatchWhenValueIsEmptyString() {\n    MatchResult match =\n        new EqualToJsonPattern(\n                \"{\\n\"\n                    + \"    \\\"outer\\\": {\\n\"\n                    + \"        \\\"inner:\\\": {\\n\"\n                    + \"            \\\"wrong\\\": 1\\n\"\n                    + \"        }\\n\"\n                    + \"    }\\n\"\n                    + \"}\",\n                false,\n                false)\n            .match(\"\");\n\n    assertFalse(match.isExactMatch());\n    assertThat(match.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void doesNotMatchWhenValueIsNotJson() {\n    MatchResult match =\n        new EqualToJsonPattern(\n                \"{\\n\"\n                    + \"    \\\"outer\\\": {\\n\"\n                    + \"        \\\"inner:\\\": {\\n\"\n                    + \"            \\\"wrong\\\": 1\\n\"\n                    + \"        }\\n\"\n                    + \"    }\\n\"\n                    + \"}\",\n                false,\n                false)\n            .match(\"<some-xml />\");\n\n    assertFalse(match.isExactMatch());\n    assertThat(match.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void doesNotBreakWhenComparingNestedArraysOfDifferentSizes() {\n    String expected =\n        \"{\\\"columns\\\": [{\\\"name\\\": \\\"agreementnumber\\\",\\\"a\\\": 1},{\\\"name\\\": \\\"utilizerstatus\\\",\\\"b\\\": 2}]}\";\n    String actual =\n        \"{\\\"columns\\\": [{\\\"name\\\": \\\"x\\\",\\\"y\\\": 3},{\\\"name\\\": \\\"agreementnumber\\\",\\\"a\\\": 1},{\\\"name\\\": \\\"agreementstatus\\\",\\\"b\\\": 2}]}\";\n\n    MatchResult match = new EqualToJsonPattern(expected, false, false).match(actual);\n\n    assertFalse(match.isExactMatch());\n  }\n\n  @Test\n  public void doesNotBreakWhenComparingTopLevelArraysOfDifferentSizesWithCommonElements() {\n    String expected =\n        \"[    \\n\"\n            + \"  { \\\"one\\\": 1 },  \\n\"\n            + \"  { \\\"two\\\": 2 },  \\n\"\n            + \"  { \\\"three\\\": 3 } \\n\"\n            + \"]\";\n    String actual =\n        \"[      \\n\"\n            + \"  { \\\"zero\\\": 0 }, \\n\"\n            + \"  { \\\"one\\\": 1 },  \\n\"\n            + \"  { \\\"two\\\": 2 },  \\n\"\n            + \"  { \\\"four\\\": 4 }  \\n\"\n            + \"]\";\n\n    MatchResult match = new EqualToJsonPattern(expected, false, false).match(actual);\n\n    assertFalse(match.isExactMatch());\n  }\n\n  @Test\n  public void ignoresExtraElementsWhenParameterIsPresentsWithoutIgnoreArrayOrder() {\n    StringValuePattern pattern =\n        Json.read(\n            \"{\\n\"\n                + \"    \\\"equalToJson\\\": { \\\"one\\\": 1 },\\n\"\n                + \"    \\\"ignoreExtraElements\\\": true\\n\"\n                + \"}\",\n            StringValuePattern.class);\n\n    assertThat(\n        pattern.match(\"{\\n\" + \"    \\\"one\\\": 1,\\n\" + \"    \\\"two\\\": 2\\n\" + \"}\").isExactMatch(),\n        is(true));\n  }\n\n  @Test\n  public void doesNotMatchEmptyArraysWhenNotIgnoringExtraElements() {\n    String expected = \"{\\\"client\\\":\\\"AAA\\\",\\\"name\\\":\\\"BBB\\\"}\";\n    String actual = \"{\\\"client\\\":\\\"AAA\\\", \\\"name\\\":\\\"BBB\\\", \\\"addresses\\\": [ ]}\";\n\n    MatchResult match = new EqualToJsonPattern(expected, false, false).match(actual);\n\n    assertFalse(match.isExactMatch());\n  }\n\n  @Test\n  public void doesNotMatchEmptyArrayWhenIgnoringExtraArrayElementsAndNotIgnoringExtraElements() {\n    String expected = \"{\\\"client\\\":\\\"AAA\\\",\\\"name\\\":\\\"BBB\\\"}\";\n    String actual = \"{\\\"client\\\":\\\"AAA\\\", \\\"name\\\":\\\"BBB\\\", \\\"addresses\\\": [ ]}\";\n\n    MatchResult match = new EqualToJsonPattern(expected, true, false).match(actual);\n\n    assertFalse(match.isExactMatch());\n  }\n\n  @Test\n  public void doesNotMatchEmptyObjectWhenIgnoringExtraArrayElementsAndNotIgnoringExtraElements() {\n    String expected = \"{\\\"client\\\":\\\"AAA\\\",\\\"name\\\":\\\"BBB\\\"}\";\n    String actual = \"{\\\"client\\\":\\\"AAA\\\", \\\"name\\\":\\\"BBB\\\", \\\"addresses\\\": { }}\";\n\n    MatchResult match = new EqualToJsonPattern(expected, true, false).match(actual);\n\n    assertFalse(match.isExactMatch());\n  }\n\n  @Test\n  public void treatsTwoTopLevelsArraysWithDifferingOrderAsSameWhenIgnoringOrder() {\n    String expected = \"[\\\"a\\\",\\\"b\\\", \\\"c\\\",\\\"d\\\",\\\"e\\\",\\\"f\\\",\\\"g\\\",\\\"h\\\"]\";\n    String actual = \"[\\\"b\\\",\\\"a\\\", \\\"d\\\",\\\"c\\\",\\\"e\\\",\\\"f\\\",\\\"g\\\",\\\"h\\\"]\";\n\n    EqualToJsonPattern pattern = new EqualToJsonPattern(expected, true, true);\n    MatchResult result = pattern.match(actual);\n\n    assertTrue(result.isExactMatch());\n  }\n\n  @Test\n  public void supportsPlaceholders() {\n    String expected =\n        \"{\\n\" + \"  \\\"id\\\": \\\"${json-unit.any-string}\\\",\\n\" + \"  \\\"name\\\": \\\"Tom\\\"\\n\" + \"}\";\n\n    String actual = \"{\\n\" + \"  \\\"id\\\": \\\"abc123\\\",\\n\" + \"  \\\"name\\\": \\\"Tom\\\"\\n\" + \"}\";\n\n    MatchResult match = new EqualToJsonPattern(expected, false, false).match(actual);\n    assertThat(match.isExactMatch(), is(true));\n  }\n\n  @Test\n  public void supportsRegexPlaceholders() {\n    String expected =\n        \"{\\n\" + \"  \\\"id\\\": \\\"${json-unit.regex}[a-z]+\\\",\\n\" + \"  \\\"name\\\": \\\"Tom\\\"\\n\" + \"}\";\n\n    String actualMatching = \"{\\n\" + \"  \\\"id\\\": \\\"abc\\\",\\n\" + \"  \\\"name\\\": \\\"Tom\\\"\\n\" + \"}\";\n    MatchResult match = new EqualToJsonPattern(expected, false, false).match(actualMatching);\n    assertThat(match.isExactMatch(), is(true));\n\n    String actualNonMatching = \"{\\n\" + \"  \\\"id\\\": \\\"123\\\",\\n\" + \"  \\\"name\\\": \\\"Tom\\\"\\n\" + \"}\";\n    MatchResult nonMatch = new EqualToJsonPattern(expected, false, false).match(actualNonMatching);\n    assertThat(nonMatch.isExactMatch(), is(false));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    EqualToJsonPattern a =\n        new EqualToJsonPattern(\n            \"{\\n\" + \"  \\\"id\\\": \\\"abc\\\",\\n\" + \"  \\\"name\\\": \\\"Tom\\\"\\n\" + \"}\", false, false);\n    EqualToJsonPattern b =\n        new EqualToJsonPattern(\n            \"{\\n\" + \"  \\\"id\\\": \\\"abc\\\",\\n\" + \"  \\\"name\\\": \\\"Tom\\\"\\n\" + \"}\", false, false);\n    EqualToJsonPattern c =\n        new EqualToJsonPattern(\n            \"{\\n\" + \"  \\\"id\\\": \\\"123\\\",\\n\" + \"  \\\"name\\\": \\\"Eric\\\"\\n\" + \"}\", false, false);\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n\n  @Test\n  void subEventIsReturnedOnJsonParsingError() {\n    MatchResult match = new EqualToJsonPattern(\"{}\", false, false).match(\"{ \\\"wrong\");\n\n    assertThat(match.getSubEvents().size(), is(1));\n    Errors.Error error =\n        match.getSubEvents().stream()\n            .findFirst()\n            .get()\n            .getDataAs(Errors.class)\n            .getErrors()\n            .stream()\n            .findFirst()\n            .get();\n    assertThat(error.getDetail(), startsWith(\"Unexpected end-of-input\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/EqualToNumberPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.skyscreamer.jsonassert.JSONAssert.assertEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\npublic class EqualToNumberPatternTest {\n\n  @Test\n  public void failsForNoMatchOnEqualsInt() {\n    StringValuePattern pattern = WireMock.equalToNumber(5);\n    assertFalse(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void failsForNoMatchOnEqualsIntContains() {\n    StringValuePattern pattern = WireMock.equalToNumber(1);\n    assertFalse(pattern.match(\"1111\").isExactMatch());\n    assertThat(pattern.match(\"1111\").getDistance(), is(0.04));\n  }\n\n  @Test\n  public void failsForNoMatchOnEqualsFloat() {\n    StringValuePattern pattern = WireMock.equalToNumber(5.5);\n    assertFalse(pattern.match(\"1.1\").isExactMatch());\n    assertThat(pattern.match(\"1.1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnEqualsInt() {\n    StringValuePattern pattern = WireMock.equalToNumber(1);\n    assertTrue(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnEqualsFloat() {\n    StringValuePattern pattern = WireMock.equalToNumber(1.1111);\n    assertTrue(pattern.match(\"1.1111\").isExactMatch());\n    assertThat(pattern.match(\"1.1111\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnEqualsFloatWithExtraDecimals() {\n    StringValuePattern pattern = WireMock.equalToNumber(1.1111);\n    assertTrue(pattern.match(\"0001.1111000\").isExactMatch());\n    assertThat(pattern.match(\"0001.1111000\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void correctlyDeserialisesEqualToNumberWithStringValueFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"equalToNumber\\\": \\\"1\\\" }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(EqualToNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesEqualToNumberWithNumberValueFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"equalToNumber\\\": 1 }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(EqualToNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlySerialisesToJson() throws Exception {\n    assertEquals(\"{ \\\"equalToNumber\\\": 1 }\", Json.write(new EqualToNumberPattern(1)), false);\n  }\n\n  @Test\n  public void noMatchOnNullValue() {\n    assertThat(WireMock.equalToNumber(1).match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void noMatchOnStringValue() {\n    assertThat(WireMock.equalToNumber(1).match(\"a string\").isExactMatch(), is(false));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    var a = new EqualToNumberPattern(1);\n    var b = new EqualToNumberPattern(1);\n    var c = new EqualToNumberPattern(2);\n\n    Assertions.assertEquals(a, b);\n    Assertions.assertEquals(a.hashCode(), b.hashCode());\n    Assertions.assertEquals(b, a);\n    Assertions.assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/EqualToPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\nimport static org.junit.jupiter.api.Assertions.fail;\nimport static org.skyscreamer.jsonassert.JSONAssert.assertEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\npublic class EqualToPatternTest {\n\n  @Test\n  public void returnsANonZeroScoreForPartialMatchOnEquals() {\n    StringValuePattern pattern = WireMock.equalTo(\"matchthis\");\n    assertThat(pattern.match(\"matchthisbadlydone\").getDistance(), is(0.5));\n  }\n\n  @Test\n  public void returns1ForNoMatchOnEquals() {\n    StringValuePattern pattern = WireMock.equalTo(\"matchthis\");\n    assertThat(pattern.match(\"924387348975923\").getDistance(), is(1.0));\n  }\n\n  @Test\n  public void returns0ForExactMatchOnEquals() {\n    StringValuePattern pattern = WireMock.equalTo(\"matchthis\");\n    assertThat(pattern.match(\"matchthis\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void matchesCaseInsensitive() {\n    StringValuePattern pattern = WireMock.equalToIgnoreCase(\"MaTchtHis\");\n    assertThat(pattern.match(\"matchthis\").isExactMatch(), is(true));\n  }\n\n  @Test\n  public void correctlyDeserialisesEqualToFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\n            \"{                               \\n\" + \"  \\\"equalTo\\\": \\\"something\\\"    \\n\" + \"}\",\n            StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(EqualToPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"something\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesEqualToFromJsonWithIgnoreCase() {\n    StringValuePattern stringValuePattern =\n        Json.read(\n            \"{                              \\n\"\n                + \"  \\\"equalTo\\\": \\\"something\\\",   \\n\"\n                + \"  \\\"caseInsensitive\\\": true     \\n\"\n                + \"}\",\n            StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(EqualToPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"something\"));\n    assertThat(((EqualToPattern) stringValuePattern).getCaseInsensitive(), is(true));\n  }\n\n  @Test\n  public void correctlySerialisesToJson() throws Exception {\n    assertEquals(\n        \"{                               \\n\" + \"  \\\"equalTo\\\": \\\"something\\\"    \\n\" + \"}\",\n        Json.write(new EqualToPattern(\"something\")),\n        false);\n  }\n\n  @Test\n  public void failsWithMeaningfulErrorWhenOperatorNotRecognised() {\n    try {\n      Json.read(\n          \"{                               \\n\" + \"  \\\"munches\\\": \\\"something\\\"    \\n\" + \"}\",\n          StringValuePattern.class);\n\n      fail();\n    } catch (Exception e) {\n      assertThat(e, instanceOf(JsonException.class));\n      JsonException jsonException = (JsonException) e;\n      assertThat(\n          jsonException.getErrors().first().getDetail(),\n          containsString(\"{\\\"munches\\\":\\\"something\\\"} is not a valid match operation\"));\n    }\n  }\n\n  @Test\n  public void noMatchOnNullValue() {\n    assertThat(WireMock.equalTo(\"this_thing\").match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    EqualToPattern a = new EqualToPattern(\"someString\");\n    EqualToPattern b = new EqualToPattern(\"someString\");\n    EqualToPattern c = new EqualToPattern(\"someOtherString\");\n\n    Assertions.assertEquals(a, b);\n    Assertions.assertEquals(a.hashCode(), b.hashCode());\n    Assertions.assertEquals(b, a);\n    Assertions.assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/EqualToXmlPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalToXml;\nimport static org.hamcrest.CoreMatchers.equalTo;\nimport static org.hamcrest.CoreMatchers.not;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.*;\nimport static org.mockito.ArgumentMatchers.contains;\nimport static org.mockito.Mockito.verify;\nimport static org.xmlunit.diff.ComparisonType.ATTR_VALUE;\nimport static org.xmlunit.diff.ComparisonType.NAMESPACE_PREFIX;\nimport static org.xmlunit.diff.ComparisonType.NAMESPACE_URI;\nimport static org.xmlunit.diff.ComparisonType.SCHEMA_LOCATION;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.xml.XmlException;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMatchers;\nimport java.util.Locale;\nimport java.util.Set;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.mockito.Mockito;\nimport org.skyscreamer.jsonassert.JSONCompareMode;\n\npublic class EqualToXmlPatternTest {\n\n  @RegisterExtension public WireMockExtension wm = WireMockExtension.newInstance().build();\n\n  @BeforeEach\n  public void init() {\n    LocalNotifier.set(new ConsoleNotifier(true));\n\n    // We assert English XML parser error messages in this test. So we set our default locale to\n    // English to make\n    // this test succeed even for users with non-English default locales.\n    Locale.setDefault(Locale.ENGLISH);\n  }\n\n  @AfterEach\n  public void cleanup() {\n    LocalNotifier.set(null);\n  }\n\n  @Test\n  public void returnsNoMatchAnd1DistanceWhenActualIsNull() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<things>\\n\"\n                + \"    <thing characteristic=\\\"tepid\\\"/>\\n\"\n                + \"    <thing characteristic=\\\"tedious\\\"/>\\n\"\n                + \"</things>\");\n\n    MatchResult matchResult = pattern.match(null);\n\n    assertFalse(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void returnsNoMatchAnd1DistanceWhenActualIsEmpty() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<things>\\n\"\n                + \"    <thing characteristic=\\\"tepid\\\"/>\\n\"\n                + \"    <thing characteristic=\\\"tedious\\\"/>\\n\"\n                + \"</things>\");\n\n    MatchResult matchResult = pattern.match(\"\");\n\n    assertFalse(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void returnsNoMatchAnd1DistanceWhenActualIsNotXml() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<things>\\n\"\n                + \"    <thing characteristic=\\\"tepid\\\"/>\\n\"\n                + \"    <thing characteristic=\\\"tedious\\\"/>\\n\"\n                + \"</things>\");\n\n    MatchResult matchResult = pattern.match(\"{ \\\"markup\\\": \\\"wrong\\\" }\");\n\n    assertFalse(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void returnsExactMatchWhenDocumentsAreIdentical() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<things>\\n\"\n                + \"    <thing characteristic=\\\"tepid\\\"/>\\n\"\n                + \"    <thing characteristic=\\\"tedious\\\"/>\\n\"\n                + \"</things>\");\n\n    assertTrue(\n        pattern\n            .match(\n                \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\\n\"\n                    + \"<things>\\n\"\n                    + \"    <thing characteristic=\\\"tepid\\\"/>\\n\"\n                    + \"    <thing characteristic=\\\"tedious\\\"/>\\n\"\n                    + \"</things>\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void returnsExactMatchWhenDocumentsAreIdenticalOtherThanWhitespace() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<things>\\n\"\n                + \"    <thing characteristic=\\\"tepid\\\"/>\\n\"\n                + \"    <thing characteristic=\\\"tedious\\\"/>\\n\"\n                + \"</things>\");\n\n    assertTrue(\n        pattern\n            .match(\n                \"<things><thing characteristic=\\\"tepid\\\"/><thing characteristic=\\\"tedious\\\"/></things>\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void returnsNoMatchWhenDocumentsAreTotallyDifferent() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<things>\\n\"\n                + \"    <thing characteristic=\\\"tepid\\\"/>\\n\"\n                + \"    <thing characteristic=\\\"tedious\\\"/>\\n\"\n                + \"</things>\");\n\n    MatchResult matchResult = pattern.match(\"<no-things-at-all />\");\n\n    assertFalse(matchResult.isExactMatch());\n    assertThat(\n        matchResult.getDistance(), is(0.5)); // Not high enough really, some more tweaking needed\n  }\n\n  @Test\n  public void returnsLowDistanceWhenActualDocumentHasMissingElement() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<things>\\n\"\n                + \"    <thing characteristic=\\\"tepid\\\"/>\\n\"\n                + \"    <thing characteristic=\\\"tedious\\\"/>\\n\"\n                + \"</things>\");\n\n    MatchResult matchResult =\n        pattern.match(\"<things>\\n\" + \"    <thing characteristic=\\\"tepid\\\"/>\\n\" + \"</things>\");\n\n    assertThat(matchResult.getDistance(), closeTo(0.14, 2));\n  }\n\n  @Test\n  public void legacyNamespaceAwarenessReturnsExactMatchOnNamespacedXml() {\n    EqualToXmlPattern pattern =\n        equalToXml(\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\"\n                + \"<soap:Envelope xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\" xmlns:soap=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n\"\n                + \"    <soap:Body>\\n\"\n                + \"        <stuff xmlns=\\\"https://example.com/mynamespace\\\">\\n\"\n                + \"            <things />\\n\"\n                + \"        </stuff>\\n\"\n                + \"    </soap:Body>\\n\"\n                + \"</soap:Envelope>\\n\",\n            EqualToXmlPattern.NamespaceAwareness.LEGACY);\n\n    MatchResult match =\n        pattern.match(\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\"\n                + \"<soap:Envelope xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\" xmlns:soap=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n\"\n                + \"    <soap:Body>\\n\"\n                + \"        <stuff xmlns=\\\"https://example.com/mynamespace\\\">\\n\"\n                + \"            <things />\\n\"\n                + \"        </stuff>\\n\"\n                + \"    </soap:Body>\\n\"\n                + \"</soap:Envelope>\\n\");\n\n    assertThat(match.getDistance(), is(0.0));\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void\n      legacyNamespaceAwarenessReturnsExactMatchOnNamespacedXmlWhenNamespacePrefixesDiffer() {\n    EqualToXmlPattern pattern =\n        equalToXml(\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\"\n                + \"<shampoo:Envelope xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\" xmlns:shampoo=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n\"\n                + \"    <shampoo:Body>\\n\"\n                + \"        <stuff xmlns=\\\"https://example.com/mynamespace\\\">\\n\"\n                + \"            <things />\\n\"\n                + \"        </stuff>\\n\"\n                + \"    </shampoo:Body>\\n\"\n                + \"</shampoo:Envelope>\\n\",\n            EqualToXmlPattern.NamespaceAwareness.LEGACY);\n\n    MatchResult match =\n        pattern.match(\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\"\n                + \"<soap:Envelope xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\" xmlns:soap=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n\"\n                + \"    <soap:Body>\\n\"\n                + \"        <stuff xmlns=\\\"https://example.com/mynamespace\\\">\\n\"\n                + \"            <things />\\n\"\n                + \"        </stuff>\\n\"\n                + \"    </soap:Body>\\n\"\n                + \"</soap:Envelope>\\n\");\n\n    assertThat(match.getDistance(), is(0.0));\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void legacyNamespaceAwarenessDoesNotReturnExactMatchWhenDefaultNamespaceUriDiffers() {\n    EqualToXmlPattern pattern =\n        equalToXml(\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\"\n                + \"<soap:Envelope xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\" xmlns:soap=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n\"\n                + \"    <soap:Body>\\n\"\n                + \"        <stuff xmlns=\\\"https://example.com/mynamespace\\\">\\n\"\n                + \"            <things />\\n\"\n                + \"        </stuff>\\n\"\n                + \"    </soap:Body>\\n\"\n                + \"</soap:Envelope>\\n\",\n            EqualToXmlPattern.NamespaceAwareness.LEGACY);\n\n    assertFalse(\n        pattern\n            .match(\n                \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\"\n                    + \"<soap:Envelope xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\" xmlns:soap=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n\"\n                    + \"    <soap:Body>\\n\"\n                    + \"        <stuff xmlns=\\\"https://example.com/the-wrong-namespace\\\">\\n\"\n                    + \"            <things />\\n\"\n                    + \"        </stuff>\\n\"\n                    + \"    </soap:Body>\\n\"\n                    + \"</soap:Envelope>\\n\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void returnsExactMatchWhenAttributesAreInDifferentOrder() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\"<my-attribs one=\\\"1\\\" two=\\\"2\\\" three=\\\"3\\\"/>\");\n    assertTrue(pattern.match(\"<my-attribs two=\\\"2\\\" one=\\\"1\\\" three=\\\"3\\\"/>\").isExactMatch());\n  }\n\n  @Test\n  public void returnsExactMatchWhenElementsAreInDifferentOrder() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<my-elements>\\n\"\n                + \"    <one />\\n\"\n                + \"    <two />\\n\"\n                + \"    <three />\\n\"\n                + \"</my-elements>\");\n\n    assertTrue(\n        pattern\n            .match(\n                \"<my-elements>\\n\"\n                    + \"    <two />\\n\"\n                    + \"    <three />\\n\"\n                    + \"    <one />\\n\"\n                    + \"</my-elements>\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void returnsNoMatchWhenTagNamesDifferAndContentIsSame() {\n    final EqualToXmlPattern pattern = new EqualToXmlPattern(\"<one>Hello</one>\");\n    final MatchResult matchResult = pattern.match(\"<two>Hello</two>\");\n\n    assertThat(matchResult.isExactMatch(), equalTo(false));\n    assertThat(matchResult.getDistance(), not(equalTo(0.0)));\n  }\n\n  @Test\n  public void logsASensibleErrorMessageWhenActualXmlIsBadlyFormed() {\n    Notifier notifier = Mockito.mock(Notifier.class);\n    LocalNotifier.set(notifier);\n    equalToXml(\"<well-formed />\").match(\"badly-formed >\").isExactMatch();\n    verify(notifier).info(contains(\"Failed to process XML. Content is not allowed in prolog.\"));\n  }\n\n  @Test\n  public void doesNotFetchDtdBecauseItCouldResultInAFailedMatch() {\n    String xmlWithDtdThatCannotBeFetched =\n        \"<!DOCTYPE my_request SYSTEM \\\"https://thishostname.doesnotexist.com/one.dtd\\\"><do_request/>\";\n    EqualToXmlPattern pattern = new EqualToXmlPattern(xmlWithDtdThatCannotBeFetched);\n    assertTrue(pattern.match(xmlWithDtdThatCannotBeFetched).isExactMatch());\n  }\n\n  @Test\n  public void createEqualToXmlPatternWithPlaceholderFromWireMockClass() {\n    String placeholderOpeningDelimiterRegex = \"theOpeningDelimiterRegex\";\n    String placeholderClosingDelimiterRegex = \"theClosingDelimiterRegex\";\n    EqualToXmlPattern equalToXmlPattern =\n        equalToXml(\n            \"<a/>\", true, placeholderOpeningDelimiterRegex, placeholderClosingDelimiterRegex);\n    assertThat(equalToXmlPattern.isEnablePlaceholders(), is(true));\n    assertThat(\n        equalToXmlPattern.getPlaceholderOpeningDelimiterRegex(),\n        is(placeholderOpeningDelimiterRegex));\n    assertThat(\n        equalToXmlPattern.getPlaceholderClosingDelimiterRegex(),\n        is(placeholderClosingDelimiterRegex));\n  }\n\n  @Test\n  public void createEqualToXmlPatternWithPlaceholderFromWireMockClass_DefaultDelimiters() {\n    EqualToXmlPattern equalToXmlPattern = equalToXml(\"<a/>\", true);\n    assertThat(equalToXmlPattern.isEnablePlaceholders(), is(true));\n    assertNull(equalToXmlPattern.getPlaceholderOpeningDelimiterRegex());\n    assertNull(equalToXmlPattern.getPlaceholderClosingDelimiterRegex());\n  }\n\n  @Test\n  public void returnsMatchWhenTextNodeIsIgnored() {\n    String expectedXml = \"<a>#{xmlunit.ignore}</a>\";\n    String actualXml = \"<a>123</a>\";\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            expectedXml,\n            true,\n            \"#\\\\{\",\n            \"}\",\n            null,\n            false,\n            EqualToXmlPattern.NamespaceAwareness.LEGACY);\n    MatchResult matchResult = pattern.match(actualXml);\n\n    assertTrue(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), is(0.0));\n  }\n\n  @Test\n  public void returnsMatchWhenTextNodeIsIgnored_DefaultDelimiters() {\n    String expectedXml = \"<a>${xmlunit.ignore}</a>\";\n    String actualXml = \"<a>123</a>\";\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            expectedXml,\n            true,\n            null,\n            null,\n            null,\n            false,\n            EqualToXmlPattern.NamespaceAwareness.LEGACY);\n    MatchResult matchResult = pattern.match(actualXml);\n\n    assertTrue(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), is(0.0));\n  }\n\n  @Test\n  public void deserializesEqualToXmlWithMinimalParameters() {\n    String patternJson = \"{\" + \"\\\"equalToXml\\\" : \\\"<a/>\\\"\" + \"}\";\n    StringValuePattern stringValuePattern = Json.read(patternJson, StringValuePattern.class);\n\n    EqualToXmlPattern equalToXmlPattern =\n        assertInstanceOf(EqualToXmlPattern.class, stringValuePattern);\n    assertThat(equalToXmlPattern.isEnablePlaceholders(), nullValue());\n    assertThat(equalToXmlPattern.getPlaceholderOpeningDelimiterRegex(), nullValue());\n    assertThat(equalToXmlPattern.getPlaceholderClosingDelimiterRegex(), nullValue());\n    assertThat(equalToXmlPattern.getExemptedComparisons(), nullValue());\n    assertThat(equalToXmlPattern.getNamespaceAwareness(), nullValue());\n  }\n\n  @Test\n  public void deserializesEqualToXmlWithAllParameters() {\n    Boolean enablePlaceholders = Boolean.TRUE;\n    Boolean ignoreOrderOfSameNode = Boolean.TRUE;\n    String placeholderOpeningDelimiterRegex = \"theOpeningDelimiterRegex\";\n    String placeholderClosingDelimiterRegex = \"theClosingDelimiterRegex\";\n    String patternJson =\n        \"{\"\n            + \"\\\"equalToXml\\\" : \\\"<a/>\\\", \"\n            + \"\\\"enablePlaceholders\\\" : \"\n            + enablePlaceholders\n            + \", \"\n            + \"\\\"ignoreOrderOfSameNode\\\" : \"\n            + ignoreOrderOfSameNode\n            + \", \"\n            + \"\\\"placeholderOpeningDelimiterRegex\\\" : \\\"\"\n            + placeholderOpeningDelimiterRegex\n            + \"\\\", \"\n            + \"\\\"placeholderClosingDelimiterRegex\\\" : \\\"\"\n            + placeholderClosingDelimiterRegex\n            + \"\\\", \"\n            + \"\\\"exemptedComparisons\\\": [\\\"SCHEMA_LOCATION\\\", \\\"NAMESPACE_URI\\\", \\\"ATTR_VALUE\\\"]\"\n            + \", \"\n            + \"\\\"namespaceAwareness\\\": \\\"LEGACY\\\"\"\n            + \" }\";\n    StringValuePattern stringValuePattern = Json.read(patternJson, StringValuePattern.class);\n\n    EqualToXmlPattern equalToXmlPattern =\n        assertInstanceOf(EqualToXmlPattern.class, stringValuePattern);\n    assertEquals(enablePlaceholders, equalToXmlPattern.isEnablePlaceholders());\n    assertEquals(ignoreOrderOfSameNode, equalToXmlPattern.isIgnoreOrderOfSameNode());\n    assertEquals(\n        placeholderOpeningDelimiterRegex, equalToXmlPattern.getPlaceholderOpeningDelimiterRegex());\n    assertEquals(\n        placeholderClosingDelimiterRegex, equalToXmlPattern.getPlaceholderClosingDelimiterRegex());\n    assertThat(\n        equalToXmlPattern.getExemptedComparisons(),\n        Matchers.is(Set.of(SCHEMA_LOCATION, NAMESPACE_URI, ATTR_VALUE)));\n    assertThat(\n        equalToXmlPattern.getNamespaceAwareness(), is(EqualToXmlPattern.NamespaceAwareness.LEGACY));\n  }\n\n  @Test\n  public void serializesEqualToXmlWithAllParameters() {\n    String xml = \"<stuff />\";\n    Boolean enablePlaceholders = Boolean.TRUE;\n    Boolean ignoreOrderOfSameNode = Boolean.TRUE;\n    String placeholderOpeningDelimiterRegex = \"[\";\n    String placeholderClosingDelimiterRegex = \"]\";\n\n    StringValuePattern pattern =\n        new EqualToXmlPattern(\n            xml,\n            enablePlaceholders,\n            placeholderOpeningDelimiterRegex,\n            placeholderClosingDelimiterRegex,\n            Set.of(SCHEMA_LOCATION, NAMESPACE_URI, ATTR_VALUE),\n            ignoreOrderOfSameNode,\n            EqualToXmlPattern.NamespaceAwareness.NONE);\n\n    String json = Json.write(pattern);\n\n    assertThat(\n        json,\n        WireMatchers.equalToJson(\n            \"{\\n\"\n                + \"  \\\"equalToXml\\\": \\\"<stuff />\\\",\\n\"\n                + \"  \\\"enablePlaceholders\\\": true,\\n\"\n                + \"  \\\"ignoreOrderOfSameNode\\\": true,\\n\"\n                + \"  \\\"placeholderOpeningDelimiterRegex\\\": \\\"[\\\",\\n\"\n                + \"  \\\"placeholderClosingDelimiterRegex\\\": \\\"]\\\",\\n\"\n                + \"  \\\"exemptedComparisons\\\": [\\\"SCHEMA_LOCATION\\\", \\\"ATTR_VALUE\\\", \\\"NAMESPACE_URI\\\"],\\n\"\n                + \"  \\\"namespaceAwareness\\\": \\\"NONE\\\"\\n\"\n                + \"}\",\n            JSONCompareMode.NON_EXTENSIBLE));\n  }\n\n  @Test\n  public void\n      legacyNamespaceAwarenessReturnsExactMatchWhenElementNamespacePrefixesDifferButTheirCorrespondingNamespaceUrisAreTheSame() {\n    String expected =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<stuff xmlns:th=\\\"https://thing.com\\\">\\n\"\n            + \"    <th:thing>Match this</th:thing>\\n\"\n            + \"</stuff>\";\n\n    String actual =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<stuff xmlns:st=\\\"https://thing.com\\\">\\n\"\n            + \"    <st:thing>Match this</st:thing>\\n\"\n            + \"</stuff>\";\n\n    MatchResult matchResult =\n        equalToXml(expected, false, null, null, false, EqualToXmlPattern.NamespaceAwareness.LEGACY)\n            .match(actual);\n\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  public void\n      legacyNamespaceAwarenessReturnsExactMatchWhenElementNamespacePrefixesAndTheirCorrespondingNamespaceUrisDiffer() {\n    String expected =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<stuff xmlns:th=\\\"https://thing.com\\\">\\n\"\n            + \"    <th:thing>Match this</th:thing>\\n\"\n            + \"</stuff>\";\n\n    String actual =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<stuff xmlns:st=\\\"https://stuff.com\\\">\\n\"\n            + \"    <st:thing>Match this</st:thing>\\n\"\n            + \"</stuff>\";\n\n    MatchResult matchResult =\n        equalToXml(expected, EqualToXmlPattern.NamespaceAwareness.LEGACY).match(actual);\n\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  public void\n      legacyNamespaceAwarenessDoesNotMatchWhenAttrNamespacePrefixesDifferButNamespaceUrisAreTheSame() {\n    String expected =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<stuff xmlns:th=\\\"https://thing.com\\\">\\n\"\n            + \"    <thing th:attr=\\\"abc\\\">Match this</thing>\\n\"\n            + \"</stuff>\";\n\n    String actual =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<stuff xmlns:st=\\\"https://thing.com\\\">\\n\"\n            + \"    <thing st:attr=\\\"abc\\\">Match this</thing>\\n\"\n            + \"</stuff>\";\n\n    MatchResult matchResult =\n        equalToXml(expected, EqualToXmlPattern.NamespaceAwareness.LEGACY).match(actual);\n\n    assertFalse(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), not(equalTo(0.0)));\n  }\n\n  @Test\n  public void\n      legacyNamespaceAwarenessDoesNotMatchWhenAttrNamespacePrefixesAndNamespaceUrisDiffer() {\n    String expected =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<stuff xmlns:th=\\\"https://thing.com\\\">\\n\"\n            + \"    <thing th:attr=\\\"abc\\\">Match this</thing>\\n\"\n            + \"</stuff>\";\n\n    String actual =\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"<stuff xmlns:st=\\\"https://stuff.com\\\">\\n\"\n            + \"    <thing st:attr=\\\"abc\\\">Match this</thing>\\n\"\n            + \"</stuff>\";\n\n    MatchResult matchResult =\n        equalToXml(expected, EqualToXmlPattern.NamespaceAwareness.LEGACY).match(actual);\n\n    assertFalse(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), not(equalTo(0.0)));\n  }\n\n  @Test\n  public void defaultNamespaceUriComparisonCanBeExcludedOnLegacyNamespaceAwareness() {\n    String expected = \"<GetValue xmlns=\\\"http://CIS/BIR/PUBL/2014/07/DataContract\\\"/>\";\n\n    String actual = \"<GetValue/>\";\n\n    EqualToXmlPattern pattern = equalToXml(expected, EqualToXmlPattern.NamespaceAwareness.LEGACY);\n    EqualToXmlPattern patternWithExclusion =\n        equalToXml(expected).exemptingComparisons(NAMESPACE_URI);\n\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(equalTo(0.0)));\n    assertTrue(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), equalTo(0.0));\n  }\n\n  @Test\n  public void defaultNamespaceUriComparisonCanBeExcludedOnLegacyNamespaceAwareness2() {\n    String expected =\n        \"<ns2:GetValue\\n\"\n            + \"        xmlns=\\\"http://CIS/BIR/PUBL/2014/07/DataContract\\\"\\n\"\n            + \"        xmlns:ns2=\\\"http://CIS/BIR/2014/07\\\"                         \\n\"\n            + \"        xmlns:ns3=\\\"http://CIS/BIR/PUBL/2014/07\\\"                    \\n\"\n            + \"        xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serializa  \\n\"\n            + \"        tion/\\\"/>\";\n\n    String actual =\n        \"<ns3:GetValue\\n\"\n            + \"        xmlns=\\\"http://CIS/BIR/PUBL/2014/07\\\"\\n\"\n            + \"        xmlns:ns2=\\\"http://CIS/BIR/PUBL/2014/07/DataContract\\\"\\n\"\n            + \"        xmlns:ns3=\\\"http://CIS/BIR/2014/07\\\"\\n\"\n            + \"        xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serializa\\n\"\n            + \"        tion/\\\"/>\";\n\n    StringValuePattern pattern =\n        equalToXml(expected, false, null, null, false, EqualToXmlPattern.NamespaceAwareness.LEGACY)\n            .exemptingComparisons(NAMESPACE_URI);\n\n    assertTrue(pattern.match(actual).isExactMatch());\n  }\n\n  @Test\n  public void xmlnsNamespacedAttributesAreNotComparedWhenUsingLegacyNamespaceAwareness() {\n    String expected =\n        \"<GetValue xmlns:ns2=\\\"http://CIS/BIR/2014/07\\\" xmlns:ns3=\\\"http://CIS/BIR/PUBL/2014/07\\\" xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serialization/\\\"/>\";\n\n    String actual =\n        \"<GetValue xmlns:ns2=\\\"http://CIS/BIR/PUBL/2014/07/DataContract\\\" xmlns:ns3=\\\"http://CIS/BIR/2014/07\\\" xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serialization/\\\" xmlns:ns5=\\\"http://stuff.com\\\"/>\";\n\n    StringValuePattern pattern =\n        equalToXml(expected).withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.LEGACY);\n\n    assertTrue(pattern.match(actual).isExactMatch());\n  }\n\n  @Test\n  public void testEquals() {\n    EqualToXmlPattern a =\n        new EqualToXmlPattern(\n            \"<ns2:GetValue\\n\"\n                + \"        xmlns=\\\"http://CIS/BIR/PUBL/2014/07/DataContract\\\"\\n\"\n                + \"        xmlns:ns2=\\\"http://CIS/BIR/2014/07\\\"                         \\n\"\n                + \"        xmlns:ns3=\\\"http://CIS/BIR/PUBL/2014/07\\\"                    \\n\"\n                + \"        xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serializa  \\n\"\n                + \"        tion/\\\"/>\");\n    EqualToXmlPattern b =\n        new EqualToXmlPattern(\n            \"<ns2:GetValue\\n\"\n                + \"        xmlns=\\\"http://CIS/BIR/PUBL/2014/07/DataContract\\\"\\n\"\n                + \"        xmlns:ns2=\\\"http://CIS/BIR/2014/07\\\"                         \\n\"\n                + \"        xmlns:ns3=\\\"http://CIS/BIR/PUBL/2014/07\\\"                    \\n\"\n                + \"        xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serializa  \\n\"\n                + \"        tion/\\\"/>\");\n    EqualToXmlPattern c =\n        new EqualToXmlPattern(\n            \"<ns2:GetValue\\n\"\n                + \"        xmlns=\\\"http://CIS/BIR/PUBL/2015/07/DataContract\\\"\\n\"\n                + \"        xmlns:ns2=\\\"http://CIS/BIR/2015/07\\\"                         \\n\"\n                + \"        xmlns:ns3=\\\"http://CIS/BIR/PUBL/2015/07\\\"                    \\n\"\n                + \"        xmlns:ns4=\\\"http://schemas.microsoft.com/2004/10/Serializa  \\n\"\n                + \"        tion/\\\"/>\");\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n\n  @Test\n  void subEventIsReturnedOnXmlParsingError() {\n    MatchResult match = new EqualToXmlPattern(\"<things />\").match(\"<wrong\");\n\n    assertThat(match.isExactMatch(), is(false));\n    assertThat(match.getSubEvents().size(), is(1));\n    String message =\n        match.getSubEvents().stream().findFirst().get().getData().get(\"message\").toString();\n    assertThat(\n        message, startsWith(\"XML document structures must start and end within the same entity\"));\n  }\n\n  @Test\n  void ignoreOrderOfSameNodeOnSameLevel() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\"<body><entry>1</entry><entry>2</entry></body>\", false, true);\n    MatchResult result = pattern.match(\"<body><entry>2</entry><entry>1</entry></body>\");\n    assertTrue(result.isExactMatch());\n  }\n\n  @Test\n  void dontIgnoreOrderOfSameNodeOnSameLevel() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\"<body><entry>1</entry><entry>2</entry></body>\", false, false);\n    MatchResult result = pattern.match(\"<body><entry>2</entry><entry>1</entry></body>\");\n    assertFalse(result.isExactMatch());\n  }\n\n  @Test\n  void doesNotMatchWhenSameNodeOnSameLevelHasDifferentValues() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\"<body><entry>1</entry><entry>3</entry></body>\", false, true);\n    MatchResult result = pattern.match(\"<body><entry>2</entry><entry>1</entry></body>\");\n    assertFalse(result.isExactMatch());\n  }\n\n  @Test\n  void matchesIfMultipleSameNodesOnSameLevelWithDifferentNodes() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<body><entry>1</entry><entry>2</entry><other>2</other></body>\", false, true);\n    MatchResult result =\n        pattern.match(\"<body><entry>2</entry><entry>1</entry><other>2</other></body>\");\n    assertTrue(result.isExactMatch());\n  }\n\n  @Test\n  void matchesIfTwoIdenticalChildNodesAreEmpty() {\n    EqualToXmlPattern pattern = new EqualToXmlPattern(\"<body><entry/><entry/></body>\", false, true);\n    MatchResult result = pattern.match(\"<body><entry/><entry/></body>\");\n    assertTrue(result.isExactMatch());\n  }\n\n  @Test\n  void matchesIfCommentsDiffer() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\"<body><!-- Comment --><entry/><entry/></body>\", false, true);\n    MatchResult result = pattern.match(\"<body><entry/><entry/><!-- A different comment --></body>\");\n    assertTrue(result.isExactMatch());\n  }\n\n  @Test\n  void legacyNamespaceAwarenessAllowsUnboundNamespacesOnElements() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<tns:companyID>100</tns:companyID>\\n\",\n            null,\n            null,\n            null,\n            null,\n            null,\n            EqualToXmlPattern.NamespaceAwareness.LEGACY);\n    MatchResult result =\n        pattern.match(\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><tns:companyID>100</tns:companyID>\");\n    assertTrue(result.isExactMatch());\n    assertThat(result.getDistance(), is(0.0));\n  }\n\n  @Test\n  void legacyNamespaceAwarenessAllowsUnboundNamespacesOnAttributes() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<companyID tns:abc=\\\"123\\\">100</companyID>\\n\",\n            null,\n            null,\n            null,\n            null,\n            null,\n            EqualToXmlPattern.NamespaceAwareness.LEGACY);\n    MatchResult result = pattern.match(\"<companyID tns:abc=\\\"123\\\">100</companyID>\");\n    assertTrue(result.isExactMatch());\n    assertThat(result.getDistance(), is(0.0));\n  }\n\n  @Test\n  void strictNamespaceAwarenessDoesNotAllowUnboundNamespacesOnElements() {\n    XmlException exception =\n        assertThrows(\n            XmlException.class,\n            () ->\n                new EqualToXmlPattern(\n                    \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<tns:companyID>100</tns:companyID>\\n\",\n                    null,\n                    null,\n                    null,\n                    null,\n                    null,\n                    EqualToXmlPattern.NamespaceAwareness.STRICT));\n    assertThat(\n        exception.getMessage(),\n        containsString(\"The prefix \\\\\\\"tns\\\\\\\" for element \\\\\\\"tns:companyID\\\\\\\" is not bound.\"));\n  }\n\n  @Test\n  void strictNamespaceAwarenessDoesNotAllowUnboundNamespacesOnAttributes() {\n    XmlException exception =\n        assertThrows(\n            XmlException.class,\n            () ->\n                new EqualToXmlPattern(\n                    \"<companyID tns:abc=\\\"123\\\">100</companyID>\\n\",\n                    null,\n                    null,\n                    null,\n                    null,\n                    null,\n                    EqualToXmlPattern.NamespaceAwareness.STRICT));\n    assertThat(\n        exception.getMessage(),\n        containsString(\n            \"The prefix \\\\\\\"tns\\\\\\\" for attribute \\\\\\\"tns:abc\\\\\\\" associated with an element type \\\\\\\"companyID\\\\\\\" is not bound.\"));\n  }\n\n  @Test\n  void noNamespaceAwarenessAllowsUnboundNamespacesOnElements() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<tns:companyID>100</tns:companyID>\\n\",\n            null,\n            null,\n            null,\n            null,\n            null,\n            EqualToXmlPattern.NamespaceAwareness.NONE);\n    MatchResult result =\n        pattern.match(\n            \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><tns:companyID>100</tns:companyID>\");\n    assertTrue(result.isExactMatch());\n    assertThat(result.getDistance(), is(0.0));\n  }\n\n  @Test\n  void noNamespaceAwarenessAllowsUnboundNamespacesOnAttributes() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n            \"<companyID tns:abc=\\\"123\\\">100</companyID>\\n\",\n            null,\n            null,\n            null,\n            null,\n            null,\n            EqualToXmlPattern.NamespaceAwareness.NONE);\n    MatchResult result = pattern.match(\"<companyID tns:abc=\\\"123\\\">100</companyID>\");\n    assertTrue(result.isExactMatch());\n    assertThat(result.getDistance(), is(0.0));\n  }\n\n  @Test\n  void strictNamespaceAwarenessMatchesWhenElementNamespacePrefixesDifferUnless() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\"<ns1:companyID xmlns:ns1=\\\"https://thing.com\\\">100</ns1:companyID>\")\n            .withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT);\n    String actual = \"<ns2:companyID xmlns:ns2=\\\"https://thing.com\\\">100</ns2:companyID>\";\n    assertTrue(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), is(0.0));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_PREFIX);\n    assertTrue(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), is(0.0));\n  }\n\n  @Test\n  void strictNamespaceAwarenessMatchesWhenAttributeNamespacePrefixesDiffer() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n                \"<companyID xmlns:ns1=\\\"https://thing.com\\\" ns1:abc=\\\"123\\\">100</companyID>\")\n            .withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT);\n    String actual = \"<companyID xmlns:ns2=\\\"https://thing.com\\\" ns2:abc=\\\"123\\\">100</companyID>\";\n    assertTrue(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), is(0.0));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_PREFIX);\n    assertTrue(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), is(0.0));\n  }\n\n  @Test\n  void\n      strictNamespaceAwarenessDoesNotMatchWhenElementNamespaceUrisDifferUnlessExplicitlyExcluded() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\"<ns1:companyID xmlns:ns1=\\\"https://stuff.com\\\">100</ns1:companyID>\")\n            .withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT);\n    String actual = \"<ns1:companyID xmlns:ns1=\\\"https://thing.com\\\">100</ns1:companyID>\";\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(is(0.0)));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_URI);\n    assertTrue(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), is(0.0));\n  }\n\n  @Test\n  void strictNamespaceAwarenessDoesNotMatchWhenAttributeNamespaceUrisDiffer() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n                \"<companyID xmlns:ns1=\\\"https://thing.com\\\" ns1:abc=\\\"123\\\">100</companyID>\")\n            .withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT);\n    String actual = \"<companyID xmlns:ns1=\\\"https://stuff.com\\\" ns1:abc=\\\"123\\\">100</companyID>\";\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(is(0.0)));\n  }\n\n  @Test\n  void noNamespaceAwarenessDoesNotMatchWhenElementNamespacePrefixesDiffer() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\"<ns1:companyID xmlns:ns1=\\\"https://stuff.com\\\">100</ns1:companyID>\")\n            .withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.NONE);\n    String actual = \"<ns2:companyID xmlns:ns2=\\\"https://stuff.com\\\">100</ns2:companyID>\";\n\n    // Expect\n    EqualToXmlPattern patternWithLegacyNsAwareness =\n        pattern.withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT);\n    assertTrue(patternWithLegacyNsAwareness.match(actual).isExactMatch());\n    assertThat(patternWithLegacyNsAwareness.match(actual).getDistance(), is(0.0));\n\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(is(0.0)));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_PREFIX);\n    assertFalse(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), not(is(0.0)));\n  }\n\n  @Test\n  void noNamespaceAwarenessDoesNotMatchWhenAttributeNamespacePrefixesDiffer() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n                \"<companyID xmlns:ns1=\\\"https://thing.com\\\" ns1:abc=\\\"123\\\">100</companyID>\")\n            .withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.NONE);\n    String actual = \"<companyID xmlns:ns2=\\\"https://thing.com\\\" ns2:abc=\\\"123\\\">100</companyID>\";\n\n    // Expect\n    EqualToXmlPattern patternWithStrictNsAwareness =\n        pattern.withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT);\n    assertTrue(patternWithStrictNsAwareness.match(actual).isExactMatch());\n    assertThat(patternWithStrictNsAwareness.match(actual).getDistance(), is(0.0));\n\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(is(0.0)));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_PREFIX);\n    assertFalse(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), not(is(0.0)));\n  }\n\n  @Test\n  void noNamespaceAwarenessDoesNotMatchWhenElementNamespaceUrisDiffer() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\"<ns1:companyID xmlns:ns1=\\\"https://thing.com\\\">100</ns1:companyID>\")\n            .withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.NONE);\n    String actual = \"<ns1:companyID xmlns:ns1=\\\"https://stuff.com\\\">100</ns1:companyID>\";\n\n    // Expect\n    EqualToXmlPattern patternWithLegacyNsAwareness =\n        pattern.withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.LEGACY);\n    assertTrue(patternWithLegacyNsAwareness.match(actual).isExactMatch());\n    assertThat(patternWithLegacyNsAwareness.match(actual).getDistance(), is(0.0));\n\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(is(0.0)));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_URI);\n    assertFalse(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), not(is(0.0)));\n  }\n\n  @Test\n  void noNamespaceAwarenessDoesNotMatchWhenAttributeNamespaceUrisDiffer() {\n    EqualToXmlPattern pattern =\n        new EqualToXmlPattern(\n                \"<companyID xmlns:ns1=\\\"https://thing.com\\\" ns1:abc=\\\"123\\\">100</companyID>\")\n            .withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.NONE);\n    String actual = \"<companyID xmlns:ns1=\\\"https://stuff.com\\\" ns1:abc=\\\"123\\\">100</companyID>\";\n\n    // Expect\n    EqualToXmlPattern patternWithLegacyNsAwareness =\n        pattern.withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.LEGACY);\n    assertTrue(patternWithLegacyNsAwareness.match(actual).isExactMatch());\n    assertThat(patternWithLegacyNsAwareness.match(actual).getDistance(), is(0.0));\n\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(is(0.0)));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_URI);\n    assertFalse(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), not(is(0.0)));\n  }\n\n  @Test\n  public void xmlnsNamespacedAttributesAreNotComparedWhenUsingStrictNamespaceAwareness() {\n    String expected =\n        \"<GetValue xmlns:ns2=\\\"http://CIS/BIR/2014/07\\\" xmlns:ns3=\\\"http://CIS/BIR/PUBL/2014/07\\\" xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serialization/\\\"/>\";\n\n    String actual =\n        \"<GetValue xmlns:ns2=\\\"http://CIS/BIR/PUBL/2014/07/DataContract\\\" xmlns:ns3=\\\"http://CIS/BIR/2014/07\\\" xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serialization/\\\" xmlns:ns5=\\\"http://stuff.com\\\"/>\";\n\n    EqualToXmlPattern pattern =\n        equalToXml(expected).withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT);\n\n    // Expect\n    EqualToXmlPattern patternWithNoNsAwareness =\n        pattern.withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.NONE);\n    assertFalse(patternWithNoNsAwareness.match(actual).isExactMatch());\n    assertThat(patternWithNoNsAwareness.match(actual).getDistance(), not(is(0.0)));\n\n    assertTrue(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), is(0.0));\n  }\n\n  @Test\n  public void xmlnsNamespacedAttributesAreComparedWhenUsingNoNamespaceAwareness() {\n    String expected =\n        \"<GetValue xmlns:ns2=\\\"http://CIS/BIR/2014/07\\\" xmlns:ns3=\\\"http://CIS/BIR/PUBL/2014/07\\\" xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serialization/\\\"/>\";\n\n    String actual =\n        \"<GetValue xmlns:ns2=\\\"http://CIS/BIR/PUBL/2014/07/DataContract\\\" xmlns:ns3=\\\"http://CIS/BIR/2014/07\\\" xmlns:ns4=\\\"http://schemas.microsoft.com/2003/10/Serialization/\\\" xmlns:ns5=\\\"http://stuff.com\\\"/>\";\n\n    EqualToXmlPattern pattern =\n        equalToXml(expected).withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.NONE);\n\n    // Expect\n    EqualToXmlPattern patternWithStrictNsAwareness =\n        pattern.withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT);\n    assertTrue(patternWithStrictNsAwareness.match(actual).isExactMatch());\n    assertThat(patternWithStrictNsAwareness.match(actual).getDistance(), is(0.0));\n\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(is(0.0)));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_URI);\n    assertFalse(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), not(is(0.0)));\n  }\n\n  @Test\n  public void\n      defaultNamespaceUrisOfXmlnsAttributesAreComparedWhenUsingStrictNamespaceAwarenessUnlessExplicitlyExcluded() {\n    String expected = \"<GetValue xmlns=\\\"http://thing.com\\\"/>\";\n\n    String actual = \"<GetValue xmlns=\\\"http://stuff.com\\\"/>\";\n\n    EqualToXmlPattern pattern =\n        equalToXml(expected).withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT);\n\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(is(0.0)));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_URI);\n    assertTrue(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), is(0.0));\n  }\n\n  @Test\n  public void defaultXmlnsAttributesAreComparedWhenUsingNoNamespaceAwareness() {\n    String expected = \"<GetValue xmlns=\\\"http://thing.com\\\"/>\";\n\n    String actual = \"<GetValue xmlns=\\\"http://stuff.com\\\"/>\";\n\n    EqualToXmlPattern pattern =\n        equalToXml(expected).withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.NONE);\n\n    // Expect\n    EqualToXmlPattern patternWithStrictNsAwareness =\n        pattern\n            .withNamespaceAwareness(EqualToXmlPattern.NamespaceAwareness.STRICT)\n            .exemptingComparisons(NAMESPACE_URI);\n    assertTrue(patternWithStrictNsAwareness.match(actual).isExactMatch());\n    assertThat(patternWithStrictNsAwareness.match(actual).getDistance(), is(0.0));\n\n    assertFalse(pattern.match(actual).isExactMatch());\n    assertThat(pattern.match(actual).getDistance(), not(is(0.0)));\n    EqualToXmlPattern patternWithExclusion = pattern.exemptingComparisons(NAMESPACE_URI);\n    assertFalse(patternWithExclusion.match(actual).isExactMatch());\n    assertThat(patternWithExclusion.match(actual).getDistance(), not(is(0.0)));\n  }\n\n  @Test\n  void getExpectedHandlesUndeclaredNamespacePrefixes() {\n    String expected = \"<abc asdas:atdf=\\\"asdas\\\">123</abc>\";\n    EqualToXmlPattern pattern = equalToXml(expected, EqualToXmlPattern.NamespaceAwareness.NONE);\n    assertThat(pattern.getExpected(), is(expected));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/GreaterThanEqualNumberPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.skyscreamer.jsonassert.JSONAssert.assertEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\npublic class GreaterThanEqualNumberPatternTest {\n\n  @Test\n  public void failsForNoMatchOnGreaterThanInt() {\n    StringValuePattern pattern = WireMock.greaterThanEqualNumber(5);\n    assertFalse(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void succeedsForNoMatchEqualOnGreaterThanInt() {\n    StringValuePattern pattern = WireMock.greaterThanEqualNumber(1);\n    assertTrue(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.00));\n  }\n\n  @Test\n  public void failsForNoMatchOnGreaterThanFloat() {\n    StringValuePattern pattern = WireMock.greaterThanEqualNumber(5.5);\n    assertFalse(pattern.match(\"1.1\").isExactMatch());\n    assertThat(pattern.match(\"1.1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void succeedsForNoMatchEqualOnGreaterThanFloat() {\n    StringValuePattern pattern = WireMock.greaterThanEqualNumber(1.1);\n    assertTrue(pattern.match(\"1.1\").isExactMatch());\n    assertThat(pattern.match(\"1.1\").getDistance(), is(0.00));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnGreaterThanInt() {\n    StringValuePattern pattern = WireMock.greaterThanEqualNumber(1);\n    assertTrue(pattern.match(\"2\").isExactMatch());\n    assertThat(pattern.match(\"2\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnGreaterThanFloat() {\n    StringValuePattern pattern = WireMock.greaterThanEqualNumber(1.1111);\n    assertTrue(pattern.match(\"1.1112\").isExactMatch());\n    assertThat(pattern.match(\"1.1112\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanEqualFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"greaterThanEqualNumber\\\": \\\"1\\\" }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(GreaterThanEqualNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanEqualWithExtraZerosFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"greaterThanEqualNumber\\\": \\\"0001.0000\\\" }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(GreaterThanEqualNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanEqualWithNumberFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"greaterThanEqualNumber\\\": 1.0000 }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(GreaterThanEqualNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void failsWhenDeserialisingGreaterThanEqualWithNonNumber() {\n    JsonException e =\n        assertThrows(\n            JsonException.class,\n            () ->\n                Json.read(\n                    \"{ \\\"greaterThanEqualNumber\\\": \\\"a string\\\" }\", StringValuePattern.class));\n    assertThat(e.getMessage(), containsString(\"greaterThanEqualNumber has to be a numeric value\"));\n  }\n\n  @Test\n  public void correctlySerialisesToJson() throws Exception {\n    assertEquals(\n        \"{ \\\"greaterThanEqualNumber\\\": 1 }\",\n        Json.write(new GreaterThanEqualNumberPattern(1)),\n        false);\n  }\n\n  @Test\n  public void noMatchOnNullValue() {\n    assertThat(WireMock.greaterThanEqualNumber(1).match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void noMatchOnStringValue() {\n    assertThat(WireMock.greaterThanEqualNumber(1).match(\"a string\").isExactMatch(), is(false));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    var a = new GreaterThanEqualNumberPattern(1);\n    var b = new GreaterThanEqualNumberPattern(1);\n    var c = new GreaterThanEqualNumberPattern(2);\n\n    Assertions.assertEquals(a, b);\n    Assertions.assertEquals(a.hashCode(), b.hashCode());\n    Assertions.assertEquals(b, a);\n    Assertions.assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/GreaterThanNumberPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.skyscreamer.jsonassert.JSONAssert.assertEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\npublic class GreaterThanNumberPatternTest {\n\n  @Test\n  public void failsForNoMatchOnGreaterThanInt() {\n    StringValuePattern pattern = WireMock.greaterThanNumber(5);\n    assertFalse(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void failsForNoMatchEqualOnGreaterThanInt() {\n    StringValuePattern pattern = WireMock.greaterThanNumber(1);\n    assertFalse(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void failsForNoMatchOnGreaterThanFloat() {\n    StringValuePattern pattern = WireMock.greaterThanNumber(5.5);\n    assertFalse(pattern.match(\"1.1\").isExactMatch());\n    assertThat(pattern.match(\"1.1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void failsForNoMatchEqualOnGreaterThanFloat() {\n    StringValuePattern pattern = WireMock.greaterThanNumber(1.1);\n    assertFalse(pattern.match(\"1.1\").isExactMatch());\n    assertThat(pattern.match(\"1.1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnGreaterThanInt() {\n    StringValuePattern pattern = WireMock.greaterThanNumber(1);\n    assertTrue(pattern.match(\"2\").isExactMatch());\n    assertThat(pattern.match(\"2\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnGreaterThanFloat() {\n    StringValuePattern pattern = WireMock.greaterThanNumber(1.1111);\n    assertTrue(pattern.match(\"1.1112\").isExactMatch());\n    assertThat(pattern.match(\"1.1112\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"greaterThanNumber\\\": \\\"1\\\" }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(GreaterThanNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanEqualWithExtraZerosFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"greaterThanNumber\\\": \\\"0001.0000\\\" }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(GreaterThanNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanEqualWithNumberFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"greaterThanNumber\\\": 1.0000 }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(GreaterThanNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void failsWhenDeserialisingGreaterThanEqualWithNonNumber() {\n    JsonException e =\n        assertThrows(\n            JsonException.class,\n            () -> Json.read(\"{ \\\"greaterThanNumber\\\": \\\"a string\\\" }\", StringValuePattern.class));\n    assertThat(e.getMessage(), containsString(\"greaterThanNumber has to be a numeric value\"));\n  }\n\n  @Test\n  public void correctlySerialisesToJson() throws Exception {\n    assertEquals(\n        \"{ \\\"greaterThanNumber\\\": 1 }\", Json.write(new GreaterThanNumberPattern(1)), false);\n  }\n\n  @Test\n  public void noMatchOnNullValue() {\n    assertThat(WireMock.greaterThanNumber(1).match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void noMatchOnStringValue() {\n    assertThat(WireMock.greaterThanNumber(1).match(\"a string\").isExactMatch(), is(false));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    var a = new GreaterThanNumberPattern(1);\n    var b = new GreaterThanNumberPattern(1);\n    var c = new GreaterThanNumberPattern(2);\n\n    Assertions.assertEquals(a, b);\n    Assertions.assertEquals(a.hashCode(), b.hashCode());\n    Assertions.assertEquals(b, a);\n    Assertions.assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/LessThanEqualNumberPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.skyscreamer.jsonassert.JSONAssert.assertEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\npublic class LessThanEqualNumberPatternTest {\n\n  @Test\n  public void failsForNoMatchOnLessThanEqualInt() {\n    StringValuePattern pattern = WireMock.lessThanEqualNumber(1);\n    assertFalse(pattern.match(\"5\").isExactMatch());\n    assertThat(pattern.match(\"5\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void succeedsForNoMatchEqualOnLessThanEqualInt() {\n    StringValuePattern pattern = WireMock.lessThanEqualNumber(1);\n    assertTrue(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.00));\n  }\n\n  @Test\n  public void failsForNoMatchOnLessThanEqualFloat() {\n    StringValuePattern pattern = WireMock.lessThanEqualNumber(1.1);\n    assertFalse(pattern.match(\"5.5\").isExactMatch());\n    assertThat(pattern.match(\"5.5\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void succeedsForNoMatchEqualOnLessThanEqualFloat() {\n    StringValuePattern pattern = WireMock.lessThanEqualNumber(1.1);\n    assertTrue(pattern.match(\"1.1\").isExactMatch());\n    assertThat(pattern.match(\"1.1\").getDistance(), is(0.00));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnLessThanEqualInt() {\n    StringValuePattern pattern = WireMock.lessThanEqualNumber(2);\n    assertTrue(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnLessThanEqualFloat() {\n    StringValuePattern pattern = WireMock.lessThanEqualNumber(1.1111);\n    assertTrue(pattern.match(\"1.111\").isExactMatch());\n    assertThat(pattern.match(\"1.111\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void correctlyDeserialisesLessThanEqualFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"lessThanEqualNumber\\\": \\\"1\\\" }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(LessThanEqualNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanEqualWithExtraZerosFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"lessThanEqualNumber\\\": \\\"0001.0000\\\" }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(LessThanEqualNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanEqualWithNumberFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"lessThanEqualNumber\\\": 1.0000 }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(LessThanEqualNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void failsWhenDeserialisingGreaterThanEqualWithNonNumber() {\n    JsonException e =\n        assertThrows(\n            JsonException.class,\n            () -> Json.read(\"{ \\\"lessThanEqualNumber\\\": \\\"a string\\\" }\", StringValuePattern.class));\n    assertThat(e.getMessage(), containsString(\"lessThanEqualNumber has to be a numeric value\"));\n  }\n\n  @Test\n  public void correctlySerialisesToJson() throws Exception {\n    assertEquals(\n        \"{ \\\"lessThanEqualNumber\\\": 1 }\", Json.write(new LessThanEqualNumberPattern(1)), false);\n  }\n\n  @Test\n  public void noMatchOnNullValue() {\n    assertThat(WireMock.lessThanEqualNumber(1).match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void noMatchOnStringValue() {\n    assertThat(WireMock.lessThanEqualNumber(1).match(\"a string\").isExactMatch(), is(false));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    var a = new LessThanEqualNumberPattern(1);\n    var b = new LessThanEqualNumberPattern(1);\n    var c = new LessThanEqualNumberPattern(2);\n\n    Assertions.assertEquals(a, b);\n    Assertions.assertEquals(a.hashCode(), b.hashCode());\n    Assertions.assertEquals(b, a);\n    Assertions.assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/LessThanNumberPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.skyscreamer.jsonassert.JSONAssert.assertEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\npublic class LessThanNumberPatternTest {\n\n  @Test\n  public void failsForNoMatchOnLessThanInt() {\n    StringValuePattern pattern = WireMock.lessThanNumber(1);\n    assertFalse(pattern.match(\"5\").isExactMatch());\n    assertThat(pattern.match(\"5\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void failsForNoMatchEqualOnLessThanInt() {\n    StringValuePattern pattern = WireMock.lessThanNumber(1);\n    assertFalse(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void failsForNoMatchOnLessThanFloat() {\n    StringValuePattern pattern = WireMock.lessThanNumber(1.1);\n    assertFalse(pattern.match(\"5.5\").isExactMatch());\n    assertThat(pattern.match(\"5.5\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void failsForNoMatchEqualOnLessThanFloat() {\n    StringValuePattern pattern = WireMock.lessThanNumber(1.1);\n    assertFalse(pattern.match(\"1.1\").isExactMatch());\n    assertThat(pattern.match(\"1.1\").getDistance(), is(0.01));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnLessThanInt() {\n    StringValuePattern pattern = WireMock.lessThanNumber(2);\n    assertTrue(pattern.match(\"1\").isExactMatch());\n    assertThat(pattern.match(\"1\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void succeedsForExactMatchOnLessThanFloat() {\n    StringValuePattern pattern = WireMock.lessThanNumber(1.1111);\n    assertTrue(pattern.match(\"1.111\").isExactMatch());\n    assertThat(pattern.match(\"1.111\").getDistance(), is(0.0));\n  }\n\n  @Test\n  public void correctlyDeserialisesLessThanFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"lessThanNumber\\\": \\\"1\\\" }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(LessThanNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanEqualWithExtraZerosFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"lessThanNumber\\\": \\\"0001.0000\\\" }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(LessThanNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesGreaterThanEqualWithNumberFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\"{ \\\"lessThanNumber\\\": 1.0000 }\", StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(LessThanNumberPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"1.0\"));\n  }\n\n  @Test\n  public void failsWhenDeserialisingGreaterThanEqualWithNonNumber() {\n    JsonException e =\n        assertThrows(\n            JsonException.class,\n            () -> Json.read(\"{ \\\"lessThanNumber\\\": \\\"a string\\\" }\", StringValuePattern.class));\n    assertThat(e.getMessage(), containsString(\"lessThanNumber has to be a numeric value\"));\n  }\n\n  @Test\n  public void correctlySerialisesToJson() throws Exception {\n    assertEquals(\"{ \\\"lessThanNumber\\\": 1 }\", Json.write(new LessThanNumberPattern(1)), false);\n  }\n\n  @Test\n  public void noMatchOnNullValue() {\n    assertThat(WireMock.lessThanNumber(1).match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void noMatchOnStringValue() {\n    assertThat(WireMock.lessThanNumber(1).match(\"a string\").isExactMatch(), is(false));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    var a = new LessThanNumberPattern(1);\n    var b = new LessThanNumberPattern(1);\n    var c = new LessThanNumberPattern(2);\n\n    Assertions.assertEquals(a, b);\n    Assertions.assertEquals(a.hashCode(), b.hashCode());\n    Assertions.assertEquals(b, a);\n    Assertions.assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/LogicalAndTest.java",
    "content": "/*\n * Copyright (C) 2021-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Test;\n\npublic class LogicalAndTest {\n\n  @Test\n  public void matchesWhenAllContainedMatchersMatch() {\n    StringValuePattern matcher =\n        WireMock.and(\n            WireMock.before(\"2021-01-01T00:00:00Z\"), WireMock.after(\"2020-01-01T00:00:00Z\"));\n\n    assertThat(\n        matcher.getExpected(), is(\"before 2021-01-01T00:00:00Z AND after 2020-01-01T00:00:00Z\"));\n\n    assertTrue(matcher.match(\"2020-06-01T11:22:33Z\").isExactMatch());\n    assertFalse(matcher.match(\"2021-06-01T11:22:33Z\").isExactMatch());\n  }\n\n  @Test\n  public void serialisesCorrectlyToJson() {\n    StringValuePattern matcher =\n        WireMock.and(\n            WireMock.before(\"2021-01-01T00:00:00Z\"), WireMock.after(\"2020-01-01T00:00:00Z\"));\n\n    assertThat(\n        Json.write(matcher),\n        jsonEquals(\n            \"{\\n\"\n                + \"  \\\"and\\\": [\\n\"\n                + \"    {\\n\"\n                + \"      \\\"before\\\": \\\"2021-01-01T00:00:00Z\\\"\\n\"\n                + \"    },\\n\"\n                + \"    {\\n\"\n                + \"      \\\"after\\\": \\\"2020-01-01T00:00:00Z\\\"\\n\"\n                + \"    }\\n\"\n                + \"  ]\\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void deserialisesCorrectlyFromJson() {\n    LogicalAnd matcher =\n        Json.read(\n            \"{\\n\"\n                + \"  \\\"and\\\": [\\n\"\n                + \"    {\\n\"\n                + \"      \\\"before\\\": \\\"2021-01-01T00:00:00Z\\\"\\n\"\n                + \"    },\\n\"\n                + \"    {\\n\"\n                + \"      \\\"after\\\": \\\"2020-01-01T00:00:00Z\\\"\\n\"\n                + \"    }\\n\"\n                + \"  ]\\n\"\n                + \"}\",\n            LogicalAnd.class);\n\n    ContentPattern<?> first = matcher.getAnd().get(0);\n    ContentPattern<?> second = matcher.getAnd().get(1);\n\n    assertThat(first, instanceOf(BeforeDateTimePattern.class));\n    assertThat(first.getExpected(), is(\"2021-01-01T00:00:00Z\"));\n\n    assertThat(second, instanceOf(AfterDateTimePattern.class));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    LogicalAnd a =\n        new LogicalAnd(WireMock.equalTo(\"A\"), WireMock.equalTo(\"B\"), WireMock.equalTo(\"C\"));\n    LogicalAnd b =\n        new LogicalAnd(WireMock.equalTo(\"A\"), WireMock.equalTo(\"B\"), WireMock.equalTo(\"C\"));\n    LogicalAnd c = new LogicalAnd(WireMock.equalTo(\"D\"), WireMock.equalTo(\"E\"));\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n\n  @Test\n  void canSuccessfullyConstructWithAbsentAsFirstMatcher() {\n    assertDoesNotThrow(\n        () ->\n            new LogicalAnd(\n                WireMock.absent(),\n                WireMock.notMatching(\"^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}Z$\")));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/LogicalOrTest.java",
    "content": "/*\n * Copyright (C) 2021-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.*;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Test;\n\npublic class LogicalOrTest {\n\n  @Test\n  public void matchesWhenAnyContainedMatchersMatch() {\n    StringValuePattern matcher =\n        WireMock.or(\n            WireMock.before(\"2020-01-01T00:00:00Z\"), WireMock.after(\"2021-01-01T00:00:00Z\"));\n\n    assertThat(\n        matcher.getExpected(), is(\"before 2020-01-01T00:00:00Z OR after 2021-01-01T00:00:00Z\"));\n\n    assertTrue(matcher.match(\"2022-06-01T11:22:33Z\").isExactMatch());\n    assertTrue(matcher.match(\"2019-06-01T11:22:33Z\").isExactMatch());\n    assertFalse(matcher.match(\"2020-06-01T11:22:33Z\").isExactMatch());\n  }\n\n  @Test\n  public void serialisesCorrectlyToJson() {\n    StringValuePattern matcher =\n        WireMock.or(\n            WireMock.before(\"2020-01-01T00:00:00Z\"), WireMock.after(\"2021-01-01T00:00:00Z\"));\n\n    assertThat(\n        Json.write(matcher),\n        jsonEquals(\n            \"{\\n\"\n                + \"  \\\"or\\\": [\\n\"\n                + \"    {\\n\"\n                + \"      \\\"before\\\": \\\"2020-01-01T00:00:00Z\\\"\\n\"\n                + \"    },\\n\"\n                + \"    {\\n\"\n                + \"      \\\"after\\\": \\\"2021-01-01T00:00:00Z\\\"\\n\"\n                + \"    }\\n\"\n                + \"  ]\\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void deserialisesCorrectlyFromJson() {\n    LogicalOr matcher =\n        Json.read(\n            \"{\\n\"\n                + \"  \\\"or\\\": [\\n\"\n                + \"    {\\n\"\n                + \"      \\\"before\\\": \\\"2020-01-01T00:00:00Z\\\"\\n\"\n                + \"    },\\n\"\n                + \"    {\\n\"\n                + \"      \\\"after\\\": \\\"2021-01-01T00:00:00Z\\\"\\n\"\n                + \"    }\\n\"\n                + \"  ]\\n\"\n                + \"}\",\n            LogicalOr.class);\n\n    ContentPattern<?> first = matcher.getOr().get(0);\n    ContentPattern<?> second = matcher.getOr().get(1);\n\n    assertThat(first, instanceOf(BeforeDateTimePattern.class));\n    assertThat(first.getExpected(), is(\"2020-01-01T00:00:00Z\"));\n\n    assertThat(second, instanceOf(AfterDateTimePattern.class));\n  }\n\n  @Test\n  public void returnsDistanceFromClosestMatchWhenNotAnExactMatch() {\n    LogicalOr matcher =\n        WireMock.equalTo(\"abcde\").or(WireMock.equalTo(\"defgh\")).or(WireMock.equalTo(\"hijkl\"));\n\n    MatchResult matchResult = matcher.match(\"efgh\");\n\n    assertFalse(matchResult.isExactMatch());\n\n    double expectedDistance = WireMock.equalTo(\"defgh\").match(\"efgh\").getDistance();\n    assertThat(matchResult.getDistance(), is(expectedDistance));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    LogicalOr a =\n        new LogicalOr(WireMock.equalTo(\"A\"), WireMock.equalTo(\"B\"), WireMock.equalTo(\"C\"));\n    LogicalOr b =\n        new LogicalOr(WireMock.equalTo(\"A\"), WireMock.equalTo(\"B\"), WireMock.equalTo(\"C\"));\n    LogicalOr c = new LogicalOr(WireMock.equalTo(\"D\"), WireMock.equalTo(\"E\"));\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n\n  @Test\n  void correctlyEvaluatesAbsentOrDoesNotMatch() {\n    LogicalOr matcher =\n        new LogicalOr(\n            WireMock.absent(),\n            WireMock.notMatching(\"^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}Z$\"));\n\n    assertThat(matcher.match(null).isExactMatch(), is(true));\n    assertThat(matcher.match(\"some-non-date-string\").isExactMatch(), is(true));\n    assertThat(matcher.match(\"2023-02-03T12:11:10Z\").isExactMatch(), is(false));\n  }\n\n  @Test\n  void throwsErrorOnConstructionIfOnlyOneMatcherSupplied() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> new LogicalOr(WireMock.equalTo(\"A\")),\n        \"LogicalOr must be constructed with at least two matchers\");\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/MatchResultTest.java",
    "content": "/*\n * Copyright (C) 2016-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.matching.WeightedMatchResult.weight;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.Mockito;\n\npublic class MatchResultTest {\n\n  @Test\n  public void aggregatesLazily() {\n    final MatchResult result1 = new ExceptionThrowingMatchResult();\n    final MatchResult result2 = new ExceptionThrowingMatchResult();\n    final MatchResult result3 = new ExceptionThrowingMatchResult();\n\n    MatchResult.aggregate(\n        result1, result2,\n        result3); // Expecting no exception to be thrown because getDistance is never called\n  }\n\n  @Test\n  void aggregateWeightedIsLazy() {\n    MatchResult match1 = Mockito.spy(MatchResult.exactMatch());\n    MatchResult match2 = Mockito.spy(MatchResult.exactMatch());\n    MatchResult match3 = Mockito.spy(MatchResult.exactMatch());\n    MatchResult nonMatch1 = Mockito.spy(MatchResult.noMatch());\n    MatchResult nonMatch2 = Mockito.spy(MatchResult.noMatch());\n\n    MatchResult matchResult =\n        MatchResult.aggregateWeighted(\n            weight(match1, 5),\n            weight(match2, 2),\n            weight(nonMatch1, 5),\n            weight(match3, 3),\n            weight(nonMatch2, 2));\n\n    boolean isExactMatch = matchResult.isExactMatch();\n\n    assertThat(isExactMatch, is(false));\n    Mockito.verify(match1).isExactMatch();\n    Mockito.verify(match2).isExactMatch();\n    Mockito.verify(nonMatch1).isExactMatch();\n    Mockito.verifyNoInteractions(match3);\n    Mockito.verifyNoInteractions(nonMatch2);\n  }\n\n  @Test\n  void subEventsAreAggregatedForWeightedMatchResultsWhenIsNotAnOverallExactMatch() {\n    MatchResult match1 = MatchResult.exactMatch(SubEvent.info(\"1\"));\n    MatchResult match2 = MatchResult.exactMatch(SubEvent.info(\"2\"));\n    MatchResult match3 = MatchResult.exactMatch(SubEvent.info(\"3\"));\n    MatchResult nonMatch1 = MatchResult.noMatch(SubEvent.info(\"4\"));\n    MatchResult nonMatch2 = MatchResult.noMatch(SubEvent.info(\"5\"));\n\n    MatchResult matchResult =\n        MatchResult.aggregateWeighted(\n            weight(match1, 5),\n            weight(match2, 2),\n            weight(nonMatch1, 5),\n            weight(match3, 3),\n            weight(nonMatch2, 2));\n\n    assertThat(matchResult.getSubEvents().size(), is(3));\n  }\n\n  @Test\n  public void aggregatesDistanceCorrectly() {\n    MatchResult matchResult =\n        MatchResult.aggregate(\n            MatchResult.partialMatch(0.5),\n            MatchResult.partialMatch(0.6),\n            MatchResult.partialMatch(0.7));\n\n    assertThat(matchResult.getDistance(), is(0.6));\n  }\n\n  @Test\n  public void aggregatesExactMatchCorrectly() {\n    MatchResult matchResult =\n        MatchResult.aggregate(\n            MatchResult.exactMatch(),\n            MatchResult.exactMatch(),\n            MatchResult.exactMatch(),\n            MatchResult.exactMatch());\n\n    assertThat(matchResult.isExactMatch(), is(true));\n  }\n\n  @Test\n  public void aggregatesNonExactMatchCorrectly() {\n    MatchResult matchResult =\n        MatchResult.aggregate(\n            MatchResult.exactMatch(),\n            MatchResult.exactMatch(),\n            MatchResult.partialMatch(0.99),\n            MatchResult.exactMatch());\n\n    assertThat(matchResult.isExactMatch(), is(false));\n  }\n\n  public static class ExceptionThrowingMatchResult extends MatchResult {\n\n    @Override\n    public boolean isExactMatch() {\n      return false;\n    }\n\n    @Override\n    public double getDistance() {\n      throw new UnsupportedOperationException();\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/MatchesJsonPathPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.stubbing.SubEvent.WARNING;\nimport static com.github.tomakehurst.wiremock.testsupport.ServeEventChecks.checkMessage;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalToJson;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\nimport static org.junit.jupiter.api.Assertions.*;\nimport static org.mockito.Mockito.verify;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.testsupport.ServeEventChecks;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.Mockito;\n\npublic class MatchesJsonPathPatternTest {\n\n  @BeforeEach\n  public void init() {\n    RequestCache.disable();\n  }\n\n  @Test\n  public void matchesABasicJsonPathWhenTheExpectedElementIsAnEmptyObject() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.empty\");\n    assertTrue(\n        pattern.match(\"{ \\\"empty\\\": {} }\").isExactMatch(),\n        \"Expected match when JSON attribute is an empty object\");\n  }\n\n  @Test\n  public void matchesABasicJsonPathWhenTheExpectedElementIsAnEmptyArray() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.items\");\n    assertTrue(\n        pattern.match(\"{ \\\"items\\\": [] }\").isExactMatch(),\n        \"Expected match when JSON attribute is an empty array (as a value, not a filter result)\");\n  }\n\n  @Test\n  public void matchesNestedEmptyObject() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.outer.inner.empty\");\n    assertTrue(\n        pattern.match(\"{ \\\"outer\\\": { \\\"inner\\\": { \\\"empty\\\": {} } } }\").isExactMatch(),\n        \"Expected match when nested JSON attribute is an empty object\");\n  }\n\n  @Test\n  public void matchesEmptyObjectWithEqualToJsonSubmatcher() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.empty\", WireMock.equalToJson(\"{}\"));\n    assertTrue(\n        pattern.match(\"{ \\\"empty\\\": {} }\").isExactMatch(),\n        \"Expected match when empty object matches the equalToJson submatcher\");\n  }\n\n  @Test\n  public void matchesEmptyArrayWithEqualToJsonSubmatcher() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.items\", WireMock.equalToJson(\"[]\"));\n    assertTrue(\n        pattern.match(\"{ \\\"items\\\": [] }\").isExactMatch(),\n        \"Expected match when empty array matches the equalToJson submatcher\");\n  }\n\n  @Test\n  public void doesNotMatchEmptyObjectWhenSubMatcherExpectsDifferentValue() {\n    StringValuePattern pattern =\n        WireMock.matchingJsonPath(\"$.empty\", WireMock.equalToJson(\"{\\\"key\\\": \\\"value\\\"}\"));\n    assertFalse(\n        pattern.match(\"{ \\\"empty\\\": {} }\").isExactMatch(),\n        \"Expected no match when empty object doesn't match the submatcher\");\n  }\n\n  @Test\n  public void distinguishesBetweenEmptyObjectValueAndFilterResultingInEmptyArray() {\n    // Empty object as a value should match\n    StringValuePattern pattern1 = WireMock.matchingJsonPath(\"$.config\");\n    assertTrue(\n        pattern1.match(\"{ \\\"config\\\": {} }\").isExactMatch(), \"Empty object as value should match\");\n\n    // Filter that returns empty array should not match (existing behavior)\n    StringValuePattern pattern2 = WireMock.matchingJsonPath(\"$.items[?(@.id == 999)]\");\n    assertFalse(\n        pattern2.match(\"{ \\\"items\\\": [{\\\"id\\\": 1}, {\\\"id\\\": 2}] }\").isExactMatch(),\n        \"Filter returning empty result should not match\");\n  }\n\n  @Test\n  public void doesNotMatchWhenDeepScanReturnsNoResults() {\n    // Deep scan (..) is an indefinite path - empty result means no match\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$..missingKey\");\n    assertFalse(\n        pattern.match(\"{ \\\"items\\\": [{\\\"id\\\": 1}, {\\\"id\\\": 2}] }\").isExactMatch(),\n        \"Deep scan returning no results should not match\");\n  }\n\n  @Test\n  public void doesNotMatchWhenWildcardReturnsNoResults() {\n    // Wildcard [*] is an indefinite path - empty result means no match\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.items[*].tags\");\n    assertFalse(\n        pattern.match(\"{ \\\"items\\\": [{\\\"id\\\": 1}, {\\\"id\\\": 2}] }\").isExactMatch(),\n        \"Wildcard returning no results should not match\");\n  }\n\n  @Test\n  public void matchesDefinitePathToEmptyArrayVsIndefinitePathReturningEmpty() {\n    String json = \"{ \\\"items\\\": [], \\\"data\\\": [{\\\"value\\\": 1}] }\";\n\n    // Definite path to an empty array - should match (the array exists and is empty)\n    StringValuePattern definitePattern = WireMock.matchingJsonPath(\"$.items\");\n    assertTrue(\n        definitePattern.match(json).isExactMatch(), \"Definite path to empty array should match\");\n\n    // Indefinite path that returns empty - should not match (no results found)\n    StringValuePattern indefinitePattern = WireMock.matchingJsonPath(\"$.data[?(@.value == 999)]\");\n    assertFalse(\n        indefinitePattern.match(json).isExactMatch(),\n        \"Indefinite path returning empty should not match\");\n  }\n\n  @Test\n  public void matchesABasicJsonPathWhenTheExpectedElementIsPresent() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.one\");\n    assertTrue(\n        pattern.match(\"{ \\\"one\\\": 1 }\").isExactMatch(),\n        \"Expected match when JSON attribute is present\");\n  }\n\n  @Test\n  public void doesNotMatchABasicJsonPathWhenTheExpectedElementIsNotPresent() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.one\");\n    assertFalse(\n        pattern.match(\"{ \\\"two\\\": 2 }\").isExactMatch(),\n        \"Expected no match when JSON attribute is absent\");\n  }\n\n  @Test\n  public void matchesOnJsonPathsWithFilters() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.numbers[?(@.number == 2)]\");\n\n    assertTrue(\n        pattern.match(\"{ \\\"numbers\\\": [ {\\\"number\\\": 1}, {\\\"number\\\": 2} ]}\").isExactMatch(),\n        \"Expected match when JSON attribute is present\");\n    assertFalse(\n        pattern.match(\"{ \\\"numbers\\\": [{\\\"number\\\": 7} ]}\").isExactMatch(),\n        \"Expected no match when JSON attribute is absent\");\n  }\n\n  @Test\n  public void matchesOnJsonPathsWithDecimalFilters() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.numbers[?(@.decimal == '2.3')]\");\n\n    assertTrue(\n        pattern.match(\"{ \\\"numbers\\\": [ {\\\"number\\\": 1}, {\\\"decimal\\\": 2.3} ]}\").isExactMatch(),\n        \"Expected match when JSON attribute is present and the same as the filter\");\n    assertTrue(\n        pattern.match(\"{ \\\"numbers\\\": [ {\\\"number\\\": 1}, {\\\"decimal\\\": 2.3000} ]}\").isExactMatch(),\n        \"Expected match when JSON attribute is present, the same as the filter but with trailing zeros\");\n  }\n\n  @Test\n  public void matchesOnJsonPathsWithDecimalFiltersWithTrailingZeros() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.numbers[?(@.decimal == '2.3000')]\");\n\n    assertTrue(\n        pattern.match(\"{ \\\"numbers\\\": [ {\\\"number\\\": 1}, {\\\"decimal\\\": 2.3} ]}\").isExactMatch(),\n        \"Expected match when JSON attribute is present, the same as the filter but without trailing zeros\");\n    assertTrue(\n        pattern.match(\"{ \\\"numbers\\\": [ {\\\"number\\\": 1}, {\\\"decimal\\\": 2.3000} ]}\").isExactMatch(),\n        \"Expected match when JSON attribute is present and the same as the filter\");\n  }\n\n  @Test\n  public void matchesOnJsonPathsWithRegexFilter() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.numbers[?(@.number =~ /2/i)]\");\n\n    assertTrue(\n        pattern.match(\"{ \\\"numbers\\\": [ {\\\"number\\\": 1}, {\\\"number\\\": 2} ]}\").isExactMatch(),\n        \"Expected match when JSON attribute is present\");\n    assertFalse(\n        pattern.match(\"{ \\\"numbers\\\": [{\\\"number\\\": 7} ]}\").isExactMatch(),\n        \"Expected no match when JSON attribute is absent\");\n  }\n\n  @Test\n  public void matchesOnJsonPathsWithSizeFilter() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$[?(@.numbers.size() == 2)]\");\n\n    assertTrue(\n        pattern.match(\"{ \\\"numbers\\\": [ {\\\"number\\\": 1}, {\\\"number\\\": 2} ]}\").isExactMatch(),\n        \"Expected match when JSON attribute is present\");\n    assertFalse(\n        pattern.match(\"{ \\\"numbers\\\": [{\\\"number\\\": 7} ]}\").isExactMatch(),\n        \"Expected no match when JSON attribute is absent\");\n  }\n\n  @Test\n  public void matchesOnJsonPathsWithFiltersOnNestedObjects() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$..thingOne[?(@.innerOne == 11)]\");\n    assertTrue(\n        pattern\n            .match(\"{ \\\"things\\\": { \\\"thingOne\\\": { \\\"innerOne\\\": 11 }, \\\"thingTwo\\\": 2 }}\")\n            .isExactMatch(),\n        \"Expected match\");\n  }\n\n  @Test\n  public void providesEventMessageWhenJsonMatchFailsDueToInvalidJson() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.something\");\n    MatchResult match = pattern.match(\"Not a JSON document\");\n\n    assertFalse(match.isExactMatch(), \"Expected the match to fail\");\n    checkMessage(\n        match,\n        WARNING,\n        \"Warning: JSON path expression failed to match document 'Not a JSON document' because of error 'Expected to find an object with property ['something'] in path $ but found 'java.lang.String'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.'\");\n  }\n\n  private static void checkWarningMessageAndEvent(\n      Notifier notifier, MatchResult match, String warningMessage) {\n    verify(notifier).info(warningMessage);\n    checkMessage(match, WARNING, warningMessage);\n  }\n\n  @Test\n  public void providesEventMessageWhenJsonMatchFailsDueToMissingAttributeJson() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.something\");\n    MatchResult matchResult = pattern.match(\"{ \\\"nothing\\\": 1 }\");\n\n    assertFalse(matchResult.isExactMatch(), \"Expected the match to fail\");\n    checkMessage(\n        matchResult,\n        WARNING,\n        \"Warning: JSON path expression failed to match document '{ \\\"nothing\\\": 1 }' because of error 'No results for path: $['something']'\");\n  }\n\n  @Test\n  void notifiesWhenMatchingBeingSkippedDueToContentProbablyBeingXml() {\n    Notifier notifier = setMockNotifier();\n\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.something\");\n    MatchResult matchResult = pattern.match(\"<xml-stuff />\");\n\n    assertFalse(matchResult.isExactMatch(), \"Expected the match to fail\");\n    checkWarningMessageAndEvent(\n        notifier,\n        matchResult,\n        \"Warning: JSON path expression failed to match document '<xml-stuff />' because it's not JSON but probably XML\");\n  }\n\n  @Test\n  void subEventsReturnedBySubMatchersAreAddedToServeEvent() {\n    StringValuePattern pattern =\n        WireMock.matchingJsonPath(\"$.something\", WireMock.equalToJson(\"{}\"));\n    MatchResult matchResult = pattern.match(\"{ \\\"something\\\": \\\"{ \\\\\\\"bad\\\\\\\": }\\\" }\");\n\n    assertFalse(matchResult.isExactMatch(), \"Expected the match to fail\");\n    ServeEventChecks.checkJsonError(\n        matchResult,\n        \"Unexpected character ('}' (code 125)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\\n at [Source: (String)\\\"{ \\\"bad\\\": }\\\"; line: 1, column: 10]\");\n  }\n\n  @Test\n  public void doesNotMatchWhenJsonPathWouldResolveToEmptyArray() {\n    String json =\n        \"{\\n\" + \"  \\\"RequestDetail\\\" : {\\n\" + \"    \\\"ClientTag\\\" : \\\"test111\\\"\\n\" + \"  }\\n\" + \"}\";\n\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.RequestDetail.[?(@=='test222')]\");\n    MatchResult match = pattern.match(json);\n    assertFalse(match.isExactMatch());\n  }\n\n  @Test\n  public void noMatchOnNullValue() {\n    assertThat(WireMock.matchingJsonPath(\"$..*\").match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void matchesNumericExpressionResultAgainstValuePatternWhenSpecified() {\n    String json = \"{\\n\" + \"    \\\"volumeControl\\\": {\\n\" + \"        \\\"max\\\": 11\\n\" + \"    }\\n\" + \"}\";\n\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.volumeControl.max\", equalTo(\"11\"));\n    MatchResult match = pattern.match(json);\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void matchesStringExpressionResultAgainstValuePatternWhenSpecified() {\n    String json =\n        \"{\\n\" + \"    \\\"volumeControl\\\": {\\n\" + \"        \\\"max\\\": \\\"eleven\\\"\\n\" + \"    }\\n\" + \"}\";\n\n    StringValuePattern pattern =\n        WireMock.matchingJsonPath(\"$.volumeControl.max\", equalTo(\"eleven\"));\n    MatchResult match = pattern.match(json);\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void matchesBooleanExpressionResultAgainstValuePatternWhenSpecified() {\n    String json =\n        \"{\\n\" + \"    \\\"volumeControl\\\": {\\n\" + \"        \\\"max\\\": true\\n\" + \"    }\\n\" + \"}\";\n\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.volumeControl.max\", equalTo(\"true\"));\n    MatchResult match = pattern.match(json);\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void matchesObjectExpressionResultAgainstValuePatternWhenSpecified() {\n    String json = \"{\\n\" + \"    \\\"volumeControl\\\": {\\n\" + \"        \\\"max\\\": 11\\n\" + \"    }\\n\" + \"}\";\n\n    StringValuePattern pattern =\n        WireMock.matchingJsonPath(\n            \"$.volumeControl\", WireMock.equalToJson(\"{\\n\" + \"    \\\"max\\\": 11\\n\" + \"}\"));\n    MatchResult match = pattern.match(json);\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void matchesArrayExpressionResultAgainstValuePatternWhenSpecified() {\n    String json =\n        \"{\\n\" + \"    \\\"volumeControl\\\": {\\n\" + \"        \\\"max\\\": [1, 2, 3, 11]\\n\" + \"    }\\n\" + \"}\";\n\n    StringValuePattern pattern =\n        WireMock.matchingJsonPath(\"$.volumeControl.max\", WireMock.equalToJson(\"[1,2,3,11]\"));\n    MatchResult match = pattern.match(json);\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void matchesNotPresentExpressionResultAgainstAbsentValuePattern() {\n    String json =\n        \"{\\n\" + \"    \\\"volumeControl\\\": {\\n\" + \"        \\\"max\\\": true\\n\" + \"    }\\n\" + \"}\";\n\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.volumeControl.min\", absent());\n    MatchResult match = pattern.match(json);\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void matchesNullExpressionResultAgainstAbsentValuePattern() {\n    String json =\n        \"{\\n\" + \"    \\\"volumeControl\\\": {\\n\" + \"        \\\"max\\\": null\\n\" + \"    }\\n\" + \"}\";\n\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.volumeControl.max\", absent());\n    MatchResult match = pattern.match(json);\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void returnsTheDistanceFromTheValueMatcherWhenNotAMatch() {\n    String json =\n        \"{\\n\" + \"    \\\"volumeControl\\\": {\\n\" + \"        \\\"max\\\": \\\"eleven\\\"\\n\" + \"    }\\n\" + \"}\";\n\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.volumeControl.max\", equalTo(\"ele\"));\n    MatchResult match = pattern.match(json);\n    assertFalse(match.isExactMatch());\n    assertThat(match.getDistance(), is(0.5));\n  }\n\n  @Test\n  public void correctlySerialises() {\n    assertThat(\n        Json.write(WireMock.matchingJsonPath(\"$..thing\")),\n        equalToJson(\n            \"{                                \\n\"\n                + \"  \\\"matchesJsonPath\\\": \\\"$..thing\\\"       \\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void correctlySerialisesWithValuePattern() {\n    assertThat(\n        Json.write(WireMock.matchingJsonPath(\"$..thing\", containing(\"123\"))),\n        equalToJson(\n            \"{                                      \\n\"\n                + \"    \\\"matchesJsonPath\\\": {              \\n\"\n                + \"        \\\"expression\\\": \\\"$..thing\\\",   \\n\"\n                + \"        \\\"contains\\\": \\\"123\\\"           \\n\"\n                + \"    }                                   \\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void correctlyDeserialises() {\n    StringValuePattern stringValuePattern =\n        Json.read(\n            \"{                                         \\n\"\n                + \"  \\\"matchesJsonPath\\\": \\\"$..thing\\\"       \\n\"\n                + \"}\",\n            StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(MatchesJsonPathPattern.class));\n    assertThat(stringValuePattern.getExpected(), is(\"$..thing\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesWithValuePattern() {\n    StringValuePattern stringValuePattern =\n        Json.read(\n            \"{                                      \\n\"\n                + \"    \\\"matchesJsonPath\\\": {              \\n\"\n                + \"        \\\"expression\\\": \\\"$..thing\\\",   \\n\"\n                + \"        \\\"equalTo\\\": \\\"the value\\\"      \\n\"\n                + \"    }                                   \\n\"\n                + \"}\",\n            StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(MatchesJsonPathPattern.class));\n    assertThat(stringValuePattern.getExpected(), is(\"$..thing\"));\n\n    ContentPattern<?> subMatcher = ((MatchesJsonPathPattern) stringValuePattern).getValuePattern();\n    assertThat(subMatcher, instanceOf(EqualToPattern.class));\n    assertThat(subMatcher.getExpected(), is(\"the value\"));\n  }\n\n  @Test\n  public void correctlyDeserialisesWithAbsentValuePattern() {\n    StringValuePattern stringValuePattern =\n        Json.read(\n            \"{                                      \\n\"\n                + \"    \\\"matchesJsonPath\\\": {              \\n\"\n                + \"        \\\"expression\\\": \\\"$..thing\\\",   \\n\"\n                + \"        \\\"absent\\\": \\\"(absent)\\\"        \\n\"\n                + \"    }                                   \\n\"\n                + \"}\",\n            StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(MatchesJsonPathPattern.class));\n    assertThat(stringValuePattern.getExpected(), is(\"$..thing\"));\n\n    ContentPattern<?> subMatcher = ((MatchesJsonPathPattern) stringValuePattern).getValuePattern();\n    assertThat(subMatcher, instanceOf(AbsentPattern.class));\n    assertThat(((StringValuePattern) subMatcher).nullSafeIsAbsent(), is(true));\n  }\n\n  @Test\n  public void correctlyDeserialisesWhenSubMatcherHasExtraParameters() {\n    StringValuePattern stringValuePattern =\n        Json.read(\n            \"{                                       \\n\"\n                + \"    \\\"matchesJsonPath\\\": {              \\n\"\n                + \"        \\\"expression\\\": \\\"$..thing\\\",   \\n\"\n                + \"        \\\"equalToJson\\\": \\\"{}\\\",        \\n\"\n                + \"        \\\"ignoreExtraElements\\\": true,  \\n\"\n                + \"        \\\"ignoreArrayOrder\\\": true   \\n\"\n                + \"    }                                   \\n\"\n                + \"}\",\n            StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(MatchesJsonPathPattern.class));\n\n    ContentPattern<?> subMatcher = ((MatchesJsonPathPattern) stringValuePattern).getValuePattern();\n    assertThat(subMatcher, instanceOf(EqualToJsonPattern.class));\n    assertThat(subMatcher.getExpected(), jsonEquals(\"{}\"));\n    assertThat(((EqualToJsonPattern) subMatcher).isIgnoreExtraElements(), is(true));\n    assertThat(((EqualToJsonPattern) subMatcher).isIgnoreArrayOrder(), is(true));\n  }\n\n  @Test\n  public void correctlySerialisesWhenSubMatcherHasExtraParameters() {\n    StringValuePattern matcher =\n        new MatchesJsonPathPattern(\"$..thing\", WireMock.equalToJson(\"{}\", true, true));\n\n    String json = Json.write(matcher);\n\n    assertThat(\n        json,\n        jsonEquals(\n            \"{                                       \\n\"\n                + \"    \\\"matchesJsonPath\\\": {              \\n\"\n                + \"        \\\"expression\\\": \\\"$..thing\\\",   \\n\"\n                + \"        \\\"equalToJson\\\": \\\"{}\\\",        \\n\"\n                + \"        \\\"ignoreExtraElements\\\": true,  \\n\"\n                + \"        \\\"ignoreArrayOrder\\\": true      \\n\"\n                + \"    }                                   \\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void throwsSensibleErrorOnDeserialisationWhenPatternIsBadlyFormedWithMissingExpression() {\n    assertThrows(\n        JsonException.class,\n        () ->\n            Json.read(\n                \"{                                      \\n\"\n                    + \"    \\\"matchesJsonPath\\\": {              \\n\"\n                    + \"        \\\"express\\\": \\\"$..thing\\\",      \\n\"\n                    + \"        \\\"equalTo\\\": \\\"the value\\\"      \\n\"\n                    + \"    }                                   \\n\"\n                    + \"}\",\n                StringValuePattern.class));\n  }\n\n  @Test\n  public void\n      throwsSensibleErrorOnDeserialisationWhenPatternIsBadlyFormedWithBadValuePatternName() {\n    assertThrows(\n        JsonException.class,\n        () ->\n            Json.read(\n                \"{                                      \\n\"\n                    + \"    \\\"matchesJsonPath\\\": {              \\n\"\n                    + \"        \\\"expression\\\": \\\"$..thing\\\",   \\n\"\n                    + \"        \\\"badOperator\\\": \\\"the value\\\"  \\n\"\n                    + \"    }                                   \\n\"\n                    + \"}\",\n                StringValuePattern.class));\n  }\n\n  @Test\n  public void equalsIncludesValuePattern() {\n    StringValuePattern pattern1 = matchingJsonPath(\"$.LinkageDetails.AccountId\", equalTo(\"1000\"));\n    StringValuePattern pattern2 = matchingJsonPath(\"$.LinkageDetails.AccountId\", equalTo(\"1001\"));\n    StringValuePattern pattern3 = matchingJsonPath(\"$.LinkageDetails.AccountId\", equalTo(\"1000\"));\n\n    assertThat(pattern1, not(Matchers.equalTo(pattern2)));\n    assertThat(pattern1.hashCode(), not(Matchers.equalTo(pattern2.hashCode())));\n\n    assertThat(pattern1, Matchers.equalTo(pattern3));\n    assertThat(pattern1.hashCode(), Matchers.equalTo(pattern3.hashCode()));\n  }\n\n  @Test\n  public void treatsAnEmptyArrayExpressionResultAsAbsent() {\n    String json =\n        \"{\\n\"\n            + \"  \\\"Books\\\": [\\n\"\n            + \"    {\\n\"\n            + \"      \\\"Author\\\": {\\n\"\n            + \"        \\\"Name\\\": \\\"1234567\\\",\\n\"\n            + \"        \\\"Price\\\": \\\"2.2\\\"\\n\"\n            + \"      }\\n\"\n            + \"    }\\n\"\n            + \"  ]\\n\"\n            + \"}\";\n\n    MatchResult result = matchingJsonPath(\"$..[?(@.Author.ISBN)]\", absent()).match(json);\n\n    assertTrue(result.isExactMatch());\n  }\n\n  @Test\n  public void matchesCorrectlyWhenSubMatcherIsUsedAndExpressionReturnsASingleItemArray() {\n    String json =\n        \"{\\n\"\n            + \"   \\\"searchCriteria\\\": {\\n\"\n            + \"      \\\"customerId\\\": \\\"104903\\\",\\n\"\n            + \"      \\\"date\\\": \\\"01/01/2021\\\"\\n\"\n            + \"   }\\n\"\n            + \"}\";\n\n    MatchResult result =\n        matchingJsonPath(\n                \"$.searchCriteria[?(@.customerId == '104903')].date\",\n                equalToDateTime(\"2021-01-01T00:00:00\").actualFormat(\"dd/MM/yyyy\"))\n            .match(json);\n\n    assertTrue(result.isExactMatch());\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    MatchesJsonPathPattern a =\n        new MatchesJsonPathPattern(\"$.searchCriteria[?(@.customerId == '104903')].date\");\n    MatchesJsonPathPattern b =\n        new MatchesJsonPathPattern(\"$.searchCriteria[?(@.customerId == '104903')].date\");\n    MatchesJsonPathPattern c =\n        new MatchesJsonPathPattern(\"$.searchCriteria[?(@.customerId == '1234')].date\");\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n\n  @Test\n  void shouldSafelyHandleNullAndResultInNoMatch() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.data.*\", WireMock.equalTo(\"true\"));\n    String json = \"{\\\"data\\\": {\\\"prop1\\\": false, \\\"prop2\\\": null}}\";\n\n    MatchResult result = pattern.match(json);\n    assertFalse(result.isExactMatch());\n  }\n\n  @Test\n  void shouldHandleNullAndNumberMixedAndResultInNoMatch() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.data.*\", WireMock.equalTo(\"100\"));\n    String json = \"{\\\"data\\\": {\\\"prop1\\\": 200, \\\"prop2\\\": null}}\";\n\n    MatchResult result = pattern.match(json);\n    assertFalse(result.isExactMatch());\n  }\n\n  @Test\n  void shouldMatchSuccessfullyWhenExtractedValueIsNull() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.data.*\", WireMock.equalTo(\"null\"));\n    String json = \"{\\\"data\\\": {\\\"prop1\\\": null, \\\"prop2\\\": 123}}\";\n\n    MatchResult result = pattern.match(json);\n    assertTrue(result.isExactMatch());\n  }\n\n  @Test\n  void shouldMatchSuccessfullyWhenAllExtractedValuesAreNull() {\n    StringValuePattern pattern = WireMock.matchingJsonPath(\"$.data.*\", WireMock.equalTo(\"null\"));\n    String json = \"{\\\"data\\\": {\\\"prop1\\\": null, \\\"prop2\\\": null, \\\"prop3\\\": null}}\";\n\n    MatchResult result = pattern.match(json);\n    assertTrue(result.isExactMatch());\n  }\n\n  private static Notifier setMockNotifier() {\n    final Notifier notifier = Mockito.mock(Notifier.class);\n    LocalNotifier.set(notifier);\n    return notifier;\n  }\n\n  @AfterEach\n  public void cleanUp() {\n    LocalNotifier.set(null);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/MatchesJsonSchemaPatternTest.java",
    "content": "/*\n * Copyright (C) 2023-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.JsonSchemaVersion.V4;\nimport static com.github.tomakehurst.wiremock.client.WireMock.JsonSchemaVersion.V6;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonSchema;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.file;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.jayway.jsonpath.JsonPath;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Stream;\nimport org.hamcrest.Description;\nimport org.hamcrest.TypeSafeMatcher;\nimport org.junit.jupiter.api.Disabled;\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 org.junit.jupiter.params.provider.ValueSource;\n\npublic class MatchesJsonSchemaPatternTest {\n\n  @Test\n  void distanceIsProportionateToNumberOfValidationErrors() {\n    String schema = file(\"schema-validation/shop-order.schema.json\");\n\n    MatchesJsonSchemaPattern pattern = new MatchesJsonSchemaPattern(schema);\n\n    MatchResult veryBadMatchResult = pattern.match(\"{}\");\n    assertThat(veryBadMatchResult.isExactMatch(), is(false));\n    assertThat(veryBadMatchResult.getDistance(), closeTo(0.66, 0.01));\n\n    MatchResult lessBadMatchResult =\n        pattern.match(file(\"schema-validation/shop-order.slightly-wrong.json\"));\n    assertThat(lessBadMatchResult.isExactMatch(), is(false));\n    assertThat(lessBadMatchResult.getDistance(), closeTo(0.33, 0.01));\n  }\n\n  private static List<String> invalidContent() {\n    return Arrays.asList(null, \"\", \"not json\", \"{\");\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"invalidContent\")\n  void invalidContentGivesNoMatch(String content) {\n    String schema = file(\"schema-validation/shop-order.schema.json\");\n\n    MatchesJsonSchemaPattern pattern = new MatchesJsonSchemaPattern(schema);\n\n    MatchResult veryBadMatchResult = pattern.match(content);\n\n    assertThat(veryBadMatchResult.isExactMatch(), is(false));\n    assertThat(veryBadMatchResult.getDistance(), greaterThan(0.33));\n  }\n\n  @Test\n  void serialisesToJsonCorrectlyWithDefaultSchemaVersion() {\n    String schema = file(\"schema-validation/shop-order.schema.json\");\n    MatchesJsonSchemaPattern pattern = new MatchesJsonSchemaPattern(schema);\n\n    String json = Json.write(pattern);\n    String schemaString = JsonPath.read(json, \"$.matchesJsonSchema\");\n    assertThat(schemaString, jsonEquals(schema));\n  }\n\n  @Test\n  void serialisesToJsonCorrectlyWithProvidedSchemaVersion() {\n    String schema = file(\"schema-validation/shop-order.schema.json\");\n    MatchesJsonSchemaPattern pattern =\n        new MatchesJsonSchemaPattern(schema, WireMock.JsonSchemaVersion.V4);\n\n    String json = Json.write(pattern);\n    String schemaString = JsonPath.read(json, \"$.matchesJsonSchema\");\n    assertThat(schemaString, jsonEquals(schema));\n  }\n\n  @Test\n  void deserialisesFromJsonStringCorrectlyWithDefaultSchemaVersion() {\n    String schemaJson =\n        \"{\\n\"\n            + \"    \\\"required\\\": [\\n\"\n            + \"      \\\"itemCatalogueId\\\",\\n\"\n            + \"      \\\"quantity\\\"\\n\"\n            + \"    ],\\n\"\n            + \"    \\\"properties\\\": {\\n\"\n            + \"      \\\"itemCatalogueId\\\": {\\n\"\n            + \"        \\\"type\\\": \\\"string\\\"\\n\"\n            + \"      },\\n\"\n            + \"      \\\"quantity\\\": {\\n\"\n            + \"        \\\"type\\\": \\\"integer\\\"\\n\"\n            + \"      },\\n\"\n            + \"      \\\"fastDelivery\\\": {\\n\"\n            + \"        \\\"type\\\": \\\"boolean\\\"\\n\"\n            + \"      }\\n\"\n            + \"    }\\n\"\n            + \"  }\";\n\n    String matcherJson = \"{\\n\" + \"  \\\"matchesJsonSchema\\\": \" + stringify(schemaJson) + \"\\n\" + \"}\";\n\n    StringValuePattern pattern = Json.read(matcherJson, StringValuePattern.class);\n\n    assertThat(pattern, instanceOf(MatchesJsonSchemaPattern.class));\n    assertThat(((MatchesJsonSchemaPattern) pattern).getMatchesJsonSchema(), jsonEquals(schemaJson));\n  }\n\n  @Test\n  void deserialisesFromJsonStringCorrectlyWithProvidedSchemaVersion() {\n    String schemaJson =\n        \"{\\n\"\n            + \"    \\\"properties\\\": {\\n\"\n            + \"      \\\"itemCatalogueId\\\": {\\n\"\n            + \"        \\\"type\\\": \\\"string\\\"\\n\"\n            + \"      }\\n\"\n            + \"    }\\n\"\n            + \"  }\";\n\n    String matcherJson =\n        \"{\\n\"\n            + \"  \\\"matchesJsonSchema\\\": \"\n            + stringify(schemaJson)\n            + \",\\n\"\n            + \"  \\\"schemaVersion\\\": \\\"V6\\\"\\n\"\n            + \"}\";\n\n    StringValuePattern pattern = Json.read(matcherJson, StringValuePattern.class);\n\n    assertThat(pattern, instanceOf(MatchesJsonSchemaPattern.class));\n    assertThat(((MatchesJsonSchemaPattern) pattern).getMatchesJsonSchema(), jsonEquals(schemaJson));\n    assertThat(((MatchesJsonSchemaPattern) pattern).getSchemaVersion(), is(V6));\n  }\n\n  @Test\n  void deserialisesFromJsonValueCorrectlyWithDefaultSchemaVersion() {\n    String schemaJson =\n        \"{\\n\"\n            + \"    \\\"required\\\": [\\n\"\n            + \"      \\\"itemCatalogueId\\\",\\n\"\n            + \"      \\\"quantity\\\"\\n\"\n            + \"    ],\\n\"\n            + \"    \\\"properties\\\": {\\n\"\n            + \"      \\\"itemCatalogueId\\\": {\\n\"\n            + \"        \\\"type\\\": \\\"string\\\"\\n\"\n            + \"      },\\n\"\n            + \"      \\\"quantity\\\": {\\n\"\n            + \"        \\\"type\\\": \\\"integer\\\"\\n\"\n            + \"      },\\n\"\n            + \"      \\\"fastDelivery\\\": {\\n\"\n            + \"        \\\"type\\\": \\\"boolean\\\"\\n\"\n            + \"      }\\n\"\n            + \"    }\\n\"\n            + \"  }\";\n\n    String matcherJson = \"{\\n\" + \"  \\\"matchesJsonSchema\\\": \" + schemaJson + \"\\n\" + \"}\";\n\n    StringValuePattern pattern = Json.read(matcherJson, StringValuePattern.class);\n\n    assertThat(pattern, instanceOf(MatchesJsonSchemaPattern.class));\n    assertThat(((MatchesJsonSchemaPattern) pattern).getMatchesJsonSchema(), jsonEquals(schemaJson));\n  }\n\n  @Test\n  void deserialisesFromJsonValueCorrectlyWithProvidedSchemaVersion() {\n    String schemaJson =\n        \"{\\n\"\n            + \"    \\\"properties\\\": {\\n\"\n            + \"      \\\"itemCatalogueId\\\": {\\n\"\n            + \"        \\\"type\\\": \\\"string\\\"\\n\"\n            + \"      }\\n\"\n            + \"    }\\n\"\n            + \"  }\";\n\n    String matcherJson =\n        \"{\\n\"\n            + \"  \\\"matchesJsonSchema\\\": \"\n            + schemaJson\n            + \",\\n\"\n            + \"  \\\"schemaVersion\\\": \\\"V6\\\"\\n\"\n            + \"}\";\n\n    StringValuePattern pattern = Json.read(matcherJson, StringValuePattern.class);\n\n    assertThat(pattern, instanceOf(MatchesJsonSchemaPattern.class));\n    assertThat(((MatchesJsonSchemaPattern) pattern).getMatchesJsonSchema(), jsonEquals(schemaJson));\n    assertThat(((MatchesJsonSchemaPattern) pattern).getSchemaVersion(), is(V6));\n  }\n\n  private static final StringValuePattern stringSchema =\n      matchingJsonSchema(\n          \"{\" + \"\\\"type\\\": \\\"string\\\",\" + \"\\\"minLength\\\": 2,\" + \"\\\"maxLength\\\": 4\" + \"}\");\n\n  @ParameterizedTest\n  @MethodSource(\"validStrings\")\n  void matchesAString(String toMatch) {\n    MatchResult match = stringSchema.match(toMatch);\n    assertThat(match.isExactMatch(), is(true));\n  }\n\n  private static Stream<Arguments> validStrings() {\n    return Stream.of(\n        Arguments.of(\"\\\"12\\\"\"),\n        Arguments.of(\"\\\"123\\\"\"),\n        Arguments.of(\"\\\"1234\\\"\"),\n        Arguments.of(\"12\"),\n        Arguments.of(\"123\"),\n        Arguments.of(\"1234\"));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"invalidStrings\")\n  void doesNotMatchAnInvalidString(String toMatch) {\n    MatchResult match = stringSchema.match(toMatch);\n\n    assertThat(match.isExactMatch(), is(false));\n    assertThat(match.getDistance(), is(1.0));\n  }\n\n  private static Stream<Arguments> invalidStrings() {\n    return Stream.of(\n        Arguments.of(\"\"),\n        Arguments.of(\"\\\"\\\"\"),\n        Arguments.of(\"\\\"1\\\"\"),\n        Arguments.of(\"\\\"12345\\\"\"),\n        Arguments.of(\"1\"),\n        Arguments.of(\"12345\"));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"simpleRefSchemaMatchingExamples\")\n  void simpleRefMatches(String input) {\n    String schema = file(\"schema-validation/has-ref.schema.json\");\n\n    MatchesJsonSchemaPattern pattern =\n        new MatchesJsonSchemaPattern(schema, WireMock.JsonSchemaVersion.V4);\n\n    MatchResult match = pattern.match(input);\n\n    assertThat(match.isExactMatch(), is(true));\n  }\n\n  private static Stream<Arguments> simpleRefSchemaMatchingExamples() {\n    return Stream.of(\n        Arguments.of(\"{ \\\"things\\\": [] }\"),\n        Arguments.of(\"{ \\\"things\\\": [ 1 ] }\"),\n        Arguments.of(\"{ \\\"things\\\": [ 1, 2 ] }\"));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"simpleRefSchemaNonMatchingExamples\")\n  void simpleRefRejectsNonMatches(String input) {\n    String schema = file(\"schema-validation/has-ref.schema.json\");\n\n    MatchesJsonSchemaPattern pattern =\n        new MatchesJsonSchemaPattern(schema, WireMock.JsonSchemaVersion.V4);\n\n    MatchResult match = pattern.match(input);\n\n    assertThat(match.isExactMatch(), is(false));\n  }\n\n  private static Stream<Arguments> simpleRefSchemaNonMatchingExamples() {\n    return Stream.of(\n        Arguments.of(\"{}\"),\n        Arguments.of(\"{ \\\"not_things\\\": null }\"),\n        Arguments.of(\"{ \\\"not_things\\\": [] }\"),\n        Arguments.of(\"{ \\\"things\\\": null }\"),\n        Arguments.of(\"{ \\\"things\\\": {} }\"),\n        Arguments.of(\"{ \\\"things\\\": 1 }\"),\n        Arguments.of(\"{ \\\"things\\\": [ \\\"1\\\" ] }\"));\n  }\n\n  @ParameterizedTest\n  @Disabled\n  @MethodSource(\"recursiveSchemaMatchingExamples\")\n  void recursiveRefExactMatchesCorrectlyMatched(String input) {\n    String schema = file(\"schema-validation/recursive.schema.json\");\n\n    MatchesJsonSchemaPattern pattern = new MatchesJsonSchemaPattern(schema, V4);\n\n    MatchResult match = pattern.match(input);\n\n    assertThat(match.isExactMatch(), is(true));\n  }\n\n  private static Stream<Arguments> recursiveSchemaMatchingExamples() {\n    return Stream.of(\n        Arguments.of(\"{ \\\"name\\\": \\\"no_children\\\" }\"),\n        Arguments.of(\"{ \\\"name\\\": \\\"no_children\\\", \\\"children\\\": null }\"),\n        Arguments.of(\"{ \\\"name\\\": \\\"no_children\\\", \\\"children\\\": [] }\"),\n        Arguments.of(\n            \"{ \\\"name\\\": \\\"no_grandchildren\\\", \\\"children\\\": [{ \\\"name\\\": \\\"no_children\\\", \\\"children\\\": [] }] }\"));\n  }\n\n  @ParameterizedTest\n  @Disabled\n  @MethodSource(\"recursiveSchemaNonMatchingExamples\")\n  void recursiveRefNonMatchesCorrectlyMatched(String input) {\n    String schema = file(\"schema-validation/recursive.schema.json\");\n\n    MatchesJsonSchemaPattern pattern = new MatchesJsonSchemaPattern(schema, V4);\n\n    MatchResult match = pattern.match(input);\n\n    assertThat(match.isExactMatch(), is(false));\n  }\n\n  @Test\n  void corercesNumericActualValueToJsonNumber() {\n    String schema = file(\"schema-validation/numeric.schema.json\");\n\n    MatchesJsonSchemaPattern pattern =\n        new MatchesJsonSchemaPattern(schema, WireMock.JsonSchemaVersion.V4);\n\n    assertThat(pattern.match(\"5\").isExactMatch(), is(true));\n    assertThat(pattern.match(\"0\").isExactMatch(), is(true));\n    assertThat(pattern.match(\"100\").isExactMatch(), is(true));\n    assertThat(pattern.match(\"10a\").isExactMatch(), is(false));\n    assertThat(pattern.match(\"101\").isExactMatch(), is(false));\n  }\n\n  @Test\n  void coercesNumericActualValueToJsonString() {\n    String schema = file(\"schema-validation/stringy.schema.json\");\n\n    MatchesJsonSchemaPattern pattern =\n        new MatchesJsonSchemaPattern(schema, WireMock.JsonSchemaVersion.V4);\n\n    assertThat(pattern.match(\"abcd\").isExactMatch(), is(true));\n    assertThat(pattern.match(\"abcde\").isExactMatch(), is(true));\n    assertThat(pattern.match(\"abcdef\").isExactMatch(), is(false));\n    assertThat(pattern.match(\"1\").isExactMatch(), is(true));\n    assertThat(pattern.match(\"12345\").isExactMatch(), is(true));\n    assertThat(pattern.match(\"123456\").isExactMatch(), is(false));\n  }\n\n  private static Stream<Arguments> recursiveSchemaNonMatchingExamples() {\n    return Stream.of(\n        Arguments.of(\"{}\"),\n        Arguments.of(\"{ \\\"not_a_name\\\": null }\"),\n        Arguments.of(\"{ \\\"name\\\": \\\"invalid_child\\\", \\\"children\\\": [{}] }\"),\n        Arguments.of(\n            \"{ \\\"name\\\": \\\"invalid_grandchild\\\", \\\"children\\\": [{ \\\"name\\\": \\\"invalid_child\\\", \\\"children\\\": [{}] }] }\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"{\\\"id\\\": 1, \\\"name\\\": \\\"alice\\\"}\",\n        \"{\\\"type\\\": \\\"array\\\", \\\"items\\\": {\\\"$ref\\\": \\\"#/does/not/exist\\\"}}\",\n      })\n  void invalidJsonSchemaNeverMatches(String schema) {\n    MatchesJsonSchemaPattern pattern = new MatchesJsonSchemaPattern(schema);\n\n    assertThat(pattern.match(\"{\\\"field\\\":\\\"value\\\"}\").isExactMatch(), is(false));\n    assertThat(pattern.match(\"\\\"json string\\\"\").isExactMatch(), is(false));\n    assertThat(pattern.match(\"{\\\"id\\\":1,\\\"name\\\":\\\"alice\\\"}\").isExactMatch(), is(false));\n    assertThat(pattern.match(\"[{\\\"id\\\":1,\\\"name\\\":\\\"alice\\\"}]\").isExactMatch(), is(false));\n  }\n\n  @Test\n  void invalidJsonSchemaMatchResultsContainExplanatorySubEvent() {\n    class SubEventMatcher extends TypeSafeMatcher<SubEvent> {\n\n      private final Map<String, Object> expectedData;\n\n      SubEventMatcher(Errors expectedData) {\n        this.expectedData = Json.objectToMap(expectedData);\n      }\n\n      @Override\n      protected boolean matchesSafely(SubEvent item) {\n        return item.getType().equals(SubEvent.ERROR) && item.getData().equals(expectedData);\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\n            \"a sub event of type \" + SubEvent.ERROR + \" with data \" + expectedData);\n      }\n    }\n\n    MatchResult matchResult1 =\n        new MatchesJsonSchemaPattern(\"{\\\"id\\\":1,\\\"name\\\":\\\"alice\\\"}\")\n            .match(\"{\\\"field\\\":\\\"value\\\"}\");\n    assertThat(matchResult1.isExactMatch(), is(false));\n    Errors expectedErrors1 =\n        Errors.singleWithDetail(10, \"Invalid JSON Schema\", \"No suitable validator for id\");\n    assertThat(matchResult1.getSubEvents(), contains(new SubEventMatcher(expectedErrors1)));\n\n    MatchResult matchResult2 =\n        new MatchesJsonSchemaPattern(\n                \"{\\\"type\\\": \\\"array\\\", \\\"items\\\": {\\\"$ref\\\": \\\"#/does/not/exist\\\"}}\")\n            .match(\"[{\\\"id\\\":1,\\\"name\\\":\\\"alice\\\"}]\");\n    assertThat(matchResult2.isExactMatch(), is(false));\n    Errors expectedErrors2 =\n        Errors.singleWithDetail(\n            10, \"Invalid JSON Schema\", \": Reference /does/not/exist cannot be resolved\");\n    assertThat(matchResult2.getSubEvents(), contains(new SubEventMatcher(expectedErrors2)));\n\n    // Check for false positives.\n    MatchResult matchResult3 =\n        new MatchesJsonSchemaPattern(\"{\\\"type\\\": \\\"string\\\"}\").match(\"\\\"my value\\\"\");\n    assertThat(matchResult3.isExactMatch(), is(true));\n    assertThat(\n        matchResult3.getSubEvents(),\n        not(\n            contains(\n                new TypeSafeMatcher<>() {\n                  @Override\n                  protected boolean matchesSafely(SubEvent item) {\n                    return item.getType().equals(SubEvent.ERROR);\n                  }\n\n                  @Override\n                  public void describeTo(Description description) {\n                    description.appendText(\"a sub event of type \" + SubEvent.ERROR);\n                  }\n                })));\n  }\n\n  private static String stringify(String json) {\n    return \"\\\"\" + json.replace(\"\\n\", \"\").replace(\"\\\"\", \"\\\\\\\"\") + \"\\\"\";\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/MatchesXPathPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.stubbing.SubEvent.WARNING;\nimport static com.github.tomakehurst.wiremock.testsupport.ServeEventChecks.checkJsonError;\nimport static com.github.tomakehurst.wiremock.testsupport.ServeEventChecks.checkMessage;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalToJson;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.util.Collections;\nimport java.util.Map;\nimport org.json.JSONException;\nimport org.junit.jupiter.api.Test;\nimport org.skyscreamer.jsonassert.JSONAssert;\n\npublic class MatchesXPathPatternTest {\n\n  @Test\n  public void returnsExactMatchWhenXPathMatches() {\n    String mySolarSystemXML =\n        \"<solar-system>\"\n            + \"<planet name='Earth' position='3' supportsLife='yes'/>\"\n            + \"<planet name='Venus' position='4'/></solar-system>\";\n\n    StringValuePattern pattern = WireMock.matchingXPath(\"//planet[@name='Earth']\");\n\n    MatchResult match = pattern.match(mySolarSystemXML);\n    assertTrue(match.isExactMatch(), \"Expected XPath match\");\n    assertThat(match.getDistance(), is(0.0));\n  }\n\n  @Test\n  public void returnsNoExactMatchWhenXPathDoesNotMatch() {\n    String mySolarSystemXML =\n        \"<solar-system>\"\n            + \"<planet name='Earth' position='3' supportsLife='yes'/>\"\n            + \"<planet name='Venus' position='4'/></solar-system>\";\n\n    StringValuePattern pattern = WireMock.matchingXPath(\"//star[@name='alpha centauri']\");\n\n    MatchResult match = pattern.match(mySolarSystemXML);\n    assertFalse(match.isExactMatch(), \"Expected XPath non-match\");\n    assertThat(match.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void returnsNoExactMatchWhenXPathExpressionIsInvalid() {\n    String mySolarSystemXML =\n        \"<solar-system>\"\n            + \"<planet name='Earth' position='3' supportsLife='yes'/>\"\n            + \"<planet name='Venus' position='4'/></solar-system>\";\n\n    StringValuePattern pattern = WireMock.matchingXPath(\"//\\\\\\\\&&&&&\");\n\n    MatchResult match = pattern.match(mySolarSystemXML);\n    assertFalse(match.isExactMatch(), \"Expected XPath non-match\");\n    assertThat(match.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void returnsNoExactMatchWhenXmlIsBadlyFormed() {\n    String mySolarSystemXML =\n        \"solar-system>\"\n            + \"<planet name='Earth' position='3' supportsLife='yes'/>\"\n            + \"<planet name='Venus' position='4'/></solar-system>\";\n\n    StringValuePattern pattern = WireMock.matchingXPath(\"//star[@name='alpha centauri']\");\n\n    MatchResult match = pattern.match(mySolarSystemXML);\n    assertFalse(match.isExactMatch(), \"Expected XPath non-match\");\n    assertThat(match.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void matchesNamespacedXmlWhenNamespacesSpecified() {\n    String xml =\n        \"<t:thing xmlns:t='http://things' xmlns:s='http://subthings'><s:subThing>The stuff</s:subThing></t:thing>\";\n\n    StringValuePattern pattern =\n        WireMock.matchingXPath(\n            \"//sub:subThing[.='The stuff']\",\n            Map.of(\"sub\", \"http://subthings\", \"t\", \"http://things\"));\n\n    MatchResult match = pattern.match(xml);\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void matchesNamespacedXmlFromLocalNames() {\n    String xml =\n        \"<t:thing xmlns:t='http://things' xmlns:s='http://subthings'><s:subThing>The stuff</s:subThing></t:thing>\";\n\n    StringValuePattern pattern = WireMock.matchingXPath(\"/thing/subThing[.='The stuff']\");\n\n    MatchResult match = pattern.match(xml);\n    assertTrue(match.isExactMatch());\n  }\n\n  @Test\n  public void matchesAgainstValuePatternWhenSingleElementReturnedFromXPath() {\n    String xml = \"<outer>\\n\" + \"    <inner>stuff</inner>\\n\" + \"</outer>\";\n\n    StringValuePattern pattern = WireMock.matchingXPath(\"//inner/text()\", matching(\"[a-z]*\"));\n\n    assertThat(pattern.match(xml).isExactMatch(), is(true));\n  }\n\n  @Test\n  public void matchesAgainstValuePatternWhenMultipleElementsReturnedFromXPath() {\n    String xml =\n        \"<outer>\\n\"\n            + \"    <inner>stuffing</inner>\\n\"\n            + \"    <inner>stuffed</inner>\\n\"\n            + \"    <inner>stuff</inner>\\n\"\n            + \"    <inner>stuffable</inner>\\n\"\n            + \"</outer>\";\n\n    StringValuePattern pattern =\n        WireMock.matchingXPath(\"//inner/text()\", WireMock.equalTo(\"stuff\"));\n\n    assertThat(pattern.match(xml).isExactMatch(), is(true));\n  }\n\n  @Test\n  public void returnsTheMatchFromTheClosestElementWhenNoneMatchExactly() {\n    String xml =\n        \"<outer>\\n\"\n            + \"    <inner>stuffing</inner>\\n\"\n            + \"    <inner>stuffed</inner>\\n\"\n            + \"    <inner>stuffy</inner>\\n\"\n            + \"    <inner>stuffable</inner>\\n\"\n            + \"</outer>\";\n\n    StringValuePattern pattern =\n        WireMock.matchingXPath(\"//inner/text()\", WireMock.equalTo(\"stuff\"));\n\n    assertThat(pattern.match(xml).getDistance(), closeTo(0.16, 0.01));\n  }\n\n  @Test\n  public void matchesAttributeAgainstValuePattern() {\n    String xml = \"<outer inner=\\\"stuff\\\"/>\";\n\n    StringValuePattern pattern =\n        WireMock.matchingXPath(\"/outer/@inner\", equalToIgnoreCase(\"Stuff\"));\n\n    assertThat(pattern.match(xml).isExactMatch(), is(true));\n  }\n\n  @Test\n  public void returnsAMaxDistanceNoMatchWhenNoNodesReturnedAndValuePatternIsPresent() {\n    String xml = \"<outer inner=\\\"stuff\\\"/>\";\n\n    StringValuePattern pattern =\n        WireMock.matchingXPath(\"/outer/@nothing\", equalToIgnoreCase(\"Stuff\"));\n\n    assertThat(pattern.match(xml).isExactMatch(), is(false));\n    assertThat(pattern.match(xml).getDistance(), is(1.0));\n  }\n\n  @Test\n  public void matchesComplexElementAgainstValuePattern() {\n    String xml = \"<outer>\\n\" + \"    <inner>stuff</inner>\\n\" + \"</outer>\";\n\n    StringValuePattern pattern =\n        WireMock.matchingXPath(\"/outer/inner\", equalToXml(\"<inner>stuff</inner>\"));\n\n    assertThat(pattern.match(xml).isExactMatch(), is(true));\n  }\n\n  @Test\n  public void matchesCorrectlyWhenSubMatcherIsDateEquality() {\n    String xml =\n        \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\"\n            + \"<soapenv:Envelope>\\n\"\n            + \"    <soapenv:Body>\\n\"\n            + \"        <Retrieve>\\n\"\n            + \"            <Policy>\\n\"\n            + \"                <EffectiveDate Val=\\\"01/01/2021\\\" />\\n\"\n            + \"                <Policy Val=\\\"ABC123\\\" />\\n\"\n            + \"            </Policy>\\n\"\n            + \"        </Retrieve>\\n\"\n            + \"    </soapenv:Body>\\n\"\n            + \"</soapenv:Envelope>\";\n\n    StringValuePattern pattern =\n        WireMock.matchesXPathWithSubMatcher(\n            \"//*[local-name() = 'EffectiveDate']/@Val\",\n            equalToDateTime(\"2021-01-01T00:00:00\").actualFormat(\"dd/MM/yyyy\"));\n\n    assertThat(pattern.match(xml).isExactMatch(), is(true));\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithoutNamespaces() {\n    String json = \"{ \\\"matchesXPath\\\" : \\\"/stuff:outer/stuff:inner[.=111]\\\" }\";\n\n    MatchesXPathPattern pattern = Json.read(json, MatchesXPathPattern.class);\n\n    assertThat(pattern.getMatchesXPath(), is(\"/stuff:outer/stuff:inner[.=111]\"));\n    assertThat(pattern.getXPathNamespaces(), nullValue());\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithNamespaces() {\n    String json =\n        \"{ \\\"matchesXPath\\\" : \\\"/stuff:outer/stuff:inner[.=111]\\\" ,   \\n\"\n            + \"  \\\"xPathNamespaces\\\" : {                                    \\n\"\n            + \"      \\\"one\\\" : \\\"http://one.com/\\\",                         \\n\"\n            + \"      \\\"two\\\" : \\\"http://two.com/\\\"                          \\n\"\n            + \"  }                                                          \\n\"\n            + \"}\";\n\n    MatchesXPathPattern pattern = Json.read(json, MatchesXPathPattern.class);\n\n    assertThat(pattern.getXPathNamespaces(), hasEntry(\"one\", \"http://one.com/\"));\n    assertThat(pattern.getXPathNamespaces(), hasEntry(\"two\", \"http://two.com/\"));\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithValuePattern() {\n    String json =\n        \"{                                      \\n\"\n            + \"    \\\"matchesXPath\\\": {                 \\n\"\n            + \"        \\\"expression\\\": \\\"/thing\\\",     \\n\"\n            + \"        \\\"matches\\\": \\\"[0-9]*\\\"         \\n\"\n            + \"    }                                   \\n\"\n            + \"}\";\n\n    MatchesXPathPattern pattern = Json.read(json, MatchesXPathPattern.class);\n\n    assertThat(pattern.getValuePattern(), instanceOf(RegexPattern.class));\n    assertThat(pattern.getExpected(), is(\"/thing\"));\n    assertThat(pattern.getValuePattern().getExpected(), is(\"[0-9]*\"));\n  }\n\n  @Test\n  public void serialisesCorrectlyWithNamspaces() throws JSONException {\n    MatchesXPathPattern pattern =\n        new MatchesXPathPattern(\"//*\", Map.of(\"one\", \"http://one.com/\", \"two\", \"http://two.com/\"));\n\n    String json = Json.write(pattern);\n\n    JSONAssert.assertEquals(\n        \"{ \\\"matchesXPath\\\" : \\\"//*\\\" ,   \\n\"\n            + \"  \\\"xPathNamespaces\\\" : {                                    \\n\"\n            + \"      \\\"one\\\" : \\\"http://one.com/\\\",                         \\n\"\n            + \"      \\\"two\\\" : \\\"http://two.com/\\\"                          \\n\"\n            + \"  }                                                          \\n\"\n            + \"}\",\n        json,\n        false);\n  }\n\n  @Test\n  public void serialisesCorrectlyWithoutNamspaces() throws JSONException {\n    MatchesXPathPattern pattern = new MatchesXPathPattern(\"//*\", Collections.emptyMap());\n\n    String json = Json.write(pattern);\n\n    JSONAssert.assertEquals(\"{ \\\"matchesXPath\\\" : \\\"//*\\\" }\", json, false);\n  }\n\n  @Test\n  public void serialisesCorrectlyWithValuePattern() {\n    assertThat(\n        Json.write(WireMock.matchingXPath(\"/thing\", containing(\"123\"))),\n        equalToJson(\n            \"{                                      \\n\"\n                + \"    \\\"matchesXPath\\\": {                 \\n\"\n                + \"        \\\"expression\\\": \\\"/thing\\\",     \\n\"\n                + \"        \\\"contains\\\": \\\"123\\\"           \\n\"\n                + \"    }                                   \\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void noMatchOnNullValue() {\n    assertThat(WireMock.matchingXPath(\"//*\").match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  void reportsErrorWhenActualXmlIsInvalid() {\n    MatchResult matchResult = new MatchesXPathPattern(\"/thing\").match(\"<xml\");\n    checkMessage(\n        matchResult,\n        WARNING,\n        \"Warning: failed to parse the XML document. Reason: {\\n  \\\"errors\\\" : [ {\\n    \\\"code\\\" : 50,\\n    \\\"title\\\" : \\\"XML document structures must start and end within the same entity.\\\"\\n  } ]\\n}\\nXML: <xml\");\n  }\n\n  @Test\n  void reportsErrorWhenActualIsNotXml() {\n    MatchResult matchResult = new MatchesXPathPattern(\"/thing\").match(\"{not-xml\");\n    checkMessage(matchResult, WARNING, \"Warning: failed to parse the XML document\\nXML: {not-xml\");\n  }\n\n  @Test\n  void reportsErrorFromSubMatcher() {\n    MatchResult matchResult =\n        new MatchesXPathPattern(\"/something/text()\", WireMock.equalToJson(\"{}\"))\n            .match(\"<something>{ bad json</something>\");\n    checkJsonError(\n        matchResult,\n        \"Unexpected character ('b' (code 98)): was expecting double-quote to start field name\\n at [Source: (String)\\\"{ bad json\\\"; line: 1, column: 3]\");\n  }\n\n  @Test\n  void reportsErrorWhenXPathExpressionIsInvalid() {\n    MatchResult matchResult = new MatchesXPathPattern(\"/\\\\!what?\").match(\"<things/>\");\n    checkMessage(\n        matchResult, WARNING, \"Warning: failed to evaluate the XPath expression /\\\\!what?\");\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    MatchesXPathPattern a = new MatchesXPathPattern(\"/thing\");\n    MatchesXPathPattern b = new MatchesXPathPattern(\"/thing\");\n    MatchesXPathPattern c = new MatchesXPathPattern(\"/other\");\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/MockMultipart.java",
    "content": "/*\n * Copyright (C) 2018-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.github.tomakehurst.wiremock.http.Body;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Objects;\n\npublic class MockMultipart implements Request.Part {\n\n  private String name;\n  private String filename;\n  private List<HttpHeader> headers = new ArrayList<>();\n  private Body body;\n\n  public static MockMultipart mockPart() {\n    return new MockMultipart();\n  }\n\n  public MockMultipart name(String name) {\n    this.name = name;\n    return this;\n  }\n\n  public MockMultipart filename(String filename) {\n    this.filename = filename;\n    return this;\n  }\n\n  public MockMultipart headers(List<HttpHeader> headers) {\n    this.headers = headers;\n    return this;\n  }\n\n  public MockMultipart header(String key, String... values) {\n    headers.add(new HttpHeader(key, values));\n    return this;\n  }\n\n  public MockMultipart body(String body) {\n    this.body = new Body(body);\n    return this;\n  }\n\n  public MockMultipart body(byte[] body) {\n    this.body = new Body(body);\n    return this;\n  }\n\n  @Override\n  public String getName() {\n    return name;\n  }\n\n  @Override\n  public String getFileName() {\n    return filename;\n  }\n\n  @Override\n  public HttpHeader getHeader(String key) {\n    return getHeaders().getHeader(key);\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    return new HttpHeaders(headers);\n  }\n\n  @Override\n  public Body getBody() {\n    return body;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    MockMultipart that = (MockMultipart) o;\n    return Objects.equals(name, that.name)\n        && Objects.equals(filename, that.filename)\n        && Objects.equals(headers, that.headers)\n        && Objects.equals(body, that.body);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(name, filename, headers, body);\n  }\n\n  @Override\n  public String toString() {\n    final StringBuilder sb = new StringBuilder(\"MockMultipart{\");\n    sb.append(\"name='\").append(name).append('\\'');\n    sb.append(\"filename='\").append(filename).append('\\'');\n    sb.append(\", headers=\").append(headers);\n    sb.append(\", body=\").append(body);\n    sb.append('}');\n    return sb.toString();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/MockRequest.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.common.Strings.bytesFromString;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static java.util.Arrays.asList;\n\nimport com.github.tomakehurst.wiremock.MultipartParserLoader;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.util.*;\nimport org.jspecify.annotations.NonNull;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\n\npublic class MockRequest implements Request {\n\n  private UUID id = UUID.randomUUID();\n\n  private String scheme = \"http\";\n  private String host = \"my.domain\";\n  private int port = 80;\n  private @NonNull String url = \"/\";\n\n  private @Nullable String absoluteUrl = null;\n  private RequestMethod method = RequestMethod.ANY;\n  private HttpHeaders headers = new HttpHeaders();\n\n  private final Map<String, Cookie> cookies = new HashMap<>();\n  private byte[] body;\n  private String clientIp = \"1.1.1.1\";\n  private Collection<Part> multiparts = null;\n\n  private Map<String, FormParameter> formParameters = new HashMap<>();\n  private boolean isBrowserProxyRequest = false;\n  private String protocol = \"HTTP/1.1\";\n\n  public static MockRequest mockRequest() {\n    return new MockRequest();\n  }\n\n  public MockRequest id(UUID id) {\n    this.id = id;\n    return this;\n  }\n\n  public MockRequest scheme(String scheme) {\n    this.scheme = scheme;\n    return this;\n  }\n\n  public MockRequest host(String host) {\n    this.host = host;\n    return this;\n  }\n\n  public MockRequest port(int port) {\n    this.port = port;\n    return this;\n  }\n\n  public MockRequest url(String url) {\n    this.url = url;\n    return this;\n  }\n\n  public MockRequest absoluteUrl(@Nullable String absoluteUrl) {\n    this.absoluteUrl = absoluteUrl;\n    return this;\n  }\n\n  public MockRequest method(RequestMethod method) {\n    this.method = method;\n    return this;\n  }\n\n  public MockRequest header(String key, String... values) {\n    headers = headers.plus(httpHeader(key, values));\n    return this;\n  }\n\n  public MockRequest headers(HttpHeaders headers) {\n    this.headers = headers;\n    return this;\n  }\n\n  public MockRequest cookie(String key, String... values) {\n    cookies.put(key, new Cookie(asList(values)));\n    return this;\n  }\n\n  public MockRequest body(String body) {\n    this.body = body.getBytes(UTF_8);\n    return this;\n  }\n\n  public MockRequest body(byte[] body) {\n    this.body = body;\n    return this;\n  }\n\n  public MockRequest clientIp(String clientIp) {\n    this.clientIp = clientIp;\n    return this;\n  }\n\n  public MockRequest parts(Collection<Part> multiparts) {\n    this.multiparts = multiparts;\n    return this;\n  }\n\n  public MockRequest part(MockMultipart part) {\n    if (multiparts == null) {\n      multiparts = new ArrayList<>();\n    }\n\n    multiparts.add(part);\n    return this;\n  }\n\n  public MockRequest formParameters(Map<String, FormParameter> formParameters) {\n    if (formParameters != null) {\n      this.formParameters = formParameters;\n    }\n    return this;\n  }\n\n  public MockRequest isBrowserProxyRequest(boolean isBrowserProxyRequest) {\n    this.isBrowserProxyRequest = isBrowserProxyRequest;\n    return this;\n  }\n\n  public MockRequest protocol(String protocol) {\n    this.protocol = protocol;\n    return this;\n  }\n\n  @Override\n  public UUID getId() {\n    return id;\n  }\n\n  @Override\n  public @NonNull String getUrl() {\n    return url;\n  }\n\n  @Override\n  public @NonNull PathAndQuery getPathAndQueryWithoutPrefix() {\n    return PathAndQuery.parse(getUrl());\n  }\n\n  @Override\n  public @NonNull String getAbsoluteUrl() {\n    String portPart = port == 80 || port == 443 ? \"\" : \":\" + port;\n    return getFirstNonNull(absoluteUrl, String.format(\"%s://%s%s%s\", scheme, host, portPart, url));\n  }\n\n  @Override\n  public @NonNull AbsoluteUrl getTypedAbsoluteUrl() {\n    return AbsoluteUrl.parse(getAbsoluteUrl());\n  }\n\n  @Override\n  public RequestMethod getMethod() {\n    return method;\n  }\n\n  @Override\n  public String getScheme() {\n    return scheme;\n  }\n\n  @Override\n  public String getHost() {\n    return host;\n  }\n\n  @Override\n  public int getPort() {\n    return port;\n  }\n\n  @Override\n  public String getClientIp() {\n    return clientIp;\n  }\n\n  @Override\n  public String getHeader(String key) {\n    return header(key).firstValue();\n  }\n\n  @Override\n  public HttpHeader header(final String key) {\n    return headers.all().stream()\n        .filter(input -> input.keyEquals(key))\n        .findFirst()\n        .orElseGet(() -> HttpHeader.absent(key));\n  }\n\n  @Override\n  public ContentTypeHeader contentTypeHeader() {\n    return ContentTypeHeader.absent();\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    return headers;\n  }\n\n  @Override\n  public boolean containsHeader(String key) {\n    return headers.getHeader(key).isPresent();\n  }\n\n  @Override\n  public Set<String> getAllHeaderKeys() {\n    return getHeaders().keys();\n  }\n\n  @Override\n  public Map<String, Cookie> getCookies() {\n    return cookies;\n  }\n\n  @Override\n  public FormParameter formParameter(String key) {\n    return getFirstNonNull(formParameters.get(key), FormParameter.absent(key));\n  }\n\n  @Override\n  public Map<String, FormParameter> formParameters() {\n    return formParameters;\n  }\n\n  @Override\n  public byte[] getBody() {\n    return body;\n  }\n\n  @Override\n  public String getBodyAsString() {\n    return body != null ? new String(body) : null;\n  }\n\n  @Override\n  public String getBodyAsBase64() {\n    return \"\";\n  }\n\n  @Override\n  public boolean isBrowserProxyRequest() {\n    return isBrowserProxyRequest;\n  }\n\n  @Override\n  public Optional<Request> getOriginalRequest() {\n    return Optional.empty();\n  }\n\n  @Override\n  public String getProtocol() {\n    return protocol;\n  }\n\n  public LoggedRequest asLoggedRequest() {\n    return LoggedRequest.createFrom(this);\n  }\n\n  @Override\n  public boolean isMultipart() {\n    return getParts() != null;\n  }\n\n  @Override\n  public Collection<Part> getParts() {\n    return multiparts;\n  }\n\n  @Override\n  public Part getPart(final String name) {\n    return (getParts() != null && name != null)\n        ? multiparts.stream().filter(input -> name.equals(input.getName())).findFirst().orElse(null)\n        : null;\n  }\n\n  public MockRequest multipartBody(String body) {\n    ContentTypeHeader contentTypeHeader = headers.getContentTypeHeader();\n    String contentType =\n        contentTypeHeader.isPresent()\n            ? contentTypeHeader.firstValue()\n            : \"multipart/form-data; boundary=BOUNDARY\";\n    this.multiparts = MultipartParserLoader.parts(bytesFromString(body), contentType);\n\n    return this;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/MultiValuePatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.absent;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static com.github.tomakehurst.wiremock.http.QueryParameter.queryParam;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.lessThan;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.skyscreamer.jsonassert.JSONAssert;\n\npublic class MultiValuePatternTest {\n\n  public static final String EXPECTED_DATE_TIME = \"2024-01-01T00:00:00.000Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_MILLI_EARLIER = \"2023-12-31T23:59:59.999Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_MILLI_LATER = \"2024-01-01T00:00:00.001Z\";\n  public static final String ACTUAL_DATE_TIME_TWO_MILLIS_EARLIER = \"2023-12-31T23:59:59.998Z\";\n  public static final String ACTUAL_DATE_TIME_TWO_MILLIS_LATER = \"2024-01-01T00:00:00.002Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_DAY_EARLIER = \"2023-12-31T00:00:00.000Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_DAY_LATER = \"2024-01-02T00:00:00.000Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_YEAR_EARLIER = \"2023-01-01T00:00:00.000Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_YEAR_LATER = \"2025-01-01T00:00:00.000Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_CENTURY_EARLIER = \"1924-01-01T00:00:00.000Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_CENTURY_LATER = \"2124-01-01T00:00:00.000Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_MILLENIUM_EARLIER = \"1024-01-01T00:00:00.000Z\";\n  public static final String ACTUAL_DATE_TIME_ONE_MILLENIUM_LATER = \"3024-01-01T00:00:00.000Z\";\n\n  @Test\n  public void returnsExactMatchForAbsentHeaderWhenRequiredAbsent() {\n    assertTrue(MultiValuePattern.absent().match(HttpHeader.absent(\"any-key\")).isExactMatch());\n  }\n\n  @Test\n  public void returnsNonMatchForPresentHeaderWhenRequiredAbsent() {\n    assertFalse(\n        MultiValuePattern.absent().match(httpHeader(\"the-key\", \"the value\")).isExactMatch());\n  }\n\n  @Test\n  public void returnsNonMatchForAbsentHeaderWhenRequiredBeforeNow() {\n    assertFalse(\n        MultiValuePattern.of(beforeNow()).match(HttpHeader.absent(\"any-key\")).isExactMatch());\n  }\n\n  @Test\n  public void returnsExactMatchForPresentHeaderWhenRequiredPresent() {\n    assertTrue(\n        MultiValuePattern.of(equalTo(\"required-value\"))\n            .match(httpHeader(\"the-key\", \"required-value\"))\n            .isExactMatch());\n  }\n\n  @Test\n  public void returnsNonMatchForAbsentHeaderWhenRequiredPresent() {\n    MatchResult matchResult =\n        MultiValuePattern.of(equalTo(\"required-value\")).match(absent(\"the-key\"));\n\n    assertFalse(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void returnsNonZeroDistanceWhenHeaderValuesAreSimilar() {\n    assertThat(\n        MultiValuePattern.of(equalTo(\"required-value\"))\n            .match(httpHeader(\"any-key\", \"require1234567\"))\n            .getDistance(),\n        is(0.5));\n  }\n\n  @Test\n  public void returnsTheBestMatchWhenSeveralHeaderValuesAreAvailableAndNoneAreExact() {\n    assertThat(\n        MultiValuePattern.of(equalTo(\"required-value\"))\n            .match(httpHeader(\"any-key\", \"require1234567\", \"requi12345\", \"1234567rrrr\"))\n            .getDistance(),\n        is(0.5));\n  }\n\n  @Test\n  public void returnsTheBestMatchWhenSeveralHeaderDateTimeValuesAreAvailableAndNoneAreExact() {\n    double distanceOfOneMilliDifference =\n        MultiValuePattern.of(equalToDateTime(EXPECTED_DATE_TIME))\n            .match(\n                httpHeader(\n                    \"any-key\",\n                    ACTUAL_DATE_TIME_ONE_MILLI_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_MILLI_LATER))\n            .getDistance();\n    double distanceOfGreaterThanOneMilliDifference =\n        MultiValuePattern.of(equalToDateTime(EXPECTED_DATE_TIME))\n            .match(\n                httpHeader(\n                    \"any-key\",\n                    ACTUAL_DATE_TIME_TWO_MILLIS_EARLIER,\n                    ACTUAL_DATE_TIME_TWO_MILLIS_LATER,\n                    ACTUAL_DATE_TIME_ONE_DAY_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_DAY_LATER,\n                    ACTUAL_DATE_TIME_ONE_YEAR_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_YEAR_LATER,\n                    ACTUAL_DATE_TIME_ONE_CENTURY_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_CENTURY_LATER,\n                    ACTUAL_DATE_TIME_ONE_MILLENIUM_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_MILLENIUM_LATER))\n            .getDistance();\n    assertThat(distanceOfOneMilliDifference, lessThan(distanceOfGreaterThanOneMilliDifference));\n  }\n\n  @Test\n  public void returnsTheBestMatchWhenSeveralHeaderValuesAreAvailableAndOneIsExact() {\n    assertTrue(\n        MultiValuePattern.of(equalTo(\"required-value\"))\n            .match(httpHeader(\"any-key\", \"require1234567\", \"required-value\", \"1234567rrrr\"))\n            .isExactMatch());\n  }\n\n  @Test\n  public void returnsTheBestMatchWhenSeveralHeaderDateTimeValuesAreAvailableAndOneIsExact() {\n    assertTrue(\n        MultiValuePattern.of(equalToDateTime(EXPECTED_DATE_TIME))\n            .match(\n                httpHeader(\n                    \"any-key\",\n                    ACTUAL_DATE_TIME_ONE_MILLI_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_MILLI_LATER,\n                    ACTUAL_DATE_TIME_TWO_MILLIS_EARLIER,\n                    ACTUAL_DATE_TIME_TWO_MILLIS_LATER,\n                    ACTUAL_DATE_TIME_ONE_DAY_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_DAY_LATER,\n                    ACTUAL_DATE_TIME_ONE_YEAR_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_YEAR_LATER,\n                    ACTUAL_DATE_TIME_ONE_CENTURY_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_CENTURY_LATER,\n                    ACTUAL_DATE_TIME_ONE_MILLENIUM_EARLIER,\n                    ACTUAL_DATE_TIME_ONE_MILLENIUM_LATER,\n                    EXPECTED_DATE_TIME))\n            .isExactMatch());\n  }\n\n  @Test\n  public void returnsTheBestMatchWhenSeveralQueryParamValuesAreAvailableAndOneIsExact() {\n    assertTrue(\n        MultiValuePattern.of(equalTo(\"required-value\"))\n            .match(queryParam(\"any-key\", \"require1234567\", \"required-value\", \"1234567rrrr\"))\n            .isExactMatch());\n  }\n\n  @Test\n  public void correctlyRendersEqualToAsJson() throws Exception {\n    String actual = Json.write(MultiValuePattern.of(equalTo(\"something\")));\n    JSONAssert.assertEquals(\n        \"{                              \\n\" + \"  \\\"equalTo\\\": \\\"something\\\"   \\n\" + \"}\",\n        actual,\n        true);\n  }\n\n  @Test\n  public void correctlyRendersAbsentAsJson() throws Exception {\n    String actual = Json.write(MultiValuePattern.absent());\n    JSONAssert.assertEquals(\n        \"{                   \\n\" + \"  \\\"absent\\\": true   \\n\" + \"}\", actual, true);\n  }\n\n  @Test\n  public void equalsChecksSingleValuePattern() {\n    MultiValuePattern a = new SingleMatchMultiValuePattern(equalTo(\"something\"));\n    MultiValuePattern b = new SingleMatchMultiValuePattern(equalTo(\"something else\"));\n    MultiValuePattern c = new SingleMatchMultiValuePattern(equalTo(\"something\"));\n    MultiValuePattern d = new ExactMatchMultiValuePattern(List.of(equalTo(\"something\")));\n    assertNotEquals(a, b);\n    assertEquals(a, c);\n    assertNotEquals(a, d);\n  }\n\n  @Test\n  public void equalsChecksExactMatchPattern() {\n    MultiValuePattern a =\n        new ExactMatchMultiValuePattern(List.of(equalTo(\"something\"), equalTo(\"another thing\")));\n    MultiValuePattern b = new ExactMatchMultiValuePattern(List.of(equalTo(\"something\")));\n    MultiValuePattern c =\n        new ExactMatchMultiValuePattern(List.of(equalTo(\"something\"), equalTo(\"another thing\")));\n    MultiValuePattern d =\n        new ExactMatchMultiValuePattern(\n            List.of(equalTo(\"something\"), equalTo(\"a different thing\")));\n    MultiValuePattern e =\n        new IncludesMatchMultiValuePattern(List.of(equalTo(\"something\"), equalTo(\"another thing\")));\n    assertNotEquals(a, b);\n    assertEquals(a, c);\n    assertNotEquals(a, d);\n    assertNotEquals(a, e);\n  }\n\n  @Test\n  public void equalsChecksIncludesMatchPattern() {\n    MultiValuePattern a =\n        new IncludesMatchMultiValuePattern(List.of(equalTo(\"something\"), equalTo(\"another thing\")));\n    MultiValuePattern b = new IncludesMatchMultiValuePattern(List.of(equalTo(\"something\")));\n    MultiValuePattern c =\n        new IncludesMatchMultiValuePattern(List.of(equalTo(\"something\"), equalTo(\"another thing\")));\n    MultiValuePattern d =\n        new IncludesMatchMultiValuePattern(\n            List.of(equalTo(\"something\"), equalTo(\"a different thing\")));\n    MultiValuePattern e =\n        new ExactMatchMultiValuePattern(List.of(equalTo(\"something\"), equalTo(\"another thing\")));\n    assertNotEquals(a, b);\n    assertEquals(a, c);\n    assertNotEquals(a, d);\n    assertNotEquals(a, e);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/MultipartValuePatternBuilderTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class MultipartValuePatternBuilderTest {\n\n  @Test\n  public void testBuilderDefaultType() {\n    MultipartValuePattern pattern = aMultipart(\"name\").build();\n    assertTrue(pattern.isMatchAny());\n    assertFalse(pattern.isMatchAll());\n  }\n\n  @Test\n  public void testBuilderAnyType() {\n    MultipartValuePattern pattern =\n        aMultipart(\"name\").matchingType(MultipartValuePattern.MatchingType.ANY).build();\n\n    assertTrue(pattern.isMatchAny());\n    assertFalse(pattern.isMatchAll());\n  }\n\n  @Test\n  public void testBuilderAllType() {\n    MultipartValuePattern pattern =\n        aMultipart(\"name\").matchingType(MultipartValuePattern.MatchingType.ALL).build();\n\n    assertTrue(pattern.isMatchAll());\n    assertFalse(pattern.isMatchAny());\n  }\n\n  @Test\n  public void testBuilderWithNameHeadersAndBody() {\n    MultipartValuePattern pattern =\n        aMultipart(\"name\")\n            .withHeader(\"X-Header\", containing(\"something\"))\n            .withHeader(\"X-Other\", absent())\n            .withBody(equalToXml(\"<xml />\"))\n            .build();\n\n    List<ContentPattern<?>> bodyPatterns = List.of(equalToXml(\"<xml />\"));\n    assertThat(bodyPatterns, everyItem(is(in(pattern.getBodyPatterns()))));\n  }\n\n  @Test\n  public void testBuilderWithNameNoHeadersAndNoBody() {\n    MultipartValuePattern pattern = aMultipart().build();\n    assertNull(pattern);\n  }\n\n  @Test\n  public void testBuilderWithoutNameWithHeadersAndBody() {\n    MultipartValuePattern pattern =\n        aMultipart()\n            .withHeader(\"X-Header\", containing(\"something\"))\n            .withHeader(\"X-Other\", absent())\n            .withBody(equalToXml(\"<xml />\"))\n            .build();\n\n    List<ContentPattern<?>> bodyPatterns = List.of(equalToXml(\"<xml />\"));\n    assertThat(bodyPatterns, everyItem(is(in(pattern.getBodyPatterns()))));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/MultipartValuePatternTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.core.Is.is;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.testsupport.WireMatchers;\nimport org.json.JSONException;\nimport org.junit.jupiter.api.Test;\nimport org.skyscreamer.jsonassert.JSONAssert;\n\npublic class MultipartValuePatternTest {\n\n  @Test\n  public void deserialisesCorrectlyWhenNoBodyOrHeaderMatchersPresent() {\n    String serializedPattern = \"{\\n\" + \"    \\\"matchingType\\\": \\\"ANY\\\"\" + \"}\";\n\n    MultipartValuePattern pattern = Json.read(serializedPattern, MultipartValuePattern.class);\n    assertTrue(pattern.isMatchAny());\n    assertFalse(pattern.isMatchAll());\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithTypeAllAndSingleHeaderMatcher() {\n    String serializedPattern =\n        \"{                                           \\n\"\n            + \"    \\\"matchingType\\\": \\\"ALL\\\",              \\n\"\n            + \"    \\\"headers\\\": {                          \\n\"\n            + \"        \\\"Content-Disposition\\\": {\\n        \\n\"\n            + \"            \\\"contains\\\": \\\"name=\\\\\\\"part1\\\\\\\"\\\"\\n\"\n            + \"        }\\n\"\n            + \"    }\"\n            + \"}\";\n\n    MultipartValuePattern pattern = Json.read(serializedPattern, MultipartValuePattern.class);\n\n    StringValuePattern headerPattern =\n        ((SingleMatchMultiValuePattern) pattern.getHeaders().get(\"Content-Disposition\"))\n            .getValuePattern();\n    assertThat(headerPattern, instanceOf(ContainsPattern.class));\n    assertThat(headerPattern.getValue(), is(\"name=\\\"part1\\\"\"));\n\n    assertNull(pattern.getBodyPatterns());\n    assertTrue(pattern.isMatchAll());\n    assertFalse(pattern.isMatchAny());\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithSingleJsonBodyMatcer() throws JSONException {\n    String expectedJson = \"{ \\\"someKey\\\": \\\"someValue\\\" }\";\n    String serializedPattern =\n        \"{                                                \\n\"\n            + \"    \\\"matchingType\\\": \\\"ANY\\\",                   \\n\"\n            + \"    \\\"bodyPatterns\\\": [                          \\n\"\n            + \"        { \\\"equalToJson\\\": \"\n            + expectedJson\n            + \" }\\n\"\n            + \"    ]\\n\"\n            + \"}\";\n\n    MultipartValuePattern pattern = Json.read(serializedPattern, MultipartValuePattern.class);\n\n    JSONAssert.assertEquals(pattern.getBodyPatterns().get(0).getExpected(), expectedJson, false);\n\n    assertNull(pattern.getHeaders());\n    assertTrue(pattern.isMatchAny());\n    assertFalse(pattern.isMatchAll());\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithANYMatchTypeWithMultipleHeaderAndBodyMatchers()\n      throws JSONException {\n    String expectedJson = \"{ \\\"someKey\\\": \\\"someValue\\\" }\";\n    String serializedPattern =\n        \"{\\n\"\n            + \"    \\\"matchingType\\\": \\\"ANY\\\",\\n\"\n            + \"    \\\"headers\\\": {\\n\"\n            + \"        \\\"Content-Disposition\\\": \\n\"\n            + \"            {\\n\"\n            + \"                \\\"contains\\\": \\\"name=\\\\\\\"part1\\\\\\\"\\\"\\n\"\n            + \"            }\\n\"\n            + \"        ,\\n\"\n            + \"        \\\"Content-Type\\\": \\n\"\n            + \"            {\\n\"\n            + \"                \\\"contains\\\": \\\"application/json\\\"\\n\"\n            + \"            }\"\n            + \"        \\n\"\n            + \"    },\\n\"\n            + \"    \\\"bodyPatterns\\\": [\\n\"\n            + \"        {\\n\"\n            + \"            \\\"equalToJson\\\": \"\n            + expectedJson\n            + \"\\n\"\n            + \"        }\\n\"\n            + \"    ]\\n\"\n            + \"}\";\n\n    MultipartValuePattern pattern = Json.read(serializedPattern, MultipartValuePattern.class);\n\n    assertThat(\n        pattern.getBodyPatterns().get(0).getExpected(), WireMatchers.equalToJson(expectedJson));\n\n    SingleMatchMultiValuePattern contentTypeHeaderPattern =\n        (SingleMatchMultiValuePattern) pattern.getHeaders().get(\"Content-Type\");\n    assertThat(contentTypeHeaderPattern.getValuePattern(), instanceOf(ContainsPattern.class));\n    assertThat(contentTypeHeaderPattern.getValuePattern().getExpected(), is(\"application/json\"));\n    assertTrue(pattern.isMatchAny());\n    assertFalse(pattern.isMatchAll());\n  }\n\n  @Test\n  public void deserialisesCorrectlyWithHeadersAndBinaryBody() {\n    String expectedBinary = \"RG9jdW1lbnQgYm9keSBjb250ZW50cw==\";\n    String serializedPattern =\n        \"{\\n\"\n            + \"    \\\"name\\\": \\\"my_part_name\\\",\\n\"\n            + \"    \\\"matchingType\\\": \\\"ALL\\\",\\n\"\n            + \"    \\\"headers\\\": {\\n\"\n            + \"        \\\"Content-Disposition\\\": \\n\"\n            + \"            {\\n\"\n            + \"                \\\"contains\\\": \\\"name=\\\\\\\"file\\\\\\\"\\\"\\n\"\n            + \"            }\\n\"\n            + \"        ,\\n\"\n            + \"        \\\"Content-Type\\\": \\n\"\n            + \"            {\\n\"\n            + \"                \\\"equalTo\\\": \\\"application/octet-stream\\\"\\n\"\n            + \"            }\\n\"\n            + \"        \\n\"\n            + \"    },\\n\"\n            + \"    \\\"bodyPatterns\\\": [\\n\"\n            + \"        {\\n\"\n            + \"            \\\"binaryEqualTo\\\": \\\"\"\n            + expectedBinary\n            + \"\\\"\\n\"\n            + \"        }\\n\"\n            + \"    ]\\n\"\n            + \"}\";\n\n    MultipartValuePattern pattern = Json.read(serializedPattern, MultipartValuePattern.class);\n\n    assertThat(pattern.getName(), is(\"my_part_name\"));\n    assertEquals(pattern.getBodyPatterns().get(0).getExpected(), expectedBinary);\n    assertThat(\n        ((SingleMatchMultiValuePattern) pattern.getHeaders().get(\"Content-Type\"))\n            .getValuePattern()\n            .getExpected(),\n        is(\"application/octet-stream\"));\n    assertTrue(pattern.isMatchAll());\n    assertFalse(pattern.isMatchAny());\n  }\n\n  @Test\n  public void serialisesCorrectlyWithMultipleHeaderAndBodyMatchers() {\n    MultipartValuePattern pattern =\n        aMultipart()\n            .withName(\"title\")\n            .withHeader(\"X-First-Header\", equalTo(\"One\"))\n            .withHeader(\"X-Second-Header\", matching(\".*2\"))\n            .withBody(equalToJson(\"{ \\\"thing\\\": 123 }\"))\n            .build();\n\n    String json = Json.write(pattern);\n\n    assertThat(\n        json,\n        WireMatchers.equalToJson(\n            \"{\\n\"\n                + \"  \\\"name\\\" : \\\"title\\\",\\n\"\n                + \"  \\\"matchingType\\\" : \\\"ANY\\\",\\n\"\n                + \"  \\\"headers\\\" : {\\n\"\n                + \"    \\\"Content-Disposition\\\" : {\\n\"\n                + \"      \\\"contains\\\" : \\\"name=\\\\\\\"title\\\\\\\"\\\"\\n\"\n                + \"    },\\n\"\n                + \"    \\\"X-First-Header\\\" : {\\n\"\n                + \"      \\\"equalTo\\\" : \\\"One\\\"\\n\"\n                + \"    },\\n\"\n                + \"    \\\"X-Second-Header\\\" : {\\n\"\n                + \"      \\\"matches\\\" : \\\".*2\\\"\\n\"\n                + \"    }\\n\"\n                + \"  },\\n\"\n                + \"  \\\"bodyPatterns\\\" : [ {\\n\"\n                + \"    \\\"equalToJson\\\" : \\\"{ \\\\\\\"thing\\\\\\\": 123 }\\\"\\n\"\n                + \"  } ]\\n\"\n                + \"}\"));\n  }\n\n  @Test\n  public void equalsShouldReturnTrueOnSameObject() {\n    MultipartValuePattern pattern =\n        aMultipart()\n            .withName(\"title\")\n            .withHeader(\"X-First-Header\", equalTo(\"One\"))\n            .withHeader(\"X-Second-Header\", matching(\".*2\"))\n            .withBody(equalToJson(\"{ \\\"thing\\\": 123 }\"))\n            .build();\n\n    assertThat(pattern.equals(pattern), is(true));\n    assertEquals(pattern.hashCode(), pattern.hashCode());\n  }\n\n  @Test\n  public void equalsShouldReturnTrueOnIdenticalButNotSameObjects() {\n    MultipartValuePattern patternA =\n        aMultipart()\n            .withName(\"title\")\n            .withHeader(\"X-First-Header\", equalTo(\"One\"))\n            .withHeader(\"X-Second-Header\", matching(\".*2\"))\n            .withBody(equalToJson(\"{ \\\"thing\\\": 123 }\"))\n            .build();\n\n    MultipartValuePattern patternB =\n        aMultipart()\n            .withName(\"title\")\n            .withHeader(\"X-First-Header\", equalTo(\"One\"))\n            .withHeader(\"X-Second-Header\", matching(\".*2\"))\n            .withBody(equalToJson(\"{ \\\"thing\\\": 123 }\"))\n            .build();\n\n    assertThat(patternA.equals(patternB), is(true));\n    assertEquals(patternA.hashCode(), patternB.hashCode());\n  }\n\n  @Test\n  public void equalsShouldReturnFalseOnDifferentObjects() {\n    MultipartValuePattern patternA =\n        aMultipart()\n            .withName(\"title\")\n            .withHeader(\"X-First-Header\", equalTo(\"One\"))\n            .withHeader(\"X-Second-Header\", matching(\".*2\"))\n            .withBody(equalToJson(\"{ \\\"thing\\\": 123 }\"))\n            .build();\n\n    MultipartValuePattern patternB =\n        aMultipart()\n            .withName(\"anotherTitle\")\n            .withHeader(\"X-Second-Header\", matching(\".*2\"))\n            .withBody(equalToJson(\"{ \\\"thing\\\": \\\"abc\\\" }\"))\n            .build();\n\n    assertThat(patternA.equals(patternB), is(false));\n    assertNotEquals(patternA.hashCode(), patternB.hashCode());\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    MultipartValuePattern patternA =\n        aMultipart()\n            .withName(\"title\")\n            .withHeader(\"X-First-Header\", equalTo(\"One\"))\n            .withHeader(\"X-Second-Header\", matching(\".*2\"))\n            .withBody(binaryEqualTo(\"RG9jdW1lbnQgYm9keSBjb250ZW50cw==\"))\n            .build();\n\n    MultipartValuePattern patternB =\n        aMultipart()\n            .withName(\"title\")\n            .withHeader(\"X-First-Header\", equalTo(\"One\"))\n            .withHeader(\"X-Second-Header\", matching(\".*2\"))\n            .withBody(binaryEqualTo(\"RG9jdW1lbnQgYm9keSBjb250ZW50cw==\"))\n            .build();\n\n    MultipartValuePattern patternC =\n        aMultipart()\n            .withName(\"Description\")\n            .withHeader(\"X-First-Header\", equalTo(\"Second\"))\n            .withBody(binaryEqualTo(\"SGVsbG9Xb3JsZA==\"))\n            .build();\n\n    assertEquals(patternA, patternB);\n    assertEquals(patternA.hashCode(), patternB.hashCode());\n    assertEquals(patternB, patternA);\n    assertEquals(patternB.hashCode(), patternA.hashCode());\n    assertNotEquals(patternA, patternC);\n    assertNotEquals(patternA.hashCode(), patternC.hashCode());\n    assertNotEquals(patternB, patternC);\n    assertNotEquals(patternB.hashCode(), patternC.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/NegativeContainsPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport org.junit.jupiter.api.Test;\n\npublic class NegativeContainsPatternTest {\n\n  @Test\n  public void returnsExactMatchWhenExpectedValueNotContainedInTestValue() {\n    assertTrue(WireMock.notContaining(\"thing\").match(\"otherstuff\").isExactMatch());\n  }\n\n  @Test\n  public void returnsExactMatchWhenTestValueIsNull() {\n    assertTrue(WireMock.notContaining(\"thing\").match(null).isExactMatch());\n  }\n\n  @Test\n  public void returnsNoMatchWhenWhenExpectedValueWhollyContainedInTestValue() {\n    MatchResult matchResult = WireMock.notContaining(\"thing\").match(\"mythings\");\n    assertFalse(matchResult.isExactMatch());\n    assertThat(matchResult.getDistance(), is(1.0));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    NegativeContainsPattern a = new NegativeContainsPattern(\"doNotContain\");\n    NegativeContainsPattern b = new NegativeContainsPattern(\"doNotContain\");\n    NegativeContainsPattern c = new NegativeContainsPattern(\"somethingElse\");\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/NotPatternTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.containing;\nimport static com.github.tomakehurst.wiremock.client.WireMock.not;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport org.junit.jupiter.api.Test;\n\nclass NotPatternTest {\n\n  @Test\n  void shouldReturnExactMatchWhenValueIsNull() {\n    MatchResult matchResult = not(containing(\"thing\")).match(null);\n    boolean result = matchResult.isExactMatch();\n\n    assertTrue(result);\n  }\n\n  @Test\n  void shouldReturnNoMatchWhenValueIsContainedInTestValue() {\n    MatchResult matchResult = not(containing(\"thing\")).match(\"otherthings\");\n    boolean result = matchResult.isExactMatch();\n    double distance = matchResult.getDistance();\n\n    assertFalse(result);\n    assertThat(distance, is(1.0));\n  }\n\n  @Test\n  void shouldReturnExactMatchWhenValueIsNotContainedInTestValue() {\n    MatchResult matchResult = not(containing(\"thing\")).match(\"otherstuff\");\n    boolean result = matchResult.isExactMatch();\n\n    assertTrue(result);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/PathTemplatePatternTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Test;\n\npublic class PathTemplatePatternTest {\n\n  @Test\n  void returns_exact_match_when_path_matches_template() {\n    PathTemplatePattern pattern = new PathTemplatePattern(\"/one/{id}/two\");\n    assertThat(pattern.match(\"/one/3/two\").isExactMatch(), is(true));\n  }\n\n  @Test\n  void returns_no_match_and_low_distance_when_path_almost_matches_template() {\n    PathTemplatePattern pattern = new PathTemplatePattern(\"/one/{id}/two\");\n\n    MatchResult matchResult = pattern.match(\"/on/3/two\");\n\n    assertThat(matchResult.isExactMatch(), is(false));\n    assertThat(matchResult.getDistance(), closeTo(0.2, 0.05));\n  }\n\n  @Test\n  void returns_no_match_and_high_distance_when_path_is_very_different_from_template() {\n    PathTemplatePattern pattern = new PathTemplatePattern(\"/one/{id}/two\");\n\n    MatchResult matchResult = pattern.match(\"/totally/different/stuff/and/length\");\n\n    assertThat(matchResult.isExactMatch(), is(false));\n    assertThat(matchResult.getDistance(), closeTo(0.9, 0.05));\n  }\n\n  @Test\n  void serialises_correctly() {\n    PathTemplatePattern pattern = new PathTemplatePattern(\"/one/{first}/two/{second}\");\n\n    String json = Json.write(pattern);\n\n    assertThat(\n        json,\n        jsonEquals(\"{\\n\" + \"  \\\"matchesPathTemplate\\\": \\\"/one/{first}/two/{second}\\\"\\n\" + \"}\"));\n  }\n\n  @Test\n  void deserialises_correcltly() {\n    StringValuePattern pattern =\n        Json.read(\n            \"{\\n\" + \"  \\\"matchesPathTemplate\\\": \\\"/one/{first}/two/{second}\\\"\\n\" + \"}\",\n            StringValuePattern.class);\n\n    assertThat(pattern, instanceOf(PathTemplatePattern.class));\n    assertThat(\n        ((PathTemplatePattern) pattern).getPathTemplate().toString(),\n        is(\"/one/{first}/two/{second}\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/RegexValuePatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Test;\nimport org.skyscreamer.jsonassert.JSONAssert;\n\npublic class RegexValuePatternTest {\n\n  @Test\n  public void correctlySerialisesMatchesAsJson() throws Exception {\n    String actual = Json.write(WireMock.matching(\"something\"));\n    System.out.println(actual);\n    JSONAssert.assertEquals(\n        \"{                               \\n\" + \"  \\\"matches\\\": \\\"something\\\"    \\n\" + \"}\",\n        actual,\n        true);\n  }\n\n  @Test\n  public void correctlyDeserialisesMatchesFromJson() {\n    StringValuePattern stringValuePattern =\n        Json.read(\n            \"{                               \\n\" + \"  \\\"matches\\\": \\\"something\\\"    \\n\" + \"}\",\n            StringValuePattern.class);\n\n    assertThat(stringValuePattern, instanceOf(RegexPattern.class));\n    assertThat(stringValuePattern.getValue(), is(\"something\"));\n  }\n\n  @Test\n  public void noMatchWhenValueIsNull() {\n    assertThat(WireMock.matching(\".*\").match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    RegexPattern a = new RegexPattern(\"test\");\n    RegexPattern b = new RegexPattern(\"test\");\n    RegexPattern c = new RegexPattern(\"anotherTest\");\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/RequestPatternBuilderTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aMultipart;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static java.util.Collections.singletonList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.hamcrest.core.Is.is;\n\nimport com.github.tomakehurst.wiremock.client.BasicCredentials;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.ImmutableRequest;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\n\nclass RequestPatternBuilderTest {\n  @Test\n  void likeRequestPatternWithDifferentUrl() {\n    RequestPattern requestPattern = RequestPattern.ANYTHING;\n\n    RequestPattern newRequestPattern =\n        RequestPatternBuilder.like(requestPattern).but().withUrl(\"/foo\").build();\n\n    assertThat(newRequestPattern.getUrl(), is(\"/foo\"));\n    assertThat(newRequestPattern, not(equalTo(requestPattern)));\n  }\n\n  @Test\n  void likeRequestPatternWithDifferentUrlPath() {\n    RequestPattern requestPattern = RequestPattern.ANYTHING;\n\n    RequestPattern newRequestPattern =\n        RequestPatternBuilder.like(requestPattern)\n            .but()\n            .withUrl(WireMock.urlPathEqualTo(\"/foo\"))\n            .build();\n\n    assertThat(newRequestPattern.getUrlPath(), is(\"/foo\"));\n    assertThat(newRequestPattern, not(equalTo(requestPattern)));\n  }\n\n  @Test\n  void likeRequestPatternWithoutCustomMatcher() {\n    // Use a RequestPattern with everything defined except a custom matcher to ensure all fields are\n    // set properly\n    RequestPattern requestPattern =\n        new RequestPattern(\n            \"https\",\n            WireMock.equalTo(\"my.wiremock.org\"),\n            1234,\n            WireMock.equalTo(\"192.168.2.2\"),\n            WireMock.urlEqualTo(\"/foo\"),\n            RequestMethod.POST,\n            Map.of(\"X-Header\", MultiValuePattern.of(WireMock.equalTo(\"bar\"))),\n            null,\n            Map.of(\"query_param\", MultiValuePattern.of(WireMock.equalTo(\"bar\"))),\n            Map.of(\"form_param\", MultiValuePattern.of(WireMock.equalTo(\"bar\"))),\n            Map.of(\"cookie\", WireMock.equalTo(\"yum\")),\n            new BasicCredentials(\"user\", \"pass\"),\n            List.of(WireMock.equalTo(\"BODY\")),\n            null,\n            null,\n            null);\n\n    RequestPattern newRequestPattern = RequestPatternBuilder.like(requestPattern).build();\n    assertThat(newRequestPattern, is(requestPattern));\n  }\n\n  @Test\n  void likeRequestPatternWithCustomMatcher() {\n    RequestMatcher customRequestMatcher =\n        new RequestMatcherExtension() {\n          @Override\n          public MatchResult match(Request request, Parameters parameters) {\n            return MatchResult.of(request.getUrl().contains(\"/match-me\"));\n          }\n        };\n    RequestPattern requestPattern =\n        RequestPatternBuilder.forCustomMatcher(customRequestMatcher).build();\n\n    RequestPattern newRequestPattern = RequestPatternBuilder.like(requestPattern).build();\n    assertThat(\n        newRequestPattern\n            .match(\n                ImmutableRequest.create()\n                    .withMethod(GET)\n                    .withAbsoluteUrl(\"https://localhost/match-me\")\n                    .build())\n            .isExactMatch(),\n        is(true));\n    assertThat(\n        newRequestPattern\n            .match(\n                ImmutableRequest.create()\n                    .withMethod(GET)\n                    .withAbsoluteUrl(\"https://localhost/match-me-too\")\n                    .build())\n            .isExactMatch(),\n        is(true));\n    assertThat(\n        newRequestPattern\n            .match(\n                ImmutableRequest.create()\n                    .withMethod(GET)\n                    .withAbsoluteUrl(\"https://localhost/match-not-me\")\n                    .build())\n            .isExactMatch(),\n        is(false));\n  }\n\n  @Test\n  void likeRequestPatternWithMultipartMatcher() {\n    MultipartValuePattern multipartValuePattern = aMultipart().withBody(equalToJson(\"[]\")).build();\n\n    RequestPattern requestPattern = RequestPattern.ANYTHING;\n    RequestPattern newRequestPattern =\n        RequestPatternBuilder.like(requestPattern)\n            .but()\n            .withRequestBodyPart(multipartValuePattern)\n            .build();\n\n    assertThat(\n        newRequestPattern.getMultipartPatterns(),\n        everyItem(is(in(singletonList(multipartValuePattern)))));\n    assertThat(newRequestPattern, not(equalTo(requestPattern)));\n  }\n\n  @Test\n  void likeRequestPatternWithoutMultipartMatcher() {\n    MultipartValuePattern multipartPattern = aMultipart().withBody(equalToJson(\"[]\")).build();\n\n    // Use a RequestPattern with everything defined except a custom matcher to ensure all fields are\n    // set properly\n    RequestPattern requestPattern =\n        new RequestPattern(\n            \"https\",\n            WireMock.equalTo(\"my.wiremock.org\"),\n            1234,\n            WireMock.equalTo(\"192.168.1.1\"),\n            WireMock.urlEqualTo(\"/foo\"),\n            RequestMethod.POST,\n            Map.of(\"X-Header\", MultiValuePattern.of(WireMock.equalTo(\"bar\"))),\n            null,\n            Map.of(\"query_param\", MultiValuePattern.of(WireMock.equalTo(\"bar\"))),\n            Map.of(\"form_param\", MultiValuePattern.of(WireMock.equalTo(\"bar\"))),\n            Map.of(\"cookie\", WireMock.equalTo(\"yum\")),\n            new BasicCredentials(\"user\", \"pass\"),\n            List.of(WireMock.equalTo(\"BODY\")),\n            null,\n            null,\n            singletonList(multipartPattern));\n\n    RequestPattern newRequestPattern = RequestPatternBuilder.like(requestPattern).build();\n    assertThat(newRequestPattern, is(requestPattern));\n  }\n\n  @Test\n  void likeRequestPatternWithCustomMatcherDefinition() {\n    CustomMatcherDefinition customMatcherDefinition =\n        new CustomMatcherDefinition(\"foo\", Parameters.empty());\n    RequestPattern requestPattern =\n        RequestPatternBuilder.forCustomMatcher(\"foo\", Parameters.empty()).build();\n\n    RequestPattern newRequestPattern = RequestPatternBuilder.like(requestPattern).build();\n    assertThat(newRequestPattern.getCustomMatcher(), is(customMatcherDefinition));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/RequestPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aMultipart;\nimport static com.github.tomakehurst.wiremock.client.WireMock.absent;\nimport static com.github.tomakehurst.wiremock.client.WireMock.containing;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalToXml;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matching;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonSchema;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matchingXPath;\nimport static com.github.tomakehurst.wiremock.client.WireMock.not;\nimport static com.github.tomakehurst.wiremock.client.WireMock.notContaining;\nimport static com.github.tomakehurst.wiremock.client.WireMock.notMatching;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathTemplate;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.PUT;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.QUERY;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.aMapWithSize;\nimport static org.hamcrest.Matchers.anEmptyMap;\nimport static org.hamcrest.Matchers.closeTo;\nimport static org.hamcrest.Matchers.contains;\nimport static org.hamcrest.Matchers.empty;\nimport static org.hamcrest.Matchers.greaterThan;\nimport static org.hamcrest.Matchers.hasItems;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.collection.IsMapContaining.hasEntry;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertInstanceOf;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.http.FormParameter;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.junit5.EnabledIfJettyVersion;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Stream;\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.Matchers;\nimport org.hamcrest.TypeSafeDiagnosingMatcher;\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 org.skyscreamer.jsonassert.JSONAssert;\n\nclass RequestPatternTest {\n\n  @Test\n  void matchesExactlyWith0DistanceWhenUrlAndMethodAreExactMatch() {\n    RequestPattern requestPattern = newRequestPattern(PUT, urlPathEqualTo(\"/my/url\")).build();\n\n    MatchResult matchResult = requestPattern.match(mockRequest().method(PUT).url(\"/my/url\"));\n    assertThat(matchResult.getDistance(), is(0.0));\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void matchesExactlyWithQueryMethod0DistanceWhenUrlAndMethodAreExactMatch() {\n    RequestPattern requestPattern = newRequestPattern(QUERY, urlPathEqualTo(\"/my/url\")).build();\n\n    MatchResult matchResult = requestPattern.match(mockRequest().method(QUERY).url(\"/my/url\"));\n    assertThat(matchResult.getDistance(), is(0.0));\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void returnsNon0DistanceWhenUrlDoesNotMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\")).withUrl(\"/my/url\").build();\n\n    MatchResult matchResult = requestPattern.match(mockRequest().url(\"/totally/other/url\"));\n    assertThat(matchResult.getDistance(), greaterThan(0.0));\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @Test\n  void matchesExactlyWith0DistanceWhenAllRequiredHeadersMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\"))\n            .withHeader(\"My-Header\", equalTo(\"my-expected-header-val\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest().method(PUT).header(\"My-Header\", \"my-expected-header-val\").url(\"/my/url\"));\n    assertThat(matchResult.getDistance(), is(0.0));\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void doesNotMatchWhenHeaderDoesNotMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(GET, urlPathEqualTo(\"/my/url\"))\n            .withHeader(\"My-Header\", equalTo(\"my-expected-header-val\"))\n            .withHeader(\"My-Other-Header\", equalTo(\"my-other-expected-header-val\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest()\n                .method(GET)\n                .header(\"My-Header\", \"my-expected-header-val\")\n                .header(\"My-Other-Header\", \"wrong\")\n                .url(\"/my/url\"));\n\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @Test\n  void matchesExactlyWhenRequiredAbsentHeaderIsAbsent() {\n    RequestPattern requestPattern =\n        newRequestPattern(GET, urlPathEqualTo(\"/my/url\"))\n            .withHeader(\"My-Header\", absent())\n            .withHeader(\"My-Other-Header\", equalTo(\"my-other-expected-header-val\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest()\n                .method(GET)\n                .header(\"My-Other-Header\", \"my-other-expected-header-val\")\n                .url(\"/my/url\"));\n\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void doesNotMatchWhenRequiredAbsentHeaderIsPresent() {\n    RequestPattern requestPattern =\n        newRequestPattern(GET, urlPathEqualTo(\"/my/url\"))\n            .withHeader(\"My-Header\", absent())\n            .withHeader(\"My-Other-Header\", equalTo(\"my-other-expected-header-val\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest()\n                .method(GET)\n                .header(\"My-Header\", \"my-expected-header-val\")\n                .header(\"My-Other-Header\", \"wrong\")\n                .url(\"/my/url\"));\n\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @Test\n  void bindsToJsonCompatibleWithOriginalRequestPatternForUrl() throws Exception {\n    RequestPattern requestPattern = newRequestPattern(GET, urlEqualTo(\"/my/url\")).build();\n\n    String actualJson = Json.write(requestPattern);\n\n    JSONAssert.assertEquals(\n        \"{\t\t\t\t\t\t\t\t\t                \\n\"\n            + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\\n\"\n            + \"\t\t\\\"url\\\": \\\"/my/url\\\"                \t\t\\n\"\n            + \"}\t\t\t\t\t\t\t\t\t\t\t\t    \",\n        actualJson,\n        true);\n  }\n\n  @Test\n  void bindsToJsonCompatibleWithOriginalRequestPatternForUrlPattern() throws Exception {\n    RequestPattern requestPattern = newRequestPattern(GET, urlMatching(\"/my/url\")).build();\n\n    String actualJson = Json.write(requestPattern);\n\n    JSONAssert.assertEquals(\n        \"{\t\t\t\t\t\t\t\t\t                \\n\"\n            + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\\n\"\n            + \"\t\t\\\"urlPattern\\\": \\\"/my/url\\\"           \t\t\\n\"\n            + \"}\t\t\t\t\t\t\t\t\t\t\t\t    \",\n        actualJson,\n        true);\n  }\n\n  @Test\n  void bindsToJsonCompatibleWithOriginalRequestPatternForUrlPathPattern() throws Exception {\n    RequestPattern requestPattern = newRequestPattern(GET, urlPathMatching(\"/my/url\")).build();\n\n    String actualJson = Json.write(requestPattern);\n\n    JSONAssert.assertEquals(\n        \"{\t\t\t\t\t\t\t\t\t                \\n\"\n            + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\\n\"\n            + \"\t\t\\\"urlPathPattern\\\": \\\"/my/url\\\"             \\n\"\n            + \"}\t\t\t\t\t\t\t\t\t\t\t\t    \",\n        actualJson,\n        true);\n  }\n\n  @Test\n  void bindsToJsonCompatibleWithOriginalRequestPatternForUrlPathAndHeaders() throws Exception {\n    RequestPattern requestPattern =\n        newRequestPattern(GET, urlPathEqualTo(\"/my/url\"))\n            .withHeader(\"Accept\", matching(\"(.*)xml(.*)\"))\n            .withHeader(\"If-None-Match\", matching(\"([a-z0-9]*)\"))\n            .build();\n\n    String actualJson = Json.write(requestPattern);\n\n    JSONAssert.assertEquals(URL_PATH_AND_HEADERS_EXAMPLE, actualJson, true);\n  }\n\n  static final String URL_PATH_AND_HEADERS_EXAMPLE =\n      \"{\t\t\t\t\t\t\t\t\t                \\n\"\n          + \"\t\t\\\"method\\\": \\\"GET\\\",\t\t\t\t\t\t\\n\"\n          + \"\t\t\\\"urlPath\\\": \\\"/my/url\\\",             \t\t\\n\"\n          + \"\t\t\\\"headers\\\": {\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\t\\\"Accept\\\": {\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\t\t\\\"matches\\\": \\\"(.*)xml(.*)\\\"\t\t\\n\"\n          + \"\t\t\t},\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t\t\\\"If-None-Match\\\": {\t\t\t\t\t\\n\"\n          + \"\t\t\t\t\\\"matches\\\": \\\"([a-z0-9]*)\\\"\t\t\\n\"\n          + \"\t\t\t}\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\t}\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"}\t\t\t\t\t\t\t\t\t\t\t\t    \";\n\n  @Test\n  void matchesExactlyWith0DistanceWhenAllRequiredQueryParametersMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\"))\n            .withQueryParam(\"param1\", equalTo(\"1\"))\n            .withQueryParam(\"param2\", equalTo(\"2\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(mockRequest().method(PUT).url(\"/my/url?param1=1&param1=555&param2=2\"));\n    assertThat(matchResult.getDistance(), is(0.0));\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void returnsNon0DistanceWhenRequiredQueryParameterMatchDoesNotMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\"))\n            .withQueryParam(\"param1\", equalTo(\"1\"))\n            .withQueryParam(\"param2\", equalTo(\"2\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(mockRequest().method(PUT).url(\"/my/url?param1=555&param2=2\"));\n    assertThat(matchResult.getDistance(), greaterThan(0.0));\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @Test\n  void bindsToJsonCompatibleWithOriginalRequestPatternWithQueryParams() throws Exception {\n    RequestPattern requestPattern =\n        newRequestPattern(GET, urlPathEqualTo(\"/my/url\"))\n            .withQueryParam(\"param1\", equalTo(\"1\"))\n            .withQueryParam(\"param2\", matching(\"2\"))\n            .build();\n\n    String actualJson = Json.write(requestPattern);\n\n    JSONAssert.assertEquals(\n        \"{                              \\n\"\n            + \"    \\\"method\\\": \\\"GET\\\",       \\n\"\n            + \"    \\\"urlPath\\\": \\\"/my/url\\\",  \\n\"\n            + \"    \\\"queryParameters\\\": {     \\n\"\n            + \"        \\\"param1\\\": {          \\n\"\n            + \"            \\\"equalTo\\\": \\\"1\\\" \\n\"\n            + \"        },                     \\n\"\n            + \"        \\\"param2\\\": {          \\n\"\n            + \"            \\\"matches\\\": \\\"2\\\" \\n\"\n            + \"        }                      \\n\"\n            + \"    }                          \\n\"\n            + \"}\",\n        actualJson,\n        true);\n  }\n\n  @Test\n  void matchesExactlyWith0DistanceWhenAllRequiredFormParametersMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\"))\n            .withFormParam(\"key1\", equalTo(\"value1\"))\n            .withFormParam(\"key2\", equalTo(\"value2\"))\n            .build();\n\n    Map<String, FormParameter> formParameters = new HashMap<>();\n    formParameters.put(\"key1\", new FormParameter(\"key1\", List.of(\"value1\")));\n    formParameters.put(\"key2\", new FormParameter(\"key1\", List.of(\"value2\")));\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest().method(PUT).url(\"/my/url\").formParameters(formParameters));\n    assertThat(matchResult.getDistance(), is(0.0));\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void returnsNon0DistanceWhenRequiredFormParameterMatchDoesNotMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\"))\n            .withFormParam(\"key1\", equalTo(\"value1\"))\n            .withFormParam(\"key2\", equalTo(\"value2\"))\n            .build();\n\n    Map<String, FormParameter> formParameters = new HashMap<>();\n    formParameters.put(\"key1\", new FormParameter(\"key1\", List.of(\"value555\")));\n    formParameters.put(\"key2\", new FormParameter(\"key1\", List.of(\"value78\")));\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest().method(PUT).url(\"/my/url\").formParameters(formParameters));\n    assertThat(matchResult.getDistance(), greaterThan(0.0));\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @Test\n  void bindsToJsonCompatibleWithOriginalRequestPatternWithFormParams() throws Exception {\n    RequestPattern requestPattern =\n        newRequestPattern(POST, urlPathEqualTo(\"/my/url\"))\n            .withFormParam(\"key1\", equalTo(\"value1\"))\n            .withFormParam(\"key2\", matching(\"value2\"))\n            .build();\n\n    String actualJson = Json.write(requestPattern);\n\n    JSONAssert.assertEquals(getFormParameterRequestPatternJson(), actualJson, true);\n  }\n\n  @Test\n  void correctlyDeserializesFormParams() {\n    RequestPattern requestPattern =\n        Json.read(getFormParameterRequestPatternJson(), RequestPattern.class);\n    assertInstanceOf(\n        SingleMatchMultiValuePattern.class, requestPattern.getFormParameters().get(\"key1\"));\n    assertInstanceOf(\n        SingleMatchMultiValuePattern.class, requestPattern.getFormParameters().get(\"key2\"));\n    assertThat(\n        ((SingleMatchMultiValuePattern) requestPattern.getFormParameters().get(\"key1\"))\n            .getValuePattern(),\n        valuePattern(EqualToPattern.class, \"value1\"));\n    assertThat(\n        ((SingleMatchMultiValuePattern) requestPattern.getFormParameters().get(\"key2\"))\n            .getValuePattern(),\n        valuePattern(RegexPattern.class, \"value2\"));\n  }\n\n  private String getFormParameterRequestPatternJson() {\n    return \"{                              \\n\"\n        + \"    \\\"method\\\": \\\"POST\\\",       \\n\"\n        + \"    \\\"urlPath\\\": \\\"/my/url\\\",  \\n\"\n        + \"    \\\"formParameters\\\": {     \\n\"\n        + \"        \\\"key1\\\": {          \\n\"\n        + \"            \\\"equalTo\\\": \\\"value1\\\" \\n\"\n        + \"        },                     \\n\"\n        + \"        \\\"key2\\\": {          \\n\"\n        + \"            \\\"matches\\\": \\\"value2\\\" \\n\"\n        + \"        }                      \\n\"\n        + \"    }                          \\n\"\n        + \"}\";\n  }\n\n  @Test\n  void matchesExactlyWith0DistanceWhenBodyPatternsAllMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\"))\n            .withRequestBody(equalTo(\"exactwordone approxwordtwo blah blah\"))\n            .withRequestBody(containing(\"two\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest().method(PUT).url(\"/my/url\").body(\"exactwordone approxwordtwo blah blah\"));\n    assertThat(matchResult.getDistance(), is(0.0));\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void doesNotMatchExactlyWhenOneBodyPatternDoesNotMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\"))\n            .withRequestBody(equalTo(\"exactwordone approxwordtwo blah blah\"))\n            .withRequestBody(containing(\"three\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest().method(PUT).url(\"/my/url\").body(\"exactwordone approxwordtwo blah blah\"));\n\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @EnabledIfJettyVersion(\n      major = 11,\n      reason = \"Jetty 12 and above does not decode BASE64 content encoding\")\n  @Test\n  void matchesExactlyWith0DistanceWhenMultipartPatternsAllMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(POST, urlPathEqualTo(\"/my/url\"))\n            .withAnyRequestBodyPart(\n                aMultipart()\n                    .withName(\"part-1\")\n                    .withHeader(\"Content-Type\", containing(\"text/plain\"))\n                    .withBody(equalTo(\"body part value\")))\n            .withAnyRequestBodyPart(\n                aMultipart()\n                    .withName(\"part-2\")\n                    .withHeader(\"Content-Type\", containing(\"application/octet-stream\"))\n                    .withBody(containing(\"other body\")))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest()\n                .method(POST)\n                .url(\"/my/url\")\n                .header(\"Content-Type\", \"multipart/form-data; boundary=BOUNDARY\")\n                .multipartBody(\n                    \"--BOUNDARY\\r\\nContent-Disposition: form-data; name=\\\"part-1\\\"; filename=\\\"\\\"\\r\\nContent-Type: text/plain\\r\\n\\r\\n\"\n                        + \"body part value\\r\\n\"\n                        + \"--BOUNDARY\\r\\nContent-Disposition: form-data; name=\\\"part-2\\\"; filename=\\\"\\\"\\r\\nContent-Type: application/octet-stream\\r\\nContent-Transfer-Encoding: base64\\r\\n\\r\\n\"\n                        + \"c29tZSBvdGhlciBib2R5IHZhbHVl\\r\\n\"\n                        + // some other body value\n                        \"--BOUNDARY--\"));\n\n    assertThat(matchResult.getDistance(), is(0.0));\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void doesNotMatchExactlyWhenOneMultipartBodyPatternDoesNotMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\"))\n            .withAnyRequestBodyPart(\n                aMultipart().withName(\"part-2\").withBody(containing(\"non existing part\")))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest()\n                .method(PUT)\n                .url(\"/my/url\")\n                .header(\"Content-Type\", \"multipart/form-data; boundary=BOUNDARY\")\n                .multipartBody(\n                    \"--BOUNDARY\\r\\nContent-Disposition: form-data; name=\\\"part-2\\\"; filename=\\\"\\\"\\r\\nContent-Type: application/octet-stream\\r\\nContent-Transfer-Encoding: base64\\r\\n\\r\\n\"\n                        + \"c29tZSBvdGhlciBib2R5IHZhbHVl\\r\\n\"\n                        + // some other body value\n                        \"--BOUNDARY--\"));\n\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @Test\n  void doesNotMatchExactlyWhenOneMultipartHeaderPatternDoesNotMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(PUT, urlPathEqualTo(\"/my/url\"))\n            .withAnyRequestBodyPart(\n                aMultipart()\n                    .withName(\"part-1\")\n                    .withHeader(\"Content-Type\", containing(\"application/json\")))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest()\n                .method(PUT)\n                .url(\"/my/url\")\n                .header(\"Content-Type\", \"multipart/form-data; boundary=BOUNDARY\")\n                .multipartBody(\n                    \"--BOUNDARY\\r\\nContent-Disposition: form-data; name=\\\"part-1\\\"; filename=\\\"\\\"\\r\\nContent-Type: application/octet-stream\\r\\nContent-Transfer-Encoding: base64\\r\\n\\r\\n\"\n                        + \"c29tZSBvdGhlciBib2R5IHZhbHVl\\r\\n\"\n                        + // some other body value\n                        \"--BOUNDARY--\"));\n\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @EnabledIfJettyVersion(\n      major = 11,\n      reason = \"Jetty 12 and above does not decode BASE64 content encoding\")\n  @Test\n  void matchesExactlyWith0DistanceWhenAllMultipartPatternsMatchAllParts() {\n    RequestPattern requestPattern =\n        newRequestPattern(POST, urlPathEqualTo(\"/my/url\"))\n            .withAllRequestBodyParts(\n                aMultipart()\n                    .withHeader(\"Content-Type\", containing(\"text/plain\"))\n                    .withBody(containing(\"body value\")))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest()\n                .method(POST)\n                .url(\"/my/url\")\n                .header(\"Content-Type\", \"multipart/form-data; boundary=BOUNDARY\")\n                .multipartBody(\n                    \"--BOUNDARY\\r\\nContent-Disposition: form-data; name=\\\"part-1\\\"; filename=\\\"\\\"\\r\\nContent-Type: text/plain\\r\\n\\r\\n\"\n                        + \"body value-1\\r\\n\"\n                        + \"--BOUNDARY\\r\\nContent-Disposition: form-data; name=\\\"part-2\\\"; filename=\\\"\\\"\\r\\nContent-Type: text/plain\\r\\nContent-Transfer-Encoding: base64\\r\\n\\r\\n\"\n                        + \"c29tZSBvdGhlciBib2R5IHZhbHVl\\r\\n\"\n                        + // some other body value\n                        \"--BOUNDARY--\"));\n\n    assertThat(matchResult.getDistance(), is(0.0));\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void matchesExactlyWhenAllCookiesMatch() {\n    RequestPattern requestPattern =\n        newRequestPattern(POST, urlPathEqualTo(\"/my/url\"))\n            .withCookie(\"my_cookie\", equalTo(\"my-cookie-value\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest().method(POST).cookie(\"my_cookie\", \"my-cookie-value\").url(\"/my/url\"));\n\n    assertThat(matchResult.getDistance(), is(0.0));\n    assertTrue(matchResult.isExactMatch());\n  }\n\n  @Test\n  void doesNotMatchWhenARequiredCookieIsMissing() {\n    RequestPattern requestPattern =\n        newRequestPattern(POST, urlPathEqualTo(\"/my/url\"))\n            .withCookie(\"my_cookie\", equalTo(\"my-cookie-value\"))\n            .build();\n\n    MatchResult matchResult = requestPattern.match(mockRequest().method(POST).url(\"/my/url\"));\n\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @Test\n  void doesNotMatchWhenRequiredCookieValueIsWrong() {\n    RequestPattern requestPattern =\n        newRequestPattern(POST, urlPathEqualTo(\"/my/url\"))\n            .withCookie(\"my_cookie\", equalTo(\"my-cookie-value\"))\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest().method(POST).cookie(\"my_cookie\", \"wrong-value\").url(\"/my/url\"));\n\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  @Test\n  void doesNotMatchWhenRequiredAbsentCookieIsPresent() {\n    RequestPattern requestPattern =\n        newRequestPattern(POST, urlPathEqualTo(\"/my/url\"))\n            .withCookie(\"my_cookie\", absent())\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(\n            mockRequest().method(POST).cookie(\"my_cookie\", \"any-value\").url(\"/my/url\"));\n\n    assertFalse(matchResult.isExactMatch());\n  }\n\n  private static final StringValuePattern stringSchema =\n      matchingJsonSchema(\n          \"{\" + \"\\\"type\\\": \\\"string\\\",\" + \"\\\"minLength\\\": 2,\" + \"\\\"maxLength\\\": 4\" + \"}\");\n\n  @ParameterizedTest\n  @MethodSource(\"validStrings\")\n  void matchesAPathParamAgainstAStringSchema(String toMatch) {\n\n    RequestPattern requestPattern =\n        newRequestPattern(GET, urlPathTemplate(\"/foo/{id}\"))\n            .withPathParam(\"id\", stringSchema)\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(mockRequest().method(GET).url(\"/foo/\" + toMatch));\n\n    assertThat(matchResult.isExactMatch(), is(true));\n  }\n\n  private static Stream<Arguments> validStrings() {\n    return Stream.of(\n        Arguments.of(\"ab\"),\n        Arguments.of(\"\\\"ab\\\"\"),\n        Arguments.of(\"\\\"12\\\"\"),\n        Arguments.of(\"\\\"123\\\"\"),\n        Arguments.of(\"\\\"1234\\\"\"),\n        Arguments.of(\"12\"),\n        Arguments.of(\"123\"),\n        Arguments.of(\"1234\"));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"invalidStrings\")\n  void doesNotMatchAnInvalidString(String toMatch) {\n\n    RequestPattern requestPattern =\n        newRequestPattern(GET, urlPathTemplate(\"/foo/{id}\"))\n            .withPathParam(\"id\", stringSchema)\n            .build();\n\n    MatchResult matchResult =\n        requestPattern.match(mockRequest().method(GET).url(\"/foo/\" + toMatch));\n\n    assertThat(matchResult.isExactMatch(), is(false));\n    assertThat(matchResult.getDistance(), closeTo(0.1, 0.25));\n  }\n\n  private static Stream<Arguments> invalidStrings() {\n    return Stream.of(\n        Arguments.of(\"\"),\n        Arguments.of(\"\\\"\\\"\"),\n        Arguments.of(\"\\\"1\\\"\"),\n        Arguments.of(\"\\\"12345\\\"\"),\n        Arguments.of(\"1\"),\n        Arguments.of(\"12345\"));\n  }\n\n  static final String ALL_BODY_PATTERNS_EXAMPLE =\n      \"{                                                      \\n\"\n          + \"    \\\"url\\\" : \\\"/all/body/patterns\\\",                  \\n\"\n          + \"    \\\"method\\\" : \\\"PUT\\\",                              \\n\"\n          + \"    \\\"bodyPatterns\\\" : [                               \\n\"\n          + \"        { \\\"equalTo\\\": \\\"thing\\\" },                    \\n\"\n          + \"        { \\\"equalToJson\\\": \\\"{ \\\\\\\"thing\\\\\\\": 1 }\\\" }, \\n\"\n          + \"        { \\\"matchesJsonPath\\\": \\\"@.*\\\" },              \\n\"\n          + \"        { \\\"equalToXml\\\": \\\"<thing />\\\" },             \\n\"\n          + \"        { \\\"matchesXPath\\\": \\\"//thing\\\" },             \\n\"\n          + \"        { \\\"contains\\\": \\\"thin\\\" },                    \\n\"\n          + \"        { \\\"doesNotContain\\\": \\\"stuff\\\" },            \\n\"\n          + \"        { \\\"not\\\": { \\\"contains\\\": \\\"thing\\\" } },     \\n\"\n          + \"        { \\\"matches\\\": \\\".*thing.*\\\" },                \\n\"\n          + \"        { \\\"doesNotMatch\\\": \\\"^stuff.+\\\" }             \\n\"\n          + \"    ]                                                  \\n\"\n          + \"}\";\n\n  @Test\n  void correctlyDeserialisesBodyPatterns() {\n    RequestPattern pattern = Json.read(ALL_BODY_PATTERNS_EXAMPLE, RequestPattern.class);\n    assertThat(\n        pattern.getBodyPatterns(),\n        hasItems(\n            valuePattern(EqualToPattern.class, \"thing\"),\n            valuePattern(EqualToJsonPattern.class, \"{ \\\"thing\\\": 1 }\"),\n            valuePattern(MatchesJsonPathPattern.class, \"@.*\"),\n            valuePattern(EqualToXmlPattern.class, \"<thing />\"),\n            valuePattern(MatchesXPathPattern.class, \"//thing\"),\n            valuePattern(ContainsPattern.class, \"thin\"),\n            valuePattern(NegativeContainsPattern.class, \"stuff\"),\n            valuePattern(NotPattern.class, containing(\"thing\").expectedValue),\n            valuePattern(RegexPattern.class, \".*thing.*\"),\n            valuePattern(NegativeRegexPattern.class, \"^stuff.+\")));\n  }\n\n  @Test\n  void correctlySerialisesBodyPatterns() throws Exception {\n    RequestPattern requestPattern =\n        newRequestPattern(RequestMethod.PUT, urlEqualTo(\"/all/body/patterns\"))\n            .withRequestBody(equalTo(\"thing\"))\n            .withRequestBody(equalToJson(\"{ \\\"thing\\\": 1 }\"))\n            .withRequestBody(matchingJsonPath(\"@.*\"))\n            .withRequestBody(equalToXml(\"<thing />\"))\n            .withRequestBody(matchingXPath(\"//thing\"))\n            .withRequestBody(containing(\"thin\"))\n            .withRequestBody(notContaining(\"stuff\"))\n            .withRequestBody(not(containing(\"thing\")))\n            .withRequestBody(matching(\".*thing.*\"))\n            .withRequestBody(notMatching(\"^stuff.+\"))\n            .build();\n\n    String json = Json.write(requestPattern);\n    JSONAssert.assertEquals(ALL_BODY_PATTERNS_EXAMPLE, json, true);\n  }\n\n  @Test\n  public void headersMapIsImmutable() {\n    var headers = new HashMap<String, MultiValuePattern>();\n    var builder1 = new RequestPattern.Builder();\n    headers.put(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\")));\n    builder1.setHeaders(headers);\n\n    var requestPattern1 = builder1.build();\n    assertThat(requestPattern1.getHeaders(), Matchers.aMapWithSize(1));\n    assertThat(\n        requestPattern1.getHeaders(), hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    headers.clear();\n\n    assertThat(requestPattern1.getHeaders(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getHeaders(), hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () -> requestPattern1.getHeaders().put(\"key-2\", MultiValuePattern.of(equalTo(\"value-2\"))));\n\n    assertThat(requestPattern1.getHeaders(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getHeaders(), hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    builder1.getHeaders().clear();\n\n    assertThat(requestPattern1.getHeaders(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getHeaders(), hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    var builder2 = requestPattern1.toBuilder();\n    builder2.getHeaders().put(\"key-2\", MultiValuePattern.of(equalTo(\"value-2\")));\n    var requestPattern2 = builder2.build();\n\n    assertThat(requestPattern1.getHeaders(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getHeaders(), hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    assertThat(requestPattern2.getHeaders(), aMapWithSize(2));\n    assertThat(\n        requestPattern2.getHeaders(), hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n    assertThat(\n        requestPattern2.getHeaders(), hasEntry(\"key-2\", MultiValuePattern.of(equalTo(\"value-2\"))));\n  }\n\n  @Test\n  public void pathParamsMapIsImmutable() {\n    var pathParams = new HashMap<String, StringValuePattern>();\n    var builder1 = new RequestPattern.Builder();\n    builder1.setUrl(urlPathTemplate(\"/{key-1}\"));\n    pathParams.put(\"key-1\", equalTo(\"value-1\"));\n    builder1.setPathParams(pathParams);\n\n    var requestPattern1 = builder1.build();\n    assertThat(requestPattern1.getPathParameters(), aMapWithSize(1));\n    assertThat(requestPattern1.getPathParameters(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    pathParams.clear();\n\n    assertThat(requestPattern1.getPathParameters(), aMapWithSize(1));\n    assertThat(requestPattern1.getPathParameters(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () -> requestPattern1.getPathParameters().put(\"key-2\", equalTo(\"value-2\")));\n\n    assertThat(requestPattern1.getPathParameters(), aMapWithSize(1));\n    assertThat(requestPattern1.getPathParameters(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    builder1.getPathParams().clear();\n\n    assertThat(requestPattern1.getPathParameters(), aMapWithSize(1));\n    assertThat(requestPattern1.getPathParameters(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    var builder2 = requestPattern1.toBuilder();\n    builder2.getPathParams().put(\"key-2\", equalTo(\"value-2\"));\n    var requestPattern2 = builder2.build();\n\n    assertThat(requestPattern1.getPathParameters(), aMapWithSize(1));\n    assertThat(requestPattern1.getPathParameters(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    assertThat(requestPattern2.getPathParameters(), aMapWithSize(2));\n    assertThat(requestPattern2.getPathParameters(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n    assertThat(requestPattern2.getPathParameters(), hasEntry(\"key-2\", equalTo(\"value-2\")));\n  }\n\n  @Test\n  public void queryParamsMapIsImmutable() {\n    var queryParameters = new HashMap<String, MultiValuePattern>();\n    var builder1 = new RequestPattern.Builder();\n    queryParameters.put(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\")));\n    builder1.setQueryParams(queryParameters);\n\n    var requestPattern1 = builder1.build();\n    assertThat(requestPattern1.getQueryParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getQueryParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    queryParameters.clear();\n\n    assertThat(requestPattern1.getQueryParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getQueryParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () ->\n            requestPattern1\n                .getQueryParameters()\n                .put(\"key-2\", MultiValuePattern.of(equalTo(\"value-2\"))));\n\n    assertThat(requestPattern1.getQueryParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getQueryParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    builder1.getQueryParams().clear();\n\n    assertThat(requestPattern1.getQueryParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getQueryParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    var builder2 = requestPattern1.toBuilder();\n    builder2.getQueryParams().put(\"key-2\", MultiValuePattern.of(equalTo(\"value-2\")));\n    var requestPattern2 = builder2.build();\n\n    assertThat(requestPattern1.getQueryParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getQueryParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    assertThat(requestPattern2.getQueryParameters(), aMapWithSize(2));\n    assertThat(\n        requestPattern2.getQueryParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n    assertThat(\n        requestPattern2.getQueryParameters(),\n        hasEntry(\"key-2\", MultiValuePattern.of(equalTo(\"value-2\"))));\n  }\n\n  @Test\n  public void formParamsMapIsImmutable() {\n    var formParameters = new HashMap<String, MultiValuePattern>();\n    var builder1 = new RequestPattern.Builder();\n    formParameters.put(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\")));\n    builder1.setFormParams(formParameters);\n\n    var requestPattern1 = builder1.build();\n    assertThat(requestPattern1.getFormParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getFormParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    formParameters.clear();\n\n    assertThat(requestPattern1.getFormParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getFormParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () ->\n            requestPattern1\n                .getFormParameters()\n                .put(\"key-2\", MultiValuePattern.of(equalTo(\"value-2\"))));\n\n    assertThat(requestPattern1.getFormParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getFormParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    builder1.getFormParams().clear();\n\n    assertThat(requestPattern1.getFormParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getFormParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    var builder2 = requestPattern1.toBuilder();\n    builder2.getFormParams().put(\"key-2\", MultiValuePattern.of(equalTo(\"value-2\")));\n    var requestPattern2 = builder2.build();\n\n    assertThat(requestPattern1.getFormParameters(), aMapWithSize(1));\n    assertThat(\n        requestPattern1.getFormParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n\n    assertThat(requestPattern2.getFormParameters(), aMapWithSize(2));\n    assertThat(\n        requestPattern2.getFormParameters(),\n        hasEntry(\"key-1\", MultiValuePattern.of(equalTo(\"value-1\"))));\n    assertThat(\n        requestPattern2.getFormParameters(),\n        hasEntry(\"key-2\", MultiValuePattern.of(equalTo(\"value-2\"))));\n  }\n\n  @Test\n  public void cookiesMapIsImmutable() {\n    var cookies = new HashMap<String, StringValuePattern>();\n    var builder1 = new RequestPattern.Builder();\n    cookies.put(\"key-1\", equalTo(\"value-1\"));\n    builder1.setCookies(cookies);\n\n    var requestPattern1 = builder1.build();\n    assertThat(requestPattern1.getCookies(), aMapWithSize(1));\n    assertThat(requestPattern1.getCookies(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    cookies.clear();\n\n    assertThat(requestPattern1.getCookies(), aMapWithSize(1));\n    assertThat(requestPattern1.getCookies(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () -> requestPattern1.getCookies().put(\"key-2\", equalTo(\"value-2\")));\n\n    assertThat(requestPattern1.getCookies(), aMapWithSize(1));\n    assertThat(requestPattern1.getCookies(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    builder1.getCookies().clear();\n\n    assertThat(requestPattern1.getCookies(), aMapWithSize(1));\n    assertThat(requestPattern1.getCookies(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    var builder2 = requestPattern1.toBuilder();\n    builder2.getCookies().put(\"key-2\", equalTo(\"value-2\"));\n    var requestPattern2 = builder2.build();\n\n    assertThat(requestPattern1.getCookies(), aMapWithSize(1));\n    assertThat(requestPattern1.getCookies(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n\n    assertThat(requestPattern2.getCookies(), aMapWithSize(2));\n    assertThat(requestPattern2.getCookies(), hasEntry(\"key-1\", equalTo(\"value-1\")));\n    assertThat(requestPattern2.getCookies(), hasEntry(\"key-2\", equalTo(\"value-2\")));\n  }\n\n  @Test\n  public void bodyPatternsListIsImmutable() {\n    var bodyPatterns = new ArrayList<ContentPattern<?>>();\n    var builder1 = new RequestPattern.Builder();\n    bodyPatterns.add(equalTo(\"value-1\"));\n    builder1.setBodyPatterns(bodyPatterns);\n\n    var requestPattern1 = builder1.build();\n    assertThat(requestPattern1.getBodyPatterns(), contains(equalTo(\"value-1\")));\n\n    bodyPatterns.clear();\n\n    assertThat(requestPattern1.getBodyPatterns(), contains(equalTo(\"value-1\")));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () -> requestPattern1.getBodyPatterns().add(equalTo(\"value-2\")));\n\n    assertThat(requestPattern1.getBodyPatterns(), contains(equalTo(\"value-1\")));\n\n    builder1.getBodyPatterns().clear();\n\n    assertThat(requestPattern1.getBodyPatterns(), contains(equalTo(\"value-1\")));\n\n    var builder2 = requestPattern1.toBuilder();\n    builder2.getBodyPatterns().add(equalTo(\"value-2\"));\n    var requestPattern2 = builder2.build();\n\n    assertThat(requestPattern1.getBodyPatterns(), contains(equalTo(\"value-1\")));\n\n    assertThat(requestPattern2.getBodyPatterns(), contains(equalTo(\"value-1\"), equalTo(\"value-2\")));\n  }\n\n  @Test\n  public void multipartPatternsListIsImmutable() {\n    var multipartPatterns = new ArrayList<MultipartValuePattern>();\n    var builder1 = new RequestPattern.Builder();\n    multipartPatterns.add(aMultipart(\"part-1\").withHeader(\"key-1\", equalTo(\"value-1\")).build());\n    builder1.setMultipartPatterns(multipartPatterns);\n\n    var requestPattern1 = builder1.build();\n    assertThat(\n        requestPattern1.getMultipartPatterns(),\n        contains(aMultipart(\"part-1\").withHeader(\"key-1\", equalTo(\"value-1\")).build()));\n\n    multipartPatterns.clear();\n\n    assertThat(\n        requestPattern1.getMultipartPatterns(),\n        contains(aMultipart(\"part-1\").withHeader(\"key-1\", equalTo(\"value-1\")).build()));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () -> requestPattern1.getMultipartPatterns().add(aMultipart(\"part-2\").build()));\n\n    assertThat(\n        requestPattern1.getMultipartPatterns(),\n        contains(aMultipart(\"part-1\").withHeader(\"key-1\", equalTo(\"value-1\")).build()));\n\n    builder1.getMultipartPatterns().clear();\n\n    assertThat(\n        requestPattern1.getMultipartPatterns(),\n        contains(aMultipart(\"part-1\").withHeader(\"key-1\", equalTo(\"value-1\")).build()));\n\n    var builder2 = requestPattern1.toBuilder();\n    builder2.getMultipartPatterns().add(aMultipart(\"part-2\").build());\n    var requestPattern2 = builder2.build();\n\n    assertThat(\n        requestPattern1.getMultipartPatterns(),\n        contains(aMultipart(\"part-1\").withHeader(\"key-1\", equalTo(\"value-1\")).build()));\n\n    assertThat(\n        requestPattern2.getMultipartPatterns(),\n        contains(\n            aMultipart(\"part-1\").withHeader(\"key-1\", equalTo(\"value-1\")).build(),\n            aMultipart(\"part-2\").build()));\n  }\n\n  @Test\n  public void headersCannotBeNull() {\n    var builder = new RequestPattern.Builder();\n    assertThat(builder.getHeaders(), anEmptyMap());\n    assertThrows(NullPointerException.class, () -> builder.setHeaders(null));\n    assertThat(builder.getHeaders(), anEmptyMap());\n    assertThat(builder.build().getHeaders(), anEmptyMap());\n    var requestPattern =\n        new RequestPattern(\n            null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(requestPattern.getHeaders(), anEmptyMap());\n  }\n\n  @Test\n  public void pathParamsCannotBeNull() {\n    var builder = new RequestPattern.Builder();\n    assertThat(builder.getPathParams(), anEmptyMap());\n    assertThrows(NullPointerException.class, () -> builder.setPathParams(null));\n    assertThat(builder.getPathParams(), anEmptyMap());\n    assertThat(builder.build().getPathParameters(), anEmptyMap());\n    var requestPattern =\n        new RequestPattern(\n            null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(requestPattern.getPathParameters(), anEmptyMap());\n  }\n\n  @Test\n  public void queryParamsCannotBeNull() {\n    var builder = new RequestPattern.Builder();\n    assertThat(builder.getQueryParams(), anEmptyMap());\n    assertThrows(NullPointerException.class, () -> builder.setQueryParams(null));\n    assertThat(builder.getQueryParams(), anEmptyMap());\n    assertThat(builder.build().getQueryParameters(), anEmptyMap());\n    var requestPattern =\n        new RequestPattern(\n            null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(requestPattern.getQueryParameters(), anEmptyMap());\n  }\n\n  @Test\n  public void formParamsCannotBeNull() {\n    var builder = new RequestPattern.Builder();\n    assertThat(builder.getFormParams(), anEmptyMap());\n    assertThrows(NullPointerException.class, () -> builder.setFormParams(null));\n    assertThat(builder.getFormParams(), anEmptyMap());\n    assertThat(builder.build().getFormParameters(), anEmptyMap());\n    var requestPattern =\n        new RequestPattern(\n            null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(requestPattern.getFormParameters(), anEmptyMap());\n  }\n\n  @Test\n  public void cookiesCannotBeNull() {\n    var builder = new RequestPattern.Builder();\n    assertThat(builder.getCookies(), anEmptyMap());\n    assertThrows(NullPointerException.class, () -> builder.setCookies(null));\n    assertThat(builder.getCookies(), anEmptyMap());\n    assertThat(builder.build().getCookies(), anEmptyMap());\n    var requestPattern =\n        new RequestPattern(\n            null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(requestPattern.getCookies(), anEmptyMap());\n  }\n\n  @Test\n  public void bodyPatternsCannotBeNull() {\n    var builder = new RequestPattern.Builder();\n    assertThat(builder.getBodyPatterns(), empty());\n    assertThrows(NullPointerException.class, () -> builder.setBodyPatterns(null));\n    assertThat(builder.getBodyPatterns(), empty());\n    assertThat(builder.build().getBodyPatterns(), empty());\n    var requestPattern =\n        new RequestPattern(\n            null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(requestPattern.getBodyPatterns(), empty());\n  }\n\n  @Test\n  public void multipartPatternsCannotBeNull() {\n    var builder = new RequestPattern.Builder();\n    assertThat(builder.getMultipartPatterns(), empty());\n    assertThrows(NullPointerException.class, () -> builder.setMultipartPatterns(null));\n    assertThat(builder.getMultipartPatterns(), empty());\n    assertThat(builder.build().getMultipartPatterns(), empty());\n    var requestPattern =\n        new RequestPattern(\n            null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(requestPattern.getMultipartPatterns(), empty());\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"emptyUrlPatterns\")\n  public void emptyUrlPatternsAreIncludedInJson(UrlPattern urlPattern, String urlJsonFieldName) {\n    var pattern = new RequestPattern.Builder().setUrl(urlPattern).build();\n    assertThat(pattern.getUrlMatcher(), is(urlPattern));\n    assertThat(\n        Json.write(pattern),\n        jsonEquals(\"{\\\"method\\\": \\\"ANY\\\", \\\"\" + urlJsonFieldName + \"\\\": \\\"\\\"}\"));\n  }\n\n  private static Stream<Arguments> emptyUrlPatterns() {\n    return Stream.of(\n        Arguments.of(urlEqualTo(\"\"), \"url\"),\n        Arguments.of(urlMatching(\"\"), \"urlPattern\"),\n        Arguments.of(urlPathEqualTo(\"\"), \"urlPath\"),\n        Arguments.of(urlPathMatching(\"\"), \"urlPathPattern\"),\n        Arguments.of(urlPathTemplate(\"\"), \"urlPathTemplate\"));\n  }\n\n  @Test\n  public void emptySchemeIsIncludedInJson() {\n    var pattern = new RequestPattern.Builder().setScheme(\"\").build();\n    assertThat(pattern.getScheme(), is(\"\"));\n    assertThat(Json.write(pattern), jsonEquals(\"\"\"\n        {\"method\": \"ANY\", \"scheme\": \"\"}\"\"\"));\n  }\n\n  static Matcher<ContentPattern<?>> valuePattern(\n      final Class<? extends StringValuePattern> patternClass, final String expectedValue) {\n    return new TypeSafeDiagnosingMatcher<>() {\n      @Override\n      protected boolean matchesSafely(ContentPattern<?> item, Description mismatchDescription) {\n        return item.getClass().equals(patternClass) && item.getValue().equals(expectedValue);\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\n            \"a value pattern of type \"\n                + patternClass.getSimpleName()\n                + \" with expected value \"\n                + expectedValue);\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/StringValuePatternTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.io.*;\nimport java.lang.reflect.Modifier;\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport org.junit.jupiter.api.Test;\n\n@SuppressWarnings({\"unchecked\", \"rawtypes\"})\nclass StringValuePatternTest {\n\n  @Test\n  void allSubclassesHaveWorkingToString() {\n    Set<Class> matchingClasses = getClassOfPackage(\"com.github.tomakehurst.wiremock.matching\");\n\n    assertDoesNotThrow(\n        () ->\n            matchingClasses.stream()\n                .filter(clazz -> clazz.isAssignableFrom(StringValuePattern.class))\n                .filter(clazz -> !Modifier.isAbstract(clazz.getModifiers()))\n                .forEach(this::findConstructorWithStringParamInFirstPosition));\n  }\n\n  private Set<Class> getClassOfPackage(String packageName) {\n    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n    assert classLoader != null;\n\n    String path = packageName.replace('.', '/');\n\n    List<File> dirs =\n        classLoader.resources(path).map(e -> new File(e.getFile())).collect(Collectors.toList());\n\n    Set<Class> classes = new HashSet<>();\n    for (File directory : dirs) {\n      classes.addAll(findClasses(directory, packageName));\n    }\n\n    return classes;\n  }\n\n  private Set<Class> findClasses(File directory, String packageName) {\n    Set<Class> classes = new HashSet<>();\n    if (!directory.exists()) {\n      return classes;\n    }\n    File[] files = directory.listFiles();\n    for (File file : Objects.requireNonNull(files)) {\n      if (file.isDirectory()) {\n        assert !file.getName().contains(\".\");\n        classes.addAll(findClasses(file, packageName + \".\" + file.getName()));\n      } else if (file.getName().endsWith(\".class\")) {\n        try {\n          classes.add(\n              Class.forName(\n                  packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));\n        } catch (ClassNotFoundException ignored) {\n        }\n      }\n    }\n    return classes;\n  }\n\n  private void findConstructorWithStringParamInFirstPosition(Class<?> clazz) {\n    Arrays.stream(clazz.getConstructors())\n        .filter(\n            constructor ->\n                constructor.getParameterTypes().length > 0\n                    && constructor.getParameterTypes()[0].equals(String.class)\n                    && constructor.getParameterAnnotations().length > 0\n                    && constructor.getParameterAnnotations()[0].length > 0\n                    && constructor\n                        .getParameterAnnotations()[0][0]\n                        .annotationType()\n                        .equals(JsonProperty.class))\n        .findFirst()\n        .orElseThrow(\n            () ->\n                new AssertionError(\n                    \"No constructor found with @JsonProperty annotated name parameter\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/matching/UrlPatternTest.java",
    "content": "/*\n * Copyright (C) 2016-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.*;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport org.junit.jupiter.api.Test;\n\npublic class UrlPatternTest {\n\n  @Test\n  public void matchesExactUrlWithQuery() {\n    UrlPattern urlPattern = WireMock.urlEqualTo(\"/my/exact/url?one=1&two=2&three=3333333\");\n    assertTrue(urlPattern.match(\"/my/exact/url?one=1&two=2&three=3333333\").isExactMatch());\n    assertFalse(urlPattern.match(\"/my/wrong/url?one=1&three=3333333\").isExactMatch());\n  }\n\n  @Test\n  public void matchesOnRegexWithQuery() {\n    UrlPattern urlPattern =\n        WireMock.urlMatching(\"/my/([a-z]*)/url\\\\?one=1&two=([0-9]*)&three=3333333\");\n    assertTrue(urlPattern.match(\"/my/regex/url?one=1&two=123456&three=3333333\").isExactMatch());\n    assertFalse(urlPattern.match(\"/my/BAD/url?one=1&two=123456&three=3333333\").isExactMatch());\n  }\n\n  @Test\n  public void matchesExactlyOnPathOnly() {\n    UrlPathPattern urlPathPattern = WireMock.urlPathEqualTo(\"/the/exact/path\");\n    assertTrue(urlPathPattern.match(\"/the/exact/path\").isExactMatch());\n    assertFalse(urlPathPattern.match(\"/totally/incorrect/path\").isExactMatch());\n  }\n\n  @Test\n  public void matchesOnPathWithRegex() {\n    UrlPathPattern urlPathPattern = WireMock.urlPathMatching(\"/my/([a-z]*)/path\");\n    assertTrue(urlPathPattern.match(\"/my/regex/path?one=not_looked_at\").isExactMatch());\n    assertFalse(urlPathPattern.match(\"/my/12345/path\").isExactMatch());\n  }\n\n  @Test\n  public void noMatchOnNullValueForUrlEquality() {\n    assertThat(WireMock.urlEqualTo(\"/things\").match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void noMatchOnNullValueForUrlPathEquality() {\n    assertThat(WireMock.urlPathEqualTo(\"/things\").match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void noMatchOnNullValueForUrlRegex() {\n    assertThat(WireMock.urlMatching(\"/things/.*\").match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void noMatchOnNullValueForUrlPathRegex() {\n    assertThat(WireMock.urlPathMatching(\"/things/.*\").match(null).isExactMatch(), is(false));\n  }\n\n  @Test\n  public void objectsShouldBeEqualOnSameExpectedValue() {\n    UrlPathPattern a = WireMock.urlPathMatching(\"/things/.*\");\n    UrlPathPattern b = WireMock.urlPathMatching(\"/things/.*\");\n    UrlPathPattern c = WireMock.urlPathMatching(\"/test/.*\");\n\n    assertEquals(a, b);\n    assertEquals(a.hashCode(), b.hashCode());\n    assertEquals(b, a);\n    assertEquals(b.hashCode(), a.hashCode());\n    assertNotEquals(a, c);\n    assertNotEquals(a.hashCode(), c.hashCode());\n    assertNotEquals(b, c);\n    assertNotEquals(b.hashCode(), c.hashCode());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/proxy/ProxiedHostnameRewriteResponseTransformerTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.proxy;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.any;\nimport static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.okJson;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_LENGTH;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Gzip;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\nclass ProxiedHostnameRewriteResponseTransformerTest {\n\n  private static final String LOCATION = \"Location\";\n\n  private String targetServiceBaseUrl;\n\n  WireMockServer targetService;\n  WireMock target;\n\n  WireMockServer proxyingService;\n  WireMock proxy;\n\n  WireMockTestClient testClient;\n\n  void init(WireMockConfiguration proxyingServiceOptions) {\n    targetService =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .dynamicHttpsPort()\n                .bindAddress(\"127.0.0.1\")\n                .stubCorsEnabled(true));\n    targetService.start();\n    target = WireMock.create().port(targetService.port()).build();\n\n    targetServiceBaseUrl = \"http://localhost:\" + targetService.port();\n\n    proxyingServiceOptions.dynamicPort().bindAddress(\"127.0.0.1\");\n    proxyingService = new WireMockServer(proxyingServiceOptions);\n    proxyingService.start();\n    proxy = WireMock.create().port(proxyingService.port()).build();\n\n    testClient = new WireMockTestClient(proxyingService.port());\n\n    WireMock.configureFor(targetService.port());\n  }\n\n  void initWithDefaultConfig() {\n    init(wireMockConfig());\n  }\n\n  @AfterEach\n  public void stop() {\n    targetService.stop();\n    proxyingService.stop();\n  }\n\n  @Test\n  public void rewritesTheHostnameInHeader() {\n    initWithDefaultConfig();\n\n    // Set up the target service to return a redirect\n    target.register(\n        get(urlPathEqualTo(\"/start\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(307) // Temporary redirect\n                    .withHeader(LOCATION, \"http://localhost:\" + targetService.port() + \"/end\")));\n\n    // Set up the proxy with the hostname rewrite transformer\n    proxy.register(\n        any(anyUrl())\n            .willReturn(\n                aResponse()\n                    .withTransformers(\"proxied-hostname-rewrite\")\n                    .proxiedFrom(targetServiceBaseUrl)));\n\n    // Make the request with a specific host header\n    WireMockResponse response = testClient.get(\"/start\");\n\n    // Verify the location header has been rewritten\n    assertThat(response.firstHeader(LOCATION), is(\"http://localhost:\" + proxyingService.port() + \"/end\"));\n  }\n\n  @Test\n  public void rewritesThePortInHeader() {\n    initWithDefaultConfig();\n\n    // Set up the target service to return a redirect\n    target.register(\n        get(urlPathEqualTo(\"/start\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(307) // Temporary redirect\n                    .withHeader(LOCATION, \"http://localhost:\" + targetService.port() + \"/end\")));\n\n    // Set up the proxy with the hostname rewrite transformer\n    proxy.register(\n        any(anyUrl())\n            .willReturn(\n                aResponse()\n                    .withTransformers(\"proxied-hostname-rewrite\")\n                    .proxiedFrom(targetServiceBaseUrl)));\n\n    // Make the request with a specific host header\n    WireMockResponse response = testClient.get(\"/start\");\n\n    // Verify the location header has been rewritten\n    assertThat(\n        response.firstHeader(LOCATION), is(\"http://localhost:\" + proxyingService.port() + \"/end\"));\n  }\n\n  @Test\n  public void rewritesTheHostnameInUngzippedBody() {\n    initWithDefaultConfig();\n\n    // JSON response with a link containing the localhost hostname\n    String responseString = \"{ \\\"link\\\": \\\"http://localhost:\" + targetService.port() + \"/other\\\" }\";\n\n    // Set up the target service to return the JSON\n    target.register(\n        get(urlPathEqualTo(\"/json\"))\n            .willReturn(\n                okJson(responseString)\n                    .withHeader(CONTENT_LENGTH, String.valueOf(responseString.getBytes().length))));\n\n    // Set up the proxy with the hostname rewrite transformer\n    proxy.register(\n        any(anyUrl())\n            .willReturn(\n                aResponse()\n                    .withTransformers(\"proxied-hostname-rewrite\")\n                    .proxiedFrom(targetServiceBaseUrl)));\n\n    // Make the request with a specific host header\n    WireMockResponse response = testClient.get(\"/json\");\n\n    String responseContent = response.content();\n\n    // Verify the link in the response has been rewritten\n    assertThat(\"{ \\\"link\\\": \\\"http://localhost:\" + proxyingService.port() + \"/other\\\" }\", is(responseContent));\n\n    // Verify the content length header is correct\n    assertThat(\n        responseContent.length(), is(Integer.parseInt(response.firstHeader(CONTENT_LENGTH))));\n  }\n\n  @Test\n  public void rewritesThePortInUngzippedBody() {\n    initWithDefaultConfig();\n\n    // JSON response with a link containing the localhost hostname\n    String responseString = \"{ \\\"link\\\": \\\"http://localhost:\" + targetService.port() + \"/other\\\" }\";\n\n    // Set up the target service to return the JSON\n    target.register(\n        get(urlPathEqualTo(\"/json\"))\n            .willReturn(\n                okJson(responseString)\n                    .withHeader(CONTENT_LENGTH, String.valueOf(responseString.getBytes().length))));\n\n    // Set up the proxy with the hostname rewrite transformer\n    proxy.register(\n        any(anyUrl())\n            .willReturn(\n                aResponse()\n                    .withTransformers(\"proxied-hostname-rewrite\")\n                    .proxiedFrom(targetServiceBaseUrl)));\n\n    // Make the request with a specific host header\n    WireMockResponse response = testClient.get(\"/json\");\n\n    String responseContent = response.content();\n\n    // Verify the link in the response has been rewritten\n    assertThat(\n        \"{ \\\"link\\\": \\\"http://localhost:\" + proxyingService.port() + \"/other\\\" }\",\n        is(responseContent));\n\n    // Verify the content length header is correct\n    assertThat(\n        responseContent.length(), is(Integer.parseInt(response.firstHeader(CONTENT_LENGTH))));\n  }\n\n  @Test\n  public void rewritesTheHostnameInGzippedBody() {\n    initWithDefaultConfig();\n\n    // JSON response with a link containing the localhost hostname\n    String responseString = \"{ \\\"link\\\": \\\"http://localhost:\" + targetService.port() + \"/other\\\" }\";\n\n    // Gzipping the original body\n    byte[] gzippedBody = Gzip.gzip(responseString.getBytes());\n\n    // Set up the target service to return the JSON\n    target.register(\n        get(urlPathEqualTo(\"/json\"))\n            .willReturn(\n                aResponse()\n                    .withBody(gzippedBody)\n                    .withHeader(\"Content-Encoding\", \"gzip\")\n                    .withHeader(CONTENT_LENGTH, String.valueOf(gzippedBody.length))\n                    .withHeader(\"Content-Type\", \"application/json\")));\n\n    // Set up the proxy with the hostname rewrite transformer\n    proxy.register(\n        any(anyUrl())\n            .willReturn(\n                aResponse()\n                    .withTransformers(\"proxied-hostname-rewrite\")\n                    .proxiedFrom(targetServiceBaseUrl)));\n\n    // Make the request with a specific host header\n    WireMockResponse response = testClient.get(\"/json\");\n\n    // Verify the response is still Gzipped\n    assertThat(response.firstHeader(\"Content-Encoding\"), is(\"gzip\"));\n\n    String responseContent = Gzip.unGzipToString(response.binaryContent());\n\n    // Expected body with the hostname rewritten\n    String expectedBody = \"{ \\\"link\\\": \\\"http://localhost:\" + proxyingService.port() + \"/other\\\" }\";\n\n    // Verify the content of the response after unzipping and rewriting\n    assertThat(responseContent, is(expectedBody));\n\n    // Verify the Content-Length header matches the new Gzipped body length\n    byte[] updatedGzippedBody = Gzip.gzip(expectedBody.getBytes());\n    assertThat(response.firstHeader(CONTENT_LENGTH), is(String.valueOf(updatedGzippedBody.length)));\n  }\n\n  @Test\n  public void rewritesThePortInGzippedBody() {\n    initWithDefaultConfig();\n\n    // JSON response with a link containing the localhost hostname\n    String responseString = \"{ \\\"link\\\": \\\"http://localhost:\" + targetService.port() + \"/other\\\" }\";\n\n    // Gzipping the original body\n    byte[] gzippedBody = Gzip.gzip(responseString.getBytes());\n\n    // Set up the target service to return the JSON\n    target.register(\n        get(urlPathEqualTo(\"/json\"))\n            .willReturn(\n                aResponse()\n                    .withBody(gzippedBody)\n                    .withHeader(\"Content-Encoding\", \"gzip\")\n                    .withHeader(CONTENT_LENGTH, String.valueOf(gzippedBody.length))\n                    .withHeader(\"Content-Type\", \"application/json\")));\n\n    // Set up the proxy with the hostname rewrite transformer\n    proxy.register(\n        any(anyUrl())\n            .willReturn(\n                aResponse()\n                    .withTransformers(\"proxied-hostname-rewrite\")\n                    .proxiedFrom(targetServiceBaseUrl)));\n\n    // Make the request with a specific host header\n    WireMockResponse response = testClient.get(\"/json\");\n\n    // Verify the response is still Gzipped\n    assertThat(response.firstHeader(\"Content-Encoding\"), is(\"gzip\"));\n\n    String responseContent = Gzip.unGzipToString(response.binaryContent());\n\n    // Expected body with the hostname rewritten\n    String expectedBody = \"{ \\\"link\\\": \\\"http://localhost:\" + proxyingService.port() + \"/other\\\" }\";\n\n    // Verify the content of the response after unzipping and rewriting\n    assertThat(responseContent, is(expectedBody));\n\n    // Verify the Content-Length header matches the new Gzipped body length\n    byte[] updatedGzippedBody = Gzip.gzip(expectedBody.getBytes());\n    assertThat(response.firstHeader(CONTENT_LENGTH), is(String.valueOf(updatedGzippedBody.length)));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/proxy/ProxiedHostnameRewriteResponseTransformerUnitTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.proxy;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.ImmutableRequest;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.google.common.collect.Streams;\nimport java.net.URI;\nimport java.util.Comparator;\nimport java.util.function.Supplier;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.jspecify.annotations.NonNull;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.MethodSource;\n\n@SuppressWarnings(\"HttpUrlsUsage\")\npublic class ProxiedHostnameRewriteResponseTransformerUnitTest {\n\n  @Test\n  void replacesMultipleCorrectlyProxyDefaultPortOriginDefaultPortSpecificDirectionOne() {\n    assertExpectedBody(\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com:80 http://origin.example.com origin.example.com:80 origin.example.com origin.example.com origin.example.com:80 http://origin.example.com http://origin.example.com:80\",\n            \"http://proxy.example.com:80 http://proxy.example.com proxy.example.com:80 proxy.example.com proxy.example.com proxy.example.com:80 http://proxy.example.com http://proxy.example.com:80\"));\n  }\n\n  @Test\n  void replacesMultipleCorrectlyProxyDefaultPortOriginDefaultPortSpecificDirectionTwo() {\n    assertExpectedBody(\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"origin.example.com origin.example.com:80 http://origin.example.com http://origin.example.com:80 http://origin.example.com:80 http://origin.example.com origin.example.com:80 origin.example.com\",\n            \"proxy.example.com proxy.example.com:80 http://proxy.example.com http://proxy.example.com:80 http://proxy.example.com:80 http://proxy.example.com proxy.example.com:80 proxy.example.com\"));\n  }\n\n  @Test\n  void replacesMultipleCorrectlyProxyDefaultPortOriginCustomPortSpecificDirectionOne() {\n    assertExpectedBody(\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"http://origin.example.com:8080 origin.example.com:8080 origin.example.com origin.example.com origin.example.com:8080 http://origin.example.com:8080\",\n            \"http://proxy.example.com proxy.example.com proxy.example.com proxy.example.com proxy.example.com http://proxy.example.com\"));\n  }\n\n  @Test\n  void replacesMultipleCorrectlyProxyDefaultPortOriginCustomPortSpecificDirectionTwo() {\n    assertExpectedBody(\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com origin.example.com:8080 http://origin.example.com:8080 http://origin.example.com:8080 origin.example.com:8080 origin.example.com\",\n            \"proxy.example.com proxy.example.com http://proxy.example.com http://proxy.example.com proxy.example.com proxy.example.com\"));\n  }\n\n  @Test\n  void replacesMultipleCorrectlyProxyCustomPortOriginDefaultPortSpecificDirectionOne() {\n    assertExpectedBody(\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com:80 http://origin.example.com origin.example.com:80 origin.example.com origin.example.com origin.example.com:80 http://origin.example.com http://origin.example.com:80\",\n            \"http://proxy.example.com:8080 http://proxy.example.com:8080 proxy.example.com:8080 proxy.example.com:8080 proxy.example.com:8080 proxy.example.com:8080 http://proxy.example.com:8080 http://proxy.example.com:8080\"));\n  }\n\n  @Test\n  void replacesMultipleCorrectlyProxyCustomPortOriginDefaultPortSpecificDirectionTwo() {\n    assertExpectedBody(\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com\",\n            \"origin.example.com origin.example.com:80 http://origin.example.com http://origin.example.com:80 http://origin.example.com:80 http://origin.example.com origin.example.com:80 origin.example.com\",\n            \"proxy.example.com:8080 proxy.example.com:8080 http://proxy.example.com:8080 http://proxy.example.com:8080 http://proxy.example.com:8080 http://proxy.example.com:8080 proxy.example.com:8080 proxy.example.com:8080\"));\n  }\n\n  @Test\n  void replacesMultipleCorrectlyProxyCustomPortOriginCustomPortSpecificDirectionOne() {\n    assertExpectedBody(\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"http://origin.example.com:8080 origin.example.com:8080 origin.example.com origin.example.com origin.example.com:8080 http://origin.example.com:8080\",\n            \"http://proxy.example.com:8080 proxy.example.com:8080 proxy.example.com proxy.example.com proxy.example.com:8080 http://proxy.example.com:8080\"));\n  }\n\n  @Test\n  void replacesMultipleCorrectlyProxyCustomPortOriginCustomPortSpecificDirectionTwo() {\n    assertExpectedBody(\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com origin.example.com:8080 http://origin.example.com:8080 http://origin.example.com:8080 origin.example.com:8080 origin.example.com\",\n            \"proxy.example.com proxy.example.com:8080 http://proxy.example.com:8080 http://proxy.example.com:8080 proxy.example.com:8080 proxy.example.com\"));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"allThatDoNotChange\")\n  void doesNotRewriteBodyWhenShouldNot(BodyRewriteTestCase testCase) {\n    assertExpectedBody(testCase);\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"allThatDoChange\")\n  void rewritesBodyAsExpected(BodyRewriteTestCase testCase) {\n    assertExpectedBody(testCase);\n  }\n\n  static Stream<BodyRewriteTestCase> simpleChanges() {\n    return Stream.of(\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com:80\",\n            \"http://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com:80\",\n            \"ws://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"http://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com:80\",\n            \"ws://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com:8080\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"ws://origin.example.com:8080\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com:443\",\n            \"http://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com:443\",\n            \"ws://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"http://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com:443\",\n            \"ws://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com:443443\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com\",\n            \"https://origin.example.com:443443\",\n            \"wss://origin.example.com:443443\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com:80\",\n            \"http://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com:80\",\n            \"ws://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"http://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com:80\",\n            \"ws://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com:8080\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"http://origin.example.com:8080\",\n            \"ws://origin.example.com:8080\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com:443\",\n            \"http://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com:443\",\n            \"ws://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"http://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com:443\",\n            \"ws://proxy.example.com:80\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"http://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com:443443\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:80\",\n            \"https://origin.example.com:443443\",\n            \"wss://origin.example.com:443443\",\n            \"ws://proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com:80\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com:80\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com\",\n            \"//origin.example.com\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com:80\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:80\",\n            \"//origin.example.com\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com:8080\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"ws://origin.example.com:8080\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com:443\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com:443\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com\",\n            \"//origin.example.com\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com:443\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443\",\n            \"//origin.example.com\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"http://proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com:443443\",\n            \"proxy.example.com:8080\"),\n        testCase(\n            \"http://proxy.example.com:8080\",\n            \"https://origin.example.com:443443\",\n            \"wss://origin.example.com:443443\",\n            \"ws://proxy.example.com:8080\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com:80\",\n            \"https://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com:80\",\n            \"wss://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"https://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com:80\",\n            \"wss://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:80\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com:8080\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"http://origin.example.com:8080\",\n            \"ws://origin.example.com:8080\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com:443\",\n            \"https://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com:443\",\n            \"wss://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"https://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com:443\",\n            \"wss://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com:443443\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com\",\n            \"https://origin.example.com:443443\",\n            \"wss://origin.example.com:443443\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com:80\",\n            \"https://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com:80\",\n            \"wss://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"https://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com:80\",\n            \"wss://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:80\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com:8080\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"http://origin.example.com:8080\",\n            \"ws://origin.example.com:8080\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com:443\",\n            \"https://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com:443\",\n            \"wss://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"https://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com:443\",\n            \"wss://proxy.example.com:443\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"//origin.example.com\",\n            \"//proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"https://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com:443443\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443\",\n            \"https://origin.example.com:443443\",\n            \"wss://origin.example.com:443443\",\n            \"wss://proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com\",\n            \"http://origin.example.com:80\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com\",\n            \"wss://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com\",\n            \"ws://origin.example.com:80\",\n            \"wss://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com\",\n            \"//origin.example.com\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:80\",\n            \"http://origin.example.com:80\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:80\",\n            \"origin.example.com:80\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com\",\n            \"wss://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:80\",\n            \"ws://origin.example.com:80\",\n            \"wss://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:80\",\n            \"//origin.example.com\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:8080\",\n            \"http://origin.example.com:8080\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:8080\",\n            \"origin.example.com:8080\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"http://origin.example.com:8080\",\n            \"ws://origin.example.com:8080\",\n            \"wss://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com\",\n            \"https://origin.example.com:443\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com\",\n            \"origin.example.com\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com\",\n            \"wss://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com\",\n            \"wss://origin.example.com:443\",\n            \"wss://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com\",\n            \"//origin.example.com\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443\",\n            \"https://origin.example.com:443\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443\",\n            \"origin.example.com:443\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com\",\n            \"wss://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443\",\n            \"wss://origin.example.com:443\",\n            \"wss://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443\",\n            \"//origin.example.com\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"https://proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com\",\n            \"proxy.example.com\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"origin.example.com:443443\",\n            \"proxy.example.com:443443\"),\n        testCase(\n            \"https://proxy.example.com:443443\",\n            \"https://origin.example.com:443443\",\n            \"wss://origin.example.com:443443\",\n            \"wss://proxy.example.com:443443\"));\n  }\n\n  @ParameterizedTest\n  @MethodSource(\"simpleChanges\")\n  void rewritesBodyAsExpectedForSimpleChange(BodyRewriteTestCase testCase) {\n    assertExpectedBody(testCase);\n  }\n\n  private static void assertExpectedBody(BodyRewriteTestCase testCase) {\n    var transformer = new ProxiedHostnameRewriteResponseTransformer();\n\n    var serveEvent =\n        ServeEvent.of(\n                ImmutableRequest.create()\n                    .withMethod(GET)\n                    .withAbsoluteUrl(testCase.proxyUrl)\n                    .build())\n            .withResponseDefinition(aResponse().proxiedFrom(testCase.originUrl).build());\n\n    var response =\n        Response.response()\n            .body(testCase.originResponseBody)\n            .headers(new HttpHeaders(HttpHeader.httpHeader(\"Content-Type\", \"text/plain\")))\n            .build();\n\n    var transformed = transformer.transform(response, serveEvent);\n\n    assertThat(transformed.getBodyAsString()).isEqualTo(testCase.expectedResponseBody);\n  }\n\n  @Nested\n  class CheckTestInputs {\n\n    @Test\n    void proxyUrlsAreUnique() {\n      assertUnique(ProxiedHostnameRewriteResponseTransformerUnitTest::proxyUrls);\n    }\n\n    @Test\n    void originUrlsAreUnique() {\n      assertUnique(ProxiedHostnameRewriteResponseTransformerUnitTest::originUrls);\n    }\n\n    @Test\n    void originResponseBodiesAreUnique() {\n      assertUnique(ProxiedHostnameRewriteResponseTransformerUnitTest::originResponseBodies);\n    }\n\n    @Test\n    void testsAreUnique() {\n      assertUnique(() -> bodyRewriteTestCases().map(BodyRewriteTestCase::getInput));\n    }\n\n    @Test\n    void simpleTestsAreUnique() {\n      assertUnique(() -> simpleChanges().map(BodyRewriteTestCase::getInput));\n    }\n\n    @Test\n    void simpleTestsAreAllInAllThatDoChange() {\n      assertThat(allThatDoChange().map(BodyRewriteTestCase::getInput).collect(Collectors.toSet()))\n          .containsAll(simpleChanges().map(BodyRewriteTestCase::getInput).toList());\n    }\n\n    @Test\n    void expectedNumberOfTests() {\n      assertThat(bodyRewriteTestCases())\n          .hasSize(\n              (proxyUrls().toList().size()\n                      * originUrls().toList().size()\n                      * originResponseBodies().toList().size())\n                  + shouldNeverChange().toList().size());\n    }\n\n    private void assertUnique(Supplier<Stream<?>> items) {\n      assertThat(items.get().collect(Collectors.toSet())).hasSameSizeAs(items.get().toList());\n    }\n  }\n\n  static Stream<BodyRewriteTestCase> bodyRewriteTestCases() {\n    return Stream.concat(allThatDoNotChange(), allThatDoChange());\n  }\n\n  private static Stream<BodyRewriteTestCase> allThatDoChange() {\n    return changes().flatMap(SourceTestCase::toChangesTests).sorted();\n  }\n\n  static Stream<BodyRewriteTestCase> allThatDoNotChange() {\n    return Streams.concat(\n            shouldNeverChange(), doesNotChange().flatMap(SourceTestCase::toDoesNotChangeTests))\n        .sorted();\n  }\n\n  static Stream<BodyRewriteTestCase> shouldNeverChange() {\n    return proxyUrls()\n        .flatMap(\n            proxyUrl ->\n                originUrls()\n                    .flatMap(\n                        originUrl ->\n                            Stream.of(\n                                    \"notorigin.example.com\",\n                                    \"notorigin.example.com:80\",\n                                    \"notorigin.example.com:8080\",\n                                    \"notorigin.example.com:443\",\n                                    \"notorigin.example.com:443443\",\n                                    \"notorigin.example.com \",\n                                    \"notorigin.example.com:80 \",\n                                    \"notorigin.example.com:8080 \",\n                                    \"notorigin.example.com:443 \",\n                                    \"notorigin.example.com:443443 \",\n                                    \"origin.example.com.au\",\n                                    \"origin.example.comp\")\n                                .map(\n                                    originResponseBody ->\n                                        testCase(\n                                            proxyUrl,\n                                            originUrl,\n                                            originResponseBody,\n                                            originResponseBody))));\n  }\n\n  static Stream<SourceTestCase> changes() {\n    return Stream.of(\n        testCase(\"http://origin.example.com\", \" http://origin.example.com \"),\n        testCase(\"http://origin.example.com\", \" http://origin.example.com:80 \"),\n        testCase(\"http://origin.example.com\", \"http://origin.example.com\"),\n        testCase(\"http://origin.example.com\", \"http://origin.example.com:80\"),\n        testCase(\"http://origin.example.com\", \" ws://origin.example.com \"),\n        testCase(\"http://origin.example.com\", \" ws://origin.example.com:80 \"),\n        testCase(\"http://origin.example.com\", \"ws://origin.example.com\"),\n        testCase(\"http://origin.example.com\", \"ws://origin.example.com:80\"),\n        testCase(\"http://origin.example.com\", \"origin.example.com\"),\n        testCase(\"http://origin.example.com\", \"origin.example.com:80\"),\n        testCase(\"http://origin.example.com\", \" origin.example.com \"),\n        testCase(\"http://origin.example.com\", \" origin.example.com:80 \"),\n        testCase(\"http://origin.example.com\", \"//origin.example.com\"),\n        testCase(\"http://origin.example.com\", \" //origin.example.com \"),\n        testCase(\"http://origin.example.com:80\", \" http://origin.example.com \"),\n        testCase(\"http://origin.example.com:80\", \" http://origin.example.com:80 \"),\n        testCase(\"http://origin.example.com:80\", \"http://origin.example.com\"),\n        testCase(\"http://origin.example.com:80\", \"http://origin.example.com:80\"),\n        testCase(\"http://origin.example.com:80\", \" ws://origin.example.com \"),\n        testCase(\"http://origin.example.com:80\", \" ws://origin.example.com:80 \"),\n        testCase(\"http://origin.example.com:80\", \"ws://origin.example.com\"),\n        testCase(\"http://origin.example.com:80\", \"ws://origin.example.com:80\"),\n        testCase(\"http://origin.example.com:80\", \"origin.example.com\"),\n        testCase(\"http://origin.example.com:80\", \"origin.example.com:80\"),\n        testCase(\"http://origin.example.com:80\", \" origin.example.com \"),\n        testCase(\"http://origin.example.com:80\", \" origin.example.com:80 \"),\n        testCase(\"http://origin.example.com:80\", \"//origin.example.com\"),\n        testCase(\"http://origin.example.com:80\", \" //origin.example.com \"),\n        testCase(\"http://origin.example.com:8080\", \" http://origin.example.com:8080 \"),\n        testCase(\"http://origin.example.com:8080\", \"http://origin.example.com:8080\"),\n        testCase(\"http://origin.example.com:8080\", \" ws://origin.example.com:8080 \"),\n        testCase(\"http://origin.example.com:8080\", \"ws://origin.example.com:8080\"),\n        testCase(\"http://origin.example.com:8080\", \"origin.example.com:8080\"),\n        testCase(\"http://origin.example.com:8080\", \" origin.example.com:8080 \"),\n        testCase(\"http://origin.example.com:8080\", \"origin.example.com\"),\n        testCase(\"http://origin.example.com:8080\", \" origin.example.com \"),\n        testCase(\"https://origin.example.com\", \" https://origin.example.com \"),\n        testCase(\"https://origin.example.com\", \" https://origin.example.com:443 \"),\n        testCase(\"https://origin.example.com\", \"https://origin.example.com\"),\n        testCase(\"https://origin.example.com\", \"https://origin.example.com:443\"),\n        testCase(\"https://origin.example.com\", \" wss://origin.example.com \"),\n        testCase(\"https://origin.example.com\", \" wss://origin.example.com:443 \"),\n        testCase(\"https://origin.example.com\", \"wss://origin.example.com\"),\n        testCase(\"https://origin.example.com\", \"wss://origin.example.com:443\"),\n        testCase(\"https://origin.example.com\", \"origin.example.com:443\"),\n        testCase(\"https://origin.example.com\", \" origin.example.com:443 \"),\n        testCase(\"https://origin.example.com\", \"origin.example.com\"),\n        testCase(\"https://origin.example.com\", \" origin.example.com \"),\n        testCase(\"https://origin.example.com\", \"//origin.example.com\"),\n        testCase(\"https://origin.example.com\", \" //origin.example.com \"),\n        testCase(\"https://origin.example.com:443\", \" https://origin.example.com \"),\n        testCase(\"https://origin.example.com:443\", \" https://origin.example.com:443 \"),\n        testCase(\"https://origin.example.com:443\", \"https://origin.example.com\"),\n        testCase(\"https://origin.example.com:443\", \"https://origin.example.com:443\"),\n        testCase(\"https://origin.example.com:443\", \" wss://origin.example.com \"),\n        testCase(\"https://origin.example.com:443\", \" wss://origin.example.com:443 \"),\n        testCase(\"https://origin.example.com:443\", \"wss://origin.example.com\"),\n        testCase(\"https://origin.example.com:443\", \"wss://origin.example.com:443\"),\n        testCase(\"https://origin.example.com:443\", \"origin.example.com\"),\n        testCase(\"https://origin.example.com:443\", \"origin.example.com:443\"),\n        testCase(\"https://origin.example.com:443\", \" origin.example.com \"),\n        testCase(\"https://origin.example.com:443\", \" origin.example.com:443 \"),\n        testCase(\"https://origin.example.com:443\", \"//origin.example.com\"),\n        testCase(\"https://origin.example.com:443\", \" //origin.example.com \"),\n        testCase(\"https://origin.example.com:443443\", \" https://origin.example.com:443443 \"),\n        testCase(\"https://origin.example.com:443443\", \"https://origin.example.com:443443\"),\n        testCase(\"https://origin.example.com:443443\", \" wss://origin.example.com:443443 \"),\n        testCase(\"https://origin.example.com:443443\", \"wss://origin.example.com:443443\"),\n        testCase(\"https://origin.example.com:443443\", \"origin.example.com:443443\"),\n        testCase(\"https://origin.example.com:443443\", \" origin.example.com:443443 \"),\n        testCase(\"https://origin.example.com:443443\", \"origin.example.com\"),\n        testCase(\"https://origin.example.com:443443\", \" origin.example.com \"));\n  }\n\n  static Stream<SourceTestCase> doesNotChange() {\n    return Stream.of(\n        testCase(\"http://origin.example.com\", \" http://origin.example.com:8080 \"),\n        testCase(\"http://origin.example.com\", \" https://origin.example.com \"),\n        testCase(\"http://origin.example.com\", \" https://origin.example.com:443 \"),\n        testCase(\"http://origin.example.com\", \" https://origin.example.com:443443 \"),\n        testCase(\"http://origin.example.com\", \"http://origin.example.com:8080\"),\n        testCase(\"http://origin.example.com\", \"https://origin.example.com\"),\n        testCase(\"http://origin.example.com\", \"https://origin.example.com:443\"),\n        testCase(\"http://origin.example.com\", \"https://origin.example.com:443443\"),\n        testCase(\"http://origin.example.com\", \" ws://origin.example.com:8080 \"),\n        testCase(\"http://origin.example.com\", \" wss://origin.example.com \"),\n        testCase(\"http://origin.example.com\", \" wss://origin.example.com:443 \"),\n        testCase(\"http://origin.example.com\", \" wss://origin.example.com:443443 \"),\n        testCase(\"http://origin.example.com\", \"ws://origin.example.com:8080\"),\n        testCase(\"http://origin.example.com\", \"wss://origin.example.com\"),\n        testCase(\"http://origin.example.com\", \"wss://origin.example.com:443\"),\n        testCase(\"http://origin.example.com\", \"wss://origin.example.com:443443\"),\n        testCase(\"http://origin.example.com\", \"origin.example.com:8080\"),\n        testCase(\"http://origin.example.com\", \"origin.example.com:443\"),\n        testCase(\"http://origin.example.com\", \"origin.example.com:443443\"),\n        testCase(\"http://origin.example.com\", \" origin.example.com:8080 \"),\n        testCase(\"http://origin.example.com\", \" origin.example.com:443 \"),\n        testCase(\"http://origin.example.com\", \" origin.example.com:443443 \"),\n        testCase(\"http://origin.example.com:80\", \" http://origin.example.com:8080 \"),\n        testCase(\"http://origin.example.com:80\", \" https://origin.example.com \"),\n        testCase(\"http://origin.example.com:80\", \" https://origin.example.com:443 \"),\n        testCase(\"http://origin.example.com:80\", \" https://origin.example.com:443443 \"),\n        testCase(\"http://origin.example.com:80\", \"http://origin.example.com:8080\"),\n        testCase(\"http://origin.example.com:80\", \"https://origin.example.com\"),\n        testCase(\"http://origin.example.com:80\", \"https://origin.example.com:443\"),\n        testCase(\"http://origin.example.com:80\", \"https://origin.example.com:443443\"),\n        testCase(\"http://origin.example.com:80\", \" ws://origin.example.com:8080 \"),\n        testCase(\"http://origin.example.com:80\", \" wss://origin.example.com \"),\n        testCase(\"http://origin.example.com:80\", \" wss://origin.example.com:443 \"),\n        testCase(\"http://origin.example.com:80\", \" wss://origin.example.com:443443 \"),\n        testCase(\"http://origin.example.com:80\", \"ws://origin.example.com:8080\"),\n        testCase(\"http://origin.example.com:80\", \"wss://origin.example.com\"),\n        testCase(\"http://origin.example.com:80\", \"wss://origin.example.com:443\"),\n        testCase(\"http://origin.example.com:80\", \"wss://origin.example.com:443443\"),\n        testCase(\"http://origin.example.com:80\", \"origin.example.com:8080\"),\n        testCase(\"http://origin.example.com:80\", \"origin.example.com:443\"),\n        testCase(\"http://origin.example.com:80\", \"origin.example.com:443443\"),\n        testCase(\"http://origin.example.com:80\", \" origin.example.com:8080 \"),\n        testCase(\"http://origin.example.com:80\", \" origin.example.com:443 \"),\n        testCase(\"http://origin.example.com:80\", \" origin.example.com:443443 \"),\n        testCase(\"http://origin.example.com:8080\", \" http://origin.example.com \"),\n        testCase(\"http://origin.example.com:8080\", \" http://origin.example.com:80 \"),\n        testCase(\"http://origin.example.com:8080\", \" https://origin.example.com \"),\n        testCase(\"http://origin.example.com:8080\", \" https://origin.example.com:443 \"),\n        testCase(\"http://origin.example.com:8080\", \" https://origin.example.com:443443 \"),\n        testCase(\"http://origin.example.com:8080\", \"http://origin.example.com\"),\n        testCase(\"http://origin.example.com:8080\", \"http://origin.example.com:80\"),\n        testCase(\"http://origin.example.com:8080\", \"https://origin.example.com\"),\n        testCase(\"http://origin.example.com:8080\", \"https://origin.example.com:443\"),\n        testCase(\"http://origin.example.com:8080\", \"https://origin.example.com:443443\"),\n        testCase(\"http://origin.example.com:8080\", \" ws://origin.example.com \"),\n        testCase(\"http://origin.example.com:8080\", \" ws://origin.example.com:80 \"),\n        testCase(\"http://origin.example.com:8080\", \" wss://origin.example.com \"),\n        testCase(\"http://origin.example.com:8080\", \" wss://origin.example.com:443 \"),\n        testCase(\"http://origin.example.com:8080\", \" wss://origin.example.com:443443 \"),\n        testCase(\"http://origin.example.com:8080\", \"ws://origin.example.com\"),\n        testCase(\"http://origin.example.com:8080\", \"ws://origin.example.com:80\"),\n        testCase(\"http://origin.example.com:8080\", \"wss://origin.example.com\"),\n        testCase(\"http://origin.example.com:8080\", \"wss://origin.example.com:443\"),\n        testCase(\"http://origin.example.com:8080\", \"wss://origin.example.com:443443\"),\n        testCase(\"http://origin.example.com:8080\", \"origin.example.com:80\"),\n        testCase(\"http://origin.example.com:8080\", \"origin.example.com:443\"),\n        testCase(\"http://origin.example.com:8080\", \"origin.example.com:443443\"),\n        testCase(\"http://origin.example.com:8080\", \" origin.example.com:80 \"),\n        testCase(\"http://origin.example.com:8080\", \" origin.example.com:443 \"),\n        testCase(\"http://origin.example.com:8080\", \" origin.example.com:443443 \"),\n        testCase(\"http://origin.example.com:8080\", \"//origin.example.com\"),\n        testCase(\"http://origin.example.com:8080\", \" //origin.example.com \"),\n        testCase(\"https://origin.example.com\", \" http://origin.example.com \"),\n        testCase(\"https://origin.example.com\", \" http://origin.example.com:80 \"),\n        testCase(\"https://origin.example.com\", \" http://origin.example.com:8080 \"),\n        testCase(\"https://origin.example.com\", \" https://origin.example.com:443443 \"),\n        testCase(\"https://origin.example.com\", \"http://origin.example.com\"),\n        testCase(\"https://origin.example.com\", \"http://origin.example.com:80\"),\n        testCase(\"https://origin.example.com\", \"http://origin.example.com:8080\"),\n        testCase(\"https://origin.example.com\", \"https://origin.example.com:443443\"),\n        testCase(\"https://origin.example.com\", \" ws://origin.example.com \"),\n        testCase(\"https://origin.example.com\", \" ws://origin.example.com:80 \"),\n        testCase(\"https://origin.example.com\", \" ws://origin.example.com:8080 \"),\n        testCase(\"https://origin.example.com\", \" wss://origin.example.com:443443 \"),\n        testCase(\"https://origin.example.com\", \"ws://origin.example.com\"),\n        testCase(\"https://origin.example.com\", \"ws://origin.example.com:80\"),\n        testCase(\"https://origin.example.com\", \"ws://origin.example.com:8080\"),\n        testCase(\"https://origin.example.com\", \"wss://origin.example.com:443443\"),\n        testCase(\"https://origin.example.com\", \"origin.example.com:80\"),\n        testCase(\"https://origin.example.com\", \"origin.example.com:8080\"),\n        testCase(\"https://origin.example.com\", \"origin.example.com:443443\"),\n        testCase(\"https://origin.example.com\", \" origin.example.com:80 \"),\n        testCase(\"https://origin.example.com\", \" origin.example.com:8080 \"),\n        testCase(\"https://origin.example.com\", \" origin.example.com:443443 \"),\n        testCase(\"https://origin.example.com:443\", \" http://origin.example.com \"),\n        testCase(\"https://origin.example.com:443\", \" http://origin.example.com:80 \"),\n        testCase(\"https://origin.example.com:443\", \" http://origin.example.com:8080 \"),\n        testCase(\"https://origin.example.com:443\", \" https://origin.example.com:443443 \"),\n        testCase(\"https://origin.example.com:443\", \"http://origin.example.com\"),\n        testCase(\"https://origin.example.com:443\", \"http://origin.example.com:80\"),\n        testCase(\"https://origin.example.com:443\", \"http://origin.example.com:8080\"),\n        testCase(\"https://origin.example.com:443\", \"https://origin.example.com:443443\"),\n        testCase(\"https://origin.example.com:443\", \" ws://origin.example.com \"),\n        testCase(\"https://origin.example.com:443\", \" ws://origin.example.com:80 \"),\n        testCase(\"https://origin.example.com:443\", \" ws://origin.example.com:8080 \"),\n        testCase(\"https://origin.example.com:443\", \" wss://origin.example.com:443443 \"),\n        testCase(\"https://origin.example.com:443\", \"ws://origin.example.com\"),\n        testCase(\"https://origin.example.com:443\", \"ws://origin.example.com:80\"),\n        testCase(\"https://origin.example.com:443\", \"ws://origin.example.com:8080\"),\n        testCase(\"https://origin.example.com:443\", \"wss://origin.example.com:443443\"),\n        testCase(\"https://origin.example.com:443\", \"origin.example.com:80\"),\n        testCase(\"https://origin.example.com:443\", \"origin.example.com:8080\"),\n        testCase(\"https://origin.example.com:443\", \"origin.example.com:443443\"),\n        testCase(\"https://origin.example.com:443\", \" origin.example.com:80 \"),\n        testCase(\"https://origin.example.com:443\", \" origin.example.com:8080 \"),\n        testCase(\"https://origin.example.com:443\", \" origin.example.com:443443 \"),\n        testCase(\"https://origin.example.com:443443\", \" http://origin.example.com \"),\n        testCase(\"https://origin.example.com:443443\", \" http://origin.example.com:80 \"),\n        testCase(\"https://origin.example.com:443443\", \" http://origin.example.com:8080 \"),\n        testCase(\"https://origin.example.com:443443\", \" https://origin.example.com \"),\n        testCase(\"https://origin.example.com:443443\", \" https://origin.example.com:443 \"),\n        testCase(\"https://origin.example.com:443443\", \"http://origin.example.com\"),\n        testCase(\"https://origin.example.com:443443\", \"http://origin.example.com:80\"),\n        testCase(\"https://origin.example.com:443443\", \"http://origin.example.com:8080\"),\n        testCase(\"https://origin.example.com:443443\", \"https://origin.example.com\"),\n        testCase(\"https://origin.example.com:443443\", \"https://origin.example.com:443\"),\n        testCase(\"https://origin.example.com:443443\", \" ws://origin.example.com \"),\n        testCase(\"https://origin.example.com:443443\", \" ws://origin.example.com:80 \"),\n        testCase(\"https://origin.example.com:443443\", \" ws://origin.example.com:8080 \"),\n        testCase(\"https://origin.example.com:443443\", \" wss://origin.example.com \"),\n        testCase(\"https://origin.example.com:443443\", \" wss://origin.example.com:443 \"),\n        testCase(\"https://origin.example.com:443443\", \"ws://origin.example.com\"),\n        testCase(\"https://origin.example.com:443443\", \"ws://origin.example.com:80\"),\n        testCase(\"https://origin.example.com:443443\", \"ws://origin.example.com:8080\"),\n        testCase(\"https://origin.example.com:443443\", \"wss://origin.example.com\"),\n        testCase(\"https://origin.example.com:443443\", \"wss://origin.example.com:443\"),\n        testCase(\"https://origin.example.com:443443\", \"origin.example.com:80\"),\n        testCase(\"https://origin.example.com:443443\", \"origin.example.com:8080\"),\n        testCase(\"https://origin.example.com:443443\", \"origin.example.com:443\"),\n        testCase(\"https://origin.example.com:443443\", \" origin.example.com:80 \"),\n        testCase(\"https://origin.example.com:443443\", \" origin.example.com:8080 \"),\n        testCase(\"https://origin.example.com:443443\", \" origin.example.com:443 \"),\n        testCase(\"https://origin.example.com:443443\", \"//origin.example.com\"),\n        testCase(\"https://origin.example.com:443443\", \" //origin.example.com \"));\n  }\n\n  static Stream<String> proxyUrls() {\n    return Stream.of(\n        \"http://proxy.example.com\",\n        \"http://proxy.example.com:80\",\n        \"http://proxy.example.com:8080\",\n        \"https://proxy.example.com\",\n        \"https://proxy.example.com:443\",\n        \"https://proxy.example.com:443443\");\n  }\n\n  static Stream<String> originUrls() {\n    return Stream.of(\n        \"http://origin.example.com\",\n        \"http://origin.example.com:80\",\n        \"http://origin.example.com:8080\",\n        \"https://origin.example.com\",\n        \"https://origin.example.com:443\",\n        \"https://origin.example.com:443443\");\n  }\n\n  static Stream<String> originResponseBodies() {\n    return Stream.of(\n        \" http://origin.example.com \",\n        \" http://origin.example.com:80 \",\n        \" http://origin.example.com:8080 \",\n        \" https://origin.example.com \",\n        \" https://origin.example.com:443 \",\n        \" https://origin.example.com:443443 \",\n        \"http://origin.example.com\",\n        \"http://origin.example.com:80\",\n        \"http://origin.example.com:8080\",\n        \"https://origin.example.com\",\n        \"https://origin.example.com:443\",\n        \"https://origin.example.com:443443\",\n        \" ws://origin.example.com \",\n        \" ws://origin.example.com:80 \",\n        \" ws://origin.example.com:8080 \",\n        \" wss://origin.example.com \",\n        \" wss://origin.example.com:443 \",\n        \" wss://origin.example.com:443443 \",\n        \"ws://origin.example.com\",\n        \"ws://origin.example.com:80\",\n        \"ws://origin.example.com:8080\",\n        \"wss://origin.example.com\",\n        \"wss://origin.example.com:443\",\n        \"wss://origin.example.com:443443\",\n        \"origin.example.com\",\n        \"origin.example.com:80\",\n        \"origin.example.com:8080\",\n        \"origin.example.com:443\",\n        \"origin.example.com:443443\",\n        \" origin.example.com \",\n        \" origin.example.com:80 \",\n        \" origin.example.com:8080 \",\n        \" origin.example.com:443 \",\n        \" origin.example.com:443443 \",\n        \"//origin.example.com\",\n        \" //origin.example.com \");\n  }\n\n  static SourceTestCase testCase(String originUrl, String originResponseBody) {\n    return new SourceTestCase(originUrl, originResponseBody);\n  }\n\n  record SourceTestCase(String originUrl, String originResponseBody) {\n\n    Stream<BodyRewriteTestCase> toChangesTests() {\n      return proxyUrls()\n          .map(\n              proxyUrlStr -> {\n                URI originUrl = URI.create(this.originUrl);\n                URI proxyUrl = URI.create(proxyUrlStr);\n                int originDefaultPort = getDefaultPort(originUrl.getScheme());\n                var proxyDefaultPort = getDefaultPort(proxyUrl.getScheme());\n                var originWsScheme = getWebSocketScheme(originUrl);\n                var proxyWsScheme = getWebSocketScheme(proxyUrl);\n                String expectedResponseBody =\n                    originResponseBody\n                        .replace(originUrl.getScheme(), proxyUrl.getScheme())\n                        .replace(originWsScheme, proxyWsScheme);\n\n                if (originUrl.getPort() == -1 || originUrl.getPort() == originDefaultPort) {\n                  if (proxyUrl.getPort() == -1 || proxyUrl.getPort() == proxyDefaultPort) {\n                    expectedResponseBody =\n                        expectedResponseBody.replace(\n                            \"origin.example.com:\" + originDefaultPort,\n                            \"proxy.example.com:\" + proxyDefaultPort);\n                    expectedResponseBody =\n                        expectedResponseBody.replace(\"origin.example.com\", \"proxy.example.com\");\n                  } else {\n                    expectedResponseBody =\n                        expectedResponseBody.replace(\n                            \"origin.example.com:\" + originDefaultPort,\n                            \"proxy.example.com:\" + proxyUrl.getPort());\n                    expectedResponseBody =\n                        expectedResponseBody.replace(\n                            \"://origin.example.com\", \"://proxy.example.com:\" + proxyUrl.getPort());\n                    expectedResponseBody =\n                        expectedResponseBody.replace(\n                            \"//origin.example.com\",\n                            proxyUrl.getScheme() + \"://proxy.example.com:\" + proxyUrl.getPort());\n                    expectedResponseBody =\n                        expectedResponseBody.replace(\n                            \"origin.example.com\", \"proxy.example.com:\" + proxyUrl.getPort());\n                  }\n                } else {\n                  if (proxyUrl.getPort() == -1 || proxyUrl.getPort() == proxyDefaultPort) {\n                    expectedResponseBody =\n                        expectedResponseBody.replace(\n                            \"origin.example.com:\" + originUrl.getPort(), \"proxy.example.com\");\n                  } else {\n                    expectedResponseBody =\n                        expectedResponseBody.replace(\n                            \"origin.example.com:\" + originUrl.getPort(),\n                            \"proxy.example.com:\" + proxyUrl.getPort());\n                  }\n                  expectedResponseBody =\n                      expectedResponseBody.replace(\"origin.example.com\", \"proxy.example.com\");\n                }\n                return testCase(\n                    proxyUrlStr, this.originUrl, originResponseBody, expectedResponseBody);\n              });\n    }\n\n    Stream<BodyRewriteTestCase> toDoesNotChangeTests() {\n      return proxyUrls()\n          .map(proxyUrl -> testCase(proxyUrl, originUrl, originResponseBody, originResponseBody));\n    }\n  }\n\n  static BodyRewriteTestCase testCase(\n      String proxyUrl, String originUrl, String originResponseBody, String expectedResponseBody) {\n    return new BodyRewriteTestCase(\n        proxyUrl + \"/\", originUrl, originResponseBody, expectedResponseBody);\n  }\n\n  record BodyRewriteTestCase(\n      String proxyUrl, String originUrl, String originResponseBody, String expectedResponseBody)\n      implements Comparable<BodyRewriteTestCase> {\n\n    private static final Comparator<BodyRewriteTestCase> ORDER =\n        Comparator.comparing(BodyRewriteTestCase::proxyUrl)\n            .thenComparing(BodyRewriteTestCase::originUrl)\n            .thenComparing(BodyRewriteTestCase::originResponseBody);\n\n    @Override\n    public int compareTo(@NonNull BodyRewriteTestCase other) {\n      return ORDER.compare(this, other);\n    }\n\n    public BodyRewriteTestCaseInput getInput() {\n      return new BodyRewriteTestCaseInput(proxyUrl, originUrl, originResponseBody);\n    }\n  }\n\n  record BodyRewriteTestCaseInput(String proxyUrl, String originUrl, String originResponseBody) {}\n\n  private static String getWebSocketScheme(URI proxyUrl) {\n    return proxyUrl.getScheme().equals(\"https\") ? \"wss\" : \"ws\";\n  }\n\n  private static int getDefaultPort(String scheme) {\n    return switch (scheme) {\n      case \"http\", \"ws\" -> 80;\n      case \"https\", \"wss\" -> 443;\n      default -> -1;\n    };\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/LoggedResponseDefinitionTransformerTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.common.Limit.UNLIMITED;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.http.*;\nimport org.junit.jupiter.api.Test;\n\npublic class LoggedResponseDefinitionTransformerTest {\n  private LoggedResponseDefinitionTransformer aTransformer() {\n    return new LoggedResponseDefinitionTransformer();\n  }\n\n  @Test\n  public void applyWithEmptyHeadersAndBody() {\n    final LoggedResponse response =\n        LoggedResponse.from(Response.response().status(401).build(), UNLIMITED);\n    assertEquals(responseDefinition().withStatus(401).build(), aTransformer().apply(response));\n  }\n\n  @Test\n  public void applyWithTextBody() {\n    final LoggedResponse response =\n        LoggedResponse.from(\n            Response.response()\n                .headers(new HttpHeaders(new ContentTypeHeader(\"text/plain\")))\n                .body(\"foo\")\n                .build(),\n            UNLIMITED);\n    final ResponseDefinition expected =\n        responseDefinition().withHeader(\"Content-Type\", \"text/plain\").withBody(\"foo\").build();\n    assertEquals(expected, aTransformer().apply(response));\n  }\n\n  @Test\n  public void applyWithBinaryBody() {\n    final byte[] body = new byte[] {0x1, 0xc, 0x3, 0xb, 0x1};\n    final LoggedResponse response =\n        LoggedResponse.from(\n            Response.response()\n                .headers(new HttpHeaders(new ContentTypeHeader(\"application/octet-stream\")))\n                .body(body)\n                .build(),\n            UNLIMITED);\n    final ResponseDefinition expected =\n        responseDefinition()\n            .withHeader(\"Content-Type\", \"application/octet-stream\")\n            .withBody(body)\n            .build();\n    assertEquals(expected, aTransformer().apply(response));\n  }\n\n  @Test\n  public void preservesHeadersExceptThoseSpecificallyExcluded() {\n    final LoggedResponse response =\n        LoggedResponse.from(\n            Response.response()\n                .headers(\n                    new HttpHeaders(\n                        httpHeader(\"Content-Encoding\", \"gzip\"), // Excluded\n                        httpHeader(\"content-LENGTH\", \"10\"), // Excluded\n                        httpHeader(\"transfer-encoding\", \"chunked\"), // Excluded\n                        httpHeader(\"Accept\", \"application/json\"),\n                        httpHeader(\"X-foo\", \"Bar\")))\n                .build(),\n            UNLIMITED);\n    final ResponseDefinition expected =\n        responseDefinition()\n            .withHeader(\"Accept\", \"application/json\")\n            .withHeader(\"X-foo\", \"Bar\")\n            .build();\n    assertEquals(expected, aTransformer().apply(response));\n  }\n\n  @Test\n  public void transformsWhenNoHeadersArePresent() {\n    final byte[] body = new byte[] {0x1, 0xc, 0x3, 0xb, 0x1};\n    final LoggedResponse response =\n        LoggedResponse.from(\n            Response.response().status(500).body(body).headers(null).build(), UNLIMITED);\n\n    final ResponseDefinition expected = responseDefinition().withStatus(500).withBody(body).build();\n    assertEquals(expected, aTransformer().apply(response));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/ProxiedServeEventFiltersTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.Timing;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.MockRequest;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.UUID;\nimport java.util.concurrent.LinkedBlockingDeque;\nimport org.junit.jupiter.api.Test;\n\npublic class ProxiedServeEventFiltersTest {\n  @Test\n  public void applyWithUniversalRequestPattern() {\n    ServeEvent serveEvent = proxiedServeEvent(mockRequest());\n    ProxiedServeEventFilters filters =\n        new ProxiedServeEventFilters(RequestPattern.ANYTHING, null, false);\n    assertTrue(filters.test(serveEvent));\n\n    // Should default to RequestPattern.ANYTHING when passing null for filters\n    filters = new ProxiedServeEventFilters(null, null, false);\n    assertTrue(filters.test(serveEvent));\n  }\n\n  @Test\n  public void applyWithUnproxiedServeEvent() {\n    ServeEvent serveEvent = toServeEvent(null, null, ResponseDefinition.ok());\n    ProxiedServeEventFilters filters = new ProxiedServeEventFilters(null, null, false);\n    assertFalse(filters.test(serveEvent));\n  }\n\n  @Test\n  public void applyWithMethodPattern() {\n    ProxiedServeEventFilters filters =\n        new ProxiedServeEventFilters(newRequestPattern(GET, anyUrl()).build(), null, false);\n    MockRequest request = mockRequest().method(GET).url(\"/foo\");\n\n    assertTrue(filters.test(proxiedServeEvent(request)));\n    assertTrue(filters.test(proxiedServeEvent(request.url(\"/bar\"))));\n    assertFalse(filters.test(proxiedServeEvent(request.method(POST))));\n  }\n\n  @Test\n  public void applyWithIds() {\n    List<UUID> ids =\n        Arrays.asList(\n            UUID.fromString(\"00000000-0000-0000-0000-000000000000\"),\n            UUID.fromString(\"00000000-0000-0000-0000-000000000001\"));\n    ProxiedServeEventFilters filters = new ProxiedServeEventFilters(null, ids, false);\n\n    assertTrue(filters.test(proxiedServeEvent(ids.get(0))));\n    assertTrue(filters.test(proxiedServeEvent(ids.get(1))));\n    assertFalse(\n        filters.test(proxiedServeEvent(UUID.fromString(\"00000000-0000-0000-0000-000000000002\"))));\n  }\n\n  @Test\n  public void applyWithMethodAndUrlPattern() {\n    ProxiedServeEventFilters filters =\n        new ProxiedServeEventFilters(\n            newRequestPattern(GET, urlEqualTo(\"/foo\")).build(), null, false);\n    MockRequest request = mockRequest().method(GET).url(\"/foo\");\n\n    assertTrue(filters.test(proxiedServeEvent(request)));\n    assertFalse(filters.test(proxiedServeEvent(request.url(\"/bar\"))));\n    assertFalse(filters.test(proxiedServeEvent(request.method(POST))));\n  }\n\n  @Test\n  public void applyWithIdsAndMethodPattern() {\n    MockRequest request = mockRequest().method(GET).url(\"/foo\");\n    List<UUID> ids =\n        Arrays.asList(\n            UUID.fromString(\"00000000-0000-0000-0000-000000000000\"),\n            UUID.fromString(\"00000000-0000-0000-0000-000000000001\"));\n    ProxiedServeEventFilters filters =\n        new ProxiedServeEventFilters(newRequestPattern(GET, anyUrl()).build(), ids, false);\n\n    assertTrue(filters.test(proxiedServeEvent(ids.get(0), request)));\n    assertFalse(\n        filters.test(\n            proxiedServeEvent(UUID.fromString(\"00000000-0000-0000-0000-000000000002\"), request)));\n    assertFalse(filters.test(proxiedServeEvent(ids.get(0), request.method(POST))));\n  }\n\n  private ServeEvent toServeEvent(\n      UUID id, MockRequest request, ResponseDefinition responseDefinition) {\n    return new ServeEvent(\n        id,\n        request != null ? request.asLoggedRequest() : null,\n        null,\n        responseDefinition,\n        null,\n        true,\n        Timing.UNTIMED,\n        new LinkedBlockingDeque<>());\n  }\n\n  private ServeEvent proxiedServeEvent(UUID id, MockRequest request) {\n    return toServeEvent(\n        id, request, new ResponseDefinitionBuilder().proxiedFrom(\"http://localhost\").build());\n  }\n\n  private ServeEvent proxiedServeEvent(MockRequest request) {\n    return proxiedServeEvent(null, request);\n  }\n\n  private ServeEvent proxiedServeEvent(UUID id) {\n    return proxiedServeEvent(id, null);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/RecordingStatusResultTest.java",
    "content": "/*\n * Copyright (C) 2017-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalToJson;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Test;\n\npublic class RecordingStatusResultTest {\n\n  @Test\n  public void deserialise() {\n    RecordingStatusResult result =\n        Json.read(\"{ \\\"status\\\": \\\"Recording\\\" }\", RecordingStatusResult.class);\n\n    assertThat(result.getStatus(), is(RecordingStatus.Recording));\n  }\n\n  @Test\n  public void serialise() {\n    RecordingStatusResult result = new RecordingStatusResult(RecordingStatus.Recording);\n\n    String json = Json.write(result);\n\n    assertThat(json, equalToJson(\"{ \\\"status\\\": \\\"Recording\\\" }\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/RequestBodyAutomaticPatternFactoryTest.java",
    "content": "/*\n * Copyright (C) 2017-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.*;\nimport org.junit.jupiter.api.Test;\n\npublic class RequestBodyAutomaticPatternFactoryTest {\n  private static final String JSON_TEST_STRING = \"{ \\\"foo\\\": 1 }\";\n  private static final String XML_TEST_STRING = \"<foo/>\";\n  private static final String MULTIPART_TEST_STRING =\n      \"--abc\\n\"\n          + \"Content-Disposition: form-data; name=\\\"test1\\\"\\n\\n\"\n          + \"test one\\n\"\n          + \"--abc\\n\"\n          + \"Content-Disposition: form-data; name=\\\"texs2\\\"\\n\\n\"\n          + \"test two\\n\"\n          + \"--abc\";\n\n  @Test\n  public void forRequestWithTextBodyIsCaseSensitiveByDefault() {\n    Request request = mockRequest().body(JSON_TEST_STRING);\n    EqualToPattern pattern = (EqualToPattern) patternForRequest(request);\n\n    assertThat(pattern.getEqualTo(), is(JSON_TEST_STRING));\n    assertThat(pattern.getCaseInsensitive(), is(false));\n  }\n\n  @Test\n  public void forRequestWithTextBodyRespectsCaseInsensitiveOption() {\n    Request request = mockRequest().body(JSON_TEST_STRING);\n    RequestBodyAutomaticPatternFactory patternFactory =\n        new RequestBodyAutomaticPatternFactory(false, false, true);\n    EqualToPattern pattern = (EqualToPattern) patternFactory.forRequest(request);\n\n    assertThat(pattern.getEqualTo(), is(JSON_TEST_STRING));\n    assertThat(pattern.getCaseInsensitive(), is(true));\n  }\n\n  @Test\n  public void forRequestWithJsonBodyIgnoresExtraElementsAndArrayOrderByDefault() {\n    Request request =\n        mockRequest().header(\"Content-Type\", \"application/json\").body(JSON_TEST_STRING);\n    EqualToJsonPattern pattern = (EqualToJsonPattern) patternForRequest(request);\n\n    assertThat(pattern.getEqualToJson(), is(JSON_TEST_STRING));\n    assertThat(pattern.isIgnoreExtraElements(), is(true));\n    assertThat(pattern.isIgnoreArrayOrder(), is(true));\n  }\n\n  @Test\n  public void forRequestWithJsonBodyRespectsOptions() {\n    RequestBodyAutomaticPatternFactory patternFactory =\n        new RequestBodyAutomaticPatternFactory(false, false, false);\n    Request request =\n        mockRequest().header(\"Content-Type\", \"application/json\").body(JSON_TEST_STRING);\n    EqualToJsonPattern pattern = (EqualToJsonPattern) patternFactory.forRequest(request);\n\n    assertThat(pattern.getEqualToJson(), is(JSON_TEST_STRING));\n    assertThat(pattern.isIgnoreExtraElements(), is(false));\n    assertThat(pattern.isIgnoreArrayOrder(), is(false));\n  }\n\n  @Test\n  public void forRequestWithXmlBody() {\n    Request request = mockRequest().header(\"Content-Type\", \"application/xml\").body(XML_TEST_STRING);\n    EqualToXmlPattern pattern = (EqualToXmlPattern) patternForRequest(request);\n\n    assertThat(pattern.getEqualToXml(), is(XML_TEST_STRING));\n  }\n\n  @Test\n  public void forRequestWithMultipartBody() {\n    Request request =\n        mockRequest().header(\"Content-Type\", \"multipart/form-data\").body(MULTIPART_TEST_STRING);\n    // TODO: Update this when we add a matcher for multipart bodies\n    AnythingPattern pattern = (AnythingPattern) patternForRequest(request);\n\n    assertThat(pattern.toString(), is(\"anything\"));\n  }\n\n  @Test\n  public void forRequestWithBinaryBody() {\n    Request request =\n        mockRequest().header(\"Content-Type\", \"application/octet-stream\").body(new byte[] {1, 2, 3});\n\n    BinaryEqualToPattern pattern = (BinaryEqualToPattern) patternForRequest(request);\n\n    assertThat(pattern.toString(), is(\"binaryEqualTo AQID\"));\n  }\n\n  private static ContentPattern<?> patternForRequest(Request request) {\n    return RequestBodyAutomaticPatternFactory.DEFAULTS.forRequest(request);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/RequestBodyEqualToJsonPatternFactoryTest.java",
    "content": "/*\n * Copyright (C) 2017-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.matching.EqualToJsonPattern;\nimport org.junit.jupiter.api.Test;\n\npublic class RequestBodyEqualToJsonPatternFactoryTest {\n\n  @Test\n  public void withIgnoreArrayOrder() {\n    RequestBodyEqualToJsonPatternFactory patternFactory =\n        new RequestBodyEqualToJsonPatternFactory(true, false);\n    EqualToJsonPattern pattern = patternFactory.forRequest(mockRequest().body(\"{}\"));\n\n    assertThat(pattern.getEqualToJson(), is(\"{}\"));\n    assertThat(pattern.isIgnoreExtraElements(), is(false));\n    assertThat(pattern.isIgnoreArrayOrder(), is(true));\n  }\n\n  @Test\n  public void withIgnoreExtraElements() {\n    RequestBodyEqualToJsonPatternFactory patternFactory =\n        new RequestBodyEqualToJsonPatternFactory(false, true);\n    EqualToJsonPattern pattern = patternFactory.forRequest(mockRequest().body(\"{}\"));\n\n    assertThat(pattern.getEqualToJson(), is(\"{}\"));\n    assertThat(pattern.isIgnoreExtraElements(), is(true));\n    assertThat(pattern.isIgnoreArrayOrder(), is(false));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/RequestBodyPatternFactoryJsonDeserializerTest.java",
    "content": "/*\n * Copyright (C) 2017-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.matching.EqualToJsonPattern;\nimport com.github.tomakehurst.wiremock.matching.EqualToPattern;\nimport org.junit.jupiter.api.Test;\n\npublic class RequestBodyPatternFactoryJsonDeserializerTest {\n  @Test\n  public void correctlyDeserializesWithEmptyObject() {\n    RequestBodyPatternFactory bodyPatternFactory = deserializeJson(\"{}\");\n    assertThat(bodyPatternFactory, instanceOf(RequestBodyAutomaticPatternFactory.class));\n  }\n\n  @Test\n  public void correctlyDeserializesWithAutoMatcher() {\n    RequestBodyPatternFactory bodyPatternFactory = deserializeJson(\"{ \\\"matcher\\\": \\\"auto\\\" }\");\n    assertThat(bodyPatternFactory, instanceOf(RequestBodyAutomaticPatternFactory.class));\n  }\n\n  @Test\n  public void correctlyDeserializesWithEqualToMatcher() {\n    RequestBodyPatternFactory bodyPatternFactory =\n        deserializeJson(\n            \"{                                    \\n\"\n                + \"    \\\"matcher\\\": \\\"equalTo\\\",        \\n\"\n                + \"    \\\"caseInsensitive\\\": true        \\n\"\n                + \"}                                      \");\n    EqualToPattern bodyPattern =\n        (EqualToPattern) bodyPatternFactory.forRequest(mockRequest().body(\"this body text\"));\n    assertThat(bodyPattern.getCaseInsensitive(), is(true));\n    assertThat(bodyPattern.getExpected(), is(\"this body text\"));\n  }\n\n  @Test\n  public void correctlyDeserializesWithEqualToJsonMatcher() {\n    RequestBodyPatternFactory bodyPatternFactory =\n        deserializeJson(\n            \"{                                    \\n\"\n                + \"    \\\"matcher\\\": \\\"equalToJson\\\",    \\n\"\n                + \"    \\\"ignoreArrayOrder\\\": false,     \\n\"\n                + \"    \\\"ignoreExtraElements\\\": true    \\n\"\n                + \"}                                      \");\n    EqualToJsonPattern bodyPattern =\n        (EqualToJsonPattern) bodyPatternFactory.forRequest(mockRequest().body(\"1\"));\n    assertThat(bodyPattern.isIgnoreArrayOrder(), is(false));\n    assertThat(bodyPattern.isIgnoreExtraElements(), is(true));\n  }\n\n  @Test\n  public void correctlyDeserializesWithEqualToXmlMatcher() {\n    RequestBodyPatternFactory bodyPatternFactory =\n        deserializeJson(\"{ \\\"matcher\\\": \\\"equalToXml\\\" }\");\n    assertThat(bodyPatternFactory, instanceOf(RequestBodyEqualToXmlPatternFactory.class));\n  }\n\n  private static RequestBodyPatternFactory deserializeJson(String json) {\n    return Json.read(json, RequestBodyPatternFactory.class);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/RequestPatternTransformerTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\n\npublic class RequestPatternTransformerTest {\n  @Test\n  public void applyIncludesMethodAndUrlMatchers() {\n    Request request =\n        mockRequest()\n            .url(\"/foo\")\n            .method(RequestMethod.GET)\n            .header(\"User-Agent\", \"foo\")\n            .header(\"X-Foo\", \"bar\");\n\n    RequestPatternBuilder expected =\n        new RequestPatternBuilder(RequestMethod.GET, urlEqualTo(\"/foo\"));\n\n    assertEquals(\n        expected.build(), new RequestPatternTransformer(null, null).apply(request).build());\n  }\n\n  @Test\n  public void applyIncludesQueryMethod() {\n    Request request = mockRequest().url(\"/foo\").method(RequestMethod.QUERY);\n\n    RequestPatternBuilder expected =\n        new RequestPatternBuilder(RequestMethod.QUERY, urlEqualTo(\"/foo\"));\n\n    assertEquals(\n        expected.build(), new RequestPatternTransformer(null, null).apply(request).build());\n  }\n\n  @Test\n  public void applyWithHeaders() {\n    Request request =\n        mockRequest()\n            .url(\"/\")\n            .method(RequestMethod.POST)\n            .header(\"X-CaseSensitive\", \"foo\")\n            .header(\"X-Ignored\", \"ignored\")\n            .header(\"X-CaseInsensitive\", \"Baz\");\n\n    RequestPatternBuilder expected =\n        new RequestPatternBuilder(RequestMethod.POST, urlEqualTo(\"/\"))\n            .withHeader(\"X-CaseSensitive\", equalTo(\"foo\"))\n            .withHeader(\"X-CaseInsensitive\", equalToIgnoreCase(\"Baz\"));\n\n    Map<String, CaptureHeadersSpec> headers =\n        Map.of(\n            \"X-CaseSensitive\",\n            new CaptureHeadersSpec(false),\n            \"X-CaseInsensitive\",\n            new CaptureHeadersSpec(true));\n\n    assertEquals(\n        expected.build(), new RequestPatternTransformer(headers, null).apply(request).build());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/ResponseDefinitionBodyMatcherDeserializerTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\n\npublic class ResponseDefinitionBodyMatcherDeserializerTest {\n  @Test\n  public void correctlyParsesFileSize() {\n    final Map<String, Long> testCases =\n        Map.of(\n            \"100\",\n            100L,\n            \"1KB\",\n            1024L,\n            \"1 kb\",\n            1024L,\n            \"1024 K\",\n            1024L * 1024,\n            \"10 Mb\",\n            10L * 1024 * 1024,\n            \"10.5 GB\",\n            Math.round(10.5 * 1024 * 1024 * 1024));\n\n    for (String input : testCases.keySet()) {\n      Long expected = testCases.get(input);\n      Long actual = ResponseDefinitionBodyMatcherDeserializer.parseFilesize(input);\n      assertEquals(expected, actual, \"Failed with \" + input);\n    }\n  }\n\n  @Test\n  public void correctlyDeserializesWithEmptyNode() {\n    ResponseDefinitionBodyMatcher matcher = Json.read(\"{}\", ResponseDefinitionBodyMatcher.class);\n    assertEquals(new ResponseDefinitionBodyMatcher(Long.MAX_VALUE, Long.MAX_VALUE), matcher);\n  }\n\n  @Test\n  public void correctlyDeserializesWithSingleValue() {\n    ResponseDefinitionBodyMatcher matcher =\n        Json.read(\"{ \\\"textSizeThreshold\\\": 100 }\", ResponseDefinitionBodyMatcher.class);\n    assertEquals(new ResponseDefinitionBodyMatcher(100, Long.MAX_VALUE), matcher);\n  }\n\n  @Test\n  public void correctlyDeserializesWithBothValues() {\n    ResponseDefinitionBodyMatcher matcher =\n        Json.read(\n            \"{ \\\"textSizeThreshold\\\": 100, \\\"binarySizeThreshold\\\": 10 }\",\n            ResponseDefinitionBodyMatcher.class);\n    assertEquals(new ResponseDefinitionBodyMatcher(100, 10), matcher);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/ResponseDefinitionBodyMatcherTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport org.junit.jupiter.api.Test;\n\npublic class ResponseDefinitionBodyMatcherTest {\n  @Test\n  public void noThresholds() {\n    ResponseDefinitionBodyMatcher matcher = new ResponseDefinitionBodyMatcher(0, 0);\n    assertFalse(matcher.match(responseDefinition().build()).isExactMatch());\n    assertTrue(matcher.match(textResponseDefinition(\"a\")).isExactMatch());\n    assertTrue(matcher.match(binaryResponseDefinition(new byte[] {0x1})).isExactMatch());\n  }\n\n  @Test\n  public void textBodyMatchingWithThreshold() {\n    ResponseDefinitionBodyMatcher matcher = new ResponseDefinitionBodyMatcher(2, 0);\n    assertFalse(matcher.match(textResponseDefinition(\"f\")).isExactMatch());\n    assertFalse(matcher.match(textResponseDefinition(\"fo\")).isExactMatch());\n    assertTrue(matcher.match(textResponseDefinition(\"foo\")).isExactMatch());\n  }\n\n  @Test\n  public void binaryBodyMatchingWithThreshold() {\n    ResponseDefinitionBodyMatcher matcher = new ResponseDefinitionBodyMatcher(0, 2);\n    assertFalse(matcher.match(binaryResponseDefinition(new byte[] {0x1})).isExactMatch());\n    assertFalse(matcher.match(binaryResponseDefinition(new byte[] {0x1, 0xc})).isExactMatch());\n    assertTrue(matcher.match(binaryResponseDefinition(new byte[] {0x1, 0xc, 0xf})).isExactMatch());\n  }\n\n  private static ResponseDefinition textResponseDefinition(String body) {\n    return new ResponseDefinitionBuilder()\n        .withHeader(\"Content-Type\", \"text/plain\")\n        .withBody(body)\n        .build();\n  }\n\n  private static ResponseDefinition binaryResponseDefinition(byte[] body) {\n    return new ResponseDefinitionBuilder().withBody(body).build();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/ScenarioProcessorTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static java.util.Arrays.asList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.nullValue;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.Collections;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class ScenarioProcessorTest {\n\n  private final ScenarioProcessor processor = new ScenarioProcessor();\n\n  @Test\n  public void placesStubMappingsIntoScenariosWhenRepetitionsArePresent() {\n    StubMapping foobar1 = WireMock.get(\"/foo/bar\").willReturn(ok(\"fb-1\")).build();\n    StubMapping other1 = WireMock.get(\"/other\").willReturn(ok(\"o-1\")).build();\n    StubMapping foobar2 = WireMock.get(\"/foo/bar\").willReturn(ok(\"fb-2\")).build();\n    StubMapping foobar3 = WireMock.get(\"/foo/bar\").willReturn(ok(\"fb-3\")).build();\n    StubMapping other2 = WireMock.get(\"/other\").willReturn(ok(\"o-2\")).build();\n\n    List<StubMapping> stubs = asList(foobar1, other1, foobar2, foobar3, other2);\n    Collections.reverse(stubs);\n    List<StubMapping> processed = processor.putRepeatedRequestsInScenarios(stubs);\n\n    final StubMapping processedFoobar1 = findStub(processed, foobar1);\n    assertThat(processedFoobar1.getScenarioName(), is(\"scenario-2-foo-bar\"));\n    assertThat(processedFoobar1.getRequiredScenarioState(), is(Scenario.STARTED));\n    assertThat(processedFoobar1.getNewScenarioState(), is(\"scenario-2-foo-bar-2\"));\n\n    final StubMapping processedFoobar2 = findStub(processed, foobar2);\n    assertThat(processedFoobar2.getScenarioName(), is(processedFoobar1.getScenarioName()));\n    assertThat(processedFoobar2.getRequiredScenarioState(), is(\"scenario-2-foo-bar-2\"));\n    assertThat(processedFoobar2.getNewScenarioState(), is(\"scenario-2-foo-bar-3\"));\n\n    final StubMapping processedFoobar3 = findStub(processed, foobar3);\n    assertThat(processedFoobar1.getScenarioName(), is(processedFoobar3.getScenarioName()));\n    assertThat(processedFoobar3.getRequiredScenarioState(), is(\"scenario-2-foo-bar-3\"));\n    assertThat(\n        \"Last mapping should not have a state transition\",\n        processedFoobar3.getNewScenarioState(),\n        nullValue());\n\n    final StubMapping processedOther1 = findStub(processed, other1);\n    final StubMapping processedOther2 = findStub(processed, other2);\n    assertThat(processedOther1.getScenarioName(), is(\"scenario-1-other\"));\n    assertThat(processedOther1.getNewScenarioState(), is(\"scenario-1-other-2\"));\n    assertThat(processedOther2.getRequiredScenarioState(), is(\"scenario-1-other-2\"));\n  }\n\n  @Test\n  public void doesNothingWhenNoRepeatedRequests() {\n    StubMapping one = WireMock.get(\"/one\").build();\n    StubMapping two = WireMock.get(\"/two\").build();\n    StubMapping three = WireMock.get(\"/three\").build();\n\n    final List<StubMapping> processed =\n        processor.putRepeatedRequestsInScenarios(asList(one, two, three));\n\n    final StubMapping processedOne = findStub(processed, one);\n    final StubMapping processedTwo = findStub(processed, two);\n    final StubMapping processedThree = findStub(processed, three);\n    assertThat(processedOne.getScenarioName(), nullValue());\n    assertThat(processedTwo.getScenarioName(), nullValue());\n    assertThat(processedThree.getScenarioName(), nullValue());\n  }\n\n  private static StubMapping findStub(List<StubMapping> processed, StubMapping foobar1) {\n    return processed.stream()\n        .filter(stub -> stub.getId().equals(foobar1.getId()))\n        .findFirst()\n        .orElseThrow();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/SnapshotOutputFormatterTest.java",
    "content": "/*\n * Copyright (C) 2017-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.recording.SnapshotOutputFormatter.FULL;\nimport static com.github.tomakehurst.wiremock.recording.SnapshotOutputFormatter.IDS;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport org.junit.jupiter.api.Test;\n\npublic class SnapshotOutputFormatterTest {\n  @Test\n  public void fromStringDefault() {\n    assertEquals(FULL, SnapshotOutputFormatter.fromString(null));\n  }\n\n  @Test\n  public void fromStringWithInvalidFormat() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> SnapshotOutputFormatter.fromString(\"invalid output format\"));\n  }\n\n  @Test\n  public void fromStringWithFull() {\n    assertEquals(FULL, SnapshotOutputFormatter.fromString(\"full\"));\n  }\n\n  @Test\n  public void fromStringWithIds() {\n    assertEquals(IDS, SnapshotOutputFormatter.fromString(\"ids\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/SnapshotRecordResultDeserialiserTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\n\npublic class SnapshotRecordResultDeserialiserTest {\n\n  @Test\n  public void supportsFullResponse() {\n    SnapshotRecordResult result =\n        Json.read(\n            \"{                                     \\n\"\n                + \"    \\\"mappings\\\": [                    \\n\"\n                + \"        {                              \\n\"\n                + \"            \\\"request\\\": {             \\n\"\n                + \"                \\\"url\\\": \\\"/hello\\\",   \\n\"\n                + \"                \\\"method\\\": \\\"GET\\\"    \\n\"\n                + \"            },                         \\n\"\n                + \"            \\\"response\\\": {            \\n\"\n                + \"                \\\"status\\\": 201        \\n\"\n                + \"            }                          \\n\"\n                + \"        },                             \\n\"\n                + \"        {}                             \\n\"\n                + \"    ]                                  \\n\"\n                + \"}\",\n            SnapshotRecordResult.class);\n\n    assertThat(result, instanceOf(SnapshotRecordResult.Full.class));\n    assertThat(result.getStubMappings().size(), is(2));\n    assertThat(result.getStubMappings().get(0), instanceOf(StubMapping.class));\n  }\n\n  @Test\n  public void supportsIdsOnlyResponse() {\n    SnapshotRecordResult result =\n        Json.read(\n            \"{                                                     \\n\"\n                + \"    \\\"ids\\\": [                                         \\n\"\n                + \"        \\\"d3f32721-ab5e-479c-9f7a-fda76ed5d803\\\",      \\n\"\n                + \"        \\\"162d0567-4baf-408b-ad7f-41a779638082\\\",      \\n\"\n                + \"        \\\"02ee46c3-0b49-40ca-a424-8298c099b6db\\\"       \\n\"\n                + \"    ]                                                  \\n\"\n                + \"}\",\n            SnapshotRecordResult.class);\n\n    assertThat(result, instanceOf(SnapshotRecordResult.Ids.class));\n\n    SnapshotRecordResult.Ids idsResult = (SnapshotRecordResult.Ids) result;\n    assertThat(idsResult.getIds().size(), is(3));\n  }\n\n  @Test\n  public void supportsFullResponseWithErrors() {\n    String json =\n        \"\"\"\n            {\n              \"errors\": [\n                {\n                  \"errorType\": \"stub-generation-failure\",\n                  \"reason\": \"bad request\",\n                  \"originalServeEvent\": {\n                    \"id\": \"4d2f37ca-f7ab-467e-a9ae-f5bbc9ceed1d\"\n                  }\n                }\n              ],\n              \"mappings\": [\n                {\n                  \"request\": {\n                    \"url\": \"/hello\",\n                    \"method\": \"GET\"\n                  },\n                  \"response\": {\n                    \"status\": 201\n                  }\n                },\n                {}\n              ]\n            }\n        \"\"\";\n    SnapshotRecordResult result = Json.read(json, SnapshotRecordResult.class);\n\n    assertThat(result, instanceOf(SnapshotRecordResult.Full.class));\n\n    SnapshotRecordResult.Full idsResult = (SnapshotRecordResult.Full) result;\n    assertThat(idsResult.getMappings().size(), is(2));\n    assertThat(idsResult.getErrors().size(), is(1));\n    RecordError error = idsResult.getErrors().get(0);\n    assertThat(error, is(instanceOf(RecordError.StubGenerationFailure.class)));\n    assertThat(((RecordError.StubGenerationFailure) error).reason(), is(\"bad request\"));\n    assertThat(\n        ((RecordError.StubGenerationFailure) error).originalServeEvent().getId(),\n        is(UUID.fromString(\"4d2f37ca-f7ab-467e-a9ae-f5bbc9ceed1d\")));\n  }\n\n  @Test\n  public void supportsIdsOnlyResponseWithErrors() {\n    String json =\n        \"\"\"\n            {\n              \"errors\": [\n                {\n                  \"errorType\": \"stub-generation-failure\",\n                  \"reason\": \"bad request\",\n                  \"originalServeEvent\": {\n                    \"id\": \"4d2f37ca-f7ab-467e-a9ae-f5bbc9ceed1d\"\n                  }\n                }\n              ],\n              \"ids\": [\n                \"d3f32721-ab5e-479c-9f7a-fda76ed5d803\",\n                \"162d0567-4baf-408b-ad7f-41a779638082\",\n                \"02ee46c3-0b49-40ca-a424-8298c099b6db\"\n              ]\n            }\n        \"\"\";\n    SnapshotRecordResult result = Json.read(json, SnapshotRecordResult.class);\n\n    assertThat(result, instanceOf(SnapshotRecordResult.Ids.class));\n\n    SnapshotRecordResult.Ids idsResult = (SnapshotRecordResult.Ids) result;\n    assertThat(idsResult.getIds().size(), is(3));\n    assertThat(idsResult.getErrors().size(), is(1));\n    RecordError error = idsResult.getErrors().get(0);\n    assertThat(error, is(instanceOf(RecordError.StubGenerationFailure.class)));\n    assertThat(((RecordError.StubGenerationFailure) error).reason(), is(\"bad request\"));\n    assertThat(\n        ((RecordError.StubGenerationFailure) error).originalServeEvent().getId(),\n        is(UUID.fromString(\"4d2f37ca-f7ab-467e-a9ae-f5bbc9ceed1d\")));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/SnapshotRecordResultSerialiserTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.created;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\nimport java.util.UUID;\nimport net.javacrumbs.jsonunit.core.Option;\nimport org.junit.jupiter.api.Test;\n\npublic class SnapshotRecordResultSerialiserTest {\n\n  @Test\n  public void supportsFullResponseWithErrors() {\n    SnapshotRecordResult result =\n        new SnapshotRecordResult.Full(\n            List.of(get(\"/hello\").willReturn(created()).build()),\n            List.of(\n                new RecordError.StubGenerationFailure(\n                    \"bad request\",\n                    ServeEvent.of(mockRequest().method(GET).url(\"/hello\"))\n                        .withResponseDefinition(ok().build()))));\n    String json = Json.write(result);\n\n    String expected =\n        \"\"\"\n            {\n              \"errors\": [\n                {\n                  \"errorType\": \"stub-generation-failure\",\n                  \"reason\": \"bad request\",\n                  \"originalServeEvent\": {\n                    \"request\": {\n                      \"method\": \"GET\"\n                    }\n                  }\n                }\n              ],\n              \"mappings\": [\n                {\n                  \"request\": {\n                    \"url\": \"/hello\",\n                    \"method\": \"GET\"\n                  },\n                  \"response\": {\n                    \"status\": 201\n                  }\n                }\n              ]\n            }\n        \"\"\";\n    assertThat(json, jsonEquals(expected).withOptions(List.of(Option.IGNORING_EXTRA_FIELDS)));\n  }\n\n  @Test\n  public void supportsIdsOnlyResponseWithErrors() {\n    SnapshotRecordResult result =\n        new SnapshotRecordResult.Ids(\n            List.of(\n                UUID.fromString(\"d3f32721-ab5e-479c-9f7a-fda76ed5d803\"),\n                UUID.fromString(\"162d0567-4baf-408b-ad7f-41a779638082\"),\n                UUID.fromString(\"02ee46c3-0b49-40ca-a424-8298c099b6db\")),\n            List.of(\n                new RecordError.StubGenerationFailure(\n                    \"bad request\",\n                    ServeEvent.of(mockRequest().method(GET).url(\"/hello\"))\n                        .withResponseDefinition(ok().build()))));\n    String json = Json.write(result);\n\n    String expected =\n        \"\"\"\n            {\n              \"errors\": [\n                {\n                  \"errorType\": \"stub-generation-failure\",\n                  \"reason\": \"bad request\",\n                  \"originalServeEvent\": {\n                    \"request\": {\n                      \"method\": \"GET\"\n                    }\n                  }\n                }\n              ],\n              \"ids\": [\n                \"d3f32721-ab5e-479c-9f7a-fda76ed5d803\",\n                \"162d0567-4baf-408b-ad7f-41a779638082\",\n                \"02ee46c3-0b49-40ca-a424-8298c099b6db\"\n              ]\n            }\n        \"\"\";\n    assertThat(json, jsonEquals(expected).withOptions(List.of(Option.IGNORING_EXTRA_FIELDS)));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/SnapshotStubMappingBodyExtractorTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.okJson;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.Mockito.verify;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.store.files.FileSourceBlobStore;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.Mockito;\n\npublic class SnapshotStubMappingBodyExtractorTest {\n  private FileSource filesSource;\n  private SnapshotStubMappingBodyExtractor bodyExtractor;\n\n  @BeforeEach\n  public void init() {\n    filesSource = Mockito.mock(FileSource.class, \"filesFileSource\");\n    bodyExtractor = new SnapshotStubMappingBodyExtractor(new FileSourceBlobStore(filesSource));\n  }\n\n  @Test\n  public void updatesStubMapping() {\n    StubMapping stubMapping = WireMock.get(\"/foo\").willReturn(ok(\"\")).build();\n    final StubMapping modifiedStub = bodyExtractor.extractInPlace(stubMapping);\n    assertThat(\n        modifiedStub.getResponse().getBodyFileName(),\n        is(\"get-foo-\" + stubMapping.getId() + \".txt\"));\n    assertThat(modifiedStub.getResponse().specifiesBodyFile(), is(true));\n    assertThat(modifiedStub.getResponse().specifiesBodyContent(), is(false));\n    // ignore arguments because this test is only for checking stub mapping changes\n    verify(filesSource).writeBinaryFile(any(String.class), any(byte[].class));\n  }\n\n  @Test\n  public void determinesFileNameProperlyFromUrlWithJson() {\n    StubMapping stubMapping = WireMock.get(\"/foo/bar.json\").willReturn(ok(\"{}\")).build();\n    bodyExtractor.extractInPlace(stubMapping);\n    verifyWriteBinaryFile(\"get-foobar.json-\" + stubMapping.getId() + \".json\", \"{}\");\n  }\n\n  @Test\n  public void determinesFileNameProperlyFromUrlWithText() {\n    StubMapping stubMapping = WireMock.get(\"/foo/bar.txt\").willReturn(ok(\"\")).build();\n    bodyExtractor.extractInPlace(stubMapping);\n    verifyWriteBinaryFile(\"get-foobar.txt-\" + stubMapping.getId() + \".txt\", \"\");\n  }\n\n  @Test\n  public void determinesFileNameProperlyFromMimeTypeWithJson() {\n    StubMapping stubMapping = WireMock.get(\"/foo/bar.txt\").willReturn(okJson(\"{}\")).build();\n    bodyExtractor.extractInPlace(stubMapping);\n    verifyWriteBinaryFile(\"get-foobar.txt-\" + stubMapping.getId() + \".json\", \"{}\");\n  }\n\n  @Test\n  public void determinesFileNameProperlyWithNamedStubMapping() {\n    StubMapping stubMapping =\n        WireMock.get(\"/foo\")\n            .willReturn(okJson(\"{}\"))\n            .build()\n            .transform(b -> b.setName(\"TEST NAME!\"));\n    bodyExtractor.extractInPlace(stubMapping);\n    verifyWriteBinaryFile(\"test-name-\" + stubMapping.getId() + \".json\", \"{}\");\n  }\n\n  private void verifyWriteBinaryFile(final String filename, final String body) {\n    verify(filesSource).writeBinaryFile(eq(filename), eq(body.getBytes()));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/SnapshotStubMappingGeneratorTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.common.Limit.UNLIMITED;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.testsupport.MockRequestBuilder.aRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.Timing;\nimport com.github.tomakehurst.wiremock.http.LoggedResponse;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.util.concurrent.LinkedBlockingDeque;\nimport org.junit.jupiter.api.Test;\n\npublic class SnapshotStubMappingGeneratorTest {\n  @Test\n  public void apply() {\n    final RequestPatternBuilder requestPatternBuilder = newRequestPattern().withUrl(\"/foo\");\n    final ResponseDefinition responseDefinition = ResponseDefinition.ok();\n\n    SnapshotStubMappingGenerator stubMappingTransformer =\n        new SnapshotStubMappingGenerator(\n            requestPatternTransformer(requestPatternBuilder),\n            responseDefinitionTransformer(responseDefinition),\n            true);\n\n    StubMapping actual = stubMappingTransformer.apply(serveEvent());\n\n    StubMapping expected =\n        StubMapping.builder()\n            .setRequest(requestPatternBuilder.build())\n            .setResponse(responseDefinition)\n            .setId(actual.getId())\n            .setName(\"\")\n            .setPersistent(true)\n            .build();\n\n    assertThat(actual, is(expected));\n  }\n\n  @Test\n  public void applyWithStrangePathAndCheckSanitizedState() {\n    final RequestPatternBuilder requestPatternBuilder =\n        newRequestPattern().withUrl(\"hello_1_2_3___ace--ace___and\");\n    final ResponseDefinition responseDefinition = ResponseDefinition.ok();\n\n    SnapshotStubMappingGenerator stubMappingTransformer =\n        new SnapshotStubMappingGenerator(\n            requestPatternTransformer(requestPatternBuilder),\n            responseDefinitionTransformer(responseDefinition),\n            false);\n\n    StubMapping actual =\n        stubMappingTransformer.apply(serveEventWithPath(\"/hello/1/2/3__!/ẮČĖ--ace/¥$$/$/and/¿?\"));\n\n    StubMapping expected =\n        StubMapping.builder()\n            .setRequest(requestPatternBuilder.build())\n            .setResponse(responseDefinition)\n            .setId(actual.getId())\n            .setName(\"hello_1_2_3___ace--ace___and\")\n            .build();\n\n    assertThat(actual, is(expected));\n  }\n\n  private static RequestPatternTransformer requestPatternTransformer(\n      final RequestPatternBuilder requestPatternBuilder) {\n    return new RequestPatternTransformer(null, null) {\n      @Override\n      public RequestPatternBuilder apply(Request request) {\n        return requestPatternBuilder;\n      }\n    };\n  }\n\n  private static LoggedResponseDefinitionTransformer responseDefinitionTransformer(\n      final ResponseDefinition responseDefinition) {\n    return new LoggedResponseDefinitionTransformer() {\n      @Override\n      public ResponseDefinition apply(LoggedResponse response) {\n        return responseDefinition;\n      }\n    };\n  }\n\n  private static ServeEvent serveEventWithPath(String path) {\n    return ServeEvent.of(LoggedRequest.createFrom(aRequest().withUrl(path).build()));\n  }\n\n  private static ServeEvent serveEvent() {\n    return new ServeEvent(\n        null,\n        LoggedRequest.createFrom(aRequest().build()),\n        null,\n        null,\n        LoggedResponse.from(Response.notConfigured(), UNLIMITED),\n        false,\n        Timing.UNTIMED,\n        new LinkedBlockingDeque<>());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/SnapshotStubMappingPostProcessorTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class SnapshotStubMappingPostProcessorTest {\n\n  // NOTE: testStubMappings is not deeply immutable, as StubMappings are mutable, and to preserve\n  // hermeticity must be an instance rather than a class variable.\n  private final List<StubMapping> testStubMappings =\n      List.of(\n          WireMock.get(\"/foo\").build(), WireMock.get(\"/bar\").build(), WireMock.get(\"/foo\").build());\n\n  private final List<Pair<ServeEvent, StubMapping>> testServeEventsToStubMappings =\n      List.of(\n          new Pair<>(ServeEvent.of(mockRequest()), testStubMappings.get(0)),\n          new Pair<>(ServeEvent.of(mockRequest()), testStubMappings.get(1)),\n          new Pair<>(ServeEvent.of(mockRequest()), testStubMappings.get(2)));\n\n  @Test\n  public void processWithRecordRepeatsAsScenariosFalseShouldFilterRepeatedRequests() {\n    final List<StubMapping> actual =\n        new SnapshotStubMappingPostProcessor(false, noopTransformerRunner(), null, null)\n            .process(testServeEventsToStubMappings)\n            .b;\n\n    assertThat(actual, hasSize(2));\n    assertThat(actual.get(0).getRequest().getUrl(), equalTo(\"/foo\"));\n    assertThat(actual.get(1).getRequest().getUrl(), equalTo(\"/bar\"));\n  }\n\n  @Test\n  public void processWithTransformerShouldTransformStubMappingRequestUrls() {\n    SnapshotStubMappingTransformerRunner transformerRunner =\n        new SnapshotStubMappingTransformerRunner(null) {\n          @Override\n          public StubGenerationResult apply(Pair<ServeEvent, StubMapping> serveEventToStubMapping) {\n            // Return StubMapping with \"/transformed\" at the end of the original URL\n            String url = serveEventToStubMapping.b.getRequest().getUrl();\n            return new StubGenerationResult.Success(\n                StubMapping.builder()\n                    .setRequest(newRequestPattern().withUrl(url + \"/transformed\").build())\n                    .setResponse(ResponseDefinition.ok())\n                    .build());\n          }\n        };\n\n    final List<StubMapping> actual =\n        new SnapshotStubMappingPostProcessor(false, transformerRunner, null, null)\n            .process(testServeEventsToStubMappings)\n            .b;\n\n    assertThat(actual, hasSize(2));\n    assertThat(actual.get(0).getRequest().getUrl(), equalTo(\"/foo/transformed\"));\n    assertThat(actual.get(1).getRequest().getUrl(), equalTo(\"/bar/transformed\"));\n  }\n\n  @Test\n  public void\n      processWithRecordRepeatsAsScenariosAndTransformerShouldRunTransformerBeforeScenarioProcessor() {\n    SnapshotStubMappingTransformerRunner transformerRunner =\n        new SnapshotStubMappingTransformerRunner(null) {\n          @Override\n          public StubGenerationResult apply(Pair<ServeEvent, StubMapping> serveEventToStubMapping) {\n            // Return StubMapping with \"/transformed\" at the end of the original URL\n            String url = serveEventToStubMapping.b.getRequest().getUrl();\n            return new StubGenerationResult.Success(\n                StubMapping.builder()\n                    .setRequest(newRequestPattern().withUrl(url + \"/transformed\").build())\n                    .setResponse(ResponseDefinition.ok())\n                    .build());\n          }\n        };\n\n    final List<StubMapping> actual =\n        new SnapshotStubMappingPostProcessor(true, transformerRunner, null, null)\n            .process(testServeEventsToStubMappings)\n            .b;\n\n    assertThat(actual, hasSize(3));\n    assertThat(actual.get(0).getRequest().getUrl(), equalTo(\"/foo/transformed\"));\n    assertThat(actual.get(1).getRequest().getUrl(), equalTo(\"/bar/transformed\"));\n    assertThat(actual.get(2).getRequest().getUrl(), equalTo(\"/foo/transformed\"));\n\n    assertTrue(actual.get(0).isInScenario());\n    assertFalse(actual.get(1).isInScenario());\n    assertTrue(actual.get(2).isInScenario());\n  }\n\n  @Test\n  public void processWithBodyExtractMatcherAndBodyExtractorShouldExtractsBodiesWhenMatched() {\n    final ResponseDefinitionBodyMatcher bodyMatcher =\n        new ResponseDefinitionBodyMatcher(0, 0) {\n          @Override\n          public MatchResult match(ResponseDefinition responseDefinition) {\n            // Only match the second stub mapping\n            return responseDefinition == testStubMappings.get(1).getResponse()\n                ? MatchResult.exactMatch()\n                : MatchResult.noMatch();\n          }\n        };\n\n    final SnapshotStubMappingBodyExtractor bodyExtractor =\n        new SnapshotStubMappingBodyExtractor(null) {\n          @Override\n          public StubMapping extractInPlace(StubMapping stubMapping) {\n            return stubMapping.transform(\n                b -> b.setRequest(newRequestPattern().withUrl(\"/extracted\").build()));\n          }\n        };\n\n    final List<StubMapping> actual =\n        new SnapshotStubMappingPostProcessor(\n                false, noopTransformerRunner(), bodyMatcher, bodyExtractor)\n            .process(testServeEventsToStubMappings)\n            .b;\n\n    assertThat(actual, hasSize(2));\n    // Should've only modified second stub mapping\n    assertThat(actual.get(0).getRequest().getUrl(), is(\"/foo\"));\n    assertThat(actual.get(1).getRequest().getUrl(), is(\"/extracted\"));\n  }\n\n  private static SnapshotStubMappingTransformerRunner noopTransformerRunner() {\n    return new SnapshotStubMappingTransformerRunner(null) {\n      @Override\n      public StubGenerationResult apply(Pair<ServeEvent, StubMapping> serveEventToStubMapping) {\n        return new StubGenerationResult.Success(serveEventToStubMapping.b);\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/recording/SnapshotStubMappingTransformerRunnerTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertInstanceOf;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.GlobalStubMappingTransformer;\nimport com.github.tomakehurst.wiremock.testsupport.NonGlobalStubMappingTransformer;\nimport com.github.tomakehurst.wiremock.testsupport.StubMappingTransformerWithServeEvent;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\n\npublic class SnapshotStubMappingTransformerRunnerTest {\n  private final StubMapping stubMapping = WireMock.get(\"/\").build();\n  private final ServeEvent serveEvent =\n      ServeEvent.of(mockRequest().url(\"/whatever?some-query=my-value\"));\n\n  @Test\n  public void applyWithNoTransformers() {\n    StubGenerationResult result =\n        new SnapshotStubMappingTransformerRunner(List.of())\n            .apply(new Pair<>(serveEvent, stubMapping));\n\n    assertEquals(new StubGenerationResult.Success(stubMapping), result);\n  }\n\n  @Test\n  public void applyWithUnregisteredNonGlobalTransformer() {\n    // Should not apply the transformer as it isn't registered\n    StubGenerationResult result =\n        new SnapshotStubMappingTransformerRunner(List.of(new NonGlobalStubMappingTransformer()))\n            .apply(new Pair<>(serveEvent, stubMapping));\n\n    assertEquals(new StubGenerationResult.Success(stubMapping), result);\n  }\n\n  @Test\n  public void applyWithRegisteredNonGlobalTransformer() {\n    StubGenerationResult result =\n        new SnapshotStubMappingTransformerRunner(\n                List.of(new NonGlobalStubMappingTransformer()),\n                List.of(\"nonglobal-transformer\"),\n                null,\n                null)\n            .apply(new Pair<>(serveEvent, stubMapping));\n\n    assertInstanceOf(StubGenerationResult.Success.class, result);\n    StubMapping stubMapping = ((StubGenerationResult.Success) result).stubMapping();\n    assertEquals(\"/?transformed=nonglobal\", stubMapping.getRequest().getUrl());\n  }\n\n  @Test\n  public void applyWithGlobalTransformer() {\n    StubGenerationResult result =\n        new SnapshotStubMappingTransformerRunner(List.of(new GlobalStubMappingTransformer()))\n            .apply(new Pair<>(serveEvent, stubMapping));\n\n    assertInstanceOf(StubGenerationResult.Success.class, result);\n    StubMapping stubMapping = ((StubGenerationResult.Success) result).stubMapping();\n    assertEquals(\"/?transformed=global\", stubMapping.getRequest().getUrl());\n  }\n\n  @Test\n  public void providesServeEventToTransformer() {\n    StubGenerationResult result =\n        new SnapshotStubMappingTransformerRunner(\n                List.of(new StubMappingTransformerWithServeEvent()))\n            .apply(new Pair<>(serveEvent, stubMapping));\n\n    assertInstanceOf(StubGenerationResult.Success.class, result);\n    StubMapping stubMapping = ((StubGenerationResult.Success) result).stubMapping();\n    assertEquals(\"/?transformed=my-value\", stubMapping.getRequest().getUrl());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/schema/WireMockMessageStubMappingJsonSchemaRegressionTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.schema;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.empty;\nimport static org.hamcrest.core.Is.is;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.networknt.schema.JsonSchema;\nimport com.networknt.schema.JsonSchemaFactory;\nimport com.networknt.schema.SchemaValidatorsConfig;\nimport com.networknt.schema.SpecVersion;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.URI;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport org.junit.jupiter.api.Test;\n\nclass WireMockMessageStubMappingJsonSchemaRegressionTest {\n\n  private static final String SCHEMA_PATH = \"schemas/wiremock-message-stub-mapping.json\";\n  private static final Path EXPECTED_SCHEMA_PATH =\n      Path.of(\"schemas/wiremock-message-stub-mapping-or-mappings.json\");\n\n  @Test\n  void schemaIsAJsonSchema() {\n    JsonNode schemaJson = Json.node(loadResourceAsString(SCHEMA_PATH));\n    assertNotNull(schemaJson, \"Schema file not found: \" + SCHEMA_PATH);\n\n    SchemaValidatorsConfig schemaValidatorsConfig = SchemaValidatorsConfig.builder().build();\n    SpecVersion.VersionFlag version =\n        SpecVersion.VersionFlag.fromId(schemaJson.get(\"$schema\").textValue()).orElseThrow();\n\n    final JsonSchemaFactory schemaFactory = JsonSchemaFactory.getInstance(version);\n\n    JsonNode metaSchemaJson =\n        Json.node(loadResourceAsString(URI.create(version.getId()).getPath().substring(1)));\n    final JsonSchema metaSchema = schemaFactory.getSchema(metaSchemaJson, schemaValidatorsConfig);\n\n    assertThat(metaSchema.validate(schemaJson), is(empty()));\n  }\n\n  @Test\n  void schemaIsExpectedSchema() throws IOException {\n    String actualSchema = loadResourceAsString(SCHEMA_PATH);\n    assertNotNull(actualSchema, \"Schema file not found: \" + SCHEMA_PATH);\n\n    String expectedSchema = loadFileAsString(EXPECTED_SCHEMA_PATH);\n    assertNotNull(expectedSchema, \"Expected schema file not found: \" + EXPECTED_SCHEMA_PATH);\n\n    try {\n      assertThat(actualSchema, jsonEquals(expectedSchema));\n    } catch (AssertionError e) {\n      Files.writeString(EXPECTED_SCHEMA_PATH, actualSchema);\n      System.err.println(\n          \"The regression test failing may just mean that your intended changes need to be committed.\"\n              + System.lineSeparator()\n              + EXPECTED_SCHEMA_PATH\n              + \" has been updated - compare it with the previous version, and if you are happy with the changes commit them.\");\n      throw e;\n    }\n  }\n\n  private String loadResourceAsString(String resourcePath) {\n    try (InputStream is = getClass().getClassLoader().getResourceAsStream(resourcePath)) {\n      if (is == null) {\n        return null;\n      }\n      return new String(is.readAllBytes(), UTF_8);\n    } catch (IOException e) {\n      throw new RuntimeException(\"Failed to load resource: \" + resourcePath, e);\n    }\n  }\n\n  private String loadFileAsString(Path filePath) {\n    try {\n      return Files.readString(filePath);\n    } catch (IOException e) {\n      throw new RuntimeException(\"Failed to load file: \" + filePath, e);\n    }\n  }\n}\n\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/schema/WireMockStubMappingJsonSchemaRegressionTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.schema;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.empty;\nimport static org.hamcrest.core.Is.is;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.networknt.schema.JsonSchema;\nimport com.networknt.schema.JsonSchemaFactory;\nimport com.networknt.schema.SchemaValidatorsConfig;\nimport com.networknt.schema.SpecVersion;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.URI;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport org.junit.jupiter.api.Test;\n\nclass WireMockStubMappingJsonSchemaRegressionTest {\n\n  private static final String SCHEMA_PATH = \"schemas/wiremock-stub-mapping.json\";\n  private static final Path EXPECTED_SCHEMA_PATH =\n      Path.of(\"schemas/wiremock-stub-mapping-or-mappings.json\");\n\n  @Test\n  void schemaIsAJsonSchema() {\n    JsonNode schemaJson = Json.node(loadResourceAsString(SCHEMA_PATH));\n    assertNotNull(schemaJson, \"Schema file not found: \" + SCHEMA_PATH);\n\n    SchemaValidatorsConfig schemaValidatorsConfig = SchemaValidatorsConfig.builder().build();\n    SpecVersion.VersionFlag version =\n        SpecVersion.VersionFlag.fromId(schemaJson.get(\"$schema\").textValue()).orElseThrow();\n\n    final JsonSchemaFactory schemaFactory = JsonSchemaFactory.getInstance(version);\n\n    JsonNode metaSchemaJson =\n        Json.node(loadResourceAsString(URI.create(version.getId()).getPath().substring(1)));\n    final JsonSchema metaSchema = schemaFactory.getSchema(metaSchemaJson, schemaValidatorsConfig);\n\n    assertThat(metaSchema.validate(schemaJson), is(empty()));\n  }\n\n  @Test\n  void schemaIsExpectedSchema() throws IOException {\n    // Load the actual schema\n    String actualSchema = loadResourceAsString(SCHEMA_PATH);\n    assertNotNull(actualSchema, \"Schema file not found: \" + SCHEMA_PATH);\n\n    // Load the expected schema\n    String expectedSchema = loadFileAsString(EXPECTED_SCHEMA_PATH);\n    assertNotNull(expectedSchema, \"Expected schema file not found: \" + EXPECTED_SCHEMA_PATH);\n\n    // Compare the schemas\n    try {\n      assertThat(actualSchema, jsonEquals(expectedSchema));\n    } catch (AssertionError e) {\n      Files.writeString(EXPECTED_SCHEMA_PATH, actualSchema);\n      System.err.println(\n          \"The regression test failing may just mean that your intended changes need to be committed.\"\n              + System.lineSeparator()\n              + EXPECTED_SCHEMA_PATH\n              + \" has been updated - compare it with the previous version, and if you are happy with the changes commit them.\");\n      throw e;\n    }\n  }\n\n  private String loadResourceAsString(String resourcePath) {\n    try (InputStream is = getClass().getClassLoader().getResourceAsStream(resourcePath)) {\n      if (is == null) {\n        return null;\n      }\n      return new String(is.readAllBytes(), UTF_8);\n    } catch (IOException e) {\n      throw new RuntimeException(\"Failed to load resource: \" + resourcePath, e);\n    }\n  }\n\n  private String loadFileAsString(Path filePath) {\n    try {\n      return Files.readString(filePath);\n    } catch (IOException e) {\n      throw new RuntimeException(\"Failed to load file: \" + filePath, e);\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/servlet/BodyChunkerTest.java",
    "content": "/*\n * Copyright (C) 2017-2021 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.servlet;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.arrayWithSize;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport org.junit.jupiter.api.Test;\n\npublic class BodyChunkerTest {\n\n  @Test\n  public void returnsBodyAsSingleChunkWhenChunkSizeIsOne() {\n    byte[] body = \"1234\".getBytes();\n    int numberOfChunks = 1;\n\n    byte[][] chunkedBody = BodyChunker.chunkBody(body, numberOfChunks);\n\n    assertThat(chunkedBody, arrayWithSize(numberOfChunks));\n    assertThat(chunkedBody[0], equalTo(body));\n  }\n\n  @Test\n  public void returnsEvenlyChunkedBody() {\n    byte[] body = \"1234\".getBytes();\n    int numberOfChunks = 2;\n\n    byte[][] chunkedBody = BodyChunker.chunkBody(body, numberOfChunks);\n\n    assertThat(chunkedBody, arrayWithSize(numberOfChunks));\n    assertThat(chunkedBody[0], equalTo(\"12\".getBytes()));\n    assertThat(chunkedBody[1], equalTo(\"34\".getBytes()));\n  }\n\n  @Test\n  public void addsExcessBytesToLastChunk() {\n    byte[] body = \"1234\".getBytes();\n    int numberOfChunks = 3;\n\n    byte[][] chunkedBody = BodyChunker.chunkBody(body, numberOfChunks);\n\n    assertThat(chunkedBody, arrayWithSize(numberOfChunks));\n    assertThat(chunkedBody[0], equalTo(\"1\".getBytes()));\n    assertThat(chunkedBody[1], equalTo(\"2\".getBytes()));\n    assertThat(chunkedBody[2], equalTo(\"34\".getBytes()));\n  }\n\n  @Test\n  public void defaultsChunkSizeToOneIfNumberOfChunksGreaterThenBodyLength() {\n    byte[] body = \"1234\".getBytes();\n    int numberOfChunks = 5;\n\n    byte[][] chunkedBody = BodyChunker.chunkBody(body, numberOfChunks);\n\n    assertThat(chunkedBody, arrayWithSize(body.length));\n    assertThat(chunkedBody[0], equalTo(\"1\".getBytes()));\n    assertThat(chunkedBody[1], equalTo(\"2\".getBytes()));\n    assertThat(chunkedBody[2], equalTo(\"3\".getBytes()));\n    assertThat(chunkedBody[3], equalTo(\"4\".getBytes()));\n  }\n\n  @Test\n  public void defaultsChunkSizeToOneIfNumberOfChunksLessThanOne() {\n    byte[] body = \"1234\".getBytes();\n    int numberOfChunks = -1;\n\n    byte[][] chunkedBody = BodyChunker.chunkBody(body, numberOfChunks);\n\n    assertThat(chunkedBody, arrayWithSize(1));\n    assertThat(chunkedBody[0], equalTo(body));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/standalone/CommandLineOptionsTest.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\nimport static com.github.tomakehurst.wiremock.common.BrowserProxySettings.DEFAULT_CA_KESTORE_PASSWORD;\nimport static com.github.tomakehurst.wiremock.common.BrowserProxySettings.DEFAULT_CA_KEYSTORE_PATH;\nimport static com.github.tomakehurst.wiremock.core.Options.DEFAULT_MAX_TEMPLATE_CACHE_ENTRIES;\nimport static com.github.tomakehurst.wiremock.core.Options.DEFAULT_WEBHOOK_THREADPOOL_SIZE;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.matchesMultiLine;\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.singletonList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.client.BasicCredentials;\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport com.github.tomakehurst.wiremock.core.MappingsSaver;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.*;\nimport com.github.tomakehurst.wiremock.http.CaseInsensitiveKey;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.ConsoleNotifyingWiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.jetty.JettyHttpServerFactory;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.security.Authenticator;\nimport java.util.Collections;\nimport java.util.Optional;\nimport java.util.Set;\nimport org.junit.jupiter.api.Test;\n\npublic class CommandLineOptionsTest {\n\n  @Test\n  public void returnsVerboseTrueWhenOptionPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--verbose\");\n    assertThat(options.verboseLoggingEnabled(), is(true));\n  }\n\n  @Test\n  public void returnsVerboseFalseWhenOptionNotPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"\");\n    assertThat(options.verboseLoggingEnabled(), is(false));\n  }\n\n  @Test\n  public void returnsVersionTrueWhenOptionPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--version\");\n    assertThat(options.version(), is(true));\n  }\n\n  @Test\n  public void returnsVersionFalseWhenOptionNotPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"\");\n    assertThat(options.version(), is(false));\n  }\n\n  @Test\n  public void returnsRecordMappingsTrueWhenOptionPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--record-mappings\");\n    assertThat(options.recordMappingsEnabled(), is(true));\n  }\n\n  @Test\n  public void returnsHeaderMatchingEnabledWhenOptionPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--match-headers\", \"Accept,Content-Type\");\n    assertThat(\n        options.matchingHeaders(),\n        hasItems(CaseInsensitiveKey.from(\"Accept\"), CaseInsensitiveKey.from(\"Content-Type\")));\n  }\n\n  @Test\n  public void returnsRecordMappingsFalseWhenOptionNotPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"\");\n    assertThat(options.recordMappingsEnabled(), is(false));\n  }\n\n  @Test\n  public void setsPortNumberWhenOptionPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--port\", \"8086\");\n    assertThat(options.portNumber(), is(8086));\n  }\n\n  @Test\n  public void disablesHttpWhenOptionPresentAndHttpsEnabled() {\n    CommandLineOptions options = new CommandLineOptions(\"--disable-http\", \"--https-port\", \"8443\");\n    assertThat(options.getHttpDisabled(), is(true));\n  }\n\n  @Test\n  public void disablesHttp2PlainWhenOptionSet() {\n    CommandLineOptions options = new CommandLineOptions(\"--disable-http2-plain\");\n    assertThat(options.getHttp2PlainDisabled(), is(true));\n  }\n\n  @Test\n  public void disablesHttp2TlsWhenOptionSet() {\n    CommandLineOptions options = new CommandLineOptions(\"--disable-http2-tls\");\n    assertThat(options.getHttp2TlsDisabled(), is(true));\n  }\n\n  @Test\n  public void enablesHttpsAndSetsPortNumberWhenOptionPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--https-port\", \"8443\");\n    assertThat(options.httpsSettings().enabled(), is(true));\n    assertThat(options.httpsSettings().port(), is(8443));\n  }\n\n  @Test\n  public void defaultsKeystorePathIfNotSpecifiedWhenHttpsEnabled() {\n    CommandLineOptions options = new CommandLineOptions(\"--https-port\", \"8443\");\n    assertThat(options.httpsSettings().keyStorePath(), endsWith(\"/keystore\"));\n  }\n\n  @Test\n  public void setsRequireClientCert() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--https-port\",\n            \"8443\",\n            \"--https-keystore\",\n            \"/my/keystore\",\n            \"--https-truststore\",\n            \"/my/truststore\",\n            \"--https-require-client-cert\");\n    assertThat(options.httpsSettings().needClientAuth(), is(true));\n  }\n\n  @Test\n  public void setsTrustStoreOptions() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--https-port\", \"8443\",\n            \"--https-keystore\", \"/my/keystore\",\n            \"--https-truststore\", \"/my/truststore\",\n            \"--truststore-type\", \"PKCS12\",\n            \"--truststore-password\", \"sometrustpwd\");\n    assertThat(options.httpsSettings().trustStorePath(), is(\"/my/truststore\"));\n    assertThat(options.httpsSettings().trustStoreType(), is(\"PKCS12\"));\n    assertThat(options.httpsSettings().trustStorePassword(), is(\"sometrustpwd\"));\n  }\n\n  @Test\n  public void defaultsTrustStorePasswordIfNotSpecified() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--https-keystore\", \"/my/keystore\",\n            \"--https-truststore\", \"/my/truststore\");\n    assertThat(options.httpsSettings().trustStorePassword(), is(\"password\"));\n  }\n\n  @Test\n  public void setsHttpsKeyStorePathOptions() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--https-port\", \"8443\",\n            \"--https-keystore\", \"/my/keystore\",\n            \"--keystore-type\", \"pkcs12\",\n            \"--keystore-password\", \"someotherpwd\",\n            \"--key-manager-password\", \"keymanpass\");\n    assertThat(options.httpsSettings().keyStorePath(), is(\"/my/keystore\"));\n    assertThat(options.httpsSettings().keyStoreType(), is(\"pkcs12\"));\n    assertThat(options.httpsSettings().keyStorePassword(), is(\"someotherpwd\"));\n    assertThat(options.httpsSettings().keyManagerPassword(), is(\"keymanpass\"));\n  }\n\n  @Test\n  public void throwsExceptionWhenPortNumberSpecifiedWithoutNumber() {\n    assertThrows(Exception.class, () -> new CommandLineOptions(\"--port\"));\n  }\n\n  @Test\n  public void returnsCorrecteyParsedBindAddress() {\n    CommandLineOptions options = new CommandLineOptions(\"--bind-address\", \"127.0.0.1\");\n    assertThat(options.bindAddress(), is(\"127.0.0.1\"));\n  }\n\n  @Test\n  public void setsProxyAllRootWhenOptionPresent() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--proxy-all\", \"http://someotherhost.com/site\");\n    assertThat(options.specifiesProxyUrl(), is(true));\n    assertThat(options.proxyUrl(), is(\"http://someotherhost.com/site\"));\n  }\n\n  @Test\n  public void setsProxyHostHeaderWithTrailingPortInformation() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--proxy-all\", \"http://someotherhost.com:8080/site\");\n    assertThat(options.proxyHostHeader(), is(\"someotherhost.com:8080\"));\n  }\n\n  @Test\n  public void throwsExceptionWhenProxyAllSpecifiedWithoutUrl() {\n    assertThrows(Exception.class, () -> new CommandLineOptions(\"--proxy-all\"));\n  }\n\n  @Test\n  public void returnsBrowserProxyingEnabledWhenOptionSet() {\n    CommandLineOptions options = new CommandLineOptions(\"--enable-browser-proxying\");\n    assertThat(options.browserProxyingEnabled(), is(true));\n    assertThat(options.browserProxySettings().enabled(), is(true));\n  }\n\n  @Test\n  public void returnsBrowserProxyingDisabledWhenOptionNoSet() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.browserProxyingEnabled(), is(false));\n    assertThat(options.browserProxySettings().enabled(), is(false));\n  }\n\n  @Test\n  public void setsAll() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--verbose\",\n            \"--record-mappings\",\n            \"--port\",\n            \"8088\",\n            \"--proxy-all\",\n            \"http://somewhere.com\");\n    assertThat(options.verboseLoggingEnabled(), is(true));\n    assertThat(options.recordMappingsEnabled(), is(true));\n    assertThat(options.portNumber(), is(8088));\n    assertThat(options.specifiesProxyUrl(), is(true));\n    assertThat(options.proxyUrl(), is(\"http://somewhere.com\"));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  public void returnsHelpText() {\n    CommandLineOptions options = new CommandLineOptions(\"--help\");\n    assertThat(options.helpText(), allOf(containsString(\"verbose\")));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedProxyViaParameter() {\n    CommandLineOptions options = new CommandLineOptions(\"--proxy-via\", \"somehost.mysite.com:8080\");\n    assertThat(options.proxyVia().host(), is(\"somehost.mysite.com\"));\n    assertThat(options.proxyVia().port(), is(8080));\n    assertThat(options.proxyVia().getUsername(), is(emptyOrNullString()));\n    assertThat(options.proxyVia().getPassword(), is(emptyOrNullString()));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedProxyViaParameterWithCredentials() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--proxy-via\", \"user:password@somehost.mysite.com:8080\");\n    assertThat(options.proxyVia().host(), is(\"somehost.mysite.com\"));\n    assertThat(options.proxyVia().port(), is(8080));\n    assertThat(options.proxyVia().getUsername(), is(\"user\"));\n    assertThat(options.proxyVia().getPassword(), is(\"password\"));\n  }\n\n  @Test\n  public void returnsNoProxyWhenNoProxyViaSpecified() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.proxyVia(), is(ProxySettings.NO_PROXY));\n  }\n\n  @Test\n  public void returnsDisabledRequestJournal() {\n    CommandLineOptions options = new CommandLineOptions(\"--no-request-journal\");\n    assertThat(options.requestJournalDisabled(), is(true));\n  }\n\n  @Test\n  public void returnsMaxRequestJournalEntries() {\n    CommandLineOptions options = new CommandLineOptions(\"--max-request-journal-entries\", \"2\");\n    assertThat(options.maxRequestJournalEntries(), is(Optional.of(2)));\n    CommandLineOptions optionsNoMax = new CommandLineOptions(\"\");\n    assertThat(optionsNoMax.maxRequestJournalEntries().isPresent(), is(false));\n  }\n\n  @Test\n  public void returnPreserveHostHeaderTrueWhenPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--preserve-host-header\");\n    assertThat(options.shouldPreserveHostHeader(), is(true));\n  }\n\n  @Test\n  public void returnPreserveHostHeaderFalseWhenNotPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--port\", \"8080\");\n    assertThat(options.shouldPreserveHostHeader(), is(false));\n  }\n\n  @Test\n  public void returnPreserveUserAgentProxyHeaderTrueWhenPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--preserve-user-agent-proxy-header\");\n    assertThat(options.shouldPreserveUserAgentProxyHeader(), is(true));\n  }\n\n  @Test\n  public void returnPreserveUserAgentProxyHeaderFalseWhenNotPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--port\", \"8080\");\n    assertThat(options.shouldPreserveUserAgentProxyHeader(), is(false));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedNumberOfThreads() {\n    CommandLineOptions options = new CommandLineOptions(\"--container-threads\", \"300\");\n    assertThat(options.containerThreads(), is(300));\n  }\n\n  @Test\n  public void defaultsContainerThreadsTo25() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.containerThreads(), is(25));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedGlobalTimeout() {\n    CommandLineOptions options = new CommandLineOptions(\"--timeout\", \"45000\");\n    assertThat(options.timeout(), is(45_000L));\n  }\n\n  @Test\n  public void returnsDefaultGlobalTimeout() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.timeout(), is(300_000L));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedJettyAcceptorThreads() {\n    CommandLineOptions options = new CommandLineOptions(\"--jetty-acceptor-threads\", \"400\");\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory()).getSettings().getAcceptors().get(),\n        is(400));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedJettyAcceptQueueSize() {\n    CommandLineOptions options = new CommandLineOptions(\"--jetty-accept-queue-size\", \"10\");\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory())\n            .getSettings()\n            .getAcceptQueueSize()\n            .get(),\n        is(10));\n  }\n\n  @Test\n  @Deprecated\n  public void returnsCorrectlyParsedJettyHeaderBufferSize() {\n    CommandLineOptions options = new CommandLineOptions(\"--jetty-header-buffer-size\", \"16384\");\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory())\n            .getSettings()\n            .getRequestHeaderSize()\n            .get(),\n        is(16384));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedJettyHeaderRequestSize() {\n    CommandLineOptions options = new CommandLineOptions(\"--jetty-header-request-size\", \"16384\");\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory())\n            .getSettings()\n            .getRequestHeaderSize()\n            .get(),\n        is(16384));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedJettyHeaderResponseSize() {\n    CommandLineOptions options = new CommandLineOptions(\"--jetty-header-response-size\", \"16384\");\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory())\n            .getSettings()\n            .getResponseHeaderSize()\n            .get(),\n        is(16384));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedJettyStopTimeout() {\n    CommandLineOptions options = new CommandLineOptions(\"--jetty-stop-timeout\", \"1000\");\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory()).getSettings().getStopTimeout().get(),\n        is(1000L));\n  }\n\n  @Test\n  public void returnsCorrectlyParsedJettyIdleTimeout() {\n    CommandLineOptions options = new CommandLineOptions(\"--jetty-idle-timeout\", \"2000\");\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory()).getSettings().getIdleTimeout().get(),\n        is(2000L));\n  }\n\n  @Test\n  public void returnsAbsentIfJettyAcceptQueueSizeNotSet() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory())\n            .getSettings()\n            .getAcceptQueueSize()\n            .isPresent(),\n        is(false));\n  }\n\n  @Test\n  public void returnsAbsentIfJettyAcceptorsNotSet() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory())\n            .getSettings()\n            .getAcceptors()\n            .isPresent(),\n        is(false));\n  }\n\n  @Test\n  public void returnsAbsentIfJettyHeaderBufferSizeNotSet() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory())\n            .getSettings()\n            .getRequestHeaderSize()\n            .isPresent(),\n        is(false));\n  }\n\n  @Test\n  public void returnsAbsentIfJettyStopTimeoutNotSet() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(\n        ((JettyHttpServerFactory) options.httpServerFactory())\n            .getSettings()\n            .getStopTimeout()\n            .isPresent(),\n        is(false));\n  }\n\n  @Test\n  public void preventsRecordingWhenRequestJournalDisabled() {\n    assertThrows(\n        IllegalArgumentException.class,\n        () -> new CommandLineOptions(\"--no-request-journal\", \"--record-mappings\"));\n  }\n\n  @Test\n  public void returnsRequestMatcherExtensionsSpecifiedAsClassNames() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--extensions\",\n            \"com.github.tomakehurst.wiremock.standalone.CommandLineOptionsTest$RequestExt1,com.github.tomakehurst.wiremock.standalone.CommandLineOptionsTest$ResponseDefinitionTransformerExt1\");\n\n    ExtensionDeclarations extensionDeclarations = options.getDeclaredExtensions();\n\n    assertThat(extensionDeclarations.getClassNames(), hasSize(2));\n    assertThat(\n        extensionDeclarations.getClassNames(),\n        hasItems(\n            \"com.github.tomakehurst.wiremock.standalone.CommandLineOptionsTest$RequestExt1\",\n            \"com.github.tomakehurst.wiremock.standalone.CommandLineOptionsTest$ResponseDefinitionTransformerExt1\"));\n  }\n\n  @Test\n  public void returnsEmptySetForNoExtensionsSpecifiedAsClassNames() {\n    CommandLineOptions options = new CommandLineOptions();\n    ExtensionDeclarations extensionDeclarations = options.getDeclaredExtensions();\n\n    assertThat(extensionDeclarations.getClassNames(), hasSize(0));\n  }\n\n  @Test\n  void extensionScanningIsEnabledByDefault() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.isExtensionScanningEnabled(), is(true));\n  }\n\n  @Test\n  void canDisableExtensionScanning() {\n    CommandLineOptions options = new CommandLineOptions(\"--disable-extensions-scanning\");\n    assertThat(options.isExtensionScanningEnabled(), is(false));\n  }\n\n  @Test\n  public void returnsAConsoleNotifyingListenerWhenOptionPresent() {\n    CommandLineOptions options = new CommandLineOptions(\"--print-all-network-traffic\");\n    assertThat(\n        options.networkTrafficListener(),\n        is(instanceOf(ConsoleNotifyingWiremockNetworkTrafficListener.class)));\n  }\n\n  @Test\n  public void enablesGlobalResponseTemplating() {\n    CommandLineOptions options = new CommandLineOptions(\"--global-response-templating\");\n    assertThat(options.getResponseTemplatingEnabled(), is(true));\n    assertThat(options.getResponseTemplatingGlobal(), is(true));\n  }\n\n  @Test\n  public void enablesLocalResponseTemplatingByDefault() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.getResponseTemplatingEnabled(), is(true));\n    assertThat(options.getResponseTemplatingGlobal(), is(false));\n  }\n\n  @Test\n  public void canDisableTemplating() {\n    CommandLineOptions options = new CommandLineOptions(\"--disable-response-templating\");\n    assertThat(options.getResponseTemplatingEnabled(), is(false));\n  }\n\n  @Test\n  public void configuresMaxTemplateCacheEntriesIfSpecified() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--global-response-templating\", \"--max-template-cache-entries\", \"5\");\n\n    assertThat(options.getResponseTemplatingGlobal(), is(true));\n    assertThat(options.getMaxTemplateCacheEntries(), is(5L));\n  }\n\n  @Test\n  public void maxTemplateCacheEntriesDefaultsWhenNotSpecified() {\n    CommandLineOptions options = new CommandLineOptions();\n\n    assertThat(options.getMaxTemplateCacheEntries(), is(DEFAULT_MAX_TEMPLATE_CACHE_ENTRIES));\n  }\n\n  @Test\n  public void supportsAdminApiBasicAuth() {\n    CommandLineOptions options = new CommandLineOptions(\"--admin-api-basic-auth\", \"user:pass\");\n    Authenticator authenticator = options.getAdminAuthenticator();\n\n    String correctAuthHeader = new BasicCredentials(\"user\", \"pass\").asAuthorizationHeaderValue();\n    String incorrectAuthHeader =\n        new BasicCredentials(\"user\", \"wrong_pass\").asAuthorizationHeaderValue();\n    assertThat(\n        authenticator.authenticate(mockRequest().header(\"Authorization\", correctAuthHeader)),\n        is(true));\n    assertThat(\n        authenticator.authenticate(mockRequest().header(\"Authorization\", incorrectAuthHeader)),\n        is(false));\n  }\n\n  @Test\n  public void canRequireHttpsForAdminApi() {\n    CommandLineOptions options = new CommandLineOptions(\"--admin-api-require-https\");\n    assertThat(options.getHttpsRequiredForAdminApi(), is(true));\n  }\n\n  @Test\n  public void defaultsToNotRequiringHttpsForAdminApi() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.getHttpsRequiredForAdminApi(), is(false));\n  }\n\n  @Test\n  public void enablesAsynchronousResponse() {\n    CommandLineOptions options = new CommandLineOptions(\"--async-response-enabled\", \"true\");\n    assertThat(options.getAsynchronousResponseSettings().isEnabled(), is(true));\n  }\n\n  @Test\n  public void disablesAsynchronousResponseByDefault() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.getAsynchronousResponseSettings().isEnabled(), is(false));\n  }\n\n  @Test\n  public void setsNumberOfAsynchronousResponseThreads() {\n    CommandLineOptions options = new CommandLineOptions(\"--async-response-threads\", \"20\");\n    assertThat(options.getAsynchronousResponseSettings().getThreads(), is(20));\n  }\n\n  @Test\n  public void setsChunkedEncodingPolicy() {\n    CommandLineOptions options = new CommandLineOptions(\"--use-chunked-encoding\", \"always\");\n    assertThat(options.getChunkedEncodingPolicy(), is(Options.ChunkedEncodingPolicy.ALWAYS));\n  }\n\n  @Test\n  public void setsDefaultNumberOfAsynchronousResponseThreads() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.getAsynchronousResponseSettings().getThreads(), is(10));\n  }\n\n  @Test\n  public void configuresPermittedSystemKeysIfSpecified() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--global-response-templating\", \"--permitted-system-keys\", \"java*,path*\");\n    assertThat(options.getTemplatePermittedSystemKeys(), hasItems(\"java*\", \"path*\"));\n  }\n\n  @Test\n  public void configureFileTemplatesWithRightFormat() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--filename-template={{{method}}}-{{{path}}}-{{{id}}}.json\");\n    assertNotNull(options.getFilenameMaker());\n  }\n\n  @Test\n  public void configureFileTemplatesWithWrongFormat() {\n    assertThrows(\n        Exception.class, () -> new CommandLineOptions(\"--filename-template={{method}}}.json\"));\n  }\n\n  @Test\n  public void returnsEmptyPermittedKeysIfNotSpecified() {\n    CommandLineOptions options = new CommandLineOptions(\"--global-response-templating\");\n    assertThat(options.getTemplatePermittedSystemKeys(), emptyCollectionOf(String.class));\n  }\n\n  @Test\n  public void disablesGzip() {\n    CommandLineOptions options = new CommandLineOptions(\"--disable-gzip\");\n    assertThat(options.getGzipDisabled(), is(true));\n  }\n\n  @Test\n  public void defaultsToGzipEnabled() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.getGzipDisabled(), is(false));\n  }\n\n  @Test\n  public void disablesRequestLogging() {\n    CommandLineOptions options = new CommandLineOptions(\"--disable-request-logging\");\n    assertThat(options.getStubRequestLoggingDisabled(), is(true));\n  }\n\n  @Test\n  public void defaultsToRequestLoggingEnabled() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.getStubRequestLoggingDisabled(), is(false));\n  }\n\n  @Test\n  public void printsTheActualPortOnlyWhenHttpsDisabled() {\n    CommandLineOptions options = new CommandLineOptions();\n    options.setActualHttpPort(5432);\n\n    String dump = options.toString();\n\n    assertThat(dump, matchesMultiLine(\".*port:.*5432.*\"));\n    assertThat(dump, not(containsString(\"https-port\")));\n  }\n\n  @Test\n  public void enablesStubCors() {\n    CommandLineOptions options = new CommandLineOptions(\"--enable-stub-cors\");\n    assertThat(options.getStubCorsEnabled(), is(true));\n  }\n\n  @Test\n  public void defaultsToNoStubCors() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertThat(options.getStubCorsEnabled(), is(false));\n  }\n\n  @Test\n  public void trustAllProxyTargets() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--enable-browser-proxying\", \"--trust-all-proxy-targets\");\n    assertThat(options.browserProxySettings().trustAllProxyTargets(), is(true));\n  }\n\n  @Test\n  public void defaultsToNotTrustingAllProxyTargets() {\n    CommandLineOptions options = new CommandLineOptions(\"--enable-browser-proxying\");\n    assertThat(options.browserProxySettings().trustAllProxyTargets(), is(false));\n  }\n\n  @Test\n  public void trustsOneProxyTarget1() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--enable-browser-proxying\", \"--trust-proxy-target\", \"localhost\");\n    assertThat(\n        options.browserProxySettings().trustedProxyTargets(), is(singletonList(\"localhost\")));\n  }\n\n  @Test\n  public void trustsManyProxyTargets() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--enable-browser-proxying\",\n            \"--trust-proxy-target=localhost\",\n            \"--trust-proxy-target\",\n            \"wiremock.org\",\n            \"--trust-proxy-target=www.google.com\");\n    assertThat(\n        options.browserProxySettings().trustedProxyTargets(),\n        is(asList(\"localhost\", \"wiremock.org\", \"www.google.com\")));\n  }\n\n  @Test\n  public void defaultsToNoTrustedProxyTargets() {\n    CommandLineOptions options = new CommandLineOptions(\"--enable-browser-proxying\");\n    assertThat(\n        options.browserProxySettings().trustedProxyTargets(), is(Collections.<String>emptyList()));\n  }\n\n  @Test\n  public void setsCaKeyStorePathAndPassword() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--enable-browser-proxying\",\n            \"--ca-keystore\",\n            \"/my/keystore\",\n            \"--ca-keystore-password\",\n            \"someotherpwd\",\n            \"--ca-keystore-type\",\n            \"pkcs12\");\n    KeyStoreSettings caKeyStore = options.browserProxySettings().caKeyStore();\n    assertThat(caKeyStore.path(), is(\"/my/keystore\"));\n    assertThat(caKeyStore.password(), is(\"someotherpwd\"));\n    assertThat(caKeyStore.type(), is(\"pkcs12\"));\n  }\n\n  @Test\n  public void defaultsCaKeyStorePathAndPassword() {\n    CommandLineOptions options = new CommandLineOptions(\"--enable-browser-proxying\");\n    KeyStoreSettings caKeyStore = options.browserProxySettings().caKeyStore();\n    assertThat(caKeyStore.path(), is(DEFAULT_CA_KEYSTORE_PATH));\n    assertThat(caKeyStore.password(), is(DEFAULT_CA_KESTORE_PASSWORD));\n    assertThat(caKeyStore.type(), is(\"jks\"));\n  }\n\n  @Test\n  public void printsBothActualPortsOnlyWhenHttpsEnabled() {\n    CommandLineOptions options = new CommandLineOptions();\n    options.setActualHttpPort(5432);\n    options.setActualHttpsPort(2345);\n\n    String dump = options.toString();\n\n    assertThat(dump, matchesMultiLine(\".*port:.*5432.*\"));\n    assertThat(dump, matchesMultiLine(\".*https-port:.*2345.*\"));\n  }\n\n  @Test\n  public void toStringWithTrustAllProxyTargetsWorks() {\n    String options =\n        new CommandLineOptions(\"--enable-browser-proxying\", \"--trust-all-proxy-targets\").toString();\n    assertThat(options, matchesMultiLine(\".*enable-browser-proxying: *true.*\"));\n    assertThat(options, matchesMultiLine(\".*trust-all-proxy-targets: *true.*\"));\n  }\n\n  @Test\n  public void toStringWithTrustProxyTarget() {\n    String options =\n        new CommandLineOptions(\n                \"--enable-browser-proxying\",\n                \"--trust-proxy-target\",\n                \"localhost\",\n                \"--trust-proxy-target\",\n                \"example.com\")\n            .toString();\n    assertThat(options, matchesMultiLine(\".*enable-browser-proxying: *true.*\"));\n    assertThat(options, matchesMultiLine(\".*trust-proxy-target: *localhost, example\\\\.com.*\"));\n  }\n\n  @Test\n  public void fileSourceDefaultsToSingleRootFileSource() {\n    CommandLineOptions options = new CommandLineOptions();\n\n    FileSource fileSource = options.filesRoot();\n\n    assertThat(fileSource, instanceOf(SingleRootFileSource.class));\n  }\n\n  @Test\n  public void mappingsSourceDefaultsToJsonFileMappingsSource() {\n    CommandLineOptions options = new CommandLineOptions();\n\n    MappingsSaver mappingsSaver = options.mappingsSaver();\n\n    assertThat(mappingsSaver, instanceOf(JsonFileMappingsSource.class));\n  }\n\n  @Test\n  public void loadResourcesFromClasspathSetsFileSourceToUseClasspath() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--load-resources-from-classpath=classpath-filesource\");\n\n    FileSource fileSource = options.filesRoot();\n\n    assertThat(fileSource, instanceOf(ClasspathFileSource.class));\n    assertThat(\n        fileSource.getTextFileNamed(\"__files/stuff.txt\").readContentsAsString(),\n        equalTo(\"THINGS!\"));\n  }\n\n  @Test\n  public void loadResourcesFromClasspathSetsMappingsSourceToUseClasspath() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--load-resources-from-classpath=wiremock-stuff\");\n\n    MappingsSaver mappingsSaver = options.mappingsSaver();\n\n    assertThat(mappingsSaver, instanceOf(JsonFileMappingsSource.class));\n  }\n\n  @Test\n  void loggedResponseBodySizeLimit() {\n    CommandLineOptions options = new CommandLineOptions(\"--logged-response-body-size-limit\", \"18\");\n\n    Limit limit = options.getDataTruncationSettings().getMaxResponseBodySize();\n\n    assertThat(limit.isExceededBy(18), is(false));\n    assertThat(limit.isExceededBy(19), is(true));\n  }\n\n  @Test\n  void defaultLoggedResponseBodySizeLimit() {\n    CommandLineOptions options = new CommandLineOptions();\n\n    Limit limit = options.getDataTruncationSettings().getMaxResponseBodySize();\n\n    assertThat(limit.isExceededBy(Integer.MAX_VALUE), is(false));\n  }\n\n  @Test\n  void proxyTargetRules() {\n    CommandLineOptions options =\n        new CommandLineOptions(\n            \"--allow-proxy-targets\", \"192.168.1.1,10.1.1.1-10.2.2.2\",\n            \"--deny-proxy-targets\", \"192.168.56.1,*host\");\n\n    NetworkAddressRules proxyTargetRules = options.getProxyTargetRules();\n\n    assertThat(proxyTargetRules.isAllowed(\"192.168.1.1\"), is(true));\n    assertThat(proxyTargetRules.isAllowed(\"10.1.2.3\"), is(true));\n\n    assertThat(proxyTargetRules.isAllowed(\"10.3.2.1\"), is(false));\n    assertThat(proxyTargetRules.isAllowed(\"localhost\"), is(false));\n  }\n\n  @Test\n  void proxyTimeout() {\n    CommandLineOptions options = new CommandLineOptions(\"--proxy-timeout\", \"5000\");\n\n    int proxyTimeout = options.proxyTimeout();\n\n    assertThat(proxyTimeout, is(5000));\n  }\n\n  @Test\n  void defaultProxyTimeout() {\n    CommandLineOptions options = new CommandLineOptions();\n\n    int proxyTimeout = options.proxyTimeout();\n\n    assertThat(proxyTimeout, is(Options.DEFAULT_TIMEOUT));\n  }\n\n  @Test\n  void webSocketIdleTimeout() {\n    CommandLineOptions options = new CommandLineOptions(\"--websocket-idle-timeout\", \"60000\");\n\n    long webSocketIdleTimeout = options.getWebSocketIdleTimeout();\n\n    assertThat(webSocketIdleTimeout, is(60000L));\n  }\n\n  @Test\n  void defaultWebSocketIdleTimeout() {\n    CommandLineOptions options = new CommandLineOptions();\n\n    long webSocketIdleTimeout = options.getWebSocketIdleTimeout();\n\n    assertThat(webSocketIdleTimeout, is(Options.DEFAULT_WEBSOCKET_IDLE_TIMEOUT));\n  }\n\n  @Test\n  void webSocketMaxTextMessageSize() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--websocket-max-text-message-size\", \"131072\");\n\n    long maxTextMessageSize = options.getWebSocketMaxTextMessageSize();\n\n    assertThat(maxTextMessageSize, is(131072L));\n  }\n\n  @Test\n  void defaultWebSocketMaxTextMessageSize() {\n    CommandLineOptions options = new CommandLineOptions();\n\n    long maxTextMessageSize = options.getWebSocketMaxTextMessageSize();\n\n    assertThat(maxTextMessageSize, is(Options.DEFAULT_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE));\n  }\n\n  @Test\n  void webSocketMaxBinaryMessageSize() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--websocket-max-binary-message-size\", \"262144\");\n\n    long maxBinaryMessageSize = options.getWebSocketMaxBinaryMessageSize();\n\n    assertThat(maxBinaryMessageSize, is(262144L));\n  }\n\n  @Test\n  void defaultWebSocketMaxBinaryMessageSize() {\n    CommandLineOptions options = new CommandLineOptions();\n\n    long maxBinaryMessageSize = options.getWebSocketMaxBinaryMessageSize();\n\n    assertThat(maxBinaryMessageSize, is(Options.DEFAULT_WEBSOCKET_MAX_BINARY_MESSAGE_SIZE));\n  }\n\n  @Test\n  void testProxyPassThroughOptionPassedAsFalse() {\n    CommandLineOptions options = new CommandLineOptions(\"--proxy-pass-through\", \"false\");\n    assertFalse(options.getStores().getSettingsStore().get().getProxyPassThrough());\n  }\n\n  @Test\n  void testProxyPassThroughOptionPassedAsTrue() {\n    CommandLineOptions options = new CommandLineOptions(\"--proxy-pass-through\", \"true\");\n    assertTrue(options.getStores().getSettingsStore().get().getProxyPassThrough());\n  }\n\n  @Test\n  void testProxyPassThroughOptionDefaultToTrue() {\n    CommandLineOptions options = new CommandLineOptions();\n    assertTrue(options.getStores().getSettingsStore().get().getProxyPassThrough());\n  }\n\n  @Test\n  void configuresProxyEncodings() {\n    CommandLineOptions options =\n        new CommandLineOptions(\"--supported-proxy-encodings\", \"gzip,deflate\");\n\n    Set<String> supportedProxyEncodings = options.getSupportedProxyEncodings();\n\n    assertThat(supportedProxyEncodings.size(), is(2));\n    assertThat(supportedProxyEncodings, hasItems(\"gzip\", \"deflate\"));\n  }\n\n  @Test\n  void testMaxHttpClientConnectionsOption() {\n    CommandLineOptions options = new CommandLineOptions(\"--max-http-client-connections\", \"5000\");\n\n    assertThat(options.getMaxHttpClientConnections(), is(5000));\n  }\n\n  @Test\n  void testDisableConnectionReuseOptionPassedAsFalse() {\n    CommandLineOptions options = new CommandLineOptions(\"--disable-connection-reuse\", \"false\");\n    assertFalse(options.getDisableConnectionReuse());\n  }\n\n  @Test\n  void testDisableConnectionReuseOptionPassedAsTrue() {\n    CommandLineOptions options = new CommandLineOptions(\"--disable-connection-reuse\", \"true\");\n    assertTrue(options.getDisableConnectionReuse());\n  }\n\n  @Test\n  public void configuresWebhookThreadPoolSizeIfSpecified() {\n    CommandLineOptions options = new CommandLineOptions(\"--webhook-threadpool-size\", \"5\");\n\n    assertThat(options.getWebhookThreadPoolSize(), is(5));\n  }\n\n  @Test\n  public void configuresWebhookThreadPoolSizeSetToDefaultIfNotSpecified() {\n    CommandLineOptions options = new CommandLineOptions();\n\n    assertThat(options.getWebhookThreadPoolSize(), is(DEFAULT_WEBHOOK_THREADPOOL_SIZE));\n  }\n\n  public static class ResponseDefinitionTransformerExt1 extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return null;\n    }\n\n    @Override\n    public String getName() {\n      return \"ResponseDefinitionTransformer_One\";\n    }\n  }\n\n  public static class ResponseDefinitionTransformerExt2 extends ResponseDefinitionTransformer {\n\n    @Override\n    public ResponseDefinition transform(\n        Request request,\n        ResponseDefinition responseDefinition,\n        FileSource files,\n        Parameters parameters) {\n      return null;\n    }\n\n    @Override\n    public String getName() {\n      return \"ResponseDefinitionTransformer_Two\";\n    }\n  }\n\n  public static class RequestExt1 extends RequestMatcherExtension {\n\n    @Override\n    public MatchResult match(Request request, Parameters parameters) {\n      return MatchResult.noMatch();\n    }\n\n    @Override\n    public String getName() {\n      return \"RequestMatcherExtension_One\";\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSourceTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.created;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.noContent;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.post;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.filePath;\nimport static java.util.Arrays.asList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.github.tomakehurst.wiremock.common.ClasspathFileSource;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.NotWritableException;\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.stubbing.InMemoryStubMappings;\nimport com.github.tomakehurst.wiremock.stubbing.StoreBackedStubMappings;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\nimport java.nio.file.StandardCopyOption;\nimport java.util.*;\nimport org.hamcrest.Matchers;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.io.TempDir;\n\nclass JsonFileMappingsSourceTest {\n\n  @TempDir public File tempDir;\n\n  StoreBackedStubMappings stubMappings;\n  JsonFileMappingsSource source;\n  File stubMappingFile;\n\n  @BeforeEach\n  public void init() throws Exception {\n    stubMappings = new InMemoryStubMappings();\n  }\n\n  private void configureWithMultipleMappingFile() throws Exception {\n    stubMappingFile = File.createTempFile(\"multi\", \".json\", tempDir);\n    Files.copy(\n        Paths.get(filePath(\"multi-stub/multi.json\")),\n        stubMappingFile.toPath(),\n        StandardCopyOption.REPLACE_EXISTING);\n    load();\n  }\n\n  private void configureWithSingleMappingFile() throws Exception {\n    stubMappingFile = File.createTempFile(\"single\", \".json\", tempDir);\n    Files.copy(\n        Paths.get(filePath(\"multi-stub/single.json\")),\n        stubMappingFile.toPath(),\n        StandardCopyOption.REPLACE_EXISTING);\n    load();\n  }\n\n  private void load() {\n    source = new JsonFileMappingsSource(new SingleRootFileSource(tempDir), new FilenameMaker());\n    source.loadMappingsInto(stubMappings);\n  }\n\n  @Test\n  void loadsMappingsViaClasspathFileSource() {\n    ClasspathFileSource fileSource = new ClasspathFileSource(\"jar-filesource\");\n    JsonFileMappingsSource source = new JsonFileMappingsSource(fileSource, new FilenameMaker());\n    StoreBackedStubMappings stubMappings = new InMemoryStubMappings();\n\n    source.loadMappingsInto(stubMappings);\n\n    List<StubMapping> allMappings = stubMappings.getAll();\n    assertThat(allMappings, hasSize(2));\n\n    List<String> mappingRequestUrls =\n        asList(allMappings.get(0).getRequest().getUrl(), allMappings.get(1).getRequest().getUrl());\n    assertThat(mappingRequestUrls, is(asList(\"/second_test\", \"/test\")));\n  }\n\n  @Test\n  void stubMappingFilesAreWrittenWithInsertionIndex() throws Exception {\n    JsonFileMappingsSource source =\n        new JsonFileMappingsSource(new SingleRootFileSource(tempDir), new FilenameMaker());\n\n    StubMapping stub = get(\"/saveable\").willReturn(ok()).build();\n    source.save(stub);\n\n    File savedFile = Objects.requireNonNull(tempDir.listFiles())[0];\n    String savedStub = Files.readString(savedFile.toPath());\n\n    assertThat(savedStub, containsString(\"\\\"insertionIndex\\\" : 0\"));\n  }\n\n  @Test\n  void stubMappingFilesWithOwnFileTemplateFormat() {\n    JsonFileMappingsSource source =\n        new JsonFileMappingsSource(\n            new SingleRootFileSource(tempDir),\n            new FilenameMaker(\"{{{request.method}}}-{{{request.url}}}.json\"));\n\n    StubMapping stub = get(\"/saveable\").willReturn(ok()).build();\n    source.save(stub);\n\n    File savedFile = Objects.requireNonNull(tempDir.listFiles())[0];\n\n    assertEquals(\"get-saveable.json\", savedFile.getName());\n  }\n\n  @Test\n  void refusesToRemoveStubMappingContainedInMultiFile() throws Exception {\n    configureWithMultipleMappingFile();\n\n    StubMapping firstStub = stubMappings.getAll().get(0);\n\n    try {\n      source.remove(firstStub.getId());\n      fail(\"Expected an exception to be thrown\");\n    } catch (Exception e) {\n      assertThat(e, Matchers.instanceOf(NotWritableException.class));\n      assertThat(\n          e.getMessage(),\n          is(\n              \"Stubs loaded from multi-mapping files are read-only, and therefore cannot be removed\"));\n    }\n\n    assertThat(stubMappingFile.exists(), is(true));\n  }\n\n  @Test\n  void refusesToRemoveAllWhenMultiMappingFilesArePresent() throws Exception {\n    configureWithMultipleMappingFile();\n\n    try {\n      source.removeAll();\n      fail(\"Expected an exception to be thrown\");\n    } catch (Exception e) {\n      assertThat(e, Matchers.instanceOf(NotWritableException.class));\n      assertThat(\n          e.getMessage(),\n          is(\n              \"Some stubs were loaded from multi-mapping files which are read-only, so remove all cannot be performed\"));\n    }\n\n    assertThat(stubMappingFile.exists(), is(true));\n  }\n\n  @Test\n  void refusesToSaveStubMappingOriginallyLoadedFromMultiMappingFile() throws Exception {\n    configureWithMultipleMappingFile();\n\n    StubMapping firstStub = stubMappings.getAll().get(0);\n\n    try {\n      source.save(firstStub);\n      fail(\"Expected an exception to be thrown\");\n    } catch (Exception e) {\n      assertThat(e, Matchers.instanceOf(NotWritableException.class));\n      assertThat(\n          e.getMessage(),\n          is(\"Stubs loaded from multi-mapping files are read-only, and therefore cannot be saved\"));\n    }\n\n    assertThat(stubMappingFile.exists(), is(true));\n  }\n\n  @Test\n  void savesStubMappingOriginallyLoadedFromSingleMappingFile() throws Exception {\n    configureWithSingleMappingFile();\n\n    StubMapping firstStub = stubMappings.getAll().get(0).transform(b -> b.setName(\"New name\"));\n    source.save(firstStub);\n\n    assertThat(Files.readString(stubMappingFile.toPath()), containsString(\"New name\"));\n  }\n\n  @Test\n  void removesStubMappingOriginallyLoadedFromSingleMappingFile() throws Exception {\n    configureWithSingleMappingFile();\n\n    StubMapping firstStub = stubMappings.getAll().get(0);\n    source.remove(firstStub.getId());\n\n    assertThat(stubMappingFile.exists(), is(false));\n  }\n\n  @Test\n  void canSetAllStubFilesInSource() throws IOException {\n    StubMapping existingStub1 = get(\"/thing/1\").withName(\"thing1\").willReturn(ok()).build();\n    File existingStub1File = new File(tempDir, \"thing1-\" + existingStub1.getId() + \".json\");\n    Files.writeString(existingStub1File.toPath(), Json.writePrivate(existingStub1));\n\n    StubMapping existingStub2 = get(\"/thing/1\").withName(\"thing1\").willReturn(noContent()).build();\n    File existingStub2File = new File(tempDir, \"thing1-\" + existingStub2.getId() + \".json\");\n    Files.writeString(existingStub2File.toPath(), Json.writePrivate(existingStub2));\n\n    File existingStub3File = File.createTempFile(\"single3\", \".json\", tempDir);\n    Files.writeString(existingStub3File.toPath(), \"{}\");\n\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(tempDir.listFiles())).toList(),\n        containsInAnyOrder(existingStub1File, existingStub2File, existingStub3File));\n\n    load();\n\n    StubMapping newStub1 =\n        post(\"/create\")\n            .withName(\"thing1\")\n            .withId(existingStub2.getId())\n            .willReturn(created())\n            .build();\n    StubMapping newStub2 = get(\"/thing/2\").withName(\"thing2\").willReturn(created()).build();\n    source.setAll(List.of(newStub1, newStub2));\n\n    File newStub2File = new File(tempDir, \"thing2-\" + newStub2.getId() + \".json\");\n    assertThat(\n        Arrays.stream(Objects.requireNonNull(tempDir.listFiles())).toList(),\n        containsInAnyOrder(existingStub2File, newStub2File));\n    assertThat(Files.readString(existingStub2File.toPath()), is(Json.writePrivate(newStub1)));\n    assertThat(Files.readString(newStub2File.toPath()), is(Json.writePrivate(newStub2)));\n  }\n\n  @Test\n  void ignoresUuidFieldOnSingleStubJsonFiles() throws Exception {\n    stubMappingFile = File.createTempFile(\"with-uuid\", \".json\", tempDir);\n    String json =\n        // language=json\n        \"\"\"\n            {\n              \"id\": \"edf19376-0e08-4b27-8632-fb7852c9e62d\",\n              \"request\": {\n                \"url\": \"/\",\n                \"method\": \"GET\"\n              },\n\n              \"response\": {\n                \"status\": 200\n              },\n\n              \"uuid\": \"07150a3a-47ea-4182-9792-c49eb77b862e\"\n            }\n            \"\"\";\n\n    Files.write(stubMappingFile.toPath(), json.getBytes());\n\n    assertDoesNotThrow(this::load);\n\n    Optional<StubMapping> maybeStub =\n        stubMappings.get(UUID.fromString(\"edf19376-0e08-4b27-8632-fb7852c9e62d\"));\n    assertTrue(maybeStub.isPresent());\n    assertThat(maybeStub.get().getId().toString(), is(\"edf19376-0e08-4b27-8632-fb7852c9e62d\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/standalone/ProxySettingsTest.java",
    "content": "/*\n * Copyright (C) 2013-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.common.ProxySettings;\nimport org.junit.jupiter.api.Test;\n\npublic class ProxySettingsTest {\n\n  @Test\n  public void throwsExceptionWhenHostPartNotSpecified() {\n    assertThrows(IllegalArgumentException.class, () -> ProxySettings.fromString(\":8090\"));\n  }\n\n  @Test\n  public void defaultsToPort80() {\n    assertThat(ProxySettings.fromString(\"myhost.com\").port(), is(80));\n  }\n\n  @Test\n  public void parsesHostAndPortCorrectly() {\n    ProxySettings settings = ProxySettings.fromString(\"some.host.org:8888\");\n    assertThat(settings.host(), is(\"some.host.org\"));\n    assertThat(settings.port(), is(8888));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/store/InMemoryObjectStoreTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport static java.util.stream.Collectors.toList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.concurrent.atomic.AtomicReference;\nimport org.junit.jupiter.api.Test;\n\npublic class InMemoryObjectStoreTest {\n\n  @Test\n  void respectsSpecifiedLimitWhenPutting() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    store.put(\"one\", \"1\");\n    store.put(\"two\", \"2\");\n    store.put(\"three\", \"3\");\n\n    assertThat(store.getAllKeys().count(), is(3L));\n\n    store.put(\"four\", \"4\");\n    assertThat(store.getAllKeys().count(), is(3L));\n    assertThat(store.getAllKeys().collect(toList()), hasItems(\"two\", \"three\", \"four\"));\n  }\n\n  @Test\n  void respectsSpecifiedLimitWhenComputing() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    store.put(\"one\", \"1\");\n    store.put(\"two\", \"2\");\n    store.put(\"three\", \"3\");\n\n    assertThat(store.getAllKeys().count(), is(3L));\n\n    store.compute(\"four\", current -> \"4\");\n\n    assertThat(store.getAllKeys().count(), is(3L));\n    assertThat(store.getAllKeys().collect(toList()), hasItems(\"two\", \"three\", \"four\"));\n  }\n\n  @Test\n  void removesLeastRecentlyAccessedWhenPuttingInExcessOfLimit() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    store.put(\"one\", \"1\");\n    store.put(\"two\", \"2\");\n    store.put(\"three\", \"3\");\n\n    store.get(\"one\");\n\n    store.put(\"four\", \"4\");\n    assertThat(store.getAllKeys().count(), is(3L));\n    assertThat(store.getAllKeys().collect(toList()), hasItems(\"one\", \"three\", \"four\"));\n  }\n\n  @Test\n  void sizeLimitRemainsConsistentWhenItemRemoved() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    store.put(\"one\", \"1\");\n    store.put(\"two\", \"2\");\n    store.put(\"three\", \"3\");\n    store.remove(\"two\");\n\n    assertThat(store.getAllKeys().count(), is(2L));\n\n    store.put(\"four\", \"4\");\n    assertThat(store.getAllKeys().count(), is(3L));\n    store.put(\"five\", \"5\");\n    assertThat(store.getAllKeys().count(), is(3L));\n    assertThat(store.getAllKeys().collect(toList()), hasItems(\"three\", \"four\", \"five\"));\n  }\n\n  @Test\n  void clearRemovesAllItems() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    store.put(\"one\", \"1\");\n    store.put(\"two\", \"2\");\n    store.put(\"three\", \"3\");\n\n    store.clear();\n\n    assertThat(store.getAllKeys().count(), is(0L));\n  }\n\n  @Test\n  void tryingToRetrieveMissingKeyDoesNotEjectOtherKeys() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    store.put(\"one\", \"1\");\n    store.put(\"two\", \"2\");\n    store.put(\"three\", \"3\");\n\n    assertThat(store.getAllKeys().count(), is(3L));\n\n    store.get(\"four\");\n\n    assertThat(store.getAllKeys().count(), is(3L));\n  }\n\n  @Test\n  void computingNullValueIsEquivalentToRemoval() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    store.put(\"one\", \"1\");\n    store.put(\"two\", \"2\");\n    store.put(\"three\", \"3\");\n\n    store.compute(\"three\", current -> null);\n\n    assertThat(store.get(\"three\"), is(Optional.empty()));\n    assertThat(store.getAllKeys().collect(toList()), containsInAnyOrder(\"one\", \"two\"));\n\n    store.put(\"four\", \"4\");\n\n    assertThat(store.getAllKeys().collect(toList()), containsInAnyOrder(\"one\", \"two\", \"four\"));\n\n    AtomicReference<Object> previousValue = new AtomicReference<>(\"\");\n    store.compute(\"three\", previousValue::getAndSet);\n    assertThat(previousValue.get(), is(nullValue()));\n  }\n\n  @Test\n  void eventEmittedOnPut() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    List<StoreEvent<String, Object>> events1 = new ArrayList<>();\n    store.registerEventListener(events1::add);\n    assertThat(events1, is(empty()));\n\n    store.put(\"one\", \"1\");\n\n    assertThat(events1, containsInAnyOrder(new StoreEvent<>(\"one\", null, \"1\")));\n\n    List<StoreEvent<String, Object>> events2 = new ArrayList<>();\n    store.registerEventListener(events2::add);\n    assertThat(events2, is(empty()));\n    events1.clear();\n\n    store.put(\"two\", \"2\");\n\n    assertThat(events1, containsInAnyOrder(new StoreEvent<>(\"two\", null, \"2\")));\n    assertThat(events2, containsInAnyOrder(new StoreEvent<>(\"two\", null, \"2\")));\n\n    events1.clear();\n    events2.clear();\n    store.put(\"one\", \"3\");\n\n    assertThat(events1, containsInAnyOrder(new StoreEvent<>(\"one\", \"1\", \"3\")));\n    assertThat(events2, containsInAnyOrder(new StoreEvent<>(\"one\", \"1\", \"3\")));\n  }\n\n  @Test\n  void eventEmittedOnRemoval() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    store.put(\"one\", \"1\");\n    store.put(\"two\", \"2\");\n    store.put(\"three\", \"3\");\n\n    List<StoreEvent<String, Object>> events1 = new ArrayList<>();\n    store.registerEventListener(events1::add);\n    assertThat(events1, is(empty()));\n\n    store.remove(\"two\");\n\n    assertThat(events1, containsInAnyOrder(new StoreEvent<>(\"two\", \"2\", null)));\n\n    List<StoreEvent<String, Object>> events2 = new ArrayList<>();\n    store.registerEventListener(events2::add);\n    events1.clear();\n\n    store.remove(\"three\");\n\n    assertThat(events1, containsInAnyOrder(new StoreEvent<>(\"three\", \"3\", null)));\n    assertThat(events2, containsInAnyOrder(new StoreEvent<>(\"three\", \"3\", null)));\n\n    events1.clear();\n    events2.clear();\n    // No event is emitted when nothing is removed.\n    store.remove(\"does not exist\");\n\n    assertThat(events1, is(empty()));\n    assertThat(events2, is(empty()));\n  }\n\n  @Test\n  void eventEmittedOnCompute() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    List<StoreEvent<String, Object>> events = new ArrayList<>();\n    store.registerEventListener(events::add);\n\n    store.compute(\"one\", o -> \"1\");\n\n    assertThat(events, containsInAnyOrder(new StoreEvent<>(\"one\", null, \"1\")));\n\n    events.clear();\n    store.compute(\"two\", o -> \"2\");\n\n    assertThat(events, containsInAnyOrder(new StoreEvent<>(\"two\", null, \"2\")));\n\n    events.clear();\n    store.compute(\"one\", o -> \"3\");\n\n    assertThat(events, containsInAnyOrder(new StoreEvent<>(\"one\", \"1\", \"3\")));\n  }\n\n  @Test\n  void eventEmittedOnRemovalByMaxItemLimit() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    store.put(\"one\", \"1\");\n    store.put(\"two\", \"2\");\n    store.put(\"three\", \"3\");\n\n    List<StoreEvent<String, Object>> events = new ArrayList<>();\n    store.registerEventListener(events::add);\n\n    store.put(\"four\", \"4\");\n\n    assertThat(\n        events,\n        containsInAnyOrder(\n            new StoreEvent<>(\"four\", null, \"4\"), new StoreEvent<>(\"one\", \"1\", null)));\n\n    events.clear();\n    store.compute(\"five\", o -> \"5\");\n\n    assertThat(\n        events,\n        containsInAnyOrder(\n            new StoreEvent<>(\"five\", null, \"5\"), new StoreEvent<>(\"two\", \"2\", null)));\n  }\n\n  @Test\n  void exceptionsThrownInAnEventHandlerAreCaught() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    List<StoreEvent<String, Object>> events1 = new ArrayList<>();\n    store.registerEventListener(events1::add);\n    store.registerEventListener(\n        event -> {\n          throw new RuntimeException();\n        });\n    List<StoreEvent<String, Object>> events2 = new ArrayList<>();\n    store.registerEventListener(events2::add);\n\n    store.put(\"one\", \"1\");\n\n    assertThat(events1, containsInAnyOrder(new StoreEvent<>(\"one\", null, \"1\")));\n    assertThat(events2, containsInAnyOrder(new StoreEvent<>(\"one\", null, \"1\")));\n  }\n\n  @Test\n  void eventsCanBeEmittedToAMoreGeneralEventListener() {\n    InMemoryObjectStore store = new InMemoryObjectStore(3);\n\n    List<StoreEvent<?, ?>> events1 = new ArrayList<>();\n\n    // Do not remove the event type, it then compiles without the fix\n    store.registerEventListener((StoreEvent<?, ?> e) -> events1.add(e));\n    store.put(\"1\", 1);\n\n    assertThat(events1, contains(new StoreEvent<>(\"1\", null, 1)));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/store/NonPathBasedBlobStoreTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.common.InputStreamSource;\nimport com.github.tomakehurst.wiremock.common.StreamSources;\nimport com.github.tomakehurst.wiremock.store.files.BlobStoreFileSource;\nimport java.io.InputStream;\nimport java.util.Optional;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.Test;\n\nclass NonPathBasedBlobStoreTest {\n\n  @Test\n  void canUseANonPathBasedBlobStoreTest() {\n    WireMockServer wireMockServer =\n        new WireMockServer(\n            wireMockConfig()\n                .dynamicPort()\n                .fileSource(new BlobStoreFileSource(new NonPathBasedBlobStore())));\n    try {\n      wireMockServer.start();\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n\n  static class NonPathBasedBlobStore implements BlobStore {\n    @Override\n    public Optional<InputStream> getStream(String key) {\n      return Optional.empty();\n    }\n\n    @Override\n    public InputStreamSource getStreamSource(String key) {\n      return StreamSources.empty();\n    }\n\n    @Override\n    public Stream<String> getAllKeys() {\n      return Stream.empty();\n    }\n\n    @Override\n    public Optional<byte[]> get(String key) {\n      return Optional.empty();\n    }\n\n    @Override\n    public void put(String key, byte[] content) {}\n\n    @Override\n    public void remove(String key) {}\n\n    @Override\n    public void clear() {}\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/store/files/BlobStoreFileSourceTest.java",
    "content": "/*\n * Copyright (C) 2022-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store.files;\n\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.filePath;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.InputStreamSource;\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport java.io.InputStream;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.io.TempDir;\n\npublic class BlobStoreFileSourceTest {\n\n  static final String ROOT_PATH = filePath(\"filesource\");\n\n  BlobStoreFileSource fileSource;\n\n  @BeforeEach\n  void setup() {\n    BlobStore blobStore = new FileSourceBlobStore(ROOT_PATH);\n    fileSource = new BlobStoreFileSource(blobStore);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Test\n  void list_all_files_returns_paths_relative_to_root_of_file_source() {\n    List<TextFile> files = fileSource.listFilesRecursively();\n\n    assertThat(\n        files,\n        hasExactlyIgnoringOrder(\n            fileWithPath(\"one\"),\n            fileWithPath(\"two\"),\n            fileWithPath(\"three\"),\n            fileWithPath(\"subdir/four\"),\n            fileWithPath(\"subdir/five\"),\n            fileWithPath(\"anothersubdir/six\"),\n            fileWithPath(\"subdir/subsubdir/seven\"),\n            fileWithPath(\"subdir/subsubdir/eight\"),\n            fileWithPath(\"subdir/deepfile.json\")));\n  }\n\n  @Test\n  void get_single_file_bytes() {\n    byte[] expected = \"{}\".getBytes();\n    assertThat(fileSource.getBinaryFileNamed(\"subdir/deepfile.json\").readContents(), is(expected));\n  }\n\n  @Test\n  void get_single_stream() throws Exception {\n    byte[] expected = \"{}\".getBytes();\n    byte[] actual =\n        fileSource.getBinaryFileNamed(\"subdir/deepfile.json\").getStream().readAllBytes();\n    assertThat(actual, is(expected));\n  }\n\n  @Test\n  void write_binary_file(@TempDir Path tempDir) throws Exception {\n    BlobStore blobStore = new FileSourceBlobStore(tempDir.toString());\n    fileSource = new BlobStoreFileSource(blobStore);\n\n    byte[] contents = \"{}\".getBytes();\n    fileSource.writeBinaryFile(\"folder/file.json\", contents);\n\n    byte[] actual = Files.readAllBytes(tempDir.resolve(\"folder/file.json\"));\n    assertThat(actual, is(contents));\n  }\n\n  @Test\n  void write_text_file(@TempDir Path tempDir) throws Exception {\n    BlobStore blobStore = new FileSourceBlobStore(tempDir.toString());\n    fileSource = new BlobStoreFileSource(blobStore);\n\n    String contents = \"{}\";\n    fileSource.writeTextFile(\"folder/text-file.json\", contents);\n\n    String actual = new String(Files.readAllBytes(tempDir.resolve(\"folder/text-file.json\")));\n    assertThat(actual, is(contents));\n  }\n\n  @Test\n  void delete_file(@TempDir Path tempDir) {\n    BlobStore blobStore = new FileSourceBlobStore(tempDir.toString());\n    fileSource = new BlobStoreFileSource(blobStore);\n\n    String filePath = \"folder/tmp-file.json\";\n    fileSource.writeTextFile(filePath, \"{}\");\n    assertThat(tempDir.resolve(filePath).toFile().exists(), is(true));\n\n    fileSource.deleteFile(filePath);\n    assertThat(tempDir.resolve(filePath).toFile().exists(), is(false));\n  }\n\n  @Test\n  void delete_all_files(@TempDir Path tempDir) {\n    BlobStore blobStore = new FileSourceBlobStore(tempDir.toString());\n    fileSource = new BlobStoreFileSource(blobStore);\n\n    String filePath1 = \"folder/tmp-file.json\";\n    String filePath2 = \"root-tmp-file.json\";\n    fileSource.writeTextFile(filePath1, \"{}\");\n    fileSource.writeTextFile(filePath2, \"{}\");\n\n    assertThat(tempDir.resolve(filePath1).toFile().exists(), is(true));\n    assertThat(tempDir.resolve(filePath2).toFile().exists(), is(true));\n\n    blobStore.clear();\n    assertThat(tempDir.resolve(filePath1).toFile().exists(), is(false));\n    assertThat(tempDir.resolve(filePath2).toFile().exists(), is(false));\n  }\n\n  @Test\n  void returns_file_path_when_backed_by_file_source() {\n    assertThat(fileSource.getPath(), is(ROOT_PATH));\n  }\n\n  @Test\n  void returns_empty_string_when_not_backed_by_file_source() {\n    FileSource otherFileSource = new BlobStoreFileSource(new TestInMemoryBlobStore());\n    assertThat(otherFileSource.getPath(), is(\"\"));\n  }\n\n  static class TestInMemoryBlobStore implements BlobStore {\n\n    @Override\n    public Optional<InputStream> getStream(String key) {\n      return Optional.empty();\n    }\n\n    @Override\n    public InputStreamSource getStreamSource(String key) {\n      return null;\n    }\n\n    @Override\n    public Stream<String> getAllKeys() {\n      return null;\n    }\n\n    @Override\n    public Optional<byte[]> get(String key) {\n      return Optional.empty();\n    }\n\n    @Override\n    public void put(String key, byte[] content) {}\n\n    @Override\n    public void remove(String key) {}\n\n    @Override\n    public void clear() {}\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/store/files/FileSourceBlobStoreTest.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store.files;\n\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport java.io.InputStream;\nimport java.util.Optional;\nimport org.junit.jupiter.api.Test;\n\nclass FileSourceBlobStoreTest {\n  private static final String DIRECTORY_PATH =\n      \"src/test/java/com/github/tomakehurst/wiremock/store/files/test/empty\";\n\n  @Test\n  public void createFileSourceBlobStoreWithEmptyDirectory_get() {\n    FileSourceBlobStore fileSourceBlobStore = new FileSourceBlobStore(DIRECTORY_PATH);\n\n    assertDoesNotThrow(\n        () -> {\n          Optional<byte[]> result = fileSourceBlobStore.get(\"any-key\");\n          assertEquals(Optional.empty(), result);\n        });\n  }\n\n  @Test\n  public void createFileSourceBlobStoreWithEmptyDirectory_getStream() {\n    FileSourceBlobStore fileSourceBlobStore = new FileSourceBlobStore(DIRECTORY_PATH);\n\n    assertDoesNotThrow(\n        () -> {\n          Optional<InputStream> result = fileSourceBlobStore.getStream(\"any-key\");\n          assertEquals(Optional.empty(), result);\n        });\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/store/files/FileSourceJsonObjectStoreTest.java",
    "content": "/*\n * Copyright (C) 2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store.files;\n\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.matching.EqualToPattern;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.io.TempDir;\n\npublic class FileSourceJsonObjectStoreTest {\n\n  @TempDir Path storeDir;\n\n  FileSourceJsonObjectStore store;\n\n  @BeforeEach\n  void init() {\n    store = new FileSourceJsonObjectStore(storeDir.toFile().getAbsolutePath());\n  }\n\n  @Test\n  void writeString() throws Exception {\n    store.put(\"the_key\", \"Store this\");\n\n    Path filePath = storeDir.resolve(\"the_key.json\");\n    assertThat(Files.exists(filePath), is(true));\n    assertThat(Files.readString(filePath), jsonEquals(\"\\\"Store this\\\"\"));\n  }\n\n  @Test\n  void writeObject() throws Exception {\n    EqualToPattern equalToPattern =\n        new EqualToPattern(\"correct\", false); // No significance, just using this as an example\n    store.put(\"the_key\", equalToPattern);\n\n    Path filePath = storeDir.resolve(\"the_key.json\");\n    assertThat(\n        Files.readString(filePath),\n        jsonEquals(\n            \"{\\n\" + \"  \\\"equalTo\\\": \\\"correct\\\",\\n\" + \"  \\\"caseInsensitive\\\": false\\n\" + \"}\"));\n  }\n\n  @Test\n  void readString() throws Exception {\n    Path filePath = storeDir.resolve(\"the_key.json\");\n    Files.write(filePath, \"\\\"this text\\\"\".getBytes());\n\n    store\n        .get(\"the_key\")\n        .ifPresentOrElse(\n            value -> {\n              assertThat(value, instanceOf(String.class));\n              assertThat(value, is(\"this text\"));\n            },\n            Assertions::fail);\n  }\n\n  @Test\n  void readObject() throws Exception {\n    Path filePath = storeDir.resolve(\"the_key.json\");\n    Files.write(\n        filePath,\n        (\"{\\n\" + \"  \\\"equalTo\\\": \\\"correct\\\",\\n\" + \"  \\\"caseInsensitive\\\": false\\n\" + \"}\")\n            .getBytes());\n\n    store\n        .get(\"the_key\")\n        .ifPresentOrElse(value -> assertThat(value, instanceOf(Map.class)), Assertions::fail);\n\n    store\n        .get(\"the_key\", EqualToPattern.class)\n        .ifPresentOrElse(\n            value -> {\n              assertThat(value, instanceOf(EqualToPattern.class));\n              assertThat(value.getEqualTo(), is(\"correct\"));\n              assertThat(value.getCaseInsensitive(), is(false));\n            },\n            Assertions::fail);\n  }\n\n  @Test\n  void readListOfStrings() throws Exception {\n    Path filePath = storeDir.resolve(\"the_key.json\");\n    Files.write(filePath, \"[\\\"one\\\", \\\"two\\\", \\\"three\\\"]\".getBytes());\n\n    store\n        .get(\"the_key\")\n        .ifPresentOrElse(\n            value -> {\n              assertThat(value, instanceOf(List.class));\n              assertThat(value, is(List.of(\"one\", \"two\", \"three\")));\n            },\n            Assertions::fail);\n  }\n\n  @Test\n  void nonExistentKey() {\n    assertThat(store.get(\"does_not_exist\").isPresent(), is(false));\n  }\n\n  @Test\n  void computeValueConcurrently() throws InterruptedException {\n    store.put(\"count\", 1);\n\n    ExecutorService executorService = Executors.newFixedThreadPool(50);\n    for (int i = 0; i < 100; i++) {\n      executorService.submit(() -> store.compute(\"count\", (Integer current) -> current + 1));\n    }\n    executorService.shutdown();\n    executorService.awaitTermination(5, SECONDS);\n\n    assertThat(store.get(\"count\").get(), is(101));\n  }\n\n  @Test\n  void getAllKeysReturnsTheCorrectKeys() {\n    store.put(\"the_key\", \"Store this\");\n    store.put(\"that_key\", \"Store that\");\n\n    assertThat(store.getAllKeys().count(), is(2L));\n    assertThat(store.getAllKeys().anyMatch(\"the_key.json\"::equals), is(true));\n    assertThat(store.getAllKeys().anyMatch(\"that_key.json\"::equals), is(true));\n  }\n\n  @Test\n  void remove() {\n    store.put(\"the_key\", \"Store this\");\n    store.put(\"that_key\", \"Store that\");\n\n    assertThat(store.getAllKeys().count(), is(2L));\n    assertThat(store.getAllKeys().anyMatch(\"the_key.json\"::equals), is(true));\n    assertThat(store.getAllKeys().anyMatch(\"that_key.json\"::equals), is(true));\n\n    store.remove(\"the_key\");\n\n    assertThat(store.getAllKeys().count(), is(1L));\n    assertThat(store.getAllKeys().anyMatch(\"the_key.json\"::equals), is(false));\n    assertThat(store.getAllKeys().anyMatch(\"that_key.json\"::equals), is(true));\n  }\n\n  @Test\n  void clear() {\n    store.put(\"the_key\", \"Store this\");\n    store.put(\"that_key\", \"Store that\");\n\n    assertThat(store.getAllKeys().count(), is(2L));\n    assertThat(store.getAllKeys().anyMatch(\"the_key.json\"::equals), is(true));\n    assertThat(store.getAllKeys().anyMatch(\"that_key.json\"::equals), is(true));\n\n    store.clear();\n\n    assertThat(store.getAllKeys().count(), is(0L));\n  }\n\n  @Test\n  void getPath() {\n    assertThat(store.getPath(), is(storeDir.toFile().getAbsolutePath()));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/AdminRequestHandlerTest.java",
    "content": "/*\n * Copyright (C) 2011-2023 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.DELETE;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.testsupport.MockRequestBuilder.aRequest;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalToJson;\nimport static java.net.HttpURLConnection.HTTP_OK;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.verify;\n\nimport com.github.tomakehurst.wiremock.admin.AdminRoutes;\nimport com.github.tomakehurst.wiremock.common.DataTruncationSettings;\nimport com.github.tomakehurst.wiremock.common.Limit;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.AdminRequestHandler;\nimport com.github.tomakehurst.wiremock.http.BasicResponseRenderer;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.security.NoAuthenticator;\nimport com.github.tomakehurst.wiremock.testsupport.MockHttpResponder;\nimport com.github.tomakehurst.wiremock.verification.VerificationResult;\nimport java.util.Collections;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.Mockito;\n\npublic class AdminRequestHandlerTest {\n  private Admin admin = mock(Admin.class);\n  private MockHttpResponder httpResponder;\n\n  private AdminRequestHandler handler;\n\n  @BeforeEach\n  public void init() {\n    httpResponder = new MockHttpResponder();\n\n    handler =\n        new AdminRequestHandler(\n            AdminRoutes.forClient(),\n            admin,\n            new BasicResponseRenderer(),\n            new NoAuthenticator(),\n            false,\n            Collections.emptyList(),\n            Collections.emptyList(),\n            new DataTruncationSettings(Limit.UNLIMITED));\n  }\n\n  @Test\n  public void shouldSaveMappingsWhenSaveCalled() {\n    Request request = aRequest().withUrl(\"/mappings/save\").withMethod(POST).build();\n\n    handler.handle(request, httpResponder, null);\n    Response response = httpResponder.response;\n\n    assertThat(response.getStatus(), is(HTTP_OK));\n    verify(admin).saveMappings();\n  }\n\n  @Test\n  public void shouldClearMappingsJournalAndRequestDelayWhenResetCalled() {\n    Request request = aRequest().withUrl(\"/reset\").withMethod(POST).build();\n\n    handler.handle(request, httpResponder, null);\n    Response response = httpResponder.response;\n\n    assertThat(response.getStatus(), is(HTTP_OK));\n    verify(admin).resetAll();\n  }\n\n  @Test\n  public void shouldClearJournalWhenResetRequestsCalled() {\n    Request request = aRequest().withUrl(\"/requests\").withMethod(DELETE).build();\n\n    handler.handle(request, httpResponder, null);\n    Response response = httpResponder.response;\n\n    assertThat(response.getStatus(), is(HTTP_OK));\n    verify(admin).resetRequests();\n  }\n\n  private static final String REQUEST_PATTERN_SAMPLE =\n      \"{\t\t\t\t\t\t\t\t\t\t\t\t\\n\"\n          + \"\t\\\"method\\\": \\\"DELETE\\\",\t\t\t\t\t\t\\n\"\n          + \"\t\\\"url\\\": \\\"/some/resource\\\"\t\t\t\t\t\\n\"\n          + \"}\t\t\t\t\t\t\t\t\t\t\t\t\";\n\n  @Test\n  public void shouldReturnCountOfMatchingRequests() {\n    RequestPattern requestPattern = newRequestPattern(DELETE, urlEqualTo(\"/some/resource\")).build();\n    Mockito.when(admin.countRequestsMatching(requestPattern))\n        .thenReturn(VerificationResult.withCount(5));\n\n    handler.handle(\n        aRequest()\n            .withUrl(\"/requests/count\")\n            .withMethod(POST)\n            .withBody(REQUEST_PATTERN_SAMPLE)\n            .build(),\n        httpResponder,\n        null);\n    Response response = httpResponder.response;\n\n    assertThat(response.getStatus(), is(HTTP_OK));\n    assertThat(\n        response.getBodyAsString(),\n        equalToJson(\"{ \\\"count\\\": 5, \\\"requestJournalDisabled\\\" : false}\"));\n  }\n\n  private static final String GLOBAL_SETTINGS_JSON =\n      \"{\t\t\t\t\t\t\t\t\t\t\t\t\\n\" + \"\t\\\"fixedDelay\\\": 2000\t\t\t\t\t\t\\n\" + \"}\t\t\t\t\t\t\t\t\t\t\t\t\";\n\n  @Test\n  public void shouldUpdateGlobalSettings() {\n    handler.handle(\n        aRequest().withUrl(\"/settings\").withMethod(POST).withBody(GLOBAL_SETTINGS_JSON).build(),\n        httpResponder,\n        null);\n\n    GlobalSettings expectedSettings = GlobalSettings.builder().fixedDelay(2000).build();\n    verify(admin).updateGlobalSettings(expectedSettings);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/InMemoryMappingsTest.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.OPTIONS;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.PUT;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;\nimport static com.github.tomakehurst.wiremock.testsupport.MockRequestBuilder.aRequest;\nimport static java.net.HttpURLConnection.HTTP_NOT_FOUND;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.common.LocalNotifier;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class InMemoryMappingsTest {\n\n  private StoreBackedStubMappings mappings;\n\n  @BeforeEach\n  public void init() {\n    mappings = new InMemoryStubMappings();\n  }\n\n  @AfterEach\n  public void cleanUp() {\n    LocalNotifier.set(null);\n  }\n\n  @Test\n  public void correctlyAcceptsMappingAndReturnsCorrespondingResponse() {\n    mappings.addMapping(\n        StubMapping.builder()\n            .setRequest(newRequestPattern(PUT, urlEqualTo(\"/some/resource\")).build())\n            .setResponse(responseDefinition().withStatus(204).build())\n            .build());\n\n    Request request = aRequest().withMethod(PUT).withUrl(\"/some/resource\").build();\n    ResponseDefinition response = mappings.serveFor(ServeEvent.of(request)).getResponseDefinition();\n\n    assertThat(response.getStatus(), is(204));\n  }\n\n  @Test\n  public void returnsNotFoundWhenMethodIncorrect() {\n    mappings.addMapping(\n        StubMapping.builder()\n            .setRequest(newRequestPattern(PUT, urlEqualTo(\"/some/resource\")).build())\n            .setResponse(responseDefinition().withStatus(204).build())\n            .build());\n\n    Request request = aRequest().withMethod(POST).withUrl(\"/some/resource\").build();\n    ResponseDefinition response = mappings.serveFor(ServeEvent.of(request)).getResponseDefinition();\n\n    assertThat(response.getStatus(), is(HTTP_NOT_FOUND));\n  }\n\n  @Test\n  public void returnsNotFoundWhenUrlIncorrect() {\n    mappings.addMapping(\n        StubMapping.builder()\n            .setRequest(newRequestPattern(PUT, urlEqualTo(\"/some/resource\")).build())\n            .setResponse(responseDefinition().withStatus(204).build())\n            .build());\n\n    Request request = aRequest().withMethod(PUT).withUrl(\"/some/bad/resource\").build();\n    ResponseDefinition response = mappings.serveFor(ServeEvent.of(request)).getResponseDefinition();\n\n    assertThat(response.getStatus(), is(HTTP_NOT_FOUND));\n  }\n\n  @Test\n  public void returnsNotConfiguredResponseForUnmappedRequest() {\n    Request request = aRequest().withMethod(OPTIONS).withUrl(\"/not/mapped\").build();\n    ResponseDefinition response = mappings.serveFor(ServeEvent.of(request)).getResponseDefinition();\n    assertThat(response.getStatus(), is(HTTP_NOT_FOUND));\n    assertThat(response.wasConfigured(), is(false));\n  }\n\n  @Test\n  public void returnsMostRecentlyInsertedResponseIfTwoOrMoreMatch() {\n    mappings.addMapping(\n        StubMapping.builder()\n            .setRequest(newRequestPattern(GET, urlEqualTo(\"/duplicated/resource\")).build())\n            .setResponse(responseDefinition().withStatus(204).withBody(\"Some content\").build())\n            .build());\n\n    mappings.addMapping(\n        StubMapping.builder()\n            .setRequest(newRequestPattern(GET, urlEqualTo(\"/duplicated/resource\")).build())\n            .setResponse(responseDefinition().withStatus(201).withBody(\"Desired content\").build())\n            .build());\n\n    ResponseDefinition response =\n        mappings\n            .serveFor(\n                ServeEvent.of(aRequest().withMethod(GET).withUrl(\"/duplicated/resource\").build()))\n            .getResponseDefinition();\n\n    assertThat(response.getStatus(), is(201));\n    assertThat(response.getBody(), is(\"Desired content\"));\n  }\n\n  @Test\n  public void returnsMappingInScenarioOnlyWhenStateIsCorrect() {\n    StubMapping firstGetMapping =\n        StubMapping.builder()\n            .setRequest(newRequestPattern(GET, urlEqualTo(\"/scenario/resource\")).build())\n            .setResponse(responseDefinition().withStatus(204).withBody(\"Initial content\").build())\n            .setScenarioName(\"TestScenario\")\n            .setRequiredScenarioState(STARTED)\n            .build();\n\n    mappings.addMapping(firstGetMapping);\n\n    StubMapping putMapping =\n        StubMapping.builder()\n            .setRequest(newRequestPattern(PUT, urlEqualTo(\"/scenario/resource\")).build())\n            .setResponse(responseDefinition().withStatus(204).build())\n            .setScenarioName(\"TestScenario\")\n            .setRequiredScenarioState(STARTED)\n            .setNewScenarioState(\"Modified\")\n            .build();\n\n    mappings.addMapping(putMapping);\n\n    StubMapping secondGetMapping =\n        StubMapping.builder()\n            .setRequest(newRequestPattern(GET, urlEqualTo(\"/scenario/resource\")).build())\n            .setResponse(responseDefinition().withStatus(204).withBody(\"Modified content\").build())\n            .setScenarioName(\"TestScenario\")\n            .setRequiredScenarioState(\"Modified\")\n            .build();\n\n    mappings.addMapping(secondGetMapping);\n\n    Request firstGet = aRequest(\"firstGet\").withMethod(GET).withUrl(\"/scenario/resource\").build();\n    Request put = aRequest(\"put\").withMethod(PUT).withUrl(\"/scenario/resource\").build();\n    Request secondGet = aRequest(\"secondGet\").withMethod(GET).withUrl(\"/scenario/resource\").build();\n\n    assertThat(\n        mappings.serveFor(ServeEvent.of(firstGet)).getResponseDefinition().getBody(),\n        is(\"Initial content\"));\n    mappings.serveFor(ServeEvent.of(put));\n    assertThat(\n        mappings.serveFor(ServeEvent.of(secondGet)).getResponseDefinition().getBody(),\n        is(\"Modified content\"));\n  }\n\n  @Test\n  public void returnsMappingInScenarioWithNoRequiredState() {\n    StubMapping firstGetMapping =\n        StubMapping.builder()\n            .setRequest(newRequestPattern(GET, urlEqualTo(\"/scenario/resource\")).build())\n            .setResponse(responseDefinition().withStatus(200).withBody(\"Expected content\").build())\n            .setScenarioName(\"TestScenario\")\n            .build();\n\n    mappings.addMapping(firstGetMapping);\n\n    Request request = aRequest().withMethod(GET).withUrl(\"/scenario/resource\").build();\n\n    assertThat(\n        mappings.serveFor(ServeEvent.of(request)).getResponseDefinition().getBody(),\n        is(\"Expected content\"));\n  }\n\n  @Test\n  public void supportsResetOfAllScenariosState() {\n    StubMapping firstGetMapping =\n        StubMapping.builder()\n            .setRequest(newRequestPattern(GET, urlEqualTo(\"/scenario/resource\")).build())\n            .setResponse(responseDefinition().withStatus(204).withBody(\"Desired content\").build())\n            .setScenarioName(\"TestScenario\")\n            .setRequiredScenarioState(STARTED)\n            .build();\n\n    mappings.addMapping(firstGetMapping);\n\n    StubMapping putMapping =\n        StubMapping.builder()\n            .setRequest(newRequestPattern(PUT, urlEqualTo(\"/scenario/resource\")).build())\n            .setResponse(responseDefinition().withStatus(204).build())\n            .setScenarioName(\"TestScenario\")\n            .setRequiredScenarioState(STARTED)\n            .setNewScenarioState(\"Modified\")\n            .build();\n\n    mappings.addMapping(putMapping);\n\n    mappings.serveFor(\n        ServeEvent.of(\n            aRequest(\"put /scenario/resource\")\n                .withMethod(PUT)\n                .withUrl(\"/scenario/resource\")\n                .build()));\n    ResponseDefinition response =\n        mappings\n            .serveFor(\n                ServeEvent.of(\n                    aRequest(\"1st get /scenario/resource\")\n                        .withMethod(GET)\n                        .withUrl(\"/scenario/resource\")\n                        .build()))\n            .getResponseDefinition();\n\n    assertThat(response.wasConfigured(), is(false));\n\n    mappings.resetScenarios();\n    response =\n        mappings\n            .serveFor(\n                ServeEvent.of(\n                    aRequest(\"2nd get /scenario/resource\")\n                        .withMethod(GET)\n                        .withUrl(\"/scenario/resource\")\n                        .build()))\n            .getResponseDefinition();\n    assertThat(response.getBody(), is(\"Desired content\"));\n  }\n\n  @Test\n  public void scenariosShouldBeResetWhenMappingsAreReset() {\n\n    StubMapping firstMapping =\n        aBasicMappingInScenario(\"Starting content\")\n            .transform(\n                b -> {\n                  b.setRequiredScenarioState(Scenario.STARTED);\n                  b.setNewScenarioState(\"modified\");\n                });\n    mappings.addMapping(firstMapping);\n\n    StubMapping secondMapping =\n        aBasicMappingInScenario(\"Modified content\")\n            .transform(b -> b.setRequiredScenarioState(\"modified\"));\n    mappings.addMapping(secondMapping);\n\n    Request request = aRequest().withMethod(POST).withUrl(\"/scenario/resource\").build();\n    mappings.serveFor(ServeEvent.of(request));\n    assertThat(\n        mappings.serveFor(ServeEvent.of(request)).getResponseDefinition().getBody(),\n        is(\"Modified content\"));\n\n    mappings.reset();\n\n    StubMapping thirdMapping =\n        aBasicMappingInScenario(\"Starting content\")\n            .transform(b -> b.setRequiredScenarioState(Scenario.STARTED));\n    mappings.addMapping(thirdMapping);\n\n    assertThat(\n        mappings.serveFor(ServeEvent.of(request)).getResponseDefinition().getBody(),\n        is(\"Starting content\"));\n  }\n\n  private StubMapping aBasicMappingInScenario(String body) {\n    return StubMapping.builder()\n        .setRequest(newRequestPattern(POST, urlEqualTo(\"/scenario/resource\")).build())\n        .setResponse(responseDefinition().withStatus(200).withBody(body).build())\n        .setScenarioName(\"TestScenario\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/InMemoryStubMappingsTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.ANY;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.fail;\n\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport java.util.List;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class InMemoryStubMappingsTest {\n\n  private StoreBackedStubMappings inMemoryStubMappings;\n\n  @BeforeEach\n  public void setUp() throws Exception {\n    inMemoryStubMappings = new InMemoryStubMappings();\n  }\n\n  @Test\n  public void testEditMapping() throws Exception {\n\n    StubMapping existingMapping = aMapping(1, \"/priority1/1\");\n    inMemoryStubMappings.addMapping(existingMapping);\n\n    StubMapping newMapping =\n        aMapping(1, \"/priority1/2\").transform(b -> b.setId(existingMapping.getId()));\n\n    inMemoryStubMappings.editMapping(newMapping);\n\n    List<StubMapping> allMappings = inMemoryStubMappings.getAll();\n\n    assertThat(allMappings, hasSize(1));\n    assertThat(allMappings.get(0), is(newMapping));\n    assertThat(newMapping.getInsertionIndex(), is(existingMapping.getInsertionIndex()));\n  }\n\n  @Test\n  public void testRemoveMapping() throws Exception {\n\n    List<StubMapping> allMappings = inMemoryStubMappings.getAll();\n    assertThat(allMappings, hasSize(0));\n\n    StubMapping existingMapping = aMapping(1, \"priority1/1\");\n    inMemoryStubMappings.addMapping(existingMapping);\n    existingMapping = aMapping(2, \"priority2/2\");\n    StubMapping mappingToRemove = existingMapping;\n    inMemoryStubMappings.addMapping(existingMapping);\n    existingMapping = aMapping(3, \"priority3/3\");\n    inMemoryStubMappings.addMapping(existingMapping);\n    allMappings = inMemoryStubMappings.getAll();\n    assertThat(allMappings, hasSize(3));\n\n    inMemoryStubMappings.removeMapping(mappingToRemove);\n\n    allMappings = inMemoryStubMappings.getAll();\n    assertThat(allMappings, hasSize(2));\n  }\n\n  @Test\n  public void testEditMappingNotPresent() throws Exception {\n\n    StubMapping existingMapping = aMapping(1, \"/priority1/1\");\n    inMemoryStubMappings.addMapping(existingMapping);\n\n    StubMapping newMapping = aMapping(1, \"/priority1/2\");\n\n    try {\n      inMemoryStubMappings.editMapping(newMapping);\n      fail(\"Expected Exception\");\n    } catch (RuntimeException e) {\n      assertThat(e.getMessage(), containsString(newMapping.getId().toString()));\n    }\n  }\n\n  private StubMapping aMapping(Integer priority, String url) {\n    RequestPattern requestPattern = newRequestPattern(ANY, urlEqualTo(url)).build();\n\n    return StubMapping.builder()\n        .setRequest(requestPattern)\n        .setResponse(responseDefinition().build())\n        .setPriority(priority)\n        .build();\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/JsonTest.java",
    "content": "/*\n * Copyright (C) 2012-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Test;\n\npublic class JsonTest {\n\n  private static final String TEST_VALUE = \"test-value\";\n  private static final String JSON_WITH_NO_COMMENTS =\n      \"{                                          \\n\"\n          + \"\\\"property\\\": \\\"\"\n          + TEST_VALUE\n          + \"\\\"   \\n\"\n          + \"}\";\n\n  private static final String JSON_WITH_SINGLE_QUOTES =\n      \"{                                            \\n\"\n          + \"'property': '\"\n          + TEST_VALUE\n          + \"'         \\n\"\n          + \"}\";\n\n  private static final String JSON_WITH_COMMENTS =\n      \"// this is the first comment                                                   \\n\"\n          + \"{                                                                              \\n\"\n          + \"//this is a comment                                                    \\n\"\n          + \"\\\"property\\\": \\\"\"\n          + TEST_VALUE\n          + \"\\\"// comment on same line as code    \\n\"\n          + \"}                                                                              \\n\"\n          + \"//this is the last comment\";\n\n  @Test\n  public void testReadNoComments() {\n    TestPojo pojo = Json.read(JSON_WITH_NO_COMMENTS, TestPojo.class);\n    assertNotNull(pojo);\n    assertThat(TEST_VALUE, is(pojo.property));\n  }\n\n  @Test\n  public void testReadWithComments() {\n    TestPojo pojo = Json.read(JSON_WITH_COMMENTS, TestPojo.class);\n    assertNotNull(pojo);\n    assertThat(TEST_VALUE, is(pojo.property));\n  }\n\n  @Test\n  public void testReadWithSingleQuotes() {\n    TestPojo pojo = Json.read(JSON_WITH_SINGLE_QUOTES, TestPojo.class);\n    assertNotNull(pojo);\n    assertThat(TEST_VALUE, is(pojo.property));\n  }\n\n  @Test\n  public void countsAllNodesInADocument() {\n    int count =\n        Json.deepSize(\n            Json.node(\n                \"{\\n\"\n                    + \"    \\\"one\\\": \\\"GET\\\",\\n\"\n                    + \"    \\\"two\\\": 2,\\n\"\n                    + \"    \\\"queryParameters\\\": {\\n\"\n                    + \"        \\\"param1\\\": {\\n\"\n                    + \"            \\\"equalTo\\\": \\\"1\\\"\\n\"\n                    + \"        },\\n\"\n                    + \"        \\\"param2\\\": {\\n\"\n                    + \"            \\\"matches\\\": \\\"2\\\"\\n\"\n                    + \"        }\\n\"\n                    + \"    },\\n\"\n                    + \"    \\\"things\\\": [1, 2, 3],\\n\"\n                    + \"    \\\"deepThings\\\": [\\n\"\n                    + \"        { \\\"deep1\\\": 1 },\\n\"\n                    + \"        { \\\"deep2\\\": 2 }\\n\"\n                    + \"    ]\\n\"\n                    + \"}\"));\n\n    assertThat(count, is(24));\n  }\n\n  @Test\n  public void counts1ForEmptyArray() {\n    int count = Json.deepSize(Json.node(\"[]\"));\n\n    assertThat(count, is(1));\n  }\n\n  @Test\n  public void counts1ForEmptyObject() {\n    int count = Json.deepSize(Json.node(\"{}\"));\n\n    assertThat(count, is(1));\n  }\n\n  private static class TestPojo {\n    public String property;\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/RecordedStubPersistenceTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.recordSpec;\nimport static com.github.tomakehurst.wiremock.common.Limit.UNLIMITED;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoInteractions;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\n\nimport com.github.tomakehurst.wiremock.common.Timing;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.Extensions;\nimport com.github.tomakehurst.wiremock.http.LoggedResponse;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.recording.Recorder;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport.Options.DuplicatePolicy;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.util.List;\nimport java.util.concurrent.LinkedBlockingDeque;\nimport org.junit.jupiter.api.Test;\nimport org.mockito.ArgumentCaptor;\n\nclass RecordedStubPersistenceTest {\n\n  @Test\n  void importsAllRecordedStubsInASingleRequest() {\n    Admin admin = mock();\n    Recorder recorder = new Recorder(admin, Extensions.NONE, mock(), mock());\n    ArgumentCaptor<StubImport> importCaptor = ArgumentCaptor.captor();\n\n    verifyNoInteractions(admin);\n\n    List<ServeEvent> serveEvents =\n        List.of(\n            new ServeEvent(\n                null,\n                LoggedRequest.createFrom(mockRequest().method(GET).url(\"/\")),\n                null,\n                null,\n                LoggedResponse.from(Response.response().status(200).build(), UNLIMITED),\n                false,\n                Timing.UNTIMED,\n                new LinkedBlockingDeque<>()),\n            new ServeEvent(\n                null,\n                LoggedRequest.createFrom(mockRequest().method(POST).url(\"/persist-me\")),\n                null,\n                null,\n                LoggedResponse.from(Response.response().status(202).build(), UNLIMITED),\n                false,\n                Timing.UNTIMED,\n                new LinkedBlockingDeque<>()));\n    recorder.takeSnapshot(\n        serveEvents, recordSpec().allowNonProxied(true).makeStubsPersistent(true).build());\n\n    verify(admin, times(1)).importStubs(importCaptor.capture());\n    verifyNoMoreInteractions(admin);\n\n    StubImport stubImport = importCaptor.getValue();\n    assertFalse(stubImport.getImportOptions().getDeleteAllNotInImport());\n    assertThat(stubImport.getImportOptions().getDuplicatePolicy(), is(DuplicatePolicy.OVERWRITE));\n\n    assertThat(stubImport.getMappings().get(0).getRequest().getUrl(), is(\"/\"));\n    assertThat(stubImport.getMappings().get(0).getResponse().getStatus(), is(200));\n    assertTrue(stubImport.getMappings().get(0).shouldBePersisted());\n\n    assertThat(stubImport.getMappings().get(1).getRequest().getUrl(), is(\"/persist-me\"));\n    assertThat(stubImport.getMappings().get(1).getResponse().getStatus(), is(202));\n    assertTrue(stubImport.getMappings().get(1).shouldBePersisted());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/RemoveStubMappingTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.post;\nimport static com.github.tomakehurst.wiremock.client.WireMock.put;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.argThat;\nimport static org.mockito.Mockito.*;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener;\nimport com.github.tomakehurst.wiremock.standalone.MappingsSource;\nimport java.util.UUID;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\nclass RemoveStubMappingTest {\n\n  StubLifecycleListener listener;\n\n  @BeforeEach\n  void init() {\n    listener = mock(StubLifecycleListener.class);\n    when(listener.beforeStubCreated(any())).thenCallRealMethod();\n    when(listener.beforeStubEdited(any(), any())).thenCallRealMethod();\n  }\n\n  @Test\n  void removingNonExistentStubByIdDoesNotTriggerStubListeners() {\n    WireMockServer wireMockServer =\n        new WireMockServer(wireMockConfig().extensions(listener).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      StubMapping existingStub = get(\"/\").build();\n      wireMockServer.addStubMapping(existingStub);\n      wireMockServer.addStubMapping(post(\"/create\").build());\n\n      clearInvocations(listener);\n\n      wireMockServer.removeStub(existingStub.getId());\n\n      verify(listener).beforeStubRemoved(existingStub);\n      verify(listener).afterStubRemoved(existingStub);\n      verifyNoMoreInteractions(listener);\n      clearInvocations(listener);\n\n      wireMockServer.removeStub(UUID.randomUUID());\n\n      verifyNoInteractions(listener);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  void removingNonExistentStubDoesNotTriggerStubListeners() {\n    WireMockServer wireMockServer =\n        new WireMockServer(wireMockConfig().extensions(listener).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      StubMapping existingStub = get(\"/\").build();\n      wireMockServer.addStubMapping(existingStub);\n      wireMockServer.addStubMapping(post(\"/create\").build());\n\n      clearInvocations(listener);\n\n      wireMockServer.removeStub(existingStub);\n\n      verify(listener).beforeStubRemoved(existingStub);\n      verify(listener).afterStubRemoved(existingStub);\n      verifyNoMoreInteractions(listener);\n      clearInvocations(listener);\n\n      wireMockServer.removeStub(put(\"/whatever\").build());\n\n      verifyNoInteractions(listener);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  void removingNonExistentStubByIdDoesNotCallMappingSaver() {\n    MappingsSource mappingsSource = mock();\n    WireMockServer wireMockServer =\n        new WireMockServer(wireMockConfig().mappingSource(mappingsSource).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      StubMapping existingStub = get(\"/\").persistent(true).build();\n      wireMockServer.addStubMapping(existingStub);\n      wireMockServer.addStubMapping(post(\"/create\").persistent(true).build());\n\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStub(existingStub.getId());\n\n      verify(mappingsSource).remove(existingStub.getId());\n      verifyNoMoreInteractions(mappingsSource);\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStub(UUID.randomUUID());\n\n      verifyNoInteractions(mappingsSource);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  void removingNonExistentStubDoesNotCallMappingSaver() {\n    MappingsSource mappingsSource = mock();\n    WireMockServer wireMockServer =\n        new WireMockServer(wireMockConfig().mappingSource(mappingsSource).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      StubMapping existingStub = get(\"/\").persistent(true).build();\n      wireMockServer.addStubMapping(existingStub);\n      wireMockServer.addStubMapping(post(\"/create\").persistent(true).build());\n\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStub(existingStub);\n\n      verify(mappingsSource).remove(existingStub.getId());\n      verifyNoMoreInteractions(mappingsSource);\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStub(put(\"/whatever\").build());\n\n      verifyNoInteractions(mappingsSource);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  void stubIsNotDeletedIfListenersPreventRemoval() {\n    MappingsSource mappingsSource = mock();\n    UUID disallowedStubId = UUID.randomUUID();\n    doThrow(new RuntimeException(\"stop that\"))\n        .when(listener)\n        .beforeStubRemoved(argThat(stub -> stub.getId().equals(disallowedStubId)));\n    WireMockServer wireMockServer =\n        new WireMockServer(\n            wireMockConfig().mappingSource(mappingsSource).extensions(listener).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      UUID allowedStubId = UUID.randomUUID();\n      wireMockServer.addStubMapping(get(\"/\").withId(allowedStubId).persistent(true).build());\n      wireMockServer.addStubMapping(\n          post(\"/create\").withId(disallowedStubId).persistent(true).build());\n\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStub(allowedStubId);\n\n      verify(mappingsSource).remove(allowedStubId);\n      verifyNoMoreInteractions(mappingsSource);\n      clearInvocations(mappingsSource);\n\n      try {\n        wireMockServer.removeStub(disallowedStubId);\n      } catch (RuntimeException e) {\n        assertThat(e.getMessage(), is(\"stop that\"));\n      }\n\n      verifyNoInteractions(mappingsSource);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/RemoveStubMappingsByMetadataPersistenceTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsInAnyOrder;\nimport static org.hamcrest.Matchers.empty;\nimport static org.mockito.Mockito.clearInvocations;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoInteractions;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.standalone.MappingsSource;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\nimport org.mockito.ArgumentCaptor;\n\nclass RemoveStubMappingsByMetadataPersistenceTest {\n\n  private final MappingsSource mappingsSource = mock();\n\n  @RegisterExtension\n  WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().mappingSource(mappingsSource).dynamicPort())\n          .build();\n\n  @Test\n  void deletesAllStubsTogetherWhenRemovingMultipleStubs() {\n    ArgumentCaptor<List<UUID>> removedCaptor = ArgumentCaptor.captor();\n\n    StubMapping stub1 =\n        get(\"/stub-1\")\n            .withName(\"stub 1\")\n            .willReturn(aResponse().withStatus(200))\n            .withMetadata(Map.of(\"key1\", \"value1\"))\n            .persistent(true)\n            .build();\n    StubMapping stub2 =\n        get(\"/stub-2\")\n            .withName(\"stub 2\")\n            .willReturn(aResponse().withStatus(201))\n            .withMetadata(Map.of(\"key1\", \"value1\"))\n            .persistent(false)\n            .build();\n    StubMapping stub3 =\n        get(\"/stub-3\")\n            .withName(\"stub 3\")\n            .willReturn(aResponse().withStatus(202))\n            .withMetadata(Map.of(\"key2\", \"value2\"))\n            .persistent(true)\n            .build();\n    StubMapping stub4 =\n        get(\"/stub-4\")\n            .withName(\"stub 4\")\n            .willReturn(aResponse().withStatus(202))\n            .withMetadata(Map.of(\"key1\", \"value1\"))\n            .persistent(true)\n            .build();\n\n    wm.addStubMapping(stub1);\n    wm.addStubMapping(stub2);\n    wm.addStubMapping(stub3);\n    wm.addStubMapping(stub4);\n\n    clearInvocations(mappingsSource);\n\n    wm.removeStubMappingsByMetadata(equalToJson(\"{ \\\"key1\\\": \\\"value1\\\" }\"));\n    verify(mappingsSource, times(1)).remove(removedCaptor.capture());\n    verifyNoMoreInteractions(mappingsSource);\n\n    List<UUID> removedStubIds = removedCaptor.getValue();\n    assertThat(removedStubIds, containsInAnyOrder(stub1.getId(), stub4.getId()));\n  }\n\n  @Test\n  void deletesNothingWhenNoRemovedStubsAreSetToPersist() {\n    StubMapping stub1 =\n        get(\"/stub-1\")\n            .withName(\"stub 1\")\n            .willReturn(aResponse().withStatus(200))\n            .persistent(true)\n            .withMetadata(Map.of(\"key1\", \"value1\"))\n            .build();\n    StubMapping stub2 =\n        get(\"/stub-2\")\n            .withName(\"stub 2\")\n            .willReturn(aResponse().withStatus(201))\n            .withMetadata(Map.of(\"key2\", \"value2\"))\n            .persistent(false)\n            .build();\n    StubMapping stub3 =\n        get(\"/stub-3\")\n            .withName(\"stub 3\")\n            .willReturn(aResponse().withStatus(202))\n            .withMetadata(Map.of(\"key2\", \"value2\"))\n            .persistent(false)\n            .build();\n    StubMapping stub4 =\n        get(\"/stub-4\")\n            .withName(\"stub 4\")\n            .willReturn(aResponse().withStatus(202))\n            .withMetadata(Map.of(\"key2\", \"value2\"))\n            .persistent(false)\n            .build();\n    wm.importStubs(\n        new StubImport(List.of(stub1, stub2, stub3, stub4), StubImport.Options.DEFAULTS));\n    assertThat(\n        wm.listAllStubMappings().getMappings(), containsInAnyOrder(stub1, stub2, stub3, stub4));\n    clearInvocations(mappingsSource);\n\n    wm.removeStubMappingsByMetadata(equalToJson(\"{ \\\"key1\\\": \\\"value1\\\" }\"));\n\n    assertThat(wm.listAllStubMappings().getMappings(), containsInAnyOrder(stub2, stub3, stub4));\n    verify(mappingsSource, times(1)).remove(List.of(stub1.getId()));\n\n    clearInvocations(mappingsSource);\n\n    wm.removeStubMappingsByMetadata(equalToJson(\"{ \\\"key2\\\": \\\"value2\\\" }\"));\n\n    assertThat(wm.listAllStubMappings().getMappings(), empty());\n    verifyNoInteractions(mappingsSource);\n  }\n\n  @Test\n  void deletesNothingWhenNoStubsAreRemoved() {\n    wm.addStubMapping(\n        get(\"/existing/stub\")\n            .persistent(true)\n            .withMetadata(Map.of(\"key1\", \"value1\"))\n            .willReturn(ok())\n            .build());\n\n    clearInvocations(mappingsSource);\n\n    wm.removeStubMappingsByMetadata(equalToJson(\"{ \\\"key2\\\": \\\"value2\\\" }\"));\n    verifyNoInteractions(mappingsSource);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/RemoveStubMappingsTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.delete;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.post;\nimport static com.github.tomakehurst.wiremock.client.WireMock.put;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.argThat;\nimport static org.mockito.Mockito.*;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener;\nimport com.github.tomakehurst.wiremock.standalone.MappingsSource;\nimport com.github.tomakehurst.wiremock.stubbing.AbstractStubMappings.RemoveStubMapping;\nimport java.util.List;\nimport java.util.UUID;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\nclass RemoveStubMappingsTest {\n\n  StubLifecycleListener listener;\n\n  @BeforeEach\n  void init() {\n    listener = mock(StubLifecycleListener.class);\n    when(listener.beforeStubCreated(any())).thenCallRealMethod();\n    when(listener.beforeStubEdited(any(), any())).thenCallRealMethod();\n  }\n\n  @Test\n  void removingNonExistentStubsByIdDoesNotTriggerStubListeners() {\n    WireMockServer wireMockServer =\n        new WireMockServer(wireMockConfig().extensions(listener).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      StubMapping existingStub1 = get(\"/\").build();\n      wireMockServer.addStubMapping(existingStub1);\n      StubMapping existingStub2 = post(\"/create\").build();\n      wireMockServer.addStubMapping(existingStub2);\n      wireMockServer.addStubMapping(put(\"/modify\").build());\n\n      clearInvocations(listener);\n\n      wireMockServer.removeStubMappings(\n          List.of(\n              get(\"/whatever\").withId(existingStub1.getId()).build(),\n              get(\"/whatever\").withId(existingStub2.getId()).build()));\n\n      verify(listener)\n          .beforeStubsAltered(\n              List.of(new RemoveStubMapping(existingStub1), new RemoveStubMapping(existingStub2)));\n      verify(listener)\n          .afterStubsAltered(\n              List.of(new RemoveStubMapping(existingStub1), new RemoveStubMapping(existingStub2)));\n      verifyNoMoreInteractions(listener);\n      clearInvocations(listener);\n\n      wireMockServer.removeStubMappings(\n          List.of(get(\"/whatever\").build(), get(\"/whatever\").build()));\n\n      verifyNoInteractions(listener);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  void removingNonExistentStubByRequestMatchDoesNotTriggerStubListeners() {\n    WireMockServer wireMockServer =\n        new WireMockServer(wireMockConfig().extensions(listener).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      StubMapping existingStub1 = get(\"/\").build();\n      wireMockServer.addStubMapping(existingStub1);\n      StubMapping existingStub2 = post(\"/create\").build();\n      wireMockServer.addStubMapping(existingStub2);\n      wireMockServer.addStubMapping(put(\"/modify\").build());\n\n      clearInvocations(listener);\n\n      wireMockServer.removeStubMappings(List.of(get(\"/\").build(), post(\"/create\").build()));\n\n      verify(listener)\n          .beforeStubsAltered(\n              List.of(new RemoveStubMapping(existingStub1), new RemoveStubMapping(existingStub2)));\n      verify(listener)\n          .afterStubsAltered(\n              List.of(new RemoveStubMapping(existingStub1), new RemoveStubMapping(existingStub2)));\n      verifyNoMoreInteractions(listener);\n      clearInvocations(listener);\n\n      wireMockServer.removeStubMappings(\n          List.of(get(\"/whatever\").build(), put(\"/whatever\").build()));\n\n      verifyNoInteractions(listener);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  void removingNonExistentStubByIdDoesNotCallMappingSaver() {\n    MappingsSource mappingsSource = mock();\n    WireMockServer wireMockServer =\n        new WireMockServer(wireMockConfig().mappingSource(mappingsSource).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      StubMapping existingStub1 = get(\"/\").persistent(true).build();\n      wireMockServer.addStubMapping(existingStub1);\n      StubMapping existingStub2 = post(\"/create\").persistent(true).build();\n      wireMockServer.addStubMapping(existingStub2);\n      wireMockServer.addStubMapping(put(\"/modify\").persistent(true).build());\n\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStubMappings(\n          List.of(\n              get(\"/whatever\").withId(existingStub1.getId()).build(),\n              get(\"/whatever\").withId(existingStub2.getId()).build()));\n\n      verify(mappingsSource).remove(List.of(existingStub1.getId(), existingStub2.getId()));\n      verifyNoMoreInteractions(mappingsSource);\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStubMappings(\n          List.of(get(\"/whatever\").build(), get(\"/whatever\").build()));\n\n      verifyNoInteractions(mappingsSource);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  void removingNonExistentStubByRequestMatchDoesNotCallMappingSaver() {\n    MappingsSource mappingsSource = mock();\n    WireMockServer wireMockServer =\n        new WireMockServer(wireMockConfig().mappingSource(mappingsSource).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      StubMapping existingStub1 = get(\"/\").persistent(true).build();\n      wireMockServer.addStubMapping(existingStub1);\n      StubMapping existingStub2 = post(\"/create\").persistent(true).build();\n      wireMockServer.addStubMapping(existingStub2);\n      wireMockServer.addStubMapping(put(\"/modify\").persistent(true).build());\n\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStubMappings(List.of(get(\"/\").build(), post(\"/create\").build()));\n\n      verify(mappingsSource).remove(List.of(existingStub1.getId(), existingStub2.getId()));\n      verifyNoMoreInteractions(mappingsSource);\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStubMappings(\n          List.of(get(\"/whatever\").build(), put(\"/whatever\").build()));\n\n      verifyNoInteractions(mappingsSource);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n\n  @Test\n  void stubsAreNotDeletedIfListenersPreventRemoval() {\n    MappingsSource mappingsSource = mock();\n    List<UUID> disallowedStubIds = List.of(UUID.randomUUID(), UUID.randomUUID());\n    doThrow(new RuntimeException(\"stop that\"))\n        .when(listener)\n        .beforeStubRemoved(argThat(stub -> disallowedStubIds.contains(stub.getId())));\n    doCallRealMethod().when(listener).beforeStubsAltered(any());\n    WireMockServer wireMockServer =\n        new WireMockServer(\n            wireMockConfig().mappingSource(mappingsSource).extensions(listener).dynamicPort());\n    try {\n      wireMockServer.start();\n\n      UUID allowedStubId1 = UUID.randomUUID();\n      wireMockServer.addStubMapping(get(\"/\").withId(allowedStubId1).persistent(true).build());\n      wireMockServer.addStubMapping(\n          post(\"/create\").withId(disallowedStubIds.get(0)).persistent(true).build());\n      wireMockServer.addStubMapping(\n          put(\"/modify\").withId(disallowedStubIds.get(1)).persistent(true).build());\n      UUID allowedStubId2 = UUID.randomUUID();\n      wireMockServer.addStubMapping(\n          delete(\"/remove\").withId(allowedStubId2).persistent(true).build());\n\n      clearInvocations(mappingsSource);\n\n      wireMockServer.removeStub(allowedStubId1);\n\n      verify(mappingsSource).remove(allowedStubId1);\n      verifyNoMoreInteractions(mappingsSource);\n      clearInvocations(mappingsSource);\n\n      try {\n        wireMockServer.removeStubMappings(\n            List.of(\n                get(\"/whatever\").withId(disallowedStubIds.get(0)).build(),\n                get(\"/whatever\").withId(allowedStubId2).build(),\n                get(\"/whatever\").withId(disallowedStubIds.get(1)).build()));\n      } catch (RuntimeException e) {\n        assertThat(e.getMessage(), is(\"stop that\"));\n      }\n\n      verifyNoInteractions(mappingsSource);\n\n    } finally {\n      wireMockServer.stop();\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/RemoveStubsPersistenceTest.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsInAnyOrder;\nimport static org.hamcrest.Matchers.empty;\nimport static org.mockito.Mockito.clearInvocations;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoInteractions;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.standalone.MappingsSource;\nimport java.util.List;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\nclass RemoveStubsPersistenceTest {\n\n  private final MappingsSource mappingsSource = mock();\n\n  @RegisterExtension\n  WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().mappingSource(mappingsSource).dynamicPort())\n          .build();\n\n  @Test\n  void deletesAllStubsTogetherWhenRemovingMultipleStubs() {\n    StubMapping stub1 =\n        get(\"/stub-1\")\n            .withName(\"stub 1\")\n            .willReturn(aResponse().withStatus(200))\n            .persistent(true)\n            .build();\n    StubMapping stub2 =\n        get(\"/stub-2\")\n            .withName(\"stub 2\")\n            .willReturn(aResponse().withStatus(201))\n            .persistent(false)\n            .build();\n    StubMapping stub3 =\n        get(\"/stub-3\")\n            .withName(\"stub 3\")\n            .willReturn(aResponse().withStatus(202))\n            .persistent(true)\n            .build();\n    StubMapping stub4 =\n        get(\"/stub-4\")\n            .withName(\"stub 4\")\n            .willReturn(aResponse().withStatus(202))\n            .persistent(true)\n            .build();\n\n    wm.addStubMapping(stub1);\n    wm.addStubMapping(stub2);\n    wm.addStubMapping(stub3);\n    wm.addStubMapping(stub4);\n\n    clearInvocations(mappingsSource);\n\n    List<StubMapping> stubsToRemove =\n        List.of(\n            get(\"/whatever\").withId(stub1.getId()).build(),\n            get(\"/stub-4\").withId(UUID.randomUUID()).build(),\n            get(\"/whatever\").withId(stub2.getId()).build());\n    wm.removeStubMappings(stubsToRemove);\n    verify(mappingsSource, times(1)).remove(List.of(stub1.getId(), stub4.getId()));\n    verifyNoMoreInteractions(mappingsSource);\n  }\n\n  @Test\n  void deletesNothingWhenNoRemovedStubsAreSetToPersist() {\n    StubMapping stub1 =\n        get(\"/stub-1\")\n            .withName(\"stub 1\")\n            .willReturn(aResponse().withStatus(200))\n            .persistent(true)\n            .build();\n    StubMapping stub2 =\n        get(\"/stub-2\")\n            .withName(\"stub 2\")\n            .willReturn(aResponse().withStatus(201))\n            .persistent(false)\n            .build();\n    StubMapping stub3 =\n        get(\"/stub-3\")\n            .withName(\"stub 3\")\n            .willReturn(aResponse().withStatus(202))\n            .persistent(false)\n            .build();\n    StubMapping stub4 =\n        get(\"/stub-4\")\n            .withName(\"stub 4\")\n            .willReturn(aResponse().withStatus(202))\n            .persistent(false)\n            .build();\n    wm.importStubs(\n        new StubImport(List.of(stub1, stub2, stub3, stub4), StubImport.Options.DEFAULTS));\n    assertThat(\n        wm.listAllStubMappings().getMappings(), containsInAnyOrder(stub1, stub2, stub3, stub4));\n    clearInvocations(mappingsSource);\n\n    wm.removeStubMappings(List.of(stub1));\n\n    assertThat(wm.listAllStubMappings().getMappings(), containsInAnyOrder(stub2, stub3, stub4));\n    verify(mappingsSource, times(1)).remove(List.of(stub1.getId()));\n\n    clearInvocations(mappingsSource);\n\n    wm.removeStubMappings(List.of(stub2, stub3, stub4));\n\n    assertThat(wm.listAllStubMappings().getMappings(), empty());\n    verifyNoInteractions(mappingsSource);\n  }\n\n  @Test\n  void deletesNothingWhenNoStubsAreRemoved() {\n    wm.addStubMapping(get(\"/existing/stub\").persistent(true).willReturn(ok()).build());\n\n    clearInvocations(mappingsSource);\n\n    wm.removeStubMappings(List.of(get(\"/whatever\").build()));\n    verifyNoInteractions(mappingsSource);\n  }\n\n  @Test\n  void deletesNothingWhenNoStubsAreProvided() {\n    wm.addStubMapping(get(\"/existing/stub\").persistent(true).willReturn(ok()).build());\n\n    clearInvocations(mappingsSource);\n\n    wm.removeStubMappings(List.of());\n    verifyNoInteractions(mappingsSource);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/ResponseDefinitionTest.java",
    "content": "/*\n * Copyright (C) 2012-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static com.github.tomakehurst.wiremock.http.ResponseDefinition.copyOf;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.Body;\nimport com.github.tomakehurst.wiremock.http.ChunkedDribbleDelay;\nimport com.github.tomakehurst.wiremock.http.Fault;\nimport com.github.tomakehurst.wiremock.http.FixedDelayDistribution;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.skyscreamer.jsonassert.JSONAssert;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.Path;\n\npublic class ResponseDefinitionTest {\n\n  @Test\n  public void copyProducesEqualObject() {\n    ResponseDefinition response =\n        new ResponseDefinition(\n            222,\n            null,\n            \"blah\",\n            null,\n            null,\n            \"name.json\",\n            new HttpHeaders(httpHeader(\"thing\", \"thingvalue\")),\n            null,\n            null,\n            1112,\n            null,\n            null,\n            \"http://base.com\",\n            null,\n            Fault.EMPTY_RESPONSE,\n            List.of(\"transformer-1\"),\n            Parameters.one(\"name\", \"Jeff\"),\n            true);\n\n    ResponseDefinition copiedResponse = copyOf(response);\n\n    assertEquals(response, copiedResponse);\n  }\n\n  @Test\n  public void copyPreservesConfiguredFlag() {\n    ResponseDefinition response = ResponseDefinition.notConfigured();\n    ResponseDefinition copiedResponse = copyOf(response);\n    assertFalse(copiedResponse.wasConfigured(), \"Should be not configured\");\n  }\n\n  private static final String STRING_BODY =\n      \"\"\"\n          {\n          \t\t\"status\": 200,\n          \t\t\"body\": \"String content\"\n          }\"\"\";\n\n  @Test\n  public void correctlyUnmarshalsFromJsonWhenBodyIsAString() {\n    ResponseDefinition responseDef = Json.read(STRING_BODY, ResponseDefinition.class);\n    assertThat(responseDef.getBase64Body(), is(nullValue()));\n    assertThat(responseDef.getJsonBody(), is(nullValue()));\n    assertThat(responseDef.getBody(), is(\"String content\"));\n  }\n\n  private static final String JSON_BODY =\n      \"\"\"\n          {\n          \t\t\"status\": 200,\n          \t\t\"jsonBody\": {\"name\":\"wirmock\",\"isCool\":true}\n          }\"\"\";\n\n  @Test\n  public void correctlyUnmarshalsFromJsonWhenBodyIsJson() {\n    ResponseDefinition responseDef = Json.read(JSON_BODY, ResponseDefinition.class);\n    assertThat(responseDef.getBase64Body(), is(nullValue()));\n    assertThat(responseDef.getBody(), is(nullValue()));\n\n    JsonNode jsonNode = Json.node(\"{\\\"name\\\":\\\"wirmock\\\",\\\"isCool\\\":true}\");\n    assertThat(responseDef.getJsonBody(), is(jsonNode));\n  }\n\n  @Test\n  public void correctlyMarshalsToJsonWhenBodyIsAString() throws Exception {\n    ResponseDefinition responseDef =\n        responseDefinition().withStatus(200).withBody(\"String content\").build();\n\n    JSONAssert.assertEquals(STRING_BODY, Json.write(responseDef), false);\n  }\n\n  private static final byte[] BODY = new byte[] {1, 2, 3};\n  private static final String BASE64_BODY = \"AQID\";\n  private static final String BINARY_BODY =\n      \"{\t        \t\t\t\t\t\t\t\t        \\n\"\n          + \"\t\t\\\"status\\\": 200,    \t\t\t\t        \\n\"\n          + \"\t\t\\\"base64Body\\\": \\\"\"\n          + BASE64_BODY\n          + \"\\\"     \\n\"\n          + \"}\t\t\t\t\t\t\t\t\t\t\t        \";\n\n  @Test\n  public void correctlyUnmarshalsFromJsonWhenBodyIsBinary() {\n    ResponseDefinition responseDef = Json.read(BINARY_BODY, ResponseDefinition.class);\n    assertThat(responseDef.getBody(), is(nullValue()));\n    assertThat(responseDef.getByteBody(), is(BODY));\n  }\n\n  @Test\n  public void correctlyMarshalsToJsonWhenBodyIsBinary() throws Exception {\n    ResponseDefinition responseDef =\n        responseDefinition().withStatus(200).withBase64Body(BASE64_BODY).build();\n\n    String actualJson = Json.write(responseDef);\n    JSONAssert.assertEquals(actualJson, BINARY_BODY, false);\n  }\n\n  @Test\n  public void indicatesBodyFileIfBodyContentIsNotAlsoSpecified() {\n    ResponseDefinition responseDefinition = responseDefinition().withBodyFile(\"my-file\").build();\n\n    assertTrue(responseDefinition.specifiesBodyFile());\n    assertFalse(responseDefinition.specifiesBodyContent());\n  }\n\n  @Test\n  public void doesNotIndicateBodyFileIfBodyContentIsAlsoSpecified() {\n    ResponseDefinition responseDefinition =\n        responseDefinition().withBodyFile(\"my-file\").withBody(\"hello\").build();\n\n    assertFalse(responseDefinition.specifiesBodyFile());\n    assertTrue(responseDefinition.specifiesBodyContent());\n  }\n\n  @Test\n  public void omitsResponseTransformerAttributesFromJsonWhenEmpty() {\n    String json = Json.write(responseDefinition().withStatus(200).build());\n\n    assertThat(json, not(containsString(\"transformers\")));\n    assertThat(json, not(containsString(\"transformerParameters\")));\n  }\n\n  @Test\n  public void removeProxyRequestHeadersListIsImmutable() {\n    var removeProxyRequestHeaders = new ArrayList<String>();\n    var builder1 = new ResponseDefinition.Builder();\n    removeProxyRequestHeaders.add(\"header-1\");\n    builder1.setRemoveProxyRequestHeaders(removeProxyRequestHeaders);\n\n    var responseDefinition1 = builder1.build();\n    assertThat(responseDefinition1.getRemoveProxyRequestHeaders(), contains(\"header-1\"));\n\n    removeProxyRequestHeaders.clear();\n\n    assertThat(responseDefinition1.getRemoveProxyRequestHeaders(), contains(\"header-1\"));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () -> responseDefinition1.getRemoveProxyRequestHeaders().add(\"header-2\"));\n\n    assertThat(responseDefinition1.getRemoveProxyRequestHeaders(), contains(\"header-1\"));\n\n    builder1.getRemoveProxyRequestHeaders().clear();\n\n    assertThat(responseDefinition1.getRemoveProxyRequestHeaders(), contains(\"header-1\"));\n\n    var builder2 = responseDefinition1.toBuilder();\n    builder2.getRemoveProxyRequestHeaders().add(\"header-2\");\n    var responseDefinition2 = builder2.build();\n\n    assertThat(responseDefinition1.getRemoveProxyRequestHeaders(), contains(\"header-1\"));\n\n    assertThat(\n        responseDefinition2.getRemoveProxyRequestHeaders(), contains(\"header-1\", \"header-2\"));\n  }\n\n  @Test\n  public void transformersListIsImmutable() {\n    var transformers = new ArrayList<String>();\n    var builder1 = new ResponseDefinition.Builder();\n    transformers.add(\"transformer-1\");\n    builder1.setTransformers(transformers);\n\n    var responseDefinition1 = builder1.build();\n    assertThat(responseDefinition1.getTransformers(), contains(\"transformer-1\"));\n\n    transformers.clear();\n\n    assertThat(responseDefinition1.getTransformers(), contains(\"transformer-1\"));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () -> responseDefinition1.getTransformers().add(\"transformer-2\"));\n\n    assertThat(responseDefinition1.getTransformers(), contains(\"transformer-1\"));\n\n    builder1.getTransformers().clear();\n\n    assertThat(responseDefinition1.getTransformers(), contains(\"transformer-1\"));\n\n    var builder2 = responseDefinition1.toBuilder();\n    builder2.getTransformers().add(\"transformer-2\");\n    var responseDefinition2 = builder2.build();\n\n    assertThat(responseDefinition1.getTransformers(), contains(\"transformer-1\"));\n\n    assertThat(responseDefinition2.getTransformers(), contains(\"transformer-1\", \"transformer-2\"));\n  }\n\n  @Test\n  public void headersCannotBeNull() {\n    var builder = new ResponseDefinition.Builder();\n    assertThat(builder.getHeaders(), notNullValue());\n    assertThat(builder.getHeaders().size(), is(0));\n    assertThrows(NullPointerException.class, () -> builder.setHeaders(null));\n    assertThat(builder.getHeaders(), notNullValue());\n    assertThat(builder.getHeaders().size(), is(0));\n    assertThat(builder.build().getHeaders(), notNullValue());\n    assertThat(builder.build().getHeaders().size(), is(0));\n    var responseDefinition =\n        new ResponseDefinition(\n            200, null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(responseDefinition.getHeaders(), notNullValue());\n    assertThat(responseDefinition.getHeaders().size(), is(0));\n  }\n\n  @Test\n  public void additionalProxyRequestHeadersCannotBeNull() {\n    var builder = new ResponseDefinition.Builder();\n    assertThat(builder.getAdditionalProxyRequestHeaders(), notNullValue());\n    assertThat(builder.getAdditionalProxyRequestHeaders().size(), is(0));\n    assertThrows(NullPointerException.class, () -> builder.setAdditionalProxyRequestHeaders(null));\n    assertThat(builder.getAdditionalProxyRequestHeaders(), notNullValue());\n    assertThat(builder.getAdditionalProxyRequestHeaders().size(), is(0));\n    assertThat(builder.build().getAdditionalProxyRequestHeaders(), notNullValue());\n    assertThat(builder.build().getAdditionalProxyRequestHeaders().size(), is(0));\n    var responseDefinition =\n        new ResponseDefinition(\n            200, null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(responseDefinition.getAdditionalProxyRequestHeaders(), notNullValue());\n    assertThat(responseDefinition.getAdditionalProxyRequestHeaders().size(), is(0));\n  }\n\n  @Test\n  public void removeProxyRequestHeadersCannotBeNull() {\n    var builder = new ResponseDefinition.Builder();\n    assertThat(builder.getRemoveProxyRequestHeaders(), empty());\n    assertThrows(NullPointerException.class, () -> builder.setRemoveProxyRequestHeaders(null));\n    assertThat(builder.getRemoveProxyRequestHeaders(), empty());\n    assertThat(builder.build().getRemoveProxyRequestHeaders(), empty());\n    var responseDefinition =\n        new ResponseDefinition(\n            200, null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(responseDefinition.getRemoveProxyRequestHeaders(), empty());\n  }\n\n  @Test\n  public void transformersCannotBeNull() {\n    var builder = new ResponseDefinition.Builder();\n    assertThat(builder.getTransformers(), empty());\n    assertThrows(NullPointerException.class, () -> builder.setTransformers(null));\n    assertThat(builder.getTransformers(), notNullValue());\n    assertThat(builder.getTransformers().size(), is(0));\n    assertThat(builder.build().getTransformers(), empty());\n    var responseDefinition =\n        new ResponseDefinition(\n            200, null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(responseDefinition.getTransformers(), empty());\n  }\n\n  @Test\n  public void transformerParametersCannotBeNull() {\n    var builder = new ResponseDefinition.Builder();\n    assertThat(builder.getTransformerParameters(), notNullValue());\n    assertThat(builder.getTransformerParameters().size(), is(0));\n    assertThrows(NullPointerException.class, () -> builder.setTransformerParameters(null));\n    assertThat(builder.getTransformerParameters(), notNullValue());\n    assertThat(builder.getTransformerParameters().size(), is(0));\n    assertThat(builder.build().getTransformerParameters(), notNullValue());\n    assertThat(builder.build().getTransformerParameters().size(), is(0));\n    var responseDefinition =\n        new ResponseDefinition(\n            200, null, null, null, null, null, null, null, null, null, null, null, null, null, null,\n            null, null);\n    assertThat(responseDefinition.getTransformerParameters(), notNullValue());\n    assertThat(responseDefinition.getTransformerParameters().size(), is(0));\n  }\n\n  @Test\n  public void builderCopiesExistingValues() {\n    var responseDefinition =\n        new ResponseDefinition(\n            200,\n            \"my status message\",\n            new Body(\"my body\"),\n            \"my body file name\",\n            new HttpHeaders(httpHeader(\"header-1\", \"h1v1\", \"h1v2\")),\n            new HttpHeaders(httpHeader(\"additional-header-1\", \"h1v1\", \"h1v2\")),\n            List.of(\"remove-header-1\", \"h1v1\", \"h1v2\"),\n            1000,\n            new FixedDelayDistribution(2000),\n            new ChunkedDribbleDelay(3, 200),\n            \"http://example.com\",\n            Path.parse(\"my-prefix\"),\n            Fault.EMPTY_RESPONSE,\n            List.of(\"my-transformer\"),\n            Parameters.one(\"p-1\", \"p1v1\"),\n            AbsoluteUrl.parse(\"https://browser.example.com\"),\n            true);\n\n    var copy = responseDefinition.toBuilder().build();\n    assertThat(copy, is(responseDefinition));\n    assertThat(copy.getStatus(), is(200));\n    assertThat(copy.getStatusMessage(), is(\"my status message\"));\n    assertThat(copy.getBody(), is(\"my body\"));\n    assertThat(copy.getBodyFileName(), is(\"my body file name\"));\n    assertThat(copy.getHeaders(), is(new HttpHeaders(httpHeader(\"header-1\", \"h1v1\", \"h1v2\"))));\n    assertThat(\n        copy.getAdditionalProxyRequestHeaders(),\n        is(new HttpHeaders(httpHeader(\"additional-header-1\", \"h1v1\", \"h1v2\"))));\n    assertThat(copy.getRemoveProxyRequestHeaders(), is(List.of(\"remove-header-1\", \"h1v1\", \"h1v2\")));\n    assertThat(copy.getFixedDelayMilliseconds(), is(1000));\n    assertThat(copy.getDelayDistribution(), instanceOf(FixedDelayDistribution.class));\n    assertThat(copy.getDelayDistribution().sampleMillis(), is(2000L));\n    assertThat(copy.getChunkedDribbleDelay().getNumberOfChunks(), is(3));\n    assertThat(copy.getChunkedDribbleDelay().getTotalDuration(), is(200));\n    assertThat(copy.getProxyBaseUrl(), is(\"http://example.com\"));\n    assertThat(copy.getProxyUrlPrefixToRemove(), is(Path.parse(\"my-prefix\")));\n    assertThat(copy.getFault(), is(Fault.EMPTY_RESPONSE));\n    assertThat(copy.getTransformers(), is(List.of(\"my-transformer\")));\n    assertThat(copy.getTransformerParameters(), is(Parameters.one(\"p-1\", \"p1v1\")));\n    assertThat(copy.getBrowserProxyUrl(), is(AbsoluteUrl.parse(\"https://browser.example.com\")));\n    assertThat(copy.wasConfigured(), is(true));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/ScenariosTest.java",
    "content": "/*\n * Copyright (C) 2017-2022 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport java.util.Set;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class ScenariosTest {\n\n  Scenarios scenarios;\n\n  @BeforeEach\n  public void init() {\n    scenarios = new InMemoryScenarios();\n  }\n\n  @Test\n  public void addsANewScenarioWhenStubAddedWithNewScenarioName() {\n    StubMapping stub =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n\n    scenarios.onStubMappingAdded(stub);\n\n    Scenario scenario = scenarios.getByName(\"one\");\n\n    assertThat(scenario.getState(), is(STARTED));\n    assertThat(scenario.getPossibleStates(), hasItems(STARTED, \"step_2\"));\n  }\n\n  @Test\n  public void updatesAnExistingScenarioWhenStubAddedWithExistingScenarioName() {\n    StubMapping stub1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(stub1);\n\n    StubMapping stub2 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step_2\")\n            .willSetStateTo(\"step_3\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(stub2);\n\n    assertThat(scenarios.getAll().size(), is(1));\n\n    Scenario scenario = scenarios.getByName(\"one\");\n    assertThat(scenario.getState(), is(STARTED));\n    assertThat(scenario.getPossibleStates(), hasItems(STARTED, \"step_2\", \"step_3\"));\n  }\n\n  @Test\n  public void removesPossibleStateFromScenarioWhenStubThatIsNotTheLastInTheScenarioIsDeleted() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping1);\n\n    StubMapping mapping2 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step_2\")\n            .willSetStateTo(\"step_3\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping2);\n\n    Scenario scenario = scenarios.getByName(\"one\");\n    assertThat(scenario.getPossibleStates(), hasItems(STARTED, \"step_2\", \"step_3\"));\n\n    scenarios.onStubMappingRemoved(mapping2);\n\n    scenario = scenarios.getByName(\"one\");\n    assertThat(scenario.getPossibleStates(), hasItems(STARTED, \"step_2\"));\n  }\n\n  @Test\n  public void removesScenarioCompletelyWhenNoMoreMappingsReferToItDueToRemoval() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping1);\n\n    StubMapping mapping2 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step_2\")\n            .willSetStateTo(\"step_3\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping2);\n\n    Scenario scenario = scenarios.getByName(\"one\");\n    assertThat(scenario.getPossibleStates(), hasItems(STARTED, \"step_2\", \"step_3\"));\n\n    scenarios.onStubMappingRemoved(mapping1);\n    scenarios.onStubMappingRemoved(mapping2);\n\n    assertThat(scenarios.getAll(), empty());\n  }\n\n  @Test\n  public void removesScenarioCompletelyWhenNoMoreMappingsReferToItDueToNameChange() {\n    StubMapping oldMapping =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(oldMapping);\n\n    assertThat(scenarios.getByName(\"one\"), notNullValue());\n\n    StubMapping newMapping =\n        get(\"/scenarios/1\")\n            .inScenario(\"two\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n\n    scenarios.onStubMappingUpdated(oldMapping, newMapping);\n\n    assertThat(scenarios.getByName(\"one\"), nullValue());\n  }\n\n  @Test\n  public void stubMappingCanStopBeingInScenario() {\n    StubMapping oldMapping =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(oldMapping);\n\n    assertThat(scenarios.getByName(\"one\"), notNullValue());\n\n    StubMapping newMapping = get(\"/scenarios/1\").willReturn(ok()).build();\n\n    scenarios.onStubMappingUpdated(oldMapping, newMapping);\n\n    assertThat(scenarios.getByName(\"one\"), nullValue());\n  }\n\n  @Test\n  public void modifiesScenarioStateWhenStubServed() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping1);\n\n    StubMapping mapping2 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step_2\")\n            .willSetStateTo(\"step_3\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping2);\n\n    assertThat(scenarios.getByName(\"one\").getState(), is(STARTED));\n\n    scenarios.onStubServed(mapping1);\n    assertThat(scenarios.getByName(\"one\").getState(), is(\"step_2\"));\n\n    scenarios.onStubServed(mapping2);\n    assertThat(scenarios.getByName(\"one\").getState(), is(\"step_3\"));\n  }\n\n  @Test\n  public void doesNotModifyScenarioStateWhenStubServedInNonMatchingState() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping1);\n\n    StubMapping mapping2 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step_2\")\n            .willSetStateTo(\"step_3\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping2);\n\n    assertThat(scenarios.getByName(\"one\").getState(), is(STARTED));\n\n    scenarios.onStubServed(mapping2);\n    assertThat(scenarios.getByName(\"one\").getState(), is(STARTED));\n  }\n\n  @Test\n  public void resetsAllScenarios() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping1);\n\n    StubMapping mapping2 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step_2\")\n            .willSetStateTo(\"step_3\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping2);\n\n    StubMapping mapping3 =\n        get(\"/scenarios/2\")\n            .inScenario(\"two\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"2_step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping3);\n\n    scenarios.onStubServed(mapping1);\n    scenarios.onStubServed(mapping3);\n\n    assertThat(scenarios.getByName(\"one\").getState(), is(\"step_2\"));\n    assertThat(scenarios.getByName(\"two\").getState(), is(\"2_step_2\"));\n\n    scenarios.reset();\n\n    assertThat(scenarios.getByName(\"one\").getState(), is(STARTED));\n    assertThat(scenarios.getByName(\"two\").getState(), is(STARTED));\n  }\n\n  @Test\n  public void clearsScenarios() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping1);\n\n    StubMapping mapping2 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step_2\")\n            .willSetStateTo(\"step_3\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping2);\n\n    StubMapping mapping3 =\n        get(\"/scenarios/2\")\n            .inScenario(\"two\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"2_step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping3);\n\n    assertThat(scenarios.getAll().size(), is(2));\n\n    scenarios.clear();\n\n    assertThat(scenarios.getAll().size(), is(0));\n  }\n\n  @Test\n  public void checksMappingIsInScenarioState() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step_2\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping1);\n\n    StubMapping mapping2 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step_2\")\n            .willSetStateTo(\"step_3\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping2);\n\n    assertThat(scenarios.mappingMatchesScenarioState(mapping1), is(true));\n    assertThat(scenarios.mappingMatchesScenarioState(mapping2), is(false));\n  }\n\n  @Test\n  public void returnsOnlyStartedStateWhenNoNextStateSpecified() {\n    StubMapping mapping =\n        get(\"/scenarios/1\").inScenario(\"one\").whenScenarioStateIs(STARTED).willReturn(ok()).build();\n    scenarios.onStubMappingAdded(mapping);\n\n    Scenario scenario = scenarios.getByName(\"one\");\n\n    assertThat(scenario.getState(), is(STARTED));\n    assertThat(scenario.getPossibleStates(), hasItems(STARTED));\n  }\n\n  @Test\n  public void doesNotAddDuplicatePossibleStates() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step two\")\n            .willReturn(ok())\n            .build();\n    StubMapping mapping2 =\n        get(\"/scenarios/2\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step two\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping1);\n    scenarios.onStubMappingAdded(mapping1);\n\n    Set<String> possibleStates = scenarios.getByName(\"one\").getPossibleStates();\n    assertThat(possibleStates.size(), is(2));\n    assertThat(possibleStates, hasItems(\"Started\", \"step two\"));\n  }\n\n  @Test\n  public void supportsNewScenarioStateWhenRequiredStateIsNull() {\n    StubMapping mapping =\n        get(\"/scenarios/1\").inScenario(\"one\").willSetStateTo(\"step two\").willReturn(ok()).build();\n\n    scenarios.onStubMappingAdded(mapping);\n\n    scenarios.onStubServed(mapping);\n\n    assertThat(scenarios.getByName(\"one\").getState(), is(\"step two\"));\n  }\n\n  @Test\n  public void doesNotRemovePossibleStateWhenStubIsRemovedButOtherStubsHaveThatState() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(STARTED)\n            .willSetStateTo(\"step two\")\n            .willReturn(ok())\n            .build();\n    StubMapping mapping2 =\n        get(\"/scenarios/2\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step two\")\n            .willSetStateTo(\"step two\")\n            .willReturn(ok())\n            .build();\n    StubMapping mapping3 =\n        get(\"/scenarios/3\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"step two\")\n            .willReturn(ok())\n            .build();\n    scenarios.onStubMappingAdded(mapping1);\n    scenarios.onStubMappingAdded(mapping2);\n    scenarios.onStubMappingAdded(mapping3);\n\n    scenarios.onStubMappingRemoved(mapping2);\n\n    Set<String> possibleStates = scenarios.getByName(\"one\").getPossibleStates();\n    assertThat(possibleStates, hasItems(\"Started\", \"step two\"));\n    assertThat(possibleStates.size(), is(2));\n  }\n\n  @Test\n  public void returnsAllPossibleScenarioStates() {\n    StubMapping mapping1 =\n        get(\"/scenarios/1\")\n            .inScenario(\"one\")\n            .whenScenarioStateIs(\"A\")\n            .willSetStateTo(\"B\")\n            .willReturn(ok())\n            .build();\n    StubMapping mapping2 =\n        get(\"/scenarios/1\").inScenario(\"one\").willSetStateTo(\"C\").willReturn(ok()).build();\n    StubMapping mapping3 =\n        get(\"/scenarios/1\").inScenario(\"one\").whenScenarioStateIs(\"D\").willReturn(ok()).build();\n\n    scenarios.onStubMappingAdded(mapping1);\n    scenarios.onStubMappingAdded(mapping2);\n    scenarios.onStubMappingAdded(mapping3);\n\n    Set<String> possibleStates = scenarios.getByName(\"one\").getPossibleStates();\n    assertThat(possibleStates, hasItems(\"A\", \"B\", \"C\", \"D\"));\n    assertThat(possibleStates.size(), is(4));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/ServeEventFactory.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\n\npublic class ServeEventFactory {\n\n  public static ServeEvent newPostMatchServeEvent(\n      Request request, ResponseDefinitionBuilder responseDefinitionBuilder) {\n    StubMapping stubMapping =\n        WireMock.any(WireMock.anyUrl()).willReturn(responseDefinitionBuilder).build();\n    return newPostMatchServeEvent(request, responseDefinitionBuilder, stubMapping);\n  }\n\n  public static ServeEvent newPostMatchServeEvent(\n      Request request, ResponseDefinition responseDefinition) {\n    StubMapping stubMapping =\n        WireMock.any(WireMock.anyUrl()).build().transform(b -> b.setResponse(responseDefinition));\n    return newPostMatchServeEvent(request, responseDefinition, stubMapping);\n  }\n\n  public static ServeEvent newPostMatchServeEvent(\n      Request request,\n      ResponseDefinitionBuilder responseDefinitionBuilder,\n      StubMapping stubMapping) {\n    return newPostMatchServeEvent(request, responseDefinitionBuilder.build(), stubMapping);\n  }\n\n  public static ServeEvent newPostMatchServeEvent(\n      Request request, ResponseDefinition responseDefinition, StubMapping stubMapping) {\n    return new ServeEvent(LoggedRequest.createFrom(request), stubMapping, responseDefinition);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/StubImportPersistenceTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.created;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.noContent;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.okJson;\nimport static com.github.tomakehurst.wiremock.client.WireMock.post;\nimport static com.github.tomakehurst.wiremock.client.WireMock.put;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.mockito.Mockito.clearInvocations;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoInteractions;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.standalone.MappingsSource;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport.Options.DuplicatePolicy;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\nclass StubImportPersistenceTest {\n\n  private final MappingsSource mappingsSource = mock();\n\n  @RegisterExtension\n  WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().mappingSource(mappingsSource).dynamicPort())\n          .build();\n\n  @Test\n  void savesAllStubsTogetherWhenImportingMultipleStubs() {\n    StubMapping existingStub = get(\"/existing/stub\").persistent(true).willReturn(ok()).build();\n    wm.addStubMapping(existingStub);\n    wm.addStubMapping(\n        put(\"/another/existing/stub\").persistent(true).willReturn(noContent()).build());\n\n    clearInvocations(mappingsSource);\n\n    List<StubMapping> newStubs =\n        List.of(\n            get(\"/\").persistent(true).willReturn(ok()).build(),\n            get(\"/do/not/persist\").willReturn(ok()).persistent(false).build(),\n            post(\"/thing\").willReturn(created()).persistent(true).build(),\n            put(\"/thing/4\")\n                .withId(existingStub.getId())\n                .willReturn(okJson(\"{}\"))\n                .persistent(true)\n                .build());\n    wm.importStubs(\n        new StubImport(newStubs, new StubImport.Options(DuplicatePolicy.OVERWRITE, false)));\n    verify(mappingsSource, times(1))\n        .save(List.of(newStubs.get(3), newStubs.get(2), newStubs.get(0)));\n    verifyNoMoreInteractions(mappingsSource);\n  }\n\n  @Test\n  void doesNotSaveIgnoredStubsWhenImportingMultipleStubs() {\n    StubMapping existingStub = get(\"/existing/stub\").persistent(true).willReturn(ok()).build();\n    wm.addStubMapping(existingStub);\n    wm.addStubMapping(\n        put(\"/another/existing/stub\").persistent(true).willReturn(noContent()).build());\n\n    clearInvocations(mappingsSource);\n\n    List<StubMapping> newStubs =\n        List.of(\n            get(\"/\").persistent(true).willReturn(ok()).build(),\n            get(\"/do/not/persist\").willReturn(ok()).persistent(false).build(),\n            post(\"/thing\").willReturn(created()).persistent(true).build(),\n            put(\"/thing/4\")\n                .withId(existingStub.getId())\n                .willReturn(okJson(\"{}\"))\n                .persistent(true)\n                .build());\n    wm.importStubs(new StubImport(newStubs, new StubImport.Options(DuplicatePolicy.IGNORE, false)));\n    verify(mappingsSource, times(1)).save(List.of(newStubs.get(2), newStubs.get(0)));\n    verifyNoMoreInteractions(mappingsSource);\n  }\n\n  @Test\n  void setsAllStubsTogetherWhenImportingMultipleStubsAndRemovingNonImportedStubs() {\n    wm.addStubMapping(get(\"/existing/stub\").persistent(true).willReturn(ok()).build());\n    wm.addStubMapping(\n        put(\"/another/existing/stub\").persistent(true).willReturn(noContent()).build());\n\n    clearInvocations(mappingsSource);\n\n    List<StubMapping> newStubs =\n        List.of(\n            get(\"/\").persistent(true).willReturn(ok()).build(),\n            get(\"/do/not/persist\").willReturn(ok()).persistent(false).build(),\n            post(\"/thing\").willReturn(created()).persistent(true).build(),\n            put(\"/thing/4\").willReturn(okJson(\"{}\")).persistent(true).build());\n    wm.importStubs(\n        new StubImport(newStubs, new StubImport.Options(DuplicatePolicy.OVERWRITE, true)));\n    verify(mappingsSource, times(1))\n        .setAll(List.of(newStubs.get(0), newStubs.get(2), newStubs.get(3)));\n    verifyNoMoreInteractions(mappingsSource);\n  }\n\n  @Test\n  void removesAllPersistedStubsWhenNoImportedStubsAreSetToPersistAndNonImportedStubsAreDeleted() {\n    wm.addStubMapping(get(\"/existing/stub\").persistent(true).willReturn(ok()).build());\n    wm.addStubMapping(\n        put(\"/another/existing/stub\").persistent(true).willReturn(noContent()).build());\n\n    clearInvocations(mappingsSource);\n\n    List<StubMapping> newStubs =\n        List.of(\n            get(\"/\").persistent(false).willReturn(ok()).build(),\n            get(\"/do/not/persist\").willReturn(ok()).persistent(false).build());\n    wm.importStubs(\n        new StubImport(newStubs, new StubImport.Options(DuplicatePolicy.OVERWRITE, true)));\n    verify(mappingsSource, times(1)).setAll(List.of());\n    verifyNoMoreInteractions(mappingsSource);\n  }\n\n  @Test\n  void savesNothingWhenNoStubsAreSetToPersist() {\n    StubMapping existingStub = get(\"/existing/stub\").persistent(true).willReturn(ok()).build();\n    wm.importStubs(new StubImport(List.of(existingStub), StubImport.Options.DEFAULTS));\n    verify(mappingsSource, times(1)).save(List.of(existingStub));\n\n    clearInvocations(mappingsSource);\n\n    List<StubMapping> newStubs =\n        List.of(\n            get(\"/\").persistent(false).willReturn(ok()).build(),\n            get(\"/do/not/persist\").willReturn(ok()).persistent(false).build());\n    wm.importStubs(new StubImport(newStubs, StubImport.Options.DEFAULTS));\n    verifyNoInteractions(mappingsSource);\n  }\n\n  @Test\n  void keepsIgnoredStubsWhenAllOtherNonImportedStubsAreDeleted() {\n    StubMapping existingStub1 = wm.stubFor(get(\"/1\").persistent().willReturn(ok()));\n    wm.stubFor(get(\"/2\").persistent().willReturn(ok()));\n\n    clearInvocations(mappingsSource);\n    var newStub2 = post(\"/three\").persistent().willReturn(ok()).build();\n    wm.importStubs(\n        StubImport.stubImport()\n            .stub(get(\"/one\").persistent().withId(existingStub1.getId()).willReturn(ok()))\n            .stub(newStub2)\n            .ignoreExisting()\n            .deleteAllExistingStubsNotInImport()\n            .build());\n    verify(mappingsSource, times(1)).setAll(List.of(newStub2, existingStub1));\n    verifyNoMoreInteractions(mappingsSource);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/StubMappingOrMappingsTest.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.exc.MismatchedInputException;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport org.junit.jupiter.api.Test;\n\npublic class StubMappingOrMappingsTest {\n\n  @Test\n  public void jacksonEmitsCorrectPointerWhenDeserializingCollection() {\n    var stubMappingsJson =\n        \"\"\"\n        {\n          \"mappings\": [\n            {\n              \"request\": {\n                \"method\": \"GET\"\n              }\n            },\n            {\n              \"response\": {\n                \"status\": \"not a number\"\n              }\n            }\n          ]\n        }\n        \"\"\";\n    MismatchedInputException mismatchedInputException =\n        assertThrows(\n            MismatchedInputException.class,\n            () -> Json.getObjectMapper().readValue(stubMappingsJson, StubMappingCollection.class));\n    assertThat(\n        ((JsonParser) mismatchedInputException.getProcessor())\n            .getParsingContext()\n            .pathAsPointer()\n            .toString(),\n        is(\"/mappings/1/response/status\"));\n  }\n\n  @Test\n  public void jacksonEmitsCorrectPointerWhenDeserializingMapping() {\n    var stubMappingJson =\n        \"\"\"\n        {\n          \"response\": {\n            \"status\": \"not a number\"\n          }\n        }\n        \"\"\";\n    MismatchedInputException mismatchedInputException =\n        assertThrows(\n            MismatchedInputException.class,\n            () -> Json.getObjectMapper().readValue(stubMappingJson, StubMapping.class));\n    assertThat(\n        ((JsonParser) mismatchedInputException.getProcessor())\n            .getParsingContext()\n            .pathAsPointer()\n            .toString(),\n        is(\"/response/status\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/stubbing/StubMappingTest.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.matching.RequestPattern.ANYTHING;\nimport static java.util.stream.Collectors.toMap;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.anEmptyMap;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.empty;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\nimport static org.hamcrest.Matchers.nullValue;\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.PostServeActionDefinition;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListenerDefinition;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\n\npublic class StubMappingTest {\n\n  @Test\n  public void excludesInsertionIndexFromPublicView() {\n    StubMapping stub = get(\"/saveable\").willReturn(ok()).build();\n\n    String json = Json.write(stub);\n    System.out.println(json);\n\n    assertThat(json, not(containsString(\"insertionIndex\")));\n  }\n\n  @Test\n  public void includedInsertionIndexInPrivateView() {\n    StubMapping stub = get(\"/saveable\").willReturn(ok()).build();\n\n    String json = Json.writePrivate(stub);\n    System.out.println(json);\n\n    assertThat(json, containsString(\"insertionIndex\"));\n  }\n\n  @Test\n  public void deserialisesInsertionIndex() {\n    String json =\n        // language=json\n        \"{\\n\"\n            + \"    \\\"request\\\": {\\n\"\n            + \"        \\\"method\\\": \\\"ANY\\\",\\n\"\n            + \"        \\\"url\\\": \\\"/\\\"\\n\"\n            + \"    },\\n\"\n            + \"    \\\"response\\\": {\\n\"\n            + \"        \\\"status\\\": 200\\n\"\n            + \"    },\\n\"\n            + \"    \\\"insertionIndex\\\": 42\\n\"\n            + \"}\";\n\n    StubMapping stub = Json.read(json, StubMapping.class);\n\n    assertThat(stub.getInsertionIndex(), is(42L));\n  }\n\n  @Test\n  public void ignoresUuidProperty() {\n    String json =\n        // language=json\n        \"\"\"\n            {\n              \"id\": \"edf19376-0e08-4b27-8632-fb7852c9e62d\",\n              \"request\": {\n                \"url\": \"/\",\n                \"method\": \"GET\"\n              },\n\n              \"response\": {\n                \"status\": 200\n              },\n\n              \"uuid\": \"07150a3a-47ea-4182-9792-c49eb77b862e\"\n            }\n            \"\"\";\n\n    StubMapping stub = assertDoesNotThrow(() -> Json.read(json, StubMapping.class));\n\n    assertThat(stub.getId().toString(), is(\"edf19376-0e08-4b27-8632-fb7852c9e62d\"));\n  }\n\n  @Test\n  public void canBeDeeplyTransformed() {\n    StubMapping stub =\n        get(\"/transformable\")\n            .withHeader(\"One\", equalTo(\"1\"))\n            .withHeader(\"Two\", containing(\"2\"))\n            .willReturn(okJson(\"{}\").withHeader(\"To-Remove\", \"xxx\"))\n            .build();\n\n    StubMapping transformed =\n        stub.transform(\n            stubBuilder ->\n                stubBuilder\n                    .setName(\"Transformed stub\")\n                    .setPriority(8)\n                    .request(\n                        requestBuilder ->\n                            requestBuilder\n                                .setUrl(urlPathEqualTo(\"/transformed\"))\n                                .setMethod(RequestMethod.POST)\n                                .setHeaders(\n                                    requestBuilder.getHeaders().entrySet().stream()\n                                        .filter(e -> !e.getKey().equals(\"Two\"))\n                                        .collect(toMap(Map.Entry::getKey, Map.Entry::getValue))))\n                    .response(\n                        responseBuilder ->\n                            responseBuilder.headers(\n                                headersBuilder ->\n                                    headersBuilder.remove(\"To-Remove\").add(\"To-Add\", \"yyy\"))));\n\n    assertThat(transformed.getName(), is(\"Transformed stub\"));\n    assertThat(transformed.getPriority(), is(8));\n\n    assertThat(transformed.getRequest().getHeaders().get(\"Two\"), nullValue());\n\n    assertThat(\n        transformed.getResponse().getHeaders().getHeader(\"To-Remove\").isPresent(), is(false));\n    assertThat(transformed.getResponse().getHeaders().getHeader(\"To-Add\").firstValue(), is(\"yyy\"));\n  }\n\n  @Test\n  void stringFormIsJson() {\n    StubMapping stub = get(\"/foo\").withHeader(\"One\", equalTo(\"1\")).willReturn(okJson(\"{}\")).build();\n\n    assertThat(\n        stub.toString(),\n        jsonEquals(\n            \"\"\"\n            {\n              \"id\": \"${json-unit.any-string}\",\n              \"request\": {\n                \"headers\": {\n                  \"One\": {\n                    \"equalTo\": \"1\"\n                  }\n                },\n                \"method\": \"GET\",\n                \"url\": \"/foo\"\n              },\n              \"response\": {\n                \"body\": \"{}\",\n                \"headers\": {\n                  \"Content-Type\": \"application/json\"\n                },\n                \"status\": 200\n              }\n            }\n            \"\"\"));\n  }\n\n  @Test\n  public void postServeActionsListIsImmutable() {\n    var postServeActionDefinitions = new ArrayList<PostServeActionDefinition>();\n    var builder1 = StubMapping.builder();\n    postServeActionDefinitions.add(\n        new PostServeActionDefinition(\"def-1\", Parameters.one(\"param1\", \"value1\")));\n    builder1.setPostServeActions(postServeActionDefinitions);\n\n    var stub1 = builder1.build();\n    assertThat(stub1.getPostServeActions(), hasSize(1));\n    assertThat(stub1.getPostServeActions().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getPostServeActions().get(0).getParameters(), is(Parameters.one(\"param1\", \"value1\")));\n\n    postServeActionDefinitions.clear();\n\n    assertThat(stub1.getPostServeActions(), hasSize(1));\n    assertThat(stub1.getPostServeActions().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getPostServeActions().get(0).getParameters(), is(Parameters.one(\"param1\", \"value1\")));\n\n    builder1.getPostServeActions().clear();\n\n    assertThat(stub1.getPostServeActions(), hasSize(1));\n    assertThat(stub1.getPostServeActions().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getPostServeActions().get(0).getParameters(), is(Parameters.one(\"param1\", \"value1\")));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () ->\n            stub1\n                .getPostServeActions()\n                .add(new PostServeActionDefinition(\"def-2\", Parameters.empty())));\n\n    assertThat(stub1.getPostServeActions(), hasSize(1));\n    assertThat(stub1.getPostServeActions().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getPostServeActions().get(0).getParameters(), is(Parameters.one(\"param1\", \"value1\")));\n\n    var builder2 = stub1.toBuilder();\n    builder2.getPostServeActions().add(new PostServeActionDefinition(\"def-2\", Parameters.empty()));\n    var stub2 = builder2.build();\n\n    assertThat(stub1.getPostServeActions(), hasSize(1));\n    assertThat(stub1.getPostServeActions().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getPostServeActions().get(0).getParameters(), is(Parameters.one(\"param1\", \"value1\")));\n\n    assertThat(stub2.getPostServeActions(), hasSize(2));\n    assertThat(stub2.getPostServeActions().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub2.getPostServeActions().get(0).getParameters(), is(Parameters.one(\"param1\", \"value1\")));\n    assertThat(stub2.getPostServeActions().get(1).getName(), is(\"def-2\"));\n    assertThat(stub2.getPostServeActions().get(1).getParameters(), is(Parameters.empty()));\n  }\n\n  @Test\n  public void serveEventListenersListIsImmutable() {\n    var serveEventListenerDefinitions = new ArrayList<ServeEventListenerDefinition>();\n    var builder1 = StubMapping.builder();\n    serveEventListenerDefinitions.add(\n        new ServeEventListenerDefinition(\"def-1\", Parameters.one(\"param1\", \"value1\")));\n    builder1.setServeEventListeners(serveEventListenerDefinitions);\n\n    var stub1 = builder1.build();\n    assertThat(stub1.getServeEventListeners(), hasSize(1));\n    assertThat(stub1.getServeEventListeners().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getServeEventListeners().get(0).getParameters(),\n        is(Parameters.one(\"param1\", \"value1\")));\n\n    serveEventListenerDefinitions.clear();\n\n    assertThat(stub1.getServeEventListeners(), hasSize(1));\n    assertThat(stub1.getServeEventListeners().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getServeEventListeners().get(0).getParameters(),\n        is(Parameters.one(\"param1\", \"value1\")));\n\n    assertThrows(\n        UnsupportedOperationException.class,\n        () ->\n            stub1\n                .getServeEventListeners()\n                .add(new ServeEventListenerDefinition(\"def-2\", Parameters.empty())));\n\n    assertThat(stub1.getServeEventListeners(), hasSize(1));\n    assertThat(stub1.getServeEventListeners().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getServeEventListeners().get(0).getParameters(),\n        is(Parameters.one(\"param1\", \"value1\")));\n\n    builder1.getServeEventListeners().clear();\n\n    assertThat(stub1.getServeEventListeners(), hasSize(1));\n    assertThat(stub1.getServeEventListeners().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getServeEventListeners().get(0).getParameters(),\n        is(Parameters.one(\"param1\", \"value1\")));\n\n    var builder2 = stub1.toBuilder();\n    builder2\n        .getServeEventListeners()\n        .add(new ServeEventListenerDefinition(\"def-2\", Parameters.empty()));\n    var stub2 = builder2.build();\n\n    assertThat(stub1.getServeEventListeners(), hasSize(1));\n    assertThat(stub1.getServeEventListeners().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub1.getServeEventListeners().get(0).getParameters(),\n        is(Parameters.one(\"param1\", \"value1\")));\n\n    assertThat(stub2.getServeEventListeners(), hasSize(2));\n    assertThat(stub2.getServeEventListeners().get(0).getName(), is(\"def-1\"));\n    assertThat(\n        stub2.getServeEventListeners().get(0).getParameters(),\n        is(Parameters.one(\"param1\", \"value1\")));\n    assertThat(stub2.getServeEventListeners().get(1).getName(), is(\"def-2\"));\n    assertThat(stub2.getServeEventListeners().get(1).getParameters(), is(Parameters.empty()));\n  }\n\n  @Test\n  public void postServeActionsCannotBeNull() {\n    var builder = StubMapping.builder();\n    assertThat(builder.getPostServeActions(), empty());\n    assertThrows(NullPointerException.class, () -> builder.setPostServeActions(null));\n    assertThat(builder.getPostServeActions(), empty());\n    assertThat(builder.build().getPostServeActions(), empty());\n    var stub =\n        new StubMapping(\n            UUID.randomUUID(),\n            \"whatever\",\n            false,\n            ANYTHING,\n            ResponseDefinition.ok(),\n            null,\n            null,\n            null,\n            null,\n            null,\n            null,\n            null,\n            0);\n    assertThat(stub.getPostServeActions(), empty());\n  }\n\n  @Test\n  public void serveEventListenersCannotBeNull() {\n    var builder = StubMapping.builder();\n    assertThat(builder.getServeEventListeners(), empty());\n    assertThrows(NullPointerException.class, () -> builder.setServeEventListeners(null));\n    assertThat(builder.getServeEventListeners(), empty());\n    assertThat(builder.build().getServeEventListeners(), empty());\n    var stub =\n        new StubMapping(\n            UUID.randomUUID(),\n            \"whatever\",\n            false,\n            ANYTHING,\n            ResponseDefinition.ok(),\n            null,\n            null,\n            null,\n            null,\n            null,\n            null,\n            null,\n            0);\n    assertThat(stub.getServeEventListeners(), empty());\n  }\n\n  @Test\n  public void metadataCannotBeNull() {\n    var builder = StubMapping.builder();\n    assertThat(builder.getMetadata(), anEmptyMap());\n    assertThrows(NullPointerException.class, () -> builder.setMetadata(null));\n    assertThat(builder.getMetadata(), anEmptyMap());\n    assertThat(builder.build().getMetadata(), anEmptyMap());\n    var stub =\n        new StubMapping(\n            UUID.randomUUID(),\n            \"whatever\",\n            false,\n            ANYTHING,\n            ResponseDefinition.ok(),\n            null,\n            null,\n            null,\n            null,\n            null,\n            null,\n            null,\n            0);\n    assertThat(stub.getMetadata(), anEmptyMap());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/verification/InMemoryMessageJournalTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matching;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.*;\n\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.Message;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport java.time.Duration;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\nimport java.util.concurrent.CountDownLatch;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.TimeUnit;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class InMemoryMessageJournalTest {\n\n  private MessageServeEvent event1, event2, event3;\n\n  private static Message message(String text) {\n    return MessageStubRequestHandler.resolveToMessage(MessageDefinition.fromString(text), null);\n  }\n\n  @BeforeEach\n  public void createTestEvents() {\n    event1 =\n        MessageServeEvent.receivedUnmatched(\n            ChannelType.WEBSOCKET,\n            UUID.randomUUID(),\n            mockRequest().url(\"/channel1\"),\n            message(\"message1\"));\n    event2 =\n        MessageServeEvent.receivedUnmatched(\n            ChannelType.WEBSOCKET,\n            UUID.randomUUID(),\n            mockRequest().url(\"/channel2\"),\n            message(\"message2\"));\n    event3 =\n        MessageServeEvent.receivedUnmatched(\n            ChannelType.WEBSOCKET,\n            UUID.randomUUID(),\n            mockRequest().url(\"/channel3\"),\n            message(\"message3\"));\n  }\n\n  @Test\n  public void returnsAllLoggedEventsWhenNoJournalSizeLimit() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    journal.messageReceived(event1);\n    journal.messageReceived(event1);\n    journal.messageReceived(event2);\n\n    assertThat(journal.countEventsMatching(MessagePattern.ANYTHING), is(3));\n    assertThat(\n        journal.countEventsMatching(\n            MessagePattern.messagePattern().withBody(equalTo(\"message1\")).build()),\n        is(2));\n    assertThat(\n        journal.countEventsMatching(\n            MessagePattern.messagePattern().withBody(equalTo(\"message2\")).build()),\n        is(1));\n  }\n\n  @Test\n  public void resettingTheJournalClearsAllEntries() {\n    MessageJournal journal = new InMemoryMessageJournal(1);\n    journal.messageReceived(event1);\n    assertThat(journal.countEventsMatching(MessagePattern.ANYTHING), is(1));\n    journal.reset();\n    assertThat(journal.countEventsMatching(MessagePattern.ANYTHING), is(0));\n  }\n\n  @Test\n  public void discardsOldEventsWhenJournalSizeIsLimited() {\n    MessageJournal journal = new InMemoryMessageJournal(2);\n\n    journal.messageReceived(event1);\n    journal.messageReceived(event2);\n\n    assertThat(journal.countEventsMatching(MessagePattern.ANYTHING), is(2));\n    assertThat(\n        journal.countEventsMatching(\n            MessagePattern.messagePattern().withBody(equalTo(\"message1\")).build()),\n        is(1));\n    assertThat(\n        journal.countEventsMatching(\n            MessagePattern.messagePattern().withBody(equalTo(\"message2\")).build()),\n        is(1));\n\n    journal.messageReceived(event3);\n    assertOnlyLastTwoEventsLeft(journal);\n  }\n\n  @Test\n  public void getEventsMatchingReturnsMatchingEvents() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    journal.messageReceived(event1);\n    journal.messageReceived(event2);\n    journal.messageReceived(event3);\n\n    List<MessageServeEvent> matching =\n        journal.getEventsMatching(\n            MessagePattern.messagePattern().withBody(matching(\"message.*\")).build());\n    assertThat(matching, hasSize(3));\n\n    List<MessageServeEvent> matchingOne =\n        journal.getEventsMatching(\n            MessagePattern.messagePattern().withBody(equalTo(\"message2\")).build());\n    assertThat(matchingOne, hasSize(1));\n    assertThat(matchingOne.get(0).getMessage().getBodyAsString(), is(\"message2\"));\n  }\n\n  @Test\n  public void getAllMessageServeEventsReturnsAllEvents() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    journal.messageReceived(event1);\n    journal.messageReceived(event2);\n\n    List<MessageServeEvent> all = journal.getAllMessageServeEvents();\n    assertThat(all, hasSize(2));\n  }\n\n  @Test\n  public void getMessageServeEventByIdReturnsCorrectEvent() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    journal.messageReceived(event1);\n    journal.messageReceived(event2);\n\n    Optional<MessageServeEvent> found = journal.getMessageServeEvent(event1.getId());\n    assertThat(found.isPresent(), is(true));\n    assertThat(found.get().getId(), is(event1.getId()));\n\n    Optional<MessageServeEvent> notFound = journal.getMessageServeEvent(UUID.randomUUID());\n    assertThat(notFound.isPresent(), is(false));\n  }\n\n  @Test\n  public void removeEventRemovesSpecificEvent() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    journal.messageReceived(event1);\n    journal.messageReceived(event2);\n\n    journal.removeEvent(event1.getId());\n\n    assertThat(journal.countEventsMatching(MessagePattern.ANYTHING), is(1));\n    assertThat(journal.getMessageServeEvent(event1.getId()).isPresent(), is(false));\n    assertThat(journal.getMessageServeEvent(event2.getId()).isPresent(), is(true));\n  }\n\n  @Test\n  public void removeEventsMatchingRemovesMatchingEvents() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    journal.messageReceived(event1);\n    journal.messageReceived(event2);\n    journal.messageReceived(event3);\n\n    List<MessageServeEvent> removed =\n        journal.removeEventsMatching(\n            MessagePattern.messagePattern().withBody(equalTo(\"message2\")).build());\n\n    assertThat(removed, hasSize(1));\n    assertThat(removed.get(0).getMessage().getBodyAsString(), is(\"message2\"));\n    assertThat(journal.countEventsMatching(MessagePattern.ANYTHING), is(2));\n  }\n\n  @Test\n  public void waitForEventReturnsImmediatelyIfEventExists() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    journal.messageReceived(event1);\n\n    Optional<MessageServeEvent> found =\n        journal.waitForEvent(\n            MessagePattern.messagePattern().withBody(equalTo(\"message1\")).build(),\n            Duration.ofSeconds(1));\n\n    assertThat(found.isPresent(), is(true));\n    assertThat(found.get().getMessage().getBodyAsString(), is(\"message1\"));\n  }\n\n  @Test\n  public void waitForEventReturnsEmptyIfNoMatchAndTimeout() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    Optional<MessageServeEvent> found =\n        journal.waitForEvent(\n            MessagePattern.messagePattern().withBody(equalTo(\"nonexistent\")).build(),\n            Duration.ofMillis(100));\n\n    assertThat(found.isPresent(), is(false));\n  }\n\n  @Test\n  public void waitForEventWaitsForNewEvent() throws Exception {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n    CountDownLatch latch = new CountDownLatch(1);\n    final Optional<MessageServeEvent>[] result = new Optional[] {Optional.empty()};\n\n    ExecutorService executor = Executors.newSingleThreadExecutor();\n    executor.submit(\n        () -> {\n          result[0] =\n              journal.waitForEvent(\n                  MessagePattern.messagePattern().withBody(equalTo(\"message1\")).build(),\n                  Duration.ofSeconds(5));\n          latch.countDown();\n        });\n\n    // Give the wait thread time to start\n    Thread.sleep(100);\n\n    // Add the event\n    journal.messageReceived(event1);\n\n    // Wait for the result\n    boolean completed = latch.await(2, TimeUnit.SECONDS);\n    executor.shutdown();\n\n    assertThat(completed, is(true));\n    assertThat(result[0].isPresent(), is(true));\n    assertThat(result[0].get().getMessage().getBodyAsString(), is(\"message1\"));\n  }\n\n  @Test\n  public void waitForEventsReturnsImmediatelyIfEnoughEventsExist() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    journal.messageReceived(event1);\n    journal.messageReceived(event2);\n\n    List<MessageServeEvent> found =\n        journal.waitForEvents(MessagePattern.ANYTHING, 2, Duration.ofSeconds(1));\n\n    assertThat(found, hasSize(2));\n  }\n\n  @Test\n  public void waitForEventsReturnsPartialIfTimeoutBeforeEnoughEvents() {\n    MessageJournal journal = new InMemoryMessageJournal(null);\n\n    journal.messageReceived(event1);\n\n    List<MessageServeEvent> found =\n        journal.waitForEvents(MessagePattern.ANYTHING, 5, Duration.ofMillis(100));\n\n    assertThat(found, hasSize(1));\n  }\n\n  @Test\n  public void matchedEventContainsStubMapping() {\n    MessageStubMapping stub = MessageStubMapping.builder().withName(\"Test stub\").build();\n\n    MessageServeEvent matchedEvent =\n        MessageServeEvent.receivedMatched(\n            ChannelType.WEBSOCKET,\n            UUID.randomUUID(),\n            mockRequest().url(\"/channel\"),\n            message(\"test message\"),\n            stub);\n\n    assertThat(matchedEvent.getWasMatched(), is(true));\n    assertThat(matchedEvent.getStubMapping(), is(notNullValue()));\n    assertThat(matchedEvent.getStubMapping().getName(), is(\"Test stub\"));\n  }\n\n  @Test\n  public void unmatchedEventHasNoStubMapping() {\n    assertThat(event1.getWasMatched(), is(false));\n    assertThat(event1.getStubMapping(), is(nullValue()));\n  }\n\n  @Test\n  public void sentEventHasCorrectEventType() {\n    MessageServeEvent sentEvent =\n        MessageServeEvent.sent(\n            ChannelType.WEBSOCKET,\n            UUID.randomUUID(),\n            mockRequest().url(\"/channel\"),\n            message(\"sent message\"));\n\n    assertThat(sentEvent.isSent(), is(true));\n    assertThat(sentEvent.isReceived(), is(false));\n    assertThat(sentEvent.getEventType(), is(MessageServeEvent.EventType.SENT));\n  }\n\n  @Test\n  public void receivedEventHasCorrectEventType() {\n    assertThat(event1.isReceived(), is(true));\n    assertThat(event1.isSent(), is(false));\n    assertThat(event1.getEventType(), is(MessageServeEvent.EventType.RECEIVED));\n  }\n\n  private void assertOnlyLastTwoEventsLeft(MessageJournal journal) {\n    assertThat(\n        journal.countEventsMatching(\n            MessagePattern.messagePattern().withBody(equalTo(\"message1\")).build()),\n        is(0));\n    assertThat(\n        journal.countEventsMatching(\n            MessagePattern.messagePattern().withBody(equalTo(\"message2\")).build()),\n        is(1));\n    assertThat(\n        journal.countEventsMatching(\n            MessagePattern.messagePattern().withBody(equalTo(\"message3\")).build()),\n        is(1));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/verification/InMemoryRequestJournalTest.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.matching.RequestMatcherExtension.ALWAYS;\nimport static com.github.tomakehurst.wiremock.testsupport.MockRequestBuilder.aRequest;\nimport static com.github.tomakehurst.wiremock.verification.LoggedRequest.createFrom;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Collections;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class InMemoryRequestJournalTest {\n\n  static final Map<String, RequestMatcherExtension> NO_CUSTOM_MATCHERS = Collections.emptyMap();\n\n  private ServeEvent serveEvent1, serveEvent2, serveEvent3;\n\n  @BeforeEach\n  public void createTestRequests() {\n    serveEvent1 = ServeEvent.of(createFrom(aRequest(\"log1\").withUrl(\"/logging1\").build()));\n    serveEvent2 = ServeEvent.of(createFrom(aRequest(\"log2\").withUrl(\"/logging2\").build()));\n    serveEvent3 = ServeEvent.of(createFrom(aRequest(\"log3\").withUrl(\"/logging3\").build()));\n  }\n\n  @Test\n  public void returnsAllLoggedRequestsWhenNoJournalSizeLimit() {\n    RequestJournal journal = new InMemoryRequestJournal(null, NO_CUSTOM_MATCHERS);\n\n    journal.requestReceived(serveEvent1);\n    journal.requestReceived(serveEvent1);\n    journal.requestReceived(serveEvent2);\n\n    assertThat(\n        journal.countRequestsMatching(getRequestedFor(urlEqualTo(\"/logging1\")).build()), is(2));\n    assertThat(\n        journal.countRequestsMatching(getRequestedFor(urlEqualTo(\"/logging2\")).build()), is(1));\n  }\n\n  @Test\n  public void resettingTheJournalClearsAllEntries() throws Exception {\n    LoggedRequest loggedRequest = createFrom(aRequest().withUrl(\"/for/logging\").build());\n\n    RequestJournal journal = new InMemoryRequestJournal(1, NO_CUSTOM_MATCHERS);\n    journal.requestReceived(ServeEvent.of(loggedRequest));\n    assertThat(journal.countRequestsMatching(RequestPattern.ANYTHING), is(1));\n    journal.reset();\n    assertThat(journal.countRequestsMatching(RequestPattern.ANYTHING), is(0));\n  }\n\n  @Test\n  public void discardsOldRequestsWhenJournalSizeIsLimited() throws Exception {\n    RequestJournal journal = new InMemoryRequestJournal(2, NO_CUSTOM_MATCHERS);\n\n    journal.requestReceived(serveEvent1);\n    journal.requestReceived(serveEvent2);\n\n    assertThat(journal.countRequestsMatching(RequestPattern.ANYTHING), is(2));\n    assertThat(\n        journal.countRequestsMatching(getRequestedFor(urlEqualTo(\"/logging1\")).build()), is(1));\n    assertThat(\n        journal.countRequestsMatching(getRequestedFor(urlEqualTo(\"/logging2\")).build()), is(1));\n\n    journal.requestReceived(serveEvent3);\n    assertOnlyLastTwoRequestsLeft(journal);\n  }\n\n  @Test\n  public void matchesRequestWithCustomMatcherDefinition() throws Exception {\n    RequestJournal journal = new InMemoryRequestJournal(null, Map.of(ALWAYS.getName(), ALWAYS));\n\n    journal.requestReceived(serveEvent1);\n    journal.requestReceived(serveEvent2);\n\n    assertThat(\n        journal.countRequestsMatching(requestMadeFor(ALWAYS.getName(), Parameters.empty()).build()),\n        is(2));\n    assertThat(\n        journal.countRequestsMatching(requestMadeFor(\"not-existing\", Parameters.empty()).build()),\n        is(0));\n\n    assertThat(\n        journal\n            .getRequestsMatching(requestMadeFor(ALWAYS.getName(), Parameters.empty()).build())\n            .size(),\n        is(2));\n    assertThat(\n        journal\n            .getRequestsMatching(requestMadeFor(\"not-existing\", Parameters.empty()).build())\n            .size(),\n        is(0));\n  }\n\n  private void assertOnlyLastTwoRequestsLeft(RequestJournal journal) {\n    assertThat(\n        journal.countRequestsMatching(getRequestedFor(urlEqualTo(\"/logging1\")).build()), is(0));\n    assertThat(\n        journal.countRequestsMatching(getRequestedFor(urlEqualTo(\"/logging2\")).build()), is(1));\n    assertThat(\n        journal.countRequestsMatching(getRequestedFor(urlEqualTo(\"/logging3\")).build()), is(1));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/verification/LoggedRequestTest.java",
    "content": "/*\n * Copyright (C) 2012-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static com.github.tomakehurst.wiremock.testsupport.MockRequestBuilder.aRequest;\nimport static com.github.tomakehurst.wiremock.verification.LoggedRequest.createFrom;\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.github.tomakehurst.wiremock.common.Dates;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.http.Cookie;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport java.io.IOException;\nimport java.util.Date;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.Test;\nimport org.skyscreamer.jsonassert.JSONAssert;\n\n@SuppressWarnings(\"rawtypes\")\npublic class LoggedRequestTest {\n\n  public static final String REQUEST_BODY = \"some text 形声字形聲字\";\n  public static final String REQUEST_BODY_AS_BASE64 = \"c29tZSB0ZXh0IOW9ouWjsOWtl+W9ouiBsuWtlw==\";\n\n  @Test\n  void headerMatchingIsCaseInsensitive() {\n    LoggedRequest loggedRequest =\n        createFrom(\n            aRequest()\n                .withUrl(\"/for/logging\")\n                .withMethod(POST)\n                .withClientIp(\"14.07.17.89\")\n                .withBody(REQUEST_BODY)\n                .withBodyAsBase64(REQUEST_BODY_AS_BASE64)\n                .withHeader(\"Content-Type\", \"text/plain\")\n                .withHeader(\"ACCEPT\", \"application/json\")\n                .build());\n\n    assertTrue(loggedRequest.containsHeader(\"content-type\"));\n    assertNotNull(loggedRequest.getHeader(\"content-type\"));\n    assertTrue(loggedRequest.containsHeader(\"CONTENT-TYPE\"));\n    assertNotNull(loggedRequest.getHeader(\"CONTENT-TYPE\"));\n    assertTrue(loggedRequest.containsHeader(\"Accept\"));\n    assertNotNull(loggedRequest.getHeader(\"Accept\"));\n  }\n\n  static final String DATE = \"2012-06-07T16:39:41Z\";\n  static final String JSON_EXAMPLE =\n      \"{\\n\"\n          + \"      \\\"url\\\" : \\\"/my/url\\\",\\n\"\n          + \"      \\\"absoluteUrl\\\" : \\\"http://mydomain.com/my/url\\\",\\n\"\n          + \"      \\\"method\\\" : \\\"GET\\\",\\n\"\n          + \"      \\\"clientIp\\\" : \\\"25.10.18.11\\\",\\n\"\n          + \"      \\\"headers\\\" : {\\n\"\n          + \"        \\\"Accept-Language\\\" : \\\"en-us,en;q=0.5\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"cookies\\\" : {\\n\"\n          + \"        \\\"first_cookie\\\"   : \\\"yum\\\",\\n\"\n          + \"        \\\"monster_cookie\\\" : \\\"COOKIIIEESS\\\"\\n\"\n          + \"      },\\n\"\n          + \"      \\\"browserProxyRequest\\\" : true,\\n\"\n          + \"      \\\"loggedDate\\\" : %d,\\n\"\n          + \"      \\\"bodyAsBase64\\\" : \\\"\"\n          + REQUEST_BODY_AS_BASE64\n          + \"\\\",\\n\"\n          + \"      \\\"body\\\" : \\\"\"\n          + REQUEST_BODY\n          + \"\\\",\\n\"\n          + \"      \\\"protocol\\\" : \\\"HTTP/1.1\\\",\\n\"\n          + \"      \\\"scheme\\\" : \\\"http\\\",\\n\"\n          + \"      \\\"host\\\" : \\\"mydomain.com\\\",\\n\"\n          + \"      \\\"port\\\" : 80,\\n\"\n          + \"      \\\"loggedDateString\\\" : \\\"\"\n          + DATE\n          + \"\\\",\\n\"\n          + \"      \\\"queryParams\\\" : { },\\n\"\n          + \"      \\\"formParams\\\" : { }\\n\"\n          + \"    }\";\n\n  @Test\n  void jsonRepresentation() throws Exception {\n    HttpHeaders headers = new HttpHeaders(httpHeader(\"Accept-Language\", \"en-us,en;q=0.5\"));\n    Map<String, Cookie> cookies =\n        Map.of(\"first_cookie\", new Cookie(\"yum\"), \"monster_cookie\", new Cookie(\"COOKIIIEESS\"));\n\n    Date loggedDate = Dates.parse(DATE);\n\n    LoggedRequest loggedRequest =\n        new LoggedRequest(\n            \"/my/url\",\n            \"http://mydomain.com/my/url\",\n            RequestMethod.GET,\n            \"25.10.18.11\",\n            headers,\n            cookies,\n            true,\n            loggedDate,\n            REQUEST_BODY_AS_BASE64,\n            null,\n            null,\n            \"HTTP/1.1\");\n\n    String expectedJson = String.format(JSON_EXAMPLE, loggedDate.getTime());\n\n    JSONAssert.assertEquals(expectedJson, Json.write(loggedRequest), false);\n  }\n\n  @Test\n  void bodyEncodedAsUTF8() {\n    LoggedRequest loggedRequest =\n        new LoggedRequest(\n            \"/my/url\",\n            \"http://mydomain.com/my/url\",\n            RequestMethod.GET,\n            null,\n            null,\n            null,\n            true,\n            null,\n            REQUEST_BODY_AS_BASE64,\n            null,\n            null,\n            \"HTTP/1.1\");\n\n    assertThat(loggedRequest.getBodyAsString(), is(equalTo(REQUEST_BODY)));\n  }\n\n  static final String JSON_PARAMS_EXAMPLE =\n      \"{\\n\"\n          + \"  \\\"url\\\" : \\\"/sample/path?test-param-1=value1&test-param-2=value2\\\",\\n\"\n          + \"  \\\"absoluteUrl\\\" : \\\"http://ex.ample/sample/path?test-param-1=value1&test-param-2=value2\\\",\\n\"\n          + \"  \\\"method\\\" : \\\"GET\\\",\\n\"\n          + \"  \\\"clientIp\\\" : \\\"0.0.0.0\\\",\\n\"\n          + \"  \\\"browserProxyRequest\\\" : true,\\n\"\n          + \"  \\\"loggedDate\\\" : 0,\\n\"\n          + \"  \\\"loggedDateString\\\" : \\\"1970-01-01T00:00:00Z\\\",\\n\"\n          + \"  \\\"queryParams\\\" : {\\n\"\n          + \"    \\\"test-param-1\\\" : {\\n\"\n          + \"      \\\"key\\\" : \\\"test-param-1\\\",\\n\"\n          + \"      \\\"values\\\" : [ \\\"value-1\\\" ]\\n\"\n          + \"    },\\n\"\n          + \"    \\\"test-param-2\\\" : {\\n\"\n          + \"      \\\"key\\\" : \\\"test-param-2\\\",\\n\"\n          + \"      \\\"values\\\" : [ \\\"value-2\\\" ]\\n\"\n          + \"    }\\n\"\n          + \"  }\\n\"\n          + \"}\";\n\n  @Test\n  void queryParametersAreSerialized() {\n    LoggedRequest req =\n        new LoggedRequest(\n            \"/sample/path?test-param-1=value-1&test-param-2=value-2\",\n            \"http://ex.ample/sample/path?test-param-1=value-1&test-param-2=value-2\",\n            RequestMethod.GET,\n            \"0.0.0.0\",\n            null,\n            null,\n            true,\n            new Date(0),\n            null,\n            null,\n            null,\n            \"HTTP/1.1\");\n\n    Map<String, Object> reqMap = Json.objectToMap(req);\n\n    assertTrue(reqMap.containsKey(\"queryParams\"));\n    assertEquals(\n        \"value-1\",\n        ((List) ((Map) ((Map) reqMap.get(\"queryParams\")).get(\"test-param-1\")).get(\"values\"))\n            .get(0));\n    assertEquals(\n        \"value-2\",\n        ((List) ((Map) ((Map) reqMap.get(\"queryParams\")).get(\"test-param-2\")).get(\"values\"))\n            .get(0));\n  }\n\n  @Test\n  void queryParametersAreDeserialized() throws IOException {\n    LoggedRequest req = new ObjectMapper().readValue(JSON_PARAMS_EXAMPLE, LoggedRequest.class);\n\n    assertEquals(\"test-param-1\", req.queryParameter(\"test-param-1\").key());\n    assertEquals(\"value-1\", req.queryParameter(\"test-param-1\").firstValue());\n\n    assertEquals(\"test-param-2\", req.queryParameter(\"test-param-2\").key());\n    assertEquals(\"value-2\", req.queryParameter(\"test-param-2\").firstValue());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/verification/LoggedResponseTest.java",
    "content": "/*\n * Copyright (C) 2017-2022 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.github.tomakehurst.wiremock.common.Limit.UNLIMITED;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.http.*;\nimport org.junit.jupiter.api.Test;\n\npublic class LoggedResponseTest {\n  private static String ISO_8859_1_RESPONSE_BODY = \"köttfärssås\";\n  private static String UTF8_RESPONSE_BODY = \"Foo © bar 𝌆 baz ☃ qux\";\n\n  @Test\n  public void returnsEmptyStringForBodyWhenNotConfigured() {\n    LoggedResponse loggedResponse = LoggedResponse.from(Response.notConfigured(), UNLIMITED);\n    assertEquals(loggedResponse.getBodyAsString(), \"\");\n  }\n\n  @Test\n  public void returnsEncodedStringForBodyWhenContentTypeHeaderGiven() {\n    LoggedResponse loggedResponse =\n        LoggedResponse.from(\n            Response.response()\n                .body(ISO_8859_1_RESPONSE_BODY)\n                .headers(\n                    new HttpHeaders(httpHeader(\"Content-Type\", \"text/plain; charset=iso-8859-1\")))\n                .build(),\n            UNLIMITED);\n    assertThat(ISO_8859_1_RESPONSE_BODY, is(equalTo(loggedResponse.getBodyAsString())));\n  }\n\n  @Test\n  public void returnsUtf8StringForBodyWhenContentTypeHeaderAbsent() {\n    LoggedResponse loggedResponse =\n        LoggedResponse.from(Response.response().body(UTF8_RESPONSE_BODY).build(), UNLIMITED);\n    assertThat(UTF8_RESPONSE_BODY, is(equalTo(loggedResponse.getBodyAsString())));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/verification/MessageSerializationTest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.any;\nimport static com.github.tomakehurst.wiremock.client.WireMock.binaryEqualTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.matching;\nimport static com.github.tomakehurst.wiremock.client.WireMock.sendMessage;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.notNullValue;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.entity.BinaryEntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.CompressionType;\nimport com.github.tomakehurst.wiremock.common.entity.FormatType;\nimport com.github.tomakehurst.wiremock.common.entity.TextEntityDefinition;\nimport com.github.tomakehurst.wiremock.matching.ContentPattern;\nimport com.github.tomakehurst.wiremock.matching.RegexPattern;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.message.ChannelTarget;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.HttpRequestTrigger;\nimport com.github.tomakehurst.wiremock.message.HttpStubTrigger;\nimport com.github.tomakehurst.wiremock.message.IncomingMessageTrigger;\nimport com.github.tomakehurst.wiremock.message.Message;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport com.github.tomakehurst.wiremock.message.RequestInitiatedChannelTarget;\nimport com.github.tomakehurst.wiremock.message.SendMessageAction;\nimport java.util.Map;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\n\npublic class MessageSerializationTest {\n\n  private static Message message(String text) {\n    return MessageStubRequestHandler.resolveToMessage(MessageDefinition.fromString(text), null);\n  }\n\n  @Test\n  void messageStubMappingSerializesToJson() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withId(UUID.fromString(\"d8e8fca2-dc0f-11db-8314-0800200c9a66\"))\n            .withName(\"Test message stub\")\n            .withPriority(3)\n            .onWebsocketChannelFromRequestMatching(newRequestPattern().withUrl(\"/test-channel\"))\n            .withBody(equalTo(\"hello\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"world\"))\n            .build();\n\n    String json = Json.write(stub);\n\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"id\": \"d8e8fca2-dc0f-11db-8314-0800200c9a66\",\n              \"name\": \"Test message stub\",\n              \"priority\": 3,\n              \"trigger\": {\n                \"type\": \"message\",\n                \"channel\": {\n                  \"type\": \"websocket\",\n                  \"initiatingRequestPattern\": {\n                    \"url\": \"/test-channel\",\n                    \"method\": \"ANY\"\n                  }\n                },\n                \"message\": {\n                  \"body\": {\n                    \"equalTo\": \"hello\"\n                  }\n                }\n              },\n              \"actions\": [\n                {\n                  \"type\": \"send\",\n                  \"message\": {\n                    \"body\": \"world\"\n                  },\n                  \"channelTarget\": {\n                    \"type\": \"originating\"\n                  }\n                }\n              ]\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void messageStubMappingDeserializesFromJson() {\n    String json =\n        // language=JSON\n        \"\"\"\n        {\n          \"id\": \"d8e8fca2-dc0f-11db-8314-0800200c9a66\",\n          \"name\": \"Deserialized stub\",\n          \"priority\": 5,\n          \"trigger\": {\n            \"channel\": {\n              \"type\": \"websocket\",\n              \"initiatingRequestPattern\": {\n                \"url\": \"/my-channel\"\n              }\n            },\n            \"message\": {\n              \"body\": {\n                \"matches\": \"hello.*\"\n              }\n            }\n          },\n          \"actions\": [\n            {\n              \"type\": \"send\",\n              \"message\": {\n                \"body\": \"response\"\n              },\n              \"channelTarget\": {\n                \"type\": \"originating\"\n              }\n            }\n          ]\n        }\n        \"\"\";\n\n    MessageStubMapping stub = Json.read(json, MessageStubMapping.class);\n\n    assertThat(stub.getId().toString(), is(\"d8e8fca2-dc0f-11db-8314-0800200c9a66\"));\n    assertThat(stub.getName(), is(\"Deserialized stub\"));\n    assertThat(stub.getPriority(), is(5));\n\n    assertThat(stub.getTrigger(), instanceOf(IncomingMessageTrigger.class));\n    IncomingMessageTrigger trigger = (IncomingMessageTrigger) stub.getTrigger();\n    assertThat(trigger.getInitiatingRequestPattern().getUrl(), is(\"/my-channel\"));\n\n    ContentPattern<?> bodyPattern = trigger.getBodyPattern();\n    assertThat(bodyPattern, notNullValue());\n    assertThat(bodyPattern, instanceOf(RegexPattern.class));\n    assertThat(bodyPattern.getExpected(), is(\"hello.*\"));\n\n    RequestPattern initiatingRequestPattern = trigger.getInitiatingRequestPattern();\n    assertThat(initiatingRequestPattern, notNullValue());\n    assertThat(initiatingRequestPattern, is(any(urlEqualTo(\"/my-channel\")).build().getRequest()));\n\n    assertThat(stub.getActions().size(), is(1));\n    assertThat(stub.getActions().get(0), is(SendMessageAction.toOriginatingChannel(\"response\")));\n  }\n\n  @Test\n  void messageStubMappingRoundTrips() {\n    MessageStubMapping original =\n        MessageStubMapping.builder()\n            .withName(\"Round trip stub\")\n            .onWebsocketChannelFromRequestMatching(newRequestPattern().withUrl(\"/round-trip\"))\n            .withBody(matching(\"test-.*\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"response\"))\n            .build();\n\n    String json = Json.write(original);\n    MessageStubMapping deserialized = Json.read(json, MessageStubMapping.class);\n\n    assertThat(deserialized.getId(), is(original.getId()));\n    assertThat(deserialized.getName(), is(original.getName()));\n\n    assertThat(deserialized.getTrigger(), instanceOf(IncomingMessageTrigger.class));\n    IncomingMessageTrigger trigger = (IncomingMessageTrigger) deserialized.getTrigger();\n    assertThat(trigger.getInitiatingRequestPattern().getUrl(), is(\"/round-trip\"));\n    assertThat(deserialized.getActions().size(), is(1));\n  }\n\n  @Test\n  void messageServeEventSerializesToJson() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withId(UUID.fromString(\"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"))\n            .withName(\"Matched stub\")\n            .withBody(equalTo(\"test\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(\"response\"))\n            .build();\n\n    MessageServeEvent event =\n        new MessageServeEvent.Builder()\n            .withId(UUID.fromString(\"eeeeeeee-ffff-0000-1111-222222222222\"))\n            .withEventType(MessageServeEvent.EventType.RECEIVED)\n            .withChannelType(ChannelType.WEBSOCKET)\n            .withChannelId(UUID.fromString(\"11111111-2222-3333-4444-555555555555\"))\n            .withMessage(message(\"test message\"))\n            .withStubMapping(stub)\n            .withWasMatched(true)\n            .withTimestamp(java.time.Instant.parse(\"2025-01-15T10:30:00Z\"))\n            .build();\n\n    String json = Json.write(event);\n\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"id\": \"eeeeeeee-ffff-0000-1111-222222222222\",\n              \"eventType\": \"received\",\n              \"channelType\": \"websocket\",\n              \"channelId\": \"11111111-2222-3333-4444-555555555555\",\n              \"message\": \"test message\",\n              \"wasMatched\": true,\n              \"timestamp\": \"2025-01-15T10:30:00Z\",\n              \"stubMapping\": {\n                \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                \"name\": \"Matched stub\",\n                \"trigger\": {\n                  \"type\": \"message\",\n                  \"message\": {\n                    \"body\": {\n                      \"equalTo\": \"test\"\n                    }\n                  }\n                },\n                \"actions\": [\n                  {\n                    \"type\": \"send\",\n                    \"message\": {\n                      \"body\": \"response\"\n                    },\n                    \"channelTarget\": {\n                      \"type\": \"originating\"\n                    }\n                  }\n                ]\n              }\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void messageServeEventDeserializesFromJson() {\n    String json =\n        // language=JSON\n        \"\"\"\n        {\n          \"id\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n          \"eventType\": \"received\",\n          \"channelType\": \"websocket\",\n          \"channelId\": \"11111111-2222-3333-4444-555555555555\",\n          \"message\": \"hello world\",\n          \"wasMatched\": false,\n          \"timestamp\": \"2025-01-15T10:30:00Z\"\n        }\n        \"\"\";\n\n    MessageServeEvent event = Json.read(json, MessageServeEvent.class);\n\n    assertThat(event.getId().toString(), is(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"));\n    assertThat(event.getEventType(), is(MessageServeEvent.EventType.RECEIVED));\n    assertThat(event.getChannelType(), is(ChannelType.WEBSOCKET));\n    assertThat(event.getChannelId().toString(), is(\"11111111-2222-3333-4444-555555555555\"));\n    assertThat(event.getMessage().getBodyAsString(), is(\"hello world\"));\n    assertThat(event.getWasMatched(), is(false));\n    assertThat(event.getTimestamp(), notNullValue());\n  }\n\n  @Test\n  void messageServeEventRoundTrips() {\n    MessageServeEvent original =\n        MessageServeEvent.receivedUnmatched(\n            ChannelType.WEBSOCKET,\n            UUID.fromString(\"99999999-8888-7777-6666-555555555555\"),\n            mockRequest().url(\"/unmatched-channel\"),\n            message(\"unmatched message\"));\n\n    String json = Json.write(original);\n    MessageServeEvent deserialized = Json.read(json, MessageServeEvent.class);\n\n    assertThat(deserialized.getId(), is(original.getId()));\n    assertThat(deserialized.getEventType(), is(MessageServeEvent.EventType.RECEIVED));\n    assertThat(deserialized.getChannelType(), is(ChannelType.WEBSOCKET));\n    assertThat(deserialized.getMessage().getBodyAsString(), is(\"unmatched message\"));\n    assertThat(deserialized.getWasMatched(), is(false));\n  }\n\n  @Test\n  void minimalMessageStubDoesNotContainEmptyElementsWhenSerialized() {\n    MessageStubMapping stub =\n        WireMock.message()\n            .withId(UUID.fromString(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"))\n            .onWebsocketChannelFromRequestMatching(\"/trigger\")\n            .willTriggerActions(sendMessage(\"response\").onOriginatingChannel());\n\n    String json = Json.write(stub);\n\n    assertThat(\n        \"JSON: \" + json,\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n                    {\n                      \"id\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n                      \"trigger\": {\n                        \"type\": \"message\",\n                        \"channel\": {\n                          \"type\": \"websocket\",\n                          \"initiatingRequestPattern\": {\n                            \"urlPath\": \"/trigger\",\n                            \"method\" : \"ANY\"\n                          }\n                        }\n                      },\n                      \"actions\": [\n                        {\n                          \"type\": \"send\",\n                          \"message\": {\n                            \"body\": {\n                              \"data\": \"response\"\n                            }\n                          },\n                          \"channelTarget\": {\n                            \"type\": \"originating\"\n                          }\n                        }\n                      ]\n                    }\n                    \"\"\"));\n  }\n\n  @Test\n  void messageStubMappingWithBroadcastActionSerializesCorrectly() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withId(UUID.fromString(\"bbbbbbbb-cccc-dddd-eeee-ffffffffffff\"))\n            .withName(\"Broadcast stub\")\n            .onWebsocketChannelFromRequestMatching(newRequestPattern().withUrl(\"/source\"))\n            .withBody(equalTo(\"broadcast\"))\n            .triggersAction(\n                SendMessageAction.toMatchingChannels(\n                    \"broadcasted\", newRequestPattern().withUrl(urlEqualTo(\"/target\")).build()))\n            .build();\n\n    String json = Json.write(stub);\n\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"id\": \"bbbbbbbb-cccc-dddd-eeee-ffffffffffff\",\n              \"name\": \"Broadcast stub\",\n              \"trigger\": {\n                \"type\": \"message\",\n                \"channel\": {\n                  \"type\": \"websocket\",\n                  \"initiatingRequestPattern\": {\n                    \"url\": \"/source\",\n                    \"method\": \"ANY\"\n                  }\n                },\n                \"message\": {\n                  \"body\": {\n                    \"equalTo\": \"broadcast\"\n                  }\n                }\n              },\n              \"actions\": [\n                {\n                  \"type\": \"send\",\n                  \"message\": {\n                    \"body\": \"broadcasted\"\n                  },\n                  \"channelTarget\": {\n                    \"type\": \"request-initiated\",\n                    \"requestPattern\": {\n                      \"url\": \"/target\",\n                      \"method\": \"ANY\"\n                    }\n                  }\n                }\n              ]\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void messageStubMappingWithBroadcastActionDeserializesCorrectly() {\n    String json =\n        // language=JSON\n        \"\"\"\n        {\n          \"name\": \"Broadcast deserialized\",\n          \"trigger\": {\n            \"channel\": {\n              \"type\": \"websocket\",\n              \"initiatingRequestPattern\": {\n                \"url\": \"/source\"\n              }\n            },\n            \"message\": {\n              \"body\": {\n                \"equalTo\": \"trigger\"\n              }\n            }\n          },\n          \"actions\": [\n            {\n              \"type\": \"send\",\n              \"message\": {\n                \"body\": \"broadcast-message\"\n              },\n              \"channelTarget\": {\n                \"type\": \"request-initiated\",\n                \"requestPattern\": {\n                  \"url\": \"/target-channel\"\n                }\n              }\n            }\n          ]\n        }\n        \"\"\";\n\n    MessageStubMapping stub = Json.read(json, MessageStubMapping.class);\n\n    assertThat(stub.getName(), is(\"Broadcast deserialized\"));\n    assertThat(stub.getActions().size(), is(1));\n\n    SendMessageAction action = (SendMessageAction) stub.getActions().get(0);\n    assertThat(action.getBody().getData(), is(\"broadcast-message\"));\n    ChannelTarget target = action.getChannelTarget();\n    assertThat(target, instanceOf(RequestInitiatedChannelTarget.class));\n    RequestInitiatedChannelTarget requestTarget = (RequestInitiatedChannelTarget) target;\n    assertThat(requestTarget.getRequestPattern().getUrl(), is(\"/target-channel\"));\n  }\n\n  @Test\n  void sentMessageServeEventSerializesCorrectly() {\n    MessageServeEvent event =\n        new MessageServeEvent.Builder()\n            .withId(UUID.fromString(\"22222222-3333-4444-5555-666666666666\"))\n            .withEventType(MessageServeEvent.EventType.SENT)\n            .withChannelType(ChannelType.WEBSOCKET)\n            .withChannelId(UUID.fromString(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"))\n            .withMessage(message(\"sent message\"))\n            .withWasMatched(true)\n            .withTimestamp(java.time.Instant.parse(\"2025-01-15T12:00:00Z\"))\n            .build();\n\n    String json = Json.write(event);\n\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"id\": \"22222222-3333-4444-5555-666666666666\",\n              \"eventType\": \"sent\",\n              \"channelType\": \"websocket\",\n              \"channelId\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n              \"message\": \"sent message\",\n              \"wasMatched\": true,\n              \"timestamp\": \"2025-01-15T12:00:00Z\"\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void sentMessageServeEventDeserializesCorrectly() {\n    String json =\n        \"\"\"\n        {\n          \"id\": \"bbbbbbbb-cccc-dddd-eeee-ffffffffffff\",\n          \"eventType\": \"sent\",\n          \"channelType\": \"websocket\",\n          \"channelId\": \"22222222-3333-4444-5555-666666666666\",\n          \"message\": \"outgoing message\",\n          \"wasMatched\": true,\n          \"timestamp\": \"2025-01-15T12:00:00Z\"\n        }\n        \"\"\";\n\n    MessageServeEvent event = Json.read(json, MessageServeEvent.class);\n\n    assertThat(event.getEventType(), is(MessageServeEvent.EventType.SENT));\n    assertThat(event.isSent(), is(true));\n    assertThat(event.isReceived(), is(false));\n    assertThat(event.getMessage().getBodyAsString(), is(\"outgoing message\"));\n  }\n\n  // TextEntityDefinition serialisation tests\n\n  @Test\n  void textEntityDefinitionWithStringDataSerializesToJson() {\n    TextEntityDefinition entityDef =\n        new TextEntityDefinition(\n            FormatType.JSON, CompressionType.NONE, null, null, \"hello world\", null);\n\n    String json = Json.write(entityDef);\n\n    // Default values (format=json, compression=none) should not be serialized\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"data\": \"hello world\"\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void textEntityDefinitionWithObjectDataSerializesToJson() {\n    Map<String, Object> objectData = Map.of(\"name\", \"John\", \"age\", 30);\n    TextEntityDefinition entityDef =\n        new TextEntityDefinition(\n            FormatType.JSON, CompressionType.NONE, null, null, objectData, null);\n\n    String json = Json.write(entityDef);\n\n    // Default values (format=json, compression=none) should not be serialized\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"data\": {\n                \"name\": \"John\",\n                \"age\": 30\n              }\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void textEntityDefinitionWithDataStoreRefSerializesToJson() {\n    // Using non-default format (TEXT instead of JSON) to test that it is serialized\n    TextEntityDefinition entityDef =\n        new TextEntityDefinition(\n            FormatType.TEXT, CompressionType.NONE, \"myStore\", \"myKey\", null, null);\n\n    String json = Json.write(entityDef);\n\n    // compression=none is default, so not serialized\n    // format=text is NOT the default (json is), so it IS serialized\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"format\": \"text\",\n              \"dataStore\": \"myStore\",\n              \"dataRef\": \"myKey\"\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void textEntityDefinitionWithDataStoreRoundTripsViaMessageStubMapping() {\n    TextEntityDefinition original =\n        new TextEntityDefinition(\n            FormatType.JSON, CompressionType.GZIP, \"myStore\", \"myKey\", null, null);\n\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Round trip stub\")\n            .withBody(equalTo(\"trigger\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(original))\n            .build();\n\n    String json = Json.write(stub);\n    MessageStubMapping deserialized = Json.read(json, MessageStubMapping.class);\n\n    SendMessageAction action = (SendMessageAction) deserialized.getActions().get(0);\n    assertThat(action.getBody(), instanceOf(TextEntityDefinition.class));\n    assertThat(action.getBody(), is(original));\n  }\n\n  @Test\n  void messageStubMappingWithTextEntityDefinitionSerializesCorrectly() {\n    TextEntityDefinition entityDef =\n        new TextEntityDefinition(\n            FormatType.JSON, CompressionType.NONE, null, null, Map.of(\"key\", \"value\"), null);\n\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withId(UUID.fromString(\"cccccccc-dddd-eeee-ffff-000000000000\"))\n            .withName(\"Text entity stub\")\n            .withBody(equalTo(\"trigger\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(entityDef))\n            .build();\n\n    String json = Json.write(stub);\n\n    // Default values (format=json, compression=none) should not be serialized\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"id\": \"cccccccc-dddd-eeee-ffff-000000000000\",\n              \"name\": \"Text entity stub\",\n              \"trigger\": {\n                \"type\": \"message\",\n                \"message\": {\n                  \"body\": {\n                    \"equalTo\": \"trigger\"\n                  }\n                }\n              },\n              \"actions\": [\n                {\n                  \"type\": \"send\",\n                  \"message\": {\n                    \"body\": {\n                      \"data\": {\n                        \"key\": \"value\"\n                      }\n                    }\n                  },\n                  \"channelTarget\": {\n                    \"type\": \"originating\"\n                  }\n                }\n              ]\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void messageStubMappingWithTextEntityDefinitionDeserializesCorrectly() {\n    String json =\n        // language=JSON\n        \"\"\"\n        {\n          \"name\": \"Text entity deserialized\",\n          \"trigger\": {\n            \"message\": {\n              \"body\": {\n                \"equalTo\": \"trigger\"\n              }\n            }\n          },\n          \"actions\": [\n            {\n              \"type\": \"send\",\n              \"message\": {\n                \"body\": {\n                  \"dataStore\": \"testStore\",\n                  \"dataRef\": \"testKey\"\n                }\n              },\n              \"channelTarget\": {\n                \"type\": \"originating\"\n              }\n            }\n          ]\n        }\n        \"\"\";\n\n    MessageStubMapping stub = Json.read(json, MessageStubMapping.class);\n\n    assertThat(stub.getName(), is(\"Text entity deserialized\"));\n    assertThat(stub.getActions().size(), is(1));\n\n    SendMessageAction action = (SendMessageAction) stub.getActions().get(0);\n    assertThat(action.getBody(), is(notNullValue()));\n    assertThat(action.getBody() instanceof TextEntityDefinition, is(true));\n\n    TextEntityDefinition entityDef = (TextEntityDefinition) action.getBody();\n    assertThat(entityDef.getDataStore(), is(\"testStore\"));\n    assertThat(entityDef.getDataRef(), is(\"testKey\"));\n  }\n\n  // BinaryEntityDefinition serialisation tests\n\n  @Test\n  void messageStubMappingWithBinaryMatchingAndBinaryResponseSerializesCorrectly() {\n    byte[] matchBytes = new byte[] {0x01, 0x02, 0x03};\n    byte[] responseBytes = new byte[] {0x0A, 0x0B, 0x0C, 0x0D};\n\n    String matchBase64 = java.util.Base64.getEncoder().encodeToString(matchBytes);\n    String responseBase64 = java.util.Base64.getEncoder().encodeToString(responseBytes);\n\n    BinaryEntityDefinition binaryBody =\n        BinaryEntityDefinition.aBinaryMessage().withBody(responseBytes).build();\n\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withId(UUID.fromString(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"))\n            .withName(\"Binary stub\")\n            .withBody(binaryEqualTo(matchBytes))\n            .triggersAction(SendMessageAction.toOriginatingChannel(binaryBody))\n            .build();\n\n    String json = Json.write(stub);\n\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"id\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n              \"name\": \"Binary stub\",\n              \"trigger\": {\n                \"type\": \"message\",\n                \"message\": {\n                  \"body\": {\n                    \"binaryEqualTo\": \"%s\"\n                  }\n                }\n              },\n              \"actions\": [\n                {\n                  \"type\": \"send\",\n                  \"message\": {\n                    \"body\": {\n                      \"encoding\": \"binary\",\n                      \"data\": \"%s\"\n                    }\n                  },\n                  \"channelTarget\": {\n                    \"type\": \"originating\"\n                  }\n                }\n              ]\n            }\n            \"\"\"\n                .formatted(matchBase64, responseBase64)));\n  }\n\n  @Test\n  void messageStubMappingWithBinaryMatchingAndBinaryResponseDeserializesCorrectly() {\n    byte[] matchBytes = new byte[] {0x01, 0x02, 0x03};\n    byte[] responseBytes = new byte[] {0x0A, 0x0B, 0x0C, 0x0D};\n\n    String matchBase64 = java.util.Base64.getEncoder().encodeToString(matchBytes);\n    String responseBase64 = java.util.Base64.getEncoder().encodeToString(responseBytes);\n\n    String json =\n        // language=JSON\n        \"\"\"\n        {\n          \"name\": \"Binary deserialized\",\n          \"trigger\": {\n            \"message\": {\n              \"body\": {\n                \"binaryEqualTo\": \"%s\"\n              }\n            }\n          },\n          \"actions\": [\n            {\n              \"type\": \"send\",\n              \"message\": {\n                \"body\": {\n                  \"encoding\": \"binary\",\n                  \"data\": \"%s\"\n                }\n              },\n              \"channelTarget\": {\n                \"type\": \"originating\"\n              }\n            }\n          ]\n        }\n        \"\"\"\n            .formatted(matchBase64, responseBase64);\n\n    MessageStubMapping stub = Json.read(json, MessageStubMapping.class);\n\n    assertThat(stub.getName(), is(\"Binary deserialized\"));\n    assertThat(stub.getActions().size(), is(1));\n\n    SendMessageAction action = (SendMessageAction) stub.getActions().get(0);\n    assertThat(action.getBody(), is(notNullValue()));\n    assertThat(action.getBody() instanceof BinaryEntityDefinition, is(true));\n\n    BinaryEntityDefinition entityDef = (BinaryEntityDefinition) action.getBody();\n    assertThat(entityDef.getData(), is(responseBase64));\n    assertThat(entityDef.getDataAsBytes(), is(responseBytes));\n  }\n\n  @Test\n  void binaryEntityDefinitionSerializesToJson() {\n    byte[] data = new byte[] {0x01, 0x02, 0x03, 0x04, 0x05};\n    String base64Data = java.util.Base64.getEncoder().encodeToString(data);\n\n    BinaryEntityDefinition entityDef =\n        BinaryEntityDefinition.aBinaryMessage().withBody(data).build();\n\n    String json = Json.write(entityDef);\n\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"encoding\": \"binary\",\n              \"data\": \"%s\"\n            }\n            \"\"\"\n                .formatted(base64Data)));\n  }\n\n  @Test\n  void binaryEntityDefinitionRoundTripsViaMessageStubMapping() {\n    byte[] data = new byte[] {0x01, 0x02, 0x03, 0x04, 0x05};\n\n    BinaryEntityDefinition original =\n        BinaryEntityDefinition.aBinaryMessage().withBody(data).build();\n\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Binary round trip stub\")\n            .withBody(equalTo(\"trigger\"))\n            .triggersAction(SendMessageAction.toOriginatingChannel(original))\n            .build();\n\n    String json = Json.write(stub);\n    MessageStubMapping deserialized = Json.read(json, MessageStubMapping.class);\n\n    SendMessageAction action = (SendMessageAction) deserialized.getActions().get(0);\n    assertThat(action.getBody(), instanceOf(BinaryEntityDefinition.class));\n    assertThat(action.getBody(), is(original));\n  }\n\n  // HttpStubTrigger serialization tests\n\n  @Test\n  void messageStubMappingWithHttpStubTriggerSerializesToJson() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withId(UUID.fromString(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"))\n            .withName(\"HTTP stub triggered message\")\n            .triggeredByHttpStub(\"11111111-2222-3333-4444-555555555555\")\n            .triggersAction(\n                SendMessageAction.toMatchingChannels(\n                    \"triggered message\", newRequestPattern().withUrl(\"/ws-channel\").build()))\n            .build();\n\n    String json = Json.write(stub);\n\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"id\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n              \"name\": \"HTTP stub triggered message\",\n              \"trigger\": {\n                \"type\": \"http-stub\",\n                \"stubId\": \"11111111-2222-3333-4444-555555555555\"\n              },\n              \"actions\": [\n                {\n                  \"type\": \"send\",\n                  \"message\": {\n                    \"body\": \"triggered message\"\n                  },\n                  \"channelTarget\": {\n                    \"type\": \"request-initiated\",\n                    \"requestPattern\": {\n                      \"url\": \"/ws-channel\",\n                      \"method\": \"ANY\"\n                    }\n                  }\n                }\n              ]\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void messageStubMappingWithHttpStubTriggerDeserializesFromJson() {\n    String json =\n        // language=JSON\n        \"\"\"\n        {\n          \"id\": \"bbbbbbbb-cccc-dddd-eeee-ffffffffffff\",\n          \"name\": \"Deserialized HTTP stub trigger\",\n          \"trigger\": {\n            \"type\": \"http-stub\",\n            \"stubId\": \"22222222-3333-4444-5555-666666666666\"\n          },\n          \"actions\": [\n            {\n              \"type\": \"send\",\n              \"message\": {\n                \"body\": \"response\"\n              },\n              \"channelTarget\": {\n                \"type\": \"request-initiated\",\n                \"requestPattern\": {\n                  \"url\": \"/target\"\n                }\n              }\n            }\n          ]\n        }\n        \"\"\";\n\n    MessageStubMapping stub = Json.read(json, MessageStubMapping.class);\n\n    assertThat(stub.getId().toString(), is(\"bbbbbbbb-cccc-dddd-eeee-ffffffffffff\"));\n    assertThat(stub.getName(), is(\"Deserialized HTTP stub trigger\"));\n    assertThat(stub.getTrigger(), instanceOf(HttpStubTrigger.class));\n    HttpStubTrigger trigger = (HttpStubTrigger) stub.getTrigger();\n    assertThat(trigger.getStubId().toString(), is(\"22222222-3333-4444-5555-666666666666\"));\n    assertThat(stub.getActions().size(), is(1));\n  }\n\n  @Test\n  void messageStubMappingWithHttpStubTriggerRoundTrips() {\n    MessageStubMapping original =\n        MessageStubMapping.builder()\n            .withName(\"Round trip HTTP stub trigger\")\n            .triggeredByHttpStub(UUID.fromString(\"33333333-4444-5555-6666-777777777777\"))\n            .triggersAction(\n                SendMessageAction.toMatchingChannels(\n                    \"round trip message\", newRequestPattern().withUrl(\"/round-trip\").build()))\n            .build();\n\n    String json = Json.write(original);\n    MessageStubMapping deserialized = Json.read(json, MessageStubMapping.class);\n\n    assertThat(deserialized.getId(), is(original.getId()));\n    assertThat(deserialized.getName(), is(original.getName()));\n    assertThat(deserialized.getTrigger(), instanceOf(HttpStubTrigger.class));\n    HttpStubTrigger trigger = (HttpStubTrigger) deserialized.getTrigger();\n    assertThat(trigger.getStubId().toString(), is(\"33333333-4444-5555-6666-777777777777\"));\n  }\n\n  // HttpRequestTrigger serialization tests\n\n  @Test\n  void messageStubMappingWithHttpRequestTriggerSerializesToJson() {\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withId(UUID.fromString(\"cccccccc-dddd-eeee-ffff-000000000000\"))\n            .withName(\"HTTP request triggered message\")\n            .triggeredByHttpRequest(newRequestPattern().withUrl(\"/api/trigger\").build())\n            .triggersAction(\n                SendMessageAction.toMatchingChannels(\n                    \"request triggered\", newRequestPattern().withUrl(\"/ws-notify\").build()))\n            .build();\n\n    String json = Json.write(stub);\n\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"id\": \"cccccccc-dddd-eeee-ffff-000000000000\",\n              \"name\": \"HTTP request triggered message\",\n              \"trigger\": {\n                \"type\": \"http-request\",\n                \"requestPattern\": {\n                  \"url\": \"/api/trigger\",\n                  \"method\": \"ANY\"\n                }\n              },\n              \"actions\": [\n                {\n                  \"type\": \"send\",\n                  \"message\": {\n                    \"body\": \"request triggered\"\n                  },\n                  \"channelTarget\": {\n                    \"type\": \"request-initiated\",\n                    \"requestPattern\": {\n                      \"url\": \"/ws-notify\",\n                      \"method\": \"ANY\"\n                    }\n                  }\n                }\n              ]\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void messageStubMappingWithHttpRequestTriggerDeserializesFromJson() {\n    String json =\n        // language=JSON\n        \"\"\"\n        {\n          \"id\": \"dddddddd-eeee-ffff-0000-111111111111\",\n          \"name\": \"Deserialized HTTP request trigger\",\n          \"trigger\": {\n            \"type\": \"http-request\",\n            \"requestPattern\": {\n              \"url\": \"/api/events\",\n              \"method\": \"POST\"\n            }\n          },\n          \"actions\": [\n            {\n              \"type\": \"send\",\n              \"message\": {\n                \"body\": \"event received\"\n              },\n              \"channelTarget\": {\n                \"type\": \"request-initiated\",\n                \"requestPattern\": {\n                  \"url\": \"/events-channel\"\n                }\n              }\n            }\n          ]\n        }\n        \"\"\";\n\n    MessageStubMapping stub = Json.read(json, MessageStubMapping.class);\n\n    assertThat(stub.getId().toString(), is(\"dddddddd-eeee-ffff-0000-111111111111\"));\n    assertThat(stub.getName(), is(\"Deserialized HTTP request trigger\"));\n    assertThat(stub.getTrigger(), instanceOf(HttpRequestTrigger.class));\n    HttpRequestTrigger trigger = (HttpRequestTrigger) stub.getTrigger();\n    assertThat(trigger.getRequestPattern().getUrl(), is(\"/api/events\"));\n    assertThat(stub.getActions().size(), is(1));\n  }\n\n  @Test\n  void messageStubMappingWithHttpRequestTriggerRoundTrips() {\n    MessageStubMapping original =\n        MessageStubMapping.builder()\n            .withName(\"Round trip HTTP request trigger\")\n            .triggeredByHttpRequest(newRequestPattern().withUrl(\"/api/round-trip\").build())\n            .triggersAction(\n                SendMessageAction.toMatchingChannels(\n                    \"round trip\", newRequestPattern().withUrl(\"/ws-round-trip\").build()))\n            .build();\n\n    String json = Json.write(original);\n    MessageStubMapping deserialized = Json.read(json, MessageStubMapping.class);\n\n    assertThat(deserialized.getId(), is(original.getId()));\n    assertThat(deserialized.getName(), is(original.getName()));\n    assertThat(deserialized.getTrigger(), instanceOf(HttpRequestTrigger.class));\n    HttpRequestTrigger trigger = (HttpRequestTrigger) deserialized.getTrigger();\n    assertThat(trigger.getRequestPattern().getUrl(), is(\"/api/round-trip\"));\n  }\n\n  // RequestInitiatedChannelTarget serialization tests\n\n  @Test\n  void requestInitiatedChannelTargetWithChannelTypeSerializesToJson() {\n    RequestInitiatedChannelTarget target =\n        RequestInitiatedChannelTarget.forTypeAndPattern(\n            ChannelType.WEBSOCKET, newRequestPattern().withUrl(\"/ws-target\").build());\n\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withId(UUID.fromString(\"eeeeeeee-ffff-0000-1111-222222222222\"))\n            .withName(\"Request-initiated with channel type\")\n            .withBody(equalTo(\"trigger\"))\n            .triggersAction(\n                new SendMessageAction(\n                    MessageDefinition.fromString(\"targeted message\"), target, null, null))\n            .build();\n\n    String json = Json.write(stub);\n\n    assertThat(\n        json,\n        jsonEquals(\n            // language=JSON\n            \"\"\"\n            {\n              \"id\": \"eeeeeeee-ffff-0000-1111-222222222222\",\n              \"name\": \"Request-initiated with channel type\",\n              \"trigger\": {\n                \"type\": \"message\",\n                \"message\": {\n                  \"body\": {\n                    \"equalTo\": \"trigger\"\n                  }\n                }\n              },\n              \"actions\": [\n                {\n                  \"type\": \"send\",\n                  \"message\": {\n                    \"body\": \"targeted message\"\n                  },\n                  \"channelTarget\": {\n                    \"type\": \"request-initiated\",\n                    \"channelType\": \"websocket\",\n                    \"requestPattern\": {\n                      \"url\": \"/ws-target\",\n                      \"method\": \"ANY\"\n                    }\n                  }\n                }\n              ]\n            }\n            \"\"\"));\n  }\n\n  @Test\n  void requestInitiatedChannelTargetWithChannelTypeDeserializesFromJson() {\n    String json =\n        // language=JSON\n        \"\"\"\n        {\n          \"name\": \"Deserialized request-initiated with channel type\",\n          \"trigger\": {\n            \"message\": {\n              \"body\": {\n                \"equalTo\": \"trigger\"\n              }\n            }\n          },\n          \"actions\": [\n            {\n              \"type\": \"send\",\n              \"message\": {\n                \"body\": \"response\"\n              },\n              \"channelTarget\": {\n                \"type\": \"request-initiated\",\n                \"channelType\": \"websocket\",\n                \"requestPattern\": {\n                  \"url\": \"/ws-channel\"\n                }\n              }\n            }\n          ]\n        }\n        \"\"\";\n\n    MessageStubMapping stub = Json.read(json, MessageStubMapping.class);\n\n    assertThat(stub.getName(), is(\"Deserialized request-initiated with channel type\"));\n    assertThat(stub.getActions().size(), is(1));\n\n    SendMessageAction action = (SendMessageAction) stub.getActions().get(0);\n    ChannelTarget target = action.getChannelTarget();\n    assertThat(target, instanceOf(RequestInitiatedChannelTarget.class));\n\n    RequestInitiatedChannelTarget requestTarget = (RequestInitiatedChannelTarget) target;\n    assertThat(requestTarget.getChannelType(), is(ChannelType.WEBSOCKET));\n    assertThat(requestTarget.getRequestPattern().getUrl(), is(\"/ws-channel\"));\n  }\n\n  @Test\n  void requestInitiatedChannelTargetWithoutChannelTypeDeserializesFromJson() {\n    String json =\n        // language=JSON\n        \"\"\"\n        {\n          \"name\": \"Request-initiated without channel type\",\n          \"trigger\": {\n            \"message\": {\n              \"body\": {\n                \"equalTo\": \"trigger\"\n              }\n            }\n          },\n          \"actions\": [\n            {\n              \"type\": \"send\",\n              \"message\": {\n                \"body\": \"response\"\n              },\n              \"channelTarget\": {\n                \"type\": \"request-initiated\",\n                \"requestPattern\": {\n                  \"urlPath\": \"/target-path\"\n                }\n              }\n            }\n          ]\n        }\n        \"\"\";\n\n    MessageStubMapping stub = Json.read(json, MessageStubMapping.class);\n\n    SendMessageAction action = (SendMessageAction) stub.getActions().get(0);\n    RequestInitiatedChannelTarget requestTarget =\n        (RequestInitiatedChannelTarget) action.getChannelTarget();\n    assertThat(requestTarget.getChannelType(), is((ChannelType) null));\n    assertThat(requestTarget.getRequestPattern().getUrlPath(), is(\"/target-path\"));\n  }\n\n  @Test\n  void requestInitiatedChannelTargetRoundTrips() {\n    RequestInitiatedChannelTarget original =\n        RequestInitiatedChannelTarget.forTypeAndPattern(\n            ChannelType.WEBSOCKET, newRequestPattern().withUrl(\"/round-trip-target\").build());\n\n    MessageStubMapping stub =\n        MessageStubMapping.builder()\n            .withName(\"Round trip request-initiated\")\n            .withBody(equalTo(\"trigger\"))\n            .triggersAction(\n                new SendMessageAction(\n                    MessageDefinition.fromString(\"message\"), original, null, null))\n            .build();\n\n    String json = Json.write(stub);\n    MessageStubMapping deserialized = Json.read(json, MessageStubMapping.class);\n\n    SendMessageAction action = (SendMessageAction) deserialized.getActions().get(0);\n    RequestInitiatedChannelTarget deserializedTarget =\n        (RequestInitiatedChannelTarget) action.getChannelTarget();\n\n    assertThat(deserializedTarget.getChannelType(), is(ChannelType.WEBSOCKET));\n    assertThat(deserializedTarget.getRequestPattern().getUrl(), is(\"/round-trip-target\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/verification/NearMissCalculatorTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.*;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.stubbing.ServeEventFactory.newPostMatchServeEvent;\nimport static com.github.tomakehurst.wiremock.verification.NearMissCalculator.NEAR_MISS_COUNT;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.client.MappingBuilder;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.stubbing.*;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Collectors;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\npublic class NearMissCalculatorTest {\n\n  NearMissCalculator nearMissCalculator;\n\n  StubMappings stubMappings;\n  RequestJournal requestJournal;\n  Scenarios scenarios;\n  RequestMatcherExtension partialMatchMatcher =\n      new RequestMatcherExtension() {\n        @Override\n        public MatchResult match(Request request, Parameters parameters) {\n          return MatchResult.partialMatch(0.2);\n        }\n      };\n\n  @BeforeEach\n  public void init() {\n    stubMappings = mock(StubMappings.class);\n    requestJournal = mock(RequestJournal.class);\n    scenarios = new InMemoryScenarios();\n    nearMissCalculator =\n        new NearMissCalculator(\n            stubMappings, requestJournal, scenarios, Map.of(\"partial\", partialMatchMatcher));\n  }\n\n  @Test\n  public void returnsNearest3MissesForSingleRequest() {\n    givenStubMappings(\n        get(urlEqualTo(\"/righ\")).willReturn(aResponse()),\n        get(urlEqualTo(\"/totally-wrong1\")).willReturn(aResponse()),\n        get(urlEqualTo(\"/totally-wrong222\")).willReturn(aResponse()),\n        get(urlEqualTo(\"/almost-right\")).willReturn(aResponse()),\n        get(urlEqualTo(\"/rig\")).willReturn(aResponse()),\n        get(urlEqualTo(\"/totally-wrong33333\")).willReturn(aResponse()));\n\n    List<NearMiss> nearest =\n        nearMissCalculator.findNearestTo(mockRequest().url(\"/right\").asLoggedRequest());\n\n    assertThat(nearest.size(), is(NEAR_MISS_COUNT));\n    assertThat(nearest.get(0).getStubMapping().getRequest().getUrl(), is(\"/righ\"));\n    assertThat(nearest.get(1).getStubMapping().getRequest().getUrl(), is(\"/rig\"));\n    assertThat(nearest.get(2).getStubMapping().getRequest().getUrl(), is(\"/almost-right\"));\n  }\n\n  @Test\n  public void returns0NearMissesForSingleRequestWhenNoStubsPresent() {\n    givenStubMappings();\n\n    List<NearMiss> nearest =\n        nearMissCalculator.findNearestTo(mockRequest().url(\"/right\").asLoggedRequest());\n\n    assertThat(nearest.size(), is(0));\n  }\n\n  @Test\n  public void returns3NearestMissesForTheGivenRequestPattern() {\n    givenRequests(\n        mockRequest().method(DELETE).url(\"/rig\"),\n        mockRequest().method(DELETE).url(\"/righ\"),\n        mockRequest().method(DELETE).url(\"/almost-right\"),\n        mockRequest().method(POST).url(\"/almost-right\"));\n\n    List<NearMiss> nearest =\n        nearMissCalculator.findNearestTo(newRequestPattern(DELETE, urlEqualTo(\"/right\")).build());\n\n    assertThat(nearest.size(), is(NEAR_MISS_COUNT));\n    assertThat(nearest.get(0).getRequest().getUrl(), is(\"/righ\"));\n    assertThat(nearest.get(1).getRequest().getUrl(), is(\"/rig\"));\n    assertThat(nearest.get(2).getRequest().getUrl(), is(\"/almost-right\"));\n    assertThat(nearest.get(2).getRequest().getMethod(), is(DELETE));\n  }\n\n  @Test\n  public void returns1NearestMissForTheGivenRequestPatternWhenOnlyOneRequestLogged() {\n    givenRequests(mockRequest().method(DELETE).url(\"/righ\"));\n\n    List<NearMiss> nearest =\n        nearMissCalculator.findNearestTo(newRequestPattern(DELETE, urlEqualTo(\"/right\")).build());\n\n    assertThat(nearest.size(), is(1));\n    assertThat(nearest.get(0).getRequest().getUrl(), is(\"/righ\"));\n  }\n\n  @Test\n  public void returns0NearMissesForSingleRequestPatternWhenNoRequestsLogged() {\n    givenRequests();\n\n    List<NearMiss> nearest =\n        nearMissCalculator.findNearestTo(newRequestPattern(DELETE, urlEqualTo(\"/right\")).build());\n\n    assertThat(nearest.size(), is(0));\n  }\n\n  @Test\n  public void\n      stubMappingsWithIdenticalMethodAndUrlWillRankHigherDespiteOtherParametersBeingAbsent() {\n    givenStubMappings(\n        post(\"/the-correct-path\")\n            .withName(\"Correct\")\n            .withHeader(\"Accept\", equalTo(\"text/plain\"))\n            .withHeader(\"X-My-Header\", matching(\"[0-9]*\"))\n            .withQueryParam(\"search\", containing(\"somethings\"))\n            .withRequestBody(equalToJson(\"[1, 2, 3]\"))\n            .withRequestBody(matchingJsonPath(\"$..*\"))\n            .willReturn(ok()),\n        post(\"/another-path\").withName(\"Another 1\").willReturn(ok()),\n        get(\"/yet-another-path\").withName(\"Yet another\").willReturn(ok()));\n\n    List<NearMiss> nearestForCorrectMethodAndUrl =\n        nearMissCalculator.findNearestTo(\n            mockRequest().method(POST).url(\"/the-correct-path\").asLoggedRequest());\n    assertThat(nearestForCorrectMethodAndUrl.get(0).getStubMapping().getName(), is(\"Correct\"));\n\n    List<NearMiss> nearestForIncorrectMethodAndCorrectUrl =\n        nearMissCalculator.findNearestTo(\n            mockRequest().method(POST).url(\"/the-incorrect-path\").asLoggedRequest());\n    assertThat(\n        nearestForIncorrectMethodAndCorrectUrl.get(0).getStubMapping().getName(), is(\"Correct\"));\n\n    List<NearMiss> nearestForIncorrectMethodAndUrl =\n        nearMissCalculator.findNearestTo(\n            mockRequest().method(PUT).url(\"/the-incorrect-path\").asLoggedRequest());\n    assertThat(nearestForIncorrectMethodAndUrl.get(0).getStubMapping().getName(), is(\"Correct\"));\n  }\n\n  @Test\n  public void customMatcherIsUsedWhenCalculatingNearestMiss() {\n    givenStubMappings(\n        get(urlEqualTo(\"/correctpath\")).andMatching(\"partial\").willReturn(aResponse()),\n        get(urlEqualTo(\"/otherpath\")).willReturn(aResponse()));\n\n    List<NearMiss> nearest =\n        nearMissCalculator.findNearestTo(\n            mockRequest().method(GET).url(\"/correctpath\").asLoggedRequest());\n\n    assertThat(nearest.size(), is(2));\n    assertThat(nearest.get(0).getStubMapping().getRequest().getUrl(), is(\"/correctpath\"));\n    assertThat(nearest.get(1).getStubMapping().getRequest().getUrl(), is(\"/otherpath\"));\n  }\n\n  private void givenStubMappings(final MappingBuilder... mappingBuilders) {\n    final List<StubMapping> mappings =\n        Arrays.stream(mappingBuilders).map(MappingBuilder::build).collect(Collectors.toList());\n\n    when(stubMappings.getAll()).thenReturn(mappings);\n  }\n\n  private void givenRequests(final Request... requests) {\n    final List<ServeEvent> serveEvents =\n        Arrays.stream(requests)\n            .map(request -> newPostMatchServeEvent(request, responseDefinition().build()))\n            .collect(Collectors.toList());\n\n    when(requestJournal.getAllServeEvents()).thenReturn(serveEvents);\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/verification/NearMissTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.HEAD;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalToJson;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.notNullValue;\nimport static org.hamcrest.Matchers.nullValue;\nimport static org.skyscreamer.jsonassert.JSONCompareMode.LENIENT;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport org.junit.jupiter.api.Test;\n\npublic class NearMissTest {\n\n  static final String STUB_MAPPING_EXAMPLE =\n      \"{\\n\"\n          + \"  \\\"request\\\" : {\\n\"\n          + \"    \\\"url\\\" : \\\"/nearly-missed-me\\\",\\n\"\n          + \"    \\\"method\\\" : \\\"HEAD\\\"\\n\"\n          + \"  },\\n\"\n          + \"  \\\"stubMapping\\\": {\\n\"\n          + \"    \\\"request\\\": {\\n\"\n          + \"      \\\"url\\\" : \\\"/missed-me\\\",\\n\"\n          + \"      \\\"method\\\" : \\\"GET\\\"  \\n\"\n          + \"    },\\n\"\n          + \"    \\\"response\\\": {\\n\"\n          + \"      \\\"status\\\": 200\\n\"\n          + \"    }\\n\"\n          + \"  },\\n\"\n          + \"  \\\"matchResult\\\": {\\n\"\n          + \"    \\\"distance\\\": 0.5\\n\"\n          + \"  }\\n\"\n          + \"}\";\n\n  static final String REQUEST_PATTERN_EXAMPLE =\n      \"{\\n\"\n          + \"  \\\"request\\\" : {\\n\"\n          + \"    \\\"url\\\" : \\\"/nearly-missed-me\\\",\\n\"\n          + \"    \\\"method\\\" : \\\"HEAD\\\"\\n\"\n          + \"  },\\n\"\n          + \"  \\\"requestPattern\\\": {\\n\"\n          + \"    \\\"url\\\" : \\\"/missed-me\\\",\\n\"\n          + \"    \\\"method\\\" : \\\"GET\\\"\\n\"\n          + \"  },\\n\"\n          + \"  \\\"matchResult\\\": {\\n\"\n          + \"    \\\"distance\\\": 0.5\\n\"\n          + \"  }\\n\"\n          + \"}\";\n\n  @Test\n  public void correctlySerialisesToJsonWithStubMapping() {\n    String json =\n        Json.write(\n            new NearMiss(\n                LoggedRequest.createFrom(mockRequest().method(HEAD).url(\"/nearly-missed-me\")),\n                get(urlEqualTo(\"/missed-me\")).willReturn(aResponse()).build(),\n                MatchResult.partialMatch(0.5),\n                null));\n\n    assertThat(json, equalToJson(STUB_MAPPING_EXAMPLE, LENIENT));\n  }\n\n  @Test\n  public void correctlySerialisesToJsonWithRequestPattern() {\n    String json =\n        Json.write(\n            new NearMiss(\n                LoggedRequest.createFrom(mockRequest().method(HEAD).url(\"/nearly-missed-me\")),\n                get(urlEqualTo(\"/missed-me\")).willReturn(aResponse()).build().getRequest(),\n                MatchResult.partialMatch(0.5)));\n\n    assertThat(json, equalToJson(REQUEST_PATTERN_EXAMPLE, LENIENT));\n  }\n\n  @Test\n  public void correctlyDeserialisesFromJsonWithStubMapping() {\n    NearMiss nearMiss = Json.read(STUB_MAPPING_EXAMPLE, NearMiss.class);\n\n    assertThat(nearMiss.getRequest().getUrl(), is(\"/nearly-missed-me\"));\n    assertThat(nearMiss.getRequest().getMethod(), is(HEAD));\n    assertThat(nearMiss.getStubMapping().getRequest().getUrl(), is(\"/missed-me\"));\n    assertThat(nearMiss.getStubMapping().getRequest().getMethod(), is(GET));\n    assertThat(nearMiss.getMatchResult().getDistance(), is(0.5));\n    assertThat(nearMiss.getRequestPattern(), nullValue());\n    assertThat(nearMiss.toString(), notNullValue());\n  }\n\n  @Test\n  public void correctlyDeserialisesFromJsonWithRequestPattern() {\n    NearMiss nearMiss = Json.read(REQUEST_PATTERN_EXAMPLE, NearMiss.class);\n\n    assertThat(nearMiss.getRequest().getUrl(), is(\"/nearly-missed-me\"));\n    assertThat(nearMiss.getRequest().getMethod(), is(HEAD));\n    assertThat(nearMiss.getRequestPattern().getUrl(), is(\"/missed-me\"));\n    assertThat(nearMiss.getRequestPattern().getMethod(), is(GET));\n    assertThat(nearMiss.getMatchResult().getDistance(), is(0.5));\n    assertThat(nearMiss.getStubMapping(), nullValue());\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/verification/diff/DiffTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.ANY;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.verification.diff.JUnitStyleDiffRenderer.junitStyleDiffMessage;\nimport static java.lang.System.lineSeparator;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport org.junit.jupiter.api.Test;\n\nclass DiffTest {\n\n  @Test\n  void correctlyRendersJUnitStyleDiffMessage() {\n    String diff = junitStyleDiffMessage(\"expected\", \"actual\");\n\n    assertThat(diff, is(String.format(\" expected:<%nexpected> but was:<%nactual>\")));\n  }\n\n  @Test\n  void showsDiffForNonMatchingRequestMethod() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(GET, urlEqualTo(\"/thing\")).build(),\n            mockRequest().method(POST).url(\"/thing\"));\n\n    assertThat(\n        diff.toString(), is(junitStyleDiffMessage(\"GET\\n\" + \"/thing\\n\", \"POST\\n\" + \"/thing\\n\")));\n  }\n\n  @Test\n  void showsDiffForUrlEqualTo() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/expected\")).build(), mockRequest().url(\"/actual\"));\n\n    assertThat(\n        diff.toString(), is(junitStyleDiffMessage(\"ANY\\n\" + \"/expected\\n\", \"ANY\\n\" + \"/actual\\n\")));\n  }\n\n  @Test\n  void showsDiffForUrlPathMatching() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlPathMatching(\"/expected/.*\")).build(),\n            mockRequest().url(\"/actual\"));\n\n    assertThat(\n        diff.toString(),\n        is(junitStyleDiffMessage(\"ANY\\n\" + \"[path regex] /expected/.*\\n\", \"ANY\\n\" + \"/actual\\n\")));\n  }\n\n  @Test\n  void showsDiffsForSingleNonMatchingHeaderAndMatchingHeader() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withHeader(\"Content-Type\", equalTo(\"application/json\"))\n                .withHeader(\"X-My-Header\", equalTo(\"expected\"))\n                .build(),\n            mockRequest()\n                .url(\"/thing\")\n                .header(\"Content-Type\", \"application/json\")\n                .header(\"X-My-Header\", \"actual\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\"\n                    + \"/thing\\n\"\n                    + \"\\n\"\n                    + \"Content-Type: application/json\\n\"\n                    + \"X-My-Header: expected\\n\",\n                \"ANY\\n\"\n                    + \"/thing\\n\"\n                    + \"\\n\"\n                    + \"Content-Type: application/json\\n\"\n                    + \"X-My-Header: actual\\n\")));\n  }\n\n  @Test\n  void showsDiffWhenRequestHeaderIsAbsent() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withHeader(\"X-My-Header\", equalTo(\"expected\"))\n                .build(),\n            mockRequest().url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"X-My-Header: expected\\n\",\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"\\n\")));\n  }\n\n  @Test\n  void showsHeaders() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withHeader(\"X-My-Header\", equalTo(\"expected\"))\n                .build(),\n            mockRequest().url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"X-My-Header: expected\\n\",\n                \"ANY\\n\" + \"/thing\\n\\n\\n\")));\n  }\n\n  @Test\n  void showsRequestBody() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withRequestBody(\n                    equalToJson(\n                        \"{\\n\"\n                            + \"    \\\"outer\\\": {\\n\"\n                            + \"        \\\"inner\\\": {\\n\"\n                            + \"            \\\"thing\\\": 1\\n\"\n                            + \"        }\\n\"\n                            + \"    }\\n\"\n                            + \"}\"))\n                .build(),\n            mockRequest().url(\"/thing\").body(\"{\\n\" + \"    \\\"outer\\\": {}\\n\" + \"}\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\"\n                    + \"/thing\\n\"\n                    + \"\\n\"\n                    + \"[equalToJson]\"\n                    + lineSeparator()\n                    + \"{\"\n                    + lineSeparator()\n                    + \"  \\\"outer\\\" : {\"\n                    + lineSeparator()\n                    + \"    \\\"inner\\\" : {\"\n                    + lineSeparator()\n                    + \"      \\\"thing\\\" : 1\"\n                    + lineSeparator()\n                    + \"    }\"\n                    + lineSeparator()\n                    + \"  }\"\n                    + lineSeparator()\n                    + \"}\",\n                \"ANY\\n\"\n                    + \"/thing\\n\"\n                    + \"\\n\"\n                    + lineSeparator()\n                    + \"{\"\n                    + lineSeparator()\n                    + \"  \\\"outer\\\" : { }\"\n                    + lineSeparator()\n                    + \"}\")));\n  }\n\n  @Test\n  void prettyPrintsJsonRequestBody() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withRequestBody(equalToJson(\"{\\\"outer\\\": {\\\"inner:\\\": {\\\"thing\\\": 1}}}\"))\n                .build(),\n            mockRequest().url(\"/thing\").body(\"{\\\"outer\\\": {}}\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\"\n                    + \"/thing\\n\"\n                    + \"\\n\"\n                    + \"[equalToJson]\\n\"\n                    + \"{\"\n                    + lineSeparator()\n                    + \"  \\\"outer\\\" : {\"\n                    + lineSeparator()\n                    + \"    \\\"inner:\\\" : {\"\n                    + lineSeparator()\n                    + \"      \\\"thing\\\" : 1\"\n                    + lineSeparator()\n                    + \"    }\"\n                    + lineSeparator()\n                    + \"  }\"\n                    + lineSeparator()\n                    + \"}\",\n                \"ANY\\n\"\n                    + \"/thing\\n\"\n                    + \"\\n\"\n                    + lineSeparator()\n                    + \"{\"\n                    + lineSeparator()\n                    + \"  \\\"outer\\\" : { }\"\n                    + lineSeparator()\n                    + \"}\")));\n  }\n\n  @Test\n  void showsJsonPathExpectations() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withRequestBody(matchingJsonPath(\"@.notfound\"))\n                .withRequestBody(matchingJsonPath(\"@.nothereeither\"))\n                .build(),\n            mockRequest()\n                .url(\"/thing\")\n                .body(\n                    \"{\\n\"\n                        + \"    \\\"outer\\\": {\\n\"\n                        + \"        \\\"inner:\\\": {\\n\"\n                        + \"            \\\"thing\\\": 1\\n\"\n                        + \"        }\\n\"\n                        + \"    }\\n\"\n                        + \"}\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"@.notfound\\n\" + \"@.nothereeither\",\n                \"ANY\\n\"\n                    + \"/thing\\n\"\n                    + \"\\n\"\n                    + \"{\\n\"\n                    + \"    \\\"outer\\\": {\\n\"\n                    + \"        \\\"inner:\\\": {\\n\"\n                    + \"            \\\"thing\\\": 1\\n\"\n                    + \"        }\\n\"\n                    + \"    }\\n\"\n                    + \"}\\n\"\n                    + \"{\\n\"\n                    + \"    \\\"outer\\\": {\\n\"\n                    + \"        \\\"inner:\\\": {\\n\"\n                    + \"            \\\"thing\\\": 1\\n\"\n                    + \"        }\\n\"\n                    + \"    }\\n\"\n                    + \"}\")));\n  }\n\n  @Test\n  void prettyPrintsXml() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withRequestBody(\n                    equalToXml(\n                        \"<my-elements><one attr-one=\\\"1111\\\" /><two /><three /></my-elements>\"))\n                .build(),\n            mockRequest()\n                .url(\"/thing\")\n                .body(\"<my-elements><one attr-one=\\\"2222\\\" /><two /><three /></my-elements>\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\"\n                    + \"/thing\\n\"\n                    + \"\\n\"\n                    + \"[equalToXml]\\n\"\n                    + \"<my-elements>\"\n                    + lineSeparator()\n                    + \"  <one attr-one=\\\"1111\\\"/>\"\n                    + lineSeparator()\n                    + \"  <two/>\"\n                    + lineSeparator()\n                    + \"  <three/>\"\n                    + lineSeparator()\n                    + \"</my-elements>\"\n                    + lineSeparator(),\n                \"ANY\\n\"\n                    + \"/thing\\n\"\n                    + \"\\n\\n\"\n                    + \"<my-elements>\"\n                    + lineSeparator()\n                    + \"  <one attr-one=\\\"2222\\\"/>\"\n                    + lineSeparator()\n                    + \"  <two/>\"\n                    + lineSeparator()\n                    + \"  <three/>\"\n                    + lineSeparator()\n                    + \"</my-elements>\"\n                    + lineSeparator())));\n  }\n\n  @Test\n  void showsCookiesInDiffWhenNotMatching() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withCookie(\"my_cookie\", equalTo(\"expected-cookie\"))\n                .build(),\n            mockRequest().url(\"/thing\").cookie(\"my_cookie\", \"actual-cookie\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"Cookie: my_cookie=expected-cookie\\n\",\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"actual-cookie\\n\")));\n  }\n\n  @Test\n  void showsQueryParametersInDiffWhenNotMatching() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlPathEqualTo(\"/thing\"))\n                .withQueryParam(\"search\", equalTo(\"everything\"))\n                .build(),\n            mockRequest().url(\"/thing?search=nothing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\" + \"/thing?search=nothing\\n\" + \"\\n\" + \"Query: search = everything\\n\",\n                \"ANY\\n\" + \"/thing?search=nothing\\n\" + \"\\n\" + \"search: nothing\\n\")));\n  }\n\n  @Test\n  void showsCookiesInDiffAbsentFromRequest() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withCookie(\"my_cookie\", equalTo(\"expected-cookie\"))\n                .build(),\n            mockRequest().url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"Cookie: my_cookie=expected-cookie\\n\",\n                \"ANY\\n\" + \"/thing\\n\\n\\n\")));\n  }\n\n  @Test\n  void indicatesThatAnInlineCustomMatcherDidNotMatch() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(GET, urlEqualTo(\"/thing\"))\n                .andMatching(value -> MatchResult.noMatch())\n                .build(),\n            mockRequest().method(GET).url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"GET\\n\" + \"/thing\\n\" + \"\\n\" + \"[custom matcher]\", \"GET\\n\" + \"/thing\\n\\n \")));\n  }\n\n  @Test\n  void indicatesThatANamedCustomMatcherDidNotMatch() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(GET, urlEqualTo(\"/thing\")).andMatching(\"my-custom-matcher\").build(),\n            mockRequest().method(GET).url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"GET\\n\" + \"/thing\\n\" + \"\\n\" + \"[custom matcher: my-custom-matcher]\",\n                \"GET\\n\" + \"/thing\\n\" + \"\\n\" + \"[custom matcher: my-custom-matcher]\")));\n  }\n\n  @Test\n  void handlesAbsentRequestBody() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(POST, urlEqualTo(\"/thing\")).withRequestBody(absent()).build(),\n            mockRequest().method(POST).body(\"not absent\").url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"POST\\n\" + \"/thing\\n\\n[absent]\\n\" + \"(absent)\",\n                \"POST\\n\" + \"/thing\\n\\n\" + \"\\nnot absent\")));\n  }\n\n  @Test\n  void indicatesThatScenarioStateDiffersWhenStubAndRequestOtherwiseMatch() {\n    Diff diff =\n        new Diff(\n            get(\"/stateful\")\n                .inScenario(\"my-steps\")\n                .whenScenarioStateIs(\"step2\")\n                .willReturn(ok(\"Yep\"))\n                .build(),\n            mockRequest().method(GET).url(\"/stateful\"),\n            Scenario.STARTED);\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"GET\\n\" + \"/stateful\\n\\n\" + \"[Scenario 'my-steps' state: step2]\",\n                \"GET\\n\" + \"/stateful\\n\\n\" + \"[Scenario 'my-steps' state: Started]\")));\n  }\n\n  @Test\n  void includesSpecificDiffForJsonPathSubMatchWhenElementFound() {\n    Diff diff =\n        new Diff(\n            post(\"/submatch\")\n                .withRequestBody(matchingJsonPath(\"$.name\", containing(\"Tom\")))\n                .willReturn(ok(\"Yep\"))\n                .build(),\n            mockRequest().method(POST).url(\"/submatch\").body(\"{\\\"name\\\": \\\"Rob\\\"}\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"POST\\n\" + \"/submatch\\n\\n\" + \"$.name [contains] Tom\",\n                \"POST\\n\" + \"/submatch\\n\\n\" + \"Rob\")));\n  }\n\n  @Test\n  void includesSpecificDiffForJsonPathSubMatchWhenElementNotFound() {\n    Diff diff =\n        new Diff(\n            post(\"/submatch\")\n                .withRequestBody(matchingJsonPath(\"$.name\", containing(\"Tom\")))\n                .willReturn(ok(\"Yep\"))\n                .build(),\n            mockRequest().method(POST).url(\"/submatch\").body(\"{\\\"id\\\": \\\"abc123\\\"}\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"POST\\n\" + \"/submatch\\n\\n\" + \"$.name [contains] Tom\",\n                \"POST\\n\" + \"/submatch\\n\\n\" + \"{\\\"id\\\": \\\"abc123\\\"}\")));\n  }\n\n  @Test\n  void includeHostnameIfSpecifiedWithEqualTo() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\")).withHost(equalTo(\"my.host\")).build(),\n            mockRequest().host(\"wrong.host\").url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"my.host\\n\" + \"ANY\\n\" + \"/thing\\n\", \"wrong.host\\n\" + \"ANY\\n\" + \"/thing\\n\")));\n  }\n\n  @Test\n  void includeHostnameIfSpecifiedWithNonEqualTo() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\")).withHost(containing(\"my.host\")).build(),\n            mockRequest().host(\"wrong.host\").url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"[contains] my.host\\n\" + \"ANY\\n\" + \"/thing\\n\",\n                \"wrong.host\\n\" + \"ANY\\n\" + \"/thing\\n\")));\n  }\n\n  @Test\n  void includeClientIpIfSpecified() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, anyUrl()).withClientIp(equalTo(\"192.168.1.1\")).build(),\n            mockRequest().clientIp(\"192.168.2.2\").url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"equalTo 192.168.1.1\\n\" + \"ANY\\n\" + \"/thing\\n\",\n                \"192.168.2.2\\n\" + \"ANY\\n\" + \"/thing\\n\")));\n  }\n\n  @Test\n  void includePortIfSpecified() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\")).withPort(5544).build(),\n            mockRequest().port(6543).url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"5544\\n\" + \"ANY\\n\" + \"/thing\\n\", \"6543\\n\" + \"ANY\\n\" + \"/thing\\n\")));\n  }\n\n  @Test\n  void includeSchemeIfSpecified() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\")).withScheme(\"https\").build(),\n            mockRequest().scheme(\"http\").url(\"/thing\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"https\\n\" + \"ANY\\n\" + \"/thing\\n\", \"http\\n\" + \"ANY\\n\" + \"/thing\\n\")));\n  }\n\n  @Test\n  void handleExceptionGettingExpressionResultDueToEmptyBody() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withRequestBody(matchingJsonPath(\"$.accountNum\", equalTo(\"1234\")))\n                .build(),\n            mockRequest().url(\"/thing\").body(\"\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"$.accountNum [equalTo] 1234\",\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\")));\n  }\n\n  @Test\n  void handleExceptionGettingExpressionResultDueToNonJson() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withRequestBody(matchingJsonPath(\"$.accountNum\", equalTo(\"1234\")))\n                .build(),\n            mockRequest().url(\"/thing\").body(\"not json\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"$.accountNum [equalTo] 1234\",\n                \"ANY\\n\" + \"/thing\\n\" + \"\\n\" + \"not json\")));\n  }\n\n  @Test\n  void pathParametersWithNoMatcherAreNotRendered() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlPathTemplate(\"/things/{thingId}/bookings/{bookingId}\"))\n                .withPathParam(\"thingId\", equalTo(\"1234\"))\n                .build(),\n            mockRequest().url(\"/things/4321/bookings/whatever\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"ANY\\n/things/4321/bookings/whatever\\n\\nPath parameter: thingId = 1234\\n\",\n                \"ANY\\n/things/4321/bookings/whatever\\n\\n4321\\n\")));\n  }\n\n  @Test\n  void showsDiffForDodgyUrls() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(GET, urlPathEqualTo(\"/news\"))\n                .withQueryParam(\"page\", equalTo(\"page\"))\n                .build(),\n            mockRequest().method(POST).url(\"/news?page={page}\"));\n\n    assertThat(\n        diff.toString(),\n        is(\n            junitStyleDiffMessage(\n                \"GET\\n/news?page={page}\\n\\nQuery: page = page\\n\",\n                \"POST\\n/news?page={page}\\n\\npage: {page}\\n\")));\n  }\n}\n"
  },
  {
    "path": "src/test/java/com/github/tomakehurst/wiremock/verification/diff/PlainTextDiffRendererTest.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.Json.prettyPrint;\nimport static com.github.tomakehurst.wiremock.common.Strings.normaliseLineBreaks;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.*;\nimport static com.github.tomakehurst.wiremock.matching.MockMultipart.mockPart;\nimport static com.github.tomakehurst.wiremock.matching.MockRequest.mockRequest;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.testsupport.TestFiles.file;\nimport static com.github.tomakehurst.wiremock.testsupport.WireMatchers.equalsMultiLine;\nimport static org.hamcrest.MatcherAssert.assertThat;\n\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.FormParameter;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.EagerMatchResult;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.matching.WeightedAggregateMatchResult;\nimport com.github.tomakehurst.wiremock.matching.WeightedMatchResult;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.DisabledForJreRange;\nimport org.junit.jupiter.api.condition.DisabledOnOs;\nimport org.junit.jupiter.api.condition.EnabledForJreRange;\nimport org.junit.jupiter.api.condition.EnabledOnOs;\nimport org.junit.jupiter.api.condition.JRE;\nimport org.junit.jupiter.api.condition.OS;\n\nclass PlainTextDiffRendererTest {\n\n  PlainTextDiffRenderer diffRenderer;\n\n  @BeforeEach\n  void init() {\n    diffRenderer =\n        new PlainTextDiffRenderer(\n            Map.of(\n                \"my-custom-matcher\", new MyCustomMatcher(),\n                \"self-describing-custom-matcher\", new SelfDescribingCustomMatcher(),\n                \"weighted-self-describing-custom-matcher\", new WeightedDescribingCustomMatcher()));\n  }\n\n  @Test\n  void rendersWithDifferingUrlHeaderAndJsonBody() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\n                    \"The post stub with a really long name that ought to wrap and let us see exactly how that looks when it is done\")\n                .withHeader(\"X-My-Header\", containing(\"correct value\"))\n                .withHeader(\"Accept\", matching(\"text/plain.*\"))\n                .withRequestBody(\n                    equalToJson(\n                        \"{     \\n\"\n                            + \"    \\\"thing\\\": {               \\n\"\n                            + \"        \\\"stuff\\\": [1, 2, 3]   \\n\"\n                            + \"    }                          \\n\"\n                            + \"}\"))\n                .build(),\n            mockRequest()\n                .method(POST)\n                .url(\"/thin\")\n                .header(\"X-My-Header\", \"wrong value\")\n                .header(\"Accept\", \"text/plain\")\n                .body(\n                    \"{                        \\n\"\n                        + \"    \\\"thing\\\": {           \\n\"\n                        + \"        \\\"nothing\\\": {}    \\n\"\n                        + \"    }                      \\n\"\n                        + \"}\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_ascii.txt\")));\n  }\n\n  @Test\n  void rendersWithDifferingCookies() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\"Cookie diff\")\n                .withCookie(\"Cookie_1\", containing(\"one value\"))\n                .withCookie(\"Second_Cookie\", matching(\"cookie two value [0-9]*\"))\n                .build(),\n            mockRequest()\n                .method(POST)\n                .url(\"/thing\")\n                .cookie(\"Cookie_1\", \"zero value\")\n                .cookie(\"Second_Cookie\", \"cookie two value 123\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_cookies.txt\")));\n  }\n\n  @Test\n  void rendersWithDifferingQueryParameters() {\n    Diff diff =\n        new Diff(\n            get(urlPathEqualTo(\"/thing\"))\n                .withName(\"Query params diff\")\n                .withQueryParam(\"one\", equalTo(\"1\"))\n                .withQueryParam(\"two\", containing(\"two things\"))\n                .withQueryParam(\"three\", matching(\"[a-z]{5}\"))\n                .build(),\n            mockRequest().method(GET).url(\"/thing?one=2&two=wrong%20things&three=abcde\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_query.txt\")));\n  }\n\n  @Test\n  void rendersWithDifferingFormParameters() {\n    Diff diff =\n        new Diff(\n            put(urlPathEqualTo(\"/thing\"))\n                .withName(\"Query params diff\")\n                .withFormParam(\"one\", equalTo(\"1\"))\n                .withFormParam(\"two\", containing(\"two things\"))\n                .withFormParam(\"three\", matching(\"[a-z]{5}\"))\n                .build(),\n            mockRequest()\n                .method(PUT)\n                .url(\"/thing\")\n                .formParameters(getFormParameters())\n                .header(\"Content-Type\", \"application/x-www-form-urlencoded\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_form.txt\")));\n  }\n\n  private Map<String, FormParameter> getFormParameters() {\n    Map<String, FormParameter> formParameters = new HashMap<>();\n    formParameters.put(\"one\", new FormParameter(\"one\", List.of(\"2\")));\n    formParameters.put(\"two\", new FormParameter(\"two\", List.of(\"wrong things\")));\n    formParameters.put(\"three\", new FormParameter(\"three\", List.of(\"abcde\")));\n    return formParameters;\n  }\n\n  @Test\n  void wrapsLargeJsonBodiesAppropriately() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\n                    \"The post stub with a really long name that ought to wrap and let us see exactly how that looks when it is done\")\n                .withHeader(\"Accept\", equalTo(\"text/plain\"))\n                .withRequestBody(\n                    equalToJson(\n                        \"{\\n\"\n                            + \"  \\\"one\\\": {\\n\"\n                            + \"    \\\"two\\\": {\\n\"\n                            + \"      \\\"three\\\": {\\n\"\n                            + \"        \\\"four\\\": {\\n\"\n                            + \"          \\\"five\\\": {\\n\"\n                            + \"            \\\"six\\\": \\\"superduperlongvaluethatshouldwrapokregardless_superduperlongvaluethatshouldwrapokregardless_superduperlongvaluethatshouldwrapokregardless_superduperlongvaluethatshouldwrapokregardless\\\"\\n\"\n                            + \"          }\\n\"\n                            + \"        }\\n\"\n                            + \"      }\\n\"\n                            + \"    }\\n\"\n                            + \"  }\\n\"\n                            + \"}\"))\n                .build(),\n            mockRequest()\n                .method(POST)\n                .url(\"/thing\")\n                .header(\"Accept\", \"text/plain\")\n                .body(\n                    prettyPrint(\n                        \"{\\n\"\n                            + \"  \\\"one\\\": {\\n\"\n                            + \"    \\\"two\\\": {\\n\"\n                            + \"      \\\"three\\\": {\\n\"\n                            + \"        \\\"four\\\": {\\n\"\n                            + \"          \\\"five\\\": {\\n\"\n                            + \"            \\\"six\\\": \\\"totally_the_wrong_value\\\"\\n\"\n                            + \"          }\\n\"\n                            + \"        }\\n\"\n                            + \"      }\\n\"\n                            + \"    }\\n\"\n                            + \"  }\\n\"\n                            + \"}\")));\n\n    String output = diffRenderer.render(diff);\n\n    // Ugh. The joys of Microsoft's line ending innovations.\n    String expected =\n        System.getProperty(\"os.name\").startsWith(\"Windows\")\n            ? file(\"not-found-diff-sample_large_json_windows.txt\")\n            : file(\"not-found-diff-sample_large_json.txt\");\n\n    System.out.println(\"expected:\\n\" + expected);\n    System.out.println(\"actual:\\n\" + output);\n\n    assertThat(normaliseLineBreaks(output), equalsMultiLine(expected));\n  }\n\n  @Test\n  @DisabledForJreRange(min = JRE.JAVA_11, disabledReason = \"Wrap differs per JRE\")\n  void wrapsLargeXmlBodiesAppropriatelyJre8() {\n    String output = wrapsLargeXmlBodiesAppropriately();\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_large_xml_jre8.txt\")));\n  }\n\n  @Test\n  @EnabledForJreRange(min = JRE.JAVA_11, disabledReason = \"Wrap differs per JRE\")\n  @DisabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void wrapsLargeXmlBodiesAppropriatelyJre11() {\n    String output = wrapsLargeXmlBodiesAppropriately();\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_large_xml_jre11.txt\")));\n  }\n\n  @Test\n  @EnabledForJreRange(min = JRE.JAVA_11, disabledReason = \"Wrap differs per JRE\")\n  @EnabledOnOs(value = OS.WINDOWS, disabledReason = \"Wrap differs per OS\")\n  void wrapsLargeXmlBodiesAppropriatelyJre11Windows() {\n    String output = wrapsLargeXmlBodiesAppropriately();\n\n    String expected = file(\"not-found-diff-sample_large_xml_jre11_windows.txt\");\n    System.out.println(\"expected:\\n\" + expected);\n    System.out.println(\"output:\\n\" + output);\n    assertThat(output, equalsMultiLine(expected));\n  }\n\n  private String wrapsLargeXmlBodiesAppropriately() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\n                    \"The post stub with a really long name that ought to wrap and let us see exactly how that looks when it is done\")\n                .withRequestBody(\n                    equalToXml(\n                        \"<deep-things>\\n\"\n                            + \"  <thing id=\\\"1\\\">\\n\"\n                            + \"    <thing id=\\\"2\\\">\\n\"\n                            + \"      <thing id=\\\"3\\\">\\n\"\n                            + \"        <thing id=\\\"4\\\">\\n\"\n                            + \"          <thing id=\\\"5\\\">\\n\"\n                            + \"            <thing id=\\\"6\\\">\\n\"\n                            + \"              Super wrong bit of text that should push it way over the length limit!\\n\"\n                            + \"            </thing>\\n\"\n                            + \"          </thing>\\n\"\n                            + \"        </thing>\\n\"\n                            + \"      </thing>\\n\"\n                            + \"    </thing>\\n\"\n                            + \"  </thing>\\n\"\n                            + \"</deep-things>\"))\n                .build(),\n            mockRequest()\n                .method(POST)\n                .url(\"/thing\")\n                .body(\n                    \"<deep-things>\\n\"\n                        + \"  <thing id=\\\"1\\\">\\n\"\n                        + \"    <thing id=\\\"2\\\">\\n\"\n                        + \"      <thing id=\\\"3\\\">\\n\"\n                        + \"        <thing id=\\\"4\\\">\\n\"\n                        + \"          <thing id=\\\"5\\\">\\n\"\n                        + \"            <thing id=\\\"6\\\">\\n\"\n                        + \"              Super long bit of text that should push it way over the length limit!\\n\"\n                        + \"            </thing>\\n\"\n                        + \"          </thing>\\n\"\n                        + \"        </thing>\\n\"\n                        + \"      </thing>\\n\"\n                        + \"    </thing>\\n\"\n                        + \"  </thing>\\n\"\n                        + \"</deep-things>\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n    return output;\n  }\n\n  @Test\n  void showsMissingHeaderMessage() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\"Missing header stub\")\n                .withHeader(\"X-My-Header\", equalTo(\"correct value\"))\n                .build(),\n            mockRequest().method(POST).url(\"/thing\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_missing_header.txt\")));\n  }\n\n  @Test\n  void showsJsonPathMismatch() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withRequestBody(matchingJsonPath(\"$..six\"))\n                .withRequestBody(matchingJsonPath(\"$..seven\"))\n                .build(),\n            mockRequest()\n                .method(POST)\n                .url(\"/thing\")\n                .body(\n                    prettyPrint(\n                        \"{\\n\"\n                            + \"  \\\"one\\\": {\\n\"\n                            + \"    \\\"two\\\": {\\n\"\n                            + \"      \\\"three\\\": {\\n\"\n                            + \"        \\\"four\\\": {\\n\"\n                            + \"          \\\"five\\\": {\\n\"\n                            + \"            \\\"six\\\": \\\"match this\\\"\\n\"\n                            + \"          }\\n\"\n                            + \"        }\\n\"\n                            + \"      }\\n\"\n                            + \"    }\\n\"\n                            + \"  }\\n\"\n                            + \"}\")));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    String expected = file(\"not-found-diff-sample_json-path.txt\");\n    assertThat(output, equalsMultiLine(expected));\n  }\n\n  @Test\n  void showsXPathWithSubMatchMismatch() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\").withRequestBody(matchingXPath(\"//thing/text()\", equalTo(\"two\"))).build(),\n            mockRequest()\n                .method(POST)\n                .url(\"/thing\")\n                .body(\"<stuff>\\n\" + \"    <thing>one</thing>\\n\" + \"</stuff>\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    String expected = file(\"not-found-diff-sample_xpath-with-submatch.txt\");\n    assertThat(output, equalsMultiLine(expected));\n  }\n\n  @Test\n  void showsUrlRegexUnescapedMessage() {\n    Diff diff =\n        new Diff(\n            get(urlMatching(\"thing?query=value\")).build(), mockRequest().method(GET).url(\"/thing\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_url-pattern.txt\")));\n  }\n\n  @Test\n  void showsUrlTemplateNonMatchMessage() {\n    Diff diff =\n        new Diff(\n            get(urlPathTemplate(\"/contacts/{contactId}\")).build(),\n            mockRequest().method(GET).url(\"/contracts/12345\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_url-template.txt\")));\n  }\n\n  @Test\n  void showsUrlPathParametersNonMatchMessage() {\n    Diff diff =\n        new Diff(\n            get(urlPathTemplate(\"/contacts/{contactId}\"))\n                .withPathParam(\"contactId\", equalTo(\"123\"))\n                .build(),\n            mockRequest().method(GET).url(\"/contacts/345\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_url-path-parameters.txt\")));\n  }\n\n  @Test\n  void showsMultipartDifference() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\"Multipart request body stub\")\n                .withMultipartRequestBody(\n                    aMultipart()\n                        .withName(\"part_one\")\n                        .withHeader(\"X-My-Stuff\", containing(\"stuff_parts\"))\n                        .withBody(matching(\"Some expected text.*\")))\n                .withMultipartRequestBody(\n                    aMultipart()\n                        .withHeader(\"X-More\", containing(\"stuff_parts\"))\n                        .withBody(equalTo(\"Correct body\")))\n                .build(),\n            mockRequest()\n                .method(POST)\n                .url(\"/thing\")\n                .header(\"Content-Type\", \"multipart/form-data\")\n                .part(\n                    mockPart()\n                        .name(\"part_one\")\n                        .header(\"X-My-Stuff\", \"wrong value\")\n                        .body(\"Wrong body\"))\n                .part(mockPart().name(\"part_two\").body(\"Correct body\")));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_multipart.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenMultipartExpectedButNotSent() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\"Multipart request body stub\")\n                .withMultipartRequestBody(\n                    aMultipart()\n                        .withHeader(\"X-My-Stuff\", containing(\"stuff_parts\"))\n                        .withBody(matching(\"Some expected text.*\")))\n                .build(),\n            mockRequest().method(POST).url(\"/thing\").body(\"Non-multipart body\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_no-multipart.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenInlineCustomMatcherNotSatisfiedInMixedStub() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\"Standard and custom matched stub\")\n                .andMatching(value -> MatchResult.noMatch())\n                .build(),\n            mockRequest().method(POST).url(\"/thing\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_mixed-matchers.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenNamedCustomMatcherNotSatisfiedInMixedStub() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\"Standard and custom matched stub\")\n                .andMatching(\"my-custom-matcher\", Parameters.one(\"myVal\", \"present\"))\n                .build(),\n            mockRequest().method(POST).url(\"/thing\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(\n        output, equalsMultiLine(file(\"not-found-diff-sample_mixed-matchers-named-custom.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenSelfDescribingNamedCustomMatcherNotSatisfiedInMixedStub() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\"Standard and custom matched stub\")\n                .andMatching(\"self-describing-custom-matcher\", Parameters.one(\"myVal\", \"present\"))\n                .build(),\n            mockRequest().method(POST).url(\"/thing\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(\n        output,\n        equalsMultiLine(\n            file(\"not-found-diff-sample_mixed-matchers-self-describing-named-custom.txt\")));\n  }\n\n  @Test\n  void\n      showsErrorInDiffWhenWeightedSelfDescribingNamedCustomMatcherNotSatisfiedInMixedStubDoesNotShowCustomDiff() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\"Standard and weighted custom matched stub\")\n                .andMatching(\n                    \"weighted-self-describing-custom-matcher\", Parameters.one(\"myVal\", \"present\"))\n                .build(),\n            mockRequest().method(POST).url(\"/thing\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(\n        output,\n        equalsMultiLine(file(\"not-found-diff-sample_mixed-matchers-weighted-named-custom.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenExactMatchForMultipleValuesInQueryParamNotSatisfiedInStub() {\n    Diff diff =\n        new Diff(\n            get(urlPathEqualTo(\"/thing\")).withQueryParam(\"q\", havingExactly(\"1\", \"2\", \"3\")).build(),\n            mockRequest().method(GET).url(\"/thing?q=2\"));\n\n    String output = diffRenderer.render(diff);\n    assertThat(\n        output,\n        equalsMultiLine(\n            file(\"not-found-diff-sample_exactmatch-for-multiple-values-query-param.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenIncludesMatchForMultipleValuesInQueryParamNotSatisfiedInStub() {\n    Diff diff =\n        new Diff(\n            get(urlPathEqualTo(\"/thing\")).withQueryParam(\"q\", including(\"1\", \"2\", \"3\")).build(),\n            mockRequest().method(GET).url(\"/thing?q=1\"));\n\n    String output = diffRenderer.render(diff);\n    assertThat(\n        output,\n        equalsMultiLine(\n            file(\"not-found-diff-sample_includematch-for-multiple-values-query-param.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenExactMatchForMultipleValuesInHeaderNotSatisfiedInStub() {\n    Diff diff =\n        new Diff(\n            get(urlPathEqualTo(\"/thing\")).withHeader(\"q\", havingExactly(\"1\", \"2\", \"3\")).build(),\n            mockRequest().method(GET).url(\"/thing\").header(\"q\", \"1\"));\n\n    String output = diffRenderer.render(diff);\n    assertThat(\n        output,\n        equalsMultiLine(file(\"not-found-diff-sample_exactmatch-for-multiple-values-header.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenIncludesMatchForMultipleValuesInHeaderNotSatisfiedInStub() {\n    Diff diff =\n        new Diff(\n            get(urlPathEqualTo(\"/thing\")).withHeader(\"q\", including(\"1\", \"2\", \"3\")).build(),\n            mockRequest().method(GET).url(\"/thing\").header(\"q\", \"1\"));\n\n    String output = diffRenderer.render(diff);\n    assertThat(\n        output,\n        equalsMultiLine(file(\"not-found-diff-sample_includematch-for-multiple-values-header.txt\")));\n  }\n\n  @Test\n  void showsAppropriateErrorInDiffWhenCustomMatcherIsUsedExclusively() {\n    Diff diff =\n        new Diff(\n            requestMatching(value -> MatchResult.noMatch()).build(),\n            mockRequest().method(POST).url(\"/thing\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_only-custom_matcher.txt\")));\n  }\n\n  @Test\n  void handlesUrlsWithQueryStringAndNoPath() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(GET, urlMatching(\"/?q=correct\")).build(),\n            mockRequest().method(GET).url(\"/q=wrong\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-found-diff-sample_no-path.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenBodyDoesNotMatchJsonSchema() {\n    Diff diff =\n        new Diff(\n            post(\"/thing\")\n                .withName(\"JSON schema stub\")\n                .withRequestBody(matchingJsonSchema(file(\"schema-validation/new-pet.schema.json\")))\n                .build(),\n            mockRequest()\n                .url(\"/thing\")\n                .method(POST)\n                .body(file(\"schema-validation/new-pet.invalid.json\")));\n\n    String output = diffRenderer.render(diff);\n\n    assertThat(\n        normaliseLineBreaks(output),\n        equalsMultiLine(file(\"not-found-diff-sample_json-schema.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenBodyIsEmptyAndPathExpressionResult() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withRequestBody(matchingJsonPath(\"$.accountNum\", equalTo(\"1234\")))\n                .build(),\n            mockRequest().url(\"/thing\").body(\"\"));\n\n    String output = diffRenderer.render(diff);\n\n    assertThat(\n        normaliseLineBreaks(output),\n        equalsMultiLine(file(\"not-found-diff-sample_json-path-no-body.txt\")));\n  }\n\n  @Test\n  void showsErrorInDiffWhenBodyIsNotJsonAndPathExpressionResult() {\n    Diff diff =\n        new Diff(\n            newRequestPattern(ANY, urlEqualTo(\"/thing\"))\n                .withRequestBody(matchingJsonPath(\"$.accountNum\", equalTo(\"1234\")))\n                .build(),\n            mockRequest().url(\"/thing\").body(\"not json\"));\n\n    String output = diffRenderer.render(diff);\n\n    assertThat(\n        normaliseLineBreaks(output),\n        equalsMultiLine(file(\"not-found-diff-sample_json-path-body-not-json.txt\")));\n  }\n\n  @Test\n  void doesNotIncorrectlyShowUrlPathParametersNonMatchMessage() {\n    Diff diff =\n        new Diff(\n            get(urlPathTemplate(\"/contacts/{contactId}\"))\n                .withPathParam(\"contactId\", equalTo(\"123\"))\n                .withHeader(\"Authorization\", equalTo(\"Token 456\"))\n                .build(),\n            mockRequest().method(GET).url(\"/contacts/123\").header(\"Authorization\", \"Token 789\"));\n\n    String output = diffRenderer.render(diff);\n\n    assertThat(\n        output, equalsMultiLine(file(\"not-found-diff-sample_no_path_parameter_message.txt\")));\n  }\n\n  @Test\n  void showsIsOneOfMissingMethodMessage() {\n    Diff diff =\n        new Diff(\n            request(isOneOf(GET, PUT), urlEqualTo(\"/url\")).build(),\n            mockRequest().method(POST).url(\"/url\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-match-isOneOf-v1.txt\")));\n  }\n\n  @Test\n  void showsIsNoneOfMissingMethodMessage() {\n    Diff diff =\n        new Diff(\n            request(isNoneOf(GET, PUT), urlEqualTo(\"/url\")).build(),\n            mockRequest().method(GET).url(\"/url\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-match-isNoneOf-v1.txt\")));\n  }\n\n  @Test\n  void showsMissingUrlMessageMethodIsOneOfVersion1() {\n    Diff diff =\n        new Diff(\n            request(isOneOf(GET, PUT), urlEqualTo(\"/url\")).build(),\n            mockRequest().method(GET).url(\"/wrong-url\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-match-isOneOf-v2.txt\")));\n  }\n\n  @Test\n  void showsMissingUrlMessageMethodIsNoneOfVersion1() {\n    Diff diff =\n        new Diff(\n            request(isNoneOf(GET, PUT), urlEqualTo(\"/url\")).build(),\n            mockRequest().method(POST).url(\"/wrong-url\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-match-isNoneOf-v2.txt\")));\n  }\n\n  @Test\n  void showsMissingUrlMessageMethodIsOneOfVersion2() {\n    Diff diff =\n        new Diff(\n            request(isOneOf(POST, PUT), urlEqualTo(\"/url\")).build(),\n            mockRequest().method(GET).url(\"/wrong-url\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-match-isOneOf-v3.txt\")));\n  }\n\n  @Test\n  void showsMissingUrlMessageMethodIsNoneOfVersion2() {\n    Diff diff =\n        new Diff(\n            request(isNoneOf(POST, PUT), urlEqualTo(\"/url\")).build(),\n            mockRequest().method(PUT).url(\"/wrong-url\"));\n\n    String output = diffRenderer.render(diff);\n    System.out.println(output);\n\n    assertThat(output, equalsMultiLine(file(\"not-match-isNoneOf-v3.txt\")));\n  }\n\n  public static class MyCustomMatcher extends RequestMatcherExtension {\n\n    @Override\n    public MatchResult match(Request request, Parameters parameters) {\n      parameters.getString(\"myVal\"); // Ensure we're getting passed parameters as expected\n      return MatchResult.noMatch();\n    }\n\n    @Override\n    public String getName() {\n      return \"my-custom-matcher\";\n    }\n  }\n\n  public static class SelfDescribingCustomMatcher extends RequestMatcherExtension {\n\n    @Override\n    public MatchResult match(Request request, Parameters parameters) {\n      parameters.getString(\"myVal\"); // Ensure we're getting passed parameters as expected\n      final MatchResult.DiffDescription diffDescription =\n          new MatchResult.DiffDescription(\n              \"Property a: foo\",\n              \"Property a: bar\",\n              \"Not matched because of property a not matching\");\n      final MatchResult.DiffDescription diffDescription2 =\n          new MatchResult.DiffDescription(\n              \"Property b: foo\",\n              \"Property b: bar\",\n              \"Not matched because of property b not matching\");\n      return new EagerMatchResult(1, List.of(), List.of(diffDescription, diffDescription2));\n    }\n\n    @Override\n    public String getName() {\n      return \"self-describing-custom-matcher\";\n    }\n  }\n\n  public static class WeightedDescribingCustomMatcher extends RequestMatcherExtension {\n\n    @Override\n    public MatchResult match(Request request, Parameters parameters) {\n      parameters.getString(\"myVal\"); // Ensure we're getting passed parameters as expected\n      final MatchResult.DiffDescription diffDescription =\n          new MatchResult.DiffDescription(\"Expected x\", \"Found y\", \"Not matched due to x != y\");\n      final MatchResult.DiffDescription diffDescription2 =\n          new MatchResult.DiffDescription(\"Expected a\", \"Found b\", \"Not matched due to a != b\");\n      final MatchResult.DiffDescription diffDescription3 =\n          new MatchResult.DiffDescription(\"Expected c\", \"Found d\", \"Not matched due to c != d\");\n      return new WeightedAggregateMatchResult(\n          List.of(\n              WeightedMatchResult.weight(\n                  new EagerMatchResult(1, List.of(), List.of(diffDescription, diffDescription2))),\n              WeightedMatchResult.weight(\n                  new EagerMatchResult(1, List.of(), List.of(diffDescription3)))));\n    }\n\n    @Override\n    public String getName() {\n      return \"weighted-self-describing-custom-matcher\";\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/ignored/Examples.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage ignored;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.common.DateTimeTruncation.FIRST_DAY_OF_MONTH;\nimport static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;\nimport static java.util.Collections.singletonList;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.AcceptanceTestBase;\nimport com.github.tomakehurst.wiremock.client.VerificationException;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.DateTimeUnit;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestFilterAction;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestWrapper;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.StubRequestFilter;\nimport com.github.tomakehurst.wiremock.http.Fault;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.jetty.JettyHttpServerFactory;\nimport com.github.tomakehurst.wiremock.jetty.JettySettings;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockResponse;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\nimport org.junit.jupiter.api.Test;\n\npublic class Examples extends AcceptanceTestBase {\n\n  @Test\n  public void exactUrlOnly() {\n    stubFor(\n        get(urlEqualTo(\"/some/thing\"))\n            .willReturn(\n                aResponse().withHeader(\"Content-Type\", \"text/plain\").withBody(\"Hello world!\")));\n\n    assertThat(testClient.get(\"/some/thing\").statusCode(), is(200));\n    assertThat(testClient.get(\"/some/thing/else\").statusCode(), is(404));\n  }\n\n  @Test\n  public void queryMethod() {\n    stubFor(\n        query(urlEqualTo(\"/some/thing\"))\n            .withRequestBody(matching(\"<status>OK</status>\"))\n            .willReturn(\n                aResponse().withHeader(\"Content-Type\", \"text/plain\").withBody(\"Hello world!\")));\n\n    assertThat(testClient.queryXml(\"/some/thing\", \"<status>OK</status>\").statusCode(), is(200));\n    assertThat(\n        testClient.queryXml(\"/some/thing\", \"<status>OK</status>\").content(), is(\"Hello World!\"));\n    assertThat(testClient.query(\"/some/thing/else\").statusCode(), is(404));\n  }\n\n  @Test\n  public void urlRegexMatch() {\n    stubFor(put(urlMatching(\"/thing/matching/[0-9]+\")).willReturn(aResponse().withStatus(200)));\n  }\n\n  @Test\n  public void headerMatching() {\n    stubFor(\n        post(urlEqualTo(\"/with/headers\"))\n            .withHeader(\"Content-Type\", equalTo(\"text/xml\"))\n            .withHeader(\"Accept\", matching(\"text/.*\"))\n            .withHeader(\"etag\", notMatching(\"abcd.*\"))\n            .withHeader(\"etag\", containing(\"2134\"))\n            .willReturn(aResponse().withStatus(200)));\n  }\n\n  @Test\n  public void bodyMatching() {\n    stubFor(\n        post(urlEqualTo(\"/with/body\"))\n            .withRequestBody(matching(\"<status>OK</status>\"))\n            .withRequestBody(notMatching(\"<status>ERROR</status>\"))\n            .willReturn(aResponse().withStatus(200)));\n  }\n\n  @Test\n  public void binaryBodyMatchingByteArray() {\n    stubFor(\n        post(urlEqualTo(\"/with/body\"))\n            .withRequestBody(binaryEqualTo(new byte[] {1, 2, 3}))\n            .willReturn(ok()));\n  }\n\n  @Test\n  public void binaryBodyMatchingBase64() {\n    stubFor(post(urlEqualTo(\"/with/body\")).withRequestBody(binaryEqualTo(\"AQID\")).willReturn(ok()));\n  }\n\n  @Test\n  public void multipartBodyMatchingBase64() {\n    stubFor(\n        post(urlEqualTo(\"/with/multipart\"))\n            .withMultipartRequestBody(aMultipart().withBody(binaryEqualTo(\"Content\")))\n            .willReturn(ok()));\n  }\n\n  @Test\n  public void priorities() {\n\n    // Catch-all case\n    stubFor(get(urlMatching(\"/api/.*\")).atPriority(5).willReturn(aResponse().withStatus(401)));\n\n    // Specific case\n    stubFor(\n        get(urlEqualTo(\"/api/specific-resource\"))\n            .atPriority(1) // 1 is highest\n            .willReturn(aResponse().withStatus(200).withBody(\"Resource state\")));\n  }\n\n  @Test\n  public void responseHeaders() {\n    stubFor(\n        get(urlEqualTo(\"/whatever\"))\n            .willReturn(\n                aResponse()\n                    .withStatus(200)\n                    .withHeader(\"Content-Type\", \"application/json\")\n                    .withHeader(\"Etag\", \"b13894794wb\")));\n  }\n\n  @Test\n  public void bodyFile() {\n    stubFor(\n        get(urlEqualTo(\"/body-file\")).willReturn(aResponse().withBodyFile(\"path/to/myfile.xml\")));\n  }\n\n  @Test\n  public void binaryBody() {\n    stubFor(\n        get(urlEqualTo(\"/binary-body\")).willReturn(aResponse().withBody(new byte[] {1, 2, 3, 4})));\n  }\n\n  @Test\n  public void verifyAtLeastOnce() {\n    assertThrows(\n        VerificationException.class,\n        () -> {\n          verify(\n              postRequestedFor(urlEqualTo(\"/verify/this\"))\n                  .withHeader(\"Content-Type\", equalTo(\"text/xml\")));\n\n          verify(3, postRequestedFor(urlEqualTo(\"/3/of/these\")));\n        });\n  }\n\n  @Test\n  public void verifyWithoutHeader() {\n    assertThrows(\n        VerificationException.class,\n        () -> verify(putRequestedFor(urlEqualTo(\"/without/header\")).withoutHeader(\"Content-Type\")));\n  }\n\n  @Test\n  public void verifyWithoutQueryParam() {\n    assertThrows(\n        VerificationException.class,\n        () ->\n            verify(\n                getRequestedFor(urlPathEqualTo(\"without/queryParam\"))\n                    .withoutQueryParam(\"test-param\")));\n  }\n\n  @Test\n  public void findingRequests() {\n    List<LoggedRequest> requests = findAll(putRequestedFor(urlMatching(\"/api/.*\")));\n  }\n\n  @Test\n  public void proxying() {\n    stubFor(\n        get(urlMatching(\"/other/service/.*\"))\n            .willReturn(aResponse().proxiedFrom(\"http://otherhost.com/approot\")));\n  }\n\n  @Test\n  public void proxyIntercept() {\n    // Low priority catch-all proxies to otherhost.com by default\n    stubFor(\n        get(urlMatching(\".*\"))\n            .atPriority(10)\n            .willReturn(aResponse().proxiedFrom(\"http://otherhost.com\")));\n\n    // High priority stub will send a Service Unavailable response\n    // if the specified URL is requested\n    stubFor(\n        get(urlEqualTo(\"/api/override/123\")).atPriority(1).willReturn(aResponse().withStatus(503)));\n  }\n\n  @Test\n  public void toDoListScenario() {\n    stubFor(\n        get(urlEqualTo(\"/todo/items\"))\n            .inScenario(\"To do list\")\n            .whenScenarioStateIs(STARTED)\n            .willReturn(aResponse().withBody(\"<items>\" + \"   <item>Buy milk</item>\" + \"</items>\")));\n\n    stubFor(\n        post(urlEqualTo(\"/todo/items\"))\n            .inScenario(\"To do list\")\n            .whenScenarioStateIs(STARTED)\n            .withRequestBody(containing(\"Cancel newspaper subscription\"))\n            .willReturn(aResponse().withStatus(201))\n            .willSetStateTo(\"Cancel newspaper item added\"));\n\n    stubFor(\n        get(urlEqualTo(\"/todo/items\"))\n            .inScenario(\"To do list\")\n            .whenScenarioStateIs(\"Cancel newspaper item added\")\n            .willReturn(\n                aResponse()\n                    .withBody(\n                        \"<items>\"\n                            + \"   <item>Buy milk</item>\"\n                            + \"   <item>Cancel newspaper subscription</item>\"\n                            + \"</items>\")));\n\n    WireMockResponse response = testClient.get(\"/todo/items\");\n    assertThat(response.content(), containsString(\"Buy milk\"));\n    assertThat(response.content(), not(containsString(\"Cancel newspaper subscription\")));\n\n    response =\n        testClient.postWithBody(\n            \"/todo/items\", \"Cancel newspaper subscription\", \"text/plain\", \"UTF-8\");\n    assertThat(response.statusCode(), is(201));\n\n    response = testClient.get(\"/todo/items\");\n    assertThat(response.content(), containsString(\"Buy milk\"));\n    assertThat(response.content(), containsString(\"Cancel newspaper subscription\"));\n  }\n\n  @Test\n  public void delay() {\n    stubFor(\n        get(urlEqualTo(\"/delayed\")).willReturn(aResponse().withStatus(200).withFixedDelay(2000)));\n  }\n\n  @Test\n  public void fault() {\n    stubFor(\n        get(urlEqualTo(\"/fault\"))\n            .willReturn(aResponse().withFault(Fault.MALFORMED_RESPONSE_CHUNK)));\n  }\n\n  @Test\n  public void xpath() {\n    stubFor(\n        put(urlEqualTo(\"/xpath\"))\n            .withRequestBody(matchingXPath(\"/todo-list[count(todo-item) = 3]\"))\n            .willReturn(aResponse().withStatus(200)));\n  }\n\n  @Test\n  public void xpathWithNamespaces() {\n    stubFor(\n        put(urlEqualTo(\"/namespaced/xpath\"))\n            .withRequestBody(\n                matchingXPath(\"/stuff:outer/stuff:inner[.=111]\")\n                    .withXPathNamespace(\"stuff\", \"http://foo.com\"))\n            .willReturn(aResponse().withStatus(200)));\n  }\n\n  @Test\n  public void advancedXPathMatching() {\n    stubFor(\n        put(urlEqualTo(\"/xpath\"))\n            .withRequestBody(matchingXPath(\"//todo-item/text()\", containing(\"wash\")))\n            .willReturn(aResponse().withStatus(200)));\n  }\n\n  @Test\n  public void advancedJSONPathMatching() {\n    stubFor(\n        put(urlEqualTo(\"/jsonpath\"))\n            .withRequestBody(matchingJsonPath(\"$..todoItem\", containing(\"wash\")))\n            .willReturn(aResponse().withStatus(200)));\n  }\n\n  @Test\n  public void advancedJSONPathMatchingWithObject() {\n    System.out.println(\n        matchingJsonPath(\"$.outer\", equalToJson(\"{\\n\" + \"        \\\"inner\\\": 42\\n\" + \"    }\"))\n            .match(\"{\\n\" + \"    \\\"outer\\\": {\\n\" + \"        \\\"inner\\\": 42\\n\" + \"    }\\n\" + \"}\")\n            .isExactMatch());\n  }\n\n  @Test\n  public void transformerParameters() {\n    stubFor(\n        get(urlEqualTo(\"/transform\"))\n            .willReturn(\n                aResponse()\n                    .withTransformerParameter(\"newValue\", 66)\n                    .withTransformerParameter(\"inner\", Map.of(\"thing\", \"value\"))));\n\n    System.out.println(\n        get(urlEqualTo(\"/transform\"))\n            .willReturn(\n                aResponse()\n                    .withTransformerParameter(\"newValue\", 66)\n                    .withTransformerParameter(\"inner\", Map.of(\"thing\", \"value\")))\n            .build());\n  }\n\n  @Test\n  public void transformerWithParameters() {\n    stubFor(\n        get(urlEqualTo(\"/transform\"))\n            .willReturn(aResponse().withTransformer(\"body-transformer\", \"newValue\", 66)));\n\n    System.out.println(\n        get(urlEqualTo(\"/transform\"))\n            .willReturn(aResponse().withTransformer(\"body-transformer\", \"newValue\", 66))\n            .build());\n  }\n\n  @Test\n  public void customMatcherName() {\n    stubFor(\n        requestMatching(\"body-too-long\", Parameters.one(\"maxLemgth\", 2048))\n            .willReturn(aResponse().withStatus(422)));\n\n    System.out.println(\n        requestMatching(\"body-too-long\", Parameters.one(\"maxLemgth\", 2048))\n            .willReturn(aResponse().withStatus(422))\n            .build());\n  }\n\n  @Test\n  public void customMatcher() {\n    wireMockServer.stubFor(\n        requestMatching(\n                new RequestMatcherExtension() {\n                  @Override\n                  public MatchResult match(Request request, Parameters parameters) {\n                    return MatchResult.of(request.getBody().length > 2048);\n                  }\n                })\n            .willReturn(aResponse().withStatus(422)));\n  }\n\n  @Test\n  public void tmp() {\n    System.out.println(\n        Json.write(\n            any(urlPathEqualTo(\"/everything\"))\n                .withHeader(\"Accept\", containing(\"xml\"))\n                .withCookie(\"session\", matching(\".*12345.*\"))\n                .withQueryParam(\"search_term\", equalTo(\"WireMock\"))\n                .withBasicAuth(\"jeff@example.com\", \"jeffteenjefftyjeff\")\n                .withRequestBody(equalToXml(\"<search-results />\"))\n                .withRequestBody(matchingXPath(\"//search-results\"))\n                .withMultipartRequestBody(\n                    aMultipart()\n                        .withName(\"info\")\n                        .withHeader(\"Content-Type\", containing(\"charset\"))\n                        .withBody(equalToJson(\"{}\")))\n                .willReturn(aResponse())\n                .build()));\n\n    stubFor(\n        any(urlPathEqualTo(\"/everything\"))\n            .withHeader(\"Accept\", containing(\"xml\"))\n            .withCookie(\"session\", matching(\".*12345.*\"))\n            .withQueryParam(\"search_term\", equalTo(\"WireMock\"))\n            .withBasicAuth(\"jeff@example.com\", \"jeffteenjefftyjeff\")\n            .withRequestBody(equalToXml(\"<search-results />\"))\n            .withRequestBody(matchingXPath(\"//search-results\"))\n            .withMultipartRequestBody(\n                aMultipart()\n                    .withName(\"info\")\n                    .withHeader(\"Content-Type\", containing(\"charset\"))\n                    .withBody(equalToJson(\"{}\")))\n            .willReturn(aResponse()));\n  }\n\n  @Test\n  public void removeStubMapping() {\n    StubMapping stubMapping =\n        stubFor(get(urlEqualTo(\"/delete-me\")).willReturn(aResponse().withStatus(200)));\n    assertThat(testClient.get(\"/delete-me\").statusCode(), is(200));\n\n    removeStub(stubMapping);\n    assertThat(testClient.get(\"/delete-me\").statusCode(), is(404));\n  }\n\n  @Test\n  public void servedStubs() {\n    List<ServeEvent> allServeEvents = getAllServeEvents();\n  }\n\n  @Test\n  public void configuration() {\n    WireMockConfiguration.options()\n        // Statically set the HTTP port number. Defaults to 8080.\n        .port(8000)\n\n        // Disable HTTP listener.\n        .httpDisabled(true)\n\n        // Statically set the HTTPS port number. Defaults to 8443.\n        .httpsPort(8001)\n\n        // Randomly assign the HTTP port on startup\n        .dynamicPort()\n\n        // Randomly asssign the HTTPS port on startup\n        .dynamicHttpsPort()\n\n        // Bind the WireMock server to this IP address locally. Defaults to the loopback adaptor.\n        .bindAddress(\"192.168.1.111\")\n\n        // Set the number of request handling threads in Jetty. Defaults to 10.\n        .containerThreads(5)\n\n        // Set the HTTP server factory with custom settings. Defaults to JettyHttpServerFactory with\n        // default settings.\n        .httpServerFactory(\n            new JettyHttpServerFactory(\n                JettySettings.Builder.aJettySettings()\n                    // Set the number of connection acceptor threads in Jetty. Defaults to 2.\n                    .withAcceptors(4)\n\n                    // Set the Jetty accept queue size. Defaults to Jetty's default of unbounded.\n                    .withAcceptQueueSize(100)\n\n                    // Set the size of Jetty's request header buffer (to avoid exceptions when very\n                    // large request headers are sent). Defaults to 8192.\n                    .withRequestHeaderSize(16834)\n\n                    // Set the size of Jetty's response header buffer (to avoid exceptions when very\n                    // large request headers are sent). Defaults to 8192.\n                    .withResponseHeaderSize(16834)\n\n                    // Set the timeout to wait for Jetty to stop in milliseconds. Defaults to 0 (no\n                    // wait)\n                    .withStopTimeout(5000L)\n                    .build()))\n\n        // Set the keystore containing the HTTPS certificate\n        .keystorePath(\"/path/to/https-certs-keystore.jks\")\n\n        // Set the password to the keystore\n        .keystorePassword(\"verysecret!\")\n\n        // Require a client calling WireMock to present a client certificate\n        .needClientAuth(true)\n\n        // Path to the trust store containing the client certificate required in by the previous\n        // parameter\n        .trustStorePath(\"/path/to/trust-store.jks\")\n\n        // The password to the trust store\n        .trustStorePassword(\"trustme\")\n\n        // Make WireMock behave as a forward proxy e.g. via browser proxy settings\n        .enableBrowserProxying(true)\n\n        // Send the Host header in the original request onwards to the system being proxied to\n        .preserveHostHeader(false)\n\n        // Override the Host header sent when reverse proxying to another system (this and the\n        // previous parameter are mutually exclusive)\n        .proxyHostHeader(\"my.otherdomain.com\")\n\n        // Send the User-Agent header in the original request onwards to the system being proxied to\n        .preserveUserAgentProxyHeader(false)\n\n        // When reverse proxying, also route via the specified forward proxy (useful inside\n        // corporate firewalls)\n        .proxyVia(\"my.corporate.proxy\", 8080)\n\n        // Set the root of the filesystem WireMock will look under for files and mappings\n        .usingFilesUnderDirectory(\"/path/to/files-and-mappings-root\")\n\n        // Set a path within the classpath as the filesystem root\n        .usingFilesUnderClasspath(\"root/path/under/classpath\")\n\n        // Do not record received requests. Typically needed during load testing to avoid JVM heap\n        // exhaustion.\n        .disableRequestJournal()\n\n        // Limit the size of the request log (for the same reason as above).\n        .maxRequestJournalEntries(100)\n\n        // Provide an alternative notifier.\n        .notifier(new ConsoleNotifier(true));\n  }\n\n  @Test\n  public void abbreviatedDsl() {\n    stubFor(get(\"/some/thing\").willReturn(aResponse().withStatus(200)));\n\n    stubFor(delete(\"/fine\").willReturn(ok()));\n    stubFor(get(\"/json\").willReturn(okJson(\"{ \\\"message\\\": \\\"Hello\\\" }\")));\n    stubFor(get(\"/xml\").willReturn(okXml(\"<hello />\"))); // application/xml\n    stubFor(get(\"/xml\").willReturn(okTextXml(\"<hello />\"))); // text/xml\n    stubFor(post(\"/things\").willReturn(noContent()));\n    stubFor(\n        get(\"/json-from-string\").willReturn(jsonResponse(\"{ \\\"message\\\": \\\"String Json\\\" }\", 200)));\n    stubFor(\n        get(\"/json-from-object\").willReturn(jsonResponse(new MockResponse(\"Object Json\"), 200)));\n\n    stubFor(post(\"/temp-redirect\").willReturn(temporaryRedirect(\"/new/place\")));\n    stubFor(post(\"/perm-redirect\").willReturn(permanentRedirect(\"/new/place\")));\n    stubFor(post(\"/see-other\").willReturn(seeOther(\"/new/place\")));\n\n    stubFor(post(\"/sorry-no\").willReturn(unauthorized()));\n    stubFor(post(\"/still-no\").willReturn(forbidden()));\n\n    stubFor(put(\"/dodgy\").willReturn(badRequest()));\n    stubFor(put(\"/dodgy-body\").willReturn(badRequestEntity()));\n    stubFor(put(\"/nothing-to-see-here\").willReturn(notFound()));\n\n    stubFor(put(\"/status-only\").willReturn(status(418)));\n\n    stubFor(get(\"/dead-server\").willReturn(serviceUnavailable()));\n    stubFor(put(\"/error\").willReturn(serverError()));\n\n    stubFor(proxyAllTo(\"http://my.example.com\"));\n  }\n\n  @Test\n  public void recordingDsl() {\n    startRecording(\n        recordSpec()\n            .forTarget(\"http://example.mocklab.io\")\n            .onlyRequestsMatching(getRequestedFor(urlPathMatching(\"/api/.*\")))\n            .captureHeader(\"Accept\")\n            .captureHeader(\"Content-Type\", true)\n            .extractBinaryBodiesOver(10240)\n            .extractTextBodiesOver(2048)\n            .makeStubsPersistent(false)\n            .ignoreRepeatRequests()\n            .transformers(\"modify-response-header\")\n            .transformerParameters(Parameters.one(\"headerValue\", \"123\"))\n            .matchRequestBodyWithEqualToJson(false, true));\n\n    System.out.println(\n        Json.write(\n            recordSpec()\n                .forTarget(\"http://example.mocklab.io\")\n                .onlyRequestsMatching(getRequestedFor(urlPathMatching(\"/api/.*\")))\n                .captureHeader(\"Accept\")\n                .captureHeader(\"Content-Type\", true)\n                .extractBinaryBodiesOver(10240)\n                .extractTextBodiesOver(2048)\n                .makeStubsPersistent(false)\n                .ignoreRepeatRequests()\n                .transformers(\"modify-response-header\")\n                .transformerParameters(Parameters.one(\"headerValue\", \"123\"))\n                .matchRequestBodyWithEqualToJson(false, true)\n                .build()));\n  }\n\n  @Test\n  public void snapshotDsl() {\n    snapshotRecord(\n        recordSpec()\n            .onlyRequestsMatching(getRequestedFor(urlPathMatching(\"/api/.*\")))\n            .onlyRequestIds(singletonList(UUID.fromString(\"40a93c4a-d378-4e07-8321-6158d5dbcb29\")))\n            .captureHeader(\"Accept\")\n            .captureHeader(\"Content-Type\", true)\n            .extractBinaryBodiesOver(10240)\n            .extractTextBodiesOver(2048)\n            .makeStubsPersistent(false)\n            .ignoreRepeatRequests()\n            .transformers(\"modify-response-header\")\n            .transformerParameters(Parameters.one(\"headerValue\", \"123\"))\n            .chooseBodyMatchTypeAutomatically());\n\n    System.out.println(\n        Json.write(\n            recordSpec()\n                .onlyRequestsMatching(getRequestedFor(urlPathMatching(\"/api/.*\")))\n                .onlyRequestIds(\n                    singletonList(UUID.fromString(\"40a93c4a-d378-4e07-8321-6158d5dbcb29\")))\n                .captureHeader(\"Accept\")\n                .captureHeader(\"Content-Type\", true)\n                .extractBinaryBodiesOver(10240)\n                .extractTextBodiesOver(2048)\n                .makeStubsPersistent(false)\n                .ignoreRepeatRequests()\n                .transformers(\"modify-response-header\")\n                .transformerParameters(Parameters.one(\"headerValue\", \"123\"))\n                .chooseBodyMatchTypeAutomatically()\n                .build()));\n  }\n\n  @Test\n  public void customAndStandardMatcherJson() {\n    System.out.println(\n        Json.write(\n            get(urlPathMatching(\"/the/.*/one\"))\n                .andMatching(\"path-contains-param\", Parameters.one(\"path\", \"correct\"))\n                .willReturn(ok())\n                .build()));\n  }\n\n  @Test\n  public void dates() {\n    stubFor(\n        post(\"/dates\")\n            .withHeader(\"X-Munged-Date\", beforeNow().expectedOffset(3, DateTimeUnit.DAYS))\n            .withHeader(\"X-Finalised-Date\", before(\"now +2 months\"))\n            .willReturn(ok()));\n\n    stubFor(\n        post(\"/dates\")\n            .withRequestBody(\n                matchingJsonPath(\n                    \"$.completedDate\",\n                    equalToDateTime(\"2020-03-01T00:00:00Z\").truncateActual(FIRST_DAY_OF_MONTH)))\n            .willReturn(ok()));\n\n    System.out.println(\n        Json.write(\n            post(\"/dates\")\n                .withRequestBody(\n                    matchingJsonPath(\n                        \"$.completedDate\",\n                        equalToDateTime(\"2020-03-01T00:00:00Z\").truncateActual(FIRST_DAY_OF_MONTH)))\n                .willReturn(ok())\n                .build()));\n  }\n\n  @Test\n  public void logicalAnd() {\n    stubFor(\n        get(urlPathEqualTo(\"/and\"))\n            .withHeader(\"X-Some-Value\", and(matching(\"[a-z]+\"), containing(\"magicvalue\")))\n            .willReturn(ok()));\n\n    stubFor(\n        get(urlPathEqualTo(\"/and\"))\n            .withHeader(\"X-Some-Value\", matching(\"[a-z]+\").and(containing(\"magicvalue\")))\n            .willReturn(ok()));\n\n    System.out.println(\n        Json.write(\n            get(urlPathEqualTo(\"/and\"))\n                .withHeader(\"X-Some-Value\", matching(\"[a-z]+\").and(containing(\"magicvalue\")))\n                .willReturn(ok())\n                .build()));\n  }\n\n  @Test\n  public void logicalOr() {\n    stubFor(\n        get(urlPathEqualTo(\"/or\"))\n            .withQueryParam(\"search\", or(matching(\"[a-z]+\"), absent()))\n            .willReturn(ok()));\n\n    stubFor(\n        get(urlPathEqualTo(\"/or\"))\n            .withQueryParam(\"search\", matching(\"[a-z]+\").or(absent()))\n            .willReturn(ok()));\n\n    System.out.println(\n        Json.write(\n            get(urlPathEqualTo(\"/or\"))\n                .withQueryParam(\"search\", matching(\"[a-z]+\").or(absent()))\n                .willReturn(ok())\n                .build()));\n  }\n\n  @Test\n  public void jsonPathAndDates() {\n    stubFor(\n        post(\"/date-range\")\n            .withRequestBody(\n                matchingJsonPath(\n                    \"$.date\", before(\"2022-01-01T00:00:00\").and(after(\"2020-01-01T00:00:00\"))))\n            .willReturn(ok()));\n\n    System.out.println(\n        Json.write(\n            post(\"/date-range\")\n                .withRequestBody(\n                    matchingJsonPath(\n                        \"$.date\", before(\"2022-01-01T00:00:00\").and(after(\"2020-01-01T00:00:00\"))))\n                .willReturn(ok())\n                .build()));\n  }\n\n  public static class SimpleAuthRequestFilter extends StubRequestFilter {\n\n    @Override\n    public RequestFilterAction filter(Request request) {\n      if (request.header(\"Authorization\").firstValue().equals(\"Basic abc123\")) {\n        return RequestFilterAction.continueWith(request);\n      }\n\n      return RequestFilterAction.stopWith(ResponseDefinition.notAuthorised());\n    }\n\n    @Override\n    public String getName() {\n      return \"simple-auth\";\n    }\n  }\n\n  public static class UrlAndHeadersModifyingFilter extends StubRequestFilter {\n\n    @Override\n    public RequestFilterAction filter(Request request) {\n      Request wrappedRequest =\n          RequestWrapper.create()\n              .transformAbsoluteUrl(url -> url + \"extraparam=123\")\n              .addHeader(\"X-Custom-Header\", \"headerval\")\n              .wrap(request);\n\n      return RequestFilterAction.continueWith(wrappedRequest);\n    }\n\n    @Override\n    public String getName() {\n      return \"url-and-header-modifier\";\n    }\n  }\n\n  public static class MockResponse {\n    private final String message;\n\n    public MockResponse(String message) {\n      this.message = message;\n    }\n\n    public String getMessage() {\n      return message;\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/java/ignored/ManyUnmatchedRequestsTest.java",
    "content": "/*\n * Copyright (C) 2016-2022 Thomas Akehurst\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 */\npackage ignored;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class ManyUnmatchedRequestsTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort().withRootDirectory(\"src/main/resources/empty\"))\n          .failOnUnmatchedRequests(true)\n          .build();\n\n  WireMockTestClient client;\n\n  @BeforeEach\n  public void init() {\n    client = new WireMockTestClient(wm.getPort());\n  }\n\n  @Test\n  public void unmatched() {\n    wm.stubFor(get(urlEqualTo(\"/hit\")).willReturn(aResponse().withStatus(200)));\n\n    client.get(\"/a-near-mis\");\n    client.get(\"/near-misssss\");\n    client.get(\"/hit\");\n  }\n}\n"
  },
  {
    "path": "src/test/java/ignored/MassiveNearMissTest.java",
    "content": "/*\n * Copyright (C) 2020-2023 Thomas Akehurst\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 */\npackage ignored;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport com.google.common.base.Stopwatch;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class MassiveNearMissTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort())\n          .failOnUnmatchedRequests(false)\n          .build();\n\n  WireMockTestClient client;\n\n  @BeforeEach\n  public void setup() {\n    client = new WireMockTestClient(wm.getPort());\n  }\n\n  @Test\n  public void timeToCalculateBigNearMissDiffXml() {\n    final int stubs = 1000;\n    for (int i = 0; i < stubs; i++) {\n      wm.stubFor(\n          post(urlPathMatching(\"/things/.*/\" + i))\n              .withRequestBody(equalToXml(requestXml(i)))\n              .willReturn(ok(\"i: \" + i)));\n    }\n\n    final int drop = 2;\n    final int reps = 10;\n    List<Long> times = new ArrayList<>(reps);\n    long sum = 0;\n    for (int i = 0; i < reps; i++) {\n      Stopwatch stopwatch = Stopwatch.createStarted();\n      client.postXml(\n          \"/things/blah123/\" + (stubs / 2), \"<?xml version=\\\"1.0\\\"?><things id=\\\"\" + i + \"\\\"/>\");\n      stopwatch.stop();\n      long time = stopwatch.elapsed(MILLISECONDS);\n      times.add(time);\n      if (i > drop) sum += time;\n    }\n\n    System.out.printf(\n        \"Times:\\n%s\\n\", times.stream().map(Object::toString).collect(Collectors.joining(\"\\n\")));\n    long mean = sum / (reps - drop);\n    System.out.printf(\"Mean: %dms\\n\", mean);\n  }\n\n  private static String requestXml(int i) {\n    return String.format(\n        \"<?xml version=\\\"1.0\\\"?>\\n\"\n            + \"\\n\"\n            + \"<things id=\\\"%d\\\">\\n\"\n            + \"    <stuff id=\\\"1\\\"/>\\n\"\n            + \"    <fluff id=\\\"2\\\"/>\\n\"\n            + \"\\n\"\n            + \"    <inside>\\n\"\n            + \"        <deep-inside level=\\\"3\\\">\\n\"\n            + \"            <one/>\\n\"\n            + \"            <two/>\\n\"\n            + \"            <three/>\\n\"\n            + \"            <four/>\\n\"\n            + \"            <one/>\\n\"\n            + \"            <text subject=\\\"JWT\\\">\\n\"\n            + \"                JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or integrity protected with a Message Authentication Code (MAC) and/or encrypted.\\n\"\n            + \"            </text>\\n\"\n            + \"        </deep-inside>\\n\"\n            + \"    </inside>\\n\"\n            + \"\\n\"\n            + \"</things>\",\n        i);\n  }\n\n  @Test\n  public void timeToCalculateBigNearMissDiffJson() {\n    final int stubs = 1000;\n    for (int i = 0; i < stubs; i++) {\n      wm.stubFor(\n          post(urlPathMatching(\"/things/.*/\" + i))\n              .withRequestBody(equalToJson(requestJson(i)))\n              .willReturn(ok(\"i: \" + i)));\n    }\n\n    final int drop = 2;\n    final int reps = 30;\n    List<Long> times = new ArrayList<>(reps);\n    long sum = 0;\n    for (int i = 0; i < reps; i++) {\n      Stopwatch stopwatch = Stopwatch.createStarted();\n      client.postJson(\"/things/blah123/\" + (stubs / 2), \"{ \\\"wrong\\\": [1,2,3]}\");\n      stopwatch.stop();\n      long time = stopwatch.elapsed(MILLISECONDS);\n      times.add(time);\n      if (i > drop) sum += time;\n    }\n\n    System.out.printf(\n        \"Times:\\n%s\\n\", times.stream().map(Object::toString).collect(Collectors.joining(\"\\n\")));\n    long mean = sum / (reps - drop);\n    System.out.printf(\"Mean: %dms\\n\", mean);\n  }\n\n  private String requestJson(int i) {\n    return \"{\\n\"\n        + \"  \\\"children\\\": [\\n\"\n        + \"    {\\n\"\n        + \"      \\\"id\\\": \\\"9010946\\\",\\n\"\n        + \"      \\\"age\\\": 1,\\n\"\n        + \"      \\\"isRegistered\\\": false\\n\"\n        + \"    },\\n\"\n        + \"    {\\n\"\n        + \"      \\\"id\\\": \\\"9405762\\\",\\n\"\n        + \"      \\\"age\\\": 1,\\n\"\n        + \"      \\\"isRegistered\\\": true\\n\"\n        + \"    },\\n\"\n        + \"    {\\n\"\n        + \"      \\\"id\\\": \\\"9166586\\\",\\n\"\n        + \"      \\\"age\\\": 1,\\n\"\n        + \"      \\\"isRegistered\\\": false\\n\"\n        + \"    },\\n\"\n        + \"    {\\n\"\n        + \"      \\\"id\\\": \\\"7537984\\\",\\n\"\n        + \"      \\\"age\\\": 1,\\n\"\n        + \"      \\\"isRegistered\\\": true\\n\"\n        + \"    }\\n\"\n        + \"  ],\\n\"\n        + \"  \\\"category\\\": \\\"060\\\",\\n\"\n        + \"  \\\"id\\\": \\\"\"\n        + i\n        + \"\\\",\\n\"\n        + \"  \\\"isRegistered\\\": true,\\n\"\n        + \"  \\\"date\\\": \\\"20200312\\\"\\n\"\n        + \"}\";\n  }\n}\n"
  },
  {
    "path": "src/test/java/ignored/NearMissExampleTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage ignored;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;\nimport static org.apache.hc.core5.http.ContentType.APPLICATION_JSON;\n\nimport com.github.tomakehurst.wiremock.client.BasicCredentials;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class NearMissExampleTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort().withRootDirectory(\"src/main/resources/empty\"))\n          .failOnUnmatchedRequests(true)\n          .build();\n\n  WireMockTestClient client;\n\n  @BeforeEach\n  public void init() {\n    client = new WireMockTestClient(wm.getPort());\n  }\n\n  @Test\n  public void showFullUnmatchedVerification() {\n    client.get(\"/some-other-thing\");\n    client.get(\"/totally-something-else\");\n    client.get(\"/whatever\");\n    client.postWithBody(\n        \"/my-near-miss\",\n        \"{\\\"data\\\": { \\\"one\\\": 1}}\",\n        APPLICATION_JSON.getMimeType(),\n        withHeader(\"Content-Type\", \"application/json\"),\n        withHeader(\"X-Expected\", \"yes\"),\n        withHeader(\"X-Matched-1\", \"yes\"),\n        withHeader(\"Cookie\", \"this=that\"),\n        withHeader(\n            \"Authorization\",\n            new BasicCredentials(\"user\", \"wrong-pass\").asAuthorizationHeaderValue()));\n\n    wm.verify(\n        postRequestedFor(urlEqualTo(\"/a-near-miss\"))\n            .withHeader(\"Content-Type\", equalTo(\"text/json\"))\n            .withHeader(\"X-Expected\", equalTo(\"yes\"))\n            .withHeader(\"X-Matched-1\", matching(\"ye.*\"))\n            .withHeader(\"X-Matched-2\", containing(\"no\"))\n            .withCookie(\"this\", equalTo(\"other\"))\n            .withBasicAuth(new BasicCredentials(\"user\", \"pass\"))\n            .withRequestBody(equalToJson(\"{\\\"data\\\": { \\\"two\\\": 1}}\")));\n  }\n\n  @Test\n  public void showSingleUnmatchedRequest() {\n    wm.stubFor(get(urlEqualTo(\"/hit\")).willReturn(aResponse().withStatus(200)));\n    client.get(\"/near-misssss\");\n  }\n\n  @Test\n  public void showManyUnmatchedRequests() {\n    wm.stubFor(get(urlEqualTo(\"/hit\")).willReturn(aResponse().withStatus(200)));\n    client.get(\"/near-misssss\");\n    client.get(\"/hat\");\n    client.get(\"/whatevs\");\n  }\n}\n"
  },
  {
    "path": "src/test/java/ignored/SingleUnmatchedRequestTest.java",
    "content": "/*\n * Copyright (C) 2016-2022 Thomas Akehurst\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 */\npackage ignored;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\n\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class SingleUnmatchedRequestTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort().withRootDirectory(\"src/main/resources/empty\"))\n          .failOnUnmatchedRequests(true)\n          .build();\n\n  WireMockTestClient client;\n\n  @BeforeEach\n  public void init() {\n    client = new WireMockTestClient(wm.getPort());\n  }\n\n  @Test\n  public void unmatched() {\n    wm.stubFor(get(urlEqualTo(\"/hit\")).willReturn(aResponse().withStatus(200)));\n    client.get(\"/near-misssss\");\n  }\n}\n"
  },
  {
    "path": "src/test/java/ignored/VeryLongAsynchronousDelayAcceptanceTest.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage ignored;\n\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hamcrest.MatcherAssert.assertThat;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.jetty.JettyHttpServerFactory;\nimport com.github.tomakehurst.wiremock.jetty.JettySettings;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.io.IOException;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.ParseException;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\nimport org.apache.hc.core5.http.io.support.ClassicRequestBuilder;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class VeryLongAsynchronousDelayAcceptanceTest {\n\n  @RegisterExtension\n  public WireMockExtension wireMockRule =\n      WireMockExtension.newInstance().options(getOptions()).build();\n\n  private WireMockConfiguration getOptions() {\n    WireMockConfiguration wireMockConfiguration = new WireMockConfiguration();\n    wireMockConfiguration\n        .httpServerFactory(\n            new JettyHttpServerFactory(\n                JettySettings.Builder.aJettySettings().withAcceptors(1).build()))\n        .containerThreads(4);\n    wireMockConfiguration.asynchronousResponseEnabled(true);\n    wireMockConfiguration.asynchronousResponseThreads(10);\n    wireMockConfiguration.dynamicPort();\n    return wireMockConfiguration;\n  }\n\n  @Test\n  public void longDelayWithBodyMatch() throws IOException, ParseException {\n    String json =\n        \"{ \\\"id\\\": \\\"cb7872bd-89cd-4015-97d1-718779df7dfe\\\", \\\"priority\\\": 1, \\\"request\\\": { \\\"urlPattern\\\": \\\"/faulty.*/.*/path/path\\\", \\\"method\\\": \\\"POST\\\", \\\"bodyPatterns\\\": [ { \\\"matches\\\": \\\".*<xml>permissions</xml>.*\\\" } ] }, \\\"response\\\": { \\\"status\\\": 200, \\\"bodyFileName\\\": \\\"plain-example.txt\\\", \\\"fixedDelayMilliseconds\\\": 35000 } }\\n\";\n\n    wireMockRule.addStubMapping(Json.read(json, StubMapping.class));\n\n    CloseableHttpResponse response =\n        ApacheHttpClientFactory.createClient(120000)\n            .execute(\n                ClassicRequestBuilder.post(wireMockRule.url(\"/faulty/1/path/path\"))\n                    .setEntity(new StringEntity(\"<xml>permissions</xml>\"))\n                    .build());\n\n    assertThat(response.getCode(), is(200));\n    assertThat(EntityUtils.toString(response.getEntity()), is(\"Some example test from a file\"));\n  }\n}\n"
  },
  {
    "path": "src/test/java/ignored/WireMockRuleFailThenPass.java",
    "content": "/*\n * Copyright (C) 2016-2022 Thomas Akehurst\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 */\npackage ignored;\n\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport org.junit.jupiter.api.Test;\n\npublic class WireMockRuleFailThenPass {\n\n  // Generates a failure to illustrate a Rule bug whereby a failed test would cause BindExceptions\n  // on subsequent (otherwise passing) tests\n  @Test\n  public void fail() {\n    assertTrue(false);\n  }\n\n  @Test\n  public void succeed() {\n    assertTrue(true);\n  }\n}\n"
  },
  {
    "path": "src/test/resources/META-INF/services/com.github.tomakehurst.wiremock.MultipartParserLoader",
    "content": "com.github.tomakehurst.wiremock.jetty.Jetty12MultipartParserLoader"
  },
  {
    "path": "src/test/resources/archunit.properties",
    "content": "# must be set to true to allow the creation of a new violation store\n# default is false\nfreeze.store.default.allowStoreCreation=false\nfreeze.store.default.allowStoreUpdate=true\nfreeze.store.default.path=src/test/resources/frozen\n"
  },
  {
    "path": "src/test/resources/bad-keystore",
    "content": ""
  },
  {
    "path": "src/test/resources/classpath-filesource/__files/stuff.txt",
    "content": "THINGS!"
  },
  {
    "path": "src/test/resources/classpath-filesource/mappings/slow-response.json",
    "content": "{\n  \"request\": {\n    \"method\": \"GET\",\n    \"url\": \"/slow-response\"\n  },\n  \"response\": {\n    \"fixedDelayMilliseconds\": 500,\n    \"bodyFileName\": \"stuff.txt\",\n    \"status\": 200\n  }\n}\n"
  },
  {
    "path": "src/test/resources/classpath-filesource/mappings/subdir/test2.json",
    "content": "{\n  \"request\": {\n    \"method\": \"GET\",\n    \"url\": \"/second_test\"\n  },\n  \"response\": {\n    \"body\": \"testing\",\n    \"status\": 200\n  }\n}\n"
  },
  {
    "path": "src/test/resources/classpath-filesource/mappings/test.json",
    "content": "{\n  \"request\": {\n    \"method\": \"GET\",\n    \"url\": \"/test\"\n  },\n  \"response\": {\n    \"bodyFileName\": \"stuff.txt\",\n    \"status\": 200\n  }\n}\n"
  },
  {
    "path": "src/test/resources/classpath-filesource/message-mappings/classpath-message-stub.json",
    "content": "{\n  \"name\": \"Classpath message stub\",\n  \"id\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n  \"trigger\": {\n    \"channel\": {\n      \"initiatingRequestPattern\": {\n        \"urlPath\": \"/ws/classpath\"\n      },\n      \"type\": \"websocket\"\n    },\n    \"type\": \"message\"\n  },\n  \"actions\": [\n    {\n      \"channelTarget\": {\n        \"type\": \"originating\"\n      },\n      \"type\": \"send\",\n      \"message\": {\n        \"body\": {\n          \"data\": \"Hello from classpath\"\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "src/test/resources/empty/.gitkeep",
    "content": ""
  },
  {
    "path": "src/test/resources/extension-test-request/200-example.json",
    "content": "{\n  \"request\": {\n    \"method\": \"GET\",\n    \"url\": \"/extension/resource/1\"\n  },\n  \"response\": {\n    \"status\": 200\n  }\n}\n"
  },
  {
    "path": "src/test/resources/filesource/anothersubdir/six",
    "content": ""
  },
  {
    "path": "src/test/resources/filesource/one",
    "content": ""
  },
  {
    "path": "src/test/resources/filesource/subdir/deepfile.json",
    "content": "{}"
  },
  {
    "path": "src/test/resources/filesource/subdir/five",
    "content": ""
  },
  {
    "path": "src/test/resources/filesource/subdir/four",
    "content": ""
  },
  {
    "path": "src/test/resources/filesource/subdir/subsubdir/eight",
    "content": ""
  },
  {
    "path": "src/test/resources/filesource/subdir/subsubdir/seven",
    "content": ""
  },
  {
    "path": "src/test/resources/filesource/three",
    "content": ""
  },
  {
    "path": "src/test/resources/filesource/two",
    "content": ""
  },
  {
    "path": "src/test/resources/frozen/do-not-throw-generic-exception",
    "content": "Method <com.github.tomakehurst.wiremock.WireMockServer.shutdown()> calls constructor <java.lang.RuntimeException.<init>(java.lang.Throwable)> in (WireMockServer.java:193)\nMethod <com.github.tomakehurst.wiremock.common.AbstractFileSource.assertExistsAndIsDirectory()> calls constructor <java.lang.RuntimeException.<init>(java.lang.String)> in (AbstractFileSource.java:138)\nMethod <com.github.tomakehurst.wiremock.common.AbstractFileSource.assertExistsAndIsDirectory()> calls constructor <java.lang.RuntimeException.<init>(java.lang.String)> in (AbstractFileSource.java:140)\nMethod <com.github.tomakehurst.wiremock.common.ClasspathFileSource.assertExistsAndIsDirectory()> calls constructor <java.lang.RuntimeException.<init>(java.lang.String)> in (ClasspathFileSource.java:212)\nMethod <com.github.tomakehurst.wiremock.common.ClasspathFileSource.assertExistsAndIsDirectory()> calls constructor <java.lang.RuntimeException.<init>(java.lang.String)> in (ClasspathFileSource.java:214)\nMethod <com.github.tomakehurst.wiremock.common.ClasspathFileSource.getZipEntryUri(java.lang.String)> calls constructor <java.lang.RuntimeException.<init>(java.lang.String)> in (ClasspathFileSource.java:114)\nMethod <com.github.tomakehurst.wiremock.jetty.JettyHttpServer.start()> calls constructor <java.lang.RuntimeException.<init>(java.lang.String)> in (JettyHttpServer.java:230)\nMethod <com.github.tomakehurst.wiremock.jetty.JettyHttpServer.start()> calls constructor <java.lang.RuntimeException.<init>(java.lang.Throwable)> in (JettyHttpServer.java:220)\nMethod <com.github.tomakehurst.wiremock.standalone.CommandLineOptions.captureHelpTextIfRequested(joptsimple.OptionParser)> calls constructor <java.lang.RuntimeException.<init>(java.lang.Throwable)> in (CommandLineOptions.java:241)\n"
  },
  {
    "path": "src/test/resources/frozen/no-standard-streams",
    "content": "Method <com.github.tomakehurst.wiremock.extension.ExtensionDeclarations.removeWebhook(java.lang.String)> gets field <java.lang.System.out> in (ExtensionDeclarations.java:79)"
  },
  {
    "path": "src/test/resources/frozen/stored.rules",
    "content": "#\n#Sat Mar 08 03:10:40 AEDT 2025\nno\\ classes\\ should\\ throw\\ generic\\ exceptions=do-not-throw-generic-exception\nclasses\\ should\\ not\\ access\\ standard\\ streams=no-standard-streams\nshould\\ use\\ all\\ classes,\\ because\\ unused\\ classes\\ should\\ be\\ removed=unused-classes\nshould\\ use\\ all\\ methods,\\ because\\ unused\\ methods\\ should\\ be\\ removed=unused-methods\n"
  },
  {
    "path": "src/test/resources/frozen/unused-classes",
    "content": "Class <com.github.tomakehurst.wiremock.client.WireMock$2> is unreferenced in (WireMock.java:0)\nClass <com.github.tomakehurst.wiremock.common.ContentTypes$1> is unreferenced in (ContentTypes.java:0)\nClass <com.github.tomakehurst.wiremock.common.xml.XmlNode$1> is unreferenced in (XmlNode.java:0)\nClass <com.github.tomakehurst.wiremock.extension.ServeEventListener$1> is unreferenced in (ServeEventListener.java:0)\nClass <com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.FormatJsonHelper$1> is unreferenced in (FormatJsonHelper.java:0)\nClass <com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.FormatXmlHelper$1> is unreferenced in (FormatXmlHelper.java:0)\nClass <com.github.tomakehurst.wiremock.http.JvmProxyConfigurer> is unreferenced in (JvmProxyConfigurer.java:0)"
  },
  {
    "path": "src/test/resources/frozen/unused-methods",
    "content": "Method <com.github.tomakehurst.wiremock.admin.Router.add(com.github.tomakehurst.wiremock.http.RequestMethod, java.lang.String, com.github.tomakehurst.wiremock.admin.AdminTask)> is unreferenced in (Router.java:0)\nMethod <com.github.tomakehurst.wiremock.admin.model.QueryParams.single(java.lang.String, [Ljava.lang.String;)> is unreferenced in (QueryParams.java:29)\nMethod <com.github.tomakehurst.wiremock.admin.model.ServeEventQuery.forStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping)> is unreferenced in (ServeEventQuery.java:37)\nMethod <com.github.tomakehurst.wiremock.admin.model.ServeEventQuery.forStubMapping(java.util.UUID)> is unreferenced in (ServeEventQuery.java:41)\nMethod <com.github.tomakehurst.wiremock.client.BasicCredentials.present()> is unreferenced in (BasicCredentials.java:38)\nMethod <com.github.tomakehurst.wiremock.common.Base64Encoder.encode([B)> is unreferenced in (Base64Encoder.java:0)\nMethod <com.github.tomakehurst.wiremock.common.Dates.parse(java.lang.String)> is unreferenced in (Dates.java:29)\nMethod <com.github.tomakehurst.wiremock.common.Encoding.urlEncode(java.lang.String)> is unreferenced in (Encoding.java:53)\nMethod <com.github.tomakehurst.wiremock.common.Errors.notPermitted(java.lang.String)> is unreferenced in (Errors.java:57)\nMethod <com.github.tomakehurst.wiremock.common.Exceptions.renderStackTrace(java.lang.Throwable)> is unreferenced in (Exceptions.java:77)\nMethod <com.github.tomakehurst.wiremock.common.Exceptions.uncheck(com.github.tomakehurst.wiremock.common.Exceptions$RunnableWithException)> is unreferenced in (Exceptions.java:70)\nMethod <com.github.tomakehurst.wiremock.common.Gzip.gzip(java.lang.String)> is unreferenced in (Gzip.java:51)\nMethod <com.github.tomakehurst.wiremock.common.Gzip.unGzipToString([B)> is unreferenced in (Gzip.java:47)\nMethod <com.github.tomakehurst.wiremock.common.Json.maxDeepSize(com.fasterxml.jackson.databind.JsonNode, com.fasterxml.jackson.databind.JsonNode)> is unreferenced in (Json.java:112)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.as(java.lang.Class)> is unreferenced in (Metadata.java:109)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.from(java.lang.Object)> is unreferenced in (Metadata.java:101)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.getBoolean(java.lang.String)> is unreferenced in (Metadata.java:43)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.getInt(java.lang.String)> is unreferenced in (Metadata.java:35)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.getInt(java.lang.String, java.lang.Integer)> is unreferenced in (Metadata.java:39)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.getList(java.lang.String)> is unreferenced in (Metadata.java:59)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.getMetadata(java.lang.String)> is unreferenced in (Metadata.java:64)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.getMetadata(java.lang.String, com.github.tomakehurst.wiremock.common.Metadata)> is unreferenced in (Metadata.java:70)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.getString(java.lang.String)> is unreferenced in (Metadata.java:51)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.getString(java.lang.String, java.lang.String)> is unreferenced in (Metadata.java:55)\nMethod <com.github.tomakehurst.wiremock.common.Metadata.metadata()> is unreferenced in (Metadata.java:105)\nMethod <com.github.tomakehurst.wiremock.common.Source.load()> is unreferenced in (Source.java:0)\nMethod <com.github.tomakehurst.wiremock.common.StreamSources.forURI(java.net.URI)> is unreferenced in (StreamSources.java:46)\nMethod <com.github.tomakehurst.wiremock.common.xml.Xml.toStringValue(org.w3c.dom.Node)> is unreferenced in (Xml.java:132)\nMethod <com.github.tomakehurst.wiremock.core.Options.browserProxyingEnabled()> is unreferenced in (Options.java:0)\nMethod <com.github.tomakehurst.wiremock.core.WireMockApp.port()> is unreferenced in (WireMockApp.java:443)\nMethod <com.github.tomakehurst.wiremock.direct.DirectCallHttpServer.adminRequest(com.github.tomakehurst.wiremock.http.Request)> is unreferenced in (DirectCallHttpServer.java:74)\nMethod <com.github.tomakehurst.wiremock.direct.DirectCallHttpServer.stubRequest(com.github.tomakehurst.wiremock.http.Request)> is unreferenced in (DirectCallHttpServer.java:84)\nMethod <com.github.tomakehurst.wiremock.extension.AbstractTransformer.transform(com.github.tomakehurst.wiremock.http.Request, java.lang.Object, com.github.tomakehurst.wiremock.common.FileSource, com.github.tomakehurst.wiremock.extension.Parameters)> is unreferenced in (AbstractTransformer.java:0)\nMethod <com.github.tomakehurst.wiremock.extension.Parameters.one(java.lang.String, java.lang.Object)> is unreferenced in (Parameters.java:37)\nMethod <com.github.tomakehurst.wiremock.extension.requestfilter.RequestFilterAction.stopWith(com.github.tomakehurst.wiremock.http.ResponseDefinition)> is unreferenced in (RequestFilterAction.java:28)\nMethod <com.github.tomakehurst.wiremock.extension.requestfilter.RequestWrapper.create()> is unreferenced in (RequestWrapper.java:90)\nMethod <com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.FormParser.parse(java.lang.String, boolean)> is unreferenced in (FormParser.java:28)\nMethod <com.github.tomakehurst.wiremock.global.GlobalSettings.builder()> is unreferenced in (GlobalSettings.java:30)\nMethod <com.github.tomakehurst.wiremock.http.Cookie.cookie(com.github.tomakehurst.wiremock.common.ListOrSingle)> is unreferenced in (Cookie.java:33)\nMethod <com.github.tomakehurst.wiremock.http.Cookie.cookie(java.lang.String)> is unreferenced in (Cookie.java:37)\nMethod <com.github.tomakehurst.wiremock.http.client.apache5.StaticApacheHttpClientFactory.createClient()> is unreferenced in (HttpClientFactory.java:241)\nMethod <com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader(com.github.tomakehurst.wiremock.http.CaseInsensitiveKey, [Ljava.lang.String;)> is unreferenced in (HttpHeader.java:40)\nMethod <com.github.tomakehurst.wiremock.http.HttpHeaders.copyOf(com.github.tomakehurst.wiremock.http.HttpHeaders)> is unreferenced in (HttpHeaders.java:98)\nMethod <com.github.tomakehurst.wiremock.http.HttpStatus.isRedirection(int)> is unreferenced in (HttpStatus.java:25)\nMethod <com.github.tomakehurst.wiremock.http.HttpStatus.isSuccess(int)> is unreferenced in (HttpStatus.java:21)\nMethod <com.github.tomakehurst.wiremock.http.MultiValue.hasValueMatching(com.github.tomakehurst.wiremock.matching.StringValuePattern)> is unreferenced in (MultiValue.java:69)\nMethod <com.github.tomakehurst.wiremock.http.QueryParameter.queryParam(java.lang.String, [Ljava.lang.String;)> is unreferenced in (QueryParameter.java:33)\nMethod <com.github.tomakehurst.wiremock.http.RequestEventSource.addRequestListener(com.github.tomakehurst.wiremock.http.RequestListener)> is unreferenced in (RequestEventSource.java:0)\nMethod <com.github.tomakehurst.wiremock.http.RequestMethod.hasEntity()> is unreferenced in (RequestMethod.java:83)\nMethod <com.github.tomakehurst.wiremock.http.RequestMethod.value()> is unreferenced in (RequestMethod.java:51)\nMethod <com.github.tomakehurst.wiremock.http.RequestMethod.values()> is unreferenced in (RequestMethod.java:97)\nMethod <com.github.tomakehurst.wiremock.jetty9.JettyHttpServer.stopTimeout()> is unreferenced in (JettyHttpServer.java:265)\nMethod <com.github.tomakehurst.wiremock.junit.WireMockStaticRule.stopServer()> is unreferenced in (WireMockStaticRule.java:45)\nMethod <com.github.tomakehurst.wiremock.matching.AbstractDateTimePattern.actualFormat(java.lang.String)> is unreferenced in (AbstractDateTimePattern.java:155)\nMethod <com.github.tomakehurst.wiremock.matching.AbstractDateTimePattern.expectedOffset(int, com.github.tomakehurst.wiremock.common.DateTimeUnit)> is unreferenced in (AbstractDateTimePattern.java:162)\nMethod <com.github.tomakehurst.wiremock.matching.EqualToXmlPattern.exemptingComparisons([Lorg.xmlunit.diff.ComparisonType;)> is unreferenced in (EqualToXmlPattern.java:228)\nMethod <com.github.tomakehurst.wiremock.matching.MatchResult.aggregateWeighted([Lcom.github.tomakehurst.wiremock.matching.WeightedMatchResult;)> is unreferenced in (MatchResult.java:65)\nMethod <com.github.tomakehurst.wiremock.matching.MatchResult.partialMatch(double)> is unreferenced in (MatchResult.java:33)\nMethod <com.github.tomakehurst.wiremock.matching.MatchesXPathPattern.withXPathNamespace(java.lang.String, java.lang.String)> is unreferenced in (MatchesXPathPattern.java:60)\nMethod <com.github.tomakehurst.wiremock.matching.RequestPattern.hasCustomMatcher()> is unreferenced in (RequestPattern.java:482)\nMethod <com.github.tomakehurst.wiremock.matching.RequestPattern.isMatchedBy(com.github.tomakehurst.wiremock.http.Request, java.util.Map)> is unreferenced in (RequestPattern.java:381)\nMethod <com.github.tomakehurst.wiremock.matching.StringValuePattern.and(com.github.tomakehurst.wiremock.matching.StringValuePattern)> is unreferenced in (StringValuePattern.java:81)\nMethod <com.github.tomakehurst.wiremock.matching.StringValuePattern.or(com.github.tomakehurst.wiremock.matching.StringValuePattern)> is unreferenced in (StringValuePattern.java:85)\nMethod <com.github.tomakehurst.wiremock.recording.ProxiedServeEventFilters.setAllowNonProxied(boolean)> is unreferenced in (ProxiedServeEventFilters.java:68)\nMethod <com.github.tomakehurst.wiremock.recording.ProxiedServeEventFilters.setFilters(com.github.tomakehurst.wiremock.matching.RequestPattern)> is unreferenced in (ProxiedServeEventFilters.java:52)\nMethod <com.github.tomakehurst.wiremock.recording.ProxiedServeEventFilters.setIds(java.util.List)> is unreferenced in (ProxiedServeEventFilters.java:60)\nMethod <com.github.tomakehurst.wiremock.servlet.MultipartRequestConfigElementBuilder.configure(javax.servlet.http.HttpServletRequest)> is unreferenced in (MultipartRequestConfigurer.java:0)\nMethod <com.github.tomakehurst.wiremock.servlet.WireMockHttpServletMultipartAdapter.from(javax.servlet.http.Part)> is unreferenced in (WireMockHttpServletMultipartAdapter.java:51)\nMethod <com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.port()> is unreferenced in (WireMockServerRunner.java:129)\nMethod <com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.stop()> is unreferenced in (WireMockServerRunner.java:115)\nMethod <com.github.tomakehurst.wiremock.stubbing.Scenario.withName(java.lang.String)> is unreferenced in (Scenario.java:144)\nMethod <com.github.tomakehurst.wiremock.stubbing.StubImport.stubImport()> is unreferenced in (StubImport.java:44)\nMethod <com.github.tomakehurst.wiremock.stubbing.StubMapping.buildJsonStringFor(com.github.tomakehurst.wiremock.stubbing.StubMapping)> is unreferenced in (StubMapping.java:75)\nMethod <com.github.tomakehurst.wiremock.stubbing.StubMapping.setPostServeActions(java.lang.Object)> is unreferenced in (StubMapping.java:218)\nMethod <com.github.tomakehurst.wiremock.stubbing.StubMappingCollection.setMappings(java.util.List)> is unreferenced in (StubMappingCollection.java:43)\nMethod <com.github.tomakehurst.wiremock.stubbing.StubMappingJsonRecorder.setIdGenerator(com.github.tomakehurst.wiremock.common.IdGenerator)> is unreferenced in (StubMappingJsonRecorder.java:198)\nMethod <com.github.tomakehurst.wiremock.verification.JournalBasedResult.requestJournalIsDisabled()> is unreferenced in (JournalBasedResult.java:30)\nMethod <com.github.tomakehurst.wiremock.verification.diff.Diff.hasCustomMatcher()> is unreferenced in (Diff.java:361)\nMethod <com.github.tomakehurst.wiremock.client.WireMock$1.initialValue()> is unreferenced in (WireMock.java:63)\nMethod <com.github.tomakehurst.wiremock.common.Json$1.initialValue()> is unreferenced in (Json.java:39)\nMethod <com.github.tomakehurst.wiremock.common.xml.Xml$SkipResolvingEntitiesDocumentBuilderFactory$1.initialValue()> is unreferenced in (Xml.java:180)\nMethod <com.github.tomakehurst.wiremock.common.xml.Xml$SkipResolvingEntitiesDocumentBuilderFactory$2.initialValue()> is unreferenced in (Xml.java:197)\nMethod <com.github.tomakehurst.wiremock.common.xml.XmlNode$1.initialValue()> is unreferenced in (XmlNode.java:43)\nMethod <com.github.tomakehurst.wiremock.common.xml.XmlNode$2.initialValue()> is unreferenced in (XmlNode.java:52)\n"
  },
  {
    "path": "src/test/resources/logback.xml",
    "content": "<configuration>\n\n  <appender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\">\n    <encoder>\n      <pattern>%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %msg%n</pattern>\n    </encoder>\n  </appender>\n\n  <root level=\"ERROR\">\n    <appender-ref ref=\"STDOUT\" />\n  </root>\n\n  <logger name=\"org.apache.hc.client5.http.wire\" level=\"ERROR\" />\n  <logger name=\"org.eclipse.jetty.util.thread\" level=\"WARN\" />\n  <logger name=\"org.eclipse.jetty.util.component\" level=\"WARN\" />\n</configuration>\n\n"
  },
  {
    "path": "src/test/resources/message-stub-test/multi.json",
    "content": "{\n  \"messageMappings\": [\n    {\n      \"name\": \"Multi message stub 1\",\n      \"id\": \"22222222-2222-2222-2222-222222222222\",\n      \"trigger\": {\n        \"channel\": {\n          \"initiatingRequestPattern\": {\n            \"urlPath\": \"/ws/multi/1\"\n          },\n          \"type\": \"websocket\"\n        },\n        \"type\": \"message\",\n        \"message\": {\n          \"body\": {\n            \"equalTo\": \"Hello multi stub 1\"\n          }\n        }\n      },\n      \"actions\": [\n        {\n          \"channelTarget\": {\n            \"type\": \"originating\"\n          },\n          \"type\": \"send\",\n          \"message\": {\n            \"body\": {\n              \"data\": \"Hello from multi stub 1\"\n            }\n          }\n        }\n      ]\n    },\n    {\n      \"name\": \"Multi message stub 2\",\n      \"trigger\": {\n        \"channel\": {\n          \"initiatingRequestPattern\": {\n            \"urlPath\": \"/ws/multi/2\"\n          },\n          \"type\": \"websocket\"\n        },\n        \"type\": \"message\"\n      },\n      \"actions\": [\n        {\n          \"channelTarget\": {\n            \"requestPattern\": {\n              \"urlPath\": \"/ws/multi/2\"\n            },\n            \"channelType\": \"websocket\",\n            \"type\": \"request-initiated\"\n          },\n          \"type\": \"send\",\n          \"message\": {\n            \"body\": {\n              \"data\": \"Hello from multi stub 2\"\n            }\n          }\n        }\n      ]\n    },\n    {\n      \"name\": \"Multi message stub 3\",\n      \"trigger\": {\n        \"channel\": {\n          \"initiatingRequestPattern\": {\n            \"urlPath\": \"/ws/multi/3\"\n          },\n          \"type\": \"websocket\"\n        },\n        \"type\": \"message\"\n      },\n      \"actions\": [\n        {\n          \"channelTarget\": {\n            \"type\": \"originating\"\n          },\n          \"type\": \"send\",\n          \"message\": {\n            \"body\": {\n              \"data\": \"Hello from multi stub 3\"\n            }\n          }\n        }\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "src/test/resources/message-stub-test/single.json",
    "content": "{\n  \"name\": \"Single message stub\",\n  \"id\": \"11111111-1111-1111-1111-111111111111\",\n  \"trigger\": {\n    \"channel\": {\n      \"initiatingRequestPattern\": {\n        \"urlPath\": \"/ws/single\"\n      },\n      \"type\": \"websocket\"\n    },\n    \"type\": \"message\"\n  },\n  \"actions\": [\n    {\n      \"channelTarget\": {\n        \"type\": \"originating\"\n      },\n      \"type\": \"send\",\n      \"message\": {\n        \"body\": {\n          \"data\": \"Hello from single stub\"\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "src/test/resources/multi-stub/multi.json",
    "content": "{\n  \"mappings\": [\n    {\n      \"request\": {\n        \"method\": \"GET\",\n        \"url\": \"/multi/1\"\n      },\n      \"response\": {\n        \"status\": 200\n      }\n    },\n    {\n      \"request\": {\n        \"method\": \"GET\",\n        \"url\": \"/multi/2\"\n      },\n      \"response\": {\n        \"status\": 200\n      }\n    },\n    {\n      \"request\": {\n        \"method\": \"GET\",\n        \"url\": \"/multi/3\"\n      },\n      \"response\": {\n        \"status\": 200\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "src/test/resources/multi-stub/single.json",
    "content": "{\n  \"request\": {\n    \"method\": \"GET\",\n    \"url\": \"/single/1\"\n  },\n  \"response\": {\n    \"status\": 200\n  }\n}\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample-logical-or.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[path] /or                                                 | /or\n                                                           |\nX-Maybe [or] : equalTo one OR absent (absent)              | X-Maybe: wrong                                      <<<<< Header does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_ascii-narrow.txt",
    "content": "\n                      Request was not matched\n                      =======================\n\n---------------------------------------------------------------------\n| Closest stub                    | Request                         |\n---------------------------------------------------------------------\n                                  |\nThe post stub with a really long  |\nname that ought to wrap and let   |\nus see exactly how that looks     |\nwhen it is done                   |\n                                  |\nPOST                              | POST\n/thing                            | /thin                      <<<<< URL does not match\n                                  |\nX-My-Header [contains] : correct  | X-My-Header: wrong value   <<<<< Header does not match\nvalue                             |\nAccept [matches] : text/plain.*   | Accept: text/plain\n                                  |\n[equalToJson]                     |                            <<<<< Body does not match\n{                                 | {\n  \"thing\" : {                     |   \"thing\" : {\n    \"stuff\" : [ 1, 2, 3 ]         |     \"nothing\" : { }\n  }                               |   }\n}                                 | }\n                                  |\n---------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_ascii.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nThe post stub with a really long name that ought to wrap   |\nand let us see exactly how that looks when it is done      |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thin                                               <<<<< URL does not match\n                                                           |\nX-My-Header [contains] : correct value                     | X-My-Header: wrong value                            <<<<< Header does not match\nAccept [matches] : text/plain.*                            | Accept: text/plain\n                                                           |\n[equalToJson]                                              |                                                     <<<<< Body does not match\n{                                                          | {\n  \"thing\" : {                                              |   \"thing\" : {\n    \"stuff\" : [ 1, 2, 3 ]                                  |     \"nothing\" : { }\n  }                                                        |   }\n}                                                          | }\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_cookies.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nCookie diff                                                |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\nCookie: Cookie_1 [contains] one value                      | zero value                                          <<<<< Cookie does not match\nCookie: Second_Cookie [matches] cookie two value [0-9]*    | cookie two value 123\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_exactmatch-for-multiple-values-header.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[path] /thing                                              | /thing\n                                                           |\nq exactly [equalTo 1 AND equalTo 2 AND equalTo 3]          | q: 1                                                <<<<< Header does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_exactmatch-for-multiple-values-query-param.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[path] /thing                                              | /thing?q=2\n                                                           |\nQuery: q exactly [equalTo 1 AND equalTo 2 AND equalTo 3]   | q: 2                                                <<<<< Query does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_form.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nQuery params diff                                          |\n                                                           |\nPUT                                                        | PUT\n[path] /thing                                              | /thing\n                                                           |\nForm: one = 1                                              | one: 2                                              <<<<< Form data does not match\nForm: two [contains] two things                            | two: wrong things                                   <<<<< Form data does not match\nForm: three [matches] [a-z]{5}                             | three: abcde\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_includematch-for-multiple-values-header.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[path] /thing                                              | /thing\n                                                           |\nq including [equalTo 1 AND equalTo 2 AND equalTo 3]        | q: 1                                                <<<<< Header does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_includematch-for-multiple-values-query-param.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[path] /thing                                              | /thing?q=1\n                                                           |\nQuery: q including [equalTo 1 AND equalTo 2 AND equalTo    | q: 1                                                <<<<< Query does not match\n3]                                                         |\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_json-path-body-not-json.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nANY                                                        | ANY\n/thing                                                     | /thing\n                                                           |\n$.accountNum [equalTo] 1234                                | not json                                            <<<<< Body does not match\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_json-path-no-body.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nANY                                                        | ANY\n/thing                                                     | /thing\n                                                           |\n$.accountNum [equalTo] 1234                                |                                                     <<<<< Body is not present\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_json-path.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n$..seven                                                   | {                                                   <<<<< Body does not match\n                                                           |   \"one\" : {\n                                                           |     \"two\" : {\n                                                           |       \"three\" : {\n                                                           |         \"four\" : {\n                                                           |           \"five\" : {\n                                                           |             \"six\" : \"match this\"\n                                                           |           }\n                                                           |         }\n                                                           |       }\n                                                           |     }\n                                                           |   }\n                                                           | }\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_json-schema.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nJSON schema stub                                           |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n[matchesJsonSchema]                                        |                                                     <<<<< Body does not match\n{                                                          | {\n  \"type\" : \"object\",                                       |   \"handle\": \"Rex\"\n  \"required\" : [ \"name\" ],                                 | }\n  \"properties\" : {                                         |\n    \"name\" : {                                             |\n      \"type\" : \"string\"                                    |\n    },                                                     |\n    \"tag\" : {                                              |\n      \"type\" : \"string\"                                    |\n    }                                                      |\n  }                                                        |\n}                                                          |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_large_json.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nThe post stub with a really long name that ought to wrap   |\nand let us see exactly how that looks when it is done      |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\nAccept: text/plain                                         | Accept: text/plain\n                                                           |\n[equalToJson]                                              |                                                     <<<<< Body does not match\n{                                                          | {\n  \"one\" : {                                                |   \"one\" : {\n    \"two\" : {                                              |     \"two\" : {\n      \"three\" :                                            |       \"three\" : {\n{                                                          |         \"four\" : {\n        \"four\" : {                                         |           \"five\" : {\n          \"five\" : {                                       |             \"six\" : \"totally_the_wrong_value\"\n\"six\" :                                                    |           }\n\"superduperlongvaluethatshouldwrapokregardless_superduper  |         }\nlongvaluethatshouldwrapokregardless_superduperlongvalueth  |       }\natshouldwrapokregardless_superduperlongvaluethatshouldwra  |     }\npokregardless\"                                             |   }\n          }                                                | }\n        }                                                  |\n      }                                                    |\n    }                                                      |\n  }                                                        |\n}                                                          |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_large_json_windows.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nThe post stub with a really long name that ought to wrap   |\nand let us see exactly how that looks when it is done      |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\nAccept: text/plain                                         | Accept: text/plain\n                                                           |\n[equalToJson]                                              |                                                     <<<<< Body does not match\n{                                                          | {\n  \"one\" : {                                                |   \"one\" : {\n    \"two\" : {                                              |     \"two\" : {\n\"three\" : {                                                |       \"three\" : {\n        \"four\" : {                                         |         \"four\" : {\n          \"five\" : {                                       |           \"five\" : {\n\"six\" :                                                    |             \"six\" : \"totally_the_wrong_value\"\n\"superduperlongvaluethatshouldwrapokregardless_superduper  |           }\nlongvaluethatshouldwrapokregardless_superduperlongvalueth  |         }\natshouldwrapokregardless_superduperlongvaluethatshouldwra  |       }\npokregardless\"                                             |     }\n          }                                                |   }\n        }                                                  | }\n      }                                                    |\n    }                                                      |\n}                                                          |\n}                                                          |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_large_xml_jre11.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nThe post stub with a really long name that ought to wrap   |\nand let us see exactly how that looks when it is done      |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n[equalToXml]                                               | <deep-things>                                       <<<<< Body does not match\n<deep-things>                                              |   <thing id=\"1\">\n  <thing id=\"1\">                                           |     <thing\n    <thing id=\"2\">                                         | id=\"2\">\n      <thing id=\"3\">                                       |       <thing id=\"3\">\n        <thing id=\"4\">                                     |         <thing id=\"4\">\n<thing id=\"5\">                                             | <thing id=\"5\">\n<thing id=\"6\">                                             | <thing id=\"6\">\n              Super wrong bit of text that                 |               Super long bit of text that\nshould push it way over the length limit!                  | should push it way over the length limit!\n</thing>                                                   | </thing>\n          </thing>                                         |           </thing>\n        </thing>                                           |         </thing>\n      </thing>                                             |       </thing>\n    </thing>                                               |     </thing>\n  </thing>                                                 |   </thing>\n</deep-things>                                             | </deep-things>\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_large_xml_jre11_windows.txt",
    "content": "\r\n                                               Request was not matched\r\n                                               =======================\r\n\r\n-----------------------------------------------------------------------------------------------------------------------\r\n| Closest stub                                             | Request                                                  |\r\n-----------------------------------------------------------------------------------------------------------------------\r\n                                                           |\r\nThe post stub with a really long name that ought to wrap   |\r\nand let us see exactly how that looks when it is done      |\r\n                                                           |\r\nPOST                                                       | POST\r\n/thing                                                     | /thing\r\n                                                           |\r\n[equalToXml]                                               | <deep-things>                                       <<<<< Body does not match\r\n<deep-things>                                              |   <thing id=\"1\">\r\n  <thing id=\"1\">                                           | <thing id=\"2\">\r\n    <thing id=\"2\">                                         |       <thing id=\"3\">\r\n      <thing                                               |         <thing id=\"4\">\r\nid=\"3\">                                                    | <thing id=\"5\">\r\n        <thing id=\"4\">                                     | <thing id=\"6\">\r\n          <thing id=\"5\">                                   |               Super long bit of text that\r\n<thing id=\"6\">                                             | should push it way over the length limit!\r\n              Super wrong bit of text                      | </thing>\r\nthat should push it way over the length limit!             |           </thing>\r\n</thing>                                                   |         </thing>\r\n          </thing>                                         |       </thing>\r\n        </thing>                                           |     </thing>\r\n      </thing>                                             |   </thing>\r\n    </thing>                                               | </deep-things>\r\n  </thing>                                                 |\r\n</deep-things>                                             |\r\n                                                           |\r\n-----------------------------------------------------------------------------------------------------------------------\r\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_large_xml_jre8.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nThe post stub with a really long name that ought to wrap   |\nand let us see exactly how that looks when it is done      |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n<deep-things>                                              | <deep-things>                                       <<<<< Body does not match\n  <thing id=\"1\">                                           |   <thing id=\"1\">\n    <thing id=\"2\">                                         |     <thing id=\"2\">\n<thing id=\"3\">                                             | <thing id=\"3\">\n        <thing id=\"4\">                                     |         <thing id=\"4\">\n          <thing                                           |           <thing\nid=\"5\">                                                    | id=\"5\">\n            <thing id=\"6\">                                 |             <thing id=\"6\">\n              Super                                        |               Super\nwrong bit of text that should push it way over the length  | long bit of text that should push it way over the length\nlimit!                                                     | limit!\n            </thing>                                       |             </thing>\n          </thing>                                         |           </thing>\n</thing>                                                   | </thing>\n      </thing>                                             |       </thing>\n    </thing>                                               |     </thing>\n</thing>                                                   | </thing>\n</deep-things>                                             | </deep-things>\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_missing_header.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nMissing header stub                                        |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\nX-My-Header: correct value                                 |                                                     <<<<< Header is not present\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_mixed-matchers-named-custom.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nStandard and custom matched stub                           |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n[custom matcher: my-custom-matcher]                        |                                                     <<<<< custom matcher does not match\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_mixed-matchers-self-describing-named-custom.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nStandard and custom matched stub                           |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\nProperty a: foo                                            | Property a: bar                                     <<<<< Not matched because of property a not matching\nProperty b: foo                                            | Property b: bar                                     <<<<< Not matched because of property b not matching\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_mixed-matchers-weighted-named-custom.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nStandard and weighted custom matched stub                  |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\nExpected x                                                 | Found y                                             <<<<< Not matched due to x != y\nExpected a                                                 | Found b                                             <<<<< Not matched due to a != b\nExpected c                                                 | Found d                                             <<<<< Not matched due to c != d\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_mixed-matchers-weighted-self-describing-named-custom.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nStandard and weighted custom matched stub                  |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n[custom matcher: weighted-self-describing-custom-matcher]  | weighted-self-describing-actual                     <<<<< Not matched because of x, y and z\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_mixed-matchers.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nStandard and custom matched stub                           |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n[custom matcher]                                           |                                                     <<<<< custom matcher does not match\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_multipart.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nMultipart request body stub                                |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n                                                           |\n[Multipart: part_one]                                      | [part_one]\n                                                           |\nContent-Disposition [contains] : name=\"part_one\"           |                                                     <<<<< Header is not present\nX-My-Stuff [contains] : stuff_parts                        | X-My-Stuff: wrong value                             <<<<< Header does not match\n                                                           |\n[matches]                                                  |                                                     <<<<< Body does not match\nSome expected text.*                                       | Wrong body\n                                                           |\n[/Multipart]                                               | [/part_one]\n                                                           |\n                                                           |\n[Multipart: part_one]                                      | [part_two]\n                                                           |\nContent-Disposition [contains] : name=\"part_one\"           |                                                     <<<<< Header is not present\nX-My-Stuff [contains] : stuff_parts                        |                                                     <<<<< Header is not present\n                                                           |\n[matches]                                                  |                                                     <<<<< Body does not match\nSome expected text.*                                       | Correct body\n                                                           |\n[/Multipart]                                               | [/part_two]\n                                                           |\n                                                           |\n[Multipart]                                                | [part_one]\n                                                           |\nX-More [contains] : stuff_parts                            |                                                     <<<<< Header is not present\n                                                           |\n[equalTo]                                                  |                                                     <<<<< Body does not match\nCorrect body                                               | Wrong body\n                                                           |\n[/Multipart]                                               | [/part_one]\n                                                           |\n                                                           |\n[Multipart]                                                | [part_two]\n                                                           |\nX-More [contains] : stuff_parts                            |                                                     <<<<< Header is not present\n                                                           |\n[equalTo]                                                  |                                                     <<<<< Body does not match\nCorrect body                                               | Correct body\n                                                           |\n[/Multipart]                                               | [/part_two]\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_no-multipart.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nMultipart request body stub                                |\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n[Multipart request body]                                   |                                                     <<<<< [Multipart request body] is not present\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_no-path.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[regex] /?q=correct                                        | /q=wrong                                            <<<<< URL does not match. When using a regex, \"?\" should be \"\\?\"\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_no_path_parameter_message.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[path template] /contacts/{contactId}                      | /contacts/123\n                                                           |\nAuthorization: Token 456                                   | Authorization: Token 789                            <<<<< Header does not match\n                                                           |\nPath parameter: contactId = 123                            | 123\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_only-custom_matcher.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nANY                                                        | POST\n(always)                                                   | /thing\n                                                           |\n[custom matcher]                                           |                                                     <<<<< custom matcher does not match\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_query.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nQuery params diff                                          |\n                                                           |\nGET                                                        | GET\n[path] /thing                                              | /thing?one=2&two=wrong%20things&three=abcde\n                                                           |\nQuery: one = 1                                             | one: 2                                              <<<<< Query does not match\nQuery: two [contains] two things                           | two: wrong things                                   <<<<< Query does not match\nQuery: three [matches] [a-z]{5}                            | three: abcde\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_scenario-state.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n[Scenario 'thing states' state: first]                     | [Scenario 'thing states' state: Started]            <<<<< Scenario does not match\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_url-path-parameters.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[path template] /contacts/{contactId}                      | /contacts/345\n                                                           |\nPath parameter: contactId = 123                            | 345                                                 <<<<< Path parameter does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_url-pattern.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[regex] thing?query=value                                  | /thing                                              <<<<< URL does not match. When using a regex, \"?\" should be \"\\?\". URLs must start with a /\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_url-template.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nGET                                                        | GET\n[path template] /contacts/{contactId}                      | /contracts/12345                                    <<<<< URL does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-found-diff-sample_xpath-with-submatch.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nPOST                                                       | POST\n/thing                                                     | /thing\n                                                           |\n//thing/text() [equalTo] two                               | one                                                 <<<<< Body does not match\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-match-isNoneOf-v1.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nnoneOf: [GET, PUT]                                         | GET                                                 <<<<< HTTP method does not match\n/url                                                       | /url\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-match-isNoneOf-v2.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nnoneOf: [GET, PUT]                                         | POST\n/url                                                       | /wrong-url                                          <<<<< URL does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-match-isNoneOf-v3.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\nnoneOf: [POST, PUT]                                        | PUT                                                 <<<<< HTTP method does not match\n/url                                                       | /wrong-url                                          <<<<< URL does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-match-isOneOf-v1.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\noneOf: [GET, PUT]                                          | POST                                                <<<<< HTTP method does not match\n/url                                                       | /url\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-match-isOneOf-v2.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\noneOf: [GET, PUT]                                          | GET\n/url                                                       | /wrong-url                                          <<<<< URL does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/not-match-isOneOf-v3.txt",
    "content": "\n                                               Request was not matched\n                                               =======================\n\n-----------------------------------------------------------------------------------------------------------------------\n| Closest stub                                             | Request                                                  |\n-----------------------------------------------------------------------------------------------------------------------\n                                                           |\noneOf: [POST, PUT]                                         | GET                                                 <<<<< HTTP method does not match\n/url                                                       | /wrong-url                                          <<<<< URL does not match\n                                                           |\n                                                           |\n-----------------------------------------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/test/resources/proxy-sample.json",
    "content": "{\n  \"request\": {\n    \"method\": \"ANY\",\n    \"urlPattern\": \"/proxy/.*\"\n  },\n  \"response\": {\n    \"proxyBaseUrl\": \"http://localhost:8087/something\"\n  },\n  \"priority\": \"LOW\"\n}\n"
  },
  {
    "path": "src/test/resources/remoteloader/__files/body.txt",
    "content": "Some text"
  },
  {
    "path": "src/test/resources/remoteloader/__files/body.unknown",
    "content": "{}"
  },
  {
    "path": "src/test/resources/remoteloader/__files/body.xml",
    "content": "<items><item>Buy milk</item><item>Cancel newspaper subscription</item></items>"
  },
  {
    "path": "src/test/resources/remoteloader/mappings/one.json",
    "content": "{\n  \"request\": {\n    \"url\": \"/remote-load/1\"\n  },\n  \"response\": {\n    \"body\": \"Remote load 1\",\n    \"status\": 200\n  }\n}\n"
  },
  {
    "path": "src/test/resources/remoteloader/mappings/two.json",
    "content": "{\n  \"request\": {\n    \"headers\": {\n      \"Accept\": {\n        \"contains\": \"text/plain\"\n      }\n    },\n    \"method\": \"GET\",\n    \"urlPath\": \"/remote-load/2\"\n  },\n  \"response\": {\n    \"headers\": {\n      \"Content-Type\": \"text/plain\"\n    },\n    \"body\": \"Remote load 2\",\n    \"status\": 200\n  },\n  \"priority\": 4\n}\n"
  },
  {
    "path": "src/test/resources/remoteloader/mappings/with-binary-body-file-header.json",
    "content": "{\n  \"request\": {\n    \"url\": \"/binary-file-from-header\"\n  },\n  \"response\": {\n    \"headers\": {\n      \"content-type\": \"image/jpg\"\n    },\n    \"bodyFileName\": \"body.unknown\",\n    \"status\": 200\n  },\n  \"id\": \"59179b2b-ce01-49cf-8381-280dcd559484\"\n}\n"
  },
  {
    "path": "src/test/resources/remoteloader/mappings/with-png-body-file.json",
    "content": "{\n  \"request\": {\n    \"url\": \"/image-file\"\n  },\n  \"response\": {\n    \"bodyFileName\": \"favicon3.png\",\n    \"status\": 200\n  },\n  \"id\": \"f7550b27-b544-4967-b7e8-f777eca68235\"\n}\n"
  },
  {
    "path": "src/test/resources/remoteloader/mappings/with-several-mappings-in-one-file.json",
    "content": "{\n  \"mappings\": [\n    {\n      \"request\": {\n        \"method\": \"GET\",\n        \"url\": \"/todo/items\"\n      },\n      \"response\": {\n        \"body\": \"<items><item>Buy milk</item></items>\",\n        \"status\": 200\n      },\n      \"requiredScenarioState\": \"Started\",\n      \"scenarioName\": \"To do list\"\n    },\n    {\n      \"request\": {\n        \"method\": \"POST\",\n        \"bodyPatterns\": [\n          {\n            \"contains\": \"Cancel newspaper subscription\"\n          }\n        ],\n        \"url\": \"/todo/items\"\n      },\n      \"newScenarioState\": \"Cancel newspaper item added\",\n      \"response\": {\n        \"status\": 201\n      },\n      \"requiredScenarioState\": \"Started\",\n      \"scenarioName\": \"To do list\"\n    },\n    {\n      \"request\": {\n        \"method\": \"GET\",\n        \"url\": \"/todo/items\"\n      },\n      \"response\": {\n        \"bodyFileName\": \"body.xml\",\n        \"status\": 200\n      },\n      \"requiredScenarioState\": \"Cancel newspaper item added\",\n      \"scenarioName\": \"To do list\"\n    }\n  ]\n}\n"
  },
  {
    "path": "src/test/resources/remoteloader/mappings/with-text-body-file-header.json",
    "content": "{\n  \"request\": {\n    \"url\": \"/text-file-from-header\"\n  },\n  \"response\": {\n    \"headers\": {\n      \"content-type\": \"application/json\"\n    },\n    \"bodyFileName\": \"body.unknown\",\n    \"status\": 200\n  },\n  \"id\": \"08851f9e-8b9a-4e32-a4f3-7befd9c72d4d\"\n}\n"
  },
  {
    "path": "src/test/resources/remoteloader/mappings/with-text-body-file.json",
    "content": "{\n  \"request\": {\n    \"url\": \"/text-file\"\n  },\n  \"response\": {\n    \"bodyFileName\": \"body.txt\",\n    \"status\": 200\n  },\n  \"id\": \"e7af68ed-ed7c-4f9f-9d34-344c88cca8b7\"\n}\n"
  },
  {
    "path": "src/test/resources/sample.json",
    "content": "{ \t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\"request\": {\t\t\t\t\t\t\t\t\t\n\t\t\"method\": \"GET\",\t\t\t\t\t\t\n\t\t\"url\": \"/my/other/resource\", // \"url\" for exact match, or \"urlPattern\" for regex\n\t\t\"headers\": {\n\t\t\t\"Content-Type\": {\n\t\t\t\t\"equalTo\": \"text/xml\"\n\t\t\t},\n\t\t\t\"Accept\": {\n\t\t\t\t\"matches\": \"(.*)xml(.*)\"\n\t\t\t},\n\t\t\t\"Etag\": {\n\t\t\t\t\"doesNotMatch\": \"s0912lksjd(.+)\"\n\t\t\t} \n\t\t}\n\t},\t\t\t\t\t\t\t\t\t\t\n\t\"response\": {\t\t\t\t\t\t\t\t\t\n\t\t\"status\": 200,\t\t\t\t\t\t\t\n\t\t\"body\": \"YES INDEED!\",\n\t\t\"headers\": {\n\t\t\t\"Content-Type\": \"text/plain\",\n\t\t\t\"Cache-Control\": \"no-cache\"\n\t\t}\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\n}"
  },
  {
    "path": "src/test/resources/schema-validation/draft-7.invalid.json",
    "content": "{\n  \"required\": \"level\",\n  \"properties\": {\n    \"level\": {\n      \"type\": \"integer\",\n      \"exclusiveMaximum\": 10\n    }\n  }\n}"
  },
  {
    "path": "src/test/resources/schema-validation/draft-7.schema.json",
    "content": "{\n  \"required\": [\n    \"level\"\n  ],\n  \"properties\": {\n    \"level\": {\n      \"type\": \"integer\",\n      \"exclusiveMaximum\": 10\n    }\n  }\n}"
  },
  {
    "path": "src/test/resources/schema-validation/has-ref.schema.json",
    "content": "{\n  \"$schema\": \"http://json-schema.org/draft-04/schema\",\n  \"required\": [ \"things\" ],\n  \"properties\": {\n    \"things\": {\n      \"type\": \"array\",\n      \"items\": { \"$ref\": \"#/definitions/single\" }\n    }\n  },\n  \"definitions\": {\n    \"single\": {\n      \"type\": \"integer\"\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/resources/schema-validation/invalid.schema.json",
    "content": "{\n  \"properties\": [1,2,3]\n}"
  },
  {
    "path": "src/test/resources/schema-validation/new-pet.invalid.json",
    "content": "{\n  \"handle\": \"Rex\"\n}"
  },
  {
    "path": "src/test/resources/schema-validation/new-pet.json",
    "content": "{\n  \"name\": \"Rex\",\n  \"tag\": \"dog\"\n}"
  },
  {
    "path": "src/test/resources/schema-validation/new-pet.schema.json",
    "content": "{\n  \"type\": \"object\",\n  \"required\": [\n    \"name\"\n  ],\n  \"properties\": {\n    \"name\": {\n      \"type\": \"string\"\n    },\n    \"tag\": {\n      \"type\": \"string\"\n    }\n  }\n}"
  },
  {
    "path": "src/test/resources/schema-validation/new-pet.unparseable.json",
    "content": "{\n  \"name\": \"Rex\",\n  \"tag\": \"dog\"\n"
  },
  {
    "path": "src/test/resources/schema-validation/numeric.schema.json",
    "content": "{\n  \"type\": \"number\",\n  \"maximum\": 100\n}"
  },
  {
    "path": "src/test/resources/schema-validation/recursive.schema.json",
    "content": "{\n  \"#ref\": \"#/schemas/Person\",\n  \"schemas\": {\n    \"Person\": {\n      \"name\": {\n        \"type\": \"string\"\n      },\n      \"children\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"#ref\": \"#/schemas/Person\"\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/test/resources/schema-validation/shop-order.schema.json",
    "content": "{\n  \"type\": \"object\",\n  \"required\": [\n    \"itemCatalogueId\",\n    \"quantity\"\n  ],\n  \"properties\": {\n    \"itemCatalogueId\": {\n      \"type\": \"string\"\n    },\n    \"quantity\": {\n      \"type\": \"integer\"\n    },\n    \"fastDelivery\": {\n      \"type\": \"boolean\"\n    }\n  }\n}"
  },
  {
    "path": "src/test/resources/schema-validation/shop-order.slightly-wrong.json",
    "content": "{\n  \"itemCatalogueId\": \"abc123\",\n  \"quantity\": 1,\n  \"fastDelivery\": \"yesplease\"\n}"
  },
  {
    "path": "src/test/resources/schema-validation/stringy.schema.json",
    "content": "{\n  \"type\": \"string\",\n  \"maxLength\": 5\n}"
  },
  {
    "path": "src/test/resources/security-filesource/root/.gitkeep",
    "content": ""
  },
  {
    "path": "src/test/resources/security-filesource/rootdir/.gitkeep",
    "content": ""
  },
  {
    "path": "src/test/resources/security-filesource/rootdir/file.json",
    "content": ""
  },
  {
    "path": "src/test/resources/templates/greet-Ram.txt",
    "content": "Hello {{request.query.name}}"
  },
  {
    "path": "src/test/resources/test-file-root/__files/plain-example.txt",
    "content": "Some example test from a file"
  },
  {
    "path": "src/test/resources/test-file-root/__files/plain-example1.txt",
    "content": "Example 1"
  },
  {
    "path": "src/test/resources/test-file-root/__files/plain-example2.txt",
    "content": "Example 2"
  },
  {
    "path": "src/test/resources/test-file-root/__files/plain-example3.txt",
    "content": "Example 3"
  },
  {
    "path": "src/test/resources/test-file-root/__files/plain-example4.txt",
    "content": "Example 4"
  },
  {
    "path": "src/test/resources/test-file-root/__files/plain-example5.txt",
    "content": "Example 5"
  },
  {
    "path": "src/test/resources/test-file-root/__files/templated-example-1.txt",
    "content": "{{request.path.[0]}}"
  },
  {
    "path": "src/test/resources/test-file-root/__files/templated-example-2.txt",
    "content": "{{request.path.0}}"
  },
  {
    "path": "src/test/resources/test-file-root/__files/templated-example-3.txt",
    "content": "{{request.path.1}}"
  },
  {
    "path": "src/test/resources/test-file-root/mappings/testjsonmapping.json",
    "content": "{\n  \"request\": {\n    \"method\": \"GET\",\n    \"urlPattern\": \"/testjsonmapping\"\n  },\n  \"response\": {\n    \"headers\": {\"Content-Type\": \"application/json\"},\n    \"jsonBody\": {\n      \"bignumber\": 1234567890.12,\n      \"integer_as_float\": 2.0,\n      \"array\": [\n        1,\n        2,\n        3\n      ],\n      \"integer\": 2,\n      \"key\": \"value\"\n    },\n    \"status\": 200\n  }\n}\n"
  },
  {
    "path": "src/test/resources/test-file-root/mappings/testmapping.json",
    "content": "{\n  \"request\": {\n    \"method\": \"GET\",\n    \"urlPattern\": \"/testmapping\"\n  },\n  \"response\": {\n    \"headers\": {\n      \"Content-Type\": \"text/plain\"\n    },\n    \"body\": \"default test mapping\",\n    \"status\": 200\n  }\n}\n"
  },
  {
    "path": "src/test/resources/test-requests/200-example.json",
    "content": "{\n  \"request\": {\n    \"method\": \"GET\",\n    \"url\": \"/canned/resource/1\"\n  },\n  \"response\": {\n    \"status\": 200\n  }\n}\n"
  },
  {
    "path": "src/test/resources/test-requests/401-example.json",
    "content": "{\n  \"request\": {\n    \"method\": \"GET\",\n    \"url\": \"/canned/resource/2\"\n  },\n  \"response\": {\n    \"headers\": {\n      \"Content-Type\": \"text/plain\"\n    },\n    \"body\": \"Not allowed!\",\n    \"status\": 401\n  }\n}\n"
  },
  {
    "path": "src/test/resources/version.properties",
    "content": "version=X.X.X"
  },
  {
    "path": "src/test/scala/com/github/tomakehurst/wiremock/WireMockScalaAcceptanceTest.scala",
    "content": "/*\n * Copyright (C) 2011 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock\n\nimport com.github.tomakehurst.wiremock.client.WireMock\nimport com.github.tomakehurst.wiremock.core.Options\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient\nimport org.junit.jupiter.api.AfterEach\nimport org.junit.jupiter.api.BeforeEach\nimport org.junit.jupiter.api.Test\nimport com.github.tomakehurst.wiremock.client.WireMock._\nimport org.hamcrest.Matchers.is\nimport org.hamcrest.MatcherAssert.assertThat\n\nclass WireMockScalaAcceptanceTest {\n\t\n\tvar wireMockServer: WireMockServer = _\n\tvar testClient: WireMockTestClient = _\n\n\t@BeforeEach\n\tdef init(): Unit = {\n\t\twireMockServer = new WireMockServer(Options.DYNAMIC_PORT)\n\t\twireMockServer.start()\n\t\tWireMock.configureFor(wireMockServer.port())\n\t\ttestClient = new WireMockTestClient(wireMockServer.port())\n\t}\n\t\n\t@AfterEach\n\tdef stopServer(): Unit = {\n\t\twireMockServer.stop()\n\t}\n\n\t@Test\n\tdef buildsMappingWithUrlOnlyRequestAndStatusOnlyResponse(): Unit = {\n\t\tval wireMock = new WireMock(wireMockServer.port())\n\t\twireMock.register(get(urlEqualTo(\"/my/new/resource\"))\n\t\t\t\t\t.willReturn(aResponse()\n\t\t\t\t\t\t.withStatus(304)))\n\t\t\n\t\tassertThat(testClient.get(\"/my/new/resource\").statusCode(), is(304))\n\t}\n\t\n\t@Test\n\tdef buildsMappingFromStaticSyntax(): Unit = {\n\t\tgivenThat(get(urlEqualTo(\"/my/new/resource\"))\n\t\t\t\t\t.willReturn(aResponse()\n\t\t\t\t\t\t.withStatus(304)))\n\t\t\n\t\tassertThat(testClient.get(\"/my/new/resource\").statusCode(), is(304))\n\t}\n\t\n\t@Test\n\tdef buildsMappingWithUrlOnyRequestAndResponseWithJsonBodyWithDiacriticSigns(): Unit = {\n\t\tval wireMock = new WireMock(wireMockServer.port())\n\t\twireMock.register(\n\t\t\t\tget(urlEqualTo(\"/my/new/resource\"))\n\t\t\t\t.willReturn(\n\t\t\t\t\t\taResponse()\n\t\t\t\t\t\t.withBody(\"{\\\"address\\\":\\\"Puerto Banús, Málaga\\\"}\")\n\t\t\t\t\t\t.withStatus(200)))\n\n\t\tassertThat(testClient.get(\"/my/new/resource\").content(), is(\"{\\\"address\\\":\\\"Puerto Banús, Málaga\\\"}\"))\n\t}\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/MultipartParserLoader.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport java.util.Collection;\nimport java.util.Optional;\nimport java.util.ServiceConfigurationError;\nimport java.util.ServiceLoader;\nimport org.eclipse.jetty.util.Jetty;\n\n/**\n * Create the Jetty's version-dependent {@link MultipartParser} instance that accepts the Jetty's\n * major version into account while creating the multipart parser instance.\n */\npublic interface MultipartParserLoader {\n  Optional<MultipartParser> getMultipartParser(String jettyMajorVersion);\n\n  /** The multipart parser implementation that depends on Jetty version being used. */\n  interface MultipartParser {\n    Collection<Request.Part> parse(byte[] body, String contentType);\n  }\n\n  /**\n   * Parses the body using {@link MultipartParser} instance.\n   *\n   * @param body body\n   * @param contentType content type\n   * @return the list of parsed multipart parts\n   */\n  static Collection<Request.Part> parts(byte[] body, String contentType) {\n    return create(Jetty.VERSION).parse(body, contentType);\n  }\n\n  /**\n   * Create the Jetty's version-dependent {@link MultipartParser} instance using Java's {@link\n   * ServiceLoader} mechanism or throws an exception if none of the multipart parser could be\n   * created.\n   *\n   * @param jettyVersion Jetty version at runtime\n   * @return {@link MultipartParser} instance\n   */\n  static MultipartParser create(String jettyVersion) {\n    final String[] version = Jetty.VERSION.split(\"[.]\");\n    if (version.length == 0 || version[0].isBlank()) {\n      throw new IllegalArgumentException(\n          \"Unrecognized Jetty version: \"\n              + jettyVersion\n              + \". Please make sure the right Jetty dependencies are on the classpath.\");\n    }\n\n    final String jettyMajorVersion = version[0];\n    final ServiceLoader<MultipartParserLoader> loaders =\n        ServiceLoader.load(MultipartParserLoader.class);\n\n    Throwable cause = null;\n    try {\n      for (final MultipartParserLoader loader : loaders) {\n        final Optional<MultipartParser> multipartParserOpt =\n            loader.getMultipartParser(jettyMajorVersion);\n        if (multipartParserOpt.isPresent()) {\n          return multipartParserOpt.get();\n        }\n      }\n    } catch (final ServiceConfigurationError ex) {\n      /* only catch this kind of exception, the Jetty's HttpServerFactoryLoader could not be instantiated */\n      cause = ex;\n    }\n\n    throw new IllegalStateException(\n        \"Unable to find MultipartParserLoader for Jetty version \"\n            + jettyMajorVersion\n            + \" (only Jetty 12 is supported at the moment). Please make sure the right Jetty dependencies are on the classpath.\",\n        cause);\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/junit5/EnabledIfJettyVersion.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\nimport org.junit.jupiter.api.extension.ExtendWith;\n\n/**\n * Meta-annotation to enable Wiremock-specific test cases only on specific version Jetty version.\n */\n@Target({ElementType.TYPE, ElementType.METHOD})\n@Retention(RetentionPolicy.RUNTIME)\n@ExtendWith(EnabledIfJettyVersionCondition.class)\npublic @interface EnabledIfJettyVersion {\n  /** The minimal required version of the OpenSearch this test could run on */\n  int major();\n\n  /** The reason (or issue reference) why this test is runnable on this version of Jetty */\n  String reason();\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/junit5/EnabledIfJettyVersionCondition.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport java.lang.reflect.AnnotatedElement;\nimport org.eclipse.jetty.util.Jetty;\nimport org.junit.jupiter.api.extension.ConditionEvaluationResult;\nimport org.junit.jupiter.api.extension.ExecutionCondition;\nimport org.junit.jupiter.api.extension.ExtensionContext;\n\npublic class EnabledIfJettyVersionCondition implements ExecutionCondition {\n  @Override\n  public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) {\n    final AnnotatedElement element = context.getElement().orElseThrow(IllegalStateException::new);\n\n    final EnabledIfJettyVersion annotation = element.getAnnotation(EnabledIfJettyVersion.class);\n    if (annotation == null) {\n      return ConditionEvaluationResult.enabled(\"@EnabledIfJettyVersion is not present\");\n    }\n\n    final int major = annotation.major();\n    if (Jetty.VERSION.startsWith(major + \".\")) {\n      return ConditionEvaluationResult.enabled(\n          \"The Jetty version \" + Jetty.VERSION + \" matches major version \" + major + \" vesion\");\n    } else {\n      return ConditionEvaluationResult.disabled(\n          \"The Jetty version \" + Jetty.VERSION + \" does not match major \" + major + \" vesion\");\n    }\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/Assumptions.java",
    "content": "/*\n * Copyright (C) 2021-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static org.junit.jupiter.api.Assumptions.assumeFalse;\n\npublic class Assumptions {\n\n  public static void doNotRunOnMacOSXInCI() {\n    assumeFalse(\n        System.getProperty(\"os.name\").startsWith(\"Mac OS X\")\n            && \"true\".equalsIgnoreCase(System.getenv(\"CI\")));\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/CompositeNotifier.java",
    "content": "/*\n * Copyright (C) 2021-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class CompositeNotifier implements Notifier {\n\n  private final List<Notifier> notifiers;\n\n  public CompositeNotifier(Notifier... notifiers) {\n    this(Arrays.asList(notifiers));\n  }\n\n  public CompositeNotifier(List<Notifier> notifiers) {\n    this.notifiers = notifiers;\n  }\n\n  @Override\n  public void info(String message) {\n    notifiers.forEach(notifier -> notifier.info(message));\n  }\n\n  @Override\n  public void error(String message) {\n    notifiers.forEach(notifier -> notifier.error(message));\n  }\n\n  @Override\n  public void error(String message, Throwable t) {\n    notifiers.forEach(notifier -> notifier.error(message, t));\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/ConstantHttpHeaderWebhookTransformer.java",
    "content": "/*\n * Copyright (C) 2021-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport org.wiremock.webhooks.WebhookDefinition;\nimport org.wiremock.webhooks.WebhookTransformer;\n\npublic class ConstantHttpHeaderWebhookTransformer implements WebhookTransformer {\n\n  public static final String key = \"X-customer-header\";\n  public static final String value = \"foo\";\n\n  @Override\n  public WebhookDefinition transform(ServeEvent serveEvent, WebhookDefinition webhookDefinition) {\n    return webhookDefinition.withHeader(key, value);\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/ExtensionFactoryUtils.java",
    "content": "/*\n * Copyright (C) 2023-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static java.util.Collections.emptyList;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.tomakehurst.wiremock.common.ClasspathFileSource;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.extension.ExtensionFactory;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport java.util.List;\nimport java.util.Map;\n\npublic class ExtensionFactoryUtils {\n\n  public static ResponseTemplateTransformer buildTemplateTransformer(boolean global) {\n    return (ResponseTemplateTransformer)\n        buildExtension(\n            new MockWireMockServices(),\n            services ->\n                List.of(\n                    new ResponseTemplateTransformer(\n                        services.getTemplateEngine(), global, services.getFiles(), emptyList())));\n  }\n\n  public static ResponseTemplateTransformer buildTemplateTransformer(\n      boolean global, String helperName, Helper<?> helper) {\n    return (ResponseTemplateTransformer)\n        buildExtension(\n            new MockWireMockServices().setHelpers(Map.of(helperName, helper)),\n            services ->\n                List.of(\n                    new ResponseTemplateTransformer(\n                        services.getTemplateEngine(), global, services.getFiles(), emptyList())));\n  }\n\n  public static ResponseTemplateTransformer buildTemplateTransformer(Long maxCacheEntries) {\n    return (ResponseTemplateTransformer)\n        buildExtension(\n            new MockWireMockServices().setMaxCacheEntries(maxCacheEntries),\n            services ->\n                List.of(\n                    new ResponseTemplateTransformer(\n                        services.getTemplateEngine(), false, services.getFiles(), emptyList())));\n  }\n\n  public static Extension buildExtension(\n      MockWireMockServices wireMockServices, ExtensionFactory factory) {\n    FileSource fileSource =\n        new ClasspathFileSource(\n            ExtensionFactoryUtils.class.getClassLoader().getResource(\"templates\").getPath());\n    wireMockServices.setFileSource(fileSource);\n    return factory.create(wireMockServices).stream().findFirst().get();\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/GlobalStubMappingTransformer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.StubMappingTransformer;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic class GlobalStubMappingTransformer extends StubMappingTransformer {\n  @Override\n  public StubMapping transform(StubMapping stubMapping, FileSource files, Parameters parameters) {\n    return WireMock.get(urlEqualTo(stubMapping.getRequest().getUrl() + \"?transformed=global\"))\n        .build();\n  }\n\n  @Override\n  public String getName() {\n    return \"stub-transformer\";\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/HttpClientUtils.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport java.io.IOException;\nimport org.apache.hc.core5.http.ClassicHttpResponse;\nimport org.apache.hc.core5.http.HttpEntity;\nimport org.apache.hc.core5.http.ParseException;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\n\npublic class HttpClientUtils {\n\n  private HttpClientUtils() {}\n\n  public static String getEntityAsStringAndCloseStream(ClassicHttpResponse httpResponse) {\n    HttpEntity entity = httpResponse.getEntity();\n    if (entity != null) {\n      try {\n        String content = EntityUtils.toString(entity, UTF_8);\n        entity.getContent().close();\n        return content;\n      } catch (IOException | ParseException ioe) {\n        throw new RuntimeException(ioe);\n      }\n    }\n\n    return null;\n  }\n\n  public static byte[] getEntityAsByteArrayAndCloseStream(ClassicHttpResponse httpResponse) {\n    HttpEntity entity = httpResponse.getEntity();\n    try {\n      if (entity != null) {\n        return EntityUtils.toByteArray(entity);\n      }\n    } catch (IOException ioe) {\n      return throwUnchecked(ioe, byte[].class);\n    } finally {\n      Exceptions.uncheck(httpResponse::close);\n    }\n\n    return null;\n  }\n\n  public static byte[] getEntityAsByteArray(ClassicHttpResponse httpResponse) {\n    HttpEntity entity = httpResponse.getEntity();\n    try {\n      if (entity != null) {\n        return EntityUtils.toByteArray(entity);\n      }\n    } catch (IOException ioe) {\n      return throwUnchecked(ioe, byte[].class);\n    }\n\n    return null;\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/MappingJsonSamples.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.encodeBase64;\n\npublic class MappingJsonSamples {\n\n  public static final String BASIC_MAPPING_REQUEST_WITH_RESPONSE_HEADER =\n      \"\"\"\n          {\n          \t\"request\": {\n          \t\t\"method\": \"GET\",\n          \t\t\"url\": \"/a/registered/resource\"\n          \t},\n          \t\"response\": {\n          \t\t\"status\": 401,\n          \t\t\"headers\": {\n          \t\t\t\"Content-Type\": \"text/plain\"\n          \t\t},\n          \t\t\"body\": \"Not allowed!\"\n          \t}\n          }\"\"\";\n\n  public static final String STATUS_ONLY_MAPPING_REQUEST =\n      \"\"\"\n          {\n          \t\"request\": {\n          \t\t\"method\": \"PUT\",\n          \t\t\"url\": \"/status/only\"\n          \t},\n          \t\"response\": {\n          \t\t\"status\": 204\n          \t}\n          }\"\"\";\n\n  public static final String STATUS_ONLY_GET_MAPPING_TEMPLATE =\n      \"\"\"\n          {\n          \t\"request\": {\n          \t\t\"method\": \"GET\",\n          \t\t\"urlPattern\": \"%s\"\n          \t},\n          \t\"response\": {\n          \t\t\"status\": 200\n          \t}\n          }\"\"\";\n\n  public static final String BASIC_GET =\n      \"\"\"\n          {\n          \t\"name\": \"Basic Resource\",\n          \t\"request\": {\n          \t\t\"method\": \"GET\",\n          \t\t\"url\": \"/basic/mapping/resource\"\n          \t},\n          \t\"response\": {\n          \t\t\"status\": 304,\n          \t\t\"body\": \"Body from mapping file\"\n          \t}\n          }\"\"\";\n\n  public static final String BASIC_POST = BASIC_GET.replace(\"GET\", \"POST\");\n  public static final String BASIC_PUT = BASIC_GET.replace(\"GET\", \"PUT\");\n  public static final String BASIC_DELETE = BASIC_GET.replace(\"GET\", \"DELETE\");\n  public static final String BASIC_PATCH = BASIC_GET.replace(\"GET\", \"PATCH\");\n  public static final String BASIC_HEAD = BASIC_GET.replace(\"GET\", \"HEAD\");\n  public static final String BASIC_OPTIONS = BASIC_GET.replace(\"GET\", \"OPTIONS\");\n  public static final String BASIC_TRACE = BASIC_GET.replace(\"GET\", \"TRACE\");\n  public static final String BASIC_ANY_METHOD = BASIC_GET.replace(\"GET\", \"ANY\");\n  public static final String BASIC_QUERY = BASIC_GET.replace(\"GET\", \"QUERY\");\n\n  public static final String MAPPING_REQUEST_WITH_EXACT_HEADERS =\n      \"\"\"\n          {\n          \t\"request\": {\n          \t\t\"method\": \"GET\",\n          \t\t\"url\": \"/header/dependent\",\n          \t\t\"headers\": {\n          \t\t\t\"Accept\": {\n          \t\t\t\t\"equalTo\": \"text/xml\"\n          \t\t\t},\n          \t\t\t\"If-None-Match\": {\n          \t\t\t\t\"equalTo\": \"abcd1234\"\n          \t\t\t}\n          \t\t}\n          \t},\n          \t\"response\": {\n          \t\t\"status\": 304,\n          \t\t\"headers\": {\n          \t\t\t\"Content-Type\": \"text/xml\"\n          \t\t}\n          \t}\n          }\"\"\";\n\n  public static final String MAPPING_REQUEST_WITH_REGEX_HEADERS =\n      \"\"\"\n          {\n          \t\"request\": {\n          \t\t\"method\": \"GET\",\n          \t\t\"url\": \"/header/match/dependent\",\n          \t\t\"headers\": {\n          \t\t\t\"Accept\": {\n          \t\t\t\t\"matches\": \"(.*)xml(.*)\"\n          \t\t\t},\n          \t\t\t\"If-None-Match\": {\n          \t\t\t\t\"matches\": \"([a-z0-9]*)\"\n          \t\t\t}\n          \t\t}\n          \t},\n          \t\"response\": {\n          \t\t\"status\": 304,\n          \t\t\"headers\": {\n          \t\t\t\"Content-Type\": \"text/xml\"\n          \t\t}\n          \t}\n          }\"\"\";\n\n  public static final String MAPPING_REQUEST_WITH_NEGATIVE_REGEX_HEADERS =\n      \"\"\"\n          {\n          \t\"request\": {\n          \t\t\"method\": \"GET\",\n          \t\t\"url\": \"/header/match/dependent\",\n          \t\t\"headers\": {\n          \t\t\t\"Accept\": {\n          \t\t\t\t\"doesNotMatch\": \"(.*)xml(.*)\"\n          \t\t\t}\n          \t\t}\n          \t},\n          \t\"response\": {\n          \t\t\"status\": 200,\n          \t\t\"headers\": {\n          \t\t\t\"Content-Type\": \"text/xml\"\n          \t\t}\n          \t}\n          }\"\"\";\n\n  public static final byte[] BINARY_COMPRESSED_CONTENT =\n      new byte[] {\n        31, -117, 8, 8, 72, -53, -8, 79, 0, 3, 103, 122, 105, 112, 100, 97, 116, 97, 45, 111, 117,\n        116, 0, -77, 41, 74, 45, 46, -56, -49, 43, 78, -75, -53, 72, -51, -55, -55, -73, -47, -121,\n        -13, 1, 9, 69, -3, 52, 26, 0, 0, 0\n      };\n  public static final String BINARY_COMPRESSED_JSON_STRING =\n      encodeBase64(BINARY_COMPRESSED_CONTENT);\n  public static final String BINARY_COMPRESSED_CONTENT_AS_STRING = \"<response>hello</response>\";\n\n  public static final String MAPPING_REQUEST_FOR_BYTE_BODY =\n      \"\"\"\n        {\n          \"request\": {\n            \"method\": \"GET\",\n            \"url\": \"/byte/resource/from/file\"\n          },\n          \"response\": {\n            \"status\": 200,\n            \"base64Body\": \"%s\"\n          }\n        }\"\"\"\n          .formatted(encodeBase64(new byte[] {65, 66, 67}));\n\n  public static final String MAPPING_REQUEST_FOR_BINARY_BYTE_BODY =\n      \"\"\"\n        {\n          \"request\": {\n            \"method\": \"GET\",\n            \"url\": \"/bytecompressed/resource/from/file\"\n          },\n          \"response\": {\n            \"status\": 200,\n            \"base64Body\": \"%s\"\n          }\n        }\"\"\"\n          .formatted(BINARY_COMPRESSED_JSON_STRING);\n\n  public static final String MAPPING_REQUEST_FOR_NON_UTF8 =\n      \"\"\"\n          {\n             \"request\": {\n                     \"method\": \"GET\",\n                     \"url\": \"/test/nonutf8/\"\n             },\n             \"response\": {\n                     \"status\": 200,\n                     \"headers\": {\n                         \"Content-type\": \"text/plain; charset=GB2312\"\n                     },\n                     \"body\": \"国家标准\"\n             }\n          }\n          \"\"\";\n\n  public static final String MAPPING_REQUEST_JSON_BODY_DECIMALS_NO_TRAILING_ZEROS =\n      \"\"\"\n          {\n          \t\"request\": {\n          \t\t\"method\": \"POST\",\n          \t\t\"url\": \"/body/decimals\",\n          \t\t\"bodyPatterns\": [\n          \t\t\t{ \"equalToJson\": {\"float\": 1.2} }\n          \t\t]\n          \t},\n          \t\"response\": {\n          \t\t\"status\": 200\n          \t}\n          }\"\"\";\n\n  public static final String MAPPING_REQUEST_JSON_BODY_DECIMALS_TRAILING_ZEROS =\n      MAPPING_REQUEST_JSON_BODY_DECIMALS_NO_TRAILING_ZEROS.replace(\"1.2\", \"1.20000000\");\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/MockHttpResponder.java",
    "content": "/*\n * Copyright (C) 2016-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport com.github.tomakehurst.wiremock.http.HttpResponder;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport java.util.Map;\n\npublic class MockHttpResponder implements HttpResponder {\n\n  public Response response;\n\n  @Override\n  public void respond(Request request, Response response, Map<String, Object> attributes) {\n    this.response = response;\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/MockHttpServletRequest.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport jakarta.servlet.*;\nimport jakarta.servlet.http.*;\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.UnsupportedEncodingException;\nimport java.security.Principal;\nimport java.util.Collection;\nimport java.util.Enumeration;\nimport java.util.Locale;\nimport java.util.Map;\n\npublic class MockHttpServletRequest implements HttpServletRequest {\n\n  @Override\n  public Object getAttribute(String name) {\n\n    return null;\n  }\n\n  @SuppressWarnings(\"rawtypes\")\n  @Override\n  public Enumeration getAttributeNames() {\n\n    return null;\n  }\n\n  @Override\n  public String getCharacterEncoding() {\n\n    return null;\n  }\n\n  @Override\n  public void setCharacterEncoding(String env) throws UnsupportedEncodingException {}\n\n  @Override\n  public int getContentLength() {\n\n    return 0;\n  }\n\n  @Override\n  public long getContentLengthLong() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public String getContentType() {\n\n    return null;\n  }\n\n  @Override\n  public ServletInputStream getInputStream() throws IOException {\n\n    return null;\n  }\n\n  @Override\n  public String getParameter(String name) {\n\n    return null;\n  }\n\n  @SuppressWarnings(\"rawtypes\")\n  @Override\n  public Enumeration getParameterNames() {\n\n    return null;\n  }\n\n  @Override\n  public String[] getParameterValues(String name) {\n\n    return null;\n  }\n\n  @SuppressWarnings(\"rawtypes\")\n  @Override\n  public Map getParameterMap() {\n\n    return null;\n  }\n\n  @Override\n  public String getProtocol() {\n\n    return null;\n  }\n\n  @Override\n  public String getScheme() {\n\n    return null;\n  }\n\n  @Override\n  public String getServerName() {\n\n    return null;\n  }\n\n  @Override\n  public int getServerPort() {\n\n    return 0;\n  }\n\n  @Override\n  public BufferedReader getReader() throws IOException {\n\n    return null;\n  }\n\n  @Override\n  public String getRemoteAddr() {\n\n    return null;\n  }\n\n  @Override\n  public String getRemoteHost() {\n\n    return null;\n  }\n\n  @Override\n  public void setAttribute(String name, Object o) {}\n\n  @Override\n  public void removeAttribute(String name) {}\n\n  @Override\n  public Locale getLocale() {\n\n    return null;\n  }\n\n  @SuppressWarnings(\"rawtypes\")\n  @Override\n  public Enumeration getLocales() {\n\n    return null;\n  }\n\n  @Override\n  public boolean isSecure() {\n\n    return false;\n  }\n\n  @Override\n  public RequestDispatcher getRequestDispatcher(String path) {\n\n    return null;\n  }\n\n  @Override\n  public int getRemotePort() {\n\n    return 0;\n  }\n\n  @Override\n  public String getLocalName() {\n\n    return null;\n  }\n\n  @Override\n  public String getLocalAddr() {\n\n    return null;\n  }\n\n  @Override\n  public int getLocalPort() {\n\n    return 0;\n  }\n\n  @Override\n  public ServletContext getServletContext() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public AsyncContext startAsync() throws IllegalStateException {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)\n      throws IllegalStateException {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public boolean isAsyncStarted() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public boolean isAsyncSupported() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public AsyncContext getAsyncContext() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public DispatcherType getDispatcherType() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public String getRequestId() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public String getProtocolRequestId() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public ServletConnection getServletConnection() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public String getAuthType() {\n\n    return null;\n  }\n\n  @Override\n  public Cookie[] getCookies() {\n\n    return null;\n  }\n\n  @Override\n  public long getDateHeader(String name) {\n\n    return 0;\n  }\n\n  @Override\n  public String getHeader(String name) {\n\n    return null;\n  }\n\n  @SuppressWarnings(\"rawtypes\")\n  @Override\n  public Enumeration getHeaders(String name) {\n\n    return null;\n  }\n\n  @SuppressWarnings(\"rawtypes\")\n  @Override\n  public Enumeration getHeaderNames() {\n\n    return null;\n  }\n\n  @Override\n  public int getIntHeader(String name) {\n\n    return 0;\n  }\n\n  @Override\n  public HttpServletMapping getHttpServletMapping() {\n    return HttpServletRequest.super.getHttpServletMapping();\n  }\n\n  @Override\n  public String getMethod() {\n\n    return null;\n  }\n\n  @Override\n  public String getPathInfo() {\n\n    return null;\n  }\n\n  @Override\n  public String getPathTranslated() {\n\n    return null;\n  }\n\n  @Override\n  public PushBuilder newPushBuilder() {\n    return HttpServletRequest.super.newPushBuilder();\n  }\n\n  @Override\n  public String getContextPath() {\n\n    return null;\n  }\n\n  @Override\n  public String getQueryString() {\n\n    return null;\n  }\n\n  @Override\n  public String getRemoteUser() {\n\n    return null;\n  }\n\n  @Override\n  public boolean isUserInRole(String role) {\n\n    return false;\n  }\n\n  @Override\n  public Principal getUserPrincipal() {\n\n    return null;\n  }\n\n  @Override\n  public String getRequestedSessionId() {\n\n    return null;\n  }\n\n  @Override\n  public String getRequestURI() {\n\n    return null;\n  }\n\n  @Override\n  public StringBuffer getRequestURL() {\n\n    return null;\n  }\n\n  @Override\n  public String getServletPath() {\n\n    return null;\n  }\n\n  @Override\n  public HttpSession getSession(boolean create) {\n\n    return null;\n  }\n\n  @Override\n  public HttpSession getSession() {\n\n    return null;\n  }\n\n  @Override\n  public String changeSessionId() {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public boolean isRequestedSessionIdValid() {\n\n    return false;\n  }\n\n  @Override\n  public boolean isRequestedSessionIdFromCookie() {\n\n    return false;\n  }\n\n  @Override\n  public boolean isRequestedSessionIdFromURL() {\n\n    return false;\n  }\n\n  @Override\n  public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public void login(String username, String password) throws ServletException {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public void logout() throws ServletException {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public Collection<Part> getParts() throws IOException, ServletException {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public Part getPart(String name) throws IOException, ServletException {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass)\n      throws IOException, ServletException {\n    throw new UnsupportedOperationException(\"not yet implemented\");\n  }\n\n  @Override\n  public Map<String, String> getTrailerFields() {\n    return HttpServletRequest.super.getTrailerFields();\n  }\n\n  @Override\n  public boolean isTrailerFieldsReady() {\n    return HttpServletRequest.super.isTrailerFieldsReady();\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/MockRequestBuilder.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.util.*;\nimport org.mockito.Mockito;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\n\npublic class MockRequestBuilder {\n\n  private String url = \"/\";\n  private RequestMethod method = GET;\n  private String clientIp = \"x.x.x.x\";\n  private List<HttpHeader> individualHeaders = new ArrayList<>();\n  private Map<String, Cookie> cookies = new HashMap<>();\n  private List<QueryParameter> queryParameters = new ArrayList<>();\n\n  private List<FormParameter> formParameters = new ArrayList<>();\n  private String body = \"\";\n  private String bodyAsBase64 = \"\";\n  private Collection<Request.Part> multiparts = new ArrayList<>();\n  private String protocol = \"HTTP/1.1\";\n\n  private boolean browserProxyRequest = false;\n  private String mockName;\n\n  public MockRequestBuilder() {}\n\n  public MockRequestBuilder(String mockName) {\n    this.mockName = mockName;\n  }\n\n  public static MockRequestBuilder aRequest() {\n    return new MockRequestBuilder();\n  }\n\n  public static MockRequestBuilder aRequest(String mockName) {\n    return new MockRequestBuilder(mockName);\n  }\n\n  public MockRequestBuilder withUrl(String url) {\n    this.url = url;\n    return this;\n  }\n\n  public MockRequestBuilder withQueryParameter(String key, String... values) {\n    queryParameters.add(new QueryParameter(key, Arrays.asList(values)));\n    return this;\n  }\n\n  public MockRequestBuilder withFormParameter(String key, String... values) {\n    formParameters.add(new FormParameter(key, Arrays.asList(values)));\n    return this;\n  }\n\n  public MockRequestBuilder withMethod(RequestMethod method) {\n    this.method = method;\n    return this;\n  }\n\n  public MockRequestBuilder withClientIp(String clientIp) {\n    this.clientIp = clientIp;\n    return this;\n  }\n\n  public MockRequestBuilder withHeader(String key, String value) {\n    individualHeaders.add(new HttpHeader(key, value));\n    return this;\n  }\n\n  public MockRequestBuilder withCookie(String key, String value) {\n    cookies.put(key, new Cookie(value));\n    return this;\n  }\n\n  public MockRequestBuilder withBody(String body) {\n    this.body = body;\n    return this;\n  }\n\n  public MockRequestBuilder withBodyAsBase64(String bodyAsBase64) {\n    this.bodyAsBase64 = bodyAsBase64;\n    return this;\n  }\n\n  public MockRequestBuilder asBrowserProxyRequest() {\n    this.browserProxyRequest = true;\n    return this;\n  }\n\n  public MockRequestBuilder withMultiparts(Collection<Request.Part> parts) {\n    this.multiparts = parts;\n    return this;\n  }\n\n  public MockRequestBuilder withProtocol(String protocol) {\n    this.protocol = protocol;\n    return this;\n  }\n\n  public Request build() {\n    final HttpHeaders headers = new HttpHeaders(individualHeaders);\n\n    final Request request =\n        mockName == null ? Mockito.mock(Request.class) : Mockito.mock(Request.class, mockName);\n    when(request.getUrl()).thenReturn(url);\n    when(request.getPathAndQueryWithoutPrefix()).thenReturn(PathAndQuery.parse(url));\n    when(request.getMethod()).thenReturn(method);\n    when(request.getClientIp()).thenReturn(clientIp);\n    for (HttpHeader header : headers.all()) {\n      when(request.containsHeader(header.key())).thenReturn(true);\n      when(request.getHeader(header.key())).thenReturn(header.firstValue());\n    }\n\n    for (HttpHeader header : headers.all()) {\n      when(request.header(header.key())).thenReturn(header);\n      if (header.key().equals(ContentTypeHeader.KEY) && header.isPresent()) {\n        when(request.contentTypeHeader()).thenReturn(new ContentTypeHeader(header.firstValue()));\n      }\n    }\n\n    for (QueryParameter queryParameter : queryParameters) {\n      when(request.queryParameter(queryParameter.key())).thenReturn(queryParameter);\n    }\n\n    for (FormParameter formParameter : formParameters) {\n      when(request.formParameter(formParameter.key())).thenReturn(formParameter);\n    }\n\n    when(request.header(Mockito.any(String.class))).thenReturn(httpHeader(\"key\", \"value\"));\n\n    when(request.getHeaders()).thenReturn(headers);\n    when(request.getAllHeaderKeys()).thenReturn(new LinkedHashSet<>(headers.keys()));\n    when(request.containsHeader(Mockito.any(String.class))).thenReturn(false);\n    when(request.getCookies()).thenReturn(cookies);\n    when(request.getBody()).thenReturn(body.getBytes());\n    when(request.getBodyAsString()).thenReturn(body);\n    when(request.getBodyAsBase64()).thenReturn(bodyAsBase64);\n    when(request.getAbsoluteUrl()).thenReturn(\"http://localhost:8080\" + url);\n    when(request.getTypedAbsoluteUrl())\n        .thenReturn(AbsoluteUrl.parse(\"http://localhost:8080\" + url));\n    when(request.isBrowserProxyRequest()).thenReturn(browserProxyRequest);\n    when(request.isMultipart()).thenReturn(multiparts != null && !multiparts.isEmpty());\n    when(request.getParts()).thenReturn(multiparts);\n    when(request.getProtocol()).thenReturn(protocol);\n\n    return request;\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/MockWireMockServices.java",
    "content": "/*\n * Copyright (C) 2023-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.emptyMap;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.Extensions;\nimport com.github.tomakehurst.wiremock.extension.WireMockServices;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.TemplateEngine;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.google.common.base.Suppliers;\nimport java.util.Map;\nimport java.util.function.Supplier;\n\npublic class MockWireMockServices implements WireMockServices {\n\n  private FileSource fileSource = new NoFileSource();\n\n  private Map<String, Helper<?>> helpers = emptyMap();\n  private Long maxCacheEntries = null;\n  private final Supplier<TemplateEngine> templateEngine =\n      Suppliers.memoize(\n          () -> new TemplateEngine(helpers, maxCacheEntries, null, true, emptyList()));\n\n  @Override\n  public Admin getAdmin() {\n    return null;\n  }\n\n  @Override\n  public Stores getStores() {\n    return null;\n  }\n\n  @Override\n  public FileSource getFiles() {\n    return fileSource;\n  }\n\n  @Override\n  public Options getOptions() {\n    return null;\n  }\n\n  @Override\n  public Extensions getExtensions() {\n    return null;\n  }\n\n  @Override\n  public TemplateEngine getTemplateEngine() {\n    return templateEngine.get();\n  }\n\n  @Override\n  public HttpClientFactory getHttpClientFactory() {\n    return null;\n  }\n\n  @Override\n  public HttpClient getDefaultHttpClient() {\n    return null;\n  }\n\n  public MockWireMockServices setFileSource(FileSource fileSource) {\n    this.fileSource = fileSource;\n    return this;\n  }\n\n  public MockWireMockServices setHelpers(Map<String, Helper<?>> helpers) {\n    this.helpers = helpers;\n    return this;\n  }\n\n  public MockWireMockServices setMaxCacheEntries(Long maxCacheEntries) {\n    this.maxCacheEntries = maxCacheEntries;\n    return this;\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/MultipartBody.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.common.Strings.bytesFromString;\n\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport org.apache.hc.client5.http.entity.mime.AbstractContentBody;\nimport org.apache.hc.core5.http.ContentType;\nimport org.apache.hc.core5.util.Args;\n\n// TODO break dependency on `AbstractContentBody` so we are decoupled from Apache HTTP Client in the\n// API\npublic class MultipartBody extends AbstractContentBody {\n  private final String name;\n  private final byte[] body;\n\n  MultipartBody(String name, byte[] body) {\n    super(ContentType.APPLICATION_OCTET_STREAM);\n    Args.notEmpty(name, \"Name was empty\");\n    Args.notNull(body, \"Body was null\");\n    this.name = name;\n    this.body = body;\n  }\n\n  MultipartBody(String name, String body, ContentType contentType) {\n    super(contentType);\n    Args.notEmpty(name, \"Name was empty\");\n    Args.notEmpty(body, \"Body was null\");\n    this.name = name;\n    this.body = bytesFromString(body, contentType.getCharset());\n  }\n\n  public static MultipartBody part(String name, byte[] body) {\n    return new MultipartBody(name, body);\n  }\n\n  public static MultipartBody part(String name, String body, ContentType contentType) {\n    return new MultipartBody(name, body, contentType);\n  }\n\n  @Override\n  public String getFilename() {\n    return name;\n  }\n\n  @Override\n  public void writeTo(OutputStream out) throws IOException {\n    out.write(body);\n  }\n\n  @Override\n  public long getContentLength() {\n    return body.length;\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/Network.java",
    "content": "/*\n * Copyright (C) 2015-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport java.net.ServerSocket;\n\npublic class Network {\n\n  public static int findFreePort() {\n    try {\n      ServerSocket socket = new ServerSocket(0);\n      int result = socket.getLocalPort();\n      socket.close();\n\n      return result;\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/NoFileSource.java",
    "content": "/*\n * Copyright (C) 2016-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport com.github.tomakehurst.wiremock.common.BinaryFile;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport java.net.URI;\nimport java.util.List;\n\npublic class NoFileSource implements FileSource {\n\n  public static NoFileSource noFileSource() {\n    return new NoFileSource();\n  }\n\n  @Override\n  public BinaryFile getBinaryFileNamed(String name) {\n    return null;\n  }\n\n  @Override\n  public TextFile getTextFileNamed(String name) {\n    return null;\n  }\n\n  @Override\n  public void createIfNecessary() {}\n\n  @Override\n  public FileSource child(String subDirectoryName) {\n    return null;\n  }\n\n  @Override\n  public String getPath() {\n    return null;\n  }\n\n  @Override\n  public URI getUri() {\n    return null;\n  }\n\n  @Override\n  public List<TextFile> listFilesRecursively() {\n    return null;\n  }\n\n  @Override\n  public void writeTextFile(String name, String contents) {}\n\n  @Override\n  public void writeBinaryFile(String name, byte[] contents) {}\n\n  @Override\n  public boolean exists() {\n    return false;\n  }\n\n  @Override\n  public void deleteFile(String name) {}\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/NonGlobalStubMappingTransformer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.StubMappingTransformer;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic class NonGlobalStubMappingTransformer extends StubMappingTransformer {\n  @Override\n  public StubMapping transform(StubMapping stubMapping, FileSource files, Parameters parameters) {\n    return WireMock.get(stubMapping.getRequest().getUrl() + \"?transformed=nonglobal\")\n        .withHeader(\"Accept\", equalTo(\"B\"))\n        .build();\n  }\n\n  @Override\n  public boolean applyGlobally() {\n    return false;\n  }\n\n  @Override\n  public String getName() {\n    return \"nonglobal-transformer\";\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/ServeEventChecks.java",
    "content": "/*\n * Copyright (C) 2023-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.common.Strings.normaliseLineBreaks;\nimport static com.github.tomakehurst.wiremock.stubbing.SubEvent.JSON_ERROR;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.fail;\n\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.Message;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\n\npublic class ServeEventChecks {\n\n  public static void assertMessageSubEventPresent(Admin admin, String type, String message) {\n    admin.getServeEvents().getServeEvents().stream()\n        .findFirst()\n        .ifPresentOrElse(\n            serveEvent -> {\n              assertThat(serveEvent.getSubEvents(), hasSize(1));\n              serveEvent.getSubEvents().stream()\n                  .findFirst()\n                  .ifPresentOrElse(\n                      subEvent -> {\n                        assertThat(subEvent.getType(), is(type));\n                        assertThat(\n                            normaliseLineBreaks(subEvent.getDataAs(Message.class).getMessage()),\n                            is(normaliseLineBreaks(message)));\n                      },\n                      () -> fail(\"No sub events found\"));\n            },\n            () -> fail(\"No serve events found\"));\n  }\n\n  public static void checkMessage(MatchResult matchResult, String type, String message) {\n    matchResult.getSubEvents().stream()\n        .filter(subEvent -> subEvent.getType().equals(type))\n        .findFirst()\n        .ifPresentOrElse(\n            subEvent ->\n                assertThat(\n                    normaliseLineBreaks(subEvent.getDataAs(Message.class).getMessage()),\n                    is(normaliseLineBreaks(message))),\n            () -> fail(\"No sub event of type \" + type + \" found\"));\n  }\n\n  public static void checkJsonError(MatchResult matchResult, String detailMessage) {\n    matchResult.getSubEvents().stream()\n        .filter(subEvent -> subEvent.getType().equals(JSON_ERROR))\n        .findFirst()\n        .ifPresentOrElse(\n            subEvent ->\n                assertThat(\n                    normaliseLineBreaks(subEvent.getDataAs(Errors.class).first().getDetail()),\n                    is(normaliseLineBreaks(detailMessage))),\n            () -> fail(\"No sub event of type JSON_ERROR found\"));\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/StubMappingTransformerWithFailure.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.POST;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.StubMappingTransformer;\nimport com.github.tomakehurst.wiremock.recording.StubGenerationResult;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic class StubMappingTransformerWithFailure extends StubMappingTransformer {\n  @Override\n  public StubGenerationResult transform(\n      StubMapping stubMapping, FileSource files, Parameters parameters, ServeEvent serveEvent) {\n    if (serveEvent.getRequest().getMethod().equals(POST)) {\n      return new StubGenerationResult.Failure(\n          \"POST \" + serveEvent.getRequest().getUrl() + \" not allowed\");\n    } else {\n      return new StubGenerationResult.Success(\n          WireMock.get(urlEqualTo(stubMapping.getRequest().getUrl() + \"?transformed=success\"))\n              .build());\n    }\n  }\n\n  @Override\n  public String getName() {\n    return \"stub-transformer-with-failure\";\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/StubMappingTransformerWithServeEvent.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.ParameterUtils;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.StubMappingTransformer;\nimport com.github.tomakehurst.wiremock.recording.StubGenerationResult;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic class StubMappingTransformerWithServeEvent extends StubMappingTransformer {\n  @Override\n  public StubGenerationResult transform(\n      StubMapping stubMapping, FileSource files, Parameters parameters, ServeEvent serveEvent) {\n    return new StubGenerationResult.Success(\n        WireMock.get(\n                urlEqualTo(\n                    ParameterUtils.getFirstNonNull(\n                            stubMapping.getRequest().getUrl(),\n                            stubMapping.getRequest().getUrlPath())\n                        + \"?transformed=\"\n                        + serveEvent.getRequest().queryParameter(\"some-query\").firstValue()))\n            .build());\n  }\n\n  @Override\n  public String getName() {\n    return \"stub-transformer-with-serve-event\";\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/TestFiles.java",
    "content": "/*\n * Copyright (C) 2017-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResourcePath;\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResourceURI;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.URI;\nimport java.nio.file.Files;\n\npublic class TestFiles {\n\n  public static final String TRUST_STORE_PASSWORD = \"mytruststorepassword\";\n  public static final String TRUST_STORE_NAME = getTrustStoreRelativeName();\n  public static final String JCEKS_TRUST_STORE_NAME = \"test-truststore.jceks\";\n  public static final String TRUST_STORE_PATH = filePath(TRUST_STORE_NAME);\n  public static final String KEY_STORE_PATH = filePath(\"test-keystore\");\n  public static final String KEY_STORE_WITH_CA_PATH = filePath(\"test-keystore-with-ca\");\n\n  private static String getTrustStoreRelativeName() {\n    return System.getProperty(\"java.specification.version\").equals(\"1.7\")\n        ? \"test-truststore.jks\"\n        : \"test-truststore.pkcs12\";\n  }\n\n  public static String defaultTestFilesRoot() {\n    return filePath(\"test-file-root\");\n  }\n\n  public static String file(String path) {\n    try {\n      String text = Files.readString(getResourcePath(TestFiles.class, path));\n      if (System.getProperty(\"os.name\").startsWith(\"Windows\")) {\n        text = text.replaceAll(\"\\\\r\\\\n\", \"\\n\").replaceAll(\"\\\\r\", \"\\n\");\n      }\n\n      return text;\n    } catch (IOException e) {\n      return throwUnchecked(e, String.class);\n    }\n  }\n\n  public static String filePath(String path) {\n    return new File(fileUri(path)).getAbsolutePath();\n  }\n\n  public static URI fileUri(String path) {\n    return getResourceURI(TestFiles.class, path);\n  }\n\n  public static String sampleWarRootDir() {\n    return new File(\"sample-war\").exists() ? \"sample-war\" : \"../sample-war\";\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/TestHttpHeader.java",
    "content": "/*\n * Copyright (C) 2011-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\npublic class TestHttpHeader {\n\n  private String name;\n  private String value;\n\n  public static TestHttpHeader withHeader(String name, String value) {\n    return new TestHttpHeader(name, value);\n  }\n\n  public TestHttpHeader(String name, String value) {\n    this.name = name;\n    this.value = value;\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  public String getValue() {\n    return value;\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/TestNotifier.java",
    "content": "/*\n * Copyright (C) 2016-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.LocalNotifier;\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class TestNotifier implements Notifier {\n\n  private List<String> info;\n  private List<String> error;\n\n  private Notifier previousNotifier;\n\n  private final ConsoleNotifier consoleNotifier = new ConsoleNotifier(true);\n\n  public TestNotifier() {\n    this.info = Collections.synchronizedList(new ArrayList<>());\n    this.error = Collections.synchronizedList(new ArrayList<>());\n  }\n\n  public static TestNotifier createAndSet() {\n    TestNotifier testNotifier = new TestNotifier();\n    testNotifier.previousNotifier = LocalNotifier.notifier();\n    LocalNotifier.set(testNotifier);\n    return testNotifier;\n  }\n\n  public void revert() {\n    LocalNotifier.set(previousNotifier);\n  }\n\n  @Override\n  public void info(String message) {\n    this.info.add(message);\n    consoleNotifier.info(message);\n  }\n\n  @Override\n  public void error(String message) {\n    this.error.add(message);\n    consoleNotifier.error(message);\n  }\n\n  @Override\n  public void error(String message, Throwable t) {\n    this.error.add(message);\n    consoleNotifier.error(message, t);\n  }\n\n  public List<String> getInfoMessages() {\n    return List.copyOf(info);\n  }\n\n  public List<String> getErrorMessages() {\n    return List.copyOf(error);\n  }\n\n  public void reset() {\n    info.clear();\n    error.clear();\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/ThrowingWebhookTransformer.java",
    "content": "/*\n * Copyright (C) 2023-2024 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport org.wiremock.webhooks.WebhookDefinition;\nimport org.wiremock.webhooks.WebhookTransformer;\n\npublic class ThrowingWebhookTransformer implements WebhookTransformer {\n\n  @Override\n  public WebhookDefinition transform(ServeEvent serveEvent, WebhookDefinition webhookDefinition) {\n    throw new RuntimeException(\"oh no\");\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/WebsocketTestClient.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static java.util.concurrent.TimeUnit.SECONDS;\nimport static org.awaitility.Awaitility.await;\n\nimport jakarta.websocket.ClientEndpointConfig;\nimport jakarta.websocket.ContainerProvider;\nimport jakarta.websocket.Endpoint;\nimport jakarta.websocket.EndpointConfig;\nimport jakarta.websocket.MessageHandler;\nimport jakarta.websocket.Session;\nimport jakarta.websocket.WebSocketContainer;\nimport java.net.URI;\nimport java.nio.ByteBuffer;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\n\npublic class WebsocketTestClient {\n\n  private final WebSocketContainer websocketClient = ContainerProvider.getWebSocketContainer();\n\n  private final NotificationCapturingEndpoint endpoint = new NotificationCapturingEndpoint();\n\n  private Session persistentSession;\n\n  public void connect(String url) {\n    ClientEndpointConfig endpointConfig = ClientEndpointConfig.Builder.create().build();\n    URI uri = URI.create(url);\n    try {\n      persistentSession = websocketClient.connectToServer(endpoint, endpointConfig, uri);\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public boolean isConnected() {\n    return persistentSession != null && persistentSession.isOpen();\n  }\n\n  public void sendMessage(String message) {\n    if (persistentSession == null || !persistentSession.isOpen()) {\n      throw new IllegalStateException(\"Not connected. Call connect() first.\");\n    }\n    try {\n      persistentSession.getBasicRemote().sendText(message);\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public void sendBinaryMessage(byte[] data) {\n    if (persistentSession == null || !persistentSession.isOpen()) {\n      throw new IllegalStateException(\"Not connected. Call connect() first.\");\n    }\n    try {\n      persistentSession.getBasicRemote().sendBinary(ByteBuffer.wrap(data));\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public void disconnect() {\n    if (persistentSession != null && persistentSession.isOpen()) {\n      try {\n        persistentSession.close();\n      } catch (Exception e) {\n        throw new RuntimeException(e);\n      }\n    }\n    persistentSession = null;\n  }\n\n  public <T> T withWebsocketSession(String url, Function<Session, T> work) {\n    ClientEndpointConfig endpointConfig = ClientEndpointConfig.Builder.create().build();\n    URI uri = URI.create(url);\n    try (Session session = websocketClient.connectToServer(endpoint, endpointConfig, uri)) {\n      return work.apply(session);\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public void sendMessage(String url, String message) {\n    withWebsocketSession(\n        url,\n        session -> {\n          try {\n            session.getBasicRemote().sendText(message);\n            Thread.sleep(100); // Give time for response\n            return null;\n          } catch (Exception e) {\n            throw new RuntimeException(e);\n          }\n        });\n  }\n\n  public String sendMessageAndWaitForResponse(String url, String message) {\n    return sendMessageAndWaitForResponse(url, message, m -> true);\n  }\n\n  public String sendMessageAndWaitForResponse(\n      String url, String message, Predicate<String> responsePredicate) {\n    ClientEndpointConfig endpointConfig = ClientEndpointConfig.Builder.create().build();\n    URI uri = URI.create(url);\n    try (Session session = websocketClient.connectToServer(endpoint, endpointConfig, uri)) {\n      int messageCountBefore = endpoint.messages.size();\n      session.getBasicRemote().sendText(message);\n      await()\n          .atMost(5, SECONDS)\n          .until(\n              () ->\n                  endpoint.messages.size() > messageCountBefore\n                      && endpoint\n                          .messages\n                          .subList(messageCountBefore, endpoint.messages.size())\n                          .stream()\n                          .anyMatch(responsePredicate));\n      return endpoint.messages.subList(messageCountBefore, endpoint.messages.size()).stream()\n          .filter(responsePredicate)\n          .findFirst()\n          .orElse(null);\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public byte[] sendMessageAndWaitForBinaryResponse(String url, String message) {\n    ClientEndpointConfig endpointConfig = ClientEndpointConfig.Builder.create().build();\n    URI uri = URI.create(url);\n    try (Session session = websocketClient.connectToServer(endpoint, endpointConfig, uri)) {\n      int binaryMessageCountBefore = endpoint.binaryMessages.size();\n      session.getBasicRemote().sendText(message);\n      await()\n          .atMost(5, SECONDS)\n          .until(() -> endpoint.binaryMessages.size() > binaryMessageCountBefore);\n      return endpoint.binaryMessages.get(binaryMessageCountBefore);\n    } catch (Exception e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public List<String> getMessages() {\n    return endpoint.messages;\n  }\n\n  public void clearMessages() {\n    endpoint.messages.clear();\n  }\n\n  public String waitForMessage(Predicate<String> predicate) {\n    await().atMost(5, SECONDS).until(() -> endpoint.messages.stream().anyMatch(predicate));\n    return endpoint.messages.stream().filter(predicate).findFirst().get();\n  }\n\n  public List<byte[]> getBinaryMessages() {\n    return endpoint.binaryMessages;\n  }\n\n  public void clearBinaryMessages() {\n    endpoint.binaryMessages.clear();\n  }\n\n  public static class NotificationCapturingEndpoint extends Endpoint {\n\n    public final List<String> messages = new LinkedList<>();\n    public final List<byte[]> binaryMessages = new LinkedList<>();\n\n    @Override\n    public void onOpen(Session session, EndpointConfig config) {\n      session.addMessageHandler(String.class, (MessageHandler.Whole<String>) messages::add);\n      session.addMessageHandler(\n          ByteBuffer.class,\n          (MessageHandler.Whole<ByteBuffer>)\n              buffer -> {\n                byte[] data = new byte[buffer.remaining()];\n                buffer.get(data);\n                binaryMessages.add(data);\n              });\n    }\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/WireMatchers.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static java.util.Arrays.asList;\nimport static java.util.regex.Pattern.DOTALL;\nimport static java.util.regex.Pattern.MULTILINE;\n\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.matching.UrlPattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.*;\nimport java.util.function.Predicate;\nimport java.util.regex.Pattern;\nimport java.util.stream.Collectors;\nimport java.util.stream.StreamSupport;\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.TypeSafeDiagnosingMatcher;\nimport org.hamcrest.TypeSafeMatcher;\nimport org.hamcrest.core.IsEqual;\nimport org.skyscreamer.jsonassert.JSONAssert;\nimport org.skyscreamer.jsonassert.JSONCompareMode;\nimport org.xmlunit.builder.DiffBuilder;\nimport org.xmlunit.builder.Input;\nimport org.xmlunit.diff.ComparisonControllers;\nimport org.xmlunit.diff.Diff;\n\npublic class WireMatchers {\n\n  public static final TypeSafeDiagnosingMatcher<StubMapping> IS_PERSISTENT =\n      new TypeSafeDiagnosingMatcher<>() {\n        @Override\n        public void describeTo(Description description) {\n          description.appendText(\"a stub mapping marked as persistent\");\n        }\n\n        @Override\n        protected boolean matchesSafely(StubMapping stub, Description mismatchDescription) {\n          final boolean result = stub.shouldBePersisted();\n          if (!result) {\n            mismatchDescription.appendText(stub.getId() + \" not marked as persistent\");\n          }\n\n          return result;\n        }\n      };\n\n  public static Matcher<String> equalToJson(final String expectedJson) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"Expected:\\n\" + expectedJson);\n      }\n\n      @Override\n      public boolean matchesSafely(String actualJson) {\n        try {\n          JSONAssert.assertEquals(expectedJson, actualJson, JSONCompareMode.STRICT);\n          return true;\n        } catch (Throwable e) {\n          return false;\n        }\n      }\n    };\n  }\n\n  public static Matcher<byte[]> bytesEqualToJson(\n      final String expectedJson, final JSONCompareMode jsonCompareMode) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"Expected:\\n\" + expectedJson);\n      }\n\n      @Override\n      public boolean matchesSafely(byte[] actualJson) {\n        try {\n          JSONAssert.assertEquals(\n              expectedJson, Strings.stringFromBytes(actualJson), jsonCompareMode);\n          return true;\n        } catch (Throwable e) {\n          return false;\n        }\n      }\n    };\n  }\n\n  public static Matcher<String> equalToJson(\n      final String expectedJson, final JSONCompareMode jsonCompareMode) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"Expected:\\n\" + expectedJson);\n      }\n\n      @Override\n      public boolean matchesSafely(String actualJson) {\n        try {\n          JSONAssert.assertEquals(expectedJson, actualJson, jsonCompareMode);\n          return true;\n        } catch (Throwable e) {\n          return false;\n        }\n      }\n    };\n  }\n\n  public static Matcher<byte[]> equalToBinaryJson(\n      final String expectedJson, final JSONCompareMode jsonCompareMode) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"Expected:\\n\" + expectedJson);\n      }\n\n      @Override\n      public boolean matchesSafely(byte[] actualJson) {\n        try {\n          JSONAssert.assertEquals(\n              expectedJson, Strings.stringFromBytes(actualJson), jsonCompareMode);\n          return true;\n        } catch (Throwable e) {\n          return false;\n        }\n      }\n    };\n  }\n\n  public static Matcher<String> equalToXml(final String expected) {\n    return new TypeSafeMatcher<>() {\n      @Override\n      protected boolean matchesSafely(String value) {\n        Diff diff =\n            DiffBuilder.compare(Input.from(expected))\n                .withTest(value)\n                .withComparisonController(ComparisonControllers.StopWhenDifferent)\n                .ignoreWhitespace()\n                .ignoreComments()\n                .build();\n\n        return !diff.hasDifferences();\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"Expected:\\n\" + expected);\n      }\n    };\n  }\n\n  public static Matcher<String> matches(final String regex) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"Should match \" + regex);\n      }\n\n      @Override\n      public boolean matchesSafely(String actual) {\n        return actual.matches(regex);\n      }\n    };\n  }\n\n  public static Matcher<String> matchesMultiLine(final String regex) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"Should match \" + regex);\n      }\n\n      @Override\n      public boolean matchesSafely(String actual) {\n        return Pattern.compile(regex, MULTILINE + DOTALL).matcher(actual).matches();\n      }\n    };\n  }\n\n  @SafeVarargs\n  public static <T> Matcher<Iterable<T>> hasExactly(final Matcher<T>... items) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"Collection must match exactly\");\n      }\n\n      @Override\n      public boolean matchesSafely(Iterable<T> actual) {\n        Iterator<T> actualIter = actual.iterator();\n        for (Matcher<T> matcher : items) {\n          if (!matcher.matches(actualIter.next())) {\n            return false;\n          }\n        }\n\n        return !actualIter.hasNext();\n      }\n    };\n  }\n\n  public static <T> Matcher<Iterable<T>> hasExactlyIgnoringOrder(final Matcher<T>... items) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"Collection elements must match, but don't have to be in the same order.\");\n      }\n\n      @Override\n      public boolean matchesSafely(Iterable<T> actual) {\n        if (StreamSupport.stream(actual.spliterator(), false).count() != items.length) {\n          return false;\n        }\n\n        for (final Matcher<T> matcher : items) {\n          if (StreamSupport.stream(actual.spliterator(), false)\n                  .filter(isMatchFor(matcher))\n                  .findAny()\n                  .orElse(null)\n              == null) {\n            return false;\n          }\n        }\n\n        return true;\n      }\n    };\n  }\n\n  private static <T> Predicate<T> isMatchFor(final Matcher<T> matcher) {\n    return matcher::matches;\n  }\n\n  public static Matcher<TextFile> fileNamed(final String name) {\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"a text file named \" + name);\n      }\n\n      @Override\n      public boolean matchesSafely(TextFile textFile) {\n        return textFile.name().endsWith(name);\n      }\n    };\n  }\n\n  public static Matcher<TextFile> fileWithPath(final String path) {\n\n    String normalizedPath = path.replace('/', File.separatorChar);\n    return new TypeSafeMatcher<>() {\n\n      @Override\n      public void describeTo(Description desc) {\n        desc.appendText(\"a text file with path \" + normalizedPath);\n      }\n\n      @Override\n      public boolean matchesSafely(TextFile textFile) {\n        return textFile.getPath().equals(normalizedPath);\n      }\n    };\n  }\n\n  public static Matcher<Date> isAfter(final String dateString) {\n    return new TypeSafeMatcher<>() {\n      @Override\n      public boolean matchesSafely(Date date) {\n        SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n        try {\n          Date compareDate = df.parse(dateString);\n          return date.after(compareDate);\n        } catch (ParseException pe) {\n          throw new RuntimeException(pe);\n        }\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"A date after \" + dateString);\n      }\n    };\n  }\n\n  public static Matcher<Date> isToday() {\n    return new TypeSafeMatcher<>() {\n      @Override\n      public boolean matchesSafely(Date date) {\n        SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n        String today = df.format(new Date());\n        return today.equals(df.format(date));\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"Today's date\");\n      }\n    };\n  }\n\n  public static Matcher<HttpHeader> header(final String key, final String value) {\n    return new TypeSafeMatcher<>() {\n      @Override\n      public boolean matchesSafely(HttpHeader httpHeader) {\n        return httpHeader.key().equals(key) && httpHeader.containsValue(value);\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(String.format(\"Header %s: %s\", key, value));\n      }\n    };\n  }\n\n  public static Matcher<Path> hasFileContaining(final String... contents) {\n    return new TypeSafeDiagnosingMatcher<>() {\n      @Override\n      protected boolean matchesSafely(Path path, Description mismatchDescription) {\n        List<File> files = asList(Objects.requireNonNull(path.toFile().listFiles()));\n        boolean matched =\n            files.stream()\n                .anyMatch(\n                    file -> {\n                      final String fileContents = fileContents(file);\n\n                      return Arrays.stream(contents).allMatch(fileContents::contains);\n                    });\n\n        if (files.isEmpty()) {\n          mismatchDescription.appendText(\"there were no files in \" + path);\n        }\n\n        if (!matched) {\n          String allFileContents =\n              files.stream().map(WireMatchers::fileContents).collect(Collectors.joining(\"\\n\\n\"));\n\n          mismatchDescription.appendText(allFileContents);\n        }\n\n        return matched;\n      }\n\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"a file containing all of: \" + String.join(\", \", contents));\n      }\n    };\n  }\n\n  public static Matcher<String> equalsMultiLine(final String expected) {\n    String normalisedExpected = Strings.normaliseLineBreaks(expected);\n    return new IsEqual<>(normalisedExpected) {\n      @Override\n      public boolean matches(Object actualValue) {\n        return super.matches(actualValue.toString());\n      }\n    };\n  }\n\n  private static String fileContents(File input) {\n    try {\n      return Files.readString(input.toPath());\n    } catch (IOException e) {\n      return throwUnchecked(e, String.class);\n    }\n  }\n\n  public static Predicate<StubMapping> withUrl(final String url) {\n    return input -> url.equals(input.getRequest().getUrl());\n  }\n\n  public static TypeSafeDiagnosingMatcher<StubMapping> stubMappingWithUrl(final String url) {\n    return stubMappingWithUrl(urlEqualTo(url));\n  }\n\n  public static TypeSafeDiagnosingMatcher<StubMapping> stubMappingWithUrl(\n      final UrlPattern urlPattern) {\n    return new TypeSafeDiagnosingMatcher<>() {\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"a stub mapping with a request URL matching \" + urlPattern);\n      }\n\n      @Override\n      protected boolean matchesSafely(StubMapping item, Description mismatchDescription) {\n        return urlPattern.match(item.getRequest().getUrl()).isExactMatch();\n      }\n    };\n  }\n\n  public static ServeEvent findServeEventWithUrl(List<ServeEvent> serveEvents, final String url) {\n    return serveEvents.stream()\n        .filter(input -> url.equals(input.getRequest().getUrl()))\n        .findAny()\n        .orElseThrow(NoSuchElementException::new);\n  }\n\n  public static StubMapping findMappingWithUrl(List<StubMapping> stubMappings, final String url) {\n    return stubMappings.stream()\n        .filter(withUrl(url))\n        .findAny()\n        .orElseThrow(NoSuchElementException::new);\n  }\n\n  public static List<StubMapping> findMappingsWithUrl(\n      List<StubMapping> stubMappings, final String url) {\n    return stubMappings.stream().filter(withUrl(url)).collect(Collectors.toUnmodifiableList());\n  }\n\n  public static TypeSafeDiagnosingMatcher<StubMapping> isInAScenario() {\n    return new TypeSafeDiagnosingMatcher<>() {\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"a stub mapping with a scenario name\");\n      }\n\n      @Override\n      protected boolean matchesSafely(StubMapping item, Description mismatchDescription) {\n        return item.getScenarioName() != null;\n      }\n    };\n  }\n\n  public static Matcher<MessageStubMapping> messageStubMappingWithName(final String name) {\n    return new TypeSafeDiagnosingMatcher<>() {\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"a message stub mapping with name \").appendValue(name);\n      }\n\n      @Override\n      protected boolean matchesSafely(MessageStubMapping item, Description mismatchDescription) {\n        if (name.equals(item.getName())) {\n          return true;\n        }\n        mismatchDescription.appendText(\"name was \").appendValue(item.getName());\n        return false;\n      }\n    };\n  }\n\n  public static Matcher<MessageStubMapping> messageStubMappingWithId(final UUID id) {\n    return new TypeSafeDiagnosingMatcher<>() {\n      @Override\n      public void describeTo(Description description) {\n        description.appendText(\"a message stub mapping with id \").appendValue(id);\n      }\n\n      @Override\n      protected boolean matchesSafely(MessageStubMapping item, Description mismatchDescription) {\n        if (id.equals(item.getId())) {\n          return true;\n        }\n        mismatchDescription.appendText(\"id was \").appendValue(item.getId());\n        return false;\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/WireMockResponse.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirst;\nimport static com.github.tomakehurst.wiremock.testsupport.HttpClientUtils.getEntityAsByteArrayAndCloseStream;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.google.common.collect.ImmutableListMultimap;\nimport com.google.common.collect.Multimap;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.ClassicHttpResponse;\nimport org.apache.hc.core5.http.Header;\n\npublic class WireMockResponse {\n\n  private final ClassicHttpResponse httpResponse;\n  private final byte[] content;\n\n  public WireMockResponse(CloseableHttpResponse httpResponse) {\n    this.httpResponse = httpResponse;\n    content = getEntityAsByteArrayAndCloseStream(httpResponse);\n  }\n\n  public int statusCode() {\n    return httpResponse.getCode();\n  }\n\n  public String content() {\n    if (content == null) {\n      return null;\n    }\n    return new String(content, UTF_8);\n  }\n\n  public byte[] binaryContent() {\n    return content;\n  }\n\n  public String firstHeader(String key) {\n    return getFirst(headers().get(key), null);\n  }\n\n  public Multimap<String, String> headers() {\n    ImmutableListMultimap.Builder<String, String> builder = ImmutableListMultimap.builder();\n\n    for (Header header : httpResponse.getHeaders()) {\n      builder.put(header.getName(), header.getValue());\n    }\n\n    return builder.build();\n  }\n\n  public String statusMessage() {\n    return httpResponse.getReasonPhrase();\n  }\n}\n"
  },
  {
    "path": "src/testFixtures/java/com/github/tomakehurst/wiremock/testsupport/WireMockTestClient.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.testsupport;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.Strings.isNullOrEmpty;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.*;\nimport static java.net.HttpURLConnection.HTTP_CREATED;\nimport static java.net.HttpURLConnection.HTTP_OK;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static org.apache.hc.core5.http.ContentType.DEFAULT_BINARY;\n\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.http.MimeType;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.net.URI;\nimport java.nio.charset.Charset;\nimport java.util.Collection;\nimport javax.net.ssl.SSLContext;\nimport org.apache.hc.client5.http.auth.UsernamePasswordCredentials;\nimport org.apache.hc.client5.http.classic.methods.*;\nimport org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;\nimport org.apache.hc.client5.http.impl.auth.BasicScheme;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.client5.http.impl.classic.HttpClientBuilder;\nimport org.apache.hc.client5.http.impl.io.ManagedHttpClientConnectionFactory;\nimport org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;\nimport org.apache.hc.client5.http.protocol.HttpClientContext;\nimport org.apache.hc.client5.http.ssl.NoopHostnameVerifier;\nimport org.apache.hc.client5.http.ssl.SSLConnectionSocketFactoryBuilder;\nimport org.apache.hc.core5.http.ClassicHttpRequest;\nimport org.apache.hc.core5.http.ContentType;\nimport org.apache.hc.core5.http.HttpEntity;\nimport org.apache.hc.core5.http.HttpHost;\nimport org.apache.hc.core5.http.config.CharCodingConfig;\nimport org.apache.hc.core5.http.io.entity.InputStreamEntity;\nimport org.apache.hc.core5.http.io.entity.StringEntity;\nimport org.apache.hc.core5.ssl.SSLContexts;\n\n@SuppressWarnings(\"HttpUrlsUsage\")\npublic class WireMockTestClient {\n\n  private static final String LOCAL_WIREMOCK_ROOT = \"http://%s:%d%s\";\n  private static final String LOCAL_WIREMOCK_SNAPSHOT_PATH = \"/__admin/recordings/snapshot\";\n\n  private final int port;\n  private final String address;\n\n  private final CloseableHttpClient client;\n\n  public WireMockTestClient(int port, String address) {\n    this.port = port;\n    this.address = address;\n\n    this.client = httpClient();\n  }\n\n  public WireMockTestClient(int port) {\n    this(port, \"localhost\");\n  }\n\n  public WireMockTestClient() {\n    this(8080);\n  }\n\n  private String mockServiceUrlFor(String path) {\n    return String.format(LOCAL_WIREMOCK_ROOT, address, port, path);\n  }\n\n  public WireMockResponse get(String url, TestHttpHeader... headers) {\n    return execute(RequestMethod.GET, url, null, null, null, headers);\n  }\n\n  public WireMockResponse head(String url, TestHttpHeader... headers) {\n    return execute(RequestMethod.HEAD, url, null, null, null, headers);\n  }\n\n  public WireMockResponse getWithBody(\n      String url, String body, String contentType, TestHttpHeader... headers) {\n    return execute(RequestMethod.GET, url, body, contentType, null, headers);\n  }\n\n  public WireMockResponse getViaProxy(String url) {\n    return getViaProxy(url, port);\n  }\n\n  public WireMockResponse getViaProxy(String url, int proxyPort) {\n    return getViaProxy(url, proxyPort, HttpHost.DEFAULT_SCHEME.getId());\n  }\n\n  public WireMockResponse getViaProxy(String url, int proxyPort, String scheme) {\n    URI targetUri = URI.create(url);\n    HttpHost proxy = new HttpHost(scheme, address, proxyPort);\n\n    HttpHost target = new HttpHost(targetUri.getScheme(), targetUri.getHost(), targetUri.getPort());\n    HttpGet req =\n        new HttpGet(\n            targetUri.getPath()\n                + (isNullOrEmpty(targetUri.getQuery()) ? \"\" : \"?\" + targetUri.getQuery()));\n    req.removeHeaders(\"Host\");\n\n    System.out.println(\"executing request to \" + targetUri + \"(\" + target + \") via \" + proxy);\n\n    try (CloseableHttpClient httpClientUsingProxy =\n        HttpClientBuilder.create()\n            .disableAuthCaching()\n            .disableAutomaticRetries()\n            .disableCookieManagement()\n            .disableRedirectHandling()\n            .setConnectionManager(\n                PoolingHttpClientConnectionManagerBuilder.create()\n                    .setSSLSocketFactory(\n                        SSLConnectionSocketFactoryBuilder.create()\n                            .setSslContext(buildTrustWireMockDefaultCertificateSSLContext())\n                            .setHostnameVerifier(new NoopHostnameVerifier())\n                            .build())\n                    .build())\n            .setProxy(proxy)\n            .build()) {\n\n      try (CloseableHttpResponse httpResponse = httpClientUsingProxy.execute(target, req)) {\n        return new WireMockResponse(httpResponse);\n      }\n    } catch (IOException ioe) {\n      return Exceptions.throwUnchecked(ioe, WireMockResponse.class);\n    }\n  }\n\n  public WireMockResponse put(String url, TestHttpHeader... headers) {\n    return execute(RequestMethod.PUT, url, null, null, null, headers);\n  }\n\n  public WireMockResponse putWithBody(\n      String url, String body, String contentType, TestHttpHeader... headers) {\n    return execute(RequestMethod.PUT, url, body, contentType, null, headers);\n  }\n\n  public WireMockResponse patchWithBody(\n      String url, String body, String contentType, TestHttpHeader... headers) {\n    return execute(RequestMethod.PATCH, url, body, contentType, null, headers);\n  }\n\n  public WireMockResponse post(String url, TestHttpHeader... headers) {\n    return execute(RequestMethod.POST, url, null, null, null, headers);\n  }\n\n  public WireMockResponse postWithBody(String url, String body, TestHttpHeader... headers) {\n    return execute(RequestMethod.POST, url, body, null, null, headers);\n  }\n\n  public WireMockResponse query(String url, TestHttpHeader... headers) {\n    return execute(QUERY, url, null, null, null, headers);\n  }\n\n  public WireMockResponse queryWithBody(\n      String url, String body, String contentType, TestHttpHeader... headers) {\n    return execute(QUERY, url, body, contentType, null, headers);\n  }\n\n  public WireMockResponse queryXml(String url, String body, TestHttpHeader... headers) {\n    return queryWithBody(url, body, \"application/xml\", headers);\n  }\n\n  @SuppressWarnings(\"UnusedReturnValue\")\n  public WireMockResponse queryJson(String url, String body, TestHttpHeader... headers) {\n    return queryWithBody(url, body, \"application/json\", headers);\n  }\n\n  public WireMockResponse queryWithMultiparts(\n      String url, Collection<MultipartBody> parts, TestHttpHeader... headers) {\n    MultipartEntityBuilder builder = MultipartEntityBuilder.create();\n\n    if (parts != null) {\n      for (MultipartBody part : parts) {\n        builder.addPart(part.getFilename(), part);\n      }\n    }\n\n    HttpEntity entity = builder.build();\n    HttpUriRequest httpQuery =\n        new HttpUriRequestBase(QUERY.toString(), URI.create(mockServiceUrlFor(url)));\n    httpQuery.setEntity(entity);\n    return executeMethodAndConvertExceptions(httpQuery, headers);\n  }\n\n  public WireMockResponse postWithBody(\n      String url, String body, String bodyMimeType, TestHttpHeader... headers) {\n    return execute(RequestMethod.POST, url, body, bodyMimeType, null, headers);\n  }\n\n  public WireMockResponse postWithBody(\n      String url,\n      String body,\n      String bodyMimeType,\n      String bodyEncoding,\n      TestHttpHeader... headers) {\n    return execute(RequestMethod.POST, url, body, bodyMimeType, bodyEncoding, headers);\n  }\n\n  public WireMockResponse postWithMultiparts(\n      String url, Collection<MultipartBody> parts, TestHttpHeader... headers) {\n    MultipartEntityBuilder builder = MultipartEntityBuilder.create();\n\n    if (parts != null) {\n      for (MultipartBody part : parts) {\n        builder.addPart(part.getFilename(), part);\n      }\n    }\n\n    return post(url, builder.build(), headers);\n  }\n\n  @SuppressWarnings(\"UnusedReturnValue\")\n  public WireMockResponse postWithChunkedBody(String url, byte[] body) {\n    return post(url, new InputStreamEntity(new ByteArrayInputStream(body), -1, DEFAULT_BINARY));\n  }\n\n  // TODO break dependency on `HttpEntity` so we are decoupled from Apache HTTP Client in the API\n  public WireMockResponse post(String url, HttpEntity entity, TestHttpHeader... headers) {\n    HttpPost httpPost = new HttpPost(mockServiceUrlFor(url));\n    httpPost.setEntity(entity);\n    return executeMethodAndConvertExceptions(httpPost, headers);\n  }\n\n  public WireMockResponse postJson(String url, String body, TestHttpHeader... headers) {\n    return postWithBody(url, body, headers);\n  }\n\n  public WireMockResponse putJson(String url, String body, TestHttpHeader... headers) {\n    return putWithBody(url, body, MimeType.JSON.toString(), headers);\n  }\n\n  public WireMockResponse postXml(String url, String body, TestHttpHeader... headers) {\n    return execute(POST, url, body, \"application/xml\", null, headers);\n  }\n\n  @SuppressWarnings(\"UnusedReturnValue\")\n  public WireMockResponse patchWithBody(\n      String url, String body, String bodyMimeType, String bodyEncoding) {\n    return execute(PATCH, url, body, bodyMimeType, bodyEncoding);\n  }\n\n  public WireMockResponse delete(String url) {\n    return execute(DELETE, url, null, null, null);\n  }\n\n  public WireMockResponse deleteWithBody(\n      String url, String body, String contentType, TestHttpHeader... headers) {\n    return execute(DELETE, url, body, contentType, null, headers);\n  }\n\n  public WireMockResponse options(String url, TestHttpHeader... headers) {\n    return execute(OPTIONS, url, null, null, null, headers);\n  }\n\n  public void addResponse(String responseSpecJson) {\n    addResponse(responseSpecJson, \"UTF-8\");\n  }\n\n  public void addResponse(String responseSpecJson, String charset) {\n    int status =\n        postWithBody(\"/__admin/mappings\", responseSpecJson, MimeType.JSON.toString(), charset)\n            .statusCode();\n    if (status != HTTP_CREATED) {\n      throw new RuntimeException(\"Returned status code was \" + status);\n    }\n  }\n\n  public void editMapping(String mappingSpecJson) {\n    StubMapping stubMapping = Json.read(mappingSpecJson, StubMapping.class);\n    WireMockResponse wireMockResponse =\n        putJson(\"/__admin/mappings/\" + stubMapping.getId(), mappingSpecJson);\n    int status = wireMockResponse.statusCode();\n    if (status != HTTP_OK) {\n      throw new RuntimeException(\"Returned status code was \" + status);\n    }\n  }\n\n  public void resetDefaultMappings() {\n    int status = post(\"/__admin/mappings/reset\").statusCode();\n    if (status != HTTP_OK) {\n      throw new RuntimeException(\"Returned status code was \" + status);\n    }\n  }\n\n  public String snapshot(String snapshotSpecJson) {\n    WireMockResponse response = postJson(LOCAL_WIREMOCK_SNAPSHOT_PATH, snapshotSpecJson);\n    if (response.statusCode() != HTTP_OK) {\n      throw new RuntimeException(\"Returned status code was \" + response.statusCode());\n    }\n    return response.content();\n  }\n\n  private WireMockResponse execute(\n      RequestMethod method,\n      String url,\n      String body,\n      String contentType,\n      String charset,\n      TestHttpHeader... headers) {\n    return execute(method.getName(), url, body, contentType, charset, headers);\n  }\n\n  private WireMockResponse execute(\n      String method,\n      String url,\n      String body,\n      String contentType,\n      String charset,\n      TestHttpHeader... headers) {\n    String actualUrl = URI.create(url).isAbsolute() ? url : mockServiceUrlFor(url);\n    ClassicHttpRequest httpRequest = new HttpUriRequestBase(method, URI.create(actualUrl));\n    if (body != null) {\n      ContentType type =\n          contentType != null ? ContentType.create(contentType) : ContentType.APPLICATION_JSON;\n      Charset charsetEnc = charset == null ? UTF_8 : Charset.forName(charset);\n      StringEntity entity = new StringEntity(body, type.withCharset(charsetEnc));\n      httpRequest.setEntity(entity);\n    }\n    return executeMethodAndConvertExceptions(httpRequest, headers);\n  }\n\n  private WireMockResponse executeMethodAndConvertExceptions(\n      ClassicHttpRequest httpRequest, TestHttpHeader... headers) {\n    for (TestHttpHeader header : headers) {\n      httpRequest.addHeader(header.getName(), header.getValue());\n    }\n    try (CloseableHttpResponse httpResponse = client.execute(httpRequest)) {\n      return new WireMockResponse(httpResponse);\n    } catch (IOException ioe) {\n      return throwUnchecked(ioe, null);\n    }\n  }\n\n  public WireMockResponse getWithPreemptiveCredentials(\n      String url, int port, String username, String password) {\n\n    BasicScheme basicAuth = new BasicScheme();\n    basicAuth.initPreemptive(new UsernamePasswordCredentials(username, password.toCharArray()));\n\n    HttpClientContext localContext = HttpClientContext.create();\n    HttpHost target = new HttpHost(\"localhost\", port);\n    localContext.resetAuthExchange(target, basicAuth);\n\n    HttpGet httpget = new HttpGet(url);\n    try (CloseableHttpResponse response = client.execute(target, httpget, localContext)) {\n      return new WireMockResponse(response);\n    } catch (IOException e) {\n      return throwUnchecked(e, null);\n    }\n  }\n\n  public WireMockResponse request(final String methodName, String url, TestHttpHeader... headers) {\n    return execute(methodName, url, null, null, null, headers);\n  }\n\n  public WireMockResponse request(\n      final String methodName, String url, String body, TestHttpHeader... headers) {\n    return execute(methodName, url, body, null, null, headers);\n  }\n\n  private static CloseableHttpClient httpClient() {\n    return HttpClientBuilder.create()\n        .setUserAgent(\"WireMock Test Client\")\n        .disableAuthCaching()\n        .disableAutomaticRetries()\n        .disableCookieManagement()\n        .disableRedirectHandling()\n        .disableContentCompression()\n        .setConnectionManager(\n            PoolingHttpClientConnectionManagerBuilder.create()\n                .setMaxConnPerRoute(1000)\n                .setMaxConnTotal(1000)\n                .setConnectionFactory(\n                    new ManagedHttpClientConnectionFactory(\n                        null, CharCodingConfig.custom().setCharset(UTF_8).build(), null))\n                .build())\n        .build();\n  }\n\n  private static SSLContext buildTrustWireMockDefaultCertificateSSLContext() {\n    try {\n      return SSLContexts.custom()\n          .loadTrustMaterial(\n              null,\n              (chain, authType) ->\n                  chain[0].getSubjectDN().getName().startsWith(\"CN=Tom Akehurst\")\n                      || chain[0]\n                          .getSubjectDN()\n                          .getName()\n                          .equals(\"CN=WireMock Local Self Signed Root Certificate\")\n                      || chain.length == 2\n                          && chain[1]\n                              .getSubjectDN()\n                              .getName()\n                              .equals(\"CN=WireMock Local Self Signed Root Certificate\"))\n          .build();\n    } catch (Exception e) {\n      return throwUnchecked(e, SSLContext.class);\n    }\n  }\n}\n"
  },
  {
    "path": "test-extension/build.gradle",
    "content": "plugins {\n  id 'java-library'\n}\n\ngroup 'org.wiremock.example'\n\nrepositories {\n  mavenCentral()\n}\n\ndependencies {\n  api project(':wiremock-core')\n}\n"
  },
  {
    "path": "test-extension/src/main/java/org/wiremock/FactoryLoaderTestExtension.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage org.wiremock;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformerV2;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class FactoryLoaderTestExtension implements ResponseDefinitionTransformerV2 {\n\n  private final Admin admin;\n\n  public FactoryLoaderTestExtension(Admin admin) {\n    this.admin = admin;\n  }\n\n  @Override\n  public String getName() {\n    return \"loader-test\";\n  }\n\n  @Override\n  public boolean applyGlobally() {\n    return false;\n  }\n\n  @Override\n  public ResponseDefinition transform(ServeEvent serveEvent) {\n    final int requestCount = admin.getServeEvents().getServeEvents().size();\n    return ResponseDefinitionBuilder.responseDefinition()\n        .withStatus(200)\n        .withBody(\"Request count \" + requestCount)\n        .build();\n  }\n}\n"
  },
  {
    "path": "test-extension/src/main/java/org/wiremock/InstanceLoaderTestExtension.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage org.wiremock;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformerV2;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class InstanceLoaderTestExtension implements ResponseDefinitionTransformerV2 {\n\n  @Override\n  public String getName() {\n    return \"instance-loader-test\";\n  }\n\n  @Override\n  public boolean applyGlobally() {\n    return false;\n  }\n\n  @Override\n  public ResponseDefinition transform(ServeEvent serveEvent) {\n    return ResponseDefinitionBuilder.responseDefinition()\n        .withStatus(200)\n        .withBody(\"Expected stuff\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "test-extension/src/main/java/org/wiremock/LoaderTestExtensionFactory.java",
    "content": "/*\n * Copyright (C) 2023 Thomas Akehurst\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 */\npackage org.wiremock;\n\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.extension.ExtensionFactory;\nimport com.github.tomakehurst.wiremock.extension.WireMockServices;\nimport java.util.List;\n\npublic class LoaderTestExtensionFactory implements ExtensionFactory {\n\n  @Override\n  public List<Extension> create(WireMockServices services) {\n    return List.of(new FactoryLoaderTestExtension(services.getAdmin()));\n  }\n}\n"
  },
  {
    "path": "test-extension/src/main/resources/META-INF/services/com.github.tomakehurst.wiremock.extension.Extension",
    "content": "org.wiremock.InstanceLoaderTestExtension"
  },
  {
    "path": "test-extension/src/main/resources/META-INF/services/com.github.tomakehurst.wiremock.extension.ExtensionFactory",
    "content": "org.wiremock.LoaderTestExtensionFactory"
  },
  {
    "path": "testlogging/pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>testlogging</groupId>\n    <artifactId>testlogging</artifactId>\n    <version>1.0-SNAPSHOT</version>\n\n  <properties>\n    <slf4jversion>1.7.1</slf4jversion>\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>\n    <project.resources.sourceEncoding>UTF-8</project.resources.sourceEncoding>\n  </properties>\n\n  <build>\n    <plugins>\n      <plugin>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <version>3.8.1</version>\n        <configuration>\n          <source>1.8</source>\n          <target>1.8</target>\n        </configuration>\n      </plugin>\n    </plugins>\n  </build>\n\n  <dependencies>\n    <!-- COMPILE -->\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>slf4j-api</artifactId>\n      <version>${slf4jversion}</version>\n      <scope>compile</scope>\n    </dependency>\n\n    <!-- TEST -->\n    <dependency>\n      <groupId>junit</groupId>\n      <artifactId>junit</artifactId>\n      <version>4.13.1</version>\n      <scope>test</scope>\n    </dependency>\n    <dependency>\n      <groupId>com.github.tomakehurst</groupId>\n      <artifactId>wiremock-jre8-standalone</artifactId>\n      <version>2.35.1</version>\n      <scope>test</scope>\n    </dependency>\n    <dependency>\n      <groupId>ch.qos.logback</groupId>\n      <artifactId>logback-classic</artifactId>\n      <version>1.2.13</version>\n      <scope>test</scope>\n    </dependency>\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>jcl-over-slf4j</artifactId>\n      <version>${slf4jversion}</version>\n      <scope>test</scope>\n    </dependency>\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>jul-to-slf4j</artifactId>\n      <version>${slf4jversion}</version>\n      <scope>test</scope>\n    </dependency>\n    <dependency>\n      <groupId>uk.org.lidalia</groupId>\n      <artifactId>jul-to-slf4j-config</artifactId>\n      <version>1.0.0</version>\n      <scope>test</scope>\n    </dependency>\n    <dependency>\n      <groupId>org.slf4j</groupId>\n      <artifactId>log4j-over-slf4j</artifactId>\n      <version>${slf4jversion}</version>\n      <scope>test</scope>\n    </dependency>\n    <dependency>\n      <groupId>commons-io</groupId>\n      <artifactId>commons-io</artifactId>\n      <version>2.14.0</version>\n    </dependency>\n  </dependencies>\n</project>\n"
  },
  {
    "path": "testlogging/src/test/java/WiremockTest.java",
    "content": "import com.github.tomakehurst.wiremock.junit.WireMockRule;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintStream;\nimport java.net.URL;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static org.hamcrest.CoreMatchers.containsString;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.junit.Assert.assertEquals;\n\npublic class WiremockTest {\n\n    @Rule\n    public WireMockRule wiremock = new WireMockRule();\n\n    StringPrintStream stdOutCapture;\n    PrintStream stdOut;\n\n    @Before\n    public void captureStdOut() {\n        stdOut = System.out;\n        stdOutCapture = new StringPrintStream();\n        System.setOut(stdOutCapture);\n    }\n\n    @After\n    public void revertStdOut() {\n        System.setOut(stdOut);\n    }\n\n\n    @Test\n    public void useWireMock() throws IOException {\n        stubFor(get(urlMatching(\"/blah\")).willReturn(aResponse().withStatus(200).withBody(\"body\")));\n        URL uri = new URL(\"http://localhost:8080/blah\");\n        InputStream content = uri.openConnection().getInputStream();\n\n        StringBuilder sb = new StringBuilder();\n        for (int ch; (ch = inputStream.read()) != -1; ) {\n            sb.append((char) ch);\n        }\n\n        final String retrievedBody = sb.toString();\n        assertEquals(\"body\", retrievedBody);\n        assertThat(stdOutCapture.toString(), containsString(\"LOGBACK INFO  w.o.e.j.s.h.ContextHandler.__admin - RequestHandlerClass from context returned com.github.tomakehurst.wiremock.http.AdminRequestHandler\"));\n    }\n\n    private static class StringPrintStream extends PrintStream {\n        public StringPrintStream() {\n            super(new ByteArrayOutputStream());\n        }\n\n        @Override\n        public String toString() {\n            return out.toString();\n        }\n    }\n}\n"
  },
  {
    "path": "testlogging/src/test/resources/logback-test.xml",
    "content": "<configuration>\n  <jmxconfigurator/>\n  <contextlistener class=\"ch.qos.logback.classic.jul.LevelChangePropagator\"/>\n\n  <appender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\">\n    <encoder>\n      <pattern>%d{HH:mm:ss.SSS} [%thread] LOGBACK %-5level %logger{36} - %msg%n</pattern>\n    </encoder>\n  </appender>\n\n  <root level=\"info\">\n    <appender-ref ref=\"STDOUT\" />\n  </root>\n</configuration>\n"
  },
  {
    "path": "ui/package.json",
    "content": "{\n  \"name\": \"wiremock-ui-resources\",\n  \"version\": \"4.0.0-beta.30\",\n  \"description\": \"WireMock UI resources processor\",\n  \"engines\": {\n    \"node\": \">= 0.10.0\"\n  },\n  \"devDependencies\": {\n    \"@redocly/cli\": \"^2.12.7\",\n    \"swagger-ui-dist\": \"^5.17.14\"\n  },\n  \"overrides\": {\n    \"glob\": \"11.0.0\"\n  },\n  \"scripts\": {\n    \"swaggerui\": \"cp -rf node_modules/swagger-ui-dist/ ../src/main/resources/assets/swagger-ui/swagger-ui-dist/\",\n    \"swaggerjson\": \"npx redocly bundle --ext json ../wiremock-core/src/main/resources/swagger/wiremock-admin-api.yaml -o ../wiremock-core/src/main/resources/swagger/wiremock-admin-api.json\",\n    \"swagger\": \"npm run swaggerui && npm run swaggerjson\"\n  }\n}\n"
  },
  {
    "path": "wiremock-core/build.gradle.kts",
    "content": "plugins {\n    id(\"wiremock.common-conventions\")\n}\n\napply(from = \"buildSchema.gradle\")\n\ndependencies {\n    api(libs.commons.fileupload)\n    api(libs.guava) {\n        exclude(group = \"com.google.code.findbugs\", module = \"jsr305\")\n    }\n    api(libs.handlebars) {\n        exclude(group = \"org.mozilla\", module = \"rhino\")\n    }\n\n    api(platform(libs.jackson.bom))\n    api(libs.jackson.annotations)\n    api(libs.jackson.core)\n    api(libs.jackson.databind)\n\n    api(libs.json.schema.validator)\n    api(libs.json.unit.core)\n\n    api(libs.xmlunit.core)\n    api(project(\":wiremock-url:wiremock-url\"))\n\n    api(libs.jspecify)\n\n    implementation(libs.apache.http5.client)\n    implementation(libs.handlebars.helpers) {\n        exclude(group = \"org.mozilla\", module = \"rhino\")\n        exclude(group = \"org.apache.commons\", module = \"commons-lang3\")\n    }\n    implementation(libs.jackson.datatype.jsr310)\n    implementation(project(\":wiremock-url:wiremock-url-jackson2\"))\n    implementation(libs.json.path) {\n        exclude(group = \"org.ow2.asm\", module = \"asm\")\n    }\n    implementation(libs.slf4j.api)\n    implementation(libs.xmlunit.legacy) {\n        exclude(group = \"junit\", module = \"junit\")\n    }\n    implementation(libs.xmlunit.placeholders)\n\n    modules {\n        module(\"org.apache.logging.log4j:log4j-core\") {\n            replacedBy(\"org.apache.logging.log4j:log4j-to-slf4j\")\n        }\n        module(\"commons-logging:commons-logging\") {\n            replacedBy(\"org.slf4j:jcl-over-slf4j\")\n        }\n        module(\"log4j:log4j\") {\n            replacedBy(\"org.slf4j:log4j-over-slf4j\")\n        }\n        module(\"org.hamcrest:hamcrest-core\") {\n            replacedBy(\"org.hamcrest:hamcrest\")\n        }\n        module(\"org.hamcrest:hamcrest-library\") {\n            replacedBy(\"org.hamcrest:hamcrest\")\n        }\n    }\n\n    constraints {\n        implementation(libs.json.smart)\n        constraints {\n            implementation(\"org.apache.commons:commons-lang3:3.20.0\") {\n                because(\n                    \"\"\"\n                    ✗ Uncontrolled Recursion [https://www.cve.org/CVERecord?id=CVE-2025-48924] in org.apache.commons:commons-lang3@3.12.0\n                    This issue was fixed in versions: 3.18.0\n                    \"\"\".trimIndent()\n                )\n            }\n        }\n    }\n}\n\ntasks.jar {\n    archiveBaseName.set(\"wiremock-core\")\n}\n\npublishing {\n    publications {\n        create<MavenPublication>(\"mavenJava\") {\n            artifactId = tasks.jar.get().archiveBaseName.get()\n            from(components[\"java\"])\n\n            pom {\n                name = \"WireMock Core\"\n                description = \"The core engine of WireMock\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "wiremock-core/buildSchema.gradle",
    "content": "import com.fasterxml.jackson.databind.JsonNode\nimport com.fasterxml.jackson.databind.ObjectMapper\nimport com.fasterxml.jackson.databind.node.ArrayNode\nimport com.fasterxml.jackson.databind.node.ObjectNode\nimport com.fasterxml.jackson.dataformat.yaml.YAMLFactory\n\nbuildscript {\n  repositories {\n    mavenCentral()\n  }\n  dependencies {\n    classpath \"com.fasterxml.jackson.core:jackson-core:2.18.3\"\n    classpath \"com.fasterxml.jackson.core:jackson-databind:2.18.3\"\n    classpath \"com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.3\"\n  }\n}\n\ndef buildStubMappingSchema = tasks.register(\"buildStubMappingSchema\") {\n  group = \"build\"\n  outputs.dir(temporaryDir)\n  inputs.dir('src/main/resources/swagger/schemas')\n\n  doLast {\n    def schemasDir = new File(temporaryDir, \"schemas\")\n    schemasDir.mkdir()\n    new File(schemasDir, \"wiremock-stub-mapping.json\").write(doBuildStubMappingSchema())\n  }\n}\n\ndef buildMessageStubMappingSchema = tasks.register(\"buildMessageStubMappingSchema\") {\n  group = \"build\"\n  outputs.dir(temporaryDir)\n  inputs.dir('src/main/resources/swagger/schemas')\n\n  doLast {\n    def schemasDir = new File(temporaryDir, \"schemas\")\n    schemasDir.mkdir()\n    new File(schemasDir, \"wiremock-message-stub-mapping.json\").write(doBuildMessageStubMappingSchema())\n  }\n}\n\nsourceSets {\n  main {\n    resources {\n      srcDir(buildStubMappingSchema.map { it.temporaryDir })\n      srcDir(buildMessageStubMappingSchema.map { it.temporaryDir })\n    }\n  }\n}\n\n/**\n * Builds a single-file JSON schema by merging the files in {@code src/main/resources/com/intellij/wiremock/schemas}.\n *\n * <pre>\n * {\n *   \"title\": \"WireMock stub mapping\",\n *   \"type\": \"object\",\n *   \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n *   \"definitions\" : {\n *     \"absent-pattern\" : {\n *       \"title\" : \"Absent matcher\",\n *       \"type\" : \"object\",\n *       \"properties\" : {\n *         \"absent\" : {\n *           \"type\" : \"boolean\"\n *         }\n *       },\n *       \"required\" : [ \"absent\" ]\n *     },\n *     ...\n *   },\n *   \"oneOf\" : [ {\n *     \"$ref\" : \"#/definitions/stub-mapping\"\n *   }, {\n *     \"$ref\" : \"#/definitions/stub-mappings\"\n *   } ]\n * }\n * </pre>\n */\nprivate String doBuildStubMappingSchema() {\n  def jsonMapper = new ObjectMapper()\n  def document = jsonMapper.createObjectNode()\n  document.put(\"title\", \"WireMock stub mapping\")\n  document.put(\"type\", \"object\")\n\n  // Only draft-07 is supported by schema-store.org so we bump up to this despite strictly being on 04 within our OpenAPI version\n  document.put(\"\\$schema\", \"http://json-schema.org/draft-07/schema#\")\n\n  def yamlMapper = new ObjectMapper(YAMLFactory.builder().build())\n\n  def schemas = new ArrayList<Tuple>()\n  file('src/main/resources/swagger/schemas').listFiles().toList().sort { it.name }.each { file ->\n    def name = file.name - \".yaml\"\n    def schema = readSchema(yamlMapper, file)\n\n    //For non-'date-time-elements', adds a single name-schema pair,\n    // while for date-time-elements file adds a separate name-schema for each schema in that yaml file\n    if (name != \"date-time-elements\") {\n      schemas.add(Tuple.tuple(name, schema))\n    } else {\n      ((ObjectNode) schema).properties().each { prop ->\n        schemas.add(Tuple.tuple(prop.getKey(), prop.getValue()))\n      }\n    }\n  }\n\n  //The content of each referenced schema file is extracted and added under a common property called 'definitions'.\n  def definitions = document.putObject(\"definitions\")\n  schemas.each { keyAndNode -> definitions.putIfAbsent(keyAndNode[0], keyAndNode[1]) }\n\n  def oneOf = document.putArray(\"oneOf\")\n  oneOf.addObject().put(\"\\$ref\", \"#/definitions/stub-mapping\")\n  oneOf.addObject().put(\"\\$ref\", \"#/definitions/stub-mappings\")\n\n  return jsonMapper\n      .writerWithDefaultPrettyPrinter()\n      .writeValueAsString(document)\n}\n\nprivate JsonNode readSchema(ObjectMapper objectMapper, File file) {\n  def node = objectMapper.readTree(file)\n  replaceFileRefs(node)\n  return node\n}\n\n/**\n * Replaces refs as follows:\n * <ul>\n *   <li>{@code \"$ref\": \"content-pattern.yaml\"} -> {@code \"$ref\": \"#/definitions/content-pattern\"}</li>\n *   <li>{@code \"$ref\": \"date-time-elements.yaml#/format\"} -> {@code \"$ref\": \"#/definitions/format\"}</li>\n * </ul>\n */\nprivate def replaceFileRefs(JsonNode node) {\n  if (node instanceof ObjectNode) {\n    def nodeAsObject = (ObjectNode) node\n    final def ref = nodeAsObject[\"\\$ref\"]?.asText()\n    if (ref != null) {\n      if (ref.endsWith(\".yaml\")) {\n        nodeAsObject.put(\"\\$ref\", \"#/definitions/${(ref - \".yaml\")}\")\n      }\n      //date-time-elements.yaml is handled explicitly because it contains multiple standalone schemas\n      else if (ref.startsWith(\"date-time-elements.yaml#/\")) {\n        nodeAsObject.put(\"\\$ref\", \"#/definitions/${removePrefix(ref, \"date-time-elements.yaml#/\")}\")\n      }\n    } else {\n      for (child in nodeAsObject) {\n        replaceFileRefs(child)\n      }\n    }\n  } else if (node instanceof ArrayNode) {\n    def nodeAsArray = (ArrayNode) node\n    for (item in nodeAsArray) {\n      replaceFileRefs(item)\n    }\n  }\n}\n\nprivate static String removePrefix(String input, String prefix) {\n  return input.substring(prefix.length())\n}\n\nprivate String doBuildMessageStubMappingSchema() {\n  def jsonMapper = new ObjectMapper()\n  def document = jsonMapper.createObjectNode()\n  document.put(\"title\", \"WireMock message stub mapping\")\n  document.put(\"type\", \"object\")\n\n  document.put(\"\\$schema\", \"http://json-schema.org/draft-07/schema#\")\n\n  def yamlMapper = new ObjectMapper(YAMLFactory.builder().build())\n\n  def schemas = new ArrayList<Tuple>()\n  file('src/main/resources/swagger/schemas').listFiles().toList().sort { it.name }.each { file ->\n    def name = file.name - \".yaml\"\n    def schema = readSchema(yamlMapper, file)\n\n    if (name != \"date-time-elements\") {\n      schemas.add(Tuple.tuple(name, schema))\n    } else {\n      ((ObjectNode) schema).properties().each { prop ->\n        schemas.add(Tuple.tuple(prop.getKey(), prop.getValue()))\n      }\n    }\n  }\n\n  def definitions = document.putObject(\"definitions\")\n  schemas.each { keyAndNode -> definitions.putIfAbsent(keyAndNode[0], keyAndNode[1]) }\n\n  def oneOf = document.putArray(\"oneOf\")\n  oneOf.addObject().put(\"\\$ref\", \"#/definitions/message-stub-mapping\")\n  oneOf.addObject().put(\"\\$ref\", \"#/definitions/message-stub-mappings\")\n\n  return jsonMapper\n      .writerWithDefaultPrettyPrinter()\n      .writeValueAsString(document)\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/WireMockServer.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkState;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.wiremock.url.Host.LOCALHOST;\n\nimport com.github.tomakehurst.wiremock.admin.model.*;\nimport com.github.tomakehurst.wiremock.client.CountMatchingStrategy;\nimport com.github.tomakehurst.wiremock.client.MappingBuilder;\nimport com.github.tomakehurst.wiremock.client.MessageStubMappingBuilder;\nimport com.github.tomakehurst.wiremock.client.VerificationException;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Container;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockApp;\nimport com.github.tomakehurst.wiremock.extension.StaticExtensionLoader;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.junit.Stubbing;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.recording.RecordSpec;\nimport com.github.tomakehurst.wiremock.recording.RecordSpecBuilder;\nimport com.github.tomakehurst.wiremock.recording.RecordingStatusResult;\nimport com.github.tomakehurst.wiremock.recording.SnapshotRecordResult;\nimport com.github.tomakehurst.wiremock.standalone.MappingsLoader;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.verification.*;\nimport java.time.Duration;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.UUID;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.BaseUrl;\nimport org.wiremock.url.HostAndPort;\nimport org.wiremock.url.Path;\nimport org.wiremock.url.Port;\nimport org.wiremock.url.RelativeUrl;\nimport org.wiremock.url.Scheme;\nimport org.wiremock.url.SchemeRegistry;\n\npublic class WireMockServer implements Container, Stubbing, Admin {\n\n  private final WireMockApp wireMockApp;\n  private final StubRequestHandler stubRequestHandler;\n\n  private final HttpServer httpServer;\n  private final Notifier notifier;\n\n  protected final Options options;\n\n  protected final WireMock client;\n\n  public WireMockServer(Options options) {\n    this.options = options;\n    this.notifier = options.notifier();\n\n    wireMockApp = new WireMockApp(options, this);\n\n    this.stubRequestHandler = wireMockApp.buildStubRequestHandler();\n\n    HttpServerFactory httpServerFactory = getHttpServerFactory();\n\n    httpServer =\n        httpServerFactory.buildHttpServer(\n            options,\n            wireMockApp.buildAdminRequestHandler(),\n            stubRequestHandler,\n            wireMockApp.buildMessageStubRequestHandler());\n\n    notifier.info(\"Using HTTP server impl: \" + httpServer.getClass().getSimpleName());\n\n    client = new WireMock(wireMockApp);\n  }\n\n  private HttpServerFactory getHttpServerFactory() {\n    return new StaticExtensionLoader<>(HttpServerFactory.class)\n        .setSpecificInstance(options.httpServerFactory())\n        .setExtensions(wireMockApp.getExtensions())\n        .load();\n  }\n\n  public WireMockServer(\n      int port,\n      Integer httpsPort,\n      FileSource fileSource,\n      boolean enableBrowserProxying,\n      ProxySettings proxySettings,\n      Notifier notifier) {\n    this(\n        wireMockConfig()\n            .port(port)\n            .httpsPort(httpsPort)\n            .fileSource(fileSource)\n            .enableBrowserProxying(enableBrowserProxying)\n            .proxyVia(proxySettings)\n            .notifier(notifier));\n  }\n\n  public WireMockServer(\n      int port, FileSource fileSource, boolean enableBrowserProxying, ProxySettings proxySettings) {\n    this(\n        wireMockConfig()\n            .port(port)\n            .fileSource(fileSource)\n            .enableBrowserProxying(enableBrowserProxying)\n            .proxyVia(proxySettings));\n  }\n\n  public WireMockServer(int port, FileSource fileSource, boolean enableBrowserProxying) {\n    this(\n        wireMockConfig()\n            .port(port)\n            .fileSource(fileSource)\n            .enableBrowserProxying(enableBrowserProxying));\n  }\n\n  public WireMockServer(int port) {\n    this(wireMockConfig().port(port));\n  }\n\n  public WireMockServer(int port, Integer httpsPort) {\n    this(wireMockConfig().port(port).httpsPort(httpsPort));\n  }\n\n  public WireMockServer() {\n    this(wireMockConfig());\n  }\n\n  public WireMockServer(String filenameTemplate) {\n    this(wireMockConfig().filenameTemplate(filenameTemplate));\n  }\n\n  public void loadMappingsUsing(final MappingsLoader mappingsLoader) {\n    wireMockApp.loadMappingsUsing(mappingsLoader);\n  }\n\n  public void loadMessageMappingsUsing(final MappingsLoader mappingsLoader) {\n    wireMockApp.loadMessageMappingsUsing(mappingsLoader);\n  }\n\n  public void addMockServiceRequestListener(RequestListener listener) {\n    stubRequestHandler.addRequestListener(listener);\n  }\n\n  public void stop() {\n    httpServer.stop();\n  }\n\n  public WireMockServer startServer() {\n    start();\n    return this;\n  }\n\n  public void start() {\n    // Try to ensure this is warmed up on the main thread so that it's inherited by worker threads\n    Json.getObjectMapper();\n    try {\n      httpServer.start();\n    } catch (Exception e) {\n      throw new FatalStartupException(e);\n    }\n  }\n\n  /**\n   * Gracefully shutdown the server.\n   *\n   * <p>This method assumes it is being called as the result of an incoming HTTP request.\n   */\n  @Override\n  public void shutdown() {\n    final WireMockServer server = this;\n    Thread shutdownThread =\n        new Thread(\n            () -> {\n              try {\n                // We have to sleep briefly to finish serving the shutdown request before stopping\n                // the server, as\n                // there's no support in Jetty for shutting down after the current request.\n                // See http://stackoverflow.com/questions/4650713\n                Thread.sleep(100);\n              } catch (InterruptedException e) {\n                throw new RuntimeException(e);\n              }\n              server.stop();\n            });\n    shutdownThread.start();\n  }\n\n  public boolean isHttpEnabled() {\n    return !options.getHttpDisabled();\n  }\n\n  public boolean isHttpsEnabled() {\n    return options.httpsSettings().enabled();\n  }\n\n  public int port() {\n    checkState(\n        isRunning() && !options.getHttpDisabled(),\n        \"Not listening on HTTP port. Either HTTP is not enabled or the WireMock server is stopped.\");\n    return httpServer.port();\n  }\n\n  public int httpsPort() {\n    checkState(\n        isRunning() && options.httpsSettings().enabled(),\n        \"Not listening on HTTPS port. Either HTTPS is not enabled or the WireMock server is stopped.\");\n    return httpServer.httpsPort();\n  }\n\n  public String url(String path) {\n    return resolve(RelativeUrl.parse(path)).toString();\n  }\n\n  public AbsoluteUrl resolve(String pathAndQuery) {\n    return resolve(RelativeUrl.parse(pathAndQuery));\n  }\n\n  public AbsoluteUrl resolve(RelativeUrl pathAndQuery) {\n    return getBaseUrl().resolve(pathAndQuery);\n  }\n\n  public AbsoluteUrl resolve(Path path) {\n    return getBaseUrl().resolve(path);\n  }\n\n  public String baseUrl() {\n    return getBaseUrl().toString();\n  }\n\n  public BaseUrl getBaseUrl() {\n    boolean https = options.httpsSettings().enabled();\n    Scheme scheme = https ? SchemeRegistry.https : SchemeRegistry.http;\n    int port = https ? httpsPort() : port();\n\n    return BaseUrl.of(scheme, HostAndPort.of(LOCALHOST, Port.of(port)));\n  }\n\n  public boolean isRunning() {\n    return httpServer.isRunning();\n  }\n\n  @Override\n  public StubMapping givenThat(MappingBuilder mappingBuilder) {\n    return client.register(mappingBuilder);\n  }\n\n  @Override\n  public StubMapping stubFor(MappingBuilder mappingBuilder) {\n    return givenThat(mappingBuilder);\n  }\n\n  @Override\n  public void editStub(MappingBuilder mappingBuilder) {\n    client.editStubMapping(mappingBuilder);\n  }\n\n  @Override\n  public void removeStub(MappingBuilder mappingBuilder) {\n    client.removeStubMapping(mappingBuilder);\n  }\n\n  @Override\n  public void removeStub(StubMapping stubMapping) {\n    client.removeStubMapping(stubMapping);\n  }\n\n  @Override\n  public void removeStub(UUID id) {\n    client.removeStubMapping(id);\n  }\n\n  @Override\n  public List<StubMapping> getStubMappings() {\n    return client.allStubMappings().getMappings();\n  }\n\n  @Override\n  public StubMapping getSingleStubMapping(UUID id) {\n    return client.getStubMapping(id).getItem();\n  }\n\n  @Override\n  public List<StubMapping> findStubMappingsByMetadata(StringValuePattern pattern) {\n    return client.findAllStubsByMetadata(pattern);\n  }\n\n  @Override\n  public void removeStubMappingsByMetadata(StringValuePattern pattern) {\n    client.removeStubsByMetadataPattern(pattern);\n  }\n\n  @Override\n  public void removeStubMapping(StubMapping stubMapping) {\n    wireMockApp.removeStubMapping(stubMapping);\n  }\n\n  @Override\n  public void removeStubMapping(UUID id) {\n    wireMockApp.removeStubMapping(id);\n  }\n\n  @Override\n  public void verify(RequestPatternBuilder requestPatternBuilder) {\n    client.verifyThat(requestPatternBuilder);\n  }\n\n  @Override\n  public void verify(int count, RequestPatternBuilder requestPatternBuilder) {\n    client.verifyThat(count, requestPatternBuilder);\n  }\n\n  @Override\n  public void verify(\n      CountMatchingStrategy countMatchingStrategy, RequestPatternBuilder requestPatternBuilder) {\n    client.verifyThat(countMatchingStrategy, requestPatternBuilder);\n  }\n\n  @Override\n  public List<LoggedRequest> findAll(RequestPatternBuilder requestPatternBuilder) {\n    return client.find(requestPatternBuilder);\n  }\n\n  @Override\n  public List<ServeEvent> getAllServeEvents() {\n    return client.getServeEvents();\n  }\n\n  @Override\n  public void setGlobalFixedDelay(int milliseconds) {\n    client.setGlobalFixedDelayVariable(milliseconds);\n  }\n\n  @Override\n  public List<LoggedRequest> findAllUnmatchedRequests() {\n    return client.findAllUnmatchedRequests();\n  }\n\n  @Override\n  public List<NearMiss> findNearMissesForAllUnmatchedRequests() {\n    return client.findNearMissesForAllUnmatchedRequests();\n  }\n\n  @Override\n  public List<NearMiss> findAllNearMissesFor(RequestPatternBuilder requestPatternBuilder) {\n    return client.findAllNearMissesFor(requestPatternBuilder);\n  }\n\n  @Override\n  public List<NearMiss> findNearMissesFor(LoggedRequest loggedRequest) {\n    return client.findTopNearMissesFor(loggedRequest);\n  }\n\n  @Override\n  public void addStubMapping(StubMapping stubMapping) {\n    wireMockApp.addStubMapping(stubMapping);\n  }\n\n  @Override\n  public void editStubMapping(StubMapping stubMapping) {\n    wireMockApp.editStubMapping(stubMapping);\n  }\n\n  @Override\n  public ListStubMappingsResult listAllStubMappings() {\n    return wireMockApp.listAllStubMappings();\n  }\n\n  @Override\n  public SingleStubMappingResult getStubMapping(UUID id) {\n    return wireMockApp.getStubMapping(id);\n  }\n\n  @Override\n  public void saveMappings() {\n    wireMockApp.saveMappings();\n  }\n\n  @Override\n  public void resetAll() {\n    wireMockApp.resetAll();\n  }\n\n  @Override\n  public void resetRequests() {\n    wireMockApp.resetRequests();\n  }\n\n  @Override\n  public void resetToDefaultMappings() {\n    wireMockApp.resetToDefaultMappings();\n  }\n\n  @Override\n  public GetServeEventsResult getServeEvents() {\n    return wireMockApp.getServeEvents();\n  }\n\n  @Override\n  public GetServeEventsResult getServeEvents(ServeEventQuery query) {\n    return wireMockApp.getServeEvents(query);\n  }\n\n  @Override\n  public SingleServedStubResult getServedStub(UUID id) {\n    return wireMockApp.getServedStub(id);\n  }\n\n  @Override\n  public void resetScenarios() {\n    wireMockApp.resetScenarios();\n  }\n\n  @Override\n  public void resetMappings() {\n    wireMockApp.resetMappings();\n  }\n\n  @Override\n  public VerificationResult countRequestsMatching(RequestPattern requestPattern) {\n    return wireMockApp.countRequestsMatching(requestPattern);\n  }\n\n  @Override\n  public FindRequestsResult findRequestsMatching(RequestPattern requestPattern) {\n    return wireMockApp.findRequestsMatching(requestPattern);\n  }\n\n  @Override\n  public FindRequestsResult findUnmatchedRequests() {\n    return wireMockApp.findUnmatchedRequests();\n  }\n\n  @Override\n  public void removeServeEvent(UUID eventId) {\n    wireMockApp.removeServeEvent(eventId);\n  }\n\n  @Override\n  public FindServeEventsResult removeServeEventsMatching(RequestPattern requestPattern) {\n    return wireMockApp.removeServeEventsMatching(requestPattern);\n  }\n\n  @Override\n  public FindServeEventsResult removeServeEventsForStubsMatchingMetadata(\n      StringValuePattern metadataPattern) {\n    return wireMockApp.removeServeEventsForStubsMatchingMetadata(metadataPattern);\n  }\n\n  @Override\n  public void updateGlobalSettings(GlobalSettings newSettings) {\n    wireMockApp.updateGlobalSettings(newSettings);\n  }\n\n  @Override\n  public FindNearMissesResult findNearMissesForUnmatchedRequests() {\n    return wireMockApp.findNearMissesForUnmatchedRequests();\n  }\n\n  @Override\n  public GetScenariosResult getAllScenarios() {\n    return wireMockApp.getAllScenarios();\n  }\n\n  @Override\n  public void resetScenario(String name) {\n    wireMockApp.resetScenario(name);\n  }\n\n  @Override\n  public void setScenarioState(String name, String state) {\n    wireMockApp.setScenarioState(name, state);\n  }\n\n  @Override\n  public FindNearMissesResult findTopNearMissesFor(LoggedRequest loggedRequest) {\n    return wireMockApp.findTopNearMissesFor(loggedRequest);\n  }\n\n  @Override\n  public FindNearMissesResult findTopNearMissesFor(RequestPattern requestPattern) {\n    return wireMockApp.findTopNearMissesFor(requestPattern);\n  }\n\n  @Override\n  public void startRecording(String targetBaseUrl) {\n    wireMockApp.startRecording(targetBaseUrl);\n  }\n\n  @Override\n  public void startRecording(RecordSpec spec) {\n    wireMockApp.startRecording(spec);\n  }\n\n  @Override\n  public void startRecording(RecordSpecBuilder recordSpec) {\n    wireMockApp.startRecording(recordSpec);\n  }\n\n  @Override\n  public SnapshotRecordResult stopRecording() {\n    return wireMockApp.stopRecording();\n  }\n\n  @Override\n  public RecordingStatusResult getRecordingStatus() {\n    return wireMockApp.getRecordingStatus();\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord() {\n    return wireMockApp.snapshotRecord();\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord(RecordSpecBuilder spec) {\n    return wireMockApp.snapshotRecord(spec);\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord(RecordSpec spec) {\n    return wireMockApp.snapshotRecord(spec);\n  }\n\n  @Override\n  public Options getOptions() {\n    return options;\n  }\n\n  @Override\n  public void shutdownServer() {\n    shutdown();\n  }\n\n  @Override\n  public ListStubMappingsResult findUnmatchedStubs() {\n    return wireMockApp.findUnmatchedStubs();\n  }\n\n  @Override\n  public ListStubMappingsResult findAllStubsByMetadata(StringValuePattern pattern) {\n    return wireMockApp.findAllStubsByMetadata(pattern);\n  }\n\n  @Override\n  public void removeStubsByMetadata(StringValuePattern pattern) {\n    wireMockApp.removeStubsByMetadata(pattern);\n  }\n\n  @Override\n  public void importStubs(StubImport stubImport) {\n    wireMockApp.importStubs(stubImport);\n  }\n\n  @Override\n  public void removeStubMappings(List<StubMapping> stubMappings) {\n    wireMockApp.removeStubMappings(stubMappings);\n  }\n\n  @Override\n  public GetGlobalSettingsResult getGlobalSettings() {\n    return wireMockApp.getGlobalSettings();\n  }\n\n  public void checkForUnmatchedRequests() {\n    List<LoggedRequest> unmatchedRequests = findAllUnmatchedRequests();\n    if (!unmatchedRequests.isEmpty()) {\n      List<NearMiss> nearMisses = findNearMissesForAllUnmatchedRequests();\n      if (nearMisses.isEmpty()) {\n        throw VerificationException.forUnmatchedRequests(unmatchedRequests);\n      } else {\n        throw VerificationException.forUnmatchedNearMisses(nearMisses);\n      }\n    }\n  }\n\n  public Set<String> getLoadedExtensionNames() {\n    return wireMockApp.getLoadedExtensionNames();\n  }\n\n  @Override\n  public SendChannelMessageResult sendChannelMessage(\n      ChannelType type, RequestPattern requestPattern, MessageDefinition message) {\n    return wireMockApp.sendChannelMessage(type, requestPattern, message);\n  }\n\n  @Override\n  public ListMessageChannelsResult listAllMessageChannels() {\n    return wireMockApp.listAllMessageChannels();\n  }\n\n  @Override\n  public void addMessageStubMapping(MessageStubMapping messageStubMapping) {\n    wireMockApp.addMessageStubMapping(messageStubMapping);\n  }\n\n  @Override\n  public void removeMessageStubMapping(UUID id) {\n    wireMockApp.removeMessageStubMapping(id);\n  }\n\n  @Override\n  public void resetMessageStubMappings() {\n    wireMockApp.resetMessageStubMappings();\n  }\n\n  @Override\n  public ListMessageStubMappingsResult findAllMessageStubsByMetadata(StringValuePattern pattern) {\n    return wireMockApp.findAllMessageStubsByMetadata(pattern);\n  }\n\n  @Override\n  public void removeMessageStubsByMetadata(StringValuePattern pattern) {\n    wireMockApp.removeMessageStubsByMetadata(pattern);\n  }\n\n  @Override\n  public ListMessageStubMappingsResult listAllMessageStubMappings() {\n    return wireMockApp.listAllMessageStubMappings();\n  }\n\n  // Stubbing interface methods for message stubs\n\n  @Override\n  public MessageStubMapping messageStubFor(MessageStubMappingBuilder builder) {\n    return messageStubFor(builder.build());\n  }\n\n  @Override\n  public MessageStubMapping messageStubFor(MessageStubMapping messageStubMapping) {\n    addMessageStubMapping(messageStubMapping);\n    return messageStubMapping;\n  }\n\n  @Override\n  public void removeMessageStub(UUID id) {\n    removeMessageStubMapping(id);\n  }\n\n  @Override\n  public List<MessageStubMapping> getMessageStubMappingsList() {\n    return new ArrayList<>(listAllMessageStubMappings().getMessageMappings());\n  }\n\n  @Override\n  public void resetMessageStubs() {\n    resetMessageStubMappings();\n  }\n\n  // Message journal methods from Admin interface\n\n  @Override\n  public GetMessageServeEventsResult getMessageServeEvents() {\n    return wireMockApp.getMessageServeEvents();\n  }\n\n  @Override\n  public SingleMessageServeEventResult getMessageServeEvent(UUID id) {\n    return wireMockApp.getMessageServeEvent(id);\n  }\n\n  @Override\n  public int countMessageEventsMatching(MessagePattern pattern) {\n    return wireMockApp.countMessageEventsMatching(pattern);\n  }\n\n  @Override\n  public List<MessageServeEvent> findMessageEventsMatching(MessagePattern pattern) {\n    return wireMockApp.findMessageEventsMatching(pattern);\n  }\n\n  @Override\n  public void removeMessageServeEvent(UUID eventId) {\n    wireMockApp.removeMessageServeEvent(eventId);\n  }\n\n  @Override\n  public FindMessageServeEventsResult removeMessageServeEventsMatching(MessagePattern pattern) {\n    return wireMockApp.removeMessageServeEventsMatching(pattern);\n  }\n\n  @Override\n  public FindMessageServeEventsResult removeMessageServeEventsForStubsMatchingMetadata(\n      StringValuePattern pattern) {\n    return wireMockApp.removeMessageServeEventsForStubsMatchingMetadata(pattern);\n  }\n\n  @Override\n  public void resetMessageJournal() {\n    wireMockApp.resetMessageJournal();\n  }\n\n  @Override\n  public Optional<MessageServeEvent> waitForMessageEvent(MessagePattern pattern, Duration maxWait) {\n    return wireMockApp.waitForMessageEvent(pattern, maxWait);\n  }\n\n  @Override\n  public List<MessageServeEvent> waitForMessageEvents(\n      MessagePattern pattern, int count, Duration maxWait) {\n    return wireMockApp.waitForMessageEvents(pattern, count, maxWait);\n  }\n\n  // Message journal methods from Stubbing interface\n\n  @Override\n  public List<MessageServeEvent> getAllMessageServeEvents() {\n    return client.getMessageServeEvents();\n  }\n\n  @Override\n  public List<MessageServeEvent> findAllMessageEvents(MessagePattern pattern) {\n    return client.findMessageEvents(pattern);\n  }\n\n  @Override\n  public void verifyMessageEvent(MessagePattern pattern) {\n    client.verifyThatMessageEvent(pattern);\n  }\n\n  @Override\n  public void verifyMessageEvent(int expectedCount, MessagePattern pattern) {\n    client.verifyThatMessageEvent(expectedCount, pattern);\n  }\n\n  @Override\n  public void verifyMessageEvent(CountMatchingStrategy expectedCount, MessagePattern pattern) {\n    client.verifyThatMessageEvent(expectedCount, pattern);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/AdminRoutes.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport static com.github.tomakehurst.wiremock.admin.RequestSpec.requestSpec;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.*;\n\nimport com.github.tomakehurst.wiremock.admin.tasks.*;\nimport com.github.tomakehurst.wiremock.extension.AdminApiExtension;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.google.common.collect.ImmutableBiMap;\nimport java.util.Collections;\nimport java.util.Map.Entry;\nimport org.wiremock.url.Path;\n\npublic class AdminRoutes {\n\n  private final ImmutableBiMap<RequestSpec, AdminTask> routes;\n  private final Iterable<AdminApiExtension> apiExtensions;\n  private final Stores stores;\n\n  public static AdminRoutes forClient() {\n    return new AdminRoutes(Collections.emptyList(), null);\n  }\n\n  public static AdminRoutes forServer(Iterable<AdminApiExtension> apiExtensions, Stores stores) {\n    return new AdminRoutes(apiExtensions, stores);\n  }\n\n  protected AdminRoutes(Iterable<AdminApiExtension> apiExtensions, Stores stores) {\n    this.apiExtensions = apiExtensions;\n    this.stores = stores;\n    RouteBuilder routeBuilder = new RouteBuilder();\n    initDefaultRoutes(routeBuilder);\n    initAdditionalRoutes(routeBuilder);\n    routes = routeBuilder.build();\n  }\n\n  private void initDefaultRoutes(Router router) {\n    router.add(GET, \"/\", new RootTask());\n    router.add(GET, \"\", new RootRedirectTask());\n    router.add(POST, \"/reset\", new ResetTask());\n\n    router.add(GET, \"/mappings\", new GetAllStubMappingsTask());\n    router.add(POST, \"/mappings\", new CreateStubMappingTask());\n    router.add(DELETE, \"/mappings\", new ResetStubMappingsTask());\n\n    // Deprecated but kept so that 2.x client will still be compatible\n    router.add(POST, \"/mappings/edit\", new OldEditStubMappingTask());\n\n    router.add(POST, \"/mappings/save\", new SaveMappingsTask());\n    router.add(POST, \"/mappings/reset\", new ResetToDefaultMappingsTask());\n    router.add(GET, \"/mappings/unmatched\", new GetUnmatchedStubMappingsTask());\n    router.add(DELETE, \"/mappings/unmatched\", new RemoveUnmatchedStubMappingsTask());\n    router.add(GET, \"/mappings/{id}\", new GetStubMappingTask());\n    router.add(PUT, \"/mappings/{id}\", new EditStubMappingTask());\n    router.add(POST, \"/mappings/remove\", new RemoveMatchingStubMappingTask());\n    router.add(DELETE, \"/mappings/{id}\", new RemoveStubMappingByIdTask());\n    router.add(POST, \"/mappings/find-by-metadata\", new FindStubMappingsByMetadataTask());\n    router.add(POST, \"/mappings/remove-by-metadata\", new RemoveStubMappingsByMetadataTask());\n    router.add(POST, \"/mappings/import\", new ImportStubMappingsTask());\n\n    router.add(GET, \"/files\", new GetAllStubFilesTask(stores));\n    router.add(PUT, \"/files/**\", new EditStubFileTask(stores));\n    router.add(DELETE, \"/files/**\", new DeleteStubFileTask(stores));\n    router.add(GET, \"/files/**\", new GetStubFileTask(stores));\n\n    router.add(GET, \"/scenarios\", new GetAllScenariosTask());\n    router.add(POST, \"/scenarios/reset\", new ResetScenariosTask());\n    router.add(PUT, \"/scenarios/{name}/state\", new SetScenarioStateTask());\n\n    router.add(GET, \"/requests\", new GetAllRequestsTask());\n    router.add(DELETE, \"/requests\", new ResetRequestsTask());\n    router.add(POST, \"/requests/count\", new GetRequestCountTask());\n    router.add(POST, \"/requests/find\", new FindRequestsTask());\n    router.add(GET, \"/requests/unmatched\", new FindUnmatchedRequestsTask());\n    router.add(GET, \"/requests/unmatched/near-misses\", new FindNearMissesForUnmatchedTask());\n    router.add(GET, \"/requests/{id}\", new GetServedStubTask());\n    router.add(DELETE, \"/requests/{id}\", new RemoveServeEventTask());\n    router.add(POST, \"/requests/remove\", new RemoveServeEventsByRequestPatternTask());\n    router.add(POST, \"/requests/remove-by-metadata\", new RemoveServeEventsByStubMetadataTask());\n\n    router.add(POST, \"/recordings/snapshot\", new SnapshotTask());\n    router.add(POST, \"/recordings/start\", new StartRecordingTask());\n    router.add(POST, \"/recordings/stop\", new StopRecordingTask());\n    router.add(GET, \"/recordings/status\", new GetRecordingStatusTask());\n    router.add(GET, \"/recorder\", new GetRecordingsIndexTask());\n\n    router.add(POST, \"/near-misses/request\", new FindNearMissesForRequestTask());\n    router.add(POST, \"/near-misses/request-pattern\", new FindNearMissesForRequestPatternTask());\n\n    router.add(GET, \"/settings\", new GetGlobalSettingsTask());\n    router.add(PUT, \"/settings\", new GlobalSettingsUpdateTask());\n    router.add(POST, \"/settings\", new GlobalSettingsUpdateTask());\n    router.add(PATCH, \"/settings/extended\", new PatchExtendedSettingsTask());\n\n    router.add(POST, \"/shutdown\", new ShutdownServerTask());\n\n    router.add(GET, \"/docs/swagger\", new GetSwaggerSpecTask());\n    router.add(GET, \"/docs\", new GetDocIndexTask());\n\n    router.add(GET, \"/certs/wiremock-ca.crt\", new GetCaCertTask());\n\n    router.add(GET, \"/health\", new HealthCheckTask());\n\n    router.add(GET, \"/version\", new GetVersionTask());\n\n    router.add(GET, \"/channels\", new GetAllMessageChannelsTask());\n    router.add(POST, \"/channels/send\", new SendChannelMessageTask());\n\n    router.add(GET, \"/messages\", new GetAllMessageEventsTask());\n    router.add(DELETE, \"/messages\", new ResetMessageJournalTask());\n    router.add(POST, \"/messages/count\", new GetMessageEventCountTask());\n    router.add(POST, \"/messages/find\", new FindMessageEventsTask());\n    router.add(POST, \"/messages/remove\", new RemoveMessageServeEventsByPatternTask());\n    router.add(POST, \"/messages/remove-by-metadata\", new RemoveMessageServeEventsByMetadataTask());\n    router.add(POST, \"/messages/wait\", new WaitForMessageEventTask());\n    router.add(POST, \"/messages/wait-for-count\", new WaitForMessageEventsTask());\n    router.add(GET, \"/messages/{id}\", new GetMessageServeEventTask());\n    router.add(DELETE, \"/messages/{id}\", new RemoveMessageServeEventTask());\n\n    router.add(GET, \"/message-mappings\", new GetAllMessageStubMappingsTask());\n    router.add(POST, \"/message-mappings\", new CreateMessageStubMappingTask());\n    router.add(DELETE, \"/message-mappings\", new ResetMessageStubMappingsTask());\n    router.add(DELETE, \"/message-mappings/{id}\", new RemoveMessageStubMappingTask());\n    router.add(\n        POST, \"/message-mappings/find-by-metadata\", new FindMessageStubMappingsByMetadataTask());\n    router.add(\n        POST,\n        \"/message-mappings/remove-by-metadata\",\n        new RemoveMessageStubMappingsByMetadataTask());\n  }\n\n  protected void initAdditionalRoutes(Router routeBuilder) {\n    for (AdminApiExtension apiExtension : apiExtensions) {\n      apiExtension.contributeAdminApiRoutes(routeBuilder);\n    }\n  }\n\n  public AdminTask taskFor(final RequestMethod method, final Path path) {\n    return routes.entrySet().stream()\n        .filter(entry -> entry.getKey().matches(method, path))\n        .map(Entry::getValue)\n        .findFirst()\n        .orElseGet(NotFoundAdminTask::new);\n  }\n\n  public RequestSpec requestSpecForTask(final Class<? extends AdminTask> taskClass) {\n    return routes.entrySet().stream()\n        .filter(input -> input.getValue().getClass().equals(taskClass))\n        .map(Entry::getKey)\n        .findFirst()\n        .orElseThrow(\n            () ->\n                new NotFoundException(\"No route could be found for \" + taskClass.getSimpleName()));\n  }\n\n  protected static class RouteBuilder implements Router {\n    private final ImmutableBiMap.Builder<RequestSpec, AdminTask> builder;\n\n    public RouteBuilder() {\n      builder = ImmutableBiMap.builder();\n    }\n\n    @Override\n    public void add(\n        RequestMethod method, String urlTemplate, Class<? extends AdminTask> taskClass) {\n      try {\n        AdminTask task = taskClass.getDeclaredConstructor().newInstance();\n        add(requestSpec(method, urlTemplate), task);\n      } catch (Exception e) {\n        throwUnchecked(e);\n      }\n    }\n\n    @Override\n    public void add(RequestMethod method, String urlTemplate, AdminTask task) {\n      add(requestSpec(method, urlTemplate), task);\n    }\n\n    public void add(RequestSpec requestSpec, AdminTask task) {\n      builder.put(requestSpec, task);\n    }\n\n    ImmutableBiMap<RequestSpec, AdminTask> build() {\n      return builder.build();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/AdminTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic interface AdminTask {\n  ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/Conversions.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport java.time.ZonedDateTime;\nimport java.time.format.DateTimeParseException;\nimport java.util.Date;\nimport org.wiremock.url.Query;\nimport org.wiremock.url.QueryParamValue;\n\npublic class Conversions {\n\n  public static Integer toInt(Query query, String key) {\n    QueryParamValue parameter = query.getFirst(key);\n    return parameter != null ? Integer.valueOf(parameter.decode()) : null;\n  }\n\n  public static Date toDate(Query query, String key) {\n    QueryParamValue parameter = query.getFirst(key);\n    try {\n      return parameter != null\n          ? Date.from(ZonedDateTime.parse(parameter.decode()).toInstant())\n          : null;\n    } catch (DateTimeParseException e) {\n      throw new InvalidInputException(\n          Errors.validation(key, parameter.decode() + \" is not a valid ISO8601 date\"));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/FindStubMappingsByMetadataTask.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class FindStubMappingsByMetadataTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StringValuePattern pattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StringValuePattern.class);\n    ListStubMappingsResult stubMappings = admin.findAllStubsByMetadata(pattern);\n    return ResponseDefinition.okForJson(stubMappings);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/GetAllScenariosTask.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetAllScenariosTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    return ResponseDefinition.okForJson(admin.getAllScenarios());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/GetGlobalSettingsTask.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetGlobalSettingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    return ResponseDefinition.okForJson(admin.getGlobalSettings());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/GetRecordingStatusTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetRecordingStatusTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    return ResponseDefinition.okForJson(admin.getRecordingStatus());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/ImportStubMappingsTask.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\n\npublic class ImportStubMappingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StubImport stubImport = Json.read(serveEvent.getRequest().getBodyAsString(), StubImport.class);\n    admin.importStubs(stubImport);\n    return ResponseDefinition.ok();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/LimitAndOffsetPaginator.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkParameter;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport java.util.List;\n\npublic class LimitAndOffsetPaginator<T> implements Paginator<T> {\n\n  private final List<T> source;\n  private final Integer limit;\n  private final Integer offset;\n\n  public LimitAndOffsetPaginator(List<T> source, Integer limit, Integer offset) {\n    this.source = source;\n    checkParameter(limit == null || limit >= 0, \"limit must be 0 or greater\");\n    checkParameter(offset == null || offset >= 0, \"offset must be 0 or greater\");\n    this.limit = limit;\n    this.offset = offset;\n  }\n\n  public static <T> LimitAndOffsetPaginator<T> fromRequest(List<T> source, Request request) {\n    var query = request.getPathAndQueryWithoutPrefix().getQueryOrEmpty();\n    return new LimitAndOffsetPaginator<>(\n        source, Conversions.toInt(query, \"limit\"), Conversions.toInt(query, \"offset\"));\n  }\n\n  @Override\n  public List<T> select() {\n    int start = getFirstNonNull(offset, 0);\n    int end = Math.min(source.size(), start + getFirstNonNull(limit, source.size()));\n\n    return source.subList(start, end);\n  }\n\n  @Override\n  public int getTotal() {\n    return source.size();\n  }\n\n  public static <T> LimitAndOffsetPaginator<T> none(List<T> source) {\n    return new LimitAndOffsetPaginator<>(source, null, null);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/LimitAndSinceDatePaginator.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport static com.github.tomakehurst.wiremock.admin.Conversions.toDate;\nimport static com.github.tomakehurst.wiremock.admin.Conversions.toInt;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkParameter;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Date;\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport org.wiremock.url.Query;\n\npublic class LimitAndSinceDatePaginator implements Paginator<ServeEvent> {\n\n  private final List<ServeEvent> source;\n  private final Integer limit;\n  private final Date since;\n\n  public LimitAndSinceDatePaginator(List<ServeEvent> source, Integer limit, Date since) {\n    checkParameter(limit == null || limit >= 0, \"limit must be 0 or greater\");\n    this.source = source;\n    this.limit = limit;\n    this.since = since;\n  }\n\n  public static LimitAndSinceDatePaginator fromRequest(List<ServeEvent> source, Request request) {\n    Query query = request.getPathAndQueryWithoutPrefix().getQueryOrEmpty();\n    return new LimitAndSinceDatePaginator(source, toInt(query, \"limit\"), toDate(query, \"since\"));\n  }\n\n  @Override\n  public List<ServeEvent> select() {\n    return source.stream()\n        .filter(input -> since == null || input.getRequest().getLoggedDate().after(since))\n        .limit(getFirstNonNull(limit, source.size()))\n        .collect(Collectors.toList());\n  }\n\n  @Override\n  public int getTotal() {\n    return source.size();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/NotFoundException.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\npublic class NotFoundException extends RuntimeException {\n  public NotFoundException(String message) {\n    super(message);\n  }\n\n  public NotFoundException(String message, Throwable cause) {\n    super(message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/Paginator.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport java.util.List;\n\npublic interface Paginator<T> {\n\n  List<T> select();\n\n  int getTotal();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/PatchExtendedSettingsTask.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.admin.model.ExtendedSettingsWrapper;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class PatchExtendedSettingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    ExtendedSettingsWrapper extendedSettingsWrapper =\n        Json.read(serveEvent.getRequest().getBodyAsString(), ExtendedSettingsWrapper.class);\n    Parameters newExtended = extendedSettingsWrapper.getExtended();\n\n    GlobalSettings existingSettings = admin.getGlobalSettings().getSettings();\n    Parameters existingExtended = existingSettings.getExtended();\n\n    Parameters extended = existingExtended.merge(newExtended);\n\n    GlobalSettings newGlobalSettings = existingSettings.copy().extended(extended).build();\n\n    admin.updateGlobalSettings(newGlobalSettings);\n\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/RemoveServeEventTask.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.admin.tasks.AbstractSingleServeEventTask;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.UUID;\n\npublic class RemoveServeEventTask extends AbstractSingleServeEventTask {\n\n  @Override\n  protected ResponseDefinition processServeEvent(Admin admin, ServeEvent adminServeEvent, UUID id) {\n    admin.removeServeEvent(id);\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/RemoveServeEventsByRequestPatternTask.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindServeEventsResult;\n\npublic class RemoveServeEventsByRequestPatternTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    RequestPattern requestPattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), RequestPattern.class);\n    FindServeEventsResult findServeEventsResult = admin.removeServeEventsMatching(requestPattern);\n    return ResponseDefinition.okForJson(findServeEventsResult);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/RemoveServeEventsByStubMetadataTask.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindServeEventsResult;\n\npublic class RemoveServeEventsByStubMetadataTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StringValuePattern metadataPattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StringValuePattern.class);\n    FindServeEventsResult findServeEventsResult =\n        admin.removeServeEventsForStubsMatchingMetadata(metadataPattern);\n    return ResponseDefinition.okForJson(findServeEventsResult);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/RemoveStubMappingsByMetadataTask.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class RemoveStubMappingsByMetadataTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StringValuePattern pattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StringValuePattern.class);\n    admin.removeStubsByMetadata(pattern);\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/RequestSpec.java",
    "content": "/*\n * Copyright (C) 2013-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.ANY;\nimport static java.util.Objects.requireNonNull;\n\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.common.url.PathTemplate;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport org.wiremock.url.Path;\n\npublic class RequestSpec {\n\n  private final RequestMethod method;\n  private final PathTemplate uriTemplate;\n\n  public RequestSpec(RequestMethod method, String uriTemplate) {\n    requireNonNull(method);\n    requireNonNull(uriTemplate);\n    this.method = method;\n    this.uriTemplate = new PathTemplate(uriTemplate);\n  }\n\n  public static RequestSpec requestSpec(RequestMethod method, String path) {\n    return new RequestSpec(method, path);\n  }\n\n  public RequestMethod method() {\n    return method;\n  }\n\n  public PathTemplate getUriTemplate() {\n    return uriTemplate;\n  }\n\n  public String path() {\n    return path(PathParams.empty());\n  }\n\n  public String path(PathParams pathParams) {\n    return uriTemplate.render(pathParams);\n  }\n\n  public boolean matches(RequestMethod method, Path path) {\n    return (this.method.equals(ANY) || this.method.equals(method)) && uriTemplate.matches(path);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    RequestSpec that = (RequestSpec) o;\n\n    if (!method.equals(that.method)) return false;\n    return uriTemplate.equals(that.uriTemplate);\n  }\n\n  @Override\n  public int hashCode() {\n    int result = method.hashCode();\n    result = 31 * result + uriTemplate.hashCode();\n    return result;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/Router.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\n\npublic interface Router {\n\n  void add(RequestMethod method, String urlTemplate, Class<? extends AdminTask> task);\n\n  void add(RequestMethod method, String urlTemplate, AdminTask adminTask);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/SetScenarioStateTask.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport com.github.tomakehurst.wiremock.admin.model.ScenarioState;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class SetScenarioStateTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    String name = pathParams.get(\"name\");\n    String body = serveEvent.getRequest().getBodyAsString();\n\n    try {\n      setOrResetScenarioState(admin, name, body);\n    } catch (NotFoundException e) {\n      return ResponseDefinitionBuilder.jsonResponse(Errors.single(404, e.getMessage()), 404);\n    }\n\n    return ResponseDefinition.okEmptyJson();\n  }\n\n  private void setOrResetScenarioState(Admin admin, String name, String body) {\n    if (body != null && !body.isEmpty()) {\n      ScenarioState scenarioState = Json.read(body, ScenarioState.class);\n      admin.setScenarioState(name, scenarioState.getState());\n    } else {\n      admin.resetScenario(name);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/StartRecordingTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.jsonResponse;\n\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.recording.RecordSpec;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class StartRecordingTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    RecordSpec recordSpec = Json.read(serveEvent.getRequest().getBodyAsString(), RecordSpec.class);\n    try {\n      admin.startRecording(recordSpec);\n      return ResponseDefinition.okEmptyJson();\n    } catch (InvalidInputException e) {\n      return jsonResponse(e.getErrors(), 422);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/StopRecordingTask.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.jsonResponse;\nimport static java.net.HttpURLConnection.HTTP_BAD_REQUEST;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.recording.NotRecordingException;\nimport com.github.tomakehurst.wiremock.recording.SnapshotRecordResult;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class StopRecordingTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    try {\n      SnapshotRecordResult result = admin.stopRecording();\n      return jsonResponse(result, HTTP_OK);\n    } catch (NotRecordingException e) {\n      return jsonResponse(Errors.notRecording(), HTTP_BAD_REQUEST);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/ExtendedSettingsWrapper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\n\npublic class ExtendedSettingsWrapper {\n\n  private final Parameters extended;\n\n  public ExtendedSettingsWrapper(@JsonProperty(\"extended\") Parameters extended) {\n    this.extended = extended;\n  }\n\n  public Parameters getExtended() {\n    return extended;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/GetGlobalSettingsResult.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\n\npublic class GetGlobalSettingsResult {\n\n  private final GlobalSettings settings;\n\n  public GetGlobalSettingsResult(@JsonProperty(\"settings\") GlobalSettings settings) {\n    this.settings = settings;\n  }\n\n  public GlobalSettings getSettings() {\n    return settings;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/GetMessageServeEventsResult.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.util.List;\n\npublic class GetMessageServeEventsResult {\n\n  private final List<MessageServeEvent> messageServeEvents;\n  private final boolean messageJournalDisabled;\n\n  @JsonCreator\n  public GetMessageServeEventsResult(\n      @JsonProperty(\"messageServeEvents\") List<MessageServeEvent> messageServeEvents,\n      @JsonProperty(\"messageJournalDisabled\") boolean messageJournalDisabled) {\n    this.messageServeEvents = messageServeEvents;\n    this.messageJournalDisabled = messageJournalDisabled;\n  }\n\n  public static GetMessageServeEventsResult messageJournalEnabled(\n      List<MessageServeEvent> messageServeEvents) {\n    return new GetMessageServeEventsResult(messageServeEvents, false);\n  }\n\n  public static GetMessageServeEventsResult messageJournalDisabled() {\n    return new GetMessageServeEventsResult(List.of(), true);\n  }\n\n  public List<MessageServeEvent> getMessageServeEvents() {\n    return messageServeEvents;\n  }\n\n  public boolean isMessageJournalDisabled() {\n    return messageJournalDisabled;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/GetScenariosResult.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport java.util.List;\n\npublic class GetScenariosResult {\n\n  private final List<Scenario> scenarios;\n\n  @JsonCreator\n  public GetScenariosResult(@JsonProperty(\"scenarios\") List<Scenario> scenarios) {\n    this.scenarios = scenarios;\n  }\n\n  public List<Scenario> getScenarios() {\n    return scenarios;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/GetServeEventsResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.admin.Paginator;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\n\npublic class GetServeEventsResult extends RequestJournalDependentResult<ServeEvent> {\n\n  @JsonCreator\n  public GetServeEventsResult(\n      @JsonProperty(\"requests\") List<ServeEvent> source,\n      @JsonProperty(\"meta\") Meta meta,\n      @JsonProperty(\"requestJournalDisabled\") boolean requestJournalDisabled) {\n    super(source, meta, requestJournalDisabled);\n  }\n\n  public GetServeEventsResult(Paginator<ServeEvent> paginator, boolean requestJournalDisabled) {\n    super(paginator, requestJournalDisabled);\n  }\n\n  public static GetServeEventsResult requestJournalEnabled(Paginator<ServeEvent> paginator) {\n    return new GetServeEventsResult(paginator, false);\n  }\n\n  public static GetServeEventsResult requestJournalDisabled(Paginator<ServeEvent> paginator) {\n    return new GetServeEventsResult(paginator, true);\n  }\n\n  public List<ServeEvent> getRequests() {\n    return getServeEvents();\n  }\n\n  @JsonIgnore\n  public List<ServeEvent> getServeEvents() {\n    return select();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/HealthCheckResult.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.github.tomakehurst.wiremock.core.Version;\nimport java.lang.management.ManagementFactory;\nimport java.time.Instant;\n\npublic class HealthCheckResult {\n  private final String status;\n  private final String message;\n  private final String version;\n  private final long uptimeInSeconds;\n  private final Instant timestamp;\n\n  public HealthCheckResult(String status, String message) {\n    this.status = status;\n    this.message = message;\n    this.version = Version.getCurrentVersion();\n    this.timestamp = Instant.now();\n    this.uptimeInSeconds = ManagementFactory.getRuntimeMXBean().getUptime() / 1000;\n  }\n\n  public String getStatus() {\n    return status;\n  }\n\n  public String getMessage() {\n    return message;\n  }\n\n  public String getVersion() {\n    return version;\n  }\n\n  public Instant getTimestamp() {\n    return timestamp;\n  }\n\n  public long getUptimeInSeconds() {\n    return uptimeInSeconds;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/ListMessageChannelsResult.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.verification.LoggedMessageChannel;\nimport java.util.List;\n\npublic class ListMessageChannelsResult extends PaginatedResult<LoggedMessageChannel> {\n\n  @JsonCreator\n  public ListMessageChannelsResult(\n      @JsonProperty(\"channels\") List<LoggedMessageChannel> channels,\n      @JsonProperty(\"meta\") Meta meta) {\n    super(channels, meta);\n  }\n\n  public ListMessageChannelsResult(List<LoggedMessageChannel> channels) {\n    super(channels, new Meta(channels.size()));\n  }\n\n  public List<LoggedMessageChannel> getChannels() {\n    return select();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/ListMessageStubMappingsResult.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.admin.LimitAndOffsetPaginator;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport java.util.List;\n\npublic class ListMessageStubMappingsResult extends PaginatedResult<MessageStubMapping> {\n\n  @JsonCreator\n  public ListMessageStubMappingsResult(\n      @JsonProperty(\"messageMappings\") List<MessageStubMapping> messageMappings,\n      @JsonProperty(\"meta\") Meta meta) {\n    super(messageMappings, meta);\n  }\n\n  public ListMessageStubMappingsResult(LimitAndOffsetPaginator<MessageStubMapping> paginator) {\n    super(paginator);\n  }\n\n  public List<MessageStubMapping> getMessageMappings() {\n    return select();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/ListStubMappingsResult.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.admin.LimitAndOffsetPaginator;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\n\npublic class ListStubMappingsResult extends PaginatedResult<StubMapping> {\n\n  @JsonCreator\n  public ListStubMappingsResult(\n      @JsonProperty(\"mappings\") List<StubMapping> mappings, @JsonProperty(\"meta\") Meta meta) {\n    super(mappings, meta);\n  }\n\n  public ListStubMappingsResult(LimitAndOffsetPaginator<StubMapping> paginator) {\n    super(paginator);\n  }\n\n  public List<StubMapping> getMappings() {\n    return select();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/PaginatedResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.admin.Paginator;\nimport java.util.List;\n\n@JsonInclude(NON_NULL)\npublic abstract class PaginatedResult<T> {\n\n  private final List<T> selection;\n  private final Meta meta;\n\n  protected PaginatedResult(Paginator<T> paginator) {\n    selection = paginator.select();\n    meta = new Meta(paginator.getTotal());\n  }\n\n  protected PaginatedResult(List<T> source, Meta meta) {\n    this.selection = source;\n    this.meta = meta;\n  }\n\n  public Meta getMeta() {\n    return meta;\n  }\n\n  protected List<T> select() {\n    return selection;\n  }\n\n  public static class Meta {\n\n    public final int total;\n\n    @JsonCreator\n    public Meta(@JsonProperty(\"total\") int total) {\n      this.total = total;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/RequestJournalDependentResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.github.tomakehurst.wiremock.admin.Paginator;\nimport java.util.List;\n\npublic abstract class RequestJournalDependentResult<T> extends PaginatedResult<T> {\n\n  private final boolean requestJournalDisabled;\n\n  protected RequestJournalDependentResult(Paginator<T> paginator, boolean requestJournalDisabled) {\n    super(paginator);\n    this.requestJournalDisabled = requestJournalDisabled;\n  }\n\n  protected RequestJournalDependentResult(\n      List<T> source, Meta meta, boolean requestJournalDisabled) {\n    super(source, meta);\n    this.requestJournalDisabled = requestJournalDisabled;\n  }\n\n  public boolean isRequestJournalDisabled() {\n    return requestJournalDisabled;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/ScenarioState.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class ScenarioState {\n\n  private final String state;\n\n  public ScenarioState(@JsonProperty(\"state\") String state) {\n    this.state = state;\n  }\n\n  public String getState() {\n    return state;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/SendChannelMessageRequest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\n\n/** Request model for sending a message to channels of a specific type. */\npublic class SendChannelMessageRequest {\n\n  private final ChannelType type;\n  private final RequestPattern initiatingRequestPattern;\n  private final MessageDefinition message;\n\n  @JsonCreator\n  public SendChannelMessageRequest(\n      @JsonProperty(\"type\") ChannelType type,\n      @JsonProperty(\"initiatingRequest\") RequestPattern initiatingRequestPattern,\n      @JsonProperty(\"message\") MessageDefinition message) {\n    this.type = type;\n    this.initiatingRequestPattern = initiatingRequestPattern;\n    this.message = message;\n  }\n\n  public ChannelType getType() {\n    return type;\n  }\n\n  public RequestPattern getInitiatingRequest() {\n    return initiatingRequestPattern;\n  }\n\n  public MessageDefinition getMessage() {\n    return message;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/SendChannelMessageResult.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.verification.LoggedMessageChannel;\nimport java.util.Collections;\nimport java.util.List;\n\n/** Result model for sending a message to channels. */\npublic class SendChannelMessageResult {\n\n  private final List<LoggedMessageChannel> channels;\n\n  @JsonCreator\n  public SendChannelMessageResult(@JsonProperty(\"channels\") List<LoggedMessageChannel> channels) {\n    this.channels = channels != null ? channels : Collections.emptyList();\n  }\n\n  public List<LoggedMessageChannel> getChannels() {\n    return channels;\n  }\n\n  public int getChannelsMessaged() {\n    return channels.size();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/ServeEventQuery.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport static java.util.stream.Collectors.toList;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.InvalidParameterException;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.UUID;\nimport java.util.function.Predicate;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.Query;\nimport org.wiremock.url.QueryParamKey;\nimport org.wiremock.url.QueryParamValue;\n\npublic class ServeEventQuery {\n\n  public static final ServeEventQuery ALL = new ServeEventQuery(false, null);\n  public static final ServeEventQuery ALL_UNMATCHED = new ServeEventQuery(true, null);\n\n  public static ServeEventQuery forStubMapping(StubMapping stubMapping) {\n    return new ServeEventQuery(false, stubMapping.getId());\n  }\n\n  public static ServeEventQuery forStubMapping(UUID stubMappingId) {\n    return new ServeEventQuery(false, stubMappingId);\n  }\n\n  private static final QueryParamKey UNMATCHED_KEY = QueryParamKey.encode(\"unmatched\");\n  private static final QueryParamValue TRUE_PARAM_VALUE = QueryParamValue.encode(\"true\");\n  private static final QueryParamKey MATCHING_STUB_KEY = QueryParamKey.encode(\"matchingStub\");\n\n  public static ServeEventQuery fromRequest(Request request) {\n    Query query = request.getPathAndQueryWithoutPrefix().getQueryOrEmpty();\n    final List<@Nullable QueryParamValue> unmatchedParameter = query.get(UNMATCHED_KEY);\n    boolean unmatched = unmatchedParameter.contains(TRUE_PARAM_VALUE);\n\n    UUID stubMappingId = toUuid(query, MATCHING_STUB_KEY);\n\n    return new ServeEventQuery(unmatched, stubMappingId);\n  }\n\n  private static UUID toUuid(Query query, QueryParamKey key) {\n    final QueryParamValue parameter = query.getFirst(key);\n    try {\n      return parameter != null ? UUID.fromString(parameter.decode()) : null;\n    } catch (IllegalArgumentException e) {\n      throw new InvalidParameterException(\n          Errors.single(\n              15, \"Query parameter \" + key + \" value '\" + parameter + \"' is not a valid UUID\"));\n    }\n  }\n\n  private final boolean onlyUnmatched;\n  private final UUID stubMappingId;\n\n  public ServeEventQuery(\n      @JsonProperty(\"onlyUnmatched\") boolean onlyUnmatched,\n      @JsonProperty(\"stubMappingId\") UUID stubMappingId) {\n    this.onlyUnmatched = onlyUnmatched;\n    this.stubMappingId = stubMappingId;\n  }\n\n  public boolean isOnlyUnmatched() {\n    return onlyUnmatched;\n  }\n\n  public UUID getStubMappingId() {\n    return stubMappingId;\n  }\n\n  public List<ServeEvent> filter(List<ServeEvent> events) {\n    if (!onlyUnmatched && stubMappingId == null) {\n      return events;\n    }\n\n    final Predicate<ServeEvent> matchPredicate =\n        onlyUnmatched ? serveEvent -> !serveEvent.getWasMatched() : serveEvent -> true;\n\n    final Predicate<ServeEvent> stubPredicate =\n        stubMappingId != null\n            ? serveEvent ->\n                serveEvent.getWasMatched()\n                    && serveEvent.getStubMapping().getId().equals(stubMappingId)\n            : serveEvent -> true;\n\n    return events.stream().filter(matchPredicate).filter(stubPredicate).collect(toList());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/SingleItemResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonValue;\n\n@JsonInclude(NON_NULL)\npublic class SingleItemResult<T> {\n\n  private final T item;\n\n  public SingleItemResult(T item) {\n    this.item = item;\n  }\n\n  @JsonValue\n  public T getItem() {\n    return item;\n  }\n\n  @JsonIgnore\n  public boolean isPresent() {\n    return item != null;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/SingleMessageServeEventResult.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.util.Optional;\n\npublic class SingleMessageServeEventResult extends SingleItemResult<MessageServeEvent> {\n\n  @JsonCreator\n  public SingleMessageServeEventResult(MessageServeEvent item) {\n    super(item);\n  }\n\n  public static SingleMessageServeEventResult fromOptional(Optional<MessageServeEvent> event) {\n    return new SingleMessageServeEventResult(event.orElse(null));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/SingleServedStubResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Optional;\n\npublic class SingleServedStubResult extends SingleItemResult<ServeEvent> {\n\n  @JsonCreator\n  public SingleServedStubResult(ServeEvent item) {\n    super(item);\n  }\n\n  public static SingleServedStubResult fromOptional(Optional<ServeEvent> servedStub) {\n    return new SingleServedStubResult(servedStub.orElse(null));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/SingleStubMappingResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.Optional;\n\npublic class SingleStubMappingResult extends SingleItemResult<StubMapping> {\n\n  @JsonCreator\n  public SingleStubMappingResult(StubMapping item) {\n    super(item);\n  }\n\n  public static SingleStubMappingResult fromOptional(Optional<StubMapping> optional) {\n    return new SingleStubMappingResult(optional.orElse(null));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/VersionResult.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\npublic class VersionResult {\n  private final String version;\n\n  public VersionResult(String version) {\n    this.version = version;\n  }\n\n  public String getVersion() {\n    return version;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/model/WaitForMessageEventRequest.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.model;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\n\npublic class WaitForMessageEventRequest {\n\n  private final MessagePattern pattern;\n  private final long timeoutMillis;\n  private final Integer count;\n\n  @JsonCreator\n  public WaitForMessageEventRequest(\n      @JsonProperty(\"pattern\") MessagePattern pattern,\n      @JsonProperty(\"timeoutMillis\") long timeoutMillis,\n      @JsonProperty(\"count\") Integer count) {\n    this.pattern = pattern != null ? pattern : MessagePattern.ANYTHING;\n    this.timeoutMillis = timeoutMillis;\n    this.count = count;\n  }\n\n  public static WaitForMessageEventRequest forSingleEvent(\n      MessagePattern pattern, long timeoutMillis) {\n    return new WaitForMessageEventRequest(pattern, timeoutMillis, null);\n  }\n\n  public static WaitForMessageEventRequest forMultipleEvents(\n      MessagePattern pattern, long timeoutMillis, int count) {\n    return new WaitForMessageEventRequest(pattern, timeoutMillis, count);\n  }\n\n  public MessagePattern getPattern() {\n    return pattern;\n  }\n\n  public long getTimeoutMillis() {\n    return timeoutMillis;\n  }\n\n  public Integer getCount() {\n    return count;\n  }\n\n  @com.fasterxml.jackson.annotation.JsonIgnore\n  public boolean isMultipleEvents() {\n    return count != null && count > 1;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/AbstractGetDocTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_TYPE;\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResource;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.io.IOException;\nimport java.io.InputStream;\n\npublic abstract class AbstractGetDocTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    try (InputStream inputStream =\n        getResource(AbstractGetDocTask.class, getFilePath()).openStream()) {\n      byte[] content = inputStream.readAllBytes();\n      return responseDefinition()\n          .withStatus(200)\n          .withBody(content)\n          .withHeader(CONTENT_TYPE, getMimeType())\n          .build();\n    } catch (IOException e) {\n      return responseDefinition().withStatus(500).build();\n    }\n  }\n\n  protected abstract String getMimeType();\n\n  protected abstract String getFilePath();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/AbstractSingleServeEventTask.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.UUID;\n\npublic abstract class AbstractSingleServeEventTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(\n      Admin admin, ServeEvent adminServeEvent, PathParams pathParams) {\n    String idString = pathParams.get(\"id\");\n    UUID id;\n    try {\n      id = UUID.fromString(idString);\n    } catch (IllegalArgumentException e) {\n      return ResponseDefinition.badRequest(Errors.single(10, idString + \" is not a valid UUID\"));\n    }\n\n    return processServeEvent(admin, adminServeEvent, id);\n  }\n\n  protected abstract ResponseDefinition processServeEvent(\n      Admin admin, ServeEvent adminServeEvent, UUID id);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/AbstractSingleStubTask.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.SingleStubMappingResult;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.UUID;\n\npublic abstract class AbstractSingleStubTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    String idString = pathParams.get(\"id\");\n    UUID id;\n    try {\n      id = UUID.fromString(idString);\n    } catch (IllegalArgumentException e) {\n      return ResponseDefinition.badRequest(Errors.single(10, idString + \" is not a valid UUID\"));\n    }\n\n    final SingleStubMappingResult result = admin.getStubMapping(id);\n    return result.isPresent()\n        ? processStubMapping(admin, serveEvent, result.getItem())\n        : ResponseDefinition.notFound();\n  }\n\n  protected abstract ResponseDefinition processStubMapping(\n      Admin admin, ServeEvent serveEvent, StubMapping stubMapping);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/CreateMessageStubMappingTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static java.net.HttpURLConnection.HTTP_CREATED;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class CreateMessageStubMappingTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    MessageStubMapping newMapping =\n        Json.read(serveEvent.getRequest().getBodyAsString(), MessageStubMapping.class);\n    admin.addMessageStubMapping(newMapping);\n    return ResponseDefinitionBuilder.jsonResponse(newMapping, HTTP_CREATED);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/CreateStubMappingTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static java.net.HttpURLConnection.HTTP_CREATED;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic class CreateStubMappingTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StubMapping newMapping =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StubMapping.class);\n    admin.addStubMapping(newMapping);\n    return ResponseDefinitionBuilder.jsonResponse(newMapping, HTTP_CREATED);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/DeleteStubFileTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class DeleteStubFileTask implements AdminTask {\n\n  private final Stores stores;\n\n  public DeleteStubFileTask(Stores stores) {\n    this.stores = stores;\n  }\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    String filePath = pathParams.get(\"0\");\n    stores.getFilesBlobStore().remove(filePath);\n    return ResponseDefinition.ok();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/EditStubFileTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class EditStubFileTask implements AdminTask {\n\n  private final Stores stores;\n\n  public EditStubFileTask(Stores stores) {\n    this.stores = stores;\n  }\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    String filename = pathParams.get(\"0\");\n    byte[] fileContent = serveEvent.getRequest().getBody();\n\n    stores.getFilesBlobStore().put(filename, fileContent);\n\n    return ResponseDefinition.okForJson(fileContent);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/EditStubMappingTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic class EditStubMappingTask extends AbstractSingleStubTask {\n\n  @Override\n  protected ResponseDefinition processStubMapping(\n      Admin admin, ServeEvent serveEvent, StubMapping stubMapping) {\n    StubMapping newStubMapping =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StubMapping.class)\n            .transform(sm -> sm.setId(stubMapping.getId()));\n    admin.editStubMapping(newStubMapping);\n    return ResponseDefinition.okForJson(newStubMapping);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/FindMessageEventsTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindMessageServeEventsResult;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.util.List;\n\npublic class FindMessageEventsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    MessagePattern pattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), MessagePattern.class);\n    List<MessageServeEvent> events = admin.findMessageEventsMatching(pattern);\n    FindMessageServeEventsResult result = new FindMessageServeEventsResult(events);\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(Json.write(result))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/FindMessageStubMappingsByMetadataTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.ListMessageStubMappingsResult;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class FindMessageStubMappingsByMetadataTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StringValuePattern pattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StringValuePattern.class);\n    ListMessageStubMappingsResult result = admin.findAllMessageStubsByMetadata(pattern);\n    return ResponseDefinition.okForJson(result);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/FindNearMissesForRequestPatternTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindNearMissesResult;\n\npublic class FindNearMissesForRequestPatternTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    RequestPattern requestPattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), RequestPattern.class);\n    FindNearMissesResult nearMissesResult = admin.findTopNearMissesFor(requestPattern);\n    return ResponseDefinition.okForJson(nearMissesResult);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/FindNearMissesForRequestTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindNearMissesResult;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\n\npublic class FindNearMissesForRequestTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    LoggedRequest loggedRequest =\n        Json.read(serveEvent.getRequest().getBodyAsString(), LoggedRequest.class);\n    FindNearMissesResult nearMissesResult = admin.findTopNearMissesFor(loggedRequest);\n    return ResponseDefinition.okForJson(nearMissesResult);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/FindNearMissesForUnmatchedTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindNearMissesResult;\n\npublic class FindNearMissesForUnmatchedTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    FindNearMissesResult nearMissesResult = admin.findNearMissesForUnmatchedRequests();\n    return ResponseDefinition.okForJson(nearMissesResult);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/FindRequestsTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindRequestsResult;\n\npublic class FindRequestsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    RequestPattern requestPattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), RequestPattern.class);\n    FindRequestsResult result = admin.findRequestsMatching(requestPattern);\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(Json.write(result))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/FindUnmatchedRequestsTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindRequestsResult;\n\npublic class FindUnmatchedRequestsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    FindRequestsResult unmatchedRequests = admin.findUnmatchedRequests();\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(Json.write(unmatchedRequests))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetAllMessageChannelsTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.ListMessageChannelsResult;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetAllMessageChannelsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    ListMessageChannelsResult result = admin.listAllMessageChannels();\n    return ResponseDefinition.okForJson(result);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetAllMessageEventsTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.GetMessageServeEventsResult;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetAllMessageEventsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    GetMessageServeEventsResult result = admin.getMessageServeEvents();\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(Json.write(result))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetAllMessageStubMappingsTask.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.LimitAndOffsetPaginator;\nimport com.github.tomakehurst.wiremock.admin.model.ListMessageStubMappingsResult;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetAllMessageStubMappingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    ListMessageStubMappingsResult result =\n        new ListMessageStubMappingsResult(\n            LimitAndOffsetPaginator.fromRequest(\n                admin.listAllMessageStubMappings().getMessageMappings(), serveEvent.getRequest()));\n\n    return ResponseDefinitionBuilder.jsonResponse(result);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetAllRequestsTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.jsonResponse;\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_BAD_REQUEST;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.LimitAndSinceDatePaginator;\nimport com.github.tomakehurst.wiremock.admin.model.GetServeEventsResult;\nimport com.github.tomakehurst.wiremock.admin.model.ServeEventQuery;\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetAllRequestsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    ServeEventQuery query = ServeEventQuery.fromRequest(serveEvent.getRequest());\n    GetServeEventsResult serveEventsResult = admin.getServeEvents(query);\n    LimitAndSinceDatePaginator paginator;\n    try {\n      paginator =\n          LimitAndSinceDatePaginator.fromRequest(\n              serveEventsResult.getRequests(), serveEvent.getRequest());\n    } catch (InvalidInputException e) {\n      return jsonResponse(e.getErrors(), HTTP_BAD_REQUEST);\n    }\n\n    GetServeEventsResult result =\n        new GetServeEventsResult(paginator, serveEventsResult.isRequestJournalDisabled());\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(Json.write(result))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetAllStubFilesTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static java.util.stream.Collectors.toList;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\n\npublic class GetAllStubFilesTask implements AdminTask {\n\n  private final Stores stores;\n\n  public GetAllStubFilesTask(Stores stores) {\n    this.stores = stores;\n  }\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    BlobStore filesBlobStore = stores.getFilesBlobStore();\n    List<String> filePaths = filesBlobStore.getAllKeys().sorted().collect(toList());\n    return ResponseDefinition.okForJson(filePaths);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetAllStubMappingsTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.LimitAndOffsetPaginator;\nimport com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetAllStubMappingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    ListStubMappingsResult result =\n        new ListStubMappingsResult(\n            LimitAndOffsetPaginator.fromRequest(\n                admin.listAllStubMappings().getMappings(), serveEvent.getRequest()));\n\n    return ResponseDefinitionBuilder.jsonResponse(result);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetCaCertTask.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.BrowserProxySettings;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.http.ssl.X509KeyStore;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.security.cert.X509Certificate;\nimport java.util.Base64;\n\npublic class GetCaCertTask implements AdminTask {\n\n  private static final Base64.Encoder BASE64_ENCODER =\n      Base64.getMimeEncoder(64, new byte[] {'\\r', '\\n'});\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    BrowserProxySettings browserProxySettings = admin.getOptions().browserProxySettings();\n    KeyStoreSettings caKeyStore = browserProxySettings.caKeyStore();\n    try {\n      X509KeyStore x509KeyStore =\n          new X509KeyStore(caKeyStore.loadStore(), caKeyStore.password().toCharArray());\n      X509Certificate certificate = x509KeyStore.getCertificateAuthority().certificateChain()[0];\n      return new ResponseDefinitionBuilder()\n          .withStatus(HTTP_OK)\n          .withHeader(\"Content-Type\", \"application/x-pem-file\")\n          .withBody(\n              \"-----BEGIN CERTIFICATE-----\\r\\n\"\n                  + BASE64_ENCODER.encodeToString(certificate.getEncoded())\n                  + \"\\r\\n\"\n                  + \"-----END CERTIFICATE-----\")\n          .build();\n    } catch (Exception e) {\n      String message = \"Failed to export certificate authority cert from \" + caKeyStore.path();\n      admin.getOptions().notifier().error(message, e);\n      return ResponseDefinition.serverError();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetDocIndexTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\npublic class GetDocIndexTask extends AbstractGetDocTask {\n\n  @Override\n  protected String getMimeType() {\n    return \"text/html\";\n  }\n\n  @Override\n  protected String getFilePath() {\n    return \"doc-index.html\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetMessageEventCountTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.common.Json.write;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.MessageVerificationResult;\n\npublic class GetMessageEventCountTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    MessagePattern pattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), MessagePattern.class);\n    int count = admin.countMessageEventsMatching(pattern);\n    MessageVerificationResult result = MessageVerificationResult.withCount(count);\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(write(result))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetMessageServeEventTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.SingleMessageServeEventResult;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.UUID;\n\npublic class GetMessageServeEventTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    UUID id = UUID.fromString(pathParams.get(\"id\"));\n    SingleMessageServeEventResult result = admin.getMessageServeEvent(id);\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(Json.write(result))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetRecordingsIndexTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\npublic class GetRecordingsIndexTask extends AbstractGetDocTask {\n\n  @Override\n  protected String getMimeType() {\n    return \"text/html\";\n  }\n\n  @Override\n  protected String getFilePath() {\n    return \"recorder-index.html\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetRequestCountTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.common.Json.write;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.VerificationResult;\n\npublic class GetRequestCountTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    RequestPattern requestPattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), RequestPattern.class);\n    VerificationResult result = admin.countRequestsMatching(requestPattern);\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(write(result))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetServedStubTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.model.SingleServedStubResult;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.UUID;\n\npublic class GetServedStubTask extends AbstractSingleServeEventTask {\n\n  @Override\n  protected ResponseDefinition processServeEvent(Admin admin, ServeEvent adminServeEvent, UUID id) {\n    final SingleServedStubResult result = admin.getServedStub(id);\n    return result.isPresent()\n        ? ResponseDefinition.okForJson(result.getItem())\n        : ResponseDefinition.notFound();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetStubFileTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Optional;\n\npublic class GetStubFileTask implements AdminTask {\n\n  private final Stores stores;\n\n  public GetStubFileTask(Stores stores) {\n    this.stores = stores;\n  }\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    String filename = pathParams.get(\"0\");\n    Optional<byte[]> fileContents = stores.getFilesBlobStore().get(filename);\n\n    return fileContents\n        .map(bytes -> responseDefinition().withStatus(HTTP_OK).withBody(bytes).build())\n        .orElseGet(ResponseDefinition::notFound);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetStubMappingTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic class GetStubMappingTask extends AbstractSingleStubTask {\n\n  @Override\n  protected ResponseDefinition processStubMapping(\n      Admin admin, ServeEvent serveEvent, StubMapping stubMapping) {\n    return ResponseDefinition.okForJson(stubMapping);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetSwaggerSpecTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\npublic class GetSwaggerSpecTask extends AbstractGetDocTask {\n\n  @Override\n  protected String getMimeType() {\n    return \"application/json\";\n  }\n\n  @Override\n  protected String getFilePath() {\n    return \"swagger/wiremock-admin-api.json\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetUnmatchedStubMappingsTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetUnmatchedStubMappingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    ListStubMappingsResult result = admin.findUnmatchedStubs();\n    return ResponseDefinition.okForJson(result);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GetVersionTask.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.jsonResponse;\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.ACCEPT;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_TYPE;\nimport static com.github.tomakehurst.wiremock.http.MimeType.PLAIN;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.VersionResult;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Version;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GetVersionTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n\n    var acceptHeader = serveEvent.getRequest().getHeader(ACCEPT);\n    if (acceptHeader != null && acceptHeader.contains(PLAIN.toString())) {\n      return responseDefinition()\n          .withStatus(HTTP_OK)\n          .withBody(Version.getCurrentVersion())\n          .withHeader(CONTENT_TYPE, PLAIN.toString())\n          .build();\n    }\n\n    var versionResult = new VersionResult(Version.getCurrentVersion());\n    return jsonResponse(versionResult);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/GlobalSettingsUpdateTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.GetGlobalSettingsResult;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class GlobalSettingsUpdateTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    GlobalSettings newSettings;\n    try {\n      newSettings = Json.read(serveEvent.getRequest().getBodyAsString(), GlobalSettings.class);\n    } catch (Exception e) {\n      newSettings =\n          Json.read(serveEvent.getRequest().getBodyAsString(), GetGlobalSettingsResult.class)\n              .getSettings();\n    }\n\n    admin.updateGlobalSettings(newSettings);\n    return ResponseDefinition.ok();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/HealthCheckTask.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.HealthCheckResult;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class HealthCheckTask implements AdminTask {\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withStatusMessage(\"Wiremock is ok\")\n        .withBody(\n            Json.write(\n                new HealthCheckResult(\n                    HealthCheckStatus.HEALTHY.name().toLowerCase(), \"Wiremock is ok\")))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n\n  protected enum HealthCheckStatus {\n    HEALTHY,\n    UNHEALTHY\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/NotFoundAdminTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class NotFoundAdminTask implements AdminTask {\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    return ResponseDefinition.notFound();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/OldEditStubMappingTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic class OldEditStubMappingTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StubMapping stubMapping =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StubMapping.class);\n    admin.editStubMapping(stubMapping);\n    return ResponseDefinition.noContent();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveMatchingStubMappingTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMappingOrMappings;\n\npublic class RemoveMatchingStubMappingTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StubMappingOrMappings removeMappings =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StubMappingOrMappings.class);\n    admin.removeStubMappings(removeMappings.getMappingOrMappings());\n    return ResponseDefinition.ok();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveMessageServeEventTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.UUID;\n\npublic class RemoveMessageServeEventTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    UUID id = UUID.fromString(pathParams.get(\"id\"));\n    admin.removeMessageServeEvent(id);\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveMessageServeEventsByMetadataTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindMessageServeEventsResult;\n\npublic class RemoveMessageServeEventsByMetadataTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StringValuePattern pattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StringValuePattern.class);\n    FindMessageServeEventsResult result =\n        admin.removeMessageServeEventsForStubsMatchingMetadata(pattern);\n    return ResponseDefinition.okForJson(result);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveMessageServeEventsByPatternTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.FindMessageServeEventsResult;\n\npublic class RemoveMessageServeEventsByPatternTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    MessagePattern pattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), MessagePattern.class);\n    FindMessageServeEventsResult result = admin.removeMessageServeEventsMatching(pattern);\n    return ResponseDefinition.okForJson(result);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveMessageStubMappingTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.UUID;\n\npublic class RemoveMessageStubMappingTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    UUID id = UUID.fromString(pathParams.get(\"id\"));\n    admin.removeMessageStubMapping(id);\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveMessageStubMappingsByMetadataTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class RemoveMessageStubMappingsByMetadataTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    StringValuePattern pattern =\n        Json.read(serveEvent.getRequest().getBodyAsString(), StringValuePattern.class);\n    admin.removeMessageStubsByMetadata(pattern);\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveStubMappingByIdTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic class RemoveStubMappingByIdTask extends AbstractSingleStubTask {\n\n  @Override\n  protected ResponseDefinition processStubMapping(\n      Admin admin, ServeEvent serveEvent, StubMapping stubMapping) {\n    admin.removeStubMapping(stubMapping);\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RemoveUnmatchedStubMappingsTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class RemoveUnmatchedStubMappingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.removeStubMappings(admin.findUnmatchedStubs().getMappings());\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/ResetMessageJournalTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class ResetMessageJournalTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.resetMessageJournal();\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/ResetMessageStubMappingsTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class ResetMessageStubMappingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.resetMessageStubMappings();\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/ResetRequestsTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class ResetRequestsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.resetRequests();\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/ResetScenariosTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class ResetScenariosTask implements AdminTask {\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.resetScenarios();\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/ResetStubMappingsTask.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class ResetStubMappingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.resetMappings();\n    return ResponseDefinition.okEmptyJson();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/ResetTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class ResetTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.resetAll();\n    return ResponseDefinition.ok();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/ResetToDefaultMappingsTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class ResetToDefaultMappingsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.resetToDefaultMappings();\n    return ResponseDefinition.ok();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RootRedirectTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.ADMIN_CONTEXT_ROOT;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class RootRedirectTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    return ResponseDefinition.redirectTo(ADMIN_CONTEXT_ROOT + \"/\");\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/RootTask.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\npublic class RootTask extends GetAllStubMappingsTask {}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/SaveMappingsTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class SaveMappingsTask implements AdminTask {\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.saveMappings();\n    return ResponseDefinition.ok();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/SendChannelMessageTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.SendChannelMessageRequest;\nimport com.github.tomakehurst.wiremock.admin.model.SendChannelMessageResult;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\n/** Admin task that sends a message to channels of a specific type matching a request pattern. */\npublic class SendChannelMessageTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    SendChannelMessageRequest request =\n        Json.read(serveEvent.getRequest().getBodyAsString(), SendChannelMessageRequest.class);\n\n    SendChannelMessageResult result =\n        admin.sendChannelMessage(\n            request.getType(), request.getInitiatingRequest(), request.getMessage());\n\n    return ResponseDefinitionBuilder.jsonResponse(result, HTTP_OK);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/ShutdownServerTask.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class ShutdownServerTask implements AdminTask {\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    admin.shutdownServer();\n    return ResponseDefinition.ok();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/SnapshotTask.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.jsonResponse;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.recording.RecordSpec;\nimport com.github.tomakehurst.wiremock.recording.SnapshotRecordResult;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class SnapshotTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    RecordSpec recordSpec =\n        serveEvent.getRequest().getBody().length == 0\n            ? RecordSpec.DEFAULTS\n            : Json.read(serveEvent.getRequest().getBodyAsString(), RecordSpec.class);\n\n    SnapshotRecordResult result = admin.snapshotRecord(recordSpec);\n    return jsonResponse(result, HTTP_OK);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/WaitForMessageEventTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.SingleMessageServeEventResult;\nimport com.github.tomakehurst.wiremock.admin.model.WaitForMessageEventRequest;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.time.Duration;\nimport java.util.Optional;\n\npublic class WaitForMessageEventTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    WaitForMessageEventRequest request =\n        Json.read(serveEvent.getRequest().getBodyAsString(), WaitForMessageEventRequest.class);\n\n    Optional<MessageServeEvent> result =\n        admin.waitForMessageEvent(\n            request.getPattern(), Duration.ofMillis(request.getTimeoutMillis()));\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(Json.write(SingleMessageServeEventResult.fromOptional(result)))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/admin/tasks/WaitForMessageEventsTask.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.admin.tasks;\n\nimport static com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder.responseDefinition;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.model.GetMessageServeEventsResult;\nimport com.github.tomakehurst.wiremock.admin.model.WaitForMessageEventRequest;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.time.Duration;\nimport java.util.List;\n\npublic class WaitForMessageEventsTask implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    WaitForMessageEventRequest request =\n        Json.read(serveEvent.getRequest().getBodyAsString(), WaitForMessageEventRequest.class);\n\n    int count = request.getCount() != null ? request.getCount() : 1;\n    List<MessageServeEvent> result =\n        admin.waitForMessageEvents(\n            request.getPattern(), count, Duration.ofMillis(request.getTimeoutMillis()));\n\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(Json.write(GetMessageServeEventsResult.messageJournalEnabled(result)))\n        .withHeader(\"Content-Type\", \"application/json\")\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/BasicCredentials.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.encodeBase64;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.matching.EqualToPatternWithCaseInsensitivePrefix;\nimport com.github.tomakehurst.wiremock.matching.MultiValuePattern;\n\npublic class BasicCredentials {\n\n  public final String username;\n  public final String password;\n\n  @JsonCreator\n  public BasicCredentials(\n      @JsonProperty(\"username\") String username, @JsonProperty(\"password\") String password) {\n    this.username = username;\n    this.password = password;\n  }\n\n  public boolean present() {\n    return username != null && password != null;\n  }\n\n  public MultiValuePattern asAuthorizationMultiValuePattern() {\n    return MultiValuePattern.of(\n        new EqualToPatternWithCaseInsensitivePrefix(\"Basic \", encodedUsernameAndPassword()));\n  }\n\n  public String asAuthorizationHeaderValue() {\n    return \"Basic \" + encodedUsernameAndPassword();\n  }\n\n  private String encodedUsernameAndPassword() {\n    byte[] usernameAndPassword = (username + \":\" + password).getBytes();\n    return encodeBase64(usernameAndPassword);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/BasicMappingBuilder.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkParameter;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkState;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.PostServeActionDefinition;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListener;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListenerDefinition;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.*;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.UUID;\n\nclass BasicMappingBuilder implements ScenarioMappingBuilder {\n\n  private final RequestPatternBuilder requestPatternBuilder;\n  private ResponseDefinitionBuilder responseDefBuilder;\n  private Integer priority;\n  private String scenarioName;\n  private String requiredScenarioState;\n  private String newScenarioState;\n  private UUID id = UUID.randomUUID();\n  private String name;\n  private Boolean isPersistent = null;\n  private final List<PostServeActionDefinition> postServeActions = new ArrayList<>();\n  private final List<ServeEventListenerDefinition> serveEventListeners = new ArrayList<>();\n  private Metadata metadata = new Metadata();\n\n  BasicMappingBuilder(RequestMethod method, UrlPattern urlPattern) {\n    requestPatternBuilder = new RequestPatternBuilder(method, urlPattern);\n  }\n\n  BasicMappingBuilder(ValueMatcher<Request> requestMatcher) {\n    requestPatternBuilder = new RequestPatternBuilder(requestMatcher);\n  }\n\n  BasicMappingBuilder(String customRequestMatcherName, Parameters parameters) {\n    requestPatternBuilder = new RequestPatternBuilder(customRequestMatcherName, parameters);\n  }\n\n  @Override\n  public BasicMappingBuilder willReturn(ResponseDefinitionBuilder responseDefBuilder) {\n    this.responseDefBuilder = responseDefBuilder;\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder atPriority(Integer priority) {\n    this.priority = priority;\n    return this;\n  }\n\n  @Override\n  public MappingBuilder withScheme(String scheme) {\n    requestPatternBuilder.withScheme(scheme);\n    return this;\n  }\n\n  @Override\n  public MappingBuilder withHost(StringValuePattern hostPattern) {\n    requestPatternBuilder.withHost(hostPattern);\n    return this;\n  }\n\n  @Override\n  public MappingBuilder withPort(int port) {\n    requestPatternBuilder.withPort(port);\n    return this;\n  }\n\n  @Override\n  public MappingBuilder withClientIp(StringValuePattern clientIpPattern) {\n    requestPatternBuilder.withClientIp(clientIpPattern);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withHeader(String key, StringValuePattern headerPattern) {\n    requestPatternBuilder.withHeader(key, headerPattern);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withHeader(String key, MultiValuePattern headerPattern) {\n    requestPatternBuilder.withHeader(key, headerPattern);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withCookie(String name, StringValuePattern cookieValuePattern) {\n    requestPatternBuilder.withCookie(name, cookieValuePattern);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withQueryParam(String key, StringValuePattern queryParamPattern) {\n    requestPatternBuilder.withQueryParam(key, queryParamPattern);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withQueryParam(String key, MultiValuePattern queryParamPattern) {\n    requestPatternBuilder.withQueryParam(key, queryParamPattern);\n    return this;\n  }\n\n  @Override\n  public ScenarioMappingBuilder withFormParam(String key, StringValuePattern formParamPattern) {\n    requestPatternBuilder.withFormParam(key, formParamPattern);\n    return this;\n  }\n\n  @Override\n  public ScenarioMappingBuilder withFormParam(String key, MultiValuePattern formParamPattern) {\n    requestPatternBuilder.withFormParam(key, formParamPattern);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withFormParams(Map<String, MultiValuePattern> formParams) {\n    for (Map.Entry<String, MultiValuePattern> formParam : formParams.entrySet()) {\n      requestPatternBuilder.withFormParam(formParam.getKey(), formParam.getValue());\n    }\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withPathParam(String key, StringValuePattern pathParamPattern) {\n    requestPatternBuilder.withPathParam(key, pathParamPattern);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withQueryParams(Map<String, StringValuePattern> queryParams) {\n    for (Map.Entry<String, StringValuePattern> queryParam : queryParams.entrySet()) {\n      requestPatternBuilder.withQueryParam(queryParam.getKey(), queryParam.getValue());\n    }\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withRequestBody(ContentPattern<?> bodyPattern) {\n    requestPatternBuilder.withRequestBody(bodyPattern);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withMultipartRequestBody(\n      MultipartValuePatternBuilder multipartPatternBuilder) {\n    requestPatternBuilder.withRequestBodyPart(multipartPatternBuilder.build());\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder inScenario(String scenarioName) {\n    checkParameter(scenarioName != null, \"Scenario name must not be null\");\n\n    this.scenarioName = scenarioName;\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder whenScenarioStateIs(String stateName) {\n    this.requiredScenarioState = stateName;\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder willSetStateTo(String stateName) {\n    this.newScenarioState = stateName;\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withId(UUID id) {\n    this.id = id;\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withName(String name) {\n    this.name = name;\n    return this;\n  }\n\n  @Override\n  public ScenarioMappingBuilder persistent() {\n    this.isPersistent = true;\n    return this;\n  }\n\n  @Override\n  public ScenarioMappingBuilder persistent(boolean persistent) {\n    this.isPersistent = persistent;\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withBasicAuth(String username, String password) {\n    requestPatternBuilder.withBasicAuth(new BasicCredentials(username, password));\n    return this;\n  }\n\n  @Override\n  public <P> BasicMappingBuilder withPostServeAction(String extensionName, P parameters) {\n    postServeActions.add(\n        new PostServeActionDefinition(extensionName, resolveParameters(parameters)));\n    return this;\n  }\n\n  @Override\n  public <P> MappingBuilder withServeEventListener(\n      Set<ServeEventListener.RequestPhase> requestPhases, String extensionName, P parameters) {\n    serveEventListeners.add(\n        new ServeEventListenerDefinition(\n            extensionName, requestPhases, resolveParameters(parameters)));\n    return this;\n  }\n\n  @Override\n  public <P> MappingBuilder withServeEventListener(String extensionName, P parameters) {\n    serveEventListeners.add(\n        new ServeEventListenerDefinition(extensionName, resolveParameters(parameters)));\n    return this;\n  }\n\n  private static <P> Parameters resolveParameters(P parameters) {\n    return parameters instanceof Parameters ? (Parameters) parameters : Parameters.of(parameters);\n  }\n\n  @Override\n  public BasicMappingBuilder withMetadata(Map<String, ?> metadataMap) {\n    this.metadata = new Metadata(metadataMap);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withMetadata(Metadata metadata) {\n    this.metadata = metadata;\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder withMetadata(Metadata.Builder metadata) {\n    this.metadata = metadata.build();\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder andMatching(ValueMatcher<Request> customMatcher) {\n    requestPatternBuilder.andMatching(customMatcher);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder andMatching(String customRequestMatcherName) {\n    requestPatternBuilder.andMatching(customRequestMatcherName);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder andMatching(String customRequestMatcherName, Parameters parameters) {\n    requestPatternBuilder.andMatching(customRequestMatcherName, parameters);\n    return this;\n  }\n\n  @Override\n  public BasicMappingBuilder andMatching(CustomMatcherDefinition matcherDefinition) {\n    requestPatternBuilder.andMatching(matcherDefinition);\n    return this;\n  }\n\n  private boolean requiredScenarioExist() {\n    return scenarioName == null && (requiredScenarioState != null || newScenarioState != null);\n  }\n\n  @Override\n  public StubMapping build() {\n    checkState(\n        !requiredScenarioExist(),\n        \"Scenario name must be specified to require or set a new scenario state\");\n    RequestPattern requestPattern = requestPatternBuilder.build();\n    ResponseDefinition response = getFirstNonNull(responseDefBuilder, aResponse()).build();\n\n    return StubMapping.builder()\n        .setRequest(requestPattern)\n        .setResponse(response)\n        .setPriority(priority)\n        .setScenarioName(scenarioName)\n        .setRequiredScenarioState(requiredScenarioState)\n        .setNewScenarioState(newScenarioState)\n        .setId(id)\n        .setName(name)\n        .setPersistent(isPersistent)\n        .setPostServeActions(postServeActions)\n        .setServeEventListeners(serveEventListeners)\n        .setMetadata(metadata)\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/CountMatchingMode.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport com.github.tomakehurst.wiremock.common.BiPredicate;\n\n/** */\npublic interface CountMatchingMode extends BiPredicate<Integer, Integer> {\n\n  String getFriendlyName();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/CountMatchingStrategy.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\n/** Matches the number of requests made using relational predicates. */\npublic class CountMatchingStrategy {\n\n  public static final CountMatchingMode LESS_THAN =\n      new CountMatchingMode() {\n        @Override\n        public String getFriendlyName() {\n          return \"Less than\";\n        }\n\n        @Override\n        public boolean test(Integer actual, Integer expected) {\n          return actual < expected;\n        }\n      };\n\n  public static final CountMatchingMode LESS_THAN_OR_EQUAL =\n      new CountMatchingMode() {\n        @Override\n        public String getFriendlyName() {\n          return \"Less than or exactly\";\n        }\n\n        @Override\n        public boolean test(Integer actual, Integer expected) {\n          return actual <= expected;\n        }\n      };\n\n  public static final CountMatchingMode EQUAL_TO =\n      new CountMatchingMode() {\n        @Override\n        public String getFriendlyName() {\n          return \"Exactly\";\n        }\n\n        @Override\n        public boolean test(Integer actual, Integer expected) {\n          return actual.equals(expected);\n        }\n      };\n\n  public static final CountMatchingMode GREATER_THAN_OR_EQUAL =\n      new CountMatchingMode() {\n        @Override\n        public String getFriendlyName() {\n          return \"More than or exactly\";\n        }\n\n        @Override\n        public boolean test(Integer actual, Integer expected) {\n          return actual >= expected;\n        }\n      };\n\n  public static final CountMatchingMode GREATER_THAN =\n      new CountMatchingMode() {\n        @Override\n        public String getFriendlyName() {\n          return \"More than\";\n        }\n\n        @Override\n        public boolean test(Integer actual, Integer expected) {\n          return actual > expected;\n        }\n      };\n\n  private CountMatchingMode mode;\n  private int expected;\n\n  public CountMatchingStrategy(CountMatchingMode mode, int expected) {\n    this.mode = mode;\n    this.expected = expected;\n  }\n\n  public boolean match(int actual) {\n    return mode.test(actual, expected);\n  }\n\n  @Override\n  public String toString() {\n    return String.format(\"%s %d\", mode.getFriendlyName(), expected);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/HttpAdminClient.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_TYPE;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.*;\nimport static com.github.tomakehurst.wiremock.http.client.HttpClient.HOST_HEADER;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static java.util.Objects.requireNonNull;\n\nimport com.github.tomakehurst.wiremock.admin.*;\nimport com.github.tomakehurst.wiremock.admin.model.*;\nimport com.github.tomakehurst.wiremock.admin.tasks.*;\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.common.url.QueryParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.recording.RecordSpec;\nimport com.github.tomakehurst.wiremock.recording.RecordSpecBuilder;\nimport com.github.tomakehurst.wiremock.recording.RecordingStatusResult;\nimport com.github.tomakehurst.wiremock.recording.SnapshotRecordResult;\nimport com.github.tomakehurst.wiremock.security.ClientAuthenticator;\nimport com.github.tomakehurst.wiremock.security.NotAuthorisedException;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.verification.*;\nimport java.time.Duration;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.UUID;\n\npublic class HttpAdminClient implements Admin {\n\n  private static final String ADMIN_URL_PREFIX = \"%s://%s%s%s/__admin\";\n  private static final int NO_PORT_DEFINED = -1;\n\n  private final String scheme;\n  private final String host;\n  private final int port;\n  private final String urlPathPrefix;\n  private final String hostHeader;\n  private final ClientAuthenticator authenticator;\n\n  private final AdminRoutes adminRoutes;\n\n  private final HttpClient httpClient;\n\n  public HttpAdminClient(\n      String scheme,\n      String host,\n      int port,\n      String urlPathPrefix,\n      String hostHeader,\n      ClientAuthenticator authenticator,\n      HttpClient httpClient) {\n    this.scheme = scheme;\n    this.host = host;\n    this.port = port;\n    this.urlPathPrefix = urlPathPrefix;\n    this.hostHeader = hostHeader;\n    this.authenticator = authenticator;\n    this.httpClient = httpClient;\n\n    adminRoutes = AdminRoutes.forClient();\n  }\n\n  @Override\n  public void addStubMapping(StubMapping stubMapping) {\n    if (stubMapping.getRequest().hasInlineCustomMatcher()) {\n      throw new AdminException(\n          \"Custom matchers can't be used when administering a remote WireMock server. \"\n              + \"Use WireMockRule.stubFor() or WireMockServer.stubFor() to administer the local instance.\");\n    }\n\n    executeRequest(\n        adminRoutes.requestSpecForTask(CreateStubMappingTask.class),\n        PathParams.empty(),\n        stubMapping,\n        Void.class);\n  }\n\n  @Override\n  public void editStubMapping(StubMapping stubMapping) {\n    putJsonAssertOkAndReturnBody(\n        urlFor(EditStubMappingTask.class, PathParams.single(\"id\", stubMapping.getId().toString())),\n        Json.write(stubMapping));\n  }\n\n  @Override\n  public void removeStubMapping(StubMapping stubbMapping) {\n    postJsonAssertOkAndReturnBody(\n        urlFor(RemoveMatchingStubMappingTask.class), Json.write(stubbMapping));\n  }\n\n  @Override\n  public void removeStubMapping(UUID id) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(RemoveStubMappingByIdTask.class),\n        PathParams.single(\"id\", id),\n        Void.class);\n  }\n\n  @Override\n  public ListStubMappingsResult listAllStubMappings() {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetAllStubMappingsTask.class), ListStubMappingsResult.class);\n  }\n\n  @Override\n  public SingleStubMappingResult getStubMapping(UUID id) {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetStubMappingTask.class),\n        PathParams.single(\"id\", id),\n        SingleStubMappingResult.class);\n  }\n\n  @Override\n  public void saveMappings() {\n    postJsonAssertOkAndReturnBody(urlFor(SaveMappingsTask.class), null);\n  }\n\n  @Override\n  public void resetAll() {\n    postJsonAssertOkAndReturnBody(urlFor(ResetTask.class), null);\n  }\n\n  @Override\n  public void resetRequests() {\n    executeRequest(adminRoutes.requestSpecForTask(ResetRequestsTask.class));\n  }\n\n  @Override\n  public void resetScenarios() {\n    executeRequest(adminRoutes.requestSpecForTask(ResetScenariosTask.class));\n  }\n\n  @Override\n  public void resetMappings() {\n    executeRequest(adminRoutes.requestSpecForTask(ResetStubMappingsTask.class));\n  }\n\n  @Override\n  public void resetToDefaultMappings() {\n    postJsonAssertOkAndReturnBody(urlFor(ResetToDefaultMappingsTask.class), null);\n  }\n\n  @Override\n  public GetServeEventsResult getServeEvents() {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetAllRequestsTask.class), GetServeEventsResult.class);\n  }\n\n  @Override\n  public GetServeEventsResult getServeEvents(ServeEventQuery query) {\n    final QueryParams queryParams = new QueryParams();\n    queryParams.add(\"unmatched\", String.valueOf(query.isOnlyUnmatched()));\n\n    if (query.getStubMappingId() != null) {\n      queryParams.add(\"matchingStub\", query.getStubMappingId().toString());\n    }\n\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetAllRequestsTask.class),\n        PathParams.empty(),\n        queryParams,\n        null,\n        GetServeEventsResult.class);\n  }\n\n  @Override\n  public SingleServedStubResult getServedStub(UUID id) {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetServedStubTask.class),\n        PathParams.single(\"id\", id),\n        SingleServedStubResult.class);\n  }\n\n  @Override\n  public VerificationResult countRequestsMatching(RequestPattern requestPattern) {\n    String body =\n        postJsonAssertOkAndReturnBody(\n            urlFor(GetRequestCountTask.class), Json.write(requestPattern));\n    return VerificationResult.from(body);\n  }\n\n  @Override\n  public FindRequestsResult findRequestsMatching(RequestPattern requestPattern) {\n    String body =\n        postJsonAssertOkAndReturnBody(urlFor(FindRequestsTask.class), Json.write(requestPattern));\n    return Json.read(body, FindRequestsResult.class);\n  }\n\n  @Override\n  public FindRequestsResult findUnmatchedRequests() {\n    String body = getJsonAssertOkAndReturnBody(urlFor(FindUnmatchedRequestsTask.class));\n    return Json.read(body, FindRequestsResult.class);\n  }\n\n  @Override\n  public void removeServeEvent(UUID eventId) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(RemoveServeEventTask.class),\n        PathParams.single(\"id\", eventId),\n        Void.class);\n  }\n\n  @Override\n  public FindServeEventsResult removeServeEventsMatching(RequestPattern requestPattern) {\n    String body =\n        postJsonAssertOkAndReturnBody(\n            urlFor(RemoveServeEventsByRequestPatternTask.class), Json.write(requestPattern));\n    return Json.read(body, FindServeEventsResult.class);\n  }\n\n  @Override\n  public FindServeEventsResult removeServeEventsForStubsMatchingMetadata(\n      StringValuePattern metadataPattern) {\n    String body =\n        postJsonAssertOkAndReturnBody(\n            urlFor(RemoveServeEventsByStubMetadataTask.class), Json.write(metadataPattern));\n    return Json.read(body, FindServeEventsResult.class);\n  }\n\n  @Override\n  public FindNearMissesResult findNearMissesForUnmatchedRequests() {\n    String body = getJsonAssertOkAndReturnBody(urlFor(FindNearMissesForUnmatchedTask.class));\n    return Json.read(body, FindNearMissesResult.class);\n  }\n\n  @Override\n  public GetScenariosResult getAllScenarios() {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetAllScenariosTask.class), GetScenariosResult.class);\n  }\n\n  @Override\n  public void resetScenario(String name) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(SetScenarioStateTask.class),\n        PathParams.single(\"name\", name),\n        Void.class);\n  }\n\n  @Override\n  public void setScenarioState(String name, String state) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(SetScenarioStateTask.class),\n        PathParams.single(\"name\", name),\n        new ScenarioState(state),\n        Void.class);\n  }\n\n  @Override\n  public FindNearMissesResult findTopNearMissesFor(LoggedRequest loggedRequest) {\n    String body =\n        postJsonAssertOkAndReturnBody(\n            urlFor(FindNearMissesForRequestTask.class), Json.write(loggedRequest));\n\n    return Json.read(body, FindNearMissesResult.class);\n  }\n\n  @Override\n  public FindNearMissesResult findTopNearMissesFor(RequestPattern requestPattern) {\n    String body =\n        postJsonAssertOkAndReturnBody(\n            urlFor(FindNearMissesForRequestPatternTask.class), Json.write(requestPattern));\n\n    return Json.read(body, FindNearMissesResult.class);\n  }\n\n  @Override\n  public void updateGlobalSettings(GlobalSettings settings) {\n    postJsonAssertOkAndReturnBody(urlFor(GlobalSettingsUpdateTask.class), Json.write(settings));\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord() {\n    String body = postJsonAssertOkAndReturnBody(urlFor(SnapshotTask.class), \"\");\n\n    return Json.read(body, SnapshotRecordResult.class);\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord(RecordSpecBuilder spec) {\n    return snapshotRecord(spec.build());\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord(RecordSpec spec) {\n    String body = postJsonAssertOkAndReturnBody(urlFor(SnapshotTask.class), Json.write(spec));\n\n    return Json.read(body, SnapshotRecordResult.class);\n  }\n\n  @Override\n  public void startRecording(String targetBaseUrl) {\n    startRecording(RecordSpec.forBaseUrl(targetBaseUrl));\n  }\n\n  @Override\n  public void startRecording(RecordSpec recordSpec) {\n    postJsonAssertOkAndReturnBody(urlFor(StartRecordingTask.class), Json.write(recordSpec));\n  }\n\n  @Override\n  public void startRecording(RecordSpecBuilder recordSpec) {\n    startRecording(recordSpec.build());\n  }\n\n  @Override\n  public SnapshotRecordResult stopRecording() {\n    String body = postJsonAssertOkAndReturnBody(urlFor(StopRecordingTask.class), \"\");\n\n    return Json.read(body, SnapshotRecordResult.class);\n  }\n\n  @Override\n  public RecordingStatusResult getRecordingStatus() {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetRecordingStatusTask.class), RecordingStatusResult.class);\n  }\n\n  @Override\n  public Options getOptions() {\n    return new WireMockConfiguration().port(port).bindAddress(host);\n  }\n\n  @Override\n  public void shutdownServer() {\n    postJsonAssertOkAndReturnBody(urlFor(ShutdownServerTask.class), null);\n  }\n\n  @Override\n  public ListStubMappingsResult findUnmatchedStubs() {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetUnmatchedStubMappingsTask.class),\n        ListStubMappingsResult.class);\n  }\n\n  @Override\n  public ListStubMappingsResult findAllStubsByMetadata(StringValuePattern pattern) {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(FindStubMappingsByMetadataTask.class),\n        pattern,\n        ListStubMappingsResult.class);\n  }\n\n  @Override\n  public void removeStubsByMetadata(StringValuePattern pattern) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(RemoveStubMappingsByMetadataTask.class),\n        pattern,\n        Void.class);\n  }\n\n  @Override\n  public void importStubs(StubImport stubImport) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(ImportStubMappingsTask.class), stubImport, Void.class);\n  }\n\n  @Override\n  public void removeStubMappings(List<StubMapping> stubMappings) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(RemoveMatchingStubMappingTask.class),\n        Map.of(\"mappings\", stubMappings),\n        Void.class);\n  }\n\n  @Override\n  public GetGlobalSettingsResult getGlobalSettings() {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetGlobalSettingsTask.class), GetGlobalSettingsResult.class);\n  }\n\n  public int port() {\n    return port;\n  }\n\n  private String postJsonAssertOkAndReturnBody(String url, String json) {\n    ImmutableRequest.Builder post = ImmutableRequest.create().withMethod(POST).withAbsoluteUrl(url);\n    post.withHeader(CONTENT_TYPE, \"application/json\");\n    post.withBody(Optional.ofNullable(json).orElse(\"\").getBytes(UTF_8));\n    return safelyExecuteRequest(url, post);\n  }\n\n  @SuppressWarnings(\"UnusedReturnValue\")\n  private String putJsonAssertOkAndReturnBody(String url, String json) {\n    ImmutableRequest.Builder put = ImmutableRequest.create().withMethod(PUT).withAbsoluteUrl(url);\n    put.withHeader(CONTENT_TYPE, \"application/json\");\n    put.withBody(Optional.ofNullable(json).orElse(\"\").getBytes(UTF_8));\n    return safelyExecuteRequest(url, put);\n  }\n\n  protected String getJsonAssertOkAndReturnBody(String url) {\n    ImmutableRequest.Builder get = ImmutableRequest.create().withMethod(GET).withAbsoluteUrl(url);\n    return safelyExecuteRequest(url, get);\n  }\n\n  private void executeRequest(RequestSpec requestSpec) {\n    executeRequest(requestSpec, PathParams.empty(), null, Void.class);\n  }\n\n  private <B, R> R executeRequest(RequestSpec requestSpec, B requestBody, Class<R> responseType) {\n    return executeRequest(requestSpec, PathParams.empty(), requestBody, responseType);\n  }\n\n  private <R> R executeRequest(RequestSpec requestSpec, Class<R> responseType) {\n    return executeRequest(requestSpec, PathParams.empty(), null, responseType);\n  }\n\n  private <R> R executeRequest(\n      RequestSpec requestSpec, PathParams pathParams, Class<R> responseType) {\n    return executeRequest(requestSpec, pathParams, null, responseType);\n  }\n\n  private <B, R> R executeRequest(\n      RequestSpec requestSpec, PathParams pathParams, B requestBody, Class<R> responseType) {\n    return executeRequest(requestSpec, pathParams, QueryParams.EMPTY, requestBody, responseType);\n  }\n\n  private <B, R> R executeRequest(\n      RequestSpec requestSpec,\n      PathParams pathParams,\n      QueryParams queryParams,\n      B requestBody,\n      Class<R> responseType) {\n    String url = getAdminUrl(requestSpec.path(pathParams) + queryParams);\n    ImmutableRequest.Builder requestBuilder =\n        ImmutableRequest.create().withMethod(requestSpec.method()).withAbsoluteUrl(url);\n\n    if (requestSpec.method().hasEntity()) {\n      requestBuilder.withBody(\n          Optional.ofNullable(requestBody).map(Json::write).orElse(\"\").getBytes(UTF_8));\n      requestBuilder.withHeader(CONTENT_TYPE, \"application/json\");\n    }\n\n    String responseBodyString = safelyExecuteRequest(url, requestBuilder);\n\n    return responseType == Void.class ? null : Json.read(responseBodyString, responseType);\n  }\n\n  private void injectHeaders(ImmutableRequest.Builder request) {\n    if (hostHeader != null) {\n      request.withHeader(HOST_HEADER, hostHeader);\n    }\n\n    List<HttpHeader> httpHeaders = authenticator.generateAuthHeaders();\n    httpHeaders.forEach(header -> request.withHeader(header.key(), header.values()));\n  }\n\n  private void verifyResponseStatus(String url, int responseStatusCode) {\n    if (HttpStatus.isServerError(responseStatusCode)) {\n      throw new VerificationException(responseStatusErrorMessage(url, responseStatusCode));\n    }\n\n    if (responseStatusCode == 401) {\n      throw new NotAuthorisedException(responseStatusErrorMessage(url, responseStatusCode));\n    }\n  }\n\n  private String responseStatusErrorMessage(String url, int responseStatusCode) {\n    return \"Expected status 2xx for \" + url + \" but was \" + responseStatusCode;\n  }\n\n  private String safelyExecuteRequest(String url, ImmutableRequest.Builder request) {\n    injectHeaders(request);\n\n    try {\n      Response response = httpClient.execute(request.build());\n      int statusCode = response.getStatus();\n\n      verifyResponseStatus(url, statusCode);\n\n      String body = response.getBodyAsString();\n      if (HttpStatus.isClientError(statusCode)) {\n        throw parseClientError(url, body, statusCode);\n      }\n\n      return body;\n    } catch (Exception e) {\n      return throwUnchecked(e, String.class);\n    }\n  }\n\n  static ClientError parseClientError(String url, String responseBody, int responseStatusCode) {\n    Errors errors;\n    try {\n      errors = Json.read(responseBody, Errors.class);\n    } catch (JsonException e) {\n      Errors.Error jsonError = e.getErrors().first();\n      String jsonErrorDetail = jsonError.getDetail();\n      String extendedDetail =\n          \"Error parsing response body '\"\n              + responseBody\n              + \"' with status code \"\n              + responseStatusCode\n              + \" for \"\n              + url\n              + \". Error: \"\n              + jsonErrorDetail;\n      errors =\n          Errors.single(\n              jsonError.getCode(),\n              jsonError.getSource().getPointer(),\n              jsonError.getTitle(),\n              extendedDetail);\n    }\n\n    return ClientError.fromErrors(errors);\n  }\n\n  private String urlFor(Class<? extends AdminTask> taskClass) {\n    return urlFor(taskClass, PathParams.empty());\n  }\n\n  private String urlFor(Class<? extends AdminTask> taskClass, PathParams pathParams) {\n    RequestSpec requestSpec = adminRoutes.requestSpecForTask(taskClass);\n    requireNonNull(requestSpec, \"No admin task URL is registered for \" + taskClass.getSimpleName());\n    return getAdminUrl(requestSpec.path(pathParams));\n  }\n\n  private String getAdminUrl(String pathSuffix) {\n    String portPart = port == NO_PORT_DEFINED ? \"\" : \":\" + port;\n    return String.format(ADMIN_URL_PREFIX + pathSuffix, scheme, host, portPart, urlPathPrefix);\n  }\n\n  @Override\n  public SendChannelMessageResult sendChannelMessage(\n      ChannelType type, RequestPattern requestPattern, MessageDefinition message) {\n    String url = urlFor(SendChannelMessageTask.class);\n    String body = Json.write(new SendChannelMessageRequest(type, requestPattern, message));\n    String response = postJsonAssertOkAndReturnBody(url, body);\n    return Json.read(response, SendChannelMessageResult.class);\n  }\n\n  @Override\n  public ListMessageChannelsResult listAllMessageChannels() {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetAllMessageChannelsTask.class),\n        ListMessageChannelsResult.class);\n  }\n\n  @Override\n  public void addMessageStubMapping(MessageStubMapping messageStubMapping) {\n    postJsonAssertOkAndReturnBody(\n        urlFor(CreateMessageStubMappingTask.class), Json.write(messageStubMapping));\n  }\n\n  @Override\n  public void removeMessageStubMapping(UUID id) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(RemoveMessageStubMappingTask.class),\n        PathParams.single(\"id\", id),\n        Void.class);\n  }\n\n  @Override\n  public void resetMessageStubMappings() {\n    executeRequest(adminRoutes.requestSpecForTask(ResetMessageStubMappingsTask.class));\n  }\n\n  @Override\n  public ListMessageStubMappingsResult findAllMessageStubsByMetadata(StringValuePattern pattern) {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(FindMessageStubMappingsByMetadataTask.class),\n        pattern,\n        ListMessageStubMappingsResult.class);\n  }\n\n  @Override\n  public void removeMessageStubsByMetadata(StringValuePattern pattern) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(RemoveMessageStubMappingsByMetadataTask.class),\n        pattern,\n        Void.class);\n  }\n\n  @Override\n  public ListMessageStubMappingsResult listAllMessageStubMappings() {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetAllMessageStubMappingsTask.class),\n        ListMessageStubMappingsResult.class);\n  }\n\n  @Override\n  public GetMessageServeEventsResult getMessageServeEvents() {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetAllMessageEventsTask.class),\n        GetMessageServeEventsResult.class);\n  }\n\n  @Override\n  public SingleMessageServeEventResult getMessageServeEvent(UUID id) {\n    return executeRequest(\n        adminRoutes.requestSpecForTask(GetMessageServeEventTask.class),\n        PathParams.single(\"id\", id),\n        SingleMessageServeEventResult.class);\n  }\n\n  @Override\n  public int countMessageEventsMatching(MessagePattern pattern) {\n    String body =\n        postJsonAssertOkAndReturnBody(urlFor(GetMessageEventCountTask.class), Json.write(pattern));\n    return MessageVerificationResult.from(body).getCount();\n  }\n\n  @Override\n  public List<MessageServeEvent> findMessageEventsMatching(MessagePattern pattern) {\n    String body =\n        postJsonAssertOkAndReturnBody(urlFor(FindMessageEventsTask.class), Json.write(pattern));\n    return Json.read(body, FindMessageServeEventsResult.class).getMessageServeEvents();\n  }\n\n  @Override\n  public void removeMessageServeEvent(UUID eventId) {\n    executeRequest(\n        adminRoutes.requestSpecForTask(RemoveMessageServeEventTask.class),\n        PathParams.single(\"id\", eventId),\n        Void.class);\n  }\n\n  @Override\n  public FindMessageServeEventsResult removeMessageServeEventsMatching(MessagePattern pattern) {\n    String body =\n        postJsonAssertOkAndReturnBody(\n            urlFor(RemoveMessageServeEventsByPatternTask.class), Json.write(pattern));\n    return Json.read(body, FindMessageServeEventsResult.class);\n  }\n\n  @Override\n  public FindMessageServeEventsResult removeMessageServeEventsForStubsMatchingMetadata(\n      StringValuePattern pattern) {\n    String body =\n        postJsonAssertOkAndReturnBody(\n            urlFor(RemoveMessageServeEventsByMetadataTask.class), Json.write(pattern));\n    return Json.read(body, FindMessageServeEventsResult.class);\n  }\n\n  @Override\n  public void resetMessageJournal() {\n    executeRequest(adminRoutes.requestSpecForTask(ResetMessageJournalTask.class));\n  }\n\n  @Override\n  public Optional<MessageServeEvent> waitForMessageEvent(MessagePattern pattern, Duration maxWait) {\n    WaitForMessageEventRequest request =\n        WaitForMessageEventRequest.forSingleEvent(pattern, maxWait.toMillis());\n    String body =\n        postJsonAssertOkAndReturnBody(urlFor(WaitForMessageEventTask.class), Json.write(request));\n    SingleMessageServeEventResult result = Json.read(body, SingleMessageServeEventResult.class);\n    return result != null ? Optional.ofNullable(result.getItem()) : Optional.empty();\n  }\n\n  @Override\n  public List<MessageServeEvent> waitForMessageEvents(\n      MessagePattern pattern, int count, Duration maxWait) {\n    WaitForMessageEventRequest request =\n        WaitForMessageEventRequest.forMultipleEvents(pattern, maxWait.toMillis(), count);\n    String body =\n        postJsonAssertOkAndReturnBody(urlFor(WaitForMessageEventsTask.class), Json.write(request));\n    return Json.read(body, GetMessageServeEventsResult.class).getMessageServeEvents();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/MappingBuilder.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListener;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.*;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.UUID;\n\npublic interface MappingBuilder {\n\n  MappingBuilder withScheme(String scheme);\n\n  MappingBuilder withHost(StringValuePattern hostPattern);\n\n  MappingBuilder withPort(int port);\n\n  MappingBuilder withClientIp(StringValuePattern hostPattern);\n\n  MappingBuilder atPriority(Integer priority);\n\n  MappingBuilder withHeader(String key, StringValuePattern headerPattern);\n\n  MappingBuilder withHeader(String key, MultiValuePattern headerPattern);\n\n  MappingBuilder withPathParam(String name, StringValuePattern pattern);\n\n  MappingBuilder withQueryParam(String key, StringValuePattern queryParamPattern);\n\n  MappingBuilder withQueryParam(String key, MultiValuePattern multiValueQueryParamPattern);\n\n  MappingBuilder withFormParam(String key, StringValuePattern formParamPattern);\n\n  MappingBuilder withFormParam(String key, MultiValuePattern multiValueFormParamPattern);\n\n  MappingBuilder withFormParams(Map<String, MultiValuePattern> formParams);\n\n  MappingBuilder withQueryParams(Map<String, StringValuePattern> queryParams);\n\n  MappingBuilder withRequestBody(ContentPattern<?> bodyPattern);\n\n  MappingBuilder withMultipartRequestBody(MultipartValuePatternBuilder multipartPatternBuilder);\n\n  ScenarioMappingBuilder inScenario(String scenarioName);\n\n  MappingBuilder withId(UUID id);\n\n  MappingBuilder withName(String name);\n\n  MappingBuilder persistent();\n\n  MappingBuilder persistent(boolean persistent);\n\n  MappingBuilder withBasicAuth(String username, String password);\n\n  MappingBuilder withCookie(String name, StringValuePattern cookieValuePattern);\n\n  <P> MappingBuilder withPostServeAction(String extensionName, P parameters);\n\n  default <P> MappingBuilder withServeEventListener(\n      ServeEventListener.RequestPhase requestPhase, String extensionName, P parameters) {\n    return withServeEventListener(Set.of(requestPhase), extensionName, parameters);\n  }\n\n  <P> MappingBuilder withServeEventListener(\n      Set<ServeEventListener.RequestPhase> requestPhases, String extensionName, P parameters);\n\n  <P> MappingBuilder withServeEventListener(String extensionName, P parameters);\n\n  MappingBuilder withMetadata(Map<String, ?> metadata);\n\n  MappingBuilder withMetadata(Metadata metadata);\n\n  MappingBuilder withMetadata(Metadata.Builder metadata);\n\n  MappingBuilder andMatching(ValueMatcher<Request> requestMatcher);\n\n  MappingBuilder andMatching(String customRequestMatcherName);\n\n  MappingBuilder andMatching(String customRequestMatcherName, Parameters parameters);\n\n  MappingBuilder andMatching(CustomMatcherDefinition matcherDefinition);\n\n  MappingBuilder willReturn(ResponseDefinitionBuilder responseDefBuilder);\n\n  StubMapping build();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/MessageStubMappingBuilder.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.MessageAction;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport java.util.Map;\nimport java.util.UUID;\n\n/** Builder interface for creating message stub mappings using a fluent DSL. */\npublic interface MessageStubMappingBuilder {\n\n  /**\n   * Sets the unique identifier for this message stub mapping.\n   *\n   * @param id the UUID to assign\n   * @return this builder\n   */\n  MessageStubMappingBuilder withId(UUID id);\n\n  /**\n   * Sets a human-readable name for this message stub mapping.\n   *\n   * @param name the name to assign\n   * @return this builder\n   */\n  MessageStubMappingBuilder withName(String name);\n\n  /**\n   * Sets the priority for this message stub mapping. Lower numbers indicate higher priority.\n   *\n   * @param priority the priority value\n   * @return this builder\n   */\n  MessageStubMappingBuilder atPriority(Integer priority);\n\n  /**\n   * Sets a pattern to match the message content.\n   *\n   * @param messagePattern the pattern to match against incoming messages\n   * @return this builder\n   */\n  MessageStubMappingBuilder withMessageBody(StringValuePattern messagePattern);\n\n  /**\n   * Sets metadata for this message stub mapping.\n   *\n   * @param metadata the metadata map\n   * @return this builder\n   */\n  MessageStubMappingBuilder withMetadata(Map<String, ?> metadata);\n\n  /**\n   * Sets metadata for this message stub mapping.\n   *\n   * @param metadata the metadata object\n   * @return this builder\n   */\n  MessageStubMappingBuilder withMetadata(Metadata metadata);\n\n  /**\n   * Sets metadata for this message stub mapping.\n   *\n   * @param metadata the metadata builder\n   * @return this builder\n   */\n  MessageStubMappingBuilder withMetadata(Metadata.Builder metadata);\n\n  /**\n   * Configures the actions to trigger when this stub matches. This method terminates the builder\n   * chain and returns the built MessageStubMapping.\n   *\n   * @param actions the actions to execute when matched\n   * @return the built MessageStubMapping\n   */\n  MessageStubMapping willTriggerActions(MessageAction... actions);\n\n  /**\n   * Builds the MessageStubMapping from the current builder state.\n   *\n   * @return the built MessageStubMapping\n   */\n  MessageStubMapping build();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/ResponseDefinitionBuilder.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.*;\nimport static java.net.HttpURLConnection.HTTP_OK;\nimport static java.util.Arrays.asList;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.util.*;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.Path;\n\n@SuppressWarnings(\"UnusedReturnValue\")\npublic class ResponseDefinitionBuilder {\n\n  protected final ResponseDefinition.Builder builder;\n\n  public ResponseDefinitionBuilder() {\n    this(new ResponseDefinition.Builder());\n  }\n\n  private ResponseDefinitionBuilder(ResponseDefinition.Builder builder) {\n    this.builder = builder;\n  }\n\n  public static ResponseDefinitionBuilder like(ResponseDefinition responseDefinition) {\n    return new ResponseDefinitionBuilder(responseDefinition.toBuilder());\n  }\n\n  public static ResponseDefinition jsonResponse(Object body) {\n    return jsonResponse(body, HTTP_OK);\n  }\n\n  public static ResponseDefinition jsonResponse(Object body, int status) {\n    return new ResponseDefinitionBuilder()\n        .withBody(Json.write(body))\n        .withStatus(status)\n        .withHeader(CONTENT_TYPE, APPLICATION_JSON)\n        .build();\n  }\n\n  public ResponseDefinitionBuilder but() {\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withStatus(int status) {\n    builder.setStatus(status);\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withHeader(String key, String... values) {\n    builder.headers(builder -> builder.add(key, values));\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withBodyFile(String fileName) {\n    builder.setBodyFileName(fileName);\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withBody(String body) {\n    builder.setBody(Body.fromOneOf(null, body, null, null));\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withBody(byte[] body) {\n    builder.setBody(Body.fromOneOf(body, null, null, null));\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withResponseBody(Body body) {\n    builder.setBody(body);\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withJsonBody(JsonNode jsonBody) {\n    builder.setBody(Body.fromOneOf(null, null, jsonBody, null));\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withFixedDelay(Integer milliseconds) {\n    builder.setFixedDelayMilliseconds(milliseconds);\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withRandomDelay(DelayDistribution distribution) {\n    builder.setDelayDistribution(distribution);\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withLogNormalRandomDelay(\n      double medianMilliseconds, double sigma) {\n    return withLogNormalRandomDelay(medianMilliseconds, sigma, null);\n  }\n\n  public ResponseDefinitionBuilder withLogNormalRandomDelay(\n      double medianMilliseconds, double sigma, Double maxValue) {\n    return withRandomDelay(new LogNormal(medianMilliseconds, sigma, maxValue));\n  }\n\n  public ResponseDefinitionBuilder withUniformRandomDelay(\n      int lowerMilliseconds, int upperMilliseconds) {\n    return withRandomDelay(new UniformDistribution(lowerMilliseconds, upperMilliseconds));\n  }\n\n  public ResponseDefinitionBuilder withChunkedDribbleDelay(int numberOfChunks, int totalDuration) {\n    builder.setChunkedDribbleDelay(new ChunkedDribbleDelay(numberOfChunks, totalDuration));\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withTransformers(String... responseTransformerNames) {\n    builder.setTransformers(asList(responseTransformerNames));\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withTransformerParameters(Map<String, Object> parameters) {\n    builder.setTransformerParameters(\n        builder.getTransformerParameters().merge(Parameters.from(parameters)));\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withTransformerParameter(String name, Object value) {\n    return withTransformerParameters(Map.of(name, value));\n  }\n\n  public ResponseDefinitionBuilder withTransformer(\n      String transformerName, String parameterKey, Object parameterValue) {\n    withTransformers(transformerName);\n    withTransformerParameter(parameterKey, parameterValue);\n    return this;\n  }\n\n  public ProxyResponseDefinitionBuilder proxiedFrom(String proxyBaseUrl) {\n    builder.setProxyBaseUrl(proxyBaseUrl);\n    return new ProxyResponseDefinitionBuilder(this);\n  }\n\n  public ResponseDefinitionBuilder withGzipDisabled(boolean gzipDisabled) {\n    if (gzipDisabled) {\n      withHeader(CONTENT_ENCODING, \"none\");\n    }\n    return this;\n  }\n\n  public static ResponseDefinitionBuilder responseDefinition() {\n    return new ResponseDefinitionBuilder();\n  }\n\n  public static <T> ResponseDefinitionBuilder okForJson(T body) {\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(Json.write(body))\n        .withHeader(CONTENT_TYPE, APPLICATION_JSON);\n  }\n\n  public static <T> ResponseDefinitionBuilder okForEmptyJson() {\n    return responseDefinition()\n        .withStatus(HTTP_OK)\n        .withBody(\"{}\")\n        .withHeader(CONTENT_TYPE, APPLICATION_JSON);\n  }\n\n  public ResponseDefinitionBuilder withHeaders(HttpHeaders headers) {\n    builder.setHeaders(headers);\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withBase64Body(String base64Body) {\n    builder.setBody(Body.fromOneOf(null, null, null, base64Body));\n    return this;\n  }\n\n  public ResponseDefinitionBuilder withStatusMessage(String message) {\n    builder.setStatusMessage(message);\n    return this;\n  }\n\n  public static class ProxyResponseDefinitionBuilder extends ResponseDefinitionBuilder {\n\n    public ProxyResponseDefinitionBuilder(ResponseDefinitionBuilder from) {\n      super(from.builder);\n    }\n\n    public ProxyResponseDefinitionBuilder withAdditionalRequestHeader(String key, String value) {\n      builder.setAdditionalProxyRequestHeaders(\n          builder.getAdditionalProxyRequestHeaders().plus(new HttpHeader(key, value)));\n      return this;\n    }\n\n    public ProxyResponseDefinitionBuilder withAdditionalRequestHeaders(HttpHeaders headers) {\n      builder.setAdditionalProxyRequestHeaders(headers);\n      return this;\n    }\n\n    public ProxyResponseDefinitionBuilder withRemoveRequestHeader(String key) {\n      builder.getRemoveProxyRequestHeaders().add(key.toLowerCase());\n      return this;\n    }\n\n    public ProxyResponseDefinitionBuilder withRemoveRequestHeaders(List<String> keys) {\n      builder.setRemoveProxyRequestHeaders(keys);\n      return this;\n    }\n\n    public ProxyResponseDefinitionBuilder withProxyUrlPrefixToRemove(\n        String proxyUrlPrefixToRemove) {\n      builder.setProxyUrlPrefixToRemove(proxyUrlPrefixToRemove);\n      return this;\n    }\n\n    @Override\n    public ResponseDefinition build() {\n      return super.build(\n          builder.getAdditionalProxyRequestHeaders(),\n          builder.getRemoveProxyRequestHeaders(),\n          builder.getProxyUrlPrefixToRemove());\n    }\n  }\n\n  public ResponseDefinitionBuilder withFault(Fault fault) {\n    builder.setFault(fault);\n    return this;\n  }\n\n  public ResponseDefinition build() {\n    return build(new HttpHeaders(), List.of(), null);\n  }\n\n  protected ResponseDefinition build(\n      HttpHeaders additionalProxyRequestHeaders,\n      List<String> removeProxyRequestHeaders,\n      @Nullable Path proxyUrlPrefixToRemove) {\n    return builder\n        .setAdditionalProxyRequestHeaders(additionalProxyRequestHeaders)\n        .setRemoveProxyRequestHeaders(removeProxyRequestHeaders)\n        .setProxyUrlPrefixToRemove(proxyUrlPrefixToRemove)\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/ScenarioMappingBuilder.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListener;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.ContentPattern;\nimport com.github.tomakehurst.wiremock.matching.MultiValuePattern;\nimport com.github.tomakehurst.wiremock.matching.MultipartValuePatternBuilder;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.matching.ValueMatcher;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.UUID;\n\npublic interface ScenarioMappingBuilder extends MappingBuilder {\n\n  ScenarioMappingBuilder whenScenarioStateIs(String stateName);\n\n  ScenarioMappingBuilder willSetStateTo(String stateName);\n\n  ScenarioMappingBuilder atPriority(Integer priority);\n\n  ScenarioMappingBuilder withHeader(String key, StringValuePattern headerPattern);\n\n  ScenarioMappingBuilder withHeader(String key, MultiValuePattern headerPattern);\n\n  ScenarioMappingBuilder withQueryParam(String key, StringValuePattern queryParamPattern);\n\n  ScenarioMappingBuilder withQueryParam(String key, MultiValuePattern queryParamPattern);\n\n  ScenarioMappingBuilder withFormParam(String key, StringValuePattern formParamPattern);\n\n  ScenarioMappingBuilder withFormParam(String key, MultiValuePattern formParamPattern);\n\n  ScenarioMappingBuilder withFormParams(Map<String, MultiValuePattern> formParams);\n\n  ScenarioMappingBuilder withQueryParams(Map<String, StringValuePattern> queryParams);\n\n  ScenarioMappingBuilder withRequestBody(ContentPattern<?> bodyPattern);\n\n  ScenarioMappingBuilder withMultipartRequestBody(\n      MultipartValuePatternBuilder multipartPatternBuilder);\n\n  ScenarioMappingBuilder inScenario(String scenarioName);\n\n  ScenarioMappingBuilder withId(UUID id);\n\n  ScenarioMappingBuilder persistent();\n\n  ScenarioMappingBuilder persistent(boolean persistent);\n\n  ScenarioMappingBuilder withBasicAuth(String username, String password);\n\n  ScenarioMappingBuilder withCookie(String name, StringValuePattern cookieValuePattern);\n\n  <P> ScenarioMappingBuilder withPostServeAction(String extensionName, P parameters);\n\n  <P> MappingBuilder withServeEventListener(\n      Set<ServeEventListener.RequestPhase> requestPhases, String extensionName, P parameters);\n\n  <P> MappingBuilder withServeEventListener(String extensionName, P parameters);\n\n  ScenarioMappingBuilder withMetadata(Map<String, ?> metadata);\n\n  ScenarioMappingBuilder withMetadata(Metadata metadata);\n\n  ScenarioMappingBuilder withMetadata(Metadata.Builder metadata);\n\n  ScenarioMappingBuilder andMatching(ValueMatcher<Request> requestMatcher);\n\n  ScenarioMappingBuilder willReturn(ResponseDefinitionBuilder responseDefBuilder);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/VerificationException.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.github.tomakehurst.wiremock.verification.NearMiss;\nimport com.github.tomakehurst.wiremock.verification.diff.Diff;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class VerificationException extends AssertionError {\n\n  private static final long serialVersionUID = 5116216532516117538L;\n\n  public VerificationException(String message) {\n    super(message);\n  }\n\n  public static VerificationException forUnmatchedRequestPattern(Diff diff) {\n    return new VerificationException(\n        \"No requests exactly matched. Most similar request was:\", diff);\n  }\n\n  public static VerificationException forSingleUnmatchedRequest(Diff diff) {\n    return new VerificationException(\n        \"A request was unmatched by any stub mapping. Closest stub mapping was:\", diff);\n  }\n\n  public static VerificationException forUnmatchedNearMisses(List<NearMiss> nearMisses) {\n    if (nearMisses.size() == 1) {\n      return forSingleUnmatchedRequest(nearMisses.get(0).getDiff());\n    }\n\n    return new VerificationException(\n        nearMisses.size()\n            + \" requests were unmatched by any stub mapping. Shown with closest stub mappings:\\n\"\n            + renderList(nearMisses));\n  }\n\n  private static String renderList(List<?> list) {\n    return list.stream().map(Object::toString).collect(Collectors.joining(\"\\n\\n\"));\n  }\n\n  private VerificationException(String messageStart, Diff diff) {\n    super(messageStart + \" \" + diff.toString());\n  }\n\n  public VerificationException(RequestPattern expected, List<LoggedRequest> requests) {\n    super(\n        String.format(\n            \"Expected at least one request matching: %s\\nRequests received: %s\",\n            expected.toString(), Json.write(requests)));\n  }\n\n  public VerificationException(RequestPattern expected, int expectedCount, int actualCount) {\n    super(\n        String.format(\n            \"Expected exactly %d requests matching the following pattern but received %d:\\n%s\",\n            expectedCount, actualCount, expected.toString()));\n  }\n\n  public VerificationException(\n      RequestPattern expected, CountMatchingStrategy expectedCount, int actualCount) {\n    super(\n        String.format(\n            \"Expected %s requests matching the following pattern but received %d:\\n%s\",\n            expectedCount.toString().toLowerCase(), actualCount, expected.toString()));\n  }\n\n  public static VerificationException forUnmatchedRequests(List<LoggedRequest> unmatchedRequests) {\n    if (unmatchedRequests.size() == 1) {\n      return new VerificationException(\n          String.format(\n              \"A request was unmatched by any stub \" + \"mapping. Request was: %s\",\n              unmatchedRequests.get(0)));\n    }\n\n    return new VerificationException(\n        unmatchedRequests.size()\n            + \" requests were unmatched by any stub mapping. Requests are:\\n\"\n            + renderList(unmatchedRequests));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/WireMock.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_TYPE;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.LOCATION;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.*;\nimport static com.github.tomakehurst.wiremock.matching.RequestPattern.thatMatch;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.allRequests;\n\nimport com.github.tomakehurst.wiremock.admin.model.ListMessageChannelsResult;\nimport com.github.tomakehurst.wiremock.admin.model.ListMessageStubMappingsResult;\nimport com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult;\nimport com.github.tomakehurst.wiremock.admin.model.ServeEventQuery;\nimport com.github.tomakehurst.wiremock.admin.model.SingleStubMappingResult;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.DelayDistribution;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.matching.*;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.message.SendMessageActionBuilder;\nimport com.github.tomakehurst.wiremock.recording.RecordSpec;\nimport com.github.tomakehurst.wiremock.recording.RecordSpecBuilder;\nimport com.github.tomakehurst.wiremock.recording.RecordingStatusResult;\nimport com.github.tomakehurst.wiremock.recording.SnapshotRecordResult;\nimport com.github.tomakehurst.wiremock.standalone.RemoteMappingsLoader;\nimport com.github.tomakehurst.wiremock.store.InMemorySettingsStore;\nimport com.github.tomakehurst.wiremock.store.SettingsStore;\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubImportBuilder;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.verification.FindMessageServeEventsResult;\nimport com.github.tomakehurst.wiremock.verification.FindNearMissesResult;\nimport com.github.tomakehurst.wiremock.verification.FindRequestsResult;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport com.github.tomakehurst.wiremock.verification.NearMiss;\nimport com.github.tomakehurst.wiremock.verification.VerificationResult;\nimport com.github.tomakehurst.wiremock.verification.diff.Diff;\nimport com.networknt.schema.SpecVersion;\nimport java.io.File;\nimport java.time.Duration;\nimport java.time.LocalDateTime;\nimport java.time.ZonedDateTime;\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.wiremock.url.Path;\nimport org.wiremock.url.PathAndQuery;\n\n@SuppressWarnings(\"unused\")\npublic class WireMock {\n\n  private static final int DEFAULT_PORT = 8080;\n  private static final String DEFAULT_HOST = \"localhost\";\n\n  private final Admin admin;\n\n  private final SettingsStore settingsStore = new InMemorySettingsStore();\n\n  private static final InheritableThreadLocal<WireMock> defaultInstance =\n      new InheritableThreadLocal<>() {\n        @Override\n        protected WireMock initialValue() {\n          return WireMock.create().build();\n        }\n      };\n\n  public static WireMockBuilder create() {\n    return new WireMockBuilder();\n  }\n\n  public WireMock(Admin admin) {\n    this.admin = admin;\n  }\n\n  public WireMock(int port) {\n    this(WireMock.create().port(port).buildAdminClient());\n  }\n\n  public static StubMapping givenThat(MappingBuilder mappingBuilder) {\n    return defaultInstance.get().register(mappingBuilder);\n  }\n\n  public static StubMapping stubFor(MappingBuilder mappingBuilder) {\n    return givenThat(mappingBuilder);\n  }\n\n  public static void editStub(MappingBuilder mappingBuilder) {\n    defaultInstance.get().editStubMapping(mappingBuilder);\n  }\n\n  public static void removeStub(MappingBuilder mappingBuilder) {\n    defaultInstance.get().removeStubMapping(mappingBuilder);\n  }\n\n  public static void removeStub(StubMapping stubMapping) {\n    defaultInstance.get().removeStubMapping(stubMapping);\n  }\n\n  public static void removeStub(UUID id) {\n    defaultInstance.get().removeStubMapping(id);\n  }\n\n  public static ListStubMappingsResult listAllStubMappings() {\n    return defaultInstance.get().allStubMappings();\n  }\n\n  public static StubMapping getSingleStubMapping(UUID id) {\n    return defaultInstance.get().getStubMapping(id).getItem();\n  }\n\n  public static void configureFor(int port) {\n    defaultInstance.set(WireMock.create().port(port).build());\n  }\n\n  public static void configureFor(String host, int port) {\n    defaultInstance.set(WireMock.create().host(host).port(port).build());\n  }\n\n  public static void configureFor(String host, int port, String urlPathPrefix) {\n    defaultInstance.set(\n        WireMock.create().host(host).port(port).urlPathPrefix(urlPathPrefix).build());\n  }\n\n  public static void configureFor(String scheme, String host, int port, String urlPathPrefix) {\n    defaultInstance.set(\n        WireMock.create()\n            .scheme(scheme)\n            .host(host)\n            .port(port)\n            .urlPathPrefix(urlPathPrefix)\n            .build());\n  }\n\n  public static void configureFor(String scheme, String host, int port) {\n    defaultInstance.set(WireMock.create().scheme(scheme).host(host).port(port).build());\n  }\n\n  public static void configureFor(\n      String scheme, String host, int port, String proxyHost, int proxyPort) {\n    defaultInstance.set(\n        WireMock.create()\n            .scheme(scheme)\n            .host(host)\n            .port(port)\n            .urlPathPrefix(\"\")\n            .hostHeader(null)\n            .proxyHost(proxyHost)\n            .proxyPort(proxyPort)\n            .build());\n  }\n\n  public static void configureFor(WireMock client) {\n    defaultInstance.set(client);\n  }\n\n  public static void configure() {\n    defaultInstance.set(WireMock.create().build());\n  }\n\n  public static StringValuePattern equalTo(String value) {\n    return new EqualToPattern(value);\n  }\n\n  public static StringValuePattern equalToNumber(Number value) {\n    return new EqualToNumberPattern(value);\n  }\n\n  public static StringValuePattern greaterThanNumber(Number value) {\n    return new GreaterThanNumberPattern(value);\n  }\n\n  public static StringValuePattern greaterThanEqualNumber(Number value) {\n    return new GreaterThanEqualNumberPattern(value);\n  }\n\n  public static StringValuePattern lessThanNumber(Number value) {\n    return new LessThanNumberPattern(value);\n  }\n\n  public static StringValuePattern lessThanEqualNumber(Number value) {\n    return new LessThanEqualNumberPattern(value);\n  }\n\n  public static BinaryEqualToPattern binaryEqualTo(byte[] content) {\n    return new BinaryEqualToPattern(content);\n  }\n\n  public static BinaryEqualToPattern binaryEqualTo(String content) {\n    return new BinaryEqualToPattern(content);\n  }\n\n  public static StringValuePattern equalToIgnoreCase(String value) {\n    return new EqualToPattern(value, true);\n  }\n\n  public static StringValuePattern equalToJson(String value) {\n    return new EqualToJsonPattern(value, null, null);\n  }\n\n  public static StringValuePattern equalToJson(\n      String value, boolean ignoreArrayOrder, boolean ignoreExtraElements) {\n    return new EqualToJsonPattern(value, ignoreArrayOrder, ignoreExtraElements);\n  }\n\n  public static StringValuePattern matchingJsonPath(String value) {\n    return new MatchesJsonPathPattern(value);\n  }\n\n  public static StringValuePattern matchingJsonPath(String value, StringValuePattern valuePattern) {\n    return new MatchesJsonPathPattern(value, valuePattern);\n  }\n\n  public static StringValuePattern matchingJsonSchema(String schema) {\n    return new MatchesJsonSchemaPattern(schema);\n  }\n\n  public static StringValuePattern matchingJsonSchema(\n      String schema, JsonSchemaVersion jsonSchemaVersion) {\n    return new MatchesJsonSchemaPattern(schema, jsonSchemaVersion);\n  }\n\n  public static EqualToXmlPattern equalToXml(String value) {\n    return new EqualToXmlPattern(value);\n  }\n\n  public static EqualToXmlPattern equalToXml(\n      String value, EqualToXmlPattern.NamespaceAwareness namespaceAwareness) {\n    return new EqualToXmlPattern(value, null, null, null, null, null, namespaceAwareness);\n  }\n\n  public static EqualToXmlPattern equalToXml(String value, boolean enablePlaceholders) {\n    return equalToXml(value, enablePlaceholders, false);\n  }\n\n  public static EqualToXmlPattern equalToXml(\n      String value, boolean enablePlaceholders, boolean ignoreOrderOfSameNode) {\n    return new EqualToXmlPattern(value, enablePlaceholders, ignoreOrderOfSameNode);\n  }\n\n  public static EqualToXmlPattern equalToXml(\n      String value,\n      boolean enablePlaceholders,\n      String placeholderOpeningDelimiterRegex,\n      String placeholderClosingDelimiterRegex) {\n    return equalToXml(\n        value,\n        enablePlaceholders,\n        placeholderOpeningDelimiterRegex,\n        placeholderClosingDelimiterRegex,\n        false);\n  }\n\n  public static EqualToXmlPattern equalToXml(\n      String value,\n      boolean enablePlaceholders,\n      String placeholderOpeningDelimiterRegex,\n      String placeholderClosingDelimiterRegex,\n      boolean ignoreOrderOfSameNode) {\n    return equalToXml(\n        value,\n        enablePlaceholders,\n        placeholderOpeningDelimiterRegex,\n        placeholderClosingDelimiterRegex,\n        ignoreOrderOfSameNode,\n        null);\n  }\n\n  public static EqualToXmlPattern equalToXml(\n      String value,\n      boolean enablePlaceholders,\n      String placeholderOpeningDelimiterRegex,\n      String placeholderClosingDelimiterRegex,\n      boolean ignoreOrderOfSameNode,\n      EqualToXmlPattern.NamespaceAwareness namespaceAwareness) {\n    return new EqualToXmlPattern(\n        value,\n        enablePlaceholders,\n        placeholderOpeningDelimiterRegex,\n        placeholderClosingDelimiterRegex,\n        null,\n        ignoreOrderOfSameNode,\n        namespaceAwareness);\n  }\n\n  public static MatchesXPathPattern matchingXPath(String value) {\n    return new MatchesXPathPattern(value, Collections.emptyMap());\n  }\n\n  public static StringValuePattern matchingXPath(String value, Map<String, String> namespaces) {\n    return new MatchesXPathPattern(value, namespaces);\n  }\n\n  public static StringValuePattern matchingXPath(String value, StringValuePattern valuePattern) {\n    return new MatchesXPathPattern(value, valuePattern);\n  }\n\n  // Use this with the date/time matchers to avoid an explicit cast\n  public static MatchesXPathPattern matchesXPathWithSubMatcher(\n      String value, StringValuePattern valuePattern) {\n    return new MatchesXPathPattern(value, valuePattern);\n  }\n\n  public static StringValuePattern containing(String value) {\n    return new ContainsPattern(value);\n  }\n\n  public static StringValuePattern notContaining(String value) {\n    return new NegativeContainsPattern(value);\n  }\n\n  public static StringValuePattern not(StringValuePattern unexpectedPattern) {\n    return new NotPattern(unexpectedPattern);\n  }\n\n  public static StringValuePattern matching(String regex) {\n    return new RegexPattern(regex);\n  }\n\n  public static StringValuePattern notMatching(String regex) {\n    return new NegativeRegexPattern(regex);\n  }\n\n  public static BeforeDateTimePattern before(String dateTimeSpec) {\n    return new BeforeDateTimePattern(dateTimeSpec);\n  }\n\n  public static BeforeDateTimePattern before(ZonedDateTime dateTime) {\n    return new BeforeDateTimePattern(dateTime);\n  }\n\n  public static BeforeDateTimePattern before(LocalDateTime dateTime) {\n    return new BeforeDateTimePattern(dateTime);\n  }\n\n  public static BeforeDateTimePattern beforeNow() {\n    return new BeforeDateTimePattern(\"now\");\n  }\n\n  public static EqualToDateTimePattern equalToDateTime(String dateTimeSpec) {\n    return new EqualToDateTimePattern(dateTimeSpec);\n  }\n\n  public static EqualToDateTimePattern equalToDateTime(ZonedDateTime dateTime) {\n    return new EqualToDateTimePattern(dateTime);\n  }\n\n  public static EqualToDateTimePattern equalToDateTime(LocalDateTime dateTime) {\n    return new EqualToDateTimePattern(dateTime);\n  }\n\n  public static EqualToDateTimePattern isNow() {\n    return new EqualToDateTimePattern(\"now\");\n  }\n\n  public static AfterDateTimePattern after(String dateTimeSpec) {\n    return new AfterDateTimePattern(dateTimeSpec);\n  }\n\n  public static AfterDateTimePattern after(ZonedDateTime dateTime) {\n    return new AfterDateTimePattern(dateTime);\n  }\n\n  public static AfterDateTimePattern after(LocalDateTime dateTime) {\n    return new AfterDateTimePattern(dateTime);\n  }\n\n  public static AfterDateTimePattern afterNow() {\n    return new AfterDateTimePattern(\"now\");\n  }\n\n  public static StringValuePattern absent() {\n    return AbsentPattern.ABSENT;\n  }\n\n  public static StringValuePattern and(StringValuePattern... matchers) {\n    return new LogicalAnd(matchers);\n  }\n\n  public static StringValuePattern or(StringValuePattern... matchers) {\n    return new LogicalOr(matchers);\n  }\n\n  public void saveMappings() {\n    admin.saveMappings();\n  }\n\n  public static void saveAllMappings() {\n    defaultInstance.get().saveMappings();\n  }\n\n  public void removeMappings() {\n    admin.resetMappings();\n  }\n\n  public static void removeAllMappings() {\n    defaultInstance.get().removeMappings();\n  }\n\n  public void resetMappings() {\n    admin.resetAll();\n  }\n\n  public static void reset() {\n    defaultInstance.get().resetMappings();\n  }\n\n  public static void resetAllRequests() {\n    defaultInstance.get().resetRequests();\n  }\n\n  public void resetRequests() {\n    admin.resetRequests();\n  }\n\n  public void resetScenarios() {\n    admin.resetScenarios();\n  }\n\n  public static void resetScenario(String name) {\n    defaultInstance.get().resetScenarioState(name);\n  }\n\n  public void resetScenarioState(String name) {\n    admin.resetScenario(name);\n  }\n\n  public static void setScenarioState(String name, String state) {\n    defaultInstance.get().setSingleScenarioState(name, state);\n  }\n\n  public void setSingleScenarioState(String name, String state) {\n    admin.setScenarioState(name, state);\n  }\n\n  public static List<Scenario> getAllScenarios() {\n    return defaultInstance.get().getScenarios();\n  }\n\n  public List<Scenario> getScenarios() {\n    return admin.getAllScenarios().getScenarios();\n  }\n\n  public static void resetAllScenarios() {\n    defaultInstance.get().resetScenarios();\n  }\n\n  public void resetToDefaultMappings() {\n    admin.resetToDefaultMappings();\n  }\n\n  public static void resetToDefault() {\n    defaultInstance.get().resetToDefaultMappings();\n  }\n\n  public StubMapping register(MappingBuilder mappingBuilder) {\n    StubMapping mapping = mappingBuilder.build();\n    register(mapping);\n    return mapping;\n  }\n\n  public void register(StubMapping mapping) {\n    admin.addStubMapping(mapping);\n  }\n\n  public void editStubMapping(MappingBuilder mappingBuilder) {\n    admin.editStubMapping(mappingBuilder.build());\n  }\n\n  public void removeStubMapping(MappingBuilder mappingBuilder) {\n    admin.removeStubMapping(mappingBuilder.build());\n  }\n\n  public void removeStubMapping(StubMapping stubMapping) {\n    admin.removeStubMapping(stubMapping);\n  }\n\n  public void removeStubMapping(UUID id) {\n    admin.removeStubMapping(id);\n  }\n\n  public ListStubMappingsResult allStubMappings() {\n    return admin.listAllStubMappings();\n  }\n\n  public SingleStubMappingResult getStubMapping(UUID id) {\n    return admin.getStubMapping(id);\n  }\n\n  public static UrlPattern urlEqualTo(PathAndQuery testUrl) {\n    return urlEqualTo(testUrl.toString());\n  }\n\n  public static UrlPattern urlEqualTo(String testUrl) {\n    return new UrlPattern(equalTo(testUrl), false);\n  }\n\n  public static UrlPattern urlMatching(String urlRegex) {\n    return new UrlPattern(matching(urlRegex), true);\n  }\n\n  public static UrlPathPattern urlPathEqualTo(Path testUrl) {\n    return urlPathEqualTo(testUrl.toString());\n  }\n\n  public static UrlPathPattern urlPathEqualTo(String testUrl) {\n    return new UrlPathPattern(equalTo(testUrl), false);\n  }\n\n  public static UrlPathPattern urlPathMatching(String urlRegex) {\n    return new UrlPathPattern(matching(urlRegex), true);\n  }\n\n  public static UrlPathPattern urlPathTemplate(String pathTemplate) {\n    return new UrlPathTemplatePattern(pathTemplate);\n  }\n\n  public static MultiValuePattern havingExactly(final StringValuePattern... valuePatterns) {\n    if (valuePatterns.length == 0) {\n      return noValues();\n    }\n    return new ExactMatchMultiValuePattern(Stream.of(valuePatterns).collect(Collectors.toList()));\n  }\n\n  public static MultiValuePattern havingExactly(String... values) {\n    return havingExactly(Stream.of(values).map(EqualToPattern::new).toArray(EqualToPattern[]::new));\n  }\n\n  public static MultiValuePattern including(final StringValuePattern... valuePatterns) {\n    if (valuePatterns.length == 0) {\n      return noValues();\n    }\n    return new IncludesMatchMultiValuePattern(\n        Stream.of(valuePatterns).collect(Collectors.toList()));\n  }\n\n  public static MultiValuePattern including(String... values) {\n    return including(Stream.of(values).map(EqualToPattern::new).toArray(EqualToPattern[]::new));\n  }\n\n  public static MultiValuePattern noValues() {\n    return MultiValuePattern.of(absent());\n  }\n\n  public static UrlPattern anyUrl() {\n    return UrlPattern.ANY;\n  }\n\n  public static CountMatchingStrategy lessThan(int expected) {\n    return new CountMatchingStrategy(CountMatchingStrategy.LESS_THAN, expected);\n  }\n\n  public static CountMatchingStrategy lessThanOrExactly(int expected) {\n    return new CountMatchingStrategy(CountMatchingStrategy.LESS_THAN_OR_EQUAL, expected);\n  }\n\n  public static CountMatchingStrategy exactly(int expected) {\n    return new CountMatchingStrategy(CountMatchingStrategy.EQUAL_TO, expected);\n  }\n\n  public static CountMatchingStrategy moreThanOrExactly(int expected) {\n    return new CountMatchingStrategy(CountMatchingStrategy.GREATER_THAN_OR_EQUAL, expected);\n  }\n\n  public static CountMatchingStrategy moreThan(int expected) {\n    return new CountMatchingStrategy(CountMatchingStrategy.GREATER_THAN, expected);\n  }\n\n  public static MappingBuilder get(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(GET, urlPattern);\n  }\n\n  public static MappingBuilder post(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.POST, urlPattern);\n  }\n\n  public static MappingBuilder put(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.PUT, urlPattern);\n  }\n\n  public static MappingBuilder delete(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.DELETE, urlPattern);\n  }\n\n  public static MappingBuilder patch(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.PATCH, urlPattern);\n  }\n\n  public static MappingBuilder head(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.HEAD, urlPattern);\n  }\n\n  public static MappingBuilder options(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.OPTIONS, urlPattern);\n  }\n\n  public static MappingBuilder trace(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.TRACE, urlPattern);\n  }\n\n  public static MappingBuilder any(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.ANY, urlPattern);\n  }\n\n  public static MappingBuilder query(UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.QUERY, urlPattern);\n  }\n\n  /**\n   * A mapping builder that can be used for both GET and HEAD http method. Returns a response body\n   * in case for GET and not in case of HEAD method. In case of tie the request is treated as a GET\n   * request\n   *\n   * @param urlPattern for the specified method\n   * @return a mapping builder for {@link RequestMethod#GET_OR_HEAD} http method\n   */\n  public static MappingBuilder getOrHead(UrlPattern urlPattern) {\n    return request(isOneOf(GET, HEAD), urlPattern);\n  }\n\n  public static MappingBuilder request(String method, UrlPattern urlPattern) {\n    return new BasicMappingBuilder(RequestMethod.fromString(method), urlPattern);\n  }\n\n  public static MappingBuilder request(RequestMethod method, UrlPattern urlPattern) {\n    return new BasicMappingBuilder(method, urlPattern);\n  }\n\n  public static MappingBuilder requestMatching(String customRequestMatcherName) {\n    return new BasicMappingBuilder(customRequestMatcherName, Parameters.empty());\n  }\n\n  public static MappingBuilder requestMatching(\n      String customRequestMatcherName, Parameters parameters) {\n    return new BasicMappingBuilder(customRequestMatcherName, parameters);\n  }\n\n  public static MappingBuilder requestMatching(ValueMatcher<Request> requestMatcher) {\n    return new BasicMappingBuilder(requestMatcher);\n  }\n\n  public static ResponseDefinitionBuilder aResponse() {\n    return new ResponseDefinitionBuilder();\n  }\n\n  public static ResponseDefinitionBuilder ok() {\n    return aResponse().withStatus(200);\n  }\n\n  public static ResponseDefinitionBuilder ok(String body) {\n    return aResponse().withStatus(200).withBody(body);\n  }\n\n  public static ResponseDefinitionBuilder okForContentType(String contentType, String body) {\n    return aResponse().withStatus(200).withHeader(CONTENT_TYPE, contentType).withBody(body);\n  }\n\n  public static ResponseDefinitionBuilder okJson(String body) {\n    return okForContentType(\"application/json\", body);\n  }\n\n  public static ResponseDefinitionBuilder okXml(String body) {\n    return okForContentType(\"application/xml\", body);\n  }\n\n  public static ResponseDefinitionBuilder okTextXml(String body) {\n    return okForContentType(\"text/xml\", body);\n  }\n\n  public static ResponseDefinitionBuilder jsonResponse(String body, int status) {\n    return aResponse()\n        .withStatus(status)\n        .withHeader(CONTENT_TYPE, \"application/json\")\n        .withBody(body);\n  }\n\n  public static ResponseDefinitionBuilder jsonResponse(Object body, int status) {\n    return jsonResponse(Json.write(body), status);\n  }\n\n  public static MappingBuilder proxyAllTo(String url) {\n    return any(anyUrl()).willReturn(aResponse().proxiedFrom(url));\n  }\n\n  public static MappingBuilder get(String url) {\n    return get(urlEqualTo(url));\n  }\n\n  public static MappingBuilder post(String url) {\n    return post(urlEqualTo(url));\n  }\n\n  public static MappingBuilder put(String url) {\n    return put(urlEqualTo(url));\n  }\n\n  public static MappingBuilder delete(String url) {\n    return delete(urlEqualTo(url));\n  }\n\n  public static MappingBuilder patch(String url) {\n    return patch(urlEqualTo(url));\n  }\n\n  public static MappingBuilder query(String url) {\n    return query(urlEqualTo(url));\n  }\n\n  public static ResponseDefinitionBuilder created() {\n    return aResponse().withStatus(201);\n  }\n\n  public static ResponseDefinitionBuilder noContent() {\n    return aResponse().withStatus(204);\n  }\n\n  public static ResponseDefinitionBuilder permanentRedirect(String location) {\n    return aResponse().withStatus(301).withHeader(LOCATION, location);\n  }\n\n  public static ResponseDefinitionBuilder temporaryRedirect(String location) {\n    return aResponse().withStatus(302).withHeader(LOCATION, location);\n  }\n\n  public static ResponseDefinitionBuilder seeOther(String location) {\n    return aResponse().withStatus(303).withHeader(LOCATION, location);\n  }\n\n  public static ResponseDefinitionBuilder badRequest() {\n    return aResponse().withStatus(400);\n  }\n\n  public static ResponseDefinitionBuilder badRequestEntity() {\n    return aResponse().withStatus(422);\n  }\n\n  public static ResponseDefinitionBuilder unauthorized() {\n    return aResponse().withStatus(401);\n  }\n\n  public static ResponseDefinitionBuilder forbidden() {\n    return aResponse().withStatus(403);\n  }\n\n  public static ResponseDefinitionBuilder notFound() {\n    return aResponse().withStatus(404);\n  }\n\n  public static ResponseDefinitionBuilder serverError() {\n    return aResponse().withStatus(500);\n  }\n\n  public static ResponseDefinitionBuilder serviceUnavailable() {\n    return aResponse().withStatus(503);\n  }\n\n  public static ResponseDefinitionBuilder status(int status) {\n    return aResponse().withStatus(status);\n  }\n\n  public void verifyThat(RequestPatternBuilder requestPatternBuilder) {\n    verifyThat(moreThanOrExactly(1), requestPatternBuilder);\n  }\n\n  public void verifyThat(int expectedCount, RequestPatternBuilder requestPatternBuilder) {\n    verifyThat(exactly(expectedCount), requestPatternBuilder);\n  }\n\n  public void verifyThat(\n      CountMatchingStrategy expectedCount, RequestPatternBuilder requestPatternBuilder) {\n    final RequestPattern requestPattern = requestPatternBuilder.build();\n\n    int actualCount;\n    if (requestPattern.hasInlineCustomMatcher()) {\n      List<LoggedRequest> requests =\n          admin.findRequestsMatching(RequestPattern.ANYTHING).getRequests();\n      actualCount = (int) requests.stream().filter(thatMatch(requestPattern)).count();\n    } else {\n      VerificationResult result = admin.countRequestsMatching(requestPattern);\n      result.assertRequestJournalEnabled();\n      actualCount = result.getCount();\n    }\n\n    if (!expectedCount.match(actualCount)) {\n      throw actualCount == 0\n          ? verificationExceptionForNearMisses(requestPatternBuilder, requestPattern)\n          : new VerificationException(requestPattern, expectedCount, actualCount);\n    }\n  }\n\n  private VerificationException verificationExceptionForNearMisses(\n      RequestPatternBuilder requestPatternBuilder, RequestPattern requestPattern) {\n    List<NearMiss> nearMisses = findAllNearMissesFor(requestPatternBuilder);\n    if (!nearMisses.isEmpty()) {\n      Diff diff = new Diff(requestPattern, nearMisses.get(0).getRequest());\n      return VerificationException.forUnmatchedRequestPattern(diff);\n    }\n\n    return new VerificationException(requestPattern, find(allRequests()));\n  }\n\n  public static void verify(RequestPatternBuilder requestPatternBuilder) {\n    defaultInstance.get().verifyThat(requestPatternBuilder);\n  }\n\n  public static void verify(int count, RequestPatternBuilder requestPatternBuilder) {\n    defaultInstance.get().verifyThat(count, requestPatternBuilder);\n  }\n\n  public static void verify(\n      CountMatchingStrategy countMatchingStrategy, RequestPatternBuilder requestPatternBuilder) {\n    defaultInstance.get().verifyThat(countMatchingStrategy, requestPatternBuilder);\n  }\n\n  public List<LoggedRequest> find(RequestPatternBuilder requestPatternBuilder) {\n    FindRequestsResult result = admin.findRequestsMatching(requestPatternBuilder.build());\n    result.assertRequestJournalEnabled();\n    return result.getRequests();\n  }\n\n  public static List<LoggedRequest> findAll(RequestPatternBuilder requestPatternBuilder) {\n    return defaultInstance.get().find(requestPatternBuilder);\n  }\n\n  public static List<ServeEvent> getAllServeEvents() {\n    return defaultInstance.get().getServeEvents();\n  }\n\n  public List<ServeEvent> getServeEvents() {\n    return admin.getServeEvents().getRequests();\n  }\n\n  public static List<ServeEvent> getAllServeEvents(ServeEventQuery query) {\n    return defaultInstance.get().getServeEvents(query);\n  }\n\n  public List<ServeEvent> getServeEvents(ServeEventQuery query) {\n    return admin.getServeEvents(query).getRequests();\n  }\n\n  public static void removeServeEvent(UUID eventId) {\n    defaultInstance.get().removeEvent(eventId);\n  }\n\n  public void removeEvent(UUID eventId) {\n    admin.removeServeEvent(eventId);\n  }\n\n  public List<ServeEvent> removeEvents(RequestPatternBuilder requestPatternBuilder) {\n    return admin.removeServeEventsMatching(requestPatternBuilder.build()).getServeEvents();\n  }\n\n  public static List<ServeEvent> removeServeEvents(RequestPatternBuilder requestPatternBuilder) {\n    return defaultInstance.get().removeEvents(requestPatternBuilder);\n  }\n\n  public static List<ServeEvent> removeEventsByStubMetadata(StringValuePattern pattern) {\n    return defaultInstance.get().removeEventsByMetadata(pattern);\n  }\n\n  public List<ServeEvent> removeEventsByMetadata(StringValuePattern pattern) {\n    return admin.removeServeEventsForStubsMatchingMetadata(pattern).getServeEvents();\n  }\n\n  public static RequestPatternBuilder getRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(GET, urlPattern);\n  }\n\n  public static RequestPatternBuilder postRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.POST, urlPattern);\n  }\n\n  public static RequestPatternBuilder putRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.PUT, urlPattern);\n  }\n\n  public static RequestPatternBuilder deleteRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.DELETE, urlPattern);\n  }\n\n  public static RequestPatternBuilder patchRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.PATCH, urlPattern);\n  }\n\n  public static RequestPatternBuilder headRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.HEAD, urlPattern);\n  }\n\n  public static RequestPatternBuilder optionsRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.OPTIONS, urlPattern);\n  }\n\n  public static RequestPatternBuilder traceRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.TRACE, urlPattern);\n  }\n\n  public static RequestPatternBuilder anyRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.ANY, urlPattern);\n  }\n\n  public static RequestPatternBuilder queryRequestedFor(UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.QUERY, urlPattern);\n  }\n\n  public static RequestPatternBuilder requestedFor(String method, UrlPattern urlPattern) {\n    return new RequestPatternBuilder(RequestMethod.fromString(method), urlPattern);\n  }\n\n  public static RequestPatternBuilder requestMadeFor(\n      String customMatcherName, Parameters parameters) {\n    return RequestPatternBuilder.forCustomMatcher(customMatcherName, parameters);\n  }\n\n  public static RequestPatternBuilder requestMadeFor(ValueMatcher<Request> requestMatcher) {\n    return RequestPatternBuilder.forCustomMatcher(requestMatcher);\n  }\n\n  public static void setGlobalFixedDelay(int milliseconds) {\n    defaultInstance.get().setGlobalFixedDelayVariable(milliseconds);\n  }\n\n  public void setGlobalFixedDelayVariable(int milliseconds) {\n    GlobalSettings settings = settingsStore.get().copy().fixedDelay(milliseconds).build();\n    updateGlobalSettings(settings);\n  }\n\n  public static void setGlobalRandomDelay(DelayDistribution distribution) {\n    defaultInstance.get().setGlobalRandomDelayVariable(distribution);\n  }\n\n  public void setGlobalRandomDelayVariable(DelayDistribution distribution) {\n    GlobalSettings settings = settingsStore.get().copy().delayDistribution(distribution).build();\n    updateGlobalSettings(settings);\n  }\n\n  public static void updateSettings(GlobalSettings settings) {\n    defaultInstance.get().updateGlobalSettings(settings);\n  }\n\n  public void updateGlobalSettings(GlobalSettings settings) {\n    settingsStore.set(settings);\n    admin.updateGlobalSettings(settings);\n  }\n\n  public void shutdown() {\n    admin.shutdownServer();\n  }\n\n  public static void shutdownServer() {\n    defaultInstance.get().shutdown();\n  }\n\n  public static List<NearMiss> findNearMissesForAllUnmatched() {\n    return defaultInstance.get().findNearMissesForAllUnmatchedRequests();\n  }\n\n  public List<NearMiss> findNearMissesForAllUnmatchedRequests() {\n    FindNearMissesResult nearMissesResult = admin.findNearMissesForUnmatchedRequests();\n    return nearMissesResult.getNearMisses();\n  }\n\n  public static List<LoggedRequest> findUnmatchedRequests() {\n    return defaultInstance.get().findAllUnmatchedRequests();\n  }\n\n  public List<LoggedRequest> findAllUnmatchedRequests() {\n    FindRequestsResult unmatchedResult = admin.findUnmatchedRequests();\n    return unmatchedResult.getRequests();\n  }\n\n  public static List<NearMiss> findNearMissesFor(LoggedRequest loggedRequest) {\n    return defaultInstance.get().findTopNearMissesFor(loggedRequest);\n  }\n\n  public List<NearMiss> findTopNearMissesFor(LoggedRequest loggedRequest) {\n    FindNearMissesResult nearMissesResult = admin.findTopNearMissesFor(loggedRequest);\n    return nearMissesResult.getNearMisses();\n  }\n\n  public static List<NearMiss> findNearMissesFor(RequestPatternBuilder requestPatternBuilder) {\n    return defaultInstance.get().findAllNearMissesFor(requestPatternBuilder);\n  }\n\n  public List<NearMiss> findAllNearMissesFor(RequestPatternBuilder requestPatternBuilder) {\n    FindNearMissesResult nearMissesResult =\n        admin.findTopNearMissesFor(requestPatternBuilder.build());\n    return nearMissesResult.getNearMisses();\n  }\n\n  public void loadMappingsFrom(String rootDir) {\n    loadMappingsFrom(new File(rootDir));\n  }\n\n  public void loadMappingsFrom(File rootDir) {\n    FileSource mappingsSource = new SingleRootFileSource(rootDir);\n    new RemoteMappingsLoader(mappingsSource, this).load();\n  }\n\n  public static List<StubMapping> snapshotRecord() {\n    return defaultInstance.get().takeSnapshotRecording();\n  }\n\n  public static List<StubMapping> snapshotRecord(RecordSpecBuilder spec) {\n    return defaultInstance.get().takeSnapshotRecording(spec);\n  }\n\n  public List<StubMapping> takeSnapshotRecording() {\n    return admin.snapshotRecord().getStubMappings();\n  }\n\n  public List<StubMapping> takeSnapshotRecording(RecordSpecBuilder spec) {\n    return admin.snapshotRecord(spec.build()).getStubMappings();\n  }\n\n  public static MultipartValuePatternBuilder aMultipart() {\n    return new MultipartValuePatternBuilder();\n  }\n\n  public static MultipartValuePatternBuilder aMultipart(String name) {\n    return new MultipartValuePatternBuilder(name);\n  }\n\n  public static void startRecording(String targetBaseUrl) {\n    defaultInstance.get().startStubRecording(targetBaseUrl);\n  }\n\n  public static void startRecording() {\n    defaultInstance.get().startStubRecording();\n  }\n\n  public static void startRecording(RecordSpecBuilder spec) {\n    defaultInstance.get().startStubRecording(spec);\n  }\n\n  public void startStubRecording(String targetBaseUrl) {\n    admin.startRecording(targetBaseUrl);\n  }\n\n  public void startStubRecording() {\n    admin.startRecording(RecordSpec.DEFAULTS);\n  }\n\n  public void startStubRecording(RecordSpecBuilder spec) {\n    admin.startRecording(spec.build());\n  }\n\n  public static SnapshotRecordResult stopRecording() {\n    return defaultInstance.get().stopStubRecording();\n  }\n\n  public SnapshotRecordResult stopStubRecording() {\n    return admin.stopRecording();\n  }\n\n  public static RecordingStatusResult getRecordingStatus() {\n    return defaultInstance.get().getStubRecordingStatus();\n  }\n\n  public RecordingStatusResult getStubRecordingStatus() {\n    return admin.getRecordingStatus();\n  }\n\n  public static RecordSpecBuilder recordSpec() {\n    return new RecordSpecBuilder();\n  }\n\n  public List<StubMapping> findAllStubsByMetadata(StringValuePattern pattern) {\n    return admin.findAllStubsByMetadata(pattern).getMappings();\n  }\n\n  public static List<StubMapping> findStubsByMetadata(StringValuePattern pattern) {\n    return defaultInstance.get().findAllStubsByMetadata(pattern);\n  }\n\n  public void removeStubsByMetadataPattern(StringValuePattern pattern) {\n    admin.removeStubsByMetadata(pattern);\n  }\n\n  public static void removeStubsByMetadata(StringValuePattern pattern) {\n    defaultInstance.get().removeStubsByMetadataPattern(pattern);\n  }\n\n  public void importStubMappings(StubImport stubImport) {\n    admin.importStubs(stubImport);\n  }\n\n  public void importStubMappings(StubImportBuilder stubImport) {\n    importStubMappings(stubImport.build());\n  }\n\n  public static void importStubs(StubImportBuilder stubImport) {\n    importStubs(stubImport.build());\n  }\n\n  public static void importStubs(StubImport stubImport) {\n    defaultInstance.get().importStubMappings(stubImport);\n  }\n\n  public void removeStubMappings(List<StubMapping> stubs) {\n    admin.removeStubMappings(stubs);\n  }\n\n  public static void removeStubs(List<StubMapping> stubs) {\n    defaultInstance.get().removeStubMappings(stubs);\n  }\n\n  public GlobalSettings getGlobalSettings() {\n    return admin.getGlobalSettings().getSettings();\n  }\n\n  public static GlobalSettings getSettings() {\n    return defaultInstance.get().getGlobalSettings();\n  }\n\n  // Message stub mapping DSL methods\n\n  public static MessageStubMapping.Builder message() {\n    return MessageStubMapping.builder();\n  }\n\n  public static SendMessageActionBuilder sendMessage() {\n    return new SendMessageActionBuilder();\n  }\n\n  public static SendMessageActionBuilder sendMessage(String message) {\n    return new SendMessageActionBuilder().withBody(message);\n  }\n\n  public static MessageStubMapping messageStubFor(MessageStubMappingBuilder builder) {\n    return defaultInstance.get().registerMessageStub(builder);\n  }\n\n  public MessageStubMapping registerMessageStub(MessageStubMappingBuilder builder) {\n    MessageStubMapping mapping = builder.build();\n    admin.addMessageStubMapping(mapping);\n    return mapping;\n  }\n\n  public static MessageStubMapping messageStubFor(MessageStubMapping messageStubMapping) {\n    return defaultInstance.get().registerMessageStub(messageStubMapping);\n  }\n\n  public MessageStubMapping registerMessageStub(MessageStubMapping messageStubMapping) {\n    admin.addMessageStubMapping(messageStubMapping);\n    return messageStubMapping;\n  }\n\n  public static void removeMessageStub(UUID id) {\n    defaultInstance.get().deleteMessageStub(id);\n  }\n\n  public void deleteMessageStub(UUID id) {\n    admin.removeMessageStubMapping(id);\n  }\n\n  public static void resetMessageStubs() {\n    defaultInstance.get().resetAllMessageStubs();\n  }\n\n  public void resetAllMessageStubs() {\n    admin.resetMessageStubMappings();\n  }\n\n  public static List<MessageStubMapping> findMessageStubsByMetadata(StringValuePattern pattern) {\n    return defaultInstance.get().findAllMessageStubsByMetadata(pattern);\n  }\n\n  public List<MessageStubMapping> findAllMessageStubsByMetadata(StringValuePattern pattern) {\n    return admin.findAllMessageStubsByMetadata(pattern).getMessageMappings();\n  }\n\n  public static void removeMessageStubsByMetadata(StringValuePattern pattern) {\n    defaultInstance.get().removeAllMessageStubsByMetadata(pattern);\n  }\n\n  public void removeAllMessageStubsByMetadata(StringValuePattern pattern) {\n    admin.removeMessageStubsByMetadata(pattern);\n  }\n\n  public static ListMessageStubMappingsResult listAllMessageStubMappings() {\n    return defaultInstance.get().allMessageStubMappings();\n  }\n\n  public ListMessageStubMappingsResult allMessageStubMappings() {\n    return admin.listAllMessageStubMappings();\n  }\n\n  public static ListMessageChannelsResult listAllMessageChannels() {\n    return defaultInstance.get().allMessageChannels();\n  }\n\n  public ListMessageChannelsResult allMessageChannels() {\n    return admin.listAllMessageChannels();\n  }\n\n  // Message journal verification methods\n\n  public static List<MessageServeEvent> getAllMessageServeEvents() {\n    return defaultInstance.get().getMessageServeEvents();\n  }\n\n  public List<MessageServeEvent> getMessageServeEvents() {\n    return admin.getMessageServeEvents().getMessageServeEvents();\n  }\n\n  public static MessageServeEvent getMessageServeEvent(UUID id) {\n    return defaultInstance.get().getMessageServeEventById(id);\n  }\n\n  public MessageServeEvent getMessageServeEventById(UUID id) {\n    return admin.getMessageServeEvent(id).getItem();\n  }\n\n  public static void removeMessageServeEvent(UUID eventId) {\n    defaultInstance.get().deleteMessageServeEvent(eventId);\n  }\n\n  public void deleteMessageServeEvent(UUID eventId) {\n    admin.removeMessageServeEvent(eventId);\n  }\n\n  public static List<MessageServeEvent> findAllMessageEvents(MessagePattern pattern) {\n    return defaultInstance.get().findMessageEvents(pattern);\n  }\n\n  public List<MessageServeEvent> findMessageEvents(MessagePattern pattern) {\n    return admin.findMessageEventsMatching(pattern);\n  }\n\n  public static void verifyMessageEvent(MessagePattern pattern) {\n    defaultInstance.get().verifyThatMessageEvent(pattern);\n  }\n\n  public void verifyThatMessageEvent(MessagePattern pattern) {\n    verifyThatMessageEvent(moreThanOrExactly(1), pattern);\n  }\n\n  public static void verifyMessageEvent(int expectedCount, MessagePattern pattern) {\n    defaultInstance.get().verifyThatMessageEvent(expectedCount, pattern);\n  }\n\n  public void verifyThatMessageEvent(int expectedCount, MessagePattern pattern) {\n    verifyThatMessageEvent(exactly(expectedCount), pattern);\n  }\n\n  public static void verifyMessageEvent(\n      CountMatchingStrategy expectedCount, MessagePattern pattern) {\n    defaultInstance.get().verifyThatMessageEvent(expectedCount, pattern);\n  }\n\n  public void verifyThatMessageEvent(CountMatchingStrategy expectedCount, MessagePattern pattern) {\n    int actualCount = admin.countMessageEventsMatching(pattern);\n    if (!expectedCount.match(actualCount)) {\n      throw new VerificationException(\n          \"Expected \"\n              + expectedCount\n              + \" message events matching pattern but found \"\n              + actualCount);\n    }\n  }\n\n  public static Optional<MessageServeEvent> waitForMessageEvent(\n      MessagePattern pattern, Duration maxWait) {\n    return defaultInstance.get().waitForMessage(pattern, maxWait);\n  }\n\n  public Optional<MessageServeEvent> waitForMessage(MessagePattern pattern, Duration maxWait) {\n    return admin.waitForMessageEvent(pattern, maxWait);\n  }\n\n  public static List<MessageServeEvent> waitForMessageEvents(\n      MessagePattern pattern, int count, Duration maxWait) {\n    return defaultInstance.get().waitForMessages(pattern, count, maxWait);\n  }\n\n  public List<MessageServeEvent> waitForMessages(\n      MessagePattern pattern, int count, Duration maxWait) {\n    return admin.waitForMessageEvents(pattern, count, maxWait);\n  }\n\n  public static void resetMessageJournal() {\n    defaultInstance.get().resetMessages();\n  }\n\n  public void resetMessages() {\n    admin.resetMessageJournal();\n  }\n\n  public static FindMessageServeEventsResult removeMessageServeEventsMatching(\n      MessagePattern pattern) {\n    return defaultInstance.get().removeMessageEvents(pattern);\n  }\n\n  public FindMessageServeEventsResult removeMessageEvents(MessagePattern pattern) {\n    return admin.removeMessageServeEventsMatching(pattern);\n  }\n\n  public static FindMessageServeEventsResult removeMessageServeEventsForStubsMatchingMetadata(\n      StringValuePattern pattern) {\n    return defaultInstance.get().removeMessageEventsForStubsMatchingMetadata(pattern);\n  }\n\n  public FindMessageServeEventsResult removeMessageEventsForStubsMatchingMetadata(\n      StringValuePattern pattern) {\n    return admin.removeMessageServeEventsForStubsMatchingMetadata(pattern);\n  }\n\n  public enum JsonSchemaVersion {\n    V4,\n    V6,\n    V7,\n    V201909,\n    V202012;\n\n    public static final JsonSchemaVersion DEFAULT = V202012;\n\n    public SpecVersion.VersionFlag toVersionFlag() {\n      return switch (this) {\n        case V4 -> SpecVersion.VersionFlag.V4;\n        case V6 -> SpecVersion.VersionFlag.V6;\n        case V7 -> SpecVersion.VersionFlag.V7;\n        case V201909 -> SpecVersion.VersionFlag.V201909;\n        case V202012 -> SpecVersion.VersionFlag.V202012;\n      };\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/client/WireMockBuilder.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.client;\n\nimport static com.github.tomakehurst.wiremock.common.ProxySettings.NO_PROXY;\nimport static com.github.tomakehurst.wiremock.common.Strings.isNotBlank;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.http.client.HttpClientFactory.DEFAULT_MAX_CONNECTIONS;\nimport static com.github.tomakehurst.wiremock.http.client.HttpClientFactory.DEFAULT_TIMEOUT;\n\nimport com.github.tomakehurst.wiremock.common.ProxySettings;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.StaticExtensionLoader;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.security.ClientAuthenticator;\nimport com.github.tomakehurst.wiremock.security.ClientBasicAuthenticator;\nimport com.github.tomakehurst.wiremock.security.NoClientAuthenticator;\nimport java.util.Collections;\n\npublic class WireMockBuilder {\n\n  private static final String DEFAULT_HOST = \"localhost\";\n  private static final int DEFAULT_PORT = 8080;\n\n  private int port = DEFAULT_PORT;\n  private String host = DEFAULT_HOST;\n  private String urlPathPrefix = \"\";\n  private String scheme = \"http\";\n  private String hostHeader = null;\n  private String proxyHost = null;\n  private int proxyPort = 0;\n  private ClientAuthenticator authenticator = new NoClientAuthenticator();\n\n  public WireMockBuilder port(int port) {\n    this.port = port;\n    return this;\n  }\n\n  public WireMockBuilder host(String host) {\n    this.host = host;\n    return this;\n  }\n\n  public WireMockBuilder urlPathPrefix(String urlPathPrefix) {\n    this.urlPathPrefix = urlPathPrefix;\n    return this;\n  }\n\n  public WireMockBuilder scheme(String scheme) {\n    this.scheme = scheme;\n    return this;\n  }\n\n  public WireMockBuilder http() {\n    return scheme(\"http\");\n  }\n\n  public WireMockBuilder https() {\n    return scheme(\"https\");\n  }\n\n  public WireMockBuilder hostHeader(String hostHeader) {\n    this.hostHeader = hostHeader;\n    return this;\n  }\n\n  public WireMockBuilder proxyHost(String proxyHost) {\n    this.proxyHost = proxyHost;\n    return this;\n  }\n\n  public WireMockBuilder proxyPort(int proxyPort) {\n    this.proxyPort = proxyPort;\n    return this;\n  }\n\n  public WireMockBuilder authenticator(ClientAuthenticator authenticator) {\n    this.authenticator = authenticator;\n    return this;\n  }\n\n  public WireMockBuilder basicAuthenticator(String username, String password) {\n    return authenticator(new ClientBasicAuthenticator(username, password));\n  }\n\n  public WireMock build() {\n    ProxySettings proxySettings =\n        isNotBlank(proxyHost) ? new ProxySettings(proxyHost, proxyPort) : NO_PROXY;\n    return new WireMock(buildAdminClient(proxySettings));\n  }\n\n  HttpAdminClient buildAdminClient() {\n    return buildAdminClient(NO_PROXY);\n  }\n\n  HttpAdminClient buildAdminClient(ProxySettings proxySettings) {\n\n    Options options =\n        wireMockConfig()\n            .maxHttpClientConnections(DEFAULT_MAX_CONNECTIONS)\n            .timeout(DEFAULT_TIMEOUT)\n            .proxyVia(proxySettings)\n            .disableConnectionReuse(false);\n\n    HttpClient httpClient =\n        new StaticExtensionLoader<>(HttpClientFactory.class)\n            .setSpecificInstance(options.httpClientFactory())\n            .load()\n            .buildHttpClient(options, true, Collections.emptyList(), true);\n    return new HttpAdminClient(\n        scheme, host, port, urlPathPrefix, hostHeader, authenticator, httpClient);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/AbstractFileSource.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.github.tomakehurst.wiremock.security.NotAuthorisedException;\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.URI;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.function.Predicate;\nimport java.util.stream.Collectors;\n\npublic abstract class AbstractFileSource implements FileSource {\n\n  protected final File rootDirectory;\n\n  protected AbstractFileSource(File rootDirectory) {\n    this.rootDirectory = rootDirectory;\n  }\n\n  protected abstract boolean readOnly();\n\n  @Override\n  public BinaryFile getBinaryFileNamed(final String name) {\n    assertFilePathIsUnderRoot(name);\n    return new BinaryFile(new File(rootDirectory, name).toURI());\n  }\n\n  @Override\n  public TextFile getTextFileNamed(String name) {\n    assertFilePathIsUnderRoot(name);\n    return new TextFile(new File(rootDirectory, name).toURI());\n  }\n\n  @Override\n  public void createIfNecessary() {\n    if (rootDirectory.isDirectory()) {\n      return;\n    }\n\n    if (rootDirectory.exists() && rootDirectory.isFile()) {\n      throw new IllegalStateException(rootDirectory + \" already exists and is a file\");\n    } else if (!rootDirectory.exists() && !readOnly()) {\n      rootDirectory.mkdirs();\n    }\n  }\n\n  @Override\n  public String getPath() {\n    return rootDirectory.getPath();\n  }\n\n  @Override\n  public URI getUri() {\n    return rootDirectory.toURI();\n  }\n\n  @Override\n  public List<TextFile> listFilesRecursively() {\n    assertExistsAndIsDirectory();\n    List<File> fileList = new ArrayList<>();\n    recursivelyAddFilesToList(rootDirectory, fileList);\n    return toTextFileList(fileList);\n  }\n\n  private void recursivelyAddFilesToList(File root, List<File> fileList) {\n    File[] files = Optional.ofNullable(root.listFiles()).orElseGet(() -> new File[0]);\n    for (File file : files) {\n      if (file.isDirectory()) {\n        recursivelyAddFilesToList(file, fileList);\n      } else {\n        fileList.add(file);\n      }\n    }\n  }\n\n  private List<TextFile> toTextFileList(List<File> fileList) {\n    return fileList.stream().map(input -> new TextFile(input.toURI())).collect(Collectors.toList());\n  }\n\n  @Override\n  public void writeTextFile(String name, String contents) {\n    writeBinaryFile(name, contents.getBytes(UTF_8));\n  }\n\n  @Override\n  public void writeBinaryFile(String name, byte[] contents) {\n    createIfNecessary();\n    writeBinaryFileAndTranslateExceptions(contents, writableFileFor(name));\n  }\n\n  @Override\n  public void deleteFile(String name) {\n    writableFileFor(name).delete();\n  }\n\n  @Override\n  public boolean exists() {\n    return rootDirectory.exists();\n  }\n\n  private File writableFileFor(String name) {\n    assertExistsAndIsDirectory();\n    assertFilePathIsUnderRoot(name);\n    assertWritable();\n    final File filePath = new File(name);\n\n    if (filePath.isAbsolute()) {\n      return filePath;\n    } else {\n      // Convert to absolute path\n      return new File(rootDirectory, name);\n    }\n  }\n\n  private void assertExistsAndIsDirectory() {\n    if (rootDirectory.exists() && !rootDirectory.isDirectory()) {\n      throw new RuntimeException(rootDirectory + \" is not a directory\");\n    } else if (!rootDirectory.exists()) {\n      throw new RuntimeException(rootDirectory + \" does not exist\");\n    }\n  }\n\n  private void assertWritable() {\n    if (readOnly()) {\n      throw new UnsupportedOperationException(\"Can't write to read only file sources\");\n    }\n  }\n\n  private void assertFilePathIsUnderRoot(String path) {\n    try {\n      String rootPath = rootDirectory.getCanonicalPath();\n\n      File file = new File(path);\n      String filePath =\n          file.isAbsolute()\n              ? new File(path).getCanonicalPath()\n              : new File(rootDirectory, path).getCanonicalPath();\n\n      if (!Paths.get(filePath).normalize().startsWith(rootPath)) {\n        throw new NotAuthorisedException(\n            \"Access to file \"\n                + path\n                + \" is not permitted. An absolute path from the filesystem root might be specified. \"\n                + \"Your file must be in \"\n                + rootDirectory.getAbsolutePath());\n      }\n    } catch (IOException ioe) {\n      throw new NotAuthorisedException(\"File \" + path + \" cannot be accessed\", ioe);\n    }\n  }\n\n  private void writeBinaryFileAndTranslateExceptions(byte[] contents, File toFile) {\n    try {\n      ensureDirectoryExists(toFile);\n      Files.write(toFile.toPath(), contents);\n    } catch (IOException ioe) {\n      throwUnchecked(ioe);\n    }\n  }\n\n  private void ensureDirectoryExists(File toFile) throws IOException {\n    Path toPath = toFile.toPath();\n    if (!java.nio.file.Files.exists(toPath)) {\n      Path toParentPath = toPath.getParent();\n      java.nio.file.Files.createDirectories(toParentPath);\n    }\n  }\n\n  public static Predicate<BinaryFile> byFileExtension(final String extension) {\n    return input -> input.name().endsWith(\".\" + extension);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/AdminException.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class AdminException extends RuntimeException {\n\n  public AdminException(String message) {\n    super(message);\n  }\n\n  public AdminException(String message, Throwable cause) {\n    super(message, cause);\n  }\n\n  public AdminException(Throwable cause) {\n    super(cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ArrayFunctions.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.util.Arrays.copyOf;\n\nimport java.lang.reflect.Array;\n\npublic final class ArrayFunctions {\n\n  public static <T> T[] concat(T[] first, T[] second) {\n    if (first.length + second.length == 0) {\n      return first;\n    }\n    T[] both = copyOf(first, first.length + second.length);\n    System.arraycopy(second, 0, both, first.length, second.length);\n    return both;\n  }\n\n  public static <T> T[] prepend(T t, T[] original) {\n    @SuppressWarnings(\"unchecked\")\n    T[] newArray =\n        (T[]) Array.newInstance(original.getClass().getComponentType(), original.length + 1);\n    newArray[0] = t;\n    System.arraycopy(original, 0, newArray, 1, original.length);\n    return newArray;\n  }\n\n  private ArrayFunctions() {\n    throw new UnsupportedOperationException(\"not instantiable\");\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/AsynchronousResponseSettings.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class AsynchronousResponseSettings {\n\n  private final boolean enabled;\n  private final int threads;\n\n  public AsynchronousResponseSettings(boolean enabled, int threads) {\n    this.enabled = enabled;\n    this.threads = threads;\n  }\n\n  public boolean isEnabled() {\n    return enabled;\n  }\n\n  public int getThreads() {\n    return threads;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Base64Encoder.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\ninterface Base64Encoder {\n  String encode(byte[] content);\n\n  String encode(byte[] content, boolean padding);\n\n  byte[] decode(String base64);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/BiPredicate.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\n/** */\npublic interface BiPredicate<T, U> {\n\n  boolean test(T first, U second);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/BinaryFile.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.URI;\n\npublic class BinaryFile implements InputStreamSource {\n\n  private final URI uri;\n\n  public BinaryFile(URI uri) {\n    this.uri = uri;\n  }\n\n  public byte[] readContents() {\n    try (InputStream stream = getStream()) {\n      return stream.readAllBytes();\n    } catch (final IOException ioe) {\n      return throwUnchecked(ioe, byte[].class);\n    }\n  }\n\n  protected URI getUri() {\n    return uri;\n  }\n\n  public String name() {\n    return uri.toString();\n  }\n\n  @Override\n  public String toString() {\n    return name();\n  }\n\n  @Override\n  public InputStream getStream() {\n    try {\n      return uri.toURL().openStream();\n    } catch (IOException e) {\n      return throwUnchecked(e, InputStream.class);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/BrowserProxySettings.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.util.Collections.emptyList;\n\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport java.io.File;\nimport java.util.List;\nimport java.util.Objects;\n\npublic final class BrowserProxySettings {\n\n  public static final String DEFAULT_CA_KEYSTORE_PATH =\n      new File(\n              System.getProperty(\"user.home\")\n                  + File.separatorChar\n                  + \".wiremock\"\n                  + File.separatorChar\n                  + \"ca-keystore.jks\"\n                  + File.separatorChar)\n          .getAbsolutePath();\n  public static final String DEFAULT_CA_KESTORE_PASSWORD = \"password\";\n\n  public static BrowserProxySettings DISABLED = new Builder().build();\n\n  private final boolean enabled;\n  private final boolean trustAllProxyTargets;\n  private final List<String> trustedProxyTargets;\n  private final KeyStoreSettings caKeyStoreSettings;\n\n  public BrowserProxySettings(\n      boolean enabled,\n      boolean trustAllProxyTargets,\n      List<String> trustedProxyTargets,\n      KeyStoreSettings caKeyStoreSettings) {\n    this.enabled = enabled;\n    this.trustAllProxyTargets = trustAllProxyTargets;\n    this.trustedProxyTargets = trustedProxyTargets;\n    this.caKeyStoreSettings = caKeyStoreSettings;\n  }\n\n  public boolean enabled() {\n    return enabled;\n  }\n\n  public boolean trustAllProxyTargets() {\n    return trustAllProxyTargets;\n  }\n\n  public List<String> trustedProxyTargets() {\n    return trustedProxyTargets;\n  }\n\n  public KeyStoreSettings caKeyStore() {\n    return caKeyStoreSettings;\n  }\n\n  @Override\n  public String toString() {\n    return \"BrowserProxySettings{\"\n        + \"enabled=\"\n        + enabled\n        + \", trustAllProxyTargets=\"\n        + trustAllProxyTargets\n        + \", trustedProxyTargets=\"\n        + trustedProxyTargets\n        + \", caKeyStore='\"\n        + caKeyStoreSettings.path()\n        + '\\''\n        + '}';\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    BrowserProxySettings that = (BrowserProxySettings) o;\n    return enabled == that.enabled\n        && trustAllProxyTargets == that.trustAllProxyTargets\n        && Objects.equals(trustedProxyTargets, that.trustedProxyTargets)\n        && Objects.equals(caKeyStoreSettings, that.caKeyStoreSettings);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(enabled, trustAllProxyTargets, trustedProxyTargets, caKeyStoreSettings);\n  }\n\n  public static final class Builder {\n\n    private boolean enabled = false;\n    private boolean trustAllProxyTargets = false;\n    private List<String> trustedProxyTargets = emptyList();\n\n    private KeyStoreSettings caKeyStoreSettings = KeyStoreSettings.NO_STORE;\n\n    public Builder enabled(boolean enabled) {\n      this.enabled = enabled;\n      return this;\n    }\n\n    public Builder trustAllProxyTargets(boolean trustAllProxyTargets) {\n      this.trustAllProxyTargets = trustAllProxyTargets;\n      return this;\n    }\n\n    public Builder trustedProxyTargets(List<String> trustedProxyTargets) {\n      this.trustedProxyTargets = trustedProxyTargets;\n      return this;\n    }\n\n    public Builder caKeyStoreSettings(KeyStoreSettings caKeyStoreSettings) {\n      this.caKeyStoreSettings = caKeyStoreSettings;\n      return this;\n    }\n\n    public BrowserProxySettings build() {\n      return new BrowserProxySettings(\n          enabled, trustAllProxyTargets, trustedProxyTargets, caKeyStoreSettings);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ClasspathFileSource.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getLoader;\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResourceURI;\nimport static java.util.Arrays.asList;\n\nimport java.io.File;\nimport java.net.URI;\nimport java.net.URL;\nimport java.util.ArrayList;\nimport java.util.Enumeration;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.stream.Collectors;\nimport java.util.zip.ZipEntry;\nimport java.util.zip.ZipFile;\n\npublic class ClasspathFileSource implements FileSource {\n\n  private final String path;\n  private final ClassLoader classLoader;\n  private URI pathUri;\n  private ZipFile zipFile;\n  private File rootDirectory;\n\n  public ClasspathFileSource(String path) {\n    this((ClassLoader) null, path);\n  }\n\n  public ClasspathFileSource(Class<?> classpath, String path) {\n    this(classpath.getClassLoader(), path);\n  }\n\n  public ClasspathFileSource(ClassLoader classLoader, String path) {\n    this.path = path;\n    this.classLoader = classLoader;\n\n    try {\n      URL resource = getClassLoader().getResource(path);\n\n      if (resource == null) {\n        rootDirectory = new File(path);\n        this.pathUri = rootDirectory.toURI();\n        return;\n      }\n\n      this.pathUri = resource.toURI();\n\n      if (asList(\"jar\", \"war\", \"ear\", \"zip\").contains(pathUri.getScheme())) {\n        String jarFileUri = pathUri.getSchemeSpecificPart().split(\"!\")[0];\n        String jarFilePath = jarFileUri.replace(\"file:\", \"\");\n        File file = new File(jarFilePath);\n        zipFile = new ZipFile(file);\n      } else if (pathUri.getScheme().equals(\"file\")) {\n        rootDirectory = new File(pathUri);\n      } else {\n        throw new IllegalArgumentException(\n            \"ClasspathFileSource can't handle paths of type \" + pathUri.getScheme());\n      }\n\n    } catch (Exception e) {\n      throwUnchecked(e);\n    }\n  }\n\n  private ClassLoader getClassLoader() {\n    if (classLoader != null) return classLoader;\n    return getLoader(ClasspathFileSource.class);\n  }\n\n  private boolean isFileSystem() {\n    return rootDirectory != null;\n  }\n\n  @Override\n  public BinaryFile getBinaryFileNamed(final String name) {\n    if (isFileSystem()) {\n      return new BinaryFile(new File(rootDirectory, name).toURI());\n    }\n\n    return new BinaryFile(getZipEntryUri(name));\n  }\n\n  @Override\n  public TextFile getTextFileNamed(String name) {\n    if (isFileSystem()) {\n      return new TextFile(new File(rootDirectory, name).toURI());\n    }\n\n    return new TextFile(getZipEntryUri(name));\n  }\n\n  private URI getZipEntryUri(final String name) {\n    final String lookFor = path + \"/\" + name;\n    final Enumeration<? extends ZipEntry> enumeration = zipFile.entries();\n    StringBuilder candidates = new StringBuilder();\n    while (enumeration.hasMoreElements()) {\n      final ZipEntry candidate = enumeration.nextElement();\n      if (candidate.getName().equals(lookFor)) {\n        return getUriFor(candidate);\n      }\n      candidates.append(candidate.getName()).append(\"\\n\");\n    }\n    throw new RuntimeException(\n        \"Was unable to find entry: \\\"\" + lookFor + \"\\\", found:\\n\" + candidates);\n  }\n\n  @Override\n  public void createIfNecessary() {}\n\n  @Override\n  public FileSource child(String subDirectoryName) {\n    return new ClasspathFileSource(classLoader, path + \"/\" + subDirectoryName);\n  }\n\n  @Override\n  public String getPath() {\n    return path;\n  }\n\n  @Override\n  public URI getUri() {\n    return pathUri;\n  }\n\n  @Override\n  public List<TextFile> listFilesRecursively() {\n    if (isFileSystem()) {\n      assertExistsAndIsDirectory();\n      List<File> fileList = new ArrayList<>();\n      recursivelyAddFilesToList(rootDirectory, fileList);\n      return toTextFileList(fileList);\n    }\n\n    return zipFile.stream()\n        .filter(jarEntry -> !jarEntry.isDirectory() && jarEntry.getName().startsWith(path))\n        .map(jarEntry -> new TextFile(getUriFor(jarEntry)))\n        .collect(Collectors.toList());\n  }\n\n  private URI getUriFor(ZipEntry jarEntry) {\n    return getResourceURI(ClasspathFileSource.class, jarEntry.getName());\n  }\n\n  private void recursivelyAddFilesToList(File root, List<File> fileList) {\n    File[] files = Optional.ofNullable(root.listFiles()).orElseGet(() -> new File[0]);\n    for (File file : files) {\n      if (file.isDirectory()) {\n        recursivelyAddFilesToList(file, fileList);\n      } else {\n        fileList.add(file);\n      }\n    }\n  }\n\n  private List<TextFile> toTextFileList(List<File> fileList) {\n    return fileList.stream().map(input -> new TextFile(input.toURI())).collect(Collectors.toList());\n  }\n\n  @Override\n  public void writeTextFile(String name, String contents) {}\n\n  @Override\n  public void writeBinaryFile(String name, byte[] contents) {}\n\n  @Override\n  public boolean exists() {\n    // It'll only be non-file system if finding the classpath resource succeeded in the constructor\n    return (isFileSystem() && rootDirectory.exists()) || (!isFileSystem());\n  }\n\n  @Override\n  public void deleteFile(String name) {}\n\n  private void assertExistsAndIsDirectory() {\n    if (rootDirectory.exists() && !rootDirectory.isDirectory()) {\n      throw new RuntimeException(rootDirectory + \" is not a directory\");\n    } else if (!rootDirectory.exists()) {\n      throw new RuntimeException(rootDirectory + \" does not exist\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ClientError.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport com.github.tomakehurst.wiremock.recording.NotRecordingException;\nimport java.util.Objects;\n\npublic class ClientError extends RuntimeException {\n\n  private final Errors errors;\n\n  public ClientError(Errors errors) {\n    super(Json.write(errors));\n    this.errors = errors;\n  }\n\n  protected ClientError(Throwable cause, Errors errors) {\n    super(Json.write(errors), cause);\n    this.errors = errors;\n  }\n\n  public static ClientError fromErrors(Errors errors) {\n    Integer errorCode = errors.first().getCode();\n    if (errorCode == null) {\n      return new ClientError(errors);\n    }\n    return switch (errorCode) {\n      case 10 -> new InvalidInputException(errors);\n      case 30 -> new NotRecordingException();\n      case 50 -> new NotPermittedException(errors);\n      default -> new ClientError(errors);\n    };\n  }\n\n  public Errors getErrors() {\n    return errors;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    ClientError that = (ClientError) o;\n    return Objects.equals(errors, that.errors);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hashCode(errors);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ConsoleNotifier.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.lang.System.err;\nimport static java.lang.System.out;\n\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\n\npublic class ConsoleNotifier implements Notifier {\n\n  private final boolean verbose;\n  private final String prefix;\n\n  public ConsoleNotifier(boolean verbose) {\n    this(null, verbose);\n  }\n\n  public ConsoleNotifier(String name, boolean verbose) {\n    this.verbose = verbose;\n    this.prefix = name != null ? \"[\" + name + \"] \" : \"\";\n\n    if (verbose) {\n      info(\"Verbose logging enabled\");\n    }\n  }\n\n  @Override\n  public void info(String message) {\n    if (verbose) {\n      out.println(formatMessage(message));\n    }\n  }\n\n  @Override\n  public void error(String message) {\n    err.println(formatMessage(message));\n  }\n\n  @Override\n  public void error(String message, Throwable t) {\n    err.println(formatMessage(message));\n    t.printStackTrace(err);\n  }\n\n  private String formatMessage(String message) {\n    DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n    String date = df.format(new Date());\n    return String.format(\"%s%s %s\", prefix, date, message);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ContentTypes.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Strings.stringFromBytes;\nimport static com.github.tomakehurst.wiremock.common.Strings.substringAfterLast;\nimport static com.github.tomakehurst.wiremock.common.TextType.JSON;\nimport static java.util.Arrays.asList;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.tomakehurst.wiremock.common.xml.Xml;\nimport com.github.tomakehurst.wiremock.http.ContentTypeHeader;\nimport java.util.List;\nimport java.util.Map;\nimport org.wiremock.url.PathAndQuery;\n\npublic class ContentTypes {\n\n  private ContentTypes() {}\n\n  public static final String CONTENT_TYPE = \"Content-Type\";\n  public static final String CONTENT_LENGTH = \"Content-Length\";\n  public static final String CONTENT_ENCODING = \"Content-Encoding\";\n  public static final String TRANSFER_ENCODING = \"Transfer-Encoding\";\n  public static final String OCTET_STREAM = \"application/octet-stream\";\n  public static final String LOCATION = \"Location\";\n  public static final String AUTHORIZATION = \"Authorization\";\n  public static final String ACCEPT = \"Accept\";\n  public static final String COOKIE = \"Cookie\";\n  public static final String APPLICATION_JSON = \"application/json\";\n\n  private static final Map<String, String> COMMON_MIME_TYPES =\n      Map.ofEntries(\n          Map.entry(\"image/jpeg\", \"jpeg\"),\n          Map.entry(\"image/gif\", \"gif\"),\n          Map.entry(\"image/tiff\", \"tiff\"),\n          Map.entry(\"image/png\", \"png\"),\n          Map.entry(\"image/x-icon\", \"ico\"),\n          Map.entry(\"image/svg+xml\", \"svg\"),\n          Map.entry(\"audio/x-aiff\", \"aiff\"),\n          Map.entry(\"video/x-ms-asf\", \"asf\"),\n          Map.entry(\"video/mpeg\", \"mp2\"),\n          Map.entry(\"audio/mpeg\", \"mp3\"),\n          Map.entry(\"video/quicktime\", \"mov\"),\n          Map.entry(\"application/pdf\", \"pdf\"));\n\n  public static final List<String> TEXT_FILE_EXTENSIONS =\n      asList(\"txt\", \"json\", \"xml\", \"html\", \"htm\", \"yaml\", \"csv\");\n\n  public static final List<String> TEXT_MIME_TYPE_PATTERNS =\n      asList(\n          \".*text.*\",\n          \".*json.*\",\n          \".*xml.*\",\n          \".*html.*\",\n          \".*yaml.*\",\n          \".*csv.*\",\n          \".*x-www-form-urlencoded.*\");\n\n  public static String determineFileExtension(\n      PathAndQuery pathAndQuery, ContentTypeHeader contentTypeHeader, byte[] responseBody) {\n    if (contentTypeHeader.isPresent()) {\n      if (contentTypeHeader.mimeTypePart().contains(\"json\")) {\n        return \"json\";\n      }\n      if (contentTypeHeader.mimeTypePart().contains(\"xml\")) {\n        return \"xml\";\n      }\n      if (contentTypeHeader.mimeTypePart().contains(\"text\")) {\n        return \"txt\";\n      }\n\n      String extension = COMMON_MIME_TYPES.get(contentTypeHeader.mimeTypePart());\n      if (extension != null) {\n        return extension;\n      }\n    }\n\n    String lastPathSegment = pathAndQuery.getPath().getLastSegment().toString();\n    if (lastPathSegment.indexOf('.') != -1) {\n      return substringAfterLast(lastPathSegment, \".\");\n    }\n\n    return determineTextFileExtension(stringFromBytes(responseBody, contentTypeHeader.charset()));\n  }\n\n  public static TextType determineTextType(String content) {\n    try {\n      Json.read(content, JsonNode.class);\n      return JSON;\n    } catch (Exception e) {\n      try {\n        Xml.read(content);\n        return TextType.XML;\n      } catch (Exception e1) {\n        return TextType.PLAIN_TEXT;\n      }\n    }\n  }\n\n  public static String determineTextFileExtension(String content) {\n    TextType textType = determineTextType(content);\n    return switch (textType) {\n      case JSON -> \"json\";\n      case XML -> \"xml\";\n      default -> \"txt\";\n    };\n  }\n\n  public static boolean determineIsTextFromExtension(String extension) {\n    return TEXT_FILE_EXTENSIONS.contains(extension);\n  }\n\n  public static boolean determineIsTextFromMimeType(final String mimeType) {\n    return TEXT_MIME_TYPE_PATTERNS.stream()\n        .anyMatch(pattern -> mimeType != null && mimeType.matches(pattern));\n  }\n\n  public static boolean determineIsText(String extension, String mimeType) {\n    return determineIsTextFromExtension(extension) || determineIsTextFromMimeType(mimeType);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/DataTruncationSettings.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class DataTruncationSettings {\n\n  public static final DataTruncationSettings NO_TRUNCATION =\n      new DataTruncationSettings(Limit.UNLIMITED);\n  public static final DataTruncationSettings DEFAULTS = NO_TRUNCATION;\n\n  private final Limit maxResponseBodySize;\n\n  public DataTruncationSettings(Limit maxResponseBodySize) {\n    this.maxResponseBodySize = maxResponseBodySize;\n  }\n\n  public Limit getMaxResponseBodySize() {\n    return maxResponseBodySize;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/DateTimeOffset.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.DateTimeUnit.SECONDS;\n\nimport java.time.ZoneId;\nimport java.time.ZonedDateTime;\nimport java.util.Date;\n\npublic class DateTimeOffset {\n\n  public static final DateTimeOffset NONE = new DateTimeOffset(0, SECONDS);\n\n  private final DateTimeUnit amountUnit;\n  private final int amount;\n\n  public static DateTimeOffset fromString(String offset) {\n    if (offset.equalsIgnoreCase(\"now\")) {\n      return NONE;\n    }\n\n    String[] parts = offset.split(\" \");\n    if (parts.length < 2 || parts.length > 3) {\n      throw new IllegalArgumentException(\n          \"Offset can be of the short form <amount> <unit> e.g. 8 seconds or long form now +/-<amount> <unit> e.g. now +5 years\");\n    }\n\n    int amount;\n    DateTimeUnit amountUnit;\n\n    if (parts.length == 2) {\n      amount = Integer.parseInt(parts[0]);\n      amountUnit = DateTimeUnit.valueOf(parts[1].toUpperCase());\n    } else {\n      amount = Integer.parseInt(parts[1]);\n      amountUnit = DateTimeUnit.valueOf(parts[2].toUpperCase());\n    }\n\n    return new DateTimeOffset(amount, amountUnit);\n  }\n\n  public DateTimeOffset(int amount, DateTimeUnit amountUnit) {\n    this.amountUnit = amountUnit;\n    this.amount = amount;\n  }\n\n  public DateTimeUnit getAmountUnit() {\n    return amountUnit;\n  }\n\n  public int getAmount() {\n    return amount;\n  }\n\n  public Date shift(Date date) {\n    if (this == NONE) {\n      return date;\n    }\n\n    final ZonedDateTime input = ZonedDateTime.ofInstant(date.toInstant(), ZoneId.of(\"Z\"));\n    ZonedDateTime output = shift(input);\n    return Date.from(output.toInstant());\n  }\n\n  public ZonedDateTime shift(ZonedDateTime dateTime) {\n    if (this == NONE) {\n      return dateTime;\n    }\n\n    return dateTime.plus(amount, amountUnit.toTemporalUnit());\n  }\n\n  @Override\n  public String toString() {\n    return amount + \" \" + amountUnit.name().toLowerCase();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/DateTimeParser.java",
    "content": "/*\n * Copyright (C) 2021-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.time.ZoneOffset.UTC;\nimport static java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME;\nimport static java.time.format.DateTimeFormatter.RFC_1123_DATE_TIME;\nimport static java.time.temporal.ChronoField.MONTH_OF_YEAR;\nimport static java.util.Arrays.asList;\nimport static java.util.Locale.US;\n\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.RenderableDate;\nimport java.time.*;\nimport java.time.format.DateTimeFormatter;\nimport java.time.format.DateTimeParseException;\nimport java.time.temporal.*;\nimport java.util.Date;\nimport java.util.List;\nimport java.util.regex.Pattern;\n\npublic class DateTimeParser {\n\n  private static final DateTimeFormatter RFC_1036_DATE_TIME =\n      DateTimeFormatter.ofPattern(\"EEEE, dd-MMM-yy HH:mm:ss zzz\").withLocale(US);\n  private static final DateTimeFormatter ASCTIME1 =\n      DateTimeFormatter.ofPattern(\"EEE MMM dd HH:mm:ss yyyy\").withZone(ZoneId.of(\"GMT\"));\n  private static final DateTimeFormatter ASCTIME2 =\n      DateTimeFormatter.ofPattern(\"EEE MMM  d HH:mm:ss yyyy\").withZone(ZoneId.of(\"GMT\"));\n\n  public static final List<DateTimeParser> ZONED_PARSERS =\n      asList(\n          DateTimeParser.forFormatter(ISO_ZONED_DATE_TIME),\n          DateTimeParser.forFormatter(RFC_1123_DATE_TIME),\n          DateTimeParser.forFormatter(RFC_1036_DATE_TIME),\n          DateTimeParser.forFormatter(ASCTIME1),\n          DateTimeParser.forFormatter(ASCTIME2));\n\n  private final DateTimeFormatter dateTimeFormatter;\n  private final boolean isUnix;\n  private final boolean isEpoch;\n\n  private DateTimeParser(DateTimeFormatter dateTimeFormatter, boolean isUnix, boolean isEpoch) {\n    this.dateTimeFormatter = dateTimeFormatter;\n    this.isUnix = isUnix;\n    this.isEpoch = isEpoch;\n  }\n\n  public static DateTimeParser forFormat(String format) {\n    if (format.equalsIgnoreCase(\"unix\")) {\n      return new DateTimeParser(null, true, false);\n    }\n\n    if (format.equalsIgnoreCase(\"epoch\")) {\n      return new DateTimeParser(null, false, true);\n    }\n\n    return DateTimeParser.forFormatter(DateTimeFormatter.ofPattern(format));\n  }\n\n  public static DateTimeParser forFormatter(DateTimeFormatter dateTimeFormatter) {\n    return new DateTimeParser(dateTimeFormatter, false, false);\n  }\n\n  private static final Pattern OFFSET_SPACE_PATTERN =\n      Pattern.compile(\"([0-5]\\\\d:[0-5]\\\\d(?::[0-5]\\\\d)?(?:\\\\.\\\\d+)?) ([0-2]\\\\d)\");\n\n  public ZonedDateTime parseZonedDateTime(String dateTimeString) {\n    if (dateTimeFormatter != null) {\n      try {\n        return ZonedDateTime.parse(dateTimeString, dateTimeFormatter);\n      } catch (DateTimeParseException parseException) {\n        // Some of our users pass dates in query params without encoding the `+`, so it gets turned\n        // into a space - to be nice to them we try changing it back and reparsing\n        var matcher = OFFSET_SPACE_PATTERN.matcher(dateTimeString);\n        if (matcher.find()) {\n          String zonedDateTimeStringWithSpaceForPlus = matcher.replaceFirst(\"$1+$2\");\n          return ZonedDateTime.parse(zonedDateTimeStringWithSpaceForPlus, dateTimeFormatter);\n        } else {\n          throw parseException;\n        }\n      }\n    }\n\n    if (isUnix) {\n      long epochMillis = Long.parseLong(dateTimeString) * 1000;\n      return Instant.ofEpochMilli(epochMillis).atZone(UTC);\n    }\n\n    if (isEpoch) {\n      long epochMillis = Long.parseLong(dateTimeString);\n      return Instant.ofEpochMilli(epochMillis).atZone(UTC);\n    }\n\n    return null;\n  }\n\n  public LocalDateTime parseLocalDateTime(String dateTimeString) {\n    if (dateTimeFormatter != null) {\n      return LocalDateTime.parse(dateTimeString, dateTimeFormatter);\n    }\n\n    if (isUnix) {\n      long epochMillis = Long.parseLong(dateTimeString) * 1000;\n      return LocalDateTime.ofInstant(Instant.ofEpochMilli(epochMillis), UTC);\n    }\n\n    if (isEpoch) {\n      long epochMillis = Long.parseLong(dateTimeString);\n      return LocalDateTime.ofInstant(Instant.ofEpochMilli(epochMillis), UTC);\n    }\n\n    return null;\n  }\n\n  public LocalDate parseLocalDate(String dateTimeString) {\n    if (dateTimeFormatter != null) {\n      return LocalDate.parse(dateTimeString, dateTimeFormatter);\n    }\n\n    return null;\n  }\n\n  public YearMonth parseYearMonth(String dateTimeString) {\n    if (dateTimeFormatter != null) {\n      return YearMonth.parse(dateTimeString, dateTimeFormatter);\n    }\n\n    return null;\n  }\n\n  public Year parseYear(String dateTimeString) {\n    if (dateTimeFormatter != null) {\n      return Year.parse(dateTimeString, dateTimeFormatter);\n    }\n\n    return null;\n  }\n\n  public RenderableDate parseDate(String dateTimeString) {\n    if (isUnix || isEpoch) {\n      return new RenderableDate(\n          Date.from(parseZonedDateTime(dateTimeString).toInstant()), null, null);\n    }\n\n    if (dateTimeFormatter == null) {\n      return null;\n    }\n\n    final TemporalAccessor parseResult = dateTimeFormatter.parse(dateTimeString);\n    final ZoneId timezoneId = parseResult.query(TemporalQueries.zone());\n\n    Date date;\n\n    if (timezoneId != null) {\n      date = Date.from(Instant.from(parseResult));\n    } else if (parseResult.query(TemporalQueries.localTime()) != null) {\n      date = Date.from(LocalDateTime.from(parseResult).toInstant(UTC));\n    } else if (parseResult.query(TemporalQueries.localDate()) != null) {\n      date = Date.from(LocalDate.from(parseResult).atStartOfDay(UTC).toInstant());\n    } else if (parseResult.isSupported(MONTH_OF_YEAR)) {\n      date = Date.from(YearMonth.from(parseResult).atDay(1).atStartOfDay(UTC).toInstant());\n    } else {\n      date = Date.from(Year.from(parseResult).atMonth(1).atDay(1).atStartOfDay(UTC).toInstant());\n    }\n\n    return new RenderableDate(date, null, timezoneId);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/DateTimeTruncation.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.time.ZoneOffset.UTC;\nimport static java.time.temporal.ChronoUnit.*;\n\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.RenderableDate;\nimport java.time.ZoneId;\nimport java.time.ZonedDateTime;\nimport java.time.temporal.TemporalAdjusters;\nimport java.util.Date;\nimport java.util.function.Function;\n\npublic enum DateTimeTruncation {\n  FIRST_SECOND_OF_MINUTE(input -> input.truncatedTo(MINUTES)),\n  FIRST_MINUTE_OF_HOUR(input -> input.truncatedTo(HOURS)),\n  FIRST_HOUR_OF_DAY(input -> input.truncatedTo(DAYS)),\n\n  FIRST_DAY_OF_MONTH(input -> input.with(TemporalAdjusters.firstDayOfMonth()).truncatedTo(DAYS)),\n  FIRST_DAY_OF_NEXT_MONTH(\n      input -> input.with(TemporalAdjusters.firstDayOfNextMonth()).truncatedTo(DAYS)),\n  LAST_DAY_OF_MONTH(input -> input.with(TemporalAdjusters.lastDayOfMonth()).truncatedTo(DAYS)),\n\n  FIRST_DAY_OF_YEAR(input -> input.with(TemporalAdjusters.firstDayOfYear()).truncatedTo(DAYS)),\n  FIRST_DAY_OF_NEXT_YEAR(\n      input -> input.with(TemporalAdjusters.firstDayOfNextYear()).truncatedTo(DAYS)),\n  LAST_DAY_OF_YEAR(input -> input.with(TemporalAdjusters.lastDayOfYear()).truncatedTo(DAYS));\n\n  private final Function<ZonedDateTime, ZonedDateTime> fn;\n\n  DateTimeTruncation(Function<ZonedDateTime, ZonedDateTime> fn) {\n    this.fn = fn;\n  }\n\n  public ZonedDateTime truncate(ZonedDateTime input) {\n    return input != null ? fn.apply(input) : null;\n  }\n\n  public Date truncate(Date input) {\n    ZoneId zoneId = getTimezone(input);\n    final ZonedDateTime zonedInput = input.toInstant().atZone(zoneId);\n    final Date date = Date.from(truncate(zonedInput).toInstant());\n    return new RenderableDate(date, null, zoneId);\n  }\n\n  private static ZoneId getTimezone(Date date) {\n    if (date instanceof RenderableDate) {\n      RenderableDate renderableDate = (RenderableDate) date;\n      if (renderableDate.getTimezone() != null) {\n        return renderableDate.getTimezone();\n      }\n\n      return ZoneId.systemDefault();\n    }\n\n    return UTC;\n  }\n\n  @Override\n  public String toString() {\n    return name().replace('_', ' ').toLowerCase();\n  }\n\n  public static DateTimeTruncation fromString(String value) {\n    final String normalisedKey = value.toUpperCase().replace(' ', '_');\n    return valueOf(normalisedKey);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/DateTimeUnit.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.time.temporal.ChronoUnit;\nimport java.time.temporal.TemporalUnit;\nimport java.util.Calendar;\n\npublic enum DateTimeUnit {\n  SECONDS(Calendar.SECOND),\n  MINUTES(Calendar.MINUTE),\n  HOURS(Calendar.HOUR),\n  DAYS(Calendar.DAY_OF_MONTH),\n  MONTHS(Calendar.MONTH),\n  YEARS(Calendar.YEAR);\n\n  private final int calendarField;\n\n  DateTimeUnit(int calendarField) {\n    this.calendarField = calendarField;\n  }\n\n  public int getCalendarField() {\n    return calendarField;\n  }\n\n  public TemporalUnit toTemporalUnit() {\n    return ChronoUnit.valueOf(name());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Dates.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport java.time.ZoneId;\nimport java.time.ZonedDateTime;\nimport java.time.format.DateTimeFormatter;\nimport java.time.format.DateTimeParseException;\nimport java.util.Date;\n\npublic class Dates {\n\n  public static Date parse(String dateString) {\n    try {\n      return Date.from(ZonedDateTime.parse(dateString).toInstant());\n    } catch (DateTimeParseException e) {\n      return throwUnchecked(e, Date.class);\n    }\n  }\n\n  public static String format(Date date) {\n    return DateTimeFormatter.ISO_ZONED_DATE_TIME.format(date.toInstant().atZone(ZoneId.of(\"Z\")));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/DefaultNetworkAddressRules.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.NetworkAddressRange.ALL_RANGES;\nimport static com.github.tomakehurst.wiremock.common.NetworkAddressUtils.isValidInet4Address;\nimport static java.util.stream.Collectors.toSet;\n\nimport java.util.Set;\n\npublic class DefaultNetworkAddressRules implements NetworkAddressRules {\n\n  private final Set<NetworkAddressRange> allowed;\n  private final Set<NetworkAddressRange> allowedHostPatterns;\n  private final Set<NetworkAddressRange> denied;\n  private final Set<NetworkAddressRange> deniedHostPatterns;\n\n  public DefaultNetworkAddressRules(\n      Set<NetworkAddressRange> allowed, Set<NetworkAddressRange> denied) {\n    this.allowed =\n        defaultIfEmpty(\n            allowed.stream()\n                .filter(\n                    networkAddressRange ->\n                        !(networkAddressRange instanceof NetworkAddressRange.DomainNameWildcard))\n                .collect(toSet()),\n            ALL_RANGES);\n    this.allowedHostPatterns =\n        defaultIfEmpty(\n            allowed.stream()\n                .filter(\n                    networkAddressRange ->\n                        (networkAddressRange instanceof NetworkAddressRange.DomainNameWildcard))\n                .collect(toSet()),\n            ALL_RANGES);\n    this.denied =\n        denied.stream()\n            .filter(\n                networkAddressRange ->\n                    !(networkAddressRange instanceof NetworkAddressRange.DomainNameWildcard))\n            .collect(toSet());\n    this.deniedHostPatterns =\n        denied.stream()\n            .filter(\n                networkAddressRange ->\n                    (networkAddressRange instanceof NetworkAddressRange.DomainNameWildcard))\n            .map(\n                networkAddressRange -> (NetworkAddressRange.DomainNameWildcard) networkAddressRange)\n            .collect(toSet());\n  }\n\n  private static <T> Set<T> defaultIfEmpty(Set<T> original, Set<T> ifEmpty) {\n    if (original.isEmpty()) {\n      return ifEmpty;\n    } else {\n      return original;\n    }\n  }\n\n  @Override\n  public boolean isAllowed(String testValue) {\n    if (isValidInet4Address(testValue)) {\n      return allowed.stream().anyMatch(rule -> rule.isIncluded(testValue))\n          && denied.stream().noneMatch(rule -> rule.isIncluded(testValue));\n    } else {\n      return allowedHostPatterns.stream().anyMatch(rule -> rule.isIncluded(testValue))\n          && deniedHostPatterns.stream().noneMatch(rule -> rule.isIncluded(testValue));\n    }\n  }\n\n  @Override\n  public boolean isAllowedAll() {\n    return allowed.equals(ALL_RANGES)\n        && allowedHostPatterns.equals(ALL_RANGES)\n        && denied.isEmpty()\n        && deniedHostPatterns.isEmpty();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Encoding.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport java.net.URLEncoder;\n\npublic class Encoding {\n\n  private Encoding() {}\n\n  private static Base64Encoder encoder = null;\n\n  private static Base64Encoder getInstance() {\n    if (encoder == null) {\n      synchronized (Encoding.class) {\n        if (encoder == null) {\n          encoder = new JdkBase64Encoder();\n        }\n      }\n    }\n\n    return encoder;\n  }\n\n  public static byte[] decodeBase64(String base64) {\n    return base64 != null ? getInstance().decode(base64) : null;\n  }\n\n  public static String encodeBase64(byte[] content) {\n    return encodeBase64(content, true);\n  }\n\n  public static String encodeBase64(byte[] content, boolean padding) {\n    return content != null ? getInstance().encode(content, padding) : null;\n  }\n\n  public static String urlEncode(String encodedUrl) {\n    return URLEncoder.encode(encodedUrl, UTF_8);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Errors.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.util.Collections.singletonList;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.List;\nimport java.util.Objects;\n\npublic class Errors {\n\n  private final List<Error> errors;\n\n  public Errors(@JsonProperty(\"errors\") List<Error> errors) {\n    this.errors = errors;\n  }\n\n  public static Errors single(Integer code, String sourcePointer, String title) {\n    return new Errors(singletonList(new Error(code, new Error.Source(sourcePointer), title)));\n  }\n\n  public static Errors single(Integer code, String sourcePointer, String title, String detail) {\n    return new Errors(\n        singletonList(new Error(code, new Error.Source(sourcePointer), title, detail)));\n  }\n\n  public static Errors single(Integer code, String title) {\n    return new Errors(singletonList(new Error(code, title)));\n  }\n\n  public static Errors singleWithDetail(Integer code, String title, String detail) {\n    return new Errors(singletonList(new Error(code, null, title, detail)));\n  }\n\n  public static Errors notRecording() {\n    return single(30, \"Not currently recording.\");\n  }\n\n  public static Errors validation(String pointer, String message) {\n    return single(10, pointer, message);\n  }\n\n  public static Errors notPermitted(String reason) {\n    return single(50, reason);\n  }\n\n  public Error first() {\n    if (errors.isEmpty()) {\n      throw new IllegalStateException(\"No errors are present\");\n    }\n\n    return errors.get(0);\n  }\n\n  public List<Error> getErrors() {\n    return errors;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    Errors errors1 = (Errors) o;\n    return Objects.equals(errors, errors1.errors);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hashCode(errors);\n  }\n\n  public static class Error {\n\n    private final Integer code;\n    private final Source source;\n    private final String title;\n    private final String detail;\n\n    public Error(\n        @JsonProperty(\"code\") Integer code,\n        @JsonProperty(\"source\") Source source,\n        @JsonProperty(\"title\") String title,\n        @JsonProperty(\"detail\") String detail) {\n      this.code = code;\n      this.source = source;\n      this.title = title;\n      this.detail = detail;\n    }\n\n    public Error(int code, Source source, String title) {\n      this(code, source, title, null);\n    }\n\n    public Error(int code, String title) {\n      this(code, null, title, null);\n    }\n\n    public Integer getCode() {\n      return code;\n    }\n\n    public Source getSource() {\n      return source;\n    }\n\n    public String getTitle() {\n      return title;\n    }\n\n    public String getDetail() {\n      return detail;\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      if (o == null || getClass() != o.getClass()) return false;\n      Error error = (Error) o;\n      return Objects.equals(code, error.code)\n          && Objects.equals(source, error.source)\n          && Objects.equals(title, error.title)\n          && Objects.equals(detail, error.detail);\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hash(code, source, title, detail);\n    }\n\n    public static class Source {\n\n      private final String pointer;\n\n      public Source(@JsonProperty(\"pointer\") String pointer) {\n        this.pointer = pointer;\n      }\n\n      public String getPointer() {\n        return pointer;\n      }\n\n      @Override\n      public boolean equals(Object o) {\n        if (o == null || getClass() != o.getClass()) return false;\n        Source source = (Source) o;\n        return Objects.equals(pointer, source.pointer);\n      }\n\n      @Override\n      public int hashCode() {\n        return Objects.hashCode(pointer);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Exceptions.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.io.PrintWriter;\nimport java.io.StringWriter;\nimport java.util.concurrent.Callable;\n\npublic class Exceptions {\n\n  /**\n   * Because this method throws an unchecked exception, when it is called in a method with a return\n   * type the compiler does not know the method is exiting, requiring a further line to return null\n   * or throw an unchecked exception directly. This generified method allows this to be avoided by\n   * tricking the compiler by adding a return statement as so:\n   *\n   * <pre>\n   *     String someMethod() {\n   *         try {\n   *             somethingThatThrowsException();\n   *         } catch (Exception e) {\n   *             return throwUnchecked(e, null); // does not actually return, throws the exception\n   *         }\n   *     }\n   * </pre>\n   *\n   * @param ex The exception that will be thrown, unwrapped and unchecked\n   * @param ignoredReturnType trick to persuade the compiler that a method returns appropriately\n   * @return Never returns, always throws the passed in exception\n   */\n  public static <T> T throwUnchecked(final Throwable ex, final Class<T> ignoredReturnType) {\n    Exceptions.throwsUnchecked(ex);\n    throw new AssertionError(\n        \"This code should be unreachable. Something went terribly wrong here!\");\n  }\n\n  /**\n   * @param ex The exception that will be thrown, unwrapped and unchecked\n   */\n  public static void throwUnchecked(final Throwable ex) {\n    throwUnchecked(ex, null);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private static <T extends Throwable> void throwsUnchecked(Throwable toThrow) throws T {\n    throw (T) toThrow;\n  }\n\n  public static <T> T uncheck(Callable<T> work, Class<T> returnType) {\n    try {\n      return work.call();\n    } catch (Exception e) {\n      return throwUnchecked(e, returnType);\n    }\n  }\n\n  public static void uncheck(RunnableWithException work) {\n    try {\n      work.run();\n    } catch (Exception e) {\n      throwUnchecked(e);\n    }\n  }\n\n  @SuppressWarnings(\"unused\")\n  public static String renderStackTrace(Throwable t) {\n    StringWriter sw = new StringWriter();\n    t.printStackTrace(new PrintWriter(sw));\n    return sw.toString();\n  }\n\n  public interface RunnableWithException {\n    void run() throws Exception;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/FatalStartupException.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class FatalStartupException extends RuntimeException {\n\n  public FatalStartupException(String message) {\n    super(message);\n  }\n\n  public FatalStartupException(Throwable cause) {\n    super(cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/FileSource.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.net.URI;\nimport java.util.List;\n\npublic interface FileSource {\n\n  BinaryFile getBinaryFileNamed(String name);\n\n  TextFile getTextFileNamed(String name);\n\n  void createIfNecessary();\n\n  FileSource child(String subDirectoryName);\n\n  String getPath();\n\n  URI getUri();\n\n  List<TextFile> listFilesRecursively();\n\n  void writeTextFile(String name, String contents);\n\n  void writeBinaryFile(String name, byte[] contents);\n\n  boolean exists();\n\n  void deleteFile(String name);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Gzip.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.Strings.bytesFromString;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.nio.charset.Charset;\nimport java.util.zip.GZIPInputStream;\nimport java.util.zip.GZIPOutputStream;\n\npublic class Gzip {\n\n  private Gzip() {}\n\n  public static byte[] unGzip(byte[] gzippedContent) {\n    if (gzippedContent.length == 0) {\n      return new byte[0];\n    }\n\n    try {\n      GZIPInputStream gzipInputStream =\n          new GZIPInputStream(new ByteArrayInputStream(gzippedContent));\n      return gzipInputStream.readAllBytes();\n    } catch (IOException e) {\n      return throwUnchecked(e, byte[].class);\n    }\n  }\n\n  public static String unGzipToString(byte[] gzippedContent) {\n    return new String(unGzip(gzippedContent));\n  }\n\n  public static byte[] gzip(String plainContent) {\n    return gzip(plainContent, UTF_8);\n  }\n\n  public static byte[] gzip(String plainContent, Charset charset) {\n    return gzip(bytesFromString(plainContent, charset));\n  }\n\n  public static byte[] gzip(byte[] plainContent) {\n    try {\n      ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n      GZIPOutputStream gzipOutputStream = new GZIPOutputStream(bytes);\n      gzipOutputStream.write(plainContent);\n      gzipOutputStream.close();\n      return bytes.toByteArray();\n    } catch (IOException e) {\n      return throwUnchecked(e, byte[].class);\n    }\n  }\n\n  public static boolean isGzipped(byte[] content) {\n    return content.length >= 2\n        && content[0] == (byte) GZIPInputStream.GZIP_MAGIC\n        && content[1] == (byte) (GZIPInputStream.GZIP_MAGIC >> 8);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/HttpsSettings.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResource;\n\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\n\npublic class HttpsSettings {\n\n  private final int port;\n  private final String keyStorePath;\n  private final String keyStorePassword;\n  private final String keyManagerPassword;\n  private final String keyStoreType;\n  private final String trustStorePath;\n  private final String trustStorePassword;\n  private final String trustStoreType;\n  private final boolean needClientAuth;\n\n  public HttpsSettings(\n      int port,\n      String keyStorePath,\n      String keyStorePassword,\n      String keyManagerPassword,\n      String keyStoreType,\n      String trustStorePath,\n      String trustStorePassword,\n      String trustStoreType,\n      boolean needClientAuth) {\n    this.port = port;\n    this.keyStorePath = keyStorePath;\n    this.keyStorePassword = keyStorePassword;\n    this.keyManagerPassword = keyManagerPassword;\n    this.keyStoreType = keyStoreType;\n    this.trustStorePath = trustStorePath;\n    this.trustStorePassword = trustStorePassword;\n    this.trustStoreType = trustStoreType;\n    this.needClientAuth = needClientAuth;\n  }\n\n  public int port() {\n    return port;\n  }\n\n  public String keyStorePath() {\n    return keyStorePath;\n  }\n\n  public String keyStorePassword() {\n    return keyStorePassword;\n  }\n\n  public String keyManagerPassword() {\n    return keyManagerPassword;\n  }\n\n  public String keyStoreType() {\n    return keyStoreType;\n  }\n\n  public boolean enabled() {\n    return port > -1;\n  }\n\n  public String trustStorePath() {\n    return trustStorePath;\n  }\n\n  public String trustStorePassword() {\n    return trustStorePassword;\n  }\n\n  public String trustStoreType() {\n    return trustStoreType;\n  }\n\n  public boolean needClientAuth() {\n    return needClientAuth;\n  }\n\n  public boolean hasTrustStore() {\n    return trustStorePath != null;\n  }\n\n  public KeyStoreSettings trustStore() {\n    return trustStorePath != null\n        ? new KeyStoreSettings(trustStorePath, trustStorePassword, trustStoreType)\n        : KeyStoreSettings.NO_STORE;\n  }\n\n  public KeyStoreSettings keyStore() {\n    return new KeyStoreSettings(keyStorePath, keyStorePassword, keyStoreType);\n  }\n\n  @Override\n  public String toString() {\n    return \"HttpsSettings{\"\n        + \"port=\"\n        + port\n        + \", keyStorePath='\"\n        + keyStorePath\n        + '\\''\n        + \", keyStoreType='\"\n        + keyStoreType\n        + '\\''\n        + \", trustStorePath='\"\n        + trustStorePath\n        + '\\''\n        + \", trustStoreType='\"\n        + trustStoreType\n        + '\\''\n        + \", needClientAuth=\"\n        + needClientAuth\n        + '}';\n  }\n\n  public static class Builder {\n\n    private int port;\n    private String keyStorePath = getResource(Builder.class, \"keystore\").toString();\n    private String keyStorePassword = \"password\";\n    private String keyManagerPassword = \"password\";\n    private String keyStoreType = \"JKS\";\n    private String trustStorePath = null;\n    private String trustStorePassword = \"password\";\n    private String trustStoreType = \"JKS\";\n    private boolean needClientAuth = false;\n\n    public Builder port(int port) {\n      this.port = port;\n      return this;\n    }\n\n    public Builder keyStorePath(String keyStorePath) {\n      this.keyStorePath = keyStorePath;\n      return this;\n    }\n\n    public Builder keyStorePassword(String keyStorePassword) {\n      this.keyStorePassword = keyStorePassword;\n      return this;\n    }\n\n    public Builder keyManagerPassword(String keyStorePassword) {\n      this.keyManagerPassword = keyStorePassword;\n      return this;\n    }\n\n    public Builder keyStoreType(String keyStoreType) {\n      this.keyStoreType = keyStoreType;\n      return this;\n    }\n\n    public Builder trustStorePath(String trustStorePath) {\n      this.trustStorePath = trustStorePath;\n      return this;\n    }\n\n    public Builder trustStorePassword(String trustStorePassword) {\n      this.trustStorePassword = trustStorePassword;\n      return this;\n    }\n\n    public Builder trustStoreType(String trustStoreType) {\n      this.trustStoreType = trustStoreType;\n      return this;\n    }\n\n    public Builder needClientAuth(boolean needClientAuth) {\n      this.needClientAuth = needClientAuth;\n      return this;\n    }\n\n    public HttpsSettings build() {\n      return new HttpsSettings(\n          port,\n          keyStorePath,\n          keyStorePassword,\n          keyManagerPassword,\n          keyStoreType,\n          trustStorePath,\n          trustStorePassword,\n          trustStoreType,\n          needClientAuth);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/IdGenerator.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic interface IdGenerator {\n\n  String generate();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/InputStreamSource.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.io.InputStream;\n\npublic interface InputStreamSource {\n  InputStream getStream();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/InvalidInputException.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class InvalidInputException extends ClientError {\n\n  public InvalidInputException(Errors errors) {\n    super(errors);\n  }\n\n  protected InvalidInputException(Throwable cause, Errors errors) {\n    super(cause, errors);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/InvalidParameterException.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class InvalidParameterException extends ClientError {\n\n  public InvalidParameterException(Errors errors) {\n    super(errors);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/JdkBase64Encoder.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.util.Base64;\n\npublic class JdkBase64Encoder implements Base64Encoder {\n\n  @Override\n  public String encode(byte[] content) {\n    return encode(content, true);\n  }\n\n  @Override\n  public String encode(byte[] content, boolean padding) {\n    var encoder = padding ? Base64.getEncoder() : Base64.getEncoder().withoutPadding();\n    return encoder.encodeToString(content);\n  }\n\n  @Override\n  public byte[] decode(String base64) {\n    return Base64.getDecoder().decode(base64);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Json.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fasterxml.jackson.core.type.TypeReference;\nimport com.fasterxml.jackson.databind.DeserializationFeature;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.databind.ObjectWriter;\nimport com.fasterxml.jackson.databind.SerializationFeature;\nimport com.fasterxml.jackson.databind.cfg.JsonNodeFeature;\nimport com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;\nimport java.io.IOException;\nimport java.util.Map;\nimport org.wiremock.url.jackson2.WireMockUrlModule;\n\npublic final class Json {\n\n  public static class PrivateView {}\n\n  public static class PublicView {}\n\n  private static final InheritableThreadLocal<ObjectMapper> objectMapperHolder =\n      new InheritableThreadLocal<>() {\n        @Override\n        protected ObjectMapper initialValue() {\n          ObjectMapper objectMapper = new ObjectMapper();\n          objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);\n          objectMapper.configure(JsonNodeFeature.STRIP_TRAILING_BIGDECIMAL_ZEROES, false);\n          objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);\n          objectMapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);\n          objectMapper.configure(JsonParser.Feature.IGNORE_UNDEFINED, true);\n          objectMapper.configure(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN, true);\n          objectMapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true);\n          objectMapper.registerModule(new JavaTimeModule());\n          objectMapper.registerModule(new WireMockUrlModule());\n          objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);\n          objectMapper.enable(JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION);\n          return objectMapper;\n        }\n      };\n\n  private Json() {}\n\n  public static <T> T read(byte[] stream, Class<T> clazz) throws IOException {\n    try {\n      ObjectMapper mapper = getObjectMapper();\n      return mapper.readValue(stream, clazz);\n    } catch (JsonProcessingException processingException) {\n      throw JsonException.fromJackson(processingException);\n    }\n  }\n\n  public static <T> T read(String json, Class<T> clazz) {\n    try {\n      ObjectMapper mapper = getObjectMapper();\n      return mapper.readValue(json, clazz);\n    } catch (JsonProcessingException processingException) {\n      throw JsonException.fromJackson(processingException);\n    }\n  }\n\n  public static <T> T read(String json, TypeReference<T> typeRef) {\n    try {\n      ObjectMapper mapper = getObjectMapper();\n      return mapper.readValue(json, typeRef);\n    } catch (JsonProcessingException processingException) {\n      throw JsonException.fromJackson(processingException);\n    }\n  }\n\n  public static <T> String write(T object) {\n    return write(object, PublicView.class);\n  }\n\n  public static <T> String writePrivate(T object) {\n    return write(object, PrivateView.class);\n  }\n\n  public static <T> String write(T object, Class<?> view) {\n    try {\n      ObjectMapper mapper = getObjectMapper();\n      ObjectWriter objectWriter = mapper.writerWithDefaultPrettyPrinter();\n      if (view != null) {\n        objectWriter = objectWriter.withView(view);\n      }\n      return objectWriter.writeValueAsString(object);\n    } catch (IOException ioe) {\n      return throwUnchecked(ioe, String.class);\n    }\n  }\n\n  public static ObjectMapper getObjectMapper() {\n    return objectMapperHolder.get();\n  }\n\n  public static byte[] toByteArray(Object object) {\n    try {\n      ObjectMapper mapper = getObjectMapper();\n      return mapper.writeValueAsBytes(object);\n    } catch (IOException ioe) {\n      return throwUnchecked(ioe, byte[].class);\n    }\n  }\n\n  public static JsonNode node(String json) {\n    return read(json, JsonNode.class);\n  }\n\n  public static int maxDeepSize(JsonNode one, JsonNode two) {\n    return Math.max(deepSize(one), deepSize(two));\n  }\n\n  public static int deepSize(JsonNode node) {\n    if (node == null) {\n      return 0;\n    }\n\n    int acc = 1;\n    if (node.isContainerNode()) {\n      for (JsonNode child : node) {\n        acc++;\n        if (child.isContainerNode()) {\n          acc += deepSize(child);\n        }\n      }\n    }\n\n    return acc;\n  }\n\n  public static String prettyPrint(String json) {\n    ObjectMapper mapper = getObjectMapper();\n    try {\n      return mapper\n          .writerWithDefaultPrettyPrinter()\n          .writeValueAsString(mapper.readValue(json, JsonNode.class));\n    } catch (IOException e) {\n      return throwUnchecked(e, String.class);\n    }\n  }\n\n  public static <T> T mapToObject(Map<String, Object> map, Class<T> targetClass) {\n    ObjectMapper mapper = getObjectMapper();\n    return mapper.convertValue(map, targetClass);\n  }\n\n  public static <T> Map<String, Object> objectToMap(T theObject) {\n    ObjectMapper mapper = getObjectMapper();\n    return mapper.convertValue(theObject, new TypeReference<>() {});\n  }\n\n  public static int schemaPropertyCount(JsonNode schema) {\n    int count = 0;\n    final JsonNode propertiesNode = schema.get(\"properties\");\n    if (propertiesNode != null && !propertiesNode.isEmpty()) {\n      for (JsonNode property : propertiesNode) {\n        count++;\n        if (property.has(\"properties\")) {\n          count += schemaPropertyCount(property);\n        }\n      }\n    }\n\n    return count;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/JsonException.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fasterxml.jackson.databind.JsonMappingException;\nimport java.util.List;\nimport java.util.function.Function;\nimport java.util.regex.PatternSyntaxException;\nimport java.util.stream.Collectors;\n\npublic class JsonException extends InvalidInputException {\n\n  protected JsonException(Errors errors) {\n    super(errors);\n  }\n\n  public static JsonException fromJackson(JsonProcessingException processingException) {\n    Throwable rootCause = getRootCause(processingException);\n\n    String message = rootCause.getMessage();\n    if (rootCause instanceof PatternSyntaxException) {\n      PatternSyntaxException patternSyntaxException = (PatternSyntaxException) rootCause;\n      message = patternSyntaxException.getMessage();\n    } else if (rootCause instanceof JsonMappingException) {\n      message = ((JsonMappingException) rootCause).getOriginalMessage();\n    } else if (rootCause instanceof InvalidInputException) {\n      message = ((InvalidInputException) rootCause).getErrors().first().getDetail();\n    }\n\n    String pointer = null;\n    if (processingException instanceof JsonMappingException) {\n      List<String> nodes =\n          ((JsonMappingException) processingException)\n              .getPath().stream().map(TO_NODE_NAMES).collect(Collectors.toList());\n      pointer = \"/\" + String.join(\"/\", nodes);\n    }\n\n    return new JsonException(Errors.single(10, pointer, \"Error parsing JSON\", message));\n  }\n\n  private static Throwable getRootCause(Throwable e) {\n    if (e.getCause() != null) {\n      return getRootCause(e.getCause());\n    }\n\n    return e;\n  }\n\n  private static final Function<JsonMappingException.Reference, String> TO_NODE_NAMES =\n      input ->\n          input.getFieldName() != null ? input.getFieldName() : String.valueOf(input.getIndex());\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/KeyLocks.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.util.concurrent.Callable;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport java.util.concurrent.locks.Lock;\nimport java.util.concurrent.locks.ReentrantLock;\n\npublic class KeyLocks {\n\n  private final ConcurrentHashMap<String, LockWrapper> locks = new ConcurrentHashMap<>();\n\n  @SuppressWarnings(\"unchecked\")\n  public <T> T withLock(String key, Callable<T> action) {\n    try {\n      lock(key);\n      return (T) Exceptions.uncheck(action::call, Object.class);\n    } finally {\n      unlock(key);\n    }\n  }\n\n  private void lock(String key) {\n    LockWrapper lockWrapper =\n        locks.compute(key, (k, v) -> v == null ? new LockWrapper() : v.addThreadInQueue());\n    lockWrapper.lock.lock();\n  }\n\n  private void unlock(String key) {\n    LockWrapper lockWrapper = locks.get(key);\n    lockWrapper.lock.unlock();\n    if (lockWrapper.removeThreadFromQueue() == 0) {\n      locks.remove(key, lockWrapper);\n    }\n  }\n\n  private static class LockWrapper {\n    private final Lock lock = new ReentrantLock();\n    private final AtomicInteger numberOfThreadsInQueue = new AtomicInteger(1);\n\n    private LockWrapper addThreadInQueue() {\n      numberOfThreadsInQueue.incrementAndGet();\n      return this;\n    }\n\n    private int removeThreadFromQueue() {\n      return numberOfThreadsInQueue.decrementAndGet();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Lazy.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.util.concurrent.atomic.AtomicReference;\nimport java.util.function.Supplier;\n\npublic class Lazy<T> {\n\n  public static <T> Lazy<T> lazy(Supplier<T> supplier) {\n    return new Lazy<>(supplier);\n  }\n\n  private final Supplier<T> supplier;\n  private final AtomicReference<T> ref = new AtomicReference<>();\n\n  private Lazy(Supplier<T> supplier) {\n    this.supplier = supplier;\n  }\n\n  public T get() {\n    return ref.updateAndGet(existing -> existing == null ? supplier.get() : existing);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Limit.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class Limit {\n\n  public static final Limit UNLIMITED = new Limit(null);\n\n  private final Integer limit;\n\n  public Limit(Integer limit) {\n    this.limit = limit;\n  }\n\n  public boolean isExceededBy(int value) {\n    return limit != null && value > limit;\n  }\n\n  public Integer getValue() {\n    return limit;\n  }\n\n  public boolean isUnlimited() {\n    return limit == null;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ListFunctions.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\n\npublic final class ListFunctions {\n\n  public static <A, B extends A> Pair<List<A>, List<B>> splitByType(A[] items, Class<B> subType) {\n    List<A> as = new ArrayList<>();\n    List<B> bs = new ArrayList<>();\n    for (A a : items) {\n      if (subType.isAssignableFrom(a.getClass())) {\n        bs.add((B) a);\n      } else {\n        as.add(a);\n      }\n    }\n    return new Pair<>(as, bs);\n  }\n\n  @SafeVarargs\n  public static <T> List<T> concatenate(List<T>... lists) {\n    return Stream.of(lists).flatMap(List::stream).collect(Collectors.toList());\n  }\n\n  private ListFunctions() {\n    throw new UnsupportedOperationException(\"Not instantiable\");\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ListOrSingle.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.util.Arrays.asList;\n\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.fasterxml.jackson.databind.annotation.JsonSerialize;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.List;\n\n@JsonSerialize(using = ListOrSingleSerialiser.class)\n@JsonDeserialize(using = ListOrStringDeserialiser.class)\npublic class ListOrSingle<T> extends ArrayList<T> {\n\n  public ListOrSingle(Collection<? extends T> c) {\n    super(c);\n  }\n\n  public ListOrSingle(T... items) {\n    this(asList(items));\n  }\n\n  @Override\n  public String toString() {\n    return size() > 0 ? get(0).toString() : \"\";\n  }\n\n  public static <T> ListOrSingle<T> of(T... items) {\n    return new ListOrSingle<>(items);\n  }\n\n  public static <T> ListOrSingle<T> of(List<T> items) {\n    return new ListOrSingle<>(items);\n  }\n\n  public T getFirst() {\n    return get(0);\n  }\n\n  public T getLast() {\n    return get(size() - 1);\n  }\n\n  @Override\n  public T get(int index) {\n    if (index < 0) {\n      index = size() - 1 + index;\n    }\n\n    return super.get(index);\n  }\n\n  public boolean isSingle() {\n    return size() == 1;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ListOrSingleSerialiser.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fasterxml.jackson.databind.JsonSerializer;\nimport com.fasterxml.jackson.databind.SerializerProvider;\nimport com.fasterxml.jackson.databind.type.CollectionType;\nimport com.fasterxml.jackson.databind.type.TypeFactory;\nimport java.io.IOException;\nimport java.util.List;\n\npublic class ListOrSingleSerialiser extends JsonSerializer<ListOrSingle<Object>> {\n\n  @Override\n  public void serialize(\n      ListOrSingle<Object> value, JsonGenerator gen, SerializerProvider serializers)\n      throws IOException, JsonProcessingException {\n    if (value.isEmpty()) {\n      gen.writeStartArray();\n      gen.writeEndArray();\n      return;\n    }\n\n    Object firstValue = value.getFirst();\n    if (value.isSingle()) {\n      JsonSerializer<Object> serializer = serializers.findValueSerializer(firstValue.getClass());\n      serializer.serialize(firstValue, gen, serializers);\n    } else {\n      CollectionType type =\n          TypeFactory.defaultInstance().constructCollectionType(List.class, firstValue.getClass());\n      JsonSerializer<Object> serializer = serializers.findValueSerializer(type);\n      serializer.serialize(value, gen, serializers);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ListOrStringDeserialiser.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.node.ArrayNode;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Iterator;\nimport java.util.List;\n\npublic class ListOrStringDeserialiser<T> extends JsonDeserializer<ListOrSingle<T>> {\n\n  @Override\n  @SuppressWarnings(\"unchecked\")\n  public ListOrSingle<T> deserialize(JsonParser parser, DeserializationContext ctxt)\n      throws IOException, JsonProcessingException {\n    JsonNode rootNode = parser.readValueAsTree();\n    if (rootNode.isArray()) {\n      ArrayNode arrayNode = (ArrayNode) rootNode;\n      List<T> items = new ArrayList<>();\n      for (Iterator<JsonNode> i = arrayNode.elements(); i.hasNext(); ) {\n        JsonNode node = i.next();\n        Object value = getValue(node);\n        items.add((T) value);\n      }\n\n      return new ListOrSingle<>(items);\n    }\n\n    return new ListOrSingle<>((T) getValue(rootNode));\n  }\n\n  private static Object getValue(JsonNode node) {\n    return node.isTextual()\n        ? node.textValue()\n        : node.isNumber()\n            ? node.numberValue()\n            : node.isBoolean() ? node.booleanValue() : node.textValue();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/LocalNotifier.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class LocalNotifier {\n\n  private static ThreadLocal<Notifier> notifierHolder = new ThreadLocal<Notifier>();\n\n  public static Notifier notifier() {\n    Notifier notifier = notifierHolder.get();\n    if (notifier == null) {\n      notifier = new NullNotifier();\n    }\n\n    return notifier;\n  }\n\n  public static void set(Notifier notifier) {\n    notifierHolder.set(notifier);\n  }\n\n  private static class NullNotifier implements Notifier {\n\n    @Override\n    public void info(String message) {}\n\n    @Override\n    public void error(String message) {}\n\n    @Override\n    public void error(String message, Throwable t) {}\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Message.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class Message {\n\n  private final String message;\n\n  @JsonCreator\n  public Message(@JsonProperty(\"message\") String message) {\n    this.message = message;\n  }\n\n  public String getMessage() {\n    return message;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Metadata.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkParameter;\nimport static java.util.Collections.emptyMap;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport java.util.*;\nimport java.util.function.BiConsumer;\nimport java.util.function.BiFunction;\nimport java.util.function.Consumer;\nimport java.util.function.Function;\n\npublic class Metadata implements Map<String, Object> {\n\n  private final Map<String, Object> data;\n\n  public Metadata() {\n    this.data = emptyMap();\n  }\n\n  @JsonCreator\n  public Metadata(Map<? extends String, ?> data) {\n    this.data = Collections.unmodifiableMap(convertNestedMapsToMetadata(data));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  protected Map<String, Object> convertNestedMapsToMetadata(Map<? extends String, ?> data) {\n    if (data == null) {\n      return emptyMap();\n    }\n\n    Map<String, Object> result = new LinkedHashMap<>();\n    for (Map.Entry<? extends String, ?> entry : data.entrySet()) {\n      Object value = entry.getValue();\n      if (value instanceof Map && !(this.getClass().isInstance(value))) {\n        result.put(entry.getKey(), newInstance((Map<String, Object>) value));\n      } else {\n        result.put(entry.getKey(), value);\n      }\n    }\n    return result;\n  }\n\n  protected Metadata newInstance(Map<String, Object> value) {\n    return new Metadata(value);\n  }\n\n  public static Builder builder() {\n    return new Builder();\n  }\n\n  public static Metadata create(Consumer<Builder> transformer) {\n    final Builder builder = builder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public Metadata transform(Consumer<Builder> transformer) {\n    final Builder builder = toBuilder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public Builder toBuilder() {\n    return new Builder(this);\n  }\n\n  public Integer getInt(String key) {\n    return checkPresenceValidityAndCast(key, Integer.class);\n  }\n\n  public Integer getInt(String key, Integer defaultValue) {\n    return returnIfValidOrDefaultIfNot(key, Integer.class, defaultValue);\n  }\n\n  public Boolean getBoolean(String key) {\n    return checkPresenceValidityAndCast(key, Boolean.class);\n  }\n\n  public Boolean getBoolean(String key, Boolean defaultValue) {\n    return returnIfValidOrDefaultIfNot(key, Boolean.class, defaultValue);\n  }\n\n  public String getString(String key) {\n    return checkPresenceValidityAndCast(key, String.class);\n  }\n\n  public String getString(String key, String defaultValue) {\n    return returnIfValidOrDefaultIfNot(key, String.class, defaultValue);\n  }\n\n  public List<?> getList(String key) {\n    return checkPresenceValidityAndCast(key, List.class);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public Metadata getMetadata(String key) {\n    checkKeyPresent(key);\n    checkParameter(Map.class.isAssignableFrom(get(key).getClass()), key + \" is not a map\");\n    return new Metadata((Map<String, ?>) get(key));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public Metadata getMetadata(String key, Metadata defaultValue) {\n    if (!containsKey(key)) {\n      return defaultValue;\n    }\n\n    checkParameter(Map.class.isAssignableFrom(get(key).getClass()), key + \" is not a map\");\n    return new Metadata((Map<String, ?>) get(key));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private <T> T checkPresenceValidityAndCast(String key, Class<T> type) {\n    checkKeyPresent(key);\n    checkParameter(\n        type.isAssignableFrom(get(key).getClass()),\n        key + \" is not of type \" + type.getSimpleName());\n    return (T) get(key);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private <T> T returnIfValidOrDefaultIfNot(String key, Class<T> type, T defaultValue) {\n    if (!containsKey(key) || !type.isAssignableFrom(get(key).getClass())) {\n      return defaultValue;\n    }\n\n    return (T) get(key);\n  }\n\n  protected void checkKeyPresent(String key) {\n    checkParameter(containsKey(key), key + \"' not present\");\n  }\n\n  public static <T> Metadata from(T myData) {\n    return new Metadata(Json.objectToMap(myData));\n  }\n\n  public static Builder metadata() {\n    return new Builder();\n  }\n\n  public <T> T as(Class<T> myDataClass) {\n    return Json.mapToObject(this, myDataClass);\n  }\n\n  // Map interface implementation - delegate to immutable data map\n  @Override\n  public int size() {\n    return data.size();\n  }\n\n  @Override\n  public boolean isEmpty() {\n    return data.isEmpty();\n  }\n\n  @Override\n  public boolean containsKey(Object key) {\n    return data.containsKey(key);\n  }\n\n  @Override\n  public boolean containsValue(Object value) {\n    return data.containsValue(value);\n  }\n\n  @Override\n  public Object get(Object key) {\n    return data.get(key);\n  }\n\n  @Override\n  public Set<String> keySet() {\n    return data.keySet();\n  }\n\n  @Override\n  public Collection<Object> values() {\n    return data.values();\n  }\n\n  @Override\n  public Set<Entry<String, Object>> entrySet() {\n    return data.entrySet();\n  }\n\n  @Override\n  public Object getOrDefault(Object key, Object defaultValue) {\n    return data.getOrDefault(key, defaultValue);\n  }\n\n  @Override\n  public void forEach(BiConsumer<? super String, ? super Object> action) {\n    data.forEach(action);\n  }\n\n  // Unsupported mutating operations\n  @Override\n  public Object put(String key, Object value) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public Object remove(Object key) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public void putAll(Map<? extends String, ?> m) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public void clear() {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public void replaceAll(BiFunction<? super String, ? super Object, ?> function) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public Object putIfAbsent(String key, Object value) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public boolean remove(Object key, Object value) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public boolean replace(String key, Object oldValue, Object newValue) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public Object replace(String key, Object value) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public Object computeIfAbsent(String key, Function<? super String, ?> mappingFunction) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public Object computeIfPresent(\n      String key, BiFunction<? super String, ? super Object, ?> remappingFunction) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public Object compute(\n      String key, BiFunction<? super String, ? super Object, ?> remappingFunction) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public Object merge(\n      String key, Object value, BiFunction<? super Object, ? super Object, ?> remappingFunction) {\n    throw new UnsupportedOperationException(\"Metadata is immutable\");\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    Metadata metadata = (Metadata) o;\n    return data.equals(metadata.data);\n  }\n\n  @Override\n  public int hashCode() {\n    return data.hashCode();\n  }\n\n  @Override\n  public String toString() {\n    return new StringJoiner(\", \", Metadata.class.getSimpleName() + \"[\", \"]\")\n        .add(\"data=\" + data)\n        .toString();\n  }\n\n  public Metadata deepMerge(Metadata toMerge) {\n    return transform(\n        builder -> {\n          for (Map.Entry<String, Object> entry : toMerge.entrySet()) {\n            if (entry.getValue() instanceof Metadata) {\n              Object existing = get(entry.getKey());\n              if (existing instanceof Metadata) {\n                builder.attr(\n                    entry.getKey(), ((Metadata) existing).deepMerge((Metadata) entry.getValue()));\n              } else {\n                builder.attr(entry.getKey(), entry.getValue());\n              }\n            } else if (entry.getValue() instanceof List<?>) {\n              Object existing = get(entry.getKey());\n              if (existing instanceof List<?>) {\n                List<Object> merged = new ArrayList<>((List<?>) existing);\n                merged.addAll((List<?>) entry.getValue());\n                builder.attr(entry.getKey(), merged);\n              } else {\n                builder.attr(entry.getKey(), entry.getValue());\n              }\n            } else {\n              builder.attr(entry.getKey(), entry.getValue());\n            }\n          }\n        });\n  }\n\n  public Map<String, Object> asMutableMap() {\n    LinkedHashMap<String, Object> map = new LinkedHashMap<>();\n    forEach(\n        (key, value) -> {\n          if (this.getClass().isInstance(value)) {\n            map.put(key, (this.getClass().cast(value)).asMutableMap());\n          } else {\n            map.put(key, value);\n          }\n        });\n\n    return map;\n  }\n\n  public static class Builder {\n\n    private final Map<String, Object> mapBuilder;\n\n    public Builder() {\n      this.mapBuilder = new LinkedHashMap<>();\n    }\n\n    public Builder(Metadata existing) {\n      this.mapBuilder = new LinkedHashMap<>(existing.data);\n    }\n\n    public Builder attr(String key, Object value) {\n      mapBuilder.put(key, value);\n      return this;\n    }\n\n    public Builder attr(String key, Consumer<Builder> transformer) {\n      final Object existing = get(key);\n      final Builder builder =\n          existing instanceof Metadata ? new Builder((Metadata) existing) : builder();\n      transformer.accept(builder);\n      attr(key, builder);\n      return this;\n    }\n\n    public Builder attr(String key, Builder metadataBuilder) {\n      mapBuilder.put(key, metadataBuilder.build());\n      return this;\n    }\n\n    public Builder list(String key, Object... values) {\n      mapBuilder.put(key, List.of(values));\n      return this;\n    }\n\n    public Object get(String key) {\n      return mapBuilder.get(key);\n    }\n\n    public boolean contains(String key) {\n      return mapBuilder.containsKey(key);\n    }\n\n    public void remove(String key) {\n      mapBuilder.remove(key);\n    }\n\n    public Metadata build() {\n      return new Metadata(mapBuilder);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/NetworkAddressRange.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.NetworkAddressUtils.ipToLong;\nimport static com.github.tomakehurst.wiremock.common.NetworkAddressUtils.isValidInet4Address;\n\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\nimport java.util.Objects;\nimport java.util.Set;\nimport java.util.regex.Pattern;\n\npublic abstract class NetworkAddressRange {\n\n  public static final NetworkAddressRange ALL = new All();\n  public static final Set<NetworkAddressRange> ALL_RANGES = Set.of(ALL);\n\n  private static final Pattern SINGLE_IP =\n      Pattern.compile(\"\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\");\n  private static final Pattern IP_RANGE =\n      Pattern.compile(SINGLE_IP.pattern() + \"-\" + SINGLE_IP.pattern());\n\n  public static NetworkAddressRange of(String value) {\n\n    if (value == null || value.isEmpty()) {\n      throw new InvalidInputException(Errors.single(17, value + \" is not a valid network address\"));\n    }\n\n    if (SINGLE_IP.matcher(value).matches()) {\n      return new SingleIp(value);\n    }\n\n    if (IP_RANGE.matcher(value).matches()) {\n      return new IpRange(value);\n    }\n\n    return new DomainNameWildcard(value);\n  }\n\n  public abstract boolean isIncluded(String testValue);\n\n  private static class SingleIp extends NetworkAddressRange {\n\n    private final InetAddress inetAddress;\n\n    private SingleIp(String ipAddress) {\n      this.inetAddress = parseIpAddress(ipAddress);\n    }\n\n    @Override\n    public boolean isIncluded(String testValue) {\n      return lookup(testValue).equals(inetAddress);\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      if (this == o) return true;\n      if (o == null || getClass() != o.getClass()) return false;\n      SingleIp singleIp = (SingleIp) o;\n      return inetAddress.equals(singleIp.inetAddress);\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hash(inetAddress);\n    }\n\n    @Override\n    public String toString() {\n      return inetAddress.toString();\n    }\n  }\n\n  private static class IpRange extends NetworkAddressRange {\n\n    private final Long start;\n    private final Long end;\n    private final String asString;\n\n    private IpRange(String ipRange) {\n      String[] parts = ipRange.split(\"-\");\n      if (parts.length != 2) {\n        throw new InvalidInputException(Errors.single(18, ipRange + \" is not a valid IP range\"));\n      }\n      this.start = ipToLong(parseIpAddress(parts[0]));\n      this.end = ipToLong(parseIpAddress(parts[1]));\n      this.asString = ipRange;\n    }\n\n    @Override\n    public boolean isIncluded(String testValue) {\n      InetAddress testValueAddress = lookup(testValue);\n      long longValue = ipToLong(testValueAddress);\n      return (longValue >= start && longValue <= end);\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      if (this == o) return true;\n      if (o == null || getClass() != o.getClass()) return false;\n      IpRange ipRange = (IpRange) o;\n      return start.equals(ipRange.start) && end.equals(ipRange.end);\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hash(start, end);\n    }\n\n    @Override\n    public String toString() {\n      return asString;\n    }\n  }\n\n  static class DomainNameWildcard extends NetworkAddressRange {\n\n    private final Pattern namePattern;\n\n    private DomainNameWildcard(String namePattern) {\n      String nameRegex = namePattern.replace(\".\", \"\\\\.\").replace(\"*\", \".+\");\n      this.namePattern = Pattern.compile(nameRegex);\n    }\n\n    @Override\n    public boolean isIncluded(String testValue) {\n      return namePattern.matcher(testValue).matches();\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      if (this == o) return true;\n      if (o == null || getClass() != o.getClass()) return false;\n      DomainNameWildcard that = (DomainNameWildcard) o;\n      return namePattern.pattern().equals(that.namePattern.pattern());\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hash(namePattern.pattern());\n    }\n\n    @Override\n    public String toString() {\n      return namePattern.pattern();\n    }\n  }\n\n  private static class All extends NetworkAddressRange {\n\n    @Override\n    public boolean isIncluded(String testValue) {\n      return true;\n    }\n  }\n\n  private static InetAddress parseIpAddress(String ipAddress) {\n    if (!isValidInet4Address(ipAddress)) {\n      throw new InvalidInputException(Errors.single(16, ipAddress + \" is not a valid IP address\"));\n    }\n\n    return lookup(ipAddress);\n  }\n\n  private static InetAddress lookup(String host) {\n    try {\n      return InetAddress.getByName(host);\n    } catch (UnknownHostException e) {\n      throw new InvalidInputException(\n          e, Errors.single(17, host + \" is not a valid network address\"));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/NetworkAddressRules.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.NetworkAddressRange.ALL_RANGES;\nimport static java.util.Collections.emptySet;\n\nimport java.util.HashSet;\nimport java.util.Set;\n\npublic interface NetworkAddressRules {\n  NetworkAddressRules ALLOW_ALL = new DefaultNetworkAddressRules(ALL_RANGES, emptySet());\n\n  static Builder builder() {\n    return new Builder();\n  }\n\n  boolean isAllowed(String testValue);\n\n  boolean isAllowedAll();\n\n  public static class Builder {\n    private final Set<NetworkAddressRange> allowed = new HashSet<>();\n    private final Set<NetworkAddressRange> denied = new HashSet<>();\n\n    public Builder allow(String expression) {\n      allowed.add(NetworkAddressRange.of(expression));\n      return this;\n    }\n\n    public Builder deny(String expression) {\n      denied.add(NetworkAddressRange.of(expression));\n      return this;\n    }\n\n    public NetworkAddressRules build() {\n      Set<NetworkAddressRange> allowedRanges = allowed;\n      if (allowedRanges.isEmpty()) {\n        allowedRanges = ALL_RANGES;\n      }\n      return new DefaultNetworkAddressRules(Set.copyOf(allowedRanges), Set.copyOf(denied));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/NetworkAddressUtils.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\n\npublic class NetworkAddressUtils {\n\n  private NetworkAddressUtils() {}\n\n  public static boolean isValidInet4Address(String ip) {\n    try {\n      return InetAddress.getByName(ip).getHostAddress().equals(ip);\n    } catch (UnknownHostException ex) {\n      return false;\n    }\n  }\n\n  public static long ipToLong(InetAddress ipAddress) {\n    long resultIP = 0;\n    byte[] ipAddressOctets = ipAddress.getAddress();\n\n    for (byte octet : ipAddressOctets) {\n      resultIP <<= 8;\n      resultIP |= octet & 0xFF;\n    }\n    return resultIP;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/NotPermittedException.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class NotPermittedException extends ClientError {\n\n  public NotPermittedException(Errors errors) {\n    super(errors);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/NotWritableException.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class NotWritableException extends RuntimeException {\n\n  public NotWritableException(String message) {\n    super(message);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Notifier.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic interface Notifier {\n\n  public static final String KEY = \"Notifier\";\n\n  void info(String message);\n\n  void error(String message);\n\n  void error(String message, Throwable t);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Pair.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.util.Objects.requireNonNull;\n\nimport java.util.Objects;\n\npublic final class Pair<A, B> {\n\n  public final A a;\n  public final B b;\n\n  public Pair(A a, B b) {\n    this.a = requireNonNull(a);\n    this.b = requireNonNull(b);\n  }\n\n  public static <A, B> Pair<A, B> pair(A a, B b) {\n    return new Pair<>(a, b);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (!(o instanceof Pair)) return false;\n    Pair<?, ?> pair = (Pair<?, ?>) o;\n    return a.equals(pair.a) && b.equals(pair.b);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(a, b);\n  }\n\n  @Override\n  public String toString() {\n    return a + \"=\" + b;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ParameterUtils.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.util.Collection;\nimport java.util.Iterator;\nimport java.util.NoSuchElementException;\nimport java.util.function.Predicate;\n\npublic class ParameterUtils {\n\n  private ParameterUtils() {}\n\n  public static <T> boolean isNullOrEmptyCollection(Collection<T> collection) {\n    return collection == null || collection.isEmpty();\n  }\n\n  public static <T> boolean isNotNullOrEmptyCollection(Collection<T> collection) {\n    return !isNullOrEmptyCollection(collection);\n  }\n\n  public static <T> T getFirstNonNull(T first, T second) {\n    if (first != null) {\n      return first;\n    }\n    if (second != null) {\n      return second;\n    }\n    throw new NullPointerException(\"Both parameters are null\");\n  }\n\n  public static <T> T getFirstNonNull(T first, T second, String etr) {\n    if (first != null) {\n      return first;\n    }\n    if (second != null) {\n      return second;\n    }\n    throw new NullPointerException(etr);\n  }\n\n  public static void checkParameter(boolean condition, String errorMessage) {\n    if (!condition) {\n      throw new IllegalArgumentException(errorMessage);\n    }\n  }\n\n  public static void checkState(boolean expression, String errorMessage) {\n    if (!expression) {\n      throw new IllegalStateException(errorMessage);\n    }\n  }\n\n  public static <T> T checkNotNull(T value, String errorMessage) {\n    if (value == null) {\n      throw new NullPointerException(errorMessage);\n    }\n    return value;\n  }\n\n  public static <T> int indexOf(Iterable<T> iterable, Predicate<? super T> predicate) {\n    checkNotNull(iterable, \"iterable\");\n    checkNotNull(predicate, \"predicate\");\n    Iterator<T> iterator = iterable.iterator();\n    for (int i = 0; iterator.hasNext(); i++) {\n      T current = iterator.next();\n      if (predicate.test(current)) {\n        return i;\n      }\n    }\n\n    return -1;\n  }\n\n  public static <T> T getFirst(Iterable<T> iterable, T defaultValue) {\n    return iterable != null && iterable.iterator().hasNext()\n        ? iterable.iterator().next()\n        : defaultValue;\n  }\n\n  public static <T> T getLast(Iterable<T> iterable) {\n    if (iterable == null || !iterable.iterator().hasNext()) {\n      throw new NoSuchElementException();\n    }\n    Iterator<T> iterator = iterable.iterator();\n    while (true) {\n      T current = iterator.next();\n      if (!iterator.hasNext()) {\n        return current;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Prioritisable.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.util.UUID;\n\npublic interface Prioritisable {\n\n  int DEFAULT_PRIORITY = 5;\n\n  UUID getId();\n\n  Integer getPriority();\n\n  long getInsertionIndex();\n\n  <T extends Prioritisable> T withInsertionIndex(long newInsertionIndex);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ProhibitedNetworkAddressException.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic class ProhibitedNetworkAddressException extends RuntimeException {}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ProxySettings.java",
    "content": "/*\n * Copyright (C) 2013-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkParameter;\nimport static com.github.tomakehurst.wiremock.common.Strings.isNotEmpty;\nimport static org.wiremock.url.SchemeRegistry.http;\n\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.IllegalUri;\nimport org.wiremock.url.Password;\n\npublic class ProxySettings {\n\n  public static final ProxySettings NO_PROXY = new ProxySettings(null, 0);\n  public static final int DEFAULT_PORT = 80;\n\n  private final String host;\n  private final int port;\n\n  private String username;\n  private String password;\n\n  public ProxySettings(String host, int port) {\n    this.host = host;\n    this.port = port;\n  }\n\n  @SuppressWarnings(\"HttpUrlsUsage\")\n  public static ProxySettings fromString(String config) {\n    AbsoluteUrl proxyUrl;\n    try {\n      proxyUrl = AbsoluteUrl.parse(config);\n    } catch (IllegalUri e) {\n      if (config.startsWith(\"http://\") || config.startsWith(\"https://\")) {\n        throw new IllegalArgumentException(\n            String.format(\"'%s' could not be parsed as a proxy URL\", config), e);\n      }\n      try {\n        proxyUrl = AbsoluteUrl.parse(\"http://\" + config);\n      } catch (IllegalUri e2) {\n        IllegalArgumentException exception =\n            new IllegalArgumentException(\n                String.format(\n                    \"'%s' could not be parsed as a proxy URL with or without an 'http://' prefix\",\n                    config),\n                e);\n        exception.addSuppressed(e2);\n        throw exception;\n      }\n    }\n    if (!proxyUrl.getScheme().equals(http)) {\n      throw new IllegalArgumentException(\"Proxy via does not support any other protocol than http\");\n    }\n    checkParameter(!proxyUrl.getHost().isEmpty(), \"Host part of proxy must be specified\");\n    ProxySettings proxySettings =\n        new ProxySettings(proxyUrl.getHost().toString(), proxyUrl.getResolvedPort().getIntValue());\n    if (proxyUrl.getUserInfo() != null) {\n      proxySettings.setUsername(proxyUrl.getUserInfo().getUsername().toString());\n      Password password = proxyUrl.getUserInfo().getPassword();\n      if (password != null) {\n        proxySettings.setPassword(password.toString());\n      }\n    }\n    return proxySettings;\n  }\n\n  public String host() {\n    return host;\n  }\n\n  public int port() {\n    return port;\n  }\n\n  public String getUsername() {\n    return username;\n  }\n\n  public void setUsername(String username) {\n    this.username = username;\n  }\n\n  public String getPassword() {\n    return password;\n  }\n\n  public void setPassword(String password) {\n    this.password = password;\n  }\n\n  @Override\n  public String toString() {\n    if (this == NO_PROXY) {\n      return \"(no proxy)\";\n    }\n\n    return String.format(\n        \"%s:%s%s\", host(), port(), (isNotEmpty(this.username) ? \" (with credentials)\" : \"\"));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/RequestCache.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.util.Arrays.asList;\n\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.function.Supplier;\n\npublic class RequestCache {\n\n  private static RequestCache OFF =\n      new RequestCache() {\n        @Override\n        public void put(Key key, Object value) {}\n\n        @Override\n        public <T> T get(Key key) {\n          return null;\n        }\n\n        @Override\n        public <T> T get(Key key, Supplier<T> supplier) {\n          return supplier.get();\n        }\n      };\n\n  private static final ThreadLocal<RequestCache> current = new ThreadLocal<>();\n\n  public static RequestCache getCurrent() {\n    RequestCache requestCache = current.get();\n    if (requestCache == null) {\n      requestCache = new RequestCache();\n      current.set(requestCache);\n    }\n\n    return requestCache;\n  }\n\n  public static void onRequestEnd() {\n    current.remove();\n  }\n\n  public static void disable() {\n    current.set(OFF);\n  }\n\n  private final Map<Key, Object> cache = new HashMap<>();\n\n  public void put(Key key, Object value) {\n    cache.put(key, value);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T> T get(Key key) {\n    return (T) cache.get(key);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T> T get(Key key, Supplier<T> supplier) {\n    return (T) cache.computeIfAbsent(key, k -> supplier.get());\n  }\n\n  public static class Key {\n    private final Class<?> forClass;\n    private final List<?> elements;\n\n    public static Key keyFor(Class<?> forClass, Object... elements) {\n      return new Key(forClass, asList(elements));\n    }\n\n    private Key(Class<?> forClass, List<?> elements) {\n      this.forClass = forClass;\n      this.elements = elements;\n    }\n\n    @Override\n    public String toString() {\n      final StringBuilder sb = new StringBuilder(\"Key{\");\n      sb.append(\"forClass=\").append(forClass);\n      sb.append(\", elements=\").append(elements);\n      sb.append('}');\n      return sb.toString();\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      if (this == o) return true;\n      if (o == null || getClass() != o.getClass()) return false;\n      Key key = (Key) o;\n      return forClass.equals(key.forClass) && elements.equals(key.elements);\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hash(forClass, elements);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ResourceUtil.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.*;\n\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.net.URL;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\n\npublic class ResourceUtil {\n\n  private ResourceUtil() {}\n\n  public static <T> ClassLoader getLoader(Class<T> className) {\n    return getFirstNonNull(\n        className.getClassLoader(), Thread.currentThread().getContextClassLoader());\n  }\n\n  public static <T> URL getResource(Class<T> className, String resourceName) {\n    ClassLoader loader = getLoader(className);\n    URL url = loader.getResource(resourceName);\n    checkParameter(url != null, String.format(\"resource %s not found.\", resourceName));\n    return loader.getResource(resourceName);\n  }\n\n  public static <T> URI getResourceURI(Class<T> className, String resourceName) {\n    try {\n      return getResource(className, resourceName).toURI();\n    } catch (URISyntaxException e) {\n      return throwUnchecked(e, URI.class);\n    }\n  }\n\n  public static <T> Path getResourcePath(Class<T> className, String resourceName) {\n    return Paths.get(getResourceURI(className, resourceName));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/SilentErrorHandler.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport org.xml.sax.ErrorHandler;\nimport org.xml.sax.SAXException;\nimport org.xml.sax.SAXParseException;\n\npublic class SilentErrorHandler implements ErrorHandler {\n  @Override\n  public void warning(final SAXParseException exception) throws SAXException {\n    throw exception;\n  }\n\n  @Override\n  public void error(final SAXParseException exception) throws SAXException {\n    throw exception;\n  }\n\n  @Override\n  public void fatalError(final SAXParseException exception) throws SAXException {\n    throw exception;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/SingleRootFileSource.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.io.File;\n\npublic class SingleRootFileSource extends AbstractFileSource {\n\n  public SingleRootFileSource(File rootDirectory) {\n    super(rootDirectory);\n  }\n\n  public SingleRootFileSource(String rootPath) {\n    super(new File(rootPath));\n  }\n\n  @Override\n  public FileSource child(String subDirectoryName) {\n    return new SingleRootFileSource(new File(rootDirectory, subDirectoryName));\n  }\n\n  @Override\n  protected boolean readOnly() {\n    return false;\n  }\n\n  @Override\n  public String toString() {\n    return SingleRootFileSource.class.getSimpleName() + \": \" + rootDirectory;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Slf4jNotifier.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class Slf4jNotifier implements Notifier {\n\n  private static final Logger log = LoggerFactory.getLogger(\"WireMock\");\n\n  private final boolean verbose;\n\n  public Slf4jNotifier(boolean verbose) {\n    this.verbose = verbose;\n  }\n\n  @Override\n  public void info(String message) {\n    if (verbose) {\n      log.info(message);\n    }\n  }\n\n  @Override\n  public void error(String message) {\n    log.error(message);\n  }\n\n  @Override\n  public void error(String message, Throwable t) {\n    log.error(message, t);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/SortedConcurrentPrioritisableSet.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.common.Prioritisable.DEFAULT_PRIORITY;\n\nimport java.util.Comparator;\nimport java.util.Iterator;\nimport java.util.UUID;\nimport java.util.concurrent.ConcurrentSkipListSet;\nimport java.util.concurrent.atomic.AtomicLong;\nimport java.util.stream.Stream;\n\npublic class SortedConcurrentPrioritisableSet<T extends Prioritisable> implements Iterable<T> {\n\n  private final AtomicLong insertionCount;\n  private final ConcurrentSkipListSet<T> set;\n\n  public SortedConcurrentPrioritisableSet() {\n    insertionCount = new AtomicLong();\n    set = new ConcurrentSkipListSet<>(sortedByPriorityThenReverseInsertionOrder());\n  }\n\n  private Comparator<Prioritisable> sortedByPriorityThenReverseInsertionOrder() {\n    return (one, two) -> {\n      int priorityComparison = comparePriorityWith(one, two);\n      if (priorityComparison != 0) {\n        return priorityComparison;\n      }\n\n      return Long.compare(two.getInsertionIndex(), one.getInsertionIndex());\n    };\n  }\n\n  private static int comparePriorityWith(Prioritisable one, Prioritisable two) {\n    int thisPriority = getFirstNonNull(one.getPriority(), DEFAULT_PRIORITY);\n    int otherPriority = getFirstNonNull(two.getPriority(), DEFAULT_PRIORITY);\n    return thisPriority - otherPriority;\n  }\n\n  @Override\n  public Iterator<T> iterator() {\n    return set.iterator();\n  }\n\n  public Stream<T> stream() {\n    return set.stream();\n  }\n\n  public T add(T mapping) {\n    mapping = mapping.withInsertionIndex(insertionCount.getAndIncrement());\n    boolean actuallyAdded = set.add(mapping);\n    return mapping;\n  }\n\n  public boolean remove(final UUID mappingId) {\n    return set.removeIf(mapping -> mappingId != null && mappingId.equals(mapping.getId()));\n  }\n\n  public T replace(T existingItem, T newItem) {\n    if (set.remove(existingItem)) {\n      set.add(newItem);\n    }\n\n    return newItem;\n  }\n\n  public void clear() {\n    set.clear();\n  }\n\n  @Override\n  public String toString() {\n    return set.toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Source.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic interface Source<T> {\n  T load();\n\n  void save(T item);\n\n  boolean exists();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/StreamSources.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport com.github.tomakehurst.wiremock.admin.NotFoundException;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\nimport java.nio.charset.Charset;\n\npublic class StreamSources {\n  private StreamSources() {}\n\n  public static InputStreamSource forString(final String string, final Charset charset) {\n    return new StringInputStreamSource(string, charset);\n  }\n\n  public static InputStreamSource forBytes(final byte[] bytes) {\n    return new ByteArrayInputStreamSource(bytes);\n  }\n\n  public static InputStreamSource forBlobStoreItem(BlobStore blobStore, String key) {\n    return () ->\n        blobStore\n            .getStream(key)\n            .orElseThrow(() -> new NotFoundException(\"Not found in blob store: \" + key));\n  }\n\n  public static class StringInputStreamSource extends ByteArrayInputStreamSource {\n\n    public StringInputStreamSource(String string, Charset charset) {\n      super(Strings.bytesFromString(string, charset));\n    }\n  }\n\n  public static class ByteArrayInputStreamSource implements InputStreamSource {\n\n    private final byte[] bytes;\n\n    public ByteArrayInputStreamSource(byte[] bytes) {\n      this.bytes = bytes;\n    }\n\n    @Override\n    public InputStream getStream() {\n      return bytes == null ? null : new ByteArrayInputStream(bytes);\n    }\n  }\n\n  public static InputStreamSource empty() {\n    return forBytes(new byte[0]);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Strings.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.lang.Math.max;\nimport static java.lang.System.lineSeparator;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport java.nio.charset.Charset;\nimport java.util.Arrays;\nimport java.util.Random;\nimport java.util.concurrent.ThreadLocalRandom;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\npublic class Strings {\n\n  private Strings() {}\n\n  private static ThreadLocalRandom random() {\n    return ThreadLocalRandom.current();\n  }\n\n  public static int getLevenshteinDistance(CharSequence s, CharSequence t) {\n    if (s == null || t == null) {\n      throw new IllegalArgumentException(\"Strings must not be null\");\n    }\n\n    int n = s.length();\n    int m = t.length();\n\n    if (n == 0) {\n      return m;\n    }\n    if (m == 0) {\n      return n;\n    }\n\n    if (n > m) {\n      // swap the input strings to consume less memory\n      final CharSequence tmp = s;\n      s = t;\n      t = tmp;\n      n = m;\n      m = t.length();\n    }\n\n    final int[] p = new int[n + 1];\n    // indexes into strings s and t\n    int i; // iterates through s\n    int j; // iterates through t\n    int upperleft;\n    int upper;\n\n    char jOfT; // jth character of t\n    int cost;\n\n    for (i = 0; i <= n; i++) {\n      p[i] = i;\n    }\n\n    for (j = 1; j <= m; j++) {\n      upperleft = p[0];\n      jOfT = t.charAt(j - 1);\n      p[0] = j;\n\n      for (i = 1; i <= n; i++) {\n        upper = p[i];\n        cost = s.charAt(i - 1) == jOfT ? 0 : 1;\n        // minimum of cell to the left+1, to the top+1, diagonally left and up +cost\n        p[i] = Math.min(Math.min(p[i - 1] + 1, p[i] + 1), upperleft + cost);\n        upperleft = upper;\n      }\n    }\n\n    return p[n];\n  }\n\n  public static String randomAlphanumeric(final int count) {\n    return random(count, true, true);\n  }\n\n  public static String random(final int count, final boolean letters, final boolean numbers) {\n    return random(count, 0, 0, letters, numbers);\n  }\n\n  public static String randomAlphabetic(final int count) {\n    return random(count, true, false);\n  }\n\n  public static String randomNumeric(final int count) {\n    return random(count, false, true);\n  }\n\n  public static String random(final int count, final String chars) {\n    if (chars == null) {\n      return random(count, 0, 0, false, false, null, random());\n    }\n    return random(count, chars.toCharArray());\n  }\n\n  public static String random(final int count, final char... chars) {\n    if (chars == null) {\n      return random(count, 0, 0, false, false, null, random());\n    }\n    return random(count, 0, chars.length, false, false, chars, random());\n  }\n\n  public static String randomAscii(final int count) {\n    return random(count, 32, 127, false, false);\n  }\n\n  public static String random(\n      final int count,\n      final int start,\n      final int end,\n      final boolean letters,\n      final boolean numbers) {\n    return random(count, start, end, letters, numbers, null, random());\n  }\n\n  public static String random(\n      int count,\n      int start,\n      int end,\n      final boolean letters,\n      final boolean numbers,\n      final char[] chars,\n      final Random random) {\n    if (count == 0) {\n      return \"\";\n    }\n    if (count < 0) {\n      throw new IllegalArgumentException(\n          \"Requested random string length \" + count + \" is less than 0.\");\n    }\n    if (chars != null && chars.length == 0) {\n      throw new IllegalArgumentException(\"The chars array must not be empty\");\n    }\n\n    if (start == 0 && end == 0) {\n      if (chars != null) {\n        end = chars.length;\n      } else if (!letters && !numbers) {\n        end = Character.MAX_CODE_POINT;\n      } else {\n        end = 'z' + 1;\n        start = ' ';\n      }\n    } else if (end <= start) {\n      throw new IllegalArgumentException(\n          \"Parameter end (\" + end + \") must be greater than start (\" + start + \")\");\n    }\n\n    final int zeroDigitAscii = 48;\n    final int firstLetterAscii = 65;\n\n    if (chars == null && (numbers && end <= zeroDigitAscii || letters && end <= firstLetterAscii)) {\n      throw new IllegalArgumentException(\n          \"Parameter end (\"\n              + end\n              + \") must be greater then (\"\n              + zeroDigitAscii\n              + \") for generating digits \"\n              + \"or greater then (\"\n              + firstLetterAscii\n              + \") for generating letters.\");\n    }\n\n    final StringBuilder builder = new StringBuilder(count);\n    final int gap = end - start;\n\n    while (count-- != 0) {\n      final int codePoint;\n      if (chars == null) {\n        codePoint = random.nextInt(gap) + start;\n\n        switch (Character.getType(codePoint)) {\n          case Character.UNASSIGNED:\n          case Character.PRIVATE_USE:\n          case Character.SURROGATE:\n            count++;\n            continue;\n        }\n\n      } else {\n        codePoint = chars[random.nextInt(gap) + start];\n      }\n\n      final int numberOfChars = Character.charCount(codePoint);\n      if (count == 0 && numberOfChars > 1) {\n        count++;\n        continue;\n      }\n\n      if (letters && Character.isLetter(codePoint)\n          || numbers && Character.isDigit(codePoint)\n          || !letters && !numbers) {\n        builder.appendCodePoint(codePoint);\n\n        if (numberOfChars == 2) {\n          count--;\n        }\n\n      } else {\n        count++;\n      }\n    }\n    return builder.toString();\n  }\n\n  public static String rightPad(final String str, final int size) {\n    return rightPad(str, size, ' ');\n  }\n\n  public static String rightPad(final String str, final int size, final char padChar) {\n    if (str == null) {\n      return null;\n    }\n    final int pads = size - str.length();\n    if (pads <= 0) {\n      return str; // returns original String when possible\n    }\n    if (pads > 8192) {\n      return rightPad(str, size, String.valueOf(padChar));\n    }\n    return str.concat(repeat(padChar, pads));\n  }\n\n  public static String rightPad(final String str, final int size, String padStr) {\n    if (str == null) {\n      return null;\n    }\n    if (isEmpty(padStr)) {\n      padStr = \" \";\n    }\n    final int padLen = padStr.length();\n    final int strLen = str.length();\n    final int pads = size - strLen;\n    if (pads <= 0) {\n      return str; // returns original String when possible\n    }\n    if (padLen == 1 && pads <= 8192) {\n      return rightPad(str, size, padStr.charAt(0));\n    }\n\n    if (pads == padLen) {\n      return str.concat(padStr);\n    }\n    if (pads < padLen) {\n      return str.concat(padStr.substring(0, pads));\n    }\n    final char[] padding = new char[pads];\n    final char[] padChars = padStr.toCharArray();\n    for (int i = 0; i < pads; i++) {\n      padding[i] = padChars[i % padLen];\n    }\n    return str.concat(new String(padding));\n  }\n\n  public static String repeat(final char ch, final int repeat) {\n    if (repeat <= 0) {\n      return \"\";\n    }\n    final char[] buf = new char[repeat];\n    Arrays.fill(buf, ch);\n    return new String(buf);\n  }\n\n  public static String stringFromBytes(byte[] bytes) {\n    return stringFromBytes(bytes, UTF_8);\n  }\n\n  public static String stringFromBytes(byte[] bytes, Charset charset) {\n    if (bytes == null) {\n      return null;\n    }\n\n    return new String(bytes, charset);\n  }\n\n  public static byte[] bytesFromString(String str) {\n    return bytesFromString(str, UTF_8);\n  }\n\n  public static byte[] bytesFromString(String str, Charset charset) {\n    if (str == null) {\n      return null;\n    }\n\n    return str.getBytes(charset);\n  }\n\n  public static String wrapIfLongestLineExceedsLimit(String s, int maxLineLength) {\n    int longestLength = findLongestLineLength(s);\n    if (longestLength > maxLineLength) {\n      String wrapped = wrap(s, maxLineLength, null, true);\n      return wrapped.replaceAll(\"(?m)^[ \\t]*\\r?\\n\", \"\");\n    }\n\n    return s;\n  }\n\n  public static String wrap(\n      final String str,\n      final int wrapLength,\n      final String newLineStr,\n      final boolean wrapLongWords) {\n    return wrap(str, wrapLength, newLineStr, wrapLongWords, \" \");\n  }\n\n  public static String wrap(\n      final String str,\n      int wrapLength,\n      String newLineStr,\n      final boolean wrapLongWords,\n      String wrapOn) {\n    if (str == null) {\n      return null;\n    }\n    if (newLineStr == null) {\n      newLineStr = System.lineSeparator();\n    }\n    if (wrapLength < 1) {\n      wrapLength = 1;\n    }\n    if (isBlank(wrapOn)) {\n      wrapOn = \" \";\n    }\n    final Pattern patternToWrapOn = Pattern.compile(wrapOn);\n    final int inputLineLength = str.length();\n    int offset = 0;\n    final StringBuilder wrappedLine = new StringBuilder(inputLineLength + 32);\n\n    while (offset < inputLineLength) {\n      int spaceToWrapAt = -1;\n      Matcher matcher =\n          patternToWrapOn.matcher(\n              str.substring(\n                  offset,\n                  Math.min(\n                      (int) Math.min(Integer.MAX_VALUE, offset + wrapLength + 1L),\n                      inputLineLength)));\n      if (matcher.find()) {\n        if (matcher.start() == 0) {\n          offset += matcher.end();\n          continue;\n        }\n        spaceToWrapAt = matcher.start() + offset;\n      }\n\n      // only last line without leading spaces is left\n      if (inputLineLength - offset <= wrapLength) {\n        break;\n      }\n\n      while (matcher.find()) {\n        spaceToWrapAt = matcher.start() + offset;\n      }\n\n      if (spaceToWrapAt >= offset) {\n        // normal case\n        wrappedLine.append(str, offset, spaceToWrapAt);\n        wrappedLine.append(newLineStr);\n        offset = spaceToWrapAt + 1;\n\n      } else // really long word or URL\n      if (wrapLongWords) {\n        // wrap really long word one line at a time\n        wrappedLine.append(str, offset, wrapLength + offset);\n        wrappedLine.append(newLineStr);\n        offset += wrapLength;\n      } else {\n        // do not wrap really long word, just extend beyond limit\n        matcher = patternToWrapOn.matcher(str.substring(offset + wrapLength));\n        if (matcher.find()) {\n          spaceToWrapAt = matcher.start() + offset + wrapLength;\n        }\n\n        if (spaceToWrapAt >= 0) {\n          wrappedLine.append(str, offset, spaceToWrapAt);\n          wrappedLine.append(newLineStr);\n          offset = spaceToWrapAt + 1;\n        } else {\n          wrappedLine.append(str, offset, str.length());\n          offset = inputLineLength;\n        }\n      }\n    }\n\n    // Whatever is left in line is short enough to just pass through\n    wrappedLine.append(str, offset, str.length());\n\n    return wrappedLine.toString();\n  }\n\n  public static String substringAfterLast(final String str, final int separator) {\n    if (isEmpty(str)) {\n      return str;\n    }\n    final int pos = str.lastIndexOf(separator);\n    if (pos == -1 || pos == str.length() - 1) {\n      return \"\";\n    }\n    return str.substring(pos + 1);\n  }\n\n  public static String substringAfterLast(final String str, final String separator) {\n    if (isEmpty(str)) {\n      return str;\n    }\n    if (isEmpty(separator)) {\n      return \"\";\n    }\n    final int pos = str.lastIndexOf(separator);\n    if (pos == -1 || pos == str.length() - separator.length()) {\n      return \"\";\n    }\n    return str.substring(pos + separator.length());\n  }\n\n  public static int countMatches(final CharSequence str, final char ch) {\n    if (isEmpty(str)) {\n      return 0;\n    }\n    int count = 0;\n    // We could also call str.toCharArray() for faster lookups but that would generate more garbage.\n    for (int i = 0; i < str.length(); i++) {\n      if (ch == str.charAt(i)) {\n        count++;\n      }\n    }\n    return count;\n  }\n\n  public static int ordinalIndexOf(\n      final CharSequence str, final CharSequence searchStr, final int ordinal) {\n    return ordinalIndexOf(str, searchStr, ordinal, false);\n  }\n\n  private static int ordinalIndexOf(\n      final CharSequence str,\n      final CharSequence searchStr,\n      final int ordinal,\n      final boolean lastIndex) {\n    if (str == null || searchStr == null || ordinal <= 0) {\n      return -1;\n    }\n    if (searchStr.length() == 0) {\n      return lastIndex ? str.length() : 0;\n    }\n    int found = 0;\n    // set the initial index beyond the end of the string\n    // this is to allow for the initial index decrement/increment\n    int index = lastIndex ? str.length() : -1;\n    do {\n      if (lastIndex) {\n        index = lastIndexOf(str, searchStr, index - 1); // step backwards through string\n      } else {\n        index = indexOf(str, searchStr, index + 1); // step forwards through string\n      }\n      if (index < 0) {\n        return index;\n      }\n      found++;\n    } while (found < ordinal);\n    return index;\n  }\n\n  private static int findLongestLineLength(String s) {\n    String[] lines = s.split(\"\\n\");\n    int longestLength = 0;\n    for (String line : lines) {\n      int length = line.length();\n      if (length > longestLength) {\n        longestLength = length;\n      }\n    }\n\n    return longestLength;\n  }\n\n  public static double normalisedLevenshteinDistance(String one, String two) {\n    if (one == null || two == null) {\n      return 1.0;\n    }\n\n    double maxDistance = max(one.length(), two.length());\n    double actualDistance = getLevenshteinDistance(one, two);\n    return (actualDistance / maxDistance);\n  }\n\n  public static String normaliseLineBreaks(String s) {\n    return s.replace(\"\\r\\n\", \"\\n\").replace(\"\\n\", lineSeparator());\n  }\n\n  public static boolean isNullOrEmpty(String s) {\n    return isNull(s) || s.isEmpty();\n  }\n\n  public static boolean isNotNullOrEmpty(String s) {\n    return !isNullOrEmpty(s);\n  }\n\n  public static boolean isBlank(String s) {\n    return isNull(s) || s.isBlank();\n  }\n\n  public static boolean isNotBlank(String s) {\n    return !isBlank(s);\n  }\n\n  public static boolean isNull(String s) {\n    return s == null;\n  }\n\n  public static boolean isNotNull(String s) {\n    return !isNull(s);\n  }\n\n  public static boolean isEmpty(CharSequence charSequence) {\n    return charSequence == null || charSequence.length() == 0;\n  }\n\n  public static boolean isEmpty(String s) {\n    return isNull(s) || s.isEmpty();\n  }\n\n  public static boolean isNotEmpty(String s) {\n    return !isEmpty(s);\n  }\n\n  public static String removeStart(String str, String remove) {\n    if (isEmpty(str) || isEmpty(remove)) {\n      return str;\n    }\n    if (str.startsWith(remove)) {\n      return str.substring(remove.length());\n    }\n    return str;\n  }\n\n  private static boolean checkLaterThan1(\n      final CharSequence cs, final CharSequence searchChar, final int len2, final int start1) {\n    for (int i = 1, j = len2 - 1; i <= j; i++, j--) {\n      if (cs.charAt(start1 + i) != searchChar.charAt(i)\n          || cs.charAt(start1 + j) != searchChar.charAt(j)) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  private static int indexOf(\n      final CharSequence cs, final CharSequence searchChar, final int start) {\n    if (cs instanceof String) {\n      return ((String) cs).indexOf(searchChar.toString(), start);\n    }\n    if (cs instanceof StringBuilder) {\n      return ((StringBuilder) cs).indexOf(searchChar.toString(), start);\n    }\n    if (cs instanceof StringBuffer) {\n      return ((StringBuffer) cs).indexOf(searchChar.toString(), start);\n    }\n    return cs.toString().indexOf(searchChar.toString(), start);\n  }\n\n  private static int lastIndexOf(final CharSequence cs, final CharSequence searchChar, int start) {\n    if (searchChar == null || cs == null) {\n      return -1;\n    }\n    if (searchChar instanceof String) {\n      if (cs instanceof String) {\n        return ((String) cs).lastIndexOf((String) searchChar, start);\n      }\n      if (cs instanceof StringBuilder) {\n        return ((StringBuilder) cs).lastIndexOf((String) searchChar, start);\n      }\n      if (cs instanceof StringBuffer) {\n        return ((StringBuffer) cs).lastIndexOf((String) searchChar, start);\n      }\n    }\n\n    final int len1 = cs.length();\n    final int len2 = searchChar.length();\n\n    if (start > len1) {\n      start = len1;\n    }\n\n    if (start < 0 || len2 > len1) {\n      return -1;\n    }\n\n    if (len2 == 0) {\n      return start;\n    }\n\n    if (len2 <= 16) {\n      if (cs instanceof String) {\n        return ((String) cs).lastIndexOf(searchChar.toString(), start);\n      }\n      if (cs instanceof StringBuilder) {\n        return ((StringBuilder) cs).lastIndexOf(searchChar.toString(), start);\n      }\n      if (cs instanceof StringBuffer) {\n        return ((StringBuffer) cs).lastIndexOf(searchChar.toString(), start);\n      }\n    }\n\n    if (start + len2 > len1) {\n      start = len1 - len2;\n    }\n\n    final char char0 = searchChar.charAt(0);\n\n    int i = start;\n    while (true) {\n      while (cs.charAt(i) != char0) {\n        i--;\n        if (i < 0) {\n          return -1;\n        }\n      }\n      if (checkLaterThan1(cs, searchChar, len2, i)) {\n        return i;\n      }\n      i--;\n      if (i < 0) {\n        return -1;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/TextFile.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport java.io.File;\nimport java.net.URI;\n\npublic class TextFile extends BinaryFile {\n\n  public TextFile(URI uri) {\n    super(uri);\n  }\n\n  public String readContentsAsString() {\n    return new String(super.readContents(), UTF_8);\n  }\n\n  public String getPath() {\n    return new File(getUri().getSchemeSpecificPart()).getPath();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/TextType.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\npublic enum TextType {\n  JSON,\n  XML,\n  PLAIN_TEXT\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Timing.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.google.common.base.Stopwatch;\n\npublic class Timing {\n\n  public static final Timing UNTIMED = create();\n\n  private volatile Integer addedDelay;\n  private volatile Integer processTime;\n  private volatile Integer responseSendTime;\n\n  public static Timing create() {\n    return new Timing(null, null, null, null, null);\n  }\n\n  private Timing(\n      @JsonProperty(\"addedDelay\") Integer addedDelay,\n      @JsonProperty(\"processTime\") Integer processTime,\n      @JsonProperty(\"responseSendTime\") Integer responseSendTime,\n      @JsonProperty(\"serveTime\") Integer ignored1,\n      @JsonProperty(\"totalTime\") Integer ignored2) {\n    this.addedDelay = addedDelay;\n    this.processTime = processTime;\n    this.responseSendTime = responseSendTime;\n  }\n\n  /** The delay added to the response via the stub or global configuration */\n  public Integer getAddedDelay() {\n    return addedDelay;\n  }\n\n  /** The amount of time spent handling the stub request */\n  public Integer getProcessTime() {\n    return processTime;\n  }\n\n  /** The amount of time taken to send the response to the client */\n  public Integer getResponseSendTime() {\n    return responseSendTime;\n  }\n\n  /** The total request time from start to finish, minus added delay */\n  public Integer getServeTime() {\n    if (processTime == null || responseSendTime == null) {\n      return null;\n    }\n    return processTime + responseSendTime;\n  }\n\n  /** The total request time including added delay */\n  public Integer getTotalTime() {\n    Integer serveTime = getServeTime();\n    if (serveTime == null || addedDelay == null) {\n      return null;\n    }\n    return serveTime + addedDelay;\n  }\n\n  public void setAddedTime(int addedDelayMillis) {\n    this.addedDelay = addedDelayMillis;\n  }\n\n  public void logProcessTime(Stopwatch stopwatch) {\n    processTime = (int) stopwatch.elapsed(MILLISECONDS);\n  }\n\n  public void logResponseSendTime(Stopwatch stopwatch) {\n    responseSendTime = (int) stopwatch.elapsed(MILLISECONDS);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/Urls.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport com.github.tomakehurst.wiremock.http.QueryParameter;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.stream.Collectors;\nimport org.wiremock.url.PathAndQuery;\nimport org.wiremock.url.Query;\n\npublic class Urls {\n\n  private Urls() {}\n\n  public static Map<String, QueryParameter> toQueryParameterMap(Query query) {\n    return query.asDecodedMap().entrySet().stream()\n        .collect(\n            Collectors.toMap(Entry::getKey, e -> new QueryParameter(e.getKey(), e.getValue())));\n  }\n\n  public static String urlToPathParts(PathAndQuery uri) {\n    List<String> uriPathNodes =\n        uri.getPath().getSegments().stream()\n            .filter(s -> !s.isEmpty())\n            .map(Object::toString)\n            .toList();\n    int nodeCount = uriPathNodes.size();\n\n    return nodeCount > 0 ? String.join(\"-\", uriPathNodes) : \"\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/VeryShortIdGenerator.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common;\n\nimport java.util.Random;\n\npublic class VeryShortIdGenerator implements IdGenerator {\n\n  private static final String CHARS =\n      \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n  public String generate() {\n    final StringBuilder sb = new StringBuilder();\n    for (int i = 0; i < 5; i++) {\n      sb.append(randomChar());\n    }\n\n    return sb.toString();\n  }\n\n  private static char randomChar() {\n    final Random random = new Random();\n    final int index = random.nextInt(CHARS.length());\n    return CHARS.charAt(index);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/entity/BinaryEntityDefinition.java",
    "content": "/*\n * Copyright (C) 2014-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport static java.util.Arrays.asList;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.util.Base64;\nimport java.util.Objects;\n\n@JsonDeserialize(as = BinaryEntityDefinition.class)\npublic class BinaryEntityDefinition extends EntityDefinition {\n\n  public static final CompressionType DEFAULT_COMPRESSION = CompressionType.NONE;\n\n  private final CompressionType compression;\n  private final String dataStore;\n  private final String dataRef;\n  private final String data;\n  private final String filePath;\n\n  public BinaryEntityDefinition(\n      @JsonProperty(\"encoding\") EncodingType ignored,\n      @JsonProperty(\"compression\") CompressionType compression,\n      @JsonProperty(\"dataStore\") String dataStore,\n      @JsonProperty(\"dataRef\") String dataRef,\n      @JsonProperty(\"data\") String data,\n      @JsonProperty(\"filePath\") String filePath) {\n    // encoding is accepted for deserialization but ignored (always BINARY)\n    this.compression =\n        asList(CompressionType.values()).contains(compression) ? compression : DEFAULT_COMPRESSION;\n    this.dataStore = dataStore;\n    this.dataRef = dataRef;\n    this.data = data;\n    this.filePath = filePath;\n  }\n\n  public static Builder aBinaryMessage() {\n    return new Builder();\n  }\n\n  @Override\n  public EncodingType getEncoding() {\n    return EncodingType.BINARY;\n  }\n\n  @Override\n  @JsonIgnore\n  public FormatType getFormat() {\n    return FormatType.BASE64;\n  }\n\n  @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = DefaultCompressionFilter.class)\n  public CompressionType getCompression() {\n    return compression;\n  }\n\n  public String getDataStore() {\n    return dataStore;\n  }\n\n  public String getDataRef() {\n    return dataRef;\n  }\n\n  @Override\n  public String getData() {\n    return data;\n  }\n\n  @JsonIgnore\n  public byte[] getDataAsBytes() {\n    if (data == null) {\n      return null;\n    }\n    return Base64.getDecoder().decode(data);\n  }\n\n  public String getFilePath() {\n    return filePath;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    BinaryEntityDefinition that = (BinaryEntityDefinition) o;\n    return Objects.equals(compression, that.compression)\n        && Objects.equals(dataStore, that.dataStore)\n        && Objects.equals(dataRef, that.dataRef)\n        && Objects.equals(data, that.data)\n        && Objects.equals(filePath, that.filePath);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(compression, dataStore, dataRef, data, filePath);\n  }\n\n  @Override\n  public String toString() {\n    return Json.write(this);\n  }\n\n  public static class DefaultCompressionFilter {\n    @Override\n    public boolean equals(Object obj) {\n      return DEFAULT_COMPRESSION.equals(obj);\n    }\n  }\n\n  public static class Builder implements EntityDefinition.Builder<BinaryEntityDefinition> {\n    private CompressionType compression;\n    private String dataStore;\n    private String dataRef;\n    private String data;\n    private String filePath;\n\n    public Builder withCompression(CompressionType compression) {\n      this.compression = compression;\n      return this;\n    }\n\n    public Builder withDataStore(String dataStore) {\n      this.dataStore = dataStore;\n      return this;\n    }\n\n    public Builder withDataRef(String dataRef) {\n      this.dataRef = dataRef;\n      return this;\n    }\n\n    public Builder withBody(byte[] data) {\n      this.data = data != null ? Base64.getEncoder().encodeToString(data) : null;\n      return this;\n    }\n\n    public Builder withBodyBase64(String base64Data) {\n      this.data = base64Data;\n      return this;\n    }\n\n    public Builder withFilePath(String filePath) {\n      this.filePath = filePath;\n      return this;\n    }\n\n    @Override\n    public BinaryEntityDefinition build() {\n      return new BinaryEntityDefinition(null, compression, dataStore, dataRef, data, filePath);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/entity/CompressionType.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonValue;\n\npublic class CompressionType {\n\n  public static final CompressionType NONE = new CompressionType(\"none\");\n  public static final CompressionType BROTLI = new CompressionType(\"brotli\");\n  public static final CompressionType GZIP = new CompressionType(\"gzip\");\n  public static final CompressionType DEFLATE = new CompressionType(\"deflate\");\n\n  private final String type;\n\n  public CompressionType(String type) {\n    this.type = type;\n  }\n\n  @JsonCreator\n  public static CompressionType fromString(String value) {\n    return new CompressionType(value);\n  }\n\n  @JsonValue\n  public String value() {\n    return type;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    CompressionType that = (CompressionType) o;\n\n    return type.equals(that.type);\n  }\n\n  @Override\n  public int hashCode() {\n    return type.hashCode();\n  }\n\n  @Override\n  public String toString() {\n    return type;\n  }\n\n  public static CompressionType[] values() {\n    return new CompressionType[] {NONE, BROTLI, GZIP, DEFLATE};\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/entity/EncodingType.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonValue;\n\npublic class EncodingType {\n\n  public static final EncodingType TEXT = new EncodingType(\"text\");\n  public static final EncodingType BINARY = new EncodingType(\"binary\");\n  public static final EncodingType MULTIPART = new EncodingType(\"multipart\");\n\n  private final String type;\n\n  public EncodingType(String type) {\n    this.type = type;\n  }\n\n  @JsonCreator\n  public static EncodingType fromString(String value) {\n    return new EncodingType(value);\n  }\n\n  @JsonValue\n  public String value() {\n    return type;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    EncodingType that = (EncodingType) o;\n\n    return type.equals(that.type);\n  }\n\n  @Override\n  public int hashCode() {\n    return type.hashCode();\n  }\n\n  @Override\n  public String toString() {\n    return type;\n  }\n\n  public static EncodingType[] values() {\n    return new EncodingType[] {TEXT, BINARY, MULTIPART};\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/entity/Entity.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport static com.github.tomakehurst.wiremock.common.Limit.UNLIMITED;\n\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport com.github.tomakehurst.wiremock.common.InputStreamSource;\nimport com.github.tomakehurst.wiremock.common.Limit;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Objects;\nimport java.util.StringJoiner;\n\npublic class Entity {\n\n  private final EncodingType encoding;\n  private final FormatType format;\n  private final CompressionType compression;\n  private final InputStreamSource streamSource;\n\n  public Entity(\n      EncodingType encoding,\n      FormatType format,\n      CompressionType compression,\n      InputStreamSource streamSource) {\n    this.encoding = encoding;\n    this.format = format;\n    this.compression = compression;\n    this.streamSource = streamSource;\n  }\n\n  public EncodingType getEncoding() {\n    return encoding;\n  }\n\n  public FormatType getFormat() {\n    return format;\n  }\n\n  public CompressionType getCompression() {\n    return compression;\n  }\n\n  public byte[] getData() {\n    return getData(UNLIMITED);\n  }\n\n  public byte[] getData(Limit sizeLimit) {\n    return Exceptions.uncheck(() -> getBytesFromStream(streamSource, sizeLimit), byte[].class);\n  }\n\n  private static byte[] getBytesFromStream(InputStreamSource streamSource, Limit limit)\n      throws IOException {\n    try (InputStream stream = streamSource == null ? null : streamSource.getStream()) {\n      if (stream == null) {\n        return null;\n      }\n\n      return limit != null && !limit.isUnlimited()\n          ? stream.readNBytes(limit.getValue())\n          : stream.readAllBytes();\n    }\n  }\n\n  public InputStreamSource getStreamSource() {\n    return streamSource;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    Entity entity = (Entity) o;\n    return Objects.equals(encoding, entity.encoding)\n        && Objects.equals(format, entity.format)\n        && Objects.equals(compression, entity.compression);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(encoding, format, compression);\n  }\n\n  @Override\n  public String toString() {\n    return new StringJoiner(\", \", Entity.class.getSimpleName() + \"[\", \"]\")\n        .add(\"encoding=\" + encoding)\n        .add(\"format=\" + format)\n        .add(\"compression=\" + compression)\n        .add(\"streamSource=\" + streamSource)\n        .toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/entity/EntityDefinition.java",
    "content": "/*\n * Copyright (C) 2014-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport com.fasterxml.jackson.annotation.JsonSubTypes;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\n\n@JsonDeserialize(using = EntityDefinitionDeserializer.class)\n@JsonSubTypes(\n    value = {\n      @JsonSubTypes.Type(StringEntityDefinition.class),\n      @JsonSubTypes.Type(TextEntityDefinition.class),\n      @JsonSubTypes.Type(BinaryEntityDefinition.class)\n    })\npublic abstract class EntityDefinition {\n\n  public abstract EncodingType getEncoding();\n\n  public abstract FormatType getFormat();\n\n  public abstract CompressionType getCompression();\n\n  public abstract Object getData();\n\n  public interface Builder<T extends EntityDefinition> {\n    T build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/entity/EntityDefinitionDeserializer.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.deser.std.StdDeserializer;\nimport java.io.IOException;\n\npublic class EntityDefinitionDeserializer extends StdDeserializer<EntityDefinition> {\n\n  public EntityDefinitionDeserializer() {\n    super(EntityDefinition.class);\n  }\n\n  @Override\n  public EntityDefinition deserialize(JsonParser parser, DeserializationContext ctxt)\n      throws IOException {\n    JsonNode node = parser.readValueAsTree();\n\n    Class<? extends EntityDefinition> targetClass;\n    if (node.isTextual()) {\n      targetClass = StringEntityDefinition.class;\n    } else if (node.isObject()) {\n      JsonNode encodingNode = node.get(\"encoding\");\n      if (encodingNode != null\n          && encodingNode.isTextual()\n          && EncodingType.BINARY.value().equals(encodingNode.textValue())) {\n        targetClass = BinaryEntityDefinition.class;\n      } else {\n        // Default to TextEntityDefinition for text encoding or when encoding is not specified\n        targetClass = TextEntityDefinition.class;\n      }\n    } else {\n      targetClass = TextEntityDefinition.class;\n    }\n\n    return ctxt.readTreeAsValue(node, targetClass);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/entity/FormatType.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonValue;\n\npublic class FormatType {\n\n  public static final FormatType JSON = new FormatType(\"json\");\n  public static final FormatType HTML = new FormatType(\"html\");\n  public static final FormatType TEXT = new FormatType(\"text\");\n  public static final FormatType XML = new FormatType(\"xml\");\n  public static final FormatType YAML = new FormatType(\"yaml\");\n  public static final FormatType CSV = new FormatType(\"csv\");\n  public static final FormatType BASE64 = new FormatType(\"base64\");\n\n  private final String type;\n\n  public FormatType(String type) {\n    this.type = type;\n  }\n\n  @JsonCreator\n  public static FormatType fromString(String value) {\n    return new FormatType(value);\n  }\n\n  @JsonValue\n  public String value() {\n    return type;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    FormatType that = (FormatType) o;\n\n    return type.equals(that.type);\n  }\n\n  @Override\n  public int hashCode() {\n    return type.hashCode();\n  }\n\n  @Override\n  public String toString() {\n    return type;\n  }\n\n  public static FormatType[] values() {\n    return new FormatType[] {JSON, HTML, TEXT, XML, YAML, CSV, BASE64};\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/entity/StringEntityDefinition.java",
    "content": "/*\n * Copyright (C) 2014-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonValue;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport java.util.Objects;\n\n@JsonDeserialize(as = StringEntityDefinition.class)\npublic class StringEntityDefinition extends EntityDefinition {\n  private final String value;\n\n  @JsonCreator(mode = JsonCreator.Mode.DELEGATING)\n  public StringEntityDefinition(String v) {\n    value = v;\n  }\n\n  @JsonValue\n  public String getValue() {\n    return value;\n  }\n\n  @Override\n  public String toString() {\n    return value;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    StringEntityDefinition that = (StringEntityDefinition) o;\n    return Objects.equals(value, that.value);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hashCode(value);\n  }\n\n  @Override\n  public EncodingType getEncoding() {\n    return EncodingType.TEXT;\n  }\n\n  @Override\n  public FormatType getFormat() {\n    return FormatType.TEXT;\n  }\n\n  @Override\n  public CompressionType getCompression() {\n    return CompressionType.NONE;\n  }\n\n  @Override\n  public Object getData() {\n    return value;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/entity/TextEntityDefinition.java",
    "content": "/*\n * Copyright (C) 2014-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.entity;\n\nimport static java.util.Arrays.asList;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.util.Objects;\n\n@JsonDeserialize(as = TextEntityDefinition.class)\npublic class TextEntityDefinition extends EntityDefinition {\n\n  public static final FormatType DEFAULT_FORMAT = FormatType.JSON;\n  public static final CompressionType DEFAULT_COMPRESSION = CompressionType.NONE;\n\n  private final FormatType format;\n  private final CompressionType compression;\n  private final String dataStore;\n  private final String dataRef;\n  private final Object data;\n  private final String filePath;\n\n  public TextEntityDefinition(\n      @JsonProperty(\"format\") FormatType format,\n      @JsonProperty(\"compression\") CompressionType compression,\n      @JsonProperty(\"dataStore\") String dataStore,\n      @JsonProperty(\"dataRef\") String dataRef,\n      @JsonProperty(\"data\") Object data,\n      @JsonProperty(\"filePath\") String filePath) {\n    this.format = asList(FormatType.values()).contains(format) ? format : DEFAULT_FORMAT;\n    this.compression =\n        asList(CompressionType.values()).contains(compression) ? compression : DEFAULT_COMPRESSION;\n    this.dataStore = dataStore;\n    this.dataRef = dataRef;\n    this.data = data;\n    this.filePath = filePath;\n  }\n\n  public static Builder aTextMessage() {\n    return new Builder();\n  }\n\n  @Override\n  @JsonIgnore\n  public EncodingType getEncoding() {\n    return EncodingType.TEXT;\n  }\n\n  @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = DefaultFormatFilter.class)\n  public FormatType getFormat() {\n    return format;\n  }\n\n  @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = DefaultCompressionFilter.class)\n  public CompressionType getCompression() {\n    return compression;\n  }\n\n  public String getDataStore() {\n    return dataStore;\n  }\n\n  public String getDataRef() {\n    return dataRef;\n  }\n\n  public Object getData() {\n    return data;\n  }\n\n  public String getFilePath() {\n    return filePath;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    TextEntityDefinition that = (TextEntityDefinition) o;\n    return Objects.equals(format, that.format)\n        && Objects.equals(compression, that.compression)\n        && Objects.equals(dataStore, that.dataStore)\n        && Objects.equals(dataRef, that.dataRef)\n        && Objects.equals(data, that.data)\n        && Objects.equals(filePath, that.filePath);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(format, compression, dataStore, dataRef, data, filePath);\n  }\n\n  @Override\n  public String toString() {\n    return Json.write(this);\n  }\n\n  public static class DefaultFormatFilter {\n    @Override\n    public boolean equals(Object obj) {\n      return DEFAULT_FORMAT.equals(obj);\n    }\n  }\n\n  public static class DefaultCompressionFilter {\n    @Override\n    public boolean equals(Object obj) {\n      return DEFAULT_COMPRESSION.equals(obj);\n    }\n  }\n\n  public static class Builder implements EntityDefinition.Builder<TextEntityDefinition> {\n    private FormatType format;\n    private CompressionType compression;\n    private String dataStore;\n    private String dataRef;\n    private Object data;\n    private String filePath;\n\n    public Builder withFormat(FormatType format) {\n      this.format = format;\n      return this;\n    }\n\n    public Builder withCompression(CompressionType compression) {\n      this.compression = compression;\n      return this;\n    }\n\n    public Builder withDataStore(String dataStore) {\n      this.dataStore = dataStore;\n      return this;\n    }\n\n    public Builder withDataRef(String dataRef) {\n      this.dataRef = dataRef;\n      return this;\n    }\n\n    public Builder withBody(Object data) {\n      this.data = data;\n      return this;\n    }\n\n    public Builder withFilePath(String filePath) {\n      this.filePath = filePath;\n      return this;\n    }\n\n    @Override\n    public TextEntityDefinition build() {\n      return new TextEntityDefinition(format, compression, dataStore, dataRef, data, filePath);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/filemaker/FilenameMaker.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.filemaker;\n\nimport static com.github.tomakehurst.wiremock.extension.responsetemplating.TemplateEngine.defaultTemplateEngine;\nimport static java.lang.Math.min;\n\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.HandlebarsOptimizedTemplate;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.TemplateEngine;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.text.Normalizer;\nimport java.util.Locale;\nimport java.util.regex.Pattern;\nimport org.wiremock.url.Path;\n\npublic class FilenameMaker {\n  public static final String DEFAULT_FILENAME_TEMPLATE =\n      \"{{#if name}}{{{name}}}{{else}}{{{method}}}-{{{url}}}{{/if}}-{{{id}}}\";\n  private static final Pattern NON_ALPHANUMERIC = Pattern.compile(\"[^\\\\w-.]\");\n  private static final String DEFAULT_EXTENSION = \".json\";\n  private static final String POINT = \".\";\n  private static final Pattern WHITESPACE = Pattern.compile(\"[\\\\s]\");\n\n  private final TemplateEngine templateEngine;\n  private final String filenameTemplate;\n\n  public FilenameMaker() {\n    this(null);\n  }\n\n  public FilenameMaker(String filenameTemplate) {\n    this.templateEngine = defaultTemplateEngine();\n    this.filenameTemplate =\n        filenameTemplate != null ? filenameTemplate : DEFAULT_FILENAME_TEMPLATE + DEFAULT_EXTENSION;\n  }\n\n  public FilenameMaker(String filenameTemplate, String extension) {\n    this.templateEngine = defaultTemplateEngine();\n    if (filenameTemplate.equals(\"default\")) {\n      this.filenameTemplate = DEFAULT_FILENAME_TEMPLATE + POINT + extension;\n    } else {\n      this.filenameTemplate = filenameTemplate + POINT + extension;\n    }\n  }\n\n  public String filenameFor(StubMapping stubMapping) {\n    HandlebarsOptimizedTemplate template = templateEngine.getUncachedTemplate(filenameTemplate);\n\n    final FilenameTemplateModel templateModel = new FilenameTemplateModel(stubMapping);\n    String parsedFilename = template.apply(templateModel);\n    return sanitise(parsedFilename);\n  }\n\n  public String sanitizeUrl(Path url) {\n    String startingPath = url.toString().replace(\"/\", \"_\");\n    String pathWithoutWhitespace = WHITESPACE.matcher(startingPath).replaceAll(\"-\");\n    String normalizedPath = Normalizer.normalize(pathWithoutWhitespace, Normalizer.Form.NFD);\n    String slug = sanitise(normalizedPath).replaceAll(\"^[_]*\", \"\").replaceAll(\"[_]*$\", \"\");\n    slug = slug.substring(0, min(slug.length(), 200));\n    return slug;\n  }\n\n  private String sanitise(String s) {\n    String decoratedString = String.join(\"-\", s.split(\" \"));\n    return NON_ALPHANUMERIC.matcher(decoratedString).replaceAll(\"\").toLowerCase(Locale.ROOT);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/filemaker/FilenameTemplateModel.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.filemaker;\n\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.UUID;\n\npublic class FilenameTemplateModel {\n\n  private final StubMapping stubMapping;\n\n  public FilenameTemplateModel(StubMapping stubMapping) {\n    this.stubMapping = stubMapping;\n  }\n\n  public UUID getId() {\n    return stubMapping.getId();\n  }\n\n  public String getName() {\n    return stubMapping.getName();\n  }\n\n  public String getUrl() {\n    return stubMapping.getRequest().getUrlMatcher().getExpected();\n  }\n\n  public String getMethod() {\n    return stubMapping.getRequest().getMethod().getName();\n  }\n\n  public Integer getPriority() {\n    return stubMapping.getPriority();\n  }\n\n  public String getScenarioName() {\n    return stubMapping.getScenarioName();\n  }\n\n  public String getRequiredScenarioState() {\n    return stubMapping.getRequiredScenarioState();\n  }\n\n  public String getNewScenarioState() {\n    return stubMapping.getNewScenarioState();\n  }\n\n  public RequestPattern getRequest() {\n    return stubMapping.getRequest();\n  }\n\n  public ResponseDefinition getResponse() {\n    return stubMapping.getResponse();\n  }\n\n  public Metadata getMetadata() {\n    return stubMapping.getMetadata();\n  }\n\n  public long getInsertionIndex() {\n    return stubMapping.getInsertionIndex();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ssl/KeyStoreSettings.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.ssl;\n\nimport com.github.tomakehurst.wiremock.common.Source;\nimport java.security.KeyStore;\n\npublic class KeyStoreSettings {\n\n  public static final KeyStoreSettings NO_STORE = new KeyStoreSettings(null, null, null);\n\n  private final KeyStoreSource keyStoreSource;\n\n  public KeyStoreSettings(KeyStoreSource keyStoreSource) {\n    this.keyStoreSource = keyStoreSource;\n  }\n\n  public KeyStoreSettings(String path, String password, String type) {\n    this(\n        path != null && password != null && type != null\n            ? KeyStoreSourceFactory.getAppropriateForJreVersion(path, type, password.toCharArray())\n            : null);\n  }\n\n  public String path() {\n    if (keyStoreSource instanceof ReadOnlyFileOrClasspathKeyStoreSource) {\n      return ((ReadOnlyFileOrClasspathKeyStoreSource) keyStoreSource).getPath();\n    }\n\n    return \"(no path - custom keystore source)\";\n  }\n\n  public String password() {\n    return keyStoreSource.getKeyStorePassword();\n  }\n\n  public String type() {\n    return keyStoreSource.getKeyStoreType();\n  }\n\n  public KeyStore loadStore() {\n    return keyStoreSource.load();\n  }\n\n  public Source<KeyStore> getSource() {\n    return keyStoreSource;\n  }\n\n  public boolean exists() {\n    return keyStoreSource.exists();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ssl/KeyStoreSource.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.ssl;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.github.tomakehurst.wiremock.common.Source;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.security.KeyStore;\nimport java.util.Arrays;\nimport java.util.Objects;\n\npublic abstract class KeyStoreSource implements Source<KeyStore> {\n\n  protected final String keyStoreType;\n  protected final char[] keyStorePassword;\n\n  protected KeyStoreSource(String keyStoreType, char[] keyStorePassword) {\n    this.keyStoreType = keyStoreType;\n    this.keyStorePassword = keyStorePassword;\n  }\n\n  public KeyStore load() {\n    InputStream instream = null;\n    try {\n      KeyStore trustStore = KeyStore.getInstance(keyStoreType);\n      instream = createInputStream();\n      trustStore.load(instream, keyStorePassword);\n      return trustStore;\n    } catch (Exception e) {\n      return throwUnchecked(e, KeyStore.class);\n    } finally {\n      if (instream != null) {\n        try {\n          instream.close();\n        } catch (IOException ioe) {\n          throwUnchecked(ioe);\n        }\n      }\n    }\n  }\n\n  protected abstract InputStream createInputStream();\n\n  public String getKeyStoreType() {\n    return keyStoreType;\n  }\n\n  public String getKeyStorePassword() {\n    return new String(keyStorePassword);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    KeyStoreSource that = (KeyStoreSource) o;\n    return keyStoreType.equals(that.keyStoreType)\n        && Arrays.equals(keyStorePassword, that.keyStorePassword);\n  }\n\n  @Override\n  public int hashCode() {\n    int result = Objects.hash(keyStoreType);\n    result = 31 * result + Arrays.hashCode(keyStorePassword);\n    return result;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ssl/KeyStoreSourceFactory.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.ssl;\n\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.InvocationTargetException;\n\npublic class KeyStoreSourceFactory {\n\n  @SuppressWarnings(\"unchecked\")\n  public static KeyStoreSource getAppropriateForJreVersion(\n      String path, String keyStoreType, char[] keyStorePassword) {\n    try {\n      final Class<? extends KeyStoreSource> theClass =\n          (Class<? extends KeyStoreSource>)\n              Class.forName(\n                  \"com.github.tomakehurst.wiremock.common.ssl.WritableFileOrClasspathKeyStoreSource\");\n      return safelyGetConstructor(theClass, String.class, String.class, char[].class)\n          .newInstance(path, keyStoreType, keyStorePassword);\n    } catch (ClassNotFoundException\n        | IllegalAccessException\n        | InstantiationException\n        | InvocationTargetException e) {\n      return new ReadOnlyFileOrClasspathKeyStoreSource(path, keyStoreType, keyStorePassword);\n    }\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private static <T> Constructor<T> safelyGetConstructor(\n      Class<T> clazz, Class<?>... parameterTypes) {\n    try {\n      return clazz.getConstructor(parameterTypes);\n    } catch (NoSuchMethodException e) {\n      return Exceptions.throwUnchecked(e, Constructor.class);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ssl/ReadOnlyFileOrClasspathKeyStoreSource.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.ssl;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResource;\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.security.KeyStore;\nimport java.util.Objects;\n\npublic class ReadOnlyFileOrClasspathKeyStoreSource extends KeyStoreSource {\n\n  protected final String path;\n\n  public ReadOnlyFileOrClasspathKeyStoreSource(\n      String path, String keyStoreType, char[] keyStorePassword) {\n    super(keyStoreType, keyStorePassword);\n    this.path = path;\n  }\n\n  @Override\n  protected InputStream createInputStream() {\n    try {\n      if (exists()) {\n        return new FileInputStream(path);\n      } else {\n        try {\n          URL pathUrl = new URL(path);\n          return pathUrl.openStream();\n        } catch (MalformedURLException ignored) {\n          return getResource(KeyStoreSource.class, path).openStream();\n        }\n      }\n    } catch (IOException e) {\n      return throwUnchecked(e, InputStream.class);\n    }\n  }\n\n  @Override\n  public boolean exists() {\n    return new File(path).isFile();\n  }\n\n  @Override\n  public void save(KeyStore keyStore) {}\n\n  public String getPath() {\n    return path;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    if (!super.equals(o)) return false;\n    ReadOnlyFileOrClasspathKeyStoreSource that = (ReadOnlyFileOrClasspathKeyStoreSource) o;\n    return path.equals(that.path);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(super.hashCode(), path);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/ssl/WritableFileOrClasspathKeyStoreSource.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.ssl;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static java.nio.file.attribute.PosixFilePermission.*;\nimport static java.nio.file.attribute.PosixFilePermissions.asFileAttribute;\n\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.nio.file.FileSystems;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.attribute.FileAttribute;\nimport java.security.KeyStore;\nimport java.security.KeyStoreException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.cert.CertificateException;\nimport java.util.EnumSet;\n\npublic class WritableFileOrClasspathKeyStoreSource extends ReadOnlyFileOrClasspathKeyStoreSource {\n\n  public WritableFileOrClasspathKeyStoreSource(\n      String path, String keyStoreType, char[] keyStorePassword) {\n    super(path, keyStoreType, keyStorePassword);\n  }\n\n  @Override\n  public void save(KeyStore keyStore) {\n    Path created = createKeystoreFile(Paths.get(path));\n    try (FileOutputStream fos = new FileOutputStream(created.toFile())) {\n      keyStore.store(fos, keyStorePassword);\n    } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException e) {\n      throwUnchecked(e);\n    }\n  }\n\n  private static Path createKeystoreFile(Path path) {\n    FileAttribute<?>[] privateDirAttrs = new FileAttribute<?>[0];\n    FileAttribute<?>[] privateFileAttrs = new FileAttribute<?>[0];\n    if (FileSystems.getDefault().supportedFileAttributeViews().contains(\"posix\")) {\n      privateDirAttrs =\n          new FileAttribute<?>[] {\n            asFileAttribute(EnumSet.of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE))\n          };\n      privateFileAttrs =\n          new FileAttribute<?>[] {asFileAttribute(EnumSet.of(OWNER_READ, OWNER_WRITE))};\n    }\n\n    try {\n      if (!Files.exists(path.getParent())) {\n        Files.createDirectories(path.getParent(), privateDirAttrs);\n      }\n      return Files.createFile(path, privateFileAttrs);\n    } catch (IOException e) {\n      return throwUnchecked(e, Path.class);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/url/PathParams.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.url;\n\nimport java.util.LinkedHashMap;\n\npublic class PathParams extends LinkedHashMap<String, String> {\n\n  public static PathParams empty() {\n    return new PathParams();\n  }\n\n  public PathParams add(String key, String value) {\n    put(key, value);\n    return this;\n  }\n\n  public static PathParams single(String key, Object value) {\n    return new PathParams().add(key, value.toString());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/url/PathTemplate.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.url;\n\nimport static java.lang.String.format;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.function.Function;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport org.wiremock.url.Path;\nimport org.wiremock.url.PathAndQuery;\n\npublic class PathTemplate {\n  static final Pattern SPECIAL_SYMBOL_REGEX =\n      Pattern.compile(\"\\\\{(?<variable>[^}]+)}|(?<wildcard>\\\\*\\\\*)\");\n\n  private final String templateString;\n  private final Parser parser;\n  private final Renderer renderer;\n\n  public static boolean couldBePathTemplate(String value) {\n    return SPECIAL_SYMBOL_REGEX.matcher(value).find();\n  }\n\n  public PathTemplate(String templateString) {\n    this.templateString = templateString;\n\n    Matcher matcher = SPECIAL_SYMBOL_REGEX.matcher(templateString);\n    ParserBuilder parserBuilder = new ParserBuilder();\n    RendererBuilder rendererBuilder = new RendererBuilder();\n    int last = 0;\n    while (matcher.find()) {\n      String text = templateString.substring(last, matcher.start());\n      parserBuilder.addStatic(text);\n      rendererBuilder.addStatic(text);\n\n      String variable = matcher.group(\"variable\");\n      if (variable != null) {\n        String variableName = stripFormatCharacters(variable);\n        parserBuilder.addVariable(variableName);\n        rendererBuilder.addVariable(variableName);\n      }\n\n      String wildcard = matcher.group(\"wildcard\");\n      if (wildcard != null) {\n        parserBuilder.addWildcard();\n        rendererBuilder.addWildcard();\n      }\n\n      last = matcher.end();\n    }\n    String text = templateString.substring(last);\n    parserBuilder.addStatic(text);\n    rendererBuilder.addStatic(text);\n\n    parser = parserBuilder.build();\n    renderer = rendererBuilder.build();\n  }\n\n  public boolean matches(String url) {\n    return matches(PathAndQuery.parse(url).getPath());\n  }\n\n  public boolean matches(Path path) {\n    return parser.matches(path);\n  }\n\n  public PathParams parse(String url) {\n    return parse(PathAndQuery.parse(url).getPath());\n  }\n\n  public PathParams parse(Path url) {\n    return parser.parse(url);\n  }\n\n  public String render(PathParams pathParams) {\n    return renderer.render(pathParams);\n  }\n\n  public String withoutVariables() {\n    return templateString.replaceAll(SPECIAL_SYMBOL_REGEX.pattern(), \"_\");\n  }\n\n  private static String stripFormatCharacters(String parameter) {\n    return parameter.replace(\".\", \"\").replace(\";\", \"\").replace(\"*\", \"\");\n  }\n\n  @Override\n  public String toString() {\n    return templateString;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    PathTemplate that = (PathTemplate) o;\n    return Objects.equals(templateString, that.templateString);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(templateString);\n  }\n\n  public int numberOfParameters() {\n    return parser.numberOfParameters();\n  }\n}\n\nclass Parser {\n  private final Pattern templatePattern;\n  private final List<String> templateParameters;\n\n  Parser(Pattern templatePattern, List<String> templateParameters) {\n    this.templatePattern = templatePattern;\n    this.templateParameters = templateParameters;\n  }\n\n  boolean matches(Path path) {\n    Matcher matcher = templatePattern.matcher(path.toString());\n    return matcher.matches();\n  }\n\n  PathParams parse(Path url) {\n    Matcher matcher = templatePattern.matcher(url.toString());\n    if (!matcher.matches()) {\n      throw new IllegalArgumentException(format(\"'%s' is not a matching URL\", url));\n    }\n\n    PathParams pathParams = new PathParams();\n    for (int i = 0; i < templateParameters.size(); i++) {\n      pathParams.put(templateParameters.get(i), matcher.group(i + 1));\n    }\n\n    return pathParams;\n  }\n\n  int numberOfParameters() {\n    return templateParameters.size();\n  }\n}\n\nclass ParserBuilder {\n  private final StringBuilder templatePattern = new StringBuilder().append(\"^\");\n  private final List<String> templateVariables = new ArrayList<>();\n  private int wildcardCount = 0;\n\n  void addStatic(String text) {\n    templatePattern.append(Pattern.quote(text));\n  }\n\n  void addVariable(String variable) {\n    templatePattern.append(\"([^/]+)\");\n    templateVariables.add(variable);\n  }\n\n  void addWildcard() {\n    templatePattern.append(\"(.*?)\");\n    templateVariables.add(String.valueOf(wildcardCount++));\n  }\n\n  Parser build() {\n    return new Parser(\n        Pattern.compile(templatePattern.append(\"$\").toString()),\n        Collections.unmodifiableList(templateVariables));\n  }\n}\n\nclass Renderer {\n  private final List<Function<PathParams, String>> tasks;\n\n  Renderer(List<Function<PathParams, String>> tasks) {\n    this.tasks = tasks;\n  }\n\n  String render(PathParams pathParams) {\n    StringBuilder rendering = new StringBuilder();\n\n    for (Function<PathParams, String> task : tasks) {\n      rendering.append(task.apply(pathParams));\n    }\n\n    return rendering.toString();\n  }\n}\n\nclass RendererBuilder {\n  private final List<Function<PathParams, String>> tasks = new ArrayList<>();\n  private int wildcardCount = 0;\n\n  void addStatic(final String text) {\n    class Static implements Function<PathParams, String> {\n      @Override\n      public String apply(PathParams input) {\n        return text;\n      }\n    }\n    tasks.add(new Static());\n  }\n\n  void addVariable(final String variable) {\n    class Variable implements Function<PathParams, String> {\n      @Override\n      public String apply(PathParams input) {\n        String value = input.get(variable);\n        if (value == null) {\n          throw new IllegalArgumentException(format(\"Path parameter %s was not bound\", variable));\n        }\n        return value;\n      }\n    }\n    tasks.add(new Variable());\n  }\n\n  void addWildcard() {\n    final String wildcardIndex = String.valueOf(wildcardCount++);\n    class Wildcard implements Function<PathParams, String> {\n      @Override\n      public String apply(PathParams input) {\n        String value = input.get(wildcardIndex);\n        if (value == null) {\n          throw new IllegalArgumentException(\"Wildcard was not bound\");\n        }\n        return value;\n      }\n    }\n    tasks.add(new Wildcard());\n  }\n\n  Renderer build() {\n    return new Renderer(Collections.unmodifiableList(tasks));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/url/QueryParams.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.url;\n\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport java.util.Arrays;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class QueryParams extends LinkedHashMap<String, List<String>> {\n\n  public static final QueryParams EMPTY = new QueryParams();\n\n  public static QueryParams single(String key, String... values) {\n    return new QueryParams().add(key, values);\n  }\n\n  public QueryParams add(String key, String... values) {\n    return add(key, Arrays.asList(values));\n  }\n\n  public QueryParams add(String key, List<String> values) {\n    put(key, values);\n    return this;\n  }\n\n  @Override\n  public String toString() {\n    if (isEmpty()) {\n      return \"\";\n    }\n\n    return \"?\"\n        + entrySet().stream()\n            .flatMap(\n                entry -> entry.getValue().stream().map(value -> Pair.pair(entry.getKey(), value)))\n            .map(pair -> pair.a + \"=\" + pair.b)\n            .collect(Collectors.joining(\"&\"));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/BuilderPerThreadDocumentBuilderFactory.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.uncheck;\n\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\n\nclass BuilderPerThreadDocumentBuilderFactory extends DelegateDocumentBuilderFactory {\n\n  // DocumentBuilder is NOT thread safe.\n  private final ThreadLocal<DocumentBuilder> documentBuilderThreadLocal;\n\n  BuilderPerThreadDocumentBuilderFactory(DocumentBuilderFactory delegate) {\n    super(delegate);\n    this.documentBuilderThreadLocal =\n        ThreadLocal.withInitial(() -> uncheck(delegate::newDocumentBuilder, null));\n  }\n\n  @Override\n  public DocumentBuilder newDocumentBuilder() {\n    return documentBuilderThreadLocal.get();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/DelegateDocumentBuilderFactory.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\n\nabstract class DelegateDocumentBuilderFactory extends DocumentBuilderFactory {\n  protected final DocumentBuilderFactory delegate;\n\n  DelegateDocumentBuilderFactory(DocumentBuilderFactory delegate) {\n    this.delegate = delegate;\n  }\n\n  @Override\n  public void setAttribute(String name, Object value) throws IllegalArgumentException {\n    delegate.setAttribute(name, value);\n  }\n\n  @Override\n  public Object getAttribute(String name) throws IllegalArgumentException {\n    return delegate.getAttribute(name);\n  }\n\n  @Override\n  public void setFeature(String name, boolean value) throws ParserConfigurationException {\n    delegate.setFeature(name, value);\n  }\n\n  @Override\n  public boolean getFeature(String name) throws ParserConfigurationException {\n    return delegate.getFeature(name);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/SilentErrorDocumentBuilderFactory.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.github.tomakehurst.wiremock.common.SilentErrorHandler;\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\n\nclass SilentErrorDocumentBuilderFactory extends DelegateDocumentBuilderFactory {\n\n  SilentErrorDocumentBuilderFactory(DocumentBuilderFactory delegate) {\n    super(delegate);\n  }\n\n  @Override\n  public DocumentBuilder newDocumentBuilder() {\n    try {\n      DocumentBuilder documentBuilder = delegate.newDocumentBuilder();\n      documentBuilder.setErrorHandler(new SilentErrorHandler());\n      return documentBuilder;\n    } catch (ParserConfigurationException e) {\n      return throwUnchecked(e, DocumentBuilder.class);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/SkipResolvingEntitiesDocumentBuilderFactory.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport java.io.StringReader;\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\nimport org.xml.sax.EntityResolver;\nimport org.xml.sax.InputSource;\n\nclass SkipResolvingEntitiesDocumentBuilderFactory extends DelegateDocumentBuilderFactory {\n\n  SkipResolvingEntitiesDocumentBuilderFactory(DocumentBuilderFactory delegate) {\n    super(delegate);\n  }\n\n  @Override\n  public DocumentBuilder newDocumentBuilder() {\n    try {\n      DocumentBuilder documentBuilder = delegate.newDocumentBuilder();\n      documentBuilder.setEntityResolver(new ResolveToEmptyString());\n      return documentBuilder;\n    } catch (ParserConfigurationException e) {\n      return throwUnchecked(e, DocumentBuilder.class);\n    }\n  }\n\n  private static class ResolveToEmptyString implements EntityResolver {\n    @Override\n    public InputSource resolveEntity(String publicId, String systemId) {\n      return new InputSource(new StringReader(\"\"));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/XPathException.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport javax.xml.xpath.XPathExpressionException;\n\npublic class XPathException extends InvalidInputException {\n\n  protected XPathException(Throwable cause, Errors errors) {\n    super(cause, errors);\n  }\n\n  public static XPathException fromXPathException(XPathExpressionException e) {\n    return new XPathException(e, Errors.single(51, e.getMessage()));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/Xml.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static javax.xml.transform.OutputKeys.INDENT;\nimport static javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION;\n\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport java.io.IOException;\nimport java.io.StringReader;\nimport java.io.StringWriter;\nimport javax.xml.XMLConstants;\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\nimport javax.xml.transform.Transformer;\nimport javax.xml.transform.TransformerFactory;\nimport javax.xml.transform.dom.DOMSource;\nimport javax.xml.transform.stream.StreamResult;\nimport javax.xml.xpath.XPathFactory;\nimport org.custommonkey.xmlunit.XMLUnit;\nimport org.w3c.dom.Document;\nimport org.xml.sax.InputSource;\nimport org.xml.sax.SAXException;\n\npublic class Xml {\n\n  public static final DocumentBuilderFactory DEFAULT_DOCUMENT_BUILDER_FACTORY =\n      newDocumentBuilderFactory();\n\n  private Xml() {\n    // Hide constructor\n  }\n\n  public static void optimizeFactoriesLoading() {\n    try {\n      String transformerFactoryImpl = TransformerFactory.newDefaultInstance().getClass().getName();\n      String xPathFactoryImpl = XPathFactory.newDefaultInstance().getClass().getName();\n\n      System.setProperty(TransformerFactory.class.getName(), transformerFactoryImpl);\n      System.setProperty(\n          XPathFactory.DEFAULT_PROPERTY_NAME + \":\" + XPathFactory.DEFAULT_OBJECT_MODEL_URI,\n          xPathFactoryImpl);\n\n      XMLUnit.setTransformerFactory(transformerFactoryImpl);\n      XMLUnit.setXPathFactory(xPathFactoryImpl);\n    } catch (Exception ignored) {\n      // Since this is just an optimisation, if an exception is thrown we do nothing and carry on\n    }\n  }\n\n  public static String prettyPrint(String xml) {\n    try {\n      return prettyPrint(read(xml));\n    } catch (Exception e) {\n      return throwUnchecked(e, String.class);\n    }\n  }\n\n  public static String prettyPrint(Document doc) {\n    try {\n      TransformerFactory transformerFactory = createTransformerFactory();\n      Transformer transformer = transformerFactory.newTransformer();\n      transformer.setOutputProperty(INDENT, \"yes\");\n      transformer.setOutputProperty(OMIT_XML_DECLARATION, \"yes\");\n      StreamResult result = new StreamResult(new StringWriter());\n      DOMSource source = new DOMSource(doc);\n      transformer.transform(source, result);\n      return result.getWriter().toString();\n    } catch (Exception e) {\n      return throwUnchecked(e, String.class);\n    }\n  }\n\n  private static TransformerFactory createTransformerFactory() {\n    TransformerFactory transformerFactory;\n    try {\n      // Optimization to get likely transformerFactory directly, rather than going through\n      // FactoryFinder#find\n      transformerFactory =\n          (TransformerFactory)\n              Class.forName(\"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl\")\n                  .getDeclaredConstructor()\n                  .newInstance();\n    } catch (Exception e) {\n      transformerFactory = TransformerFactory.newDefaultInstance();\n    }\n    transformerFactory.setAttribute(\"indent-number\", 2);\n    transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, \"\");\n    transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, \"\");\n    return transformerFactory;\n  }\n\n  public static Document read(String xml) {\n    return read(xml, DEFAULT_DOCUMENT_BUILDER_FACTORY);\n  }\n\n  public static Document read(String xml, DocumentBuilderFactory dbf) {\n    try {\n      DocumentBuilder db = dbf.newDocumentBuilder();\n      InputSource is = new InputSource(new StringReader(xml));\n      return db.parse(is);\n    } catch (SAXException e) {\n      throw XmlException.fromSaxException(e);\n    } catch (Exception e) {\n      return throwUnchecked(e, Document.class);\n    }\n  }\n\n  public static XmlDocument parse(String xml) {\n    return parse(xml, getDocumentBuilder());\n  }\n\n  public static XmlDocument parse(String xml, DocumentBuilder db) {\n    try {\n      InputSource source = new InputSource(new StringReader(xml));\n      return new XmlDocument(db.parse(source));\n    } catch (SAXException | IOException e) {\n      throw new XmlException(Errors.single(50, e.getMessage()));\n    }\n  }\n\n  private static DocumentBuilder getDocumentBuilder() {\n    try {\n      return DEFAULT_DOCUMENT_BUILDER_FACTORY.newDocumentBuilder();\n    } catch (ParserConfigurationException e) {\n      return throwUnchecked(e, DocumentBuilder.class);\n    }\n  }\n\n  public static DocumentBuilderFactory newDocumentBuilderFactory() {\n    try {\n      DocumentBuilderFactory dbf =\n          new BuilderPerThreadDocumentBuilderFactory(\n              new SilentErrorDocumentBuilderFactory(\n                  new SkipResolvingEntitiesDocumentBuilderFactory(\n                      DocumentBuilderFactory.newDefaultInstance())));\n      dbf.setFeature(\"http://xml.org/sax/features/validation\", false);\n      dbf.setFeature(\"http://apache.org/xml/features/nonvalidating/load-dtd-grammar\", false);\n      dbf.setFeature(\"http://apache.org/xml/features/nonvalidating/load-external-dtd\", false);\n      dbf.setFeature(\"http://xml.org/sax/features/external-general-entities\", false);\n      dbf.setFeature(\"http://xml.org/sax/features/external-parameter-entities\", false);\n      dbf.setXIncludeAware(false);\n      dbf.setExpandEntityReferences(false);\n      dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);\n      return dbf;\n    } catch (ParserConfigurationException e) {\n      return throwUnchecked(e, DocumentBuilderFactory.class);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/XmlDocument.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport java.util.HashMap;\nimport java.util.Map;\nimport javax.xml.XMLConstants;\nimport javax.xml.namespace.NamespaceContext;\nimport javax.xml.transform.dom.DOMSource;\nimport javax.xml.xpath.XPath;\nimport javax.xml.xpath.XPathEvaluationResult;\nimport javax.xml.xpath.XPathExpressionException;\nimport org.w3c.dom.Document;\nimport org.xmlunit.util.Convert;\n\npublic class XmlDocument extends XmlDomNode {\n\n  private final Document document;\n\n  public XmlDocument(Document document) {\n    super(document);\n    this.document = document;\n  }\n\n  public ListOrSingle<XmlNode> findNodes(String xPathExpression) {\n    return findNodes(xPathExpression, null);\n  }\n\n  public ListOrSingle<XmlNode> findNodes(String xPathExpression, Map<String, String> namespaces) {\n    try {\n      final XPath xPath = XPATH_CACHE.get();\n      xPath.reset();\n\n      XPathEvaluationResult<?> xPathEvaluationResult;\n      if (namespaces != null) {\n        Map<String, String> fullNamespaces = addStandardNamespaces(namespaces);\n        NamespaceContext namespaceContext = Convert.toNamespaceContext(fullNamespaces);\n        xPath.setNamespaceContext(namespaceContext);\n        xPathEvaluationResult =\n            xPath.evaluateExpression(\n                xPathExpression, Convert.toInputSource(new DOMSource(document)));\n      } else {\n        xPathEvaluationResult = xPath.evaluateExpression(xPathExpression, document);\n      }\n\n      return toListOrSingle(xPathEvaluationResult);\n    } catch (XPathExpressionException e) {\n      throw XPathException.fromXPathException(e);\n    }\n  }\n\n  private static Map<String, String> addStandardNamespaces(Map<String, String> namespaces) {\n    Map<String, String> result = new HashMap<String, String>();\n    for (String prefix : namespaces.keySet()) {\n      String uri = namespaces.get(prefix);\n      // according to the Javadocs only the constants defined in\n      // XMLConstants are allowed as prefixes for the following\n      // two URIs\n      if (!XMLConstants.XML_NS_URI.equals(uri)\n          && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri)) {\n        result.put(prefix, uri);\n      }\n    }\n    result.put(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI);\n    result.put(XMLConstants.XMLNS_ATTRIBUTE, XMLConstants.XMLNS_ATTRIBUTE_NS_URI);\n\n    return result;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/XmlDomNode.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport java.io.StringWriter;\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.InvocationTargetException;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.Map;\nimport javax.xml.transform.Source;\nimport javax.xml.transform.Transformer;\nimport javax.xml.transform.dom.DOMSource;\nimport javax.xml.transform.sax.SAXSource;\nimport javax.xml.transform.stream.StreamResult;\nimport org.w3c.dom.NamedNodeMap;\nimport org.w3c.dom.Node;\nimport org.xml.sax.XMLReader;\n\npublic class XmlDomNode extends XmlNode {\n\n  private final Node domNode;\n  private final Map<String, String> attributes;\n\n  public XmlDomNode(Node domNode) {\n    this.domNode = domNode;\n    attributes =\n        domNode.hasAttributes()\n            ? convertAttributeMap(domNode.getAttributes())\n            : Collections.emptyMap();\n  }\n\n  private static Map<String, String> convertAttributeMap(NamedNodeMap namedNodeMap) {\n    Map<String, String> map = new HashMap<>();\n    for (int i = 0; i < namedNodeMap.getLength(); i++) {\n      Node node = namedNodeMap.item(i);\n      map.put(node.getNodeName(), node.getNodeValue());\n    }\n\n    return Collections.unmodifiableMap(map);\n  }\n\n  public Map<String, String> getAttributes() {\n    return attributes;\n  }\n\n  public String getName() {\n    return domNode.getNodeName();\n  }\n\n  public String getText() {\n    return domNode.getTextContent();\n  }\n\n  @Override\n  public String toString() {\n    switch (domNode.getNodeType()) {\n      case Node.TEXT_NODE:\n      case Node.ATTRIBUTE_NODE:\n        return domNode.getTextContent();\n      case Node.DOCUMENT_NODE:\n      case Node.ELEMENT_NODE:\n        return render();\n      default:\n        return domNode.toString();\n    }\n  }\n\n  private String render() {\n    try {\n      Transformer transformer = TRANSFORMER_CACHE.get();\n      StreamResult result = new StreamResult(new StringWriter());\n      Source source = getSourceForTransform(domNode);\n      transformer.transform(source, result);\n      return result.getWriter().toString();\n    } catch (Exception e) {\n      return throwUnchecked(e, String.class);\n    }\n  }\n\n  private static final Class<XMLReader> DOM2SAX_XMLREADER_CLASS = getDom2SaxAvailability();\n\n  @SuppressWarnings(\"unchecked\")\n  private static Class<XMLReader> getDom2SaxAvailability() {\n    try {\n      return (Class<XMLReader>)\n          Class.forName(\"com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX\");\n    } catch (ClassNotFoundException e) {\n      return null;\n    }\n  }\n\n  // This nasty little hack attempts to ensure no exception is thrown when attempting to print an\n  // XML node with\n  // unbound namespace prefixes (which can happen when you've selected an element via XPath whose\n  // namespaces are declared in a parent element).\n  // For some reason Transformer is happy to do this with a SAX source, but not a DOM source.\n  private static Source getSourceForTransform(Node node) {\n    if (DOM2SAX_XMLREADER_CLASS != null) {\n      try {\n        Constructor<XMLReader> constructor = DOM2SAX_XMLREADER_CLASS.getConstructor(Node.class);\n        XMLReader dom2SAX = constructor.newInstance(node);\n        SAXSource saxSource = new SAXSource();\n        saxSource.setXMLReader(dom2SAX);\n        return saxSource;\n      } catch (NoSuchMethodException\n          | InstantiationException\n          | IllegalAccessException\n          | InvocationTargetException e) {\n        return new DOMSource(node);\n      }\n    }\n\n    return new DOMSource(node);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/XmlException.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport org.xml.sax.SAXException;\nimport org.xml.sax.SAXParseException;\n\npublic class XmlException extends InvalidInputException {\n\n  protected XmlException(Errors errors) {\n    super(errors);\n  }\n\n  protected XmlException(Throwable cause, Errors errors) {\n    super(cause, errors);\n  }\n\n  public static XmlException fromSaxException(SAXException e) {\n    if (e instanceof SAXParseException) {\n      SAXParseException spe = (SAXParseException) e;\n      String detail =\n          String.format(\n              \"%s; line %d; column %d\",\n              spe.getMessage(), spe.getLineNumber(), spe.getColumnNumber());\n      return new XmlException(Errors.singleWithDetail(50, e.getMessage(), detail));\n    }\n\n    return new XmlException(e, Errors.single(50, e.getMessage()));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/XmlNode.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static javax.xml.transform.OutputKeys.INDENT;\nimport static javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION;\n\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport java.util.Map;\nimport javax.xml.transform.Transformer;\nimport javax.xml.transform.TransformerConfigurationException;\nimport javax.xml.transform.TransformerFactory;\nimport javax.xml.xpath.XPath;\nimport javax.xml.xpath.XPathEvaluationResult;\nimport javax.xml.xpath.XPathFactory;\nimport org.w3c.dom.Node;\n\npublic abstract class XmlNode {\n\n  protected static final ThreadLocal<XPath> XPATH_CACHE =\n      ThreadLocal.withInitial(\n          () -> {\n            final XPathFactory xPathfactory = XPathFactory.newDefaultInstance();\n            return xPathfactory.newXPath();\n          });\n\n  protected static final ThreadLocal<Transformer> TRANSFORMER_CACHE =\n      ThreadLocal.withInitial(\n          () -> {\n            TransformerFactory transformerFactory;\n            try {\n              // Optimization to get likely transformerFactory directly, rather than going through\n              // FactoryFinder#find\n              transformerFactory =\n                  (TransformerFactory)\n                      Class.forName(\n                              \"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl\")\n                          .getDeclaredConstructor()\n                          .newInstance();\n            } catch (Exception e) {\n              transformerFactory = TransformerFactory.newDefaultInstance();\n            }\n            transformerFactory.setAttribute(\"indent-number\", 2);\n\n            try {\n              Transformer transformer = transformerFactory.newTransformer();\n              transformer.setOutputProperty(INDENT, \"yes\");\n              transformer.setOutputProperty(OMIT_XML_DECLARATION, \"yes\");\n              return transformer;\n            } catch (TransformerConfigurationException e) {\n              return throwUnchecked(e, Transformer.class);\n            }\n          });\n\n  public abstract Map<String, String> getAttributes();\n\n  @SuppressWarnings(\"unchecked\")\n  protected static ListOrSingle<XmlNode> toListOrSingle(XPathEvaluationResult<?> evaluationResult) {\n    ListOrSingle<XmlNode> xmlNodes = new ListOrSingle<>();\n\n    switch (evaluationResult.type()) {\n      case NODESET:\n        Iterable<Node> nodes = (Iterable<Node>) evaluationResult.value();\n        nodes.forEach(node -> xmlNodes.add(new XmlDomNode(node)));\n        break;\n      case NODE:\n        xmlNodes.add(new XmlDomNode((Node) evaluationResult.value()));\n        break;\n      default:\n        xmlNodes.add(new XmlPrimitiveNode<>(evaluationResult.value()));\n        break;\n    }\n\n    return xmlNodes;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/common/xml/XmlPrimitiveNode.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.common.xml;\n\nimport java.text.NumberFormat;\nimport java.util.Collections;\nimport java.util.Map;\n\npublic class XmlPrimitiveNode<T> extends XmlNode {\n\n  private final T value;\n\n  public XmlPrimitiveNode(T value) {\n    this.value = value;\n  }\n\n  @Override\n  public String toString() {\n    return value instanceof Number ? NumberFormat.getInstance().format(value) : value.toString();\n  }\n\n  @Override\n  public Map<String, String> getAttributes() {\n    return Collections.emptyMap();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/Admin.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\nimport com.github.tomakehurst.wiremock.admin.model.*;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.recording.RecordSpec;\nimport com.github.tomakehurst.wiremock.recording.RecordSpecBuilder;\nimport com.github.tomakehurst.wiremock.recording.RecordingStatusResult;\nimport com.github.tomakehurst.wiremock.recording.SnapshotRecordResult;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.verification.*;\nimport java.time.Duration;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\n\npublic interface Admin {\n\n  void addStubMapping(StubMapping stubMapping);\n\n  void editStubMapping(StubMapping stubMapping);\n\n  void removeStubMapping(StubMapping stubbMapping);\n\n  void removeStubMapping(UUID id);\n\n  ListStubMappingsResult listAllStubMappings();\n\n  SingleStubMappingResult getStubMapping(UUID id);\n\n  void saveMappings();\n\n  void resetRequests();\n\n  void resetScenarios();\n\n  void resetMappings();\n\n  void resetAll();\n\n  void resetToDefaultMappings();\n\n  GetServeEventsResult getServeEvents();\n\n  GetServeEventsResult getServeEvents(ServeEventQuery query);\n\n  SingleServedStubResult getServedStub(UUID id);\n\n  VerificationResult countRequestsMatching(RequestPattern requestPattern);\n\n  FindRequestsResult findRequestsMatching(RequestPattern requestPattern);\n\n  FindRequestsResult findUnmatchedRequests();\n\n  void removeServeEvent(UUID eventId);\n\n  FindServeEventsResult removeServeEventsMatching(RequestPattern requestPattern);\n\n  FindServeEventsResult removeServeEventsForStubsMatchingMetadata(StringValuePattern pattern);\n\n  FindNearMissesResult findTopNearMissesFor(LoggedRequest loggedRequest);\n\n  FindNearMissesResult findTopNearMissesFor(RequestPattern requestPattern);\n\n  FindNearMissesResult findNearMissesForUnmatchedRequests();\n\n  GetScenariosResult getAllScenarios();\n\n  void resetScenario(String name);\n\n  void setScenarioState(String name, String state);\n\n  void updateGlobalSettings(GlobalSettings settings);\n\n  SnapshotRecordResult snapshotRecord();\n\n  SnapshotRecordResult snapshotRecord(RecordSpec spec);\n\n  SnapshotRecordResult snapshotRecord(RecordSpecBuilder spec);\n\n  void startRecording(String targetBaseUrl);\n\n  void startRecording(RecordSpec spec);\n\n  void startRecording(RecordSpecBuilder recordSpec);\n\n  SnapshotRecordResult stopRecording();\n\n  RecordingStatusResult getRecordingStatus();\n\n  Options getOptions();\n\n  void shutdownServer();\n\n  ListStubMappingsResult findUnmatchedStubs();\n\n  ListStubMappingsResult findAllStubsByMetadata(StringValuePattern pattern);\n\n  void removeStubsByMetadata(StringValuePattern pattern);\n\n  void importStubs(StubImport stubImport);\n\n  void removeStubMappings(List<StubMapping> stubMappings);\n\n  GetGlobalSettingsResult getGlobalSettings();\n\n  /**\n   * Sends a message to all channels of the specified type matching the given request pattern.\n   *\n   * @param type the channel type to target\n   * @param requestPattern the pattern to match against the original upgrade request\n   * @param message the message to send\n   * @return result containing the matched channels that were messaged\n   */\n  SendChannelMessageResult sendChannelMessage(\n      ChannelType type, RequestPattern requestPattern, MessageDefinition message);\n\n  /**\n   * Sends a message to all channels of the specified type matching the given request pattern.\n   * Convenience method that wraps the string message in a MessageDefinition.\n   *\n   * @param type the channel type to target\n   * @param requestPattern the pattern to match against the original upgrade request\n   * @param message the message to send\n   * @return result containing the matched channels that were messaged\n   */\n  default SendChannelMessageResult sendChannelMessage(\n      ChannelType type, RequestPattern requestPattern, String message) {\n    return sendChannelMessage(type, requestPattern, MessageDefinition.fromString(message));\n  }\n\n  /**\n   * Lists all active message channels.\n   *\n   * @return result containing all message channels\n   */\n  ListMessageChannelsResult listAllMessageChannels();\n\n  /**\n   * Adds a message stub mapping that will be matched against incoming messages on channels.\n   *\n   * @param messageStubMapping the message stub mapping to add\n   */\n  void addMessageStubMapping(MessageStubMapping messageStubMapping);\n\n  /**\n   * Removes a message stub mapping by its ID.\n   *\n   * @param id the ID of the message stub mapping to remove\n   */\n  void removeMessageStubMapping(UUID id);\n\n  /** Removes all message stub mappings. */\n  void resetMessageStubMappings();\n\n  /**\n   * Finds all message stub mappings matching the given metadata pattern.\n   *\n   * @param pattern the pattern to match stub metadata against\n   * @return result containing matching message stub mappings\n   */\n  ListMessageStubMappingsResult findAllMessageStubsByMetadata(StringValuePattern pattern);\n\n  /**\n   * Removes all message stub mappings matching the given metadata pattern.\n   *\n   * @param pattern the pattern to match stub metadata against\n   */\n  void removeMessageStubsByMetadata(StringValuePattern pattern);\n\n  /**\n   * Lists all message stub mappings.\n   *\n   * @return result containing all message stub mappings\n   */\n  ListMessageStubMappingsResult listAllMessageStubMappings();\n\n  /**\n   * Gets all message serve events from the message journal.\n   *\n   * @return result containing all message serve events\n   */\n  GetMessageServeEventsResult getMessageServeEvents();\n\n  /**\n   * Gets a specific message serve event by ID.\n   *\n   * @param id the event ID\n   * @return the event if found\n   */\n  SingleMessageServeEventResult getMessageServeEvent(UUID id);\n\n  /**\n   * Counts message events matching the given pattern.\n   *\n   * @param pattern the pattern to match events against\n   * @return the count of matching events\n   */\n  int countMessageEventsMatching(MessagePattern pattern);\n\n  /**\n   * Gets message events matching the given pattern.\n   *\n   * @param pattern the pattern to match events against\n   * @return list of matching events\n   */\n  List<MessageServeEvent> findMessageEventsMatching(MessagePattern pattern);\n\n  /**\n   * Removes a specific message serve event from the journal.\n   *\n   * @param eventId the ID of the event to remove\n   */\n  void removeMessageServeEvent(UUID eventId);\n\n  /**\n   * Removes all message serve events matching the given pattern.\n   *\n   * @param pattern the pattern to match events against\n   * @return result containing the removed events\n   */\n  FindMessageServeEventsResult removeMessageServeEventsMatching(MessagePattern pattern);\n\n  /**\n   * Removes all message serve events for stubs matching the given metadata pattern.\n   *\n   * @param pattern the pattern to match stub metadata against\n   * @return result containing the removed events\n   */\n  FindMessageServeEventsResult removeMessageServeEventsForStubsMatchingMetadata(\n      StringValuePattern pattern);\n\n  /** Resets the message journal, removing all events. */\n  void resetMessageJournal();\n\n  /**\n   * Waits for a message event matching the given pattern to appear in the journal.\n   *\n   * @param pattern the pattern to match events against\n   * @param maxWait the maximum duration to wait\n   * @return the matching event if found within the timeout\n   */\n  Optional<MessageServeEvent> waitForMessageEvent(MessagePattern pattern, Duration maxWait);\n\n  /**\n   * Waits for a specific number of message events matching the given pattern.\n   *\n   * @param pattern the pattern to match events against\n   * @param count the number of events to wait for\n   * @param maxWait the maximum duration to wait\n   * @return list of matching events\n   */\n  List<MessageServeEvent> waitForMessageEvents(MessagePattern pattern, int count, Duration maxWait);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/ConfigurationException.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\npublic class ConfigurationException extends RuntimeException {\n\n  public ConfigurationException(String message) {\n    super(message);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/Container.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\n/** A container of a WireMockApp instance */\npublic interface Container {\n\n  int port();\n\n  /** Shuts down the container, stopping execution of WireMock, gracefully if possible. */\n  void shutdown();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/FaultInjector.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\npublic interface FaultInjector {\n\n  void connectionResetByPeer();\n\n  void emptyResponseAndCloseConnection();\n\n  void malformedResponseChunk();\n\n  void randomDataAndCloseConnection();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/MappingsSaver.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.UUID;\n\npublic interface MappingsSaver {\n  void save(List<StubMapping> stubMappings);\n\n  void save(StubMapping stubMapping);\n\n  void remove(UUID stubMappingId);\n\n  default void remove(List<UUID> stubMappingIds) {\n    stubMappingIds.forEach(this::remove);\n  }\n\n  void removeAll();\n\n  /** Saves the provided stubs and removes all others. */\n  default void setAll(List<StubMapping> stubMappings) {\n    removeAll();\n    save(stubMappings);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/Options.java",
    "content": "/*\n * Copyright (C) 2013-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.extension.ExtensionDeclarations;\nimport com.github.tomakehurst.wiremock.extension.Extensions;\nimport com.github.tomakehurst.wiremock.http.CaseInsensitiveKey;\nimport com.github.tomakehurst.wiremock.http.HttpServerFactory;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.WiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.security.Authenticator;\nimport com.github.tomakehurst.wiremock.standalone.MappingsLoader;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.verification.notmatched.NotMatchedRenderer;\nimport com.github.tomakehurst.wiremock.verification.notmatched.PlainTextStubNotMatchedRenderer;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.function.Function;\n\npublic interface Options {\n\n  enum ChunkedEncodingPolicy {\n    ALWAYS,\n    NEVER,\n    BODY_FILE\n  }\n\n  int DEFAULT_PORT = 8080;\n  int DYNAMIC_PORT = 0;\n  int DEFAULT_TIMEOUT = 300_000;\n  int DEFAULT_CONTAINER_THREADS = 25;\n  String DEFAULT_BIND_ADDRESS = \"0.0.0.0\";\n  int DEFAULT_MAX_HTTP_CONNECTIONS = 1000;\n  int DEFAULT_WEBHOOK_THREADPOOL_SIZE = 10;\n  boolean DEFAULT_DISABLE_CONNECTION_REUSE = true;\n  Long DEFAULT_MAX_TEMPLATE_CACHE_ENTRIES = 1000L;\n  long DEFAULT_WEBSOCKET_IDLE_TIMEOUT = 300_000;\n  long DEFAULT_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE = 10485760;\n  long DEFAULT_WEBSOCKET_MAX_BINARY_MESSAGE_SIZE = 10485760;\n\n  int portNumber();\n\n  boolean getHttpDisabled();\n\n  boolean getHttp2PlainDisabled();\n\n  boolean getHttp2TlsDisabled();\n\n  HttpsSettings httpsSettings();\n\n  int containerThreads();\n\n  /**\n   * @deprecated use {@link BrowserProxySettings#enabled()}\n   */\n  @Deprecated\n  boolean browserProxyingEnabled();\n\n  BrowserProxySettings browserProxySettings();\n\n  ProxySettings proxyVia();\n\n  Stores getStores();\n\n  FileSource filesRoot();\n\n  MappingsLoader mappingsLoader();\n\n  MappingsSaver mappingsSaver();\n\n  Notifier notifier();\n\n  boolean requestJournalDisabled();\n\n  Optional<Integer> maxRequestJournalEntries();\n\n  String bindAddress();\n\n  FilenameMaker getFilenameMaker();\n\n  List<CaseInsensitiveKey> matchingHeaders();\n\n  boolean shouldPreserveHostHeader();\n\n  boolean shouldPreserveUserAgentProxyHeader();\n\n  String proxyHostHeader();\n\n  HttpServerFactory httpServerFactory();\n\n  HttpClientFactory httpClientFactory();\n\n  ExtensionDeclarations getDeclaredExtensions();\n\n  boolean isExtensionScanningEnabled();\n\n  WiremockNetworkTrafficListener networkTrafficListener();\n\n  Authenticator getAdminAuthenticator();\n\n  boolean getHttpsRequiredForAdminApi();\n\n  default Function<Extensions, NotMatchedRenderer> getNotMatchedRendererFactory() {\n    return PlainTextStubNotMatchedRenderer::new;\n  }\n\n  AsynchronousResponseSettings getAsynchronousResponseSettings();\n\n  ChunkedEncodingPolicy getChunkedEncodingPolicy();\n\n  boolean getGzipDisabled();\n\n  boolean getStubRequestLoggingDisabled();\n\n  boolean getStubCorsEnabled();\n\n  long timeout();\n\n  boolean getDisableOptimizeXmlFactoriesLoading();\n\n  boolean getDisableStrictHttpHeaders();\n\n  DataTruncationSettings getDataTruncationSettings();\n\n  NetworkAddressRules getProxyTargetRules();\n\n  int proxyTimeout();\n\n  int getMaxHttpClientConnections();\n\n  boolean getResponseTemplatingEnabled();\n\n  boolean getResponseTemplatingGlobal();\n\n  Long getMaxTemplateCacheEntries();\n\n  Set<String> getTemplatePermittedSystemKeys();\n\n  boolean getTemplateEscapingDisabled();\n\n  Set<String> getSupportedProxyEncodings();\n\n  boolean getDisableConnectionReuse();\n\n  int getWebhookThreadPoolSize();\n\n  long getWebSocketIdleTimeout();\n\n  long getWebSocketMaxTextMessageSize();\n\n  long getWebSocketMaxBinaryMessageSize();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/StubServer.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic interface StubServer {\n\n  ServeEvent serveStubFor(ServeEvent serveEvent);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/Version.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\nimport static com.github.tomakehurst.wiremock.common.Lazy.lazy;\n\nimport com.github.tomakehurst.wiremock.common.Lazy;\nimport java.io.IOException;\nimport java.util.Properties;\n\npublic class Version {\n  private static final Lazy<String> version = lazy(Version::load);\n\n  public static String getCurrentVersion() {\n    return version.get();\n  }\n\n  private static String load() {\n    try {\n      Properties properties = new Properties();\n      properties.load(Version.class.getResourceAsStream(\"/version.properties\"));\n      return properties.getProperty(\"version\");\n    } catch (NullPointerException | IOException e) {\n      return \"unknown\";\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/WireMockApp.java",
    "content": "/*\n * Copyright (C) 2012-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.github.tomakehurst.wiremock.admin.AdminRoutes;\nimport com.github.tomakehurst.wiremock.admin.LimitAndOffsetPaginator;\nimport com.github.tomakehurst.wiremock.admin.model.*;\nimport com.github.tomakehurst.wiremock.common.BrowserProxySettings;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.xml.Xml;\nimport com.github.tomakehurst.wiremock.extension.*;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestFilter;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestFilterV2;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.HttpStubServeEventListener;\nimport com.github.tomakehurst.wiremock.message.MessageChannels;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.message.MessageStubMappings;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport com.github.tomakehurst.wiremock.message.RequestInitiatedMessageChannel;\nimport com.github.tomakehurst.wiremock.recording.*;\nimport com.github.tomakehurst.wiremock.standalone.MappingsLoader;\nimport com.github.tomakehurst.wiremock.store.DefaultStores;\nimport com.github.tomakehurst.wiremock.store.SettingsStore;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.stubbing.*;\nimport com.github.tomakehurst.wiremock.verification.*;\nimport com.jayway.jsonpath.JsonPathException;\nimport com.jayway.jsonpath.spi.cache.CacheProvider;\nimport com.jayway.jsonpath.spi.cache.NOOPCache;\nimport java.time.Duration;\nimport java.util.*;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport java.util.stream.Collectors;\nimport org.wiremock.url.Segment;\n\npublic class WireMockApp implements StubServer, Admin {\n\n  public static final String FILES_ROOT = \"__files\";\n  public static final Segment ADMIN_CONTEXT_ROOT_SEGMENT = Segment.parse(\"__admin\");\n  public static final String ADMIN_CONTEXT_ROOT = \"/\" + ADMIN_CONTEXT_ROOT_SEGMENT;\n  public static final String MAPPINGS_ROOT = \"mappings\";\n  public static final String MESSAGE_MAPPINGS_ROOT = \"message-mappings\";\n  private static final AtomicBoolean FACTORIES_LOADING_OPTIMIZED = new AtomicBoolean(false);\n\n  private final Stores stores;\n  private final Scenarios scenarios;\n  private final StubMappings stubMappings;\n  private final RequestJournal requestJournal;\n  private final MessageJournal messageJournal;\n  private final SettingsStore settingsStore;\n  private final boolean browserProxyingEnabled;\n  private final MappingsLoader defaultMappingsLoader;\n  private final Container container;\n  private final MappingsSaver mappingsSaver;\n  private final NearMissCalculator nearMissCalculator;\n  private final Recorder recorder;\n  private final List<GlobalSettingsListener> globalSettingsListeners;\n  private final Map<String, MappingsLoaderExtension> mappingsLoaderExtensions;\n  private final Map<String, ServeEventListener> serveEventListeners;\n  private final MessageChannels messageChannels;\n  private final MessageStubMappings messageStubMappings;\n\n  private Options options;\n\n  private Extensions extensions;\n\n  public WireMockApp(Options options, Container container) {\n    if (!options.getDisableOptimizeXmlFactoriesLoading()\n        && Boolean.FALSE.equals(FACTORIES_LOADING_OPTIMIZED.get())) {\n      Xml.optimizeFactoriesLoading();\n      FACTORIES_LOADING_OPTIMIZED.set(true);\n    }\n\n    try {\n      // Disabling JsonPath's cache due to\n      // https://github.com/json-path/JsonPath/issues/975#issuecomment-1867293053 and the fact that\n      // we're now doing our own caching.\n      CacheProvider.setCache(new NOOPCache());\n    } catch (JsonPathException ignored) {\n      // May fail on subsequent runs, but this doesn't matter\n    }\n\n    this.options = options;\n    this.stores = options.getStores();\n    this.stores.start();\n\n    this.browserProxyingEnabled = options.browserProxySettings().enabled();\n    this.defaultMappingsLoader = options.mappingsLoader();\n    this.mappingsSaver = options.mappingsSaver();\n\n    this.settingsStore = stores.getSettingsStore();\n\n    extensions =\n        new Extensions(\n            options.getDeclaredExtensions(),\n            this,\n            options,\n            stores,\n            options.filesRoot().child(FILES_ROOT));\n    extensions.load();\n\n    Map<String, RequestMatcherExtension> customMatchers =\n        extensions.ofType(RequestMatcherExtension.class);\n\n    requestJournal =\n        options.requestJournalDisabled()\n            ? new DisabledRequestJournal()\n            : new StoreBackedRequestJournal(\n                options.maxRequestJournalEntries().orElse(null),\n                customMatchers,\n                stores.getRequestJournalStore());\n\n    messageJournal =\n        options.requestJournalDisabled()\n            ? new DisabledMessageJournal()\n            : new StoreBackedMessageJournal(\n                options.maxRequestJournalEntries().orElse(null), stores.getMessageJournalStore());\n\n    this.messageChannels = new MessageChannels(stores.getMessageChannelStore());\n    this.messageStubMappings = new MessageStubMappings(stores.getMessageStubMappingStore());\n\n    HttpStubServeEventListener httpStubListener =\n        new HttpStubServeEventListener(\n            messageStubMappings,\n            messageChannels,\n            stores,\n            customMatchers,\n            List.copyOf(extensions.ofType(MessageActionTransformer.class).values()));\n    Map<String, ServeEventListener> extensionListeners =\n        extensions.ofType(ServeEventListener.class);\n    Map<String, ServeEventListener> combinedListeners = new HashMap<>(extensionListeners);\n    combinedListeners.put(httpStubListener.getName(), httpStubListener);\n    serveEventListeners = Collections.unmodifiableMap(combinedListeners);\n\n    scenarios = new InMemoryScenarios(stores.getScenariosStore());\n    stubMappings =\n        new StoreBackedStubMappings(\n            stores.getStubStore(),\n            scenarios,\n            customMatchers,\n            extensions.ofType(ResponseDefinitionTransformer.class),\n            extensions.ofType(ResponseDefinitionTransformerV2.class),\n            stores.getFilesBlobStore(),\n            List.copyOf(extensions.ofType(StubLifecycleListener.class).values()),\n            serveEventListeners);\n    nearMissCalculator =\n        new NearMissCalculator(stubMappings, requestJournal, scenarios, customMatchers);\n    recorder =\n        new Recorder(this, extensions, stores.getFilesBlobStore(), stores.getRecorderStateStore());\n    globalSettingsListeners = List.copyOf(extensions.ofType(GlobalSettingsListener.class).values());\n    this.mappingsLoaderExtensions = extensions.ofType(MappingsLoaderExtension.class);\n\n    this.container = container;\n    extensions.startAll();\n    loadDefaultMappings();\n  }\n\n  public WireMockApp(\n      boolean browserProxyingEnabled,\n      MappingsLoader defaultMappingsLoader,\n      Map<String, MappingsLoaderExtension> mappingsLoaderExtensions,\n      MappingsSaver mappingsSaver,\n      boolean requestJournalDisabled,\n      Integer maxRequestJournalEntries,\n      Map<String, ResponseDefinitionTransformer> transformers,\n      Map<String, ResponseDefinitionTransformerV2> v2transformers,\n      Map<String, RequestMatcherExtension> requestMatchers,\n      FileSource rootFileSource,\n      Container container) {\n\n    this.stores = new DefaultStores(rootFileSource);\n\n    this.browserProxyingEnabled = browserProxyingEnabled;\n    this.defaultMappingsLoader = defaultMappingsLoader;\n    this.mappingsLoaderExtensions = mappingsLoaderExtensions;\n    this.mappingsSaver = mappingsSaver;\n    this.settingsStore = stores.getSettingsStore();\n    requestJournal =\n        requestJournalDisabled\n            ? new DisabledRequestJournal()\n            : new StoreBackedRequestJournal(\n                maxRequestJournalEntries, requestMatchers, stores.getRequestJournalStore());\n    messageJournal =\n        requestJournalDisabled\n            ? new DisabledMessageJournal()\n            : new StoreBackedMessageJournal(\n                maxRequestJournalEntries, stores.getMessageJournalStore());\n    scenarios = new InMemoryScenarios(stores.getScenariosStore());\n\n    this.messageChannels = new MessageChannels(stores.getMessageChannelStore());\n    this.messageStubMappings = new MessageStubMappings(stores.getMessageStubMappingStore());\n\n    HttpStubServeEventListener httpStubListener =\n        new HttpStubServeEventListener(\n            messageStubMappings,\n            messageChannels,\n            stores,\n            requestMatchers,\n            List.copyOf(extensions.ofType(MessageActionTransformer.class).values()));\n    serveEventListeners = Map.of(httpStubListener.getName(), httpStubListener);\n\n    stubMappings =\n        new StoreBackedStubMappings(\n            stores.getStubStore(),\n            scenarios,\n            requestMatchers,\n            transformers,\n            v2transformers,\n            stores.getFilesBlobStore(),\n            Collections.emptyList(),\n            serveEventListeners);\n    this.container = container;\n    nearMissCalculator =\n        new NearMissCalculator(stubMappings, requestJournal, scenarios, requestMatchers);\n    recorder =\n        new Recorder(this, extensions, stores.getFilesBlobStore(), stores.getRecorderStateStore());\n    globalSettingsListeners = Collections.emptyList();\n    loadDefaultMappings();\n  }\n\n  public AdminRequestHandler buildAdminRequestHandler() {\n    AdminRoutes adminRoutes =\n        AdminRoutes.forServer(extensions.ofType(AdminApiExtension.class).values(), stores);\n    return new AdminRequestHandler(\n        adminRoutes,\n        this,\n        new BasicResponseRenderer(),\n        options.getAdminAuthenticator(),\n        options.getHttpsRequiredForAdminApi(),\n        getAdminRequestFilters(),\n        getV2AdminRequestFilters(),\n        options.getDataTruncationSettings());\n  }\n\n  public StubRequestHandler buildStubRequestHandler() {\n    Map<String, PostServeAction> postServeActions = extensions.ofType(PostServeAction.class);\n    BrowserProxySettings browserProxySettings = options.browserProxySettings();\n\n    final HttpClientFactory httpClientFactory =\n        new StaticExtensionLoader<>(HttpClientFactory.class)\n            .setSpecificInstance(options.httpClientFactory())\n            .setExtensions(extensions)\n            .load();\n\n    final HttpClient reverseProxyClient =\n        httpClientFactory.buildHttpClient(options, true, Collections.emptyList(), true);\n    final HttpClient forwardProxyClient =\n        httpClientFactory.buildHttpClient(\n            options,\n            browserProxySettings.trustAllProxyTargets(),\n            browserProxySettings.trustAllProxyTargets()\n                ? Collections.emptyList()\n                : browserProxySettings.trustedProxyTargets(),\n            false);\n\n    return new StubRequestHandler(\n        this,\n        new StubResponseRenderer(\n            options.getStores().getFilesBlobStore(),\n            settingsStore,\n            new ProxyResponseRenderer(\n                options.shouldPreserveHostHeader(),\n                options.proxyHostHeader(),\n                settingsStore,\n                options.getStubCorsEnabled(),\n                options.getSupportedProxyEncodings(),\n                reverseProxyClient,\n                forwardProxyClient),\n            List.copyOf(extensions.ofType(ResponseTransformer.class).values()),\n            List.copyOf(extensions.ofType(ResponseTransformerV2.class).values())),\n        this,\n        postServeActions,\n        serveEventListeners,\n        requestJournal,\n        getStubRequestFilters(),\n        getV2StubRequestFilters(),\n        options.getStubRequestLoggingDisabled(),\n        options.getDataTruncationSettings(),\n        options.getNotMatchedRendererFactory().apply(extensions));\n  }\n\n  public MessageStubRequestHandler buildMessageStubRequestHandler() {\n    return new MessageStubRequestHandler(\n        messageStubMappings,\n        messageChannels,\n        messageJournal,\n        stores,\n        List.copyOf(extensions.ofType(MessageActionTransformer.class).values()));\n  }\n\n  private List<RequestFilter> getAdminRequestFilters() {\n    return extensions.ofType(RequestFilter.class).values().stream()\n        .filter(RequestFilter::applyToAdmin)\n        .collect(Collectors.toList());\n  }\n\n  private List<RequestFilterV2> getV2AdminRequestFilters() {\n    return extensions.ofType(RequestFilterV2.class).values().stream()\n        .filter(RequestFilterV2::applyToAdmin)\n        .collect(Collectors.toList());\n  }\n\n  private List<RequestFilter> getStubRequestFilters() {\n    return extensions.ofType(RequestFilter.class).values().stream()\n        .filter(RequestFilter::applyToStubs)\n        .collect(Collectors.toList());\n  }\n\n  private List<RequestFilterV2> getV2StubRequestFilters() {\n    return extensions.ofType(RequestFilterV2.class).values().stream()\n        .filter(RequestFilterV2::applyToStubs)\n        .collect(Collectors.toList());\n  }\n\n  private void loadDefaultMappings() {\n    loadMappingsUsing(defaultMappingsLoader);\n    loadMessageMappingsUsing(defaultMappingsLoader);\n    if (mappingsLoaderExtensions != null) {\n      mappingsLoaderExtensions.values().forEach(e -> loadMappingsUsing(e));\n      mappingsLoaderExtensions.values().forEach(e -> loadMessageMappingsUsing(e));\n    }\n  }\n\n  public void loadMappingsUsing(final MappingsLoader mappingsLoader) {\n    mappingsLoader.loadMappingsInto(stubMappings);\n  }\n\n  public void loadMessageMappingsUsing(final MappingsLoader mappingsLoader) {\n    mappingsLoader.loadMessageMappingsInto(messageStubMappings);\n  }\n\n  @Override\n  public ServeEvent serveStubFor(ServeEvent initialServeEvent) {\n    ServeEvent serveEvent = stubMappings.serveFor(initialServeEvent);\n\n    if (serveEvent.isNoExactMatch()\n        && browserProxyingEnabled\n        && serveEvent.getRequest().isBrowserProxyRequest()\n        && getGlobalSettings().getSettings().getProxyPassThrough()) {\n      return ServeEvent.ofUnmatched(\n          serveEvent.getRequest(), ResponseDefinition.browserProxy(serveEvent.getRequest()));\n    }\n\n    return serveEvent;\n  }\n\n  @Override\n  public void addStubMapping(StubMapping stubMapping) {\n    if (stubMapping.getId() == null) {\n      stubMapping = stubMapping.transform(b -> b.setId(UUID.randomUUID()));\n    }\n\n    stubMapping = stubMappings.addMapping(stubMapping);\n    if (stubMapping.shouldBePersisted()) {\n      mappingsSaver.save(stubMapping);\n    }\n  }\n\n  @Override\n  public void removeStubMapping(StubMapping stubMapping) {\n    StubMapping matchedStub = findStubMatching(stubMapping);\n    if (matchedStub == null) return;\n\n    stubMappings.removeMapping(matchedStub);\n\n    if (matchedStub.shouldBePersisted()) {\n      mappingsSaver.remove(matchedStub.getId());\n    }\n  }\n\n  /**\n   * Attempts to retrieve a stub mapping that matches the provided stub. For a stub to \"match\", it\n   * must either share the same ID or the same request pattern. Matching the stub ID is prioritized\n   * over matching the request pattern. In other words, stubs are only checked for matching request\n   * patterns if no stubs are found that match the provided stub's ID.\n   */\n  private StubMapping findStubMatching(StubMapping stubMapping) {\n    return stubMappings\n        .get(stubMapping.getId())\n        .orElseGet(\n            () ->\n                stubMappings.getAll().stream()\n                    .filter(stub -> stub.getRequest().equals(stubMapping.getRequest()))\n                    .findFirst()\n                    .orElse(null));\n  }\n\n  @Override\n  public void removeStubMapping(UUID id) {\n    stubMappings.get(id).ifPresent(this::removeStubMapping);\n  }\n\n  @Override\n  public void editStubMapping(StubMapping stubMapping) {\n    stubMapping = stubMappings.editMapping(stubMapping);\n    if (stubMapping.shouldBePersisted()) {\n      mappingsSaver.save(stubMapping);\n    }\n  }\n\n  @Override\n  public ListStubMappingsResult listAllStubMappings() {\n    return new ListStubMappingsResult(LimitAndOffsetPaginator.none(stubMappings.getAll()));\n  }\n\n  @Override\n  public SingleStubMappingResult getStubMapping(UUID id) {\n    return SingleStubMappingResult.fromOptional(stubMappings.get(id));\n  }\n\n  @Override\n  public void saveMappings() {\n    for (StubMapping stubMapping : stubMappings.getAll()) {\n      stubMappings.editMapping(stubMapping.transform(b -> b.setPersistent(true)));\n    }\n    mappingsSaver.save(stubMappings.getAll());\n  }\n\n  @Override\n  public void resetAll() {\n    resetToDefaultMappings();\n  }\n\n  @Override\n  public void resetRequests() {\n    requestJournal.reset();\n  }\n\n  @Override\n  public void resetToDefaultMappings() {\n    stubMappings.reset();\n    resetRequests();\n    loadDefaultMappings();\n  }\n\n  @Override\n  public void resetScenarios() {\n    stubMappings.resetScenarios();\n  }\n\n  @Override\n  public void resetMappings() {\n    mappingsSaver.removeAll();\n    stubMappings.reset();\n  }\n\n  @Override\n  public GetServeEventsResult getServeEvents() {\n    return getServeEvents(ServeEventQuery.ALL);\n  }\n\n  @Override\n  public GetServeEventsResult getServeEvents(ServeEventQuery query) {\n    try {\n      final List<ServeEvent> serveEvents = query.filter(requestJournal.getAllServeEvents());\n      return GetServeEventsResult.requestJournalEnabled(LimitAndOffsetPaginator.none(serveEvents));\n    } catch (RequestJournalDisabledException e) {\n      return GetServeEventsResult.requestJournalDisabled(\n          LimitAndOffsetPaginator.none(requestJournal.getAllServeEvents()));\n    }\n  }\n\n  @Override\n  public SingleServedStubResult getServedStub(UUID id) {\n    return SingleServedStubResult.fromOptional(requestJournal.getServeEvent(id));\n  }\n\n  @Override\n  public VerificationResult countRequestsMatching(RequestPattern requestPattern) {\n    try {\n      return VerificationResult.withCount(requestJournal.countRequestsMatching(requestPattern));\n    } catch (RequestJournalDisabledException e) {\n      return VerificationResult.withRequestJournalDisabled();\n    }\n  }\n\n  @Override\n  public FindRequestsResult findRequestsMatching(RequestPattern requestPattern) {\n    try {\n      List<LoggedRequest> requests = requestJournal.getRequestsMatching(requestPattern);\n      return FindRequestsResult.withRequests(requests);\n    } catch (RequestJournalDisabledException e) {\n      return FindRequestsResult.withRequestJournalDisabled();\n    }\n  }\n\n  @Override\n  public FindRequestsResult findUnmatchedRequests() {\n    try {\n      List<LoggedRequest> requests =\n          requestJournal.getAllServeEvents().stream()\n              .filter(ServeEvent::isNoExactMatch)\n              .map(ServeEvent::getRequest)\n              .collect(Collectors.toList());\n      return FindRequestsResult.withRequests(requests);\n    } catch (RequestJournalDisabledException e) {\n      return FindRequestsResult.withRequestJournalDisabled();\n    }\n  }\n\n  @Override\n  public void removeServeEvent(UUID eventId) {\n    requestJournal.removeEvent(eventId);\n  }\n\n  @Override\n  public FindServeEventsResult removeServeEventsMatching(RequestPattern requestPattern) {\n    return new FindServeEventsResult(requestJournal.removeEventsMatching(requestPattern));\n  }\n\n  @Override\n  public FindServeEventsResult removeServeEventsForStubsMatchingMetadata(\n      StringValuePattern metadataPattern) {\n    return new FindServeEventsResult(\n        requestJournal.removeServeEventsForStubsMatchingMetadata(metadataPattern));\n  }\n\n  @Override\n  public FindNearMissesResult findNearMissesForUnmatchedRequests() {\n    List<NearMiss> nearMisses = new ArrayList<>();\n    List<ServeEvent> unmatchedServeEvents =\n        requestJournal.getAllServeEvents().stream()\n            .filter(ServeEvent::isNoExactMatch)\n            .collect(Collectors.toList());\n\n    for (ServeEvent serveEvent : unmatchedServeEvents) {\n      nearMisses.addAll(nearMissCalculator.findNearestTo(serveEvent.getRequest()));\n    }\n\n    return new FindNearMissesResult(nearMisses);\n  }\n\n  @Override\n  public GetScenariosResult getAllScenarios() {\n    return new GetScenariosResult(stubMappings.getAllScenarios());\n  }\n\n  @Override\n  public void resetScenario(String name) {\n    scenarios.resetSingle(name);\n  }\n\n  @Override\n  public void setScenarioState(String name, String state) {\n    scenarios.setSingle(name, state);\n  }\n\n  @Override\n  public FindNearMissesResult findTopNearMissesFor(LoggedRequest loggedRequest) {\n    return new FindNearMissesResult(nearMissCalculator.findNearestTo(loggedRequest));\n  }\n\n  @Override\n  public FindNearMissesResult findTopNearMissesFor(RequestPattern requestPattern) {\n    return new FindNearMissesResult(nearMissCalculator.findNearestTo(requestPattern));\n  }\n\n  @Override\n  public GetGlobalSettingsResult getGlobalSettings() {\n    return new GetGlobalSettingsResult(settingsStore.get());\n  }\n\n  @Override\n  public void updateGlobalSettings(GlobalSettings newSettings) {\n    GlobalSettings oldSettings = settingsStore.get();\n\n    for (GlobalSettingsListener listener : globalSettingsListeners) {\n      listener.beforeGlobalSettingsUpdated(oldSettings, newSettings);\n    }\n\n    settingsStore.set(newSettings);\n\n    for (GlobalSettingsListener listener : globalSettingsListeners) {\n      listener.afterGlobalSettingsUpdated(oldSettings, newSettings);\n    }\n  }\n\n  public int port() {\n    return container.port();\n  }\n\n  @Override\n  public Options getOptions() {\n    return options;\n  }\n\n  public Extensions getExtensions() {\n    return extensions;\n  }\n\n  @Override\n  public void shutdownServer() {\n    extensions.stopAll();\n    stores.stop();\n    container.shutdown();\n  }\n\n  public SnapshotRecordResult snapshotRecord() {\n    return snapshotRecord(RecordSpec.DEFAULTS);\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord(RecordSpecBuilder spec) {\n    return snapshotRecord(spec.build());\n  }\n\n  public SnapshotRecordResult snapshotRecord(RecordSpec recordSpec) {\n    return recorder.takeSnapshot(getServeEvents().getServeEvents(), recordSpec);\n  }\n\n  @Override\n  public void startRecording(String targetBaseUrl) {\n    recorder.startRecording(RecordSpec.forBaseUrl(targetBaseUrl));\n  }\n\n  @Override\n  public void startRecording(RecordSpec recordSpec) {\n    recorder.startRecording(recordSpec);\n  }\n\n  @Override\n  public void startRecording(RecordSpecBuilder recordSpec) {\n    recorder.startRecording(recordSpec.build());\n  }\n\n  @Override\n  public SnapshotRecordResult stopRecording() {\n    return recorder.stopRecording();\n  }\n\n  @Override\n  public RecordingStatusResult getRecordingStatus() {\n    return new RecordingStatusResult(recorder.getStatus().name());\n  }\n\n  private Set<UUID> findMatchedStubIds() {\n    return requestJournal.getAllServeEvents().stream()\n        .filter(event -> event.getStubMapping() != null)\n        .map(event -> event.getStubMapping().getId())\n        .collect(Collectors.toSet());\n  }\n\n  @Override\n  public ListStubMappingsResult findUnmatchedStubs() {\n    // Collect IDs of stub mappings that have matched at least one request in a HashSet for O(1)\n    // lookups so this method is O(n + m), where n is the number of stubs and m is the number of\n    // requests in the journal.\n    // It'd be slightly more efficient to use IdentityHashMap, but that's error-prone.\n    Set<UUID> servedStubIds = findMatchedStubIds();\n    List<StubMapping> foundMappings =\n        stubMappings.getAll().stream()\n            .filter(stub -> !servedStubIds.contains(stub.getId()))\n            .collect(Collectors.toList());\n    return new ListStubMappingsResult(LimitAndOffsetPaginator.none(foundMappings));\n  }\n\n  @Override\n  public ListStubMappingsResult findAllStubsByMetadata(StringValuePattern pattern) {\n    return new ListStubMappingsResult(\n        LimitAndOffsetPaginator.none(stubMappings.findByMetadata(pattern)));\n  }\n\n  @Override\n  public void removeStubsByMetadata(StringValuePattern pattern) {\n    removeStubMappings(stubMappings.findByMetadata(pattern));\n  }\n\n  @Override\n  public void importStubs(StubImport stubImport) {\n    List<StubMapping> mappings = stubImport.getMappings();\n    StubImport.Options importOptions =\n        getFirstNonNull(stubImport.getImportOptions(), StubImport.Options.DEFAULTS);\n\n    List<StubMapping> mappingsToInsert = new ArrayList<>();\n    for (int i = mappings.size() - 1; i >= 0; i--) {\n      StubMapping mapping = mappings.get(i);\n      if (getStubMapping(mapping.getId()).isPresent()) {\n        if (importOptions.getDuplicatePolicy() == StubImport.Options.DuplicatePolicy.OVERWRITE) {\n          mappingsToInsert.add(mapping);\n        }\n      } else {\n        mappingsToInsert.add(mapping);\n      }\n    }\n\n    if (importOptions.getDeleteAllNotInImport()) {\n      Set<UUID> ids = mappings.stream().map(StubMapping::getId).collect(Collectors.toSet());\n      List<StubMapping> mappingsToRemove = new ArrayList<>();\n      for (StubMapping mapping : listAllStubMappings().getMappings()) {\n        if (!ids.contains(mapping.getId())) {\n          mappingsToRemove.add(mapping);\n        }\n      }\n      stubMappings.updateMappings(mappingsToInsert, mappingsToRemove);\n      mappingsSaver.setAll(\n          listAllStubMappings().getMappings().stream()\n              .filter(StubMapping::shouldBePersisted)\n              .toList());\n    } else {\n      List<StubMapping> insertedStubs = stubMappings.updateMappings(mappingsToInsert, List.of());\n      List<StubMapping> mappingsToSave =\n          insertedStubs.stream().filter(StubMapping::shouldBePersisted).toList();\n      if (!mappingsToSave.isEmpty()) mappingsSaver.save(mappingsToSave);\n    }\n  }\n\n  @Override\n  public void removeStubMappings(List<StubMapping> stubMappings) {\n    List<StubMapping> toRemove =\n        stubMappings.stream()\n            .<StubMapping>mapMulti(\n                (mapping, consumer) -> {\n                  StubMapping found = findStubMatching(mapping);\n                  if (found != null) consumer.accept(found);\n                })\n            .toList();\n    if (!toRemove.isEmpty()) {\n      this.stubMappings.updateMappings(List.of(), toRemove);\n      List<UUID> mappingsToDelete = new ArrayList<>();\n      for (StubMapping removed : toRemove) {\n        if (removed.shouldBePersisted()) mappingsToDelete.add(removed.getId());\n      }\n      if (!mappingsToDelete.isEmpty()) mappingsSaver.remove(mappingsToDelete);\n    }\n  }\n\n  public Set<String> getLoadedExtensionNames() {\n    return extensions.getAllExtensionNames();\n  }\n\n  @Override\n  public SendChannelMessageResult sendChannelMessage(\n      ChannelType type, RequestPattern requestPattern, MessageDefinition message) {\n    Map<String, RequestMatcherExtension> customMatchers =\n        extensions.ofType(RequestMatcherExtension.class);\n    List<RequestInitiatedMessageChannel> matchedChannels =\n        messageChannels.sendMessageToMatchingByType(type, requestPattern, message, customMatchers);\n    List<LoggedMessageChannel> loggedChannels =\n        matchedChannels.stream().map(LoggedMessageChannel::createFrom).collect(Collectors.toList());\n    return new SendChannelMessageResult(loggedChannels);\n  }\n\n  @Override\n  public ListMessageChannelsResult listAllMessageChannels() {\n    List<LoggedMessageChannel> channels =\n        messageChannels.getAll().stream()\n            .map(LoggedMessageChannel::createFrom)\n            .collect(Collectors.toList());\n    return new ListMessageChannelsResult(channels);\n  }\n\n  @Override\n  public void addMessageStubMapping(MessageStubMapping messageStubMapping) {\n    messageStubMappings.add(messageStubMapping);\n  }\n\n  @Override\n  public void removeMessageStubMapping(UUID id) {\n    messageStubMappings.remove(id);\n  }\n\n  @Override\n  public void resetMessageStubMappings() {\n    messageStubMappings.clear();\n  }\n\n  @Override\n  public ListMessageStubMappingsResult findAllMessageStubsByMetadata(StringValuePattern pattern) {\n    return new ListMessageStubMappingsResult(\n        LimitAndOffsetPaginator.none(messageStubMappings.findByMetadata(pattern)));\n  }\n\n  @Override\n  public void removeMessageStubsByMetadata(StringValuePattern pattern) {\n    List<MessageStubMapping> toRemove = messageStubMappings.findByMetadata(pattern);\n    for (MessageStubMapping stub : toRemove) {\n      messageStubMappings.remove(stub.getId());\n    }\n  }\n\n  @Override\n  public ListMessageStubMappingsResult listAllMessageStubMappings() {\n    return new ListMessageStubMappingsResult(\n        LimitAndOffsetPaginator.none(messageStubMappings.getAll()));\n  }\n\n  @Override\n  public GetMessageServeEventsResult getMessageServeEvents() {\n    try {\n      return GetMessageServeEventsResult.messageJournalEnabled(\n          messageJournal.getAllMessageServeEvents());\n    } catch (MessageJournalDisabledException e) {\n      return GetMessageServeEventsResult.messageJournalDisabled();\n    }\n  }\n\n  @Override\n  public SingleMessageServeEventResult getMessageServeEvent(UUID id) {\n    return SingleMessageServeEventResult.fromOptional(messageJournal.getMessageServeEvent(id));\n  }\n\n  @Override\n  public int countMessageEventsMatching(MessagePattern pattern) {\n    return messageJournal.countEventsMatching(pattern);\n  }\n\n  @Override\n  public List<MessageServeEvent> findMessageEventsMatching(MessagePattern pattern) {\n    return messageJournal.getEventsMatching(pattern);\n  }\n\n  @Override\n  public void removeMessageServeEvent(UUID eventId) {\n    messageJournal.removeEvent(eventId);\n  }\n\n  @Override\n  public FindMessageServeEventsResult removeMessageServeEventsMatching(MessagePattern pattern) {\n    return new FindMessageServeEventsResult(messageJournal.removeEventsMatching(pattern));\n  }\n\n  @Override\n  public FindMessageServeEventsResult removeMessageServeEventsForStubsMatchingMetadata(\n      StringValuePattern pattern) {\n    return new FindMessageServeEventsResult(\n        messageJournal.removeEventsForStubsMatchingMetadata(pattern));\n  }\n\n  @Override\n  public void resetMessageJournal() {\n    messageJournal.reset();\n  }\n\n  @Override\n  public Optional<MessageServeEvent> waitForMessageEvent(MessagePattern pattern, Duration maxWait) {\n    return messageJournal.waitForEvent(pattern, maxWait);\n  }\n\n  @Override\n  public List<MessageServeEvent> waitForMessageEvents(\n      MessagePattern pattern, int count, Duration maxWait) {\n    return messageJournal.waitForEvents(pattern, count, maxWait);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/core/WireMockConfiguration.java",
    "content": "/*\n * Copyright (C) 2013-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.core;\n\nimport static com.github.tomakehurst.wiremock.common.BrowserProxySettings.DEFAULT_CA_KESTORE_PASSWORD;\nimport static com.github.tomakehurst.wiremock.common.BrowserProxySettings.DEFAULT_CA_KEYSTORE_PATH;\nimport static com.github.tomakehurst.wiremock.common.Limit.UNLIMITED;\nimport static com.github.tomakehurst.wiremock.common.ResourceUtil.getResource;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MAPPINGS_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MESSAGE_MAPPINGS_ROOT;\nimport static com.github.tomakehurst.wiremock.http.CaseInsensitiveKey.TO_CASE_INSENSITIVE_KEYS;\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.emptyList;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSourceFactory;\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.extension.ExtensionDeclarations;\nimport com.github.tomakehurst.wiremock.extension.ExtensionFactory;\nimport com.github.tomakehurst.wiremock.extension.Extensions;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.CaseInsensitiveKey;\nimport com.github.tomakehurst.wiremock.http.HttpServerFactory;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.DoNothingWiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.WiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.security.Authenticator;\nimport com.github.tomakehurst.wiremock.security.BasicAuthenticator;\nimport com.github.tomakehurst.wiremock.security.NoAuthenticator;\nimport com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource;\nimport com.github.tomakehurst.wiremock.standalone.MappingsLoader;\nimport com.github.tomakehurst.wiremock.standalone.MappingsSource;\nimport com.github.tomakehurst.wiremock.store.DefaultStores;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.verification.notmatched.NotMatchedRenderer;\nimport com.github.tomakehurst.wiremock.verification.notmatched.PlainTextStubNotMatchedRenderer;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.function.Function;\nimport java.util.stream.Collectors;\n\npublic class WireMockConfiguration implements Options {\n\n  private long asyncResponseTimeout = DEFAULT_TIMEOUT;\n  private boolean disableOptimizeXmlFactoriesLoading = false;\n  private int portNumber = DEFAULT_PORT;\n  private boolean httpDisabled = false;\n  private boolean http2PlainDisabled = false;\n  private boolean http2TlsDisabled = false;\n  private String bindAddress = DEFAULT_BIND_ADDRESS;\n\n  private int containerThreads = DEFAULT_CONTAINER_THREADS;\n\n  private int httpsPort = -1;\n  private String keyStorePath = getResource(WireMockConfiguration.class, \"keystore\").toString();\n  private String keyStorePassword = \"password\";\n  private String keyManagerPassword = \"password\";\n  private String keyStoreType = \"JKS\";\n  private String trustStorePath;\n  private String trustStorePassword = \"password\";\n  private String trustStoreType = \"JKS\";\n  private boolean needClientAuth;\n\n  private boolean browserProxyingEnabled = false;\n  private String caKeystorePath = DEFAULT_CA_KEYSTORE_PATH;\n  private String caKeystorePassword = DEFAULT_CA_KESTORE_PASSWORD;\n  private String caKeystoreType = \"JKS\";\n  private KeyStoreSettings caKeyStoreSettings = null;\n  private boolean trustAllProxyTargets = false;\n  private final List<String> trustedProxyTargets = new ArrayList<>();\n\n  private ProxySettings proxySettings = ProxySettings.NO_PROXY;\n  private FileSource filesRoot = new SingleRootFileSource(\"src/test/resources\");\n  private Stores stores;\n  private MappingsSource mappingsSource;\n  private FilenameMaker filenameMaker;\n\n  private Notifier notifier = new Slf4jNotifier(false);\n  private boolean requestJournalDisabled = false;\n  private Optional<Integer> maxRequestJournalEntries = Optional.empty();\n  private List<CaseInsensitiveKey> matchingHeaders = emptyList();\n\n  private boolean preserveHostHeader;\n  private boolean preserveUserAgentProxyHeader;\n  private String proxyHostHeader;\n  private HttpServerFactory httpServerFactory = null;\n  private HttpClientFactory httpClientFactory = null;\n\n  private ExtensionDeclarations extensions = new ExtensionDeclarations();\n  private boolean extensionScanningEnabled = false;\n  private WiremockNetworkTrafficListener networkTrafficListener =\n      new DoNothingWiremockNetworkTrafficListener();\n\n  private Authenticator adminAuthenticator = new NoAuthenticator();\n  private boolean requireHttpsForAdminApi = false;\n\n  private Function<Extensions, NotMatchedRenderer> notMatchedRendererFactory =\n      PlainTextStubNotMatchedRenderer::new;\n  private boolean asynchronousResponseEnabled;\n  private int asynchronousResponseThreads;\n  private ChunkedEncodingPolicy chunkedEncodingPolicy;\n  private boolean gzipDisabled = false;\n  private boolean stubLoggingDisabled = false;\n\n  private boolean stubCorsEnabled = false;\n  private boolean disableStrictHttpHeaders;\n\n  private boolean proxyPassThrough = true;\n\n  private Limit responseBodySizeLimit = UNLIMITED;\n\n  private NetworkAddressRules proxyTargetRules = NetworkAddressRules.ALLOW_ALL;\n\n  private int proxyTimeout = DEFAULT_TIMEOUT;\n\n  private int maxHttpClientConnections = DEFAULT_MAX_HTTP_CONNECTIONS;\n  private boolean disableConnectionReuse = DEFAULT_DISABLE_CONNECTION_REUSE;\n\n  private boolean templatingEnabled = true;\n  private boolean globalTemplating = false;\n  private Set<String> permittedSystemKeys = null;\n  private Long maxTemplateCacheEntries = DEFAULT_MAX_TEMPLATE_CACHE_ENTRIES;\n  private boolean templateEscapingDisabled = true;\n\n  private Set<String> supportedProxyEncodings = null;\n\n  private int webhookThreadPoolSize = DEFAULT_WEBHOOK_THREADPOOL_SIZE;\n\n  private long webSocketIdleTimeout = DEFAULT_WEBSOCKET_IDLE_TIMEOUT;\n  private long webSocketMaxTextMessageSize = DEFAULT_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE;\n  private long webSocketMaxBinaryMessageSize = DEFAULT_WEBSOCKET_MAX_BINARY_MESSAGE_SIZE;\n\n  private MappingsSource getMappingsSource() {\n    if (mappingsSource == null) {\n      mappingsSource =\n          new JsonFileMappingsSource(\n              filesRoot.child(MAPPINGS_ROOT),\n              filesRoot.child(MESSAGE_MAPPINGS_ROOT),\n              getFilenameMaker());\n    }\n\n    return mappingsSource;\n  }\n\n  public static WireMockConfiguration wireMockConfig() {\n    return new WireMockConfiguration();\n  }\n\n  public static WireMockConfiguration options() {\n    return wireMockConfig();\n  }\n\n  public WireMockConfiguration proxyPassThrough(boolean proxyPassThrough) {\n    this.proxyPassThrough = proxyPassThrough;\n    GlobalSettings newSettings =\n        getStores().getSettingsStore().get().copy().proxyPassThrough(proxyPassThrough).build();\n    getStores().getSettingsStore().set(newSettings);\n    return this;\n  }\n\n  public WireMockConfiguration timeout(int timeout) {\n    this.asyncResponseTimeout = timeout;\n    return this;\n  }\n\n  public WireMockConfiguration webSocketIdleTimeout(long timeout) {\n    this.webSocketIdleTimeout = timeout;\n    return this;\n  }\n\n  public WireMockConfiguration webSocketMaxTextMessageSize(long size) {\n    this.webSocketMaxTextMessageSize = size;\n    return this;\n  }\n\n  public WireMockConfiguration webSocketMaxBinaryMessageSize(long size) {\n    this.webSocketMaxBinaryMessageSize = size;\n    return this;\n  }\n\n  public WireMockConfiguration port(int portNumber) {\n    this.portNumber = portNumber;\n    return this;\n  }\n\n  public WireMockConfiguration filenameTemplate(String filenameTemplate) {\n    this.filenameMaker = new FilenameMaker(filenameTemplate);\n    return this;\n  }\n\n  public WireMockConfiguration dynamicPort() {\n    this.portNumber = DYNAMIC_PORT;\n    return this;\n  }\n\n  public WireMockConfiguration httpDisabled(boolean httpDisabled) {\n    this.httpDisabled = httpDisabled;\n    return this;\n  }\n\n  public WireMockConfiguration http2PlainDisabled(boolean enabled) {\n    this.http2PlainDisabled = enabled;\n    return this;\n  }\n\n  public WireMockConfiguration http2TlsDisabled(boolean enabled) {\n    this.http2TlsDisabled = enabled;\n    return this;\n  }\n\n  public WireMockConfiguration httpsPort(Integer httpsPort) {\n    this.httpsPort = httpsPort;\n    return this;\n  }\n\n  public WireMockConfiguration dynamicHttpsPort() {\n    this.httpsPort = DYNAMIC_PORT;\n    return this;\n  }\n\n  public WireMockConfiguration containerThreads(Integer containerThreads) {\n    this.containerThreads = containerThreads;\n    return this;\n  }\n\n  public WireMockConfiguration keystorePath(String path) {\n    this.keyStorePath = path;\n    return this;\n  }\n\n  public WireMockConfiguration keystorePassword(String keyStorePassword) {\n    this.keyStorePassword = keyStorePassword;\n    return this;\n  }\n\n  public WireMockConfiguration keyManagerPassword(String keyManagerPassword) {\n    this.keyManagerPassword = keyManagerPassword;\n    return this;\n  }\n\n  public WireMockConfiguration keystoreType(String keyStoreType) {\n    this.keyStoreType = keyStoreType;\n    return this;\n  }\n\n  public WireMockConfiguration caKeystoreSettings(KeyStoreSettings caKeyStoreSettings) {\n    this.caKeyStoreSettings = caKeyStoreSettings;\n    return this;\n  }\n\n  public WireMockConfiguration caKeystorePath(String path) {\n    this.caKeystorePath = path;\n    return this;\n  }\n\n  public WireMockConfiguration caKeystorePassword(String keyStorePassword) {\n    this.caKeystorePassword = keyStorePassword;\n    return this;\n  }\n\n  public WireMockConfiguration caKeystoreType(String caKeystoreType) {\n    this.caKeystoreType = caKeystoreType;\n    return this;\n  }\n\n  public WireMockConfiguration trustStorePath(String truststorePath) {\n    this.trustStorePath = truststorePath;\n    return this;\n  }\n\n  public WireMockConfiguration trustStorePassword(String trustStorePassword) {\n    this.trustStorePassword = trustStorePassword;\n    return this;\n  }\n\n  public WireMockConfiguration trustStoreType(String trustStoreType) {\n    this.trustStoreType = trustStoreType;\n    return this;\n  }\n\n  public WireMockConfiguration needClientAuth(boolean needClientAuth) {\n    this.needClientAuth = needClientAuth;\n    return this;\n  }\n\n  public WireMockConfiguration enableBrowserProxying(boolean enabled) {\n    this.browserProxyingEnabled = enabled;\n    return this;\n  }\n\n  public WireMockConfiguration proxyVia(String host, int port) {\n    this.proxySettings = new ProxySettings(host, port);\n    return this;\n  }\n\n  public WireMockConfiguration proxyVia(ProxySettings proxySettings) {\n    this.proxySettings = proxySettings;\n    return this;\n  }\n\n  public WireMockConfiguration withStores(Stores stores) {\n    this.stores = stores;\n    return this;\n  }\n\n  public WireMockConfiguration withRootDirectory(String path) {\n    this.filesRoot = new SingleRootFileSource(path);\n    return this;\n  }\n\n  public WireMockConfiguration usingFilesUnderDirectory(String path) {\n    return withRootDirectory(path);\n  }\n\n  public WireMockConfiguration usingFilesUnderClasspath(String path) {\n    fileSource(new ClasspathFileSource(path));\n    return this;\n  }\n\n  public WireMockConfiguration fileSource(FileSource fileSource) {\n    this.filesRoot = fileSource;\n    return this;\n  }\n\n  public WireMockConfiguration mappingSource(MappingsSource mappingsSource) {\n    this.mappingsSource = mappingsSource;\n    return this;\n  }\n\n  public WireMockConfiguration notifier(Notifier notifier) {\n    this.notifier = notifier;\n    return this;\n  }\n\n  public WireMockConfiguration bindAddress(String bindAddress) {\n    this.bindAddress = bindAddress;\n    return this;\n  }\n\n  public WireMockConfiguration disableRequestJournal() {\n    requestJournalDisabled = true;\n    return this;\n  }\n\n  @Deprecated\n  /**\n   * @deprecated use {@link #maxRequestJournalEntries(int)} instead\n   */\n  public WireMockConfiguration maxRequestJournalEntries(\n      Optional<Integer> maxRequestJournalEntries) {\n    this.maxRequestJournalEntries = maxRequestJournalEntries;\n    return this;\n  }\n\n  public WireMockConfiguration maxRequestJournalEntries(int maxRequestJournalEntries) {\n    this.maxRequestJournalEntries = Optional.of(maxRequestJournalEntries);\n    return this;\n  }\n\n  public WireMockConfiguration recordRequestHeadersForMatching(List<String> headers) {\n    this.matchingHeaders =\n        headers.stream().map(TO_CASE_INSENSITIVE_KEYS).collect(Collectors.toUnmodifiableList());\n    return this;\n  }\n\n  public WireMockConfiguration preserveHostHeader(boolean preserveHostHeader) {\n    this.preserveHostHeader = preserveHostHeader;\n    return this;\n  }\n\n  public WireMockConfiguration preserveUserAgentProxyHeader(boolean preserveUserAgentProxyHeader) {\n    this.preserveUserAgentProxyHeader = preserveUserAgentProxyHeader;\n    return this;\n  }\n\n  public WireMockConfiguration proxyHostHeader(String hostHeaderValue) {\n    this.proxyHostHeader = hostHeaderValue;\n    return this;\n  }\n\n  public WireMockConfiguration extensions(String... classNames) {\n    extensions.add(classNames);\n    return this;\n  }\n\n  public WireMockConfiguration extensions(Extension... extensionInstances) {\n    extensions.add(extensionInstances);\n    return this;\n  }\n\n  public WireMockConfiguration extensionFactories(ExtensionFactory... extensionFactories) {\n    return extensions(extensionFactories);\n  }\n\n  public WireMockConfiguration extensions(ExtensionFactory... extensionFactories) {\n    extensions.add(extensionFactories);\n    return this;\n  }\n\n  public WireMockConfiguration extensions(Class<? extends Extension>... classes) {\n    extensions.add(classes);\n    return this;\n  }\n\n  public WireMockConfiguration extensionFactories(\n      Class<? extends ExtensionFactory>... factoryClasses) {\n    extensions.addFactories(factoryClasses);\n    return this;\n  }\n\n  public WireMockConfiguration extensionScanningEnabled(boolean enabled) {\n    this.extensionScanningEnabled = enabled;\n    return this;\n  }\n\n  public WireMockConfiguration httpServerFactory(HttpServerFactory serverFactory) {\n    this.httpServerFactory = serverFactory;\n    return this;\n  }\n\n  public WireMockConfiguration httpClientFactory(HttpClientFactory httpClientFactory) {\n    this.httpClientFactory = httpClientFactory;\n    return this;\n  }\n\n  public WireMockConfiguration networkTrafficListener(\n      WiremockNetworkTrafficListener networkTrafficListener) {\n    this.networkTrafficListener = networkTrafficListener;\n    return this;\n  }\n\n  public WireMockConfiguration adminAuthenticator(Authenticator authenticator) {\n    this.adminAuthenticator = authenticator;\n    return this;\n  }\n\n  public WireMockConfiguration basicAdminAuthenticator(String username, String password) {\n    return adminAuthenticator(new BasicAuthenticator(username, password));\n  }\n\n  public WireMockConfiguration requireHttpsForAdminApi() {\n    this.requireHttpsForAdminApi = true;\n    return this;\n  }\n\n  public WireMockConfiguration notMatchedRendererFactory(\n      Function<Extensions, NotMatchedRenderer> notMatchedRendererFactory) {\n    this.notMatchedRendererFactory = notMatchedRendererFactory;\n    return this;\n  }\n\n  public WireMockConfiguration asynchronousResponseEnabled(boolean asynchronousResponseEnabled) {\n    this.asynchronousResponseEnabled = asynchronousResponseEnabled;\n    return this;\n  }\n\n  public WireMockConfiguration asynchronousResponseThreads(int asynchronousResponseThreads) {\n    this.asynchronousResponseThreads = asynchronousResponseThreads;\n    return this;\n  }\n\n  public WireMockConfiguration useChunkedTransferEncoding(ChunkedEncodingPolicy policy) {\n    this.chunkedEncodingPolicy = policy;\n    return this;\n  }\n\n  public WireMockConfiguration gzipDisabled(boolean gzipDisabled) {\n    this.gzipDisabled = gzipDisabled;\n    return this;\n  }\n\n  public WireMockConfiguration stubRequestLoggingDisabled(boolean disabled) {\n    this.stubLoggingDisabled = disabled;\n    return this;\n  }\n\n  public WireMockConfiguration stubCorsEnabled(boolean enabled) {\n    this.stubCorsEnabled = enabled;\n    return this;\n  }\n\n  public WireMockConfiguration trustAllProxyTargets(boolean enabled) {\n    this.trustAllProxyTargets = enabled;\n    return this;\n  }\n\n  public WireMockConfiguration trustedProxyTargets(String... trustedProxyTargets) {\n    return trustedProxyTargets(asList(trustedProxyTargets));\n  }\n\n  public WireMockConfiguration trustedProxyTargets(List<String> trustedProxyTargets) {\n    this.trustedProxyTargets.addAll(trustedProxyTargets);\n    return this;\n  }\n\n  public WireMockConfiguration disableOptimizeXmlFactoriesLoading(\n      boolean disableOptimizeXmlFactoriesLoading) {\n    this.disableOptimizeXmlFactoriesLoading = disableOptimizeXmlFactoriesLoading;\n    return this;\n  }\n\n  public WireMockConfiguration maxLoggedResponseSize(int maxSize) {\n    this.responseBodySizeLimit = new Limit(maxSize);\n    return this;\n  }\n\n  public WireMockConfiguration limitProxyTargets(NetworkAddressRules proxyTargetRules) {\n    this.proxyTargetRules = proxyTargetRules;\n    return this;\n  }\n\n  public WireMockConfiguration proxyTimeout(int proxyTimeout) {\n    this.proxyTimeout = proxyTimeout;\n    return this;\n  }\n\n  public WireMockConfiguration maxHttpClientConnections(int maxHttpClientConnections) {\n    this.maxHttpClientConnections = maxHttpClientConnections;\n    return this;\n  }\n\n  public WireMockConfiguration disableConnectionReuse(boolean disableConnectionReuse) {\n    this.disableConnectionReuse = disableConnectionReuse;\n    return this;\n  }\n\n  public WireMockConfiguration templatingEnabled(boolean templatingEnabled) {\n    this.templatingEnabled = templatingEnabled;\n    return this;\n  }\n\n  public WireMockConfiguration globalTemplating(boolean globalTemplating) {\n    this.globalTemplating = globalTemplating;\n    return this;\n  }\n\n  public WireMockConfiguration withPermittedSystemKeys(String... systemKeys) {\n    this.permittedSystemKeys = Set.of(systemKeys);\n    return this;\n  }\n\n  public WireMockConfiguration withTemplateEscapingDisabled(boolean templateEscapingDisabled) {\n    this.templateEscapingDisabled = templateEscapingDisabled;\n    return this;\n  }\n\n  public WireMockConfiguration withMaxTemplateCacheEntries(Long maxTemplateCacheEntries) {\n    this.maxTemplateCacheEntries = maxTemplateCacheEntries;\n    return this;\n  }\n\n  public WireMockConfiguration withSupportedProxyEncodings(Set<String> supportedProxyEncodings) {\n    this.supportedProxyEncodings = supportedProxyEncodings;\n    return this;\n  }\n\n  public WireMockConfiguration withSupportedProxyEncodings(String... supportedProxyEncodings) {\n    return withSupportedProxyEncodings(Set.of(supportedProxyEncodings));\n  }\n\n  public WireMockConfiguration withWebhookThreadPoolSize(Integer webhookThreadPoolSize) {\n    this.webhookThreadPoolSize = webhookThreadPoolSize;\n    return this;\n  }\n\n  @Override\n  public int portNumber() {\n    return portNumber;\n  }\n\n  @Override\n  public boolean getHttpDisabled() {\n    return httpDisabled;\n  }\n\n  @Override\n  public boolean getHttp2PlainDisabled() {\n    return http2PlainDisabled;\n  }\n\n  @Override\n  public boolean getHttp2TlsDisabled() {\n    return http2TlsDisabled;\n  }\n\n  @Override\n  public int containerThreads() {\n    return containerThreads;\n  }\n\n  @Override\n  public HttpsSettings httpsSettings() {\n    return new HttpsSettings.Builder()\n        .port(httpsPort)\n        .keyStorePath(keyStorePath)\n        .keyStorePassword(keyStorePassword)\n        .keyManagerPassword(keyManagerPassword)\n        .keyStoreType(keyStoreType)\n        .trustStorePath(trustStorePath)\n        .trustStorePassword(trustStorePassword)\n        .trustStoreType(trustStoreType)\n        .needClientAuth(needClientAuth)\n        .build();\n  }\n\n  @Override\n  public boolean browserProxyingEnabled() {\n    return browserProxyingEnabled;\n  }\n\n  @Override\n  public ProxySettings proxyVia() {\n    return proxySettings;\n  }\n\n  @Override\n  public Stores getStores() {\n    if (stores == null) {\n      stores = new DefaultStores(filesRoot);\n    }\n\n    return stores;\n  }\n\n  @Override\n  public FileSource filesRoot() {\n    return filesRoot;\n  }\n\n  @Override\n  public MappingsLoader mappingsLoader() {\n    return getMappingsSource();\n  }\n\n  @Override\n  public MappingsSaver mappingsSaver() {\n    return getMappingsSource();\n  }\n\n  @Override\n  public Notifier notifier() {\n    return notifier;\n  }\n\n  @Override\n  public boolean requestJournalDisabled() {\n    return requestJournalDisabled;\n  }\n\n  @Override\n  public Optional<Integer> maxRequestJournalEntries() {\n    return maxRequestJournalEntries;\n  }\n\n  @Override\n  public String bindAddress() {\n    return bindAddress;\n  }\n\n  @Override\n  public FilenameMaker getFilenameMaker() {\n    return filenameMaker;\n  }\n\n  @Override\n  public List<CaseInsensitiveKey> matchingHeaders() {\n    return matchingHeaders;\n  }\n\n  @Override\n  public HttpServerFactory httpServerFactory() {\n    return httpServerFactory;\n  }\n\n  @Override\n  public HttpClientFactory httpClientFactory() {\n    return httpClientFactory;\n  }\n\n  @Override\n  public boolean shouldPreserveHostHeader() {\n    return preserveHostHeader;\n  }\n\n  @Override\n  public boolean shouldPreserveUserAgentProxyHeader() {\n    return preserveUserAgentProxyHeader;\n  }\n\n  @Override\n  public String proxyHostHeader() {\n    return proxyHostHeader;\n  }\n\n  @Override\n  public ExtensionDeclarations getDeclaredExtensions() {\n    return extensions;\n  }\n\n  @Override\n  public boolean isExtensionScanningEnabled() {\n    return extensionScanningEnabled;\n  }\n\n  @Override\n  public WiremockNetworkTrafficListener networkTrafficListener() {\n    return networkTrafficListener;\n  }\n\n  @Override\n  public Authenticator getAdminAuthenticator() {\n    return adminAuthenticator;\n  }\n\n  @Override\n  public boolean getHttpsRequiredForAdminApi() {\n    return requireHttpsForAdminApi;\n  }\n\n  @Override\n  public Function<Extensions, NotMatchedRenderer> getNotMatchedRendererFactory() {\n    return notMatchedRendererFactory;\n  }\n\n  @Override\n  public AsynchronousResponseSettings getAsynchronousResponseSettings() {\n    return new AsynchronousResponseSettings(\n        asynchronousResponseEnabled, asynchronousResponseThreads);\n  }\n\n  @Override\n  public ChunkedEncodingPolicy getChunkedEncodingPolicy() {\n    return chunkedEncodingPolicy;\n  }\n\n  @Override\n  public boolean getGzipDisabled() {\n    return gzipDisabled;\n  }\n\n  @Override\n  public boolean getStubRequestLoggingDisabled() {\n    return stubLoggingDisabled;\n  }\n\n  @Override\n  public boolean getStubCorsEnabled() {\n    return stubCorsEnabled;\n  }\n\n  @Override\n  public long timeout() {\n    return asyncResponseTimeout;\n  }\n\n  @Override\n  public boolean getDisableOptimizeXmlFactoriesLoading() {\n    return disableOptimizeXmlFactoriesLoading;\n  }\n\n  @Override\n  public boolean getDisableStrictHttpHeaders() {\n    return disableStrictHttpHeaders;\n  }\n\n  @Override\n  public DataTruncationSettings getDataTruncationSettings() {\n    return new DataTruncationSettings(responseBodySizeLimit);\n  }\n\n  public WireMockConfiguration disableStrictHttpHeaders(boolean disableStrictHttpHeaders) {\n    this.disableStrictHttpHeaders = disableStrictHttpHeaders;\n    return this;\n  }\n\n  @Override\n  public BrowserProxySettings browserProxySettings() {\n    KeyStoreSettings keyStoreSettings =\n        caKeyStoreSettings != null\n            ? caKeyStoreSettings\n            : new KeyStoreSettings(\n                KeyStoreSourceFactory.getAppropriateForJreVersion(\n                    caKeystorePath, caKeystoreType, caKeystorePassword.toCharArray()));\n\n    return new BrowserProxySettings.Builder()\n        .enabled(browserProxyingEnabled)\n        .trustAllProxyTargets(trustAllProxyTargets)\n        .trustedProxyTargets(trustedProxyTargets)\n        .caKeyStoreSettings(keyStoreSettings)\n        .build();\n  }\n\n  @Override\n  public NetworkAddressRules getProxyTargetRules() {\n    return proxyTargetRules;\n  }\n\n  @Override\n  public int proxyTimeout() {\n    return proxyTimeout;\n  }\n\n  @Override\n  public int getMaxHttpClientConnections() {\n    return maxHttpClientConnections;\n  }\n\n  @Override\n  public boolean getDisableConnectionReuse() {\n    return disableConnectionReuse;\n  }\n\n  @Override\n  public boolean getResponseTemplatingEnabled() {\n    return templatingEnabled;\n  }\n\n  @Override\n  public boolean getResponseTemplatingGlobal() {\n    return globalTemplating;\n  }\n\n  @Override\n  public Long getMaxTemplateCacheEntries() {\n    return maxTemplateCacheEntries;\n  }\n\n  @Override\n  public Set<String> getTemplatePermittedSystemKeys() {\n    return permittedSystemKeys;\n  }\n\n  @Override\n  public boolean getTemplateEscapingDisabled() {\n    return templateEscapingDisabled;\n  }\n\n  @Override\n  public Set<String> getSupportedProxyEncodings() {\n    return supportedProxyEncodings;\n  }\n\n  @Override\n  public int getWebhookThreadPoolSize() {\n    return webhookThreadPoolSize;\n  }\n\n  @Override\n  public long getWebSocketIdleTimeout() {\n    return webSocketIdleTimeout;\n  }\n\n  @Override\n  public long getWebSocketMaxTextMessageSize() {\n    return webSocketMaxTextMessageSize;\n  }\n\n  @Override\n  public long getWebSocketMaxBinaryMessageSize() {\n    return webSocketMaxBinaryMessageSize;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/direct/DirectCallHttpServer.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.direct;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.util.concurrent.CompletableFuture;\nimport java.util.concurrent.ExecutionException;\nimport java.util.concurrent.TimeUnit;\nimport java.util.concurrent.TimeoutException;\n\n/**\n * An implementation of the {@link HttpServer} that doesn't actually run an HTTP server.\n *\n * <p>This is to allow the use of Wiremock through direct method calls, which is then suitable for\n * i.e. running in Serverless applications.\n */\npublic class DirectCallHttpServer implements HttpServer {\n  private final AdminRequestHandler adminRequestHandler;\n  private final StubRequestHandler stubRequestHandler;\n  private final long timeout;\n  private final SleepFacade sleepFacade;\n\n  /**\n   * Construct the Direct Call HTTP Server.\n   *\n   * @param options the {@link Options} used to configure this server\n   * @param adminRequestHandler the {@link AdminRequestHandler}\n   * @param stubRequestHandler the {@link StubRequestHandler}\n   */\n  public DirectCallHttpServer(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler) {\n    this.sleepFacade = new SleepFacade();\n    this.timeout = getTimeout(options);\n    this.adminRequestHandler = adminRequestHandler;\n    this.stubRequestHandler = stubRequestHandler;\n  }\n\n  DirectCallHttpServer(\n      SleepFacade sleepFacade,\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler) {\n    this.sleepFacade = sleepFacade;\n    this.timeout = getTimeout(options);\n    this.adminRequestHandler = adminRequestHandler;\n    this.stubRequestHandler = stubRequestHandler;\n  }\n\n  /**\n   * Retrieve the admin response that is mapped for a given request to the server.\n   *\n   * @param request the incoming admin {@link Request}\n   * @return the admin {@link Response}\n   */\n  public Response adminRequest(Request request) {\n    return handleRequest(request, adminRequestHandler);\n  }\n\n  /**\n   * Retrieve the stub response that is mapped for a given request to the server.\n   *\n   * @param request the incoming stub {@link Request}\n   * @return the stub {@link Response} that best matches the mappings\n   */\n  public Response stubRequest(Request request) {\n    return handleRequest(request, stubRequestHandler);\n  }\n\n  @Override\n  public void start() {\n    // no implementation, as this is a stub\n  }\n\n  @Override\n  public void stop() {\n    // no implementation, as this is a stub\n  }\n\n  @Override\n  public boolean isRunning() {\n    return true;\n  }\n\n  @Override\n  public int port() {\n    return -1;\n  }\n\n  @Override\n  public int httpsPort() {\n    return -2;\n  }\n\n  private Response handleRequest(Request request, AbstractRequestHandler handler) {\n    CompletableFuture<Response> responseFuture = new CompletableFuture<>();\n    handler.handle(\n        request, (ignored, response, attributes) -> responseFuture.complete(response), null);\n\n    try {\n      Response response = responseFuture.get(timeout, TimeUnit.MILLISECONDS);\n      if (response.getInitialDelay() != 0) {\n        sleepFacade.sleep(response.getInitialDelay());\n      }\n      return response;\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new IllegalStateException(\"Could not retrieve response from the Stub Handler\", e);\n    } catch (ExecutionException e) {\n      throw new IllegalStateException(\"Could not retrieve response from the Stub Handler\", e);\n    } catch (TimeoutException e) {\n      throw new IllegalStateException(\n          String.format(\"The request was not handled within the timeout of %dms\", timeout), e);\n    }\n  }\n\n  private static long getTimeout(Options options) {\n    return options.timeout();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/direct/DirectCallHttpServerFactory.java",
    "content": "/*\n * Copyright (C) 2021-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.direct;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.http.AdminRequestHandler;\nimport com.github.tomakehurst.wiremock.http.HttpServer;\nimport com.github.tomakehurst.wiremock.http.HttpServerFactory;\nimport com.github.tomakehurst.wiremock.http.StubRequestHandler;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\n\npublic class DirectCallHttpServerFactory implements HttpServerFactory {\n  private DirectCallHttpServer lastBuilt;\n\n  @Override\n  public HttpServer buildHttpServer(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler,\n      MessageStubRequestHandler messageStubRequestHandler) {\n    lastBuilt = new DirectCallHttpServer(options, adminRequestHandler, stubRequestHandler);\n    return lastBuilt;\n  }\n\n  /**\n   * Returns the most recently created {@link DirectCallHttpServer}.\n   *\n   * @return the {@link DirectCallHttpServer}\n   */\n  public DirectCallHttpServer getHttpServer() {\n    return lastBuilt;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/direct/SleepFacade.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.direct;\n\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\n\nimport java.util.concurrent.*;\n\nclass SleepFacade {\n\n  private final ScheduledExecutorService executorService;\n\n  public SleepFacade() {\n    this.executorService = Executors.newSingleThreadScheduledExecutor();\n  }\n\n  void sleep(long millis) {\n    try {\n      executorService.schedule(() -> {}, millis, MILLISECONDS).get();\n    } catch (Exception e) {\n      Thread.currentThread().interrupt();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/AbstractTransformer.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.http.Request;\n\npublic abstract class AbstractTransformer<T> implements Extension {\n\n  public abstract T transform(Request request, T response, FileSource files, Parameters parameters);\n\n  public boolean applyGlobally() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/AdminApiExtension.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.admin.Router;\n\npublic interface AdminApiExtension extends Extension {\n\n  /**\n   * To be overridden if the extension needs to expose new API resources under /__admin\n   *\n   * @param router the admin route builder\n   */\n  void contributeAdminApiRoutes(Router router);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/Extension.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\npublic interface Extension {\n\n  String getName();\n\n  default void start() {}\n\n  default void stop() {}\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ExtensionDeclarations.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport static java.util.Arrays.asList;\n\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport org.wiremock.webhooks.Webhooks;\n\npublic class ExtensionDeclarations {\n\n  private final List<String> classNames;\n  private final List<Class<? extends Extension>> classes;\n  private final Map<String, Extension> instances;\n  private final List<Class<? extends ExtensionFactory>> factoryClasses;\n  private final List<ExtensionFactory> factories;\n  private static final String WEBHOOK_MESSAGE =\n      \"Passing webhooks in extensions is no longer required and\"\n          + \" may lead to compatibility issues in future\";\n\n  public ExtensionDeclarations() {\n    this.classNames = new ArrayList<>();\n    this.classes = new ArrayList<>();\n    this.instances = new LinkedHashMap<>();\n    this.factoryClasses = new ArrayList<>();\n    this.factories = new ArrayList<>();\n  }\n\n  public void add(String... classNames) {\n    List<String> processedClassNames =\n        Arrays.stream(classNames).filter(this::removeWebhook).collect(Collectors.toList());\n    this.classNames.addAll(processedClassNames);\n  }\n\n  public void add(Extension... extensionInstances) {\n    Arrays.stream(extensionInstances).forEach(e -> instances.put(e.getName(), e));\n  }\n\n  public void add(Class<? extends Extension>... classes) {\n    List<Class<? extends Extension>> processedClasses =\n        Arrays.stream(classes).filter(c -> removeWebhook(c.getName())).collect(Collectors.toList());\n    this.classes.addAll(processedClasses);\n  }\n\n  public void add(ExtensionFactory... factories) {\n    this.factories.addAll(asList(factories));\n  }\n\n  public void addFactories(Class<? extends ExtensionFactory>... factoryClasses) {\n    this.factoryClasses.addAll(asList(factoryClasses));\n  }\n\n  public List<String> getClassNames() {\n    return classNames;\n  }\n\n  public List<Class<? extends Extension>> getClasses() {\n    return classes;\n  }\n\n  public Map<String, Extension> getInstances() {\n    return instances;\n  }\n\n  public List<ExtensionFactory> getFactories() {\n    return factories;\n  }\n\n  public List<Class<? extends ExtensionFactory>> getFactoryClasses() {\n    return factoryClasses;\n  }\n\n  private boolean removeWebhook(String className) {\n    if (className.equals(Webhooks.class.getName())) {\n      System.out.println(WEBHOOK_MESSAGE);\n      return false;\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ExtensionFactory.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport java.util.List;\n\npublic interface ExtensionFactory {\n\n  /**\n   * Allows the factory to check the runtime environment and prevent itself being used if not\n   * compatible e.g. because the wrong Jetty version is present.\n   *\n   * @return true if the factory can be loaded.\n   */\n  default boolean isLoadable() {\n    return true;\n  }\n\n  List<Extension> create(WireMockServices services);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ExtensionLoader.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\nimport java.util.stream.Collectors;\n\npublic class ExtensionLoader {\n\n  private ExtensionLoader() {}\n\n  @SuppressWarnings(\"unchecked\")\n  public static <T> Map<String, T> loadExtension(String... classNames) {\n    return (Map<String, T>)\n        asMap(\n            Arrays.stream(classNames)\n                .map(toClasses())\n                .map(toExtensions())\n                .collect(Collectors.toList()));\n  }\n\n  public static Map<String, Extension> load(String... classNames) {\n    return loadExtension(classNames);\n  }\n\n  public static Map<String, Extension> asMap(List<Extension> extensions) {\n    return extensions.stream()\n        .map(extension -> Map.entry(extension.getName(), extension))\n        .collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue));\n  }\n\n  @SafeVarargs\n  public static Map<String, Extension> load(Class<? extends Extension>... classes) {\n    return asMap(Arrays.stream(classes).map(toExtensions()).collect(Collectors.toList()));\n  }\n\n  private static Function<Class<? extends Extension>, Extension> toExtensions() {\n    return extensionClass -> {\n      try {\n        return extensionClass.getDeclaredConstructor().newInstance();\n      } catch (Exception e) {\n        return throwUnchecked(e, Extension.class);\n      }\n    };\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private static Function<String, Class<? extends Extension>> toClasses() {\n    return className -> {\n      try {\n        return (Class<? extends Extension>) Class.forName(className);\n      } catch (ClassNotFoundException e) {\n        return throwUnchecked(e, Class.class);\n      }\n    };\n  }\n\n  public static <T extends Extension> Predicate<Map.Entry<String, Extension>> valueAssignableFrom(\n      final Class<T> extensionType) {\n    return input -> extensionType.isAssignableFrom(input.getValue().getClass());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/Extensions.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.extension.ExtensionLoader.valueAssignableFrom;\nimport static java.util.stream.Collectors.toMap;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.LazyTemplateEngine;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.MessageTemplateTransformer;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.TemplateEngine;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.http.client.LazyHttpClient;\nimport com.github.tomakehurst.wiremock.http.client.LazyHttpClientFactory;\nimport com.github.tomakehurst.wiremock.proxy.ProxiedHostnameRewriteResponseTransformer;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport java.util.*;\nimport java.util.concurrent.Executors;\nimport java.util.function.Function;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.wiremock.webhooks.WebhookTransformer;\nimport org.wiremock.webhooks.Webhooks;\n\npublic class Extensions implements WireMockServices {\n\n  public static final Extensions NONE =\n      new Extensions(new ExtensionDeclarations(), null, null, null, null);\n\n  private final ExtensionDeclarations extensionDeclarations;\n  private final Admin admin;\n\n  private final Options options;\n  private final Stores stores;\n  private final FileSource files;\n\n  private TemplateEngine templateEngine;\n\n  private HttpClientFactory httpClientFactory;\n\n  private final Map<String, Extension> loadedExtensions;\n\n  public Extensions(\n      ExtensionDeclarations extensionDeclarations,\n      Admin admin,\n      Options options,\n      Stores stores,\n      FileSource files) {\n    this.extensionDeclarations = extensionDeclarations;\n    this.admin = admin;\n    this.options = options;\n    this.stores = stores;\n    this.files = files;\n\n    loadedExtensions = new LinkedHashMap<>();\n  }\n\n  public void load() {\n    Stream.concat(\n            extensionDeclarations.getClassNames().stream().map(Extensions::loadClass),\n            extensionDeclarations.getClasses().stream())\n        .map(Extensions::load)\n        .forEach(\n            extension -> {\n              if (loadedExtensions.containsKey(extension.getName())) {\n                throw new IllegalArgumentException(\n                    \"Duplicate extension name: \" + extension.getName());\n              }\n              loadedExtensions.put(extension.getName(), extension);\n            });\n\n    loadedExtensions.putAll(extensionDeclarations.getInstances());\n\n    if (options.isExtensionScanningEnabled()) {\n      loadedExtensions.putAll(\n          loadExtensionsAsServices()\n              .collect(\n                  toMap(\n                      Extension::getName,\n                      Function.identity(),\n                      (e1, e2) -> {\n                        throw new IllegalStateException(\n                            \"Duplicate extension name: \" + e1.getName());\n                      },\n                      LinkedHashMap::new)));\n    }\n\n    final Stream<ExtensionFactory> declaredFactories =\n        Stream.concat(\n            extensionDeclarations.getFactories().stream(),\n            extensionDeclarations.getFactoryClasses().stream()\n                .map(Extensions::instantiateExtensionFactory));\n    final Stream<ExtensionFactory> allFactories =\n        options.isExtensionScanningEnabled()\n            ? Stream.concat(declaredFactories, loadExtensionFactoriesAsServices())\n            : declaredFactories;\n\n    loadedExtensions.putAll(\n        allFactories\n            .map(factory -> factory.create(Extensions.this))\n            .flatMap(List::stream)\n            .collect(\n                toMap(\n                    Extension::getName,\n                    Function.identity(),\n                    (e1, e2) -> {\n                      throw new IllegalStateException(\"Duplicate extension name: \" + e1.getName());\n                    },\n                    LinkedHashMap::new)));\n\n    configureTemplating();\n    configureHttpClient();\n    configureWebhooks();\n    configureProxiedHostnameRewrite();\n  }\n\n  private Stream<Extension> loadExtensionsAsServices() {\n    final ServiceLoader<Extension> loader = ServiceLoader.load(Extension.class);\n    return loader.stream().map(ServiceLoader.Provider::get);\n  }\n\n  private Stream<ExtensionFactory> loadExtensionFactoriesAsServices() {\n    final ServiceLoader<ExtensionFactory> loader = ServiceLoader.load(ExtensionFactory.class);\n    return loader.stream().map(ServiceLoader.Provider::get).filter(ExtensionFactory::isLoadable);\n  }\n\n  private void configureTemplating() {\n    final Map<String, Helper<?>> helpers =\n        ofType(TemplateHelperProviderExtension.class).values().stream()\n            .map(TemplateHelperProviderExtension::provideTemplateHelpers)\n            .map(Map::entrySet)\n            .flatMap(Set::stream)\n            .collect(\n                toMap(\n                    Map.Entry::getKey,\n                    Map.Entry::getValue,\n                    (k1, k2) -> {\n                      throw new IllegalStateException(\"Duplicate key\");\n                    },\n                    LinkedHashMap::new));\n\n    final List<TemplateModelDataProviderExtension> templateModelProviders =\n        new ArrayList<>(ofType(TemplateModelDataProviderExtension.class).values());\n\n    templateEngine =\n        new TemplateEngine(\n            helpers,\n            options.getMaxTemplateCacheEntries(),\n            options.getTemplatePermittedSystemKeys(),\n            options.getTemplateEscapingDisabled(),\n            templateModelProviders);\n\n    if (options.getResponseTemplatingEnabled()) {\n      final ResponseTemplateTransformer responseTemplateTransformer =\n          new ResponseTemplateTransformer(\n              getTemplateEngine(),\n              options.getResponseTemplatingGlobal(),\n              getFiles(),\n              templateModelProviders);\n      loadedExtensions.put(responseTemplateTransformer.getName(), responseTemplateTransformer);\n\n      final MessageTemplateTransformer messageTemplateTransformer =\n          new MessageTemplateTransformer(getTemplateEngine());\n      loadedExtensions.put(messageTemplateTransformer.getName(), messageTemplateTransformer);\n    }\n  }\n\n  private void configureHttpClient() {\n    httpClientFactory =\n        new StaticExtensionLoader<>(HttpClientFactory.class)\n            .setSpecificInstance(options.httpClientFactory())\n            .setExtensions(this)\n            .load();\n  }\n\n  private void configureWebhooks() {\n    final List<WebhookTransformer> webhookTransformers =\n        ofType(WebhookTransformer.class).values().stream().toList();\n\n    final Webhooks webhooks =\n        new Webhooks(\n            this,\n            Executors.newScheduledThreadPool(options.getWebhookThreadPoolSize()),\n            webhookTransformers);\n    loadedExtensions.put(webhooks.getName(), webhooks);\n  }\n\n  private void configureProxiedHostnameRewrite() {\n    final ProxiedHostnameRewriteResponseTransformer proxiedHostnameRewriteTransformer =\n        new ProxiedHostnameRewriteResponseTransformer();\n    loadedExtensions.put(\n        proxiedHostnameRewriteTransformer.getName(), proxiedHostnameRewriteTransformer);\n  }\n\n  @Override\n  public Admin getAdmin() {\n    return admin;\n  }\n\n  @Override\n  public Stores getStores() {\n    return stores;\n  }\n\n  @Override\n  public FileSource getFiles() {\n    return files;\n  }\n\n  @Override\n  public Options getOptions() {\n    return options;\n  }\n\n  @Override\n  public Extensions getExtensions() {\n    return this;\n  }\n\n  @Override\n  public TemplateEngine getTemplateEngine() {\n    return new LazyTemplateEngine(() -> templateEngine);\n  }\n\n  @Override\n  public HttpClientFactory getHttpClientFactory() {\n    return new LazyHttpClientFactory(() -> httpClientFactory);\n  }\n\n  @Override\n  public HttpClient getDefaultHttpClient() {\n    return new LazyHttpClient(\n        () -> httpClientFactory.buildHttpClient(options, true, Collections.emptyList(), true));\n  }\n\n  public int getCount() {\n    return loadedExtensions.size();\n  }\n\n  public Set<String> getAllExtensionNames() {\n    return loadedExtensions.keySet();\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private static Class<? extends Extension> loadClass(String className) {\n    try {\n      return (Class<? extends Extension>) Class.forName(className);\n    } catch (ClassNotFoundException e) {\n      return throwUnchecked(e, Class.class);\n    }\n  }\n\n  public static Extension load(Class<? extends Extension> extensionClass) {\n    try {\n      return extensionClass.getDeclaredConstructor().newInstance();\n    } catch (Exception e) {\n      return throwUnchecked(e, Extension.class);\n    }\n  }\n\n  public void startAll() {\n    loadedExtensions.values().forEach(Extension::start);\n  }\n\n  public void stopAll() {\n    loadedExtensions.values().forEach(Extension::stop);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T extends Extension> Map<String, T> ofType(Class<T> extensionType) {\n    return (Map<String, T>)\n        Collections.unmodifiableMap(\n            loadedExtensions.entrySet().stream()\n                .filter(valueAssignableFrom(extensionType))\n                .collect(\n                    Collectors.toMap(\n                        Map.Entry::getKey,\n                        Map.Entry::getValue,\n                        (entry1, entry2) -> entry1,\n                        LinkedHashMap::new)));\n  }\n\n  private static ExtensionFactory instantiateExtensionFactory(\n      Class<? extends ExtensionFactory> factoryClass) {\n    return Exceptions.uncheck(\n        () -> factoryClass.getDeclaredConstructor().newInstance(), ExtensionFactory.class);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/GlobalSettingsListener.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\n\npublic interface GlobalSettingsListener extends Extension {\n\n  default void beforeGlobalSettingsUpdated(\n      GlobalSettings oldSettings, GlobalSettings newSettings) {}\n\n  default void afterGlobalSettingsUpdated(GlobalSettings oldSettings, GlobalSettings newSettings) {}\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/MappingsLoaderExtension.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.standalone.MappingsLoader;\n\npublic interface MappingsLoaderExtension extends MappingsLoader, Extension {}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/MessageActionTransformer.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.message.MessageAction;\nimport com.github.tomakehurst.wiremock.message.MessageActionContext;\n\npublic interface MessageActionTransformer extends Extension {\n\n  MessageAction transform(MessageAction action, MessageActionContext context);\n\n  default boolean applyGlobally() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/Parameters.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkParameter;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.function.Consumer;\n\npublic class Parameters extends Metadata {\n\n  public Parameters() {\n    super();\n  }\n\n  @JsonCreator\n  public Parameters(Map<? extends String, ?> data) {\n    super(data);\n  }\n\n  @Override\n  protected Metadata newInstance(Map<String, Object> value) {\n    return new Parameters(value);\n  }\n\n  public static Parameters empty() {\n    return new Parameters();\n  }\n\n  public static Parameters from(Map<String, Object> parameterMap) {\n    return new Parameters(parameterMap);\n  }\n\n  public static Parameters one(String name, Object value) {\n    return from(Map.of(name, value));\n  }\n\n  public static <T> Parameters of(T myData) {\n    return from(Json.objectToMap(myData));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public Parameters getParameters(String key) {\n    checkKeyPresent(key);\n    checkParameter(Map.class.isAssignableFrom(get(key).getClass()), key + \" is not a map\");\n    return new Parameters((Map<String, ?>) get(key));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public Parameters getParameters(String key, Parameters defaultValue) {\n    if (!containsKey(key)) {\n      return defaultValue;\n    }\n\n    checkParameter(Map.class.isAssignableFrom(get(key).getClass()), key + \" is not a map\");\n    return new Parameters((Map<String, ?>) get(key));\n  }\n\n  public Parameters transform(Consumer<Builder> transformer) {\n    final Builder builder = new Builder(this);\n    transformer.accept(builder);\n    return Parameters.from(builder.build());\n  }\n\n  public Parameters merge(Parameters other) {\n    Map<String, Object> attributes = new LinkedHashMap<>(this);\n    attributes.putAll(other);\n    return Parameters.from(attributes);\n  }\n\n  public Parameters deepMerge(Parameters other) {\n    return from(super.deepMerge(other));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/PostServeAction.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\n/**\n * @deprecated Use {@link ServeEventListener} instead.\n */\n@Deprecated\npublic abstract class PostServeAction implements Extension {\n\n  /**\n   * Do something after a request has been served. Called when this extension is applied to a\n   * specific stub mapping.\n   *\n   * @param serveEvent the serve event, including the request and the response definition\n   * @param admin WireMock's admin functions\n   * @param parameters the parameters passed to the extension from the stub mapping\n   */\n  public void doAction(ServeEvent serveEvent, Admin admin, Parameters parameters) {}\n\n  /**\n   * Do something after a request has been served. Called when this extension is applied to a\n   * specific stub mapping.\n   *\n   * @param serveEvent the serve event, including the request and the response definition\n   * @param admin WireMock's admin functions\n   */\n  public void doGlobalAction(ServeEvent serveEvent, Admin admin) {}\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/PostServeActionDefinition.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class PostServeActionDefinition {\n\n  private final String name;\n  private final Parameters parameters;\n\n  public PostServeActionDefinition(\n      @JsonProperty(\"name\") String name, @JsonProperty(\"parameters\") Parameters parameters) {\n    this.name = name;\n    this.parameters = parameters;\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  public Parameters getParameters() {\n    return parameters;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/PostServeActionDefinitionListDeserializer.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.core.JsonToken;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\npublic class PostServeActionDefinitionListDeserializer\n    extends JsonDeserializer<List<PostServeActionDefinition>> {\n\n  @Override\n  public List<PostServeActionDefinition> deserialize(\n      JsonParser parser, DeserializationContext context) throws IOException {\n\n    JsonToken currentToken = parser.currentToken();\n\n    if (currentToken == JsonToken.START_OBJECT) {\n      return deserializeFromMap(parser);\n    } else if (currentToken == JsonToken.START_ARRAY) {\n      return deserializeFromArray(parser);\n    } else {\n      return null;\n    }\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private List<PostServeActionDefinition> deserializeFromMap(JsonParser parser) throws IOException {\n    Map<String, Object> map = parser.readValueAs(Map.class);\n\n    List<PostServeActionDefinition> result = new ArrayList<>();\n    for (Map.Entry<String, Object> entry : map.entrySet()) {\n      result.add(\n          new PostServeActionDefinition(\n              entry.getKey(), Parameters.from((Map<String, Object>) entry.getValue())));\n    }\n    return result;\n  }\n\n  private List<PostServeActionDefinition> deserializeFromArray(JsonParser parser)\n      throws IOException {\n    @SuppressWarnings(\"unchecked\")\n    List<Map<String, Object>> list = parser.readValueAs(List.class);\n\n    List<PostServeActionDefinition> result = new ArrayList<>();\n    for (Map<String, Object> item : list) {\n      result.add(Json.mapToObject(item, PostServeActionDefinition.class));\n    }\n    return result;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ResponseDefinitionTransformer.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\n\n@Deprecated\n/**\n * @deprecated Use {@link ResponseDefinitionTransformerV2} instead\n */\npublic abstract class ResponseDefinitionTransformer\n    extends AbstractTransformer<ResponseDefinition> {\n\n  @Override\n  public abstract ResponseDefinition transform(\n      Request request,\n      ResponseDefinition responseDefinition,\n      FileSource files,\n      Parameters parameters);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ResponseDefinitionTransformerV2.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic interface ResponseDefinitionTransformerV2 extends Extension {\n\n  ResponseDefinition transform(ServeEvent serveEvent);\n\n  default boolean applyGlobally() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ResponseTransformer.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\n\n@Deprecated\n/**\n * @deprecated Use {@link ResponseTransformerV2} instead\n */\npublic abstract class ResponseTransformer extends AbstractTransformer<Response> {\n\n  @Override\n  public abstract Response transform(\n      Request request, Response response, FileSource files, Parameters parameters);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ResponseTransformerV2.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic interface ResponseTransformerV2 extends Extension {\n\n  Response transform(Response response, ServeEvent serveEvent);\n\n  default boolean applyGlobally() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ServeEventListener.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic interface ServeEventListener extends Extension {\n\n  enum RequestPhase {\n    BEFORE_MATCH,\n    AFTER_MATCH,\n    BEFORE_RESPONSE_SENT,\n    AFTER_COMPLETE\n  }\n\n  default void onEvent(RequestPhase requestPhase, ServeEvent serveEvent, Parameters parameters) {\n    switch (requestPhase) {\n      case BEFORE_MATCH:\n        beforeMatch(serveEvent, parameters);\n        break;\n      case AFTER_MATCH:\n        afterMatch(serveEvent, parameters);\n        break;\n      case BEFORE_RESPONSE_SENT:\n        beforeResponseSent(serveEvent, parameters);\n        break;\n      case AFTER_COMPLETE:\n        afterComplete(serveEvent, parameters);\n        break;\n    }\n  }\n\n  default void beforeMatch(ServeEvent serveEvent, Parameters parameters) {}\n\n  default void afterMatch(ServeEvent serveEvent, Parameters parameters) {}\n\n  default void beforeResponseSent(ServeEvent serveEvent, Parameters parameters) {}\n\n  default void afterComplete(ServeEvent serveEvent, Parameters parameters) {}\n\n  default boolean applyGlobally() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ServeEventListenerDefinition.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.Set;\n\npublic class ServeEventListenerDefinition {\n\n  private final String name;\n  private final Set<ServeEventListener.RequestPhase> requestPhases;\n  private final Parameters parameters;\n\n  public ServeEventListenerDefinition(String name, Parameters parameters) {\n    this(name, null, parameters);\n  }\n\n  public ServeEventListenerDefinition(\n      @JsonProperty(\"name\") String name,\n      @JsonProperty(\"requestPhases\") Set<ServeEventListener.RequestPhase> requestPhases,\n      @JsonProperty(\"parameters\") Parameters parameters) {\n    this.name = name;\n    this.requestPhases = requestPhases;\n    this.parameters = parameters;\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  public Set<ServeEventListener.RequestPhase> getRequestPhases() {\n    return requestPhases;\n  }\n\n  public Parameters getParameters() {\n    return parameters;\n  }\n\n  public boolean shouldFireFor(ServeEventListener.RequestPhase requestPhase) {\n    return requestPhases == null || requestPhases.contains(requestPhase);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/ServeEventListenerUtils.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\nimport java.util.Map;\n\npublic class ServeEventListenerUtils {\n  public static void triggerListeners(\n      Map<String, ServeEventListener> serveEventListeners,\n      ServeEventListener.RequestPhase requestPhase,\n      ServeEvent serveEvent) {\n\n    serveEventListeners.values().stream()\n        .filter(ServeEventListener::applyGlobally)\n        .forEach(listener -> listener.onEvent(requestPhase, serveEvent, Parameters.empty()));\n\n    List<ServeEventListenerDefinition> serveEventListenerDefinitions =\n        serveEvent.getServeEventListeners();\n    for (ServeEventListenerDefinition listenerDef : serveEventListenerDefinitions) {\n      ServeEventListener listener = serveEventListeners.get(listenerDef.getName());\n      if (listener != null\n          && !listener.applyGlobally()\n          && listenerDef.shouldFireFor(requestPhase)) {\n        Parameters parameters = listenerDef.getParameters();\n        listener.onEvent(requestPhase, serveEvent, parameters);\n      } else {\n        notifier().error(\"No per-stub listener was found named \\\"\" + listenerDef.getName() + \"\\\"\");\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/StaticExtensionLoader.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.common.FatalStartupException;\nimport com.github.tomakehurst.wiremock.http.DefaultFactory;\nimport java.util.Collection;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.ServiceLoader;\nimport java.util.function.Supplier;\nimport java.util.stream.Stream;\n\npublic final class StaticExtensionLoader<T extends Extension> {\n\n  private final Class<T> type;\n  private T specificInstance = null;\n  private Collection<T> extensions = List.of();\n  private Supplier<Stream<T>> serviceLoader;\n\n  public StaticExtensionLoader(Class<T> type) {\n    this.type = type;\n    this.serviceLoader = systemServiceLoader(type);\n  }\n\n  public T load() {\n    if (specificInstance != null) {\n      return specificInstance;\n    }\n\n    if (!extensions.isEmpty()) {\n      return pickMostAppropriateFrom(extensions.stream());\n    }\n\n    return pickMostAppropriateFrom(serviceLoader.get());\n  }\n\n  public StaticExtensionLoader<T> setSpecificInstance(T specificInstance) {\n    this.specificInstance = specificInstance;\n    return this;\n  }\n\n  public StaticExtensionLoader<T> setExtensions(List<T> extensions) {\n    this.extensions = extensions;\n    return this;\n  }\n\n  public StaticExtensionLoader<T> setExtensions(Extensions extensions) {\n    this.extensions = extensions.ofType(type).values();\n    return this;\n  }\n\n  public StaticExtensionLoader<T> setServiceLoader(Supplier<Stream<T>> serviceLoader) {\n    this.serviceLoader = serviceLoader;\n    return this;\n  }\n\n  private T pickMostAppropriateFrom(Stream<T> candidates) {\n    return candidates\n        .min(defaultFactoryLast())\n        .orElseThrow(this::couldNotFindSuitableImplementationException);\n  }\n\n  private Comparator<Object> defaultFactoryLast() {\n    return (o1, o2) -> {\n      boolean o1IsDefault = o1 instanceof DefaultFactory;\n      boolean o2IsDefault = o2 instanceof DefaultFactory;\n      if (o1IsDefault == o2IsDefault) {\n        return 0;\n      } else if (o1IsDefault) {\n        return 1;\n      } else {\n        return -1;\n      }\n    };\n  }\n\n  private FatalStartupException couldNotFindSuitableImplementationException() {\n    return new FatalStartupException(\n        \"No suitable \"\n            + type.getSimpleName()\n            + \" was found. Please ensure that the classpath includes a WireMock extension that provides an \"\n            + type.getSimpleName()\n            + \" implementation. See https://wiremock.org/docs/extending-wiremock/ for more information.\");\n  }\n\n  private static <T extends Extension> Supplier<Stream<T>> systemServiceLoader(Class<T> type) {\n    //noinspection unchecked\n    return () ->\n        ServiceLoader.load(Extension.class).stream()\n            .filter(extension -> type.isAssignableFrom(extension.type()))\n            .map(e -> (T) e.get());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/StubLifecycleListener.java",
    "content": "/*\n * Copyright (C) 2019-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport org.jspecify.annotations.NullMarked;\n\n@NullMarked\npublic interface StubLifecycleListener extends Extension {\n\n  default StubMapping beforeStubCreated(StubMapping stub) {\n    return stub;\n  }\n\n  default void afterStubCreated(StubMapping stub) {}\n\n  default StubMapping beforeStubEdited(StubMapping oldStub, StubMapping newStub) {\n    return newStub;\n  }\n\n  default void afterStubEdited(StubMapping oldStub, StubMapping newStub) {}\n\n  default void beforeStubRemoved(StubMapping stub) {}\n\n  default void afterStubRemoved(StubMapping stub) {}\n\n  default void beforeStubsReset() {}\n\n  default void afterStubsReset() {}\n\n  default void beforeStubsAltered(List<StubMappingToAlter> stubs) {\n    for (StubMappingToAlter alteredStub : stubs) {\n      if (alteredStub instanceof StubMappingToCreate toCreate) {\n        toCreate.setStub(beforeStubCreated(toCreate.getStub()));\n      } else if (alteredStub instanceof StubMappingToEdit toEdit) {\n        toEdit.setNewStub(beforeStubEdited(toEdit.getOldStub(), toEdit.getNewStub()));\n      } else if (alteredStub instanceof StubMappingToRemove toRemove) {\n        beforeStubRemoved(toRemove.getStub());\n      }\n    }\n  }\n\n  default void afterStubsAltered(List<AlteredStubMapping> stubs) {\n    for (AlteredStubMapping alteredStub : stubs) {\n      if (alteredStub instanceof CreatedStubMapping created) {\n        afterStubCreated(created.getStub());\n      } else if (alteredStub instanceof EditedStubMapping edited) {\n        afterStubEdited(edited.getOldStub(), edited.getNewStub());\n      } else if (alteredStub instanceof RemovedStubMapping removed) {\n        afterStubRemoved(removed.getStub());\n      }\n    }\n  }\n\n  sealed interface AlteredStubMapping\n      permits CreatedStubMapping, EditedStubMapping, RemovedStubMapping {}\n\n  non-sealed interface CreatedStubMapping extends AlteredStubMapping {\n    StubMapping getStub();\n  }\n\n  non-sealed interface EditedStubMapping extends AlteredStubMapping {\n    StubMapping getOldStub();\n\n    StubMapping getNewStub();\n  }\n\n  non-sealed interface RemovedStubMapping extends AlteredStubMapping {\n    StubMapping getStub();\n  }\n\n  sealed interface StubMappingToAlter\n      permits StubMappingToCreate, StubMappingToEdit, StubMappingToRemove {}\n\n  non-sealed interface StubMappingToCreate extends StubMappingToAlter, CreatedStubMapping {\n    void setStub(StubMapping stub);\n  }\n\n  non-sealed interface StubMappingToEdit extends StubMappingToAlter, EditedStubMapping {\n    void setNewStub(StubMapping stub);\n  }\n\n  non-sealed interface StubMappingToRemove extends StubMappingToAlter, RemovedStubMapping {}\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/StubMappingTransformer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.recording.StubGenerationResult;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\n/**\n * Base class for stub mapping transformer extensions. This allows transforming stub mappings\n * recorded via the snapshot and recording API endpoints.\n */\npublic abstract class StubMappingTransformer implements Extension {\n  public StubMapping transform(StubMapping stubMapping, FileSource files, Parameters parameters) {\n    throw new UnsupportedOperationException();\n  }\n\n  /**\n   * @param serveEvent The original recorded serve event used to generate the stub mapping.\n   */\n  public StubGenerationResult transform(\n      StubMapping stubMapping, FileSource files, Parameters parameters, ServeEvent serveEvent) {\n    return new StubGenerationResult.Success(transform(stubMapping, files, parameters));\n  }\n\n  public boolean applyGlobally() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/TemplateHelperProviderExtension.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.jknack.handlebars.Helper;\nimport java.util.Map;\n\npublic interface TemplateHelperProviderExtension extends Extension {\n  Map<String, Helper<?>> provideTemplateHelpers();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/TemplateModelDataProviderExtension.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Map;\n\npublic interface TemplateModelDataProviderExtension extends Extension {\n  Map<String, Object> provideTemplateModelData(ServeEvent serveEvent);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/WireMockServices.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.TemplateEngine;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.store.Stores;\n\npublic interface WireMockServices {\n\n  Admin getAdmin();\n\n  Stores getStores();\n\n  FileSource getFiles();\n\n  Options getOptions();\n\n  Extensions getExtensions();\n\n  TemplateEngine getTemplateEngine();\n\n  HttpClientFactory getHttpClientFactory();\n\n  HttpClient getDefaultHttpClient();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/AdminRequestFilter.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\npublic abstract class AdminRequestFilter implements RequestFilter {\n\n  @Override\n  public boolean applyToAdmin() {\n    return true;\n  }\n\n  @Override\n  public boolean applyToStubs() {\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/AdminRequestFilterV2.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\npublic interface AdminRequestFilterV2 extends RequestFilterV2 {\n\n  @Override\n  default boolean applyToAdmin() {\n    return true;\n  }\n\n  @Override\n  default boolean applyToStubs() {\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/ContinueAction.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\nimport com.github.tomakehurst.wiremock.http.Request;\n\npublic class ContinueAction extends RequestFilterAction {\n\n  private final Request request;\n\n  ContinueAction(Request request) {\n    this.request = request;\n  }\n\n  public Request getRequest() {\n    return request;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/FieldTransformer.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\npublic interface FieldTransformer<T> {\n\n  T transform(T source);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/FilterProcessor.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\n\npublic class FilterProcessor {\n\n  private final List<? extends RequestFilter> v1RequestFilters;\n  private final List<? extends RequestFilterV2> v2RequestFilters;\n\n  public FilterProcessor(\n      List<? extends RequestFilter> v1RequestFilters,\n      List<? extends RequestFilterV2> v2RequestFilters) {\n    this.v1RequestFilters = v1RequestFilters;\n    this.v2RequestFilters = v2RequestFilters;\n  }\n\n  public RequestFilterAction processFilters(Request request, ServeEvent serveEvent) {\n    RequestFilterAction requestFilterAction =\n        processV1Filters(request, v1RequestFilters, RequestFilterAction.continueWith(request));\n    if (requestFilterAction instanceof ContinueAction) {\n      return processV2Filters(request, serveEvent, v2RequestFilters, requestFilterAction);\n    } else {\n      return requestFilterAction;\n    }\n  }\n\n  private RequestFilterAction processV1Filters(\n      Request request,\n      List<? extends RequestFilter> requestFilters,\n      RequestFilterAction lastAction) {\n\n    if (requestFilters.isEmpty()) {\n      return lastAction;\n    }\n\n    RequestFilterAction action = requestFilters.get(0).filter(request);\n\n    if (action instanceof ContinueAction) {\n      Request newRequest = ((ContinueAction) action).getRequest();\n      return processV1Filters(newRequest, requestFilters.subList(1, requestFilters.size()), action);\n    }\n\n    return action;\n  }\n\n  private RequestFilterAction processV2Filters(\n      Request request,\n      ServeEvent serveEvent,\n      List<? extends RequestFilterV2> v2RequestFilters,\n      RequestFilterAction lastAction) {\n\n    if (v2RequestFilters.isEmpty()) {\n      return lastAction;\n    }\n\n    RequestFilterAction action = v2RequestFilters.get(0).filter(request, serveEvent);\n\n    if (action instanceof ContinueAction) {\n      Request newRequest = ((ContinueAction) action).getRequest();\n      return processV2Filters(\n          newRequest, serveEvent, v2RequestFilters.subList(1, v2RequestFilters.size()), action);\n    }\n\n    return action;\n  }\n\n  public boolean hasAnyFilters() {\n    return !v1RequestFilters.isEmpty() || !v2RequestFilters.isEmpty();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/RequestFilter.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.http.Request;\n\n@Deprecated\n/**\n * @deprecated Use {@link RequestFilterV2} instead\n */\npublic interface RequestFilter extends Extension {\n\n  RequestFilterAction filter(Request request);\n\n  boolean applyToAdmin();\n\n  boolean applyToStubs();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/RequestFilterAction.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\n\npublic class RequestFilterAction {\n\n  public static RequestFilterAction continueWith(Request request) {\n    return new ContinueAction(request);\n  }\n\n  public static RequestFilterAction stopWith(ResponseDefinition responseDefinition) {\n    return new StopAction(responseDefinition);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/RequestFilterV2.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic interface RequestFilterV2 extends Extension {\n\n  RequestFilterAction filter(Request request, ServeEvent serveEvent);\n\n  boolean applyToAdmin();\n\n  boolean applyToStubs();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/RequestWrapper.java",
    "content": "/*\n * Copyright (C) 2018-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.encodeBase64;\nimport static com.github.tomakehurst.wiremock.common.Lazy.lazy;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static java.util.Objects.requireNonNull;\n\nimport com.github.tomakehurst.wiremock.common.Lazy;\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport org.jspecify.annotations.NonNull;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\n\npublic class RequestWrapper implements Request {\n\n  private final Request delegate;\n\n  private final RequestMethod method;\n  private final FieldTransformer<String> absoluteUrlTransformer;\n  private final List<HttpHeader> addedHeaders;\n  private final List<String> removedHeaders;\n  private final Map<CaseInsensitiveKey, FieldTransformer<List<String>>> headerTransformers;\n  private final Map<String, Cookie> additionalCookies;\n  private final List<String> cookiesToRemove;\n  private final Map<String, FieldTransformer<Cookie>> cookieTransformers;\n  private final FieldTransformer<Body> bodyTransformer;\n  private final FieldTransformer<Part> multipartTransformer;\n\n  public RequestWrapper(Request delegate) {\n    this(\n        delegate,\n        null,\n        null,\n        Collections.emptyList(),\n        Collections.emptyList(),\n        Collections.emptyMap(),\n        Collections.emptyMap(),\n        Collections.emptyList(),\n        Collections.emptyMap(),\n        null,\n        null);\n  }\n\n  public RequestWrapper(\n      Request delegate,\n      RequestMethod method,\n      FieldTransformer<String> absoluteUrlTransformer,\n      List<HttpHeader> addedHeaders,\n      List<String> removedHeaders,\n      Map<CaseInsensitiveKey, FieldTransformer<List<String>>> headerTransformers,\n      Map<String, Cookie> additionalCookies,\n      List<String> cookiesToRemove,\n      Map<String, FieldTransformer<Cookie>> cookieTransformers,\n      FieldTransformer<Body> bodyTransformer,\n      FieldTransformer<Part> multipartTransformer) {\n    this.delegate = delegate;\n\n    this.method = method;\n    this.absoluteUrlTransformer = absoluteUrlTransformer;\n    this.addedHeaders = addedHeaders;\n    this.removedHeaders = removedHeaders;\n    this.headerTransformers = headerTransformers;\n    this.additionalCookies = additionalCookies;\n    this.cookiesToRemove = cookiesToRemove;\n    this.cookieTransformers = cookieTransformers;\n    this.bodyTransformer = bodyTransformer;\n    this.multipartTransformer = multipartTransformer;\n  }\n\n  public static Builder create() {\n    return new Builder();\n  }\n\n  @Override\n  public @NonNull String getAbsoluteUrl() {\n    String absoluteUrl = requireNonNull(delegate.getAbsoluteUrl());\n    if (absoluteUrlTransformer != null) {\n      return absoluteUrlTransformer.transform(absoluteUrl);\n    }\n\n    return absoluteUrl;\n  }\n\n  private final Lazy<@NonNull AbsoluteUrl> typedAbsoluteUrl =\n      lazy(() -> AbsoluteUrl.parse(getAbsoluteUrl()));\n\n  @Override\n  public @NonNull AbsoluteUrl getTypedAbsoluteUrl() {\n    return typedAbsoluteUrl.get();\n  }\n\n  private final Lazy<@NonNull PathAndQuery> pathAndQuery =\n      lazy(() -> getTypedAbsoluteUrl().getPathAndQuery());\n\n  @Override\n  public @NonNull PathAndQuery getPathAndQueryWithoutPrefix() {\n    return pathAndQuery.get();\n  }\n\n  @Override\n  public @NonNull String getUrl() {\n    return pathAndQuery.get().toString();\n  }\n\n  @Override\n  public RequestMethod getMethod() {\n    return getFirstNonNull(method, delegate.getMethod());\n  }\n\n  @Override\n  public String getScheme() {\n    return delegate.getScheme();\n  }\n\n  @Override\n  public String getHost() {\n    return delegate.getHost();\n  }\n\n  @Override\n  public int getPort() {\n    return delegate.getPort();\n  }\n\n  @Override\n  public String getClientIp() {\n    return delegate.getClientIp();\n  }\n\n  @Override\n  public String getHeader(String key) {\n    return getHeaders().getHeader(key).firstValue();\n  }\n\n  @Override\n  public HttpHeader header(String key) {\n    return getHeaders().getHeader(key);\n  }\n\n  @Override\n  public ContentTypeHeader contentTypeHeader() {\n    return delegate.contentTypeHeader();\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    List<HttpHeader> existingHeaders = new ArrayList<>(delegate.getHeaders().all());\n    existingHeaders.addAll(addedHeaders);\n\n    List<HttpHeader> combinedHeaders =\n        existingHeaders.stream()\n            .filter(httpHeader -> !removedHeaders.contains(httpHeader.key()))\n            .map(\n                httpHeader -> {\n                  if (headerTransformers.containsKey(httpHeader.caseInsensitiveKey())) {\n                    FieldTransformer<List<String>> transformer =\n                        headerTransformers.get(httpHeader.caseInsensitiveKey());\n                    List<String> newValues = transformer.transform(httpHeader.values());\n                    return new HttpHeader(httpHeader.key(), newValues);\n                  }\n\n                  return httpHeader;\n                })\n            .collect(Collectors.toList());\n\n    return new HttpHeaders(combinedHeaders);\n  }\n\n  @Override\n  public boolean containsHeader(String key) {\n    return getHeaders().getHeader(key).isPresent();\n  }\n\n  @Override\n  public Set<String> getAllHeaderKeys() {\n    return getHeaders().keys();\n  }\n\n  @Override\n  public Map<String, Cookie> getCookies() {\n    Map<String, Cookie> cookieMap = new HashMap<>();\n    for (Map.Entry<String, Cookie> entry : delegate.getCookies().entrySet()) {\n      Cookie newCookie =\n          cookieTransformers.containsKey(entry.getKey())\n              ? cookieTransformers.get(entry.getKey()).transform(entry.getValue())\n              : entry.getValue();\n\n      if (!cookiesToRemove.contains(entry.getKey())) {\n        cookieMap.put(entry.getKey(), newCookie);\n      }\n    }\n\n    cookieMap.putAll(additionalCookies);\n\n    return Collections.unmodifiableMap(cookieMap);\n  }\n\n  @Override\n  public QueryParameter queryParameter(String key) {\n    return delegate.queryParameter(key);\n  }\n\n  @Override\n  public FormParameter formParameter(String key) {\n    return delegate.formParameter(key);\n  }\n\n  @Override\n  public Map<String, FormParameter> formParameters() {\n    return delegate.formParameters();\n  }\n\n  @Override\n  public byte[] getBody() {\n    if (bodyTransformer != null) {\n      return bodyTransformer.transform(new Body(delegate.getBody())).asBytes();\n    }\n\n    return delegate.getBody();\n  }\n\n  @Override\n  public String getBodyAsString() {\n    if (bodyTransformer != null) {\n      return bodyTransformer.transform(new Body(delegate.getBodyAsString())).asString();\n    }\n\n    return delegate.getBodyAsString();\n  }\n\n  @Override\n  public String getBodyAsBase64() {\n    return encodeBase64(getBody());\n  }\n\n  @Override\n  public boolean isMultipart() {\n    return delegate.isMultipart();\n  }\n\n  @Override\n  public Collection<Part> getParts() {\n    if (delegate.getParts() == null || multipartTransformer == null) {\n      return delegate.getParts();\n    }\n\n    return delegate.getParts().stream()\n        .map(multipartTransformer::transform)\n        .collect(Collectors.toList());\n  }\n\n  @Override\n  public Part getPart(String name) {\n    if (multipartTransformer != null) {\n      return multipartTransformer.transform(delegate.getPart(name));\n    }\n\n    return delegate.getPart(name);\n  }\n\n  @Override\n  public boolean isBrowserProxyRequest() {\n    return delegate.isBrowserProxyRequest();\n  }\n\n  @Override\n  public Optional<Request> getOriginalRequest() {\n    return delegate.getOriginalRequest();\n  }\n\n  @Override\n  public String getProtocol() {\n    return delegate.getProtocol();\n  }\n\n  public static class Builder {\n\n    private RequestMethod requestMethod;\n    private FieldTransformer<String> absoluteUrlTransformer;\n\n    private final List<HttpHeader> additionalHeaders = new ArrayList<>();\n    private final List<String> headersToRemove = new ArrayList<>();\n    private final Map<CaseInsensitiveKey, FieldTransformer<List<String>>> headerTransformers =\n        new HashMap<>();\n\n    private final Map<String, Cookie> additionalCookies = new HashMap<>();\n    private final List<String> cookiesToRemove = new ArrayList<>();\n    private final Map<String, FieldTransformer<Cookie>> cookieTransformers = new HashMap<>();\n\n    private FieldTransformer<Body> bodyTransformer;\n    private FieldTransformer<Part> mutlipartTransformer;\n\n    public Builder addHeader(String key, String... values) {\n      additionalHeaders.add(new HttpHeader(key, values));\n      return this;\n    }\n\n    public Builder removeHeader(String key) {\n      headersToRemove.add(key);\n      return this;\n    }\n\n    public Builder transformHeader(String key, FieldTransformer<List<String>> transformer) {\n      headerTransformers.put(CaseInsensitiveKey.from(key), transformer);\n      return this;\n    }\n\n    public Builder setMethod(RequestMethod method) {\n      requestMethod = method;\n      return this;\n    }\n\n    public Builder transformAbsoluteUrl(FieldTransformer<String> transformer) {\n      absoluteUrlTransformer = transformer;\n      return this;\n    }\n\n    public Request wrap(Request request) {\n      return new RequestWrapper(\n          request,\n          requestMethod,\n          absoluteUrlTransformer,\n          additionalHeaders,\n          headersToRemove,\n          headerTransformers,\n          additionalCookies,\n          cookiesToRemove,\n          cookieTransformers,\n          bodyTransformer,\n          mutlipartTransformer);\n    }\n\n    public Builder transformBody(FieldTransformer<Body> transformer) {\n      bodyTransformer = transformer;\n      return this;\n    }\n\n    public Builder transformCookie(String name, FieldTransformer<Cookie> transformer) {\n      cookieTransformers.put(name, transformer);\n      return this;\n    }\n\n    public Builder transformParts(FieldTransformer<Part> transformer) {\n      mutlipartTransformer = transformer;\n      return this;\n    }\n\n    public Builder addCookie(String name, Cookie value) {\n      additionalCookies.put(name, value);\n      return this;\n    }\n\n    public Builder removeCookie(String name) {\n      cookiesToRemove.add(name);\n      return this;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/StopAction.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\n\npublic class StopAction extends RequestFilterAction {\n\n  private final ResponseDefinition responseDefinition;\n\n  StopAction(ResponseDefinition responseDefinition) {\n    this.responseDefinition = responseDefinition;\n  }\n\n  public ResponseDefinition getResponseDefinition() {\n    return responseDefinition;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/StubRequestFilter.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\npublic abstract class StubRequestFilter implements RequestFilter {\n\n  @Override\n  public boolean applyToAdmin() {\n    return false;\n  }\n\n  @Override\n  public boolean applyToStubs() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/requestfilter/StubRequestFilterV2.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.requestfilter;\n\npublic interface StubRequestFilterV2 extends RequestFilterV2 {\n\n  @Override\n  default boolean applyToAdmin() {\n    return false;\n  }\n\n  @Override\n  default boolean applyToStubs() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/HandlebarsOptimizedTemplate.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport com.github.jknack.handlebars.Context;\nimport com.github.jknack.handlebars.Handlebars;\nimport com.github.jknack.handlebars.Template;\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport com.github.tomakehurst.wiremock.common.RequestCache;\nimport java.io.IOException;\nimport java.io.StringWriter;\nimport java.io.Writer;\n\npublic class HandlebarsOptimizedTemplate {\n\n  private final Template template;\n\n  private String startContent;\n  private String templateContent;\n  private String endContent;\n\n  public HandlebarsOptimizedTemplate(final Handlebars handlebars, final String content) {\n    startContent = content;\n    templateContent = \"\";\n    endContent = \"\";\n\n    int firstDelimStartPosition = content.indexOf(Handlebars.DELIM_START);\n    if (firstDelimStartPosition != -1) {\n      int lastDelimEndPosition = content.lastIndexOf(Handlebars.DELIM_END);\n      if (lastDelimEndPosition != -1) {\n        startContent = content.substring(0, firstDelimStartPosition);\n        templateContent =\n            content.substring(\n                firstDelimStartPosition, lastDelimEndPosition + Handlebars.DELIM_END.length());\n        endContent = content.substring(lastDelimEndPosition + Handlebars.DELIM_END.length());\n      }\n    }\n\n    this.template = uncheckedCompileTemplate(handlebars, templateContent);\n  }\n\n  private static Template uncheckedCompileTemplate(Handlebars handlebars, String templateContent) {\n    try {\n      return handlebars.compileInline(templateContent);\n    } catch (IOException e) {\n      return Exceptions.throwUnchecked(e, Template.class);\n    }\n  }\n\n  public String apply(Object contextData) {\n    final RequestCache requestCache = RequestCache.getCurrent();\n    Context context = Context.newBuilder(contextData).combine(\"requestCache\", requestCache).build();\n\n    return startContent + applyTemplate(context) + endContent;\n  }\n\n  private String applyTemplate(Context context) {\n    return Exceptions.uncheck(\n        () -> {\n          Writer stringWriter = new StringWriter(template.text().length() * 2);\n          template.apply(context, stringWriter);\n          return stringWriter.toString();\n        },\n        String.class);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/HttpTemplateCacheKey.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport java.util.Objects;\n\npublic class HttpTemplateCacheKey {\n\n  public enum ResponseElement {\n    BODY,\n    PROXY_URL,\n    HEADER\n  }\n\n  private final ResponseDefinition responseDefinition;\n  private final ResponseElement element;\n  private final String name;\n  private final Integer index;\n\n  public static HttpTemplateCacheKey forInlineBody(ResponseDefinition responseDefinition) {\n    return new HttpTemplateCacheKey(responseDefinition, ResponseElement.BODY, \"[inlineBody]\", null);\n  }\n\n  public static HttpTemplateCacheKey forFileBody(\n      ResponseDefinition responseDefinition, String filename) {\n    return new HttpTemplateCacheKey(responseDefinition, ResponseElement.BODY, filename, null);\n  }\n\n  public static HttpTemplateCacheKey forHeader(\n      ResponseDefinition responseDefinition, String headerName, int valueIndex) {\n    return new HttpTemplateCacheKey(\n        responseDefinition, ResponseElement.HEADER, headerName, valueIndex);\n  }\n\n  public static HttpTemplateCacheKey forProxyUrl(ResponseDefinition responseDefinition) {\n    return new HttpTemplateCacheKey(\n        responseDefinition, ResponseElement.PROXY_URL, \"[proxyUrl]\", null);\n  }\n\n  private HttpTemplateCacheKey(\n      ResponseDefinition responseDefinition, ResponseElement element, String name, Integer index) {\n    this.responseDefinition = responseDefinition;\n    this.element = element;\n    this.name = name;\n    this.index = index;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    HttpTemplateCacheKey that = (HttpTemplateCacheKey) o;\n    return responseDefinition.equals(that.responseDefinition)\n        && element == that.element\n        && name.equals(that.name)\n        && Objects.equals(index, that.index);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(responseDefinition, element, name, index);\n  }\n\n  @Override\n  public String toString() {\n    final StringBuilder sb = new StringBuilder(\"TemplateCacheKey{\");\n    sb.append(\"responseDefinition=\").append(responseDefinition);\n    sb.append(\", element=\").append(element);\n    sb.append(\", name='\").append(name).append('\\'');\n    sb.append(\", index=\").append(index);\n    sb.append('}');\n    return sb.toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/LazyTemplateEngine.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport com.github.tomakehurst.wiremock.common.Lazy;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Map;\nimport java.util.function.Supplier;\n\npublic class LazyTemplateEngine extends TemplateEngine {\n  private final Lazy<TemplateEngine> templateEngineLazy;\n\n  public LazyTemplateEngine(Supplier<TemplateEngine> templateEngineSupplier) {\n    this.templateEngineLazy = Lazy.lazy(templateEngineSupplier);\n  }\n\n  @Override\n  public HandlebarsOptimizedTemplate getTemplate(Object key, String content) {\n    return templateEngineLazy.get().getTemplate(key, content);\n  }\n\n  @Override\n  public HandlebarsOptimizedTemplate getUncachedTemplate(String content) {\n    return templateEngineLazy.get().getUncachedTemplate(content);\n  }\n\n  @Override\n  public Map<String, Object> buildModelForRequest(ServeEvent serveEvent) {\n    return templateEngineLazy.get().buildModelForRequest(serveEvent);\n  }\n\n  @Override\n  public long getCacheSize() {\n    return templateEngineLazy.get().getCacheSize();\n  }\n\n  @Override\n  public void invalidateCache() {\n    templateEngineLazy.get().invalidateCache();\n  }\n\n  @Override\n  public Long getMaxCacheEntries() {\n    return templateEngineLazy.get().getMaxCacheEntries();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/MessageTemplateTransformer.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.entity.EntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.StringEntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.TextEntityDefinition;\nimport com.github.tomakehurst.wiremock.extension.MessageActionTransformer;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.message.Message;\nimport com.github.tomakehurst.wiremock.message.MessageAction;\nimport com.github.tomakehurst.wiremock.message.MessageActionContext;\nimport com.github.tomakehurst.wiremock.message.MessageChannel;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.RequestInitiatedMessageChannel;\nimport com.github.tomakehurst.wiremock.message.SendMessageAction;\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class MessageTemplateTransformer implements MessageActionTransformer {\n\n  public static final String NAME = \"message-template\";\n\n  private final TemplateEngine templateEngine;\n\n  public MessageTemplateTransformer(TemplateEngine templateEngine) {\n    this.templateEngine = templateEngine;\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @Override\n  public boolean applyGlobally() {\n    return true;\n  }\n\n  @Override\n  public MessageAction transform(MessageAction action, MessageActionContext context) {\n    if (!(action instanceof SendMessageAction sendAction)) {\n      return action;\n    }\n\n    EntityDefinition body = sendAction.getBody();\n    if (body == null) {\n      return action;\n    }\n\n    String bodyContent = extractBodyContent(body);\n    if (bodyContent == null || bodyContent.isEmpty()) {\n      return action;\n    }\n\n    Map<String, Object> model = buildModel(context, sendAction);\n    HandlebarsOptimizedTemplate template = templateEngine.getTemplate(bodyContent, bodyContent);\n    String transformedBody = template.apply(model);\n\n    return rebuildAction(sendAction, transformedBody);\n  }\n\n  private String extractBodyContent(EntityDefinition body) {\n    if (body instanceof StringEntityDefinition stringDef) {\n      return stringDef.getValue();\n    }\n    if (body instanceof TextEntityDefinition textDef) {\n      Object data = textDef.getData();\n      if (data instanceof String) {\n        return (String) data;\n      }\n      if (data != null) {\n        return Json.write(data);\n      }\n    }\n    return null;\n  }\n\n  private Map<String, Object> buildModel(MessageActionContext context, SendMessageAction action) {\n    Map<String, Object> model = new HashMap<>();\n\n    if (context.isTriggeredByMessage()) {\n      Message incomingMessage = context.getIncomingMessage();\n      if (incomingMessage != null) {\n        model.put(\"message\", new MessageTemplateModel(incomingMessage));\n      }\n      MessageChannel channel = context.getOriginatingChannel();\n      if (channel instanceof RequestInitiatedMessageChannel) {\n        Request initiatingRequest =\n            ((RequestInitiatedMessageChannel) channel).getInitiatingRequest();\n        if (initiatingRequest != null) {\n          model.putAll(templateEngine.buildModelForRequest(initiatingRequest));\n        }\n      }\n    } else if (context.isTriggeredByHttp()) {\n      model.putAll(templateEngine.buildModelForRequest(context.getHttpServeEvent()));\n    }\n\n    Parameters params = action.getTransformerParameters();\n    if (params != null && !params.isEmpty()) {\n      model.put(\"parameters\", params);\n    }\n\n    return model;\n  }\n\n  private SendMessageAction rebuildAction(SendMessageAction original, String newBody) {\n    return new SendMessageAction(\n        new MessageDefinition(new StringEntityDefinition(newBody)),\n        original.getChannelTarget(),\n        original.getTransformers(),\n        original.getTransformerParameters());\n  }\n\n  public static class MessageTemplateModel {\n    private final String body;\n\n    public MessageTemplateModel(Message message) {\n      this.body = message != null ? message.getBodyAsString() : null;\n    }\n\n    public String getBody() {\n      return body;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/RequestLine.java",
    "content": "/*\n * Copyright (C) 2017-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.stream.Collectors;\nimport org.wiremock.url.PathAndQuery;\n\npublic class RequestLine {\n  private final RequestMethod method;\n  private final String scheme;\n  private final String host;\n  private final int port;\n  private final Map<String, ListOrSingle<String>> query;\n  private final PathAndQuery url;\n  private final String clientIp;\n\n  private final PathParams pathParams;\n\n  private RequestLine(\n      RequestMethod method,\n      String scheme,\n      String host,\n      int port,\n      PathAndQuery url,\n      String clientIp,\n      Map<String, ListOrSingle<String>> query,\n      PathParams pathParams) {\n    this.method = method;\n    this.scheme = scheme;\n    this.host = host;\n    this.port = port;\n    this.url = url;\n    this.clientIp = clientIp;\n    this.query = query;\n    this.pathParams = pathParams;\n  }\n\n  public static RequestLine fromRequest(final Request request) {\n    var query = request.getPathAndQueryWithoutPrefix().getQueryOrEmpty();\n    Map<String, ListOrSingle<String>> adaptedQuery =\n        query.asDecodedMap().entrySet().stream()\n            .collect(Collectors.toMap(Entry::getKey, e -> ListOrSingle.of(e.getValue())));\n\n    return new RequestLine(\n        request.getMethod(),\n        request.getScheme(),\n        request.getHost(),\n        request.getPort(),\n        request.getPathAndQueryWithoutPrefix(),\n        request.getClientIp(),\n        adaptedQuery,\n        request.getPathParameters());\n  }\n\n  public RequestMethod getMethod() {\n    return method;\n  }\n\n  public Object getPathSegments() {\n    return pathParams.isEmpty() ? new UrlPath(url) : new TemplatedUrlPath(url, pathParams);\n  }\n\n  public String getPath() {\n    return getPathSegments().toString();\n  }\n\n  public String getUrl() {\n    return url.toString();\n  }\n\n  public Map<String, ListOrSingle<String>> getQuery() {\n    return query;\n  }\n\n  public String getScheme() {\n    return scheme;\n  }\n\n  public String getHost() {\n    return host;\n  }\n\n  public int getPort() {\n    return port;\n  }\n\n  public String getBaseUrl() {\n    String portPart = isStandardPort(scheme, port) ? \"\" : \":\" + port;\n\n    return scheme + \"://\" + host + portPart;\n  }\n\n  public String getClientIp() {\n    return this.clientIp;\n  }\n\n  private boolean isStandardPort(String scheme, int port) {\n    return (scheme.equals(\"http\") && port == 80) || (scheme.equals(\"https\") && port == 443);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/RequestPartTemplateModel.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport com.github.tomakehurst.wiremock.http.Body;\nimport java.util.Map;\nimport java.util.StringJoiner;\nimport java.util.TreeMap;\n\npublic class RequestPartTemplateModel {\n\n  private final String name;\n  private final Map<String, ListOrSingle<String>> headers;\n  private final Body body;\n\n  public RequestPartTemplateModel(\n      String name, Map<String, ListOrSingle<String>> headers, Body body) {\n    this.name = name;\n    this.headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);\n    this.headers.putAll(headers);\n    this.body = body;\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  public Map<String, ListOrSingle<String>> getHeaders() {\n    return headers;\n  }\n\n  public String getBody() {\n    return body.asString();\n  }\n\n  public String getBodyAsBase64() {\n    return body.asBase64();\n  }\n\n  public boolean isBinary() {\n    return body.isBinary();\n  }\n\n  @Override\n  public String toString() {\n    return new StringJoiner(\", \", \"[\", \"]\")\n        .add(\"name='\" + name + \"'\")\n        .add(\"headers=\" + headers)\n        .add(\"body=\" + body.asString())\n        .toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/RequestTemplateModel.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport com.github.tomakehurst.wiremock.http.Body;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport java.util.Map;\n\npublic class RequestTemplateModel {\n\n  private final String id;\n  private final RequestLine requestLine;\n  private final Map<String, ListOrSingle<String>> headers;\n  private final Map<String, ListOrSingle<String>> cookies;\n\n  private final boolean isMultipart;\n  private final Body body;\n  private final Map<String, RequestPartTemplateModel> parts;\n\n  protected RequestTemplateModel(\n      String id,\n      RequestLine requestLine,\n      Map<String, ListOrSingle<String>> headers,\n      Map<String, ListOrSingle<String>> cookies,\n      boolean isMultipart,\n      Body body,\n      Map<String, RequestPartTemplateModel> parts) {\n    this.id = id;\n    this.requestLine = requestLine;\n    this.headers = headers;\n    this.cookies = cookies;\n    this.isMultipart = isMultipart;\n    this.body = body;\n    this.parts = parts;\n  }\n\n  public String getId() {\n    return id;\n  }\n\n  @Deprecated\n  /**\n   * @deprecated Use the direct accessors\n   */\n  public RequestLine getRequestLine() {\n    return requestLine;\n  }\n\n  public RequestMethod getMethod() {\n    return requestLine.getMethod();\n  }\n\n  public Object getPathSegments() {\n    return requestLine.getPathSegments();\n  }\n\n  public Object getPath() {\n    return requestLine.getPathSegments();\n  }\n\n  public String getUrl() {\n    return requestLine.getUrl();\n  }\n\n  public Map<String, ListOrSingle<String>> getQuery() {\n    return requestLine.getQuery();\n  }\n\n  public String getScheme() {\n    return requestLine.getScheme();\n  }\n\n  public String getHost() {\n    return requestLine.getHost();\n  }\n\n  public int getPort() {\n    return requestLine.getPort();\n  }\n\n  public String getBaseUrl() {\n    return requestLine.getBaseUrl();\n  }\n\n  public Map<String, ListOrSingle<String>> getHeaders() {\n    return headers;\n  }\n\n  public Map<String, ListOrSingle<String>> getCookies() {\n    return cookies;\n  }\n\n  public String getBody() {\n    return body.asString();\n  }\n\n  public String getBodyAsBase64() {\n    return body.asBase64();\n  }\n\n  public boolean isBinary() {\n    return body.isBinary();\n  }\n\n  public boolean isMultipart() {\n    return isMultipart;\n  }\n\n  public Map<String, RequestPartTemplateModel> getParts() {\n    return parts;\n  }\n\n  public String getClientIp() {\n    return requestLine.getClientIp();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/ResponseTemplateTransformer.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.serverError;\n\nimport com.github.jknack.handlebars.HandlebarsException;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport com.github.tomakehurst.wiremock.extension.*;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport java.nio.charset.StandardCharsets;\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport org.jspecify.annotations.NullMarked;\n\npublic class ResponseTemplateTransformer\n    implements StubLifecycleListener, ResponseDefinitionTransformerV2 {\n\n  public static final String NAME = \"response-template\";\n\n  private final boolean global;\n  private final FileSource files;\n  private final TemplateEngine templateEngine;\n\n  private final List<TemplateModelDataProviderExtension> templateModelDataProviders;\n\n  public ResponseTemplateTransformer(\n      TemplateEngine templateEngine,\n      boolean global,\n      FileSource files,\n      List<TemplateModelDataProviderExtension> templateModelDataProviders) {\n    this.templateEngine = templateEngine;\n    this.global = global;\n    this.files = files;\n    this.templateModelDataProviders = templateModelDataProviders;\n  }\n\n  @Override\n  public boolean applyGlobally() {\n    return global;\n  }\n\n  @Override\n  public String getName() {\n    return NAME;\n  }\n\n  @Override\n  public ResponseDefinition transform(ServeEvent serveEvent) {\n    try {\n      final Request request = serveEvent.getRequest();\n      final ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();\n      final Parameters parameters = responseDefinition.getTransformerParameters();\n\n      ResponseDefinitionBuilder newResponseDefBuilder =\n          ResponseDefinitionBuilder.like(responseDefinition);\n\n      final Map<String, Object> model = templateEngine.buildModelForRequest(serveEvent);\n      model.putAll(addExtraModelElements(request, responseDefinition, files, parameters));\n\n      if (responseDefinition.specifiesTextBodyContent()) {\n        boolean isJsonBody = responseDefinition.getReponseBody().isJson();\n        HandlebarsOptimizedTemplate bodyTemplate =\n            templateEngine.getTemplate(\n                HttpTemplateCacheKey.forInlineBody(responseDefinition),\n                responseDefinition.getTextBody());\n        applyTemplatedResponseBody(newResponseDefBuilder, model, bodyTemplate, isJsonBody);\n      } else if (responseDefinition.specifiesBodyFile()) {\n        HandlebarsOptimizedTemplate filePathTemplate =\n            templateEngine.getUncachedTemplate(responseDefinition.getBodyFileName());\n        String compiledFilePath = uncheckedApplyTemplate(filePathTemplate, model);\n\n        boolean disableBodyFileTemplating =\n            parameters.getBoolean(\"disableBodyFileTemplating\", false);\n        if (disableBodyFileTemplating) {\n          newResponseDefBuilder.withBodyFile(compiledFilePath);\n        } else {\n          TextFile file = files.getTextFileNamed(compiledFilePath);\n          HandlebarsOptimizedTemplate bodyTemplate =\n              templateEngine.getTemplate(\n                  HttpTemplateCacheKey.forFileBody(responseDefinition, compiledFilePath),\n                  file.readContentsAsString());\n          applyTemplatedResponseBody(newResponseDefBuilder, model, bodyTemplate, false);\n        }\n      }\n\n      {\n        List<HttpHeader> newResponseHeaders =\n            responseDefinition.getHeaders().all().stream()\n                .map(\n                    header -> {\n                      ArrayList<String> valueListBuilder = new ArrayList<>();\n                      int index = 0;\n                      for (String headerValue : header.values()) {\n                        HandlebarsOptimizedTemplate template =\n                            templateEngine.getTemplate(\n                                HttpTemplateCacheKey.forHeader(\n                                    responseDefinition, header.key(), index++),\n                                headerValue);\n                        valueListBuilder.add(uncheckedApplyTemplate(template, model));\n                      }\n\n                      return new HttpHeader(header.key(), valueListBuilder);\n                    })\n                .collect(Collectors.toList());\n        newResponseDefBuilder.withHeaders(new HttpHeaders(newResponseHeaders));\n      }\n\n      if (responseDefinition.getProxyBaseUrl() != null) {\n        HandlebarsOptimizedTemplate proxyBaseUrlTemplate =\n            templateEngine.getTemplate(\n                HttpTemplateCacheKey.forProxyUrl(responseDefinition),\n                responseDefinition.getProxyBaseUrl());\n        String newProxyBaseUrl = uncheckedApplyTemplate(proxyBaseUrlTemplate, model);\n\n        ResponseDefinitionBuilder.ProxyResponseDefinitionBuilder newProxyResponseDefBuilder =\n            newResponseDefBuilder.proxiedFrom(newProxyBaseUrl);\n\n        {\n          List<HttpHeader> newResponseHeaders =\n              responseDefinition.getAdditionalProxyRequestHeaders().all().stream()\n                  .map(\n                      header -> {\n                        ArrayList<String> valueListBuilder = new ArrayList<>();\n                        int index = 0;\n                        for (String headerValue : header.values()) {\n                          HandlebarsOptimizedTemplate template =\n                              templateEngine.getTemplate(\n                                  HttpTemplateCacheKey.forHeader(\n                                      responseDefinition, header.key(), index++),\n                                  headerValue);\n                          valueListBuilder.add(uncheckedApplyTemplate(template, model));\n                        }\n                        return new HttpHeader(header.key(), valueListBuilder);\n                      })\n                  .collect(Collectors.toList());\n          newProxyResponseDefBuilder.withAdditionalRequestHeaders(\n              new HttpHeaders(newResponseHeaders));\n        }\n\n        return newProxyResponseDefBuilder.build();\n      } else {\n        return newResponseDefBuilder.build();\n      }\n    } catch (HandlebarsException he) {\n      final String message = cleanUpHandlebarsErrorMessage(he);\n      serveEvent.appendSubEvent(SubEvent.error(message));\n      return serverError()\n          .withHeader(ContentTypeHeader.KEY, \"text/plain\")\n          .withBody(message)\n          .build();\n    }\n  }\n\n  private static String cleanUpHandlebarsErrorMessage(HandlebarsException t) {\n    String rawMessage;\n    if (t.getCause() instanceof JsonException) {\n      rawMessage = ((JsonException) t.getCause()).getErrors().first().getDetail();\n    } else {\n      rawMessage = t.getMessage() == null ? \"\" : t.getMessage();\n    }\n\n    var message =\n        rawMessage\n            .replaceAll(\"\\\\n\\\\s*inline@[a-z0-9]+:\\\\S+$\", \"\")\n            .replaceAll(\"inline@[a-z0-9]+:\", \"\");\n    return \"[ERROR] \" + message;\n  }\n\n  /** Override this to add extra elements to the template model */\n  protected Map<String, Object> addExtraModelElements(\n      Request request,\n      ResponseDefinition responseDefinition,\n      FileSource files,\n      Parameters parameters) {\n    return Collections.emptyMap();\n  }\n\n  private void applyTemplatedResponseBody(\n      ResponseDefinitionBuilder newResponseDefBuilder,\n      Map<String, Object> model,\n      HandlebarsOptimizedTemplate bodyTemplate,\n      boolean isJsonBody) {\n    String bodyString = uncheckedApplyTemplate(bodyTemplate, model);\n    Body body =\n        isJsonBody\n            ? Body.fromJsonBytes(bodyString.getBytes(StandardCharsets.UTF_8))\n            : Body.fromOneOf(null, bodyString, null, null);\n    newResponseDefBuilder.withResponseBody(body);\n  }\n\n  private String uncheckedApplyTemplate(HandlebarsOptimizedTemplate template, Object context) {\n    return template.apply(context);\n  }\n\n  @Override\n  @NullMarked\n  public void afterStubRemoved(StubMapping stub) {\n    templateEngine.invalidateCache();\n  }\n\n  @Override\n  public void afterStubsReset() {\n    templateEngine.invalidateCache();\n  }\n\n  public long getCacheSize() {\n    return templateEngine.getCacheSize();\n  }\n\n  public Long getMaxCacheEntries() {\n    return templateEngine.getMaxCacheEntries();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/SystemKeyAuthoriser.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport static java.util.regex.Pattern.CASE_INSENSITIVE;\n\nimport java.util.HashSet;\nimport java.util.Set;\nimport java.util.regex.Pattern;\n\npublic class SystemKeyAuthoriser {\n\n  private final Set<Pattern> regexes = new HashSet<>();\n\n  public SystemKeyAuthoriser(Set<String> patterns) {\n    if (patterns == null || patterns.isEmpty()) {\n      patterns = Set.of(\"wiremock.*\");\n    }\n\n    for (String pattern : patterns) {\n      regexes.add(Pattern.compile(pattern, CASE_INSENSITIVE));\n    }\n  }\n\n  public boolean isPermitted(String key) {\n    for (Pattern regex : regexes) {\n      if (regex.matcher(key).matches()) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/TemplateEngine.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport static java.util.Collections.emptyList;\nimport static java.util.Collections.emptyMap;\n\nimport com.github.jknack.handlebars.EscapingStrategy;\nimport com.github.jknack.handlebars.Handlebars;\nimport com.github.jknack.handlebars.Helper;\nimport com.github.jknack.handlebars.helper.ConditionalHelpers;\nimport com.github.jknack.handlebars.helper.StringHelpers;\nimport com.github.jknack.handlebars.helper.ext.AssignHelper;\nimport com.github.jknack.handlebars.helper.ext.NumberHelper;\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.TemplateModelDataProviderExtension;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.SystemValueHelper;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.WireMockHelpers;\nimport com.github.tomakehurst.wiremock.http.Body;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.google.common.cache.Cache;\nimport com.google.common.cache.CacheBuilder;\nimport com.google.common.collect.Maps;\nimport com.google.common.util.concurrent.ExecutionError;\nimport com.google.common.util.concurrent.UncheckedExecutionException;\nimport java.util.*;\nimport java.util.concurrent.ExecutionException;\nimport java.util.stream.Collectors;\n\npublic class TemplateEngine {\n\n  private final Handlebars handlebars;\n  private final Cache<Object, HandlebarsOptimizedTemplate> cache;\n  private final Long maxCacheEntries;\n\n  private final List<TemplateModelDataProviderExtension> templateModelDataProviders;\n\n  public static TemplateEngine defaultTemplateEngine() {\n    return new TemplateEngine(emptyMap(), null, null, false, emptyList());\n  }\n\n  public TemplateEngine(\n      Map<String, Helper<?>> helpers,\n      Long maxCacheEntries,\n      Set<String> permittedSystemKeys,\n      boolean escapingDisabled,\n      List<TemplateModelDataProviderExtension> templateModelDataProviders) {\n\n    this.handlebars =\n        escapingDisabled ? new Handlebars().with(EscapingStrategy.NOOP) : new Handlebars();\n\n    this.maxCacheEntries = maxCacheEntries;\n    this.templateModelDataProviders = templateModelDataProviders;\n    CacheBuilder<Object, Object> cacheBuilder = CacheBuilder.newBuilder();\n    if (maxCacheEntries != null) {\n      cacheBuilder.maximumSize(maxCacheEntries);\n    }\n    cache = cacheBuilder.build();\n\n    addHelpers(helpers, permittedSystemKeys);\n  }\n\n  protected TemplateEngine() {\n    this.handlebars = null;\n    this.maxCacheEntries = null;\n    this.cache = null;\n    this.templateModelDataProviders = emptyList();\n  }\n\n  private void addHelpers(Map<String, Helper<?>> helpers, Set<String> permittedSystemKeys) {\n    for (StringHelpers helper : StringHelpers.values()) {\n      if (!helper.name().equals(\"now\")) {\n        this.handlebars.registerHelper(helper.name(), helper);\n      }\n    }\n\n    for (NumberHelper helper : NumberHelper.values()) {\n      this.handlebars.registerHelper(helper.name(), helper);\n    }\n\n    for (ConditionalHelpers helper : ConditionalHelpers.values()) {\n      this.handlebars.registerHelper(helper.name(), helper);\n    }\n\n    this.handlebars.registerHelper(AssignHelper.NAME, new AssignHelper());\n\n    // Add all available wiremock helpers\n    for (WireMockHelpers helper : WireMockHelpers.values()) {\n      this.handlebars.registerHelper(helper.name(), helper);\n    }\n\n    this.handlebars.registerHelper(\n        \"systemValue\", new SystemValueHelper(new SystemKeyAuthoriser(permittedSystemKeys)));\n\n    for (Map.Entry<String, Helper<?>> entry : helpers.entrySet()) {\n      this.handlebars.registerHelper(entry.getKey(), entry.getValue());\n    }\n  }\n\n  public HandlebarsOptimizedTemplate getTemplate(final Object key, final String content) {\n    if (maxCacheEntries != null && maxCacheEntries < 1) {\n      return getUncachedTemplate(content);\n    }\n\n    try {\n      return cache.get(key, () -> new HandlebarsOptimizedTemplate(handlebars, content));\n    } catch (ExecutionException | UncheckedExecutionException | ExecutionError e) {\n      return Exceptions.throwUnchecked(e.getCause(), null);\n    }\n  }\n\n  public HandlebarsOptimizedTemplate getUncachedTemplate(final String content) {\n    return new HandlebarsOptimizedTemplate(handlebars, content);\n  }\n\n  public Map<String, Object> buildModelForRequest(ServeEvent serveEvent) {\n    final ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();\n    final Parameters parameters = responseDefinition.getTransformerParameters();\n\n    final Map<String, Object> additionalModelData =\n        templateModelDataProviders.stream()\n            .map(provider -> provider.provideTemplateModelData(serveEvent).entrySet())\n            .flatMap(Set::stream)\n            .collect(\n                Collectors.toMap(\n                    Map.Entry::getKey,\n                    Map.Entry::getValue,\n                    (e1, e2) -> {\n                      throw new IllegalStateException(\"Duplicate model key\");\n                    },\n                    LinkedHashMap::new));\n\n    final Map<String, Object> model = new HashMap<>();\n    model.put(\"parameters\", parameters);\n    model.put(\"request\", buildRequestModel(serveEvent.getRequest()));\n    model.putAll(additionalModelData);\n    return model;\n  }\n\n  public Map<String, Object> buildModelForRequest(Request request) {\n    final Map<String, Object> model = new HashMap<>();\n    model.put(\"request\", buildRequestModel(request));\n    return model;\n  }\n\n  private static RequestTemplateModel buildRequestModel(Request request) {\n    RequestLine requestLine = RequestLine.fromRequest(request);\n    Map<String, ListOrSingle<String>> adaptedHeaders = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);\n    adaptedHeaders.putAll(\n        Maps.toMap(\n            request.getAllHeaderKeys(), input -> ListOrSingle.of(request.header(input).values())));\n    Map<String, ListOrSingle<String>> adaptedCookies =\n        Maps.transformValues(request.getCookies(), cookie -> ListOrSingle.of(cookie.getValues()));\n\n    return new RequestTemplateModel(\n        request.getId() != null ? request.getId().toString() : null,\n        requestLine,\n        adaptedHeaders,\n        adaptedCookies,\n        request.isMultipart(),\n        Body.ofBinaryOrText(request.getBody(), request.contentTypeHeader()),\n        buildRequestPartModel(request));\n  }\n\n  private static Map<String, RequestPartTemplateModel> buildRequestPartModel(Request request) {\n\n    if (request.isMultipart()) {\n      String contentType = request.getHeader(\"Content-Type\");\n      boolean isMultipartRelated = contentType != null && contentType.contains(\"multipart/related\");\n\n      if (isMultipartRelated) {\n        Map<String, RequestPartTemplateModel> result = new LinkedHashMap<>();\n        int partIndex = 0;\n        for (Request.Part part : request.getParts()) {\n          String key = part.getName() != null ? part.getName() : \"part-\" + partIndex++;\n          result.put(\n              key,\n              new RequestPartTemplateModel(\n                  key,\n                  part.getHeaders().all().stream()\n                      .collect(\n                          Collectors.toMap(\n                              HttpHeader::key,\n                              header -> ListOrSingle.of(header.values()),\n                              (e1, e2) -> {\n                                throw new IllegalStateException(\"Duplicate header name\");\n                              },\n                              LinkedHashMap::new)),\n                  part.getBody()));\n        }\n\n        return result;\n      } else {\n        return request.getParts().stream()\n            .collect(\n                Collectors.toMap(\n                    Request.Part::getName,\n                    part ->\n                        new RequestPartTemplateModel(\n                            part.getName(),\n                            part.getHeaders().all().stream()\n                                .collect(\n                                    Collectors.toMap(\n                                        HttpHeader::key,\n                                        header -> ListOrSingle.of(header.values()),\n                                        (e1, e2) -> {\n                                          throw new IllegalStateException(\"Duplicate header name\");\n                                        },\n                                        LinkedHashMap::new)),\n                            part.getBody()),\n                    (e1, e2) -> {\n                      throw new IllegalStateException(\"Duplicate request part name\");\n                    },\n                    LinkedHashMap::new));\n      }\n    }\n\n    return Collections.emptyMap();\n  }\n\n  public long getCacheSize() {\n    return cache.size();\n  }\n\n  public void invalidateCache() {\n    cache.invalidateAll();\n  }\n\n  public Long getMaxCacheEntries() {\n    return maxCacheEntries;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/TemplatedUrlPath.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport java.util.Iterator;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport org.wiremock.url.Path;\nimport org.wiremock.url.PathAndQuery;\nimport org.wiremock.url.Segment;\n\npublic class TemplatedUrlPath extends LinkedHashMap<String, String> implements Iterable<String> {\n\n  private final Path originalPath;\n\n  public TemplatedUrlPath(PathAndQuery url, PathParams pathParams) {\n    this.originalPath = url.getPath();\n    addAllPathSegments();\n    putAll(pathParams);\n  }\n\n  private void addAllPathSegments() {\n    final List<Segment> pathSegments = originalPath.getSegments();\n    int i = 0;\n    for (Segment pathNode : pathSegments) {\n      if (!pathNode.isEmpty()) {\n        String key = String.valueOf(i++);\n        put(key, pathNode.toString());\n      }\n    }\n  }\n\n  @Override\n  public String toString() {\n    return originalPath.toString();\n  }\n\n  @Override\n  public Iterator<String> iterator() {\n    return originalPath.getSegments().stream().map(Object::toString).iterator();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/UrlPath.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating;\n\nimport java.util.ArrayList;\nimport org.wiremock.url.Path;\nimport org.wiremock.url.PathAndQuery;\n\npublic class UrlPath extends ArrayList<String> {\n\n  private final String originalPath;\n\n  public UrlPath(PathAndQuery url) {\n    Path path = url.getPath();\n    originalPath = path.toString();\n    path.getSegments()\n        .forEach(\n            pathNode -> {\n              if (!pathNode.isEmpty()) {\n                add(pathNode.toString());\n              }\n            });\n  }\n\n  @Override\n  public String toString() {\n    return originalPath;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/AbstractArrayHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport java.util.List;\n\npublic abstract class AbstractArrayHelper extends HandlebarsHelper<List<?>> {\n\n  protected Integer parsePosition(Options options) {\n    final Object positionSpec = options.hash(\"position\", \"end\");\n    Integer position;\n    if (positionSpec.toString().equalsIgnoreCase(\"start\")) {\n      position = 0;\n    } else if (positionSpec.toString().equalsIgnoreCase(\"end\")) {\n      position = null;\n    } else if (positionSpec instanceof Integer) {\n      position = (Integer) positionSpec;\n    } else {\n      position = Integer.parseInt(positionSpec.toString());\n    }\n\n    return position;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/AbstractFormattingHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport java.io.IOException;\nimport java.util.Arrays;\n\npublic abstract class AbstractFormattingHelper extends HandlebarsHelper<Object> {\n\n  abstract String getName();\n\n  abstract String getDataFormat();\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    // get the trimmed contents and make sure it isn't empty\n    String bodyText;\n    if (options.tagType == TagType.SECTION) {\n      bodyText = options.fn().toString().trim();\n    } else if (context instanceof CharSequence) {\n      bodyText = context.toString().trim();\n    } else {\n      bodyText = \"\";\n    }\n\n    if (bodyText.isEmpty()) {\n      return handleError(\n          String.format(\n              \"%s should take a block of %s to format or a single parameter of type String\",\n              getName(), getDataFormat()));\n    }\n\n    // get the format field and default to pretty\n    Object formatOption = options.hash.get(\"format\");\n    Format format;\n    if (formatOption == null) {\n      format = Format.pretty;\n    } else if (formatOption instanceof Format) {\n      format = (Format) formatOption;\n    } else if (formatOption instanceof CharSequence) {\n      try {\n        format = Format.valueOf(formatOption.toString());\n      } catch (IllegalArgumentException e) {\n        return handleError(\n            String.format(\n                \"%s: format [%s] should be one of %s\",\n                getName(), formatOption, Arrays.toString(Format.values())));\n      }\n    } else {\n      return handleError(\n          String.format(\n              \"%s: format [%s] of type [%s should be a %s or a String and one of %s]\",\n              getName(),\n              formatOption,\n              formatOption.getClass().getName(),\n              Format.class.getSimpleName(),\n              Arrays.toString(Format.values())));\n    }\n\n    return apply(bodyText, format);\n  }\n\n  protected abstract String apply(String bodyText, Format format);\n\n  public enum Format {\n    pretty,\n    compact,\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ArrayAddHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static java.util.Collections.emptyList;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class ArrayAddHelper extends AbstractArrayHelper {\n\n  @Override\n  public Object apply(List<?> list, Options options) throws IOException {\n    if (list == null) {\n      return emptyList();\n    }\n\n    final ArrayList<Object> mutableList = new ArrayList<>(list);\n\n    if (options.params.length == 0) {\n      return handleError(\"Missing required parameter: additional value to add to list\");\n    }\n\n    final Object newValue = options.params[0];\n\n    Integer position;\n    try {\n      position = parsePosition(options);\n    } catch (NumberFormatException e) {\n      return handleError(\"position must be 'start', 'end' or an integer\");\n    }\n\n    if (position != null) {\n      if (position < 0 || position > mutableList.size()) {\n        return handleError(\n            \"position must be greater than or equal to 0 and less than or equal to the size of the list\");\n      }\n      mutableList.add(position, newValue);\n    } else {\n      mutableList.add(newValue);\n    }\n\n    return mutableList;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ArrayHelper.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static java.util.Arrays.asList;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class ArrayHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    if (context == null || context == options.context.model()) {\n      return List.of();\n    }\n\n    List<Object> list = new ArrayList<>();\n    list.add(context);\n    list.addAll(asList(options.params));\n\n    return list;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ArrayRemoveHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class ArrayRemoveHelper extends AbstractArrayHelper {\n\n  @Override\n  public Object apply(List<?> list, Options options) throws IOException {\n    Integer position;\n    try {\n      position = parsePosition(options);\n    } catch (NumberFormatException e) {\n      return handleError(\"position must be 'start', 'end' or an integer\");\n    }\n\n    final Integer positionToRemove = getFirstNonNull(position, list.size() - 1);\n    final ArrayList<Object> mutableList = new ArrayList<>(list);\n    if (position != null && (position < 0 || position > mutableList.size())) {\n      return handleError(\n          \"position must be greater than or equal to 0 and less than or equal to the size of the list\");\n    }\n    mutableList.remove((int) positionToRemove);\n\n    return mutableList;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/Base64Helper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.decodeBase64;\nimport static com.github.tomakehurst.wiremock.common.Encoding.encodeBase64;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport java.io.IOException;\n\npublic class Base64Helper implements Helper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    String value =\n        options.tagType == TagType.SECTION ? options.fn(context).toString() : context.toString();\n\n    if (Boolean.TRUE.equals(options.hash.get(\"decode\"))) {\n      return new String(decodeBase64(value));\n    }\n\n    Object paddingOption = options.hash.get(\"padding\");\n    boolean padding = paddingOption == null || Boolean.TRUE.equals(paddingOption);\n    return encodeBase64(value.getBytes(), padding);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ContainsHelper.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport java.io.IOException;\nimport java.util.Collection;\n\npublic class ContainsHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    if (options.params.length < 1) {\n      return handleError(\n          \"You must specify the string or array to be matched and the regular expression\");\n    }\n\n    String expected = options.param(0);\n\n    if (context == null || expected == null) {\n      return false;\n    }\n\n    boolean isMatch =\n        Collection.class.isAssignableFrom(context.getClass())\n            ? ((Collection<?>) context).contains(expected)\n            : context.toString().contains(expected);\n\n    if (options.tagType == TagType.SECTION) {\n      return isMatch ? options.apply(options.fn) : \"\";\n    }\n\n    return isMatch;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/FormDataHelper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport java.util.Map;\n\npublic class FormDataHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) {\n    Map<String, ListOrSingle<String>> formData =\n        FormParser.parse(\n            context.toString(),\n            Boolean.TRUE.equals(options.hash.get(\"urlDecode\")),\n            getFirstNonNull(options.hash.get(\"encoding\"), \"utf-8\").toString());\n\n    if (options.params.length > 0) {\n      String variableName = options.param(0);\n      options.context.data(variableName, formData);\n      return null;\n    }\n\n    return formData;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/FormParser.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport java.net.URLDecoder;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\n\npublic class FormParser {\n\n  public static Map<String, ListOrSingle<String>> parse(String formText, boolean urlDecode) {\n    return parse(formText, urlDecode, \"utf-8\");\n  }\n\n  public static Map<String, ListOrSingle<String>> parse(\n      String formText, boolean urlDecode, String encoding) {\n    Map<String, ListOrSingle<String>> map = new LinkedHashMap<>();\n\n    for (String formField : formText.split(\"&\")) {\n      String[] parts = formField.split(\"=\");\n      if (parts.length > 1) {\n        String key = parts[0];\n        String value = urlDecode ? urlDecode(parts[1].trim(), encoding) : parts[1].trim();\n\n        ListOrSingle<String> existing = map.get(key);\n        if (existing != null) {\n          existing.add(value);\n        } else {\n          map.put(key, ListOrSingle.of(value));\n        }\n      }\n    }\n\n    return map;\n  }\n\n  private static String urlDecode(String text, String encoding) {\n    try {\n      return URLDecoder.decode(text, encoding);\n    } catch (Exception e) {\n      return throwUnchecked(e, String.class);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/FormatJsonHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\n\n/**\n * Handlebars helper to allow JSON to be formatted:\n *\n * <p>```handlebars {{#formatJson format='pretty'}} // Badly formatted JSON {{/formatJson}}```\n * `format` can be `pretty` or `compact` and defaults to `pretty`\n */\npublic class FormatJsonHelper extends AbstractFormattingHelper {\n\n  @Override\n  String getName() {\n    return \"formatJson\";\n  }\n\n  @Override\n  String getDataFormat() {\n    return \"JSON\";\n  }\n\n  @Override\n  protected String apply(String bodyText, Format format) {\n    try {\n      switch (format) {\n        case pretty:\n          return Json.prettyPrint(bodyText);\n        case compact:\n          return Json.node(bodyText).toString();\n        default:\n          throw new IllegalStateException();\n      }\n    } catch (JsonException e) {\n      return handleError(\n          \"There was an error parsing the json. Please make sure the json is valid\", e);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/FormatXmlHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static javax.xml.transform.OutputKeys.INDENT;\nimport static javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION;\n\nimport com.github.tomakehurst.wiremock.common.xml.Xml;\nimport com.github.tomakehurst.wiremock.common.xml.XmlException;\nimport java.io.IOException;\nimport java.io.StringReader;\nimport java.io.StringWriter;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.xml.XMLConstants;\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\nimport javax.xml.transform.Transformer;\nimport javax.xml.transform.TransformerException;\nimport javax.xml.transform.TransformerFactory;\nimport javax.xml.transform.dom.DOMSource;\nimport javax.xml.transform.stream.StreamResult;\nimport org.w3c.dom.Attr;\nimport org.w3c.dom.Document;\nimport org.w3c.dom.Node;\nimport org.w3c.dom.Text;\nimport org.xml.sax.InputSource;\nimport org.xml.sax.SAXException;\n\n/**\n * Handlebars helper to allow xml to be formatted :\n *\n * <p>```handlebars {{#formatXml format='pretty'}} // Badly formatted XML {{/formatXml}} ```\n * `format` can be `pretty` or `compact` and defaults to `pretty`\n */\npublic class FormatXmlHelper extends AbstractFormattingHelper {\n\n  @Override\n  String getName() {\n    return \"formatXml\";\n  }\n\n  @Override\n  String getDataFormat() {\n    return \"XML\";\n  }\n\n  private final DocumentBuilderFactory documentBuilderFactory =\n      Xml.DEFAULT_DOCUMENT_BUILDER_FACTORY;\n\n  private final TransformerFactory transformerFactory;\n\n  public FormatXmlHelper() {\n    TransformerFactory factory = TransformerFactory.newDefaultInstance();\n    factory.setAttribute(\"indent-number\", 2);\n    factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, \"\");\n    factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, \"\");\n    transformerFactory = factory;\n  }\n\n  @Override\n  protected String apply(String bodyText, Format format) {\n    try {\n      var xml = read(bodyText);\n      switch (format) {\n        case pretty:\n          return print(xml, \"yes\");\n        case compact:\n          return print(xml, \"no\");\n        default:\n          throw new IllegalStateException();\n      }\n    } catch (XmlException\n        | ParserConfigurationException\n        | IOException\n        | SAXException\n        | TransformerException e) {\n      return handleError(\"Input is not valid XML\", e);\n    }\n  }\n\n  private Document read(String xml) throws ParserConfigurationException, IOException, SAXException {\n    try {\n      DocumentBuilder db = documentBuilderFactory.newDocumentBuilder();\n      Document doc = db.parse(new InputSource(new StringReader(xml)));\n      return removeBlankTextNodes(doc);\n    } catch (SAXException e) {\n      throw XmlException.fromSaxException(e);\n    }\n  }\n\n  private <T extends Node> T removeBlankTextNodes(T node) {\n    List<Node> toRemove = new ArrayList<>();\n    if (!(node instanceof Attr)) {\n      for (int i = 0; i < node.getChildNodes().getLength(); i++) {\n        Node child = node.getChildNodes().item(i);\n        if (isBlankTextNode(child)) {\n          toRemove.add(child);\n        } else {\n          removeBlankTextNodes(child);\n        }\n      }\n      for (Node child : toRemove) {\n        node.removeChild(child);\n      }\n    }\n    return node;\n  }\n\n  private boolean isBlankTextNode(Node node) {\n    return (node instanceof Text) && node.getNodeValue().isBlank();\n  }\n\n  private String print(Document doc, String indent) throws TransformerException {\n    Transformer transformer = transformerFactory.newTransformer();\n    transformer.setOutputProperty(INDENT, indent);\n    transformer.setOutputProperty(OMIT_XML_DECLARATION, \"yes\");\n    return writeToString(doc, transformer);\n  }\n\n  private String writeToString(Document doc, Transformer transformer) throws TransformerException {\n    StringWriter writer = new StringWriter();\n    transformer.transform(new DOMSource(doc), new StreamResult(writer));\n    return writer.toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsCurrentDateHelper.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.DateTimeOffset;\nimport java.io.IOException;\nimport java.time.ZoneId;\nimport java.util.Date;\n\npublic class HandlebarsCurrentDateHelper extends HandlebarsHelper<Date> {\n\n  @Override\n  public Object apply(Date context, Options options) throws IOException {\n    String format = options.hash(\"format\", null);\n    String offset = options.hash(\"offset\", null);\n    String timezone = options.hash(\"timezone\", null);\n\n    ZoneId zoneId;\n    Date date;\n\n    if (context instanceof RenderableDate) {\n      date = context;\n      RenderableDate renderableDate = (RenderableDate) context;\n      zoneId = renderableDate.getTimezone();\n    } else {\n      date = context != null ? context : new Date();\n      zoneId = timezone != null ? ZoneId.of(timezone) : null;\n    }\n\n    if (offset != null) {\n      date = DateTimeOffset.fromString(offset).shift(date);\n    }\n\n    return new RenderableDate(date, format, zoneId);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsHelper.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.RequestCache;\n\n/**\n * This abstract class is the base for all defined Handlebars helper in wiremock. It basically\n * allows simpler error handling.\n *\n * @param <T> Type used as context for the Handlebars helper.\n */\npublic abstract class HandlebarsHelper<T> implements Helper<T> {\n\n  public static final String ERROR_PREFIX = \"[ERROR: \";\n  public static final String ERROR_SUFFIX = \"]\";\n\n  /**\n   * Handle invalid helper data without exception details or because none was thrown.\n   *\n   * @param message message to log and return\n   * @return a message which will be used as content\n   */\n  protected String handleError(final String message) {\n    notifier().error(formatMessage(message));\n    return formatMessage(message);\n  }\n\n  /**\n   * Handle invalid helper data with exception details in the log message.\n   *\n   * @param message message to log and return\n   * @param cause which occurred during application of the helper\n   * @return a message which will be used as content\n   */\n  protected String handleError(final String message, final Throwable cause) {\n    notifier().error(formatMessage(message), cause);\n    return formatMessage(message);\n  }\n\n  /**\n   * Handle invalid helper data with exception details in the log message. Also additional\n   * information regarding the issue is written in the logs.\n   *\n   * @param message message to log and return\n   * @param logExclusive additional information just for the log\n   * @param cause which occured during application of the helper\n   * @return a message which will be used as content\n   */\n  protected String handleError(\n      final String message, final String logExclusive, final Throwable cause) {\n    notifier().error(ERROR_PREFIX + message + \" - \" + logExclusive, cause);\n    return formatMessage(message);\n  }\n\n  private String formatMessage(String message) {\n    return ERROR_PREFIX + message + ERROR_SUFFIX;\n  }\n\n  protected static RequestCache getRequestCache(Options options) {\n    return options.get(\"requestCache\", new RequestCache());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsJsonPathHelper.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.RequestCache;\nimport com.jayway.jsonpath.DocumentContext;\nimport com.jayway.jsonpath.InvalidJsonException;\nimport com.jayway.jsonpath.InvalidPathException;\nimport com.jayway.jsonpath.JsonPath;\nimport com.jayway.jsonpath.ParseContext;\nimport java.io.IOException;\n\npublic class HandlebarsJsonPathHelper extends HandlebarsHelper<Object> {\n\n  private final ParseContext parseContext = JsonPath.using(HelperUtils.jsonPathConfig);\n\n  @Override\n  public Object apply(final Object input, final Options options) throws IOException {\n    if (input == null || (input instanceof String && ((String) input).isEmpty())) {\n      return \"\";\n    }\n\n    if (options == null || options.param(0, null) == null) {\n      return this.handleError(\"The JSONPath cannot be empty\");\n    }\n\n    final String jsonPathString = options.param(0);\n\n    try {\n      final DocumentContext jsonDocument = getJsonDocument(input, options);\n      final JsonPath jsonPath = JsonPath.compile(jsonPathString);\n      Object result = getValue(jsonPath, jsonDocument, options);\n      return JsonData.create(result);\n    } catch (InvalidJsonException e) {\n      return this.handleError(input + \" is not valid JSON\", e.getJson(), e);\n    } catch (InvalidPathException e) {\n      return this.handleError(jsonPathString + \" is not a valid JSONPath expression\", e);\n    }\n  }\n\n  private Object getValue(JsonPath jsonPath, DocumentContext jsonDocument, Options options) {\n    RequestCache requestCache = getRequestCache(options);\n    RequestCache.Key cacheKey = RequestCache.Key.keyFor(Object.class, jsonPath, jsonDocument);\n    Object value = requestCache.get(cacheKey);\n    if (value == null) {\n      Object defaultValue = options.hash != null ? options.hash(\"default\") : null;\n      try {\n        value = jsonDocument.read(jsonPath);\n      } catch (Exception e) {\n        value = defaultValue;\n      }\n\n      if (value == null) {\n        value = getFirstNonNull(defaultValue, \"\");\n      }\n\n      requestCache.put(cacheKey, value);\n    }\n\n    return value;\n  }\n\n  private DocumentContext getJsonDocument(Object json, Options options) {\n    RequestCache requestCache = getRequestCache(options);\n    RequestCache.Key cacheKey = RequestCache.Key.keyFor(DocumentContext.class, json);\n    DocumentContext document = requestCache.get(cacheKey);\n    if (document == null) {\n      document =\n          json instanceof String ? parseContext.parse((String) json) : parseContext.parse(json);\n      requestCache.put(cacheKey, document);\n    }\n\n    return document;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsRandomValuesHelper.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.Strings.*;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.UUID;\n\npublic class HandlebarsRandomValuesHelper extends HandlebarsHelper<Void> {\n\n  @Override\n  public Object apply(Void context, Options options) throws IOException {\n    int length = options.hash(\"length\", 36);\n    boolean uppercase = options.hash(\"uppercase\", false);\n\n    String type = options.hash(\"type\", \"ALPHANUMERIC\");\n    String rawValue;\n\n    switch (type) {\n      case \"ALPHANUMERIC\":\n        rawValue = randomAlphanumeric(length);\n        break;\n      case \"ALPHABETIC\":\n        rawValue = randomAlphabetic(length);\n        break;\n      case \"NUMERIC\":\n        rawValue = randomNumeric(length);\n        break;\n      case \"ALPHANUMERIC_AND_SYMBOLS\":\n        rawValue = random(length, 33, 126, false, false);\n        break;\n      case \"UUID\":\n        rawValue = UUID.randomUUID().toString();\n        break;\n      case \"HEXADECIMAL\":\n        rawValue = random(length, \"ABCDEF0123456789\");\n        break;\n      default:\n        rawValue = randomAscii(length);\n        break;\n    }\n    return uppercase ? rawValue.toUpperCase() : rawValue.toLowerCase();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsSoapHelper.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\n/**\n * This class uses HandlebarsXmlHelper as a base an just set a prefix which reduce the written\n * handlebars helper to the relevant part\n */\npublic class HandlebarsSoapHelper extends HandlebarsXPathHelper {\n\n  @Override\n  protected String getXPathPrefix() {\n    return \"/Envelope/Body/\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsXPathHelper.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport com.github.tomakehurst.wiremock.common.RequestCache;\nimport com.github.tomakehurst.wiremock.common.xml.*;\nimport java.io.IOException;\n\n/**\n * This class uses javax.xml.xpath.* for reading a xml via xPath so that the result can be used for\n * response templating.\n */\npublic class HandlebarsXPathHelper extends HandlebarsHelper<String> {\n\n  @Override\n  public Object apply(final String inputXml, final Options options) throws IOException {\n    if (inputXml == null) {\n      return \"\";\n    }\n\n    if (options.param(0, null) == null) {\n      return handleError(\"The XPath expression cannot be empty\");\n    }\n\n    final String xPathInput = options.param(0);\n\n    XmlDocument xmlDocument;\n    try {\n      xmlDocument = getXmlDocument(inputXml, options);\n    } catch (XmlException e) {\n      return handleError(inputXml + \" is not valid XML\");\n    }\n\n    try {\n      ListOrSingle<XmlNode> xmlNodes =\n          getXmlNodes(getXPathPrefix() + xPathInput, xmlDocument, options);\n\n      if (xmlNodes == null || xmlNodes.isEmpty()) {\n        return \"\";\n      }\n\n      return xmlNodes;\n    } catch (XPathException e) {\n      return handleError(xPathInput + \" is not a valid XPath expression\", e);\n    }\n  }\n\n  private ListOrSingle<XmlNode> getXmlNodes(\n      String xPathExpression, XmlDocument doc, Options options) {\n    RequestCache requestCache = getRequestCache(options);\n    RequestCache.Key cacheKey = RequestCache.Key.keyFor(XmlDocument.class, xPathExpression, doc);\n    ListOrSingle<XmlNode> nodes = requestCache.get(cacheKey);\n\n    if (nodes == null) {\n      nodes = doc.findNodes(xPathExpression);\n      requestCache.put(cacheKey, nodes);\n    }\n\n    return nodes;\n  }\n\n  private XmlDocument getXmlDocument(String xml, Options options) {\n    RequestCache requestCache = getRequestCache(options);\n    RequestCache.Key cacheKey = RequestCache.Key.keyFor(XmlDocument.class, xml);\n    XmlDocument document = requestCache.get(cacheKey);\n    if (document == null) {\n      document = Xml.parse(xml);\n      requestCache.put(cacheKey, document);\n    }\n\n    return document;\n  }\n\n  /**\n   * No prefix by default. It allows to extend this class with a specified prefix. Just overwrite\n   * this method to do so.\n   *\n   * @return a prefix which will be applied before the specified xpath.\n   */\n  protected String getXPathPrefix() {\n    return \"\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HelperUtils.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.jayway.jsonpath.Configuration;\nimport com.jayway.jsonpath.Option;\nimport com.jayway.jsonpath.spi.json.JacksonJsonProvider;\n\npublic class HelperUtils {\n\n  public static Integer coerceToInt(Object value) {\n    if (value == null) {\n      return null;\n    }\n\n    if (Number.class.isAssignableFrom(value.getClass())) {\n      return ((Number) value).intValue();\n    }\n\n    if (CharSequence.class.isAssignableFrom(value.getClass())) {\n      return Integer.parseInt(value.toString());\n    }\n\n    return null;\n  }\n\n  public static Double coerceToDouble(Object value) {\n    if (value == null) {\n      return null;\n    }\n\n    if (Number.class.isAssignableFrom(value.getClass())) {\n      return ((Number) value).doubleValue();\n    }\n\n    if (CharSequence.class.isAssignableFrom(value.getClass())) {\n      return Double.parseDouble(value.toString());\n    }\n\n    return null;\n  }\n\n  static final Configuration jsonPathConfig =\n      Configuration.defaultConfiguration()\n          .addOptions(Option.DEFAULT_PATH_LEAF_TO_NULL)\n          // Explicitly use Jackson for JSON parsing because the default provider allows invalid\n          // JSON to be parsed as a JSON string in certain circumstances, which, in my opinion,\n          // creates a confusing user experience.\n          .jsonProvider(new JacksonJsonProvider(Json.getObjectMapper()));\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HostnameHelper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\n\nimport com.github.jknack.handlebars.Options;\nimport java.net.InetAddress;\n\npublic class HostnameHelper extends HandlebarsHelper<Object> {\n\n  private static String HOSTNAME;\n\n  static {\n    try {\n      HOSTNAME = InetAddress.getLocalHost().getHostName();\n    } catch (Exception e) {\n      notifier()\n          .error(\n              \"Failed to look up localhost. {{hostname}} Handlebars helper will return localhost.\",\n              e);\n      HOSTNAME = \"localhost\";\n    }\n  }\n\n  @Override\n  public Object apply(Object context, Options options) {\n    return HOSTNAME;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JoinHelper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport java.io.IOException;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class JoinHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n\n    if (!(context instanceof String)) {\n      return handleError(\"Separator parameter must be a String\");\n    }\n\n    String separator = (String) context;\n\n    List<Object> items;\n    Object firstParam = options.param(0, null);\n    if (firstParam == null) {\n      return handleError(\"The parameter must be list\");\n    } else if (Iterable.class.isAssignableFrom(firstParam.getClass())) {\n      items = (List<Object>) firstParam;\n    } else {\n      items = Arrays.asList(options.params);\n    }\n\n    String prefix = options.hash(\"prefix\", \"\");\n    String suffix = options.hash(\"suffix\", \"\");\n\n    if (items.isEmpty()) {\n      return \"\";\n    }\n    String result;\n    if (options.tagType == TagType.SECTION) {\n      result = processSection(options, separator, items);\n    } else {\n      result = processWithoutSection(separator, items);\n    }\n\n    return prefix + result + suffix;\n  }\n\n  private static String processWithoutSection(String separator, List<Object> items) {\n    StringBuilder sb = new StringBuilder();\n    boolean initialised = false;\n\n    for (Object item : items) {\n      if (initialised) {\n        sb.append(separator);\n      }\n      sb.append(item.toString());\n      initialised = true;\n    }\n    return sb.toString();\n  }\n\n  private static String processSection(Options options, String separator, List<Object> list)\n      throws IOException {\n    StringBuilder sb = new StringBuilder();\n    for (int i = 0; i < list.size(); i++) {\n      CharSequence itemRendered = options.fn(list.get(i));\n      sb.append(itemRendered);\n      if (i < list.size() - 1) {\n        sb.append(separator);\n      }\n    }\n\n    return sb.toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JsonArrayAddHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.jayway.jsonpath.DocumentContext;\nimport com.jayway.jsonpath.InvalidPathException;\nimport com.jayway.jsonpath.JsonPath;\nimport com.jayway.jsonpath.ParseContext;\nimport com.jayway.jsonpath.PathNotFoundException;\nimport java.io.IOException;\nimport java.util.Collection;\nimport java.util.List;\n\nclass JsonArrayAddHelper extends HandlebarsHelper<Object> {\n\n  private final ParseContext parseContext = JsonPath.using(HelperUtils.jsonPathConfig);\n\n  @Override\n  public String apply(Object inputJson, Options options) throws IOException {\n    if (!(inputJson instanceof String)) {\n      return handleError(\"Base JSON must be a string\");\n    }\n\n    DocumentContext root;\n    try {\n      root = parseContext.parse((String) inputJson);\n    } catch (Exception e) {\n      return handleError(\"Base JSON is not valid JSON ('\" + inputJson + \"')\", e);\n    }\n\n    Object jsonPathString = options.hash.get(\"jsonPath\");\n    if (jsonPathString != null && !(jsonPathString instanceof String))\n      return handleError(\"jsonPath option must be a string\");\n\n    Object currentList;\n    if (jsonPathString == null) {\n      currentList = root.json();\n    } else {\n      try {\n        if (((String) jsonPathString).isEmpty())\n          throw new InvalidPathException(\"JSONPath expression is empty\");\n        currentList = root.read((String) jsonPathString);\n      } catch (PathNotFoundException e) {\n        currentList = null;\n      } catch (InvalidPathException e) {\n        return handleError(\n            \"jsonPath option is not valid JSONPath expression ('\" + jsonPathString + \"')\");\n      }\n    }\n    if (!(currentList instanceof List)) {\n      String detail;\n      if (jsonPathString == null) {\n        detail = \"'\" + inputJson + \"'\";\n      } else {\n        detail = \"root: '\" + inputJson + \"', jsonPath: '\" + jsonPathString + \"'\";\n      }\n      return handleError(\"Target JSON is not a JSON array (\" + detail + \")\");\n    }\n\n    Object itemToAddString;\n    if (options.tagType == TagType.SECTION) {\n      itemToAddString = options.fn().toString();\n    } else {\n      itemToAddString = options.params.length > 0 ? options.params[0] : null;\n    }\n    if (!(itemToAddString instanceof String)) {\n      return handleError(\"Item-to-add JSON must be a string\");\n    }\n\n    Object toAdd;\n    try {\n      toAdd = Json.read((String) itemToAddString, Object.class);\n    } catch (Exception e) {\n      return handleError(\"Item-to-add JSON is not valid JSON ('\" + itemToAddString + \"')\", e);\n    }\n    boolean flatten;\n    {\n      Object flatten0 = options.hash.get(\"flatten\");\n      if (flatten0 instanceof Boolean) {\n        flatten = (boolean) flatten0;\n      } else if (flatten0 == null) {\n        flatten = false;\n      } else {\n        return handleError(\"flatten option must be a boolean\");\n      }\n    }\n    if (flatten && toAdd instanceof Collection) {\n      //noinspection rawtypes,unchecked\n      ((List) currentList).addAll((Collection) toAdd);\n    } else {\n      //noinspection rawtypes,unchecked\n      ((List) currentList).add(toAdd);\n    }\n\n    Object maxItems = options.hash.get(\"maxItems\");\n    if (maxItems != null) {\n      if (!(maxItems instanceof Integer)) return handleError(\"maxItems option must be an integer\");\n      if ((int) maxItems < 0) return handleError(\"maxItems option integer must be positive\");\n      if (((List<?>) currentList).size() - (int) maxItems > 0) {\n        ((List<?>) currentList).subList(0, ((List<?>) currentList).size() - (int) maxItems).clear();\n      }\n    }\n\n    return root.jsonString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JsonData.java",
    "content": "/*\n * Copyright (C) 2018-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.util.*;\n\npublic abstract class JsonData<T> {\n\n  protected abstract String toJsonString();\n\n  @Override\n  public String toString() {\n    return toJsonString();\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  static Object create(Object data) {\n    if (data instanceof Map) {\n      return new MapJsonData((Map<String, Object>) data);\n    }\n\n    if (data instanceof List) {\n      return new ListJsonData((List<Object>) data);\n    }\n\n    return data;\n  }\n\n  protected final T data;\n\n  public JsonData(T data) {\n    this.data = data;\n  }\n\n  public static class MapJsonData extends JsonData<Map<String, Object>>\n      implements Map<String, Object> {\n\n    @Override\n    protected String toJsonString() {\n      return Json.write(data);\n    }\n\n    public MapJsonData(Map<String, Object> data) {\n      super(data);\n    }\n\n    @Override\n    public int size() {\n      return data.size();\n    }\n\n    @Override\n    public boolean isEmpty() {\n      return data.isEmpty();\n    }\n\n    @Override\n    public boolean containsKey(Object key) {\n      return data.containsKey(key);\n    }\n\n    @Override\n    public boolean containsValue(Object value) {\n      return data.containsValue(value);\n    }\n\n    @Override\n    public Object get(Object key) {\n      return data.get(key);\n    }\n\n    @Override\n    public Object remove(Object key) {\n      return data.remove(key);\n    }\n\n    @Override\n    public void clear() {\n      data.clear();\n    }\n\n    @Override\n    public Set<String> keySet() {\n      return data.keySet();\n    }\n\n    @Override\n    public Collection<Object> values() {\n      return data.values();\n    }\n\n    @Override\n    public Set<Entry<String, Object>> entrySet() {\n      return data.entrySet();\n    }\n\n    @Override\n    public void putAll(Map<? extends String, ?> m) {\n      data.putAll(m);\n    }\n\n    @Override\n    public Object put(String key, Object value) {\n      return data.put(key, value);\n    }\n  }\n\n  public static class ListJsonData extends JsonData<List<Object>> implements List<Object> {\n\n    public ListJsonData(List<Object> data) {\n      super(data);\n    }\n\n    public int size() {\n      return data.size();\n    }\n\n    public boolean isEmpty() {\n      return data.isEmpty();\n    }\n\n    public boolean contains(Object o) {\n      return data.contains(o);\n    }\n\n    public Iterator<Object> iterator() {\n      return data.iterator();\n    }\n\n    public Object[] toArray() {\n      return data.toArray();\n    }\n\n    public <T> T[] toArray(T[] a) {\n      return data.toArray(a);\n    }\n\n    public boolean add(Object o) {\n      return data.add(o);\n    }\n\n    public boolean remove(Object o) {\n      return data.remove(o);\n    }\n\n    public boolean containsAll(Collection<?> c) {\n      return data.containsAll(c);\n    }\n\n    public boolean addAll(Collection<?> c) {\n      return data.addAll(c);\n    }\n\n    public boolean addAll(int index, Collection<?> c) {\n      return data.addAll(index, c);\n    }\n\n    public boolean removeAll(Collection<?> c) {\n      return data.removeAll(c);\n    }\n\n    public boolean retainAll(Collection<?> c) {\n      return data.retainAll(c);\n    }\n\n    public void clear() {\n      data.clear();\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      return data.equals(o);\n    }\n\n    @Override\n    public int hashCode() {\n      return data.hashCode();\n    }\n\n    public Object get(int index) {\n      return data.get(index);\n    }\n\n    public Object set(int index, Object element) {\n      return data.set(index, element);\n    }\n\n    public void add(int index, Object element) {\n      data.add(index, element);\n    }\n\n    public Object remove(int index) {\n      return data.remove(index);\n    }\n\n    public int indexOf(Object o) {\n      return data.indexOf(o);\n    }\n\n    public int lastIndexOf(Object o) {\n      return data.lastIndexOf(o);\n    }\n\n    public ListIterator<Object> listIterator() {\n      return data.listIterator();\n    }\n\n    public ListIterator<Object> listIterator(int index) {\n      return data.listIterator(index);\n    }\n\n    public List<Object> subList(int fromIndex, int toIndex) {\n      return data.subList(fromIndex, toIndex);\n    }\n\n    @Override\n    protected String toJsonString() {\n      return Json.write(data);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JsonMergeHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.node.ObjectNode;\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.io.IOException;\nimport java.util.Iterator;\nimport java.util.Map;\n\nclass JsonMergeHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public String apply(Object baseJsonString, Options options) throws IOException {\n    if (!(baseJsonString instanceof String))\n      return handleError(\"Base JSON parameter must be a string\");\n\n    JsonNode baseJson;\n    try {\n      baseJson = Json.read((String) baseJsonString, JsonNode.class);\n    } catch (Exception e) {\n      return handleError(\"Base JSON is not valid JSON ('\" + baseJsonString + \"')\", e);\n    }\n    if (!(baseJson instanceof ObjectNode)) {\n      return handleError(\"Base JSON is not a JSON object ('\" + baseJsonString + \"')\");\n    }\n\n    Object jsonToMergeString;\n    if (options.tagType == TagType.SECTION) {\n      jsonToMergeString = options.fn().toString();\n    } else {\n      jsonToMergeString = options.params.length > 0 ? options.params[0] : null;\n    }\n    if (!(jsonToMergeString instanceof String))\n      return handleError(\"JSON to merge must be a string\");\n\n    JsonNode jsonToMerge;\n    try {\n      jsonToMerge = Json.read((String) jsonToMergeString, JsonNode.class);\n    } catch (Exception e) {\n      return handleError(\"JSON to merge is not valid JSON ('\" + jsonToMergeString + \"')\", e);\n    }\n    if (!(jsonToMerge instanceof ObjectNode)) {\n      return handleError(\"JSON to merge is not a JSON object ('\" + jsonToMergeString + \"')\");\n    }\n\n    boolean removeNulls =\n        options.hash.containsKey(\"removeNulls\") && (boolean) options.hash.get(\"removeNulls\");\n\n    merge((ObjectNode) baseJson, (ObjectNode) jsonToMerge, removeNulls);\n    return Json.getObjectMapper().writeValueAsString(baseJson);\n  }\n\n  private void merge(ObjectNode base, ObjectNode other, boolean removeNulls) {\n    for (Iterator<Map.Entry<String, JsonNode>> it = other.fields(); it.hasNext(); ) {\n      Map.Entry<String, JsonNode> child = it.next();\n      String fieldName = child.getKey();\n      JsonNode childNodeToMerge = child.getValue();\n      if (childNodeToMerge instanceof ObjectNode) {\n        JsonNode baseChildNode = base.get(fieldName);\n        if (baseChildNode instanceof ObjectNode) {\n          merge((ObjectNode) baseChildNode, (ObjectNode) childNodeToMerge, removeNulls);\n        } else {\n          base.replace(fieldName, childNodeToMerge);\n        }\n      } else {\n        if (removeNulls && childNodeToMerge.isNull()) {\n          base.remove(fieldName);\n        } else {\n          base.replace(fieldName, childNodeToMerge);\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JsonRemoveHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.jayway.jsonpath.DocumentContext;\nimport com.jayway.jsonpath.InvalidModificationException;\nimport com.jayway.jsonpath.InvalidPathException;\nimport com.jayway.jsonpath.JsonPath;\nimport com.jayway.jsonpath.ParseContext;\nimport com.jayway.jsonpath.PathNotFoundException;\n\nclass JsonRemoveHelper extends HandlebarsHelper<Object> {\n\n  private final ParseContext parseContext = JsonPath.using(HelperUtils.jsonPathConfig);\n\n  @Override\n  public String apply(Object inputJson, Options options) {\n    if (!(inputJson instanceof String)) {\n      return handleError(\"Input JSON must be a string\");\n    }\n    if (inputJson.equals(\"null\")) {\n      // No op\n      return (String) inputJson;\n    }\n    if (options.params.length != 1) {\n      return handleError(\"A single JSONPath expression parameter must be supplied\");\n    }\n    Object jsonPathString = options.param(0);\n    if (!(jsonPathString instanceof String)) {\n      return handleError(\"JSONPath parameter must be a string\");\n    }\n    DocumentContext jsonDocument;\n    try {\n      jsonDocument = parseContext.parse((String) inputJson);\n    } catch (Exception e) {\n      return handleError(\"Input JSON string is not valid JSON ('\" + inputJson + \"')\", e);\n    }\n    try {\n      if (((String) jsonPathString).isEmpty())\n        throw new InvalidPathException(\"JSONPath expression is empty\");\n      return jsonDocument.delete((String) jsonPathString).jsonString();\n    } catch (PathNotFoundException e) {\n      return (String) inputJson;\n    } catch (InvalidPathException e) {\n      String message =\n          \"JSONPath parameter is not a valid JSONPath expression ('\" + jsonPathString + \"')\";\n      return handleError(message, e);\n    } catch (InvalidModificationException e) {\n      String message =\n          \"Delete operation cannot be applied to JSONPath expression ('\" + jsonPathString + \"')\";\n      return handleError(message, e);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/JsonSortHelper.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.RequestCache;\nimport com.jayway.jsonpath.DocumentContext;\nimport com.jayway.jsonpath.JsonPath;\nimport com.jayway.jsonpath.ParseContext;\nimport com.jayway.jsonpath.PathNotFoundException;\nimport java.io.IOException;\nimport java.math.BigDecimal;\nimport java.util.ArrayList;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport org.jspecify.annotations.NonNull;\n\npublic class JsonSortHelper extends HandlebarsHelper<Object> {\n\n  private final ParseContext parseContext = JsonPath.using(HelperUtils.jsonPathConfig);\n\n  @Override\n  public Object apply(Object inputJson, Options options) throws IOException {\n    if (!(inputJson instanceof String)) {\n      return handleError(\"Input JSON must be a string\");\n    }\n    if (inputJson.equals(\"null\")) {\n      return handleError(\"Cannot sort a JSON null value - input must be a JSON array\");\n    }\n    if (options.params.length != 1) {\n      return handleError(\"A single JSONPath expression parameter must be supplied\");\n    }\n    Object jsonPathString = options.param(0);\n    if (!(jsonPathString instanceof String)) {\n      return handleError(\"JSONPath parameter must be a string\");\n    }\n\n    // Extract and validate optional 'order' parameter\n    String order = \"asc\"; // default to ascending\n    if (options.hash != null) {\n      Object orderParam = options.hash.get(\"order\");\n      if (orderParam != null) {\n        if (!(orderParam instanceof String)) {\n          return handleError(\"order parameter must be a string\");\n        }\n        order = (String) orderParam;\n        if (!order.equals(\"asc\") && !order.equals(\"desc\")) {\n          return handleError(\"order parameter must be 'asc' or 'desc'\");\n        }\n      }\n    }\n\n    // Extract and validate optional 'nulls' parameter\n    String nullsPlacement = \"first\"; // default to nulls first\n    if (options.hash != null) {\n      Object nullsParam = options.hash.get(\"nulls\");\n      if (nullsParam != null) {\n        if (!(nullsParam instanceof String)) {\n          return handleError(\"nulls parameter must be a string\");\n        }\n        nullsPlacement = (String) nullsParam;\n        if (!nullsPlacement.equals(\"first\") && !nullsPlacement.equals(\"last\")) {\n          return handleError(\"nulls parameter must be 'first' or 'last'\");\n        }\n      }\n    }\n\n    // Extract array path from JsonPath\n    String arrayPath = extractArrayPath((String) jsonPathString);\n    if (arrayPath == null) {\n      return handleError(\n          \"JSONPath must include [*] to specify array location (e.g., '$[*].name' or '$.users[*].name')\");\n    }\n\n    DocumentContext jsonDocument;\n    try {\n      jsonDocument = getParsedDocument((String) inputJson, options);\n    } catch (Exception e) {\n      return handleError(\"Input JSON string is not valid JSON ('\" + inputJson + \"')\", e);\n    }\n    // Read the sort values using the full JsonPath with [*]\n    // ASSUMPTION: JsonPath maintains document order for wildcard projections,\n    // so sortValues[i] corresponds to array[i]\n    List<?> sortValues;\n    try {\n      sortValues = readJsonPath(jsonDocument, (String) jsonPathString, List.class, options);\n    } catch (PathNotFoundException e) {\n      return handleError(\n          \"JSONPath expression did not match any values ('\" + jsonPathString + \"')\", e);\n    } catch (Exception e) {\n      return handleError(\"Invalid JSONPath expression ('\" + jsonPathString + \"')\", e);\n    }\n    // Read the array to sort\n    Object arrayObject;\n    try {\n      arrayObject = readJsonPath(jsonDocument, arrayPath, Object.class, options);\n    } catch (PathNotFoundException e) {\n      return handleError(\"Array not found at path ('\" + arrayPath + \"')\", e);\n    } catch (Exception e) {\n      return handleError(\"Error reading array at path ('\" + arrayPath + \"')\", e);\n    }\n\n    // Validate it's actually an array\n    if (!(arrayObject instanceof List)) {\n      return handleError(\"JSONPath does not reference an array ('\" + arrayPath + \"')\");\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    List<Object> array = (List<Object>) arrayObject;\n\n    // Validate sort values list matches array size\n    if (sortValues.size() != array.size()) {\n      return handleError(getError(sortValues, array, (String) jsonPathString));\n    }\n\n    // Handle empty arrays early - nothing to validate or sort\n    if (array.isEmpty()) {\n      return jsonDocument.jsonString();\n    }\n\n    // Validate all values are the same comparable type\n    Class<?> commonType = detectCommonType(sortValues);\n    if (commonType == null) {\n      return handleError(\n          \"All sort field values must be of the same comparable type (Number, String, or Boolean)\");\n    }\n\n    // Handle single element arrays - validated, but no sorting needed\n    if (array.size() == 1) {\n      return jsonDocument.jsonString();\n    }\n\n    // Create pairs of (array element, sort value)\n    List<SortPair> pairs = new ArrayList<>();\n    for (int i = 0; i < array.size(); i++) {\n      pairs.add(new SortPair(array.get(i), sortValues.get(i)));\n    }\n\n    // Create comparator based on detected type\n    Comparator<Object> valueComparator = createComparator(commonType, nullsPlacement);\n    if (\"desc\".equals(order)) {\n      valueComparator = valueComparator.reversed();\n    }\n\n    // Sort pairs by their sort values\n    final Comparator<Object> finalComparator = valueComparator;\n    pairs.sort((a, b) -> finalComparator.compare(a.sortValue, b.sortValue));\n\n    // Extract sorted objects\n    List<Object> sortedArray = pairs.stream().map(p -> p.object).collect(Collectors.toList());\n\n    // Special case: if we're sorting the root array, we can't use set() as JsonPath doesn't allow\n    // setting the root element. Instead, we serialize the sorted array directly.\n    if (\"$\".equals(arrayPath)) {\n      return parseContext.parse(sortedArray).jsonString();\n    }\n\n    // Update the document with a sorted array\n    jsonDocument.set(arrayPath, sortedArray);\n\n    return jsonDocument.jsonString();\n  }\n\n  private @NonNull String getError(List<?> sortValues, List<Object> array, String jsonPathString) {\n    String errorMsg =\n        \"Number of sort values (\"\n            + sortValues.size()\n            + \") does not match array size (\"\n            + array.size()\n            + \")\";\n\n    // Detect multiple wildcards and add a helpful hint\n    int wildcardCount = countWildcards(jsonPathString);\n    if (wildcardCount > 1) {\n      errorMsg +=\n          \". JSONPath contains \"\n              + wildcardCount\n              + \" wildcards [*] but only single-level array sorting is supported\";\n    }\n    return errorMsg;\n  }\n\n  private String extractArrayPath(String jsonPath) {\n    // Extract the array path from expressions like \"$[*].name\" or \"$.users[*].priority\"\n    int wildcardIndex = jsonPath.indexOf(\"[*]\");\n    if (wildcardIndex == -1) {\n      return null; // Must contain [*]\n    }\n\n    // Return everything before [*]\n    String path = jsonPath.substring(0, wildcardIndex);\n    return path.isEmpty() ? \"$\" : path;\n  }\n\n  private int countWildcards(String jsonPath) {\n    int count = 0;\n    int index = 0;\n    while ((index = jsonPath.indexOf(\"[*]\", index)) != -1) {\n      count++;\n      index += 3;\n    }\n    return count;\n  }\n\n  private Class<?> detectCommonType(List<?> values) {\n    if (values.isEmpty()) {\n      return null;\n    }\n\n    Class<?> firstType = null;\n    for (Object value : values) {\n      // Skip nulls when detecting type - they'll be handled by comparator\n      if (value == null) {\n        continue;\n      }\n\n      Class<?> currentType = getComparableType(value);\n      if (currentType == null) {\n        return null; // Unsupported type\n      }\n      if (firstType == null) {\n        firstType = currentType;\n      } else if (!firstType.equals(currentType)) {\n        return null; // Mixed types\n      }\n    }\n\n    // If all values are null, default to String comparison\n    return firstType != null ? firstType : String.class;\n  }\n\n  private Class<?> getComparableType(Object value) {\n    if (value == null) {\n      return null;\n    }\n    if (value instanceof Number) {\n      return Number.class;\n    }\n    if (value instanceof String) {\n      return String.class;\n    }\n    if (value instanceof Boolean) {\n      return Boolean.class;\n    }\n    return null; // Unsupported type (object, array, etc.)\n  }\n\n  private record SortPair(Object object, Object sortValue) {}\n\n  private Comparator<Object> createComparator(Class<?> type, String nullsPlacement) {\n    Comparator<Object> baseComparator;\n\n    if (Number.class.equals(type)) {\n      baseComparator =\n          (a, b) -> {\n            BigDecimal bdA = toBigDecimal((Number) a);\n            BigDecimal bdB = toBigDecimal((Number) b);\n            return bdA.compareTo(bdB);\n          };\n    } else if (String.class.equals(type)) {\n      baseComparator = Comparator.comparing(v -> (String) v);\n    } else if (Boolean.class.equals(type)) {\n      // Booleans sort as: false < true (false comes before true)\n      baseComparator = Comparator.comparing(v -> (Boolean) v);\n    } else {\n      throw new IllegalArgumentException(\"Unsupported type: \" + type);\n    }\n\n    // Wrap with null handling based on user preference\n    return \"last\".equals(nullsPlacement)\n        ? Comparator.nullsLast(baseComparator)\n        : Comparator.nullsFirst(baseComparator);\n  }\n\n  private BigDecimal toBigDecimal(Number number) {\n    if (number instanceof BigDecimal) {\n      return (BigDecimal) number;\n    } else if (number instanceof Integer\n        || number instanceof Long\n        || number instanceof Short\n        || number instanceof Byte) {\n      return BigDecimal.valueOf(number.longValue());\n    } else if (number instanceof Float || number instanceof Double) {\n      return BigDecimal.valueOf(number.doubleValue());\n    } else {\n      // Fallback for other Number types\n      return new BigDecimal(number.toString());\n    }\n  }\n\n  private DocumentContext getParsedDocument(String json, Options options) {\n    RequestCache requestCache = getRequestCache(options);\n    RequestCache.Key cacheKey = RequestCache.Key.keyFor(DocumentContext.class, json);\n    DocumentContext document = requestCache.get(cacheKey);\n    if (document == null) {\n      document = parseContext.parse(json);\n      requestCache.put(cacheKey, document);\n    }\n    return document;\n  }\n\n  private <T> T readJsonPath(\n      DocumentContext document, String jsonPath, Class<T> returnType, Options options) {\n    RequestCache requestCache = getRequestCache(options);\n    RequestCache.Key cacheKey = RequestCache.Key.keyFor(returnType, jsonPath, document);\n    T value = requestCache.get(cacheKey);\n    if (value == null) {\n      value = document.read(jsonPath, returnType);\n      requestCache.put(cacheKey, value);\n    }\n    return value;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/MatchesRegexHelper.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport java.io.IOException;\n\npublic class MatchesRegexHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    if (options.params.length < 1) {\n      return handleError(\"You must specify the string to be matched and the regular expression\");\n    }\n\n    String value = context.toString();\n    String regex = options.param(0);\n\n    boolean isMatch = value.matches(regex);\n\n    if (options.tagType == TagType.SECTION) {\n      return isMatch ? options.apply(options.fn) : \"\";\n    }\n\n    return isMatch;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/MathsHelper.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.math.BigDecimal;\nimport java.math.RoundingMode;\n\npublic class MathsHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    if (options.params.length != 2) {\n      return handleError(\n          \"All maths functions require two operands and an operator as parameters e.g. 3 '+' 2\");\n    }\n\n    BigDecimal left = coerceToBigDecimal(context);\n    String operator = options.params[0].toString();\n    BigDecimal right = coerceToBigDecimal(options.params[1]);\n\n    BigDecimal result = null;\n    switch (operator) {\n      case \"+\":\n        result = left.add(right);\n        break;\n      case \"-\":\n        result = left.subtract(right);\n        break;\n      case \"*\":\n      case \"x\":\n        result = left.multiply(right);\n        break;\n      case \"/\":\n        result = left.divide(right, RoundingMode.HALF_UP);\n        break;\n      case \"%\":\n        result = left.remainder(right);\n        break;\n      default:\n        return handleError(operator + \" is not a valid mathematical operator\");\n    }\n\n    return reduceToPrimitiveNumber(result);\n  }\n\n  private static BigDecimal coerceToBigDecimal(Object value) {\n    if (value instanceof Integer) {\n      return new BigDecimal((int) value);\n    }\n\n    if (value instanceof Long) {\n      return new BigDecimal((long) value);\n    }\n\n    if (value instanceof Double) {\n      return BigDecimal.valueOf((double) value);\n    }\n\n    if (value instanceof Float) {\n      return BigDecimal.valueOf((float) value);\n    }\n\n    try {\n      return new BigDecimal(value.toString());\n    } catch (NumberFormatException e) {\n      return new BigDecimal(0);\n    }\n  }\n\n  private static Object reduceToPrimitiveNumber(BigDecimal value) {\n    if (value == null) {\n      return null;\n    }\n\n    if (value.scale() == 0) {\n      long longValue = value.longValue();\n      if (longValue <= Integer.MAX_VALUE && longValue >= Integer.MIN_VALUE) {\n        return value.intValue();\n      }\n\n      return longValue;\n    }\n\n    return value.doubleValue();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ParseDateHelper.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.DateTimeParser.ZONED_PARSERS;\nimport static java.util.Collections.singletonList;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.DateTimeParser;\nimport java.io.IOException;\nimport java.time.format.DateTimeParseException;\nimport java.util.List;\n\npublic class ParseDateHelper extends HandlebarsHelper<String> {\n\n  @Override\n  public Object apply(String dateTimeString, Options options) throws IOException {\n    String format = options.hash(\"format\", null);\n\n    return format == null\n        ? parseOrNull(dateTimeString)\n        : parseOrNull(dateTimeString, DateTimeParser.forFormat(format));\n  }\n\n  private static RenderableDate parseOrNull(String dateTimeString) {\n    return parseOrNull(dateTimeString, (DateTimeParser) null);\n  }\n\n  private static RenderableDate parseOrNull(String dateTimeString, DateTimeParser parser) {\n    final List<DateTimeParser> parsers = parser != null ? singletonList(parser) : ZONED_PARSERS;\n    return parseOrNull(dateTimeString, parsers);\n  }\n\n  private static RenderableDate parseOrNull(String dateTimeString, List<DateTimeParser> parsers) {\n    if (parsers.isEmpty()) {\n      return null;\n    }\n\n    try {\n      final DateTimeParser headParser = parsers.get(0);\n      return headParser.parseDate(dateTimeString);\n    } catch (DateTimeParseException e) {\n      return parseOrNull(dateTimeString, parsers.subList(1, parsers.size()));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ParseJsonHelper.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.fasterxml.jackson.core.type.TypeReference;\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\npublic class ParseJsonHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    CharSequence json;\n    String variableName;\n    Object result = new HashMap<String, Object>();\n\n    // Edge case if null JSON object passed in\n    if (context == null) {\n      return result;\n    }\n\n    boolean hasContext = context != options.context.model();\n\n    if (options.tagType == TagType.SECTION) {\n      json = options.apply(options.fn);\n      variableName = hasContext ? context.toString() : null;\n    } else {\n      if (!hasContext) {\n        return handleError(\"Missing required JSON string parameter\");\n      }\n\n      json = context.toString();\n      variableName = options.params.length > 0 ? options.param(0) : null;\n    }\n\n    if (json != null) {\n      String jsonAsString = json.toString().trim();\n\n      // Edge case if JSON object is empty {}\n      String jsonAsStringWithoutSpace = jsonAsString.replaceAll(\"\\\\s\", \"\");\n      if (jsonAsStringWithoutSpace.equals(\"{}\") || jsonAsStringWithoutSpace.isEmpty()) {\n        result = new HashMap<String, Object>();\n      } else {\n        if (jsonAsString.startsWith(\"[\") && jsonAsString.endsWith(\"]\")) {\n          result = Json.read(jsonAsString, new TypeReference<List<Object>>() {});\n        } else {\n          result = Json.read(jsonAsString, new TypeReference<Map<String, Object>>() {});\n        }\n      }\n    }\n\n    if (variableName != null) {\n      options.context.data(variableName, result);\n      return null;\n    }\n\n    return result;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/PickRandomHelper.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.*;\nimport java.util.concurrent.ThreadLocalRandom;\n\npublic class PickRandomHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  @SuppressWarnings(\"unchecked\")\n  public Object apply(Object context, Options options) throws IOException {\n    if (context == null) {\n      return this.handleError(\n          \"Must specify either a single list argument or a set of single value arguments.\");\n    }\n\n    List<Object> valueList = new ArrayList<>();\n    if (Iterable.class.isAssignableFrom(context.getClass())) {\n      ((Iterable<Object>) context).forEach(valueList::add);\n    } else {\n      valueList.add(context);\n      valueList.addAll(Arrays.asList(options.params));\n    }\n\n    Integer count = (Integer) options.hash.get(\"count\");\n    if (count != null && count > 0) {\n      int desiredLength = Math.min(valueList.size(), count);\n      for (int i = 0; i < desiredLength; i++) {\n        Collections.swap(valueList, i, ThreadLocalRandom.current().nextInt(i, valueList.size()));\n      }\n      return valueList.subList(0, desiredLength);\n    }\n\n    int index = ThreadLocalRandom.current().nextInt(valueList.size());\n    return valueList.get(index);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/RandomDecimalHelper.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HelperUtils.coerceToDouble;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.concurrent.ThreadLocalRandom;\n\npublic class RandomDecimalHelper extends HandlebarsHelper<Void> {\n\n  @Override\n  public Object apply(Void context, Options options) throws IOException {\n    double lowerBound = coerceToDouble(options.hash(\"lower\", Double.MIN_VALUE));\n    double upperBound = coerceToDouble(options.hash(\"upper\", Double.MAX_VALUE));\n\n    return ThreadLocalRandom.current().nextDouble(lowerBound, upperBound);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/RandomIntHelper.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HelperUtils.coerceToInt;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.concurrent.ThreadLocalRandom;\n\npublic class RandomIntHelper extends HandlebarsHelper<Void> {\n\n  @Override\n  public Object apply(Void context, Options options) throws IOException {\n    int lowerBound = coerceToInt(options.hash(\"lower\", Integer.MIN_VALUE));\n    int upperBound = coerceToInt(options.hash(\"upper\", Integer.MAX_VALUE));\n    return ThreadLocalRandom.current().nextInt(lowerBound, upperBound);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/RangeHelper.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HelperUtils.coerceToInt;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\n\npublic class RangeHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    Integer lowerBound = coerceToInt(context);\n    Integer upperBound = options.params.length > 0 ? coerceToInt(options.param(0)) : null;\n\n    if (lowerBound == null || upperBound == null) {\n      return handleError(\n          \"The range helper requires both lower and upper bounds as integer parameters\");\n    }\n\n    int limit = (upperBound - lowerBound) + 1;\n    return Stream.iterate(lowerBound, n -> n + 1).limit(limit).collect(Collectors.toList());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/RegexExtractHelper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport java.util.regex.PatternSyntaxException;\n\npublic class RegexExtractHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) {\n    List<String> groups = new ArrayList<>();\n    String regexString = options.param(0);\n    Pattern regex;\n\n    try {\n      regex = Pattern.compile(regexString);\n    } catch (PatternSyntaxException ex) {\n      return handleError(\"Invalid regex string \" + regexString);\n    }\n\n    Matcher matcher = regex.matcher(context.toString());\n\n    while (matcher.find()) {\n\n      if (options.params.length == 1) {\n        return matcher.group();\n      }\n\n      for (int i = 1; i <= matcher.groupCount(); i++) {\n        groups.add(matcher.group(i));\n      }\n    }\n\n    if (groups.isEmpty()) {\n      Object defaultValue = options.hash(\"default\");\n      return defaultValue != null ? defaultValue : handleError(\"Nothing matched \" + regexString);\n    }\n\n    String variableName = options.param(1);\n    options.context.data(variableName, new ListOrSingle<>(groups));\n\n    return null;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/RenderableDate.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.fasterxml.jackson.annotation.JsonValue;\nimport com.fasterxml.jackson.databind.util.ISO8601Utils;\nimport java.time.ZoneId;\nimport java.time.ZonedDateTime;\nimport java.time.format.DateTimeFormatter;\nimport java.util.Date;\nimport java.util.TimeZone;\n\npublic class RenderableDate extends Date {\n  private static final long DIVIDE_MILLISECONDS_TO_SECONDS = 1000L;\n\n  private final String format;\n  private final ZoneId timezone;\n\n  public RenderableDate(Date date, String format, ZoneId timezone) {\n    super(date.getTime());\n    this.format = format;\n    this.timezone = timezone;\n  }\n\n  public String getFormat() {\n    return format;\n  }\n\n  public ZoneId getTimezone() {\n    return timezone;\n  }\n\n  @Override\n  @JsonValue\n  public String toString() {\n    if (format != null) {\n      if (format.equals(\"epoch\")) {\n        return String.valueOf(getTime());\n      }\n\n      if (format.equals(\"unix\")) {\n        return String.valueOf(getTime() / DIVIDE_MILLISECONDS_TO_SECONDS);\n      }\n\n      return formatCustom();\n    }\n\n    return timezone != null\n        ? ISO8601Utils.format(this, false, TimeZone.getTimeZone(timezone))\n        : ISO8601Utils.format(this, false);\n  }\n\n  private String formatCustom() {\n    ZonedDateTime zonedDateTime =\n        toInstant().atZone(timezone != null ? timezone : ZoneId.systemDefault());\n\n    DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);\n    return formatter.format(zonedDateTime);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/SizeHelper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.List;\nimport java.util.Map;\n\npublic class SizeHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    Class<?> contextClass = context.getClass();\n\n    if (CharSequence.class.isAssignableFrom(contextClass)) {\n      return ((CharSequence) context).length();\n    }\n\n    if (List.class.isAssignableFrom(contextClass)) {\n      return ((List) context).size();\n    }\n\n    if (Map.class.isAssignableFrom(contextClass)) {\n      return ((Map) context).size();\n    }\n\n    return null;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/StringTrimHelper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport java.io.IOException;\n\npublic class StringTrimHelper implements Helper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    String value =\n        options.tagType == TagType.SECTION ? options.fn(context).toString() : context.toString();\n\n    return value.trim();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/SystemValueHelper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport static com.github.tomakehurst.wiremock.common.Strings.isEmpty;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.SystemKeyAuthoriser;\n\npublic class SystemValueHelper extends HandlebarsHelper<Object> {\n\n  private final SystemKeyAuthoriser systemKeyAuthoriser;\n\n  public SystemValueHelper(SystemKeyAuthoriser systemKeyAuthoriser) {\n    this.systemKeyAuthoriser = systemKeyAuthoriser;\n  }\n\n  @Override\n  public String apply(Object context, Options options) {\n    String key = options.hash(\"key\", \"\");\n    String type = options.hash(\"type\", \"ENVIRONMENT\");\n    String defaultValue = options.hash(\"default\");\n    if (isEmpty(key)) {\n      return this.handleError(\"The key cannot be empty\");\n    }\n    if (!systemKeyAuthoriser.isPermitted(key)) {\n      return this.handleError(\"Access to \" + key + \" is denied\");\n    }\n\n    String rawValue = \"\";\n\n    switch (type) {\n      case \"ENVIRONMENT\":\n        rawValue = getSystemEnvironment(key, defaultValue);\n        break;\n      case \"PROPERTY\":\n        rawValue = getSystemProperties(key, defaultValue);\n        break;\n    }\n    return rawValue;\n  }\n\n  private String getSystemEnvironment(final String key, final String defaultValue) {\n    return System.getenv().getOrDefault(key, defaultValue);\n  }\n\n  private String getSystemProperties(final String key, final String defaultValue) {\n    return System.getProperty(key, defaultValue);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ToJsonHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.Json;\n\nclass ToJsonHelper extends HandlebarsHelper<Object> {\n  @Override\n  public String apply(Object obj, Options options) {\n    if (obj == null) {\n      return \"\";\n    } else {\n      return Json.write(obj);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/TruncateDateTimeHelper.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport com.github.tomakehurst.wiremock.common.DateTimeTruncation;\nimport java.io.IOException;\nimport java.util.Date;\n\npublic class TruncateDateTimeHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    if (options.params.length < 1) {\n      return handleError(\n          \"Truncation type must be specified as the first parameter to truncateDate\");\n    }\n\n    if (context instanceof Date) {\n      Date date = (Date) context;\n      DateTimeTruncation truncation = DateTimeTruncation.fromString(options.params[0].toString());\n      return truncation.truncate(date);\n    }\n\n    return handleError(\"A date object must be passed to the truncateDate helper\");\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/UrlEncodingHelper.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.jknack.handlebars.Options;\nimport com.github.jknack.handlebars.TagType;\nimport java.io.IOException;\nimport java.io.UnsupportedEncodingException;\nimport java.net.URLDecoder;\nimport java.net.URLEncoder;\n\npublic class UrlEncodingHelper implements Helper<Object> {\n\n  @Override\n  public Object apply(Object context, Options options) throws IOException {\n    String value =\n        options.tagType == TagType.SECTION ? options.fn(context).toString() : context.toString();\n\n    Object encodingObj = options.hash.get(\"encoding\");\n    String encoding = encodingObj != null ? encodingObj.toString() : \"utf-8\";\n\n    if (Boolean.TRUE.equals(options.hash.get(\"decode\"))) {\n      return decode(value, encoding);\n    }\n\n    return encode(value, encoding);\n  }\n\n  private String encode(String value, String encoding) throws IOException {\n    try {\n      return URLEncoder.encode(value, encoding);\n    } catch (UnsupportedEncodingException e) {\n      throw new IOException(e);\n    }\n  }\n\n  private String decode(String value, String encoding) throws IOException {\n    try {\n      return URLDecoder.decode(value, encoding);\n    } catch (UnsupportedEncodingException e) {\n      throw new IOException(e);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/ValHelper.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\n\npublic class ValHelper extends HandlebarsHelper<Object> {\n\n  @Override\n  public Object apply(Object value, Options options) throws IOException {\n    final Object defaultValue = options.hash(\"or\", options.hash(\"default\"));\n    Object finalValue = value != null ? value : defaultValue;\n\n    if (options.hash(\"assign\") != null) {\n      options.context.data(options.hash(\"assign\"), finalValue);\n      return null;\n    }\n\n    return finalValue;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/WireMockHelpers.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;\n\nimport com.github.jknack.handlebars.Helper;\nimport com.github.jknack.handlebars.Options;\nimport java.io.IOException;\nimport java.util.Date;\nimport java.util.List;\n\n/**\n * This enum is implemented similar to the StringHelpers of handlebars. It is basically a library of\n * all available wiremock helpers\n */\npublic enum WireMockHelpers implements Helper<Object> {\n  xPath {\n    private final HandlebarsXPathHelper helper = new HandlebarsXPathHelper();\n\n    @Override\n    public Object apply(final Object context, final Options options) throws IOException {\n      return this.helper.apply(String.valueOf(context), options);\n    }\n  },\n  soapXPath {\n    private final HandlebarsSoapHelper helper = new HandlebarsSoapHelper();\n\n    @Override\n    public Object apply(final Object context, final Options options) throws IOException {\n      return this.helper.apply(String.valueOf(context), options);\n    }\n  },\n  jsonPath {\n    private final HandlebarsJsonPathHelper helper = new HandlebarsJsonPathHelper();\n\n    @Override\n    public Object apply(final Object context, final Options options) throws IOException {\n      return this.helper.apply(context, options);\n    }\n  },\n  randomValue {\n    private final HandlebarsRandomValuesHelper helper = new HandlebarsRandomValuesHelper();\n\n    @Override\n    public Object apply(final Object context, final Options options) throws IOException {\n      return this.helper.apply(null, options);\n    }\n  },\n  hostname {\n    private final HostnameHelper helper = new HostnameHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return this.helper.apply(context, options);\n    }\n  },\n  date {\n    private final HandlebarsCurrentDateHelper helper = new HandlebarsCurrentDateHelper();\n\n    @Override\n    public Object apply(final Object context, final Options options) throws IOException {\n      Date dateContext = context instanceof Date ? (Date) context : null;\n      return this.helper.apply(dateContext, options);\n    }\n  },\n  now {\n    private final HandlebarsCurrentDateHelper helper = new HandlebarsCurrentDateHelper();\n\n    @Override\n    public Object apply(final Object context, final Options options) throws IOException {\n      return this.helper.apply(null, options);\n    }\n  },\n  parseDate {\n    private final ParseDateHelper helper = new ParseDateHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context.toString(), options);\n    }\n  },\n  truncateDate {\n    private final TruncateDateTimeHelper helper = new TruncateDateTimeHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  trim {\n    private final StringTrimHelper helper = new StringTrimHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  base64 {\n    private final Base64Helper helper = new Base64Helper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  urlEncode {\n    private final UrlEncodingHelper helper = new UrlEncodingHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  formData {\n    private final FormDataHelper helper = new FormDataHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  regexExtract {\n    private final RegexExtractHelper helper = new RegexExtractHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  size {\n    private final SizeHelper helper = new SizeHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  pickRandom {\n    private final PickRandomHelper helper = new PickRandomHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  randomInt {\n    private final RandomIntHelper helper = new RandomIntHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(null, options);\n    }\n  },\n\n  randomDecimal {\n    private final RandomDecimalHelper helper = new RandomDecimalHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(null, options);\n    }\n  },\n\n  range {\n    private final RangeHelper helper = new RangeHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  array {\n    private final ArrayHelper helper = new ArrayHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  arrayAdd {\n    private final ArrayAddHelper helper = new ArrayAddHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply((List<?>) context, options);\n    }\n  },\n\n  arrayRemove {\n    private final ArrayRemoveHelper helper = new ArrayRemoveHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply((List<?>) context, options);\n    }\n  },\n\n  parseJson {\n    private final ParseJsonHelper helper = new ParseJsonHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  matches {\n    private final MatchesRegexHelper helper = new MatchesRegexHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  contains {\n    private final ContainsHelper helper = new ContainsHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  math {\n    private final MathsHelper helper = new MathsHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  val {\n    private final ValHelper helper = new ValHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  arrayJoin {\n    private final JoinHelper helper = new JoinHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  formatJson {\n    private final FormatJsonHelper helper = new FormatJsonHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  formatXml {\n    private final FormatXmlHelper helper = new FormatXmlHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  toJson {\n    private final ToJsonHelper helper = new ToJsonHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  jsonMerge {\n    private final JsonMergeHelper helper = new JsonMergeHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  jsonRemove {\n    private final JsonRemoveHelper helper = new JsonRemoveHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  jsonArrayAdd {\n    private final JsonArrayAddHelper helper = new JsonArrayAddHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n\n  jsonSort {\n    private final JsonSortHelper helper = new JsonSortHelper();\n\n    @Override\n    public Object apply(Object context, Options options) throws IOException {\n      return helper.apply(context, options);\n    }\n  },\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/global/GlobalSettings.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.global;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.DelayDistribution;\nimport java.util.Objects;\nimport java.util.function.Consumer;\nimport org.jspecify.annotations.NullMarked;\nimport org.jspecify.annotations.Nullable;\n\n@NullMarked\npublic class GlobalSettings {\n\n  @Nullable private final Integer fixedDelay;\n  @Nullable private final DelayDistribution delayDistribution;\n  @Nullable private final Parameters extended;\n\n  private final boolean proxyPassThrough;\n\n  public static GlobalSettings.Builder builder() {\n    return new Builder();\n  }\n\n  public static GlobalSettings defaults() {\n    return new Builder().build();\n  }\n\n  public GlobalSettings(\n      @JsonProperty(\"fixedDelay\") @Nullable Integer fixedDelay,\n      @JsonProperty(\"delayDistribution\") @Nullable DelayDistribution delayDistribution,\n      @JsonProperty(\"extended\") @Nullable Parameters extended,\n      @JsonProperty(\"proxyPassThrough\") boolean proxyPassThrough) {\n    this.fixedDelay = fixedDelay;\n    this.delayDistribution = delayDistribution;\n    this.extended = extended;\n    this.proxyPassThrough = proxyPassThrough;\n  }\n\n  public @Nullable Integer getFixedDelay() {\n    return fixedDelay;\n  }\n\n  public @Nullable DelayDistribution getDelayDistribution() {\n    return delayDistribution;\n  }\n\n  public @Nullable Parameters getExtended() {\n    return extended;\n  }\n\n  public boolean getProxyPassThrough() {\n    return proxyPassThrough;\n  }\n\n  public GlobalSettings.Builder copy() {\n    return new Builder()\n        .fixedDelay(fixedDelay)\n        .delayDistribution(delayDistribution)\n        .extended(extended);\n  }\n\n  public GlobalSettings transform(Consumer<Builder> transformer) {\n    final Builder builder = toBuilder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  private Builder toBuilder() {\n    return new Builder(this);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    GlobalSettings that = (GlobalSettings) o;\n    return Objects.equals(getFixedDelay(), that.getFixedDelay())\n        && Objects.equals(getDelayDistribution(), that.getDelayDistribution())\n        && Objects.equals(getExtended(), that.getExtended());\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(getFixedDelay(), getDelayDistribution(), getExtended());\n  }\n\n  public static class Builder {\n    @Nullable private Integer fixedDelay;\n    @Nullable private DelayDistribution delayDistribution;\n    @Nullable private Parameters extended;\n\n    private boolean proxyPassThrough = true;\n\n    public Builder() {}\n\n    public Builder(GlobalSettings existing) {\n      this.fixedDelay = existing.getFixedDelay();\n      this.delayDistribution = existing.getDelayDistribution();\n      this.extended = existing.getExtended();\n      this.proxyPassThrough = existing.getProxyPassThrough();\n    }\n\n    public Builder fixedDelay(@Nullable Integer fixedDelay) {\n      this.fixedDelay = fixedDelay;\n      return this;\n    }\n\n    public Builder delayDistribution(@Nullable DelayDistribution delayDistribution) {\n      this.delayDistribution = delayDistribution;\n      return this;\n    }\n\n    public Builder extended(@Nullable Parameters extended) {\n      this.extended = extended;\n      return this;\n    }\n\n    public Builder proxyPassThrough(boolean proxyPassThrough) {\n      this.proxyPassThrough = proxyPassThrough;\n      return this;\n    }\n\n    public @Nullable Integer getFixedDelay() {\n      return fixedDelay;\n    }\n\n    public @Nullable DelayDistribution getDelayDistribution() {\n      return delayDistribution;\n    }\n\n    public @Nullable Parameters getExtended() {\n      return extended;\n    }\n\n    public boolean isProxyPassThrough() {\n      return proxyPassThrough;\n    }\n\n    public Builder setFixedDelay(@Nullable Integer fixedDelay) {\n      this.fixedDelay = fixedDelay;\n      return this;\n    }\n\n    public Builder setDelayDistribution(@Nullable DelayDistribution delayDistribution) {\n      this.delayDistribution = delayDistribution;\n      return this;\n    }\n\n    public Builder setExtended(@Nullable Parameters extended) {\n      this.extended = extended;\n      return this;\n    }\n\n    public Builder setProxyPassThrough(boolean proxyPassThrough) {\n      this.proxyPassThrough = proxyPassThrough;\n      return this;\n    }\n\n    public GlobalSettings build() {\n      return new GlobalSettings(fixedDelay, delayDistribution, extended, proxyPassThrough);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/AbstractRequestHandler.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static com.github.tomakehurst.wiremock.stubbing.ServeEvent.ORIGINAL_SERVE_EVENT_KEY;\n\nimport com.github.tomakehurst.wiremock.common.DataTruncationSettings;\nimport com.github.tomakehurst.wiremock.common.RequestCache;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.*;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\npublic abstract class AbstractRequestHandler implements RequestHandler, RequestEventSource {\n\n  protected List<RequestListener> listeners = new ArrayList<>();\n  protected final ResponseRenderer responseRenderer;\n  protected final FilterProcessor filterProcessor;\n\n  private final DataTruncationSettings dataTruncationSettings;\n\n  public AbstractRequestHandler(\n      ResponseRenderer responseRenderer,\n      List<RequestFilter> requestFilters,\n      List<RequestFilterV2> v2RequestFilters,\n      DataTruncationSettings dataTruncationSettings) {\n    this.responseRenderer = responseRenderer;\n    this.filterProcessor = new FilterProcessor(requestFilters, v2RequestFilters);\n    this.dataTruncationSettings = dataTruncationSettings;\n  }\n\n  @Override\n  public void addRequestListener(RequestListener requestListener) {\n    listeners.add(requestListener);\n  }\n\n  protected void beforeResponseSent(ServeEvent serveEvent, Response response) {}\n\n  protected void afterResponseSent(ServeEvent serveEvent, Response response) {}\n\n  @Override\n  public void handle(Request request, HttpResponder httpResponder, ServeEvent originalServeEvent) {\n    ServeEvent serveEvent = ServeEvent.of(request);\n    Request processedRequest = request;\n\n    if (filterProcessor.hasAnyFilters()) {\n      RequestFilterAction requestFilterAction = filterProcessor.processFilters(request, serveEvent);\n\n      if (requestFilterAction instanceof ContinueAction) {\n        processedRequest = ((ContinueAction) requestFilterAction).getRequest();\n        serveEvent = handleRequest(serveEvent.replaceRequest(processedRequest));\n      } else {\n        serveEvent =\n            serveEvent.withResponseDefinition(\n                ((StopAction) requestFilterAction).getResponseDefinition());\n      }\n    } else {\n      serveEvent = handleRequest(serveEvent);\n    }\n\n    ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();\n    Response response = responseRenderer.render(serveEvent);\n    response = Response.Builder.like(response).protocol(request.getProtocol()).build();\n    serveEvent = serveEvent.complete(response, dataTruncationSettings);\n\n    if (logRequests()) {\n      notifier()\n          .info(\n              \"Request received:\\n\"\n                  + formatRequest(request)\n                  + \"\\n\\nMatched response definition:\\n\"\n                  + responseDefinition\n                  + \"\\n\\nResponse:\\n\"\n                  + response);\n    }\n\n    for (RequestListener listener : listeners) {\n      listener.requestReceived(request, response);\n    }\n\n    beforeResponseSent(serveEvent, response);\n\n    serveEvent.beforeSend();\n\n    Map<String, Object> attributes = Map.of(ORIGINAL_SERVE_EVENT_KEY, serveEvent);\n    httpResponder.respond(request, response, attributes);\n\n    serveEvent.afterSend();\n    afterResponseSent(serveEvent, response);\n\n    RequestCache.onRequestEnd();\n  }\n\n  protected String formatRequest(Request request) {\n    StringBuilder sb = new StringBuilder();\n    sb.append(request.getClientIp())\n        .append(\" - \")\n        .append(request.getMethod())\n        .append(\" \")\n        .append(request.getPathAndQueryWithoutPrefix());\n\n    if (request.isBrowserProxyRequest()) {\n      sb.append(\" (via browser proxy request)\");\n    }\n\n    sb.append(\"\\n\\n\");\n    sb.append(request.getHeaders());\n\n    if (request.getBody() != null) {\n      sb.append(request.getBodyAsString()).append(\"\\n\");\n    }\n\n    return sb.toString();\n  }\n\n  protected boolean logRequests() {\n    return false;\n  }\n\n  protected abstract ServeEvent handleRequest(ServeEvent request);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/AdminRequestHandler.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.ADMIN_CONTEXT_ROOT_SEGMENT;\nimport static org.wiremock.url.SchemeRegistry.https;\n\nimport com.github.tomakehurst.wiremock.admin.AdminRoutes;\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.admin.NotFoundException;\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.common.url.PathTemplate;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestFilter;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestFilterV2;\nimport com.github.tomakehurst.wiremock.security.Authenticator;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\nimport org.wiremock.url.Path;\n\npublic class AdminRequestHandler extends AbstractRequestHandler {\n\n  private final AdminRoutes adminRoutes;\n  private final Admin admin;\n  private final Authenticator authenticator;\n  private final boolean requireHttps;\n\n  public AdminRequestHandler(\n      AdminRoutes adminRoutes,\n      Admin admin,\n      ResponseRenderer responseRenderer,\n      Authenticator authenticator,\n      boolean requireHttps,\n      List<RequestFilter> requestFilters,\n      List<RequestFilterV2> v2RequestFilters,\n      DataTruncationSettings dataTruncationSettings) {\n    super(responseRenderer, requestFilters, v2RequestFilters, dataTruncationSettings);\n    this.adminRoutes = adminRoutes;\n    this.admin = admin;\n    this.authenticator = authenticator;\n    this.requireHttps = requireHttps;\n  }\n\n  @Override\n  public ServeEvent handleRequest(ServeEvent initialServeEvent) {\n    final Request request = initialServeEvent.getRequest();\n\n    final boolean isRequestHttps = request.getTypedAbsoluteUrl().getScheme().equals(https);\n\n    if (requireHttps && !isRequestHttps) {\n      notifier().info(\"HTTPS is required for admin requests, sending upgrade redirect\");\n      return initialServeEvent.withResponseDefinition(\n          ResponseDefinition.notPermitted(\"HTTPS is required for accessing the admin API\"));\n    }\n\n    if (!authenticator.authenticate(request)) {\n      notifier()\n          .info(\n              \"Authentication failed for \"\n                  + request.getMethod()\n                  + \" \"\n                  + request.getPathAndQueryWithoutPrefix());\n      return initialServeEvent.withResponseDefinition(ResponseDefinition.notAuthorised());\n    }\n\n    notifier().info(\"Admin request received:\\n\" + formatRequest(request));\n    Path path = withoutAdminRoot(request.getPathAndQueryWithoutPrefix().getPath());\n\n    try {\n      AdminTask adminTask = adminRoutes.taskFor(request.getMethod(), path);\n\n      PathTemplate uriTemplate =\n          adminRoutes.requestSpecForTask(adminTask.getClass()).getUriTemplate();\n      PathParams pathParams = uriTemplate.parse(path);\n\n      return initialServeEvent.withResponseDefinition(\n          adminTask.execute(admin, initialServeEvent, pathParams));\n    } catch (NotFoundException e) {\n      return initialServeEvent.withResponseDefinition(ResponseDefinition.notConfigured());\n    } catch (InvalidParameterException ipe) {\n      return initialServeEvent.withResponseDefinition(\n          ResponseDefinition.badRequest(ipe.getErrors()));\n    } catch (InvalidInputException iie) {\n      return initialServeEvent.withResponseDefinition(\n          ResponseDefinition.badRequestEntity(iie.getErrors()));\n    } catch (NotPermittedException npe) {\n      return initialServeEvent.withResponseDefinition(\n          ResponseDefinition.notPermitted(npe.getErrors()));\n    } catch (Throwable t) {\n      notifier().error(\"Unrecoverable error handling admin request\", t);\n      throw t;\n    }\n  }\n\n  private static Path withoutAdminRoot(Path url) {\n    return Path.of(\n        url.getSegments().stream()\n            .filter(segment -> !segment.equals(ADMIN_CONTEXT_ROOT_SEGMENT))\n            .toList());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/BasicResponseRenderer.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.http.Response.response;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class BasicResponseRenderer implements ResponseRenderer {\n\n  @Override\n  public Response render(ServeEvent serveEvent) {\n    ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();\n    return response()\n        .status(responseDefinition.getStatus())\n        .headers(responseDefinition.getHeaders())\n        .body(responseDefinition.getByteBody())\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/Body.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.decodeBase64;\nimport static com.github.tomakehurst.wiremock.common.Encoding.encodeBase64;\nimport static com.github.tomakehurst.wiremock.common.Strings.stringFromBytes;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.node.NullNode;\nimport com.github.tomakehurst.wiremock.common.ContentTypes;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport java.util.Arrays;\nimport java.util.Objects;\n\npublic class Body {\n\n  private final byte[] content;\n  private final boolean binary;\n  private final boolean json;\n\n  public Body(byte[] content) {\n    this(content, true);\n  }\n\n  public Body(String content) {\n    this.content = Strings.bytesFromString(content);\n    binary = false;\n    json = false;\n  }\n\n  private Body(byte[] content, boolean binary) {\n    this.content = content;\n    this.binary = binary;\n    json = false;\n  }\n\n  private Body(byte[] content, boolean binary, boolean json) {\n    this.content = content;\n    this.binary = binary;\n    this.json = json;\n  }\n\n  private Body(JsonNode content) {\n    this.content = Json.toByteArray(content);\n    binary = false;\n    json = true;\n  }\n\n  public static Body fromJsonBytes(byte[] bytes) {\n    return bytes != null ? new Body(bytes, false, true) : none();\n  }\n\n  public static Body ofBinaryOrText(byte[] content, ContentTypeHeader contentTypeHeader) {\n    return new Body(\n        content, !ContentTypes.determineIsTextFromMimeType(contentTypeHeader.mimeTypePart()));\n  }\n\n  public static Body fromOneOf(byte[] bytes, String str, JsonNode json, String base64) {\n    if (bytes != null) return new Body(bytes);\n    if (str != null) return new Body(str);\n    if (json != null && !(json instanceof NullNode)) return new Body(json);\n    if (base64 != null) return new Body(decodeBase64(base64), true);\n\n    return none();\n  }\n\n  private static final Body EMPTY_BODY = new Body((byte[]) null);\n\n  public static Body none() {\n    return EMPTY_BODY;\n  }\n\n  public String asString() {\n    return content != null ? stringFromBytes(content) : null;\n  }\n\n  public byte[] asBytes() {\n    return content != null ? content : null;\n  }\n\n  public String asBase64() {\n    return encodeBase64(content);\n  }\n\n  public boolean isBinary() {\n    return binary;\n  }\n\n  public JsonNode asJson() {\n    return Json.node(asString());\n  }\n\n  public boolean isJson() {\n    return json;\n  }\n\n  public boolean isAbsent() {\n    return content == null;\n  }\n\n  public boolean isPresent() {\n    return !isAbsent();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    Body body = (Body) o;\n    return Objects.equals(binary, body.binary) && Arrays.equals(content, body.content);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(Arrays.hashCode(content), binary);\n  }\n\n  @Override\n  public String toString() {\n    return \"Body {\" + \"content=\" + asString() + \", binary=\" + binary + \", json=\" + json + '}';\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/CaseInsensitiveKey.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport java.util.function.Function;\n\npublic class CaseInsensitiveKey {\n\n  private final String key;\n\n  /** Cache the hash code for the key */\n  private int hash; // Default to 0\n\n  public CaseInsensitiveKey(String key) {\n    this.key = key;\n  }\n\n  public static CaseInsensitiveKey from(String key) {\n    return new CaseInsensitiveKey(key);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    CaseInsensitiveKey that = (CaseInsensitiveKey) o;\n\n    if (key != null ? !key.equalsIgnoreCase(that.key) : that.key != null) return false;\n\n    return true;\n  }\n\n  @Override\n  public int hashCode() {\n    int h = hash;\n    if (h == 0 && key.length() > 0) {\n      for (int i = 0; i < key.length(); i++) {\n        char c = Character.toLowerCase(key.charAt(i));\n        h = 31 * h + c;\n      }\n      hash = h;\n    }\n    return h;\n  }\n\n  @Override\n  public String toString() {\n    return key;\n  }\n\n  public String value() {\n    return key;\n  }\n\n  public static final Function<String, CaseInsensitiveKey> TO_CASE_INSENSITIVE_KEYS =\n      CaseInsensitiveKey::from;\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ChunkedDribbleDelay.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class ChunkedDribbleDelay {\n\n  private final Integer numberOfChunks;\n  private final Integer totalDuration;\n\n  @JsonCreator\n  public ChunkedDribbleDelay(\n      @JsonProperty(\"numberOfChunks\") Integer numberOfChunks,\n      @JsonProperty(\"totalDuration\") Integer totalDuration) {\n    this.numberOfChunks = numberOfChunks;\n    this.totalDuration = totalDuration;\n  }\n\n  public Integer getNumberOfChunks() {\n    return numberOfChunks;\n  }\n\n  public Integer getTotalDuration() {\n    return totalDuration;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ContentTypeHeader.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport java.nio.charset.Charset;\nimport java.nio.charset.UnsupportedCharsetException;\nimport java.util.Optional;\n\npublic class ContentTypeHeader extends HttpHeader {\n\n  public static final String KEY = \"Content-Type\";\n\n  private String[] parts;\n\n  public ContentTypeHeader(String stringValue) {\n    super(KEY, stringValue);\n    parts = stringValue != null ? stringValue.split(\";\") : new String[0];\n  }\n\n  private ContentTypeHeader() {\n    super(KEY);\n  }\n\n  public static ContentTypeHeader absent() {\n    return new ContentTypeHeader();\n  }\n\n  public ContentTypeHeader or(String stringValue) {\n    return isPresent() ? this : new ContentTypeHeader(stringValue);\n  }\n\n  public String mimeTypePart() {\n    return parts != null && parts.length > 0 ? parts[0] : null;\n  }\n\n  public Optional<String> encodingPart() {\n    for (int i = 1; i < parts.length; i++) {\n      if (parts[i].matches(\"\\\\s*charset\\\\s*=.*\")) {\n        return Optional.of(parts[i].split(\"=\")[1].replace(\"\\\"\", \"\"));\n      }\n    }\n\n    return Optional.empty();\n  }\n\n  public Charset charset() {\n    if (isPresent() && encodingPart().isPresent()) {\n      try {\n        return Charset.forName(encodingPart().get());\n      } catch (UnsupportedCharsetException ignored) {\n        return UTF_8;\n      }\n    }\n\n    return UTF_8;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/Cookie.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static java.util.Arrays.asList;\nimport static java.util.Collections.singletonList;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonValue;\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class Cookie extends MultiValue {\n\n  @JsonCreator\n  public static Cookie cookie(ListOrSingle<String> values) {\n    return new Cookie(null, values);\n  }\n\n  public static Cookie cookie(String value) {\n    return new Cookie(null, value);\n  }\n\n  public static Cookie absent() {\n    return new Cookie(null, Collections.emptyList());\n  }\n\n  public Cookie(String value) {\n    super(null, singletonList(value));\n  }\n\n  public Cookie(List<String> values) {\n    this(null, values);\n  }\n\n  public Cookie(String name, String... value) {\n    super(name, asList(value));\n  }\n\n  public Cookie(String name, List<String> values) {\n    super(name, values);\n  }\n\n  @JsonIgnore\n  public boolean isAbsent() {\n    return !isPresent();\n  }\n\n  @JsonValue\n  public ListOrSingle<String> getValues() {\n    return new ListOrSingle<>(isPresent() ? values() : Collections.emptyList());\n  }\n\n  @JsonIgnore\n  public String getValue() {\n    return firstValue();\n  }\n\n  @Override\n  public String toString() {\n    return isAbsent() ? \"(absent)\" : String.join(\"; \", getValues());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/DefaultFactory.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\n/**\n * Marker interface signifying this factory should only be used if user-supplied extensions are not\n * present.\n */\npublic interface DefaultFactory {}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/DelayDistribution.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.annotation.JsonSubTypes;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\n\n/**\n * Distribution that models delays.\n *\n * <p>Implementations should be thread safe.\n */\n@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = \"type\")\n@JsonSubTypes({\n  @JsonSubTypes.Type(value = LogNormal.class, name = \"lognormal\"),\n  @JsonSubTypes.Type(value = UniformDistribution.class, name = \"uniform\"),\n  @JsonSubTypes.Type(value = FixedDelayDistribution.class, name = \"fixed\")\n})\npublic interface DelayDistribution {\n  /**\n   * Samples a delay in milliseconds from the distribution.\n   *\n   * @return next delay in millis\n   */\n  long sampleMillis();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/Fault.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.github.tomakehurst.wiremock.core.FaultInjector;\n\npublic enum Fault {\n  CONNECTION_RESET_BY_PEER {\n    @Override\n    public void apply(FaultInjector faultInjector) {\n      faultInjector.connectionResetByPeer();\n    }\n  },\n\n  EMPTY_RESPONSE {\n    @Override\n    public void apply(FaultInjector faultInjector) {\n      faultInjector.emptyResponseAndCloseConnection();\n    }\n  },\n\n  MALFORMED_RESPONSE_CHUNK {\n    @Override\n    public void apply(FaultInjector faultInjector) {\n      faultInjector.malformedResponseChunk();\n    }\n  },\n\n  RANDOM_DATA_THEN_CLOSE {\n    @Override\n    public void apply(FaultInjector faultInjector) {\n      faultInjector.randomDataAndCloseConnection();\n    }\n  };\n\n  public abstract void apply(FaultInjector faultInjector);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/FixedDelayDistribution.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class FixedDelayDistribution implements DelayDistribution {\n\n  private final long milliseconds;\n\n  public FixedDelayDistribution(@JsonProperty(\"milliseconds\") long milliseconds) {\n    this.milliseconds = milliseconds;\n  }\n\n  public long getMilliseconds() {\n    return milliseconds;\n  }\n\n  @Override\n  public long sampleMillis() {\n    return milliseconds;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/FormParameter.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class FormParameter extends MultiValue {\n\n  public FormParameter(\n      @JsonProperty(\"key\") String key, @JsonProperty(\"values\") List<String> values) {\n    super(key, values);\n  }\n\n  public static FormParameter absent(String key) {\n    return new FormParameter(key, Collections.emptyList());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/HttpHeader.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static java.util.Arrays.asList;\n\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class HttpHeader extends MultiValue {\n\n  public HttpHeader(String key, String... values) {\n    super(key, asList(values));\n  }\n\n  public HttpHeader(CaseInsensitiveKey key, Collection<String> values) {\n    super(key.value(), List.copyOf(values));\n  }\n\n  public HttpHeader(String key, Collection<String> values) {\n    super(key, List.copyOf(getFirstNonNull(values, Collections.emptyList())));\n  }\n\n  public static HttpHeader httpHeader(CaseInsensitiveKey key, String... values) {\n    return new HttpHeader(key.value(), values);\n  }\n\n  public static HttpHeader httpHeader(String key, String... values) {\n    return new HttpHeader(key, values);\n  }\n\n  public static HttpHeader absent(String key) {\n    return new HttpHeader(key);\n  }\n\n  public static HttpHeader empty(String key) {\n    return httpHeader(key, \"\");\n  }\n\n  public CaseInsensitiveKey caseInsensitiveKey() {\n    return CaseInsensitiveKey.from(key);\n  }\n\n  public boolean keyEquals(String candidateKey) {\n    return CaseInsensitiveKey.from(candidateKey).equals(caseInsensitiveKey());\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    HttpHeader that = (HttpHeader) o;\n\n    if (key != null ? !key.equalsIgnoreCase(that.key) : that.key != null) return false;\n    if (values != null ? !values.equals(that.values) : that.values != null) return false;\n\n    return true;\n  }\n\n  @Override\n  public int hashCode() {\n    int result = key != null ? key.toLowerCase().hashCode() : 0;\n    result = 31 * result + (values != null ? values.hashCode() : 0);\n    return result;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/HttpHeaders.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static java.util.Arrays.asList;\n\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.fasterxml.jackson.databind.annotation.JsonSerialize;\nimport com.google.common.collect.ImmutableMultimap;\nimport com.google.common.collect.ListMultimap;\nimport com.google.common.collect.Multimap;\nimport com.google.common.collect.MultimapBuilder;\nimport java.util.*;\nimport java.util.function.Consumer;\nimport java.util.stream.Collectors;\n\n@JsonSerialize(using = HttpHeadersJsonSerializer.class)\n@JsonDeserialize(using = HttpHeadersJsonDeserializer.class)\npublic class HttpHeaders {\n\n  private final Multimap<CaseInsensitiveKey, String> headers;\n\n  public HttpHeaders() {\n    headers = ImmutableMultimap.of();\n  }\n\n  public HttpHeaders(HttpHeader... headers) {\n    this(Arrays.asList(headers));\n  }\n\n  public HttpHeaders(Iterable<HttpHeader> headers) {\n    ImmutableMultimap.Builder<CaseInsensitiveKey, String> builder = ImmutableMultimap.builder();\n    for (HttpHeader header : getFirstNonNull(headers, Collections.<HttpHeader>emptyList())) {\n      builder.putAll(caseInsensitive(header.key()), header.values());\n    }\n\n    this.headers = builder.build();\n  }\n\n  public HttpHeaders(HttpHeaders headers) {\n    this(headers.all());\n  }\n\n  private HttpHeaders(Multimap<CaseInsensitiveKey, String> headers) {\n    this.headers = ImmutableMultimap.copyOf(headers);\n  }\n\n  public static HttpHeaders noHeaders() {\n    return new HttpHeaders();\n  }\n\n  public HttpHeader getHeader(String key) {\n    if (!headers.containsKey(caseInsensitive(key))) {\n      return HttpHeader.absent(key);\n    }\n\n    Collection<String> values = headers.get(caseInsensitive(key));\n    return new HttpHeader(key, values);\n  }\n\n  public ContentTypeHeader getContentTypeHeader() {\n    HttpHeader header = getHeader(ContentTypeHeader.KEY);\n    if (header.isPresent()) {\n      return new ContentTypeHeader(header.firstValue());\n    }\n\n    return ContentTypeHeader.absent();\n  }\n\n  public Collection<HttpHeader> all() {\n    List<HttpHeader> httpHeaderList = new ArrayList<>();\n    for (CaseInsensitiveKey key : headers.keySet()) {\n      httpHeaderList.add(new HttpHeader(key.value(), headers.get(key)));\n    }\n\n    return httpHeaderList;\n  }\n\n  public Set<String> keys() {\n    return headers.keySet().stream().map(CaseInsensitiveKey::toString).collect(Collectors.toSet());\n  }\n\n  public static HttpHeaders copyOf(HttpHeaders source) {\n    return new HttpHeaders(source);\n  }\n\n  public HttpHeaders transform(Consumer<Builder> transformer) {\n    final Builder builder = new Builder(this);\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public int size() {\n    return headers.asMap().size();\n  }\n\n  public HttpHeaders plus(HttpHeader... additionalHeaders) {\n    List<HttpHeader> httpHeaders = new ArrayList<>(all());\n    httpHeaders.addAll(asList(additionalHeaders));\n    return new HttpHeaders(httpHeaders);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    HttpHeaders that = (HttpHeaders) o;\n\n    return headers != null ? headers.equals(that.headers) : that.headers == null;\n  }\n\n  @Override\n  public int hashCode() {\n    return headers != null ? headers.hashCode() : 0;\n  }\n\n  @Override\n  public String toString() {\n    if (headers.isEmpty()) {\n      return \"(no headers)\\n\";\n    }\n\n    StringBuilder outString = new StringBuilder();\n    for (CaseInsensitiveKey key : headers.keySet()) {\n      outString.append(key.toString()).append(\": \").append(headers.get(key)).append(\"\\n\");\n    }\n\n    return outString.toString();\n  }\n\n  private CaseInsensitiveKey caseInsensitive(String key) {\n    return new CaseInsensitiveKey(key);\n  }\n\n  @SuppressWarnings(\"UnusedReturnValue\")\n  public static class Builder {\n    private final ListMultimap<CaseInsensitiveKey, String> headers =\n        MultimapBuilder.linkedHashKeys().arrayListValues().build();\n\n    public Builder() {}\n\n    public Builder(HttpHeaders httpHeaders) {\n      headers.putAll(httpHeaders.headers);\n    }\n\n    public Builder setAll(HttpHeader... headers) {\n      return setAll(List.of(headers));\n    }\n\n    public Builder setAll(Iterable<HttpHeader> headers) {\n      removeAll();\n      for (HttpHeader header : headers) {\n        add(header.caseInsensitiveKey(), header.values());\n      }\n      return this;\n    }\n\n    public Builder addAll(HttpHeader... headers) {\n      return addAll(List.of(headers));\n    }\n\n    public Builder addAll(Iterable<HttpHeader> headers) {\n      for (HttpHeader header : headers) {\n        add(header.caseInsensitiveKey(), header.values());\n      }\n      return this;\n    }\n\n    public Builder set(String key, String... values) {\n      return set(new CaseInsensitiveKey(key), values);\n    }\n\n    public Builder set(CaseInsensitiveKey key, String... values) {\n      set(key, List.of(values));\n      return this;\n    }\n\n    public Builder set(String key, Iterable<String> values) {\n      return set(new CaseInsensitiveKey(key), values);\n    }\n\n    public Builder set(CaseInsensitiveKey key, Iterable<String> values) {\n      headers.replaceValues(key, values);\n      return this;\n    }\n\n    public Builder add(String key, String... values) {\n      add(new CaseInsensitiveKey(key), values);\n      return this;\n    }\n\n    public Builder add(CaseInsensitiveKey key, String... values) {\n      add(key, List.of(values));\n      return this;\n    }\n\n    public Builder add(String key, Iterable<String> values) {\n      add(new CaseInsensitiveKey(key), values);\n      return this;\n    }\n\n    public Builder add(CaseInsensitiveKey key, Iterable<String> values) {\n      headers.putAll(key, values);\n      return this;\n    }\n\n    public Builder remove(String key) {\n      return remove(new CaseInsensitiveKey(key));\n    }\n\n    public Builder remove(CaseInsensitiveKey key) {\n      headers.removeAll(key);\n      return this;\n    }\n\n    public Builder removeAll() {\n      headers.clear();\n      return this;\n    }\n\n    public List<String> get(String key) {\n      return get(new CaseInsensitiveKey(key));\n    }\n\n    public List<String> get(CaseInsensitiveKey key) {\n      return headers.get(key);\n    }\n\n    public Set<CaseInsensitiveKey> keys() {\n      return headers.keySet();\n    }\n\n    public HttpHeaders build() {\n      return new HttpHeaders(headers);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/HttpHeadersJsonDeserializer.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport java.io.IOException;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Collectors;\nimport java.util.stream.StreamSupport;\n\npublic class HttpHeadersJsonDeserializer extends JsonDeserializer<HttpHeaders> {\n\n  @Override\n  public HttpHeaders deserialize(JsonParser parser, DeserializationContext context)\n      throws IOException {\n    JsonNode rootNode = parser.readValueAsTree();\n    Iterable<Map.Entry<String, JsonNode>> all = rootNode::fields;\n    List<HttpHeader> headers =\n        StreamSupport.stream(all.spliterator(), false)\n            .map(entry -> createHttpHeader(entry.getKey(), entry.getValue()))\n            .collect(Collectors.toList());\n    return new HttpHeaders(headers);\n  }\n\n  private static HttpHeader createHttpHeader(String key, JsonNode fieldValue) {\n    if (fieldValue.isArray()) {\n      Iterable<JsonNode> all = fieldValue::elements;\n      List<String> headerValues =\n          StreamSupport.stream(all.spliterator(), false)\n              .map(JsonNode::textValue)\n              .collect(Collectors.toList());\n      return new HttpHeader(key, headerValues);\n    } else {\n      return new HttpHeader(key, fieldValue.textValue());\n    }\n  }\n\n  public static <T> Iterable<T> all(final Iterator<T> underlyingIterator) {\n    return () -> underlyingIterator;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/HttpHeadersJsonSerializer.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.databind.JsonSerializer;\nimport com.fasterxml.jackson.databind.SerializerProvider;\nimport java.io.IOException;\n\npublic class HttpHeadersJsonSerializer extends JsonSerializer<HttpHeaders> {\n\n  @Override\n  public void serialize(HttpHeaders headers, JsonGenerator jgen, SerializerProvider provider)\n      throws IOException {\n    jgen.writeStartObject();\n    for (HttpHeader header : headers.all()) {\n      if (header.isSingleValued()) {\n        jgen.writeStringField(header.key(), header.firstValue());\n      } else {\n        jgen.writeArrayFieldStart(header.key());\n        for (String value : header.values()) {\n          jgen.writeString(value);\n        }\n        jgen.writeEndArray();\n      }\n    }\n    jgen.writeEndObject();\n  }\n\n  @Override\n  public boolean isEmpty(SerializerProvider provider, HttpHeaders value) {\n    return value.size() == 0;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/HttpResponder.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport java.util.Map;\n\npublic interface HttpResponder {\n  void respond(Request request, Response response, Map<String, Object> attributes);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/HttpServer.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\npublic interface HttpServer {\n  void start();\n\n  void stop();\n\n  boolean isRunning();\n\n  int port();\n\n  int httpsPort();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/HttpServerFactory.java",
    "content": "/*\n * Copyright (C) 2014-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\n\n@FunctionalInterface\npublic interface HttpServerFactory extends Extension {\n\n  @Override\n  default String getName() {\n    return \"http-server-factory-\" + getClass().getSimpleName();\n  }\n\n  HttpServer buildHttpServer(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler,\n      MessageStubRequestHandler messageStubRequestHandler);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/HttpStatus.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\npublic class HttpStatus {\n\n  public static boolean isSuccess(int code) {\n    return ((200 <= code) && (code <= 299));\n  }\n\n  public static boolean isRedirection(int code) {\n    return ((300 <= code) && (code <= 399));\n  }\n\n  public static boolean isClientError(int code) {\n    return ((400 <= code) && (code <= 499));\n  }\n\n  public static boolean isServerError(int code) {\n    return ((500 <= code) && (code <= 599));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ImmutableRequest.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.encodeBase64;\nimport static java.util.Objects.requireNonNull;\n\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport org.jspecify.annotations.NonNull;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\nimport org.wiremock.url.Port;\n\npublic class ImmutableRequest implements Request {\n\n  private final @NonNull AbsoluteUrl absoluteUrl;\n  private final @NonNull PathAndQuery pathAndQuery;\n  private final RequestMethod method;\n  private final String protocol;\n  private final String scheme;\n  private final String host;\n  private final int port;\n  private final String clientIp;\n  private final HttpHeaders headers;\n  private final byte[] body;\n  private final boolean multipart;\n\n  private final Map<String, Part> parts;\n  private final boolean browserProxyRequest;\n\n  public static Builder create() {\n    return new Builder();\n  }\n\n  protected ImmutableRequest(\n      @NonNull AbsoluteUrl absoluteUrl,\n      RequestMethod method,\n      String protocol,\n      String clientIp,\n      HttpHeaders headers,\n      byte[] body,\n      boolean multipart,\n      boolean browserProxyRequest) {\n    this.absoluteUrl = absoluteUrl;\n    this.pathAndQuery = this.absoluteUrl.getPathAndQuery();\n    this.method = requireNonNull(method);\n    this.protocol = protocol;\n\n    this.scheme = this.absoluteUrl.getScheme().toString();\n    this.host = this.absoluteUrl.getAuthority().getHost().toString();\n    Port maybePort = this.absoluteUrl.getPort();\n    this.port = maybePort != null ? maybePort.getIntValue() : -1;\n\n    this.clientIp = clientIp;\n    this.headers = headers;\n    this.body = body;\n    this.multipart = multipart;\n    this.parts = Collections.emptyMap();\n    this.browserProxyRequest = browserProxyRequest;\n  }\n\n  @Override\n  public @NonNull String getUrl() {\n    return pathAndQuery.toString();\n  }\n\n  @Override\n  public @NonNull PathAndQuery getPathAndQueryWithoutPrefix() {\n    return pathAndQuery;\n  }\n\n  @Override\n  public @NonNull String getAbsoluteUrl() {\n    return absoluteUrl.toString();\n  }\n\n  @Override\n  public @NonNull AbsoluteUrl getTypedAbsoluteUrl() {\n    return absoluteUrl;\n  }\n\n  @Override\n  public RequestMethod getMethod() {\n    return method;\n  }\n\n  @Override\n  public String getScheme() {\n    return scheme;\n  }\n\n  @Override\n  public String getHost() {\n    return host;\n  }\n\n  @Override\n  public int getPort() {\n    return port;\n  }\n\n  @Override\n  public String getClientIp() {\n    return clientIp;\n  }\n\n  @Override\n  public String getHeader(String key) {\n    final HttpHeader header = header(key);\n    return header.isPresent() ? header.firstValue() : null;\n  }\n\n  @Override\n  public HttpHeader header(String key) {\n    return headers.getHeader(key);\n  }\n\n  @Override\n  public ContentTypeHeader contentTypeHeader() {\n    return headers.getContentTypeHeader();\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    return headers;\n  }\n\n  @Override\n  public boolean containsHeader(String key) {\n    return headers.getHeader(key).isPresent();\n  }\n\n  @Override\n  public Set<String> getAllHeaderKeys() {\n    return headers.keys();\n  }\n\n  @Override\n  public FormParameter formParameter(String key) {\n    return null;\n  }\n\n  @Override\n  public Map<String, FormParameter> formParameters() {\n    return Collections.emptyMap();\n  }\n\n  @Override\n  public Map<String, Cookie> getCookies() {\n    return Collections.emptyMap();\n  }\n\n  @Override\n  public byte[] getBody() {\n    return body;\n  }\n\n  @Override\n  public String getBodyAsString() {\n    return Strings.stringFromBytes(body);\n  }\n\n  @Override\n  public String getBodyAsBase64() {\n    return encodeBase64(getBody());\n  }\n\n  @Override\n  public boolean isMultipart() {\n    return multipart;\n  }\n\n  @Override\n  public Collection<Part> getParts() {\n    return parts.values();\n  }\n\n  @Override\n  public Part getPart(String name) {\n    return parts.get(name);\n  }\n\n  @Override\n  public boolean isBrowserProxyRequest() {\n    return browserProxyRequest;\n  }\n\n  @Override\n  public Optional<Request> getOriginalRequest() {\n    return Optional.empty();\n  }\n\n  @Override\n  public String getProtocol() {\n    return protocol;\n  }\n\n  public static class Builder {\n    private AbsoluteUrl absoluteUrl;\n    private RequestMethod requestMethod;\n    private String protocol;\n    private String clientIp;\n    private List<HttpHeader> headers = new ArrayList<>();\n    private byte[] body;\n    private boolean multipart;\n    private boolean browserProxyRequest;\n\n    public Builder withAbsoluteUrl(AbsoluteUrl absoluteUrl) {\n      this.absoluteUrl = absoluteUrl;\n      return this;\n    }\n\n    public Builder withAbsoluteUrl(String absoluteUrl) {\n      this.absoluteUrl = AbsoluteUrl.parse(absoluteUrl);\n      return this;\n    }\n\n    public Builder withMethod(RequestMethod requestMethod) {\n      this.requestMethod = requestMethod;\n      return this;\n    }\n\n    public Builder withProtocol(String protocol) {\n      this.protocol = protocol;\n      return this;\n    }\n\n    public Builder withClientIp(String clientIp) {\n      this.clientIp = clientIp;\n      return this;\n    }\n\n    public Builder withHeaders(HttpHeaders headers) {\n      this.headers = new ArrayList<>(headers.all());\n      return this;\n    }\n\n    public Builder withHeader(String key, String value) {\n      this.headers.add(new HttpHeader(key, Collections.singletonList(value)));\n      return this;\n    }\n\n    public Builder withHeader(String key, Collection<String> values) {\n      this.headers.add(new HttpHeader(key, values));\n      return this;\n    }\n\n    public Builder withBody(byte[] body) {\n      this.body = body;\n      return this;\n    }\n\n    public Builder withMultipart(boolean multipart) {\n      this.multipart = multipart;\n      return this;\n    }\n\n    public Builder withBrowserProxyRequest(boolean browserProxyRequest) {\n      this.browserProxyRequest = browserProxyRequest;\n      return this;\n    }\n\n    public ImmutableRequest build() {\n      return new ImmutableRequest(\n          absoluteUrl,\n          requestMethod,\n          protocol,\n          clientIp,\n          new HttpHeaders(headers),\n          body,\n          multipart,\n          browserProxyRequest);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/JvmProxyConfigurer.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static java.util.Arrays.asList;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\npublic class JvmProxyConfigurer {\n\n  private static final String HTTP_PROXY_HOST = \"http.proxyHost\";\n  private static final String HTTP_PROXY_PORT = \"http.proxyPort\";\n  private static final String HTTPS_PROXY_HOST = \"https.proxyHost\";\n  private static final String HTTPS_PROXY_PORT = \"https.proxyPort\";\n  private static final String HTTP_NON_PROXY_HOSTS = \"http.nonProxyHosts\";\n  private static final List<String> ALL_PROXY_SETTINGS =\n      asList(\n          HTTP_PROXY_HOST,\n          HTTP_PROXY_PORT,\n          HTTPS_PROXY_HOST,\n          HTTPS_PROXY_PORT,\n          HTTP_NON_PROXY_HOSTS);\n\n  private static final Map<String, String> previousSettings = new HashMap<>();\n\n  public static void configureFor(WireMockServer wireMockServer) {\n    stashPreviousSettings();\n\n    configureFor(wireMockServer.port());\n  }\n\n  public static void configureFor(int port) {\n    System.setProperty(HTTP_PROXY_HOST, \"localhost\");\n    System.setProperty(HTTP_PROXY_PORT, String.valueOf(port));\n    System.setProperty(HTTPS_PROXY_HOST, \"localhost\");\n    System.setProperty(HTTPS_PROXY_PORT, String.valueOf(port));\n    System.setProperty(HTTP_NON_PROXY_HOSTS, \"localhost|127.*|[::1]\");\n  }\n\n  public static void restorePrevious() {\n    ALL_PROXY_SETTINGS.forEach(\n        key -> {\n          final String previous = previousSettings.get(key);\n          if (previous == null) {\n            System.clearProperty(key);\n          } else {\n            System.setProperty(key, previous);\n          }\n        });\n  }\n\n  private static void stashPreviousSettings() {\n    ALL_PROXY_SETTINGS.forEach(key -> previousSettings.put(key, System.getProperty(key)));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/LogNormal.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.concurrent.ThreadLocalRandom;\n\n/**\n * Returns log normally distributed values. Takes two parameters, the median (50th percentile) of\n * the lognormal and the standard deviation of the underlying normal distribution, plus an optional\n * maximum value to truncate the result by resampling to prevent an extra long tail\n *\n * <p>The larger the standard deviation the longer the tails.\n *\n * @see <a\n *     href=\"https://www.wolframalpha.com/input/?i=lognormaldistribution%28log%2890%29%2C+0.1%29\">lognormal\n *     example</a>\n */\npublic final class LogNormal implements DelayDistribution {\n\n  @JsonProperty(\"median\")\n  private final double median;\n\n  @JsonProperty(\"sigma\")\n  private final double sigma;\n\n  @JsonProperty(value = \"maxValue\", required = false)\n  private final Double maxValue;\n\n  /**\n   * @param median 50th percentile of the distribution in millis\n   * @param sigma standard deviation of the underlying normal distribution, a larger value produces\n   *     a longer tail\n   * @param maxValue the maximum value to truncate the distribution at, or null to disable\n   *     truncation\n   */\n  @JsonCreator\n  public LogNormal(\n      @JsonProperty(\"median\") double median,\n      @JsonProperty(\"sigma\") double sigma,\n      @JsonProperty(\"maxValue\") Double maxValue) {\n    this.median = median;\n    this.sigma = sigma;\n    this.maxValue = maxValue;\n\n    if (maxValue != null && maxValue < median) {\n      throw new IllegalArgumentException(\n          String.format(\n              \"The max value (%s) has to be greater than or equal to the median (%s). Sigma: %s\",\n              maxValue, median, sigma));\n    }\n  }\n\n  /**\n   * @param median 50th percentile of the distribution in millis\n   * @param sigma standard deviation of the distribution, a larger value produces a longer tail\n   */\n  public LogNormal(double median, double sigma) {\n    // Initialise maxValue to null to disable long tail truncation\n    this(median, sigma, null);\n  }\n\n  @Override\n  public long sampleMillis() {\n\n    long generatedValue = generateDelayMillis();\n\n    if (maxValue == null) {\n      // Don't want to truncate any potential long tails\n      return generatedValue;\n    }\n\n    // Rather than truncating the value at the max, if it's over the max value, then resample, but\n    // only do that a few times\n    int i = 0;\n    while (generatedValue > maxValue && i < 10) {\n      generatedValue = generateDelayMillis();\n      i++;\n    }\n\n    // Belt and braces, in the unlikely event the generated value is still over the max, truncate\n    // it at the max\n    return Math.round(Math.min(maxValue, generatedValue));\n  }\n\n  private long generateDelayMillis() {\n    return Math.round(Math.exp(ThreadLocalRandom.current().nextGaussian() * sigma) * median);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/LoggedResponse.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.OCTET_STREAM;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.Encoding;\nimport com.github.tomakehurst.wiremock.common.Limit;\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport java.nio.charset.Charset;\n\npublic class LoggedResponse {\n\n  private final int status;\n  private final HttpHeaders headers;\n  private final byte[] body;\n  private final Fault fault;\n  private final boolean fromProxy;\n\n  public LoggedResponse(\n      @JsonProperty(\"status\") int status,\n      @JsonProperty(\"headers\") HttpHeaders headers,\n      @JsonProperty(\"bodyAsBase64\") String bodyAsBase64,\n      @JsonProperty(\"fault\") Fault fault,\n      @JsonProperty(\"body\") String ignoredBodyOnlyUsedForBinding,\n      @JsonProperty(\"fromProxy\") boolean fromProxy) {\n    this(status, headers, Encoding.decodeBase64(bodyAsBase64), fault, fromProxy);\n  }\n\n  private LoggedResponse(\n      int status, HttpHeaders headers, byte[] body, Fault fault, boolean fromProxy) {\n    this.status = status;\n    this.headers = headers;\n    this.body = body;\n    this.fault = fault;\n    this.fromProxy = fromProxy;\n  }\n\n  public static LoggedResponse from(Response response, Limit responseBodySizeLimit) {\n    return new LoggedResponse(\n        response.getStatus(),\n        response.getHeaders() == null || response.getHeaders().all().isEmpty()\n            ? null\n            : response.getHeaders(),\n        response.getBody(responseBodySizeLimit),\n        response.getFault(),\n        response.isFromProxy());\n  }\n\n  public int getStatus() {\n    return status;\n  }\n\n  public HttpHeaders getHeaders() {\n    return headers;\n  }\n\n  /**\n   * Retrieve body as a String encoded in the charset in the \"Content-Type\" header, or, if that's\n   * not present, the default character set (UTF-8)\n   *\n   * @return Encoded string\n   */\n  @JsonProperty(\"body\")\n  public String getBodyAsString() {\n    if (body == null) {\n      return \"\";\n    }\n\n    return Strings.stringFromBytes(body, getCharset());\n  }\n\n  @JsonIgnore\n  public String getMimeType() {\n    return headers == null || headers.getContentTypeHeader() == null\n        ? OCTET_STREAM\n        : headers.getContentTypeHeader().mimeTypePart();\n  }\n\n  @JsonIgnore\n  public Charset getCharset() {\n    return headers == null ? UTF_8 : headers.getContentTypeHeader().charset();\n  }\n\n  @JsonIgnore\n  public byte[] getBody() {\n    return body;\n  }\n\n  @JsonProperty(\"bodyAsBase64\")\n  public String getBodyAsBase64() {\n    return Encoding.encodeBase64(body);\n  }\n\n  public Fault getFault() {\n    return fault;\n  }\n\n  public boolean isFromProxy() {\n    return fromProxy;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/MimeType.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\npublic enum MimeType {\n  JSON(\"application/json\"),\n  XML(\"text/xml\"),\n  PLAIN(\"text/plain\");\n\n  private String mimeString;\n\n  private MimeType(String mimeString) {\n    this.mimeString = mimeString;\n  }\n\n  public String toString() {\n    return mimeString;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/MultiValue.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkState;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class MultiValue {\n\n  protected final String key;\n  protected final List<String> values;\n\n  public MultiValue(String key, List<String> values) {\n    this.key = key;\n    this.values = values;\n  }\n\n  public String getKey() {\n    return key;\n  }\n\n  public List<String> getValues() {\n    return values;\n  }\n\n  @JsonIgnore\n  public boolean isPresent() {\n    return !values.isEmpty();\n  }\n\n  public String key() {\n    return key;\n  }\n\n  public String firstValue() {\n    checkPresent();\n    return values.get(0);\n  }\n\n  public List<String> values() {\n    checkPresent();\n    return values;\n  }\n\n  private void checkPresent() {\n    checkState(isPresent(), \"No value for \" + key);\n  }\n\n  @JsonIgnore\n  public boolean isSingleValued() {\n    return values.size() == 1;\n  }\n\n  public boolean containsValue(String expectedValue) {\n    return values.contains(expectedValue);\n  }\n\n  public boolean hasValueMatching(final StringValuePattern valuePattern) {\n    return (valuePattern.nullSafeIsAbsent() && !isPresent()) || anyValueMatches(valuePattern);\n  }\n\n  private boolean anyValueMatches(final StringValuePattern valuePattern) {\n    return values.stream().anyMatch(headerValue -> valuePattern.match(headerValue).isExactMatch());\n  }\n\n  @Override\n  public String toString() {\n    return values.stream().map(value -> key + \": \" + value).collect(Collectors.joining(\"\\n\"));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ProxyResponseRenderer.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.http.Response.response;\nimport static java.net.HttpURLConnection.HTTP_INTERNAL_ERROR;\n\nimport com.github.tomakehurst.wiremock.common.ProhibitedNetworkAddressException;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.store.SettingsStore;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.io.IOException;\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport javax.net.ssl.SSLException;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.IllegalUriOrPart;\nimport org.wiremock.url.Path;\nimport org.wiremock.url.PathAndQuery;\n\npublic class ProxyResponseRenderer implements ResponseRenderer {\n\n  private final HttpClient reverseProxyClient;\n  private final HttpClient forwardProxyClient;\n  private final boolean preserveHostHeader;\n  private final String hostHeaderValue;\n  private final SettingsStore settingsStore;\n  private final boolean stubCorsEnabled;\n  private final Set<String> supportedEncodings;\n\n  @SuppressWarnings(\"unused\")\n  public ProxyResponseRenderer(\n      boolean preserveHostHeader,\n      String hostHeaderValue,\n      SettingsStore settingsStore,\n      boolean stubCorsEnabled,\n      HttpClient reverseProxyClient,\n      HttpClient forwardProxyClient) {\n\n    this(\n        preserveHostHeader,\n        hostHeaderValue,\n        settingsStore,\n        stubCorsEnabled,\n        null,\n        reverseProxyClient,\n        forwardProxyClient);\n  }\n\n  public ProxyResponseRenderer(\n      boolean preserveHostHeader,\n      String hostHeaderValue,\n      SettingsStore settingsStore,\n      boolean stubCorsEnabled,\n      Set<String> supportedEncodings,\n      HttpClient reverseProxyClient,\n      HttpClient forwardProxyClient) {\n\n    this.settingsStore = settingsStore;\n    this.preserveHostHeader = preserveHostHeader;\n    this.hostHeaderValue = hostHeaderValue;\n    this.stubCorsEnabled = stubCorsEnabled;\n    this.supportedEncodings = supportedEncodings;\n\n    this.forwardProxyClient = forwardProxyClient;\n    this.reverseProxyClient = reverseProxyClient;\n  }\n\n  @Override\n  public Response render(ServeEvent serveEvent) {\n    ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();\n\n    AbsoluteUrl proxyUrl = getProxyUrl(serveEvent);\n    if (proxyUrl == null) {\n      return response()\n          .status(HTTP_INTERNAL_ERROR)\n          .headers(new HttpHeaders(new HttpHeader(\"Content-Type\", \"text/plain\")))\n          .body(\n              \"The target proxy address `\"\n                  + serveEvent.getResponseDefinition().getProxyBaseUrl()\n                  + \"` is not an absolute URL.\")\n          .build();\n    }\n    final ImmutableRequest.Builder requestBuilder =\n        ImmutableRequest.create()\n            .withAbsoluteUrl(proxyUrl)\n            .withMethod(serveEvent.getRequest().getMethod());\n    addRequestHeaders(requestBuilder, responseDefinition, serveEvent.getRequest());\n\n    GlobalSettings settings = settingsStore.get();\n\n    Request originalRequest = serveEvent.getRequest();\n\n    boolean originalRequestBodyExists =\n        originalRequest.getBody() != null && originalRequest.getBody().length > 0;\n\n    if (originalRequestBodyExists || originalRequest.containsHeader(HttpClient.CONTENT_LENGTH)) {\n      requestBuilder.withBody(originalRequest.getBody());\n    }\n\n    Request request = requestBuilder.build();\n\n    HttpClient client = chooseClient(serveEvent.getRequest().isBrowserProxyRequest());\n\n    try {\n      final Response httpResponse = client.execute(request);\n      return Response.Builder.like(httpResponse)\n          .fromProxy(true)\n          .headers(headersFrom(httpResponse, responseDefinition))\n          .configureDelay(\n              settings.getFixedDelay(),\n              settings.getDelayDistribution(),\n              responseDefinition.getFixedDelayMilliseconds(),\n              responseDefinition.getDelayDistribution())\n          .chunkedDribbleDelay(responseDefinition.getChunkedDribbleDelay())\n          .build();\n    } catch (ProhibitedNetworkAddressException e) {\n      return response()\n          .status(HTTP_INTERNAL_ERROR)\n          .headers(new HttpHeaders(new HttpHeader(\"Content-Type\", \"text/plain\")))\n          .body(\"The target proxy address is denied in WireMock's configuration.\")\n          .build();\n    } catch (SSLException e) {\n      return proxyResponseError(\"SSL\", request, e);\n    } catch (IOException e) {\n      return proxyResponseError(\"Network\", request, e);\n    }\n  }\n\n  private AbsoluteUrl getProxyUrl(ServeEvent serveEvent) {\n    final ResponseDefinition responseDef = serveEvent.getResponseDefinition();\n    AbsoluteUrl browserProxyUrl = responseDef.getBrowserProxyUrl();\n    if (browserProxyUrl != null) {\n      return browserProxyUrl;\n    }\n\n    String proxyBaseUrlStr = responseDef.getProxyBaseUrl();\n    if (proxyBaseUrlStr == null) {\n      return null;\n    }\n\n    try {\n      AbsoluteUrl baseUrl = AbsoluteUrl.parse(proxyBaseUrlStr).toBaseUrl();\n\n      Path prefixToRemove = responseDef.getProxyUrlPrefixToRemove();\n\n      PathAndQuery requestPathAndQuery = serveEvent.getRequest().getPathAndQueryWithoutPrefix();\n\n      var requestPathToProxy =\n          requestPathAndQuery\n              .getPath()\n              .removePrefix(prefixToRemove != null ? prefixToRemove : Path.EMPTY);\n\n      Path fullPath = baseUrl.getPath().append(requestPathToProxy);\n\n      return baseUrl.transform(b -> b.setPath(fullPath).setQuery(requestPathAndQuery.getQuery()));\n    } catch (IllegalUriOrPart e) {\n      return null;\n    }\n  }\n\n  private Response proxyResponseError(String type, Request request, Exception e) {\n    return response()\n        .status(HTTP_INTERNAL_ERROR)\n        .body(\n            type\n                + \" failure trying to make a proxied request from WireMock to \"\n                + request.getTypedAbsoluteUrl()\n                + \"\\r\\n\"\n                + e.getMessage())\n        .build();\n  }\n\n  private HttpClient chooseClient(boolean browserProxyRequest) {\n    if (browserProxyRequest) {\n      return forwardProxyClient;\n    } else {\n      return reverseProxyClient;\n    }\n  }\n\n  private HttpHeaders headersFrom(Response response, ResponseDefinition responseDefinition) {\n    List<HttpHeader> httpHeaders = new LinkedList<>();\n    for (HttpHeader header : response.getHeaders().all()) {\n      if (responseHeaderShouldBeTransferred(header.getKey())) {\n        httpHeaders.add(header);\n      }\n    }\n\n    httpHeaders.addAll(responseDefinition.getHeaders().all());\n\n    return new HttpHeaders(httpHeaders);\n  }\n\n  private void addRequestHeaders(\n      ImmutableRequest.Builder requestBuilder,\n      ResponseDefinition response,\n      Request originalRequest) {\n    List<String> removeProxyRequestHeaders =\n        response.getRemoveProxyRequestHeaders().stream().map(String::toLowerCase).toList();\n    for (String key : originalRequest.getAllHeaderKeys()) {\n      String lowerCaseKey = key.toLowerCase();\n      if (removeProxyRequestHeaders.contains(lowerCaseKey)) {\n        continue;\n      }\n      switch (lowerCaseKey) {\n        case HttpClient.HOST_HEADER:\n          addHostHeader(requestBuilder, response, key, originalRequest);\n          break;\n        case HttpClient.ACCEPT_ENCODING_HEADER:\n          addAcceptEncodingHeader(requestBuilder, key, originalRequest);\n          break;\n        default:\n          copyHeader(requestBuilder, key, originalRequest);\n          break;\n      }\n    }\n\n    {\n      for (String key : response.getAdditionalProxyRequestHeaders().keys()) {\n        requestBuilder.withHeader(\n            key, response.getAdditionalProxyRequestHeaders().getHeader(key).firstValue());\n      }\n    }\n  }\n\n  private void addHostHeader(\n      ImmutableRequest.Builder requestBuilder,\n      ResponseDefinition response,\n      String key,\n      Request originalRequest) {\n    if (preserveHostHeader) {\n      copyHeader(requestBuilder, key, originalRequest);\n    } else if (hostHeaderValue != null) {\n      requestBuilder.withHeader(key, hostHeaderValue);\n    } else if (response.getProxyBaseUrl() != null) {\n      AbsoluteUrl url = AbsoluteUrl.parse(response.getProxyBaseUrl());\n      requestBuilder.withHeader(key, url.getAuthority().getHostAndPort().toString());\n    }\n  }\n\n  private void addAcceptEncodingHeader(\n      ImmutableRequest.Builder requestBuilder, String key, Request originalRequest) {\n    if (supportedEncodings == null) {\n      copyHeader(requestBuilder, key, originalRequest);\n    } else {\n      List<String> prunedAcceptEncodings =\n          originalRequest.header(key).values().stream()\n              .flatMap(s -> Arrays.stream(s.split(\",\")))\n              .map(String::trim)\n              .filter(supportedEncodings::contains)\n              .collect(Collectors.toList());\n      if (!prunedAcceptEncodings.isEmpty()) {\n        requestBuilder.withHeader(key, String.join(\",\", prunedAcceptEncodings));\n      }\n    }\n  }\n\n  private static void copyHeader(\n      ImmutableRequest.Builder requestBuilder, String key, Request originalRequest) {\n    List<String> values = originalRequest.header(key).values();\n    requestBuilder.withHeader(key, values);\n  }\n\n  public boolean responseHeaderShouldBeTransferred(String key) {\n    final String lowerCaseKey = key.toLowerCase();\n    return !HttpClient.FORBIDDEN_RESPONSE_HEADERS.contains(lowerCaseKey)\n        && (!stubCorsEnabled || !lowerCaseKey.startsWith(\"access-control\"));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/QueryParameter.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static java.util.Arrays.asList;\n\nimport com.fasterxml.jackson.annotation.*;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class QueryParameter extends MultiValue {\n\n  @JsonCreator\n  public QueryParameter(\n      @JsonProperty(\"key\") String key, @JsonProperty(\"values\") List<String> values) {\n    super(key, values);\n  }\n\n  public static QueryParameter queryParam(String key, String... values) {\n    return new QueryParameter(key, asList(values));\n  }\n\n  public static QueryParameter absent(String key) {\n    return new QueryParameter(key, Collections.emptyList());\n  }\n\n  @JsonIgnore\n  @Override\n  public boolean isPresent() {\n    return super.isPresent();\n  }\n\n  @JsonProperty\n  @Override\n  public String key() {\n    return super.key();\n  }\n\n  @JsonProperty\n  @Override\n  public List<String> values() {\n    return super.values();\n  }\n\n  @JsonIgnore\n  @Override\n  public boolean isSingleValued() {\n    return super.isSingleValued();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/Request.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport java.util.Collection;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.UUID;\nimport org.jspecify.annotations.NonNull;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\nimport org.wiremock.url.Query;\n\npublic interface Request {\n\n  // This is populated by the serve event.\n  @JsonIgnore\n  default UUID getId() {\n    return null;\n  }\n\n  interface Part {\n    String getName();\n\n    String getFileName();\n\n    HttpHeader getHeader(String name);\n\n    HttpHeaders getHeaders();\n\n    Body getBody();\n  }\n\n  @Deprecated // use getPathAndQueryWithoutPrefix()\n  @NonNull String getUrl();\n\n  @JsonIgnore\n  default @NonNull PathAndQuery getPathAndQueryWithoutPrefix() {\n    return PathAndQuery.parse(getUrl());\n  }\n\n  @Deprecated // use getTypedAbsoluteUrl()\n  @Nullable String getAbsoluteUrl();\n\n  @JsonIgnore\n  default @Nullable AbsoluteUrl getTypedAbsoluteUrl() {\n    String absoluteUrl = getAbsoluteUrl();\n    return absoluteUrl != null ? AbsoluteUrl.parse(absoluteUrl) : null;\n  }\n\n  RequestMethod getMethod();\n\n  String getScheme();\n\n  String getHost();\n\n  int getPort();\n\n  String getClientIp();\n\n  String getHeader(String key);\n\n  HttpHeader header(String key);\n\n  ContentTypeHeader contentTypeHeader();\n\n  HttpHeaders getHeaders();\n\n  boolean containsHeader(String key);\n\n  Set<String> getAllHeaderKeys();\n\n  // These are calculated from other fields so should not be serialised\n  @JsonIgnore\n  default PathParams getPathParameters() {\n    return PathParams.empty();\n  }\n\n  @Deprecated // use getPathAndQueryWithoutPrefix().getQueryOrEmpty().get(key)\n  default @Nullable QueryParameter queryParameter(String key) {\n    PathAndQuery pathAndQuery = getPathAndQueryWithoutPrefix();\n    Query query = pathAndQuery.getQueryOrEmpty();\n    return new QueryParameter(key, query.getDecoded(key));\n  }\n\n  FormParameter formParameter(String key);\n\n  Map<String, FormParameter> formParameters();\n\n  Map<String, Cookie> getCookies();\n\n  byte[] getBody();\n\n  String getBodyAsString();\n\n  String getBodyAsBase64();\n\n  boolean isMultipart();\n\n  Collection<Part> getParts();\n\n  Part getPart(String name);\n\n  boolean isBrowserProxyRequest();\n\n  Optional<Request> getOriginalRequest();\n\n  String getProtocol();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/RequestEventSource.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\npublic interface RequestEventSource {\n\n  void addRequestListener(RequestListener requestListener);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/RequestHandler.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic interface RequestHandler {\n\n  String HANDLER_CLASS_KEY = \"RequestHandlerClass\";\n\n  void handle(Request request, HttpResponder httpResponder, ServeEvent originalServeEvent);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/RequestIdDecorator.java",
    "content": "/*\n * Copyright (C) 2024-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport java.util.Collection;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.UUID;\nimport org.jspecify.annotations.NonNull;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\n\npublic class RequestIdDecorator implements Request {\n\n  private final Request request;\n  private final UUID id;\n\n  public RequestIdDecorator(Request request, UUID id) {\n    this.request = request;\n    this.id = id;\n  }\n\n  @Override\n  public UUID getId() {\n    return id;\n  }\n\n  @Override\n  public @NonNull String getUrl() {\n    return request.getUrl();\n  }\n\n  @Override\n  public @NonNull PathAndQuery getPathAndQueryWithoutPrefix() {\n    return request.getPathAndQueryWithoutPrefix();\n  }\n\n  @Override\n  public @Nullable String getAbsoluteUrl() {\n    return request.getAbsoluteUrl();\n  }\n\n  public @Nullable AbsoluteUrl getTypedAbsoluteUrl() {\n    return request.getTypedAbsoluteUrl();\n  }\n\n  @Override\n  public RequestMethod getMethod() {\n    return request.getMethod();\n  }\n\n  @Override\n  public String getScheme() {\n    return request.getScheme();\n  }\n\n  @Override\n  public String getHost() {\n    return request.getHost();\n  }\n\n  @Override\n  public int getPort() {\n    return request.getPort();\n  }\n\n  @Override\n  public String getClientIp() {\n    return request.getClientIp();\n  }\n\n  @Override\n  public String getHeader(String key) {\n    return request.getHeader(key);\n  }\n\n  @Override\n  public HttpHeader header(String key) {\n    return request.header(key);\n  }\n\n  @Override\n  public ContentTypeHeader contentTypeHeader() {\n    return request.contentTypeHeader();\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    return request.getHeaders();\n  }\n\n  @Override\n  public boolean containsHeader(String key) {\n    return request.containsHeader(key);\n  }\n\n  @Override\n  public Set<String> getAllHeaderKeys() {\n    return request.getAllHeaderKeys();\n  }\n\n  @Override\n  @JsonIgnore\n  public PathParams getPathParameters() {\n    return request.getPathParameters();\n  }\n\n  @Override\n  public QueryParameter queryParameter(String key) {\n    return request.queryParameter(key);\n  }\n\n  @Override\n  public FormParameter formParameter(String key) {\n    return request.formParameter(key);\n  }\n\n  @Override\n  public Map<String, FormParameter> formParameters() {\n    return request.formParameters();\n  }\n\n  @Override\n  public Map<String, Cookie> getCookies() {\n    return request.getCookies();\n  }\n\n  @Override\n  public byte[] getBody() {\n    return request.getBody();\n  }\n\n  @Override\n  public String getBodyAsString() {\n    return request.getBodyAsString();\n  }\n\n  @Override\n  public String getBodyAsBase64() {\n    return request.getBodyAsBase64();\n  }\n\n  @Override\n  public boolean isMultipart() {\n    return request.isMultipart();\n  }\n\n  @Override\n  public Collection<Part> getParts() {\n    return request.getParts();\n  }\n\n  @Override\n  public Part getPart(String name) {\n    return request.getPart(name);\n  }\n\n  @Override\n  public boolean isBrowserProxyRequest() {\n    return request.isBrowserProxyRequest();\n  }\n\n  @Override\n  public Optional<Request> getOriginalRequest() {\n    return request.getOriginalRequest();\n  }\n\n  @Override\n  public String getProtocol() {\n    return request.getProtocol();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/RequestListener.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\npublic interface RequestListener {\n\n  void requestReceived(Request request, Response response);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/RequestMethod.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.annotation.JsonValue;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.MultiRequestMethodPattern;\nimport com.github.tomakehurst.wiremock.matching.NamedValueMatcher;\n\nimport java.util.*;\nimport java.util.stream.Collectors;\n\n@JsonDeserialize(using = RequestMethodJsonDeserializer.class)\npublic class RequestMethod implements NamedValueMatcher<RequestMethod> {\n\n  public static final RequestMethod GET = new RequestMethod(\"GET\");\n  public static final RequestMethod POST = new RequestMethod(\"POST\");\n  public static final RequestMethod PUT = new RequestMethod(\"PUT\");\n  public static final RequestMethod DELETE = new RequestMethod(\"DELETE\");\n  public static final RequestMethod PATCH = new RequestMethod(\"PATCH\");\n  public static final RequestMethod OPTIONS = new RequestMethod(\"OPTIONS\");\n  public static final RequestMethod HEAD = new RequestMethod(\"HEAD\");\n  public static final RequestMethod TRACE = new RequestMethod(\"TRACE\");\n  public static final RequestMethod ANY = new RequestMethod(\"ANY\");\n  public static final RequestMethod GET_OR_HEAD = isOneOf(GET, HEAD);\n  public static final RequestMethod QUERY = new RequestMethod(\"QUERY\");\n\n  private static final List<RequestMethod> METHODS_WITH_ENTITY = Arrays.asList(PUT, PATCH, POST, QUERY);\n\n  private final String name;\n\n  public RequestMethod(String name) {\n    if (name == null) throw new NullPointerException(\"Method name cannot be null\");\n    this.name = name;\n  }\n\n  public static RequestMethod fromString(String value) {\n    return new RequestMethod(value);\n  }\n\n  public static Set<RequestMethod> fromStrings(Set<String> values) {\n    return values.stream().map(RequestMethod::fromString).collect(Collectors.toSet());\n  }\n\n  public static RequestMethod isOneOf(RequestMethod... methods) {\n    return isOneOf(setOf(methods));\n  }\n\n  public static MultiRequestMethodPattern.IsOneOf isOneOf(Set<RequestMethod> methods) {\n    return new MultiRequestMethodPattern.IsOneOf(methods);\n  }\n\n  public static RequestMethod isNoneOf(RequestMethod... methods) {\n    return isNoneOf(setOf(methods));\n  }\n\n  public static RequestMethod isNoneOf(Set<RequestMethod> methods) {\n    return new MultiRequestMethodPattern.IsNoneOf(methods);\n  }\n\n  @SafeVarargs\n  private static <T> Set<T> setOf(T... items) {\n    return Collections.unmodifiableSet(new LinkedHashSet<>(Arrays.asList(items)));\n  }\n\n  @JsonValue\n  public Object value() {\n    return name;\n  }\n\n  public MatchResult match(RequestMethod method) {\n    return MatchResult.of(this.equals(ANY) || this.equals(method));\n  }\n\n  @Override\n  public String getName() {\n    return name;\n  }\n\n  @Override\n  public String getExpected() {\n    return getName();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    RequestMethod that = (RequestMethod) o;\n    return name.equals(that.name);\n  }\n\n  public boolean hasEntity() {\n    return (METHODS_WITH_ENTITY.contains(this));\n  }\n\n  @Override\n  public int hashCode() {\n    return name.hashCode();\n  }\n\n  @Override\n  public String toString() {\n    return name;\n  }\n\n  public static RequestMethod[] values() {\n    return new RequestMethod[] {\n      GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, ANY, GET_OR_HEAD, QUERY\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/RequestMethodJsonDeserializer.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.core.JacksonException;\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.deser.BeanDeserializer;\nimport com.fasterxml.jackson.databind.node.ArrayNode;\nimport com.github.tomakehurst.wiremock.matching.MultiRequestMethodPattern.IsNoneOf;\nimport com.github.tomakehurst.wiremock.matching.MultiRequestMethodPattern.IsOneOf;\nimport java.io.IOException;\nimport java.util.Set;\nimport java.util.Spliterator;\nimport java.util.Spliterators;\nimport java.util.stream.Collectors;\nimport java.util.stream.StreamSupport;\n\npublic class RequestMethodJsonDeserializer extends JsonDeserializer<RequestMethod> {\n\n  @Override\n  public RequestMethod deserialize(JsonParser parser, DeserializationContext context)\n      throws IOException, JacksonException {\n    JsonNode rootNode = parser.readValueAsTree();\n    RequestMethod requestMethod;\n    if (rootNode.has(IsOneOf.NAME)) {\n      ArrayNode itemsNode = (ArrayNode) rootNode.get(IsOneOf.NAME);\n      Set<RequestMethod> methods = toRequestMethodSet(itemsNode);\n      requestMethod = new IsOneOf(methods);\n    } else if (rootNode.has(IsNoneOf.NAME)) {\n      ArrayNode itemsNode = (ArrayNode) rootNode.get(IsNoneOf.NAME);\n      Set<RequestMethod> methods = toRequestMethodSet(itemsNode);\n      requestMethod = new IsNoneOf(methods);\n    } else {\n      requestMethod = RequestMethod.fromString(rootNode.asText());\n    }\n\n    return requestMethod;\n  }\n\n  private static Set<RequestMethod> toRequestMethodSet(ArrayNode itemsNode) {\n    return StreamSupport.stream(\n            Spliterators.spliteratorUnknownSize(itemsNode.elements(), Spliterator.ORDERED), false)\n        .map(JsonNode::asText)\n        .map(RequestMethod::fromString)\n        .collect(Collectors.toSet());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/RequestPathParamsDecorator.java",
    "content": "/*\n * Copyright (C) 2024-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.common.url.PathTemplate;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport java.util.Collection;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.UUID;\nimport org.jspecify.annotations.NonNull;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\n\npublic class RequestPathParamsDecorator implements Request {\n\n  private final Request request;\n  private final PathTemplate pathTemplate;\n\n  public static Request decorate(Request request, RequestPattern requestPattern) {\n    final PathTemplate pathTemplate = requestPattern.getUrlMatcher().getPathTemplate();\n    return pathTemplate != null ? new RequestPathParamsDecorator(request, pathTemplate) : request;\n  }\n\n  public RequestPathParamsDecorator(Request request, PathTemplate pathTemplate) {\n    this.request = request;\n    this.pathTemplate = pathTemplate;\n  }\n\n  @Override\n  public UUID getId() {\n    return request.getId();\n  }\n\n  @Override\n  public @NonNull String getUrl() {\n    return request.getUrl();\n  }\n\n  @Override\n  public @NonNull PathAndQuery getPathAndQueryWithoutPrefix() {\n    return request.getPathAndQueryWithoutPrefix();\n  }\n\n  @Override\n  public @Nullable String getAbsoluteUrl() {\n    return request.getAbsoluteUrl();\n  }\n\n  public @Nullable AbsoluteUrl getTypedAbsoluteUrl() {\n    return request.getTypedAbsoluteUrl();\n  }\n\n  @Override\n  public RequestMethod getMethod() {\n    return request.getMethod();\n  }\n\n  @Override\n  public String getScheme() {\n    return request.getScheme();\n  }\n\n  @Override\n  public String getHost() {\n    return request.getHost();\n  }\n\n  @Override\n  public int getPort() {\n    return request.getPort();\n  }\n\n  @Override\n  public String getClientIp() {\n    return request.getClientIp();\n  }\n\n  @Override\n  public String getHeader(String key) {\n    return request.getHeader(key);\n  }\n\n  @Override\n  public HttpHeader header(String key) {\n    return request.header(key);\n  }\n\n  @Override\n  public ContentTypeHeader contentTypeHeader() {\n    return request.contentTypeHeader();\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    return request.getHeaders();\n  }\n\n  @Override\n  public boolean containsHeader(String key) {\n    return request.containsHeader(key);\n  }\n\n  @Override\n  public Set<String> getAllHeaderKeys() {\n    return request.getAllHeaderKeys();\n  }\n\n  @Override\n  public PathParams getPathParameters() {\n    PathAndQuery pathAndQuery = getPathAndQueryWithoutPrefix();\n    return pathAndQuery != null ? pathTemplate.parse(pathAndQuery.getPath()) : PathParams.empty();\n  }\n\n  @Override\n  public QueryParameter queryParameter(String key) {\n    return request.queryParameter(key);\n  }\n\n  @Override\n  public FormParameter formParameter(String key) {\n    return request.formParameter(key);\n  }\n\n  @Override\n  public Map<String, FormParameter> formParameters() {\n    return request.formParameters();\n  }\n\n  @Override\n  public Map<String, Cookie> getCookies() {\n    return request.getCookies();\n  }\n\n  @Override\n  public byte[] getBody() {\n    return request.getBody();\n  }\n\n  @Override\n  public String getBodyAsString() {\n    return request.getBodyAsString();\n  }\n\n  @Override\n  public String getBodyAsBase64() {\n    return request.getBodyAsBase64();\n  }\n\n  @Override\n  public boolean isMultipart() {\n    return request.isMultipart();\n  }\n\n  @Override\n  public Collection<Part> getParts() {\n    return request.getParts();\n  }\n\n  @Override\n  public Part getPart(String name) {\n    return request.getPart(name);\n  }\n\n  @Override\n  public boolean isBrowserProxyRequest() {\n    return request.isBrowserProxyRequest();\n  }\n\n  @Override\n  public Optional<Request> getOriginalRequest() {\n    return request.getOriginalRequest();\n  }\n\n  @Override\n  public String getProtocol() {\n    return request.getProtocol();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/Response.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.Limit.UNLIMITED;\nimport static com.github.tomakehurst.wiremock.http.HttpHeaders.noHeaders;\nimport static java.net.HttpURLConnection.HTTP_NOT_FOUND;\nimport static java.net.HttpURLConnection.HTTP_OK;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Optional;\n\npublic class Response {\n\n  private final int status;\n  private final String statusMessage;\n  private final InputStreamSource bodyStreamSource;\n  private final HttpHeaders headers;\n  private final boolean configured;\n  private final Fault fault;\n  private final boolean fromProxy;\n  private final long initialDelay;\n  private final ChunkedDribbleDelay chunkedDribbleDelay;\n  private final String protocol;\n\n  public static Response notConfigured() {\n    return new Response(\n        HTTP_NOT_FOUND,\n        null,\n        StreamSources.empty(),\n        noHeaders(),\n        false,\n        null,\n        0,\n        null,\n        false,\n        null);\n  }\n\n  public static Builder response() {\n    return new Builder();\n  }\n\n  private Response(\n      int status,\n      String statusMessage,\n      InputStreamSource bodyStreamSource,\n      HttpHeaders headers,\n      boolean configured,\n      Fault fault,\n      long initialDelay,\n      ChunkedDribbleDelay chunkedDribbleDelay,\n      boolean fromProxy,\n      String protocol) {\n    this.status = status;\n    this.statusMessage = statusMessage;\n    this.bodyStreamSource = bodyStreamSource;\n    this.headers = headers;\n    this.configured = configured;\n    this.fault = fault;\n    this.initialDelay = initialDelay;\n    this.chunkedDribbleDelay = chunkedDribbleDelay;\n    this.fromProxy = fromProxy;\n    this.protocol = protocol;\n  }\n\n  public int getStatus() {\n    return status;\n  }\n\n  public String getStatusMessage() {\n    return statusMessage;\n  }\n\n  public byte[] getBody() {\n    return getBody(UNLIMITED);\n  }\n\n  public byte[] getBody(Limit sizeLimit) {\n    return Exceptions.uncheck(() -> getBytesFromStream(bodyStreamSource, sizeLimit), byte[].class);\n  }\n\n  private static byte[] getBytesFromStream(InputStreamSource streamSource, Limit limit)\n      throws IOException {\n    try (InputStream stream = streamSource == null ? null : streamSource.getStream()) {\n      if (stream == null) {\n        return null;\n      }\n\n      return limit != null && !limit.isUnlimited()\n          ? stream.readNBytes(limit.getValue())\n          : stream.readAllBytes();\n    }\n  }\n\n  public String getBodyAsString() {\n    return Strings.stringFromBytes(getBody(), headers.getContentTypeHeader().charset());\n  }\n\n  public InputStream getBodyStream() {\n    return bodyStreamSource == null ? null : bodyStreamSource.getStream();\n  }\n\n  public boolean hasInlineBody() {\n    return StreamSources.ByteArrayInputStreamSource.class.isAssignableFrom(\n        bodyStreamSource.getClass());\n  }\n\n  public HttpHeaders getHeaders() {\n    return headers;\n  }\n\n  public Fault getFault() {\n    return fault;\n  }\n\n  public long getInitialDelay() {\n    return initialDelay;\n  }\n\n  public ChunkedDribbleDelay getChunkedDribbleDelay() {\n    return chunkedDribbleDelay;\n  }\n\n  public boolean shouldAddChunkedDribbleDelay() {\n    return chunkedDribbleDelay != null;\n  }\n\n  public boolean wasConfigured() {\n    return configured;\n  }\n\n  public boolean isFromProxy() {\n    return fromProxy;\n  }\n\n  @Override\n  public String toString() {\n    return protocol + \" \" + status + \"\\n\" + headers;\n  }\n\n  public static class Builder {\n    private int status = HTTP_OK;\n    private String statusMessage;\n    private byte[] bodyBytes;\n    private String bodyString;\n    private InputStreamSource bodyStream;\n    private HttpHeaders headers = new HttpHeaders();\n    private boolean configured = true;\n    private Fault fault;\n    private boolean fromProxy;\n    private long initialDelay;\n    private ChunkedDribbleDelay chunkedDribbleDelay;\n    private String protocol;\n\n    public static Builder like(Response response) {\n      Builder responseBuilder = new Builder();\n      responseBuilder.status = response.getStatus();\n      responseBuilder.statusMessage = response.getStatusMessage();\n      responseBuilder.bodyStream = response.bodyStreamSource;\n      responseBuilder.headers = response.getHeaders();\n      responseBuilder.configured = response.wasConfigured();\n      responseBuilder.fault = response.getFault();\n      responseBuilder.initialDelay = response.getInitialDelay();\n      responseBuilder.chunkedDribbleDelay = response.getChunkedDribbleDelay();\n      responseBuilder.fromProxy = response.isFromProxy();\n      return responseBuilder;\n    }\n\n    public Builder but() {\n      return this;\n    }\n\n    public Builder status(int status) {\n      this.status = status;\n      return this;\n    }\n\n    public Builder statusMessage(String statusMessage) {\n      this.statusMessage = statusMessage;\n      return this;\n    }\n\n    public Builder body(byte[] body) {\n      this.bodyBytes = body;\n      this.bodyString = null;\n      this.bodyStream = null;\n      return this;\n    }\n\n    public Builder body(String body) {\n      this.bodyBytes = null;\n      this.bodyString = body;\n      this.bodyStream = null;\n      return this;\n    }\n\n    public Builder body(InputStreamSource bodySource) {\n      this.bodyBytes = null;\n      this.bodyString = null;\n      this.bodyStream = bodySource;\n      return this;\n    }\n\n    public Builder headers(HttpHeaders headers) {\n      this.headers = headers == null ? noHeaders() : headers;\n      return this;\n    }\n\n    public Builder configured(boolean configured) {\n      this.configured = configured;\n      return this;\n    }\n\n    public Builder fault(Fault fault) {\n      this.fault = fault;\n      return this;\n    }\n\n    public Builder configureDelay(\n        Integer globalFixedDelay,\n        DelayDistribution globalDelayDistribution,\n        Integer fixedDelay,\n        DelayDistribution delayDistribution) {\n      addDelayIfSpecifiedGloballyOrIn(fixedDelay, globalFixedDelay);\n      addRandomDelayIfSpecifiedGloballyOrIn(delayDistribution, globalDelayDistribution);\n      return this;\n    }\n\n    private void addDelayIfSpecifiedGloballyOrIn(Integer fixedDelay, Integer globalFixedDelay) {\n      Optional<Integer> optionalDelay =\n          getDelayFromResponseOrGlobalSetting(fixedDelay, globalFixedDelay);\n      optionalDelay.ifPresent(this::incrementInitialDelay);\n    }\n\n    private Optional<Integer> getDelayFromResponseOrGlobalSetting(\n        Integer fixedDelay, Integer globalFixedDelay) {\n      Integer delay = fixedDelay != null ? fixedDelay : globalFixedDelay;\n\n      return Optional.ofNullable(delay);\n    }\n\n    private void addRandomDelayIfSpecifiedGloballyOrIn(\n        DelayDistribution localDelayDistribution, DelayDistribution globalDelayDistribution) {\n      DelayDistribution delayDistribution;\n\n      if (localDelayDistribution != null) {\n        delayDistribution = localDelayDistribution;\n      } else {\n        delayDistribution = globalDelayDistribution;\n      }\n\n      if (delayDistribution != null) {\n        incrementInitialDelay(delayDistribution.sampleMillis());\n      }\n    }\n\n    public Builder incrementInitialDelay(long amountMillis) {\n      this.initialDelay += amountMillis;\n      return this;\n    }\n\n    public Builder chunkedDribbleDelay(ChunkedDribbleDelay chunkedDribbleDelay) {\n      this.chunkedDribbleDelay = chunkedDribbleDelay;\n      return this;\n    }\n\n    public Builder fromProxy(boolean fromProxy) {\n      this.fromProxy = fromProxy;\n      return this;\n    }\n\n    public Response build() {\n      InputStreamSource bodyStream;\n      if (bodyBytes != null) {\n        bodyStream = StreamSources.forBytes(bodyBytes);\n      } else if (bodyString != null) {\n        bodyStream = StreamSources.forString(bodyString, headers.getContentTypeHeader().charset());\n      } else if (this.bodyStream != null) {\n        bodyStream = this.bodyStream;\n      } else {\n        bodyStream = StreamSources.empty();\n      }\n\n      return new Response(\n          status,\n          statusMessage,\n          bodyStream,\n          headers,\n          configured,\n          fault,\n          initialDelay,\n          chunkedDribbleDelay,\n          fromProxy,\n          protocol);\n    }\n\n    public Builder protocol(final String protocol) {\n      this.protocol = protocol;\n      return this;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ResponseDefinition.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_TYPE;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.LOCATION;\nimport static java.net.HttpURLConnection.*;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonInclude.Include;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.function.Consumer;\nimport org.jspecify.annotations.NonNull;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.Path;\n\n@JsonInclude(Include.NON_NULL)\npublic class ResponseDefinition {\n\n  private final int status;\n  private final String statusMessage;\n  private final Body body;\n  private final String bodyFileName;\n  private final @NonNull HttpHeaders headers;\n  private final @NonNull HttpHeaders additionalProxyRequestHeaders;\n  private final @NonNull List<String> removeProxyRequestHeaders;\n  private final Integer fixedDelayMilliseconds;\n  private final DelayDistribution delayDistribution;\n  private final ChunkedDribbleDelay chunkedDribbleDelay;\n  private final @Nullable String proxyBaseUrl;\n  private final @Nullable Path proxyUrlPrefixToRemove;\n  private final Fault fault;\n  private final @NonNull List<String> transformers;\n  private final @NonNull Parameters transformerParameters;\n\n  private final @Nullable AbsoluteUrl browserProxyUrl;\n  private final Boolean wasConfigured;\n\n  @JsonCreator\n  public ResponseDefinition(\n      @JsonProperty(\"status\") int status,\n      @JsonProperty(\"statusMessage\") String statusMessage,\n      @JsonProperty(\"body\") String body,\n      @JsonProperty(\"jsonBody\") JsonNode jsonBody,\n      @JsonProperty(\"base64Body\") String base64Body,\n      @JsonProperty(\"bodyFileName\") String bodyFileName,\n      @JsonProperty(\"headers\") HttpHeaders headers,\n      @JsonProperty(\"additionalProxyRequestHeaders\") HttpHeaders additionalProxyRequestHeaders,\n      @JsonProperty(\"removeProxyRequestHeaders\") List<String> removeProxyRequestHeaders,\n      @JsonProperty(\"fixedDelayMilliseconds\") Integer fixedDelayMilliseconds,\n      @JsonProperty(\"delayDistribution\") DelayDistribution delayDistribution,\n      @JsonProperty(\"chunkedDribbleDelay\") ChunkedDribbleDelay chunkedDribbleDelay,\n      @JsonProperty(\"proxyBaseUrl\") String proxyBaseUrl,\n      @JsonProperty(\"proxyUrlPrefixToRemove\") String proxyUrlPrefixToRemove,\n      @JsonProperty(\"fault\") Fault fault,\n      @JsonProperty(\"transformers\") List<String> transformers,\n      @JsonProperty(\"transformerParameters\") Parameters transformerParameters,\n      @JsonProperty(\"fromConfiguredStub\") Boolean wasConfigured) {\n    this(\n        status,\n        statusMessage,\n        Body.fromOneOf(null, body, jsonBody, base64Body),\n        bodyFileName,\n        headers,\n        additionalProxyRequestHeaders,\n        removeProxyRequestHeaders,\n        fixedDelayMilliseconds,\n        delayDistribution,\n        chunkedDribbleDelay,\n        proxyBaseUrl,\n        proxyUrlPrefixToRemove != null ? Path.parse(proxyUrlPrefixToRemove) : null,\n        fault,\n        transformers,\n        transformerParameters,\n        null,\n        wasConfigured);\n  }\n\n  public ResponseDefinition(\n      int status,\n      String statusMessage,\n      Body body,\n      String bodyFileName,\n      HttpHeaders headers,\n      HttpHeaders additionalProxyRequestHeaders,\n      List<String> removeProxyRequestHeaders,\n      Integer fixedDelayMilliseconds,\n      DelayDistribution delayDistribution,\n      ChunkedDribbleDelay chunkedDribbleDelay,\n      @Nullable String proxyBaseUrl,\n      @Nullable Path proxyUrlPrefixToRemove,\n      Fault fault,\n      List<String> transformers,\n      Parameters transformerParameters,\n      @Nullable AbsoluteUrl browserProxyUrl,\n      Boolean wasConfigured) {\n    this.status = status > 0 ? status : 200;\n    this.statusMessage = statusMessage;\n\n    this.body = body;\n    this.bodyFileName = bodyFileName;\n\n    this.headers = headers != null ? headers : new HttpHeaders();\n    this.additionalProxyRequestHeaders =\n        additionalProxyRequestHeaders != null ? additionalProxyRequestHeaders : new HttpHeaders();\n    this.removeProxyRequestHeaders =\n        removeProxyRequestHeaders != null ? List.copyOf(removeProxyRequestHeaders) : List.of();\n    this.fixedDelayMilliseconds = fixedDelayMilliseconds;\n    this.delayDistribution = delayDistribution;\n    this.chunkedDribbleDelay = chunkedDribbleDelay;\n    this.proxyBaseUrl = proxyBaseUrl == null ? null : proxyBaseUrl.trim();\n    this.proxyUrlPrefixToRemove = proxyUrlPrefixToRemove;\n    this.fault = fault;\n    this.transformers = transformers != null ? List.copyOf(transformers) : List.of();\n    this.transformerParameters =\n        transformerParameters != null ? transformerParameters : Parameters.empty();\n    this.browserProxyUrl = browserProxyUrl;\n    this.wasConfigured = wasConfigured == null || wasConfigured;\n  }\n\n  public static ResponseDefinition notFound() {\n    return new Builder().setStatus(HTTP_NOT_FOUND).build();\n  }\n\n  public static ResponseDefinition ok() {\n    return new Builder().setStatus(HTTP_OK).build();\n  }\n\n  public static ResponseDefinition okEmptyJson() {\n    return ResponseDefinitionBuilder.okForEmptyJson().build();\n  }\n\n  public static <T> ResponseDefinition okForJson(T body) {\n    return ResponseDefinitionBuilder.okForJson(body).build();\n  }\n\n  public static ResponseDefinition created() {\n    return new Builder().setStatus(HTTP_CREATED).build();\n  }\n\n  public static ResponseDefinition noContent() {\n    return new Builder().setStatus(HTTP_NO_CONTENT).build();\n  }\n\n  public static ResponseDefinition badRequest(Errors errors) {\n    return ResponseDefinitionBuilder.responseDefinition()\n        .withStatus(400)\n        .withHeader(CONTENT_TYPE, \"application/json\")\n        .withBody(Json.write(errors))\n        .build();\n  }\n\n  public static ResponseDefinition badRequestEntity(Errors errors) {\n    return ResponseDefinitionBuilder.responseDefinition()\n        .withStatus(422)\n        .withHeader(CONTENT_TYPE, \"application/json\")\n        .withBody(Json.write(errors))\n        .build();\n  }\n\n  public static ResponseDefinition redirectTo(String path) {\n    return new ResponseDefinitionBuilder()\n        .withHeader(LOCATION, path)\n        .withStatus(HTTP_MOVED_TEMP)\n        .build();\n  }\n\n  public static ResponseDefinition notConfigured() {\n    return new Builder().setStatus(HTTP_NOT_FOUND).setWasConfigured(false).build();\n  }\n\n  public static ResponseDefinition notAuthorised() {\n    return new Builder().setStatus(HTTP_UNAUTHORIZED).build();\n  }\n\n  public static ResponseDefinition notPermitted(String message) {\n    return notPermitted(Errors.single(40, message));\n  }\n\n  public static ResponseDefinition notPermitted(Errors errors) {\n    return ResponseDefinitionBuilder.jsonResponse(errors, HTTP_FORBIDDEN);\n  }\n\n  public static ResponseDefinition serverError() {\n    return ResponseDefinitionBuilder.responseDefinition().withStatus(HTTP_INTERNAL_ERROR).build();\n  }\n\n  public static ResponseDefinition browserProxy(Request originalRequest) {\n    return new Builder().setBrowserProxyUrl(originalRequest.getTypedAbsoluteUrl()).build();\n  }\n\n  public static ResponseDefinition copyOf(ResponseDefinition original) {\n    return original.copy();\n  }\n\n  public ResponseDefinition copy() {\n    return new ResponseDefinition(\n        this.status,\n        this.statusMessage,\n        this.body,\n        this.bodyFileName,\n        this.headers,\n        this.additionalProxyRequestHeaders,\n        this.removeProxyRequestHeaders,\n        this.fixedDelayMilliseconds,\n        this.delayDistribution,\n        this.chunkedDribbleDelay,\n        this.proxyBaseUrl,\n        this.proxyUrlPrefixToRemove,\n        this.fault,\n        this.transformers,\n        this.transformerParameters,\n        this.browserProxyUrl,\n        this.wasConfigured);\n  }\n\n  public ResponseDefinition transform(Consumer<Builder> transformer) {\n    final Builder builder = toBuilder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public Builder toBuilder() {\n    return new Builder(this);\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public HttpHeaders getHeaders() {\n    return headers;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public HttpHeaders getAdditionalProxyRequestHeaders() {\n    return additionalProxyRequestHeaders;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public List<String> getRemoveProxyRequestHeaders() {\n    return removeProxyRequestHeaders;\n  }\n\n  public int getStatus() {\n    return status;\n  }\n\n  public String getStatusMessage() {\n    return statusMessage;\n  }\n\n  public String getBody() {\n    return (!body.isBinary() && !body.isJson()) ? body.asString() : null;\n  }\n\n  @JsonIgnore\n  public String getTextBody() {\n    return !body.isBinary() ? body.asString() : null;\n  }\n\n  @JsonIgnore\n  public byte[] getByteBody() {\n    return body.asBytes();\n  }\n\n  @JsonIgnore\n  @SuppressWarnings(\"unused\")\n  public byte[] getByteBodyIfBinary() {\n    return body.isBinary() ? body.asBytes() : null;\n  }\n\n  public String getBase64Body() {\n    return body.isBinary() ? body.asBase64() : null;\n  }\n\n  @JsonIgnore\n  public Body getReponseBody() {\n    return body;\n  }\n\n  public JsonNode getJsonBody() {\n\n    return body.isJson() ? body.asJson() : null;\n  }\n\n  public String getBodyFileName() {\n    return bodyFileName;\n  }\n\n  public boolean wasConfigured() {\n    return wasConfigured == null || wasConfigured;\n  }\n\n  @SuppressWarnings(\"unused\")\n  public Boolean isFromConfiguredStub() {\n    return wasConfigured == null || wasConfigured ? null : false;\n  }\n\n  public Integer getFixedDelayMilliseconds() {\n    return fixedDelayMilliseconds;\n  }\n\n  public DelayDistribution getDelayDistribution() {\n    return delayDistribution;\n  }\n\n  public ChunkedDribbleDelay getChunkedDribbleDelay() {\n    return chunkedDribbleDelay;\n  }\n\n  public @Nullable String getProxyBaseUrl() {\n    return proxyBaseUrl;\n  }\n\n  public @Nullable Path getProxyUrlPrefixToRemove() {\n    return proxyUrlPrefixToRemove;\n  }\n\n  @JsonIgnore\n  public boolean specifiesBodyFile() {\n    return bodyFileName != null && body.isAbsent();\n  }\n\n  @JsonIgnore\n  public boolean specifiesBodyContent() {\n    return body.isPresent();\n  }\n\n  @JsonIgnore\n  public boolean specifiesTextBodyContent() {\n    return body.isPresent() && !body.isBinary();\n  }\n\n  @JsonIgnore\n  public boolean specifiesBinaryBodyContent() {\n    return (body.isPresent() && body.isBinary());\n  }\n\n  @JsonIgnore\n  public boolean isProxyResponse() {\n    return browserProxyUrl != null || proxyBaseUrl != null;\n  }\n\n  @JsonIgnore\n  public @Nullable AbsoluteUrl getBrowserProxyUrl() {\n    return browserProxyUrl;\n  }\n\n  public Fault getFault() {\n    return fault;\n  }\n\n  @JsonInclude(NON_EMPTY)\n  @NonNull\n  public List<String> getTransformers() {\n    return transformers;\n  }\n\n  @JsonInclude(NON_EMPTY)\n  @NonNull\n  public Parameters getTransformerParameters() {\n    return transformerParameters;\n  }\n\n  public boolean hasTransformer(Extension transformer) {\n    return transformers.contains(transformer.getName());\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    ResponseDefinition that = (ResponseDefinition) o;\n    return status == that.status\n        && Objects.equals(statusMessage, that.statusMessage)\n        && Objects.equals(body, that.body)\n        && Objects.equals(bodyFileName, that.bodyFileName)\n        && Objects.equals(headers, that.headers)\n        && Objects.equals(additionalProxyRequestHeaders, that.additionalProxyRequestHeaders)\n        && Objects.equals(removeProxyRequestHeaders, that.removeProxyRequestHeaders)\n        && Objects.equals(fixedDelayMilliseconds, that.fixedDelayMilliseconds)\n        && Objects.equals(delayDistribution, that.delayDistribution)\n        && Objects.equals(chunkedDribbleDelay, that.chunkedDribbleDelay)\n        && Objects.equals(proxyBaseUrl, that.proxyBaseUrl)\n        && Objects.equals(proxyUrlPrefixToRemove, that.proxyUrlPrefixToRemove)\n        && fault == that.fault\n        && Objects.equals(transformers, that.transformers)\n        && Objects.equals(transformerParameters, that.transformerParameters)\n        && Objects.equals(browserProxyUrl, that.browserProxyUrl)\n        && Objects.equals(wasConfigured, that.wasConfigured);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(\n        status,\n        statusMessage,\n        body,\n        bodyFileName,\n        headers,\n        additionalProxyRequestHeaders,\n        removeProxyRequestHeaders,\n        fixedDelayMilliseconds,\n        delayDistribution,\n        chunkedDribbleDelay,\n        proxyBaseUrl,\n        proxyUrlPrefixToRemove,\n        fault,\n        transformers,\n        transformerParameters,\n        browserProxyUrl,\n        wasConfigured);\n  }\n\n  @Override\n  public String toString() {\n    return this.wasConfigured ? Json.write(this) : \"(no response definition configured)\";\n  }\n\n  @SuppressWarnings({\"UnusedReturnValue\", \"unused\"})\n  public static class Builder {\n    private int status = 200;\n    private String statusMessage;\n    private Body body = Body.none();\n    private String bodyFileName;\n    private @NonNull HttpHeaders headers = new HttpHeaders();\n    private @NonNull HttpHeaders additionalProxyRequestHeaders = new HttpHeaders();\n    private @NonNull List<String> removeProxyRequestHeaders = new ArrayList<>();\n    private Integer fixedDelayMilliseconds;\n    private DelayDistribution delayDistribution;\n    private ChunkedDribbleDelay chunkedDribbleDelay;\n    private @Nullable String proxyBaseUrl;\n    private @Nullable Path proxyUrlPrefixToRemove = null;\n    private Fault fault;\n    private @NonNull List<String> transformers = new ArrayList<>();\n    private @NonNull Parameters transformerParameters = Parameters.empty();\n    private @Nullable AbsoluteUrl browserProxyUrl;\n    private Boolean wasConfigured = true;\n    private Request originalRequest;\n\n    public Builder() {}\n\n    public Builder(ResponseDefinition original) {\n      this.status = original.status;\n      this.statusMessage = original.statusMessage;\n      this.body = original.body;\n      this.bodyFileName = original.bodyFileName;\n      this.headers = original.headers;\n      this.additionalProxyRequestHeaders = original.additionalProxyRequestHeaders;\n      this.removeProxyRequestHeaders.addAll(original.removeProxyRequestHeaders);\n      this.fixedDelayMilliseconds = original.fixedDelayMilliseconds;\n      this.delayDistribution = original.delayDistribution;\n      this.chunkedDribbleDelay = original.chunkedDribbleDelay;\n      this.proxyBaseUrl = original.proxyBaseUrl;\n      this.proxyUrlPrefixToRemove = original.proxyUrlPrefixToRemove;\n      this.fault = original.fault;\n      this.transformers.addAll(original.transformers);\n      this.transformerParameters = original.transformerParameters;\n      this.browserProxyUrl = original.browserProxyUrl;\n      this.wasConfigured = original.wasConfigured;\n    }\n\n    public int getStatus() {\n      return status;\n    }\n\n    public String getStatusMessage() {\n      return statusMessage;\n    }\n\n    public Body getBody() {\n      return body;\n    }\n\n    public String getBodyFileName() {\n      return bodyFileName;\n    }\n\n    @NonNull\n    public HttpHeaders getHeaders() {\n      return headers;\n    }\n\n    @NonNull\n    public HttpHeaders getAdditionalProxyRequestHeaders() {\n      return additionalProxyRequestHeaders;\n    }\n\n    @NonNull\n    public List<String> getRemoveProxyRequestHeaders() {\n      return removeProxyRequestHeaders;\n    }\n\n    public Integer getFixedDelayMilliseconds() {\n      return fixedDelayMilliseconds;\n    }\n\n    public DelayDistribution getDelayDistribution() {\n      return delayDistribution;\n    }\n\n    public ChunkedDribbleDelay getChunkedDribbleDelay() {\n      return chunkedDribbleDelay;\n    }\n\n    public @Nullable String getProxyBaseUrl() {\n      return proxyBaseUrl;\n    }\n\n    public @Nullable Path getProxyUrlPrefixToRemove() {\n      return proxyUrlPrefixToRemove;\n    }\n\n    public Fault getFault() {\n      return fault;\n    }\n\n    @NonNull\n    public List<String> getTransformers() {\n      return transformers;\n    }\n\n    @NonNull\n    public Parameters getTransformerParameters() {\n      return transformerParameters;\n    }\n\n    public @Nullable AbsoluteUrl getBrowserProxyUrl() {\n      return browserProxyUrl;\n    }\n\n    public Boolean getWasConfigured() {\n      return wasConfigured;\n    }\n\n    public Request getOriginalRequest() {\n      return originalRequest;\n    }\n\n    public Builder setStatus(int status) {\n      this.status = status;\n      return this;\n    }\n\n    public Builder setStatusMessage(String statusMessage) {\n      this.statusMessage = statusMessage;\n      return this;\n    }\n\n    public Builder setBody(Body body) {\n      this.body = body;\n      return this;\n    }\n\n    public Builder setBodyFileName(String bodyFileName) {\n      this.bodyFileName = bodyFileName;\n      return this;\n    }\n\n    public Builder setHeaders(@NonNull HttpHeaders headers) {\n      Objects.requireNonNull(headers);\n      this.headers = headers;\n      return this;\n    }\n\n    public Builder headers(Consumer<HttpHeaders.Builder> transformer) {\n      this.headers = headers.transform(transformer);\n      return this;\n    }\n\n    public Builder setAdditionalProxyRequestHeaders(\n        @NonNull HttpHeaders additionalProxyRequestHeaders) {\n      Objects.requireNonNull(additionalProxyRequestHeaders);\n      this.additionalProxyRequestHeaders = additionalProxyRequestHeaders;\n      return this;\n    }\n\n    public Builder setRemoveProxyRequestHeaders(@NonNull List<String> removeProxyRequestHeaders) {\n      Objects.requireNonNull(removeProxyRequestHeaders);\n      this.removeProxyRequestHeaders = removeProxyRequestHeaders;\n      return this;\n    }\n\n    public Builder setFixedDelayMilliseconds(Integer fixedDelayMilliseconds) {\n      this.fixedDelayMilliseconds = fixedDelayMilliseconds;\n      return this;\n    }\n\n    public Builder setDelayDistribution(DelayDistribution delayDistribution) {\n      this.delayDistribution = delayDistribution;\n      return this;\n    }\n\n    public Builder setChunkedDribbleDelay(ChunkedDribbleDelay chunkedDribbleDelay) {\n      this.chunkedDribbleDelay = chunkedDribbleDelay;\n      return this;\n    }\n\n    public Builder setProxyBaseUrl(AbsoluteUrl proxyBaseUrl) {\n      this.proxyBaseUrl = proxyBaseUrl.toString();\n      return this;\n    }\n\n    public Builder setProxyBaseUrl(String proxyBaseUrl) {\n      this.proxyBaseUrl = proxyBaseUrl;\n      return this;\n    }\n\n    public Builder setProxyUrlPrefixToRemove(@Nullable String proxyUrlPrefixToRemove) {\n      Path prefix = proxyUrlPrefixToRemove != null ? Path.parse(proxyUrlPrefixToRemove) : null;\n      return setProxyUrlPrefixToRemove(prefix);\n    }\n\n    public Builder setProxyUrlPrefixToRemove(@Nullable Path proxyUrlPrefixToRemove) {\n      this.proxyUrlPrefixToRemove = proxyUrlPrefixToRemove;\n      return this;\n    }\n\n    public Builder setFault(Fault fault) {\n      this.fault = fault;\n      return this;\n    }\n\n    public Builder setTransformers(@NonNull List<String> transformers) {\n      Objects.requireNonNull(transformers);\n      this.transformers = transformers;\n      return this;\n    }\n\n    public Builder setTransformerParameters(@NonNull Parameters transformerParameters) {\n      Objects.requireNonNull(transformerParameters);\n      this.transformerParameters = transformerParameters;\n      return this;\n    }\n\n    public Builder setBrowserProxyUrl(@Nullable AbsoluteUrl browserProxyUrl) {\n      this.browserProxyUrl = browserProxyUrl;\n      return this;\n    }\n\n    public Builder setBrowserProxyUrl(@Nullable String browserProxyUrl) {\n      AbsoluteUrl url = browserProxyUrl != null ? AbsoluteUrl.parse(browserProxyUrl) : null;\n      return setBrowserProxyUrl(url);\n    }\n\n    public Builder setWasConfigured(Boolean wasConfigured) {\n      this.wasConfigured = wasConfigured;\n      return this;\n    }\n\n    public Builder setOriginalRequest(Request originalRequest) {\n      this.originalRequest = originalRequest;\n      return this;\n    }\n\n    public ResponseDefinition build() {\n      return new ResponseDefinition(\n          status,\n          statusMessage,\n          body,\n          bodyFileName,\n          headers,\n          additionalProxyRequestHeaders,\n          removeProxyRequestHeaders,\n          fixedDelayMilliseconds,\n          delayDistribution,\n          chunkedDribbleDelay,\n          proxyBaseUrl,\n          proxyUrlPrefixToRemove,\n          fault,\n          transformers,\n          transformerParameters,\n          browserProxyUrl,\n          wasConfigured);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ResponseRenderer.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic interface ResponseRenderer {\n\n  Response render(ServeEvent serveEvent);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/StubRequestHandler.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static com.github.tomakehurst.wiremock.extension.ServeEventListener.RequestPhase.*;\nimport static com.github.tomakehurst.wiremock.extension.ServeEventListenerUtils.triggerListeners;\n\nimport com.github.tomakehurst.wiremock.common.DataTruncationSettings;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.StubServer;\nimport com.github.tomakehurst.wiremock.extension.*;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestFilter;\nimport com.github.tomakehurst.wiremock.extension.requestfilter.RequestFilterV2;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.github.tomakehurst.wiremock.verification.RequestJournal;\nimport com.github.tomakehurst.wiremock.verification.diff.DiffEventData;\nimport com.github.tomakehurst.wiremock.verification.notmatched.NotMatchedRenderer;\nimport java.util.List;\nimport java.util.Map;\n\npublic class StubRequestHandler extends AbstractRequestHandler {\n\n  private final StubServer stubServer;\n  private final Admin admin;\n  private final Map<String, PostServeAction> postServeActions;\n  private final Map<String, ServeEventListener> serveEventListeners;\n  private final RequestJournal requestJournal;\n  private final boolean loggingDisabled;\n\n  private final NotMatchedRenderer notMatchedRenderer;\n\n  public StubRequestHandler(\n      StubServer stubServer,\n      ResponseRenderer responseRenderer,\n      Admin admin,\n      Map<String, PostServeAction> postServeActions,\n      Map<String, ServeEventListener> serveEventListeners,\n      RequestJournal requestJournal,\n      List<RequestFilter> requestFilters,\n      List<RequestFilterV2> v2RequestFilters,\n      boolean loggingDisabled,\n      DataTruncationSettings dataTruncationSettings,\n      NotMatchedRenderer notMatchedRenderer) {\n    super(responseRenderer, requestFilters, v2RequestFilters, dataTruncationSettings);\n    this.stubServer = stubServer;\n    this.admin = admin;\n    this.postServeActions = postServeActions;\n    this.serveEventListeners = serveEventListeners;\n    this.requestJournal = requestJournal;\n    this.loggingDisabled = loggingDisabled;\n    this.notMatchedRenderer = notMatchedRenderer;\n  }\n\n  @Override\n  public ServeEvent handleRequest(ServeEvent initialServeEvent) {\n    triggerListeners(serveEventListeners, BEFORE_MATCH, initialServeEvent);\n    return stubServer.serveStubFor(initialServeEvent);\n  }\n\n  @Override\n  protected boolean logRequests() {\n    return !loggingDisabled;\n  }\n\n  @Override\n  protected void beforeResponseSent(ServeEvent serveEvent, Response response) {\n    if (!response.wasConfigured()) {\n      appendNonMatchSubEvent(serveEvent);\n    }\n\n    requestJournal.requestReceived(serveEvent);\n\n    triggerListeners(serveEventListeners, BEFORE_RESPONSE_SENT, serveEvent);\n  }\n\n  private void appendNonMatchSubEvent(ServeEvent serveEvent) {\n    final ResponseDefinition responseDefinition =\n        notMatchedRenderer.execute(admin, serveEvent, PathParams.empty());\n    final HttpHeaders headers = responseDefinition.getHeaders();\n    final String contentTypeHeader =\n        headers.getHeader(ContentTypeHeader.KEY).isPresent()\n            ? headers.getContentTypeHeader().firstValue()\n            : null;\n\n    serveEvent.appendSubEvent(\n        SubEvent.NON_MATCH_TYPE,\n        new DiffEventData(\n            responseDefinition.getStatus(), contentTypeHeader, responseDefinition.getBody()));\n  }\n\n  @Override\n  protected void afterResponseSent(ServeEvent serveEvent, Response response) {\n    requestJournal.serveCompleted(serveEvent);\n\n    triggerPostServeActions(serveEvent);\n\n    triggerListeners(serveEventListeners, AFTER_COMPLETE, serveEvent);\n  }\n\n  private void triggerPostServeActions(ServeEvent serveEvent) {\n    for (PostServeAction postServeAction : postServeActions.values()) {\n      postServeAction.doGlobalAction(serveEvent, admin);\n    }\n\n    List<PostServeActionDefinition> postServeActionDefs = serveEvent.getPostServeActions();\n    for (PostServeActionDefinition postServeActionDef : postServeActionDefs) {\n      PostServeAction action = postServeActions.get(postServeActionDef.getName());\n      if (action != null) {\n        Parameters parameters = postServeActionDef.getParameters();\n        action.doAction(serveEvent, admin, parameters);\n      } else {\n        notifier().error(\"No extension was found named \\\"\" + postServeActionDef.getName() + \"\\\"\");\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/StubResponseRenderer.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.http.Response.response;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.InputStreamSource;\nimport com.github.tomakehurst.wiremock.extension.ResponseTransformer;\nimport com.github.tomakehurst.wiremock.extension.ResponseTransformerV2;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport com.github.tomakehurst.wiremock.store.SettingsStore;\nimport com.github.tomakehurst.wiremock.store.files.BlobStoreFileSource;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.nio.charset.StandardCharsets;\nimport java.util.List;\n\npublic class StubResponseRenderer implements ResponseRenderer {\n\n  private final BlobStore filesBlobStore;\n  private final FileSource filesFileSource;\n  private final SettingsStore settingsStore;\n  private final ProxyResponseRenderer proxyResponseRenderer;\n  private final List<ResponseTransformer> responseTransformers;\n  private final List<ResponseTransformerV2> v2ResponseTransformers;\n\n  public StubResponseRenderer(\n      BlobStore filesBlobStore,\n      SettingsStore settingsStore,\n      ProxyResponseRenderer proxyResponseRenderer,\n      List<ResponseTransformer> responseTransformers,\n      List<ResponseTransformerV2> v2ResponseTransformers) {\n    this.filesBlobStore = filesBlobStore;\n    this.settingsStore = settingsStore;\n    this.proxyResponseRenderer = proxyResponseRenderer;\n    this.responseTransformers = responseTransformers;\n    this.v2ResponseTransformers = v2ResponseTransformers;\n\n    filesFileSource = new BlobStoreFileSource(filesBlobStore);\n  }\n\n  @Override\n  public Response render(ServeEvent serveEvent) {\n    ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();\n    if (!responseDefinition.wasConfigured()) {\n      return Response.notConfigured();\n    }\n\n    Response response = buildResponse(serveEvent);\n\n    response =\n        applyTransformations(\n            serveEvent.getRequest(), responseDefinition, response, responseTransformers);\n\n    response = applyV2Transformations(response, serveEvent, v2ResponseTransformers);\n\n    return response;\n  }\n\n  private Response buildResponse(ServeEvent serveEvent) {\n    if (serveEvent.getResponseDefinition().isProxyResponse()) {\n      return proxyResponseRenderer.render(serveEvent);\n    } else {\n      Response.Builder responseBuilder = renderDirectly(serveEvent);\n      return responseBuilder.build();\n    }\n  }\n\n  private Response applyTransformations(\n      Request request,\n      ResponseDefinition responseDefinition,\n      Response response,\n      List<ResponseTransformer> transformers) {\n    if (transformers.isEmpty()) {\n      return response;\n    }\n\n    ResponseTransformer transformer = transformers.get(0);\n    Response newResponse =\n        transformer.applyGlobally() || responseDefinition.hasTransformer(transformer)\n            ? transformer.transform(\n                request, response, filesFileSource, responseDefinition.getTransformerParameters())\n            : response;\n\n    return applyTransformations(\n        request, responseDefinition, newResponse, transformers.subList(1, transformers.size()));\n  }\n\n  private Response applyV2Transformations(\n      Response response, ServeEvent serveEvent, List<ResponseTransformerV2> transformers) {\n\n    if (transformers.isEmpty()) {\n      return response;\n    }\n\n    final ResponseTransformerV2 transformer = transformers.get(0);\n    final ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();\n\n    Response newResponse =\n        transformer.applyGlobally() || responseDefinition.hasTransformer(transformer)\n            ? transformer.transform(response, serveEvent)\n            : response;\n\n    return applyV2Transformations(\n        newResponse, serveEvent, transformers.subList(1, transformers.size()));\n  }\n\n  private Response.Builder renderDirectly(ServeEvent serveEvent) {\n    ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();\n\n    HttpHeaders headers = responseDefinition.getHeaders();\n    StubMapping stubMapping = serveEvent.getStubMapping();\n    if (serveEvent.getWasMatched() && stubMapping != null) {\n      headers =\n          getFirstNonNull(headers, new HttpHeaders())\n              .plus(new HttpHeader(\"Matched-Stub-Id\", stubMapping.getId().toString()));\n\n      if (stubMapping.getName() != null) {\n        // ensure stub name is compliant with http spec header values\n        // https://www.rfc-editor.org/rfc/rfc9110.html#name-field-values.\n        String sanitisedStubName =\n            new String(stubMapping.getName().getBytes(StandardCharsets.US_ASCII));\n        headers = headers.plus(new HttpHeader(\"Matched-Stub-Name\", sanitisedStubName));\n      }\n    }\n\n    GlobalSettings settings = settingsStore.get();\n    Response.Builder responseBuilder =\n        response()\n            .status(responseDefinition.getStatus())\n            .statusMessage(responseDefinition.getStatusMessage())\n            .headers(headers)\n            .fault(responseDefinition.getFault())\n            .configureDelay(\n                settings.getFixedDelay(),\n                settings.getDelayDistribution(),\n                responseDefinition.getFixedDelayMilliseconds(),\n                responseDefinition.getDelayDistribution())\n            .chunkedDribbleDelay(responseDefinition.getChunkedDribbleDelay());\n\n    if (responseDefinition.specifiesBodyFile()) {\n      final InputStreamSource bodyStreamSource =\n          filesBlobStore.getStreamSource(responseDefinition.getBodyFileName());\n      responseBuilder.body(bodyStreamSource);\n    } else if (responseDefinition.specifiesBodyContent()) {\n      responseBuilder.body(responseDefinition.getByteBody());\n    }\n\n    return responseBuilder;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/UniformDistribution.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.concurrent.ThreadLocalRandom;\n\n/**\n * Distribution that returns values uniformally distributed across a range.\n *\n * <p>That is, given a uniform distribution of 50 to 60 ms, there will be an equal spread of delays\n * between 50 and 60. This would useful for representing an average delay of 55ms with a +/- 5ms\n * jitter.\n */\npublic final class UniformDistribution implements DelayDistribution {\n\n  @JsonProperty(\"lower\")\n  private final int lower;\n\n  @JsonProperty(\"upper\")\n  private final int upper;\n\n  /**\n   * @param lower lower bound inclusive\n   * @param upper upper bound inclusive\n   */\n  public UniformDistribution(@JsonProperty(\"lower\") int lower, @JsonProperty(\"upper\") int upper) {\n    this.lower = lower;\n    this.upper = upper;\n  }\n\n  @Override\n  public long sampleMillis() {\n    return ThreadLocalRandom.current().nextLong(lower, upper + 1);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/client/HttpClient.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport java.io.IOException;\nimport java.util.List;\n\npublic interface HttpClient {\n\n  String USER_AGENT = \"user-agent\";\n  String TRANSFER_ENCODING = \"transfer-encoding\";\n  List<String> FORBIDDEN_RESPONSE_HEADERS = List.of(TRANSFER_ENCODING, \"connection\");\n  String CONTENT_ENCODING = \"content-encoding\";\n  String CONTENT_LENGTH = \"content-length\";\n  String CONNECTION = \"connection\";\n  String UPGRADE = \"upgrade\";\n  List<String> FORBIDDEN_REQUEST_HEADERS =\n      List.of(TRANSFER_ENCODING, CONTENT_LENGTH, CONNECTION, UPGRADE, USER_AGENT);\n  String HOST_HEADER = \"host\";\n  String ACCEPT_ENCODING_HEADER = \"accept-encoding\";\n\n  Response execute(Request request) throws IOException;\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/client/HttpClientFactory.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport java.util.List;\n\npublic interface HttpClientFactory extends Extension {\n\n  int DEFAULT_MAX_CONNECTIONS = 50;\n  int DEFAULT_TIMEOUT = 30000;\n\n  @Override\n  default String getName() {\n    return \"http-client-factory\";\n  }\n\n  HttpClient buildHttpClient(\n      Options options,\n      boolean trustAllCertificates,\n      List<String> trustedHosts,\n      boolean useSystemProperties);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/client/LazyHttpClient.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client;\n\nimport com.github.tomakehurst.wiremock.common.Lazy;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport java.io.IOException;\nimport java.util.function.Supplier;\n\npublic class LazyHttpClient implements HttpClient {\n\n  private final Lazy<HttpClient> httpClientLazy;\n\n  public LazyHttpClient(Supplier<HttpClient> httpClientSupplier) {\n    this.httpClientLazy = Lazy.lazy(httpClientSupplier);\n  }\n\n  @Override\n  public Response execute(Request request) throws IOException {\n    return httpClientLazy.get().execute(request);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/client/LazyHttpClientFactory.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client;\n\nimport com.github.tomakehurst.wiremock.common.Lazy;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport java.util.List;\nimport java.util.function.Supplier;\n\npublic class LazyHttpClientFactory implements HttpClientFactory {\n\n  private final Lazy<HttpClientFactory> httpClientFactoryLazy;\n\n  public LazyHttpClientFactory(Supplier<HttpClientFactory> httpClientFactorySupplier) {\n    this.httpClientFactoryLazy = Lazy.lazy(httpClientFactorySupplier);\n  }\n\n  @Override\n  public String getName() {\n    return httpClientFactoryLazy.get().getName();\n  }\n\n  @Override\n  public HttpClient buildHttpClient(\n      Options options,\n      boolean trustAllCertificates,\n      List<String> trustedHosts,\n      boolean useSystemProperties) {\n    return httpClientFactoryLazy\n        .get()\n        .buildHttpClient(options, trustAllCertificates, trustedHosts, useSystemProperties);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/multipart/FileItemPartAdapter.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.multipart;\n\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.function.Function;\nimport org.apache.commons.fileupload.FileItem;\nimport org.apache.commons.fileupload.FileItemHeaders;\n\npublic class FileItemPartAdapter implements Request.Part {\n\n  private final FileItem fileItem;\n\n  public FileItemPartAdapter(FileItem fileItem) {\n    this.fileItem = fileItem;\n  }\n\n  @Override\n  public String getName() {\n    return fileItem.getFieldName();\n  }\n\n  @Override\n  public String getFileName() {\n    return fileItem.getName();\n  }\n\n  @Override\n  public HttpHeader getHeader(String name) {\n    Iterator<String> headerValues = fileItem.getHeaders().getHeaders(name);\n    List<String> values = new ArrayList<>();\n    headerValues.forEachRemaining(values::add);\n    return new HttpHeader(name, values);\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    FileItemHeaders headers = fileItem.getHeaders();\n    Iterator<String> i = headers.getHeaderNames();\n    List<HttpHeader> headersList = new ArrayList<>();\n    while (i.hasNext()) {\n      String name = i.next();\n      headersList.add(getHeader(name));\n    }\n\n    return new HttpHeaders(Collections.unmodifiableList(headersList));\n  }\n\n  @Override\n  public Body getBody() {\n    return Body.ofBinaryOrText(fileItem.get(), new ContentTypeHeader(fileItem.getContentType()));\n  }\n\n  public static final Function<FileItem, Request.Part> TO_PARTS = FileItemPartAdapter::new;\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/multipart/FileUpload.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.multipart;\n\nimport static java.lang.String.format;\n\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.UnsupportedEncodingException;\nimport java.lang.reflect.Method;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.Map;\nimport java.util.NoSuchElementException;\nimport org.apache.commons.fileupload.FileItem;\nimport org.apache.commons.fileupload.FileItemFactory;\nimport org.apache.commons.fileupload.FileItemHeaders;\nimport org.apache.commons.fileupload.FileItemIterator;\nimport org.apache.commons.fileupload.FileItemStream;\nimport org.apache.commons.fileupload.FileUploadBase;\nimport org.apache.commons.fileupload.FileUploadBase.FileSizeLimitExceededException;\nimport org.apache.commons.fileupload.FileUploadBase.FileUploadIOException;\nimport org.apache.commons.fileupload.FileUploadBase.IOFileUploadException;\nimport org.apache.commons.fileupload.FileUploadBase.InvalidContentTypeException;\nimport org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException;\nimport org.apache.commons.fileupload.FileUploadException;\nimport org.apache.commons.fileupload.MultipartStream;\nimport org.apache.commons.fileupload.ParameterParser;\nimport org.apache.commons.fileupload.RequestContext;\nimport org.apache.commons.fileupload.UploadContext;\nimport org.apache.commons.fileupload.util.Closeable;\nimport org.apache.commons.fileupload.util.FileItemHeadersImpl;\nimport org.apache.commons.fileupload.util.LimitedInputStream;\nimport org.apache.commons.fileupload.util.Streams;\n\n/**\n * The implementation is largely ported from {@link org.apache.commons.fileupload.FileUpload} and\n * {@link org.apache.commons.fileupload.FileUploadBase} to support 'jakarta.servlet' instead of\n * 'javax.servlet'. The standard support of multipart content type by Jetty in limited to\n * 'multipart/form-data', so 'multipart/mixed' and 'multipart/related' are not recognized and parsed\n * properly. To preserve backward compatibility and support wider range of multipart content,\n * re-implementing this part of the upload.\n */\nclass FileUpload {\n  /** HTTP content type header for multiple related data. */\n  private static final String MULTIPART_RELATED = \"multipart/related\";\n\n  private final FileItemFactory fileItemFactory;\n\n  FileUpload(FileItemFactory fileItemFactory) {\n    this.fileItemFactory = fileItemFactory;\n  }\n\n  /**\n   * The maximum size permitted for the complete request, as opposed to {@link #fileSizeMax}. A\n   * value of -1 indicates no maximum.\n   */\n  private long sizeMax = -1;\n\n  /**\n   * The maximum size permitted for a single uploaded file, as opposed to {@link #sizeMax}. A value\n   * of -1 indicates no maximum.\n   */\n  private long fileSizeMax = -1;\n\n  /** The content encoding to use when reading part headers. */\n  private String headerEncoding;\n\n  protected FileItemIterator getItemIterator(RequestContext ctx)\n      throws FileUploadException, IOException {\n    try {\n      return new FileItemIteratorImpl(ctx);\n    } catch (FileUploadIOException e) {\n      // unwrap encapsulated SizeException\n      throw (FileUploadException) e.getCause();\n    }\n  }\n\n  protected FileItemFactory getFileItemFactory() {\n    return fileItemFactory;\n  }\n\n  /**\n   * Processes an <a href=\"http://www.ietf.org/rfc/rfc1867.txt\">RFC 1867</a> compliant <code>\n   * multipart/form-data</code> stream.\n   *\n   * @param ctx The context for the request to be parsed.\n   * @return A list of <code>FileItem</code> instances parsed from the request, in the order that\n   *     they were transmitted.\n   * @throws FileUploadException if there are problems reading/parsing the request or storing files.\n   */\n  public List<FileItem> parseRequest(RequestContext ctx) throws FileUploadException {\n    List<FileItem> items = new ArrayList<>();\n    boolean successful = false;\n    try {\n      FileItemIterator iter = getItemIterator(ctx);\n      FileItemFactory fac = getFileItemFactory();\n      if (fac == null) {\n        throw new NullPointerException(\"No FileItemFactory has been set.\");\n      }\n      while (iter.hasNext()) {\n        final FileItemStream item = iter.next();\n        // Don't use getName() here to prevent an InvalidFileNameException.\n        final String fileName = ((FileItemIteratorImpl.FileItemStreamImpl) item).name;\n        FileItem fileItem =\n            fac.createItem(\n                item.getFieldName(), item.getContentType(), item.isFormField(), fileName);\n        items.add(fileItem);\n        try {\n          Streams.copy(item.openStream(), fileItem.getOutputStream(), true);\n        } catch (FileUploadIOException e) {\n          throw (FileUploadException) e.getCause();\n        } catch (IOException e) {\n          throw new IOFileUploadException(\n              format(\n                  \"Processing of %s request failed. %s\",\n                  FileUploadBase.MULTIPART_FORM_DATA, e.getMessage()),\n              e);\n        }\n        final FileItemHeaders fih = item.getHeaders();\n        fileItem.setHeaders(fih);\n      }\n      successful = true;\n      return items;\n    } catch (FileUploadIOException e) {\n      throw (FileUploadException) e.getCause();\n    } catch (IOException e) {\n      throw new FileUploadException(e.getMessage(), e);\n    } finally {\n      if (!successful) {\n        for (FileItem fileItem : items) {\n          try {\n            fileItem.delete();\n          } catch (Exception ignored) {\n            // ignored TODO perhaps add to tracker delete failure list somehow?\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * Retrieves the boundary from the <code>Content-type</code> header.\n   *\n   * @param contentType The value of the content type header from which to extract the boundary\n   *     value.\n   * @return The boundary, as a byte array.\n   */\n  protected byte[] getBoundary(String contentType) {\n    ParameterParser parser = new ParameterParser();\n    parser.setLowerCaseNames(true);\n    // Parameter parser can handle null input\n    Map<String, String> params = parser.parse(contentType, new char[] {';', ','});\n    String boundaryStr = params.get(\"boundary\");\n\n    if (boundaryStr == null) {\n      return null;\n    }\n    byte[] boundary;\n    try {\n      boundary = boundaryStr.getBytes(\"ISO-8859-1\");\n    } catch (UnsupportedEncodingException e) {\n      boundary = boundaryStr.getBytes(); // Intentionally falls back to default charset\n    }\n    return boundary;\n  }\n\n  /**\n   * Retrieves the file name from the <code>Content-disposition</code> header.\n   *\n   * @param headers The HTTP headers object.\n   * @return The file name for the current <code>encapsulation</code>.\n   */\n  protected String getFileName(FileItemHeaders headers) {\n    return getFileName(headers.getHeader(FileUploadBase.CONTENT_DISPOSITION));\n  }\n\n  /**\n   * Returns the given content-disposition headers file name.\n   *\n   * @param pContentDisposition The content-disposition headers value.\n   * @return The file name\n   */\n  private String getFileName(String pContentDisposition) {\n    String fileName = null;\n    if (pContentDisposition != null) {\n      String cdl = pContentDisposition.toLowerCase(Locale.ENGLISH);\n      if (cdl.startsWith(FileUploadBase.FORM_DATA) || cdl.startsWith(FileUploadBase.ATTACHMENT)) {\n        ParameterParser parser = new ParameterParser();\n        parser.setLowerCaseNames(true);\n        // Parameter parser can handle null input\n        Map<String, String> params = parser.parse(pContentDisposition, ';');\n        if (params.containsKey(\"filename\")) {\n          fileName = params.get(\"filename\");\n          if (fileName != null) {\n            fileName = fileName.trim();\n          } else {\n            // Even if there is no value, the parameter is present,\n            // so we return an empty file name rather than no file\n            // name.\n            fileName = \"\";\n          }\n        }\n      }\n    }\n    return fileName;\n  }\n\n  /**\n   * Retrieves the field name from the <code>Content-disposition</code> header.\n   *\n   * @param headers A <code>Map</code> containing the HTTP request headers.\n   * @return The field name for the current <code>encapsulation</code>.\n   */\n  protected String getFieldName(FileItemHeaders headers) {\n    return getFieldName(headers.getHeader(FileUploadBase.CONTENT_DISPOSITION));\n  }\n\n  /**\n   * Returns the field name, which is given by the content-disposition header.\n   *\n   * @param pContentDisposition The content-dispositions header value.\n   * @return The field jake\n   */\n  private String getFieldName(String pContentDisposition) {\n    String fieldName = null;\n    if (pContentDisposition != null\n        && pContentDisposition.toLowerCase(Locale.ENGLISH).startsWith(FileUploadBase.FORM_DATA)) {\n      ParameterParser parser = new ParameterParser();\n      parser.setLowerCaseNames(true);\n      // Parameter parser can handle null input\n      Map<String, String> params = parser.parse(pContentDisposition, ';');\n      fieldName = params.get(\"name\");\n      if (fieldName != null) {\n        fieldName = fieldName.trim();\n      }\n    }\n    return fieldName;\n  }\n\n  /**\n   * Parses the <code>header-part</code> and returns as key/value pairs.\n   *\n   * <p>If there are multiple headers of the same names, the name will map to a comma-separated list\n   * containing the values.\n   *\n   * @param headerPart The <code>header-part</code> of the current <code>encapsulation</code>.\n   * @return A <code>Map</code> containing the parsed HTTP request headers.\n   */\n  protected FileItemHeaders getParsedHeaders(String headerPart) {\n    final int len = headerPart.length();\n    FileItemHeadersImpl headers = newFileItemHeaders();\n    int start = 0;\n    for (; ; ) {\n      int end = parseEndOfLine(headerPart, start);\n      if (start == end) {\n        break;\n      }\n      StringBuilder header = new StringBuilder(headerPart.substring(start, end));\n      start = end + 2;\n      while (start < len) {\n        int nonWs = start;\n        while (nonWs < len) {\n          char c = headerPart.charAt(nonWs);\n          if (c != ' ' && c != '\\t') {\n            break;\n          }\n          ++nonWs;\n        }\n        if (nonWs == start) {\n          break;\n        }\n        // Continuation line found\n        end = parseEndOfLine(headerPart, nonWs);\n        header.append(\" \").append(headerPart.substring(nonWs, end));\n        start = end + 2;\n      }\n      parseHeaderLine(headers, header.toString());\n    }\n    return headers;\n  }\n\n  /**\n   * Creates a new instance of {@link FileItemHeaders}.\n   *\n   * @return The new instance.\n   */\n  protected FileItemHeadersImpl newFileItemHeaders() {\n    return new FileItemHeadersImpl();\n  }\n\n  /**\n   * Skips bytes until the end of the current line.\n   *\n   * @param headerPart The headers, which are being parsed.\n   * @param end Index of the last byte, which has yet been processed.\n   * @return Index of the \\r\\n sequence, which indicates end of line.\n   */\n  private int parseEndOfLine(String headerPart, int end) {\n    int index = end;\n    for (; ; ) {\n      int offset = headerPart.indexOf('\\r', index);\n      if (offset == -1 || offset + 1 >= headerPart.length()) {\n        throw new IllegalStateException(\"Expected headers to be terminated by an empty line.\");\n      }\n      if (headerPart.charAt(offset + 1) == '\\n') {\n        return offset;\n      }\n      index = offset + 1;\n    }\n  }\n\n  /**\n   * Reads the next header line.\n   *\n   * @param headers String with all headers.\n   * @param header Map where to store the current header.\n   */\n  private void parseHeaderLine(FileItemHeadersImpl headers, String header) {\n    final int colonOffset = header.indexOf(':');\n    if (colonOffset == -1) {\n      // This header line is malformed, skip it.\n      return;\n    }\n    String headerName = header.substring(0, colonOffset).trim();\n    String headerValue = header.substring(header.indexOf(':') + 1).trim();\n    headers.addHeader(headerName, headerValue);\n  }\n\n  /** The iterator, which is returned by {@link FileUpload#getItemIterator(RequestContext)}. */\n  private class FileItemIteratorImpl implements FileItemIterator {\n\n    /** Default implementation of {@link FileItemStream}. */\n    class FileItemStreamImpl implements FileItemStream {\n\n      /** The file items content type. */\n      private final String contentType;\n\n      /** The file items field name. */\n      private final String fieldName;\n\n      /** The file items file name. */\n      private final String name;\n\n      /** Whether the file item is a form field. */\n      private final boolean formField;\n\n      /** The file items input stream. */\n      private final InputStream stream;\n\n      /** Whether the file item was already opened. */\n      private boolean opened;\n\n      /** The headers, if any. */\n      private FileItemHeaders headers;\n\n      /**\n       * Creates a new instance.\n       *\n       * @param pName The items file name, or null.\n       * @param pFieldName The items field name.\n       * @param pContentType The items content type, or null.\n       * @param pFormField Whether the item is a form field.\n       * @param pContentLength The items content length, if known, or -1\n       * @throws IOException Creating the file item failed.\n       */\n      FileItemStreamImpl(\n          String pName,\n          String pFieldName,\n          String pContentType,\n          boolean pFormField,\n          long pContentLength)\n          throws IOException {\n        name = pName;\n        fieldName = pFieldName;\n        contentType = pContentType;\n        formField = pFormField;\n        if (fileSizeMax != -1) { // Check if limit is already exceeded\n          if (pContentLength != -1 && pContentLength > fileSizeMax) {\n            FileSizeLimitExceededException e =\n                new FileSizeLimitExceededException(\n                    format(\n                        \"The field %s exceeds its maximum permitted size of %s bytes.\",\n                        fieldName, fileSizeMax),\n                    pContentLength,\n                    fileSizeMax);\n            e.setFileName(pName);\n            e.setFieldName(pFieldName);\n            throw new FileUploadIOException(e);\n          }\n        }\n        // OK to construct stream now\n        final MultipartStream.ItemInputStream itemStream = newInputStream(multi);\n        InputStream istream = itemStream;\n        if (fileSizeMax != -1) {\n          istream =\n              new LimitedInputStream(istream, fileSizeMax) {\n                @Override\n                protected void raiseError(long pSizeMax, long pCount) throws IOException {\n                  itemStream.close();\n                  FileSizeLimitExceededException e =\n                      new FileSizeLimitExceededException(\n                          format(\n                              \"The field %s exceeds its maximum permitted size of %s bytes.\",\n                              fieldName, pSizeMax),\n                          pCount,\n                          pSizeMax);\n                  e.setFieldName(fieldName);\n                  e.setFileName(name);\n                  throw new FileUploadIOException(e);\n                }\n              };\n        }\n        stream = istream;\n      }\n\n      private MultipartStream.ItemInputStream newInputStream(MultipartStream multipartStream) {\n        return Exceptions.uncheck(\n            () -> {\n              final Method newInputStreamMethod =\n                  multipartStream.getClass().getDeclaredMethod(\"newInputStream\");\n              newInputStreamMethod.setAccessible(true);\n              return (MultipartStream.ItemInputStream) newInputStreamMethod.invoke(multipartStream);\n            },\n            MultipartStream.ItemInputStream.class);\n      }\n\n      /**\n       * Returns the items content type, or null.\n       *\n       * @return Content type, if known, or null.\n       */\n      @Override\n      public String getContentType() {\n        return contentType;\n      }\n\n      /**\n       * Returns the items field name.\n       *\n       * @return Field name.\n       */\n      @Override\n      public String getFieldName() {\n        return fieldName;\n      }\n\n      /**\n       * Returns the items file name.\n       *\n       * @return File name, if known, or null.\n       * @throws InvalidFileNameException The file name contains a NUL character, which might be an\n       *     indicator of a security attack. If you intend to use the file name anyways, catch the\n       *     exception and use InvalidFileNameException#getName().\n       */\n      @Override\n      public String getName() {\n        return Streams.checkFileName(name);\n      }\n\n      /**\n       * Returns, whether this is a form field.\n       *\n       * @return True, if the item is a form field, otherwise false.\n       */\n      @Override\n      public boolean isFormField() {\n        return formField;\n      }\n\n      /**\n       * Returns an input stream, which may be used to read the items contents.\n       *\n       * @return Opened input stream.\n       * @throws IOException An I/O error occurred.\n       */\n      @Override\n      public InputStream openStream() throws IOException {\n        if (opened) {\n          throw new IllegalStateException(\"The stream was already opened.\");\n        }\n        if (stream instanceof Closeable && ((Closeable) stream).isClosed()) {\n          throw new FileItemStream.ItemSkippedException();\n        }\n        return stream;\n      }\n\n      /**\n       * Closes the file item.\n       *\n       * @throws IOException An I/O error occurred.\n       */\n      void close() throws IOException {\n        stream.close();\n      }\n\n      /**\n       * Returns the file item headers.\n       *\n       * @return The items header object\n       */\n      @Override\n      public FileItemHeaders getHeaders() {\n        return headers;\n      }\n\n      /**\n       * Sets the file item headers.\n       *\n       * @param pHeaders The items header object\n       */\n      @Override\n      public void setHeaders(FileItemHeaders pHeaders) {\n        headers = pHeaders;\n      }\n    }\n\n    /** The multi part stream to process. */\n    private final MultipartStream multi;\n\n    /** The boundary, which separates the various parts. */\n    private final byte[] boundary;\n\n    /** The item, which we currently process. */\n    private FileItemStreamImpl currentItem;\n\n    /** The current items field name. */\n    private String currentFieldName;\n\n    /** Whether we are currently skipping the preamble. */\n    private boolean skipPreamble;\n\n    /** Whether the current item may still be read. */\n    private boolean itemValid;\n\n    /** Whether we have seen the end of the file. */\n    private boolean eof;\n\n    /** Is this a multipart/related Request */\n    private final boolean multipartRelated;\n\n    /**\n     * Creates a new instance.\n     *\n     * @param ctx The request context.\n     * @throws FileUploadException An error occurred while parsing the request.\n     * @throws IOException An I/O error occurred.\n     */\n    FileItemIteratorImpl(RequestContext ctx) throws FileUploadException, IOException {\n      if (ctx == null) {\n        throw new NullPointerException(\"ctx parameter\");\n      }\n\n      String contentType = ctx.getContentType();\n      if ((null == contentType)\n          || (!contentType.toLowerCase(Locale.ENGLISH).startsWith(FileUploadBase.MULTIPART))) {\n        throw new InvalidContentTypeException(\n            format(\n                \"the request neither contain a %s nor a %s nor a %s stream, content type header is %s\",\n                FileUploadBase.MULTIPART_FORM_DATA,\n                FileUploadBase.MULTIPART_MIXED,\n                MULTIPART_RELATED,\n                contentType));\n      }\n\n      multipartRelated = contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART_RELATED);\n\n      @SuppressWarnings(\"deprecation\") // still has to be backward compatible\n      final int contentLengthInt = ctx.getContentLength();\n\n      final long requestSize =\n          UploadContext.class.isAssignableFrom(ctx.getClass())\n              // Inline conditional is OK here CHECKSTYLE:OFF\n              ? ((UploadContext) ctx).contentLength()\n              : contentLengthInt;\n      // CHECKSTYLE:ON\n\n      ; // N.B. this is eventually closed in MultipartStream processing\n      if (sizeMax >= 0) {\n        if (requestSize != -1 && requestSize > sizeMax) {\n          throw new SizeLimitExceededException(\n              format(\n                  \"the request was rejected because its size (%s) exceeds the configured maximum (%s)\",\n                  requestSize, sizeMax),\n              requestSize,\n              sizeMax);\n        }\n      }\n\n      try (InputStream input =\n          sizeMax >= 0\n              ? new LimitedInputStream(ctx.getInputStream(), sizeMax) {\n                @Override\n                protected void raiseError(long pSizeMax, long pCount) throws IOException {\n                  FileUploadException ex =\n                      new SizeLimitExceededException(\n                          format(\n                              \"the request was rejected because its size (%s) exceeds the configured maximum (%s)\",\n                              pCount, pSizeMax),\n                          pCount,\n                          pSizeMax);\n                  throw new FileUploadIOException(ex);\n                }\n              }\n              : ctx.getInputStream()) {\n        String charEncoding = headerEncoding;\n        if (charEncoding == null) {\n          charEncoding = ctx.getCharacterEncoding();\n        }\n\n        boundary = getBoundary(contentType);\n        if (boundary == null) {\n          throw new FileUploadException(\n              \"the request was rejected because no multipart boundary was found\");\n        }\n\n        try {\n          multi = new MultipartStream(input, boundary, 4096, null);\n        } catch (IllegalArgumentException iae) {\n          throw new InvalidContentTypeException(\n              format(\n                  \"The boundary specified in the %s header is too long\",\n                  FileUploadBase.CONTENT_TYPE),\n              iae);\n        }\n        multi.setHeaderEncoding(charEncoding);\n\n        skipPreamble = true;\n        findNextItem();\n      }\n    }\n\n    /**\n     * Called for finding the next item, if any.\n     *\n     * @return True, if an next item was found, otherwise false.\n     * @throws IOException An I/O error occurred.\n     */\n    private boolean findNextItem() throws IOException {\n      if (eof) {\n        return false;\n      }\n      if (currentItem != null) {\n        currentItem.close();\n        currentItem = null;\n      }\n      for (; ; ) {\n        boolean nextPart;\n        if (skipPreamble) {\n          nextPart = multi.skipPreamble();\n        } else {\n          nextPart = multi.readBoundary();\n        }\n        if (!nextPart) {\n          if (currentFieldName == null) {\n            // Outer multipart terminated -> No more data\n            eof = true;\n            return false;\n          }\n          // Inner multipart terminated -> Return to parsing the outer\n          multi.setBoundary(boundary);\n          currentFieldName = null;\n          continue;\n        }\n        FileItemHeaders headers = getParsedHeaders(multi.readHeaders());\n        if (multipartRelated) {\n          currentFieldName = \"\";\n          currentItem =\n              new FileItemStreamImpl(\n                  null,\n                  null,\n                  headers.getHeader(FileUploadBase.CONTENT_TYPE),\n                  false,\n                  getContentLength(headers));\n          currentItem.setHeaders(headers);\n          itemValid = true;\n          return true;\n        } else if (currentFieldName == null) {\n          // We're parsing the outer multipart\n          String fieldName = getFieldName(headers);\n          if (fieldName != null) {\n            String subContentType = headers.getHeader(FileUploadBase.CONTENT_TYPE);\n            if (subContentType != null\n                && subContentType\n                    .toLowerCase(Locale.ENGLISH)\n                    .startsWith(FileUploadBase.MULTIPART_MIXED)) {\n              currentFieldName = fieldName;\n              // Multiple files associated with this field name\n              byte[] subBoundary = getBoundary(subContentType);\n              multi.setBoundary(subBoundary);\n              skipPreamble = true;\n              continue;\n            }\n            String fileName = getFileName(headers);\n            currentItem =\n                new FileItemStreamImpl(\n                    fileName,\n                    fieldName,\n                    headers.getHeader(FileUploadBase.CONTENT_TYPE),\n                    fileName == null,\n                    getContentLength(headers));\n            currentItem.setHeaders(headers);\n            itemValid = true;\n            return true;\n          }\n        } else {\n          String fileName = getFileName(headers);\n          if (fileName != null) {\n            currentItem =\n                new FileItemStreamImpl(\n                    fileName,\n                    currentFieldName,\n                    headers.getHeader(FileUploadBase.CONTENT_TYPE),\n                    false,\n                    getContentLength(headers));\n            currentItem.setHeaders(headers);\n            itemValid = true;\n            return true;\n          }\n        }\n        multi.discardBodyData();\n      }\n    }\n\n    private long getContentLength(FileItemHeaders pHeaders) {\n      try {\n        return Long.parseLong(pHeaders.getHeader(FileUploadBase.CONTENT_LENGTH));\n      } catch (Exception e) {\n        return -1;\n      }\n    }\n\n    /**\n     * Returns, whether another instance of {@link FileItemStream} is available.\n     *\n     * @throws FileUploadException Parsing or processing the file item failed.\n     * @throws IOException Reading the file item failed.\n     * @return True, if one or more additional file items are available, otherwise false.\n     */\n    @Override\n    public boolean hasNext() throws FileUploadException, IOException {\n      if (eof) {\n        return false;\n      }\n      if (itemValid) {\n        return true;\n      }\n      try {\n        return findNextItem();\n      } catch (FileUploadIOException e) {\n        // unwrap encapsulated SizeException\n        throw (FileUploadException) e.getCause();\n      }\n    }\n\n    /**\n     * Returns the next available {@link FileItemStream}.\n     *\n     * @throws java.util.NoSuchElementException No more items are available. Use {@link #hasNext()}\n     *     to prevent this exception.\n     * @throws FileUploadException Parsing or processing the file item failed.\n     * @throws IOException Reading the file item failed.\n     * @return FileItemStream instance, which provides access to the next file item.\n     */\n    @Override\n    public FileItemStream next() throws FileUploadException, IOException {\n      if (eof || (!itemValid && !hasNext())) {\n        throw new NoSuchElementException();\n      }\n      itemValid = false;\n      return currentItem;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/multipart/PartParser.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.multipart;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.http.multipart.FileItemPartAdapter.TO_PARTS;\n\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport java.io.ByteArrayInputStream;\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport org.apache.commons.fileupload.FileItem;\nimport org.apache.commons.fileupload.FileItemFactory;\nimport org.apache.commons.fileupload.FileUploadException;\nimport org.apache.commons.fileupload.UploadContext;\nimport org.apache.commons.fileupload.disk.DiskFileItemFactory;\n\npublic class PartParser {\n\n  @SuppressWarnings(\"unchecked\")\n  public static Collection<Request.Part> parseFrom(Request request) {\n    FileItemFactory fileItemFactory =\n        new DiskFileItemFactory(Integer.MAX_VALUE, new File(System.getProperty(\"java.io.tmpdir\")));\n\n    HttpHeaders headers = request.getHeaders();\n    ByteArrayUploadContext uploadContext =\n        new ByteArrayUploadContext(\n            request.getBody(),\n            headerValueOrNull(\"Content-Encoding\", headers),\n            headers.getContentTypeHeader().firstValue());\n\n    FileUpload upload = new FileUpload(fileItemFactory);\n\n    try {\n      List<FileItem> items = upload.parseRequest(uploadContext);\n      return items.stream().map(TO_PARTS).collect(Collectors.toList());\n    } catch (FileUploadException e) {\n      return throwUnchecked(e, Collection.class);\n    }\n  }\n\n  private static String headerValueOrNull(String key, HttpHeaders httpHeaders) {\n    HttpHeader header = httpHeaders.getHeader(key);\n    return header.isPresent() ? header.firstValue() : null;\n  }\n\n  public static class ByteArrayUploadContext implements UploadContext {\n\n    private final byte[] content;\n    private final String encoding;\n    private final String contentType;\n\n    public ByteArrayUploadContext(byte[] content, String encoding, String contentType) {\n      this.content = content;\n      this.encoding = encoding;\n      this.contentType = contentType;\n    }\n\n    @Override\n    public long contentLength() {\n      return content.length;\n    }\n\n    @Override\n    public String getCharacterEncoding() {\n      return encoding;\n    }\n\n    @Override\n    public String getContentType() {\n      return contentType;\n    }\n\n    @Override\n    public int getContentLength() {\n      return content.length;\n    }\n\n    @Override\n    public InputStream getInputStream() throws IOException {\n      return new ByteArrayInputStream(content);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/ApacheHttpHostNameMatcher.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport java.security.cert.X509Certificate;\nimport javax.net.ssl.SNIHostName;\nimport javax.net.ssl.SSLException;\nimport org.apache.hc.client5.http.ssl.DefaultHostnameVerifier;\n\npublic class ApacheHttpHostNameMatcher implements HostNameMatcher {\n  @Override\n  public Boolean matches(X509Certificate x509Certificate, SNIHostName sniHostName) {\n    try {\n      new DefaultHostnameVerifier().verify(sniHostName.getAsciiName(), x509Certificate);\n      return true;\n    } catch (SSLException e) {\n      return false;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/CertChainAndKey.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport java.security.PrivateKey;\nimport java.security.cert.X509Certificate;\n\nclass CertChainAndKey {\n  final X509Certificate[] certificateChain;\n  final PrivateKey key;\n\n  CertChainAndKey(X509Certificate[] certificateChain, PrivateKey key) {\n    this.certificateChain = certificateChain;\n    this.key = key;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/CertificateAuthority.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static com.github.tomakehurst.wiremock.common.ArrayFunctions.prepend;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static java.util.Objects.requireNonNull;\n\nimport java.io.IOException;\nimport java.security.*;\nimport java.security.cert.CertificateException;\nimport java.security.cert.X509Certificate;\nimport java.time.Period;\nimport java.time.ZonedDateTime;\nimport java.util.Date;\nimport javax.net.ssl.SNIHostName;\nimport sun.security.x509.*;\n\n@SuppressWarnings(\"sunapi\")\npublic class CertificateAuthority {\n\n  private final X509Certificate[] certificateChain;\n  private final PrivateKey key;\n\n  public CertificateAuthority(X509Certificate[] certificateChain, PrivateKey key) {\n    this.certificateChain = requireNonNull(certificateChain);\n    if (certificateChain.length == 0) {\n      throw new IllegalArgumentException(\"Chain must have entries\");\n    }\n    this.key = requireNonNull(key);\n  }\n\n  public static CertificateAuthority generateCertificateAuthority()\n      throws CertificateGenerationUnsupportedException {\n    try {\n      KeyPair pair = generateKeyPair(\"RSA\");\n      String sigAlg = \"SHA256WithRSA\";\n      X509CertInfo info =\n          makeX509CertInfo(\n              sigAlg,\n              \"WireMock Local Self Signed Root Certificate\",\n              ZonedDateTime.now().minus(Period.ofDays(1)),\n              Period.ofYears(10),\n              pair.getPublic(),\n              certificateAuthorityExtensions(pair.getPublic()));\n\n      X509CertImpl certificate = selfSign(info, pair.getPrivate(), sigAlg);\n\n      return new CertificateAuthority(new X509Certificate[] {certificate}, pair.getPrivate());\n    } catch (NoSuchAlgorithmException\n        | NoSuchProviderException\n        | InvalidKeyException\n        | CertificateException\n        | SignatureException\n        | NoSuchMethodError\n        | VerifyError\n        | NoClassDefFoundError\n        | IOException\n        | IllegalAccessError e) {\n      throw new CertificateGenerationUnsupportedException(\n          \"Your runtime does not support generating certificates at runtime\", e);\n    }\n  }\n\n  private static X509CertImpl selfSign(X509CertInfo info, PrivateKey privateKey, String sigAlg)\n      throws CertificateException,\n          NoSuchAlgorithmException,\n          InvalidKeyException,\n          NoSuchProviderException,\n          SignatureException {\n    X509CertImpl certificate = new X509CertImpl(info);\n    certificate.sign(privateKey, sigAlg);\n    return certificate;\n  }\n\n  private static CertificateExtensions certificateAuthorityExtensions(PublicKey publicKey) {\n    try {\n      KeyIdentifier keyId = new KeyIdentifier(publicKey);\n      byte[] keyIdBytes = keyId.getIdentifier();\n      CertificateExtensions extensions = new CertificateExtensions();\n      extensions.set(\n          AuthorityKeyIdentifierExtension.NAME,\n          new AuthorityKeyIdentifierExtension(keyId, null, null));\n\n      extensions.set(\n          BasicConstraintsExtension.NAME, new BasicConstraintsExtension(true, Integer.MAX_VALUE));\n\n      KeyUsageExtension keyUsage = new KeyUsageExtension(new boolean[7]);\n      keyUsage.set(KeyUsageExtension.KEY_CERTSIGN, true);\n      keyUsage.set(KeyUsageExtension.CRL_SIGN, true);\n      extensions.set(KeyUsageExtension.NAME, keyUsage);\n\n      extensions.set(\n          SubjectKeyIdentifierExtension.NAME, new SubjectKeyIdentifierExtension(keyIdBytes));\n\n      return extensions;\n    } catch (IOException e) {\n      return throwUnchecked(e, null);\n    }\n  }\n\n  public X509Certificate[] certificateChain() {\n    return certificateChain;\n  }\n\n  public PrivateKey key() {\n    return key;\n  }\n\n  CertChainAndKey generateCertificate(String keyType, SNIHostName hostName)\n      throws CertificateGenerationUnsupportedException {\n    try {\n      KeyPair pair = generateKeyPair(keyType);\n      String sigAlg = \"SHA256With\" + keyType;\n      X509CertInfo info =\n          makeX509CertInfo(\n              sigAlg,\n              hostName.getAsciiName(),\n              ZonedDateTime.now().minus(Period.ofDays(1)),\n              Period.ofYears(1),\n              pair.getPublic(),\n              subjectAlternativeName(hostName));\n\n      X509CertImpl certificate = sign(info);\n\n      X509Certificate[] fullChain = prepend(certificate, certificateChain);\n      return new CertChainAndKey(fullChain, pair.getPrivate());\n    } catch (NoSuchAlgorithmException\n        | NoSuchProviderException\n        | InvalidKeyException\n        | CertificateException\n        | SignatureException\n        | NoSuchMethodError\n        | VerifyError\n        | NoClassDefFoundError\n        | IOException\n        | IllegalAccessError e) {\n      throw new CertificateGenerationUnsupportedException(\n          \"Your runtime does not support generating certificates at runtime\", e);\n    }\n  }\n\n  private X509CertImpl sign(X509CertInfo info)\n      throws CertificateException,\n          IOException,\n          NoSuchAlgorithmException,\n          InvalidKeyException,\n          NoSuchProviderException,\n          SignatureException {\n    X509Certificate issuerCertificate = certificateChain[0];\n    info.set(X509CertInfo.ISSUER, issuerCertificate.getSubjectDN());\n\n    X509CertImpl certificate = new X509CertImpl(info);\n    certificate.sign(key, issuerCertificate.getSigAlgName());\n    return certificate;\n  }\n\n  private static KeyPair generateKeyPair(String keyType) throws NoSuchAlgorithmException {\n    KeyPairGenerator keyGen = KeyPairGenerator.getInstance(keyType);\n    keyGen.initialize(2048, new SecureRandom());\n    return keyGen.generateKeyPair();\n  }\n\n  private static X509CertInfo makeX509CertInfo(\n      String sigAlg,\n      String subjectName,\n      ZonedDateTime start,\n      Period validity,\n      PublicKey publicKey,\n      CertificateExtensions certificateExtensions)\n      throws IOException, CertificateException, NoSuchAlgorithmException {\n    ZonedDateTime end = start.plus(validity);\n\n    X500Name myname = new X500Name(\"CN=\" + subjectName);\n    X509CertInfo info = new X509CertInfo();\n    // Add all mandatory attributes\n    info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));\n    info.set(\n        X509CertInfo.SERIAL_NUMBER,\n        new CertificateSerialNumber(new java.util.Random().nextInt() & 0x7fffffff));\n    info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(AlgorithmId.get(sigAlg)));\n    info.set(X509CertInfo.SUBJECT, myname);\n    info.set(X509CertInfo.KEY, new CertificateX509Key(publicKey));\n    info.set(\n        X509CertInfo.VALIDITY,\n        new CertificateValidity(Date.from(start.toInstant()), Date.from(end.toInstant())));\n    info.set(X509CertInfo.ISSUER, myname);\n    info.set(X509CertInfo.EXTENSIONS, certificateExtensions);\n    return info;\n  }\n\n  private static CertificateExtensions subjectAlternativeName(SNIHostName hostName) {\n    GeneralName name = new GeneralName(dnsName(hostName));\n    GeneralNames names = new GeneralNames();\n    names.add(name);\n    try {\n      CertificateExtensions extensions = new CertificateExtensions();\n      extensions.set(\n          SubjectAlternativeNameExtension.NAME, new SubjectAlternativeNameExtension(names));\n      return extensions;\n    } catch (IOException e) {\n      // it's an in memory op, should be impossible...\n      return throwUnchecked(e, null);\n    }\n  }\n\n  private static DNSName dnsName(SNIHostName name) {\n    try {\n      return new DNSName(name.getAsciiName());\n    } catch (IOException e) {\n      // DNSName throws IOException for a parse error (which isn't an IO problem...)\n      // An SNIHostName should be guaranteed not to have a parse issue\n      return throwUnchecked(e, null);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/CertificateGeneratingX509ExtendedKeyManager.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static java.lang.System.lineSeparator;\nimport static java.util.Collections.emptyList;\nimport static java.util.Objects.requireNonNull;\n\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport java.net.Socket;\nimport java.security.KeyStoreException;\nimport java.security.Principal;\nimport java.security.PrivateKey;\nimport java.security.cert.X509Certificate;\nimport java.util.List;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport java.util.stream.Collectors;\nimport javax.net.ssl.*;\n\npublic class CertificateGeneratingX509ExtendedKeyManager extends DelegatingX509ExtendedKeyManager {\n\n  private final DynamicKeyStore dynamicKeyStore;\n  private final HostNameMatcher hostNameMatcher;\n  private final OnceOnlyNotifier notifier;\n\n  public CertificateGeneratingX509ExtendedKeyManager(\n      X509ExtendedKeyManager keyManager,\n      DynamicKeyStore dynamicKeyStore,\n      HostNameMatcher hostNameMatcher,\n      Notifier notifier) {\n    super(keyManager);\n    this.dynamicKeyStore = requireNonNull(dynamicKeyStore);\n    this.hostNameMatcher = requireNonNull(hostNameMatcher);\n    this.notifier = new OnceOnlyNotifier(notifier);\n  }\n\n  @Override\n  public PrivateKey getPrivateKey(String alias) {\n    PrivateKey original = super.getPrivateKey(alias);\n    return original != null ? original : dynamicKeyStore.getPrivateKey(alias);\n  }\n\n  @Override\n  public X509Certificate[] getCertificateChain(String alias) {\n    X509Certificate[] original = super.getCertificateChain(alias);\n    return original != null ? original : dynamicKeyStore.getCertificateChain(alias);\n  }\n\n  @Override\n  public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) {\n    String defaultAlias = super.chooseServerAlias(keyType, issuers, socket);\n    ExtendedSSLSession handshakeSession = getHandshakeSession(socket);\n    return tryToChooseServerAlias(keyType, defaultAlias, handshakeSession);\n  }\n\n  private ExtendedSSLSession getHandshakeSession(Socket socket) {\n    if (socket instanceof SSLSocket) {\n      SSLSocket sslSocket = (SSLSocket) socket;\n      SSLSession sslSession = getHandshakeSessionIfSupported(sslSocket);\n      return getHandshakeSession(sslSession);\n    } else {\n      return null;\n    }\n  }\n\n  private SSLSession getHandshakeSessionIfSupported(SSLSocket sslSocket) {\n    try {\n      return sslSocket.getHandshakeSession();\n    } catch (UnsupportedOperationException e) {\n      notify(\"your SSL Provider does not support SSLSocket.getHandshakeSession()\", e);\n      return null;\n    }\n  }\n\n  @Override\n  public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine) {\n    String defaultAlias = super.chooseEngineServerAlias(keyType, issuers, engine);\n    ExtendedSSLSession handshakeSession = getHandshakeSession(engine);\n    return tryToChooseServerAlias(keyType, defaultAlias, handshakeSession);\n  }\n\n  private ExtendedSSLSession getHandshakeSession(SSLEngine sslEngine) {\n    SSLSession sslSession = getHandshakeSessionIfSupported(sslEngine);\n    return getHandshakeSession(sslSession);\n  }\n\n  private SSLSession getHandshakeSessionIfSupported(SSLEngine sslEngine) {\n    try {\n      return sslEngine.getHandshakeSession();\n    } catch (UnsupportedOperationException | NullPointerException e) {\n      notify(\"your SSL Provider does not support SSLEngine.getHandshakeSession()\", e);\n      return null;\n    }\n  }\n\n  private static ExtendedSSLSession getHandshakeSession(SSLSession handshakeSession) {\n    if (handshakeSession instanceof ExtendedSSLSession) {\n      return (ExtendedSSLSession) handshakeSession;\n    } else {\n      return null;\n    }\n  }\n\n  /**\n   * @param keyType non null, may be invalid\n   * @param defaultAlias nullable\n   * @param handshakeSession nullable\n   */\n  private String tryToChooseServerAlias(\n      String keyType, String defaultAlias, ExtendedSSLSession handshakeSession) {\n    if (defaultAlias != null && handshakeSession != null) {\n      return chooseServerAlias(keyType, defaultAlias, handshakeSession);\n    } else {\n      return defaultAlias;\n    }\n  }\n\n  /**\n   * @param keyType non null, guaranteed to be valid\n   * @param defaultAlias non null, guaranteed to match a private key entry\n   * @param handshakeSession non null\n   */\n  private String chooseServerAlias(\n      String keyType, String defaultAlias, ExtendedSSLSession handshakeSession) {\n    List<SNIHostName> requestedServerNames = getSNIHostNames(handshakeSession);\n    if (requestedServerNames.isEmpty()) {\n      return defaultAlias;\n    } else {\n      return chooseServerAlias(keyType, defaultAlias, requestedServerNames);\n    }\n  }\n\n  private List<SNIHostName> getSNIHostNames(ExtendedSSLSession handshakeSession) {\n    List<SNIServerName> requestedServerNames = getRequestedServerNames(handshakeSession);\n    return requestedServerNames.stream()\n        .filter(SNIHostName.class::isInstance)\n        .map(SNIHostName.class::cast)\n        .collect(Collectors.toList());\n  }\n\n  private List<SNIServerName> getRequestedServerNames(ExtendedSSLSession handshakeSession) {\n    try {\n      return handshakeSession.getRequestedServerNames();\n    } catch (UnsupportedOperationException e) {\n      notify(\"your SSL Provider does not support ExtendedSSLSession.getRequestedServerNames()\", e);\n      return emptyList();\n    }\n  }\n\n  /**\n   * @param keyType non null, guaranteed to be valid\n   * @param defaultAlias non null, guaranteed to match a private key entry\n   * @param requestedServerNames non null, non empty\n   */\n  private String chooseServerAlias(\n      String keyType, String defaultAlias, List<SNIHostName> requestedServerNames) {\n    X509Certificate[] certificateChain = super.getCertificateChain(defaultAlias);\n    if (certificateChain != null && matches(certificateChain[0], requestedServerNames)) {\n      return defaultAlias;\n    } else {\n      try {\n        SNIHostName requestedServerName = requestedServerNames.get(0);\n        dynamicKeyStore.generateCertificateIfNecessary(keyType, requestedServerName);\n        return requestedServerName.getAsciiName();\n      } catch (KeyStoreException | CertificateGenerationUnsupportedException e) {\n        notify(\n            \"certificates cannot be generated; perhaps the sun internal classes are not available?\",\n            e);\n        return defaultAlias;\n      }\n    }\n  }\n\n  private boolean matches(X509Certificate x509Certificate, List<SNIHostName> requestedServerNames) {\n    return requestedServerNames.stream()\n        .anyMatch(sniHostName -> hostNameMatcher.matches(x509Certificate, sniHostName));\n  }\n\n  private void notify(String reason, Exception e) {\n    notifier.error(\n        \"Dynamic certificate generation is not supported because \"\n            + reason\n            + lineSeparator()\n            + \"All sites will be served using the normal WireMock HTTPS certificate.\",\n        e);\n  }\n\n  private static class OnceOnlyNotifier implements Notifier {\n\n    private final Notifier notifier;\n    private final OnceOnly onceOnly = new OnceOnly();\n\n    private OnceOnlyNotifier(Notifier notifier) {\n      this.notifier = notifier;\n    }\n\n    @Override\n    public void info(String message) {\n      if (onceOnly.unused()) {\n        notifier.info(message);\n      }\n    }\n\n    @Override\n    public void error(String message) {\n      if (onceOnly.unused()) {\n        notifier.error(message);\n      }\n    }\n\n    @Override\n    public void error(String message, Throwable t) {\n      if (onceOnly.unused()) {\n        notifier.error(message, t);\n      }\n    }\n  }\n\n  private static class OnceOnly {\n    private final AtomicBoolean used = new AtomicBoolean(false);\n\n    boolean unused() {\n      return used.compareAndSet(false, true);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/CertificateGenerationUnsupportedException.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\npublic class CertificateGenerationUnsupportedException extends Exception {\n  public CertificateGenerationUnsupportedException(String message, Throwable cause) {\n    super(message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/CompositeTrustManager.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static java.util.Arrays.asList;\nimport static java.util.Arrays.copyOf;\n\nimport java.net.Socket;\nimport java.security.cert.CertificateException;\nimport java.security.cert.X509Certificate;\nimport java.util.ArrayList;\nimport java.util.Iterator;\nimport java.util.List;\nimport javax.net.ssl.SSLEngine;\nimport javax.net.ssl.X509ExtendedTrustManager;\nimport javax.net.ssl.X509TrustManager;\n\n/**\n * Implementation of {@link X509ExtendedTrustManager} that delegates to multiple nested\n * X509ExtendedTrustManagers.\n *\n * <p>{@link javax.net.ssl.SSLContext#init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[],\n * java.security.SecureRandom)} accepts an array of {@link javax.net.ssl.TrustManager} instances,\n * but {@link sun.security.ssl.SSLContextImpl#chooseTrustManager(javax.net.ssl.TrustManager[])}\n * chooses the first instance of X509TrustManager in the array. So in order to provide a composite\n * trust manager that will trust based on the decision of more than one X509TrustManager we need to\n * create a new implementation that delegates its decision to one or more real X509TrustManager\n * instances.\n *\n * <p>The contract of this class is that a check will pass if it passes against any of its trust\n * managers. If it passes against none of them, the {@link CertificateException} thrown by the last\n * of them is propagated.\n */\nclass CompositeTrustManager extends X509ExtendedTrustManager {\n\n  private final List<X509ExtendedTrustManager> trustManagers;\n  private final X509Certificate[] acceptedIssuers;\n\n  CompositeTrustManager(List<X509ExtendedTrustManager> trustManagers) {\n    if (trustManagers.isEmpty()) {\n      throw new IllegalArgumentException(\"A trust manager must be provided\");\n    }\n    this.trustManagers = new ArrayList<>(trustManagers);\n    this.acceptedIssuers = loadAcceptedIssuers(this.trustManagers);\n  }\n\n  private X509Certificate[] loadAcceptedIssuers(List<X509ExtendedTrustManager> trustManagers) {\n    List<X509Certificate> result = new ArrayList<>();\n    for (X509TrustManager trustManager : trustManagers) {\n      result.addAll(asList(trustManager.getAcceptedIssuers()));\n    }\n    return result.toArray(new X509Certificate[0]);\n  }\n\n  @Override\n  public void checkClientTrusted(final X509Certificate[] chain, final String authType)\n      throws CertificateException {\n    checkAllTrustManagers(tm -> tm.checkClientTrusted(chain, authType));\n  }\n\n  @Override\n  public void checkServerTrusted(final X509Certificate[] chain, final String authType)\n      throws CertificateException {\n    checkAllTrustManagers(tm -> tm.checkServerTrusted(chain, authType));\n  }\n\n  @Override\n  public void checkClientTrusted(\n      final X509Certificate[] chain, final String authType, final Socket socket)\n      throws CertificateException {\n    checkAllTrustManagers(tm -> tm.checkClientTrusted(chain, authType, socket));\n  }\n\n  @Override\n  public void checkServerTrusted(\n      final X509Certificate[] chain, final String authType, final Socket socket)\n      throws CertificateException {\n    checkAllTrustManagers(tm -> tm.checkServerTrusted(chain, authType, socket));\n  }\n\n  @Override\n  public void checkClientTrusted(\n      final X509Certificate[] chain, final String authType, final SSLEngine engine)\n      throws CertificateException {\n    checkAllTrustManagers(tm -> tm.checkClientTrusted(chain, authType, engine));\n  }\n\n  @Override\n  public void checkServerTrusted(\n      final X509Certificate[] chain, final String authType, final SSLEngine engine)\n      throws CertificateException {\n    checkAllTrustManagers(tm -> tm.checkServerTrusted(chain, authType, engine));\n  }\n\n  @Override\n  public X509Certificate[] getAcceptedIssuers() {\n    return copyOf(acceptedIssuers, acceptedIssuers.length);\n  }\n\n  private void checkAllTrustManagers(CertificateChecker certificateChecker)\n      throws CertificateException {\n    for (Iterator<X509ExtendedTrustManager> iterator = trustManagers.iterator();\n        iterator.hasNext(); ) {\n      X509ExtendedTrustManager tm = iterator.next();\n      try {\n        certificateChecker.check(tm);\n        break;\n      } catch (CertificateException e) {\n        if (!iterator.hasNext()) {\n          throw e;\n        }\n      }\n    }\n  }\n\n  private interface CertificateChecker {\n    void check(X509ExtendedTrustManager tm) throws CertificateException;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/DelegatingX509ExtendedKeyManager.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static java.util.Objects.requireNonNull;\n\nimport java.net.Socket;\nimport java.security.Principal;\nimport java.security.PrivateKey;\nimport java.security.cert.X509Certificate;\nimport javax.net.ssl.SSLEngine;\nimport javax.net.ssl.X509ExtendedKeyManager;\n\n/**\n * Convenience class to override in order to change specific methods without implementing all the\n * others.\n *\n * <p>Just delegates all calls to the delegate X509ExtendedKeyManager.\n */\npublic abstract class DelegatingX509ExtendedKeyManager extends X509ExtendedKeyManager {\n\n  private final X509ExtendedKeyManager delegate;\n\n  protected DelegatingX509ExtendedKeyManager(X509ExtendedKeyManager keyManager) {\n    this.delegate = requireNonNull(keyManager);\n  }\n\n  @Override\n  public String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine) {\n    return delegate.chooseEngineClientAlias(keyType, issuers, engine);\n  }\n\n  @Override\n  public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine) {\n    return delegate.chooseEngineServerAlias(keyType, issuers, engine);\n  }\n\n  @Override\n  public String[] getClientAliases(String keyType, Principal[] issuers) {\n    return delegate.getClientAliases(keyType, issuers);\n  }\n\n  @Override\n  public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket) {\n    return delegate.chooseClientAlias(keyType, issuers, socket);\n  }\n\n  @Override\n  public String[] getServerAliases(String keyType, Principal[] issuers) {\n    return delegate.getServerAliases(keyType, issuers);\n  }\n\n  @Override\n  public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) {\n    return delegate.chooseServerAlias(keyType, issuers, socket);\n  }\n\n  @Override\n  public X509Certificate[] getCertificateChain(String alias) {\n    return delegate.getCertificateChain(alias);\n  }\n\n  @Override\n  public PrivateKey getPrivateKey(String alias) {\n    return delegate.getPrivateKey(alias);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/DynamicKeyStore.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static java.util.Objects.requireNonNull;\n\nimport java.security.KeyStoreException;\nimport java.security.PrivateKey;\nimport java.security.cert.X509Certificate;\nimport javax.net.ssl.SNIHostName;\n\npublic class DynamicKeyStore {\n\n  private final X509KeyStore keyStore;\n  private final CertificateAuthority existingCertificateAuthority;\n\n  public DynamicKeyStore(X509KeyStore keyStore) {\n    this.keyStore = requireNonNull(keyStore);\n    this.existingCertificateAuthority =\n        requireNonNull(\n            keyStore.getCertificateAuthority(),\n            \"Keystore does not contain a certificate that can act as a certificate authority\");\n  }\n\n  PrivateKey getPrivateKey(String alias) {\n    return keyStore.getPrivateKey(alias);\n  }\n\n  X509Certificate[] getCertificateChain(String alias) {\n    return keyStore.getCertificateChain(alias);\n  }\n\n  /**\n   * @param keyType non null, guaranteed to be valid\n   * @param requestedServerName non null\n   */\n  void generateCertificateIfNecessary(String keyType, SNIHostName requestedServerName)\n      throws CertificateGenerationUnsupportedException, KeyStoreException {\n    if (getPrivateKey(requestedServerName.getAsciiName()) == null) {\n      generateCertificate(keyType, requestedServerName);\n    }\n  }\n\n  /**\n   * @param keyType non null, guaranteed to be valid\n   * @param requestedServerName non null\n   */\n  private void generateCertificate(String keyType, SNIHostName requestedServerName)\n      throws CertificateGenerationUnsupportedException, KeyStoreException {\n    CertChainAndKey newCertChainAndKey =\n        existingCertificateAuthority.generateCertificate(keyType, requestedServerName);\n    keyStore.setKeyEntry(requestedServerName.getAsciiName(), newCertChainAndKey);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/HostNameMatcher.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport java.security.cert.X509Certificate;\nimport javax.net.ssl.SNIHostName;\n\n@FunctionalInterface\npublic interface HostNameMatcher {\n  Boolean matches(X509Certificate x509Certificate, SNIHostName sniHostName);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/HostVerifyingSSLSocketFactory.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport java.io.IOException;\nimport java.net.InetAddress;\nimport java.net.Socket;\nimport java.net.UnknownHostException;\nimport javax.net.ssl.SSLParameters;\nimport javax.net.ssl.SSLSocket;\nimport javax.net.ssl.SSLSocketFactory;\n\npublic class HostVerifyingSSLSocketFactory extends SSLSocketFactory {\n\n  private final SSLSocketFactory delegate;\n\n  public HostVerifyingSSLSocketFactory(SSLSocketFactory delegate) {\n    this.delegate = delegate;\n  }\n\n  public String[] getDefaultCipherSuites() {\n    return delegate.getDefaultCipherSuites();\n  }\n\n  public String[] getSupportedCipherSuites() {\n    return delegate.getSupportedCipherSuites();\n  }\n\n  public Socket createSocket(Socket s, String host, int port, boolean autoClose)\n      throws IOException {\n    return verifyHosts(delegate.createSocket(s, host, port, autoClose));\n  }\n\n  public Socket createSocket() throws IOException {\n    return verifyHosts(delegate.createSocket());\n  }\n\n  public Socket createSocket(String host, int port) throws IOException, UnknownHostException {\n    return verifyHosts(delegate.createSocket(host, port));\n  }\n\n  public Socket createSocket(String host, int port, InetAddress localHost, int localPort)\n      throws IOException, UnknownHostException {\n    return verifyHosts(delegate.createSocket(host, port, localHost, localPort));\n  }\n\n  public Socket createSocket(InetAddress host, int port) throws IOException {\n    return verifyHosts(delegate.createSocket(host, port));\n  }\n\n  public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)\n      throws IOException {\n    return verifyHosts(delegate.createSocket(address, port, localAddress, localPort));\n  }\n\n  public static Socket verifyHosts(Socket socket) {\n    if (socket instanceof SSLSocket) {\n      SSLSocket sslSocket = (SSLSocket) socket;\n      SSLParameters sslParameters = sslSocket.getSSLParameters();\n      sslParameters.setEndpointIdentificationAlgorithm(\"HTTPS\");\n      sslSocket.setSSLParameters(sslParameters);\n    }\n    return socket;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/SSLContextBuilder.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static com.github.tomakehurst.wiremock.common.ArrayFunctions.concat;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.ListFunctions.splitByType;\nimport static java.util.Collections.addAll;\n\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport java.net.Socket;\nimport java.security.KeyManagementException;\nimport java.security.KeyStore;\nimport java.security.KeyStoreException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.UnrecoverableKeyException;\nimport java.security.cert.CertificateException;\nimport java.security.cert.X509Certificate;\nimport java.util.Collection;\nimport java.util.LinkedHashSet;\nimport java.util.List;\nimport java.util.Set;\nimport javax.net.ssl.KeyManager;\nimport javax.net.ssl.KeyManagerFactory;\nimport javax.net.ssl.SSLContext;\nimport javax.net.ssl.SSLEngine;\nimport javax.net.ssl.TrustManager;\nimport javax.net.ssl.TrustManagerFactory;\nimport javax.net.ssl.X509ExtendedTrustManager;\n\npublic class SSLContextBuilder {\n\n  private final Set<KeyManager> keyManagers = new LinkedHashSet<>();\n  private final Set<TrustManager> trustManagers = new LinkedHashSet<>();\n\n  public static SSLContextBuilder create() {\n    return new SSLContextBuilder();\n  }\n\n  public SSLContextBuilder loadTrustMaterial(final KeyStore truststore)\n      throws KeyStoreException, NoSuchAlgorithmException {\n    return loadTrustMaterial(truststore, null);\n  }\n\n  public SSLContextBuilder loadTrustMaterial(\n      final KeyStore truststore, final TrustStrategy trustStrategy)\n      throws NoSuchAlgorithmException, KeyStoreException {\n\n    String algorithm = TrustManagerFactory.getDefaultAlgorithm();\n    TrustManager[] tms = loadTrustManagers(truststore, algorithm);\n    TrustManager[] allTms = concat(tms, loadDefaultTrustManagers());\n\n    Pair<List<TrustManager>, List<X509ExtendedTrustManager>> split =\n        splitByType(allTms, X509ExtendedTrustManager.class);\n    List<TrustManager> otherTms = split.a;\n    List<X509ExtendedTrustManager> x509Tms = split.b;\n    if (!x509Tms.isEmpty()) {\n      CompositeTrustManager trustManager = new CompositeTrustManager(x509Tms);\n      TrustManager tm =\n          trustStrategy == null ? trustManager : addStrategy(trustManager, trustStrategy);\n      this.trustManagers.add(tm);\n    }\n    this.trustManagers.addAll(otherTms);\n    return this;\n  }\n\n  public SSLContextBuilder loadTrustMaterial(final TrustStrategy trustStrategy) {\n\n    TrustManager[] tms = loadDefaultTrustManagers();\n    TrustManager[] tmsWithStrategy = addStrategy(tms, trustStrategy);\n\n    addAll(this.trustManagers, tmsWithStrategy);\n    return this;\n  }\n\n  private TrustManager[] loadTrustManagers(KeyStore truststore, String algorithm)\n      throws NoSuchAlgorithmException, KeyStoreException {\n    final TrustManagerFactory tmfactory = TrustManagerFactory.getInstance(algorithm);\n    tmfactory.init(truststore);\n    TrustManager[] tms = tmfactory.getTrustManagers();\n    return tms == null ? new TrustManager[0] : tms;\n  }\n\n  private TrustManager[] loadDefaultTrustManagers() {\n    try {\n      return loadTrustManagers(null, TrustManagerFactory.getDefaultAlgorithm());\n    } catch (NoSuchAlgorithmException | KeyStoreException e) {\n      return throwUnchecked(e, null);\n    }\n  }\n\n  private TrustManager[] addStrategy(TrustManager[] allTms, TrustStrategy trustStrategy) {\n    TrustManager[] withStrategy = new TrustManager[allTms.length];\n    for (int i = 0; i < allTms.length; i++) {\n      withStrategy[i] = addStrategy(allTms[i], trustStrategy);\n    }\n    return withStrategy;\n  }\n\n  private TrustManager addStrategy(TrustManager tm, TrustStrategy trustStrategy) {\n    if (tm instanceof X509ExtendedTrustManager) {\n      return new TrustManagerDelegate((X509ExtendedTrustManager) tm, trustStrategy);\n    } else {\n      return tm;\n    }\n  }\n\n  public SSLContextBuilder loadKeyMaterial(final KeyStore keystore, final char[] keyPassword)\n      throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException {\n    final KeyManagerFactory kmfactory =\n        KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\n    kmfactory.init(keystore, keyPassword);\n    final KeyManager[] kms = kmfactory.getKeyManagers();\n    if (kms != null) {\n      addAll(keyManagers, kms);\n    }\n    return this;\n  }\n\n  protected void initSSLContext(\n      final SSLContext sslContext,\n      final Collection<KeyManager> keyManagers,\n      final Collection<TrustManager> trustManagers)\n      throws KeyManagementException {\n    sslContext.init(\n        !keyManagers.isEmpty() ? keyManagers.toArray(new KeyManager[0]) : null,\n        !trustManagers.isEmpty() ? trustManagers.toArray(new TrustManager[0]) : null,\n        null);\n  }\n\n  public SSLContext build() throws NoSuchAlgorithmException, KeyManagementException {\n    final SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n    initSSLContext(sslContext, keyManagers, trustManagers);\n    return sslContext;\n  }\n\n  static class TrustManagerDelegate extends X509ExtendedTrustManager {\n\n    private final X509ExtendedTrustManager trustManager;\n    private final TrustStrategy trustStrategy;\n\n    TrustManagerDelegate(\n        final X509ExtendedTrustManager trustManager, final TrustStrategy trustStrategy) {\n      this.trustManager = trustManager;\n      this.trustStrategy = trustStrategy;\n    }\n\n    @Override\n    public void checkClientTrusted(final X509Certificate[] chain, final String authType)\n        throws CertificateException {\n      this.trustManager.checkClientTrusted(chain, authType);\n    }\n\n    @Override\n    public void checkServerTrusted(final X509Certificate[] chain, final String authType)\n        throws CertificateException {\n      if (!this.trustStrategy.isTrusted(chain, authType)) {\n        this.trustManager.checkServerTrusted(chain, authType);\n      }\n    }\n\n    @Override\n    public X509Certificate[] getAcceptedIssuers() {\n      return this.trustManager.getAcceptedIssuers();\n    }\n\n    @Override\n    public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket)\n        throws CertificateException {\n      trustManager.checkClientTrusted(chain, authType, socket);\n    }\n\n    @Override\n    public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket)\n        throws CertificateException {\n      if (!this.trustStrategy.isTrusted(chain, authType, socket)) {\n        trustManager.checkServerTrusted(chain, authType, socket);\n      }\n    }\n\n    @Override\n    public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine)\n        throws CertificateException {\n      trustManager.checkClientTrusted(chain, authType, engine);\n    }\n\n    @Override\n    public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine)\n        throws CertificateException {\n      if (!this.trustStrategy.isTrusted(chain, authType, engine)) {\n        trustManager.checkServerTrusted(chain, authType, engine);\n      }\n    }\n  }\n\n  @Override\n  public String toString() {\n    return \"[keyManagers=\" + keyManagers + \", trustManagers=\" + trustManagers + \"]\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/TrustEverythingStrategy.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport java.net.Socket;\nimport java.security.cert.X509Certificate;\nimport javax.net.ssl.SSLEngine;\n\npublic class TrustEverythingStrategy implements TrustStrategy {\n  @Override\n  public boolean isTrusted(X509Certificate[] chain, String authType) {\n    return true;\n  }\n\n  @Override\n  public boolean isTrusted(X509Certificate[] chain, String authType, Socket socket) {\n    return true;\n  }\n\n  @Override\n  public boolean isTrusted(X509Certificate[] chain, String authType, SSLEngine engine) {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/TrustSpecificHostsStrategy.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport java.net.InetAddress;\nimport java.net.Socket;\nimport java.security.cert.X509Certificate;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.net.ssl.SSLEngine;\n\npublic class TrustSpecificHostsStrategy implements TrustStrategy {\n\n  private final List<String> trustedHosts;\n\n  public TrustSpecificHostsStrategy(List<String> trustedHosts) {\n    this.trustedHosts = new ArrayList<>(trustedHosts);\n  }\n\n  @Override\n  public boolean isTrusted(X509Certificate[] chain, String authType) {\n    return false;\n  }\n\n  @Override\n  public boolean isTrusted(X509Certificate[] chain, String authType, Socket socket) {\n    InetAddress inetAddress = socket.getInetAddress();\n    return trustedHosts.contains(inetAddress.getHostName())\n        || trustedHosts.contains(inetAddress.getHostAddress());\n  }\n\n  @Override\n  public boolean isTrusted(X509Certificate[] chain, String authType, SSLEngine engine) {\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/TrustStrategy.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport java.net.Socket;\nimport java.security.cert.X509Certificate;\nimport javax.net.ssl.SSLEngine;\n\npublic interface TrustStrategy {\n\n  boolean isTrusted(X509Certificate[] chain, String authType);\n\n  boolean isTrusted(X509Certificate[] chain, String authType, Socket socket);\n\n  boolean isTrusted(X509Certificate[] chain, String authType, SSLEngine engine);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/ssl/X509KeyStore.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.ssl;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static java.util.Arrays.stream;\nimport static java.util.Objects.requireNonNull;\n\nimport java.security.*;\nimport java.security.cert.Certificate;\nimport java.security.cert.X509Certificate;\nimport java.util.Collections;\nimport java.util.List;\n\n/** Wrapper class to make it easy to retrieve X509 PrivateKey and certificate chains */\npublic class X509KeyStore {\n\n  private final KeyStore keyStore;\n  private final char[] password;\n  private final List<String> aliases;\n\n  /**\n   * @param keyStore {@link KeyStore} to delegate to\n   * @param password used to manage all keys stored in this key store\n   * @throws KeyStoreException if the keystore has not been loaded\n   */\n  public X509KeyStore(KeyStore keyStore, char[] password) throws KeyStoreException {\n    this.keyStore = requireNonNull(keyStore);\n    this.password = requireNonNull(password);\n    this.aliases = Collections.list(keyStore.aliases());\n  }\n\n  PrivateKey getPrivateKey(String alias) {\n    try {\n      Key key = keyStore.getKey(alias, password);\n      if (key instanceof PrivateKey) {\n        return (PrivateKey) key;\n      } else {\n        return null;\n      }\n    } catch (NoSuchAlgorithmException | UnrecoverableKeyException e) {\n      return null;\n    } catch (KeyStoreException e) {\n      // impossible, class could not have been constructed\n      return throwUnchecked(e, null);\n    }\n  }\n\n  X509Certificate[] getCertificateChain(String alias) {\n    try {\n      Certificate[] fromKeyStore = keyStore.getCertificateChain(alias);\n      if (fromKeyStore != null && areX509Certificates(fromKeyStore)) {\n        return convertToX509(fromKeyStore);\n      } else {\n        return null;\n      }\n    } catch (KeyStoreException e) {\n      return throwUnchecked(e, null);\n    }\n  }\n\n  private static boolean areX509Certificates(Certificate[] fromKeyStore) {\n    return fromKeyStore.length == 0 || fromKeyStore[0] instanceof X509Certificate;\n  }\n\n  private static X509Certificate[] convertToX509(Certificate[] fromKeyStore) {\n    return stream(fromKeyStore).map(X509Certificate.class::cast).toArray(X509Certificate[]::new);\n  }\n\n  /**\n   * @return the first key &amp; chain that represent a certificate authority or null if none found\n   */\n  public CertificateAuthority getCertificateAuthority() {\n    for (String alias : aliases) {\n      X509Certificate[] chain = getCertificateChain(alias);\n      PrivateKey key = getPrivateKey(alias);\n      if (isCertificateAuthority(chain[0]) && key != null) {\n        return new CertificateAuthority(chain, key);\n      }\n    }\n    return null;\n  }\n\n  private static boolean isCertificateAuthority(X509Certificate certificate) {\n    boolean[] keyUsage = certificate.getKeyUsage();\n    return keyUsage != null && keyUsage.length > 5 && keyUsage[5];\n  }\n\n  void setKeyEntry(String alias, CertChainAndKey newCertChainAndKey) throws KeyStoreException {\n    keyStore.setKeyEntry(\n        alias, newCertChainAndKey.key, password, newCertChainAndKey.certificateChain);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/trafficlistener/CollectingNetworkTrafficListener.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.trafficlistener;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport java.net.Socket;\nimport java.nio.ByteBuffer;\nimport java.nio.charset.CharacterCodingException;\nimport java.nio.charset.Charset;\nimport java.nio.charset.CharsetDecoder;\n\npublic class CollectingNetworkTrafficListener implements WiremockNetworkTrafficListener {\n\n  private final StringBuilder requestBuilder = new StringBuilder();\n  private final StringBuilder responseBuilder = new StringBuilder();\n\n  private final Charset charset = UTF_8;\n  private final CharsetDecoder decoder = charset.newDecoder();\n\n  @Override\n  public void opened(Socket socket) {}\n\n  @Override\n  public void incoming(Socket socket, ByteBuffer bytes) {\n    try {\n      requestBuilder.append(decoder.decode(bytes));\n    } catch (CharacterCodingException e) {\n      notifier().error(\"Problem decoding network traffic\", e);\n    }\n  }\n\n  @Override\n  public void outgoing(Socket socket, ByteBuffer bytes) {\n    try {\n      responseBuilder.append(decoder.decode(bytes));\n    } catch (CharacterCodingException e) {\n      notifier().error(\"Problem decoding network traffic\", e);\n    }\n  }\n\n  @Override\n  public void closed(Socket socket) {}\n\n  public String getAllRequests() {\n    return requestBuilder.toString();\n  }\n\n  public String getAllResponses() {\n    return responseBuilder.toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/trafficlistener/ConsoleNotifyingWiremockNetworkTrafficListener.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.trafficlistener;\n\nimport java.net.Socket;\nimport java.nio.ByteBuffer;\nimport java.nio.charset.Charset;\n\npublic class ConsoleNotifyingWiremockNetworkTrafficListener\n    implements WiremockNetworkTrafficListener {\n\n  private final WiremockNetworkTrafficListener wiremockNetworkTrafficListener;\n\n  public ConsoleNotifyingWiremockNetworkTrafficListener(Charset charset) {\n    this.wiremockNetworkTrafficListener =\n        WiremockNetworkTrafficListeners.createConsoleNotifying(charset);\n  }\n\n  public ConsoleNotifyingWiremockNetworkTrafficListener() {\n    this.wiremockNetworkTrafficListener = WiremockNetworkTrafficListeners.createConsoleNotifying();\n  }\n\n  @Override\n  public void opened(Socket socket) {\n    wiremockNetworkTrafficListener.opened(socket);\n  }\n\n  @Override\n  public void incoming(Socket socket, ByteBuffer bytes) {\n    wiremockNetworkTrafficListener.incoming(socket, bytes);\n  }\n\n  @Override\n  public void outgoing(Socket socket, ByteBuffer bytes) {\n    wiremockNetworkTrafficListener.outgoing(socket, bytes);\n  }\n\n  @Override\n  public void closed(Socket socket) {\n    wiremockNetworkTrafficListener.closed(socket);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/trafficlistener/DoNothingWiremockNetworkTrafficListener.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.trafficlistener;\n\nimport java.net.Socket;\nimport java.nio.ByteBuffer;\n\npublic class DoNothingWiremockNetworkTrafficListener implements WiremockNetworkTrafficListener {\n  @Override\n  public void opened(Socket socket) {}\n\n  @Override\n  public void incoming(Socket socket, ByteBuffer bytes) {}\n\n  @Override\n  public void outgoing(Socket socket, ByteBuffer bytes) {}\n\n  @Override\n  public void closed(Socket socket) {}\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/trafficlistener/NotifyingWiremockNetworkTrafficListener.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.trafficlistener;\n\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport java.net.Socket;\nimport java.nio.ByteBuffer;\nimport java.nio.charset.CharacterCodingException;\nimport java.nio.charset.Charset;\nimport java.nio.charset.CharsetDecoder;\n\nfinal class NotifyingWiremockNetworkTrafficListener implements WiremockNetworkTrafficListener {\n\n  private final Notifier notifier;\n  private final Charset charset;\n  private final CharsetDecoder charsetDecoder;\n\n  NotifyingWiremockNetworkTrafficListener(Notifier notifier, Charset charset) {\n    this.notifier = notifier;\n    this.charset = charset;\n    this.charsetDecoder = charset.newDecoder();\n  }\n\n  @Override\n  public void opened(Socket socket) {\n    notifier.info(\"Opened \" + socket);\n  }\n\n  @Override\n  public void incoming(Socket socket, ByteBuffer bytes) {\n    try {\n      notifier.info(\"Incoming bytes: \" + charsetDecoder.decode(bytes));\n    } catch (CharacterCodingException e) {\n      notifier.error(\"Incoming bytes omitted. Could not decode with charset: \" + charset);\n    }\n  }\n\n  @Override\n  public void outgoing(Socket socket, ByteBuffer bytes) {\n    try {\n      notifier.info(\"Outgoing bytes: \" + charsetDecoder.decode(bytes));\n    } catch (CharacterCodingException e) {\n      notifier.error(\"Outgoing bytes omitted. Could not decode with charset: \" + charset);\n    }\n  }\n\n  @Override\n  public void closed(Socket socket) {\n    notifier.info(\"Closed \" + socket);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/trafficlistener/WiremockNetworkTrafficListener.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.trafficlistener;\n\nimport java.net.Socket;\nimport java.nio.ByteBuffer;\n\npublic interface WiremockNetworkTrafficListener {\n  void opened(Socket socket);\n\n  void incoming(Socket socket, ByteBuffer bytes);\n\n  void outgoing(Socket socket, ByteBuffer bytes);\n\n  void closed(Socket socket);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/http/trafficlistener/WiremockNetworkTrafficListeners.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.trafficlistener;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport java.nio.charset.Charset;\n\npublic final class WiremockNetworkTrafficListeners {\n  private static final ConsoleNotifier CONSOLE_NOTIFIER = new ConsoleNotifier(true);\n\n  private WiremockNetworkTrafficListeners() {}\n\n  public static WiremockNetworkTrafficListener createNotifying(Notifier notifier, Charset charset) {\n    return new NotifyingWiremockNetworkTrafficListener(notifier, charset);\n  }\n\n  public static WiremockNetworkTrafficListener createConsoleNotifying() {\n    return new NotifyingWiremockNetworkTrafficListener(CONSOLE_NOTIFIER, UTF_8);\n  }\n\n  public static WiremockNetworkTrafficListener createConsoleNotifying(Charset charset) {\n    return new NotifyingWiremockNetworkTrafficListener(CONSOLE_NOTIFIER, charset);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/junit/DslWrapper.java",
    "content": "/*\n * Copyright (C) 2021-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit;\n\nimport com.github.tomakehurst.wiremock.admin.model.*;\nimport com.github.tomakehurst.wiremock.client.CountMatchingStrategy;\nimport com.github.tomakehurst.wiremock.client.MappingBuilder;\nimport com.github.tomakehurst.wiremock.client.MessageStubMappingBuilder;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.recording.RecordSpec;\nimport com.github.tomakehurst.wiremock.recording.RecordSpecBuilder;\nimport com.github.tomakehurst.wiremock.recording.RecordingStatusResult;\nimport com.github.tomakehurst.wiremock.recording.SnapshotRecordResult;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.verification.*;\nimport java.time.Duration;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\n\npublic class DslWrapper implements Admin, Stubbing {\n\n  protected Admin admin;\n  protected Stubbing stubbing;\n\n  @Override\n  public void addStubMapping(StubMapping stubMapping) {\n    admin.addStubMapping(stubMapping);\n  }\n\n  @Override\n  public void editStubMapping(StubMapping stubMapping) {\n    admin.editStubMapping(stubMapping);\n  }\n\n  @Override\n  public void removeStubMapping(StubMapping stubbMapping) {\n    admin.removeStubMapping(stubbMapping);\n  }\n\n  @Override\n  public void removeStubMapping(UUID id) {\n    admin.removeStubMapping(id);\n  }\n\n  @Override\n  public ListStubMappingsResult listAllStubMappings() {\n    return admin.listAllStubMappings();\n  }\n\n  @Override\n  public SingleStubMappingResult getStubMapping(UUID id) {\n    return admin.getStubMapping(id);\n  }\n\n  @Override\n  public void saveMappings() {\n    admin.saveMappings();\n  }\n\n  @Override\n  public void resetRequests() {\n    admin.resetRequests();\n  }\n\n  @Override\n  public void resetScenarios() {\n    admin.resetScenarios();\n  }\n\n  @Override\n  public void resetMappings() {\n    admin.resetMappings();\n  }\n\n  @Override\n  public void resetAll() {\n    admin.resetAll();\n  }\n\n  @Override\n  public void resetToDefaultMappings() {\n    admin.resetToDefaultMappings();\n  }\n\n  @Override\n  public GetServeEventsResult getServeEvents() {\n    return admin.getServeEvents();\n  }\n\n  @Override\n  public GetServeEventsResult getServeEvents(ServeEventQuery query) {\n    return admin.getServeEvents(query);\n  }\n\n  @Override\n  public SingleServedStubResult getServedStub(UUID id) {\n    return admin.getServedStub(id);\n  }\n\n  @Override\n  public VerificationResult countRequestsMatching(RequestPattern requestPattern) {\n    return admin.countRequestsMatching(requestPattern);\n  }\n\n  @Override\n  public FindRequestsResult findRequestsMatching(RequestPattern requestPattern) {\n    return admin.findRequestsMatching(requestPattern);\n  }\n\n  @Override\n  public FindRequestsResult findUnmatchedRequests() {\n    return admin.findUnmatchedRequests();\n  }\n\n  @Override\n  public void removeServeEvent(UUID eventId) {\n    admin.removeServeEvent(eventId);\n  }\n\n  @Override\n  public FindServeEventsResult removeServeEventsMatching(RequestPattern requestPattern) {\n    return admin.removeServeEventsMatching(requestPattern);\n  }\n\n  @Override\n  public FindServeEventsResult removeServeEventsForStubsMatchingMetadata(\n      StringValuePattern pattern) {\n    return admin.removeServeEventsForStubsMatchingMetadata(pattern);\n  }\n\n  @Override\n  public FindNearMissesResult findTopNearMissesFor(LoggedRequest loggedRequest) {\n    return admin.findTopNearMissesFor(loggedRequest);\n  }\n\n  @Override\n  public FindNearMissesResult findTopNearMissesFor(RequestPattern requestPattern) {\n    return admin.findTopNearMissesFor(requestPattern);\n  }\n\n  @Override\n  public FindNearMissesResult findNearMissesForUnmatchedRequests() {\n    return admin.findNearMissesForUnmatchedRequests();\n  }\n\n  @Override\n  public GetScenariosResult getAllScenarios() {\n    return admin.getAllScenarios();\n  }\n\n  @Override\n  public void resetScenario(String name) {\n    admin.resetScenario(name);\n  }\n\n  @Override\n  public void setScenarioState(String name, String state) {\n    admin.setScenarioState(name, state);\n  }\n\n  @Override\n  public void updateGlobalSettings(GlobalSettings settings) {\n    admin.updateGlobalSettings(settings);\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord() {\n    return admin.snapshotRecord();\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord(RecordSpec spec) {\n    return admin.snapshotRecord(spec);\n  }\n\n  @Override\n  public SnapshotRecordResult snapshotRecord(RecordSpecBuilder spec) {\n    return admin.snapshotRecord(spec);\n  }\n\n  @Override\n  public void startRecording(String targetBaseUrl) {\n    admin.startRecording(targetBaseUrl);\n  }\n\n  @Override\n  public void startRecording(RecordSpec spec) {\n    admin.startRecording(spec);\n  }\n\n  @Override\n  public void startRecording(RecordSpecBuilder recordSpec) {\n    admin.startRecording(recordSpec);\n  }\n\n  @Override\n  public SnapshotRecordResult stopRecording() {\n    return admin.stopRecording();\n  }\n\n  @Override\n  public RecordingStatusResult getRecordingStatus() {\n    return admin.getRecordingStatus();\n  }\n\n  @Override\n  public Options getOptions() {\n    return admin.getOptions();\n  }\n\n  @Override\n  public void shutdownServer() {\n    admin.shutdownServer();\n  }\n\n  @Override\n  public ListStubMappingsResult findUnmatchedStubs() {\n    return admin.findUnmatchedStubs();\n  }\n\n  @Override\n  public ListStubMappingsResult findAllStubsByMetadata(StringValuePattern pattern) {\n    return admin.findAllStubsByMetadata(pattern);\n  }\n\n  @Override\n  public void removeStubsByMetadata(StringValuePattern pattern) {\n    admin.removeStubsByMetadata(pattern);\n  }\n\n  @Override\n  public void importStubs(StubImport stubImport) {\n    admin.importStubs(stubImport);\n  }\n\n  @Override\n  public void removeStubMappings(List<StubMapping> stubMappings) {\n    admin.removeStubMappings(stubMappings);\n  }\n\n  @Override\n  public GetGlobalSettingsResult getGlobalSettings() {\n    return admin.getGlobalSettings();\n  }\n\n  @Override\n  public StubMapping givenThat(MappingBuilder mappingBuilder) {\n    return stubbing.givenThat(mappingBuilder);\n  }\n\n  @Override\n  public StubMapping stubFor(MappingBuilder mappingBuilder) {\n    return stubbing.stubFor(mappingBuilder);\n  }\n\n  @Override\n  public void editStub(MappingBuilder mappingBuilder) {\n    stubbing.editStub(mappingBuilder);\n  }\n\n  @Override\n  public void removeStub(MappingBuilder mappingBuilder) {\n    stubbing.removeStub(mappingBuilder);\n  }\n\n  @Override\n  public void removeStub(StubMapping mappingBuilder) {\n    stubbing.removeStub(mappingBuilder);\n  }\n\n  @Override\n  public void removeStub(UUID id) {\n    stubbing.removeStub(id);\n  }\n\n  @Override\n  public List<StubMapping> getStubMappings() {\n    return stubbing.getStubMappings();\n  }\n\n  @Override\n  public StubMapping getSingleStubMapping(UUID id) {\n    return stubbing.getSingleStubMapping(id);\n  }\n\n  @Override\n  public List<StubMapping> findStubMappingsByMetadata(StringValuePattern pattern) {\n    return stubbing.findStubMappingsByMetadata(pattern);\n  }\n\n  @Override\n  public void removeStubMappingsByMetadata(StringValuePattern pattern) {\n    stubbing.removeStubMappingsByMetadata(pattern);\n  }\n\n  @Override\n  public void verify(RequestPatternBuilder requestPatternBuilder) {\n    stubbing.verify(requestPatternBuilder);\n  }\n\n  @Override\n  public void verify(int count, RequestPatternBuilder requestPatternBuilder) {\n    stubbing.verify(count, requestPatternBuilder);\n  }\n\n  @Override\n  public void verify(\n      CountMatchingStrategy countMatchingStrategy, RequestPatternBuilder requestPatternBuilder) {\n    stubbing.verify(countMatchingStrategy, requestPatternBuilder);\n  }\n\n  @Override\n  public List<LoggedRequest> findAll(RequestPatternBuilder requestPatternBuilder) {\n    return stubbing.findAll(requestPatternBuilder);\n  }\n\n  @Override\n  public List<ServeEvent> getAllServeEvents() {\n    return stubbing.getAllServeEvents();\n  }\n\n  @Override\n  public void setGlobalFixedDelay(int milliseconds) {\n    stubbing.setGlobalFixedDelay(milliseconds);\n  }\n\n  @Override\n  public List<LoggedRequest> findAllUnmatchedRequests() {\n    return stubbing.findAllUnmatchedRequests();\n  }\n\n  @Override\n  public List<NearMiss> findNearMissesForAllUnmatchedRequests() {\n    return stubbing.findNearMissesForAllUnmatchedRequests();\n  }\n\n  @Override\n  public List<NearMiss> findNearMissesFor(LoggedRequest loggedRequest) {\n    return stubbing.findNearMissesFor(loggedRequest);\n  }\n\n  @Override\n  public List<NearMiss> findAllNearMissesFor(RequestPatternBuilder requestPatternBuilder) {\n    return stubbing.findAllNearMissesFor(requestPatternBuilder);\n  }\n\n  @Override\n  public SendChannelMessageResult sendChannelMessage(\n      ChannelType type, RequestPattern requestPattern, MessageDefinition message) {\n    return admin.sendChannelMessage(type, requestPattern, message);\n  }\n\n  @Override\n  public ListMessageChannelsResult listAllMessageChannels() {\n    return admin.listAllMessageChannels();\n  }\n\n  @Override\n  public void addMessageStubMapping(MessageStubMapping messageStubMapping) {\n    admin.addMessageStubMapping(messageStubMapping);\n  }\n\n  @Override\n  public void removeMessageStubMapping(UUID id) {\n    admin.removeMessageStubMapping(id);\n  }\n\n  @Override\n  public void resetMessageStubMappings() {\n    admin.resetMessageStubMappings();\n  }\n\n  @Override\n  public ListMessageStubMappingsResult findAllMessageStubsByMetadata(StringValuePattern pattern) {\n    return admin.findAllMessageStubsByMetadata(pattern);\n  }\n\n  @Override\n  public void removeMessageStubsByMetadata(StringValuePattern pattern) {\n    admin.removeMessageStubsByMetadata(pattern);\n  }\n\n  @Override\n  public ListMessageStubMappingsResult listAllMessageStubMappings() {\n    return admin.listAllMessageStubMappings();\n  }\n\n  // Stubbing interface methods for message stubs\n\n  @Override\n  public MessageStubMapping messageStubFor(MessageStubMappingBuilder builder) {\n    return stubbing.messageStubFor(builder);\n  }\n\n  @Override\n  public MessageStubMapping messageStubFor(MessageStubMapping messageStubMapping) {\n    return stubbing.messageStubFor(messageStubMapping);\n  }\n\n  @Override\n  public void removeMessageStub(UUID id) {\n    stubbing.removeMessageStub(id);\n  }\n\n  @Override\n  public List<MessageStubMapping> getMessageStubMappingsList() {\n    return stubbing.getMessageStubMappingsList();\n  }\n\n  @Override\n  public void resetMessageStubs() {\n    stubbing.resetMessageStubs();\n  }\n\n  // Message journal methods from Admin interface\n\n  @Override\n  public GetMessageServeEventsResult getMessageServeEvents() {\n    return admin.getMessageServeEvents();\n  }\n\n  @Override\n  public SingleMessageServeEventResult getMessageServeEvent(UUID id) {\n    return admin.getMessageServeEvent(id);\n  }\n\n  @Override\n  public int countMessageEventsMatching(MessagePattern pattern) {\n    return admin.countMessageEventsMatching(pattern);\n  }\n\n  @Override\n  public List<MessageServeEvent> findMessageEventsMatching(MessagePattern pattern) {\n    return admin.findMessageEventsMatching(pattern);\n  }\n\n  @Override\n  public void removeMessageServeEvent(UUID eventId) {\n    admin.removeMessageServeEvent(eventId);\n  }\n\n  @Override\n  public FindMessageServeEventsResult removeMessageServeEventsMatching(MessagePattern pattern) {\n    return admin.removeMessageServeEventsMatching(pattern);\n  }\n\n  @Override\n  public FindMessageServeEventsResult removeMessageServeEventsForStubsMatchingMetadata(\n      StringValuePattern pattern) {\n    return admin.removeMessageServeEventsForStubsMatchingMetadata(pattern);\n  }\n\n  @Override\n  public void resetMessageJournal() {\n    admin.resetMessageJournal();\n  }\n\n  @Override\n  public Optional<MessageServeEvent> waitForMessageEvent(MessagePattern pattern, Duration maxWait) {\n    return admin.waitForMessageEvent(pattern, maxWait);\n  }\n\n  @Override\n  public List<MessageServeEvent> waitForMessageEvents(\n      MessagePattern pattern, int count, Duration maxWait) {\n    return admin.waitForMessageEvents(pattern, count, maxWait);\n  }\n\n  // Message journal methods from Stubbing interface\n\n  @Override\n  public List<MessageServeEvent> getAllMessageServeEvents() {\n    return stubbing.getAllMessageServeEvents();\n  }\n\n  @Override\n  public List<MessageServeEvent> findAllMessageEvents(MessagePattern pattern) {\n    return stubbing.findAllMessageEvents(pattern);\n  }\n\n  @Override\n  public void verifyMessageEvent(MessagePattern pattern) {\n    stubbing.verifyMessageEvent(pattern);\n  }\n\n  @Override\n  public void verifyMessageEvent(int expectedCount, MessagePattern pattern) {\n    stubbing.verifyMessageEvent(expectedCount, pattern);\n  }\n\n  @Override\n  public void verifyMessageEvent(CountMatchingStrategy expectedCount, MessagePattern pattern) {\n    stubbing.verifyMessageEvent(expectedCount, pattern);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/junit/Stubbing.java",
    "content": "/*\n * Copyright (C) 2013-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit;\n\nimport com.github.tomakehurst.wiremock.client.CountMatchingStrategy;\nimport com.github.tomakehurst.wiremock.client.MappingBuilder;\nimport com.github.tomakehurst.wiremock.client.MessageStubMappingBuilder;\nimport com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport com.github.tomakehurst.wiremock.verification.NearMiss;\nimport java.time.Duration;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\n\npublic interface Stubbing {\n\n  StubMapping givenThat(MappingBuilder mappingBuilder);\n\n  StubMapping stubFor(MappingBuilder mappingBuilder);\n\n  void editStub(MappingBuilder mappingBuilder);\n\n  void removeStub(MappingBuilder mappingBuilder);\n\n  void removeStub(StubMapping mappingBuilder);\n\n  void removeStub(UUID id);\n\n  List<StubMapping> getStubMappings();\n\n  StubMapping getSingleStubMapping(UUID id);\n\n  List<StubMapping> findStubMappingsByMetadata(StringValuePattern pattern);\n\n  void removeStubMappingsByMetadata(StringValuePattern pattern);\n\n  void verify(RequestPatternBuilder requestPatternBuilder);\n\n  void verify(int count, RequestPatternBuilder requestPatternBuilder);\n\n  void verify(\n      CountMatchingStrategy countMatchingStrategy, RequestPatternBuilder requestPatternBuilder);\n\n  List<LoggedRequest> findAll(RequestPatternBuilder requestPatternBuilder);\n\n  List<ServeEvent> getAllServeEvents();\n\n  void setGlobalFixedDelay(int milliseconds);\n\n  List<LoggedRequest> findAllUnmatchedRequests();\n\n  List<NearMiss> findNearMissesForAllUnmatchedRequests();\n\n  List<NearMiss> findNearMissesFor(LoggedRequest loggedRequest);\n\n  List<NearMiss> findAllNearMissesFor(RequestPatternBuilder requestPatternBuilder);\n\n  // Message stub mapping methods\n\n  /**\n   * Registers a message stub mapping using a builder.\n   *\n   * @param builder the message stub mapping builder\n   * @return the registered MessageStubMapping\n   */\n  MessageStubMapping messageStubFor(MessageStubMappingBuilder builder);\n\n  /**\n   * Registers a message stub mapping directly.\n   *\n   * @param messageStubMapping the message stub mapping to register\n   * @return the registered MessageStubMapping\n   */\n  MessageStubMapping messageStubFor(MessageStubMapping messageStubMapping);\n\n  /**\n   * Removes a message stub mapping.\n   *\n   * @param id the UUID of the message stub mapping to remove\n   */\n  void removeMessageStub(UUID id);\n\n  /**\n   * Gets all registered message stub mappings.\n   *\n   * @return list of all message stub mappings\n   */\n  List<MessageStubMapping> getMessageStubMappingsList();\n\n  /** Removes all message stub mappings. */\n  void resetMessageStubs();\n\n  // Message journal verification methods\n\n  /**\n   * Gets all message serve events from the message journal.\n   *\n   * @return list of all message serve events\n   */\n  List<MessageServeEvent> getAllMessageServeEvents();\n\n  /**\n   * Gets message serve events matching the given pattern.\n   *\n   * @param pattern the pattern to match events against\n   * @return list of matching events\n   */\n  List<MessageServeEvent> findAllMessageEvents(MessagePattern pattern);\n\n  /**\n   * Verifies that at least one message event matches the given pattern.\n   *\n   * @param pattern the pattern to match events against\n   */\n  void verifyMessageEvent(MessagePattern pattern);\n\n  /**\n   * Verifies that exactly the specified number of message events match the given pattern.\n   *\n   * @param expectedCount the expected number of matching events\n   * @param pattern the pattern to match events against\n   */\n  void verifyMessageEvent(int expectedCount, MessagePattern pattern);\n\n  /**\n   * Verifies that the number of message events matching the pattern satisfies the count strategy.\n   *\n   * @param expectedCount the count matching strategy\n   * @param pattern the pattern to match events against\n   */\n  void verifyMessageEvent(CountMatchingStrategy expectedCount, MessagePattern pattern);\n\n  /**\n   * Waits for a message event matching the given pattern to appear in the journal.\n   *\n   * @param pattern the pattern to match events against\n   * @param maxWait the maximum duration to wait\n   * @return the matching event if found within the timeout\n   */\n  Optional<MessageServeEvent> waitForMessageEvent(MessagePattern pattern, Duration maxWait);\n\n  /**\n   * Waits for a specific number of message events matching the given pattern.\n   *\n   * @param pattern the pattern to match events against\n   * @param count the number of events to wait for\n   * @param maxWait the maximum duration to wait\n   * @return list of matching events\n   */\n  List<MessageServeEvent> waitForMessageEvents(MessagePattern pattern, int count, Duration maxWait);\n\n  /** Resets the message journal, removing all events. */\n  void resetMessageJournal();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AbsentPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class AbsentPattern extends StringValuePattern {\n\n  public static final AbsentPattern ABSENT = new AbsentPattern(null);\n\n  public AbsentPattern(@JsonProperty(\"absent\") String expectedValue) {\n    super(expectedValue);\n  }\n\n  @Override\n  public boolean nullSafeIsAbsent() {\n    return true;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    return MatchResult.of(value == null);\n  }\n\n  @Override\n  public String getExpected() {\n    return \"(absent)\";\n  }\n\n  @Override\n  protected boolean isNullValuePermitted() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AbstractDateTimeMatchResult.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport java.time.LocalDateTime;\nimport java.time.ZoneId;\nimport java.time.ZonedDateTime;\nimport java.time.temporal.ChronoUnit;\nimport java.time.temporal.Temporal;\n\npublic abstract class AbstractDateTimeMatchResult extends MatchResult {\n\n  private static final long ONE_YEAR_IN_MILLIS = 365 * 24 * 60 * 60 * 1000L;\n\n  private final boolean isZoned;\n  private final boolean isLocal;\n\n  protected final LocalDateTime localExpected;\n  protected final ZonedDateTime zonedExpected;\n\n  protected final ZonedDateTime zonedActual;\n  protected final LocalDateTime localActual;\n\n  public AbstractDateTimeMatchResult(\n      ZonedDateTime zonedExpected,\n      LocalDateTime localExpected,\n      ZonedDateTime zonedActual,\n      LocalDateTime localActual) {\n    this.zonedExpected = zonedExpected;\n    this.localExpected = localExpected;\n    this.isZoned = zonedExpected != null;\n    this.isLocal = localExpected != null;\n    this.zonedActual = zonedActual;\n    this.localActual = localActual;\n  }\n\n  @Override\n  public boolean isExactMatch() {\n    boolean isMatch = false;\n    if (isZoned && zonedActual != null) {\n      isMatch = matchZonedZoned();\n    } else if (isLocal && localActual != null) {\n      isMatch = matchLocalLocal();\n    } else if (isLocal && zonedActual != null) {\n      isMatch = matchLocalZoned();\n    } else if (isZoned && localActual != null) {\n      isMatch = matchZonedLocal();\n    }\n\n    return isMatch;\n  }\n\n  protected abstract boolean matchZonedZoned();\n\n  protected abstract boolean matchLocalLocal();\n\n  protected abstract boolean matchLocalZoned();\n\n  protected abstract boolean matchZonedLocal();\n\n  @Override\n  public double getDistance() {\n    double distance = 1;\n    if (isZoned && zonedActual != null) {\n      distance = calculateDistance(zonedExpected, zonedActual);\n    } else if (isLocal && localActual != null) {\n      distance = calculateDistance(localExpected, localActual);\n    } else if (isLocal && zonedActual != null) {\n      distance = calculateDistance(localExpected, zonedActual.toLocalDateTime());\n    } else if (isZoned && localActual != null) {\n      distance = calculateDistance(zonedExpected, localActual.atZone(ZoneId.systemDefault()));\n    }\n\n    return distance;\n  }\n\n  private double calculateDistance(Temporal start, Temporal end) {\n    long absoluteTimeDifference = Math.abs((ChronoUnit.MILLIS.between(start, end)));\n    return (double) absoluteTimeDifference / (absoluteTimeDifference + 2 * ONE_YEAR_IN_MILLIS);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AbstractDateTimePattern.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.DateTimeParser.ZONED_PARSERS;\nimport static java.util.Collections.singletonList;\n\nimport com.github.tomakehurst.wiremock.common.DateTimeOffset;\nimport com.github.tomakehurst.wiremock.common.DateTimeParser;\nimport com.github.tomakehurst.wiremock.common.DateTimeTruncation;\nimport com.github.tomakehurst.wiremock.common.DateTimeUnit;\nimport java.time.*;\nimport java.time.format.DateTimeParseException;\nimport java.util.List;\n\npublic abstract class AbstractDateTimePattern extends StringValuePattern {\n\n  private final ZonedDateTime zonedDateTime;\n  private final LocalDateTime localDateTime;\n  private String actualDateTimeFormat;\n  private DateTimeParser actualDateTimeParser;\n  private DateTimeOffset expectedOffset;\n  private DateTimeTruncation truncateExpected;\n  private DateTimeTruncation truncateActual;\n  private boolean applyTruncationLast = false;\n\n  protected AbstractDateTimePattern(String dateTimeSpec) {\n    this(dateTimeSpec, null, (DateTimeTruncation) null, null, false, null, null);\n  }\n\n  protected AbstractDateTimePattern(\n      DateTimeOffset offset,\n      String actualDateTimeFormat,\n      DateTimeTruncation truncateExpected,\n      DateTimeTruncation truncateActual) {\n    super(buildExpectedString(offset));\n    this.expectedOffset = offset;\n    localDateTime = null;\n    zonedDateTime = null;\n    this.actualDateTimeFormat = actualDateTimeFormat;\n    this.actualDateTimeParser =\n        actualDateTimeFormat != null ? DateTimeParser.forFormat(actualDateTimeFormat) : null;\n    this.truncateExpected = truncateExpected;\n    this.truncateActual = truncateActual;\n  }\n\n  // Call this from JSON creator constructor in subclasses\n  protected AbstractDateTimePattern(\n      String dateTimeSpec,\n      String actualDateFormat,\n      String truncateExpected,\n      String truncateActual,\n      boolean applyTruncationLast,\n      Integer expectedOffsetAmount,\n      DateTimeUnit expectedOffsetUnit) {\n    this(\n        dateTimeSpec,\n        actualDateFormat,\n        truncateExpected != null ? DateTimeTruncation.fromString(truncateExpected) : null,\n        truncateActual != null ? DateTimeTruncation.fromString(truncateActual) : null,\n        applyTruncationLast,\n        expectedOffsetAmount,\n        expectedOffsetUnit);\n  }\n\n  protected AbstractDateTimePattern(\n      String dateTimeSpec,\n      String actualDateFormat,\n      DateTimeTruncation truncateExpected,\n      DateTimeTruncation truncateActual,\n      boolean applyTruncationLast,\n      Integer expectedOffsetAmount,\n      DateTimeUnit expectedOffsetUnit) {\n    super(dateTimeSpec);\n\n    if (isNowOffsetExpression(dateTimeSpec)) {\n      zonedDateTime = null;\n      localDateTime = null;\n      expectedOffset =\n          expectedOffsetAmount != null && expectedOffsetUnit != null\n              ? new DateTimeOffset(expectedOffsetAmount, expectedOffsetUnit)\n              : DateTimeOffset.fromString(dateTimeSpec);\n    } else {\n      zonedDateTime = parseZonedOrNull(dateTimeSpec);\n      localDateTime = parseLocalOrNull(dateTimeSpec);\n      expectedOffset = null;\n    }\n\n    this.actualDateTimeFormat = actualDateFormat;\n    this.actualDateTimeParser =\n        actualDateTimeFormat != null ? DateTimeParser.forFormat(actualDateTimeFormat) : null;\n\n    this.truncateExpected = truncateExpected;\n    this.truncateActual = truncateActual;\n    this.applyTruncationLast = applyTruncationLast;\n  }\n\n  public AbstractDateTimePattern(ZonedDateTime zonedDateTime) {\n    this(zonedDateTime.toString(), zonedDateTime, null, null, null, null, null);\n  }\n\n  public AbstractDateTimePattern(LocalDateTime localDateTime) {\n    this(localDateTime.toString(), null, localDateTime, null, null, null, null);\n  }\n\n  private AbstractDateTimePattern(\n      String dateTimeSpec,\n      ZonedDateTime zonedDateTime,\n      LocalDateTime localDateTime,\n      DateTimeOffset expectedOffset,\n      String actualDatetimeFormat,\n      DateTimeTruncation truncateExpected,\n      DateTimeTruncation truncateActual) {\n    super(dateTimeSpec);\n    this.zonedDateTime = zonedDateTime;\n    this.localDateTime = localDateTime;\n    this.expectedOffset = expectedOffset;\n    this.actualDateTimeFormat = actualDatetimeFormat;\n    this.actualDateTimeParser =\n        actualDateTimeFormat != null ? DateTimeParser.forFormat(actualDateTimeFormat) : null;\n    this.truncateExpected = truncateExpected;\n    this.truncateActual = truncateActual;\n  }\n\n  @Override\n  public String getValue() {\n    if (expectedValue.equals(\"now\") && expectedOffset != null) {\n      return buildExpectedString(expectedOffset);\n    }\n\n    return expectedValue;\n  }\n\n  private static String buildExpectedString(DateTimeOffset dateTimeOffset) {\n    return dateTimeOffset.getAmount() >= 0 ? \"now +\" + dateTimeOffset : \"now \" + dateTimeOffset;\n  }\n\n  private static boolean isNowOffsetExpression(String dateTimeSpec) {\n    return dateTimeSpec.equalsIgnoreCase(\"now\")\n        || dateTimeSpec.replaceAll(\"(?i)now \", \"\").matches(\"^[\\\\-+]?[0-9]+ [a-zA-Z]+$\");\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T extends AbstractDateTimePattern> T actualFormat(String format) {\n    this.actualDateTimeFormat = format;\n    this.actualDateTimeParser = DateTimeParser.forFormat(format);\n    return (T) this;\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T extends AbstractDateTimePattern> T expectedOffset(int amount, DateTimeUnit unit) {\n    this.expectedOffset = new DateTimeOffset(amount, unit);\n    return (T) this;\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T extends AbstractDateTimePattern> T expectedOffset(DateTimeOffset offset) {\n    this.expectedOffset = offset;\n    return (T) this;\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T extends AbstractDateTimePattern> T truncateExpected(DateTimeTruncation truncation) {\n    this.truncateExpected = truncation;\n    return (T) this;\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T extends AbstractDateTimePattern> T truncateActual(DateTimeTruncation truncation) {\n    this.truncateActual = truncation;\n    return (T) this;\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T extends AbstractDateTimePattern> T applyTruncationLast(boolean applyTruncationLast) {\n    this.applyTruncationLast = applyTruncationLast;\n    return (T) this;\n  }\n\n  public String getActualFormat() {\n    return actualDateTimeFormat;\n  }\n\n  public String getTruncateExpected() {\n    return stringOrNull(truncateExpected);\n  }\n\n  public String getTruncateActual() {\n    return stringOrNull(truncateActual);\n  }\n\n  public Boolean getApplyTruncationLast() {\n    return applyTruncationLast ? true : null;\n  }\n\n  private static String stringOrNull(Object obj) {\n    return obj != null ? obj.toString() : null;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    final ZonedDateTime zonedActual =\n        truncateActual != null\n            ? truncateActual.truncate(parseZonedOrNull(value, actualDateTimeParser))\n            : parseZonedOrNull(value, actualDateTimeParser);\n\n    final LocalDateTime localActual = parseLocalOrNull(value, actualDateTimeParser);\n\n    final ZonedDateTime zonedExpectedDateTime =\n        isNowOffset() ? calculateExpectedFromNow() : zonedDateTime;\n\n    return getMatchResult(zonedExpectedDateTime, localDateTime, zonedActual, localActual);\n  }\n\n  private ZonedDateTime calculateExpectedFromNow() {\n    final ZonedDateTime now = ZonedDateTime.now();\n    if (applyTruncationLast) {\n      final ZonedDateTime shifted = expectedOffset.shift(now);\n      return truncateExpected != null ? truncateExpected.truncate(shifted) : shifted;\n    } else {\n      final ZonedDateTime truncated =\n          truncateExpected != null ? truncateExpected.truncate(now) : now;\n      return expectedOffset.shift(truncated);\n    }\n  }\n\n  protected abstract MatchResult getMatchResult(\n      ZonedDateTime zonedExpected,\n      LocalDateTime localExpected,\n      ZonedDateTime zonedActual,\n      LocalDateTime localActual);\n\n  private boolean isNowOffset() {\n    return expectedOffset != null;\n  }\n\n  private static ZonedDateTime parseZonedOrNull(String dateTimeString) {\n    return parseZonedOrNull(dateTimeString, (DateTimeParser) null);\n  }\n\n  private static ZonedDateTime parseZonedOrNull(String dateTimeString, DateTimeParser parser) {\n    final List<DateTimeParser> parsers = parser != null ? singletonList(parser) : ZONED_PARSERS;\n    return parseZonedOrNull(dateTimeString, parsers);\n  }\n\n  private static ZonedDateTime parseZonedOrNull(\n      String dateTimeString, List<DateTimeParser> parsers) {\n    if (parsers.isEmpty() || dateTimeString == null) {\n      return null;\n    }\n\n    try {\n      return parsers.get(0).parseZonedDateTime(dateTimeString);\n    } catch (DateTimeParseException e) {\n      return parseZonedOrNull(dateTimeString, parsers.subList(1, parsers.size()));\n    }\n  }\n\n  private static LocalDateTime parseLocalOrNull(String dateTimeString) {\n    return parseLocalOrNull(dateTimeString, null);\n  }\n\n  private static LocalDateTime parseLocalOrNull(String dateTimeString, DateTimeParser parser) {\n    if (dateTimeString == null) {\n      return null;\n    }\n\n    try {\n      return parser != null\n          ? parser.parseLocalDateTime(dateTimeString)\n          : LocalDateTime.parse(dateTimeString);\n    } catch (DateTimeParseException ignored) {\n      try {\n        return (parser != null\n                ? parser.parseLocalDate(dateTimeString)\n                : LocalDate.parse(dateTimeString))\n            .atStartOfDay();\n      } catch (DateTimeParseException ignored2) {\n        try {\n          return (parser != null\n                  ? parser.parseYearMonth(dateTimeString)\n                  : YearMonth.parse(dateTimeString))\n              .atDay(1)\n              .atStartOfDay();\n        } catch (DateTimeParseException ignored3) {\n          try {\n            return (parser != null ? parser.parseYear(dateTimeString) : Year.parse(dateTimeString))\n                .atDay(1)\n                .atStartOfDay();\n          } catch (DateTimeParseException ignored4) {\n            return null;\n          }\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AbstractLogicalMatcher.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static java.util.Arrays.asList;\n\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic abstract class AbstractLogicalMatcher extends StringValuePattern {\n\n  protected final List<StringValuePattern> operands;\n\n  public AbstractLogicalMatcher(StringValuePattern... operands) {\n    this(asList(operands));\n  }\n\n  public AbstractLogicalMatcher(List<StringValuePattern> operands) {\n    super(checkAtLeast2OperandsAndReturnFirstExpected(operands));\n    this.operands = operands;\n  }\n\n  private static String checkAtLeast2OperandsAndReturnFirstExpected(\n      List<StringValuePattern> operands) {\n    if (operands.size() < 2) {\n      throw new IllegalArgumentException(\"Must be constructed with at least two matchers\");\n    }\n\n    return operands.stream()\n        .findFirst()\n        .map(ContentPattern::getExpected)\n        .orElseThrow(() -> new IllegalArgumentException(\"Matchers must have expected values\"));\n  }\n\n  @Override\n  public String getExpected() {\n    return operands.stream()\n        .map(contentPattern -> contentPattern.getName() + \" \" + contentPattern.getExpected())\n        .collect(Collectors.joining(\" \" + getOperationName() + \" \"));\n  }\n\n  protected abstract String getOperationName();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AbstractNumberMatchResult.java",
    "content": "/*\n * Copyright (C) 2021-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static java.lang.Math.min;\nimport static java.lang.Math.round;\n\npublic abstract class AbstractNumberMatchResult extends MatchResult {\n\n  protected static final float EXACT_MATCH = 0.0f;\n  protected static final float NO_MATCH = 1.0f;\n  private static final double MAX_LOG_DIFF = 176.0;\n  private final Double expectedValue;\n  private final String value;\n\n  public AbstractNumberMatchResult(Number expectedValue, String value) {\n    this.expectedValue = expectedValue.doubleValue();\n    this.value = value;\n  }\n\n  private static double getShiftValue(double expectedDouble, double actualDouble) {\n    if (expectedDouble < 0.0 || actualDouble < 0.0) {\n      return min(expectedDouble, actualDouble);\n    } else {\n      return EXACT_MATCH;\n    }\n  }\n\n  private static boolean areValuesTooBig(double expectedDouble, double actualDouble) {\n    return expectedDouble == Double.POSITIVE_INFINITY\n        || actualDouble == Double.POSITIVE_INFINITY\n        || (expectedDouble == Double.MAX_VALUE && actualDouble == Double.MAX_VALUE);\n  }\n\n  private static double calculateDistance(double expectedDouble, double actualDouble) {\n    double logA = Math.log(expectedDouble);\n    double logB = Math.log(actualDouble);\n    double logDiff = Math.abs(logA - logB);\n    double normalized = logDiff / MAX_LOG_DIFF;\n\n    return round(min(normalized, 1.0) * 100) / 100.0;\n  }\n\n  protected abstract boolean isExactMatch(double expected, double actual);\n\n  @Override\n  public boolean isExactMatch() {\n    try {\n      var actualDouble = Double.parseDouble(value);\n\n      return isExactMatch(expectedValue, actualDouble);\n    } catch (NumberFormatException | NullPointerException e) {\n      return false;\n    }\n  }\n\n  @Override\n  public double getDistance() {\n    try {\n      var parsedActual = Double.parseDouble(value);\n      if (isExactMatch(expectedValue, parsedActual)) {\n        return EXACT_MATCH;\n      }\n      var shiftValue = getShiftValue(expectedValue, parsedActual);\n      var expectedDouble = expectedValue + shiftValue;\n      var actualDouble = parsedActual + shiftValue;\n\n      if (areValuesTooBig(expectedDouble, actualDouble)) {\n        return NO_MATCH;\n      }\n      double actualDistance = calculateDistance(expectedDouble, actualDouble);\n      if (actualDistance == EXACT_MATCH) {\n        return 0.01;\n      } else {\n        return actualDistance;\n      }\n    } catch (NumberFormatException | NullPointerException e) {\n      return 1.0;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AbstractNumberPattern.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\npublic abstract class AbstractNumberPattern extends StringValuePattern {\n\n  protected final Number expectedNumber;\n\n  public AbstractNumberPattern(Number expectedNumber) {\n    super(expectedNumber.toString());\n    this.expectedNumber = expectedNumber;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AbstractRegexPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static java.util.regex.Pattern.DOTALL;\n\nimport java.util.regex.Pattern;\n\npublic abstract class AbstractRegexPattern extends StringValuePattern {\n\n  protected final Pattern pattern;\n\n  protected AbstractRegexPattern(String regex) {\n    super(regex);\n    pattern = Pattern.compile(regex, DOTALL);\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    return MatchResult.of(value != null && pattern.matcher(value).matches());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AdvancedPathPattern.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonUnwrapped;\n\npublic class AdvancedPathPattern {\n\n  public final String expression;\n\n  @JsonUnwrapped public final ContentPattern<?> submatcher;\n\n  public AdvancedPathPattern(String expression, ContentPattern<?> submatcher) {\n    this.expression = expression;\n    this.submatcher = submatcher;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AfterDateTimePattern.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.DateTimeUnit;\nimport java.time.LocalDateTime;\nimport java.time.ZoneId;\nimport java.time.ZonedDateTime;\n\npublic class AfterDateTimePattern extends AbstractDateTimePattern {\n\n  public AfterDateTimePattern(ZonedDateTime zonedDateTime) {\n    super(zonedDateTime);\n  }\n\n  public AfterDateTimePattern(LocalDateTime localDateTime) {\n    super(localDateTime);\n  }\n\n  public AfterDateTimePattern(String dateTimeSpec) {\n    super(dateTimeSpec);\n  }\n\n  public AfterDateTimePattern(\n      @JsonProperty(\"after\") String dateTimeSpec,\n      @JsonProperty(\"actualFormat\") String actualDateFormat,\n      @JsonProperty(\"truncateExpected\") String truncateExpected,\n      @JsonProperty(\"truncateActual\") String truncateActual,\n      @JsonProperty(\"applyTruncationLast\") boolean applyTruncationLast,\n      @JsonProperty(\"expectedOffset\") Integer expectedOffsetAmount,\n      @JsonProperty(\"expectedOffsetUnit\") DateTimeUnit expectedOffsetUnit) {\n    super(\n        dateTimeSpec,\n        actualDateFormat,\n        truncateExpected,\n        truncateActual,\n        applyTruncationLast,\n        expectedOffsetAmount,\n        expectedOffsetUnit);\n  }\n\n  @Override\n  protected MatchResult getMatchResult(\n      ZonedDateTime zonedExpected,\n      LocalDateTime localExpected,\n      ZonedDateTime zonedActual,\n      LocalDateTime localActual) {\n\n    return new AbstractDateTimeMatchResult(zonedExpected, localExpected, zonedActual, localActual) {\n      @Override\n      protected boolean matchZonedZoned() {\n        return zonedActual.isAfter(zonedExpected);\n      }\n\n      @Override\n      protected boolean matchLocalLocal() {\n        return localActual.isAfter(localExpected);\n      }\n\n      @Override\n      protected boolean matchLocalZoned() {\n        return zonedActual.toLocalDateTime().isAfter(localExpected);\n      }\n\n      @Override\n      protected boolean matchZonedLocal() {\n        return localActual.atZone(ZoneId.systemDefault()).isAfter(zonedExpected);\n      }\n    };\n  }\n\n  public String getAfter() {\n    return getValue();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/AnythingPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class AnythingPattern extends StringValuePattern {\n\n  public AnythingPattern(@JsonProperty(\"anything\") String expectedValue) {\n    super(expectedValue);\n  }\n\n  public AnythingPattern() {\n    this(\"(always)\");\n  }\n\n  public String getAnything() {\n    return \"anything\";\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    return MatchResult.exactMatch();\n  }\n\n  @Override\n  public String toString() {\n    return \"anything\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/BeforeDateTimePattern.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.DateTimeUnit;\nimport java.time.LocalDateTime;\nimport java.time.ZoneId;\nimport java.time.ZonedDateTime;\n\npublic class BeforeDateTimePattern extends AbstractDateTimePattern {\n\n  public BeforeDateTimePattern(ZonedDateTime zonedDateTime) {\n    super(zonedDateTime);\n  }\n\n  public BeforeDateTimePattern(LocalDateTime localDateTime) {\n    super(localDateTime);\n  }\n\n  public BeforeDateTimePattern(String dateTimeSpec) {\n    super(dateTimeSpec);\n  }\n\n  public BeforeDateTimePattern(\n      @JsonProperty(\"before\") String dateTimeSpec,\n      @JsonProperty(\"actualFormat\") String actualDateFormat,\n      @JsonProperty(\"truncateExpected\") String truncateExpected,\n      @JsonProperty(\"truncateActual\") String truncateActual,\n      @JsonProperty(\"applyTruncationLast\") boolean applyTruncationLast,\n      @JsonProperty(\"expectedOffset\") Integer expectedOffsetAmount,\n      @JsonProperty(\"expectedOffsetUnit\") DateTimeUnit expectedOffsetUnit) {\n    super(\n        dateTimeSpec,\n        actualDateFormat,\n        truncateExpected,\n        truncateActual,\n        applyTruncationLast,\n        expectedOffsetAmount,\n        expectedOffsetUnit);\n  }\n\n  @Override\n  protected MatchResult getMatchResult(\n      ZonedDateTime zonedExpected,\n      LocalDateTime localExpected,\n      ZonedDateTime zonedActual,\n      LocalDateTime localActual) {\n\n    return new AbstractDateTimeMatchResult(zonedExpected, localExpected, zonedActual, localActual) {\n      @Override\n      protected boolean matchZonedZoned() {\n        return zonedActual.isBefore(zonedExpected);\n      }\n\n      @Override\n      protected boolean matchLocalLocal() {\n        return localActual.isBefore(localExpected);\n      }\n\n      @Override\n      protected boolean matchLocalZoned() {\n        return zonedActual.toLocalDateTime().isBefore(localExpected);\n      }\n\n      @Override\n      protected boolean matchZonedLocal() {\n        return localActual.atZone(ZoneId.systemDefault()).isBefore(zonedExpected);\n      }\n    };\n  }\n\n  public String getBefore() {\n    return getValue();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/BinaryEqualToPattern.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.Arrays;\nimport java.util.Base64;\nimport java.util.Objects;\n\npublic class BinaryEqualToPattern extends ContentPattern<byte[]> {\n\n  public BinaryEqualToPattern(byte[] expected) {\n    super(expected);\n  }\n\n  @JsonCreator\n  public BinaryEqualToPattern(@JsonProperty(\"binaryEqualTo\") String expected) {\n    this(Base64.getDecoder().decode(expected));\n  }\n\n  @Override\n  public MatchResult match(byte[] actual) {\n    return MatchResult.of(Arrays.equals(actual, expectedValue));\n  }\n\n  @Override\n  @JsonIgnore\n  public String getName() {\n    return \"binaryEqualTo\";\n  }\n\n  @Override\n  @JsonIgnore\n  public String getExpected() {\n    return Base64.getEncoder().encodeToString(expectedValue);\n  }\n\n  public String getBinaryEqualTo() {\n    return getExpected();\n  }\n\n  @Override\n  public String toString() {\n    return getName() + \" \" + getExpected();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    BinaryEqualToPattern that = (BinaryEqualToPattern) o;\n\n    return Objects.equals(getExpected(), that.getExpected());\n  }\n\n  @Override\n  public int hashCode() {\n    return getExpected() != null ? getExpected().hashCode() : 0;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/ContainsPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class ContainsPattern extends StringValuePattern {\n\n  public ContainsPattern(@JsonProperty(\"contains\") String expectedValue) {\n    super(expectedValue);\n  }\n\n  public String getContains() {\n    return expectedValue;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    return MatchResult.of(value != null && value.contains(expectedValue));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/ContentPattern.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.checkNotNull;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport java.util.Objects;\n\n@JsonDeserialize(using = ContentPatternDeserialiser.class)\npublic abstract class ContentPattern<T> implements NamedValueMatcher<T> {\n\n  protected final T expectedValue;\n\n  public ContentPattern(T expectedValue) {\n    if (!isNullValuePermitted()) {\n      checkNotNull(expectedValue, \"'\" + getName() + \"' expected value cannot be null\");\n    }\n    this.expectedValue = expectedValue;\n  }\n\n  @JsonIgnore\n  public T getValue() {\n    return expectedValue;\n  }\n\n  protected boolean isNullValuePermitted() {\n    return false;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    ContentPattern<?> that = (ContentPattern<?>) o;\n\n    return Objects.equals(expectedValue, that.expectedValue);\n  }\n\n  @Override\n  public int hashCode() {\n    return expectedValue != null ? expectedValue.hashCode() : 0;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/ContentPatternDeserialiser.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport java.io.IOException;\n\npublic class ContentPatternDeserialiser extends JsonDeserializer<ContentPattern<?>> {\n\n  @Override\n  public ContentPattern<?> deserialize(JsonParser parser, DeserializationContext context)\n      throws IOException, JsonProcessingException {\n    JsonNode rootNode = parser.readValueAsTree();\n\n    if (rootNode.has(\"binaryEqualTo\")) {\n      return deserializeBinaryEqualTo(rootNode);\n    }\n\n    return new StringValuePatternJsonDeserializer().buildStringValuePattern(rootNode);\n  }\n\n  private BinaryEqualToPattern deserializeBinaryEqualTo(JsonNode rootNode) {\n    String operand = rootNode.findValue(\"binaryEqualTo\").textValue();\n\n    return new BinaryEqualToPattern(operand);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/CustomMatcherDefinition.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport java.util.Objects;\n\npublic class CustomMatcherDefinition {\n\n  private final String name;\n  private final Parameters parameters;\n\n  public CustomMatcherDefinition(\n      @JsonProperty(\"name\") String name, @JsonProperty(\"parameters\") Parameters parameters) {\n    this.name = name;\n    this.parameters = parameters;\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  public Parameters getParameters() {\n    return parameters;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    CustomMatcherDefinition that = (CustomMatcherDefinition) o;\n    return Objects.equals(name, that.name) && Objects.equals(parameters, that.parameters);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(name, parameters);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/EagerMatchResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport java.util.List;\n\npublic class EagerMatchResult extends MatchResult {\n\n  private final double distance;\n\n  EagerMatchResult(double distance) {\n    this(distance, List.of());\n  }\n\n  EagerMatchResult(double distance, List<SubEvent> subEvents) {\n    this(distance, subEvents, List.of());\n  }\n\n  public EagerMatchResult(\n      double distance, List<SubEvent> subEvents, List<DiffDescription> diffDescriptions) {\n    super(subEvents, diffDescriptions);\n    this.distance = distance;\n  }\n\n  public double getDistance() {\n    return distance;\n  }\n\n  public boolean isExactMatch() {\n    return distance == 0;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/EqualToDateTimePattern.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.DateTimeUnit;\nimport java.time.LocalDateTime;\nimport java.time.ZoneId;\nimport java.time.ZonedDateTime;\n\npublic class EqualToDateTimePattern extends AbstractDateTimePattern {\n\n  public EqualToDateTimePattern(ZonedDateTime zonedDateTime) {\n    super(zonedDateTime);\n  }\n\n  public EqualToDateTimePattern(LocalDateTime localDateTime) {\n    super(localDateTime);\n  }\n\n  public EqualToDateTimePattern(String dateTimeSpec) {\n    super(dateTimeSpec);\n  }\n\n  public EqualToDateTimePattern(\n      @JsonProperty(\"equalToDateTime\") String dateTimeSpec,\n      @JsonProperty(\"actualFormat\") String actualDateFormat,\n      @JsonProperty(\"truncateExpected\") String truncateExpected,\n      @JsonProperty(\"truncateActual\") String truncateActual,\n      @JsonProperty(\"applyTruncationLast\") boolean applyTruncationLast,\n      @JsonProperty(\"expectedOffset\") Integer expectedOffsetAmount,\n      @JsonProperty(\"expectedOffsetUnit\") DateTimeUnit expectedOffsetUnit) {\n    super(\n        dateTimeSpec,\n        actualDateFormat,\n        truncateExpected,\n        truncateActual,\n        applyTruncationLast,\n        expectedOffsetAmount,\n        expectedOffsetUnit);\n  }\n\n  @Override\n  protected MatchResult getMatchResult(\n      ZonedDateTime zonedExpected,\n      LocalDateTime localExpected,\n      ZonedDateTime zonedActual,\n      LocalDateTime localActual) {\n\n    return new AbstractDateTimeMatchResult(zonedExpected, localExpected, zonedActual, localActual) {\n      @Override\n      protected boolean matchZonedZoned() {\n        return zonedActual.isEqual(zonedExpected);\n      }\n\n      @Override\n      protected boolean matchLocalLocal() {\n        return localActual.isEqual(localExpected);\n      }\n\n      @Override\n      protected boolean matchLocalZoned() {\n        return zonedActual.toLocalDateTime().isEqual(localExpected);\n      }\n\n      @Override\n      protected boolean matchZonedLocal() {\n        return localActual.atZone(ZoneId.systemDefault()).isEqual(zonedExpected);\n      }\n    };\n  }\n\n  public String getEqualToDateTime() {\n    return getValue();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/EqualToJsonPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.stubbing.SubEvent.JSON_ERROR;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport net.javacrumbs.jsonunit.core.Configuration;\nimport net.javacrumbs.jsonunit.core.Option;\nimport net.javacrumbs.jsonunit.core.internal.Diff;\nimport net.javacrumbs.jsonunit.core.listener.Difference;\nimport net.javacrumbs.jsonunit.core.listener.DifferenceContext;\nimport net.javacrumbs.jsonunit.core.listener.DifferenceListener;\n\npublic class EqualToJsonPattern extends StringValuePattern {\n\n  private final JsonNode expected;\n  private final Boolean ignoreArrayOrder;\n  private final Boolean ignoreExtraElements;\n  private final Boolean serializeAsString;\n\n  public EqualToJsonPattern(\n      @JsonProperty(\"equalToJson\") String json,\n      @JsonProperty(\"ignoreArrayOrder\") Boolean ignoreArrayOrder,\n      @JsonProperty(\"ignoreExtraElements\") Boolean ignoreExtraElements) {\n    super(json);\n    expected = Json.read(json, JsonNode.class);\n    this.ignoreArrayOrder = ignoreArrayOrder;\n    this.ignoreExtraElements = ignoreExtraElements;\n    this.serializeAsString = true;\n  }\n\n  public EqualToJsonPattern(\n      JsonNode jsonNode, Boolean ignoreArrayOrder, Boolean ignoreExtraElements) {\n    super(Json.write(jsonNode));\n    expected = jsonNode;\n    this.ignoreArrayOrder = ignoreArrayOrder;\n    this.ignoreExtraElements = ignoreExtraElements;\n    this.serializeAsString = false;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    final CountingDiffListener diffListener = new CountingDiffListener();\n    Configuration diffConfig =\n        Configuration.empty()\n            .withDifferenceListener(diffListener)\n            .withNumberComparator(new NormalisedNumberComparator());\n\n    if (shouldIgnoreArrayOrder()) {\n      diffConfig = diffConfig.withOptions(Option.IGNORING_ARRAY_ORDER);\n    }\n\n    if (shouldIgnoreExtraElements()) {\n      diffConfig =\n          diffConfig.withOptions(Option.IGNORING_EXTRA_ARRAY_ITEMS, Option.IGNORING_EXTRA_FIELDS);\n    }\n\n    final JsonNode actual;\n    final Diff diff;\n    try {\n      actual = Json.read(value, JsonNode.class);\n      diff =\n          Diff.create(\n              expected, // JsonUnit knows how to work with JsonNode\n              actual,\n              \"\",\n              \"\",\n              diffConfig);\n    } catch (JsonException je) {\n      return MatchResult.noMatch(new SubEvent(JSON_ERROR, je.getErrors()));\n    } catch (Exception e) {\n      return MatchResult.noMatch(SubEvent.warning(e.getMessage()));\n    }\n\n    return new MatchResult() {\n      @Override\n      public boolean isExactMatch() {\n        return diff.similar();\n      }\n\n      @Override\n      public double getDistance() {\n        diff.similar();\n        double maxNodes = maxDeepSize(expected, actual);\n        return diffListener.count / maxNodes;\n      }\n    };\n  }\n\n  @JsonProperty(\"equalToJson\")\n  public Object getSerializedEqualToJson() {\n    return serializeAsString ? getValue() : Json.read(getValue(), JsonNode.class);\n  }\n\n  public String getEqualToJson() {\n    return expectedValue;\n  }\n\n  private boolean shouldIgnoreArrayOrder() {\n    return ignoreArrayOrder != null && ignoreArrayOrder;\n  }\n\n  public Boolean isIgnoreArrayOrder() {\n    return ignoreArrayOrder;\n  }\n\n  private boolean shouldIgnoreExtraElements() {\n    return ignoreExtraElements != null && ignoreExtraElements;\n  }\n\n  public Boolean isIgnoreExtraElements() {\n    return ignoreExtraElements;\n  }\n\n  @Override\n  public String getExpected() {\n    return Json.prettyPrint(getValue());\n  }\n\n  private static class CountingDiffListener implements DifferenceListener {\n\n    public int count = 0;\n\n    @Override\n    public void diff(Difference difference, DifferenceContext context) {\n      final int delta = maxDeepSize(difference.getExpected(), difference.getActual());\n      count += delta == 0 ? 1 : Math.abs(delta);\n    }\n  }\n\n  public static int maxDeepSize(Object one, Object two) {\n    return Math.max(one != null ? deepSize(one) : 0, two != null ? deepSize(two) : 0);\n  }\n\n  private static int deepSize(Object nodeObj) {\n    JsonNode jsonNode = Json.getObjectMapper().convertValue(nodeObj, JsonNode.class);\n    return Json.deepSize(jsonNode);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/EqualToNumberPattern.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class EqualToNumberPattern extends AbstractNumberPattern {\n\n  public EqualToNumberPattern(@JsonProperty(\"equalToNumber\") Number testValue) {\n    super(testValue);\n  }\n\n  public Number getEqualToNumber() {\n    return expectedNumber;\n  }\n\n  @Override\n  public MatchResult match(final String value) {\n    return new AbstractNumberMatchResult(expectedNumber, value) {\n      @Override\n      protected boolean isExactMatch(double expected, double actual) {\n        return expected == actual;\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/EqualToPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.Strings.normalisedLevenshteinDistance;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.Objects;\n\npublic class EqualToPattern extends StringValuePattern {\n\n  private final Boolean caseInsensitive;\n\n  public EqualToPattern(\n      @JsonProperty(\"equalTo\") String testValue,\n      @JsonProperty(\"caseInsensitive\") Boolean caseInsensitive) {\n    super(testValue);\n    this.caseInsensitive = caseInsensitive;\n  }\n\n  public EqualToPattern(String expectedValue) {\n    this(expectedValue, null);\n  }\n\n  public String getEqualTo() {\n    return expectedValue;\n  }\n\n  public Boolean getCaseInsensitive() {\n    return caseInsensitive;\n  }\n\n  @Override\n  public MatchResult match(final String value) {\n    return new MatchResult() {\n      @Override\n      public boolean isExactMatch() {\n        return shouldMatchCaseInsensitive()\n            ? value != null && value.equalsIgnoreCase(expectedValue)\n            : Objects.equals(expectedValue, value);\n      }\n\n      @Override\n      public double getDistance() {\n        return normalisedLevenshteinDistance(expectedValue, value);\n      }\n    };\n  }\n\n  private boolean shouldMatchCaseInsensitive() {\n    return caseInsensitive != null && caseInsensitive;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/EqualToPatternWithCaseInsensitivePrefix.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.Strings.normalisedLevenshteinDistance;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.Objects;\n\npublic class EqualToPatternWithCaseInsensitivePrefix extends StringValuePattern {\n\n  private final String prefix;\n  private final String testValue;\n\n  public EqualToPatternWithCaseInsensitivePrefix(\n      @JsonProperty(\"prefix\") String prefix, @JsonProperty(\"equalTo\") String testValue) {\n    super(prefix + testValue);\n    Objects.requireNonNull(prefix, \"prefix cannot be null\");\n    this.prefix = prefix;\n    this.testValue = testValue;\n  }\n\n  @Override\n  public MatchResult match(final String value) {\n    return new MatchResult() {\n      @Override\n      public boolean isExactMatch() {\n        return value != null\n            && value.substring(0, prefix.length()).equalsIgnoreCase(prefix)\n            && Objects.equals(testValue, value.substring(prefix.length()));\n      }\n\n      @Override\n      public double getDistance() {\n        return normalisedLevenshteinDistance(expectedValue, value);\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/EqualToXmlPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static com.github.tomakehurst.wiremock.common.Strings.isNullOrEmpty;\nimport static org.xmlunit.diff.ComparisonType.*;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.xml.Xml;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport java.util.*;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport java.util.stream.*;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\nimport org.w3c.dom.DOMException;\nimport org.w3c.dom.Document;\nimport org.w3c.dom.Node;\nimport org.xmlunit.XMLUnitException;\nimport org.xmlunit.builder.DiffBuilder;\nimport org.xmlunit.builder.Input;\nimport org.xmlunit.diff.*;\nimport org.xmlunit.placeholder.PlaceholderDifferenceEvaluator;\n\npublic class EqualToXmlPattern extends StringValuePattern {\n\n  private static final Set<ComparisonType> COUNTED_COMPARISONS =\n      Set.of(\n          ELEMENT_TAG_NAME,\n          SCHEMA_LOCATION,\n          NO_NAMESPACE_SCHEMA_LOCATION,\n          NODE_TYPE,\n          NAMESPACE_URI,\n          TEXT_VALUE,\n          PROCESSING_INSTRUCTION_TARGET,\n          PROCESSING_INSTRUCTION_DATA,\n          ELEMENT_NUM_ATTRIBUTES,\n          ATTR_VALUE,\n          CHILD_NODELIST_LENGTH,\n          CHILD_LOOKUP,\n          ATTR_NAME_LOOKUP);\n\n  private final DocumentBuilderFactory documentBuilderFactory;\n\n  private final Boolean enablePlaceholders;\n  private final String placeholderOpeningDelimiterRegex;\n  private final String placeholderClosingDelimiterRegex;\n  private final DifferenceEvaluator diffEvaluator;\n  private final Set<ComparisonType> exemptedComparisons;\n  private final Boolean ignoreOrderOfSameNode;\n  private final NamespaceAwareness namespaceAwareness;\n  private final Set<ComparisonType> countedComparisons;\n  private final Document expectedXmlDoc;\n\n  public EqualToXmlPattern(@JsonProperty(\"equalToXml\") String expectedValue) {\n    this(expectedValue, null, null, null, null, null, null);\n  }\n\n  public EqualToXmlPattern(\n      @JsonProperty(\"equalToXml\") String expectedValue,\n      @JsonProperty(\"enablePlaceholders\") Boolean enablePlaceholders,\n      @JsonProperty(\"ignoreOrderOfSameNode\") boolean ignoreOrderOfSameNode) {\n    this(expectedValue, enablePlaceholders, null, null, null, ignoreOrderOfSameNode, null);\n  }\n\n  @JsonCreator\n  public EqualToXmlPattern(\n      @JsonProperty(\"equalToXml\") String expectedValue,\n      @JsonProperty(\"enablePlaceholders\") Boolean enablePlaceholders,\n      @JsonProperty(\"placeholderOpeningDelimiterRegex\") String placeholderOpeningDelimiterRegex,\n      @JsonProperty(\"placeholderClosingDelimiterRegex\") String placeholderClosingDelimiterRegex,\n      @JsonProperty(\"exemptedComparisons\") Set<ComparisonType> exemptedComparisons,\n      @JsonProperty(\"ignoreOrderOfSameNode\") Boolean ignoreOrderOfSameNode,\n      @JsonProperty(\"namespaceAwareness\") NamespaceAwareness namespaceAwareness) {\n\n    super(expectedValue);\n    documentBuilderFactory = getDocumentBuilderFactory(namespaceAwareness);\n    // Throw an exception if we can't parse the document\n    expectedXmlDoc = Xml.read(expectedValue, documentBuilderFactory);\n    this.enablePlaceholders = enablePlaceholders;\n    this.placeholderOpeningDelimiterRegex = placeholderOpeningDelimiterRegex;\n    this.placeholderClosingDelimiterRegex = placeholderClosingDelimiterRegex;\n    this.exemptedComparisons = exemptedComparisons;\n    this.ignoreOrderOfSameNode = ignoreOrderOfSameNode;\n    this.namespaceAwareness = namespaceAwareness;\n    Set<ComparisonType> comparisonsToExempt = new HashSet<>();\n    if (exemptedComparisons != null) {\n      comparisonsToExempt.addAll(exemptedComparisons);\n    }\n    this.countedComparisons =\n        COUNTED_COMPARISONS.stream()\n            .filter(e -> !comparisonsToExempt.contains(e))\n            .collect(Collectors.toSet());\n\n    IgnoreUncountedDifferenceEvaluator baseDifferenceEvaluator =\n        new IgnoreUncountedDifferenceEvaluator(comparisonsToExempt);\n    if (enablePlaceholders != null && enablePlaceholders) {\n      diffEvaluator =\n          DifferenceEvaluators.chain(\n              baseDifferenceEvaluator,\n              new PlaceholderDifferenceEvaluator(\n                  placeholderOpeningDelimiterRegex, placeholderClosingDelimiterRegex));\n    } else {\n      diffEvaluator = baseDifferenceEvaluator;\n    }\n  }\n\n  public String getEqualToXml() {\n    return expectedValue;\n  }\n\n  @Override\n  public String getExpected() {\n    try {\n      // as of writing, Xml.prettyPrint will throw an exception if the provided XML has unbound\n      // namespace prefixes.\n      return Xml.prettyPrint(getValue());\n    } catch (Exception e) {\n      return getValue();\n    }\n  }\n\n  public Boolean isEnablePlaceholders() {\n    return enablePlaceholders;\n  }\n\n  public Boolean isIgnoreOrderOfSameNode() {\n    return ignoreOrderOfSameNode;\n  }\n\n  public String getPlaceholderOpeningDelimiterRegex() {\n    return placeholderOpeningDelimiterRegex;\n  }\n\n  public String getPlaceholderClosingDelimiterRegex() {\n    return placeholderClosingDelimiterRegex;\n  }\n\n  public Set<ComparisonType> getExemptedComparisons() {\n    return exemptedComparisons;\n  }\n\n  public NamespaceAwareness getNamespaceAwareness() {\n    return namespaceAwareness;\n  }\n\n  @Override\n  public MatchResult match(final String value) {\n    return new MatchResult() {\n      @Override\n      public boolean isExactMatch() {\n        if (isNullOrEmpty(value)) {\n          return false;\n        }\n        try {\n          DiffBuilder diffBuilder =\n              DiffBuilder.compare(Input.from(expectedXmlDoc))\n                  .withTest(value)\n                  .withComparisonController(ComparisonControllers.StopWhenDifferent)\n                  .ignoreWhitespace()\n                  .withDifferenceEvaluator(diffEvaluator)\n                  .withNodeMatcher(new OrderInvariantNodeMatcher(ignoreOrderOfSameNode))\n                  .withDocumentBuilderFactory(documentBuilderFactory);\n          if (namespaceAwareness == NamespaceAwareness.LEGACY) {\n            // See NamespaceAwareness javadoc for details of why this is set here.\n            diffBuilder.ignoreComments();\n          }\n          Diff diff = diffBuilder.build();\n\n          return !diff.hasDifferences();\n        } catch (XMLUnitException | DOMException e) {\n          appendSubEvent(SubEvent.warning(e.getMessage()));\n\n          notifier()\n              .info(\n                  \"Failed to process XML. \"\n                      + e.getMessage()\n                      + \"\\nExpected:\\n\"\n                      + expectedValue\n                      + \"\\n\\nActual:\\n\"\n                      + value);\n          return false;\n        }\n      }\n\n      @Override\n      public double getDistance() {\n        if (isNullOrEmpty(value)) {\n          return 1.0;\n        }\n\n        final AtomicInteger totalComparisons = new AtomicInteger(0);\n        final AtomicInteger differences = new AtomicInteger(0);\n\n        Diff diff;\n        try {\n          DiffBuilder diffBuilder =\n              DiffBuilder.compare(Input.from(expectedValue))\n                  .withTest(value)\n                  .ignoreWhitespace()\n                  .withDifferenceEvaluator(diffEvaluator)\n                  .withComparisonListeners(\n                      (comparison, outcome) -> {\n                        if (countedComparisons.contains(comparison.getType())\n                            && comparison.getControlDetails().getValue() != null) {\n                          totalComparisons.incrementAndGet();\n                          if (outcome == ComparisonResult.DIFFERENT) {\n                            differences.incrementAndGet();\n                          }\n                        }\n                      })\n                  .withDocumentBuilderFactory(documentBuilderFactory);\n          if (namespaceAwareness == NamespaceAwareness.LEGACY) {\n            diffBuilder.ignoreComments();\n          }\n          diff = diffBuilder.build();\n        } catch (XMLUnitException e) {\n          notifier()\n              .info(\n                  \"Failed to process XML. \"\n                      + e.getMessage()\n                      + \"\\nExpected:\\n\"\n                      + expectedValue\n                      + \"\\n\\nActual:\\n\"\n                      + value);\n          return 1.0;\n        }\n\n        notifier()\n            .info(\n                StreamSupport.stream(diff.getDifferences().spliterator(), false)\n                    .map(Object::toString)\n                    .collect(Collectors.joining(\"\\n\")));\n\n        return differences.doubleValue() / totalComparisons.doubleValue();\n      }\n    };\n  }\n\n  private static final DocumentBuilderFactory namespaceAware = newDocumentBuilderFactory(true);\n  private static final DocumentBuilderFactory namespaceUnaware = newDocumentBuilderFactory(false);\n\n  private static DocumentBuilderFactory getDocumentBuilderFactory(\n      NamespaceAwareness namespaceAwareness) {\n    if (namespaceAwareness == null || namespaceAwareness == NamespaceAwareness.STRICT) {\n      return namespaceAware;\n    } else {\n      return namespaceUnaware;\n    }\n  }\n\n  private static DocumentBuilderFactory newDocumentBuilderFactory(boolean namespaceAware) {\n    DocumentBuilderFactory factory = Xml.newDocumentBuilderFactory();\n    try {\n      factory.setFeature(\"http://apache.org/xml/features/include-comments\", false);\n      factory.setFeature(\"http://xml.org/sax/features/namespaces\", namespaceAware);\n    } catch (ParserConfigurationException e) {\n      throwUnchecked(e);\n    }\n    return factory;\n  }\n\n  private static class IgnoreUncountedDifferenceEvaluator implements DifferenceEvaluator {\n\n    private final Set<ComparisonType> finalCountedComparisons;\n\n    public IgnoreUncountedDifferenceEvaluator(Set<ComparisonType> exemptedComparisons) {\n      finalCountedComparisons =\n          exemptedComparisons != null\n              ? COUNTED_COMPARISONS.stream()\n                  .filter(e -> !exemptedComparisons.contains(e))\n                  .collect(Collectors.toSet())\n              : COUNTED_COMPARISONS;\n    }\n\n    @Override\n    public ComparisonResult evaluate(Comparison comparison, ComparisonResult outcome) {\n      if (finalCountedComparisons.contains(comparison.getType())\n          && comparison.getControlDetails().getValue() != null) {\n        return outcome;\n      }\n\n      return ComparisonResult.EQUAL;\n    }\n  }\n\n  public EqualToXmlPattern exemptingComparisons(ComparisonType... comparisons) {\n    return new EqualToXmlPattern(\n        expectedValue,\n        enablePlaceholders,\n        placeholderOpeningDelimiterRegex,\n        placeholderClosingDelimiterRegex,\n        new HashSet<>(Arrays.asList(comparisons)),\n        ignoreOrderOfSameNode,\n        namespaceAwareness);\n  }\n\n  public EqualToXmlPattern withNamespaceAwareness(NamespaceAwareness namespaceAwareness) {\n    return new EqualToXmlPattern(\n        expectedValue,\n        enablePlaceholders,\n        placeholderOpeningDelimiterRegex,\n        placeholderClosingDelimiterRegex,\n        exemptedComparisons,\n        ignoreOrderOfSameNode,\n        namespaceAwareness);\n  }\n\n  private static final class OrderInvariantNodeMatcher extends DefaultNodeMatcher {\n    private static Boolean secondaryOrderByTextContent;\n\n    public OrderInvariantNodeMatcher(Boolean secondaryOrderByTextContent) {\n      OrderInvariantNodeMatcher.secondaryOrderByTextContent = secondaryOrderByTextContent;\n    }\n\n    @Override\n    public Iterable<Map.Entry<Node, Node>> match(\n        Iterable<Node> controlNodes, Iterable<Node> testNodes) {\n\n      return super.match(sort(controlNodes), sort(testNodes));\n    }\n\n    private static Iterable<Node> sort(Iterable<Node> nodes) {\n      return StreamSupport.stream(nodes.spliterator(), false)\n          .sorted(getComparator())\n          .collect(Collectors.toList());\n    }\n\n    private static Comparator<Node> getComparator() {\n      if (Objects.nonNull(secondaryOrderByTextContent) && secondaryOrderByTextContent) {\n        return Comparator.comparing(Node::getLocalName).thenComparing(Node::getTextContent);\n      } else {\n        return Comparator.comparing(Node::getLocalName);\n      }\n    }\n  }\n\n  /**\n   * This enum represents how the pattern will treat XML namespaces when matching.\n   *\n   * <p>{@link NamespaceAwareness#LEGACY} represents the old way that namespaces were treated. This\n   * had a lot of unpredictability and some behaviours were more of a side effect of other\n   * implementation details, rather than intentional. A key detail is that the original {@link\n   * DocumentBuilderFactory} was not namespace aware, but the XSLT transform performed by {@link\n   * DiffBuilder#ignoreComments()} seems to return a document that is semi-namespace aware, so some\n   * namespace aware functionality was available. Now {@link DiffBuilder#ignoreComments()} has been\n   * replaced by setting the {@link DocumentBuilderFactory} to ignore comment on read (much more\n   * performant and predictable), so is only used to produce the legacy namespace aware behaviour.\n   *\n   * <p>{@link NamespaceAwareness#STRICT} and {@link NamespaceAwareness#NONE} represent firmer, more\n   * intentional behaviour around how namespaces are handled. The details of how each option behaves\n   * are documented below:\n   *\n   * <p>{@link NamespaceAwareness#LEGACY} behaviour:\n   *\n   * <ul>\n   *   <li>Namespace prefixes do not need to be bound to a namespace URI.\n   *   <li>Element namespace prefixes (and their corresponding namespace URIs) are ignored (e.g.\n   *       `&lt;th:thing>Match this&lt;/th:thing>` == `&lt;st:thing>Match this&lt;/st:thing>`)\n   *       <ul>\n   *         <li>Element prefixes seem to effectively be totally removed from the document by the\n   *             XSLT transform performed by {@link DiffBuilder#ignoreComments()} (and no namespace\n   *             URI is assigned to the element).\n   *       </ul>\n   *   <li>Attributes are compared by their full name (i.e. namespace prefixes are NOT ignored)\n   *       (e.g. `&lt;thing th:attr=\"abc\">Match this&lt;/thing>` != `&lt;thing st:attr=\"abc\">Match\n   *       this&lt;/thing>`)\n   *       <ul>\n   *         <li>The XSLT transform performed by {@link DiffBuilder#ignoreComments()} does not\n   *             assign a namespace URI to attributes, so XMLUnit uses the attribute's full name.\n   *       </ul>\n   *   <li>xmlns namespaced attributes are ignored (e.g. `&lt;thing\n   *       xmlns:th=\"https://thing.com\">Match this&lt;/thing>` == `&lt;thing\n   *       xmlns:st=\"https://stuff.com\">Match this&lt;/thing>`)\n   *       <ul>\n   *         <li>XMLUnit ignores all attributes namespaced to http://www.w3.org/2000/xmlns/, which\n   *             all xmlns prefixed attributes are assigned to by the XSLT transform performed by\n   *             {@link DiffBuilder#ignoreComments()}.\n   *       </ul>\n   *   <li>Element default namespace attributes (i.e. `xmlns` attributes) are NOT ignored unless\n   *       NAMESPACE_URI comparison type is explicitly excluded (e.g. `&lt;thing\n   *       xmlns=\"https://thing.com\">Match this&lt;/thing>` != `&lt;thing\n   *       xmlns=\"https://stuff.com\">Match this&lt;/thing>`)\n   *       <ul>\n   *         <li>Like xmlns namespaced attributes, XMLUnit ignores all attributes namespaced to\n   *             http://www.w3.org/2000/xmlns/, which all xmlns attributes are assigned to by the\n   *             XSLT transform performed by {@link DiffBuilder#ignoreComments()}.\n   *         <li>The difference between default xmlns attributes and xmlns <i>prefixed</i>\n   *             attributes is that the XSLT transform performed by {@link\n   *             DiffBuilder#ignoreComments()} assigns the namespace URI of default xmlns attributes\n   *             to the attributed element, which is why matching will fail (unless NAMESPACE_URI\n   *             comparison type is explicitly excluded).\n   *       </ul>\n   * </ul>\n   *\n   * <p>{@link NamespaceAwareness#STRICT} behaviour:\n   *\n   * <ul>\n   *   <li>Namespace prefixes need to be bound to a namespace URI.\n   *   <li>Element and attribute namespace URIs are compared, but their prefixes are ignored.\n   *       <ul>\n   *         <li>Namespace URIs can be explicitly excluded. Although, due to how XMLUnit's engine is\n   *             implemented, excluding NAMESPACE_URI does not work with attributes (<a\n   *             href=\"https://github.com/xmlunit/xmlunit/issues/282\">see XMLUnit issue</a>).\n   *       </ul>\n   *   <li>The namespaces defined by xmlns namespaced attributes are compared, but the attributes\n   *       themselves are ignored (e.g. `&lt;thing xmlns:th=\"https://thing.com\">Match\n   *       this&lt;/thing>` == `&lt;thing xmlns:st=\"https://stuff.com\">Match this&lt;/thing>`)\n   *       <ul>\n   *         <li>XMLUnit ignores all attributes namespaced to http://www.w3.org/2000/xmlns/, which\n   *             all default and prefixed xmlns attributes are assigned to by when the document\n   *             builder factory is namespace aware.\n   *       </ul>\n   * </ul>\n   *\n   * <p>{@link NamespaceAwareness#NONE} behaviour:\n   *\n   * <ul>\n   *   <li>Namespace prefixes do not need to be bound to a namespace URI.\n   *   <li>Element and attribute are compared by their full name and all namespace URIs are ignored.\n   *   <li>xmlns attributes are not ignored and are treated like any other attribute.\n   * </ul>\n   */\n  public enum NamespaceAwareness {\n    STRICT,\n    LEGACY,\n    NONE,\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/ExactMatchMultiValuePattern.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.http.MultiValue;\nimport java.util.List;\n\n@JsonDeserialize(as = ExactMatchMultiValuePattern.class)\npublic class ExactMatchMultiValuePattern extends MultipleMatchMultiValuePattern {\n\n  public static final String JSON_KEY = \"hasExactly\";\n  public static final String HAS_EXACTLY_OPERATOR = \" exactly \";\n\n  @JsonProperty(JSON_KEY)\n  private List<StringValuePattern> stringValuePatterns;\n\n  @JsonCreator\n  public ExactMatchMultiValuePattern(\n      @JsonProperty(JSON_KEY) final List<StringValuePattern> valuePatterns) {\n    this.stringValuePatterns = valuePatterns;\n  }\n\n  @Override\n  public MatchResult match(MultiValue value) {\n\n    if (!value.isPresent()) {\n      return MatchResult.of(false);\n    }\n    return MatchResult.aggregate(\n        MatchResult.of(stringValuePatterns.size() == value.values().size()), super.match(value));\n  }\n\n  @Override\n  public List<StringValuePattern> getValues() {\n    return stringValuePatterns;\n  }\n\n  @Override\n  public String getOperator() {\n    return HAS_EXACTLY_OPERATOR;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/GreaterThanEqualNumberPattern.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class GreaterThanEqualNumberPattern extends AbstractNumberPattern {\n\n  public GreaterThanEqualNumberPattern(@JsonProperty(\"greaterThanEqualNumber\") Number testValue) {\n    super(testValue);\n  }\n\n  public Number getGreaterThanEqualNumber() {\n    return expectedNumber;\n  }\n\n  @Override\n  public MatchResult match(final String value) {\n    return new AbstractNumberMatchResult(expectedNumber, value) {\n      @Override\n      protected boolean isExactMatch(double expected, double actual) {\n        return actual >= expected;\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/GreaterThanNumberPattern.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class GreaterThanNumberPattern extends AbstractNumberPattern {\n\n  public GreaterThanNumberPattern(@JsonProperty(\"greaterThanNumber\") Number testValue) {\n    super(testValue);\n  }\n\n  public Number getGreaterThanNumber() {\n    return expectedNumber;\n  }\n\n  @Override\n  public MatchResult match(final String value) {\n    return new AbstractNumberMatchResult(expectedNumber, value) {\n      @Override\n      protected boolean isExactMatch(double expected, double actual) {\n        return actual > expected;\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/IncludesMatchMultiValuePattern.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport java.util.List;\n\n@JsonDeserialize(as = IncludesMatchMultiValuePattern.class)\npublic class IncludesMatchMultiValuePattern extends MultipleMatchMultiValuePattern {\n\n  public static final String JSON_KEY = \"includes\";\n  public static final String INCLUDING_OPERATOR = \" including \";\n\n  @JsonProperty(JSON_KEY)\n  private final List<StringValuePattern> stringValuePatterns;\n\n  @JsonCreator\n  public IncludesMatchMultiValuePattern(\n      @JsonProperty(JSON_KEY) final List<StringValuePattern> stringValuePatterns) {\n    this.stringValuePatterns = stringValuePatterns;\n  }\n\n  @Override\n  public List<StringValuePattern> getValues() {\n    return stringValuePatterns;\n  }\n\n  @Override\n  public String getOperator() {\n    return INCLUDING_OPERATOR;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/JsonPathPatternJsonSerializer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.databind.JsonSerializer;\nimport com.fasterxml.jackson.databind.SerializerProvider;\nimport com.fasterxml.jackson.databind.util.NameTransformer;\nimport java.io.IOException;\n\npublic class JsonPathPatternJsonSerializer\n    extends PathPatternJsonSerializer<MatchesJsonPathPattern> {\n\n  @Override\n  public JsonSerializer<MatchesJsonPathPattern> unwrappingSerializer(NameTransformer unwrapper) {\n    return new UnwrappedJsonPathPatternJsonSerializer();\n  }\n\n  @Override\n  protected void serializeAdditionalFields(\n      MatchesJsonPathPattern value, JsonGenerator gen, SerializerProvider serializers)\n      throws IOException {}\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/LessThanEqualNumberPattern.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class LessThanEqualNumberPattern extends AbstractNumberPattern {\n\n  public LessThanEqualNumberPattern(@JsonProperty(\"lessThanEqualNumber\") Number testValue) {\n    super(testValue);\n  }\n\n  public Number getLessThanEqualNumber() {\n    return expectedNumber;\n  }\n\n  @Override\n  public MatchResult match(final String value) {\n    return new AbstractNumberMatchResult(expectedNumber, value) {\n      @Override\n      protected boolean isExactMatch(double expected, double actual) {\n        return actual <= expected;\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/LessThanNumberPattern.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class LessThanNumberPattern extends AbstractNumberPattern {\n\n  public LessThanNumberPattern(@JsonProperty(\"lessThanNumber\") Number testValue) {\n    super(testValue);\n  }\n\n  public Number getLessThanNumber() {\n    return expectedNumber;\n  }\n\n  @Override\n  public MatchResult match(final String value) {\n    return new AbstractNumberMatchResult(expectedNumber, value) {\n      @Override\n      protected boolean isExactMatch(double expected, double actual) {\n        return actual < expected;\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/LogicalAnd.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class LogicalAnd extends AbstractLogicalMatcher {\n\n  public LogicalAnd(StringValuePattern... operands) {\n    super(operands);\n  }\n\n  public LogicalAnd(@JsonProperty(\"and\") List<StringValuePattern> operands) {\n    super(operands);\n  }\n\n  @Override\n  protected String getOperationName() {\n    return \"AND\";\n  }\n\n  public List<StringValuePattern> getAnd() {\n    return operands;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    return MatchResult.aggregate(\n        operands.stream().map(matcher -> matcher.match(value)).collect(Collectors.toList()));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/LogicalOr.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class LogicalOr extends AbstractLogicalMatcher {\n\n  public LogicalOr(StringValuePattern... operands) {\n    super(operands);\n  }\n\n  public LogicalOr(@JsonProperty(\"or\") List<StringValuePattern> operands) {\n    super(operands);\n  }\n\n  @Override\n  protected String getOperationName() {\n    return \"OR\";\n  }\n\n  public List<StringValuePattern> getOr() {\n    return operands;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    final List<MatchResult> matchResults =\n        operands.stream().map(matcher -> matcher.match(value)).collect(Collectors.toList());\n\n    return new MatchResult() {\n      @Override\n      public boolean isExactMatch() {\n        return matchResults.stream().anyMatch(MatchResult::isExactMatch);\n      }\n\n      @Override\n      public double getDistance() {\n        return matchResults.stream().map(MatchResult::getDistance).sorted().findFirst().get();\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MatchResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static java.util.Arrays.asList;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Queue;\nimport java.util.concurrent.LinkedBlockingQueue;\nimport java.util.function.Predicate;\nimport java.util.stream.Collectors;\nimport org.wiremock.annotations.Beta;\n\npublic abstract class MatchResult implements Comparable<MatchResult> {\n\n  private final Queue<SubEvent> subEvents;\n  private final List<DiffDescription> diffDescriptions;\n\n  public MatchResult() {\n    this(List.of(), List.of());\n  }\n\n  public MatchResult(List<SubEvent> subEvents) {\n    this(subEvents, List.of());\n  }\n\n  public MatchResult(List<SubEvent> subEvents, DiffDescription diffDescription) {\n    this(subEvents, List.of(diffDescription));\n  }\n\n  public MatchResult(List<SubEvent> subEvents, List<DiffDescription> diffDescriptions) {\n    this.subEvents = new LinkedBlockingQueue<>(subEvents);\n    this.diffDescriptions = diffDescriptions;\n  }\n\n  protected void appendSubEvent(SubEvent subEvent) {\n    subEvents.add(subEvent);\n  }\n\n  public List<SubEvent> getSubEvents() {\n    return new ArrayList<>(subEvents);\n  }\n\n  public List<DiffDescription> getDiffDescriptions() {\n    return this.diffDescriptions;\n  }\n\n  @JsonCreator\n  public static MatchResult partialMatch(@JsonProperty(\"distance\") double distance) {\n    return partialMatch(distance, List.of());\n  }\n\n  public static MatchResult partialMatch(double distance, SubEvent... subEvents) {\n    return partialMatch(distance, List.of(subEvents));\n  }\n\n  public static MatchResult partialMatch(double distance, List<SubEvent> subEvents) {\n    return new EagerMatchResult(distance, subEvents);\n  }\n\n  public static MatchResult exactMatch(SubEvent... subEvents) {\n    return exactMatch(List.of(subEvents));\n  }\n\n  public static MatchResult exactMatch(List<SubEvent> subEvents) {\n    return new EagerMatchResult(0, subEvents);\n  }\n\n  public static MatchResult noMatch(SubEvent... subEvents) {\n    return noMatch(List.of(subEvents));\n  }\n\n  public static MatchResult noMatch(List<SubEvent> subEvents) {\n    return new EagerMatchResult(1, subEvents);\n  }\n\n  public static MatchResult of(boolean isMatch, SubEvent... subEvents) {\n    return of(isMatch, List.of(subEvents));\n  }\n\n  public static MatchResult of(boolean isMatch, List<SubEvent> subEvents) {\n    return isMatch ? exactMatch(subEvents) : noMatch(subEvents);\n  }\n\n  public static MatchResult aggregate(MatchResult... matches) {\n    return aggregate(asList(matches));\n  }\n\n  public static MatchResult aggregate(final List<MatchResult> matchResults) {\n    return aggregateWeighted(\n        matchResults.stream().map(WeightedMatchResult::new).collect(Collectors.toList()));\n  }\n\n  public static MatchResult aggregateWeighted(WeightedMatchResult... matchResults) {\n    return aggregateWeighted(asList(matchResults));\n  }\n\n  public static MatchResult aggregateWeighted(final List<WeightedMatchResult> matchResults) {\n    return new WeightedAggregateMatchResult(matchResults);\n  }\n\n  @JsonIgnore\n  public abstract boolean isExactMatch();\n\n  public abstract double getDistance();\n\n  @Override\n  public int compareTo(MatchResult other) {\n    return Double.compare(other.getDistance(), getDistance());\n  }\n\n  public static final Predicate<WeightedMatchResult> ARE_EXACT_MATCH =\n      WeightedMatchResult::isExactMatch;\n\n  @Beta(\n      justification =\n          \"Add self-description callbacks for use in Diff - https://github.com/wiremock/wiremock/issues/2758\")\n  public static class DiffDescription {\n    private final String expected;\n    private final String actual;\n    private final String errorMessage;\n\n    public DiffDescription(String expected, String actual, String errorMessage) {\n      this.expected = expected;\n      this.actual = actual;\n      this.errorMessage = errorMessage;\n    }\n\n    public String getExpected() {\n      return expected;\n    }\n\n    public String getErrorMessage() {\n      return errorMessage;\n    }\n\n    public String getActual() {\n      return actual;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MatchesJsonPathPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static com.github.tomakehurst.wiremock.common.RequestCache.Key.keyFor;\nimport static java.util.stream.Collectors.toList;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.annotation.JsonSerialize;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport com.github.tomakehurst.wiremock.common.RequestCache;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.jayway.jsonpath.DocumentContext;\nimport com.jayway.jsonpath.JsonPath;\nimport com.jayway.jsonpath.PathNotFoundException;\nimport java.util.Collection;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.Map;\n\n@JsonSerialize(using = JsonPathPatternJsonSerializer.class)\npublic class MatchesJsonPathPattern extends PathPattern {\n\n  private final JsonPath jsonPath;\n\n  public MatchesJsonPathPattern(\n      @JsonProperty(\"matchesJsonPath\") String expectedJsonPath, StringValuePattern valuePattern) {\n    super(expectedJsonPath, valuePattern);\n    jsonPath = JsonPath.compile(expectedJsonPath);\n  }\n\n  public MatchesJsonPathPattern(String value) {\n    this(value, null);\n  }\n\n  public String getMatchesJsonPath() {\n    return expectedValue;\n  }\n\n  protected MatchResult isSimpleMatch(String value) {\n    // For performance reason, don't try to parse XML value\n    if (value != null && value.trim().startsWith(\"<\")) {\n      final String message =\n          String.format(\n              \"Warning: JSON path expression failed to match document '%s' because it's not JSON but probably XML\",\n              value);\n      notifier().info(message);\n      return MatchResult.noMatch(SubEvent.warning(message));\n    }\n    try {\n      Object obj = evaluateJsonPath(value);\n\n      boolean result;\n      if (obj instanceof Collection<?> collection) {\n        // If the path is definite (e.g., $.items), an empty collection IS the value\n        // If the path is indefinite (e.g., $.items[?(@.id == 999)]), empty means no match\n        result = !collection.isEmpty() || jsonPath.isDefinite();\n      } else if (obj instanceof Map<?, ?> map) {\n        // If the path is definite (e.g., $.empty), an empty map IS the value\n        result = !map.isEmpty() || jsonPath.isDefinite();\n      } else {\n        result = obj != null;\n      }\n\n      return MatchResult.of(result);\n    } catch (Exception e) {\n      String error;\n      if (e.getMessage().equalsIgnoreCase(\"invalid path\")) {\n        error = \"the JSON path didn't match the document structure\";\n      } else if (e.getMessage().equalsIgnoreCase(\"invalid container object\")) {\n        error = \"the JSON document couldn't be parsed\";\n      } else {\n        error = \"of error '\" + e.getMessage() + \"'\";\n      }\n\n      String message =\n          String.format(\n              \"Warning: JSON path expression failed to match document '%s' because %s\",\n              value, error);\n\n      return MatchResult.noMatch(SubEvent.warning(message));\n    }\n  }\n\n  protected MatchResult isAdvancedMatch(String value) {\n    try {\n      ListOrSingle<String> expressionResult = getExpressionResult(value);\n\n      // Bit of a hack, but otherwise empty array results aren't matched as absent()\n      if ((expressionResult == null || expressionResult.isEmpty())\n          && AbsentPattern.class.isAssignableFrom(valuePattern.getClass())) {\n        expressionResult = ListOrSingle.of((String) null);\n      }\n\n      final List<MatchResult> matchResults =\n          expressionResult.stream().map(valuePattern::match).collect(toList());\n      final List<SubEvent> subEvents =\n          matchResults.stream()\n              .map(MatchResult::getSubEvents)\n              .flatMap(Collection::stream)\n              .collect(toList());\n\n      return matchResults.stream()\n          .filter(MatchResult::isExactMatch)\n          .findFirst()\n          .orElse(\n              new MatchResult(subEvents) {\n                @Override\n                public boolean isExactMatch() {\n                  return false;\n                }\n\n                @Override\n                public double getDistance() {\n                  return matchResults.stream()\n                      .min(Comparator.comparingDouble(MatchResult::getDistance))\n                      .map(MatchResult::getDistance)\n                      .orElse(1.0);\n                }\n              });\n    } catch (SubExpressionException e) {\n      return MatchResult.noMatch(SubEvent.warning(e.getMessage()));\n    }\n  }\n\n  @Override\n  public ListOrSingle<String> getExpressionResult(final String value) {\n    // For performance reason, don't try to parse XML value\n    if (value != null && value.trim().startsWith(\"<\")) {\n      final String message =\n          String.format(\n              \"Warning: JSON path expression '%s' failed to match document '%s' because it's not JSON but probably XML\",\n              expectedValue, value);\n\n      throw new SubExpressionException(message);\n    }\n\n    Object obj = null;\n    try {\n      obj = evaluateJsonPath(value);\n    } catch (PathNotFoundException ignored) {\n    } catch (Exception e) {\n      String error;\n      if (e.getMessage().equalsIgnoreCase(\"invalid container object\")) {\n        error = \"the JSON document couldn't be parsed\";\n      } else {\n        error = \"of error '\" + e.getMessage() + \"'\";\n      }\n\n      String message =\n          String.format(\n              \"Warning: JSON path expression '%s' failed to match document '%s' because %s\",\n              expectedValue, value, error);\n\n      throw new SubExpressionException(message, e);\n    }\n\n    ListOrSingle<String> expressionResult;\n    if (obj instanceof Map\n        || (obj instanceof List\n            && EqualToJsonPattern.class.isAssignableFrom(valuePattern.getClass()))) {\n      expressionResult = ListOrSingle.of(Json.write(obj));\n    } else if (obj instanceof List) {\n      final List<String> stringValues =\n          ((List<?>) obj).stream().map(String::valueOf).collect(toList());\n      expressionResult = ListOrSingle.of(stringValues);\n    } else if (obj instanceof Number || obj instanceof String || obj instanceof Boolean) {\n      expressionResult = ListOrSingle.of(String.valueOf(obj));\n    } else {\n      expressionResult = ListOrSingle.of();\n    }\n\n    return expressionResult;\n  }\n\n  private Object evaluateJsonPath(String value) {\n    if (value == null) {\n      return null;\n    }\n\n    final RequestCache requestCache = RequestCache.getCurrent();\n\n    final DocumentContext documentContext =\n        requestCache.get(\n            keyFor(JsonNode.class, \"parsedJson\", value.hashCode()), () -> JsonPath.parse(value));\n\n    return requestCache.get(\n        keyFor(JsonNode.class, \"jsonPathResult\", expectedValue, value.hashCode()),\n        () -> documentContext.read(jsonPath));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MatchesJsonSchemaPattern.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.node.TextNode;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.ClientError;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.networknt.schema.JsonSchema;\nimport com.networknt.schema.JsonSchemaFactory;\nimport com.networknt.schema.SchemaValidatorsConfig;\nimport com.networknt.schema.ValidationMessage;\nimport java.util.Set;\n\npublic class MatchesJsonSchemaPattern extends StringValuePattern {\n\n  private final JsonSchema schema;\n  private final WireMock.JsonSchemaVersion schemaVersion;\n  private final int schemaPropertyCount;\n  private final Errors invalidSchemaErrors;\n\n  public MatchesJsonSchemaPattern(String schemaJson) {\n    this(schemaJson, WireMock.JsonSchemaVersion.V202012);\n  }\n\n  public MatchesJsonSchemaPattern(\n      @JsonProperty(\"matchesJsonSchema\") String schemaJson,\n      @JsonProperty(\"schemaVersion\") WireMock.JsonSchemaVersion schemaVersion) {\n    super(schemaJson);\n\n    SchemaValidatorsConfig config = new SchemaValidatorsConfig();\n    config.setTypeLoose(false);\n    config.setHandleNullableField(true);\n\n    final JsonSchemaFactory schemaFactory =\n        JsonSchemaFactory.getInstance(schemaVersion.toVersionFlag());\n    JsonSchema schema;\n    JsonNode schemaAsJson = Json.read(schemaJson, JsonNode.class);\n    int schemaPropertyCount;\n    Errors invalidSchemaErrors;\n    try {\n      schema = schemaFactory.getSchema(schemaAsJson, config);\n      schemaPropertyCount = Json.schemaPropertyCount(schemaAsJson);\n      invalidSchemaErrors = null;\n    } catch (Exception e) {\n      schema = null;\n      schemaPropertyCount = 0;\n      invalidSchemaErrors = getInvalidSchemaErrors(e);\n    }\n    this.schema = schema;\n    this.schemaVersion = schemaVersion;\n\n    this.schemaPropertyCount = schemaPropertyCount;\n    this.invalidSchemaErrors = invalidSchemaErrors;\n  }\n\n  public MatchesJsonSchemaPattern(\n      JsonNode schemaJsonNode, WireMock.JsonSchemaVersion schemaVersion) {\n    this(Json.write(schemaJsonNode), schemaVersion);\n  }\n\n  public String getMatchesJsonSchema() {\n    return expectedValue;\n  }\n\n  public WireMock.JsonSchemaVersion getSchemaVersion() {\n    return schemaVersion;\n  }\n\n  @Override\n  public String getExpected() {\n    return Json.prettyPrint(getValue());\n  }\n\n  @Override\n  public MatchResult match(String json) {\n    if (schema == null) {\n      return MatchResult.noMatch(new SubEvent(SubEvent.ERROR, invalidSchemaErrors));\n    }\n    if (json == null) {\n      return MatchResult.noMatch();\n    }\n\n    JsonNode jsonNode;\n    try {\n      jsonNode = Json.read(json, JsonNode.class);\n    } catch (JsonException je) {\n      jsonNode = new TextNode(json);\n    }\n\n    final Set<ValidationMessage> validationMessages;\n    try {\n      validationMessages = validate(jsonNode, json);\n    } catch (Exception e) {\n      return MatchResult.noMatch(new SubEvent(SubEvent.ERROR, getInvalidSchemaErrors(e)));\n    }\n\n    if (validationMessages.isEmpty()) {\n      return MatchResult.exactMatch();\n    }\n\n    return new MatchResult() {\n      @Override\n      public boolean isExactMatch() {\n        return false;\n      }\n\n      @Override\n      public double getDistance() {\n        if (schemaPropertyCount == 0) {\n          return 1;\n        }\n\n        return (double) validationMessages.size() / schemaPropertyCount;\n      }\n    };\n  }\n\n  private static Errors getInvalidSchemaErrors(Exception e) {\n    Errors invalidSchemaErrors;\n    if (e instanceof ClientError) {\n      Errors.Error error = ((ClientError) e).getErrors().first();\n      invalidSchemaErrors =\n          Errors.single(\n              error.getCode(),\n              error.getSource().getPointer(),\n              \"Invalid JSON Schema\",\n              error.getDetail());\n    } else {\n      invalidSchemaErrors =\n          Errors.singleWithDetail(10, \"Invalid JSON Schema\", getRootCause(e).getMessage());\n    }\n    return invalidSchemaErrors;\n  }\n\n  private static Throwable getRootCause(Throwable e) {\n    if (e.getCause() != null) {\n      return getRootCause(e.getCause());\n    }\n    return e;\n  }\n\n  private Set<ValidationMessage> validate(JsonNode jsonNode, String originalJson) {\n    final Set<ValidationMessage> validationMessages = schema.validate(jsonNode);\n    if (validationMessages.isEmpty() || jsonNode.isTextual() || jsonNode.isContainerNode()) {\n      return validationMessages;\n    } else {\n      return schema.validate(new TextNode(originalJson));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MatchesXPathPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.fasterxml.jackson.annotation.JsonGetter;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonSerialize;\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport com.github.tomakehurst.wiremock.common.xml.*;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport java.util.*;\nimport java.util.stream.Collectors;\n\n@JsonSerialize(using = XPathPatternJsonSerializer.class)\npublic class MatchesXPathPattern extends PathPattern {\n\n  private final Map<String, String> xpathNamespaces;\n\n  public MatchesXPathPattern(String xpath) {\n    this(xpath, null, null);\n  }\n\n  public MatchesXPathPattern(String xpath, StringValuePattern valuePattern) {\n    this(xpath, null, valuePattern);\n  }\n\n  public MatchesXPathPattern(String xpath, Map<String, String> namespaces) {\n    this(xpath, namespaces, null);\n  }\n\n  public MatchesXPathPattern(\n      @JsonProperty(\"matchesXPath\") String xpath,\n      @JsonProperty(\"namespaces\") Map<String, String> namespaces,\n      @JsonProperty(\"valuePattern\") StringValuePattern valuePattern) {\n    super(xpath, valuePattern);\n    xpathNamespaces = namespaces == null || namespaces.isEmpty() ? null : namespaces;\n  }\n\n  public MatchesXPathPattern withXPathNamespace(String name, String namespaceUri) {\n    Map<String, String> namespaceMap =\n        new HashMap<>(getFirstNonNull(xpathNamespaces, new HashMap<>()));\n    namespaceMap.put(name, namespaceUri);\n    return new MatchesXPathPattern(expectedValue, Collections.unmodifiableMap(namespaceMap));\n  }\n\n  public String getMatchesXPath() {\n    return expectedValue;\n  }\n\n  @JsonGetter(\"xPathNamespaces\")\n  public Map<String, String> getXPathNamespaces() {\n    return xpathNamespaces;\n  }\n\n  @Override\n  protected MatchResult isSimpleMatch(String value) {\n    final XmlNodeFindResult xmlNodeFindResult = findXmlNodes(value);\n    ListOrSingle<XmlNode> nodeList = xmlNodeFindResult.nodes;\n    return MatchResult.of(nodeList != null && !nodeList.isEmpty(), xmlNodeFindResult.subEvents);\n  }\n\n  @Override\n  protected MatchResult isAdvancedMatch(String value) {\n    final XmlNodeFindResult xmlNodeFindResult = findXmlNodes(value);\n    ListOrSingle<XmlNode> nodeList = xmlNodeFindResult.nodes;\n    if (nodeList == null || nodeList.isEmpty()) {\n      return MatchResult.noMatch(xmlNodeFindResult.subEvents);\n    }\n\n    SortedSet<MatchResult> results = new TreeSet<>();\n    for (XmlNode node : nodeList) {\n      results.add(valuePattern.match(node.toString()));\n    }\n\n    return results.last();\n  }\n\n  @Override\n  public ListOrSingle<String> getExpressionResult(String value) {\n    ListOrSingle<XmlNode> nodeList = findXmlNodes(value).nodes;\n    if (nodeList == null || nodeList.isEmpty()) {\n      return ListOrSingle.of();\n    }\n\n    return ListOrSingle.of(nodeList.stream().map(XmlNode::toString).collect(Collectors.toList()));\n  }\n\n  private XmlNodeFindResult findXmlNodes(String value) {\n    // For performance reason, don't try to parse non XML value\n    if (value == null || !value.trim().startsWith(\"<\")) {\n      final String message =\n          String.format(\"Warning: failed to parse the XML document\\nXML: %s\", value);\n      notifier().info(message);\n      return new XmlNodeFindResult(null, SubEvent.warning(message));\n    }\n\n    try {\n      XmlDocument xmlDocument = Xml.parse(value);\n      return new XmlNodeFindResult(xmlDocument.findNodes(expectedValue, xpathNamespaces));\n    } catch (XmlException e) {\n      final String message =\n          String.format(\n              \"Warning: failed to parse the XML document. Reason: %s\\nXML: %s\",\n              e.getMessage(), value);\n      notifier().info(message);\n      return new XmlNodeFindResult(null, SubEvent.warning(message));\n    } catch (XPathException e) {\n      final String message = \"Warning: failed to evaluate the XPath expression \" + expectedValue;\n      notifier().info(message);\n      return new XmlNodeFindResult(null, SubEvent.warning(message));\n    }\n  }\n\n  private static class XmlNodeFindResult {\n    final ListOrSingle<XmlNode> nodes;\n    final List<SubEvent> subEvents;\n\n    public XmlNodeFindResult(ListOrSingle<XmlNode> nodes, SubEvent... subEvents) {\n      this.nodes = nodes;\n      this.subEvents = List.of(subEvents);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MemoizingMatchResult.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.google.common.base.Supplier;\nimport com.google.common.base.Suppliers;\nimport java.util.List;\n\npublic class MemoizingMatchResult extends MatchResult {\n\n  private final Supplier<Double> memoizedDistance =\n      Suppliers.memoize(\n          new Supplier<>() {\n            @Override\n            public Double get() {\n              return target.getDistance();\n            }\n          });\n\n  private final Supplier<Boolean> memoizedExactMatch =\n      Suppliers.memoize(\n          new Supplier<>() {\n            @Override\n            public Boolean get() {\n              return target.isExactMatch();\n            }\n          });\n\n  private final MatchResult target;\n\n  public MemoizingMatchResult(MatchResult target) {\n    this.target = target;\n  }\n\n  @Override\n  public boolean isExactMatch() {\n    return memoizedExactMatch.get();\n  }\n\n  @Override\n  public double getDistance() {\n    return memoizedDistance.get();\n  }\n\n  @Override\n  public List<SubEvent> getSubEvents() {\n    return target.getSubEvents();\n  }\n\n  @Override\n  public List<DiffDescription> getDiffDescriptions() {\n    return target.getDiffDescriptions();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MultiRequestMethodPattern.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\n\nimport java.util.Map;\nimport java.util.Set;\n\npublic abstract class MultiRequestMethodPattern extends RequestMethod {\n\n  protected final Set<RequestMethod> methods;\n\n  protected MultiRequestMethodPattern(String name, Set<RequestMethod> methods) {\n    super(name);\n    this.methods = methods;\n  }\n\n  public Set<RequestMethod> getMethods() {\n    return methods;\n  }\n\n  @Override\n  public String getExpected() {\n    return getName() + \": \" + methods.toString();\n  }\n\n  public static class IsOneOf extends MultiRequestMethodPattern {\n\n    public static final String NAME = \"oneOf\";\n\n    public IsOneOf(Set<RequestMethod> methods) {\n      super(NAME, methods);\n    }\n\n    @Override\n    public String getName() {\n      return NAME;\n    }\n\n    @Override\n    public Object value() {\n      return Map.of(NAME, methods);\n    }\n\n    @Override\n    public MatchResult match(RequestMethod value) {\n      return methods.contains(value) ? MatchResult.exactMatch() : MatchResult.noMatch();\n    }\n  }\n\n  public static class IsNoneOf extends MultiRequestMethodPattern {\n\n    public static final String NAME = \"noneOf\";\n\n    public IsNoneOf(Set<RequestMethod> methods) {\n      super(NAME, methods);\n    }\n\n    @Override\n    public String getName() {\n      return NAME;\n    }\n\n    @Override\n    public Object value() {\n      return Map.of(NAME, methods);\n    }\n\n    @Override\n    public MatchResult match(RequestMethod value) {\n      return methods.contains(value) ? MatchResult.noMatch() : MatchResult.exactMatch();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MultiValuePattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static java.util.Collections.min;\n\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.http.MultiValue;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\n@JsonDeserialize(using = MultiValuePatternDeserializer.class)\npublic abstract class MultiValuePattern implements NamedValueMatcher<MultiValue> {\n\n  public static MultiValuePattern of(StringValuePattern valuePattern) {\n    return new SingleMatchMultiValuePattern(valuePattern);\n  }\n\n  public static MultiValuePattern absent() {\n    return new SingleMatchMultiValuePattern(WireMock.absent());\n  }\n\n  protected static MatchResult getBestMatch(\n      final StringValuePattern valuePattern, List<String> values) {\n    List<MatchResult> allResults =\n        values.stream().map(valuePattern::match).collect(Collectors.toList());\n    return min(allResults, Comparator.comparingDouble(MatchResult::getDistance));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MultiValuePatternDeserializer.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport java.io.IOException;\n\npublic class MultiValuePatternDeserializer extends JsonDeserializer<MultiValuePattern> {\n\n  @Override\n  public MultiValuePattern deserialize(JsonParser parser, DeserializationContext ctxt)\n      throws IOException {\n    JsonNode rootNode = parser.readValueAsTree();\n    final ObjectMapper mapper = (ObjectMapper) parser.getCodec();\n    if (rootNode.has(ExactMatchMultiValuePattern.JSON_KEY)) {\n      return mapper.treeToValue(rootNode, ExactMatchMultiValuePattern.class);\n    } else if (rootNode.has(IncludesMatchMultiValuePattern.JSON_KEY)) {\n      return mapper.treeToValue(rootNode, IncludesMatchMultiValuePattern.class);\n    } else {\n      return mapper.treeToValue(rootNode, SingleMatchMultiValuePattern.class);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MultipartValuePattern.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.http.Body;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.stream.Collectors;\n\npublic class MultipartValuePattern implements ValueMatcher<Request.Part> {\n\n  public enum MatchingType {\n    ALL,\n    ANY\n  }\n\n  private final String name;\n  private final String filename;\n  private final Map<String, MultiValuePattern> headers;\n  private final List<ContentPattern<?>> bodyPatterns;\n  private final MatchingType matchingType;\n\n  @JsonCreator\n  public MultipartValuePattern(\n      @JsonProperty(\"name\") String name,\n      @JsonProperty(\"fileName\") String filename,\n      @JsonProperty(\"matchingType\") MatchingType type,\n      @JsonProperty(\"headers\") Map<String, MultiValuePattern> headers,\n      @JsonProperty(\"bodyPatterns\") List<ContentPattern<?>> body) {\n    this.name = name;\n    this.filename = filename;\n    this.matchingType = type;\n    this.headers = headers;\n    this.bodyPatterns = body;\n  }\n\n  @JsonIgnore\n  public boolean isMatchAny() {\n    return matchingType == MatchingType.ANY;\n  }\n\n  @JsonIgnore\n  public boolean isMatchAll() {\n    return matchingType == MatchingType.ALL;\n  }\n\n  @Override\n  public MatchResult match(final Request.Part value) {\n    if (headers != null || bodyPatterns != null) {\n      return MatchResult.aggregate(\n          headers != null ? matchHeaderPatterns(value) : MatchResult.exactMatch(),\n          bodyPatterns != null ? matchBodyPatterns(value) : MatchResult.exactMatch(),\n          filename != null ? matchFileName(value) : MatchResult.exactMatch());\n    }\n\n    return MatchResult.exactMatch();\n  }\n\n  public MatchResult match(final Request request) {\n    return isMatchAll() ? matchAllMultiparts(request) : matchAnyMultipart(request);\n  }\n\n  private MatchResult matchAllMultiparts(final Request request) {\n    return request.getParts().stream()\n            .allMatch(input -> MultipartValuePattern.this.match(input).isExactMatch())\n        ? MatchResult.exactMatch()\n        : MatchResult.noMatch();\n  }\n\n  private MatchResult matchAnyMultipart(final Request request) {\n    Collection<Request.Part> parts = request.getParts();\n    if (parts == null || parts.isEmpty()) {\n      return MatchResult.noMatch();\n    }\n\n    return parts.stream().anyMatch(input -> MultipartValuePattern.this.match(input).isExactMatch())\n        ? MatchResult.exactMatch()\n        : MatchResult.noMatch();\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  public String getFileName() {\n    return filename;\n  }\n\n  public Map<String, MultiValuePattern> getHeaders() {\n    return headers;\n  }\n\n  public MatchingType getMatchingType() {\n    return matchingType;\n  }\n\n  public List<ContentPattern<?>> getBodyPatterns() {\n    return bodyPatterns;\n  }\n\n  private MatchResult matchFileName(final Request.Part part) {\n    if (filename != null && !filename.isEmpty()) {\n      return MatchResult.of(filename.equals(part.getFileName()));\n    }\n    return MatchResult.exactMatch();\n  }\n\n  private MatchResult matchHeaderPatterns(final Request.Part part) {\n    if (headers != null && !headers.isEmpty()) {\n      return MatchResult.aggregate(\n          headers.entrySet().stream()\n              .map(\n                  headerPattern ->\n                      headerPattern.getValue().match(part.getHeader(headerPattern.getKey())))\n              .collect(Collectors.toList()));\n    }\n\n    return MatchResult.exactMatch();\n  }\n\n  private MatchResult matchBodyPatterns(final Request.Part value) {\n    return MatchResult.aggregate(\n        bodyPatterns.stream()\n            .map(bodyPattern -> matchBody(value, bodyPattern))\n            .collect(Collectors.toList()));\n  }\n\n  private static MatchResult matchBody(Request.Part part, ContentPattern<?> bodyPattern) {\n    Body body = part.getBody();\n    if (body == null) {\n      return MatchResult.noMatch();\n    }\n\n    if (BinaryEqualToPattern.class.isAssignableFrom(bodyPattern.getClass())) {\n      return ((BinaryEqualToPattern) bodyPattern).match(body.asBytes());\n    }\n\n    return ((StringValuePattern) bodyPattern).match(body.asString());\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    MultipartValuePattern that = (MultipartValuePattern) o;\n\n    return Objects.equals(name, that.name)\n        && Objects.equals(filename, that.filename)\n        && Objects.equals(headers, that.headers)\n        && Objects.equals(bodyPatterns, that.bodyPatterns)\n        && matchingType == that.matchingType;\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(name, filename, headers, bodyPatterns, matchingType);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MultipartValuePatternBuilder.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.containing;\n\nimport java.util.LinkedHashMap;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.Map;\n\npublic class MultipartValuePatternBuilder {\n\n  private String name = null;\n  private String filename = null;\n  private Map<String, MultiValuePattern> headerPatterns = new LinkedHashMap<>();\n  private List<ContentPattern<?>> bodyPatterns = new LinkedList<>();\n  private MultipartValuePattern.MatchingType matchingType = MultipartValuePattern.MatchingType.ANY;\n\n  public MultipartValuePatternBuilder() {}\n\n  public MultipartValuePatternBuilder(String name) {\n    withName(name);\n  }\n\n  public MultipartValuePatternBuilder matchingType(MultipartValuePattern.MatchingType type) {\n    matchingType = type;\n    return this;\n  }\n\n  public MultipartValuePatternBuilder withName(String name) {\n    this.name = name;\n    return withHeader(\"Content-Disposition\", containing(\"name=\\\"\" + name + \"\\\"\"));\n  }\n\n  public MultipartValuePatternBuilder withFileName(String filename) {\n    this.filename = filename;\n    return withHeader(\"Content-Disposition\", containing(\"filename=\\\"\" + filename + \"\\\"\"));\n  }\n\n  public MultipartValuePatternBuilder withHeader(String name, StringValuePattern headerPattern) {\n    headerPatterns.put(name, MultiValuePattern.of(headerPattern));\n    return this;\n  }\n\n  public MultipartValuePatternBuilder withBody(ContentPattern<?> bodyPattern) {\n    bodyPatterns.add(bodyPattern);\n    return this;\n  }\n\n  public MultipartValuePattern build() {\n    return headerPatterns.isEmpty() && bodyPatterns.isEmpty()\n        ? null\n        : headerPatterns.isEmpty()\n            ? new MultipartValuePattern(name, filename, matchingType, null, bodyPatterns)\n            : new MultipartValuePattern(name, filename, matchingType, headerPatterns, bodyPatterns);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/MultipleMatchMultiValuePattern.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.github.tomakehurst.wiremock.http.MultiValue;\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.stream.Collectors;\n\npublic abstract class MultipleMatchMultiValuePattern extends MultiValuePattern {\n\n  private static final String AND = \" AND \";\n\n  @Override\n  public String getName() {\n    return getValues().stream()\n        .map(\n            stringValuePattern ->\n                stringValuePattern.getName() + \" \" + stringValuePattern.getExpected())\n        .collect(Collectors.joining(AND));\n  }\n\n  /**\n   * since this method will only be used by diff in case of multiple match values, so returning\n   * empty. For other patterns, it should not return empty value\n   *\n   * @return expected value\n   */\n  @Override\n  public String getExpected() {\n    return \"\";\n  }\n\n  @Override\n  public MatchResult match(MultiValue value) {\n    if (!value.isPresent()) {\n      return MatchResult.of(false);\n    }\n    List<MatchResult> matchResults =\n        getValues().stream()\n            .map(stringValuePattern -> getBestMatch(stringValuePattern, value.values()))\n            .collect(Collectors.toList());\n    return MatchResult.aggregate(matchResults);\n  }\n\n  @JsonIgnore\n  public abstract List<StringValuePattern> getValues();\n\n  @JsonIgnore\n  public String getOperator() {\n    return \"\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    MultipleMatchMultiValuePattern that = (MultipleMatchMultiValuePattern) o;\n    return Objects.equals(getValues(), that.getValues());\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hashCode(getValues());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/NamedValueMatcher.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\n\npublic interface NamedValueMatcher<T> extends ValueMatcher<T> {\n\n  @JsonIgnore\n  String getName();\n\n  @JsonIgnore\n  String getExpected();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/NegativeContainsPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class NegativeContainsPattern extends StringValuePattern {\n\n  public NegativeContainsPattern(@JsonProperty(\"doesNotContain\") String expectedValue) {\n    super(expectedValue);\n  }\n\n  public String getDoesNotContain() {\n    return expectedValue;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    return MatchResult.of(value == null || !value.contains(expectedValue));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/NegativeRegexPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class NegativeRegexPattern extends AbstractRegexPattern {\n\n  public NegativeRegexPattern(@JsonProperty(\"doesNotMatch\") String regex) {\n    super(regex);\n  }\n\n  public String getDoesNotMatch() {\n    return expectedValue;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    return invert(super.match(value));\n  }\n\n  private MatchResult invert(final MatchResult matchResult) {\n    return new MatchResult() {\n\n      @Override\n      public boolean isExactMatch() {\n        return !matchResult.isExactMatch();\n      }\n\n      @Override\n      public double getDistance() {\n        return 1.0 - matchResult.getDistance();\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/NormalisedNumberComparator.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport java.math.BigDecimal;\nimport net.javacrumbs.jsonunit.core.NumberComparator;\n\npublic class NormalisedNumberComparator implements NumberComparator {\n  @Override\n  public boolean compare(BigDecimal expectedValue, BigDecimal actualValue, BigDecimal tolerance) {\n    var normalisedExpectedValue = expectedValue.stripTrailingZeros();\n    var normalisedActualValue = actualValue.stripTrailingZeros();\n    if (tolerance != null) {\n      var diff = normalisedExpectedValue.subtract(normalisedActualValue).abs();\n      return diff.compareTo(tolerance) <= 0;\n    } else {\n      return normalisedExpectedValue.equals(normalisedActualValue);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/NotPattern.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class NotPattern extends StringValuePattern {\n\n  private StringValuePattern unexpectedPattern;\n\n  public NotPattern(@JsonProperty(\"not\") StringValuePattern unexpectedPattern) {\n    super(unexpectedPattern.getExpected());\n    this.unexpectedPattern = unexpectedPattern;\n  }\n\n  public StringValuePattern getNot() {\n    return unexpectedPattern;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    return invert(unexpectedPattern.match(value));\n  }\n\n  private MatchResult invert(final MatchResult matchResult) {\n    return new MatchResult() {\n      @Override\n      public boolean isExactMatch() {\n        return !matchResult.isExactMatch();\n      }\n\n      @Override\n      public double getDistance() {\n        if (isExactMatch()) {\n          return 0;\n        }\n\n        return 1.0;\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/PathPattern.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport java.util.Objects;\n\npublic abstract class PathPattern extends StringValuePattern {\n\n  protected final StringValuePattern valuePattern;\n\n  protected PathPattern(String expectedValue, StringValuePattern valuePattern) {\n    super(expectedValue);\n    this.valuePattern = valuePattern;\n  }\n\n  public StringValuePattern getValuePattern() {\n    return valuePattern;\n  }\n\n  @JsonIgnore\n  public boolean isSimple() {\n    return valuePattern == null;\n  }\n\n  @Override\n  public MatchResult match(String value) {\n    if (isSimple()) {\n      return isSimpleMatch(value);\n    }\n\n    return isAdvancedMatch(value);\n  }\n\n  protected abstract MatchResult isSimpleMatch(String value);\n\n  protected abstract MatchResult isAdvancedMatch(String value);\n\n  public abstract ListOrSingle<String> getExpressionResult(String value);\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    if (!super.equals(o)) return false;\n    PathPattern that = (PathPattern) o;\n    return Objects.equals(expectedValue, that.expectedValue)\n        && Objects.equals(valuePattern, that.valuePattern);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(super.hashCode(), valuePattern);\n  }\n\n  protected static class SubExpressionException extends RuntimeException {\n    public SubExpressionException(String message) {\n      super(message);\n    }\n\n    public SubExpressionException(String message, Throwable cause) {\n      super(message, cause);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/PathPatternJsonSerializer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.databind.JavaType;\nimport com.fasterxml.jackson.databind.JsonSerializer;\nimport com.fasterxml.jackson.databind.SerializerProvider;\nimport com.fasterxml.jackson.databind.ser.BeanSerializerFactory;\nimport java.io.IOException;\n\npublic abstract class PathPatternJsonSerializer<T extends PathPattern> extends JsonSerializer<T> {\n\n  @Override\n  public void serialize(T value, JsonGenerator gen, SerializerProvider serializers)\n      throws IOException {\n    gen.writeStartObject();\n    this.serializePathPattern(value, gen, serializers);\n    gen.writeEndObject();\n  }\n\n  protected void serializePathPattern(T value, JsonGenerator gen, SerializerProvider serializers)\n      throws IOException {\n    if (value.isSimple()) {\n      gen.writeStringField(value.getName(), value.getExpected());\n    } else {\n      AdvancedPathPattern advancedPathPattern =\n          new AdvancedPathPattern(value.getExpected(), value.getValuePattern());\n      gen.writeFieldName(value.getName());\n\n      JavaType javaType = serializers.getConfig().constructType(advancedPathPattern.getClass());\n      JsonSerializer<Object> serializer =\n          BeanSerializerFactory.instance.createSerializer(serializers, javaType);\n      serializer.serialize(advancedPathPattern, gen, serializers);\n    }\n    serializeAdditionalFields(value, gen, serializers);\n  }\n\n  protected abstract void serializeAdditionalFields(\n      T value, JsonGenerator gen, SerializerProvider serializers) throws IOException;\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/PathTemplatePattern.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport com.github.tomakehurst.wiremock.common.url.PathTemplate;\n\npublic class PathTemplatePattern extends StringValuePattern {\n\n  private final PathTemplate pathTemplate;\n\n  public PathTemplatePattern(@JsonProperty(\"matchesPathTemplate\") String expectedValue) {\n    super(expectedValue);\n    this.pathTemplate = new PathTemplate(expectedValue);\n  }\n\n  public String getMatchesPathTemplate() {\n    return expectedValue;\n  }\n\n  @JsonIgnore\n  public PathTemplate getPathTemplate() {\n    return pathTemplate;\n  }\n\n  @Override\n  public MatchResult match(String path) {\n    return new MatchResult() {\n      @Override\n      public boolean isExactMatch() {\n        return pathTemplate.matches(path);\n      }\n\n      @Override\n      public double getDistance() {\n        if (isExactMatch()) {\n          return 0;\n        }\n\n        String expected = pathTemplate.withoutVariables();\n        return Strings.normalisedLevenshteinDistance(expected, path);\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/RegexPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class RegexPattern extends AbstractRegexPattern {\n\n  public RegexPattern(@JsonProperty(\"matches\") String regex) {\n    super(regex);\n  }\n\n  public String getMatches() {\n    return expectedValue;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/RequestMatcher.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport java.util.Objects;\n\npublic abstract class RequestMatcher implements NamedValueMatcher<Request> {\n\n  @Override\n  public String getExpected() {\n    return \"(custom request matcher - override this for meaningful diff)\";\n  }\n\n  @Override\n  public int hashCode() {\n    return this.getClass().hashCode();\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    return Objects.equals(this.getClass(), obj.getClass());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/RequestMatcherExtension.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.matching.MatchResult.exactMatch;\nimport static com.github.tomakehurst.wiremock.matching.MatchResult.noMatch;\n\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.Request;\n\npublic abstract class RequestMatcherExtension extends RequestMatcher implements Extension {\n\n  @Override\n  public MatchResult match(Request request) {\n    return match(request, Parameters.empty());\n  }\n\n  public abstract MatchResult match(Request request, Parameters parameters);\n\n  @Override\n  public String getName() {\n    return \"inline\";\n  }\n\n  public static final RequestMatcherExtension ALWAYS =\n      new RequestMatcherExtension() {\n        @Override\n        public MatchResult match(Request request, Parameters parameters) {\n          return exactMatch();\n        }\n      };\n\n  public static final RequestMatcherExtension NEVER =\n      new RequestMatcherExtension() {\n        @Override\n        public MatchResult match(Request request, Parameters parameters) {\n          return noMatch();\n        }\n      };\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/RequestPattern.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.AUTHORIZATION;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.common.Strings.isEmpty;\nimport static com.github.tomakehurst.wiremock.matching.RequestMatcherExtension.NEVER;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\nimport static com.github.tomakehurst.wiremock.matching.WeightedMatchResult.weight;\nimport static java.util.stream.Collectors.toList;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonInclude.Include;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.client.BasicCredentials;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.common.url.PathTemplate;\nimport com.github.tomakehurst.wiremock.http.Cookie;\nimport com.github.tomakehurst.wiremock.http.QueryParameter;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.http.RequestPathParamsDecorator;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.google.common.collect.ImmutableMap;\nimport java.util.*;\nimport java.util.function.Consumer;\nimport java.util.function.Function;\nimport java.util.function.Predicate;\nimport org.jspecify.annotations.NonNull;\nimport org.wiremock.url.Query;\n\n@JsonInclude(Include.NON_NULL)\npublic class RequestPattern implements NamedValueMatcher<Request> {\n\n  private final String scheme;\n  private final StringValuePattern host;\n  private final Integer port;\n  private final StringValuePattern clientIp;\n  private final UrlPattern url;\n  private final RequestMethod method;\n  @NonNull private final Map<String, MultiValuePattern> headers;\n\n  @NonNull private final Map<String, StringValuePattern> pathParams;\n  @NonNull private final Map<String, MultiValuePattern> queryParams;\n  @NonNull private final Map<String, MultiValuePattern> formParams;\n  @NonNull private final Map<String, StringValuePattern> cookies;\n  private final BasicCredentials basicAuthCredentials;\n  @NonNull private final List<ContentPattern<?>> bodyPatterns;\n  @NonNull private final List<MultipartValuePattern> multipartPatterns;\n\n  private final CustomMatcherDefinition customMatcherDefinition;\n  private final ValueMatcher<Request> matcher;\n  private final ValueMatcher<Request> inlineCustomMatcher;\n\n  @JsonCreator\n  public RequestPattern(\n      @JsonProperty(\"scheme\") String scheme,\n      @JsonProperty(\"host\") StringValuePattern host,\n      @JsonProperty(\"port\") Integer port,\n      @JsonProperty(\"url\") String url,\n      @JsonProperty(\"clientIp\") StringValuePattern clientIp,\n      @JsonProperty(\"urlPattern\") String urlPattern,\n      @JsonProperty(\"urlPath\") String urlPath,\n      @JsonProperty(\"urlPathPattern\") String urlPathPattern,\n      @JsonProperty(\"urlPathTemplate\") String urlPathTemplate,\n      @JsonProperty(\"method\") RequestMethod method,\n      @JsonProperty(\"headers\") Map<String, MultiValuePattern> headers,\n      @JsonProperty(\"pathParameters\") Map<String, StringValuePattern> pathParams,\n      @JsonProperty(\"queryParameters\") Map<String, MultiValuePattern> queryParams,\n      @JsonProperty(\"formParameters\") Map<String, MultiValuePattern> formParams,\n      @JsonProperty(\"cookies\") Map<String, StringValuePattern> cookies,\n      @JsonProperty(\"basicAuth\") BasicCredentials basicAuthCredentials,\n      @JsonProperty(\"bodyPatterns\") List<ContentPattern<?>> bodyPatterns,\n      @JsonProperty(\"customMatcher\") CustomMatcherDefinition customMatcherDefinition,\n      @JsonProperty(\"multipartPatterns\") List<MultipartValuePattern> multiPattern) {\n\n    this(\n        scheme,\n        host,\n        port,\n        clientIp,\n        UrlPattern.fromOneOf(url, urlPattern, urlPath, urlPathPattern, urlPathTemplate),\n        method,\n        headers,\n        pathParams,\n        queryParams,\n        formParams,\n        cookies,\n        basicAuthCredentials,\n        bodyPatterns,\n        customMatcherDefinition,\n        null,\n        multiPattern);\n  }\n\n  RequestPattern(\n      final String scheme,\n      final StringValuePattern host,\n      final Integer port,\n      final StringValuePattern clientIp,\n      final UrlPattern url,\n      final RequestMethod method,\n      final Map<String, MultiValuePattern> headers,\n      final Map<String, StringValuePattern> pathParams,\n      final Map<String, MultiValuePattern> queryParams,\n      final Map<String, MultiValuePattern> formParams,\n      final Map<String, StringValuePattern> cookies,\n      final BasicCredentials basicAuthCredentials,\n      final List<ContentPattern<?>> bodyPatterns,\n      final CustomMatcherDefinition customMatcherDefinition,\n      final ValueMatcher<Request> customMatcher,\n      final List<MultipartValuePattern> multiPattern) {\n    this.scheme = scheme;\n    this.host = host;\n    this.port = port;\n    this.clientIp = clientIp;\n    this.url = getFirstNonNull(url, UrlPattern.ANY);\n    this.method = getFirstNonNull(method, RequestMethod.ANY);\n    this.headers = headers != null ? ImmutableMap.copyOf(headers) : Map.of();\n    this.pathParams = pathParams != null ? ImmutableMap.copyOf(pathParams) : Map.of();\n    this.formParams = formParams != null ? ImmutableMap.copyOf(formParams) : Map.of();\n    this.queryParams = queryParams != null ? ImmutableMap.copyOf(queryParams) : Map.of();\n    this.cookies = cookies != null ? ImmutableMap.copyOf(cookies) : Map.of();\n    this.basicAuthCredentials = basicAuthCredentials;\n    this.bodyPatterns = bodyPatterns != null ? List.copyOf(bodyPatterns) : List.of();\n    this.customMatcherDefinition = customMatcherDefinition;\n    this.multipartPatterns = multiPattern != null ? List.copyOf(multiPattern) : List.of();\n    this.inlineCustomMatcher = customMatcher;\n\n    this.matcher =\n        new RequestMatcher() {\n          @Override\n          public MatchResult match(Request request) {\n            final List<WeightedMatchResult> requestPartMatchResults = new ArrayList<>(15);\n\n            requestPartMatchResults.add(weight(schemeMatches(request), 3.0));\n            requestPartMatchResults.add(weight(hostMatches(request), 10.0));\n            requestPartMatchResults.add(weight(portMatches(request), 10.0));\n            requestPartMatchResults.add(weight(clientIpMatches(request), 3.0));\n            requestPartMatchResults.add(\n                weight(\n                    RequestPattern.this.url.match(\n                        request.getPathAndQueryWithoutPrefix().toString()),\n                    10.0));\n            requestPartMatchResults.add(\n                weight(RequestPattern.this.method.match(request.getMethod()), 3.0));\n\n            MatchResult matchResult =\n                new MemoizingMatchResult(MatchResult.aggregateWeighted(requestPartMatchResults));\n\n            if (!matchResult.isExactMatch()) {\n              return matchResult;\n            }\n\n            requestPartMatchResults.add(weight(allPathParamsMatch(request)));\n            requestPartMatchResults.add(weight(allHeadersMatchResult(request)));\n            requestPartMatchResults.add(weight(allQueryParamsMatch(request)));\n            requestPartMatchResults.add(weight(allFormParamsMatch(request)));\n            requestPartMatchResults.add(weight(allCookiesMatch(request)));\n            requestPartMatchResults.add(weight(allBodyPatternsMatch(request)));\n            requestPartMatchResults.add(weight(allMultipartPatternsMatch(request)));\n\n            matchResult =\n                new MemoizingMatchResult(MatchResult.aggregateWeighted(requestPartMatchResults));\n            if (!matchResult.isExactMatch() || customMatcher == null) {\n              return matchResult;\n            }\n\n            requestPartMatchResults.add(weight(customMatcher.match(request)));\n            return new MemoizingMatchResult(MatchResult.aggregateWeighted(requestPartMatchResults));\n          }\n\n          @Override\n          public String getName() {\n            return \"request-matcher\";\n          }\n        };\n  }\n\n  public static final RequestPattern ANYTHING =\n      newRequestPattern(RequestMethod.ANY, anyUrl()).build();\n\n  public RequestPattern transform(Consumer<Builder> transformer) {\n    final RequestPattern.Builder builder = toBuilder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public Builder toBuilder() {\n    return new RequestPattern.Builder(this);\n  }\n\n  @Override\n  public MatchResult match(Request request) {\n    return match(request, Collections.emptyMap());\n  }\n\n  public MatchResult match(Request request, Map<String, RequestMatcherExtension> customMatchers) {\n    request = RequestPathParamsDecorator.decorate(request, this);\n    final MatchResult standardMatchResult = matcher.match(request);\n    if (standardMatchResult.isExactMatch() && customMatcherDefinition != null) {\n      RequestMatcherExtension requestMatcher =\n          getFirstNonNull(customMatchers.get(customMatcherDefinition.getName()), NEVER);\n\n      MatchResult customMatchResult =\n          requestMatcher.match(request, customMatcherDefinition.getParameters());\n\n      return MatchResult.aggregate(standardMatchResult, customMatchResult);\n    }\n\n    return standardMatchResult;\n  }\n\n  private MatchResult allCookiesMatch(final Request request) {\n    if (!cookies.isEmpty()) {\n      return MatchResult.aggregate(\n          cookies.entrySet().stream()\n              .map(\n                  entry -> {\n                    final StringValuePattern cookiePattern = entry.getValue();\n                    Cookie cookie = request.getCookies().get(entry.getKey());\n                    if (cookie == null) {\n                      return cookiePattern.nullSafeIsAbsent()\n                          ? MatchResult.exactMatch()\n                          : MatchResult.noMatch();\n                    }\n\n                    return cookie.getValues().stream()\n                        .map(cookiePattern::match)\n                        .max(Comparator.naturalOrder())\n                        .orElseGet(MatchResult::noMatch);\n                  })\n              .collect(toList()));\n    }\n\n    return MatchResult.exactMatch();\n  }\n\n  private MatchResult schemeMatches(final Request request) {\n    return scheme != null\n        ? MatchResult.of(scheme.equals(request.getScheme()))\n        : MatchResult.exactMatch();\n  }\n\n  private MatchResult hostMatches(final Request request) {\n    return host != null ? host.match(request.getHost()) : MatchResult.exactMatch();\n  }\n\n  private MatchResult portMatches(final Request request) {\n    return port != null ? MatchResult.of(request.getPort() == port) : MatchResult.exactMatch();\n  }\n\n  private MatchResult clientIpMatches(final Request request) {\n    return clientIp != null ? clientIp.match(request.getClientIp()) : MatchResult.exactMatch();\n  }\n\n  private MatchResult allHeadersMatchResult(final Request request) {\n    Map<String, MultiValuePattern> combinedHeaders = combineBasicAuthAndOtherHeaders();\n\n    if (combinedHeaders != null && !combinedHeaders.isEmpty()) {\n      return MatchResult.aggregate(\n          combinedHeaders.entrySet().stream()\n              .map(\n                  headerPattern ->\n                      headerPattern.getValue().match(request.header(headerPattern.getKey())))\n              .collect(toList()));\n    }\n\n    return MatchResult.exactMatch();\n  }\n\n  public Map<String, MultiValuePattern> combineBasicAuthAndOtherHeaders() {\n    if (basicAuthCredentials == null) {\n      return headers;\n    }\n\n    Map<String, MultiValuePattern> combinedHeaders = headers;\n    Map<String, MultiValuePattern> allHeadersBuilder =\n        new HashMap<>(getFirstNonNull(combinedHeaders, Collections.emptyMap()));\n    allHeadersBuilder.put(AUTHORIZATION, basicAuthCredentials.asAuthorizationMultiValuePattern());\n    combinedHeaders = allHeadersBuilder;\n    return combinedHeaders;\n  }\n\n  private MatchResult allQueryParamsMatch(final Request request) {\n    if (!queryParams.isEmpty()) {\n      return MatchResult.aggregate(\n          queryParams.entrySet().stream()\n              .map(\n                  queryParamPattern -> {\n                    Query query = request.getPathAndQueryWithoutPrefix().getQueryOrEmpty();\n                    String key = queryParamPattern.getKey();\n                    QueryParameter queryParameter = new QueryParameter(key, query.getDecoded(key));\n                    return queryParamPattern.getValue().match(queryParameter);\n                  })\n              .collect(toList()));\n    }\n\n    return MatchResult.exactMatch();\n  }\n\n  private MatchResult allFormParamsMatch(final Request request) {\n    if (!formParams.isEmpty()) {\n      return MatchResult.aggregate(\n          formParams.entrySet().stream()\n              .map(\n                  formParamPattern ->\n                      formParamPattern\n                          .getValue()\n                          .match(request.formParameter(formParamPattern.getKey())))\n              .collect(toList()));\n    }\n\n    return MatchResult.exactMatch();\n  }\n\n  private MatchResult allPathParamsMatch(final Request request) {\n    if (url.getClass().equals(UrlPathTemplatePattern.class) && !pathParams.isEmpty()) {\n      final UrlPathTemplatePattern urlPathTemplatePattern = (UrlPathTemplatePattern) url;\n      final PathTemplate pathTemplate = urlPathTemplatePattern.getPathTemplate();\n      if (!pathTemplate.matches(request.getPathAndQueryWithoutPrefix().getPath())) {\n        return MatchResult.noMatch();\n      }\n\n      final PathParams requestPathParams =\n          pathTemplate.parse(request.getPathAndQueryWithoutPrefix().getPath());\n      return MatchResult.aggregate(\n          pathParams.entrySet().stream()\n              .map(entry -> entry.getValue().match(requestPathParams.get(entry.getKey())))\n              .collect(toList()));\n    }\n\n    return MatchResult.exactMatch();\n  }\n\n  @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n  private MatchResult allBodyPatternsMatch(final Request request) {\n    if (!bodyPatterns.isEmpty() && request.getBody() != null) {\n      return MatchResult.aggregate(\n          bodyPatterns.stream()\n              .map(\n                  (Function<ContentPattern, MatchResult>)\n                      pattern -> {\n                        if (StringValuePattern.class.isAssignableFrom(pattern.getClass())) {\n                          String body =\n                              isEmpty(request.getBodyAsString()) ? null : request.getBodyAsString();\n                          return pattern.match(body);\n                        }\n\n                        return pattern.match(request.getBody());\n                      })\n              .collect(toList()));\n    }\n\n    return MatchResult.exactMatch();\n  }\n\n  private MatchResult allMultipartPatternsMatch(final Request request) {\n    if (!multipartPatterns.isEmpty()) {\n      if (!request.isMultipart()) {\n        return MatchResult.noMatch();\n      }\n      return MatchResult.aggregate(\n          multipartPatterns.stream().map(pattern -> pattern.match(request)).collect(toList()));\n    }\n\n    return MatchResult.exactMatch();\n  }\n\n  public boolean isMatchedBy(Request request, Map<String, RequestMatcherExtension> customMatchers) {\n    return match(request, customMatchers).isExactMatch();\n  }\n\n  public String getScheme() {\n    return scheme;\n  }\n\n  public StringValuePattern getHost() {\n    return host;\n  }\n\n  public Integer getPort() {\n    return port;\n  }\n\n  public StringValuePattern getClientIp() {\n    return clientIp;\n  }\n\n  public String getUrl() {\n    return urlPatternOrNull(UrlPattern.class, false);\n  }\n\n  public String getUrlPattern() {\n    return urlPatternOrNull(UrlPattern.class, true);\n  }\n\n  public String getUrlPath() {\n    return urlPatternOrNull(UrlPathPattern.class, false);\n  }\n\n  public String getUrlPathPattern() {\n    return urlPatternOrNull(UrlPathPattern.class, true);\n  }\n\n  public String getUrlPathTemplate() {\n    return urlPatternOrNull(UrlPathTemplatePattern.class, false);\n  }\n\n  @JsonIgnore\n  public UrlPattern getUrlMatcher() {\n    return url;\n  }\n\n  private String urlPatternOrNull(Class<? extends UrlPattern> clazz, boolean regex) {\n    return (url != null\n            && url.getClass().equals(clazz)\n            && url.isRegex() == regex\n            && url.isSpecified())\n        ? url.getPattern().getValue()\n        : null;\n  }\n\n  public RequestMethod getMethod() {\n    return method;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public Map<String, MultiValuePattern> getHeaders() {\n    return headers;\n  }\n\n  public BasicCredentials getBasicAuthCredentials() {\n    return basicAuthCredentials;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public Map<String, StringValuePattern> getPathParameters() {\n    return pathParams;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public Map<String, MultiValuePattern> getQueryParameters() {\n    return queryParams;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public Map<String, MultiValuePattern> getFormParameters() {\n    return formParams;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public Map<String, StringValuePattern> getCookies() {\n    return cookies;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public List<ContentPattern<?>> getBodyPatterns() {\n    return bodyPatterns;\n  }\n\n  public CustomMatcherDefinition getCustomMatcher() {\n    return customMatcherDefinition;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public List<MultipartValuePattern> getMultipartPatterns() {\n    return multipartPatterns;\n  }\n\n  @JsonIgnore\n  public ValueMatcher<Request> getInlineCustomMatcher() {\n    return inlineCustomMatcher;\n  }\n\n  @Override\n  public String getName() {\n    return \"requestMatching\";\n  }\n\n  @Override\n  public String getExpected() {\n    return toString();\n  }\n\n  public boolean hasInlineCustomMatcher() {\n    return inlineCustomMatcher != null;\n  }\n\n  public boolean hasNamedCustomMatcher() {\n    return customMatcherDefinition != null;\n  }\n\n  public boolean hasCustomMatcher() {\n    return hasInlineCustomMatcher() || hasNamedCustomMatcher();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    RequestPattern that = (RequestPattern) o;\n    return Objects.equals(scheme, that.scheme)\n        && Objects.equals(host, that.host)\n        && Objects.equals(port, that.port)\n        && Objects.equals(clientIp, that.clientIp)\n        && Objects.equals(url, that.url)\n        && Objects.equals(method, that.method)\n        && Objects.equals(headers, that.headers)\n        && Objects.equals(pathParams, that.pathParams)\n        && Objects.equals(queryParams, that.queryParams)\n        && Objects.equals(formParams, that.formParams)\n        && Objects.equals(cookies, that.cookies)\n        && Objects.equals(basicAuthCredentials, that.basicAuthCredentials)\n        && Objects.equals(bodyPatterns, that.bodyPatterns)\n        && Objects.equals(multipartPatterns, that.multipartPatterns)\n        && Objects.equals(customMatcherDefinition, that.customMatcherDefinition)\n        && Objects.equals(inlineCustomMatcher, that.inlineCustomMatcher);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(\n        scheme,\n        host,\n        port,\n        clientIp,\n        url,\n        method,\n        headers,\n        pathParams,\n        queryParams,\n        formParams,\n        cookies,\n        basicAuthCredentials,\n        bodyPatterns,\n        multipartPatterns,\n        customMatcherDefinition,\n        inlineCustomMatcher);\n  }\n\n  @Override\n  public String toString() {\n    return Json.write(this);\n  }\n\n  public static Predicate<Request> thatMatch(final RequestPattern pattern) {\n    return thatMatch(pattern, Collections.emptyMap());\n  }\n\n  public static Predicate<Request> thatMatch(\n      final RequestPattern pattern, final Map<String, RequestMatcherExtension> customMatchers) {\n    return request -> pattern.match(request, customMatchers).isExactMatch();\n  }\n\n  public static Predicate<ServeEvent> withRequestMatching(final RequestPattern pattern) {\n    return serveEvent -> pattern.match(serveEvent.getRequest()).isExactMatch();\n  }\n\n  public static Predicate<ServeEvent> withRequestMatching(\n      final RequestPattern pattern, final Map<String, RequestMatcherExtension> customMatchers) {\n    return serveEvent -> pattern.match(serveEvent.getRequest(), customMatchers).isExactMatch();\n  }\n\n  @SuppressWarnings(\"UnusedReturnValue\")\n  public static class Builder {\n    private String scheme;\n    private StringValuePattern host;\n    private Integer port;\n    private StringValuePattern clientIp;\n    private UrlPattern url;\n    private RequestMethod method;\n    @NonNull private Map<String, MultiValuePattern> headers = new LinkedHashMap<>();\n\n    @NonNull private Map<String, StringValuePattern> pathParams = new LinkedHashMap<>();\n    @NonNull private Map<String, MultiValuePattern> queryParams = new LinkedHashMap<>();\n    @NonNull private Map<String, MultiValuePattern> formParams = new LinkedHashMap<>();\n    @NonNull private Map<String, StringValuePattern> cookies = new LinkedHashMap<>();\n    private BasicCredentials basicAuthCredentials;\n    @NonNull private List<ContentPattern<?>> bodyPatterns = new ArrayList<>();\n    @NonNull private List<MultipartValuePattern> multipartPatterns = new ArrayList<>();\n\n    private CustomMatcherDefinition customMatcherDefinition;\n    private ValueMatcher<Request> inlineCustomMatcher;\n\n    public Builder() {}\n\n    public Builder(RequestPattern existing) {\n      this.scheme = existing.getScheme();\n      this.host = existing.getHost();\n      this.port = existing.getPort();\n      this.clientIp = existing.getClientIp();\n      this.url = existing.getUrlMatcher();\n      this.method = existing.getMethod();\n      this.headers.putAll(existing.getHeaders());\n      this.pathParams.putAll(existing.getPathParameters());\n      this.queryParams.putAll(existing.getQueryParameters());\n      this.formParams.putAll(existing.getFormParameters());\n      this.cookies.putAll(existing.getCookies());\n      this.basicAuthCredentials = existing.getBasicAuthCredentials();\n      this.bodyPatterns.addAll(existing.getBodyPatterns());\n      this.multipartPatterns.addAll(existing.getMultipartPatterns());\n      this.customMatcherDefinition = existing.getCustomMatcher();\n      this.inlineCustomMatcher = existing.getInlineCustomMatcher();\n    }\n\n    public String getScheme() {\n      return scheme;\n    }\n\n    public StringValuePattern getHost() {\n      return host;\n    }\n\n    public Integer getPort() {\n      return port;\n    }\n\n    public StringValuePattern getClientIp() {\n      return clientIp;\n    }\n\n    public UrlPattern getUrl() {\n      return url;\n    }\n\n    public RequestMethod getMethod() {\n      return method;\n    }\n\n    @NonNull\n    public Map<String, MultiValuePattern> getHeaders() {\n      return headers;\n    }\n\n    @NonNull\n    public Map<String, StringValuePattern> getPathParams() {\n      return pathParams;\n    }\n\n    @NonNull\n    public Map<String, MultiValuePattern> getQueryParams() {\n      return queryParams;\n    }\n\n    @NonNull\n    public Map<String, MultiValuePattern> getFormParams() {\n      return formParams;\n    }\n\n    @NonNull\n    public Map<String, StringValuePattern> getCookies() {\n      return cookies;\n    }\n\n    public BasicCredentials getBasicAuthCredentials() {\n      return basicAuthCredentials;\n    }\n\n    @NonNull\n    public List<ContentPattern<?>> getBodyPatterns() {\n      return bodyPatterns;\n    }\n\n    @NonNull\n    public List<MultipartValuePattern> getMultipartPatterns() {\n      return multipartPatterns;\n    }\n\n    public CustomMatcherDefinition getCustomMatcherDefinition() {\n      return customMatcherDefinition;\n    }\n\n    public ValueMatcher<Request> getInlineCustomMatcher() {\n      return inlineCustomMatcher;\n    }\n\n    public Builder setScheme(String scheme) {\n      this.scheme = scheme;\n      return this;\n    }\n\n    public Builder setHost(StringValuePattern host) {\n      this.host = host;\n      return this;\n    }\n\n    public Builder setPort(Integer port) {\n      this.port = port;\n      return this;\n    }\n\n    public Builder setClientIp(StringValuePattern clientIp) {\n      this.clientIp = clientIp;\n      return this;\n    }\n\n    public Builder setUrl(UrlPattern url) {\n      this.url = url;\n      return this;\n    }\n\n    public Builder setMethod(RequestMethod method) {\n      this.method = method;\n      return this;\n    }\n\n    public Builder setHeaders(@NonNull Map<String, MultiValuePattern> headers) {\n      Objects.requireNonNull(headers);\n      this.headers = headers;\n      return this;\n    }\n\n    public Builder setPathParams(@NonNull Map<String, StringValuePattern> pathParams) {\n      Objects.requireNonNull(pathParams);\n      this.pathParams = pathParams;\n      return this;\n    }\n\n    public Builder setQueryParams(@NonNull Map<String, MultiValuePattern> queryParams) {\n      Objects.requireNonNull(queryParams);\n      this.queryParams = queryParams;\n      return this;\n    }\n\n    public Builder setFormParams(@NonNull Map<String, MultiValuePattern> formParams) {\n      Objects.requireNonNull(formParams);\n      this.formParams = formParams;\n      return this;\n    }\n\n    public Builder setCookies(@NonNull Map<String, StringValuePattern> cookies) {\n      Objects.requireNonNull(cookies);\n      this.cookies = cookies;\n      return this;\n    }\n\n    public Builder setBasicAuthCredentials(BasicCredentials basicAuthCredentials) {\n      this.basicAuthCredentials = basicAuthCredentials;\n      return this;\n    }\n\n    public Builder setBodyPatterns(@NonNull List<ContentPattern<?>> bodyPatterns) {\n      Objects.requireNonNull(bodyPatterns);\n      this.bodyPatterns = bodyPatterns;\n      return this;\n    }\n\n    public Builder setMultipartPatterns(@NonNull List<MultipartValuePattern> multipartPatterns) {\n      Objects.requireNonNull(multipartPatterns);\n      this.multipartPatterns = multipartPatterns;\n      return this;\n    }\n\n    public Builder setCustomMatcherDefinition(CustomMatcherDefinition customMatcherDefinition) {\n      this.customMatcherDefinition = customMatcherDefinition;\n      return this;\n    }\n\n    public Builder setInlineCustomMatcher(ValueMatcher<Request> matcher) {\n      this.inlineCustomMatcher = matcher;\n      return this;\n    }\n\n    public RequestPattern build() {\n      if (!(url instanceof UrlPathTemplatePattern) && !pathParams.isEmpty()) {\n        throw new InvalidInputException(\n            Errors.single(\n                19, \"URL path parameters specified without a path template as the URL matcher\"));\n      }\n\n      return new RequestPattern(\n          scheme,\n          host,\n          port,\n          clientIp,\n          url,\n          method,\n          headers,\n          pathParams,\n          queryParams,\n          formParams,\n          cookies,\n          basicAuthCredentials,\n          bodyPatterns,\n          customMatcherDefinition,\n          inlineCustomMatcher,\n          multipartPatterns);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/RequestPatternBuilder.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.github.tomakehurst.wiremock.client.BasicCredentials;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern.Builder;\n\n@SuppressWarnings(\"UnusedReturnValue\")\npublic class RequestPatternBuilder {\n\n  private final RequestPattern.Builder builder;\n\n  public RequestPatternBuilder() {\n    this(new RequestPattern.Builder());\n  }\n\n  public RequestPatternBuilder(ValueMatcher<Request> customMatcher) {\n    this();\n    builder.setInlineCustomMatcher(customMatcher);\n  }\n\n  public RequestPatternBuilder(RequestMethod method, UrlPattern url) {\n    this();\n    builder.setMethod(method);\n    builder.setUrl(url);\n  }\n\n  public RequestPatternBuilder(String customRequestMatcherName, Parameters parameters) {\n    this();\n    builder.setCustomMatcherDefinition(\n        new CustomMatcherDefinition(customRequestMatcherName, parameters));\n  }\n\n  private RequestPatternBuilder(Builder builder) {\n    this.builder = builder;\n  }\n\n  public static RequestPatternBuilder newRequestPattern(RequestMethod method, UrlPattern url) {\n    return new RequestPatternBuilder(method, url);\n  }\n\n  public static RequestPatternBuilder newRequestPattern() {\n    return new RequestPatternBuilder();\n  }\n\n  public static RequestPatternBuilder forCustomMatcher(ValueMatcher<Request> requestMatcher) {\n    return new RequestPatternBuilder(requestMatcher);\n  }\n\n  public static RequestPatternBuilder forCustomMatcher(\n      String customRequestMatcherName, Parameters parameters) {\n    return new RequestPatternBuilder(customRequestMatcherName, parameters);\n  }\n\n  public static RequestPatternBuilder allRequests() {\n    return new RequestPatternBuilder(RequestMethod.ANY, WireMock.anyUrl());\n  }\n\n  /**\n   * Construct a builder that uses an existing RequestPattern as a template\n   *\n   * @param requestPattern A RequestPattern to copy\n   * @return A builder based on the RequestPattern\n   * @deprecated use RequestPattern.transform() instead\n   */\n  @Deprecated\n  public static RequestPatternBuilder like(RequestPattern requestPattern) {\n    return new RequestPatternBuilder(requestPattern.toBuilder());\n  }\n\n  /**\n   * @deprecated intended for use with now-deprecated like() method. Use RequestPattern.transform()\n   *     instead.\n   */\n  @Deprecated\n  public RequestPatternBuilder but() {\n    return this;\n  }\n\n  public RequestPatternBuilder withScheme(String scheme) {\n    builder.setScheme(scheme);\n    return this;\n  }\n\n  public RequestPatternBuilder withHost(StringValuePattern hostPattern) {\n    builder.setHost(hostPattern);\n    return this;\n  }\n\n  public RequestPatternBuilder withPort(int port) {\n    builder.setPort(port);\n    return this;\n  }\n\n  public RequestPatternBuilder withClientIp(StringValuePattern clientIpPattern) {\n    builder.setClientIp(clientIpPattern);\n    return this;\n  }\n\n  public RequestPatternBuilder withUrl(String url) {\n    builder.setUrl(WireMock.urlEqualTo(url));\n    return this;\n  }\n\n  public RequestPatternBuilder withUrl(UrlPattern urlPattern) {\n    builder.setUrl(urlPattern);\n    return this;\n  }\n\n  public RequestPatternBuilder withHeader(String key, StringValuePattern valuePattern) {\n    builder.getHeaders().put(key, MultiValuePattern.of(valuePattern));\n    return this;\n  }\n\n  public RequestPatternBuilder withHeader(String key, MultiValuePattern multiValuePattern) {\n    builder.getHeaders().put(key, multiValuePattern);\n    return this;\n  }\n\n  public RequestPatternBuilder withoutHeader(String key) {\n    builder.getHeaders().put(key, MultiValuePattern.absent());\n    return this;\n  }\n\n  public RequestPatternBuilder withPathParam(String key, StringValuePattern valuePattern) {\n    builder.getPathParams().put(key, valuePattern);\n    return this;\n  }\n\n  public RequestPatternBuilder withQueryParam(String key, StringValuePattern valuePattern) {\n    builder.getQueryParams().put(key, MultiValuePattern.of(valuePattern));\n    return this;\n  }\n\n  public RequestPatternBuilder withQueryParam(String key, MultiValuePattern multiValuePattern) {\n    builder.getQueryParams().put(key, multiValuePattern);\n    return this;\n  }\n\n  public RequestPatternBuilder withFormParam(String key, StringValuePattern valuePattern) {\n    builder.getFormParams().put(key, MultiValuePattern.of(valuePattern));\n    return this;\n  }\n\n  public RequestPatternBuilder withFormParam(String key, MultiValuePattern multiValuePattern) {\n    builder.getFormParams().put(key, multiValuePattern);\n    return this;\n  }\n\n  public RequestPatternBuilder withoutFormParam(String key) {\n    builder.getFormParams().put(key, MultiValuePattern.absent());\n    return this;\n  }\n\n  public RequestPatternBuilder withoutQueryParam(String key) {\n    builder.getQueryParams().put(key, MultiValuePattern.absent());\n    return this;\n  }\n\n  public RequestPatternBuilder withCookie(String key, StringValuePattern valuePattern) {\n    builder.getCookies().put(key, valuePattern);\n    return this;\n  }\n\n  public RequestPatternBuilder withBasicAuth(BasicCredentials basicCredentials) {\n    builder.setBasicAuthCredentials(basicCredentials);\n    return this;\n  }\n\n  public RequestPatternBuilder withRequestBody(ContentPattern valuePattern) {\n    builder.getBodyPatterns().add(valuePattern);\n    return this;\n  }\n\n  public RequestPatternBuilder withRequestBodyPart(MultipartValuePattern multiPattern) {\n    if (multiPattern != null) {\n      builder.getMultipartPatterns().add(multiPattern);\n    }\n    return this;\n  }\n\n  public RequestPatternBuilder withAnyRequestBodyPart(\n      MultipartValuePatternBuilder multiPatternBuilder) {\n    return withRequestBodyPart(\n        multiPatternBuilder.matchingType(MultipartValuePattern.MatchingType.ANY).build());\n  }\n\n  public RequestPatternBuilder withAllRequestBodyParts(\n      MultipartValuePatternBuilder multiPatternBuilder) {\n    return withRequestBodyPart(\n        multiPatternBuilder.matchingType(MultipartValuePattern.MatchingType.ALL).build());\n  }\n\n  public RequestPatternBuilder andMatching(ValueMatcher<Request> customMatcher) {\n    builder.setInlineCustomMatcher(customMatcher);\n    return this;\n  }\n\n  public RequestPatternBuilder andMatching(String customRequestMatcherName) {\n    return andMatching(customRequestMatcherName, Parameters.empty());\n  }\n\n  public RequestPatternBuilder andMatching(String customRequestMatcherName, Parameters parameters) {\n    return andMatching(new CustomMatcherDefinition(customRequestMatcherName, parameters));\n  }\n\n  public RequestPatternBuilder andMatching(CustomMatcherDefinition matcherDefinition) {\n    builder.setCustomMatcherDefinition(matcherDefinition);\n    return this;\n  }\n\n  public RequestPatternBuilder clearQueryParams() {\n    builder.getQueryParams().clear();\n    return this;\n  }\n\n  public RequestPatternBuilder clearFormParams() {\n    builder.getFormParams().clear();\n    return this;\n  }\n\n  public RequestPatternBuilder clearBodyPatterns() {\n    builder.getBodyPatterns().clear();\n    return this;\n  }\n\n  public RequestPattern build() {\n    return builder.build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/SingleMatchMultiValuePattern.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static java.util.Collections.singletonList;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonValue;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.http.MultiValue;\nimport java.util.List;\nimport java.util.Objects;\n\n@JsonDeserialize(as = SingleMatchMultiValuePattern.class)\npublic class SingleMatchMultiValuePattern extends MultiValuePattern {\n\n  private final StringValuePattern valuePattern;\n\n  @JsonCreator\n  public SingleMatchMultiValuePattern(StringValuePattern valuePattern) {\n    this.valuePattern = valuePattern;\n  }\n\n  @Override\n  public MatchResult match(MultiValue multiValue) {\n    List<String> values = multiValue.isPresent() ? multiValue.values() : singletonList(null);\n    return getBestMatch(valuePattern, values);\n  }\n\n  @JsonValue\n  public StringValuePattern getValuePattern() {\n    return valuePattern;\n  }\n\n  @Override\n  public String getName() {\n    return valuePattern.getName();\n  }\n\n  @Override\n  public String getExpected() {\n    return valuePattern.getExpected();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) {\n      return true;\n    }\n    if (o == null || getClass() != o.getClass()) {\n      return false;\n    }\n    SingleMatchMultiValuePattern that = (SingleMatchMultiValuePattern) o;\n    return Objects.equals(valuePattern, that.valuePattern);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(valuePattern);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/StringValuePattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport java.lang.reflect.Constructor;\nimport java.util.Arrays;\nimport java.util.Objects;\n\n@JsonDeserialize(using = StringValuePatternJsonDeserializer.class)\npublic abstract class StringValuePattern extends ContentPattern<String> {\n\n  protected StringValuePattern(String expectedValue) {\n    super(expectedValue);\n  }\n\n  @JsonIgnore\n  public boolean isPresent() {\n    return !nullSafeIsAbsent();\n  }\n\n  public Boolean isAbsent() {\n    return !nullSafeIsAbsent() ? null : true;\n  }\n\n  @JsonIgnore\n  public boolean nullSafeIsAbsent() {\n    return false;\n  }\n\n  @Override\n  public String toString() {\n    return getName() + \" \" + getValue();\n  }\n\n  public final String getName() {\n    Constructor<?> constructor =\n        Arrays.stream(this.getClass().getDeclaredConstructors())\n            .filter(\n                input ->\n                    input.getParameterAnnotations().length > 0\n                        && input.getParameterAnnotations()[0].length > 0\n                        && input.getParameterAnnotations()[0][0] instanceof JsonProperty)\n            .findFirst()\n            .orElseThrow(\n                () ->\n                    new IllegalStateException(\n                        \"Constructor must have a first parameter annotated with JsonProperty(\\\"<operator name>\\\")\"));\n\n    JsonProperty jsonPropertyAnnotation =\n        (JsonProperty) constructor.getParameterAnnotations()[0][0];\n    return jsonPropertyAnnotation.value();\n  }\n\n  @Override\n  public String getExpected() {\n    return getValue();\n  }\n\n  public LogicalAnd and(StringValuePattern other) {\n    return new LogicalAnd(this, other);\n  }\n\n  public LogicalOr or(StringValuePattern other) {\n    return new LogicalOr(this, other);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    StringValuePattern that = (StringValuePattern) o;\n    return Objects.equals(expectedValue, that.expectedValue);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(expectedValue);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/StringValuePatternJsonDeserializer.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.core.type.TypeReference;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.JsonMappingException;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.tomakehurst.wiremock.client.WireMock.JsonSchemaVersion;\nimport com.github.tomakehurst.wiremock.common.DateTimeUnit;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.io.IOException;\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.InvocationTargetException;\nimport java.lang.reflect.Parameter;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.Iterator;\nimport java.util.LinkedHashMap;\nimport java.util.LinkedHashSet;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.NoSuchElementException;\nimport java.util.Optional;\nimport java.util.Set;\nimport org.xmlunit.diff.ComparisonType;\n\npublic class StringValuePatternJsonDeserializer extends JsonDeserializer<StringValuePattern> {\n\n  private static final Map<String, Class<? extends StringValuePattern>> PATTERNS =\n      Map.ofEntries(\n          Map.entry(\"equalTo\", EqualToPattern.class),\n          Map.entry(\"equalToNumber\", EqualToNumberPattern.class),\n          Map.entry(\"equalToJson\", EqualToJsonPattern.class),\n          Map.entry(\"matchesJsonPath\", MatchesJsonPathPattern.class),\n          Map.entry(\"matchesJsonSchema\", MatchesJsonSchemaPattern.class),\n          Map.entry(\"equalToXml\", EqualToXmlPattern.class),\n          Map.entry(\"matchesXPath\", MatchesXPathPattern.class),\n          Map.entry(\"contains\", ContainsPattern.class),\n          Map.entry(\"not\", NotPattern.class),\n          Map.entry(\"doesNotContain\", NegativeContainsPattern.class),\n          Map.entry(\"matches\", RegexPattern.class),\n          Map.entry(\"doesNotMatch\", NegativeRegexPattern.class),\n          Map.entry(\"before\", BeforeDateTimePattern.class),\n          Map.entry(\"after\", AfterDateTimePattern.class),\n          Map.entry(\"equalToDateTime\", EqualToDateTimePattern.class),\n          Map.entry(\"anything\", AnythingPattern.class),\n          Map.entry(\"absent\", AbsentPattern.class),\n          Map.entry(\"and\", LogicalAnd.class),\n          Map.entry(\"or\", LogicalOr.class),\n          Map.entry(\"matchesPathTemplate\", PathTemplatePattern.class),\n          Map.entry(\"greaterThanNumber\", GreaterThanNumberPattern.class),\n          Map.entry(\"greaterThanEqualNumber\", GreaterThanEqualNumberPattern.class),\n          Map.entry(\"lessThanNumber\", LessThanNumberPattern.class),\n          Map.entry(\"lessThanEqualNumber\", LessThanEqualNumberPattern.class));\n\n  private static Map.Entry<String, JsonNode> findMainFieldEntry(JsonNode rootNode) {\n    List<Map.Entry<String, JsonNode>> list = getListFromNode(rootNode);\n    return list.stream()\n        .filter(input -> PATTERNS.containsKey(input.getKey()))\n        .findFirst()\n        .orElseThrow(NoSuchElementException::new);\n  }\n\n  private static EqualToXmlPattern.NamespaceAwareness deserializeNamespaceAwareness(\n      JsonNode rootNode) {\n    String namespaceAwarenessString =\n        fromNullableTextNode(rootNode.findValue(\"namespaceAwareness\"));\n    return namespaceAwarenessString == null\n        ? null\n        : EqualToXmlPattern.NamespaceAwareness.valueOf(namespaceAwarenessString);\n  }\n\n  private static Map<String, String> toNamespaceMap(JsonNode namespacesNode) {\n    Map<String, String> map = new LinkedHashMap<>();\n    for (Iterator<Map.Entry<String, JsonNode>> fields = namespacesNode.fields();\n        fields.hasNext(); ) {\n      Map.Entry<String, JsonNode> field = fields.next();\n      map.put(field.getKey(), field.getValue().textValue());\n    }\n\n    return map;\n  }\n\n  private static Boolean fromNullable(JsonNode node) {\n    return node == null ? null : node.asBoolean();\n  }\n\n  private static String fromNullableTextNode(JsonNode node) {\n    return node == null ? null : node.asText();\n  }\n\n  private static Set<ComparisonType> comparisonTypeSetFromArray(JsonNode node) {\n    if (node == null || !node.isArray()) {\n      return null;\n    }\n\n    Set<ComparisonType> comparisonTypes = new LinkedHashSet<>();\n    for (JsonNode itemNode : node) {\n      comparisonTypes.add(ComparisonType.valueOf(itemNode.textValue()));\n    }\n\n    return comparisonTypes;\n  }\n\n  private static Constructor<? extends StringValuePattern> findConstructor(\n      Class<? extends StringValuePattern> clazz) {\n    return findConstructor(clazz, String.class);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private static Constructor<? extends StringValuePattern> findConstructor(\n      Class<? extends StringValuePattern> clazz, Class<?> parameterType) {\n    Optional<Constructor<?>> optionalConstructor =\n        Arrays.stream(clazz.getDeclaredConstructors())\n            .filter(\n                input ->\n                    input.getParameterTypes().length == 1\n                        && input.getGenericParameterTypes()[0].equals(parameterType))\n            .findFirst();\n\n    if (optionalConstructor.isEmpty()) {\n      throw new IllegalStateException(\n          \"Constructor for \"\n              + clazz.getSimpleName()\n              + \" must have a single \"\n              + parameterType.getSimpleName().toLowerCase()\n              + \" argument constructor\");\n    }\n\n    return (Constructor<? extends StringValuePattern>) optionalConstructor.get();\n  }\n\n  @SuppressWarnings(\"OptionalGetWithoutIsPresent\") // exceptions are handled in main try-catch\n  private static String getSingleArgumentConstructorJsonPropertyName(\n      Constructor<? extends StringValuePattern> constructor) {\n    try {\n      Parameter parameter = Arrays.stream(constructor.getParameters()).findFirst().get();\n      return Arrays.stream(parameter.getAnnotationsByType(JsonProperty.class))\n          .findFirst()\n          .get()\n          .value();\n    } catch (Exception e) {\n      throw new IllegalStateException(\n          \"Constructor for \"\n              + constructor.getDeclaringClass().getSimpleName()\n              + \" must have a single argument constructor with @JsonProperty annotation\");\n    }\n  }\n\n  private static Class<? extends StringValuePattern> findPatternClass(JsonNode rootNode)\n      throws JsonMappingException {\n    for (Map.Entry<String, JsonNode> node : getListFromNode(rootNode)) {\n      Class<? extends StringValuePattern> patternClass = PATTERNS.get(node.getKey());\n      if (patternClass != null) {\n        return patternClass;\n      }\n    }\n\n    throw new JsonMappingException(rootNode + \" is not a valid match operation\");\n  }\n\n  private static List<Map.Entry<String, JsonNode>> getListFromNode(JsonNode rootNode) {\n    List<Map.Entry<String, JsonNode>> list = new LinkedList<>();\n    rootNode.fields().forEachRemaining(list::add);\n    return list;\n  }\n\n  @Override\n  public StringValuePattern deserialize(JsonParser parser, DeserializationContext context)\n      throws IOException {\n    JsonNode rootNode = parser.readValueAsTree();\n    return buildStringValuePattern(rootNode);\n  }\n\n  public StringValuePattern buildStringValuePattern(JsonNode rootNode) throws JsonMappingException {\n    Class<? extends StringValuePattern> patternClass = findPatternClass(rootNode);\n    if (patternClass.equals(AbsentPattern.class)) {\n      return AbsentPattern.ABSENT;\n    } else if (patternClass.equals(EqualToJsonPattern.class)) {\n      return deserializeEqualToJson(rootNode);\n    } else if (patternClass.equals(MatchesJsonSchemaPattern.class)) {\n      return deserializeMatchesJsonSchema(rootNode);\n    } else if (patternClass.equals(EqualToXmlPattern.class)) {\n      return deserializeEqualToXml(rootNode);\n    } else if (patternClass.equals(MatchesJsonPathPattern.class)) {\n      return deserialiseMatchesJsonPathPattern(rootNode);\n    } else if (patternClass.equals(MatchesXPathPattern.class)) {\n      return deserialiseMatchesXPathPattern(rootNode);\n    } else if (patternClass.equals(EqualToPattern.class)) {\n      return deserializeEqualTo(rootNode);\n    } else if (AbstractDateTimePattern.class.isAssignableFrom(patternClass)) {\n      final Map.Entry<String, JsonNode> mainFieldEntry = findMainFieldEntry(rootNode);\n      String matcherName = mainFieldEntry.getKey();\n      return deserialiseDateTimePattern(rootNode, matcherName);\n    } else if (AbstractNumberPattern.class.isAssignableFrom(patternClass)) {\n      return deserializeNumberPattern(rootNode, patternClass);\n    } else if (patternClass.equals(LogicalAnd.class)) {\n      return deserializeAnd(rootNode);\n    } else if (patternClass.equals(LogicalOr.class)) {\n      return deserializeOr(rootNode);\n    } else if (patternClass.equals(NotPattern.class)) {\n      return deserializeNot(rootNode);\n    }\n\n    final Map.Entry<String, JsonNode> mainFieldEntry = findMainFieldEntry(rootNode);\n    if (!mainFieldEntry.getValue().isTextual()) {\n      throw new JsonMappingException(\n          mainFieldEntry.getKey() + \" operand must be a non-null string\");\n    }\n    String operand = mainFieldEntry.getValue().textValue();\n    try {\n      Constructor<? extends StringValuePattern> constructor = findConstructor(patternClass);\n      return constructor.newInstance(operand);\n    } catch (Exception e) {\n      return throwUnchecked(e, StringValuePattern.class);\n    }\n  }\n\n  private EqualToPattern deserializeEqualTo(JsonNode rootNode) throws JsonMappingException {\n    if (!rootNode.has(\"equalTo\")) {\n      throw new JsonMappingException(rootNode + \" is not a valid match operation\");\n    }\n\n    JsonNode equalToNode = rootNode.findValue(\"equalTo\");\n    if (!equalToNode.isTextual()) {\n      throw new JsonMappingException(\"equalTo operand must be a non-null string\");\n    }\n\n    String operand = equalToNode.textValue();\n    Boolean ignoreCase = fromNullable(rootNode.findValue(\"caseInsensitive\"));\n\n    return new EqualToPattern(operand, ignoreCase);\n  }\n\n  private EqualToJsonPattern deserializeEqualToJson(JsonNode rootNode) throws JsonMappingException {\n    if (!rootNode.has(\"equalToJson\")) {\n      throw new JsonMappingException(rootNode + \" is not a valid match operation\");\n    }\n\n    JsonNode operand = rootNode.findValue(\"equalToJson\");\n\n    Boolean ignoreArrayOrder = fromNullable(rootNode.findValue(\"ignoreArrayOrder\"));\n    Boolean ignoreExtraElements = fromNullable(rootNode.findValue(\"ignoreExtraElements\"));\n\n    // Allow either a JSON value or a string containing JSON\n    if (operand.isTextual()) {\n      return new EqualToJsonPattern(operand.textValue(), ignoreArrayOrder, ignoreExtraElements);\n    } else {\n      return new EqualToJsonPattern(operand, ignoreArrayOrder, ignoreExtraElements);\n    }\n  }\n\n  private MatchesJsonSchemaPattern deserializeMatchesJsonSchema(JsonNode rootNode)\n      throws JsonMappingException {\n    if (!rootNode.has(\"matchesJsonSchema\")) {\n      throw new JsonMappingException(rootNode + \" is not a valid match operation\");\n    }\n\n    JsonNode operand = rootNode.findValue(\"matchesJsonSchema\");\n\n    JsonSchemaVersion schemaVersion;\n    try {\n      String schemaVersionString = fromNullableTextNode(rootNode.findValue(\"schemaVersion\"));\n      schemaVersion =\n          schemaVersionString != null\n              ? JsonSchemaVersion.valueOf(schemaVersionString)\n              : JsonSchemaVersion.DEFAULT;\n    } catch (Exception e) {\n      throw new JsonMappingException(\n          \"schemaVersion must be one of \" + Json.write(JsonSchemaVersion.values()));\n    }\n\n    // Allow either a JSON value or a string containing JSON\n    if (operand.isTextual()) {\n      return new MatchesJsonSchemaPattern(operand.textValue(), schemaVersion);\n    } else {\n      return new MatchesJsonSchemaPattern(operand, schemaVersion);\n    }\n  }\n\n  private EqualToXmlPattern deserializeEqualToXml(JsonNode rootNode) throws JsonMappingException {\n    if (!rootNode.has(\"equalToXml\")) {\n      throw new JsonMappingException(rootNode + \" is not a valid match operation\");\n    }\n\n    JsonNode operand = rootNode.findValue(\"equalToXml\");\n\n    Boolean enablePlaceholders = fromNullable(rootNode.findValue(\"enablePlaceholders\"));\n    String placeholderOpeningDelimiterRegex =\n        fromNullableTextNode(rootNode.findValue(\"placeholderOpeningDelimiterRegex\"));\n    String placeholderClosingDelimiterRegex =\n        fromNullableTextNode(rootNode.findValue(\"placeholderClosingDelimiterRegex\"));\n    Set<ComparisonType> exemptedComparisons =\n        comparisonTypeSetFromArray(rootNode.findValue(\"exemptedComparisons\"));\n    Boolean ignoreOrderOfSameNode = fromNullable(rootNode.findValue(\"ignoreOrderOfSameNode\"));\n    EqualToXmlPattern.NamespaceAwareness namespaceAwareness =\n        deserializeNamespaceAwareness(rootNode);\n    return new EqualToXmlPattern(\n        operand.textValue(),\n        enablePlaceholders,\n        placeholderOpeningDelimiterRegex,\n        placeholderClosingDelimiterRegex,\n        exemptedComparisons,\n        ignoreOrderOfSameNode,\n        namespaceAwareness);\n  }\n\n  private MatchesJsonPathPattern deserialiseMatchesJsonPathPattern(JsonNode rootNode)\n      throws JsonMappingException {\n    if (!rootNode.has(\"matchesJsonPath\")) {\n      throw new JsonMappingException(rootNode + \" is not a valid match operation\");\n    }\n\n    JsonNode outerPatternNode = rootNode.findValue(\"matchesJsonPath\");\n    if (outerPatternNode.isTextual()) {\n      return new MatchesJsonPathPattern(outerPatternNode.textValue());\n    }\n\n    if (!outerPatternNode.has(\"expression\")) {\n      throw new JsonMappingException(\"expression is required in the advanced matchesJsonPath form\");\n    }\n\n    String expression = outerPatternNode.findValue(\"expression\").textValue();\n    StringValuePattern valuePattern = buildStringValuePattern(outerPatternNode);\n\n    return new MatchesJsonPathPattern(expression, valuePattern);\n  }\n\n  private MatchesXPathPattern deserialiseMatchesXPathPattern(JsonNode rootNode)\n      throws JsonMappingException {\n    if (!rootNode.has(\"matchesXPath\")) {\n      throw new JsonMappingException(rootNode + \" is not a valid match operation\");\n    }\n\n    JsonNode namespacesNode = rootNode.findValue(\"xPathNamespaces\");\n\n    Map<String, String> namespaces =\n        namespacesNode != null ? toNamespaceMap(namespacesNode) : Collections.emptyMap();\n\n    JsonNode outerPatternNode = rootNode.findValue(\"matchesXPath\");\n    if (outerPatternNode.isTextual()) {\n      return new MatchesXPathPattern(outerPatternNode.textValue(), namespaces);\n    }\n\n    if (!outerPatternNode.has(\"expression\")) {\n      throw new JsonMappingException(\"expression is required in the advanced matchesXPath form\");\n    }\n\n    String expression = outerPatternNode.findValue(\"expression\").textValue();\n    StringValuePattern valuePattern = buildStringValuePattern(outerPatternNode);\n\n    return new MatchesXPathPattern(expression, namespaces, valuePattern);\n  }\n\n  private StringValuePattern deserialiseDateTimePattern(JsonNode rootNode, String matcherName)\n      throws JsonMappingException {\n    JsonNode dateTimeNode = rootNode.findValue(matcherName);\n    JsonNode formatNode = rootNode.findValue(\"actualFormat\");\n    JsonNode truncateExpectedNode = rootNode.findValue(\"truncateExpected\");\n    JsonNode truncateActualNode = rootNode.findValue(\"truncateActual\");\n    JsonNode applyTruncationLastNode = rootNode.findValue(\"applyTruncationLast\");\n    JsonNode expectedOffsetAmountNode = rootNode.findValue(\"expectedOffset\");\n    JsonNode expectedOffsetUnitNode = rootNode.findValue(\"expectedOffsetUnit\");\n\n    switch (matcherName) {\n      case \"before\":\n        return new BeforeDateTimePattern(\n            dateTimeNode.textValue(),\n            formatNode != null ? formatNode.textValue() : null,\n            truncateExpectedNode != null ? truncateExpectedNode.textValue() : null,\n            truncateActualNode != null ? truncateActualNode.textValue() : null,\n            applyTruncationLastNode != null && applyTruncationLastNode.booleanValue(),\n            expectedOffsetAmountNode != null ? expectedOffsetAmountNode.intValue() : null,\n            expectedOffsetUnitNode != null\n                ? DateTimeUnit.valueOf(expectedOffsetUnitNode.textValue().toUpperCase())\n                : null);\n      case \"after\":\n        return new AfterDateTimePattern(\n            dateTimeNode.textValue(),\n            formatNode != null ? formatNode.textValue() : null,\n            truncateExpectedNode != null ? truncateExpectedNode.textValue() : null,\n            truncateActualNode != null ? truncateActualNode.textValue() : null,\n            applyTruncationLastNode != null && applyTruncationLastNode.booleanValue(),\n            expectedOffsetAmountNode != null ? expectedOffsetAmountNode.intValue() : null,\n            expectedOffsetUnitNode != null\n                ? DateTimeUnit.valueOf(expectedOffsetUnitNode.textValue().toUpperCase())\n                : null);\n      case \"equalToDateTime\":\n        return new EqualToDateTimePattern(\n            dateTimeNode.textValue(),\n            formatNode != null ? formatNode.textValue() : null,\n            truncateExpectedNode != null ? truncateExpectedNode.textValue() : null,\n            truncateActualNode != null ? truncateActualNode.textValue() : null,\n            applyTruncationLastNode != null && applyTruncationLastNode.booleanValue(),\n            expectedOffsetAmountNode != null ? expectedOffsetAmountNode.intValue() : null,\n            expectedOffsetUnitNode != null\n                ? DateTimeUnit.valueOf(expectedOffsetUnitNode.textValue().toUpperCase())\n                : null);\n      default:\n        throw new JsonMappingException(rootNode + \" is not a valid match operation\");\n    }\n  }\n\n  private static StringValuePattern deserializeNumberPattern(\n      JsonNode rootNode, Class<? extends StringValuePattern> patternClass)\n      throws JsonMappingException {\n    Constructor<? extends StringValuePattern> constructor =\n        findConstructor(patternClass, Number.class);\n    String propertyName = getSingleArgumentConstructorJsonPropertyName(constructor);\n    if (!rootNode.hasNonNull(propertyName)) {\n      throw new JsonMappingException(propertyName + \" has to be a numeric value\");\n    }\n    try {\n      Number propertyValue = Double.parseDouble(rootNode.get(propertyName).asText());\n      return constructor.newInstance(propertyValue);\n    } catch (NumberFormatException\n        | InstantiationException\n        | IllegalAccessException\n        | InvocationTargetException e) {\n      throw new JsonMappingException(propertyName + \" has to be a numeric value\");\n    }\n  }\n\n  private LogicalAnd deserializeAnd(JsonNode node) throws JsonMappingException {\n    JsonNode operandsNode = node.get(\"and\");\n    if (!operandsNode.isArray()) {\n      throw new JsonMappingException(\"and field must be an array of matchers\");\n    }\n\n    try (JsonParser parser = Json.getObjectMapper().treeAsTokens(node.get(\"and\"))) {\n      List<StringValuePattern> operands =\n          parser.readValueAs(new TypeReference<List<StringValuePattern>>() {});\n      return new LogicalAnd(operands);\n    } catch (IOException e) {\n      return throwUnchecked(e, LogicalAnd.class);\n    }\n  }\n\n  private LogicalOr deserializeOr(JsonNode node) throws JsonMappingException {\n    JsonNode operandsNode = node.get(\"or\");\n    if (!operandsNode.isArray()) {\n      throw new JsonMappingException(\"and field must be an array of matchers\");\n    }\n\n    try (JsonParser parser = Json.getObjectMapper().treeAsTokens(node.get(\"or\"))) {\n      List<StringValuePattern> operands =\n          parser.readValueAs(new TypeReference<List<StringValuePattern>>() {});\n      return new LogicalOr(operands);\n    } catch (IOException e) {\n      return throwUnchecked(e, LogicalOr.class);\n    }\n  }\n\n  private StringValuePattern deserializeNot(JsonNode rootNode) throws JsonMappingException {\n    if (!rootNode.has(\"not\")) {\n      throw new JsonMappingException(rootNode + \" is not a valid not operation\");\n    }\n\n    JsonNode notNode = rootNode.findValue(\"not\");\n\n    try (JsonParser parser = Json.getObjectMapper().treeAsTokens(notNode)) {\n      StringValuePattern unexpectedPattern =\n          parser.readValueAs(new TypeReference<StringValuePattern>() {});\n      return new NotPattern(unexpectedPattern);\n    } catch (IOException e) {\n      return throwUnchecked(e, NotPattern.class);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/UnwrappedJsonPathPatternJsonSerializer.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.databind.SerializerProvider;\nimport java.io.IOException;\n\npublic class UnwrappedJsonPathPatternJsonSerializer extends JsonPathPatternJsonSerializer {\n\n  @Override\n  public void serialize(\n      MatchesJsonPathPattern value, JsonGenerator gen, SerializerProvider serializers)\n      throws IOException {\n    this.serializePathPattern(value, gen, serializers);\n  }\n\n  @Override\n  public boolean isUnwrappingSerializer() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/UnwrappedXPathPatternJsonSerializer.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.databind.SerializerProvider;\nimport java.io.IOException;\n\npublic class UnwrappedXPathPatternJsonSerializer extends XPathPatternJsonSerializer {\n\n  @Override\n  public void serialize(\n      MatchesXPathPattern value, JsonGenerator gen, SerializerProvider serializers)\n      throws IOException {\n    this.serializePathPattern(value, gen, serializers);\n  }\n\n  @Override\n  public boolean isUnwrappingSerializer() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/UrlPathPattern.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport org.wiremock.url.PathAndQuery;\n\npublic class UrlPathPattern extends UrlPattern {\n\n  public UrlPathPattern(StringValuePattern testUrl, boolean regex) {\n    super(testUrl, regex);\n  }\n\n  @Override\n  public MatchResult match(String url) {\n    if (url == null) {\n      return MatchResult.noMatch();\n    }\n\n    String path = PathAndQuery.parse(url).getPath().toString();\n    return super.match(path);\n  }\n\n  @Override\n  public String toString() {\n    return \"path \" + pattern.toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/UrlPathTemplatePattern.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.github.tomakehurst.wiremock.common.url.PathTemplate;\n\npublic class UrlPathTemplatePattern extends UrlPathPattern {\n\n  public UrlPathTemplatePattern(String expectedValue) {\n    super(new PathTemplatePattern(expectedValue), false);\n  }\n\n  @Override\n  public PathTemplatePattern getPattern() {\n    return (PathTemplatePattern) super.getPattern();\n  }\n\n  public PathTemplate getPathTemplate() {\n    return getPattern().getPathTemplate();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/UrlPattern.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.annotation.JsonValue;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.url.PathTemplate;\nimport java.util.Objects;\n\npublic class UrlPattern implements NamedValueMatcher<String> {\n\n  public static final UrlPattern ANY = new UrlPattern(new AnythingPattern(), false);\n\n  protected final StringValuePattern pattern;\n  private final boolean regex;\n\n  public UrlPattern(StringValuePattern pattern, boolean regex) {\n    this.pattern = pattern;\n    this.regex = regex;\n  }\n\n  public static UrlPattern fromOneOf(\n      String url,\n      String urlPattern,\n      String urlPath,\n      String urlPathPattern,\n      String urlPathTemplate) {\n    if (url != null) {\n      return WireMock.urlEqualTo(url);\n    } else if (urlPattern != null) {\n      return WireMock.urlMatching(urlPattern);\n    } else if (urlPath != null) {\n      return WireMock.urlPathEqualTo(urlPath);\n    } else if (urlPathPattern != null) {\n      return WireMock.urlPathMatching(urlPathPattern);\n    } else if (urlPathTemplate != null) {\n      return WireMock.urlPathTemplate(urlPathTemplate);\n    } else {\n      return WireMock.anyUrl();\n    }\n  }\n\n  @Override\n  public MatchResult match(String url) {\n    return pattern.match(url);\n  }\n\n  @Override\n  public String getName() {\n    return pattern.getName();\n  }\n\n  public boolean isRegex() {\n    return regex;\n  }\n\n  @JsonValue\n  public StringValuePattern getPattern() {\n    return pattern;\n  }\n\n  public PathTemplate getPathTemplate() {\n    return null;\n  }\n\n  @Override\n  public String getExpected() {\n    return pattern.expectedValue;\n  }\n\n  @Override\n  public String toString() {\n    return \"path and query \" + pattern.toString();\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    UrlPattern that = (UrlPattern) o;\n    return regex == that.regex && Objects.equals(pattern, that.pattern);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(pattern, regex);\n  }\n\n  public boolean isSpecified() {\n    return pattern.getClass() != AnythingPattern.class;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/ValueMatcher.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\npublic interface ValueMatcher<T> {\n\n  MatchResult match(T value);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/WeightedAggregateMatchResult.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport static com.github.tomakehurst.wiremock.common.Lazy.lazy;\nimport static com.github.tomakehurst.wiremock.common.Pair.pair;\n\nimport com.github.tomakehurst.wiremock.common.Lazy;\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class WeightedAggregateMatchResult extends MatchResult {\n\n  private final List<WeightedMatchResult> matchResults;\n\n  private final Lazy<Pair<Boolean, List<SubEvent>>> resultAndEvents;\n\n  public WeightedAggregateMatchResult(List<WeightedMatchResult> matchResults) {\n    this.matchResults = matchResults;\n    resultAndEvents =\n        lazy(\n            () -> {\n              final List<SubEvent> subEvents = new ArrayList<>(matchResults.size());\n              return pair(\n                  matchResults.stream()\n                      .allMatch(\n                          weightedMatchResult -> {\n                            final boolean exactMatch = weightedMatchResult.isExactMatch();\n                            subEvents.addAll(weightedMatchResult.getMatchResult().getSubEvents());\n                            return exactMatch;\n                          }),\n                  subEvents);\n            });\n  }\n\n  @Override\n  public boolean isExactMatch() {\n    return resultAndEvents.get().a;\n  }\n\n  @Override\n  public double getDistance() {\n    double totalDistance = 0;\n    double sizeWithWeighting = 0;\n    for (WeightedMatchResult matchResult : matchResults) {\n      totalDistance += matchResult.getDistance();\n      sizeWithWeighting += matchResult.getWeighting();\n    }\n\n    return (totalDistance / sizeWithWeighting);\n  }\n\n  @Override\n  public List<SubEvent> getSubEvents() {\n    return resultAndEvents.get().b;\n  }\n\n  @Override\n  public List<DiffDescription> getDiffDescriptions() {\n    return matchResults.stream()\n        .map(matchResult -> matchResult.getMatchResult().getDiffDescriptions())\n        .flatMap(List::stream)\n        .collect(Collectors.toList());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/WeightedMatchResult.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\npublic class WeightedMatchResult {\n\n  private final MatchResult matchResult;\n  private final double weighting;\n\n  public static WeightedMatchResult weight(MatchResult matchResult, double weighting) {\n    return new WeightedMatchResult(matchResult, weighting);\n  }\n\n  public static WeightedMatchResult weight(MatchResult matchResult) {\n    return new WeightedMatchResult(matchResult);\n  }\n\n  public WeightedMatchResult(MatchResult matchResult) {\n    this(matchResult, 1.0);\n  }\n\n  public WeightedMatchResult(MatchResult matchResult, double weighting) {\n    this.matchResult = matchResult;\n    this.weighting = weighting;\n  }\n\n  public boolean isExactMatch() {\n    return matchResult.isExactMatch();\n  }\n\n  public double getDistance() {\n    return weighting * matchResult.getDistance();\n  }\n\n  public double getWeighting() {\n    return weighting;\n  }\n\n  public MatchResult getMatchResult() {\n    return matchResult;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/matching/XPathPatternJsonSerializer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.matching;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.databind.JsonSerializer;\nimport com.fasterxml.jackson.databind.SerializerProvider;\nimport com.fasterxml.jackson.databind.util.NameTransformer;\nimport java.io.IOException;\nimport java.util.Map;\n\npublic class XPathPatternJsonSerializer extends PathPatternJsonSerializer<MatchesXPathPattern> {\n\n  @Override\n  public JsonSerializer<MatchesXPathPattern> unwrappingSerializer(NameTransformer unwrapper) {\n    return new UnwrappedXPathPatternJsonSerializer();\n  }\n\n  @Override\n  protected void serializeAdditionalFields(\n      MatchesXPathPattern value, JsonGenerator gen, SerializerProvider serializers)\n      throws IOException {\n    if (value.getXPathNamespaces() != null && !value.getXPathNamespaces().isEmpty()) {\n      gen.writeObjectFieldStart(\"xPathNamespaces\");\n      for (Map.Entry<String, String> namespace : value.getXPathNamespaces().entrySet()) {\n        gen.writeStringField(namespace.getKey(), namespace.getValue());\n      }\n      gen.writeEndObject();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/ChannelPattern.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.fasterxml.jackson.annotation.JsonSubTypes;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\n\n@JsonTypeInfo(\n    use = JsonTypeInfo.Id.NAME,\n    include = JsonTypeInfo.As.EXISTING_PROPERTY,\n    property = \"type\",\n    visible = true)\n@JsonSubTypes({\n  @JsonSubTypes.Type(value = RequestInitiatedChannelPattern.class, name = \"websocket\")\n})\npublic interface ChannelPattern {\n\n  ChannelType getType();\n\n  boolean matches(MessageChannel channel);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/ChannelTarget.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.fasterxml.jackson.annotation.JsonSubTypes;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\n\n@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = \"type\")\n@JsonSubTypes({\n  @JsonSubTypes.Type(value = OriginatingChannelTarget.class, name = \"originating\"),\n  @JsonSubTypes.Type(value = RequestInitiatedChannelTarget.class, name = \"request-initiated\")\n})\npublic interface ChannelTarget {}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/ChannelType.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.github.tomakehurst.wiremock.message.ChannelType.Directionality.BIDIRECTIONAL;\nimport static com.github.tomakehurst.wiremock.message.ChannelType.Lifecycle.REQUEST_INITIATED;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonValue;\nimport java.util.Locale;\n\npublic class ChannelType {\n\n  public enum Lifecycle {\n    REQUEST_INITIATED\n  }\n\n  public enum Directionality {\n    BIDIRECTIONAL\n  }\n\n  private final String name;\n  private final Lifecycle lifecycle;\n  private final Directionality directionality;\n\n  public ChannelType(String name, Lifecycle lifecycle, Directionality directionality) {\n    this.name = name;\n    this.lifecycle = lifecycle;\n    this.directionality = directionality;\n  }\n\n  public boolean isRequestInitiated() {\n    return getLifecycle() == REQUEST_INITIATED;\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  public Lifecycle getLifecycle() {\n    return lifecycle;\n  }\n\n  public Directionality getDirectionality() {\n    return directionality;\n  }\n\n  @JsonCreator\n  public static ChannelType fromJson(String value) {\n    return WEBSOCKET;\n  }\n\n  @JsonValue\n  public String toJson() {\n    return getName().toLowerCase(Locale.ROOT);\n  }\n\n  public static ChannelType WEBSOCKET =\n      new ChannelType(\"websocket\", REQUEST_INITIATED, BIDIRECTIONAL);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/HttpRequestTrigger.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Collections;\nimport java.util.Map;\nimport java.util.Objects;\n\n@JsonInclude(NON_EMPTY)\npublic class HttpRequestTrigger implements MessageTrigger {\n\n  private final RequestPattern requestPattern;\n\n  @JsonCreator\n  public HttpRequestTrigger(@JsonProperty(\"requestPattern\") RequestPattern requestPattern) {\n    this.requestPattern = requestPattern;\n  }\n\n  public static HttpRequestTrigger forRequestPattern(RequestPattern requestPattern) {\n    return new HttpRequestTrigger(requestPattern);\n  }\n\n  public RequestPattern getRequestPattern() {\n    return requestPattern;\n  }\n\n  public boolean matches(\n      ServeEvent serveEvent, Map<String, RequestMatcherExtension> customMatchers) {\n    if (serveEvent == null || serveEvent.getRequest() == null) {\n      return false;\n    }\n    return matches(serveEvent.getRequest(), customMatchers);\n  }\n\n  public boolean matches(Request request, Map<String, RequestMatcherExtension> customMatchers) {\n    if (requestPattern == null) {\n      return true;\n    }\n    MatchResult matchResult = requestPattern.match(request, customMatchers);\n    return matchResult.isExactMatch();\n  }\n\n  public boolean matches(ServeEvent serveEvent) {\n    return matches(serveEvent, Collections.emptyMap());\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    HttpRequestTrigger that = (HttpRequestTrigger) o;\n    return Objects.equals(requestPattern, that.requestPattern);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(requestPattern);\n  }\n\n  @Override\n  public String toString() {\n    return \"HttpRequestTrigger{\" + \"requestPattern=\" + requestPattern + '}';\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/HttpStubServeEventListener.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.github.tomakehurst.wiremock.extension.MessageActionTransformer;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListener;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\n\npublic class HttpStubServeEventListener implements ServeEventListener {\n\n  private final MessageStubMappings messageStubMappings;\n  private final MessageChannels messageChannels;\n  private final Stores stores;\n  private final Map<String, RequestMatcherExtension> customMatchers;\n  private final List<MessageActionTransformer> actionTransformers;\n\n  public HttpStubServeEventListener(\n      MessageStubMappings messageStubMappings,\n      MessageChannels messageChannels,\n      Stores stores,\n      Map<String, RequestMatcherExtension> customMatchers,\n      List<MessageActionTransformer> actionTransformers) {\n    this.messageStubMappings = messageStubMappings;\n    this.messageChannels = messageChannels;\n    this.stores = stores;\n    this.customMatchers = customMatchers != null ? customMatchers : Collections.emptyMap();\n    this.actionTransformers =\n        actionTransformers != null ? actionTransformers : Collections.emptyList();\n  }\n\n  @Override\n  public String getName() {\n    return \"http-stub-message-trigger\";\n  }\n\n  @Override\n  public boolean applyGlobally() {\n    return true;\n  }\n\n  @Override\n  public void afterMatch(ServeEvent serveEvent, Parameters parameters) {\n    if (serveEvent == null || serveEvent.getStubMapping() == null) {\n      return;\n    }\n\n    List<MessageStubMapping> matchingStubs = findMatchingMessageStubs(serveEvent);\n    for (MessageStubMapping stub : matchingStubs) {\n      executeActions(stub, serveEvent);\n    }\n  }\n\n  private List<MessageStubMapping> findMatchingMessageStubs(ServeEvent serveEvent) {\n    return messageStubMappings.getAllSortedByPriority().stream()\n        .filter(stub -> matchesTrigger(stub, serveEvent))\n        .toList();\n  }\n\n  private boolean matchesTrigger(MessageStubMapping stub, ServeEvent serveEvent) {\n    MessageTrigger trigger = stub.getTrigger();\n    if (trigger instanceof HttpStubTrigger httpStubTrigger) {\n      return httpStubTrigger.matches(serveEvent);\n    } else if (trigger instanceof HttpRequestTrigger httpRequestTrigger) {\n      return httpRequestTrigger.matches(serveEvent, customMatchers);\n    }\n    return false;\n  }\n\n  private void executeActions(MessageStubMapping stub, ServeEvent httpServeEvent) {\n    MessageActionContext context = MessageActionContext.forHttpTrigger(stub, httpServeEvent);\n    for (MessageAction action : stub.getActions()) {\n      MessageAction transformedAction = applyTransformations(action, context);\n      executeAction(transformedAction);\n    }\n  }\n\n  private MessageAction applyTransformations(MessageAction action, MessageActionContext context) {\n    MessageAction result = action;\n    for (MessageActionTransformer transformer : actionTransformers) {\n      if (transformer.applyGlobally() || action.hasTransformer(transformer)) {\n        result = transformer.transform(result, context);\n      }\n    }\n    return result;\n  }\n\n  private void executeAction(MessageAction action) {\n    if (action instanceof SendMessageAction sendAction) {\n      executeSendMessageAction(sendAction);\n    }\n  }\n\n  private void executeSendMessageAction(SendMessageAction action) {\n    Message message = MessageStubRequestHandler.resolveToMessage(action.getMessage(), stores);\n    ChannelTarget target = action.getChannelTarget();\n\n    if (target instanceof RequestInitiatedChannelTarget requestTarget) {\n      List<RequestInitiatedMessageChannel> matchingChannels;\n      if (requestTarget.getChannelType() != null) {\n        matchingChannels =\n            messageChannels.findByTypeAndRequestPattern(\n                requestTarget.getChannelType(), requestTarget.getRequestPattern(), customMatchers);\n      } else {\n        matchingChannels =\n            messageChannels.findByRequestPattern(requestTarget.getRequestPattern(), customMatchers);\n      }\n      for (RequestInitiatedMessageChannel channel : matchingChannels) {\n        channel.sendMessage(message);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/HttpStubTrigger.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.Objects;\nimport java.util.UUID;\n\n@JsonInclude(NON_EMPTY)\npublic class HttpStubTrigger implements MessageTrigger {\n\n  private final UUID stubId;\n\n  @JsonCreator\n  public HttpStubTrigger(@JsonProperty(\"stubId\") UUID stubId) {\n    this.stubId = stubId;\n  }\n\n  public static HttpStubTrigger forStubId(UUID stubId) {\n    return new HttpStubTrigger(stubId);\n  }\n\n  public static HttpStubTrigger forStubId(String stubId) {\n    return new HttpStubTrigger(UUID.fromString(stubId));\n  }\n\n  public UUID getStubId() {\n    return stubId;\n  }\n\n  public boolean matches(ServeEvent serveEvent) {\n    if (serveEvent == null || serveEvent.getStubMapping() == null) {\n      return false;\n    }\n    return stubId.equals(serveEvent.getStubMapping().getId());\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    HttpStubTrigger that = (HttpStubTrigger) o;\n    return Objects.equals(stubId, that.stubId);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(stubId);\n  }\n\n  @Override\n  public String toString() {\n    return \"HttpStubTrigger{\" + \"stubId=\" + stubId + '}';\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/IncomingMessageTrigger.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.ContentPattern;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport java.util.Objects;\n\n@JsonInclude(NON_EMPTY)\npublic class IncomingMessageTrigger implements MessageTrigger {\n\n  public static final IncomingMessageTrigger ANYTHING = new IncomingMessageTrigger(null, null);\n\n  private final ChannelPattern channelPattern;\n  private final MessagePattern messagePattern;\n\n  @JsonCreator\n  public IncomingMessageTrigger(\n      @JsonProperty(\"channel\") ChannelPattern channelPattern,\n      @JsonProperty(\"message\") MessagePattern messagePattern) {\n    this.channelPattern = channelPattern;\n    this.messagePattern = messagePattern;\n  }\n\n  public ChannelPattern getChannel() {\n    return channelPattern;\n  }\n\n  public MessagePattern getMessage() {\n    return messagePattern;\n  }\n\n  @JsonIgnore\n  public ContentPattern<?> getBodyPattern() {\n    return messagePattern != null ? messagePattern.getBodyPattern() : null;\n  }\n\n  @JsonIgnore\n  public RequestPattern getInitiatingRequestPattern() {\n    if (channelPattern instanceof RequestInitiatedChannelPattern) {\n      return ((RequestInitiatedChannelPattern) channelPattern).getInitiatingRequestPattern();\n    }\n    return null;\n  }\n\n  public boolean matches(MessageChannel channel, Message message) {\n    if (channelPattern != null && !channelPattern.matches(channel)) {\n      return false;\n    }\n\n    if (messagePattern != null) {\n      return messagePattern.matches(channel, message);\n    }\n\n    return true;\n  }\n\n  public boolean matches(Request channelRequest, Message message) {\n    if (channelPattern instanceof RequestInitiatedChannelPattern requestInitiated) {\n      if (!requestInitiated.matches(channelRequest)) {\n        return false;\n      }\n    } else if (channelPattern != null) {\n      return false;\n    }\n\n    if (messagePattern != null) {\n      return messagePattern.matches(channelRequest, message);\n    }\n\n    return true;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    IncomingMessageTrigger that = (IncomingMessageTrigger) o;\n    return Objects.equals(channelPattern, that.channelPattern)\n        && Objects.equals(messagePattern, that.messagePattern);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(channelPattern, messagePattern);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/Message.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonValue;\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.common.InputStreamSource;\nimport com.github.tomakehurst.wiremock.common.entity.CompressionType;\nimport com.github.tomakehurst.wiremock.common.entity.EncodingType;\nimport com.github.tomakehurst.wiremock.common.entity.Entity;\nimport com.github.tomakehurst.wiremock.common.entity.FormatType;\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Objects;\n\n@JsonDeserialize(using = Message.MessageDeserializer.class)\npublic class Message {\n\n  private final Entity body;\n\n  public Message(Entity body) {\n    this.body = body;\n  }\n\n  @JsonIgnore\n  public Entity getBody() {\n    return body;\n  }\n\n  @JsonIgnore\n  public byte[] getBodyAsBytes() {\n    if (body == null) {\n      return null;\n    }\n    return body.getData();\n  }\n\n  @JsonValue\n  public String getBodyAsString() {\n    if (body == null) {\n      return null;\n    }\n    byte[] data = body.getData();\n    return data != null ? new String(data, StandardCharsets.UTF_8) : null;\n  }\n\n  @JsonIgnore\n  public boolean isBinary() {\n    return body != null && EncodingType.BINARY.equals(body.getEncoding());\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    Message message = (Message) o;\n    return Objects.equals(body, message.body);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hashCode(body);\n  }\n\n  @Override\n  public String toString() {\n    return getBodyAsString();\n  }\n\n  static class MessageDeserializer extends JsonDeserializer<Message> {\n    @Override\n    public Message deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {\n      String text = p.getValueAsString();\n      if (text == null) {\n        return new Message(null);\n      }\n      byte[] bytes = text.getBytes(StandardCharsets.UTF_8);\n      InputStreamSource streamSource = () -> new ByteArrayInputStream(bytes);\n      Entity entity =\n          new Entity(EncodingType.TEXT, FormatType.TEXT, CompressionType.NONE, streamSource);\n      return new Message(entity);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageAction.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.fasterxml.jackson.annotation.JsonSubTypes;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\nimport com.github.tomakehurst.wiremock.extension.Extension;\n\n@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = \"type\")\n@JsonSubTypes({@JsonSubTypes.Type(value = SendMessageAction.class, name = \"send\")})\npublic interface MessageAction {\n  default boolean hasTransformer(Extension transformer) {\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageActionContext.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic class MessageActionContext {\n\n  private final MessageStubMapping stubMapping;\n  private final MessageChannel originatingChannel;\n  private final Message incomingMessage;\n  private final ServeEvent httpServeEvent;\n\n  private MessageActionContext(\n      MessageStubMapping stubMapping,\n      MessageChannel originatingChannel,\n      Message incomingMessage,\n      ServeEvent httpServeEvent) {\n    this.stubMapping = stubMapping;\n    this.originatingChannel = originatingChannel;\n    this.incomingMessage = incomingMessage;\n    this.httpServeEvent = httpServeEvent;\n  }\n\n  public static MessageActionContext forIncomingMessage(\n      MessageStubMapping stubMapping, MessageChannel originatingChannel, Message incomingMessage) {\n    return new MessageActionContext(stubMapping, originatingChannel, incomingMessage, null);\n  }\n\n  public static MessageActionContext forHttpTrigger(\n      MessageStubMapping stubMapping, ServeEvent httpServeEvent) {\n    return new MessageActionContext(stubMapping, null, null, httpServeEvent);\n  }\n\n  public MessageStubMapping getStubMapping() {\n    return stubMapping;\n  }\n\n  public MessageChannel getOriginatingChannel() {\n    return originatingChannel;\n  }\n\n  public Message getIncomingMessage() {\n    return incomingMessage;\n  }\n\n  public ServeEvent getHttpServeEvent() {\n    return httpServeEvent;\n  }\n\n  public boolean isTriggeredByMessage() {\n    return originatingChannel != null;\n  }\n\n  public boolean isTriggeredByHttp() {\n    return httpServeEvent != null;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageChannel.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport java.util.UUID;\n\npublic interface MessageChannel {\n\n  ChannelType getType();\n\n  UUID getId();\n\n  boolean isOpen();\n\n  void sendMessage(Message message);\n\n  void close();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageChannels.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.store.MessageChannelStore;\nimport java.util.*;\nimport java.util.stream.Collectors;\n\npublic class MessageChannels {\n\n  private final MessageChannelStore store;\n\n  public MessageChannels(MessageChannelStore store) {\n    this.store = store;\n  }\n\n  public void add(MessageChannel channel) {\n    store.add(channel);\n  }\n\n  public void remove(UUID id) {\n    store.remove(id).ifPresent(MessageChannel::close);\n  }\n\n  public Optional<MessageChannel> get(UUID id) {\n    return store.get(id);\n  }\n\n  public List<MessageChannel> getAll() {\n    return store.getAll().collect(Collectors.toList());\n  }\n\n  public List<MessageChannel> getAllByType(ChannelType type) {\n    return store.getAll().filter(channel -> channel.getType() == type).collect(Collectors.toList());\n  }\n\n  public List<MessageChannel> getAllOpen() {\n    return store.getAll().filter(MessageChannel::isOpen).collect(Collectors.toList());\n  }\n\n  public List<MessageChannel> getAllOpenByType(ChannelType type) {\n    return store\n        .getAll()\n        .filter(MessageChannel::isOpen)\n        .filter(channel -> channel.getType() == type)\n        .collect(Collectors.toList());\n  }\n\n  public List<RequestInitiatedMessageChannel> findByRequestPattern(\n      RequestPattern requestPattern, Map<String, RequestMatcherExtension> customMatchers) {\n    return store\n        .getAll()\n        .filter(MessageChannel::isOpen)\n        .filter(RequestInitiatedMessageChannel.class::isInstance)\n        .map(RequestInitiatedMessageChannel.class::cast)\n        .filter(\n            channel ->\n                requestPattern.match(channel.getInitiatingRequest(), customMatchers).isExactMatch())\n        .collect(Collectors.toList());\n  }\n\n  public List<RequestInitiatedMessageChannel> findByTypeAndRequestPattern(\n      ChannelType type,\n      RequestPattern requestPattern,\n      Map<String, RequestMatcherExtension> customMatchers) {\n    return store\n        .getAll()\n        .filter(MessageChannel::isOpen)\n        .filter(channel -> channel.getType() == type)\n        .filter(RequestInitiatedMessageChannel.class::isInstance)\n        .map(RequestInitiatedMessageChannel.class::cast)\n        .filter(\n            channel ->\n                requestPattern.match(channel.getInitiatingRequest(), customMatchers).isExactMatch())\n        .collect(Collectors.toList());\n  }\n\n  public int sendMessageToMatching(\n      RequestPattern requestPattern,\n      MessageDefinition messageDefinition,\n      Map<String, RequestMatcherExtension> customMatchers) {\n    List<RequestInitiatedMessageChannel> matchingChannels =\n        findByRequestPattern(requestPattern, customMatchers);\n    Message message = MessageStubRequestHandler.resolveToMessage(messageDefinition, null);\n    for (RequestInitiatedMessageChannel channel : matchingChannels) {\n      channel.sendMessage(message);\n    }\n    return matchingChannels.size();\n  }\n\n  public List<RequestInitiatedMessageChannel> sendMessageToMatchingByType(\n      ChannelType type,\n      RequestPattern requestPattern,\n      MessageDefinition messageDefinition,\n      Map<String, RequestMatcherExtension> customMatchers) {\n    List<RequestInitiatedMessageChannel> matchingChannels =\n        findByTypeAndRequestPattern(type, requestPattern, customMatchers);\n    Message message = MessageStubRequestHandler.resolveToMessage(messageDefinition, null);\n    for (RequestInitiatedMessageChannel channel : matchingChannels) {\n      channel.sendMessage(message);\n    }\n    return matchingChannels;\n  }\n\n  public int size() {\n    return (int) store.getAll().count();\n  }\n\n  public int sizeByType(ChannelType type) {\n    return (int) store.getAll().filter(channel -> channel.getType() == type).count();\n  }\n\n  public int openCount() {\n    return (int) store.getAll().filter(MessageChannel::isOpen).count();\n  }\n\n  public int openCountByType(ChannelType type) {\n    return (int)\n        store\n            .getAll()\n            .filter(MessageChannel::isOpen)\n            .filter(channel -> channel.getType() == type)\n            .count();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageDefinition.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.entity.BinaryEntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.EntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.StringEntityDefinition;\nimport java.util.Objects;\n\n@JsonInclude(NON_NULL)\npublic class MessageDefinition {\n\n  private final EntityDefinition body;\n\n  @JsonCreator\n  public MessageDefinition(@JsonProperty(\"body\") EntityDefinition body) {\n    this.body = body;\n  }\n\n  public static MessageDefinition fromString(String message) {\n    return new MessageDefinition(new StringEntityDefinition(message));\n  }\n\n  public static MessageDefinition fromBytes(byte[] data) {\n    return new MessageDefinition(BinaryEntityDefinition.aBinaryMessage().withBody(data).build());\n  }\n\n  public EntityDefinition getBody() {\n    return body;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    MessageDefinition that = (MessageDefinition) o;\n    return Objects.equals(body, that.body);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hashCode(body);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessagePattern.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.ContentPattern;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.util.Collections;\nimport java.util.Objects;\nimport java.util.function.Consumer;\n\n@JsonInclude(NON_EMPTY)\npublic class MessagePattern {\n\n  public static final MessagePattern ANYTHING = new MessagePattern(null, null);\n\n  private final RequestPattern channelPattern;\n  private final ContentPattern<?> bodyPattern;\n\n  @JsonCreator\n  public MessagePattern(\n      @JsonProperty(\"channel\") RequestPattern channelPattern,\n      @JsonProperty(\"body\") ContentPattern<?> bodyPattern) {\n    this.channelPattern = channelPattern;\n    this.bodyPattern = bodyPattern;\n  }\n\n  public static Builder messagePattern() {\n    return new Builder();\n  }\n\n  public static MessagePattern create(Consumer<Builder> transformer) {\n    final Builder builder = messagePattern();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public MessagePattern transform(Consumer<Builder> transformer) {\n    final Builder builder = toBuilder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public Builder toBuilder() {\n    return new Builder(this);\n  }\n\n  @JsonIgnore\n  public RequestPattern getChannel() {\n    return channelPattern;\n  }\n\n  @JsonProperty(\"body\")\n  public ContentPattern<?> getBodyPattern() {\n    return bodyPattern;\n  }\n\n  public boolean matches(MessageChannel channel, Message message) {\n    if (channel instanceof RequestInitiatedMessageChannel) {\n      return matches(((RequestInitiatedMessageChannel) channel).getInitiatingRequest(), message);\n    }\n    // For non-request-initiated channels, only match if there's no channel pattern\n    return matches((Request) null, message);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public boolean matches(Request channelRequest, Message message) {\n    if (channelPattern != null) {\n      MatchResult channelMatch = channelPattern.match(channelRequest, Collections.emptyMap());\n      if (!channelMatch.isExactMatch()) {\n        return false;\n      }\n    }\n\n    if (bodyPattern != null) {\n      MatchResult messageMatch;\n      if (bodyPattern instanceof StringValuePattern) {\n        String messageBody = message != null ? message.getBodyAsString() : null;\n        messageMatch = ((StringValuePattern) bodyPattern).match(messageBody);\n      } else {\n        byte[] messageBody = message != null ? message.getBodyAsBytes() : null;\n        messageMatch = ((ContentPattern<byte[]>) bodyPattern).match(messageBody);\n      }\n      if (!messageMatch.isExactMatch()) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  public boolean matches(MessageServeEvent event) {\n    return matches(event.getChannelRequest(), event.getMessage());\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    MessagePattern that = (MessagePattern) o;\n    return Objects.equals(channelPattern, that.channelPattern)\n        && Objects.equals(bodyPattern, that.bodyPattern);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(channelPattern, bodyPattern);\n  }\n\n  @Override\n  public String toString() {\n    return Json.write(this);\n  }\n\n  public static class Builder {\n    private RequestPattern channelPattern;\n    private ContentPattern<?> bodyPattern;\n\n    public Builder() {}\n\n    public Builder(MessagePattern existing) {\n      this.channelPattern = existing.channelPattern;\n      this.bodyPattern = existing.bodyPattern;\n    }\n\n    public RequestPattern getChannelPattern() {\n      return channelPattern;\n    }\n\n    public Builder setChannelPattern(RequestPattern channelPattern) {\n      this.channelPattern = channelPattern;\n      return this;\n    }\n\n    public Builder withChannelPattern(RequestPattern channelPattern) {\n      return setChannelPattern(channelPattern);\n    }\n\n    public ContentPattern<?> getBodyPattern() {\n      return bodyPattern;\n    }\n\n    public Builder setBodyPattern(ContentPattern<?> bodyPattern) {\n      this.bodyPattern = bodyPattern;\n      return this;\n    }\n\n    public Builder withBody(ContentPattern<?> bodyPattern) {\n      return setBodyPattern(bodyPattern);\n    }\n\n    public MessagePattern build() {\n      return new MessagePattern(channelPattern, bodyPattern);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageStubMapping.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;\nimport static com.github.tomakehurst.wiremock.matching.RequestPatternBuilder.newRequestPattern;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.annotation.JsonView;\nimport com.github.tomakehurst.wiremock.client.MessageStubMappingBuilder;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport com.github.tomakehurst.wiremock.common.Prioritisable;\nimport com.github.tomakehurst.wiremock.matching.ContentPattern;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.function.Consumer;\nimport org.jspecify.annotations.NonNull;\n\n@JsonInclude(NON_EMPTY)\n@JsonIgnoreProperties({\"$schema\", \"uuid\", \"insertionIndex\"})\npublic class MessageStubMapping implements Prioritisable {\n\n  public static final int DEFAULT_PRIORITY = 5;\n\n  private final UUID id;\n  private final String name;\n  private final Integer priority;\n  @NonNull private final MessageTrigger trigger;\n  @NonNull private final List<MessageAction> actions;\n  @NonNull private final Metadata metadata;\n  private final long insertionIndex;\n\n  @JsonCreator\n  public MessageStubMapping(\n      @JsonProperty(\"id\") UUID id,\n      @JsonProperty(\"name\") String name,\n      @JsonProperty(\"priority\") Integer priority,\n      @JsonProperty(\"trigger\") MessageTrigger trigger,\n      @JsonProperty(\"actions\") List<MessageAction> actions,\n      @JsonProperty(\"metadata\") Metadata metadata,\n      @JsonProperty(\"insertionIndex\") @JsonView(Json.PrivateView.class) long insertionIndex) {\n    this.id = id != null ? id : UUID.randomUUID();\n    this.name = name;\n    this.priority = priority;\n    this.trigger = trigger != null ? trigger : IncomingMessageTrigger.ANYTHING;\n    this.actions = actions != null ? actions : Collections.emptyList();\n    this.metadata = metadata != null ? metadata : new Metadata();\n    this.insertionIndex = insertionIndex;\n  }\n\n  public static Builder builder() {\n    return new Builder();\n  }\n\n  public static MessageStubMapping create(Consumer<Builder> transformer) {\n    final Builder builder = builder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public MessageStubMapping transform(Consumer<Builder> transformer) {\n    final Builder builder = toBuilder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public Builder toBuilder() {\n    return new Builder(this);\n  }\n\n  public UUID getId() {\n    return id;\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  public Integer getPriority() {\n    return priority;\n  }\n\n  public MessageTrigger getTrigger() {\n    return trigger;\n  }\n\n  public List<MessageAction> getActions() {\n    return actions;\n  }\n\n  @NonNull\n  public Metadata getMetadata() {\n    return metadata;\n  }\n\n  public boolean matches(MessageChannel channel, Message message) {\n    if (trigger instanceof IncomingMessageTrigger messageTrigger) {\n      return messageTrigger.matches(channel, message);\n    }\n    return false;\n  }\n\n  public long getInsertionIndex() {\n    return insertionIndex;\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Override\n  public <T extends Prioritisable> T withInsertionIndex(long newInsertionIndex) {\n    return (T) transform(builder -> builder.setInsertionIndex(newInsertionIndex));\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    MessageStubMapping that = (MessageStubMapping) o;\n    return Objects.equals(id, that.id)\n        && Objects.equals(priority, that.priority)\n        && Objects.equals(trigger, that.trigger)\n        && Objects.equals(actions, that.actions)\n        && Objects.equals(metadata, that.metadata);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(id, priority, trigger, actions, metadata);\n  }\n\n  @Override\n  public String toString() {\n    return Json.write(this);\n  }\n\n  public static class Builder implements MessageStubMappingBuilder {\n    private UUID id;\n    private String name;\n    private Integer priority;\n    private ChannelPattern channelPattern;\n    private ContentPattern<?> bodyPattern;\n    private MessageTrigger explicitTrigger;\n    private ArrayList<MessageAction> actions = new ArrayList<>();\n    @NonNull private Metadata metadata = new Metadata();\n    private long insertionIndex;\n\n    public Builder() {}\n\n    public Builder(MessageStubMapping existing) {\n      this.id = existing.id;\n      this.name = existing.name;\n      this.priority = existing.priority;\n      if (existing.trigger instanceof IncomingMessageTrigger incomingTrigger) {\n        this.channelPattern = incomingTrigger.getChannel();\n        if (incomingTrigger.getMessage() != null) {\n          this.bodyPattern = incomingTrigger.getMessage().getBodyPattern();\n        }\n      } else {\n        this.explicitTrigger = existing.trigger;\n      }\n      this.actions = new ArrayList<>(existing.actions);\n      this.metadata = existing.metadata;\n      this.insertionIndex = existing.insertionIndex;\n    }\n\n    @Override\n    public Builder withId(UUID id) {\n      this.id = id;\n      return this;\n    }\n\n    @Override\n    public Builder withName(String name) {\n      this.name = name;\n      return this;\n    }\n\n    @Override\n    public Builder atPriority(Integer priority) {\n      this.priority = priority;\n      return this;\n    }\n\n    public Builder withPriority(Integer priority) {\n      return atPriority(priority);\n    }\n\n    @Override\n    public Builder withMessageBody(StringValuePattern messagePattern) {\n      this.bodyPattern = messagePattern;\n      return this;\n    }\n\n    public Builder onWebsocketChannelFromRequestMatching(String urlPath) {\n      return onChannelFromRequestMatching(\n          ChannelType.WEBSOCKET, newRequestPattern().withUrl(urlPathEqualTo(urlPath)));\n    }\n\n    public Builder onWebsocketChannelFromRequestMatching(\n        RequestPatternBuilder channelPatternBuilder) {\n      return onChannelFromRequestMatching(ChannelType.WEBSOCKET, channelPatternBuilder.build());\n    }\n\n    public Builder onChannelFromRequestMatching(ChannelType channelType, String urlPath) {\n      return onChannelFromRequestMatching(\n          channelType, newRequestPattern().withUrl(urlPathEqualTo(urlPath)));\n    }\n\n    public Builder onChannelFromRequestMatching(\n        ChannelType channelType, RequestPatternBuilder channelPatternBuilder) {\n      return onChannelFromRequestMatching(channelType, channelPatternBuilder.build());\n    }\n\n    public Builder onChannelFromRequestMatching(\n        ChannelType channelType, RequestPattern requestPattern) {\n      this.channelPattern =\n          RequestInitiatedChannelPattern.forRequestPattern(channelType, requestPattern);\n      return this;\n    }\n\n    public Builder withBody(ContentPattern<?> bodyPattern) {\n      this.bodyPattern = bodyPattern;\n      return this;\n    }\n\n    public Builder triggeredByHttpStub(UUID stubId) {\n      this.explicitTrigger = HttpStubTrigger.forStubId(stubId);\n      return this;\n    }\n\n    public Builder triggeredByHttpStub(String stubId) {\n      this.explicitTrigger = HttpStubTrigger.forStubId(stubId);\n      return this;\n    }\n\n    public Builder triggeredByHttpRequest(RequestPattern requestPattern) {\n      this.explicitTrigger = HttpRequestTrigger.forRequestPattern(requestPattern);\n      return this;\n    }\n\n    public Builder triggeredByHttpRequest(RequestPatternBuilder requestPatternBuilder) {\n      this.explicitTrigger = HttpRequestTrigger.forRequestPattern(requestPatternBuilder.build());\n      return this;\n    }\n\n    public Builder withActions(List<MessageAction> actions) {\n      this.actions = new ArrayList<>(actions);\n      return this;\n    }\n\n    @Override\n    public MessageStubMapping willTriggerActions(MessageAction... actions) {\n      this.actions.addAll(Arrays.asList(actions));\n      return build();\n    }\n\n    public Builder triggersAction(MessageAction action) {\n      this.actions.add(action);\n      return this;\n    }\n\n    @Override\n    public Builder withMetadata(Map<String, ?> metadataMap) {\n      this.metadata = new Metadata(metadataMap);\n      return this;\n    }\n\n    @Override\n    public Builder withMetadata(Metadata metadata) {\n      this.metadata = metadata;\n      return this;\n    }\n\n    @Override\n    public Builder withMetadata(Metadata.Builder metadata) {\n      this.metadata = metadata.build();\n      return this;\n    }\n\n    public long getInsertionIndex() {\n      return insertionIndex;\n    }\n\n    @SuppressWarnings(\"UnusedReturnValue\")\n    public Builder setInsertionIndex(long insertionIndex) {\n      this.insertionIndex = insertionIndex;\n      return this;\n    }\n\n    @Override\n    public MessageStubMapping build() {\n      MessageTrigger trigger;\n      if (explicitTrigger != null) {\n        trigger = explicitTrigger;\n      } else {\n        MessagePattern messagePattern =\n            bodyPattern != null ? new MessagePattern(null, bodyPattern) : null;\n        trigger = new IncomingMessageTrigger(channelPattern, messagePattern);\n      }\n      return new MessageStubMapping(id, name, priority, trigger, actions, metadata, insertionIndex);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageStubMappingCollection.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport java.util.List;\n\n@JsonIgnoreProperties({\"$schema\", \"meta\", \"uuid\"})\n@JsonDeserialize()\npublic class MessageStubMappingCollection implements MessageStubMappingOrMappings {\n\n  private List<MessageStubMapping> messageMappings;\n\n  @Override\n  public List<MessageStubMapping> getMappingOrMappings() {\n    return getMessageMappings();\n  }\n\n  @Override\n  public boolean isMulti() {\n    return true;\n  }\n\n  public List<MessageStubMapping> getMessageMappings() {\n    return messageMappings;\n  }\n\n  public void setMessageMappings(List<MessageStubMapping> mappings) {\n    this.messageMappings = mappings;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageStubMappingOrMappings.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.fasterxml.jackson.databind.deser.std.StdDeserializer;\nimport java.io.IOException;\nimport java.util.List;\n\n@JsonDeserialize(using = MessageStubMappingOrMappingsJsonDeserializer.class)\npublic interface MessageStubMappingOrMappings {\n\n  @JsonIgnore\n  List<MessageStubMapping> getMappingOrMappings();\n\n  @JsonIgnore\n  boolean isMulti();\n}\n\nclass MessageStubMappingOrMappingsJsonDeserializer\n    extends StdDeserializer<MessageStubMappingOrMappings> {\n\n  protected MessageStubMappingOrMappingsJsonDeserializer() {\n    super(MessageStubMappingOrMappings.class);\n  }\n\n  @Override\n  public MessageStubMappingOrMappings deserialize(JsonParser parser, DeserializationContext ctxt)\n      throws IOException {\n    JsonNode rootNode = parser.readValueAsTree();\n    Class<? extends MessageStubMappingOrMappings> clazz;\n    if (rootNode.has(\"messageMappings\")) {\n      clazz = MessageStubMappingCollection.class;\n    } else {\n      clazz = SingleMessageStubMappingWrapper.class;\n    }\n    return ctxt.readTreeAsValue(rootNode, clazz);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageStubMappings.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.store.MessageStubMappingStore;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class MessageStubMappings {\n\n  private final MessageStubMappingStore store;\n\n  public MessageStubMappings(MessageStubMappingStore store) {\n    this.store = store;\n  }\n\n  public void add(MessageStubMapping mapping) {\n    store.add(mapping);\n  }\n\n  public void remove(UUID id) {\n    store.remove(id);\n  }\n\n  public Optional<MessageStubMapping> get(UUID id) {\n    return store.get(id);\n  }\n\n  public List<MessageStubMapping> getAll() {\n    return store.getAll().collect(Collectors.toList());\n  }\n\n  public List<MessageStubMapping> getAllSortedByPriority() {\n    return store\n        .getAll()\n        .sorted(\n            Comparator.comparingInt(\n                m ->\n                    m.getPriority() != null\n                        ? m.getPriority()\n                        : MessageStubMapping.DEFAULT_PRIORITY))\n        .collect(Collectors.toList());\n  }\n\n  public void clear() {\n    store.clear();\n  }\n\n  public int size() {\n    return (int) store.getAll().count();\n  }\n\n  public Optional<MessageStubMapping> findMatchingStub(MessageChannel channel, Message message) {\n    return getAllSortedByPriority().stream()\n        .filter(stub -> stub.matches(channel, message))\n        .findFirst();\n  }\n\n  public List<MessageStubMapping> findByMetadata(final StringValuePattern pattern) {\n    return store\n        .getAll()\n        .filter(\n            stubMapping -> {\n              String metadataJson = Json.write(stubMapping.getMetadata());\n              return pattern.match(metadataJson).isExactMatch();\n            })\n        .collect(Collectors.toList());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageStubRequestHandler.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static java.util.Base64.*;\n\nimport com.github.tomakehurst.wiremock.common.InputStreamSource;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport com.github.tomakehurst.wiremock.common.entity.BinaryEntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.CompressionType;\nimport com.github.tomakehurst.wiremock.common.entity.EncodingType;\nimport com.github.tomakehurst.wiremock.common.entity.Entity;\nimport com.github.tomakehurst.wiremock.common.entity.EntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.FormatType;\nimport com.github.tomakehurst.wiremock.common.entity.StringEntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.TextEntityDefinition;\nimport com.github.tomakehurst.wiremock.extension.MessageActionTransformer;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport com.github.tomakehurst.wiremock.verification.MessageJournal;\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.io.ByteArrayInputStream;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Optional;\n\npublic class MessageStubRequestHandler {\n\n  private final MessageStubMappings messageStubMappings;\n  private final MessageChannels messageChannels;\n  private final MessageJournal messageJournal;\n  private final Stores stores;\n  private final List<MessageActionTransformer> actionTransformers;\n\n  public MessageStubRequestHandler(\n      MessageStubMappings messageStubMappings,\n      MessageChannels messageChannels,\n      MessageJournal messageJournal,\n      Stores stores,\n      List<MessageActionTransformer> actionTransformers) {\n    this.messageStubMappings = messageStubMappings;\n    this.messageChannels = messageChannels;\n    this.messageJournal = messageJournal;\n    this.stores = stores;\n    this.actionTransformers =\n        actionTransformers != null ? actionTransformers : Collections.emptyList();\n  }\n\n  public void processMessage(MessageChannel channel, Message message) {\n    Optional<MessageStubMapping> matchingStub =\n        messageStubMappings.findMatchingStub(channel, message);\n    if (matchingStub.isPresent()) {\n      MessageStubMapping stub = matchingStub.get();\n      executeActions(stub, channel, message);\n\n      MessageServeEvent event = MessageServeEvent.receivedMatched(channel, message, stub);\n      messageJournal.messageReceived(event);\n    } else {\n      MessageServeEvent event = MessageServeEvent.receivedUnmatched(channel, message);\n      messageJournal.messageReceived(event);\n    }\n  }\n\n  private void executeActions(\n      MessageStubMapping stub, MessageChannel originatingChannel, Message incomingMessage) {\n    MessageActionContext context =\n        MessageActionContext.forIncomingMessage(stub, originatingChannel, incomingMessage);\n    for (MessageAction action : stub.getActions()) {\n      MessageAction transformedAction = applyTransformations(action, context);\n      executeAction(transformedAction, originatingChannel, incomingMessage);\n    }\n  }\n\n  private MessageAction applyTransformations(MessageAction action, MessageActionContext context) {\n    MessageAction result = action;\n    for (MessageActionTransformer transformer : actionTransformers) {\n      if (transformer.applyGlobally() || action.hasTransformer(transformer)) {\n        result = transformer.transform(result, context);\n      }\n    }\n    return result;\n  }\n\n  private void executeAction(\n      MessageAction action, MessageChannel originatingChannel, Message incomingMessage) {\n    if (action instanceof SendMessageAction sendAction) {\n      executeSendMessageAction(sendAction, originatingChannel);\n    }\n  }\n\n  private void executeSendMessageAction(\n      SendMessageAction action, MessageChannel originatingChannel) {\n    Message message = resolveToMessage(action.getMessage());\n    ChannelTarget target = action.getChannelTarget();\n\n    if (target instanceof OriginatingChannelTarget) {\n      originatingChannel.sendMessage(message);\n    } else if (target instanceof RequestInitiatedChannelTarget requestTarget) {\n      List<RequestInitiatedMessageChannel> matchingChannels;\n      if (requestTarget.getChannelType() != null) {\n        matchingChannels =\n            messageChannels.findByTypeAndRequestPattern(\n                requestTarget.getChannelType(),\n                requestTarget.getRequestPattern(),\n                Collections.emptyMap());\n      } else {\n        matchingChannels =\n            messageChannels.findByRequestPattern(\n                requestTarget.getRequestPattern(), Collections.emptyMap());\n      }\n      for (RequestInitiatedMessageChannel channel : matchingChannels) {\n        channel.sendMessage(message);\n      }\n    }\n  }\n\n  public Message resolveToMessage(MessageDefinition messageDefinition) {\n    return resolveToMessage(messageDefinition, stores);\n  }\n\n  public static Message resolveToMessage(MessageDefinition messageDefinition, Stores stores) {\n    Entity entity = resolveEntity(messageDefinition.getBody(), stores);\n    return new Message(entity);\n  }\n\n  private static Entity resolveEntity(EntityDefinition definition, Stores stores) {\n    if (definition instanceof StringEntityDefinition) {\n      String value = ((StringEntityDefinition) definition).getValue();\n      byte[] bytes = value != null ? value.getBytes(StandardCharsets.UTF_8) : new byte[0];\n      InputStreamSource streamSource = () -> new ByteArrayInputStream(bytes);\n      return new Entity(EncodingType.TEXT, FormatType.TEXT, CompressionType.NONE, streamSource);\n    }\n\n    if (definition instanceof BinaryEntityDefinition binaryDef) {\n      byte[] bytes = resolveBinaryEntityData(binaryDef, stores);\n      InputStreamSource streamSource = () -> new ByteArrayInputStream(bytes);\n      return new Entity(\n          EncodingType.BINARY, FormatType.BASE64, binaryDef.getCompression(), streamSource);\n    }\n\n    if (definition instanceof TextEntityDefinition textDef) {\n      String resolvedData = resolveTextEntityData(textDef, stores);\n      byte[] bytes =\n          resolvedData != null ? resolvedData.getBytes(StandardCharsets.UTF_8) : new byte[0];\n      InputStreamSource streamSource = () -> new ByteArrayInputStream(bytes);\n      return new Entity(\n          EncodingType.TEXT, textDef.getFormat(), textDef.getCompression(), streamSource);\n    }\n\n    throw new UnsupportedOperationException(\n        \"Resolution of \" + definition.getClass().getSimpleName() + \" is not yet supported\");\n  }\n\n  private static String resolveTextEntityData(TextEntityDefinition definition, Stores stores) {\n    Object data = definition.getData();\n\n    if (data instanceof String s) {\n      return s;\n    }\n\n    if (data != null) {\n      return Json.write(data);\n    }\n\n    String filePath = definition.getFilePath();\n    if (filePath != null && stores != null) {\n      BlobStore filesBlobStore = stores.getFilesBlobStore();\n      return filesBlobStore.get(filePath).map(Strings::stringFromBytes).orElse(null);\n    }\n\n    String dataStore = definition.getDataStore();\n    String dataRef = definition.getDataRef();\n    if (dataStore != null && dataRef != null && stores != null) {\n      return stores\n          .getObjectStore(dataStore)\n          .get(dataRef)\n          .map(\n              value -> {\n                if (value instanceof String s) {\n                  return s;\n                }\n                return Json.write(value);\n              })\n          .orElse(null);\n    }\n\n    return null;\n  }\n\n  private static byte[] resolveBinaryEntityData(BinaryEntityDefinition definition, Stores stores) {\n    byte[] data = definition.getDataAsBytes();\n    if (data != null) {\n      return data;\n    }\n\n    String filePath = definition.getFilePath();\n    if (filePath != null && stores != null) {\n      BlobStore filesBlobStore = stores.getFilesBlobStore();\n      return filesBlobStore.get(filePath).orElse(new byte[0]);\n    }\n\n    String dataStore = definition.getDataStore();\n    String dataRef = definition.getDataRef();\n    if (dataStore != null && dataRef != null && stores != null) {\n      return stores\n          .getObjectStore(dataStore)\n          .get(dataRef)\n          .map(\n              value -> {\n                if (value instanceof byte[] bytes) {\n                  return bytes;\n                }\n                if (value instanceof String s) {\n                  return getDecoder().decode(s);\n                }\n                return new byte[0];\n              })\n          .orElse(new byte[0]);\n    }\n\n    return new byte[0];\n  }\n\n  public MessageStubMappings getMessageStubMappings() {\n    return messageStubMappings;\n  }\n\n  public MessageChannels getMessageChannels() {\n    return messageChannels;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/MessageTrigger.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.fasterxml.jackson.annotation.JsonSubTypes;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\n\n@JsonTypeInfo(\n    use = JsonTypeInfo.Id.NAME,\n    property = \"type\",\n    defaultImpl = IncomingMessageTrigger.class)\n@JsonSubTypes({\n  @JsonSubTypes.Type(value = IncomingMessageTrigger.class, name = \"message\"),\n  @JsonSubTypes.Type(value = HttpStubTrigger.class, name = \"http-stub\"),\n  @JsonSubTypes.Type(value = HttpRequestTrigger.class, name = \"http-request\")\n})\npublic interface MessageTrigger {\n\n  MessageTrigger ANYTHING = IncomingMessageTrigger.ANYTHING;\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/OriginatingChannelTarget.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\npublic class OriginatingChannelTarget implements ChannelTarget {\n\n  public static final OriginatingChannelTarget INSTANCE = new OriginatingChannelTarget();\n\n  public OriginatingChannelTarget() {}\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    return true;\n  }\n\n  @Override\n  public int hashCode() {\n    return getClass().hashCode();\n  }\n\n  @Override\n  public String toString() {\n    return \"OriginatingChannelTarget{}\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/RequestInitiatedChannelPattern.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport java.util.Collections;\nimport java.util.Objects;\n\n@JsonInclude(NON_EMPTY)\npublic class RequestInitiatedChannelPattern implements ChannelPattern {\n\n  private final RequestPattern initiatingRequestPattern;\n  private final ChannelType channelType;\n\n  @JsonCreator\n  public RequestInitiatedChannelPattern(\n      @JsonProperty(\"type\") ChannelType type,\n      @JsonProperty(\"initiatingRequestPattern\") RequestPattern initiatingRequestPattern) {\n    this.channelType = type;\n    this.initiatingRequestPattern = initiatingRequestPattern;\n  }\n\n  public static RequestInitiatedChannelPattern forRequestPattern(\n      ChannelType channelType, RequestPattern requestPattern) {\n    return new RequestInitiatedChannelPattern(channelType, requestPattern);\n  }\n\n  @Override\n  @JsonInclude\n  public ChannelType getType() {\n    return channelType;\n  }\n\n  public RequestPattern getInitiatingRequestPattern() {\n    return initiatingRequestPattern;\n  }\n\n  @Override\n  public boolean matches(MessageChannel channel) {\n    if (channel instanceof RequestInitiatedMessageChannel) {\n      return matches(((RequestInitiatedMessageChannel) channel).getInitiatingRequest());\n    }\n    return initiatingRequestPattern == null;\n  }\n\n  public boolean matches(Request channelRequest) {\n    if (initiatingRequestPattern != null) {\n      MatchResult channelMatch =\n          initiatingRequestPattern.match(channelRequest, Collections.emptyMap());\n      return channelMatch.isExactMatch();\n    }\n    return true;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    RequestInitiatedChannelPattern that = (RequestInitiatedChannelPattern) o;\n    return Objects.equals(initiatingRequestPattern, that.initiatingRequestPattern);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(initiatingRequestPattern);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/RequestInitiatedChannelTarget.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport java.util.Objects;\n\npublic class RequestInitiatedChannelTarget implements ChannelTarget {\n\n  private final ChannelType channelType;\n  private final RequestPattern requestPattern;\n\n  @JsonCreator\n  public RequestInitiatedChannelTarget(\n      @JsonProperty(\"channelType\") ChannelType channelType,\n      @JsonProperty(\"requestPattern\") RequestPattern requestPattern) {\n    this.channelType = channelType;\n    this.requestPattern = requestPattern;\n  }\n\n  public static RequestInitiatedChannelTarget forPattern(RequestPattern requestPattern) {\n    return new RequestInitiatedChannelTarget(null, requestPattern);\n  }\n\n  public static RequestInitiatedChannelTarget forTypeAndPattern(\n      ChannelType channelType, RequestPattern requestPattern) {\n    return new RequestInitiatedChannelTarget(channelType, requestPattern);\n  }\n\n  @JsonInclude(JsonInclude.Include.NON_NULL)\n  public ChannelType getChannelType() {\n    return channelType;\n  }\n\n  public RequestPattern getRequestPattern() {\n    return requestPattern;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    RequestInitiatedChannelTarget that = (RequestInitiatedChannelTarget) o;\n    return channelType == that.channelType && Objects.equals(requestPattern, that.requestPattern);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(channelType, requestPattern);\n  }\n\n  @Override\n  public String toString() {\n    return \"RequestInitiatedChannelTarget{\"\n        + \"channelType=\"\n        + channelType\n        + \", requestPattern=\"\n        + requestPattern\n        + '}';\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/RequestInitiatedMessageChannel.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport com.github.tomakehurst.wiremock.http.Request;\n\npublic interface RequestInitiatedMessageChannel extends MessageChannel {\n\n  Request getInitiatingRequest();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/SendMessageAction.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.entity.EntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.StringEntityDefinition;\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Objects;\nimport org.jspecify.annotations.NonNull;\n\n@JsonInclude(NON_EMPTY)\npublic class SendMessageAction implements MessageAction {\n\n  @NonNull private final MessageDefinition message;\n  @NonNull private final ChannelTarget channelTarget;\n  @NonNull private final List<String> transformers;\n  @NonNull private final Parameters transformerParameters;\n\n  @JsonCreator\n  public SendMessageAction(\n      @JsonProperty(\"message\") MessageDefinition message,\n      @JsonProperty(\"channelTarget\") ChannelTarget channelTarget,\n      @JsonProperty(\"transformers\") List<String> transformers,\n      @JsonProperty(\"transformerParameters\") Parameters transformerParameters) {\n    this.message = message;\n    this.channelTarget = channelTarget != null ? channelTarget : OriginatingChannelTarget.INSTANCE;\n    this.transformers = transformers != null ? new ArrayList<>(transformers) : new ArrayList<>();\n    this.transformerParameters =\n        transformerParameters != null ? transformerParameters : Parameters.empty();\n  }\n\n  public static SendMessageAction toOriginatingChannel(EntityDefinition body) {\n    return new SendMessageAction(\n        new MessageDefinition(body), OriginatingChannelTarget.INSTANCE, null, null);\n  }\n\n  public static SendMessageAction toOriginatingChannel(String messageBody) {\n    return toOriginatingChannel(new StringEntityDefinition(messageBody));\n  }\n\n  public static SendMessageAction toMatchingChannels(\n      EntityDefinition body, RequestPattern targetChannelPattern) {\n    return new SendMessageAction(\n        new MessageDefinition(body),\n        RequestInitiatedChannelTarget.forPattern(targetChannelPattern),\n        null,\n        null);\n  }\n\n  public static SendMessageAction toMatchingChannels(\n      String messageBody, RequestPattern targetChannelPattern) {\n    return toMatchingChannels(new StringEntityDefinition(messageBody), targetChannelPattern);\n  }\n\n  public MessageDefinition getMessage() {\n    return message;\n  }\n\n  @JsonIgnore\n  public EntityDefinition getBody() {\n    return message != null ? message.getBody() : null;\n  }\n\n  public ChannelTarget getChannelTarget() {\n    return channelTarget;\n  }\n\n  @JsonInclude(NON_EMPTY)\n  public List<String> getTransformers() {\n    return Collections.unmodifiableList(transformers);\n  }\n\n  @JsonInclude(NON_EMPTY)\n  public Parameters getTransformerParameters() {\n    return transformerParameters;\n  }\n\n  @Override\n  public boolean hasTransformer(Extension transformer) {\n    return transformers.contains(transformer.getName());\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    SendMessageAction that = (SendMessageAction) o;\n    return Objects.equals(message, that.message)\n        && Objects.equals(channelTarget, that.channelTarget)\n        && Objects.equals(transformers, that.transformers)\n        && Objects.equals(transformerParameters, that.transformerParameters);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(message, channelTarget, transformers, transformerParameters);\n  }\n\n  @Override\n  public String toString() {\n    return \"SendMessageAction{\"\n        + \"message='\"\n        + message\n        + '\\''\n        + \", channelTarget=\"\n        + channelTarget\n        + \", transformers=\"\n        + transformers\n        + '}';\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/SendMessageActionBuilder.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.github.tomakehurst.wiremock.common.entity.TextEntityDefinition.aTextMessage;\n\nimport com.github.tomakehurst.wiremock.common.entity.EntityDefinition;\nimport com.github.tomakehurst.wiremock.common.entity.TextEntityDefinition;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class SendMessageActionBuilder {\n\n  private TextEntityDefinition.Builder textEntityBuilder = aTextMessage();\n  private final List<String> transformers = new ArrayList<>();\n  private Parameters transformerParameters = Parameters.empty();\n\n  public SendMessageActionBuilder() {}\n\n  public SendMessageActionBuilder withBody(String message) {\n    this.textEntityBuilder.withBody(message);\n    return this;\n  }\n\n  public SendMessageActionBuilder withBody(Object data) {\n    textEntityBuilder.withBody(data);\n    return this;\n  }\n\n  public SendMessageActionBuilder withBodyFromStore(String storeName, String key) {\n    textEntityBuilder.withDataStore(storeName);\n    textEntityBuilder.withDataRef(key);\n    return this;\n  }\n\n  public SendMessageActionBuilder withBodyFromFile(String filePath) {\n    textEntityBuilder.withFilePath(filePath);\n    return this;\n  }\n\n  public SendMessageActionBuilder withTransformer(String transformerName) {\n    this.transformers.add(transformerName);\n    return this;\n  }\n\n  public SendMessageActionBuilder withTransformers(String... transformerNames) {\n    for (String name : transformerNames) {\n      this.transformers.add(name);\n    }\n    return this;\n  }\n\n  public SendMessageActionBuilder withTransformerParameters(Parameters parameters) {\n    this.transformerParameters = parameters;\n    return this;\n  }\n\n  public SendMessageActionBuilder withTransformerParameter(String key, Object value) {\n    this.transformerParameters = this.transformerParameters.merge(Parameters.one(key, value));\n    return this;\n  }\n\n  private EntityDefinition resolveBody() {\n    return textEntityBuilder.build();\n  }\n\n  public SendMessageAction onOriginatingChannel() {\n    return new SendMessageAction(\n        new MessageDefinition(resolveBody()),\n        OriginatingChannelTarget.INSTANCE,\n        transformers,\n        transformerParameters);\n  }\n\n  public SendMessageAction onChannelsMatching(RequestPattern targetChannelPattern) {\n    return new SendMessageAction(\n        new MessageDefinition(resolveBody()),\n        RequestInitiatedChannelTarget.forPattern(targetChannelPattern),\n        transformers,\n        transformerParameters);\n  }\n\n  public SendMessageAction onChannelsMatching(RequestPatternBuilder targetChannelPatternBuilder) {\n    return onChannelsMatching(targetChannelPatternBuilder.build());\n  }\n\n  public TargetedSendMessageActionBuilder toOriginatingChannel() {\n    return new TargetedSendMessageActionBuilder(\n        OriginatingChannelTarget.INSTANCE, transformers, transformerParameters);\n  }\n\n  public TargetedSendMessageActionBuilder toMatchingChannels(RequestPattern targetChannelPattern) {\n    return new TargetedSendMessageActionBuilder(\n        RequestInitiatedChannelTarget.forPattern(targetChannelPattern),\n        transformers,\n        transformerParameters);\n  }\n\n  public TargetedSendMessageActionBuilder toMatchingChannels(\n      RequestPatternBuilder targetChannelPatternBuilder) {\n    return new TargetedSendMessageActionBuilder(\n        RequestInitiatedChannelTarget.forPattern(targetChannelPatternBuilder.build()),\n        transformers,\n        transformerParameters);\n  }\n\n  public static class TargetedSendMessageActionBuilder {\n    private final ChannelTarget channelTarget;\n    private final List<String> transformers;\n    private final Parameters transformerParameters;\n\n    TargetedSendMessageActionBuilder(\n        ChannelTarget channelTarget, List<String> transformers, Parameters transformerParameters) {\n      this.channelTarget = channelTarget;\n      this.transformers = transformers;\n      this.transformerParameters = transformerParameters;\n    }\n\n    public SendMessageAction withMessage(EntityDefinition body) {\n      return new SendMessageAction(\n          new MessageDefinition(body), channelTarget, transformers, transformerParameters);\n    }\n\n    public SendMessageAction withMessage(EntityDefinition.Builder<?> bodyBuilder) {\n      return withMessage(bodyBuilder.build());\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/SingleMessageStubMappingWrapper.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.UUID;\n\n@JsonDeserialize()\nclass SingleMessageStubMappingWrapper implements MessageStubMappingOrMappings {\n\n  private final MessageStubMapping mapping;\n\n  @JsonCreator\n  public SingleMessageStubMappingWrapper(\n      @JsonProperty(\"id\") UUID id,\n      @JsonProperty(\"name\") String name,\n      @JsonProperty(\"priority\") Integer priority,\n      @JsonProperty(\"trigger\") MessageTrigger trigger,\n      @JsonProperty(\"actions\") List<MessageAction> actions,\n      @JsonProperty(\"metadata\") Metadata metadata,\n      @JsonProperty(\"insertionIndex\") Long insertionIndex) {\n    this.mapping =\n        new MessageStubMapping(\n            id, name, priority, trigger, actions, metadata, getFirstNonNull(insertionIndex, 0L));\n  }\n\n  @Override\n  public List<MessageStubMapping> getMappingOrMappings() {\n    return Collections.singletonList(mapping);\n  }\n\n  @Override\n  public boolean isMulti() {\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/websocket/WebSocketMessageChannel.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message.websocket;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.Message;\nimport com.github.tomakehurst.wiremock.message.RequestInitiatedMessageChannel;\nimport java.util.UUID;\n\npublic class WebSocketMessageChannel implements RequestInitiatedMessageChannel {\n\n  private final UUID id;\n  private final Request request;\n  private final WebSocketSession session;\n\n  public WebSocketMessageChannel(UUID id, Request request, WebSocketSession session) {\n    this.id = id;\n    this.request = request;\n    this.session = session;\n  }\n\n  public WebSocketMessageChannel(Request request, WebSocketSession session) {\n    this(UUID.randomUUID(), request, session);\n  }\n\n  @Override\n  public ChannelType getType() {\n    return ChannelType.WEBSOCKET;\n  }\n\n  @Override\n  public UUID getId() {\n    return id;\n  }\n\n  @Override\n  public Request getInitiatingRequest() {\n    return request;\n  }\n\n  public WebSocketSession getSession() {\n    return session;\n  }\n\n  @Override\n  public boolean isOpen() {\n    return session != null && session.isOpen();\n  }\n\n  @Override\n  public void sendMessage(Message message) {\n    if (session != null && session.isOpen()) {\n      session.sendMessage(message);\n    }\n  }\n\n  @Override\n  public void close() {\n    if (session != null && session.isOpen()) {\n      session.close();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/message/websocket/WebSocketSession.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.message.websocket;\n\nimport com.github.tomakehurst.wiremock.message.Message;\n\npublic interface WebSocketSession {\n\n  boolean isOpen();\n\n  void sendMessage(Message message);\n\n  void close();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/proxy/ProxiedHostnameRewriteResponseTransformer.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.proxy;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_LENGTH;\nimport static org.wiremock.url.SchemeRegistry.https;\nimport static org.wiremock.url.SchemeRegistry.ws;\nimport static org.wiremock.url.SchemeRegistry.wss;\n\nimport com.github.tomakehurst.wiremock.common.ContentTypes;\nimport com.github.tomakehurst.wiremock.common.Gzip;\nimport com.github.tomakehurst.wiremock.extension.ResponseTransformerV2;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.regex.Pattern;\nimport java.util.stream.Collectors;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.Host;\nimport org.wiremock.url.HostAndPort;\nimport org.wiremock.url.Path;\nimport org.wiremock.url.Port;\nimport org.wiremock.url.Scheme;\nimport org.wiremock.url.Url;\n\n/**\n * At the moment this transformer works with Proxy responses to replace the host and port. If we\n * decide to extend this to a generic host/port replacement we should rename the class and update\n * the transformer name\n */\npublic class ProxiedHostnameRewriteResponseTransformer implements ResponseTransformerV2 {\n\n  @Override\n  public Response transform(Response response, ServeEvent serveEvent) {\n\n    if (!serveEvent.getResponseDefinition().isProxyResponse()) {\n      return response;\n    }\n\n    var substitutionData = getSubstitutionData(serveEvent);\n\n    // Update headers\n    List<HttpHeader> updatedHeaderList =\n        response.getHeaders().all().stream()\n            .map(\n                header ->\n                    new HttpHeader(\n                        header.key(),\n                        header.values().stream()\n                            .map(value -> applySubstitutions(value, substitutionData))\n                            .toList()))\n            .toList();\n    HttpHeaders updatedHeaders = new HttpHeaders(updatedHeaderList);\n\n    Response.Builder responseBuilder = Response.Builder.like(response).headers(updatedHeaders);\n\n    // Update body if applicable\n    byte[] initialBody = response.getBody();\n    if (initialBody != null\n        && initialBody.length > 0\n        && ContentTypes.determineIsTextFromMimeType(getMimeType(response))) {\n      byte[] updatedBody;\n      if (Gzip.isGzipped(initialBody)) {\n        String uncompressedBody = Gzip.unGzipToString(initialBody);\n        uncompressedBody = applySubstitutions(uncompressedBody, substitutionData);\n        updatedBody = Gzip.gzip(uncompressedBody.getBytes());\n      } else {\n        String responseBodyAsString = response.getBodyAsString();\n        responseBodyAsString = applySubstitutions(responseBodyAsString, substitutionData);\n        updatedBody = responseBodyAsString.getBytes();\n      }\n      responseBuilder.body(updatedBody);\n\n      // Update Content-Length header if present\n      if (updatedHeaders.getHeader(CONTENT_LENGTH).isPresent()) {\n        responseBuilder.headers(\n            setContentLengthHeader(updatedHeaders, String.valueOf(updatedBody.length)));\n      }\n    }\n\n    return responseBuilder.build();\n  }\n\n  private static String applySubstitutions(String input, SubstitutionData data) {\n    return data.combinedPattern.matcher(input).replaceAll(data::getReplacement);\n  }\n\n  private static class SubstitutionData {\n    private final Pattern combinedPattern;\n    private final Map<String, String> replacementMap;\n\n    SubstitutionData(Map<Pattern, String> substitutions) {\n      this.replacementMap = new LinkedHashMap<>();\n      StringBuilder combinedPatternBuilder = new StringBuilder();\n      int groupIndex = 0;\n\n      for (Map.Entry<Pattern, String> entry : substitutions.entrySet()) {\n        if (groupIndex > 0) {\n          combinedPatternBuilder.append(\"|\");\n        }\n        String patternStr = entry.getKey().pattern();\n        combinedPatternBuilder.append(\"(\").append(patternStr).append(\")\");\n        replacementMap.put(String.valueOf(groupIndex), entry.getValue());\n        groupIndex++;\n      }\n\n      this.combinedPattern =\n          Pattern.compile(combinedPatternBuilder.toString(), Pattern.CASE_INSENSITIVE);\n    }\n\n    String getReplacement(java.util.regex.MatchResult matchResult) {\n      for (int i = 1; i <= matchResult.groupCount(); i++) {\n        if (matchResult.group(i) != null) {\n          return replacementMap.get(String.valueOf(i - 1));\n        }\n      }\n      return matchResult.group(0);\n    }\n  }\n\n  @Override\n  public String getName() {\n    return \"proxied-hostname-rewrite\";\n  }\n\n  @Override\n  public boolean applyGlobally() {\n    return false;\n  }\n\n  private static HttpHeaders setContentLengthHeader(HttpHeaders headers, String value) {\n    List<HttpHeader> filteredHeaders =\n        headers.all().stream()\n            .filter(h -> !h.keyEquals(CONTENT_LENGTH))\n            .collect(Collectors.toList());\n    filteredHeaders.add(new HttpHeader(CONTENT_LENGTH, value));\n    return new HttpHeaders(filteredHeaders);\n  }\n\n  private static String getMimeType(Response response) {\n    HttpHeaders responseHeaders = response.getHeaders();\n    return responseHeaders != null && responseHeaders.getContentTypeHeader() != null\n        ? responseHeaders.getContentTypeHeader().mimeTypePart()\n        : null;\n  }\n\n  /**\n   * This method can be used to pull substitution data from other sources such as stub metadata\n   *\n   * @param serveEvent the serveEvent for this request/response\n   * @return The SubstitutionData containing combined pattern and replacements\n   */\n  private static SubstitutionData getSubstitutionData(ServeEvent serveEvent) {\n\n    AbsoluteUrl proxyUrl =\n        serveEvent\n            .getRequest()\n            .getTypedAbsoluteUrl()\n            .transform(b -> b.setPath(Path.EMPTY).setQuery(null));\n    var proxyDefaultPort = proxyUrl.getScheme().getDefaultPort();\n    var proxyActualPort = proxyUrl.getResolvedPort();\n    var proxyWsScheme = getWebSocketScheme(proxyUrl);\n\n    AbsoluteUrl originUrl =\n        AbsoluteUrl.parse(serveEvent.getResponseDefinition().getProxyBaseUrl())\n            .transform(b -> b.setPath(Path.EMPTY).setQuery(null));\n    var originDefaultPort = originUrl.getScheme().getDefaultPort();\n    var originActualPort = originUrl.getResolvedPort();\n    var originWsScheme = getWebSocketScheme(originUrl);\n\n    var replacements = new LinkedHashMap<Pattern, String>();\n\n    if (Objects.equals(originActualPort, originDefaultPort)) {\n      if (Objects.equals(proxyActualPort, proxyDefaultPort)) {\n        // origin is on default port, proxy is on default port\n\n        // https://origin.example.com:443 -> https://proxy.example.com:443\n        replacements.put(\n            fullUrlPattern(originUrl.getScheme(), originUrl.getHost(), originActualPort),\n            proxyUrl.transform(it -> it.setPort(proxyActualPort)).toString());\n\n        // https://origin.example.com -> https://proxy.example.com\n        replacements.put(\n            fullUrlPattern(originUrl.getScheme(), originUrl.getHost()),\n            proxyUrl.transform(it -> it.setPort(null)).toString());\n\n        // wss://origin.example.com:443 -> wss://proxy.example.com:443\n        replacements.put(\n            fullUrlPattern(originWsScheme, originUrl.getHost(), originActualPort),\n            Url.builder()\n                .setScheme(proxyWsScheme)\n                .setHost(proxyUrl.getHost())\n                .setPort(proxyActualPort)\n                .setPath(Path.EMPTY)\n                .build()\n                .toString());\n\n        // wss://origin.example.com -> wss://proxy.example.com\n        replacements.put(\n            fullUrlPattern(originWsScheme, originUrl.getHost()),\n            Url.builder()\n                .setScheme(proxyWsScheme)\n                .setHost(proxyUrl.getHost())\n                .setPath(Path.EMPTY)\n                .build()\n                .toString());\n\n        // origin.example.com:443 -> proxy.example.com:443\n        replacements.put(\n            schemelessPattern(originUrl.getHost(), originActualPort),\n            HostAndPort.of(proxyUrl.getHost(), proxyActualPort).toString());\n\n        // origin.example.com -> proxy.example.com\n        replacements.put(schemelessPattern(originUrl.getHost()), proxyUrl.getHost().toString());\n\n        // //origin.example.com -> //proxy.example.com\n        replacements.put(\n            pattern(\"[^:]\", \"//\" + originUrl.getHost(), possibleHostPrefix),\n            \"//\" + proxyUrl.getHost());\n      } else {\n        // origin is on default port, proxy is on custom port\n\n        // https://origin.example.com:443 -> https://proxy.example.com:4434\n        replacements.put(\n            fullUrlPattern(originUrl.getScheme(), originUrl.getHost(), originActualPort),\n            proxyUrl.getScheme() + \"://\" + proxyUrl.getHost() + \":\" + proxyActualPort);\n\n        // https://origin.example.com -> https://proxy.example.com:4434\n        replacements.put(\n            fullUrlPattern(originUrl.getScheme(), originUrl.getHost()),\n            proxyUrl.getScheme() + \"://\" + proxyUrl.getHost() + \":\" + proxyActualPort);\n\n        // wss://origin.example.com:443 -> wss://proxy.example.com:4434\n        replacements.put(\n            fullUrlPattern(originWsScheme, originUrl.getHost(), originActualPort),\n            proxyWsScheme + \"://\" + proxyUrl.getHost() + \":\" + proxyActualPort);\n\n        // wss://origin.example.com -> wss://proxy.example.com:4434\n        replacements.put(\n            fullUrlPattern(originWsScheme, originUrl.getHost()),\n            proxyWsScheme + \"://\" + proxyUrl.getHost() + \":\" + proxyActualPort);\n\n        // origin.example.com:443 -> proxy.example.com:4434\n        replacements.put(\n            schemelessPattern(originUrl.getHost(), originActualPort),\n            proxyUrl.getHost() + \":\" + proxyActualPort);\n\n        // origin.example.com -> proxy.example.com:4434\n        replacements.put(\n            schemelessPattern(originUrl.getHost()), proxyUrl.getHost() + \":\" + proxyActualPort);\n\n        // //origin.example.com -> https://proxy.example.com:4434\n        replacements.put(\n            pattern(\"[^:]\", \"//\" + originUrl.getHost(), possibleHostPrefix),\n            proxyUrl.getScheme() + \"://\" + proxyUrl.getHost() + \":\" + proxyActualPort);\n      }\n    } else {\n      if (Objects.equals(proxyActualPort, proxyDefaultPort)) {\n        // origin is on custom port, proxy is on default port\n\n        // https://origin.example.com:4434 -> https://proxy.example.com\n        replacements.put(\n            fullUrlPattern(originUrl.getScheme(), originUrl.getHost(), originActualPort),\n            proxyUrl.getScheme() + \"://\" + proxyUrl.getHost());\n\n        // wss://origin.example.com:4434 -> wss://proxy.example.com\n        replacements.put(\n            fullUrlPattern(originWsScheme, originUrl.getHost(), originActualPort),\n            proxyWsScheme + \"://\" + proxyUrl.getHost());\n\n        // origin.example.com:4434 -> proxy.example.com\n        replacements.put(\n            schemelessPattern(originUrl.getHost(), originActualPort),\n            proxyUrl.getHost().toString());\n\n        // origin.example.com -> proxy.example.com\n        replacements.put(schemelessPattern(originUrl.getHost()), proxyUrl.getHost().toString());\n      } else {\n        // origin is on custom port, proxy is on custom port\n\n        // https://origin.example.com:4434 -> https://proxy.example.com:4434\n        replacements.put(\n            fullUrlPattern(originUrl.getScheme(), originUrl.getHost(), originActualPort),\n            proxyUrl.getScheme() + \"://\" + proxyUrl.getHost() + \":\" + proxyActualPort);\n\n        // wss://origin.example.com:4434 -> wss://proxy.example.com:4434\n        replacements.put(\n            fullUrlPattern(originWsScheme, originUrl.getHost(), originActualPort),\n            proxyWsScheme + \"://\" + proxyUrl.getHost() + \":\" + proxyActualPort);\n\n        // origin.example.com:4434 -> proxy.example.com:4434\n        replacements.put(\n            schemelessPattern(originUrl.getHost(), originActualPort),\n            proxyUrl.getHost() + \":\" + proxyActualPort);\n\n        // origin.example.com -> proxy.example.com\n        replacements.put(schemelessPattern(originUrl.getHost()), proxyUrl.getHost().toString());\n      }\n    }\n\n    return new SubstitutionData(replacements);\n  }\n\n  // language=RegExp\n  private static final String possibleSchemePrefixes = \"[^a-zA-Z0-9+-.]\";\n  // language=RegExp\n  private static final String possibleHostPrefix = \"[^a-zA-Z0-9-.!$&'()*+,;=:/]\";\n  // language=RegExp\n  private static final String possibleHostPostfix = \"[^a-zA-Z0-9-.!$&'()*+,;=:]\";\n  // language RegExp\n  private static final String possiblePortPostfix = \"\\\\D\";\n\n  private static Pattern fullUrlPattern(Scheme scheme, Host host) {\n    return pattern(possibleSchemePrefixes, scheme + \"://\" + host, possibleHostPostfix);\n  }\n\n  private static Pattern fullUrlPattern(Scheme scheme, Host host, Port port) {\n    return pattern(possibleSchemePrefixes, scheme + \"://\" + host + \":\" + port, possiblePortPostfix);\n  }\n\n  private static Pattern schemelessPattern(Host host) {\n    return pattern(possibleHostPrefix, host.toString(), possibleHostPostfix);\n  }\n\n  private static Pattern schemelessPattern(Host host, Port port) {\n    return pattern(possibleHostPrefix, host + \":\" + port, possiblePortPostfix);\n  }\n\n  private static Pattern pattern(String prefixPattern, String literal, String postfixPattern) {\n    return Pattern.compile(\n        \"(?<=\" + prefixPattern + \"|^)\" + Pattern.quote(literal) + \"(?=\" + postfixPattern + \"|$)\",\n        Pattern.CASE_INSENSITIVE);\n  }\n\n  private static Scheme getWebSocketScheme(AbsoluteUrl proxyUrl) {\n    return proxyUrl.getScheme().equals(https) ? wss : ws;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/CaptureHeadersSpec.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class CaptureHeadersSpec {\n\n  private final Boolean caseInsensitive;\n\n  public CaptureHeadersSpec(@JsonProperty(\"caseInsensitive\") Boolean caseInsensitive) {\n    this.caseInsensitive = caseInsensitive;\n  }\n\n  public Boolean getCaseInsensitive() {\n    return caseInsensitive;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/LoggedResponseDefinitionTransformer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.*;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.Gzip;\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.nio.charset.Charset;\nimport java.util.List;\nimport java.util.function.Function;\nimport java.util.stream.Collectors;\n\n/**\n * Transforms a LoggedResponse into a ResponseDefinition, which will be used to construct a\n * StubMapping\n */\npublic class LoggedResponseDefinitionTransformer\n    implements Function<LoggedResponse, ResponseDefinition> {\n\n  private static final List<CaseInsensitiveKey> EXCLUDED_HEADERS =\n      List.of(\n          CaseInsensitiveKey.from(CONTENT_ENCODING),\n          CaseInsensitiveKey.from(CONTENT_LENGTH),\n          CaseInsensitiveKey.from(TRANSFER_ENCODING));\n\n  @Override\n  public ResponseDefinition apply(LoggedResponse response) {\n    final ResponseDefinitionBuilder responseDefinitionBuilder =\n        new ResponseDefinitionBuilder().withStatus(response.getStatus());\n\n    if (response.getBody() != null && response.getBody().length > 0) {\n\n      byte[] body = bodyDecompressedIfRequired(response);\n      String mimeType = response.getMimeType();\n      Charset charset = response.getCharset();\n      if (determineIsTextFromMimeType(mimeType)) {\n        responseDefinitionBuilder.withBody(Strings.stringFromBytes(body, charset));\n      } else {\n        responseDefinitionBuilder.withBody(body);\n      }\n    }\n\n    if (response.getHeaders() != null) {\n      responseDefinitionBuilder.withHeaders(withoutContentEncodingAndContentLength(response));\n    }\n\n    return responseDefinitionBuilder.build();\n  }\n\n  private byte[] bodyDecompressedIfRequired(LoggedResponse response) {\n    if (response.getHeaders() != null\n        && response.getHeaders().getHeader(CONTENT_ENCODING).containsValue(\"gzip\")) {\n      return Gzip.unGzip(response.getBody());\n    }\n    return response.getBody();\n  }\n\n  private HttpHeaders withoutContentEncodingAndContentLength(LoggedResponse response) {\n    return new HttpHeaders(\n        response.getHeaders().all().stream()\n            .filter(header -> !EXCLUDED_HEADERS.contains(header.caseInsensitiveKey()))\n            .collect(Collectors.toList()));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/NotRecordingException.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.github.tomakehurst.wiremock.common.ClientError;\nimport com.github.tomakehurst.wiremock.common.Errors;\n\npublic class NotRecordingException extends ClientError {\n\n  public NotRecordingException() {\n    super(Errors.notRecording());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/ProxiedServeEventFilters.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonUnwrapped;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\nimport java.util.UUID;\nimport java.util.function.Predicate;\n\n/** A predicate to filter proxied ServeEvents against RequestPattern filters and IDs */\npublic class ProxiedServeEventFilters implements Predicate<ServeEvent> {\n\n  @JsonUnwrapped private RequestPattern filters;\n\n  @JsonUnwrapped private List<UUID> ids;\n\n  @JsonUnwrapped private boolean allowNonProxied;\n\n  public static final ProxiedServeEventFilters ALLOW_ALL =\n      new ProxiedServeEventFilters(null, null, false);\n\n  // For Jackson. This class needs to be mutable as @JsonUnwrapped doesn't yet do constructor based\n  // serialisation\n  public ProxiedServeEventFilters() {}\n\n  public ProxiedServeEventFilters(RequestPattern filters, List<UUID> ids, boolean allowNonProxied) {\n    this.filters = filters;\n    this.ids = ids;\n    this.allowNonProxied = allowNonProxied;\n  }\n\n  public RequestPattern getFilters() {\n    return filters;\n  }\n\n  public void setFilters(RequestPattern filters) {\n    this.filters = filters;\n  }\n\n  public List<UUID> getIds() {\n    return ids;\n  }\n\n  public void setIds(List<UUID> ids) {\n    this.ids = ids;\n  }\n\n  public boolean isAllowNonProxied() {\n    return allowNonProxied;\n  }\n\n  public void setAllowNonProxied(boolean allowNonProxied) {\n    this.allowNonProxied = allowNonProxied;\n  }\n\n  @Override\n  public boolean test(ServeEvent serveEvent) {\n    if (!allowNonProxied && !serveEvent.getResponseDefinition().isProxyResponse()) {\n      return false;\n    }\n\n    if (filters != null && !filters.match(serveEvent.getRequest()).isExactMatch()) {\n      return false;\n    }\n\n    return ids == null || ids.contains(serveEvent.getId());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RecordError.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonSubTypes;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\n@JsonTypeInfo(\n    use = JsonTypeInfo.Id.NAME,\n    include = JsonTypeInfo.As.PROPERTY,\n    property = \"errorType\")\n@JsonSubTypes({\n  @JsonSubTypes.Type(\n      value = RecordError.StubGenerationFailure.class,\n      name = \"stub-generation-failure\"),\n})\npublic sealed interface RecordError permits RecordError.StubGenerationFailure {\n  record StubGenerationFailure(String reason, ServeEvent originalServeEvent)\n      implements RecordError {}\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RecordSpec.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport java.util.List;\nimport java.util.Map;\n\n/** Encapsulates options for generating and outputting StubMappings */\npublic class RecordSpec {\n\n  // Target URL when using the recording API. Not applicable to snapshotting\n  private final String targetBaseUrl;\n\n  // Whitelist requests to generate StubMappings for\n  private final ProxiedServeEventFilters filters;\n\n  // Headers from the request to include in the stub mapping, if they match the corresponding\n  // matcher\n  private final Map<String, CaptureHeadersSpec> captureHeaders;\n\n  // Factory for the StringValuePattern that will be used to match request bodies\n  private final RequestBodyPatternFactory requestBodyPatternFactory;\n\n  // Criteria for extracting body from responses\n  private final ResponseDefinitionBodyMatcher extractBodyCriteria;\n\n  // How to format StubMappings in the response body\n  private final SnapshotOutputFormatter outputFormat;\n\n  // Whether to persist stub mappings\n  private final Boolean persist;\n\n  // Whether duplicate requests should be recorded as scenarios or just discarded\n  private final Boolean repeatsAsScenarios;\n\n  // Stub mapping transformers\n  private final List<String> transformers;\n\n  // Parameters for stub mapping transformers\n  private final Parameters transformerParameters;\n\n  @JsonCreator\n  public RecordSpec(\n      @JsonProperty(\"targetBaseUrl\") String targetBaseUrl,\n      @JsonProperty(\"filters\") ProxiedServeEventFilters filters,\n      @JsonProperty(\"captureHeaders\") Map<String, CaptureHeadersSpec> captureHeaders,\n      @JsonProperty(\"requestBodyPattern\") RequestBodyPatternFactory requestBodyPatternFactory,\n      @JsonProperty(\"extractBodyCriteria\") ResponseDefinitionBodyMatcher extractBodyCriteria,\n      @JsonProperty(\"outputFormat\") SnapshotOutputFormatter outputFormat,\n      @JsonProperty(\"persist\") Boolean persist,\n      @JsonProperty(\"repeatsAsScenarios\") Boolean repeatsAsScenarios,\n      @JsonProperty(\"transformers\") List<String> transformers,\n      @JsonProperty(\"transformerParameters\") Parameters transformerParameters) {\n    this.targetBaseUrl = targetBaseUrl;\n    this.filters = filters == null ? ProxiedServeEventFilters.ALLOW_ALL : filters;\n    this.captureHeaders = captureHeaders;\n    this.requestBodyPatternFactory =\n        requestBodyPatternFactory == null\n            ? RequestBodyAutomaticPatternFactory.DEFAULTS\n            : requestBodyPatternFactory;\n    this.extractBodyCriteria = extractBodyCriteria;\n    this.outputFormat = outputFormat == null ? SnapshotOutputFormatter.FULL : outputFormat;\n    this.persist = persist == null ? true : persist;\n    this.repeatsAsScenarios = repeatsAsScenarios;\n    this.transformers = transformers;\n    this.transformerParameters = transformerParameters;\n  }\n\n  private RecordSpec() {\n    this(null, null, null, null, null, null, null, null, null, null);\n  }\n\n  public static final RecordSpec DEFAULTS = new RecordSpec();\n\n  public static RecordSpec forBaseUrl(String targetBaseUrl) {\n    return new RecordSpec(targetBaseUrl, null, null, null, null, null, null, true, null, null);\n  }\n\n  public String getTargetBaseUrl() {\n    return targetBaseUrl;\n  }\n\n  public ProxiedServeEventFilters getFilters() {\n    return filters;\n  }\n\n  public Map<String, CaptureHeadersSpec> getCaptureHeaders() {\n    return captureHeaders;\n  }\n\n  public SnapshotOutputFormatter getOutputFormat() {\n    return outputFormat;\n  }\n\n  @JsonProperty(\"persist\")\n  public boolean shouldPersist() {\n    return persist;\n  }\n\n  @JsonIgnore\n  public boolean shouldRecordRepeatsAsScenarios() {\n    return repeatsAsScenarios == null ? true : repeatsAsScenarios;\n  }\n\n  public Boolean getRepeatsAsScenarios() {\n    return repeatsAsScenarios;\n  }\n\n  public List<String> getTransformers() {\n    return transformers;\n  }\n\n  public Parameters getTransformerParameters() {\n    return transformerParameters;\n  }\n\n  public ResponseDefinitionBodyMatcher getExtractBodyCriteria() {\n    return extractBodyCriteria;\n  }\n\n  public RequestBodyPatternFactory getRequestBodyPatternFactory() {\n    return requestBodyPatternFactory;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RecordSpecBuilder.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static java.util.Arrays.asList;\n\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\n\npublic class RecordSpecBuilder {\n\n  private String targetBaseUrl;\n  private RequestPatternBuilder filterRequestPatternBuilder;\n  private List<UUID> filterIds;\n  private final Map<String, CaptureHeadersSpec> headers = new LinkedHashMap<>();\n  private RequestBodyPatternFactory requestBodyPatternFactory;\n  private long maxTextBodySize = ResponseDefinitionBodyMatcher.DEFAULT_MAX_TEXT_SIZE;\n  private long maxBinaryBodySize = ResponseDefinitionBodyMatcher.DEFAULT_MAX_BINARY_SIZE;\n  private boolean persistentStubs = true;\n  private boolean repeatsAsScenarios = true;\n  private List<String> transformerNames;\n  private Parameters transformerParameters;\n  private boolean allowNonProxied;\n\n  public RecordSpecBuilder forTarget(String targetBaseUrl) {\n    this.targetBaseUrl = targetBaseUrl;\n    return this;\n  }\n\n  public RecordSpecBuilder onlyRequestsMatching(RequestPatternBuilder filterRequestPattern) {\n    this.filterRequestPatternBuilder = filterRequestPattern;\n    return this;\n  }\n\n  public RecordSpecBuilder onlyRequestIds(List<UUID> filterIds) {\n    this.filterIds = filterIds;\n    return this;\n  }\n\n  public RecordSpecBuilder extractTextBodiesOver(long size) {\n    this.maxTextBodySize = size;\n    return this;\n  }\n\n  public RecordSpecBuilder extractBinaryBodiesOver(long size) {\n    this.maxBinaryBodySize = size;\n    return this;\n  }\n\n  public RecordSpecBuilder makeStubsPersistent(boolean persistent) {\n    this.persistentStubs = persistent;\n    return this;\n  }\n\n  public RecordSpecBuilder ignoreRepeatRequests() {\n    this.repeatsAsScenarios = false;\n    return this;\n  }\n\n  public RecordSpecBuilder transformers(String... transformerName) {\n    return transformers(asList(transformerName));\n  }\n\n  public RecordSpecBuilder transformers(List<String> transformerName) {\n    this.transformerNames = transformerName;\n    return this;\n  }\n\n  public RecordSpecBuilder transformerParameters(Parameters parameters) {\n    this.transformerParameters = parameters;\n    return this;\n  }\n\n  public RecordSpecBuilder captureHeader(String key) {\n    return captureHeader(key, null);\n  }\n\n  public RecordSpecBuilder captureHeader(String key, Boolean caseInsensitive) {\n    headers.put(key, new CaptureHeadersSpec(caseInsensitive));\n    return this;\n  }\n\n  public RecordSpecBuilder chooseBodyMatchTypeAutomatically() {\n    return chooseBodyMatchTypeAutomatically(null, null, null);\n  }\n\n  public RecordSpecBuilder chooseBodyMatchTypeAutomatically(\n      Boolean ignoreArrayOrder, Boolean ignoreExtraElements, Boolean caseInsensitive) {\n    this.requestBodyPatternFactory =\n        new RequestBodyAutomaticPatternFactory(\n            ignoreArrayOrder, ignoreExtraElements, caseInsensitive);\n    return this;\n  }\n\n  @SuppressWarnings(\"unused\")\n  public RecordSpecBuilder matchRequestBodyWithEqualToJson() {\n    return matchRequestBodyWithEqualToJson(null, null);\n  }\n\n  public RecordSpecBuilder matchRequestBodyWithEqualToJson(\n      Boolean ignoreArrayOrder, Boolean ignoreExtraElements) {\n    this.requestBodyPatternFactory =\n        new RequestBodyEqualToJsonPatternFactory(ignoreArrayOrder, ignoreExtraElements);\n    return this;\n  }\n\n  public RecordSpecBuilder matchRequestBodyWithEqualToXml() {\n    this.requestBodyPatternFactory = new RequestBodyEqualToXmlPatternFactory();\n    return this;\n  }\n\n  @SuppressWarnings(\"unused\")\n  public RecordSpecBuilder matchRequestBodyWithEqualTo() {\n    return matchRequestBodyWithEqualTo(null);\n  }\n\n  public RecordSpecBuilder matchRequestBodyWithEqualTo(Boolean caseInsensitive) {\n    this.requestBodyPatternFactory = new RequestBodyEqualToPatternFactory(caseInsensitive);\n    return this;\n  }\n\n  public RecordSpecBuilder allowNonProxied(boolean allowNonProxied) {\n    this.allowNonProxied = allowNonProxied;\n    return this;\n  }\n\n  public RecordSpec build() {\n    RequestPattern filterRequestPattern =\n        filterRequestPatternBuilder != null ? filterRequestPatternBuilder.build() : null;\n    ProxiedServeEventFilters filters =\n        filterRequestPatternBuilder != null || filterIds != null || allowNonProxied\n            ? new ProxiedServeEventFilters(filterRequestPattern, filterIds, allowNonProxied)\n            : null;\n\n    ResponseDefinitionBodyMatcher responseDefinitionBodyMatcher =\n        new ResponseDefinitionBodyMatcher(maxTextBodySize, maxBinaryBodySize);\n\n    return new RecordSpec(\n        targetBaseUrl,\n        filters,\n        headers.isEmpty() ? null : headers,\n        requestBodyPatternFactory,\n        responseDefinitionBodyMatcher,\n        SnapshotOutputFormatter.FULL,\n        persistentStubs,\n        repeatsAsScenarios,\n        transformerNames,\n        transformerParameters);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/Recorder.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.proxyAllTo;\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.indexOf;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.Extensions;\nimport com.github.tomakehurst.wiremock.extension.StubMappingTransformer;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport com.github.tomakehurst.wiremock.store.RecorderStateStore;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubImport;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.UUID;\nimport java.util.function.Predicate;\nimport java.util.stream.Collectors;\n\npublic class Recorder {\n\n  private final Admin admin;\n  private final Extensions extensions;\n  private final BlobStore filesBlobStore;\n\n  private final RecorderStateStore stateStore;\n\n  public Recorder(\n      Admin admin, Extensions extensions, BlobStore filesBlobStore, RecorderStateStore stateStore) {\n    this.admin = admin;\n    this.extensions = extensions;\n    this.filesBlobStore = filesBlobStore;\n    this.stateStore = stateStore;\n  }\n\n  public synchronized void startRecording(RecordSpec spec) {\n    RecorderState state = stateStore.get();\n    if (state.getStatus() == RecordingStatus.Recording) {\n      return;\n    }\n\n    StubMapping proxyMapping = null;\n    if (spec.getTargetBaseUrl() != null && !spec.getTargetBaseUrl().isEmpty()) {\n      proxyMapping = proxyAllTo(spec.getTargetBaseUrl()).build();\n      admin.addStubMapping(proxyMapping);\n    }\n\n    List<ServeEvent> serveEvents = admin.getServeEvents().getServeEvents();\n    UUID initialId = serveEvents.isEmpty() ? null : serveEvents.get(0).getId();\n    state = state.start(initialId, proxyMapping, spec);\n    stateStore.set(state);\n\n    notifier().info(\"Started recording with record spec:\\n\" + Json.write(spec));\n  }\n\n  public synchronized SnapshotRecordResult stopRecording() {\n    RecorderState state = stateStore.get();\n    if (state.getStatus() != RecordingStatus.Recording) {\n      throw new NotRecordingException();\n    }\n\n    List<ServeEvent> serveEvents = admin.getServeEvents().getServeEvents();\n\n    UUID lastId = serveEvents.isEmpty() ? null : serveEvents.get(0).getId();\n    state = state.stop(lastId);\n    stateStore.set(state);\n\n    if (state.getProxyMapping() != null) {\n      admin.removeStubMapping(state.getProxyMapping());\n    }\n\n    if (serveEvents.isEmpty()) {\n      return SnapshotRecordResult.empty();\n    }\n\n    int startIndex =\n        state.getStartingServeEventId() == null\n            ? serveEvents.size()\n            : indexOf(serveEvents, withId(state.getStartingServeEventId()));\n    int endIndex = indexOf(serveEvents, withId(state.getFinishingServeEventId()));\n    List<ServeEvent> eventsToSnapshot = serveEvents.subList(endIndex, startIndex);\n\n    SnapshotRecordResult result = takeSnapshot(eventsToSnapshot, state.getSpec());\n\n    notifier().info(\"Stopped recording. Stubs captured:\\n\" + Json.write(result.getStubMappings()));\n    return result;\n  }\n\n  private static Predicate<ServeEvent> withId(final UUID id) {\n    return input -> input.getId().equals(id);\n  }\n\n  public SnapshotRecordResult takeSnapshot(List<ServeEvent> serveEvents, RecordSpec recordSpec) {\n    final Pair<List<RecordError>, List<StubMapping>> results =\n        serveEventsToStubMappings(\n            serveEvents,\n            recordSpec.getFilters(),\n            new SnapshotStubMappingGenerator(\n                recordSpec.getCaptureHeaders(),\n                recordSpec.getRequestBodyPatternFactory(),\n                recordSpec.shouldPersist()),\n            getStubMappingPostProcessor(recordSpec));\n\n    admin.importStubs(new StubImport(results.b, StubImport.Options.DEFAULTS));\n    return recordSpec.getOutputFormat().format(results.b, results.a);\n  }\n\n  private Pair<List<RecordError>, List<StubMapping>> serveEventsToStubMappings(\n      List<ServeEvent> serveEventsResult,\n      ProxiedServeEventFilters serveEventFilters,\n      SnapshotStubMappingGenerator stubMappingGenerator,\n      SnapshotStubMappingPostProcessor stubMappingPostProcessor) {\n    final List<Pair<ServeEvent, StubMapping>> stubMappings =\n        serveEventsResult.stream()\n            .filter(serveEventFilters)\n            .map((serveEvent) -> new Pair<>(serveEvent, stubMappingGenerator.apply(serveEvent)))\n            .collect(Collectors.toList());\n\n    return stubMappingPostProcessor.process(stubMappings);\n  }\n\n  private SnapshotStubMappingPostProcessor getStubMappingPostProcessor(RecordSpec recordSpec) {\n    final SnapshotStubMappingTransformerRunner transformerRunner =\n        new SnapshotStubMappingTransformerRunner(\n            extensions.ofType(StubMappingTransformer.class).values(),\n            recordSpec.getTransformers(),\n            recordSpec.getTransformerParameters(),\n            filesBlobStore);\n\n    return new SnapshotStubMappingPostProcessor(\n        recordSpec.shouldRecordRepeatsAsScenarios(),\n        transformerRunner,\n        recordSpec.getExtractBodyCriteria(),\n        new SnapshotStubMappingBodyExtractor(filesBlobStore));\n  }\n\n  public RecordingStatus getStatus() {\n    return stateStore.get().getStatus();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RecorderState.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.UUID;\n\npublic class RecorderState {\n\n  private final RecordingStatus status;\n  private final StubMapping proxyMapping;\n  private final RecordSpec spec;\n  private final UUID startingServeEventId;\n  private final UUID finishingServeEventId;\n\n  public RecorderState(\n      @JsonProperty(\"status\") RecordingStatus status,\n      @JsonProperty(\"proxyMapping\") StubMapping proxyMapping,\n      @JsonProperty(\"spec\") RecordSpec spec,\n      @JsonProperty(\"startingServeEventId\") UUID startingServeEventId,\n      @JsonProperty(\"finishingServeEventId\") UUID finishingServeEventId) {\n    this.status = status;\n    this.proxyMapping = proxyMapping;\n    this.spec = spec;\n    this.startingServeEventId = startingServeEventId;\n    this.finishingServeEventId = finishingServeEventId;\n  }\n\n  public static RecorderState initial() {\n    return new RecorderState(RecordingStatus.NeverStarted, null, null, null, null);\n  }\n\n  public RecorderState start(UUID startingServeEventId, StubMapping proxyMapping, RecordSpec spec) {\n    return new RecorderState(\n        RecordingStatus.Recording, proxyMapping, spec, startingServeEventId, null);\n  }\n\n  public RecorderState stop(UUID finishingServeEventId) {\n    return new RecorderState(\n        RecordingStatus.Stopped, proxyMapping, spec, startingServeEventId, finishingServeEventId);\n  }\n\n  public RecordingStatus getStatus() {\n    return status;\n  }\n\n  public StubMapping getProxyMapping() {\n    return proxyMapping;\n  }\n\n  public RecordSpec getSpec() {\n    return spec;\n  }\n\n  public UUID getStartingServeEventId() {\n    return startingServeEventId;\n  }\n\n  public UUID getFinishingServeEventId() {\n    return finishingServeEventId;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RecordingStatus.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\npublic enum RecordingStatus {\n  NeverStarted,\n  Recording,\n  Stopped\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RecordingStatusResult.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class RecordingStatusResult {\n\n  private final RecordingStatus status;\n\n  @JsonCreator\n  public RecordingStatusResult(@JsonProperty(\"status\") String status) {\n    this(RecordingStatus.valueOf(status));\n  }\n\n  public RecordingStatusResult(RecordingStatus status) {\n    this.status = status;\n  }\n\n  public RecordingStatus getStatus() {\n    return status;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RequestBodyAutomaticPatternFactory.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.determineIsTextFromMimeType;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.*;\n\npublic class RequestBodyAutomaticPatternFactory implements RequestBodyPatternFactory {\n\n  private final Boolean caseInsensitive;\n  private final Boolean ignoreArrayOrder;\n  private final Boolean ignoreExtraElements;\n\n  @JsonCreator\n  public RequestBodyAutomaticPatternFactory(\n      @JsonProperty(\"ignoreArrayOrder\") Boolean ignoreArrayOrder,\n      @JsonProperty(\"ignoreExtraElements\") Boolean ignoreExtraElements,\n      @JsonProperty(\"caseInsensitive\") Boolean caseInsensitive) {\n    this.ignoreArrayOrder = ignoreArrayOrder == null ? true : ignoreArrayOrder;\n    this.ignoreExtraElements = ignoreExtraElements == null ? true : ignoreExtraElements;\n    this.caseInsensitive = caseInsensitive == null ? false : caseInsensitive;\n  }\n\n  private RequestBodyAutomaticPatternFactory() {\n    this(null, null, null);\n  }\n\n  public static final RequestBodyAutomaticPatternFactory DEFAULTS =\n      new RequestBodyAutomaticPatternFactory();\n\n  public Boolean isIgnoreArrayOrder() {\n    return ignoreArrayOrder;\n  }\n\n  public Boolean isIgnoreExtraElements() {\n    return ignoreExtraElements;\n  }\n\n  public Boolean isCaseInsensitive() {\n    return caseInsensitive;\n  }\n\n  /**\n   * If request body was JSON or XML, use \"equalToJson\" or \"equalToXml\" (respectively) in the\n   * RequestPattern so it's easier to read. Otherwise, just use \"equalTo\"\n   */\n  @Override\n  public ContentPattern<?> forRequest(Request request) {\n    final String mimeType = request.getHeaders().getContentTypeHeader().mimeTypePart();\n    if (mimeType != null) {\n      if (mimeType.contains(\"json\")) {\n        return new EqualToJsonPattern(\n            request.getBodyAsString(), ignoreArrayOrder, ignoreExtraElements);\n      } else if (mimeType.contains(\"xml\")) {\n        return new EqualToXmlPattern(request.getBodyAsString());\n      } else if (mimeType.equals(\"multipart/form-data\")) {\n        // TODO: Need to add a matcher that can handle multipart data properly. For now, just always\n        // match\n        return new AnythingPattern();\n      } else if (!determineIsTextFromMimeType(mimeType)) {\n        return new BinaryEqualToPattern(request.getBody());\n      }\n    }\n\n    return new EqualToPattern(request.getBodyAsString(), caseInsensitive);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RequestBodyEqualToJsonPatternFactory.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.EqualToJsonPattern;\n\npublic class RequestBodyEqualToJsonPatternFactory implements RequestBodyPatternFactory {\n\n  private final Boolean ignoreArrayOrder;\n  private final Boolean ignoreExtraElements;\n\n  @JsonCreator\n  public RequestBodyEqualToJsonPatternFactory(\n      @JsonProperty(\"ignoreArrayOrder\") Boolean ignoreArrayOrder,\n      @JsonProperty(\"ignoreExtraElements\") Boolean ignoreExtraElements) {\n    this.ignoreArrayOrder = ignoreArrayOrder;\n    this.ignoreExtraElements = ignoreExtraElements;\n  }\n\n  public Boolean isIgnoreArrayOrder() {\n    return ignoreArrayOrder;\n  }\n\n  public Boolean isIgnoreExtraElements() {\n    return ignoreExtraElements;\n  }\n\n  @Override\n  public EqualToJsonPattern forRequest(Request request) {\n    return new EqualToJsonPattern(request.getBodyAsString(), ignoreArrayOrder, ignoreExtraElements);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RequestBodyEqualToPatternFactory.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.EqualToPattern;\n\npublic class RequestBodyEqualToPatternFactory implements RequestBodyPatternFactory {\n\n  private final Boolean caseInsensitive;\n\n  @JsonCreator\n  public RequestBodyEqualToPatternFactory(\n      @JsonProperty(\"caseInsensitive\") Boolean caseInsensitive) {\n    this.caseInsensitive = caseInsensitive;\n  }\n\n  public Boolean isCaseInsensitive() {\n    return caseInsensitive;\n  }\n\n  @Override\n  public EqualToPattern forRequest(Request request) {\n    return new EqualToPattern(request.getBodyAsString(), caseInsensitive);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RequestBodyEqualToXmlPatternFactory.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.EqualToXmlPattern;\n\npublic class RequestBodyEqualToXmlPatternFactory implements RequestBodyPatternFactory {\n\n  @Override\n  public EqualToXmlPattern forRequest(Request request) {\n    return new EqualToXmlPattern(request.getBodyAsString());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RequestBodyPatternFactory.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonSubTypes;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.ContentPattern;\n\n/** Factory for the StringValuePattern to use in a recorded stub mapping to match request bodies */\n@JsonTypeInfo(\n    use = JsonTypeInfo.Id.NAME,\n    include = JsonTypeInfo.As.PROPERTY,\n    property = \"matcher\",\n    defaultImpl = RequestBodyAutomaticPatternFactory.class)\n@JsonSubTypes({\n  @JsonSubTypes.Type(value = RequestBodyAutomaticPatternFactory.class, name = \"auto\"),\n  @JsonSubTypes.Type(value = RequestBodyEqualToPatternFactory.class, name = \"equalTo\"),\n  @JsonSubTypes.Type(value = RequestBodyEqualToJsonPatternFactory.class, name = \"equalToJson\"),\n  @JsonSubTypes.Type(value = RequestBodyEqualToXmlPatternFactory.class, name = \"equalToXml\")\n})\npublic interface RequestBodyPatternFactory {\n  ContentPattern<?> forRequest(Request request);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/RequestPatternTransformer.java",
    "content": "/*\n * Copyright (C) 2017-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.havingExactly;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.*;\nimport java.util.Map;\nimport java.util.function.Function;\nimport org.wiremock.url.PathAndQuery;\n\n/**\n * Creates a RequestPatternBuilder from a Request's URL, method, body (if present), and optionally\n * headers from a whitelist.\n */\nclass RequestPatternTransformer implements Function<Request, RequestPatternBuilder> {\n  private final Map<String, CaptureHeadersSpec> headers;\n  private final RequestBodyPatternFactory bodyPatternFactory;\n\n  RequestPatternTransformer(\n      Map<String, CaptureHeadersSpec> headers, RequestBodyPatternFactory bodyPatternFactory) {\n    this.headers = headers;\n    this.bodyPatternFactory = bodyPatternFactory;\n  }\n\n  /** Returns a RequestPatternBuilder matching a given Request */\n  @Override\n  public RequestPatternBuilder apply(Request request) {\n    PathAndQuery pathAndQuery = request.getPathAndQueryWithoutPrefix();\n    var queryParameters = pathAndQuery.getQueryOrEmpty().asDecodedMap();\n    // urlEqualTo is used when there are no query parameters to be as least disruptive to existing\n    // behaviour as possible.\n    // TODO: could be changed to always use urlPathEqualTo in next major release.\n    var urlMatcher =\n        queryParameters.isEmpty()\n            ? urlEqualTo(pathAndQuery)\n            : urlPathEqualTo(pathAndQuery.getPath());\n    final RequestPatternBuilder builder =\n        new RequestPatternBuilder(request.getMethod(), urlMatcher);\n\n    queryParameters.forEach(\n        (name, parameters) -> {\n          var decodedValues = parameters.toArray(String[]::new);\n          builder.withQueryParam(\n              name,\n              decodedValues.length == 1\n                  ? MultiValuePattern.of(equalTo(decodedValues[0]))\n                  : havingExactly(decodedValues));\n        });\n\n    if (headers != null && !headers.isEmpty()) {\n      for (Map.Entry<String, CaptureHeadersSpec> header : headers.entrySet()) {\n        String headerName = header.getKey();\n        if (request.containsHeader(headerName)) {\n          CaptureHeadersSpec spec = header.getValue();\n          StringValuePattern headerMatcher =\n              new EqualToPattern(request.getHeader(headerName), spec.getCaseInsensitive());\n          builder.withHeader(headerName, headerMatcher);\n        }\n      }\n    }\n\n    byte[] body = request.getBody();\n    if (bodyPatternFactory != null && body != null && body.length > 0) {\n      builder.withRequestBody(bodyPatternFactory.forRequest(request));\n    }\n\n    return builder;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/ResponseDefinitionBodyMatcher.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.common.ContentTypes;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.ValueMatcher;\nimport java.util.Objects;\n\n// Matches the size of the body of a ResponseDefinition, for use by the Snapshot API when\n// determining if the body\n// should be extracted to a file.\n@JsonDeserialize(using = ResponseDefinitionBodyMatcherDeserializer.class)\npublic class ResponseDefinitionBodyMatcher implements ValueMatcher<ResponseDefinition> {\n\n  public static final long DEFAULT_MAX_TEXT_SIZE = 10240;\n  public static final long DEFAULT_MAX_BINARY_SIZE = 0;\n\n  private final long textSizeThreshold;\n  private final long binarySizeThreshold;\n\n  public ResponseDefinitionBodyMatcher(long textSizeThreshold, long binarySizeThreshold) {\n    this.textSizeThreshold = textSizeThreshold;\n    this.binarySizeThreshold = binarySizeThreshold;\n  }\n\n  public String getTextSizeThreshold() {\n    return String.valueOf(textSizeThreshold);\n  }\n\n  public String getBinarySizeThreshold() {\n    return String.valueOf(binarySizeThreshold);\n  }\n\n  @Override\n  public MatchResult match(ResponseDefinition responseDefinition) {\n    if (!responseDefinition.specifiesBodyContent()) {\n      return MatchResult.noMatch();\n    } else if (ContentTypes.determineIsTextFromMimeType(\n        responseDefinition.getHeaders().getContentTypeHeader().mimeTypePart())) {\n      if (responseDefinition.getTextBody().length() > textSizeThreshold) {\n        return MatchResult.exactMatch();\n      } else {\n        return MatchResult.noMatch();\n      }\n    } else {\n      if (responseDefinition.getByteBody().length > binarySizeThreshold) {\n        return MatchResult.exactMatch();\n      } else {\n        return MatchResult.noMatch();\n      }\n    }\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n\n    ResponseDefinitionBodyMatcher that = (ResponseDefinitionBodyMatcher) o;\n\n    return Objects.equals(textSizeThreshold, that.textSizeThreshold)\n        && Objects.equals(binarySizeThreshold, that.binarySizeThreshold);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(textSizeThreshold, binarySizeThreshold);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/ResponseDefinitionBodyMatcherDeserializer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport java.io.IOException;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\npublic class ResponseDefinitionBodyMatcherDeserializer\n    extends JsonDeserializer<ResponseDefinitionBodyMatcher> {\n  @Override\n  public ResponseDefinitionBodyMatcher deserialize(\n      JsonParser parser, DeserializationContext context) throws IOException {\n    JsonNode rootNode = parser.readValueAsTree();\n    return new ResponseDefinitionBodyMatcher(\n        parseJsonNode(rootNode.get(\"textSizeThreshold\")),\n        parseJsonNode(rootNode.get(\"binarySizeThreshold\")));\n  }\n\n  public static long parseJsonNode(JsonNode node) {\n    if (node == null || node.isNull()) {\n      return Long.MAX_VALUE;\n    } else if (node.isNumber()) {\n      return node.asLong();\n    } else {\n      return parseFilesize(node.textValue());\n    }\n  }\n\n  // Converts a human-readable file size string (e.g. \"10,100 KB\") to bytes\n  // Partially based off https://stackoverflow.com/a/12090818\n  public static long parseFilesize(String in) {\n    String cleanedInput = in.trim().replaceAll(\",\", \".\");\n\n    final Matcher m =\n        Pattern.compile(\"^([\\\\d.]+)\\\\s*(\\\\w)?b?$\", Pattern.CASE_INSENSITIVE).matcher(cleanedInput);\n    if (!m.find()) {\n      throw new IllegalArgumentException(\"Invalid size string: \\\"\" + in + \"\\\"\");\n    }\n\n    int scale = 1;\n    if (m.group(2) != null) {\n      switch (m.group(2).toUpperCase()) {\n        case \"G\":\n          scale *= 1024;\n        case \"M\":\n          scale *= 1024;\n        case \"K\":\n          scale *= 1024;\n          break;\n        default:\n          throw new IllegalArgumentException(\"Invalid size unit: \" + m.group(2));\n      }\n    }\n    return Math.round(Double.parseDouble(m.group(1)) * scale);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/ScenarioProcessor.java",
    "content": "/*\n * Copyright (C) 2017-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static java.util.stream.Collectors.toList;\nimport static java.util.stream.Collectors.toMap;\n\nimport com.github.tomakehurst.wiremock.common.Urls;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.*;\nimport java.util.function.Function;\nimport java.util.stream.Collectors;\nimport java.util.stream.IntStream;\nimport org.wiremock.url.PathAndQuery;\n\nclass ScenarioProcessor {\n\n  List<StubMapping> putRepeatedRequestsInScenarios(List<StubMapping> stubMappings) {\n    Map<RequestPattern, List<StubMapping>> stubsGroupedByRequest =\n        stubMappings.stream()\n            .collect(\n                Collectors.groupingBy(\n                    StubMapping::getRequest,\n                    LinkedHashMap::new,\n                    Collectors.toCollection(LinkedList::new)));\n\n    Map<RequestPattern, Collection<StubMapping>> groupsWithMoreThanOneStub =\n        stubsGroupedByRequest.entrySet().stream()\n            .filter(entry -> entry.getValue().size() > 1)\n            .collect(\n                toMap(\n                    Map.Entry::getKey,\n                    Map.Entry::getValue,\n                    (entry1, entry2) -> entry1,\n                    LinkedHashMap::new));\n\n    final List<StubMapping> stubsInScenario = new LinkedList<>();\n    int scenarioIndex = 0;\n    for (Map.Entry<RequestPattern, Collection<StubMapping>> entry :\n        groupsWithMoreThanOneStub.entrySet()) {\n      scenarioIndex++;\n      final List<StubMapping> batch = new LinkedList<>(entry.getValue());\n      Collections.reverse(batch);\n\n      stubsInScenario.addAll(putStubsInScenario(scenarioIndex, batch));\n    }\n\n    Map<UUID, StubMapping> stubsInScenarioById =\n        stubsInScenario.stream().collect(toMap(StubMapping::getId, Function.identity()));\n\n    return stubMappings.stream()\n        .map(originalStub -> stubsInScenarioById.getOrDefault(originalStub.getId(), originalStub))\n        .toList();\n  }\n\n  private List<StubMapping> putStubsInScenario(int scenarioIndex, List<StubMapping> stubMappings) {\n    StubMapping firstScenario = stubMappings.get(0);\n    String scenarioName =\n        \"scenario-\"\n            + scenarioIndex\n            + \"-\"\n            + Urls.urlToPathParts(\n                PathAndQuery.parse(\n                    getFirstNonNull(\n                        firstScenario.getRequest().getUrl(),\n                        firstScenario.getRequest().getUrlPath())));\n\n    return IntStream.range(1, stubMappings.size() + 1)\n        .mapToObj(\n            i ->\n                stubMappings\n                    .get(i - 1)\n                    .transform(\n                        stub -> {\n                          stub.setScenarioName(scenarioName);\n                          if (i == 1) {\n                            stub.setRequiredScenarioState(Scenario.STARTED);\n                          } else {\n                            stub.setRequiredScenarioState(scenarioName + \"-\" + i);\n                          }\n                          if (i < stubMappings.size()) {\n                            stub.setNewScenarioState(scenarioName + \"-\" + (i + 1));\n                          }\n                        }))\n        .collect(toList());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/SnapshotOutputFormatter.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\n\n/** Wraps a list of generated StubMappings into a SnapshotRecordResult object */\npublic enum SnapshotOutputFormatter {\n  FULL {\n    @Override\n    SnapshotRecordResult format(\n        List<StubMapping> stubMappings, List<? extends RecordError> errors) {\n      return SnapshotRecordResult.full(stubMappings, errors);\n    }\n  },\n  IDS {\n    @Override\n    SnapshotRecordResult format(\n        List<StubMapping> stubMappings, List<? extends RecordError> errors) {\n      return SnapshotRecordResult.idsFromMappings(stubMappings, errors);\n    }\n  };\n\n  abstract SnapshotRecordResult format(\n      List<StubMapping> stubMappings, List<? extends RecordError> errors);\n\n  @JsonCreator\n  public static SnapshotOutputFormatter fromString(String value) {\n    if (value == null || value.equalsIgnoreCase(\"full\")) {\n      return FULL;\n    } else if (value.equalsIgnoreCase(\"ids\")) {\n      return IDS;\n    } else {\n      throw new IllegalArgumentException(\"Invalid output format\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/SnapshotRecordResult.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.annotation.JsonSubTypes;\nimport com.fasterxml.jackson.annotation.JsonTypeInfo;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\n@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION)\n@JsonSubTypes({\n  @JsonSubTypes.Type(SnapshotRecordResult.Full.class),\n  @JsonSubTypes.Type(SnapshotRecordResult.Ids.class),\n})\npublic class SnapshotRecordResult {\n\n  protected final List<StubMapping> stubMappings;\n  protected final List<? extends RecordError> errors;\n\n  protected SnapshotRecordResult(List<StubMapping> mappings, List<? extends RecordError> errors) {\n    this.stubMappings = mappings;\n    this.errors = errors;\n  }\n\n  @JsonIgnore\n  public List<StubMapping> getStubMappings() {\n    return stubMappings;\n  }\n\n  public List<? extends RecordError> getErrors() {\n    return errors;\n  }\n\n  public static SnapshotRecordResult full(\n      List<StubMapping> stubMappings, List<? extends RecordError> errors) {\n    return new Full(stubMappings, errors);\n  }\n\n  public static SnapshotRecordResult idsFromMappings(\n      List<StubMapping> stubMappings, List<? extends RecordError> errors) {\n    return new Ids(\n        stubMappings.stream().map(StubMapping::getId).collect(Collectors.toList()), errors);\n  }\n\n  public static SnapshotRecordResult empty() {\n    return full(Collections.emptyList(), Collections.emptyList());\n  }\n\n  public static class Full extends SnapshotRecordResult {\n\n    @JsonCreator\n    public Full(\n        @JsonProperty(\"mappings\") List<StubMapping> mappings,\n        @JsonProperty(\"errors\") List<? extends RecordError> errors) {\n      super(mappings, errors);\n    }\n\n    public List<StubMapping> getMappings() {\n      return stubMappings;\n    }\n  }\n\n  public static class Ids extends SnapshotRecordResult {\n\n    private final List<UUID> ids;\n\n    @JsonCreator\n    public Ids(\n        @JsonProperty(\"ids\") List<UUID> ids,\n        @JsonProperty(\"errors\") List<? extends RecordError> errors) {\n      super(Collections.emptyList(), errors);\n      this.ids = ids;\n    }\n\n    public List<UUID> getIds() {\n      return ids;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/SnapshotStubMappingBodyExtractor.java",
    "content": "/*\n * Copyright (C) 2017-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport org.wiremock.url.PathAndQuery;\n\nclass SnapshotStubMappingBodyExtractor {\n  private final BlobStore filesBlobStore;\n\n  SnapshotStubMappingBodyExtractor(BlobStore filesBlobStore) {\n    this.filesBlobStore = filesBlobStore;\n  }\n\n  /**\n   * Extracts body of the ResponseDefinition to a file written to the files source. Modifies the\n   * ResponseDefinition to point to the file in-place.\n   *\n   * @param stubMapping Stub mapping to extract\n   */\n  StubMapping extractInPlace(StubMapping stubMapping) {\n    byte[] body = stubMapping.getResponse().getByteBody();\n    HttpHeaders responseHeaders = stubMapping.getResponse().getHeaders();\n    PathAndQuery pathAndQuery =\n        PathAndQuery.parse(\n            getFirstNonNull(\n                stubMapping.getRequest().getUrl(), stubMapping.getRequest().getUrlPath()));\n    String extension =\n        ContentTypes.determineFileExtension(\n            pathAndQuery, responseHeaders.getContentTypeHeader(), body);\n\n    FilenameMaker filenameMaker = new FilenameMaker(\"default\", extension);\n    String bodyFileName = filenameMaker.filenameFor(stubMapping);\n\n    filesBlobStore.put(bodyFileName, body);\n\n    // used to prevent ambiguous method call error for withBody()\n    String noStringBody = null;\n    byte[] noByteBody = null;\n\n    return stubMapping.transform(\n        sm ->\n            sm.setResponse(\n                ResponseDefinitionBuilder.like(stubMapping.getResponse())\n                    .withBodyFile(bodyFileName)\n                    .withBody(noStringBody)\n                    .withBody(noByteBody)\n                    .withBase64Body(null)\n                    .build()));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/SnapshotStubMappingGenerator.java",
    "content": "/*\n * Copyright (C) 2017-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.Map;\nimport java.util.function.Function;\nimport org.wiremock.url.PathAndQuery;\n\n/**\n * Transforms ServeEvents to StubMappings using RequestPatternTransformer and\n * LoggedResponseDefinitionTransformer\n */\nclass SnapshotStubMappingGenerator implements Function<ServeEvent, StubMapping> {\n  private final RequestPatternTransformer requestTransformer;\n  private final LoggedResponseDefinitionTransformer responseTransformer;\n  private final boolean markStubsPersistent;\n\n  SnapshotStubMappingGenerator(\n      RequestPatternTransformer requestTransformer,\n      LoggedResponseDefinitionTransformer responseTransformer,\n      boolean markStubsPersistent) {\n    this.requestTransformer = requestTransformer;\n    this.responseTransformer = responseTransformer;\n    this.markStubsPersistent = markStubsPersistent;\n  }\n\n  SnapshotStubMappingGenerator(\n      Map<String, CaptureHeadersSpec> captureHeaders,\n      RequestBodyPatternFactory requestBodyPatternFactory,\n      boolean markStubsPersistent) {\n    this(\n        new RequestPatternTransformer(captureHeaders, requestBodyPatternFactory),\n        new LoggedResponseDefinitionTransformer(),\n        markStubsPersistent);\n  }\n\n  @Override\n  public StubMapping apply(ServeEvent event) {\n    final RequestPattern requestPattern = requestTransformer.apply(event.getRequest()).build();\n    final ResponseDefinition responseDefinition = responseTransformer.apply(event.getResponse());\n\n    PathAndQuery url = event.getRequest().getPathAndQueryWithoutPrefix();\n    FilenameMaker filenameMaker = new FilenameMaker();\n\n    return StubMapping.builder()\n        .setRequest(requestPattern)\n        .setResponse(responseDefinition)\n        .setPersistent(markStubsPersistent ? true : null)\n        .setName(filenameMaker.sanitizeUrl(url.getPath()))\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/SnapshotStubMappingPostProcessor.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.google.common.collect.HashMultiset;\nimport com.google.common.collect.Multiset;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Performs stateful post-processing tasks on stub mappings generated from ServeEvents:\n *\n * <ol>\n *   <li>Run any applicable StubMappingTransformers against the stub mappings.\n *   <li>Detect duplicate requests and either discard them or turn them into scenarios.\n *   <li>Extract response bodies to a separate file, if applicable.\n * </ol>\n */\nclass SnapshotStubMappingPostProcessor {\n  private final boolean shouldRecordRepeatsAsScenarios;\n  private final SnapshotStubMappingTransformerRunner transformerRunner;\n  private final ResponseDefinitionBodyMatcher bodyExtractMatcher;\n  private final SnapshotStubMappingBodyExtractor bodyExtractor;\n\n  SnapshotStubMappingPostProcessor(\n      boolean shouldRecordRepeatsAsScenarios,\n      SnapshotStubMappingTransformerRunner transformerRunner,\n      ResponseDefinitionBodyMatcher bodyExtractMatcher,\n      SnapshotStubMappingBodyExtractor bodyExtractor) {\n    this.shouldRecordRepeatsAsScenarios = shouldRecordRepeatsAsScenarios;\n    this.transformerRunner = transformerRunner;\n    this.bodyExtractMatcher = bodyExtractMatcher;\n    this.bodyExtractor = bodyExtractor;\n  }\n\n  Pair<List<RecordError>, List<StubMapping>> process(\n      List<Pair<ServeEvent, StubMapping>> serveEventsToStubMappings) {\n    // 1. Run any applicable StubMappingTransformers against the stub mappings.\n    List<StubMapping> transformedStubMappings = new ArrayList<>();\n    List<RecordError> errors = new ArrayList<>();\n    for (Pair<ServeEvent, StubMapping> serveEventToStubMapping : serveEventsToStubMappings) {\n      StubGenerationResult result = transformerRunner.apply(serveEventToStubMapping);\n      if (result instanceof StubGenerationResult.Success success) {\n        transformedStubMappings.add(success.stubMapping());\n      } else if (result instanceof StubGenerationResult.Failure failure) {\n        errors.add(\n            new RecordError.StubGenerationFailure(failure.reason(), serveEventToStubMapping.a));\n      } else {\n        throw new IllegalStateException(\"Unexpected result: \" + result);\n      }\n    }\n\n    // 2. Detect duplicate requests and either discard them or turn them into scenarios.\n    Multiset<RequestPattern> requestCounts = HashMultiset.create();\n    List<StubMapping> processedStubMappings = new ArrayList<>();\n    for (StubMapping transformedStubMapping : transformedStubMappings) {\n      requestCounts.add(transformedStubMapping.getRequest());\n\n      // Skip duplicate requests if shouldRecordRepeatsAsScenarios is not enabled\n      if (requestCounts.count(transformedStubMapping.getRequest()) > 1\n          && !shouldRecordRepeatsAsScenarios) {\n        continue;\n      }\n\n      processedStubMappings.add(transformedStubMapping);\n    }\n\n    if (shouldRecordRepeatsAsScenarios) {\n      processedStubMappings =\n          new ScenarioProcessor().putRepeatedRequestsInScenarios(processedStubMappings);\n    }\n\n    // 3. Extract response bodies to a separate file, if applicable.\n    processedStubMappings = extractStubMappingBodies(processedStubMappings);\n\n    return new Pair<>(errors, processedStubMappings);\n  }\n\n  private List<StubMapping> extractStubMappingBodies(List<StubMapping> stubMappings) {\n    if (bodyExtractMatcher == null) {\n      return stubMappings;\n    }\n\n    return stubMappings.stream()\n        .map(\n            sm ->\n                bodyExtractMatcher.match(sm.getResponse()).isExactMatch()\n                    ? bodyExtractor.extractInPlace(sm)\n                    : sm)\n        .toList();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/SnapshotStubMappingTransformerRunner.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.StubMappingTransformer;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport com.github.tomakehurst.wiremock.store.files.BlobStoreFileSource;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.function.Function;\n\n/**\n * Applies all registered StubMappingTransformer extensions against a stub mapping when applicable,\n * passing them any supplied Parameters.\n */\nclass SnapshotStubMappingTransformerRunner\n    implements Function<Pair<ServeEvent, StubMapping>, StubGenerationResult> {\n  private final FileSource filesRoot;\n  private final Parameters parameters;\n  private final Iterable<StubMappingTransformer> registeredTransformers;\n  private final List<String> requestedTransformers;\n\n  SnapshotStubMappingTransformerRunner(Iterable<StubMappingTransformer> registeredTransformers) {\n    this(registeredTransformers, null, null, null);\n  }\n\n  SnapshotStubMappingTransformerRunner(\n      Iterable<StubMappingTransformer> registeredTransformers,\n      List<String> requestedTransformers,\n      Parameters parameters,\n      BlobStore filesBlobStore) {\n    this.requestedTransformers = requestedTransformers;\n    this.registeredTransformers = registeredTransformers;\n    this.parameters = parameters;\n    this.filesRoot = new BlobStoreFileSource(filesBlobStore);\n  }\n\n  @Override\n  public StubGenerationResult apply(Pair<ServeEvent, StubMapping> serveEventToStubMapping) {\n    StubMapping stubMapping = serveEventToStubMapping.b;\n    for (StubMappingTransformer transformer : registeredTransformers) {\n      if (transformer.applyGlobally()\n          || (requestedTransformers != null\n              && requestedTransformers.contains(transformer.getName()))) {\n        StubGenerationResult result =\n            transformer.transform(stubMapping, filesRoot, parameters, serveEventToStubMapping.a);\n        if (result instanceof StubGenerationResult.Success success) {\n          stubMapping = success.stubMapping();\n        } else if (result instanceof StubGenerationResult.Failure failure) {\n          return failure;\n        } else {\n          throw new IllegalStateException(\"Unexpected result: \" + result);\n        }\n      }\n    }\n\n    return new StubGenerationResult.Success(stubMapping);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/recording/StubGenerationResult.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.recording;\n\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\n\npublic sealed interface StubGenerationResult {\n  record Success(StubMapping stubMapping) implements StubGenerationResult {}\n\n  record Failure(String reason) implements StubGenerationResult {}\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/Authenticator.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport com.github.tomakehurst.wiremock.http.Request;\n\npublic interface Authenticator {\n\n  boolean authenticate(Request request);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/BasicAuthenticator.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.AUTHORIZATION;\nimport static java.util.Arrays.asList;\n\nimport com.github.tomakehurst.wiremock.client.BasicCredentials;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class BasicAuthenticator implements Authenticator {\n\n  private final List<BasicCredentials> credentials;\n\n  public BasicAuthenticator(List<BasicCredentials> credentials) {\n    this.credentials = credentials;\n  }\n\n  public BasicAuthenticator(BasicCredentials... credentials) {\n    this.credentials = asList(credentials);\n  }\n\n  public BasicAuthenticator(String username, String password) {\n    this(new BasicCredentials(username, password));\n  }\n\n  @Override\n  public boolean authenticate(Request request) {\n    List<String> headerValues =\n        credentials.stream()\n            .map(BasicCredentials::asAuthorizationHeaderValue)\n            .collect(Collectors.toList());\n    return request.containsHeader(AUTHORIZATION)\n        && headerValues.contains(request.header(AUTHORIZATION).firstValue());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/ClientAuthenticator.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport java.util.List;\n\npublic interface ClientAuthenticator {\n\n  List<HttpHeader> generateAuthHeaders();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/ClientBasicAuthenticator.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.AUTHORIZATION;\nimport static com.github.tomakehurst.wiremock.http.HttpHeader.httpHeader;\nimport static java.util.Collections.singletonList;\n\nimport com.github.tomakehurst.wiremock.client.BasicCredentials;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport java.util.List;\n\npublic class ClientBasicAuthenticator implements ClientAuthenticator {\n\n  private final String username;\n  private final String password;\n\n  public ClientBasicAuthenticator(String username, String password) {\n    this.username = username;\n    this.password = password;\n  }\n\n  @Override\n  public List<HttpHeader> generateAuthHeaders() {\n    BasicCredentials basicCredentials = new BasicCredentials(username, password);\n    return singletonList(httpHeader(AUTHORIZATION, basicCredentials.asAuthorizationHeaderValue()));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/ClientTokenAuthenticator.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.AUTHORIZATION;\n\npublic class ClientTokenAuthenticator extends SingleHeaderClientAuthenticator {\n\n  public ClientTokenAuthenticator(String token) {\n    super(AUTHORIZATION, \"Token \" + token);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/NoAuthenticator.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport com.github.tomakehurst.wiremock.http.Request;\n\npublic class NoAuthenticator implements Authenticator {\n\n  @Override\n  public boolean authenticate(Request request) {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/NoClientAuthenticator.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport static java.util.Collections.emptyList;\n\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport java.util.List;\n\npublic class NoClientAuthenticator implements ClientAuthenticator {\n\n  public static NoClientAuthenticator noClientAuthenticator() {\n    return new NoClientAuthenticator();\n  }\n\n  @Override\n  public List<HttpHeader> generateAuthHeaders() {\n    return emptyList();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/NotAuthorisedException.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\npublic class NotAuthorisedException extends RuntimeException {\n\n  public NotAuthorisedException() {}\n\n  public NotAuthorisedException(String message) {\n    super(message);\n  }\n\n  public NotAuthorisedException(String message, Throwable cause) {\n    super(message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/SingleHeaderAuthenticator.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.AUTHORIZATION;\n\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport java.util.List;\n\npublic class SingleHeaderAuthenticator implements Authenticator {\n\n  private final String key;\n  private final String value;\n\n  public SingleHeaderAuthenticator(String key, String value) {\n    this.key = key;\n    this.value = value;\n  }\n\n  @Override\n  public boolean authenticate(Request request) {\n    HttpHeader requestHeader = request.header(key);\n    if (requestHeader == null || !requestHeader.isPresent()) {\n      return false;\n    }\n\n    List<String> headerValues = requestHeader.values();\n    return request.containsHeader(AUTHORIZATION) && headerValues.contains(value);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/SingleHeaderClientAuthenticator.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class SingleHeaderClientAuthenticator implements ClientAuthenticator {\n\n  private final String key;\n  private final String value;\n\n  public SingleHeaderClientAuthenticator(String key, String value) {\n    this.key = key;\n    this.value = value;\n  }\n\n  @Override\n  public List<HttpHeader> generateAuthHeaders() {\n    return Collections.singletonList(new HttpHeader(key, value));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/security/TokenAuthenticator.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.security;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.AUTHORIZATION;\n\npublic class TokenAuthenticator extends SingleHeaderAuthenticator {\n\n  public TokenAuthenticator(String token) {\n    super(AUTHORIZATION, \"Token \" + token);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/servlet/BodyChunker.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.servlet;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\n\nimport java.util.Arrays;\n\npublic class BodyChunker {\n\n  public static byte[][] chunkBody(byte[] body, int numberOfChunks) {\n\n    if (numberOfChunks < 1) {\n      notifier().error(\"Number of chunks set to value less than 1: \" + numberOfChunks);\n      numberOfChunks = 1;\n    }\n\n    if (body.length < numberOfChunks) {\n      notifier()\n          .error(\n              \"Number of chunks set to value greater then body length. Number of chunks: \"\n                  + numberOfChunks\n                  + \". Body length: \"\n                  + body.length\n                  + \". Overriding number of chunks to body length.\");\n      numberOfChunks = body.length;\n    }\n\n    int chunkSize = body.length / numberOfChunks;\n    int excessSize = body.length % numberOfChunks;\n\n    byte[][] chunkedBody = new byte[numberOfChunks][];\n\n    for (int chunkIndex = 0; chunkIndex < numberOfChunks; chunkIndex++) {\n      int chunkStart = chunkIndex * chunkSize;\n      int chunkEnd = chunkStart + chunkSize;\n\n      chunkedBody[chunkIndex] = Arrays.copyOfRange(body, chunkStart, chunkEnd);\n    }\n\n    if (excessSize > 0) {\n      int lastChunkIndex = numberOfChunks - 1;\n\n      int chunkStart = lastChunkIndex * chunkSize;\n      int newChunkEnd = chunkStart + chunkSize + excessSize;\n\n      chunkedBody[lastChunkIndex] = Arrays.copyOfRange(body, chunkStart, newChunkEnd);\n    }\n\n    return chunkedBody;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/servlet/NotImplementedContainer.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.servlet;\n\nimport com.github.tomakehurst.wiremock.core.Container;\n\npublic class NotImplementedContainer implements Container {\n  @Override\n  public int port() {\n    throw new UnsupportedOperationException(\"Server port number cannot be retrieved\");\n  }\n\n  @Override\n  public void shutdown() {\n    throw new UnsupportedOperationException(\"Stopping the server is not supported\");\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/servlet/NotImplementedMappingsSaver.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.servlet;\n\nimport com.github.tomakehurst.wiremock.core.MappingsSaver;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.List;\nimport java.util.UUID;\n\npublic class NotImplementedMappingsSaver implements MappingsSaver {\n  @Override\n  public void save(List<StubMapping> stubMappings) {\n    throw new UnsupportedOperationException(\"Saving mappings is not supported\");\n  }\n\n  @Override\n  public void save(StubMapping stubMapping) {\n    throw new UnsupportedOperationException(\"Saving mapping is not supported\");\n  }\n\n  @Override\n  public void remove(UUID stubMappingId) {\n    throw new UnsupportedOperationException(\"Remove mapping is not supported\");\n  }\n\n  @Override\n  public void removeAll() {\n    throw new UnsupportedOperationException(\"Remove all mappings is not supported\");\n  }\n\n  @Override\n  public void setAll(List<StubMapping> stubMappings) {\n    throw new UnsupportedOperationException(\"Set all mappings is not supported\");\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSource.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\nimport static com.github.tomakehurst.wiremock.common.AbstractFileSource.byFileExtension;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.Json.writePrivate;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.message.MessageStubMappingOrMappings;\nimport com.github.tomakehurst.wiremock.message.MessageStubMappings;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.StubMappingOrMappings;\nimport com.github.tomakehurst.wiremock.stubbing.StubMappings;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.stream.Collectors;\n\npublic class JsonFileMappingsSource implements MappingsSource {\n\n  private final FileSource mappingsFileSource;\n  private final FileSource messageMappingsFileSource;\n  private final Map<UUID, StubMappingFileMetadata> fileNameMap;\n  private final FilenameMaker filenameMaker;\n\n  public JsonFileMappingsSource(FileSource mappingsFileSource, FilenameMaker filenameMaker) {\n    this(mappingsFileSource, null, filenameMaker);\n  }\n\n  public JsonFileMappingsSource(\n      FileSource mappingsFileSource,\n      FileSource messageMappingsFileSource,\n      FilenameMaker filenameMaker) {\n    this.mappingsFileSource = mappingsFileSource;\n    this.messageMappingsFileSource = messageMappingsFileSource;\n    this.filenameMaker = Objects.requireNonNullElseGet(filenameMaker, FilenameMaker::new);\n    fileNameMap = new HashMap<>();\n  }\n\n  @Override\n  public void save(List<StubMapping> stubMappings) {\n    for (StubMapping mapping : stubMappings) {\n      if (mapping != null) {\n        save(mapping);\n      }\n    }\n  }\n\n  @Override\n  public void save(StubMapping stubMapping) {\n    StubMappingFileMetadata fileMetadata = fileNameMap.get(stubMapping.getId());\n    if (fileMetadata == null) {\n      fileMetadata = new StubMappingFileMetadata(filenameMaker.filenameFor(stubMapping), false);\n    }\n\n    if (fileMetadata.multi) {\n      throw new NotWritableException(\n          \"Stubs loaded from multi-mapping files are read-only, and therefore cannot be saved\");\n    }\n\n    mappingsFileSource.writeTextFile(fileMetadata.path, writePrivate(stubMapping));\n\n    fileNameMap.put(stubMapping.getId(), fileMetadata);\n  }\n\n  @Override\n  public void remove(UUID stubMappingId) {\n    StubMappingFileMetadata fileMetadata = fileNameMap.get(stubMappingId);\n    if (fileMetadata.multi) {\n      throw new NotWritableException(\n          \"Stubs loaded from multi-mapping files are read-only, and therefore cannot be removed\");\n    }\n\n    mappingsFileSource.deleteFile(fileMetadata.path);\n    fileNameMap.remove(stubMappingId);\n  }\n\n  @Override\n  public void removeAll() {\n    if (anyFilesAreMultiMapping()) {\n      throw new NotWritableException(\n          \"Some stubs were loaded from multi-mapping files which are read-only, so remove all cannot be performed\");\n    }\n\n    for (StubMappingFileMetadata fileMetadata : fileNameMap.values()) {\n      mappingsFileSource.deleteFile(fileMetadata.path);\n    }\n    fileNameMap.clear();\n  }\n\n  private boolean anyFilesAreMultiMapping() {\n    return fileNameMap.values().stream().anyMatch(input -> input.multi);\n  }\n\n  @Override\n  public void loadMappingsInto(StubMappings stubMappings) {\n    if (!mappingsFileSource.exists()) {\n      return;\n    }\n\n    List<TextFile> mappingFiles =\n        mappingsFileSource.listFilesRecursively().stream()\n            .filter(byFileExtension(\"json\"))\n            .collect(Collectors.toList());\n    for (TextFile mappingFile : mappingFiles) {\n      try {\n        StubMappingOrMappings stubCollection =\n            Json.read(mappingFile.readContents(), StubMappingOrMappings.class);\n        for (StubMapping mapping : stubCollection.getMappingOrMappings()) {\n          stubMappings.addMapping(mapping);\n          StubMappingFileMetadata fileMetadata =\n              new StubMappingFileMetadata(mappingFile.getPath(), stubCollection.isMulti());\n          fileNameMap.put(mapping.getId(), fileMetadata);\n        }\n      } catch (JsonException e) {\n        throw new MappingFileException(mappingFile.getPath(), e.getErrors().first().getDetail());\n      } catch (IOException e) {\n        throwUnchecked(e);\n      }\n    }\n  }\n\n  @Override\n  public void loadMessageMappingsInto(MessageStubMappings messageStubMappings) {\n    if (messageMappingsFileSource == null || !messageMappingsFileSource.exists()) {\n      return;\n    }\n\n    List<TextFile> mappingFiles =\n        messageMappingsFileSource.listFilesRecursively().stream()\n            .filter(byFileExtension(\"json\"))\n            .collect(Collectors.toList());\n    for (TextFile mappingFile : mappingFiles) {\n      try {\n        MessageStubMappingOrMappings stubCollection =\n            Json.read(mappingFile.readContents(), MessageStubMappingOrMappings.class);\n        for (MessageStubMapping mapping : stubCollection.getMappingOrMappings()) {\n          messageStubMappings.add(mapping);\n        }\n      } catch (JsonException e) {\n        throw new MappingFileException(mappingFile.getPath(), e.getErrors().first().getDetail());\n      } catch (IOException e) {\n        throwUnchecked(e);\n      }\n    }\n  }\n\n  private static class StubMappingFileMetadata {\n    final String path;\n    final boolean multi;\n\n    public StubMappingFileMetadata(String path, boolean multi) {\n      this.path = path;\n      this.multi = multi;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/standalone/MappingFileException.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\npublic class MappingFileException extends RuntimeException {\n\n  public MappingFileException(String filePath, String error) {\n    super(String.format(\"Error loading file %s:\\n%s\", filePath, error));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/standalone/MappingsLoader.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\nimport com.github.tomakehurst.wiremock.message.MessageStubMappings;\nimport com.github.tomakehurst.wiremock.stubbing.StubMappings;\n\npublic interface MappingsLoader {\n\n  void loadMappingsInto(StubMappings stubMappings);\n\n  default void loadMessageMappingsInto(MessageStubMappings messageStubMappings) {\n    // Default implementation does nothing - subclasses can override\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/standalone/MappingsSource.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\nimport com.github.tomakehurst.wiremock.core.MappingsSaver;\n\npublic interface MappingsSource extends MappingsLoader, MappingsSaver {}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/standalone/RemoteMappingsLoader.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.standalone;\n\nimport static com.github.tomakehurst.wiremock.common.AbstractFileSource.byFileExtension;\nimport static com.github.tomakehurst.wiremock.common.Strings.substringAfterLast;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.FILES_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MAPPINGS_ROOT;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.BinaryFile;\nimport com.github.tomakehurst.wiremock.common.ContentTypes;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.JsonException;\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport com.github.tomakehurst.wiremock.http.ContentTypeHeader;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.StubMappingOrMappings;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class RemoteMappingsLoader {\n\n  private final FileSource mappingsFileSource;\n  private final FileSource filesFileSource;\n  private final WireMock wireMock;\n\n  public RemoteMappingsLoader(FileSource fileSource, WireMock wireMock) {\n    this.mappingsFileSource = fileSource.child(MAPPINGS_ROOT);\n    this.filesFileSource = fileSource.child(FILES_ROOT);\n    this.wireMock = wireMock;\n  }\n\n  public void load() {\n    List<TextFile> mappingFiles =\n        mappingsFileSource.listFilesRecursively().stream()\n            .filter(byFileExtension(\"json\"))\n            .collect(Collectors.toList());\n    for (TextFile mappingFile : mappingFiles) {\n      try {\n        StubMappingOrMappings stubCollection =\n            Json.read(mappingFile.readContentsAsString(), StubMappingOrMappings.class);\n        for (StubMapping mapping : stubCollection.getMappingOrMappings()) {\n          wireMock.register(convertBodyFromFileIfNecessary(mapping));\n        }\n      } catch (JsonException e) {\n        throw new MappingFileException(mappingFile.getPath(), e.getErrors().first().getDetail());\n      }\n    }\n  }\n\n  private StubMapping convertBodyFromFileIfNecessary(StubMapping mapping) {\n    String bodyFileName = mapping.getResponse().getBodyFileName();\n    if (bodyFileName != null) {\n      ResponseDefinitionBuilder responseDefinitionBuilder =\n          ResponseDefinitionBuilder.like(mapping.getResponse()).withBodyFile(null);\n\n      String extension = substringAfterLast(bodyFileName, \".\");\n      String mimeType = getMimeType(mapping);\n\n      if (ContentTypes.determineIsText(extension, mimeType)) {\n        TextFile bodyFile = filesFileSource.getTextFileNamed(bodyFileName);\n        responseDefinitionBuilder.withBody(bodyFile.readContentsAsString());\n      } else {\n        BinaryFile bodyFile = filesFileSource.getBinaryFileNamed(bodyFileName);\n        responseDefinitionBuilder.withBody(bodyFile.readContents());\n      }\n\n      return mapping.transform(sm -> sm.setResponse(responseDefinitionBuilder.build()));\n    }\n\n    return mapping;\n  }\n\n  private String getMimeType(StubMapping mapping) {\n    HttpHeaders responseHeaders = mapping.getResponse().getHeaders();\n    ContentTypeHeader contentTypeHeader = responseHeaders.getContentTypeHeader();\n    return contentTypeHeader != null ? contentTypeHeader.mimeTypePart() : null;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/BlobStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.common.InputStreamSource;\nimport java.io.InputStream;\nimport java.util.Optional;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface BlobStore extends Store<String, byte[]> {\n\n  Optional<InputStream> getStream(String key);\n\n  InputStreamSource getStreamSource(String key);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/DefaultStores.java",
    "content": "/*\n * Copyright (C) 2022-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport static com.github.tomakehurst.wiremock.store.Stores.PersistenceType.EPHEMERAL;\n\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.store.files.FileSourceBlobStore;\nimport com.github.tomakehurst.wiremock.store.files.FileSourceJsonObjectStore;\nimport java.util.Map;\nimport java.util.concurrent.ConcurrentHashMap;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class DefaultStores implements Stores {\n\n  private final FileSource fileRoot;\n\n  private final StubMappingStore stubMappingStore;\n  private final RequestJournalStore requestJournalStore;\n  private final SettingsStore settingsStore;\n  private final ScenariosStore scenariosStore;\n  private final MessageChannelStore messageChannelStore;\n  private final MessageStubMappingStore messageStubMappingStore;\n  private final MessageJournalStore messageJournalStore;\n\n  private final Map<String, ObjectStore> objectStores;\n\n  public DefaultStores(FileSource fileRoot) {\n    this.fileRoot = fileRoot;\n\n    this.stubMappingStore = new InMemoryStubMappingStore();\n    this.requestJournalStore = new InMemoryRequestJournalStore();\n    this.settingsStore = new InMemorySettingsStore();\n    this.scenariosStore = new InMemoryScenariosStore();\n    this.messageChannelStore = new InMemoryMessageChannelStore();\n    this.messageStubMappingStore = new InMemoryMessageStubMappingStore();\n    this.messageJournalStore = new InMemoryMessageJournalStore();\n\n    objectStores = new ConcurrentHashMap<>();\n  }\n\n  @Override\n  public StubMappingStore getStubStore() {\n    return stubMappingStore;\n  }\n\n  @Override\n  public RequestJournalStore getRequestJournalStore() {\n    return requestJournalStore;\n  }\n\n  @Override\n  public SettingsStore getSettingsStore() {\n    return settingsStore;\n  }\n\n  @Override\n  public ScenariosStore getScenariosStore() {\n    return scenariosStore;\n  }\n\n  @Override\n  public RecorderStateStore getRecorderStateStore() {\n    return new InMemoryRecorderStateStore();\n  }\n\n  @Override\n  public MessageChannelStore getMessageChannelStore() {\n    return messageChannelStore;\n  }\n\n  @Override\n  public MessageStubMappingStore getMessageStubMappingStore() {\n    return messageStubMappingStore;\n  }\n\n  @Override\n  public MessageJournalStore getMessageJournalStore() {\n    return messageJournalStore;\n  }\n\n  @Override\n  public BlobStore getBlobStore(String name) {\n    final FileSource child = fileRoot.child(name);\n    return new FileSourceBlobStore(child);\n  }\n\n  @Override\n  public ObjectStore getObjectStore(\n      String name, PersistenceType persistenceTypeHint, int maxItems) {\n    if (persistenceTypeHint == EPHEMERAL) {\n      return objectStores.computeIfAbsent(name, n -> new InMemoryObjectStore(maxItems));\n    } else {\n      final FileSource child = fileRoot.child(name);\n      return new FileSourceJsonObjectStore(child);\n    }\n  }\n\n  @Override\n  public void start() {}\n\n  @Override\n  public void stop() {}\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemoryMappingStore.java",
    "content": "/*\n * Copyright (C) 2022-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.common.Prioritisable;\nimport com.github.tomakehurst.wiremock.common.SortedConcurrentPrioritisableSet;\nimport java.util.Optional;\nimport java.util.UUID;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic abstract class InMemoryMappingStore<T extends Prioritisable> {\n\n  private final SortedConcurrentPrioritisableSet<T> mappings =\n      new SortedConcurrentPrioritisableSet<>();\n\n  public Optional<T> get(UUID id) {\n    return mappings.stream().filter(mapping -> mapping.getId().equals(id)).findFirst();\n  }\n\n  public void remove(UUID id) {\n    mappings.remove(id);\n  }\n\n  public void clear() {\n    mappings.clear();\n  }\n\n  public Stream<T> getAll() {\n    return mappings.stream();\n  }\n\n  public T add(T mapping) {\n    return mappings.add(mapping);\n  }\n\n  public T replace(T existing, T updated) {\n    return mappings.replace(existing, updated);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemoryMessageChannelStore.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.message.MessageChannel;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.UUID;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class InMemoryMessageChannelStore implements MessageChannelStore {\n\n  private final Map<UUID, MessageChannel> channels = new ConcurrentHashMap<>();\n\n  @Override\n  public Stream<MessageChannel> getAll() {\n    return channels.values().stream();\n  }\n\n  @Override\n  public Optional<MessageChannel> get(UUID id) {\n    return Optional.ofNullable(channels.get(id));\n  }\n\n  @Override\n  public void add(MessageChannel channel) {\n    channels.put(channel.getId(), channel);\n  }\n\n  @Override\n  public Optional<MessageChannel> remove(UUID id) {\n    return Optional.ofNullable(channels.remove(id));\n  }\n\n  @Override\n  public void clear() {\n    channels.clear();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemoryMessageJournalStore.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.util.*;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.ConcurrentLinkedDeque;\nimport java.util.concurrent.CopyOnWriteArrayList;\nimport java.util.function.Consumer;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n/**\n * In-memory implementation of MessageJournalStore. Stores message serve events in memory with\n * support for event listeners.\n */\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class InMemoryMessageJournalStore implements MessageJournalStore {\n\n  private final Deque<UUID> deque = new ConcurrentLinkedDeque<>();\n  private final Map<UUID, MessageServeEvent> events = new ConcurrentHashMap<>();\n  private final List<Consumer<? super StoreEvent<UUID, MessageServeEvent>>> eventListeners =\n      new CopyOnWriteArrayList<>();\n\n  @Override\n  public void add(MessageServeEvent event) {\n    MessageServeEvent previous = events.put(event.getId(), event);\n    deque.addFirst(event.getId());\n    notifyListeners(new StoreEvent<>(event.getId(), previous, event));\n  }\n\n  @Override\n  public Stream<MessageServeEvent> getAll() {\n    return deque.stream().map(events::get).filter(Objects::nonNull);\n  }\n\n  @Override\n  public void removeLast() {\n    final UUID id = deque.pollLast();\n    if (id != null) {\n      MessageServeEvent removed = events.remove(id);\n      if (removed != null) {\n        notifyListeners(new StoreEvent<>(id, removed, null));\n      }\n    }\n  }\n\n  @Override\n  public Stream<UUID> getAllKeys() {\n    return getAll().map(MessageServeEvent::getId);\n  }\n\n  @Override\n  public Optional<MessageServeEvent> get(UUID id) {\n    return Optional.ofNullable(events.get(id));\n  }\n\n  @Override\n  public void put(UUID id, MessageServeEvent event) {\n    if (deque.contains(id)) {\n      MessageServeEvent previous = events.put(id, event);\n      notifyListeners(new StoreEvent<>(id, previous, event));\n    }\n  }\n\n  @Override\n  public void remove(UUID id) {\n    deque.stream().filter(eventId -> eventId.equals(id)).forEach(deque::remove);\n    MessageServeEvent removed = events.remove(id);\n    if (removed != null) {\n      notifyListeners(new StoreEvent<>(id, removed, null));\n    }\n  }\n\n  @Override\n  public void clear() {\n    deque.clear();\n    events.clear();\n  }\n\n  @Override\n  public void registerEventListener(\n      Consumer<? super StoreEvent<UUID, MessageServeEvent>> listener) {\n    eventListeners.add(listener);\n  }\n\n  @Override\n  public void unregisterEventListener(\n      Consumer<? super StoreEvent<UUID, MessageServeEvent>> listener) {\n    eventListeners.remove(listener);\n  }\n\n  private void notifyListeners(StoreEvent<UUID, MessageServeEvent> event) {\n    for (Consumer<? super StoreEvent<UUID, MessageServeEvent>> listener : eventListeners) {\n      try {\n        listener.accept(event);\n      } catch (Exception e) {\n        // Ignore listener exceptions to prevent them from affecting the store operation\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemoryMessageStubMappingStore.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class InMemoryMessageStubMappingStore extends InMemoryMappingStore<MessageStubMapping>\n    implements MessageStubMappingStore {}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemoryObjectStore.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.Queue;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.ConcurrentLinkedQueue;\nimport java.util.concurrent.atomic.AtomicReference;\nimport java.util.function.Consumer;\nimport java.util.function.Function;\nimport java.util.stream.Stream;\n\npublic class InMemoryObjectStore implements ObjectStore, StoreEventEmitter<String, Object> {\n\n  private final ConcurrentHashMap<String, Object> cache;\n  private final Queue<String> keyUseOrder = new ConcurrentLinkedQueue<>();\n  private final int maxItems;\n  private final List<Consumer<? super StoreEvent<String, Object>>> listeners = new ArrayList<>();\n\n  public InMemoryObjectStore(int maxItems) {\n    this.cache = new ConcurrentHashMap<>();\n    this.maxItems = maxItems;\n  }\n\n  @Override\n  public <T> Optional<T> get(String key, Class<T> type) {\n    return get(key).map(type::cast);\n  }\n\n  @Override\n  public Optional<Object> get(String key) {\n    Optional<Object> value = Optional.ofNullable(cache.get(key));\n    if (value.isPresent()) {\n      touch(key);\n    }\n    return value;\n  }\n\n  @Override\n  public Stream<String> getAllKeys() {\n    return cache.keySet().stream();\n  }\n\n  @Override\n  public void put(String key, Object content) {\n    Object previousValue = cache.put(key, content);\n    touchAndResize(key);\n    handleEvent(StoreEvent.set(key, previousValue, content));\n  }\n\n  @Override\n  @SuppressWarnings(\"unchecked\")\n  public <T> T compute(String key, Function<T, T> valueFunction) {\n    final AtomicReference<T> previousValue = new AtomicReference<>();\n    final T result =\n        (T)\n            cache.compute(\n                key,\n                (k, currentValue) -> {\n                  previousValue.set((T) currentValue);\n                  return valueFunction.apply((T) currentValue);\n                });\n    if (result != null) {\n      touchAndResize(key);\n    } else {\n      keyUseOrder.remove(key);\n    }\n    handleEvent(StoreEvent.set(key, previousValue.get(), result));\n    return result;\n  }\n\n  @Override\n  public void remove(String key) {\n    Object previousValue = cache.remove(key);\n    keyUseOrder.remove(key);\n    if (previousValue != null) {\n      handleEvent(StoreEvent.remove(key, previousValue));\n    }\n  }\n\n  @Override\n  public void clear() {\n    cache.clear();\n    keyUseOrder.clear();\n  }\n\n  @Override\n  public void registerEventListener(Consumer<? super StoreEvent<String, Object>> handler) {\n    listeners.add(handler);\n  }\n\n  private void handleEvent(StoreEvent<String, Object> event) {\n    for (Consumer<? super StoreEvent<String, Object>> listener : listeners) {\n      try {\n        listener.accept(event);\n      } catch (Exception e) {\n        notifier().error(\"Error handling store event\", e);\n      }\n    }\n  }\n\n  private void touchAndResize(String key) {\n    touch(key);\n    resize();\n  }\n\n  private void touch(String key) {\n    keyUseOrder.remove(key);\n    keyUseOrder.offer(key);\n  }\n\n  private void resize() {\n    while (keyUseOrder.size() > maxItems) {\n      final String keyToRemove = keyUseOrder.poll();\n      remove(keyToRemove);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemoryRecorderStateStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.recording.RecorderState;\nimport java.util.concurrent.atomic.AtomicReference;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class InMemoryRecorderStateStore implements RecorderStateStore {\n\n  private final AtomicReference<RecorderState> store;\n\n  public InMemoryRecorderStateStore() {\n    this.store = new AtomicReference<>(RecorderState.initial());\n  }\n\n  @Override\n  public RecorderState get() {\n    return store.get();\n  }\n\n  @Override\n  public void set(RecorderState state) {\n    store.set(state);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemoryRequestJournalStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.*;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.ConcurrentLinkedDeque;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class InMemoryRequestJournalStore implements RequestJournalStore {\n\n  private final Deque<UUID> deque = new ConcurrentLinkedDeque<>();\n  private final Map<UUID, ServeEvent> serveEvents = new ConcurrentHashMap<>();\n\n  @Override\n  public void add(ServeEvent event) {\n    serveEvents.put(event.getId(), event);\n    deque.addFirst(event.getId());\n  }\n\n  @Override\n  public Stream<ServeEvent> getAll() {\n    return deque.stream().map(serveEvents::get).filter(Objects::nonNull);\n  }\n\n  @Override\n  public void removeLast() {\n    final UUID id = deque.pollLast();\n    if (id != null) {\n      serveEvents.remove(id);\n    }\n  }\n\n  @Override\n  public Stream<UUID> getAllKeys() {\n    return getAll().map(ServeEvent::getId);\n  }\n\n  @Override\n  public Optional<ServeEvent> get(UUID id) {\n    return Optional.ofNullable(serveEvents.get(id));\n  }\n\n  @Override\n  public void put(UUID id, ServeEvent event) {\n    if (deque.contains(id)) {\n      serveEvents.put(id, event);\n    }\n  }\n\n  @Override\n  public void remove(UUID id) {\n    deque.stream().filter(eventId -> eventId.equals(id)).forEach(deque::remove);\n    serveEvents.remove(id);\n  }\n\n  @Override\n  public void clear() {\n    deque.clear();\n    serveEvents.clear();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemoryScenariosStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport java.util.Optional;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class InMemoryScenariosStore implements ScenariosStore {\n\n  private final ConcurrentHashMap<String, Scenario> scenarioMap = new ConcurrentHashMap<>();\n\n  @Override\n  public Stream<String> getAllKeys() {\n    return scenarioMap.keySet().stream();\n  }\n\n  @Override\n  public Stream<Scenario> getAll() {\n    return scenarioMap.values().stream();\n  }\n\n  @Override\n  public Optional<Scenario> get(String key) {\n    return Optional.ofNullable(scenarioMap.get(key));\n  }\n\n  @Override\n  public void put(String key, Scenario content) {\n    scenarioMap.put(key, content);\n  }\n\n  @Override\n  public void remove(String key) {\n    scenarioMap.remove(key);\n  }\n\n  @Override\n  public void clear() {\n    scenarioMap.clear();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemorySettingsStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport java.util.concurrent.atomic.AtomicReference;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class InMemorySettingsStore implements SettingsStore {\n\n  private AtomicReference<GlobalSettings> holder = new AtomicReference<>(GlobalSettings.defaults());\n\n  @Override\n  public GlobalSettings get() {\n    return holder.get();\n  }\n\n  @Override\n  public void set(GlobalSettings newSettings) {\n    holder.set(newSettings);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/InMemoryStubMappingStore.java",
    "content": "/*\n * Copyright (C) 2022-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class InMemoryStubMappingStore extends InMemoryMappingStore<StubMapping>\n    implements StubMappingStore {}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/MessageChannelStore.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.message.MessageChannel;\nimport java.util.Optional;\nimport java.util.UUID;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface MessageChannelStore {\n\n  Stream<MessageChannel> getAll();\n\n  Optional<MessageChannel> get(UUID id);\n\n  void add(MessageChannel channel);\n\n  Optional<MessageChannel> remove(UUID id);\n\n  void clear();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/MessageJournalStore.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.verification.MessageServeEvent;\nimport java.util.UUID;\nimport java.util.function.Consumer;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface MessageJournalStore extends Store<UUID, MessageServeEvent> {\n\n  Stream<MessageServeEvent> getAll();\n\n  void add(MessageServeEvent event);\n\n  void removeLast();\n\n  void registerEventListener(Consumer<? super StoreEvent<UUID, MessageServeEvent>> listener);\n\n  void unregisterEventListener(Consumer<? super StoreEvent<UUID, MessageServeEvent>> listener);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/MessageStubMappingStore.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport java.util.Optional;\nimport java.util.UUID;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface MessageStubMappingStore {\n\n  Stream<MessageStubMapping> getAll();\n\n  Optional<MessageStubMapping> get(UUID id);\n\n  MessageStubMapping add(MessageStubMapping mapping);\n\n  void remove(UUID id);\n\n  void clear();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/ObjectStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport java.util.Optional;\nimport java.util.function.Function;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface ObjectStore extends Store<String, Object> {\n\n  <T> Optional<T> get(String key, Class<T> type);\n\n  <T> T compute(String key, Function<T, T> valueFunction);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/RecorderStateStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.recording.RecorderState;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface RecorderStateStore {\n  RecorderState get();\n\n  void set(RecorderState state);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/RequestJournalStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.UUID;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface RequestJournalStore extends Store<UUID, ServeEvent> {\n\n  Stream<ServeEvent> getAll();\n\n  void add(ServeEvent event);\n\n  void removeLast();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/ScenariosStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.stubbing.Scenario;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface ScenariosStore extends Store<String, Scenario> {\n\n  Stream<Scenario> getAll();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/SettingsStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.global.GlobalSettings;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface SettingsStore {\n\n  GlobalSettings get();\n\n  void set(GlobalSettings newSettings);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/Store.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport java.util.Optional;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface Store<K, V> {\n\n  Stream<K> getAllKeys();\n\n  Optional<V> get(K key);\n\n  void put(K key, V content);\n\n  void remove(K key);\n\n  void clear();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/StoreEvent.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport java.util.Objects;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class StoreEvent<K, V> {\n\n  public static <K, V> StoreEvent<K, V> set(K key, V previousValue, V newValue) {\n    return new StoreEvent<>(key, previousValue, newValue);\n  }\n\n  public static <K, V> StoreEvent<K, V> remove(K key, V previousValue) {\n    return new StoreEvent<>(key, previousValue, null);\n  }\n\n  private final K key;\n  private final V oldValue;\n  private final V newValue;\n\n  public StoreEvent(K key, V oldValue, V newValue) {\n    this.key = key;\n    this.oldValue = oldValue;\n    this.newValue = newValue;\n  }\n\n  public K getKey() {\n    return key;\n  }\n\n  public V getOldValue() {\n    return oldValue;\n  }\n\n  public V getNewValue() {\n    return newValue;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    StoreEvent<?, ?> that = (StoreEvent<?, ?>) o;\n    return Objects.equals(key, that.key)\n        && Objects.equals(oldValue, that.oldValue)\n        && Objects.equals(newValue, that.newValue);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(key, oldValue, newValue);\n  }\n\n  @Override\n  public String toString() {\n    return \"StoreEvent{\" + \"key=\" + key + \", oldValue=\" + oldValue + \", newValue=\" + newValue + '}';\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/StoreEventEmitter.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport java.util.function.Consumer;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface StoreEventEmitter<K, V> {\n\n  void registerEventListener(Consumer<? super StoreEvent<K, V>> handler);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/Stores.java",
    "content": "/*\n * Copyright (C) 2022-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.FILES_ROOT;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MAPPINGS_ROOT;\n\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface Stores extends StoresLifecycle {\n\n  enum PersistenceType {\n    PERSISTENT,\n    EPHEMERAL\n  }\n\n  StubMappingStore getStubStore();\n\n  RequestJournalStore getRequestJournalStore();\n\n  SettingsStore getSettingsStore();\n\n  ScenariosStore getScenariosStore();\n\n  RecorderStateStore getRecorderStateStore();\n\n  MessageChannelStore getMessageChannelStore();\n\n  MessageStubMappingStore getMessageStubMappingStore();\n\n  MessageJournalStore getMessageJournalStore();\n\n  default BlobStore getMappingsBlobStore() {\n    return getBlobStore(MAPPINGS_ROOT);\n  }\n\n  default BlobStore getFilesBlobStore() {\n    return getBlobStore(FILES_ROOT);\n  }\n\n  BlobStore getBlobStore(String name);\n\n  default ObjectStore getObjectStore(String name) {\n    return getObjectStore(name, PersistenceType.EPHEMERAL);\n  }\n\n  default ObjectStore getObjectStore(String name, PersistenceType persistenceTypeHint) {\n    return getObjectStore(name, persistenceTypeHint, 10_000);\n  }\n\n  ObjectStore getObjectStore(String name, PersistenceType persistenceTypeHint, int maxSize);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/StoresLifecycle.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface StoresLifecycle {\n\n  void start();\n\n  void stop();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/StubMappingStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store;\n\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport java.util.*;\nimport java.util.function.Consumer;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface StubMappingStore {\n\n  Stream<StubMapping> getAll();\n\n  Optional<StubMapping> get(UUID id);\n\n  default Stream<StubMapping> findAllMatchingRequest(\n      Request request,\n      Map<String, RequestMatcherExtension> customMatchers,\n      Consumer<SubEvent> subEventConsumer) {\n    return getAll()\n        .map(\n            stubMapping ->\n                Pair.pair(stubMapping, stubMapping.getRequest().match(request, customMatchers)))\n        .peek(stubAndMatchResult -> stubAndMatchResult.b.getSubEvents().forEach(subEventConsumer))\n        .filter(stubAndMatchResult -> stubAndMatchResult.b.isExactMatch())\n        .map(stubAndMatchResult -> stubAndMatchResult.a);\n  }\n\n  StubMapping add(StubMapping stub);\n\n  StubMapping replace(StubMapping existing, StubMapping updated);\n\n  void remove(UUID stubMapping);\n\n  void clear();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/files/BlobStoreBinaryFile.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store.files;\n\nimport com.github.tomakehurst.wiremock.admin.NotFoundException;\nimport com.github.tomakehurst.wiremock.common.BinaryFile;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport java.io.InputStream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class BlobStoreBinaryFile extends BinaryFile {\n\n  private final BlobStore blobStore;\n  private final String path;\n\n  public BlobStoreBinaryFile(BlobStore blobStore, String path) {\n    super(null);\n    this.blobStore = blobStore;\n    this.path = path;\n  }\n\n  @Override\n  public byte[] readContents() {\n    return blobStore.get(path).orElseThrow(() -> new NotFoundException(path + \" not found\"));\n  }\n\n  @Override\n  public String name() {\n    return path;\n  }\n\n  @Override\n  public String toString() {\n    return name();\n  }\n\n  @Override\n  public InputStream getStream() {\n    return blobStore.getStream(path).orElseThrow(() -> new NotFoundException(path + \" not found\"));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/files/BlobStoreFileSource.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store.files;\n\nimport com.github.tomakehurst.wiremock.common.BinaryFile;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport java.net.URI;\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class BlobStoreFileSource implements FileSource {\n\n  private final BlobStore blobStore;\n\n  public BlobStoreFileSource(BlobStore blobStore) {\n    this.blobStore = blobStore;\n  }\n\n  @Override\n  public BinaryFile getBinaryFileNamed(String name) {\n    return new BlobStoreBinaryFile(blobStore, name);\n  }\n\n  @Override\n  public TextFile getTextFileNamed(String name) {\n    return new BlobStoreTextFile(blobStore, name);\n  }\n\n  @Override\n  public void createIfNecessary() {}\n\n  @Override\n  public FileSource child(String subDirectoryName) {\n    return this;\n  }\n\n  @Override\n  public String getPath() {\n    if (blobStore instanceof PathBased) {\n      return ((PathBased) blobStore).getPath();\n    }\n\n    return \"\";\n  }\n\n  @Override\n  public URI getUri() {\n    return null;\n  }\n\n  @Override\n  public List<TextFile> listFilesRecursively() {\n    return blobStore\n        .getAllKeys()\n        .map(path -> new BlobStoreTextFile(blobStore, path))\n        .collect(Collectors.toList());\n  }\n\n  @Override\n  public void writeTextFile(String name, String contents) {\n    blobStore.put(name, Strings.bytesFromString(contents));\n  }\n\n  @Override\n  public void writeBinaryFile(String name, byte[] contents) {\n    blobStore.put(name, contents);\n  }\n\n  @Override\n  public boolean exists() {\n    return true;\n  }\n\n  @Override\n  public void deleteFile(String name) {\n    blobStore.remove(name);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/files/BlobStoreTextFile.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store.files;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.github.tomakehurst.wiremock.admin.NotFoundException;\nimport com.github.tomakehurst.wiremock.common.TextFile;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport java.io.InputStream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class BlobStoreTextFile extends TextFile {\n\n  private final BlobStore blobStore;\n  private final String path;\n\n  public BlobStoreTextFile(BlobStore blobStore, String path) {\n    super(null);\n    this.blobStore = blobStore;\n    this.path = path;\n  }\n\n  @Override\n  public byte[] readContents() {\n    return blobStore.get(path).orElseThrow(() -> new NotFoundException(path + \" not found\"));\n  }\n\n  @Override\n  public String name() {\n    return path;\n  }\n\n  @Override\n  public String toString() {\n    return name();\n  }\n\n  @Override\n  public InputStream getStream() {\n    return blobStore.getStream(path).orElseThrow(() -> new NotFoundException(path + \" not found\"));\n  }\n\n  @Override\n  public String readContentsAsString() {\n    return new String(readContents(), UTF_8);\n  }\n\n  @Override\n  public String getPath() {\n    return path;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/files/FileSourceBlobStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store.files;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.InputStream;\nimport java.util.Optional;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class FileSourceBlobStore implements BlobStore, PathBased {\n\n  private final FileSource fileSource;\n\n  FileSourceBlobStore(String root) {\n    this.fileSource = new SingleRootFileSource(root);\n  }\n\n  public FileSourceBlobStore(FileSource fileSource) {\n    this.fileSource = fileSource;\n  }\n\n  @Override\n  public Optional<InputStream> getStream(String key) {\n    try {\n      return Optional.of(fileSource.getBinaryFileNamed(key).getStream());\n    } catch (Exception exception) {\n      if (!(exception instanceof FileNotFoundException)) {\n        notifier()\n            .error(\"Error when working with FileSource:\\n\" + Json.write(exception.getMessage()));\n        return Optional.of(throwUnchecked(exception, InputStream.class));\n      } else {\n        return Optional.empty();\n      }\n    }\n  }\n\n  @Override\n  public InputStreamSource getStreamSource(String key) {\n    return StreamSources.forBlobStoreItem(this, key);\n  }\n\n  @Override\n  public Stream<String> getAllKeys() {\n    final String rootPath = new File(fileSource.getUri().getSchemeSpecificPart()).getPath();\n    return fileSource.listFilesRecursively().stream()\n        .map(TextFile::getPath)\n        .map(path -> path.substring(rootPath.length() + 1));\n  }\n\n  @Override\n  public Optional<byte[]> get(String key) {\n    try {\n      return Optional.of(fileSource.getBinaryFileNamed(key).readContents());\n    } catch (Exception exception) {\n      if (!(exception instanceof FileNotFoundException)) {\n        notifier()\n            .error(\"Error when working with FileSource:\\n\" + Json.write(exception.getMessage()));\n        return Optional.of(throwUnchecked(exception, byte[].class));\n      } else {\n        return Optional.empty();\n      }\n    }\n  }\n\n  @Override\n  public void put(String key, byte[] content) {\n    fileSource.writeBinaryFile(key, content);\n  }\n\n  @Override\n  public void remove(String key) {\n    fileSource.deleteFile(key);\n  }\n\n  @Override\n  public void clear() {\n    fileSource.listFilesRecursively().forEach(file -> fileSource.deleteFile(file.getPath()));\n  }\n\n  public FileSource getFileSource() {\n    return fileSource;\n  }\n\n  @Override\n  public String getPath() {\n    return fileSource.getPath();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/files/FileSourceJsonObjectStore.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store.files;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.uncheck;\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.store.ObjectStore;\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.util.Optional;\nimport java.util.function.Function;\nimport java.util.stream.Stream;\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic class FileSourceJsonObjectStore implements ObjectStore, PathBased {\n\n  private final FileSource fileSource;\n  private final KeyLocks keyLocks = new KeyLocks();\n\n  public FileSourceJsonObjectStore(String root) {\n    this.fileSource = new SingleRootFileSource(root);\n  }\n\n  public FileSourceJsonObjectStore(FileSource fileSource) {\n    this.fileSource = fileSource;\n  }\n\n  @Override\n  public Stream<String> getAllKeys() {\n    final String rootPath = new File(fileSource.getUri().getSchemeSpecificPart()).getPath();\n    return fileSource.listFilesRecursively().stream()\n        .map(TextFile::getPath)\n        .map(path -> path.substring(rootPath.length() + 1));\n  }\n\n  @Override\n  public Optional<Object> get(String key) {\n    return get(key, Object.class);\n  }\n\n  @Override\n  public <T> Optional<T> get(String key, Class<T> type) {\n    return getBytes(key).map(bytes -> uncheck(() -> Json.read(bytes, type), type));\n  }\n\n  @Override\n  @SuppressWarnings(\"unchecked\")\n  public <T> T compute(String key, Function<T, T> valueFunction) {\n    return keyLocks.withLock(\n        key,\n        () -> {\n          final T newValue =\n              get(key)\n                  .map(value -> valueFunction.apply((T) value))\n                  .orElseGet(() -> valueFunction.apply(null));\n          put(key, newValue);\n          return newValue;\n        });\n  }\n\n  private Optional<byte[]> getBytes(String key) {\n    try {\n      return Optional.of(fileSource.getBinaryFileNamed(createFileName(key)).readContents());\n    } catch (Exception exception) {\n      if (!(exception instanceof FileNotFoundException)) {\n        notifier()\n            .error(\"Error when working with FileSource:\\n\" + Json.write(exception.getMessage()));\n        return Optional.of(throwUnchecked(exception, byte[].class));\n      } else {\n        return Optional.empty();\n      }\n    }\n  }\n\n  @Override\n  public void put(String key, Object content) {\n    final String json = Json.write(content);\n    final String fileName = createFileName(key);\n    fileSource.writeBinaryFile(fileName, Strings.bytesFromString(json));\n  }\n\n  @Override\n  public void remove(String key) {\n    fileSource.deleteFile(createFileName(key));\n  }\n\n  @Override\n  public void clear() {\n    fileSource.listFilesRecursively().forEach(file -> fileSource.deleteFile(file.getPath()));\n  }\n\n  public FileSource getFileSource() {\n    return fileSource;\n  }\n\n  @Override\n  public String getPath() {\n    return fileSource.getPath();\n  }\n\n  private static String createFileName(String key) {\n    return key + \".json\";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/store/files/PathBased.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.store.files;\n\nimport org.wiremock.annotations.Beta;\n\n@Beta(justification = \"Externalized State API: https://github.com/wiremock/wiremock/issues/2144\")\npublic interface PathBased {\n\n  String getPath();\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/AbstractScenarios.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static java.util.stream.Collectors.toList;\n\nimport com.github.tomakehurst.wiremock.admin.NotFoundException;\nimport com.github.tomakehurst.wiremock.store.ScenariosStore;\nimport java.util.List;\n\npublic abstract class AbstractScenarios implements Scenarios {\n\n  private final ScenariosStore store;\n\n  public AbstractScenarios(ScenariosStore store) {\n    this.store = store;\n  }\n\n  @Override\n  public Scenario getByName(String name) {\n    return store.get(name).orElse(null);\n  }\n\n  @Override\n  public List<Scenario> getAll() {\n    return store.getAll().collect(toList());\n  }\n\n  @Override\n  public void onStubMappingAdded(StubMapping mapping) {\n    if (mapping.isInScenario()) {\n      String scenarioName = mapping.getScenarioName();\n      Scenario scenario =\n          getFirstNonNull(\n                  store.get(scenarioName).orElse(null), Scenario.inStartedState(scenarioName))\n              .withStubMapping(mapping);\n      store.put(scenarioName, scenario);\n    }\n  }\n\n  @Override\n  public void onStubMappingUpdated(StubMapping oldMapping, StubMapping newMapping) {\n    if (oldMapping.isInScenario()\n        && !oldMapping.getScenarioName().equals(newMapping.getScenarioName())) {\n      Scenario scenarioForOldMapping =\n          store\n              .get(oldMapping.getScenarioName())\n              .map(scenario -> scenario.withoutStubMapping(oldMapping))\n              .orElseThrow(IllegalStateException::new);\n\n      if (scenarioForOldMapping.getMappings().isEmpty()) {\n        store.remove(scenarioForOldMapping.getId());\n      } else {\n        store.put(oldMapping.getScenarioName(), scenarioForOldMapping);\n      }\n    }\n\n    if (newMapping.isInScenario()) {\n      String scenarioName = newMapping.getScenarioName();\n      Scenario scenario =\n          getFirstNonNull(\n                  store.get(scenarioName).orElse(null), Scenario.inStartedState(scenarioName))\n              .withStubMapping(newMapping);\n      store.put(scenarioName, scenario);\n    }\n  }\n\n  @Override\n  public void onStubMappingRemoved(StubMapping mapping) {\n    if (mapping.isInScenario()) {\n      final String scenarioName = mapping.getScenarioName();\n      Scenario scenario =\n          store\n              .get(scenarioName)\n              .orElseThrow(IllegalStateException::new)\n              .withoutStubMapping(mapping);\n\n      if (scenario.getMappings().isEmpty()) {\n        store.remove(scenarioName);\n      } else {\n        store.put(scenarioName, scenario);\n      }\n    }\n  }\n\n  @Override\n  public void onStubServed(StubMapping mapping) {\n    if (mapping.isInScenario()) {\n      final String scenarioName = mapping.getScenarioName();\n      Scenario scenario = store.get(scenarioName).orElseThrow(IllegalStateException::new);\n      if (mapping.modifiesScenarioState()\n          && (mapping.getRequiredScenarioState() == null\n              || scenario.getState().equals(mapping.getRequiredScenarioState()))) {\n        Scenario newScenario = scenario.setState(mapping.getNewScenarioState());\n        store.put(scenarioName, newScenario);\n      }\n    }\n  }\n\n  @Override\n  public void reset() {\n    store.getAll().map(Scenario::reset).forEach(scenario -> store.put(scenario.getId(), scenario));\n  }\n\n  @Override\n  public void resetSingle(String name) {\n    setSingleScenarioState(name, Scenario::reset);\n  }\n\n  @Override\n  public void setSingle(String name, String state) {\n    setSingleScenarioState(name, scenario -> scenario.setState(state));\n  }\n\n  private void setSingleScenarioState(\n      String name, java.util.function.Function<Scenario, Scenario> fn) {\n    Scenario scenario =\n        store\n            .get(name)\n            .orElseThrow(() -> new NotFoundException(\"Scenario \" + name + \" does not exist\"));\n\n    store.put(name, fn.apply(scenario));\n  }\n\n  @Override\n  public void clear() {\n    store.clear();\n  }\n\n  @Override\n  public boolean mappingMatchesScenarioState(StubMapping mapping) {\n    String currentScenarioState = getByName(mapping.getScenarioName()).getState();\n    return mapping.getRequiredScenarioState().equals(currentScenarioState);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/AbstractStubMappings.java",
    "content": "/*\n * Copyright (C) 2022-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static com.github.tomakehurst.wiremock.common.Pair.pair;\nimport static com.github.tomakehurst.wiremock.extension.ServeEventListener.RequestPhase.AFTER_MATCH;\nimport static com.github.tomakehurst.wiremock.extension.ServeEventListenerUtils.triggerListeners;\nimport static com.github.tomakehurst.wiremock.http.ResponseDefinition.copyOf;\nimport static java.util.stream.Collectors.toList;\n\nimport com.github.tomakehurst.wiremock.admin.NotFoundException;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.Pair;\nimport com.github.tomakehurst.wiremock.extension.*;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener.AlteredStubMapping;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener.StubMappingToAlter;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener.StubMappingToCreate;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener.StubMappingToEdit;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener.StubMappingToRemove;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport com.github.tomakehurst.wiremock.store.StubMappingStore;\nimport com.github.tomakehurst.wiremock.store.files.BlobStoreFileSource;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.util.*;\nimport java.util.stream.Stream;\nimport org.jspecify.annotations.NullMarked;\n\npublic abstract class AbstractStubMappings implements StubMappings {\n\n  protected final StubMappingStore store;\n  protected final Scenarios scenarios;\n  protected final Map<String, RequestMatcherExtension> customMatchers;\n  protected final Map<String, ResponseDefinitionTransformer> transformers;\n  protected final Map<String, ResponseDefinitionTransformerV2> v2transformers;\n  protected final FileSource filesFileSource;\n  protected final List<StubLifecycleListener> stubLifecycleListeners;\n  protected final Map<String, ServeEventListener> serveEventListeners;\n\n  public AbstractStubMappings(\n      StubMappingStore store,\n      Scenarios scenarios,\n      Map<String, RequestMatcherExtension> customMatchers,\n      Map<String, ResponseDefinitionTransformer> transformers,\n      Map<String, ResponseDefinitionTransformerV2> v2transformers,\n      BlobStore filesBlobStore,\n      List<StubLifecycleListener> stubLifecycleListeners,\n      Map<String, ServeEventListener> serveEventListeners) {\n    this.store = store;\n    this.scenarios = scenarios;\n    this.customMatchers = customMatchers;\n    this.transformers = transformers;\n    this.v2transformers = v2transformers;\n    this.filesFileSource = new BlobStoreFileSource(filesBlobStore);\n    this.stubLifecycleListeners = stubLifecycleListeners;\n    this.serveEventListeners = serveEventListeners;\n  }\n\n  @Override\n  public ServeEvent serveFor(ServeEvent initialServeEvent) {\n    initialServeEvent = initialServeEvent.withIdDecoratedRequest();\n    final LoggedRequest request = initialServeEvent.getRequest();\n\n    final List<SubEvent> subEvents = new LinkedList<>();\n\n    StubMapping matchingStub =\n        store\n            .findAllMatchingRequest(request, customMatchers, subEvents::add)\n            .filter(\n                stubMapping ->\n                    stubMapping.isIndependentOfScenarioState()\n                        || scenarios.mappingMatchesScenarioState(stubMapping))\n            .findFirst()\n            .orElse(StubMapping.NOT_CONFIGURED);\n\n    subEvents.forEach(initialServeEvent::appendSubEvent);\n\n    scenarios.onStubServed(matchingStub);\n\n    final ResponseDefinition initialResponseDefinition = matchingStub.getResponse();\n    ServeEvent serveEvent =\n        initialServeEvent\n            .withStubMapping(matchingStub)\n            .withResponseDefinition(initialResponseDefinition)\n            .withPathParamDecoratedRequest();\n\n    triggerListeners(serveEventListeners, AFTER_MATCH, serveEvent);\n\n    ResponseDefinition responseDefinition =\n        applyV1Transformations(\n            request, matchingStub.getResponse(), List.copyOf(transformers.values()));\n\n    serveEvent = serveEvent.withResponseDefinition(responseDefinition);\n\n    final Pair<ServeEvent, ResponseDefinition> transformed =\n        applyV2Transformations(serveEvent, List.copyOf(v2transformers.values()));\n    serveEvent = transformed.a;\n    responseDefinition = transformed.b;\n\n    return serveEvent.withResponseDefinition(copyOf(responseDefinition));\n  }\n\n  private ResponseDefinition applyV1Transformations(\n      Request request,\n      ResponseDefinition responseDefinition,\n      List<ResponseDefinitionTransformer> transformers) {\n\n    if (transformers.isEmpty()) {\n      return responseDefinition;\n    }\n\n    ResponseDefinitionTransformer transformer = transformers.get(0);\n    ResponseDefinition newResponseDef =\n        transformer.applyGlobally() || responseDefinition.hasTransformer(transformer)\n            ? transformer.transform(\n                request,\n                responseDefinition,\n                filesFileSource,\n                responseDefinition.getTransformerParameters())\n            : responseDefinition;\n\n    return applyV1Transformations(\n        request, newResponseDef, transformers.subList(1, transformers.size()));\n  }\n\n  private Pair<ServeEvent, ResponseDefinition> applyV2Transformations(\n      ServeEvent serveEvent, List<ResponseDefinitionTransformerV2> transformers) {\n\n    final ResponseDefinition responseDefinition = serveEvent.getResponseDefinition();\n\n    if (transformers.isEmpty()) {\n      return pair(serveEvent, responseDefinition);\n    }\n\n    ResponseDefinitionTransformerV2 transformer = transformers.get(0);\n    ResponseDefinition newResponseDef =\n        transformer.applyGlobally() || responseDefinition.hasTransformer(transformer)\n            ? transformer.transform(serveEvent)\n            : responseDefinition;\n\n    return applyV2Transformations(\n        serveEvent.withResponseDefinition(newResponseDef),\n        transformers.subList(1, transformers.size()));\n  }\n\n  @Override\n  public StubMapping addMapping(StubMapping mapping) {\n    if (store.get(mapping.getId()).isPresent()) {\n      String msg =\n          \"ID of the provided stub mapping '\"\n              + mapping.getId()\n              + \"' is already taken by another stub mapping\";\n      notifier().error(msg);\n      throw new InvalidInputException(\n          Errors.singleWithDetail(109, \"Duplicate stub mapping ID\", msg));\n    }\n\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      mapping = listener.beforeStubCreated(mapping);\n    }\n\n    mapping = store.add(mapping);\n    scenarios.onStubMappingAdded(mapping);\n\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      listener.afterStubCreated(mapping);\n    }\n\n    return mapping;\n  }\n\n  @Override\n  public StubMapping removeMapping(StubMapping mapping) {\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      listener.beforeStubRemoved(mapping);\n    }\n\n    store.remove(mapping.getId());\n    scenarios.onStubMappingRemoved(mapping);\n\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      listener.afterStubRemoved(mapping);\n    }\n\n    return mapping;\n  }\n\n  @Override\n  public StubMapping editMapping(StubMapping stubMapping) {\n    final Optional<StubMapping> optionalExistingMapping = store.get(stubMapping.getId());\n\n    if (optionalExistingMapping.isEmpty()) {\n      String msg = \"StubMapping with UUID: \" + stubMapping.getId() + \" not found\";\n      notifier().error(msg);\n      throw new NotFoundException(msg);\n    }\n\n    final StubMapping existingMapping = optionalExistingMapping.get();\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      stubMapping = listener.beforeStubEdited(existingMapping, stubMapping);\n    }\n\n    stubMapping =\n        stubMapping.transform(b -> b.setInsertionIndex(existingMapping.getInsertionIndex()));\n\n    store.replace(existingMapping, stubMapping);\n    scenarios.onStubMappingUpdated(existingMapping, stubMapping);\n\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      listener.afterStubEdited(existingMapping, stubMapping);\n    }\n\n    return stubMapping;\n  }\n\n  @Override\n  public List<StubMapping> updateMappings(List<StubMapping> toInsert, List<StubMapping> toRemove) {\n    List<StubMappingToAlter> toAlterStubs =\n        Stream.concat(\n                toInsert.stream()\n                    .<StubMappingToAlter>map(\n                        (stub) -> {\n                          Optional<StubMapping> existingStub = store.get(stub.getId());\n                          return existingStub.isPresent()\n                              ? new EditStubMapping(existingStub.get(), stub)\n                              : new CreateStubMapping(stub);\n                        }),\n                toRemove.stream().<StubMappingToAlter>map(RemoveStubMapping::new))\n            .toList();\n\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      listener.beforeStubsAltered(toAlterStubs);\n    }\n\n    List<StubMapping> result = new ArrayList<>(toInsert.size());\n    for (StubMappingToAlter alter : toAlterStubs) {\n      if (alter instanceof StubMappingToCreate create) {\n        create.setStub(store.add(create.getStub()));\n        scenarios.onStubMappingAdded(create.getStub());\n        result.add(create.getStub());\n      } else if (alter instanceof StubMappingToEdit edit) {\n        edit.setNewStub(\n            edit.getNewStub()\n                .transform(b -> b.setInsertionIndex(edit.getOldStub().getInsertionIndex())));\n        store.replace(edit.getOldStub(), edit.getNewStub());\n        scenarios.onStubMappingUpdated(edit.getOldStub(), edit.getNewStub());\n        result.add(edit.getNewStub());\n      } else if (alter instanceof StubMappingToRemove remove) {\n        store.remove(remove.getStub().getId());\n        scenarios.onStubMappingRemoved(remove.getStub());\n      }\n    }\n\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      listener.afterStubsAltered(\n          toAlterStubs.stream().map(toAlter -> (AlteredStubMapping) toAlter).toList());\n    }\n\n    return result;\n  }\n\n  @Override\n  public void reset() {\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      listener.beforeStubsReset();\n    }\n\n    store.clear();\n    scenarios.clear();\n\n    for (StubLifecycleListener listener : stubLifecycleListeners) {\n      listener.afterStubsReset();\n    }\n  }\n\n  @Override\n  public void resetScenarios() {\n    scenarios.reset();\n  }\n\n  @Override\n  public List<StubMapping> getAll() {\n    return store.getAll().collect(toList());\n  }\n\n  @Override\n  public Optional<StubMapping> get(final UUID id) {\n    return store.get(id);\n  }\n\n  @Override\n  public List<Scenario> getAllScenarios() {\n    return scenarios.getAll();\n  }\n\n  @Override\n  public List<StubMapping> findByMetadata(final StringValuePattern pattern) {\n    return store\n        .getAll()\n        .filter(\n            stubMapping -> {\n              String metadataJson = Json.write(stubMapping.getMetadata());\n              return pattern.match(metadataJson).isExactMatch();\n            })\n        .collect(toList());\n  }\n\n  @NullMarked\n  public static final class CreateStubMapping implements StubMappingToCreate {\n    private StubMapping stub;\n\n    public CreateStubMapping(StubMapping stub) {\n      this.stub = stub;\n    }\n\n    @Override\n    public StubMapping getStub() {\n      return stub;\n    }\n\n    @Override\n    public void setStub(StubMapping stub) {\n      this.stub = stub;\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      if (!(o instanceof CreateStubMapping that)) return false;\n      return Objects.equals(stub, that.stub);\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hashCode(stub);\n    }\n\n    @Override\n    public String toString() {\n      return \"CreateStubMapping{\" + \"stub=\" + stub + '}';\n    }\n  }\n\n  @NullMarked\n  public static final class EditStubMapping implements StubMappingToEdit {\n    private final StubMapping oldStub;\n    private StubMapping newStub;\n\n    public EditStubMapping(StubMapping oldStub, StubMapping newStub) {\n      this.oldStub = oldStub;\n      this.newStub = newStub;\n    }\n\n    @Override\n    public StubMapping getOldStub() {\n      return oldStub;\n    }\n\n    @Override\n    public StubMapping getNewStub() {\n      return newStub;\n    }\n\n    @Override\n    public void setNewStub(StubMapping newStub) {\n      this.newStub = newStub;\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      if (!(o instanceof EditStubMapping that)) return false;\n      return Objects.equals(oldStub, that.oldStub) && Objects.equals(newStub, that.newStub);\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hash(oldStub, newStub);\n    }\n\n    @Override\n    public String toString() {\n      return \"EditStubMapping{\" + \"oldStub=\" + oldStub + \", newStub=\" + newStub + '}';\n    }\n  }\n\n  @SuppressWarnings(\"ClassCanBeRecord\")\n  @NullMarked\n  public static final class RemoveStubMapping implements StubMappingToRemove {\n    private final StubMapping stub;\n\n    public RemoveStubMapping(StubMapping stub) {\n      this.stub = stub;\n    }\n\n    @Override\n    public StubMapping getStub() {\n      return stub;\n    }\n\n    @Override\n    public boolean equals(Object o) {\n      if (!(o instanceof RemoveStubMapping that)) return false;\n      return Objects.equals(stub, that.stub);\n    }\n\n    @Override\n    public int hashCode() {\n      return Objects.hashCode(stub);\n    }\n\n    @Override\n    public String toString() {\n      return \"RemoveStubMapping{\" + \"stub=\" + stub + '}';\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/InMemoryScenarios.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.github.tomakehurst.wiremock.store.InMemoryScenariosStore;\nimport com.github.tomakehurst.wiremock.store.ScenariosStore;\n\npublic class InMemoryScenarios extends AbstractScenarios {\n\n  public InMemoryScenarios(ScenariosStore store) {\n    super(store);\n  }\n\n  public InMemoryScenarios() {\n    this(new InMemoryScenariosStore());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/InMemoryStubMappings.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.github.tomakehurst.wiremock.common.SingleRootFileSource;\nimport com.github.tomakehurst.wiremock.store.InMemoryStubMappingStore;\nimport com.github.tomakehurst.wiremock.store.files.FileSourceBlobStore;\nimport java.util.Collections;\n\npublic class InMemoryStubMappings extends StoreBackedStubMappings {\n\n  public InMemoryStubMappings() {\n    super(\n        new InMemoryStubMappingStore(),\n        new InMemoryScenarios(),\n        Collections.emptyMap(),\n        Collections.emptyMap(),\n        Collections.emptyMap(),\n        new FileSourceBlobStore(new SingleRootFileSource(\".\")),\n        Collections.emptyList(),\n        Collections.emptyMap());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/Scenario.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static java.util.stream.Collectors.toSet;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.Errors;\nimport com.github.tomakehurst.wiremock.common.InvalidInputException;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport java.util.*;\nimport java.util.function.Predicate;\nimport java.util.stream.Collectors;\n\npublic class Scenario {\n\n  public static final String STARTED = \"Started\";\n\n  private final String id;\n  private final String state;\n  private final Set<StubMapping> stubMappings;\n\n  @JsonCreator\n  public Scenario(\n      @JsonProperty(\"id\") String id,\n      @JsonProperty(\"name\") String ignored,\n      @JsonProperty(\"state\") String currentState,\n      @JsonProperty(\"possibleStates\") Set<String> ignored2,\n      @JsonProperty(\"mappings\") Set<StubMapping> stubMappings) {\n    this.id = id;\n    this.state = currentState;\n    this.stubMappings = stubMappings;\n  }\n\n  private Scenario(String id, String state, Set<StubMapping> stubMappings) {\n    this(id, null, state, null, stubMappings);\n  }\n\n  public static Scenario inStartedState(String name) {\n    return new Scenario(name, STARTED, Collections.emptySet());\n  }\n\n  public String getId() {\n    return id;\n  }\n\n  // For JSON backwards compatibility\n  public String getName() {\n    return id;\n  }\n\n  public String getState() {\n    return state;\n  }\n\n  public Set<String> getPossibleStates() {\n    List<String> requiredStates =\n        stubMappings.stream()\n            .map(StubMapping::getRequiredScenarioState)\n            .collect(Collectors.toList());\n\n    requiredStates.addAll(\n        stubMappings.stream().map(StubMapping::getNewScenarioState).collect(Collectors.toList()));\n\n    return requiredStates.stream().filter(Objects::nonNull).collect(Collectors.toSet());\n  }\n\n  public Set<StubMapping> getMappings() {\n    return stubMappings;\n  }\n\n  Scenario setState(String newState) {\n    if (!getPossibleStates().contains(newState)) {\n      throw new InvalidInputException(\n          Errors.single(11, \"Scenario \" + id + \" does not support state \" + newState));\n    }\n\n    return new Scenario(id, newState, stubMappings);\n  }\n\n  Scenario reset() {\n    return new Scenario(id, STARTED, stubMappings);\n  }\n\n  Scenario withStubMapping(StubMapping stubMapping) {\n    Set<StubMapping> newMappings = new LinkedHashSet<>(stubMappings);\n    newMappings.add(stubMapping);\n\n    return new Scenario(id, state, newMappings);\n  }\n\n  Scenario withoutStubMapping(StubMapping stubMapping) {\n    Set<StubMapping> newMappings =\n        stubMappings.stream()\n            .filter(stub -> !stub.getId().equals(stubMapping.getId()))\n            .collect(toSet());\n    return new Scenario(id, state, newMappings);\n  }\n\n  @Override\n  public String toString() {\n    return Json.write(this);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    Scenario scenario = (Scenario) o;\n    return Objects.equals(getId(), scenario.getId())\n        && Objects.equals(getState(), scenario.getState())\n        && Objects.equals(getMappings(), scenario.getMappings());\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(getId(), getState(), getMappings());\n  }\n\n  public static Predicate<Scenario> withName(final String name) {\n    return input -> input.getId().equals(name);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/Scenarios.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport java.util.List;\n\npublic interface Scenarios {\n  Scenario getByName(String name);\n\n  List<Scenario> getAll();\n\n  void onStubMappingAdded(StubMapping mapping);\n\n  void onStubMappingUpdated(StubMapping oldMapping, StubMapping newMapping);\n\n  void onStubMappingRemoved(StubMapping mapping);\n\n  void onStubServed(StubMapping mapping);\n\n  void reset();\n\n  void resetSingle(String name);\n\n  void setSingle(String name, String state);\n\n  void clear();\n\n  boolean mappingMatchesScenarioState(StubMapping mapping);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/ServeEvent.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.stubbing.SubEvent.NON_MATCH_TYPE;\nimport static java.util.concurrent.TimeUnit.NANOSECONDS;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.DataTruncationSettings;\nimport com.github.tomakehurst.wiremock.common.Timing;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.PostServeActionDefinition;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListenerDefinition;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.google.common.base.Stopwatch;\nimport java.util.*;\nimport java.util.concurrent.ConcurrentLinkedQueue;\n\npublic class ServeEvent {\n\n  public static final String ORIGINAL_SERVE_EVENT_KEY = \"wiremock.ORIGINAL_SERVE_EVENT\";\n\n  private final UUID id;\n  private final LoggedRequest request;\n  private final StubMapping stubMapping;\n  private final ResponseDefinition responseDefinition;\n  private final LoggedResponse response;\n  private final Timing timing;\n\n  private final ConcurrentLinkedQueue<SubEvent> subEvents;\n\n  private final Stopwatch stopwatch;\n\n  protected ServeEvent(\n      UUID id,\n      LoggedRequest request,\n      StubMapping stubMapping,\n      ResponseDefinition responseDefinition,\n      LoggedResponse response,\n      Timing timing,\n      ConcurrentLinkedQueue<SubEvent> subEvents,\n      Stopwatch stopwatch) {\n    this.id = id;\n    this.request = request;\n    this.stubMapping = stubMapping;\n    this.responseDefinition = responseDefinition;\n    this.response = response;\n    this.timing = timing;\n    this.subEvents = subEvents;\n    this.stopwatch = stopwatch;\n  }\n\n  @JsonCreator\n  public ServeEvent(\n      @JsonProperty(\"id\") UUID id,\n      @JsonProperty(\"request\") LoggedRequest request,\n      @JsonProperty(\"mapping\") StubMapping stubMapping,\n      @JsonProperty(\"responseDefinition\") ResponseDefinition responseDefinition,\n      @JsonProperty(\"response\") LoggedResponse response,\n      @JsonProperty(\"wasMatched\") boolean ignoredReadOnly,\n      @JsonProperty(\"timing\") Timing timing,\n      @JsonProperty(\"subEvents\") Queue<SubEvent> subEvents) {\n    this(\n        id,\n        request,\n        stubMapping,\n        responseDefinition,\n        response,\n        timing != null ? timing : Timing.create(),\n        subEvents != null ? new ConcurrentLinkedQueue<>(subEvents) : new ConcurrentLinkedQueue<>(),\n        Stopwatch.createStarted());\n  }\n\n  protected ServeEvent(\n      LoggedRequest request, StubMapping stubMapping, ResponseDefinition responseDefinition) {\n    this(UUID.randomUUID(), request, stubMapping, responseDefinition, null, false, null, null);\n  }\n\n  public static ServeEvent of(Request request) {\n    return new ServeEvent(LoggedRequest.createFrom(request), null, null);\n  }\n\n  public static ServeEvent ofUnmatched(\n      LoggedRequest request, ResponseDefinition responseDefinition) {\n    return new ServeEvent(request, null, responseDefinition);\n  }\n\n  public ServeEvent replaceRequest(Request request) {\n    return new ServeEvent(\n        id,\n        LoggedRequest.createFrom(request),\n        stubMapping,\n        responseDefinition,\n        response,\n        timing,\n        subEvents,\n        stopwatch);\n  }\n\n  public ServeEvent withStubMapping(StubMapping stubMapping) {\n    return new ServeEvent(\n        id, request, stubMapping, responseDefinition, response, false, timing, subEvents);\n  }\n\n  public ServeEvent withResponseDefinition(ResponseDefinition responseDefinition) {\n    return new ServeEvent(\n        id, request, stubMapping, responseDefinition, response, false, timing, subEvents);\n  }\n\n  public ServeEvent withPathParamDecoratedRequest() {\n    final LoggedRequest newLoggedRequest =\n        LoggedRequest.createFrom(\n            RequestPathParamsDecorator.decorate(request, stubMapping.getRequest()));\n    return new ServeEvent(\n        id, newLoggedRequest, stubMapping, responseDefinition, response, false, timing, subEvents);\n  }\n\n  public ServeEvent withIdDecoratedRequest() {\n    final LoggedRequest newLoggedRequest =\n        LoggedRequest.createFrom(new RequestIdDecorator(request, id));\n    return new ServeEvent(\n        id, newLoggedRequest, stubMapping, responseDefinition, response, false, timing, subEvents);\n  }\n\n  public ServeEvent complete(Response response, DataTruncationSettings dataTruncationSettings) {\n    timing.logProcessTime(stopwatch);\n    timing.setAddedTime((int) response.getInitialDelay());\n\n    return new ServeEvent(\n        id,\n        request,\n        stubMapping,\n        responseDefinition,\n        LoggedResponse.from(response, dataTruncationSettings.getMaxResponseBodySize()),\n        false,\n        timing,\n        subEvents);\n  }\n\n  public void beforeSend() {\n    stopwatch.reset();\n  }\n\n  public void afterSend() {\n    timing.logResponseSendTime(stopwatch);\n  }\n\n  @JsonIgnore\n  public boolean isNoExactMatch() {\n    return responseDefinition == null || !responseDefinition.wasConfigured();\n  }\n\n  public UUID getId() {\n    return id;\n  }\n\n  public LoggedRequest getRequest() {\n    return request;\n  }\n\n  public ResponseDefinition getResponseDefinition() {\n    return responseDefinition;\n  }\n\n  public boolean getWasMatched() {\n    return responseDefinition.wasConfigured();\n  }\n\n  public StubMapping getStubMapping() {\n    return stubMapping;\n  }\n\n  public LoggedResponse getResponse() {\n    return response;\n  }\n\n  public Timing getTiming() {\n    return timing;\n  }\n\n  public Queue<? extends SubEvent> getSubEvents() {\n    return subEvents;\n  }\n\n  public void appendSubEvent(String type, Object data) {\n    final long elapsedNanos = stopwatch.elapsed(NANOSECONDS);\n    appendSubEvent(new SubEvent(type, elapsedNanos, data));\n  }\n\n  public void appendSubEvent(SubEvent subEvent) {\n    if (hasNotAlreadyBeenAppended(subEvent)) {\n      subEvents.add(subEvent);\n    }\n  }\n\n  private boolean hasNotAlreadyBeenAppended(SubEvent subEvent) {\n    if (!subEvent.isStandardType()) {\n      return true;\n    }\n\n    return subEvents.stream().noneMatch(subEvent::isEquivalentStandardTypedEventTo);\n  }\n\n  @JsonIgnore\n  public Optional<SubEvent> getDiffSubEvent() {\n    return subEvents.stream()\n        .filter(subEvent -> subEvent.getType().equals(NON_MATCH_TYPE))\n        .findFirst();\n  }\n\n  @JsonIgnore\n  public List<PostServeActionDefinition> getPostServeActions() {\n    return stubMapping != null ? getStubMapping().getPostServeActions() : Collections.emptyList();\n  }\n\n  @JsonIgnore\n  public List<ServeEventListenerDefinition> getServeEventListeners() {\n    return stubMapping != null\n        ? getStubMapping().getServeEventListeners()\n        : Collections.emptyList();\n  }\n\n  @JsonIgnore\n  public Parameters getTransformerParameters() {\n    return stubMapping != null && stubMapping.getResponse() != null\n        ? stubMapping.getResponse().getTransformerParameters()\n        : Parameters.empty();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/StoreBackedStubMappings.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformer;\nimport com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformerV2;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListener;\nimport com.github.tomakehurst.wiremock.extension.StubLifecycleListener;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.store.BlobStore;\nimport com.github.tomakehurst.wiremock.store.StubMappingStore;\nimport java.util.List;\nimport java.util.Map;\n\npublic class StoreBackedStubMappings extends AbstractStubMappings {\n\n  public StoreBackedStubMappings(\n      StubMappingStore store,\n      Scenarios scenarios,\n      Map<String, RequestMatcherExtension> customMatchers,\n      Map<String, ResponseDefinitionTransformer> transformers,\n      Map<String, ResponseDefinitionTransformerV2> v2transformers,\n      BlobStore filesBlobStore,\n      List<StubLifecycleListener> stubLifecycleListeners,\n      Map<String, ServeEventListener> serveEventListeners) {\n    super(\n        store,\n        scenarios,\n        customMatchers,\n        transformers,\n        v2transformers,\n        filesBlobStore,\n        stubLifecycleListeners,\n        serveEventListeners);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/StubImport.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.List;\n\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class StubImport {\n\n  private final List<StubMapping> mappings;\n  private final Options importOptions;\n\n  public StubImport(\n      @JsonProperty(\"mappings\") List<StubMapping> mappings,\n      @JsonProperty(\"importOptions\") Options importOptions) {\n    this.mappings = mappings;\n    this.importOptions = importOptions;\n  }\n\n  public List<StubMapping> getMappings() {\n    return mappings;\n  }\n\n  public Options getImportOptions() {\n    return importOptions;\n  }\n\n  public static StubImportBuilder stubImport() {\n    return new StubImportBuilder();\n  }\n\n  public static class Options {\n\n    public enum DuplicatePolicy {\n      OVERWRITE,\n      IGNORE\n    }\n\n    private final DuplicatePolicy duplicatePolicy;\n    private final Boolean deleteAllNotInImport;\n\n    public Options(\n        @JsonProperty(\"duplicatePolicy\") DuplicatePolicy duplicatePolicy,\n        @JsonProperty(\"deleteAllNotInImport\") Boolean deleteAllNotInImport) {\n      this.duplicatePolicy = duplicatePolicy;\n      this.deleteAllNotInImport = deleteAllNotInImport;\n    }\n\n    public DuplicatePolicy getDuplicatePolicy() {\n      return duplicatePolicy;\n    }\n\n    public Boolean getDeleteAllNotInImport() {\n      return deleteAllNotInImport;\n    }\n\n    public static final Options DEFAULTS = new Options(DuplicatePolicy.OVERWRITE, false);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/StubImportBuilder.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.github.tomakehurst.wiremock.client.MappingBuilder;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class StubImportBuilder {\n\n  private List<StubMapping> mappings = new ArrayList<>();\n  private StubImport.Options.DuplicatePolicy duplicatePolicy =\n      StubImport.Options.DuplicatePolicy.OVERWRITE;\n  private Boolean deleteAllNotInImport = false;\n\n  StubImportBuilder() {}\n\n  public StubImportBuilder stub(MappingBuilder stubMappingBuilder) {\n    mappings.add(stubMappingBuilder.build());\n    return this;\n  }\n\n  public StubImportBuilder stub(StubMapping stubMapping) {\n    mappings.add(stubMapping);\n    return this;\n  }\n\n  public StubImportBuilder ignoreExisting() {\n    duplicatePolicy = StubImport.Options.DuplicatePolicy.IGNORE;\n    return this;\n  }\n\n  public StubImportBuilder overwriteExisting() {\n    duplicatePolicy = StubImport.Options.DuplicatePolicy.OVERWRITE;\n    return this;\n  }\n\n  public StubImportBuilder deleteAllExistingStubsNotInImport() {\n    deleteAllNotInImport = true;\n    return this;\n  }\n\n  public StubImportBuilder doNotDeleteExistingStubs() {\n    deleteAllNotInImport = false;\n    return this;\n  }\n\n  public StubImport build() {\n    return new StubImport(mappings, new StubImport.Options(duplicatePolicy, deleteAllNotInImport));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/StubMapping.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.fasterxml.jackson.annotation.*;\nimport com.fasterxml.jackson.annotation.JsonInclude.Include;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport com.github.tomakehurst.wiremock.common.Prioritisable;\nimport com.github.tomakehurst.wiremock.extension.PostServeActionDefinition;\nimport com.github.tomakehurst.wiremock.extension.PostServeActionDefinitionListDeserializer;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListenerDefinition;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.UUID;\nimport java.util.function.Consumer;\nimport org.jspecify.annotations.NonNull;\n\n@JsonPropertyOrder({\"id\", \"name\", \"request\", \"newRequest\", \"response\"})\n@JsonIgnoreProperties({\n  \"$schema\", \"uuid\"\n}) // $schema allows this to be added as a hint to IDEs like VS Code\n@JsonInclude(Include.NON_NULL)\n@JsonDeserialize() // stops infinite recursion when deserializing as StubMappingOrMappings\npublic final class StubMapping implements StubMappingOrMappings, Prioritisable {\n\n  public static final StubMapping NOT_CONFIGURED =\n      StubMapping.builder().setResponse(ResponseDefinition.notConfigured()).build();\n  private final UUID id;\n  private final String name;\n  private final Boolean persistent;\n  private final RequestPattern request;\n  private final ResponseDefinition response;\n  private final Integer priority;\n  private final String scenarioName;\n  private final String requiredScenarioState;\n  private final String newScenarioState;\n  @NonNull private final List<PostServeActionDefinition> postServeActions;\n  @NonNull private final List<ServeEventListenerDefinition> serveEventListeners;\n  @NonNull private final Metadata metadata;\n  private final long insertionIndex;\n\n  @JsonCreator\n  public StubMapping(\n      @JsonProperty(\"id\") UUID id,\n      @JsonProperty(\"name\") String name,\n      @JsonProperty(\"persistent\") Boolean persistent,\n      @JsonProperty(\"request\") RequestPattern request,\n      @JsonProperty(\"response\") ResponseDefinition response,\n      @JsonProperty(\"priority\") Integer priority,\n      @JsonProperty(\"scenarioName\") String scenarioName,\n      @JsonProperty(\"requiredScenarioState\") String requiredScenarioState,\n      @JsonProperty(\"newScenarioState\") String newScenarioState,\n      @JsonProperty(\"postServeActions\")\n          @JsonDeserialize(using = PostServeActionDefinitionListDeserializer.class)\n          List<PostServeActionDefinition> postServeActions,\n      @JsonProperty(\"serveEventListeners\") List<ServeEventListenerDefinition> serveEventListeners,\n      @JsonProperty(\"metadata\") Metadata metadata,\n      @JsonProperty(\"insertionIndex\") @JsonView(Json.PrivateView.class) long insertionIndex) {\n    this.id = id != null ? id : UUID.randomUUID();\n    this.name = name;\n    this.persistent = persistent;\n    this.request = getFirstNonNull(request, RequestPattern.ANYTHING);\n    this.response = getFirstNonNull(response, ResponseDefinition.ok());\n    this.priority = priority;\n    this.scenarioName = scenarioName;\n    this.requiredScenarioState = requiredScenarioState;\n    this.newScenarioState = newScenarioState;\n    this.postServeActions = postServeActions != null ? List.copyOf(postServeActions) : List.of();\n    this.serveEventListeners =\n        serveEventListeners != null ? List.copyOf(serveEventListeners) : List.of();\n    this.metadata = metadata != null ? metadata : new Metadata();\n    this.insertionIndex = insertionIndex;\n  }\n\n  public static Builder builder() {\n    return new Builder();\n  }\n\n  public static StubMapping create(Consumer<Builder> transformer) {\n    final Builder builder = builder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public StubMapping transform(Consumer<Builder> transformer) {\n    final Builder builder = toBuilder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public Builder toBuilder() {\n    return new Builder(this);\n  }\n\n  public UUID getId() {\n    return id;\n  }\n\n  public String getName() {\n    return name;\n  }\n\n  public Boolean isPersistent() {\n    return persistent;\n  }\n\n  public RequestPattern getRequest() {\n    return request;\n  }\n\n  public ResponseDefinition getResponse() {\n    return response;\n  }\n\n  public Integer getPriority() {\n    return priority;\n  }\n\n  public String getScenarioName() {\n    return scenarioName;\n  }\n\n  public String getRequiredScenarioState() {\n    return requiredScenarioState;\n  }\n\n  public String getNewScenarioState() {\n    return newScenarioState;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public List<PostServeActionDefinition> getPostServeActions() {\n    return postServeActions;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public List<ServeEventListenerDefinition> getServeEventListeners() {\n    return serveEventListeners;\n  }\n\n  @JsonInclude(Include.NON_EMPTY)\n  @NonNull\n  public Metadata getMetadata() {\n    return metadata;\n  }\n\n  public long getInsertionIndex() {\n    return insertionIndex;\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  @Override\n  public <T extends Prioritisable> T withInsertionIndex(long newInsertionIndex) {\n    return (T) transform(builder -> builder.setInsertionIndex(newInsertionIndex));\n  }\n\n  @JsonIgnore\n  public boolean isInScenario() {\n    return scenarioName != null;\n  }\n\n  @JsonIgnore\n  public boolean modifiesScenarioState() {\n    return newScenarioState != null;\n  }\n\n  @JsonIgnore\n  public boolean isIndependentOfScenarioState() {\n    return !isInScenario() || requiredScenarioState == null;\n  }\n\n  public int comparePriorityWith(StubMapping otherMapping) {\n    int thisPriority = priority != null ? priority : DEFAULT_PRIORITY;\n    int otherPriority = otherMapping.priority != null ? otherMapping.priority : DEFAULT_PRIORITY;\n    return thisPriority - otherPriority;\n  }\n\n  public boolean shouldBePersisted() {\n    return persistent != null && persistent;\n  }\n\n  @Override\n  public List<StubMapping> getMappingOrMappings() {\n    return List.of(this);\n  }\n\n  @Override\n  public boolean isMulti() {\n    return false;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == null || getClass() != o.getClass()) return false;\n    StubMapping that = (StubMapping) o;\n    return Objects.equals(id, that.id)\n        && Objects.equals(priority, that.priority)\n        && Objects.equals(metadata, that.metadata)\n        && Objects.equals(scenarioName, that.scenarioName)\n        && Objects.equals(request, that.request)\n        && Objects.equals(newScenarioState, that.newScenarioState)\n        && Objects.equals(response, that.response)\n        && Objects.equals(requiredScenarioState, that.requiredScenarioState)\n        && Objects.equals(postServeActions, that.postServeActions)\n        && Objects.equals(serveEventListeners, that.serveEventListeners);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(\n        id,\n        request,\n        response,\n        priority,\n        requiredScenarioState,\n        newScenarioState,\n        postServeActions,\n        serveEventListeners,\n        metadata);\n  }\n\n  @Override\n  public String toString() {\n    return Json.write(this);\n  }\n\n  public static class Builder {\n    private UUID id = UUID.randomUUID();\n    private String name;\n\n    private Boolean persistent;\n\n    private RequestPattern request;\n    private ResponseDefinition response;\n    private Integer priority;\n    private String scenarioName;\n    private String requiredScenarioState;\n    private String newScenarioState;\n\n    @NonNull private List<PostServeActionDefinition> postServeActions = new ArrayList<>();\n\n    @NonNull private List<ServeEventListenerDefinition> serveEventListeners = new ArrayList<>();\n\n    @NonNull private Metadata metadata = new Metadata();\n\n    private long insertionIndex;\n\n    public Builder() {}\n\n    public Builder(StubMapping existing) {\n      this.id = existing.id;\n      this.name = existing.name;\n      this.persistent = existing.persistent;\n      this.request = existing.request;\n      this.response = existing.response;\n      this.priority = existing.priority;\n      this.scenarioName = existing.scenarioName;\n      this.requiredScenarioState = existing.requiredScenarioState;\n      this.newScenarioState = existing.newScenarioState;\n      this.postServeActions.addAll(existing.postServeActions);\n      this.serveEventListeners.addAll(existing.serveEventListeners);\n      this.metadata = existing.metadata;\n      this.insertionIndex = existing.insertionIndex;\n    }\n\n    public StubMapping build() {\n      return new StubMapping(\n          id,\n          name,\n          persistent,\n          request,\n          response,\n          priority,\n          scenarioName,\n          requiredScenarioState,\n          newScenarioState,\n          postServeActions,\n          serveEventListeners,\n          metadata,\n          insertionIndex);\n    }\n\n    public UUID getId() {\n      return id;\n    }\n\n    public Builder setId(UUID id) {\n      this.id = id;\n      return this;\n    }\n\n    public String getName() {\n      return name;\n    }\n\n    public Builder setName(String name) {\n      this.name = name;\n      return this;\n    }\n\n    public Boolean getPersistent() {\n      return persistent;\n    }\n\n    public Builder setPersistent(Boolean persistent) {\n      this.persistent = persistent;\n      return this;\n    }\n\n    public RequestPattern getRequest() {\n      return request;\n    }\n\n    public Builder setRequest(RequestPattern request) {\n      this.request = request;\n      return this;\n    }\n\n    public Builder request(Consumer<RequestPattern.Builder> transformer) {\n      return setRequest(request.transform(transformer));\n    }\n\n    public ResponseDefinition getResponse() {\n      return response;\n    }\n\n    public Builder setResponse(ResponseDefinition response) {\n      this.response = response;\n      return this;\n    }\n\n    public Builder response(Consumer<ResponseDefinition.Builder> transformer) {\n      return setResponse(response.transform(transformer));\n    }\n\n    public Integer getPriority() {\n      return priority;\n    }\n\n    public Builder setPriority(Integer priority) {\n      this.priority = priority;\n      return this;\n    }\n\n    public String getScenarioName() {\n      return scenarioName;\n    }\n\n    public Builder setScenarioName(String scenarioName) {\n      this.scenarioName = scenarioName;\n      return this;\n    }\n\n    @SuppressWarnings(\"unused\")\n    public String getRequiredScenarioState() {\n      return requiredScenarioState;\n    }\n\n    public Builder setRequiredScenarioState(String requiredScenarioState) {\n      this.requiredScenarioState = requiredScenarioState;\n      return this;\n    }\n\n    @SuppressWarnings(\"unused\")\n    public String getNewScenarioState() {\n      return newScenarioState;\n    }\n\n    public Builder setNewScenarioState(String newScenarioState) {\n      this.newScenarioState = newScenarioState;\n      return this;\n    }\n\n    @NonNull\n    public List<PostServeActionDefinition> getPostServeActions() {\n      return postServeActions;\n    }\n\n    public Builder setPostServeActions(@NonNull List<PostServeActionDefinition> postServeActions) {\n      Objects.requireNonNull(postServeActions);\n      this.postServeActions = postServeActions;\n      return this;\n    }\n\n    @NonNull\n    public List<ServeEventListenerDefinition> getServeEventListeners() {\n      return serveEventListeners;\n    }\n\n    public Builder setServeEventListeners(\n        @NonNull List<ServeEventListenerDefinition> serveEventListeners) {\n      Objects.requireNonNull(serveEventListeners);\n      this.serveEventListeners = serveEventListeners;\n      return this;\n    }\n\n    @NonNull\n    public Metadata getMetadata() {\n      return metadata;\n    }\n\n    public Builder setMetadata(@NonNull Metadata metadata) {\n      Objects.requireNonNull(metadata);\n      this.metadata = metadata;\n      return this;\n    }\n\n    public Builder metadata(Consumer<Metadata.Builder> transformer) {\n      this.metadata = getFirstNonNull(metadata, new Metadata()).transform(transformer);\n      return this;\n    }\n\n    @SuppressWarnings(\"unused\")\n    public long getInsertionIndex() {\n      return insertionIndex;\n    }\n\n    @SuppressWarnings(\"UnusedReturnValue\")\n    public Builder setInsertionIndex(long insertionIndex) {\n      this.insertionIndex = insertionIndex;\n      return this;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/StubMappingCollection.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport java.util.List;\n\n@JsonIgnoreProperties({\"$schema\", \"meta\", \"uuid\"})\n@JsonDeserialize() // stops infinite recursion when deserializing as StubMappingOrMappings\npublic class StubMappingCollection implements StubMappingOrMappings {\n\n  private List<StubMapping> mappings;\n\n  @Override\n  public List<StubMapping> getMappingOrMappings() {\n    return getMappings();\n  }\n\n  @Override\n  public boolean isMulti() {\n    return true;\n  }\n\n  public List<StubMapping> getMappings() {\n    return mappings;\n  }\n\n  public void setMappings(List<StubMapping> mappings) {\n    this.mappings = mappings;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/StubMappingOrMappings.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;\nimport com.fasterxml.jackson.databind.deser.std.StdDeserializer;\nimport java.io.IOException;\nimport java.util.List;\n\n@JsonDeserialize(using = StubMappingOrMappingsJsonDeserializer.class)\npublic interface StubMappingOrMappings {\n\n  @JsonIgnore\n  List<StubMapping> getMappingOrMappings();\n\n  @JsonIgnore\n  boolean isMulti();\n}\n\nclass StubMappingOrMappingsJsonDeserializer extends StdDeserializer<StubMappingOrMappings> {\n\n  protected StubMappingOrMappingsJsonDeserializer() {\n    super(StubMappingOrMappings.class);\n  }\n\n  @Override\n  public StubMappingOrMappings deserialize(JsonParser parser, DeserializationContext ctxt)\n      throws IOException {\n    JsonNode rootNode = parser.readValueAsTree();\n    Class<? extends StubMappingOrMappings> clazz;\n    if (rootNode.has(\"mappings\")) {\n      clazz = StubMappingCollection.class;\n    } else {\n      clazz = StubMapping.class;\n    }\n    return ctxt.readTreeAsValue(rootNode, clazz);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/StubMappings.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\n\npublic interface StubMappings {\n\n  ServeEvent serveFor(ServeEvent request);\n\n  StubMapping addMapping(StubMapping mapping);\n\n  StubMapping removeMapping(StubMapping mapping);\n\n  StubMapping editMapping(StubMapping stubMapping);\n\n  List<StubMapping> updateMappings(List<StubMapping> toInsert, List<StubMapping> toRemove);\n\n  void reset();\n\n  void resetScenarios();\n\n  List<StubMapping> getAll();\n\n  Optional<StubMapping> get(UUID id);\n\n  List<Scenario> getAllScenarios();\n\n  List<StubMapping> findByMetadata(StringValuePattern pattern);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/stubbing/SubEvent.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.stubbing;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.Message;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\n\npublic class SubEvent {\n\n  public static final String NON_MATCH_TYPE = \"REQUEST_NOT_MATCHED\";\n  public static final String JSON_ERROR = \"JSON_ERROR\";\n  public static final String XML_ERROR = \"XML\";\n  public static final String INFO = \"INFO\";\n  public static final String WARNING = \"WARNING\";\n  public static final String ERROR = \"ERROR\";\n\n  private static final List<String> STANDARD_TYPES =\n      Arrays.asList(NON_MATCH_TYPE, JSON_ERROR, XML_ERROR, INFO, WARNING, ERROR);\n\n  private final String type;\n\n  private final Long timeOffsetNanos;\n\n  private final Map<String, Object> data;\n\n  public static SubEvent info(String message) {\n    return message(INFO, message);\n  }\n\n  public static SubEvent warning(String message) {\n    return message(WARNING, message);\n  }\n\n  public static SubEvent error(String message) {\n    return message(ERROR, message);\n  }\n\n  public static SubEvent message(String type, String message) {\n    return new SubEvent(type, null, new Message(message));\n  }\n\n  public SubEvent(String type, Object data) {\n    this(type, null, data);\n  }\n\n  public SubEvent(String type, Long timeOffsetMillis, Object data) {\n    this(type, timeOffsetMillis, Json.objectToMap(data));\n  }\n\n  public SubEvent(\n      @JsonProperty(\"type\") String type,\n      @JsonProperty(\"timeOffsetNanos\") Long timeOffsetNanos,\n      @JsonProperty(\"data\") Map<String, Object> data) {\n    this.type = type;\n    this.timeOffsetNanos = timeOffsetNanos;\n    this.data = data;\n  }\n\n  public String getType() {\n    return type;\n  }\n\n  public Long getTimeOffsetNanos() {\n    return timeOffsetNanos;\n  }\n\n  public Map<String, Object> getData() {\n    return data;\n  }\n\n  public <T> T getDataAs(Class<T> dataType) {\n    return Json.mapToObject(data, dataType);\n  }\n\n  public boolean isEquivalentStandardTypedEventTo(SubEvent other) {\n    return isStandardType()\n        && other.isStandardType()\n        && type.equals(other.type)\n        && data.equals(other.data);\n  }\n\n  boolean isStandardType() {\n    return STANDARD_TYPES.contains(type);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/AbstractRequestJournal.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.github.tomakehurst.wiremock.matching.RequestPattern.thatMatch;\nimport static com.github.tomakehurst.wiremock.matching.RequestPattern.withRequestMatching;\nimport static java.util.stream.Collectors.toList;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.store.RequestJournalStore;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.*;\nimport java.util.function.Predicate;\nimport java.util.stream.Stream;\n\npublic abstract class AbstractRequestJournal implements RequestJournal {\n\n  protected final RequestJournalStore store;\n\n  private final Integer maxEntries;\n  private final Map<String, RequestMatcherExtension> customMatchers;\n\n  public AbstractRequestJournal(\n      Integer maxEntries,\n      Map<String, RequestMatcherExtension> customMatchers,\n      RequestJournalStore store) {\n\n    if (maxEntries != null && maxEntries < 0) {\n      throw new IllegalArgumentException(\n          \"Maximum number of entries of journal must be greater than zero\");\n    }\n    this.maxEntries = maxEntries;\n    this.customMatchers = customMatchers;\n    this.store = store;\n  }\n\n  @Override\n  public int countRequestsMatching(RequestPattern requestPattern) {\n    return (int) getRequests().filter(thatMatch(requestPattern, customMatchers)).count();\n  }\n\n  @Override\n  public List<LoggedRequest> getRequestsMatching(RequestPattern requestPattern) {\n    List<LoggedRequest> loggedRequests =\n        getRequests().filter(thatMatch(requestPattern, customMatchers)).collect(toList());\n    Collections.reverse(loggedRequests);\n    return loggedRequests;\n  }\n\n  @Override\n  public void requestReceived(ServeEvent serveEvent) {\n    store.add(serveEvent);\n    removeOldEntries();\n  }\n\n  @Override\n  public void serveCompleted(ServeEvent serveEvent) {\n    store.put(serveEvent.getId(), serveEvent);\n  }\n\n  @Override\n  public void removeEvent(final UUID eventId) {\n    store.remove(eventId);\n  }\n\n  @Override\n  public List<ServeEvent> removeEventsMatching(RequestPattern requestPattern) {\n    return removeServeEvents(withRequestMatching(requestPattern, customMatchers));\n  }\n\n  @Override\n  public List<ServeEvent> removeServeEventsForStubsMatchingMetadata(\n      StringValuePattern metadataPattern) {\n    return removeServeEvents(withStubMetadataMatching(metadataPattern));\n  }\n\n  private List<ServeEvent> removeServeEvents(Predicate<ServeEvent> predicate) {\n    List<ServeEvent> toDelete = store.getAll().filter(predicate).collect(toList());\n\n    for (ServeEvent event : toDelete) {\n      store.remove(event.getId());\n    }\n\n    return toDelete;\n  }\n\n  @Override\n  public List<ServeEvent> getAllServeEvents() {\n    return store.getAll().collect(toList());\n  }\n\n  @Override\n  public Optional<ServeEvent> getServeEvent(final UUID id) {\n    return store.get(id);\n  }\n\n  @Override\n  public void reset() {\n    store.clear();\n  }\n\n  private Stream<LoggedRequest> getRequests() {\n    return store.getAll().map(ServeEvent::getRequest);\n  }\n\n  private void removeOldEntries() {\n    if (maxEntries != null) {\n      while (store.getAllKeys().count() > maxEntries) {\n        store.removeLast();\n      }\n    }\n  }\n\n  private static Predicate<ServeEvent> withStubMetadataMatching(\n      final StringValuePattern metadataPattern) {\n\n    return (ServeEvent serveEvent) -> {\n      StubMapping stub = serveEvent.getStubMapping();\n      if (stub != null) {\n        String metadataJson = Json.write(stub.getMetadata());\n        return metadataPattern.match(metadataJson).isExactMatch();\n      }\n\n      return false;\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/DisabledMessageJournal.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport java.time.Duration;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\n\npublic class DisabledMessageJournal implements MessageJournal {\n\n  @Override\n  public int countEventsMatching(MessagePattern pattern) {\n    throw new MessageJournalDisabledException();\n  }\n\n  @Override\n  public List<MessageServeEvent> getEventsMatching(MessagePattern pattern) {\n    throw new MessageJournalDisabledException();\n  }\n\n  @Override\n  public List<MessageServeEvent> getAllMessageServeEvents() {\n    throw new MessageJournalDisabledException();\n  }\n\n  @Override\n  public Optional<MessageServeEvent> getMessageServeEvent(UUID id) {\n    throw new MessageJournalDisabledException();\n  }\n\n  @Override\n  public void reset() {}\n\n  @Override\n  public void messageReceived(MessageServeEvent event) {}\n\n  @Override\n  public void removeEvent(UUID eventId) {}\n\n  @Override\n  public List<MessageServeEvent> removeEventsMatching(MessagePattern pattern) {\n    throw new MessageJournalDisabledException();\n  }\n\n  @Override\n  public List<MessageServeEvent> removeEventsForStubsMatchingMetadata(\n      StringValuePattern metadataPattern) {\n    throw new MessageJournalDisabledException();\n  }\n\n  @Override\n  public Optional<MessageServeEvent> waitForEvent(MessagePattern pattern, Duration maxWait) {\n    throw new MessageJournalDisabledException();\n  }\n\n  @Override\n  public List<MessageServeEvent> waitForEvents(\n      MessagePattern pattern, int count, Duration maxWait) {\n    throw new MessageJournalDisabledException();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/DisabledRequestJournal.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\n\npublic class DisabledRequestJournal implements RequestJournal {\n\n  @Override\n  public int countRequestsMatching(RequestPattern requestPattern) {\n    throw new RequestJournalDisabledException();\n  }\n\n  @Override\n  public List<LoggedRequest> getRequestsMatching(RequestPattern requestPattern) {\n    throw new RequestJournalDisabledException();\n  }\n\n  @Override\n  public List<ServeEvent> getAllServeEvents() {\n    throw new RequestJournalDisabledException();\n  }\n\n  @Override\n  public Optional<ServeEvent> getServeEvent(UUID id) {\n    throw new RequestJournalDisabledException();\n  }\n\n  @Override\n  public void reset() {}\n\n  @Override\n  public void requestReceived(ServeEvent serveEvent) {}\n\n  @Override\n  public void serveCompleted(ServeEvent serveEvent) {}\n\n  @Override\n  public void removeEvent(UUID eventId) {}\n\n  @Override\n  public List<ServeEvent> removeEventsMatching(RequestPattern requestPattern) {\n    throw new RequestJournalDisabledException();\n  }\n\n  @Override\n  public List<ServeEvent> removeServeEventsForStubsMatchingMetadata(\n      StringValuePattern metadataPattern) {\n    throw new RequestJournalDisabledException();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/FindMessageServeEventsResult.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.List;\n\npublic class FindMessageServeEventsResult {\n\n  private final List<MessageServeEvent> messageServeEvents;\n\n  @JsonCreator\n  public FindMessageServeEventsResult(\n      @JsonProperty(\"messageServeEvents\") List<MessageServeEvent> messageServeEvents) {\n    this.messageServeEvents = messageServeEvents;\n  }\n\n  public List<MessageServeEvent> getMessageServeEvents() {\n    return messageServeEvents;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/FindNearMissesResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.List;\n\npublic class FindNearMissesResult {\n\n  private final List<NearMiss> nearMisses;\n\n  @JsonCreator\n  public FindNearMissesResult(@JsonProperty(\"nearMisses\") List<NearMiss> nearMisses) {\n    this.nearMisses = nearMisses;\n  }\n\n  public List<NearMiss> getNearMisses() {\n    return nearMisses;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/FindRequestsResult.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class FindRequestsResult extends JournalBasedResult {\n\n  private final List<LoggedRequest> requests;\n\n  @JsonCreator\n  public FindRequestsResult(\n      @JsonProperty(\"requests\") List<LoggedRequest> requests,\n      @JsonProperty(\"requestJournalDisabled\") boolean requestJournalDisabled) {\n    super(requestJournalDisabled);\n    this.requests = requests;\n  }\n\n  public List<LoggedRequest> getRequests() {\n    return requests;\n  }\n\n  public static FindRequestsResult withRequestJournalDisabled() {\n    return new FindRequestsResult(Collections.emptyList(), true);\n  }\n\n  public static FindRequestsResult withRequests(List<LoggedRequest> requests) {\n    return new FindRequestsResult(requests, false);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/FindServeEventsResult.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\n\npublic class FindServeEventsResult {\n\n  private final List<ServeEvent> serveEvents;\n\n  @JsonCreator\n  public FindServeEventsResult(@JsonProperty(\"serveEvents\") List<ServeEvent> serveEvents) {\n    this.serveEvents = serveEvents;\n  }\n\n  public List<ServeEvent> getServeEvents() {\n    return serveEvents;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/InMemoryMessageJournal.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.github.tomakehurst.wiremock.store.InMemoryMessageJournalStore;\n\npublic class InMemoryMessageJournal extends StoreBackedMessageJournal {\n\n  public InMemoryMessageJournal(Integer maxEntries) {\n    super(maxEntries, new InMemoryMessageJournalStore());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/InMemoryRequestJournal.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.store.InMemoryRequestJournalStore;\nimport java.util.Map;\n\npublic class InMemoryRequestJournal extends StoreBackedRequestJournal {\n\n  public InMemoryRequestJournal(\n      Integer maxEntries, Map<String, RequestMatcherExtension> customMatchers) {\n    super(maxEntries, customMatchers, new InMemoryRequestJournalStore());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/JournalBasedResult.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class JournalBasedResult {\n  protected final boolean requestJournalDisabled;\n\n  public JournalBasedResult(\n      @JsonProperty(\"requestJournalDisabled\") boolean requestJournalDisabled) {\n    this.requestJournalDisabled = requestJournalDisabled;\n  }\n\n  @JsonProperty(\"requestJournalDisabled\")\n  public boolean requestJournalIsDisabled() {\n    return requestJournalDisabled;\n  }\n\n  public void assertRequestJournalEnabled() {\n    if (requestJournalDisabled) {\n      throw new RequestJournalDisabledException();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/LoggedMessageChannel.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.MessageChannel;\nimport com.github.tomakehurst.wiremock.message.RequestInitiatedMessageChannel;\nimport java.util.UUID;\n\npublic class LoggedMessageChannel {\n\n  private final UUID id;\n  private final ChannelType type;\n  private final LoggedRequest initiatingRequest;\n  private final boolean open;\n\n  @JsonCreator\n  public LoggedMessageChannel(\n      @JsonProperty(\"id\") UUID id,\n      @JsonProperty(\"type\") ChannelType type,\n      @JsonProperty(\"initiatingRequest\") LoggedRequest initiatingRequest,\n      @JsonProperty(\"open\") boolean open) {\n    this.id = id;\n    this.type = type;\n    this.initiatingRequest = initiatingRequest;\n    this.open = open;\n  }\n\n  public static LoggedMessageChannel createFrom(MessageChannel channel) {\n    LoggedRequest loggedRequest = null;\n    if (channel instanceof RequestInitiatedMessageChannel) {\n      loggedRequest =\n          LoggedRequest.createFrom(\n              ((RequestInitiatedMessageChannel) channel).getInitiatingRequest());\n    }\n    return new LoggedMessageChannel(\n        channel.getId(), channel.getType(), loggedRequest, channel.isOpen());\n  }\n\n  public UUID getId() {\n    return id;\n  }\n\n  public ChannelType getType() {\n    return type;\n  }\n\n  public LoggedRequest getInitiatingRequest() {\n    return initiatingRequest;\n  }\n\n  @JsonProperty(\"open\")\n  public boolean isOpen() {\n    return open;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/LoggedRequest.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.decodeBase64;\nimport static com.github.tomakehurst.wiremock.common.Encoding.encodeBase64;\nimport static com.github.tomakehurst.wiremock.common.Lazy.lazy;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.common.Strings.stringFromBytes;\nimport static com.github.tomakehurst.wiremock.common.Urls.toQueryParameterMap;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.fasterxml.jackson.annotation.*;\nimport com.github.tomakehurst.wiremock.common.Dates;\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.Lazy;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.nio.charset.Charset;\nimport java.util.*;\nimport org.jspecify.annotations.NonNull;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\n\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class LoggedRequest implements Request {\n\n  private final UUID id;\n  private final String scheme;\n  private final String host;\n  private final int port;\n  private final @NonNull PathAndQuery pathAndQuery;\n  private final AbsoluteUrl absoluteUrl;\n  private final String clientIp;\n  private final RequestMethod method;\n  private final HttpHeaders headers;\n  private final PathParams pathParams;\n  private final Map<String, Cookie> cookies;\n  private final Map<String, QueryParameter> queryParams;\n  private final Map<String, FormParameter> formParameters;\n  private final byte[] body;\n  private final boolean isBrowserProxyRequest;\n  private final Date loggedDate;\n  private final Collection<Part> multiparts;\n  private final String protocol;\n\n  private final Lazy<String> lazyBodyAsString;\n  private final Lazy<String> lazyBodyAsBase64;\n\n  public static LoggedRequest createFrom(Request request) {\n    return new LoggedRequest(\n        request.getId(),\n        request.getScheme(),\n        request.getHost(),\n        request.getPort(),\n        request.getPathAndQueryWithoutPrefix(),\n        request.getTypedAbsoluteUrl(),\n        request.getMethod(),\n        request.getClientIp(),\n        request.getHeaders(),\n        request.getPathParameters(),\n        request.getCookies(),\n        request.isBrowserProxyRequest(),\n        new Date(),\n        request.getBody(),\n        request.getParts(),\n        request.getProtocol(),\n        request.formParameters());\n  }\n\n  @JsonCreator\n  LoggedRequest(\n      @JsonProperty(\"url\") @NonNull String url,\n      @JsonProperty(\"absoluteUrl\") @Nullable String absoluteUrl,\n      @JsonProperty(\"method\") RequestMethod method,\n      @JsonProperty(\"clientIp\") String clientIp,\n      @JsonProperty(\"headers\") HttpHeaders headers,\n      @JsonProperty(\"cookies\") Map<String, Cookie> cookies,\n      @JsonProperty(\"browserProxyRequest\") boolean isBrowserProxyRequest,\n      @JsonProperty(\"loggedDate\") Date loggedDate,\n      @JsonProperty(\"bodyAsBase64\") String bodyAsBase64,\n      @JsonProperty(\"body\") String ignoredBodyOnlyUsedForBinding,\n      @JsonProperty(\"multiparts\") Collection<Part> multiparts,\n      @JsonProperty(\"protocol\") String protocol) {\n    this(\n        null,\n        null,\n        null,\n        null,\n        PathAndQuery.parse(url),\n        absoluteUrl != null ? AbsoluteUrl.parse(absoluteUrl) : null,\n        method,\n        clientIp,\n        headers,\n        PathParams.empty(),\n        cookies,\n        isBrowserProxyRequest,\n        loggedDate,\n        decodeBase64(bodyAsBase64),\n        multiparts,\n        protocol,\n        new HashMap<>());\n  }\n\n  private LoggedRequest(\n      UUID id,\n      String scheme,\n      String host,\n      Integer port,\n      @NonNull PathAndQuery pathAndQuery,\n      @Nullable AbsoluteUrl absoluteUrl,\n      RequestMethod method,\n      String clientIp,\n      HttpHeaders headers,\n      PathParams pathParams,\n      Map<String, Cookie> cookies,\n      boolean isBrowserProxyRequest,\n      Date loggedDate,\n      byte[] body,\n      Collection<Part> multiparts,\n      String protocol,\n      Map<String, FormParameter> formParameters) {\n    this.id = id;\n    this.pathAndQuery = pathAndQuery;\n\n    this.absoluteUrl = absoluteUrl;\n    if (this.absoluteUrl == null) {\n      this.scheme = scheme;\n      this.host = host;\n      this.port = port != null ? port : -1;\n    } else {\n      this.scheme = this.absoluteUrl.getScheme().toString();\n      this.host = this.absoluteUrl.getHost().toString();\n      //noinspection DataFlowIssue - getResolvedPort should never return null for a url we support\n      this.port = this.absoluteUrl.getResolvedPort().getIntValue();\n    }\n\n    this.clientIp = clientIp;\n    this.method = method;\n    this.body = body;\n    this.headers = headers;\n    this.pathParams = pathParams;\n    this.cookies = cookies;\n    this.queryParams = toQueryParameterMap(this.pathAndQuery.getQueryOrEmpty());\n    this.formParameters = formParameters;\n    this.isBrowserProxyRequest = isBrowserProxyRequest;\n    this.loggedDate = loggedDate;\n    this.multiparts = multiparts;\n    this.protocol = protocol;\n\n    lazyBodyAsString = lazy(() -> stringFromBytes(body, encodingFromContentTypeHeaderOrUtf8()));\n    lazyBodyAsBase64 = lazy(() -> encodeBase64(body));\n  }\n\n  @Override\n  public UUID getId() {\n    return id;\n  }\n\n  @Override\n  public @NonNull String getUrl() {\n    return pathAndQuery.toString();\n  }\n\n  @Override\n  public @NonNull PathAndQuery getPathAndQueryWithoutPrefix() {\n    return pathAndQuery;\n  }\n\n  @Override\n  public @Nullable String getAbsoluteUrl() {\n    return absoluteUrl != null ? absoluteUrl.toString() : null;\n  }\n\n  @Override\n  public @Nullable AbsoluteUrl getTypedAbsoluteUrl() {\n    return absoluteUrl;\n  }\n\n  @Override\n  public RequestMethod getMethod() {\n    return method;\n  }\n\n  @Override\n  public String getScheme() {\n    return scheme;\n  }\n\n  @Override\n  public String getHost() {\n    return host;\n  }\n\n  @Override\n  public int getPort() {\n    return port;\n  }\n\n  @Override\n  public String getClientIp() {\n    return clientIp;\n  }\n\n  @Override\n  @JsonIgnore\n  public String getHeader(String key) {\n    HttpHeader header = header(key);\n    if (header.isPresent()) {\n      return header.firstValue();\n    }\n\n    return null;\n  }\n\n  @Override\n  public HttpHeader header(String key) {\n    return headers.getHeader(key);\n  }\n\n  @Override\n  public ContentTypeHeader contentTypeHeader() {\n    if (headers != null) {\n      return headers.getContentTypeHeader();\n    }\n    return null;\n  }\n\n  private Charset encodingFromContentTypeHeaderOrUtf8() {\n    ContentTypeHeader contentTypeHeader = contentTypeHeader();\n    if (contentTypeHeader != null) {\n      return contentTypeHeader.charset();\n    }\n    return UTF_8;\n  }\n\n  @Override\n  public boolean containsHeader(String key) {\n    return getHeader(key) != null;\n  }\n\n  @JsonIgnore\n  @Override\n  public PathParams getPathParameters() {\n    return pathParams;\n  }\n\n  @Override\n  public Map<String, Cookie> getCookies() {\n    return cookies;\n  }\n\n  @Override\n  public byte[] getBody() {\n    return body;\n  }\n\n  @Override\n  @JsonProperty(\"body\")\n  public String getBodyAsString() {\n    return lazyBodyAsString.get();\n  }\n\n  @Override\n  @JsonProperty(\"bodyAsBase64\")\n  public String getBodyAsBase64() {\n    return lazyBodyAsBase64.get();\n  }\n\n  @Override\n  @JsonIgnore\n  public Set<String> getAllHeaderKeys() {\n    return headers.keys();\n  }\n\n  @Override\n  public QueryParameter queryParameter(String key) {\n    return getFirstNonNull(queryParams.get(key), QueryParameter.absent(key));\n  }\n\n  @Override\n  public FormParameter formParameter(String key) {\n    return getFirstNonNull(formParameters.get(key), FormParameter.absent(key));\n  }\n\n  @Override\n  public Map<String, FormParameter> formParameters() {\n    return formParameters;\n  }\n\n  @JsonProperty(\"formParams\")\n  public Map<String, FormParameter> getFormParameters() {\n    return formParameters;\n  }\n\n  @JsonProperty(\"queryParams\")\n  public Map<String, QueryParameter> getQueryParams() {\n    return queryParams;\n  }\n\n  public HttpHeaders getHeaders() {\n    return headers;\n  }\n\n  @Override\n  public boolean isBrowserProxyRequest() {\n    return isBrowserProxyRequest;\n  }\n\n  @JsonIgnore\n  @Override\n  public Optional<Request> getOriginalRequest() {\n    return Optional.empty();\n  }\n\n  @Override\n  public String getProtocol() {\n    return protocol;\n  }\n\n  @JsonFormat(shape = JsonFormat.Shape.NUMBER)\n  public Date getLoggedDate() {\n    return loggedDate;\n  }\n\n  public String getLoggedDateString() {\n    return loggedDate != null ? Dates.format(loggedDate) : null;\n  }\n\n  @Override\n  public String toString() {\n    return Json.write(this);\n  }\n\n  @JsonIgnore\n  @Override\n  public boolean isMultipart() {\n    return (multiparts != null && !multiparts.isEmpty());\n  }\n\n  @JsonIgnore\n  @Override\n  public Collection<Part> getParts() {\n    return multiparts;\n  }\n\n  @JsonIgnore\n  @Override\n  public Part getPart(final String name) {\n    return (multiparts != null && name != null)\n        ? multiparts.stream()\n            .filter(input -> (name.equals(input.getName())))\n            .findFirst()\n            .orElse(null)\n        : null;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/MessageJournal.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport java.time.Duration;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\n\npublic interface MessageJournal {\n\n  int countEventsMatching(MessagePattern pattern);\n\n  List<MessageServeEvent> getEventsMatching(MessagePattern pattern);\n\n  List<MessageServeEvent> getAllMessageServeEvents();\n\n  Optional<MessageServeEvent> getMessageServeEvent(UUID id);\n\n  void reset();\n\n  void messageReceived(MessageServeEvent event);\n\n  void removeEvent(UUID eventId);\n\n  List<MessageServeEvent> removeEventsMatching(MessagePattern pattern);\n\n  List<MessageServeEvent> removeEventsForStubsMatchingMetadata(StringValuePattern metadataPattern);\n\n  Optional<MessageServeEvent> waitForEvent(MessagePattern pattern, Duration maxWait);\n\n  List<MessageServeEvent> waitForEvents(MessagePattern pattern, int count, Duration maxWait);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/MessageJournalDisabledException.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.github.tomakehurst.wiremock.core.ConfigurationException;\n\npublic class MessageJournalDisabledException extends ConfigurationException {\n\n  public MessageJournalDisabledException() {\n    super(\n        \"The message journal is disabled, so no verification or message searching operations are available\");\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/MessageServeEvent.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.annotation.JsonValue;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.message.ChannelType;\nimport com.github.tomakehurst.wiremock.message.Message;\nimport com.github.tomakehurst.wiremock.message.MessageChannel;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.message.RequestInitiatedMessageChannel;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.google.common.base.Stopwatch;\nimport java.time.Instant;\nimport java.util.*;\nimport java.util.concurrent.ConcurrentLinkedQueue;\nimport java.util.function.Consumer;\n\n@JsonInclude(NON_EMPTY)\npublic class MessageServeEvent {\n\n  public enum EventType {\n    RECEIVED,\n    SENT;\n\n    @JsonValue\n    public String toJson() {\n      return name().toLowerCase(java.util.Locale.ROOT);\n    }\n\n    @JsonCreator\n    public static EventType fromJson(String value) {\n      if (value == null) {\n        return null;\n      }\n      return valueOf(value.toUpperCase(java.util.Locale.ROOT));\n    }\n  }\n\n  private final UUID id;\n  private final EventType eventType;\n  private final ChannelType channelType;\n  private final UUID channelId;\n  private final LoggedRequest channelRequest;\n  private final Message message;\n  private final MessageStubMapping stubMapping;\n  private final boolean wasMatched;\n  private final Instant timestamp;\n  private final ConcurrentLinkedQueue<SubEvent> subEvents;\n  private final Stopwatch stopwatch;\n\n  @JsonCreator\n  public MessageServeEvent(\n      @JsonProperty(\"id\") UUID id,\n      @JsonProperty(\"eventType\") EventType eventType,\n      @JsonProperty(\"channelType\") ChannelType channelType,\n      @JsonProperty(\"channelId\") UUID channelId,\n      @JsonProperty(\"channelRequest\") LoggedRequest channelRequest,\n      @JsonProperty(\"message\") Message message,\n      @JsonProperty(\"stubMapping\") MessageStubMapping stubMapping,\n      @JsonProperty(\"wasMatched\") boolean wasMatched,\n      @JsonProperty(\"timestamp\") Instant timestamp,\n      @JsonProperty(\"subEvents\") Queue<SubEvent> subEvents) {\n    this.id = id != null ? id : UUID.randomUUID();\n    this.eventType = eventType;\n    this.channelType = channelType;\n    this.channelId = channelId;\n    this.channelRequest = channelRequest;\n    this.message = message;\n    this.stubMapping = stubMapping;\n    this.wasMatched = wasMatched;\n    this.timestamp = timestamp != null ? timestamp : Instant.now();\n    this.subEvents =\n        subEvents != null ? new ConcurrentLinkedQueue<>(subEvents) : new ConcurrentLinkedQueue<>();\n    this.stopwatch = Stopwatch.createStarted();\n  }\n\n  private MessageServeEvent(\n      UUID id,\n      EventType eventType,\n      ChannelType channelType,\n      UUID channelId,\n      LoggedRequest channelRequest,\n      Message message,\n      MessageStubMapping stubMapping,\n      boolean wasMatched,\n      Instant timestamp,\n      ConcurrentLinkedQueue<SubEvent> subEvents,\n      Stopwatch stopwatch) {\n    this.id = id;\n    this.eventType = eventType;\n    this.channelType = channelType;\n    this.channelId = channelId;\n    this.channelRequest = channelRequest;\n    this.message = message;\n    this.stubMapping = stubMapping;\n    this.wasMatched = wasMatched;\n    this.timestamp = timestamp;\n    this.subEvents = subEvents;\n    this.stopwatch = stopwatch;\n  }\n\n  public static MessageServeEvent receivedMatched(\n      ChannelType channelType,\n      UUID channelId,\n      Request channelRequest,\n      Message message,\n      MessageStubMapping stubMapping) {\n    return new MessageServeEvent(\n        UUID.randomUUID(),\n        EventType.RECEIVED,\n        channelType,\n        channelId,\n        LoggedRequest.createFrom(channelRequest),\n        message,\n        stubMapping,\n        true,\n        Instant.now(),\n        null);\n  }\n\n  public static MessageServeEvent receivedMatched(\n      MessageChannel channel, Message message, MessageStubMapping stubMapping) {\n    Request channelRequest = null;\n    if (channel instanceof RequestInitiatedMessageChannel) {\n      channelRequest = ((RequestInitiatedMessageChannel) channel).getInitiatingRequest();\n    }\n    return receivedMatched(\n        channel.getType(), channel.getId(), channelRequest, message, stubMapping);\n  }\n\n  public static MessageServeEvent receivedUnmatched(\n      ChannelType channelType, UUID channelId, Request channelRequest, Message message) {\n    return new MessageServeEvent(\n        UUID.randomUUID(),\n        EventType.RECEIVED,\n        channelType,\n        channelId,\n        LoggedRequest.createFrom(channelRequest),\n        message,\n        null,\n        false,\n        Instant.now(),\n        null);\n  }\n\n  public static MessageServeEvent receivedUnmatched(MessageChannel channel, Message message) {\n    Request channelRequest = null;\n    if (channel instanceof RequestInitiatedMessageChannel) {\n      channelRequest = ((RequestInitiatedMessageChannel) channel).getInitiatingRequest();\n    }\n    return receivedUnmatched(channel.getType(), channel.getId(), channelRequest, message);\n  }\n\n  public static MessageServeEvent sent(\n      ChannelType channelType, UUID channelId, Request channelRequest, Message message) {\n    return new MessageServeEvent(\n        UUID.randomUUID(),\n        EventType.SENT,\n        channelType,\n        channelId,\n        LoggedRequest.createFrom(channelRequest),\n        message,\n        null,\n        true,\n        Instant.now(),\n        null);\n  }\n\n  public static MessageServeEvent sent(MessageChannel channel, Message message) {\n    Request channelRequest = null;\n    if (channel instanceof RequestInitiatedMessageChannel) {\n      channelRequest = ((RequestInitiatedMessageChannel) channel).getInitiatingRequest();\n    }\n    return sent(channel.getType(), channel.getId(), channelRequest, message);\n  }\n\n  public UUID getId() {\n    return id;\n  }\n\n  public EventType getEventType() {\n    return eventType;\n  }\n\n  public ChannelType getChannelType() {\n    return channelType;\n  }\n\n  public UUID getChannelId() {\n    return channelId;\n  }\n\n  public LoggedRequest getChannelRequest() {\n    return channelRequest;\n  }\n\n  public Message getMessage() {\n    return message;\n  }\n\n  public MessageStubMapping getStubMapping() {\n    return stubMapping;\n  }\n\n  public boolean getWasMatched() {\n    return wasMatched;\n  }\n\n  public Instant getTimestamp() {\n    return timestamp;\n  }\n\n  public Queue<? extends SubEvent> getSubEvents() {\n    return subEvents;\n  }\n\n  @JsonIgnore\n  public boolean isReceived() {\n    return eventType == EventType.RECEIVED;\n  }\n\n  @JsonIgnore\n  public boolean isSent() {\n    return eventType == EventType.SENT;\n  }\n\n  public void appendSubEvent(String type, Object data) {\n    final long elapsedNanos = stopwatch.elapsed(java.util.concurrent.TimeUnit.NANOSECONDS);\n    appendSubEvent(new SubEvent(type, elapsedNanos, data));\n  }\n\n  public void appendSubEvent(SubEvent subEvent) {\n    subEvents.add(subEvent);\n  }\n\n  public MessageServeEvent withStubMapping(MessageStubMapping stubMapping) {\n    return new MessageServeEvent(\n        id,\n        eventType,\n        channelType,\n        channelId,\n        channelRequest,\n        message,\n        stubMapping,\n        stubMapping != null,\n        timestamp,\n        subEvents,\n        stopwatch);\n  }\n\n  public static Builder builder() {\n    return new Builder();\n  }\n\n  public static MessageServeEvent create(Consumer<Builder> transformer) {\n    final Builder builder = builder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public MessageServeEvent transform(Consumer<Builder> transformer) {\n    final Builder builder = toBuilder();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  public Builder toBuilder() {\n    return new Builder(this);\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;\n    if (o == null || getClass() != o.getClass()) return false;\n    MessageServeEvent that = (MessageServeEvent) o;\n    return Objects.equals(id, that.id);\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(id);\n  }\n\n  public static class Builder {\n    private UUID id;\n    private EventType eventType;\n    private ChannelType channelType;\n    private UUID channelId;\n    private LoggedRequest channelRequest;\n    private Message message;\n    private MessageStubMapping stubMapping;\n    private boolean wasMatched;\n    private Instant timestamp;\n    private Queue<SubEvent> subEvents;\n\n    public Builder() {}\n\n    public Builder(MessageServeEvent existing) {\n      this.id = existing.id;\n      this.eventType = existing.eventType;\n      this.channelType = existing.channelType;\n      this.channelId = existing.channelId;\n      this.channelRequest = existing.channelRequest;\n      this.message = existing.message;\n      this.stubMapping = existing.stubMapping;\n      this.wasMatched = existing.wasMatched;\n      this.timestamp = existing.timestamp;\n      this.subEvents = new ConcurrentLinkedQueue<>(existing.subEvents);\n    }\n\n    public Builder withId(UUID id) {\n      this.id = id;\n      return this;\n    }\n\n    public Builder withEventType(EventType eventType) {\n      this.eventType = eventType;\n      return this;\n    }\n\n    public Builder withChannelType(ChannelType channelType) {\n      this.channelType = channelType;\n      return this;\n    }\n\n    public Builder withChannelId(UUID channelId) {\n      this.channelId = channelId;\n      return this;\n    }\n\n    public Builder withChannelRequest(LoggedRequest channelRequest) {\n      this.channelRequest = channelRequest;\n      return this;\n    }\n\n    public Builder withMessage(Message message) {\n      this.message = message;\n      return this;\n    }\n\n    public Builder withStubMapping(MessageStubMapping stubMapping) {\n      this.stubMapping = stubMapping;\n      return this;\n    }\n\n    public Builder withWasMatched(boolean wasMatched) {\n      this.wasMatched = wasMatched;\n      return this;\n    }\n\n    public Builder withTimestamp(Instant timestamp) {\n      this.timestamp = timestamp;\n      return this;\n    }\n\n    public Builder withSubEvents(Queue<SubEvent> subEvents) {\n      this.subEvents = subEvents;\n      return this;\n    }\n\n    public MessageServeEvent build() {\n      return new MessageServeEvent(\n          id,\n          eventType,\n          channelType,\n          channelId,\n          channelRequest,\n          message,\n          stubMapping,\n          wasMatched,\n          timestamp,\n          subEvents);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/MessageVerificationResult.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.Json;\n\npublic class MessageVerificationResult {\n\n  private final int count;\n  private final boolean messageJournalDisabled;\n\n  @JsonCreator\n  public MessageVerificationResult(\n      @JsonProperty(\"count\") int count,\n      @JsonProperty(\"messageJournalDisabled\") boolean messageJournalDisabled) {\n    this.count = count;\n    this.messageJournalDisabled = messageJournalDisabled;\n  }\n\n  public static MessageVerificationResult from(String json) {\n    return Json.read(json, MessageVerificationResult.class);\n  }\n\n  public static MessageVerificationResult withCount(int count) {\n    return new MessageVerificationResult(count, false);\n  }\n\n  public static MessageVerificationResult withMessageJournalDisabled() {\n    return new MessageVerificationResult(-1, true);\n  }\n\n  public int getCount() {\n    return count;\n  }\n\n  public boolean isMessageJournalDisabled() {\n    return messageJournalDisabled;\n  }\n\n  public void assertMessageJournalEnabled() {\n    if (messageJournalDisabled) {\n      throw new MessageJournalDisabledException();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/NearMiss.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport com.github.tomakehurst.wiremock.verification.diff.Diff;\n\npublic class NearMiss implements Comparable<NearMiss> {\n\n  private final LoggedRequest request;\n  private final StubMapping mapping;\n  private final RequestPattern requestPattern;\n  private final MatchResult matchResult;\n  private final String scenarioState;\n\n  @JsonCreator\n  public NearMiss(\n      @JsonProperty(\"request\") LoggedRequest request,\n      @JsonProperty(\"stubMapping\") StubMapping mapping,\n      @JsonProperty(\"requestPattern\") RequestPattern requestPattern,\n      @JsonProperty(\"matchResult\") MatchResult matchResult,\n      @JsonProperty(\"scenarioState\") String scenarioState) {\n    this.request = request;\n    this.mapping = mapping;\n    this.requestPattern = requestPattern;\n    this.matchResult = matchResult;\n    this.scenarioState = scenarioState;\n  }\n\n  public NearMiss(\n      LoggedRequest request, StubMapping mapping, MatchResult matchResult, String scenarioState) {\n    this(request, mapping, null, matchResult, scenarioState);\n  }\n\n  public NearMiss(LoggedRequest request, RequestPattern requestPattern, MatchResult matchResult) {\n    this(request, null, requestPattern, matchResult, null);\n  }\n\n  public LoggedRequest getRequest() {\n    return request;\n  }\n\n  public StubMapping getStubMapping() {\n    return mapping;\n  }\n\n  public RequestPattern getRequestPattern() {\n    return requestPattern;\n  }\n\n  public MatchResult getMatchResult() {\n    return matchResult;\n  }\n\n  @Override\n  public int compareTo(NearMiss o) {\n    return o.getMatchResult().compareTo(matchResult);\n  }\n\n  @JsonIgnore\n  public Diff getDiff() {\n    if (requestPattern != null) {\n      return new Diff(requestPattern, request);\n    }\n\n    return new Diff(getStubMapping(), request, scenarioState);\n  }\n\n  @Override\n  public String toString() {\n    return getDiff().toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/NearMissCalculator.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static java.lang.Math.min;\n\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.MemoizingMatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.stubbing.*;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Collectors;\n\npublic class NearMissCalculator {\n\n  public static final int NEAR_MISS_COUNT = 3;\n\n  public static final Comparator<NearMiss> NEAR_MISS_ASCENDING_COMPARATOR = Comparable::compareTo;\n\n  private final StubMappings stubMappings;\n  private final RequestJournal requestJournal;\n  private final Scenarios scenarios;\n  private final Map<String, RequestMatcherExtension> customMatchers;\n\n  public NearMissCalculator(\n      StubMappings stubMappings, RequestJournal requestJournal, Scenarios scenarios) {\n    this(stubMappings, requestJournal, scenarios, Map.of());\n  }\n\n  public NearMissCalculator(\n      StubMappings stubMappings,\n      RequestJournal requestJournal,\n      Scenarios scenarios,\n      Map<String, RequestMatcherExtension> customMatchers) {\n    this.stubMappings = stubMappings;\n    this.requestJournal = requestJournal;\n    this.scenarios = scenarios;\n    this.customMatchers = customMatchers;\n  }\n\n  public List<NearMiss> findNearestTo(final LoggedRequest request) {\n    List<StubMapping> allMappings = stubMappings.getAll();\n\n    return sortAndTruncate(\n        allMappings.stream()\n            .map(\n                stubMapping -> {\n                  MatchResult matchResult =\n                      new MemoizingMatchResult(\n                          stubMapping.getRequest().match(request, customMatchers));\n                  String actualScenarioState = getScenarioStateOrNull(stubMapping);\n                  return new NearMiss(request, stubMapping, matchResult, actualScenarioState);\n                })\n            .collect(Collectors.toList()),\n        allMappings.size());\n  }\n\n  private String getScenarioStateOrNull(StubMapping stubMapping) {\n    if (!stubMapping.isInScenario()) {\n      return null;\n    }\n\n    Scenario scenario = scenarios.getByName(stubMapping.getScenarioName());\n    return scenario != null ? scenario.getState() : null;\n  }\n\n  public List<NearMiss> findNearestTo(final RequestPattern requestPattern) {\n    List<ServeEvent> serveEvents = requestJournal.getAllServeEvents();\n    return sortAndTruncate(\n        serveEvents.stream()\n            .map(\n                serveEvent -> {\n                  MatchResult matchResult =\n                      new MemoizingMatchResult(\n                          requestPattern.match(serveEvent.getRequest(), customMatchers));\n                  return new NearMiss(serveEvent.getRequest(), requestPattern, matchResult);\n                })\n            .collect(Collectors.toList()),\n        serveEvents.size());\n  }\n\n  private static List<NearMiss> sortAndTruncate(List<NearMiss> nearMisses, int originalSize) {\n    nearMisses.sort(NEAR_MISS_ASCENDING_COMPARATOR);\n    return nearMisses.subList(0, min(NEAR_MISS_COUNT, originalSize));\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/RequestJournal.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.UUID;\n\npublic interface RequestJournal {\n\n  int countRequestsMatching(RequestPattern requestPattern);\n\n  List<LoggedRequest> getRequestsMatching(RequestPattern requestPattern);\n\n  List<ServeEvent> getAllServeEvents();\n\n  Optional<ServeEvent> getServeEvent(UUID id);\n\n  void reset();\n\n  void requestReceived(ServeEvent serveEvent);\n\n  void serveCompleted(ServeEvent serveEvent);\n\n  void removeEvent(UUID eventId);\n\n  List<ServeEvent> removeEventsMatching(RequestPattern requestPattern);\n\n  List<ServeEvent> removeServeEventsForStubsMatchingMetadata(StringValuePattern metadataPattern);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/RequestJournalDisabledException.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.github.tomakehurst.wiremock.core.ConfigurationException;\n\npublic class RequestJournalDisabledException extends ConfigurationException {\n\n  public RequestJournalDisabledException() {\n    super(\n        \"The request journal is disabled, so no verification or request searching operations are available\");\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/StoreBackedMessageJournal.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport static java.util.stream.Collectors.toList;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.message.MessagePattern;\nimport com.github.tomakehurst.wiremock.message.MessageStubMapping;\nimport com.github.tomakehurst.wiremock.store.MessageJournalStore;\nimport com.github.tomakehurst.wiremock.store.StoreEvent;\nimport java.time.Duration;\nimport java.util.*;\nimport java.util.concurrent.CountDownLatch;\nimport java.util.concurrent.TimeUnit;\nimport java.util.function.Consumer;\n\npublic class StoreBackedMessageJournal implements MessageJournal {\n\n  protected final MessageJournalStore store;\n  private final Integer maxEntries;\n\n  public StoreBackedMessageJournal(Integer maxEntries, MessageJournalStore store) {\n    if (maxEntries != null && maxEntries < 0) {\n      throw new IllegalArgumentException(\n          \"Maximum number of entries of journal must be greater than zero\");\n    }\n    this.maxEntries = maxEntries;\n    this.store = store;\n  }\n\n  @Override\n  public int countEventsMatching(MessagePattern pattern) {\n    return (int) store.getAll().filter(pattern::matches).count();\n  }\n\n  @Override\n  public List<MessageServeEvent> getEventsMatching(MessagePattern pattern) {\n    List<MessageServeEvent> events = store.getAll().filter(pattern::matches).collect(toList());\n    Collections.reverse(events);\n    return events;\n  }\n\n  @Override\n  public List<MessageServeEvent> getAllMessageServeEvents() {\n    return store.getAll().collect(toList());\n  }\n\n  @Override\n  public Optional<MessageServeEvent> getMessageServeEvent(UUID id) {\n    return store.get(id);\n  }\n\n  @Override\n  public void reset() {\n    store.clear();\n  }\n\n  @Override\n  public void messageReceived(MessageServeEvent event) {\n    store.add(event);\n    removeOldEntries();\n  }\n\n  @Override\n  public void removeEvent(UUID eventId) {\n    store.remove(eventId);\n  }\n\n  @Override\n  public List<MessageServeEvent> removeEventsMatching(MessagePattern pattern) {\n    List<MessageServeEvent> toDelete = store.getAll().filter(pattern::matches).collect(toList());\n    for (MessageServeEvent event : toDelete) {\n      store.remove(event.getId());\n    }\n    return toDelete;\n  }\n\n  @Override\n  public List<MessageServeEvent> removeEventsForStubsMatchingMetadata(\n      StringValuePattern metadataPattern) {\n    return removeEventsMatching(withStubMetadataMatching(metadataPattern));\n  }\n\n  @Override\n  public Optional<MessageServeEvent> waitForEvent(MessagePattern pattern, Duration maxWait) {\n    Optional<MessageServeEvent> existing = store.getAll().filter(pattern::matches).findFirst();\n    if (existing.isPresent()) {\n      return existing;\n    }\n\n    CountDownLatch latch = new CountDownLatch(1);\n    final MessageServeEvent[] result = new MessageServeEvent[1];\n\n    Consumer<StoreEvent<UUID, MessageServeEvent>> listener =\n        storeEvent -> {\n          if (storeEvent.getNewValue() != null && pattern.matches(storeEvent.getNewValue())) {\n            result[0] = storeEvent.getNewValue();\n            latch.countDown();\n          }\n        };\n\n    store.registerEventListener(listener);\n\n    try {\n      boolean found = latch.await(maxWait.toMillis(), TimeUnit.MILLISECONDS);\n      if (found) {\n        return Optional.ofNullable(result[0]);\n      }\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n    } finally {\n      store.unregisterEventListener(listener);\n    }\n\n    return store.getAll().filter(pattern::matches).findFirst();\n  }\n\n  @Override\n  public List<MessageServeEvent> waitForEvents(\n      MessagePattern pattern, int count, Duration maxWait) {\n    long deadline = System.currentTimeMillis() + maxWait.toMillis();\n    while (System.currentTimeMillis() < deadline) {\n      List<MessageServeEvent> current = store.getAll().filter(pattern::matches).collect(toList());\n      if (current.size() >= count) {\n        return current.subList(0, count);\n      }\n\n      long remaining = deadline - System.currentTimeMillis();\n      if (remaining > 0) {\n        CountDownLatch latch = new CountDownLatch(1);\n        Consumer<StoreEvent<UUID, MessageServeEvent>> listener =\n            storeEvent -> {\n              if (storeEvent.getNewValue() != null && pattern.matches(storeEvent.getNewValue())) {\n                latch.countDown();\n              }\n            };\n\n        store.registerEventListener(listener);\n\n        try {\n          latch.await(Math.min(remaining, 100), TimeUnit.MILLISECONDS);\n        } catch (InterruptedException e) {\n          Thread.currentThread().interrupt();\n          break;\n        } finally {\n          store.unregisterEventListener(listener);\n        }\n      }\n    }\n\n    return store.getAll().filter(pattern::matches).limit(count).collect(toList());\n  }\n\n  private void removeOldEntries() {\n    if (maxEntries != null) {\n      while (store.getAllKeys().count() > maxEntries) {\n        store.removeLast();\n      }\n    }\n  }\n\n  private static MessagePattern withStubMetadataMatching(final StringValuePattern metadataPattern) {\n    return new MessagePattern(null, null) {\n      @Override\n      public boolean matches(MessageServeEvent event) {\n        MessageStubMapping stub = event.getStubMapping();\n        if (stub != null) {\n          String metadataJson = Json.write(stub.getMetadata());\n          return metadataPattern.match(metadataJson).isExactMatch();\n        }\n        return false;\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/StoreBackedRequestJournal.java",
    "content": "/*\n * Copyright (C) 2022-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.store.RequestJournalStore;\nimport java.util.Map;\n\npublic class StoreBackedRequestJournal extends AbstractRequestJournal {\n\n  public StoreBackedRequestJournal(\n      Integer maxEntries,\n      Map<String, RequestMatcherExtension> customMatchers,\n      RequestJournalStore store) {\n    super(maxEntries, customMatchers, store);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/VerificationResult.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.github.tomakehurst.wiremock.common.Json;\n\npublic class VerificationResult extends JournalBasedResult {\n\n  private final Integer count;\n\n  @JsonCreator\n  public VerificationResult(\n      @JsonProperty(\"count\") Integer count,\n      @JsonProperty(\"requestJournalDisabled\") boolean requestJournalDisabled) {\n    super(requestJournalDisabled);\n    this.count = count;\n  }\n\n  public static VerificationResult from(String json) {\n    return Json.read(json, VerificationResult.class);\n  }\n\n  public static VerificationResult withCount(int count) {\n    return new VerificationResult(count, false);\n  }\n\n  public static VerificationResult withRequestJournalDisabled() {\n    return new VerificationResult(-1, true);\n  }\n\n  public int getCount() {\n    return count;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/CustomMatcherWrapper.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.NamedValueMatcher;\nimport com.github.tomakehurst.wiremock.matching.ValueMatcher;\n\npublic class CustomMatcherWrapper implements NamedValueMatcher<Request> {\n\n  private final ValueMatcher<Request> matcher;\n\n  public CustomMatcherWrapper(ValueMatcher<Request> matcher) {\n    this.matcher = matcher;\n  }\n\n  @Override\n  public String getName() {\n    return \"custom matcher\";\n  }\n\n  @Override\n  public String getExpected() {\n    return \"[custom matcher]\";\n  }\n\n  @Override\n  public MatchResult match(Request value) {\n    return matcher.match(value);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/Diff.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.common.Strings.isEmpty;\nimport static com.github.tomakehurst.wiremock.verification.diff.SpacerLine.SPACER;\n\nimport com.github.tomakehurst.wiremock.common.Json;\nimport com.github.tomakehurst.wiremock.common.ListOrSingle;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.common.url.PathTemplate;\nimport com.github.tomakehurst.wiremock.common.xml.Xml;\nimport com.github.tomakehurst.wiremock.http.Body;\nimport com.github.tomakehurst.wiremock.http.Cookie;\nimport com.github.tomakehurst.wiremock.http.FormParameter;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.MultiValue;\nimport com.github.tomakehurst.wiremock.http.QueryParameter;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.RequestMethod;\nimport com.github.tomakehurst.wiremock.matching.BinaryEqualToPattern;\nimport com.github.tomakehurst.wiremock.matching.ContentPattern;\nimport com.github.tomakehurst.wiremock.matching.EqualToJsonPattern;\nimport com.github.tomakehurst.wiremock.matching.EqualToPattern;\nimport com.github.tomakehurst.wiremock.matching.EqualToXmlPattern;\nimport com.github.tomakehurst.wiremock.matching.MultiValuePattern;\nimport com.github.tomakehurst.wiremock.matching.MultipartValuePattern;\nimport com.github.tomakehurst.wiremock.matching.MultipleMatchMultiValuePattern;\nimport com.github.tomakehurst.wiremock.matching.PathPattern;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.matching.RequestPattern;\nimport com.github.tomakehurst.wiremock.matching.SingleMatchMultiValuePattern;\nimport com.github.tomakehurst.wiremock.matching.StringValuePattern;\nimport com.github.tomakehurst.wiremock.matching.UrlPathPattern;\nimport com.github.tomakehurst.wiremock.matching.UrlPathTemplatePattern;\nimport com.github.tomakehurst.wiremock.matching.UrlPattern;\nimport com.github.tomakehurst.wiremock.stubbing.StubMapping;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Collectors;\n\npublic class Diff {\n\n  private final String stubMappingName;\n  private final RequestPattern requestPattern;\n  private final Request request;\n  private final String scenarioName;\n  private final String scenarioState;\n  private final String expectedScenarioState;\n\n  public Diff(RequestPattern expected, Request actual) {\n    this.requestPattern = expected;\n    this.request = actual;\n    this.stubMappingName = null;\n    this.scenarioName = null;\n    this.scenarioState = null;\n    this.expectedScenarioState = null;\n  }\n\n  public Diff(StubMapping expected, Request actual) {\n    this(expected, actual, null);\n  }\n\n  public Diff(StubMapping expected, Request actual, String scenarioState) {\n    this.requestPattern = expected.getRequest();\n    this.request = actual;\n    this.stubMappingName = expected.getName();\n    this.scenarioName = expected.getScenarioName();\n    this.scenarioState = scenarioState;\n    this.expectedScenarioState = expected.getRequiredScenarioState();\n  }\n\n  @Override\n  public String toString() {\n    return new JUnitStyleDiffRenderer().render(this);\n  }\n\n  public List<DiffLine<?>> getLines() {\n    return getLines(Collections.emptyMap());\n  }\n\n  public List<DiffLine<?>> getLines(Map<String, RequestMatcherExtension> customMatcherExtensions) {\n    List<DiffLine<?>> diffLineList = new LinkedList<>();\n\n    addHostSectionIfPresent(diffLineList);\n    addPortSectionIfPresent(diffLineList);\n    addClientIpSectionIfPresent(diffLineList);\n    addSchemeSectionIfPresent(diffLineList);\n    addMethodSection(diffLineList);\n    UrlPattern urlPattern = getFirstNonNull(requestPattern.getUrlMatcher(), anyUrl());\n    DiffLine<String> urlSection = addUrlSectionWithSpacer(urlPattern, diffLineList);\n\n    addHeaderSectionWithSpacerIfPresent(\n        requestPattern.combineBasicAuthAndOtherHeaders(), request.getHeaders(), diffLineList);\n\n    addPathParameterSectionWithSpacerIfPresent(urlPattern, urlSection, diffLineList);\n\n    addQueryParametersSectionWithSpacerIfPresent(diffLineList);\n\n    addFormParametersSectionWithSpacerIfPresent(diffLineList);\n\n    addCookiesSectionWithSpacerIfPresent(diffLineList);\n\n    addBodySectionIfPresent(diffLineList);\n\n    addMultipartSectionWithSpacerIfPresent(diffLineList);\n\n    addInlineCustomMatcherSectionIfPresent(diffLineList);\n    addNamedCustomMatcherSectionIfPresent(customMatcherExtensions, diffLineList);\n    addScenarioSectionIfPresent(diffLineList);\n\n    return diffLineList;\n  }\n\n  private void addScenarioSectionIfPresent(List<DiffLine<?>> diffLineList) {\n    if (scenarioName != null && expectedScenarioState != null) {\n      diffLineList.addAll(\n          toDiffDescriptionLines(\n              new DiffLine<>(\n                  \"Scenario\",\n                  new EqualToPattern(expectedScenarioState),\n                  buildScenarioLine(scenarioName, scenarioState),\n                  buildScenarioLine(scenarioName, expectedScenarioState))));\n    }\n  }\n\n  private void addNamedCustomMatcherSectionIfPresent(\n      Map<String, RequestMatcherExtension> customMatcherExtensions,\n      List<DiffLine<?>> diffLineList) {\n    if (requestPattern.hasNamedCustomMatcher()) {\n      RequestMatcherExtension customMatcher =\n          customMatcherExtensions.get(requestPattern.getCustomMatcher().getName());\n      if (customMatcher != null) {\n        NamedCustomMatcherLine namedCustomMatcherLine =\n            new NamedCustomMatcherLine(\n                customMatcher, requestPattern.getCustomMatcher().getParameters(), request);\n        diffLineList.addAll(toDiffDescriptionLines(namedCustomMatcherLine));\n      } else {\n        diffLineList.add(\n            new SectionDelimiter(\n                \"[custom matcher: \" + requestPattern.getCustomMatcher().getName() + \"]\"));\n      }\n    }\n  }\n\n  private void addInlineCustomMatcherSectionIfPresent(List<DiffLine<?>> diffLineList) {\n    if (requestPattern.hasInlineCustomMatcher()) {\n      InlineCustomMatcherLine customMatcherLine =\n          new InlineCustomMatcherLine(requestPattern.getInlineCustomMatcher(), request);\n      diffLineList.addAll(toDiffDescriptionLines(customMatcherLine));\n    }\n  }\n\n  private void addMultipartSectionWithSpacerIfPresent(List<DiffLine<?>> diffLineList) {\n    List<MultipartValuePattern> multipartPatterns = requestPattern.getMultipartPatterns();\n    if (!multipartPatterns.isEmpty()) {\n\n      for (MultipartValuePattern pattern : multipartPatterns) {\n        if (!request.isMultipart()) {\n          diffLineList.add(new SectionDelimiter(\"[Multipart request body]\", \"\"));\n        } else if (!pattern.match(request).isExactMatch()) {\n          for (Request.Part part : request.getParts()) {\n            diffLineList.add(SPACER);\n            String patternPartName = pattern.getName() == null ? \"\" : \": \" + pattern.getName();\n            String partName = part.getName() == null ? \"\" : part.getName();\n            diffLineList.add(\n                new SectionDelimiter(\"[Multipart\" + patternPartName + \"]\", \"[\" + partName + \"]\"));\n            diffLineList.add(SPACER);\n\n            if (!pattern.match(part).isExactMatch()) {\n              addHeaderSectionWithSpacerIfPresent(\n                  pattern.getHeaders(), part.getHeaders(), diffLineList);\n              addBodySectionIfPresent(pattern.getBodyPatterns(), part.getBody(), diffLineList);\n              diffLineList.add(SPACER);\n            }\n\n            diffLineList.add(new SectionDelimiter(\"[/Multipart]\", \"[/\" + partName + \"]\"));\n            diffLineList.add(SPACER);\n          }\n        }\n      }\n    }\n  }\n\n  private void addCookiesSectionWithSpacerIfPresent(List<DiffLine<?>> diffLineList) {\n    Map<String, StringValuePattern> cookiesPattern = requestPattern.getCookies();\n    {\n      Map<String, Cookie> cookies = getFirstNonNull(request.getCookies(), Collections.emptyMap());\n      for (Map.Entry<String, StringValuePattern> entry : cookiesPattern.entrySet()) {\n        String key = entry.getKey();\n        StringValuePattern pattern = entry.getValue();\n        Cookie cookie = getFirstNonNull(cookies.get(key), Cookie.absent());\n\n        String operator = generateOperatorString(pattern, \"=\");\n        DiffLine<String> section =\n            new DiffLine<>(\n                \"Cookie\",\n                pattern,\n                cookie.isPresent() ? cookie.getValue() : \"\",\n                \"Cookie: \" + key + operator + pattern.getValue());\n        diffLineList.addAll(toDiffDescriptionLines(section));\n      }\n      if (!cookiesPattern.isEmpty()) {\n        diffLineList.add(SPACER);\n      }\n    }\n  }\n\n  private void addFormParametersSectionWithSpacerIfPresent(List<DiffLine<?>> diffLineList) {\n    final Map<String, MultiValuePattern> formParameters = requestPattern.getFormParameters();\n    {\n      Map<String, FormParameter> requestFormParameters = request.formParameters();\n\n      for (Map.Entry<String, MultiValuePattern> entry : formParameters.entrySet()) {\n        String key = entry.getKey();\n        MultiValuePattern pattern = entry.getValue();\n        FormParameter formParameter =\n            getFirstNonNull(requestFormParameters.get(key), FormParameter.absent(key));\n\n        String operator = generateOperatorStringForMultiValuePattern(pattern, \" = \");\n        DiffLine<MultiValue> section =\n            new DiffLine<>(\n                \"Form data\",\n                pattern,\n                formParameter,\n                \"Form: \" + key + operator + pattern.getExpected());\n        diffLineList.addAll(toDiffDescriptionLines(section));\n      }\n      if (!formParameters.isEmpty()) {\n        diffLineList.add(SPACER);\n      }\n    }\n  }\n\n  private void addQueryParametersSectionWithSpacerIfPresent(List<DiffLine<?>> diffLineList) {\n    final Map<String, MultiValuePattern> queryParameters = requestPattern.getQueryParameters();\n    {\n      var query = request.getPathAndQueryWithoutPrefix().getQueryOrEmpty();\n\n      for (Map.Entry<String, MultiValuePattern> entry : queryParameters.entrySet()) {\n        String key = entry.getKey();\n        MultiValuePattern pattern = entry.getValue();\n        QueryParameter queryParameter = new QueryParameter(key, query.getDecoded(key));\n\n        String operator = generateOperatorStringForMultiValuePattern(pattern, \" = \");\n        DiffLine<MultiValue> section =\n            new DiffLine<>(\n                \"Query\",\n                pattern,\n                queryParameter,\n                \"Query: \" + key + operator + pattern.getExpected());\n        diffLineList.addAll(toDiffDescriptionLines(section));\n      }\n      if (!queryParameters.isEmpty()) {\n        diffLineList.add(SPACER);\n      }\n    }\n  }\n\n  private void addPathParameterSectionWithSpacerIfPresent(\n      UrlPattern urlPattern, DiffLine<String> urlSection, List<DiffLine<?>> diffLineList) {\n    final Map<String, StringValuePattern> pathParameters = requestPattern.getPathParameters();\n    if (urlPattern instanceof UrlPathTemplatePattern\n        && !pathParameters.isEmpty()\n        && urlSection.isExactMatch()) {\n      final UrlPathTemplatePattern urlPathTemplatePattern =\n          (UrlPathTemplatePattern) requestPattern.getUrlMatcher();\n      final PathTemplate pathTemplate = urlPathTemplatePattern.getPathTemplate();\n      final PathParams requestPathParameterValues =\n          pathTemplate.parse(request.getPathAndQueryWithoutPrefix().getPath());\n\n      for (Map.Entry<String, String> entry : requestPathParameterValues.entrySet()) {\n        String parameterName = entry.getKey();\n        final String parameterValue = entry.getValue();\n        final StringValuePattern pattern = pathParameters.get(parameterName);\n        if (pattern == null) continue;\n        String operator = generateOperatorString(pattern, \" = \");\n        DiffLine<String> section =\n            new DiffLine<>(\n                \"Path parameter\",\n                pattern,\n                parameterValue,\n                \"Path parameter: \" + parameterName + operator + pattern.getValue());\n        diffLineList.addAll(toDiffDescriptionLines(section));\n      }\n\n      diffLineList.add(SPACER);\n    }\n  }\n\n  private DiffLine<String> addUrlSectionWithSpacer(\n      UrlPattern urlPattern, List<DiffLine<?>> diffLineList) {\n    String printedUrlPattern = generatePrintedUrlPattern(urlPattern);\n    DiffLine<String> urlSection =\n        new DiffLine<>(\n            \"URL\",\n            urlPattern,\n            request.getPathAndQueryWithoutPrefix().toString(),\n            printedUrlPattern);\n    diffLineList.addAll(toDiffDescriptionLines(urlSection));\n    diffLineList.add(SPACER);\n    return urlSection;\n  }\n\n  private void addMethodSection(List<DiffLine<?>> diffLineList) {\n    DiffLine<RequestMethod> methodSection =\n        new DiffLine<>(\n            \"HTTP method\",\n            requestPattern.getMethod(),\n            request.getMethod(),\n            requestPattern.getMethod().getExpected());\n    diffLineList.addAll(toDiffDescriptionLines(methodSection));\n  }\n\n  private void addSchemeSectionIfPresent(List<DiffLine<?>> diffLineList) {\n    if (requestPattern.getScheme() != null) {\n      StringValuePattern expectedScheme = equalTo(String.valueOf(requestPattern.getScheme()));\n      DiffLine<String> schemeSection =\n          new DiffLine<>(\"Scheme\", expectedScheme, request.getScheme(), requestPattern.getScheme());\n      diffLineList.addAll(toDiffDescriptionLines(schemeSection));\n    }\n  }\n\n  private void addPortSectionIfPresent(List<DiffLine<?>> diffLineList) {\n    if (requestPattern.getPort() != null) {\n      StringValuePattern expectedPort = equalTo(String.valueOf(requestPattern.getPort()));\n      String actualPort = String.valueOf(request.getPort());\n      DiffLine<String> portSection =\n          new DiffLine<>(\"Port\", expectedPort, actualPort, expectedPort.getExpected());\n      diffLineList.addAll(toDiffDescriptionLines(portSection));\n    }\n  }\n\n  private void addClientIpSectionIfPresent(List<DiffLine<?>> diffLineList) {\n    if (requestPattern.getClientIp() != null) {\n      StringValuePattern expectedClientIp = equalTo(String.valueOf(requestPattern.getClientIp()));\n      String actualClientIp = request.getClientIp();\n      DiffLine<String> clientIpSection =\n          new DiffLine<>(\n              \"ClientIp\", expectedClientIp, actualClientIp, expectedClientIp.getExpected());\n      diffLineList.addAll(toDiffDescriptionLines(clientIpSection));\n    }\n  }\n\n  private void addHostSectionIfPresent(List<DiffLine<?>> diffLineList) {\n    if (requestPattern.getHost() != null) {\n      String hostOperator = generateOperatorString(requestPattern.getHost(), \"\");\n      String printedHostPatternValue = hostOperator + requestPattern.getHost().getExpected();\n      DiffLine<String> hostSection =\n          new DiffLine<>(\n              \"Host\", requestPattern.getHost(), request.getHost(), printedHostPatternValue.trim());\n      diffLineList.addAll(toDiffDescriptionLines(hostSection));\n    }\n  }\n\n  private static String buildScenarioLine(String scenarioName, String scenarioState) {\n    return \"[Scenario '\" + scenarioName + \"' state: \" + scenarioState + \"]\";\n  }\n\n  private void addHeaderSectionWithSpacerIfPresent(\n      Map<String, MultiValuePattern> headerPatterns,\n      HttpHeaders headers,\n      List<DiffLine<?>> diffLineList) {\n    if (headerPatterns != null && !headerPatterns.isEmpty()) {\n      for (String key : headerPatterns.keySet()) {\n        HttpHeader header = headers.getHeader(key);\n        MultiValuePattern headerPattern = headerPatterns.get(header.key());\n\n        String operator = generateOperatorStringForMultiValuePattern(headerPattern, \"\");\n        String expected =\n            isEmpty(headerPattern.getExpected()) ? \"\" : \": \" + headerPattern.getExpected();\n        String printedPatternValue = header.key() + operator + expected;\n\n        DiffLine<MultiValue> section =\n            new DiffLine<>(\"Header\", headerPattern, header, printedPatternValue);\n        diffLineList.addAll(toDiffDescriptionLines(section));\n      }\n      diffLineList.add(SPACER);\n    }\n  }\n\n  private void addBodySectionIfPresent(\n      List<ContentPattern<?>> bodyPatterns, Body body, List<DiffLine<?>> diffLineList) {\n    if (bodyPatterns != null && !bodyPatterns.isEmpty()) {\n      for (ContentPattern<?> pattern : bodyPatterns) {\n        String formattedBody = formatIfJsonOrXml(pattern, body);\n        if (PathPattern.class.isAssignableFrom(pattern.getClass())) {\n          PathPattern pathPattern = (PathPattern) pattern;\n          if (!pathPattern.isSimple()) {\n            String expressionResultString = getExpressionResultString(body, pathPattern);\n            String printedExpectedValue =\n                pathPattern.getExpected()\n                    + \" [\"\n                    + pathPattern.getValuePattern().getName()\n                    + \"] \"\n                    + pathPattern.getValuePattern().getExpected();\n            if (expressionResultString != null) {\n              diffLineList.addAll(\n                  toDiffDescriptionLines(\n                      new DiffLine<>(\n                          \"Body\",\n                          pathPattern.getValuePattern(),\n                          expressionResultString,\n                          printedExpectedValue)));\n            } else {\n              diffLineList.addAll(\n                  toDiffDescriptionLines(\n                      new DiffLine<>(\"Body\", pathPattern, formattedBody, printedExpectedValue)));\n            }\n          } else {\n            diffLineList.addAll(\n                toDiffDescriptionLines(\n                    new DiffLine<>(\"Body\", pathPattern, formattedBody, pattern.getExpected())));\n          }\n        } else if (StringValuePattern.class.isAssignableFrom(pattern.getClass())) {\n          StringValuePattern stringValuePattern = (StringValuePattern) pattern;\n          String printedPatternValue = \"[\" + pattern.getName() + \"]\\n\" + pattern.getExpected();\n          diffLineList.addAll(\n              toDiffDescriptionLines(\n                  new DiffLine<>(\n                      \"Body\", stringValuePattern, \"\\n\" + formattedBody, printedPatternValue)));\n        } else {\n          BinaryEqualToPattern nonStringPattern = (BinaryEqualToPattern) pattern;\n          diffLineList.addAll(\n              toDiffDescriptionLines(\n                  new DiffLine<>(\n                      \"Body\", nonStringPattern, formattedBody.getBytes(), pattern.getExpected())));\n        }\n      }\n    }\n  }\n\n  private void addBodySectionIfPresent(List<DiffLine<?>> builder) {\n    List<ContentPattern<?>> bodyPatterns = requestPattern.getBodyPatterns();\n    Body body = new Body(request.getBody());\n    addBodySectionIfPresent(bodyPatterns, body, builder);\n  }\n\n  private static String getExpressionResultString(Body body, PathPattern pathPattern) {\n    String bodyStr = body.asString();\n    if (isEmpty(bodyStr)) {\n      return null;\n    } else {\n      try {\n        ListOrSingle<String> expressionResult = pathPattern.getExpressionResult(bodyStr);\n        return expressionResult != null && !expressionResult.isEmpty()\n            ? expressionResult.toString()\n            : null;\n      } catch (Exception e) {\n        return null;\n      }\n    }\n  }\n\n  private String generatePrintedUrlPattern(UrlPattern urlPattern) {\n    String matchPart;\n    if (urlPattern instanceof UrlPathTemplatePattern) {\n      matchPart = \"path template\";\n    } else {\n      matchPart =\n          (urlPattern instanceof UrlPathPattern ? \"path\" : \"\")\n              + (urlPattern.isRegex() ? \" regex\" : \"\");\n    }\n\n    matchPart = matchPart.trim();\n\n    return matchPart.isEmpty()\n        ? urlPattern.getExpected()\n        : \"[\" + matchPart + \"] \" + urlPattern.getExpected();\n  }\n\n  private String generateOperatorString(ContentPattern<?> pattern, String defaultValue) {\n    return isAnEqualToPattern(pattern) ? defaultValue : \" [\" + pattern.getName() + \"] \";\n  }\n\n  private String generateOperatorStringForMultiValuePattern(\n      final MultiValuePattern valuePattern, final String defaultValue) {\n    if (valuePattern instanceof MultipleMatchMultiValuePattern) {\n      return ((MultipleMatchMultiValuePattern) valuePattern).getOperator()\n          + \"[\"\n          + valuePattern.getName()\n          + \"]\";\n    } else {\n      return isAnEqualToPattern(((SingleMatchMultiValuePattern) valuePattern).getValuePattern())\n          ? defaultValue\n          : \" [\" + valuePattern.getName() + \"] \";\n    }\n  }\n\n  public String getStubMappingName() {\n    return stubMappingName;\n  }\n\n  private static String formatIfJsonOrXml(ContentPattern<?> pattern, Body body) {\n    if (body == null || body.isAbsent()) {\n      return \"\";\n    }\n\n    try {\n      return pattern.getClass().equals(EqualToJsonPattern.class)\n          ? Json.prettyPrint(Json.write(body.asJson()))\n          : pattern.getClass().equals(EqualToXmlPattern.class)\n              ? Xml.prettyPrint(body.asString())\n              : pattern.getClass().equals(BinaryEqualToPattern.class)\n                  ? body.asBase64()\n                  : body.asString();\n    } catch (Exception e) {\n      return body.asString();\n    }\n  }\n\n  private static boolean isAnEqualToPattern(ContentPattern<?> pattern) {\n    return pattern instanceof EqualToPattern\n        || pattern instanceof EqualToJsonPattern\n        || pattern instanceof EqualToXmlPattern\n        || pattern instanceof BinaryEqualToPattern;\n  }\n\n  private Collection<? extends DiffLine<?>> toDiffDescriptionLines(DiffLine<?> diffLine) {\n    return diffLine.getDiffDescriptions().stream()\n        .map(\n            diffDescription ->\n                new DiffDescriptionLine<>(\n                    diffDescription, diffLine.requestAttribute, diffLine.isExactMatch()))\n        .collect(Collectors.toList());\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/DiffDescriptionLine.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport com.github.tomakehurst.wiremock.matching.MatchResult.DiffDescription;\n\npublic class DiffDescriptionLine<T> extends DiffLine<T> {\n\n  private final DiffDescription diffDescription;\n  private final Boolean isExactMatch;\n\n  public DiffDescriptionLine(\n      DiffDescription diffDescription, String requestAttribute, Boolean isExactMatch) {\n    super(requestAttribute, null, null, diffDescription.getExpected());\n    this.diffDescription = diffDescription;\n    this.isExactMatch = isExactMatch;\n  }\n\n  @Override\n  public Object getActual() {\n    return this.diffDescription.getActual();\n  }\n\n  @Override\n  public String getMessage() {\n    return this.diffDescription.getErrorMessage();\n  }\n\n  @Override\n  protected boolean isExactMatch() {\n    return this.isExactMatch;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/DiffEventData.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class DiffEventData {\n\n  public static final String KEY = \"DIFF_REPORT\";\n\n  private final int status;\n  private final String contentType;\n  private final String report;\n\n  public DiffEventData(\n      @JsonProperty(\"status\") int status,\n      @JsonProperty(\"contentType\") String contentType,\n      @JsonProperty(\"report\") String report) {\n    this.status = status;\n    this.contentType = contentType;\n    this.report = report;\n  }\n\n  public int getStatus() {\n    return status;\n  }\n\n  public String getContentType() {\n    return contentType;\n  }\n\n  public String getReport() {\n    return report;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/DiffLine.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport static com.github.tomakehurst.wiremock.common.Strings.isEmpty;\n\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.MatchResult.DiffDescription;\nimport com.github.tomakehurst.wiremock.matching.NamedValueMatcher;\nimport com.github.tomakehurst.wiremock.matching.UrlPattern;\nimport java.util.List;\n\nclass DiffLine<V> {\n\n  protected final String requestAttribute;\n  protected final NamedValueMatcher<V> pattern;\n  protected final V value;\n  protected final String printedPatternValue;\n\n  public DiffLine(\n      String requestAttribute, NamedValueMatcher<V> pattern, V value, String printedPatternValue) {\n    this.requestAttribute = requestAttribute;\n    this.pattern = pattern;\n    this.value = value;\n    this.printedPatternValue = printedPatternValue;\n  }\n\n  public String getRequestAttribute() {\n    return requestAttribute;\n  }\n\n  public Object getActual() {\n    return value;\n  }\n\n  public String getPrintedPatternValue() {\n    return printedPatternValue;\n  }\n\n  public boolean isForNonMatch() {\n    return !isExactMatch();\n  }\n\n  protected boolean isExactMatch() {\n    return pattern.match(value).isExactMatch();\n  }\n\n  public String getMessage() {\n    String message;\n    if (value == null || isEmpty(value.toString())) {\n      message = requestAttribute + \" is not present\";\n    } else {\n      message = isExactMatch() ? null : requestAttribute + \" does not match\";\n    }\n\n    if (isUrlRegexPattern() && !anyQuestionsMarksAreEscaped(pattern.getExpected())) {\n      message += \". When using a regex, \\\"?\\\" should be \\\"\\\\?\\\"\";\n    }\n\n    if (pattern instanceof UrlPattern\n        && pattern != UrlPattern.ANY\n        && !pattern.getExpected().startsWith(\"/\")) {\n      message += \". URLs must start with a /\";\n    }\n\n    return message;\n  }\n\n  private static boolean anyQuestionsMarksAreEscaped(String s) {\n    int index = s.indexOf('?');\n    if (index == -1) {\n      return true;\n    }\n\n    if (index < 2) {\n      return false;\n    }\n\n    String sub = s.substring(index - 1, index);\n    return sub.equals(\"\\\\\");\n  }\n\n  private boolean isUrlRegexPattern() {\n    return pattern instanceof UrlPattern && ((UrlPattern) pattern).isRegex();\n  }\n\n  public List<DiffDescription> getDiffDescriptions() {\n    List<DiffDescription> diffDescriptions = getMatchResult().getDiffDescriptions();\n    if (diffDescriptions.isEmpty()) {\n      return List.of(\n          new DiffDescription(\n              this.getPrintedPatternValue(), this.getActual().toString(), this.getMessage()));\n    }\n    return diffDescriptions;\n  }\n\n  public MatchResult getMatchResult() {\n    return pattern.match(value);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/EmptyToStringRequestWrapper.java",
    "content": "/*\n * Copyright (C) 2018-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.util.Collection;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport org.jspecify.annotations.NonNull;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\n\npublic class EmptyToStringRequestWrapper implements Request {\n\n  private final Request target;\n\n  public EmptyToStringRequestWrapper(Request target) {\n    this.target = target;\n  }\n\n  @Override\n  public @NonNull String getUrl() {\n    return target.getUrl();\n  }\n\n  @Override\n  public @NonNull PathAndQuery getPathAndQueryWithoutPrefix() {\n    return target.getPathAndQueryWithoutPrefix();\n  }\n\n  @Override\n  public @Nullable String getAbsoluteUrl() {\n    return target.getAbsoluteUrl();\n  }\n\n  @Override\n  public @Nullable AbsoluteUrl getTypedAbsoluteUrl() {\n    return target.getTypedAbsoluteUrl();\n  }\n\n  @Override\n  public RequestMethod getMethod() {\n    return target.getMethod();\n  }\n\n  @Override\n  public String getScheme() {\n    return target.getScheme();\n  }\n\n  @Override\n  public String getHost() {\n    return target.getHost();\n  }\n\n  @Override\n  public int getPort() {\n    return target.getPort();\n  }\n\n  @Override\n  public String getClientIp() {\n    return target.getClientIp();\n  }\n\n  @Override\n  public String getHeader(String key) {\n    return target.getHeader(key);\n  }\n\n  @Override\n  public HttpHeader header(String key) {\n    return target.header(key);\n  }\n\n  @Override\n  public ContentTypeHeader contentTypeHeader() {\n    return target.contentTypeHeader();\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    return target.getHeaders();\n  }\n\n  @Override\n  public boolean containsHeader(String key) {\n    return target.containsHeader(key);\n  }\n\n  @Override\n  public Set<String> getAllHeaderKeys() {\n    return target.getAllHeaderKeys();\n  }\n\n  @Override\n  public Map<String, Cookie> getCookies() {\n    return target.getCookies();\n  }\n\n  @Override\n  public QueryParameter queryParameter(String key) {\n    return target.queryParameter(key);\n  }\n\n  @Override\n  public FormParameter formParameter(String key) {\n    return target.formParameter(key);\n  }\n\n  @Override\n  public Map<String, FormParameter> formParameters() {\n    return target.formParameters();\n  }\n\n  @Override\n  public byte[] getBody() {\n    return target.getBody();\n  }\n\n  @Override\n  public String getBodyAsString() {\n    return target.getBodyAsString();\n  }\n\n  @Override\n  public String getBodyAsBase64() {\n    return target.getBodyAsBase64();\n  }\n\n  @Override\n  public boolean isMultipart() {\n    return target.isMultipart();\n  }\n\n  @Override\n  public Collection<Part> getParts() {\n    return target.getParts();\n  }\n\n  @Override\n  public Part getPart(String name) {\n    return target.getPart(name);\n  }\n\n  @Override\n  public boolean isBrowserProxyRequest() {\n    return target.isBrowserProxyRequest();\n  }\n\n  @Override\n  public Optional<Request> getOriginalRequest() {\n    return target.getOriginalRequest();\n  }\n\n  @Override\n  public String getProtocol() {\n    return target.getProtocol();\n  }\n\n  @Override\n  public String toString() {\n    return \" \";\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/InlineCustomMatcherLine.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.ValueMatcher;\n\npublic class InlineCustomMatcherLine extends DiffLine<Request> {\n\n  public InlineCustomMatcherLine(ValueMatcher<Request> customMatcher, Request request) {\n    super(\n        \"custom matcher\",\n        new CustomMatcherWrapper(customMatcher),\n        new EmptyToStringRequestWrapper(request),\n        \"[custom matcher]\");\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/JUnitStyleDiffRenderer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport java.util.List;\nimport java.util.function.Function;\nimport java.util.stream.Collectors;\n\npublic class JUnitStyleDiffRenderer {\n\n  public String render(Diff diff) {\n    List<DiffLine<?>> lines = diff.getLines();\n\n    String expected =\n        lines.stream().map(EXPECTED).map(Object::toString).collect(Collectors.joining(\"\\n\"));\n\n    String actual =\n        lines.stream().map(ACTUAL).map(Object::toString).collect(Collectors.joining(\"\\n\"));\n\n    return lines.isEmpty() ? \"\" : junitStyleDiffMessage(expected, actual);\n  }\n\n  public static String junitStyleDiffMessage(Object expected, Object actual) {\n    return String.format(\n        \" expected:<%n%s> but was:<%n%s>\",\n        Strings.normaliseLineBreaks(expected.toString()),\n        Strings.normaliseLineBreaks(actual.toString()));\n  }\n\n  private static final Function<DiffLine<?>, Object> EXPECTED =\n      line -> line.isForNonMatch() ? line.getPrintedPatternValue() : line.getActual();\n\n  private static final Function<DiffLine<?>, Object> ACTUAL = DiffLine::getActual;\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/MissingMultipart.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport com.github.tomakehurst.wiremock.http.Body;\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.Request;\n\npublic class MissingMultipart implements Request.Part {\n\n  @Override\n  public String getName() {\n    return \"[request is not multipart]\";\n  }\n\n  @Override\n  public String getFileName() {\n    return \"[request is not multipart]\";\n  }\n\n  @Override\n  public HttpHeader getHeader(String name) {\n    return HttpHeader.absent(name);\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    return new HttpHeaders();\n  }\n\n  @Override\n  public Body getBody() {\n    return null;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/NamedCustomMatcherLine.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\n\npublic class NamedCustomMatcherLine extends DiffLine<Request> {\n\n  private final RequestMatcherExtension customMatcher;\n  private final Parameters parameters;\n\n  public NamedCustomMatcherLine(\n      RequestMatcherExtension customMatcher, Parameters parameters, Request request) {\n    super(\n        \"custom matcher\",\n        customMatcher,\n        new EmptyToStringRequestWrapper(request),\n        \"[custom matcher: \" + customMatcher.getName() + \"]\");\n    this.customMatcher = customMatcher;\n    this.parameters = parameters;\n  }\n\n  @Override\n  protected boolean isExactMatch() {\n    return getMatchResult().isExactMatch();\n  }\n\n  @Override\n  public MatchResult getMatchResult() {\n    return customMatcher.match(value, parameters);\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/PlainTextDiffRenderer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport static com.github.tomakehurst.wiremock.common.Strings.isNotEmpty;\nimport static com.github.tomakehurst.wiremock.common.Strings.normaliseLineBreaks;\nimport static com.github.tomakehurst.wiremock.common.Strings.rightPad;\nimport static java.lang.System.lineSeparator;\n\nimport com.github.tomakehurst.wiremock.common.Strings;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport java.util.Map;\n\npublic class PlainTextDiffRenderer {\n\n  private final String SEPARATOR = lineSeparator();\n\n  private final int consoleWidth;\n  private final Map<String, RequestMatcherExtension> customMatcherExtensions;\n\n  public PlainTextDiffRenderer(Map<String, RequestMatcherExtension> customMatcherExtensions) {\n    this(customMatcherExtensions, 119);\n  }\n\n  public PlainTextDiffRenderer(\n      Map<String, RequestMatcherExtension> customMatcherExtensions, int consoleWidth) {\n    this.customMatcherExtensions = customMatcherExtensions;\n    this.consoleWidth = consoleWidth;\n  }\n\n  public String render(Diff diff) {\n    StringBuilder sb = new StringBuilder();\n    header(sb);\n\n    if (diff.getStubMappingName() != null) {\n      writeLine(sb, diff.getStubMappingName(), \"\", null);\n      writeBlankLine(sb);\n    }\n\n    for (DiffLine<?> line : diff.getLines(customMatcherExtensions)) {\n      boolean isBodyLine = line.getRequestAttribute().equals(\"Body\");\n      if (!isBodyLine || line.isForNonMatch()) {\n        writeLine(\n            sb, line.getPrintedPatternValue(), line.getActual().toString(), line.getMessage());\n      }\n    }\n\n    writeBlankLine(sb);\n    footer(sb);\n\n    return sb.toString();\n  }\n\n  private void header(StringBuilder sb) {\n    String titleLine = \"Request was not matched\";\n    int middle = getMiddle();\n    int titleLinePaddingLeft = middle - (titleLine.length() / 2);\n    sb.append(SEPARATOR)\n        .append(String.valueOf(' ').repeat(titleLinePaddingLeft))\n        .append(titleLine)\n        .append(SEPARATOR)\n        .append(String.valueOf(' ').repeat(titleLinePaddingLeft))\n        .append(String.valueOf('=').repeat(titleLine.length()))\n        .append(SEPARATOR)\n        .append(SEPARATOR)\n        .append(String.valueOf('-').repeat(consoleWidth))\n        .append(SEPARATOR)\n        .append('|')\n        .append(rightPad(\" Closest stub\", middle))\n        .append('|')\n        .append(rightPad(\" Request\", middle, ' '))\n        .append('|')\n        .append(SEPARATOR)\n        .append(String.valueOf('-').repeat(consoleWidth))\n        .append(SEPARATOR);\n\n    writeBlankLine(sb);\n  }\n\n  private void footer(StringBuilder sb) {\n    sb.append(String.valueOf('-').repeat(consoleWidth)).append(SEPARATOR);\n  }\n\n  private void writeLine(StringBuilder sb, String left, String right, String message) {\n    String[] leftLines = wrap(normaliseLineBreaks(left)).split(SEPARATOR);\n    String[] rightLines = wrap(normaliseLineBreaks(right)).split(SEPARATOR);\n\n    int maxLines = Math.max(leftLines.length, rightLines.length);\n\n    writeSingleLine(sb, firstOrEmpty(leftLines), firstOrEmpty(rightLines), message);\n\n    if (maxLines > 1) {\n      for (int i = 1; i < maxLines; i++) {\n        String leftPart = leftLines.length > i ? leftLines[i] : \"\";\n        String rightPart = rightLines.length > i ? rightLines[i] : \"\";\n        writeSingleLine(sb, leftPart, rightPart, null);\n      }\n    }\n  }\n\n  private static String firstOrEmpty(String[] lines) {\n    return lines.length > 0 ? lines[0] : \"\";\n  }\n\n  private void writeBlankLine(StringBuilder sb) {\n    writeSingleLine(sb, \"\", null, null);\n  }\n\n  private void writeSingleLine(StringBuilder sb, String left, String right, String message) {\n    sb.append(rightPad(left, getMiddle() + 1, \" \")).append(\"|\");\n\n    if (isNotEmpty(right)) {\n      sb.append(\" \");\n\n      if (isNotEmpty(message)) {\n        sb.append(rightPad(right, getMiddle() - 6, \" \")).append(\"<<<<< \").append(message);\n      } else {\n        sb.append(right);\n      }\n    } else {\n      if (isNotEmpty(message)) {\n        sb.append(rightPad(right, getMiddle() - 5, \" \")).append(\"<<<<< \").append(message);\n      }\n    }\n\n    sb.append(SEPARATOR);\n  }\n\n  private String wrap(String s) {\n    String safeString = s == null ? \"\" : s;\n    return Strings.wrapIfLongestLineExceedsLimit(safeString, getColumnWidth());\n  }\n\n  private int getColumnWidth() {\n    return (consoleWidth / 2) - 2;\n  }\n\n  private int getMiddle() {\n    return (consoleWidth / 2) - 1;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/SectionDelimiter.java",
    "content": "/*\n * Copyright (C) 2018-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\nimport com.github.tomakehurst.wiremock.matching.EqualToPattern;\n\npublic class SectionDelimiter extends DiffLine<String> {\n\n  public SectionDelimiter(String title) {\n    super(title, new EqualToPattern(title), title, title);\n  }\n\n  public SectionDelimiter(String left, String right) {\n    super(left, new EqualToPattern(left), right, left);\n  }\n\n  @Override\n  protected boolean isExactMatch() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/diff/SpacerLine.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.diff;\n\npublic class SpacerLine extends DiffLine<Void> {\n\n  public static SpacerLine SPACER = new SpacerLine();\n\n  public SpacerLine() {\n    super(\"spacer\", null, null, \"\");\n  }\n\n  @Override\n  public Object getActual() {\n    return \"\";\n  }\n\n  @Override\n  public String getMessage() {\n    return null;\n  }\n\n  @Override\n  protected boolean isExactMatch() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/notmatched/NotMatchedRenderer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.notmatched;\n\nimport com.github.tomakehurst.wiremock.admin.AdminTask;\nimport com.github.tomakehurst.wiremock.common.url.PathParams;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic abstract class NotMatchedRenderer implements AdminTask {\n\n  @Override\n  public ResponseDefinition execute(Admin admin, ServeEvent serveEvent, PathParams pathParams) {\n    return render(admin, serveEvent);\n  }\n\n  protected abstract ResponseDefinition render(Admin admin, ServeEvent serveEvent);\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/com/github/tomakehurst/wiremock/verification/notmatched/PlainTextStubNotMatchedRenderer.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.verification.notmatched;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_TYPE;\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\n\nimport com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.Extensions;\nimport com.github.tomakehurst.wiremock.http.ResponseDefinition;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport com.github.tomakehurst.wiremock.verification.NearMiss;\nimport com.github.tomakehurst.wiremock.verification.diff.Diff;\nimport com.github.tomakehurst.wiremock.verification.diff.PlainTextDiffRenderer;\nimport java.util.List;\nimport java.util.Map;\n\npublic class PlainTextStubNotMatchedRenderer extends NotMatchedRenderer {\n\n  public static final String CONSOLE_WIDTH_HEADER_KEY = \"X-WireMock-Console-Width\";\n\n  private final Extensions extensions;\n\n  public PlainTextStubNotMatchedRenderer(Extensions extensions) {\n    this.extensions = extensions;\n  }\n\n  @Override\n  public ResponseDefinition render(Admin admin, ServeEvent serveEvent) {\n    LoggedRequest loggedRequest = serveEvent.getRequest();\n    List<NearMiss> nearMisses = admin.findTopNearMissesFor(loggedRequest).getNearMisses();\n\n    Map<String, RequestMatcherExtension> customMatcherExtensions =\n        extensions.ofType(RequestMatcherExtension.class);\n\n    PlainTextDiffRenderer diffRenderer =\n        loggedRequest.containsHeader(CONSOLE_WIDTH_HEADER_KEY)\n            ? new PlainTextDiffRenderer(\n                customMatcherExtensions,\n                Integer.parseInt(loggedRequest.getHeader(CONSOLE_WIDTH_HEADER_KEY)))\n            : new PlainTextDiffRenderer(customMatcherExtensions);\n\n    String body;\n    if (nearMisses.isEmpty()) {\n      body = \"No response could be served as there are no stub mappings in this WireMock instance.\";\n    } else {\n      Diff firstDiff = nearMisses.get(0).getDiff();\n      body = diffRenderer.render(firstDiff);\n    }\n\n    notifier().error(body);\n\n    return ResponseDefinitionBuilder.responseDefinition()\n        .withStatus(404)\n        .withHeader(CONTENT_TYPE, \"text/plain\")\n        .withBody(body)\n        .build();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/org/wiremock/annotations/Beta.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage org.wiremock.annotations;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n/**\n * Indicates that the class or a method represent preview Beta API that might change in the future\n * as a part of the minor release.\n *\n * @since 3.0.0\n */\n@Retention(RetentionPolicy.RUNTIME)\n@Target({ElementType.TYPE, ElementType.METHOD})\npublic @interface Beta {\n\n  public String justification() default \"\";\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/org/wiremock/annotations/InternalAPI.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage org.wiremock.annotations;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n/**\n * This item, while being declared as public or protected, is shared only for internal needs and not\n * supposed to be used outside the project. The API may change in minor and patch releases without\n * advance notice.\n *\n * <p>The annotation will be replaced by sealed classes after updating to Java 17. It is not\n * expected to be used outside the project on its own.\n *\n * @since 3.0.0\n */\n@Retention(RetentionPolicy.RUNTIME)\n@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})\npublic @interface InternalAPI {\n\n  public String justification() default \"\";\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/org/wiremock/webhooks/WebhookDefinition.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage org.wiremock.webhooks;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.decodeBase64;\nimport static java.util.Collections.singletonList;\n\nimport com.fasterxml.jackson.annotation.JsonAnyGetter;\nimport com.fasterxml.jackson.annotation.JsonAnySetter;\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.github.tomakehurst.wiremock.common.Metadata;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.*;\nimport java.net.URI;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Collectors;\n\npublic class WebhookDefinition {\n\n  private String method;\n  private String url;\n  private List<HttpHeader> headers;\n  private Body body = Body.none();\n  private DelayDistribution delay;\n  private Parameters parameters;\n\n  public static WebhookDefinition from(Parameters parameters) {\n    return new WebhookDefinition(\n        parameters.getString(\"method\", \"GET\"),\n        parameters.getString(\"url\"),\n        toHttpHeaders(parameters.getMetadata(\"headers\", null)),\n        parameters.getString(\"body\", null),\n        parameters.getString(\"base64Body\", null),\n        getDelayDistribution(parameters.getMetadata(\"delay\", null)),\n        parameters);\n  }\n\n  private static HttpHeaders toHttpHeaders(Metadata headerMap) {\n    if (headerMap == null || headerMap.isEmpty()) {\n      return null;\n    }\n\n    return new HttpHeaders(\n        headerMap.entrySet().stream()\n            .map(entry -> new HttpHeader(entry.getKey(), getHeaderValues(entry.getValue())))\n            .collect(Collectors.toList()));\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private static Collection<String> getHeaderValues(Object obj) {\n    if (obj == null) {\n      return null;\n    }\n\n    if (obj instanceof List) {\n      return ((List<String>) obj);\n    }\n\n    return singletonList(obj.toString());\n  }\n\n  private static DelayDistribution getDelayDistribution(Metadata delayParams) {\n    if (delayParams == null) {\n      return null;\n    }\n\n    return delayParams.as(DelayDistribution.class);\n  }\n\n  @JsonCreator\n  public WebhookDefinition(\n      String method,\n      String url,\n      HttpHeaders headers,\n      String body,\n      String base64Body,\n      DelayDistribution delay,\n      Parameters parameters) {\n    this.method = method;\n    this.url = url;\n    this.headers = headers != null ? new ArrayList<>(headers.all()) : null;\n\n    if (body != null) {\n      this.body = new Body(body);\n    } else if (base64Body != null) {\n      this.body = new Body(decodeBase64(base64Body));\n    }\n\n    this.delay = delay;\n    this.parameters = parameters;\n  }\n\n  public WebhookDefinition() {}\n\n  public String getMethod() {\n    return method;\n  }\n\n  @JsonIgnore\n  public RequestMethod getRequestMethod() {\n    return RequestMethod.fromString(method);\n  }\n\n  public String getUrl() {\n    return url;\n  }\n\n  public HttpHeaders getHeaders() {\n    return new HttpHeaders(headers);\n  }\n\n  public String getBase64Body() {\n    return body.isBinary() ? body.asBase64() : null;\n  }\n\n  public String getBody() {\n    return body.isBinary() ? null : body.asString();\n  }\n\n  public DelayDistribution getDelay() {\n    return delay;\n  }\n\n  @JsonIgnore\n  public long getDelaySampleMillis() {\n    return delay != null ? delay.sampleMillis() : 0L;\n  }\n\n  @JsonIgnore\n  public Parameters getExtraParameters() {\n    return parameters;\n  }\n\n  @JsonIgnore\n  public byte[] getBinaryBody() {\n    return body.asBytes();\n  }\n\n  public WebhookDefinition withMethod(String method) {\n    this.method = method;\n    return this;\n  }\n\n  public WebhookDefinition withMethod(RequestMethod method) {\n    this.method = method.getName();\n    return this;\n  }\n\n  public WebhookDefinition withUrl(URI url) {\n    this.url = url.toString();\n    return this;\n  }\n\n  public WebhookDefinition withUrl(String url) {\n    this.url = url;\n    return this;\n  }\n\n  public WebhookDefinition withHeaders(List<HttpHeader> headers) {\n    this.headers = headers;\n    return this;\n  }\n\n  public WebhookDefinition withHeader(String key, String... values) {\n    if (headers == null) {\n      headers = new ArrayList<>();\n    }\n\n    headers.add(new HttpHeader(key, values));\n    return this;\n  }\n\n  public WebhookDefinition withBody(String body) {\n    this.body = new Body(body);\n    return this;\n  }\n\n  public WebhookDefinition withBinaryBody(byte[] body) {\n    this.body = new Body(body);\n    return this;\n  }\n\n  public WebhookDefinition withFixedDelay(int delayMilliseconds) {\n    this.delay = new FixedDelayDistribution(delayMilliseconds);\n    return this;\n  }\n\n  public WebhookDefinition withDelay(DelayDistribution delay) {\n    this.delay = delay;\n    return this;\n  }\n\n  @JsonAnyGetter\n  public Map<String, Object> getOtherFields() {\n    return parameters;\n  }\n\n  @JsonAnySetter\n  public WebhookDefinition withExtraParameter(String key, Object value) {\n    if (parameters == null) {\n      parameters = Parameters.one(key, value);\n    } else {\n      parameters = parameters.merge(Parameters.one(key, value));\n    }\n    return this;\n  }\n\n  @JsonIgnore\n  public boolean hasBody() {\n    return body != null && body.isPresent();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/org/wiremock/webhooks/WebhookTransformer.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage org.wiremock.webhooks;\n\nimport com.github.tomakehurst.wiremock.extension.Extension;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\n\npublic interface WebhookTransformer extends Extension {\n\n  WebhookDefinition transform(ServeEvent serveEvent, WebhookDefinition webhookDefinition);\n\n  // Defaulting this for backwards compatibility\n  default String getName() {\n    return \"webhook-transformer-\" + this.getClass().getSimpleName();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/java/org/wiremock/webhooks/Webhooks.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage org.wiremock.webhooks;\n\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\nimport static java.util.stream.Collectors.toList;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.core.Admin;\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.extension.PostServeAction;\nimport com.github.tomakehurst.wiremock.extension.ServeEventListener;\nimport com.github.tomakehurst.wiremock.extension.WireMockServices;\nimport com.github.tomakehurst.wiremock.extension.responsetemplating.TemplateEngine;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.stubbing.SubEvent;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport java.util.*;\nimport java.util.concurrent.ScheduledExecutorService;\n\n@SuppressWarnings(\"deprecation\") // maintaining PostServeAction for backwards compatibility\npublic class Webhooks extends PostServeAction implements ServeEventListener {\n\n  private final ScheduledExecutorService scheduler;\n  private final HttpClient httpClient;\n  private final List<WebhookTransformer> transformers;\n  private final TemplateEngine templateEngine;\n  private final DataTruncationSettings dataTruncationSettings;\n\n  public Webhooks(\n      WireMockServices wireMockServices,\n      ScheduledExecutorService scheduler,\n      List<WebhookTransformer> transformers) {\n\n    this.scheduler = scheduler;\n    this.httpClient = wireMockServices.getDefaultHttpClient();\n    this.transformers = transformers;\n    this.templateEngine = wireMockServices.getTemplateEngine();\n    this.dataTruncationSettings = wireMockServices.getOptions().getDataTruncationSettings();\n  }\n\n  @Override\n  public String getName() {\n    return \"webhook\";\n  }\n\n  @Override\n  public void afterComplete(ServeEvent serveEvent, Parameters parameters) {\n    triggerWebhook(serveEvent, parameters);\n  }\n\n  @Override\n  public void doAction(\n      final ServeEvent serveEvent, final Admin admin, final Parameters parameters) {\n    triggerWebhook(serveEvent, parameters);\n  }\n\n  private void triggerWebhook(ServeEvent serveEvent, Parameters parameters) {\n    final Notifier notifier = notifier();\n\n    WebhookDefinition definition;\n    Request request;\n    try {\n      definition = WebhookDefinition.from(parameters);\n      for (WebhookTransformer transformer : transformers) {\n        definition = transformer.transform(serveEvent, definition);\n      }\n      definition = applyTemplating(definition, serveEvent);\n      request = buildRequest(definition);\n\n      serveEvent.appendSubEvent(\"WEBHOOK_REQUEST\", LoggedRequest.createFrom(request));\n    } catch (Exception e) {\n      final String msg = \"Exception thrown while configuring webhook\";\n      notifier().error(msg, e);\n      serveEvent.appendSubEvent(SubEvent.error(msg + \": \" + e.getMessage()));\n      return;\n    }\n\n    final WebhookDefinition finalDefinition = definition;\n    scheduler.schedule(\n        () -> {\n          try {\n            Response response = httpClient.execute(request);\n            notifier.info(\n                String.format(\n                    \"Webhook %s request to %s returned status %s\\n\\n%s\",\n                    finalDefinition.getMethod(),\n                    finalDefinition.getUrl(),\n                    response.getStatus(),\n                    response.getBodyAsString()));\n            serveEvent.appendSubEvent(\n                \"WEBHOOK_RESPONSE\",\n                LoggedResponse.from(\n                    response, this.dataTruncationSettings.getMaxResponseBodySize()));\n          } catch (ProhibitedNetworkAddressException e) {\n            final String msg =\n                String.format(\n                    \"The target webhook address %s specified by stub %s is denied in WireMock's configuration.\",\n                    finalDefinition.getUrl(),\n                    getFirstNonNull(\n                        serveEvent.getStubMapping().getName(),\n                        serveEvent.getStubMapping().getId(),\n                        \"<no name or id>\"));\n            notifier.error(msg);\n            serveEvent.appendSubEvent(SubEvent.error(msg));\n          } catch (Exception e) {\n            final String msg =\n                String.format(\n                    \"Failed to fire webhook %s %s\",\n                    finalDefinition.getMethod(), finalDefinition.getUrl());\n            notifier.error(msg, e);\n            serveEvent.appendSubEvent(SubEvent.error(msg + \": \" + e.getMessage()));\n          }\n        },\n        finalDefinition.getDelaySampleMillis(),\n        MILLISECONDS);\n  }\n\n  private WebhookDefinition applyTemplating(\n      WebhookDefinition webhookDefinition, ServeEvent serveEvent) {\n\n    final Map<String, Object> model =\n        new HashMap<>(this.templateEngine.buildModelForRequest(serveEvent));\n    model.put(\n        \"parameters\",\n        webhookDefinition.getExtraParameters() != null\n            ? webhookDefinition.getExtraParameters()\n            : Collections.<String, Object>emptyMap());\n    model.put(\"originalRequest\", model.get(\"request\"));\n    model.remove(\"request\");\n\n    WebhookDefinition renderedWebhookDefinition =\n        webhookDefinition\n            .withUrl(renderTemplate(model, webhookDefinition.getUrl()))\n            .withMethod(renderTemplate(model, webhookDefinition.getMethod()))\n            .withHeaders(\n                webhookDefinition.getHeaders().all().stream()\n                    .map(\n                        header ->\n                            new HttpHeader(\n                                header.key(),\n                                header.values().stream()\n                                    .map(value -> renderTemplate(model, value))\n                                    .collect(toList())))\n                    .collect(toList()));\n\n    if (webhookDefinition.getBody() != null) {\n      renderedWebhookDefinition =\n          webhookDefinition.withBody(renderTemplate(model, webhookDefinition.getBody()));\n    }\n\n    return renderedWebhookDefinition;\n  }\n\n  private String renderTemplate(Object context, String value) {\n    return templateEngine.getUncachedTemplate(value).apply(context);\n  }\n\n  private static Request buildRequest(WebhookDefinition definition) {\n    final ImmutableRequest.Builder requestBuilder =\n        ImmutableRequest.create()\n            .withMethod(definition.getRequestMethod())\n            .withAbsoluteUrl(definition.getUrl())\n            .withHeaders(definition.getHeaders());\n\n    if (definition.getRequestMethod().hasEntity() && definition.hasBody()) {\n      requestBuilder.withBody(definition.getBinaryBody());\n    }\n\n    return requestBuilder.build();\n  }\n\n  @Override\n  public boolean applyGlobally() {\n    return false;\n  }\n\n  public static WebhookDefinition webhook() {\n    return new WebhookDefinition();\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/by-metadata-request.yaml",
    "content": "matchesJsonPath:\n  expression: '$.outer'\n  equalToJson: '{ \"inner\": 42 }'\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/health.yaml",
    "content": "status: \"healthy\"\nmessage: \"Wiremock is ok\"\nversion: \"3.8.0\"\nuptimeInSeconds: 14355\ntimestamp: \"2024-07-03T13:16:06.172362Z\""
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/logged-message-channel.json",
    "content": "{\n  \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n  \"type\": \"websocket\",\n  \"initiatingRequest\": {\n    \"url\": \"/ws/chat\",\n    \"absoluteUrl\": \"http://localhost:8080/ws/chat\",\n    \"method\": \"GET\",\n    \"clientIp\": \"127.0.0.1\",\n    \"headers\": {\n      \"Host\": \"localhost:8080\",\n      \"Upgrade\": \"websocket\",\n      \"Connection\": \"Upgrade\"\n    },\n    \"cookies\": {},\n    \"browserProxyRequest\": false,\n    \"loggedDate\": 1609459200000,\n    \"loggedDateString\": \"2021-01-01T00:00:00Z\"\n  },\n  \"open\": true\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/logged-request.yaml",
    "content": "url: \"/actual\"\nabsoluteUrl: http://localhost:8080/actual\nmethod: GET\nclientIp: '0:0:0:0:0:0:0:1'\nheaders:\n  User-Agent: curl/7.30.0\n  Accept: \"*/*\"\n  Host: localhost:8080\ncookies: {}\nbrowserProxyRequest: false\nloggedDate: 1467402464520\nbodyAsBase64: ''\nbody: ''\nloggedDateString: '2016-07-01T19:47:44Z'\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/message-channels.json",
    "content": "{\n  \"channels\": [\n    {\n      \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n      \"type\": \"websocket\",\n      \"initiatingRequest\": {\n        \"url\": \"/ws/chat\",\n        \"method\": \"GET\"\n      },\n      \"open\": true\n    },\n    {\n      \"id\": \"b2c3d4e5-f6a7-8901-bcde-f12345678901\",\n      \"type\": \"websocket\",\n      \"initiatingRequest\": {\n        \"url\": \"/ws/notifications\",\n        \"method\": \"GET\"\n      },\n      \"open\": true\n    }\n  ],\n  \"meta\": {\n    \"total\": 2\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/message-pattern.json",
    "content": "{\n  \"channel\": {\n    \"urlPath\": \"/ws/chat\",\n    \"method\": \"GET\"\n  },\n  \"body\": {\n    \"contains\": \"hello\"\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/message-serve-event.json",
    "content": "{\n  \"id\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n  \"eventType\": \"RECEIVED\",\n  \"channelType\": \"websocket\",\n  \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n  \"channelRequest\": {\n    \"url\": \"/ws/chat\",\n    \"absoluteUrl\": \"http://localhost:8080/ws/chat\",\n    \"method\": \"GET\",\n    \"clientIp\": \"127.0.0.1\",\n    \"headers\": {\n      \"Host\": \"localhost:8080\",\n      \"Upgrade\": \"websocket\",\n      \"Connection\": \"Upgrade\"\n    },\n    \"cookies\": {},\n    \"browserProxyRequest\": false,\n    \"loggedDate\": 1609459200000,\n    \"loggedDateString\": \"2021-01-01T00:00:00Z\"\n  },\n  \"message\": \"Hello, WebSocket!\",\n  \"stubMapping\": {\n    \"id\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n    \"name\": \"Echo WebSocket messages\",\n    \"trigger\": {\n      \"type\": \"message\",\n      \"channel\": {\n        \"type\": \"websocket\",\n        \"initiatingRequestPattern\": {\n          \"urlPath\": \"/ws/chat\"\n        }\n      }\n    },\n    \"actions\": [\n      {\n        \"type\": \"send\",\n        \"message\": {\n          \"body\": {\n            \"data\": \"Echo: Hello, WebSocket!\"\n          }\n        },\n        \"channelTarget\": {\n          \"type\": \"originating\"\n        }\n      }\n    ]\n  },\n  \"wasMatched\": true,\n  \"timestamp\": \"2021-01-01T00:00:00Z\",\n  \"subEvents\": []\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/message-serve-events.json",
    "content": "{\n  \"messageServeEvents\": [\n    {\n      \"id\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n      \"eventType\": \"RECEIVED\",\n      \"channelType\": \"websocket\",\n      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n      \"channelRequest\": {\n        \"url\": \"/ws/chat\",\n        \"method\": \"GET\"\n      },\n      \"message\": \"Hello, WebSocket!\",\n      \"wasMatched\": true,\n      \"timestamp\": \"2021-01-01T00:00:00Z\"\n    },\n    {\n      \"id\": \"98765432-abcd-ef12-3456-7890abcdef12\",\n      \"eventType\": \"SENT\",\n      \"channelType\": \"websocket\",\n      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n      \"channelRequest\": {\n        \"url\": \"/ws/chat\",\n        \"method\": \"GET\"\n      },\n      \"message\": \"Echo: Hello, WebSocket!\",\n      \"wasMatched\": true,\n      \"timestamp\": \"2021-01-01T00:00:01Z\"\n    }\n  ],\n  \"messageJournalDisabled\": false\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/message-stub-mapping.json",
    "content": "{\n  \"id\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n  \"name\": \"Echo WebSocket messages\",\n  \"priority\": 5,\n  \"trigger\": {\n    \"type\": \"message\",\n    \"channel\": {\n      \"type\": \"websocket\",\n      \"initiatingRequestPattern\": {\n        \"urlPath\": \"/ws/echo\"\n      }\n    },\n    \"message\": {\n      \"body\": {\n        \"contains\": \"hello\"\n      }\n    }\n  },\n  \"actions\": [\n    {\n      \"type\": \"send\",\n      \"message\": {\n        \"body\": {\n          \"data\": \"Echo: hello\"\n        }\n      },\n      \"channelTarget\": {\n        \"type\": \"originating\"\n      }\n    }\n  ],\n  \"metadata\": {\n    \"tags\": [\n      \"websocket\",\n      \"echo\"\n    ]\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/message-stub-mappings.json",
    "content": "{\n  \"messageMappings\": [\n    {\n      \"id\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n      \"name\": \"Echo WebSocket messages\",\n      \"priority\": 5,\n      \"trigger\": {\n        \"type\": \"message\",\n        \"channel\": {\n          \"type\": \"websocket\",\n          \"initiatingRequestPattern\": {\n            \"urlPath\": \"/ws/echo\"\n          }\n        }\n      },\n      \"actions\": [\n        {\n          \"type\": \"send\",\n          \"message\": {\n            \"body\": {\n              \"data\": \"Echo response\"\n            }\n          },\n          \"channelTarget\": {\n            \"type\": \"originating\"\n          }\n        }\n      ]\n    },\n    {\n      \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n      \"name\": \"Broadcast to all WebSocket clients\",\n      \"trigger\": {\n        \"type\": \"http-request\",\n        \"requestPattern\": {\n          \"method\": \"POST\",\n          \"urlPath\": \"/broadcast\"\n        }\n      },\n      \"actions\": [\n        {\n          \"type\": \"send\",\n          \"message\": {\n            \"body\": {\n              \"data\": \"Broadcast message\"\n            }\n          },\n          \"channelTarget\": {\n            \"type\": \"request-initiated\",\n            \"channelType\": \"websocket\",\n            \"requestPattern\": {\n              \"urlPathPattern\": \"/ws/.*\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"meta\": {\n    \"total\": 2\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/near-misses.yaml",
    "content": "nearMisses:\n- request:\n    url: \"/nomatch\"\n    absoluteUrl: http://localhost:8080/nomatch\n    method: GET\n    clientIp: '0:0:0:0:0:0:0:1'\n    headers:\n      User-Agent: curl/7.30.0\n      Accept: \"*/*\"\n      Host: localhost:8080\n    cookies: {}\n    browserProxyRequest: false\n    loggedDate: 1467402464520\n    bodyAsBase64: ''\n    body: ''\n    loggedDateString: '2016-07-01T19:47:44Z'\n  requestPattern:\n    url: \"/almostmatch\"\n    method: GET\n  matchResult:\n    distance: 0.06944444444444445\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/record-spec.yaml",
    "content": "targetBaseUrl: http://example.mocklab.io\nfilters:\n  urlPathPattern: \"/api/.*\"\n  method: GET\ncaptureHeaders:\n  Accept: {}\n  Content-Type:\n    caseInsensitive: true\nrequestBodyPattern:\n  matcher: equalToJson\n  ignoreArrayOrder: false\n  ignoreExtraElements: true\nextractBodyCriteria:\n  textSizeThreshold: '2048'\n  binarySizeThreshold: '10240'\npersist: false\nrepeatsAsScenarios: false\ntransformers:\n  - modify-response-header\ntransformerParameters:\n  headerValue: '123'"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/recorded-stub-mappings.yaml",
    "content": "mappings:\n  - id: 093f1027-e5e0-4921-9e6d-e619dfd5d2c7\n    name: recordables_123\n    request:\n      url: \"/recordables/123\"\n      method: GET\n    response:\n      status: 200\n      body: |-\n        {\n          \"message\": \"Congratulations on your first recording!\"\n        }\n      headers:\n        Content-Type: application/json\n    uuid: 093f1027-e5e0-4921-9e6d-e619dfd5d2c7\n    persistent: true\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/request-pattern.yaml",
    "content": "method: POST\nurl: \"/resource\"\nheaders:\n  Content-Type:\n    matches: \".*/xml\"\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/request.yaml",
    "content": "id: 12fb14bb-600e-4bfa-bd8d-be7f12562c99\nrequest:\n  url: \"/received-request/2\"\n  absoluteUrl: http://localhost:56738/received-request/2\n  method: GET\n  clientIp: 127.0.0.1\n  headers:\n    Connection: keep-alive\n    Host: localhost:56738\n    User-Agent: Apache-HttpClient/4.5.1 (Java/1.7.0_51)\n  cookies: {}\n  browserProxyRequest: false\n  loggedDate: 1471442557047\n  bodyAsBase64: ''\n  body: ''\n  loggedDateString: '2016-08-17T14:02:37Z'\nresponseDefinition:\n  status: 404\n  transformers: []\n  fromConfiguredStub: false\n  transformerParameters: {}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/requests.yaml",
    "content": "requests:\n- url: \"/my/url\"\n  absoluteUrl: http://mydomain.com/my/url\n  method: GET\n  headers:\n    Accept-Language: en-us,en;q=0.5\n    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101\n      Firefox/9.0\n    Accept: image/png,image/*;q=0.8,*/*;q=0.5\n  body: ''\n  browserProxyRequest: true\n  loggedDate: 1339083581823\n  loggedDateString: '2012-06-07 16:39:41'\n- url: \"/my/other/url\"\n  absoluteUrl: http://my.other.domain.com/my/other/url\n  method: POST\n  headers:\n    Accept: text/plain\n    Content-Type: text/plain\n  body: My text\n  browserProxyRequest: false\n  loggedDate: 1339083581823\n  loggedDateString: '2012-06-07 16:39:41'\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/send-channel-message-request.json",
    "content": "{\n  \"type\": \"websocket\",\n  \"initiatingRequest\": {\n    \"urlPathPattern\": \"/ws/.*\"\n  },\n  \"message\": {\n    \"body\": {\n      \"data\": \"Broadcast message to all WebSocket clients\"\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/serve-events.yaml",
    "content": "requests:\n- id: 45760a03-eebb-4387-ad0d-bb89b5d3d662\n  request:\n    url: \"/received-request/9\"\n    absoluteUrl: http://localhost:56715/received-request/9\n    method: GET\n    clientIp: 127.0.0.1\n    headers:\n      Connection: keep-alive\n      Host: localhost:56715\n      User-Agent: Apache-HttpClient/4.5.1 (Java/1.7.0_51)\n    cookies: {}\n    browserProxyRequest: false\n    loggedDate: 1471442494809\n    bodyAsBase64: ''\n    body: ''\n    loggedDateString: '2016-08-17T14:01:34Z'\n  responseDefinition:\n    status: 404\n    transformers: []\n    fromConfiguredStub: false\n    transformerParameters: {}\n- id: 6ae78311-0178-46c9-987a-fbfc528d54d8\n  request:\n    url: \"/received-request/8\"\n    absoluteUrl: http://localhost:56715/received-request/8\n    method: GET\n    clientIp: 127.0.0.1\n    headers:\n      Connection: keep-alive\n      Host: localhost:56715\n      User-Agent: Apache-HttpClient/4.5.1 (Java/1.7.0_51)\n    cookies: {}\n    browserProxyRequest: false\n    loggedDate: 1471442494802\n    bodyAsBase64: ''\n    body: ''\n    loggedDateString: '2016-08-17T14:01:34Z'\n  responseDefinition:\n    status: 404\n    transformers: []\n    fromConfiguredStub: false\n    transformerParameters: {}\n- id: aba8e4ad-1b5b-4518-8f05-b2170a24de35\n  request:\n    url: \"/received-request/7\"\n    absoluteUrl: http://localhost:56715/received-request/7\n    method: GET\n    clientIp: 127.0.0.1\n    headers:\n      Connection: keep-alive\n      Host: localhost:56715\n      User-Agent: Apache-HttpClient/4.5.1 (Java/1.7.0_51)\n    cookies: {}\n    browserProxyRequest: false\n    loggedDate: 1471442494795\n    bodyAsBase64: ''\n    body: ''\n    loggedDateString: '2016-08-17T14:01:34Z'\n  responseDefinition:\n    status: 404\n    transformers: []\n    fromConfiguredStub: false\n    transformerParameters: {}\nmeta:\n  total: 9\nrequestJournalDisabled: false\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/snapshot-spec.yaml",
    "content": "filters:\n  urlPathPattern: \"/api/.*\"\n  method: GET\n  ids:\n  - 40a93c4a-d378-4e07-8321-6158d5dbcb29\ncaptureHeaders:\n  Accept: {}\n  Content-Type:\n    caseInsensitive: true\nrequestBodyPattern:\n  matcher: equalToJson\n  ignoreArrayOrder: false\n  ignoreExtraElements: true\nextractBodyCriteria:\n  textSizeThreshold: 2 kb\n  binarySizeThreshold: 1 Mb\noutputFormat: FULL\npersist: false\nrepeatsAsScenarios: false\ntransformers:\n- modify-response-header\ntransformerParameters:\n  headerValue: '123'\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/stub-mapping-no-id.yaml",
    "content": "request:\n  method: GET\n  url: /some/thing\nresponse:\n  body: Hello world!\n  headers:\n    Content-Type: text/plain\n  status: 200\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/stub-mapping-with-id.yaml",
    "content": "id: 76ada7b0-49ae-4229-91c4-396a36f18e09\npriority: 3\nrequest:\n  headers:\n    Accept:\n      equalTo: text/plain\n  method: GET\n  url: /some/thing\nresponse:\n  body: Hello world!\n  headers:\n    Content-Type: text/plain\n  status: 200\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/stub-mappings.yaml",
    "content": "meta:\n  total: 2\nmappings:\n  - id: \"76ada7b0-49ae-4229-91c4-396a36f18e09\"\n    uuid: \"76ada7b0-49ae-4229-91c4-396a36f18e09\"\n    request:\n      method: GET\n      url: /search?q=things\n      headers:\n        Accept:\n          equalTo: application/json\n    response:\n      status: 200\n      jsonBody:\n        - thing1\n        - thing2\n      headers:\n        Content-Type: application/json\n  - request:\n      method: POST\n      urlPath: /some/things\n      bodyPatterns:\n        - { equalToXml: <stuff /> }\n    response:\n      status: 201\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/examples/wait-for-message-request.json",
    "content": "{\n  \"pattern\": {\n    \"channel\": {\n      \"urlPath\": \"/ws/chat\"\n    },\n    \"body\": {\n      \"contains\": \"hello\"\n    }\n  },\n  \"timeoutMillis\": 5000,\n  \"count\": 1\n}\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/absent-pattern.yaml",
    "content": "title: Absent matcher\ntype: object\nproperties:\n  absent:\n    type: boolean\n\nrequired:\n  - absent"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/after-pattern.yaml",
    "content": "title: After datetime\ntype: object\nproperties:\n  after:\n    $ref: \"date-time-elements.yaml#/dateTimeExpression\"\n  actualFormat:\n    $ref: \"date-time-elements.yaml#/format\"\n  truncateExpected:\n    $ref: \"date-time-elements.yaml#/truncation\"\n  truncateActual:\n    $ref: \"date-time-elements.yaml#/truncation\"\n\nrequired:\n  - after\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/and-pattern.yaml",
    "content": "title: Logical AND matcher\ntype: object\nproperties:\n  and:\n    type: array\n    items:\n      $ref: \"content-pattern.yaml\"\n\nrequired:\n  - and"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/bad-request-entity.yaml",
    "content": "title: Bad request entity\ntype: object\nproperties:\n  errors:\n    type: array\n    items:\n      type: object\n      properties:\n        code:\n          type: integer\n        source:\n          type: string\n        title:\n          type: string\n        detail:\n          type: string"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/base64-string.yaml",
    "content": "title: Base64 string\ntype: string\npattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$\ndescription: A base64 encoded string used to describe binary data."
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/before-pattern.yaml",
    "content": "title: Before datetime\ntype: object\nproperties:\n  before:\n    $ref: \"date-time-elements.yaml#/dateTimeExpression\"\n  actualFormat:\n    $ref: \"date-time-elements.yaml#/format\"\n  truncateExpected:\n    $ref: \"date-time-elements.yaml#/truncation\"\n  truncateActual:\n    $ref: \"date-time-elements.yaml#/truncation\"\n\nrequired:\n  - before"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/binary-equal-to-pattern.yaml",
    "content": "title: Binary equals\ntype: object\nrequired:\n  - binaryEqualTo\nproperties:\n  binaryEqualTo:\n    $ref: \"base64-string.yaml\""
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/channel-pattern.yaml",
    "content": "type: object\ndescription: Pattern for matching message channels\nrequired:\n  - type\nproperties:\n  type:\n    $ref: 'channel-type.yaml'\n  initiatingRequestPattern:\n    $ref: 'request-pattern.yaml'\n    description: Pattern to match the request that initiated the channel\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/channel-target.yaml",
    "content": "oneOf:\n  - type: object\n    description: Target the originating channel\n    required:\n      - type\n    properties:\n      type:\n        type: string\n        enum:\n          - originating\n  - type: object\n    description: Target channels initiated by requests matching a pattern\n    required:\n      - type\n      - requestPattern\n    properties:\n      type:\n        type: string\n        enum:\n          - request-initiated\n      channelType:\n        $ref: 'channel-type.yaml'\n      requestPattern:\n        $ref: 'request-pattern.yaml'\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/channel-type.yaml",
    "content": "type: string\ndescription: The type of message channel\nenum:\n  - websocket\nexample: websocket\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/contains-pattern.yaml",
    "content": "title: String contains\ntype: object\nproperties:\n  contains:\n    type: string\nrequired:\n  - contains"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/content-pattern.yaml",
    "content": "type: object\ntitle: Content pattern\noneOf:\n  - $ref: \"equal-to-pattern.yaml\"\n  - $ref: \"binary-equal-to-pattern.yaml\"\n  - $ref: \"contains-pattern.yaml\"\n  - $ref: \"does-not-contain-pattern.yaml\"\n  - $ref: \"matches-pattern.yaml\"\n  - $ref: \"does-not-match-pattern.yaml\"\n  - $ref: \"not-pattern.yaml\"\n  - $ref: \"before-pattern.yaml\"\n  - $ref: \"after-pattern.yaml\"\n  - $ref: \"equal-to-date-time-pattern.yaml\"\n  - $ref: \"equal-to-json-pattern.yaml\"\n  - $ref: \"matches-json-path-pattern.yaml\"\n  - $ref: \"equal-to-xml-pattern.yaml\"\n  - $ref: \"matches-xpath-pattern.yaml\"\n  - $ref: \"matches-json-schema-pattern.yaml\"\n  - $ref: \"absent-pattern.yaml\"\n  - $ref: \"and-pattern.yaml\"\n  - $ref: \"or-pattern.yaml\"\n  - $ref: \"has-exactly-multivalue-pattern.yaml\"\n  - $ref: \"includes-multivalue-pattern.yaml\"\n  - $ref: \"equal-to-number-pattern.yaml\"\n  - $ref: \"greater-than-number-pattern.yaml\"\n  - $ref: \"greater-than-equal-number-pattern.yaml\"\n  - $ref: \"less-than-number-pattern.yaml\"\n  - $ref: \"less-than-equal-number-pattern.yaml\"\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/date-time-elements.yaml",
    "content": "dateTimeExpression:\n  type: string\n  example: now +3 days\n\nformat:\n  type: string\n  example: yyyy-MM-dd\n\ntruncation:\n  type: string\n  enum:\n    - first second of minute\n    - first minute of hour\n    - first hour of day\n    - first day of month\n    - first day of next month\n    - last day of month\n    - first day of year\n    - first day of next year\n    - last day of year\n  example: first day of month"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/delay-distribution.yaml",
    "content": "type: object\ndescription: The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.\noneOf:\n  - title: Log normal\n    description: Log normal randomly distributed response delay.\n    type: object\n    properties:\n      median:\n        type: integer\n      sigma:\n        type: number\n      maxValue:\n        type: number\n      type:\n        type: string\n        enum:\n          - lognormal\n    required:\n      - median\n      - sigma\n\n  - title: Uniform\n    description: Uniformly distributed random response delay.\n    type: object\n    properties:\n      lower:\n        type: integer\n      upper:\n        type: integer\n      type:\n        type: string\n        enum:\n          - uniform\n    required:\n      - lower\n      - upper\n\n  - title: Fixed\n    description: Fixed response delay.\n    type: object\n    properties:\n      milliseconds:\n        type: integer\n      type:\n        type: string\n        enum:\n          - fixed\n    required:\n      - milliseconds\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/does-not-contain-pattern.yaml",
    "content": "title: String does not contain\ntype: object\nproperties:\n  doesNotContain:\n    type: string\nrequired:\n  - doesNotContain"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/does-not-match-pattern.yaml",
    "content": "title: Negative regular expression match\ntype: object\nproperties:\n  doesNotMatch:\n    type: string\n    x-intellij-language-injection: RegExp\nrequired:\n  - doesNotMatch"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/equal-to-date-time-pattern.yaml",
    "content": "title: Before datetime\ntype: object\nproperties:\n  equalToDateTime:\n    $ref: \"date-time-elements.yaml#/dateTimeExpression\"\n  actualFormat:\n    $ref: \"date-time-elements.yaml#/format\"\n  truncateExpected:\n    $ref: \"date-time-elements.yaml#/truncation\"\n  truncateActual:\n    $ref: \"date-time-elements.yaml#/truncation\"\n\nrequired:\n  - equalToDateTime"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/equal-to-json-pattern.yaml",
    "content": "title: JSON equals\ntype: object\nproperties:\n  equalToJson:\n    oneOf:\n      - type: object\n        description: The JSON object to match.\n        example:\n          message: hello\n      - type: string\n        x-intellij-language-injection: JSON\n        description: A JSON-encoded JSON string to match.\n        example: |-\n          { \"message\": \"hello\" }\n  ignoreExtraElements:\n    type: boolean\n  ignoreArrayOrder:\n    type: boolean\n\nrequired:\n  - equalToJson\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/equal-to-number-pattern.yaml",
    "content": "title: Number equals\ntype: object\nproperties:\n  equalToNumber:\n    type: number\nrequired:\n  - equalToNumber"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/equal-to-pattern.yaml",
    "content": "title: String equals\ntype: object\nrequired:\n  - equalTo\nproperties:\n  equalTo:\n    type: string\n  caseInsensitive:\n    type: boolean"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/equal-to-xml-pattern.yaml",
    "content": "title: XML equality\ntype: object\nproperties:\n  equalToXml:\n    type: string\n    x-intellij-language-injection: XML\n    example: |-\n      <amount>123</amount>\n  enablePlaceholders:\n    type: boolean\n  placeholderOpeningDelimiterRegex:\n    type: string\n    example: \"\\\\[\"\n  placeholderClosingDelimiterRegex:\n    type: string\n    example: \"]\"\n  namespaceAwareness:\n    type: string\n    enum: ['LEGACY', 'STRICT', 'NONE']\n\nrequired:\n  - equalToXml\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/greater-than-equal-number-pattern.yaml",
    "content": "title: Number greater than or equal\ntype: object\nproperties:\n  greaterThanEqualNumber:\n    type: number\nrequired:\n  - greaterThanEqualNumber"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/greater-than-number-pattern.yaml",
    "content": "title: Number greater than\ntype: object\nproperties:\n  greaterThanNumber:\n    type: number\nrequired:\n  - greaterThanNumber"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/has-exactly-multivalue-pattern.yaml",
    "content": "title: Has exactly multi value matcher\ntype: object\nproperties:\n  hasExactly:\n    type: array\n    items:\n      $ref: \"content-pattern.yaml\"\n\nrequired:\n  - hasExactly"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/headers.yaml",
    "content": "type: object\ndescription: HTTP headers\nadditionalProperties:\n  type: object\n  properties:\n    key:\n      type: string\n    values:\n      type: array\n      items:\n        type: string\nexample:\n  Connection:\n    key: \"Connection\"\n    values: [\"keep-alive\"]\n  Host:\n    key: \"Host\"\n    values: [\"localhost:56738\"]\n  User-Agent:\n    key: \"User-Agent\"\n    values: [\"Apache-HttpClient/4.5.1 (Java/1.7.0_51)\"]\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/health.yaml",
    "content": "type: object\nproperties:\n  status:\n    type: string\n    example: \"healthy\"\n    description: \"The status of the server\"\n    enum:\n      - healthy\n      - unhealthy\n  message:\n    type: string\n    description: \"Longer message regarding the status of the server\"\n    example: \"Wiremock is ok\"\n  version:\n    type: string\n    description: \"The WireMock version\"\n    example: \"3.8.0\"\n  uptimeInSeconds:\n    type: integer\n    description: \"How long the server has been running\"\n    example: 14355\n  timestamp:\n    type: string\n    description: \"The current timestamp\"\n    example: \"2024-07-03T13:16:06.172362Z\"\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/includes-multivalue-pattern.yaml",
    "content": "title: Has exactly multi value matcher\ntype: object\nproperties:\n  includes:\n    type: array\n    items:\n      $ref: \"content-pattern.yaml\"\n\nrequired:\n  - includes"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/less-than-equal-number-pattern.yaml",
    "content": "title: Number less than or equal\ntype: object\nproperties:\n  lessThanEqualNumber:\n    type: number\nrequired:\n  - lessThanEqualNumber"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/less-than-number-pattern.yaml",
    "content": "title: Number less than\ntype: object\nproperties:\n  lessThanNumber:\n    type: number\nrequired:\n  - lessThanNumber"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/logged-message-channel.yaml",
    "content": "type: object\ndescription: A logged message channel\nproperties:\n  id:\n    type: string\n    format: uuid\n    description: Unique identifier for this channel\n  type:\n    $ref: 'channel-type.yaml'\n  initiatingRequest:\n    $ref: 'logged-request.yaml'\n    description: The HTTP request that initiated the channel (for request-initiated channels)\n  open:\n    type: boolean\n    description: Whether the channel is currently open\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/logged-request.yaml",
    "content": "type: object\nproperties:\n  id:\n    description: The unique identifier for this request\n    type: string\n    format: uuid\n  method:\n    description: The HTTP request method\n    type: string\n    example: \"GET\"\n  url:\n    description: The path and query to match exactly against\n    type: string\n    example: \"/received-request/2\"\n  absoluteUrl:\n    description: The full URL to match against\n    type: string\n    example: \"http://localhost:56738/received-request/2\"\n  scheme:\n    description: The URL scheme (http/https)\n    type: string\n    example: \"http\"\n  host:\n    description: The host part of the URL\n    type: string\n    example: \"localhost\"\n  port:\n    description: The port number\n    type: integer\n    example: 56738\n  clientIp:\n    description: The client IP address\n    type: string\n    example: \"127.0.0.1\"\n  headers:\n    $ref: \"headers.yaml\"\n  cookies:\n    description: Cookies received with the request\n    type: object\n    additionalProperties:\n      type: object\n      properties:\n        name:\n          type: string\n        value:\n          type: string\n    example: {}\n  body:\n    description: Body string to match against\n    type: string\n    example: \"Hello world\"\n  bodyAsBase64:\n    description: Base64 encoded body content\n    type: string\n  browserProxyRequest:\n    description: Whether this request was made via a browser proxy\n    type: boolean\n    example: false\n  loggedDate:\n    description: The timestamp when the request was logged (epoch millis)\n    type: integer\n    format: int64\n    example: 1471442557047\n  loggedDateString:\n    description: The formatted date string when the request was logged\n    type: string\n    example: \"2016-08-17T14:02:37Z\"\n  queryParams:\n    description: Query parameters parsed from the URL\n    type: object\n    additionalProperties:\n      type: object\n      properties:\n        key:\n          type: string\n        values:\n          type: array\n          items:\n            type: string\n  formParams:\n    description: Form parameters parsed from the request body\n    type: object\n    additionalProperties:\n      type: object\n      properties:\n        key:\n          type: string\n        values:\n          type: array\n          items:\n            type: string\n  multiparts:\n    description: Multipart form data parts\n    type: array\n    items:\n      type: object\n      properties:\n        name:\n          type: string\n          description: The name of the multipart part\n        fileName:\n          type: string\n          description: The filename of the multipart part, if provided\n        headers:\n          $ref: \"headers.yaml\"\n        body:\n          type: string\n          description: The body content of this part\n        bodyAsBase64:\n          type: string\n          description: Base64 encoded body content of this part\n      required:\n        - name\n  protocol:\n    description: The HTTP protocol version\n    type: string\n    example: \"HTTP/1.1\"\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/matches-json-path-pattern.yaml",
    "content": "title: JSONPath match\ntype: object\nproperties:\n  matchesJsonPath:\n    oneOf:\n      - type: string\n        example: \"$.name\"\n        x-intellij-language-injection: JSONPath\n      - type: object\n        allOf:\n          - properties:\n              expression:\n                type: string\n                example: \"$.name\"\n          - $ref: \"content-pattern.yaml\"\n\n        required:\n          - expression\n\nrequired:\n  - matchesJsonPath"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/matches-json-schema-pattern.yaml",
    "content": "title: JSON Schema match\ntype: object\nproperties:\n  matchesJsonSchema:\n    type: string\n    x-intellij-language-injection: JSON\n    description: A valid JSON schema as a string\n    example: |-\n      {\n        \"type\": \"object\",\n        \"required\": [\n          \"name\"\n        ],\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"tag\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n\n  schemaVersion:\n    description: The JSON schema version to interpret the schema against\n    example: \"V202012\"\n    enum:\n      - V4\n      - V6\n      - V7\n      - V201909\n      - V202012\n\nrequired:\n  - matchesJsonSchema"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/matches-pattern.yaml",
    "content": "title: Regular expression match\ntype: object\nproperties:\n  matches:\n    type: string\n    x-intellij-language-injection: RegExp\nrequired:\n  - matches"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/matches-xpath-pattern.yaml",
    "content": "title: XPath match\ntype: object\nproperties:\n  matchesXPath:\n    oneOf:\n      - type: string\n        example: \"//Order/Amount\"\n        x-intellij-language-injection: XPath\n      - type: object\n        allOf:\n          - properties:\n              expression:\n                type: string\n                example: \"//Order/Amount\"\n          - $ref: \"content-pattern.yaml\"\n\n        required:\n          - expression\n\n  xPathNamespaces:\n    type: object\n    additionalProperties:\n      type: string\n\nrequired:\n  - matchesXPath"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-action.yaml",
    "content": "type: object\ndescription: Action to perform when a message stub is triggered\nrequired:\n  - type\n  - message\nproperties:\n  type:\n    type: string\n    enum:\n      - send\n  message:\n    $ref: 'message-definition.yaml'\n  channelTarget:\n    $ref: 'channel-target.yaml'\n  transformers:\n    type: array\n    description: List of transformer names to apply to the message\n    items:\n      type: string\n  transformerParameters:\n    type: object\n    description: Parameters to pass to transformers\n    additionalProperties: true\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-channels-result.yaml",
    "content": "type: object\ndescription: Result containing message channels\nproperties:\n  channels:\n    type: array\n    items:\n      $ref: 'logged-message-channel.yaml'\n  meta:\n    type: object\n    description: Pagination metadata\n    properties:\n      total:\n        type: integer\n        description: Total number of channels\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-definition.yaml",
    "content": "type: object\ndescription: Definition of a message to be sent\nproperties:\n  body:\n    description: The message body\n    oneOf:\n      - type: object\n        properties:\n          data:\n            type: string\n            description: Text message data\n      - type: object\n        properties:\n          data:\n            type: string\n            format: byte\n            description: Base64-encoded binary message data\n          isBinary:\n            type: boolean\n            description: Indicates this is binary data\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-pattern.yaml",
    "content": "type: object\ndescription: Pattern for matching messages\nproperties:\n  channel:\n    $ref: 'request-pattern.yaml'\n    description: Pattern to match the channel's initiating request\n  body:\n    $ref: 'content-pattern.yaml'\n    description: Pattern to match the message body\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-serve-event.yaml",
    "content": "type: object\ndescription: A message event logged in the journal\nproperties:\n  id:\n    type: string\n    format: uuid\n    description: Unique identifier for this message event\n  eventType:\n    type: string\n    enum:\n      - RECEIVED\n      - SENT\n    description: Whether the message was received or sent\n  channelType:\n    $ref: 'channel-type.yaml'\n  channelId:\n    type: string\n    format: uuid\n    description: ID of the channel on which the message was sent/received\n  channelRequest:\n    $ref: 'logged-request.yaml'\n    description: The HTTP request that initiated the channel (for request-initiated channels)\n  message:\n    type: string\n    description: The message body as a string\n  stubMapping:\n    $ref: 'message-stub-mapping.yaml'\n    description: The message stub mapping that was matched (if any)\n  wasMatched:\n    type: boolean\n    description: Whether this message matched a stub mapping\n  timestamp:\n    type: string\n    format: date-time\n    description: When the message event occurred\n  subEvents:\n    type: array\n    description: Sub-events that occurred during message processing\n    items:\n      type: object\n      properties:\n        type:\n          type: string\n        relativeTiming:\n          type: integer\n          description: Timing in nanoseconds relative to the start of the event\n        data:\n          type: object\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-serve-events-result.yaml",
    "content": "type: object\ndescription: Result containing message serve events\nproperties:\n  messageServeEvents:\n    type: array\n    items:\n      $ref: 'message-serve-event.yaml'\n  messageJournalDisabled:\n    type: boolean\n    description: Whether the message journal is disabled\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-stub-mapping.yaml",
    "content": "type: object\ndescription: A message stub mapping defines how WireMock responds to messages on channels\nproperties:\n  id:\n    type: string\n    format: uuid\n    description: This message stub mapping's unique identifier\n  uuid:\n    type: string\n    format: uuid\n    description: Alias for the id\n  name:\n    type: string\n    description: The message stub mapping's name\n  priority:\n    type: integer\n    description: This message stub mapping's priority relative to others. 1 is highest.\n    minimum: 1\n  trigger:\n    $ref: 'message-trigger.yaml'\n  actions:\n    type: array\n    description: Actions to perform when this stub is triggered\n    items:\n      $ref: 'message-action.yaml'\n  metadata:\n    type: object\n    description: Arbitrary metadata to be attached to the stub mapping\n    additionalProperties: true\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-stub-mappings.yaml",
    "content": "type: object\ndescription: A collection of message stub mappings\nproperties:\n  messageMappings:\n    type: array\n    items:\n      $ref: 'message-stub-mapping.yaml'\n  meta:\n    type: object\n    description: Pagination metadata\n    properties:\n      total:\n        type: integer\n        description: Total number of message stub mappings\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-trigger.yaml",
    "content": "oneOf:\n  - type: object\n    description: Trigger on incoming message\n    required:\n      - type\n    properties:\n      type:\n        type: string\n        enum:\n          - message\n      channel:\n        $ref: 'channel-pattern.yaml'\n      message:\n        $ref: 'message-pattern.yaml'\n  - type: object\n    description: Trigger when a specific HTTP stub is matched\n    required:\n      - type\n      - stubId\n    properties:\n      type:\n        type: string\n        enum:\n          - http-stub\n      stubId:\n        type: string\n        format: uuid\n        description: The ID of the HTTP stub mapping that triggers this message stub\n  - type: object\n    description: Trigger when an HTTP request matches a pattern\n    required:\n      - type\n      - requestPattern\n    properties:\n      type:\n        type: string\n        enum:\n          - http-request\n      requestPattern:\n        $ref: 'request-pattern.yaml'\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/message-verification-result.yaml",
    "content": "type: object\ndescription: Result of a message verification operation\nproperties:\n  count:\n    type: integer\n    description: Number of messages matching the criteria\n  messageJournalDisabled:\n    type: boolean\n    description: Whether the message journal is disabled\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/none-of-request-method-pattern.yaml",
    "content": "title: One of request method pattern\ntype: object\nproperties:\n  noneOf:\n    type: array\n    items:\n      type: string\n\nrequired:\n  - noneOf"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/not-pattern.yaml",
    "content": "title: Logical NOT modifier\ntype: object\nproperties:\n  not:\n    $ref: \"content-pattern.yaml\"\nrequired:\n  - not\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/one-of-request-method-pattern.yaml",
    "content": "title: One of request method pattern\ntype: object\nproperties:\n  oneOf:\n    type: array\n    items:\n      type: string\n\nrequired:\n  - oneOf"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/or-pattern.yaml",
    "content": "title: Logical OR matcher\ntype: object\nproperties:\n  or:\n    type: array\n    items:\n      $ref: \"content-pattern.yaml\"\n\nrequired:\n  - or"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/record-spec.yaml",
    "content": "type: object\nproperties:\n  captureHeaders:\n    type: object\n    additionalProperties:\n      type: object\n      additionalProperties: false\n      properties:\n        caseInsensitive:\n          type: boolean\n    description: Headers from the request to include in the generated stub mappings, mapped to parameter objects. The only parameter available is \"caseInsensitive\", which defaults to false\n    example:\n      Accept: {}\n      Content-Type:\n        caseInsensitive: true\n  extractBodyCriteria:\n    type: object\n    description: Criteria for extracting response bodies to a separate file instead of including it in the stub mapping\n    example:\n      - binarySizeThreshold: 1 Mb\n        textSizeThreshold: 2 kb\n    properties:\n      binarySizeThreshold:\n        type: string\n        default: '0'\n        description: Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \"56 Mb\". Default unit is bytes.\n        example: 18.2 GB\n      textSizeThreshold:\n        default: '0'\n        description: Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \"56 Mb\". Default unit is bytes.\n        example: 18.2 GB\n        type: string\n  persist:\n    type: boolean\n    default: true\n    description: Whether to save stub mappings to the file system or just return them\n  repeatsAsScenarios:\n    type: boolean\n    default: true\n    description: When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded\n  requestBodyPattern:\n    type: object\n    description: Control the request body matcher used in generated stub mappings\n    oneOf:\n      - type: object\n        description: Automatically determine matcher based on content type (the default)\n        properties:\n          caseInsensitive:\n            type: boolean\n            default: false\n            description: If equalTo is used, match body use case-insensitive string comparison\n          ignoreArrayOrder:\n            type: boolean\n            default: true\n            description: If equalToJson is used, ignore order of array elements\n          ignoreExtraElements:\n            type: boolean\n            default: true\n            description: If equalToJson is used, matcher ignores extra elements in objects\n          matcher:\n            type: string\n            enum:\n              - auto\n      - type: object\n        description: Always match request bodies using equalTo\n        properties:\n          caseInsensitive:\n            default: false\n            description: Match body using case-insensitive string comparison\n            type: boolean\n          matcher:\n            enum:\n              - equalTo\n            type: string\n      - type: object\n        description: Always match request bodies using equalToJson\n        properties:\n          ignoreArrayOrder:\n            default: true\n            description: Ignore order of array elements\n            type: boolean\n          ignoreExtraElements:\n            default: true\n            description: Ignore extra elements in objects\n            type: boolean\n          matcher:\n            enum:\n              - equalToJson\n            type: string\n      - type: object\n        description: Always match request bodies using equalToXml\n        properties:\n          matcher:\n            type: string\n            enum:\n              - equalToXml\n  transformerParameters:\n    type: object\n    description: List of names of stub mappings transformers to apply to generated stubs\n  transformers:\n    type: array\n    description: Parameters to pass to stub mapping transformers\n    items:\n      type: string\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/request-method-pattern.yaml",
    "content": "type: object\ntitle: Request method pattern\noneOf:\n  - $ref: \"one-of-request-method-pattern.yaml\"\n  - $ref: \"none-of-request-method-pattern.yaml\"\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/request-pattern.yaml",
    "content": "type: object\nexample: |-\n  {\n    \"urlPath\" : \"/charges\",\n    \"method\" : \"POST\",\n    \"headers\" : {\n      \"Content-Type\" : {\n        \"equalTo\" : \"application/json\"\n      }\n    }\n  }\nproperties:\n  scheme:\n    type: string\n    enum:\n      - http\n      - https\n    description: The scheme (protocol) part of the request URL\n  host:\n    type: string\n    description: The hostname part of the request URL\n  port:\n    type: integer\n    minimum: 1\n    maximum: 65535\n    description: The HTTP port number of the request URL\n  method:\n    oneOf:\n      - type: string\n        pattern: ^[A-Z]+$\n        description: The HTTP request method e.g. GET\n      - $ref: \"one-of-request-method-pattern.yaml\"\n      - $ref: \"none-of-request-method-pattern.yaml\"\n  url:\n    type: string\n    description: The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\n  urlPath:\n    type: string\n    description: The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\n  urlPathPattern:\n    type: string\n    description: The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\n  urlPattern:\n    type: string\n    description: The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\n  urlPathTemplate:\n    type: string\n    description: |\n      The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification.\n      Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\n\n  pathParameters:\n    type: object\n    description: |-\n      Path parameter patterns to match against in the <key>: { \"<predicate>\": \"<value>\" } form. Can only\n      be used when the urlPathPattern URL match type is in use and all keys must be present as variables\n      in the path template.\n    additionalProperties:\n      $ref: \"content-pattern.yaml\"\n\n  queryParameters:\n    type: object\n    description: 'Query parameter patterns to match against in the <key>: { \"<predicate>\": \"<value>\" } form'\n    additionalProperties:\n      $ref: \"content-pattern.yaml\"\n\n  formParameters:\n    type: object\n    description: 'application/x-www-form-urlencoded form parameter patterns to match against in the <key>: { \"<predicate>\": \"<value>\" } form'\n    additionalProperties:\n      $ref: \"content-pattern.yaml\"\n\n  headers:\n    type: object\n    description: 'Header patterns to match against in the <key>: { \"<predicate>\": \"<value>\" } form'\n    additionalProperties:\n      $ref: \"content-pattern.yaml\"\n\n  clientIp:\n    type: string\n    description: The client IP address to match against\n\n  basicAuthCredentials:\n    type: object\n    description: Pre-emptive basic auth credentials to match against\n    properties:\n      password:\n        type: string\n      username:\n        type: string\n    required:\n      - username\n      - password\n\n  cookies:\n    type: object\n    description: 'Cookie patterns to match against in the <key>: { \"<predicate>\": \"<value>\" } form'\n    additionalProperties:\n      $ref: \"content-pattern.yaml\"\n\n  bodyPatterns:\n    type: array\n    description: 'Request body patterns to match against in the { \"<predicate>\": \"<value>\" } form'\n    items:\n      $ref: \"content-pattern.yaml\"\n\n  customMatcher:\n    type: object\n    description: Custom request matcher to match against\n    properties:\n      name:\n        type: string\n        description: The matcher's name specified in the implementation of the matcher.\n      parameters:\n        type: object\n\n  multipartPatterns:\n    type: array\n    description: Multipart patterns to match against headers and body.\n    items:\n      type: object\n      properties:\n        name:\n          type: string\n        fileName:\n          type: string\n        matchingType:\n          type: string\n          description: Determines whether all or any of the parts must match the criteria for an overall match.\n          default: ANY\n          enum:\n            - ALL\n            - ANY\n        headers:\n          type: object\n          description: 'Header patterns to match against in the <key>: { \"<predicate>\": \"<value>\" } form'\n          additionalProperties:\n            $ref: \"content-pattern.yaml\"\n\n        bodyPatterns:\n          type: array\n          description: 'Body patterns to match against in the { \"<predicate>\": \"<value>\" } form'\n          items:\n            $ref: \"content-pattern.yaml\"\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/response-definition.yaml",
    "content": "allOf:\n  - type: object\n    properties:\n      status:\n        type: integer\n        description: The HTTP status code to be returned\n      statusMessage:\n        type: string\n        description: The HTTP status message to be returned\n\n      headers:\n        type: object\n        description: Map of response headers to send\n        additionalProperties:\n          type: string\n      additionalProxyRequestHeaders:\n        type: object\n        description: Extra request headers to send when proxying to another host.\n        additionalProperties:\n          type: string\n      removeProxyRequestHeaders:\n        type: array\n        description: Request headers to remove when proxying to another host.\n        items:\n          type: string\n\n      body:\n        type: string\n        description: The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\n      base64Body:\n        $ref: \"base64-string.yaml\"\n      jsonBody:\n        description: The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\n        oneOf:\n          - type: object\n          - type: array\n      bodyFileName:\n        type: string\n        description: The path to the file containing the response body, relative to the configured file root. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\n        example: user-profile-responses/user1.json\n\n      fault:\n        type: string\n        description: The fault to apply (instead of a full, valid response).\n        enum:\n          - CONNECTION_RESET_BY_PEER\n          - EMPTY_RESPONSE\n          - MALFORMED_RESPONSE_CHUNK\n          - RANDOM_DATA_THEN_CLOSE\n\n      fixedDelayMilliseconds:\n        type: integer\n        description: Number of milliseconds to delay be before sending the response.\n      delayDistribution:\n        $ref: \"delay-distribution.yaml\"\n      chunkedDribbleDelay:\n        type: object\n        description: The parameters for chunked dribble delay - chopping the response into pieces and sending them at delayed intervals\n        properties:\n          numberOfChunks:\n            type: integer\n          totalDuration:\n            type: integer\n        required:\n          - numberOfChunks\n          - totalDuration\n\n      fromConfiguredStub:\n        type: boolean\n        description: Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.\n\n      proxyBaseUrl:\n        type: string\n        description: The base URL of the target to proxy matching requests to.\n      proxyUrlPrefixToRemove:\n        type: string\n        description: A path segment to remove from the beginning in incoming request URL paths before proxying to the target.\n\n      transformerParameters:\n        type: object\n        description: Parameters to apply to response transformers.\n      transformers:\n        type: array\n        description: List of names of transformers to apply to this response.\n        items:\n          type: string\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/scenario.yaml",
    "content": "type: object\nproperties:\n  id:\n    type: string\n    description: The scenario ID\n    example: c8d249ec-d86d-48b1-88a8-a660e6848042\n  name:\n    type: string\n    description: The scenario name\n    example: my_scenario\n  possibleStates:\n    type: array\n    items:\n      default: Started\n      description: All the states this scenario can be in\n      type: string\n    example: [ Started, state_1, state_2 ]\n  state:\n    type: string\n    default: Started\n    description: The current state of this scenario\n    example: state_2\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/send-channel-message-request.yaml",
    "content": "type: object\ndescription: Request to send a message to channels\nrequired:\n  - type\n  - message\nproperties:\n  type:\n    $ref: 'channel-type.yaml'\n  initiatingRequest:\n    $ref: 'request-pattern.yaml'\n    description: Pattern to match the initiating request of target channels\n  message:\n    $ref: 'message-definition.yaml'\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/send-channel-message-result.yaml",
    "content": "type: object\ndescription: Result of sending a message to channels\nproperties:\n  channels:\n    type: array\n    description: Channels that received the message\n    items:\n      $ref: 'logged-message-channel.yaml'\n  channelsMessaged:\n    type: integer\n    description: Number of channels that received the message\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/single-message-serve-event-result.yaml",
    "content": "type: object\ndescription: Result containing a single message serve event\nproperties:\n  item:\n    $ref: 'message-serve-event.yaml'\n    description: The message serve event, or null if not found\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/stub-mapping.yaml",
    "content": "type: object\nproperties:\n  id:\n    type: string\n    description: This stub mapping's unique identifier\n  uuid:\n    type: string\n    description: Alias for the id\n  name:\n    type: string\n    description: The stub mapping's name\n  request:\n    $ref: 'request-pattern.yaml'\n  response:\n    $ref: \"response-definition.yaml\"\n  persistent:\n    type: boolean\n    description: Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.\n  priority:\n    type: integer\n    description: This stub mapping's priority relative to others. 1 is highest.\n    minimum: 1\n  scenarioName:\n    type: string\n    description: The name of the scenario that this stub mapping is part of\n  requiredScenarioState:\n    type: string\n    description: The required state of the scenario in order for this stub to be matched.\n  newScenarioState:\n    type: string\n    description: The new state for the scenario to be updated to after this stub is served.\n  postServeActions:\n    type: array\n    description: |\n      DEPRECATED: Use `serveEventListeners` instead.\n      A map of the names of post serve action extensions to trigger and their parameters.\n    items: \n      type: object\n  serveEventListeners:\n    type: array\n    description: The list of serve event listeners\n    items:\n      type: object\n      properties:\n        name:\n          type: string\n        requestPhases:\n          type: array\n          items:\n            type: string\n            enum:\n              - BEFORE_MATCH\n              - AFTER_MATCH\n              - BEFORE_RESPONSE_SENT\n              - AFTER_COMPLETE\n        parameters:\n          type: object\n  metadata:\n    type: object\n    description: Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.\nadditionalProperties: false\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/stub-mappings.yaml",
    "content": "type: object\nproperties:\n  mappings:\n    type: array\n    items:\n      $ref: \"stub-mapping.yaml\"\n  meta:\n    type: object\n    properties:\n      total:\n        type: integer\n        example: 4\n    required:\n      - total\nadditionalProperties: false\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/schemas/wait-for-message-request.yaml",
    "content": "type: object\ndescription: Request to wait for message events\nrequired:\n  - timeoutMillis\nproperties:\n  pattern:\n    $ref: 'message-pattern.yaml'\n  timeoutMillis:\n    type: integer\n    format: int64\n    description: Maximum time to wait in milliseconds\n  count:\n    type: integer\n    description: Number of messages to wait for (for wait-for-count endpoint)\n\n"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/wiremock-admin-api.json",
    "content": "{\n  \"openapi\": \"3.0.0\",\n  \"info\": {\n    \"title\": \"WireMock\",\n    \"version\": \"4.0.0-beta.30\",\n    \"description\": \"WireMock offers a REST API for administration, troubleshooting and analysis purposes\"\n  },\n  \"servers\": [\n    {\n      \"url\": \"/\"\n    }\n  ],\n  \"tags\": [\n    {\n      \"name\": \"Stub Mappings\",\n      \"description\": \"Operations on stub mappings\",\n      \"externalDocs\": {\n        \"description\": \"User documentation\",\n        \"url\": \"https://wiremock.org/docs/stubbing/\"\n      }\n    },\n    {\n      \"name\": \"Requests\",\n      \"description\": \"Logged requests and responses received by the mock service\",\n      \"externalDocs\": {\n        \"description\": \"User documentation\",\n        \"url\": \"https://wiremock.org/docs/verifying/\"\n      }\n    },\n    {\n      \"name\": \"Near Misses\",\n      \"description\": \"Near misses allow querying of received requests or request patterns according to similarity\",\n      \"externalDocs\": {\n        \"description\": \"User documentation\",\n        \"url\": \"https://wiremock.org/docs/verifying/#near-misses\"\n      }\n    },\n    {\n      \"name\": \"Recordings\",\n      \"description\": \"Stub mapping record and snapshot functions\",\n      \"externalDocs\": {\n        \"description\": \"User documentation\",\n        \"url\": \"https://wiremock.org/docs/record-playback/\"\n      }\n    },\n    {\n      \"name\": \"Scenarios\",\n      \"description\": \"Scenarios support modelling of stateful behaviour\",\n      \"externalDocs\": {\n        \"description\": \"User documentation\",\n        \"url\": \"https://wiremock.org/docs/stateful-behaviour/\"\n      }\n    },\n    {\n      \"name\": \"Files\",\n      \"description\": \"Manage the files used to support WireMock stubs\"\n    },\n    {\n      \"name\": \"Message Mappings\",\n      \"description\": \"Operations on message stub mappings for WebSocket and other messaging protocols\",\n      \"externalDocs\": {\n        \"description\": \"User documentation\",\n        \"url\": \"https://wiremock.org/docs/websockets-and-other-messaging/\"\n      }\n    },\n    {\n      \"name\": \"Messages\",\n      \"description\": \"Message events logged in the journal\",\n      \"externalDocs\": {\n        \"description\": \"User documentation\",\n        \"url\": \"https://wiremock.org/docs/websockets-and-other-messaging/\"\n      }\n    },\n    {\n      \"name\": \"Channels\",\n      \"description\": \"Active message channels\",\n      \"externalDocs\": {\n        \"description\": \"User documentation\",\n        \"url\": \"https://wiremock.org/docs/websockets-and-other-messaging/\"\n      }\n    },\n    {\n      \"name\": \"System\",\n      \"description\": \"Global operations\"\n    }\n  ],\n  \"externalDocs\": {\n    \"description\": \"WireMock user documentation\",\n    \"url\": \"https://wiremock.org/docs/\"\n  },\n  \"paths\": {\n    \"/__admin/mappings\": {\n      \"get\": {\n        \"operationId\": \"getAllStubMappings\",\n        \"summary\": \"Get all stub mappings\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"parameters\": [\n          {\n            \"description\": \"The maximum number of results to return\",\n            \"in\": \"query\",\n            \"name\": \"limit\",\n            \"required\": false,\n            \"example\": 10,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          },\n          {\n            \"description\": \"The start index of the results to return\",\n            \"in\": \"query\",\n            \"name\": \"offset\",\n            \"required\": false,\n            \"example\": 0,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/stub-mappings\"\n                },\n                \"example\": {\n                  \"meta\": {\n                    \"total\": 2\n                  },\n                  \"mappings\": [\n                    {\n                      \"id\": \"76ada7b0-49ae-4229-91c4-396a36f18e09\",\n                      \"uuid\": \"76ada7b0-49ae-4229-91c4-396a36f18e09\",\n                      \"request\": {\n                        \"method\": \"GET\",\n                        \"url\": \"/search?q=things\",\n                        \"headers\": {\n                          \"Accept\": {\n                            \"equalTo\": \"application/json\"\n                          }\n                        }\n                      },\n                      \"response\": {\n                        \"status\": 200,\n                        \"jsonBody\": [\n                          \"thing1\",\n                          \"thing2\"\n                        ],\n                        \"headers\": {\n                          \"Content-Type\": \"application/json\"\n                        }\n                      }\n                    },\n                    {\n                      \"request\": {\n                        \"method\": \"POST\",\n                        \"urlPath\": \"/some/things\",\n                        \"bodyPatterns\": [\n                          {\n                            \"equalToXml\": \"<stuff />\"\n                          }\n                        ]\n                      },\n                      \"response\": {\n                        \"status\": 201\n                      }\n                    }\n                  ]\n                }\n              }\n            },\n            \"description\": \"All stub mappings\"\n          }\n        }\n      },\n      \"post\": {\n        \"operationId\": \"createNewStubMapping\",\n        \"summary\": \"Create a new stub mapping\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"requestBody\": {\n          \"$ref\": \"#/components/requestBodies/stubMapping\"\n        },\n        \"responses\": {\n          \"201\": {\n            \"$ref\": \"#/components/responses/stubMapping\"\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/badRequestEntity\"\n          }\n        }\n      },\n      \"delete\": {\n        \"operationId\": \"deleteAllStubMappings\",\n        \"summary\": \"Delete all stub mappings\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully deleted\"\n          }\n        }\n      }\n    },\n    \"/__admin/mappings/reset\": {\n      \"post\": {\n        \"operationId\": \"resetStubMappings\",\n        \"summary\": \"Reset stub mappings\",\n        \"description\": \"Restores stub mappings to the defaults defined back in the backing store\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully reset\"\n          }\n        }\n      }\n    },\n    \"/__admin/mappings/save\": {\n      \"post\": {\n        \"operationId\": \"persistStubMappings\",\n        \"summary\": \"Persist stub mappings\",\n        \"description\": \"Save all persistent stub mappings to the backing store\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully saved\"\n          }\n        }\n      }\n    },\n    \"/__admin/mappings/import\": {\n      \"post\": {\n        \"operationId\": \"importStubMappings\",\n        \"summary\": \"Import stub mappings\",\n        \"description\": \"Import given stub mappings to the backing store\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully imported\"\n          }\n        }\n      }\n    },\n    \"/__admin/mappings/{stubMappingId}\": {\n      \"parameters\": [\n        {\n          \"description\": \"The UUID of stub mapping\",\n          \"in\": \"path\",\n          \"name\": \"stubMappingId\",\n          \"required\": true,\n          \"example\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n          \"schema\": {\n            \"type\": \"string\"\n          }\n        }\n      ],\n      \"get\": {\n        \"operationId\": \"getStubMappingById\",\n        \"summary\": \"Get stub mapping by ID\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"$ref\": \"#/components/responses/stubMapping\"\n          },\n          \"404\": {\n            \"description\": \"Stub mapping not found\"\n          }\n        }\n      },\n      \"put\": {\n        \"operationId\": \"updateStubMapping\",\n        \"summary\": \"Update a stub mapping\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"requestBody\": {\n          \"$ref\": \"#/components/requestBodies/stubMapping\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"$ref\": \"#/components/responses/stubMapping\"\n          },\n          \"404\": {\n            \"description\": \"Stub mapping not found\"\n          }\n        }\n      },\n      \"delete\": {\n        \"operationId\": \"deleteStubMapping\",\n        \"summary\": \"Delete a stub mapping\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"OK\"\n          },\n          \"404\": {\n            \"description\": \"Stub mapping not found\"\n          }\n        }\n      }\n    },\n    \"/__admin/mappings/find-by-metadata\": {\n      \"post\": {\n        \"operationId\": \"findStubMappingsByMetadata\",\n        \"description\": \"Find stubs by matching on their metadata\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/content-pattern\"\n              },\n              \"example\": {\n                \"matchesJsonPath\": {\n                  \"expression\": \"$.outer\",\n                  \"equalToJson\": \"{ \\\"inner\\\": 42 }\"\n                }\n              }\n            }\n          },\n          \"required\": true\n        },\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/stub-mappings\"\n                },\n                \"example\": {\n                  \"meta\": {\n                    \"total\": 2\n                  },\n                  \"mappings\": [\n                    {\n                      \"id\": \"76ada7b0-49ae-4229-91c4-396a36f18e09\",\n                      \"uuid\": \"76ada7b0-49ae-4229-91c4-396a36f18e09\",\n                      \"request\": {\n                        \"method\": \"GET\",\n                        \"url\": \"/search?q=things\",\n                        \"headers\": {\n                          \"Accept\": {\n                            \"equalTo\": \"application/json\"\n                          }\n                        }\n                      },\n                      \"response\": {\n                        \"status\": 200,\n                        \"jsonBody\": [\n                          \"thing1\",\n                          \"thing2\"\n                        ],\n                        \"headers\": {\n                          \"Content-Type\": \"application/json\"\n                        }\n                      }\n                    },\n                    {\n                      \"request\": {\n                        \"method\": \"POST\",\n                        \"urlPath\": \"/some/things\",\n                        \"bodyPatterns\": [\n                          {\n                            \"equalToXml\": \"<stuff />\"\n                          }\n                        ]\n                      },\n                      \"response\": {\n                        \"status\": 201\n                      }\n                    }\n                  ]\n                }\n              }\n            },\n            \"description\": \"Matched stub mappings\"\n          }\n        }\n      }\n    },\n    \"/__admin/mappings/remove-by-metadata\": {\n      \"post\": {\n        \"operationId\": \"removeStubMappingsByMetadata\",\n        \"summary\": \"Delete stub mappings matching metadata\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/content-pattern\"\n              },\n              \"example\": {\n                \"matchesJsonPath\": {\n                  \"expression\": \"$.outer\",\n                  \"equalToJson\": \"{ \\\"inner\\\": 42 }\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The stub mappings were successfully removed\"\n          }\n        }\n      }\n    },\n    \"/__admin/mappings/unmatched\": {\n      \"get\": {\n        \"operationId\": \"findUnmatchedStubMappings\",\n        \"summary\": \"Find unmatched stub mappings\",\n        \"description\": \"Find stub mappings that haven't matched any requests in the journal\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Unmatched stub mappings\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/stub-mappings\"\n                },\n                \"example\": {\n                  \"meta\": {\n                    \"total\": 2\n                  },\n                  \"mappings\": [\n                    {\n                      \"id\": \"76ada7b0-49ae-4229-91c4-396a36f18e09\",\n                      \"uuid\": \"76ada7b0-49ae-4229-91c4-396a36f18e09\",\n                      \"request\": {\n                        \"method\": \"GET\",\n                        \"url\": \"/search?q=things\",\n                        \"headers\": {\n                          \"Accept\": {\n                            \"equalTo\": \"application/json\"\n                          }\n                        }\n                      },\n                      \"response\": {\n                        \"status\": 200,\n                        \"jsonBody\": [\n                          \"thing1\",\n                          \"thing2\"\n                        ],\n                        \"headers\": {\n                          \"Content-Type\": \"application/json\"\n                        }\n                      }\n                    },\n                    {\n                      \"request\": {\n                        \"method\": \"POST\",\n                        \"urlPath\": \"/some/things\",\n                        \"bodyPatterns\": [\n                          {\n                            \"equalToXml\": \"<stuff />\"\n                          }\n                        ]\n                      },\n                      \"response\": {\n                        \"status\": 201\n                      }\n                    }\n                  ]\n                }\n              }\n            }\n          }\n        }\n      },\n      \"delete\": {\n        \"operationId\": \"removeUnmatchedStubMappings\",\n        \"summary\": \"Remove unmatched stub mappings\",\n        \"description\": \"Remove stub mappings that haven't matched any requests in the journal\",\n        \"tags\": [\n          \"Stub Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"OK\"\n          }\n        }\n      }\n    },\n    \"/__admin/requests\": {\n      \"get\": {\n        \"operationId\": \"getAllRequestsInJournal\",\n        \"summary\": \"Get all requests in journal\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"parameters\": [\n          {\n            \"description\": \"The maximum number of results to return\",\n            \"in\": \"query\",\n            \"name\": \"limit\",\n            \"example\": 10,\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          },\n          {\n            \"description\": \"Only return logged requests after this date\",\n            \"in\": \"query\",\n            \"name\": \"since\",\n            \"example\": \"2016-10-05T12:33:01Z\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"example\": {\n                  \"requests\": [\n                    {\n                      \"id\": \"45760a03-eebb-4387-ad0d-bb89b5d3d662\",\n                      \"request\": {\n                        \"url\": \"/received-request/9\",\n                        \"absoluteUrl\": \"http://localhost:56715/received-request/9\",\n                        \"method\": \"GET\",\n                        \"clientIp\": \"127.0.0.1\",\n                        \"headers\": {\n                          \"Connection\": \"keep-alive\",\n                          \"Host\": \"localhost:56715\",\n                          \"User-Agent\": \"Apache-HttpClient/4.5.1 (Java/1.7.0_51)\"\n                        },\n                        \"cookies\": {},\n                        \"browserProxyRequest\": false,\n                        \"loggedDate\": 1471442494809,\n                        \"bodyAsBase64\": \"\",\n                        \"body\": \"\",\n                        \"loggedDateString\": \"2016-08-17T14:01:34Z\"\n                      },\n                      \"responseDefinition\": {\n                        \"status\": 404,\n                        \"transformers\": [],\n                        \"fromConfiguredStub\": false,\n                        \"transformerParameters\": {}\n                      }\n                    },\n                    {\n                      \"id\": \"6ae78311-0178-46c9-987a-fbfc528d54d8\",\n                      \"request\": {\n                        \"url\": \"/received-request/8\",\n                        \"absoluteUrl\": \"http://localhost:56715/received-request/8\",\n                        \"method\": \"GET\",\n                        \"clientIp\": \"127.0.0.1\",\n                        \"headers\": {\n                          \"Connection\": \"keep-alive\",\n                          \"Host\": \"localhost:56715\",\n                          \"User-Agent\": \"Apache-HttpClient/4.5.1 (Java/1.7.0_51)\"\n                        },\n                        \"cookies\": {},\n                        \"browserProxyRequest\": false,\n                        \"loggedDate\": 1471442494802,\n                        \"bodyAsBase64\": \"\",\n                        \"body\": \"\",\n                        \"loggedDateString\": \"2016-08-17T14:01:34Z\"\n                      },\n                      \"responseDefinition\": {\n                        \"status\": 404,\n                        \"transformers\": [],\n                        \"fromConfiguredStub\": false,\n                        \"transformerParameters\": {}\n                      }\n                    },\n                    {\n                      \"id\": \"aba8e4ad-1b5b-4518-8f05-b2170a24de35\",\n                      \"request\": {\n                        \"url\": \"/received-request/7\",\n                        \"absoluteUrl\": \"http://localhost:56715/received-request/7\",\n                        \"method\": \"GET\",\n                        \"clientIp\": \"127.0.0.1\",\n                        \"headers\": {\n                          \"Connection\": \"keep-alive\",\n                          \"Host\": \"localhost:56715\",\n                          \"User-Agent\": \"Apache-HttpClient/4.5.1 (Java/1.7.0_51)\"\n                        },\n                        \"cookies\": {},\n                        \"browserProxyRequest\": false,\n                        \"loggedDate\": 1471442494795,\n                        \"bodyAsBase64\": \"\",\n                        \"body\": \"\",\n                        \"loggedDateString\": \"2016-08-17T14:01:34Z\"\n                      },\n                      \"responseDefinition\": {\n                        \"status\": 404,\n                        \"transformers\": [],\n                        \"fromConfiguredStub\": false,\n                        \"transformerParameters\": {}\n                      }\n                    }\n                  ],\n                  \"meta\": {\n                    \"total\": 9\n                  },\n                  \"requestJournalDisabled\": false\n                }\n              }\n            },\n            \"description\": \"List of received requests\"\n          }\n        }\n      },\n      \"delete\": {\n        \"operationId\": \"deleteAllRequestsInJournal\",\n        \"summary\": \"Delete all requests in journal\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully deleted\"\n          }\n        }\n      }\n    },\n    \"/__admin/requests/{requestId}\": {\n      \"get\": {\n        \"operationId\": \"getRequestById\",\n        \"summary\": \"Get request by ID\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"parameters\": [\n          {\n            \"description\": \"The UUID of the logged request\",\n            \"in\": \"path\",\n            \"name\": \"requestId\",\n            \"required\": true,\n            \"example\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"OK\",\n            \"content\": {\n              \"application/json\": {\n                \"example\": {\n                  \"id\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n                  \"request\": {\n                    \"url\": \"/received-request/2\",\n                    \"absoluteUrl\": \"http://localhost:56738/received-request/2\",\n                    \"method\": \"GET\",\n                    \"clientIp\": \"127.0.0.1\",\n                    \"headers\": {\n                      \"Connection\": \"keep-alive\",\n                      \"Host\": \"localhost:56738\",\n                      \"User-Agent\": \"Apache-HttpClient/4.5.1 (Java/1.7.0_51)\"\n                    },\n                    \"cookies\": {},\n                    \"browserProxyRequest\": false,\n                    \"loggedDate\": 1471442557047,\n                    \"bodyAsBase64\": \"\",\n                    \"body\": \"\",\n                    \"loggedDateString\": \"2016-08-17T14:02:37Z\"\n                  },\n                  \"responseDefinition\": {\n                    \"status\": 404,\n                    \"transformers\": [],\n                    \"fromConfiguredStub\": false,\n                    \"transformerParameters\": {}\n                  }\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"Request not found\"\n          }\n        }\n      },\n      \"delete\": {\n        \"operationId\": \"deleteRequestById\",\n        \"summary\": \"Delete request by ID\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"parameters\": [\n          {\n            \"description\": \"The UUID of the logged request\",\n            \"in\": \"path\",\n            \"name\": \"requestId\",\n            \"required\": true,\n            \"example\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully deleted\"\n          }\n        }\n      }\n    },\n    \"/__admin/requests/reset\": {\n      \"post\": {\n        \"operationId\": \"emptyRequestJournal\",\n        \"deprecated\": true,\n        \"summary\": \"Empty the request journal\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully reset\"\n          }\n        }\n      }\n    },\n    \"/__admin/requests/count\": {\n      \"post\": {\n        \"operationId\": \"countRequestsByCriteria\",\n        \"summary\": \"Count requests by criteria\",\n        \"description\": \"Count requests logged in the journal matching the specified criteria\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"requestBody\": {\n          \"$ref\": \"#/components/requestBodies/requestPattern\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Number of matching requests\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"count\": {\n                      \"type\": \"integer\",\n                      \"example\": 4\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/requests/remove\": {\n      \"post\": {\n        \"operationId\": \"removeRequestsByCriteria\",\n        \"summary\": \"Remove requests by criteria\",\n        \"description\": \"Removed requests logged in the journal matching the specified criteria\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"requestBody\": {\n          \"$ref\": \"#/components/requestBodies/requestPattern\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Removed request details\",\n            \"content\": {\n              \"application/json\": {\n                \"example\": {\n                  \"requests\": [\n                    {\n                      \"url\": \"/my/url\",\n                      \"absoluteUrl\": \"http://mydomain.com/my/url\",\n                      \"method\": \"GET\",\n                      \"headers\": {\n                        \"Accept-Language\": \"en-us,en;q=0.5\",\n                        \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0\",\n                        \"Accept\": \"image/png,image/*;q=0.8,*/*;q=0.5\"\n                      },\n                      \"body\": \"\",\n                      \"browserProxyRequest\": true,\n                      \"loggedDate\": 1339083581823,\n                      \"loggedDateString\": \"2012-06-07 16:39:41\"\n                    },\n                    {\n                      \"url\": \"/my/other/url\",\n                      \"absoluteUrl\": \"http://my.other.domain.com/my/other/url\",\n                      \"method\": \"POST\",\n                      \"headers\": {\n                        \"Accept\": \"text/plain\",\n                        \"Content-Type\": \"text/plain\"\n                      },\n                      \"body\": \"My text\",\n                      \"browserProxyRequest\": false,\n                      \"loggedDate\": 1339083581823,\n                      \"loggedDateString\": \"2012-06-07 16:39:41\"\n                    }\n                  ]\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/requests/remove-by-metadata\": {\n      \"post\": {\n        \"operationId\": \"removeRequestsByMetadata\",\n        \"summary\": \"Delete requests mappings matching metadata\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/content-pattern\"\n              },\n              \"example\": {\n                \"matchesJsonPath\": {\n                  \"expression\": \"$.outer\",\n                  \"equalToJson\": \"{ \\\"inner\\\": 42 }\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Removed request details\",\n            \"content\": {\n              \"application/json\": {\n                \"example\": {\n                  \"requests\": [\n                    {\n                      \"url\": \"/my/url\",\n                      \"absoluteUrl\": \"http://mydomain.com/my/url\",\n                      \"method\": \"GET\",\n                      \"headers\": {\n                        \"Accept-Language\": \"en-us,en;q=0.5\",\n                        \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0\",\n                        \"Accept\": \"image/png,image/*;q=0.8,*/*;q=0.5\"\n                      },\n                      \"body\": \"\",\n                      \"browserProxyRequest\": true,\n                      \"loggedDate\": 1339083581823,\n                      \"loggedDateString\": \"2012-06-07 16:39:41\"\n                    },\n                    {\n                      \"url\": \"/my/other/url\",\n                      \"absoluteUrl\": \"http://my.other.domain.com/my/other/url\",\n                      \"method\": \"POST\",\n                      \"headers\": {\n                        \"Accept\": \"text/plain\",\n                        \"Content-Type\": \"text/plain\"\n                      },\n                      \"body\": \"My text\",\n                      \"browserProxyRequest\": false,\n                      \"loggedDate\": 1339083581823,\n                      \"loggedDateString\": \"2012-06-07 16:39:41\"\n                    }\n                  ]\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/requests/find\": {\n      \"post\": {\n        \"operationId\": \"findRequestsByCriteria\",\n        \"summary\": \"Find requests by criteria\",\n        \"description\": \"Retrieve details of requests logged in the journal matching the specified criteria\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"requestBody\": {\n          \"$ref\": \"#/components/requestBodies/requestPattern\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Matching request details\",\n            \"content\": {\n              \"application/json\": {\n                \"example\": {\n                  \"requests\": [\n                    {\n                      \"url\": \"/my/url\",\n                      \"absoluteUrl\": \"http://mydomain.com/my/url\",\n                      \"method\": \"GET\",\n                      \"headers\": {\n                        \"Accept-Language\": \"en-us,en;q=0.5\",\n                        \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0\",\n                        \"Accept\": \"image/png,image/*;q=0.8,*/*;q=0.5\"\n                      },\n                      \"body\": \"\",\n                      \"browserProxyRequest\": true,\n                      \"loggedDate\": 1339083581823,\n                      \"loggedDateString\": \"2012-06-07 16:39:41\"\n                    },\n                    {\n                      \"url\": \"/my/other/url\",\n                      \"absoluteUrl\": \"http://my.other.domain.com/my/other/url\",\n                      \"method\": \"POST\",\n                      \"headers\": {\n                        \"Accept\": \"text/plain\",\n                        \"Content-Type\": \"text/plain\"\n                      },\n                      \"body\": \"My text\",\n                      \"browserProxyRequest\": false,\n                      \"loggedDate\": 1339083581823,\n                      \"loggedDateString\": \"2012-06-07 16:39:41\"\n                    }\n                  ]\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/requests/unmatched\": {\n      \"get\": {\n        \"operationId\": \"findUnmatchedRequests\",\n        \"summary\": \"Find unmatched requests\",\n        \"description\": \"Get details of logged requests that weren't matched by any stub mapping\",\n        \"tags\": [\n          \"Requests\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Unmatched request details\",\n            \"content\": {\n              \"application/json\": {\n                \"example\": {\n                  \"requests\": [\n                    {\n                      \"url\": \"/my/url\",\n                      \"absoluteUrl\": \"http://mydomain.com/my/url\",\n                      \"method\": \"GET\",\n                      \"headers\": {\n                        \"Accept-Language\": \"en-us,en;q=0.5\",\n                        \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0\",\n                        \"Accept\": \"image/png,image/*;q=0.8,*/*;q=0.5\"\n                      },\n                      \"body\": \"\",\n                      \"browserProxyRequest\": true,\n                      \"loggedDate\": 1339083581823,\n                      \"loggedDateString\": \"2012-06-07 16:39:41\"\n                    },\n                    {\n                      \"url\": \"/my/other/url\",\n                      \"absoluteUrl\": \"http://my.other.domain.com/my/other/url\",\n                      \"method\": \"POST\",\n                      \"headers\": {\n                        \"Accept\": \"text/plain\",\n                        \"Content-Type\": \"text/plain\"\n                      },\n                      \"body\": \"My text\",\n                      \"browserProxyRequest\": false,\n                      \"loggedDate\": 1339083581823,\n                      \"loggedDateString\": \"2012-06-07 16:39:41\"\n                    }\n                  ]\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/requests/unmatched/near-misses\": {\n      \"get\": {\n        \"operationId\": \"retrieveNearMissesForUnmatchedRequests\",\n        \"description\": \"Retrieve near-misses for all unmatched requests\",\n        \"tags\": [\n          \"Near Misses\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"$ref\": \"#/components/responses/nearMisses\"\n          }\n        }\n      }\n    },\n    \"/__admin/near-misses/request\": {\n      \"post\": {\n        \"operationId\": \"findNearMissesForRequest\",\n        \"summary\": \"Find near misses matching specific request\",\n        \"description\": \"Find at most 3 near misses for closest stub mappings to the specified request\",\n        \"tags\": [\n          \"Near Misses\"\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/logged-request\"\n              },\n              \"example\": {\n                \"url\": \"/actual\",\n                \"absoluteUrl\": \"http://localhost:8080/actual\",\n                \"method\": \"GET\",\n                \"clientIp\": \"0:0:0:0:0:0:0:1\",\n                \"headers\": {\n                  \"User-Agent\": \"curl/7.30.0\",\n                  \"Accept\": \"*/*\",\n                  \"Host\": \"localhost:8080\"\n                },\n                \"cookies\": {},\n                \"browserProxyRequest\": false,\n                \"loggedDate\": 1467402464520,\n                \"bodyAsBase64\": \"\",\n                \"body\": \"\",\n                \"loggedDateString\": \"2016-07-01T19:47:44Z\"\n              }\n            }\n          },\n          \"required\": true\n        },\n        \"responses\": {\n          \"200\": {\n            \"$ref\": \"#/components/responses/nearMisses\"\n          }\n        }\n      }\n    },\n    \"/__admin/near-misses/request-pattern\": {\n      \"post\": {\n        \"operationId\": \"findNearMissesForRequestPattern\",\n        \"summary\": \"Find near misses matching request pattern\",\n        \"description\": \"Find at most 3 near misses for closest logged requests to the specified request pattern\",\n        \"tags\": [\n          \"Near Misses\"\n        ],\n        \"requestBody\": {\n          \"$ref\": \"#/components/requestBodies/requestPattern\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"$ref\": \"#/components/responses/nearMisses\"\n          }\n        }\n      }\n    },\n    \"/__admin/recordings/start\": {\n      \"post\": {\n        \"operationId\": \"startRecording\",\n        \"summary\": \"Start recording\",\n        \"description\": \"Begin recording stub mappings\",\n        \"tags\": [\n          \"Recordings\"\n        ],\n        \"requestBody\": {\n          \"$ref\": \"#/components/requestBodies/startRecording\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully started recording\"\n          }\n        }\n      }\n    },\n    \"/__admin/recordings/stop\": {\n      \"post\": {\n        \"operationId\": \"stopRecording\",\n        \"summary\": \"Stop recording\",\n        \"description\": \"End recording of stub mappings\",\n        \"tags\": [\n          \"Recordings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/stub-mappings\"\n                },\n                \"example\": {\n                  \"mappings\": [\n                    {\n                      \"id\": \"093f1027-e5e0-4921-9e6d-e619dfd5d2c7\",\n                      \"name\": \"recordables_123\",\n                      \"request\": {\n                        \"url\": \"/recordables/123\",\n                        \"method\": \"GET\"\n                      },\n                      \"response\": {\n                        \"status\": 200,\n                        \"body\": \"{\\n  \\\"message\\\": \\\"Congratulations on your first recording!\\\"\\n}\",\n                        \"headers\": {\n                          \"Content-Type\": \"application/json\"\n                        }\n                      },\n                      \"uuid\": \"093f1027-e5e0-4921-9e6d-e619dfd5d2c7\",\n                      \"persistent\": true\n                    }\n                  ]\n                }\n              }\n            },\n            \"description\": \"Successfully stopped recording\"\n          }\n        }\n      }\n    },\n    \"/__admin/recordings/status\": {\n      \"get\": {\n        \"operationId\": \"getRecordingStatus\",\n        \"summary\": \"Get recording status\",\n        \"tags\": [\n          \"Recordings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully got the record status\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"status\": {\n                      \"type\": \"string\",\n                      \"example\": \"Stopped\",\n                      \"enum\": [\n                        \"NeverStarted\",\n                        \"Recording\",\n                        \"Stopped\"\n                      ]\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/recordings/snapshot\": {\n      \"post\": {\n        \"operationId\": \"takeRecordingSnapshot\",\n        \"summary\": \"Take a snapshot recording\",\n        \"tags\": [\n          \"Recordings\"\n        ],\n        \"requestBody\": {\n          \"$ref\": \"#/components/requestBodies/snapshotRecording\"\n        },\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/stub-mappings\"\n                },\n                \"example\": {\n                  \"mappings\": [\n                    {\n                      \"id\": \"093f1027-e5e0-4921-9e6d-e619dfd5d2c7\",\n                      \"name\": \"recordables_123\",\n                      \"request\": {\n                        \"url\": \"/recordables/123\",\n                        \"method\": \"GET\"\n                      },\n                      \"response\": {\n                        \"status\": 200,\n                        \"body\": \"{\\n  \\\"message\\\": \\\"Congratulations on your first recording!\\\"\\n}\",\n                        \"headers\": {\n                          \"Content-Type\": \"application/json\"\n                        }\n                      },\n                      \"uuid\": \"093f1027-e5e0-4921-9e6d-e619dfd5d2c7\",\n                      \"persistent\": true\n                    }\n                  ]\n                }\n              }\n            },\n            \"description\": \"Successfully took a snapshot recording\"\n          }\n        }\n      }\n    },\n    \"/__admin/scenarios\": {\n      \"get\": {\n        \"operationId\": \"getAllScenarios\",\n        \"summary\": \"Get all scenarios\",\n        \"tags\": [\n          \"Scenarios\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"scenarios\": {\n                      \"type\": \"array\",\n                      \"items\": {\n                        \"$ref\": \"#/components/schemas/scenario\"\n                      }\n                    }\n                  }\n                }\n              }\n            },\n            \"description\": \"All scenarios\"\n          }\n        }\n      }\n    },\n    \"/__admin/scenarios/reset\": {\n      \"post\": {\n        \"operationId\": \"resetAllScenarios\",\n        \"summary\": \"Reset the state of all scenarios\",\n        \"tags\": [\n          \"Scenarios\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully reset\"\n          }\n        }\n      }\n    },\n    \"/__admin/files\": {\n      \"get\": {\n        \"operationId\": \"getAllFileNames\",\n        \"summary\": \"Get all file names\",\n        \"tags\": [\n          \"Files\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\"\n                  },\n                  \"example\": [\n                    \"file1.json\",\n                    \"file2.json\",\n                    \"file3.txt\"\n                  ]\n                }\n              }\n            },\n            \"description\": \"All scenarios\"\n          }\n        }\n      }\n    },\n    \"/__admin/files/{fileId}\": {\n      \"parameters\": [\n        {\n          \"description\": \"The name of the file\",\n          \"in\": \"path\",\n          \"name\": \"fileId\",\n          \"required\": true,\n          \"example\": \"file1.json\",\n          \"schema\": {\n            \"type\": \"string\"\n          }\n        }\n      ],\n      \"get\": {\n        \"operationId\": \"getFileById\",\n        \"summary\": \"Get file by ID\",\n        \"tags\": [\n          \"Files\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The contents of the file\"\n          },\n          \"404\": {\n            \"description\": \"File not found\"\n          }\n        }\n      },\n      \"put\": {\n        \"operationId\": \"updateFileById\",\n        \"summary\": \"Update or create a file\",\n        \"tags\": [\n          \"Files\"\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/octet-stream\": {\n              \"schema\": {\n                \"type\": \"string\",\n                \"format\": \"byte\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"OK - contents of the request body as a string\"\n          }\n        }\n      },\n      \"delete\": {\n        \"operationId\": \"deleteFileById\",\n        \"summary\": \"Delete a file if it exists\",\n        \"tags\": [\n          \"Files\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"OK\"\n          }\n        }\n      }\n    },\n    \"/__admin/settings\": {\n      \"post\": {\n        \"operationId\": \"updateGlobalSettings\",\n        \"summary\": \"Update global settings\",\n        \"tags\": [\n          \"System\"\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"allOf\": [\n                  {\n                    \"$ref\": \"#/components/schemas/delay-distribution\"\n                  },\n                  {\n                    \"type\": \"object\",\n                    \"properties\": {\n                      \"fixedDelay\": {\n                        \"type\": \"number\"\n                      }\n                    },\n                    \"example\": {\n                      \"fixedDelay\": 500\n                    }\n                  }\n                ]\n              }\n            }\n          },\n          \"required\": true\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Settings successfully updated\"\n          }\n        }\n      }\n    },\n    \"/__admin/reset\": {\n      \"post\": {\n        \"operationId\": \"resetMappingsAndJournal\",\n        \"summary\": \"Reset mappings and request journal\",\n        \"description\": \"Reset mappings to the default state and reset the request journal\",\n        \"tags\": [\n          \"System\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully reset\"\n          }\n        }\n      }\n    },\n    \"/__admin/shutdown\": {\n      \"post\": {\n        \"operationId\": \"shutdownServer\",\n        \"summary\": \"Shutdown the WireMock server\",\n        \"description\": \"Shutdown the WireMock server\",\n        \"tags\": [\n          \"System\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Server will be shut down\"\n          }\n        }\n      }\n    },\n    \"/__admin/version\": {\n      \"get\": {\n        \"operationId\": \"getVersion\",\n        \"summary\": \"Return the version of the WireMock server\",\n        \"description\": \"Returns the version of the WireMock server\",\n        \"tags\": [\n          \"System\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully returned the version of the WireMock server\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"version\": {\n                      \"type\": \"string\",\n                      \"example\": \"3.8.0\"\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/message-mappings\": {\n      \"get\": {\n        \"operationId\": \"getAllMessageStubMappings\",\n        \"summary\": \"Get all message stub mappings\",\n        \"tags\": [\n          \"Message Mappings\"\n        ],\n        \"parameters\": [\n          {\n            \"description\": \"The maximum number of results to return\",\n            \"in\": \"query\",\n            \"name\": \"limit\",\n            \"required\": false,\n            \"example\": 10,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          },\n          {\n            \"description\": \"The start index of the results to return\",\n            \"in\": \"query\",\n            \"name\": \"offset\",\n            \"required\": false,\n            \"example\": 0,\n            \"schema\": {\n              \"type\": \"integer\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-stub-mappings\"\n                },\n                \"example\": {\n                  \"messageMappings\": [\n                    {\n                      \"id\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n                      \"name\": \"Echo WebSocket messages\",\n                      \"priority\": 5,\n                      \"trigger\": {\n                        \"type\": \"message\",\n                        \"channel\": {\n                          \"type\": \"websocket\",\n                          \"initiatingRequestPattern\": {\n                            \"urlPath\": \"/ws/echo\"\n                          }\n                        }\n                      },\n                      \"actions\": [\n                        {\n                          \"type\": \"send\",\n                          \"message\": {\n                            \"body\": {\n                              \"data\": \"Echo response\"\n                            }\n                          },\n                          \"channelTarget\": {\n                            \"type\": \"originating\"\n                          }\n                        }\n                      ]\n                    },\n                    {\n                      \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"name\": \"Broadcast to all WebSocket clients\",\n                      \"trigger\": {\n                        \"type\": \"http-request\",\n                        \"requestPattern\": {\n                          \"method\": \"POST\",\n                          \"urlPath\": \"/broadcast\"\n                        }\n                      },\n                      \"actions\": [\n                        {\n                          \"type\": \"send\",\n                          \"message\": {\n                            \"body\": {\n                              \"data\": \"Broadcast message\"\n                            }\n                          },\n                          \"channelTarget\": {\n                            \"type\": \"request-initiated\",\n                            \"channelType\": \"websocket\",\n                            \"requestPattern\": {\n                              \"urlPathPattern\": \"/ws/.*\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  ],\n                  \"meta\": {\n                    \"total\": 2\n                  }\n                }\n              }\n            },\n            \"description\": \"All message stub mappings\"\n          }\n        }\n      },\n      \"post\": {\n        \"operationId\": \"createMessageStubMapping\",\n        \"summary\": \"Create a new message stub mapping\",\n        \"tags\": [\n          \"Message Mappings\"\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/message-stub-mapping\"\n              },\n              \"example\": {\n                \"id\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n                \"name\": \"Echo WebSocket messages\",\n                \"priority\": 5,\n                \"trigger\": {\n                  \"type\": \"message\",\n                  \"channel\": {\n                    \"type\": \"websocket\",\n                    \"initiatingRequestPattern\": {\n                      \"urlPath\": \"/ws/echo\"\n                    }\n                  },\n                  \"message\": {\n                    \"body\": {\n                      \"contains\": \"hello\"\n                    }\n                  }\n                },\n                \"actions\": [\n                  {\n                    \"type\": \"send\",\n                    \"message\": {\n                      \"body\": {\n                        \"data\": \"Echo: hello\"\n                      }\n                    },\n                    \"channelTarget\": {\n                      \"type\": \"originating\"\n                    }\n                  }\n                ],\n                \"metadata\": {\n                  \"tags\": [\n                    \"websocket\",\n                    \"echo\"\n                  ]\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Message stub mapping created\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-stub-mapping\"\n                },\n                \"example\": {\n                  \"id\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n                  \"name\": \"Echo WebSocket messages\",\n                  \"priority\": 5,\n                  \"trigger\": {\n                    \"type\": \"message\",\n                    \"channel\": {\n                      \"type\": \"websocket\",\n                      \"initiatingRequestPattern\": {\n                        \"urlPath\": \"/ws/echo\"\n                      }\n                    },\n                    \"message\": {\n                      \"body\": {\n                        \"contains\": \"hello\"\n                      }\n                    }\n                  },\n                  \"actions\": [\n                    {\n                      \"type\": \"send\",\n                      \"message\": {\n                        \"body\": {\n                          \"data\": \"Echo: hello\"\n                        }\n                      },\n                      \"channelTarget\": {\n                        \"type\": \"originating\"\n                      }\n                    }\n                  ],\n                  \"metadata\": {\n                    \"tags\": [\n                      \"websocket\",\n                      \"echo\"\n                    ]\n                  }\n                }\n              }\n            }\n          },\n          \"422\": {\n            \"$ref\": \"#/components/responses/badRequestEntity\"\n          }\n        }\n      },\n      \"delete\": {\n        \"operationId\": \"deleteAllMessageStubMappings\",\n        \"summary\": \"Delete all message stub mappings\",\n        \"tags\": [\n          \"Message Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully deleted\"\n          }\n        }\n      }\n    },\n    \"/__admin/message-mappings/{id}\": {\n      \"parameters\": [\n        {\n          \"description\": \"The UUID of the message stub mapping\",\n          \"in\": \"path\",\n          \"name\": \"id\",\n          \"required\": true,\n          \"example\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n          \"schema\": {\n            \"type\": \"string\"\n          }\n        }\n      ],\n      \"delete\": {\n        \"operationId\": \"deleteMessageStubMapping\",\n        \"summary\": \"Delete a message stub mapping\",\n        \"tags\": [\n          \"Message Mappings\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully deleted\"\n          },\n          \"404\": {\n            \"description\": \"Message stub mapping not found\"\n          }\n        }\n      }\n    },\n    \"/__admin/message-mappings/find-by-metadata\": {\n      \"post\": {\n        \"operationId\": \"findMessageStubMappingsByMetadata\",\n        \"summary\": \"Find message stub mappings by metadata\",\n        \"description\": \"Find message stub mappings by matching on their metadata\",\n        \"tags\": [\n          \"Message Mappings\"\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/content-pattern\"\n              },\n              \"example\": {\n                \"matchesJsonPath\": {\n                  \"expression\": \"$.outer\",\n                  \"equalToJson\": \"{ \\\"inner\\\": 42 }\"\n                }\n              }\n            }\n          },\n          \"required\": true\n        },\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-stub-mappings\"\n                },\n                \"example\": {\n                  \"messageMappings\": [\n                    {\n                      \"id\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n                      \"name\": \"Echo WebSocket messages\",\n                      \"priority\": 5,\n                      \"trigger\": {\n                        \"type\": \"message\",\n                        \"channel\": {\n                          \"type\": \"websocket\",\n                          \"initiatingRequestPattern\": {\n                            \"urlPath\": \"/ws/echo\"\n                          }\n                        }\n                      },\n                      \"actions\": [\n                        {\n                          \"type\": \"send\",\n                          \"message\": {\n                            \"body\": {\n                              \"data\": \"Echo response\"\n                            }\n                          },\n                          \"channelTarget\": {\n                            \"type\": \"originating\"\n                          }\n                        }\n                      ]\n                    },\n                    {\n                      \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"name\": \"Broadcast to all WebSocket clients\",\n                      \"trigger\": {\n                        \"type\": \"http-request\",\n                        \"requestPattern\": {\n                          \"method\": \"POST\",\n                          \"urlPath\": \"/broadcast\"\n                        }\n                      },\n                      \"actions\": [\n                        {\n                          \"type\": \"send\",\n                          \"message\": {\n                            \"body\": {\n                              \"data\": \"Broadcast message\"\n                            }\n                          },\n                          \"channelTarget\": {\n                            \"type\": \"request-initiated\",\n                            \"channelType\": \"websocket\",\n                            \"requestPattern\": {\n                              \"urlPathPattern\": \"/ws/.*\"\n                            }\n                          }\n                        }\n                      ]\n                    }\n                  ],\n                  \"meta\": {\n                    \"total\": 2\n                  }\n                }\n              }\n            },\n            \"description\": \"Matched message stub mappings\"\n          }\n        }\n      }\n    },\n    \"/__admin/message-mappings/remove-by-metadata\": {\n      \"post\": {\n        \"operationId\": \"removeMessageStubMappingsByMetadata\",\n        \"summary\": \"Delete message stub mappings matching metadata\",\n        \"tags\": [\n          \"Message Mappings\"\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/content-pattern\"\n              },\n              \"example\": {\n                \"matchesJsonPath\": {\n                  \"expression\": \"$.outer\",\n                  \"equalToJson\": \"{ \\\"inner\\\": 42 }\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The message stub mappings were successfully removed\"\n          }\n        }\n      }\n    },\n    \"/__admin/messages\": {\n      \"get\": {\n        \"operationId\": \"getAllMessageEvents\",\n        \"summary\": \"Get all message events in journal\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-serve-events-result\"\n                },\n                \"example\": {\n                  \"messageServeEvents\": [\n                    {\n                      \"id\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n                      \"eventType\": \"RECEIVED\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:00Z\"\n                    },\n                    {\n                      \"id\": \"98765432-abcd-ef12-3456-7890abcdef12\",\n                      \"eventType\": \"SENT\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Echo: Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:01Z\"\n                    }\n                  ],\n                  \"messageJournalDisabled\": false\n                }\n              }\n            },\n            \"description\": \"List of message events\"\n          }\n        }\n      },\n      \"delete\": {\n        \"operationId\": \"deleteAllMessageEvents\",\n        \"summary\": \"Delete all message events in journal\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully deleted\"\n          }\n        }\n      }\n    },\n    \"/__admin/messages/{id}\": {\n      \"parameters\": [\n        {\n          \"description\": \"The UUID of the message event\",\n          \"in\": \"path\",\n          \"name\": \"id\",\n          \"required\": true,\n          \"example\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n          \"schema\": {\n            \"type\": \"string\"\n          }\n        }\n      ],\n      \"get\": {\n        \"operationId\": \"getMessageEventById\",\n        \"summary\": \"Get message event by ID\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"OK\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/single-message-serve-event-result\"\n                },\n                \"example\": {\n                  \"id\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n                  \"eventType\": \"RECEIVED\",\n                  \"channelType\": \"websocket\",\n                  \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                  \"channelRequest\": {\n                    \"url\": \"/ws/chat\",\n                    \"absoluteUrl\": \"http://localhost:8080/ws/chat\",\n                    \"method\": \"GET\",\n                    \"clientIp\": \"127.0.0.1\",\n                    \"headers\": {\n                      \"Host\": \"localhost:8080\",\n                      \"Upgrade\": \"websocket\",\n                      \"Connection\": \"Upgrade\"\n                    },\n                    \"cookies\": {},\n                    \"browserProxyRequest\": false,\n                    \"loggedDate\": 1609459200000,\n                    \"loggedDateString\": \"2021-01-01T00:00:00Z\"\n                  },\n                  \"message\": \"Hello, WebSocket!\",\n                  \"stubMapping\": {\n                    \"id\": \"730d3e32-d098-4169-a20c-554c3bedce58\",\n                    \"name\": \"Echo WebSocket messages\",\n                    \"trigger\": {\n                      \"type\": \"message\",\n                      \"channel\": {\n                        \"type\": \"websocket\",\n                        \"initiatingRequestPattern\": {\n                          \"urlPath\": \"/ws/chat\"\n                        }\n                      }\n                    },\n                    \"actions\": [\n                      {\n                        \"type\": \"send\",\n                        \"message\": {\n                          \"body\": {\n                            \"data\": \"Echo: Hello, WebSocket!\"\n                          }\n                        },\n                        \"channelTarget\": {\n                          \"type\": \"originating\"\n                        }\n                      }\n                    ]\n                  },\n                  \"wasMatched\": true,\n                  \"timestamp\": \"2021-01-01T00:00:00Z\",\n                  \"subEvents\": []\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"Message event not found\"\n          }\n        }\n      },\n      \"delete\": {\n        \"operationId\": \"deleteMessageEventById\",\n        \"summary\": \"Delete message event by ID\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"parameters\": [\n          {\n            \"description\": \"The UUID of the message event\",\n            \"in\": \"path\",\n            \"name\": \"id\",\n            \"required\": true,\n            \"example\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successfully deleted\"\n          }\n        }\n      }\n    },\n    \"/__admin/messages/count\": {\n      \"post\": {\n        \"operationId\": \"countMessageEventsByCriteria\",\n        \"summary\": \"Count message events by criteria\",\n        \"description\": \"Count message events logged in the journal matching the specified criteria\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/message-pattern\"\n              },\n              \"example\": {\n                \"channel\": {\n                  \"urlPath\": \"/ws/chat\",\n                  \"method\": \"GET\"\n                },\n                \"body\": {\n                  \"contains\": \"hello\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Number of matching message events\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-verification-result\"\n                },\n                \"example\": {\n                  \"count\": 4,\n                  \"messageJournalDisabled\": false\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/messages/find\": {\n      \"post\": {\n        \"operationId\": \"findMessageEventsByCriteria\",\n        \"summary\": \"Find message events by criteria\",\n        \"description\": \"Retrieve details of message events logged in the journal matching the specified criteria\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/message-pattern\"\n              },\n              \"example\": {\n                \"channel\": {\n                  \"urlPath\": \"/ws/chat\",\n                  \"method\": \"GET\"\n                },\n                \"body\": {\n                  \"contains\": \"hello\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Matching message event details\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-serve-events-result\"\n                },\n                \"example\": {\n                  \"messageServeEvents\": [\n                    {\n                      \"id\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n                      \"eventType\": \"RECEIVED\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:00Z\"\n                    },\n                    {\n                      \"id\": \"98765432-abcd-ef12-3456-7890abcdef12\",\n                      \"eventType\": \"SENT\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Echo: Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:01Z\"\n                    }\n                  ],\n                  \"messageJournalDisabled\": false\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/messages/remove\": {\n      \"post\": {\n        \"operationId\": \"removeMessageEventsByCriteria\",\n        \"summary\": \"Remove message events by criteria\",\n        \"description\": \"Remove message events logged in the journal matching the specified criteria\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/message-pattern\"\n              },\n              \"example\": {\n                \"channel\": {\n                  \"urlPath\": \"/ws/chat\",\n                  \"method\": \"GET\"\n                },\n                \"body\": {\n                  \"contains\": \"hello\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Removed message event details\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-serve-events-result\"\n                },\n                \"example\": {\n                  \"messageServeEvents\": [\n                    {\n                      \"id\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n                      \"eventType\": \"RECEIVED\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:00Z\"\n                    },\n                    {\n                      \"id\": \"98765432-abcd-ef12-3456-7890abcdef12\",\n                      \"eventType\": \"SENT\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Echo: Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:01Z\"\n                    }\n                  ],\n                  \"messageJournalDisabled\": false\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/messages/remove-by-metadata\": {\n      \"post\": {\n        \"operationId\": \"removeMessageEventsByMetadata\",\n        \"summary\": \"Delete message events matching metadata\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/content-pattern\"\n              },\n              \"example\": {\n                \"matchesJsonPath\": {\n                  \"expression\": \"$.outer\",\n                  \"equalToJson\": \"{ \\\"inner\\\": 42 }\"\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Removed message event details\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-serve-events-result\"\n                },\n                \"example\": {\n                  \"messageServeEvents\": [\n                    {\n                      \"id\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n                      \"eventType\": \"RECEIVED\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:00Z\"\n                    },\n                    {\n                      \"id\": \"98765432-abcd-ef12-3456-7890abcdef12\",\n                      \"eventType\": \"SENT\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Echo: Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:01Z\"\n                    }\n                  ],\n                  \"messageJournalDisabled\": false\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/messages/wait\": {\n      \"post\": {\n        \"operationId\": \"waitForMessageEvent\",\n        \"summary\": \"Wait for a message event\",\n        \"description\": \"Wait for a message event matching the specified pattern\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/wait-for-message-request\"\n              },\n              \"example\": {\n                \"pattern\": {\n                  \"channel\": {\n                    \"urlPath\": \"/ws/chat\"\n                  },\n                  \"body\": {\n                    \"contains\": \"hello\"\n                  }\n                },\n                \"timeoutMillis\": 5000,\n                \"count\": 1\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Message event result (may be null if timeout)\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/single-message-serve-event-result\"\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/messages/wait-for-count\": {\n      \"post\": {\n        \"operationId\": \"waitForMessageEvents\",\n        \"summary\": \"Wait for multiple message events\",\n        \"description\": \"Wait for a specified number of message events matching the specified pattern\",\n        \"tags\": [\n          \"Messages\"\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/wait-for-message-request\"\n              },\n              \"example\": {\n                \"pattern\": {\n                  \"body\": {\n                    \"contains\": \"hello\"\n                  }\n                },\n                \"timeoutMillis\": 5000,\n                \"count\": 3\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Message events result\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-serve-events-result\"\n                },\n                \"example\": {\n                  \"messageServeEvents\": [\n                    {\n                      \"id\": \"12fb14bb-600e-4bfa-bd8d-be7f12562c99\",\n                      \"eventType\": \"RECEIVED\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:00Z\"\n                    },\n                    {\n                      \"id\": \"98765432-abcd-ef12-3456-7890abcdef12\",\n                      \"eventType\": \"SENT\",\n                      \"channelType\": \"websocket\",\n                      \"channelId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"channelRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"message\": \"Echo: Hello, WebSocket!\",\n                      \"wasMatched\": true,\n                      \"timestamp\": \"2021-01-01T00:00:01Z\"\n                    }\n                  ],\n                  \"messageJournalDisabled\": false\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/channels\": {\n      \"get\": {\n        \"operationId\": \"getAllMessageChannels\",\n        \"summary\": \"Get all message channels\",\n        \"description\": \"Get all active message channels\",\n        \"tags\": [\n          \"Channels\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/message-channels-result\"\n                },\n                \"example\": {\n                  \"channels\": [\n                    {\n                      \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"type\": \"websocket\",\n                      \"initiatingRequest\": {\n                        \"url\": \"/ws/chat\",\n                        \"method\": \"GET\"\n                      },\n                      \"open\": true\n                    },\n                    {\n                      \"id\": \"b2c3d4e5-f6a7-8901-bcde-f12345678901\",\n                      \"type\": \"websocket\",\n                      \"initiatingRequest\": {\n                        \"url\": \"/ws/notifications\",\n                        \"method\": \"GET\"\n                      },\n                      \"open\": true\n                    }\n                  ],\n                  \"meta\": {\n                    \"total\": 2\n                  }\n                }\n              }\n            },\n            \"description\": \"All message channels\"\n          }\n        }\n      }\n    },\n    \"/__admin/channels/send\": {\n      \"post\": {\n        \"operationId\": \"sendChannelMessage\",\n        \"summary\": \"Send a message to channels\",\n        \"description\": \"Send a message to all channels matching the specified criteria\",\n        \"tags\": [\n          \"Channels\"\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/send-channel-message-request\"\n              },\n              \"example\": {\n                \"type\": \"websocket\",\n                \"initiatingRequest\": {\n                  \"urlPathPattern\": \"/ws/.*\"\n                },\n                \"message\": {\n                  \"body\": {\n                    \"data\": \"Broadcast message to all WebSocket clients\"\n                  }\n                }\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Message sent successfully\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/send-channel-message-result\"\n                },\n                \"example\": {\n                  \"channels\": [\n                    {\n                      \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n                      \"type\": \"websocket\",\n                      \"open\": true\n                    }\n                  ],\n                  \"channelsMessaged\": 1\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"/__admin/health\": {\n      \"get\": {\n        \"operationId\": \"getHealth\",\n        \"summary\": \"Return the health of the WireMock server\",\n        \"description\": \"Returns the health of the WireMock server\",\n        \"tags\": [\n          \"System\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Successful health and uptime data\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/health\"\n                },\n                \"example\": {\n                  \"status\": \"healthy\",\n                  \"message\": \"Wiremock is ok\",\n                  \"version\": \"3.8.0\",\n                  \"uptimeInSeconds\": 14355,\n                  \"timestamp\": \"2024-07-03T13:16:06.172362Z\"\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"requestBodies\": {\n      \"requestPattern\": {\n        \"required\": true,\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/request-pattern\"\n            },\n            \"example\": {\n              \"method\": \"POST\",\n              \"url\": \"/resource\",\n              \"headers\": {\n                \"Content-Type\": {\n                  \"matches\": \".*/xml\"\n                }\n              }\n            }\n          }\n        }\n      },\n      \"stubMapping\": {\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/stub-mapping\"\n            },\n            \"example\": {\n              \"request\": {\n                \"method\": \"GET\",\n                \"url\": \"/some/thing\"\n              },\n              \"response\": {\n                \"body\": \"Hello world!\",\n                \"headers\": {\n                  \"Content-Type\": \"text/plain\"\n                },\n                \"status\": 200\n              }\n            }\n          }\n        }\n      },\n      \"startRecording\": {\n        \"required\": true,\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"allOf\": [\n                {\n                  \"$ref\": \"#/components/schemas/record-spec\"\n                },\n                {\n                  \"properties\": {\n                    \"filters\": {\n                      \"allOf\": [\n                        {\n                          \"$ref\": \"#/components/schemas/request-pattern\"\n                        },\n                        {\n                          \"description\": \"Filter requests for which to create stub mapping\"\n                        }\n                      ]\n                    },\n                    \"targetBaseUrl\": {\n                      \"type\": \"string\",\n                      \"description\": \"Target URL when using the record and playback API\",\n                      \"example\": \"https://example.wiremock.org\"\n                    }\n                  }\n                }\n              ]\n            },\n            \"example\": {\n              \"targetBaseUrl\": \"http://example.mocklab.io\",\n              \"filters\": {\n                \"urlPathPattern\": \"/api/.*\",\n                \"method\": \"GET\"\n              },\n              \"captureHeaders\": {\n                \"Accept\": {},\n                \"Content-Type\": {\n                  \"caseInsensitive\": true\n                }\n              },\n              \"requestBodyPattern\": {\n                \"matcher\": \"equalToJson\",\n                \"ignoreArrayOrder\": false,\n                \"ignoreExtraElements\": true\n              },\n              \"extractBodyCriteria\": {\n                \"textSizeThreshold\": \"2048\",\n                \"binarySizeThreshold\": \"10240\"\n              },\n              \"persist\": false,\n              \"repeatsAsScenarios\": false,\n              \"transformers\": [\n                \"modify-response-header\"\n              ],\n              \"transformerParameters\": {\n                \"headerValue\": \"123\"\n              }\n            }\n          }\n        }\n      },\n      \"snapshotRecording\": {\n        \"required\": true,\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"type\": \"object\",\n              \"allOf\": [\n                {\n                  \"$ref\": \"#/components/schemas/record-spec\"\n                },\n                {\n                  \"properties\": {\n                    \"filters\": {\n                      \"type\": \"object\",\n                      \"allOf\": [\n                        {\n                          \"properties\": {\n                            \"ids\": {\n                              \"type\": \"array\",\n                              \"items\": {\n                                \"type\": \"string\"\n                              }\n                            }\n                          },\n                          \"type\": \"object\",\n                          \"description\": \"Filter requests for which to create stub mapping\"\n                        },\n                        {\n                          \"$ref\": \"#/components/schemas/request-pattern\"\n                        }\n                      ]\n                    }\n                  }\n                }\n              ]\n            },\n            \"example\": {\n              \"filters\": {\n                \"urlPathPattern\": \"/api/.*\",\n                \"method\": \"GET\",\n                \"ids\": [\n                  \"40a93c4a-d378-4e07-8321-6158d5dbcb29\"\n                ]\n              },\n              \"captureHeaders\": {\n                \"Accept\": {},\n                \"Content-Type\": {\n                  \"caseInsensitive\": true\n                }\n              },\n              \"requestBodyPattern\": {\n                \"matcher\": \"equalToJson\",\n                \"ignoreArrayOrder\": false,\n                \"ignoreExtraElements\": true\n              },\n              \"extractBodyCriteria\": {\n                \"textSizeThreshold\": \"2 kb\",\n                \"binarySizeThreshold\": \"1 Mb\"\n              },\n              \"outputFormat\": \"FULL\",\n              \"persist\": false,\n              \"repeatsAsScenarios\": false,\n              \"transformers\": [\n                \"modify-response-header\"\n              ],\n              \"transformerParameters\": {\n                \"headerValue\": \"123\"\n              }\n            }\n          }\n        }\n      }\n    },\n    \"responses\": {\n      \"stubMapping\": {\n        \"description\": \"The stub mapping\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/stub-mapping\"\n            },\n            \"example\": {\n              \"id\": \"76ada7b0-49ae-4229-91c4-396a36f18e09\",\n              \"priority\": 3,\n              \"request\": {\n                \"headers\": {\n                  \"Accept\": {\n                    \"equalTo\": \"text/plain\"\n                  }\n                },\n                \"method\": \"GET\",\n                \"url\": \"/some/thing\"\n              },\n              \"response\": {\n                \"body\": \"Hello world!\",\n                \"headers\": {\n                  \"Content-Type\": \"text/plain\"\n                },\n                \"status\": 200\n              }\n            }\n          }\n        }\n      },\n      \"nearMisses\": {\n        \"description\": \"Near misses matching criteria\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"nearMisses\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/logged-request\"\n                  }\n                }\n              }\n            },\n            \"example\": {\n              \"nearMisses\": [\n                {\n                  \"request\": {\n                    \"url\": \"/nomatch\",\n                    \"absoluteUrl\": \"http://localhost:8080/nomatch\",\n                    \"method\": \"GET\",\n                    \"clientIp\": \"0:0:0:0:0:0:0:1\",\n                    \"headers\": {\n                      \"User-Agent\": \"curl/7.30.0\",\n                      \"Accept\": \"*/*\",\n                      \"Host\": \"localhost:8080\"\n                    },\n                    \"cookies\": {},\n                    \"browserProxyRequest\": false,\n                    \"loggedDate\": 1467402464520,\n                    \"bodyAsBase64\": \"\",\n                    \"body\": \"\",\n                    \"loggedDateString\": \"2016-07-01T19:47:44Z\"\n                  },\n                  \"requestPattern\": {\n                    \"url\": \"/almostmatch\",\n                    \"method\": \"GET\"\n                  },\n                  \"matchResult\": {\n                    \"distance\": 0.06944444444444445\n                  }\n                }\n              ]\n            }\n          }\n        }\n      },\n      \"badRequestEntity\": {\n        \"description\": \"Bad request body\",\n        \"content\": {\n          \"application/json\": {\n            \"schema\": {\n              \"$ref\": \"#/components/schemas/bad-request-entity\"\n            }\n          }\n        }\n      }\n    },\n    \"schemas\": {\n      \"one-of-request-method-pattern\": {\n        \"title\": \"One of request method pattern\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"oneOf\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          }\n        },\n        \"required\": [\n          \"oneOf\"\n        ]\n      },\n      \"none-of-request-method-pattern\": {\n        \"title\": \"One of request method pattern\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"noneOf\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          }\n        },\n        \"required\": [\n          \"noneOf\"\n        ]\n      },\n      \"equal-to-pattern\": {\n        \"title\": \"String equals\",\n        \"type\": \"object\",\n        \"required\": [\n          \"equalTo\"\n        ],\n        \"properties\": {\n          \"equalTo\": {\n            \"type\": \"string\"\n          },\n          \"caseInsensitive\": {\n            \"type\": \"boolean\"\n          }\n        }\n      },\n      \"base64-string\": {\n        \"title\": \"Base64 string\",\n        \"type\": \"string\",\n        \"pattern\": \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$\",\n        \"description\": \"A base64 encoded string used to describe binary data.\"\n      },\n      \"binary-equal-to-pattern\": {\n        \"title\": \"Binary equals\",\n        \"type\": \"object\",\n        \"required\": [\n          \"binaryEqualTo\"\n        ],\n        \"properties\": {\n          \"binaryEqualTo\": {\n            \"$ref\": \"#/components/schemas/base64-string\"\n          }\n        }\n      },\n      \"contains-pattern\": {\n        \"title\": \"String contains\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"contains\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"contains\"\n        ]\n      },\n      \"does-not-contain-pattern\": {\n        \"title\": \"String does not contain\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"doesNotContain\": {\n            \"type\": \"string\"\n          }\n        },\n        \"required\": [\n          \"doesNotContain\"\n        ]\n      },\n      \"matches-pattern\": {\n        \"title\": \"Regular expression match\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"matches\": {\n            \"type\": \"string\",\n            \"x-intellij-language-injection\": \"RegExp\"\n          }\n        },\n        \"required\": [\n          \"matches\"\n        ]\n      },\n      \"does-not-match-pattern\": {\n        \"title\": \"Negative regular expression match\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"doesNotMatch\": {\n            \"type\": \"string\",\n            \"x-intellij-language-injection\": \"RegExp\"\n          }\n        },\n        \"required\": [\n          \"doesNotMatch\"\n        ]\n      },\n      \"content-pattern\": {\n        \"type\": \"object\",\n        \"title\": \"Content pattern\",\n        \"oneOf\": [\n          {\n            \"$ref\": \"#/components/schemas/equal-to-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/binary-equal-to-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/contains-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/does-not-contain-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/matches-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/does-not-match-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/not-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/before-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/after-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/equal-to-date-time-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/equal-to-json-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/matches-json-path-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/equal-to-xml-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/matches-xpath-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/matches-json-schema-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/absent-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/and-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/or-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/has-exactly-multivalue-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/includes-multivalue-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/equal-to-number-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/greater-than-number-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/greater-than-equal-number-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/less-than-number-pattern\"\n          },\n          {\n            \"$ref\": \"#/components/schemas/less-than-equal-number-pattern\"\n          }\n        ]\n      },\n      \"not-pattern\": {\n        \"title\": \"Logical NOT modifier\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"not\": {\n            \"$ref\": \"#/components/schemas/content-pattern\"\n          }\n        },\n        \"required\": [\n          \"not\"\n        ]\n      },\n      \"dateTimeExpression\": {\n        \"type\": \"string\",\n        \"example\": \"now +3 days\"\n      },\n      \"format\": {\n        \"type\": \"string\",\n        \"example\": \"yyyy-MM-dd\"\n      },\n      \"truncation\": {\n        \"type\": \"string\",\n        \"enum\": [\n          \"first second of minute\",\n          \"first minute of hour\",\n          \"first hour of day\",\n          \"first day of month\",\n          \"first day of next month\",\n          \"last day of month\",\n          \"first day of year\",\n          \"first day of next year\",\n          \"last day of year\"\n        ],\n        \"example\": \"first day of month\"\n      },\n      \"before-pattern\": {\n        \"title\": \"Before datetime\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"before\": {\n            \"$ref\": \"#/components/schemas/dateTimeExpression\"\n          },\n          \"actualFormat\": {\n            \"$ref\": \"#/components/schemas/format\"\n          },\n          \"truncateExpected\": {\n            \"$ref\": \"#/components/schemas/truncation\"\n          },\n          \"truncateActual\": {\n            \"$ref\": \"#/components/schemas/truncation\"\n          }\n        },\n        \"required\": [\n          \"before\"\n        ]\n      },\n      \"after-pattern\": {\n        \"title\": \"After datetime\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"after\": {\n            \"$ref\": \"#/components/schemas/dateTimeExpression\"\n          },\n          \"actualFormat\": {\n            \"$ref\": \"#/components/schemas/format\"\n          },\n          \"truncateExpected\": {\n            \"$ref\": \"#/components/schemas/truncation\"\n          },\n          \"truncateActual\": {\n            \"$ref\": \"#/components/schemas/truncation\"\n          }\n        },\n        \"required\": [\n          \"after\"\n        ]\n      },\n      \"equal-to-date-time-pattern\": {\n        \"title\": \"Before datetime\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"equalToDateTime\": {\n            \"$ref\": \"#/components/schemas/dateTimeExpression\"\n          },\n          \"actualFormat\": {\n            \"$ref\": \"#/components/schemas/format\"\n          },\n          \"truncateExpected\": {\n            \"$ref\": \"#/components/schemas/truncation\"\n          },\n          \"truncateActual\": {\n            \"$ref\": \"#/components/schemas/truncation\"\n          }\n        },\n        \"required\": [\n          \"equalToDateTime\"\n        ]\n      },\n      \"equal-to-json-pattern\": {\n        \"title\": \"JSON equals\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"equalToJson\": {\n            \"oneOf\": [\n              {\n                \"type\": \"object\",\n                \"description\": \"The JSON object to match.\",\n                \"example\": {\n                  \"message\": \"hello\"\n                }\n              },\n              {\n                \"type\": \"string\",\n                \"x-intellij-language-injection\": \"JSON\",\n                \"description\": \"A JSON-encoded JSON string to match.\",\n                \"example\": \"{ \\\"message\\\": \\\"hello\\\" }\"\n              }\n            ]\n          },\n          \"ignoreExtraElements\": {\n            \"type\": \"boolean\"\n          },\n          \"ignoreArrayOrder\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"equalToJson\"\n        ]\n      },\n      \"matches-json-path-pattern\": {\n        \"title\": \"JSONPath match\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"matchesJsonPath\": {\n            \"oneOf\": [\n              {\n                \"type\": \"string\",\n                \"example\": \"$.name\",\n                \"x-intellij-language-injection\": \"JSONPath\"\n              },\n              {\n                \"type\": \"object\",\n                \"allOf\": [\n                  {\n                    \"properties\": {\n                      \"expression\": {\n                        \"type\": \"string\",\n                        \"example\": \"$.name\"\n                      }\n                    }\n                  },\n                  {\n                    \"$ref\": \"#/components/schemas/content-pattern\"\n                  }\n                ],\n                \"required\": [\n                  \"expression\"\n                ]\n              }\n            ]\n          }\n        },\n        \"required\": [\n          \"matchesJsonPath\"\n        ]\n      },\n      \"equal-to-xml-pattern\": {\n        \"title\": \"XML equality\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"equalToXml\": {\n            \"type\": \"string\",\n            \"x-intellij-language-injection\": \"XML\",\n            \"example\": \"<amount>123</amount>\"\n          },\n          \"enablePlaceholders\": {\n            \"type\": \"boolean\"\n          },\n          \"placeholderOpeningDelimiterRegex\": {\n            \"type\": \"string\",\n            \"example\": \"\\\\[\"\n          },\n          \"placeholderClosingDelimiterRegex\": {\n            \"type\": \"string\",\n            \"example\": \"]\"\n          },\n          \"namespaceAwareness\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"LEGACY\",\n              \"STRICT\",\n              \"NONE\"\n            ]\n          }\n        },\n        \"required\": [\n          \"equalToXml\"\n        ]\n      },\n      \"matches-xpath-pattern\": {\n        \"title\": \"XPath match\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"matchesXPath\": {\n            \"oneOf\": [\n              {\n                \"type\": \"string\",\n                \"example\": \"//Order/Amount\",\n                \"x-intellij-language-injection\": \"XPath\"\n              },\n              {\n                \"type\": \"object\",\n                \"allOf\": [\n                  {\n                    \"properties\": {\n                      \"expression\": {\n                        \"type\": \"string\",\n                        \"example\": \"//Order/Amount\"\n                      }\n                    }\n                  },\n                  {\n                    \"$ref\": \"#/components/schemas/content-pattern\"\n                  }\n                ],\n                \"required\": [\n                  \"expression\"\n                ]\n              }\n            ]\n          },\n          \"xPathNamespaces\": {\n            \"type\": \"object\",\n            \"additionalProperties\": {\n              \"type\": \"string\"\n            }\n          }\n        },\n        \"required\": [\n          \"matchesXPath\"\n        ]\n      },\n      \"matches-json-schema-pattern\": {\n        \"title\": \"JSON Schema match\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"matchesJsonSchema\": {\n            \"type\": \"string\",\n            \"x-intellij-language-injection\": \"JSON\",\n            \"description\": \"A valid JSON schema as a string\",\n            \"example\": \"{\\n  \\\"type\\\": \\\"object\\\",\\n  \\\"required\\\": [\\n    \\\"name\\\"\\n  ],\\n  \\\"properties\\\": {\\n    \\\"name\\\": {\\n      \\\"type\\\": \\\"string\\\"\\n    },\\n    \\\"tag\\\": {\\n      \\\"type\\\": \\\"string\\\"\\n    }\\n  }\\n}\"\n          },\n          \"schemaVersion\": {\n            \"description\": \"The JSON schema version to interpret the schema against\",\n            \"example\": \"V202012\",\n            \"enum\": [\n              \"V4\",\n              \"V6\",\n              \"V7\",\n              \"V201909\",\n              \"V202012\"\n            ]\n          }\n        },\n        \"required\": [\n          \"matchesJsonSchema\"\n        ]\n      },\n      \"absent-pattern\": {\n        \"title\": \"Absent matcher\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"absent\": {\n            \"type\": \"boolean\"\n          }\n        },\n        \"required\": [\n          \"absent\"\n        ]\n      },\n      \"and-pattern\": {\n        \"title\": \"Logical AND matcher\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"and\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          }\n        },\n        \"required\": [\n          \"and\"\n        ]\n      },\n      \"or-pattern\": {\n        \"title\": \"Logical OR matcher\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"or\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          }\n        },\n        \"required\": [\n          \"or\"\n        ]\n      },\n      \"has-exactly-multivalue-pattern\": {\n        \"title\": \"Has exactly multi value matcher\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"hasExactly\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          }\n        },\n        \"required\": [\n          \"hasExactly\"\n        ]\n      },\n      \"includes-multivalue-pattern\": {\n        \"title\": \"Has exactly multi value matcher\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"includes\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          }\n        },\n        \"required\": [\n          \"includes\"\n        ]\n      },\n      \"equal-to-number-pattern\": {\n        \"title\": \"Number equals\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"equalToNumber\": {\n            \"type\": \"number\"\n          }\n        },\n        \"required\": [\n          \"equalToNumber\"\n        ]\n      },\n      \"greater-than-number-pattern\": {\n        \"title\": \"Number greater than\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"greaterThanNumber\": {\n            \"type\": \"number\"\n          }\n        },\n        \"required\": [\n          \"greaterThanNumber\"\n        ]\n      },\n      \"greater-than-equal-number-pattern\": {\n        \"title\": \"Number greater than or equal\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"greaterThanEqualNumber\": {\n            \"type\": \"number\"\n          }\n        },\n        \"required\": [\n          \"greaterThanEqualNumber\"\n        ]\n      },\n      \"less-than-number-pattern\": {\n        \"title\": \"Number less than\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"lessThanNumber\": {\n            \"type\": \"number\"\n          }\n        },\n        \"required\": [\n          \"lessThanNumber\"\n        ]\n      },\n      \"less-than-equal-number-pattern\": {\n        \"title\": \"Number less than or equal\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"lessThanEqualNumber\": {\n            \"type\": \"number\"\n          }\n        },\n        \"required\": [\n          \"lessThanEqualNumber\"\n        ]\n      },\n      \"request-pattern\": {\n        \"type\": \"object\",\n        \"example\": \"{\\n  \\\"urlPath\\\" : \\\"/charges\\\",\\n  \\\"method\\\" : \\\"POST\\\",\\n  \\\"headers\\\" : {\\n    \\\"Content-Type\\\" : {\\n      \\\"equalTo\\\" : \\\"application/json\\\"\\n    }\\n  }\\n}\",\n        \"properties\": {\n          \"scheme\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"http\",\n              \"https\"\n            ],\n            \"description\": \"The scheme (protocol) part of the request URL\"\n          },\n          \"host\": {\n            \"type\": \"string\",\n            \"description\": \"The hostname part of the request URL\"\n          },\n          \"port\": {\n            \"type\": \"integer\",\n            \"minimum\": 1,\n            \"maximum\": 65535,\n            \"description\": \"The HTTP port number of the request URL\"\n          },\n          \"method\": {\n            \"oneOf\": [\n              {\n                \"type\": \"string\",\n                \"pattern\": \"^[A-Z]+$\",\n                \"description\": \"The HTTP request method e.g. GET\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/one-of-request-method-pattern\"\n              },\n              {\n                \"$ref\": \"#/components/schemas/none-of-request-method-pattern\"\n              }\n            ]\n          },\n          \"url\": {\n            \"type\": \"string\",\n            \"description\": \"The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n          },\n          \"urlPath\": {\n            \"type\": \"string\",\n            \"description\": \"The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n          },\n          \"urlPathPattern\": {\n            \"type\": \"string\",\n            \"description\": \"The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n          },\n          \"urlPattern\": {\n            \"type\": \"string\",\n            \"description\": \"The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.\"\n          },\n          \"urlPathTemplate\": {\n            \"type\": \"string\",\n            \"description\": \"The path template to match against. Must conform to the OpenAPI compatible subset of the RFC 6570 URI Template specification.\\nOnly one of url, urlPattern, urlPath or urlPathPattern may be specified.\\n\"\n          },\n          \"pathParameters\": {\n            \"type\": \"object\",\n            \"description\": \"Path parameter patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form. Can only\\nbe used when the urlPathPattern URL match type is in use and all keys must be present as variables\\nin the path template.\",\n            \"additionalProperties\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          },\n          \"queryParameters\": {\n            \"type\": \"object\",\n            \"description\": \"Query parameter patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n            \"additionalProperties\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          },\n          \"formParameters\": {\n            \"type\": \"object\",\n            \"description\": \"application/x-www-form-urlencoded form parameter patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n            \"additionalProperties\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          },\n          \"headers\": {\n            \"type\": \"object\",\n            \"description\": \"Header patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n            \"additionalProperties\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          },\n          \"clientIp\": {\n            \"type\": \"string\",\n            \"description\": \"The client IP address to match against\"\n          },\n          \"basicAuthCredentials\": {\n            \"type\": \"object\",\n            \"description\": \"Pre-emptive basic auth credentials to match against\",\n            \"properties\": {\n              \"password\": {\n                \"type\": \"string\"\n              },\n              \"username\": {\n                \"type\": \"string\"\n              }\n            },\n            \"required\": [\n              \"username\",\n              \"password\"\n            ]\n          },\n          \"cookies\": {\n            \"type\": \"object\",\n            \"description\": \"Cookie patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n            \"additionalProperties\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          },\n          \"bodyPatterns\": {\n            \"type\": \"array\",\n            \"description\": \"Request body patterns to match against in the { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/content-pattern\"\n            }\n          },\n          \"customMatcher\": {\n            \"type\": \"object\",\n            \"description\": \"Custom request matcher to match against\",\n            \"properties\": {\n              \"name\": {\n                \"type\": \"string\",\n                \"description\": \"The matcher's name specified in the implementation of the matcher.\"\n              },\n              \"parameters\": {\n                \"type\": \"object\"\n              }\n            }\n          },\n          \"multipartPatterns\": {\n            \"type\": \"array\",\n            \"description\": \"Multipart patterns to match against headers and body.\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"fileName\": {\n                  \"type\": \"string\"\n                },\n                \"matchingType\": {\n                  \"type\": \"string\",\n                  \"description\": \"Determines whether all or any of the parts must match the criteria for an overall match.\",\n                  \"default\": \"ANY\",\n                  \"enum\": [\n                    \"ALL\",\n                    \"ANY\"\n                  ]\n                },\n                \"headers\": {\n                  \"type\": \"object\",\n                  \"description\": \"Header patterns to match against in the <key>: { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n                  \"additionalProperties\": {\n                    \"$ref\": \"#/components/schemas/content-pattern\"\n                  }\n                },\n                \"bodyPatterns\": {\n                  \"type\": \"array\",\n                  \"description\": \"Body patterns to match against in the { \\\"<predicate>\\\": \\\"<value>\\\" } form\",\n                  \"items\": {\n                    \"$ref\": \"#/components/schemas/content-pattern\"\n                  }\n                }\n              }\n            }\n          }\n        }\n      },\n      \"delay-distribution\": {\n        \"type\": \"object\",\n        \"description\": \"The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.\",\n        \"oneOf\": [\n          {\n            \"title\": \"Log normal\",\n            \"description\": \"Log normal randomly distributed response delay.\",\n            \"type\": \"object\",\n            \"properties\": {\n              \"median\": {\n                \"type\": \"integer\"\n              },\n              \"sigma\": {\n                \"type\": \"number\"\n              },\n              \"maxValue\": {\n                \"type\": \"number\"\n              },\n              \"type\": {\n                \"type\": \"string\",\n                \"enum\": [\n                  \"lognormal\"\n                ]\n              }\n            },\n            \"required\": [\n              \"median\",\n              \"sigma\"\n            ]\n          },\n          {\n            \"title\": \"Uniform\",\n            \"description\": \"Uniformly distributed random response delay.\",\n            \"type\": \"object\",\n            \"properties\": {\n              \"lower\": {\n                \"type\": \"integer\"\n              },\n              \"upper\": {\n                \"type\": \"integer\"\n              },\n              \"type\": {\n                \"type\": \"string\",\n                \"enum\": [\n                  \"uniform\"\n                ]\n              }\n            },\n            \"required\": [\n              \"lower\",\n              \"upper\"\n            ]\n          },\n          {\n            \"title\": \"Fixed\",\n            \"description\": \"Fixed response delay.\",\n            \"type\": \"object\",\n            \"properties\": {\n              \"milliseconds\": {\n                \"type\": \"integer\"\n              },\n              \"type\": {\n                \"type\": \"string\",\n                \"enum\": [\n                  \"fixed\"\n                ]\n              }\n            },\n            \"required\": [\n              \"milliseconds\"\n            ]\n          }\n        ]\n      },\n      \"response-definition\": {\n        \"allOf\": [\n          {\n            \"type\": \"object\",\n            \"properties\": {\n              \"status\": {\n                \"type\": \"integer\",\n                \"description\": \"The HTTP status code to be returned\"\n              },\n              \"statusMessage\": {\n                \"type\": \"string\",\n                \"description\": \"The HTTP status message to be returned\"\n              },\n              \"headers\": {\n                \"type\": \"object\",\n                \"description\": \"Map of response headers to send\",\n                \"additionalProperties\": {\n                  \"type\": \"string\"\n                }\n              },\n              \"additionalProxyRequestHeaders\": {\n                \"type\": \"object\",\n                \"description\": \"Extra request headers to send when proxying to another host.\",\n                \"additionalProperties\": {\n                  \"type\": \"string\"\n                }\n              },\n              \"removeProxyRequestHeaders\": {\n                \"type\": \"array\",\n                \"description\": \"Request headers to remove when proxying to another host.\",\n                \"items\": {\n                  \"type\": \"string\"\n                }\n              },\n              \"body\": {\n                \"type\": \"string\",\n                \"description\": \"The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\"\n              },\n              \"base64Body\": {\n                \"$ref\": \"#/components/schemas/base64-string\"\n              },\n              \"jsonBody\": {\n                \"description\": \"The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\",\n                \"oneOf\": [\n                  {\n                    \"type\": \"object\"\n                  },\n                  {\n                    \"type\": \"array\"\n                  }\n                ]\n              },\n              \"bodyFileName\": {\n                \"type\": \"string\",\n                \"description\": \"The path to the file containing the response body, relative to the configured file root. Only one of body, base64Body, jsonBody or bodyFileName may be specified.\",\n                \"example\": \"user-profile-responses/user1.json\"\n              },\n              \"fault\": {\n                \"type\": \"string\",\n                \"description\": \"The fault to apply (instead of a full, valid response).\",\n                \"enum\": [\n                  \"CONNECTION_RESET_BY_PEER\",\n                  \"EMPTY_RESPONSE\",\n                  \"MALFORMED_RESPONSE_CHUNK\",\n                  \"RANDOM_DATA_THEN_CLOSE\"\n                ]\n              },\n              \"fixedDelayMilliseconds\": {\n                \"type\": \"integer\",\n                \"description\": \"Number of milliseconds to delay be before sending the response.\"\n              },\n              \"delayDistribution\": {\n                \"$ref\": \"#/components/schemas/delay-distribution\"\n              },\n              \"chunkedDribbleDelay\": {\n                \"type\": \"object\",\n                \"description\": \"The parameters for chunked dribble delay - chopping the response into pieces and sending them at delayed intervals\",\n                \"properties\": {\n                  \"numberOfChunks\": {\n                    \"type\": \"integer\"\n                  },\n                  \"totalDuration\": {\n                    \"type\": \"integer\"\n                  }\n                },\n                \"required\": [\n                  \"numberOfChunks\",\n                  \"totalDuration\"\n                ]\n              },\n              \"fromConfiguredStub\": {\n                \"type\": \"boolean\",\n                \"description\": \"Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.\"\n              },\n              \"proxyBaseUrl\": {\n                \"type\": \"string\",\n                \"description\": \"The base URL of the target to proxy matching requests to.\"\n              },\n              \"proxyUrlPrefixToRemove\": {\n                \"type\": \"string\",\n                \"description\": \"A path segment to remove from the beginning in incoming request URL paths before proxying to the target.\"\n              },\n              \"transformerParameters\": {\n                \"type\": \"object\",\n                \"description\": \"Parameters to apply to response transformers.\"\n              },\n              \"transformers\": {\n                \"type\": \"array\",\n                \"description\": \"List of names of transformers to apply to this response.\",\n                \"items\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        ]\n      },\n      \"stub-mapping\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"string\",\n            \"description\": \"This stub mapping's unique identifier\"\n          },\n          \"uuid\": {\n            \"type\": \"string\",\n            \"description\": \"Alias for the id\"\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"description\": \"The stub mapping's name\"\n          },\n          \"request\": {\n            \"$ref\": \"#/components/schemas/request-pattern\"\n          },\n          \"response\": {\n            \"$ref\": \"#/components/schemas/response-definition\"\n          },\n          \"persistent\": {\n            \"type\": \"boolean\",\n            \"description\": \"Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.\"\n          },\n          \"priority\": {\n            \"type\": \"integer\",\n            \"description\": \"This stub mapping's priority relative to others. 1 is highest.\",\n            \"minimum\": 1\n          },\n          \"scenarioName\": {\n            \"type\": \"string\",\n            \"description\": \"The name of the scenario that this stub mapping is part of\"\n          },\n          \"requiredScenarioState\": {\n            \"type\": \"string\",\n            \"description\": \"The required state of the scenario in order for this stub to be matched.\"\n          },\n          \"newScenarioState\": {\n            \"type\": \"string\",\n            \"description\": \"The new state for the scenario to be updated to after this stub is served.\"\n          },\n          \"postServeActions\": {\n            \"type\": \"array\",\n            \"description\": \"DEPRECATED: Use `serveEventListeners` instead.\\nA map of the names of post serve action extensions to trigger and their parameters.\\n\",\n            \"items\": {\n              \"type\": \"object\"\n            }\n          },\n          \"serveEventListeners\": {\n            \"type\": \"array\",\n            \"description\": \"The list of serve event listeners\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"requestPhases\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                      \"BEFORE_MATCH\",\n                      \"AFTER_MATCH\",\n                      \"BEFORE_RESPONSE_SENT\",\n                      \"AFTER_COMPLETE\"\n                    ]\n                  }\n                },\n                \"parameters\": {\n                  \"type\": \"object\"\n                }\n              }\n            }\n          },\n          \"metadata\": {\n            \"type\": \"object\",\n            \"description\": \"Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.\"\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"stub-mappings\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"mappings\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/stub-mapping\"\n            }\n          },\n          \"meta\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"total\": {\n                \"type\": \"integer\",\n                \"example\": 4\n              }\n            },\n            \"required\": [\n              \"total\"\n            ]\n          }\n        },\n        \"additionalProperties\": false\n      },\n      \"bad-request-entity\": {\n        \"title\": \"Bad request entity\",\n        \"type\": \"object\",\n        \"properties\": {\n          \"errors\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"code\": {\n                  \"type\": \"integer\"\n                },\n                \"source\": {\n                  \"type\": \"string\"\n                },\n                \"title\": {\n                  \"type\": \"string\"\n                },\n                \"detail\": {\n                  \"type\": \"string\"\n                }\n              }\n            }\n          }\n        }\n      },\n      \"headers\": {\n        \"type\": \"object\",\n        \"description\": \"HTTP headers\",\n        \"additionalProperties\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"key\": {\n              \"type\": \"string\"\n            },\n            \"values\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"string\"\n              }\n            }\n          }\n        },\n        \"example\": {\n          \"Connection\": {\n            \"key\": \"Connection\",\n            \"values\": [\n              \"keep-alive\"\n            ]\n          },\n          \"Host\": {\n            \"key\": \"Host\",\n            \"values\": [\n              \"localhost:56738\"\n            ]\n          },\n          \"User-Agent\": {\n            \"key\": \"User-Agent\",\n            \"values\": [\n              \"Apache-HttpClient/4.5.1 (Java/1.7.0_51)\"\n            ]\n          }\n        }\n      },\n      \"logged-request\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"description\": \"The unique identifier for this request\",\n            \"type\": \"string\",\n            \"format\": \"uuid\"\n          },\n          \"method\": {\n            \"description\": \"The HTTP request method\",\n            \"type\": \"string\",\n            \"example\": \"GET\"\n          },\n          \"url\": {\n            \"description\": \"The path and query to match exactly against\",\n            \"type\": \"string\",\n            \"example\": \"/received-request/2\"\n          },\n          \"absoluteUrl\": {\n            \"description\": \"The full URL to match against\",\n            \"type\": \"string\",\n            \"example\": \"http://localhost:56738/received-request/2\"\n          },\n          \"scheme\": {\n            \"description\": \"The URL scheme (http/https)\",\n            \"type\": \"string\",\n            \"example\": \"http\"\n          },\n          \"host\": {\n            \"description\": \"The host part of the URL\",\n            \"type\": \"string\",\n            \"example\": \"localhost\"\n          },\n          \"port\": {\n            \"description\": \"The port number\",\n            \"type\": \"integer\",\n            \"example\": 56738\n          },\n          \"clientIp\": {\n            \"description\": \"The client IP address\",\n            \"type\": \"string\",\n            \"example\": \"127.0.0.1\"\n          },\n          \"headers\": {\n            \"$ref\": \"#/components/schemas/headers\"\n          },\n          \"cookies\": {\n            \"description\": \"Cookies received with the request\",\n            \"type\": \"object\",\n            \"additionalProperties\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"value\": {\n                  \"type\": \"string\"\n                }\n              }\n            },\n            \"example\": {}\n          },\n          \"body\": {\n            \"description\": \"Body string to match against\",\n            \"type\": \"string\",\n            \"example\": \"Hello world\"\n          },\n          \"bodyAsBase64\": {\n            \"description\": \"Base64 encoded body content\",\n            \"type\": \"string\"\n          },\n          \"browserProxyRequest\": {\n            \"description\": \"Whether this request was made via a browser proxy\",\n            \"type\": \"boolean\",\n            \"example\": false\n          },\n          \"loggedDate\": {\n            \"description\": \"The timestamp when the request was logged (epoch millis)\",\n            \"type\": \"integer\",\n            \"format\": \"int64\",\n            \"example\": 1471442557047\n          },\n          \"loggedDateString\": {\n            \"description\": \"The formatted date string when the request was logged\",\n            \"type\": \"string\",\n            \"example\": \"2016-08-17T14:02:37Z\"\n          },\n          \"queryParams\": {\n            \"description\": \"Query parameters parsed from the URL\",\n            \"type\": \"object\",\n            \"additionalProperties\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"key\": {\n                  \"type\": \"string\"\n                },\n                \"values\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\"\n                  }\n                }\n              }\n            }\n          },\n          \"formParams\": {\n            \"description\": \"Form parameters parsed from the request body\",\n            \"type\": \"object\",\n            \"additionalProperties\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"key\": {\n                  \"type\": \"string\"\n                },\n                \"values\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                    \"type\": \"string\"\n                  }\n                }\n              }\n            }\n          },\n          \"multiparts\": {\n            \"description\": \"Multipart form data parts\",\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"description\": \"The name of the multipart part\"\n                },\n                \"fileName\": {\n                  \"type\": \"string\",\n                  \"description\": \"The filename of the multipart part, if provided\"\n                },\n                \"headers\": {\n                  \"$ref\": \"#/components/schemas/headers\"\n                },\n                \"body\": {\n                  \"type\": \"string\",\n                  \"description\": \"The body content of this part\"\n                },\n                \"bodyAsBase64\": {\n                  \"type\": \"string\",\n                  \"description\": \"Base64 encoded body content of this part\"\n                }\n              },\n              \"required\": [\n                \"name\"\n              ]\n            }\n          },\n          \"protocol\": {\n            \"description\": \"The HTTP protocol version\",\n            \"type\": \"string\",\n            \"example\": \"HTTP/1.1\"\n          }\n        }\n      },\n      \"record-spec\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"captureHeaders\": {\n            \"type\": \"object\",\n            \"additionalProperties\": {\n              \"type\": \"object\",\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"caseInsensitive\": {\n                  \"type\": \"boolean\"\n                }\n              }\n            },\n            \"description\": \"Headers from the request to include in the generated stub mappings, mapped to parameter objects. The only parameter available is \\\"caseInsensitive\\\", which defaults to false\",\n            \"example\": {\n              \"Accept\": {},\n              \"Content-Type\": {\n                \"caseInsensitive\": true\n              }\n            }\n          },\n          \"extractBodyCriteria\": {\n            \"type\": \"object\",\n            \"description\": \"Criteria for extracting response bodies to a separate file instead of including it in the stub mapping\",\n            \"example\": [\n              {\n                \"binarySizeThreshold\": \"1 Mb\",\n                \"textSizeThreshold\": \"2 kb\"\n              }\n            ],\n            \"properties\": {\n              \"binarySizeThreshold\": {\n                \"type\": \"string\",\n                \"default\": \"0\",\n                \"description\": \"Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \\\"56 Mb\\\". Default unit is bytes.\",\n                \"example\": \"18.2 GB\"\n              },\n              \"textSizeThreshold\": {\n                \"default\": \"0\",\n                \"description\": \"Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. \\\"56 Mb\\\". Default unit is bytes.\",\n                \"example\": \"18.2 GB\",\n                \"type\": \"string\"\n              }\n            }\n          },\n          \"persist\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"Whether to save stub mappings to the file system or just return them\"\n          },\n          \"repeatsAsScenarios\": {\n            \"type\": \"boolean\",\n            \"default\": true,\n            \"description\": \"When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded\"\n          },\n          \"requestBodyPattern\": {\n            \"type\": \"object\",\n            \"description\": \"Control the request body matcher used in generated stub mappings\",\n            \"oneOf\": [\n              {\n                \"type\": \"object\",\n                \"description\": \"Automatically determine matcher based on content type (the default)\",\n                \"properties\": {\n                  \"caseInsensitive\": {\n                    \"type\": \"boolean\",\n                    \"default\": false,\n                    \"description\": \"If equalTo is used, match body use case-insensitive string comparison\"\n                  },\n                  \"ignoreArrayOrder\": {\n                    \"type\": \"boolean\",\n                    \"default\": true,\n                    \"description\": \"If equalToJson is used, ignore order of array elements\"\n                  },\n                  \"ignoreExtraElements\": {\n                    \"type\": \"boolean\",\n                    \"default\": true,\n                    \"description\": \"If equalToJson is used, matcher ignores extra elements in objects\"\n                  },\n                  \"matcher\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                      \"auto\"\n                    ]\n                  }\n                }\n              },\n              {\n                \"type\": \"object\",\n                \"description\": \"Always match request bodies using equalTo\",\n                \"properties\": {\n                  \"caseInsensitive\": {\n                    \"default\": false,\n                    \"description\": \"Match body using case-insensitive string comparison\",\n                    \"type\": \"boolean\"\n                  },\n                  \"matcher\": {\n                    \"enum\": [\n                      \"equalTo\"\n                    ],\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              {\n                \"type\": \"object\",\n                \"description\": \"Always match request bodies using equalToJson\",\n                \"properties\": {\n                  \"ignoreArrayOrder\": {\n                    \"default\": true,\n                    \"description\": \"Ignore order of array elements\",\n                    \"type\": \"boolean\"\n                  },\n                  \"ignoreExtraElements\": {\n                    \"default\": true,\n                    \"description\": \"Ignore extra elements in objects\",\n                    \"type\": \"boolean\"\n                  },\n                  \"matcher\": {\n                    \"enum\": [\n                      \"equalToJson\"\n                    ],\n                    \"type\": \"string\"\n                  }\n                }\n              },\n              {\n                \"type\": \"object\",\n                \"description\": \"Always match request bodies using equalToXml\",\n                \"properties\": {\n                  \"matcher\": {\n                    \"type\": \"string\",\n                    \"enum\": [\n                      \"equalToXml\"\n                    ]\n                  }\n                }\n              }\n            ]\n          },\n          \"transformerParameters\": {\n            \"type\": \"object\",\n            \"description\": \"List of names of stub mappings transformers to apply to generated stubs\"\n          },\n          \"transformers\": {\n            \"type\": \"array\",\n            \"description\": \"Parameters to pass to stub mapping transformers\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          }\n        }\n      },\n      \"scenario\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"string\",\n            \"description\": \"The scenario ID\",\n            \"example\": \"c8d249ec-d86d-48b1-88a8-a660e6848042\"\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"description\": \"The scenario name\",\n            \"example\": \"my_scenario\"\n          },\n          \"possibleStates\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"default\": \"Started\",\n              \"description\": \"All the states this scenario can be in\",\n              \"type\": \"string\"\n            },\n            \"example\": [\n              \"Started\",\n              \"state_1\",\n              \"state_2\"\n            ]\n          },\n          \"state\": {\n            \"type\": \"string\",\n            \"default\": \"Started\",\n            \"description\": \"The current state of this scenario\",\n            \"example\": \"state_2\"\n          }\n        }\n      },\n      \"channel-type\": {\n        \"type\": \"string\",\n        \"description\": \"The type of message channel\",\n        \"enum\": [\n          \"websocket\"\n        ],\n        \"example\": \"websocket\"\n      },\n      \"channel-pattern\": {\n        \"type\": \"object\",\n        \"description\": \"Pattern for matching message channels\",\n        \"required\": [\n          \"type\"\n        ],\n        \"properties\": {\n          \"type\": {\n            \"$ref\": \"#/components/schemas/channel-type\"\n          },\n          \"initiatingRequestPattern\": {\n            \"$ref\": \"#/components/schemas/request-pattern\",\n            \"description\": \"Pattern to match the request that initiated the channel\"\n          }\n        }\n      },\n      \"message-pattern\": {\n        \"type\": \"object\",\n        \"description\": \"Pattern for matching messages\",\n        \"properties\": {\n          \"channel\": {\n            \"$ref\": \"#/components/schemas/request-pattern\",\n            \"description\": \"Pattern to match the channel's initiating request\"\n          },\n          \"body\": {\n            \"$ref\": \"#/components/schemas/content-pattern\",\n            \"description\": \"Pattern to match the message body\"\n          }\n        }\n      },\n      \"message-trigger\": {\n        \"oneOf\": [\n          {\n            \"type\": \"object\",\n            \"description\": \"Trigger on incoming message\",\n            \"required\": [\n              \"type\"\n            ],\n            \"properties\": {\n              \"type\": {\n                \"type\": \"string\",\n                \"enum\": [\n                  \"message\"\n                ]\n              },\n              \"channel\": {\n                \"$ref\": \"#/components/schemas/channel-pattern\"\n              },\n              \"message\": {\n                \"$ref\": \"#/components/schemas/message-pattern\"\n              }\n            }\n          },\n          {\n            \"type\": \"object\",\n            \"description\": \"Trigger when a specific HTTP stub is matched\",\n            \"required\": [\n              \"type\",\n              \"stubId\"\n            ],\n            \"properties\": {\n              \"type\": {\n                \"type\": \"string\",\n                \"enum\": [\n                  \"http-stub\"\n                ]\n              },\n              \"stubId\": {\n                \"type\": \"string\",\n                \"format\": \"uuid\",\n                \"description\": \"The ID of the HTTP stub mapping that triggers this message stub\"\n              }\n            }\n          },\n          {\n            \"type\": \"object\",\n            \"description\": \"Trigger when an HTTP request matches a pattern\",\n            \"required\": [\n              \"type\",\n              \"requestPattern\"\n            ],\n            \"properties\": {\n              \"type\": {\n                \"type\": \"string\",\n                \"enum\": [\n                  \"http-request\"\n                ]\n              },\n              \"requestPattern\": {\n                \"$ref\": \"#/components/schemas/request-pattern\"\n              }\n            }\n          }\n        ]\n      },\n      \"message-definition\": {\n        \"type\": \"object\",\n        \"description\": \"Definition of a message to be sent\",\n        \"properties\": {\n          \"body\": {\n            \"description\": \"The message body\",\n            \"oneOf\": [\n              {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"data\": {\n                    \"type\": \"string\",\n                    \"description\": \"Text message data\"\n                  }\n                }\n              },\n              {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"data\": {\n                    \"type\": \"string\",\n                    \"format\": \"byte\",\n                    \"description\": \"Base64-encoded binary message data\"\n                  },\n                  \"isBinary\": {\n                    \"type\": \"boolean\",\n                    \"description\": \"Indicates this is binary data\"\n                  }\n                }\n              }\n            ]\n          }\n        }\n      },\n      \"channel-target\": {\n        \"oneOf\": [\n          {\n            \"type\": \"object\",\n            \"description\": \"Target the originating channel\",\n            \"required\": [\n              \"type\"\n            ],\n            \"properties\": {\n              \"type\": {\n                \"type\": \"string\",\n                \"enum\": [\n                  \"originating\"\n                ]\n              }\n            }\n          },\n          {\n            \"type\": \"object\",\n            \"description\": \"Target channels initiated by requests matching a pattern\",\n            \"required\": [\n              \"type\",\n              \"requestPattern\"\n            ],\n            \"properties\": {\n              \"type\": {\n                \"type\": \"string\",\n                \"enum\": [\n                  \"request-initiated\"\n                ]\n              },\n              \"channelType\": {\n                \"$ref\": \"#/components/schemas/channel-type\"\n              },\n              \"requestPattern\": {\n                \"$ref\": \"#/components/schemas/request-pattern\"\n              }\n            }\n          }\n        ]\n      },\n      \"message-action\": {\n        \"type\": \"object\",\n        \"description\": \"Action to perform when a message stub is triggered\",\n        \"required\": [\n          \"type\",\n          \"message\"\n        ],\n        \"properties\": {\n          \"type\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"send\"\n            ]\n          },\n          \"message\": {\n            \"$ref\": \"#/components/schemas/message-definition\"\n          },\n          \"channelTarget\": {\n            \"$ref\": \"#/components/schemas/channel-target\"\n          },\n          \"transformers\": {\n            \"type\": \"array\",\n            \"description\": \"List of transformer names to apply to the message\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"transformerParameters\": {\n            \"type\": \"object\",\n            \"description\": \"Parameters to pass to transformers\",\n            \"additionalProperties\": true\n          }\n        }\n      },\n      \"message-stub-mapping\": {\n        \"type\": \"object\",\n        \"description\": \"A message stub mapping defines how WireMock responds to messages on channels\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"string\",\n            \"format\": \"uuid\",\n            \"description\": \"This message stub mapping's unique identifier\"\n          },\n          \"uuid\": {\n            \"type\": \"string\",\n            \"format\": \"uuid\",\n            \"description\": \"Alias for the id\"\n          },\n          \"name\": {\n            \"type\": \"string\",\n            \"description\": \"The message stub mapping's name\"\n          },\n          \"priority\": {\n            \"type\": \"integer\",\n            \"description\": \"This message stub mapping's priority relative to others. 1 is highest.\",\n            \"minimum\": 1\n          },\n          \"trigger\": {\n            \"$ref\": \"#/components/schemas/message-trigger\"\n          },\n          \"actions\": {\n            \"type\": \"array\",\n            \"description\": \"Actions to perform when this stub is triggered\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/message-action\"\n            }\n          },\n          \"metadata\": {\n            \"type\": \"object\",\n            \"description\": \"Arbitrary metadata to be attached to the stub mapping\",\n            \"additionalProperties\": true\n          }\n        }\n      },\n      \"message-stub-mappings\": {\n        \"type\": \"object\",\n        \"description\": \"A collection of message stub mappings\",\n        \"properties\": {\n          \"messageMappings\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/message-stub-mapping\"\n            }\n          },\n          \"meta\": {\n            \"type\": \"object\",\n            \"description\": \"Pagination metadata\",\n            \"properties\": {\n              \"total\": {\n                \"type\": \"integer\",\n                \"description\": \"Total number of message stub mappings\"\n              }\n            }\n          }\n        }\n      },\n      \"message-serve-event\": {\n        \"type\": \"object\",\n        \"description\": \"A message event logged in the journal\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"string\",\n            \"format\": \"uuid\",\n            \"description\": \"Unique identifier for this message event\"\n          },\n          \"eventType\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"RECEIVED\",\n              \"SENT\"\n            ],\n            \"description\": \"Whether the message was received or sent\"\n          },\n          \"channelType\": {\n            \"$ref\": \"#/components/schemas/channel-type\"\n          },\n          \"channelId\": {\n            \"type\": \"string\",\n            \"format\": \"uuid\",\n            \"description\": \"ID of the channel on which the message was sent/received\"\n          },\n          \"channelRequest\": {\n            \"$ref\": \"#/components/schemas/logged-request\",\n            \"description\": \"The HTTP request that initiated the channel (for request-initiated channels)\"\n          },\n          \"message\": {\n            \"type\": \"string\",\n            \"description\": \"The message body as a string\"\n          },\n          \"stubMapping\": {\n            \"$ref\": \"#/components/schemas/message-stub-mapping\",\n            \"description\": \"The message stub mapping that was matched (if any)\"\n          },\n          \"wasMatched\": {\n            \"type\": \"boolean\",\n            \"description\": \"Whether this message matched a stub mapping\"\n          },\n          \"timestamp\": {\n            \"type\": \"string\",\n            \"format\": \"date-time\",\n            \"description\": \"When the message event occurred\"\n          },\n          \"subEvents\": {\n            \"type\": \"array\",\n            \"description\": \"Sub-events that occurred during message processing\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"type\": {\n                  \"type\": \"string\"\n                },\n                \"relativeTiming\": {\n                  \"type\": \"integer\",\n                  \"description\": \"Timing in nanoseconds relative to the start of the event\"\n                },\n                \"data\": {\n                  \"type\": \"object\"\n                }\n              }\n            }\n          }\n        }\n      },\n      \"message-serve-events-result\": {\n        \"type\": \"object\",\n        \"description\": \"Result containing message serve events\",\n        \"properties\": {\n          \"messageServeEvents\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/message-serve-event\"\n            }\n          },\n          \"messageJournalDisabled\": {\n            \"type\": \"boolean\",\n            \"description\": \"Whether the message journal is disabled\"\n          }\n        }\n      },\n      \"single-message-serve-event-result\": {\n        \"type\": \"object\",\n        \"description\": \"Result containing a single message serve event\",\n        \"properties\": {\n          \"item\": {\n            \"$ref\": \"#/components/schemas/message-serve-event\",\n            \"description\": \"The message serve event, or null if not found\"\n          }\n        }\n      },\n      \"message-verification-result\": {\n        \"type\": \"object\",\n        \"description\": \"Result of a message verification operation\",\n        \"properties\": {\n          \"count\": {\n            \"type\": \"integer\",\n            \"description\": \"Number of messages matching the criteria\"\n          },\n          \"messageJournalDisabled\": {\n            \"type\": \"boolean\",\n            \"description\": \"Whether the message journal is disabled\"\n          }\n        }\n      },\n      \"wait-for-message-request\": {\n        \"type\": \"object\",\n        \"description\": \"Request to wait for message events\",\n        \"required\": [\n          \"timeoutMillis\"\n        ],\n        \"properties\": {\n          \"pattern\": {\n            \"$ref\": \"#/components/schemas/message-pattern\"\n          },\n          \"timeoutMillis\": {\n            \"type\": \"integer\",\n            \"format\": \"int64\",\n            \"description\": \"Maximum time to wait in milliseconds\"\n          },\n          \"count\": {\n            \"type\": \"integer\",\n            \"description\": \"Number of messages to wait for (for wait-for-count endpoint)\"\n          }\n        }\n      },\n      \"logged-message-channel\": {\n        \"type\": \"object\",\n        \"description\": \"A logged message channel\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"string\",\n            \"format\": \"uuid\",\n            \"description\": \"Unique identifier for this channel\"\n          },\n          \"type\": {\n            \"$ref\": \"#/components/schemas/channel-type\"\n          },\n          \"initiatingRequest\": {\n            \"$ref\": \"#/components/schemas/logged-request\",\n            \"description\": \"The HTTP request that initiated the channel (for request-initiated channels)\"\n          },\n          \"open\": {\n            \"type\": \"boolean\",\n            \"description\": \"Whether the channel is currently open\"\n          }\n        }\n      },\n      \"message-channels-result\": {\n        \"type\": \"object\",\n        \"description\": \"Result containing message channels\",\n        \"properties\": {\n          \"channels\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/logged-message-channel\"\n            }\n          },\n          \"meta\": {\n            \"type\": \"object\",\n            \"description\": \"Pagination metadata\",\n            \"properties\": {\n              \"total\": {\n                \"type\": \"integer\",\n                \"description\": \"Total number of channels\"\n              }\n            }\n          }\n        }\n      },\n      \"send-channel-message-request\": {\n        \"type\": \"object\",\n        \"description\": \"Request to send a message to channels\",\n        \"required\": [\n          \"type\",\n          \"message\"\n        ],\n        \"properties\": {\n          \"type\": {\n            \"$ref\": \"#/components/schemas/channel-type\"\n          },\n          \"initiatingRequest\": {\n            \"$ref\": \"#/components/schemas/request-pattern\",\n            \"description\": \"Pattern to match the initiating request of target channels\"\n          },\n          \"message\": {\n            \"$ref\": \"#/components/schemas/message-definition\"\n          }\n        }\n      },\n      \"send-channel-message-result\": {\n        \"type\": \"object\",\n        \"description\": \"Result of sending a message to channels\",\n        \"properties\": {\n          \"channels\": {\n            \"type\": \"array\",\n            \"description\": \"Channels that received the message\",\n            \"items\": {\n              \"$ref\": \"#/components/schemas/logged-message-channel\"\n            }\n          },\n          \"channelsMessaged\": {\n            \"type\": \"integer\",\n            \"description\": \"Number of channels that received the message\"\n          }\n        }\n      },\n      \"health\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"status\": {\n            \"type\": \"string\",\n            \"example\": \"healthy\",\n            \"description\": \"The status of the server\",\n            \"enum\": [\n              \"healthy\",\n              \"unhealthy\"\n            ]\n          },\n          \"message\": {\n            \"type\": \"string\",\n            \"description\": \"Longer message regarding the status of the server\",\n            \"example\": \"Wiremock is ok\"\n          },\n          \"version\": {\n            \"type\": \"string\",\n            \"description\": \"The WireMock version\",\n            \"example\": \"3.8.0\"\n          },\n          \"uptimeInSeconds\": {\n            \"type\": \"integer\",\n            \"description\": \"How long the server has been running\",\n            \"example\": 14355\n          },\n          \"timestamp\": {\n            \"type\": \"string\",\n            \"description\": \"The current timestamp\",\n            \"example\": \"2024-07-03T13:16:06.172362Z\"\n          }\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "wiremock-core/src/main/resources/swagger/wiremock-admin-api.yaml",
    "content": "openapi: 3.0.0\n\ninfo:\n  title: WireMock\n  version: 4.0.0-beta.30\n  description: \"WireMock offers a REST API for administration, troubleshooting and analysis purposes\"\n\nexternalDocs:\n  description: WireMock user documentation\n  url: https://wiremock.org/docs/\n\nservers:\n  - url: /\n\ntags:\n  - name: Stub Mappings\n    description: Operations on stub mappings\n    externalDocs:\n      description: User documentation\n      url: https://wiremock.org/docs/stubbing/\n  - name: Requests\n    description: Logged requests and responses received by the mock service\n    externalDocs:\n      description: User documentation\n      url: https://wiremock.org/docs/verifying/\n  - name: Near Misses\n    description: Near misses allow querying of received requests or request patterns according to similarity\n    externalDocs:\n      description: User documentation\n      url: https://wiremock.org/docs/verifying/#near-misses\n  - name: Recordings\n    description: Stub mapping record and snapshot functions\n    externalDocs:\n      description: User documentation\n      url: https://wiremock.org/docs/record-playback/\n  - name: Scenarios\n    description: Scenarios support modelling of stateful behaviour\n    externalDocs:\n      description: User documentation\n      url: https://wiremock.org/docs/stateful-behaviour/\n  - name: Files\n    description: Manage the files used to support WireMock stubs\n  - name: Message Mappings\n    description: Operations on message stub mappings for WebSocket and other messaging protocols\n    externalDocs:\n      description: User documentation\n      url: https://wiremock.org/docs/websockets-and-other-messaging/\n  - name: Messages\n    description: Message events logged in the journal\n    externalDocs:\n      description: User documentation\n      url: https://wiremock.org/docs/websockets-and-other-messaging/\n  - name: Channels\n    description: Active message channels\n    externalDocs:\n      description: User documentation\n      url: https://wiremock.org/docs/websockets-and-other-messaging/\n  - name: System\n    description: Global operations\n\npaths:\n  /__admin/mappings:\n    get:\n      operationId: getAllStubMappings\n      summary: Get all stub mappings\n      tags:\n         - Stub Mappings\n      parameters:\n        - description: The maximum number of results to return\n          in: query\n          name: limit\n          required: false\n          example: 10\n          schema:\n            type: integer\n        - description: The start index of the results to return\n          in: query\n          name: offset\n          required: false\n          example: 0\n          schema:\n            type: integer\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/stub-mappings.yaml'\n              example:\n                $ref: 'examples/stub-mappings.yaml'\n          description: All stub mappings\n    post:\n      operationId: createNewStubMapping\n      summary: Create a new stub mapping\n      tags:\n         - Stub Mappings\n      requestBody:\n        $ref: \"#/components/requestBodies/stubMapping\"\n      responses:\n        '201':\n          $ref: \"#/components/responses/stubMapping\"\n        '422':\n          $ref: \"#/components/responses/badRequestEntity\"\n    delete:\n      operationId: deleteAllStubMappings\n      summary: Delete all stub mappings\n      tags:\n         - Stub Mappings\n      responses:\n        '200':\n          description: Successfully deleted\n\n  /__admin/mappings/reset:\n    post:\n      operationId: resetStubMappings\n      summary: Reset stub mappings\n      description: Restores stub mappings to the defaults defined back in the backing store\n      tags:\n         - Stub Mappings\n      responses:\n        '200':\n          description: Successfully reset\n\n  /__admin/mappings/save:\n    post:\n      operationId: persistStubMappings\n      summary: Persist stub mappings\n      description: Save all persistent stub mappings to the backing store\n      tags:\n         - Stub Mappings\n      responses:\n        '200':\n          description: Successfully saved\n\n  /__admin/mappings/import:\n    post:\n      operationId: importStubMappings\n      summary: Import stub mappings\n      description: Import given stub mappings to the backing store\n      tags:\n        - Stub Mappings\n      responses:\n        '200':\n          description: Successfully imported\n\n  /__admin/mappings/{stubMappingId}:\n    parameters:\n      - description: The UUID of stub mapping\n        in: path\n        name: stubMappingId\n        required: true\n        example: 730d3e32-d098-4169-a20c-554c3bedce58\n        schema:\n          type: string\n    get:\n      operationId: getStubMappingById\n      summary: Get stub mapping by ID\n      tags:\n         - Stub Mappings\n      responses:\n        '404':\n          description: Stub mapping not found\n        '200':\n          $ref: \"#/components/responses/stubMapping\"\n    put:\n      operationId: updateStubMapping\n      summary: Update a stub mapping\n      tags:\n         - Stub Mappings\n      requestBody:\n        $ref: \"#/components/requestBodies/stubMapping\"\n      responses:\n        '404':\n          description: Stub mapping not found\n        '200':\n          $ref: \"#/components/responses/stubMapping\"\n    delete:\n      operationId: deleteStubMapping\n      summary: Delete a stub mapping\n      tags:\n         - Stub Mappings\n      responses:\n        '404':\n          description: Stub mapping not found\n        '200':\n          description: OK\n\n  /__admin/mappings/find-by-metadata:\n    post:\n      operationId: findStubMappingsByMetadata\n      description: Find stubs by matching on their metadata\n      tags:\n        - Stub Mappings\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/content-pattern.yaml'\n            example:\n              $ref: 'examples/by-metadata-request.yaml'\n        required: true\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/stub-mappings.yaml'\n              example:\n                $ref: 'examples/stub-mappings.yaml'\n          description: Matched stub mappings\n\n  /__admin/mappings/remove-by-metadata:\n    post:\n      operationId: removeStubMappingsByMetadata\n      summary: Delete stub mappings matching metadata\n      tags:\n        - Stub Mappings\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/content-pattern.yaml'\n            example:\n              $ref: 'examples/by-metadata-request.yaml'\n      responses:\n        '200':\n          description: 'The stub mappings were successfully removed'\n\n  /__admin/mappings/unmatched:\n    get:\n      operationId: findUnmatchedStubMappings\n      summary: Find unmatched stub mappings\n      description: Find stub mappings that haven't matched any requests in the journal\n      tags:\n        - Stub Mappings\n      responses:\n        '200':\n          description: Unmatched stub mappings\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/stub-mappings.yaml'\n              example:\n                $ref: 'examples/stub-mappings.yaml'\n    delete:\n      operationId: removeUnmatchedStubMappings\n      summary: Remove unmatched stub mappings\n      description: Remove stub mappings that haven't matched any requests in the journal\n      tags:\n        - Stub Mappings\n      responses:\n        '200':\n          description: OK\n\n  /__admin/requests:\n    get:\n      operationId: getAllRequestsInJournal\n      summary: Get all requests in journal\n      tags:\n         - Requests\n      parameters:\n        - description: The maximum number of results to return\n          in: query\n          name: limit\n          example: 10\n          schema:\n            type: string\n        - description: Only return logged requests after this date\n          in: query\n          name: since\n          example: 2016-10-05T12:33:01Z\n          schema:\n            type: string\n      responses:\n        '200':\n          content:\n            application/json:\n              example:\n                $ref: 'examples/serve-events.yaml'\n          description: List of received requests\n    delete:\n      operationId: deleteAllRequestsInJournal\n      summary: Delete all requests in journal\n      tags:\n         - Requests\n      responses:\n        '200':\n          description: Successfully deleted\n\n  /__admin/requests/{requestId}:\n    get:\n      operationId: getRequestById\n      summary: Get request by ID\n      tags:\n         - Requests\n      parameters:\n        - description: The UUID of the logged request\n          in: path\n          name: requestId\n          required: true\n          example: 12fb14bb-600e-4bfa-bd8d-be7f12562c99\n          schema:\n            type: string\n      responses:\n        '404':\n          description: Request not found\n        '200':\n          description: OK\n          content:\n            application/json:\n              example:\n                $ref: \"examples/request.yaml\"\n    delete:\n      operationId: deleteRequestById\n      summary: Delete request by ID\n      tags:\n         - Requests\n      parameters:\n        - description: The UUID of the logged request\n          in: path\n          name: requestId\n          required: true\n          example: 12fb14bb-600e-4bfa-bd8d-be7f12562c99\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Successfully deleted\n\n  /__admin/requests/reset:\n    post:\n      operationId: emptyRequestJournal\n      deprecated: true\n      summary: Empty the request journal\n      tags:\n         - Requests\n      responses:\n        '200':\n          description: Successfully reset\n\n  /__admin/requests/count:\n    post:\n      operationId: countRequestsByCriteria\n      summary: Count requests by criteria\n      description: Count requests logged in the journal matching the specified criteria\n      tags:\n         - Requests\n      requestBody:\n        $ref: \"#/components/requestBodies/requestPattern\"\n      responses:\n        '200':\n          description: Number of matching requests\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  count:\n                    type: integer\n                    example: 4\n\n  /__admin/requests/remove:\n    post:\n      operationId: removeRequestsByCriteria\n      summary: Remove requests by criteria\n      description: Removed requests logged in the journal matching the specified criteria\n      tags:\n         - Requests\n      requestBody:\n        $ref: \"#/components/requestBodies/requestPattern\"\n      responses:\n        '200':\n          description: Removed request details\n          content:\n            application/json:\n              example:\n                $ref: \"examples/requests.yaml\"\n\n  /__admin/requests/remove-by-metadata:\n    post:\n      operationId: removeRequestsByMetadata\n      summary: Delete requests mappings matching metadata\n      tags:\n        - Requests\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/content-pattern.yaml'\n            example:\n              $ref: 'examples/by-metadata-request.yaml'\n      responses:\n        '200':\n          description: Removed request details\n          content:\n            application/json:\n              example:\n                $ref: \"examples/requests.yaml\"\n\n  /__admin/requests/find:\n    post:\n      operationId: findRequestsByCriteria\n      summary: Find requests by criteria\n      description: Retrieve details of requests logged in the journal matching the specified criteria\n      tags:\n         - Requests\n      requestBody:\n        $ref: \"#/components/requestBodies/requestPattern\"\n      responses:\n        '200':\n          description: Matching request details\n          content:\n            application/json:\n              example:\n                $ref: \"examples/requests.yaml\"\n\n  /__admin/requests/unmatched:\n    get:\n      operationId: findUnmatchedRequests\n      summary: Find unmatched requests\n      description: Get details of logged requests that weren't matched by any stub mapping\n      tags:\n         - Requests\n      responses:\n        '200':\n          description: Unmatched request details\n          content:\n            application/json:\n              example:\n                $ref: \"examples/requests.yaml\"\n\n  /__admin/requests/unmatched/near-misses:\n    get:\n      operationId: retrieveNearMissesForUnmatchedRequests\n      description: Retrieve near-misses for all unmatched requests\n      tags:\n         - Near Misses\n      responses:\n        '200':\n          $ref: \"#/components/responses/nearMisses\"\n\n  /__admin/near-misses/request:\n    post:\n      operationId: findNearMissesForRequest\n      summary: Find near misses matching specific request\n      description: Find at most 3 near misses for closest stub mappings to the specified request\n      tags:\n         - Near Misses\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/logged-request.yaml'\n            example:\n              $ref: 'examples/logged-request.yaml'\n        required: true\n      responses:\n        '200':\n          $ref: \"#/components/responses/nearMisses\"\n\n  /__admin/near-misses/request-pattern:\n    post:\n      operationId: findNearMissesForRequestPattern\n      summary: Find near misses matching request pattern\n      description: Find at most 3 near misses for closest logged requests to the specified request pattern\n      tags:\n         - Near Misses\n      requestBody:\n        $ref: \"#/components/requestBodies/requestPattern\"\n      responses:\n        '200':\n          $ref: \"#/components/responses/nearMisses\"\n\n  /__admin/recordings/start:\n    post:\n      operationId: startRecording\n      summary: Start recording\n      description: Begin recording stub mappings\n      tags:\n         - Recordings\n      requestBody:\n        $ref: \"#/components/requestBodies/startRecording\"\n      responses:\n        '200':\n          description: Successfully started recording\n\n  /__admin/recordings/stop:\n    post:\n      operationId: stopRecording\n      summary: Stop recording\n      description: End recording of stub mappings\n      tags:\n         - Recordings\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/stub-mappings.yaml'\n              example:\n                $ref: 'examples/recorded-stub-mappings.yaml'\n          description: Successfully stopped recording\n\n  /__admin/recordings/status:\n    get:\n      operationId: getRecordingStatus\n      summary: Get recording status\n      tags:\n         - Recordings\n      responses:\n        '200':\n          description: Successfully got the record status\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  status:\n                    type: string\n                    example: \"Stopped\"\n                    enum:\n                      - NeverStarted\n                      - Recording\n                      - Stopped\n\n  /__admin/recordings/snapshot:\n    post:\n      operationId: takeRecordingSnapshot\n      summary: Take a snapshot recording\n      tags:\n         - Recordings\n      requestBody:\n        $ref: \"#/components/requestBodies/snapshotRecording\"\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/stub-mappings.yaml'\n              example:\n                $ref: 'examples/recorded-stub-mappings.yaml'\n          description: Successfully took a snapshot recording\n\n  /__admin/scenarios:\n    get:\n      operationId: getAllScenarios\n      summary: Get all scenarios\n      tags:\n         - Scenarios\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  scenarios:\n                    type: array\n                    items:\n                      $ref: \"schemas/scenario.yaml\"\n          description: All scenarios\n\n  /__admin/scenarios/reset:\n    post:\n      operationId: resetAllScenarios\n      summary: Reset the state of all scenarios\n      tags:\n         - Scenarios\n      responses:\n        '200':\n          description: Successfully reset\n\n\n  /__admin/files:\n    get:\n      operationId: getAllFileNames\n      summary: Get all file names\n      tags:\n        - Files\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  type: string\n                example: [\"file1.json\", \"file2.json\", \"file3.txt\"]\n          description: All scenarios\n\n  /__admin/files/{fileId}:\n    parameters:\n      - description: The name of the file\n        in: path\n        name: fileId\n        required: true\n        example: file1.json\n        schema:\n          type: string\n    get:\n      operationId: getFileById\n      summary: Get file by ID\n      tags:\n        - Files\n      responses:\n        '404':\n          description: File not found\n        '200':\n          description: The contents of the file\n    put:\n      operationId: updateFileById\n      summary: Update or create a file\n      tags:\n        - Files\n      requestBody:\n        content:\n          application/octet-stream:\n            schema:\n              type: string\n              format: byte\n      responses:\n        '200':\n          description: OK - contents of the request body as a string\n    delete:\n      operationId: deleteFileById\n      summary: Delete a file if it exists\n      tags:\n        - Files\n      responses:\n        '200':\n          description: OK\n\n  /__admin/settings:\n    post:\n      operationId: updateGlobalSettings\n      summary: Update global settings\n      tags:\n         - System\n      requestBody:\n        content:\n          application/json:\n            schema:\n              allOf:\n                - $ref: \"schemas/delay-distribution.yaml\"\n                - type: object\n                  properties:\n                    fixedDelay:\n                      type: number\n                  example:\n                    fixedDelay: 500\n        required: true\n      responses:\n        '200':\n          description: Settings successfully updated\n\n  /__admin/reset:\n    post:\n      operationId: resetMappingsAndJournal\n      summary: Reset mappings and request journal\n      description: Reset mappings to the default state and reset the request journal\n      tags:\n         - System\n      responses:\n        '200':\n          description: Successfully reset\n\n  /__admin/shutdown:\n    post:\n      operationId: shutdownServer\n      summary: Shutdown the WireMock server\n      description: Shutdown the WireMock server\n      tags:\n         - System\n      responses:\n        '200':\n          description: Server will be shut down\n\n  /__admin/version:\n    get:\n      operationId: getVersion\n      summary: Return the version of the WireMock server\n      description: Returns the version of the WireMock server\n      tags:\n        - System\n      responses:\n        '200':\n          description: Successfully returned the version of the WireMock server\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  version:\n                    type: string\n                    example: \"3.8.0\"\n\n  /__admin/message-mappings:\n    get:\n      operationId: getAllMessageStubMappings\n      summary: Get all message stub mappings\n      tags:\n        - Message Mappings\n      parameters:\n        - description: The maximum number of results to return\n          in: query\n          name: limit\n          required: false\n          example: 10\n          schema:\n            type: integer\n        - description: The start index of the results to return\n          in: query\n          name: offset\n          required: false\n          example: 0\n          schema:\n            type: integer\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-stub-mappings.yaml'\n              example:\n                $ref: 'examples/message-stub-mappings.json'\n          description: All message stub mappings\n    post:\n      operationId: createMessageStubMapping\n      summary: Create a new message stub mapping\n      tags:\n        - Message Mappings\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/message-stub-mapping.yaml'\n            example:\n              $ref: 'examples/message-stub-mapping.json'\n      responses:\n        '201':\n          description: Message stub mapping created\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-stub-mapping.yaml'\n              example:\n                $ref: 'examples/message-stub-mapping.json'\n        '422':\n          $ref: \"#/components/responses/badRequestEntity\"\n    delete:\n      operationId: deleteAllMessageStubMappings\n      summary: Delete all message stub mappings\n      tags:\n        - Message Mappings\n      responses:\n        '200':\n          description: Successfully deleted\n\n  /__admin/message-mappings/{id}:\n    parameters:\n      - description: The UUID of the message stub mapping\n        in: path\n        name: id\n        required: true\n        example: 730d3e32-d098-4169-a20c-554c3bedce58\n        schema:\n          type: string\n    delete:\n      operationId: deleteMessageStubMapping\n      summary: Delete a message stub mapping\n      tags:\n        - Message Mappings\n      responses:\n        '404':\n          description: Message stub mapping not found\n        '200':\n          description: Successfully deleted\n\n  /__admin/message-mappings/find-by-metadata:\n    post:\n      operationId: findMessageStubMappingsByMetadata\n      summary: Find message stub mappings by metadata\n      description: Find message stub mappings by matching on their metadata\n      tags:\n        - Message Mappings\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/content-pattern.yaml'\n            example:\n              $ref: 'examples/by-metadata-request.yaml'\n        required: true\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-stub-mappings.yaml'\n              example:\n                $ref: 'examples/message-stub-mappings.json'\n          description: Matched message stub mappings\n\n  /__admin/message-mappings/remove-by-metadata:\n    post:\n      operationId: removeMessageStubMappingsByMetadata\n      summary: Delete message stub mappings matching metadata\n      tags:\n        - Message Mappings\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/content-pattern.yaml'\n            example:\n              $ref: 'examples/by-metadata-request.yaml'\n      responses:\n        '200':\n          description: 'The message stub mappings were successfully removed'\n\n  /__admin/messages:\n    get:\n      operationId: getAllMessageEvents\n      summary: Get all message events in journal\n      tags:\n        - Messages\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-serve-events-result.yaml'\n              example:\n                $ref: 'examples/message-serve-events.json'\n          description: List of message events\n    delete:\n      operationId: deleteAllMessageEvents\n      summary: Delete all message events in journal\n      tags:\n        - Messages\n      responses:\n        '200':\n          description: Successfully deleted\n\n  /__admin/messages/{id}:\n    parameters:\n      - description: The UUID of the message event\n        in: path\n        name: id\n        required: true\n        example: 12fb14bb-600e-4bfa-bd8d-be7f12562c99\n        schema:\n          type: string\n    get:\n      operationId: getMessageEventById\n      summary: Get message event by ID\n      tags:\n        - Messages\n      responses:\n        '404':\n          description: Message event not found\n        '200':\n          description: OK\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/single-message-serve-event-result.yaml'\n              example:\n                $ref: 'examples/message-serve-event.json'\n    delete:\n      operationId: deleteMessageEventById\n      summary: Delete message event by ID\n      tags:\n        - Messages\n      parameters:\n        - description: The UUID of the message event\n          in: path\n          name: id\n          required: true\n          example: 12fb14bb-600e-4bfa-bd8d-be7f12562c99\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Successfully deleted\n\n  /__admin/messages/count:\n    post:\n      operationId: countMessageEventsByCriteria\n      summary: Count message events by criteria\n      description: Count message events logged in the journal matching the specified criteria\n      tags:\n        - Messages\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/message-pattern.yaml'\n            example:\n              $ref: 'examples/message-pattern.json'\n      responses:\n        '200':\n          description: Number of matching message events\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-verification-result.yaml'\n              example:\n                count: 4\n                messageJournalDisabled: false\n\n  /__admin/messages/find:\n    post:\n      operationId: findMessageEventsByCriteria\n      summary: Find message events by criteria\n      description: Retrieve details of message events logged in the journal matching the specified criteria\n      tags:\n        - Messages\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/message-pattern.yaml'\n            example:\n              $ref: 'examples/message-pattern.json'\n      responses:\n        '200':\n          description: Matching message event details\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-serve-events-result.yaml'\n              example:\n                $ref: 'examples/message-serve-events.json'\n\n  /__admin/messages/remove:\n    post:\n      operationId: removeMessageEventsByCriteria\n      summary: Remove message events by criteria\n      description: Remove message events logged in the journal matching the specified criteria\n      tags:\n        - Messages\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/message-pattern.yaml'\n            example:\n              $ref: 'examples/message-pattern.json'\n      responses:\n        '200':\n          description: Removed message event details\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-serve-events-result.yaml'\n              example:\n                $ref: 'examples/message-serve-events.json'\n\n  /__admin/messages/remove-by-metadata:\n    post:\n      operationId: removeMessageEventsByMetadata\n      summary: Delete message events matching metadata\n      tags:\n        - Messages\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/content-pattern.yaml'\n            example:\n              $ref: 'examples/by-metadata-request.yaml'\n      responses:\n        '200':\n          description: Removed message event details\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-serve-events-result.yaml'\n              example:\n                $ref: 'examples/message-serve-events.json'\n\n  /__admin/messages/wait:\n    post:\n      operationId: waitForMessageEvent\n      summary: Wait for a message event\n      description: Wait for a message event matching the specified pattern\n      tags:\n        - Messages\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/wait-for-message-request.yaml'\n            example:\n              $ref: 'examples/wait-for-message-request.json'\n      responses:\n        '200':\n          description: Message event result (may be null if timeout)\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/single-message-serve-event-result.yaml'\n\n  /__admin/messages/wait-for-count:\n    post:\n      operationId: waitForMessageEvents\n      summary: Wait for multiple message events\n      description: Wait for a specified number of message events matching the specified pattern\n      tags:\n        - Messages\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/wait-for-message-request.yaml'\n            example:\n              pattern:\n                body:\n                  contains: \"hello\"\n              timeoutMillis: 5000\n              count: 3\n      responses:\n        '200':\n          description: Message events result\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-serve-events-result.yaml'\n              example:\n                $ref: 'examples/message-serve-events.json'\n\n  /__admin/channels:\n    get:\n      operationId: getAllMessageChannels\n      summary: Get all message channels\n      description: Get all active message channels\n      tags:\n        - Channels\n      responses:\n        '200':\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/message-channels-result.yaml'\n              example:\n                $ref: 'examples/message-channels.json'\n          description: All message channels\n\n  /__admin/channels/send:\n    post:\n      operationId: sendChannelMessage\n      summary: Send a message to channels\n      description: Send a message to all channels matching the specified criteria\n      tags:\n        - Channels\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: 'schemas/send-channel-message-request.yaml'\n            example:\n              $ref: 'examples/send-channel-message-request.json'\n      responses:\n        '200':\n          description: Message sent successfully\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/send-channel-message-result.yaml'\n              example:\n                channels:\n                  - id: \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n                    type: \"websocket\"\n                    open: true\n                channelsMessaged: 1\n\n  /__admin/health:\n    get:\n      operationId: getHealth\n      summary: Return the health of the WireMock server\n      description: Returns the health of the WireMock server\n      tags:\n        - System\n      responses:\n        '200':\n          description: Successful health and uptime data\n          content:\n            application/json:\n              schema:\n                $ref: 'schemas/health.yaml'\n              example:\n                $ref: 'examples/health.yaml'\n\ncomponents:\n  requestBodies:\n    requestPattern:\n      required: true\n      content:\n        application/json:\n          schema:\n            $ref: 'schemas/request-pattern.yaml'\n          example:\n            $ref: \"examples/request-pattern.yaml\"\n\n    stubMapping:\n      content:\n        application/json:\n          schema:\n            $ref: 'schemas/stub-mapping.yaml'\n          example:\n            $ref: \"examples/stub-mapping-no-id.yaml\"\n\n    startRecording:\n      required: true\n      content:\n        application/json:\n          schema:\n            allOf:\n              - $ref: 'schemas/record-spec.yaml'\n              - properties:\n                  filters:\n                    allOf:\n                      - $ref: 'schemas/request-pattern.yaml'\n                      - description: Filter requests for which to create stub mapping\n                  targetBaseUrl:\n                    type: string\n                    description: Target URL when using the record and playback API\n                    example: https://example.wiremock.org\n          example:\n            $ref: \"examples/record-spec.yaml\"\n\n    snapshotRecording:\n      required: true\n      content:\n        application/json:\n          schema:\n            type: object\n            allOf:\n              - $ref: \"schemas/record-spec.yaml\"\n              - properties:\n                  filters:\n                    type: object\n                    allOf:\n                      - properties:\n                          ids:\n                            type: array\n                            items:\n                              type: string\n                        type: object\n                        description: Filter requests for which to create stub mapping\n                      - $ref: 'schemas/request-pattern.yaml'\n          example:\n            $ref: \"examples/snapshot-spec.yaml\"\n\n  responses:\n    stubMapping:\n      description: The stub mapping\n      content:\n        application/json:\n          schema:\n            $ref: 'schemas/stub-mapping.yaml'\n          example:\n            $ref: \"examples/stub-mapping-with-id.yaml\"\n\n    nearMisses:\n      description: Near misses matching criteria\n      content:\n        application/json:\n          schema:\n            type: object\n            properties:\n              nearMisses:\n                type: array\n                items:\n                  $ref: \"schemas/logged-request.yaml\"\n          example:\n            $ref: 'examples/near-misses.yaml'\n\n    badRequestEntity:\n      description: Bad request body\n      content:\n        application/json:\n          schema:\n            $ref: \"schemas/bad-request-entity.yaml\"\n"
  },
  {
    "path": "wiremock-core/src/main/resources/version.properties",
    "content": "version=4.0.0-beta.30"
  },
  {
    "path": "wiremock-httpclient-apache5/build.gradle.kts",
    "content": "plugins {\n    id(\"wiremock.common-conventions\")\n}\n\ndependencies {\n    api(libs.apache.http5.client)\n    api(libs.apache.http5.core)\n\n    api(project(\":wiremock-core\"))\n    implementation(project(\":wiremock-url:wiremock-url\"))\n\n    testImplementation(platform(libs.junit.bom))\n    testImplementation(libs.junit.jupiter.api)\n    testImplementation(libs.junit.jupiter.params)\n    testImplementation(libs.assertj.core)\n\n    testRuntimeOnly(libs.junit.jupiter)\n    testRuntimeOnly(libs.junit.platform.launcher)\n    testRuntimeOnly(project(\":wiremock-jetty\"))\n\n    modules {\n        module(\"org.apache.logging.log4j:log4j-core\") {\n            replacedBy(\"org.apache.logging.log4j:log4j-to-slf4j\")\n        }\n        module(\"commons-logging:commons-logging\") {\n            replacedBy(\"org.slf4j:jcl-over-slf4j\")\n        }\n        module(\"log4j:log4j\") {\n            replacedBy(\"org.slf4j:log4j-over-slf4j\")\n        }\n        module(\"org.hamcrest:hamcrest-core\") {\n            replacedBy(\"org.hamcrest:hamcrest\")\n        }\n        module(\"org.hamcrest:hamcrest-library\") {\n            replacedBy(\"org.hamcrest:hamcrest\")\n        }\n    }\n}\n\ntasks.jar {\n    archiveBaseName.set(\"wiremock-httpclient-apache5\")\n}\n\npublishing {\n    publications {\n        create<MavenPublication>(\"mavenJava\") {\n            artifactId = tasks.jar.get().archiveBaseName.get()\n            from(components[\"java\"])\n\n            pom {\n                name = \"WireMock HTTP Client Apache 5\"\n                description = \"A WireMock HTTP client implementation that uses the Apache 5HTTP client\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "wiremock-httpclient-apache5/src/main/java/com/github/tomakehurst/wiremock/http/client/apache5/ApacheBackedHttpClient.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client.apache5;\n\nimport static com.github.tomakehurst.wiremock.http.Response.response;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static java.util.Objects.requireNonNull;\nimport static java.util.stream.Collectors.groupingBy;\nimport static java.util.stream.Collectors.toUnmodifiableList;\n\nimport com.github.tomakehurst.wiremock.http.HttpHeader;\nimport com.github.tomakehurst.wiremock.http.HttpHeaders;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.http.Response;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport java.io.ByteArrayInputStream;\nimport java.io.IOException;\nimport java.net.URI;\nimport java.util.Arrays;\nimport java.util.List;\nimport org.apache.hc.client5.http.entity.GzipCompressingEntity;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.core5.http.*;\nimport org.apache.hc.core5.http.io.entity.ByteArrayEntity;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.apache.hc.core5.http.io.entity.InputStreamEntity;\nimport org.apache.hc.core5.http.io.support.ClassicRequestBuilder;\nimport org.apache.hc.core5.http.message.BasicHeader;\nimport org.jspecify.annotations.NonNull;\nimport org.wiremock.url.AbsoluteUrl;\n\npublic class ApacheBackedHttpClient implements HttpClient {\n\n  private final CloseableHttpClient apacheHttpClient;\n  private final boolean preserveUserAgentProxyHeader;\n\n  public ApacheBackedHttpClient(\n      CloseableHttpClient apacheHttpClient, boolean preserveUserAgentProxyHeader) {\n    this.apacheHttpClient = apacheHttpClient;\n    this.preserveUserAgentProxyHeader = preserveUserAgentProxyHeader;\n  }\n\n  @Override\n  public Response execute(Request request) throws IOException {\n    ClassicHttpRequest apacheRequest = createApacheRequest(request, preserveUserAgentProxyHeader);\n    return apacheHttpClient.execute(apacheRequest, ApacheBackedHttpClient::toWireMockHttpResponse);\n  }\n\n  private static ClassicHttpRequest createApacheRequest(\n      Request request, boolean preserveUserAgentProxyHeader) {\n    ContentType contentType =\n        request.contentTypeHeader().isPresent()\n            ? ContentType.parse(request.contentTypeHeader().firstValue())\n            : ContentType.APPLICATION_OCTET_STREAM.withCharset(UTF_8);\n\n    URI uri = safelyToUri(requireNonNull(request.getTypedAbsoluteUrl()));\n    final ClassicRequestBuilder requestBuilder =\n        ClassicRequestBuilder.create(request.getMethod().getName())\n            .setUri(uri)\n            .setHeaders(\n                request.getHeaders().all().stream()\n                    .filter(\n                        header ->\n                            !FORBIDDEN_REQUEST_HEADERS.contains(header.key().toLowerCase())\n                                || (preserveUserAgentProxyHeader\n                                    && header.key().equalsIgnoreCase(USER_AGENT)))\n                    .flatMap(\n                        header ->\n                            header.values().stream()\n                                .map(headerValue -> new BasicHeader(header.key(), headerValue)))\n                    .toArray(Header[]::new));\n\n    if (request.getBody() != null) {\n      HttpEntity entity =\n          request.containsHeader(TRANSFER_ENCODING)\n                  && request.header(TRANSFER_ENCODING).firstValue().equals(\"chunked\")\n              ? new InputStreamEntity(new ByteArrayInputStream(request.getBody()), -1, contentType)\n              : new ByteArrayEntity(\n                  request.getBody(), request.contentTypeHeader().isPresent() ? contentType : null);\n\n      requestBuilder.setEntity(applyGzipWrapperIfRequired(request, entity));\n    }\n\n    return requestBuilder.build();\n  }\n\n  private static @NonNull URI safelyToUri(@NonNull AbsoluteUrl absoluteUrl) {\n    try {\n      return absoluteUrl.toJavaUri();\n    } catch (IllegalArgumentException e) {\n      return absoluteUrl.normalise().toJavaUri();\n    }\n  }\n\n  private static HttpEntity applyGzipWrapperIfRequired(\n      Request originalRequest, HttpEntity content) {\n    if (originalRequest.containsHeader(CONTENT_ENCODING)\n        && originalRequest.header(CONTENT_ENCODING).firstValue().contains(\"gzip\")) {\n      return new GzipCompressingEntity(content);\n    }\n\n    return content;\n  }\n\n  private static Response toWireMockHttpResponse(ClassicHttpResponse apacheResponse)\n      throws IOException {\n    final List<HttpHeader> headers =\n        Arrays.stream(apacheResponse.getHeaders())\n            .collect(groupingBy(NameValuePair::getName))\n            .entrySet()\n            .stream()\n            .map(\n                entry ->\n                    new HttpHeader(\n                        entry.getKey(),\n                        entry.getValue().stream()\n                            .map(Header::getValue)\n                            .collect(toUnmodifiableList())))\n            .collect(toUnmodifiableList());\n\n    final Response.Builder responseBuilder =\n        response()\n            .status(apacheResponse.getCode())\n            .headers(new HttpHeaders(headers))\n            .protocol(apacheResponse.getVersion().toString());\n\n    final HttpEntity entity = apacheResponse.getEntity();\n    if (entity != null) {\n      responseBuilder.body(EntityUtils.toByteArray(entity));\n    }\n\n    if (apacheResponse.getReasonPhrase() != null) {\n      responseBuilder.statusMessage(apacheResponse.getReasonPhrase());\n    }\n\n    return responseBuilder.build();\n  }\n}\n"
  },
  {
    "path": "wiremock-httpclient-apache5/src/main/java/com/github/tomakehurst/wiremock/http/client/apache5/ApacheHttpClientFactory.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client.apache5;\n\nimport static com.github.tomakehurst.wiremock.common.ProxySettings.NO_PROXY;\nimport static com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings.NO_STORE;\n\nimport com.github.tomakehurst.wiremock.common.NetworkAddressRules;\nimport com.github.tomakehurst.wiremock.common.ProxySettings;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.http.client.HttpClient;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport java.util.Collections;\nimport java.util.List;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\n\npublic class ApacheHttpClientFactory implements HttpClientFactory {\n\n  @Override\n  public HttpClient buildHttpClient(\n      Options options,\n      boolean trustAllCertificates,\n      List<String> trustedHosts,\n      boolean useSystemProperties) {\n    final CloseableHttpClient apacheClient =\n        createClient(\n            options.getMaxHttpClientConnections(),\n            options.proxyTimeout(),\n            options.proxyVia(),\n            options.httpsSettings().trustStore(),\n            trustAllCertificates,\n            trustedHosts,\n            useSystemProperties,\n            options.getProxyTargetRules(),\n            options.getDisableConnectionReuse(),\n            null);\n\n    return new ApacheBackedHttpClient(apacheClient, options.shouldPreserveUserAgentProxyHeader());\n  }\n\n  public static CloseableHttpClient createClient() {\n    return createClient(HttpClientFactory.DEFAULT_TIMEOUT);\n  }\n\n  public static CloseableHttpClient createClient(int timeoutMilliseconds) {\n    return createClient(\n        HttpClientFactory.DEFAULT_MAX_CONNECTIONS,\n        timeoutMilliseconds,\n        NO_PROXY,\n        NO_STORE,\n        true,\n        Collections.emptyList(),\n        true,\n        NetworkAddressRules.ALLOW_ALL,\n        false,\n        null);\n  }\n\n  public static CloseableHttpClient createClient(\n      int maxConnections,\n      int timeoutMilliseconds,\n      ProxySettings proxySettings,\n      KeyStoreSettings trustStoreSettings,\n      boolean trustAllCertificates,\n      final List<String> trustedHosts,\n      boolean useSystemProperties,\n      NetworkAddressRules networkAddressRules,\n      boolean disableConnectionReuse,\n      String userAgent) {\n    return StaticApacheHttpClientFactory.createClient(\n        maxConnections,\n        timeoutMilliseconds,\n        proxySettings,\n        trustStoreSettings,\n        trustAllCertificates,\n        trustedHosts,\n        useSystemProperties,\n        networkAddressRules,\n        disableConnectionReuse,\n        userAgent);\n  }\n}\n"
  },
  {
    "path": "wiremock-httpclient-apache5/src/main/java/com/github/tomakehurst/wiremock/http/client/apache5/NetworkAddressRulesAdheringDnsResolver.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client.apache5;\n\nimport com.github.tomakehurst.wiremock.common.NetworkAddressRules;\nimport com.github.tomakehurst.wiremock.common.ProhibitedNetworkAddressException;\nimport java.net.Inet4Address;\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\nimport java.util.Arrays;\nimport java.util.stream.Stream;\nimport org.apache.hc.client5.http.DnsResolver;\nimport org.apache.hc.client5.http.SystemDefaultDnsResolver;\n\npublic class NetworkAddressRulesAdheringDnsResolver implements DnsResolver {\n\n  private final DnsResolver delegate;\n  private final NetworkAddressRules networkAddressRules;\n\n  public NetworkAddressRulesAdheringDnsResolver(NetworkAddressRules networkAddressRules) {\n    this(SystemDefaultDnsResolver.INSTANCE, networkAddressRules);\n  }\n\n  public NetworkAddressRulesAdheringDnsResolver(\n      DnsResolver delegate, NetworkAddressRules networkAddressRules) {\n    this.delegate = delegate;\n    this.networkAddressRules = networkAddressRules;\n  }\n\n  @Override\n  public InetAddress[] resolve(String host) throws UnknownHostException {\n    if (!networkAddressRules.isAllowed(host)) {\n      throw new ProhibitedNetworkAddressException();\n    }\n\n    final InetAddress[] resolved = delegate.resolve(host);\n\n    if (networkAddressRules.isAllowedAll()) {\n      return resolved;\n    }\n\n    final InetAddress[] resolvedIpv4 =\n        Arrays.stream(resolved)\n            .filter(inetAddress -> inetAddress instanceof Inet4Address)\n            .toArray(InetAddress[]::new);\n\n    if (Stream.of(resolvedIpv4)\n        .anyMatch(address -> !networkAddressRules.isAllowed(address.getHostAddress()))) {\n      throw new ProhibitedNetworkAddressException();\n    }\n\n    return resolvedIpv4;\n  }\n\n  @Override\n  public String resolveCanonicalHostname(String host) throws UnknownHostException {\n    return delegate.resolveCanonicalHostname(host);\n  }\n}\n"
  },
  {
    "path": "wiremock-httpclient-apache5/src/main/java/com/github/tomakehurst/wiremock/http/client/apache5/StaticApacheHttpClientFactory.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client.apache5;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.ProxySettings.NO_PROXY;\nimport static com.github.tomakehurst.wiremock.common.Strings.isNotEmpty;\nimport static com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings.NO_STORE;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.github.tomakehurst.wiremock.common.NetworkAddressRules;\nimport com.github.tomakehurst.wiremock.common.ProxySettings;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport com.github.tomakehurst.wiremock.core.Version;\nimport com.github.tomakehurst.wiremock.http.ssl.*;\nimport java.security.*;\nimport java.util.Enumeration;\nimport java.util.List;\nimport javax.net.ssl.SSLContext;\nimport org.apache.hc.client5.http.auth.AuthScope;\nimport org.apache.hc.client5.http.auth.UsernamePasswordCredentials;\nimport org.apache.hc.client5.http.config.RequestConfig;\nimport org.apache.hc.client5.http.impl.DefaultAuthenticationStrategy;\nimport org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.HttpClientBuilder;\nimport org.apache.hc.client5.http.impl.io.ManagedHttpClientConnectionFactory;\nimport org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;\nimport org.apache.hc.client5.http.socket.LayeredConnectionSocketFactory;\nimport org.apache.hc.client5.http.ssl.NoopHostnameVerifier;\nimport org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;\nimport org.apache.hc.core5.http.HttpHost;\nimport org.apache.hc.core5.http.config.CharCodingConfig;\nimport org.apache.hc.core5.util.TextUtils;\nimport org.apache.hc.core5.util.TimeValue;\nimport org.apache.hc.core5.util.Timeout;\n\nclass StaticApacheHttpClientFactory {\n\n  static CloseableHttpClient createClient(\n      int maxConnections,\n      int timeoutMilliseconds,\n      ProxySettings proxySettings,\n      KeyStoreSettings trustStoreSettings,\n      boolean trustAllCertificates,\n      final List<String> trustedHosts,\n      boolean useSystemProperties,\n      NetworkAddressRules networkAddressRules,\n      boolean disableConnectionReuse,\n      String userAgent) {\n\n    NetworkAddressRulesAdheringDnsResolver dnsResolver =\n        new NetworkAddressRulesAdheringDnsResolver(networkAddressRules);\n\n    HttpClientBuilder builder =\n        HttpClientBuilder.create()\n            .disableAuthCaching()\n            .disableAutomaticRetries()\n            .disableCookieManagement()\n            .disableRedirectHandling()\n            .disableContentCompression()\n            .setDefaultRequestConfig(\n                RequestConfig.custom()\n                    .setResponseTimeout(Timeout.ofMilliseconds(timeoutMilliseconds))\n                    .setProtocolUpgradeEnabled(false)\n                    .build());\n\n    String effectiveUserAgent =\n        userAgent != null ? userAgent : \"WireMock \" + Version.getCurrentVersion();\n    builder.setUserAgent(effectiveUserAgent);\n\n    if (disableConnectionReuse) {\n      builder\n          .setConnectionReuseStrategy((request, response, context) -> false)\n          .setKeepAliveStrategy((response, context) -> TimeValue.ZERO_MILLISECONDS);\n    }\n\n    if (useSystemProperties) {\n      builder.useSystemProperties();\n    }\n\n    if (proxySettings != NO_PROXY) {\n      HttpHost proxyHost = new HttpHost(proxySettings.host(), proxySettings.port());\n      builder.setProxy(proxyHost);\n      if (isNotEmpty(proxySettings.getUsername()) && isNotEmpty(proxySettings.getPassword())) {\n        builder.setProxyAuthenticationStrategy(new DefaultAuthenticationStrategy()); // TODO Verify\n        BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();\n        credentialsProvider.setCredentials(\n            new AuthScope(proxySettings.host(), proxySettings.port()),\n            new UsernamePasswordCredentials(\n                proxySettings.getUsername(), proxySettings.getPassword().toCharArray()));\n        builder.setDefaultCredentialsProvider(credentialsProvider);\n      }\n    }\n\n    final SSLContext sslContext =\n        buildSslContext(trustStoreSettings, trustAllCertificates, trustedHosts);\n    LayeredConnectionSocketFactory sslSocketFactory = buildSslConnectionSocketFactory(sslContext);\n    builder.setConnectionManager(\n        PoolingHttpClientConnectionManagerBuilder.create()\n            .setSSLSocketFactory(sslSocketFactory)\n            .setDnsResolver(dnsResolver)\n            .setMaxConnPerRoute(maxConnections)\n            .setMaxConnTotal(maxConnections)\n            .setValidateAfterInactivity(TimeValue.ofSeconds(5)) // TODO Verify duration\n            .setConnectionFactory(\n                new ManagedHttpClientConnectionFactory(\n                    null, CharCodingConfig.custom().setCharset(UTF_8).build(), null))\n            .build());\n\n    return builder.build();\n  }\n\n  private static LayeredConnectionSocketFactory buildSslConnectionSocketFactory(\n      final SSLContext sslContext) {\n    final String[] supportedProtocols = split(System.getProperty(\"https.protocols\"));\n    final String[] supportedCipherSuites = split(System.getProperty(\"https.cipherSuites\"));\n\n    return new SSLConnectionSocketFactory(\n        new HostVerifyingSSLSocketFactory(sslContext.getSocketFactory()),\n        supportedProtocols,\n        supportedCipherSuites,\n        new NoopHostnameVerifier() // using Java's hostname verification\n        );\n  }\n\n  private static String[] split(final String s) {\n    if (TextUtils.isBlank(s)) {\n      return null;\n    }\n    return s.split(\" *, *\");\n  }\n\n  private static SSLContext buildSslContext(\n      KeyStoreSettings trustStoreSettings,\n      boolean trustAllCertificates,\n      List<String> trustedHosts) {\n    if (trustStoreSettings != NO_STORE) {\n      return buildSSLContextWithTrustStore(trustStoreSettings, trustAllCertificates, trustedHosts);\n    } else if (trustAllCertificates) {\n      return buildAllowAnythingSSLContext();\n    } else {\n      try {\n        return SSLContextBuilder.create()\n            .loadTrustMaterial(new TrustSpecificHostsStrategy(trustedHosts))\n            .build();\n      } catch (NoSuchAlgorithmException | KeyManagementException e) {\n        return throwUnchecked(e, null);\n      }\n    }\n  }\n\n  private static SSLContext buildSSLContextWithTrustStore(\n      KeyStoreSettings trustStoreSettings,\n      boolean trustSelfSignedCertificates,\n      List<String> trustedHosts) {\n    try {\n      KeyStore trustStore = trustStoreSettings.loadStore();\n      SSLContextBuilder sslContextBuilder =\n          SSLContextBuilder.create()\n              .loadKeyMaterial(trustStore, trustStoreSettings.password().toCharArray());\n      if (trustSelfSignedCertificates) {\n        sslContextBuilder.loadTrustMaterial(new TrustSelfSignedStrategy());\n      } else if (containsCertificate(trustStore)) {\n        sslContextBuilder.loadTrustMaterial(\n            trustStore, new TrustSpecificHostsStrategy(trustedHosts));\n      } else {\n        sslContextBuilder.loadTrustMaterial(new TrustSpecificHostsStrategy(trustedHosts));\n      }\n      return sslContextBuilder.build();\n    } catch (Exception e) {\n      return throwUnchecked(e, SSLContext.class);\n    }\n  }\n\n  private static boolean containsCertificate(KeyStore trustStore) throws KeyStoreException {\n    Enumeration<String> aliases = trustStore.aliases();\n    while (aliases.hasMoreElements()) {\n      String alias = aliases.nextElement();\n      try {\n        if (trustStore.getEntry(alias, null) instanceof KeyStore.TrustedCertificateEntry) {\n          return true;\n        }\n      } catch (NoSuchAlgorithmException | UnrecoverableEntryException e) {\n        // ignore\n      }\n    }\n    return false;\n  }\n\n  private static SSLContext buildAllowAnythingSSLContext() {\n    try {\n      return SSLContextBuilder.create().loadTrustMaterial(new TrustEverythingStrategy()).build();\n    } catch (Exception e) {\n      return throwUnchecked(e, null);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-httpclient-apache5/src/main/java/com/github/tomakehurst/wiremock/http/client/apache5/TrustSelfSignedStrategy.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client.apache5;\n\nimport java.net.Socket;\nimport java.security.cert.X509Certificate;\nimport javax.net.ssl.SSLEngine;\n\npublic class TrustSelfSignedStrategy\n    implements org.apache.hc.core5.ssl.TrustStrategy,\n        com.github.tomakehurst.wiremock.http.ssl.TrustStrategy {\n\n  @Override\n  public boolean isTrusted(X509Certificate[] chain, String authType) {\n    return chain.length == 1;\n  }\n\n  @Override\n  public boolean isTrusted(X509Certificate[] chain, String authType, Socket socket) {\n    return chain.length == 1;\n  }\n\n  @Override\n  public boolean isTrusted(X509Certificate[] chain, String authType, SSLEngine engine) {\n    return chain.length == 1;\n  }\n}\n"
  },
  {
    "path": "wiremock-httpclient-apache5/src/main/resources/META-INF/services/com.github.tomakehurst.wiremock.extension.Extension",
    "content": "com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory\n"
  },
  {
    "path": "wiremock-httpclient-apache5/src/test/java/com/github/tomakehurst/wiremock/http/client/apache5/NetworkAddressRulesAdheringDnsResolverTest.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.http.client.apache5;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatThrownBy;\n\nimport com.github.tomakehurst.wiremock.common.NetworkAddressRules;\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\nimport java.util.stream.Stream;\nimport org.apache.hc.client5.http.impl.InMemoryDnsResolver;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.ValueSource;\n\npublic class NetworkAddressRulesAdheringDnsResolverTest {\n\n  InMemoryDnsResolver dns = new InMemoryDnsResolver();\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"10.1.1.2\", \"2.example.com\"})\n  void resolveReturnsWithUnmatchedIpv4DenyRule(String host) throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().deny(\"10.1.1.1\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThat(resolver.resolve(host)).isEqualTo(dns.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"10.1.1.1\",\n        \"1.example.com\",\n        \"3.example.com\",\n      })\n  void resolveThrowsExceptionWithMatchedIpv4DenyRule(String host) throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().deny(\"10.1.1.1\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThatThrownBy(() -> resolver.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"10.1.1.2\", \"10.1.1.3\", \"2.example.com\"})\n  void resolveReturnsForHostnameResolvingToMultipleAddressesWithUnmatchedIpv4DenyRule(String host)\n      throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.0\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\", \"10.1.1.3\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().deny(\"10.1.1.1\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThat(resolver.resolve(host)).isEqualTo(dns.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"10.1.1.1\", \"1.example.com\"})\n  void resolveThrowsExceptionForHostnameResolvingToMultipleAddressesWithMatchedIpv4DenyRule(\n      String host) throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.0\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\", \"10.1.1.3\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().deny(\"10.1.1.1\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThatThrownBy(() -> resolver.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"10.1.1.1\", \"1.example.com\"})\n  void resolveReturnsWithUnmatchedIpv4AllowRule(String host) throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().allow(\"10.1.1.1\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThat(resolver.resolve(host)).isEqualTo(dns.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"10.1.1.2\",\n        \"2.example.com\",\n        \"3.example.com\",\n      })\n  void resolveThrowsExceptionWithMatchedIpv4AllowRule(String host) throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().allow(\"10.1.1.1\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThatThrownBy(() -> resolver.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"10.1.1.1\",\n      })\n  void resolveReturnsForHostnameResolvingToMultipleAddressesWithUnmatchedIpv4AllowRule(String host)\n      throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.0\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\", \"10.1.1.3\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().allow(\"10.1.1.1\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThat(resolver.resolve(host)).isEqualTo(dns.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"10.1.1.0\",\n        \"10.1.1.2\",\n        \"10.1.1.3\",\n        \"1.example.com\",\n        \"2.example.com\",\n        \"3.example.com\",\n      })\n  void resolveThrowsExceptionForHostnameResolvingToMultipleAddressesWithMatchedIpv4AllowRule(\n      String host) throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.0\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\", \"10.1.1.3\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().allow(\"10.1.1.1\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThatThrownBy(() -> resolver.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"10.1.1.1\",\n        \"10.1.1.2\",\n        \"2.example.com\",\n      })\n  void resolveReturnsForIpv4AddressWithHostnameDenyRule(String host) throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().deny(\"1.example.com\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThat(resolver.resolve(host)).isEqualTo(dns.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"1.example.com\",\n        \"3.example.com\",\n      })\n  void resolveThrowsExceptionForIpv4AddressWithHostnameDenyRule(String host)\n      throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().deny(\"1.example.com\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThatThrownBy(() -> resolver.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"10.1.1.1\",\n        \"10.1.1.2\",\n        \"1.example.com\",\n      })\n  void resolveReturnsForIpv4AddressWithHostnameAllowRule(String host) throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().allow(\"1.example.com\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThat(resolver.resolve(host)).isEqualTo(dns.resolve(host));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"2.example.com\",\n        \"3.example.com\",\n      })\n  void resolveThrowsExceptionForIpv4AddressWithHostnameAllowRule(String host)\n      throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\");\n    register(\"2.example.com\", \"10.1.1.2\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().allow(\"1.example.com\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThatThrownBy(() -> resolver.resolve(host));\n  }\n\n  @Test\n  void resolveIgnoresIpv6Addresses() throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\", \"2001:0db8:85a3:0000:0000:8a2e:0370:7334\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().allow(\"10.1.1.1\").build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThat(resolver.resolve(\"1.example.com\")).isEqualTo(dns.resolve(\"10.1.1.1\"));\n  }\n\n  @Test\n  void resolveIpv4AndIpv6AddressesWithoutCustomRules() throws UnknownHostException {\n    register(\"1.example.com\", \"10.1.1.1\", \"2001:0db8:85a3:0000:0000:8a2e:0370:7334\");\n\n    NetworkAddressRules rules = NetworkAddressRules.builder().build();\n\n    NetworkAddressRulesAdheringDnsResolver resolver =\n        new NetworkAddressRulesAdheringDnsResolver(dns, rules);\n\n    assertThat(resolver.resolve(\"1.example.com\")).isEqualTo(dns.resolve(\"1.example.com\"));\n  }\n\n  private void register(String host, String... ipAddresses) throws UnknownHostException {\n    dns.add(\n        host,\n        Stream.of(ipAddresses)\n            .map(NetworkAddressRulesAdheringDnsResolverTest::toInetAddress)\n            .toArray(InetAddress[]::new));\n    for (String ipAddress : ipAddresses) {\n      dns.add(ipAddress, InetAddress.getByName(ipAddress));\n    }\n  }\n\n  private static InetAddress toInetAddress(String ipAddress) {\n    try {\n      return InetAddress.getByName(ipAddress);\n    } catch (UnknownHostException e) {\n      throw new RuntimeException(e);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/build.gradle.kts",
    "content": "plugins {\n    id(\"wiremock.common-conventions\")\n}\n\ndependencies {\n    api(project(\":wiremock-core\"))\n    api(project(\":wiremock-url:wiremock-url\"))\n\n    api(libs.jakarta.servlet.api)\n\n    api(platform(libs.jetty.bom))\n    api(platform(libs.jetty.ee11.bom))\n    api(libs.jetty.ee11.servlet)\n    api(libs.jetty.io)\n    api(libs.jetty.server)\n    api(libs.jetty.util)\n    api(libs.jetty.websocket.jetty.api)\n\n    api(libs.jspecify)\n\n    implementation(libs.jetty.alpn.server)\n    implementation(libs.jetty.ee11.servlets)\n    implementation(libs.jetty.http)\n    implementation(libs.jetty.http2.common)\n    implementation(libs.jetty.http2.server)\n\n    implementation(libs.jetty.ee11.websocket.jetty.server)\n\n    runtimeOnly(libs.jetty.ee11.websockets)\n    runtimeOnly(libs.jetty.alpn.java.client)\n    runtimeOnly(libs.jetty.alpn.java.server)\n    runtimeOnly(libs.jetty.ee11.webapp)\n\n    implementation(libs.guava)\n\n    modules {\n        module(\"javax.activation:activation\") {\n            replacedBy(\"jakarta.activation:jakarta.activation-api\")\n        }\n        module(\"javax.activation:javax.activation-api\") {\n            replacedBy(\"jakarta.activation:jakarta.activation-api\")\n        }\n        module(\"javax.validation:validation-api\") {\n            replacedBy(\"jakarta.validation:jakarta.validation-api\")\n        }\n        module(\"javax.xml.bind:jaxb-api\") {\n            replacedBy(\"jakarta.xml.bind:jakarta.xml.bind-api\")\n        }\n        module(\"javax.ws.rs:jsr311-api\") {\n            replacedBy(\"jakarta.ws.rs:jakarta.ws.rs-api\")\n        }\n        module(\"javax.ws.rs:javax.ws.rs-api\") {\n            replacedBy(\"jakarta.ws.rs:jakarta.ws.rs-api\")\n        }\n        module(\"javax.servlet:javax.servlet-api\") {\n            replacedBy(\"jakarta.servlet:jakarta.servlet-api\")\n        }\n        module(\"org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api\") {\n            replacedBy(\"jakarta.servlet:jakarta.servlet-api\")\n        }\n        module(\"javax.annotation:javax.annotation-api\") {\n            replacedBy(\"jakarta.annotation:jakarta.annotation-api\")\n        }\n        module(\"com.sun.activation:jakarta.activation\") {\n            replacedBy(\"jakarta.activation:jakarta.activation-api\")\n        }\n    }\n}\n\ntasks.jar {\n    archiveBaseName.set(\"wiremock-jetty\")\n}\n\npublishing {\n    publications {\n        create<MavenPublication>(\"mavenJava\") {\n            artifactId = tasks.jar.get().archiveBaseName.get()\n            from(components[\"java\"])\n\n            pom {\n                name = \"WireMock Jetty\"\n                description = \"A Jetty implementation of WireMock's HttpServer\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/DefaultMultipartRequestConfigElementBuilder.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport com.github.tomakehurst.wiremock.jetty.servlet.MultipartRequestConfigElementBuilder;\nimport jakarta.servlet.MultipartConfigElement;\n\npublic class DefaultMultipartRequestConfigElementBuilder\n    implements MultipartRequestConfigElementBuilder {\n\n  public MultipartConfigElement build() {\n    return new MultipartConfigElement(\n        System.getProperty(\"java.io.tmpdir\"), Integer.MAX_VALUE, -1L, 0);\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/Jetty12HttpServer.java",
    "content": "/*\n * Copyright (C) 2019-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.ADMIN_CONTEXT_ROOT;\nimport static com.github.tomakehurst.wiremock.jetty.JettyUtils.createHttpConfig;\nimport static com.github.tomakehurst.wiremock.jetty.ssl.SslContexts.buildManInTheMiddleSslContextFactory;\nimport static java.util.concurrent.Executors.newScheduledThreadPool;\n\nimport com.github.tomakehurst.wiremock.common.AsynchronousResponseSettings;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport com.github.tomakehurst.wiremock.common.HttpsSettings;\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockApp;\nimport com.github.tomakehurst.wiremock.http.AdminRequestHandler;\nimport com.github.tomakehurst.wiremock.http.RequestHandler;\nimport com.github.tomakehurst.wiremock.http.StubRequestHandler;\nimport com.github.tomakehurst.wiremock.jetty.faults.JettyFaultInjectorFactory;\nimport com.github.tomakehurst.wiremock.jetty.proxy.HttpProxyDetectingHandler;\nimport com.github.tomakehurst.wiremock.jetty.proxy.HttpsProxyDetectingHandler;\nimport com.github.tomakehurst.wiremock.jetty.proxy.ManInTheMiddleSslConnectHandler;\nimport com.github.tomakehurst.wiremock.jetty.servlet.ContentTypeSettingFilter;\nimport com.github.tomakehurst.wiremock.jetty.servlet.FaultInjectorFactory;\nimport com.github.tomakehurst.wiremock.jetty.servlet.NotMatchedServlet;\nimport com.github.tomakehurst.wiremock.jetty.servlet.TrailingSlashFilter;\nimport com.github.tomakehurst.wiremock.jetty.ssl.SslContexts;\nimport com.github.tomakehurst.wiremock.jetty.websocket.WireMockWebSocketEndpoint;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport jakarta.servlet.DispatcherType;\nimport java.time.Duration;\nimport java.util.*;\nimport java.util.stream.Stream;\nimport org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;\nimport org.eclipse.jetty.ee11.servlet.*;\nimport org.eclipse.jetty.ee11.servlets.CrossOriginFilter;\nimport org.eclipse.jetty.ee11.websocket.server.config.JettyWebSocketServletContainerInitializer;\nimport org.eclipse.jetty.http.HttpVersion;\nimport org.eclipse.jetty.http.MimeTypes;\nimport org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory;\nimport org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;\nimport org.eclipse.jetty.io.NetworkTrafficListener;\nimport org.eclipse.jetty.server.*;\nimport org.eclipse.jetty.server.handler.gzip.GzipHandler;\nimport org.eclipse.jetty.util.Callback;\nimport org.eclipse.jetty.util.resource.Resource;\nimport org.eclipse.jetty.util.resource.ResourceFactory;\nimport org.eclipse.jetty.util.resource.Resources;\nimport org.eclipse.jetty.util.ssl.SslContextFactory;\nimport org.eclipse.jetty.util.thread.ThreadPool;\n\npublic class Jetty12HttpServer extends JettyHttpServer {\n\n  private ServerConnector mitmProxyConnector;\n\n  public Jetty12HttpServer(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler,\n      JettySettings jettySettings,\n      ThreadPool threadPool,\n      MessageStubRequestHandler messageStubRequestHandler) {\n    super(\n        options,\n        adminRequestHandler,\n        stubRequestHandler,\n        jettySettings,\n        threadPool,\n        messageStubRequestHandler);\n  }\n\n  @Override\n  protected ServerConnector createHttpConnector(\n      String bindAddress, int port, JettySettings jettySettings, NetworkTrafficListener listener) {\n\n    HttpConfiguration httpConfig = createHttpConfig(jettySettings);\n\n    ConnectionFactory[] connectionFactories =\n        Stream.of(\n                new HttpConnectionFactory(httpConfig),\n                options.getHttp2PlainDisabled()\n                    ? null\n                    : new HTTP2CServerConnectionFactory(httpConfig))\n            .filter(Objects::nonNull)\n            .toArray(ConnectionFactory[]::new);\n\n    return JettyUtils.createServerConnector(\n        jettyServer, bindAddress, jettySettings, port, listener, connectionFactories);\n  }\n\n  @Override\n  protected ServerConnector createHttpsConnector(\n      String bindAddress,\n      HttpsSettings httpsSettings,\n      JettySettings jettySettings,\n      NetworkTrafficListener listener) {\n\n    HttpConfiguration httpConfig = createHttpConfig(jettySettings);\n\n    ConnectionFactory[] connectionFactories;\n\n    if (!options.getHttp2TlsDisabled()) {\n\n      SslContextFactory.Server http2SslContextFactory =\n          SslContexts.buildHttp2SslContextFactory(httpsSettings);\n\n      HttpConnectionFactory http = new HttpConnectionFactory(httpConfig);\n      HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(httpConfig);\n\n      try {\n        ALPNServerConnectionFactory alpn = new ALPNServerConnectionFactory();\n\n        SslConnectionFactory ssl =\n            new SslConnectionFactory(http2SslContextFactory, alpn.getProtocol());\n\n        connectionFactories = new ConnectionFactory[] {ssl, alpn, h2, http};\n      } catch (IllegalStateException e) {\n        SslConnectionFactory ssl =\n            new SslConnectionFactory(http2SslContextFactory, http.getProtocol());\n\n        connectionFactories = new ConnectionFactory[] {ssl, http};\n      }\n    } else {\n      final SslContextFactory.Server sslContextFactory =\n          SslContexts.buildHttp1_1SslContextFactory(httpsSettings);\n      final SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory, \"http/1.1\");\n      final HttpConnectionFactory http = new HttpConnectionFactory(httpConfig);\n      connectionFactories = new ConnectionFactory[] {ssl, http};\n    }\n\n    return JettyUtils.createServerConnector(\n        jettyServer,\n        bindAddress,\n        jettySettings,\n        httpsSettings.port(),\n        listener,\n        connectionFactories);\n  }\n\n  @Override\n  protected void applyAdditionalServerConfiguration(Server jettyServer, Options options) {\n    if (options.browserProxySettings().enabled()) {\n      final SslConnectionFactory ssl =\n          new SslConnectionFactory(\n              buildManInTheMiddleSslContextFactory(\n                  options.httpsSettings(), options.browserProxySettings(), options.notifier()),\n              /*\n              If the proxy CONNECT request is made over HTTPS, and the\n              actual content request is made using HTTP/2 tunneled over\n              HTTPS, and an exception is thrown, the server blocks for 30\n              seconds before flushing the response.\n\n              To fix this, force HTTP/1.1 over TLS when tunneling HTTPS.\n\n              This also means the HTTP mitmProxyConnector does not need the alpn &\n              h2 connection factories as it will not use them.\n\n              Unfortunately it has proven too hard to write a test to\n              demonstrate the bug; it requires an HTTP client capable of\n              doing ALPN & HTTP/2, which will only offer HTTP/1.1 in the\n              ALPN negotiation when using HTTPS for the initial CONNECT\n              request but will then offer both HTTP/1.1 and HTTP/2 for the\n              actual request (this is how curl 7.64.1 behaves!). Neither\n              Apache HTTP 4, 5, 5 Async, OkHttp, nor the Jetty client\n              could do this. It might be possible to write one using\n              Netty, but it would be hard and time-consuming.\n               */\n              HttpVersion.HTTP_1_1.asString());\n\n      HttpConfiguration httpConfig = createHttpConfig(jettySettings);\n      HttpConnectionFactory http = new HttpConnectionFactory(httpConfig);\n      mitmProxyConnector =\n          new NetworkTrafficServerConnector(jettyServer, null, null, null, 2, 2, ssl, http);\n\n      mitmProxyConnector.setPort(0);\n      mitmProxyConnector.setShutdownIdleTimeout(\n          jettySettings.getShutdownIdleTimeout().orElse(100L));\n\n      jettyServer.addConnector(mitmProxyConnector);\n    }\n  }\n\n  @Override\n  protected Handler createHandler(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler) {\n    Notifier notifier = options.notifier();\n    ServletContextHandler adminContext = addAdminContext(adminRequestHandler, notifier);\n    ServletContextHandler mockServiceContext =\n        addMockServiceContext(\n            adminContext,\n            stubRequestHandler,\n            // Setting the files to the real path here since Jetty 12 does not include\n            // the servlet context path in forwarded request (and at the moment, there\n            // is no way to tell it to do so), the RequestDispatcher.FORWARD_SERVLET_PATH is\n            // ignored (only RequestDispatcher.INCLUDE_SERVLET_PATH is taken into account but\n            // that requires change from to RequestDispatcher#forward() to\n            // RequestDispatcher#include()).\n            options.filesRoot().child(WireMockApp.FILES_ROOT),\n            options.getAsynchronousResponseSettings(),\n            options.getChunkedEncodingPolicy(),\n            options.getStubCorsEnabled(),\n            options.browserProxySettings().enabled(),\n            notifier);\n\n    final List<Handler> handlers = new ArrayList<>(Arrays.asList(extensionHandlers()));\n    handlers.add(adminContext);\n    Handler.Abstract asyncTimeoutSettingHandler =\n        new Handler.Abstract() {\n          @Override\n          public boolean handle(Request request, Response response, Callback callback) {\n            if (request instanceof ServletContextRequest r) {\n              r.getState().setTimeout(options.timeout());\n            }\n            return false;\n          }\n        };\n    handlers.add(asyncTimeoutSettingHandler);\n\n    if (options.getGzipDisabled()) {\n      handlers.add(mockServiceContext);\n    } else {\n      addGZipHandler(mockServiceContext, handlers);\n    }\n\n    if (options.browserProxySettings().enabled()) {\n      handlers.add(0, new HttpProxyDetectingHandler(httpConnector));\n      handlers.add(0, new HttpsProxyDetectingHandler(mitmProxyConnector));\n      handlers.add(0, new ManInTheMiddleSslConnectHandler(mitmProxyConnector));\n    }\n\n    return new Handler.Sequence(handlers);\n  }\n\n  @SuppressWarnings(\"unused\")\n  protected void decorateAdminServiceContextBeforeConfig(\n      ServletContextHandler adminServiceContext) {}\n\n  @SuppressWarnings(\"unused\")\n  protected void decorateAdminServiceContextAfterConfig(\n      ServletContextHandler adminServiceContext) {}\n\n  private void addCorsFilter(ServletContextHandler context) {\n    context.addFilter(buildCorsFilter(), \"/*\", EnumSet.of(DispatcherType.REQUEST));\n  }\n\n  private ServletContextHandler addAdminContext(\n      AdminRequestHandler adminRequestHandler, Notifier notifier) {\n    ServletContextHandler adminContext = new ServletContextHandler();\n    adminContext.setServer(jettyServer);\n    adminContext.setContextPath(ADMIN_CONTEXT_ROOT);\n\n    decorateAdminServiceContextBeforeConfig(adminContext);\n\n    adminContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.maxCacheSize\", \"0\");\n\n    Resource assetsResource = ResourceFactory.of(adminContext).newClassLoaderResource(\"assets\");\n    if (Resources.isReadable(assetsResource)) {\n      adminContext.setBaseResource(assetsResource);\n    }\n\n    adminContext.setWelcomeFiles(new String[] {\"index.html\", \"index.jsp\"});\n\n    adminContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n\n    ServletHolder swaggerUiServletHolder =\n        adminContext.addServlet(DefaultServlet.class, \"/swagger-ui/*\");\n    swaggerUiServletHolder.setInitParameter(\"baseResource\", \"swagger-ui\");\n    swaggerUiServletHolder.setAsyncSupported(false);\n\n    ServletHolder recorderServletHolder =\n        adminContext.addServlet(DefaultServlet.class, \"/recorder/*\");\n    recorderServletHolder.setInitParameter(\"baseResource\", \"recorder\");\n\n    ServletHolder servletHolder =\n        adminContext.addServlet(WireMockHandlerDispatchingServlet.class, \"/\");\n    servletHolder.setInitParameter(\n        RequestHandler.HANDLER_CLASS_KEY, AdminRequestHandler.class.getName());\n    adminContext.setAttribute(AdminRequestHandler.class.getName(), adminRequestHandler);\n    adminContext.setAttribute(Notifier.KEY, notifier);\n\n    servletHolder.getRegistration().setMultipartConfig(buildMultipartRequestConfigurer().build());\n\n    adminContext.addServlet(NotMatchedServlet.class, \"/not-matched\");\n\n    addCorsFilter(adminContext);\n\n    decorateAdminServiceContextAfterConfig(adminContext);\n\n    return adminContext;\n  }\n\n  private ServletContextHandler addMockServiceContext(\n      ServletContextHandler adminContext,\n      StubRequestHandler stubRequestHandler,\n      FileSource fileSource,\n      AsynchronousResponseSettings asynchronousResponseSettings,\n      Options.ChunkedEncodingPolicy chunkedEncodingPolicy,\n      boolean stubCorsEnabled,\n      boolean browserProxyingEnabled,\n      Notifier notifier) {\n    ServletContextHandler mockServiceContext = new ServletContextHandler();\n    mockServiceContext.setServer(jettyServer);\n    mockServiceContext.setContextPath(\"/\");\n    String fileSourcePath = fileSource.getPath();\n    if (!fileSourcePath.isEmpty()) {\n      Resource fileSourceResource =\n          ResourceFactory.of(mockServiceContext).newResource(fileSourcePath);\n      if (Resources.isReadable(fileSourceResource)) {\n        mockServiceContext.setBaseResource(fileSourceResource);\n      }\n    }\n\n    decorateMockServiceContextBeforeConfig(mockServiceContext);\n\n    mockServiceContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.maxCacheSize\", \"0\");\n    mockServiceContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n\n    mockServiceContext.addServlet(DefaultServlet.class, FILES_URL_MATCH);\n\n    final Jetty12HttpUtils utils = new Jetty12HttpUtils();\n    mockServiceContext.setAttribute(JettyHttpUtils.class.getName(), utils);\n\n    mockServiceContext.setAttribute(\n        JettyFaultInjectorFactory.class.getName(), new JettyFaultInjectorFactory(utils));\n    mockServiceContext.setAttribute(StubRequestHandler.class.getName(), stubRequestHandler);\n    mockServiceContext.setAttribute(Notifier.KEY, notifier);\n    mockServiceContext.setAttribute(\n        Options.ChunkedEncodingPolicy.class.getName(), chunkedEncodingPolicy);\n    mockServiceContext.setAttribute(\"browserProxyingEnabled\", browserProxyingEnabled);\n    ServletHolder servletHolder =\n        mockServiceContext.addServlet(WireMockHandlerDispatchingServlet.class, \"/\");\n    servletHolder.setInitOrder(1);\n    servletHolder.setInitParameter(\n        RequestHandler.HANDLER_CLASS_KEY, StubRequestHandler.class.getName());\n    servletHolder.setInitParameter(\n        FaultInjectorFactory.INJECTOR_CLASS_KEY, JettyFaultInjectorFactory.class.getName());\n    servletHolder.setInitParameter(\n        WireMockHandlerDispatchingServlet.SHOULD_FORWARD_TO_FILES_CONTEXT, \"true\");\n\n    if (asynchronousResponseSettings.isEnabled()) {\n      scheduledExecutorService = newScheduledThreadPool(asynchronousResponseSettings.getThreads());\n      mockServiceContext.setAttribute(\n          WireMockHandlerDispatchingServlet.ASYNCHRONOUS_RESPONSE_EXECUTOR,\n          scheduledExecutorService);\n    }\n\n    servletHolder.getRegistration().setMultipartConfig(buildMultipartRequestConfigurer().build());\n\n    MimeTypes.Mutable mimeTypes = mockServiceContext.getMimeTypes();\n    // For files without extension, use \"application/json\" as the default in case\n    // file extension is not provided(and content type could not be detected).\n    mimeTypes.addMimeMapping(\"*\", \"application/json\");\n    mimeTypes.addMimeMapping(\"json\", \"application/json\");\n    mimeTypes.addMimeMapping(\"html\", \"text/html\");\n    mimeTypes.addMimeMapping(\"xml\", \"application/xml\");\n    mimeTypes.addMimeMapping(\"txt\", \"text/plain\");\n\n    // Nasty hack to prevent Jetty 12 + EE11 adding charsets we didn't ask for to the Content-Type\n    // header\n    Stream.of(\"text/plain\", \"text/xml\", \"text/html\", \"application/xhtml+xml\")\n        .forEach(mt -> mimeTypes.addInferred(mt, null));\n\n    mockServiceContext.setWelcomeFiles(\n        new String[] {\"index.json\", \"index.html\", \"index.xml\", \"index.txt\"});\n\n    // Jetty 12 does not currently support cross context dispatch, we\n    // need to use the adminContext explicitly.\n    NotFoundHandler errorHandler = new NotFoundHandler(adminContext);\n    mockServiceContext.setErrorHandler(errorHandler);\n\n    mockServiceContext.addFilter(\n        ContentTypeSettingFilter.class, FILES_URL_MATCH, EnumSet.of(DispatcherType.FORWARD));\n    mockServiceContext.addFilter(\n        TrailingSlashFilter.class, FILES_URL_MATCH, EnumSet.allOf(DispatcherType.class));\n\n    if (stubCorsEnabled) {\n      addCorsFilter(mockServiceContext);\n    }\n\n    // Configure WebSocket support using the filter-based approach\n    // This ensures non-WebSocket requests pass through to the normal servlet chain\n    JettyWebSocketServletContainerInitializer.configure(\n        mockServiceContext,\n        (servletContext, container) -> {\n          // Set WebSocket configuration from options\n          container.setIdleTimeout(Duration.ofMillis(options.getWebSocketIdleTimeout()));\n          container.setMaxTextMessageSize(options.getWebSocketMaxTextMessageSize());\n          container.setMaxBinaryMessageSize(options.getWebSocketMaxBinaryMessageSize());\n\n          // Add WebSocket mapping that accepts all WebSocket upgrade requests\n          container.addMapping(\n              \"/*\",\n              (upgradeRequest, upgradeResponse) -> {\n                // Convert the upgrade request to a WireMock Request and create a snapshot\n                // We need to create a LoggedRequest snapshot because the servlet request\n                // becomes invalid after the WebSocket upgrade completes\n                com.github.tomakehurst.wiremock.http.Request servletRequest =\n                    new WireMockHttpServletRequestAdapter(\n                        upgradeRequest.getHttpServletRequest(), null, false);\n                com.github.tomakehurst.wiremock.http.Request wireMockRequest =\n                    LoggedRequest.createFrom(servletRequest);\n\n                // Create and return the WebSocket endpoint\n                return new WireMockWebSocketEndpoint(messageStubRequestHandler, wireMockRequest);\n              });\n        });\n\n    decorateMockServiceContextAfterConfig(mockServiceContext);\n\n    return mockServiceContext;\n  }\n\n  @SuppressWarnings(\"unused\")\n  protected void decorateMockServiceContextBeforeConfig(ServletContextHandler mockServiceContext) {}\n\n  @SuppressWarnings(\"unused\")\n  protected void decorateMockServiceContextAfterConfig(ServletContextHandler mockServiceContext) {}\n\n  private void addGZipHandler(ServletContextHandler mockServiceContext, List<Handler> handlers) {\n    try {\n      GzipHandler gzipHandler = new GzipHandler();\n      gzipHandler.addIncludedMethods(GZIPPABLE_METHODS);\n      gzipHandler.setHandler(mockServiceContext);\n      gzipHandler.setVary(null);\n      handlers.add(gzipHandler);\n    } catch (Exception e) {\n      throwUnchecked(e);\n    }\n  }\n\n  private FilterHolder buildCorsFilter() {\n    FilterHolder filterHolder = new FilterHolder(CrossOriginFilter.class);\n    filterHolder.setInitParameters(\n        Map.of(\n            \"chainPreflight\",\n            \"false\",\n            \"allowedOrigins\",\n            \"*\",\n            \"allowedHeaders\",\n            \"*\",\n            \"allowedMethods\",\n            \"OPTIONS,GET,POST,PUT,PATCH,DELETE\"));\n    return filterHolder;\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/Jetty12HttpUtils.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport jakarta.servlet.ServletResponse;\nimport jakarta.servlet.http.HttpServletResponseWrapper;\nimport java.net.Socket;\nimport java.nio.channels.SocketChannel;\nimport org.eclipse.jetty.ee11.servlet.ServletApiResponse;\nimport org.eclipse.jetty.io.EndPoint;\nimport org.eclipse.jetty.io.SelectableChannelEndPoint;\nimport org.eclipse.jetty.io.ssl.SslConnection;\nimport org.eclipse.jetty.server.Response;\n\npublic class Jetty12HttpUtils implements JettyHttpUtils {\n  @Override\n  public Response unwrapResponse(ServletResponse httpServletResponse) {\n    if (httpServletResponse instanceof HttpServletResponseWrapper) {\n      ServletResponse unwrapped = ((HttpServletResponseWrapper) httpServletResponse).getResponse();\n      return unwrapResponse(unwrapped);\n    } else {\n      return unwrap(httpServletResponse);\n    }\n  }\n\n  private static Response unwrap(ServletResponse wrapped) {\n    if (wrapped instanceof Response) {\n      return (Response) wrapped;\n    } else if (wrapped instanceof ServletApiResponse) {\n      return ((ServletApiResponse) wrapped).getResponse();\n    } else {\n      throw new IllegalStateException(\n          \"Cannot unwrap a\" + Response.class.getName() + \" from a \" + wrapped.getClass().getName());\n    }\n  }\n\n  @Override\n  public Socket socket(Response response) {\n    SelectableChannelEndPoint ep = (SelectableChannelEndPoint) getEndpoint(response);\n    return ((SocketChannel) ep.getChannel()).socket();\n  }\n\n  @Override\n  public Socket tlsSocket(Response response) {\n    final SslConnection.SslEndPoint sslEndpoint = (SslConnection.SslEndPoint) getEndpoint(response);\n    final SelectableChannelEndPoint endpoint =\n        (SelectableChannelEndPoint) sslEndpoint.getSslConnection().getEndPoint();\n    return ((SocketChannel) endpoint.getChannel()).socket();\n  }\n\n  @Override\n  public EndPoint unwrapEndPoint(Response jettyResponse) {\n    return getEndpoint(jettyResponse);\n  }\n\n  private EndPoint getEndpoint(Response response) {\n    return response.getRequest().getConnectionMetaData().getConnection().getEndPoint();\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/JettyHttpServer.java",
    "content": "/*\n * Copyright (C) 2014-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockApp;\nimport com.github.tomakehurst.wiremock.http.AdminRequestHandler;\nimport com.github.tomakehurst.wiremock.http.HttpServer;\nimport com.github.tomakehurst.wiremock.http.StubRequestHandler;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.WiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.jetty.servlet.MultipartRequestConfigElementBuilder;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport java.io.IOException;\nimport java.net.Socket;\nimport java.nio.ByteBuffer;\nimport java.util.Optional;\nimport java.util.concurrent.ScheduledExecutorService;\nimport java.util.concurrent.TimeoutException;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport org.eclipse.jetty.io.EndPoint;\nimport org.eclipse.jetty.io.NetworkTrafficListener;\nimport org.eclipse.jetty.server.Handler;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.server.ServerConnector;\nimport org.eclipse.jetty.util.thread.ThreadPool;\n\npublic abstract class JettyHttpServer implements HttpServer {\n  private static final AtomicBoolean STRICT_HTTP_HEADERS_APPLIED = new AtomicBoolean(false);\n  private static final int MAX_RETRIES = 3;\n\n  protected static final String FILES_URL_MATCH = String.format(\"/%s/*\", WireMockApp.FILES_ROOT);\n  protected static final String[] GZIPPABLE_METHODS =\n      new String[] {\"POST\", \"PUT\", \"PATCH\", \"DELETE\"};\n\n  protected final Options options;\n  protected final JettySettings jettySettings;\n\n  protected final Server jettyServer;\n  protected final ServerConnector httpConnector;\n  protected final ServerConnector httpsConnector;\n  protected final MessageStubRequestHandler messageStubRequestHandler;\n\n  protected ScheduledExecutorService scheduledExecutorService;\n\n  public JettyHttpServer(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler,\n      JettySettings jettySettings,\n      ThreadPool threadPool,\n      MessageStubRequestHandler messageStubRequestHandler) {\n    this.options = options;\n    this.jettySettings = jettySettings;\n    this.messageStubRequestHandler = messageStubRequestHandler;\n\n    if (!options.getDisableStrictHttpHeaders()\n        && Boolean.FALSE.equals(STRICT_HTTP_HEADERS_APPLIED.get())) {\n      System.setProperty(\"org.eclipse.jetty.http.HttpGenerator.STRICT\", String.valueOf(true));\n      STRICT_HTTP_HEADERS_APPLIED.set(true);\n    }\n\n    jettyServer = createServer(threadPool);\n\n    NetworkTrafficListenerAdapter networkTrafficListenerAdapter =\n        new NetworkTrafficListenerAdapter(options.networkTrafficListener());\n\n    if (options.getHttpDisabled()) {\n      httpConnector = null;\n    } else {\n      httpConnector =\n          createHttpConnector(\n              options.bindAddress(),\n              options.portNumber(),\n              jettySettings,\n              networkTrafficListenerAdapter);\n      jettyServer.addConnector(httpConnector);\n    }\n\n    if (options.httpsSettings().enabled()) {\n      httpsConnector =\n          createHttpsConnector(\n              options.bindAddress(),\n              options.httpsSettings(),\n              jettySettings,\n              networkTrafficListenerAdapter);\n      jettyServer.addConnector(httpsConnector);\n    } else {\n      httpsConnector = null;\n    }\n\n    applyAdditionalServerConfiguration(jettyServer, options);\n\n    final Handler handlers = createHandler(options, adminRequestHandler, stubRequestHandler);\n    jettyServer.setHandler(handlers);\n\n    finalizeSetup();\n  }\n\n  protected void applyAdditionalServerConfiguration(Server jettyServer, Options options) {}\n\n  protected abstract Handler createHandler(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler);\n\n  protected void finalizeSetup() {\n    if (jettySettings.getStopTimeout().isEmpty()) {\n      jettyServer.setStopTimeout(1000);\n    }\n  }\n\n  protected Server createServer(ThreadPool threadPool) {\n    final Server server = new Server(threadPool);\n    final Optional<Long> stopTimeout = jettySettings.getStopTimeout();\n    stopTimeout.ifPresent(server::setStopTimeout);\n\n    return server;\n  }\n\n  /** Extend only this method if you want to add additional handlers to Jetty. */\n  public Handler[] extensionHandlers() {\n    return new Handler[] {};\n  }\n\n  @Override\n  public void start() {\n    int retryCount = 0;\n\n    while (retryCount < MAX_RETRIES) {\n      try {\n        jettyServer.start();\n        break;\n      } catch (IOException bindException) {\n        retryCount++;\n        if (retryCount >= MAX_RETRIES) {\n          throw new FatalStartupException(bindException);\n        }\n      } catch (Exception e) {\n        throw new RuntimeException(e);\n      }\n    }\n    long timeout = System.currentTimeMillis() + 30000;\n    while (!jettyServer.isStarted()) {\n      try {\n        Thread.sleep(100);\n      } catch (InterruptedException e) {\n        // no-op\n      }\n      if (System.currentTimeMillis() > timeout) {\n        throw new RuntimeException(\"Server took too long to start up.\");\n      }\n    }\n  }\n\n  @Override\n  public void stop() {\n    try {\n      if (scheduledExecutorService != null) {\n        scheduledExecutorService.shutdown();\n      }\n\n      if (httpConnector != null) {\n        httpConnector.getConnectedEndPoints().forEach(EndPoint::close);\n      }\n\n      if (httpsConnector != null) {\n        httpsConnector.getConnectedEndPoints().forEach(EndPoint::close);\n      }\n\n      jettyServer.stop();\n      jettyServer.join();\n    } catch (TimeoutException ignored) {\n    } catch (Exception e) {\n      throwUnchecked(e);\n    }\n  }\n\n  @Override\n  public boolean isRunning() {\n    return jettyServer.isRunning();\n  }\n\n  @Override\n  public int port() {\n    return httpConnector.getLocalPort();\n  }\n\n  @Override\n  public int httpsPort() {\n    return httpsConnector.getLocalPort();\n  }\n\n  public long stopTimeout() {\n    return jettyServer.getStopTimeout();\n  }\n\n  protected abstract ServerConnector createHttpConnector(\n      String bindAddress, int port, JettySettings jettySettings, NetworkTrafficListener listener);\n\n  protected abstract ServerConnector createHttpsConnector(\n      String bindAddress,\n      HttpsSettings httpsSettings,\n      JettySettings jettySettings,\n      NetworkTrafficListener listener);\n\n  // Override this for platform-specific impls\n  protected MultipartRequestConfigElementBuilder buildMultipartRequestConfigurer() {\n    return new DefaultMultipartRequestConfigElementBuilder();\n  }\n\n  private static class NetworkTrafficListenerAdapter implements NetworkTrafficListener {\n    private final WiremockNetworkTrafficListener wiremockNetworkTrafficListener;\n\n    NetworkTrafficListenerAdapter(WiremockNetworkTrafficListener wiremockNetworkTrafficListener) {\n      this.wiremockNetworkTrafficListener = wiremockNetworkTrafficListener;\n    }\n\n    @Override\n    public void opened(Socket socket) {\n      wiremockNetworkTrafficListener.opened(socket);\n    }\n\n    @Override\n    public void incoming(Socket socket, ByteBuffer bytes) {\n      wiremockNetworkTrafficListener.incoming(socket, bytes);\n    }\n\n    @Override\n    public void outgoing(Socket socket, ByteBuffer bytes) {\n      wiremockNetworkTrafficListener.outgoing(socket, bytes);\n    }\n\n    @Override\n    public void closed(Socket socket) {\n      wiremockNetworkTrafficListener.closed(socket);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/JettyHttpServerFactory.java",
    "content": "/*\n * Copyright (C) 2014-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport org.eclipse.jetty.util.thread.QueuedThreadPool;\n\npublic class JettyHttpServerFactory implements HttpServerFactory, DefaultFactory {\n\n  private final JettySettings settings;\n\n  public JettyHttpServerFactory() {\n    this(JettySettings.Builder.aJettySettings().build());\n  }\n\n  public JettyHttpServerFactory(JettySettings settings) {\n    this.settings = settings;\n  }\n\n  public JettySettings getSettings() {\n    return settings;\n  }\n\n  @Override\n  public HttpServer buildHttpServer(\n      Options options,\n      AdminRequestHandler adminRequestHandler,\n      StubRequestHandler stubRequestHandler,\n      MessageStubRequestHandler messageStubRequestHandler) {\n    return new Jetty12HttpServer(\n        options,\n        adminRequestHandler,\n        stubRequestHandler,\n        settings,\n        new QueuedThreadPool(options.containerThreads()),\n        messageStubRequestHandler);\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/JettyHttpUtils.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport jakarta.servlet.ServletResponse;\nimport jakarta.servlet.http.HttpServletResponse;\nimport java.net.Socket;\nimport org.eclipse.jetty.io.EndPoint;\nimport org.eclipse.jetty.server.Response;\n\n/** Helper utility interface to inject Jetty 11/12/... specific response / request handling */\npublic interface JettyHttpUtils {\n  boolean IS_JETTY = isClassExist(\"org.eclipse.jetty.server.Request\");\n\n  static boolean isJetty() {\n    return IS_JETTY;\n  }\n\n  private static boolean isClassExist(String type) {\n    try {\n      ClassLoader contextCL = Thread.currentThread().getContextClassLoader();\n      ClassLoader loader = contextCL == null ? JettyHttpUtils.class.getClassLoader() : contextCL;\n      Class.forName(type, false, loader);\n      return true;\n    } catch (Exception e) {\n      return false;\n    }\n  }\n\n  /**\n   * Unwraps Jetty's {@link Response} out of the {@link HttpServletResponse}\n   *\n   * @param httpServletResponse {@link HttpServletResponse} instance\n   * @return unwrapped {@link Response} instance\n   */\n  Response unwrapResponse(ServletResponse httpServletResponse);\n\n  /**\n   * Extracts the raw network socket of out Jetty's {@link Response}\n   *\n   * @param response {@link Response} instance\n   * @return raw network socket\n   */\n  Socket socket(Response response);\n\n  /**\n   * Extracts the raw network TLS socket of out Jetty's {@link Response}\n   *\n   * @param response {@link Response} instance\n   * @return raw network TLS socket\n   */\n  Socket tlsSocket(Response response);\n\n  /**\n   * Unwraps Jetty's {@link EndPoint} out of the {@link Response}\n   *\n   * @param response {@link Response} instance\n   * @return unwrapped {@link EndPoint} instance\n   */\n  EndPoint unwrapEndPoint(Response response);\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/JettySettings.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport java.util.Optional;\n\n/**\n * Exposed Jetty tuning options. See: <a\n * href=\"https://www.eclipse.org/jetty/javadoc/jetty-11/org/eclipse/jetty/server/AbstractConnector.html\">AbstractConnector</a>\n */\npublic class JettySettings {\n  private final Integer acceptors;\n  private final Integer acceptQueueSize;\n  private final Integer requestHeaderSize;\n  private final Integer responseHeaderSize;\n  private final Long stopTimeout;\n  private final Long idleTimeout;\n  private final Long shutdownIdleTimeout;\n\n  private JettySettings(\n      Integer acceptors,\n      Integer acceptQueueSize,\n      Integer requestHeaderSize,\n      Integer responseHeaderSize,\n      Long stopTimeout,\n      Long idleTimeout,\n      Long shutdownIdleTimeout) {\n    this.acceptors = acceptors;\n    this.acceptQueueSize = acceptQueueSize;\n    this.requestHeaderSize = requestHeaderSize;\n    this.responseHeaderSize = responseHeaderSize;\n    this.stopTimeout = stopTimeout;\n    this.idleTimeout = idleTimeout;\n    this.shutdownIdleTimeout = shutdownIdleTimeout;\n  }\n\n  public Optional<Integer> getAcceptors() {\n    return Optional.ofNullable(acceptors);\n  }\n\n  public Optional<Integer> getAcceptQueueSize() {\n    return Optional.ofNullable(acceptQueueSize);\n  }\n\n  public Optional<Integer> getRequestHeaderSize() {\n    return Optional.ofNullable(requestHeaderSize);\n  }\n\n  public Optional<Integer> getResponseHeaderSize() {\n    return Optional.ofNullable(responseHeaderSize);\n  }\n\n  public Optional<Long> getStopTimeout() {\n    return Optional.ofNullable(stopTimeout);\n  }\n\n  public Optional<Long> getIdleTimeout() {\n    return Optional.ofNullable(idleTimeout);\n  }\n\n  public Optional<Long> getShutdownIdleTimeout() {\n    return Optional.ofNullable(shutdownIdleTimeout);\n  }\n\n  @Override\n  public String toString() {\n    return \"JettySettings{\"\n        + \"acceptors=\"\n        + acceptors\n        + \", acceptQueueSize=\"\n        + acceptQueueSize\n        + \", requestHeaderSize=\"\n        + requestHeaderSize\n        + \", responseHeaderSize=\"\n        + responseHeaderSize\n        + \", stopTimeout=\"\n        + stopTimeout\n        + \", idleTimeout=\"\n        + idleTimeout\n        + \", shutdownIdleTimeout=\"\n        + shutdownIdleTimeout\n        + '}';\n  }\n\n  public static class Builder {\n    private Integer acceptors;\n    private Integer acceptQueueSize;\n    private Integer requestHeaderSize;\n    private Integer responseHeaderSize;\n    private Long stopTimeout;\n    private Long idleTimeout;\n    private Long shutdownIdleTimeout;\n\n    private Builder() {}\n\n    public static Builder aJettySettings() {\n      return new Builder();\n    }\n\n    public Builder withAcceptors(Integer acceptors) {\n      this.acceptors = acceptors;\n      return this;\n    }\n\n    public Builder withAcceptQueueSize(Integer acceptQueueSize) {\n      this.acceptQueueSize = acceptQueueSize;\n      return this;\n    }\n\n    public Builder withRequestHeaderSize(Integer requestHeaderSize) {\n      this.requestHeaderSize = requestHeaderSize;\n      return this;\n    }\n\n    public Builder withResponseHeaderSize(Integer responseHeaderSize) {\n      this.responseHeaderSize = responseHeaderSize;\n      return this;\n    }\n\n    public Builder withStopTimeout(Long stopTimeout) {\n      this.stopTimeout = stopTimeout;\n      return this;\n    }\n\n    public Builder withIdleTimeout(Long idleTimeout) {\n      this.idleTimeout = idleTimeout;\n      return this;\n    }\n\n    public Builder withShutdownIdleTimeout(Long shutdownIdleTimeout) {\n      this.shutdownIdleTimeout = shutdownIdleTimeout;\n      return this;\n    }\n\n    public JettySettings build() {\n      return new JettySettings(\n          acceptors,\n          acceptQueueSize,\n          requestHeaderSize,\n          responseHeaderSize,\n          stopTimeout,\n          idleTimeout,\n          shutdownIdleTimeout);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/JettyUtils.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static org.eclipse.jetty.http.UriCompliance.UNSAFE;\n\nimport org.eclipse.jetty.io.NetworkTrafficListener;\nimport org.eclipse.jetty.server.*;\n\npublic class JettyUtils {\n\n  private JettyUtils() {}\n\n  private static final int DEFAULT_ACCEPTORS = 3;\n  private static final int DEFAULT_HEADER_SIZE = 32768;\n\n  public static ServerConnector createServerConnector(\n      Server jettyServer,\n      String bindAddress,\n      JettySettings jettySettings,\n      int port,\n      NetworkTrafficListener listener,\n      ConnectionFactory... connectionFactories) {\n\n    int acceptors = jettySettings.getAcceptors().orElse(DEFAULT_ACCEPTORS);\n\n    NetworkTrafficServerConnector connector =\n        new NetworkTrafficServerConnector(\n            jettyServer, null, null, null, acceptors, 2, connectionFactories);\n\n    connector.setPort(port);\n    connector.setNetworkTrafficListener(listener);\n    setJettySettings(jettySettings, connector);\n    connector.setHost(bindAddress);\n    return connector;\n  }\n\n  public static void setJettySettings(JettySettings jettySettings, ServerConnector connector) {\n    jettySettings.getAcceptQueueSize().ifPresent(connector::setAcceptQueueSize);\n    jettySettings.getIdleTimeout().ifPresent(connector::setIdleTimeout);\n    connector.setShutdownIdleTimeout(jettySettings.getShutdownIdleTimeout().orElse(200L));\n  }\n\n  public static HttpConfiguration createHttpConfig(JettySettings jettySettings) {\n    HttpConfiguration httpConfig = new HttpConfiguration();\n    httpConfig.setRequestHeaderSize(\n        jettySettings.getRequestHeaderSize().orElse(DEFAULT_HEADER_SIZE));\n    httpConfig.setResponseHeaderSize(\n        jettySettings.getResponseHeaderSize().orElse(DEFAULT_HEADER_SIZE));\n    httpConfig.setSendDateHeader(false);\n    httpConfig.setSendXPoweredBy(false);\n    httpConfig.setSendServerVersion(false);\n    httpConfig.addCustomizer(new SecureRequestCustomizer(false));\n    httpConfig.setUriCompliance(UNSAFE);\n    return httpConfig;\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/NotFoundHandler.java",
    "content": "/*\n * Copyright (C) 2017-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport jakarta.servlet.ServletException;\nimport org.eclipse.jetty.ee11.servlet.Dispatcher;\nimport org.eclipse.jetty.ee11.servlet.ServletContextHandler;\nimport org.eclipse.jetty.ee11.servlet.ServletContextRequest;\nimport org.eclipse.jetty.ee11.servlet.ServletContextResponse;\nimport org.eclipse.jetty.server.Request;\nimport org.eclipse.jetty.server.Response;\nimport org.eclipse.jetty.server.handler.ErrorHandler;\nimport org.eclipse.jetty.util.Callback;\n\npublic class NotFoundHandler extends ErrorHandler {\n\n  private final ErrorHandler DEFAULT_HANDLER = new ErrorHandler();\n\n  private final ServletContextHandler adminServiceHandler;\n\n  public NotFoundHandler(ServletContextHandler adminServiceHandler) {\n    this.adminServiceHandler = adminServiceHandler;\n  }\n\n  @Override\n  public boolean errorPageForMethod(String method) {\n    return true;\n  }\n\n  @Override\n  public boolean handle(Request request, Response response, Callback callback) throws Exception {\n    if (response.getStatus() == 404) {\n\n      // Jetty 12 does not currently support cross context dispatch\n      Dispatcher requestDispatcher =\n          (Dispatcher) adminServiceHandler.getServletContext().getRequestDispatcher(\"/not-matched\");\n\n      try {\n        requestDispatcher.error(\n            ((ServletContextRequest) request).getServletApiRequest(),\n            ((ServletContextResponse) response).getServletApiResponse());\n        callback.succeeded();\n        return true;\n      } catch (ServletException e) {\n        callback.failed(e);\n      }\n    } else {\n      try {\n        return DEFAULT_HANDLER.handle(request, response, callback);\n      } catch (Exception e) {\n        callback.failed(e);\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/WireMockHandlerDispatchingServlet.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_LENGTH;\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.core.Options.ChunkedEncodingPolicy.BODY_FILE;\nimport static com.github.tomakehurst.wiremock.core.Options.ChunkedEncodingPolicy.NEVER;\nimport static com.github.tomakehurst.wiremock.http.RequestMethod.GET;\nimport static com.github.tomakehurst.wiremock.jetty.WireMockHttpServletRequestAdapter.ORIGINAL_REQUEST_KEY;\nimport static com.github.tomakehurst.wiremock.stubbing.ServeEvent.ORIGINAL_SERVE_EVENT_KEY;\nimport static java.net.HttpURLConnection.HTTP_NOT_FOUND;\nimport static java.net.URLDecoder.decode;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static java.util.concurrent.TimeUnit.MILLISECONDS;\n\nimport com.github.tomakehurst.wiremock.common.LocalNotifier;\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport com.github.tomakehurst.wiremock.core.FaultInjector;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockApp;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.jetty.servlet.FaultInjectorFactory;\nimport com.github.tomakehurst.wiremock.jetty.servlet.NoFaultInjectorFactory;\nimport com.github.tomakehurst.wiremock.servlet.BodyChunker;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.LoggedRequest;\nimport jakarta.servlet.*;\nimport jakarta.servlet.http.HttpServlet;\nimport jakarta.servlet.http.HttpServletRequest;\nimport jakarta.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.concurrent.ScheduledExecutorService;\n\npublic class WireMockHandlerDispatchingServlet extends HttpServlet {\n\n  public static final String SHOULD_FORWARD_TO_FILES_CONTEXT = \"shouldForwardToFilesContext\";\n  public static final String ASYNCHRONOUS_RESPONSE_EXECUTOR =\n      WireMockHandlerDispatchingServlet.class.getSimpleName() + \".asynchronousResponseExecutor\";\n  public static final String MAPPED_UNDER_KEY = \"mappedUnder\";\n\n  private static final long serialVersionUID = -6602042274260495538L;\n\n  private ScheduledExecutorService scheduledExecutorService;\n\n  private RequestHandler requestHandler;\n  private FaultInjectorFactory faultHandlerFactory;\n  private String mappedUnder;\n  private Notifier notifier;\n  private String wiremockFileSourceRoot = \"/\";\n  private boolean shouldForwardToFilesContext;\n  private Options.ChunkedEncodingPolicy chunkedEncodingPolicy;\n  private boolean browserProxyingEnabled;\n\n  @Override\n  public void init(ServletConfig config) {\n    ServletContext context = config.getServletContext();\n    shouldForwardToFilesContext = getFileContextForwardingFlagFrom(config);\n\n    if (context.getInitParameter(\"WireMockFileSourceRoot\") != null) {\n      wiremockFileSourceRoot = context.getInitParameter(\"WireMockFileSourceRoot\");\n    }\n\n    scheduledExecutorService =\n        (ScheduledExecutorService) context.getAttribute(ASYNCHRONOUS_RESPONSE_EXECUTOR);\n\n    String handlerClassName = config.getInitParameter(RequestHandler.HANDLER_CLASS_KEY);\n    String faultInjectorFactoryClassName =\n        config.getInitParameter(FaultInjectorFactory.INJECTOR_CLASS_KEY);\n    mappedUnder = getNormalizedMappedUnder(config);\n    context.log(\n        RequestHandler.HANDLER_CLASS_KEY\n            + \" from context returned \"\n            + handlerClassName\n            + \". Normalized mapped under returned '\"\n            + mappedUnder\n            + \"'\");\n    requestHandler = (RequestHandler) context.getAttribute(handlerClassName);\n\n    faultHandlerFactory =\n        faultInjectorFactoryClassName != null\n            ? (FaultInjectorFactory) context.getAttribute(faultInjectorFactoryClassName)\n            : new NoFaultInjectorFactory();\n\n    notifier = (Notifier) context.getAttribute(Notifier.KEY);\n\n    Object chunkedEncodingPolicyAttr =\n        context.getAttribute(Options.ChunkedEncodingPolicy.class.getName());\n    chunkedEncodingPolicy =\n        chunkedEncodingPolicyAttr != null\n            ? (Options.ChunkedEncodingPolicy) chunkedEncodingPolicyAttr\n            : Options.ChunkedEncodingPolicy.ALWAYS;\n\n    browserProxyingEnabled =\n        Boolean.parseBoolean(\n            getFirstNonNull(context.getAttribute(\"browserProxyingEnabled\"), \"false\").toString());\n  }\n\n  private String getNormalizedMappedUnder(ServletConfig config) {\n    String mappedUnder = config.getInitParameter(MAPPED_UNDER_KEY);\n    if (mappedUnder == null) {\n      return null;\n    }\n    if (mappedUnder.endsWith(\"/\")) {\n      mappedUnder = mappedUnder.substring(0, mappedUnder.length() - 1);\n    }\n    return mappedUnder;\n  }\n\n  private boolean getFileContextForwardingFlagFrom(ServletConfig config) {\n    String flagValue = config.getInitParameter(SHOULD_FORWARD_TO_FILES_CONTEXT);\n    return Boolean.parseBoolean(flagValue);\n  }\n\n  @Override\n  protected void service(\n      HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)\n      throws ServletException, IOException {\n    LocalNotifier.set(notifier);\n\n    // TODO: The HTTP/1.x CONNECT is also forwarded to the servlet now. To keep backward\n    // compatible behavior (with proxy involved), skipping the CONNECT handling altogether.\n    if (Objects.equals(httpServletRequest.getMethod(), \"CONNECT\")) {\n      return;\n    }\n\n    Request request =\n        new WireMockHttpServletRequestAdapter(\n            httpServletRequest, mappedUnder, browserProxyingEnabled);\n\n    ServletHttpResponder responder =\n        new ServletHttpResponder(httpServletRequest, httpServletResponse);\n\n    final ServeEvent originalServeEvent =\n        httpServletRequest.getAttribute(ORIGINAL_SERVE_EVENT_KEY) != null\n            ? (ServeEvent) httpServletRequest.getAttribute(ORIGINAL_SERVE_EVENT_KEY)\n            : null;\n\n    requestHandler.handle(request, responder, originalServeEvent);\n  }\n\n  private class ServletHttpResponder implements HttpResponder {\n\n    private final HttpServletRequest httpServletRequest;\n    private final HttpServletResponse httpServletResponse;\n\n    public ServletHttpResponder(\n        HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {\n      this.httpServletRequest = httpServletRequest;\n      this.httpServletResponse = httpServletResponse;\n    }\n\n    @Override\n    public void respond(\n        final Request request, final Response response, Map<String, Object> attributes) {\n      if (Thread.currentThread().isInterrupted()) {\n        return;\n      }\n\n      httpServletRequest.setAttribute(ORIGINAL_REQUEST_KEY, LoggedRequest.createFrom(request));\n      attributes.forEach(httpServletRequest::setAttribute);\n\n      if (isAsyncSupportedAndDelayConfigured(response, httpServletRequest)) {\n        respondAsync(request, response);\n      } else {\n        respondSync(request, response);\n      }\n    }\n\n    private void respondSync(Request request, Response response) {\n      delayIfRequired(response.getInitialDelay());\n      respondTo(request, response);\n    }\n\n    private void delayIfRequired(long delayMillis) {\n      try {\n        MILLISECONDS.sleep(delayMillis);\n      } catch (InterruptedException e) {\n        Thread.currentThread().interrupt();\n      }\n    }\n\n    private boolean isAsyncSupportedAndDelayConfigured(\n        Response response, HttpServletRequest httpServletRequest) {\n      if (scheduledExecutorService == null || !httpServletRequest.isAsyncSupported()) {\n        return false;\n      }\n\n      return response.getInitialDelay() > 0 || response.shouldAddChunkedDribbleDelay();\n    }\n\n    private void respondAsync(final Request request, final Response response) {\n      final AsyncContext asyncContext = httpServletRequest.startAsync();\n      scheduledExecutorService.schedule(\n          () -> {\n            try {\n              respondTo(request, response);\n            } finally {\n              asyncContext.complete();\n            }\n          },\n          response.getInitialDelay(),\n          MILLISECONDS);\n    }\n\n    private void respondTo(Request request, Response response) {\n      try {\n        if (response.wasConfigured()) {\n          applyResponse(response, httpServletRequest, httpServletResponse);\n        } else if (request.getMethod().equals(GET) && shouldForwardToFilesContext) {\n          forwardToFilesContext(httpServletRequest, httpServletResponse, request);\n        } else {\n          httpServletResponse.sendError(HTTP_NOT_FOUND);\n        }\n      } catch (Exception e) {\n        throwUnchecked(e);\n      }\n    }\n  }\n\n  public void applyResponse(\n      Response response,\n      HttpServletRequest httpServletRequest,\n      HttpServletResponse httpServletResponse) {\n    Fault fault = response.getFault();\n    if (fault != null) {\n      FaultInjector faultInjector = buildFaultInjector(httpServletRequest, httpServletResponse);\n      fault.apply(faultInjector);\n      httpServletResponse.addHeader(Fault.class.getName(), fault.name());\n      return;\n    }\n\n    httpServletResponse.setStatus(response.getStatus());\n\n    for (HttpHeader header : response.getHeaders().all()) {\n      for (String value : header.values()) {\n        httpServletResponse.addHeader(header.key(), value);\n      }\n    }\n\n    if ((chunkedEncodingPolicy == NEVER\n            || (chunkedEncodingPolicy == BODY_FILE && response.hasInlineBody()))\n        && httpServletResponse.getHeader(CONTENT_LENGTH) == null) {\n      httpServletResponse.setContentLength(response.getBody().length);\n    }\n\n    if (response.shouldAddChunkedDribbleDelay()) {\n      writeAndTranslateExceptionsWithChunkedDribbleDelay(\n          httpServletResponse, response.getBodyStream(), response.getChunkedDribbleDelay());\n    } else {\n      writeAndTranslateExceptions(httpServletResponse, response.getBodyStream());\n    }\n  }\n\n  private FaultInjector buildFaultInjector(\n      HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {\n    return faultHandlerFactory.buildFaultInjector(httpServletRequest, httpServletResponse);\n  }\n\n  private static void writeAndTranslateExceptions(\n      HttpServletResponse httpServletResponse, InputStream content) {\n    try (ServletOutputStream out = httpServletResponse.getOutputStream()) {\n      content.transferTo(out);\n      out.flush();\n    } catch (IOException e) {\n      throwUnchecked(e);\n    } finally {\n      try {\n        content.close();\n      } catch (IOException e) {\n        // well, we tried\n      }\n    }\n  }\n\n  private void writeAndTranslateExceptionsWithChunkedDribbleDelay(\n      HttpServletResponse httpServletResponse,\n      InputStream bodyStream,\n      ChunkedDribbleDelay chunkedDribbleDelay) {\n    try (ServletOutputStream out = httpServletResponse.getOutputStream()) {\n      byte[] body = bodyStream.readAllBytes();\n\n      if (body.length < 1) {\n        notifier.error(\"Cannot chunk dribble delay when no body set\");\n        out.flush();\n        return;\n      }\n\n      byte[][] chunkedBody = BodyChunker.chunkBody(body, chunkedDribbleDelay.getNumberOfChunks());\n\n      int chunkInterval = chunkedDribbleDelay.getTotalDuration() / chunkedBody.length;\n\n      for (byte[] bodyChunk : chunkedBody) {\n        Thread.sleep(chunkInterval);\n        out.write(bodyChunk);\n        out.flush();\n      }\n\n    } catch (IOException e) {\n      throwUnchecked(e);\n    } catch (InterruptedException ignored) {\n      // Ignore the interrupt quietly since it's probably the client timing out, which is a\n      // completely valid outcome\n    }\n  }\n\n  private void forwardToFilesContext(\n      HttpServletRequest httpServletRequest,\n      HttpServletResponse httpServletResponse,\n      Request request)\n      throws ServletException, IOException {\n    String forwardUrl =\n        wiremockFileSourceRoot + WireMockApp.FILES_ROOT + request.getPathAndQueryWithoutPrefix();\n    RequestDispatcher dispatcher =\n        httpServletRequest.getRequestDispatcher(decode(forwardUrl, UTF_8));\n    dispatcher.forward(httpServletRequest, httpServletResponse);\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/WireMockHttpServletRequestAdapter.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty;\n\nimport static com.github.tomakehurst.wiremock.common.Encoding.encodeBase64;\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\nimport static com.github.tomakehurst.wiremock.common.Strings.isNullOrEmpty;\nimport static com.github.tomakehurst.wiremock.common.Strings.stringFromBytes;\nimport static com.github.tomakehurst.wiremock.jetty.proxy.HttpProxyDetectingHandler.IS_HTTP_PROXY_REQUEST_ATTRIBUTE;\nimport static com.github.tomakehurst.wiremock.jetty.proxy.HttpsProxyDetectingHandler.IS_HTTPS_PROXY_REQUEST_ATTRIBUTE;\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static java.util.Collections.list;\n\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport com.github.tomakehurst.wiremock.common.Gzip;\nimport com.github.tomakehurst.wiremock.common.Lazy;\nimport com.github.tomakehurst.wiremock.http.*;\nimport com.github.tomakehurst.wiremock.http.multipart.PartParser;\nimport com.google.common.collect.ImmutableMultimap;\nimport com.google.common.collect.Maps;\nimport jakarta.servlet.http.HttpServletRequest;\nimport java.net.URLDecoder;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\nimport java.util.*;\nimport java.util.stream.Collectors;\nimport org.eclipse.jetty.util.MultiMap;\nimport org.eclipse.jetty.util.UrlEncoded;\nimport org.jspecify.annotations.NonNull;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.PathAndQuery;\n\npublic class WireMockHttpServletRequestAdapter implements Request {\n\n  public static final String ORIGINAL_REQUEST_KEY = \"wiremock.ORIGINAL_REQUEST\";\n\n  private final HttpServletRequest request;\n  private final Lazy<@NonNull String> url;\n  private final Lazy<@NonNull PathAndQuery> pathAndQuery;\n  private final Lazy<@NonNull String> absoluteUrl;\n  private final Lazy<@NonNull AbsoluteUrl> typedAbsoluteUrl;\n  private final Lazy<byte[]> body;\n  private final Lazy<Map<String, Cookie>> cookies;\n  private final Lazy<Map<String, FormParameter>> formParameters;\n  private final Lazy<Collection<Part>> multiParts;\n  private final Lazy<HttpHeaders> headers;\n\n  private final boolean browserProxyingEnabled;\n  private final String urlPrefixToRemove;\n\n  public WireMockHttpServletRequestAdapter(\n      HttpServletRequest request, String urlPrefixToRemove, boolean browserProxyingEnabled) {\n    this.request = request;\n    this.urlPrefixToRemove = urlPrefixToRemove;\n    this.browserProxyingEnabled = browserProxyingEnabled;\n\n    this.url = Lazy.lazy(this::adaptUrl);\n    this.pathAndQuery = Lazy.lazy(this::adaptPathAndQuery);\n    this.absoluteUrl = Lazy.lazy(this::adaptAbsoluteUrl);\n    this.typedAbsoluteUrl = Lazy.lazy(this::adaptTypedAbsoluteUrl);\n    this.headers = Lazy.lazy(this::adaptHeaders);\n    this.cookies = Lazy.lazy(this::adaptCookies);\n    this.body = Lazy.lazy(this::adaptBody);\n    this.formParameters = Lazy.lazy(() -> adaptFormParameters(request));\n    this.multiParts = Lazy.lazy(this::adaptParts);\n  }\n\n  @Override\n  public @NonNull String getUrl() {\n    return url.get();\n  }\n\n  private @NonNull String adaptUrl() {\n    String url = request.getRequestURI();\n\n    String contextPath = request.getContextPath();\n    if (!isNullOrEmpty(contextPath) && url.startsWith(contextPath)) {\n      url = url.substring(contextPath.length());\n    }\n    if (!isNullOrEmpty(urlPrefixToRemove) && url.startsWith(urlPrefixToRemove)) {\n      url = url.substring(urlPrefixToRemove.length());\n    }\n\n    return withQueryStringIfPresent(url);\n  }\n\n  @Override\n  public @NonNull PathAndQuery getPathAndQueryWithoutPrefix() {\n    return pathAndQuery.get();\n  }\n\n  private @NonNull PathAndQuery adaptPathAndQuery() {\n    return PathAndQuery.parse(getUrl());\n  }\n\n  @Override\n  public @NonNull String getAbsoluteUrl() {\n    return absoluteUrl.get();\n  }\n\n  private @NonNull String adaptAbsoluteUrl() {\n    return withQueryStringIfPresent(request.getRequestURL().toString());\n  }\n\n  @Override\n  public @NonNull AbsoluteUrl getTypedAbsoluteUrl() {\n    return typedAbsoluteUrl.get();\n  }\n\n  private @NonNull AbsoluteUrl adaptTypedAbsoluteUrl() {\n    return AbsoluteUrl.parse(getAbsoluteUrl());\n  }\n\n  private String withQueryStringIfPresent(String url) {\n    return url + (isNullOrEmpty(request.getQueryString()) ? \"\" : \"?\" + request.getQueryString());\n  }\n\n  @Override\n  public RequestMethod getMethod() {\n    return RequestMethod.fromString(request.getMethod().toUpperCase());\n  }\n\n  @Override\n  public String getScheme() {\n    return request.getScheme();\n  }\n\n  @Override\n  public String getHost() {\n    return request.getServerName();\n  }\n\n  @Override\n  public int getPort() {\n    return request.getServerPort();\n  }\n\n  @Override\n  public String getClientIp() {\n    String forwardedForHeader = this.getHeader(\"X-Forwarded-For\");\n\n    if (forwardedForHeader != null && !forwardedForHeader.isEmpty()) {\n      return forwardedForHeader;\n    }\n\n    return request.getRemoteAddr();\n  }\n\n  @Override\n  public byte[] getBody() {\n    return body.get();\n  }\n\n  private byte[] adaptBody() {\n    byte[] body = Exceptions.uncheck(() -> request.getInputStream().readAllBytes(), byte[].class);\n    boolean isGzipped = hasGzipEncoding() || Gzip.isGzipped(body);\n    return isGzipped ? Gzip.unGzip(body) : body;\n  }\n\n  private Charset encodingFromContentTypeHeaderOrUtf8() {\n    ContentTypeHeader contentTypeHeader = contentTypeHeader();\n    if (contentTypeHeader != null) {\n      return contentTypeHeader.charset();\n    }\n    return UTF_8;\n  }\n\n  private boolean hasGzipEncoding() {\n    String encodingHeader = request.getHeader(\"Content-Encoding\");\n    return encodingHeader != null && encodingHeader.contains(\"gzip\");\n  }\n\n  @Override\n  public String getBodyAsString() {\n    return stringFromBytes(getBody(), encodingFromContentTypeHeaderOrUtf8());\n  }\n\n  @Override\n  public String getBodyAsBase64() {\n    return encodeBase64(getBody());\n  }\n\n  @Override\n  public String getHeader(String key) {\n    return request.getHeader(key); // case-insensitive per javadoc\n  }\n\n  @Override\n  public HttpHeader header(String key) {\n    if (request.getHeader(key) == null) {\n      return HttpHeader.absent(key);\n    } else {\n      List<String> valueList = list(request.getHeaders(key));\n      if (valueList.isEmpty()) {\n        return HttpHeader.empty(key);\n      }\n\n      return new HttpHeader(key, valueList);\n    }\n  }\n\n  @Override\n  public ContentTypeHeader contentTypeHeader() {\n    String firstValue = getHeader(ContentTypeHeader.KEY);\n    return firstValue == null ? ContentTypeHeader.absent() : new ContentTypeHeader(firstValue);\n  }\n\n  @Override\n  public boolean containsHeader(String key) {\n    return header(key).isPresent();\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    return headers.get();\n  }\n\n  private HttpHeaders adaptHeaders() {\n    if (request instanceof org.eclipse.jetty.server.Request) {\n      return getHeadersLinear((org.eclipse.jetty.server.Request) request);\n    } else {\n      return getHeadersQuadratic();\n    }\n  }\n\n  private static HttpHeaders getHeadersLinear(org.eclipse.jetty.server.Request request) {\n    List<HttpHeader> headers =\n        request.getHeaders().stream()\n            .map(field -> HttpHeader.httpHeader(field.getName(), field.getValue()))\n            .collect(Collectors.toList());\n    return new HttpHeaders(headers);\n  }\n\n  private HttpHeaders getHeadersQuadratic() {\n    List<HttpHeader> headerList = new ArrayList<>();\n    for (String key : getAllHeaderKeys()) {\n      headerList.add(header(key));\n    }\n\n    return new HttpHeaders(headerList);\n  }\n\n  @Override\n  public Set<String> getAllHeaderKeys() {\n    LinkedHashSet<String> headerKeys = new LinkedHashSet<>();\n    for (Enumeration<String> headerNames = request.getHeaderNames();\n        headerNames.hasMoreElements(); ) {\n      headerKeys.add(headerNames.nextElement());\n    }\n\n    return headerKeys;\n  }\n\n  @Override\n  public Map<String, Cookie> getCookies() {\n    return cookies.get();\n  }\n\n  private Map<String, Cookie> adaptCookies() {\n    ImmutableMultimap.Builder<String, String> builder = ImmutableMultimap.builder();\n\n    jakarta.servlet.http.Cookie[] cookies =\n        getFirstNonNull(request.getCookies(), new jakarta.servlet.http.Cookie[0]);\n    for (jakarta.servlet.http.Cookie cookie : cookies) {\n      builder.put(cookie.getName(), URLDecoder.decode(cookie.getValue(), StandardCharsets.UTF_8));\n    }\n\n    return Maps.transformValues(\n        builder.build().asMap(), input -> new Cookie(null, List.copyOf(input)));\n  }\n\n  @Override\n  public FormParameter formParameter(String key) {\n    return getFirstNonNull(formParameters().get(key), FormParameter.absent(key));\n  }\n\n  @Override\n  public Map<String, FormParameter> formParameters() {\n    return formParameters.get();\n  }\n\n  @Override\n  public boolean isBrowserProxyRequest() {\n    // Avoid the performance hit if browser proxying is disabled\n    if (!browserProxyingEnabled) {\n      return false;\n    }\n\n    return Boolean.TRUE.equals(request.getAttribute(IS_HTTPS_PROXY_REQUEST_ATTRIBUTE))\n        || Boolean.TRUE.equals(request.getAttribute(IS_HTTP_PROXY_REQUEST_ATTRIBUTE));\n  }\n\n  @Override\n  public Collection<Part> getParts() {\n    return multiParts.get();\n  }\n\n  private Collection<Part> adaptParts() {\n    if (!isMultipart()) {\n      return null;\n    }\n\n    Collection<Part> multiParts = PartParser.parseFrom(this);\n\n    return (multiParts.isEmpty()) ? null : multiParts;\n  }\n\n  @Override\n  public boolean isMultipart() {\n    String header = getHeader(\"Content-Type\");\n    return (header != null && header.matches(\"(?i)^\\\\s*multipart/.*\"));\n  }\n\n  @Override\n  public Part getPart(final String name) {\n    if (isNullOrEmpty(name) || (getParts() == null)) {\n      return null;\n    }\n\n    return getParts().stream().filter(part -> name.equals(part.getName())).findFirst().orElse(null);\n  }\n\n  @Override\n  public Optional<Request> getOriginalRequest() {\n    Request originalRequest = (Request) request.getAttribute(ORIGINAL_REQUEST_KEY);\n    return Optional.ofNullable(originalRequest);\n  }\n\n  @Override\n  public String toString() {\n    return request.toString() + getBodyAsString();\n  }\n\n  @Override\n  public String getProtocol() {\n    return request.getProtocol();\n  }\n\n  private Map<String, FormParameter> adaptFormParameters(HttpServletRequest request) {\n\n    final String contentType = request.getContentType();\n    if (contentType == null || !contentType.contains(\"application/x-www-form-urlencoded\")) {\n      return Collections.emptyMap();\n    }\n\n    final MultiMap<String> formParameterMultimap = new MultiMap<>();\n    final String characterEncoding = request.getCharacterEncoding();\n    final Charset charset =\n        characterEncoding != null ? Charset.forName(characterEncoding) : Charset.defaultCharset();\n    try {\n      UrlEncoded.decodeTo(getBodyAsString(), formParameterMultimap, charset);\n    } catch (IllegalArgumentException ignored) {\n      return Collections.emptyMap();\n    }\n    return formParameterMultimap.entrySet().stream()\n        .collect(\n            Collectors.toMap(\n                Map.Entry::getKey, entry -> new FormParameter(entry.getKey(), entry.getValue())));\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/faults/JettyFaultInjector.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.faults;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.github.tomakehurst.wiremock.core.FaultInjector;\nimport com.github.tomakehurst.wiremock.jetty.JettyHttpUtils;\nimport jakarta.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.net.Socket;\nimport org.eclipse.jetty.server.Response;\nimport org.eclipse.jetty.util.BufferUtil;\n\npublic class JettyFaultInjector implements FaultInjector {\n\n  private static final byte[] GARBAGE = \"lskdu018973t09sylgasjkfg1][]'./.sdlv\".getBytes(UTF_8);\n\n  private final HttpServletResponse response;\n  private final Socket socket;\n\n  public JettyFaultInjector(HttpServletResponse response, JettyHttpUtils utils) {\n    this.response = response;\n    final Response jettyResponse = utils.unwrapResponse(response);\n    this.socket = utils.socket(jettyResponse);\n  }\n\n  @Override\n  public void connectionResetByPeer() {\n    try {\n      socket.setSoLinger(true, 0);\n      socket.close();\n    } catch (IOException e) {\n      throwUnchecked(e);\n    }\n  }\n\n  @Override\n  public void emptyResponseAndCloseConnection() {\n    try {\n      socket.close();\n    } catch (IOException e) {\n      throwUnchecked(e);\n    }\n  }\n\n  @Override\n  public void malformedResponseChunk() {\n    try {\n      response.setStatus(200);\n      response.flushBuffer();\n      socket.getChannel().write(BufferUtil.toBuffer(GARBAGE));\n      socket.close();\n    } catch (IOException e) {\n      throwUnchecked(e);\n    }\n  }\n\n  @Override\n  public void randomDataAndCloseConnection() {\n    try {\n      socket.getChannel().write(BufferUtil.toBuffer(GARBAGE));\n      socket.close();\n    } catch (IOException e) {\n      throwUnchecked(e);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/faults/JettyFaultInjectorFactory.java",
    "content": "/*\n * Copyright (C) 2015-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.faults;\n\nimport com.github.tomakehurst.wiremock.core.FaultInjector;\nimport com.github.tomakehurst.wiremock.jetty.JettyHttpUtils;\nimport com.github.tomakehurst.wiremock.jetty.servlet.FaultInjectorFactory;\nimport jakarta.servlet.http.HttpServletRequest;\nimport jakarta.servlet.http.HttpServletResponse;\n\npublic class JettyFaultInjectorFactory implements FaultInjectorFactory {\n  private final JettyHttpUtils utils;\n\n  public JettyFaultInjectorFactory(JettyHttpUtils utils) {\n    this.utils = utils;\n  }\n\n  @Override\n  public FaultInjector buildFaultInjector(\n      HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {\n    if (httpServletRequest.getScheme().equals(\"https\")) {\n      return new JettyHttpsFaultInjector(httpServletResponse, utils);\n    }\n\n    return new JettyFaultInjector(httpServletResponse, utils);\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/faults/JettyHttpsFaultInjector.java",
    "content": "/*\n * Copyright (C) 2014-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.faults;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\nimport static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport com.github.tomakehurst.wiremock.core.FaultInjector;\nimport com.github.tomakehurst.wiremock.jetty.JettyHttpUtils;\nimport jakarta.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.net.Socket;\nimport org.eclipse.jetty.io.EndPoint;\nimport org.eclipse.jetty.server.Response;\nimport org.eclipse.jetty.util.BufferUtil;\nimport org.eclipse.jetty.util.Callback;\n\npublic class JettyHttpsFaultInjector implements FaultInjector {\n\n  private static final byte[] GARBAGE = \"lskdu018973t09sylgasjkfg1][]'./.sdlv\".getBytes(UTF_8);\n\n  private final HttpServletResponse response;\n  private final EndPoint endpoint;\n  private final Socket socket;\n\n  public JettyHttpsFaultInjector(HttpServletResponse response, JettyHttpUtils utils) {\n    this.response = response;\n    final Response jettyResponse = utils.unwrapResponse(response);\n    this.endpoint = utils.unwrapEndPoint(jettyResponse);\n    this.socket = utils.tlsSocket(jettyResponse);\n  }\n\n  @Override\n  public void connectionResetByPeer() {\n    try {\n      socket.setSoLinger(true, 0);\n      socket.close();\n    } catch (IOException e) {\n      throwUnchecked(e);\n    }\n  }\n\n  @Override\n  public void emptyResponseAndCloseConnection() {\n    try {\n      socket.close();\n    } catch (IOException e) {\n      throwUnchecked(e);\n    }\n  }\n\n  @Override\n  public void malformedResponseChunk() {\n    try {\n      response.setStatus(200);\n      response.flushBuffer();\n      writeGarbageThenCloseSocket();\n    } catch (IOException e) {\n      throwUnchecked(e);\n    }\n  }\n\n  @Override\n  public void randomDataAndCloseConnection() {\n    writeGarbageThenCloseSocket();\n  }\n\n  private void writeGarbageThenCloseSocket() {\n    endpoint.write(\n        new Callback() {\n          @Override\n          public void succeeded() {\n            try {\n              socket.close();\n            } catch (IOException e) {\n              notifier().error(\"Failed to close socket after Garbage write succeeded\", e);\n            }\n          }\n\n          @Override\n          public void failed(Throwable x) {\n            try {\n              socket.close();\n            } catch (IOException e) {\n              notifier().error(\"Failed to close socket after Garbage write failed\", e);\n            }\n          }\n        },\n        BufferUtil.toBuffer(GARBAGE));\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/proxy/HttpProxyDetectingHandler.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.proxy;\n\nimport org.eclipse.jetty.server.Handler;\nimport org.eclipse.jetty.server.Request;\nimport org.eclipse.jetty.server.Response;\nimport org.eclipse.jetty.server.ServerConnector;\nimport org.eclipse.jetty.util.Callback;\n\n/**\n * The Jetty 11 implementation was relying on relative request URI presence to detect the proxying\n * request. Jetty 12 does not do that anymore and URI is always converted to absolute form. To keep\n * proxy detection working, the Jetty 12 specific implementation does compare connector and URI\n * ports (which are different in case of proxying request).\n */\npublic class HttpProxyDetectingHandler extends Handler.Abstract {\n\n  public static final String IS_HTTP_PROXY_REQUEST_ATTRIBUTE = \"wiremock.isHttpProxyRequest\";\n\n  private final ServerConnector httpConnector;\n\n  public HttpProxyDetectingHandler(ServerConnector httpConnector) {\n    this.httpConnector = httpConnector;\n  }\n\n  @Override\n  public boolean handle(Request request, Response response, Callback callback) throws Exception {\n    final int httpPort = httpConnector.getLocalPort();\n\n    if (httpPort != request.getHttpURI().getPort()\n        && \"http\".equals(request.getHttpURI().getScheme())) {\n      request.setAttribute(IS_HTTP_PROXY_REQUEST_ATTRIBUTE, true);\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/proxy/HttpsProxyDetectingHandler.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.proxy;\n\nimport java.net.InetSocketAddress;\nimport java.net.SocketAddress;\nimport org.eclipse.jetty.server.Handler;\nimport org.eclipse.jetty.server.Request;\nimport org.eclipse.jetty.server.Response;\nimport org.eclipse.jetty.server.ServerConnector;\nimport org.eclipse.jetty.util.Callback;\n\npublic class HttpsProxyDetectingHandler extends Handler.Abstract {\n\n  public static final String IS_HTTPS_PROXY_REQUEST_ATTRIBUTE = \"wiremock.isHttpsProxyRequest\";\n\n  private final ServerConnector mitmProxyConnector;\n\n  public HttpsProxyDetectingHandler(ServerConnector mitmProxyConnector) {\n    this.mitmProxyConnector = mitmProxyConnector;\n  }\n\n  @Override\n  public boolean handle(Request request, Response response, Callback callback) throws Exception {\n    final int httpsProxyPort = mitmProxyConnector.getLocalPort();\n\n    int localPort = -1;\n    SocketAddress local = request.getConnectionMetaData().getLocalSocketAddress();\n    if (local instanceof InetSocketAddress) {\n      localPort = ((InetSocketAddress) local).getPort();\n    }\n\n    if (localPort == httpsProxyPort) {\n      request.setAttribute(IS_HTTPS_PROXY_REQUEST_ATTRIBUTE, true);\n    }\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/proxy/ManInTheMiddleSslConnectHandler.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.proxy;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport java.io.Closeable;\nimport java.net.InetSocketAddress;\nimport java.nio.channels.SocketChannel;\nimport org.eclipse.jetty.server.*;\nimport org.eclipse.jetty.server.handler.ConnectHandler;\nimport org.eclipse.jetty.util.Promise;\n\npublic class ManInTheMiddleSslConnectHandler extends ConnectHandler {\n\n  private final ServerConnector mitmProxyConnector;\n\n  public ManInTheMiddleSslConnectHandler(ServerConnector mitmProxyConnector) {\n    this.mitmProxyConnector = mitmProxyConnector;\n  }\n\n  @Override\n  protected void connectToServer(\n      Request request, String ignoredHost, int ignoredPort, Promise<SocketChannel> promise) {\n    SocketChannel channel = null;\n    try {\n      channel = SocketChannel.open();\n      channel.socket().setTcpNoDelay(true);\n      channel.configureBlocking(false);\n\n      String host = getFirstNonNull(mitmProxyConnector.getHost(), \"localhost\");\n      int port = mitmProxyConnector.getLocalPort();\n      InetSocketAddress address = newConnectAddress(host, port);\n\n      channel.connect(address);\n      promise.succeeded(channel);\n    } catch (Throwable x) {\n      closeSafely(channel);\n      promise.failed(x);\n    }\n  }\n\n  private void closeSafely(Closeable closeable) {\n    try {\n      if (closeable != null) closeable.close();\n    } catch (Throwable x) {\n      /* Ignore */\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/ContentTypeSettingFilter.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport jakarta.servlet.*;\nimport jakarta.servlet.http.HttpServletRequest;\nimport jakarta.servlet.http.HttpServletResponse;\nimport java.io.IOException;\n\npublic class ContentTypeSettingFilter implements Filter {\n\n  private ServletContext context;\n\n  @Override\n  public void init(FilterConfig filterConfig) throws ServletException {\n    context = filterConfig.getServletContext();\n  }\n\n  @Override\n  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)\n      throws IOException, ServletException {\n\n    if (response instanceof HttpServletResponse) {\n      String filePath = ((HttpServletRequest) request).getRequestURI();\n      String contentType = context.getMimeType(filePath);\n      if (contentType == null) {\n        contentType = \"application/json\";\n      }\n      ((HttpServletResponse) response).setContentType(contentType);\n    }\n\n    chain.doFilter(request, response);\n  }\n\n  @Override\n  public void destroy() {}\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/FaultInjectorFactory.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport com.github.tomakehurst.wiremock.core.FaultInjector;\nimport jakarta.servlet.http.HttpServletRequest;\nimport jakarta.servlet.http.HttpServletResponse;\n\npublic interface FaultInjectorFactory {\n\n  String INJECTOR_CLASS_KEY = \"FaultHandlerFactoryClass\";\n\n  FaultInjector buildFaultInjector(\n      HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/MultipartRequestConfigElementBuilder.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport jakarta.servlet.MultipartConfigElement;\n\npublic interface MultipartRequestConfigElementBuilder {\n  MultipartConfigElement build();\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/NoFaultInjector.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.github.tomakehurst.wiremock.core.FaultInjector;\nimport jakarta.servlet.http.HttpServletResponse;\nimport java.io.IOException;\n\npublic class NoFaultInjector implements FaultInjector {\n\n  private final HttpServletResponse httpServletResponse;\n\n  public NoFaultInjector(HttpServletResponse httpServletResponse) {\n    this.httpServletResponse = httpServletResponse;\n  }\n\n  @Override\n  public void connectionResetByPeer() {\n    sendError();\n  }\n\n  @Override\n  public void emptyResponseAndCloseConnection() {\n    sendError();\n  }\n\n  @Override\n  public void malformedResponseChunk() {\n    sendError();\n  }\n\n  @Override\n  public void randomDataAndCloseConnection() {\n    sendError();\n  }\n\n  private void sendError() {\n    httpServletResponse.setStatus(418);\n    try {\n      httpServletResponse.getWriter().write(\"No fault injector is configured!\");\n    } catch (IOException e) {\n      throwUnchecked(e);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/NoFaultInjectorFactory.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport com.github.tomakehurst.wiremock.core.FaultInjector;\nimport jakarta.servlet.http.HttpServletRequest;\nimport jakarta.servlet.http.HttpServletResponse;\n\npublic class NoFaultInjectorFactory implements FaultInjectorFactory {\n\n  @Override\n  public FaultInjector buildFaultInjector(\n      HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {\n    return new NoFaultInjector(httpServletResponse);\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/NotMatchedServlet.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport com.github.tomakehurst.wiremock.common.Exceptions;\nimport com.github.tomakehurst.wiremock.stubbing.ServeEvent;\nimport com.github.tomakehurst.wiremock.verification.diff.DiffEventData;\nimport jakarta.servlet.ServletException;\nimport jakarta.servlet.http.HttpServlet;\nimport jakarta.servlet.http.HttpServletRequest;\nimport jakarta.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Optional;\n\npublic class NotMatchedServlet extends HttpServlet {\n\n  @Override\n  protected void service(HttpServletRequest req, HttpServletResponse resp)\n      throws ServletException, IOException {\n    Optional.ofNullable(req.getAttribute(ServeEvent.ORIGINAL_SERVE_EVENT_KEY))\n        .map(ServeEvent.class::cast)\n        .flatMap(ServeEvent::getDiffSubEvent)\n        .ifPresentOrElse(\n            diffSubEvent -> {\n              final DiffEventData diffData = diffSubEvent.getDataAs(DiffEventData.class);\n              resp.setStatus(diffData.getStatus());\n              resp.setContentType(diffData.getContentType());\n              resp.setCharacterEncoding(StandardCharsets.UTF_8.name());\n\n              try (final PrintWriter writer = resp.getWriter()) {\n                writer.write(diffData.getReport());\n                writer.flush();\n              } catch (IOException e) {\n                Exceptions.throwUnchecked(e);\n              }\n            },\n            () -> Exceptions.uncheck(() -> resp.sendError(404)));\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/ServletContextFileSource.java",
    "content": "/*\n * Copyright (C) 2011-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport com.github.tomakehurst.wiremock.common.AbstractFileSource;\nimport com.github.tomakehurst.wiremock.common.FileSource;\nimport jakarta.servlet.ServletContext;\nimport java.io.File;\n\npublic class ServletContextFileSource extends AbstractFileSource {\n\n  private final String rootPath;\n  private final ServletContext servletContext;\n\n  public ServletContextFileSource(ServletContext servletContext, String rootPath) {\n    super(getRootFile(servletContext, rootPath));\n    this.rootPath = rootPath;\n    this.servletContext = servletContext;\n  }\n\n  private static File getRootFile(ServletContext servletContext, String rootPath) {\n    String containerRootPath = servletContext.getRealPath(rootPath);\n    servletContext.log(\"rootPath: \" + rootPath);\n    if (containerRootPath == null) {\n      // Path doesn't exist in the WAR, return a non-existent file\n      return new File(rootPath);\n    }\n    return new File(containerRootPath);\n  }\n\n  @Override\n  public FileSource child(String subDirectoryName) {\n    return new ServletContextFileSource(servletContext, rootPath + '/' + subDirectoryName);\n  }\n\n  @Override\n  protected boolean readOnly() {\n    return true;\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/TrailingSlashFilter.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport jakarta.servlet.*;\nimport jakarta.servlet.http.HttpServletRequest;\nimport jakarta.servlet.http.HttpServletResponse;\nimport jakarta.servlet.http.HttpServletResponseWrapper;\nimport java.io.IOException;\nimport java.net.*;\n\npublic class TrailingSlashFilter implements Filter {\n\n  @Override\n  public void init(FilterConfig filterConfig) throws ServletException {}\n\n  @Override\n  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)\n      throws IOException, ServletException {\n\n    HttpServletRequest httpServletRequest = (HttpServletRequest) request;\n    String path = getRequestPathFrom(httpServletRequest);\n\n    StatusAndRedirectExposingHttpServletResponse wrappedResponse =\n        new StatusAndRedirectExposingHttpServletResponse(\n            (HttpServletResponse) response, path, httpServletRequest);\n    chain.doFilter(request, wrappedResponse);\n  }\n\n  private static class StatusAndRedirectExposingHttpServletResponse\n      extends HttpServletResponseWrapper {\n\n    private final String path;\n    private final HttpServletRequest request;\n\n    public StatusAndRedirectExposingHttpServletResponse(\n        HttpServletResponse response, String path, HttpServletRequest request) {\n      super(response);\n      this.path = path;\n      this.request = request;\n    }\n\n    @Override\n    public void sendRedirect(String location) throws IOException {\n      if (location.contains(path)) {\n        RequestDispatcher dispatcher =\n            request.getRequestDispatcher(getPathPartFromLocation(location));\n        try {\n          dispatcher.forward(request, this);\n        } catch (ServletException se) {\n          throw new IOException(se);\n        }\n      }\n    }\n\n    private String getPathPartFromLocation(String location) throws IOException {\n      if (isRelativePath(location)) {\n        return location;\n      }\n\n      URL url = new URL(location);\n      return url.getPath();\n    }\n  }\n\n  private static boolean isRelativePath(String location) {\n    return location.matches(\"^/[^/]{1}.*\");\n  }\n\n  private String getRequestPathFrom(HttpServletRequest httpServletRequest) throws ServletException {\n    try {\n      String fullPath =\n          new URI(URLEncoder.encode(httpServletRequest.getRequestURI(), UTF_8)).getPath();\n      String pathWithoutContext = fullPath.substring(httpServletRequest.getContextPath().length());\n      return URLDecoder.decode(pathWithoutContext, UTF_8);\n    } catch (URISyntaxException e) {\n      throw new ServletException(e);\n    }\n  }\n\n  @Override\n  public void destroy() {}\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/WarConfiguration.java",
    "content": "/*\n * Copyright (C) 2016-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockApp.MESSAGE_MAPPINGS_ROOT;\nimport static java.util.Collections.emptyList;\n\nimport com.github.tomakehurst.wiremock.common.*;\nimport com.github.tomakehurst.wiremock.common.BrowserProxySettings;\nimport com.github.tomakehurst.wiremock.common.filemaker.FilenameMaker;\nimport com.github.tomakehurst.wiremock.core.MappingsSaver;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.extension.ExtensionDeclarations;\nimport com.github.tomakehurst.wiremock.http.CaseInsensitiveKey;\nimport com.github.tomakehurst.wiremock.http.HttpServerFactory;\nimport com.github.tomakehurst.wiremock.http.client.HttpClientFactory;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.DoNothingWiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.http.trafficlistener.WiremockNetworkTrafficListener;\nimport com.github.tomakehurst.wiremock.security.Authenticator;\nimport com.github.tomakehurst.wiremock.security.NoAuthenticator;\nimport com.github.tomakehurst.wiremock.servlet.NotImplementedMappingsSaver;\nimport com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource;\nimport com.github.tomakehurst.wiremock.standalone.MappingsLoader;\nimport com.github.tomakehurst.wiremock.store.DefaultStores;\nimport com.github.tomakehurst.wiremock.store.Stores;\nimport jakarta.servlet.ServletContext;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.Set;\n\npublic class WarConfiguration implements Options {\n\n  private static final String FILE_SOURCE_ROOT_KEY = \"WireMockFileSourceRoot\";\n\n  private final ServletContext servletContext;\n\n  public WarConfiguration(ServletContext servletContext) {\n    this.servletContext = servletContext;\n  }\n\n  @Override\n  public int portNumber() {\n    return 0;\n  }\n\n  @Override\n  public boolean getHttpDisabled() {\n    return false;\n  }\n\n  @Override\n  public boolean getHttp2PlainDisabled() {\n    return false;\n  }\n\n  @Override\n  public boolean getHttp2TlsDisabled() {\n    return false;\n  }\n\n  @Override\n  public HttpsSettings httpsSettings() {\n    return new HttpsSettings.Builder().build();\n  }\n\n  @Override\n  public int containerThreads() {\n    return 0;\n  }\n\n  @Override\n  public boolean browserProxyingEnabled() {\n    return false;\n  }\n\n  @Override\n  public ProxySettings proxyVia() {\n    return ProxySettings.NO_PROXY;\n  }\n\n  @Override\n  public Stores getStores() {\n    return new DefaultStores(filesRoot());\n  }\n\n  @Override\n  public FileSource filesRoot() {\n    String fileSourceRoot = servletContext.getInitParameter(FILE_SOURCE_ROOT_KEY);\n    return new ServletContextFileSource(servletContext, fileSourceRoot);\n  }\n\n  @Override\n  public MappingsLoader mappingsLoader() {\n    return new JsonFileMappingsSource(\n        filesRoot().child(\"mappings\"),\n        filesRoot().child(MESSAGE_MAPPINGS_ROOT),\n        new FilenameMaker());\n  }\n\n  @Override\n  public MappingsSaver mappingsSaver() {\n    return new NotImplementedMappingsSaver();\n  }\n\n  @Override\n  public Notifier notifier() {\n    return null;\n  }\n\n  @Override\n  public boolean requestJournalDisabled() {\n    return false;\n  }\n\n  @Override\n  public Optional<Integer> maxRequestJournalEntries() {\n    String str = servletContext.getInitParameter(\"maxRequestJournalEntries\");\n    if (str == null) {\n      return Optional.empty();\n    }\n    return Optional.of(Integer.parseInt(str));\n  }\n\n  @Override\n  public String bindAddress() {\n    return null;\n  }\n\n  @Override\n  public FilenameMaker getFilenameMaker() {\n    return null;\n  }\n\n  @Override\n  public List<CaseInsensitiveKey> matchingHeaders() {\n    return emptyList();\n  }\n\n  @Override\n  public boolean shouldPreserveHostHeader() {\n    return false;\n  }\n\n  @Override\n  public boolean shouldPreserveUserAgentProxyHeader() {\n    return false;\n  }\n\n  @Override\n  public String proxyHostHeader() {\n    return null;\n  }\n\n  @Override\n  public HttpServerFactory httpServerFactory() {\n    return null;\n  }\n\n  @Override\n  public HttpClientFactory httpClientFactory() {\n    return null;\n  }\n\n  @Override\n  public ExtensionDeclarations getDeclaredExtensions() {\n    return new ExtensionDeclarations();\n  }\n\n  @Override\n  public boolean isExtensionScanningEnabled() {\n    return true;\n  }\n\n  @Override\n  public WiremockNetworkTrafficListener networkTrafficListener() {\n    return new DoNothingWiremockNetworkTrafficListener();\n  }\n\n  @Override\n  public Authenticator getAdminAuthenticator() {\n    return new NoAuthenticator();\n  }\n\n  @Override\n  public boolean getHttpsRequiredForAdminApi() {\n    return false;\n  }\n\n  @Override\n  public AsynchronousResponseSettings getAsynchronousResponseSettings() {\n    return new AsynchronousResponseSettings(false, 0);\n  }\n\n  @Override\n  public ChunkedEncodingPolicy getChunkedEncodingPolicy() {\n    return ChunkedEncodingPolicy.ALWAYS;\n  }\n\n  @Override\n  public boolean getGzipDisabled() {\n    return false;\n  }\n\n  @Override\n  public boolean getStubRequestLoggingDisabled() {\n    return false;\n  }\n\n  @Override\n  public boolean getStubCorsEnabled() {\n    return false;\n  }\n\n  @Override\n  public long timeout() {\n    return 0;\n  }\n\n  @Override\n  public boolean getDisableOptimizeXmlFactoriesLoading() {\n    return false;\n  }\n\n  @Override\n  public boolean getDisableStrictHttpHeaders() {\n    return false;\n  }\n\n  @Override\n  public DataTruncationSettings getDataTruncationSettings() {\n    return DataTruncationSettings.DEFAULTS;\n  }\n\n  @Override\n  public NetworkAddressRules getProxyTargetRules() {\n    return NetworkAddressRules.ALLOW_ALL;\n  }\n\n  @Override\n  public BrowserProxySettings browserProxySettings() {\n    return BrowserProxySettings.DISABLED;\n  }\n\n  @Override\n  public int proxyTimeout() {\n    return DEFAULT_TIMEOUT;\n  }\n\n  @Override\n  public int getMaxHttpClientConnections() {\n    return DEFAULT_MAX_HTTP_CONNECTIONS;\n  }\n\n  @Override\n  public boolean getDisableConnectionReuse() {\n    return DEFAULT_DISABLE_CONNECTION_REUSE;\n  }\n\n  @Override\n  public boolean getResponseTemplatingEnabled() {\n    return true;\n  }\n\n  @Override\n  public boolean getResponseTemplatingGlobal() {\n    return false;\n  }\n\n  @Override\n  public Long getMaxTemplateCacheEntries() {\n    return null;\n  }\n\n  @Override\n  public Set<String> getTemplatePermittedSystemKeys() {\n    return null;\n  }\n\n  @Override\n  public boolean getTemplateEscapingDisabled() {\n    return false;\n  }\n\n  @Override\n  public Set<String> getSupportedProxyEncodings() {\n    return null;\n  }\n\n  @Override\n  public int getWebhookThreadPoolSize() {\n    return DEFAULT_WEBHOOK_THREADPOOL_SIZE;\n  }\n\n  @Override\n  public long getWebSocketIdleTimeout() {\n    return DEFAULT_WEBSOCKET_IDLE_TIMEOUT;\n  }\n\n  @Override\n  public long getWebSocketMaxTextMessageSize() {\n    return DEFAULT_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE;\n  }\n\n  @Override\n  public long getWebSocketMaxBinaryMessageSize() {\n    return DEFAULT_WEBSOCKET_MAX_BINARY_MESSAGE_SIZE;\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/WireMockHttpServletMultipartAdapter.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.github.tomakehurst.wiremock.http.*;\nimport jakarta.servlet.http.Part;\nimport java.io.IOException;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class WireMockHttpServletMultipartAdapter implements Request.Part {\n\n  private final Part mPart;\n  private final HttpHeaders headers;\n\n  public WireMockHttpServletMultipartAdapter(final Part servletPart) {\n    mPart = servletPart;\n    List<HttpHeader> httpHeaders =\n        mPart.getHeaderNames().stream()\n            .map(\n                name -> {\n                  Collection<String> headerValues = servletPart.getHeaders(name);\n                  return HttpHeader.httpHeader(\n                      name, headerValues.toArray(new String[headerValues.size()]));\n                })\n            .collect(Collectors.toList());\n    headers = new HttpHeaders(httpHeaders);\n  }\n\n  public static WireMockHttpServletMultipartAdapter from(Part servletPart) {\n    return new WireMockHttpServletMultipartAdapter(servletPart);\n  }\n\n  @Override\n  public String getName() {\n    return mPart.getName();\n  }\n\n  @Override\n  public String getFileName() {\n    return mPart.getSubmittedFileName();\n  }\n\n  @Override\n  public HttpHeader getHeader(String name) {\n    return headers.getHeader(name);\n  }\n\n  @Override\n  public HttpHeaders getHeaders() {\n    return headers;\n  }\n\n  @Override\n  public Body getBody() {\n    try {\n      byte[] bytes = mPart.getInputStream().readAllBytes();\n      HttpHeader header = getHeader(ContentTypeHeader.KEY);\n      ContentTypeHeader contentTypeHeader =\n          header.isPresent()\n              ? new ContentTypeHeader(header.firstValue())\n              : ContentTypeHeader.absent();\n      return Body.ofBinaryOrText(bytes, contentTypeHeader);\n    } catch (IOException e) {\n      return throwUnchecked(e, Body.class);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/servlet/WireMockWebContextListener.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.servlet;\n\nimport static com.github.tomakehurst.wiremock.common.ParameterUtils.getFirstNonNull;\n\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport com.github.tomakehurst.wiremock.common.Slf4jNotifier;\nimport com.github.tomakehurst.wiremock.core.WireMockApp;\nimport com.github.tomakehurst.wiremock.http.AdminRequestHandler;\nimport com.github.tomakehurst.wiremock.http.StubRequestHandler;\nimport com.github.tomakehurst.wiremock.servlet.NotImplementedContainer;\nimport jakarta.servlet.ServletContext;\nimport jakarta.servlet.ServletContextEvent;\nimport jakarta.servlet.ServletContextListener;\n\npublic class WireMockWebContextListener implements ServletContextListener {\n\n  private static final String APP_CONTEXT_KEY = \"WireMockApp\";\n\n  @Override\n  public void contextInitialized(ServletContextEvent sce) {\n    ServletContext context = sce.getServletContext();\n\n    boolean verboseLoggingEnabled =\n        Boolean.parseBoolean(\n            getFirstNonNull(context.getInitParameter(\"verboseLoggingEnabled\"), \"true\"));\n\n    WireMockApp wireMockApp =\n        new WireMockApp(new WarConfiguration(context), new NotImplementedContainer());\n\n    context.setAttribute(APP_CONTEXT_KEY, wireMockApp);\n    context.setAttribute(StubRequestHandler.class.getName(), wireMockApp.buildStubRequestHandler());\n    context.setAttribute(\n        AdminRequestHandler.class.getName(), wireMockApp.buildAdminRequestHandler());\n    context.setAttribute(Notifier.KEY, new Slf4jNotifier(verboseLoggingEnabled));\n  }\n\n  @Override\n  public void contextDestroyed(ServletContextEvent sce) {}\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/ssl/CertificateGeneratingSslContextFactory.java",
    "content": "/*\n * Copyright (C) 2020-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.ssl;\n\nimport static java.util.Arrays.stream;\nimport static java.util.Objects.requireNonNull;\n\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport com.github.tomakehurst.wiremock.http.ssl.ApacheHttpHostNameMatcher;\nimport com.github.tomakehurst.wiremock.http.ssl.CertificateGeneratingX509ExtendedKeyManager;\nimport com.github.tomakehurst.wiremock.http.ssl.DynamicKeyStore;\nimport com.github.tomakehurst.wiremock.http.ssl.X509KeyStore;\nimport java.security.KeyStore;\nimport javax.net.ssl.KeyManager;\nimport javax.net.ssl.X509ExtendedKeyManager;\nimport org.eclipse.jetty.util.ssl.SslContextFactory;\n\nclass CertificateGeneratingSslContextFactory extends SslContextFactory.Server {\n\n  private final X509KeyStore x509KeyStore;\n  private final Notifier notifier;\n\n  CertificateGeneratingSslContextFactory(X509KeyStore x509KeyStore, Notifier notifier) {\n    this.x509KeyStore = requireNonNull(x509KeyStore);\n    this.notifier = requireNonNull(notifier);\n  }\n\n  @Override\n  protected KeyManager[] getKeyManagers(KeyStore keyStore) throws Exception {\n    KeyManager[] managers = super.getKeyManagers(keyStore);\n    return stream(managers)\n        .map(\n            manager -> {\n              if (manager instanceof X509ExtendedKeyManager) {\n                return new CertificateGeneratingX509ExtendedKeyManager(\n                    (X509ExtendedKeyManager) manager,\n                    new DynamicKeyStore(x509KeyStore),\n                    new ApacheHttpHostNameMatcher(),\n                    notifier);\n              } else {\n                return manager;\n              }\n            })\n        .toArray(KeyManager[]::new);\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/ssl/SslContexts.java",
    "content": "/*\n * Copyright (C) 2019-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.ssl;\n\nimport static com.github.tomakehurst.wiremock.common.Exceptions.throwUnchecked;\n\nimport com.github.tomakehurst.wiremock.common.BrowserProxySettings;\nimport com.github.tomakehurst.wiremock.common.HttpsSettings;\nimport com.github.tomakehurst.wiremock.common.Notifier;\nimport com.github.tomakehurst.wiremock.common.ssl.KeyStoreSettings;\nimport com.github.tomakehurst.wiremock.http.ssl.CertificateAuthority;\nimport com.github.tomakehurst.wiremock.http.ssl.CertificateGenerationUnsupportedException;\nimport com.github.tomakehurst.wiremock.http.ssl.X509KeyStore;\nimport java.io.IOException;\nimport java.security.KeyStore;\nimport java.security.KeyStoreException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.cert.CertificateException;\nimport org.eclipse.jetty.http2.HTTP2Cipher;\nimport org.eclipse.jetty.util.ssl.SslContextFactory;\n\npublic class SslContexts {\n\n  public static SslContextFactory.Server buildHttp2SslContextFactory(HttpsSettings httpsSettings) {\n    SslContextFactory.Server sslContextFactory =\n        SslContexts.defaultSslContextFactory(httpsSettings.keyStore());\n    sslContextFactory.setKeyManagerPassword(httpsSettings.keyManagerPassword());\n    setupClientAuth(sslContextFactory, httpsSettings);\n    sslContextFactory.setCipherComparator(HTTP2Cipher.COMPARATOR);\n    return sslContextFactory;\n  }\n\n  public static SslContextFactory.Server buildHttp1_1SslContextFactory(\n      HttpsSettings httpsSettings) {\n    SslContextFactory.Server sslContextFactory =\n        SslContexts.defaultSslContextFactory(httpsSettings.keyStore());\n    sslContextFactory.setKeyManagerPassword(httpsSettings.keyManagerPassword());\n    setupClientAuth(sslContextFactory, httpsSettings);\n    return sslContextFactory;\n  }\n\n  public static SslContextFactory.Server buildManInTheMiddleSslContextFactory(\n      HttpsSettings httpsSettings,\n      BrowserProxySettings browserProxySettings,\n      final Notifier notifier) {\n    KeyStoreSettings browserProxyCaKeyStore = browserProxySettings.caKeyStore();\n    SslContextFactory.Server sslContextFactory =\n        buildSslContextFactory(notifier, browserProxyCaKeyStore, httpsSettings.keyStore());\n    setupClientAuth(sslContextFactory, httpsSettings);\n    return sslContextFactory;\n  }\n\n  private static void setupClientAuth(\n      SslContextFactory.Server sslContextFactory, HttpsSettings httpsSettings) {\n    if (httpsSettings.hasTrustStore()) {\n      sslContextFactory.setTrustStorePath(httpsSettings.trustStorePath());\n      sslContextFactory.setTrustStorePassword(httpsSettings.trustStorePassword());\n    }\n    sslContextFactory.setNeedClientAuth(httpsSettings.needClientAuth());\n  }\n\n  private static SslContextFactory.Server buildSslContextFactory(\n      Notifier notifier,\n      KeyStoreSettings browserProxyCaKeyStore,\n      KeyStoreSettings defaultHttpsKeyStore) {\n    if (browserProxyCaKeyStore.exists()) {\n      X509KeyStore existingKeyStore = toX509KeyStore(browserProxyCaKeyStore);\n      return certificateGeneratingSslContextFactory(\n          notifier, browserProxyCaKeyStore, existingKeyStore);\n    } else {\n      try {\n        X509KeyStore newKeyStore = buildKeyStore(browserProxyCaKeyStore);\n        return certificateGeneratingSslContextFactory(\n            notifier, browserProxyCaKeyStore, newKeyStore);\n      } catch (Exception e) {\n        notifier.error(\"Unable to generate a certificate authority\", e);\n        return defaultSslContextFactory(defaultHttpsKeyStore);\n      }\n    }\n  }\n\n  private static SslContextFactory.Server defaultSslContextFactory(\n      KeyStoreSettings defaultHttpsKeyStore) {\n    SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();\n    setupKeyStore(sslContextFactory, defaultHttpsKeyStore);\n    return sslContextFactory;\n  }\n\n  private static SslContextFactory.Server certificateGeneratingSslContextFactory(\n      Notifier notifier, KeyStoreSettings browserProxyCaKeyStore, X509KeyStore newKeyStore) {\n    SslContextFactory.Server sslContextFactory =\n        new CertificateGeneratingSslContextFactory(newKeyStore, notifier);\n    setupKeyStore(sslContextFactory, browserProxyCaKeyStore);\n    // Unlike the default one, we can insist that the keystore password is the keystore password\n    sslContextFactory.setKeyStorePassword(browserProxyCaKeyStore.password());\n    return sslContextFactory;\n  }\n\n  private static void setupKeyStore(\n      SslContextFactory.Server sslContextFactory, KeyStoreSettings keyStoreSettings) {\n    sslContextFactory.setKeyStore(keyStoreSettings.loadStore());\n    sslContextFactory.setKeyStorePassword(keyStoreSettings.password());\n    sslContextFactory.setKeyStoreType(keyStoreSettings.type());\n  }\n\n  private static X509KeyStore toX509KeyStore(KeyStoreSettings browserProxyCaKeyStore) {\n    try {\n      return new X509KeyStore(\n          browserProxyCaKeyStore.loadStore(), browserProxyCaKeyStore.password().toCharArray());\n    } catch (KeyStoreException e) {\n      // KeyStore must be loaded here, should never happen\n      return throwUnchecked(e, null);\n    }\n  }\n\n  private static X509KeyStore buildKeyStore(KeyStoreSettings browserProxyCaKeyStore)\n      throws KeyStoreException,\n          IOException,\n          NoSuchAlgorithmException,\n          CertificateException,\n          CertificateGenerationUnsupportedException {\n    final CertificateAuthority certificateAuthority =\n        CertificateAuthority.generateCertificateAuthority();\n    KeyStore keyStore = KeyStore.getInstance(browserProxyCaKeyStore.type());\n    char[] password = browserProxyCaKeyStore.password().toCharArray();\n    keyStore.load(null, password);\n    keyStore.setKeyEntry(\n        \"wiremock-ca\",\n        certificateAuthority.key(),\n        password,\n        certificateAuthority.certificateChain());\n\n    browserProxyCaKeyStore.getSource().save(keyStore);\n\n    return new X509KeyStore(keyStore, password);\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/websocket/JettyWebSocketSession.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.websocket;\n\nimport com.github.tomakehurst.wiremock.message.Message;\nimport com.github.tomakehurst.wiremock.message.websocket.WebSocketSession;\nimport java.nio.ByteBuffer;\nimport java.nio.charset.StandardCharsets;\nimport org.eclipse.jetty.websocket.api.Callback;\nimport org.eclipse.jetty.websocket.api.Session;\n\npublic class JettyWebSocketSession implements WebSocketSession {\n\n  private final Session session;\n\n  public JettyWebSocketSession(Session session) {\n    this.session = session;\n  }\n\n  @Override\n  public boolean isOpen() {\n    return session != null && session.isOpen();\n  }\n\n  @Override\n  public void sendMessage(Message message) {\n    if (isOpen()) {\n      byte[] data = message.getBody().getData();\n      if (message.isBinary()) {\n        session.sendBinary(ByteBuffer.wrap(data), Callback.NOOP);\n      } else {\n        String text = new String(data, StandardCharsets.UTF_8);\n        session.sendText(text, Callback.NOOP);\n      }\n    }\n  }\n\n  @Override\n  public void close() {\n    if (isOpen()) {\n      session.close(1000, \"Closed by server\", Callback.NOOP);\n    }\n  }\n\n  public Session getJettySession() {\n    return session;\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/java/com/github/tomakehurst/wiremock/jetty/websocket/WireMockWebSocketEndpoint.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.jetty.websocket;\n\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.message.Message;\nimport com.github.tomakehurst.wiremock.message.MessageDefinition;\nimport com.github.tomakehurst.wiremock.message.MessageStubRequestHandler;\nimport com.github.tomakehurst.wiremock.message.RequestInitiatedMessageChannel;\nimport com.github.tomakehurst.wiremock.message.websocket.WebSocketMessageChannel;\nimport org.eclipse.jetty.websocket.api.Callback;\nimport org.eclipse.jetty.websocket.api.Session;\n\npublic class WireMockWebSocketEndpoint implements Session.Listener.AutoDemanding {\n\n  private final MessageStubRequestHandler messageStubRequestHandler;\n  private final Request upgradeRequest;\n  private RequestInitiatedMessageChannel messageChannel;\n\n  public WireMockWebSocketEndpoint(\n      MessageStubRequestHandler messageStubRequestHandler, Request upgradeRequest) {\n    this.messageStubRequestHandler = messageStubRequestHandler;\n    this.upgradeRequest = upgradeRequest;\n  }\n\n  @Override\n  public void onWebSocketOpen(Session session) {\n    JettyWebSocketSession webSocketSession = new JettyWebSocketSession(session);\n    this.messageChannel = new WebSocketMessageChannel(upgradeRequest, webSocketSession);\n    messageStubRequestHandler.getMessageChannels().add(messageChannel);\n  }\n\n  @Override\n  public void onWebSocketText(String text) {\n    if (messageStubRequestHandler != null && messageChannel != null) {\n      Message message =\n          MessageStubRequestHandler.resolveToMessage(MessageDefinition.fromString(text), null);\n      messageStubRequestHandler.processMessage(messageChannel, message);\n    }\n  }\n\n  @Override\n  public void onWebSocketBinary(java.nio.ByteBuffer payload, Callback callback) {\n    if (messageStubRequestHandler != null && messageChannel != null) {\n      byte[] data = new byte[payload.remaining()];\n      payload.get(data);\n      Message message =\n          MessageStubRequestHandler.resolveToMessage(MessageDefinition.fromBytes(data), null);\n      messageStubRequestHandler.processMessage(messageChannel, message);\n    }\n    callback.succeed();\n  }\n\n  @Override\n  public void onWebSocketClose(int statusCode, String reason, Callback callback) {\n    if (messageChannel != null) {\n      messageStubRequestHandler.getMessageChannels().remove(messageChannel.getId());\n    }\n\n    callback.succeed();\n  }\n\n  public RequestInitiatedMessageChannel getMessageChannel() {\n    return messageChannel;\n  }\n}\n"
  },
  {
    "path": "wiremock-jetty/src/main/resources/META-INF/services/com.github.tomakehurst.wiremock.extension.Extension",
    "content": "com.github.tomakehurst.wiremock.jetty.JettyHttpServerFactory"
  },
  {
    "path": "wiremock-junit4/build.gradle.kts",
    "content": "plugins {\n    id(\"wiremock.common-conventions\")\n}\n\ndependencies {\n    api(project(\":wiremock-core\"))\n\n    api(libs.junit4)\n\n    testImplementation(testFixtures(project(\":\")))\n    testImplementation(libs.apache.http5.client)\n    testImplementation(libs.apache.http5.core)\n    testImplementation(libs.hamcrest)\n    testImplementation(platform(libs.junit.bom))\n    testImplementation(project(\":wiremock-httpclient-apache5\"))\n    testRuntimeOnly(libs.junit.vintage.engine)\n}\n\ntasks.jar {\n    archiveBaseName.set(\"wiremock-junit4\")\n}\n\npublishing {\n    publications {\n        create<MavenPublication>(\"mavenJava\") {\n            artifactId = tasks.jar.get().archiveBaseName.get()\n            from(components[\"java\"])\n\n            pom {\n                name = \"WireMock JUnit 4\"\n                description = \"JUnit 4 integration for WireMock\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "wiremock-junit4/src/main/java/com/github/tomakehurst/wiremock/junit/WireMockClassRule.java",
    "content": "/*\n * Copyright (C) 2013-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport org.junit.rules.MethodRule;\nimport org.junit.rules.TestRule;\nimport org.junit.runner.Description;\nimport org.junit.runners.model.FrameworkMethod;\nimport org.junit.runners.model.Statement;\n\npublic class WireMockClassRule extends WireMockServer implements MethodRule, TestRule {\n\n  public WireMockClassRule(Options options) {\n    super(options);\n  }\n\n  public WireMockClassRule(int port, Integer httpsPort) {\n    this(wireMockConfig().port(port).httpsPort(httpsPort));\n  }\n\n  public WireMockClassRule(int port) {\n    this(wireMockConfig().port(port));\n  }\n\n  public WireMockClassRule() {\n    this(wireMockConfig());\n  }\n\n  @Override\n  public Statement apply(final Statement base, FrameworkMethod method, Object target) {\n    return apply(base, null);\n  }\n\n  @Override\n  public Statement apply(final Statement base, Description description) {\n    return new Statement() {\n      @Override\n      public void evaluate() throws Throwable {\n        if (isRunning()) {\n          try {\n            before();\n            base.evaluate();\n          } finally {\n            after();\n            client.resetMappings();\n          }\n        } else {\n          start();\n          if (options.getHttpDisabled()) {\n            WireMock.configureFor(\"https\", \"localhost\", httpsPort());\n          } else {\n            WireMock.configureFor(\"http\", \"localhost\", port());\n          }\n\n          try {\n            before();\n            base.evaluate();\n          } finally {\n            after();\n            stop();\n          }\n        }\n      }\n    };\n  }\n\n  protected void before() {\n    // NOOP\n  }\n\n  protected void after() {\n    // NOOP\n  }\n}\n"
  },
  {
    "path": "wiremock-junit4/src/main/java/com/github/tomakehurst/wiremock/junit/WireMockRule.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport org.junit.rules.TestRule;\nimport org.junit.runner.Description;\nimport org.junit.runners.model.Statement;\n\npublic class WireMockRule extends WireMockServer implements TestRule {\n\n  private final boolean failOnUnmatchedRequests;\n\n  public WireMockRule(Options options) {\n    this(options, true);\n  }\n\n  public WireMockRule(Options options, boolean failOnUnmatchedRequests) {\n    super(options);\n    this.failOnUnmatchedRequests = failOnUnmatchedRequests;\n  }\n\n  public WireMockRule(int port) {\n    this(wireMockConfig().port(port));\n  }\n\n  public WireMockRule(int port, Integer httpsPort) {\n    this(wireMockConfig().port(port).httpsPort(httpsPort));\n  }\n\n  public WireMockRule() {\n    this(wireMockConfig());\n  }\n\n  @Override\n  public Statement apply(final Statement base, Description description) {\n    return new Statement() {\n      @Override\n      public void evaluate() throws Throwable {\n        start();\n\n        if (options.getHttpDisabled()) {\n          WireMock.configureFor(\"https\", \"localhost\", httpsPort());\n        } else {\n          WireMock.configureFor(\"localhost\", port());\n        }\n\n        try {\n          before();\n          base.evaluate();\n\n          if (failOnUnmatchedRequests) {\n            checkForUnmatchedRequests();\n          }\n        } finally {\n          after();\n          stop();\n        }\n      }\n    };\n  }\n\n  protected void before() {\n    // NOOP\n  }\n\n  protected void after() {\n    // NOOP\n  }\n}\n"
  },
  {
    "path": "wiremock-junit4/src/main/java/com/github/tomakehurst/wiremock/junit/WireMockStaticRule.java",
    "content": "/*\n * Copyright (C) 2012-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport org.junit.rules.MethodRule;\nimport org.junit.runners.model.FrameworkMethod;\nimport org.junit.runners.model.Statement;\n\n/**\n * @deprecated JUnit disallows this approach from version 4.11. Use {@link WireMockClassRule}\n *     instead\n */\n@Deprecated(forRemoval = true)\npublic class WireMockStaticRule implements MethodRule {\n\n  private final WireMockServer wireMockServer;\n\n  public WireMockStaticRule(int port) {\n    wireMockServer = new WireMockServer(port);\n    wireMockServer.start();\n    WireMock.configureFor(\"localhost\", port);\n  }\n\n  public WireMockStaticRule() {\n    this(Options.DEFAULT_PORT);\n  }\n\n  public void stopServer() {\n    wireMockServer.stop();\n  }\n\n  @Override\n  public Statement apply(final Statement base, final FrameworkMethod method, Object target) {\n    return new Statement() {\n\n      @Override\n      public void evaluate() throws Throwable {\n        try {\n          before();\n          base.evaluate();\n        } finally {\n          after();\n          WireMock.reset();\n        }\n      }\n    };\n  }\n\n  protected void before() {\n    // NOOP\n  }\n\n  protected void after() {\n    // NOOP\n  }\n}\n"
  },
  {
    "path": "wiremock-junit4/src/test/java/com/github/tomakehurst/wiremock/WireMockJUnitRuleTest.java",
    "content": "/*\n * Copyright (C) 2011-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.common.ConsoleNotifier;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.junit.Stubbing;\nimport com.github.tomakehurst.wiremock.junit.WireMockClassRule;\nimport com.github.tomakehurst.wiremock.junit.WireMockRule;\nimport com.github.tomakehurst.wiremock.testsupport.Network;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.core5.http.HttpResponse;\nimport org.junit.Before;\nimport org.junit.ClassRule;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.experimental.runners.Enclosed;\nimport org.junit.runner.RunWith;\n\n@RunWith(Enclosed.class)\npublic class WireMockJUnitRuleTest {\n\n  public static class BasicWireMockRule {\n\n    @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());\n\n    @Test\n    public void canRegisterStubAndFetchOnCorrectPort() {\n      givenThat(get(urlEqualTo(\"/rule/test\")).willReturn(aResponse().withBody(\"Rule test body\")));\n\n      WireMockTestClient testClient = new WireMockTestClient(wireMockRule.port());\n\n      assertThat(testClient.get(\"/rule/test\").content(), is(\"Rule test body\"));\n    }\n  }\n\n  /**\n   * Tests that WireMockRule run as a @Rule resets the WireMock server between tests. If it doesn't\n   * do so, one of the two tests will fail (probably 'B', but that's not guaranteed, as JUnit\n   * doesn't guarantee the order of test execution).\n   */\n  public static class WireMockJournalIsResetBetweenMultipleTests {\n\n    @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());\n\n    @Before\n    public void init() {\n      WireMock.configureFor(wireMockRule.port());\n    }\n\n    @Test\n    public void noPreviousRequestsUntilOneMadeA() {\n      assertNoPreviousRequestsReceived();\n      assertCanRegisterStubAndFetchOnCorrectPort(wireMockRule.port());\n    }\n\n    @Test\n    public void noPreviousRequestsUntilOneMadeB() {\n      assertNoPreviousRequestsReceived();\n      assertCanRegisterStubAndFetchOnCorrectPort(wireMockRule.port());\n    }\n  }\n\n  public static class WireMockRuleAsJUnit411ClassRule {\n\n    @ClassRule\n    public static WireMockClassRule classRule =\n        new WireMockClassRule(wireMockConfig().dynamicPort());\n\n    @Rule public WireMockClassRule instanceRule = classRule;\n\n    @Before\n    public void init() {\n      WireMock.configureFor(classRule.port());\n    }\n\n    @Test\n    public void testStubAndFetchOnce() {\n      assertNoPreviousRequestsReceived();\n      assertCanRegisterStubAndFetchOnCorrectPort(classRule.port());\n    }\n\n    @Test\n    public void testStubAndFetchAgain() {\n      assertNoPreviousRequestsReceived(); // Will fail if reset() not called after the previous test\n      // case\n      assertCanRegisterStubAndFetchOnCorrectPort(classRule.port());\n    }\n  }\n\n  /**\n   * Tests that WireMockClassRule run as a @Rule resets the WireMock server between tests. If it\n   * doesn't do so, one of the two tests will fail (probably 'B', but that's not guaranteed, as\n   * JUnit doesn't guarantee the order of test execution).\n   */\n  public static\n  class WireMockJournalIsResetBetweenMultipleTestsWithWireMockRuleAsJUnit411ClassRule {\n\n    @ClassRule\n    public static WireMockClassRule wireMockRule1 =\n        new WireMockClassRule(wireMockConfig().dynamicPort());\n\n    @Rule public WireMockClassRule instancewireMockRule1 = wireMockRule1;\n\n    @ClassRule\n    public static WireMockClassRule wireMockRule2 =\n        new WireMockClassRule(wireMockConfig().dynamicPort());\n\n    @Rule public WireMockClassRule instancewireMockRule2 = wireMockRule2;\n\n    @Test\n    public void noPreviousRequestsUntilOneMadeA() {\n      assertNoPreviousRequestsReceived(instancewireMockRule1);\n      assertNoPreviousRequestsReceived(instancewireMockRule2);\n\n      assertCanRegisterStubAndFetchOnCorrectPort(instancewireMockRule1);\n      assertCanRegisterStubAndFetchOnCorrectPort(instancewireMockRule2);\n    }\n\n    @Test\n    public void noPreviousRequestsUntilOneMadeB() {\n      assertNoPreviousRequestsReceived(instancewireMockRule1);\n      assertNoPreviousRequestsReceived(instancewireMockRule2);\n\n      assertCanRegisterStubAndFetchOnCorrectPort(instancewireMockRule1);\n      assertCanRegisterStubAndFetchOnCorrectPort(instancewireMockRule2);\n    }\n\n    private static void assertNoPreviousRequestsReceived(WireMockClassRule wireMockRule) {\n      wireMockRule.verify(0, getRequestedFor(urlMatching(\".*\")));\n    }\n\n    private static void assertCanRegisterStubAndFetchOnCorrectPort(WireMockClassRule wireMockRule) {\n      wireMockRule.givenThat(\n          get(urlEqualTo(\"/rule/test\")).willReturn(aResponse().withBody(\"Rule test body\")));\n\n      WireMockTestClient testClient = new WireMockTestClient(wireMockRule.port());\n\n      assertThat(testClient.get(\"/rule/test\").content(), is(\"Rule test body\"));\n    }\n  }\n\n  public static class PortNumbers {\n\n    private static final int RULE_HTTP_PORT = Network.findFreePort();\n    private static final int RULE_HTTPS_PORT = Network.findFreePort();\n    private static final int CLASSRULE_HTTP_PORT = Network.findFreePort();\n    private static final int CLASSRULE_HTTPS_PORT = Network.findFreePort();\n\n    @Rule\n    public WireMockRule wireMockRule =\n        new WireMockRule(wireMockConfig().port(RULE_HTTP_PORT).httpsPort(RULE_HTTPS_PORT));\n\n    @ClassRule\n    public static WireMockClassRule wireMockClassRule =\n        new WireMockClassRule(\n            wireMockConfig().port(CLASSRULE_HTTP_PORT).httpsPort(CLASSRULE_HTTPS_PORT));\n\n    @Test\n    public void reportedPortIsAsConfiguredInRule() {\n      assertThat(wireMockRule.port(), equalTo(RULE_HTTP_PORT));\n    }\n\n    @Test\n    public void reportedPortIsAsConfiguredInClassRule() {\n      assertThat(wireMockClassRule.port(), equalTo(CLASSRULE_HTTP_PORT));\n    }\n\n    @Test\n    public void reportedHttpsPortIsAsConfiguredInRule() {\n      assertThat(wireMockRule.httpsPort(), equalTo(RULE_HTTPS_PORT));\n    }\n\n    @Test\n    public void reportedHttpsPortIsAsConfiguredInClassRule() {\n      assertThat(wireMockClassRule.httpsPort(), equalTo(CLASSRULE_HTTPS_PORT));\n    }\n  }\n\n  public static class RuleStubbing {\n\n    public static final int PORT1 = Network.findFreePort();\n    public static final int PORT2 = Network.findFreePort();\n    public static final int PORT3 = Network.findFreePort();\n    public static final int PORT4 = Network.findFreePort();\n\n    @ClassRule\n    public static WireMockClassRule serviceOne =\n        new WireMockClassRule(wireMockConfig().port(PORT1));\n\n    @ClassRule\n    public static WireMockClassRule serviceTwo =\n        new WireMockClassRule(wireMockConfig().port(PORT2));\n\n    @Rule public WireMockRule serviceThree = new WireMockRule(wireMockConfig().port(PORT3));\n    @Rule public WireMockRule serviceFour = new WireMockRule(wireMockConfig().port(PORT4));\n\n    @Rule public WireMockRule portZeroRule = new WireMockRule(wireMockConfig().port(0));\n\n    @Rule\n    public WireMockClassRule portZeroClassRule = new WireMockClassRule(wireMockConfig().port(0));\n\n    @Test\n    public void canStubAndVerifyMultipleWireMockRulesWithoutInterferenceBetweenRuleInstances() {\n      setupStubbing(serviceOne, \"service one\");\n      setupStubbing(serviceTwo, \"service two\");\n      setupStubbing(serviceThree, \"service three\");\n      setupStubbing(serviceFour, \"service four\");\n\n      stubIsCalledAndResponseIsCorrect(serviceOne, PORT1, \"service one\");\n      stubIsCalledAndResponseIsCorrect(serviceTwo, PORT2, \"service two\");\n      stubIsCalledAndResponseIsCorrect(serviceThree, PORT3, \"service three\");\n      stubIsCalledAndResponseIsCorrect(serviceFour, PORT4, \"service four\");\n    }\n\n    @Test\n    public void canStubOnPortZero() {\n      setupStubbing(portZeroRule, \"port zero rule\");\n      setupStubbing(portZeroClassRule, \"port zero class rule\");\n\n      stubIsCalledAndResponseIsCorrect(portZeroRule, portZeroRule.port(), \"port zero rule\");\n      stubIsCalledAndResponseIsCorrect(\n          portZeroClassRule, portZeroClassRule.port(), \"port zero class rule\");\n    }\n\n    private void setupStubbing(Stubbing stubbing, String body) {\n      stubbing.stubFor(get(urlEqualTo(\"/test\")).willReturn(aResponse().withBody(body)));\n    }\n\n    private void stubIsCalledAndResponseIsCorrect(\n        Stubbing stubbing, int port, String expectedText) {\n      assertThat(new WireMockTestClient(port).get(\"/test\").content(), is(expectedText));\n      stubbing.verify(getRequestedFor(urlEqualTo(\"/test\")));\n    }\n  }\n\n  public static class ListenerTest {\n\n    @Rule\n    public WireMockRule wireMockRule =\n        new WireMockRule(wireMockConfig().dynamicPort().notifier(new ConsoleNotifier(true)));\n\n    @Test\n    public void requestReceivedByListener() {\n      final List<String> urls = new ArrayList<String>();\n      wireMockRule.addMockServiceRequestListener((request, response) -> urls.add(request.getUrl()));\n      wireMockRule.stubFor(\n          get(urlEqualTo(\"/test/listener\")).willReturn(aResponse().withBody(\"Listener\")));\n\n      WireMockTestClient testClient = new WireMockTestClient(wireMockRule.port());\n      assertThat(testClient.get(\"/test/listener\").content(), is(\"Listener\"));\n      assertThat(urls.size(), is(1));\n      assertThat(urls.get(0), is(\"/test/listener\"));\n    }\n  }\n\n  public static class HttpsOnly {\n\n    @Rule\n    public WireMockRule wireMockRule =\n        new WireMockRule(wireMockConfig().dynamicHttpsPort().httpDisabled(true));\n\n    @Test\n    public void exposesHttpsOnly() throws Exception {\n      wireMockRule.stubFor(any(anyUrl()).willReturn(ok()));\n\n      CloseableHttpClient client = ApacheHttpClientFactory.createClient();\n\n      HttpGet request = new HttpGet(\"https://localhost:\" + wireMockRule.httpsPort() + \"/anything\");\n      HttpResponse response = client.execute(request);\n\n      assertThat(response.getCode(), is(200));\n    }\n  }\n\n  private static void assertNoPreviousRequestsReceived() {\n    verify(0, getRequestedFor(urlMatching(\".*\")));\n  }\n\n  public static void assertCanRegisterStubAndFetchOnCorrectPort(int port) {\n    givenThat(get(urlEqualTo(\"/rule/test\")).willReturn(aResponse().withBody(\"Rule test body\")));\n\n    WireMockTestClient testClient = new WireMockTestClient(port);\n\n    assertThat(testClient.get(\"/rule/test\").content(), is(\"Rule test body\"));\n  }\n}\n"
  },
  {
    "path": "wiremock-junit4/src/test/java/com/github/tomakehurst/wiremock/junit/WireMockRuleFailOnUnmatchedRequestsTest.java",
    "content": "/*\n * Copyright (C) 2016-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.hamcrest.Matchers.containsString;\n\nimport com.github.tomakehurst.wiremock.client.VerificationException;\nimport com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\nimport org.junit.rules.RuleChain;\nimport org.junit.rules.TestRule;\n\npublic class WireMockRuleFailOnUnmatchedRequestsTest {\n\n  public ExpectedException expectedException = ExpectedException.none();\n\n  public WireMockRule wm =\n      new WireMockRule(options().dynamicPort().withRootDirectory(\"src/main/resources/empty\"), true);\n\n  @Rule public TestRule chain = RuleChain.outerRule(expectedException).around(wm);\n\n  WireMockTestClient client;\n\n  @Before\n  public void init() {\n    client = new WireMockTestClient(wm.port());\n  }\n\n  @Test\n  public void singleUnmatchedRequestShouldThrowVerificationException() {\n    expectedException.expect(VerificationException.class);\n    expectedException.expectMessage(containsString(\"A request was unmatched by any stub mapping\"));\n    wm.stubFor(get(urlEqualTo(\"/hit\")).willReturn(aResponse().withStatus(200)));\n    client.get(\"/near-misssss\");\n  }\n\n  @Test\n  public void manyUnmatchedRequestsShouldThrowVerificationException() {\n    expectedException.expect(VerificationException.class);\n    expectedException.expectMessage(\n        containsString(\"3 requests were unmatched by any stub mapping\"));\n    wm.stubFor(get(urlEqualTo(\"/hit\")).willReturn(aResponse().withStatus(200)));\n    client.get(\"/near-misssss\");\n    client.get(\"/hat\");\n    client.get(\"/whatevs\");\n  }\n\n  @Test\n  public void unmatchedRequestButMatchedStubShouldThrowVerificationException() {\n    expectedException.expect(VerificationException.class);\n    expectedException.expectMessage(containsString(\"A request was unmatched by any stub mapping\"));\n    wm.stubFor(get(urlEqualTo(\"/hit\")).willReturn(aResponse().withStatus(200)));\n    client.get(\"/near-misssss\");\n    client.get(\"/hit\");\n  }\n\n  @Test\n  public void matchedRequestButUnmatchedStubShouldNotThrowVerificationException() {\n    expectedException = ExpectedException.none();\n    wm.stubFor(get(urlEqualTo(\"/hit\")).willReturn(aResponse().withStatus(200)));\n    wm.stubFor(get(urlEqualTo(\"/miss\")).willReturn(aResponse().withStatus(404)));\n    client.get(\"/hit\");\n  }\n\n  @Test\n  public void unmatchedRequestWithoutStubShouldThrowVerificationException() {\n    expectedException.expect(VerificationException.class);\n    expectedException.expectMessage(containsString(\"A request was unmatched by any stub mapping.\"));\n\n    // Check that url details are part of the output error\n    expectedException.expectMessage(containsString(\"\\\"url\\\" : \\\"/miss\\\"\"));\n\n    client.get(\"/miss\");\n  }\n\n  @Test\n  public void unmatchedStubWithoutRequestShouldNotThrowVerificationException() {\n    expectedException = ExpectedException.none();\n    wm.stubFor(get(urlEqualTo(\"/miss\")).willReturn(aResponse().withStatus(404)));\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/build.gradle.kts",
    "content": "plugins {\n    id(\"wiremock.common-conventions\")\n}\n\ndependencies {\n    api(project(\":wiremock-core\"))\n\n    api(platform(libs.junit.bom))\n    api(libs.junit.jupiter.api)\n\n    implementation(libs.junit.platform.commons)\n\n    testImplementation(libs.apache.http5.client)\n    testImplementation(libs.apache.http5.core)\n    testImplementation(libs.hamcrest)\n    testImplementation(libs.junit.platform.engine)\n    testImplementation(libs.junit.platform.testkit)\n    testImplementation(libs.mockito.core)\n    testRuntimeOnly(libs.jetty.http)\n    testRuntimeOnly(libs.junit.jupiter)\n    testRuntimeOnly(project(\":wiremock-jetty\"))\n    testImplementation(project(\":wiremock-httpclient-apache5\"))\n}\n\ntasks.jar {\n    archiveBaseName.set(\"wiremock-junit5\")\n}\n\npublishing {\n    publications {\n        create<MavenPublication>(\"mavenJava\") {\n            artifactId = tasks.jar.get().archiveBaseName.get()\n            from(components[\"java\"])\n\n            pom {\n                name = \"WireMock JUnit 5\"\n                description = \"JUnit 5 (Jupiter) integration for WireMock\"\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/main/java/com/github/tomakehurst/wiremock/junit5/WireMockExtension.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.core.Options;\nimport com.github.tomakehurst.wiremock.core.WireMockConfiguration;\nimport com.github.tomakehurst.wiremock.http.JvmProxyConfigurer;\nimport com.github.tomakehurst.wiremock.junit.DslWrapper;\nimport java.util.Optional;\nimport org.junit.jupiter.api.extension.*;\nimport org.junit.platform.commons.support.AnnotationSupport;\n\n/**\n * JUnit Jupiter extension that manages a WireMock server instance's lifecycle and configuration.\n *\n * <p>See <a\n * href=\"http://wiremock.org/docs/junit-jupiter/\">http://wiremock.org/docs/junit-jupiter/</a> for\n * full documentation.\n */\npublic class WireMockExtension extends DslWrapper\n    implements ParameterResolver,\n        BeforeEachCallback,\n        BeforeAllCallback,\n        AfterEachCallback,\n        AfterAllCallback {\n\n  private final boolean configureStaticDsl;\n  private final boolean failOnUnmatchedRequests;\n  private final boolean resetOnEachTest;\n\n  private final boolean isDeclarative;\n\n  private Options options;\n  private WireMockServer wireMockServer;\n  private WireMockRuntimeInfo runtimeInfo;\n  private boolean isNonStatic = false;\n  private Boolean proxyMode;\n\n  WireMockExtension() {\n    configureStaticDsl = true;\n    failOnUnmatchedRequests = false;\n    isDeclarative = true;\n    resetOnEachTest = true;\n  }\n\n  /**\n   * Constructor intended for subclasses.\n   *\n   * <p>The parameter is a builder so that we can avoid a constructor explosion or\n   * backwards-incompatible changes when new options are added.\n   *\n   * @param builder a {@link com.github.tomakehurst.wiremock.junit5.WireMockExtension.Builder}\n   *     instance holding the initialisation parameters for the extension.\n   */\n  protected WireMockExtension(Builder builder) {\n    this.options = builder.options;\n    this.configureStaticDsl = builder.configureStaticDsl;\n    this.failOnUnmatchedRequests = builder.failOnUnmatchedRequests;\n    this.proxyMode = builder.proxyMode;\n    this.isDeclarative = false;\n    this.resetOnEachTest = builder.resetOnEachTest;\n  }\n\n  private WireMockExtension(\n      Options options,\n      boolean configureStaticDsl,\n      boolean failOnUnmatchedRequests,\n      boolean proxyMode) {\n    this.options = options;\n    this.configureStaticDsl = configureStaticDsl;\n    this.failOnUnmatchedRequests = failOnUnmatchedRequests;\n    this.proxyMode = proxyMode;\n    this.isDeclarative = false;\n    this.resetOnEachTest = true;\n  }\n\n  private WireMockExtension(\n      Options options,\n      boolean configureStaticDsl,\n      boolean failOnUnmatchedRequests,\n      boolean proxyMode,\n      boolean resetOnEachTest) {\n    this.options = options;\n    this.configureStaticDsl = configureStaticDsl;\n    this.failOnUnmatchedRequests = failOnUnmatchedRequests;\n    this.proxyMode = proxyMode;\n    this.isDeclarative = false;\n    this.resetOnEachTest = resetOnEachTest;\n  }\n\n  /**\n   * Alias for {@link #newInstance()} for use with custom subclasses, with a more relevant name for\n   * that use.\n   *\n   * @return a new {@link com.github.tomakehurst.wiremock.junit5.WireMockExtension.Builder}\n   *     instance.\n   */\n  public static Builder extensionOptions() {\n    return newInstance();\n  }\n\n  /**\n   * Create a new builder for the extension.\n   *\n   * @return a new {@link com.github.tomakehurst.wiremock.junit5.WireMockExtension.Builder}\n   *     instance.\n   */\n  public static Builder newInstance() {\n    return new Builder();\n  }\n\n  /**\n   * To be overridden in subclasses in order to run code immediately after per-class WireMock setup.\n   *\n   * @param wireMockRuntimeInfo port numbers, base URLs and HTTPS info for the running WireMock\n   *     instance/\n   */\n  protected void onBeforeAll(WireMockRuntimeInfo wireMockRuntimeInfo) {}\n\n  /**\n   * To be overridden in subclasses in order to run code immediately after per-class WireMock setup.\n   *\n   * @param extensionContext the current extension context; never {@code null}\n   * @param wireMockRuntimeInfo port numbers, base URLs and HTTPS info for the running WireMock\n   *     instance/\n   */\n  protected void onBeforeAll(\n      ExtensionContext extensionContext, WireMockRuntimeInfo wireMockRuntimeInfo) {\n    this.onBeforeAll(wireMockRuntimeInfo);\n  }\n\n  /**\n   * To be overridden in subclasses in order to run code immediately after per-test WireMock setup.\n   *\n   * @param wireMockRuntimeInfo port numbers, base URLs and HTTPS info for the running WireMock\n   *     instance/\n   */\n  protected void onBeforeEach(WireMockRuntimeInfo wireMockRuntimeInfo) {}\n\n  /**\n   * To be overridden in subclasses in order to run code immediately after per-test cleanup of\n   * WireMock and its associated resources.\n   *\n   * @param extensionContext the current extension context; never {@code null}\n   * @param wireMockRuntimeInfo port numbers, base URLs and HTTPS info for the running WireMock\n   *     instance/\n   */\n  protected void onBeforeEach(\n      ExtensionContext extensionContext, WireMockRuntimeInfo wireMockRuntimeInfo) {\n    this.onBeforeEach(wireMockRuntimeInfo);\n  }\n\n  /**\n   * To be overridden in subclasses in order to run code immediately after per-test cleanup of\n   * WireMock and its associated resources.\n   *\n   * @param wireMockRuntimeInfo port numbers, base URLs and HTTPS info for the running WireMock\n   *     instance/\n   */\n  protected void onAfterEach(WireMockRuntimeInfo wireMockRuntimeInfo) {}\n\n  /**\n   * To be overridden in subclasses in order to run code immediately after per-class cleanup of\n   * WireMock.\n   *\n   * @param extensionContext the current extension context; never {@code null}\n   * @param wireMockRuntimeInfo port numbers, base URLs and HTTPS info for the running WireMock\n   *     instance/\n   */\n  protected void onAfterEach(\n      ExtensionContext extensionContext, WireMockRuntimeInfo wireMockRuntimeInfo) {\n    this.onAfterEach(wireMockRuntimeInfo);\n  }\n\n  /**\n   * To be overridden in subclasses in order to run code immediately after per-class cleanup of\n   * WireMock.\n   *\n   * @param wireMockRuntimeInfo port numbers, base URLs and HTTPS info for the running WireMock\n   *     instance/\n   */\n  protected void onAfterAll(WireMockRuntimeInfo wireMockRuntimeInfo) {}\n\n  /**\n   * To be overridden in subclasses in order to run code immediately after per-class cleanup of\n   * WireMock.\n   *\n   * @param extensionContext the current extension context; never {@code null}\n   * @param wireMockRuntimeInfo port numbers, base URLs and HTTPS info for the running WireMock\n   *     instance/\n   */\n  protected void onAfterAll(\n      ExtensionContext extensionContext, WireMockRuntimeInfo wireMockRuntimeInfo) {\n    this.onAfterAll(wireMockRuntimeInfo);\n  }\n\n  @Override\n  public boolean supportsParameter(\n      final ParameterContext parameterContext, final ExtensionContext extensionContext)\n      throws ParameterResolutionException {\n    return parameterIsWireMockRuntimeInfo(parameterContext);\n  }\n\n  @Override\n  public Object resolveParameter(\n      final ParameterContext parameterContext, final ExtensionContext extensionContext)\n      throws ParameterResolutionException {\n\n    if (parameterIsWireMockRuntimeInfo(parameterContext)) {\n      return runtimeInfo;\n    }\n\n    return null;\n  }\n\n  private void startServerIfRequired(ExtensionContext extensionContext) {\n    if (wireMockServer == null || !wireMockServer.isRunning()) {\n      wireMockServer = new WireMockServer(resolveOptions(extensionContext));\n      wireMockServer.start();\n\n      runtimeInfo = new WireMockRuntimeInfo(wireMockServer);\n\n      this.admin = wireMockServer;\n      this.stubbing = wireMockServer;\n\n      if (configureStaticDsl) {\n        WireMock.configureFor(new WireMock(this));\n      }\n    }\n  }\n\n  private void setAdditionalOptions(ExtensionContext extensionContext) {\n    if (proxyMode == null) {\n      proxyMode =\n          extensionContext\n              .getElement()\n              .flatMap(\n                  annotatedElement ->\n                      AnnotationSupport.findAnnotation(annotatedElement, WireMockTest.class))\n              .map(WireMockTest::proxyMode)\n              .orElse(false);\n    }\n  }\n\n  private Options resolveOptions(ExtensionContext extensionContext) {\n    final Options defaultOptions = WireMockConfiguration.options().dynamicPort();\n    return extensionContext\n        .getElement()\n        .flatMap(\n            annotatedElement ->\n                this.isDeclarative\n                    ? AnnotationSupport.findAnnotation(annotatedElement, WireMockTest.class)\n                    : Optional.empty())\n        .map(this::buildOptionsFromWireMockTestAnnotation)\n        .orElseGet(() -> Optional.ofNullable(this.options).orElse(defaultOptions));\n  }\n\n  private Options buildOptionsFromWireMockTestAnnotation(WireMockTest annotation) {\n    WireMockConfiguration options =\n        WireMockConfiguration.options()\n            .port(annotation.httpPort())\n            .extensionScanningEnabled(annotation.extensionScanningEnabled())\n            .enableBrowserProxying(annotation.proxyMode());\n\n    if (annotation.httpsEnabled()) {\n      options.httpsPort(annotation.httpsPort());\n    }\n\n    return options;\n  }\n\n  private void stopServerIfRunning() {\n    if (wireMockServer != null && wireMockServer.isRunning()) {\n      wireMockServer.stop();\n    }\n  }\n\n  private boolean parameterIsWireMockRuntimeInfo(ParameterContext parameterContext) {\n    return parameterContext.getParameter().getType().equals(WireMockRuntimeInfo.class)\n        && this.isDeclarative;\n  }\n\n  @Override\n  public final void beforeAll(ExtensionContext context) throws Exception {\n    startServerIfRequired(context);\n    setAdditionalOptions(context);\n\n    onBeforeAll(context, runtimeInfo);\n  }\n\n  @Override\n  public final void beforeEach(ExtensionContext context) throws Exception {\n    if (wireMockServer == null) {\n      isNonStatic = true;\n      startServerIfRequired(context);\n    } else {\n      if (resetOnEachTest) {\n        resetToDefaultMappings();\n      }\n    }\n\n    setAdditionalOptions(context);\n\n    if (proxyMode) {\n      JvmProxyConfigurer.configureFor(wireMockServer);\n    }\n\n    onBeforeEach(context, runtimeInfo);\n  }\n\n  @Override\n  public final void afterAll(ExtensionContext context) throws Exception {\n    stopServerIfRunning();\n\n    onAfterAll(context, runtimeInfo);\n  }\n\n  @Override\n  public final void afterEach(ExtensionContext context) throws Exception {\n    if (failOnUnmatchedRequests) {\n      wireMockServer.checkForUnmatchedRequests();\n    }\n\n    if (isNonStatic) {\n      stopServerIfRunning();\n    }\n\n    if (proxyMode) {\n      JvmProxyConfigurer.restorePrevious();\n    }\n\n    onAfterEach(context, runtimeInfo);\n  }\n\n  public WireMockRuntimeInfo getRuntimeInfo() {\n    return new WireMockRuntimeInfo(wireMockServer);\n  }\n\n  public String baseUrl() {\n    return wireMockServer.baseUrl();\n  }\n\n  public String url(String path) {\n    return wireMockServer.url(path);\n  }\n\n  public int getHttpsPort() {\n    return wireMockServer.httpsPort();\n  }\n\n  public int getPort() {\n    return wireMockServer.port();\n  }\n\n  public static class Builder {\n\n    private Options options = WireMockConfiguration.wireMockConfig().dynamicPort();\n    private boolean configureStaticDsl = false;\n    private boolean failOnUnmatchedRequests = false;\n    private boolean resetOnEachTest = true;\n    private boolean proxyMode = false;\n\n    public Builder options(Options options) {\n      this.options = options;\n      return this;\n    }\n\n    public Builder configureStaticDsl(boolean configureStaticDsl) {\n      this.configureStaticDsl = configureStaticDsl;\n      return this;\n    }\n\n    public Builder failOnUnmatchedRequests(boolean failOnUnmatched) {\n      this.failOnUnmatchedRequests = failOnUnmatched;\n      return this;\n    }\n\n    public Builder proxyMode(boolean proxyMode) {\n      this.proxyMode = proxyMode;\n      return this;\n    }\n\n    public Builder resetOnEachTest(boolean resetOnEachTest) {\n      this.resetOnEachTest = resetOnEachTest;\n      return this;\n    }\n\n    public WireMockExtension build() {\n      if (proxyMode\n          && !options.browserProxySettings().enabled()\n          && (options instanceof WireMockConfiguration)) {\n        ((WireMockConfiguration) options).enableBrowserProxying(true);\n      }\n\n      return new WireMockExtension(\n          options, configureStaticDsl, failOnUnmatchedRequests, proxyMode, resetOnEachTest);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/main/java/com/github/tomakehurst/wiremock/junit5/WireMockRuntimeInfo.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.client.WireMock;\n\npublic class WireMockRuntimeInfo {\n\n  private final WireMockServer wireMockServer;\n  private final WireMock wireMock;\n\n  public WireMockRuntimeInfo(WireMockServer wireMockServer) {\n    this.wireMockServer = wireMockServer;\n    this.wireMock = new WireMock(wireMockServer);\n  }\n\n  public int getHttpPort() {\n    return wireMockServer.port();\n  }\n\n  public int getHttpsPort() {\n    return wireMockServer.httpsPort();\n  }\n\n  public boolean isHttpEnabled() {\n    return wireMockServer.isHttpEnabled();\n  }\n\n  public boolean isHttpsEnabled() {\n    return wireMockServer.isHttpsEnabled();\n  }\n\n  public String getHttpBaseUrl() {\n    return \"http://localhost:\" + getHttpPort();\n  }\n\n  public String getHttpsBaseUrl() {\n    return \"https://localhost:\" + getHttpsPort();\n  }\n\n  public WireMock getWireMock() {\n    return wireMock;\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/main/java/com/github/tomakehurst/wiremock/junit5/WireMockTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Inherited;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\nimport org.junit.jupiter.api.extension.ExtendWith;\n\n@Target(ElementType.TYPE)\n@Retention(RetentionPolicy.RUNTIME)\n@Inherited\n@ExtendWith(WireMockExtension.class)\npublic @interface WireMockTest {\n\n  boolean extensionScanningEnabled() default false;\n\n  int httpPort() default 0;\n\n  boolean httpsEnabled() default false;\n\n  int httpsPort() default 0;\n\n  boolean proxyMode() default false;\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionDeclarativeProgrammaticMixTest.java",
    "content": "/*\n * Copyright (C) 2023-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\nimport static org.hamcrest.Matchers.notNullValue;\n\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class JUnitJupiterExtensionDeclarativeProgrammaticMixTest {\n  @WireMockTest\n  public static class TestSaneStaticDefaults {\n    @RegisterExtension\n    public static WireMockExtension wms =\n        WireMockExtension.newInstance().options(wireMockConfig().port(44345)).build();\n\n    @Test\n    void programmatic_port_option_used_when_no_port_specified_in_attributes_static() {\n      final int port = wms.getPort();\n      assertThat(port, is(44345));\n    }\n\n    @Test\n    void programmatic_port_is_different_from_declarative_port(WireMockRuntimeInfo wmRuntimeInfo) {\n      final int declarativePort = wmRuntimeInfo.getHttpPort();\n      final int staticMemberPort = wms.getPort();\n      assertThat(staticMemberPort, is(not(declarativePort)));\n    }\n\n    @Test\n    void wiremockruntimeinfo_always_injects_declarative_instance(\n        WireMockRuntimeInfo wmRuntimeInfo) {\n      WireMockRuntimeInfo staticMemberRuntimeInfo = wms.getRuntimeInfo();\n      assertThat(wmRuntimeInfo, is(notNullValue()));\n      assertThat(wmRuntimeInfo, is(not(staticMemberRuntimeInfo)));\n    }\n  }\n\n  @WireMockTest(httpPort = 44777)\n  public static class TestNoStaticOverride {\n    @RegisterExtension\n    public static WireMockExtension wms =\n        WireMockExtension.newInstance().options(wireMockConfig().port(44346)).build();\n\n    @Test\n    void programmatic_and_declarative_ports_are_as_defined(WireMockRuntimeInfo wmRuntimeInfo) {\n      final int declarativePort = wmRuntimeInfo.getHttpPort();\n      final int staticMemberPort = wms.getPort();\n\n      assertThat(staticMemberPort, is(44346));\n      assertThat(declarativePort, is(44777));\n    }\n  }\n\n  @WireMockTest\n  public static class TestSaneInstanceDefaults {\n    @RegisterExtension\n    public WireMockExtension wmi =\n        WireMockExtension.newInstance().options(wireMockConfig().port(44349)).build();\n\n    @Test\n    void programmatic_port_option_used_when_no_port_specified_in_attributes_instance() {\n      final int port = wmi.getPort();\n      assertThat(port, is(44349));\n    }\n\n    @Test\n    void programmatic_port_is_different_from_declarative_port(WireMockRuntimeInfo wmRuntimeInfo) {\n      final int declarativePort = wmRuntimeInfo.getHttpPort();\n      final int staticMemberPort = wmi.getPort();\n      assertThat(staticMemberPort, is(not(declarativePort)));\n    }\n\n    @Test\n    void wiremockruntimeinfo_always_injects_declarative_instance(\n        WireMockRuntimeInfo wmRuntimeInfo) {\n      WireMockRuntimeInfo staticMemberRuntimeInfo = wmi.getRuntimeInfo();\n      assertThat(wmRuntimeInfo, is(notNullValue()));\n      assertThat(wmRuntimeInfo, is(not(staticMemberRuntimeInfo)));\n    }\n  }\n\n  @WireMockTest(httpPort = 44778)\n  public static class TestNoInstanceOverride {\n    @RegisterExtension\n    public WireMockExtension wmi =\n        WireMockExtension.newInstance().options(wireMockConfig().port(44351)).build();\n\n    @Test\n    void programmatic_port_option_used_when_no_port_specified_in_attributes_instance() {\n      final int port = wmi.getPort();\n      assertThat(port, is(44351));\n    }\n\n    @Test\n    void programmatic_port_is_different_from_declarative_port(WireMockRuntimeInfo wmRuntimeInfo) {\n      final int declarativePort = wmRuntimeInfo.getHttpPort();\n      final int staticMemberPort = wmi.getPort();\n      assertThat(staticMemberPort, is(not(declarativePort)));\n    }\n\n    @Test\n    void wiremockruntimeinfo_always_injects_declarative_instance(\n        WireMockRuntimeInfo wmRuntimeInfo) {\n      WireMockRuntimeInfo staticMemberRuntimeInfo = wmi.getRuntimeInfo();\n      assertThat(wmRuntimeInfo, is(notNullValue()));\n      assertThat(wmRuntimeInfo, is(not(staticMemberRuntimeInfo)));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionDeclarativeTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertNotNull;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\n\nimport com.github.tomakehurst.wiremock.client.WireMock;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\n@WireMockTest\npublic class JUnitJupiterExtensionDeclarativeTest {\n\n  CloseableHttpClient client;\n\n  @BeforeEach\n  void init() {\n    client = ApacheHttpClientFactory.createClient();\n  }\n\n  @Test\n  void provides_wiremock_info_as_method_parameter(WireMockRuntimeInfo wmRuntimeInfo)\n      throws Exception {\n    assertNotNull(wmRuntimeInfo);\n    assertNotNull(wmRuntimeInfo.getWireMock());\n\n    assertThrows(\n        IllegalStateException.class, wmRuntimeInfo::getHttpsPort); // HTTPS is off by default\n\n    WireMock wireMock = wmRuntimeInfo.getWireMock();\n    wireMock.register(get(\"/instance-dsl\").willReturn(ok()));\n    HttpGet request = new HttpGet(wmRuntimeInfo.getHttpBaseUrl() + \"/instance-dsl\");\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(response.getCode(), is(200));\n    }\n\n    stubFor(get(\"/static-dsl\").willReturn(ok()));\n    request = new HttpGet(wmRuntimeInfo.getHttpBaseUrl() + \"/static-dsl\");\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(response.getCode(), is(200));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionDeclarativeWithFixedHttpsPortParameterTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport org.junit.jupiter.api.Test;\n\n@WireMockTest(httpsEnabled = true, httpsPort = 8766)\npublic class JUnitJupiterExtensionDeclarativeWithFixedHttpsPortParameterTest {\n\n  @Test\n  void runs_on_the_supplied_port(WireMockRuntimeInfo wmRuntimeInfo) {\n    assertTrue(wmRuntimeInfo.isHttpsEnabled(), \"Expected HTTPS to be enabled\");\n    assertThat(wmRuntimeInfo.getHttpsPort(), is(8766));\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionDeclarativeWithHttpPortParameterTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport org.junit.jupiter.api.Test;\n\n@WireMockTest(httpPort = 8765)\npublic class JUnitJupiterExtensionDeclarativeWithHttpPortParameterTest {\n\n  @Test\n  void runs_on_the_supplied_port(WireMockRuntimeInfo wmRuntimeInfo) {\n    assertThat(wmRuntimeInfo.getHttpPort(), is(8765));\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionDeclarativeWithRandomHttpsPortParameterTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\n@WireMockTest(httpsEnabled = true)\npublic class JUnitJupiterExtensionDeclarativeWithRandomHttpsPortParameterTest {\n\n  CloseableHttpClient client;\n\n  @BeforeEach\n  void init() {\n    client = ApacheHttpClientFactory.createClient();\n  }\n\n  @Test\n  void runs_on_a_random_port_when_enabled(WireMockRuntimeInfo wmRuntimeInfo) throws Exception {\n    assertTrue(wmRuntimeInfo.isHttpsEnabled(), \"Expected HTTPS to be enabled\");\n\n    stubFor(get(\"/thing\").willReturn(ok()));\n\n    HttpGet request = new HttpGet(wmRuntimeInfo.getHttpsBaseUrl() + \"/thing\");\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(response.getCode(), is(200));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionExtensionScanningEnabledDeclarativeTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.requestMatching;\nimport static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport java.io.IOException;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\n\npublic class JUnitJupiterExtensionExtensionScanningEnabledDeclarativeTest {\n\n  private static int responseCode(String url) {\n    try {\n      try (CloseableHttpClient client = ApacheHttpClientFactory.createClient();\n          CloseableHttpResponse response = client.execute(new HttpGet(url))) {\n        return response.getCode();\n      }\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  @Nested\n  @WireMockTest\n  class Default {\n\n    @Test\n    void extension_scanning_defaults_to_false(WireMockRuntimeInfo wmRuntimeInfo) {\n      stubFor(requestMatching(\"mock\").willReturn(ok()));\n      assertNotEquals(responseCode(wmRuntimeInfo.getHttpBaseUrl()), 200);\n    }\n  }\n\n  @Nested\n  @WireMockTest(extensionScanningEnabled = false)\n  class Disabled {\n\n    @Test\n    void extension_scanning_disabled(WireMockRuntimeInfo wmRuntimeInfo) {\n      stubFor(requestMatching(\"mock\").willReturn(ok()));\n      assertNotEquals(responseCode(wmRuntimeInfo.getHttpBaseUrl()), 200);\n    }\n  }\n\n  @Nested\n  @WireMockTest(extensionScanningEnabled = true)\n  class Enabled {\n\n    @Test\n    void extension_scanning_enabled(WireMockRuntimeInfo wmRuntimeInfo) {\n      stubFor(requestMatching(\"mock\").willReturn(ok()));\n      assertEquals(responseCode(wmRuntimeInfo.getHttpBaseUrl()), 200);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionExtensionScanningEnabledProgrammaticTest.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.requestMatching;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertNotEquals;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport java.io.IOException;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class JUnitJupiterExtensionExtensionScanningEnabledProgrammaticTest {\n\n  private static int responseCode(String url) {\n    try {\n      try (CloseableHttpClient client = ApacheHttpClientFactory.createClient();\n          CloseableHttpResponse response = client.execute(new HttpGet(url))) {\n        return response.getCode();\n      }\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  @Nested\n  class Default {\n    @RegisterExtension\n    WireMockExtension wm =\n        WireMockExtension.newInstance().options(wireMockConfig().dynamicPort()).build();\n\n    @Test\n    void extension_scanning_defaults_to_false() {\n      wm.stubFor(requestMatching(\"mock\").willReturn(ok()));\n      assertNotEquals(responseCode(wm.getRuntimeInfo().getHttpBaseUrl()), 200);\n    }\n  }\n\n  @Nested\n  class Disabled {\n    @RegisterExtension\n    WireMockExtension disabled =\n        WireMockExtension.newInstance()\n            .options(wireMockConfig().dynamicPort().extensionScanningEnabled(false))\n            .build();\n\n    @Test\n    void extension_scanning_disabled() {\n      disabled.stubFor(requestMatching(\"mock\").willReturn(ok()));\n      assertNotEquals(responseCode(disabled.getRuntimeInfo().getHttpBaseUrl()), 200);\n    }\n  }\n\n  @Nested\n  class Enabled {\n    @RegisterExtension\n    WireMockExtension enabled =\n        WireMockExtension.newInstance()\n            .options(wireMockConfig().dynamicPort().extensionScanningEnabled(true))\n            .build();\n\n    @Test\n    void extension_scanning_enabled() {\n      enabled.stubFor(requestMatching(\"mock\").willReturn(ok()));\n      assertEquals(responseCode(enabled.getRuntimeInfo().getHttpBaseUrl()), 200);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionFailOnUnmatchedTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\nimport static org.junit.jupiter.api.Assertions.assertThrows;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.client.VerificationException;\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport java.util.Optional;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtensionContext;\nimport org.mockito.Mockito;\n\npublic class JUnitJupiterExtensionFailOnUnmatchedTest {\n\n  CloseableHttpClient client;\n  ExtensionContext extensionContext;\n\n  @BeforeEach\n  void init() {\n    client = ApacheHttpClientFactory.createClient();\n\n    extensionContext = Mockito.mock(ExtensionContext.class);\n    when(extensionContext.getElement()).thenReturn(Optional.empty());\n  }\n\n  @Test\n  void throws_a_verification_exception_when_an_unmatched_request_is_made_during_the_test()\n      throws Exception {\n    WireMockExtension extension =\n        WireMockExtension.newInstance().failOnUnmatchedRequests(true).build();\n\n    extension.beforeEach(extensionContext);\n\n    extension.stubFor(get(\"/found\").willReturn(ok()));\n\n    try (CloseableHttpResponse response =\n        client.execute(new HttpGet(extension.url(\"/not-found\")))) {\n      assertThat(response.getCode(), is(404));\n    }\n\n    assertThrows(VerificationException.class, () -> extension.afterEach(extensionContext));\n  }\n\n  @Test\n  void does_not_throw_a_verification_exception_when_fail_on_unmatched_disabled() throws Exception {\n    WireMockExtension extension =\n        WireMockExtension.newInstance().failOnUnmatchedRequests(false).build();\n\n    extension.beforeEach(extensionContext);\n\n    extension.stubFor(get(\"/found\").willReturn(ok()));\n\n    try (CloseableHttpResponse response =\n        client.execute(new HttpGet(extension.url(\"/not-found\")))) {\n      assertThat(response.getCode(), is(404));\n    }\n\n    assertDoesNotThrow(() -> extension.afterEach(extensionContext));\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionJvmProxyDeclarativeTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\n\n@WireMockTest(proxyMode = true, httpsEnabled = true)\npublic class JUnitJupiterExtensionJvmProxyDeclarativeTest {\n\n  CloseableHttpClient client;\n\n  @BeforeEach\n  void init() {\n    client = ApacheHttpClientFactory.createClient();\n  }\n\n  @Test\n  void configures_jvm_proxy_and_enables_browser_proxying() throws Exception {\n    stubFor(get(\"/things\").withHost(equalTo(\"one.my.domain\")).willReturn(ok(\"1\")));\n\n    stubFor(get(\"/things\").withHost(equalTo(\"two.my.domain\")).willReturn(ok(\"2\")));\n\n    assertThat(getContent(\"http://one.my.domain/things\"), is(\"1\"));\n    assertThat(getContent(\"https://two.my.domain/things\"), is(\"2\"));\n  }\n\n  private String getContent(String url) throws Exception {\n    try (CloseableHttpResponse response = client.execute(new HttpGet(url))) {\n      return EntityUtils.toString(response.getEntity());\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionJvmProxyNonStaticProgrammaticTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class JUnitJupiterExtensionJvmProxyNonStaticProgrammaticTest {\n\n  @RegisterExtension\n  WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().dynamicPort().dynamicHttpsPort())\n          .configureStaticDsl(true)\n          .proxyMode(true)\n          .build();\n\n  CloseableHttpClient client;\n\n  @BeforeEach\n  void init() {\n    client = ApacheHttpClientFactory.createClient();\n  }\n\n  @Test\n  void configures_jvm_proxy_and_enables_browser_proxying() throws Exception {\n    stubFor(get(\"/things\").withHost(equalTo(\"one.my.domain\")).willReturn(ok(\"1\")));\n\n    stubFor(get(\"/things\").withHost(equalTo(\"two.my.domain\")).willReturn(ok(\"2\")));\n\n    assertThat(getContent(\"http://one.my.domain/things\"), is(\"1\"));\n    assertThat(getContent(\"https://two.my.domain/things\"), is(\"2\"));\n  }\n\n  private String getContent(String url) throws Exception {\n    try (CloseableHttpResponse response = client.execute(new HttpGet(url))) {\n      return EntityUtils.toString(response.getEntity());\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionJvmProxyStaticProgrammaticTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class JUnitJupiterExtensionJvmProxyStaticProgrammaticTest {\n\n  @RegisterExtension\n  static WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().dynamicPort().dynamicHttpsPort())\n          .configureStaticDsl(true)\n          .proxyMode(true)\n          .build();\n\n  CloseableHttpClient client;\n\n  @BeforeEach\n  void init() {\n    client = ApacheHttpClientFactory.createClient();\n  }\n\n  @Test\n  void configures_jvm_proxy_and_enables_browser_proxying() throws Exception {\n    stubFor(get(\"/things\").withHost(equalTo(\"one.my.domain\")).willReturn(ok(\"1\")));\n\n    stubFor(get(\"/things\").withHost(equalTo(\"two.my.domain\")).willReturn(ok(\"2\")));\n\n    assertThat(getContent(\"http://one.my.domain/things\"), is(\"1\"));\n    assertThat(getContent(\"https://two.my.domain/things\"), is(\"2\"));\n  }\n\n  private String getContent(String url) throws Exception {\n    try (CloseableHttpResponse response = client.execute(new HttpGet(url))) {\n      return EntityUtils.toString(response.getEntity());\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionNonStaticMultiInstanceTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.getAllServeEvents;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.MethodOrderer.OrderAnnotation;\nimport org.junit.jupiter.api.Order;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestMethodOrder;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\n@TestMethodOrder(OrderAnnotation.class)\npublic class JUnitJupiterExtensionNonStaticMultiInstanceTest {\n\n  CloseableHttpClient client;\n\n  @RegisterExtension\n  WireMockExtension wm1 =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().dynamicPort().dynamicHttpsPort())\n          .configureStaticDsl(true)\n          .build();\n\n  @RegisterExtension\n  WireMockExtension wm2 =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().dynamicPort().templatingEnabled(true).globalTemplating(true))\n          .build();\n\n  @BeforeEach\n  void init() {\n    client = ApacheHttpClientFactory.createClient();\n  }\n\n  @Test\n  @Order(1)\n  void extension_field_provides_wiremock_info() throws Exception {\n    WireMockRuntimeInfo wm1RuntimeInfo = wm1.getRuntimeInfo();\n    assertDoesNotThrow(wm1RuntimeInfo::getHttpsPort);\n\n    stubFor(get(\"/wm1\").willReturn(ok()));\n    HttpGet request = new HttpGet(wm1RuntimeInfo.getHttpsBaseUrl() + \"/wm1\");\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(response.getCode(), is(200));\n    }\n\n    WireMockRuntimeInfo wm2RuntimeInfo = wm2.getRuntimeInfo();\n    wm2.stubFor(get(\"/wm2\").willReturn(ok(\"{{request.path.0}}\")));\n    request = new HttpGet(wm2RuntimeInfo.getHttpBaseUrl() + \"/wm2\");\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(response.getCode(), is(200));\n      assertThat(\n          EntityUtils.toString(response.getEntity()), is(\"wm2\")); // Ensures templating is enabled\n    }\n  }\n\n  @Test\n  @Order(2)\n  void wiremock_is_reset_between_tests() throws Exception {\n    WireMockRuntimeInfo wm1RuntimeInfo = wm1.getRuntimeInfo();\n\n    assertTrue(getAllServeEvents().isEmpty(), \"The request log should be empty\");\n\n    HttpGet request = new HttpGet(wm1RuntimeInfo.getHttpsBaseUrl() + \"/wm1\");\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(response.getCode(), is(404));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionResetOnEachTestTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.hasSize;\nimport static org.hamcrest.Matchers.is;\nimport static org.mockito.Mockito.when;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport java.util.Optional;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtensionContext;\nimport org.mockito.Mockito;\n\npublic class JUnitJupiterExtensionResetOnEachTestTest {\n\n  CloseableHttpClient client;\n  ExtensionContext extensionContext;\n\n  @BeforeEach\n  void init() {\n    client = ApacheHttpClientFactory.createClient();\n\n    extensionContext = Mockito.mock(ExtensionContext.class);\n    when(extensionContext.getElement()).thenReturn(Optional.empty());\n  }\n\n  @Test\n  void default_behavior_is_to_reset_stubs_in_before_each() throws Exception {\n    WireMockExtension extension = WireMockExtension.newInstance().build();\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getStubMappings(), hasSize(0));\n\n    extension.stubFor(get(\"/one\").willReturn(ok()));\n    assertThat(extension.getStubMappings(), hasSize(1));\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getStubMappings(), hasSize(0));\n\n    extension.stubFor(get(\"/two\").willReturn(ok()));\n    assertThat(extension.getStubMappings(), hasSize(1));\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getStubMappings(), hasSize(0));\n  }\n\n  @Test\n  void default_behavior_is_to_reset_requests_in_before_each() throws Exception {\n    WireMockExtension extension = WireMockExtension.newInstance().build();\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getAllServeEvents(), hasSize(0));\n\n    extension.stubFor(get(\"/one\").willReturn(ok()));\n    try (CloseableHttpResponse response = client.execute(new HttpGet(extension.url(\"/one\")))) {\n      assertThat(response.getCode(), is(200));\n    }\n    assertThat(extension.getAllServeEvents(), hasSize(1));\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getAllServeEvents(), hasSize(0));\n\n    extension.stubFor(get(\"/two\").willReturn(ok()));\n    try (CloseableHttpResponse response = client.execute(new HttpGet(extension.url(\"/two\")))) {\n      assertThat(response.getCode(), is(200));\n    }\n    assertThat(extension.getAllServeEvents(), hasSize(1));\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getAllServeEvents(), hasSize(0));\n  }\n\n  @Test\n  void can_configure_to_not_reset_stubs_in_before_each() throws Exception {\n    WireMockExtension extension = WireMockExtension.newInstance().resetOnEachTest(false).build();\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getStubMappings(), hasSize(0));\n\n    extension.stubFor(get(\"/one\").willReturn(ok()));\n    assertThat(extension.getStubMappings(), hasSize(1));\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getStubMappings(), hasSize(1));\n\n    extension.stubFor(get(\"/two\").willReturn(ok()));\n    assertThat(extension.getStubMappings(), hasSize(2));\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getStubMappings(), hasSize(2));\n  }\n\n  @Test\n  void can_configure_to_not_reset_requests_in_before_each() throws Exception {\n    WireMockExtension extension = WireMockExtension.newInstance().resetOnEachTest(false).build();\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getAllServeEvents(), hasSize(0));\n\n    extension.stubFor(get(\"/one\").willReturn(ok()));\n    try (CloseableHttpResponse response = client.execute(new HttpGet(extension.url(\"/one\")))) {\n      assertThat(response.getCode(), is(200));\n    }\n    assertThat(extension.getAllServeEvents(), hasSize(1));\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getAllServeEvents(), hasSize(1));\n\n    extension.stubFor(get(\"/two\").willReturn(ok()));\n    try (CloseableHttpResponse response = client.execute(new HttpGet(extension.url(\"/two\")))) {\n      assertThat(response.getCode(), is(200));\n    }\n    assertThat(extension.getAllServeEvents(), hasSize(2));\n\n    extension.beforeEach(extensionContext);\n    assertThat(extension.getAllServeEvents(), hasSize(2));\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionStaticMultiInstanceTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.MethodOrderer.OrderAnnotation;\nimport org.junit.jupiter.api.Order;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestMethodOrder;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\n@TestMethodOrder(OrderAnnotation.class)\npublic class JUnitJupiterExtensionStaticMultiInstanceTest {\n\n  CloseableHttpClient client;\n\n  @RegisterExtension\n  static WireMockExtension wm1 =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().dynamicPort().dynamicHttpsPort())\n          .configureStaticDsl(true)\n          .build();\n\n  @RegisterExtension\n  static WireMockExtension wm2 =\n      WireMockExtension.newInstance()\n          .options(wireMockConfig().dynamicPort().templatingEnabled(true).globalTemplating(true))\n          .build();\n\n  @BeforeEach\n  void init() {\n    client = ApacheHttpClientFactory.createClient();\n  }\n\n  @Test\n  @Order(1)\n  void extension_field_provides_wiremock_info() throws Exception {\n    WireMockRuntimeInfo wm1RuntimeInfo = wm1.getRuntimeInfo();\n    assertDoesNotThrow(wm1RuntimeInfo::getHttpsPort);\n\n    stubFor(get(\"/wm1\").willReturn(ok()));\n    HttpGet request = new HttpGet(wm1RuntimeInfo.getHttpsBaseUrl() + \"/wm1\");\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(response.getCode(), is(200));\n    }\n\n    WireMockRuntimeInfo wm2RuntimeInfo = wm2.getRuntimeInfo();\n    wm2.stubFor(get(\"/wm2\").willReturn(ok(\"{{request.path.0}}\")));\n    request = new HttpGet(wm2RuntimeInfo.getHttpBaseUrl() + \"/wm2\");\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(response.getCode(), is(200));\n      assertThat(\n          EntityUtils.toString(response.getEntity()), is(\"wm2\")); // Ensures templating is enabled\n    }\n  }\n\n  @Test\n  @Order(2)\n  void wiremock_is_reset_between_tests() throws Exception {\n    WireMockRuntimeInfo wm1RuntimeInfo = wm1.getRuntimeInfo();\n\n    assertTrue(getAllServeEvents().isEmpty(), \"The request log should be empty\");\n\n    HttpGet request = new HttpGet(wm1RuntimeInfo.getHttpsBaseUrl() + \"/wm1\");\n    try (CloseableHttpResponse response = client.execute(request)) {\n      assertThat(response.getCode(), is(404));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JUnitJupiterExtensionSubclassingTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass;\n\nimport ignored.JupiterExtensionTestClass;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.platform.testkit.engine.EngineTestKit;\nimport org.junit.platform.testkit.engine.Events;\n\npublic class JUnitJupiterExtensionSubclassingTest {\n\n  @BeforeEach\n  public void beforeEach() {\n    MyWireMockExtension.reset();\n  }\n\n  @Test\n  void executes_all_lifecycle_callbacks() {\n    Events testEvents =\n        EngineTestKit.engine(\"junit-jupiter\")\n            .selectors(selectClass(JupiterExtensionTestClass.class))\n            .execute()\n            .testEvents();\n\n    testEvents.assertStatistics(stats -> stats.succeeded(1));\n\n    assertThat(MyWireMockExtension.beforeAllCalled, is(true));\n    assertThat(MyWireMockExtension.beforeEachCalled, is(true));\n    assertThat(MyWireMockExtension.afterEachCalled, is(true));\n    assertThat(MyWireMockExtension.afterAllCalled, is(true));\n  }\n\n  public static class MyWireMockExtension extends WireMockExtension {\n\n    public static boolean beforeAllCalled = false;\n    public static boolean beforeEachCalled = false;\n    public static boolean afterEachCalled = false;\n    public static boolean afterAllCalled = false;\n\n    public MyWireMockExtension(WireMockExtension.Builder builder) {\n      super(builder);\n    }\n\n    @Override\n    protected void onBeforeAll(WireMockRuntimeInfo wireMockRuntimeInfo) {\n      beforeAllCalled = true;\n    }\n\n    @Override\n    protected void onBeforeEach(WireMockRuntimeInfo wireMockRuntimeInfo) {\n      beforeEachCalled = true;\n    }\n\n    @Override\n    protected void onAfterEach(WireMockRuntimeInfo wireMockRuntimeInfo) {\n      afterEachCalled = true;\n    }\n\n    @Override\n    protected void onAfterAll(WireMockRuntimeInfo wireMockRuntimeInfo) {\n      afterAllCalled = true;\n    }\n\n    public static void reset() {\n      beforeAllCalled = false;\n      beforeEachCalled = false;\n      afterEachCalled = false;\n      afterAllCalled = false;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JunitJupiterExtensionDeclarativeWithConfiguredNestedTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\n\n@WireMockTest(httpPort = 8765)\nclass JunitJupiterExtensionDeclarativeWithConfiguredNestedTest {\n  @Test\n  void runs_on_the_supplied_port(WireMockRuntimeInfo wmRuntimeInfo) {\n    assertThat(wmRuntimeInfo.getHttpPort(), is(8765));\n  }\n\n  @Nested\n  @WireMockTest(httpPort = 8766)\n  class RunsOn8766 {\n    @Test\n    void runs_on_the_supplied_port(WireMockRuntimeInfo wmRuntimeInfo) {\n      assertThat(wmRuntimeInfo.getHttpPort(), is(8766));\n    }\n  }\n\n  @Nested\n  @WireMockTest(httpPort = 8767)\n  class RunsOn8767 {\n    @Test\n    void runs_on_the_supplied_port(WireMockRuntimeInfo wmRuntimeInfo) {\n      assertThat(wmRuntimeInfo.getHttpPort(), is(8767));\n    }\n  }\n\n  @Nested\n  class RunsOnInheritedPort {\n    @Test\n    void runs_on_the_supplied_port(WireMockRuntimeInfo wmRuntimeInfo) {\n      assertThat(wmRuntimeInfo.getHttpPort(), is(8765));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JunitJupiterExtensionDeclarativeWithInheritedTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.serverError;\nimport static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport java.io.IOException;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\nimport org.junit.jupiter.api.Test;\n\nclass JunitJupiterExtensionDeclarativeWithInheritedTest extends Inherited {\n  @Test\n  void proxy_is_applied_on_subclass() throws IOException {\n    stubFor(get(\"/foo\").withHost(equalTo(\"example.com\")).willReturn(serverError()));\n\n    URL url = new URL(\"http://example.com/foo\");\n\n    HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n\n    connection.setRequestMethod(\"GET\");\n\n    int responseCode = connection.getResponseCode();\n\n    assertThat(responseCode, is(500));\n  }\n}\n\n@WireMockTest(proxyMode = true)\nabstract class Inherited {}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/JunitJupiterExtensionDeclarativeWithNestedTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\n\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\n\n@WireMockTest\nclass JunitJupiterExtensionDeclarativeWithNestedTest {\n  @Test\n  void runs(WireMockRuntimeInfo info) {\n    assertDoesNotThrow(info::getHttpBaseUrl);\n  }\n\n  @Nested\n  class First {\n    @Test\n    void runs(WireMockRuntimeInfo info) {\n      assertDoesNotThrow(info::getHttpBaseUrl);\n    }\n  }\n\n  @Nested\n  class Second {\n    @Test\n    void runs(WireMockRuntimeInfo info) {\n      assertDoesNotThrow(info::getHttpBaseUrl);\n    }\n  }\n\n  @Nested\n  class Third {\n    @Test\n    void runs(WireMockRuntimeInfo info) {\n      assertDoesNotThrow(info::getHttpBaseUrl);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/com/github/tomakehurst/wiremock/junit5/MockExtension.java",
    "content": "/*\n * Copyright (C) 2024-2025 Thomas Akehurst\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 */\npackage com.github.tomakehurst.wiremock.junit5;\n\nimport com.github.tomakehurst.wiremock.extension.Parameters;\nimport com.github.tomakehurst.wiremock.http.Request;\nimport com.github.tomakehurst.wiremock.matching.MatchResult;\nimport com.github.tomakehurst.wiremock.matching.RequestMatcherExtension;\n\npublic class MockExtension extends RequestMatcherExtension {\n\n  @Override\n  public MatchResult match(Request request, Parameters parameters) {\n    return MatchResult.exactMatch();\n  }\n\n  @Override\n  public String getName() {\n    return \"mock\";\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/ignored/JUnit5ProxyTest.java",
    "content": "/*\n * Copyright (C) 2021-2025 Thomas Akehurst\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 */\npackage ignored;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.equalTo;\nimport static com.github.tomakehurst.wiremock.client.WireMock.get;\nimport static com.github.tomakehurst.wiremock.client.WireMock.ok;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport com.github.tomakehurst.wiremock.WireMockServer;\nimport com.github.tomakehurst.wiremock.http.JvmProxyConfigurer;\nimport com.github.tomakehurst.wiremock.junit5.WireMockExtension;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.HttpClientBuilder;\nimport org.apache.hc.core5.http.ClassicHttpResponse;\nimport org.apache.hc.core5.http.io.entity.EntityUtils;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class JUnit5ProxyTest {\n\n  @RegisterExtension\n  public WireMockExtension wm =\n      WireMockExtension.newInstance()\n          .options(options().dynamicPort().enableBrowserProxying(true))\n          .build();\n\n  CloseableHttpClient httpClient =\n      HttpClientBuilder.create()\n          .useSystemProperties() // This must be enabled for auto-configuration of proxy settings to\n          // work\n          .build();\n\n  @BeforeEach\n  public void init() {\n    JvmProxyConfigurer.configureFor(wm.getPort());\n  }\n\n  @AfterEach\n  public void cleanup() {\n    JvmProxyConfigurer.restorePrevious();\n  }\n\n  @Test\n  public void testViaProxyUsingRule() throws Exception {\n    wm.stubFor(get(\"/things\").withHost(equalTo(\"my.first.domain\")).willReturn(ok(\"Domain 1\")));\n\n    wm.stubFor(get(\"/things\").withHost(equalTo(\"my.second.domain\")).willReturn(ok(\"Domain 2\")));\n\n    ClassicHttpResponse response = httpClient.execute(new HttpGet(\"http://my.first.domain/things\"));\n    String responseBody = EntityUtils.toString(response.getEntity());\n    assertEquals(\"Domain 1\", responseBody);\n\n    response = httpClient.execute(new HttpGet(\"http://my.second.domain/things\"));\n    responseBody = EntityUtils.toString(response.getEntity());\n    assertEquals(\"Domain 2\", responseBody);\n  }\n\n  @Test\n  public void testViaProxyUsingServer() throws Exception {\n    WireMockServer wireMockServer =\n        new WireMockServer(options().dynamicPort().enableBrowserProxying(true));\n    wireMockServer.start();\n    JvmProxyConfigurer.configureFor(wireMockServer);\n\n    wireMockServer.stubFor(\n        get(\"/things\").withHost(equalTo(\"my.first.domain\")).willReturn(ok(\"Domain 1\")));\n\n    wireMockServer.stubFor(\n        get(\"/things\").withHost(equalTo(\"my.second.domain\")).willReturn(ok(\"Domain 2\")));\n\n    ClassicHttpResponse response = httpClient.execute(new HttpGet(\"http://my.first.domain/things\"));\n    String responseBody = EntityUtils.toString(response.getEntity());\n    assertEquals(\"Domain 1\", responseBody);\n\n    response = httpClient.execute(new HttpGet(\"http://my.second.domain/things\"));\n    responseBody = EntityUtils.toString(response.getEntity());\n    assertEquals(\"Domain 2\", responseBody);\n\n    wireMockServer.stop();\n    JvmProxyConfigurer.restorePrevious();\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/java/ignored/JupiterExtensionTestClass.java",
    "content": "/*\n * Copyright (C) 2025 Thomas Akehurst\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 */\npackage ignored;\n\nimport static com.github.tomakehurst.wiremock.client.WireMock.*;\nimport static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;\nimport static com.github.tomakehurst.wiremock.junit5.WireMockExtension.extensionOptions;\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.is;\n\nimport com.github.tomakehurst.wiremock.http.client.apache5.ApacheHttpClientFactory;\nimport com.github.tomakehurst.wiremock.junit5.JUnitJupiterExtensionSubclassingTest;\nimport org.apache.hc.client5.http.classic.methods.HttpGet;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpClient;\nimport org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.RegisterExtension;\n\npublic class JupiterExtensionTestClass {\n\n  CloseableHttpClient client = ApacheHttpClientFactory.createClient();\n\n  @RegisterExtension\n  static JUnitJupiterExtensionSubclassingTest.MyWireMockExtension wm =\n      new JUnitJupiterExtensionSubclassingTest.MyWireMockExtension(\n          extensionOptions()\n              .options(wireMockConfig().dynamicPort().dynamicHttpsPort())\n              .configureStaticDsl(true));\n\n  @Test\n  void respects_config_passed_via_builder() throws Exception {\n    assertThat(JUnitJupiterExtensionSubclassingTest.MyWireMockExtension.beforeAllCalled, is(true));\n    assertThat(JUnitJupiterExtensionSubclassingTest.MyWireMockExtension.beforeEachCalled, is(true));\n    assertThat(JUnitJupiterExtensionSubclassingTest.MyWireMockExtension.afterEachCalled, is(false));\n    assertThat(JUnitJupiterExtensionSubclassingTest.MyWireMockExtension.afterAllCalled, is(false));\n\n    stubFor(get(\"/ping\").willReturn(ok()));\n\n    try (CloseableHttpResponse response =\n        client.execute(new HttpGet(\"https://localhost:\" + wm.getHttpsPort() + \"/ping\"))) {\n      assertThat(response.getCode(), is(200));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-junit5/src/test/resources/META-INF/services/com.github.tomakehurst.wiremock.extension.Extension",
    "content": "com.github.tomakehurst.wiremock.junit5.MockExtension\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser/build.gradle.kts",
    "content": "import net.ltgt.gradle.errorprone.CheckSeverity\nimport net.ltgt.gradle.errorprone.errorprone\n\nplugins {\n  id(\"wiremock.common-conventions\")\n  id(\"net.ltgt.errorprone\") version \"5.1.0\"\n}\n\ntasks.jar {\n  archiveBaseName.set(\"wiremock-string-parser\")\n}\n\ndependencies {\n  api(\"org.jspecify:jspecify:1.0.0\")\n\n  annotationProcessor(\"com.uber.nullaway:nullaway:0.13.1\")\n  errorprone(\"com.google.errorprone:error_prone_core:2.42.0\")\n}\n\ntasks.compileJava {\n  options.errorprone {\n    check(\"NullAway\", CheckSeverity.ERROR)\n    check(\"NullableOptional\", CheckSeverity.OFF)\n    check(\"ClassInitializationDeadlock\", CheckSeverity.OFF)\n    option(\"NullAway:AnnotatedPackages\", \"org.wiremock.url\")\n  }\n}\n\npublishing {\n  publications {\n    create<MavenPublication>(\"mavenJava\") {\n      artifactId = tasks.jar.get().archiveBaseName.get()\n      from(components[\"java\"])\n\n      pom {\n        name = \"WireMock String Parser\"\n        description = \"Utility interfaces for String parsing\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser/src/main/java/org/wiremock/stringparser/ParseException.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.stringparser;\n\nimport org.jspecify.annotations.Nullable;\n\npublic abstract class ParseException extends IllegalArgumentException {\n\n  private final String illegalValue;\n\n  public ParseException(String illegalValue, String message, @Nullable Throwable cause) {\n    super(message, cause);\n    this.illegalValue = illegalValue;\n  }\n\n  public String getIllegalValue() {\n    return illegalValue;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser/src/main/java/org/wiremock/stringparser/ParsedString.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.stringparser;\n\n/**\n * An instance of {@link ParsedString} is produced by {@link StringParser#parse(String)}. The\n * contract is that {@link ParsedString#toString()} will return a String equal to the one passed to\n * {@link StringParser#parse(String)} to create it.\n *\n * <p>Serialization libraries can depend on this contract to serialize and deserialize subtypes of\n * {@link ParsedString}.\n */\npublic interface ParsedString {\n\n  /**\n   * @return a String equal to the one that was parsed to create this instance\n   */\n  @Override\n  String toString();\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser/src/main/java/org/wiremock/stringparser/StringParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.stringparser;\n\n/**\n * A {@link StringParser} produces instances of {@link ParsedString}. The contract is that {@link\n * ParsedString#toString()} will return a String equal to the one passed to {@link\n * StringParser#parse(String)} to create it.\n *\n * <p>Serialization libraries can depend on this contract to serialize and deserialize subtypes of\n * {@link ParsedString}.\n */\npublic interface StringParser<T extends ParsedString> {\n  Class<T> getType();\n\n  T parse(String stringForm) throws ParseException;\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser/src/main/java/org/wiremock/stringparser/package-info.java",
    "content": "@NullMarked\npackage org.wiremock.stringparser;\n\nimport org.jspecify.annotations.NullMarked;\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser-jackson2/build.gradle.kts",
    "content": "@file:Suppress(\"VulnerableLibrariesLocal\")\n\nimport net.ltgt.gradle.errorprone.CheckSeverity\nimport net.ltgt.gradle.errorprone.errorprone\n\nplugins {\n  id(\"wiremock.common-conventions\")\n  id(\"net.ltgt.errorprone\") version \"5.1.0\"\n}\n\ntasks.jar {\n  archiveBaseName.set(\"wiremock-string-parser-jackson2\")\n}\n\ndependencies {\n  api(\"org.jspecify:jspecify:1.0.0\")\n  api(project(\":wiremock-url:wiremock-string-parser\"))\n  api(\"com.fasterxml.jackson.core:jackson-core:2.5.0\")\n  api(\"com.fasterxml.jackson.core:jackson-databind:2.5.0\")\n\n  annotationProcessor(\"com.uber.nullaway:nullaway:0.13.1\")\n  errorprone(\"com.google.errorprone:error_prone_core:2.42.0\")\n}\n\ntasks.compileJava {\n  options.errorprone {\n    check(\"NullAway\", CheckSeverity.ERROR)\n    check(\"NullableOptional\", CheckSeverity.OFF)\n    check(\"ClassInitializationDeadlock\", CheckSeverity.OFF)\n    option(\"NullAway:AnnotatedPackages\", \"org.wiremock.url\")\n  }\n}\n\npublishing {\n  publications {\n    create<MavenPublication>(\"mavenJava\") {\n      artifactId = tasks.jar.get().archiveBaseName.get()\n      from(components[\"java\"])\n\n      pom {\n        name = \"WireMock String Parser Jackson 2\"\n        description = \"Jackson 2 module for WireMock String Parser\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser-jackson2/src/main/java/org/wiremock/stringparser/jackson2/ParsedStringDeserializer.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.stringparser.jackson2;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.JsonMappingException;\nimport java.io.IOException;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.ParseException;\nimport org.wiremock.stringparser.ParsedString;\nimport org.wiremock.stringparser.StringParser;\n\npublic class ParsedStringDeserializer<T extends ParsedString> extends JsonDeserializer<T> {\n\n  private final StringParser<T> parser;\n\n  public ParsedStringDeserializer(StringParser<T> parser) {\n    this.parser = parser;\n  }\n\n  public StringParser<T> getStringParser() {\n    return parser;\n  }\n\n  @Override\n  public @Nullable T deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {\n    String text = p.getValueAsString();\n    if (text == null) {\n      return null;\n    }\n\n    try {\n      return parser.parse(text);\n    } catch (ParseException e) {\n      throw JsonMappingException.from(p, e.getMessage(), e);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser-jackson2/src/main/java/org/wiremock/stringparser/jackson2/ParsedStringModule.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.stringparser.jackson2;\n\nimport com.fasterxml.jackson.databind.module.SimpleDeserializers;\nimport com.fasterxml.jackson.databind.module.SimpleModule;\nimport com.fasterxml.jackson.databind.module.SimpleSerializers;\nimport com.fasterxml.jackson.databind.ser.std.ToStringSerializer;\nimport java.util.List;\nimport org.wiremock.stringparser.ParsedString;\nimport org.wiremock.stringparser.StringParser;\n\npublic class ParsedStringModule extends SimpleModule {\n\n  private final List<StringParser<?>> stringParsers;\n\n  public ParsedStringModule(List<StringParser<?>> stringParsers) {\n    this.stringParsers = stringParsers;\n  }\n\n  public List<StringParser<?>> getStringParsers() {\n    return stringParsers;\n  }\n\n  @Override\n  public void setupModule(SetupContext context) {\n\n    // Global serializer for all ParsedString types\n    context.addSerializers(\n        new SimpleSerializers(List.of(new ToStringSerializer(ParsedString.class))));\n\n    // Per-type deserializers\n    SimpleDeserializers deserializers = new SimpleDeserializers();\n    for (var deserializer : stringParsers) {\n      addDeserializer(deserializers, new ParsedStringDeserializer<>(deserializer));\n    }\n\n    context.addDeserializers(deserializers);\n  }\n\n  private <T extends ParsedString> void addDeserializer(\n      SimpleDeserializers deserializers, ParsedStringDeserializer<T> deserializer) {\n    deserializers.addDeserializer(deserializer.getStringParser().getType(), deserializer);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser-jackson2/src/main/java/org/wiremock/stringparser/jackson2/package-info.java",
    "content": "@NullMarked\npackage org.wiremock.stringparser.jackson2;\n\nimport org.jspecify.annotations.NullMarked;\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser-jackson3/build.gradle.kts",
    "content": "import net.ltgt.gradle.errorprone.CheckSeverity\nimport net.ltgt.gradle.errorprone.errorprone\n\nplugins {\n  id(\"wiremock.common-conventions\")\n  id(\"net.ltgt.errorprone\") version \"5.1.0\"\n}\n\ntasks.jar {\n  archiveBaseName.set(\"wiremock-string-parser-jackson3\")\n}\n\ndependencies {\n  api(\"org.jspecify:jspecify:1.0.0\")\n  api(project(\":wiremock-url:wiremock-string-parser\"))\n  api(\"tools.jackson.core:jackson-core:3.0.0\")\n  api(\"tools.jackson.core:jackson-databind:3.0.0\")\n\n  annotationProcessor(\"com.uber.nullaway:nullaway:0.13.1\")\n  errorprone(\"com.google.errorprone:error_prone_core:2.42.0\")\n}\n\ntasks.compileJava {\n  options.errorprone {\n    check(\"NullAway\", CheckSeverity.ERROR)\n    check(\"NullableOptional\", CheckSeverity.OFF)\n    check(\"ClassInitializationDeadlock\", CheckSeverity.OFF)\n    option(\"NullAway:AnnotatedPackages\", \"org.wiremock.url\")\n  }\n}\n\npublishing {\n  publications {\n    create<MavenPublication>(\"mavenJava\") {\n      artifactId = tasks.jar.get().archiveBaseName.get()\n      from(components[\"java\"])\n\n      pom {\n        name = \"WireMock String Parser Jackson 3\"\n        description = \"Jackson 3 module for WireMock String Parser\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser-jackson3/src/main/java/org/wiremock/stringparser/jackson3/ParsedStringDeserializer.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.stringparser.jackson3;\n\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.ParseException;\nimport org.wiremock.stringparser.ParsedString;\nimport org.wiremock.stringparser.StringParser;\nimport tools.jackson.core.JsonParser;\nimport tools.jackson.databind.DeserializationContext;\nimport tools.jackson.databind.ValueDeserializer;\nimport tools.jackson.databind.exc.InvalidFormatException;\n\npublic class ParsedStringDeserializer<T extends ParsedString> extends ValueDeserializer<T> {\n\n  private final StringParser<T> parser;\n\n  public ParsedStringDeserializer(StringParser<T> parser) {\n    this.parser = parser;\n  }\n\n  public StringParser<T> getStringParser() {\n    return parser;\n  }\n\n  @Override\n  public @Nullable T deserialize(JsonParser p, DeserializationContext ctxt) {\n    String text = p.getValueAsString();\n    if (text == null) {\n      return null;\n    }\n\n    try {\n      return parser.parse(text);\n    } catch (ParseException e) {\n      throw InvalidFormatException.from(p, e.getMessage(), text, parser.getType());\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser-jackson3/src/main/java/org/wiremock/stringparser/jackson3/ParsedStringModule.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.stringparser.jackson3;\n\nimport java.util.List;\nimport org.wiremock.stringparser.ParsedString;\nimport org.wiremock.stringparser.StringParser;\nimport tools.jackson.databind.module.SimpleDeserializers;\nimport tools.jackson.databind.module.SimpleModule;\nimport tools.jackson.databind.module.SimpleSerializers;\nimport tools.jackson.databind.ser.std.ToStringSerializer;\n\npublic class ParsedStringModule extends SimpleModule {\n\n  private final List<StringParser<?>> stringParsers;\n\n  public ParsedStringModule(List<StringParser<?>> stringParsers) {\n    this.stringParsers = stringParsers;\n  }\n\n  public List<StringParser<?>> getStringParsers() {\n    return stringParsers;\n  }\n\n  @Override\n  public void setupModule(SetupContext context) {\n    super.setupModule(context);\n\n    // Global serializer for all ParsedString types\n    context.addSerializers(\n        new SimpleSerializers(List.of(new ToStringSerializer(ParsedString.class))));\n\n    // Per-type deserializers\n    SimpleDeserializers deserializers = new SimpleDeserializers();\n    for (var deserializer : stringParsers) {\n      addDeserializer(deserializers, new ParsedStringDeserializer<>(deserializer));\n    }\n\n    context.addDeserializers(deserializers);\n  }\n\n  private <T extends ParsedString> void addDeserializer(\n      SimpleDeserializers deserializers, ParsedStringDeserializer<T> deserializer) {\n    deserializers.addDeserializer(deserializer.getStringParser().getType(), deserializer);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-string-parser-jackson3/src/main/java/org/wiremock/stringparser/jackson3/package-info.java",
    "content": "@NullMarked\npackage org.wiremock.stringparser.jackson3;\n\nimport org.jspecify.annotations.NullMarked;\n"
  },
  {
    "path": "wiremock-url/wiremock-url/README.md",
    "content": "# WireMock URL\n\nA type-safe, immutable URL parsing and manipulation library for Java, designed for lenient parsing\nand RFC 3986 compliance.\n\n## Overview\n\nWireMock URL provides a robust set of tiny types for working with URLs and their components. The\nlibrary balances strict RFC 3986 compliance with practical leniency, accepting all valid RFC 3986\nURLs while being permissive with path, query, and fragment components.\n\n## Usage\n\n### Parsing URLs\n\n```java\nUrl url = Url.parse(\"https://example.com/path?query=value#fragment\");\n```\n\n### Normalization\n\n```java\nHost host = Host.parse(\"EXAMPLE.COM%2fpath\");\nHost normalised = host.normalise();  // Returns \"example.com%2Fpath\"\n```\n\n### Decoding\n\n```java\nFragment fragment = Fragment.parse(\"section%20name\");\nString decoded = fragment.decode();  // Returns \"section name\"\n```\n\n## Components\n\nThe library provides:\n\n* A class hierarchy of tiny types representing types of URI Reference (see diagram below)\n* Tiny types representing the components of URIs\n* Parsers for producing these types from String representations\n\n### URI Types\n- **Uri**: Either an Absolute URI (an Absolute URL or an Opaque URI), or a Relative URL\n- **AbsoluteUri**: Either an Absolute URL or an Opaque URI\n- **Url**: Either an Absolute URL or a Relative URL. `AbsoluteUrl.resolve(Url)` can return\n  `AbsoluteUrl` because it is guaranteed to produce an `AbsoluteUrl`, whereas\n  `AbsoluteUrl.resolve(Uri)` can only  return `AbsoluteUri` because it may produce an `OpaqueUri`.\n- **UrlWithAuthority**: Either an Absolute URL or a Scheme Relative URL.\n  `Scheme.resolve(UrlWithAuthority)` can return `AbsoluteUrl` because it is guaranteed to produce an\n  `AbsoluteUrl`, whereas `Scheme.resolve(Url)` can only return `AbsoluteUri` because it may produce\n  an `OpaqueUri` (a `Url` may not contain an `Authority`).\n- **AbsoluteUrl**: A URI with a scheme and an authority, e.g. `http://example.com/foo?q#f`\n- **RelativeUrl**: A relative reference, lacking a scheme and possibly an authority.\n  e.g. `//example.com/foo?q#f` or `/foo?q#f`\n- **SchemeRelativeUrl**: A specialisation of `RelativeUrl` that has an authority.\n- **OpaqueURI**: A URI with a scheme but no authority, e.g. `mailto:me@example.com` or `file:/home`\n- **PathAndQuery**: A specialisation of `RelativeUrl` that contains neither an authority nor a\n  fragment. Used in the request line of an HTTP request.\n- **ServersideAbsoluteUrl**: A specialisation of `AbsoluteUrl` that contains no fragment. Used in\n  the request line of an HTTP request when using an HTTP proxy.\n- **BaseUrl**: A specialisation of `AbsoluteUrl` whose path is either empty or ends with a slash,\n  and which has neither a query nor a fragment. Typically used as a configuration parameter, as\n  you can always resolve a relative path (and query and fragment) onto it and it will effectively be\n  appended to the base url.\n- **Origin**: A specialisation of `AbsoluteUrl` which contains only a normalised scheme, host and\n  (optional) port. Used as the origin for a user agent doing content security.\n\n### URI Components\n\n- **Scheme**: Scheme component (http, ftp, ssh etc.)\n- **Authority**: Optional userinfo, host and optional port\n- **HostAndPort**: Specialisation of `Authority` with no `UserInfo`. As found in an HTTP Request's\n  `Host` header.\n- **UserInfo**: Part of the Authority before the `@`\n- **Username**: Part of the userinfo before the first `:`\n- **Password**: Part of the userinfo after the first `:`\n- **Host**: Host component (domain, IPv4, IPv6)\n- **Port**: Port component (e.g. `80`, `080`)\n- **Path**: Path component\n- **Query**: Query string component\n- **Fragment**: Fragment identifier\n- **Segment**: Individual path segments\n\n### Generalised Concepts\n\n- **PercentEncoded**: Indicates a component that is percent encoded (contains e.g. `%20`). It's\n  `toString` will be percent encoded, but it has a `decode()` method that will decode it to the\n  unencoded value. Should have corresponding static `parse` (taking a percent encoded string and \n  wrapping it) and `encode` (taking an unencoded value and encoding it) methods.\n- **Normalisable**: Indicates a component that can be normalised into its normal form\n\n```mermaid\n\nclassDiagram\ndirection TB\n\nclass Uri {\n  <<Sealed_Interface>>\n\n}\n\nclass Url {\n  <<Sealed_Interface>>\n\n}\n\nclass AbsoluteUri {\n  <<Sealed_Interface>>\n\n}\n\nclass RelativeUrl {\n  <<Interface>>\n\n}\n\nclass UrlWithAuthority {\n  <<Sealed_Interface>>\n\n}\n\nclass SchemeRelativeUrl {\n  <<Interface>>\n\n}\n\nclass AbsoluteUrl {\n  <<Interface>>\n\n}\n\nclass OpaqueUri {\n  <<Interface>>\n\n}\n\nclass PathAndQuery {\n  <<Interface>>\n\n}\n\nclass ServersideAbsoluteUrl {\n  <<Interface>>\n\n}\n\nclass BaseUrl {\n  <<Interface>>\n\n}\n\nclass Origin {\n  <<Interface>>\n\n}\n\nUri <|-- Url \nUri <|-- AbsoluteUri\nUrl <|-- RelativeUrl\nAbsoluteUri <|-- AbsoluteUrl\nAbsoluteUri <|-- OpaqueUri \nRelativeUrl <|-- PathAndQuery \nUrl <|-- UrlWithAuthority\nUrlWithAuthority <|-- SchemeRelativeUrl \nUrlWithAuthority <|-- AbsoluteUrl \nRelativeUrl <|-- SchemeRelativeUrl\nAbsoluteUrl <|-- ServersideAbsoluteUrl\nServersideAbsoluteUrl <|-- BaseUrl\nBaseUrl <|-- Origin\n```\n## Design Goals\n\n### Core Objectives\n\n- **Type Safety**: Leverage Java's type system with domain-specific tiny types for URL components\n- **Ease of Use**: Simple, intuitive API for common URL manipulation tasks (e.g., modifying query\n  parameters)\n- **Lenient Parsing**: Accept all RFC 3986 compliant URLs with additional leniency:\n  - **Path**: Accepts all non-control characters except `?` and `#`\n  - **Query**: Accepts all non-control characters except `#`\n  - **Fragment**: Accepts all non-control characters\n- **Normalization**: RFC 3986 compliant normalisation via `normalise()` method, which\n  percent-encodes path, query, and fragment components as needed\n\n### Design Principles\n\n#### Immutability\n\nAll types are immutable, except for builder classes. This ensures thread safety and prevents\naccidental modification.\n\n#### Consistent API\n\nAll types provide a standard parsing interface:\n\n```java\nstatic Type parse(String stringForm);\n```\n\nTypes implementing `PercentEncoded` additionally provide:\n\n```java\nstatic Type encode(String unencoded);\n```\n\n#### Invariants\n\nThe library maintains the following invariants:\n\n1. **Parse Idempotence**: For all types, parsing and converting to string preserves the original\n   input:\n   ```java\n   Type.parse(input).toString().equals(input) == true;\n   ```\n\n2. **Normalization Idempotence**: Normalization is idempotent:\n   ```java\n   instance.normalise().equals(instance.normalise().normalise()) == true;\n   ```\n\n3. **Round-Trip Equality**: In general, round-tripping through parse and toString preserves equality:\n   ```java\n   Uri.parse(uri.toString()).equals(uri) == true;\n   ```\n\n   **Note**: There are edge cases where this is not possible. For example, a `PathAndQuery`\n   starting with `//` will be parsed as a `RelativeRef` when converted to string and re-parsed.\n\n4. **Percent-Encoded Round-Trip**: The following two invariants should always hold:\n   1. Original -> Encode -> Decode produces the original value:\n   ```java\n   PercentEncoded encoded = PercentEncoded.encode(original);\n   encoded.decode().equals(original) == true;\n   ```\n   2. Original (encoded) -> Normalise -> Decode -> Encode produces the normalised value:\n   ```java\n   PercentEncoded normalisedEncoded = PercentEncoded.parse(originalEncoded).normalise();\n   String decoded = normalisedEncoded.decode();\n   PercentEncoded reEncoded = PercentEncoded.encode(decoded);\n   reEncoded.equals(normalisedEncoded) == true;\n   ```\n\n## Testing\n\n### Snapshot Testing\n\nThe library uses **snapshot testing** to maintain comprehensive test coverage of URI/URL parsing\nbehaviour. Snapshot tests capture the actual behaviour of the parser and compare it against\npreviously recorded \"snapshots\" stored in JSON files.\n\n#### How Snapshot Testing Works\n\n1. **Test Execution**: Tests parse URIs and compare results against expected values in snapshot\n   files\n2. **Behaviour Changes**: When implementation changes cause different parsing behaviour:\n   - Tests fail (as expected)\n   - Actual behaviour is recorded in memory\n   - After all tests complete, updated snapshots are written to disk\n3. **Review & Commit**: Developers review the snapshot diffs and commit them if the changes are\n   correct\n\n#### Test Categories\n\nSnapshot tests are organised into four categories based on two dimensions:\n\n- **WHATWG validity**: Whether the input is valid according to the WHATWG URL Standard\n- **WireMock validity**: Whether WireMock successfully parses the input\n\nThis creates four snapshot files in `wiremock-url/src/test/resources/org/wiremock/url/whatwg/`:\n\n| Snapshot File                          | Description                                                     |\n|----------------------------------------|-----------------------------------------------------------------|\n| `whatwg_valid_wiremock_valid.json`     | Valid by both standards (ideal cases)                           |\n| `whatwg_valid_wiremock_invalid.json`   | WHATWG considers valid but WireMock rejects                     |\n| `whatwg_invalid_wiremock_valid.json`   | WHATWG considers invalid but WireMock accepts (lenient parsing) |\n| `whatwg_invalid_wiremock_invalid.json` | Invalid by both standards                                       |\n\n#### Developer Workflow\n\nWhen making changes to the URI parsing implementation:\n\n1. Make your code changes\n2. Run the `SnapshotTests` test class\n3. If behaviour changed:\n   - Tests will fail\n   - Snapshot files will be automatically updated\n4. Review the diff in the JSON snapshot files (e.g., using `git diff`)\n5. If changes are correct, commit the updated snapshots along with your code changes\n6. If changes are incorrect, fix the implementation and repeat\n\n#### What Gets Tested\n\n**For successful parses**, snapshots verify:\n- The parsed input URI and its normalised form\n- The parsed base URI (if provided) and its normalised form\n- The result of resolving the input against the base URI\n- The origin (for absolute URLs)\n- All URI components (scheme, authority, host, port, path, query, fragment, etc.)\n\n**For parsing failures**, snapshots verify:\n- The exception type thrown\n- The exception message\n- The cause exception (if any)\n"
  },
  {
    "path": "wiremock-url/wiremock-url/build.gradle.kts",
    "content": "import net.ltgt.gradle.errorprone.CheckSeverity\nimport net.ltgt.gradle.errorprone.errorprone\n\nplugins {\n  id(\"wiremock.common-conventions\")\n  alias(libs.plugins.jmh)\n  id(\"net.ltgt.errorprone\") version \"5.1.0\"\n}\n\ntasks.jar {\n  archiveBaseName.set(\"wiremock-url\")\n}\n\ndependencies {\n  api(\"org.jspecify:jspecify:1.0.0\")\n  api(project(\":wiremock-url:wiremock-string-parser\"))\n  compileOnly(\"org.jetbrains:annotations:26.1.0\")\n\n  testImplementation(platform(\"org.junit:junit-bom:6.0.1\"))\n  testImplementation(libs.junit.jupiter.api)\n  testImplementation(libs.junit.jupiter.params)\n  testImplementation(libs.assertj.core)\n\n  testImplementation(platform(libs.jackson.bom))\n  testImplementation(libs.jackson.core)\n  testImplementation(libs.jackson.databind)\n  testImplementation(libs.jackson.annotations)\n  testImplementation(libs.commons.lang)\n  testImplementation(libs.apache.commons.text)\n\n  testRuntimeOnly(libs.junit.jupiter)\n  testRuntimeOnly(libs.junit.platform.launcher)\n\n  // JMH\n  jmh(libs.jmh.core)\n  jmh(libs.jmh.generator.annprocess)\n\n  // JMH needs access to test dependencies for benchmark data\n  jmh(platform(libs.jackson.bom))\n  jmh(libs.jackson.core)\n  jmh(libs.jackson.databind)\n  jmh(libs.commons.lang)\n\n  annotationProcessor(\"com.uber.nullaway:nullaway:0.13.1\")\n  errorprone(\"com.google.errorprone:error_prone_core:2.42.0\")\n}\n\ntasks.compileJava {\n  options.errorprone {\n    check(\"NullAway\", CheckSeverity.ERROR)\n    check(\"NullableOptional\", CheckSeverity.OFF)\n    check(\"ClassInitializationDeadlock\", CheckSeverity.OFF)\n    option(\"NullAway:AnnotatedPackages\", \"org.wiremock.url\")\n  }\n}\n\ntasks.compileTestJava {\n  options.errorprone {\n    disableAllChecks = true\n  }\n}\n\njmh {\n  includes.add(\".*ParsePerformanceBenchmark.*\")\n}\n\npublishing {\n  publications {\n    create<MavenPublication>(\"mavenJava\") {\n      artifactId = tasks.jar.get().archiveBaseName.get()\n      from(components[\"java\"])\n\n      pom {\n        name = \"WireMock URL\"\n        description = \"loose URL type\"\n      }\n    }\n  }\n}\n\nspotless {\n  json {\n    targetExclude(\"src/test/resources/org/wiremock/url/whatwg/*.json\")\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/jmh/java/org/wiremock/url/ParsePerformanceBenchmark.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.concurrent.TimeUnit;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.openjdk.jmh.annotations.*;\nimport org.wiremock.url.whatwg.SimpleFailureWhatWGUrlTestCase;\nimport org.wiremock.url.whatwg.SuccessWhatWGUrlTestCase;\nimport org.wiremock.url.whatwg.WhatWGUrlTestManagement;\n\n/**\n * JMH benchmark comparing the performance of {@code java.net.URI} and {@code org.wiremock.url.Uri}\n * parsing.\n *\n * <p>Run with: {@code ./gradlew :wiremock-url:jmh}\n *\n * <p>This benchmark tests two scenarios:\n *\n * <ul>\n *   <li><strong>Valid parsing</strong>: URIs successfully parseable by both implementations\n *   <li><strong>Error handling</strong>: URIs rejected by both implementations (exception handling\n *       performance)\n * </ul>\n */\n@BenchmarkMode(Mode.Throughput)\n@OutputTimeUnit(TimeUnit.MILLISECONDS)\n@State(Scope.Benchmark)\n@Fork(\n    value = 2,\n    jvmArgs = {\"-Xms2G\", \"-Xmx2G\"})\n@Warmup(iterations = 3, time = 1)\n@Measurement(iterations = 5, time = 1)\npublic class ParsePerformanceBenchmark {\n\n  private static final Set<String> allUris =\n      WhatWGUrlTestManagement.testData.stream()\n          .flatMap(\n              test -> {\n                if (test instanceof SuccessWhatWGUrlTestCase success) {\n                  return Stream.of(\n                      success.input(), success.base(), success.href(), success.origin());\n                } else if (test instanceof SimpleFailureWhatWGUrlTestCase failure) {\n                  return Stream.of(failure.input(), failure.base());\n                } else {\n                  return Stream.of(test.input());\n                }\n              })\n          .filter(t -> t != null && !t.isEmpty() && !t.equals(\"null\"))\n          .collect(Collectors.toSet());\n\n  private static final List<String> parseableByBoth =\n      allUris.stream()\n          .filter(\n              uriStr -> {\n                try {\n                  new URI(uriStr);\n                } catch (URISyntaxException e) {\n                  return false;\n                }\n                try {\n                  Uri.parse(uriStr);\n                } catch (IllegalUri e) {\n                  return false;\n                }\n                return true;\n              })\n          .toList();\n\n  private static final List<String> notParseableByEither =\n      allUris.stream()\n          .filter(\n              uriStr -> {\n                try {\n                  new URI(uriStr);\n                  return false;\n                } catch (URISyntaxException ignored) {\n                  // means we can't parse it\n                }\n                try {\n                  Uri.parse(uriStr);\n                  return false;\n                } catch (IllegalUri ignored) {\n                  // means we can't parse it\n                }\n                return true;\n              })\n          .toList();\n\n  @State(Scope.Thread)\n  public static class ParseableBenchmarkState {\n    private int index = 0;\n\n    @Setup(Level.Invocation)\n    public void setUp() {\n      index = (index + 1) % parseableByBoth.size();\n    }\n\n    public String getCurrentUri() {\n      return parseableByBoth.get(index);\n    }\n  }\n\n  /**\n   * Benchmark for parsing URIs using {@code java.net.URI.create}.\n   *\n   * @param state the benchmark state containing the current URI to parse\n   * @return the parsed URI (to prevent dead code elimination)\n   */\n  @Benchmark\n  public URI benchmarkJavaNetUri(ParseableBenchmarkState state) {\n    return URI.create(state.getCurrentUri());\n  }\n\n  /**\n   * Benchmark for parsing URIs using {@code org.wiremock.url.Uri.parse}.\n   *\n   * @param state the benchmark state containing the current URI to parse\n   * @return the parsed Uri (to prevent dead code elimination)\n   */\n  @Benchmark\n  public Uri benchmarkWireMockUri(ParseableBenchmarkState state) {\n    return Uri.parse(state.getCurrentUri());\n  }\n\n  @State(Scope.Thread)\n  public static class InvalidBenchmarkState {\n    private int index = 0;\n\n    @Setup(Level.Invocation)\n    public void setUp() {\n      index = (index + 1) % notParseableByEither.size();\n    }\n\n    public String getCurrentUri() {\n      return notParseableByEither.get(index);\n    }\n  }\n\n  /**\n   * Benchmark for error handling when parsing invalid URIs using {@code java.net.URI}.\n   *\n   * <p>Tests the performance of exception handling when URIs are rejected by java.net.URI.\n   *\n   * @param state the benchmark state containing the current invalid URI\n   * @return null (exception is expected)\n   */\n  @Benchmark\n  public URI benchmarkJavaNetUriErrorHandling(InvalidBenchmarkState state) {\n    try {\n      return new URI(state.getCurrentUri());\n    } catch (URISyntaxException e) {\n      return null;\n    }\n  }\n\n  /**\n   * Benchmark for error handling when parsing invalid URIs using {@code\n   * org.wiremock.url.Uri.parse}.\n   *\n   * <p>Tests the performance of exception handling when URIs are rejected by Uri.\n   *\n   * @param state the benchmark state containing the current invalid URI\n   * @return null (exception is expected)\n   */\n  @Benchmark\n  public Uri benchmarkWireMockUriErrorHandling(InvalidBenchmarkState state) {\n    try {\n      return Uri.parse(state.getCurrentUri());\n    } catch (IllegalUri e) {\n      return null;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbsoluteUri.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.function.Consumer;\n\n/**\n * Represents a full URI as defined in <a href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC\n * 3986</a>. The name {@link AbsoluteUri} is used in preference to Uri to maintain consistency with\n * the names {@link Url}, {@link AbsoluteUrl} and {@link RelativeUrl} elsewhere in the hierarchy,\n * which are chosen for familiarity to developers.\n *\n * <p>An {@link AbsoluteUri} is either an {@link AbsoluteUrl} or an {@link OpaqueUri}. {@link\n * AbsoluteUri}s are used to identify resources.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-4.1\">RFC 3986 Section 4.1</a>\n */\npublic sealed interface AbsoluteUri extends Uri, Normalisable<AbsoluteUri>\n    permits AbsoluteUrl, AbstractAbsoluteUriValue, OpaqueUri {\n\n  @Override\n  Scheme getScheme();\n\n  @Override\n  default boolean isRelative() {\n    return false;\n  }\n\n  @Override\n  default boolean isAbsolute() {\n    return true;\n  }\n\n  @Override\n  AbsoluteUri normalise();\n\n  @Override\n  default boolean isNormalForm() {\n    var scheme = getScheme();\n    var authority = getAuthority();\n    var path = getPath();\n    var query = getQuery();\n    var fragment = getFragment();\n    return scheme.isNormalForm()\n        && (authority == null || authority.isNormalForm(scheme))\n        && path.isNormalForm()\n        && path.toString().startsWith(\"/\")\n        && (query == null || query.isNormalForm())\n        && (fragment == null || fragment.isNormalForm());\n  }\n\n  default AbsoluteUrl resolve(UrlWithAuthority other) {\n    if (other instanceof AbsoluteUrl otherUrl) {\n      return otherUrl.normalise();\n    } else {\n      var builder = AbsoluteUrl.builder(this.getScheme(), other.getAuthority().normalise());\n\n      Path otherPath = other.getPath();\n      Path path = otherPath.isEmpty() ? Path.ROOT : otherPath.normalise();\n      builder.setPath(path);\n\n      Query otherQuery = other.getQuery();\n      builder.setQuery(otherQuery != null ? otherQuery.normalise() : null);\n\n      Fragment otherFragment = other.getFragment();\n      builder.setFragment(otherFragment != null ? otherFragment.normalise() : null);\n\n      return builder.build();\n    }\n  }\n\n  default AbsoluteUri resolve(Uri other) {\n    if (other instanceof AbsoluteUri otherUri) {\n      return otherUri.normalise();\n    } else {\n      var builder = builder(this);\n\n      Authority otherAuthority = other.getAuthority();\n      Path otherPath = other.getPath();\n      Query otherQuery = other.getQuery();\n      Fragment otherFragment = other.getFragment();\n\n      if (otherAuthority != null) {\n        builder.setAuthority(otherAuthority.normalise());\n        Path path = otherPath.isEmpty() ? Path.ROOT : otherPath.normalise();\n        builder.setPath(path);\n        builder.setQuery(otherQuery != null ? otherQuery.normalise() : null);\n      } else if (otherPath.isEmpty()) {\n        builder.setPath(this.normalise().getPath());\n        if (otherQuery != null) {\n          builder.setQuery(otherQuery.normalise());\n        }\n      } else {\n        if (otherPath.isAbsolute()) {\n          builder.setPath(otherPath.normalise());\n        } else {\n          builder.setPath(this.normalise().getPath().resolve(otherPath));\n        }\n        builder.setQuery(otherQuery != null ? otherQuery.normalise() : null);\n      }\n      otherFragment = otherFragment != null ? otherFragment.normalise() : null;\n      builder.setFragment(otherFragment);\n\n      return builder.build();\n    }\n  }\n\n  default AbsoluteUri resolve(Path other) {\n    var relative = RelativeUrl.builder().setPath(other).build();\n    return resolve(relative);\n  }\n\n  default AbsoluteUri.Transformer<?> thaw() {\n    return new AbsoluteUriTransformer(this);\n  }\n\n  default AbsoluteUri transform(Consumer<Uri.Transformer<?>> mutator) {\n    var transformer = thaw();\n    mutator.accept(transformer);\n    return transformer.build();\n  }\n\n  static AbsoluteUri.Builder<?> builder(Scheme scheme) {\n    return new AbsoluteUriBuilder(scheme);\n  }\n\n  static AbsoluteUri.Builder<?> builder(AbsoluteUri uri) {\n    return new AbsoluteUriBuilder(uri);\n  }\n\n  static AbsoluteUri parse(String uriString) throws IllegalAbsoluteUri {\n    return AbsoluteUriParser.INSTANCE.parse(uriString);\n  }\n\n  interface Builder<SELF extends Builder<SELF>> extends UriBaseBuilder<SELF> {\n\n    Scheme getScheme();\n\n    SELF setScheme(Scheme scheme);\n\n    @Override\n    AbsoluteUri build();\n  }\n\n  interface Transformer<SELF extends Transformer<SELF>> extends Uri.Transformer<SELF> {\n    @Override\n    AbsoluteUri build();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbsoluteUriBuilder.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class AbsoluteUriTransformer extends AbstractUriBaseBuilder<AbsoluteUriTransformer>\n    implements AbsoluteUri.Transformer<AbsoluteUriTransformer> {\n\n  public AbsoluteUriTransformer(AbsoluteUri absoluteUri) {\n    super(absoluteUri);\n  }\n\n  @Override\n  public AbsoluteUriTransformer setScheme(Scheme scheme) {\n    return super.doSetScheme(requireNonNull(scheme));\n  }\n\n  @Override\n  public AbsoluteUriTransformer setAuthority(Authority authority) {\n    return super.doSetAuthority(requireNonNull(authority));\n  }\n\n  @Override\n  public AbsoluteUri build() {\n    return (AbsoluteUri) super.build();\n  }\n}\n\nfinal class AbsoluteUriBuilder extends AbstractUriBaseBuilder<AbsoluteUriBuilder>\n    implements AbsoluteUri.Builder<AbsoluteUriBuilder> {\n\n  private final Scheme nonNullScheme;\n\n  AbsoluteUriBuilder(Scheme scheme) {\n    this.scheme = scheme;\n    this.nonNullScheme = scheme;\n  }\n\n  AbsoluteUriBuilder(AbsoluteUri uri) {\n    super(uri);\n    this.nonNullScheme = uri.getScheme();\n  }\n\n  @Override\n  public Scheme getScheme() {\n    return this.nonNullScheme;\n  }\n\n  @Override\n  public AbsoluteUriBuilder setScheme(Scheme scheme) {\n    return super.doSetScheme(requireNonNull(scheme));\n  }\n\n  @Override\n  public AbsoluteUriBuilder setAuthority(@Nullable Authority authority) {\n    return super.doSetAuthority(authority);\n  }\n\n  @Override\n  public AbsoluteUri build() {\n    return (AbsoluteUri) super.build();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbsoluteUriParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic final class AbsoluteUriParser implements StringParser<AbsoluteUri> {\n\n  public static final AbsoluteUriParser INSTANCE = new AbsoluteUriParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public AbsoluteUriParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<AbsoluteUri> getType() {\n    return AbsoluteUri.class;\n  }\n\n  @Override\n  public AbsoluteUri parse(String uriString) throws IllegalAbsoluteUri {\n    var uri = uriParser.parse(uriString);\n    if (uri instanceof AbsoluteUri absoluteUri) {\n      return absoluteUri;\n    } else {\n      throw new IllegalAbsoluteUri(uriString);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbsoluteUrl.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.function.Consumer;\n\n/**\n * Represents a Uniform Resource Locator (URL) as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC 3986</a>. The name {@link AbsoluteUrl}\n * is used in preference to Url because it is more familiar to developers, who habitually think of\n * both relative and complete URL references as URLs and use absolute URL to mean the latter. Note\n * that this is <b>not</b> an absolute URL in the RFC 3986 sense of a complete URI with no fragment.\n *\n * <p>An {@link AbsoluteUrl} consists of a scheme, authority (host and optional port and user info),\n * path, optional query, and optional fragment. {@link AbsoluteUrl}s always have both a scheme and\n * an authority component.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC 3986</a>\n */\npublic non-sealed interface AbsoluteUrl extends AbsoluteUri, UrlWithAuthority {\n\n  /**\n   * Returns the authority component of this URL.\n   *\n   * <p>URLs always have an authority component (unlike relative references and URNs).\n   *\n   * @return the authority component, never {@code null}\n   */\n  @Override\n  Authority getAuthority();\n\n  @Override\n  default boolean isRelative() {\n    return false;\n  }\n\n  @Override\n  default boolean isAbsoluteUrl() {\n    return true;\n  }\n\n  @Override\n  default boolean isOpaqueUri() {\n    return false;\n  }\n\n  @Override\n  default Host getHost() {\n    return getAuthority().getHost();\n  }\n\n  /**\n   * Returns the origin of this URL, consisting of the scheme, host, and port.\n   *\n   * @return the origin\n   */\n  default Origin getOrigin() {\n    var normalised = normalise();\n    return Origin.of(normalised.getScheme(), normalised.getAuthority().getHostAndPort());\n  }\n\n  /**\n   * Returns the serverside absolute URL of this URL, this URL without a fragment\n   *\n   * @return the origin\n   */\n  default ServersideAbsoluteUrl getServersideAbsoluteUrl() {\n    return (ServersideAbsoluteUrl) transform(builder -> builder.setFragment(null));\n  }\n\n  /**\n   * Returns this URL as a base URL, by removing the query and fragment and ensuring the path is\n   * either empty or ends with /\n   *\n   * @return the origin\n   */\n  default BaseUrl toBaseUrl() {\n    return (BaseUrl)\n        transform(\n            builder -> {\n              builder.setPath(getPath().toBasePath()).setQuery((Query) null).setFragment(null);\n            });\n  }\n\n  @Override\n  default SchemeRelativeUrl getSchemeRelativeUrl() {\n    return (SchemeRelativeUrl) Url.builder(this).setScheme(null).build();\n  }\n\n  /**\n   * Returns a normalised form of this URL.\n   *\n   * @return a normalised URL\n   */\n  @Override\n  AbsoluteUrl normalise();\n\n  /**\n   * Resolves the given string as a URI reference against this URL.\n   *\n   * @param other the URL to resolve\n   * @return the resolved absolute URL\n   * @throws IllegalUrl if the other is not a valid URL\n   */\n  default AbsoluteUrl resolve(String other) throws IllegalUrl {\n    return resolve(Url.parse(other));\n  }\n\n  /**\n   * Resolves the given path against this URL.\n   *\n   * @param other the path to resolve\n   * @return the URL with the resolved path\n   */\n  @Override\n  default AbsoluteUrl resolve(Path other) {\n    var relative = RelativeUrl.builder().setPath(other).build();\n    return resolve(relative);\n  }\n\n  /**\n   * Resolves the given URL reference against this URL.\n   *\n   * @param other the URL reference to resolve\n   * @return the resolved URL\n   */\n  default AbsoluteUrl resolve(Url other) {\n    return (AbsoluteUrl) resolve((Uri) other);\n  }\n\n  /**\n   * Creates a builder initialized with the values from this URL.\n   *\n   * @return a builder\n   */\n  @Override\n  default AbsoluteUrl.Transformer thaw() {\n    return new AbsoluteUrlTransformer(this);\n  }\n\n  /**\n   * Transforms this URL by applying modifications via a transformer.\n   *\n   * @param mutator a function that modifies the transformer\n   * @return the transformed URL\n   */\n  @Override\n  default AbsoluteUrl transform(Consumer<Uri.Transformer<?>> mutator) {\n    var transformer = thaw();\n    mutator.accept(transformer);\n    return transformer.build();\n  }\n\n  /**\n   * Parses a string into a URL.\n   *\n   * @param url the string to parse\n   * @return the parsed URL\n   * @throws IllegalAbsoluteUrl if the string is not a valid URL\n   */\n  static AbsoluteUrl parse(String url) throws IllegalAbsoluteUrl {\n    return AbsoluteUrlParser.INSTANCE.parse(url);\n  }\n\n  /**\n   * Creates a new builder with the given scheme and authority.\n   *\n   * @param scheme the scheme\n   * @param authority the authority\n   * @return a new builder\n   */\n  static AbsoluteUrl.Builder builder(Scheme scheme, Authority authority) {\n    return new AbsoluteUrlBuilder(scheme, authority);\n  }\n\n  /**\n   * Creates a builder initialized with the values from the given URL.\n   *\n   * @param url the URL to copy values from\n   * @return a new builder\n   */\n  static AbsoluteUrl.Builder builder(AbsoluteUrl url) {\n    return new AbsoluteUrlBuilder(url);\n  }\n\n  interface Builder extends UriBaseBuilder<Builder> {\n\n    Scheme getScheme();\n\n    AbsoluteUrl.Builder setScheme(Scheme scheme);\n\n    @Override\n    AbsoluteUrl build();\n  }\n\n  interface Transformer extends Url.Transformer<Transformer>, AbsoluteUri.Transformer<Transformer> {\n    @Override\n    AbsoluteUrl build();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbsoluteUrlBuilder.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\n\nfinal class AbsoluteUrlTransformer extends AbstractUriBaseBuilder<AbsoluteUrl.Transformer>\n    implements AbsoluteUrl.Transformer {\n\n  AbsoluteUrlTransformer(AbsoluteUrl url) {\n    super(url);\n  }\n\n  @Override\n  public AbsoluteUrl.Transformer setScheme(Scheme scheme) {\n    return super.doSetScheme(requireNonNull(scheme));\n  }\n\n  @Override\n  public AbsoluteUrl.Transformer setAuthority(Authority authority) {\n    return super.doSetAuthority(requireNonNull(authority));\n  }\n\n  @Override\n  public AbsoluteUrl build() {\n    return (AbsoluteUrl) super.build();\n  }\n}\n\nfinal class AbsoluteUrlBuilder extends AbstractUriBaseBuilder<AbsoluteUrl.Builder>\n    implements AbsoluteUrl.Builder {\n\n  private final Scheme nonNullScheme;\n  private final Authority nonNullAuthority;\n\n  AbsoluteUrlBuilder(Scheme scheme, Authority authority) {\n    this.scheme = scheme;\n    this.nonNullScheme = scheme;\n    this.authority = authority;\n    this.nonNullAuthority = authority;\n  }\n\n  AbsoluteUrlBuilder(AbsoluteUrl url) {\n    super(url);\n    this.nonNullScheme = url.getScheme();\n    this.nonNullAuthority = url.getAuthority();\n  }\n\n  @Override\n  public Scheme getScheme() {\n    return this.nonNullScheme;\n  }\n\n  @Override\n  public AbsoluteUrl.Builder setScheme(Scheme scheme) {\n    return super.doSetScheme(requireNonNull(scheme));\n  }\n\n  @Override\n  public Authority getAuthority() {\n    return this.nonNullAuthority;\n  }\n\n  @Override\n  public AbsoluteUrl.Builder setAuthority(Authority authority) {\n    return super.doSetAuthority(requireNonNull(authority));\n  }\n\n  @Override\n  public AbsoluteUrl build() {\n    return (AbsoluteUrl) super.build();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbsoluteUrlParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic final class AbsoluteUrlParser implements StringParser<AbsoluteUrl> {\n\n  public static final AbsoluteUrlParser INSTANCE = new AbsoluteUrlParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public AbsoluteUrlParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<AbsoluteUrl> getType() {\n    return AbsoluteUrl.class;\n  }\n\n  @Override\n  public AbsoluteUrl parse(String stringForm) throws IllegalAbsoluteUrl {\n    var uri = uriParser.parse(stringForm);\n    if (uri instanceof AbsoluteUrl absoluteUrl) {\n      return absoluteUrl;\n    } else {\n      throw new IllegalAbsoluteUrl(stringForm);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbsoluteUrlValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class AbsoluteUrlValue extends AbstractAbsoluteUrlValue<AbsoluteUrl> implements AbsoluteUrl {\n\n  AbsoluteUrlValue(\n      @Nullable String stringValue,\n      Scheme scheme,\n      Authority authority,\n      Path path,\n      @Nullable Query query,\n      @Nullable Fragment fragment) {\n    super(stringValue, scheme, authority, path, query, fragment);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbstractAbsoluteUriValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\n\nimport java.util.Objects;\nimport org.jspecify.annotations.NonNull;\nimport org.jspecify.annotations.Nullable;\n\nabstract non-sealed class AbstractAbsoluteUriValue<NORMALISED extends AbsoluteUri>\n    extends AbstractUriValue implements AbsoluteUri {\n\n  protected final Scheme nonNullScheme;\n  private final MemoisedNormalisable<AbsoluteUri> memoisedNormalisable;\n\n  AbstractAbsoluteUriValue(\n      @Nullable String stringValue,\n      Scheme scheme,\n      @Nullable Authority authority,\n      Path path,\n      @Nullable Query query,\n      @Nullable Fragment fragment) {\n    super(stringValue, scheme, authority, path, query, fragment);\n    this.nonNullScheme = requireNonNull(scheme);\n    this.memoisedNormalisable =\n        new MemoisedNormalisable<>(this, this::doIsNormalForm, this::doNormalise);\n  }\n\n  @Override\n  public Scheme getScheme() {\n    return nonNullScheme;\n  }\n\n  @Override\n  @SuppressWarnings(\"NullableProblems\")\n  public @NonNull NORMALISED normalise() {\n    return getNormalised(memoisedNormalisable.normalise());\n  }\n\n  private AbsoluteUri doNormalise() {\n    Scheme normalisedScheme = scheme != null ? scheme.normalise() : null;\n    Authority normalisedAuthority = getNormalisedAuthority(normalisedScheme);\n    Path normalisedPath = path.normalise();\n    if (normalisedPath.isEmpty()) {\n      normalisedPath = Path.ROOT;\n    }\n    Query normalisedQuery = query == null ? null : query.normalise();\n    Fragment normalisedFragment = fragment == null ? null : fragment.normalise();\n    var uri =\n        (Objects.equals(normalisedScheme, scheme)\n                && Objects.equals(normalisedAuthority, authority)\n                && Objects.equals(normalisedPath, path)\n                && Objects.equals(normalisedQuery, query)\n                && Objects.equals(normalisedFragment, fragment))\n            ? this\n            : Uri.builder()\n                .setScheme(normalisedScheme)\n                .setAuthority(normalisedAuthority)\n                .setPath(normalisedPath)\n                .setQuery(normalisedQuery)\n                .setFragment(normalisedFragment)\n                .build();\n    return getNormalised(uri);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private NORMALISED getNormalised(Uri uri) {\n    return (NORMALISED) uri;\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return memoisedNormalisable.isNormalForm();\n  }\n\n  private boolean doIsNormalForm() {\n    return AbsoluteUri.super.isNormalForm();\n  }\n\n  private @Nullable Authority getNormalisedAuthority(@Nullable Scheme normalisedScheme) {\n    if (authority == null) {\n      return null;\n    }\n    return normalisedScheme == null ? authority.normalise() : authority.normalise(normalisedScheme);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbstractAbsoluteUrlValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\n\nimport org.jspecify.annotations.Nullable;\n\nabstract class AbstractAbsoluteUrlValue<NORMALISED extends AbsoluteUrl>\n    extends AbstractAbsoluteUriValue<NORMALISED> implements AbsoluteUrl {\n\n  protected final Authority nonNullAuthority;\n\n  AbstractAbsoluteUrlValue(\n      @Nullable String stringValue,\n      Scheme scheme,\n      Authority authority,\n      Path path,\n      @Nullable Query query,\n      @Nullable Fragment fragment) {\n    super(stringValue, scheme, authority, path, query, fragment);\n    this.nonNullAuthority = requireNonNull(authority);\n\n    if (!path.isEmpty() && !path.isAbsolute()) {\n      throw new IllegalAbsoluteUrl(\n          this.toString(),\n          \"Illegal absolute url: `\"\n              + this\n              + \"` - an absolute url's path must be absolute or empty, was `\"\n              + path\n              + \"`\",\n          new IllegalPath(\n              path.toString(), \"Illegal path: `\" + path + \"` - must be absolute or empty\"));\n    }\n  }\n\n  @Override\n  public Authority getAuthority() {\n    return nonNullAuthority;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbstractUriBaseBuilder.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\n\nimport org.jspecify.annotations.Nullable;\n\nabstract class AbstractUriBaseBuilder<SELF extends UriBaseBuilder<SELF>>\n    implements UriBaseBuilder<SELF> {\n\n  protected @Nullable Scheme scheme = null;\n  protected @Nullable UserInfo userInfo = null;\n  protected @Nullable Port port = null;\n  protected @Nullable Authority authority = null;\n  protected Path path = Path.ROOT;\n  protected @Nullable Query query = null;\n  protected Query.@Nullable Builder queryBuilder = null;\n  protected @Nullable Fragment fragment = null;\n\n  AbstractUriBaseBuilder() {}\n\n  AbstractUriBaseBuilder(Uri uri) {\n    this.scheme = uri.getScheme();\n    this.authority = uri.getAuthority();\n    this.path = uri.getPath();\n    this.query = uri.getQuery();\n    this.fragment = uri.getFragment();\n  }\n\n  public @Nullable Scheme getScheme() {\n    return this.scheme;\n  }\n\n  protected SELF doSetScheme(@Nullable Scheme scheme) {\n    this.scheme = scheme;\n    return getSelf();\n  }\n\n  @Override\n  public @Nullable Authority getAuthority() {\n    return this.authority;\n  }\n\n  protected SELF doSetAuthority(@Nullable Authority authority) {\n    this.authority = authority;\n    this.userInfo = null;\n    this.port = null;\n    return getSelf();\n  }\n\n  @Override\n  public @Nullable UserInfo getUserInfo() {\n    if (this.authority == null) {\n      return this.userInfo;\n    } else {\n      return this.authority.getUserInfo();\n    }\n  }\n\n  @Override\n  public SELF setUserInfo(@Nullable UserInfo userInfo) {\n    if (this.authority == null) {\n      this.userInfo = userInfo;\n      return getSelf();\n    } else {\n      return doSetAuthority(Authority.of(userInfo, authority.getHost(), authority.getPort()));\n    }\n  }\n\n  @Override\n  public @Nullable Host getHost() {\n    return this.authority != null ? this.authority.getHost() : null;\n  }\n\n  @Override\n  public SELF setHost(Host host) {\n    if (this.authority == null) {\n      return doSetAuthority(Authority.of(userInfo, host, port));\n    } else {\n      return doSetAuthority(Authority.of(authority.getUserInfo(), host, authority.getPort()));\n    }\n  }\n\n  @Override\n  public @Nullable Port getPort() {\n    return this.authority != null ? this.authority.getPort() : null;\n  }\n\n  @Override\n  public SELF setPort(@Nullable Port port) {\n    if (this.authority == null) {\n      this.port = port;\n      return getSelf();\n    } else {\n      return doSetAuthority(Authority.of(authority.getUserInfo(), authority.getHost(), port));\n    }\n  }\n\n  @Override\n  public Path getPath() {\n    return this.path;\n  }\n\n  @Override\n  public SELF setPath(Path path) {\n    this.path = requireNonNull(path);\n    return getSelf();\n  }\n\n  @Override\n  public @Nullable Query getQuery() {\n    return this.query;\n  }\n\n  @Override\n  public SELF setQuery(@Nullable Query query) {\n    this.query = query;\n    this.queryBuilder = null;\n    return getSelf();\n  }\n\n  @Override\n  public Query.Builder getQueryBuilder() {\n    if (queryBuilder == null) {\n      queryBuilder = query != null ? new QueryBuilder(query.getEntries()) : new QueryBuilder();\n    }\n    return queryBuilder;\n  }\n\n  @Override\n  public SELF setQueryBuilder(Query.Builder query) {\n    Query built = query.build();\n    built = built.isEmpty() ? null : built;\n    return setQuery(built);\n  }\n\n  @Override\n  public @Nullable Fragment getFragment() {\n    return this.fragment;\n  }\n\n  @Override\n  public SELF setFragment(@Nullable Fragment fragment) {\n    this.fragment = fragment;\n    return getSelf();\n  }\n\n  Uri build(@Nullable String stringForm) {\n    if (authority == null && (userInfo != null || port != null)) {\n      throw new IllegalStateException(\"Cannot construct a uri with a userinfo or port but no host\");\n    }\n    if (queryBuilder != null) {\n      setQueryBuilder(queryBuilder);\n    }\n    if (scheme == null) {\n      if (authority == null && fragment == null && (path.isEmpty() || path.isAbsolute())) {\n        return new PathAndQueryValue(stringForm, path, query);\n      } else if (authority != null) {\n        return new SchemeRelativeUrlValue(stringForm, authority, path, query, fragment);\n      } else {\n        return new RelativeUrlValue(stringForm, path, query, fragment);\n      }\n    } else if (authority == null) {\n      return new OpaqueUriValue(stringForm, scheme, path, query, fragment);\n    } else {\n      if (scheme.isNormalForm()\n          && authority instanceof HostAndPort hostAndPort\n          && hostAndPort.isNormalForm(scheme)\n          && path.isEmpty()\n          && query == null\n          && fragment == null) {\n        return new OriginValue(stringForm, scheme, hostAndPort);\n      } else if (fragment == null) {\n        if (query == null && path.isBase()) {\n          return new BaseUrlValue(stringForm, scheme, authority, path);\n        }\n        return new ServersideAbsoluteUrlValue(stringForm, scheme, authority, path, query);\n      } else {\n        return new AbsoluteUrlValue(stringForm, scheme, authority, path, query, fragment);\n      }\n    }\n  }\n\n  @Override\n  public Uri build() {\n    return build(null);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  private SELF getSelf() {\n    return (SELF) this;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AbstractUriValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\nimport static org.wiremock.url.Lazy.lazy;\n\nimport java.util.List;\nimport java.util.Objects;\nimport org.jspecify.annotations.Nullable;\n\nabstract non-sealed class AbstractUriValue implements Uri {\n\n  protected final @Nullable Scheme scheme;\n  protected final @Nullable Authority authority;\n  protected final Path path;\n  protected final @Nullable Query query;\n  protected final @Nullable Fragment fragment;\n  private final Lazy<String> toString;\n\n  AbstractUriValue(\n      @Nullable String stringValue,\n      @Nullable Scheme scheme,\n      @Nullable Authority authority,\n      Path path,\n      @Nullable Query query,\n      @Nullable Fragment fragment) {\n    this.toString = lazy(stringValue, this::buildString);\n    this.scheme = scheme;\n    this.authority = authority;\n    this.path = requireNonNull(path);\n    this.query = query;\n    this.fragment = fragment;\n  }\n\n  @Override\n  public @Nullable Scheme getScheme() {\n    return scheme;\n  }\n\n  @Override\n  public @Nullable Authority getAuthority() {\n    return authority;\n  }\n\n  @Override\n  public Path getPath() {\n    return path;\n  }\n\n  @Override\n  public @Nullable Query getQuery() {\n    return query;\n  }\n\n  @Override\n  public @Nullable Fragment getFragment() {\n    return fragment;\n  }\n\n  private static final List<Class<? extends Uri>> URI_TYPES =\n      List.of(\n          Origin.class,\n          BaseUrl.class,\n          ServersideAbsoluteUrl.class,\n          AbsoluteUrl.class,\n          OpaqueUri.class,\n          SchemeRelativeUrl.class,\n          RelativeUrl.class,\n          PathAndQuery.class);\n\n  @Override\n  public boolean equals(Object obj) {\n    if (this == obj) {\n      return true;\n    }\n\n    if (!(obj instanceof Uri other)) {\n      return false;\n    }\n\n    Class<? extends Uri> oneClass = ((Uri) this).getClass();\n    Class<? extends Uri> otherClass = other.getClass();\n    return shareSameSuperTypes(oneClass, otherClass, URI_TYPES)\n        && Objects.equals(getScheme(), other.getScheme())\n        && Objects.equals(getAuthority(), other.getAuthority())\n        && Objects.equals(getPath(), other.getPath())\n        && Objects.equals(getQuery(), other.getQuery())\n        && Objects.equals(getFragment(), other.getFragment());\n  }\n\n  @SuppressWarnings(\"SameParameterValue\")\n  private static <T> boolean shareSameSuperTypes(\n      Class<? extends T> oneClass, Class<? extends T> otherClass, List<Class<? extends T>> types) {\n    for (Class<?> type : types) {\n      if (oneClass.isAssignableFrom(type) != otherClass.isAssignableFrom(type)) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(getScheme(), getAuthority(), getPath(), query, getFragment());\n  }\n\n  @Override\n  public String toString() {\n    return toString.get();\n  }\n\n  private String buildString() {\n    StringBuilder result = new StringBuilder();\n    if (getScheme() != null) {\n      result.append(getScheme()).append(\":\");\n    }\n    if (getAuthority() != null) {\n      result.append(\"//\").append(getAuthority());\n    }\n    result.append(getPath());\n    if (query != null) {\n      result.append(\"?\").append(query);\n    }\n    if (getFragment() != null) {\n      result.append(\"#\").append(getFragment());\n    }\n    return result.toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AppendableTo.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.stream.IntStream;\n\ninterface AppendableTo {\n\n  void appendTo(StringBuilder builder);\n}\n\n@SuppressWarnings(\"unused\")\nclass AppendableToAwareStringBuilder implements CharSequence {\n\n  final StringBuilder delegate = new StringBuilder();\n\n  @SuppressWarnings(\"UnusedReturnValue\")\n  AppendableToAwareStringBuilder append(AppendableTo appendableTo) {\n    appendableTo.appendTo(delegate);\n    return this;\n  }\n\n  @Override\n  public String toString() {\n    return delegate.toString();\n  }\n\n  @SuppressWarnings(\"unused\")\n  public int compareTo(StringBuilder another) {\n    return delegate.compareTo(another);\n  }\n\n  public int indexOf(String str) {\n    return delegate.indexOf(str);\n  }\n\n  @Override\n  public IntStream chars() {\n    return delegate.chars();\n  }\n\n  public int codePointBefore(int index) {\n    return delegate.codePointBefore(index);\n  }\n\n  public AppendableToAwareStringBuilder insert(int dstOffset, CharSequence s, int start, int end) {\n    delegate.insert(dstOffset, s, start, end);\n    return this;\n  }\n\n  @Override\n  public CharSequence subSequence(int start, int end) {\n    return delegate.subSequence(start, end);\n  }\n\n  public int capacity() {\n    return delegate.capacity();\n  }\n\n  public AppendableToAwareStringBuilder deleteCharAt(int index) {\n    delegate.deleteCharAt(index);\n    return this;\n  }\n\n  public int offsetByCodePoints(int index, int codePointOffset) {\n    return delegate.offsetByCodePoints(index, codePointOffset);\n  }\n\n  public AppendableToAwareStringBuilder append(char[] str, int offset, int len) {\n    delegate.append(str, offset, len);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder insert(int offset, float f) {\n    delegate.insert(offset, f);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder insert(int offset, char[] str) {\n    delegate.insert(offset, str);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder appendCodePoint(int codePoint) {\n    delegate.appendCodePoint(codePoint);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder reverse() {\n    delegate.reverse();\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder insert(int offset, String str) {\n    delegate.insert(offset, str);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder append(double d) {\n    delegate.append(d);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder append(long lng) {\n    delegate.append(lng);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder append(CharSequence s) {\n    delegate.append(s);\n    return this;\n  }\n\n  public void setCharAt(int index, char ch) {\n    delegate.setCharAt(index, ch);\n  }\n\n  public void setLength(int newLength) {\n    delegate.setLength(newLength);\n  }\n\n  public int lastIndexOf(String str) {\n    return delegate.lastIndexOf(str);\n  }\n\n  public AppendableToAwareStringBuilder append(int i) {\n    delegate.append(i);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder insert(int index, char[] str, int offset, int len) {\n    delegate.insert(index, str, offset, len);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder insert(int offset, char c) {\n    delegate.insert(offset, c);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder append(Object obj) {\n    delegate.append(obj);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder append(char c) {\n    delegate.append(c);\n    return this;\n  }\n\n  public int codePointAt(int index) {\n    return delegate.codePointAt(index);\n  }\n\n  public AppendableToAwareStringBuilder append(boolean b) {\n    delegate.append(b);\n    return this;\n  }\n\n  public String substring(int start) {\n    return delegate.substring(start);\n  }\n\n  public AppendableToAwareStringBuilder replace(int start, int end, String str) {\n    delegate.replace(start, end, str);\n    return this;\n  }\n\n  @Override\n  public int length() {\n    return delegate.length();\n  }\n\n  public AppendableToAwareStringBuilder insert(int dstOffset, CharSequence s) {\n    delegate.insert(dstOffset, s);\n    return this;\n  }\n\n  @Override\n  public IntStream codePoints() {\n    return delegate.codePoints();\n  }\n\n  public AppendableToAwareStringBuilder insert(int offset, double d) {\n    delegate.insert(offset, d);\n    return this;\n  }\n\n  public int codePointCount(int beginIndex, int endIndex) {\n    return delegate.codePointCount(beginIndex, endIndex);\n  }\n\n  @Override\n  public boolean isEmpty() {\n    return delegate.isEmpty();\n  }\n\n  public AppendableToAwareStringBuilder append(char[] str) {\n    delegate.append(str);\n    return this;\n  }\n\n  public void ensureCapacity(int minimumCapacity) {\n    delegate.ensureCapacity(minimumCapacity);\n  }\n\n  public String substring(int start, int end) {\n    return delegate.substring(start, end);\n  }\n\n  public AppendableToAwareStringBuilder delete(int start, int end) {\n    delegate.delete(start, end);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder insert(int offset, long l) {\n    delegate.insert(offset, l);\n    return this;\n  }\n\n  public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) {\n    delegate.getChars(srcBegin, srcEnd, dst, dstBegin);\n  }\n\n  public AppendableToAwareStringBuilder append(float f) {\n    delegate.append(f);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder insert(int offset, int i) {\n    delegate.insert(offset, i);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder append(CharSequence s, int start, int end) {\n    delegate.append(s, start, end);\n    return this;\n  }\n\n  public void trimToSize() {\n    delegate.trimToSize();\n  }\n\n  public AppendableToAwareStringBuilder insert(int offset, Object obj) {\n    delegate.insert(offset, obj);\n    return this;\n  }\n\n  public int lastIndexOf(String str, int fromIndex) {\n    return delegate.lastIndexOf(str, fromIndex);\n  }\n\n  public AppendableToAwareStringBuilder append(StringBuffer sb) {\n    delegate.append(sb);\n    return this;\n  }\n\n  @Override\n  public char charAt(int index) {\n    return delegate.charAt(index);\n  }\n\n  public AppendableToAwareStringBuilder insert(int offset, boolean b) {\n    delegate.insert(offset, b);\n    return this;\n  }\n\n  public AppendableToAwareStringBuilder append(String str) {\n    delegate.append(str);\n    return this;\n  }\n\n  public int indexOf(String str, int fromIndex) {\n    return delegate.indexOf(str, fromIndex);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Authority.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\nimport java.util.Optional;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents the authority component of a URI as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.2\">RFC 3986 Section 3.2</a>.\n *\n * <p>The authority component consists of optional user information, a host, and an optional port.\n * It typically takes the form {@code [userinfo@]host[:port]}.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.2\">RFC 3986 Section 3.2</a>\n */\npublic interface Authority extends Normalisable<Authority>, ParsedString {\n\n  /**\n   * Returns the user info component, or {@code null} if there is no user info.\n   *\n   * @return the user info, or {@code null} if absent\n   */\n  @Nullable UserInfo getUserInfo();\n\n  /**\n   * Returns the host component.\n   *\n   * @return the host, never {@code null}\n   */\n  Host getHost();\n\n  /**\n   * Returns the port component, or {@code null} if there is no port.\n   *\n   * @return the port, or {@code null} if absent\n   */\n  @Nullable Port getPort();\n\n  /**\n   * Returns an optional representation of the port to distinguish between no port and empty port.\n   *\n   * <p>An Authority can legitimately be any of:\n   *\n   * <ul>\n   *   <li>{@code example.com} - no port (returns {@code null})\n   *   <li>{@code example.com:} - empty port (returns {@code Optional.empty()})\n   *   <li>{@code example.com:80} - with port (returns {@code Optional.of(port)})\n   * </ul>\n   *\n   * @return {@code null} for no port, {@code Optional.empty()} for empty port, or {@code\n   *     Optional.of(port)} for a port value\n   */\n  @Nullable Optional<Port> getMaybePort();\n\n  /**\n   * Returns the host and port as a {@link HostAndPort}.\n   *\n   * @return the host and port\n   */\n  HostAndPort getHostAndPort();\n\n  /**\n   * Returns a new authority with the specified port.\n   *\n   * @param port the port to set, or {@code null} to remove it\n   * @return a new authority with the updated port\n   */\n  Authority withPort(@Nullable Port port);\n\n  /**\n   * Returns a new authority with the port removed.\n   *\n   * @return a new authority without a port\n   */\n  default Authority withoutPort() {\n    return withPort(null);\n  }\n\n  /**\n   * Returns a normalised form of this authority using scheme-specific normalization rules.\n   *\n   * <p>The scheme is used to determine if the port should be removed when it matches the default\n   * port for that scheme.\n   *\n   * @param canonicalScheme the canonical scheme to use for normalization\n   * @return a normalised authority\n   */\n  Authority normalise(Scheme canonicalScheme);\n\n  @Override\n  default boolean isNormalForm() {\n    Optional<Port> maybePort = getMaybePort();\n    //noinspection OptionalAssignedToNull\n    return (getUserInfo() == null || getUserInfo().isNormalForm())\n        && getHost().isNormalForm()\n        && (maybePort == null || (maybePort.isPresent() && maybePort.get().isNormalForm()));\n  }\n\n  /**\n   * Tests if this value is already normalised\n   *\n   * @param canonicalScheme the scheme to be in normal form against\n   * @return true if in normal form for this scheme\n   */\n  default boolean isNormalForm(Scheme canonicalScheme) {\n    return getHost().isNormalForm() && portIsNormalForm(canonicalScheme);\n  }\n\n  private boolean portIsNormalForm(Scheme scheme) {\n    Optional<Port> maybePort = getMaybePort();\n    //noinspection OptionalAssignedToNull\n    return maybePort == null\n        || (maybePort.isPresent()\n            && maybePort.get().isNormalForm()\n            && !maybePort.get().equals(scheme.getDefaultPort()));\n  }\n\n  /**\n   * Parses a string into an authority.\n   *\n   * @param authorityStr the string to parse\n   * @return the parsed authority\n   * @throws IllegalAuthority if the string is not a valid authority\n   */\n  static Authority parse(String authorityStr) throws IllegalAuthority {\n    return AuthorityParser.INSTANCE.parse(authorityStr);\n  }\n\n  /**\n   * Creates an authority from a host.\n   *\n   * @param host the host\n   * @return the authority\n   */\n  static Authority of(Host host) {\n    return of(null, host, null);\n  }\n\n  /**\n   * Creates an authority from a host and port.\n   *\n   * @param host the host\n   * @param port the port, or {@code null}\n   * @return the authority\n   */\n  static Authority of(Host host, @Nullable Port port) {\n    return of(null, host, port);\n  }\n\n  /**\n   * Creates an authority from user info and host.\n   *\n   * @param userInfo the user info, or {@code null}\n   * @param host the host\n   * @return the authority\n   */\n  static Authority of(@Nullable UserInfo userInfo, Host host) {\n    return of(userInfo, host, null);\n  }\n\n  /**\n   * Creates an authority from user info, host, and port.\n   *\n   * @param userInfo the user info, or {@code null}\n   * @param host the host\n   * @param port the port, or {@code null}\n   * @return the authority\n   */\n  static Authority of(@Nullable UserInfo userInfo, Host host, @Nullable Port port) {\n    return AuthorityParser.INSTANCE.of(userInfo, host, port);\n  }\n\n  static boolean equals(Authority one, Object o) {\n    if (one == o) {\n      return true;\n    }\n\n    if (!(o instanceof Authority other)) {\n      return false;\n    }\n\n    return Objects.equals(one.getUserInfo(), other.getUserInfo())\n        && Objects.equals(one.getHost(), other.getHost())\n        && Objects.equals(one.getMaybePort(), other.getMaybePort());\n  }\n\n  static int hashCode(Authority authority) {\n    return Objects.hash(authority.getUserInfo(), authority.getHost(), authority.getMaybePort());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AuthorityParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.HostParser.hostRegex;\nimport static org.wiremock.url.UserInfoParser.userInfoRegex;\n\nimport java.util.Optional;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.StringParser;\n\npublic final class AuthorityParser implements StringParser<Authority> {\n\n  public static final AuthorityParser INSTANCE = new AuthorityParser();\n\n  static final String authorityRegex =\n      \"(?:(?<userInfo>\"\n          + userInfoRegex\n          + \")@)?(?<host>\"\n          + hostRegex\n          + \")(?<colonAndPort>:(?<port>[0-9]+)?)?\";\n\n  private final Pattern authorityPattern = Pattern.compile(\"^\" + authorityRegex + \"$\");\n\n  @Override\n  public Class<Authority> getType() {\n    return Authority.class;\n  }\n\n  @Override\n  public Authority parse(String stringForm) throws IllegalAuthority {\n    var matcher = authorityPattern.matcher(stringForm);\n    if (matcher.matches()) {\n      return parse(matcher, stringForm);\n    } else {\n      throw new IllegalAuthority(stringForm);\n    }\n  }\n\n  Authority parse(Matcher matcher, String rawAuthority) throws IllegalAuthority {\n    try {\n      String userInfoString = matcher.group(\"userInfo\");\n      var userInfo = userInfoString == null ? null : UserInfoParser.INSTANCE.parse(userInfoString);\n      var hostString = matcher.group(\"host\");\n      var host = HostParser.INSTANCE.parse(hostString);\n      Optional<Port> maybePort = extractPort(matcher);\n      //noinspection OptionalAssignedToNull\n      if (userInfo == null && (maybePort == null || maybePort.isPresent())) {\n        //noinspection OptionalAssignedToNull\n        return HostAndPort.of(host, maybePort != null ? maybePort.orElse(null) : null);\n      } else {\n        return new AuthorityValue(rawAuthority, userInfo, host, maybePort);\n      }\n    } catch (IllegalUriPart cause) {\n      throw new IllegalAuthority(rawAuthority, cause);\n    }\n  }\n\n  Authority of(@Nullable UserInfo userInfo, Host host, @Nullable Port port) {\n    if (userInfo == null) {\n      return HostAndPort.of(host, port);\n    } else {\n      @SuppressWarnings(\"OptionalAssignedToNull\")\n      var portOptional = port != null ? Optional.of(port) : null;\n      return new AuthorityValue(userInfo, host, portOptional);\n    }\n  }\n\n  private static @Nullable Optional<Port> extractPort(Matcher matcher) {\n    String colonAndPort = matcher.group(\"colonAndPort\");\n    if (colonAndPort == null) {\n      //noinspection OptionalAssignedToNull\n      return null;\n    } else {\n      String portString = matcher.group(\"port\");\n      return portString != null ? Optional.of(Port.parse(portString)) : Optional.empty();\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/AuthorityValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\nimport static org.wiremock.url.Lazy.lazy;\n\nimport java.util.Objects;\nimport java.util.Optional;\nimport org.jspecify.annotations.Nullable;\n\n@SuppressWarnings({\"OptionalUsedAsFieldOrParameterType\"})\nfinal class AuthorityValue implements Authority {\n\n  private final @Nullable UserInfo userInfo;\n  private final Host host;\n  private final @Nullable Optional<Port> maybePort;\n  private final Lazy<String> toString;\n\n  AuthorityValue(@Nullable UserInfo userInfo, Host host, @Nullable Optional<Port> maybePort) {\n    this(null, userInfo, host, maybePort);\n  }\n\n  AuthorityValue(\n      @Nullable String stringValue,\n      @Nullable UserInfo userInfo,\n      Host host,\n      @Nullable Optional<Port> maybePort) {\n    this.toString = lazy(stringValue, this::buildString);\n    this.userInfo = userInfo;\n    this.host = requireNonNull(host);\n    this.maybePort = maybePort;\n  }\n\n  @Override\n  public @Nullable Port getPort() {\n    //noinspection OptionalAssignedToNull\n    return maybePort != null ? maybePort.orElse(null) : null;\n  }\n\n  @Override\n  @Nullable\n  public Optional<Port> getMaybePort() {\n    return maybePort;\n  }\n\n  @Override\n  public String toString() {\n    return toString.get();\n  }\n\n  private String buildString() {\n    StringBuilder result = new StringBuilder();\n    if (userInfo != null) {\n      result.append(userInfo).append('@');\n    }\n    result.append(host);\n\n    //noinspection OptionalAssignedToNull\n    if (maybePort != null) {\n      result.append(':');\n      maybePort.ifPresent(result::append);\n    }\n    return result.toString();\n  }\n\n  @Override\n  public HostAndPort getHostAndPort() {\n    return HostAndPort.of(host, getPort());\n  }\n\n  @Override\n  public Authority withPort(@Nullable Port port) {\n    @SuppressWarnings(\"OptionalAssignedToNull\")\n    Optional<Port> newPort = port != null ? Optional.of(port) : null;\n    if (Objects.equals(newPort, maybePort)) {\n      return this;\n    } else {\n      return new AuthorityValue(userInfo, host, newPort);\n    }\n  }\n\n  @Override\n  public Authority normalise() {\n    var normalisedPort = normalisePort();\n    return buildNormalisedAuthority(normalisedPort);\n  }\n\n  @Override\n  public Authority normalise(Scheme canonicalScheme) {\n    var normalisedPort = normalisePort(canonicalScheme);\n    return buildNormalisedAuthority(normalisedPort);\n  }\n\n  private @Nullable Port normalisePort(Scheme canonicalScheme) {\n    var normalisedPort = normalisePort();\n    return Objects.equals(normalisedPort, canonicalScheme.getDefaultPort()) ? null : normalisedPort;\n  }\n\n  private @Nullable Port normalisePort() {\n    var port = getPort();\n    return port != null ? port.normalise() : null;\n  }\n\n  private Authority buildNormalisedAuthority(@Nullable Port normalisedPort) {\n    var normalisedUserInfo = userInfo != null ? userInfo.normalise() : null;\n    var normalisedHost = host.normalise();\n    @SuppressWarnings(\"OptionalAssignedToNull\")\n    var optionalNormalisedPort = normalisedPort != null ? Optional.of(normalisedPort) : null;\n    if (Objects.equals(normalisedUserInfo, userInfo)\n        && normalisedHost.equals(host)\n        && Objects.equals(optionalNormalisedPort, maybePort)) {\n      return this;\n    } else if (normalisedUserInfo == null) {\n      return HostAndPort.of(normalisedHost, normalisedPort);\n    } else {\n      return new AuthorityValue(normalisedUserInfo, normalisedHost, optionalNormalisedPort);\n    }\n  }\n\n  @Override\n  public @Nullable UserInfo getUserInfo() {\n    return userInfo;\n  }\n\n  @Override\n  public Host getHost() {\n    return host;\n  }\n\n  @Override\n  @SuppressWarnings(\"EqualsDoesntCheckParameterClass\")\n  public boolean equals(Object other) {\n    return Authority.equals(this, other);\n  }\n\n  @Override\n  public int hashCode() {\n    return Authority.hashCode(this);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/BaseUrl.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\n/**\n * A base url is a url whose path is either empty or ends with a slash, and which has neither a\n * query nor a fragment.\n *\n * <p>You can always resolve a relative path (and query and fragment) onto it and it will\n * effectively be appended to the base url:\n *\n * <ul>\n *   <li>{@code https://example.com resolve some/path?q#f == https://example.com/some/path?q#f}\n *   <li>{@code https://example.com/base/path/ resolve some/path?q#f ==\n *       https://example.com/base/path/some/path?q#f}\n * </ul>\n */\npublic interface BaseUrl extends ServersideAbsoluteUrl {\n\n  /**\n   * Returns a normalised form of this base url\n   *\n   * @return a normalised base url\n   */\n  @Override\n  BaseUrl normalise();\n\n  /**\n   * Returns this.\n   *\n   * @return this\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default BaseUrl getServersideAbsoluteUrl() {\n    return this;\n  }\n\n  /**\n   * Implementations must ALWAYS return null\n   *\n   * @deprecated This always returns null so you have no reason to ever call it\n   * @return null\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  @Nullable\n  default Query getQuery() {\n    return null;\n  }\n\n  /**\n   * Returns this.\n   *\n   * @return this\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default BaseUrl toBaseUrl() {\n    return this;\n  }\n\n  /**\n   * Parses a string into a base url.\n   *\n   * @param baseUrl the string to parse\n   * @return the parsed base url\n   * @throws IllegalBaseUrl if the string is not a valid base url\n   */\n  static BaseUrl parse(String baseUrl) throws IllegalBaseUrl {\n    return BaseUrlParser.INSTANCE.parse(baseUrl);\n  }\n\n  static BaseUrl of(Scheme scheme, Authority authority) {\n    return of(scheme, authority, Path.EMPTY);\n  }\n\n  static BaseUrl of(Scheme scheme, Authority authority, Path path) {\n    return new BaseUrlValue(null, scheme, authority, path);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/BaseUrlParser.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic class BaseUrlParser implements StringParser<BaseUrl> {\n\n  public static final BaseUrlParser INSTANCE = new BaseUrlParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public BaseUrlParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<BaseUrl> getType() {\n    return BaseUrl.class;\n  }\n\n  @Override\n  public BaseUrl parse(String stringForm) throws IllegalBaseUrl {\n    var uri = uriParser.parse(stringForm);\n    if (uri instanceof BaseUrl baseUrl) {\n      return baseUrl;\n    } else {\n      throw new IllegalBaseUrl(\n          stringForm,\n          \"Illegal base url: `\"\n              + stringForm\n              + \"`; path must be a base path (empty or end in `/`), query must be null, fragment must be null\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/BaseUrlValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic class BaseUrlValue extends AbstractAbsoluteUrlValue<BaseUrlValue> implements BaseUrl {\n\n  BaseUrlValue(@Nullable String stringValue, Scheme scheme, Authority authority, Path path) {\n    super(stringValue, scheme, authority, path, null, null);\n    if (!path.isBase()) {\n      throw new IllegalBaseUrl(\n          toString(),\n          \"Illegal base url: `\" + this + \"`; path must be a base path (empty or end in `/`)\",\n          new IllegalPath(path.toString(), \"Path must be a base path (empty or end in `/`)\"));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/CodePointDomain.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\n\nimport java.util.Arrays;\n\nsealed interface CodePointOrHexCodePoint extends AppendableTo {\n  CodePoint decode();\n\n  boolean isEncoded();\n}\n\nsealed interface HexCodePoint extends CodePointOrHexCodePoint {\n\n  @Override\n  CodePoint decode();\n\n  @Override\n  default boolean isEncoded() {\n    return true;\n  }\n\n  HexCodePoint toUpperCase();\n\n  boolean isUpperCase();\n\n  static int hexDigitToInt(char c) {\n    if (c >= '0' && c <= '9') {\n      return c - '0';\n    } else if (c >= 'A' && c <= 'F') {\n      return c - 'A' + 10;\n    } else if (c >= 'a' && c <= 'f') {\n      return c - 'a' + 10;\n    }\n    throw new IllegalArgumentException(\"Invalid hex digit: \" + c);\n  }\n}\n\nrecord CodePoint(int codePoint) implements CodePointOrHexCodePoint {\n\n  @Override\n  public boolean isEncoded() {\n    return false;\n  }\n\n  public CodePointOrHexCodePoint maybePercentEncode(boolean[] charactersThatDoNotNeedEncoding) {\n    if (isIn(charactersThatDoNotNeedEncoding)) {\n      return this;\n    } else {\n      return percentEncode();\n    }\n  }\n\n  private HexCodePoint percentEncode() {\n    int codePoint = codePoint();\n    String str = new String(Character.toChars(codePoint));\n    byte[] bytes = str.getBytes(UTF_8);\n    HexCharacter[] hexCharacters = new HexCharacter[bytes.length];\n    for (int i = 0; i < bytes.length; i++) {\n      hexCharacters[i] = getHexCharacter(bytes[i]);\n    }\n    return new HexSequence(hexCharacters);\n  }\n\n  private static HexCharacter getHexCharacter(byte aByte) {\n    int byteValue = aByte & 0xFF;\n    return new HexCharacter(toHexDigit(byteValue >> 4), toHexDigit(byteValue & 0x0F));\n  }\n\n  static char toHexDigit(int value) {\n    return (char) (value < 10 ? '0' + value : 'A' + value - 10);\n  }\n\n  public boolean isIn(boolean[] charactersThatDoNotNeedEncoding) {\n    return codePoint < charactersThatDoNotNeedEncoding.length\n        && charactersThatDoNotNeedEncoding[codePoint];\n  }\n\n  @Override\n  public String toString() {\n    return new String(Character.toChars(codePoint));\n  }\n\n  @Override\n  public CodePoint decode() {\n    return this;\n  }\n\n  @Override\n  public void appendTo(StringBuilder builder) {\n    builder.appendCodePoint(codePoint);\n  }\n}\n\nfinal class HexSequence implements HexCodePoint {\n\n  private final HexCharacter[] hexChars;\n\n  HexSequence(HexCharacter[] hexChars) {\n    this.hexChars = hexChars;\n    if (hexChars.length == 0 || hexChars.length > 4) {\n      throw new IllegalArgumentException(\n          \"hex sequence must be 1-4 hex characters, was \" + Arrays.toString(hexChars));\n    }\n  }\n\n  @Override\n  public CodePoint decode() {\n    byte[] bytes = new byte[hexChars.length];\n    for (int i = 0; i < hexChars.length; i++) {\n      HexCharacter hc = hexChars[i];\n      bytes[i] =\n          (byte)\n              ((HexCodePoint.hexDigitToInt(hc.digit1()) << 4)\n                  | HexCodePoint.hexDigitToInt(hc.digit2()));\n    }\n\n    // Convert UTF-8 bytes to String, then get the code point\n    String decoded = new String(bytes, UTF_8);\n    int codePoint = decoded.codePointAt(0);\n    return new CodePoint(codePoint);\n  }\n\n  @Override\n  public HexSequence toUpperCase() {\n    HexCharacter[] upper = new HexCharacter[hexChars.length];\n    boolean changed = false;\n    for (int i = 0; i < hexChars.length; i++) {\n      var original = hexChars[i];\n      var upperCase = original.toUpperCase();\n      if (!upperCase.equals(original)) {\n        changed = true;\n      }\n      upper[i] = upperCase;\n    }\n    if (changed) {\n      return new HexSequence(upper);\n    } else {\n      return this;\n    }\n  }\n\n  @Override\n  public boolean isUpperCase() {\n    for (HexCharacter hexChar : hexChars) {\n      if (!hexChar.isUpperCase()) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  @Override\n  public String toString() {\n    StringBuilder sb = new StringBuilder();\n    for (HexCharacter hexChar : hexChars) {\n      sb.append(hexChar);\n    }\n    return sb.toString();\n  }\n\n  @Override\n  public void appendTo(StringBuilder builder) {\n    for (HexCharacter hexChar : hexChars) {\n      hexChar.appendTo(builder);\n    }\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (this == obj) {\n      return true;\n    }\n    if (!(obj instanceof HexSequence that)) {\n      return false;\n    }\n    return Arrays.equals(this.hexChars, that.hexChars);\n  }\n\n  @Override\n  public int hashCode() {\n    return Arrays.hashCode(hexChars);\n  }\n}\n\nrecord HexCharacter(char digit1, char digit2) implements HexCodePoint {\n  @Override\n  public CodePoint decode() {\n    return new CodePoint(\n        (char) ((HexCodePoint.hexDigitToInt(digit1) << 4) | HexCodePoint.hexDigitToInt(digit2)));\n  }\n\n  @Override\n  public HexCharacter toUpperCase() {\n    var char1Upper = Character.toUpperCase(digit1);\n    var char2Upper = Character.toUpperCase(digit2);\n    if (char1Upper == digit1 && char2Upper == digit2) {\n      return this;\n    } else {\n      return new HexCharacter(char1Upper, char2Upper);\n    }\n  }\n\n  @SuppressWarnings(\"BooleanMethodIsAlwaysInverted\")\n  @Override\n  public boolean isUpperCase() {\n    return isUpperCaseHexDigit(digit1) && isUpperCaseHexDigit(digit2);\n  }\n\n  @Override\n  public String toString() {\n    return new String(new char[] {'%', digit1, digit2});\n  }\n\n  @Override\n  public void appendTo(StringBuilder builder) {\n    builder.append('%').append(digit1).append(digit2);\n  }\n\n  private static boolean isUpperCaseHexDigit(char c) {\n    return Character.isUpperCase(c) || Character.isDigit(c);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/CodePointStream.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nclass CodePointStream extends StringTokenStream<CodePoint> {\n\n  CodePointStream(String input) {\n    super(input);\n  }\n\n  @Override\n  public CodePoint next() {\n    int codePoint = input.codePointAt(index);\n    index += Character.charCount(codePoint);\n    return new CodePoint(codePoint);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Constants.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.regex.Pattern;\nimport org.intellij.lang.annotations.Language;\n\nfinal class Constants {\n\n  @Language(\"RegExp\")\n  static final String unreserved = \"-a-zA-Z0-9\\\\._~\";\n\n  static final boolean[] empty = new boolean[0];\n\n  static final boolean[] unreservedCharSet =\n      combine(\n          includeRange('a', 'z'),\n          includeRange('A', 'Z'),\n          includeRange('0', '9'),\n          include('-', '.', '_', '~'));\n\n  @Language(\"RegExp\")\n  static final String pctEncoded = \"%[0-9a-fA-F]{2}\";\n\n  static final Pattern pctEncodedPattern = Pattern.compile(pctEncoded);\n  static final Pattern multiplePctEncodedPattern = Pattern.compile(\"(?:\" + pctEncoded + \")+\");\n\n  @Language(\"RegExp\")\n  static final String subDelims = \"!\\\\$&'\\\\(\\\\)\\\\*\\\\+,;=\";\n\n  static final boolean[] subDelimCharSet =\n      include('!', '$', '&', '\\'', '(', ')', '*', '+', ',', ';', '=');\n\n  @Language(\"RegExp\")\n  static final String alwaysIllegal =\n      \"\\\\u0000-\\\\u0008\\\\u000A-\\\\u001F\\\\u007F\\\\u0080-\\\\u009F\\\\uD800-\\\\uDFFF\";\n\n  static final boolean[] pcharCharSet =\n      combine(unreservedCharSet, subDelimCharSet, include(':', '@'));\n\n  static boolean[] combine(boolean[] one, boolean[]... charSets) {\n    int length = one.length;\n    for (boolean[] charSet : charSets) {\n      length = Math.max(length, charSet.length);\n    }\n    boolean[] result = new boolean[length];\n    System.arraycopy(one, 0, result, 0, one.length);\n    for (boolean[] charSet : charSets) {\n      for (int i = 0; i < charSet.length; i++) {\n        result[i] = result[i] || charSet[i];\n      }\n    }\n    return result;\n  }\n\n  static boolean[] include(char... chars) {\n    boolean[] charSet = new boolean[128];\n    for (char aChar : chars) {\n      charSet[aChar] = true;\n    }\n    return charSet;\n  }\n\n  static boolean[] includeRange(char start, char end) {\n    boolean[] charSet = new boolean[128];\n    for (int i = start; i <= end; i++) {\n      charSet[i] = true;\n    }\n    return charSet;\n  }\n\n  static boolean[] remove(boolean[] original, char... toRemove) {\n    boolean[] result = new boolean[original.length];\n    System.arraycopy(original, 0, result, 0, original.length);\n    for (char c : toRemove) {\n      result[c] = false;\n    }\n    return result;\n  }\n\n  private Constants() {\n    throw new UnsupportedOperationException(\"Not instantiable\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/DefaultSchemeRegistry.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Locale;\nimport java.util.Map;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.regex.Pattern;\nimport org.jspecify.annotations.Nullable;\n\npublic final class DefaultSchemeRegistry implements SchemeRegistry {\n\n  static final Pattern schemeRegex = Pattern.compile(\"[a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n\n  private final Map<String, Scheme> knownSchemes = new ConcurrentHashMap<>();\n\n  @Override\n  public Scheme register(String schemeString, @Nullable Port defaultPort) throws IllegalScheme {\n    if (!schemeRegex.matcher(schemeString).matches()) {\n      throw new IllegalScheme(schemeString);\n    }\n    String canonicalSchemeString = schemeString.toLowerCase(Locale.ROOT);\n    return knownSchemes.computeIfAbsent(\n        canonicalSchemeString, (key) -> new SchemeValue(key, null, defaultPort));\n  }\n\n  @Override\n  public Scheme parse(String schemeString) throws IllegalScheme {\n    Scheme canonicalScheme = getCanonicalScheme(schemeString);\n    if (canonicalScheme.toString().equals(schemeString)) {\n      return canonicalScheme;\n    } else {\n      return new SchemeValue(schemeString, canonicalScheme, null);\n    }\n  }\n\n  private Scheme getCanonicalScheme(String schemeString) throws IllegalScheme {\n    String canonicalSchemeString = schemeString.toLowerCase(Locale.ROOT);\n    var existingCanonical = knownSchemes.get(canonicalSchemeString);\n    if (existingCanonical != null) {\n      return existingCanonical;\n    } else if (!schemeRegex.matcher(schemeString).matches()) {\n      throw new IllegalScheme(schemeString);\n    } else {\n      return new SchemeValue(canonicalSchemeString, null, null);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Fragment.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents the fragment component of a URI as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.5\">RFC 3986 Section 3.5</a>.\n *\n * <p>The fragment identifier provides direction to a secondary resource, such as a section within a\n * document. Fragments are not sent to the server but are used by the client. Fragment strings may\n * contain percent-encoded characters.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.5\">RFC 3986 Section 3.5</a>\n */\npublic interface Fragment extends PercentEncoded<Fragment>, ParsedString {\n\n  Fragment EMPTY = new FragmentValue(\"\", true);\n\n  /**\n   * Returns a normalised form of this fragment.\n   *\n   * @return a normalised fragment\n   */\n  @Override\n  Fragment normalise();\n\n  /**\n   * Parses a string into a fragment.\n   *\n   * @param fragment the string to parse\n   * @return the parsed fragment\n   * @throws IllegalFragment if the string is not a valid fragment\n   */\n  static Fragment parse(String fragment) throws IllegalFragment {\n    return FragmentParser.INSTANCE.parse(fragment);\n  }\n\n  /**\n   * Encodes a string into a valid fragment with proper percent-encoding.\n   *\n   * @param unencoded the unencoded string\n   * @return the encoded fragment\n   */\n  static Fragment encode(String unencoded) {\n    return FragmentParser.INSTANCE.encode(unencoded);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/FragmentParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.*;\n\npublic final class FragmentParser implements PercentEncodedStringParser<Fragment> {\n\n  public static final FragmentParser INSTANCE = new FragmentParser();\n\n  @Override\n  public Class<Fragment> getType() {\n    return Fragment.class;\n  }\n\n  @Override\n  public Fragment parse(String stringForm) {\n    if (stringForm.isEmpty()) {\n      return Fragment.EMPTY;\n    } else {\n      return new FragmentValue(stringForm);\n    }\n  }\n\n  static final boolean[] fragmentCharSet = combine(pcharCharSet, include('/', '?'));\n\n  @Override\n  public Fragment encode(String unencoded) {\n    if (unencoded.isEmpty()) {\n      return Fragment.EMPTY;\n    } else {\n      var result = PercentEncoding.encode(unencoded, fragmentCharSet);\n      return new FragmentValue(result, true);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/FragmentValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\nimport org.jspecify.annotations.Nullable;\n\nfinal class FragmentValue implements Fragment {\n\n  private final String fragment;\n  private final MemoisedNormalisable<Fragment> memoisedNormalisable;\n\n  FragmentValue(String fragment) {\n    this(fragment, null);\n  }\n\n  FragmentValue(String fragment, @Nullable Boolean isNormalForm) {\n    this.fragment = fragment;\n    this.memoisedNormalisable =\n        new MemoisedNormalisable<>(this, isNormalForm, this::isNormalFormWork, this::normaliseWork);\n  }\n\n  @Override\n  public String toString() {\n    return fragment;\n  }\n\n  @Override\n  public Fragment normalise() {\n    return memoisedNormalisable.normalise();\n  }\n\n  private @Nullable Fragment normaliseWork() {\n    String result = PercentEncoding.simpleNormalise(fragment, FragmentParser.fragmentCharSet);\n    return result != null ? new FragmentValue(result, true) : null;\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return memoisedNormalisable.isNormalForm();\n  }\n\n  private boolean isNormalFormWork() {\n    return PercentEncoding.isSimpleNormalForm(fragment, FragmentParser.fragmentCharSet);\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof Fragment that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(fragment);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Host.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents the host component of a URI as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2\">RFC 3986 Section 3.2.2</a>.\n *\n * <p>A host can be an IP address (IPv4 or IPv6), a registered name (domain name), or an IPvFuture\n * address. Registered names may contain percent-encoded characters.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2\">RFC 3986 Section\n *     3.2.2</a>\n */\npublic interface Host extends PercentEncoded<Host>, ParsedString {\n\n  Host EMPTY = new HostValue(\"\", true);\n  Host LOCALHOST = new HostValue(\"localhost\", true);\n\n  /**\n   * Returns a normalised form of this host.\n   *\n   * <p>Normalization includes converting registered names to lowercase and normalizing\n   * percent-encoding.\n   *\n   * @return a normalised host\n   */\n  @Override\n  Host normalise();\n\n  /**\n   * Parses a string into a host.\n   *\n   * @param hostString the string to parse\n   * @return the parsed host\n   * @throws IllegalHost if the string is not a valid host\n   */\n  static Host parse(String hostString) throws IllegalHost {\n    return HostParser.INSTANCE.parse(hostString);\n  }\n\n  /**\n   * Encodes a string into a valid host with proper percent-encoding.\n   *\n   * @param unencoded the unencoded string\n   * @return the encoded host\n   */\n  static Host encode(String unencoded) {\n    return HostParser.INSTANCE.encode(unencoded);\n  }\n\n  /**\n   * Returns {@code true} if this host is in normal form.\n   *\n   * @return {@code true} if this is in normal form\n   */\n  @Override\n  boolean isNormalForm();\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/HostAndPort.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\n/**\n * Represents an authority component consisting of only a host and optional port, with no user info.\n *\n * <p>This is a specialized form of {@link Authority} that is guaranteed to have no user\n * information. It is commonly used for origins and server identification.\n *\n * <p>Implementations must be immutable and thread-safe.\n */\npublic interface HostAndPort extends Authority {\n\n  HostAndPort EMPTY = new HostAndPortValue(Host.EMPTY, null);\n\n  /**\n   * Creates a host and port from a host.\n   *\n   * @param host the host\n   * @return the host and port\n   */\n  static HostAndPort of(Host host) {\n    return of(host, null);\n  }\n\n  /**\n   * Creates a host and port from a host and optional port.\n   *\n   * @param host the host\n   * @param port the port, or {@code null}\n   * @return the host and port\n   */\n  static HostAndPort of(Host host, @Nullable Port port) {\n    if (host.isEmpty() && port == null) {\n      return HostAndPort.EMPTY;\n    } else {\n      return new HostAndPortValue(host, port);\n    }\n  }\n\n  /**\n   * Parses a string into a host and port.\n   *\n   * @param hostAndPortStr the string to parse\n   * @return the parsed host and port\n   * @throws IllegalHostAndPort if the string is not a valid host and port\n   */\n  static HostAndPort parse(String hostAndPortStr) throws IllegalAuthority {\n    return HostAndPortParser.INSTANCE.parse(hostAndPortStr);\n  }\n\n  /**\n   * Implementations must ALWAYS return null\n   *\n   * @deprecated This always returns null so you have no reason to ever call it\n   * @return null\n   */\n  @Override\n  @Nullable\n  @Deprecated // no point ever calling on this subtype\n  default UserInfo getUserInfo() {\n    return null;\n  }\n\n  /**\n   * Implementations must ALWAYS return this\n   *\n   * @deprecated This always returns this so you have no reason to ever call it\n   * @return this\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default HostAndPort getHostAndPort() {\n    return this;\n  }\n\n  /**\n   * Returns a new host and port with the specified port.\n   *\n   * @param port the port to set, or {@code null} to remove it\n   * @return a new host and port with the updated port\n   */\n  @Override\n  HostAndPort withPort(@Nullable Port port);\n\n  /**\n   * Returns a normalized form of this host and port.\n   *\n   * @return a normalized host and port\n   */\n  @Override\n  HostAndPort normalise();\n\n  /**\n   * Returns a normalized form of this host and port using scheme-specific normalization rules.\n   *\n   * @param canonicalScheme the canonical scheme to use for normalization\n   * @return a normalized host and port\n   */\n  @Override\n  HostAndPort normalise(Scheme canonicalScheme);\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/HostAndPortParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParseException;\nimport org.wiremock.stringparser.StringParser;\n\npublic final class HostAndPortParser implements StringParser<HostAndPort> {\n\n  public static final HostAndPortParser INSTANCE = new HostAndPortParser();\n\n  @Override\n  public Class<HostAndPort> getType() {\n    return HostAndPort.class;\n  }\n\n  @Override\n  public HostAndPort parse(String stringForm) throws ParseException {\n    var authority = Authority.parse(stringForm);\n    if (authority instanceof HostAndPort hostAndPort) {\n      return hostAndPort;\n    } else {\n      throw new IllegalHostAndPort(stringForm);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/HostAndPortValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\n\nimport java.util.Objects;\nimport java.util.Optional;\nimport org.jspecify.annotations.Nullable;\n\n@SuppressWarnings(\"ClassCanBeRecord\")\nfinal class HostAndPortValue implements HostAndPort {\n\n  private final Host host;\n  private final @Nullable Port port;\n\n  HostAndPortValue(Host host, @Nullable Port port) {\n    this.host = requireNonNull(host);\n    this.port = port;\n  }\n\n  @Override\n  public String toString() {\n    if (port != null) {\n      return host + \":\" + port;\n    } else {\n      return host.toString();\n    }\n  }\n\n  @Override\n  public @Nullable Optional<Port> getMaybePort() {\n    //noinspection OptionalAssignedToNull\n    return port != null ? Optional.of(port) : null;\n  }\n\n  @Override\n  public HostAndPort withPort(@Nullable Port port) {\n    if (Objects.equals(port, this.port)) {\n      return this;\n    } else {\n      return HostAndPort.of(host, port);\n    }\n  }\n\n  @Override\n  public HostAndPort normalise() {\n    var normalisedHost = host.normalise();\n    var normalisedPort = port == null ? null : port.normalise();\n    return normalised(normalisedHost, normalisedPort);\n  }\n\n  @Override\n  public HostAndPort normalise(Scheme canonicalScheme) {\n    var normalisedHost = host.normalise();\n    var normalisedPort = port == null ? null : port.normalise();\n    if (Objects.equals(canonicalScheme.getDefaultPort(), normalisedPort)) {\n      normalisedPort = null;\n    }\n    return normalised(normalisedHost, normalisedPort);\n  }\n\n  private HostAndPort normalised(Host normalisedHost, @Nullable Port normalisedPort) {\n    return normalisedHost.equals(host) && Objects.equals(normalisedPort, port)\n        ? this\n        : HostAndPort.of(normalisedHost, normalisedPort);\n  }\n\n  @Override\n  public Host getHost() {\n    return host;\n  }\n\n  @Override\n  public @Nullable Port getPort() {\n    return port;\n  }\n\n  @Override\n  @SuppressWarnings(\"EqualsDoesntCheckParameterClass\")\n  public boolean equals(Object other) {\n    return Authority.equals(this, other);\n  }\n\n  @Override\n  public int hashCode() {\n    return Authority.hashCode(this);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/HostParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.*;\n\nimport java.net.InetAddress;\nimport java.net.UnknownHostException;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\npublic final class HostParser implements PercentEncodedStringParser<Host> {\n\n  public static final HostParser INSTANCE = new HostParser();\n\n  static final String ipv6Address = \"(?<ipv6Address>[0-9A-Fa-f:.]+)\";\n  static final String ipvFuture = \"v[0-9A-Fa-f]\\\\.[\" + unreserved + subDelims + \":]+\";\n  static final String ipLiteral = \"\\\\[(?:\" + ipv6Address + \"|\" + ipvFuture + \")]\";\n  static final String registeredName = \"(?:[\" + unreserved + subDelims + \"]|\" + pctEncoded + \")*\";\n  // all ipv4 addresses are also legal registered names\n  static final String hostRegex = ipLiteral + \"|\" + registeredName;\n\n  private final Pattern hostPattern = Pattern.compile(\"^\" + hostRegex + \"$\");\n\n  @Override\n  public Class<Host> getType() {\n    return Host.class;\n  }\n\n  @Override\n  public Host parse(String stringForm) throws IllegalHost {\n    if (stringForm.isEmpty()) return Host.EMPTY;\n    if (stringForm.equals(\"localhost\")) return Host.LOCALHOST;\n    Matcher matcher = hostPattern.matcher(stringForm);\n    if (matcher.matches()) {\n      String ipv6Address = matcher.group(\"ipv6Address\");\n      if (ipv6Address != null) {\n        if (!ipv6Address.contains(\":\")) {\n          throw new IllegalHost(stringForm);\n        }\n        try {\n          //noinspection ResultOfMethodCallIgnored\n          InetAddress.getByName(ipv6Address);\n        } catch (UnknownHostException e) {\n          throw new IllegalHost(stringForm);\n        }\n      }\n      return new HostValue(stringForm);\n    } else {\n      throw new IllegalHost(stringForm);\n    }\n  }\n\n  private static final boolean[] hostCharSet = combine(unreservedCharSet, subDelimCharSet);\n\n  @Override\n  public Host encode(String unencoded) {\n    if (unencoded.isEmpty()) return Host.EMPTY;\n    if (unencoded.equals(\"localhost\")) return Host.LOCALHOST;\n    var result = PercentEncoding.encode(unencoded, hostCharSet);\n    return new HostValue(result, true);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/HostValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Locale.ROOT;\nimport static org.wiremock.url.Constants.pctEncodedPattern;\nimport static org.wiremock.url.Strings.transform;\n\nimport java.util.Objects;\nimport org.jspecify.annotations.Nullable;\n\nfinal class HostValue implements Host {\n\n  private final String host;\n  private final MemoisedNormalisable<Host> normalisable;\n\n  HostValue(String host) {\n    this(host, null);\n  }\n\n  @SuppressWarnings(\"DataFlowIssue\")\n  HostValue(String host, @Nullable Boolean isNormalForm) {\n    this.host = host;\n    this.normalisable =\n        new MemoisedNormalisable<>(this, isNormalForm, this::doIsNormalForm, this::doNormalise);\n  }\n\n  @Override\n  public String toString() {\n    return host;\n  }\n\n  @Override\n  public Host normalise() {\n    return normalisable.normalise();\n  }\n\n  private @Nullable Host doNormalise() {\n    String normalised =\n        transform(\n            host,\n            pctEncodedPattern,\n            matched -> matched.toUpperCase(ROOT),\n            unmatched -> unmatched.toLowerCase(ROOT));\n    return normalised.equals(host) ? null : new HostValue(normalised, true);\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return normalisable.isNormalForm();\n  }\n\n  private boolean doIsNormalForm() {\n    return normalise().equals(this);\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof Host that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(host);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalAbsoluteUri.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic non-sealed class IllegalAbsoluteUri extends IllegalUri {\n\n  public IllegalAbsoluteUri(String uri) {\n    this(uri, null);\n  }\n\n  public IllegalAbsoluteUri(String uri, @Nullable IllegalUriPart cause) {\n    this(uri, \"Illegal absolute uri: `\" + uri + \"`\", cause);\n  }\n\n  public IllegalAbsoluteUri(String uri, String message, @Nullable IllegalUriPart cause) {\n    super(uri, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalAbsoluteUrl.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic non-sealed class IllegalAbsoluteUrl extends IllegalUrl {\n\n  public IllegalAbsoluteUrl(String url) {\n    this(url, null);\n  }\n\n  public IllegalAbsoluteUrl(String url, @Nullable IllegalUriPart cause) {\n    this(url, \"Illegal absolute url: `\" + url + \"`\", cause);\n  }\n\n  public IllegalAbsoluteUrl(String url, String message, @Nullable IllegalUriPart cause) {\n    super(url, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalAuthority.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic class IllegalAuthority extends IllegalUriPart {\n\n  public IllegalAuthority(String authority) {\n    this(authority, message(authority));\n  }\n\n  public IllegalAuthority(String authority, String message) {\n    this(authority, message, null);\n  }\n\n  public IllegalAuthority(String authority, IllegalUriPart cause) {\n    this(authority, message(authority), cause);\n  }\n\n  public IllegalAuthority(String authority, String message, @Nullable IllegalUriPart cause) {\n    super(authority, message, cause);\n  }\n\n  private static String message(String authority) {\n    return \"Illegal authority: `\" + authority + \"`\";\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalBaseUrl.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic class IllegalBaseUrl extends IllegalServersideAbsoluteUrl {\n\n  public IllegalBaseUrl(String url, String message) {\n    this(url, message, null);\n  }\n\n  public IllegalBaseUrl(String url, String message, @Nullable IllegalUriPart cause) {\n    super(url, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalFragment.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic final class IllegalFragment extends IllegalUriPart {\n\n  public IllegalFragment(String fragment) {\n    super(fragment, \"Illegal fragment: `\" + fragment + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalHost.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic class IllegalHost extends IllegalUriPart {\n\n  public IllegalHost(String host) {\n    super(host, \"Illegal host: `\" + host + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalHostAndPort.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic class IllegalHostAndPort extends IllegalAuthority {\n\n  public IllegalHostAndPort(String hostAndPort) {\n    super(hostAndPort, \"Illegal host and port: `\" + hostAndPort + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalOpaqueUri.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic class IllegalOpaqueUri extends IllegalAbsoluteUri {\n\n  public IllegalOpaqueUri(String opaqueUri) {\n    this(opaqueUri, null);\n  }\n\n  public IllegalOpaqueUri(String opaqueUri, @Nullable IllegalUriPart cause) {\n    this(opaqueUri, \"Illegal opaque uri: `\" + opaqueUri + \"`\", cause);\n  }\n\n  public IllegalOpaqueUri(String opaqueUri, String message, @Nullable IllegalUriPart cause) {\n    super(opaqueUri, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalOrigin.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic final class IllegalOrigin extends IllegalServersideAbsoluteUrl {\n\n  public IllegalOrigin(String url) {\n    this(url, null);\n  }\n\n  public IllegalOrigin(String url, @Nullable IllegalUriPart cause) {\n    super(url, \"Illegal origin: `\" + url + \"`\", cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalPassword.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic class IllegalPassword extends IllegalUriPart {\n\n  public IllegalPassword(String password) {\n    super(password, \"Illegal password: `\" + password + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalPath.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic final class IllegalPath extends IllegalUriPart {\n\n  public IllegalPath(String path) {\n    this(path, \"Illegal path: `\" + path + \"`\");\n  }\n\n  public IllegalPath(String path, String message) {\n    super(path, message);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalPathAndQuery.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic final class IllegalPathAndQuery extends IllegalRelativeUrl {\n\n  public IllegalPathAndQuery(String pathAndQuery) {\n    this(pathAndQuery, null);\n  }\n\n  public IllegalPathAndQuery(String pathAndQuery, @Nullable IllegalUriPart cause) {\n    this(pathAndQuery, \"Illegal path and query: `\" + pathAndQuery + \"`\", cause);\n  }\n\n  public IllegalPathAndQuery(String pathAndQuery, String message, @Nullable IllegalUriPart cause) {\n    super(pathAndQuery, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalPort.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.PortParser.MAX_PORT;\n\npublic final class IllegalPort extends IllegalUriPart {\n\n  public IllegalPort(String illegalPortString) {\n    super(\n        illegalPortString,\n        \"Illegal port [\"\n            + illegalPortString\n            + \"]; Port value must be an integer between 1 and \"\n            + MAX_PORT);\n  }\n\n  public IllegalPort(int illegalPort) {\n    this(String.valueOf(illegalPort));\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalQuery.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic final class IllegalQuery extends IllegalUriPart {\n\n  public IllegalQuery(String query) {\n    super(query, \"Illegal query: `\" + query + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalQueryParamKey.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic class IllegalQueryParamKey extends IllegalUriPart {\n\n  public IllegalQueryParamKey(String stringForm) {\n    super(stringForm, \"Illegal query param key: `\" + stringForm + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalQueryParamValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic class IllegalQueryParamValue extends IllegalUriPart {\n\n  public IllegalQueryParamValue(String stringForm) {\n    super(stringForm, \"Illegal query param value: `\" + stringForm + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalRelativeUrl.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic non-sealed class IllegalRelativeUrl extends IllegalUrl {\n\n  public IllegalRelativeUrl(String relativeRef) {\n    this(relativeRef, null);\n  }\n\n  public IllegalRelativeUrl(String illegalRelativeRef, @Nullable IllegalUriPart cause) {\n    this(illegalRelativeRef, \"Illegal relative url: `\" + illegalRelativeRef + \"`\", cause);\n  }\n\n  public IllegalRelativeUrl(\n      String illegalRelativeRef, String message, @Nullable IllegalUriPart cause) {\n    super(illegalRelativeRef, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalScheme.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic final class IllegalScheme extends IllegalUriPart {\n\n  public IllegalScheme(String illegalScheme) {\n    super(\n        illegalScheme,\n        \"Illegal scheme `\"\n            + illegalScheme\n            + \"`; Scheme must match \"\n            + DefaultSchemeRegistry.schemeRegex);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalSchemeRelativeUrl.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic class IllegalSchemeRelativeUrl extends IllegalAbsoluteUrl {\n\n  public IllegalSchemeRelativeUrl(String url) {\n    this(url, null);\n  }\n\n  public IllegalSchemeRelativeUrl(String url, @Nullable IllegalUriPart cause) {\n    this(url, \"Illegal scheme relative url: `\" + url + \"`\", cause);\n  }\n\n  public IllegalSchemeRelativeUrl(String url, String message, @Nullable IllegalUriPart cause) {\n    super(url, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalSegment.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic class IllegalSegment extends IllegalUriPart {\n  public IllegalSegment(String segment) {\n    super(segment, \"Illegal segment: `\" + segment + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalServersideAbsoluteUrl.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic class IllegalServersideAbsoluteUrl extends IllegalAbsoluteUrl {\n\n  public IllegalServersideAbsoluteUrl(String url) {\n    this(url, null);\n  }\n\n  public IllegalServersideAbsoluteUrl(String url, @Nullable IllegalUriPart cause) {\n    this(url, \"Illegal serverside absolute url: `\" + url + \"`\", cause);\n  }\n\n  public IllegalServersideAbsoluteUrl(String url, String message, @Nullable IllegalUriPart cause) {\n    super(url, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalUri.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic sealed class IllegalUri extends IllegalUriOrPart permits IllegalUrl, IllegalAbsoluteUri {\n\n  public IllegalUri(String illegalValue) {\n    this(illegalValue, \"Illegal uri: `\" + illegalValue + \"`\", null);\n  }\n\n  public IllegalUri(String illegalValue, @Nullable IllegalUriPart cause) {\n    this(illegalValue, \"Illegal uri: `\" + illegalValue + \"`\", cause);\n  }\n\n  public IllegalUri(String illegalValue, String message, @Nullable IllegalUriPart cause) {\n    super(illegalValue, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalUriOrPart.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.ParseException;\n\npublic abstract sealed class IllegalUriOrPart extends ParseException\n    permits IllegalUriPart, IllegalUri {\n\n  public IllegalUriOrPart(String illegalValue, String message, @Nullable IllegalUriPart cause) {\n    super(illegalValue, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalUriPart.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic abstract non-sealed class IllegalUriPart extends IllegalUriOrPart {\n\n  public IllegalUriPart(String illegalValue, String message) {\n    this(illegalValue, message, null);\n  }\n\n  public IllegalUriPart(String illegalValue, String message, @Nullable IllegalUriPart cause) {\n    super(illegalValue, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalUrl.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic sealed class IllegalUrl extends IllegalUri permits IllegalRelativeUrl, IllegalAbsoluteUrl {\n\n  public IllegalUrl(String illegalValue, String message) {\n    this(illegalValue, message, null);\n  }\n\n  public IllegalUrl(String illegalValue, String message, @Nullable IllegalUriPart cause) {\n    super(illegalValue, message, cause);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalUserInfo.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic class IllegalUserInfo extends IllegalUriPart {\n\n  public IllegalUserInfo(String illegalUserInfo) {\n    super(illegalUserInfo, \"Illegal user info: `\" + illegalUserInfo + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/IllegalUsername.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic class IllegalUsername extends IllegalUriPart {\n\n  public IllegalUsername(String username) {\n    super(username, \"Illegal username: `\" + username + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Lazy.java",
    "content": "/*\n * Copyright (C) 2023-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.function.Supplier;\nimport org.jspecify.annotations.Nullable;\n\nclass Lazy<T> {\n\n  static <T> Lazy<T> lazy(Supplier<T> supplier) {\n    return lazy(null, supplier);\n  }\n\n  static <T> Lazy<T> lazy(@Nullable T initial, Supplier<T> supplier) {\n    @SuppressWarnings(\"UnnecessaryLocalVariable\")\n    Lazy<T> lazy = new Lazy<>(initial, supplier);\n    return lazy;\n  }\n\n  private final Supplier<T> supplier;\n  private volatile @Nullable T ref;\n\n  private Lazy(@Nullable T initial, Supplier<T> supplier) {\n    this.ref = initial;\n    this.supplier = supplier;\n  }\n\n  T get() {\n    T local = ref;\n    if (local == null) {\n      local = supplier.get();\n      ref = local;\n    }\n    return local;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Lists.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.jspecify.annotations.Nullable;\n\npublic final class Lists {\n  static <T> List<@Nullable T> of(@Nullable T value, @Nullable T[] otherValues) {\n    var values = new ArrayList<@Nullable T>(1 + otherValues.length);\n    values.add(value);\n    Collections.addAll(values, otherValues);\n    return values;\n  }\n\n  public static <C extends Collection<T>, T> List<? extends T> concat(\n      Collection<? extends C> lists) {\n    return concat(lists.stream());\n  }\n\n  @SafeVarargs\n  public static <T> List<? extends T> concat(Collection<? extends T>... lists) {\n    return concat(Stream.of(lists));\n  }\n\n  public static <C extends Collection<? extends T>, T> List<? extends T> concat(Stream<C> lists) {\n    return lists.flatMap(Collection::stream).toList();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/MemoisedNormalisable.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.function.BooleanSupplier;\nimport java.util.function.Supplier;\nimport org.jspecify.annotations.Nullable;\n\n/**\n * A helper class that memoises the results of {@link Normalisable#normalise()} and {@link\n * Normalisable#isNormalForm()} operations.\n *\n * <p>This class is thread-safe in the sense that it will always return correct results, but it does\n * not guarantee that the work will only be done once. Under concurrent access, both {@code\n * isNormalFormWork} and {@code normalisationWork} may be invoked multiple times by different\n * threads. Therefore:\n *\n * <ul>\n *   <li>Both suppliers must be idempotent and always return the same result for the same input\n *   <li>Both suppliers must be consistent with each other: if {@code normalisationWork} returns\n *       {@code null} (meaning the original is already in normal form), then {@code\n *       isNormalFormWork} must return {@code true}, and vice versa\n * </ul>\n *\n * @param <NORMALISED> the type of the normalisable value\n */\nfinal class MemoisedNormalisable<NORMALISED extends Normalisable<NORMALISED>> {\n\n  private final NORMALISED original;\n  private final BooleanSupplier isNormalFormWork;\n  private final Supplier<@Nullable NORMALISED> normalisationWork;\n\n  private volatile @Nullable NORMALISED normalised;\n  private volatile @Nullable Boolean isNormalForm;\n\n  MemoisedNormalisable(\n      NORMALISED original,\n      BooleanSupplier isNormalFormWork,\n      Supplier<@Nullable NORMALISED> normalisationWork) {\n    this(original, null, isNormalFormWork, normalisationWork);\n  }\n\n  MemoisedNormalisable(\n      NORMALISED original,\n      @Nullable Boolean isNormalForm,\n      BooleanSupplier isNormalFormWork,\n      Supplier<@Nullable NORMALISED> normalisationWork) {\n    this.original = original;\n    this.isNormalForm = isNormalForm;\n    this.isNormalFormWork = isNormalFormWork;\n    this.normalisationWork = normalisationWork;\n    initialiseNormalised(original);\n  }\n\n  private void initialiseNormalised(NORMALISED original) {\n    if (Boolean.TRUE.equals(this.isNormalForm)) {\n      this.normalised = original;\n    } else {\n      this.normalised = null;\n    }\n  }\n\n  public NORMALISED normalise() {\n    NORMALISED localNormalised = this.normalised;\n    if (localNormalised == null) {\n      localNormalised = normalisationWork.get();\n      if (localNormalised == null) {\n        localNormalised = original;\n        this.isNormalForm = true;\n      } else {\n        this.isNormalForm = false;\n      }\n      this.normalised = localNormalised;\n    }\n    return localNormalised;\n  }\n\n  public boolean isNormalForm() {\n    var normalForm = isNormalForm;\n    if (normalForm == null) {\n      normalForm = isNormalFormWork.getAsBoolean();\n      this.isNormalForm = normalForm;\n      if (normalForm) {\n        this.normalised = original;\n      }\n    }\n    return normalForm;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Normalisable.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\n/**\n * Many elements of URI References have a normal form - e.g. the schemes {@code HTTP} and {@code\n * HtTp} both normalise to {@code http}.\n *\n * <p>{@code Type.normalise().equals(Type.normalise().normalise()} should always be true.\n *\n * @param <SELF> the self type\n */\npublic interface Normalisable<SELF extends Normalisable<SELF>> {\n\n  /**\n   * Returns a normalised form of this value.\n   *\n   * @return a normalised value\n   */\n  SELF normalise();\n\n  boolean isNormalForm();\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/OpaqueUri.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\n/**\n * Represents a URI as defined in <a href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC\n * 3986</a> which does not have an {@link Authority}, such as {@code mailto:joan@example.com},\n * {@code file:/home/joan} or {@code aws:some:identifier}\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC 3986</a>\n */\npublic non-sealed interface OpaqueUri extends AbsoluteUri {\n\n  @Override\n  default boolean isAbsoluteUrl() {\n    return false;\n  }\n\n  @Override\n  default boolean isOpaqueUri() {\n    return true;\n  }\n\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default @Nullable Authority getAuthority() {\n    return null;\n  }\n\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default @Nullable UserInfo getUserInfo() {\n    return null;\n  }\n\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default @Nullable Host getHost() {\n    return null;\n  }\n\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default @Nullable Port getPort() {\n    return null;\n  }\n\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default @Nullable Port getResolvedPort() {\n    return null;\n  }\n\n  static OpaqueUri parse(String opaqueUri) throws IllegalOpaqueUri {\n    return OpaqueUriParser.INSTANCE.parse(opaqueUri);\n  }\n\n  static OpaqueUri of(Scheme scheme, Path path) {\n    return of(scheme, path, null, null);\n  }\n\n  static OpaqueUri of(Scheme scheme, Path path, Query query) {\n    return of(scheme, path, query, null);\n  }\n\n  static OpaqueUri of(\n      Scheme scheme, Path path, @Nullable Query query, @Nullable Fragment fragment) {\n    return new OpaqueUriValue(scheme, path, query, fragment);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/OpaqueUriParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic final class OpaqueUriParser implements StringParser<OpaqueUri> {\n\n  public static final OpaqueUriParser INSTANCE = new OpaqueUriParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public OpaqueUriParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<OpaqueUri> getType() {\n    return OpaqueUri.class;\n  }\n\n  @Override\n  public OpaqueUri parse(String stringForm) throws IllegalOpaqueUri {\n    var uri = uriParser.parse(stringForm);\n    if (uri instanceof OpaqueUri opaqueUri) {\n      return opaqueUri;\n    } else {\n      throw new IllegalOpaqueUri(stringForm);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/OpaqueUriValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\nimport org.jspecify.annotations.Nullable;\n\nfinal class OpaqueUriValue extends AbstractAbsoluteUriValue<OpaqueUri> implements OpaqueUri {\n\n  OpaqueUriValue(\n      @Nullable String stringValue,\n      Scheme scheme,\n      Path path,\n      @Nullable Query query,\n      @Nullable Fragment fragment) {\n    super(stringValue, scheme, null, path, query, fragment);\n  }\n\n  OpaqueUriValue(Scheme scheme, Path path, @Nullable Query query, @Nullable Fragment fragment) {\n    this(null, scheme, path, query, fragment);\n  }\n\n  @Override\n  public OpaqueUri normalise() {\n\n    Scheme normalisedScheme = nonNullScheme.normalise();\n    Path normalisedPath = path.normalise();\n\n    /*\n    `whatever:/..//` is a URI without an Authority.\n    Acording to the spec https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n    `/..//` should normalise to `//`, so `whatever:/..//` should normalise to `whatever://`.\n    However, this changes the semantics to now have an (empty) authority and an empty path.\n\n    We have made an executive decision that if a URI without an Authority has a path that\n    normalises to more than one `/` at the start, they will be treatd as a single `/`.\n    */\n    if (normalisedPath.toString().startsWith(\"//\")) {\n      normalisedPath = new PathValue(normalisedPath.toString().replaceFirst(\"^//+\", \"/\"), true);\n    }\n    Query normalisedQuery = query == null ? null : query.normalise();\n    Fragment normalisedFragment = fragment == null ? null : fragment.normalise();\n\n    if (nonNullScheme.equals(normalisedScheme)\n        && path.equals(normalisedPath)\n        && Objects.equals(query, normalisedQuery)\n        && Objects.equals(fragment, normalisedFragment)) {\n      return this;\n    } else {\n      return new OpaqueUriValue(\n          normalisedScheme, normalisedPath, normalisedQuery, normalisedFragment);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Origin.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\n/**\n * Represents a web origin as defined in <a\n * href=\"https://html.spec.whatwg.org/multipage/origin.html#concept-origin\">HTML Living\n * Standard</a>.\n *\n * <p>An origin consists of a scheme, host, and port. It represents the security context of a web\n * resource and is used for same-origin policy enforcement. Origins have no path, query, or fragment\n * components.\n *\n * <p>The component parts of an origin (scheme, host and port) are always normalised. The origin\n * itself is <b>not</b> the normal form of the URL it represents, since it has an empty path rather\n * than an absolute root path. {@code Origin.parse(\"https://example.org\").normalise().toString() }\n * will return {@code https://example.org/ }.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://html.spec.whatwg.org/multipage/origin.html#concept-origin\">HTML Living\n *     Standard - Origin</a>\n */\npublic interface Origin extends BaseUrl {\n\n  /**\n   * Returns the authority component of this origin.\n   *\n   * <p>Origins always have an authority that is a {@link HostAndPort} (no user info).\n   *\n   * @return the authority component, never {@code null}\n   */\n  @Override\n  HostAndPort getAuthority();\n\n  /**\n   * Implementations must ALWAYS return {@link PathAndQuery#EMPTY}\n   *\n   * @deprecated This always returns empty so you have no reason to ever call it\n   * @return {@link PathAndQuery#EMPTY}\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default PathAndQuery getPathAndQuery() {\n    return PathAndQuery.EMPTY;\n  }\n\n  /**\n   * Implementations must ALWAYS return {@link Path#EMPTY}\n   *\n   * @deprecated This always returns empty so you have no reason to ever call it\n   * @return {@link Path#EMPTY}\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default Path getPath() {\n    return Path.EMPTY;\n  }\n\n  /**\n   * Implementations must ALWAYS return null\n   *\n   * @deprecated This always returns null so you have no reason to ever call it\n   * @return null\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  @Nullable\n  default Query getQuery() {\n    return null;\n  }\n\n  /**\n   * Returns a normalised form of this origin by setting the path to {@code / }.\n   *\n   * @return a normalised origin (as a URL)\n   */\n  @Override\n  BaseUrl normalise();\n\n  /**\n   * Returns this.\n   *\n   * @return this\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default Origin getOrigin() {\n    return this;\n  }\n\n  /**\n   * Returns this.\n   *\n   * @return this\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default Origin getServersideAbsoluteUrl() {\n    return this;\n  }\n\n  /**\n   * Creates an origin from a scheme and host/port.\n   *\n   * @param scheme the scheme\n   * @param hostAndPort the host and port\n   * @return the origin\n   * @throws IllegalOrigin if any of the scheme, host and port are not normalised\n   */\n  static Origin of(Scheme scheme, HostAndPort hostAndPort) throws IllegalOrigin {\n    return OriginParser.INSTANCE.of(scheme, hostAndPort);\n  }\n\n  /**\n   * Parses a string into an origin.\n   *\n   * @param origin the string to parse\n   * @return the parsed origin\n   * @throws IllegalOrigin if the string is not a valid origin\n   */\n  static Origin parse(String origin) throws IllegalOrigin {\n    return OriginParser.INSTANCE.parse(origin);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/OriginParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic final class OriginParser implements StringParser<Origin> {\n\n  public static final OriginParser INSTANCE = new OriginParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public OriginParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<Origin> getType() {\n    return Origin.class;\n  }\n\n  @Override\n  public Origin parse(String url) throws IllegalOrigin {\n    var uri = uriParser.parse(url);\n    if (uri instanceof Origin origin) {\n      return origin;\n    } else {\n      throw new IllegalOrigin(url);\n    }\n  }\n\n  Origin of(Scheme scheme, HostAndPort hostAndPort) {\n    if (scheme.isNormalForm() && hostAndPort.isNormalForm(scheme)) {\n      return new OriginValue(scheme, hostAndPort);\n    } else {\n      throw new IllegalOrigin(scheme + \"://\" + hostAndPort);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/OriginValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class OriginValue extends AbstractAbsoluteUrlValue<ServersideAbsoluteUrl> implements Origin {\n\n  private final HostAndPort hostAndPort;\n\n  OriginValue(@Nullable String stringValue, Scheme scheme, HostAndPort authority) {\n    super(stringValue, scheme, authority, Path.EMPTY, null, null);\n    this.hostAndPort = requireNonNull(authority);\n    if (!authority.isNormalForm(scheme)) {\n      throw new IllegalOrigin(toString());\n    }\n  }\n\n  OriginValue(Scheme scheme, HostAndPort authority) {\n    this(null, scheme, authority);\n  }\n\n  @Override\n  public BaseUrl normalise() {\n    return (BaseUrl) transform(b -> b.setPath(Path.ROOT));\n  }\n\n  @Override\n  public HostAndPort getAuthority() {\n    return hostAndPort;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Password.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents the password portion of user information in a URI authority.\n *\n * <p>The password is the part after the colon in user information ({@code username:password}).\n * Passwords may contain percent-encoded characters.\n *\n * <p><strong>Security Warning:</strong> Including passwords in URIs is strongly discouraged as they\n * may be logged, cached, or exposed in various ways. This interface is provided for compatibility\n * with legacy systems only.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see UserInfo\n */\npublic interface Password extends PercentEncoded<Password>, ParsedString {\n\n  /**\n   * Parses a string into a password.\n   *\n   * @param password the string to parse\n   * @return the parsed password\n   * @throws IllegalPassword if the string is not a valid password\n   */\n  static Password parse(String password) throws IllegalPassword {\n    return PasswordParser.INSTANCE.parse(password);\n  }\n\n  /**\n   * Encodes a string into a valid password with proper percent-encoding.\n   *\n   * @param unencoded the unencoded string\n   * @return the encoded password\n   */\n  static Password encode(String unencoded) {\n    return PasswordParser.INSTANCE.encode(unencoded);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PasswordParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.*;\n\nimport java.util.regex.Pattern;\n\npublic final class PasswordParser implements PercentEncodedStringParser<Password> {\n\n  public static final PasswordParser INSTANCE = new PasswordParser();\n\n  final String passwordRegex = \"(?:[\" + unreserved + subDelims + \":]|\" + pctEncoded + \")*\";\n\n  private final Pattern passwordPattern = Pattern.compile(\"^\" + passwordRegex + \"$\");\n\n  @Override\n  public Class<Password> getType() {\n    return Password.class;\n  }\n\n  @Override\n  public Password parse(String stringForm) throws IllegalPassword {\n    if (passwordPattern.matcher(stringForm).matches()) {\n      return new PasswordValue(stringForm);\n    } else {\n      throw new IllegalPassword(stringForm);\n    }\n  }\n\n  private static final boolean[] passwordCharSet =\n      combine(unreservedCharSet, subDelimCharSet, include(':'));\n\n  @Override\n  public Password encode(String unencoded) {\n    var result = PercentEncoding.encode(unencoded, passwordCharSet);\n    return new PasswordValue(result, true);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PasswordValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\n\nfinal class PasswordValue implements Password {\n\n  private final String password;\n  private final boolean isNormalForm;\n\n  PasswordValue(String password) {\n    this(password, false);\n  }\n\n  PasswordValue(String password, boolean isNormalForm) {\n    this.password = password;\n    this.isNormalForm = isNormalForm;\n  }\n\n  @Override\n  public Password normalise() {\n    if (isNormalForm) {\n      return this;\n    }\n\n    String result = PercentEncoding.normalise(password, UserInfoParser.userInfoCharSet);\n\n    if (result == null) {\n      return this;\n    } else {\n      return new PasswordValue(result, true);\n    }\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return isNormalForm || PercentEncoding.isNormalForm(password, UserInfoParser.userInfoCharSet);\n  }\n\n  @Override\n  public String toString() {\n    return password;\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof Password that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(password);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Path.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents the path component of a URI as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.3\">RFC 3986 Section 3.3</a>.\n *\n * <p>A path consists of a sequence of segments separated by forward slashes. Paths can be absolute\n * (starting with {@code /}) or relative. Path segments may contain percent-encoded characters.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.3\">RFC 3986 Section 3.3</a>\n */\npublic interface Path extends PercentEncoded<Path>, ParsedString {\n\n  /** An empty path with no segments. */\n  Path EMPTY = new PathValue(\"\", true);\n\n  /** A root path consisting of a single forward slash. */\n  Path ROOT = new PathValue(\"/\", true);\n\n  /**\n   * Returns {@code true} if this path is absolute (starts with {@code /}).\n   *\n   * @return {@code true} if this is an absolute path\n   */\n  boolean isAbsolute();\n\n  /**\n   * Returns {@code true} if this path is not absolute (does not start with {@code /}).\n   *\n   * @return {@code true} if this is a relative path\n   */\n  default boolean isRelative() {\n    return !isAbsolute();\n  }\n\n  /**\n   * Returns {@code true} if this path is a base path (empty, or ends with {@code /}). e.g. {@code\n   * /base/}\n   *\n   * @return {@code true} if this is a base path\n   */\n  default boolean isBase() {\n    return isEmpty() || toString().endsWith(\"/\");\n  }\n\n  /**\n   * Returns {@code true} if this path is a leaf path (last segment is not empty). e.g. {@code\n   * /segment/leaf}\n   *\n   * @return {@code true} if this is a leaf path\n   */\n  default boolean isLeaf() {\n    return !isBase();\n  }\n\n  /**\n   * Returns the segments of this path.\n   *\n   * @return the list of path segments, never {@code null}\n   */\n  List<Segment> getSegments();\n\n  default Segment getFirstSegment() {\n    return getSegments().get(0);\n  }\n\n  default Segment getLastSegment() {\n    List<Segment> segments = getSegments();\n    return segments.get(segments.size() - 1);\n  }\n\n  /**\n   * Returns a normalised form of this path with dot segments removed.\n   *\n   * @return a normalised path\n   * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2\">RFC 3986 Section\n   *     6.2.2</a>\n   */\n  @Override\n  Path normalise();\n\n  /**\n   * Resolves the given path against this path using reference resolution rules.\n   *\n   * @param other the path to resolve\n   * @return the resolved path\n   * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-5.2\">RFC 3986 Section\n   *     5.2</a>\n   */\n  Path resolve(Path other);\n\n  /**\n   * Returns {@code true} if this path is empty (has no segments).\n   *\n   * @return {@code true} if this path is empty\n   */\n  @Override\n  default boolean isEmpty() {\n    return this.equals(Path.EMPTY);\n  }\n\n  /** Returns this path with a leading slash added if not present */\n  default Path toAbsolutePath() {\n    if (isAbsolute()) {\n      return this;\n    } else {\n      return PathParser.INSTANCE.construct(\"/\" + this);\n    }\n  }\n\n  /** Returns this path with any leading slash removed */\n  default Path toRelativePath() {\n    if (isRelative()) {\n      return this;\n    } else {\n      String pathStr = toString();\n      return PathParser.INSTANCE.construct(pathStr.substring(1));\n    }\n  }\n\n  /** Returns this path with a trailing slash added if not present and not empty */\n  default Path toBasePath() {\n    if (isBase()) {\n      return this;\n    } else {\n      return PathParser.INSTANCE.construct(this + \"/\");\n    }\n  }\n\n  /** Returns this path with any trailing slash removed */\n  default Path toLeafPath() {\n    if (isEmpty() || isLeaf()) {\n      return this;\n    } else {\n      String pathStr = toString();\n      return PathParser.INSTANCE.construct(pathStr.substring(0, pathStr.length() - 1));\n    }\n  }\n\n  /**\n   * Parses a string into a path.\n   *\n   * @param path the string to parse\n   * @return the parsed path\n   * @throws IllegalPath if the string is not a valid path\n   */\n  static Path parse(String path) throws IllegalPath {\n    return PathParser.INSTANCE.parse(path);\n  }\n\n  /**\n   * Encodes a string into a valid path with proper percent-encoding.\n   *\n   * @param unencoded the unencoded string\n   * @return the encoded path\n   */\n  static Path encode(String unencoded) {\n    return PathParser.INSTANCE.encode(unencoded);\n  }\n\n  static Path of(List<Segment> segments) {\n    return of(segments.stream());\n  }\n\n  static Path of(Stream<Segment> segments) {\n    return new PathValue(segments.map(Object::toString).collect(Collectors.joining(\"/\")));\n  }\n\n  default Path removePrefix(Path prefix) {\n    if (prefix.isEmpty()) {\n      return this;\n    }\n    String pathStr = toString();\n    String prefixStr = prefix.toString();\n    if (pathStr.startsWith(prefixStr)) {\n      return PathParser.INSTANCE.construct(pathStr.substring(prefixStr.length()));\n    } else {\n      return this;\n    }\n  }\n\n  default Path append(Path toAppend) {\n    if (this.isEmpty()) {\n      return toAppend;\n    }\n    if (toAppend.isEmpty()) {\n      return this;\n    }\n    return PathParser.INSTANCE.construct(this.toLeafPath().toString() + toAppend.toAbsolutePath());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PathAndQuery.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\n/**\n * Represents a path and query component combination, which is a type of relative reference.\n *\n * <p>A PathAndQuery consists of a path and an optional query, with no scheme, authority, or\n * fragment. It is typically used to represent the part of a URL after the authority.\n *\n * <p>Implementations must be immutable and thread-safe.\n */\npublic interface PathAndQuery extends RelativeUrl {\n\n  /** An empty path and query with no components. */\n  PathAndQuery EMPTY = new PathAndQueryValue(\"\", Path.EMPTY, null);\n\n  /**\n   * Implementations must ALWAYS return null\n   *\n   * @deprecated This always returns null so you have no reason to ever call it\n   * @return null\n   */\n  @Override\n  @Nullable\n  @Deprecated // no point ever calling on this subtype\n  default Authority getAuthority() {\n    return null;\n  }\n\n  /**\n   * Implementations must ALWAYS return null\n   *\n   * @deprecated This always returns null so you have no reason to ever call it\n   * @return null\n   */\n  @Override\n  @Nullable\n  @Deprecated // no point ever calling on this subtype\n  default Fragment getFragment() {\n    return null;\n  }\n\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default PathAndQuery getPathAndQuery() {\n    return this;\n  }\n\n  /**\n   * Parses a string into a path and query.\n   *\n   * @param pathAndQuery the string to parse\n   * @return the parsed path and query\n   * @throws IllegalPathAndQuery if the string is not a valid path and query\n   */\n  static PathAndQuery parse(String pathAndQuery) throws IllegalPathAndQuery {\n    return PathAndQueryParser.INSTANCE.parse(pathAndQuery);\n  }\n\n  static PathAndQuery of(Path path) {\n    return of(path, null);\n  }\n\n  static PathAndQuery of(Path path, @Nullable Query query) {\n    return new PathAndQueryValue(path, query);\n  }\n\n  default PathAndQuery removePathPrefix(Path prefix) {\n    return of(getPath().removePrefix(prefix), getQuery());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PathAndQueryParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.regex.Pattern;\nimport org.wiremock.stringparser.StringParser;\n\npublic final class PathAndQueryParser implements StringParser<PathAndQuery> {\n\n  public static final PathAndQueryParser INSTANCE = new PathAndQueryParser();\n\n  @Override\n  public Class<PathAndQuery> getType() {\n    return PathAndQuery.class;\n  }\n\n  private static final Pattern regex =\n      Pattern.compile(\"^(?<path>/[^?#]*|)(?:\\\\?(?<query>[^#]*))?$\");\n\n  @Override\n  public PathAndQuery parse(String stringForm) {\n    try {\n      var result = regex.matcher(stringForm);\n      if (!result.matches()) {\n        throw new IllegalPathAndQuery(stringForm);\n      }\n\n      var path = PathParser.INSTANCE.parse(result.group(\"path\"));\n\n      var queryString = result.group(\"query\");\n      var query = queryString == null ? null : Query.parse(queryString);\n\n      return PathAndQuery.of(path, query);\n    } catch (IllegalUriPart illegalPart) {\n      throw new IllegalUri(stringForm, illegalPart);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PathAndQueryValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class PathAndQueryValue extends AbstractUriValue implements PathAndQuery {\n\n  PathAndQueryValue(@Nullable String stringValue, Path path, @Nullable Query query) {\n    super(stringValue, null, null, path, query, null);\n    if (!path.isEmpty() && !path.isAbsolute()) {\n      throw new IllegalPathAndQuery(\n          this.toString(),\n          \"Illegal path and query: `\"\n              + this\n              + \"` - a path and query's path must be absolute or empty\",\n          new IllegalPath(\n              path.toString(),\n              \"Illegal path: `\" + path + \"` - a path and query's path must be absolute or empty\"));\n    }\n  }\n\n  PathAndQueryValue(Path path, @Nullable Query query) {\n    this(null, path, query);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PathParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.alwaysIllegal;\nimport static org.wiremock.url.Constants.combine;\nimport static org.wiremock.url.Constants.include;\nimport static org.wiremock.url.Constants.pcharCharSet;\n\nimport java.util.regex.Pattern;\n\npublic final class PathParser implements PercentEncodedStringParser<Path> {\n\n  public static final PathParser INSTANCE = new PathParser();\n\n  static final String pathRegex = \"[^#?\" + alwaysIllegal + \"]*\";\n  private final Pattern pathPattern = Pattern.compile(\"^\" + pathRegex + \"$\");\n\n  @Override\n  public Class<Path> getType() {\n    return Path.class;\n  }\n\n  @Override\n  public Path parse(String stringForm) {\n    if (stringForm.isEmpty()) {\n      return Path.EMPTY;\n    } else if (stringForm.equals(\"/\")) {\n      return Path.ROOT;\n    } else if (pathPattern.matcher(stringForm).matches()) {\n      return new PathValue(stringForm);\n    } else {\n      throw new IllegalPath(stringForm);\n    }\n  }\n\n  Path construct(String stringForm) {\n    if (stringForm.isEmpty()) {\n      return Path.EMPTY;\n    } else if (stringForm.equals(\"/\")) {\n      return Path.ROOT;\n    } else {\n      return new PathValue(stringForm);\n    }\n  }\n\n  private static final boolean[] charactersToLeaveAsIs = include('/');\n\n  static final boolean[] pathCharSet = combine(pcharCharSet, charactersToLeaveAsIs);\n\n  @Override\n  public Path encode(String unencoded) {\n    if (unencoded.isEmpty()) {\n      return Path.EMPTY;\n    } else if (unencoded.equals(\"/\")) {\n      return Path.ROOT;\n    } else {\n      return new PathValue(PercentEncoding.encode(unencoded, pathCharSet), true);\n    }\n  }\n\n  String normalisePercentEncoded(String unencoded) {\n    String result = PercentEncoding.normalise(unencoded, pathCharSet, charactersToLeaveAsIs);\n    return result != null ? result : unencoded;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PathValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Lazy.lazy;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport org.intellij.lang.annotations.Language;\nimport org.jspecify.annotations.Nullable;\n\nfinal class PathValue implements Path {\n\n  private final String path;\n  private final MemoisedNormalisable<Path> memoisedNormalisable;\n\n  PathValue(String path) {\n    this(path, null);\n  }\n\n  PathValue(String path, @Nullable Boolean isNormalForm) {\n    this.path = path;\n    this.memoisedNormalisable =\n        new MemoisedNormalisable<>(this, isNormalForm, this::isNormalFormWork, this::normaliseWork);\n  }\n\n  @Override\n  public String toString() {\n    return path;\n  }\n\n  @Override\n  public boolean isAbsolute() {\n    return !path.isEmpty() && path.charAt(0) == '/';\n  }\n\n  /**\n   * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\">RFC 3986 5.2.4.\n   *     Remove Dot Segments</a>\n   */\n  @Override\n  public Path normalise() {\n    return memoisedNormalisable.normalise();\n  }\n\n  private @Nullable Path normaliseWork() {\n    if (this.equals(ROOT) || this.equals(EMPTY)) {\n      return null;\n    }\n    var inputBuffer = new StringBuilder(path);\n    var outputBuffer = new StringBuilder();\n    while (!inputBuffer.isEmpty()) {\n      // A. If the input buffer begins with a prefix of \"../\" or \"./\", then remove that prefix\n      // from the input buffer\n      if (remove(inputBuffer, \"^..?/\")) {\n        continue;\n      }\n\n      // B. if the input buffer begins with a prefix of \"/./\" or \"/.\", where \".\" is a complete\n      // path segment, then replace that prefix with \"/\" in the input buffer\n      if (replace(inputBuffer, \"^/.(/|$)\", \"/\")) {\n        continue;\n      }\n\n      // C. if the input buffer begins with a prefix of \"/../\" or \"/..\", where \"..\" is a complete\n      // path segment, then replace that prefix with \"/\" in the input buffer and remove the last\n      // segment and its preceding \"/\" (if any) from the output buffer\n      if (replace(inputBuffer, \"^/..(/|$)\", \"/\")) {\n        var lastSegment = outputBuffer.lastIndexOf(\"/\");\n        if (lastSegment >= 0) {\n          outputBuffer.replace(lastSegment, outputBuffer.length(), \"\");\n        }\n        continue;\n      }\n\n      // D. if the input buffer consists only of \".\" or \"..\", then remove that from the input\n      // buffer\n      if (remove(inputBuffer, \"^..?$\")) {\n        continue;\n      }\n\n      // E. move the first path segment in the input buffer to the end of the output buffer,\n      // including the initial \"/\" character (if any) and any subsequent characters up to, but not\n      // including, the next \"/\" character or the end of the input buffer.\n      int endOfFirstSegment = getEndOfFirstSegment(inputBuffer);\n      outputBuffer.append(inputBuffer, 0, endOfFirstSegment);\n      inputBuffer.replace(0, endOfFirstSegment, \"\");\n    }\n    var outStr = PathParser.INSTANCE.normalisePercentEncoded(outputBuffer.toString());\n    if (outStr.equals(path)) {\n      return null;\n    } else if (outStr.equals(ROOT.toString())) {\n      return ROOT;\n    } else {\n      return new PathValue(outStr, true);\n    }\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return memoisedNormalisable.isNormalForm();\n  }\n\n  private boolean isNormalFormWork() {\n    return normalise().equals(this);\n  }\n\n  private static int getEndOfFirstSegment(StringBuilder inputBuffer) {\n    final int indexOfSlashAtEndOfFirstSegment;\n    if (inputBuffer.charAt(0) == '/') {\n      indexOfSlashAtEndOfFirstSegment = inputBuffer.indexOf(\"/\", 1);\n    } else {\n      indexOfSlashAtEndOfFirstSegment = inputBuffer.indexOf(\"/\");\n    }\n    if (indexOfSlashAtEndOfFirstSegment == -1) {\n      return inputBuffer.length();\n    }\n    return indexOfSlashAtEndOfFirstSegment;\n  }\n\n  /*\n   * The character `.` does not have its usual regex meaning here. For ease of comparison with\n   * the spec it is a placeholder, replaced with the pattern `(?:\\.|%2[Ee])` that matches both a\n   * literal `.` and the percent encoded form of `.`, either `%2E` or `%2e`.\n   */\n  private static boolean remove(StringBuilder original, @Language(\"RegExp\") String pattern) {\n    return replace(original, pattern, \"\");\n  }\n\n  @Language(\"RegExp\")\n  @SuppressWarnings(\"RegExpUnnecessaryNonCapturingGroup\")\n  private static final String DOT = \"(?:\\\\.|%2[Ee])\";\n\n  private static final Map<String, Pattern> CACHE = new ConcurrentHashMap<>();\n\n  /*\n   * The character `.` does not have its usual regex meaning here. For ease of comparison with\n   * the spec it is a placeholder, replaced with the pattern `(?:\\.|%2[Ee])` that matches both a\n   * literal `.` and the percent encoded form of `.`, either `%2E` or `%2e`.\n   */\n  private static boolean replace(\n      StringBuilder original, @Language(\"RegExp\") String pattern, String replacement) {\n    Pattern p =\n        CACHE.computeIfAbsent(\n            pattern,\n            regex -> Pattern.compile(regex.replaceAll(\"\\\\.\", Matcher.quoteReplacement(DOT))));\n    Matcher matcher = p.matcher(original);\n    boolean matches = matcher.find();\n    if (matches) {\n      original.replace(matcher.start(), matcher.end(), replacement);\n    }\n    return matches;\n  }\n\n  @Override\n  public Path resolve(Path other) {\n    final Path result;\n    if (other.toString().isEmpty()) {\n      result = this;\n    } else if (other.isAbsolute()) {\n      result = other;\n    } else {\n      var lastIndexOfSlash = this.path.lastIndexOf('/');\n      if (lastIndexOfSlash == -1) {\n        result = other;\n      } else {\n        result =\n            PathParser.INSTANCE.construct(this.path.substring(0, lastIndexOfSlash + 1) + other);\n      }\n    }\n    return result.normalise();\n  }\n\n  private final Lazy<List<Segment>> segments = lazy(this::buildSegments);\n\n  @Override\n  public List<Segment> getSegments() {\n    return segments.get();\n  }\n\n  private List<Segment> buildSegments() {\n    return Arrays.stream(path.split(\"/\", -1)).map(s -> (Segment) new SegmentValue(s)).toList();\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof Path that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(path);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PercentEncoded.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents a string that may contain percent-encoded characters as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-2.1\">RFC 3986 Section 2.1</a>.\n *\n * <p>Percent-encoding is a mechanism to represent characters that are not allowed or have special\n * meaning in URIs. Characters are encoded as a percent sign ({@code %}) followed by two hexadecimal\n * digits representing the byte value.\n *\n * <p>Implementations must provide a {@link Object#toString()} method that returns the\n * percent-encoded string representation.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-2.1\">RFC 3986 Section 2.1</a>\n */\npublic interface PercentEncoded<SELF extends PercentEncoded<SELF>>\n    extends Normalisable<SELF>, ParsedString {\n\n  /**\n   * Decodes all percent-encoded sequences in this string.\n   *\n   * <p>Sequences like {@code %20} are decoded to their corresponding characters using UTF-8\n   * encoding.\n   *\n   * @return the decoded string\n   */\n  default String decode() {\n    return PercentEncoding.decode(toString());\n  }\n\n  /**\n   * Returns the length of this percent-encoded string.\n   *\n   * @return the length of the string\n   */\n  default int length() {\n    return toString().length();\n  }\n\n  /**\n   * Returns {@code true} if this percent-encoded string is empty.\n   *\n   * @return {@code true} if the string has zero length\n   */\n  default boolean isEmpty() {\n    return toString().isEmpty();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PercentEncodedStream.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\nclass PercentEncodedStream extends StringTokenStream<CodePointOrHexCodePoint> {\n\n  PercentEncodedStream(String input) {\n    super(input);\n  }\n\n  @Override\n  public CodePointOrHexCodePoint next() {\n\n    // Check percent-encoded sequences\n    var maybeHex = nextHex(index);\n    if (maybeHex != null) {\n      // Decode the first byte to check if it's a multi-byte UTF-8 sequence\n      int decodedChar = maybeHex.decode().codePoint();\n      int firstByte = decodedChar & 0xFF;\n      int utf8Length = getUtf8SequenceLength(firstByte);\n\n      if (utf8Length == 1) {\n        index += 3;\n        return maybeHex;\n      } else {\n        // Multi-byte UTF-8 sequence - read the continuation bytes\n        HexCharacter[] hexChars = new HexCharacter[utf8Length];\n        hexChars[0] = maybeHex;\n\n        for (int i = 1; i < utf8Length; i++) {\n          var continuationHex = nextHex(index + (i * 3));\n          if (continuationHex == null) {\n            // Invalid UTF-8 sequence - treat first byte as standalone\n            index += 3;\n            return maybeHex;\n          }\n          hexChars[i] = continuationHex;\n        }\n\n        index += utf8Length * 3;\n        return new HexSequence(hexChars);\n      }\n    }\n    int codePoint = input.codePointAt(index);\n    index += Character.charCount(codePoint);\n    return new CodePoint(codePoint);\n  }\n\n  private static int getUtf8SequenceLength(int firstByte) {\n    // Check the high bits to determine UTF-8 sequence length\n    if ((firstByte & 0x80) == 0) {\n      // 0xxxxxxx = 1 byte (ASCII)\n      return 1;\n    } else if ((firstByte & 0xE0) == 0xC0) {\n      // 110xxxxx = 2 bytes\n      return 2;\n    } else if ((firstByte & 0xF0) == 0xE0) {\n      // 1110xxxx = 3 bytes\n      return 3;\n    } else if ((firstByte & 0xF8) == 0xF0) {\n      // 11110xxx = 4 bytes\n      return 4;\n    } else {\n      // Invalid UTF-8 lead byte - treat as single byte\n      return 1;\n    }\n  }\n\n  private @Nullable HexCharacter nextHex(int startPoint) {\n    if (startPoint >= input.length()) {\n      return null;\n    }\n    var startChar = input.charAt(startPoint);\n    if (startChar == '%' && startPoint + 2 < input.length()) {\n      char maybeFirstHexDigit = input.charAt(startPoint + 1);\n      char maybeSecondHexDigit = input.charAt(startPoint + 2);\n      if (isHexDigit(maybeFirstHexDigit) && isHexDigit(maybeSecondHexDigit)) {\n        return new HexCharacter(maybeFirstHexDigit, maybeSecondHexDigit);\n      }\n    }\n    return null;\n  }\n\n  private static boolean isHexDigit(char c) {\n    return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f');\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PercentEncodedStringParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic interface PercentEncodedStringParser<T extends PercentEncoded<T>> extends StringParser<T> {\n  T encode(String unencoded);\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PercentEncoding.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class PercentEncoding {\n\n  /**\n   * Decodes all percent-encoded sequences in a string (handles mixed content).\n   *\n   * <p>This method can handle strings containing both encoded and unencoded characters, like {@code\n   * a%C3%9Fc}. It will decode only the percent-encoded sequences and leave other characters\n   * unchanged.\n   *\n   * @param input a string that may contain percent-encoded sequences\n   * @return the decoded string\n   */\n  static String decode(String input) {\n    var result = new AppendableToAwareStringBuilder();\n    var percentEncodedStream = new PercentEncodedStream(input);\n    while (percentEncodedStream.hasNext()) {\n      result.append(percentEncodedStream.next().decode());\n    }\n    return result.toString();\n  }\n\n  PercentEncoding() {\n    throw new UnsupportedOperationException(\"not instantiable\");\n  }\n\n  @Nullable\n  static String normalise(String original, boolean[] charactersThatDoNotNeedEncoding) {\n    return normalise(original, charactersThatDoNotNeedEncoding, Constants.empty);\n  }\n\n  @Nullable\n  static String normalise(\n      String original, boolean[] charactersThatDoNotNeedEncoding, boolean[] charactersToLeaveAsIs) {\n    var result = new AppendableToAwareStringBuilder();\n    boolean changed = false;\n\n    var percentEncodedStream = new PercentEncodedStream(original);\n    while (percentEncodedStream.hasNext()) {\n      var charOrHex = percentEncodedStream.next();\n      if (charOrHex instanceof HexCodePoint hex) {\n        var decodedChar = hex.decode();\n\n        // If the decoded character is unreserved, decode it\n        if (decodedChar.isIn(charactersThatDoNotNeedEncoding)\n            && !decodedChar.isIn(charactersToLeaveAsIs)) {\n          result.append(decodedChar);\n          changed = true;\n        } else {\n          // Otherwise, keep it encoded but uppercase the hex digits\n          var upperCased = hex.toUpperCase();\n          result.append(upperCased);\n          if (!upperCased.equals(hex)) {\n            changed = true;\n          }\n        }\n      } else if (charOrHex instanceof CodePoint codePoint) {\n        var maybeEncoded = codePoint.maybePercentEncode(charactersThatDoNotNeedEncoding);\n        result.append(maybeEncoded);\n        changed = maybeEncoded.isEncoded() || changed;\n      }\n    }\n\n    if (!changed) {\n      return null;\n    } else {\n      return result.toString();\n    }\n  }\n\n  @Nullable\n  static String simpleNormalise(String original, boolean[] charactersThatDoNotNeedEncoding) {\n    var result = new AppendableToAwareStringBuilder();\n    boolean changed = false;\n\n    var percentEncodedStream = new PercentEncodedStream(original);\n    while (percentEncodedStream.hasNext()) {\n      var charOrHex = percentEncodedStream.next();\n      if (charOrHex instanceof HexCodePoint hex) {\n        var upperCased = hex.toUpperCase();\n        result.append(upperCased);\n        if (!upperCased.equals(hex)) {\n          changed = true;\n        }\n      } else if (charOrHex instanceof CodePoint codePoint) {\n        var maybeEncoded = codePoint.maybePercentEncode(charactersThatDoNotNeedEncoding);\n        result.append(maybeEncoded);\n        changed = maybeEncoded.isEncoded() || changed;\n      }\n    }\n\n    if (!changed) {\n      return null;\n    } else {\n      return result.toString();\n    }\n  }\n\n  static boolean isSimpleNormalForm(String original, boolean[] charactersThatDoNotNeedEncoding) {\n    var percentEncodedStream = new PercentEncodedStream(original);\n    while (percentEncodedStream.hasNext()) {\n      var charOrHex = percentEncodedStream.next();\n      if (charOrHex instanceof HexCodePoint hex) {\n        if (!hex.isUpperCase()) {\n          return false;\n        }\n      } else if (charOrHex instanceof CodePoint codePoint\n          && !codePoint.isIn(charactersThatDoNotNeedEncoding)) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  @SuppressWarnings(\"SameParameterValue\")\n  static boolean isNormalForm(\n      String original, boolean[] charactersThatDoNotNeedEncoding, boolean[] charactersToLeaveAsIs) {\n    var percentEncodedStream = new PercentEncodedStream(original);\n    while (percentEncodedStream.hasNext()) {\n      var charOrHex = percentEncodedStream.next();\n      if (charOrHex instanceof HexCodePoint hex) {\n        if (!hex.isUpperCase()) {\n          return false;\n        }\n\n        var decodedChar = hex.decode();\n\n        // If the decoded character is unreserved, it should not be percent-encoded\n        if (decodedChar.isIn(charactersThatDoNotNeedEncoding)\n            && !decodedChar.isIn(charactersToLeaveAsIs)) {\n          return false;\n        }\n      } else if (charOrHex instanceof CodePoint character\n          && !character.isIn(charactersThatDoNotNeedEncoding)\n          && !character.isIn(charactersToLeaveAsIs)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  static boolean isNormalForm(String original, boolean[] charactersThatDoNotNeedEncoding) {\n    return isNormalForm(original, charactersThatDoNotNeedEncoding, Constants.empty);\n  }\n\n  static String encode(String unencoded, boolean[] charactersThatDoNotNeedEncoding) {\n    var result = new AppendableToAwareStringBuilder();\n    new CodePointStream(unencoded)\n        .forEachRemaining(\n            codePoint ->\n                result.append(codePoint.maybePercentEncode(charactersThatDoNotNeedEncoding)));\n    return result.toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Port.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents a valid network port.\n *\n * <p>An implementation must be immutable (and hence threadsafe)\n *\n * <p>Implementations must enforce that 1 &lt;= port &lt;= 65,535\n *\n * <p>Implementations should be equal to any other Port implementation with the same text\n * representation. Implementations are <b>NOT</b> equal if they have different string\n * representations, even if they represent the same port number. For example, {@code\n * Port.parse(\"00080\").equals(Port.of(80)) == false} because their string representations differ\n * (\"00080\" vs \"80\"), even though both represent port 80. This preserves the original format as it\n * appeared in the URL.\n *\n * <p>An implementation's toString should return the String used when it was created. For ports\n * created via {@code parse()}, this preserves the original format including any leading zeros. For\n * ports created via {@code of()}, this returns the canonical form without leading zeros.\n *\n * <p>An implementation's hashCode() is based on the string representation, ensuring consistency\n * with equals.\n */\npublic interface Port extends Normalisable<Port>, ParsedString {\n\n  int getIntValue();\n\n  @Override\n  boolean isNormalForm();\n\n  /**\n   * Returns a Port with the canonical (normalised) string representation of this port number,\n   * without any leading zeros.\n   *\n   * <p>For example, {@code Port.parse(\"00080\").normalise()} returns a Port whose {@code toString()}\n   * is \"80\".\n   *\n   * <p>If this Port is already in canonical form, returns a Port equal to this one.\n   *\n   * @return a Port with the canonical string representation\n   */\n  @Override\n  Port normalise();\n\n  static Port parse(String port) throws IllegalPort {\n    return PortParser.INSTANCE.parse(port);\n  }\n\n  static Port of(int port) throws IllegalPort {\n    return PortParser.INSTANCE.of(port);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PortParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Map;\nimport java.util.concurrent.ConcurrentHashMap;\nimport org.wiremock.stringparser.StringParser;\n\npublic final class PortParser implements StringParser<Port> {\n\n  public static final PortParser INSTANCE = new PortParser();\n\n  static final int MAX_PORT = Integer.MAX_VALUE;\n\n  private final Map<Integer, PortValue> portsByInt = new ConcurrentHashMap<>();\n\n  @Override\n  public Class<Port> getType() {\n    return Port.class;\n  }\n\n  PortValue of(int port) throws IllegalPort {\n    return portsByInt.computeIfAbsent(\n        port,\n        (p) -> {\n          validate(p);\n          return new PortValue(p, String.valueOf(p), true);\n        });\n  }\n\n  @Override\n  public Port parse(String stringForm) {\n    try {\n      if (stringForm.startsWith(\"+\")) {\n        throw new IllegalPort(stringForm);\n      }\n      int port = Integer.parseInt(stringForm);\n      String canonical = String.valueOf(port);\n      boolean isNormalForm = stringForm.equals(canonical);\n      if (isNormalForm) {\n        return of(port);\n      } else {\n        validate(port);\n        return new PortValue(port, stringForm, false);\n      }\n\n    } catch (NumberFormatException e) {\n      throw new IllegalPort(stringForm);\n    }\n  }\n\n  private static void validate(int port) {\n    if (port < 0) {\n      throw new IllegalPort(port);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/PortValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nfinal class PortValue implements Port {\n\n  private final int port;\n  private final String portString;\n  private final boolean isNormalForm;\n\n  PortValue(int port, String portString, boolean isNormalForm) {\n    this.port = port;\n    this.portString = portString;\n    this.isNormalForm = isNormalForm;\n  }\n\n  @Override\n  public String toString() {\n    return portString;\n  }\n\n  @Override\n  public Port normalise() {\n    if (portString.equals(String.valueOf(port))) {\n      return this;\n    } else {\n      return PortParser.INSTANCE.of(port);\n    }\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (!(o instanceof Port other)) {\n      return false;\n    }\n    return toString().equals(other.toString());\n  }\n\n  @Override\n  public int hashCode() {\n    return portString.hashCode();\n  }\n\n  @Override\n  public int getIntValue() {\n    return port;\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return isNormalForm;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Query.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.QueryValue.encodeValues;\n\nimport java.util.List;\nimport java.util.function.Consumer;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents the query component of a URI as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.4\">RFC 3986 Section 3.4</a>.\n *\n * <p>The query component contains non-hierarchical data, typically formatted as key-value pairs\n * separated by ampersands. Query strings may contain percent-encoded characters.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.4\">RFC 3986 Section 3.4</a>\n */\npublic interface Query extends PercentEncoded<Query>, QueryParamReader, ParsedString {\n\n  Query EMPTY = new QueryValue(\"\", List.of(), true);\n\n  /**\n   * Parses a string into a query.\n   *\n   * @param query the string to parse\n   * @return the parsed query\n   * @throws IllegalQuery if the string is not a valid query\n   */\n  static Query parse(String query) throws IllegalQuery {\n    return QueryParser.INSTANCE.parse(query);\n  }\n\n  /**\n   * Encodes a string into a valid query with proper percent-encoding.\n   *\n   * @param unencoded the unencoded string\n   * @return the encoded query\n   */\n  static Query encode(String unencoded) {\n    return QueryParser.INSTANCE.encode(unencoded);\n  }\n\n  @Override\n  Query normalise();\n\n  default Query with(String key, @Nullable String value, @Nullable String... otherValues) {\n    return with(QueryParamKey.encode(key), encodeValues(value, otherValues));\n  }\n\n  default Query with(\n      QueryParamKey key,\n      @Nullable QueryParamValue value,\n      @Nullable QueryParamValue... otherValues) {\n    return with(key, Lists.of(value, otherValues));\n  }\n\n  default Query with(QueryParamKey key, List<? extends @Nullable QueryParamValue> values) {\n    return transform(q -> q.append(key, values));\n  }\n\n  default Query replace(String key, @Nullable String value, @Nullable String... otherValues) {\n    return replace(QueryParamKey.encode(key), encodeValues(value, otherValues));\n  }\n\n  default Query replace(\n      QueryParamKey key,\n      @Nullable QueryParamValue value,\n      @Nullable QueryParamValue... otherValues) {\n    return replace(key, Lists.of(value, otherValues));\n  }\n\n  default Query replace(QueryParamKey key, List<? extends @Nullable QueryParamValue> values) {\n    return transform(q -> q.put(key, values));\n  }\n\n  default Query without(String key) {\n    return without(QueryParamKey.encode(key));\n  }\n\n  default Query without(QueryParamKey key) {\n    return transform(q -> q.remove(key));\n  }\n\n  default Query without(String key, @Nullable String value, @Nullable String... otherValues) {\n    return without(QueryParamKey.encode(key), encodeValues(value, otherValues));\n  }\n\n  default Query without(\n      QueryParamKey key,\n      @Nullable QueryParamValue value,\n      @Nullable QueryParamValue... otherValues) {\n    return without(key, Lists.of(value, otherValues));\n  }\n\n  default Query without(QueryParamKey key, List<? extends @Nullable QueryParamValue> values) {\n    return transform(q -> q.remove(key, values));\n  }\n\n  static Builder builder() {\n    return new QueryBuilder();\n  }\n\n  Builder thaw();\n\n  default Query transform(Consumer<Builder> transformer) {\n    var builder = thaw();\n    transformer.accept(builder);\n    return builder.build();\n  }\n\n  interface Builder {\n\n    Builder append(String key, @Nullable String value, @Nullable String... otherValues);\n\n    Builder append(\n        QueryParamKey key,\n        @Nullable QueryParamValue value,\n        @Nullable QueryParamValue... otherValues);\n\n    Builder append(QueryParamKey key, List<? extends @Nullable QueryParamValue> values);\n\n    Builder put(String key, @Nullable String value, @Nullable String... otherValues);\n\n    Builder put(\n        QueryParamKey key,\n        @Nullable QueryParamValue value,\n        @Nullable QueryParamValue... otherValues);\n\n    Builder put(QueryParamKey key, List<? extends @Nullable QueryParamValue> values);\n\n    Builder remove(String key);\n\n    Builder remove(QueryParamKey key);\n\n    Builder remove(String key, @Nullable String value, @Nullable String... otherValues);\n\n    Builder remove(\n        QueryParamKey key,\n        @Nullable QueryParamValue value,\n        @Nullable QueryParamValue... otherValues);\n\n    Builder remove(QueryParamKey key, List<? extends @Nullable QueryParamValue> values);\n\n    Query build();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryBuilder.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.AbstractMap.SimpleEntry;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map.Entry;\nimport org.jspecify.annotations.Nullable;\n\nfinal class QueryBuilder implements Query.Builder {\n\n  private final List<Entry<QueryParamKey, @Nullable QueryParamValue>> mutableParams;\n\n  QueryBuilder() {\n    mutableParams = new ArrayList<>();\n  }\n\n  QueryBuilder(List<Entry<QueryParamKey, @Nullable QueryParamValue>> query) {\n    mutableParams = new ArrayList<>(query);\n  }\n\n  @Override\n  public Query.Builder append(String key, @Nullable String value, @Nullable String... otherValues) {\n    append(key, value);\n    for (var otherValue : otherValues) {\n      append(key, otherValue);\n    }\n    return this;\n  }\n\n  @Override\n  public Query.Builder append(\n      QueryParamKey key,\n      @Nullable QueryParamValue value,\n      @Nullable QueryParamValue... otherValues) {\n    append(key, value);\n    for (var otherValue : otherValues) {\n      append(key, otherValue);\n    }\n    return this;\n  }\n\n  @Override\n  public Query.Builder append(QueryParamKey key, List<? extends @Nullable QueryParamValue> values) {\n    for (var value : values) {\n      append(key, value);\n    }\n    return this;\n  }\n\n  private void append(String key, @Nullable String value) {\n    append(QueryParamKey.encode(key), value);\n  }\n\n  private void append(QueryParamKey key, @Nullable String value) {\n    append(key, value != null ? QueryParamValue.encode(value) : null);\n  }\n\n  private void append(QueryParamKey key, @Nullable QueryParamValue value) {\n    mutableParams.add(new SimpleEntry<>(key, value));\n  }\n\n  @Override\n  public Query.Builder put(String key, @Nullable String value, @Nullable String... otherValues) {\n    var encodedKey = QueryParamKey.encode(key);\n    remove(encodedKey);\n    append(encodedKey, value);\n    for (var otherValue : otherValues) {\n      append(encodedKey, otherValue);\n    }\n    return this;\n  }\n\n  @Override\n  public Query.Builder put(\n      QueryParamKey key,\n      @Nullable QueryParamValue value,\n      @Nullable QueryParamValue... otherValues) {\n    remove(key);\n    this.append(key, value, otherValues);\n    return this;\n  }\n\n  @Override\n  public Query.Builder put(QueryParamKey key, List<? extends @Nullable QueryParamValue> values) {\n    remove(key);\n    append(key, values);\n    return this;\n  }\n\n  @Override\n  public Query.Builder remove(String key) {\n    return remove(QueryParamKey.encode(key));\n  }\n\n  @Override\n  public Query.Builder remove(QueryParamKey key) {\n    mutableParams.removeIf(e -> e.getKey().equals(key));\n    return this;\n  }\n\n  @Override\n  public Query.Builder remove(String key, @Nullable String value, @Nullable String... otherValues) {\n    return remove(QueryParamKey.encode(key), QueryValue.encodeValues(value, otherValues));\n  }\n\n  @Override\n  public Query.Builder remove(\n      QueryParamKey key,\n      @Nullable QueryParamValue value,\n      @Nullable QueryParamValue... otherValues) {\n    return remove(key, Lists.of(value, otherValues));\n  }\n\n  @Override\n  public Query.Builder remove(QueryParamKey key, List<? extends @Nullable QueryParamValue> values) {\n    mutableParams.removeIf(e -> e.getKey().equals(key) && values.contains(e.getValue()));\n    return this;\n  }\n\n  @Override\n  public Query build() {\n    if (mutableParams.isEmpty()) {\n      return Query.EMPTY;\n    } else {\n      return new QueryValue(mutableParams);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryParamKey.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParsedString;\n\npublic interface QueryParamKey extends PercentEncoded<QueryParamKey>, ParsedString {\n\n  QueryParamKey EMPTY = new QueryParamKeyValue(\"\");\n\n  static QueryParamKey parse(String key) throws IllegalQueryParamKey {\n    return QueryParamKeyParser.INSTANCE.parse(key);\n  }\n\n  static QueryParamKey encode(String key) {\n    return QueryParamKeyParser.INSTANCE.encode(key);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryParamKeyParser.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.alwaysIllegal;\nimport static org.wiremock.url.Constants.remove;\nimport static org.wiremock.url.QueryParser.queryCharSet;\n\nimport java.util.regex.Pattern;\n\npublic final class QueryParamKeyParser implements PercentEncodedStringParser<QueryParamKey> {\n\n  public static final QueryParamKeyParser INSTANCE = new QueryParamKeyParser();\n\n  private static final String queryParamKeyRegex = \"[^#&=\" + alwaysIllegal + \"]*\";\n  private static final Pattern queryParamKeyPattern =\n      Pattern.compile(\"^\" + queryParamKeyRegex + \"$\");\n\n  @Override\n  public Class<QueryParamKey> getType() {\n    return QueryParamKey.class;\n  }\n\n  @Override\n  public QueryParamKey parse(String stringForm) {\n    if (stringForm.isEmpty()) {\n      return QueryParamKey.EMPTY;\n    } else if (queryParamKeyPattern.matcher(stringForm).matches()) {\n      return new QueryParamKeyValue(stringForm);\n    } else {\n      throw new IllegalSegment(stringForm);\n    }\n  }\n\n  static final boolean[] queryParamKeyCharSet = remove(queryCharSet, '&', '=', '+');\n\n  @Override\n  public QueryParamKey encode(String unencoded) {\n    return unencoded.isEmpty()\n        ? QueryParamKey.EMPTY\n        : new QueryParamKeyValue(PercentEncoding.encode(unencoded, queryParamKeyCharSet), true);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryParamKeyValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\nimport org.jspecify.annotations.Nullable;\n\nfinal class QueryParamKeyValue implements QueryParamKey {\n\n  private final String stringForm;\n  private final MemoisedNormalisable<QueryParamKey> memoisedNormalisable;\n\n  public QueryParamKeyValue(String stringForm) {\n    this(stringForm, null);\n  }\n\n  QueryParamKeyValue(String stringForm, @Nullable Boolean isNormalForm) {\n    this.stringForm = stringForm;\n    this.memoisedNormalisable =\n        new MemoisedNormalisable<>(this, isNormalForm, this::isNormalFormWork, this::normaliseWork);\n  }\n\n  @Override\n  public String toString() {\n    return stringForm;\n  }\n\n  @Override\n  public String decode() {\n    return PercentEncoding.decode(stringForm.replace('+', ' '));\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof QueryParamKey that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return stringForm.hashCode();\n  }\n\n  @Override\n  public QueryParamKey normalise() {\n    return memoisedNormalisable.normalise();\n  }\n\n  private @Nullable QueryParamKey normaliseWork() {\n    String result =\n        PercentEncoding.normalise(\n            stringForm.replace('+', ' '), QueryParamKeyParser.queryParamKeyCharSet);\n    return result != null ? new QueryParamKeyValue(result, true) : null;\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return memoisedNormalisable.isNormalForm();\n  }\n\n  private boolean isNormalFormWork() {\n    return PercentEncoding.isNormalForm(stringForm, QueryParamKeyParser.queryParamKeyCharSet);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryParamReader.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNullElse;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.Set;\nimport java.util.stream.Collectors;\nimport org.jspecify.annotations.Nullable;\n\n/**\n * All methods accepting String as a parameter will call {@code encode} to encode it to a valid\n * {@link QueryParamKey} or {@link QueryParamValue}, so must be called with an <b>unencoded</b>\n * value.\n */\npublic interface QueryParamReader {\n\n  List<Entry<QueryParamKey, @Nullable QueryParamValue>> getEntries();\n\n  default List<@Nullable QueryParamValue> get(String key) {\n    return get(QueryParamKey.encode(key));\n  }\n\n  default List<@Nullable QueryParamValue> get(QueryParamKey key) {\n    List<@Nullable QueryParamValue> result = asMap().get(key.normalise());\n    return requireNonNullElse(result, List.of());\n  }\n\n  default boolean contains(String key) {\n    return contains(QueryParamKey.encode(key));\n  }\n\n  default boolean contains(QueryParamKey key) {\n    return asMap().containsKey(key.normalise());\n  }\n\n  default Set<QueryParamKey> getKeys() {\n    return asMap().keySet();\n  }\n\n  default Map<QueryParamKey, List<@Nullable QueryParamValue>> asMap() {\n    return getEntries().stream()\n        .collect(\n            Collectors.groupingBy(\n                entry -> entry.getKey().normalise(),\n                Collectors.mapping(Entry::getValue, Collectors.toList())));\n  }\n\n  default @Nullable QueryParamValue getFirst(String key) {\n    return getFirst(QueryParamKey.encode(key));\n  }\n\n  default @Nullable QueryParamValue getFirst(QueryParamKey key) {\n    List<@Nullable QueryParamValue> values = get(key);\n    return values.isEmpty() ? null : requireNonNullElse(values.get(0), QueryParamValue.EMPTY);\n  }\n\n  /**\n   * Returns a map of all query parameters with decoded keys and values.\n   *\n   * <p>Both keys and values are percent-decoded using UTF-8 encoding. Null values (keys without\n   * values) are represented as empty strings.\n   *\n   * @return a map where keys are decoded parameter names and values are lists of decoded parameter\n   *     values\n   * @see #asMap()\n   */\n  default Map<String, List<String>> asDecodedMap() {\n    return asMap().entrySet().stream()\n        .collect(\n            Collectors.toMap(\n                entry -> entry.getKey().decode(),\n                entry ->\n                    entry.getValue().stream()\n                        .map(value -> value != null ? value.decode() : \"\")\n                        .collect(Collectors.toList())));\n  }\n\n  /**\n   * Returns all decoded values for the given key.\n   *\n   * <p>The key is matched against decoded parameter names. Values are percent-decoded using UTF-8\n   * encoding. Null values (keys without values) are represented as empty strings.\n   *\n   * @param key the unencoded parameter name to look up\n   * @return a list of decoded values, or an empty list if the key is not present\n   * @see #get(String)\n   */\n  default List<String> getDecoded(String key) {\n    var result = asDecodedMap().get(key);\n    return result != null ? result : List.of();\n  }\n\n  /**\n   * Returns the first decoded value for the given key.\n   *\n   * <p>The key is matched against decoded parameter names. The value is percent-decoded using UTF-8\n   * encoding. If the key exists but has no value, an empty string is returned.\n   *\n   * @param key the unencoded parameter name to look up\n   * @return the first decoded value, or {@code null} if the key is not present\n   * @see #getFirst(String)\n   */\n  default @Nullable String getFirstDecoded(String key) {\n    List<String> result = getDecoded(key);\n    return result.isEmpty() ? null : result.get(0);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryParamValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParsedString;\n\npublic interface QueryParamValue extends PercentEncoded<QueryParamValue>, ParsedString {\n\n  QueryParamValue EMPTY = new QueryParamValueValue(\"\");\n\n  static QueryParamValue parse(String key) throws IllegalQueryParamValue {\n    return QueryParamValueParser.INSTANCE.parse(key);\n  }\n\n  static QueryParamValue encode(String key) {\n    return QueryParamValueParser.INSTANCE.encode(key);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryParamValueParser.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.alwaysIllegal;\nimport static org.wiremock.url.Constants.remove;\nimport static org.wiremock.url.QueryParser.queryCharSet;\n\nimport java.util.regex.Pattern;\n\npublic final class QueryParamValueParser implements PercentEncodedStringParser<QueryParamValue> {\n\n  public static final QueryParamValueParser INSTANCE = new QueryParamValueParser();\n\n  private static final String queryParamValueRegex = \"[^#&\" + alwaysIllegal + \"]*\";\n  private static final Pattern queryParamValuePattern =\n      Pattern.compile(\"^\" + queryParamValueRegex + \"$\");\n\n  @Override\n  public Class<QueryParamValue> getType() {\n    return QueryParamValue.class;\n  }\n\n  @Override\n  public QueryParamValue parse(String stringForm) {\n    if (queryParamValuePattern.matcher(stringForm).matches()) {\n      return new QueryParamValueValue(stringForm);\n    } else {\n      throw new IllegalSegment(stringForm);\n    }\n  }\n\n  static final boolean[] queryParamValueCharSet = remove(queryCharSet, '&', '+');\n\n  @Override\n  public QueryParamValue encode(String unencoded) {\n    return new QueryParamValueValue(\n        PercentEncoding.encode(unencoded, queryParamValueCharSet), true);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryParamValueValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\nimport org.jspecify.annotations.Nullable;\n\nfinal class QueryParamValueValue implements QueryParamValue {\n\n  private final String stringForm;\n  private final MemoisedNormalisable<QueryParamValue> memoisedNormalisable;\n\n  public QueryParamValueValue(String stringForm) {\n    this(stringForm, null);\n  }\n\n  QueryParamValueValue(String stringForm, @Nullable Boolean isNormalForm) {\n    this.stringForm = stringForm;\n    this.memoisedNormalisable =\n        new MemoisedNormalisable<>(this, isNormalForm, this::isNormalFormWork, this::normaliseWork);\n  }\n\n  @Override\n  public String toString() {\n    return stringForm;\n  }\n\n  @Override\n  public String decode() {\n    return PercentEncoding.decode(stringForm.replace('+', ' '));\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof QueryParamValue that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return stringForm.hashCode();\n  }\n\n  @Override\n  public QueryParamValue normalise() {\n    return memoisedNormalisable.normalise();\n  }\n\n  private @Nullable QueryParamValue normaliseWork() {\n    String result =\n        PercentEncoding.normalise(\n            stringForm.replace('+', ' '), QueryParamValueParser.queryParamValueCharSet);\n    return result != null ? new QueryParamValueValue(result, true) : null;\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return memoisedNormalisable.isNormalForm();\n  }\n\n  private boolean isNormalFormWork() {\n    return PercentEncoding.isNormalForm(stringForm, QueryParamValueParser.queryParamValueCharSet);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.*;\n\nimport java.util.regex.Pattern;\n\npublic final class QueryParser implements PercentEncodedStringParser<Query> {\n\n  public static final QueryParser INSTANCE = new QueryParser();\n\n  static final String queryRegex = \"[^#\" + alwaysIllegal + \"]*\";\n  private final Pattern queryPattern = Pattern.compile(\"^\" + queryRegex + \"$\");\n\n  @Override\n  public Class<Query> getType() {\n    return Query.class;\n  }\n\n  @Override\n  public Query parse(String stringForm) throws IllegalQuery {\n    if (stringForm.isEmpty()) {\n      return Query.EMPTY;\n    } else if (queryPattern.matcher(stringForm).matches()) {\n      return new QueryValue(stringForm);\n    } else {\n      throw new IllegalQuery(stringForm);\n    }\n  }\n\n  static final boolean[] queryCharSet = combine(pcharCharSet, include('/', '?'));\n\n  @Override\n  public Query encode(String unencoded) {\n    if (unencoded.isEmpty()) {\n      return Query.EMPTY;\n    } else {\n      var result = PercentEncoding.encode(unencoded, queryCharSet);\n      return new QueryValue(result);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/QueryValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Lazy.lazy;\n\nimport java.util.AbstractMap.SimpleEntry;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.Objects;\nimport java.util.stream.Collectors;\nimport org.jspecify.annotations.Nullable;\n\nfinal class QueryValue implements Query {\n\n  private final String query;\n  private final Lazy<List<Map.Entry<QueryParamKey, @Nullable QueryParamValue>>> paramEntries;\n  private final MemoisedNormalisable<Query> memoisedNormalisable;\n\n  QueryValue(String query) {\n    this(query, null);\n  }\n\n  QueryValue(String query, @Nullable Boolean isNormalForm) {\n    this(query, null, isNormalForm);\n  }\n\n  QueryValue(List<Entry<QueryParamKey, @Nullable QueryParamValue>> params) {\n    this(params, null);\n  }\n\n  QueryValue(\n      List<Entry<QueryParamKey, @Nullable QueryParamValue>> params,\n      @Nullable Boolean isNormalForm) {\n    this(joinToString(params), Collections.unmodifiableList(params), isNormalForm);\n  }\n\n  private static String joinToString(List<Entry<QueryParamKey, @Nullable QueryParamValue>> params) {\n    return params.stream()\n        .map(\n            entry -> {\n              var value = entry.getValue();\n              return value == null ? entry.getKey().toString() : entry.getKey() + \"=\" + value;\n            })\n        .collect(Collectors.joining(\"&\"));\n  }\n\n  QueryValue(\n      String query,\n      @Nullable List<Map.Entry<QueryParamKey, @Nullable QueryParamValue>> paramEntries,\n      @Nullable Boolean isNormalForm) {\n    this.query = query;\n    this.paramEntries = lazy(paramEntries, this::parseEntries);\n    this.memoisedNormalisable =\n        new MemoisedNormalisable<>(this, isNormalForm, this::isNormalFormWork, this::normaliseWork);\n  }\n\n  @Override\n  public String toString() {\n    return query;\n  }\n\n  @Override\n  public Query normalise() {\n    return memoisedNormalisable.normalise();\n  }\n\n  private @Nullable Query normaliseWork() {\n    String result = PercentEncoding.simpleNormalise(query, QueryParser.queryCharSet);\n    return result != null ? new QueryValue(result, true) : null;\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return memoisedNormalisable.isNormalForm();\n  }\n\n  private boolean isNormalFormWork() {\n    return PercentEncoding.isSimpleNormalForm(query, QueryParser.queryCharSet);\n  }\n\n  private volatile @Nullable Map<QueryParamKey, List<@Nullable QueryParamValue>> asMap = null;\n\n  @Override\n  public Map<QueryParamKey, List<@Nullable QueryParamValue>> asMap() {\n    Map<QueryParamKey, List<@Nullable QueryParamValue>> local = asMap;\n    if (local == null) {\n      local = Query.super.asMap();\n      asMap = local;\n    }\n    return local;\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof Query that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(query);\n  }\n\n  @Override\n  public Builder thaw() {\n    return new QueryBuilder(getEntries());\n  }\n\n  @Override\n  public List<Entry<QueryParamKey, @Nullable QueryParamValue>> getEntries() {\n    return paramEntries.get();\n  }\n\n  private List<Entry<QueryParamKey, @Nullable QueryParamValue>> parseEntries() {\n    var keyValuePairStrs = query.split(\"&\", -1);\n    var result = new ArrayList<Entry<QueryParamKey, @Nullable QueryParamValue>>();\n    for (String keyValuePairStr : keyValuePairStrs) {\n      var keyValuePair = keyValuePairStr.split(\"=\", 2);\n      var key = new QueryParamKeyValue(keyValuePair[0]);\n      var value = keyValuePair.length == 2 ? new QueryParamValueValue(keyValuePair[1]) : null;\n      result.add(new SimpleEntry<>(key, value));\n    }\n    return Collections.unmodifiableList(result);\n  }\n\n  static List<@Nullable QueryParamValue> encodeValues(\n      @Nullable String value, @Nullable String[] otherValues) {\n    return Lists.of(value, otherValues).stream().map(QueryValue::encodeValue).toList();\n  }\n\n  private static @Nullable QueryParamValue encodeValue(@Nullable String value) {\n    return value != null ? QueryParamValue.encode(value) : null;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/RelativeUrl.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\n/**\n * Represents a relative reference as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-4.2\">RFC 3986 Section 4.2</a>.\n *\n * <p>A relative reference is a URI reference that does not have a scheme component. It can have an\n * authority, path, query, and fragment. Relative references are typically resolved against a base\n * URI to produce another URI.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-4.2\">RFC 3986 Section 4.2</a>\n */\npublic non-sealed interface RelativeUrl extends Url {\n\n  /**\n   * Implementations must ALWAYS return null\n   *\n   * @deprecated This always returns null so you have no reason to ever call it\n   * @return null\n   */\n  @Override\n  @Nullable\n  @Deprecated // no point ever calling on this subtype\n  default Scheme getScheme() {\n    return null;\n  }\n\n  @Override\n  default boolean isRelative() {\n    return true;\n  }\n\n  @Override\n  default boolean isAbsolute() {\n    return false;\n  }\n\n  @Override\n  default boolean isAbsoluteUrl() {\n    return false;\n  }\n\n  @Override\n  default boolean isOpaqueUri() {\n    return false;\n  }\n\n  @Override\n  default RelativeUrl.Transformer thaw() {\n    return new RelativeUrlTransformer(this);\n  }\n\n  /**\n   * Parses a string into a relative reference.\n   *\n   * @param relativeRef the string to parse\n   * @return the parsed relative reference\n   * @throws IllegalRelativeUrl if the string is not a valid relative reference\n   */\n  static RelativeUrl parse(String relativeRef) throws IllegalRelativeUrl {\n    return RelativeUrlParser.INSTANCE.parse(relativeRef);\n  }\n\n  /**\n   * Creates a new builder\n   *\n   * @return a new builder\n   */\n  static RelativeUrl.Builder builder() {\n    return new RelativeUrlBuilder();\n  }\n\n  /**\n   * Creates a builder initialized with the values from the given URL.\n   *\n   * @param url the URL to copy values from\n   * @return a new builder\n   */\n  static RelativeUrl.Builder builder(RelativeUrl url) {\n    return new RelativeUrlBuilder(url);\n  }\n\n  interface Builder extends UriBaseBuilder<Builder> {\n\n    @Override\n    RelativeUrl.Builder setAuthority(@Nullable Authority authority);\n\n    @Override\n    RelativeUrl build() throws IllegalRelativeUrl;\n  }\n\n  interface Transformer extends Url.Transformer<RelativeUrl.Transformer> {\n\n    @Override\n    RelativeUrl.Transformer setScheme(@Nullable Scheme scheme);\n\n    @Override\n    RelativeUrl.Transformer setAuthority(@Nullable Authority authority);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/RelativeUrlBuilder.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.RelativeUrl.Transformer;\n\nfinal class RelativeUrlTransformer extends AbstractUriBaseBuilder<RelativeUrl.Transformer>\n    implements RelativeUrl.Transformer {\n\n  public RelativeUrlTransformer(RelativeUrl relativeUrl) {\n    super(relativeUrl);\n  }\n\n  @Override\n  public Transformer setScheme(@Nullable Scheme scheme) {\n    return super.doSetScheme(scheme);\n  }\n\n  @Override\n  public Transformer setAuthority(@Nullable Authority authority) {\n    return super.doSetAuthority(authority);\n  }\n\n  @Override\n  public Url build() {\n    Uri uri = super.build();\n    if (uri instanceof Url url) {\n      return url;\n    } else {\n      throw new IllegalUrl(uri.toString(), \"Illegal url: `\" + uri + \"`; a url has an authority\");\n    }\n  }\n}\n\nfinal class RelativeUrlBuilder extends AbstractUriBaseBuilder<RelativeUrl.Builder>\n    implements RelativeUrl.Builder {\n\n  public RelativeUrlBuilder() {\n    super();\n  }\n\n  public RelativeUrlBuilder(RelativeUrl url) {\n    super(url);\n  }\n\n  @Override\n  public RelativeUrl.Builder setAuthority(@Nullable Authority authority) {\n    return super.doSetAuthority(authority);\n  }\n\n  @Override\n  public RelativeUrl build() {\n    return (RelativeUrl) super.build();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/RelativeUrlParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic final class RelativeUrlParser implements StringParser<RelativeUrl> {\n\n  public static final RelativeUrlParser INSTANCE = new RelativeUrlParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public RelativeUrlParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<RelativeUrl> getType() {\n    return RelativeUrl.class;\n  }\n\n  @Override\n  public RelativeUrl parse(String stringForm) {\n    var uri = uriParser.parse(stringForm);\n    if (uri instanceof RelativeUrl relativeUrl) {\n      return relativeUrl;\n    } else {\n      throw new IllegalRelativeUrl(stringForm);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/RelativeUrlValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class RelativeUrlValue extends AbstractUriValue implements RelativeUrl {\n\n  RelativeUrlValue(\n      @Nullable String stringValue, Path path, @Nullable Query query, @Nullable Fragment fragment) {\n    super(stringValue, null, null, path, query, fragment);\n    if (!path.isEmpty()) {\n      if (path.getFirstSegment().toString().contains(\":\")) {\n        throw new IllegalRelativeUrl(\n            this.toString(),\n            \"Illegal relative url: `\"\n                + this\n                + \"` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\",\n            new IllegalPath(\n                path.toString(),\n                \"Illegal path: `\"\n                    + path\n                    + \"` - may not contain a colon (`:`) in the first segment of a relative url with no authority\"));\n      } else if (path.toString().startsWith(\"//\")) {\n        throw new IllegalPathAndQuery(\n            this.toString(),\n            \"Illegal relative url: `\"\n                + this\n                + \"` - a relative url without authority's path may not start with //, as that would make the first segment an authority\",\n            new IllegalPath(\n                path.toString(),\n                \"Illegal path: `\"\n                    + path\n                    + \"` - may not start with // in a relative url with no authority\"));\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Scheme.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents a valid URI scheme.\n *\n * <p>An implementation must be immutable (and hence threadsafe)\n *\n * <p>Implementations must enforce that the scheme is valid\n *\n * <p>Implementations should be equal to any other Scheme implementation with the same text\n * representation. Implementations are <b>NOT</b> equal to a scheme with different casing - so\n * {@code Scheme.parse(\"http\").equals(Scheme.parse(\"HTTP\")) == false}. However, their canonical\n * representations are equal, so {@code\n * Scheme.parse(\"http\").canonical().equals(Scheme.parse(\"HTTP\").canonical()) == true }.\n *\n * <p>An implementation's toString should return the String used when it was created.\n */\npublic interface Scheme extends ParsedString {\n\n  Scheme normalise();\n\n  @Nullable Port getDefaultPort();\n\n  default boolean isNormalForm() {\n    return normalise().equals(this);\n  }\n\n  default AbsoluteUri resolve(Uri other) {\n    return asUri().resolve(other);\n  }\n\n  default AbsoluteUrl resolve(UrlWithAuthority other) {\n    return asUri().resolve(other);\n  }\n\n  private OpaqueUri asUri() {\n    return OpaqueUri.of(this, Path.EMPTY);\n  }\n\n  /**\n   * Parses &amp; registers a scheme\n   *\n   * <p>Unlike register, returns a scheme with the same casing as the scheme param, but {@code\n   * canonical()} will return the canonical (lower case) version, which may already have been\n   * registered.\n   *\n   * <p>If the scheme parameter is canonical (lower case), and a matching Scheme with a default port\n   * has already been registered, that Scheme will be returned.\n   *\n   * @param scheme - the raw scheme\n   * @return a Scheme object representing the scheme\n   * @throws IllegalScheme if the raw scheme is not a legal Scheme, matching {@code\n   *     [a-zA-Z][a-zA-Z0-9+\\-.]{0,255}}\n   */\n  static Scheme parse(String scheme) throws IllegalScheme {\n    return SchemeRegistry.INSTANCE.parse(scheme);\n  }\n\n  /**\n   * Registers a canonical scheme with no default port.\n   *\n   * <p>The registered and returned scheme will be canonical (i.e. lower case) regardless of the\n   * case of the input.\n   *\n   * <p>If the scheme is already registered, returns the existing instance with the existing\n   * instances default port (or none).\n   *\n   * @param schemeString - the raw scheme\n   * @return a canonical Scheme object representing the scheme\n   * @throws IllegalScheme if the raw scheme is not a legal Scheme, matching {@code\n   *     [a-zA-Z][a-zA-Z0-9+\\-.]{0,255}}\n   */\n  static Scheme register(String schemeString) throws IllegalScheme {\n    return register(schemeString, null);\n  }\n\n  /**\n   * Registers a scheme with an optional default port.\n   *\n   * <p>The registered and returned scheme will be canonical (i.e. lower case) regardless of input.\n   *\n   * <p>If the scheme is already registered, returns the existing instance and ignores the provided\n   * default port.\n   *\n   * <p>The returned scheme will be canonical (i.e. lower case)\n   *\n   * @param schemeString - the raw scheme\n   * @return a canonical Scheme object representing the scheme\n   * @throws IllegalScheme if the raw scheme is not a legal Scheme, matching {@code\n   *     [a-zA-Z][a-zA-Z0-9+\\-.]{0,255}}\n   */\n  static Scheme register(String schemeString, @Nullable Port defaultPort) throws IllegalScheme {\n    return SchemeRegistry.INSTANCE.register(schemeString, defaultPort);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/SchemeRegistry.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.StringParser;\n\npublic interface SchemeRegistry extends StringParser<Scheme> {\n\n  SchemeRegistry INSTANCE = new DefaultSchemeRegistry();\n\n  Scheme http = INSTANCE.register(\"http\", Port.of(80));\n  Scheme https = INSTANCE.register(\"https\", Port.of(443));\n  Scheme ws = INSTANCE.register(\"ws\", Port.of(80));\n  Scheme wss = INSTANCE.register(\"wss\", Port.of(443));\n  Scheme file = INSTANCE.register(\"file\");\n  Scheme ftp = INSTANCE.register(\"ftp\", Port.of(21));\n  Scheme sftp = INSTANCE.register(\"sftp\", Port.of(22));\n  Scheme ssh = INSTANCE.register(\"ssh\", Port.of(22));\n  Scheme mailto = INSTANCE.register(\"mailto\");\n\n  @Override\n  default Class<Scheme> getType() {\n    return Scheme.class;\n  }\n\n  default Scheme register(String schemeString) throws IllegalScheme {\n    return register(schemeString, null);\n  }\n\n  Scheme register(String schemeString, @Nullable Port defaultPort) throws IllegalScheme;\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/SchemeRelativeUrl.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\n/**\n * Represents a path and query component combination, which is a type of relative reference.\n *\n * <p>A PathAndQuery consists of a path and an optional query, with no scheme, authority, or\n * fragment. It is typically used to represent the part of a URL after the authority.\n *\n * <p>Implementations must be immutable and thread-safe.\n */\npublic non-sealed interface SchemeRelativeUrl extends RelativeUrl, UrlWithAuthority {\n\n  /**\n   * Returns the authority component of this scheme relative url, which should always be present.\n   *\n   * @return the authority component\n   */\n  @Override\n  Authority getAuthority();\n\n  @Override\n  @Deprecated // no point ever calling\n  default SchemeRelativeUrl getSchemeRelativeUrl() {\n    return this;\n  }\n\n  /**\n   * Parses a string into a scheme relative url\n   *\n   * @param pathAndQuery the string to parse\n   * @return the parsed path and query\n   * @throws IllegalPathAndQuery if the string is not a valid path and query\n   */\n  static SchemeRelativeUrl parse(String pathAndQuery) throws IllegalSchemeRelativeUrl {\n    return SchemeRelativeUrlParser.INSTANCE.parse(pathAndQuery);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/SchemeRelativeUrlParser.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic final class SchemeRelativeUrlParser implements StringParser<SchemeRelativeUrl> {\n\n  public static final SchemeRelativeUrlParser INSTANCE =\n      new SchemeRelativeUrlParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public SchemeRelativeUrlParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<SchemeRelativeUrl> getType() {\n    return SchemeRelativeUrl.class;\n  }\n\n  @Override\n  public SchemeRelativeUrl parse(String stringForm) throws IllegalSchemeRelativeUrl {\n    var uri = uriParser.parse(stringForm);\n    if (uri instanceof SchemeRelativeUrl schemeRelativeUrl) {\n      return schemeRelativeUrl;\n    } else {\n      throw new IllegalSchemeRelativeUrl(stringForm);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/SchemeRelativeUrlValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class SchemeRelativeUrlValue extends AbstractUriValue implements SchemeRelativeUrl {\n\n  private final Authority nonNullAuthority;\n\n  SchemeRelativeUrlValue(\n      @Nullable String stringValue,\n      Authority authority,\n      Path path,\n      @Nullable Query query,\n      @Nullable Fragment fragment) {\n    super(stringValue, null, authority, path, query, fragment);\n    this.nonNullAuthority = requireNonNull(authority);\n\n    if (!path.isEmpty() && !path.isAbsolute()) {\n      throw new IllegalSchemeRelativeUrl(\n          this.toString(),\n          \"Illegal scheme relative url: `\"\n              + this\n              + \"` - a scheme relative url's path must be absolute or empty, was `\"\n              + path\n              + \"`\",\n          new IllegalPath(\n              path.toString(), \"Illegal path: `\" + path + \"` - must be absolute or empty\"));\n    }\n  }\n\n  @Override\n  public Authority getAuthority() {\n    return nonNullAuthority;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/SchemeValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\nimport org.jspecify.annotations.Nullable;\n\nfinal class SchemeValue implements Scheme {\n\n  private final String scheme;\n\n  @Nullable private final Scheme normalForm;\n\n  @Nullable private final Port defaultPort;\n\n  SchemeValue(String scheme, @Nullable Scheme normalForm, @Nullable Port defaultPort) {\n    this.scheme = scheme;\n    this.normalForm = normalForm;\n    this.defaultPort = defaultPort;\n  }\n\n  @Override\n  @SuppressWarnings(\"DataFlowIssue\")\n  public Scheme normalise() {\n    return Objects.requireNonNullElse(normalForm, this);\n  }\n\n  @Override\n  public @Nullable Port getDefaultPort() {\n    if (defaultPort != null) {\n      return defaultPort;\n    } else if (normalForm != null) {\n      return normalForm.getDefaultPort();\n    } else {\n      return null;\n    }\n  }\n\n  @Override\n  public String toString() {\n    return scheme;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (!(o instanceof Scheme other)) {\n      return false;\n    }\n    return Objects.equals(this.scheme, other.toString());\n  }\n\n  @Override\n  public int hashCode() {\n    return scheme.hashCode();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Segment.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents a single segment of a path.\n *\n * <p>A path segment is a portion of a path between forward slashes. Special segments include the\n * empty segment, the dot segment ({@code .}), and the dot-dot segment ({@code ..}) used for\n * relative path resolution.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see Path\n */\npublic interface Segment extends PercentEncoded<Segment>, ParsedString {\n\n  /** An empty path segment. */\n  Segment EMPTY = new SegmentValue(\"\");\n\n  /** A dot segment ({@code .}) representing the current directory. */\n  Segment DOT = new SegmentValue(\".\");\n\n  /** A dot-dot segment ({@code ..}) representing the parent directory. */\n  @SuppressWarnings(\"unused\")\n  Segment DOT_DOT = new SegmentValue(\"..\");\n\n  /**\n   * Parses a string into a path segment.\n   *\n   * @param segment the string to parse\n   * @return the parsed segment\n   * @throws IllegalSegment if the string is not a valid segment\n   */\n  static Segment parse(String segment) throws IllegalSegment {\n    return SegmentParser.INSTANCE.parse(segment);\n  }\n\n  /**\n   * Encodes a string into a valid path segment with proper percent-encoding.\n   *\n   * @param unencoded the unencoded string\n   * @return the encoded segment\n   */\n  static Segment encode(String unencoded) {\n    return SegmentParser.INSTANCE.encode(unencoded);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/SegmentParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.alwaysIllegal;\nimport static org.wiremock.url.Constants.combine;\nimport static org.wiremock.url.Constants.include;\nimport static org.wiremock.url.Constants.subDelimCharSet;\nimport static org.wiremock.url.Constants.unreservedCharSet;\n\nimport java.util.function.Supplier;\nimport java.util.regex.Pattern;\n\npublic final class SegmentParser implements PercentEncodedStringParser<Segment> {\n\n  public static final SegmentParser INSTANCE = new SegmentParser();\n\n  private static final String segmentRegex = \"[^#?/\" + alwaysIllegal + \"]*\";\n  private static final Pattern segmentPattern = Pattern.compile(\"^\" + segmentRegex + \"$\");\n\n  @Override\n  public Class<Segment> getType() {\n    return Segment.class;\n  }\n\n  @Override\n  public Segment parse(String stringForm) {\n    return build(stringForm, () -> buildSafely(stringForm));\n  }\n\n  private Segment buildSafely(String stringForm) {\n    if (segmentPattern.matcher(stringForm).matches()) {\n      return new SegmentValue(stringForm);\n    } else {\n      throw new IllegalSegment(stringForm);\n    }\n  }\n\n  static final boolean[] segmentCharSet =\n      combine(unreservedCharSet, subDelimCharSet, include(':', '@'));\n\n  @Override\n  public Segment encode(String unencoded) {\n    return build(\n        unencoded, () -> new SegmentValue(PercentEncoding.encode(unencoded, segmentCharSet), true));\n  }\n\n  Segment build(String stringForm, Supplier<Segment> builder) {\n    return switch (stringForm) {\n      case \"\" -> Segment.EMPTY;\n      case \".\" -> Segment.DOT;\n      case \"..\" -> Segment.DOT_DOT;\n      default -> builder.get();\n    };\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/SegmentValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\nimport org.jspecify.annotations.Nullable;\n\nfinal class SegmentValue implements Segment {\n\n  private final String stringForm;\n  private final MemoisedNormalisable<Segment> memoisedNormalisable;\n\n  SegmentValue(String stringForm) {\n    this(stringForm, null);\n  }\n\n  @SuppressWarnings(\"DataFlowIssue\")\n  SegmentValue(String stringForm, @Nullable Boolean isNormalForm) {\n    this.stringForm = stringForm;\n    this.memoisedNormalisable =\n        new MemoisedNormalisable<>(this, isNormalForm, this::isNormalFormWork, this::normaliseWork);\n  }\n\n  @Override\n  public String toString() {\n    return stringForm;\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof Segment that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return stringForm.hashCode();\n  }\n\n  @Override\n  public Segment normalise() {\n    return memoisedNormalisable.normalise();\n  }\n\n  private @Nullable Segment normaliseWork() {\n    String result = PercentEncoding.normalise(stringForm, SegmentParser.segmentCharSet);\n    return result != null\n        ? SegmentParser.INSTANCE.build(result, () -> new SegmentValue(result, true))\n        : null;\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return memoisedNormalisable.isNormalForm();\n  }\n\n  private boolean isNormalFormWork() {\n    return PercentEncoding.isNormalForm(stringForm, SegmentParser.segmentCharSet);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/ServersideAbsoluteUrl.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\n/**\n * Represents an Absolute URL (a URL without an {@link Fragment}) as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-4.3\">RFC 3986 Section 4.3</a>. The\n * name {@link ServersideAbsoluteUrl} is used in preference to AbsoluteUrl because {@link\n * AbsoluteUrl} is more familiarly used by developers to mean a URL that is not relative, rather\n * than in the RFC 3986 sense of a complete URL without a fragment.\n *\n * <p>An {@link ServersideAbsoluteUrl} is a URL with no fragment, suitable for making requests for a\n * representation over the network.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-4.3\">RFC 3986 Section 4.3</a>\n */\npublic interface ServersideAbsoluteUrl extends AbsoluteUrl {\n\n  /**\n   * Implementations must ALWAYS return null\n   *\n   * @deprecated This always returns null so you have no reason to ever call it\n   * @return null\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  @Nullable\n  default Fragment getFragment() {\n    return null;\n  }\n\n  /**\n   * Returns a normalised form of this absolute URL.\n   *\n   * @return a normalised absolute URL\n   */\n  @Override\n  ServersideAbsoluteUrl normalise();\n\n  /**\n   * Returns this.\n   *\n   * @return this\n   */\n  @Override\n  @Deprecated // no point ever calling on this subtype\n  default ServersideAbsoluteUrl getServersideAbsoluteUrl() {\n    return this;\n  }\n\n  /**\n   * Parses a string into an absolute URL.\n   *\n   * @param absoluteUrl the string to parse\n   * @return the parsed absolute URL\n   * @throws IllegalServersideAbsoluteUrl if the string is not a valid absolute URL\n   */\n  static ServersideAbsoluteUrl parse(String absoluteUrl) throws IllegalServersideAbsoluteUrl {\n    return ServersideAbsoluteUrlParser.INSTANCE.parse(absoluteUrl);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/ServersideAbsoluteUrlParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic final class ServersideAbsoluteUrlParser implements StringParser<ServersideAbsoluteUrl> {\n\n  public static final ServersideAbsoluteUrlParser INSTANCE =\n      new ServersideAbsoluteUrlParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public ServersideAbsoluteUrlParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<ServersideAbsoluteUrl> getType() {\n    return ServersideAbsoluteUrl.class;\n  }\n\n  @Override\n  public ServersideAbsoluteUrl parse(String stringForm) throws IllegalServersideAbsoluteUrl {\n    var uri = uriParser.parse(stringForm);\n    if (uri instanceof ServersideAbsoluteUrl absoluteUrl) {\n      return absoluteUrl;\n    } else {\n      throw new IllegalServersideAbsoluteUrl(stringForm);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/ServersideAbsoluteUrlValue.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class ServersideAbsoluteUrlValue extends AbstractAbsoluteUrlValue<ServersideAbsoluteUrl>\n    implements ServersideAbsoluteUrl {\n\n  ServersideAbsoluteUrlValue(\n      @Nullable String stringValue,\n      Scheme scheme,\n      Authority authority,\n      Path path,\n      @Nullable Query query) {\n    super(stringValue, scheme, authority, path, query, null);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/StringTokenStream.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Iterator;\n\nabstract class StringTokenStream<T> implements Iterator<T> {\n\n  protected final String input;\n  protected int index = 0;\n\n  StringTokenStream(String input) {\n    this.input = input;\n  }\n\n  @Override\n  public boolean hasNext() {\n    return index < input.length();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Strings.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.function.Function;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\nfinal class Strings {\n\n  static String transform(\n      String original, Pattern pattern, Function<String, String> transformMatched) {\n    return transform(original, pattern, transformMatched, Function.identity());\n  }\n\n  static String transform(\n      String original,\n      Pattern pattern,\n      Function<String, String> transformMatched,\n      Function<String, String> transformUnmatched) {\n    StringBuilder result = new StringBuilder();\n    Matcher matcher = pattern.matcher(original);\n    int lastEnd = 0;\n\n    while (matcher.find()) {\n      // Transform the part before the match\n      result.append(transformUnmatched.apply(original.substring(lastEnd, matcher.start())));\n      // Transform the match\n      result.append(transformMatched.apply(matcher.group()));\n      lastEnd = matcher.end();\n    }\n\n    // Transform the remaining part\n    result.append(transformUnmatched.apply(original.substring(lastEnd)));\n\n    return result.toString();\n  }\n\n  private Strings() {\n    throw new UnsupportedOperationException(\"Not instantiable\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Uri.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.net.URI;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents a URI reference as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986\">RFC 3986</a>. The name {@link Uri} is used\n * in preference to UriReference to maintain consistency with the names {@link Url}, {@link\n * AbsoluteUrl} and {@link RelativeUrl} elsewhere in the hierarchy, which are chosen for familiarity\n * to developers.\n *\n * <p>An {@link Uri} is either an {@link AbsoluteUri} or an {@link Url}. {@link Uri}s are used to\n * identify resources and can be resolved against an {@link AbsoluteUri} to produce an {@link\n * AbsoluteUri}.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-4.1\">RFC 3986 Section 4.1</a>\n */\npublic sealed interface Uri extends ParsedString permits AbsoluteUri, AbstractUriValue, Url {\n\n  /**\n   * Returns the scheme component of this URI, or {@code null} if it is a URI Reference and so there\n   * is no scheme.\n   *\n   * @return the scheme component, or {@code null} if absent\n   */\n  @Nullable Scheme getScheme();\n\n  /**\n   * Returns the authority component of this URI reference, or {@code null} if there is no\n   * authority.\n   *\n   * @return the authority component, or {@code null} if absent\n   */\n  @Nullable Authority getAuthority();\n\n  /**\n   * Returns the path component of this URI reference.\n   *\n   * @return the path component, never {@code null}\n   */\n  Path getPath();\n\n  /**\n   * Returns the query component of this URI reference, or {@code null} if there is no query.\n   *\n   * @return the query component, or {@code null} if absent\n   */\n  @Nullable Query getQuery();\n\n  default Query getQueryOrEmpty() {\n    var query = getQuery();\n    return query != null ? query : Query.EMPTY;\n  }\n\n  /**\n   * Returns the fragment component of this URI reference, or {@code null} if there is no fragment.\n   *\n   * @return the fragment component, or {@code null} if absent\n   */\n  @Nullable Fragment getFragment();\n\n  /**\n   * Returns {@code true} if this is a relative reference (has no scheme).\n   *\n   * @return {@code true} if this is a relative reference\n   */\n  boolean isRelative();\n\n  /**\n   * Returns {@code true} if this is an absolute URI (either an absolute URL or an Opaque URI).\n   *\n   * @return {@code true} if this is an absolute URI\n   */\n  boolean isAbsolute();\n\n  /**\n   * Returns {@code true} if this is an absolute URL (has a scheme and authority).\n   *\n   * @return {@code true} if this is an absolute URL\n   */\n  boolean isAbsoluteUrl();\n\n  /**\n   * Returns {@code true} if this is an Opaque URI (has a scheme but no authority).\n   *\n   * @return {@code true} if this is an Opaque URI\n   */\n  boolean isOpaqueUri();\n\n  /**\n   * Returns the user info component from the authority, or {@code null} if there is no authority or\n   * no user info.\n   *\n   * @return the user info component, or {@code null} if absent\n   */\n  default @Nullable UserInfo getUserInfo() {\n    Authority authority = getAuthority();\n    return authority != null ? authority.getUserInfo() : null;\n  }\n\n  /**\n   * Returns the host component from the authority, or {@code null} if there is no authority.\n   *\n   * @return the host component, or {@code null} if absent\n   */\n  default @Nullable Host getHost() {\n    Authority authority = getAuthority();\n    return authority != null ? authority.getHost() : null;\n  }\n\n  /**\n   * Returns the port component from the authority, or {@code null} if there is no authority or no\n   * port.\n   *\n   * @return the port component, or {@code null} if absent\n   */\n  default @Nullable Port getPort() {\n    Authority authority = getAuthority();\n    return authority != null ? authority.getPort() : null;\n  }\n\n  /**\n   * Returns the resolved port, which is either the explicitly defined port or the default port for\n   * the scheme.\n   *\n   * @return the resolved port, or {@code null} if no port is defined and no default exists for the\n   *     scheme\n   */\n  default @Nullable Port getResolvedPort() {\n    Port definedPort = getPort();\n    Scheme scheme = getScheme();\n    return definedPort != null ? definedPort : (scheme != null ? scheme.getDefaultPort() : null);\n  }\n\n  /**\n   * Converts a {@code Uri} to a {@code java.net.URI}\n   *\n   * <p>This may fail with an {@code IllegalArgumentException} because {@code Uri} is more lenient\n   * than {@code java.net.URI}. Calling {@code Uri.normalise().toUri()} should nearly always work;\n   * the only cases where it will not are:\n   *\n   * <ol>\n   *   <li>{@code scheme:} - no authority, no path, no query, no fragment\n   *   <li>{@code scheme:#fragment} - no authority, no path, no query\n   *   <li>{@code scheme://} - empty authority, no path, no query, no fragment\n   * </ol>\n   *\n   * @return this as a {@code java.net.URI}\n   * @throws IllegalArgumentException if this is not a valid {@code java.net.URI}\n   */\n  default URI toJavaUri() throws IllegalArgumentException {\n    return URI.create(this.toString());\n  }\n\n  /**\n   * Parses a string into a URI reference.\n   *\n   * @param uri the string to parse\n   * @return the parsed URI reference\n   * @throws IllegalUri if the string is not a valid URI reference\n   */\n  static Uri parse(String uri) throws IllegalUri {\n    return UriParser.INSTANCE.parse(uri);\n  }\n\n  /**\n   * Converts a {@code java.net.URI} to a {@code Uri}.\n   *\n   * <p>This is guaranteed to succeed - if it throws an exception it is a bug.\n   *\n   * @param uri the value as a {@code java.net.URI}\n   * @return the value as a {@code Uri}\n   */\n  static Uri of(URI uri) {\n    return parse(uri.toASCIIString());\n  }\n\n  /**\n   * Creates a new builder for constructing URI references.\n   *\n   * @return a new builder\n   */\n  static Uri.Builder builder() {\n    return new UriBuilder();\n  }\n\n  /**\n   * Creates a new builder initialized with the values from the given URI reference.\n   *\n   * @param uri the URI reference to copy values from\n   * @return a new builder\n   */\n  static Uri.Builder builder(Uri uri) {\n    return new UriBuilder(uri);\n  }\n\n  interface Builder extends UriBaseBuilder<Builder> {\n\n    @Nullable Scheme getScheme();\n\n    Uri.Builder setScheme(@Nullable Scheme scheme);\n\n    @Override\n    Uri.Builder setAuthority(@Nullable Authority authority);\n  }\n\n  interface Transformer<SELF extends Transformer<SELF>> extends UriBaseBuilder<SELF> {\n\n    @Nullable Scheme getScheme();\n\n    SELF setScheme(Scheme scheme);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UriBaseBuilder.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\npublic interface UriBaseBuilder<SELF extends UriBaseBuilder<SELF>> {\n\n  @Nullable Authority getAuthority();\n\n  SELF setAuthority(Authority authority);\n\n  @Nullable UserInfo getUserInfo();\n\n  SELF setUserInfo(@Nullable UserInfo userInfo);\n\n  @Nullable Host getHost();\n\n  SELF setHost(Host host);\n\n  @Nullable Port getPort();\n\n  SELF setPort(@Nullable Port port);\n\n  Path getPath();\n\n  SELF setPath(Path path);\n\n  @Nullable Query getQuery();\n\n  SELF setQuery(@Nullable Query query);\n\n  Query.Builder getQueryBuilder();\n\n  SELF setQueryBuilder(Query.Builder query);\n\n  @Nullable Fragment getFragment();\n\n  SELF setFragment(@Nullable Fragment fragment);\n\n  Uri build();\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UriBuilder.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class UriBuilder extends AbstractUriBaseBuilder<Uri.Builder> implements Uri.Builder {\n\n  UriBuilder() {\n    super();\n  }\n\n  UriBuilder(Uri uri) {\n    super(uri);\n  }\n\n  @Override\n  public Uri.Builder setScheme(@Nullable Scheme scheme) {\n    return super.doSetScheme(scheme);\n  }\n\n  @Override\n  public Uri.Builder setAuthority(@Nullable Authority authority) {\n    return super.doSetAuthority(authority);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UriParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.StringParser;\n\npublic final class UriParser implements StringParser<Uri> {\n\n  public static final UriParser INSTANCE = new UriParser();\n\n  private static final Pattern regex =\n      Pattern.compile(\n          \"^(?:(?<scheme>[^:/?#]+):)?(?://(?<authority>[^/?#]*))?(?<path>[^?#]*)(?:\\\\?(?<query>[^#]*))?(?:#(?<fragment>.*))?\");\n\n  private final SchemeRegistry schemeRegistry;\n\n  public UriParser() {\n    this(SchemeRegistry.INSTANCE);\n  }\n\n  public UriParser(SchemeRegistry schemeRegistry) {\n    this.schemeRegistry = schemeRegistry;\n  }\n\n  @Override\n  public Class<Uri> getType() {\n    return Uri.class;\n  }\n\n  @Override\n  public Uri parse(String stringForm) {\n    try {\n      var result = regex.matcher(stringForm);\n      if (!result.matches()) {\n        if (stringForm.contains(\":\")) {\n          throw new IllegalAbsoluteUrl(stringForm);\n        } else {\n          throw new IllegalRelativeUrl(stringForm);\n        }\n      }\n\n      var schemeString = result.group(\"scheme\");\n      var scheme = schemeString == null ? null : schemeRegistry.parse(schemeString);\n\n      var queryString = result.group(\"query\");\n      var query = queryString == null ? null : Query.parse(queryString);\n\n      var fragmentString = result.group(\"fragment\");\n      var fragment = fragmentString == null ? null : Fragment.parse(fragmentString);\n\n      var authority = extractAuthorityOrNull(result);\n      var path = PathParser.INSTANCE.parse(result.group(\"path\"));\n\n      UriBuilder uriBuilder = new UriBuilder();\n      uriBuilder\n          .setScheme(scheme)\n          .setAuthority(authority)\n          .setPath(path)\n          .setQuery(query)\n          .setFragment(fragment);\n      return uriBuilder.build(stringForm);\n    } catch (IllegalUriPart illegalPart) {\n      throw new IllegalUri(stringForm, illegalPart);\n    }\n  }\n\n  @Nullable\n  private Authority extractAuthorityOrNull(Matcher matcher) {\n    String authorityStr = matcher.group(\"authority\");\n    if (authorityStr == null) {\n      return null;\n    } else {\n      return AuthorityParser.INSTANCE.parse(authorityStr);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Url.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.function.Consumer;\nimport org.jspecify.annotations.Nullable;\n\n/**\n * Represents a URL reference, which is the subset of URI references that are <b>not</b> full\n * (absolute) URIs without an authority - what we call {@link OpaqueUri}s. The name {@link Url} is\n * used in preference to UrlReference because it is more familiar to developers, who habitually\n * think of both relative and complete URL references as URLs.\n *\n * <p>An {@link Url} is either an {@link AbsoluteUrl} or an {@link RelativeUrl}. An {@link\n * AbsoluteUrl} is guaranteed to resolve to an {@link AbsoluteUrl} if resolved against an {@link\n * Url}, whereas it may resolve to an {@link OpaqueUri} if resolved against an {@link Uri}.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see Uri\n * @see AbsoluteUrl\n * @see RelativeUrl\n */\npublic sealed interface Url extends Uri permits RelativeUrl, UrlWithAuthority {\n\n  /**\n   * Returns the path and query components combined.\n   *\n   * @return the path and query\n   */\n  default PathAndQuery getPathAndQuery() {\n    return new PathAndQueryValue(getPath(), getQuery());\n  }\n\n  /**\n   * Creates a transformer initialized with the values from this URL.\n   *\n   * @return a transformer\n   */\n  default Url.Transformer<?> thaw() {\n    return new UrlTransformer(this);\n  }\n\n  /**\n   * Convenience method for transforming a Url\n   *\n   * @param mutator a function to mutate the transformer\n   * @return the transformed Url\n   * @throws IllegalUrl if scheme is set and Authority is not set\n   */\n  default Url transform(Consumer<Uri.Transformer<?>> mutator) throws IllegalUri {\n    var transformer = thaw();\n    mutator.accept(transformer);\n    return transformer.build();\n  }\n\n  /**\n   * Creates a new builder\n   *\n   * @return a new builder\n   */\n  static Url.Builder builder() {\n    return new UrlBuilder();\n  }\n\n  /**\n   * Creates a builder initialized with the values from the given URL.\n   *\n   * @param url the URL to copy values from\n   * @return a new builder\n   */\n  static Url.Builder builder(Url url) {\n    return new UrlBuilder(url);\n  }\n\n  /**\n   * Parses a string into a URI reference.\n   *\n   * @param url the string to parse\n   * @return the parsed URI reference\n   * @throws IllegalUri if the string is not a valid URI reference\n   */\n  static Url parse(String url) throws IllegalUri {\n    return UrlParser.INSTANCE.parse(url);\n  }\n\n  interface Builder extends UriBaseBuilder<Builder> {\n\n    @Nullable Scheme getScheme();\n\n    Url.Builder setScheme(@Nullable Scheme scheme);\n\n    @Override\n    Url.Builder setAuthority(@Nullable Authority authority);\n\n    /**\n     * @return the built Url\n     * @throws IllegalUrl if scheme is set and Authority is not set\n     */\n    @Override\n    Url build() throws IllegalUri;\n  }\n\n  interface Transformer<SELF extends Transformer<SELF>> extends Uri.Transformer<SELF> {\n\n    /**\n     * @return the transformed Url\n     * @throws IllegalUrl if scheme is set and Authority is not set\n     */\n    @Override\n    Url build() throws IllegalUri;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UrlBuilder.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\nfinal class UrlTransformer extends AbstractUriBaseBuilder<UrlTransformer>\n    implements Url.Transformer<UrlTransformer> {\n\n  UrlTransformer(Url url) {\n    super(url);\n  }\n\n  @Override\n  public Url build() {\n    Uri uri = super.build();\n    if (uri instanceof Url url) {\n      return url;\n    } else {\n      throw new IllegalUrl(uri.toString(), \"Illegal url: `\" + uri + \"`; a url has an authority\");\n    }\n  }\n\n  @Override\n  public @Nullable Scheme getScheme() {\n    return this.scheme;\n  }\n\n  @Override\n  public UrlTransformer setScheme(@Nullable Scheme scheme) {\n    return super.doSetScheme(scheme);\n  }\n\n  @Override\n  public @Nullable Authority getAuthority() {\n    return this.authority;\n  }\n\n  @Override\n  public UrlTransformer setAuthority(@Nullable Authority authority) {\n    return super.doSetAuthority(authority);\n  }\n}\n\nfinal class UrlBuilder extends AbstractUriBaseBuilder<Url.Builder> implements Url.Builder {\n\n  UrlBuilder() {\n    super();\n  }\n\n  UrlBuilder(Uri uri) {\n    super(uri);\n  }\n\n  @Override\n  public Url.Builder setScheme(@Nullable Scheme scheme) {\n    return super.doSetScheme(scheme);\n  }\n\n  @Override\n  public Url.Builder setAuthority(@Nullable Authority authority) {\n    return super.doSetAuthority(authority);\n  }\n\n  @Override\n  public Url build() {\n    Uri uri = super.build();\n    if (uri instanceof Url url) {\n      return url;\n    } else {\n      throw new IllegalUrl(uri.toString(), \"Illegal url: `\" + uri + \"`; a url has an authority\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UrlParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic final class UrlParser implements StringParser<Url> {\n\n  public static final UrlParser INSTANCE = new UrlParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public UrlParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<Url> getType() {\n    return Url.class;\n  }\n\n  @Override\n  public Url parse(String stringForm) {\n    var uri = uriParser.parse(stringForm);\n    if (uri instanceof Url url) {\n      return url;\n    } else {\n      throw new IllegalUrl(stringForm, \"Illegal url: `\" + uri + \"`; a url has an authority\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UrlWithAuthority.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\npublic sealed interface UrlWithAuthority extends Url permits SchemeRelativeUrl, AbsoluteUrl {\n\n  /**\n   * Returns the authority component of this URL.\n   *\n   * <p>URLs always have an authority component (unlike relative references and URNs).\n   *\n   * @return the authority component, never {@code null}\n   */\n  @Override\n  Authority getAuthority();\n\n  SchemeRelativeUrl getSchemeRelativeUrl();\n\n  /**\n   * Parses a string into a URL with an authority.\n   *\n   * @param url the string to parse\n   * @return the parsed URI reference\n   * @throws IllegalUrl if the string is not a valid URI reference\n   */\n  static UrlWithAuthority parse(String url) throws IllegalUrl {\n    return UrlWithAuthorityParser.INSTANCE.parse(url);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UrlWithAuthorityParser.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.StringParser;\n\npublic class UrlWithAuthorityParser implements StringParser<UrlWithAuthority> {\n\n  public static final UrlWithAuthorityParser INSTANCE =\n      new UrlWithAuthorityParser(UriParser.INSTANCE);\n\n  private final UriParser uriParser;\n\n  public UrlWithAuthorityParser(UriParser uriParser) {\n    this.uriParser = uriParser;\n  }\n\n  @Override\n  public Class<UrlWithAuthority> getType() {\n    return UrlWithAuthority.class;\n  }\n\n  @Override\n  public UrlWithAuthority parse(String url) {\n    var uri = uriParser.parse(url);\n    if (uri instanceof UrlWithAuthority absoluteUri) {\n      return absoluteUri;\n    } else {\n      if (url.contains(\":\")) {\n        throw new IllegalAbsoluteUrl(url);\n      } else {\n        throw new IllegalRelativeUrl(url);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UserInfo.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents the user information component of a URI authority as defined in <a\n * href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1\">RFC 3986 Section 3.2.1</a>.\n *\n * <p>User information typically consists of a username and optional password in the form {@code\n * username[:password]}. It appears before the host in a URI, separated by an {@code @} symbol.\n *\n * <p><strong>Security Note:</strong> Including passwords in URIs is deprecated due to security\n * concerns. Most modern protocols discourage this practice.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see <a href=\"https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1\">RFC 3986 Section\n *     3.2.1</a>\n */\npublic interface UserInfo extends PercentEncoded<UserInfo>, ParsedString {\n\n  /**\n   * Parses a string into user info.\n   *\n   * @param userInfoString the string to parse\n   * @return the parsed user info\n   * @throws IllegalUserInfo if the string is not valid user info\n   */\n  static UserInfo parse(String userInfoString) throws IllegalUserInfo {\n    return UserInfoParser.INSTANCE.parse(userInfoString);\n  }\n\n  /**\n   * Encodes a string into valid user info with proper percent-encoding.\n   *\n   * @param unencoded the unencoded string\n   * @return the encoded user info\n   */\n  static UserInfo encode(String unencoded) {\n    return UserInfoParser.INSTANCE.encode(unencoded);\n  }\n\n  /**\n   * Returns the username component.\n   *\n   * @return the username, never {@code null}\n   */\n  Username getUsername();\n\n  /**\n   * Returns the password component, or {@code null} if there is no password.\n   *\n   * @return the password, or {@code null} if absent\n   */\n  @Nullable Password getPassword();\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UserInfoParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.*;\n\nimport java.util.regex.Pattern;\n\npublic final class UserInfoParser implements PercentEncodedStringParser<UserInfo> {\n\n  public static final UserInfoParser INSTANCE = new UserInfoParser();\n\n  static final String userInfoRegex = \"(?:[\" + unreserved + subDelims + \":]|\" + pctEncoded + \")*\";\n\n  private final Pattern userInfoPattern = Pattern.compile(\"^\" + userInfoRegex + \"$\");\n\n  @Override\n  public Class<UserInfo> getType() {\n    return UserInfo.class;\n  }\n\n  @Override\n  public UserInfo parse(String stringForm) {\n    if (userInfoPattern.matcher(stringForm).matches()) {\n      return new UserInfoValue(stringForm);\n    } else {\n      throw new IllegalUserInfo(stringForm);\n    }\n  }\n\n  static final boolean[] usernameCharSet = combine(unreservedCharSet, subDelimCharSet);\n\n  static final boolean[] userInfoCharSet = combine(usernameCharSet, include(':'));\n\n  @Override\n  public UserInfo encode(String unencoded) {\n    String encoded = PercentEncoding.encode(unencoded, userInfoCharSet);\n    return parse(encoded);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UserInfoValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\nimport org.jspecify.annotations.Nullable;\n\nfinal class UserInfoValue implements UserInfo {\n\n  private final String userInfo;\n  private final Username username;\n  private final @Nullable Password password;\n\n  UserInfoValue(String userInfo) {\n    this.userInfo = userInfo;\n    var components = userInfo.split(\":\", 2);\n    this.username = new UsernameValue(components[0]);\n    if (components.length == 2) {\n      this.password = new PasswordValue(components[1]);\n    } else {\n      this.password = null;\n    }\n  }\n\n  UserInfoValue(Username username, @Nullable Password password) {\n    this.userInfo = password == null ? username.toString() : username + \":\" + password;\n    this.username = username;\n    this.password = password;\n  }\n\n  @Override\n  public String toString() {\n    return userInfo;\n  }\n\n  @Override\n  public Username getUsername() {\n    return username;\n  }\n\n  @Override\n  public @Nullable Password getPassword() {\n    return password;\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof UserInfo that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(userInfo);\n  }\n\n  @Override\n  public UserInfo normalise() {\n\n    var normalisedUsername = username.normalise();\n    var normalisedPassword = password != null ? password.normalise() : null;\n\n    if (normalisedUsername.equals(username) && Objects.equals(normalisedPassword, password)) {\n      return this;\n    } else {\n      return new UserInfoValue(normalisedUsername, normalisedPassword);\n    }\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return username.isNormalForm() && (password == null || password.isNormalForm());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/Username.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.wiremock.stringparser.ParsedString;\n\n/**\n * Represents the username portion of user information in a URI authority.\n *\n * <p>The username is the part before the colon in user information ({@code username:password}).\n * Usernames may contain percent-encoded characters.\n *\n * <p>Implementations must be immutable and thread-safe.\n *\n * @see UserInfo\n */\npublic interface Username extends PercentEncoded<Username>, ParsedString {\n\n  /**\n   * Parses a string into a username.\n   *\n   * @param username the string to parse\n   * @return the parsed username\n   * @throws IllegalUsername if the string is not a valid username\n   */\n  static Username parse(String username) throws IllegalUsername {\n    return UsernameParser.INSTANCE.parse(username);\n  }\n\n  /**\n   * Encodes a string into a valid username with proper percent-encoding.\n   *\n   * @param unencoded the unencoded string\n   * @return the encoded username\n   */\n  static Username encode(String unencoded) {\n    return UsernameParser.INSTANCE.encode(unencoded);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UsernameParser.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.wiremock.url.Constants.*;\n\nimport java.util.regex.Pattern;\n\npublic final class UsernameParser implements PercentEncodedStringParser<Username> {\n\n  public static final UsernameParser INSTANCE = new UsernameParser();\n\n  final String usernameRegex = \"(?:[\" + unreserved + subDelims + \"]|\" + pctEncoded + \")*\";\n\n  private final Pattern usernamePattern = Pattern.compile(\"^\" + usernameRegex + \"$\");\n\n  @Override\n  public Class<Username> getType() {\n    return Username.class;\n  }\n\n  @Override\n  public Username parse(String stringForm) throws IllegalUsername {\n    if (usernamePattern.matcher(stringForm).matches()) {\n      return new UsernameValue(stringForm);\n    } else {\n      throw new IllegalUsername(stringForm);\n    }\n  }\n\n  private static final boolean[] usernameCharSet = combine(unreservedCharSet, subDelimCharSet);\n\n  @Override\n  public Username encode(String unencoded) {\n    String encoded = PercentEncoding.encode(unencoded, usernameCharSet);\n    return new UsernameValue(encoded);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/UsernameValue.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.Objects;\n\nfinal class UsernameValue implements Username {\n\n  private final String username;\n  private final boolean isNormalForm;\n\n  UsernameValue(String username) {\n    this(username, false);\n  }\n\n  UsernameValue(String username, boolean isNormalForm) {\n    this.username = username;\n    this.isNormalForm = isNormalForm;\n  }\n\n  @Override\n  public Username normalise() {\n    if (isNormalForm) {\n      return this;\n    }\n\n    String result = PercentEncoding.normalise(username, UserInfoParser.usernameCharSet);\n\n    if (result == null) {\n      return this;\n    } else {\n      return new UsernameValue(result, true);\n    }\n  }\n\n  @Override\n  public boolean isNormalForm() {\n    return isNormalForm || PercentEncoding.isNormalForm(username, UserInfoParser.usernameCharSet);\n  }\n\n  @Override\n  public String toString() {\n    return username;\n  }\n\n  @Override\n  public boolean equals(Object obj) {\n    if (obj == this) {\n      return true;\n    } else if (obj instanceof Username that) {\n      return Objects.equals(this.toString(), that.toString());\n    } else {\n      return false;\n    }\n  }\n\n  @Override\n  public int hashCode() {\n    return Objects.hash(username);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/main/java/org/wiremock/url/package-info.java",
    "content": "@NullMarked\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.NullMarked;\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/AbsoluteUriTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.Assertions.assertThatIllegalStateException;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\nimport static org.wiremock.url.SchemeRegistry.https;\nimport static org.wiremock.url.SchemeRegistry.wss;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\npublic class AbsoluteUriTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void parses_absolute_url_correctly() {\n      var absoluteUrl = AbsoluteUri.parse(\"https://example.com/path?query#fragment\");\n\n      assertThat(absoluteUrl.toString()).isEqualTo(\"https://example.com/path?query#fragment\");\n      assertThat(absoluteUrl).isInstanceOf(AbsoluteUrl.class);\n    }\n\n    @Test\n    void parses_absolute_url_with_userinfo_correctly() {\n      var absoluteUrl = AbsoluteUri.parse(\"https://user@example.com/path?query#fragment\");\n\n      assertThat(absoluteUrl.toString()).isEqualTo(\"https://user@example.com/path?query#fragment\");\n      assertThat(absoluteUrl).isInstanceOf(AbsoluteUrl.class);\n    }\n\n    @Test\n    void parses_serverside_absolute_url_correctly() {\n      var serversideAbsoluteUrl = AbsoluteUri.parse(\"https://example.com/path?query\");\n\n      assertThat(serversideAbsoluteUrl.toString()).isEqualTo(\"https://example.com/path?query\");\n      assertThat(serversideAbsoluteUrl).isInstanceOf(ServersideAbsoluteUrl.class);\n    }\n\n    @Test\n    void parses_serverside_absolute_url_empty_host_and_port_correctly() {\n      var serversideAbsoluteUrl = AbsoluteUri.parse(\"data://:443\");\n\n      assertThat(serversideAbsoluteUrl.toString()).isEqualTo(\"data://:443\");\n      assertThat(serversideAbsoluteUrl).isInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_origin_correctly() {\n      var origin = AbsoluteUri.parse(\"https://example.com\");\n\n      assertThat(origin.toString()).isEqualTo(\"https://example.com\");\n      assertThat(origin).isInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_mailto_correctly() {\n      var mailtoUri = AbsoluteUri.parse(\"mailto:joan@example.com\");\n\n      assertThat(mailtoUri.toString()).isEqualTo(\"mailto:joan@example.com\");\n      assertThat(mailtoUri).isInstanceOf(OpaqueUri.class);\n    }\n\n    @Test\n    void parses_arn_correctly() {\n      var arn =\n          AbsoluteUri.parse(\n              \"arn:aws:servicecatalog:us-east-1:912624918755:stack/some-stack/pp-a3B9zXp1mQ7rS\");\n\n      assertThat(arn.toString())\n          .isEqualTo(\n              \"arn:aws:servicecatalog:us-east-1:912624918755:stack/some-stack/pp-a3B9zXp1mQ7rS\");\n      assertThat(arn).isInstanceOf(OpaqueUri.class);\n    }\n\n    @Test\n    void parses_file_empty_authority_correctly() {\n      var fileUri = AbsoluteUri.parse(\"file:///home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file:///home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n    }\n\n    @Test\n    void parses_file_with_authority_correctly() {\n      var fileUri = AbsoluteUri.parse(\"file://user@remote/home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file://user@remote/home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n    }\n\n    @Test\n    void parses_file_no_authority_correctly() {\n      var fileUri = AbsoluteUri.parse(\"file:/home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file:/home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(OpaqueUri.class);\n    }\n\n    @Test\n    void rejects_illegal_uri() {\n      IllegalUri exception =\n          assertThatExceptionOfType(IllegalUri.class)\n              .isThrownBy(() -> AbsoluteUri.parse(\"not a :uri\"))\n              .actual();\n      assertThat(exception.getMessage()).isEqualTo(\"Illegal uri: `not a :uri`\");\n      assertThat(exception.getIllegalValue()).isEqualTo(\"not a :uri\");\n\n      IllegalScheme cause =\n          assertThat(exception.getCause()).asInstanceOf(type(IllegalScheme.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\"Illegal scheme `not a `; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n      assertThat(cause.getIllegalValue()).isEqualTo(\"not a \");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    static final List<String> illegalAbsoluteUris =\n        List.of(\n            \"//example.com/path?query#fragment\",\n            \"/path?query#fragment\",\n            \"/path?query\",\n            \"\",\n            \"relative\",\n            \"?\",\n            \"#\");\n\n    @ParameterizedTest\n    @FieldSource(\"illegalAbsoluteUris\")\n    void rejects_illegal_absolute_uri(String illegalAbsoluteUri) {\n      assertThatExceptionOfType(IllegalAbsoluteUri.class)\n          .isThrownBy(() -> AbsoluteUri.parse(illegalAbsoluteUri))\n          .withMessage(\"Illegal absolute uri: `\" + illegalAbsoluteUri + \"`\")\n          .extracting(IllegalAbsoluteUri::getIllegalValue)\n          .isEqualTo(illegalAbsoluteUri);\n    }\n  }\n\n  @SuppressWarnings(\"HttpUrlsUsage\")\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<AbsoluteUri>> normalisationCases =\n        Stream.<Pair<String, String>>of(\n                // Scheme normalization - uppercase to lowercase\n                Pair.of(\"HTTPS://EXAMPLE.COM:8080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTPS://example.com:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTPS://example.com:8080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTP://example.com\", \"http://example.com/\"),\n                Pair.of(\"FTP://example.com\", \"ftp://example.com/\"),\n\n                // Host normalization - uppercase to lowercase\n                Pair.of(\"https://EXAMPLE.COM:8080\", \"https://example.com:8080/\"),\n                Pair.of(\"https://EXAMPLE.COM:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"http://WWW.EXAMPLE.COM\", \"http://www.example.com/\"),\n                Pair.of(\"http://Example.Com\", \"http://example.com/\"),\n\n                // Port normalization - leading zeros\n                Pair.of(\"https://example.com:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"http://example.com:09090\", \"http://example.com:9090/\"),\n                Pair.of(\"http://example.com:00080\", \"http://example.com/\"),\n\n                // Port normalization - default port removal\n                Pair.of(\"http://example.com:80\", \"http://example.com/\"),\n                Pair.of(\"http://example.com:80/\", \"http://example.com/\"),\n                Pair.of(\"http://example.com:80/path\", \"http://example.com/path\"),\n                Pair.of(\"http://example.com:080\", \"http://example.com/\"),\n                Pair.of(\"https://example.com:443\", \"https://example.com/\"),\n                Pair.of(\"https://example.com:443/\", \"https://example.com/\"),\n                Pair.of(\"https://example.com:443/path\", \"https://example.com/path\"),\n                Pair.of(\"https://example.com:0443\", \"https://example.com/\"),\n\n                // Percent encoding - uppercase hex digits in path\n                Pair.of(\"http://example.com/%1f\", \"http://example.com/%1F\"),\n                Pair.of(\"http://example.com/%1f%3f\", \"http://example.com/%1F%3F\"),\n                Pair.of(\"http://example.com/path%1fto\", \"http://example.com/path%1Fto\"),\n                Pair.of(\"http://example.com/%3f%3F\", \"http://example.com/%3F%3F\"),\n                Pair.of(\"http://example.com/%ab%cd%ef\", \"http://example.com/%AB%CD%EF\"),\n\n                // Percent encoding - decode unreserved characters in path (A-Z a-z 0-9 - . _ ~)\n                Pair.of(\"http://example.com/%41\", \"http://example.com/A\"),\n                Pair.of(\"http://example.com/%61\", \"http://example.com/a\"),\n                Pair.of(\"http://example.com/%30\", \"http://example.com/0\"),\n                Pair.of(\"http://example.com/%7E\", \"http://example.com/~\"),\n                Pair.of(\"http://example.com/%7e\", \"http://example.com/~\"),\n                Pair.of(\"http://example.com/%2D\", \"http://example.com/-\"),\n                Pair.of(\"http://example.com/%2E\", \"http://example.com/\"),\n                Pair.of(\"http://example.com/%5F\", \"http://example.com/_\"),\n                Pair.of(\"http://example.com/%41%42%43\", \"http://example.com/ABC\"),\n                Pair.of(\"http://example.com/~%75ser\", \"http://example.com/~user\"),\n\n                // Percent encoding - uppercase hex in query\n                Pair.of(\"http://example.com?key=%1f\", \"http://example.com/?key=%1F\"),\n                Pair.of(\"http://example.com?a=%1f&b=%1a\", \"http://example.com/?a=%1F&b=%1A\"),\n                Pair.of(\"http://example.com?key=%ab\", \"http://example.com/?key=%AB\"),\n\n                // Percent encoding - uppercase hex in fragment\n                Pair.of(\"http://example.com#%1f\", \"http://example.com/#%1F\"),\n                Pair.of(\"http://example.com#%ab\", \"http://example.com/#%AB\"),\n\n                // Combined normalizations - scheme + host + port\n                Pair.of(\"HTTP://EXAMPLE.COM:80\", \"http://example.com/\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:443\", \"https://example.com/\"),\n                Pair.of(\"HTTP://EXAMPLE.COM:080\", \"http://example.com/\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:0443\", \"https://example.com/\"),\n\n                // Combined normalizations - multiple components\n                Pair.of(\"HTTP://EXAMPLE.COM:80/%1f\", \"http://example.com/%1F\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:443/PATH\", \"https://example.com/PATH\"),\n                Pair.of(\"HTTP://EXAMPLE.COM/%41%42\", \"http://example.com/AB\"),\n                Pair.of(\"HTTP://EXAMPLE.COM:080/%1f?a=%1f#%1f\", \"http://example.com/%1F?a=%1F#%1F\"),\n                Pair.of(\n                    \"HTTPS://EXAMPLE.COM:443/%61?%62=%63#%64\", \"https://example.com/a?%62=%63#%64\"),\n\n                // Path with percent encoding variations\n                Pair.of(\"http://example.com/%41/%42/%43\", \"http://example.com/A/B/C\"),\n                Pair.of(\n                    \"http://example.com/path/%1F/segment\", \"http://example.com/path/%1F/segment\"),\n                Pair.of(\"http://example.com/%7Euser/docs\", \"http://example.com/~user/docs\"),\n\n                // Query and fragment combinations\n                Pair.of(\"http://example.com?key=%1f#%1f\", \"http://example.com/?key=%1F#%1F\"),\n\n                // Multiple ports in different contexts\n                Pair.of(\"http://example.com:8080\", \"http://example.com:8080/\"),\n                Pair.of(\"https://example.com:8443\", \"https://example.com:8443/\"),\n                Pair.of(\"ftp://example.com:21\", \"ftp://example.com/\"),\n\n                // Non-spec driven\n                /*\n                `whatever:/..//` is a URI without an Authority.\n                Acording to the spec https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n                `/..//` should normalise to `//`, so `whatever:/..//` should normalise to `whatever://`.\n                However, this changes the semantics to now have an (empty) authority and an empty path.\n\n                We have made an executive decision that if a URI without an Authority has a path that\n                normalises to more than one `/` at the start, they will be treatd as a single `/`.\n                */\n                Pair.of(\"whatever:/..//\", \"whatever:/\"),\n\n                // Mixed case hex digits\n                Pair.of(\"http://example.com/%aB%Cd\", \"http://example.com/%AB%CD\"),\n                Pair.of(\"http://example.com?key=%aB\", \"http://example.com/?key=%AB\"),\n                Pair.of(\"http://example.com#%aB\", \"http://example.com/#%AB\"))\n            .map(\n                it ->\n                    new NormalisationCase<>(\n                        AbsoluteUri.parse(it.getLeft()), AbsoluteUri.parse(it.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_uri_reference_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(\n          normalisationCases.stream().filter(t -> !t.normalForm().equals(t.notNormal())).toList());\n    }\n\n    static final List<String> alreadyNormalised =\n        List.of(\"http://example.com/#%7E\", \"http://example.com/?%61=%62\");\n\n    static final List<? extends AbsoluteUri> alreadyNormalisedUriReferences =\n        Lists.concat(\n            normalisationCases.stream().map(NormalisationCase::normalForm).distinct().toList(),\n            alreadyNormalised.stream().map(AbsoluteUri::parse).toList());\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedUriReferences);\n    }\n  }\n\n  @Nested\n  class Resolve {\n\n    @Test\n    void resolve_replaces_query_if_other_has_authority_and_query() {\n      var base = AbsoluteUri.parse(\"https://example.com?query\");\n      assertThat(base.getQuery()).isEqualTo(Query.parse(\"query\"));\n      var other = RelativeUrl.parse(\"//other.com?newquery\");\n      assertThat(other.getQuery()).isEqualTo(Query.parse(\"newquery\"));\n\n      var resolved = base.resolve(other);\n      assertThat(resolved.toString()).isEqualTo(\"https://other.com/?newquery\");\n      assertThat(resolved.getQuery()).isEqualTo(Query.parse(\"newquery\"));\n    }\n\n    @Test\n    void resolve_replaces_query_if_other_has_authority_and_no_query() {\n      var base = AbsoluteUri.parse(\"https://example.com?query\");\n      assertThat(base.getQuery()).isEqualTo(Query.parse(\"query\"));\n      var other = RelativeUrl.parse(\"//other.com\");\n      assertThat(other.getQuery()).isNull();\n\n      var resolved = base.resolve(other);\n      assertThat(resolved.toString()).isEqualTo(\"https://other.com/\");\n      assertThat(resolved.getQuery()).isNull();\n    }\n  }\n\n  @Nested\n  class Builder {\n\n    @Test\n    void can_build_an_absolute_uri() {\n\n      AbsoluteUri uri =\n          AbsoluteUri.builder(https)\n              .setAuthority(Authority.parse(\"example.com\"))\n              .setPath(Path.parse(\"/path\"))\n              .setQuery(Query.parse(\"query\"))\n              .setFragment(Fragment.parse(\"fragment\"))\n              .build();\n\n      assertThat(uri).isEqualTo(Uri.parse(\"https://example.com/path?query#fragment\"));\n    }\n\n    @Test\n    void can_build_an_absolute_uri_with_separate_authority_parts() {\n\n      var uri =\n          AbsoluteUri.builder(https)\n              .setHost(Host.parse(\"example.com\"))\n              .setUserInfo(UserInfo.parse(\"user:password\"))\n              .setPort(Port.of(8443))\n              .setPath(Path.parse(\"/path\"))\n              .setQuery(Query.parse(\"query\"))\n              .setFragment(Fragment.parse(\"fragment\"))\n              .build();\n\n      assertThat(uri)\n          .isEqualTo(\n              AbsoluteUri.parse(\"https://user:password@example.com:8443/path?query#fragment\"));\n    }\n\n    private static final List<AbsoluteUri.Builder<?>> authorityBuilders =\n        List.of(\n            AbsoluteUri.builder(https)\n                .setHost(Host.parse(\"example.com\"))\n                .setUserInfo(UserInfo.parse(\"user:password\"))\n                .setPort(Port.of(8443)),\n            AbsoluteUri.builder(https)\n                .setHost(Host.parse(\"example.com\"))\n                .setPort(Port.of(8443))\n                .setUserInfo(UserInfo.parse(\"user:password\")),\n            AbsoluteUri.builder(https)\n                .setPort(Port.of(8443))\n                .setHost(Host.parse(\"example.com\"))\n                .setUserInfo(UserInfo.parse(\"user:password\")),\n            AbsoluteUri.builder(https)\n                .setPort(Port.of(8443))\n                .setUserInfo(UserInfo.parse(\"user:password\"))\n                .setHost(Host.parse(\"example.com\")),\n            AbsoluteUri.builder(https)\n                .setUserInfo(UserInfo.parse(\"user:password\"))\n                .setPort(Port.of(8443))\n                .setHost(Host.parse(\"example.com\")),\n            AbsoluteUri.builder(https)\n                .setUserInfo(UserInfo.parse(\"user:password\"))\n                .setHost(Host.parse(\"example.com\"))\n                .setPort(Port.of(8443)));\n\n    @ParameterizedTest\n    @FieldSource(\"authorityBuilders\")\n    void can_set_authority_fields_in_any_order(AbsoluteUri.Builder<?> builder) {\n      var uri =\n          builder\n              .setPath(Path.parse(\"/path\"))\n              .setQuery(Query.parse(\"query\"))\n              .setFragment(Fragment.parse(\"fragment\"))\n              .build();\n      assertThat(uri)\n          .isEqualTo(\n              AbsoluteUri.parse(\"https://user:password@example.com:8443/path?query#fragment\"));\n    }\n\n    @Test\n    void setting_user_info_after_authority_works() {\n      var uri =\n          AbsoluteUri.builder(https)\n              .setAuthority(Authority.parse(\"user@example.com:8443\"))\n              .setUserInfo(UserInfo.parse(\"me:passwd\"))\n              .build();\n\n      assertThat(uri).isEqualTo(AbsoluteUri.parse(\"https://me:passwd@example.com:8443/\"));\n    }\n\n    @Test\n    void setting_host_after_authority_works() {\n      var uri =\n          AbsoluteUri.builder(https)\n              .setAuthority(Authority.parse(\"user@www.example.com:8443\"))\n              .setHost(Host.parse(\"example.com\"))\n              .build();\n\n      assertThat(uri).isEqualTo(AbsoluteUri.parse(\"https://user@example.com:8443/\"));\n    }\n\n    @Test\n    void setting_port_after_authority_works() {\n      var uri =\n          AbsoluteUri.builder(https)\n              .setAuthority(Authority.parse(\"user@example.com:8443\"))\n              .setPort(Port.of(88443))\n              .build();\n\n      assertThat(uri).isEqualTo(AbsoluteUri.parse(\"https://user@example.com:88443/\"));\n    }\n\n    @Test\n    void authority_overrides_user_info_and_port() {\n      var uri =\n          AbsoluteUri.builder(https)\n              .setUserInfo(UserInfo.parse(\"me:passwd\"))\n              .setPort(Port.of(88443))\n              .setAuthority(Authority.parse(\"user@example.com:8443\"))\n              .build();\n\n      assertThat(uri).isEqualTo(AbsoluteUri.parse(\"https://user@example.com:8443/\"));\n    }\n\n    @Test\n    void build_fails_if_user_info_set_and_host_or_authority_not() {\n      assertThatIllegalStateException()\n          .isThrownBy(\n              () -> AbsoluteUri.builder(https).setUserInfo(UserInfo.parse(\"me:passwd\")).build())\n          .withMessage(\"Cannot construct a uri with a userinfo or port but no host\")\n          .withNoCause();\n    }\n\n    @Test\n    void build_fails_if_port_set_and_host_or_authority_not() {\n      assertThatIllegalStateException()\n          .isThrownBy(() -> AbsoluteUri.builder(https).setPort(Port.of(88443)).build())\n          .withMessage(\"Cannot construct a uri with a userinfo or port but no host\")\n          .withNoCause();\n    }\n\n    @Test\n    void build_fails_if_user_info_and_port_set_and_host_or_authority_not() {\n      assertThatIllegalStateException()\n          .isThrownBy(\n              () ->\n                  AbsoluteUri.builder(https)\n                      .setUserInfo(UserInfo.parse(\"me:passwd\"))\n                      .setPort(Port.of(88443))\n                      .build())\n          .withMessage(\"Cannot construct a uri with a userinfo or port but no host\")\n          .withNoCause();\n    }\n  }\n\n  @Nested\n  class Transform {\n\n    @Test\n    void can_change_an_absolute_uris_scheme() {\n\n      AbsoluteUri absoluteUri =\n          AbsoluteUri.parse(\"https://user@example.com:8443/path?query#fragment\");\n      AbsoluteUri transformed = absoluteUri.transform(it -> it.setScheme(wss));\n\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .isEqualTo(AbsoluteUri.parse(\"wss://user@example.com:8443/path?query#fragment\"));\n    }\n\n    @Test\n    void can_change_an_absolute_uris_authority() {\n\n      AbsoluteUri absoluteUri =\n          AbsoluteUri.parse(\"https://user@example.com:8443/path?query#fragment\");\n      AbsoluteUri transformed =\n          absoluteUri.transform(it -> it.setAuthority(Authority.parse(\"www.example.com\")));\n\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .isEqualTo(AbsoluteUri.parse(\"https://www.example.com/path?query#fragment\"));\n    }\n\n    @Test\n    void can_change_an_opaque_uris_scheme() {\n\n      AbsoluteUri absoluteUri = AbsoluteUri.parse(\"file:/path?query#fragment\");\n      AbsoluteUri transformed = absoluteUri.transform(it -> it.setScheme(wss));\n\n      assertThat(transformed)\n          .isInstanceOf(OpaqueUri.class)\n          .isEqualTo(AbsoluteUri.parse(\"wss:/path?query#fragment\"));\n    }\n\n    @Test\n    void can_change_an_opaque_uris_authority() {\n\n      AbsoluteUri absoluteUri = AbsoluteUri.parse(\"file:/path?query#fragment\");\n      AbsoluteUri transformed =\n          absoluteUri.transform(it -> it.setAuthority(Authority.parse(\"www.example.com\")));\n\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .isEqualTo(AbsoluteUri.parse(\"file://www.example.com/path?query#fragment\"));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/AbsoluteUrlTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\nimport static org.wiremock.url.AbsoluteUriTests.Parse.illegalAbsoluteUris;\nimport static org.wiremock.url.Lists.concat;\nimport static org.wiremock.url.SchemeRegistry.https;\nimport static org.wiremock.url.UriExpectation.expectation;\nimport static org.wiremock.url.UriParseTestCase.testCase;\nimport static org.wiremock.url.UrlTests.Parse.illegalUrls;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.MethodSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\n@SuppressWarnings(\"HttpUrlsUsage\")\nclass AbsoluteUrlTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void parses_absolute_url_correctly() {\n      var absoluteUrl = AbsoluteUrl.parse(\"https://example.com/path?query#fragment\");\n\n      assertThat(absoluteUrl.toString()).isEqualTo(\"https://example.com/path?query#fragment\");\n      assertThat(absoluteUrl).isInstanceOf(AbsoluteUrl.class);\n      assertThat(absoluteUrl).isNotInstanceOf(ServersideAbsoluteUrl.class);\n\n      assertThat(absoluteUrl.getScheme()).isEqualTo(https);\n\n      assertThat(absoluteUrl.getAuthority()).isEqualTo(HostAndPort.parse(\"example.com\"));\n      assertThat(absoluteUrl.getUserInfo()).isNull();\n      assertThat(absoluteUrl.getHost()).isEqualTo(Host.parse(\"example.com\"));\n      assertThat(absoluteUrl.getPort()).isNull();\n\n      assertThat(absoluteUrl.getPath()).isEqualTo(Path.parse(\"/path\"));\n      assertThat(absoluteUrl.getQuery()).isEqualTo(Query.parse(\"query\"));\n\n      assertThat(absoluteUrl.getFragment()).isEqualTo(Fragment.parse(\"fragment\"));\n\n      assertThat(absoluteUrl.isAbsolute()).isTrue();\n      assertThat(absoluteUrl.isRelative()).isFalse();\n      assertThat(absoluteUrl.isAbsoluteUrl()).isTrue();\n      assertThat(absoluteUrl.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void parses_absolute_url_with_userinfo_correctly() {\n      var absoluteUrl = AbsoluteUrl.parse(\"https://user@example.com/path?query#fragment\");\n\n      assertThat(absoluteUrl.toString()).isEqualTo(\"https://user@example.com/path?query#fragment\");\n      assertThat(absoluteUrl).isInstanceOf(AbsoluteUrl.class);\n      assertThat(absoluteUrl).isNotInstanceOf(ServersideAbsoluteUrl.class);\n\n      assertThat(absoluteUrl.getScheme()).isEqualTo(https);\n\n      assertThat(absoluteUrl.getAuthority()).isEqualTo(Authority.parse(\"user@example.com\"));\n      assertThat(absoluteUrl.getUserInfo()).isEqualTo(UserInfo.parse(\"user\"));\n      assertThat(absoluteUrl.getHost()).isEqualTo(Host.parse(\"example.com\"));\n      assertThat(absoluteUrl.getPort()).isNull();\n\n      assertThat(absoluteUrl.getPath()).isEqualTo(Path.parse(\"/path\"));\n      assertThat(absoluteUrl.getQuery()).isEqualTo(Query.parse(\"query\"));\n\n      assertThat(absoluteUrl.getFragment()).isEqualTo(Fragment.parse(\"fragment\"));\n\n      assertThat(absoluteUrl.isAbsolute()).isTrue();\n      assertThat(absoluteUrl.isRelative()).isFalse();\n      assertThat(absoluteUrl.isAbsoluteUrl()).isTrue();\n      assertThat(absoluteUrl.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void parses_serverside_absolute_url_correctly() {\n      var serversideAbsoluteUrl = AbsoluteUrl.parse(\"https://example.com/path?query\");\n\n      assertThat(serversideAbsoluteUrl.toString()).isEqualTo(\"https://example.com/path?query\");\n      assertThat(serversideAbsoluteUrl).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(serversideAbsoluteUrl).isNotInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_origin_correctly() {\n      var origin = AbsoluteUrl.parse(\"https://example.com\");\n\n      assertThat(origin.toString()).isEqualTo(\"https://example.com\");\n      assertThat(origin).isInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_file_empty_authority_correctly() {\n      var fileUri = AbsoluteUrl.parse(\"file:///home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file:///home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(fileUri).isNotInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_file_with_authority_correctly() {\n      var fileUri = AbsoluteUrl.parse(\"file://user@remote/home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file://user@remote/home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(fileUri).isNotInstanceOf(Origin.class);\n    }\n\n    @Test\n    void rejects_illegal_uri() {\n      IllegalUri exception =\n          assertThatExceptionOfType(IllegalUri.class)\n              .isThrownBy(() -> AbsoluteUrl.parse(\"not a :uri\"))\n              .actual();\n      assertThat(exception.getMessage()).isEqualTo(\"Illegal uri: `not a :uri`\");\n      assertThat(exception.getIllegalValue()).isEqualTo(\"not a :uri\");\n\n      IllegalScheme cause =\n          assertThat(exception.getCause()).asInstanceOf(type(IllegalScheme.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\"Illegal scheme `not a `; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n      assertThat(cause.getIllegalValue()).isEqualTo(\"not a \");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    static final List<? extends String> illegalAbsoluteUrls =\n        concat(illegalUrls, illegalAbsoluteUris);\n\n    @ParameterizedTest\n    @FieldSource(\"illegalAbsoluteUrls\")\n    void rejects_illegal_absolute_url(String illegalAbsoluteUrl) {\n      assertThatExceptionOfType(IllegalAbsoluteUrl.class)\n          .isThrownBy(() -> AbsoluteUrl.parse(illegalAbsoluteUrl))\n          .withMessage(\"Illegal absolute url: `\" + illegalAbsoluteUrl + \"`\")\n          .extracting(IllegalAbsoluteUrl::getIllegalValue)\n          .isEqualTo(illegalAbsoluteUrl);\n    }\n\n    @ParameterizedTest\n    @MethodSource(\"validUrls\")\n    void parses_valid_url(UriParseTestCase urlTest) {\n      AbsoluteUrl url = AbsoluteUrl.parse(urlTest.stringForm());\n      assertThat(url.isAbsoluteUrl()).isTrue();\n      assertThat(url.getScheme()).isEqualTo(urlTest.expectation().scheme());\n      assertThat(url.getPath()).isEqualTo(urlTest.expectation().path());\n      assertThat(url.getQuery()).isEqualTo(urlTest.expectation().query());\n      assertThat(url.getFragment()).isEqualTo(urlTest.expectation().fragment());\n    }\n\n    static Stream<UriParseTestCase> validUrls() {\n      return Stream.of(\n          testCase(\n              \"https://user:password@www.example.com:8080/foo/bar?a=b#somefragment\",\n              expectation(\n                  \"https\",\n                  \"user:password@www.example.com:8080\",\n                  \"/foo/bar\",\n                  \"a=b\",\n                  \"somefragment\")),\n          testCase(\"s://h/p2\", expectation(\"s\", \"h\", \"/p2\", null, null)),\n          testCase(\"s://h/p2?\", expectation(\"s\", \"h\", \"/p2\", \"\", null)),\n          testCase(\"s://h/p2?q\", expectation(\"s\", \"h\", \"/p2\", \"q\", null)),\n          testCase(\"s://h/p2#\", expectation(\"s\", \"h\", \"/p2\", null, \"\")),\n          testCase(\"s://h/p2#f\", expectation(\"s\", \"h\", \"/p2\", null, \"f\")),\n          testCase(\"s://h/p2?#\", expectation(\"s\", \"h\", \"/p2\", \"\", \"\")),\n          testCase(\"s://h/p2?q#\", expectation(\"s\", \"h\", \"/p2\", \"q\", \"\")),\n          testCase(\"s://h/p2?#f\", expectation(\"s\", \"h\", \"/p2\", \"\", \"f\")),\n          testCase(\"s://h/p2?q#f\", expectation(\"s\", \"h\", \"/p2\", \"q\", \"f\")),\n          testCase(\n              \"ftp://user:pass@example.com:21/\",\n              expectation(\"ftp\", \"user:pass@example.com:21\", \"/\", null, null)),\n          testCase(\n              \"https://example.com:00080/\",\n              expectation(\"https\", \"example.com:00080\", \"/\", null, null)),\n          testCase(\n              \"https://example.com?foo=bar\",\n              expectation(\"https\", \"example.com\", \"\", \"foo=bar\", null)),\n          testCase(\n              \"https://example.com#frag\", expectation(\"https\", \"example.com\", \"\", null, \"frag\")),\n          testCase(\n              \"https://example.com/?q=100%25\",\n              expectation(\"https\", \"example.com\", \"/\", \"q=100%25\", null)),\n          testCase(\n              \"https://example.com/path%2Fwith%2Fslashes\",\n              expectation(\"https\", \"example.com\", \"/path%2Fwith%2Fslashes\", null, null)),\n          testCase(\"https://[::1]/\", expectation(\"https\", \"[::1]\", \"/\", null, null)),\n          testCase(\n              \"https://[2001:db8::1]/\", expectation(\"https\", \"[2001:db8::1]\", \"/\", null, null)),\n          testCase(\n              \"https://[v7.fe80::1234]/\", expectation(\"https\", \"[v7.fe80::1234]\", \"/\", null, null)),\n          testCase(\n              \"scheme+ext.-123://host/\", expectation(\"scheme+ext.-123\", \"host\", \"/\", null, null)),\n          testCase(\"a://%61\", expectation(\"a\", \"%61\", \"\", null, null)),\n          testCase(\"x://host/path;param\", expectation(\"x\", \"host\", \"/path;param\", null, null)),\n          testCase(\n              \"x://host/path?query=foo&bar=baz\",\n              expectation(\"x\", \"host\", \"/path\", \"query=foo&bar=baz\", null)),\n          testCase(\n              \"x://host/path%00segment\", expectation(\"x\", \"host\", \"/path%00segment\", null, null)),\n          testCase(\n              \"https://example.com/{}?{}#{}\",\n              expectation(\"https\", \"example.com\", \"/{}\", \"{}\", \"{}\")),\n          testCase(\n              \"https://example.com/a b?a b#a b\",\n              expectation(\"https\", \"example.com\", \"/a b\", \"a b\", \"a b\")),\n          testCase(\n              \"https://example.com/a\\tb?a\\tb#a\\tb\",\n              expectation(\"https\", \"example.com\", \"/a\\tb\", \"a\\tb\", \"a\\tb\")),\n          testCase(\n              \"https://example.com/a|b?a|b#a|b\",\n              expectation(\"https\", \"example.com\", \"/a|b\", \"a|b\", \"a|b\")),\n          testCase(\"http://example.com/😀\", expectation(\"http\", \"example.com\", \"/😀\", null, null)),\n          testCase(\n              \"http://example.com/{}?{}#{}\", expectation(\"http\", \"example.com\", \"/{}\", \"{}\", \"{}\")),\n          testCase(\"http://example.com/안녕\", expectation(\"http\", \"example.com\", \"/안녕\", null, null)),\n          testCase(\n              \"http://example.com/नमस्ते\",\n              expectation(\"http\", \"example.com\", \"/नमस्ते\", null, null)),\n          testCase(\n              \"http://example.com/こんにちは\", expectation(\"http\", \"example.com\", \"/こんにちは\", null, null)),\n          testCase(\n              \"http://example.com/Здравствуйте\",\n              expectation(\"http\", \"example.com\", \"/Здравствуйте\", null, null)),\n          testCase(\n              \"http://example.com/مرحب,ا\",\n              expectation(\"http\", \"example.com\", \"/مرحب,ا\", null, null)),\n          testCase(\n              \"http://example.com/שָׁלוֹ,ם\",\n              expectation(\"http\", \"example.com\", \"/שָׁלוֹ,ם\", null, null)));\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<AbsoluteUri>> normalisationCases =\n        Stream.<Pair<String, String>>of(\n                // Scheme normalization - uppercase to lowercase\n                Pair.of(\"HTTPS://EXAMPLE.COM:8080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTPS://example.com:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTPS://example.com:8080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTP://example.com\", \"http://example.com/\"),\n                Pair.of(\"FTP://example.com\", \"ftp://example.com/\"),\n\n                // Host normalization - uppercase to lowercase\n                Pair.of(\"https://EXAMPLE.COM:8080\", \"https://example.com:8080/\"),\n                Pair.of(\"https://EXAMPLE.COM:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"http://WWW.EXAMPLE.COM\", \"http://www.example.com/\"),\n                Pair.of(\"http://Example.Com\", \"http://example.com/\"),\n\n                // Port normalization - leading zeros\n                Pair.of(\"https://example.com:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"http://example.com:09090\", \"http://example.com:9090/\"),\n                Pair.of(\"http://example.com:00080\", \"http://example.com/\"),\n\n                // Port normalization - default port removal\n                Pair.of(\"http://example.com:80\", \"http://example.com/\"),\n                Pair.of(\"http://example.com:80/\", \"http://example.com/\"),\n                Pair.of(\"http://example.com:80/path\", \"http://example.com/path\"),\n                Pair.of(\"http://example.com:080\", \"http://example.com/\"),\n                Pair.of(\"https://example.com:443\", \"https://example.com/\"),\n                Pair.of(\"https://example.com:443/\", \"https://example.com/\"),\n                Pair.of(\"https://example.com:443/path\", \"https://example.com/path\"),\n                Pair.of(\"https://example.com:0443\", \"https://example.com/\"),\n\n                // Percent encoding - uppercase hex digits in path\n                Pair.of(\"http://example.com/%1f\", \"http://example.com/%1F\"),\n                Pair.of(\"http://example.com/%1f%3f\", \"http://example.com/%1F%3F\"),\n                Pair.of(\"http://example.com/path%1fto\", \"http://example.com/path%1Fto\"),\n                Pair.of(\"http://example.com/%3f%3F\", \"http://example.com/%3F%3F\"),\n                Pair.of(\"http://example.com/%ab%cd%ef\", \"http://example.com/%AB%CD%EF\"),\n\n                // Percent encoding - decode unreserved characters in path (A-Z a-z 0-9 - . _ ~)\n                Pair.of(\"http://example.com/%41\", \"http://example.com/A\"),\n                Pair.of(\"http://example.com/%61\", \"http://example.com/a\"),\n                Pair.of(\"http://example.com/%30\", \"http://example.com/0\"),\n                Pair.of(\"http://example.com/%7E\", \"http://example.com/~\"),\n                Pair.of(\"http://example.com/%7e\", \"http://example.com/~\"),\n                Pair.of(\"http://example.com/%2D\", \"http://example.com/-\"),\n                Pair.of(\"http://example.com/%2E\", \"http://example.com/\"),\n                Pair.of(\"http://example.com/%5F\", \"http://example.com/_\"),\n                Pair.of(\"http://example.com/%41%42%43\", \"http://example.com/ABC\"),\n                Pair.of(\"http://example.com/~%75ser\", \"http://example.com/~user\"),\n\n                // Percent encoding - uppercase hex in query\n                Pair.of(\"http://example.com?key=%1f\", \"http://example.com/?key=%1F\"),\n                Pair.of(\"http://example.com?a=%1f&b=%1a\", \"http://example.com/?a=%1F&b=%1A\"),\n                Pair.of(\"http://example.com?key=%ab\", \"http://example.com/?key=%AB\"),\n\n                // Percent encoding - uppercase hex in fragment\n                Pair.of(\"http://example.com#%1f\", \"http://example.com/#%1F\"),\n                Pair.of(\"http://example.com#%ab\", \"http://example.com/#%AB\"),\n\n                // Combined normalizations - scheme + host + port\n                Pair.of(\"HTTP://EXAMPLE.COM:80\", \"http://example.com/\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:443\", \"https://example.com/\"),\n                Pair.of(\"HTTP://EXAMPLE.COM:080\", \"http://example.com/\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:0443\", \"https://example.com/\"),\n\n                // Combined normalizations - multiple components\n                Pair.of(\"HTTP://EXAMPLE.COM:80/%1f\", \"http://example.com/%1F\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:443/PATH\", \"https://example.com/PATH\"),\n                Pair.of(\"HTTP://EXAMPLE.COM/%41%42\", \"http://example.com/AB\"),\n                Pair.of(\"HTTP://EXAMPLE.COM:080/%1f?a=%1f#%1f\", \"http://example.com/%1F?a=%1F#%1F\"),\n                Pair.of(\n                    \"HTTPS://EXAMPLE.COM:443/%61?%62=%63#%64\", \"https://example.com/a?%62=%63#%64\"),\n\n                // Path with percent encoding variations\n                Pair.of(\"http://example.com/%41/%42/%43\", \"http://example.com/A/B/C\"),\n                Pair.of(\n                    \"http://example.com/path/%1F/segment\", \"http://example.com/path/%1F/segment\"),\n                Pair.of(\"http://example.com/%7Euser/docs\", \"http://example.com/~user/docs\"),\n\n                // Query and fragment combinations\n                Pair.of(\"http://example.com?%41=%42#%43\", \"http://example.com/?%41=%42#%43\"),\n                Pair.of(\"http://example.com?key=%1f#%1f\", \"http://example.com/?key=%1F#%1F\"),\n\n                // Multiple ports in different contexts\n                Pair.of(\"http://example.com:8080\", \"http://example.com:8080/\"),\n                Pair.of(\"https://example.com:8443\", \"https://example.com:8443/\"),\n                Pair.of(\"ftp://example.com:21\", \"ftp://example.com/\"),\n\n                // Mixed case hex digits\n                Pair.of(\"http://example.com/%aB%Cd\", \"http://example.com/%AB%CD\"),\n                Pair.of(\"http://example.com?key=%aB\", \"http://example.com/?key=%AB\"),\n                Pair.of(\"http://example.com#%aB\", \"http://example.com/#%AB\"))\n            .map(\n                it ->\n                    new NormalisationCase<>(\n                        AbsoluteUrl.parse(it.getLeft()), AbsoluteUrl.parse(it.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_absolute_urls_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(\n          normalisationCases.stream().filter(t -> !t.normalForm().equals(t.notNormal())).toList());\n    }\n\n    static final List<String> alreadyNormalised =\n        List.of(\"http://example.com/?%41=%42#%43\", \"http://example.com/?%61=%62\");\n\n    static final List<? extends AbsoluteUri> alreadyNormalisedUrlReferences =\n        Lists.concat(\n            normalisationCases.stream().map(NormalisationCase::normalForm).distinct().toList(),\n            alreadyNormalised.stream().map(AbsoluteUri::parse).toList());\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedUrlReferences);\n    }\n  }\n\n  @Nested\n  class Resolve {\n\n    @Test\n    void resolves_relative_path() {\n      AbsoluteUrl base = AbsoluteUrl.parse(\"http://example.com\");\n      AbsoluteUrl resolved = base.resolve(Path.parse(\"foo\"));\n      assertThat(resolved.toString()).isEqualTo(\"http://example.com/foo\");\n      assertThat(resolved.getHost()).isEqualTo(Host.parse(\"example.com\"));\n      assertThat(resolved.getPath()).isEqualTo(Path.parse(\"/foo\"));\n    }\n\n    static final List<ResolutionTestCase> resolutionCases =\n        List.of(\n            testCase(\"http://example.com\", \"https://www.example.com\", \"https://www.example.com/\"),\n            testCase(\"http://example.com\", \"https://example.com\", \"https://example.com/\"),\n            testCase(\"http://example.com\", \"https://example.com:8443\", \"https://example.com:8443/\"),\n            testCase(\n                \"http://example.com\",\n                \"https://user@example.com:8443/path\",\n                \"https://user@example.com:8443/path\"),\n            testCase(\n                \"http://example.com\",\n                \"https://user@example.com:8443?query\",\n                \"https://user@example.com:8443/?query\"),\n            testCase(\n                \"http://example.com\",\n                \"https://user@example.com:8443#fragment\",\n                \"https://user@example.com:8443/#fragment\"),\n            testCase(\n                \"http://example.com\",\n                \"https://user@example.com:8443/path?query#fragment\",\n                \"https://user@example.com:8443/path?query#fragment\"),\n            testCase(\"http://example.com\", \"//www.example.com\", \"http://www.example.com/\"),\n            testCase(\"http://example.com\", \"//example.com\", \"http://example.com/\"),\n            testCase(\"http://example.com\", \"//example.com:8443\", \"http://example.com:8443/\"),\n            testCase(\n                \"http://example.com\",\n                \"//user@example.com:8443/path\",\n                \"http://user@example.com:8443/path\"),\n            testCase(\n                \"http://example.com\",\n                \"//user@example.com:8443?query\",\n                \"http://user@example.com:8443/?query\"),\n            testCase(\n                \"http://example.com\",\n                \"//user@example.com:8443#fragment\",\n                \"http://user@example.com:8443/#fragment\"),\n            testCase(\n                \"http://example.com\",\n                \"//user@example.com:8443/path?query#fragment\",\n                \"http://user@example.com:8443/path?query#fragment\"),\n            testCase(\"http://example.com\", \"?query\", \"http://example.com/?query\"),\n            testCase(\"http://example.com\", \"#fragment\", \"http://example.com/#fragment\"),\n            testCase(\n                \"http://example.com\",\n                \"/path?query#fragment\",\n                \"http://example.com/path?query#fragment\"),\n            testCase(\"http://example.com\", \"path?query\", \"http://example.com/path?query\"),\n            testCase(\"http://example.com\", \"path#fragment\", \"http://example.com/path#fragment\"),\n            testCase(\n                \"http://example.com\",\n                \"path?query#fragment\",\n                \"http://example.com/path?query#fragment\"),\n            testCase(\"http://example.com/basepath\", \"path?query\", \"http://example.com/path?query\"),\n            testCase(\n                \"http://example.com/basepath/\",\n                \"path?query\",\n                \"http://example.com/basepath/path?query\"));\n\n    @ParameterizedTest\n    @FieldSource(\"resolutionCases\")\n    void resolves_strings_when_they_are_valid_urls(ResolutionTestCase resolutionTestCase) {\n      var base = AbsoluteUrl.parse(resolutionTestCase.base());\n      String input = resolutionTestCase.input();\n      var resolved = base.resolve(input);\n      assertThat(resolved).isEqualTo(AbsoluteUrl.parse(resolutionTestCase.expectedResult()));\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"resolutionCases\")\n    void resolves_urls(ResolutionTestCase resolutionTestCase) {\n      var base = AbsoluteUrl.parse(resolutionTestCase.base());\n      Url other = Url.parse(resolutionTestCase.input());\n      var resolved = base.resolve(other);\n      assertThat(resolved).isEqualTo(AbsoluteUrl.parse(resolutionTestCase.expectedResult()));\n    }\n\n    record ResolutionTestCase(String base, String input, String expectedResult) {}\n\n    static ResolutionTestCase testCase(String base, String input, String expectedResult) {\n      return new ResolutionTestCase(base, input, expectedResult);\n    }\n  }\n\n  @Nested\n  class Builder {\n\n    @Test\n    void can_build_an_absolute_uri() {\n\n      AbsoluteUrl uri =\n          AbsoluteUrl.builder(https, Authority.parse(\"example.com\"))\n              .setPath(Path.parse(\"/path\"))\n              .setQuery(Query.parse(\"query\"))\n              .setFragment(Fragment.parse(\"fragment\"))\n              .build();\n\n      assertThat(uri).isEqualTo(Uri.parse(\"https://example.com/path?query#fragment\"));\n    }\n\n    @Test\n    void setting_user_info_after_authority_works() {\n      var uri =\n          AbsoluteUrl.builder(https, Authority.parse(\"user@example.com:8443\"))\n              .setUserInfo(UserInfo.parse(\"me:passwd\"))\n              .build();\n\n      assertThat(uri).isEqualTo(AbsoluteUrl.parse(\"https://me:passwd@example.com:8443/\"));\n    }\n\n    @Test\n    void setting_host_after_authority_works() {\n      var uri =\n          AbsoluteUrl.builder(https, Authority.parse(\"user@www.example.com:8443\"))\n              .setHost(Host.parse(\"example.com\"))\n              .build();\n\n      assertThat(uri).isEqualTo(AbsoluteUrl.parse(\"https://user@example.com:8443/\"));\n    }\n\n    @Test\n    void setting_port_after_authority_works() {\n      var uri =\n          AbsoluteUrl.builder(https, Authority.parse(\"user@example.com:8443\"))\n              .setPort(Port.of(88443))\n              .build();\n\n      assertThat(uri).isEqualTo(AbsoluteUrl.parse(\"https://user@example.com:88443/\"));\n    }\n\n    @Test\n    void rejects_relative_path() {\n      assertThatExceptionOfType(IllegalAbsoluteUrl.class)\n          .isThrownBy(\n              () ->\n                  AbsoluteUrl.builder(https, Authority.parse(\"example.com\"))\n                      .setPath(Path.parse(\"relative\"))\n                      .build())\n          .withMessage(\n              \"Illegal absolute url: `https://example.comrelative` - an absolute url's path must be absolute or empty, was `relative`\")\n          .extracting(IllegalUrl::getIllegalValue)\n          .isEqualTo(\"https://example.comrelative\");\n    }\n  }\n\n  @Nested\n  class Transform {\n\n    @Test\n    void can_change_a_urls_scheme() {\n\n      AbsoluteUrl uri = AbsoluteUrl.parse(\"https://user@example.com:8443/path?query#fragment\");\n      AbsoluteUrl transformed = uri.thaw().setScheme(SchemeRegistry.wss).build();\n\n      assertThat(transformed)\n          .isEqualTo(AbsoluteUrl.parse(\"wss://user@example.com:8443/path?query#fragment\"));\n    }\n\n    @Test\n    void can_change_authority() {\n      var uri = AbsoluteUrl.parse(\"https://example.com/path#fragment\");\n\n      var uriWithNewAuthority =\n          uri.transform(\n              builder -> builder.setAuthority(Authority.parse(\"user@www.example.com:8443\")));\n\n      assertThat(uriWithNewAuthority)\n          .isEqualTo(AbsoluteUrl.parse(\"https://user@www.example.com:8443/path#fragment\"));\n    }\n\n    @Test\n    void setting_port_to_null_changes_nothing() {\n      String urlString = \"http://example.com\";\n\n      AbsoluteUrl noPortToStartWith = AbsoluteUrl.parse(urlString);\n      assertThat(noPortToStartWith.toString()).isEqualTo(urlString);\n\n      AbsoluteUrl stillNoPort = noPortToStartWith.transform(it -> it.setPort(null));\n      assertThat(noPortToStartWith).isEqualTo(stillNoPort);\n      assertThat(noPortToStartWith.toString()).isEqualTo(stillNoPort.toString());\n    }\n\n    @Test\n    void cannot_set_scheme_to_null() {\n      var url = AbsoluteUrl.parse(\"https://example.com/path#fragment\");\n\n      //noinspection DataFlowIssue\n      assertThatExceptionOfType(NullPointerException.class)\n          .isThrownBy(() -> url.transform(it -> it.setScheme(null)))\n          .withMessage(null)\n          .withNoCause();\n    }\n\n    @Test\n    void cannot_set_authority_to_null() {\n      var url = AbsoluteUrl.parse(\"https://example.com/path#fragment\");\n\n      //noinspection DataFlowIssue\n      assertThatExceptionOfType(NullPointerException.class)\n          .isThrownBy(() -> url.transform(it -> it.setAuthority(null)))\n          .withMessage(null)\n          .withNoCause();\n    }\n\n    @Test\n    void can_update_query() {\n      var url = AbsoluteUrl.parse(\"https://example.com/?a=b\");\n      Url updated = url.transform(builder -> builder.getQueryBuilder().append(\"b\", \"2\"));\n      assertThat(updated).hasToString(\"https://example.com/?a=b&b=2\");\n    }\n  }\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"https://example.com/\", \"https://example.com/#fragment\"})\n  void get_serverside_absolute_url_returns_without_fragment(String urlString) {\n    var url = AbsoluteUrl.parse(urlString);\n    assertThat(url.getServersideAbsoluteUrl())\n        .isEqualTo(ServersideAbsoluteUrl.parse(\"https://example.com/\"));\n  }\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"https://example.com/\",\n        \"https://example.com/#fragment\",\n        \"https://example.com:443/#fragment\"\n      })\n  void get_origin_always_returns(String urlString) {\n    var url = AbsoluteUrl.parse(urlString);\n    assertThat(url.getOrigin()).isEqualTo(Origin.parse(\"https://example.com\"));\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/AbstractEncodableInitialisationTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport org.junit.jupiter.api.Test;\n\nabstract class AbstractEncodableInitialisationTests extends AbstractInitialisationTests {\n\n  static final String encode = \"encode\";\n\n  AbstractEncodableInitialisationTests(\n      String className, String staticField, String parserName, String inputToTest) {\n    super(className, staticField, parserName, inputToTest);\n  }\n\n  @Test\n  void encodeInputWorks() throws Exception {\n    try (IsolatedClassLoader classLoader = new IsolatedClassLoader()) {\n      var encoded = classLoader.load(className).invoke(encode, inputToTest);\n      assertThat(encoded).hasToString(inputToTest);\n\n      assertStaticFieldInitialised(classLoader);\n    }\n  }\n\n  @Test\n  void parserInstanceEncode() throws Throwable {\n    try (IsolatedClassLoader classLoader = new IsolatedClassLoader()) {\n      var parser = getParserInstance(classLoader);\n      var encoded = parser.invoke(encode, inputToTest);\n      assertThat(encoded).hasToString(inputToTest);\n\n      assertStaticFieldInitialised(classLoader);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/AbstractInitialisationTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport org.junit.jupiter.api.Test;\n\nabstract class AbstractInitialisationTests {\n\n  final String className;\n  final String parserName;\n  final String inputToTest;\n\n  static final String EMPTY = \"EMPTY\";\n  static final String INSTANCE = \"INSTANCE\";\n  static final String parse = \"parse\";\n  final String staticField;\n\n  AbstractInitialisationTests(\n      String className, String staticField, String parserName, String inputToTest) {\n    this.className = className;\n    this.parserName = parserName;\n    this.inputToTest = inputToTest;\n    this.staticField = staticField;\n  }\n\n  @Test\n  void staticFieldIsInitialised() throws Exception {\n    try (IsolatedClassLoader classLoader = new IsolatedClassLoader()) {\n      assertStaticFieldInitialised(classLoader);\n    }\n  }\n\n  @Test\n  void parseInputWorks() throws Exception {\n    try (IsolatedClassLoader classLoader = new IsolatedClassLoader()) {\n      var parsed = classLoader.load(className).invoke(parse, inputToTest);\n      assertThat(parsed).hasToString(inputToTest);\n\n      assertStaticFieldInitialised(classLoader);\n    }\n  }\n\n  @Test\n  void parserInstanceParse() throws Throwable {\n    try (IsolatedClassLoader classLoader = new IsolatedClassLoader()) {\n      var parser = getParserInstance(classLoader);\n      var parsed = parser.invoke(parse, inputToTest);\n      assertThat(parsed).hasToString(inputToTest);\n\n      assertStaticFieldInitialised(classLoader);\n    }\n  }\n\n  ReflectiveInstance getParserInstance(IsolatedClassLoader classLoader)\n      throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {\n    return requireNonNull(classLoader.load(parserName).field(INSTANCE));\n  }\n\n  void assertStaticFieldInitialised(IsolatedClassLoader classLoader)\n      throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {\n    var staticField = classLoader.load(className).field(this.staticField);\n    assertThat(staticField).hasToString(inputToTest);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/AuthorityTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.AssertionsForClassTypes.assertThat;\nimport static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\nimport static org.wiremock.url.SchemeRegistry.file;\nimport static org.wiremock.url.SchemeRegistry.http;\n\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.jspecify.annotations.Nullable;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\npublic class AuthorityTests {\n\n  @Nested\n  class Parse {\n\n    static List<AuthorityParseTestCase> validHostAndPorts =\n        List.of(\n            testCase(\"example.com:00080\", expectation(null, \"example.com\", \"00080\")),\n            testCase(\"example.com\", expectation(null, \"example.com\", null)),\n            testCase(\"[::1]\", expectation(null, \"[::1]\", null)),\n            testCase(\"[2001:db8::1]\", expectation(null, \"[2001:db8::1]\", null)),\n            testCase(\"[v7.fe80::1234]\", expectation(null, \"[v7.fe80::1234]\", null)),\n            testCase(\"%61\", expectation(null, \"%61\", null)),\n            testCase(\"localhost\", expectation(null, \"localhost\", null)),\n            testCase(\"www.example.com\", expectation(null, \"www.example.com\", null)),\n            testCase(\"127.0.0.1\", expectation(null, \"127.0.0.1\", null)),\n            testCase(\"test-server\", expectation(null, \"test-server\", null)),\n            testCase(\"test_server\", expectation(null, \"test_server\", null)),\n            testCase(\"server123\", expectation(null, \"server123\", null)),\n            testCase(\"a\", expectation(null, \"a\", null)),\n            testCase(\"a.b.c.d.e\", expectation(null, \"a.b.c.d.e\", null)),\n            testCase(\"test%20server\", expectation(null, \"test%20server\", null)),\n            testCase(\"caf%C3%A9.com\", expectation(null, \"caf%C3%A9.com\", null)),\n            testCase(\"localhost:8080\", expectation(null, \"localhost\", \"8080\")),\n            testCase(\"example.com:8080\", expectation(null, \"example.com\", \"8080\")),\n            testCase(\"www.example.com:8080\", expectation(null, \"www.example.com\", \"8080\")),\n            testCase(\"127.0.0.1:8080\", expectation(null, \"127.0.0.1\", \"8080\")),\n            testCase(\"[::1]:8080\", expectation(null, \"[::1]\", \"8080\")),\n            testCase(\"[2001:db8::1]:8080\", expectation(null, \"[2001:db8::1]\", \"8080\")),\n            testCase(\"test-server:8080\", expectation(null, \"test-server\", \"8080\")),\n            testCase(\"test_server:8080\", expectation(null, \"test_server\", \"8080\")),\n            testCase(\"server123:8080\", expectation(null, \"server123\", \"8080\")),\n            testCase(\"a:8080\", expectation(null, \"a\", \"8080\")),\n            testCase(\"a.b.c.d.e:8080\", expectation(null, \"a.b.c.d.e\", \"8080\")),\n            testCase(\"test%20server:8080\", expectation(null, \"test%20server\", \"8080\")),\n            testCase(\"caf%C3%A9.com:8080\", expectation(null, \"caf%C3%A9.com\", \"8080\")));\n\n    static final List<AuthorityParseTestCase> validAuthoritiesWithUserInfo =\n        List.of(\n            testCase(\n                \"user:password@www.example.com:8080\",\n                expectation(\"user:password\", \"www.example.com\", \"8080\")),\n            testCase(\"user:pass@example.com:21\", expectation(\"user:pass\", \"example.com\", \"21\")),\n            testCase(\"me@localhost\", expectation(\"me\", \"localhost\", null)),\n            testCase(\"me@example.com\", expectation(\"me\", \"example.com\", null)),\n            testCase(\"me@www.example.com\", expectation(\"me\", \"www.example.com\", null)),\n            testCase(\"me@127.0.0.1\", expectation(\"me\", \"127.0.0.1\", null)),\n            testCase(\"me@[::1]\", expectation(\"me\", \"[::1]\", null)),\n            testCase(\"me@[2001:db8::1]\", expectation(\"me\", \"[2001:db8::1]\", null)),\n            testCase(\"me@test-server\", expectation(\"me\", \"test-server\", null)),\n            testCase(\"me@test_server\", expectation(\"me\", \"test_server\", null)),\n            testCase(\"me@server123\", expectation(\"me\", \"server123\", null)),\n            testCase(\"me@a\", expectation(\"me\", \"a\", null)),\n            testCase(\"me@a.b.c.d.e\", expectation(\"me\", \"a.b.c.d.e\", null)),\n            testCase(\"me@test%20server\", expectation(\"me\", \"test%20server\", null)),\n            testCase(\"me@caf%C3%A9.com\", expectation(\"me\", \"caf%C3%A9.com\", null)),\n            testCase(\"me@localhost:8080\", expectation(\"me\", \"localhost\", \"8080\")),\n            testCase(\"me@example.com:8080\", expectation(\"me\", \"example.com\", \"8080\")),\n            testCase(\"me@www.example.com:8080\", expectation(\"me\", \"www.example.com\", \"8080\")),\n            testCase(\"me@127.0.0.1:8080\", expectation(\"me\", \"127.0.0.1\", \"8080\")),\n            testCase(\"me@[::1]:8080\", expectation(\"me\", \"[::1]\", \"8080\")),\n            testCase(\"me@[2001:db8::1]:8080\", expectation(\"me\", \"[2001:db8::1]\", \"8080\")),\n            testCase(\"me@test-server:8080\", expectation(\"me\", \"test-server\", \"8080\")),\n            testCase(\"me@test_server:8080\", expectation(\"me\", \"test_server\", \"8080\")),\n            testCase(\"me@server123:8080\", expectation(\"me\", \"server123\", \"8080\")),\n            testCase(\"me@a:8080\", expectation(\"me\", \"a\", \"8080\")),\n            testCase(\"me@a.b.c.d.e:8080\", expectation(\"me\", \"a.b.c.d.e\", \"8080\")),\n            testCase(\"me@test%20server:8080\", expectation(\"me\", \"test%20server\", \"8080\")),\n            testCase(\"me@caf%C3%A9.com:8080\", expectation(\"me\", \"caf%C3%A9.com\", \"8080\")));\n\n    static List<AuthorityParseTestCase> validAuthorities =\n        Stream.concat(validHostAndPorts.stream(), validAuthoritiesWithUserInfo.stream()).toList();\n\n    @ParameterizedTest\n    @FieldSource(\"validAuthorities\")\n    void parses_valid_authority(AuthorityParseTestCase urlTest) {\n      Authority authority = Authority.parse(urlTest.stringForm);\n      assertThat(authority.getUserInfo()).isEqualTo(urlTest.expectation.userInfo);\n      assertThat(authority.getHost()).isEqualTo(urlTest.expectation.host);\n      assertThat(authority.getPort()).isEqualTo(urlTest.expectation.port);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"validHostAndPorts\")\n    void parses_valid_host_and_port(AuthorityParseTestCase urlTest) {\n      Authority authority = Authority.parse(urlTest.stringForm);\n      assertThat(authority).isInstanceOf(HostAndPort.class);\n      HostAndPort hostAndPort = HostAndPort.parse(urlTest.stringForm);\n      assertThat(hostAndPort).isEqualTo(authority);\n      assertThat(authority.getUserInfo()).isNull();\n      assertThat(authority.getHost()).isEqualTo(urlTest.expectation.host);\n      assertThat(authority.getPort()).isEqualTo(urlTest.expectation.port);\n    }\n\n    @TestFactory\n    Stream<DynamicTest> invariants() {\n      List<String> authorities =\n          validAuthorities.stream()\n              .map(authorityParseTestCase -> authorityParseTestCase.stringForm)\n              .toList();\n      return StringParserInvariantTests.generateInvariantTests(\n          AuthorityParser.INSTANCE, authorities);\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \" \", // space\n          \"example.com:abc\", // non-numeric port\n          \"example.com:-80\", // negative port\n          \"user name@example.com\", // unencoded space in userinfo\n          \"user@ex ample.com\", // space in host\n          \"example.com:8080:9090\", // multiple ports\n          \"[::1\", // unclosed IPv6 bracket\n          \"::1]\", // IPv6 without opening bracket\n          \"user@@example.com\", // double @\n          \"user#name@example.com\", // invalid char in userinfo\n          \"example?.com\", // invalid char in host\n        })\n    void throws_exception_for_illegal_authority(String illegalAuthority) {\n      assertThatExceptionOfType(IllegalAuthority.class)\n          .isThrownBy(() -> Authority.parse(illegalAuthority))\n          .withMessage(\"Illegal authority: `\" + illegalAuthority + \"`\")\n          .extracting(IllegalAuthority::getIllegalValue)\n          .isEqualTo(illegalAuthority);\n    }\n\n    @Test\n    void rejects_illegal_port() {\n      // Intger.MAX_VALUE + 1\n      var authorityWithIllegalPort = \"example.com:2147483648\";\n      var exception =\n          assertThatExceptionOfType(IllegalAuthority.class)\n              .isThrownBy(() -> Authority.parse(authorityWithIllegalPort))\n              .withMessage(\"Illegal authority: `\" + authorityWithIllegalPort + \"`\")\n              .actual();\n\n      assertThat(exception.getIllegalValue()).isEqualTo(authorityWithIllegalPort);\n      var cause = assertThat(exception.getCause()).asInstanceOf(type(IllegalPort.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\n              \"Illegal port [2147483648]; Port value must be an integer between 1 and 2147483647\");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    static AuthorityParseTestCase testCase(String stringForm, AuthorityExpectation expectation) {\n      return new AuthorityParseTestCase(stringForm, expectation);\n    }\n\n    static AuthorityExpectation expectation(\n        @Nullable String userInfoStr, String hostStr, @Nullable String portStr) {\n      UserInfo userInfo = userInfoStr == null ? null : UserInfo.parse(userInfoStr);\n      Host host = Host.parse(hostStr);\n      Port port = portStr == null ? null : Port.parse(portStr);\n      return new AuthorityExpectation(userInfo, host, port);\n    }\n\n    record AuthorityParseTestCase(String stringForm, AuthorityExpectation expectation) {}\n\n    record AuthorityExpectation(@Nullable UserInfo userInfo, Host host, @Nullable Port port) {}\n  }\n\n  @Nested\n  class Update {\n\n    private static final List<AuthorityChangeTestCase> withoutPortTestCases =\n        List.of(\n            changeTest(\"example.com:80\", \"example.com\"),\n            changeTest(\"user@example.com:80\", \"user@example.com\"),\n            changeTest(\"example.com:\", \"example.com\"),\n            changeTest(\"user@example.com:\", \"user@example.com\"));\n\n    @ParameterizedTest\n    @FieldSource(\"withoutPortTestCases\")\n    void withoutPortRemovesPort(AuthorityChangeTestCase testCase) {\n      assertThat(testCase.original.withoutPort()).isEqualTo(testCase.expected);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"withoutPortTestCases\")\n    void withPortNullRemovesPort(AuthorityChangeTestCase testCase) {\n      assertThat(testCase.original.withPort(null)).isEqualTo(testCase.expected);\n    }\n\n    private static final List<AuthorityChangeTestCase> unchangedWithoutPortTestCases =\n        List.of(\n            changeTest(\"example.com\", \"example.com\"),\n            changeTest(\"user@example.com\", \"user@example.com\"));\n\n    @ParameterizedTest\n    @FieldSource(\"unchangedWithoutPortTestCases\")\n    void withoutPortDoesNothingIfNoPort(AuthorityChangeTestCase testCase) {\n      assertThat(testCase.original.withoutPort()).isSameAs(testCase.original);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"unchangedWithoutPortTestCases\")\n    void withPortNullDoesNothingIfNoPort(AuthorityChangeTestCase testCase) {\n      assertThat(testCase.original.withPort(null)).isSameAs(testCase.original);\n    }\n\n    private static final List<AuthorityChangeTestCase> withPortChangesPortTestCases =\n        List.of(\n            changeTest(\"example.com\", \"example.com:8080\"),\n            changeTest(\"user@example.com\", \"user@example.com:8080\"),\n            changeTest(\"example.com:\", \"example.com:8080\"),\n            changeTest(\"user@example.com:\", \"user@example.com:8080\"),\n            changeTest(\"example.com:80\", \"example.com:8080\"),\n            changeTest(\"user@example.com:80\", \"user@example.com:8080\"));\n\n    @ParameterizedTest\n    @FieldSource(\"withPortChangesPortTestCases\")\n    void withPortChangesPort(AuthorityChangeTestCase testCase) {\n      assertThat(testCase.original.withPort(Port.of(8080))).isEqualTo(testCase.expected);\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"example.com:8080\",\n          \"user@example.com:8080\",\n        })\n    void withPortDoesNothingIfNoChangeInPort(String original) {\n      var authority = Authority.parse(original);\n      assertThat(authority.withPort(Port.of(8080))).isSameAs(authority);\n    }\n\n    record AuthorityChangeTestCase(Authority original, Authority expected) {}\n\n    private static AuthorityChangeTestCase changeTest(String original, String expected) {\n      return new AuthorityChangeTestCase(Authority.parse(original), Authority.parse(expected));\n    }\n  }\n\n  @Nested\n  class AuthorityEquality {\n\n    @Test\n    void authorities_with_same_components_are_equal() {\n      Authority authority1 = Authority.parse(\"user@example.com:8080\");\n      Authority authority2 = Authority.parse(\"user@example.com:8080\");\n      assertThat(authority1).isEqualTo(authority2);\n    }\n\n    @Test\n    void authorities_with_different_hosts_are_not_equal() {\n      Authority authority1 = Authority.parse(\"user@example.com:8080\");\n      Authority authority2 = Authority.parse(\"user@different.com:8080\");\n      assertThat(authority1).isNotEqualTo(authority2);\n    }\n\n    @Test\n    void authorities_with_different_ports_are_not_equal() {\n      Authority authority1 = Authority.parse(\"example.com:8080\");\n      Authority authority2 = Authority.parse(\"example.com:9090\");\n      assertThat(authority1).isNotEqualTo(authority2);\n    }\n\n    @Test\n    void authorities_with_different_userInfo_are_not_equal() {\n      Authority authority1 = Authority.parse(\"user1@example.com:8080\");\n      Authority authority2 = Authority.parse(\"user2@example.com:8080\");\n      assertThat(authority1).isNotEqualTo(authority2);\n    }\n\n    @Test\n    void authority_with_port_and_without_port_are_not_equal() {\n      Authority authority1 = Authority.parse(\"example.com:8080\");\n      Authority authority2 = Authority.parse(\"example.com\");\n      assertThat(authority1).isNotEqualTo(authority2);\n    }\n\n    @Test\n    void authority_with_empty_port_and_without_port_are_not_equal() {\n      Authority authority1 = Authority.parse(\"example.com:\");\n      Authority authority2 = Authority.parse(\"example.com\");\n      assertThat(authority1).isNotEqualTo(authority2);\n    }\n\n    @Test\n    void authority_is_equal_to_itself() {\n      Authority authority = Authority.parse(\"user@example.com:8080\");\n      assertThat(authority).isEqualTo(authority);\n    }\n\n    @Test\n    void authority_is_not_equal_to_null() {\n      Authority authority = Authority.parse(\"example.com\");\n      assertThat(authority).isNotEqualTo(null);\n    }\n\n    @Test\n    void authority_is_not_equal_to_different_type() {\n      Authority authority = Authority.parse(\"example.com\");\n      assertThat(authority).isNotEqualTo(\"example.com\");\n    }\n  }\n\n  @Nested\n  class AuthorityHashCode {\n\n    @Test\n    void equal_authorities_have_same_hash_code() {\n      Authority authority1 = Authority.parse(\"user@example.com:8080\");\n      Authority authority2 = Authority.parse(\"user@example.com:8080\");\n      assertThat(authority1.hashCode()).isEqualTo(authority2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      Authority authority = Authority.parse(\"user@example.com:8080\");\n      int hashCode1 = authority.hashCode();\n      int hashCode2 = authority.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class HostAndPortEquality {\n\n    @Test\n    void hostAndPorts_with_same_components_are_equal() {\n      HostAndPort hostAndPort1 = HostAndPort.parse(\"example.com:8080\");\n      HostAndPort hostAndPort2 = HostAndPort.parse(\"example.com:8080\");\n      assertThat(hostAndPort1).isEqualTo(hostAndPort2);\n    }\n\n    @Test\n    void hostAndPorts_with_different_hosts_are_not_equal() {\n      HostAndPort hostAndPort1 = HostAndPort.parse(\"example.com:8080\");\n      HostAndPort hostAndPort2 = HostAndPort.parse(\"different.com:8080\");\n      assertThat(hostAndPort1).isNotEqualTo(hostAndPort2);\n    }\n\n    @Test\n    void hostAndPorts_with_different_ports_are_not_equal() {\n      HostAndPort hostAndPort1 = HostAndPort.parse(\"example.com:8080\");\n      HostAndPort hostAndPort2 = HostAndPort.parse(\"example.com:9090\");\n      assertThat(hostAndPort1).isNotEqualTo(hostAndPort2);\n    }\n\n    @Test\n    void hostAndPort_with_port_and_without_port_are_not_equal() {\n      HostAndPort hostAndPort1 = HostAndPort.parse(\"example.com:8080\");\n      HostAndPort hostAndPort2 = HostAndPort.parse(\"example.com\");\n      assertThat(hostAndPort1).isNotEqualTo(hostAndPort2);\n    }\n\n    @Test\n    void hostAndPort_is_equal_to_itself() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:8080\");\n      assertThat(hostAndPort).isEqualTo(hostAndPort);\n    }\n\n    @Test\n    void hostAndPort_is_not_equal_to_null() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com\");\n      assertThat(hostAndPort).isNotEqualTo(null);\n    }\n\n    @Test\n    void hostAndPort_is_not_equal_to_different_type() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com\");\n      assertThat(hostAndPort).isNotEqualTo(\"example.com\");\n    }\n\n    @Test\n    void hostAndPort_equals_authority_with_same_host_and_port() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:8080\");\n      Authority authority = Authority.parse(\"example.com:8080\");\n      assertThat(hostAndPort).isEqualTo(authority);\n      assertThat(authority).isEqualTo(hostAndPort);\n    }\n\n    @Test\n    void hostAndPort_not_equals_authority_with_userInfo() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:8080\");\n      Authority authority = Authority.parse(\"user@example.com:8080\");\n      assertThat(hostAndPort).isNotEqualTo(authority);\n      assertThat(authority).isNotEqualTo(hostAndPort);\n    }\n  }\n\n  @Nested\n  class HostAndPortHashCode {\n\n    @Test\n    void equal_hostAndPorts_have_same_hash_code() {\n      HostAndPort hostAndPort1 = HostAndPort.parse(\"example.com:8080\");\n      HostAndPort hostAndPort2 = HostAndPort.parse(\"example.com:8080\");\n      assertThat(hostAndPort1.hashCode()).isEqualTo(hostAndPort2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:8080\");\n      int hashCode1 = hostAndPort.hashCode();\n      int hashCode2 = hostAndPort.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n\n    @Test\n    void hostAndPort_and_authority_with_same_components_have_same_hash_code() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:8080\");\n      Authority authority = Authority.parse(\"example.com:8080\");\n      assertThat(hostAndPort.hashCode()).isEqualTo(authority.hashCode());\n    }\n  }\n\n  @Nested\n  class AuthorityOfMethods {\n\n    @Test\n    void of_with_host_only() {\n      Host host = Host.parse(\"example.com\");\n      Authority authority = Authority.of(host);\n      assertThat(authority).hasToString(\"example.com\");\n      assertThat(authority.getHost()).isEqualTo(host);\n      assertThat(authority.getPort()).isNull();\n      assertThat(authority.getMaybePort()).isNull();\n      assertThat(authority.getUserInfo()).isNull();\n      assertThat(authority).isEqualTo(Authority.parse(\"example.com\"));\n    }\n\n    @Test\n    void of_with_host_and_port() {\n      Host host = Host.parse(\"example.com\");\n      Port port = Port.of(8080);\n      Authority authority = Authority.of(host, port);\n      assertThat(authority).hasToString(\"example.com:8080\");\n      assertThat(authority.getHost()).isEqualTo(host);\n      assertThat(authority.getPort()).isEqualTo(port);\n      assertThat(authority.getMaybePort()).isEqualTo(Optional.of(port));\n      assertThat(authority.getUserInfo()).isNull();\n      assertThat(authority).isEqualTo(Authority.parse(\"example.com:8080\"));\n    }\n\n    @Test\n    void of_with_host_and_null_port() {\n      Host host = Host.parse(\"example.com\");\n      Authority authority = Authority.of(host, null);\n      assertThat(authority).hasToString(\"example.com\");\n      assertThat(authority.getHost()).isEqualTo(host);\n      assertThat(authority.getPort()).isNull();\n      assertThat(authority.getMaybePort()).isNull();\n      assertThat(authority.getUserInfo()).isNull();\n      assertThat(authority).isEqualTo(Authority.parse(\"example.com\"));\n    }\n\n    @Test\n    void of_with_userInfo_and_host() {\n      UserInfo userInfo = UserInfo.parse(\"user:password\");\n      Host host = Host.parse(\"example.com\");\n      Authority authority = Authority.of(userInfo, host);\n      assertThat(authority).hasToString(\"user:password@example.com\");\n      assertThat(authority.getUserInfo()).isEqualTo(userInfo);\n      assertThat(authority.getHost()).isEqualTo(host);\n      assertThat(authority.getPort()).isNull();\n      assertThat(authority.getMaybePort()).isNull();\n      assertThat(authority).isEqualTo(Authority.parse(\"user:password@example.com\"));\n    }\n\n    @Test\n    void of_with_null_userInfo_and_host() {\n      Host host = Host.parse(\"example.com\");\n      Authority authority = Authority.of(null, host);\n      assertThat(authority).hasToString(\"example.com\");\n      assertThat(authority.getUserInfo()).isNull();\n      assertThat(authority.getHost()).isEqualTo(host);\n      assertThat(authority.getPort()).isNull();\n      assertThat(authority.getMaybePort()).isNull();\n      assertThat(authority).isEqualTo(Authority.parse(\"example.com\"));\n    }\n\n    @Test\n    void of_with_all_components() {\n      UserInfo userInfo = UserInfo.parse(\"user:password\");\n      Host host = Host.parse(\"example.com\");\n      Port port = Port.of(8080);\n      Authority authority = Authority.of(userInfo, host, port);\n      assertThat(authority).hasToString(\"user:password@example.com:8080\");\n      assertThat(authority.getUserInfo()).isEqualTo(userInfo);\n      assertThat(authority.getHost()).isEqualTo(host);\n      assertThat(authority.getPort()).isEqualTo(port);\n      assertThat(authority.getMaybePort()).isEqualTo(Optional.of(port));\n      assertThat(authority).isEqualTo(Authority.parse(\"user:password@example.com:8080\"));\n    }\n\n    @Test\n    void of_with_all_components_and_null_port() {\n      UserInfo userInfo = UserInfo.parse(\"user:password\");\n      Host host = Host.parse(\"example.com\");\n      Authority authority = Authority.of(userInfo, host, null);\n      assertThat(authority).hasToString(\"user:password@example.com\");\n      assertThat(authority.getUserInfo()).isEqualTo(userInfo);\n      assertThat(authority.getHost()).isEqualTo(host);\n      assertThat(authority.getPort()).isNull();\n      assertThat(authority.getMaybePort()).isNull();\n      assertThat(authority).isEqualTo(Authority.parse(\"user:password@example.com\"));\n    }\n\n    @Test\n    void of_with_all_components_and_null_userInfo() {\n      Host host = Host.parse(\"example.com\");\n      Port port = Port.of(8080);\n      Authority authority = Authority.of(null, host, port);\n      assertThat(authority).hasToString(\"example.com:8080\");\n      assertThat(authority.getUserInfo()).isNull();\n      assertThat(authority.getHost()).isEqualTo(host);\n      assertThat(authority.getPort()).isEqualTo(port);\n      assertThat(authority.getMaybePort()).isEqualTo(Optional.of(port));\n      assertThat(authority).isEqualTo(Authority.parse(\"example.com:8080\"));\n    }\n\n    @Test\n    void of_returns_hostAndPort_when_no_userInfo() {\n      Host host = Host.parse(\"example.com\");\n      Port port = Port.of(8080);\n      Authority authority = Authority.of(null, host, port);\n      assertThat(authority).hasToString(\"example.com:8080\");\n      assertThat(authority).isInstanceOf(HostAndPort.class);\n    }\n  }\n\n  @Nested\n  class HostAndPortOfMethods {\n\n    @Test\n    void of_with_host_only() {\n      Host host = Host.parse(\"example.com\");\n      HostAndPort hostAndPort = HostAndPort.of(host);\n      assertThat(hostAndPort.getHost()).isEqualTo(host);\n      assertThat(hostAndPort.getPort()).isNull();\n      assertThat(hostAndPort.getUserInfo()).isNull();\n      assertThat(hostAndPort).isEqualTo(HostAndPort.parse(\"example.com\"));\n    }\n\n    @Test\n    void of_with_host_and_port() {\n      Host host = Host.parse(\"example.com\");\n      Port port = Port.of(8080);\n      HostAndPort hostAndPort = HostAndPort.of(host, port);\n      assertThat(hostAndPort.getHost()).isEqualTo(host);\n      assertThat(hostAndPort.getPort()).isEqualTo(port);\n      assertThat(hostAndPort.getUserInfo()).isNull();\n      assertThat(hostAndPort).isEqualTo(HostAndPort.parse(\"example.com:8080\"));\n    }\n\n    @Test\n    void of_with_host_and_null_port() {\n      Host host = Host.parse(\"example.com\");\n      HostAndPort hostAndPort = HostAndPort.of(host, null);\n      assertThat(hostAndPort.getHost()).isEqualTo(host);\n      assertThat(hostAndPort.getPort()).isNull();\n      assertThat(hostAndPort.getUserInfo()).isNull();\n      assertThat(hostAndPort).isEqualTo(HostAndPort.parse(\"example.com\"));\n    }\n\n    @Test\n    void of_equals_authority_of_with_same_components() {\n      Host host = Host.parse(\"example.com\");\n      Port port = Port.of(8080);\n      HostAndPort hostAndPort = HostAndPort.of(host, port);\n      Authority authority = Authority.of(host, port);\n      assertThat(hostAndPort).isEqualTo(authority);\n      assertThat(authority).isEqualTo(hostAndPort);\n    }\n  }\n\n  @Nested\n  class AuthorityNormalise {\n\n    @Test\n    void normalise_with_scheme_removes_default_port() {\n      Authority authority = Authority.parse(\"example.com:80\");\n      Authority normalised = authority.normalise(http);\n      assertThat(normalised).isEqualTo(Authority.parse(\"example.com\"));\n      assertThat(normalised.getPort()).isNull();\n    }\n\n    @Test\n    void normalise_with_scheme_keeps_non_default_port() {\n      Authority authority = Authority.parse(\"example.com:8080\");\n      Authority normalised = authority.normalise(http);\n      assertThat(normalised).isEqualTo(Authority.parse(\"example.com:8080\"));\n      assertThat(normalised.getPort()).isEqualTo(Port.of(8080));\n    }\n\n    @Test\n    void normalise_with_scheme_returns_same_instance_when_already_normalised() {\n      Authority authority = Authority.parse(\"example.com:8080\");\n      Authority normalised = authority.normalise(http);\n      assertThat(normalised).isSameAs(authority);\n    }\n\n    @Test\n    void normalise_with_scheme_normalises_host_and_removes_default_port() {\n      Authority authority = Authority.parse(\"EXAMPLE.COM:80\");\n      Authority normalised = authority.normalise(http);\n      assertThat(normalised).isEqualTo(Authority.parse(\"example.com\"));\n      assertThat(normalised.getPort()).isNull();\n    }\n\n    @Test\n    void normalise_with_userInfo_and_scheme_removes_default_port() {\n      Authority authority = Authority.parse(\"user:password@example.com:80\");\n      Authority normalised = authority.normalise(http);\n      assertThat(normalised).isEqualTo(Authority.parse(\"user:password@example.com\"));\n      assertThat(normalised.getPort()).isNull();\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"example.com\", \"example.com:8080\"})\n    void is_normal_form_with_http_scheme_returns_true(String authorityString) {\n      var authority = Authority.parse(authorityString);\n      assertThat(authority.isNormalForm(http)).isTrue();\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"example.com:\", \"example.com:80\"})\n    void is_normal_form_with_http_scheme_returns_false(String authorityString) {\n      var authority = Authority.parse(authorityString);\n      assertThat(authority.isNormalForm(http)).isFalse();\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"example.com\",\n          \"example.com:123\",\n        })\n    void is_normal_form_with_file_scheme_returns_true(String authorityString) {\n      var authority = Authority.parse(authorityString);\n      assertThat(authority.isNormalForm(file)).isTrue();\n    }\n\n    @Test\n    void is_normal_form_with_file_scheme_returns_false() {\n      var authority = Authority.parse(\"example.com:\");\n      assertThat(authority.isNormalForm(file)).isFalse();\n    }\n\n    static final List<NormalisationCase<Authority>> normalisationCases =\n        Stream.of(\n                Pair.of(\"EXAMPLE.COM:8080\", \"example.com:8080\"),\n                Pair.of(\"EXAMPLE.COM:08080\", \"example.com:8080\"),\n                Pair.of(\"EXAMPLE.COM:\", \"example.com\"),\n                Pair.of(\"example.com:08080\", \"example.com:8080\"),\n                Pair.of(\"example.com:\", \"example.com\"),\n                Pair.of(\"user@EXAMPLE.COM:8080\", \"user@example.com:8080\"),\n                Pair.of(\"user@EXAMPLE.COM:08080\", \"user@example.com:8080\"),\n                Pair.of(\"user@EXAMPLE.COM:\", \"user@example.com\"),\n                Pair.of(\"user@example.com:08080\", \"user@example.com:8080\"),\n                Pair.of(\"user@example.com:\", \"user@example.com\"),\n                Pair.of(\"us%65r@example.com:\", \"user@example.com\"),\n                Pair.of(\"us%65r%2f@example.com:\", \"user%2F@example.com\"))\n            .map(\n                it ->\n                    new NormalisationCase<>(\n                        Authority.parse(it.getLeft()), Authority.parse(it.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_authority_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(normalisationCases);\n    }\n\n    static final List<Authority> alreadyNormalisedAuthorities =\n        Stream.of(\n                \"example.com\",\n                \"example.com:8080\",\n                \"user@example.com:8080\",\n                \"user@example.com\",\n                \"user:@example.com:8080\",\n                \"user:@example.com\",\n                \":@example.com:8080\",\n                \":@example.com\",\n                \":password@example.com:8080\",\n                \":password@example.com\",\n                \"user:password@example.com:8080\",\n                \"userwithencodedcolon%3A@example.com:8080\",\n                \"user:password@example.com\")\n            .map(Authority::parse)\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedAuthorities);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/BaseUrlTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\n\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\n\nclass BaseUrlTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void non_base_path_rejected() {\n\n      IllegalBaseUrl exception =\n          assertThatExceptionOfType(IllegalBaseUrl.class)\n              .isThrownBy(() -> BaseUrl.parse(\"https://example.com/leaf\"))\n              .actual();\n\n      assertThat(exception)\n          .hasMessage(\n              \"Illegal base url: `https://example.com/leaf`; path must be a base path (empty or end in `/`), query must be null, fragment must be null\")\n          .hasNoCause();\n      assertThat(exception.getIllegalValue()).isEqualTo(\"https://example.com/leaf\");\n    }\n  }\n\n  @Nested\n  class Resolve {\n\n    @Test\n    void relative_path_appended_to_empty_path() {\n\n      BaseUrl baseUrl = BaseUrl.parse(\"https://example.com\");\n\n      AbsoluteUrl resolved = baseUrl.resolve(\"some/path\");\n\n      assertThat(resolved).isEqualTo(AbsoluteUrl.parse(\"https://example.com/some/path\"));\n    }\n\n    @Test\n    void relative_path_appended_to_base_path() {\n\n      BaseUrl baseUrl = BaseUrl.parse(\"https://example.com/base/path/\");\n\n      AbsoluteUrl resolved = baseUrl.resolve(\"some/path\");\n\n      assertThat(resolved).isEqualTo(AbsoluteUrl.parse(\"https://example.com/base/path/some/path\"));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/CodecCase.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nrecord CodecCase(String encoded, String decoded) {}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/FragmentTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\nclass FragmentTests {\n\n  @Nested\n  class Parse {\n\n    static final List<String> validFragments =\n        List.of(\n            // Empty and simple fragments\n            \"\",\n            \"section\",\n            \"top\",\n            \"introduction\",\n            \"chapter-1\",\n            \"heading123\",\n\n            // Unreserved characters (alphanumeric, hyphen, period, underscore, tilde)\n            \"section-name\",\n            \"section.name\",\n            \"section_name\",\n            \"section~name\",\n            \"Section123\",\n            \"test-section_123.name~test\",\n\n            // Sub-delimiters (!$&'()*+,;=)\n            \"section!name\",\n            \"section$name\",\n            \"section&name\",\n            \"section'name\",\n            \"section(name)\",\n            \"section*name\",\n            \"section+name\",\n            \"section,name\",\n            \"section;name\",\n            \"section=name\",\n\n            // Colon and at-sign\n            \"time:12:30\",\n            \"user@example\",\n            \"ref:v1.2.3\",\n            \"id:123\",\n\n            // Forward slash and question mark\n            \"path/to/section\",\n            \"section?detail\",\n            \"part/1?view=full\",\n            \"nested/section/subsection\",\n\n            // Percent-encoded characters\n            \"%20\", // space\n            \"section%20name\", // section name\n            \"caf%C3%A9\", // café\n            \"%C3%A9ric\", // éric\n            \"100%25\", // 100%\n            \"path%2Fsection\", // path/section\n\n            // Characters that extend beyond RFC 3986\n            \"section{name}\",\n            \"data[123]\",\n            \"tag<value>\",\n            \"section|name\",\n            \"back\\\\slash\",\n            \"caret^name\",\n            \"grave`name\",\n\n            // Spaces and special characters (permissive)\n            \"section name\", // unencoded space\n            \"section#nested\", // hash\n            \"section[1]\", // brackets\n            \"section<name>\", // angle brackets\n\n            // Complex combinations\n            \"api/v1/users/123\",\n            \"section:subsection:detail\",\n            \"user@domain.com/profile\",\n            \"heading-1.2.3?expanded=true\",\n            \"doc%20section/page%202\",\n\n            // IDs and references\n            \"L123\",\n            \"line-456\",\n            \"ref123\",\n            \"footnote1\",\n\n            // Edge cases\n            \"//double//slashes\",\n            \"trailing/slash/\",\n            \"multiple?question?marks\",\n            \"dots...\",\n            \"dashes---\",\n\n            // JSON-like fragments (percent-encoded and unencoded)\n            \"%7B%22key%22:%22value%22%7D\", // {\"key\":\"value\"}\n            \"data=%7B%7D\", // data={}\n            \"data={}\",\n\n            // No separators\n            \"justonefragment\",\n            \"noseparators123\",\n\n            // Invalid percent encoding (still accepted - permissive parser)\n            \"%\", // incomplete\n            \"%2\", // incomplete\n            \"%GG\", // invalid hex\n            \"section%ZZname\"); // invalid hex\n\n    @ParameterizedTest\n    @FieldSource(\"validFragments\")\n    void parses_valid_fragments(String fragmentString) {\n      Fragment fragment = Fragment.parse(fragmentString);\n      assertThat(fragment.toString()).isEqualTo(fragmentString);\n    }\n\n    @TestFactory\n    Stream<DynamicTest> invariants() {\n      return StringParserInvariantTests.generateInvariantTests(\n          FragmentParser.INSTANCE, validFragments);\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<Fragment>> normalisationCases =\n        Stream.of(\n                // Characters that need encoding\n                Pair.of(\"section name\", \"section%20name\"),\n                Pair.of(\"hello world\", \"hello%20world\"),\n                Pair.of(\"test\\\"quote\", \"test%22quote\"),\n                Pair.of(\"test<tag>\", \"test%3Ctag%3E\"),\n                Pair.of(\"test`backtick\", \"test%60backtick\"),\n                Pair.of(\"data{value}\", \"data%7Bvalue%7D\"),\n                Pair.of(\"test{name}\", \"test%7Bname%7D\"),\n                Pair.of(\"café\", \"caf%C3%A9\"),\n                Pair.of(\"héllo\", \"h%C3%A9llo\"),\n                Pair.of(\"%ff\", \"%FF\"),\n                Pair.of(\"%fF\", \"%FF\"),\n                Pair.of(\"%Ff\", \"%FF\"),\n                Pair.of(\"%5a\", \"%5A\"),\n                Pair.of(\"\\u0001control\", \"%01control\"))\n            .map(\n                testCase ->\n                    new NormalisationCase<>(\n                        Fragment.parse(testCase.getLeft()), Fragment.parse(testCase.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_fragment_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(normalisationCases);\n    }\n\n    static final List<String> alreadyNormalisedFragments =\n        List.of(\n            \"\",\n            \"section\",\n            \"section-name\",\n            \"section_name.test~123\",\n            \"section!name\",\n            \"path/to/section\",\n            \"time:12:30\",\n            \"section?detail\",\n            \"section%20name\",\n            \"caf%C3%A9\",\n            \"test%22quote\",\n            \"%5A\",\n            \"%41\");\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedFragments.stream().map(Fragment::parse).toList());\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    static final List<String> fragmentsWithoutPercentEncoding =\n        List.of(\n            \"\",\n            \"section\",\n            \"chapter-1\",\n            \"section-name.test_123\",\n            \"path/to/section\",\n            \"section?detail\",\n            \"time:12:30\");\n\n    @ParameterizedTest\n    @FieldSource(\"fragmentsWithoutPercentEncoding\")\n    void returns_same_string_for_fragment_without_percent_encoding(String fragmentString) {\n      Fragment fragment = Fragment.parse(fragmentString);\n      assertThat(fragment.decode()).isEqualTo(fragmentString);\n    }\n\n    static final List<CodecCase> encodeCases =\n        List.of(\n            new CodecCase(\"section%20name\", \"section name\"),\n            new CodecCase(\"caf%C3%A9\", \"café\"),\n            new CodecCase(\"%C3%A9ric\", \"éric\"),\n            new CodecCase(\"100%25\", \"100%\"),\n            new CodecCase(\"path/section\", \"path/section\"),\n            new CodecCase(\"%7B%22key%22:%22value%22%7D\", \"{\\\"key\\\":\\\"value\\\"}\"),\n            new CodecCase(\"hello%20world!\", \"hello world!\"),\n            new CodecCase(\"test%3Ctag%3E\", \"test<tag>\"),\n            new CodecCase(\"test%60backtick\", \"test`backtick\"));\n\n    @ParameterizedTest\n    @FieldSource(\"encodeCases\")\n    void encodes_percent_encoded_correctly(CodecCase testCase) {\n      var encoded = Fragment.encode(testCase.decoded());\n      assertThat(encoded.toString()).isEqualTo(testCase.encoded());\n      assertThat(encoded.decode()).isEqualTo(testCase.decoded());\n    }\n\n    static final List<CodecCase> decodeCases =\n        List.of(\n            new CodecCase(\"section%20name\", \"section name\"),\n            new CodecCase(\"caf%C3%A9\", \"café\"),\n            new CodecCase(\"%C3%A9ric\", \"éric\"),\n            new CodecCase(\"100%25\", \"100%\"),\n            new CodecCase(\"path%2Fsection\", \"path/section\"),\n            new CodecCase(\"%7B%22key%22:%22value%22%7D\", \"{\\\"key\\\":\\\"value\\\"}\"),\n            new CodecCase(\"hello%20world%21\", \"hello world!\"),\n            new CodecCase(\"test%3Ctag%3E\", \"test<tag>\"),\n            new CodecCase(\"test%60backtick\", \"test`backtick\"));\n\n    @ParameterizedTest\n    @FieldSource(\"decodeCases\")\n    void decodes_percent_encoded_correctly(CodecCase testCase) {\n      var encoded = Fragment.parse(testCase.encoded());\n      assertThat(encoded.decode()).isEqualTo(testCase.decoded());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      var decoded =\n          Stream.concat(decodeCases.stream(), encodeCases.stream())\n              .map(CodecCase::decoded)\n              .collect(Collectors.toSet())\n              .stream()\n              .sorted();\n\n      return generateEncodeDecodeInvariantTests(FragmentParser.INSTANCE, decoded);\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    @Test\n    void fragments_with_same_value_are_equal() {\n      Fragment fragment1 = Fragment.parse(\"section\");\n      Fragment fragment2 = Fragment.parse(\"section\");\n      assertThat(fragment1).isEqualTo(fragment2);\n    }\n\n    @Test\n    void fragments_with_different_values_are_not_equal() {\n      Fragment fragment1 = Fragment.parse(\"section1\");\n      Fragment fragment2 = Fragment.parse(\"section2\");\n      assertThat(fragment1).isNotEqualTo(fragment2);\n    }\n\n    @Test\n    void fragments_with_different_case_are_not_equal() {\n      Fragment fragment1 = Fragment.parse(\"section\");\n      Fragment fragment2 = Fragment.parse(\"SECTION\");\n      assertThat(fragment1).isNotEqualTo(fragment2);\n    }\n\n    @Test\n    void fragment_is_equal_to_itself() {\n      Fragment fragment = Fragment.parse(\"section\");\n      assertThat(fragment).isEqualTo(fragment);\n    }\n\n    @Test\n    void fragment_is_not_equal_to_null() {\n      Fragment fragment = Fragment.parse(\"section\");\n      assertThat(fragment).isNotEqualTo(null);\n    }\n\n    @Test\n    @SuppressWarnings(\"AssertBetweenInconvertibleTypes\")\n    void fragment_is_not_equal_to_different_type() {\n      Fragment fragment = Fragment.parse(\"section\");\n      assertThat(fragment).isNotEqualTo(\"section\");\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void equal_fragments_have_same_hash_code() {\n      Fragment fragment1 = Fragment.parse(\"section\");\n      Fragment fragment2 = Fragment.parse(\"section\");\n      assertThat(fragment1.hashCode()).isEqualTo(fragment2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      Fragment fragment = Fragment.parse(\"section-name\");\n      int hashCode1 = fragment.hashCode();\n      int hashCode2 = fragment.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class ToStringMethod {\n\n    @Test\n    void to_string_returns_original_fragment() {\n      String fragmentString = \"section-name\";\n      Fragment fragment = Fragment.parse(fragmentString);\n      assertThat(fragment.toString()).isEqualTo(fragmentString);\n    }\n\n    @Test\n    void to_string_preserves_case() {\n      String fragmentString = \"Section-Name\";\n      Fragment fragment = Fragment.parse(fragmentString);\n      assertThat(fragment.toString()).isEqualTo(fragmentString);\n    }\n\n    @Test\n    void to_string_preserves_percent_encoding() {\n      String encoded = \"section%20name\";\n      Fragment fragment = Fragment.parse(encoded);\n      assertThat(fragment.toString()).isEqualTo(encoded);\n    }\n\n    @Test\n    void to_string_result_can_be_parsed_back() {\n      Fragment original = Fragment.parse(\"section/subsection\");\n      String stringForm = original.toString();\n      Fragment parsed = Fragment.parse(stringForm);\n      assertThat(parsed).isEqualTo(original);\n      assertThat(parsed.toString()).isEqualTo(stringForm);\n    }\n  }\n\n  @Nested\n  class Initialisation extends AbstractEncodableInitialisationTests {\n\n    Initialisation() {\n      super(\"org.wiremock.url.Fragment\", EMPTY, \"org.wiremock.url.FragmentParser\", \"\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/HostAndPortTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThatThrownBy;\nimport static org.assertj.core.api.AssertionsForClassTypes.assertThat;\nimport static org.wiremock.url.SchemeRegistry.http;\nimport static org.wiremock.url.SchemeRegistry.https;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.wiremock.url.AuthorityTests.Parse.AuthorityParseTestCase;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\nclass HostAndPortTests {\n\n  @Test\n  void withoutPortRemovesPort() {\n    HostAndPort hostAndPort = HostAndPort.parse(\"example.com:80\");\n    assertThat(hostAndPort.withoutPort()).isEqualTo(HostAndPort.parse(\"example.com\"));\n  }\n\n  @Test\n  void withoutPortDoesNothingIfNoPort() {\n    var hostAndPort = HostAndPort.parse(\"example.com\");\n    assertThat(hostAndPort.withoutPort()).isSameAs(hostAndPort);\n  }\n\n  @Test\n  void withPortNullRemovesPort() {\n    HostAndPort hostAndPort = HostAndPort.parse(\"example.com:80\");\n    assertThat(hostAndPort.withPort(null)).isEqualTo(HostAndPort.parse(\"example.com\"));\n  }\n\n  @Test\n  void withPortNullDoesNothingIfNoPort() {\n    var hostAndPort = HostAndPort.parse(\"example.com\");\n    assertThat(hostAndPort.withPort(null)).isSameAs(hostAndPort);\n  }\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"example.com\", \"example.com:80\"})\n  void withPortChangesPort(String original) {\n    assertThat(HostAndPort.parse(original).withPort(Port.of(8080)))\n        .isEqualTo(HostAndPort.parse(\"example.com:8080\"));\n  }\n\n  @Test\n  void withPortDoesNothingIfNoChangeInPort() {\n    var hostAndPort = HostAndPort.parse(\"example.com:8080\");\n    assertThat(hostAndPort.withPort(Port.of(8080))).isSameAs(hostAndPort);\n  }\n\n  @TestFactory\n  Stream<DynamicTest> invariants() {\n    List<String> authorities =\n        validHostAndPorts.stream().map(AuthorityParseTestCase::stringForm).toList();\n    return StringParserInvariantTests.generateInvariantTests(\n        HostAndPortParser.INSTANCE, authorities);\n  }\n\n  private static final List<AuthorityParseTestCase> validHostAndPorts =\n      AuthorityTests.Parse.validHostAndPorts;\n\n  @ParameterizedTest\n  @FieldSource(\"validHostAndPorts\")\n  void parses_valid_host_and_port(AuthorityParseTestCase urlTest) {\n    HostAndPort hostAndPort = HostAndPort.parse(urlTest.stringForm());\n    assertThat(hostAndPort.getUserInfo()).isNull();\n    assertThat(hostAndPort.getHost()).isEqualTo(urlTest.expectation().host());\n    assertThat(hostAndPort.getPort()).isEqualTo(urlTest.expectation().port());\n  }\n\n  private static final List<AuthorityParseTestCase> illegalHostAndPorts =\n      AuthorityTests.Parse.validAuthoritiesWithUserInfo;\n\n  @ParameterizedTest\n  @FieldSource(\"illegalHostAndPorts\")\n  void rejects_illegal_host_and_port(AuthorityParseTestCase urlTest) {\n    assertThatThrownBy(() -> HostAndPort.parse(urlTest.stringForm()))\n        .isInstanceOf(IllegalHostAndPort.class)\n        .hasMessage(\"Illegal host and port: `\" + urlTest.stringForm() + \"`\");\n  }\n\n  @Nested\n  class HostAndPortNormalise {\n\n    @Test\n    void normalise_returns_same_instance_when_already_normalised() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:8080\");\n      HostAndPort normalised = hostAndPort.normalise();\n      assertThat(normalised).isSameAs(hostAndPort);\n    }\n\n    @Test\n    void normalise_normalises_host() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"EXAMPLE.COM:8080\");\n      HostAndPort normalised = hostAndPort.normalise();\n      assertThat(normalised).isEqualTo(HostAndPort.parse(\"example.com:8080\"));\n      assertThat(normalised).isNotSameAs(hostAndPort);\n    }\n\n    @Test\n    void normalise_normalises_port() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:00080\");\n      HostAndPort normalised = hostAndPort.normalise();\n      assertThat(normalised).isEqualTo(HostAndPort.parse(\"example.com:80\"));\n      assertThat(normalised).isNotSameAs(hostAndPort);\n    }\n\n    @Test\n    void normalise_with_scheme_removes_default_port() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:80\");\n      HostAndPort normalised = hostAndPort.normalise(http);\n      assertThat(normalised).isEqualTo(HostAndPort.parse(\"example.com\"));\n      assertThat(normalised.getPort()).isNull();\n    }\n\n    @Test\n    void normalise_with_scheme_keeps_non_default_port() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:8080\");\n      HostAndPort normalised = hostAndPort.normalise(http);\n      assertThat(normalised).isEqualTo(HostAndPort.parse(\"example.com:8080\"));\n      assertThat(normalised.getPort()).isEqualTo(Port.of(8080));\n    }\n\n    @Test\n    void normalise_with_scheme_returns_same_instance_when_already_normalised() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com:8080\");\n      HostAndPort normalised = hostAndPort.normalise(http);\n      assertThat(normalised).isSameAs(hostAndPort);\n    }\n\n    @Test\n    void normalise_with_scheme_normalises_host_and_removes_default_port() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"EXAMPLE.COM:80\");\n      HostAndPort normalised = hostAndPort.normalise(http);\n      assertThat(normalised).isEqualTo(HostAndPort.parse(\"example.com\"));\n      assertThat(normalised.getPort()).isNull();\n    }\n\n    @Test\n    void normalise_with_scheme_normalises_host_and_port() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"EXAMPLE.COM:00443\");\n      HostAndPort normalised = hostAndPort.normalise(https);\n      assertThat(normalised).isEqualTo(HostAndPort.parse(\"example.com\"));\n      assertThat(normalised.getPort()).isNull();\n    }\n\n    @Test\n    void normalise_without_port_returns_same_instance() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com\");\n      HostAndPort normalised = hostAndPort.normalise();\n      assertThat(normalised).isSameAs(hostAndPort);\n    }\n\n    @Test\n    void normalise_with_scheme_without_port_returns_same_instance() {\n      HostAndPort hostAndPort = HostAndPort.parse(\"example.com\");\n      HostAndPort normalised = hostAndPort.normalise(http);\n      assertThat(normalised).isSameAs(hostAndPort);\n    }\n\n    static final List<NormalisationCase<Authority>> normalisationCases =\n        Stream.of(\n                Pair.of(\"EXAMPLE.COM:8080\", \"example.com:8080\"),\n                Pair.of(\"EXAMPLE.COM:08080\", \"example.com:8080\"),\n                Pair.of(\"example.com:08080\", \"example.com:8080\"))\n            .map(\n                it ->\n                    new NormalisationCase<>(\n                        HostAndPort.parse(it.getLeft()), HostAndPort.parse(it.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_hostAndPort_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(normalisationCases);\n    }\n\n    static final List<HostAndPort> alreadyNormalisedAuthorities =\n        Stream.of(\"example.com\", \"example.com:8080\").map(HostAndPort::parse).toList();\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedAuthorities);\n    }\n  }\n\n  @Nested\n  class Initialisation extends AbstractInitialisationTests {\n    Initialisation() {\n      super(\"org.wiremock.url.HostAndPort\", EMPTY, \"org.wiremock.url.HostAndPortParser\", \"\");\n    }\n\n    @Test\n    void of_initialises_as_expected() throws Exception {\n      try (IsolatedClassLoader classLoader = new IsolatedClassLoader()) {\n\n        var emptyHost = classLoader.load(\"org.wiremock.url.Host\").field(EMPTY);\n        var empty =\n            classLoader\n                .load(\"org.wiremock.url.HostAndPort\")\n                .invoke(\n                    \"of\",\n                    Pair.of(\"org.wiremock.url.Host\", emptyHost),\n                    Pair.of(\"org.wiremock.url.Port\", null));\n        assertThat(empty).hasToString(\"\");\n\n        assertStaticFieldInitialised(classLoader);\n      }\n    }\n  }\n\n  @Nested\n  class AuthorityInitialisation extends AbstractInitialisationTests {\n    AuthorityInitialisation() {\n      super(\"org.wiremock.url.HostAndPort\", EMPTY, \"org.wiremock.url.AuthorityParser\", \"\");\n    }\n\n    @Test\n    void of_initialises_as_expected() throws Exception {\n      try (IsolatedClassLoader classLoader = new IsolatedClassLoader()) {\n\n        var emptyHost = classLoader.load(\"org.wiremock.url.Host\").field(EMPTY);\n        var empty =\n            classLoader\n                .load(\"org.wiremock.url.Authority\")\n                .invoke(\n                    \"of\",\n                    Pair.of(\"org.wiremock.url.UserInfo\", null),\n                    Pair.of(\"org.wiremock.url.Host\", emptyHost),\n                    Pair.of(\"org.wiremock.url.Port\", null));\n        assertThat(empty).hasToString(\"\");\n\n        assertStaticFieldInitialised(classLoader);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/HostTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.function.Function.identity;\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.MethodSource;\nimport org.junit.jupiter.params.provider.ValueSource;\n\nclass HostTests {\n\n  @Nested\n  class Parse {\n\n    @Nested\n    class IPv4Addresses {\n      static Stream<String> validIpv4Addresses() {\n        return Stream.of(\n            \"0.0.0.0\",\n            \"1.1.1.1\",\n            \"8.8.8.8\",\n            \"127.0.0.1\",\n            \"192.168.0.1\",\n            \"192.168.1.100\",\n            \"10.0.0.1\",\n            \"172.16.0.1\",\n            \"255.255.255.255\",\n            \"1.2.3.4\",\n            \"100.200.50.25\");\n      }\n\n      @ParameterizedTest\n      @MethodSource(\"validIpv4Addresses\")\n      void parses_valid_ipv4_addresses(String ipv4) {\n        Host host = Host.parse(ipv4);\n        assertThat(host.toString()).isEqualTo(ipv4);\n      }\n\n      @Test\n      void parses_invalid_ipv4_as_registered_name() {\n        // The regex treats these as valid registered names, not invalid IPv4\n        // This is acceptable per RFC 3986 - the host component doesn't validate IPv4 semantics\n        Host host1 = Host.parse(\"256.1.1.1\");\n        assertThat(host1.toString()).isEqualTo(\"256.1.1.1\");\n\n        Host host2 = Host.parse(\"1.1.1\");\n        assertThat(host2.toString()).isEqualTo(\"1.1.1\");\n\n        Host host3 = Host.parse(\"a.b.c.d\");\n        assertThat(host3.toString()).isEqualTo(\"a.b.c.d\");\n      }\n    }\n\n    @Nested\n    class IPv6Addresses {\n\n      static Stream<String> validIpv6Addresses() {\n        return Stream.of(\n            \"[::1]\", // loopback\n            \"[::ffff:192.0.2.1]\", // IPv4-mapped\n            \"[2001:db8::1]\",\n            \"[2001:0db8:0000:0000:0000:0000:0000:0001]\", // full form\n            \"[fe80::1]\",\n            \"[::1234:5678]\",\n            \"[2001:db8:85a3::8a2e:370:7334]\",\n            \"[2001:db8:85a3:0:0:8a2e:370:7334]\",\n            \"[::]\", // all zeros\n            \"[2001:db8::8a2e:370:7334]\",\n            \"[ff02::1]\",\n            \"[ff02::2]\");\n      }\n\n      @ParameterizedTest\n      @MethodSource(\"validIpv6Addresses\")\n      void parses_valid_ipv6_addresses(String ipv6) {\n        Host host = Host.parse(ipv6);\n        assertThat(host.toString()).isEqualTo(ipv6);\n      }\n\n      @ParameterizedTest\n      @ValueSource(\n          strings = {\n            \"::1\", // missing brackets\n            \"2001:db8::1\", // missing brackets\n            \"[2001:db8::1\", // missing closing bracket\n            \"2001:db8::1]\", // missing opening bracket\n            \"[]\", // empty brackets\n            \"[[::1]]\", // double brackets\n            \"[123abc]\", // hex digits without colons\n            \"[ABCDEF]\", // hex digits without colons\n            \"[0000]\", // digits without colons\n            \"[:::::]\", // only colons, invalid format\n            \"[1:2:3:4:5:6:7:8:9]\", // too many groups\n            \"[gggg::1]\", // invalid hex character\n            \"[1:2:3:4:5:6:7:8:9:10]\", // way too many groups\n            \"[12345::1]\", // group with too many digits\n          })\n      void throws_exception_for_invalid_ipv6_addresses(String invalidIpv6) {\n        assertThatExceptionOfType(IllegalHost.class)\n            .isThrownBy(() -> Host.parse(invalidIpv6))\n            .withMessage(\"Illegal host: `\" + invalidIpv6 + \"`\")\n            .extracting(IllegalHost::getIllegalValue)\n            .isEqualTo(invalidIpv6);\n      }\n\n      @TestFactory\n      Stream<DynamicTest> invariants() {\n        List<String> validHosts =\n            Stream.of(\n                    IPv4Addresses.validIpv4Addresses(),\n                    IPv6Addresses.validIpv6Addresses(),\n                    RegisteredNames.validRegisteredNames(),\n                    Stream.of(\"\"))\n                .flatMap(identity())\n                .toList();\n\n        return StringParserInvariantTests.generateInvariantTests(HostParser.INSTANCE, validHosts);\n      }\n    }\n\n    @Nested\n    class RegisteredNames {\n\n      static Stream<String> validRegisteredNames() {\n        return Stream.of(\n            \"localhost\",\n            \"example.com\",\n            \"www.example.com\",\n            \"sub.domain.example.com\",\n            \"example.co.uk\",\n            \"my-server\",\n            \"my_server\",\n            \"server123\",\n            \"123server\",\n            \"a\",\n            \"a.b\",\n            \"a.b.c.d.e.f.g\",\n            \"xn--e1afmkfd.xn--p1ai\", // punycode (Russian domain)\n            \"test-123.example.com\",\n            \"test_123.example.com\",\n            \"test~server\", // tilde is unreserved\n            \"test.server\",\n            \"%20\", // space encoded\n            \"%2F\", // slash encoded\n            \"test%20server\",\n            \"my%2Fserver\",\n            \"%C3%A9\", // é encoded\n            \"caf%C3%A9.example.com\",\n            \"%41%42%43\", // ABC encoded\n            \"test!\", // sub-delims\n            \"test$\",\n            \"test&\",\n            \"test'\",\n            \"test(\",\n            \"test)\",\n            \"test*\",\n            \"test+\",\n            \"test,\",\n            \"test;\",\n            \"test=\",\n            \"ex!ample.com\",\n            \"ex$ample.com\");\n      }\n\n      @ParameterizedTest\n      @MethodSource(\"validRegisteredNames\")\n      void parses_valid_registered_names(String registeredName) {\n        Host host = Host.parse(registeredName);\n        assertThat(host.toString()).isEqualTo(registeredName);\n      }\n\n      @ParameterizedTest\n      @ValueSource(\n          strings = {\n            \"example.com:8080\", // port included (not part of host)\n            \"user@example.com\", // userinfo included\n            \"example.com/path\", // path included\n            \"example.com?query\", // query included\n            \"example.com#fragment\", // fragment included\n            \"<invalid>\",\n            \"in valid\", // space\n            \"test\\nserver\", // newline\n            \"test\\tserver\", // tab\n          })\n      void throws_exception_for_invalid_registered_names(String invalidName) {\n        assertThatExceptionOfType(IllegalHost.class)\n            .isThrownBy(() -> Host.parse(invalidName))\n            .withMessage(\"Illegal host: `\" + invalidName + \"`\")\n            .extracting(IllegalHost::getIllegalValue)\n            .isEqualTo(invalidName);\n      }\n\n      @ParameterizedTest\n      @ValueSource(\n          strings = {\n            \"%\", // incomplete encoding\n            \"%2\", // incomplete encoding\n            \"%GG\", // invalid hex\n            \"%ZZ\", // invalid hex\n            \"test%2\", // incomplete at end\n            \"test%\", // incomplete at end\n            \"test%ZZserver\", // invalid hex\n          })\n      void throws_exception_for_invalid_percent_encoding(String invalidEncoding) {\n        assertThatExceptionOfType(IllegalHost.class)\n            .isThrownBy(() -> Host.parse(invalidEncoding))\n            .withMessage(\"Illegal host: `\" + invalidEncoding + \"`\")\n            .extracting(IllegalHost::getIllegalValue)\n            .isEqualTo(invalidEncoding);\n      }\n\n      @Test\n      void parses_empty_registered_name() {\n        Host host = Host.parse(\"\");\n        assertThat(host.toString()).isEmpty();\n      }\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    @Test\n    void hosts_with_same_value_are_equal() {\n      Host host1 = Host.parse(\"example.com\");\n      Host host2 = Host.parse(\"example.com\");\n      assertThat(host1).isEqualTo(host2);\n    }\n\n    @Test\n    void ipv4_hosts_with_same_value_are_equal() {\n      Host host1 = Host.parse(\"192.168.1.1\");\n      Host host2 = Host.parse(\"192.168.1.1\");\n      assertThat(host1).isEqualTo(host2);\n    }\n\n    @Test\n    void ipv6_hosts_with_same_value_are_equal() {\n      Host host1 = Host.parse(\"[::1]\");\n      Host host2 = Host.parse(\"[::1]\");\n      assertThat(host1).isEqualTo(host2);\n    }\n\n    @Test\n    void hosts_with_different_values_are_not_equal() {\n      Host host1 = Host.parse(\"example.com\");\n      Host host2 = Host.parse(\"other.com\");\n      assertThat(host1).isNotEqualTo(host2);\n    }\n\n    @Test\n    void hosts_with_different_case_are_not_equal() {\n      Host host1 = Host.parse(\"example.com\");\n      Host host2 = Host.parse(\"EXAMPLE.COM\");\n      assertThat(host1).isNotEqualTo(host2);\n    }\n\n    @Test\n    void ipv4_and_registered_name_are_not_equal() {\n      Host ipv4 = Host.parse(\"127.0.0.1\");\n      Host name = Host.parse(\"localhost\");\n      assertThat(ipv4).isNotEqualTo(name);\n    }\n\n    @Test\n    void host_is_equal_to_itself() {\n      Host host = Host.parse(\"example.com\");\n      assertThat(host).isEqualTo(host);\n    }\n\n    @Test\n    void host_is_not_equal_to_null() {\n      Host host = Host.parse(\"example.com\");\n      assertThat(host).isNotEqualTo(null);\n    }\n\n    @Test\n    @SuppressWarnings(\"AssertBetweenInconvertibleTypes\")\n    void host_is_not_equal_to_different_type() {\n      Host host = Host.parse(\"example.com\");\n      assertThat(host).isNotEqualTo(\"example.com\");\n    }\n\n    @Test\n    void equals_is_symmetric() {\n      Host host1 = Host.parse(\"test.example.com\");\n      Host host2 = Host.parse(\"test.example.com\");\n      assertThat(host1.equals(host2)).isEqualTo(host2.equals(host1));\n    }\n\n    @Test\n    void equals_is_transitive() {\n      Host host1 = Host.parse(\"192.168.1.100\");\n      Host host2 = Host.parse(\"192.168.1.100\");\n      Host host3 = Host.parse(\"192.168.1.100\");\n      assertThat(host1).isEqualTo(host2);\n      assertThat(host2).isEqualTo(host3);\n      assertThat(host1).isEqualTo(host3);\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void equal_hosts_have_same_hash_code() {\n      Host host1 = Host.parse(\"example.com\");\n      Host host2 = Host.parse(\"example.com\");\n      assertThat(host1.hashCode()).isEqualTo(host2.hashCode());\n    }\n\n    @Test\n    void equal_ipv4_hosts_have_same_hash_code() {\n      Host host1 = Host.parse(\"10.0.0.1\");\n      Host host2 = Host.parse(\"10.0.0.1\");\n      assertThat(host1.hashCode()).isEqualTo(host2.hashCode());\n    }\n\n    @Test\n    void equal_ipv6_hosts_have_same_hash_code() {\n      Host host1 = Host.parse(\"[2001:db8::1]\");\n      Host host2 = Host.parse(\"[2001:db8::1]\");\n      assertThat(host1.hashCode()).isEqualTo(host2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      Host host = Host.parse(\"www.example.com\");\n      int hashCode1 = host.hashCode();\n      int hashCode2 = host.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class ToStringMethod {\n\n    @Test\n    void to_string_returns_original_registered_name() {\n      String hostString = \"example.com\";\n      Host host = Host.parse(hostString);\n      assertThat(host.toString()).isEqualTo(hostString);\n    }\n\n    @Test\n    void to_string_returns_original_ipv4() {\n      String ipv4 = \"192.168.1.1\";\n      Host host = Host.parse(ipv4);\n      assertThat(host.toString()).isEqualTo(ipv4);\n    }\n\n    @Test\n    void to_string_returns_original_ipv6() {\n      String ipv6 = \"[2001:db8::1]\";\n      Host host = Host.parse(ipv6);\n      assertThat(host.toString()).isEqualTo(ipv6);\n    }\n\n    @Test\n    void to_string_preserves_case() {\n      String hostString = \"Example.COM\";\n      Host host = Host.parse(hostString);\n      assertThat(host.toString()).isEqualTo(hostString);\n    }\n\n    @Test\n    void to_string_preserves_percent_encoding() {\n      String encoded = \"test%20server\";\n      Host host = Host.parse(encoded);\n      assertThat(host.toString()).isEqualTo(encoded);\n    }\n\n    @Test\n    void to_string_result_can_be_parsed_back() {\n      Host original = Host.parse(\"www.example.com\");\n      String stringForm = original.toString();\n      Host parsed = Host.parse(stringForm);\n      assertThat(parsed).isEqualTo(original);\n      assertThat(parsed.toString()).isEqualTo(stringForm);\n    }\n  }\n\n  @Nested\n  class NormaliseMethod {\n\n    record NormalisationCase(String input, String expected) {}\n\n    static final List<NormalisationCase> normalisationCases =\n        List.of(\n            new NormalisationCase(\"EXAMPLE.COM\", \"example.com\"),\n            new NormalisationCase(\"Example.COM\", \"example.com\"),\n            new NormalisationCase(\"test%2fserver\", \"test%2Fserver\"),\n            new NormalisationCase(\"EXAMPLE.COM%2fPath%20Test\", \"example.com%2Fpath%20test\"),\n            new NormalisationCase(\"test%2f%20%3a%3Aserver\", \"test%2F%20%3A%3Aserver\"),\n            new NormalisationCase(\"[2001:DB8::1]\", \"[2001:db8::1]\"),\n            new NormalisationCase(\"[FE80::1]\", \"[fe80::1]\"),\n            new NormalisationCase(\"Test!Server$Example\", \"test!server$example\"),\n            new NormalisationCase(\"caf%c3%a9.Example.COM\", \"caf%C3%A9.example.com\"),\n            new NormalisationCase(\"Test-Server_123.Example.COM\", \"test-server_123.example.com\"));\n\n    @TestFactory\n    Stream<DynamicTest> normalises_host_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(\n          normalisationCases.stream()\n              .map(\n                  testCase ->\n                      new NormalisableInvariantTests.NormalisationCase<>(\n                          Host.parse(testCase.input()), Host.parse(testCase.expected())))\n              .toList());\n    }\n\n    static final List<String> alreadyNormalisedHosts =\n        List.of(\"example.com\", \"192.168.1.1\", \"[2001:db8::1]\", \"test%2Fserver\", \"\");\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedHosts.stream().map(Host::parse).toList());\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    static final List<String> hostsWithoutPercentEncoding =\n        List.of(\n            \"example.com\",\n            \"192.168.1.1\",\n            \"[2001:db8::1]\",\n            \"\",\n            \"test-server_123.example.com\",\n            \"test!server$example\");\n\n    static final List<CodecCase> decodeCases =\n        List.of(\n            new CodecCase(\"test%20server\", \"test server\"),\n            new CodecCase(\"test%20%21server\", \"test !server\"),\n            new CodecCase(\"caf%C3%A9.example.com\", \"café.example.com\"),\n            new CodecCase(\"%2F\", \"/\"),\n            new CodecCase(\"example.com%2Fpath\", \"example.com/path\"),\n            new CodecCase(\"test%2fserver\", \"test/server\"),\n            new CodecCase(\"%C3%A9\", \"é\"),\n            new CodecCase(\"hello%20world%21\", \"hello world!\"),\n            new CodecCase(\"test%3A%2F%2Fserver\", \"test://server\"));\n\n    @ParameterizedTest\n    @FieldSource(\"hostsWithoutPercentEncoding\")\n    void returns_same_string_for_host_without_percent_encoding(String hostString) {\n      Host host = Host.parse(hostString);\n      assertThat(host.decode()).isEqualTo(hostString);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"decodeCases\")\n    void decodes_percent_encoded_host_correctly(CodecCase testCase) {\n      Host host = Host.parse(testCase.encoded());\n      assertThat(host.decode()).isEqualTo(testCase.decoded());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      return generateEncodeDecodeInvariantTests(\n          HostParser.INSTANCE,\n          Stream.of(\n              \"foo\", \"example.com\", \"test123\", \"hello world\", \"café\", \"example.org\", \"こんにちは\"));\n    }\n  }\n\n  @Nested\n  class EdgeCases {\n\n    @Test\n    void parses_host_with_many_subdomains() {\n      String longHost = \"a.b.c.d.e.f.g.h.i.j.k.l.m.example.com\";\n      Host host = Host.parse(longHost);\n      assertThat(host.toString()).isEqualTo(longHost);\n    }\n\n    @Test\n    void parses_single_character_host() {\n      Host host = Host.parse(\"a\");\n      assertThat(host.toString()).isEqualTo(\"a\");\n    }\n\n    @Test\n    void parses_numeric_registered_name() {\n      Host host = Host.parse(\"123456\");\n      assertThat(host.toString()).isEqualTo(\"123456\");\n    }\n\n    @Test\n    void parses_host_with_all_unreserved_characters() {\n      String unreservedHost = \"aZ09-._~\";\n      Host host = Host.parse(unreservedHost);\n      assertThat(host.toString()).isEqualTo(unreservedHost);\n    }\n\n    @Test\n    void parses_host_with_multiple_percent_encodings() {\n      String encoded = \"test%20%21%22%23server\";\n      Host host = Host.parse(encoded);\n      assertThat(host.toString()).isEqualTo(encoded);\n    }\n\n    @Test\n    void parses_minimum_ipv4() {\n      Host host = Host.parse(\"0.0.0.0\");\n      assertThat(host.toString()).isEqualTo(\"0.0.0.0\");\n    }\n\n    @Test\n    void parses_maximum_ipv4() {\n      Host host = Host.parse(\"255.255.255.255\");\n      assertThat(host.toString()).isEqualTo(\"255.255.255.255\");\n    }\n  }\n\n  @Nested\n  class Initialisation extends AbstractEncodableInitialisationTests {\n\n    Initialisation() {\n      super(\"org.wiremock.url.Host\", EMPTY, \"org.wiremock.url.HostParser\", \"\");\n    }\n  }\n\n  @Nested\n  class LocalhostInitialisation extends AbstractEncodableInitialisationTests {\n\n    LocalhostInitialisation() {\n      super(\"org.wiremock.url.Host\", \"LOCALHOST\", \"org.wiremock.url.HostParser\", \"localhost\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/IsolatedClassLoader.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static java.util.Objects.requireNonNull;\n\nimport java.io.Closeable;\nimport java.io.File;\nimport java.io.IOException;\nimport java.lang.reflect.InvocationTargetException;\nimport java.lang.reflect.Method;\nimport java.net.URL;\nimport java.net.URLClassLoader;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Random;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.jspecify.annotations.Nullable;\n\nclass IsolatedClassLoader implements Closeable {\n\n  private static final URL[] urls = getClasspathUrls();\n  private final URLClassLoader isolated =\n      new URLClassLoader(\n          \"isolated-\" + new Random().nextInt(), urls, ClassLoader.getPlatformClassLoader());\n\n  ReflectiveInstance load(String className) throws ClassNotFoundException {\n    return new ReflectiveInstance(isolated.loadClass(className), isolated);\n  }\n\n  private static URL[] getClasspathUrls() {\n    return Arrays.stream(System.getProperty(\"java.class.path\").split(File.pathSeparator))\n        .map(\n            path -> {\n              try {\n                return new File(path).toURI().toURL();\n              } catch (Exception e) {\n                throw new RuntimeException(e);\n              }\n            })\n        .toArray(URL[]::new);\n  }\n\n  @Override\n  public void close() throws IOException {\n    isolated.close();\n  }\n}\n\n@SuppressWarnings(\"unused\")\nfinal class ReflectiveInstance {\n\n  private final Object instance;\n  private final Class<?> theClass;\n  private final ClassLoader classLoader;\n\n  ReflectiveInstance(Object instance, ClassLoader classLoader) {\n    this.instance = requireNonNull(instance);\n    theClass = instance instanceof Class<?> aClass ? aClass : instance.getClass();\n    this.classLoader = classLoader;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (o == this) {\n      return true;\n    }\n    if (!(o instanceof ReflectiveInstance that)) return false;\n    return instance.equals(that.instance);\n  }\n\n  @Override\n  public int hashCode() {\n    return instance.hashCode();\n  }\n\n  @Override\n  public String toString() {\n    return instance.toString();\n  }\n\n  public ReflectiveInstance getReflectiveClass() {\n    return new ReflectiveInstance(instance.getClass(), classLoader);\n  }\n\n  @Nullable ReflectiveInstance invoke(String methodName, Object... args)\n      throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {\n    return invoke(methodName, Arrays.stream(args).map(this::transform).toList());\n  }\n\n  private Pair<Class<?>, Object> transform(Object arg) {\n    if (arg instanceof ReflectiveInstance ref) {\n      return Pair.of((Class<?>) getReflectiveClass().instance, ref.instance);\n    } else {\n      return Pair.of(arg.getClass(), arg);\n    }\n  }\n\n  @SafeVarargs\n  @Nullable\n  final ReflectiveInstance invoke(String methodName, Pair<String, @Nullable Object>... args)\n      throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n    return invoke(methodName, Arrays.stream(args).map(this::transform).toList());\n  }\n\n  private Pair<Class<?>, @Nullable Object> transform(Pair<String, @Nullable Object> arg) {\n    try {\n      Object param = arg.getRight();\n      Object unwrapped = param instanceof ReflectiveInstance ref ? ref.instance : param;\n\n      return Pair.of(classLoader.loadClass(arg.getLeft()), unwrapped);\n    } catch (ClassNotFoundException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private @Nullable ReflectiveInstance invoke(\n      String methodName, List<Pair<Class<?>, @Nullable Object>> args)\n      throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {\n    Class<?>[] parameterTypes = args.stream().map(Pair::getLeft).toArray(Class<?>[]::new);\n\n    Object[] parameters = args.stream().map(Pair::getRight).toArray();\n    Method theMethod = theClass.getMethod(methodName, parameterTypes);\n    theMethod.setAccessible(true);\n    //    System.out.println(describe(theMethod));\n    //    for (Object parameter : parameters) {\n    //      System.out.println(describe(parameter));\n    //    }\n    Object result = theMethod.invoke(instance, parameters);\n    return asInstance(result);\n  }\n\n  private String describe(Method theMethod) {\n    StringBuilder base = new StringBuilder(theMethod.toString()).append('\\n');\n    for (Class<?> parameterType : theMethod.getParameterTypes()) {\n      ClassLoader parameterTypeClassLoader = parameterType.getClassLoader();\n      base.append(parameterType.getName())\n          .append(\" \")\n          .append(\n              parameterTypeClassLoader != null ? parameterTypeClassLoader.getName() : \"bootstrap\")\n          .append('\\n');\n    }\n    return base.toString();\n  }\n\n  private String describe(@Nullable Object o) {\n    StringBuilder base = new StringBuilder();\n    if (o != null) {\n      base.append(o)\n          .append(\" \")\n          .append(o.getClass().getName())\n          .append(\" \")\n          .append(o.getClass().getClassLoader().getName());\n    } else {\n      base.append(\"<null>\");\n    }\n    return base.toString();\n  }\n\n  public @Nullable ReflectiveInstance field(String name)\n      throws NoSuchFieldException, IllegalAccessException {\n    Object result = theClass.getField(name).get(instance);\n    return asInstance(result);\n  }\n\n  private @Nullable ReflectiveInstance asInstance(@Nullable Object result) {\n    return result != null ? new ReflectiveInstance(result, classLoader) : null;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/LazyTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.wiremock.url.Lazy.lazy;\n\nimport java.util.concurrent.atomic.AtomicInteger;\nimport org.junit.jupiter.api.Test;\n\nclass LazyTests {\n\n  @Test\n  void returns_pre_computed_value_when_provided() {\n    var memoised =\n        lazy(\n            \"pre-computed\",\n            () -> {\n              throw new AssertionError(\"should not be called\");\n            });\n\n    assertThat(memoised.get()).isEqualTo(\"pre-computed\");\n  }\n\n  @Test\n  void computes_value_when_not_provided() {\n    var memoised = lazy(null, () -> \"computed\");\n\n    assertThat(memoised.get()).isEqualTo(\"computed\");\n  }\n\n  @Test\n  void memoises_result_and_only_calls_toStringWork_once() {\n    var callCount = new AtomicInteger(0);\n\n    var memoised =\n        lazy(\n            null,\n            () -> {\n              callCount.incrementAndGet();\n              return \"computed\";\n            });\n\n    var result1 = memoised.get();\n    var result2 = memoised.get();\n    var result3 = memoised.get();\n\n    assertThat(result1).isEqualTo(\"computed\");\n    assertThat(result2).isEqualTo(\"computed\");\n    assertThat(result3).isEqualTo(\"computed\");\n    assertThat(callCount.get()).isEqualTo(1);\n  }\n\n  @Test\n  void does_not_call_toStringWork_when_value_provided() {\n    var callCount = new AtomicInteger(0);\n\n    var memoised =\n        lazy(\n            \"pre-computed\",\n            () -> {\n              callCount.incrementAndGet();\n              return \"computed\";\n            });\n\n    memoised.get();\n    memoised.get();\n\n    assertThat(callCount.get()).isEqualTo(0);\n  }\n\n  @Test\n  void returns_same_instance_on_subsequent_calls() {\n    var memoised = lazy(null, () -> \"computed\");\n\n    var result1 = memoised.get();\n    var result2 = memoised.get();\n\n    assertThat(result1).isSameAs(result2);\n  }\n\n  @Test\n  void handles_empty_string_as_pre_computed_value() {\n    var memoised =\n        lazy(\n            \"\",\n            () -> {\n              throw new AssertionError(\"should not be called\");\n            });\n\n    assertThat(memoised.get()).isEmpty();\n  }\n\n  @Test\n  void computes_empty_string_when_work_returns_empty() {\n    var memoised = lazy(null, () -> \"\");\n\n    assertThat(memoised.get()).isEmpty();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/MemoisedNormalisableTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport java.util.concurrent.atomic.AtomicInteger;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\n\nclass MemoisedNormalisableTests {\n\n  @Nested\n  class Normalise {\n\n    @Test\n    void returns_original_when_known_to_be_normal_form() {\n      var original = new TestNormalisable(\"value\");\n      var normalised = new TestNormalisable(\"normalised\");\n\n      var memoised = new MemoisedNormalisable<>(original, true, () -> false, () -> normalised);\n\n      assertThat(memoised.normalise()).isSameAs(original);\n    }\n\n    @Test\n    void returns_normalised_when_normalisation_work_returns_new_instance() {\n      var original = new TestNormalisable(\"value\");\n      var normalised = new TestNormalisable(\"normalised\");\n\n      var memoised = new MemoisedNormalisable<>(original, null, () -> false, () -> normalised);\n\n      assertThat(memoised.normalise()).isSameAs(normalised);\n    }\n\n    @Test\n    void returns_original_when_normalisation_work_returns_null() {\n      var original = new TestNormalisable(\"value\");\n\n      var memoised = new MemoisedNormalisable<>(original, null, () -> true, () -> null);\n\n      assertThat(memoised.normalise()).isSameAs(original);\n    }\n\n    @Test\n    void memoises_result_and_only_calls_normalisation_work_once() {\n      var original = new TestNormalisable(\"value\");\n      var normalised = new TestNormalisable(\"normalised\");\n      var callCount = new AtomicInteger(0);\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              null,\n              () -> false,\n              () -> {\n                callCount.incrementAndGet();\n                return normalised;\n              });\n\n      var result1 = memoised.normalise();\n      var result2 = memoised.normalise();\n      var result3 = memoised.normalise();\n\n      assertThat(result1).isSameAs(normalised);\n      assertThat(result2).isSameAs(normalised);\n      assertThat(result3).isSameAs(normalised);\n      assertThat(callCount.get()).isEqualTo(1);\n    }\n\n    @Test\n    void sets_isNormalForm_to_true_when_normalisation_returns_null() {\n      var original = new TestNormalisable(\"value\");\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              null,\n              () -> {\n                throw new AssertionError(\"should not be called\");\n              },\n              () -> null);\n\n      memoised.normalise();\n\n      assertThat(memoised.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void sets_isNormalForm_to_false_when_normalisation_returns_new_instance() {\n      var original = new TestNormalisable(\"value\");\n      var normalised = new TestNormalisable(\"normalised\");\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              null,\n              () -> {\n                throw new AssertionError(\"should not be called\");\n              },\n              () -> normalised);\n\n      memoised.normalise();\n\n      assertThat(memoised.isNormalForm()).isFalse();\n    }\n  }\n\n  @Nested\n  class IsNormalForm {\n\n    @Test\n    void returns_true_when_known_to_be_normal_form() {\n      var original = new TestNormalisable(\"value\");\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              true,\n              () -> {\n                throw new AssertionError(\"should not be called\");\n              },\n              () -> null);\n\n      assertThat(memoised.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void returns_false_when_known_to_not_be_normal_form() {\n      var original = new TestNormalisable(\"value\");\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              false,\n              () -> {\n                throw new AssertionError(\"should not be called\");\n              },\n              () -> null);\n\n      assertThat(memoised.isNormalForm()).isFalse();\n    }\n\n    @Test\n    void calls_isNormalFormWork_when_unknown_and_returns_result() {\n      var original = new TestNormalisable(\"value\");\n\n      var memoisedTrue = new MemoisedNormalisable<>(original, null, () -> true, () -> null);\n\n      var memoisedFalse = new MemoisedNormalisable<>(original, null, () -> false, () -> null);\n\n      assertThat(memoisedTrue.isNormalForm()).isTrue();\n      assertThat(memoisedFalse.isNormalForm()).isFalse();\n    }\n\n    @Test\n    void memoises_result_and_only_calls_isNormalFormWork_once() {\n      var original = new TestNormalisable(\"value\");\n      var callCount = new AtomicInteger(0);\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              null,\n              () -> {\n                callCount.incrementAndGet();\n                return true;\n              },\n              () -> null);\n\n      var result1 = memoised.isNormalForm();\n      var result2 = memoised.isNormalForm();\n      var result3 = memoised.isNormalForm();\n\n      assertThat(result1).isTrue();\n      assertThat(result2).isTrue();\n      assertThat(result3).isTrue();\n      assertThat(callCount.get()).isEqualTo(1);\n    }\n\n    @Test\n    void populates_normalised_with_original_when_isNormalFormWork_returns_true() {\n      var original = new TestNormalisable(\"value\");\n      var normalisationCallCount = new AtomicInteger(0);\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              null,\n              () -> true,\n              () -> {\n                normalisationCallCount.incrementAndGet();\n                return new TestNormalisable(\"should not be used\");\n              });\n\n      // First check isNormalForm\n      assertThat(memoised.isNormalForm()).isTrue();\n\n      // Then normalise should return original without calling normalisation work\n      assertThat(memoised.normalise()).isSameAs(original);\n      assertThat(normalisationCallCount.get()).isEqualTo(0);\n    }\n  }\n\n  @Nested\n  class CrossMethodInteraction {\n\n    @Test\n    void normalise_first_then_isNormalForm_does_not_call_isNormalFormWork() {\n      var original = new TestNormalisable(\"value\");\n      var normalised = new TestNormalisable(\"normalised\");\n      var isNormalFormWorkCallCount = new AtomicInteger(0);\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              null,\n              () -> {\n                isNormalFormWorkCallCount.incrementAndGet();\n                return false;\n              },\n              () -> normalised);\n\n      // Normalise first\n      memoised.normalise();\n\n      // isNormalForm should not call isNormalFormWork\n      assertThat(memoised.isNormalForm()).isFalse();\n      assertThat(isNormalFormWorkCallCount.get()).isEqualTo(0);\n    }\n\n    @Test\n    void isNormalForm_true_first_then_normalise_does_not_call_normalisationWork() {\n      var original = new TestNormalisable(\"value\");\n      var normalisationWorkCallCount = new AtomicInteger(0);\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              null,\n              () -> true,\n              () -> {\n                normalisationWorkCallCount.incrementAndGet();\n                return new TestNormalisable(\"should not be used\");\n              });\n\n      // isNormalForm first\n      assertThat(memoised.isNormalForm()).isTrue();\n\n      // normalise should return original without calling normalisation work\n      assertThat(memoised.normalise()).isSameAs(original);\n      assertThat(normalisationWorkCallCount.get()).isEqualTo(0);\n    }\n\n    @Test\n    void isNormalForm_false_first_then_normalise_still_calls_normalisationWork() {\n      var original = new TestNormalisable(\"value\");\n      var normalised = new TestNormalisable(\"normalised\");\n      var normalisationWorkCallCount = new AtomicInteger(0);\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              null,\n              () -> false,\n              () -> {\n                normalisationWorkCallCount.incrementAndGet();\n                return normalised;\n              });\n\n      // isNormalForm first\n      assertThat(memoised.isNormalForm()).isFalse();\n\n      // normalise should still call normalisation work since we don't know the normalised value\n      assertThat(memoised.normalise()).isSameAs(normalised);\n      assertThat(normalisationWorkCallCount.get()).isEqualTo(1);\n    }\n  }\n\n  @Nested\n  class ConstructorWithoutIsNormalForm {\n\n    @Test\n    void uses_null_for_isNormalForm() {\n      var original = new TestNormalisable(\"value\");\n      var isNormalFormWorkCallCount = new AtomicInteger(0);\n\n      var memoised =\n          new MemoisedNormalisable<>(\n              original,\n              () -> {\n                isNormalFormWorkCallCount.incrementAndGet();\n                return true;\n              },\n              () -> null);\n\n      // Should call isNormalFormWork since isNormalForm was not provided\n      assertThat(memoised.isNormalForm()).isTrue();\n      assertThat(isNormalFormWorkCallCount.get()).isEqualTo(1);\n    }\n  }\n\n  /** A simple test implementation of Normalisable for testing purposes. */\n  private static class TestNormalisable implements Normalisable<TestNormalisable> {\n    private final String value;\n\n    TestNormalisable(String value) {\n      this.value = value;\n    }\n\n    @Override\n    public TestNormalisable normalise() {\n      return this;\n    }\n\n    @Override\n    public boolean isNormalForm() {\n      return true;\n    }\n\n    @Override\n    public String toString() {\n      return value;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/NormalisableInvariantTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.jupiter.api.DynamicTest.dynamicTest;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.DynamicTest;\n\npublic class NormalisableInvariantTests {\n\n  public static <T extends Normalisable<T>> Stream<DynamicTest> generateNormalisedInvariantTests(\n      Collection<? extends T> normalForms) {\n    List<DynamicTest> tests = new ArrayList<>();\n\n    for (Normalisable<T> normalForm : normalForms) {\n      tests.add(\n          dynamicTest(\n              \"Already normal : `\" + normalForm + \"` is in normal form\",\n              () -> {\n                assertThat(normalForm.isNormalForm()).describedAs(normalForm.toString()).isTrue();\n\n                var normalised = normalForm.normalise();\n                assertThat(normalised.isNormalForm()).describedAs(normalised.toString()).isTrue();\n                assertThat(normalised).isEqualTo(normalForm);\n              }));\n    }\n    return tests.stream();\n  }\n\n  public record NormalisationCase<T extends Normalisable<T>>(T notNormal, T normalForm) {}\n\n  public static <T extends Normalisable<T>> Stream<DynamicTest> generateNotNormalisedInvariantTests(\n      List<NormalisationCase<T>> testCases) {\n    List<DynamicTest> tests = new ArrayList<>();\n\n    for (NormalisationCase<T> testCase : testCases) {\n      T notNormal = testCase.notNormal;\n      T normalForm = testCase.normalForm;\n      tests.add(\n          dynamicTest(\n              \"non-normal : `\" + notNormal + \"` is not normal form\",\n              () -> {\n                assertThat(notNormal.isNormalForm()).describedAs(notNormal.toString()).isFalse();\n              }));\n      tests.add(\n          dynamicTest(\n              \"normal : `\" + normalForm + \"` is in normal form\",\n              () -> {\n                assertThat(normalForm.isNormalForm()).describedAs(normalForm.toString()).isTrue();\n              }));\n      tests.add(\n          dynamicTest(\n              \"non-normal : `\" + notNormal + \"` when normalised is not equal to the original\",\n              () -> {\n                var normalised = notNormal.normalise();\n                assertThat(normalised).isNotEqualTo(notNormal);\n              }));\n      tests.add(\n          dynamicTest(\n              \"non-normal : `\" + notNormal + \"` when normalised is in normal form\",\n              () -> {\n                var normalised = notNormal.normalise();\n                assertThat(normalised.isNormalForm()).describedAs(normalised.toString()).isTrue();\n              }));\n      tests.add(\n          dynamicTest(\n              \"Non-normal : `\" + notNormal + \"` normalises to `\" + normalForm + \"`\",\n              () -> {\n                var normalised = notNormal.normalise();\n                assertThat(normalised).isEqualTo(normalForm);\n              }));\n      tests.add(\n          dynamicTest(\n              \"Non-normal : `\" + notNormal + \"` normalised twice is the same as normalised once\",\n              () -> {\n                var normalised = notNormal.normalise();\n                assertThat(normalised.normalise()).isEqualTo(normalised);\n              }));\n    }\n    return tests.stream();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/OpaqueUriTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\nimport static org.wiremock.url.AbsoluteUriTests.Parse.illegalAbsoluteUris;\nimport static org.wiremock.url.Lists.concat;\nimport static org.wiremock.url.SchemeRegistry.file;\nimport static org.wiremock.url.SchemeRegistry.mailto;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\n\nclass OpaqueUriTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void parses_mailto_correctly() {\n      var mailtoUri = OpaqueUri.parse(\"mailto:joan@example.com\");\n\n      assertThat(mailtoUri.toString()).isEqualTo(\"mailto:joan@example.com\");\n      assertThat(mailtoUri).isInstanceOf(OpaqueUri.class);\n\n      assertThat(mailtoUri.getScheme()).isEqualTo(mailto);\n\n      assertThat(mailtoUri.getAuthority()).isNull();\n      assertThat(mailtoUri.getUserInfo()).isNull();\n      assertThat(mailtoUri.getHost()).isNull();\n      assertThat(mailtoUri.getPort()).isNull();\n\n      assertThat(mailtoUri.getPath()).isEqualTo(Path.parse(\"joan@example.com\"));\n      assertThat(mailtoUri.getQuery()).isNull();\n\n      assertThat(mailtoUri.getFragment()).isNull();\n\n      assertThat(mailtoUri.isAbsolute()).isTrue();\n      assertThat(mailtoUri.isRelative()).isFalse();\n      assertThat(mailtoUri.isAbsoluteUrl()).isFalse();\n      assertThat(mailtoUri.isOpaqueUri()).isTrue();\n    }\n\n    @Test\n    void parses_arn_correctly() {\n      var arn =\n          OpaqueUri.parse(\n              \"arn:aws:servicecatalog:us-east-1:912624918755:stack/some-stack/pp-a3B9zXp1mQ7rS\");\n\n      assertThat(arn.toString())\n          .isEqualTo(\n              \"arn:aws:servicecatalog:us-east-1:912624918755:stack/some-stack/pp-a3B9zXp1mQ7rS\");\n      assertThat(arn).isInstanceOf(OpaqueUri.class);\n\n      assertThat(arn.getScheme()).isEqualTo(Scheme.parse(\"arn\"));\n\n      assertThat(arn.getAuthority()).isNull();\n      assertThat(arn.getUserInfo()).isNull();\n      assertThat(arn.getHost()).isNull();\n      assertThat(arn.getPort()).isNull();\n\n      assertThat(arn.getPath())\n          .isEqualTo(\n              Path.parse(\n                  \"aws:servicecatalog:us-east-1:912624918755:stack/some-stack/pp-a3B9zXp1mQ7rS\"));\n      assertThat(arn.getQuery()).isNull();\n\n      assertThat(arn.getFragment()).isNull();\n\n      assertThat(arn.isAbsolute()).isTrue();\n      assertThat(arn.isRelative()).isFalse();\n      assertThat(arn.isAbsoluteUrl()).isFalse();\n      assertThat(arn.isOpaqueUri()).isTrue();\n    }\n\n    @Test\n    void parses_file_no_authority_correctly() {\n      var fileUri = OpaqueUri.parse(\"file:/home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file:/home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(OpaqueUri.class);\n\n      assertThat(fileUri.getScheme()).isEqualTo(file);\n\n      assertThat(fileUri.getAuthority()).isNull();\n      assertThat(fileUri.getUserInfo()).isNull();\n      assertThat(fileUri.getHost()).isNull();\n      assertThat(fileUri.getPort()).isNull();\n\n      assertThat(fileUri.getPath()).isEqualTo(Path.parse(\"/home/me/some/dir\"));\n      assertThat(fileUri.getQuery()).isNull();\n\n      assertThat(fileUri.getFragment()).isNull();\n\n      assertThat(fileUri.isAbsolute()).isTrue();\n      assertThat(fileUri.isRelative()).isFalse();\n      assertThat(fileUri.isAbsoluteUrl()).isFalse();\n      assertThat(fileUri.isOpaqueUri()).isTrue();\n    }\n\n    @Test\n    void rejects_illegal_uri() {\n      IllegalUri exception =\n          assertThatExceptionOfType(IllegalUri.class)\n              .isThrownBy(() -> OpaqueUri.parse(\"not a :uri\"))\n              .actual();\n      assertThat(exception.getMessage()).isEqualTo(\"Illegal uri: `not a :uri`\");\n      assertThat(exception.getIllegalValue()).isEqualTo(\"not a :uri\");\n\n      IllegalScheme cause =\n          assertThat(exception.getCause()).asInstanceOf(type(IllegalScheme.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\"Illegal scheme `not a `; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n      assertThat(cause.getIllegalValue()).isEqualTo(\"not a \");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    private static final List<? extends String> nonOpaqueUris =\n        concat(\n            illegalAbsoluteUris,\n            List.of(\n                \"https://example.com/path?query#fragment\",\n                \"https://user@example.com/path?query#fragment\",\n                \"https://example.com/path?query\",\n                \"data://:443\",\n                \"https://example.com\",\n                \"file:///home/me/some/dir\",\n                \"file://user@remote/home/me/some/dir\"));\n\n    @ParameterizedTest\n    @FieldSource(\"nonOpaqueUris\")\n    void rejects_illegal_opaque_uris(String nonOpaqueUri) {\n      assertThatExceptionOfType(IllegalOpaqueUri.class)\n          .isThrownBy(() -> OpaqueUri.parse(nonOpaqueUri))\n          .withMessage(\"Illegal opaque uri: `\" + nonOpaqueUri + \"`\")\n          .withNoCause()\n          .extracting(IllegalOpaqueUri::getIllegalValue)\n          .isEqualTo(nonOpaqueUri);\n    }\n  }\n\n  @Nested\n  class Resolve {\n\n    @Test\n    void resolvesOpaqueUriAgainstInput() {\n      var opaqueUri = OpaqueUri.parse(\"non-spec:/..//p\");\n      assertThat(opaqueUri.resolve(Uri.parse(\"\"))).isEqualTo(OpaqueUri.parse(\"non-spec:/p\"));\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    @Test\n    void normalisesOpaqueUri() {\n      var opaqueUri = OpaqueUri.parse(\"non-spec:/..//p\");\n      assertThat(opaqueUri.normalise()).isEqualTo(OpaqueUri.parse(\"non-spec:/p\"));\n    }\n\n    @Test\n    void resolve_empty_path_with_query() {\n      var opaqueUri = OpaqueUri.parse(\"file:/foo?t\");\n      var resolved = opaqueUri.resolve(RelativeUrl.parse(\"?r\"));\n      assertThat(resolved).hasToString(\"file:/foo?r\");\n    }\n\n    @Test\n    void resolve_empty_path_no_query() {\n      var opaqueUri = OpaqueUri.parse(\"file:/foo?t\");\n      var resolved = opaqueUri.resolve(RelativeUrl.parse(\"\"));\n      assertThat(resolved).hasToString(\"file:/foo?t\");\n    }\n\n    @Test\n    void resolve_absolute_path_with_query() {\n      var opaqueUri = OpaqueUri.parse(\"file:/foo?t\");\n      var resolved = opaqueUri.resolve(RelativeUrl.parse(\"/new?r\"));\n      assertThat(resolved).hasToString(\"file:/new?r\");\n    }\n\n    @Test\n    void resolve_absolute_path_no_query() {\n      var opaqueUri = OpaqueUri.parse(\"file:/foo?t\");\n      var resolved = opaqueUri.resolve(RelativeUrl.parse(\"/new\"));\n      assertThat(resolved).hasToString(\"file:/new\");\n    }\n\n    private static final List<ResolveCase> resolveCases =\n        List.of(\n            resolveCase(\"\", \"bar\", \"bar\"),\n            resolveCase(\"\", \"bar/\", \"bar/\"),\n            resolveCase(\"foo\", \"bar\", \"bar\"),\n            resolveCase(\"foo\", \"bar/\", \"bar/\"),\n            resolveCase(\"foo/\", \"bar\", \"foo/bar\"),\n            resolveCase(\"foo/\", \"bar/\", \"foo/bar/\"),\n            resolveCase(\"/\", \"bar\", \"/bar\"),\n            resolveCase(\"/\", \"bar/\", \"/bar/\"),\n            resolveCase(\"/foo\", \"bar\", \"/bar\"),\n            resolveCase(\"/foo\", \"bar/\", \"/bar/\"),\n            resolveCase(\"/foo/\", \"bar\", \"/foo/bar\"),\n            resolveCase(\"/foo/\", \"bar/\", \"/foo/bar/\"));\n\n    @ParameterizedTest\n    @FieldSource(\"resolveCases\")\n    void resolve_relative_path(ResolveCase resolveCase) {\n      var opaqueUri = OpaqueUri.parse(\"opaque:\" + resolveCase.initialPath + \"?t\");\n      var resolved = opaqueUri.resolve(RelativeUrl.parse(resolveCase.relativePath + \"?r\"));\n      assertThat(resolved).hasToString(\"opaque:\" + resolveCase.expectedPath + \"?r\");\n    }\n\n    static ResolveCase resolveCase(String initialPath, String relativePath, String expectedPath) {\n      return new ResolveCase(initialPath, relativePath, expectedPath);\n    }\n\n    record ResolveCase(String initialPath, String relativePath, String expectedPath) {}\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/OriginTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\nimport static org.wiremock.url.Lists.concat;\nimport static org.wiremock.url.SchemeRegistry.http;\nimport static org.wiremock.url.ServersideAbsoluteUrlTests.Parse.illegalServersideAbsoluteUrls;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\npublic class OriginTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void parses_origin_correctly() {\n      var origin = Origin.parse(\"http://example.com\");\n\n      assertThat(origin.getScheme()).isEqualTo(http);\n\n      assertThat(origin.getAuthority()).isEqualTo(HostAndPort.parse(\"example.com\"));\n      assertThat(origin.getUserInfo()).isNull();\n      assertThat(origin.getHost()).isEqualTo(Host.parse(\"example.com\"));\n      assertThat(origin.getPort()).isNull();\n\n      assertThat(origin.getPathAndQuery()).isEqualTo(PathAndQuery.EMPTY);\n      assertThat(origin.getPath()).isEqualTo(Path.EMPTY);\n      assertThat(origin.getQuery()).isNull();\n\n      assertThat(origin.getFragment()).isNull();\n\n      assertThat(origin.toString()).isEqualTo(\"http://example.com\");\n\n      assertThat(origin.isAbsolute()).isTrue();\n      assertThat(origin.isRelative()).isFalse();\n      assertThat(origin.isAbsoluteUrl()).isTrue();\n      assertThat(origin.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void rejects_illegal_uri() {\n      IllegalUri exception =\n          assertThatExceptionOfType(IllegalUri.class)\n              .isThrownBy(() -> Origin.parse(\"not a :uri\"))\n              .actual();\n      assertThat(exception.getMessage()).isEqualTo(\"Illegal uri: `not a :uri`\");\n      assertThat(exception.getIllegalValue()).isEqualTo(\"not a :uri\");\n\n      IllegalScheme cause =\n          assertThat(exception.getCause()).asInstanceOf(type(IllegalScheme.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\"Illegal scheme `not a `; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n      assertThat(cause.getIllegalValue()).isEqualTo(\"not a \");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    static final List<? extends String> illegalOrigins =\n        concat(\n            illegalServersideAbsoluteUrls,\n            List.of(\n                \"http://example.com/\",\n                \"http://example.com/?\",\n                \"http://example.com?\",\n                \"http://example.com/\",\n                \"http://example.com/?\"));\n\n    @ParameterizedTest\n    @FieldSource(\"illegalOrigins\")\n    void rejects_illegal_origin(String illegalOrigin) {\n      assertThatExceptionOfType(IllegalOrigin.class)\n          .isThrownBy(() -> Origin.parse(illegalOrigin))\n          .withMessage(\"Illegal origin: `\" + illegalOrigin + \"`\")\n          .extracting(IllegalOrigin::getIllegalValue)\n          .isEqualTo(illegalOrigin);\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<AbsoluteUri>> normalisationCases =\n        Stream.of(\n                Pair.of(\"http://example.com\", \"http://example.com/\"),\n                Pair.of(\"http://example.com:8080\", \"http://example.com:8080/\"))\n            .map(\n                it ->\n                    new NormalisationCase<>(\n                        Origin.parse(it.getLeft()), AbsoluteUrl.parse(it.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_uri_reference_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(\n          normalisationCases.stream().filter(t -> !t.normalForm().equals(t.notNormal())).toList());\n    }\n\n    static final List<AbsoluteUri> alreadyNormalisedUrlReferences =\n        normalisationCases.stream().map(NormalisationCase::normalForm).distinct().toList();\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedUrlReferences);\n    }\n  }\n\n  @Nested\n  class Of {\n\n    @Test\n    void of_builds_origin_from_valid_parameters_no_port() {\n      assertThat(Origin.of(http, HostAndPort.parse(\"example.com\")))\n          .isEqualTo(Origin.parse(\"http://example.com\"));\n    }\n\n    @Test\n    void of_builds_origin_from_valid_parameters_with_port() {\n      assertThat(Origin.of(http, HostAndPort.parse(\"example.com:8080\")))\n          .isEqualTo(Origin.parse(\"http://example.com:8080\"));\n    }\n\n    @Test\n    void of_rejects_non_normal_scheme() {\n      assertThatExceptionOfType(IllegalOrigin.class)\n          .isThrownBy(() -> Origin.of(Scheme.parse(\"HTTP\"), HostAndPort.parse(\"example.com\")))\n          .withMessage(\"Illegal origin: `HTTP://example.com`\")\n          .withNoCause();\n    }\n\n    @Test\n    void of_rejects_non_normal_host() {\n      assertThatExceptionOfType(IllegalOrigin.class)\n          .isThrownBy(() -> Origin.of(http, HostAndPort.parse(\"EXAMPLE.com\")))\n          .withMessage(\"Illegal origin: `http://EXAMPLE.com`\")\n          .withNoCause();\n    }\n\n    @Test\n    void of_rejects_non_normal_port() {\n      assertThatExceptionOfType(IllegalOrigin.class)\n          .isThrownBy(() -> Origin.of(http, HostAndPort.parse(\"example.com:80\")))\n          .withMessage(\"Illegal origin: `http://example.com:80`\")\n          .withNoCause();\n    }\n  }\n\n  @Nested\n  class Resolve {\n\n    @Test\n    void resolves_a_relative_path() {\n      var resolved = Origin.parse(\"https://example.com\").resolve(Path.parse(\"relative/path\"));\n      assertThat(resolved).isEqualTo(AbsoluteUrl.parse(\"https://example.com/relative/path\"));\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/PasswordTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\n\nclass PasswordTests {\n\n  @Nested\n  class Parse {\n\n    static final List<String> validPasswords =\n        List.of(\n            // Empty password\n            \"\",\n\n            // Simple passwords\n            \"password\",\n            \"secret\",\n            \"pass123\",\n            \"MyPassw0rd\",\n\n            // Unreserved characters (alphanumeric, hyphen, period, underscore, tilde)\n            \"pass-word\",\n            \"pass.word\",\n            \"pass_word\",\n            \"pass~word\",\n            \"Pass123\",\n            \"test-pass_123.word~test\",\n\n            // Sub-delimiters (!$&'()*+,;=)\n            \"pass!word\",\n            \"pass$word\",\n            \"pass&word\",\n            \"pass'word\",\n            \"pass(word)\",\n            \"pass*word\",\n            \"pass+word\",\n            \"pass,word\",\n            \"pass;word\",\n            \"pass=word\",\n\n            // Colons (allowed in passwords)\n            \"pass:word\",\n            \":::\",\n            \"time:12:30\",\n\n            // Percent-encoded characters\n            \"%20\", // space\n            \"pass%20word\", // pass word\n            \"pass%40example\", // pass@example\n            \"%C3%A9\", // é\n            \"caf%C3%A9\", // café\n            \"pass%2Fword\", // pass/word\n\n            // Complex combinations\n            \"Passw0rd!123\",\n            \"pass%20word\",\n            \"secret_456\",\n            \"test+pass\",\n            \"my:secret:key\");\n\n    @ParameterizedTest\n    @FieldSource(\"validPasswords\")\n    void parses_valid_passwords(String passwordString) {\n      Password password = Password.parse(passwordString);\n      assertThat(password.toString()).isEqualTo(passwordString);\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"pass word\", // unencoded space\n          \"pass@word\", // @ not allowed (must be percent-encoded)\n          \"pass#word\", // # not allowed\n          \"pass/word\", // / not allowed\n          \"pass?word\", // ? not allowed\n          \"pass[word]\", // brackets not allowed\n          \"pass<word>\", // angle brackets not allowed\n          \"pass\\\\word\", // backslash not allowed\n          \"pass|word\", // pipe not allowed\n          \"pass\\\"word\", // quote not allowed\n          \"%\", // incomplete encoding\n          \"%2\", // incomplete encoding\n          \"%GG\", // invalid hex\n          \"pass%ZZword\" // invalid hex\n        })\n    void rejects_illegal_password(String illegalPassword) {\n      assertThatExceptionOfType(IllegalPassword.class)\n          .isThrownBy(() -> Password.parse(illegalPassword))\n          .withMessage(\"Illegal password: `\" + illegalPassword + \"`\")\n          .extracting(IllegalPassword::getIllegalValue)\n          .isEqualTo(illegalPassword);\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    record DecodeCase(String input, String expected) {}\n\n    static final List<String> passwordsWithoutPercentEncoding =\n        List.of(\"\", \"password\", \"secret\", \"pass-word\", \"pass.word\", \"Pass123\", \"pass:word\");\n\n    static final List<DecodeCase> decodeCases =\n        List.of(\n            new DecodeCase(\"pass%20word\", \"pass word\"),\n            new DecodeCase(\"%C3%A9\", \"é\"),\n            new DecodeCase(\"caf%C3%A9\", \"café\"),\n            new DecodeCase(\"pass%40example\", \"pass@example\"),\n            new DecodeCase(\"pass%2Fword\", \"pass/word\"),\n            new DecodeCase(\"%20\", \" \"),\n            new DecodeCase(\"hello%20world\", \"hello world\"),\n            new DecodeCase(\"test%3Apass\", \"test:pass\"));\n\n    @ParameterizedTest\n    @FieldSource(\"passwordsWithoutPercentEncoding\")\n    void returns_same_string_for_password_without_percent_encoding(String passwordString) {\n      Password password = Password.parse(passwordString);\n      assertThat(password.decode()).isEqualTo(passwordString);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"decodeCases\")\n    void decodes_percent_encoded_password_correctly(DecodeCase testCase) {\n      Password password = Password.parse(testCase.input());\n      assertThat(password.decode()).isEqualTo(testCase.expected());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      return generateEncodeDecodeInvariantTests(\n          PasswordParser.INSTANCE,\n          Stream.of(\"foo\", \"bar\", \"test123\", \"hello world\", \"user@example\", \"café\", \"こんにちは\"));\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    @Test\n    void passwords_with_same_value_are_equal() {\n      Password password1 = Password.parse(\"secret\");\n      Password password2 = Password.parse(\"secret\");\n      assertThat(password1).isEqualTo(password2);\n    }\n\n    @Test\n    void passwords_with_different_values_are_not_equal() {\n      Password password1 = Password.parse(\"secret1\");\n      Password password2 = Password.parse(\"secret2\");\n      assertThat(password1).isNotEqualTo(password2);\n    }\n\n    @Test\n    void passwords_with_different_case_are_not_equal() {\n      Password password1 = Password.parse(\"secret\");\n      Password password2 = Password.parse(\"SECRET\");\n      assertThat(password1).isNotEqualTo(password2);\n    }\n\n    @Test\n    void password_is_equal_to_itself() {\n      Password password = Password.parse(\"secret\");\n      assertThat(password).isEqualTo(password);\n    }\n\n    @Test\n    void password_is_not_equal_to_null() {\n      Password password = Password.parse(\"secret\");\n      assertThat(password).isNotEqualTo(null);\n    }\n\n    @Test\n    @SuppressWarnings(\"AssertBetweenInconvertibleTypes\")\n    void password_is_not_equal_to_different_type() {\n      Password password = Password.parse(\"secret\");\n      assertThat(password).isNotEqualTo(\"secret\");\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void equal_passwords_have_same_hash_code() {\n      Password password1 = Password.parse(\"secret\");\n      Password password2 = Password.parse(\"secret\");\n      assertThat(password1.hashCode()).isEqualTo(password2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      Password password = Password.parse(\"MyPassw0rd!123\");\n      int hashCode1 = password.hashCode();\n      int hashCode2 = password.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class ToStringMethod {\n\n    @Test\n    void to_string_returns_original_password() {\n      String passwordString = \"pass-word\";\n      Password password = Password.parse(passwordString);\n      assertThat(password.toString()).isEqualTo(passwordString);\n    }\n\n    @Test\n    void to_string_preserves_case() {\n      String passwordString = \"PassWord\";\n      Password password = Password.parse(passwordString);\n      assertThat(password.toString()).isEqualTo(passwordString);\n    }\n\n    @Test\n    void to_string_preserves_percent_encoding() {\n      String encoded = \"pass%20word\";\n      Password password = Password.parse(encoded);\n      assertThat(password.toString()).isEqualTo(encoded);\n    }\n\n    @Test\n    void to_string_result_can_be_parsed_back() {\n      Password original = Password.parse(\"pass.word\");\n      String stringForm = original.toString();\n      Password parsed = Password.parse(stringForm);\n      assertThat(parsed).isEqualTo(original);\n      assertThat(parsed.toString()).isEqualTo(stringForm);\n    }\n  }\n\n  @TestFactory\n  Stream<DynamicTest> invariants() {\n    return StringParserInvariantTests.generateInvariantTests(\n        PasswordParser.INSTANCE, Parse.validPasswords);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/PathAndQueryTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\nimport static org.wiremock.url.Lists.concat;\nimport static org.wiremock.url.RelativeUrlTests.Parse.illegalRelativeUrls;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\n\nclass PathAndQueryTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void parses_path_and_query_correctly() {\n      var pathAndQuery = PathAndQuery.parse(\"/path?query\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"/path?query\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n\n      assertThat(pathAndQuery.getScheme()).isNull();\n\n      assertThat(pathAndQuery.getAuthority()).isNull();\n      assertThat(pathAndQuery.getUserInfo()).isNull();\n      assertThat(pathAndQuery.getHost()).isNull();\n      assertThat(pathAndQuery.getPort()).isNull();\n\n      assertThat(pathAndQuery.getPath()).isEqualTo(Path.parse(\"/path\"));\n      assertThat(pathAndQuery.getQuery()).isEqualTo(Query.parse(\"query\"));\n\n      assertThat(pathAndQuery.getFragment()).isNull();\n\n      assertThat(pathAndQuery.isAbsolute()).isFalse();\n      assertThat(pathAndQuery.isRelative()).isTrue();\n      assertThat(pathAndQuery.isAbsoluteUrl()).isFalse();\n      assertThat(pathAndQuery.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void parses_path_with_double_slash_correctly() {\n      var pathAndQuery = PathAndQuery.parse(\"//relative\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"//relative\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n\n      assertThat(pathAndQuery.getScheme()).isNull();\n\n      assertThat(pathAndQuery.getAuthority()).isNull();\n      assertThat(pathAndQuery.getUserInfo()).isNull();\n      assertThat(pathAndQuery.getHost()).isNull();\n      assertThat(pathAndQuery.getPort()).isNull();\n\n      assertThat(pathAndQuery.getPath()).isEqualTo(Path.parse(\"//relative\"));\n      assertThat(pathAndQuery.getQuery()).isNull();\n\n      assertThat(pathAndQuery.getFragment()).isNull();\n\n      assertThat(pathAndQuery.isAbsolute()).isFalse();\n      assertThat(pathAndQuery.isRelative()).isTrue();\n      assertThat(pathAndQuery.isAbsoluteUrl()).isFalse();\n      assertThat(pathAndQuery.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void parses_empty_path_correctly() {\n      var pathAndQuery = PathAndQuery.parse(\"\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n\n      assertThat(pathAndQuery.getScheme()).isNull();\n\n      assertThat(pathAndQuery.getAuthority()).isNull();\n      assertThat(pathAndQuery.getUserInfo()).isNull();\n      assertThat(pathAndQuery.getHost()).isNull();\n      assertThat(pathAndQuery.getPort()).isNull();\n\n      assertThat(pathAndQuery.getPath()).isEqualTo(Path.EMPTY);\n      assertThat(pathAndQuery.getQuery()).isNull();\n\n      assertThat(pathAndQuery.getFragment()).isNull();\n\n      assertThat(pathAndQuery.isAbsolute()).isFalse();\n      assertThat(pathAndQuery.isRelative()).isTrue();\n      assertThat(pathAndQuery.isAbsoluteUrl()).isFalse();\n      assertThat(pathAndQuery.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void parses_query_only_correctly() {\n      var pathAndQuery = PathAndQuery.parse(\"?\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"?\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n\n      assertThat(pathAndQuery.getScheme()).isNull();\n\n      assertThat(pathAndQuery.getAuthority()).isNull();\n      assertThat(pathAndQuery.getUserInfo()).isNull();\n      assertThat(pathAndQuery.getHost()).isNull();\n      assertThat(pathAndQuery.getPort()).isNull();\n\n      assertThat(pathAndQuery.getPath()).isEqualTo(Path.EMPTY);\n      assertThat(pathAndQuery.getQuery()).isEqualTo(Query.parse(\"\"));\n\n      assertThat(pathAndQuery.getFragment()).isNull();\n\n      assertThat(pathAndQuery.isAbsolute()).isFalse();\n      assertThat(pathAndQuery.isRelative()).isTrue();\n      assertThat(pathAndQuery.isAbsoluteUrl()).isFalse();\n      assertThat(pathAndQuery.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void rejects_illegal_path_and_query() {\n      assertThatExceptionOfType(IllegalUri.class)\n          .isThrownBy(() -> PathAndQuery.parse(\"not a :uri\"))\n          .withMessage(\"Illegal path and query: `not a :uri`\")\n          .withNoCause();\n    }\n\n    static final List<? extends String> illegalPathAndQueries =\n        concat(\n            illegalRelativeUrls,\n            List.of(\n                \"relative\",\n                \"//example.com/path?query#fragment\",\n                \"/path?query#fragment\",\n                \"/path#fragment\",\n                \"?query#fragment\",\n                \"?#fragment\",\n                \"?#\",\n                \"#fragment\",\n                \"#\"));\n\n    @ParameterizedTest\n    @FieldSource(\"illegalPathAndQueries\")\n    void rejects_illegal_path_and_query(String illegalPathAndQuery) {\n      assertThatExceptionOfType(IllegalPathAndQuery.class)\n          .isThrownBy(() -> PathAndQuery.parse(illegalPathAndQuery))\n          .withMessage(\"Illegal path and query: `\" + illegalPathAndQuery + \"`\")\n          .extracting(IllegalPathAndQuery::getIllegalValue)\n          .isEqualTo(illegalPathAndQuery);\n    }\n  }\n\n  @Nested\n  class Transform {\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"/path?query\",\n          \"/path\",\n        })\n    void cannot_set_path_with_colon_in_first_segment_when_no_authority(String relativeUrl) {\n      PathAndQuery pathAndQuery = PathAndQuery.parse(relativeUrl);\n      var query = pathAndQuery.transform(it -> it.setPath(Path.EMPTY)).toString();\n      assertThatExceptionOfType(IllegalRelativeUrl.class)\n          .isThrownBy(() -> pathAndQuery.transform(it -> it.setPath(Path.parse(\"foo:bar\"))))\n          .withMessage(\n              \"Illegal relative url: `foo:bar\"\n                  + query\n                  + \"` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\")\n          .extracting(IllegalRelativeUrl::getIllegalValue)\n          .isEqualTo(\"foo:bar\" + query);\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"//\", \"///\", \"//foo\", \"//foo/\", \"///foo/\",\n        })\n    void can_set_path_with_double_slash_when_no_authority(String legalPath) {\n      PathAndQuery original = PathAndQuery.parse(\"/path?query\");\n      Url transformed = original.transform(it -> it.setPath(Path.parse(legalPath)));\n      PathAndQuery transfo =\n          assertThat(transformed).asInstanceOf(type(PathAndQuery.class)).actual();\n      assertThat(transfo.toString()).isEqualTo(legalPath + \"?query\");\n      assertThat(transfo.getPath().toString()).isEqualTo(legalPath);\n      assertThat(transfo.getQuery()).hasToString(\"query\");\n    }\n  }\n\n  @Nested\n  class Of {\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"//\", \"///\", \"//foo\", \"//foo/\", \"///foo/\", \"\", \"/\", \"/foo\",\n        })\n    void can_set_path_with_double_slash_when_no_authority(String legalPath) {\n      PathAndQuery pathAndQuery = PathAndQuery.of(Path.parse(legalPath));\n      assertThat(pathAndQuery.toString()).isEqualTo(legalPath);\n      assertThat(pathAndQuery.getPath().toString()).isEqualTo(legalPath);\n      assertThat(pathAndQuery.getQuery()).isNull();\n    }\n  }\n\n  @Test\n  void path_and_query_may_not_be_equal_to_relative_url_with_same_string_representation() {\n\n    var stringForm = \"//example.com/path\";\n\n    PathAndQuery pathAndQuery = PathAndQuery.parse(stringForm);\n    RelativeUrl relativeUrl = RelativeUrl.parse(stringForm);\n\n    assertThat(pathAndQuery).isNotEqualTo(relativeUrl);\n    assertThat(relativeUrl).isNotEqualTo(pathAndQuery);\n\n    var baseUrl = AbsoluteUrl.parse(\"https://www.example.com/other/\");\n\n    assertThat(baseUrl.resolve(pathAndQuery))\n        .isEqualTo(AbsoluteUrl.parse(\"https://www.example.com//example.com/path\"));\n    assertThat(baseUrl.resolve(relativeUrl))\n        .isEqualTo(AbsoluteUrl.parse(\"https://example.com/path\"));\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/PathTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.junit.jupiter.params.provider.Arguments.arguments;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.Arguments;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.MethodSource;\n\npublic class PathTests {\n\n  @Nested\n  class Parse {\n\n    static Stream<String> validPaths() {\n      return Stream.of(\n          // Empty and simple paths\n          \"\",\n          \"/\",\n          \"/path\",\n          \"/path/to/resource\",\n          \"relative/path\",\n          \"relative\",\n\n          // Paths with segments\n          \"/one\",\n          \"/one/two\",\n          \"/one/two/three\",\n          \"one/two/three\",\n\n          // Unreserved characters (alphanumeric, hyphen, period, underscore, tilde)\n          \"/path-name\",\n          \"/path.name\",\n          \"/path_name\",\n          \"/path~name\",\n          \"/Path123\",\n          \"/test-path_123.name~test\",\n\n          // Sub-delimiters (!$&'()*+,;=)\n          \"/path!name\",\n          \"/path$name\",\n          \"/path&name\",\n          \"/path'name\",\n          \"/path(name)\",\n          \"/path*name\",\n          \"/path+name\",\n          \"/path,name\",\n          \"/path;name\",\n          \"/path=name\",\n\n          // Colon and at-sign\n          \"/path:name\",\n          \"/path@name\",\n          \"/user:pass@host\",\n          \"/::\",\n          \"/@@@\",\n\n          // Percent-encoded characters\n          \"/%20\", // space\n          \"/path%20name\", // path name\n          \"/path%2Fname\", // path/name (encoded slash)\n          \"/%C3%A9\", // é\n          \"/caf%C3%A9\", // café\n          \"/100%25complete\", // 100%complete\n\n          // Characters allowed by RFC 3986 but often considered special\n          \"/path{brace}\",\n          \"/path[bracket]\",\n          \"/<angle>\",\n          \"/path|pipe\",\n          \"/path\\\\backslash\",\n          \"/path^caret\",\n          \"/path`grave\",\n\n          // Spaces and control characters (permissive parsing)\n          \"/path name\", // unencoded space\n          \"/path\\tname\", // tab\n\n          // Complex combinations\n          \"/api/v1/users\",\n          \"/files/document.pdf\",\n          \"/path/with/many/segments/123\",\n          \"/path%20with%20spaces/and-dashes\",\n          \"/user@example.com:8080/resource\",\n          \"/path!$&'()*+,;=/segment\",\n\n          // Edge cases\n          \"//double//slashes\",\n          \"/trailing/slash/\",\n          \"/./dot\",\n          \"/../dotdot\",\n          \"/single-segment\",\n\n          // Relative paths\n          \".\",\n          \"..\",\n          \"./relative\",\n          \"../parent\",\n          \"../../grandparent\",\n\n          // Invalid percent encoding (still accepted - permissive parser)\n          \"/%\", // incomplete\n          \"/%2\", // incomplete\n          \"/%GG\", // invalid hex\n          \"/path%ZZname\"); // invalid hex\n    }\n\n    @TestFactory\n    Stream<DynamicTest> invariants() {\n      return StringParserInvariantTests.generateInvariantTests(\n          PathParser.INSTANCE, validPaths().toList());\n    }\n\n    static Stream<String> illegalPaths() {\n      return Stream.of(\n          // Query and fragment characters (not delimiters in path context for this parser)\n          \"/path?with?questions\", \"/path#with#hashes\", \"/path#fragment\");\n    }\n\n    @ParameterizedTest\n    @MethodSource(\"illegalPaths\")\n    void rejects_illegal_path(String illegalPath) {\n      assertThatExceptionOfType(IllegalPath.class)\n          .isThrownBy(() -> Path.parse(illegalPath))\n          .withMessage(\"Illegal path: `\" + illegalPath + \"`\")\n          .extracting(IllegalPath::getIllegalValue)\n          .isEqualTo(illegalPath);\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    private static final List<Entry<Path, Path>> normaliseTestCases =\n        List.of(\n            entry(\"\", \"\"),\n            entry(\".\", \"\"),\n            entry(\"..\", \"\"),\n            entry(\"a\", \"a\"),\n            entry(\"/\", \"/\"),\n            entry(\"/%2F/\", \"/%2F/\"),\n            entry(\"/%2f/\", \"/%2F/\"),\n            entry(\"/.\", \"/\"),\n            entry(\"/..\", \"/\"),\n            entry(\"/a\", \"/a\"),\n            entry(\"./\", \"\"),\n            entry(\"../\", \"\"),\n            entry(\"a/\", \"a/\"),\n            entry(\"//\", \"//\"),\n            entry(\"/./\", \"/\"),\n            entry(\"/../\", \"/\"),\n            entry(\"/../../../../\", \"/\"),\n            entry(\"/a/\", \"/a/\"),\n            entry(\"/foo/bar/../ton\", \"/foo/ton\"),\n            entry(\"//a//../..//foo\", \"///foo\"),\n            entry(\"/﻿/foo\", \"/%EF%BB%BF/foo\"),\n            entry(\"/foo%2Â©zbar\", \"/foo%252%C3%82%C2%A9zbar\"),\n            entry(\"/你好你好\", \"/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\"),\n            entry(\"/\\u202e/foo/\\u202d/bar\", \"/%E2%80%AE/foo/%E2%80%AD/bar\"),\n            entry(\"/\\\"quoted\\\"\", \"/%22quoted%22\"),\n            entry(\"/￿y\", \"/%EF%BF%BFy\"),\n            entry(\"/‥/foo\", \"/%E2%80%A5/foo\"),\n            entry(\n                \"/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\",\n                \"/%20!%22$%25&'()*+,-./:;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~\"),\n            entry(\"/�\", \"/%EF%BF%BD\"),\n            entry(\"/foo/../../..\", \"/\"),\n            entry(\"/foo/%2e./%2e%2e/.%2e/%2e.bar\", \"/..bar\"),\n            entry(\"%fF\", \"%FF\"),\n            entry(\"%Ff\", \"%FF\"),\n            entry(\"%41\", \"A\"),\n            entry(\"%5A\", \"Z\"),\n            entry(\"%5a\", \"Z\"),\n            entry(\"/foo/%2e\", \"/foo/\"),\n            entry(\"/foo/.\", \"/foo/\"),\n            entry(\"/./y:\", \"/y:\"),\n            entry(\"/foo/./\", \"/foo/\"),\n            entry(\"/a/../b\", \"/b\"),\n            entry(\"/foo/bar//../..\", \"/foo/\"),\n            entry(\"/aaa/bbb/%2e%2e\", \"/aaa/\"),\n            entry(\"/./Y:\", \"/Y:\"),\n            entry(\"\", \"\"),\n            entry(\"/foo/../../../ton\", \"/ton\"),\n            entry(\"/./Y\", \"/Y\"),\n            entry(\"/./.foo\", \"/.foo\"),\n            entry(\"/foo/%2E/html\", \"/foo/html\"),\n            entry(\"/foo/bar/../ton/../../a\", \"/a\"),\n            entry(\"/foo/bar/../\", \"/foo/\"),\n            entry(\"//a//../..//\", \"///\"),\n            entry(\"/./y\", \"/y\"),\n            entry(\"////../..\", \"//\"),\n            entry(\"/foo/bar/..\", \"/foo/\"),\n            entry(\"/././foo\", \"/foo\"),\n            entry(\"/foo/bar//..\", \"/foo/bar/\"),\n            entry(\"/a/b/c/./../../g\", \"/a/g\"),\n            entry(\"mid/content=5/../6\", \"mid/6\"));\n\n    @TestFactory\n    Stream<DynamicTest> normalises_path_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(\n          normaliseTestCases.stream()\n              .filter(testCase -> !testCase.getKey().equals(testCase.getValue()))\n              .map(\n                  testCase ->\n                      new NormalisableInvariantTests.NormalisationCase<>(\n                          testCase.getKey(), testCase.getValue()))\n              .toList());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          normaliseTestCases.stream().map(Entry::getValue).collect(Collectors.toSet()));\n    }\n  }\n\n  @Nested\n  class Resolve {\n\n    private static final List<Entry<Path, Path>> rfc3986TestCases =\n        List.of(\n            entry(\"g\", \"/b/c/g\"),\n            entry(\"./g\", \"/b/c/g\"),\n            entry(\"g/\", \"/b/c/g/\"),\n            entry(\"/g\", \"/g\"),\n            entry(\";x\", \"/b/c/;x\"),\n            entry(\"g;x\", \"/b/c/g;x\"),\n            entry(\"\", \"/b/c/d;p\"),\n            entry(\".\", \"/b/c/\"),\n            entry(\"./\", \"/b/c/\"),\n            entry(\"..\", \"/b/\"),\n            entry(\"../\", \"/b/\"),\n            entry(\"../g\", \"/b/g\"),\n            entry(\"../..\", \"/\"),\n            entry(\"../../\", \"/\"),\n            entry(\"../../g\", \"/g\"),\n            entry(\"../../../g\", \"/g\"),\n            entry(\"../../../../g\", \"/g\"),\n            entry(\"/./g\", \"/g\"),\n            entry(\"/../g\", \"/g\"),\n            entry(\"g.\", \"/b/c/g.\"),\n            entry(\".g\", \"/b/c/.g\"),\n            entry(\"g..\", \"/b/c/g..\"),\n            entry(\"..g\", \"/b/c/..g\"),\n            entry(\"./../g\", \"/b/g\"),\n            entry(\"./g/.\", \"/b/c/g/\"),\n            entry(\"g/./h\", \"/b/c/g/h\"),\n            entry(\"g/../h\", \"/b/c/h\"),\n            entry(\"g;x=1/./y\", \"/b/c/g;x=1/y\"),\n            entry(\"g;x=1/../y\", \"/b/c/y\"));\n\n    private static final Path original = Path.parse(\"/b/c/d;p\");\n\n    @ParameterizedTest\n    @FieldSource(\"rfc3986TestCases\")\n    void resolvePath(Entry<Path, Path> testCase) {\n      assertThat(original.resolve(testCase.getKey())).isEqualTo(testCase.getValue());\n    }\n\n    @Test\n    void resolvePathSingle() {\n      resolvePath(entry(\"\", \"/b/c/d;p\"));\n    }\n\n    private static final List<ResolveCase> resolveCases =\n        List.of(\n            resolveCase(\"\", \"\", \"\"),\n            resolveCase(\"\", \"bar/\", \"bar/\"),\n            resolveCase(\"\", \"bar\", \"bar\"),\n            resolveCase(\"\", \"/\", \"/\"),\n            resolveCase(\"\", \"/bar\", \"/bar\"),\n            resolveCase(\"foo/\", \"\", \"foo/\"),\n            resolveCase(\"foo/\", \"bar/\", \"foo/bar/\"),\n            resolveCase(\"foo/\", \"bar\", \"foo/bar\"),\n            resolveCase(\"foo/\", \"/\", \"/\"),\n            resolveCase(\"foo/\", \"/bar\", \"/bar\"),\n            resolveCase(\"foo\", \"\", \"foo\"),\n            resolveCase(\"foo\", \"bar/\", \"bar/\"),\n            resolveCase(\"foo\", \"bar\", \"bar\"),\n            resolveCase(\"foo\", \"/\", \"/\"),\n            resolveCase(\"foo\", \"/bar\", \"/bar\"),\n            resolveCase(\"/\", \"\", \"/\"),\n            resolveCase(\"/\", \"bar/\", \"/bar/\"),\n            resolveCase(\"/\", \"bar\", \"/bar\"),\n            resolveCase(\"/\", \"/\", \"/\"),\n            resolveCase(\"/\", \"/bar\", \"/bar\"),\n            resolveCase(\"/foo\", \"\", \"/foo\"),\n            resolveCase(\"/foo\", \"bar/\", \"/bar/\"),\n            resolveCase(\"/foo\", \"bar\", \"/bar\"),\n            resolveCase(\"/foo\", \"/\", \"/\"),\n            resolveCase(\"/foo\", \"/bar\", \"/bar\"));\n\n    @ParameterizedTest\n    @FieldSource(\"resolveCases\")\n    void paths_are_resolved(ResolveCase resolveCase) {\n      assertThat(resolveCase.initial().resolve(resolveCase.other()))\n          .isEqualTo(resolveCase.expected());\n    }\n\n    static ResolveCase resolveCase(String initialStr, String otherStr, String expectedStr) {\n      return new ResolveCase(initialStr, otherStr, expectedStr);\n    }\n\n    record ResolveCase(String initialStr, String otherStr, String expectedStr) {\n      Path initial() {\n        return Path.parse(initialStr);\n      }\n\n      Path other() {\n        return Path.parse(otherStr);\n      }\n\n      Path expected() {\n        return Path.parse(expectedStr);\n      }\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    static final List<String> pathsWithoutPercentEncoding =\n        List.of(\"\", \"/\", \"/path\", \"/path/to/resource\", \"relative/path\", \"/user:pass@host\");\n\n    static final List<CodecCase> codecCases =\n        List.of(\n            new CodecCase(\"/%20\", \"/ \"),\n            new CodecCase(\"/path%20name\", \"/path name\"),\n            new CodecCase(\"/path%2Fname\", \"/path/name\"),\n            new CodecCase(\"/%C3%A9\", \"/é\"),\n            new CodecCase(\"/caf%C3%A9\", \"/café\"),\n            new CodecCase(\"/100%25complete\", \"/100%complete\"),\n            new CodecCase(\"/path%20with%20spaces/and-dashes\", \"/path with spaces/and-dashes\"),\n            new CodecCase(\"/user%40example.com\", \"/user@example.com\"),\n            new CodecCase(\"/hello%20world\", \"/hello world\"),\n            new CodecCase(\"/test%3Avalue\", \"/test:value\"));\n\n    @ParameterizedTest\n    @FieldSource(\"pathsWithoutPercentEncoding\")\n    void returns_same_string_for_path_without_percent_encoding(String pathString) {\n      Path path = Path.parse(pathString);\n      assertThat(path.decode()).isEqualTo(pathString);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"codecCases\")\n    void decodes_percent_encoded_path_correctly(CodecCase testCase) {\n      Path path = Path.parse(testCase.encoded());\n      assertThat(path.decode()).isEqualTo(testCase.decoded());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      return generateEncodeDecodeInvariantTests(\n          PathParser.INSTANCE,\n          Stream.of(\n              \"foo\",\n              \"/bar\",\n              \"/path/to/resource\",\n              \"hello world\",\n              \"/café\",\n              \"/path/with spaces\",\n              \"こんにちは\"));\n    }\n  }\n\n  @Nested\n  class EncodedSlash {\n\n    @Test\n    void parse_with_encoded_slash() {\n      Path path = Path.parse(\"/%2F/\");\n      assertThat(path.toString()).isEqualTo(\"/%2F/\");\n    }\n\n    @Test\n    void decode_with_encoded_slash() {\n      Path path = Path.parse(\"/%2F/\");\n      assertThat(path.decode()).isEqualTo(\"///\");\n    }\n\n    @Test\n    void encode_with_encoded_slash() {\n      Path path = Path.encode(\"/%2F/\");\n      assertThat(path).isEqualTo(Path.parse(\"/%252F/\"));\n    }\n\n    @Test\n    void normalise_with_encoded_slash() {\n      Path path = Path.parse(\"/%2F/\");\n      assertThat(path.normalise()).isEqualTo(path);\n    }\n  }\n\n  @Nested\n  class Transformers {\n\n    private static final List<Arguments> to_absolute_cases =\n        List.of(\n            arguments(\"\", \"/\"),\n            arguments(\"/\", \"/\"),\n            arguments(\"foo\", \"/foo\"),\n            arguments(\"foo/\", \"/foo/\"),\n            arguments(\"/foo\", \"/foo\"),\n            arguments(\"/foo/\", \"/foo/\"));\n\n    @ParameterizedTest\n    @FieldSource(\"to_absolute_cases\")\n    void to_absolute_creates_absolute_path(String original, String expected) {\n      assertThat(Path.parse(original).toAbsolutePath()).isEqualTo(Path.parse(expected));\n    }\n\n    private static final List<Arguments> to_relative_cases =\n        List.of(\n            arguments(\"\", \"\"),\n            arguments(\"/\", \"\"),\n            arguments(\"foo\", \"foo\"),\n            arguments(\"foo/\", \"foo/\"),\n            arguments(\"/foo\", \"foo\"),\n            arguments(\"/foo/\", \"foo/\"));\n\n    @ParameterizedTest\n    @FieldSource(\"to_relative_cases\")\n    void to_relative_creates_relative_path(String original, String expected) {\n      assertThat(Path.parse(original).toRelativePath()).isEqualTo(Path.parse(expected));\n    }\n\n    private static final List<Arguments> to_base_cases =\n        List.of(\n            arguments(\"\", \"\"),\n            arguments(\"/\", \"/\"),\n            arguments(\"foo\", \"foo/\"),\n            arguments(\"foo/\", \"foo/\"),\n            arguments(\"/foo\", \"/foo/\"),\n            arguments(\"/foo/\", \"/foo/\"));\n\n    @ParameterizedTest\n    @FieldSource(\"to_base_cases\")\n    void to_base_creates_base_path(String original, String expected) {\n      assertThat(Path.parse(original).toBasePath()).isEqualTo(Path.parse(expected));\n    }\n\n    private static final List<Arguments> to_leaf_cases =\n        List.of(\n            arguments(\"\", \"\"),\n            arguments(\"/\", \"\"),\n            arguments(\"foo\", \"foo\"),\n            arguments(\"foo/\", \"foo\"),\n            arguments(\"/foo\", \"/foo\"),\n            arguments(\"/foo/\", \"/foo\"));\n\n    @ParameterizedTest\n    @FieldSource(\"to_leaf_cases\")\n    void to_leaf_creates_leaf_path(String original, String expected) {\n      assertThat(Path.parse(original).toLeafPath()).isEqualTo(Path.parse(expected));\n    }\n\n    private static final List<Arguments> remove_prefix_cases =\n        List.of(\n            arguments(\"\", \"\", \"\"),\n            arguments(\"/\", \"\", \"/\"),\n            arguments(\"foo\", \"\", \"foo\"),\n            arguments(\"foo/\", \"\", \"foo/\"),\n            arguments(\"/foo\", \"\", \"/foo\"),\n            arguments(\"/foo/\", \"\", \"/foo/\"),\n            arguments(\"\", \"/\", \"\"),\n            arguments(\"/\", \"/\", \"\"),\n            arguments(\"foo\", \"/\", \"foo\"),\n            arguments(\"foo/\", \"/\", \"foo/\"),\n            arguments(\"/foo\", \"/\", \"foo\"),\n            arguments(\"/foo/\", \"/\", \"foo/\"),\n            arguments(\"\", \"foo\", \"\"),\n            arguments(\"/\", \"foo\", \"/\"),\n            arguments(\"foo\", \"foo\", \"\"),\n            arguments(\"foo/\", \"foo\", \"/\"),\n            arguments(\"/foo\", \"foo\", \"/foo\"),\n            arguments(\"/foo/\", \"foo\", \"/foo/\"),\n            arguments(\"\", \"foo/\", \"\"),\n            arguments(\"/\", \"foo/\", \"/\"),\n            arguments(\"foo\", \"foo/\", \"foo\"),\n            arguments(\"foo/\", \"foo/\", \"\"),\n            arguments(\"/foo\", \"foo/\", \"/foo\"),\n            arguments(\"/foo/\", \"foo/\", \"/foo/\"),\n            arguments(\"\", \"/foo\", \"\"),\n            arguments(\"/\", \"/foo\", \"/\"),\n            arguments(\"foo\", \"/foo\", \"foo\"),\n            arguments(\"foo/\", \"/foo\", \"foo/\"),\n            arguments(\"/foo\", \"/foo\", \"\"),\n            arguments(\"/foo/\", \"/foo\", \"/\"),\n            arguments(\"\", \"/foo/\", \"\"),\n            arguments(\"/\", \"/foo/\", \"/\"),\n            arguments(\"foo\", \"/foo/\", \"foo\"),\n            arguments(\"foo/\", \"/foo/\", \"foo/\"),\n            arguments(\"/foo\", \"/foo/\", \"/foo\"),\n            arguments(\"/foo/\", \"/foo/\", \"\"));\n\n    @ParameterizedTest\n    @FieldSource(\"remove_prefix_cases\")\n    void remove_prefix_removes_prefix(String original, String prefixToRemove, String expected) {\n      assertThat(Path.parse(original).removePrefix(Path.parse(prefixToRemove)))\n          .isEqualTo(Path.parse(expected));\n    }\n\n    private static final List<Arguments> append_cases =\n        List.of(\n            arguments(\"\", \"\", \"\"),\n            arguments(\"/\", \"\", \"/\"),\n            arguments(\"foo\", \"\", \"foo\"),\n            arguments(\"foo/\", \"\", \"foo/\"),\n            arguments(\"/foo\", \"\", \"/foo\"),\n            arguments(\"/foo/\", \"\", \"/foo/\"),\n            arguments(\"\", \"/\", \"/\"),\n            arguments(\"/\", \"/\", \"/\"),\n            arguments(\"foo\", \"/\", \"foo/\"),\n            arguments(\"foo/\", \"/\", \"foo/\"),\n            arguments(\"/foo\", \"/\", \"/foo/\"),\n            arguments(\"/foo/\", \"/\", \"/foo/\"),\n            arguments(\"\", \"foo\", \"foo\"),\n            arguments(\"/\", \"foo\", \"/foo\"),\n            arguments(\"foo\", \"foo\", \"foo/foo\"),\n            arguments(\"foo/\", \"foo\", \"foo/foo\"),\n            arguments(\"/foo\", \"foo\", \"/foo/foo\"),\n            arguments(\"/foo/\", \"foo\", \"/foo/foo\"),\n            arguments(\"\", \"foo/\", \"foo/\"),\n            arguments(\"/\", \"foo/\", \"/foo/\"),\n            arguments(\"foo\", \"foo/\", \"foo/foo/\"),\n            arguments(\"foo/\", \"foo/\", \"foo/foo/\"),\n            arguments(\"/foo\", \"foo/\", \"/foo/foo/\"),\n            arguments(\"/foo/\", \"foo/\", \"/foo/foo/\"),\n            arguments(\"\", \"/foo\", \"/foo\"),\n            arguments(\"/\", \"/foo\", \"/foo\"),\n            arguments(\"foo\", \"/foo\", \"foo/foo\"),\n            arguments(\"foo/\", \"/foo\", \"foo/foo\"),\n            arguments(\"/foo\", \"/foo\", \"/foo/foo\"),\n            arguments(\"/foo/\", \"/foo\", \"/foo/foo\"),\n            arguments(\"\", \"/foo/\", \"/foo/\"),\n            arguments(\"/\", \"/foo/\", \"/foo/\"),\n            arguments(\"foo\", \"/foo/\", \"foo/foo/\"),\n            arguments(\"foo/\", \"/foo/\", \"foo/foo/\"),\n            arguments(\"/foo\", \"/foo/\", \"/foo/foo/\"),\n            arguments(\"/foo/\", \"/foo/\", \"/foo/foo/\"));\n\n    @ParameterizedTest\n    @FieldSource(\"append_cases\")\n    void append_cases(String original, String toAppend, String expected) {\n      assertThat(Path.parse(original).append(Path.parse(toAppend))).isEqualTo(Path.parse(expected));\n    }\n  }\n\n  static Entry<Path, Path> entry(String nonNormalised, String normalised) {\n    return Map.entry(Path.parse(nonNormalised), Path.parse(normalised));\n  }\n\n  @Nested\n  class EmptyInitialisation extends AbstractEncodableInitialisationTests {\n\n    EmptyInitialisation() {\n      super(\"org.wiremock.url.Path\", EMPTY, \"org.wiremock.url.PathParser\", \"\");\n    }\n  }\n\n  @Nested\n  class RootInitialisation extends AbstractEncodableInitialisationTests {\n\n    RootInitialisation() {\n      super(\"org.wiremock.url.Path\", \"ROOT\", \"org.wiremock.url.PathParser\", \"/\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/PercentEncodedStringParserInvariantTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.jupiter.api.DynamicTest.dynamicTest;\n\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.DynamicTest;\n\npublic class PercentEncodedStringParserInvariantTests {\n\n  static <T extends PercentEncoded<T>> Stream<DynamicTest> generateEncodeDecodeInvariantTests(\n      PercentEncodedStringParser<T> parser, Stream<String> decodedForms) {\n    return decodedForms.flatMap(\n        original ->\n            Stream.of(\n                dynamicTest(\n                    \"result of encoding `\" + original + \"` is in normal form\",\n                    () -> {\n                      T encoded = parser.encode(original);\n                      assertThat(encoded.isNormalForm());\n\n                      T parsed = parser.parse(encoded.toString());\n                      assertThat(parsed).isEqualTo(encoded);\n                      assertThat(parsed.isNormalForm());\n                    }),\n                dynamicTest(\n                    \"Original -> Encode -> Decode `\" + original + \"` produces the original value\",\n                    () -> {\n                      T encoded = parser.encode(original);\n                      String decoded = encoded.decode();\n                      assertThat(decoded).isEqualTo(original);\n                    })));\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/PercentEncodingTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.wiremock.url.Constants.combine;\nimport static org.wiremock.url.Constants.includeRange;\n\nimport java.util.List;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\n\nclass PercentEncodingTests {\n\n  private static final boolean[] alphanumericDoNotNeedEncoding =\n      combine(includeRange('a', 'z'), includeRange('A', 'Z'), includeRange('0', '9'));\n\n  private static final List<Pair<String, String>> normalisationCases =\n      List.of(\n          Pair.of(\"%\", \"%25\"),\n          Pair.of(\"%0\", \"%250\"),\n          Pair.of(\"%F\", \"%25F\"),\n          Pair.of(\"%0G\", \"%250G\"),\n          Pair.of(\"%G0\", \"%25G0\"),\n          Pair.of(\"%/0\", \"%25%2F0\"),\n          Pair.of(\"%0/\", \"%250%2F\"),\n          Pair.of(\"%:0\", \"%25%3A0\"),\n          Pair.of(\"%0:\", \"%250%3A\"),\n          Pair.of(\"%@0\", \"%25%400\"),\n          Pair.of(\"%0@\", \"%250%40\"),\n          Pair.of(\"%[0\", \"%25%5B0\"),\n          Pair.of(\"%0[\", \"%250%5B\"),\n          Pair.of(\"%`0\", \"%25%600\"),\n          Pair.of(\"%0`\", \"%250%60\"),\n          Pair.of(\"%{0\", \"%25%7B0\"),\n          Pair.of(\"%0}\", \"%250%7D\"),\n          Pair.of(\"%00\", \"%00\"),\n          Pair.of(\"%09\", \"%09\"),\n          Pair.of(\"%99\", \"%99\"),\n          Pair.of(\"%a0\", \"%A0\"),\n          Pair.of(\"%A0\", \"%A0\"),\n          Pair.of(\"%a9\", \"%A9\"),\n          Pair.of(\"%A9\", \"%A9\"),\n          Pair.of(\"%aA\", \"%AA\"),\n          Pair.of(\"%Aa\", \"%AA\"),\n          Pair.of(\"%AA\", \"%AA\"),\n          Pair.of(\"%Af\", \"%AF\"),\n          Pair.of(\"%aF\", \"%AF\"),\n          Pair.of(\"%AF\", \"%AF\"),\n          Pair.of(\"%f0\", \"%F0\"),\n          Pair.of(\"%F0\", \"%F0\"),\n          Pair.of(\"%F9\", \"%F9\"),\n          Pair.of(\"%FA\", \"%FA\"),\n          Pair.of(\"%FF\", \"%FF\"),\n          Pair.of(\"%30\", \"0\"),\n          Pair.of(\"%39\", \"9\"),\n          Pair.of(\"%41\", \"A\"),\n          Pair.of(\"%5A\", \"Z\"),\n          Pair.of(\"%61\", \"a\"),\n          Pair.of(\"%7A\", \"z\"),\n          Pair.of(\"aßc\", \"a%C3%9Fc\"),\n          Pair.of(\n              \"loC𝐀𝐋𝐇𝐨𝐬𝐭/usr/bin\",\n              \"loC%F0%9D%90%80%F0%9D%90%8B%F0%9D%90%87%F0%9D%90%A8%F0%9D%90%AC%F0%9D%90%AD%2Fusr%2Fbin\"),\n          Pair.of(\"%~\", \"%25%7E\"), // should be encoded\n          Pair.of(\"%0~\", \"%250%7E\"), // should be encoded\n          Pair.of(\"%~0\", \"%25%7E0\"), // should be encoded\n          Pair.of(\"~\", \"%7E\") // should be encoded\n          );\n\n  private static final List<Pair<String, String>> nonNormalNormalisationCases =\n      normalisationCases.stream().filter(t -> !t.getLeft().equals(t.getRight())).toList();\n\n  @ParameterizedTest\n  @FieldSource(\"nonNormalNormalisationCases\")\n  void is_normal_form_returns_false(Pair<String, String> nonNormalNormalisationCases) {\n    var nonNormalForm = nonNormalNormalisationCases.getLeft();\n    assertThat(PercentEncoding.isNormalForm(nonNormalForm, alphanumericDoNotNeedEncoding))\n        .isFalse();\n  }\n\n  @ParameterizedTest\n  @FieldSource(\"nonNormalNormalisationCases\")\n  void normalise_returns_normalised(Pair<String, String> nonNormalNormalisationCases) {\n    var nonNormalForm = nonNormalNormalisationCases.getLeft();\n    var normalForm = nonNormalNormalisationCases.getRight();\n    assertThat(PercentEncoding.normalise(nonNormalForm, alphanumericDoNotNeedEncoding))\n        .isEqualTo(normalForm);\n  }\n\n  @ParameterizedTest\n  @FieldSource(\"normalisationCases\")\n  void is_normal_form_returns_true_for_normal_form(Pair<String, String> normalisationCase) {\n    var normalForm = normalisationCase.getRight();\n    assertThat(PercentEncoding.isNormalForm(normalForm, alphanumericDoNotNeedEncoding)).isTrue();\n  }\n\n  @ParameterizedTest\n  @FieldSource(\"normalisationCases\")\n  void normalise_returns_null_when_already_normal(Pair<String, String> normalisationCase) {\n    var normalForm = normalisationCase.getRight();\n    assertThat(PercentEncoding.normalise(normalForm, alphanumericDoNotNeedEncoding)).isNull();\n  }\n\n  private static final List<Pair<String, String>> encodingCases =\n      List.of(\n          Pair.of(\"aßc\", \"a%C3%9Fc\"),\n          Pair.of(\n              \"loC𝐀𝐋𝐇𝐨𝐬𝐭/usr/bin\",\n              \"loC%F0%9D%90%80%F0%9D%90%8B%F0%9D%90%87%F0%9D%90%A8%F0%9D%90%AC%F0%9D%90%AD%2Fusr%2Fbin\"));\n\n  @ParameterizedTest\n  @FieldSource(\"encodingCases\")\n  void encode_encodes_as_expected(Pair<String, String> testCase) {\n    assertThat(PercentEncoding.encode(testCase.getLeft(), alphanumericDoNotNeedEncoding))\n        .isEqualTo(testCase.getRight());\n  }\n\n  @ParameterizedTest\n  @FieldSource(\"encodingCases\")\n  void decode_decodes_as_expected(Pair<String, String> testCase) {\n    assertThat(PercentEncoding.decode(testCase.getRight())).isEqualTo(testCase.getLeft());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/PortTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.MethodSource;\nimport org.junit.jupiter.params.provider.ValueSource;\n\nclass PortTests {\n\n  @Nested\n  class OfMethod {\n\n    @ParameterizedTest\n    @ValueSource(ints = {0, 1, 80, 443, 8080, 8443, 9000, 65535, 65536, 70000, 100000})\n    void creates_ports_with_various_valid_values(int portNumber) {\n      Port port = Port.of(portNumber);\n      assertThat(port.getIntValue()).isEqualTo(portNumber);\n    }\n\n    @ParameterizedTest\n    @ValueSource(ints = {-1000, -1})\n    void rejects_illegal_port(int illegalPort) {\n      assertThatExceptionOfType(IllegalPort.class)\n          .isThrownBy(() -> Port.of(illegalPort))\n          .withMessage(\n              \"Illegal port [\"\n                  + illegalPort\n                  + \"]; Port value must be an integer between 1 and 2147483647\")\n          .withNoCause()\n          .extracting(IllegalPort::getIllegalValue)\n          .isEqualTo(String.valueOf(illegalPort));\n    }\n  }\n\n  @Nested\n  class ParseMethod {\n\n    static Stream<String> validPortStrings() {\n      return Stream.of(\n          \"0\", \"1\", \"80\", \"443\", \"8080\", \"8443\", \"9000\", \"65535\", \"00080\", \"65536\", \"70000\",\n          \"100000\");\n    }\n\n    @ParameterizedTest\n    @MethodSource(\"validPortStrings\")\n    void parses_various_valid_port_strings(String portString) {\n      Port port = Port.parse(portString);\n      assertThat(port.getIntValue()).isEqualTo(Integer.parseInt(portString));\n      assertThat(port.toString()).isEqualTo(portString);\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"-1000\", \"-1\"})\n    void rejects_illegal_port(String illegalPortString) {\n      assertThatExceptionOfType(IllegalPort.class)\n          .isThrownBy(() -> Port.parse(illegalPortString))\n          .withMessage(\n              \"Illegal port [\"\n                  + illegalPortString\n                  + \"]; Port value must be an integer between 1 and 2147483647\")\n          .withNoCause()\n          .extracting(IllegalPort::getIllegalValue)\n          .isEqualTo(illegalPortString);\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"+80\",\n          \"abc\",\n          \"80.0\",\n          \"12.34\",\n          \"1e3\",\n          \"0x50\",\n          \"\",\n          \"   \",\n          \" 80\",\n          \"80 \",\n          \" 80 \",\n          \"port8080\",\n          \"8080port\",\n          \"80 80\"\n        })\n    void rejects_various_illegal_port_strings(String illegalPortString) {\n      assertThatExceptionOfType(IllegalPort.class)\n          .isThrownBy(() -> Port.parse(illegalPortString))\n          .withMessage(\n              \"Illegal port [\"\n                  + illegalPortString\n                  + \"]; Port value must be an integer between 1 and 2147483647\")\n          .withNoCause()\n          .extracting(IllegalPort::getIllegalValue)\n          .isEqualTo(illegalPortString);\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    @Test\n    void ports_with_same_value_are_equal() {\n      Port port1 = Port.of(8080);\n      Port port2 = Port.of(8080);\n      assertThat(port1).isEqualTo(port2);\n    }\n\n    @Test\n    void ports_created_with_same_canonical_string_are_equal() {\n      Port portFromInt = Port.of(8080);\n      Port portFromString = Port.parse(\"8080\");\n      assertThat(portFromInt).isEqualTo(portFromString);\n      assertThat(portFromInt.toString()).isEqualTo(\"8080\");\n      assertThat(portFromString.toString()).isEqualTo(\"8080\");\n    }\n\n    @Test\n    void ports_with_different_string_representations_are_not_equal() {\n      Port portWithLeadingZeros = Port.parse(\"00080\");\n      Port portCanonical = Port.of(80);\n      assertThat(portWithLeadingZeros.getIntValue()).isEqualTo(80);\n      assertThat(portCanonical.getIntValue()).isEqualTo(80);\n      assertThat(portWithLeadingZeros).isNotEqualTo(portCanonical);\n      assertThat(portWithLeadingZeros.toString()).isEqualTo(\"00080\");\n      assertThat(portCanonical.toString()).isEqualTo(\"80\");\n    }\n\n    @Test\n    void ports_with_different_values_are_not_equal() {\n      Port port1 = Port.of(8080);\n      Port port2 = Port.of(9000);\n      assertThat(port1).isNotEqualTo(port2);\n    }\n\n    @Test\n    void port_is_equal_to_itself() {\n      Port port = Port.of(8080);\n      assertThat(port).isEqualTo(port);\n    }\n\n    @Test\n    void port_is_not_equal_to_null() {\n      Port port = Port.of(8080);\n      assertThat(port).isNotEqualTo(null);\n    }\n\n    @Test\n    void port_is_not_equal_to_different_type() {\n      Port port = Port.of(8080);\n      assertThat(port).isNotEqualTo(\"8080\");\n      assertThat(port).isNotEqualTo(8080);\n    }\n\n    @Test\n    void equals_is_symmetric() {\n      Port port1 = Port.of(443);\n      Port port2 = Port.of(443);\n      assertThat(port1.equals(port2)).isEqualTo(port2.equals(port1));\n    }\n\n    @Test\n    void equals_is_transitive() {\n      Port port1 = Port.of(443);\n      Port port2 = Port.of(443);\n      Port port3 = Port.of(443);\n      assertThat(port1).isEqualTo(port2);\n      assertThat(port2).isEqualTo(port3);\n      assertThat(port1).isEqualTo(port3);\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void hash_code_based_on_string_representation() {\n      Port port = Port.of(8080);\n      assertThat(port.hashCode()).isEqualTo(\"8080\".hashCode());\n    }\n\n    @Test\n    void hash_code_for_port_with_leading_zeros() {\n      Port port = Port.parse(\"00080\");\n      assertThat(port.hashCode()).isEqualTo(\"00080\".hashCode());\n    }\n\n    @Test\n    void equal_ports_have_same_hash_code() {\n      Port port1 = Port.of(443);\n      Port port2 = Port.of(443);\n      assertThat(port1.hashCode()).isEqualTo(port2.hashCode());\n    }\n\n    @Test\n    void ports_with_different_string_representations_have_different_hash_codes() {\n      Port port1 = Port.parse(\"00080\");\n      Port port2 = Port.of(80);\n      assertThat(port1.hashCode()).isNotEqualTo(port2.hashCode());\n    }\n\n    @Test\n    void different_ports_have_different_hash_codes() {\n      Port port1 = Port.of(8080);\n      Port port2 = Port.of(9000);\n      assertThat(port1.hashCode()).isNotEqualTo(port2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      Port port = Port.of(8443);\n      int hashCode1 = port.hashCode();\n      int hashCode2 = port.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class ToStringMethod {\n\n    @ParameterizedTest\n    @ValueSource(ints = {1, 80, 443, 8080, 8443, 9000, 65535})\n    void to_string_returns_correct_string_for_various_ports(int portNumber) {\n      Port port = Port.of(portNumber);\n      assertThat(port.toString()).isEqualTo(String.valueOf(portNumber));\n    }\n\n    @Test\n    void to_string_result_can_be_parsed_back() {\n      Port original = Port.of(8080);\n      String stringForm = original.toString();\n      Port parsed = Port.parse(stringForm);\n      assertThat(parsed).isEqualTo(original);\n      assertThat(parsed.toString()).isEqualTo(stringForm);\n    }\n\n    @Test\n    void to_string_preserves_leading_zeros() {\n      Port port = Port.parse(\"00080\");\n      assertThat(port.toString()).isEqualTo(\"00080\");\n    }\n\n    @Test\n    void to_string_preserves_format_from_parse() {\n      assertThat(Port.parse(\"00080\").toString()).isEqualTo(\"00080\");\n      assertThat(Port.parse(\"0080\").toString()).isEqualTo(\"0080\");\n      assertThat(Port.parse(\"080\").toString()).isEqualTo(\"080\");\n      assertThat(Port.parse(\"80\").toString()).isEqualTo(\"80\");\n    }\n  }\n\n  @Nested\n  class LeadingZeros {\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"00080\", \"0080\", \"080\", \"00443\", \"01\", \"001\", \"0001\", \"00001\"})\n    void parses_ports_with_leading_zeros(String portString) {\n      Port port = Port.parse(portString);\n      assertThat(port.getIntValue()).isEqualTo(Integer.parseInt(portString));\n      assertThat(port.toString()).isEqualTo(portString);\n    }\n\n    @Test\n    void ports_with_leading_zeros_have_correct_port_number() {\n      Port port = Port.parse(\"00080\");\n      assertThat(port.getIntValue()).isEqualTo(80);\n    }\n\n    @Test\n    void ports_with_and_without_leading_zeros_are_not_equal() {\n      Port port1 = Port.parse(\"00080\");\n      Port port2 = Port.parse(\"080\");\n      Port port3 = Port.parse(\"80\");\n      Port port4 = Port.of(80);\n\n      assertThat(port1).isNotEqualTo(port2);\n      assertThat(port1).isNotEqualTo(port3);\n      assertThat(port1).isNotEqualTo(port4);\n      assertThat(port2).isNotEqualTo(port3);\n      assertThat(port2).isNotEqualTo(port4);\n      assertThat(port3).isEqualTo(port4); // These are equal - same string representation\n    }\n\n    @Test\n    void ports_with_same_leading_zeros_are_equal() {\n      Port port1 = Port.parse(\"00080\");\n      Port port2 = Port.parse(\"00080\");\n      assertThat(port1).isEqualTo(port2);\n    }\n\n    @Test\n    void leading_zeros_are_preserved_in_round_trip() {\n      String original = \"00443\";\n      Port port = Port.parse(original);\n      String stringForm = port.toString();\n      Port reparsed = Port.parse(stringForm);\n      assertThat(stringForm).isEqualTo(original);\n      assertThat(reparsed).isEqualTo(port);\n      assertThat(reparsed.toString()).isEqualTo(original);\n    }\n\n    @Test\n    void port_with_many_leading_zeros() {\n      Port port = Port.parse(\"000000080\");\n      assertThat(port.getIntValue()).isEqualTo(80);\n      assertThat(port.toString()).isEqualTo(\"000000080\");\n    }\n\n    @Test\n    void leading_zeros_do_not_affect_port_number() {\n      assertThat(Port.parse(\"00080\").getIntValue()).isEqualTo(80);\n      assertThat(Port.parse(\"0080\").getIntValue()).isEqualTo(80);\n      assertThat(Port.parse(\"080\").getIntValue()).isEqualTo(80);\n      assertThat(Port.parse(\"80\").getIntValue()).isEqualTo(80);\n      assertThat(Port.of(80).getIntValue()).isEqualTo(80);\n    }\n\n    @Test\n    void ports_with_leading_zeros_are_not_cached() {\n      Port port1 = Port.parse(\"00080\");\n      Port port2 = Port.parse(\"00080\");\n      // Non-canonical ports are not cached, so different instances\n      assertThat(port1).isNotSameAs(port2);\n      // But they are equal (same string representation)\n      assertThat(port1).isEqualTo(port2);\n    }\n\n    @Test\n    void canonical_ports_are_cached() {\n      Port port1 = Port.parse(\"80\");\n      Port port2 = Port.parse(\"80\");\n      Port port3 = Port.of(80);\n      // Canonical ports are cached, so same instance\n      assertThat(port1).isSameAs(port2);\n      assertThat(port1).isSameAs(port3);\n    }\n\n    @Test\n    void mixed_canonical_and_non_canonical_not_cached_together() {\n      Port canonical = Port.parse(\"80\");\n      Port withLeadingZeros = Port.parse(\"00080\");\n      // Different instances (canonical cached, non-canonical not)\n      assertThat(canonical).isNotSameAs(withLeadingZeros);\n      // Different values (different string representations)\n      assertThat(canonical).isNotEqualTo(withLeadingZeros);\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    @Test\n    void normalise_removes_leading_zeros() {\n      Port portWithLeadingZeros = Port.parse(\"00080\");\n      Port normalised = portWithLeadingZeros.normalise();\n      assertThat(normalised.toString()).isEqualTo(\"80\");\n      assertThat(normalised.getIntValue()).isEqualTo(80);\n    }\n\n    @Test\n    void normalise_returns_equal_to_port_of() {\n      Port portWithLeadingZeros = Port.parse(\"00080\");\n      Port normalised = portWithLeadingZeros.normalise();\n      Port canonical = Port.of(80);\n      assertThat(normalised).isEqualTo(canonical);\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"00080\", \"0080\", \"080\", \"00443\", \"01\", \"001\", \"0001\", \"00001\"})\n    void normalise_removes_all_leading_zeros(String portString) {\n      Port port = Port.parse(portString);\n      Port normalised = port.normalise();\n      int expectedPort = Integer.parseInt(portString);\n      assertThat(normalised.toString()).isEqualTo(String.valueOf(expectedPort));\n      assertThat(normalised.getIntValue()).isEqualTo(expectedPort);\n    }\n\n    @Test\n    void normalise_on_canonical_form_returns_equal_port() {\n      Port canonical = Port.of(8080);\n      Port normalised = canonical.normalise();\n      assertThat(normalised).isEqualTo(canonical);\n      assertThat(normalised.toString()).isEqualTo(\"8080\");\n    }\n\n    @Test\n    void normalise_on_parsed_canonical_form_returns_equal_port() {\n      Port parsed = Port.parse(\"443\");\n      Port normalised = parsed.normalise();\n      assertThat(normalised).isEqualTo(parsed);\n      assertThat(normalised.toString()).isEqualTo(\"443\");\n    }\n\n    @Test\n    void normalise_is_idempotent() {\n      Port port = Port.parse(\"00080\");\n      Port normalised1 = port.normalise();\n      Port normalised2 = normalised1.normalise();\n      assertThat(normalised1).isEqualTo(normalised2);\n      assertThat(normalised1.toString()).isEqualTo(\"80\");\n      assertThat(normalised2.toString()).isEqualTo(\"80\");\n    }\n\n    @Test\n    void normalise_allows_comparison_of_ports_with_different_formats() {\n      Port port1 = Port.parse(\"00080\");\n      Port port2 = Port.parse(\"080\");\n      Port port3 = Port.parse(\"80\");\n      Port port4 = Port.of(80);\n\n      // Original ports are not equal\n      assertThat(port1).isNotEqualTo(port2);\n      assertThat(port1).isNotEqualTo(port3);\n      assertThat(port1).isNotEqualTo(port4);\n\n      // Normalised ports are all equal\n      assertThat(port1.normalise()).isEqualTo(port2.normalise());\n      assertThat(port1.normalise()).isEqualTo(port3.normalise());\n      assertThat(port1.normalise()).isEqualTo(port4.normalise());\n    }\n\n    @Test\n    void normalise_preserves_port_number() {\n      Port port = Port.parse(\"00443\");\n      Port normalised = port.normalise();\n      assertThat(port.getIntValue()).isEqualTo(normalised.getIntValue());\n      assertThat(normalised.getIntValue()).isEqualTo(443);\n    }\n\n    @Test\n    void normalise_creates_cacheable_instance() {\n      Port port1 = Port.parse(\"00080\");\n      Port port2 = Port.parse(\"0080\");\n      Port normalised1 = port1.normalise();\n      Port normalised2 = port2.normalise();\n\n      // Normalised instances should be the same cached instance\n      assertThat(normalised1).isSameAs(normalised2);\n      assertThat(normalised1).isSameAs(Port.of(80));\n    }\n\n    @Test\n    void normalise_minimum_port() {\n      Port port = Port.parse(\"01\");\n      Port normalised = port.normalise();\n      assertThat(normalised.toString()).isEqualTo(\"1\");\n      assertThat(normalised).isEqualTo(Port.of(1));\n    }\n\n    @Test\n    void normalise_maximum_port() {\n      Port port = Port.parse(\"065535\");\n      Port normalised = port.normalise();\n      assertThat(normalised.toString()).isEqualTo(\"65535\");\n      assertThat(normalised).isEqualTo(Port.of(65535));\n    }\n\n    @Test\n    void normalise_with_many_leading_zeros() {\n      Port port = Port.parse(\"000000080\");\n      Port normalised = port.normalise();\n      assertThat(normalised.toString()).isEqualTo(\"80\");\n      assertThat(normalised.getIntValue()).isEqualTo(80);\n    }\n\n    @TestFactory\n    Stream<DynamicTest> normalises_port_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(\n          List.of(\n              new NormalisableInvariantTests.NormalisationCase<>(\n                  Port.parse(\"00080\"), Port.of(80))));\n    }\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          List.of(Port.of(0), Port.of(80), Port.of(Integer.MAX_VALUE)));\n    }\n  }\n\n  @TestFactory\n  Stream<DynamicTest> port_parser_invariants() {\n    return StringParserInvariantTests.generateInvariantTests(\n        PortParser.INSTANCE, ParseMethod.validPortStrings().toList());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/QueryParamKeyTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\nclass QueryParamKeyTests {\n\n  @Nested\n  class Parse {\n\n    static final List<String> validKeys =\n        List.of(\n            // Empty and simple keys\n            \"\",\n            \"key\",\n            \"123\",\n\n            // Unreserved characters (alphanumeric, hyphen, period, underscore, tilde)\n            \"key-name\",\n            \"key.name\",\n            \"key_name\",\n            \"key~name\",\n            \"Key123\",\n            \"test-key_123.name~test\",\n\n            // Sub-delimiters (!$'()*+,;) - note & and = are not allowed in keys\n            \"key!name\",\n            \"key$name\",\n            \"key'name\",\n            \"key(name)\",\n            \"key*name\",\n            \"key+name\",\n            \"key,name\",\n            \"key;name\",\n\n            // Colon and at-sign\n            \"time:12:30:00\",\n            \"user@example.com\",\n            \"http://example.com\",\n            \"/api/v1/users\",\n\n            // Forward slash and question mark\n            \"/path/to/resource\",\n            \"what?when?where\",\n            \"/search?q\",\n\n            // Percent-encoded characters\n            \"%20\",\n            \"search%20term\",\n            \"%2Fapi%2Fv1\",\n            \"%C3%A9ric\",\n            \"caf%C3%A9\",\n            \"%25\",\n            \"%3D\", // encoded =\n            \"key%3Dname\",\n\n            // Characters that extend beyond RFC 3986\n            \"{key}\",\n            \"[1,2,3]\",\n            \"<key>\",\n            \"key|name\",\n            \"key\\\\name\",\n            \"key^name\",\n            \"key`name\",\n\n            // Spaces and special characters (permissive)\n            \"search term\",\n            \"na[me]\",\n            \"<key>\",\n\n            // Complex combinations\n            \"http://example.com:8080/path?q\",\n            \"%7B%22key%22:%22value%22%7D\",\n            \"jQuery.ajax\",\n\n            // No separators\n            \"justtext\",\n            \"noseparators123\",\n\n            // Invalid percent encoding (still accepted - permissive parser)\n            \"%\",\n            \"%2\",\n            \"%GG\",\n            \"%ZZkey\");\n\n    @ParameterizedTest\n    @FieldSource(\"validKeys\")\n    void parses_valid_keys(String keyString) {\n      QueryParamKey key = QueryParamKey.parse(keyString);\n      assertThat(key.toString()).isEqualTo(keyString);\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"key#fragment\", \"test#test\", \"#\", \"key#\"})\n    void rejects_keys_with_hash(String illegalKey) {\n      assertThatExceptionOfType(IllegalSegment.class)\n          .isThrownBy(() -> QueryParamKey.parse(illegalKey))\n          .withMessage(\"Illegal segment: `\" + illegalKey + \"`\")\n          .extracting(IllegalSegment::getIllegalValue)\n          .isEqualTo(illegalKey);\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"key&other\", \"test&test\", \"&\", \"key&\"})\n    void rejects_keys_with_ampersand(String illegalKey) {\n      assertThatExceptionOfType(IllegalSegment.class)\n          .isThrownBy(() -> QueryParamKey.parse(illegalKey))\n          .withMessage(\"Illegal segment: `\" + illegalKey + \"`\")\n          .extracting(IllegalSegment::getIllegalValue)\n          .isEqualTo(illegalKey);\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"key=value\", \"test=test\", \"=\", \"key=\"})\n    void rejects_keys_with_equals(String illegalKey) {\n      assertThatExceptionOfType(IllegalSegment.class)\n          .isThrownBy(() -> QueryParamKey.parse(illegalKey))\n          .withMessage(\"Illegal segment: `\" + illegalKey + \"`\")\n          .extracting(IllegalSegment::getIllegalValue)\n          .isEqualTo(illegalKey);\n    }\n\n    @TestFactory\n    Stream<DynamicTest> invariants() {\n      return StringParserInvariantTests.generateInvariantTests(\n          QueryParamKeyParser.INSTANCE, validKeys);\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<QueryParamKey>> normalisationCases =\n        Stream.of(\n                // Characters that need encoding\n                Pair.of(\"search term\", \"search%20term\"),\n                Pair.of(\"hello world\", \"hello%20world\"),\n                Pair.of(\"test\\\"quote\", \"test%22quote\"),\n                Pair.of(\"test<tag>\", \"test%3Ctag%3E\"),\n                Pair.of(\"test`backtick\", \"test%60backtick\"),\n                Pair.of(\"data{key}\", \"data%7Bkey%7D\"),\n                Pair.of(\"café\", \"caf%C3%A9\"),\n                Pair.of(\"héllo\", \"h%C3%A9llo\"),\n                // Percent encoding normalisation\n                Pair.of(\"%ff\", \"%FF\"),\n                Pair.of(\"%fF\", \"%FF\"),\n                Pair.of(\"%Ff\", \"%FF\"),\n                Pair.of(\"%41\", \"A\"),\n                Pair.of(\"%5A\", \"Z\"),\n                Pair.of(\"%5a\", \"Z\"))\n            .map(\n                testCase ->\n                    new NormalisationCase<>(\n                        QueryParamKey.parse(testCase.getLeft()),\n                        QueryParamKey.parse(testCase.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_key_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(normalisationCases);\n    }\n\n    static final List<String> alreadyNormalisedKeys =\n        List.of(\n            \"\",\n            \"key\",\n            \"key-name\",\n            \"key_name.test~123\",\n            \"key!name\",\n            \"time:12:30\",\n            \"/api/v1\",\n            \"search%20term\",\n            \"caf%C3%A9\",\n            \"test%22quote\");\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedKeys.stream().map(QueryParamKey::parse).toList());\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    static final List<String> keysWithoutPercentEncoding =\n        List.of(\"\", \"key\", \"test-key\", \"key_name.test\", \"time:12:30\", \"/api/v1\");\n\n    @ParameterizedTest\n    @FieldSource(\"keysWithoutPercentEncoding\")\n    void returns_same_string_for_key_without_percent_encoding(String keyString) {\n      QueryParamKey key = QueryParamKey.parse(keyString);\n      assertThat(key.decode()).isEqualTo(keyString);\n    }\n\n    static final List<CodecCase> encodeCases =\n        List.of(\n            new CodecCase(\"search%20term\", \"search term\"),\n            new CodecCase(\"caf%C3%A9\", \"café\"),\n            new CodecCase(\"%C3%A9ric\", \"éric\"),\n            new CodecCase(\"100%25\", \"100%\"),\n            new CodecCase(\"%7B%22key%22:%22value%22%7D\", \"{\\\"key\\\":\\\"value\\\"}\"),\n            new CodecCase(\"hello%20world!\", \"hello world!\"),\n            new CodecCase(\"test%3Ctag%3E\", \"test<tag>\"),\n            new CodecCase(\"test%60backtick\", \"test`backtick\"),\n            new CodecCase(\"key%3Dvalue\", \"key=value\"),\n            new CodecCase(\"a%26b\", \"a&b\"));\n\n    @ParameterizedTest\n    @FieldSource(\"encodeCases\")\n    void encodes_correctly(CodecCase testCase) {\n      var encoded = QueryParamKey.encode(testCase.decoded());\n      assertThat(encoded.toString()).isEqualTo(testCase.encoded());\n      assertThat(encoded.decode()).isEqualTo(testCase.decoded());\n    }\n\n    static final List<CodecCase> decodeCases =\n        List.of(\n            new CodecCase(\"search%20term\", \"search term\"),\n            new CodecCase(\"caf%C3%A9\", \"café\"),\n            new CodecCase(\"%C3%A9ric\", \"éric\"),\n            new CodecCase(\"100%25\", \"100%\"),\n            new CodecCase(\"%7B%22key%22:%22value%22%7D\", \"{\\\"key\\\":\\\"value\\\"}\"),\n            new CodecCase(\"hello%20world%21\", \"hello world!\"),\n            new CodecCase(\"key%3Dvalue\", \"key=value\"),\n            new CodecCase(\"a%26b\", \"a&b\"));\n\n    @ParameterizedTest\n    @FieldSource(\"decodeCases\")\n    void decodes_correctly(CodecCase testCase) {\n      var key = QueryParamKey.parse(testCase.encoded());\n      assertThat(key.decode()).isEqualTo(testCase.decoded());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      var decoded =\n          Stream.concat(decodeCases.stream(), encodeCases.stream())\n              .map(CodecCase::decoded)\n              .collect(Collectors.toSet())\n              .stream()\n              .sorted();\n\n      return generateEncodeDecodeInvariantTests(QueryParamKeyParser.INSTANCE, decoded);\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    @Test\n    void keys_with_same_content_are_equal() {\n      QueryParamKey key1 = QueryParamKey.parse(\"test\");\n      QueryParamKey key2 = QueryParamKey.parse(\"test\");\n      assertThat(key1).isEqualTo(key2);\n    }\n\n    @Test\n    void keys_with_different_content_are_not_equal() {\n      QueryParamKey key1 = QueryParamKey.parse(\"test1\");\n      QueryParamKey key2 = QueryParamKey.parse(\"test2\");\n      assertThat(key1).isNotEqualTo(key2);\n    }\n\n    @Test\n    void keys_with_different_case_are_not_equal() {\n      QueryParamKey key1 = QueryParamKey.parse(\"test\");\n      QueryParamKey key2 = QueryParamKey.parse(\"TEST\");\n      assertThat(key1).isNotEqualTo(key2);\n    }\n\n    @Test\n    void key_is_equal_to_itself() {\n      QueryParamKey key = QueryParamKey.parse(\"test\");\n      assertThat(key).isEqualTo(key);\n    }\n\n    @Test\n    void key_is_not_equal_to_null() {\n      QueryParamKey key = QueryParamKey.parse(\"test\");\n      assertThat(key).isNotEqualTo(null);\n    }\n\n    @Test\n    @SuppressWarnings(\"AssertBetweenInconvertibleTypes\")\n    void key_is_not_equal_to_different_type() {\n      QueryParamKey key = QueryParamKey.parse(\"test\");\n      assertThat(key).isNotEqualTo(\"test\");\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void equal_keys_have_same_hash_code() {\n      QueryParamKey key1 = QueryParamKey.parse(\"test\");\n      QueryParamKey key2 = QueryParamKey.parse(\"test\");\n      assertThat(key1.hashCode()).isEqualTo(key2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      QueryParamKey key = QueryParamKey.parse(\"test-key\");\n      int hashCode1 = key.hashCode();\n      int hashCode2 = key.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class ToStringMethod {\n\n    @Test\n    void to_string_returns_original_key() {\n      String keyString = \"test-key\";\n      QueryParamKey key = QueryParamKey.parse(keyString);\n      assertThat(key.toString()).isEqualTo(keyString);\n    }\n\n    @Test\n    void to_string_preserves_case() {\n      String keyString = \"Test-Key\";\n      QueryParamKey key = QueryParamKey.parse(keyString);\n      assertThat(key.toString()).isEqualTo(keyString);\n    }\n\n    @Test\n    void to_string_preserves_percent_encoding() {\n      String encoded = \"search%20term\";\n      QueryParamKey key = QueryParamKey.parse(encoded);\n      assertThat(key.toString()).isEqualTo(encoded);\n    }\n\n    @Test\n    void to_string_result_can_be_parsed_back() {\n      QueryParamKey original = QueryParamKey.parse(\"test/key\");\n      String stringForm = original.toString();\n      QueryParamKey parsed = QueryParamKey.parse(stringForm);\n      assertThat(parsed).isEqualTo(original);\n      assertThat(parsed.toString()).isEqualTo(stringForm);\n    }\n  }\n\n  @Nested\n  class LengthAndEmpty {\n\n    @Test\n    void length_returns_string_length() {\n      QueryParamKey key = QueryParamKey.parse(\"test\");\n      assertThat(key.length()).isEqualTo(4);\n    }\n\n    @Test\n    void length_includes_percent_encoding() {\n      QueryParamKey key = QueryParamKey.parse(\"a%20b\");\n      assertThat(key.length()).isEqualTo(5);\n    }\n\n    @Test\n    void is_empty_returns_true_for_empty_key() {\n      QueryParamKey key = QueryParamKey.parse(\"\");\n      assertThat(key.isEmpty()).isTrue();\n    }\n\n    @Test\n    void is_empty_returns_false_for_non_empty_key() {\n      QueryParamKey key = QueryParamKey.parse(\"test\");\n      assertThat(key.isEmpty()).isFalse();\n    }\n  }\n\n  @Nested\n  class Initialisation extends AbstractEncodableInitialisationTests {\n    Initialisation() {\n      super(\"org.wiremock.url.QueryParamKey\", EMPTY, \"org.wiremock.url.QueryParamKeyParser\", \"\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/QueryParamValueTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\nclass QueryParamValueTests {\n\n  @Nested\n  class Parse {\n\n    static final List<String> validValues =\n        List.of(\n            // Empty and simple values\n            \"\",\n            \"value\",\n            \"123\",\n\n            // Unreserved characters (alphanumeric, hyphen, period, underscore, tilde)\n            \"value-name\",\n            \"value.name\",\n            \"value_name\",\n            \"value~name\",\n            \"Value123\",\n            \"test-value_123.name~test\",\n\n            // Sub-delimiters (!$'()*+,;=) - note & is not allowed in values\n            \"value!name\",\n            \"value$name\",\n            \"value'name\",\n            \"value(name)\",\n            \"value*name\",\n            \"value+name\",\n            \"value,name\",\n            \"value;name\",\n            \"value=name\",\n            \"a=b=c\",\n\n            // Colon and at-sign\n            \"time:12:30:00\",\n            \"user@example.com\",\n            \"http://example.com\",\n            \"/api/v1/users\",\n\n            // Forward slash and question mark\n            \"/path/to/resource\",\n            \"what?when?where\",\n            \"/search?q=test\",\n\n            // Percent-encoded characters\n            \"%20\",\n            \"search%20term\",\n            \"%2Fapi%2Fv1\",\n            \"%C3%A9ric\",\n            \"caf%C3%A9\",\n            \"%25\",\n\n            // Characters that extend beyond RFC 3986\n            \"{value}\",\n            \"[1,2,3]\",\n            \"<value>\",\n            \"val|ue\",\n            \"val\\\\ue\",\n            \"val^ue\",\n            \"val`ue\",\n\n            // Spaces and special characters (permissive)\n            \"search term\",\n            \"na[me]\",\n            \"<value>\",\n\n            // Complex combinations\n            \"http://example.com:8080/path?q=test\",\n            \"%7B%22key%22:%22value%22%7D\",\n            \"jQuery.ajax\",\n\n            // No separators\n            \"justtext\",\n            \"noseparators123\",\n\n            // Invalid percent encoding (still accepted - permissive parser)\n            \"%\",\n            \"%2\",\n            \"%GG\",\n            \"%ZZvalue\");\n\n    @ParameterizedTest\n    @FieldSource(\"validValues\")\n    void parses_valid_values(String valueString) {\n      QueryParamValue value = QueryParamValue.parse(valueString);\n      assertThat(value.toString()).isEqualTo(valueString);\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"value#fragment\", \"test#test\", \"#\", \"value#\"})\n    void rejects_values_with_hash(String illegalValue) {\n      assertThatExceptionOfType(IllegalSegment.class)\n          .isThrownBy(() -> QueryParamValue.parse(illegalValue))\n          .withMessage(\"Illegal segment: `\" + illegalValue + \"`\")\n          .extracting(IllegalSegment::getIllegalValue)\n          .isEqualTo(illegalValue);\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"value&other\", \"test&test\", \"&\", \"value&\"})\n    void rejects_values_with_ampersand(String illegalValue) {\n      assertThatExceptionOfType(IllegalSegment.class)\n          .isThrownBy(() -> QueryParamValue.parse(illegalValue))\n          .withMessage(\"Illegal segment: `\" + illegalValue + \"`\")\n          .extracting(IllegalSegment::getIllegalValue)\n          .isEqualTo(illegalValue);\n    }\n\n    @TestFactory\n    Stream<DynamicTest> invariants() {\n      return StringParserInvariantTests.generateInvariantTests(\n          QueryParamValueParser.INSTANCE, validValues);\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<QueryParamValue>> normalisationCases =\n        Stream.of(\n                // Characters that need encoding\n                Pair.of(\"search term\", \"search%20term\"),\n                Pair.of(\"hello world\", \"hello%20world\"),\n                Pair.of(\"test\\\"quote\", \"test%22quote\"),\n                Pair.of(\"test<tag>\", \"test%3Ctag%3E\"),\n                Pair.of(\"test`backtick\", \"test%60backtick\"),\n                Pair.of(\"data{value}\", \"data%7Bvalue%7D\"),\n                Pair.of(\"café\", \"caf%C3%A9\"),\n                Pair.of(\"héllo\", \"h%C3%A9llo\"),\n                // Percent encoding normalisation\n                Pair.of(\"%ff\", \"%FF\"),\n                Pair.of(\"%fF\", \"%FF\"),\n                Pair.of(\"%Ff\", \"%FF\"),\n                Pair.of(\"%41\", \"A\"),\n                Pair.of(\"%5A\", \"Z\"),\n                Pair.of(\"%5a\", \"Z\"),\n                // Reserved characters that should be decoded in values\n                Pair.of(\"c%3D2%263=4\", \"c=2%263=4\"))\n            .map(\n                testCase ->\n                    new NormalisationCase<>(\n                        QueryParamValue.parse(testCase.getLeft()),\n                        QueryParamValue.parse(testCase.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_value_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(normalisationCases);\n    }\n\n    static final List<String> alreadyNormalisedValues =\n        List.of(\n            \"\",\n            \"value\",\n            \"value-name\",\n            \"value_name.test~123\",\n            \"value!name\",\n            \"time:12:30\",\n            \"/api/v1\",\n            \"search%20term\",\n            \"caf%C3%A9\",\n            \"test%22quote\",\n            \"c=2%263=4\");\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedValues.stream().map(QueryParamValue::parse).toList());\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    static final List<String> valuesWithoutPercentEncoding =\n        List.of(\"\", \"value\", \"test-value\", \"value_name.test\", \"time:12:30\", \"/api/v1\");\n\n    @ParameterizedTest\n    @FieldSource(\"valuesWithoutPercentEncoding\")\n    void returns_same_string_for_value_without_percent_encoding(String valueString) {\n      QueryParamValue value = QueryParamValue.parse(valueString);\n      assertThat(value.decode()).isEqualTo(valueString);\n    }\n\n    static final List<CodecCase> encodeCases =\n        List.of(\n            new CodecCase(\"search%20term\", \"search term\"),\n            new CodecCase(\"caf%C3%A9\", \"café\"),\n            new CodecCase(\"%C3%A9ric\", \"éric\"),\n            new CodecCase(\"100%25\", \"100%\"),\n            new CodecCase(\"%7B%22key%22:%22value%22%7D\", \"{\\\"key\\\":\\\"value\\\"}\"),\n            new CodecCase(\"hello%20world!\", \"hello world!\"),\n            new CodecCase(\"test%3Ctag%3E\", \"test<tag>\"),\n            new CodecCase(\"test%60backtick\", \"test`backtick\"),\n            new CodecCase(\"c=2%263=4\", \"c=2&3=4\"));\n\n    @ParameterizedTest\n    @FieldSource(\"encodeCases\")\n    void encodes_correctly(CodecCase testCase) {\n      var encoded = QueryParamValue.encode(testCase.decoded());\n      assertThat(encoded.toString()).isEqualTo(testCase.encoded());\n      assertThat(encoded.decode()).isEqualTo(testCase.decoded());\n    }\n\n    static final List<CodecCase> decodeCases =\n        List.of(\n            new CodecCase(\"search%20term\", \"search term\"),\n            new CodecCase(\"caf%C3%A9\", \"café\"),\n            new CodecCase(\"%C3%A9ric\", \"éric\"),\n            new CodecCase(\"100%25\", \"100%\"),\n            new CodecCase(\"%7B%22key%22:%22value%22%7D\", \"{\\\"key\\\":\\\"value\\\"}\"),\n            new CodecCase(\"hello%20world%21\", \"hello world!\"),\n            new CodecCase(\"c%3D2%263=4\", \"c=2&3=4\"));\n\n    @ParameterizedTest\n    @FieldSource(\"decodeCases\")\n    void decodes_correctly(CodecCase testCase) {\n      var value = QueryParamValue.parse(testCase.encoded());\n      assertThat(value.decode()).isEqualTo(testCase.decoded());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      var decoded =\n          Stream.concat(decodeCases.stream(), encodeCases.stream())\n              .map(CodecCase::decoded)\n              .collect(Collectors.toSet())\n              .stream()\n              .sorted();\n\n      return generateEncodeDecodeInvariantTests(QueryParamValueParser.INSTANCE, decoded);\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    @Test\n    void values_with_same_content_are_equal() {\n      QueryParamValue value1 = QueryParamValue.parse(\"test\");\n      QueryParamValue value2 = QueryParamValue.parse(\"test\");\n      assertThat(value1).isEqualTo(value2);\n    }\n\n    @Test\n    void values_with_different_content_are_not_equal() {\n      QueryParamValue value1 = QueryParamValue.parse(\"test1\");\n      QueryParamValue value2 = QueryParamValue.parse(\"test2\");\n      assertThat(value1).isNotEqualTo(value2);\n    }\n\n    @Test\n    void values_with_different_case_are_not_equal() {\n      QueryParamValue value1 = QueryParamValue.parse(\"test\");\n      QueryParamValue value2 = QueryParamValue.parse(\"TEST\");\n      assertThat(value1).isNotEqualTo(value2);\n    }\n\n    @Test\n    void value_is_equal_to_itself() {\n      QueryParamValue value = QueryParamValue.parse(\"test\");\n      assertThat(value).isEqualTo(value);\n    }\n\n    @Test\n    void value_is_not_equal_to_null() {\n      QueryParamValue value = QueryParamValue.parse(\"test\");\n      assertThat(value).isNotEqualTo(null);\n    }\n\n    @Test\n    @SuppressWarnings(\"AssertBetweenInconvertibleTypes\")\n    void value_is_not_equal_to_different_type() {\n      QueryParamValue value = QueryParamValue.parse(\"test\");\n      assertThat(value).isNotEqualTo(\"test\");\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void equal_values_have_same_hash_code() {\n      QueryParamValue value1 = QueryParamValue.parse(\"test\");\n      QueryParamValue value2 = QueryParamValue.parse(\"test\");\n      assertThat(value1.hashCode()).isEqualTo(value2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      QueryParamValue value = QueryParamValue.parse(\"test-value\");\n      int hashCode1 = value.hashCode();\n      int hashCode2 = value.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class ToStringMethod {\n\n    @Test\n    void to_string_returns_original_value() {\n      String valueString = \"test-value\";\n      QueryParamValue value = QueryParamValue.parse(valueString);\n      assertThat(value.toString()).isEqualTo(valueString);\n    }\n\n    @Test\n    void to_string_preserves_case() {\n      String valueString = \"Test-Value\";\n      QueryParamValue value = QueryParamValue.parse(valueString);\n      assertThat(value.toString()).isEqualTo(valueString);\n    }\n\n    @Test\n    void to_string_preserves_percent_encoding() {\n      String encoded = \"search%20term\";\n      QueryParamValue value = QueryParamValue.parse(encoded);\n      assertThat(value.toString()).isEqualTo(encoded);\n    }\n\n    @Test\n    void to_string_result_can_be_parsed_back() {\n      QueryParamValue original = QueryParamValue.parse(\"test/value\");\n      String stringForm = original.toString();\n      QueryParamValue parsed = QueryParamValue.parse(stringForm);\n      assertThat(parsed).isEqualTo(original);\n      assertThat(parsed.toString()).isEqualTo(stringForm);\n    }\n  }\n\n  @Nested\n  class LengthAndEmpty {\n\n    @Test\n    void length_returns_string_length() {\n      QueryParamValue value = QueryParamValue.parse(\"test\");\n      assertThat(value.length()).isEqualTo(4);\n    }\n\n    @Test\n    void length_includes_percent_encoding() {\n      QueryParamValue value = QueryParamValue.parse(\"a%20b\");\n      assertThat(value.length()).isEqualTo(5);\n    }\n\n    @Test\n    void is_empty_returns_true_for_empty_value() {\n      QueryParamValue value = QueryParamValue.parse(\"\");\n      assertThat(value.isEmpty()).isTrue();\n    }\n\n    @Test\n    void is_empty_returns_false_for_non_empty_value() {\n      QueryParamValue value = QueryParamValue.parse(\"test\");\n      assertThat(value.isEmpty()).isFalse();\n    }\n  }\n\n  @Nested\n  class Initialisation extends AbstractEncodableInitialisationTests {\n    Initialisation() {\n      super(\n          \"org.wiremock.url.QueryParamValue\", EMPTY, \"org.wiremock.url.QueryParamValueParser\", \"\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/QueryTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.AbstractMap.SimpleEntry;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.assertj.core.api.Assertions;\nimport org.jspecify.annotations.Nullable;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\n\nclass QueryTests {\n\n  @Nested\n  class Parse {\n\n    static final List<String> validQueries =\n        List.of(\n            // Empty and simple queries\n            \"\",\n            \"q=search\",\n            \"key=value\",\n            \"name=John\",\n            \"id=123\",\n\n            // Multiple parameters\n            \"q=search&page=1\",\n            \"name=John&age=30&city=NYC\",\n            \"a=1&b=2&c=3\",\n\n            // Unreserved characters (alphanumeric, hyphen, period, underscore, tilde)\n            \"query-name=value\",\n            \"query.name=value\",\n            \"query_name=value\",\n            \"query~name=value\",\n            \"Query123=Value456\",\n            \"test-param_123.name~test=result\",\n\n            // Sub-delimiters (!$&'()*+,;=)\n            \"query!name=value\",\n            \"query$name=value\",\n            \"key&key2=value\",\n            \"query'name=value\",\n            \"query(name)=value\",\n            \"query*name=value\",\n            \"query+name=value\",\n            \"query,name=value\",\n            \"query;name=value\",\n            \"key=val=ue\",\n\n            // Colon and at-sign\n            \"time=12:30:00\",\n            \"email=user@example.com\",\n            \"url=http://example.com\",\n            \"path=/api/v1/users\",\n\n            // Forward slash and question mark\n            \"path=/path/to/resource\",\n            \"query=what?when?where\",\n            \"url=/search?q=test\",\n            \"nested=a=b?c=d\",\n\n            // Percent-encoded characters\n            \"%20=value\", // space key\n            \"query=%20\", // space value\n            \"q=search%20term\", // search term\n            \"path=%2Fapi%2Fv1\", // /api/v1\n            \"name=%C3%A9ric\", // éric\n            \"caf%C3%A9=coffee\", // café=coffee\n            \"percent=%25\", // %\n\n            // Empty values\n            \"key=\",\n            \"key1=&key2=\",\n            \"=value\",\n            \"=\",\n\n            // Characters that extend beyond RFC 3986\n            \"key={value}\",\n            \"data=[1,2,3]\",\n            \"path=<value>\",\n            \"pipe=val|ue\",\n            \"back=val\\\\ue\",\n            \"caret=val^ue\",\n            \"grave=val`ue\",\n\n            // Spaces and special characters (permissive)\n            \"q=search term\", // unencoded space\n            \"na[me]=value\", // brackets\n            \"key=<value>\", // angle brackets\n\n            // Complex combinations\n            \"q=test&page=1&limit=10\",\n            \"filter=name:John&sort=date:desc\",\n            \"url=http://example.com:8080/path?q=test\",\n            \"data=%7B%22key%22:%22value%22%7D\", // {\"key\":\"value\"}\n            \"callback=jQuery.ajax&_=1234567890\",\n\n            // No separators\n            \"justtext\",\n            \"noseparators123\",\n\n            // Edge cases\n            \"?nested=question\",\n            \"key=value&&&\",\n            \"===\",\n            \"&&&\",\n\n            // Invalid percent encoding (still accepted - permissive parser)\n            \"q=%\", // incomplete\n            \"key=%2\", // incomplete\n            \"val=%GG\", // invalid hex\n            \"query=%ZZvalue\"); // invalid hex\n\n    @ParameterizedTest\n    @FieldSource(\"validQueries\")\n    void parses_valid_queries(String queryString) {\n      Query query = Query.parse(queryString);\n      assertThat(query.toString()).isEqualTo(queryString);\n    }\n\n    @Test\n    void get_entries_returns_flat_key_value_pairs() {\n      Query parsed = Query.parse(\"x=1&y&x&y=2&z\");\n      assertThat(parsed.getEntries())\n          .isEqualTo(\n              List.of(\n                  flatEntry(\"x\", \"1\"),\n                  flatEntry(\"y\", null),\n                  flatEntry(\"x\", null),\n                  flatEntry(\"y\", \"2\"),\n                  flatEntry(\"z\", null)));\n    }\n\n    @Test\n    void get_entry_set_returns_grouped_entries() {\n      Query parsed = Query.parse(\"x=1&y&x&y=2&z\");\n      assertThat(parsed.asMap())\n          .isEqualTo(Map.ofEntries(entry(\"x\", \"1\", null), entry(\"y\", null, \"2\"), entry(\"z\")));\n    }\n\n    @Test\n    void get_values_by_string_key() {\n      Query parsed = Query.parse(\"x=1&y&x&y=2&z\");\n      assertThat(parsed.get(\"x\")).isEqualTo(values(\"1\", null));\n      assertThat(parsed.getFirst(\"x\")).isEqualTo(QueryParamValue.parse(\"1\"));\n      assertThat(parsed.getFirst(\"y\")).isEqualTo(QueryParamValue.EMPTY);\n      assertThat(parsed.getFirst(\"not_present\")).isNull();\n    }\n\n    @Test\n    void get_values_by_query_param_key() {\n      Query parsed = Query.parse(\"x=1&y&x&y=2&z\");\n      assertThat(parsed.get(QueryParamKey.parse(\"x\"))).isEqualTo(values(\"1\", null));\n      assertThat(parsed.getFirst(QueryParamKey.parse(\"x\"))).isEqualTo(QueryParamValue.parse(\"1\"));\n      assertThat(parsed.getFirst(QueryParamKey.parse(\"y\"))).isEqualTo(QueryParamValue.EMPTY);\n      assertThat(parsed.getFirst(QueryParamKey.parse(\"not_present\"))).isNull();\n    }\n\n    private static final List<Pair<Query, QueryParamKey>> normalisedKeyTestCases =\n        Stream.of(\n                Pair.of(\"a b=c\", \"a b\"),\n                Pair.of(\"a b=c\", \"a%20b\"),\n                Pair.of(\"a b=c\", \"a+b\"),\n                Pair.of(\"a%20b=c\", \"a b\"),\n                Pair.of(\"a%20b=c\", \"a%20b\"),\n                Pair.of(\"a%20b=c\", \"a+b\"),\n                Pair.of(\"a+b=c\", \"a b\"),\n                Pair.of(\"a+b=c\", \"a%20b\"),\n                Pair.of(\"a+b=c\", \"a+b\"))\n            .map(\n                testCase ->\n                    Pair.of(\n                        Query.parse(testCase.getLeft()), QueryParamKey.parse(testCase.getRight())))\n            .toList();\n\n    @ParameterizedTest\n    @FieldSource(\"normalisedKeyTestCases\")\n    void can_get_with_normalised_key(Pair<Query, QueryParamKey> testCase) {\n      var query = testCase.getLeft();\n      var key = testCase.getRight();\n      assertThat(query.get(key)).isEqualTo(List.of(QueryParamValue.parse(\"c\")));\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"normalisedKeyTestCases\")\n    void can_get_first_with_normalised_key(Pair<Query, QueryParamKey> testCase) {\n      var query = testCase.getLeft();\n      var key = testCase.getRight();\n      assertThat(query.getFirst(key)).isEqualTo(QueryParamValue.parse(\"c\"));\n    }\n\n    @Test\n    void get_keys_returns_all_keys() {\n      Query parsed = Query.parse(\"x=1&y&x&y=2&z\");\n      assertThat(parsed.getKeys())\n          .isEqualTo(\n              Set.of(QueryParamKey.parse(\"x\"), QueryParamKey.parse(\"y\"), QueryParamKey.parse(\"z\")));\n    }\n\n    @Test\n    void get_first_with_percent_encoded_key_returns_value() {\n      Query parsed = Query.parse(\"a&b%3D1%262=c%3D2%263=4&\");\n      assertThat(parsed.getFirst(\"a\")).hasToString(\"\");\n      assertThat(parsed.getFirst(\"b=1&2\")).hasToString(\"c%3D2%263=4\");\n    }\n\n    @ParameterizedTest\n    @ValueSource(strings = {\"key=val#ue\", \"query#fragment\", \"#\", \"test#test\"})\n    void rejects_queries_with_hash(String illegalQuery) {\n      assertThatExceptionOfType(IllegalQuery.class)\n          .isThrownBy(() -> Query.parse(illegalQuery))\n          .withMessage(\"Illegal query: `\" + illegalQuery + \"`\")\n          .extracting(IllegalQuery::getIllegalValue)\n          .isEqualTo(illegalQuery);\n    }\n\n    @Test\n    void get_empty_works() {\n      Query parsed = Query.parse(\"\");\n      assertThat(parsed.getEntries()).isEqualTo(List.of());\n      assertThat(parsed.get(\"\")).isEqualTo(List.of());\n      assertThat(parsed.getFirst(\"\")).isEqualTo(null);\n      assertThat(parsed.getKeys()).isEqualTo(Set.of());\n    }\n\n    @Test\n    void get_multiple_empty_works() {\n      Query parsed = Query.parse(\"&\");\n      assertThat(parsed.getEntries()).isEqualTo(List.of(flatEntry(\"\", null), flatEntry(\"\", null)));\n      assertThat(parsed.get(\"\")).isEqualTo(values(null, null));\n      assertThat(parsed.getFirst(\"\")).isEqualTo(QueryParamValue.EMPTY);\n      assertThat(parsed.getKeys()).isEqualTo(Set.of(QueryParamKey.parse(\"\")));\n      assertThat(parsed.contains(\"\")).isTrue();\n    }\n\n    @Test\n    void plus_in_query_decoded_in_query_param_value() {\n      var query = Query.parse(\"a+2=b+1\");\n      assertThat(query).hasToString(\"a+2=b+1\");\n      assertThat(query.decode()).isEqualTo(\"a+2=b+1\");\n\n      var value = query.getFirst(\"a 2\");\n      assertThat(value).hasToString(\"b+1\").extracting(QueryParamValue::decode).isEqualTo(\"b 1\");\n    }\n\n    @Test\n    void as_decoded_map_returns_decoded_keys_and_values() {\n      var query = Query.parse(\"a%20b=c%20d&e+f=g+h&plain=value\");\n      var decoded = query.asDecodedMap();\n      assertThat(decoded)\n          .containsEntry(\"a b\", List.of(\"c d\"))\n          .containsEntry(\"e f\", List.of(\"g h\"))\n          .containsEntry(\"plain\", List.of(\"value\"));\n    }\n\n    @Test\n    void as_decoded_map_groups_multiple_values() {\n      var query = Query.parse(\"key=first&key=second&key=third\");\n      var decoded = query.asDecodedMap();\n      assertThat(decoded).containsEntry(\"key\", List.of(\"first\", \"second\", \"third\"));\n    }\n\n    @Test\n    void as_decoded_map_returns_empty_string_for_null_values() {\n      var query = Query.parse(\"key1&key2=value&key1=second\");\n      var decoded = query.asDecodedMap();\n      assertThat(decoded)\n          .containsEntry(\"key1\", List.of(\"\", \"second\"))\n          .containsEntry(\"key2\", List.of(\"value\"));\n    }\n\n    @Test\n    void can_get_first_decoded() {\n      var query = Query.parse(\"a+b=c\");\n      Assertions.assertThat(query.getFirstDecoded(\"a b\")).isEqualTo(\"c\");\n    }\n\n    @Test\n    void get_first_decoded_returns_empty_string_for_key_without_value() {\n      var query = Query.parse(\"a&a=ignored\");\n      Assertions.assertThat(query.getFirstDecoded(\"a\")).isEqualTo(\"\");\n    }\n\n    @Test\n    void get_decoded_returns_empty_strings_for_keys_without_value() {\n      var query = Query.parse(\"a&a=second&a=\");\n      Assertions.assertThat(query.getDecoded(\"a\")).isEqualTo(List.of(\"\", \"second\", \"\"));\n    }\n\n    @Test\n    void get_decoded_returns_empty_list_for_missing_key() {\n      var query = Query.parse(\"a&a=second&a=\");\n      Assertions.assertThat(query.getDecoded(\"b\")).isEqualTo(List.of());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> invariants() {\n      return StringParserInvariantTests.generateInvariantTests(\n          QueryParser.INSTANCE, Parse.validQueries);\n    }\n\n    private static Map.Entry<QueryParamKey, @Nullable QueryParamValue> flatEntry(\n        String key, @Nullable String value) {\n      return new SimpleEntry<>(QueryParamKey.parse(key), parseOrNull(value));\n    }\n\n    private static Map.Entry<QueryParamKey, List<@Nullable QueryParamValue>> entry(String key) {\n      return entry(key, (String) null);\n    }\n\n    private static Map.Entry<QueryParamKey, List<@Nullable QueryParamValue>> entry(\n        String x, @Nullable String... values) {\n      return new SimpleEntry<>(QueryParamKey.parse(x), values(values));\n    }\n\n    private static @Nullable QueryParamValue parseOrNull(@Nullable String value) {\n      return value != null ? QueryParamValue.parse(value) : null;\n    }\n\n    private static List<@Nullable QueryParamValue> values(@Nullable String... values) {\n      return Arrays.stream(values).map(Parse::parseOrNull).toList();\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"a b\", \"a+b\", \"a%20b\",\n        })\n    void query_param_key_normalises(String input) {\n      var key = QueryParamKey.parse(input);\n      assertThat(key.normalise()).hasToString(\"a%20b\");\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"a b\", \"a+b\", \"a%20b\",\n        })\n    void query_param_value_normalises(String input) {\n      var value = QueryParamValue.parse(input);\n      assertThat(value.normalise()).hasToString(\"a%20b\");\n    }\n\n    record NormalisationCase(String input, String expected) {}\n\n    static final List<NormalisationCase> normalisationCases =\n        List.of(\n            new NormalisationCase(\"q=search term\", \"q=search%20term\"),\n            new NormalisationCase(\"key=value test\", \"key=value%20test\"),\n            new NormalisationCase(\"q=test\\\"quote\", \"q=test%22quote\"),\n            new NormalisationCase(\"data={value}\", \"data=%7Bvalue%7D\"),\n            new NormalisationCase(\"q=test<tag>\", \"q=test%3Ctag%3E\"),\n            new NormalisationCase(\"name=café\", \"name=caf%C3%A9\"),\n            new NormalisationCase(\"%ff\", \"%FF\"),\n            new NormalisationCase(\"%fF\", \"%FF\"),\n            new NormalisationCase(\"%Ff\", \"%FF\"),\n            new NormalisationCase(\"key=}value{\", \"key=%7Dvalue%7B\"));\n\n    static final List<String> alreadyNormalisedQueries =\n        List.of(\n            \"\",\n            \"q=search\",\n            \"key=value\",\n            \"a=1&b=2\",\n            \"query-name=value\",\n            \"time=12:30:00\",\n            \"path=/api/v1\",\n            \"q=search%20term\",\n            \"name=%C3%A9ric\",\n            \"q=test'quote\",\n            \"%41\",\n            \"a&b%3D1%262=c%3D2%263=4&\");\n\n    @TestFactory\n    Stream<DynamicTest> normalises_query_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(\n          normalisationCases.stream()\n              .map(\n                  testCase ->\n                      new NormalisableInvariantTests.NormalisationCase<>(\n                          Query.parse(testCase.input()), Query.parse(testCase.expected())))\n              .toList());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedQueries.stream().map(Query::parse).toList());\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    @Test\n    void encode_double_encodes_percent_signs() {\n      Query encoded = Query.encode(\"a&b%3D1%262=c%3D2%263=4&\");\n      assertThat(encoded.toString()).isEqualTo(\"a&b%253D1%25262=c%253D2%25263=4&\");\n    }\n\n    static final List<String> queriesWithoutPercentEncoding =\n        List.of(\"\", \"q=search\", \"key=value\", \"a=1&b=2\", \"time=12:30:00\", \"path=/api/v1\");\n\n    static final List<CodecCase> decodeCases =\n        List.of(\n            new CodecCase(\"q=search%20term\", \"q=search term\"),\n            new CodecCase(\"name=%C3%A9ric\", \"name=éric\"),\n            new CodecCase(\"caf%C3%A9=coffee\", \"café=coffee\"),\n            new CodecCase(\"percent=%25\", \"percent=%\"),\n            new CodecCase(\"path=%2Fapi%2Fv1\", \"path=/api/v1\"),\n            new CodecCase(\"data=%7B%22key%22:%22value%22%7D\", \"data={\\\"key\\\":\\\"value\\\"}\"),\n            new CodecCase(\"query=%20\", \"query= \"),\n            new CodecCase(\"%20=value\", \" =value\"),\n            new CodecCase(\"a&b%253D1%25262=c%253D2%25263=4&\", \"a&b%3D1%262=c%3D2%263=4&\"),\n            new CodecCase(\"q=hello%20world%21\", \"q=hello world!\"));\n\n    @ParameterizedTest\n    @FieldSource(\"queriesWithoutPercentEncoding\")\n    void returns_same_string_for_query_without_percent_encoding(String queryString) {\n      Query query = Query.parse(queryString);\n      assertThat(query.decode()).isEqualTo(queryString);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"decodeCases\")\n    void decodes_percent_encoded_query_correctly(CodecCase testCase) {\n      Query query = Query.parse(testCase.encoded());\n      assertThat(query.decode()).isEqualTo(testCase.decoded());\n    }\n\n    @Test\n    void encode_does_not_encode_pluses() {\n      Query query = Query.encode(\"a+b\");\n      assertThat(query).hasToString(\"a+b\");\n      assertThat(query.decode()).isEqualTo(\"a+b\");\n    }\n\n    @Test\n    void encode_encodes_spaces_as_percent20() {\n      Query query = Query.encode(\"a b\");\n      assertThat(query).hasToString(\"a%20b\");\n      assertThat(query.decode()).isEqualTo(\"a b\");\n    }\n\n    @Test\n    void query_param_key_encode_encodes_pluses() {\n      var key = QueryParamKey.encode(\"a+b\");\n      assertThat(key).hasToString(\"a%2Bb\");\n      assertThat(key.decode()).isEqualTo(\"a+b\");\n    }\n\n    @Test\n    void query_param_key_encode_encodes_spaces_as_percent20() {\n      var key = QueryParamKey.encode(\"a b\");\n      assertThat(key).hasToString(\"a%20b\");\n      assertThat(key.decode()).isEqualTo(\"a b\");\n    }\n\n    @Test\n    void query_param_key_decode_decodes_pluses_as_spaces() {\n      var key = QueryParamKey.parse(\"a+b\");\n      assertThat(key).hasToString(\"a+b\");\n      assertThat(key.decode()).isEqualTo(\"a b\");\n    }\n\n    @Test\n    void query_param_value_encode_encodes_pluses() {\n      var value = QueryParamValue.encode(\"a+b\");\n      assertThat(value).hasToString(\"a%2Bb\");\n      assertThat(value.decode()).isEqualTo(\"a+b\");\n    }\n\n    @Test\n    void query_param_value_encode_encodes_spaces_as_percent20() {\n      var value = QueryParamValue.encode(\"a b\");\n      assertThat(value).hasToString(\"a%20b\");\n      assertThat(value.decode()).isEqualTo(\"a b\");\n    }\n\n    @Test\n    void query_param_value_decode_decodes_pluses_as_spaces() {\n      var value = QueryParamValue.parse(\"a+b\");\n      assertThat(value).hasToString(\"a+b\");\n      assertThat(value.decode()).isEqualTo(\"a b\");\n    }\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      return generateEncodeDecodeInvariantTests(\n          QueryParser.INSTANCE,\n          Stream.of(\n              \"foo\",\n              \"bar\",\n              \"key=value\",\n              \"hello world\",\n              \"q=café\",\n              \"param1=value1&param2=value2\",\n              \"a&b%3D1%262=c%3D2%263=4&\",\n              \"こんにちは\"));\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    @Test\n    void queries_with_same_value_are_equal() {\n      Query query1 = Query.parse(\"q=search\");\n      Query query2 = Query.parse(\"q=search\");\n      assertThat(query1).isEqualTo(query2);\n    }\n\n    @Test\n    void queries_with_different_values_are_not_equal() {\n      Query query1 = Query.parse(\"q=search1\");\n      Query query2 = Query.parse(\"q=search2\");\n      assertThat(query1).isNotEqualTo(query2);\n    }\n\n    @Test\n    void queries_with_different_case_are_not_equal() {\n      Query query1 = Query.parse(\"q=search\");\n      Query query2 = Query.parse(\"Q=SEARCH\");\n      assertThat(query1).isNotEqualTo(query2);\n    }\n\n    @Test\n    void query_is_equal_to_itself() {\n      Query query = Query.parse(\"q=search\");\n      assertThat(query).isEqualTo(query);\n    }\n\n    @Test\n    void query_is_not_equal_to_null() {\n      Query query = Query.parse(\"q=search\");\n      assertThat(query).isNotEqualTo(null);\n    }\n\n    @Test\n    @SuppressWarnings(\"AssertBetweenInconvertibleTypes\")\n    void query_is_not_equal_to_different_type() {\n      Query query = Query.parse(\"q=search\");\n      assertThat(query).isNotEqualTo(\"q=search\");\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void equal_queries_have_same_hash_code() {\n      Query query1 = Query.parse(\"q=search\");\n      Query query2 = Query.parse(\"q=search\");\n      assertThat(query1.hashCode()).isEqualTo(query2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      Query query = Query.parse(\"q=search&page=1\");\n      int hashCode1 = query.hashCode();\n      int hashCode2 = query.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class ToStringMethod {\n\n    @Test\n    void to_string_returns_original_query() {\n      String queryString = \"q=search&page=1\";\n      Query query = Query.parse(queryString);\n      assertThat(query.toString()).isEqualTo(queryString);\n    }\n\n    @Test\n    void to_string_preserves_case() {\n      String queryString = \"Query=Search\";\n      Query query = Query.parse(queryString);\n      assertThat(query.toString()).isEqualTo(queryString);\n    }\n\n    @Test\n    void to_string_preserves_percent_encoding() {\n      String encoded = \"q=search%20term\";\n      Query query = Query.parse(encoded);\n      assertThat(query.toString()).isEqualTo(encoded);\n    }\n\n    @Test\n    void to_string_result_can_be_parsed_back() {\n      Query original = Query.parse(\"q=test&page=1&limit=10\");\n      String stringForm = original.toString();\n      Query parsed = Query.parse(stringForm);\n      assertThat(parsed).isEqualTo(original);\n      assertThat(parsed.toString()).isEqualTo(stringForm);\n    }\n  }\n\n  @Nested\n  class Builder {\n\n    @Test\n    void builds_empty_query() {\n      Query query = Query.builder().build();\n      assertThat(query.toString()).isEmpty();\n      assertThat(query.getKeys()).isEqualTo(Set.of());\n    }\n\n    @Test\n    void appends_single_key_value_pair_with_strings() {\n      Query query = Query.builder().append(\"key\", \"value\").build();\n      assertThat(query.toString()).isEqualTo(\"key=value\");\n    }\n\n    @Test\n    void appends_single_key_value_pair_with_typed_params() {\n      Query query =\n          Query.builder()\n              .append(QueryParamKey.encode(\"key\"), QueryParamValue.encode(\"value\"))\n              .build();\n      assertThat(query.toString()).isEqualTo(\"key=value\");\n    }\n\n    @Test\n    void appends_key_with_null_value() {\n      Query query = Query.builder().append(\"key\", null).build();\n      assertThat(query.toString()).isEqualTo(\"key\");\n      assertThat(query.getFirst(\"key\")).hasToString(\"\");\n    }\n\n    @Test\n    void appends_multiple_key_value_pairs() {\n      Query query = Query.builder().append(\"a\", \"1\").append(\"b\", \"2\").append(\"c\", \"3\").build();\n      assertThat(query.toString()).isEqualTo(\"a=1&b=2&c=3\");\n    }\n\n    @Test\n    void appends_multiple_values_for_same_key() {\n      Query query = Query.builder().append(\"key\", \"value1\").append(\"key\", \"value2\").build();\n      assertThat(query.toString()).isEqualTo(\"key=value1&key=value2\");\n      assertThat(query.get(\"key\"))\n          .containsExactly(QueryParamValue.parse(\"value1\"), QueryParamValue.parse(\"value2\"));\n    }\n\n    @Test\n    void appends_multiple_values_at_once() {\n      Query query = Query.builder().append(\"key\", \"value1\", \"value2\", \"value3\").build();\n      assertThat(query.toString()).isEqualTo(\"key=value1&key=value2&key=value3\");\n    }\n\n    @Test\n    void appends_values_with_list() {\n      Query query =\n          Query.builder()\n              .append(\n                  QueryParamKey.encode(\"key\"),\n                  List.of(QueryParamValue.encode(\"a\"), QueryParamValue.encode(\"b\")))\n              .build();\n      assertThat(query.toString()).isEqualTo(\"key=a&key=b\");\n    }\n\n    @Test\n    void put_replaces_existing_values() {\n      Query query =\n          Query.builder().append(\"key\", \"old1\").append(\"key\", \"old2\").put(\"key\", \"new\").build();\n      assertThat(query.toString()).isEqualTo(\"key=new\");\n      assertThat(query.get(\"key\")).containsExactly(QueryParamValue.parse(\"new\"));\n    }\n\n    @Test\n    void put_adds_if_key_not_present() {\n      Query query = Query.builder().append(\"other\", \"value\").put(\"key\", \"new\").build();\n      assertThat(query.toString()).isEqualTo(\"other=value&key=new\");\n    }\n\n    @Test\n    void put_with_multiple_values() {\n      Query query = Query.builder().append(\"key\", \"old\").put(\"key\", \"new1\", \"new2\").build();\n      assertThat(query.toString()).isEqualTo(\"key=new1&key=new2\");\n    }\n\n    @Test\n    void put_with_typed_params() {\n      Query query =\n          Query.builder()\n              .append(\"key\", \"old\")\n              .put(QueryParamKey.encode(\"key\"), QueryParamValue.encode(\"new\"))\n              .build();\n      assertThat(query.toString()).isEqualTo(\"key=new\");\n    }\n\n    @Test\n    void remove_by_key_string() {\n      Query query = Query.builder().append(\"a\", \"1\").append(\"b\", \"2\").remove(\"a\").build();\n      assertThat(query.toString()).isEqualTo(\"b=2\");\n      assertThat(query.contains(\"a\")).isFalse();\n    }\n\n    @Test\n    void remove_by_typed_key() {\n      Query query =\n          Query.builder()\n              .append(\"a\", \"1\")\n              .append(\"b\", \"2\")\n              .remove(QueryParamKey.encode(\"a\"))\n              .build();\n      assertThat(query.toString()).isEqualTo(\"b=2\");\n    }\n\n    @Test\n    void remove_all_values_for_key() {\n      Query query =\n          Query.builder()\n              .append(\"key\", \"value1\")\n              .append(\"key\", \"value2\")\n              .append(\"other\", \"x\")\n              .remove(\"key\")\n              .build();\n      assertThat(query.toString()).isEqualTo(\"other=x\");\n    }\n\n    @Test\n    void remove_specific_value_from_key() {\n      Query query =\n          Query.builder()\n              .append(\"key\", \"keep\")\n              .append(\"key\", \"remove\")\n              .append(\"key\", \"also-keep\")\n              .remove(QueryParamKey.encode(\"key\"), List.of(QueryParamValue.encode(\"remove\")))\n              .build();\n      assertThat(query.toString()).isEqualTo(\"key=keep&key=also-keep\");\n    }\n\n    @Test\n    void remove_multiple_specific_values() {\n      Query query =\n          Query.builder()\n              .append(\"key\", \"a\")\n              .append(\"key\", \"b\")\n              .append(\"key\", \"c\")\n              .append(\"key\", \"d\")\n              .remove(\n                  QueryParamKey.encode(\"key\"),\n                  List.of(QueryParamValue.encode(\"b\"), QueryParamValue.encode(\"d\")))\n              .build();\n      assertThat(query.toString()).isEqualTo(\"key=a&key=c\");\n    }\n\n    @Test\n    void remove_with_typed_key_and_value_list() {\n      Query query =\n          Query.builder()\n              .append(\"key\", \"keep\")\n              .append(\"key\", \"remove\")\n              .remove(QueryParamKey.encode(\"key\"), List.of(QueryParamValue.encode(\"remove\")))\n              .build();\n      assertThat(query.toString()).isEqualTo(\"key=keep\");\n    }\n\n    @Test\n    void remove_nonexistent_key_is_no_op() {\n      Query query = Query.builder().append(\"a\", \"1\").remove(\"nonexistent\").build();\n      assertThat(query.toString()).isEqualTo(\"a=1\");\n    }\n\n    @Test\n    void remove_with_string_key_and_specific_value() {\n      Query query =\n          Query.builder()\n              .append(\"key\", \"keep\")\n              .append(\"key\", \"remove\")\n              .append(\"key\", \"also-keep\")\n              .remove(\"key\", \"remove\")\n              .build();\n      assertThat(query.toString()).isEqualTo(\"key=keep&key=also-keep\");\n    }\n\n    @Test\n    void remove_with_string_key_and_multiple_specific_values() {\n      Query query =\n          Query.builder()\n              .append(\"key\", \"a\")\n              .append(\"key\", \"b\")\n              .append(\"key\", \"c\")\n              .append(\"key\", \"d\")\n              .remove(\"key\", \"b\", \"d\")\n              .build();\n      assertThat(query.toString()).isEqualTo(\"key=a&key=c\");\n    }\n\n    @Test\n    void remove_with_typed_key_and_varargs_values() {\n      Query query =\n          Query.builder()\n              .append(\"key\", \"keep\")\n              .append(\"key\", \"remove\")\n              .remove(QueryParamKey.encode(\"key\"), QueryParamValue.encode(\"remove\"))\n              .build();\n      assertThat(query.toString()).isEqualTo(\"key=keep\");\n    }\n\n    @Test\n    void encodes_special_characters_in_keys() {\n      Query query = Query.builder().append(\"key=with=equals\", \"value\").build();\n      assertThat(query.toString()).isEqualTo(\"key%3Dwith%3Dequals=value\");\n    }\n\n    @Test\n    void encodes_special_characters_in_values() {\n      Query query = Query.builder().append(\"key\", \"value&with&ampersands\").build();\n      assertThat(query.toString()).isEqualTo(\"key=value%26with%26ampersands\");\n    }\n\n    @Test\n    void chained_operations() {\n      Query query =\n          Query.builder()\n              .append(\"a\", \"1\")\n              .append(\"b\", \"2\")\n              .append(\"c\", \"3\")\n              .put(\"b\", \"replaced\")\n              .remove(\"c\")\n              .append(\"d\", \"4\")\n              .build();\n      assertThat(query.toString()).isEqualTo(\"a=1&b=replaced&d=4\");\n    }\n\n    @Test\n    void builder_is_reusable_for_multiple_builds() {\n      Query.Builder builder = Query.builder().append(\"shared\", \"value\");\n\n      Query query1 = builder.append(\"extra1\", \"a\").build();\n      // Note: builder state is modified, so this tests current behavior\n      Query query2 = builder.append(\"extra2\", \"b\").build();\n\n      assertThat(query1.contains(\"shared\")).isTrue();\n      assertThat(query2.contains(\"shared\")).isTrue();\n    }\n  }\n\n  @Nested\n  class Empty {\n\n    @Test\n    void empty_constant_has_empty_string_representation() {\n      assertThat(Query.EMPTY.toString()).isEmpty();\n    }\n\n    @Test\n    void empty_constant_has_no_keys() {\n      assertThat(Query.EMPTY.getKeys()).isEqualTo(Set.of());\n    }\n\n    @Test\n    void empty_constant_equals_parsed_empty_string() {\n      assertThat(Query.EMPTY).isEqualTo(Query.parse(\"\"));\n    }\n\n    @Test\n    void empty_constant_equals_builder_built_empty() {\n      assertThat(Query.EMPTY).isEqualTo(Query.builder().build());\n    }\n  }\n\n  @Nested\n  class With {\n\n    @Test\n    void with_adds_param_to_existing_query() {\n      Query original = Query.parse(\"a=1\");\n      Query updated =\n          original.with(QueryParamKey.encode(\"b\"), List.of(QueryParamValue.encode(\"2\")));\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2\");\n    }\n\n    @Test\n    void with_preserves_original_query() {\n      Query original = Query.parse(\"a=1\");\n      original.with(QueryParamKey.encode(\"b\"), List.of(QueryParamValue.encode(\"2\")));\n      assertThat(original.toString()).isEqualTo(\"a=1\");\n    }\n\n    @Test\n    void with_adds_multiple_values_for_same_key() {\n      Query original = Query.parse(\"a=1\");\n      Query updated =\n          original\n              .with(QueryParamKey.encode(\"b\"), List.of(QueryParamValue.encode(\"2\")))\n              .with(QueryParamKey.encode(\"b\"), List.of(QueryParamValue.encode(\"3\")));\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2&b=3\");\n    }\n\n    @Test\n    void with_adds_null_value() {\n      Query original = Query.parse(\"a=1\");\n      List<@Nullable QueryParamValue> nullValue = Collections.singletonList(null);\n      Query updated = original.with(QueryParamKey.encode(\"b\"), nullValue);\n      assertThat(updated.toString()).isEqualTo(\"a=1&b\");\n    }\n\n    @Test\n    void with_list_of_values() {\n      Query original = Query.parse(\"a=1\");\n      Query updated =\n          original.with(\n              QueryParamKey.encode(\"b\"),\n              List.of(QueryParamValue.encode(\"2\"), QueryParamValue.encode(\"3\")));\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2&b=3\");\n    }\n\n    @Test\n    void with_encodes_special_characters() {\n      Query original = Query.parse(\"a=1\");\n      Query updated =\n          original.with(\n              QueryParamKey.encode(\"key=special\"),\n              List.of(QueryParamValue.encode(\"value&special\")));\n      assertThat(updated.toString()).isEqualTo(\"a=1&key%3Dspecial=value%26special\");\n    }\n\n    @Test\n    void with_string_key_and_value() {\n      Query original = Query.parse(\"a=1\");\n      Query updated = original.with(\"b\", \"2\");\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2\");\n    }\n\n    @Test\n    void with_string_key_and_multiple_values() {\n      Query original = Query.parse(\"a=1\");\n      Query updated = original.with(\"b\", \"2\", \"3\", \"4\");\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2&b=3&b=4\");\n    }\n\n    @Test\n    void with_string_key_and_null_value() {\n      Query original = Query.parse(\"a=1\");\n      Query updated = original.with(\"b\", null);\n      assertThat(updated.toString()).isEqualTo(\"a=1&b\");\n    }\n\n    @Test\n    void with_typed_key_and_varargs_values() {\n      Query original = Query.parse(\"a=1\");\n      Query updated =\n          original.with(\n              QueryParamKey.encode(\"b\"), QueryParamValue.encode(\"2\"), QueryParamValue.encode(\"3\"));\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2&b=3\");\n    }\n  }\n\n  @Nested\n  class Replace {\n\n    @Test\n    void replace_replaces_existing_param() {\n      Query original = Query.parse(\"a=1&b=2\");\n      Query updated =\n          original.replace(QueryParamKey.encode(\"a\"), List.of(QueryParamValue.encode(\"new\")));\n      assertThat(updated.toString()).isEqualTo(\"b=2&a=new\");\n    }\n\n    @Test\n    void replace_preserves_original_query() {\n      Query original = Query.parse(\"a=1\");\n      original.replace(QueryParamKey.encode(\"a\"), List.of(QueryParamValue.encode(\"new\")));\n      assertThat(original.toString()).isEqualTo(\"a=1\");\n    }\n\n    @Test\n    void replace_adds_if_key_not_present() {\n      Query original = Query.parse(\"a=1\");\n      Query updated =\n          original.replace(QueryParamKey.encode(\"b\"), List.of(QueryParamValue.encode(\"2\")));\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2\");\n    }\n\n    @Test\n    void replace_replaces_all_values_for_key() {\n      Query original = Query.parse(\"a=1&a=2&a=3&b=x\");\n      Query updated =\n          original.replace(QueryParamKey.encode(\"a\"), List.of(QueryParamValue.encode(\"new\")));\n      assertThat(updated.toString()).isEqualTo(\"b=x&a=new\");\n      assertThat(updated.get(\"a\")).containsExactly(QueryParamValue.parse(\"new\"));\n    }\n\n    @Test\n    void replace_with_multiple_values() {\n      Query original = Query.parse(\"a=1&b=2\");\n      Query updated =\n          original.replace(\n              QueryParamKey.encode(\"a\"),\n              List.of(\n                  QueryParamValue.encode(\"x\"),\n                  QueryParamValue.encode(\"y\"),\n                  QueryParamValue.encode(\"z\")));\n      assertThat(updated.get(\"a\"))\n          .containsExactly(\n              QueryParamValue.parse(\"x\"), QueryParamValue.parse(\"y\"), QueryParamValue.parse(\"z\"));\n    }\n\n    @Test\n    void replace_with_list_of_values() {\n      Query original = Query.parse(\"a=1\");\n      Query updated =\n          original.replace(\n              QueryParamKey.encode(\"a\"),\n              List.of(QueryParamValue.encode(\"x\"), QueryParamValue.encode(\"y\")));\n      assertThat(updated.get(\"a\"))\n          .containsExactly(QueryParamValue.parse(\"x\"), QueryParamValue.parse(\"y\"));\n    }\n\n    @Test\n    void replace_with_string_key_and_value() {\n      Query original = Query.parse(\"a=1&b=2\");\n      Query updated = original.replace(\"a\", \"new\");\n      assertThat(updated.toString()).isEqualTo(\"b=2&a=new\");\n    }\n\n    @Test\n    void replace_with_string_key_and_multiple_values() {\n      Query original = Query.parse(\"a=1&b=2\");\n      Query updated = original.replace(\"a\", \"x\", \"y\", \"z\");\n      assertThat(updated.get(\"a\"))\n          .containsExactly(\n              QueryParamValue.parse(\"x\"), QueryParamValue.parse(\"y\"), QueryParamValue.parse(\"z\"));\n    }\n\n    @Test\n    void replace_with_typed_key_and_varargs_values() {\n      Query original = Query.parse(\"a=1\");\n      Query updated =\n          original.replace(\n              QueryParamKey.encode(\"a\"), QueryParamValue.encode(\"x\"), QueryParamValue.encode(\"y\"));\n      assertThat(updated.get(\"a\"))\n          .containsExactly(QueryParamValue.parse(\"x\"), QueryParamValue.parse(\"y\"));\n    }\n  }\n\n  @Nested\n  class Without {\n\n    @Test\n    void without_removes_param_by_key() {\n      Query original = Query.parse(\"a=1&b=2&c=3\");\n      Query updated = original.without(\"b\");\n      assertThat(updated.toString()).isEqualTo(\"a=1&c=3\");\n    }\n\n    @Test\n    void without_preserves_original_query() {\n      Query original = Query.parse(\"a=1&b=2\");\n      original.without(\"a\");\n      assertThat(original.toString()).isEqualTo(\"a=1&b=2\");\n    }\n\n    @Test\n    void without_removes_all_values_for_key() {\n      Query original = Query.parse(\"a=1&a=2&a=3&b=x\");\n      Query updated = original.without(\"a\");\n      assertThat(updated.toString()).isEqualTo(\"b=x\");\n      assertThat(updated.contains(\"a\")).isFalse();\n    }\n\n    @Test\n    void without_nonexistent_key_returns_equivalent_query() {\n      Query original = Query.parse(\"a=1&b=2\");\n      Query updated = original.without(\"nonexistent\");\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2\");\n    }\n\n    @Test\n    void without_typed_key() {\n      Query original = Query.parse(\"a=1&b=2\");\n      Query updated = original.without(QueryParamKey.encode(\"a\"));\n      assertThat(updated.toString()).isEqualTo(\"b=2\");\n    }\n\n    @Test\n    void without_specific_value() {\n      Query original = Query.parse(\"a=1&a=2&a=3\");\n      Query updated =\n          original.without(QueryParamKey.encode(\"a\"), List.of(QueryParamValue.encode(\"2\")));\n      assertThat(updated.toString()).isEqualTo(\"a=1&a=3\");\n    }\n\n    @Test\n    void without_multiple_specific_values() {\n      Query original = Query.parse(\"a=1&a=2&a=3&a=4\");\n      Query updated =\n          original.without(\n              QueryParamKey.encode(\"a\"),\n              List.of(QueryParamValue.encode(\"2\"), QueryParamValue.encode(\"4\")));\n      assertThat(updated.toString()).isEqualTo(\"a=1&a=3\");\n    }\n\n    @Test\n    void without_string_key_and_specific_value() {\n      Query original = Query.parse(\"a=1&a=2&a=3\");\n      Query updated = original.without(\"a\", \"2\");\n      assertThat(updated.toString()).isEqualTo(\"a=1&a=3\");\n    }\n\n    @Test\n    void without_string_key_and_multiple_specific_values() {\n      Query original = Query.parse(\"a=1&a=2&a=3&a=4\");\n      Query updated = original.without(\"a\", \"2\", \"4\");\n      assertThat(updated.toString()).isEqualTo(\"a=1&a=3\");\n    }\n\n    @Test\n    void without_typed_key_and_varargs_values() {\n      Query original = Query.parse(\"a=1&a=2&a=3\");\n      Query updated =\n          original.without(\n              QueryParamKey.encode(\"a\"), QueryParamValue.encode(\"2\"), QueryParamValue.encode(\"3\"));\n      assertThat(updated.toString()).isEqualTo(\"a=1\");\n    }\n  }\n\n  @Nested\n  class Thaw {\n\n    @Test\n    void thaw_returns_builder_with_same_content() {\n      Query original = Query.parse(\"a=1&b=2\");\n      Query.Builder builder = original.thaw();\n      Query rebuilt = builder.build();\n      assertThat(rebuilt).isEqualTo(original);\n    }\n\n    @Test\n    void thaw_builder_can_be_modified() {\n      Query original = Query.parse(\"a=1\");\n      Query.Builder builder = original.thaw();\n      builder.append(\"b\", \"2\");\n      Query updated = builder.build();\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2\");\n    }\n\n    @Test\n    void thaw_does_not_modify_original() {\n      Query original = Query.parse(\"a=1\");\n      Query.Builder builder = original.thaw();\n      builder.append(\"b\", \"2\");\n      builder.build();\n      assertThat(original.toString()).isEqualTo(\"a=1\");\n    }\n\n    @Test\n    void thaw_empty_query() {\n      Query original = Query.parse(\"\");\n      Query.Builder builder = original.thaw();\n      builder.append(\"a\", \"1\");\n      Query updated = builder.build();\n      assertThat(updated.toString()).isEqualTo(\"a=1\");\n    }\n  }\n\n  @Nested\n  class Transform {\n\n    @Test\n    void transform_applies_modification() {\n      Query original = Query.parse(\"a=1\");\n      Query updated = original.transform(b -> b.append(\"b\", \"2\"));\n      assertThat(updated.toString()).isEqualTo(\"a=1&b=2\");\n    }\n\n    @Test\n    void transform_preserves_original() {\n      Query original = Query.parse(\"a=1\");\n      original.transform(b -> b.append(\"b\", \"2\"));\n      assertThat(original.toString()).isEqualTo(\"a=1\");\n    }\n\n    @Test\n    void transform_with_multiple_operations() {\n      Query original = Query.parse(\"a=1&b=2&c=3\");\n      Query updated =\n          original.transform(\n              b -> {\n                b.remove(\"b\");\n                b.put(\"a\", \"replaced\");\n                b.append(\"d\", \"4\");\n              });\n      assertThat(updated.toString()).isEqualTo(\"c=3&a=replaced&d=4\");\n    }\n\n    @Test\n    void transform_can_clear_and_rebuild() {\n      Query original = Query.parse(\"a=1&b=2\");\n      Query updated =\n          original.transform(\n              b -> {\n                b.remove(\"a\");\n                b.remove(\"b\");\n                b.append(\"x\", \"new\");\n              });\n      assertThat(updated.toString()).isEqualTo(\"x=new\");\n    }\n\n    @Test\n    void transform_chained() {\n      Query original = Query.parse(\"a=1\");\n      Query updated =\n          original\n              .transform(b -> b.append(\"b\", \"2\"))\n              .transform(b -> b.append(\"c\", \"3\"))\n              .transform(b -> b.remove(\"a\"));\n      assertThat(updated.toString()).isEqualTo(\"b=2&c=3\");\n    }\n  }\n\n  @Nested\n  class Initialisation extends AbstractEncodableInitialisationTests {\n    Initialisation() {\n      super(\"org.wiremock.url.Query\", EMPTY, \"org.wiremock.url.QueryParser\", \"\");\n    }\n\n    @Test\n    @SuppressWarnings(\"DataFlowIssue\")\n    void buildEmptyWorks() throws Throwable {\n      try (IsolatedClassLoader classLoader = new IsolatedClassLoader()) {\n        var emptyQuery =\n            classLoader.load(\"org.wiremock.url.Query\").invoke(\"builder\").invoke(\"build\");\n        assertThat(emptyQuery).hasToString(\"\");\n\n        assertStaticFieldInitialised(classLoader);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/RelativeUrlTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\nimport static org.wiremock.url.Lists.concat;\nimport static org.wiremock.url.SchemeRegistry.file;\nimport static org.wiremock.url.SchemeRegistry.https;\nimport static org.wiremock.url.UrlTests.Parse.illegalUrls;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\n\nclass RelativeUrlTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void parses_relative_url_with_authority_correctly() {\n      var relativeUrl = RelativeUrl.parse(\"//example.com/path?query#fragment\");\n\n      assertThat(relativeUrl.toString()).isEqualTo(\"//example.com/path?query#fragment\");\n      assertThat(relativeUrl).isInstanceOf(RelativeUrl.class);\n      assertThat(relativeUrl).isNotInstanceOf(PathAndQuery.class);\n\n      assertThat(relativeUrl.getScheme()).isNull();\n\n      assertThat(relativeUrl.getAuthority()).isEqualTo(Authority.parse(\"example.com\"));\n      assertThat(relativeUrl.getUserInfo()).isNull();\n      assertThat(relativeUrl.getHost()).isEqualTo(Host.parse(\"example.com\"));\n      assertThat(relativeUrl.getPort()).isNull();\n\n      assertThat(relativeUrl.getPath()).isEqualTo(Path.parse(\"/path\"));\n      assertThat(relativeUrl.getQuery()).isEqualTo(Query.parse(\"query\"));\n\n      assertThat(relativeUrl.getFragment()).isEqualTo(Fragment.parse(\"fragment\"));\n\n      assertThat(relativeUrl.isAbsolute()).isFalse();\n      assertThat(relativeUrl.isRelative()).isTrue();\n      assertThat(relativeUrl.isAbsoluteUrl()).isFalse();\n      assertThat(relativeUrl.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void parses_relative_url_without_authority_correctly() {\n      var relativeUrl = RelativeUrl.parse(\"/path?query#fragment\");\n\n      assertThat(relativeUrl.toString()).isEqualTo(\"/path?query#fragment\");\n      assertThat(relativeUrl).isInstanceOf(RelativeUrl.class);\n      assertThat(relativeUrl).isNotInstanceOf(PathAndQuery.class);\n\n      assertThat(relativeUrl.getScheme()).isNull();\n\n      assertThat(relativeUrl.getAuthority()).isNull();\n      assertThat(relativeUrl.getUserInfo()).isNull();\n      assertThat(relativeUrl.getHost()).isNull();\n      assertThat(relativeUrl.getPort()).isNull();\n\n      assertThat(relativeUrl.getPath()).isEqualTo(Path.parse(\"/path\"));\n      assertThat(relativeUrl.getQuery()).isEqualTo(Query.parse(\"query\"));\n\n      assertThat(relativeUrl.getFragment()).isEqualTo(Fragment.parse(\"fragment\"));\n\n      assertThat(relativeUrl.isAbsolute()).isFalse();\n      assertThat(relativeUrl.isRelative()).isTrue();\n      assertThat(relativeUrl.isAbsoluteUrl()).isFalse();\n      assertThat(relativeUrl.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void parses_path_and_query_correctly() {\n      var pathAndQuery = RelativeUrl.parse(\"/path?query\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"/path?query\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_relative_path_correctly() {\n      var relativeUrl = RelativeUrl.parse(\"relative\");\n\n      assertThat(relativeUrl).hasToString(\"relative\");\n      assertThat(relativeUrl).isInstanceOf(RelativeUrl.class);\n      assertThat(relativeUrl.getPath()).hasToString(\"relative\");\n    }\n\n    @Test\n    void parses_empty_path_correctly() {\n      var pathAndQuery = RelativeUrl.parse(\"\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_query_only_correctly() {\n      var pathAndQuery = RelativeUrl.parse(\"?\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"?\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_fragment_only_correctly() {\n      var pathAndQuery = RelativeUrl.parse(\"#\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"#\");\n      assertThat(pathAndQuery).isInstanceOf(RelativeUrl.class);\n      assertThat(pathAndQuery).isNotInstanceOf(PathAndQuery.class);\n\n      assertThat(pathAndQuery.getScheme()).isNull();\n\n      assertThat(pathAndQuery.getAuthority()).isNull();\n      assertThat(pathAndQuery.getUserInfo()).isNull();\n      assertThat(pathAndQuery.getHost()).isNull();\n      assertThat(pathAndQuery.getPort()).isNull();\n\n      assertThat(pathAndQuery.getPath()).isEqualTo(Path.EMPTY);\n      assertThat(pathAndQuery.getQuery()).isNull();\n\n      assertThat(pathAndQuery.getFragment()).isEqualTo(Fragment.parse(\"\"));\n\n      assertThat(pathAndQuery.isAbsolute()).isFalse();\n      assertThat(pathAndQuery.isRelative()).isTrue();\n      assertThat(pathAndQuery.isAbsoluteUrl()).isFalse();\n      assertThat(pathAndQuery.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void rejects_illegal_uri() {\n      IllegalUri exception =\n          assertThatExceptionOfType(IllegalUri.class)\n              .isThrownBy(() -> RelativeUrl.parse(\"not a :uri\"))\n              .actual();\n      assertThat(exception.getMessage()).isEqualTo(\"Illegal uri: `not a :uri`\");\n      assertThat(exception.getIllegalValue()).isEqualTo(\"not a :uri\");\n\n      IllegalScheme cause =\n          assertThat(exception.getCause()).asInstanceOf(type(IllegalScheme.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\"Illegal scheme `not a `; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n      assertThat(cause.getIllegalValue()).isEqualTo(\"not a \");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    static final List<? extends String> illegalRelativeUrls =\n        concat(\n            illegalUrls,\n            List.of(\n                \"https://example.com/path?query#fragment\",\n                \"https://user@example.com/path?query#fragment\",\n                \"https://example.com/path?query\",\n                \"https://example.com\"));\n\n    @ParameterizedTest\n    @FieldSource(\"illegalRelativeUrls\")\n    void rejects_illegal_relative_url(String illegalRelativeUrl) {\n      assertThatExceptionOfType(IllegalRelativeUrl.class)\n          .isThrownBy(() -> RelativeUrl.parse(illegalRelativeUrl))\n          .withMessage(\"Illegal relative url: `\" + illegalRelativeUrl + \"`\")\n          .extracting(IllegalRelativeUrl::getIllegalValue)\n          .isEqualTo(illegalRelativeUrl);\n    }\n  }\n\n  @Nested\n  class Transform {\n\n    @Test\n    void can_transform_a_relative_url() {\n      RelativeUrl base = RelativeUrl.parse(\"//example.com/path\");\n      Url transformed = base.transform(b -> b.setScheme(https).setQuery(Query.parse(\"a=b\")));\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .hasToString(\"https://example.com/path?a=b\");\n    }\n\n    @Test\n    void can_transform_a_path_and_query() {\n      RelativeUrl base = RelativeUrl.parse(\"/path?a=b\");\n      Url transformed =\n          base.transform(b -> b.setScheme(https).setAuthority(Authority.parse(\"example.com\")));\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .hasToString(\"https://example.com/path?a=b\");\n    }\n\n    @Test\n    void can_pointlessly_set_scheme_to_null() {\n      var url = RelativeUrl.parse(\"//example.com/path#fragment\");\n      Url transformed = url.thaw().setScheme(null).build();\n      assertThat(transformed).isInstanceOf(SchemeRelativeUrl.class).isEqualTo(url);\n    }\n\n    @Test\n    void can_set_authority_to_null() {\n      var url = RelativeUrl.parse(\"//example.com/path#fragment\");\n      Url transformed = url.thaw().setAuthority(null).build();\n      assertThat(transformed)\n          .isInstanceOf(RelativeUrl.class)\n          .isEqualTo(RelativeUrl.parse(\"/path#fragment\"));\n    }\n\n    @Test\n    void cannot_set_scheme_without_authority() {\n\n      RelativeUrl url = RelativeUrl.parse(\"/path?query#fragment\");\n      assertThatExceptionOfType(IllegalUrl.class)\n          .isThrownBy(() -> url.transform(it -> it.setScheme(file)))\n          .withMessage(\"Illegal url: `file:/path?query#fragment`; a url has an authority\")\n          .withNoCause()\n          .extracting(IllegalUrl::getIllegalValue)\n          .isEqualTo(\"file:/path?query#fragment\");\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"/path?query#fragment\",\n          \"/path?query\",\n          \"/path\",\n        })\n    void cannot_set_path_with_colon_in_first_segment_when_no_authority() {\n      RelativeUrl url = RelativeUrl.parse(\"/path?query#fragment\");\n      assertThatExceptionOfType(IllegalRelativeUrl.class)\n          .isThrownBy(() -> url.transform(it -> it.setPath(Path.parse(\"foo:bar\"))))\n          .withMessage(\n              \"Illegal relative url: `foo:bar?query#fragment` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\")\n          .extracting(IllegalRelativeUrl::getIllegalValue)\n          .isEqualTo(\"foo:bar?query#fragment\");\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"//\", \"///\", \"//foo\", \"//foo/\", \"///foo/\",\n        })\n    void cannot_set_path_with_double_slash_when_no_authority(String illegalPath) {\n      RelativeUrl url = RelativeUrl.parse(\"/path?query#fragment\");\n      assertThatExceptionOfType(IllegalRelativeUrl.class)\n          .isThrownBy(() -> url.transform(it -> it.setPath(Path.parse(illegalPath))))\n          .withMessage(\n              \"Illegal relative url: `\"\n                  + illegalPath\n                  + \"?query#fragment` - a relative url without authority's path may not start with //, as that would make the first segment an authority\")\n          .extracting(IllegalRelativeUrl::getIllegalValue)\n          .isEqualTo(illegalPath + \"?query#fragment\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/Rfc3986Validator.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport java.util.regex.Pattern;\n\n/**\n * A strict RFC 3986 URI-reference validator.\n *\n * <p>This validates the syntax defined <a\n * href=\"https://www.rfc-editor.org/rfc/rfc3986#appendix-A\">RFC 3986 Appendix A.</a>\n *\n * <p>Key grammar rules implemented:\n *\n * <p>URI-reference = URI / relative-ref URI = scheme \":\" hier-part [ \"?\" query ] [ \"#\" fragment ]\n * relative-ref = relative-part [ \"?\" query ] [ \"#\" fragment ]\n *\n * <p>hier-part = \"//\" authority path-abempty / path-absolute / path-rootless / path-empty\n *\n * <p>authority = [ userinfo \"@\" ] host [ \":\" port ] host = IP-literal / IPv4address / reg-name\n * IP-literal = \"[\" ( IPv6address / IPvFuture ) \"]\"\n */\npublic final class Rfc3986Validator {\n\n  private Rfc3986Validator() {}\n\n  // ===========================================\n  // Character classes (RFC 3986 Section 2)\n  // ===========================================\n\n  // ALPHA = A-Za-z\n  private static final String ALPHA = \"A-Za-z\";\n\n  // DIGIT = 0-9\n  private static final String DIGIT = \"0-9\";\n\n  // HEXDIG = DIGIT / \"A\" / \"B\" / \"C\" / \"D\" / \"E\" / \"F\" (case-insensitive)\n  private static final String HEXDIG = \"0-9A-Fa-f\";\n\n  // unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n  private static final String UNRESERVED = ALPHA + DIGIT + \"\\\\-._~\";\n\n  // sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\" / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n  private static final String SUB_DELIMS = \"!$&'()*+,;=\";\n\n  // pct-encoded = \"%\" HEXDIG HEXDIG\n  private static final String PCT_ENCODED = \"%[\" + HEXDIG + \"]{2}\";\n\n  // ===========================================\n  // URI Components\n  // ===========================================\n\n  // scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n  private static final String SCHEME = \"[\" + ALPHA + \"][\" + ALPHA + DIGIT + \"+\\\\-.]*\";\n\n  // userinfo = *( unreserved / pct-encoded / sub-delims / \":\" )\n  private static final String USERINFO_CHAR = \"[\" + UNRESERVED + SUB_DELIMS + \":]\";\n  private static final String USERINFO = \"(?:\" + USERINFO_CHAR + \"|\" + PCT_ENCODED + \")*\";\n\n  // ===========================================\n  // IP Address Validation (the hard part)\n  // ===========================================\n\n  // dec-octet: 0-255\n  // dec-octet = DIGIT                 ; 0-9\n  //           / %x31-39 DIGIT         ; 10-99\n  //           / \"1\" 2DIGIT            ; 100-199\n  //           / \"2\" %x30-34 DIGIT     ; 200-249\n  //           / \"25\" %x30-35          ; 250-255\n  private static final String DEC_OCTET = \"(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\";\n\n  // IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet\n  private static final String IPV4_ADDRESS =\n      DEC_OCTET + \"\\\\.\" + DEC_OCTET + \"\\\\.\" + DEC_OCTET + \"\\\\.\" + DEC_OCTET;\n\n  // h16 = 1*4HEXDIG\n  private static final String H16 = \"[\" + HEXDIG + \"]{1,4}\";\n\n  // ls32 = ( h16 \":\" h16 ) / IPv4address\n  private static final String LS32 = \"(?:\" + H16 + \":\" + H16 + \"|\" + IPV4_ADDRESS + \")\";\n\n  // IPv6address =                            6( h16 \":\" ) ls32\n  //             /                       \"::\" 5( h16 \":\" ) ls32\n  //             / [               h16 ] \"::\" 4( h16 \":\" ) ls32\n  //             / [ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n  //             / [ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n  //             / [ *3( h16 \":\" ) h16 ] \"::\"    h16 \":\"   ls32\n  //             / [ *4( h16 \":\" ) h16 ] \"::\"              ls32\n  //             / [ *5( h16 \":\" ) h16 ] \"::\"              h16\n  //             / [ *6( h16 \":\" ) h16 ] \"::\"\n  private static final String IPV6_ADDRESS = buildIpv6Pattern();\n\n  private static String buildIpv6Pattern() {\n    String h16c = H16 + \":\"; // h16 followed by colon\n\n    // Build each alternative\n    String[] alts = {\n      // 6( h16 \":\" ) ls32\n      \"(?:\" + h16c + \"){6}\" + LS32,\n\n      // \"::\" 5( h16 \":\" ) ls32\n      \"::(?:\" + h16c + \"){5}\" + LS32,\n\n      // [ h16 ] \"::\" 4( h16 \":\" ) ls32\n      \"(?:\" + H16 + \")?::(?:\" + h16c + \"){4}\" + LS32,\n\n      // [ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n      \"(?:(?:\" + h16c + \"){0,1}\" + H16 + \")?::(?:\" + h16c + \"){3}\" + LS32,\n\n      // [ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n      \"(?:(?:\" + h16c + \"){0,2}\" + H16 + \")?::(?:\" + h16c + \"){2}\" + LS32,\n\n      // [ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n      \"(?:(?:\" + h16c + \"){0,3}\" + H16 + \")?::\" + h16c + LS32,\n\n      // [ *4( h16 \":\" ) h16 ] \"::\" ls32\n      \"(?:(?:\" + h16c + \"){0,4}\" + H16 + \")?::\" + LS32,\n\n      // [ *5( h16 \":\" ) h16 ] \"::\" h16\n      \"(?:(?:\" + h16c + \"){0,5}\" + H16 + \")?::\" + H16,\n\n      // [ *6( h16 \":\" ) h16 ] \"::\"\n      \"(?:(?:\" + h16c + \"){0,6}\" + H16 + \")?::\"\n    };\n\n    return \"(?:\" + String.join(\"|\", alts) + \")\";\n  }\n\n  // IPvFuture = \"v\" 1*HEXDIG \".\" 1*( unreserved / sub-delims / \":\" )\n  private static final String IPV_FUTURE =\n      \"v[\" + HEXDIG + \"]+\\\\.[\" + UNRESERVED + SUB_DELIMS + \":]+\";\n\n  // IP-literal = \"[\" ( IPv6address / IPvFuture ) \"]\"\n  private static final String IP_LITERAL = \"\\\\[(?:\" + IPV6_ADDRESS + \"|\" + IPV_FUTURE + \")\\\\]\";\n\n  // reg-name = *( unreserved / pct-encoded / sub-delims )\n  private static final String REG_NAME_CHAR = \"[\" + UNRESERVED + SUB_DELIMS + \"]\";\n  private static final String REG_NAME = \"(?:\" + REG_NAME_CHAR + \"|\" + PCT_ENCODED + \")*\";\n\n  // host = IP-literal / IPv4address / reg-name\n  // Note: Order matters - we try IP-literal first, then IPv4, then reg-name\n  private static final String HOST = \"(?:\" + IP_LITERAL + \"|\" + IPV4_ADDRESS + \"|\" + REG_NAME + \")\";\n\n  // port = *DIGIT\n  private static final String PORT = \"[\" + DIGIT + \"]*\";\n\n  // authority = [ userinfo \"@\" ] host [ \":\" port ]\n  private static final String AUTHORITY = \"(?:\" + USERINFO + \"@)?\" + HOST + \"(?::\" + PORT + \")?\";\n\n  // ===========================================\n  // Path Components\n  // ===========================================\n\n  // pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n  private static final String PCHAR = \"(?:[\" + UNRESERVED + SUB_DELIMS + \":@]|\" + PCT_ENCODED + \")\";\n\n  // segment = *pchar\n  private static final String SEGMENT = PCHAR + \"*\";\n\n  // segment-nz = 1*pchar\n  private static final String SEGMENT_NZ = PCHAR + \"+\";\n\n  // segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / \"@\" )\n  //               ; non-zero-length segment without any colon \":\"\n  private static final String SEGMENT_NZ_NC =\n      \"(?:[\" + UNRESERVED + SUB_DELIMS + \"@]|\" + PCT_ENCODED + \")+\";\n\n  // path-abempty  = *( \"/\" segment )\n  private static final String PATH_ABEMPTY = \"(?:/\" + SEGMENT + \")*\";\n\n  // path-absolute = \"/\" [ segment-nz *( \"/\" segment ) ]\n  private static final String PATH_ABSOLUTE = \"/(?:\" + SEGMENT_NZ + \"(?:/\" + SEGMENT + \")*)?\";\n\n  // path-noscheme = segment-nz-nc *( \"/\" segment )\n  private static final String PATH_NOSCHEME = SEGMENT_NZ_NC + \"(?:/\" + SEGMENT + \")*\";\n\n  // path-rootless = segment-nz *( \"/\" segment )\n  private static final String PATH_ROOTLESS = SEGMENT_NZ + \"(?:/\" + SEGMENT + \")*\";\n\n  // path-empty = 0<pchar>\n  private static final String PATH_EMPTY = \"\";\n\n  // ===========================================\n  // Query and Fragment\n  // ===========================================\n\n  // query = *( pchar / \"/\" / \"?\" )\n  private static final String QUERY = \"(?:\" + PCHAR + \"|[/?])*\";\n\n  // fragment = *( pchar / \"/\" / \"?\" )\n  private static final String FRAGMENT = QUERY; // Same as query\n\n  // ===========================================\n  // Hierarchical Part\n  // ===========================================\n\n  // hier-part = \"//\" authority path-abempty\n  //           / path-absolute\n  //           / path-rootless\n  //           / path-empty\n  private static final String HIER_PART =\n      \"(?://\"\n          + AUTHORITY\n          + PATH_ABEMPTY\n          + \"|\"\n          + PATH_ABSOLUTE\n          + \"|\"\n          + PATH_ROOTLESS\n          + \"|\"\n          + PATH_EMPTY\n          + \")\";\n\n  // relative-part = \"//\" authority path-abempty\n  //               / path-absolute\n  //               / path-noscheme\n  //               / path-empty\n  private static final String RELATIVE_PART =\n      \"(?://\"\n          + AUTHORITY\n          + PATH_ABEMPTY\n          + \"|\"\n          + PATH_ABSOLUTE\n          + \"|\"\n          + PATH_NOSCHEME\n          + \"|\"\n          + PATH_EMPTY\n          + \")\";\n\n  // ===========================================\n  // Full URI and URI-reference\n  // ===========================================\n\n  // URI = scheme \":\" hier-part [ \"?\" query ] [ \"#\" fragment ]\n  private static final String URI =\n      SCHEME + \":\" + HIER_PART + \"(?:\\\\?\" + QUERY + \")?(?:#\" + FRAGMENT + \")?\";\n\n  // relative-ref = relative-part [ \"?\" query ] [ \"#\" fragment ]\n  private static final String RELATIVE_REF =\n      RELATIVE_PART + \"(?:\\\\?\" + QUERY + \")?(?:#\" + FRAGMENT + \")?\";\n\n  // URI-reference = URI / relative-ref\n  private static final String URI_REFERENCE = \"(?:\" + URI + \"|\" + RELATIVE_REF + \")\";\n\n  // ===========================================\n  // Compiled Patterns\n  // ===========================================\n\n  private static final Pattern URI_PATTERN = Pattern.compile(\"^\" + URI + \"$\");\n  private static final Pattern URI_REFERENCE_PATTERN = Pattern.compile(\"^\" + URI_REFERENCE + \"$\");\n  private static final Pattern RELATIVE_REF_PATTERN = Pattern.compile(\"^\" + RELATIVE_REF + \"$\");\n\n  // Component patterns for validation\n  private static final Pattern SCHEME_PATTERN = Pattern.compile(\"^\" + SCHEME + \"$\");\n  private static final Pattern HOST_PATTERN = Pattern.compile(\"^\" + HOST + \"$\");\n  private static final Pattern IPV4_PATTERN = Pattern.compile(\"^\" + IPV4_ADDRESS + \"$\");\n  private static final Pattern IPV6_PATTERN = Pattern.compile(\"^\" + IPV6_ADDRESS + \"$\");\n  private static final Pattern PATH_PATTERN =\n      Pattern.compile(\n          \"^(?:\"\n              + PATH_ABEMPTY\n              + \"|\"\n              + PATH_ABSOLUTE\n              + \"|\"\n              + PATH_ROOTLESS\n              + \"|\"\n              + PATH_NOSCHEME\n              + \")$\");\n  private static final Pattern QUERY_PATTERN = Pattern.compile(\"^\" + QUERY + \"$\");\n  private static final Pattern FRAGMENT_PATTERN = Pattern.compile(\"^\" + FRAGMENT + \"$\");\n\n  // ===========================================\n  // Public API\n  // ===========================================\n\n  /**\n   * Validates a URI (must have a scheme).\n   *\n   * @param input the string to validate\n   * @return true if valid RFC 3986 URI\n   */\n  public static boolean isValidUri(String input) {\n    return URI_PATTERN.matcher(input).matches();\n  }\n\n  /**\n   * Validates a URI-reference (URI or relative-ref). This is the most permissive validation.\n   *\n   * @param input the string to validate\n   * @return true if valid RFC 3986 URI-reference\n   */\n  public static boolean isValidUriReference(String input) {\n    return URI_REFERENCE_PATTERN.matcher(input).matches();\n  }\n\n  /**\n   * Validates a relative reference (no scheme).\n   *\n   * @param input the string to validate\n   * @return true if valid RFC 3986 relative-ref\n   */\n  public static boolean isValidRelativeRef(String input) {\n    return RELATIVE_REF_PATTERN.matcher(input).matches();\n  }\n\n  /**\n   * Validates a scheme component.\n   *\n   * @param input the scheme to validate\n   * @return true if valid RFC 3986 scheme\n   */\n  public static boolean isValidScheme(String input) {\n    return SCHEME_PATTERN.matcher(input).matches();\n  }\n\n  /**\n   * Validates a host component.\n   *\n   * @param input the host to validate\n   * @return true if valid RFC 3986 host\n   */\n  public static boolean isValidHost(String input) {\n    return HOST_PATTERN.matcher(input).matches();\n  }\n\n  /**\n   * Validates an IPv4 address.\n   *\n   * @param input the address to validate\n   * @return true if valid IPv4 address\n   */\n  public static boolean isValidIpv4(String input) {\n    return IPV4_PATTERN.matcher(input).matches();\n  }\n\n  /**\n   * Validates an IPv6 address (without brackets).\n   *\n   * @param input the address to validate\n   * @return true if valid IPv6 address\n   */\n  public static boolean isValidIpv6(String input) {\n    return IPV6_PATTERN.matcher(input).matches();\n  }\n\n  /**\n   * Validates a path component.\n   *\n   * @param input the path to validate\n   * @return true if valid RFC 3986 path\n   */\n  public static boolean isValidPath(String input) {\n    return PATH_PATTERN.matcher(input).matches();\n  }\n\n  /**\n   * Validates a query component (without leading ?).\n   *\n   * @param input the query to validate\n   * @return true if valid RFC 3986 query\n   */\n  public static boolean isValidQuery(String input) {\n    return QUERY_PATTERN.matcher(input).matches();\n  }\n\n  /**\n   * Validates a fragment component (without leading #).\n   *\n   * @param input the fragment to validate\n   * @return true if valid RFC 3986 fragment\n   */\n  public static boolean isValidFragment(String input) {\n    return FRAGMENT_PATTERN.matcher(input).matches();\n  }\n\n  /** Returns the regex pattern string for debugging/inspection. */\n  public static String getUriPatternString() {\n    return \"^\" + URI + \"$\";\n  }\n\n  /** Returns the regex pattern string for URI-reference for debugging/inspection. */\n  public static String getUriReferencePatternString() {\n    return \"^\" + URI_REFERENCE + \"$\";\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/SchemeRelativeUrlTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.wiremock.url.SchemeRegistry.https;\n\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\n\nclass SchemeRelativeUrlTests {\n\n  @Nested\n  class Transform {\n\n    @Test\n    void can_transform_a_scheme_relative_url() {\n      SchemeRelativeUrl url = SchemeRelativeUrl.parse(\"//example.com/path\");\n      Url transformed = url.transform(b -> b.setScheme(https).setQuery(Query.parse(\"a=b\")));\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .hasToString(\"https://example.com/path?a=b\");\n    }\n\n    @Test\n    void can_pointlessly_set_scheme_to_null() {\n      SchemeRelativeUrl url = SchemeRelativeUrl.parse(\"//example.com/path#fragment\");\n      Url transformed = url.transform(it -> it.setScheme(null));\n      assertThat(transformed).isInstanceOf(SchemeRelativeUrl.class).isEqualTo(url);\n    }\n\n    @Test\n    void can_set_authority_to_null() {\n      SchemeRelativeUrl url = SchemeRelativeUrl.parse(\"//example.com/path#fragment\");\n      Url transformed = url.transform(it -> it.setAuthority(null));\n      assertThat(transformed)\n          .isInstanceOf(RelativeUrl.class)\n          .isEqualTo(RelativeUrl.parse(\"/path#fragment\"));\n    }\n\n    @Test\n    void rejects_setting_relative_path() {\n      SchemeRelativeUrl url = SchemeRelativeUrl.parse(\"//example.com/path\");\n      assertThatExceptionOfType(IllegalUrl.class)\n          .isThrownBy(() -> url.transform(it -> it.setPath(Path.parse(\"relative\"))))\n          .withMessage(\n              \"Illegal scheme relative url: `//example.comrelative` - a scheme relative url's path must be absolute or empty, was `relative`\")\n          .extracting(IllegalUrl::getIllegalValue)\n          .isEqualTo(\"//example.comrelative\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/SchemeTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\n\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.MethodSource;\nimport org.junit.jupiter.params.provider.ValueSource;\n\nclass SchemeTests {\n\n  @Nested\n  class OfMethod {\n\n    static Stream<String> validSchemes() {\n      return Stream.of(\n          \"x\",\n          \"X\",\n          \"verylongschemenamethatcontainsmanycharactersandisvalidaccordingtotherfc\",\n          \"http2\",\n          \"svn+\",\n          \"proto-\",\n          \"custom.\",\n          \"x+-.\",\n          \"http\",\n          \"https\",\n          \"ftp\",\n          \"ssh\",\n          \"file\",\n          \"mailto\",\n          \"HTTP\",\n          \"HTTPS\",\n          \"FTP\",\n          \"SSH\",\n          \"FILE\",\n          \"MAILTO\",\n          \"Http\",\n          \"Https\",\n          \"Ftp\",\n          \"Ssh\",\n          \"File\",\n          \"Mailto\",\n          \"svn+ssh\",\n          \"content-type\",\n          \"x.custom\",\n          \"h2c\",\n          \"custom+proto-1.0\");\n    }\n\n    @ParameterizedTest\n    @MethodSource(\"validSchemes\")\n    void parses_valid_schemes(String schemeString) {\n      Scheme scheme = Scheme.parse(schemeString);\n      assertThat(scheme.toString()).isEqualTo(schemeString);\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"-http\",\n          \"+http\",\n          \".http\",\n          \"\",\n          \"http!\",\n          \"http@home\",\n          \"http#tag\",\n          \"http$var\",\n          \"http%20\",\n          \"http&amp\",\n          \"http:\",\n          \"http://\",\n          \"://\",\n          \" http\",\n          \"http \",\n          \" http \",\n          \"1invalid\",\n          \"@invalid\",\n          \"http scheme\",\n          \"http:\",\n          \"http/\"\n        })\n    void throws_exception_for_illegal_schemes(String illegalScheme) {\n      assertThatExceptionOfType(IllegalScheme.class)\n          .isThrownBy(() -> Scheme.parse(illegalScheme))\n          .withMessage(\n              \"Illegal scheme `\"\n                  + illegalScheme\n                  + \"`; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\")\n          .withNoCause()\n          .extracting(IllegalScheme::getIllegalValue)\n          .isEqualTo(illegalScheme);\n    }\n  }\n\n  @Nested\n  class RegisterMethod {\n\n    @Test\n    void registers_custom_scheme_without_default_port() {\n      Scheme scheme = Scheme.register(\"reg1\");\n      assertThat(scheme.toString()).isEqualTo(\"reg1\");\n      assertThat(scheme.getDefaultPort()).isNull();\n    }\n\n    @Test\n    void registers_custom_scheme_with_default_port() {\n      Scheme scheme = Scheme.register(\"reg2\", Port.of(9999));\n      assertThat(scheme.toString()).isEqualTo(\"reg2\");\n      assertThat(scheme.getDefaultPort()).isEqualTo(Port.of(9999));\n    }\n\n    @Test\n    void registering_same_scheme_twice_returns_same_instance() {\n      Scheme scheme1 = Scheme.register(\"reg3\");\n      Scheme scheme2 = Scheme.register(\"reg3\");\n      assertThat(scheme1).isSameAs(scheme2);\n    }\n\n    @Test\n    void registering_scheme_with_different_case_returns_canonical_instance() {\n      Scheme lowercase = Scheme.register(\"reg4\");\n      Scheme uppercase = Scheme.register(\"REG4\");\n      assertThat(lowercase).isSameAs(uppercase);\n    }\n\n    @Test\n    void rejects_illegal_scheme() {\n      assertThatExceptionOfType(IllegalScheme.class)\n          .isThrownBy(() -> Scheme.register(\"1invalid\"))\n          .withMessage(\n              \"Illegal scheme `1invalid`; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\")\n          .withNoCause()\n          .extracting(IllegalScheme::getIllegalValue)\n          .isEqualTo(\"1invalid\");\n    }\n  }\n\n  @Nested\n  class PredefinedSchemes {\n\n    @Test\n    void http_scheme_has_port_80() {\n      assertThat(SchemeRegistry.http.toString()).isEqualTo(\"http\");\n      assertThat(SchemeRegistry.http.getDefaultPort()).isEqualTo(Port.of(80));\n      assertThat(SchemeRegistry.http.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void https_scheme_has_port_443() {\n      assertThat(SchemeRegistry.https.toString()).isEqualTo(\"https\");\n      assertThat(SchemeRegistry.https.getDefaultPort()).isEqualTo(Port.of(443));\n      assertThat(SchemeRegistry.https.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void ftp_scheme_has_port_21() {\n      assertThat(SchemeRegistry.ftp.toString()).isEqualTo(\"ftp\");\n      assertThat(SchemeRegistry.ftp.getDefaultPort()).isEqualTo(Port.of(21));\n      assertThat(SchemeRegistry.ftp.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void ssh_scheme_has_port_22() {\n      assertThat(SchemeRegistry.ssh.toString()).isEqualTo(\"ssh\");\n      assertThat(SchemeRegistry.ssh.getDefaultPort()).isEqualTo(Port.of(22));\n      assertThat(SchemeRegistry.ssh.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void file_scheme_has_no_default_port() {\n      assertThat(SchemeRegistry.file.toString()).isEqualTo(\"file\");\n      assertThat(SchemeRegistry.file.getDefaultPort()).isNull();\n      assertThat(SchemeRegistry.file.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void mailto_scheme_has_no_default_port() {\n      assertThat(SchemeRegistry.mailto.toString()).isEqualTo(\"mailto\");\n      assertThat(SchemeRegistry.mailto.getDefaultPort()).isNull();\n      assertThat(SchemeRegistry.mailto.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void parsing_http_returns_predefined_instance() {\n      Scheme parsed = Scheme.parse(\"http\");\n      assertThat(parsed).isSameAs(SchemeRegistry.http);\n    }\n\n    @Test\n    void parsing_https_returns_predefined_instance() {\n      Scheme parsed = Scheme.parse(\"https\");\n      assertThat(parsed).isSameAs(SchemeRegistry.https);\n    }\n  }\n\n  @Nested\n  class Canonical {\n\n    @Test\n    void lowercase_scheme_is_its_own_canonical() {\n      Scheme scheme = Scheme.parse(\"http\");\n      assertThat(scheme.normalise()).isSameAs(scheme);\n      assertThat(scheme.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void uppercase_scheme_has_lowercase_canonical() {\n      Scheme uppercase = Scheme.parse(\"HTTP\");\n      Scheme lowercase = Scheme.parse(\"http\");\n      assertThat(uppercase.normalise()).isSameAs(lowercase);\n      assertThat(uppercase.isNormalForm()).isFalse();\n    }\n\n    @Test\n    void mixed_case_scheme_has_lowercase_canonical() {\n      Scheme mixedCase = Scheme.parse(\"HtTp\");\n      Scheme lowercase = Scheme.parse(\"http\");\n      assertThat(mixedCase.normalise()).isSameAs(lowercase);\n      assertThat(mixedCase.isNormalForm()).isFalse();\n    }\n\n    @Test\n    void custom_lowercase_scheme_is_canonical() {\n      Scheme scheme = Scheme.parse(\"canon1\");\n      assertThat(scheme.normalise()).isEqualTo(scheme);\n      assertThat(scheme.isNormalForm()).isTrue();\n    }\n\n    @Test\n    void custom_uppercase_scheme_references_lowercase_canonical() {\n      Scheme uppercase = Scheme.parse(\"CANON2\");\n      Scheme lowercase = Scheme.parse(\"canon2\");\n      assertThat(uppercase.normalise()).isEqualTo(lowercase);\n      assertThat(uppercase.isNormalForm()).isFalse();\n    }\n  }\n\n  @Nested\n  class DefaultPort {\n\n    @Test\n    void scheme_without_registered_port_returns_null() {\n      Scheme scheme = Scheme.parse(\"port1\");\n      assertThat(scheme.getDefaultPort()).isNull();\n    }\n\n    @Test\n    void registered_scheme_with_port_returns_port() {\n      Scheme scheme = Scheme.register(\"port2\", Port.of(8888));\n      assertThat(scheme.getDefaultPort()).isEqualTo(Port.of(8888));\n    }\n\n    @Test\n    void non_canonical_scheme_inherits_default_port_from_canonical() {\n      Scheme canonical = Scheme.register(\"port3\", Port.of(7777));\n      Scheme uppercase = Scheme.parse(\"PORT3\");\n      assertThat(uppercase.getDefaultPort()).isEqualTo(Port.of(7777));\n      assertThat(uppercase.getDefaultPort()).isSameAs(canonical.getDefaultPort());\n    }\n\n    @Test\n    void parsing_uppercase_predefined_scheme_gets_default_port() {\n      Scheme uppercase = Scheme.parse(\"HTTP\");\n      assertThat(uppercase.getDefaultPort()).isEqualTo(Port.of(80));\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    @Test\n    void schemes_with_same_string_are_equal() {\n      Scheme scheme1 = Scheme.parse(\"http\");\n      Scheme scheme2 = Scheme.parse(\"http\");\n      assertThat(scheme1).isEqualTo(scheme2);\n    }\n\n    @Test\n    void schemes_with_different_case_are_not_equal() {\n      Scheme lowercase = Scheme.parse(\"http\");\n      Scheme uppercase = Scheme.parse(\"HTTP\");\n      assertThat(lowercase).isNotEqualTo(uppercase);\n    }\n\n    @Test\n    void scheme_equals_itself() {\n      Scheme scheme = Scheme.parse(\"https\");\n      assertThat(scheme).isEqualTo(scheme);\n    }\n\n    @Test\n    void scheme_not_equal_to_null() {\n      Scheme scheme = Scheme.parse(\"http\");\n      assertThat(scheme).isNotEqualTo(null);\n    }\n\n    @Test\n    void scheme_not_equal_to_string() {\n      Scheme scheme = Scheme.parse(\"http\");\n      assertThat(scheme).isNotEqualTo(\"http\");\n    }\n\n    @Test\n    void different_schemes_are_not_equal() {\n      Scheme http = Scheme.parse(\"http\");\n      Scheme https = Scheme.parse(\"https\");\n      assertThat(http).isNotEqualTo(https);\n    }\n\n    @Test\n    void equals_is_reflexive() {\n      Scheme scheme = Scheme.parse(\"ftp\");\n      assertThat(scheme.equals(scheme)).isTrue();\n    }\n\n    @Test\n    void equals_is_symmetric() {\n      Scheme scheme1 = Scheme.parse(\"ssh\");\n      Scheme scheme2 = Scheme.parse(\"ssh\");\n      assertThat(scheme1.equals(scheme2)).isEqualTo(scheme2.equals(scheme1));\n    }\n\n    @Test\n    void equals_is_transitive() {\n      Scheme scheme1 = Scheme.parse(\"mailto\");\n      Scheme scheme2 = Scheme.parse(\"mailto\");\n      Scheme scheme3 = Scheme.parse(\"mailto\");\n      assertThat(scheme1).isEqualTo(scheme2);\n      assertThat(scheme2).isEqualTo(scheme3);\n      assertThat(scheme1).isEqualTo(scheme3);\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void equal_schemes_have_same_hash_code() {\n      Scheme scheme1 = Scheme.parse(\"http\");\n      Scheme scheme2 = Scheme.parse(\"http\");\n      assertThat(scheme1.hashCode()).isEqualTo(scheme2.hashCode());\n    }\n\n    @Test\n    void different_case_schemes_have_different_hash_codes() {\n      Scheme lowercase = Scheme.parse(\"http\");\n      Scheme uppercase = Scheme.parse(\"HTTP\");\n      assertThat(lowercase.hashCode()).isNotEqualTo(uppercase.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      Scheme scheme = Scheme.parse(\"https\");\n      int hash1 = scheme.hashCode();\n      int hash2 = scheme.hashCode();\n      assertThat(hash1).isEqualTo(hash2);\n    }\n\n    @Test\n    void hash_code_equals_string_hash_code() {\n      Scheme scheme = Scheme.parse(\"ftp\");\n      assertThat(scheme.hashCode()).isEqualTo(\"ftp\".hashCode());\n    }\n  }\n\n  @Nested\n  class Caching {\n\n    @Test\n    void parsing_same_registered_scheme_twice_returns_same_instance() {\n      Scheme scheme1 = Scheme.parse(\"http\");\n      Scheme scheme2 = Scheme.parse(\"http\");\n      assertThat(scheme1).isSameAs(scheme2);\n    }\n\n    @Test\n    void parsing_different_case_returns_different_instances() {\n      Scheme lowercase = Scheme.parse(\"http\");\n      Scheme uppercase = Scheme.parse(\"HTTP\");\n      assertThat(lowercase).isNotEqualTo(uppercase);\n    }\n\n    @Test\n    void parsing_custom_scheme_twice_returns_equal_instances() {\n      Scheme scheme1 = Scheme.parse(\"cache1\");\n      Scheme scheme2 = Scheme.parse(\"cache1\");\n      assertThat(scheme1).isEqualTo(scheme2);\n    }\n\n    @Test\n    void canonical_and_non_canonical_are_not_equal() {\n      Scheme lowercase = Scheme.parse(\"cache2\");\n      Scheme uppercase = Scheme.parse(\"CACHE2\");\n      assertThat(lowercase).isNotEqualTo(uppercase);\n      assertThat(uppercase.normalise()).isEqualTo(lowercase);\n    }\n  }\n\n  @TestFactory\n  Stream<DynamicTest> invariants() {\n    return StringParserInvariantTests.generateInvariantTests(\n        SchemeRegistry.INSTANCE, OfMethod.validSchemes().toList());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/SegmentTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.assertj.core.api.Assertions;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\nclass SegmentTests {\n\n  @Nested\n  class Parse {\n\n    static final List<String> validSegments =\n        List.of(\n            \"\",\n            \"segment\",\n            \"%3F\",\n            \"seg%3Fment\",\n            \"seg%3fment\",\n            \"seg  ment\",\n            \"{}\",\n            \"%3Fsegment\",\n            \"segment%3F\",\n            \"%23\",\n            \"seg%23ment\",\n            \"%23segment\",\n            \"segment%23\",\n            \"%2F\",\n            \"seg%2Fment\",\n            \"%2Fsegment\",\n            \"segment%2F\");\n\n    @TestFactory\n    Stream<DynamicTest> invariants() {\n      return StringParserInvariantTests.generateInvariantTests(\n          SegmentParser.INSTANCE, validSegments);\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"?\",\n          \"seg?ment\",\n          \"?segment\",\n          \"segment?\",\n          \"#\",\n          \"seg#ment\",\n          \"#segment\",\n          \"segment#\",\n          \"/\",\n          \"seg/ment\",\n          \"/segment\",\n          \"segment/\",\n        })\n    void rejects_illegal_segments(String illegalSegment) {\n      Assertions.assertThatExceptionOfType(IllegalSegment.class)\n          .isThrownBy(() -> Segment.parse(illegalSegment))\n          .withMessage(\"Illegal segment: `\" + illegalSegment + \"`\")\n          .withNoCause()\n          .extracting(IllegalSegment::getIllegalValue)\n          .isEqualTo(illegalSegment);\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      var decoded =\n          Stream.of(\n              \"?\",\n              \"seg?ment\",\n              \"?segment\",\n              \"segment?\",\n              \"#\",\n              \"seg#ment\",\n              \"#segment\",\n              \"segment#\",\n              \"/\",\n              \"seg/ment\",\n              \"/segment\",\n              \"segment/\");\n\n      return generateEncodeDecodeInvariantTests(SegmentParser.INSTANCE, decoded);\n    }\n\n    static final List<CodecCase> codedCases =\n        List.of(\n            new CodecCase(\"\", \"\"),\n            new CodecCase(\"segment\", \"segment\"),\n            new CodecCase(\"%3F\", \"?\"),\n            new CodecCase(\"seg%3Fment\", \"seg?ment\"),\n            new CodecCase(\"%3Fsegment\", \"?segment\"),\n            new CodecCase(\"segment%3F\", \"segment?\"),\n            new CodecCase(\"%23\", \"#\"),\n            new CodecCase(\"seg%23ment\", \"seg#ment\"),\n            new CodecCase(\"%23segment\", \"#segment\"),\n            new CodecCase(\"segment%23\", \"segment#\"),\n            new CodecCase(\"%2F\", \"/\"),\n            new CodecCase(\"seg%2Fment\", \"seg/ment\"),\n            new CodecCase(\"%2Fsegment\", \"/segment\"),\n            new CodecCase(\"segment%2F\", \"segment/\"));\n\n    @ParameterizedTest\n    @FieldSource(\"codedCases\")\n    void encodes_percent_encoded_correctly(CodecCase testCase) {\n      var encoded = Segment.encode(testCase.decoded());\n      assertThat(encoded.toString()).isEqualTo(testCase.encoded());\n      assertThat(encoded.decode()).isEqualTo(testCase.decoded());\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"codedCases\")\n    void decodes_percent_encoded_correctly(CodecCase testCase) {\n      var encoded = Segment.parse(testCase.encoded());\n      assertThat(encoded.decode()).isEqualTo(testCase.decoded());\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<Segment>> normalisationCases =\n        Stream.of(\n                // Characters that need encoding\n                Pair.of(\"section name\", \"section%20name\"),\n                Pair.of(\"hello world\", \"hello%20world\"),\n                Pair.of(\"test\\\"quote\", \"test%22quote\"),\n                Pair.of(\"test<tag>\", \"test%3Ctag%3E\"),\n                Pair.of(\"test`backtick\", \"test%60backtick\"),\n                Pair.of(\"data{value}\", \"data%7Bvalue%7D\"),\n                Pair.of(\"test{name}\", \"test%7Bname%7D\"),\n                Pair.of(\"café\", \"caf%C3%A9\"),\n                Pair.of(\"héllo\", \"h%C3%A9llo\"),\n                Pair.of(\"%ff\", \"%FF\"),\n                Pair.of(\"%fF\", \"%FF\"),\n                Pair.of(\"%Ff\", \"%FF\"),\n                Pair.of(\"%41\", \"A\"),\n                Pair.of(\"%5A\", \"Z\"),\n                Pair.of(\"%5a\", \"Z\"))\n            .map(\n                testCase ->\n                    new NormalisationCase<>(\n                        Segment.parse(testCase.getLeft()), Segment.parse(testCase.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_segment_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(normalisationCases);\n    }\n\n    static final List<Segment> alreadyNormalised =\n        Stream.of(\n                \"\",\n                \"section\",\n                \"section-name\",\n                \"section_name.test~123\",\n                \"section!name\",\n                \"time:12:30\",\n                \"section%20name\",\n                \"caf%C3%A9\",\n                \"test%22quote\")\n            .map(Segment::parse)\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(alreadyNormalised);\n    }\n  }\n\n  @Nested\n  class EmptyInitialisation extends AbstractEncodableInitialisationTests {\n    EmptyInitialisation() {\n      super(\"org.wiremock.url.Segment\", EMPTY, \"org.wiremock.url.SegmentParser\", \"\");\n    }\n  }\n\n  @Nested\n  class DotInitialisation extends AbstractEncodableInitialisationTests {\n    DotInitialisation() {\n      super(\"org.wiremock.url.Segment\", \"DOT\", \"org.wiremock.url.SegmentParser\", \".\");\n    }\n  }\n\n  @Nested\n  class DotDotInitialisation extends AbstractEncodableInitialisationTests {\n    DotDotInitialisation() {\n      super(\"org.wiremock.url.Segment\", \"DOT_DOT\", \"org.wiremock.url.SegmentParser\", \"..\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/ServersideAbsoluteUrlTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\nimport static org.wiremock.url.AbsoluteUriTests.Parse.illegalAbsoluteUris;\nimport static org.wiremock.url.Lists.concat;\nimport static org.wiremock.url.SchemeRegistry.file;\nimport static org.wiremock.url.SchemeRegistry.https;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\nclass ServersideAbsoluteUrlTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void parses_serverside_absolute_url_correctly() {\n      var serversideAbsoluteUrl = ServersideAbsoluteUrl.parse(\"https://example.com/path?query\");\n\n      assertThat(serversideAbsoluteUrl.toString()).isEqualTo(\"https://example.com/path?query\");\n      assertThat(serversideAbsoluteUrl).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(serversideAbsoluteUrl).isNotInstanceOf(Origin.class);\n\n      assertThat(serversideAbsoluteUrl.getScheme()).isEqualTo(https);\n\n      assertThat(serversideAbsoluteUrl.getAuthority()).isEqualTo(HostAndPort.parse(\"example.com\"));\n      assertThat(serversideAbsoluteUrl.getUserInfo()).isNull();\n      assertThat(serversideAbsoluteUrl.getHost()).isEqualTo(Host.parse(\"example.com\"));\n      assertThat(serversideAbsoluteUrl.getPort()).isNull();\n\n      assertThat(serversideAbsoluteUrl.getPath()).isEqualTo(Path.parse(\"/path\"));\n      assertThat(serversideAbsoluteUrl.getQuery()).isEqualTo(Query.parse(\"query\"));\n\n      assertThat(serversideAbsoluteUrl.getFragment()).isNull();\n\n      assertThat(serversideAbsoluteUrl.isAbsolute()).isTrue();\n      assertThat(serversideAbsoluteUrl.isRelative()).isFalse();\n      assertThat(serversideAbsoluteUrl.isAbsoluteUrl()).isTrue();\n      assertThat(serversideAbsoluteUrl.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void parses_origin_correctly() {\n      var origin = ServersideAbsoluteUrl.parse(\"https://example.com\");\n\n      assertThat(origin.toString()).isEqualTo(\"https://example.com\");\n      assertThat(origin).isInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_file_empty_authority_correctly() {\n      var fileUri = ServersideAbsoluteUrl.parse(\"file:///home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file:///home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(fileUri).isNotInstanceOf(Origin.class);\n\n      assertThat(fileUri.getScheme()).isEqualTo(file);\n\n      assertThat(fileUri.getAuthority()).isEqualTo(HostAndPort.EMPTY);\n      assertThat(fileUri.getUserInfo()).isNull();\n      assertThat(fileUri.getHost()).isEqualTo(Host.EMPTY);\n      assertThat(fileUri.getPort()).isNull();\n\n      assertThat(fileUri.getPath()).isEqualTo(Path.parse(\"/home/me/some/dir\"));\n      assertThat(fileUri.getQuery()).isNull();\n\n      assertThat(fileUri.getFragment()).isNull();\n\n      assertThat(fileUri.isAbsolute()).isTrue();\n      assertThat(fileUri.isRelative()).isFalse();\n      assertThat(fileUri.isAbsoluteUrl()).isTrue();\n      assertThat(fileUri.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void parses_file_with_authority_correctly() {\n      var fileUri = ServersideAbsoluteUrl.parse(\"file://user@remote/home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file://user@remote/home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(fileUri).isNotInstanceOf(Origin.class);\n\n      assertThat(fileUri.getScheme()).isEqualTo(file);\n\n      assertThat(fileUri.getAuthority()).isEqualTo(Authority.parse(\"user@remote\"));\n      assertThat(fileUri.getUserInfo()).isEqualTo(UserInfo.parse(\"user\"));\n      assertThat(fileUri.getHost()).isEqualTo(Host.parse(\"remote\"));\n      assertThat(fileUri.getPort()).isNull();\n\n      assertThat(fileUri.getPath()).isEqualTo(Path.parse(\"/home/me/some/dir\"));\n      assertThat(fileUri.getQuery()).isNull();\n\n      assertThat(fileUri.getFragment()).isNull();\n\n      assertThat(fileUri.isAbsolute()).isTrue();\n      assertThat(fileUri.isRelative()).isFalse();\n      assertThat(fileUri.isAbsoluteUrl()).isTrue();\n      assertThat(fileUri.isOpaqueUri()).isFalse();\n    }\n\n    @Test\n    void rejects_illegal_uri() {\n      IllegalUri exception =\n          assertThatExceptionOfType(IllegalUri.class)\n              .isThrownBy(() -> ServersideAbsoluteUrl.parse(\"not a :uri\"))\n              .actual();\n      assertThat(exception.getMessage()).isEqualTo(\"Illegal uri: `not a :uri`\");\n      assertThat(exception.getIllegalValue()).isEqualTo(\"not a :uri\");\n\n      IllegalScheme cause =\n          assertThat(exception.getCause()).asInstanceOf(type(IllegalScheme.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\"Illegal scheme `not a `; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n      assertThat(cause.getIllegalValue()).isEqualTo(\"not a \");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    static final List<? extends String> illegalServersideAbsoluteUrls =\n        concat(\n            illegalAbsoluteUris,\n            List.of(\n                \"mailto:joan@example.com\",\n                \"arn:aws:servicecatalog:us-east-1:912624918755:stack/some-stack/pp-a3B9zXp1mQ7rS\",\n                \"file:/home/me/some/dir\",\n                \"//example.com/path?query#fragment\"));\n\n    @ParameterizedTest\n    @FieldSource(\"illegalServersideAbsoluteUrls\")\n    void rejects_illegal_serverside_absolute_url(String illegalAbsoluteUrl) {\n      assertThatExceptionOfType(IllegalServersideAbsoluteUrl.class)\n          .isThrownBy(() -> ServersideAbsoluteUrl.parse(illegalAbsoluteUrl))\n          .withMessage(\"Illegal serverside absolute url: `\" + illegalAbsoluteUrl + \"`\")\n          .extracting(IllegalServersideAbsoluteUrl::getIllegalValue)\n          .isEqualTo(illegalAbsoluteUrl);\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<AbsoluteUri>> normalisationCases =\n        Stream.<Pair<String, String>>of(\n                Pair.of(\"HTTPS://EXAMPLE.COM:8080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTPS://example.com:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTPS://example.com:8080\", \"https://example.com:8080/\"),\n                Pair.of(\"HTTP://example.com\", \"http://example.com/\"),\n                Pair.of(\"FTP://example.com\", \"ftp://example.com/\"),\n\n                // Host normalization - uppercase to lowercase\n                Pair.of(\"https://EXAMPLE.COM:8080\", \"https://example.com:8080/\"),\n                Pair.of(\"https://EXAMPLE.COM:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"http://WWW.EXAMPLE.COM\", \"http://www.example.com/\"),\n                Pair.of(\"http://Example.Com\", \"http://example.com/\"),\n\n                // Port normalization - leading zeros\n                Pair.of(\"https://example.com:08080\", \"https://example.com:8080/\"),\n                Pair.of(\"http://example.com:09090\", \"http://example.com:9090/\"),\n                Pair.of(\"http://example.com:00080\", \"http://example.com/\"),\n\n                // Port normalization - default port removal\n                Pair.of(\"http://example.com:80\", \"http://example.com/\"),\n                Pair.of(\"http://example.com:80/\", \"http://example.com/\"),\n                Pair.of(\"http://example.com:80/path\", \"http://example.com/path\"),\n                Pair.of(\"http://example.com:080\", \"http://example.com/\"),\n                Pair.of(\"https://example.com:443\", \"https://example.com/\"),\n                Pair.of(\"https://example.com:443/\", \"https://example.com/\"),\n                Pair.of(\"https://example.com:443/path\", \"https://example.com/path\"),\n                Pair.of(\"https://example.com:0443\", \"https://example.com/\"),\n\n                // Percent encoding - uppercase hex digits in path\n                Pair.of(\"http://example.com/%1f\", \"http://example.com/%1F\"),\n                Pair.of(\"http://example.com/%1f%3f\", \"http://example.com/%1F%3F\"),\n                Pair.of(\"http://example.com/path%1fto\", \"http://example.com/path%1Fto\"),\n                Pair.of(\"http://example.com/%3f%3F\", \"http://example.com/%3F%3F\"),\n                Pair.of(\"http://example.com/%ab%cd%ef\", \"http://example.com/%AB%CD%EF\"),\n\n                // Percent encoding - decode unreserved characters in path (A-Z a-z 0-9 - . _ ~)\n                Pair.of(\"http://example.com/%41\", \"http://example.com/A\"),\n                Pair.of(\"http://example.com/%61\", \"http://example.com/a\"),\n                Pair.of(\"http://example.com/%30\", \"http://example.com/0\"),\n                Pair.of(\"http://example.com/%7E\", \"http://example.com/~\"),\n                Pair.of(\"http://example.com/%7e\", \"http://example.com/~\"),\n                Pair.of(\"http://example.com/%2D\", \"http://example.com/-\"),\n                Pair.of(\"http://example.com/%2E\", \"http://example.com/\"),\n                Pair.of(\"http://example.com/%5F\", \"http://example.com/_\"),\n                Pair.of(\"http://example.com/%41%42%43\", \"http://example.com/ABC\"),\n                Pair.of(\"http://example.com/~%75ser\", \"http://example.com/~user\"),\n\n                // Percent encoding - uppercase hex in query\n                Pair.of(\"http://example.com?key=%1f\", \"http://example.com/?key=%1F\"),\n                Pair.of(\"http://example.com?a=%1f&b=%1a\", \"http://example.com/?a=%1F&b=%1A\"),\n                Pair.of(\"http://example.com?key=%ab\", \"http://example.com/?key=%AB\"),\n\n                // Combined normalizations - scheme + host + port\n                Pair.of(\"HTTP://EXAMPLE.COM:80\", \"http://example.com/\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:443\", \"https://example.com/\"),\n                Pair.of(\"HTTP://EXAMPLE.COM:080\", \"http://example.com/\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:0443\", \"https://example.com/\"),\n\n                // Combined normalizations - multiple components\n                Pair.of(\"HTTP://EXAMPLE.COM:80/%1f\", \"http://example.com/%1F\"),\n                Pair.of(\"HTTPS://EXAMPLE.COM:443/PATH\", \"https://example.com/PATH\"),\n                Pair.of(\"HTTP://EXAMPLE.COM/%41%42\", \"http://example.com/AB\"),\n                Pair.of(\n                    \"HTTPS://EXAMPLE.COM:0443/path?key=%41\", \"https://example.com/path?key=%41\"),\n\n                // Path with percent encoding variations\n                Pair.of(\"http://example.com/%41/%42/%43\", \"http://example.com/A/B/C\"),\n                Pair.of(\n                    \"http://example.com/path/%1F/segment\", \"http://example.com/path/%1F/segment\"),\n                Pair.of(\"http://example.com/%7Euser/docs\", \"http://example.com/~user/docs\"),\n\n                // Multiple ports in different contexts\n                Pair.of(\"http://example.com:8080\", \"http://example.com:8080/\"),\n                Pair.of(\"https://example.com:8443\", \"https://example.com:8443/\"),\n                Pair.of(\"ftp://example.com:21\", \"ftp://example.com/\"),\n\n                // Mixed case hex digits\n                Pair.of(\"http://example.com/%aB%Cd\", \"http://example.com/%AB%CD\"),\n                Pair.of(\"http://example.com?key=%aB\", \"http://example.com/?key=%AB\"))\n            .map(\n                it ->\n                    new NormalisationCase<>(\n                        ServersideAbsoluteUrl.parse(it.getLeft()),\n                        ServersideAbsoluteUrl.parse(it.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_uri_reference_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(\n          normalisationCases.stream().filter(t -> !t.normalForm().equals(t.notNormal())).toList());\n    }\n\n    static final List<String> alreadyNormalised = List.of();\n\n    static final List<? extends AbsoluteUri> alreadyNormalisedUrlReferences =\n        Lists.concat(\n            normalisationCases.stream().map(NormalisationCase::normalForm).distinct().toList(),\n            alreadyNormalised.stream().map(AbsoluteUri::parse).toList());\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(\n          alreadyNormalisedUrlReferences);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/StringParserInvariantTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.junit.jupiter.api.DynamicTest.dynamicTest;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.wiremock.stringparser.ParsedString;\nimport org.wiremock.stringparser.StringParser;\n\n/**\n * Reusable test utility for verifying StringParser invariants.\n *\n * <p>This class provides methods to generate dynamic tests that verify any StringParser\n * implementation maintains the following invariants:\n *\n * <ul>\n *   <li>The {@code toString()} of the parsed instance equals the original input string\n *   <li>Values parsed from non-equal strings are never equal to each other\n * </ul>\n *\n * <p>Usage example:\n *\n * <pre>{@code\n * class MyParserTests {\n *   @TestFactory\n *   Stream<DynamicTest> parser_invariants() {\n *     List<String> validInputs = List.of(\"value1\", \"value2\", \"value3\");\n *     return StringParserInvariantTests.generateInvariantTests(\n *         MyParser.INSTANCE, validInputs);\n *   }\n * }\n * }</pre>\n */\npublic class StringParserInvariantTests {\n\n  /**\n   * Generates dynamic tests that verify all StringParser invariants for the provided valid input\n   * strings.\n   *\n   * <p>This method returns a Stream of DynamicTest that can be used with JUnit's\n   * {@code @TestFactory} annotation.\n   *\n   * @param parser the StringParser to test\n   * @param validStrings a collection of valid string values that the parser should successfully\n   *     parse\n   * @param <T> the type returned by the parser\n   * @return a Stream of DynamicTest instances\n   */\n  public static <T extends ParsedString> Stream<DynamicTest> generateInvariantTests(\n      StringParser<T> parser, Collection<String> validStrings) {\n    List<DynamicTest> tests = new ArrayList<>();\n\n    // Generate toString preservation tests\n    for (String input : validStrings) {\n      tests.add(\n          dynamicTest(\n              \"toString() preserves input: '\" + input + \"'\",\n              () -> {\n                T parsed = parser.parse(input);\n                assertThat(parsed.toString()).isEqualTo(input);\n              }));\n    }\n\n    // Generate non-equal strings tests\n    String[] strings = validStrings.toArray(new String[0]);\n    for (int i = 0; i < strings.length; i++) {\n      for (int j = i + 1; j < strings.length; j++) {\n        String string1 = strings[i];\n        String string2 = strings[j];\n\n        if (!string1.equals(string2)) {\n          tests.add(\n              dynamicTest(\n                  \"Different strings produce non-equal values: '\"\n                      + string1\n                      + \"' vs '\"\n                      + string2\n                      + \"'\",\n                  () -> {\n                    T parsed1 = parser.parse(string1);\n                    T parsed2 = parser.parse(string2);\n                    assertThat(parsed1).isNotEqualTo(parsed2);\n                  }));\n        }\n      }\n    }\n\n    return tests.stream();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/UriParseTestCase.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.Nullable;\n\nrecord UriParseTestCase(String stringForm, UriExpectation expectation) {\n  static UriParseTestCase testCase(String stringForm, UriExpectation expectation) {\n    return new UriParseTestCase(stringForm, expectation);\n  }\n}\n\nrecord UriExpectation(\n    @Nullable Scheme scheme,\n    @Nullable Authority authority,\n    @Nullable Path path,\n    @Nullable Query query,\n    @Nullable Fragment fragment) {\n\n  static UriExpectation expectation(\n      @Nullable String schemeStr,\n      @Nullable String authorityStr,\n      String pathStr,\n      @Nullable String queryStr,\n      @Nullable String fragmentStr) {\n    Scheme scheme = schemeStr == null ? null : Scheme.parse(schemeStr);\n    Authority authority = authorityStr == null ? null : Authority.parse(authorityStr);\n    Path path = Path.parse(pathStr);\n    Query query = queryStr == null ? null : Query.parse(queryStr);\n    Fragment fragment = fragmentStr == null ? null : Fragment.parse(fragmentStr);\n    return new UriExpectation(scheme, authority, path, query, fragment);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/UriTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.Assertions.assertThatIllegalStateException;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\n\nimport java.util.List;\nimport org.jspecify.annotations.Nullable;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\n\npublic class UriTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void parses_absolute_url_correctly() {\n      var absoluteUrl = Uri.parse(\"https://example.com/path?query#fragment\");\n\n      assertThat(absoluteUrl.toString()).isEqualTo(\"https://example.com/path?query#fragment\");\n      assertThat(absoluteUrl).isInstanceOf(AbsoluteUrl.class);\n      assertThat(absoluteUrl).isNotInstanceOf(ServersideAbsoluteUrl.class);\n    }\n\n    @Test\n    void parses_absolute_url_with_userinfo_correctly() {\n      var absoluteUrl = Uri.parse(\"https://user@example.com/path?query#fragment\");\n\n      assertThat(absoluteUrl.toString()).isEqualTo(\"https://user@example.com/path?query#fragment\");\n      assertThat(absoluteUrl).isInstanceOf(AbsoluteUrl.class);\n      assertThat(absoluteUrl).isNotInstanceOf(ServersideAbsoluteUrl.class);\n    }\n\n    @Test\n    void parses_serverside_absolute_url_correctly() {\n      var serversideAbsoluteUrl = Uri.parse(\"https://example.com/path?query\");\n\n      assertThat(serversideAbsoluteUrl.toString()).isEqualTo(\"https://example.com/path?query\");\n      assertThat(serversideAbsoluteUrl).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(serversideAbsoluteUrl).isNotInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_serverside_absolute_url_empty_host_and_port_correctly() {\n      var serversideAbsoluteUrl = Uri.parse(\"data://:443\");\n\n      assertThat(serversideAbsoluteUrl.toString()).isEqualTo(\"data://:443\");\n      assertThat(serversideAbsoluteUrl).isInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_origin_correctly() {\n      var origin = Uri.parse(\"https://example.com\");\n\n      assertThat(origin.toString()).isEqualTo(\"https://example.com\");\n      assertThat(origin).isInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_relative_url_with_authority_correctly() {\n      var relativeUrl = Uri.parse(\"//example.com/path?query#fragment\");\n\n      assertThat(relativeUrl.toString()).isEqualTo(\"//example.com/path?query#fragment\");\n      assertThat(relativeUrl).isInstanceOf(RelativeUrl.class);\n      assertThat(relativeUrl).isNotInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_relative_url_without_authority_correctly() {\n      var relativeUrl = Uri.parse(\"/path?query#fragment\");\n\n      assertThat(relativeUrl.toString()).isEqualTo(\"/path?query#fragment\");\n      assertThat(relativeUrl).isInstanceOf(RelativeUrl.class);\n      assertThat(relativeUrl).isNotInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_path_and_query_correctly() {\n      var pathAndQuery = Uri.parse(\"/path?query\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"/path?query\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_relative_path_correctly() {\n      var pathAndQuery = Uri.parse(\"relative\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"relative\");\n      assertThat(pathAndQuery).isInstanceOf(RelativeUrl.class);\n    }\n\n    @Test\n    void parses_empty_path_correctly() {\n      var pathAndQuery = Uri.parse(\"\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_mailto_correctly() {\n      var mailtoUri = Uri.parse(\"mailto:joan@example.com\");\n\n      assertThat(mailtoUri.toString()).isEqualTo(\"mailto:joan@example.com\");\n      assertThat(mailtoUri).isInstanceOf(OpaqueUri.class);\n    }\n\n    @Test\n    void parses_arn_correctly() {\n      var arn =\n          Uri.parse(\n              \"arn:aws:servicecatalog:us-east-1:912624918755:stack/some-stack/pp-a3B9zXp1mQ7rS\");\n\n      assertThat(arn.toString())\n          .isEqualTo(\n              \"arn:aws:servicecatalog:us-east-1:912624918755:stack/some-stack/pp-a3B9zXp1mQ7rS\");\n      assertThat(arn).isInstanceOf(OpaqueUri.class);\n    }\n\n    @Test\n    void parses_file_empty_authority_correctly() {\n      var fileUri = Uri.parse(\"file:///home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file:///home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(fileUri).isNotInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_file_with_authority_correctly() {\n      var fileUri = Uri.parse(\"file://user@remote/home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file://user@remote/home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(fileUri).isNotInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_file_no_authority_correctly() {\n      var fileUri = Uri.parse(\"file:/home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file:/home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(OpaqueUri.class);\n    }\n\n    @Test\n    void rejects_illegal_scheme() {\n      IllegalUri exception =\n          assertThatExceptionOfType(IllegalUri.class)\n              .isThrownBy(() -> Uri.parse(\"not~scheme:foo\"))\n              .actual();\n      assertThat(exception.getMessage()).isEqualTo(\"Illegal uri: `not~scheme:foo`\");\n      assertThat(exception.getIllegalValue()).isEqualTo(\"not~scheme:foo\");\n\n      IllegalScheme cause =\n          assertThat(exception.getCause()).asInstanceOf(type(IllegalScheme.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\n              \"Illegal scheme `not~scheme`; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n      assertThat(cause.getIllegalValue()).isEqualTo(\"not~scheme\");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    @Test\n    void rejects_illegal_uri() {\n      IllegalUri exception =\n          assertThatExceptionOfType(IllegalUri.class)\n              .isThrownBy(() -> Uri.parse(\"not a :uri\"))\n              .actual();\n      assertThat(exception.getMessage()).isEqualTo(\"Illegal uri: `not a :uri`\");\n      assertThat(exception.getIllegalValue()).isEqualTo(\"not a :uri\");\n\n      IllegalScheme cause =\n          assertThat(exception.getCause()).asInstanceOf(type(IllegalScheme.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\"Illegal scheme `not a `; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n      assertThat(cause.getIllegalValue()).isEqualTo(\"not a \");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    @Test\n    void rejects_illegal_relative_url() {\n      assertThatExceptionOfType(IllegalRelativeUrl.class)\n          .isThrownBy(() -> Uri.parse(\"#\\n\"))\n          .withMessage(\"Illegal relative url: `#\\n`\")\n          .withNoCause()\n          .extracting(IllegalUri::getIllegalValue)\n          .isEqualTo(\"#\\n\");\n    }\n\n    @Test\n    void rejects_illegal_absolute_url() {\n      assertThatExceptionOfType(IllegalAbsoluteUrl.class)\n          .isThrownBy(() -> Uri.parse(\"#:\\n\"))\n          .withMessage(\"Illegal absolute url: `#:\\n`\")\n          .withNoCause()\n          .extracting(IllegalUri::getIllegalValue)\n          .isEqualTo(\"#:\\n\");\n    }\n  }\n\n  @Nested\n  class ResolvedPort {\n\n    private static final List<ResolvedPortCase> resolvedPortCases =\n        List.of(\n            new ResolvedPortCase(\"//host:80\", Port.of(80)),\n            new ResolvedPortCase(\"https://host\", Port.of(443)),\n            new ResolvedPortCase(\"//host\", null));\n\n    @ParameterizedTest\n    @FieldSource(\"resolvedPortCases\")\n    void get_resolved_port_returns_correct_port(ResolvedPortCase testCase) {\n      var uri = Uri.parse(testCase.uri);\n      assertThat(uri.getResolvedPort()).isEqualTo(testCase.expected);\n    }\n\n    record ResolvedPortCase(String uri, @Nullable Port expected) {}\n  }\n\n  @Nested\n  class Builder {\n\n    @Test\n    void can_build_a_uri() {\n\n      var uri =\n          Uri.builder()\n              .setAuthority(Authority.parse(\"example.com\"))\n              .setPath(Path.parse(\"/path\"))\n              .setQuery(Query.parse(\"query\"))\n              .setFragment(Fragment.parse(\"fragment\"))\n              .build();\n\n      assertThat(uri).isEqualTo(Uri.parse(\"//example.com/path?query#fragment\"));\n    }\n\n    @Test\n    void can_build_a_uri_with_separate_authority_parts() {\n\n      var uri =\n          Uri.builder()\n              .setHost(Host.parse(\"example.com\"))\n              .setUserInfo(UserInfo.parse(\"user:password\"))\n              .setPort(Port.of(8443))\n              .setPath(Path.parse(\"/path\"))\n              .setQuery(Query.parse(\"query\"))\n              .setFragment(Fragment.parse(\"fragment\"))\n              .build();\n\n      assertThat(uri).isEqualTo(Uri.parse(\"//user:password@example.com:8443/path?query#fragment\"));\n    }\n\n    private static final List<Uri.Builder> authorityBuilders =\n        List.of(\n            Uri.builder()\n                .setHost(Host.parse(\"example.com\"))\n                .setUserInfo(UserInfo.parse(\"user:password\"))\n                .setPort(Port.of(8443)),\n            Uri.builder()\n                .setHost(Host.parse(\"example.com\"))\n                .setPort(Port.of(8443))\n                .setUserInfo(UserInfo.parse(\"user:password\")),\n            Uri.builder()\n                .setPort(Port.of(8443))\n                .setHost(Host.parse(\"example.com\"))\n                .setUserInfo(UserInfo.parse(\"user:password\")),\n            Uri.builder()\n                .setPort(Port.of(8443))\n                .setUserInfo(UserInfo.parse(\"user:password\"))\n                .setHost(Host.parse(\"example.com\")),\n            Uri.builder()\n                .setUserInfo(UserInfo.parse(\"user:password\"))\n                .setPort(Port.of(8443))\n                .setHost(Host.parse(\"example.com\")),\n            Uri.builder()\n                .setUserInfo(UserInfo.parse(\"user:password\"))\n                .setHost(Host.parse(\"example.com\"))\n                .setPort(Port.of(8443)));\n\n    @ParameterizedTest\n    @FieldSource(\"authorityBuilders\")\n    void can_set_authority_fields_in_any_order(UriBuilder builder) {\n      var uri =\n          builder\n              .setPath(Path.parse(\"/path\"))\n              .setQuery(Query.parse(\"query\"))\n              .setFragment(Fragment.parse(\"fragment\"))\n              .build();\n      assertThat(uri).isEqualTo(Uri.parse(\"//user:password@example.com:8443/path?query#fragment\"));\n    }\n\n    @Test\n    void setting_user_info_after_authority_works() {\n      var uri =\n          Uri.builder()\n              .setAuthority(Authority.parse(\"user@example.com:8443\"))\n              .setUserInfo(UserInfo.parse(\"me:passwd\"))\n              .build();\n\n      assertThat(uri).isEqualTo(Uri.parse(\"//me:passwd@example.com:8443/\"));\n    }\n\n    @Test\n    void setting_host_after_authority_works() {\n      var uri =\n          Uri.builder()\n              .setAuthority(Authority.parse(\"user@www.example.com:8443\"))\n              .setHost(Host.parse(\"example.com\"))\n              .build();\n\n      assertThat(uri).isEqualTo(Uri.parse(\"//user@example.com:8443/\"));\n    }\n\n    @Test\n    void setting_port_after_authority_works() {\n      var uri =\n          Uri.builder()\n              .setAuthority(Authority.parse(\"user@example.com:8443\"))\n              .setPort(Port.of(88443))\n              .build();\n\n      assertThat(uri).isEqualTo(Uri.parse(\"//user@example.com:88443/\"));\n    }\n\n    @Test\n    void authority_overrides_user_info_and_port() {\n      var uri =\n          Uri.builder()\n              .setUserInfo(UserInfo.parse(\"me:passwd\"))\n              .setPort(Port.of(88443))\n              .setAuthority(Authority.parse(\"user@example.com:8443\"))\n              .build();\n\n      assertThat(uri).isEqualTo(Uri.parse(\"//user@example.com:8443/\"));\n    }\n\n    @Test\n    void build_fails_if_user_info_set_and_host_or_authority_not() {\n      assertThatIllegalStateException()\n          .isThrownBy(() -> Uri.builder().setUserInfo(UserInfo.parse(\"me:passwd\")).build())\n          .withMessage(\"Cannot construct a uri with a userinfo or port but no host\")\n          .withNoCause();\n    }\n\n    @Test\n    void build_fails_if_port_set_and_host_or_authority_not() {\n      assertThatIllegalStateException()\n          .isThrownBy(() -> Uri.builder().setPort(Port.of(88443)).build())\n          .withMessage(\"Cannot construct a uri with a userinfo or port but no host\")\n          .withNoCause();\n    }\n\n    @Test\n    void build_fails_if_user_info_and_port_set_and_host_or_authority_not() {\n      assertThatIllegalStateException()\n          .isThrownBy(\n              () ->\n                  Uri.builder()\n                      .setUserInfo(UserInfo.parse(\"me:passwd\"))\n                      .setPort(Port.of(88443))\n                      .build())\n          .withMessage(\"Cannot construct a uri with a userinfo or port but no host\")\n          .withNoCause();\n    }\n\n    @Test\n    void build_with_path_set_to_double_slash_and_no_authority_returns_path_and_query() {\n      Uri uri = Uri.builder().setPath(Path.parse(\"//\")).build();\n      assertThat(uri).isInstanceOf(PathAndQuery.class);\n      assertThat(uri.getPath()).hasToString(\"//\");\n    }\n\n    @Test\n    void build_fails_if_path_is_set_to_double_slash_and_no_authority_with_fragment() {\n      assertThatExceptionOfType(IllegalPathAndQuery.class)\n          .isThrownBy(\n              () ->\n                  Uri.builder()\n                      .setPath(Path.parse(\"//\"))\n                      .setFragment(Fragment.parse(\"frag\"))\n                      .build())\n          .withMessage(\n              \"Illegal relative url: `//#frag` - a relative url without authority's path may not start with //, as that would make the first segment an authority\")\n          .extracting(IllegalRelativeUrl::getIllegalValue)\n          .isEqualTo(\"//#frag\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/UrlTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.InstanceOfAssertFactories.type;\nimport static org.wiremock.url.SchemeRegistry.file;\nimport static org.wiremock.url.SchemeRegistry.wss;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\n\nclass UrlTests {\n\n  @Nested\n  class Parse {\n\n    @Test\n    void parses_absolute_url_correctly() {\n      var absoluteUrl = Url.parse(\"https://example.com/path?query#fragment\");\n\n      assertThat(absoluteUrl.toString()).isEqualTo(\"https://example.com/path?query#fragment\");\n      assertThat(absoluteUrl).isInstanceOf(AbsoluteUrl.class);\n      assertThat(absoluteUrl).isNotInstanceOf(ServersideAbsoluteUrl.class);\n    }\n\n    @Test\n    void parses_absolute_url_with_userinfo_correctly() {\n      var absoluteUrl = Url.parse(\"https://user@example.com/path?query#fragment\");\n\n      assertThat(absoluteUrl.toString()).isEqualTo(\"https://user@example.com/path?query#fragment\");\n      assertThat(absoluteUrl).isInstanceOf(AbsoluteUrl.class);\n      assertThat(absoluteUrl).isNotInstanceOf(ServersideAbsoluteUrl.class);\n    }\n\n    @Test\n    void parses_serverside_absolute_url_correctly() {\n      var serversideAbsoluteUrl = Url.parse(\"https://example.com/path?query\");\n\n      assertThat(serversideAbsoluteUrl.toString()).isEqualTo(\"https://example.com/path?query\");\n      assertThat(serversideAbsoluteUrl).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(serversideAbsoluteUrl).isNotInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_origin_correctly() {\n      var origin = Url.parse(\"https://example.com\");\n\n      assertThat(origin.toString()).isEqualTo(\"https://example.com\");\n      assertThat(origin).isInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_relative_url_with_authority_correctly() {\n      var relativeUrl = Url.parse(\"//example.com/path?query#fragment\");\n\n      assertThat(relativeUrl.toString()).isEqualTo(\"//example.com/path?query#fragment\");\n      assertThat(relativeUrl).isInstanceOf(RelativeUrl.class);\n      assertThat(relativeUrl).isNotInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_relative_url_without_authority_correctly() {\n      var relativeUrl = Url.parse(\"/path?query#fragment\");\n\n      assertThat(relativeUrl.toString()).isEqualTo(\"/path?query#fragment\");\n      assertThat(relativeUrl).isInstanceOf(RelativeUrl.class);\n      assertThat(relativeUrl).isNotInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_path_and_query_correctly() {\n      var pathAndQuery = Url.parse(\"/path?query\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"/path?query\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_relative_path_correctly() {\n      var pathAndQuery = Url.parse(\"relative\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"relative\");\n      assertThat(pathAndQuery).isInstanceOf(RelativeUrl.class);\n    }\n\n    @Test\n    void parses_empty_path_correctly() {\n      var pathAndQuery = Url.parse(\"\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_query_only_correctly() {\n      var pathAndQuery = Url.parse(\"?\");\n\n      assertThat(pathAndQuery.toString()).isEqualTo(\"?\");\n      assertThat(pathAndQuery).isInstanceOf(PathAndQuery.class);\n    }\n\n    @Test\n    void parses_fragment_only_correctly() {\n      var relativeUrl = Url.parse(\"#\");\n\n      assertThat(relativeUrl.toString()).isEqualTo(\"#\");\n      assertThat(relativeUrl).isInstanceOf(RelativeUrl.class);\n    }\n\n    @Test\n    void parses_file_empty_authority_correctly() {\n      var fileUri = Url.parse(\"file:///home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file:///home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(fileUri).isNotInstanceOf(Origin.class);\n    }\n\n    @Test\n    void parses_file_with_authority_correctly() {\n      var fileUri = Url.parse(\"file://user@remote/home/me/some/dir\");\n\n      assertThat(fileUri.toString()).isEqualTo(\"file://user@remote/home/me/some/dir\");\n      assertThat(fileUri).isInstanceOf(ServersideAbsoluteUrl.class);\n      assertThat(fileUri).isNotInstanceOf(Origin.class);\n    }\n\n    @Test\n    void rejects_illegal_uri() {\n      IllegalUri exception =\n          assertThatExceptionOfType(IllegalUri.class)\n              .isThrownBy(() -> Url.parse(\"not a :uri\"))\n              .actual();\n      assertThat(exception.getMessage()).isEqualTo(\"Illegal uri: `not a :uri`\");\n      assertThat(exception.getIllegalValue()).isEqualTo(\"not a :uri\");\n\n      IllegalScheme cause =\n          assertThat(exception.getCause()).asInstanceOf(type(IllegalScheme.class)).actual();\n      assertThat(cause.getMessage())\n          .isEqualTo(\"Illegal scheme `not a `; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\");\n      assertThat(cause.getIllegalValue()).isEqualTo(\"not a \");\n      assertThat(cause.getCause()).isNull();\n    }\n\n    static final List<String> illegalUrls =\n        Stream.of(\n                \"mailto:joan@example.com\",\n                \"arn:aws:servicecatalog:us-east-1:912624918755:stack/some-stack/pp-a3B9zXp1mQ7rS\",\n                \"file:/home/me/some/dir\")\n            .toList();\n\n    @ParameterizedTest\n    @FieldSource(\"illegalUrls\")\n    void rejects_illegal_url(String illegalUrl) {\n      assertThatExceptionOfType(IllegalUrl.class)\n          .isThrownBy(() -> Url.parse(illegalUrl))\n          .withMessage(\"Illegal url: `\" + illegalUrl + \"`; a url has an authority\")\n          .extracting(IllegalUrl::getIllegalValue)\n          .isEqualTo(illegalUrl);\n    }\n  }\n\n  @Nested\n  class Transform {\n\n    @Test\n    void can_change_an_absolute_urls_scheme() {\n\n      Url url = Url.parse(\"https://user@example.com:8443/path?query#fragment\");\n      Url transformed = url.transform(it -> it.setScheme(wss));\n\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .isEqualTo(Url.parse(\"wss://user@example.com:8443/path?query#fragment\"));\n    }\n\n    @Test\n    void can_set_a_scheme_relative_urls_scheme() {\n\n      Url url = Url.parse(\"//user@example.com:8443/path?query#fragment\");\n      Url transformed = url.transform(it -> it.setScheme(wss));\n\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .isEqualTo(Url.parse(\"wss://user@example.com:8443/path?query#fragment\"));\n    }\n\n    @Test\n    void can_set_a_relative_urls_scheme_with_authority() {\n\n      Url url = Url.parse(\"/path?query#fragment\");\n      Url transformed =\n          url.transform(it -> it.setScheme(wss).setAuthority(Authority.parse(\"www.example.com\")));\n\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .isEqualTo(Url.parse(\"wss://www.example.com/path?query#fragment\"));\n    }\n\n    @Test\n    void cannot_set_a_relative_urls_scheme_without_authority() {\n\n      Url url = Url.parse(\"/path?query#fragment\");\n      assertThatExceptionOfType(IllegalUrl.class)\n          .isThrownBy(() -> url.transform(it -> it.setScheme(file)))\n          .withMessage(\"Illegal url: `file:/path?query#fragment`; a url has an authority\")\n          .withNoCause()\n          .extracting(IllegalUrl::getIllegalValue)\n          .isEqualTo(\"file:/path?query#fragment\");\n    }\n\n    @Test\n    void can_change_an_absolute_urls_authority() {\n\n      Url url = Url.parse(\"https://user@example.com:8443/path?query#fragment\");\n      Url transformed = url.transform(it -> it.setAuthority(Authority.parse(\"www.example.com\")));\n\n      assertThat(transformed)\n          .isInstanceOf(AbsoluteUrl.class)\n          .isEqualTo(Url.parse(\"https://www.example.com/path?query#fragment\"));\n    }\n\n    @Test\n    void can_change_a_scheme_relative_urls_authority() {\n\n      Url url = Url.parse(\"//user@example.com:8443/path?query#fragment\");\n      Url transformed = url.transform(it -> it.setAuthority(Authority.parse(\"www.example.com\")));\n\n      assertThat(transformed)\n          .isInstanceOf(SchemeRelativeUrl.class)\n          .isEqualTo(Url.parse(\"//www.example.com/path?query#fragment\"));\n    }\n\n    @Test\n    void can_set_a_relative_urls_authority() {\n\n      Url url = Url.parse(\"/path?query#fragment\");\n      Url transformed = url.transform(it -> it.setAuthority(Authority.parse(\"www.example.com\")));\n\n      assertThat(transformed)\n          .isInstanceOf(SchemeRelativeUrl.class)\n          .isEqualTo(Url.parse(\"//www.example.com/path?query#fragment\"));\n    }\n  }\n\n  @Nested\n  class Builder {\n\n    @Test\n    void can_update_query() {\n      var url = Url.parse(\"https://example.com/?a=b\");\n      Url.Transformer<?> builder = url.thaw();\n      builder.getQueryBuilder().append(\"b\", \"2\");\n      Url updated = builder.build();\n      assertThat(updated).hasToString(\"https://example.com/?a=b&b=2\");\n    }\n\n    @Test\n    void getQuery_returns_empty_builder_when_no_query() {\n      var url = Url.parse(\"https://example.com/\");\n      Url.Transformer<?> builder = url.thaw();\n      Query.Builder queryBuilder = builder.getQueryBuilder();\n      assertThat(queryBuilder.build().toString()).isEmpty();\n    }\n\n    @Test\n    void getQuery_returns_builder_with_existing_params() {\n      var url = Url.parse(\"https://example.com/?a=1&b=2\");\n      Url.Transformer<?> builder = url.thaw();\n      Query.Builder queryBuilder = builder.getQueryBuilder();\n      Query built = queryBuilder.build();\n      assertThat(built.get(\"a\")).containsExactly(QueryParamValue.parse(\"1\"));\n      assertThat(built.get(\"b\")).containsExactly(QueryParamValue.parse(\"2\"));\n    }\n\n    @Test\n    void getQuery_returns_same_builder_on_multiple_calls() {\n      var url = Url.parse(\"https://example.com/?a=1\");\n      Url.Transformer<?> builder = url.thaw();\n      Query.Builder queryBuilder1 = builder.getQueryBuilder();\n      Query.Builder queryBuilder2 = builder.getQueryBuilder();\n      assertThat(queryBuilder1).isSameAs(queryBuilder2);\n    }\n\n    @Test\n    void getQuery_modifications_reflected_in_build() {\n      var url = Url.parse(\"https://example.com/?a=1\");\n      Url.Transformer<?> builder = url.thaw();\n      builder.getQueryBuilder().append(\"b\", \"2\");\n      builder.getQueryBuilder().append(\"c\", \"3\");\n      Url updated = builder.build();\n      assertThat(updated).hasToString(\"https://example.com/?a=1&b=2&c=3\");\n    }\n\n    @Test\n    void setQuery_clears_query_builder() {\n      var url = Url.parse(\"https://example.com/?a=1\");\n      Url.Transformer<?> builder = url.thaw();\n      builder.getQueryBuilder().append(\"b\", \"2\");\n      builder.setQuery(Query.parse(\"x=9\"));\n      Url updated = builder.build();\n      assertThat(updated).hasToString(\"https://example.com/?x=9\");\n    }\n\n    @Test\n    void setQuery_with_builder_sets_query() {\n      var url = Url.parse(\"https://example.com/\");\n      Url.Transformer<?> builder = url.thaw();\n      Query.Builder queryBuilder = Query.builder().append(\"a\", \"1\").append(\"b\", \"2\");\n      builder.setQueryBuilder(queryBuilder);\n      Url updated = builder.build();\n      assertThat(updated).hasToString(\"https://example.com/?a=1&b=2\");\n    }\n\n    @Test\n    void setQuery_with_empty_builder_removes_query() {\n      var url = Url.parse(\"https://example.com/?a=1\");\n      Url.Transformer<?> builder = url.thaw();\n      builder.setQueryBuilder(Query.builder());\n      Url updated = builder.build();\n      assertThat(updated).hasToString(\"https://example.com/\");\n    }\n\n    @Test\n    void setQuery_null_removes_query() {\n      var url = Url.parse(\"https://example.com/?a=1\");\n      Url.Transformer<?> builder = url.thaw();\n      builder.setQuery((Query) null);\n      Url updated = builder.build();\n      assertThat(updated).hasToString(\"https://example.com/\");\n    }\n\n    @Test\n    void getQuery_after_setQuery_returns_new_builder() {\n      var url = Url.parse(\"https://example.com/?a=1\");\n      Url.Transformer<?> builder = url.thaw();\n      Query.Builder originalBuilder = builder.getQueryBuilder();\n      builder.setQuery(Query.parse(\"x=9\"));\n      Query.Builder newBuilder = builder.getQueryBuilder();\n      assertThat(newBuilder).isNotSameAs(originalBuilder);\n      assertThat(newBuilder.build().get(\"x\")).containsExactly(QueryParamValue.parse(\"9\"));\n    }\n\n    @Test\n    void can_chain_getQuery_modifications() {\n      var url = Url.parse(\"https://example.com/\");\n      Url updated =\n          url.transform(\n              builder -> {\n                builder.getQueryBuilder().append(\"a\", \"1\");\n                builder.getQueryBuilder().remove(\"a\");\n                builder.getQueryBuilder().append(\"b\", \"2\");\n              });\n      assertThat(updated).hasToString(\"https://example.com/?b=2\");\n    }\n\n    @Test\n    void getQuery_with_put_replaces_values() {\n      var url = Url.parse(\"https://example.com/?a=1&a=2\");\n      Url updated = url.transform(builder -> builder.getQueryBuilder().put(\"a\", \"replaced\"));\n      assertThat(updated).hasToString(\"https://example.com/?a=replaced\");\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/UserInfoTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.jspecify.annotations.Nullable;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\nclass UserInfoTests {\n\n  @Nested\n  class Parse {\n\n    static final List<String> validUserInfo =\n        List.of(\n            // Simple usernames\n            \"user\",\n            \"admin\",\n            \"john\",\n            \"alice123\",\n\n            // Username with password\n            \"user:password\",\n            \"admin:secret123\",\n            \"john:passw0rd\",\n\n            // Unreserved characters (alphanumeric, hyphen, period, underscore, tilde)\n            \"user-name\",\n            \"user.name\",\n            \"user_name\",\n            \"user~name\",\n            \"User123\",\n            \"test-user_123.name~test\",\n\n            // Sub-delimiters (!$&'()*+,;=)\n            \"user!name\",\n            \"user$name\",\n            \"user&name\",\n            \"user'name\",\n            \"user(name)\",\n            \"user*name\",\n            \"user+name\",\n            \"user,name\",\n            \"user;name\",\n            \"user=name\",\n\n            // Percent-encoded characters\n            \"%20\", // space\n            \"user%20name\", // user name\n            \"user%40example\", // user@example\n            \"%C3%A9\", // é\n            \"caf%C3%A9\", // café\n\n            // With colons (common in password-based auth)\n            \":\",\n            \":::\",\n            \"user:\",\n            \":password\",\n            \"user:pass:extra\",\n\n            // with encoded colon in username\n            \"user_with_encoded_%3A_colon:password\",\n\n            // Complex combinations\n            \"john.doe:secret123\",\n            \"user%20one:p%40ssword\",\n            \"admin_123:!secret$\",\n            \"test+user:pass=123\",\n\n            // Empty (valid according to regex)\n            \"\");\n\n    @ParameterizedTest\n    @FieldSource(\"validUserInfo\")\n    void parses_valid_userinfo(String userInfoString) {\n      UserInfo userInfo = UserInfo.parse(userInfoString);\n      assertThat(userInfo.toString()).isEqualTo(userInfoString);\n    }\n\n    @TestFactory\n    Stream<DynamicTest> invariants() {\n      return StringParserInvariantTests.generateInvariantTests(\n          UserInfoParser.INSTANCE, validUserInfo);\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"user name\", // unencoded space\n          \"user@name\", // @ not allowed (must be percent-encoded)\n          \"user#name\", // # not allowed\n          \"user/name\", // / not allowed\n          \"user?name\", // ? not allowed\n          \"user[name]\", // brackets not allowed\n          \"user<name>\", // angle brackets not allowed\n          \"user\\\\name\", // backslash not allowed\n          \"user|name\", // pipe not allowed\n          \"user\\\"name\", // quote not allowed\n          \"%\", // incomplete encoding\n          \"%2\", // incomplete encoding\n          \"%GG\", // invalid hex\n          \"user%ZZname\" // invalid hex\n        })\n    void rejects_illegal_userinfo(String illegalUserInfo) {\n      assertThatExceptionOfType(IllegalUserInfo.class)\n          .isThrownBy(() -> UserInfo.parse(illegalUserInfo))\n          .withMessage(\"Illegal user info: `\" + illegalUserInfo + \"`\")\n          .withNoCause()\n          .extracting(IllegalUserInfo::getIllegalValue)\n          .isEqualTo(illegalUserInfo);\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    record DecodeCase(String input, String expected) {}\n\n    static final List<String> userInfoWithoutPercentEncoding =\n        List.of(\"\", \"user\", \"user:password\", \"admin:secret123\", \"john.doe:pass\");\n\n    static final List<DecodeCase> decodeCases =\n        List.of(\n            new DecodeCase(\"user%20name\", \"user name\"),\n            new DecodeCase(\"user%40example\", \"user@example\"),\n            new DecodeCase(\"caf%C3%A9\", \"café\"),\n            new DecodeCase(\"user:pass%20word\", \"user:pass word\"),\n            new DecodeCase(\"user%20one:p%40ssword\", \"user one:p@ssword\"),\n            new DecodeCase(\"%C3%A9:%C3%A9\", \"é:é\"),\n            new DecodeCase(\"user%2Fname:pass\", \"user/name:pass\"),\n            new DecodeCase(\"test:pass%3Aword\", \"test:pass:word\"));\n\n    @ParameterizedTest\n    @FieldSource(\"userInfoWithoutPercentEncoding\")\n    void returns_same_string_for_userinfo_without_percent_encoding(String userInfoString) {\n      UserInfo userInfo = UserInfo.parse(userInfoString);\n      assertThat(userInfo.decode()).isEqualTo(userInfoString);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"decodeCases\")\n    void decodes_percent_encoded_userinfo_correctly(DecodeCase testCase) {\n      UserInfo userInfo = UserInfo.parse(testCase.input());\n      assertThat(userInfo.decode()).isEqualTo(testCase.expected());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      return generateEncodeDecodeInvariantTests(\n          UserInfoParser.INSTANCE,\n          Stream.of(\n              \"foo\",\n              \"foo:bar\",\n              \"test123\",\n              \"hello world\",\n              \"user@example:password\",\n              \"café\",\n              \"こんにちは\"));\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<UserInfo>> normalisationCases =\n        Stream.of(\n                Pair.of(\"us%65r\", \"user\"),\n                Pair.of(\"user%2f\", \"user%2F\"),\n                Pair.of(\n                    \"user_with_encoded_%3A_colon:pass_%3A_word\",\n                    \"user_with_encoded_%3A_colon:pass_:_word\"))\n            .map(\n                it ->\n                    new NormalisationCase<>(\n                        UserInfo.parse(it.getLeft()), UserInfo.parse(it.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_user_info_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(normalisationCases);\n    }\n\n    static final List<UserInfo> alreadyNormalised =\n        Stream.of(\n                \"user\",\n                \"user:password\",\n                \"user:pass:word\",\n                \"user%2F:password%2F\",\n                \"user_with_encoded_%3A_colon:password\")\n            .map(UserInfo::parse)\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(alreadyNormalised);\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    record EqualityCase(String userInfo1, String userInfo2, boolean shouldBeEqual) {}\n\n    static final List<EqualityCase> equalityCases =\n        List.of(\n            new EqualityCase(\"user:password\", \"user:password\", true),\n            new EqualityCase(\"user1:password\", \"user2:password\", false),\n            new EqualityCase(\"user:password1\", \"user:password2\", false),\n            new EqualityCase(\"user:password\", \"USER:PASSWORD\", false));\n\n    @ParameterizedTest\n    @FieldSource(\"equalityCases\")\n    void equality_comparison(EqualityCase testCase) {\n      UserInfo userInfo1 = UserInfo.parse(testCase.userInfo1());\n      UserInfo userInfo2 = UserInfo.parse(testCase.userInfo2());\n      if (testCase.shouldBeEqual()) {\n        assertThat(userInfo1).isEqualTo(userInfo2);\n      } else {\n        assertThat(userInfo1).isNotEqualTo(userInfo2);\n      }\n    }\n\n    @Test\n    void userinfo_is_equal_to_itself() {\n      UserInfo userInfo = UserInfo.parse(\"user:password\");\n      assertThat(userInfo).isEqualTo(userInfo);\n    }\n\n    @Test\n    void userinfo_is_not_equal_to_null() {\n      UserInfo userInfo = UserInfo.parse(\"user:password\");\n      assertThat(userInfo).isNotEqualTo(null);\n    }\n\n    @Test\n    @SuppressWarnings(\"AssertBetweenInconvertibleTypes\")\n    void userinfo_is_not_equal_to_different_type() {\n      UserInfo userInfo = UserInfo.parse(\"user:password\");\n      assertThat(userInfo).isNotEqualTo(\"user:password\");\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void equal_userinfo_have_same_hash_code() {\n      UserInfo userInfo1 = UserInfo.parse(\"user:password\");\n      UserInfo userInfo2 = UserInfo.parse(\"user:password\");\n      assertThat(userInfo1.hashCode()).isEqualTo(userInfo2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      UserInfo userInfo = UserInfo.parse(\"admin:secret123\");\n      int hashCode1 = userInfo.hashCode();\n      int hashCode2 = userInfo.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class ToString {\n\n    static final List<String> toStringTestCases =\n        List.of(\"user:password\", \"User:Password\", \"user%20name:pass%20word\", \"john.doe:secret123\");\n\n    @ParameterizedTest\n    @FieldSource(\"toStringTestCases\")\n    void to_string_returns_original_userinfo(String userInfoString) {\n      UserInfo userInfo = UserInfo.parse(userInfoString);\n      assertThat(userInfo.toString()).isEqualTo(userInfoString);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"toStringTestCases\")\n    void to_string_result_can_be_parsed_back(String userInfoString) {\n      UserInfo original = UserInfo.parse(userInfoString);\n      String stringForm = original.toString();\n      UserInfo parsed = UserInfo.parse(stringForm);\n      assertThat(parsed).isEqualTo(original);\n      assertThat(parsed.toString()).isEqualTo(stringForm);\n    }\n  }\n\n  @Nested\n  class UsernameAndPassword {\n\n    static final List<ExtractionCase> extractionCases =\n        List.of(\n            new ExtractionCase(\"john:secret\", \"john\", \"secret\"),\n            new ExtractionCase(\"john\", \"john\", null),\n            new ExtractionCase(\"john:\", \"john\", \"\"),\n            new ExtractionCase(\":password\", \"\", \"password\"),\n            new ExtractionCase(\"user:pass:word:123\", \"user\", \"pass:word:123\"));\n\n    @ParameterizedTest\n    @FieldSource(\"extractionCases\")\n    void extracts_username_and_password_correctly(ExtractionCase testCase) {\n      UserInfo userInfo = UserInfo.parse(testCase.input());\n      assertThat(userInfo.getUsername().toString()).isEqualTo(testCase.expectedUsername());\n      if (testCase.expectedPassword() == null) {\n        assertThat(userInfo.getPassword()).isNull();\n      } else {\n        assertThat(userInfo.getPassword()).isNotNull();\n        assertThat(userInfo.getPassword().toString()).isEqualTo(testCase.expectedPassword());\n      }\n    }\n\n    record ExtractionCase(\n        String input, String expectedUsername, @Nullable String expectedPassword) {}\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/UsernameTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.wiremock.url.PercentEncodedStringParserInvariantTests.generateEncodeDecodeInvariantTests;\n\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.apache.commons.lang3.tuple.Pair;\nimport org.junit.jupiter.api.DynamicTest;\nimport org.junit.jupiter.api.Nested;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.TestFactory;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.wiremock.url.NormalisableInvariantTests.NormalisationCase;\n\nclass UsernameTests {\n\n  @Nested\n  class Parse {\n\n    static final List<String> validUsernames =\n        List.of(\n            // Empty username\n            \"\",\n\n            // Simple usernames\n            \"user\",\n            \"admin\",\n            \"john\",\n            \"alice123\",\n\n            // Unreserved characters (alphanumeric, hyphen, period, underscore, tilde)\n            \"user-name\",\n            \"user.name\",\n            \"user_name\",\n            \"user~name\",\n            \"User123\",\n            \"test-user_123.name~test\",\n\n            // Sub-delimiters (!$&'()*+,;=)\n            \"user!name\",\n            \"user$name\",\n            \"user&name\",\n            \"user'name\",\n            \"user(name)\",\n            \"user*name\",\n            \"user+name\",\n            \"user,name\",\n            \"user;name\",\n            \"user=name\",\n\n            // Percent-encoded characters\n            \"%20\", // space\n            \"user%20name\", // user name\n            \"user%40example\", // user@example\n            \"%C3%A9\", // é\n            \"caf%C3%A9\", // café\n            \"user%3Aname\", // user:name (colon must be encoded)\n\n            // Complex combinations\n            \"john.doe\",\n            \"user%20one\",\n            \"admin_123\",\n            \"test+user\");\n\n    @ParameterizedTest\n    @FieldSource(\"validUsernames\")\n    void parses_valid_usernames(String usernameString) {\n      Username username = Username.parse(usernameString);\n      assertThat(username.toString()).isEqualTo(usernameString);\n    }\n\n    @ParameterizedTest\n    @ValueSource(\n        strings = {\n          \"user name\", // unencoded space\n          \"user@name\", // @ not allowed (must be percent-encoded)\n          \"user:name\", // : not allowed (must be percent-encoded)\n          \"user#name\", // # not allowed\n          \"user/name\", // / not allowed\n          \"user?name\", // ? not allowed\n          \"user[name]\", // brackets not allowed\n          \"user<name>\", // angle brackets not allowed\n          \"user\\\\name\", // backslash not allowed\n          \"user|name\", // pipe not allowed\n          \"user\\\"name\", // quote not allowed\n          \"%\", // incomplete encoding\n          \"%2\", // incomplete encoding\n          \"%2G\", // incomplete encoding\n          \"%GG\", // invalid hex\n          \"user%ZZname\" // invalid hex\n        })\n    void rejects_illegal_username(String illegalUsername) {\n      assertThatExceptionOfType(IllegalUsername.class)\n          .isThrownBy(() -> Username.parse(illegalUsername))\n          .withMessage(\"Illegal username: `\" + illegalUsername + \"`\")\n          .withNoCause()\n          .extracting(IllegalUsername::getIllegalValue)\n          .isEqualTo(illegalUsername);\n    }\n\n    @TestFactory\n    Stream<DynamicTest> invariants() {\n      return StringParserInvariantTests.generateInvariantTests(\n          UsernameParser.INSTANCE, validUsernames);\n    }\n  }\n\n  @Nested\n  class Normalise {\n\n    static final List<NormalisationCase<UserInfo>> normalisationCases =\n        Stream.of(Pair.of(\"us%65r\", \"user\"), Pair.of(\"user%2f\", \"user%2F\"))\n            .map(\n                it ->\n                    new NormalisationCase<>(\n                        UserInfo.parse(it.getLeft()), UserInfo.parse(it.getRight())))\n            .toList();\n\n    @TestFactory\n    Stream<DynamicTest> normalises_user_info_correctly() {\n      return NormalisableInvariantTests.generateNotNormalisedInvariantTests(normalisationCases);\n    }\n\n    static final List<UserInfo> alreadyNormalised =\n        Stream.of(\"user\", \"user%2F\", \"user_with_encoded_%3A_colon\").map(UserInfo::parse).toList();\n\n    @TestFactory\n    Stream<DynamicTest> already_normalised_invariants() {\n      return NormalisableInvariantTests.generateNormalisedInvariantTests(alreadyNormalised);\n    }\n  }\n\n  @Nested\n  class Codec {\n\n    static final List<String> usernamesWithoutPercentEncoding =\n        List.of(\"\", \"user\", \"admin\", \"user-name\", \"user.name\", \"User123\");\n\n    @ParameterizedTest\n    @FieldSource(\"usernamesWithoutPercentEncoding\")\n    void encode_returns_same_string_for_username_without_percent_encoding(String usernameString) {\n      Username username = Username.encode(usernameString);\n      assertThat(username.toString()).isEqualTo(usernameString);\n      assertThat(username.decode()).isEqualTo(usernameString);\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"usernamesWithoutPercentEncoding\")\n    void decode_returns_same_string_for_username_without_percent_encoding(String usernameString) {\n      Username username = Username.parse(usernameString);\n      assertThat(username.decode()).isEqualTo(usernameString);\n    }\n\n    static final List<CodecCase> codecCases =\n        List.of(\n            new CodecCase(\"user%20name\", \"user name\"),\n            new CodecCase(\"user%3Aname\", \"user:name\"),\n            new CodecCase(\"user%25name\", \"user%name\"),\n            new CodecCase(\"%C3%A9\", \"é\"),\n            new CodecCase(\"caf%C3%A9\", \"café\"),\n            new CodecCase(\"user%40example\", \"user@example\"),\n            new CodecCase(\"user%3Aname\", \"user:name\"),\n            new CodecCase(\"%20\", \" \"),\n            new CodecCase(\"hello%20world\", \"hello world\"),\n            new CodecCase(\"test%2Fuser\", \"test/user\"));\n\n    @ParameterizedTest\n    @FieldSource(\"codecCases\")\n    void encodes_percent_encoded_username_correctly(CodecCase testCase) {\n      Username username = Username.encode(testCase.decoded());\n      assertThat(username.toString()).isEqualTo(testCase.encoded());\n    }\n\n    @ParameterizedTest\n    @FieldSource(\"codecCases\")\n    void decodes_percent_encoded_username_correctly(CodecCase testCase) {\n      Username username = Username.parse(testCase.encoded());\n      assertThat(username.decode()).isEqualTo(testCase.decoded());\n    }\n\n    @TestFactory\n    Stream<DynamicTest> encode_decode_invariants() {\n      return generateEncodeDecodeInvariantTests(\n          UsernameParser.INSTANCE,\n          Stream.of(\"foo\", \"bar\", \"test123\", \"hello world\", \"user@example\", \"café\", \"こんにちは\"));\n    }\n  }\n\n  @Nested\n  class Equality {\n\n    @Test\n    void usernames_with_same_value_are_equal() {\n      Username username1 = Username.parse(\"user\");\n      Username username2 = Username.parse(\"user\");\n      assertThat(username1).isEqualTo(username2);\n    }\n\n    @Test\n    void usernames_with_different_values_are_not_equal() {\n      Username username1 = Username.parse(\"user1\");\n      Username username2 = Username.parse(\"user2\");\n      assertThat(username1).isNotEqualTo(username2);\n    }\n\n    @Test\n    void usernames_with_different_case_are_not_equal() {\n      Username username1 = Username.parse(\"user\");\n      Username username2 = Username.parse(\"USER\");\n      assertThat(username1).isNotEqualTo(username2);\n    }\n\n    @Test\n    void username_is_equal_to_itself() {\n      Username username = Username.parse(\"user\");\n      assertThat(username).isEqualTo(username);\n    }\n\n    @Test\n    void username_is_not_equal_to_null() {\n      Username username = Username.parse(\"user\");\n      assertThat(username).isNotEqualTo(null);\n    }\n\n    @Test\n    @SuppressWarnings(\"AssertBetweenInconvertibleTypes\")\n    void username_is_not_equal_to_different_type() {\n      Username username = Username.parse(\"user\");\n      assertThat(username).isNotEqualTo(\"user\");\n    }\n  }\n\n  @Nested\n  class HashCode {\n\n    @Test\n    void equal_usernames_have_same_hash_code() {\n      Username username1 = Username.parse(\"user\");\n      Username username2 = Username.parse(\"user\");\n      assertThat(username1.hashCode()).isEqualTo(username2.hashCode());\n    }\n\n    @Test\n    void hash_code_is_consistent() {\n      Username username = Username.parse(\"admin123\");\n      int hashCode1 = username.hashCode();\n      int hashCode2 = username.hashCode();\n      assertThat(hashCode1).isEqualTo(hashCode2);\n    }\n  }\n\n  @Nested\n  class ToStringMethod {\n\n    @Test\n    void to_string_returns_original_username() {\n      String usernameString = \"user-name\";\n      Username username = Username.parse(usernameString);\n      assertThat(username.toString()).isEqualTo(usernameString);\n    }\n\n    @Test\n    void to_string_preserves_case() {\n      String usernameString = \"UserName\";\n      Username username = Username.parse(usernameString);\n      assertThat(username.toString()).isEqualTo(usernameString);\n    }\n\n    @Test\n    void to_string_preserves_percent_encoding() {\n      String encoded = \"user%20name\";\n      Username username = Username.parse(encoded);\n      assertThat(username.toString()).isEqualTo(encoded);\n    }\n\n    @Test\n    void to_string_result_can_be_parsed_back() {\n      Username original = Username.parse(\"user.name\");\n      String stringForm = original.toString();\n      Username parsed = Username.parse(stringForm);\n      assertThat(parsed).isEqualTo(original);\n      assertThat(parsed.toString()).isEqualTo(stringForm);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/package-info.java",
    "content": "@NullMarked\npackage org.wiremock.url;\n\nimport org.jspecify.annotations.NullMarked;\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/FailureWhatWGUrlTestCase.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\npublic sealed interface FailureWhatWGUrlTestCase extends WhatWGUrlTestCase\n    permits RelativeToFailureWhatWGUrlTestCase, SimpleFailureWhatWGUrlTestCase {\n\n  default boolean success() {\n    return false;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/NormalisedAreJavaUrisTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.junit.jupiter.api.Assertions.assertDoesNotThrow;\n\nimport java.net.URI;\nimport java.util.List;\nimport org.jspecify.annotations.Nullable;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.junit.jupiter.params.provider.ValueSource;\nimport org.wiremock.url.AbsoluteUri;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.Authority;\nimport org.wiremock.url.Origin;\nimport org.wiremock.url.Uri;\n\npublic class NormalisedAreJavaUrisTests {\n\n  @ParameterizedTest\n  @ValueSource(\n      strings = {\n        \"sc:foo\",\n        \"file:///\",\n        \"file://localhost\",\n        \"file://localhost/\",\n        \"sc:?\",\n        \"sc:foo?\",\n        \"file://?\",\n        \"file://#frag\",\n        \"file:///?\",\n        \"file://localhost?\",\n        \"file://localhost/?\",\n      })\n  void java_valid_uris(String validUri) {\n    assertDoesNotThrow(() -> URI.create(validUri));\n  }\n\n  @ParameterizedTest\n  @ValueSource(strings = {\"sc:\", \"file://\", \"sc:#frag\"})\n  void java_invalid_uris(String invalidUri) {\n    assertThatExceptionOfType(IllegalArgumentException.class)\n        .isThrownBy(() -> URI.create(invalidUri));\n  }\n\n  private static final List<? extends SimpleParseSuccess> wiremock_valid =\n      WhatWGUrlTestManagement.wiremock_valid;\n\n  @ParameterizedTest\n  @FieldSource(\"wiremock_valid\")\n  void normalised_are_all_valid_java_uris(SimpleParseSuccess testCase) {\n    var inputUriRef = Uri.parse(testCase.input());\n    Uri inputNormalised =\n        inputUriRef instanceof AbsoluteUri absoluteUri ? absoluteUri.normalise() : inputUriRef;\n\n    var baseUri = parseUri(testCase.base());\n    var baseNormalised = baseUri != null ? baseUri.normalise() : null;\n\n    Uri resolved = baseUri == null ? inputNormalised : baseUri.resolve(inputUriRef);\n\n    Origin origin = resolved instanceof AbsoluteUrl resolvedUrl ? resolvedUrl.getOrigin() : null;\n\n    assertDoesNotThrow(\n        () -> {\n          if (inputNormalised instanceof AbsoluteUri && notJavaEdgeCase(inputNormalised)) {\n            URI.create(inputNormalised.toString());\n          }\n          if (baseNormalised != null && notJavaEdgeCase(baseNormalised)) {\n            URI.create(baseNormalised.toString());\n          }\n          if (notJavaEdgeCase(resolved)) {\n            URI.create(resolved.toString());\n          }\n          if (origin != null && notJavaEdgeCase(origin)) {\n            URI.create(origin.toString());\n          }\n        });\n  }\n\n  private @Nullable AbsoluteUri parseUri(@Nullable String input) {\n    if (input == null) {\n      return null;\n    }\n    return AbsoluteUri.parse(input);\n  }\n\n  private static boolean notJavaEdgeCase(Uri uri) {\n    return !isJavaEdgeCase(uri);\n  }\n\n  private static boolean isJavaEdgeCase(Uri uri) {\n    Authority authority = uri.getAuthority();\n    boolean edgeCase1 = authority == null && uri.getPath().isEmpty() && uri.getQuery() == null;\n    boolean edgeCase2 =\n        authority != null\n            && authority.toString().isEmpty()\n            && uri.getPath().isEmpty()\n            && uri.getQuery() == null\n            && uri.getFragment() == null;\n    return edgeCase1 || edgeCase2;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/RelativeTo.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic enum RelativeTo {\n  @JsonProperty(\"non-opaque-path-base\")\n  NonOpaquePathBase,\n  @JsonProperty(\"any-base\")\n  AnyBase\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/RelativeToFailureWhatWGUrlTestCase.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\n\n@JsonIgnoreProperties({\"comment\", \"base\"})\npublic record RelativeToFailureWhatWGUrlTestCase(\n    // always present, never null, can be empty signifying empty input\n    String input, RelativeTo relativeTo) implements FailureWhatWGUrlTestCase {\n\n  @Override\n  public String context() {\n    return relativeTo.toString();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/SimpleFailureWhatWGUrlTestCase.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport org.jspecify.annotations.Nullable;\n\n@JsonIgnoreProperties({\"comment\"})\npublic record SimpleFailureWhatWGUrlTestCase(\n    // always present, never null, can be empty signifying empty input\n    String input,\n    // always present, can be null, never empty\n    // 213 null base & failure\n    //  60 present base & failure\n    @Nullable String base)\n    implements FailureWhatWGUrlTestCase {\n\n  @Override\n  @Nullable\n  public String context() {\n    return base;\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/SimpleParseFailure.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport org.jspecify.annotations.Nullable;\n\npublic record SimpleParseFailure(\n    @Override String input,\n    @Override @Nullable String base,\n    String exceptionType,\n    String exceptionMessage,\n    @Nullable String exceptionCauseType,\n    @Nullable String exceptionCauseMessage,\n    @Override WhatWGUrlTestCase source)\n    implements WireMockSnapshotTestCase {\n  public SimpleParseFailure {\n    if (base != null && (base.isEmpty() || base.equals(\"null\"))) {\n      throw new IllegalArgumentException(\"base cannot be \" + base);\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/SimpleParseSuccess.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport org.jspecify.annotations.Nullable;\n\npublic record SimpleParseSuccess(\n    @Override String input,\n    @Override @Nullable String base,\n    UriReferenceExpectation inputExpected,\n    UriReferenceExpectation inputNormalised,\n    @Nullable UriReferenceExpectation baseExpected,\n    @Nullable UriReferenceExpectation baseNormalised,\n    UriReferenceExpectation resolved,\n    @Nullable UriReferenceExpectation origin,\n    @Override WhatWGUrlTestCase source,\n    boolean matchesWhatWg)\n    implements WireMockSnapshotTestCase {}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/SnapshotTests.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\nimport static org.assertj.core.api.SoftAssertions.assertSoftly;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.writeResource;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Comparator;\nimport java.util.List;\nimport org.jspecify.annotations.Nullable;\nimport org.junit.jupiter.api.TestInstance;\nimport org.junit.jupiter.api.extension.AfterAllCallback;\nimport org.junit.jupiter.api.extension.ExtendWith;\nimport org.junit.jupiter.api.extension.ExtensionContext;\nimport org.junit.jupiter.api.extension.TestWatcher;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.wiremock.url.AbsoluteUri;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.IllegalUri;\nimport org.wiremock.url.Origin;\nimport org.wiremock.url.Uri;\n\n/**\n * Snapshot tests for URI/URL parsing behaviour.\n *\n * <h2>What is Snapshot Testing?</h2>\n *\n * Snapshot testing captures the actual behaviour of the URI parser and compares it against\n * previously recorded \"snapshots\" stored in JSON files. When implementation changes cause different\n * parsing behaviour, the tests fail but automatically update the snapshots to match the new\n * behaviour. This allows developers to review what changed and verify it's intentional.\n *\n * <h2>How It Works</h2>\n *\n * <ol>\n *   <li>Test cases are loaded from JSON snapshot files in {@code\n *       src/test/resources/org/wiremock/url/whatwg/}\n *   <li>Each test parses a URI and compares the result against expected values in the snapshot\n *   <li>When actual behaviour differs from the snapshot:\n *       <ul>\n *         <li>The test fails (as expected)\n *         <li>The actual behaviour is recorded in memory\n *         <li>After all tests complete, the {@link FailureTracker} writes updated snapshots to disk\n *       </ul>\n *   <li>Developers review the updated snapshots to verify the changes are correct\n *   <li>Re-running the tests with the updated snapshots will pass\n * </ol>\n *\n * <h2>Test Categories</h2>\n *\n * Tests are organised into four categories based on two dimensions:\n *\n * <ul>\n *   <li><strong>WHATWG validity</strong>: Whether the input is valid according to the WHATWG URL\n *       Standard\n *   <li><strong>WireMock validity</strong>: Whether WireMock successfully parses the input\n * </ul>\n *\n * This creates four snapshot files:\n *\n * <ul>\n *   <li>{@code whatwg_valid_wiremock_valid.json} - Valid by both standards (ideal cases)\n *   <li>{@code whatwg_valid_wiremock_invalid.json} - WHATWG considers valid but WireMock rejects\n *   <li>{@code whatwg_invalid_wiremock_valid.json} - WHATWG considers invalid but WireMock accepts\n *       (lenient parsing)\n *   <li>{@code whatwg_invalid_wiremock_invalid.json} - Invalid by both standards\n * </ul>\n *\n * <h2>What Gets Tested</h2>\n *\n * For successful parses ({@link #wiremock_valid}), the test verifies:\n *\n * <ul>\n *   <li>The parsed input URI and its normalised form\n *   <li>The parsed base URI (if provided) and its normalised form\n *   <li>The result of resolving the input against the base URI\n *   <li>The origin (for absolute URLs)\n *   <li>All URI components (scheme, authority, host, port, path, query, fragment, etc.)\n * </ul>\n *\n * For parsing failures ({@link #wiremock_invalid}), the test verifies:\n *\n * <ul>\n *   <li>The exception type thrown\n *   <li>The exception message\n *   <li>The cause exception type (if any)\n *   <li>The cause exception message (if any)\n * </ul>\n *\n * <h2>Developer Workflow</h2>\n *\n * <ol>\n *   <li>Make changes to the URI parsing implementation\n *   <li>Run {@code SnapshotTests}\n *   <li>If behaviour changed, tests will fail and snapshots will be updated\n *   <li>Review the diff in the JSON snapshot files (e.g., using git diff)\n *   <li>If changes are correct, commit the updated snapshots along with the code changes\n *   <li>If changes are incorrect, fix the implementation and repeat\n * </ol>\n *\n * @see WhatWGUrlTestManagement for test data loading and snapshot file management\n * @see FailureTracker for the JUnit extension that handles snapshot updates\n */\n@TestInstance(TestInstance.Lifecycle.PER_CLASS)\n@ExtendWith(FailureTracker.class)\npublic class SnapshotTests {\n\n  final List<SimpleParseFailure> updated_whatwg_valid_wiremock_invalid = new ArrayList<>();\n  final List<SimpleParseFailure> updated_whatwg_invalid_wiremock_invalid = new ArrayList<>();\n  final List<SimpleParseSuccess> updated_whatwg_valid_wiremock_valid = new ArrayList<>();\n  final List<SimpleParseSuccess> updated_whatwg_invalid_wiremock_valid = new ArrayList<>();\n\n  volatile boolean failed = false;\n\n  private static final List<? extends SimpleParseSuccess> wiremock_valid =\n      WhatWGUrlTestManagement.wiremock_valid;\n\n  @ParameterizedTest\n  @FieldSource(\"wiremock_valid\")\n  void wiremock_valid(SimpleParseSuccess testCase) {\n\n    var inputUriRef = parseReference(testCase, testCase.input());\n    Uri inputNormalised =\n        inputUriRef instanceof AbsoluteUri absoluteUri ? absoluteUri.normalise() : inputUriRef;\n\n    var baseUri = parseUri(testCase, testCase.base());\n    var baseNormalised = baseUri != null ? baseUri.normalise() : null;\n\n    Uri resolved = baseUri == null ? inputNormalised : baseUri.resolve(inputUriRef);\n\n    Origin origin = resolved instanceof AbsoluteUrl resolvedUrl ? resolvedUrl.getOrigin() : null;\n\n    try {\n      assertSoftly(\n          s -> {\n            s.assertThat(toExpectation(inputUriRef)).isEqualTo(testCase.inputExpected());\n            s.assertThat(toExpectation(inputNormalised)).isEqualTo(testCase.inputNormalised());\n            s.assertThat(toExpectation(baseUri)).isEqualTo(testCase.baseExpected());\n            s.assertThat(toExpectation(baseNormalised)).isEqualTo(testCase.baseNormalised());\n            s.assertThat(toExpectation(resolved)).isEqualTo(testCase.resolved());\n            s.assertThat(toExpectation(origin)).isEqualTo(testCase.origin());\n          });\n      registerSuccess(testCase);\n    } catch (AssertionError e) {\n      registerUpdatedSuccess(testCase);\n      throw e;\n    }\n  }\n\n  private static final List<? extends SimpleParseFailure> wiremock_invalid =\n      WhatWGUrlTestManagement.wiremock_invalid;\n\n  @ParameterizedTest\n  @FieldSource(\"wiremock_invalid\")\n  void wiremock_invalid(SimpleParseFailure testCase) {\n\n    var throwable =\n        assertThatExceptionOfType(IllegalUri.class)\n            .isThrownBy(\n                () -> {\n                  Uri.parse(testCase.input());\n                  registerUpdatedSuccess(testCase);\n                })\n            .actual();\n\n    try {\n      assertSoftly(\n          s -> {\n            s.assertThat(throwable.getClass().getSimpleName()).isEqualTo(testCase.exceptionType());\n            s.assertThat(throwable.getMessage()).isEqualTo(testCase.exceptionMessage());\n            s.assertThat(\n                    throwable.getCause() == null\n                        ? null\n                        : throwable.getCause().getClass().getSimpleName())\n                .isEqualTo(testCase.exceptionCauseType());\n            s.assertThat(throwable.getCause() == null ? null : throwable.getCause().getMessage())\n                .isEqualTo(testCase.exceptionCauseMessage());\n          });\n      registerFailure(testCase);\n    } catch (AssertionError e) {\n      registerUpdatedFailure(testCase, throwable);\n      throw e;\n    }\n  }\n\n  private Uri parseReference(SimpleParseSuccess testCase, String input) {\n    try {\n      return Uri.parse(input);\n    } catch (Exception e) {\n      registerUpdatedFailure(testCase, e);\n      throw e;\n    }\n  }\n\n  private @Nullable AbsoluteUri parseUri(SimpleParseSuccess testCase, @Nullable String input) {\n    if (input == null) {\n      return null;\n    }\n    try {\n      return AbsoluteUri.parse(input);\n    } catch (Exception e) {\n      registerUpdatedFailure(testCase, e);\n      throw e;\n    }\n  }\n\n  private void registerUpdatedSuccess(WireMockSnapshotTestCase testCase) {\n    String input = testCase.input();\n    Uri inputUriRef = Uri.parse(input);\n    Uri inputNormalised =\n        inputUriRef instanceof AbsoluteUri absoluteUri ? absoluteUri.normalise() : inputUriRef;\n\n    final UriReferenceExpectation inputExpected = toExpectation(inputUriRef);\n    final UriReferenceExpectation inputNormalisedExpected = toExpectation(inputNormalised);\n\n    final String base = testCase.base();\n\n    final AbsoluteUri baseUri;\n    final AbsoluteUri baseUriNormalised;\n    final Uri resolved;\n\n    if (base == null || base.isEmpty() || base.equals(\"null\")) {\n      baseUri = null;\n      baseUriNormalised = null;\n      resolved = inputNormalised;\n    } else {\n      baseUri = AbsoluteUri.parse(base);\n      baseUriNormalised = baseUri.normalise();\n      resolved = baseUri.resolve(inputUriRef);\n    }\n\n    final UriReferenceExpectation baseExpected = toExpectation(baseUri);\n    final UriReferenceExpectation baseNormalised = toExpectation(baseUriNormalised);\n    final UriReferenceExpectation resolvedExpected = toExpectation(resolved);\n\n    final UriReferenceExpectation origin;\n    if (resolved instanceof AbsoluteUrl resolvedUrl) {\n      origin = toExpectation(resolvedUrl.getOrigin());\n    } else {\n      origin = null;\n    }\n\n    SimpleParseSuccess updated =\n        new SimpleParseSuccess(\n            input,\n            base,\n            inputExpected,\n            inputNormalisedExpected,\n            baseExpected,\n            baseNormalised,\n            resolvedExpected,\n            origin,\n            testCase.source(),\n            matchesWhatWg(testCase.source(), resolved));\n    registerSuccess(updated);\n  }\n\n  private boolean matchesWhatWg(WhatWGUrlTestCase source, Uri resolved) {\n    if (source instanceof SuccessWhatWGUrlTestCase successWhatWGUrlTestCase) {\n      return successWhatWGUrlTestCase.href().equals(resolved.toString());\n    } else {\n      return false;\n    }\n  }\n\n  private void registerSuccess(SimpleParseSuccess testCase) {\n    if (testCase.source().failure()) {\n      updated_whatwg_invalid_wiremock_valid.add(testCase);\n    } else {\n      updated_whatwg_valid_wiremock_valid.add(testCase);\n    }\n  }\n\n  private void registerUpdatedFailure(WireMockSnapshotTestCase testCase, Throwable e) {\n    var failure =\n        new SimpleParseFailure(\n            testCase.input(),\n            testCase.base(),\n            e.getClass().getSimpleName(),\n            e.getMessage(),\n            e.getCause() == null ? null : e.getCause().getClass().getSimpleName(),\n            e.getCause() == null ? null : e.getCause().getMessage(),\n            testCase.source());\n    registerFailure(failure);\n  }\n\n  private void registerFailure(SimpleParseFailure failure) {\n    if (failure.source().failure()) {\n      updated_whatwg_invalid_wiremock_invalid.add(failure);\n    } else {\n      updated_whatwg_valid_wiremock_invalid.add(failure);\n    }\n  }\n\n  public static @Nullable UriReferenceExpectation toExpectation(@Nullable Uri uri) {\n    if (uri == null) {\n      return null;\n    }\n    return new UriReferenceExpectation(\n        uri.toString(),\n        getFirstInterface(uri),\n        uri.getScheme() == null ? null : uri.getScheme().toString(),\n        uri.getAuthority() == null ? null : uri.getAuthority().toString(),\n        uri.getUserInfo() == null ? null : uri.getUserInfo().toString(),\n        uri.getUserInfo() == null ? null : uri.getUserInfo().getUsername().toString(),\n        uri.getUserInfo() == null\n            ? null\n            : (uri.getUserInfo().getPassword() == null\n                ? null\n                : uri.getUserInfo().getPassword().toString()),\n        uri.getHost() == null ? null : uri.getHost().toString(),\n        uri.getPort() == null ? null : uri.getPort().toString(),\n        uri.getPath().toString(),\n        uri.getQuery() == null ? null : uri.getQuery().toString(),\n        uri.getFragment() == null ? null : uri.getFragment().toString());\n  }\n\n  static String getFirstInterface(Uri uri) {\n    //noinspection OptionalGetWithoutIsPresent\n    return Arrays.stream(uri.getClass().getInterfaces()).findFirst().get().getSimpleName();\n  }\n}\n\n/**\n * JUnit extension that tracks test failures and updates snapshot files.\n *\n * <p>This extension implements two JUnit interfaces:\n *\n * <ul>\n *   <li>{@link TestWatcher} - to detect when any test fails\n *   <li>{@link AfterAllCallback} - to write updated snapshots after all tests complete\n * </ul>\n *\n * <p>When any test in {@link SnapshotTests} fails, this extension:\n *\n * <ol>\n *   <li>Sets the {@code failed} flag to true\n *   <li>After all tests complete, writes the captured actual behaviour to snapshot JSON files\n *   <li>Sorts the test cases alphabetically by input for consistent file diffs\n * </ol>\n *\n * <p>The snapshot files are written to {@code src/test/resources/org/wiremock/url/whatwg/} with\n * names like {@code whatwg_valid_wiremock_valid.json}.\n */\nclass FailureTracker implements TestWatcher, AfterAllCallback {\n\n  @Override\n  @SuppressWarnings(\"OptionalGetWithoutIsPresent\")\n  public void testFailed(ExtensionContext context, @Nullable Throwable cause) {\n    ((SnapshotTests) context.getTestInstance().get()).failed = true;\n  }\n\n  @Override\n  @SuppressWarnings(\"OptionalGetWithoutIsPresent\")\n  public void afterAll(ExtensionContext context) throws Exception {\n    var snapshotTests = (SnapshotTests) context.getTestInstance().get();\n    if (snapshotTests.failed) {\n      writeResource(\n          \"whatwg_valid_wiremock_valid\",\n          sort(snapshotTests.updated_whatwg_valid_wiremock_valid),\n          new CustomDepthPrettyPrinter());\n      writeResource(\n          \"whatwg_valid_wiremock_invalid\",\n          sort(snapshotTests.updated_whatwg_valid_wiremock_invalid));\n      writeResource(\n          \"whatwg_invalid_wiremock_valid\",\n          sort(snapshotTests.updated_whatwg_invalid_wiremock_valid),\n          new CustomDepthPrettyPrinter());\n      writeResource(\n          \"whatwg_invalid_wiremock_invalid\",\n          sort(snapshotTests.updated_whatwg_invalid_wiremock_invalid));\n    }\n  }\n\n  private List<?> sort(List<? extends WireMockSnapshotTestCase> testCases) {\n    return testCases.stream()\n        .sorted(Comparator.comparing(WireMockSnapshotTestCase::input))\n        .toList();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/SuccessWhatWGUrlTestCase.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport org.apache.commons.text.StringEscapeUtils;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.AbsoluteUri;\nimport org.wiremock.url.Uri;\n\n// 596 success\n@JsonIgnoreProperties(\"comment\")\npublic record SuccessWhatWGUrlTestCase(\n\n    // always present, never null, can be empty signifying empty input\n    String input,\n\n    // always present, can be null, never empty\n    // 328 null base & success\n    // 268 present base & success\n    // 213 null base & failure\n    //  60 present base & failure\n    @Nullable String base,\n    String href,\n\n    // can be absent (null), never empty. What I call base url\n    @Nullable String origin,\n\n    // always present, never empty, never just \":\" on success\n    String protocol,\n\n    // always present, can be empty on success\n    String username,\n\n    // always present, can be empty on success\n    String password,\n\n    // always present, can be empty (226) on success\n    // what I call hostAndPort\n    String host,\n\n    // always present, can be empty (226) on success\n    // what I call host\n    String hostname,\n\n    // sometimes empty on success\n    // sometimes absent on success TEST ME\n    @Nullable String port,\n\n    // always present, can be empty (21) on success\n    String pathname,\n\n    // always present, often empty (531) on success\n    String search,\n\n    // sometimes present (9), can be empty (7) on success\n    @Nullable String searchParams,\n\n    // always present, often empty (537) on success\n    String hash)\n    implements WhatWGUrlTestCase {\n\n  public boolean success() {\n    return true;\n  }\n\n  @Override\n  public @Nullable String context() {\n    return base;\n  }\n\n  @Override\n  public String toString() {\n    return \"new SuccessWhatWGUrlTestCase(\"\n        + appendParameter(\"input\", input)\n        + ','\n        + appendParameter(\"base\", base)\n        + ','\n        + appendParameter(\"href\", href)\n        + ','\n        + appendParameter(\"origin\", origin)\n        + ','\n        + appendParameter(\"protocol\", protocol)\n        + ','\n        + appendParameter(\"username\", username)\n        + ','\n        + appendParameter(\"password\", password)\n        + ','\n        + appendParameter(\"host\", host)\n        + ','\n        + appendParameter(\"hostname\", hostname)\n        + ','\n        + appendParameter(\"port\", port)\n        + ','\n        + appendParameter(\"pathname\", pathname)\n        + ','\n        + appendParameter(\"search\", search)\n        + ','\n        + appendParameter(\"searchParams\", searchParams)\n        + ','\n        + appendParameter(\"hash\", hash)\n        + \"\\n)\";\n  }\n\n  private static String appendParameter(String name, @Nullable String value) {\n    return \"\\n  /* \" + name + \" */ \" + stringOrNull(value);\n  }\n\n  private static String stringOrNull(@Nullable String value) {\n    return value == null ? \"null\" : '\"' + StringEscapeUtils.escapeJava(value) + '\"';\n  }\n\n  public static void withContext(WhatWGUrlTestCase testCase, Runnable o) {\n    try {\n      o.run();\n    } catch (Throwable e) {\n      System.out.println(testCase);\n      var input = Uri.parse(testCase.input());\n      report(\"input\", input);\n      Uri resolved;\n      if (testCase instanceof SuccessWhatWGUrlTestCase successTestCase\n          && successTestCase.base() != null\n          && !successTestCase.base().isEmpty()\n          && !successTestCase.base().equals(\"sc://ñ\")) {\n        var base = AbsoluteUri.parse(successTestCase.base());\n        report(\"base\", base);\n        resolved = base.resolve(input);\n      } else {\n        resolved = input instanceof AbsoluteUri absoluteUri ? absoluteUri.normalise() : input;\n      }\n      report(\"resolved\", resolved);\n      throw e;\n    }\n  }\n\n  private static void report(String element, Uri uri) {\n    System.out.println(element + \": \" + uri.getClass() + \" `\" + uri + \"`\");\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/UriReferenceExpectation.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport org.jspecify.annotations.Nullable;\n\npublic record UriReferenceExpectation(\n    String stringValue,\n    String type,\n    @Nullable String scheme,\n    @Nullable String authority,\n    @Nullable String userInfo,\n    @Nullable String username,\n    @Nullable String password,\n    @Nullable String host,\n    @Nullable String port,\n    String path,\n    @Nullable String query,\n    @Nullable String fragment) {}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/WhatWGUrlInvariantTests.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatThrownBy;\nimport static org.wiremock.url.Lists.concat;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.remoteUrl;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.sortTestData;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.testData;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.updateTestData;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.whatwg_invalid_wiremock_invalid;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.whatwg_invalid_wiremock_valid;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.whatwg_valid_wiremock_invalid;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.whatwg_valid_wiremock_valid;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.wiremock_invalid;\nimport static org.wiremock.url.whatwg.WhatWGUrlTestManagement.wiremock_valid;\n\nimport java.io.IOException;\nimport java.net.InetSocketAddress;\nimport java.net.Socket;\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.condition.EnabledIf;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.FieldSource;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.Rfc3986Validator;\n\nclass WhatWGUrlInvariantTests {\n\n  @Test\n  @EnabledIf(\"remoteDataReachable\")\n  void test_data_is_up_to_date() throws IOException {\n    String expected = WhatWGUrlTestManagement.readRemote();\n    try {\n      assertThat(WhatWGUrlTestManagement.readLocal()).isEqualTo(expected);\n    } catch (AssertionError e) {\n      updateTestData(expected);\n      throw e;\n    }\n  }\n\n  @Test\n  void test_data_contains_no_duplicates() {\n    assertThat(testData).doesNotHaveDuplicates();\n  }\n\n  @Test\n  void whatwg_valid_wiremock_valid_contains_no_duplicates() {\n    assertThat(whatwg_valid_wiremock_valid).doesNotHaveDuplicates();\n  }\n\n  @Test\n  void whatwg_valid_wiremock_invalid_contains_no_duplicates() {\n    assertThat(whatwg_valid_wiremock_invalid).doesNotHaveDuplicates();\n  }\n\n  @Test\n  void whatwg_invalid_wiremock_valid_contains_no_duplicates() {\n    assertThat(whatwg_invalid_wiremock_valid).doesNotHaveDuplicates();\n  }\n\n  @Test\n  void whatwg_invalid_wiremock_invalid_contains_no_duplicates() {\n    assertThat(whatwg_invalid_wiremock_invalid).doesNotHaveDuplicates();\n  }\n\n  @Test\n  void whatwg_covers_all_cases() throws IOException {\n    coversAllWireMockCases(whatwg_valid, whatwg_invalid);\n  }\n\n  @Test\n  void wiremock_covers_all_cases() throws IOException {\n    coversAllWireMockCases(wiremock_valid, wiremock_invalid);\n  }\n\n  @Test\n  void rfc3986_covers_all_cases() throws IOException {\n    coversAllWhatWgCases(rfc3986_valid, rfc3986_invalid);\n  }\n\n  @Test\n  void java_covers_all_cases() throws IOException {\n    coversAllWhatWgCases(java_valid, java_invalid);\n  }\n\n  private static final List<? extends WhatWGUrlTestCase> rfc3986_valid =\n      WhatWGUrlTestManagement.rfc3986_valid;\n\n  @ParameterizedTest\n  @FieldSource(\"rfc3986_valid\")\n  void rfc3986_valid_is_correct(WhatWGUrlTestCase testCase) {\n    assertThat(Rfc3986Validator.isValidUriReference(testCase.input())).isTrue();\n  }\n\n  private static final List<? extends WhatWGUrlTestCase> rfc3986_invalid =\n      WhatWGUrlTestManagement.rfc3986_invalid;\n\n  @ParameterizedTest\n  @FieldSource(\"rfc3986_invalid\")\n  void rfc3986_invalid_is_correct(WhatWGUrlTestCase testCase) {\n    assertThat(Rfc3986Validator.isValidUriReference(testCase.input())).isFalse();\n  }\n\n  private static final List<? extends WireMockSnapshotTestCase> whatwg_valid =\n      WhatWGUrlTestManagement.whatwg_valid;\n\n  @ParameterizedTest\n  @FieldSource(\"whatwg_valid\")\n  void whatwg_valid_is_correct(WireMockSnapshotTestCase testCase) {\n    assertThat(testCase.source().success()).isTrue();\n  }\n\n  private static final List<? extends WireMockSnapshotTestCase> whatwg_invalid =\n      WhatWGUrlTestManagement.whatwg_invalid;\n\n  @ParameterizedTest\n  @FieldSource(\"whatwg_invalid\")\n  void whatwg_invalid_is_correct(WireMockSnapshotTestCase testCase) {\n    assertThat(testCase.source().success()).isFalse();\n  }\n\n  private static final List<? extends WhatWGUrlTestCase> java_valid =\n      WhatWGUrlTestManagement.java_valid;\n\n  @ParameterizedTest\n  @FieldSource(\"java_valid\")\n  void java_valid_is_correct(WhatWGUrlTestCase testCase) throws URISyntaxException {\n    new URI(testCase.input());\n  }\n\n  private static final List<? extends WhatWGUrlTestCase> java_invalid =\n      WhatWGUrlTestManagement.java_invalid;\n\n  @ParameterizedTest\n  @FieldSource(\"java_invalid\")\n  void java_invalid_is_correct(WhatWGUrlTestCase testCase) {\n    assertThatThrownBy(() -> new URI(testCase.input())).isInstanceOf(URISyntaxException.class);\n  }\n\n  private static void coversAllWhatWgCases(\n      List<? extends WhatWGUrlTestCase> valid, List<? extends WhatWGUrlTestCase> invalid)\n      throws IOException {\n    try {\n      @SuppressWarnings(\"unchecked\")\n      var concat = (List<WhatWGUrlTestCase>) concat(valid, invalid);\n      assertThat(concat).containsAll(testData);\n    } catch (AssertionError e) {\n      sortTestData();\n      throw e;\n    }\n  }\n\n  private static void coversAllWireMockCases(\n      List<? extends WireMockSnapshotTestCase> valid,\n      List<? extends WireMockSnapshotTestCase> invalid)\n      throws IOException {\n    try {\n      var whatWgTestCases = concat(valid, invalid).stream().map(WireMockSnapshotTestCase::source);\n\n      assertThat(whatWgTestCases).containsAll(testData);\n    } catch (AssertionError e) {\n      sortTestData();\n      throw e;\n    }\n  }\n\n  private static boolean remoteDataReachable() {\n    return hostReachable(remoteUrl);\n  }\n\n  @SuppressWarnings(\"SameParameterValue\")\n  private static boolean hostReachable(AbsoluteUrl url) {\n    try (Socket socket = new Socket()) {\n      //noinspection DataFlowIssue\n      socket.connect(\n          new InetSocketAddress(url.getHost().toString(), url.getResolvedPort().getIntValue()),\n          500);\n      return true;\n    } catch (IOException e) {\n      return false;\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/WhatWGUrlTestCase.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonInclude.Include;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport java.util.Comparator;\nimport org.jspecify.annotations.Nullable;\n\n@JsonInclude(Include.NON_NULL)\npublic sealed interface WhatWGUrlTestCase extends Comparable<WhatWGUrlTestCase>\n    permits FailureWhatWGUrlTestCase, SuccessWhatWGUrlTestCase {\n\n  boolean success();\n\n  String input();\n\n  @Nullable String context();\n\n  @JsonProperty(value = \"failure\", access = JsonProperty.Access.READ_ONLY)\n  @JsonInclude(JsonInclude.Include.NON_DEFAULT)\n  default boolean failure() {\n    return !success();\n  }\n\n  Comparator<WhatWGUrlTestCase> comparator =\n      Comparator.comparing(WhatWGUrlTestCase::input) // input assumed non-null\n          .thenComparing(\n              WhatWGUrlTestCase::context, Comparator.nullsFirst(Comparator.naturalOrder()));\n\n  @Override\n  default int compareTo(WhatWGUrlTestCase o) {\n    return comparator.compare(this, o);\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/WhatWGUrlTestManagement.java",
    "content": "/*\n * Copyright (C) 2025-2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport static java.nio.charset.StandardCharsets.UTF_8;\nimport static org.apache.commons.lang3.StringUtils.substringAfter;\nimport static org.apache.commons.lang3.StringUtils.substringBefore;\nimport static org.wiremock.url.Lists.concat;\nimport static org.wiremock.url.whatwg.SnapshotTests.toExpectation;\n\nimport com.fasterxml.jackson.core.JsonGenerator;\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fasterxml.jackson.core.PrettyPrinter;\nimport com.fasterxml.jackson.core.util.DefaultIndenter;\nimport com.fasterxml.jackson.core.util.DefaultPrettyPrinter;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport java.io.BufferedWriter;\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.net.URL;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.function.Function;\nimport org.apache.commons.lang3.StringUtils;\nimport org.jspecify.annotations.Nullable;\nimport org.wiremock.url.AbsoluteUri;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.IllegalUri;\nimport org.wiremock.url.OpaqueUri;\nimport org.wiremock.url.Origin;\nimport org.wiremock.url.Rfc3986Validator;\nimport org.wiremock.url.ServersideAbsoluteUrl;\nimport org.wiremock.url.Uri;\n\npublic class WhatWGUrlTestManagement {\n\n  private static final ObjectMapper objectMapper = new ObjectMapper();\n\n  static final AbsoluteUrl remoteUrl =\n      AbsoluteUrl.parse(\n          \"https://raw.githubusercontent.com/web-platform-tests/wpt/refs/heads/master/url/resources/urltestdata.json\");\n\n  private static final String URLTESTDATA_JSON = \"urltestdata.json\";\n\n  public static final List<? extends WhatWGUrlTestCase> testData =\n      toWhatWGUrlTestCases(readLocalJson());\n\n  private static List<WhatWGUrlTestCase> toWhatWGUrlTestCases(JsonNode jsonNode) {\n    return jsonNode\n        .valueStream()\n        .filter(JsonNode::isObject)\n        .map(WhatWGUrlTestManagement::mapToWhatWgUrlTestCase)\n        .toList();\n  }\n\n  private static WhatWGUrlTestCase mapToWhatWgUrlTestCase(JsonNode o) {\n    try {\n      JsonNode failure = o.get(\"failure\");\n      if (failure != null && failure.asBoolean()) {\n        if (o.get(\"relativeTo\") == null) {\n          return objectMapper.treeToValue(o, SimpleFailureWhatWGUrlTestCase.class);\n        } else {\n          return objectMapper.treeToValue(o, RelativeToFailureWhatWGUrlTestCase.class);\n        }\n      } else {\n        return objectMapper.treeToValue(o, SuccessWhatWGUrlTestCase.class);\n      }\n    } catch (JsonProcessingException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  private static WireMockSnapshotTestCase mapToWireMockSnapshotTestCase(JsonNode o) {\n    try {\n      var input = o.get(\"input\").asText();\n      var base = o.get(\"base\").textValue();\n      var source = mapToWhatWgUrlTestCase(o.get(\"source\"));\n      var inputExpectedNode = o.get(\"inputExpected\");\n      if (inputExpectedNode != null) {\n        var inputExpected =\n            objectMapper.treeToValue(inputExpectedNode, UriReferenceExpectation.class);\n        var inputNormalised =\n            objectMapper.treeToValue(o.get(\"inputNormalised\"), UriReferenceExpectation.class);\n        var baseExpected =\n            objectMapper.treeToValue(o.get(\"baseExpected\"), UriReferenceExpectation.class);\n        var baseNormalised =\n            objectMapper.treeToValue(o.get(\"baseNormalised\"), UriReferenceExpectation.class);\n        var resolved = objectMapper.treeToValue(o.get(\"resolved\"), UriReferenceExpectation.class);\n        var origin = objectMapper.treeToValue(o.get(\"origin\"), UriReferenceExpectation.class);\n        var matchesWhatWg = o.get(\"matchesWhatWg\").asBoolean();\n        return new SimpleParseSuccess(\n            input,\n            base,\n            inputExpected,\n            inputNormalised,\n            baseExpected,\n            baseNormalised,\n            resolved,\n            origin,\n            source,\n            matchesWhatWg);\n      } else {\n        JsonNode exceptionCauseType = o.get(\"exceptionCauseType\");\n        JsonNode exceptionCauseMessage = o.get(\"exceptionCauseMessage\");\n        return new SimpleParseFailure(\n            input,\n            base,\n            o.get(\"exceptionType\").textValue(),\n            o.get(\"exceptionMessage\").textValue(),\n            exceptionCauseType.textValue(),\n            exceptionCauseMessage.textValue(),\n            source);\n      }\n    } catch (JsonProcessingException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public static final List<SimpleParseSuccess> whatwg_valid_wiremock_valid =\n      (List<SimpleParseSuccess>)\n          readResource(\n              \"whatwg_valid_wiremock_valid\",\n              WhatWGUrlTestManagement::mapToWireMockSnapshotTestCase);\n\n  @SuppressWarnings(\"unchecked\")\n  static final List<SimpleParseFailure> whatwg_valid_wiremock_invalid =\n      (List<SimpleParseFailure>)\n          readResource(\n              \"whatwg_valid_wiremock_invalid\",\n              WhatWGUrlTestManagement::mapToWireMockSnapshotTestCase);\n\n  @SuppressWarnings(\"unchecked\")\n  static final List<SimpleParseSuccess> whatwg_invalid_wiremock_valid =\n      (List<SimpleParseSuccess>)\n          readResource(\n              \"whatwg_invalid_wiremock_valid\",\n              WhatWGUrlTestManagement::mapToWireMockSnapshotTestCase);\n\n  @SuppressWarnings(\"unchecked\")\n  static final List<SimpleParseFailure> whatwg_invalid_wiremock_invalid =\n      (List<SimpleParseFailure>)\n          readResource(\n              \"whatwg_invalid_wiremock_invalid\",\n              WhatWGUrlTestManagement::mapToWireMockSnapshotTestCase);\n\n  static final List<? extends WhatWGUrlTestCase> rfc3986_valid_java_valid =\n      readResource(\"rfc3986_valid_java_valid\", WhatWGUrlTestManagement::mapToWhatWgUrlTestCase);\n\n  static final List<? extends WhatWGUrlTestCase> rfc3986_valid_java_invalid =\n      readResource(\"rfc3986_valid_java_invalid\", WhatWGUrlTestManagement::mapToWhatWgUrlTestCase);\n\n  static final List<? extends WhatWGUrlTestCase> rfc3986_invalid_java_valid =\n      readResource(\"rfc3986_invalid_java_valid\", WhatWGUrlTestManagement::mapToWhatWgUrlTestCase);\n\n  static final List<? extends WhatWGUrlTestCase> rfc3986_invalid_java_invalid =\n      readResource(\"rfc3986_invalid_java_invalid\", WhatWGUrlTestManagement::mapToWhatWgUrlTestCase);\n\n  static final List<? extends WhatWGUrlTestCase> rfc3986_valid =\n      concat(rfc3986_valid_java_valid, rfc3986_valid_java_invalid);\n\n  static final List<? extends WhatWGUrlTestCase> rfc3986_invalid =\n      concat(rfc3986_invalid_java_valid, rfc3986_invalid_java_invalid);\n\n  static final List<? extends WhatWGUrlTestCase> java_valid =\n      concat(rfc3986_valid_java_valid, rfc3986_invalid_java_valid);\n\n  static final List<? extends WhatWGUrlTestCase> java_invalid =\n      concat(rfc3986_valid_java_invalid, rfc3986_invalid_java_invalid);\n\n  public static final List<? extends WireMockSnapshotTestCase> whatwg_valid =\n      concat(whatwg_valid_wiremock_valid, whatwg_valid_wiremock_invalid);\n\n  static final List<? extends WireMockSnapshotTestCase> whatwg_invalid =\n      concat(whatwg_invalid_wiremock_valid, whatwg_invalid_wiremock_invalid);\n\n  public static final List<? extends SimpleParseSuccess> wiremock_valid =\n      concat(whatwg_valid_wiremock_valid, whatwg_invalid_wiremock_valid);\n\n  public static final List<? extends SimpleParseFailure> wiremock_invalid =\n      concat(whatwg_valid_wiremock_invalid, whatwg_invalid_wiremock_invalid);\n\n  private static JsonNode readLocalJson() {\n    try {\n      return objectMapper.readTree(readLocal());\n    } catch (JsonProcessingException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  static void updateTestData(String testData) throws IOException {\n    File theFile = getResourceFile(URLTESTDATA_JSON);\n    if (theFile != null) {\n      try (var writer = new BufferedWriter(new FileWriter(theFile))) {\n        writer.write(testData);\n        System.err.println(\n            \"Updated with latest from \" + remoteUrl + \", test should pass next time\");\n      }\n    }\n  }\n\n  static String readLocal() {\n    try (var testData = WhatWGUrlTestManagement.class.getResourceAsStream(URLTESTDATA_JSON)) {\n      assert testData != null;\n      return normaliseToString(testData);\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  static String readRemote() throws IOException {\n    try (var testData = new URL(remoteUrl.toString()).openStream()) {\n      return normaliseToString(testData);\n    }\n  }\n\n  private static String normaliseToString(InputStream testData) throws IOException {\n    String value = new String(testData.readAllBytes(), UTF_8);\n    if (value.endsWith(\"\\n\")) {\n      return value;\n    } else {\n      return value + \"\\n\";\n    }\n  }\n\n  static <T> List<? extends T> readResource(String resourceName, Function<JsonNode, T> mapper) {\n    try (var resource = WhatWGUrlTestManagement.class.getResourceAsStream(resourceName + \".json\")) {\n      if (resource == null) {\n        return Collections.emptyList();\n      } else {\n        var json = objectMapper.readTree(resource);\n        return json.valueStream().map(mapper).toList();\n      }\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n  }\n\n  public static void writeResource(String resourceName, List<?> testCases) throws IOException {\n    var printer = new OneObjectPerLinePrettyPrinter();\n    writeResource(resourceName, testCases, printer);\n  }\n\n  public static void writeResource(String resourceName, List<?> testCases, PrettyPrinter printer)\n      throws IOException {\n    File theFile = getResourceFile(resourceName + \".json\");\n    if (theFile != null) {\n      objectMapper.writer(printer).writeValue(theFile, testCases);\n    }\n  }\n\n  private static @Nullable File getResourceFile(String resourceName) {\n    URL resourceUrl = WhatWGUrlTestManagement.class.getResource(resourceName);\n    if (resourceUrl != null && resourceUrl.getProtocol().equals(\"file\")) {\n      return new File(\n          resourceUrl.getPath().replace(\"/build/resources/test/\", \"/src/test/resources/\"));\n    } else {\n      return null;\n    }\n  }\n\n  static void sortTestData() throws IOException {\n    documentJavaUriBehaviour();\n    initialiseSimpleSuccesses();\n    initialiseSimpleFailures();\n    writeResource(\"whatwg_valid_wiremock_invalid\", List.of());\n    writeResource(\"whatwg_invalid_wiremock_valid\", List.of(), new CustomDepthPrettyPrinter());\n  }\n\n  private static void initialiseSimpleSuccesses() throws IOException {\n    List<SimpleParseSuccess> wiremock_valid_whatwg_valid =\n        testData.stream()\n            .filter(testCase -> testCase instanceof SuccessWhatWGUrlTestCase)\n            .map(testCase -> (SuccessWhatWGUrlTestCase) testCase)\n            .map(WhatWGUrlTestManagement::toWireMockSuccess)\n            .sorted()\n            .toList();\n\n    writeResource(\n        \"whatwg_valid_wiremock_valid\", wiremock_valid_whatwg_valid, new CustomDepthPrettyPrinter());\n  }\n\n  private static SimpleParseSuccess toWireMockSuccess(SuccessWhatWGUrlTestCase testCase) {\n\n    String input = testCase.input();\n    UriReferenceExpectation normalisedInputExpectation;\n    UriReferenceExpectation inputExpectation;\n    try {\n      Uri inputUriRef = Uri.parse(input);\n      inputExpectation = toExpectation(inputUriRef);\n      Uri inputNormalised =\n          inputUriRef instanceof AbsoluteUri absoluteUri ? absoluteUri.normalise() : inputUriRef;\n      normalisedInputExpectation = toExpectation(inputNormalised);\n    } catch (IllegalUri e) {\n      inputExpectation = expectation(testCase, input, false);\n      normalisedInputExpectation = expectation(testCase, input, true);\n    }\n\n    String base = normalise(testCase.base());\n    UriReferenceExpectation baseExpectation;\n    UriReferenceExpectation baseNormalised;\n    if (base != null) {\n      try {\n        Uri baseUriRef = Uri.parse(base);\n        baseExpectation = toExpectation(baseUriRef);\n        Uri base2 =\n            baseUriRef instanceof AbsoluteUri absoluteUri ? absoluteUri.normalise() : baseUriRef;\n        baseNormalised = toExpectation(base2);\n      } catch (IllegalUri e) {\n        baseExpectation = expectation(testCase, base, false);\n        baseNormalised = expectation(testCase, base, true);\n      }\n    } else {\n      baseExpectation = null;\n      baseNormalised = null;\n    }\n\n    String href = testCase.href();\n    UriReferenceExpectation resolved = expectation(testCase, href, true);\n\n    String origin = testCase.origin();\n    UriReferenceExpectation originExpectation = null;\n    if (normalise(origin) != null) {\n      originExpectation =\n          new UriReferenceExpectation(\n              origin,\n              Origin.class.getSimpleName(),\n              StringUtils.substringBefore(testCase.protocol(), \":\"),\n              testCase.host(),\n              null,\n              null,\n              null,\n              testCase.hostname().isEmpty() ? null : testCase.hostname(),\n              testCase.port() == null ? null : (testCase.port().isEmpty() ? null : testCase.port()),\n              \"\",\n              null,\n              null);\n    }\n\n    return new SimpleParseSuccess(\n        input,\n        base,\n        inputExpectation,\n        normalisedInputExpectation,\n        baseExpectation,\n        baseNormalised,\n        resolved,\n        originExpectation,\n        testCase,\n        true);\n  }\n\n  private static UriReferenceExpectation expectation(\n      SuccessWhatWGUrlTestCase testCase, String input, boolean normalised) {\n    String search = substringAfter(testCase.search(), \"?\");\n    String hash = substringAfter(testCase.hash(), \"#\");\n    Class<? extends AbsoluteUri> type = calculateType(testCase, input, normalised);\n    return new UriReferenceExpectation(\n        (testCase.pathname().isEmpty()\n                && normalised\n                && testCase.search().isEmpty()\n                && testCase.hash().isEmpty())\n            ? testCase.href() + \"/\"\n            : testCase.href(),\n        type.getSimpleName(),\n        substringBefore(testCase.protocol(), \":\"),\n        authority(testCase, type),\n        userInfo(testCase),\n        testCase.username().isEmpty() ? null : testCase.username(),\n        testCase.password().isEmpty() ? null : testCase.password(),\n        AbsoluteUrl.class.isAssignableFrom(type) ? testCase.hostname() : null,\n        testCase.port() == null ? null : (testCase.port().isEmpty() ? null : testCase.port()),\n        (testCase.pathname().isEmpty() && normalised) ? \"/\" : testCase.pathname(),\n        search.isEmpty() ? null : search,\n        hash.isEmpty() ? null : hash);\n  }\n\n  private static void initialiseSimpleFailures() throws IOException {\n    var wiremock_invalid_whatwg_invalid =\n        testData.stream()\n            .filter(testCase -> testCase instanceof FailureWhatWGUrlTestCase)\n            .map(testCase -> (FailureWhatWGUrlTestCase) testCase)\n            .map(WhatWGUrlTestManagement::toWireMockFailure)\n            .sorted()\n            .toList();\n\n    writeResource(\"whatwg_invalid_wiremock_invalid\", wiremock_invalid_whatwg_invalid);\n  }\n\n  @SuppressWarnings(\"ConstantValue\")\n  private static void documentJavaUriBehaviour() throws IOException {\n    var rfc3986_valid_java_valid = new ArrayList<WhatWGUrlTestCase>();\n    var rfc3986_valid_java_invalid = new ArrayList<WhatWGUrlTestCase>();\n    var rfc3986_invalid_java_valid = new ArrayList<WhatWGUrlTestCase>();\n    var rfc3986_invalid_java_invalid = new ArrayList<WhatWGUrlTestCase>();\n\n    testData.forEach(\n        test -> {\n          var rfc3986_valid = Rfc3986Validator.isValidUriReference(test.input());\n          var java_valid = javaValid(test.input());\n\n          if (rfc3986_valid && java_valid) {\n            rfc3986_valid_java_valid.add(test);\n          } else if (rfc3986_valid && !java_valid) {\n            rfc3986_valid_java_invalid.add(test);\n          } else if (!rfc3986_valid && java_valid) {\n            rfc3986_invalid_java_valid.add(test);\n          } else if (!rfc3986_valid && !java_valid) {\n            rfc3986_invalid_java_invalid.add(test);\n          } else {\n            throw new IllegalStateException(\"Unreachable\");\n          }\n        });\n\n    writeResource(\"rfc3986_valid_java_valid\", rfc3986_valid_java_valid);\n    writeResource(\"rfc3986_valid_java_invalid\", rfc3986_valid_java_invalid);\n    writeResource(\"rfc3986_invalid_java_valid\", rfc3986_invalid_java_valid);\n    writeResource(\"rfc3986_invalid_java_invalid\", rfc3986_invalid_java_invalid);\n  }\n\n  private static boolean javaValid(String input) {\n    try {\n      new URI(input);\n      return true;\n    } catch (URISyntaxException e) {\n      return false;\n    }\n  }\n\n  @SuppressWarnings(\"unused\")\n  private static boolean shouldBeValid(boolean rfc3986Valid, WhatWGUrlTestCase test) {\n    try {\n      Uri.parse(test.input());\n      return true;\n    } catch (Exception e) {\n      return false;\n    }\n  }\n\n  private static Class<? extends AbsoluteUri> calculateType(\n      SuccessWhatWGUrlTestCase testCase, String input, boolean normalised) {\n    if (!normalised\n        && (input.equals(testCase.origin())\n            || (!testCase.protocol().isEmpty()\n                && testCase.pathname().isEmpty()\n                && testCase.username().isEmpty()\n                && testCase.password().isEmpty()\n                && testCase.search().isEmpty()\n                && testCase.hash().isEmpty()))) {\n      return Origin.class;\n    } else if (testCase.host().isEmpty() && !input.matches(\"^[a-z]+://($|/.*)\")) {\n      return OpaqueUri.class;\n    } else if (testCase.hash().isEmpty()) {\n      return ServersideAbsoluteUrl.class;\n    } else {\n      return AbsoluteUrl.class;\n    }\n  }\n\n  private static SimpleParseFailure toWireMockFailure(FailureWhatWGUrlTestCase testCase) {\n    String base;\n    if (testCase instanceof SimpleFailureWhatWGUrlTestCase simpleFailureWhatWGUrlTestCase) {\n      base = normalise(simpleFailureWhatWGUrlTestCase.base());\n    } else {\n      base = null;\n    }\n    return new SimpleParseFailure(\n        testCase.input(),\n        base,\n        IllegalUri.class.getSimpleName(),\n        \"Illegal uri reference: `\" + testCase.input() + \"`\",\n        null,\n        \"\",\n        testCase);\n  }\n\n  private static @Nullable String normalise(@Nullable String input) {\n    if (input == null || input.isEmpty() || input.equals(\"null\")) {\n      return null;\n    }\n    return input;\n  }\n\n  private static @Nullable String userInfo(SuccessWhatWGUrlTestCase testCase) {\n    if (testCase.password().isEmpty()) {\n      return testCase.username().isEmpty() ? null : testCase.username();\n    } else {\n      return testCase.username() + \":\" + testCase.password();\n    }\n  }\n\n  private static @Nullable String authority(\n      SuccessWhatWGUrlTestCase testCase, Class<? extends AbsoluteUri> type) {\n    var userInfo = userInfo(testCase);\n    return userInfo == null ? hostAndPort(testCase, type) : userInfo + \"@\" + testCase.host();\n  }\n\n  private static @Nullable String hostAndPort(\n      SuccessWhatWGUrlTestCase testCase, Class<? extends AbsoluteUri> type) {\n    return AbsoluteUrl.class.isAssignableFrom(type) ? testCase.host() : null;\n  }\n}\n\nclass OneObjectPerLinePrettyPrinter extends DefaultPrettyPrinter {\n\n  public OneObjectPerLinePrettyPrinter() {\n    super();\n    _arrayIndenter = new DefaultIndenter(\"\", \"\");\n    _objectIndenter = new DefaultIndenter(\"\", \"\");\n    _spacesInObjectEntries = true;\n  }\n\n  @Override\n  public DefaultPrettyPrinter createInstance() {\n    return new OneObjectPerLinePrettyPrinter();\n  }\n\n  @Override\n  public void writeStartArray(JsonGenerator g) throws IOException {\n    g.writeRaw('[');\n  }\n\n  @Override\n  public void writeEndArray(JsonGenerator g, int nrOfValues) throws IOException {\n    if (nrOfValues > 0) {\n      g.writeRaw('\\n');\n    }\n    g.writeRaw(']');\n  }\n\n  @Override\n  public void beforeArrayValues(JsonGenerator g) throws IOException {\n    g.writeRaw('\\n');\n  }\n\n  @Override\n  public void writeArrayValueSeparator(JsonGenerator g) throws IOException {\n    g.writeRaw(',');\n    g.writeRaw('\\n');\n  }\n\n  @Override\n  public void writeStartObject(JsonGenerator g) throws IOException {\n    g.writeRaw(\"{ \");\n  }\n\n  @Override\n  public void writeEndObject(JsonGenerator g, int nrOfEntries) throws IOException {\n    g.writeRaw(\" }\");\n  }\n\n  @Override\n  public void writeObjectFieldValueSeparator(JsonGenerator g) throws IOException {\n    g.writeRaw(\": \");\n  }\n\n  @Override\n  public void writeObjectEntrySeparator(JsonGenerator g) throws IOException {\n    g.writeRaw(\", \");\n  }\n}\n\nclass CustomDepthPrettyPrinter extends DefaultPrettyPrinter {\n  private int depth = 0;\n  private final DefaultIndenter normalIndent = new DefaultIndenter(\"  \", \"\\n\");\n  private final DefaultIndenter compactIndent = new DefaultIndenter(\"\", \" \");\n\n  public CustomDepthPrettyPrinter() {\n    _objectIndenter = normalIndent;\n    indentArraysWith(normalIndent);\n  }\n\n  @Override\n  public void writeStartObject(JsonGenerator g) throws java.io.IOException {\n    depth++;\n    if (depth > 1) {\n      _objectIndenter = compactIndent;\n    }\n    super.writeStartObject(g);\n  }\n\n  @Override\n  public void writeEndObject(JsonGenerator g, int nrOfEntries) throws java.io.IOException {\n    super.writeEndObject(g, nrOfEntries);\n    depth--;\n    if (depth <= 1) {\n      _objectIndenter = normalIndent;\n    }\n  }\n\n  @Override\n  public DefaultPrettyPrinter createInstance() {\n    return new CustomDepthPrettyPrinter();\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/WireMockSnapshotTestCase.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.whatwg;\n\nimport org.jspecify.annotations.Nullable;\n\npublic sealed interface WireMockSnapshotTestCase extends Comparable<WireMockSnapshotTestCase>\n    permits SimpleParseSuccess, SimpleParseFailure {\n\n  String input();\n\n  @Nullable String base();\n\n  WhatWGUrlTestCase source();\n\n  @Override\n  default int compareTo(WireMockSnapshotTestCase o) {\n    return source().compareTo(o.source());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/java/org/wiremock/url/whatwg/package-info.java",
    "content": "@NullMarked\npackage org.wiremock.url.whatwg;\n\nimport org.jspecify.annotations.NullMarked;\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/resources/org/wiremock/url/whatwg/rfc3986_invalid_java_invalid.json",
    "content": "[\n{ \"input\": \"http://example\\t.\\norg\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\\t   :foo.com   \\n\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:foo.com\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:foo.com\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \" foo.com  \", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/foo.com\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/foo.com\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"a:\\t foo.com\", \"base\": \"http://example.org/foo/bar\", \"href\": \"a: foo.com\", \"origin\": \"null\", \"protocol\": \"a:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \" foo.com\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://f:21/ b ? d # e \", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://f:21/%20b%20?%20d%20#%20e\", \"origin\": \"http://f:21\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"f:21\", \"hostname\": \"f\", \"port\": \"21\", \"pathname\": \"/%20b%20\", \"search\": \"?%20d%20\", \"hash\": \"#%20e\" },\n{ \"input\": \"lolscheme:x x#x x\", \"href\": \"lolscheme:x x#x%20x\", \"protocol\": \"lolscheme:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x x\", \"search\": \"\", \"hash\": \"#x%20x\" },\n{ \"input\": \"http://f: /c\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"http://f:\\n/c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://f/c\", \"origin\": \"http://f\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"f\", \"hostname\": \"f\", \"port\": \"\", \"pathname\": \"/c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://f: 21 / b ? d # e \", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"  \\t\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \":foo.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:foo.com/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:foo.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \":foo.com\\\\\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:foo.com/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:foo.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \":\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \":a\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:a\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \":/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \":\\\\\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \":#\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:#\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"#\\\\\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar#\\\\\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"hash\": \"#\\\\\" },\n{ \"input\": \":23\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:23\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:23\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\\\\x\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/x\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/x\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\\\\\\\\x\\\\hello\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://x/hello\", \"origin\": \"http://x\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/hello\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"::\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/::\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/::\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"::23\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/::23\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/::23\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://&a:foo(b]c@d:2/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://&a:foo(b%5Dc@d:2/\", \"origin\": \"http://d:2\", \"protocol\": \"http:\", \"username\": \"&a\", \"password\": \"foo(b%5Dc\", \"host\": \"d:2\", \"hostname\": \"d\", \"port\": \"2\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://foo.com/\\\\@\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://foo.com//@\", \"origin\": \"http://foo.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo.com\", \"hostname\": \"foo.com\", \"port\": \"\", \"pathname\": \"//@\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:\\\\\\\\foo.com\\\\\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://foo.com/\", \"origin\": \"http://foo.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo.com\", \"hostname\": \"foo.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://a/b:c/d@foo.com/\", \"origin\": \"http://a\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"a\", \"hostname\": \"a\", \"port\": \"\", \"pathname\": \"/b:c/d@foo.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://a:b@c\\\\\", \"href\": \"http://a:b@c/\", \"origin\": \"http://c\", \"protocol\": \"http:\", \"username\": \"a\", \"password\": \"b\", \"host\": \"c\", \"hostname\": \"c\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ws://a@b\\\\c\", \"href\": \"ws://a@b/c\", \"origin\": \"ws://b\", \"protocol\": \"ws:\", \"username\": \"a\", \"password\": \"\", \"host\": \"b\", \"hostname\": \"b\", \"port\": \"\", \"pathname\": \"/c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://foo/path;a??e#f#g\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://foo/path;a??e#f#g\", \"origin\": \"http://foo\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/path;a\", \"search\": \"??e\", \"hash\": \"#f#g\" },\n{ \"input\": \"[61:24:74]:98\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/[61:24:74]:98\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/[61:24:74]:98\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://[1::2]:3:4\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"http://2001::1]\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"http://2001::1]:80\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"http://[::127.0.0.1.]\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"file://example%/\", \"failure\": true },\n{ \"input\": \"file://[example]/\", \"failure\": true },\n{ \"input\": \"/a/ /c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/a/%20/c\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/a/%20/c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:c:\\\\foo\\\\bar.html\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///c:/foo/bar.html\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/c:/foo/bar.html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"  File:c|////foo\\\\bar.html\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///c:////foo/bar.html\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/c:////foo/bar.html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|/foo/bar\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///C:/foo/bar\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/C|\\\\foo\\\\bar\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///C:/foo/bar\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//C|/foo/bar\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///C:/foo/bar\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\\\\\\\\server\\\\file\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file://server/file\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"server\", \"hostname\": \"server\", \"port\": \"\", \"pathname\": \"/file\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/\\\\server/file\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file://server/file\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"server\", \"hostname\": \"server\", \"port\": \"\", \"pathname\": \"/file\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///w|m\", \"href\": \"file:///w|m\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/w|m\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///w||m\", \"href\": \"file:///w||m\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/w||m\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///w|/m\", \"href\": \"file:///w:/m\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/w:/m\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:C|/m/\", \"href\": \"file:///C:/m/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/m/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:C||/m/\", \"href\": \"file:///C||/m/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C||/m/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/%2e%2\", \"href\": \"http://example.com/foo/%2e%2\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/%2e%2\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo%\", \"href\": \"http://example.com/foo%\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo%\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo%2\", \"href\": \"http://example.com/foo%2\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo%2\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo%2zbar\", \"href\": \"http://example.com/foo%2zbar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo%2zbar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo%2Â©zbar\", \"href\": \"http://example.com/foo%2%C3%82%C2%A9zbar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo%2%C3%82%C2%A9zbar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo\\t%91\", \"href\": \"http://example.com/foo%C2%91%91\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo%C2%91%91\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo\\tbar\", \"href\": \"http://example.com/foobar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foobar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com\\\\\\\\foo\\\\\\\\bar\", \"href\": \"http://example.com//foo//bar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"//foo//bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://www.google.com/foo?bar=baz# »\", \"href\": \"http://www.google.com/foo?bar=baz#%20%C2%BB\", \"origin\": \"http://www.google.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.google.com\", \"hostname\": \"www.google.com\", \"port\": \"\", \"pathname\": \"/foo\", \"search\": \"?bar=baz\", \"hash\": \"#%20%C2%BB\" },\n{ \"input\": \"data:test# »\", \"href\": \"data:test#%20%C2%BB\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"test\", \"search\": \"\", \"hash\": \"#%20%C2%BB\" },\n{ \"input\": \"http:\\\\\\\\www.google.com\\\\foo\", \"href\": \"http://www.google.com/foo\", \"origin\": \"http://www.google.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.google.com\", \"hostname\": \"www.google.com\", \"port\": \"\", \"pathname\": \"/foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example example.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://Goo%20 goo%7C|.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://[]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://[:]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://GOO 　goo.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"\\u0000\\u001B\\u0004\\u0012 http://example.com/\\u001F \\r \", \"href\": \"http://example.com/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:opaque  \", \"href\": \"non-special:opaque\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"opaque\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:opaque  ?hi\", \"href\": \"non-special:opaque %20?hi\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"opaque %20\", \"search\": \"?hi\", \"hash\": \"\" },\n{ \"input\": \"non-special:opaque  #hi\", \"href\": \"non-special:opaque %20#hi\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"opaque %20\", \"search\": \"\", \"hash\": \"#hi\" },\n{ \"input\": \"non-special:opaque  x?hi\", \"href\": \"non-special:opaque  x?hi\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"opaque  x\", \"search\": \"?hi\", \"hash\": \"\" },\n{ \"input\": \"non-special:opaque  x#hi\", \"href\": \"non-special:opaque  x#hi\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"opaque  x\", \"search\": \"\", \"hash\": \"#hi\" },\n{ \"input\": \"non-special:opaque \\t\\t  \\t#hi\", \"href\": \"non-special:opaque  %20#hi\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"opaque  %20\", \"search\": \"\", \"hash\": \"#hi\" },\n{ \"input\": \"non-special:opaque \\t\\t  #hi\", \"href\": \"non-special:opaque  %20#hi\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"opaque  %20\", \"search\": \"\", \"hash\": \"#hi\" },\n{ \"input\": \"non-special:opaque\\t\\t  \\r #hi\", \"href\": \"non-special:opaque  %20#hi\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"opaque  %20\", \"search\": \"\", \"hash\": \"#hi\" },\n{ \"input\": \"http://%zz%66%a.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://%3g%78%63%30%2e%30%32%35%30%2E.01\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://192.168.0.1 hello\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"https://x x:12\", \"failure\": true },\n{ \"input\": \"http://[www.google.com]/\", \"failure\": true },\n{ \"input\": \"http://[google.com]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://[::1.2.3.4x]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://[::1.2.3.]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://[::1.2.]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://[::.1.2]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://[::1.]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://[::.1]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://%5B::1]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://`{}:`{}@h/`{}?`{}\", \"base\": \"http://doesnotmatter/\", \"href\": \"http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}\", \"origin\": \"http://h\", \"protocol\": \"http:\", \"username\": \"%60%7B%7D\", \"password\": \"%60%7B%7D\", \"host\": \"h\", \"hostname\": \"h\", \"port\": \"\", \"pathname\": \"/%60%7B%7D\", \"search\": \"?`{}\", \"hash\": \"\" },\n{ \"input\": \"sc://%/\", \"href\": \"sc://%/\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%\", \"hostname\": \"%\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc:\\\\../\", \"href\": \"sc:\\\\../\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\\\\../\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wow:%NBD\", \"href\": \"wow:%NBD\", \"origin\": \"null\", \"protocol\": \"wow:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"%NBD\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wow:%1G\", \"href\": \"wow:%1G\", \"origin\": \"null\", \"protocol\": \"wow:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"%1G\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc://a\\u0000b/\", \"failure\": true },\n{ \"input\": \"sc://a b/\", \"failure\": true },\n{ \"input\": \"sc://a<b\", \"failure\": true },\n{ \"input\": \"sc://a>b\", \"failure\": true },\n{ \"input\": \"sc://a[b/\", \"failure\": true },\n{ \"input\": \"sc://a\\\\b/\", \"failure\": true },\n{ \"input\": \"sc://a]b/\", \"failure\": true },\n{ \"input\": \"sc://a^b\", \"failure\": true },\n{ \"input\": \"sc://a|b/\", \"failure\": true },\n{ \"input\": \"foo://ho\\tst/\", \"href\": \"foo://host/\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo://ho\\nst/\", \"href\": \"foo://host/\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo://ho\\rst/\", \"href\": \"foo://host/\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://a\\u0000b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0001b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0002b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0003b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0004b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0005b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0006b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0007b/\", \"failure\": true },\n{ \"input\": \"http://a\\bb/\", \"failure\": true },\n{ \"input\": \"http://a\\u000Bb/\", \"failure\": true },\n{ \"input\": \"http://a\\fb/\", \"failure\": true },\n{ \"input\": \"http://a\\u000Eb/\", \"failure\": true },\n{ \"input\": \"http://a\\u000Fb/\", \"failure\": true },\n{ \"input\": \"http://a\\u0010b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0011b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0012b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0013b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0014b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0015b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0016b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0017b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0018b/\", \"failure\": true },\n{ \"input\": \"http://a\\u0019b/\", \"failure\": true },\n{ \"input\": \"http://a\\u001Ab/\", \"failure\": true },\n{ \"input\": \"http://a\\u001Bb/\", \"failure\": true },\n{ \"input\": \"http://a\\u001Cb/\", \"failure\": true },\n{ \"input\": \"http://a\\u001Db/\", \"failure\": true },\n{ \"input\": \"http://a\\u001Eb/\", \"failure\": true },\n{ \"input\": \"http://a\\u001Fb/\", \"failure\": true },\n{ \"input\": \"http://a b/\", \"failure\": true },\n{ \"input\": \"http://a%b/\", \"failure\": true },\n{ \"input\": \"http://a<b\", \"failure\": true },\n{ \"input\": \"http://a>b\", \"failure\": true },\n{ \"input\": \"http://a[b/\", \"failure\": true },\n{ \"input\": \"http://a]b/\", \"failure\": true },\n{ \"input\": \"http://a^b\", \"failure\": true },\n{ \"input\": \"http://a|b/\", \"failure\": true },\n{ \"input\": \"http://ab/\", \"failure\": true },\n{ \"input\": \"http://ho\\tst/\", \"href\": \"http://host/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://ho\\nst/\", \"href\": \"http://host/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://ho\\rst/\", \"href\": \"http://host/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://!\\\"$&'()*+,-.;=_`{}~/\", \"href\": \"http://!\\\"$&'()*+,-.;=_`{}~/\", \"origin\": \"http://!\\\"$&'()*+,-.;=_`{}~\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"!\\\"$&'()*+,-.;=_`{}~\", \"hostname\": \"!\\\"$&'()*+,-.;=_`{}~\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc://\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\u000B\\f\\u000E\\u000F\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001A\\u001B\\u001C\\u001D\\u001E\\u001F!\\\"$%&'()*+,-.;=_`{}~/\", \"href\": \"sc://%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\\\"$%&'()*+,-.;=_`{}~/\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\\\"$%&'()*+,-.;=_`{}~\", \"hostname\": \"%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\\\"$%&'()*+,-.;=_`{}~\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"h\\tt\\nt\\rp://h\\to\\ns\\rt:9\\t0\\n0\\r0/p\\ta\\nt\\rh?q\\tu\\ne\\rry#f\\tr\\na\\rg\", \"href\": \"http://host:9000/path?query#frag\", \"origin\": \"http://host:9000\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"host:9000\", \"hostname\": \"host\", \"port\": \"9000\", \"pathname\": \"/path\", \"search\": \"?query\", \"hash\": \"#frag\" },\n{ \"input\": \"http://foo.bar/baz?qux#foo\\bbar\", \"href\": \"http://foo.bar/baz?qux#foo%08bar\", \"origin\": \"http://foo.bar\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo.bar\", \"hostname\": \"foo.bar\", \"port\": \"\", \"pathname\": \"/baz\", \"search\": \"?qux\", \"searchParams\": \"qux=\", \"hash\": \"#foo%08bar\" },\n{ \"input\": \"http://foo.bar/baz?qux#foo\\\"bar\", \"href\": \"http://foo.bar/baz?qux#foo%22bar\", \"origin\": \"http://foo.bar\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo.bar\", \"hostname\": \"foo.bar\", \"port\": \"\", \"pathname\": \"/baz\", \"search\": \"?qux\", \"searchParams\": \"qux=\", \"hash\": \"#foo%22bar\" },\n{ \"input\": \"http://foo.bar/baz?qux#foo<bar\", \"href\": \"http://foo.bar/baz?qux#foo%3Cbar\", \"origin\": \"http://foo.bar\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo.bar\", \"hostname\": \"foo.bar\", \"port\": \"\", \"pathname\": \"/baz\", \"search\": \"?qux\", \"searchParams\": \"qux=\", \"hash\": \"#foo%3Cbar\" },\n{ \"input\": \"http://foo.bar/baz?qux#foo>bar\", \"href\": \"http://foo.bar/baz?qux#foo%3Ebar\", \"origin\": \"http://foo.bar\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo.bar\", \"hostname\": \"foo.bar\", \"port\": \"\", \"pathname\": \"/baz\", \"search\": \"?qux\", \"searchParams\": \"qux=\", \"hash\": \"#foo%3Ebar\" },\n{ \"input\": \"http://foo.bar/baz?qux#foo`bar\", \"href\": \"http://foo.bar/baz?qux#foo%60bar\", \"origin\": \"http://foo.bar\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo.bar\", \"hostname\": \"foo.bar\", \"port\": \"\", \"pathname\": \"/baz\", \"search\": \"?qux\", \"searchParams\": \"qux=\", \"hash\": \"#foo%60bar\" },\n{ \"input\": \"file://%43|\", \"failure\": true },\n{ \"input\": \"asdf://%43|/\", \"failure\": true },\n{ \"input\": \"file:\\\\\\\\//\", \"href\": \"file:////\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:\\\\\\\\\\\\\\\\\", \"href\": \"file:////\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:\\\\\\\\\\\\\\\\?fox\", \"href\": \"file:////?fox\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"?fox\", \"hash\": \"\" },\n{ \"input\": \"file:\\\\\\\\\\\\\\\\#guppy\", \"href\": \"file:////#guppy\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"#guppy\" },\n{ \"input\": \"file:\\\\\\\\localhost//\", \"href\": \"file:////\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://\\\\/localhost//cat\", \"href\": \"file:////localhost//cat\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//localhost//cat\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\\\\//pig\", \"base\": \"file://lion/\", \"href\": \"file:///pig\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/pig\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\\\\/localhost//pig\", \"base\": \"file://lion/\", \"href\": \"file:////pig\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//pig\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|\", \"base\": \"file://host/dir/file\", \"href\": \"file://host/C:\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|\", \"base\": \"file://host/D:/dir1/dir2/file\", \"href\": \"file://host/C:\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|#\", \"base\": \"file://host/dir/file\", \"href\": \"file://host/C:#\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|?\", \"base\": \"file://host/dir/file\", \"href\": \"file://host/C:?\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|/\", \"base\": \"file://host/dir/file\", \"href\": \"file://host/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|\\n/\", \"base\": \"file://host/dir/file\", \"href\": \"file://host/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|\\\\\", \"base\": \"file://host/dir/file\", \"href\": \"file://host/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|a\", \"base\": \"file://host/dir/file\", \"href\": \"file://host/dir/C|a\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/dir/C|a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/c|/foo/bar\", \"base\": \"file:///c:/baz/qux\", \"href\": \"file:///c:/foo/bar\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/c:/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:\\\\c:\\\\foo\\\\bar\", \"base\": \"file:///c:/baz/qux\", \"href\": \"file:///c:/foo/bar\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/c:/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"C|/\", \"base\": \"file://host/\", \"href\": \"file://host/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:/C|/\", \"href\": \"file:///C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://C|/\", \"href\": \"file:///C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\\\\\\\\\\\\.\\\\Y:\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"\\\\\\\\\\\\.\\\\y:\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http://[0:1:2:3:4:5:6:7:8]\", \"base\": \"http://example.net/\", \"failure\": true },\n{ \"input\": \"https://[0::0::0]\", \"failure\": true },\n{ \"input\": \"https://[0:.0]\", \"failure\": true },\n{ \"input\": \"https://[0:0:]\", \"failure\": true },\n{ \"input\": \"https://[0:1:2:3:4:5:6:7.0.0.0.1]\", \"failure\": true },\n{ \"input\": \"https://[0:1.00.0.0.0]\", \"failure\": true },\n{ \"input\": \"https://[0:1.290.0.0.0]\", \"failure\": true },\n{ \"input\": \"https://[0:1.23.23]\", \"failure\": true },\n{ \"input\": \"non-special://[:80/\", \"failure\": true },\n{ \"input\": \"http://[::127.0.0.0.1]\", \"failure\": true },\n{ \"input\": \"http://example.org/test?\\\"\", \"href\": \"http://example.org/test?%22\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?%22\", \"hash\": \"\" },\n{ \"input\": \"http://example.org/test?<\", \"href\": \"http://example.org/test?%3C\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?%3C\", \"hash\": \"\" },\n{ \"input\": \"http://example.org/test?>\", \"href\": \"http://example.org/test?%3E\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?%3E\", \"hash\": \"\" },\n{ \"input\": \"http://example.org/test?%GH\", \"href\": \"http://example.org/test?%GH\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?%GH\", \"hash\": \"\" },\n{ \"input\": \"http://example.org/test?a#%GH\", \"href\": \"http://example.org/test?a#%GH\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?a\", \"hash\": \"#%GH\" },\n{ \"input\": \"http://example.org/test?a#b\\u0000c\", \"href\": \"http://example.org/test?a#b%00c\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?a\", \"hash\": \"#b%00c\" },\n{ \"input\": \"non-spec://example.org/test?a#b\\u0000c\", \"href\": \"non-spec://example.org/test?a#b%00c\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?a\", \"hash\": \"#b%00c\" },\n{ \"input\": \"non-spec:/test?a#b\\u0000c\", \"href\": \"non-spec:/test?a#b%00c\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?a\", \"hash\": \"#b%00c\" },\n{ \"input\": \"10.0.0.7:8080/foo.html\", \"base\": \"file:///some/dir/bar.html\", \"href\": \"file:///some/dir/10.0.0.7:8080/foo.html\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/some/dir/10.0.0.7:8080/foo.html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:cannot-be-a-base-url-\\u0000\\u0001\\u001F\\u001E~\", \"href\": \"non-special:cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\", \"href\": \"non-special:cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://www.example.com/path{path.html?query'=query#fragment<fragment\", \"href\": \"https://www.example.com/path%7B%7Fpath.html?query%27%7F=query#fragment%3C%7Ffragment\", \"origin\": \"https://www.example.com\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/path%7B%7Fpath.html\", \"search\": \"?query%27%7F=query\", \"hash\": \"#fragment%3C%7Ffragment\" },\n{ \"input\": \"https://user:pass[@foo/bar\", \"base\": \"http://example.org\", \"href\": \"https://user:pass%5B%7F@foo/bar\", \"origin\": \"https://foo\", \"protocol\": \"https:\", \"username\": \"user\", \"password\": \"pass%5B%7F\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo:// !\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@host/\", \"href\": \"foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss:// !\\\"$%&'()*+,-.;<=>@[]^_`{|}~@host/\", \"href\": \"wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/\", \"origin\": \"wss://host\", \"protocol\": \"wss:\", \"username\": \"%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo://joe: !\\\"$%&'()*+,-.:;<=>@[\\\\]^_`{|}~@host/\", \"href\": \"foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"joe\", \"password\": \"%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss://joe: !\\\"$%&'()*+,-.:;<=>@[]^_`{|}~@host/\", \"href\": \"wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/\", \"origin\": \"wss://host\", \"protocol\": \"wss:\", \"username\": \"joe\", \"password\": \"%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo://!\\\"$%&'()*+,-.;=_`{}~/\", \"href\": \"foo://!\\\"$%&'()*+,-.;=_`{}~/\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"!\\\"$%&'()*+,-.;=_`{}~\", \"hostname\": \"!\\\"$%&'()*+,-.;=_`{}~\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss://!\\\"$&'()*+,-.;=_`{}~/\", \"href\": \"wss://!\\\"$&'()*+,-.;=_`{}~/\", \"origin\": \"wss://!\\\"$&'()*+,-.;=_`{}~\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"!\\\"$&'()*+,-.;=_`{}~\", \"hostname\": \"!\\\"$&'()*+,-.;=_`{}~\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\", \"href\": \"foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\\\]%5E_%60%7B|%7D~\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/%20!%22$%&'()*+,-./:;%3C=%3E@[\\\\]%5E_%60%7B|%7D~\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\", \"href\": \"wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~\", \"origin\": \"wss://host\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"href\": \"foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/dir/\", \"search\": \"?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\", \"hash\": \"\" },\n{ \"input\": \"wss://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"href\": \"wss://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\", \"origin\": \"wss://host\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/dir/\", \"search\": \"?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\", \"hash\": \"\" },\n{ \"input\": \"foo://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"href\": \"foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/dir/\", \"search\": \"\", \"hash\": \"#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\" },\n{ \"input\": \"wss://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"href\": \"wss://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\", \"origin\": \"wss://host\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/dir/\", \"search\": \"\", \"hash\": \"#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\" },\n{ \"input\": \"https://\\u0000y\", \"failure\": true },\n{ \"input\": \"https://x/\\u0000y\", \"href\": \"https://x/%00y\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/%00y\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://x/?\\u0000y\", \"href\": \"https://x/?%00y\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"?%00y\", \"hash\": \"\" },\n{ \"input\": \"https://x/?#\\u0000y\", \"href\": \"https://x/?#%00y\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"#%00y\" },\n{ \"input\": \"non-special:\\u0000y\", \"href\": \"non-special:%00y\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"%00y\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:x/\\u0000y\", \"href\": \"non-special:x/%00y\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x/%00y\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:x/?\\u0000y\", \"href\": \"non-special:x/?%00y\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x/\", \"search\": \"?%00y\", \"hash\": \"\" },\n{ \"input\": \"non-special:x/?#\\u0000y\", \"href\": \"non-special:x/?#%00y\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x/\", \"search\": \"\", \"hash\": \"#%00y\" },\n{ \"input\": \"https://example.com/\\\"quoted\\\"\", \"href\": \"https://example.com/%22quoted%22\", \"origin\": \"https://example.com\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/%22quoted%22\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data://[:1]\", \"failure\": true },\n{ \"input\": \"javascript://[:1]\", \"failure\": true },\n{ \"input\": \"mailto://[:1]\", \"failure\": true },\n{ \"input\": \"intent://[:1]\", \"failure\": true },\n{ \"input\": \"urn://[:1]\", \"failure\": true },\n{ \"input\": \"turn://[:1]\", \"failure\": true },\n{ \"input\": \"stun://[:1]\", \"failure\": true },\n{ \"input\": \"///\\\\//\\\\//test\", \"base\": \"http://example.org/\", \"href\": \"http://test/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/\\\\/\\\\//example.org/../path\", \"base\": \"http://example.org/\", \"href\": \"http://example.org/path\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/\\\\//\\\\/a/../\", \"base\": \"file:///\", \"href\": \"file://////\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"////\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:\\\\\\\\opaque\", \"href\": \"non-special:\\\\\\\\opaque\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\\\\\\\\opaque\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:\\\\\\\\opaque/path\", \"href\": \"non-special:\\\\\\\\opaque/path\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\\\\\\\\opaque/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:\\\\\\\\opaque\\\\path\", \"href\": \"non-special:\\\\\\\\opaque\\\\path\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\\\\\\\\opaque\\\\path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:\\\\/opaque\", \"href\": \"non-special:\\\\/opaque\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\\\\/opaque\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:/\\\\path\", \"href\": \"non-special:/\\\\path\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\\\\path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special://host\\\\a\", \"failure\": true },\n{ \"input\": \"non-special://host/a\\\\b\", \"href\": \"non-special://host/a\\\\b\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/a\\\\b\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data:text/plain,test#<foo> <bar>\", \"href\": \"data:text/plain,test#%3Cfoo%3E%20%3Cbar%3E\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"text/plain,test\", \"search\": \"\", \"hash\": \"#%3Cfoo%3E%20%3Cbar%3E\" },\n{ \"input\": \"about:blank#<foo> <bar>\", \"href\": \"about:blank#%3Cfoo%3E%20%3Cbar%3E\", \"protocol\": \"about:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"blank\", \"search\": \"\", \"hash\": \"#%3Cfoo%3E%20%3Cbar%3E\" },\n{ \"input\": \"data:text/plain,test#\\u0000\\u0001\\t\\n\\r\\u001F !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~Éé\", \"href\": \"data:text/plain,test#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"text/plain,test\", \"search\": \"\", \"hash\": \"#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\" },\n{ \"input\": \"about:blank#\\u0000\\u0001\\t\\n\\r\\u001F !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~Éé\", \"href\": \"about:blank#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\", \"protocol\": \"about:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"blank\", \"search\": \"\", \"hash\": \"#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\" }\n]"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/resources/org/wiremock/url/whatwg/rfc3986_invalid_java_valid.json",
    "content": "[\n{ \"input\": \"http://f:b/c\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"http://f:fifty-two/c\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"http://::@c@d:2\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://:%3A%40c@d:2/\", \"origin\": \"http://d:2\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"%3A%40c\", \"host\": \"d:2\", \"hostname\": \"d\", \"port\": \"2\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:[61:27]/:foo\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/[61:27]/:foo\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/[61:27]/:foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://2001::1\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"file://example:test/\", \"failure\": true },\n{ \"input\": \"#β\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar#%CE%B2\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"hash\": \"#%CE%B2\" },\n{ \"input\": \"http://example.com/你好你好\", \"href\": \"http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/‥/foo\", \"href\": \"http://example.com/%E2%80%A5/foo\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/%E2%80%A5/foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/﻿/foo\", \"href\": \"http://example.com/%EF%BB%BF/foo\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/%EF%BB%BF/foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/‮/foo/‭/bar\", \"href\": \"http://example.com/%E2%80%AE/foo/%E2%80%AD/bar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/%E2%80%AE/foo/%E2%80%AD/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://foo:-80/\", \"failure\": true },\n{ \"input\": \"http://@:www.example.com\", \"failure\": true },\n{ \"input\": \"中/test.txt\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/%E4%B8%AD/test.txt\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/%E4%B8%AD/test.txt\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://GOO​⁠﻿goo.com\", \"base\": \"http://other.com/\", \"href\": \"http://googoo.com/\", \"origin\": \"http://googoo.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"googoo.com\", \"hostname\": \"googoo.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://www.foo。bar.com\", \"base\": \"http://other.com/\", \"href\": \"http://www.foo.bar.com/\", \"origin\": \"http://www.foo.bar.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.foo.bar.com\", \"hostname\": \"www.foo.bar.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://﷐zyx.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"https://�\", \"failure\": true },\n{ \"input\": \"https://x/�?�#�\", \"href\": \"https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD\", \"origin\": \"https://x\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/%EF%BF%BD\", \"search\": \"?%EF%BF%BD\", \"hash\": \"#%EF%BF%BD\" },\n{ \"input\": \"http://Ｇｏ.com\", \"base\": \"http://other.com/\", \"href\": \"http://go.com/\", \"origin\": \"http://go.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"go.com\", \"hostname\": \"go.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://％４１.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://％００.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://你好你好\", \"base\": \"http://other.com/\", \"href\": \"http://xn--6qqa088eba/\", \"origin\": \"http://xn--6qqa088eba\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"xn--6qqa088eba\", \"hostname\": \"xn--6qqa088eba\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://faß.ExAmPlE/\", \"href\": \"https://xn--fa-hia.example/\", \"origin\": \"https://xn--fa-hia.example\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"xn--fa-hia.example\", \"hostname\": \"xn--fa-hia.example\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc://faß.ExAmPlE/\", \"href\": \"sc://fa%C3%9F.ExAmPlE/\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"fa%C3%9F.ExAmPlE\", \"hostname\": \"fa%C3%9F.ExAmPlE\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://０Ｘｃ０．０２５０．０１\", \"base\": \"http://other.com/\", \"href\": \"http://192.168.0.1/\", \"origin\": \"http://192.168.0.1\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"192.168.0.1\", \"hostname\": \"192.168.0.1\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://[::%31]\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://foo:\\uD83D\\uDCA9@example.com/bar\", \"base\": \"http://other.com/\", \"href\": \"http://foo:%F0%9F%92%A9@example.com/bar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"foo\", \"password\": \"%F0%9F%92%A9\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://@test@test@example:800/\", \"base\": \"http://doesnotmatter/\", \"href\": \"https://%40test%40test@example:800/\", \"origin\": \"https://example:800\", \"protocol\": \"https:\", \"username\": \"%40test%40test\", \"password\": \"\", \"host\": \"example:800\", \"hostname\": \"example\", \"port\": \"800\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://@@@example\", \"base\": \"http://doesnotmatter/\", \"href\": \"https://%40%40@example/\", \"origin\": \"https://example\", \"protocol\": \"https:\", \"username\": \"%40%40\", \"password\": \"\", \"host\": \"example\", \"hostname\": \"example\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc://ñ.test/\", \"href\": \"sc://%C3%B1.test/\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1.test\", \"hostname\": \"%C3%B1.test\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc://te@s:t@/\", \"failure\": true },\n{ \"input\": \"wow:￿\", \"href\": \"wow:%EF%BF%BF\", \"origin\": \"null\", \"protocol\": \"wow:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"%EF%BF%BF\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc://ñ\", \"href\": \"sc://%C3%B1\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc://ñ?x\", \"href\": \"sc://%C3%B1?x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"?x\", \"hash\": \"\" },\n{ \"input\": \"sc://ñ#x\", \"href\": \"sc://%C3%B1#x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"#x\" },\n{ \"input\": \"http://example.org/test?⌣\", \"href\": \"http://example.org/test?%E2%8C%A3\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?%E2%8C%A3\", \"hash\": \"\" },\n{ \"input\": \"file://a­b/p\", \"href\": \"file://ab/p\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"ab\", \"hostname\": \"ab\", \"port\": \"\", \"pathname\": \"/p\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://loC\\uD835\\uDC00\\uD835\\uDC0B\\uD835\\uDC07\\uD835\\uDC28\\uD835\\uDC2C\\uD835\\uDC2D/usr/bin\", \"href\": \"file:///usr/bin\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/usr/bin\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://­/p\", \"failure\": true },\n{ \"input\": \"http://\\uD83D\\uDCA9.123/\", \"failure\": true },\n{ \"input\": \"https://￿y\", \"failure\": true },\n{ \"input\": \"https://x/￿y\", \"href\": \"https://x/%EF%BF%BFy\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/%EF%BF%BFy\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://x/?￿y\", \"href\": \"https://x/?%EF%BF%BFy\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"?%EF%BF%BFy\", \"hash\": \"\" },\n{ \"input\": \"https://x/?#￿y\", \"href\": \"https://x/?#%EF%BF%BFy\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"#%EF%BF%BFy\" },\n{ \"input\": \"non-special:￿y\", \"href\": \"non-special:%EF%BF%BFy\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"%EF%BF%BFy\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:x/￿y\", \"href\": \"non-special:x/%EF%BF%BFy\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x/%EF%BF%BFy\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special:x/?￿y\", \"href\": \"non-special:x/?%EF%BF%BFy\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x/\", \"search\": \"?%EF%BF%BFy\", \"hash\": \"\" },\n{ \"input\": \"non-special:x/?#￿y\", \"href\": \"non-special:x/?#%EF%BF%BFy\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x/\", \"search\": \"\", \"hash\": \"#%EF%BF%BFy\" },\n{ \"input\": \"https://­/\", \"failure\": true },\n{ \"input\": \"data://test:test\", \"failure\": true },\n{ \"input\": \"javascript://test:test\", \"failure\": true },\n{ \"input\": \"mailto://test:test\", \"failure\": true },\n{ \"input\": \"intent://test:test\", \"failure\": true },\n{ \"input\": \"urn://test:test\", \"failure\": true },\n{ \"input\": \"turn://test:test\", \"failure\": true },\n{ \"input\": \"stun://test:test\", \"failure\": true }\n]"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/resources/org/wiremock/url/whatwg/rfc3986_valid_java_invalid.json",
    "content": "[\n{ \"input\": \"foo://\", \"base\": \"http://example.org/foo/bar\", \"href\": \"foo://\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"searchParams\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:\", \"base\": \"https://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"sc:\", \"base\": \"https://example.org/foo/bar\", \"href\": \"sc:\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"searchParams\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:\", \"base\": \"file:///test?test#test\", \"href\": \"file:///test?test\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?test\", \"hash\": \"\" },\n{ \"input\": \"file:#x\", \"base\": \"file:///test?test#test\", \"href\": \"file:///test?test#x\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?test\", \"hash\": \"#x\" },\n{ \"input\": \"file://\", \"base\": \"file://ape/\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:#frag\", \"href\": \"file:///#frag\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"#frag\" },\n{ \"input\": \"blob:\", \"href\": \"blob:\", \"origin\": \"null\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" }\n]"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/resources/org/wiremock/url/whatwg/rfc3986_valid_java_valid.json",
    "content": "[\n{ \"input\": \"http://user:pass@foo:21/bar;par?b#c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://user:pass@foo:21/bar;par?b#c\", \"origin\": \"http://foo:21\", \"protocol\": \"http:\", \"username\": \"user\", \"password\": \"pass\", \"host\": \"foo:21\", \"hostname\": \"foo\", \"port\": \"21\", \"pathname\": \"/bar;par\", \"search\": \"?b\", \"hash\": \"#c\" },\n{ \"input\": \"https://test:@test\", \"href\": \"https://test@test/\", \"origin\": \"https://test\", \"protocol\": \"https:\", \"username\": \"test\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://:@test\", \"href\": \"https://test/\", \"origin\": \"https://test\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special://test:@test/x\", \"href\": \"non-special://test@test/x\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"test\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/x\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special://:@test/x\", \"href\": \"non-special://test/x\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/x\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:foo.com\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/foo.com\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/foo.com\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://f:/c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://f/c\", \"origin\": \"http://f\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"f\", \"hostname\": \"f\", \"port\": \"\", \"pathname\": \"/c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://f:0/c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://f:0/c\", \"origin\": \"http://f:0\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"f:0\", \"hostname\": \"f\", \"port\": \"0\", \"pathname\": \"/c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://f:00000000000000/c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://f:0/c\", \"origin\": \"http://f:0\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"f:0\", \"hostname\": \"f\", \"port\": \"0\", \"pathname\": \"/c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://f:00000000000000000000080/c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://f/c\", \"origin\": \"http://f\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"f\", \"hostname\": \"f\", \"port\": \"\", \"pathname\": \"/c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://f:999999/c\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"non-special://f:999999/c\", \"base\": \"http://example.org/foo/bar\", \"failure\": true },\n{ \"input\": \"\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"#\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar#\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"#/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar#/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"hash\": \"#/\" },\n{ \"input\": \"#;?\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar#;?\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"hash\": \"#;?\" },\n{ \"input\": \"?\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar?\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/:23\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/:23\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/:23\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://a:b@c:29/d\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://a:b@c:29/d\", \"origin\": \"http://c:29\", \"protocol\": \"http:\", \"username\": \"a\", \"password\": \"b\", \"host\": \"c:29\", \"hostname\": \"c\", \"port\": \"29\", \"pathname\": \"/d\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http::@c:29\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:@c:29\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:@c:29\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://foo.com:b@d/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://foo.com:b@d/\", \"origin\": \"http://d\", \"protocol\": \"http:\", \"username\": \"foo.com\", \"password\": \"b\", \"host\": \"d\", \"hostname\": \"d\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo:/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"foo:/\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo:/bar.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"foo:/bar.com/\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/bar.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo://///////\", \"base\": \"http://example.org/foo/bar\", \"href\": \"foo://///////\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"///////\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo://///////bar.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"foo://///////bar.com/\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"///////bar.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"foo:////://///\", \"base\": \"http://example.org/foo/bar\", \"href\": \"foo:////://///\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//://///\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"c:/foo\", \"base\": \"http://example.org/foo/bar\", \"href\": \"c:/foo\", \"origin\": \"null\", \"protocol\": \"c:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//foo/bar\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://foo/bar\", \"origin\": \"http://foo\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://foo/abcd?efgh?ijkl\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://foo/abcd?efgh?ijkl\", \"origin\": \"http://foo\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/abcd\", \"search\": \"?efgh?ijkl\", \"hash\": \"\" },\n{ \"input\": \"http://foo/abcd#foo?bar\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://foo/abcd#foo?bar\", \"origin\": \"http://foo\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/abcd\", \"search\": \"\", \"hash\": \"#foo?bar\" },\n{ \"input\": \"http://[2001::1]\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://[2001::1]/\", \"origin\": \"http://[2001::1]\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"[2001::1]\", \"hostname\": \"[2001::1]\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://[::127.0.0.1]\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://[::7f00:1]/\", \"origin\": \"http://[::7f00:1]\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"[::7f00:1]\", \"hostname\": \"[::7f00:1]\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://[0:0:0:0:0:0:13.1.68.3]\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://[::d01:4403]/\", \"origin\": \"http://[::d01:4403]\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"[::d01:4403]\", \"hostname\": \"[::d01:4403]\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://[2001::1]:80\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://[2001::1]/\", \"origin\": \"http://[2001::1]\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"[2001::1]\", \"hostname\": \"[2001::1]\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/example.com/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ftp:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"ftp://example.com/\", \"origin\": \"ftp://example.com\", \"protocol\": \"ftp:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"https://example.com/\", \"origin\": \"https://example.com\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"madeupscheme:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"madeupscheme:/example.com/\", \"origin\": \"null\", \"protocol\": \"madeupscheme:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"file:///example.com/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://example:1/\", \"failure\": true },\n{ \"input\": \"ftps:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"ftps:/example.com/\", \"origin\": \"null\", \"protocol\": \"ftps:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"gopher:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"gopher:/example.com/\", \"origin\": \"null\", \"protocol\": \"gopher:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ws:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"ws://example.com/\", \"origin\": \"ws://example.com\", \"protocol\": \"ws:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"wss://example.com/\", \"origin\": \"wss://example.com\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"data:/example.com/\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"javascript:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"javascript:/example.com/\", \"origin\": \"null\", \"protocol\": \"javascript:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"mailto:/example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"mailto:/example.com/\", \"origin\": \"null\", \"protocol\": \"mailto:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/example.com/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ftp:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"ftp://example.com/\", \"origin\": \"ftp://example.com\", \"protocol\": \"ftp:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"https://example.com/\", \"origin\": \"https://example.com\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"madeupscheme:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"madeupscheme:example.com/\", \"origin\": \"null\", \"protocol\": \"madeupscheme:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ftps:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"ftps:example.com/\", \"origin\": \"null\", \"protocol\": \"ftps:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"gopher:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"gopher:example.com/\", \"origin\": \"null\", \"protocol\": \"gopher:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ws:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"ws://example.com/\", \"origin\": \"ws://example.com\", \"protocol\": \"ws:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"wss://example.com/\", \"origin\": \"wss://example.com\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"data:example.com/\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"javascript:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"javascript:example.com/\", \"origin\": \"null\", \"protocol\": \"javascript:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"mailto:example.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"mailto:example.com/\", \"origin\": \"null\", \"protocol\": \"mailto:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/a/b/c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/a/b/c\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/a/b/c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/a%2fc\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/a%2fc\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/a%2fc\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/a/%2f/c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/a/%2f/c\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/a/%2f/c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data:text/html,test#test\", \"base\": \"http://example.org/foo/bar\", \"href\": \"data:text/html,test#test\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"text/html,test\", \"search\": \"\", \"hash\": \"#test\" },\n{ \"input\": \"tel:1234567890\", \"base\": \"http://example.org/foo/bar\", \"href\": \"tel:1234567890\", \"origin\": \"null\", \"protocol\": \"tel:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"1234567890\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ssh://example.com/foo/bar.git\", \"base\": \"http://example.org/\", \"href\": \"ssh://example.com/foo/bar.git\", \"origin\": \"null\", \"protocol\": \"ssh:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/bar.git\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//server/file\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file://server/file\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"server\", \"hostname\": \"server\", \"port\": \"\", \"pathname\": \"/file\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///foo/bar.txt\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///foo/bar.txt\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/foo/bar.txt\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///home/me\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///home/me\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/home/me\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///test\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///test\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://test\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file://test/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://localhost\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://localhost/\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://localhost/test\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///test\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"test\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///tmp/mock/test\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/tmp/mock/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:test\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///tmp/mock/test\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/tmp/mock/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/././foo\", \"href\": \"http://example.com/foo\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/./.foo\", \"href\": \"http://example.com/.foo\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/.foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/.\", \"href\": \"http://example.com/foo/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/./\", \"href\": \"http://example.com/foo/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/bar/..\", \"href\": \"http://example.com/foo/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/bar/../\", \"href\": \"http://example.com/foo/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/..bar\", \"href\": \"http://example.com/foo/..bar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/..bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/bar/../ton\", \"href\": \"http://example.com/foo/ton\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/ton\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/bar/../ton/../../a\", \"href\": \"http://example.com/a\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/../../..\", \"href\": \"http://example.com/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/../../../ton\", \"href\": \"http://example.com/ton\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/ton\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/%2e\", \"href\": \"http://example.com/foo/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar\", \"href\": \"http://example.com/%2e.bar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/%2e.bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com////../..\", \"href\": \"http://example.com//\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/bar//../..\", \"href\": \"http://example.com/foo/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo/bar//..\", \"href\": \"http://example.com/foo/bar/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo/bar/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo\", \"href\": \"http://example.com/foo\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/%20foo\", \"href\": \"http://example.com/%20foo\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/%20foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo%41%7a\", \"href\": \"http://example.com/foo%41%7a\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo%41%7a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/foo%00%51\", \"href\": \"http://example.com/foo%00%51\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo%00%51\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/(%28:%3A%29)\", \"href\": \"http://example.com/(%28:%3A%29)\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/(%28:%3A%29)\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/%3A%3a%3C%3c\", \"href\": \"http://example.com/%3A%3a%3C%3c\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/%3A%3a%3C%3c\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd\", \"href\": \"http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/%7Ffp3%3Eju%3Dduvgw%3Dd\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.com/@asdf%40\", \"href\": \"http://example.com/@asdf%40\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/@asdf%40\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://www.google.com/foo?bar=baz#\", \"href\": \"http://www.google.com/foo?bar=baz#\", \"origin\": \"http://www.google.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.google.com\", \"hostname\": \"www.google.com\", \"port\": \"\", \"pathname\": \"/foo\", \"search\": \"?bar=baz\", \"hash\": \"\" },\n{ \"input\": \"http://www.google.com\", \"href\": \"http://www.google.com/\", \"origin\": \"http://www.google.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.google.com\", \"hostname\": \"www.google.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://192.0x00A80001\", \"href\": \"http://192.168.0.1/\", \"origin\": \"http://192.168.0.1\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"192.168.0.1\", \"hostname\": \"192.168.0.1\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://www/foo%2Ehtml\", \"href\": \"http://www/foo%2Ehtml\", \"origin\": \"http://www\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www\", \"hostname\": \"www\", \"port\": \"\", \"pathname\": \"/foo%2Ehtml\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://www/foo/%2E/html\", \"href\": \"http://www/foo/html\", \"origin\": \"http://www\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www\", \"hostname\": \"www\", \"port\": \"\", \"pathname\": \"/foo/html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://user:pass@/\", \"failure\": true },\n{ \"input\": \"http://%25DOMAIN:foobar@foodomain.com/\", \"href\": \"http://%25DOMAIN:foobar@foodomain.com/\", \"origin\": \"http://foodomain.com\", \"protocol\": \"http:\", \"username\": \"%25DOMAIN\", \"password\": \"foobar\", \"host\": \"foodomain.com\", \"hostname\": \"foodomain.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://foo:80/\", \"href\": \"http://foo/\", \"origin\": \"http://foo\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://foo:81/\", \"href\": \"http://foo:81/\", \"origin\": \"http://foo:81\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:81\", \"hostname\": \"foo\", \"port\": \"81\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"httpa://foo:80/\", \"href\": \"httpa://foo:80/\", \"origin\": \"null\", \"protocol\": \"httpa:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:80\", \"hostname\": \"foo\", \"port\": \"80\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://foo:443/\", \"href\": \"https://foo/\", \"origin\": \"https://foo\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://foo:80/\", \"href\": \"https://foo:80/\", \"origin\": \"https://foo:80\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:80\", \"hostname\": \"foo\", \"port\": \"80\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ftp://foo:21/\", \"href\": \"ftp://foo/\", \"origin\": \"ftp://foo\", \"protocol\": \"ftp:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ftp://foo:80/\", \"href\": \"ftp://foo:80/\", \"origin\": \"ftp://foo:80\", \"protocol\": \"ftp:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:80\", \"hostname\": \"foo\", \"port\": \"80\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"gopher://foo:70/\", \"href\": \"gopher://foo:70/\", \"origin\": \"null\", \"protocol\": \"gopher:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:70\", \"hostname\": \"foo\", \"port\": \"70\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"gopher://foo:443/\", \"href\": \"gopher://foo:443/\", \"origin\": \"null\", \"protocol\": \"gopher:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:443\", \"hostname\": \"foo\", \"port\": \"443\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ws://foo:80/\", \"href\": \"ws://foo/\", \"origin\": \"ws://foo\", \"protocol\": \"ws:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ws://foo:81/\", \"href\": \"ws://foo:81/\", \"origin\": \"ws://foo:81\", \"protocol\": \"ws:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:81\", \"hostname\": \"foo\", \"port\": \"81\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ws://foo:443/\", \"href\": \"ws://foo:443/\", \"origin\": \"ws://foo:443\", \"protocol\": \"ws:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:443\", \"hostname\": \"foo\", \"port\": \"443\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ws://foo:815/\", \"href\": \"ws://foo:815/\", \"origin\": \"ws://foo:815\", \"protocol\": \"ws:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:815\", \"hostname\": \"foo\", \"port\": \"815\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss://foo:80/\", \"href\": \"wss://foo:80/\", \"origin\": \"wss://foo:80\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:80\", \"hostname\": \"foo\", \"port\": \"80\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss://foo:81/\", \"href\": \"wss://foo:81/\", \"origin\": \"wss://foo:81\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:81\", \"hostname\": \"foo\", \"port\": \"81\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss://foo:443/\", \"href\": \"wss://foo/\", \"origin\": \"wss://foo\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss://foo:815/\", \"href\": \"wss://foo:815/\", \"origin\": \"wss://foo:815\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo:815\", \"hostname\": \"foo\", \"port\": \"815\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:/example.com/\", \"href\": \"http://example.com/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ftp:/example.com/\", \"href\": \"ftp://example.com/\", \"origin\": \"ftp://example.com\", \"protocol\": \"ftp:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https:/example.com/\", \"href\": \"https://example.com/\", \"origin\": \"https://example.com\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"madeupscheme:/example.com/\", \"href\": \"madeupscheme:/example.com/\", \"origin\": \"null\", \"protocol\": \"madeupscheme:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:/example.com/\", \"href\": \"file:///example.com/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ftps:/example.com/\", \"href\": \"ftps:/example.com/\", \"origin\": \"null\", \"protocol\": \"ftps:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"gopher:/example.com/\", \"href\": \"gopher:/example.com/\", \"origin\": \"null\", \"protocol\": \"gopher:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ws:/example.com/\", \"href\": \"ws://example.com/\", \"origin\": \"ws://example.com\", \"protocol\": \"ws:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss:/example.com/\", \"href\": \"wss://example.com/\", \"origin\": \"wss://example.com\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data:/example.com/\", \"href\": \"data:/example.com/\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"javascript:/example.com/\", \"href\": \"javascript:/example.com/\", \"origin\": \"null\", \"protocol\": \"javascript:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"mailto:/example.com/\", \"href\": \"mailto:/example.com/\", \"origin\": \"null\", \"protocol\": \"mailto:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:example.com/\", \"href\": \"http://example.com/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ftp:example.com/\", \"href\": \"ftp://example.com/\", \"origin\": \"ftp://example.com\", \"protocol\": \"ftp:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https:example.com/\", \"href\": \"https://example.com/\", \"origin\": \"https://example.com\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"madeupscheme:example.com/\", \"href\": \"madeupscheme:example.com/\", \"origin\": \"null\", \"protocol\": \"madeupscheme:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ftps:example.com/\", \"href\": \"ftps:example.com/\", \"origin\": \"null\", \"protocol\": \"ftps:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"gopher:example.com/\", \"href\": \"gopher:example.com/\", \"origin\": \"null\", \"protocol\": \"gopher:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ws:example.com/\", \"href\": \"ws://example.com/\", \"origin\": \"ws://example.com\", \"protocol\": \"ws:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"wss:example.com/\", \"href\": \"wss://example.com/\", \"origin\": \"wss://example.com\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data:example.com/\", \"href\": \"data:example.com/\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"javascript:example.com/\", \"href\": \"javascript:example.com/\", \"origin\": \"null\", \"protocol\": \"javascript:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"mailto:example.com/\", \"href\": \"mailto:example.com/\", \"origin\": \"null\", \"protocol\": \"mailto:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"example.com/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://example.com/aaa/bbb/%2e%2e?query\", \"href\": \"https://example.com/aaa/?query\", \"origin\": \"https://example.com\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/aaa/\", \"search\": \"?query\", \"hash\": \"\" },\n{ \"input\": \"http:@www.example.com\", \"href\": \"http://www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:/@www.example.com\", \"href\": \"http://www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://@www.example.com\", \"href\": \"http://www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:a:b@www.example.com\", \"href\": \"http://a:b@www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"a\", \"password\": \"b\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:/a:b@www.example.com\", \"href\": \"http://a:b@www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"a\", \"password\": \"b\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://a:b@www.example.com\", \"href\": \"http://a:b@www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"a\", \"password\": \"b\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://@pple.com\", \"href\": \"http://pple.com/\", \"origin\": \"http://pple.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"pple.com\", \"hostname\": \"pple.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http::b@www.example.com\", \"href\": \"http://:b@www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"b\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:/:b@www.example.com\", \"href\": \"http://:b@www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"b\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://:b@www.example.com\", \"href\": \"http://:b@www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"b\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:/:@/www.example.com\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http://user@/www.example.com\", \"failure\": true },\n{ \"input\": \"http:@/www.example.com\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http:/@/www.example.com\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http://@/www.example.com\", \"failure\": true },\n{ \"input\": \"https:@/www.example.com\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http:a:b@/www.example.com\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http:/a:b@/www.example.com\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http://a:b@/www.example.com\", \"failure\": true },\n{ \"input\": \"http::@/www.example.com\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http:a:@www.example.com\", \"href\": \"http://a@www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"a\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:/a:@www.example.com\", \"href\": \"http://a@www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"a\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://a:@www.example.com\", \"href\": \"http://a@www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"a\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://www.@pple.com\", \"href\": \"http://www.@pple.com/\", \"origin\": \"http://pple.com\", \"protocol\": \"http:\", \"username\": \"www.\", \"password\": \"\", \"host\": \"pple.com\", \"hostname\": \"pple.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http:@:www.example.com\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http:/@:www.example.com\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http://:@www.example.com\", \"href\": \"http://www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/test.txt\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/test.txt\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/test.txt\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \".\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"..\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"test.txt\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/test.txt\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/test.txt\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"./test.txt\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/test.txt\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/test.txt\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"../test.txt\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/test.txt\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/test.txt\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"../aaa/test.txt\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/aaa/test.txt\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/aaa/test.txt\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"../../test.txt\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example.com/test.txt\", \"origin\": \"http://www.example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/test.txt\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://www.example2.com\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example2.com/\", \"origin\": \"http://www.example2.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example2.com\", \"hostname\": \"www.example2.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//www.example2.com\", \"base\": \"http://www.example.com/test\", \"href\": \"http://www.example2.com/\", \"origin\": \"http://www.example2.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example2.com\", \"hostname\": \"www.example2.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:...\", \"base\": \"http://www.example.com/test\", \"href\": \"file:///...\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/...\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:..\", \"base\": \"http://www.example.com/test\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:a\", \"base\": \"http://www.example.com/test\", \"href\": \"file:///a\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:.\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:.\", \"base\": \"http://www.example.com/test\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://ExAmPlE.CoM\", \"base\": \"http://other.com/\", \"href\": \"http://example.com/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://%ef%b7%90zyx.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"https://%EF%BF%BD\", \"failure\": true },\n{ \"input\": \"http://a.b.c.xn--pokxncvks\", \"failure\": true },\n{ \"input\": \"http://10.0.0.xn--pokxncvks\", \"failure\": true },\n{ \"input\": \"http://a.b.c.XN--pokxncvks\", \"failure\": true },\n{ \"input\": \"http://a.b.c.Xn--pokxncvks\", \"failure\": true },\n{ \"input\": \"http://10.0.0.XN--pokxncvks\", \"failure\": true },\n{ \"input\": \"http://10.0.0.xN--pokxncvks\", \"failure\": true },\n{ \"input\": \"http://%ef%bc%85%ef%bc%94%ef%bc%91.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://%ef%bc%85%ef%bc%90%ef%bc%90.com\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://%25\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://hello%00\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://%30%78%63%30%2e%30%32%35%30.01\", \"base\": \"http://other.com/\", \"href\": \"http://192.168.0.1/\", \"origin\": \"http://192.168.0.1\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"192.168.0.1\", \"hostname\": \"192.168.0.1\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://%30%78%63%30%2e%30%32%35%30.01%2e\", \"base\": \"http://other.com/\", \"href\": \"http://192.168.0.1/\", \"origin\": \"http://192.168.0.1\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"192.168.0.1\", \"hostname\": \"192.168.0.1\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://192.168.0.257\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://./\", \"href\": \"http://./\", \"origin\": \"http://.\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \".\", \"hostname\": \".\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://../\", \"href\": \"http://../\", \"origin\": \"http://..\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"..\", \"hostname\": \"..\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"h://.\", \"href\": \"h://.\", \"origin\": \"null\", \"protocol\": \"h:\", \"username\": \"\", \"password\": \"\", \"host\": \".\", \"hostname\": \".\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"#\", \"base\": \"test:test\", \"href\": \"test:test#\", \"origin\": \"null\", \"protocol\": \"test:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"#x\", \"base\": \"mailto:x@x.com\", \"href\": \"mailto:x@x.com#x\", \"origin\": \"null\", \"protocol\": \"mailto:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x@x.com\", \"search\": \"\", \"hash\": \"#x\" },\n{ \"input\": \"#x\", \"base\": \"data:,\", \"href\": \"data:,#x\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \",\", \"search\": \"\", \"hash\": \"#x\" },\n{ \"input\": \"#x\", \"base\": \"about:blank\", \"href\": \"about:blank#x\", \"origin\": \"null\", \"protocol\": \"about:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"blank\", \"search\": \"\", \"hash\": \"#x\" },\n{ \"input\": \"#x:y\", \"base\": \"about:blank\", \"href\": \"about:blank#x:y\", \"origin\": \"null\", \"protocol\": \"about:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"blank\", \"search\": \"\", \"hash\": \"#x:y\" },\n{ \"input\": \"#\", \"base\": \"test:test?test\", \"href\": \"test:test?test#\", \"origin\": \"null\", \"protocol\": \"test:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"test\", \"search\": \"?test\", \"hash\": \"\" },\n{ \"input\": \"http://host/?'\", \"href\": \"http://host/?%27\", \"origin\": \"http://host\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"?%27\", \"hash\": \"\" },\n{ \"input\": \"notspecial://host/?'\", \"href\": \"notspecial://host/?'\", \"origin\": \"null\", \"protocol\": \"notspecial:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"?'\", \"hash\": \"\" },\n{ \"input\": \"/some/path\", \"base\": \"http://user@example.org/smth\", \"href\": \"http://user@example.org/some/path\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"user\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/some/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\", \"base\": \"http://user:pass@example.org:21/smth\", \"href\": \"http://user:pass@example.org:21/smth\", \"origin\": \"http://example.org:21\", \"protocol\": \"http:\", \"username\": \"user\", \"password\": \"pass\", \"host\": \"example.org:21\", \"hostname\": \"example.org\", \"port\": \"21\", \"pathname\": \"/smth\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/some/path\", \"base\": \"http://user:pass@example.org:21/smth\", \"href\": \"http://user:pass@example.org:21/some/path\", \"origin\": \"http://example.org:21\", \"protocol\": \"http:\", \"username\": \"user\", \"password\": \"pass\", \"host\": \"example.org:21\", \"hostname\": \"example.org\", \"port\": \"21\", \"pathname\": \"/some/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"i\", \"base\": \"sc:sd\", \"failure\": true },\n{ \"input\": \"i\", \"base\": \"sc:sd/sd\", \"failure\": true },\n{ \"input\": \"i\", \"base\": \"sc:/pa/pa\", \"href\": \"sc:/pa/i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/pa/i\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"i\", \"base\": \"sc://ho/pa\", \"href\": \"sc://ho/i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"ho\", \"hostname\": \"ho\", \"port\": \"\", \"pathname\": \"/i\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"i\", \"base\": \"sc:///pa/pa\", \"href\": \"sc:///pa/i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/pa/i\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"../i\", \"base\": \"sc:sd\", \"failure\": true },\n{ \"input\": \"../i\", \"base\": \"sc:sd/sd\", \"failure\": true },\n{ \"input\": \"../i\", \"base\": \"sc:/pa/pa\", \"href\": \"sc:/i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/i\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"../i\", \"base\": \"sc://ho/pa\", \"href\": \"sc://ho/i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"ho\", \"hostname\": \"ho\", \"port\": \"\", \"pathname\": \"/i\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"../i\", \"base\": \"sc:///pa/pa\", \"href\": \"sc:///i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/i\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/i\", \"base\": \"sc:sd\", \"failure\": true },\n{ \"input\": \"/i\", \"base\": \"sc:sd/sd\", \"failure\": true },\n{ \"input\": \"/i\", \"base\": \"sc:/pa/pa\", \"href\": \"sc:/i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/i\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/i\", \"base\": \"sc://ho/pa\", \"href\": \"sc://ho/i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"ho\", \"hostname\": \"ho\", \"port\": \"\", \"pathname\": \"/i\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/i\", \"base\": \"sc:///pa/pa\", \"href\": \"sc:///i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/i\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"?i\", \"base\": \"sc:sd\", \"failure\": true },\n{ \"input\": \"?i\", \"base\": \"sc:sd/sd\", \"failure\": true },\n{ \"input\": \"?i\", \"base\": \"sc:/pa/pa\", \"href\": \"sc:/pa/pa?i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/pa/pa\", \"search\": \"?i\", \"hash\": \"\" },\n{ \"input\": \"?i\", \"base\": \"sc://ho/pa\", \"href\": \"sc://ho/pa?i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"ho\", \"hostname\": \"ho\", \"port\": \"\", \"pathname\": \"/pa\", \"search\": \"?i\", \"hash\": \"\" },\n{ \"input\": \"?i\", \"base\": \"sc:///pa/pa\", \"href\": \"sc:///pa/pa?i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/pa/pa\", \"search\": \"?i\", \"hash\": \"\" },\n{ \"input\": \"#i\", \"base\": \"sc:sd\", \"href\": \"sc:sd#i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"sd\", \"search\": \"\", \"hash\": \"#i\" },\n{ \"input\": \"#i\", \"base\": \"sc:sd/sd\", \"href\": \"sc:sd/sd#i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"sd/sd\", \"search\": \"\", \"hash\": \"#i\" },\n{ \"input\": \"#i\", \"base\": \"sc:/pa/pa\", \"href\": \"sc:/pa/pa#i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/pa/pa\", \"search\": \"\", \"hash\": \"#i\" },\n{ \"input\": \"#i\", \"base\": \"sc://ho/pa\", \"href\": \"sc://ho/pa#i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"ho\", \"hostname\": \"ho\", \"port\": \"\", \"pathname\": \"/pa\", \"search\": \"\", \"hash\": \"#i\" },\n{ \"input\": \"#i\", \"base\": \"sc:///pa/pa\", \"href\": \"sc:///pa/pa#i\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/pa/pa\", \"search\": \"\", \"hash\": \"#i\" },\n{ \"input\": \"about:/../\", \"href\": \"about:/\", \"origin\": \"null\", \"protocol\": \"about:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data:/../\", \"href\": \"data:/\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"javascript:/../\", \"href\": \"javascript:/\", \"origin\": \"null\", \"protocol\": \"javascript:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"mailto:/../\", \"href\": \"mailto:/\", \"origin\": \"null\", \"protocol\": \"mailto:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc://@/\", \"failure\": true },\n{ \"input\": \"sc://:/\", \"failure\": true },\n{ \"input\": \"sc://:12/\", \"failure\": true },\n{ \"input\": \"x\", \"base\": \"sc://ñ\", \"href\": \"sc://%C3%B1/x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"/x\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc::a@example.net\", \"href\": \"sc::a@example.net\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \":a@example.net\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://ho%00st/\", \"failure\": true },\n{ \"input\": \"http://ho%01st/\", \"failure\": true },\n{ \"input\": \"http://ho%02st/\", \"failure\": true },\n{ \"input\": \"http://ho%03st/\", \"failure\": true },\n{ \"input\": \"http://ho%04st/\", \"failure\": true },\n{ \"input\": \"http://ho%05st/\", \"failure\": true },\n{ \"input\": \"http://ho%06st/\", \"failure\": true },\n{ \"input\": \"http://ho%07st/\", \"failure\": true },\n{ \"input\": \"http://ho%08st/\", \"failure\": true },\n{ \"input\": \"http://ho%09st/\", \"failure\": true },\n{ \"input\": \"http://ho%0Ast/\", \"failure\": true },\n{ \"input\": \"http://ho%0Bst/\", \"failure\": true },\n{ \"input\": \"http://ho%0Cst/\", \"failure\": true },\n{ \"input\": \"http://ho%0Dst/\", \"failure\": true },\n{ \"input\": \"http://ho%0Est/\", \"failure\": true },\n{ \"input\": \"http://ho%0Fst/\", \"failure\": true },\n{ \"input\": \"http://ho%10st/\", \"failure\": true },\n{ \"input\": \"http://ho%11st/\", \"failure\": true },\n{ \"input\": \"http://ho%12st/\", \"failure\": true },\n{ \"input\": \"http://ho%13st/\", \"failure\": true },\n{ \"input\": \"http://ho%14st/\", \"failure\": true },\n{ \"input\": \"http://ho%15st/\", \"failure\": true },\n{ \"input\": \"http://ho%16st/\", \"failure\": true },\n{ \"input\": \"http://ho%17st/\", \"failure\": true },\n{ \"input\": \"http://ho%18st/\", \"failure\": true },\n{ \"input\": \"http://ho%19st/\", \"failure\": true },\n{ \"input\": \"http://ho%1Ast/\", \"failure\": true },\n{ \"input\": \"http://ho%1Bst/\", \"failure\": true },\n{ \"input\": \"http://ho%1Cst/\", \"failure\": true },\n{ \"input\": \"http://ho%1Dst/\", \"failure\": true },\n{ \"input\": \"http://ho%1Est/\", \"failure\": true },\n{ \"input\": \"http://ho%1Fst/\", \"failure\": true },\n{ \"input\": \"http://ho%20st/\", \"failure\": true },\n{ \"input\": \"http://ho%23st/\", \"failure\": true },\n{ \"input\": \"http://ho%25st/\", \"failure\": true },\n{ \"input\": \"http://ho%2Fst/\", \"failure\": true },\n{ \"input\": \"http://ho%3Ast/\", \"failure\": true },\n{ \"input\": \"http://ho%3Cst/\", \"failure\": true },\n{ \"input\": \"http://ho%3Est/\", \"failure\": true },\n{ \"input\": \"http://ho%3Fst/\", \"failure\": true },\n{ \"input\": \"http://ho%40st/\", \"failure\": true },\n{ \"input\": \"http://ho%5Bst/\", \"failure\": true },\n{ \"input\": \"http://ho%5Cst/\", \"failure\": true },\n{ \"input\": \"http://ho%5Dst/\", \"failure\": true },\n{ \"input\": \"http://ho%7Cst/\", \"failure\": true },\n{ \"input\": \"http://ho%7Fst/\", \"failure\": true },\n{ \"input\": \"ftp://example.com%80/\", \"failure\": true },\n{ \"input\": \"ftp://example.com%A0/\", \"failure\": true },\n{ \"input\": \"https://example.com%80/\", \"failure\": true },\n{ \"input\": \"https://example.com%A0/\", \"failure\": true },\n{ \"input\": \"ftp://%e2%98%83\", \"href\": \"ftp://xn--n3h/\", \"origin\": \"ftp://xn--n3h\", \"protocol\": \"ftp:\", \"username\": \"\", \"password\": \"\", \"host\": \"xn--n3h\", \"hostname\": \"xn--n3h\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://%e2%98%83\", \"href\": \"https://xn--n3h/\", \"origin\": \"https://xn--n3h\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"xn--n3h\", \"hostname\": \"xn--n3h\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://127.0.0.1:10100/relative_import.html\", \"href\": \"http://127.0.0.1:10100/relative_import.html\", \"origin\": \"http://127.0.0.1:10100\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"127.0.0.1:10100\", \"hostname\": \"127.0.0.1\", \"port\": \"10100\", \"pathname\": \"/relative_import.html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://facebook.com/?foo=%7B%22abc%22\", \"href\": \"http://facebook.com/?foo=%7B%22abc%22\", \"origin\": \"http://facebook.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"facebook.com\", \"hostname\": \"facebook.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"?foo=%7B%22abc%22\", \"hash\": \"\" },\n{ \"input\": \"https://localhost:3000/jqueryui@1.2.3\", \"href\": \"https://localhost:3000/jqueryui@1.2.3\", \"origin\": \"https://localhost:3000\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"localhost:3000\", \"hostname\": \"localhost\", \"port\": \"3000\", \"pathname\": \"/jqueryui@1.2.3\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"?a=b&c=d\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar?a=b&c=d\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"?a=b&c=d\", \"searchParams\": \"a=b&c=d\", \"hash\": \"\" },\n{ \"input\": \"??a=b&c=d\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/bar??a=b&c=d\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"??a=b&c=d\", \"searchParams\": \"%3Fa=b&c=d\", \"hash\": \"\" },\n{ \"input\": \"http://1.2.3.4/\", \"base\": \"http://other.com/\", \"href\": \"http://1.2.3.4/\", \"origin\": \"http://1.2.3.4\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"1.2.3.4\", \"hostname\": \"1.2.3.4\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://1.2.3.4./\", \"base\": \"http://other.com/\", \"href\": \"http://1.2.3.4/\", \"origin\": \"http://1.2.3.4\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"1.2.3.4\", \"hostname\": \"1.2.3.4\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://192.168.257\", \"base\": \"http://other.com/\", \"href\": \"http://192.168.1.1/\", \"origin\": \"http://192.168.1.1\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"192.168.1.1\", \"hostname\": \"192.168.1.1\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://192.168.257.\", \"base\": \"http://other.com/\", \"href\": \"http://192.168.1.1/\", \"origin\": \"http://192.168.1.1\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"192.168.1.1\", \"hostname\": \"192.168.1.1\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://192.168.257.com\", \"base\": \"http://other.com/\", \"href\": \"http://192.168.257.com/\", \"origin\": \"http://192.168.257.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"192.168.257.com\", \"hostname\": \"192.168.257.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://256\", \"base\": \"http://other.com/\", \"href\": \"http://0.0.1.0/\", \"origin\": \"http://0.0.1.0\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"0.0.1.0\", \"hostname\": \"0.0.1.0\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://256.com\", \"base\": \"http://other.com/\", \"href\": \"http://256.com/\", \"origin\": \"http://256.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"256.com\", \"hostname\": \"256.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://999999999\", \"base\": \"http://other.com/\", \"href\": \"http://59.154.201.255/\", \"origin\": \"http://59.154.201.255\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"59.154.201.255\", \"hostname\": \"59.154.201.255\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://999999999.\", \"base\": \"http://other.com/\", \"href\": \"http://59.154.201.255/\", \"origin\": \"http://59.154.201.255\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"59.154.201.255\", \"hostname\": \"59.154.201.255\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://999999999.com\", \"base\": \"http://other.com/\", \"href\": \"http://999999999.com/\", \"origin\": \"http://999999999.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"999999999.com\", \"hostname\": \"999999999.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://10000000000\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://10000000000.com\", \"base\": \"http://other.com/\", \"href\": \"http://10000000000.com/\", \"origin\": \"http://10000000000.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"10000000000.com\", \"hostname\": \"10000000000.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://4294967295\", \"base\": \"http://other.com/\", \"href\": \"http://255.255.255.255/\", \"origin\": \"http://255.255.255.255\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"255.255.255.255\", \"hostname\": \"255.255.255.255\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://4294967296\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://0xffffffff\", \"base\": \"http://other.com/\", \"href\": \"http://255.255.255.255/\", \"origin\": \"http://255.255.255.255\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"255.255.255.255\", \"hostname\": \"255.255.255.255\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://0xffffffff1\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://256.256.256.256\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"https://0x.0x.0\", \"href\": \"https://0.0.0.0/\", \"origin\": \"https://0.0.0.0\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"0.0.0.0\", \"hostname\": \"0.0.0.0\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://0x.0x.0x.0x\", \"href\": \"https://0.0.0.0/\", \"origin\": \"https://0.0.0.0\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"0.0.0.0\", \"hostname\": \"0.0.0.0\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://00.00.00.00\", \"href\": \"https://0.0.0.0/\", \"origin\": \"https://0.0.0.0\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"0.0.0.0\", \"hostname\": \"0.0.0.0\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://0x100000000/test\", \"failure\": true },\n{ \"input\": \"https://256.0.0.1/test\", \"failure\": true },\n{ \"input\": \"file:///C%3A/\", \"href\": \"file:///C%3A/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C%3A/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///C%7C/\", \"href\": \"file:///C%7C/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C%7C/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://%43%3A\", \"failure\": true },\n{ \"input\": \"file://%43%7C\", \"failure\": true },\n{ \"input\": \"file://C%7C\", \"failure\": true },\n{ \"input\": \"file://%43%7C/\", \"failure\": true },\n{ \"input\": \"https://%43%7C/\", \"failure\": true },\n{ \"input\": \"asdf://%43%7C/\", \"href\": \"asdf://%43%7C/\", \"origin\": \"null\", \"protocol\": \"asdf:\", \"username\": \"\", \"password\": \"\", \"host\": \"%43%7C\", \"hostname\": \"%43%7C\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"pix/submit.gif\", \"base\": \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html\", \"href\": \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"..\", \"base\": \"file:///C:/\", \"href\": \"file:///C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"..\", \"base\": \"file:///\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/\", \"base\": \"file:///C:/a/b\", \"href\": \"file:///C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/\", \"base\": \"file://h/C:/a/b\", \"href\": \"file://h/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"h\", \"hostname\": \"h\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/\", \"base\": \"file://h/a/b\", \"href\": \"file://h/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"h\", \"hostname\": \"h\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//d:\", \"base\": \"file:///C:/a/b\", \"href\": \"file:///d:\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/d:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//d:/..\", \"base\": \"file:///C:/a/b\", \"href\": \"file:///d:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/d:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"..\", \"base\": \"file:///ab:/\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"..\", \"base\": \"file:///1:/\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\", \"base\": \"file:///test?test#test\", \"href\": \"file:///test?test\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?test\", \"hash\": \"\" },\n{ \"input\": \"?x\", \"base\": \"file:///test?test#test\", \"href\": \"file:///test?x\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?x\", \"hash\": \"\" },\n{ \"input\": \"file:?x\", \"base\": \"file:///test?test#test\", \"href\": \"file:///test?x\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?x\", \"hash\": \"\" },\n{ \"input\": \"#x\", \"base\": \"file:///test?test#test\", \"href\": \"file:///test?test#x\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?test\", \"hash\": \"#x\" },\n{ \"input\": \"file://spider///\", \"href\": \"file://spider///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"spider\", \"hostname\": \"spider\", \"port\": \"\", \"pathname\": \"///\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///localhost//cat\", \"href\": \"file:///localhost//cat\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/localhost//cat\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://localhost//a//../..//\", \"href\": \"file://///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"///\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/////mouse\", \"base\": \"file:///elephant\", \"href\": \"file://///mouse\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"///mouse\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//localhost//pig\", \"base\": \"file://lion/\", \"href\": \"file:////pig\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//pig\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/..//localhost//pig\", \"base\": \"file://lion/\", \"href\": \"file://lion//localhost//pig\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"lion\", \"hostname\": \"lion\", \"port\": \"\", \"pathname\": \"//localhost//pig\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/rooibos\", \"base\": \"file://tea/\", \"href\": \"file://tea/rooibos\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"tea\", \"hostname\": \"tea\", \"port\": \"\", \"pathname\": \"/rooibos\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/?chai\", \"base\": \"file://tea/\", \"href\": \"file://tea/?chai\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"tea\", \"hostname\": \"tea\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"?chai\", \"hash\": \"\" },\n{ \"input\": \"C\", \"base\": \"file://host/dir/file\", \"href\": \"file://host/dir/C\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/dir/C\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/c:/foo/bar\", \"base\": \"file:///c:/baz/qux\", \"href\": \"file:///c:/foo/bar\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/c:/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/c:/foo/bar\", \"base\": \"file://host/path\", \"href\": \"file://host/c:/foo/bar\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/c:/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"..\", \"base\": \"abc://x/y/z/C:/\", \"href\": \"abc://x/y/z/\", \"protocol\": \"abc:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/y/z/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"..\", \"base\": \"file://x/C:/\", \"href\": \"file://x/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://example.net/C:/\", \"href\": \"file://example.net/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.net\", \"hostname\": \"example.net\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://1.2.3.4/C:/\", \"href\": \"file://1.2.3.4/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"1.2.3.4\", \"hostname\": \"1.2.3.4\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://[1::8]/C:/\", \"href\": \"file://[1::8]/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"[1::8]\", \"hostname\": \"[1::8]\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/C:/\", \"base\": \"file://host/\", \"href\": \"file://host/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:C:/\", \"base\": \"file://host/\", \"href\": \"file://host/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:/C:/\", \"base\": \"file://host/\", \"href\": \"file://host/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//C:/\", \"base\": \"file://host/\", \"href\": \"file:///C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://C:/\", \"base\": \"file://host/\", \"href\": \"file:///C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///C:/\", \"base\": \"file://host/\", \"href\": \"file:///C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///C:/\", \"base\": \"file://host/\", \"href\": \"file:///C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:?q=v\", \"href\": \"file:///?q=v\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"?q=v\", \"hash\": \"\" },\n{ \"input\": \"file:///Y:\", \"href\": \"file:///Y:\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/Y:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///Y:/\", \"href\": \"file:///Y:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/Y:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///./Y\", \"href\": \"file:///Y\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/Y\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///./Y:\", \"href\": \"file:///Y:\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/Y:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///y:\", \"href\": \"file:///y:\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/y:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///y:/\", \"href\": \"file:///y:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/y:/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///./y\", \"href\": \"file:///y\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/y\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///./y:\", \"href\": \"file:///y:\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/y:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://localhost//a//../..//foo\", \"href\": \"file://///foo\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"///foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://localhost////foo\", \"href\": \"file://////foo\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"////foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:////foo\", \"href\": \"file:////foo\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//foo\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///one/two\", \"base\": \"file:///\", \"href\": \"file:///one/two\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/one/two\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:////one/two\", \"base\": \"file:///\", \"href\": \"file:////one/two\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//one/two\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//one/two\", \"base\": \"file:///\", \"href\": \"file://one/two\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"one\", \"hostname\": \"one\", \"port\": \"\", \"pathname\": \"/two\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///one/two\", \"base\": \"file:///\", \"href\": \"file:///one/two\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/one/two\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"////one/two\", \"base\": \"file:///\", \"href\": \"file:////one/two\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//one/two\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:///.//\", \"base\": \"file:////\", \"href\": \"file:////\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:.//p\", \"href\": \"file:////p\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//p\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file:/.//p\", \"href\": \"file:////p\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//p\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://[1:0::]\", \"base\": \"http://example.net/\", \"href\": \"http://[1::]/\", \"origin\": \"http://[1::]\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"[1::]\", \"hostname\": \"[1::]\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://?\", \"failure\": true },\n{ \"input\": \"http://#\", \"failure\": true },\n{ \"input\": \"http://f:4294967377/c\", \"base\": \"http://example.org/\", \"failure\": true },\n{ \"input\": \"http://f:18446744073709551697/c\", \"base\": \"http://example.org/\", \"failure\": true },\n{ \"input\": \"http://f:340282366920938463463374607431768211537/c\", \"base\": \"http://example.org/\", \"failure\": true },\n{ \"input\": \"#x\", \"base\": \"sc://ñ\", \"href\": \"sc://%C3%B1#x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"#x\" },\n{ \"input\": \"?x\", \"base\": \"sc://ñ\", \"href\": \"sc://%C3%B1?x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"?x\", \"hash\": \"\" },\n{ \"input\": \"sc://?\", \"href\": \"sc://?\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"sc://#\", \"href\": \"sc://#\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///\", \"base\": \"sc://x/\", \"href\": \"sc:///\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"////\", \"base\": \"sc://x/\", \"href\": \"sc:////\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"////x/\", \"base\": \"sc://x/\", \"href\": \"sc:////x/\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//x/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"tftp://foobar.com/someconfig;mode=netascii\", \"href\": \"tftp://foobar.com/someconfig;mode=netascii\", \"origin\": \"null\", \"protocol\": \"tftp:\", \"username\": \"\", \"password\": \"\", \"host\": \"foobar.com\", \"hostname\": \"foobar.com\", \"port\": \"\", \"pathname\": \"/someconfig;mode=netascii\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"telnet://user:pass@foobar.com:23/\", \"href\": \"telnet://user:pass@foobar.com:23/\", \"origin\": \"null\", \"protocol\": \"telnet:\", \"username\": \"user\", \"password\": \"pass\", \"host\": \"foobar.com:23\", \"hostname\": \"foobar.com\", \"port\": \"23\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"ut2004://10.10.10.10:7777/Index.ut2\", \"href\": \"ut2004://10.10.10.10:7777/Index.ut2\", \"origin\": \"null\", \"protocol\": \"ut2004:\", \"username\": \"\", \"password\": \"\", \"host\": \"10.10.10.10:7777\", \"hostname\": \"10.10.10.10\", \"port\": \"7777\", \"pathname\": \"/Index.ut2\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\", \"href\": \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\", \"origin\": \"null\", \"protocol\": \"redis:\", \"username\": \"foo\", \"password\": \"bar\", \"host\": \"somehost:6379\", \"hostname\": \"somehost\", \"port\": \"6379\", \"pathname\": \"/0\", \"search\": \"?baz=bam&qux=baz\", \"hash\": \"\" },\n{ \"input\": \"rsync://foo@host:911/sup\", \"href\": \"rsync://foo@host:911/sup\", \"origin\": \"null\", \"protocol\": \"rsync:\", \"username\": \"foo\", \"password\": \"\", \"host\": \"host:911\", \"hostname\": \"host\", \"port\": \"911\", \"pathname\": \"/sup\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"git://github.com/foo/bar.git\", \"href\": \"git://github.com/foo/bar.git\", \"origin\": \"null\", \"protocol\": \"git:\", \"username\": \"\", \"password\": \"\", \"host\": \"github.com\", \"hostname\": \"github.com\", \"port\": \"\", \"pathname\": \"/foo/bar.git\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"irc://myserver.com:6999/channel?passwd\", \"href\": \"irc://myserver.com:6999/channel?passwd\", \"origin\": \"null\", \"protocol\": \"irc:\", \"username\": \"\", \"password\": \"\", \"host\": \"myserver.com:6999\", \"hostname\": \"myserver.com\", \"port\": \"6999\", \"pathname\": \"/channel\", \"search\": \"?passwd\", \"hash\": \"\" },\n{ \"input\": \"dns://fw.example.org:9999/foo.bar.org?type=TXT\", \"href\": \"dns://fw.example.org:9999/foo.bar.org?type=TXT\", \"origin\": \"null\", \"protocol\": \"dns:\", \"username\": \"\", \"password\": \"\", \"host\": \"fw.example.org:9999\", \"hostname\": \"fw.example.org\", \"port\": \"9999\", \"pathname\": \"/foo.bar.org\", \"search\": \"?type=TXT\", \"hash\": \"\" },\n{ \"input\": \"ldap://localhost:389/ou=People,o=JNDITutorial\", \"href\": \"ldap://localhost:389/ou=People,o=JNDITutorial\", \"origin\": \"null\", \"protocol\": \"ldap:\", \"username\": \"\", \"password\": \"\", \"host\": \"localhost:389\", \"hostname\": \"localhost\", \"port\": \"389\", \"pathname\": \"/ou=People,o=JNDITutorial\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"git+https://github.com/foo/bar\", \"href\": \"git+https://github.com/foo/bar\", \"origin\": \"null\", \"protocol\": \"git+https:\", \"username\": \"\", \"password\": \"\", \"host\": \"github.com\", \"hostname\": \"github.com\", \"port\": \"\", \"pathname\": \"/foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"urn:ietf:rfc:2648\", \"href\": \"urn:ietf:rfc:2648\", \"origin\": \"null\", \"protocol\": \"urn:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"ietf:rfc:2648\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"tag:joe@example.org,2001:foo/bar\", \"href\": \"tag:joe@example.org,2001:foo/bar\", \"origin\": \"null\", \"protocol\": \"tag:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"joe@example.org,2001:foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-spec:/.//\", \"href\": \"non-spec:/.//\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-spec:/..//\", \"href\": \"non-spec:/.//\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-spec:/a/..//\", \"href\": \"non-spec:/.//\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-spec:/.//path\", \"href\": \"non-spec:/.//path\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-spec:/..//path\", \"href\": \"non-spec:/.//path\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-spec:/a/..//path\", \"href\": \"non-spec:/.//path\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/.//path\", \"base\": \"non-spec:/p\", \"href\": \"non-spec:/.//path\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"/..//path\", \"base\": \"non-spec:/p\", \"href\": \"non-spec:/.//path\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"..//path\", \"base\": \"non-spec:/p\", \"href\": \"non-spec:/.//path\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"a/..//path\", \"base\": \"non-spec:/p\", \"href\": \"non-spec:/.//path\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"\", \"base\": \"non-spec:/..//p\", \"href\": \"non-spec:/.//p\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//p\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"path\", \"base\": \"non-spec:/..//p\", \"href\": \"non-spec:/.//path\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"../path\", \"base\": \"non-spec:/.//p\", \"href\": \"non-spec:/path\", \"protocol\": \"non-spec:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special://%E2%80%A0/\", \"href\": \"non-special://%E2%80%A0/\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"%E2%80%A0\", \"hostname\": \"%E2%80%A0\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special://H%4fSt/path\", \"href\": \"non-special://H%4fSt/path\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"H%4fSt\", \"hostname\": \"H%4fSt\", \"port\": \"\", \"pathname\": \"/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special://[1:2:0:0:5:0:0:0]/\", \"href\": \"non-special://[1:2:0:0:5::]/\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"[1:2:0:0:5::]\", \"hostname\": \"[1:2:0:0:5::]\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special://[1:2:0:0:0:0:0:3]/\", \"href\": \"non-special://[1:2::3]/\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"[1:2::3]\", \"hostname\": \"[1:2::3]\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"non-special://[1:2::3]:80/\", \"href\": \"non-special://[1:2::3]:80/\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"[1:2::3]:80\", \"hostname\": \"[1:2::3]\", \"port\": \"80\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:https://example.com:443/\", \"href\": \"blob:https://example.com:443/\", \"origin\": \"https://example.com\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"https://example.com:443/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:http://example.org:88/\", \"href\": \"blob:http://example.org:88/\", \"origin\": \"http://example.org:88\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"http://example.org:88/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"href\": \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"origin\": \"null\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:blob:\", \"href\": \"blob:blob:\", \"origin\": \"null\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"blob:\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:blob:https://example.org/\", \"href\": \"blob:blob:https://example.org/\", \"origin\": \"null\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"blob:https://example.org/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:about:blank\", \"href\": \"blob:about:blank\", \"origin\": \"null\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"about:blank\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:file://host/path\", \"href\": \"blob:file://host/path\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"file://host/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:ftp://host/path\", \"href\": \"blob:ftp://host/path\", \"origin\": \"null\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"ftp://host/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:ws://example.org/\", \"href\": \"blob:ws://example.org/\", \"origin\": \"null\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"ws://example.org/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:wss://example.org/\", \"href\": \"blob:wss://example.org/\", \"origin\": \"null\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"wss://example.org/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"blob:http%3a//example.org/\", \"href\": \"blob:http%3a//example.org/\", \"origin\": \"null\", \"protocol\": \"blob:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"http%3a//example.org/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://0x7f.0.0.0x7g\", \"href\": \"http://0x7f.0.0.0x7g/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"0x7f.0.0.0x7g\", \"hostname\": \"0x7f.0.0.0x7g\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://0X7F.0.0.0X7G\", \"href\": \"http://0x7f.0.0.0x7g/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"0x7f.0.0.0x7g\", \"hostname\": \"0x7f.0.0.0x7g\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://[0:1:0:1:0:1:0:1]\", \"href\": \"http://[0:1:0:1:0:1:0:1]/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"[0:1:0:1:0:1:0:1]\", \"hostname\": \"[0:1:0:1:0:1:0:1]\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://[1:0:1:0:1:0:1:0]\", \"href\": \"http://[1:0:1:0:1:0:1:0]/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"[1:0:1:0:1:0:1:0]\", \"hostname\": \"[1:0:1:0:1:0:1:0]\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.org/test?#\", \"href\": \"http://example.org/test?#\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://example.org/test?%23%23\", \"href\": \"http://example.org/test?%23%23\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?%23%23\", \"hash\": \"\" },\n{ \"input\": \"http://example.org/test?a#%EF\", \"href\": \"http://example.org/test?a#%EF\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"?a\", \"hash\": \"#%EF\" },\n{ \"input\": \"a\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"a/\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"a//\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"test-a-colon.html\", \"base\": \"a:\", \"failure\": true },\n{ \"input\": \"test-a-colon-b.html\", \"base\": \"a:b\", \"failure\": true },\n{ \"input\": \"test-a-colon-slash.html\", \"base\": \"a:/\", \"href\": \"a:/test-a-colon-slash.html\", \"protocol\": \"a:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test-a-colon-slash.html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"test-a-colon-slash-slash.html\", \"base\": \"a://\", \"href\": \"a:///test-a-colon-slash-slash.html\", \"protocol\": \"a:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test-a-colon-slash-slash.html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"test-a-colon-slash-b.html\", \"base\": \"a:/b\", \"href\": \"a:/test-a-colon-slash-b.html\", \"protocol\": \"a:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test-a-colon-slash-b.html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"test-a-colon-slash-slash-b.html\", \"base\": \"a://b\", \"href\": \"a://b/test-a-colon-slash-slash-b.html\", \"protocol\": \"a:\", \"username\": \"\", \"password\": \"\", \"host\": \"b\", \"hostname\": \"b\", \"port\": \"\", \"pathname\": \"/test-a-colon-slash-slash-b.html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"a!@$*=/foo.html\", \"base\": \"file:///some/dir/bar.html\", \"href\": \"file:///some/dir/a!@$*=/foo.html\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/some/dir/a!@$*=/foo.html\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"a1234567890-+.:foo/bar\", \"base\": \"http://example.com/dir/file\", \"href\": \"a1234567890-+.:foo/bar\", \"protocol\": \"a1234567890-+.:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"foo/bar\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://a%C2%ADb/p\", \"href\": \"file://ab/p\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"ab\", \"hostname\": \"ab\", \"port\": \"\", \"pathname\": \"/p\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"file://%C2%AD/p\", \"failure\": true },\n{ \"input\": \"file://xn--/p\", \"failure\": true },\n{ \"input\": \"#link\", \"base\": \"https://example.org/##link\", \"href\": \"https://example.org/#link\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"#link\" },\n{ \"input\": \"abc:rootless\", \"base\": \"abc://host/path\", \"href\": \"abc:rootless\", \"protocol\": \"abc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"rootless\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"abc:rootless\", \"base\": \"abc:/path\", \"href\": \"abc:rootless\", \"protocol\": \"abc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"rootless\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"abc:rootless\", \"base\": \"abc:path\", \"href\": \"abc:rootless\", \"protocol\": \"abc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"rootless\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"abc:/rooted\", \"base\": \"abc://host/path\", \"href\": \"abc:/rooted\", \"protocol\": \"abc:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/rooted\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"#\", \"relativeTo\": \"any-base\", \"failure\": true },\n{ \"input\": \"?\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"http://1.2.3.4.5\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://1.2.3.4.5.\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://0..0x300/\", \"failure\": true },\n{ \"input\": \"http://0..0x300./\", \"failure\": true },\n{ \"input\": \"http://256.256.256.256.256\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://256.256.256.256.256.\", \"base\": \"http://other.com/\", \"failure\": true },\n{ \"input\": \"http://1.2.3.08\", \"failure\": true },\n{ \"input\": \"http://1.2.3.08.\", \"failure\": true },\n{ \"input\": \"http://1.2.3.09\", \"failure\": true },\n{ \"input\": \"http://09.2.3.4\", \"failure\": true },\n{ \"input\": \"http://09.2.3.4.\", \"failure\": true },\n{ \"input\": \"http://01.2.3.4.5\", \"failure\": true },\n{ \"input\": \"http://01.2.3.4.5.\", \"failure\": true },\n{ \"input\": \"http://0x100.2.3.4\", \"failure\": true },\n{ \"input\": \"http://0x100.2.3.4.\", \"failure\": true },\n{ \"input\": \"http://0x1.2.3.4.5\", \"failure\": true },\n{ \"input\": \"http://0x1.2.3.4.5.\", \"failure\": true },\n{ \"input\": \"http://foo.1.2.3.4\", \"failure\": true },\n{ \"input\": \"http://foo.1.2.3.4.\", \"failure\": true },\n{ \"input\": \"http://foo.2.3.4\", \"failure\": true },\n{ \"input\": \"http://foo.2.3.4.\", \"failure\": true },\n{ \"input\": \"http://foo.09\", \"failure\": true },\n{ \"input\": \"http://foo.09.\", \"failure\": true },\n{ \"input\": \"http://foo.0x4\", \"failure\": true },\n{ \"input\": \"http://foo.0x4.\", \"failure\": true },\n{ \"input\": \"http://foo.09..\", \"href\": \"http://foo.09../\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"foo.09..\", \"hostname\": \"foo.09..\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"http://0999999999999999999/\", \"failure\": true },\n{ \"input\": \"http://foo.0x\", \"failure\": true },\n{ \"input\": \"http://foo.0XFfFfFfFfFfFfFfFfFfAcE123\", \"failure\": true },\n{ \"input\": \"\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true },\n{ \"input\": \"https://a%C2%ADb/\", \"href\": \"https://ab/\", \"origin\": \"https://ab\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"ab\", \"hostname\": \"ab\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"https://%C2%AD/\", \"failure\": true },\n{ \"input\": \"https://xn--/\", \"failure\": true },\n{ \"input\": \"data://example.com:8080/pathname?search#hash\", \"href\": \"data://example.com:8080/pathname?search#hash\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com:8080\", \"hostname\": \"example.com\", \"port\": \"8080\", \"pathname\": \"/pathname\", \"search\": \"?search\", \"hash\": \"#hash\" },\n{ \"input\": \"data:///test\", \"href\": \"data:///test\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data://test/a/../b\", \"href\": \"data://test/b\", \"origin\": \"null\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/b\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"data://:443\", \"failure\": true },\n{ \"input\": \"javascript://example.com:8080/pathname?search#hash\", \"href\": \"javascript://example.com:8080/pathname?search#hash\", \"origin\": \"null\", \"protocol\": \"javascript:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com:8080\", \"hostname\": \"example.com\", \"port\": \"8080\", \"pathname\": \"/pathname\", \"search\": \"?search\", \"hash\": \"#hash\" },\n{ \"input\": \"javascript:///test\", \"href\": \"javascript:///test\", \"origin\": \"null\", \"protocol\": \"javascript:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"javascript://test/a/../b\", \"href\": \"javascript://test/b\", \"origin\": \"null\", \"protocol\": \"javascript:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/b\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"javascript://:443\", \"failure\": true },\n{ \"input\": \"mailto://example.com:8080/pathname?search#hash\", \"href\": \"mailto://example.com:8080/pathname?search#hash\", \"origin\": \"null\", \"protocol\": \"mailto:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com:8080\", \"hostname\": \"example.com\", \"port\": \"8080\", \"pathname\": \"/pathname\", \"search\": \"?search\", \"hash\": \"#hash\" },\n{ \"input\": \"mailto:///test\", \"href\": \"mailto:///test\", \"origin\": \"null\", \"protocol\": \"mailto:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"mailto://test/a/../b\", \"href\": \"mailto://test/b\", \"origin\": \"null\", \"protocol\": \"mailto:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/b\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"mailto://:443\", \"failure\": true },\n{ \"input\": \"intent://example.com:8080/pathname?search#hash\", \"href\": \"intent://example.com:8080/pathname?search#hash\", \"origin\": \"null\", \"protocol\": \"intent:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com:8080\", \"hostname\": \"example.com\", \"port\": \"8080\", \"pathname\": \"/pathname\", \"search\": \"?search\", \"hash\": \"#hash\" },\n{ \"input\": \"intent:///test\", \"href\": \"intent:///test\", \"origin\": \"null\", \"protocol\": \"intent:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"intent://test/a/../b\", \"href\": \"intent://test/b\", \"origin\": \"null\", \"protocol\": \"intent:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/b\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"intent://:443\", \"failure\": true },\n{ \"input\": \"urn://example.com:8080/pathname?search#hash\", \"href\": \"urn://example.com:8080/pathname?search#hash\", \"origin\": \"null\", \"protocol\": \"urn:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com:8080\", \"hostname\": \"example.com\", \"port\": \"8080\", \"pathname\": \"/pathname\", \"search\": \"?search\", \"hash\": \"#hash\" },\n{ \"input\": \"urn:///test\", \"href\": \"urn:///test\", \"origin\": \"null\", \"protocol\": \"urn:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"urn://test/a/../b\", \"href\": \"urn://test/b\", \"origin\": \"null\", \"protocol\": \"urn:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/b\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"urn://:443\", \"failure\": true },\n{ \"input\": \"turn://example.com:8080/pathname?search#hash\", \"href\": \"turn://example.com:8080/pathname?search#hash\", \"origin\": \"null\", \"protocol\": \"turn:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com:8080\", \"hostname\": \"example.com\", \"port\": \"8080\", \"pathname\": \"/pathname\", \"search\": \"?search\", \"hash\": \"#hash\" },\n{ \"input\": \"turn:///test\", \"href\": \"turn:///test\", \"origin\": \"null\", \"protocol\": \"turn:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"turn://test/a/../b\", \"href\": \"turn://test/b\", \"origin\": \"null\", \"protocol\": \"turn:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/b\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"turn://:443\", \"failure\": true },\n{ \"input\": \"stun://example.com:8080/pathname?search#hash\", \"href\": \"stun://example.com:8080/pathname?search#hash\", \"origin\": \"null\", \"protocol\": \"stun:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com:8080\", \"hostname\": \"example.com\", \"port\": \"8080\", \"pathname\": \"/pathname\", \"search\": \"?search\", \"hash\": \"#hash\" },\n{ \"input\": \"stun:///test\", \"href\": \"stun:///test\", \"origin\": \"null\", \"protocol\": \"stun:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/test\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"stun://test/a/../b\", \"href\": \"stun://test/b\", \"origin\": \"null\", \"protocol\": \"stun:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/b\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"stun://:443\", \"failure\": true },\n{ \"input\": \"w://x:0\", \"href\": \"w://x:0\", \"origin\": \"null\", \"protocol\": \"w:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"west://x:0\", \"href\": \"west://x:0\", \"origin\": \"null\", \"protocol\": \"west:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"android://x:0/a\", \"href\": \"android://x:0/a\", \"origin\": \"null\", \"protocol\": \"android:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"/a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"drivefs://x:0/a\", \"href\": \"drivefs://x:0/a\", \"origin\": \"null\", \"protocol\": \"drivefs:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"/a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"chromeos-steam://x:0/a\", \"href\": \"chromeos-steam://x:0/a\", \"origin\": \"null\", \"protocol\": \"chromeos-steam:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"/a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"steam://x:0/a\", \"href\": \"steam://x:0/a\", \"origin\": \"null\", \"protocol\": \"steam:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"/a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"materialized-view://x:0/a\", \"href\": \"materialized-view://x:0/a\", \"origin\": \"null\", \"protocol\": \"materialized-view:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"/a\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"android-app://x:0\", \"href\": \"android-app://x:0\", \"origin\": \"null\", \"protocol\": \"android-app:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"chrome-distiller://x:0\", \"href\": \"chrome-distiller://x:0\", \"origin\": \"null\", \"protocol\": \"chrome-distiller:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"chrome-extension://x:0\", \"href\": \"chrome-extension://x:0\", \"origin\": \"null\", \"protocol\": \"chrome-extension:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"chrome-native://x:0\", \"href\": \"chrome-native://x:0\", \"origin\": \"null\", \"protocol\": \"chrome-native:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"chrome-resource://x:0\", \"href\": \"chrome-resource://x:0\", \"origin\": \"null\", \"protocol\": \"chrome-resource:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"chrome-search://x:0\", \"href\": \"chrome-search://x:0\", \"origin\": \"null\", \"protocol\": \"chrome-search:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"fuchsia-dir://x:0\", \"href\": \"fuchsia-dir://x:0\", \"origin\": \"null\", \"protocol\": \"fuchsia-dir:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"isolated-app://x:0\", \"href\": \"isolated-app://x:0\", \"origin\": \"null\", \"protocol\": \"isolated-app:\", \"username\": \"\", \"password\": \"\", \"host\": \"x:0\", \"hostname\": \"x\", \"port\": \"0\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///test\", \"base\": \"http://example.org/\", \"href\": \"http://test/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"test\", \"hostname\": \"test\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///example.org/path\", \"base\": \"http://example.org/\", \"href\": \"http://example.org/path\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///example.org/../path\", \"base\": \"http://example.org/\", \"href\": \"http://example.org/path\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///example.org/../../\", \"base\": \"http://example.org/\", \"href\": \"http://example.org/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///example.org/../path/../../\", \"base\": \"http://example.org/\", \"href\": \"http://example.org/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///example.org/../path/../../path\", \"base\": \"http://example.org/\", \"href\": \"http://example.org/path\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/path\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"///abcdef/../\", \"base\": \"file:///\", \"href\": \"file:///\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" },\n{ \"input\": \"//a/../\", \"base\": \"file:///\", \"href\": \"file://a/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"a\", \"hostname\": \"a\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" }\n]"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/resources/org/wiremock/url/whatwg/urltestdata.json",
    "content": "[\n  \"See ../README.md for a description of the format.\",\n  {\n    \"input\": \"http://example\\t.\\norg\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://user:pass@foo:21/bar;par?b#c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://user:pass@foo:21/bar;par?b#c\",\n    \"origin\": \"http://foo:21\",\n    \"protocol\": \"http:\",\n    \"username\": \"user\",\n    \"password\": \"pass\",\n    \"host\": \"foo:21\",\n    \"hostname\": \"foo\",\n    \"port\": \"21\",\n    \"pathname\": \"/bar;par\",\n    \"search\": \"?b\",\n    \"hash\": \"#c\"\n  },\n  {\n    \"input\": \"https://test:@test\",\n    \"base\": null,\n    \"href\": \"https://test@test/\",\n    \"origin\": \"https://test\",\n    \"protocol\": \"https:\",\n    \"username\": \"test\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https://:@test\",\n    \"base\": null,\n    \"href\": \"https://test/\",\n    \"origin\": \"https://test\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special://test:@test/x\",\n    \"base\": null,\n    \"href\": \"non-special://test@test/x\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"test\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/x\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special://:@test/x\",\n    \"base\": null,\n    \"href\": \"non-special://test/x\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/x\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:foo.com\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/foo.com\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/foo.com\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\\t   :foo.com   \\n\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:foo.com\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:foo.com\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \" foo.com  \",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/foo.com\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/foo.com\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"a:\\t foo.com\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"a: foo.com\",\n    \"origin\": \"null\",\n    \"protocol\": \"a:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \" foo.com\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://f:21/ b ? d # e \",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://f:21/%20b%20?%20d%20#%20e\",\n    \"origin\": \"http://f:21\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"f:21\",\n    \"hostname\": \"f\",\n    \"port\": \"21\",\n    \"pathname\": \"/%20b%20\",\n    \"search\": \"?%20d%20\",\n    \"hash\": \"#%20e\"\n  },\n  {\n    \"input\": \"lolscheme:x x#x x\",\n    \"base\": null,\n    \"href\": \"lolscheme:x x#x%20x\",\n    \"protocol\": \"lolscheme:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"x x\",\n    \"search\": \"\",\n    \"hash\": \"#x%20x\"\n  },\n  {\n    \"input\": \"http://f:/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://f/c\",\n    \"origin\": \"http://f\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"f\",\n    \"hostname\": \"f\",\n    \"port\": \"\",\n    \"pathname\": \"/c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://f:0/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://f:0/c\",\n    \"origin\": \"http://f:0\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"f:0\",\n    \"hostname\": \"f\",\n    \"port\": \"0\",\n    \"pathname\": \"/c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://f:00000000000000/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://f:0/c\",\n    \"origin\": \"http://f:0\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"f:0\",\n    \"hostname\": \"f\",\n    \"port\": \"0\",\n    \"pathname\": \"/c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://f:00000000000000000000080/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://f/c\",\n    \"origin\": \"http://f\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"f\",\n    \"hostname\": \"f\",\n    \"port\": \"\",\n    \"pathname\": \"/c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://f:b/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://f: /c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://f:\\n/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://f/c\",\n    \"origin\": \"http://f\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"f\",\n    \"hostname\": \"f\",\n    \"port\": \"\",\n    \"pathname\": \"/c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://f:fifty-two/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://f:999999/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"non-special://f:999999/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://f: 21 / b ? d # e \",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"  \\t\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \":foo.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:foo.com/\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:foo.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \":foo.com\\\\\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:foo.com/\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:foo.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \":\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \":a\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:a\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \":/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:/\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \":\\\\\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:/\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \":#\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:#\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"#\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar#\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"#/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar#/\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"#/\"\n  },\n  {\n    \"input\": \"#\\\\\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar#\\\\\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"#\\\\\"\n  },\n  {\n    \"input\": \"#;?\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar#;?\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"#;?\"\n  },\n  {\n    \"input\": \"?\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar?\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \":23\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:23\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:23\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/:23\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/:23\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/:23\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\\\\x\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/x\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/x\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\\\\\\\\x\\\\hello\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://x/hello\",\n    \"origin\": \"http://x\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x\",\n    \"hostname\": \"x\",\n    \"port\": \"\",\n    \"pathname\": \"/hello\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"::\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/::\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/::\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"::23\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/::23\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/::23\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"foo://\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"foo://\",\n    \"origin\": \"null\",\n    \"protocol\": \"foo:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://a:b@c:29/d\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://a:b@c:29/d\",\n    \"origin\": \"http://c:29\",\n    \"protocol\": \"http:\",\n    \"username\": \"a\",\n    \"password\": \"b\",\n    \"host\": \"c:29\",\n    \"hostname\": \"c\",\n    \"port\": \"29\",\n    \"pathname\": \"/d\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http::@c:29\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/:@c:29\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/:@c:29\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://&a:foo(b]c@d:2/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://&a:foo(b%5Dc@d:2/\",\n    \"origin\": \"http://d:2\",\n    \"protocol\": \"http:\",\n    \"username\": \"&a\",\n    \"password\": \"foo(b%5Dc\",\n    \"host\": \"d:2\",\n    \"hostname\": \"d\",\n    \"port\": \"2\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://::@c@d:2\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://:%3A%40c@d:2/\",\n    \"origin\": \"http://d:2\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"%3A%40c\",\n    \"host\": \"d:2\",\n    \"hostname\": \"d\",\n    \"port\": \"2\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://foo.com:b@d/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://foo.com:b@d/\",\n    \"origin\": \"http://d\",\n    \"protocol\": \"http:\",\n    \"username\": \"foo.com\",\n    \"password\": \"b\",\n    \"host\": \"d\",\n    \"hostname\": \"d\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://foo.com/\\\\@\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://foo.com//@\",\n    \"origin\": \"http://foo.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo.com\",\n    \"hostname\": \"foo.com\",\n    \"port\": \"\",\n    \"pathname\": \"//@\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:\\\\\\\\foo.com\\\\\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://foo.com/\",\n    \"origin\": \"http://foo.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo.com\",\n    \"hostname\": \"foo.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://a/b:c/d@foo.com/\",\n    \"origin\": \"http://a\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"a\",\n    \"hostname\": \"a\",\n    \"port\": \"\",\n    \"pathname\": \"/b:c/d@foo.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://a:b@c\\\\\",\n    \"base\": null,\n    \"href\": \"http://a:b@c/\",\n    \"origin\": \"http://c\",\n    \"protocol\": \"http:\",\n    \"username\": \"a\",\n    \"password\": \"b\",\n    \"host\": \"c\",\n    \"hostname\": \"c\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ws://a@b\\\\c\",\n    \"base\": null,\n    \"href\": \"ws://a@b/c\",\n    \"origin\": \"ws://b\",\n    \"protocol\": \"ws:\",\n    \"username\": \"a\",\n    \"password\": \"\",\n    \"host\": \"b\",\n    \"hostname\": \"b\",\n    \"port\": \"\",\n    \"pathname\": \"/c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"foo:/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"foo:/\",\n    \"origin\": \"null\",\n    \"protocol\": \"foo:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"foo:/bar.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"foo:/bar.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"foo:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/bar.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"foo://///////\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"foo://///////\",\n    \"origin\": \"null\",\n    \"protocol\": \"foo:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"///////\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"foo://///////bar.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"foo://///////bar.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"foo:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"///////bar.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"foo:////://///\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"foo:////://///\",\n    \"origin\": \"null\",\n    \"protocol\": \"foo:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//://///\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"c:/foo\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"c:/foo\",\n    \"origin\": \"null\",\n    \"protocol\": \"c:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//foo/bar\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://foo/bar\",\n    \"origin\": \"http://foo\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"port\": \"\",\n    \"pathname\": \"/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://foo/path;a??e#f#g\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://foo/path;a??e#f#g\",\n    \"origin\": \"http://foo\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"port\": \"\",\n    \"pathname\": \"/path;a\",\n    \"search\": \"??e\",\n    \"hash\": \"#f#g\"\n  },\n  {\n    \"input\": \"http://foo/abcd?efgh?ijkl\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://foo/abcd?efgh?ijkl\",\n    \"origin\": \"http://foo\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"port\": \"\",\n    \"pathname\": \"/abcd\",\n    \"search\": \"?efgh?ijkl\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://foo/abcd#foo?bar\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://foo/abcd#foo?bar\",\n    \"origin\": \"http://foo\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"port\": \"\",\n    \"pathname\": \"/abcd\",\n    \"search\": \"\",\n    \"hash\": \"#foo?bar\"\n  },\n  {\n    \"input\": \"[61:24:74]:98\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/[61:24:74]:98\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/[61:24:74]:98\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:[61:27]/:foo\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/[61:27]/:foo\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/[61:27]/:foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://[1::2]:3:4\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://2001::1\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://2001::1]\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://2001::1]:80\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[2001::1]\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://[2001::1]/\",\n    \"origin\": \"http://[2001::1]\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[2001::1]\",\n    \"hostname\": \"[2001::1]\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://[::127.0.0.1]\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://[::7f00:1]/\",\n    \"origin\": \"http://[::7f00:1]\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[::7f00:1]\",\n    \"hostname\": \"[::7f00:1]\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://[::127.0.0.1.]\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[0:0:0:0:0:0:13.1.68.3]\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://[::d01:4403]/\",\n    \"origin\": \"http://[::d01:4403]\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[::d01:4403]\",\n    \"hostname\": \"[::d01:4403]\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://[2001::1]:80\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://[2001::1]/\",\n    \"origin\": \"http://[2001::1]\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[2001::1]\",\n    \"hostname\": \"[2001::1]\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/example.com/\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ftp:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"ftp://example.com/\",\n    \"origin\": \"ftp://example.com\",\n    \"protocol\": \"ftp:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"https://example.com/\",\n    \"origin\": \"https://example.com\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"madeupscheme:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"madeupscheme:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"madeupscheme:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"file:///example.com/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://example:1/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"file://example:test/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"file://example%/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"file://[example]/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"ftps:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"ftps:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"ftps:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"gopher:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"gopher:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"gopher:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ws:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"ws://example.com/\",\n    \"origin\": \"ws://example.com\",\n    \"protocol\": \"ws:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"wss:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"wss://example.com/\",\n    \"origin\": \"wss://example.com\",\n    \"protocol\": \"wss:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"data:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"data:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"javascript:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"javascript:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"javascript:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"mailto:/example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"mailto:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"mailto:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/example.com/\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ftp:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"ftp://example.com/\",\n    \"origin\": \"ftp://example.com\",\n    \"protocol\": \"ftp:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"https://example.com/\",\n    \"origin\": \"https://example.com\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"madeupscheme:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"madeupscheme:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"madeupscheme:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ftps:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"ftps:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"ftps:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"gopher:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"gopher:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"gopher:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ws:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"ws://example.com/\",\n    \"origin\": \"ws://example.com\",\n    \"protocol\": \"ws:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"wss:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"wss://example.com/\",\n    \"origin\": \"wss://example.com\",\n    \"protocol\": \"wss:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"data:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"data:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"javascript:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"javascript:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"javascript:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"mailto:example.com/\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"mailto:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"mailto:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/a/b/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/a/b/c\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/a/b/c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/a/ /c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/a/%20/c\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/a/%20/c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/a%2fc\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/a%2fc\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/a%2fc\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/a/%2f/c\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/a/%2f/c\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/a/%2f/c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"#β\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar#%CE%B2\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"#%CE%B2\"\n  },\n  {\n    \"input\": \"data:text/html,test#test\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"data:text/html,test#test\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"text/html,test\",\n    \"search\": \"\",\n    \"hash\": \"#test\"\n  },\n  {\n    \"input\": \"tel:1234567890\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"tel:1234567890\",\n    \"origin\": \"null\",\n    \"protocol\": \"tel:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"1234567890\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Based on https://felixfbecker.github.io/whatwg-url-custom-host-repro/\",\n  {\n    \"input\": \"ssh://example.com/foo/bar.git\",\n    \"base\": \"http://example.org/\",\n    \"href\": \"ssh://example.com/foo/bar.git\",\n    \"origin\": \"null\",\n    \"protocol\": \"ssh:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar.git\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html\",\n  {\n    \"input\": \"file:c:\\\\foo\\\\bar.html\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///c:/foo/bar.html\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/c:/foo/bar.html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"  File:c|////foo\\\\bar.html\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///c:////foo/bar.html\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/c:////foo/bar.html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"C|/foo/bar\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///C:/foo/bar\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/C|\\\\foo\\\\bar\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///C:/foo/bar\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//C|/foo/bar\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///C:/foo/bar\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//server/file\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file://server/file\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"server\",\n    \"hostname\": \"server\",\n    \"port\": \"\",\n    \"pathname\": \"/file\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\\\\\\\\server\\\\file\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file://server/file\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"server\",\n    \"hostname\": \"server\",\n    \"port\": \"\",\n    \"pathname\": \"/file\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/\\\\server/file\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file://server/file\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"server\",\n    \"hostname\": \"server\",\n    \"port\": \"\",\n    \"pathname\": \"/file\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///foo/bar.txt\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///foo/bar.txt\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar.txt\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///home/me\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///home/me\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/home/me\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///test\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///test\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://test\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file://test/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://localhost\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://localhost/\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://localhost/test\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///test\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"test\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///tmp/mock/test\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/tmp/mock/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:test\",\n    \"base\": \"file:///tmp/mock/path\",\n    \"href\": \"file:///tmp/mock/test\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/tmp/mock/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///w|m\",\n    \"base\": null,\n    \"href\": \"file:///w|m\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/w|m\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///w||m\",\n    \"base\": null,\n    \"href\": \"file:///w||m\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/w||m\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///w|/m\",\n    \"base\": null,\n    \"href\": \"file:///w:/m\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/w:/m\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:C|/m/\",\n    \"base\": null,\n    \"href\": \"file:///C:/m/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/m/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:C||/m/\",\n    \"base\": null,\n    \"href\": \"file:///C||/m/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C||/m/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js\",\n  {\n    \"input\": \"http://example.com/././foo\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/./.foo\",\n    \"base\": null,\n    \"href\": \"http://example.com/.foo\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/.foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/.\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/./\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/bar/..\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/bar/../\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/..bar\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/..bar\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/..bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/bar/../ton\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/ton\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/ton\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/bar/../ton/../../a\",\n    \"base\": null,\n    \"href\": \"http://example.com/a\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/../../..\",\n    \"base\": null,\n    \"href\": \"http://example.com/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/../../../ton\",\n    \"base\": null,\n    \"href\": \"http://example.com/ton\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/ton\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/%2e\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/%2e%2\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/%2e%2\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/%2e%2\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar\",\n    \"base\": null,\n    \"href\": \"http://example.com/%2e.bar\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/%2e.bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com////../..\",\n    \"base\": null,\n    \"href\": \"http://example.com//\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/bar//../..\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo/bar//..\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo/bar/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/%20foo\",\n    \"base\": null,\n    \"href\": \"http://example.com/%20foo\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/%20foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo%\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo%\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo%\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo%2\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo%2\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo%2\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo%2zbar\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo%2zbar\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo%2zbar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo%2Â©zbar\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo%2%C3%82%C2%A9zbar\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo%2%C3%82%C2%A9zbar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo%41%7a\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo%41%7a\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo%41%7a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo\\t\\u0091%91\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo%C2%91%91\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo%C2%91%91\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo%00%51\",\n    \"base\": null,\n    \"href\": \"http://example.com/foo%00%51\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo%00%51\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/(%28:%3A%29)\",\n    \"base\": null,\n    \"href\": \"http://example.com/(%28:%3A%29)\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/(%28:%3A%29)\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/%3A%3a%3C%3c\",\n    \"base\": null,\n    \"href\": \"http://example.com/%3A%3a%3C%3c\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/%3A%3a%3C%3c\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/foo\\tbar\",\n    \"base\": null,\n    \"href\": \"http://example.com/foobar\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foobar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com\\\\\\\\foo\\\\\\\\bar\",\n    \"base\": null,\n    \"href\": \"http://example.com//foo//bar\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"//foo//bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd\",\n    \"base\": null,\n    \"href\": \"http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/%7Ffp3%3Eju%3Dduvgw%3Dd\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/@asdf%40\",\n    \"base\": null,\n    \"href\": \"http://example.com/@asdf%40\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/@asdf%40\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/你好你好\",\n    \"base\": null,\n    \"href\": \"http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/‥/foo\",\n    \"base\": null,\n    \"href\": \"http://example.com/%E2%80%A5/foo\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/%E2%80%A5/foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/﻿/foo\",\n    \"base\": null,\n    \"href\": \"http://example.com/%EF%BB%BF/foo\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/%EF%BB%BF/foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.com/‮/foo/‭/bar\",\n    \"base\": null,\n    \"href\": \"http://example.com/%E2%80%AE/foo/%E2%80%AD/bar\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/%E2%80%AE/foo/%E2%80%AD/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js\",\n  {\n    \"input\": \"http://www.google.com/foo?bar=baz#\",\n    \"base\": null,\n    \"href\": \"http://www.google.com/foo?bar=baz#\",\n    \"origin\": \"http://www.google.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.google.com\",\n    \"hostname\": \"www.google.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo\",\n    \"search\": \"?bar=baz\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://www.google.com/foo?bar=baz# »\",\n    \"base\": null,\n    \"href\": \"http://www.google.com/foo?bar=baz#%20%C2%BB\",\n    \"origin\": \"http://www.google.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.google.com\",\n    \"hostname\": \"www.google.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo\",\n    \"search\": \"?bar=baz\",\n    \"hash\": \"#%20%C2%BB\"\n  },\n  {\n    \"input\": \"data:test# »\",\n    \"base\": null,\n    \"href\": \"data:test#%20%C2%BB\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"test\",\n    \"search\": \"\",\n    \"hash\": \"#%20%C2%BB\"\n  },\n  {\n    \"input\": \"http://www.google.com\",\n    \"base\": null,\n    \"href\": \"http://www.google.com/\",\n    \"origin\": \"http://www.google.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.google.com\",\n    \"hostname\": \"www.google.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://192.0x00A80001\",\n    \"base\": null,\n    \"href\": \"http://192.168.0.1/\",\n    \"origin\": \"http://192.168.0.1\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"192.168.0.1\",\n    \"hostname\": \"192.168.0.1\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://www/foo%2Ehtml\",\n    \"base\": null,\n    \"href\": \"http://www/foo%2Ehtml\",\n    \"origin\": \"http://www\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www\",\n    \"hostname\": \"www\",\n    \"port\": \"\",\n    \"pathname\": \"/foo%2Ehtml\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://www/foo/%2E/html\",\n    \"base\": null,\n    \"href\": \"http://www/foo/html\",\n    \"origin\": \"http://www\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www\",\n    \"hostname\": \"www\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://user:pass@/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://%25DOMAIN:foobar@foodomain.com/\",\n    \"base\": null,\n    \"href\": \"http://%25DOMAIN:foobar@foodomain.com/\",\n    \"origin\": \"http://foodomain.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"%25DOMAIN\",\n    \"password\": \"foobar\",\n    \"host\": \"foodomain.com\",\n    \"hostname\": \"foodomain.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:\\\\\\\\www.google.com\\\\foo\",\n    \"base\": null,\n    \"href\": \"http://www.google.com/foo\",\n    \"origin\": \"http://www.google.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.google.com\",\n    \"hostname\": \"www.google.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://foo:80/\",\n    \"base\": null,\n    \"href\": \"http://foo/\",\n    \"origin\": \"http://foo\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://foo:81/\",\n    \"base\": null,\n    \"href\": \"http://foo:81/\",\n    \"origin\": \"http://foo:81\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:81\",\n    \"hostname\": \"foo\",\n    \"port\": \"81\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"httpa://foo:80/\",\n    \"base\": null,\n    \"href\": \"httpa://foo:80/\",\n    \"origin\": \"null\",\n    \"protocol\": \"httpa:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:80\",\n    \"hostname\": \"foo\",\n    \"port\": \"80\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://foo:-80/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://foo:443/\",\n    \"base\": null,\n    \"href\": \"https://foo/\",\n    \"origin\": \"https://foo\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https://foo:80/\",\n    \"base\": null,\n    \"href\": \"https://foo:80/\",\n    \"origin\": \"https://foo:80\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:80\",\n    \"hostname\": \"foo\",\n    \"port\": \"80\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ftp://foo:21/\",\n    \"base\": null,\n    \"href\": \"ftp://foo/\",\n    \"origin\": \"ftp://foo\",\n    \"protocol\": \"ftp:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ftp://foo:80/\",\n    \"base\": null,\n    \"href\": \"ftp://foo:80/\",\n    \"origin\": \"ftp://foo:80\",\n    \"protocol\": \"ftp:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:80\",\n    \"hostname\": \"foo\",\n    \"port\": \"80\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"gopher://foo:70/\",\n    \"base\": null,\n    \"href\": \"gopher://foo:70/\",\n    \"origin\": \"null\",\n    \"protocol\": \"gopher:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:70\",\n    \"hostname\": \"foo\",\n    \"port\": \"70\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"gopher://foo:443/\",\n    \"base\": null,\n    \"href\": \"gopher://foo:443/\",\n    \"origin\": \"null\",\n    \"protocol\": \"gopher:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:443\",\n    \"hostname\": \"foo\",\n    \"port\": \"443\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ws://foo:80/\",\n    \"base\": null,\n    \"href\": \"ws://foo/\",\n    \"origin\": \"ws://foo\",\n    \"protocol\": \"ws:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ws://foo:81/\",\n    \"base\": null,\n    \"href\": \"ws://foo:81/\",\n    \"origin\": \"ws://foo:81\",\n    \"protocol\": \"ws:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:81\",\n    \"hostname\": \"foo\",\n    \"port\": \"81\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ws://foo:443/\",\n    \"base\": null,\n    \"href\": \"ws://foo:443/\",\n    \"origin\": \"ws://foo:443\",\n    \"protocol\": \"ws:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:443\",\n    \"hostname\": \"foo\",\n    \"port\": \"443\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ws://foo:815/\",\n    \"base\": null,\n    \"href\": \"ws://foo:815/\",\n    \"origin\": \"ws://foo:815\",\n    \"protocol\": \"ws:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:815\",\n    \"hostname\": \"foo\",\n    \"port\": \"815\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"wss://foo:80/\",\n    \"base\": null,\n    \"href\": \"wss://foo:80/\",\n    \"origin\": \"wss://foo:80\",\n    \"protocol\": \"wss:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:80\",\n    \"hostname\": \"foo\",\n    \"port\": \"80\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"wss://foo:81/\",\n    \"base\": null,\n    \"href\": \"wss://foo:81/\",\n    \"origin\": \"wss://foo:81\",\n    \"protocol\": \"wss:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:81\",\n    \"hostname\": \"foo\",\n    \"port\": \"81\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"wss://foo:443/\",\n    \"base\": null,\n    \"href\": \"wss://foo/\",\n    \"origin\": \"wss://foo\",\n    \"protocol\": \"wss:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"wss://foo:815/\",\n    \"base\": null,\n    \"href\": \"wss://foo:815/\",\n    \"origin\": \"wss://foo:815\",\n    \"protocol\": \"wss:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo:815\",\n    \"hostname\": \"foo\",\n    \"port\": \"815\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:/example.com/\",\n    \"base\": null,\n    \"href\": \"http://example.com/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ftp:/example.com/\",\n    \"base\": null,\n    \"href\": \"ftp://example.com/\",\n    \"origin\": \"ftp://example.com\",\n    \"protocol\": \"ftp:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https:/example.com/\",\n    \"base\": null,\n    \"href\": \"https://example.com/\",\n    \"origin\": \"https://example.com\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"madeupscheme:/example.com/\",\n    \"base\": null,\n    \"href\": \"madeupscheme:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"madeupscheme:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:/example.com/\",\n    \"base\": null,\n    \"href\": \"file:///example.com/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ftps:/example.com/\",\n    \"base\": null,\n    \"href\": \"ftps:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"ftps:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"gopher:/example.com/\",\n    \"base\": null,\n    \"href\": \"gopher:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"gopher:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ws:/example.com/\",\n    \"base\": null,\n    \"href\": \"ws://example.com/\",\n    \"origin\": \"ws://example.com\",\n    \"protocol\": \"ws:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"wss:/example.com/\",\n    \"base\": null,\n    \"href\": \"wss://example.com/\",\n    \"origin\": \"wss://example.com\",\n    \"protocol\": \"wss:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"data:/example.com/\",\n    \"base\": null,\n    \"href\": \"data:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"javascript:/example.com/\",\n    \"base\": null,\n    \"href\": \"javascript:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"javascript:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"mailto:/example.com/\",\n    \"base\": null,\n    \"href\": \"mailto:/example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"mailto:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:example.com/\",\n    \"base\": null,\n    \"href\": \"http://example.com/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ftp:example.com/\",\n    \"base\": null,\n    \"href\": \"ftp://example.com/\",\n    \"origin\": \"ftp://example.com\",\n    \"protocol\": \"ftp:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https:example.com/\",\n    \"base\": null,\n    \"href\": \"https://example.com/\",\n    \"origin\": \"https://example.com\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"madeupscheme:example.com/\",\n    \"base\": null,\n    \"href\": \"madeupscheme:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"madeupscheme:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ftps:example.com/\",\n    \"base\": null,\n    \"href\": \"ftps:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"ftps:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"gopher:example.com/\",\n    \"base\": null,\n    \"href\": \"gopher:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"gopher:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ws:example.com/\",\n    \"base\": null,\n    \"href\": \"ws://example.com/\",\n    \"origin\": \"ws://example.com\",\n    \"protocol\": \"ws:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"wss:example.com/\",\n    \"base\": null,\n    \"href\": \"wss://example.com/\",\n    \"origin\": \"wss://example.com\",\n    \"protocol\": \"wss:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"data:example.com/\",\n    \"base\": null,\n    \"href\": \"data:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"javascript:example.com/\",\n    \"base\": null,\n    \"href\": \"javascript:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"javascript:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"mailto:example.com/\",\n    \"base\": null,\n    \"href\": \"mailto:example.com/\",\n    \"origin\": \"null\",\n    \"protocol\": \"mailto:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"example.com/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https://example.com/aaa/bbb/%2e%2e?query\",\n    \"base\": null,\n    \"href\": \"https://example.com/aaa/?query\",\n    \"origin\": \"https://example.com\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/aaa/\",\n    \"search\": \"?query\",\n    \"hash\": \"\"\n  },\n  \"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html\",\n  {\n    \"input\": \"http:@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:/@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:a:b@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://a:b@www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"a\",\n    \"password\": \"b\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:/a:b@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://a:b@www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"a\",\n    \"password\": \"b\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://a:b@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://a:b@www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"a\",\n    \"password\": \"b\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://@pple.com\",\n    \"base\": null,\n    \"href\": \"http://pple.com/\",\n    \"origin\": \"http://pple.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"pple.com\",\n    \"hostname\": \"pple.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http::b@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://:b@www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"b\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:/:b@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://:b@www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"b\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://:b@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://:b@www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"b\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:/:@/www.example.com\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"http://user@/www.example.com\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http:@/www.example.com\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"http:/@/www.example.com\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"http://@/www.example.com\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https:@/www.example.com\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"http:a:b@/www.example.com\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"http:/a:b@/www.example.com\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"http://a:b@/www.example.com\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http::@/www.example.com\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"http:a:@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://a@www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"a\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:/a:@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://a@www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"a\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://a:@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://a@www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"a\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://www.@pple.com\",\n    \"base\": null,\n    \"href\": \"http://www.@pple.com/\",\n    \"origin\": \"http://pple.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"www.\",\n    \"password\": \"\",\n    \"host\": \"pple.com\",\n    \"hostname\": \"pple.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:@:www.example.com\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"http:/@:www.example.com\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"http://@:www.example.com\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://:@www.example.com\",\n    \"base\": null,\n    \"href\": \"http://www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Others\",\n  {\n    \"input\": \"/\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/test.txt\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/test.txt\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/test.txt\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \".\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"..\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"test.txt\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/test.txt\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/test.txt\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"./test.txt\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/test.txt\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/test.txt\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"../test.txt\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/test.txt\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/test.txt\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"../aaa/test.txt\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/aaa/test.txt\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/aaa/test.txt\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"../../test.txt\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/test.txt\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/test.txt\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"中/test.txt\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example.com/%E4%B8%AD/test.txt\",\n    \"origin\": \"http://www.example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/%E4%B8%AD/test.txt\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://www.example2.com\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example2.com/\",\n    \"origin\": \"http://www.example2.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example2.com\",\n    \"hostname\": \"www.example2.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//www.example2.com\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"http://www.example2.com/\",\n    \"origin\": \"http://www.example2.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.example2.com\",\n    \"hostname\": \"www.example2.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:...\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"file:///...\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/...\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:..\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:a\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"file:///a\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:.\",\n    \"base\": null,\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:.\",\n    \"base\": \"http://www.example.com/test\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html\",\n  \"Basic canonicalization, uppercase should be converted to lowercase\",\n  {\n    \"input\": \"http://ExAmPlE.CoM\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://example.com/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example example.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://Goo%20 goo%7C|.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[:]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"U+3000 is mapped to U+0020 (space) which is disallowed\",\n  {\n    \"input\": \"http://GOO\\u00a0\\u3000goo.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"Other types of space (no-break, zero-width, zero-width-no-break) are name-prepped away to nothing. U+200B, U+2060, and U+FEFF, are ignored\",\n  {\n    \"input\": \"http://GOO\\u200b\\u2060\\ufeffgoo.com\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://googoo.com/\",\n    \"origin\": \"http://googoo.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"googoo.com\",\n    \"hostname\": \"googoo.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Leading and trailing C0 control or space\",\n  {\n    \"input\": \"\\u0000\\u001b\\u0004\\u0012 http://example.com/\\u001f \\u000d \",\n    \"base\": null,\n    \"href\": \"http://example.com/\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special:opaque  \",\n    \"base\": null,\n    \"href\": \"non-special:opaque\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"opaque\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special:opaque  ?hi\",\n    \"base\": null,\n    \"href\": \"non-special:opaque %20?hi\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"opaque %20\",\n    \"search\": \"?hi\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special:opaque  #hi\",\n    \"base\": null,\n    \"href\": \"non-special:opaque %20#hi\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"opaque %20\",\n    \"search\": \"\",\n    \"hash\": \"#hi\"\n  },\n  {\n    \"input\": \"non-special:opaque  x?hi\",\n    \"base\": null,\n    \"href\": \"non-special:opaque  x?hi\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"opaque  x\",\n    \"search\": \"?hi\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special:opaque  x#hi\",\n    \"base\": null,\n    \"href\": \"non-special:opaque  x#hi\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"opaque  x\",\n    \"search\": \"\",\n    \"hash\": \"#hi\"\n  },\n  {\n    \"input\": \"non-special:opaque \\t\\t  \\t#hi\",\n    \"base\": null,\n    \"href\": \"non-special:opaque  %20#hi\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"opaque  %20\",\n    \"search\": \"\",\n    \"hash\": \"#hi\"\n  },\n  {\n    \"input\": \"non-special:opaque \\t\\t  #hi\",\n    \"base\": null,\n    \"href\": \"non-special:opaque  %20#hi\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"opaque  %20\",\n    \"search\": \"\",\n    \"hash\": \"#hi\"\n  },\n  {\n    \"input\": \"non-special:opaque\\t\\t  \\r #hi\",\n    \"base\": null,\n    \"href\": \"non-special:opaque  %20#hi\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"opaque  %20\",\n    \"search\": \"\",\n    \"hash\": \"#hi\"\n  },\n  \"Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)\",\n  {\n    \"input\": \"http://www.foo。bar.com\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://www.foo.bar.com/\",\n    \"origin\": \"http://www.foo.bar.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"www.foo.bar.com\",\n    \"hostname\": \"www.foo.bar.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0\",\n  {\n    \"input\": \"http://\\ufdd0zyx.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"This is the same as previous but escaped\",\n  {\n    \"input\": \"http://%ef%b7%90zyx.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"U+FFFD\",\n  {\n    \"input\": \"https://\\ufffd\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://%EF%BF%BD\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://x/\\ufffd?\\ufffd#\\ufffd\",\n    \"base\": null,\n    \"href\": \"https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD\",\n    \"origin\": \"https://x\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x\",\n    \"hostname\": \"x\",\n    \"port\": \"\",\n    \"pathname\": \"/%EF%BF%BD\",\n    \"search\": \"?%EF%BF%BD\",\n    \"hash\": \"#%EF%BF%BD\"\n  },\n  \"Domain is ASCII, but a label is invalid IDNA\",\n  {\n    \"input\": \"http://a.b.c.xn--pokxncvks\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://10.0.0.xn--pokxncvks\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"IDNA labels should be matched case-insensitively\",\n  {\n    \"input\": \"http://a.b.c.XN--pokxncvks\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a.b.c.Xn--pokxncvks\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://10.0.0.XN--pokxncvks\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://10.0.0.xN--pokxncvks\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.\",\n  {\n    \"input\": \"http://Ｇｏ.com\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://go.com/\",\n    \"origin\": \"http://go.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"go.com\",\n    \"hostname\": \"go.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257\",\n  {\n    \"input\": \"http://％４１.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://%ef%bc%85%ef%bc%94%ef%bc%91.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"...%00 in fullwidth should fail (also as escaped UTF-8 input)\",\n  {\n    \"input\": \"http://％００.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://%ef%bc%85%ef%bc%90%ef%bc%90.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN\",\n  {\n    \"input\": \"http://你好你好\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://xn--6qqa088eba/\",\n    \"origin\": \"http://xn--6qqa088eba\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"xn--6qqa088eba\",\n    \"hostname\": \"xn--6qqa088eba\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https://faß.ExAmPlE/\",\n    \"base\": null,\n    \"href\": \"https://xn--fa-hia.example/\",\n    \"origin\": \"https://xn--fa-hia.example\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"xn--fa-hia.example\",\n    \"hostname\": \"xn--fa-hia.example\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"sc://faß.ExAmPlE/\",\n    \"base\": null,\n    \"href\": \"sc://fa%C3%9F.ExAmPlE/\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"fa%C3%9F.ExAmPlE\",\n    \"hostname\": \"fa%C3%9F.ExAmPlE\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191\",\n  {\n    \"input\": \"http://%zz%66%a.com\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"If we get an invalid character that has been escaped.\",\n  {\n    \"input\": \"http://%25\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://hello%00\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"Escaped numbers should be treated like IP addresses if they are.\",\n  {\n    \"input\": \"http://%30%78%63%30%2e%30%32%35%30.01\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://192.168.0.1/\",\n    \"origin\": \"http://192.168.0.1\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"192.168.0.1\",\n    \"hostname\": \"192.168.0.1\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://%30%78%63%30%2e%30%32%35%30.01%2e\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://192.168.0.1/\",\n    \"origin\": \"http://192.168.0.1\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"192.168.0.1\",\n    \"hostname\": \"192.168.0.1\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://192.168.0.257\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"Invalid escaping in hosts causes failure\",\n  {\n    \"input\": \"http://%3g%78%63%30%2e%30%32%35%30%2E.01\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"A space in a host causes failure\",\n  {\n    \"input\": \"http://192.168.0.1 hello\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://x x:12\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"Fullwidth and escaped UTF-8 fullwidth should still be treated as IP\",\n  {\n    \"input\": \"http://０Ｘｃ０．０２５０．０１\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://192.168.0.1/\",\n    \"origin\": \"http://192.168.0.1\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"192.168.0.1\",\n    \"hostname\": \"192.168.0.1\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Domains with empty labels\",\n  {\n    \"input\": \"http://./\",\n    \"base\": null,\n    \"href\": \"http://./\",\n    \"origin\": \"http://.\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \".\",\n    \"hostname\": \".\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://../\",\n    \"base\": null,\n    \"href\": \"http://../\",\n    \"origin\": \"http://..\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"..\",\n    \"hostname\": \"..\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Non-special domains with empty labels\",\n  {\n    \"input\": \"h://.\",\n    \"base\": null,\n    \"href\": \"h://.\",\n    \"origin\": \"null\",\n    \"protocol\": \"h:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \".\",\n    \"hostname\": \".\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Broken IPv6\",\n  {\n    \"input\": \"http://[www.google.com]/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[google.com]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[::1.2.3.4x]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[::1.2.3.]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[::1.2.]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[::.1.2]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[::1.]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[::.1]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://[::%31]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://%5B::1]\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  \"Misc Unicode\",\n  {\n    \"input\": \"http://foo:💩@example.com/bar\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://foo:%F0%9F%92%A9@example.com/bar\",\n    \"origin\": \"http://example.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"foo\",\n    \"password\": \"%F0%9F%92%A9\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"port\": \"\",\n    \"pathname\": \"/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# resolving a fragment against any scheme succeeds\",\n  {\n    \"input\": \"#\",\n    \"base\": \"test:test\",\n    \"href\": \"test:test#\",\n    \"origin\": \"null\",\n    \"protocol\": \"test:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"#x\",\n    \"base\": \"mailto:x@x.com\",\n    \"href\": \"mailto:x@x.com#x\",\n    \"origin\": \"null\",\n    \"protocol\": \"mailto:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"x@x.com\",\n    \"search\": \"\",\n    \"hash\": \"#x\"\n  },\n  {\n    \"input\": \"#x\",\n    \"base\": \"data:,\",\n    \"href\": \"data:,#x\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \",\",\n    \"search\": \"\",\n    \"hash\": \"#x\"\n  },\n  {\n    \"input\": \"#x\",\n    \"base\": \"about:blank\",\n    \"href\": \"about:blank#x\",\n    \"origin\": \"null\",\n    \"protocol\": \"about:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"blank\",\n    \"search\": \"\",\n    \"hash\": \"#x\"\n  },\n  {\n    \"input\": \"#x:y\",\n    \"base\": \"about:blank\",\n    \"href\": \"about:blank#x:y\",\n    \"origin\": \"null\",\n    \"protocol\": \"about:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"blank\",\n    \"search\": \"\",\n    \"hash\": \"#x:y\"\n  },\n  {\n    \"input\": \"#\",\n    \"base\": \"test:test?test\",\n    \"href\": \"test:test?test#\",\n    \"origin\": \"null\",\n    \"protocol\": \"test:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"test\",\n    \"search\": \"?test\",\n    \"hash\": \"\"\n  },\n  \"# multiple @ in authority state\",\n  {\n    \"input\": \"https://@test@test@example:800/\",\n    \"base\": \"http://doesnotmatter/\",\n    \"href\": \"https://%40test%40test@example:800/\",\n    \"origin\": \"https://example:800\",\n    \"protocol\": \"https:\",\n    \"username\": \"%40test%40test\",\n    \"password\": \"\",\n    \"host\": \"example:800\",\n    \"hostname\": \"example\",\n    \"port\": \"800\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https://@@@example\",\n    \"base\": \"http://doesnotmatter/\",\n    \"href\": \"https://%40%40@example/\",\n    \"origin\": \"https://example\",\n    \"protocol\": \"https:\",\n    \"username\": \"%40%40\",\n    \"password\": \"\",\n    \"host\": \"example\",\n    \"hostname\": \"example\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"non-az-09 characters\",\n  {\n    \"input\": \"http://`{}:`{}@h/`{}?`{}\",\n    \"base\": \"http://doesnotmatter/\",\n    \"href\": \"http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}\",\n    \"origin\": \"http://h\",\n    \"protocol\": \"http:\",\n    \"username\": \"%60%7B%7D\",\n    \"password\": \"%60%7B%7D\",\n    \"host\": \"h\",\n    \"hostname\": \"h\",\n    \"port\": \"\",\n    \"pathname\": \"/%60%7B%7D\",\n    \"search\": \"?`{}\",\n    \"hash\": \"\"\n  },\n  \"byte is ' and url is special\",\n  {\n    \"input\": \"http://host/?'\",\n    \"base\": null,\n    \"href\": \"http://host/?%27\",\n    \"origin\": \"http://host\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"?%27\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"notspecial://host/?'\",\n    \"base\": null,\n    \"href\": \"notspecial://host/?'\",\n    \"origin\": \"null\",\n    \"protocol\": \"notspecial:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"?'\",\n    \"hash\": \"\"\n  },\n  \"# Credentials in base\",\n  {\n    \"input\": \"/some/path\",\n    \"base\": \"http://user@example.org/smth\",\n    \"href\": \"http://user@example.org/some/path\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"user\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/some/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\",\n    \"base\": \"http://user:pass@example.org:21/smth\",\n    \"href\": \"http://user:pass@example.org:21/smth\",\n    \"origin\": \"http://example.org:21\",\n    \"protocol\": \"http:\",\n    \"username\": \"user\",\n    \"password\": \"pass\",\n    \"host\": \"example.org:21\",\n    \"hostname\": \"example.org\",\n    \"port\": \"21\",\n    \"pathname\": \"/smth\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/some/path\",\n    \"base\": \"http://user:pass@example.org:21/smth\",\n    \"href\": \"http://user:pass@example.org:21/some/path\",\n    \"origin\": \"http://example.org:21\",\n    \"protocol\": \"http:\",\n    \"username\": \"user\",\n    \"password\": \"pass\",\n    \"host\": \"example.org:21\",\n    \"hostname\": \"example.org\",\n    \"port\": \"21\",\n    \"pathname\": \"/some/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# a set of tests designed by zcorpan for relative URLs with unknown schemes\",\n  {\n    \"input\": \"i\",\n    \"base\": \"sc:sd\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"i\",\n    \"base\": \"sc:sd/sd\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"i\",\n    \"base\": \"sc:/pa/pa\",\n    \"href\": \"sc:/pa/i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/pa/i\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"i\",\n    \"base\": \"sc://ho/pa\",\n    \"href\": \"sc://ho/i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"ho\",\n    \"hostname\": \"ho\",\n    \"port\": \"\",\n    \"pathname\": \"/i\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"i\",\n    \"base\": \"sc:///pa/pa\",\n    \"href\": \"sc:///pa/i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/pa/i\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"../i\",\n    \"base\": \"sc:sd\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"../i\",\n    \"base\": \"sc:sd/sd\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"../i\",\n    \"base\": \"sc:/pa/pa\",\n    \"href\": \"sc:/i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/i\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"../i\",\n    \"base\": \"sc://ho/pa\",\n    \"href\": \"sc://ho/i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"ho\",\n    \"hostname\": \"ho\",\n    \"port\": \"\",\n    \"pathname\": \"/i\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"../i\",\n    \"base\": \"sc:///pa/pa\",\n    \"href\": \"sc:///i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/i\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/i\",\n    \"base\": \"sc:sd\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"/i\",\n    \"base\": \"sc:sd/sd\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"/i\",\n    \"base\": \"sc:/pa/pa\",\n    \"href\": \"sc:/i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/i\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/i\",\n    \"base\": \"sc://ho/pa\",\n    \"href\": \"sc://ho/i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"ho\",\n    \"hostname\": \"ho\",\n    \"port\": \"\",\n    \"pathname\": \"/i\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/i\",\n    \"base\": \"sc:///pa/pa\",\n    \"href\": \"sc:///i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/i\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"?i\",\n    \"base\": \"sc:sd\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"?i\",\n    \"base\": \"sc:sd/sd\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"?i\",\n    \"base\": \"sc:/pa/pa\",\n    \"href\": \"sc:/pa/pa?i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/pa/pa\",\n    \"search\": \"?i\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"?i\",\n    \"base\": \"sc://ho/pa\",\n    \"href\": \"sc://ho/pa?i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"ho\",\n    \"hostname\": \"ho\",\n    \"port\": \"\",\n    \"pathname\": \"/pa\",\n    \"search\": \"?i\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"?i\",\n    \"base\": \"sc:///pa/pa\",\n    \"href\": \"sc:///pa/pa?i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/pa/pa\",\n    \"search\": \"?i\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"#i\",\n    \"base\": \"sc:sd\",\n    \"href\": \"sc:sd#i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"sd\",\n    \"search\": \"\",\n    \"hash\": \"#i\"\n  },\n  {\n    \"input\": \"#i\",\n    \"base\": \"sc:sd/sd\",\n    \"href\": \"sc:sd/sd#i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"sd/sd\",\n    \"search\": \"\",\n    \"hash\": \"#i\"\n  },\n  {\n    \"input\": \"#i\",\n    \"base\": \"sc:/pa/pa\",\n    \"href\": \"sc:/pa/pa#i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/pa/pa\",\n    \"search\": \"\",\n    \"hash\": \"#i\"\n  },\n  {\n    \"input\": \"#i\",\n    \"base\": \"sc://ho/pa\",\n    \"href\": \"sc://ho/pa#i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"ho\",\n    \"hostname\": \"ho\",\n    \"port\": \"\",\n    \"pathname\": \"/pa\",\n    \"search\": \"\",\n    \"hash\": \"#i\"\n  },\n  {\n    \"input\": \"#i\",\n    \"base\": \"sc:///pa/pa\",\n    \"href\": \"sc:///pa/pa#i\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/pa/pa\",\n    \"search\": \"\",\n    \"hash\": \"#i\"\n  },\n  \"# make sure that relative URL logic works on known typically non-relative schemes too\",\n  {\n    \"input\": \"about:/../\",\n    \"base\": null,\n    \"href\": \"about:/\",\n    \"origin\": \"null\",\n    \"protocol\": \"about:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"data:/../\",\n    \"base\": null,\n    \"href\": \"data:/\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"javascript:/../\",\n    \"base\": null,\n    \"href\": \"javascript:/\",\n    \"origin\": \"null\",\n    \"protocol\": \"javascript:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"mailto:/../\",\n    \"base\": null,\n    \"href\": \"mailto:/\",\n    \"origin\": \"null\",\n    \"protocol\": \"mailto:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# unknown schemes and their hosts\",\n  {\n    \"input\": \"sc://ñ.test/\",\n    \"base\": null,\n    \"href\": \"sc://%C3%B1.test/\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%C3%B1.test\",\n    \"hostname\": \"%C3%B1.test\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"sc://%/\",\n    \"base\": null,\n    \"href\": \"sc://%/\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%\",\n    \"hostname\": \"%\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"sc://@/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://te@s:t@/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://:/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://:12/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"x\",\n    \"base\": \"sc://ñ\",\n    \"href\": \"sc://%C3%B1/x\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%C3%B1\",\n    \"hostname\": \"%C3%B1\",\n    \"port\": \"\",\n    \"pathname\": \"/x\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# unknown schemes and backslashes\",\n  {\n    \"input\": \"sc:\\\\../\",\n    \"base\": null,\n    \"href\": \"sc:\\\\../\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\\\\../\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# unknown scheme with path looking like a password\",\n  {\n    \"input\": \"sc::a@example.net\",\n    \"base\": null,\n    \"href\": \"sc::a@example.net\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \":a@example.net\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# unknown scheme with bogus percent-encoding\",\n  {\n    \"input\": \"wow:%NBD\",\n    \"base\": null,\n    \"href\": \"wow:%NBD\",\n    \"origin\": \"null\",\n    \"protocol\": \"wow:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"%NBD\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"wow:%1G\",\n    \"base\": null,\n    \"href\": \"wow:%1G\",\n    \"origin\": \"null\",\n    \"protocol\": \"wow:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"%1G\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# unknown scheme with non-URL characters\",\n  {\n    \"input\": \"wow:\\uFFFF\",\n    \"base\": null,\n    \"href\": \"wow:%EF%BF%BF\",\n    \"origin\": \"null\",\n    \"protocol\": \"wow:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"%EF%BF%BF\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Forbidden host code points\",\n  {\n    \"input\": \"sc://a\\u0000b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://a b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://a<b\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://a>b\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://a[b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://a\\\\b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://a]b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://a^b\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc://a|b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"Forbidden host codepoints: tabs and newlines are removed during preprocessing\",\n  {\n    \"input\": \"foo://ho\\u0009st/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\":\"foo://host/\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"foo:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"foo://ho\\u000Ast/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\":\"foo://host/\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"foo:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"foo://ho\\u000Dst/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\":\"foo://host/\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"foo:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  \"Forbidden domain code-points\",\n  {\n    \"input\": \"http://a\\u0000b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0001b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0002b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0003b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0004b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0005b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0006b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0007b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0008b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u000Bb/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u000Cb/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u000Eb/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u000Fb/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0010b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0011b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0012b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0013b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0014b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0015b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0016b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0017b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0018b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u0019b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u001Ab/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u001Bb/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u001Cb/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u001Db/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u001Eb/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u001Fb/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a%b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a<b\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a>b\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a[b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a]b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a^b\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a|b/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://a\\u007Fb/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"Forbidden domain codepoints: tabs and newlines are removed during preprocessing\",\n  {\n    \"input\": \"http://ho\\u0009st/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\":\"http://host/\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"http:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"http://ho\\u000Ast/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\":\"http://host/\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"http:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"http://ho\\u000Dst/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\":\"http://host/\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"http:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  \"Encoded forbidden domain codepoints in special URLs\",\n  {\n    \"input\": \"http://ho%00st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%01st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%02st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%03st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%04st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%05st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%06st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%07st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%08st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%09st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%0Ast/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%0Bst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%0Cst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%0Dst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%0Est/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%0Fst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%10st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%11st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%12st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%13st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%14st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%15st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%16st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%17st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%18st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%19st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%1Ast/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%1Bst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%1Cst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%1Dst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%1Est/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%1Fst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%20st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%23st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%25st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%2Fst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%3Ast/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%3Cst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%3Est/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%3Fst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%40st/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%5Bst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%5Cst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%5Dst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%7Cst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://ho%7Fst/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"Allowed host/domain code points\",\n  {\n    \"input\": \"http://!\\\"$&'()*+,-.;=_`{}~/\",\n    \"base\": null,\n    \"href\": \"http://!\\\"$&'()*+,-.;=_`{}~/\",\n    \"origin\": \"http://!\\\"$&'()*+,-.;=_`{}~\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"!\\\"$&'()*+,-.;=_`{}~\",\n    \"hostname\": \"!\\\"$&'()*+,-.;=_`{}~\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"sc://\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\u0008\\u000B\\u000C\\u000E\\u000F\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001A\\u001B\\u001C\\u001D\\u001E\\u001F\\u007F!\\\"$%&'()*+,-.;=_`{}~/\",\n    \"base\": null,\n    \"href\": \"sc://%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\\\"$%&'()*+,-.;=_`{}~/\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\\\"$%&'()*+,-.;=_`{}~\",\n    \"hostname\": \"%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\\\"$%&'()*+,-.;=_`{}~\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Hosts and percent-encoding\",\n  {\n    \"input\": \"ftp://example.com%80/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"ftp://example.com%A0/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://example.com%80/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://example.com%A0/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"ftp://%e2%98%83\",\n    \"base\": null,\n    \"href\": \"ftp://xn--n3h/\",\n    \"origin\": \"ftp://xn--n3h\",\n    \"protocol\": \"ftp:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"xn--n3h\",\n    \"hostname\": \"xn--n3h\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https://%e2%98%83\",\n    \"base\": null,\n    \"href\": \"https://xn--n3h/\",\n    \"origin\": \"https://xn--n3h\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"xn--n3h\",\n    \"hostname\": \"xn--n3h\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# tests from jsdom/whatwg-url designed for code coverage\",\n  {\n    \"input\": \"http://127.0.0.1:10100/relative_import.html\",\n    \"base\": null,\n    \"href\": \"http://127.0.0.1:10100/relative_import.html\",\n    \"origin\": \"http://127.0.0.1:10100\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"127.0.0.1:10100\",\n    \"hostname\": \"127.0.0.1\",\n    \"port\": \"10100\",\n    \"pathname\": \"/relative_import.html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://facebook.com/?foo=%7B%22abc%22\",\n    \"base\": null,\n    \"href\": \"http://facebook.com/?foo=%7B%22abc%22\",\n    \"origin\": \"http://facebook.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"facebook.com\",\n    \"hostname\": \"facebook.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"?foo=%7B%22abc%22\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https://localhost:3000/jqueryui@1.2.3\",\n    \"base\": null,\n    \"href\": \"https://localhost:3000/jqueryui@1.2.3\",\n    \"origin\": \"https://localhost:3000\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"localhost:3000\",\n    \"hostname\": \"localhost\",\n    \"port\": \"3000\",\n    \"pathname\": \"/jqueryui@1.2.3\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# tab/LF/CR\",\n  {\n    \"input\": \"h\\tt\\nt\\rp://h\\to\\ns\\rt:9\\t0\\n0\\r0/p\\ta\\nt\\rh?q\\tu\\ne\\rry#f\\tr\\na\\rg\",\n    \"base\": null,\n    \"href\": \"http://host:9000/path?query#frag\",\n    \"origin\": \"http://host:9000\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host:9000\",\n    \"hostname\": \"host\",\n    \"port\": \"9000\",\n    \"pathname\": \"/path\",\n    \"search\": \"?query\",\n    \"hash\": \"#frag\"\n  },\n  \"# Stringification of URL.searchParams\",\n  {\n    \"input\": \"?a=b&c=d\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar?a=b&c=d\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"?a=b&c=d\",\n    \"searchParams\": \"a=b&c=d\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"??a=b&c=d\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar??a=b&c=d\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"??a=b&c=d\",\n    \"searchParams\": \"%3Fa=b&c=d\",\n    \"hash\": \"\"\n  },\n  \"# Scheme only\",\n  {\n    \"input\": \"http:\",\n    \"base\": \"http://example.org/foo/bar\",\n    \"href\": \"http://example.org/foo/bar\",\n    \"origin\": \"http://example.org\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"searchParams\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http:\",\n    \"base\": \"https://example.org/foo/bar\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"sc:\",\n    \"base\": \"https://example.org/foo/bar\",\n    \"href\": \"sc:\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"searchParams\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Percent encoding of fragments\",\n  {\n    \"input\": \"http://foo.bar/baz?qux#foo\\bbar\",\n    \"base\": null,\n    \"href\": \"http://foo.bar/baz?qux#foo%08bar\",\n    \"origin\": \"http://foo.bar\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo.bar\",\n    \"hostname\": \"foo.bar\",\n    \"port\": \"\",\n    \"pathname\": \"/baz\",\n    \"search\": \"?qux\",\n    \"searchParams\": \"qux=\",\n    \"hash\": \"#foo%08bar\"\n  },\n  {\n    \"input\": \"http://foo.bar/baz?qux#foo\\\"bar\",\n    \"base\": null,\n    \"href\": \"http://foo.bar/baz?qux#foo%22bar\",\n    \"origin\": \"http://foo.bar\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo.bar\",\n    \"hostname\": \"foo.bar\",\n    \"port\": \"\",\n    \"pathname\": \"/baz\",\n    \"search\": \"?qux\",\n    \"searchParams\": \"qux=\",\n    \"hash\": \"#foo%22bar\"\n  },\n  {\n    \"input\": \"http://foo.bar/baz?qux#foo<bar\",\n    \"base\": null,\n    \"href\": \"http://foo.bar/baz?qux#foo%3Cbar\",\n    \"origin\": \"http://foo.bar\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo.bar\",\n    \"hostname\": \"foo.bar\",\n    \"port\": \"\",\n    \"pathname\": \"/baz\",\n    \"search\": \"?qux\",\n    \"searchParams\": \"qux=\",\n    \"hash\": \"#foo%3Cbar\"\n  },\n  {\n    \"input\": \"http://foo.bar/baz?qux#foo>bar\",\n    \"base\": null,\n    \"href\": \"http://foo.bar/baz?qux#foo%3Ebar\",\n    \"origin\": \"http://foo.bar\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo.bar\",\n    \"hostname\": \"foo.bar\",\n    \"port\": \"\",\n    \"pathname\": \"/baz\",\n    \"search\": \"?qux\",\n    \"searchParams\": \"qux=\",\n    \"hash\": \"#foo%3Ebar\"\n  },\n  {\n    \"input\": \"http://foo.bar/baz?qux#foo`bar\",\n    \"base\": null,\n    \"href\": \"http://foo.bar/baz?qux#foo%60bar\",\n    \"origin\": \"http://foo.bar\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foo.bar\",\n    \"hostname\": \"foo.bar\",\n    \"port\": \"\",\n    \"pathname\": \"/baz\",\n    \"search\": \"?qux\",\n    \"searchParams\": \"qux=\",\n    \"hash\": \"#foo%60bar\"\n  },\n  \"# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)\",\n  {\n    \"input\": \"http://1.2.3.4/\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://1.2.3.4/\",\n    \"origin\": \"http://1.2.3.4\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"1.2.3.4\",\n    \"hostname\": \"1.2.3.4\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://1.2.3.4./\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://1.2.3.4/\",\n    \"origin\": \"http://1.2.3.4\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"1.2.3.4\",\n    \"hostname\": \"1.2.3.4\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://192.168.257\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://192.168.1.1/\",\n    \"origin\": \"http://192.168.1.1\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"192.168.1.1\",\n    \"hostname\": \"192.168.1.1\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://192.168.257.\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://192.168.1.1/\",\n    \"origin\": \"http://192.168.1.1\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"192.168.1.1\",\n    \"hostname\": \"192.168.1.1\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://192.168.257.com\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://192.168.257.com/\",\n    \"origin\": \"http://192.168.257.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"192.168.257.com\",\n    \"hostname\": \"192.168.257.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://256\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://0.0.1.0/\",\n    \"origin\": \"http://0.0.1.0\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"0.0.1.0\",\n    \"hostname\": \"0.0.1.0\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://256.com\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://256.com/\",\n    \"origin\": \"http://256.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"256.com\",\n    \"hostname\": \"256.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://999999999\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://59.154.201.255/\",\n    \"origin\": \"http://59.154.201.255\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"59.154.201.255\",\n    \"hostname\": \"59.154.201.255\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://999999999.\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://59.154.201.255/\",\n    \"origin\": \"http://59.154.201.255\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"59.154.201.255\",\n    \"hostname\": \"59.154.201.255\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://999999999.com\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://999999999.com/\",\n    \"origin\": \"http://999999999.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"999999999.com\",\n    \"hostname\": \"999999999.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://10000000000\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://10000000000.com\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://10000000000.com/\",\n    \"origin\": \"http://10000000000.com\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"10000000000.com\",\n    \"hostname\": \"10000000000.com\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://4294967295\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://255.255.255.255/\",\n    \"origin\": \"http://255.255.255.255\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"255.255.255.255\",\n    \"hostname\": \"255.255.255.255\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://4294967296\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://0xffffffff\",\n    \"base\": \"http://other.com/\",\n    \"href\": \"http://255.255.255.255/\",\n    \"origin\": \"http://255.255.255.255\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"255.255.255.255\",\n    \"hostname\": \"255.255.255.255\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://0xffffffff1\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://256.256.256.256\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://0x.0x.0\",\n    \"base\": null,\n    \"href\": \"https://0.0.0.0/\",\n    \"origin\": \"https://0.0.0.0\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"0.0.0.0\",\n    \"hostname\": \"0.0.0.0\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https://0x.0x.0x.0x\",\n    \"base\": null,\n    \"href\": \"https://0.0.0.0/\",\n    \"origin\": \"https://0.0.0.0\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"0.0.0.0\",\n    \"hostname\": \"0.0.0.0\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"https://00.00.00.00\",\n    \"base\": null,\n    \"href\": \"https://0.0.0.0/\",\n    \"origin\": \"https://0.0.0.0\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"0.0.0.0\",\n    \"hostname\": \"0.0.0.0\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)\",\n  {\n    \"input\": \"https://0x100000000/test\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://256.0.0.1/test\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"# file URLs containing percent-encoded Windows drive letters (shouldn't work)\",\n  {\n    \"input\": \"file:///C%3A/\",\n    \"base\": null,\n    \"href\": \"file:///C%3A/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C%3A/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///C%7C/\",\n    \"base\": null,\n    \"href\": \"file:///C%7C/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C%7C/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://%43%3A\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"file://%43%7C\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"file://%43|\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"file://C%7C\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"file://%43%7C/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://%43%7C/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"asdf://%43|/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"asdf://%43%7C/\",\n    \"base\": null,\n    \"href\": \"asdf://%43%7C/\",\n    \"origin\": \"null\",\n    \"protocol\": \"asdf:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%43%7C\",\n    \"hostname\": \"%43%7C\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)\",\n  {\n    \"input\": \"pix/submit.gif\",\n    \"base\": \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html\",\n    \"href\": \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"..\",\n    \"base\": \"file:///C:/\",\n    \"href\": \"file:///C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"..\",\n    \"base\": \"file:///\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# More file URL tests by zcorpan and annevk\",\n  {\n    \"input\": \"/\",\n    \"base\": \"file:///C:/a/b\",\n    \"href\": \"file:///C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/\",\n    \"base\": \"file://h/C:/a/b\",\n    \"href\": \"file://h/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"h\",\n    \"hostname\": \"h\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/\",\n    \"base\": \"file://h/a/b\",\n    \"href\": \"file://h/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"h\",\n    \"hostname\": \"h\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//d:\",\n    \"base\": \"file:///C:/a/b\",\n    \"href\": \"file:///d:\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/d:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//d:/..\",\n    \"base\": \"file:///C:/a/b\",\n    \"href\": \"file:///d:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/d:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"..\",\n    \"base\": \"file:///ab:/\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"..\",\n    \"base\": \"file:///1:/\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\",\n    \"base\": \"file:///test?test#test\",\n    \"href\": \"file:///test?test\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?test\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:\",\n    \"base\": \"file:///test?test#test\",\n    \"href\": \"file:///test?test\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?test\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"?x\",\n    \"base\": \"file:///test?test#test\",\n    \"href\": \"file:///test?x\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?x\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:?x\",\n    \"base\": \"file:///test?test#test\",\n    \"href\": \"file:///test?x\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?x\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"#x\",\n    \"base\": \"file:///test?test#test\",\n    \"href\": \"file:///test?test#x\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?test\",\n    \"hash\": \"#x\"\n  },\n  {\n    \"input\": \"file:#x\",\n    \"base\": \"file:///test?test#test\",\n    \"href\": \"file:///test?test#x\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?test\",\n    \"hash\": \"#x\"\n  },\n  \"# File URLs and many (back)slashes\",\n  {\n    \"input\": \"file:\\\\\\\\//\",\n    \"base\": null,\n    \"href\": \"file:////\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:\\\\\\\\\\\\\\\\\",\n    \"base\": null,\n    \"href\": \"file:////\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:\\\\\\\\\\\\\\\\?fox\",\n    \"base\": null,\n    \"href\": \"file:////?fox\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"?fox\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:\\\\\\\\\\\\\\\\#guppy\",\n    \"base\": null,\n    \"href\": \"file:////#guppy\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"#guppy\"\n  },\n  {\n    \"input\": \"file://spider///\",\n    \"base\": null,\n    \"href\": \"file://spider///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"spider\",\n    \"hostname\": \"spider\",\n    \"port\": \"\",\n    \"pathname\": \"///\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:\\\\\\\\localhost//\",\n    \"base\": null,\n    \"href\": \"file:////\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///localhost//cat\",\n    \"base\": null,\n    \"href\": \"file:///localhost//cat\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/localhost//cat\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://\\\\/localhost//cat\",\n    \"base\": null,\n    \"href\": \"file:////localhost//cat\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//localhost//cat\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://localhost//a//../..//\",\n    \"base\": null,\n    \"href\": \"file://///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"///\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/////mouse\",\n    \"base\": \"file:///elephant\",\n    \"href\": \"file://///mouse\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"///mouse\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\\\\//pig\",\n    \"base\": \"file://lion/\",\n    \"href\": \"file:///pig\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/pig\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\\\\/localhost//pig\",\n    \"base\": \"file://lion/\",\n    \"href\": \"file:////pig\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//pig\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//localhost//pig\",\n    \"base\": \"file://lion/\",\n    \"href\": \"file:////pig\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//pig\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/..//localhost//pig\",\n    \"base\": \"file://lion/\",\n    \"href\": \"file://lion//localhost//pig\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"lion\",\n    \"hostname\": \"lion\",\n    \"port\": \"\",\n    \"pathname\": \"//localhost//pig\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://\",\n    \"base\": \"file://ape/\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# File URLs with non-empty hosts\",\n  {\n    \"input\": \"/rooibos\",\n    \"base\": \"file://tea/\",\n    \"href\": \"file://tea/rooibos\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"tea\",\n    \"hostname\": \"tea\",\n    \"port\": \"\",\n    \"pathname\": \"/rooibos\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/?chai\",\n    \"base\": \"file://tea/\",\n    \"href\": \"file://tea/?chai\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"tea\",\n    \"hostname\": \"tea\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"?chai\",\n    \"hash\": \"\"\n  },\n  \"# Windows drive letter handling with the 'file:' base URL\",\n  {\n    \"input\": \"C|\",\n    \"base\": \"file://host/dir/file\",\n    \"href\": \"file://host/C:\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"C|\",\n    \"base\": \"file://host/D:/dir1/dir2/file\",\n    \"href\": \"file://host/C:\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"C|#\",\n    \"base\": \"file://host/dir/file\",\n    \"href\": \"file://host/C:#\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"C|?\",\n    \"base\": \"file://host/dir/file\",\n    \"href\": \"file://host/C:?\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"C|/\",\n    \"base\": \"file://host/dir/file\",\n    \"href\": \"file://host/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"C|\\n/\",\n    \"base\": \"file://host/dir/file\",\n    \"href\": \"file://host/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"C|\\\\\",\n    \"base\": \"file://host/dir/file\",\n    \"href\": \"file://host/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"C\",\n    \"base\": \"file://host/dir/file\",\n    \"href\": \"file://host/dir/C\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/dir/C\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"C|a\",\n    \"base\": \"file://host/dir/file\",\n    \"href\": \"file://host/dir/C|a\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/dir/C|a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Windows drive letter quirk in the file slash state\",\n  {\n    \"input\": \"/c:/foo/bar\",\n    \"base\": \"file:///c:/baz/qux\",\n    \"href\": \"file:///c:/foo/bar\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/c:/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/c|/foo/bar\",\n    \"base\": \"file:///c:/baz/qux\",\n    \"href\": \"file:///c:/foo/bar\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/c:/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:\\\\c:\\\\foo\\\\bar\",\n    \"base\": \"file:///c:/baz/qux\",\n    \"href\": \"file:///c:/foo/bar\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/c:/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/c:/foo/bar\",\n    \"base\": \"file://host/path\",\n    \"href\": \"file://host/c:/foo/bar\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/c:/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"..\",\n    \"base\": \"abc://x/y/z/C:/\",\n    \"href\": \"abc://x/y/z/\",\n    \"protocol\": \"abc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"hostname\": \"x\",\n    \"port\": \"\",\n    \"host\": \"x\",\n    \"pathname\": \"/y/z/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"..\",\n    \"base\": \"file://x/C:/\",\n    \"href\": \"file://x/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"hostname\": \"x\",\n    \"port\": \"\",\n    \"host\": \"x\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Do not drop the host in the presence of a drive letter\",\n  {\n    \"input\": \"file://example.net/C:/\",\n    \"base\": null,\n    \"href\": \"file://example.net/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.net\",\n    \"hostname\": \"example.net\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://1.2.3.4/C:/\",\n    \"base\": null,\n    \"href\": \"file://1.2.3.4/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"1.2.3.4\",\n    \"hostname\": \"1.2.3.4\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://[1::8]/C:/\",\n    \"base\": null,\n    \"href\": \"file://[1::8]/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[1::8]\",\n    \"hostname\": \"[1::8]\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Copy the host from the base URL in the following cases\",\n  {\n    \"input\": \"C|/\",\n    \"base\": \"file://host/\",\n    \"href\": \"file://host/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/C:/\",\n    \"base\": \"file://host/\",\n    \"href\": \"file://host/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:C:/\",\n    \"base\": \"file://host/\",\n    \"href\": \"file://host/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:/C:/\",\n    \"base\": \"file://host/\",\n    \"href\": \"file://host/C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Copy the empty host from the input in the following cases\",\n  {\n    \"input\": \"//C:/\",\n    \"base\": \"file://host/\",\n    \"href\": \"file:///C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://C:/\",\n    \"base\": \"file://host/\",\n    \"href\": \"file:///C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///C:/\",\n    \"base\": \"file://host/\",\n    \"href\": \"file:///C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///C:/\",\n    \"base\": \"file://host/\",\n    \"href\": \"file:///C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Windows drive letter quirk (no host)\",\n  {\n    \"input\": \"file:/C|/\",\n    \"base\": null,\n    \"href\": \"file:///C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://C|/\",\n    \"base\": null,\n    \"href\": \"file:///C:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/C:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# file URLs without base URL by Rimas Misevičius\",\n  {\n    \"input\": \"file:\",\n    \"base\": null,\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:?q=v\",\n    \"base\": null,\n    \"href\": \"file:///?q=v\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"?q=v\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:#frag\",\n    \"base\": null,\n    \"href\": \"file:///#frag\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"#frag\"\n  },\n  \"# file: drive letter cases from https://crbug.com/1078698\",\n  {\n    \"input\": \"file:///Y:\",\n    \"base\": null,\n    \"href\": \"file:///Y:\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/Y:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///Y:/\",\n    \"base\": null,\n    \"href\": \"file:///Y:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/Y:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///./Y\",\n    \"base\": null,\n    \"href\": \"file:///Y\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/Y\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///./Y:\",\n    \"base\": null,\n    \"href\": \"file:///Y:\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/Y:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\\\\\\\\\\\\.\\\\Y:\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  \"# file: drive letter cases from https://crbug.com/1078698 but lowercased\",\n  {\n    \"input\": \"file:///y:\",\n    \"base\": null,\n    \"href\": \"file:///y:\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/y:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///y:/\",\n    \"base\": null,\n    \"href\": \"file:///y:/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/y:/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///./y\",\n    \"base\": null,\n    \"href\": \"file:///y\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/y\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///./y:\",\n    \"base\": null,\n    \"href\": \"file:///y:\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/y:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\\\\\\\\\\\\.\\\\y:\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  \"# Additional file URL tests for (https://github.com/whatwg/url/issues/405)\",\n  {\n    \"input\": \"file://localhost//a//../..//foo\",\n    \"base\": null,\n    \"href\": \"file://///foo\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"///foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://localhost////foo\",\n    \"base\": null,\n    \"href\": \"file://////foo\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"////foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:////foo\",\n    \"base\": null,\n    \"href\": \"file:////foo\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//foo\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///one/two\",\n    \"base\": \"file:///\",\n    \"href\": \"file:///one/two\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/one/two\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:////one/two\",\n    \"base\": \"file:///\",\n    \"href\": \"file:////one/two\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//one/two\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//one/two\",\n    \"base\": \"file:///\",\n    \"href\": \"file://one/two\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"one\",\n    \"hostname\": \"one\",\n    \"port\": \"\",\n    \"pathname\": \"/two\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///one/two\",\n    \"base\": \"file:///\",\n    \"href\": \"file:///one/two\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/one/two\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"////one/two\",\n    \"base\": \"file:///\",\n    \"href\": \"file:////one/two\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//one/two\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:///.//\",\n    \"base\": \"file:////\",\n    \"href\": \"file:////\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"File URL tests for https://github.com/whatwg/url/issues/549\",\n  {\n    \"input\": \"file:.//p\",\n    \"base\": null,\n    \"href\": \"file:////p\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//p\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file:/.//p\",\n    \"base\": null,\n    \"href\": \"file:////p\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//p\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# IPv6 tests\",\n  {\n    \"input\": \"http://[1:0::]\",\n    \"base\": \"http://example.net/\",\n    \"href\": \"http://[1::]/\",\n    \"origin\": \"http://[1::]\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[1::]\",\n    \"hostname\": \"[1::]\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://[0:1:2:3:4:5:6:7:8]\",\n    \"base\": \"http://example.net/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://[0::0::0]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://[0:.0]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://[0:0:]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://[0:1:2:3:4:5:6:7.0.0.0.1]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://[0:1.00.0.0.0]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://[0:1.290.0.0.0]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://[0:1.23.23]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"# Empty host\",\n  {\n    \"input\": \"http://?\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://#\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"Port overflow (2^32 + 81)\",\n  {\n    \"input\": \"http://f:4294967377/c\",\n    \"base\": \"http://example.org/\",\n    \"failure\": true\n  },\n  \"Port overflow (2^64 + 81)\",\n  {\n    \"input\": \"http://f:18446744073709551697/c\",\n    \"base\": \"http://example.org/\",\n    \"failure\": true\n  },\n  \"Port overflow (2^128 + 81)\",\n  {\n    \"input\": \"http://f:340282366920938463463374607431768211537/c\",\n    \"base\": \"http://example.org/\",\n    \"failure\": true\n  },\n  \"# Non-special-URL path tests\",\n  {\n    \"input\": \"sc://ñ\",\n    \"base\": null,\n    \"href\": \"sc://%C3%B1\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%C3%B1\",\n    \"hostname\": \"%C3%B1\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"sc://ñ?x\",\n    \"base\": null,\n    \"href\": \"sc://%C3%B1?x\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%C3%B1\",\n    \"hostname\": \"%C3%B1\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"?x\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"sc://ñ#x\",\n    \"base\": null,\n    \"href\": \"sc://%C3%B1#x\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%C3%B1\",\n    \"hostname\": \"%C3%B1\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"#x\"\n  },\n  {\n    \"input\": \"#x\",\n    \"base\": \"sc://ñ\",\n    \"href\": \"sc://%C3%B1#x\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%C3%B1\",\n    \"hostname\": \"%C3%B1\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"#x\"\n  },\n  {\n    \"input\": \"?x\",\n    \"base\": \"sc://ñ\",\n    \"href\": \"sc://%C3%B1?x\",\n    \"origin\": \"null\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%C3%B1\",\n    \"hostname\": \"%C3%B1\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"?x\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"sc://?\",\n    \"base\": null,\n    \"href\": \"sc://?\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"sc://#\",\n    \"base\": null,\n    \"href\": \"sc://#\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///\",\n    \"base\": \"sc://x/\",\n    \"href\": \"sc:///\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"////\",\n    \"base\": \"sc://x/\",\n    \"href\": \"sc:////\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"////x/\",\n    \"base\": \"sc://x/\",\n    \"href\": \"sc:////x/\",\n    \"protocol\": \"sc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//x/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"tftp://foobar.com/someconfig;mode=netascii\",\n    \"base\": null,\n    \"href\": \"tftp://foobar.com/someconfig;mode=netascii\",\n    \"origin\": \"null\",\n    \"protocol\": \"tftp:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"foobar.com\",\n    \"hostname\": \"foobar.com\",\n    \"port\": \"\",\n    \"pathname\": \"/someconfig;mode=netascii\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"telnet://user:pass@foobar.com:23/\",\n    \"base\": null,\n    \"href\": \"telnet://user:pass@foobar.com:23/\",\n    \"origin\": \"null\",\n    \"protocol\": \"telnet:\",\n    \"username\": \"user\",\n    \"password\": \"pass\",\n    \"host\": \"foobar.com:23\",\n    \"hostname\": \"foobar.com\",\n    \"port\": \"23\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ut2004://10.10.10.10:7777/Index.ut2\",\n    \"base\": null,\n    \"href\": \"ut2004://10.10.10.10:7777/Index.ut2\",\n    \"origin\": \"null\",\n    \"protocol\": \"ut2004:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"10.10.10.10:7777\",\n    \"hostname\": \"10.10.10.10\",\n    \"port\": \"7777\",\n    \"pathname\": \"/Index.ut2\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\",\n    \"base\": null,\n    \"href\": \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\",\n    \"origin\": \"null\",\n    \"protocol\": \"redis:\",\n    \"username\": \"foo\",\n    \"password\": \"bar\",\n    \"host\": \"somehost:6379\",\n    \"hostname\": \"somehost\",\n    \"port\": \"6379\",\n    \"pathname\": \"/0\",\n    \"search\": \"?baz=bam&qux=baz\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"rsync://foo@host:911/sup\",\n    \"base\": null,\n    \"href\": \"rsync://foo@host:911/sup\",\n    \"origin\": \"null\",\n    \"protocol\": \"rsync:\",\n    \"username\": \"foo\",\n    \"password\": \"\",\n    \"host\": \"host:911\",\n    \"hostname\": \"host\",\n    \"port\": \"911\",\n    \"pathname\": \"/sup\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"git://github.com/foo/bar.git\",\n    \"base\": null,\n    \"href\": \"git://github.com/foo/bar.git\",\n    \"origin\": \"null\",\n    \"protocol\": \"git:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"github.com\",\n    \"hostname\": \"github.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar.git\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"irc://myserver.com:6999/channel?passwd\",\n    \"base\": null,\n    \"href\": \"irc://myserver.com:6999/channel?passwd\",\n    \"origin\": \"null\",\n    \"protocol\": \"irc:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"myserver.com:6999\",\n    \"hostname\": \"myserver.com\",\n    \"port\": \"6999\",\n    \"pathname\": \"/channel\",\n    \"search\": \"?passwd\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"dns://fw.example.org:9999/foo.bar.org?type=TXT\",\n    \"base\": null,\n    \"href\": \"dns://fw.example.org:9999/foo.bar.org?type=TXT\",\n    \"origin\": \"null\",\n    \"protocol\": \"dns:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"fw.example.org:9999\",\n    \"hostname\": \"fw.example.org\",\n    \"port\": \"9999\",\n    \"pathname\": \"/foo.bar.org\",\n    \"search\": \"?type=TXT\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"ldap://localhost:389/ou=People,o=JNDITutorial\",\n    \"base\": null,\n    \"href\": \"ldap://localhost:389/ou=People,o=JNDITutorial\",\n    \"origin\": \"null\",\n    \"protocol\": \"ldap:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"localhost:389\",\n    \"hostname\": \"localhost\",\n    \"port\": \"389\",\n    \"pathname\": \"/ou=People,o=JNDITutorial\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"git+https://github.com/foo/bar\",\n    \"base\": null,\n    \"href\": \"git+https://github.com/foo/bar\",\n    \"origin\": \"null\",\n    \"protocol\": \"git+https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"github.com\",\n    \"hostname\": \"github.com\",\n    \"port\": \"\",\n    \"pathname\": \"/foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"urn:ietf:rfc:2648\",\n    \"base\": null,\n    \"href\": \"urn:ietf:rfc:2648\",\n    \"origin\": \"null\",\n    \"protocol\": \"urn:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"ietf:rfc:2648\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"tag:joe@example.org,2001:foo/bar\",\n    \"base\": null,\n    \"href\": \"tag:joe@example.org,2001:foo/bar\",\n    \"origin\": \"null\",\n    \"protocol\": \"tag:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"joe@example.org,2001:foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Serialize /. in path\",\n  {\n    \"input\": \"non-spec:/.//\",\n    \"base\": null,\n    \"href\": \"non-spec:/.//\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-spec:/..//\",\n    \"base\": null,\n    \"href\": \"non-spec:/.//\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-spec:/a/..//\",\n    \"base\": null,\n    \"href\": \"non-spec:/.//\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-spec:/.//path\",\n    \"base\": null,\n    \"href\": \"non-spec:/.//path\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-spec:/..//path\",\n    \"base\": null,\n    \"href\": \"non-spec:/.//path\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-spec:/a/..//path\",\n    \"base\": null,\n    \"href\": \"non-spec:/.//path\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/.//path\",\n    \"base\": \"non-spec:/p\",\n    \"href\": \"non-spec:/.//path\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/..//path\",\n    \"base\": \"non-spec:/p\",\n    \"href\": \"non-spec:/.//path\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"..//path\",\n    \"base\": \"non-spec:/p\",\n    \"href\": \"non-spec:/.//path\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"a/..//path\",\n    \"base\": \"non-spec:/p\",\n    \"href\": \"non-spec:/.//path\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"\",\n    \"base\": \"non-spec:/..//p\",\n    \"href\": \"non-spec:/.//p\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//p\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"path\",\n    \"base\": \"non-spec:/..//p\",\n    \"href\": \"non-spec:/.//path\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"//path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Do not serialize /. in path\",\n  {\n    \"input\": \"../path\",\n    \"base\": \"non-spec:/.//p\",\n    \"href\": \"non-spec:/path\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# percent encoded hosts in non-special-URLs\",\n  {\n    \"input\": \"non-special://%E2%80%A0/\",\n    \"base\": null,\n    \"href\": \"non-special://%E2%80%A0/\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"%E2%80%A0\",\n    \"hostname\": \"%E2%80%A0\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special://H%4fSt/path\",\n    \"base\": null,\n    \"href\": \"non-special://H%4fSt/path\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"H%4fSt\",\n    \"hostname\": \"H%4fSt\",\n    \"port\": \"\",\n    \"pathname\": \"/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# IPv6 in non-special-URLs\",\n  {\n    \"input\": \"non-special://[1:2:0:0:5:0:0:0]/\",\n    \"base\": null,\n    \"href\": \"non-special://[1:2:0:0:5::]/\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[1:2:0:0:5::]\",\n    \"hostname\": \"[1:2:0:0:5::]\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special://[1:2:0:0:0:0:0:3]/\",\n    \"base\": null,\n    \"href\": \"non-special://[1:2::3]/\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[1:2::3]\",\n    \"hostname\": \"[1:2::3]\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special://[1:2::3]:80/\",\n    \"base\": null,\n    \"href\": \"non-special://[1:2::3]:80/\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[1:2::3]:80\",\n    \"hostname\": \"[1:2::3]\",\n    \"port\": \"80\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special://[:80/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"blob:https://example.com:443/\",\n    \"base\": null,\n    \"href\": \"blob:https://example.com:443/\",\n    \"origin\": \"https://example.com\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"https://example.com:443/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"blob:http://example.org:88/\",\n    \"base\": null,\n    \"href\": \"blob:http://example.org:88/\",\n    \"origin\": \"http://example.org:88\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"http://example.org:88/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\",\n    \"base\": null,\n    \"href\": \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\",\n    \"origin\": \"null\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"d3958f5c-0777-0845-9dcf-2cb28783acaf\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"blob:\",\n    \"base\": null,\n    \"href\": \"blob:\",\n    \"origin\": \"null\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"blob: in blob:\",\n  {\n    \"input\": \"blob:blob:\",\n    \"base\": null,\n    \"href\": \"blob:blob:\",\n    \"origin\": \"null\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"blob:\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"blob:blob:https://example.org/\",\n    \"base\": null,\n    \"href\": \"blob:blob:https://example.org/\",\n    \"origin\": \"null\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"blob:https://example.org/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Non-http(s): in blob:\",\n  {\n    \"input\": \"blob:about:blank\",\n    \"base\": null,\n    \"href\": \"blob:about:blank\",\n    \"origin\": \"null\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"about:blank\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"blob:file://host/path\",\n    \"base\": null,\n    \"href\": \"blob:file://host/path\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"file://host/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"blob:ftp://host/path\",\n    \"base\": null,\n    \"href\": \"blob:ftp://host/path\",\n    \"origin\": \"null\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"ftp://host/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"blob:ws://example.org/\",\n    \"base\": null,\n    \"href\": \"blob:ws://example.org/\",\n    \"origin\": \"null\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"ws://example.org/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"blob:wss://example.org/\",\n    \"base\": null,\n    \"href\": \"blob:wss://example.org/\",\n    \"origin\": \"null\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"wss://example.org/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Percent-encoded http: in blob:\",\n  {\n    \"input\": \"blob:http%3a//example.org/\",\n    \"base\": null,\n    \"href\": \"blob:http%3a//example.org/\",\n    \"origin\": \"null\",\n    \"protocol\": \"blob:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"http%3a//example.org/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Invalid IPv4 radix digits\",\n  {\n    \"input\": \"http://0x7f.0.0.0x7g\",\n    \"base\": null,\n    \"href\": \"http://0x7f.0.0.0x7g/\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"0x7f.0.0.0x7g\",\n    \"hostname\": \"0x7f.0.0.0x7g\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://0X7F.0.0.0X7G\",\n    \"base\": null,\n    \"href\": \"http://0x7f.0.0.0x7g/\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"0x7f.0.0.0x7g\",\n    \"hostname\": \"0x7f.0.0.0x7g\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Invalid IPv4 portion of IPv6 address\",\n  {\n    \"input\": \"http://[::127.0.0.0.1]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"Uncompressed IPv6 addresses with 0\",\n  {\n    \"input\": \"http://[0:1:0:1:0:1:0:1]\",\n    \"base\": null,\n    \"href\": \"http://[0:1:0:1:0:1:0:1]/\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[0:1:0:1:0:1:0:1]\",\n    \"hostname\": \"[0:1:0:1:0:1:0:1]\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://[1:0:1:0:1:0:1:0]\",\n    \"base\": null,\n    \"href\": \"http://[1:0:1:0:1:0:1:0]/\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"[1:0:1:0:1:0:1:0]\",\n    \"hostname\": \"[1:0:1:0:1:0:1:0]\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Percent-encoded query and fragment\",\n  {\n    \"input\": \"http://example.org/test?\\u0022\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?%22\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?%22\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.org/test?\\u0023\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?#\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.org/test?\\u003C\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?%3C\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?%3C\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.org/test?\\u003E\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?%3E\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?%3E\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.org/test?\\u2323\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?%E2%8C%A3\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?%E2%8C%A3\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.org/test?%23%23\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?%23%23\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?%23%23\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.org/test?%GH\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?%GH\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?%GH\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"http://example.org/test?a#%EF\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?a#%EF\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?a\",\n    \"hash\": \"#%EF\"\n  },\n  {\n    \"input\": \"http://example.org/test?a#%GH\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?a#%GH\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?a\",\n    \"hash\": \"#%GH\"\n  },\n  \"URLs that require a non-about:blank base. (Also serve as invalid base tests.)\",\n  {\n    \"input\": \"a\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"a/\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"a//\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  \"Bases that don't fail to parse but fail to be bases\",\n  {\n    \"input\": \"test-a-colon.html\",\n    \"base\": \"a:\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"test-a-colon-b.html\",\n    \"base\": \"a:b\",\n    \"failure\": true\n  },\n  \"Other base URL tests, that must succeed\",\n  {\n    \"input\": \"test-a-colon-slash.html\",\n    \"base\": \"a:/\",\n    \"href\": \"a:/test-a-colon-slash.html\",\n    \"protocol\": \"a:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test-a-colon-slash.html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"test-a-colon-slash-slash.html\",\n    \"base\": \"a://\",\n    \"href\": \"a:///test-a-colon-slash-slash.html\",\n    \"protocol\": \"a:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test-a-colon-slash-slash.html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"test-a-colon-slash-b.html\",\n    \"base\": \"a:/b\",\n    \"href\": \"a:/test-a-colon-slash-b.html\",\n    \"protocol\": \"a:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test-a-colon-slash-b.html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"test-a-colon-slash-slash-b.html\",\n    \"base\": \"a://b\",\n    \"href\": \"a://b/test-a-colon-slash-slash-b.html\",\n    \"protocol\": \"a:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"b\",\n    \"hostname\": \"b\",\n    \"port\": \"\",\n    \"pathname\": \"/test-a-colon-slash-slash-b.html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Null code point in fragment\",\n  {\n    \"input\": \"http://example.org/test?a#b\\u0000c\",\n    \"base\": null,\n    \"href\": \"http://example.org/test?a#b%00c\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?a\",\n    \"hash\": \"#b%00c\"\n  },\n  {\n    \"input\": \"non-spec://example.org/test?a#b\\u0000c\",\n    \"base\": null,\n    \"href\": \"non-spec://example.org/test?a#b%00c\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?a\",\n    \"hash\": \"#b%00c\"\n  },\n  {\n    \"input\": \"non-spec:/test?a#b\\u0000c\",\n    \"base\": null,\n    \"href\": \"non-spec:/test?a#b%00c\",\n    \"protocol\": \"non-spec:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"?a\",\n    \"hash\": \"#b%00c\"\n  },\n  \"First scheme char - not allowed: https://github.com/whatwg/url/issues/464\",\n  {\n    \"input\": \"10.0.0.7:8080/foo.html\",\n    \"base\": \"file:///some/dir/bar.html\",\n    \"href\": \"file:///some/dir/10.0.0.7:8080/foo.html\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/some/dir/10.0.0.7:8080/foo.html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Subsequent scheme chars - not allowed\",\n  {\n    \"input\": \"a!@$*=/foo.html\",\n    \"base\": \"file:///some/dir/bar.html\",\n    \"href\": \"file:///some/dir/a!@$*=/foo.html\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/some/dir/a!@$*=/foo.html\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"First and subsequent scheme chars - allowed\",\n  {\n    \"input\": \"a1234567890-+.:foo/bar\",\n    \"base\": \"http://example.com/dir/file\",\n    \"href\": \"a1234567890-+.:foo/bar\",\n    \"protocol\": \"a1234567890-+.:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"foo/bar\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"IDNA ignored code points in file URLs hosts\",\n  {\n    \"input\": \"file://a\\u00ADb/p\",\n    \"base\": null,\n    \"href\": \"file://ab/p\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"ab\",\n    \"hostname\": \"ab\",\n    \"port\": \"\",\n    \"pathname\": \"/p\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"file://a%C2%ADb/p\",\n    \"base\": null,\n    \"href\": \"file://ab/p\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"ab\",\n    \"hostname\": \"ab\",\n    \"port\": \"\",\n    \"pathname\": \"/p\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"IDNA hostnames which get mapped to 'localhost'\",\n  {\n    \"input\": \"file://loC𝐀𝐋𝐇𝐨𝐬𝐭/usr/bin\",\n    \"base\": null,\n    \"href\": \"file:///usr/bin\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/usr/bin\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Empty host after the domain to ASCII\",\n  {\n    \"input\": \"file://\\u00ad/p\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"file://%C2%AD/p\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"file://xn--/p\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"https://bugzilla.mozilla.org/show_bug.cgi?id=1647058\",\n  {\n    \"input\": \"#link\",\n    \"base\": \"https://example.org/##link\",\n    \"href\": \"https://example.org/#link\",\n    \"protocol\": \"https:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"#link\"\n  },\n  \"UTF-8 percent-encode of C0 control percent-encode set and supersets\",\n  {\n    \"input\": \"non-special:cannot-be-a-base-url-\\u0000\\u0001\\u001F\\u001E\\u007E\\u007F\\u0080\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80\",\n    \"origin\": \"null\",\n    \"password\": \"\",\n    \"pathname\": \"cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"non-special:cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\",\n    \"origin\": \"null\",\n    \"password\": \"\",\n    \"pathname\": \"cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"https://www.example.com/path{\\u007Fpath.html?query'\\u007F=query#fragment<\\u007Ffragment\",\n    \"base\": null,\n    \"hash\": \"#fragment%3C%7Ffragment\",\n    \"host\": \"www.example.com\",\n    \"hostname\": \"www.example.com\",\n    \"href\": \"https://www.example.com/path%7B%7Fpath.html?query%27%7F=query#fragment%3C%7Ffragment\",\n    \"origin\": \"https://www.example.com\",\n    \"password\": \"\",\n    \"pathname\": \"/path%7B%7Fpath.html\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"?query%27%7F=query\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"https://user:pass[\\u007F@foo/bar\",\n    \"base\": \"http://example.org\",\n    \"hash\": \"\",\n    \"host\": \"foo\",\n    \"hostname\": \"foo\",\n    \"href\": \"https://user:pass%5B%7F@foo/bar\",\n    \"origin\": \"https://foo\",\n    \"password\": \"pass%5B%7F\",\n    \"pathname\": \"/bar\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"\",\n    \"username\": \"user\"\n  },\n  \"Tests for the distinct percent-encode sets\",\n  {\n    \"input\": \"foo:// !\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@host/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/\",\n    \"origin\": \"null\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"foo:\",\n    \"search\": \"\",\n    \"username\": \"%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~\"\n  },\n  {\n    \"input\": \"wss:// !\\\"$%&'()*+,-.;<=>@[]^_`{|}~@host/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/\",\n    \"origin\": \"wss://host\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"wss:\",\n    \"search\": \"\",\n    \"username\": \"%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~\"\n  },\n  {\n    \"input\": \"foo://joe: !\\\"$%&'()*+,-.:;<=>@[\\\\]^_`{|}~@host/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/\",\n    \"origin\": \"null\",\n    \"password\": \"%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"foo:\",\n    \"search\": \"\",\n    \"username\": \"joe\"\n  },\n  {\n    \"input\": \"wss://joe: !\\\"$%&'()*+,-.:;<=>@[]^_`{|}~@host/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/\",\n    \"origin\": \"wss://host\",\n    \"password\": \"%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"wss:\",\n    \"search\": \"\",\n    \"username\": \"joe\"\n  },\n  {\n    \"input\": \"foo://!\\\"$%&'()*+,-.;=_`{}~/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"!\\\"$%&'()*+,-.;=_`{}~\",\n    \"hostname\": \"!\\\"$%&'()*+,-.;=_`{}~\",\n    \"href\":\"foo://!\\\"$%&'()*+,-.;=_`{}~/\",\n    \"origin\": \"null\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"foo:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"wss://!\\\"$&'()*+,-.;=_`{}~/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"!\\\"$&'()*+,-.;=_`{}~\",\n    \"hostname\": \"!\\\"$&'()*+,-.;=_`{}~\",\n    \"href\":\"wss://!\\\"$&'()*+,-.;=_`{}~/\",\n    \"origin\": \"wss://!\\\"$&'()*+,-.;=_`{}~\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"wss:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"foo://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\\\]%5E_%60%7B|%7D~\",\n    \"origin\": \"null\",\n    \"password\": \"\",\n    \"pathname\": \"/%20!%22$%&'()*+,-./:;%3C=%3E@[\\\\]%5E_%60%7B|%7D~\",\n    \"port\":\"\",\n    \"protocol\": \"foo:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"wss://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~\",\n    \"origin\": \"wss://host\",\n    \"password\": \"\",\n    \"pathname\": \"/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~\",\n    \"port\":\"\",\n    \"protocol\": \"wss:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"foo://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\",\n    \"origin\": \"null\",\n    \"password\": \"\",\n    \"pathname\": \"/dir/\",\n    \"port\":\"\",\n    \"protocol\": \"foo:\",\n    \"search\": \"?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"wss://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"wss://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\",\n    \"origin\": \"wss://host\",\n    \"password\": \"\",\n    \"pathname\": \"/dir/\",\n    \"port\":\"\",\n    \"protocol\": \"wss:\",\n    \"search\": \"?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"foo://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\",\n    \"base\": null,\n    \"hash\": \"#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\",\n    \"origin\": \"null\",\n    \"password\": \"\",\n    \"pathname\": \"/dir/\",\n    \"port\":\"\",\n    \"protocol\": \"foo:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"wss://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\",\n    \"base\": null,\n    \"hash\": \"#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"href\": \"wss://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\",\n    \"origin\": \"wss://host\",\n    \"password\": \"\",\n    \"pathname\": \"/dir/\",\n    \"port\":\"\",\n    \"protocol\": \"wss:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  \"Ensure that input schemes are not ignored when resolving non-special URLs\",\n  {\n    \"input\": \"abc:rootless\",\n    \"base\": \"abc://host/path\",\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\":\"abc:rootless\",\n    \"password\": \"\",\n    \"pathname\": \"rootless\",\n    \"port\":\"\",\n    \"protocol\": \"abc:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"abc:rootless\",\n    \"base\": \"abc:/path\",\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\":\"abc:rootless\",\n    \"password\": \"\",\n    \"pathname\": \"rootless\",\n    \"port\":\"\",\n    \"protocol\": \"abc:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"abc:rootless\",\n    \"base\": \"abc:path\",\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\":\"abc:rootless\",\n    \"password\": \"\",\n    \"pathname\": \"rootless\",\n    \"port\":\"\",\n    \"protocol\": \"abc:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"abc:/rooted\",\n    \"base\": \"abc://host/path\",\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\":\"abc:/rooted\",\n    \"password\": \"\",\n    \"pathname\": \"/rooted\",\n    \"port\":\"\",\n    \"protocol\": \"abc:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  \"Empty query and fragment with blank should throw an error\",\n  {\n    \"input\": \"#\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"any-base\"\n  },\n  {\n    \"input\": \"?\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  \"Last component looks like a number, but not valid IPv4\",\n  {\n    \"input\": \"http://1.2.3.4.5\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://1.2.3.4.5.\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://0..0x300/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://0..0x300./\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://256.256.256.256.256\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://256.256.256.256.256.\",\n    \"base\": \"http://other.com/\",\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://1.2.3.08\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://1.2.3.08.\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://1.2.3.09\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://09.2.3.4\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://09.2.3.4.\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://01.2.3.4.5\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://01.2.3.4.5.\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://0x100.2.3.4\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://0x100.2.3.4.\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://0x1.2.3.4.5\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://0x1.2.3.4.5.\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.1.2.3.4\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.1.2.3.4.\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.2.3.4\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.2.3.4.\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.09\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.09.\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.0x4\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.0x4.\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.09..\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"foo.09..\",\n    \"hostname\": \"foo.09..\",\n    \"href\":\"http://foo.09../\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\":\"\",\n    \"protocol\": \"http:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"http://0999999999999999999/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.0x\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://foo.0XFfFfFfFfFfFfFfFfFfAcE123\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"http://💩.123/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"U+0000 and U+FFFF in various places\",\n  {\n    \"input\": \"https://\\u0000y\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://x/\\u0000y\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"x\",\n    \"hostname\": \"x\",\n    \"href\": \"https://x/%00y\",\n    \"password\": \"\",\n    \"pathname\": \"/%00y\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"https://x/?\\u0000y\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"x\",\n    \"hostname\": \"x\",\n    \"href\": \"https://x/?%00y\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"?%00y\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"https://x/?#\\u0000y\",\n    \"base\": null,\n    \"hash\": \"#%00y\",\n    \"host\": \"x\",\n    \"hostname\": \"x\",\n    \"href\": \"https://x/?#%00y\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"https://\\uFFFFy\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://x/\\uFFFFy\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"x\",\n    \"hostname\": \"x\",\n    \"href\": \"https://x/%EF%BF%BFy\",\n    \"password\": \"\",\n    \"pathname\": \"/%EF%BF%BFy\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"https://x/?\\uFFFFy\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"x\",\n    \"hostname\": \"x\",\n    \"href\": \"https://x/?%EF%BF%BFy\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"?%EF%BF%BFy\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"https://x/?#\\uFFFFy\",\n    \"base\": null,\n    \"hash\": \"#%EF%BF%BFy\",\n    \"host\": \"x\",\n    \"hostname\": \"x\",\n    \"href\": \"https://x/?#%EF%BF%BFy\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"non-special:\\u0000y\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:%00y\",\n    \"password\": \"\",\n    \"pathname\": \"%00y\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"non-special:x/\\u0000y\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:x/%00y\",\n    \"password\": \"\",\n    \"pathname\": \"x/%00y\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"non-special:x/?\\u0000y\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:x/?%00y\",\n    \"password\": \"\",\n    \"pathname\": \"x/\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"?%00y\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"non-special:x/?#\\u0000y\",\n    \"base\": null,\n    \"hash\": \"#%00y\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:x/?#%00y\",\n    \"password\": \"\",\n    \"pathname\": \"x/\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"non-special:\\uFFFFy\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:%EF%BF%BFy\",\n    \"password\": \"\",\n    \"pathname\": \"%EF%BF%BFy\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"non-special:x/\\uFFFFy\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:x/%EF%BF%BFy\",\n    \"password\": \"\",\n    \"pathname\": \"x/%EF%BF%BFy\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"non-special:x/?\\uFFFFy\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:x/?%EF%BF%BFy\",\n    \"password\": \"\",\n    \"pathname\": \"x/\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"?%EF%BF%BFy\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"non-special:x/?#\\uFFFFy\",\n    \"base\": null,\n    \"hash\": \"#%EF%BF%BFy\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"href\": \"non-special:x/?#%EF%BF%BFy\",\n    \"password\": \"\",\n    \"pathname\": \"x/\",\n    \"port\": \"\",\n    \"protocol\": \"non-special:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"\",\n    \"base\": null,\n    \"failure\": true,\n    \"relativeTo\": \"non-opaque-path-base\"\n  },\n  {\n    \"input\": \"https://example.com/\\\"quoted\\\"\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"example.com\",\n    \"hostname\": \"example.com\",\n    \"href\": \"https://example.com/%22quoted%22\",\n    \"origin\": \"https://example.com\",\n    \"password\": \"\",\n    \"pathname\": \"/%22quoted%22\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"input\": \"https://a%C2%ADb/\",\n    \"base\": null,\n    \"hash\": \"\",\n    \"host\": \"ab\",\n    \"hostname\": \"ab\",\n    \"href\": \"https://ab/\",\n    \"origin\": \"https://ab\",\n    \"password\": \"\",\n    \"pathname\": \"/\",\n    \"port\": \"\",\n    \"protocol\": \"https:\",\n    \"search\": \"\",\n    \"username\": \"\"\n  },\n  {\n    \"comment\": \"Empty host after domain to ASCII\",\n    \"input\": \"https://\\u00AD/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://%C2%AD/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"https://xn--/\",\n    \"base\": null,\n    \"failure\": true\n  },\n  \"Non-special schemes that some implementations might incorrectly treat as special\",\n  {\n    \"input\": \"data://example.com:8080/pathname?search#hash\",\n    \"base\": null,\n    \"href\": \"data://example.com:8080/pathname?search#hash\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com:8080\",\n    \"hostname\": \"example.com\",\n    \"port\": \"8080\",\n    \"pathname\": \"/pathname\",\n    \"search\": \"?search\",\n    \"hash\": \"#hash\"\n  },\n  {\n    \"input\": \"data:///test\",\n    \"base\": null,\n    \"href\": \"data:///test\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"data://test/a/../b\",\n    \"base\": null,\n    \"href\": \"data://test/b\",\n    \"origin\": \"null\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/b\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"data://:443\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"data://test:test\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"data://[:1]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"javascript://example.com:8080/pathname?search#hash\",\n    \"base\": null,\n    \"href\": \"javascript://example.com:8080/pathname?search#hash\",\n    \"origin\": \"null\",\n    \"protocol\": \"javascript:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com:8080\",\n    \"hostname\": \"example.com\",\n    \"port\": \"8080\",\n    \"pathname\": \"/pathname\",\n    \"search\": \"?search\",\n    \"hash\": \"#hash\"\n  },\n  {\n    \"input\": \"javascript:///test\",\n    \"base\": null,\n    \"href\": \"javascript:///test\",\n    \"origin\": \"null\",\n    \"protocol\": \"javascript:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"javascript://test/a/../b\",\n    \"base\": null,\n    \"href\": \"javascript://test/b\",\n    \"origin\": \"null\",\n    \"protocol\": \"javascript:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/b\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"javascript://:443\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"javascript://test:test\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"javascript://[:1]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"mailto://example.com:8080/pathname?search#hash\",\n    \"base\": null,\n    \"href\": \"mailto://example.com:8080/pathname?search#hash\",\n    \"origin\": \"null\",\n    \"protocol\": \"mailto:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com:8080\",\n    \"hostname\": \"example.com\",\n    \"port\": \"8080\",\n    \"pathname\": \"/pathname\",\n    \"search\": \"?search\",\n    \"hash\": \"#hash\"\n  },\n  {\n    \"input\": \"mailto:///test\",\n    \"base\": null,\n    \"href\": \"mailto:///test\",\n    \"origin\": \"null\",\n    \"protocol\": \"mailto:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"mailto://test/a/../b\",\n    \"base\": null,\n    \"href\": \"mailto://test/b\",\n    \"origin\": \"null\",\n    \"protocol\": \"mailto:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/b\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"mailto://:443\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"mailto://test:test\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"mailto://[:1]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"intent://example.com:8080/pathname?search#hash\",\n    \"base\": null,\n    \"href\": \"intent://example.com:8080/pathname?search#hash\",\n    \"origin\": \"null\",\n    \"protocol\": \"intent:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com:8080\",\n    \"hostname\": \"example.com\",\n    \"port\": \"8080\",\n    \"pathname\": \"/pathname\",\n    \"search\": \"?search\",\n    \"hash\": \"#hash\"\n  },\n  {\n    \"input\": \"intent:///test\",\n    \"base\": null,\n    \"href\": \"intent:///test\",\n    \"origin\": \"null\",\n    \"protocol\": \"intent:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"intent://test/a/../b\",\n    \"base\": null,\n    \"href\": \"intent://test/b\",\n    \"origin\": \"null\",\n    \"protocol\": \"intent:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/b\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"intent://:443\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"intent://test:test\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"intent://[:1]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"urn://example.com:8080/pathname?search#hash\",\n    \"base\": null,\n    \"href\": \"urn://example.com:8080/pathname?search#hash\",\n    \"origin\": \"null\",\n    \"protocol\": \"urn:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com:8080\",\n    \"hostname\": \"example.com\",\n    \"port\": \"8080\",\n    \"pathname\": \"/pathname\",\n    \"search\": \"?search\",\n    \"hash\": \"#hash\"\n  },\n  {\n    \"input\": \"urn:///test\",\n    \"base\": null,\n    \"href\": \"urn:///test\",\n    \"origin\": \"null\",\n    \"protocol\": \"urn:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"urn://test/a/../b\",\n    \"base\": null,\n    \"href\": \"urn://test/b\",\n    \"origin\": \"null\",\n    \"protocol\": \"urn:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/b\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"urn://:443\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"urn://test:test\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"urn://[:1]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"turn://example.com:8080/pathname?search#hash\",\n    \"base\": null,\n    \"href\": \"turn://example.com:8080/pathname?search#hash\",\n    \"origin\": \"null\",\n    \"protocol\": \"turn:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com:8080\",\n    \"hostname\": \"example.com\",\n    \"port\": \"8080\",\n    \"pathname\": \"/pathname\",\n    \"search\": \"?search\",\n    \"hash\": \"#hash\"\n  },\n  {\n    \"input\": \"turn:///test\",\n    \"base\": null,\n    \"href\": \"turn:///test\",\n    \"origin\": \"null\",\n    \"protocol\": \"turn:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"turn://test/a/../b\",\n    \"base\": null,\n    \"href\": \"turn://test/b\",\n    \"origin\": \"null\",\n    \"protocol\": \"turn:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/b\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"turn://:443\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"turn://test:test\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"turn://[:1]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"stun://example.com:8080/pathname?search#hash\",\n    \"base\": null,\n    \"href\": \"stun://example.com:8080/pathname?search#hash\",\n    \"origin\": \"null\",\n    \"protocol\": \"stun:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.com:8080\",\n    \"hostname\": \"example.com\",\n    \"port\": \"8080\",\n    \"pathname\": \"/pathname\",\n    \"search\": \"?search\",\n    \"hash\": \"#hash\"\n  },\n  {\n    \"input\": \"stun:///test\",\n    \"base\": null,\n    \"href\": \"stun:///test\",\n    \"origin\": \"null\",\n    \"protocol\": \"stun:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/test\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"stun://test/a/../b\",\n    \"base\": null,\n    \"href\": \"stun://test/b\",\n    \"origin\": \"null\",\n    \"protocol\": \"stun:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/b\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"stun://:443\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"stun://test:test\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"stun://[:1]\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"w://x:0\",\n    \"base\": null,\n    \"href\": \"w://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"w:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"west://x:0\",\n    \"base\": null,\n    \"href\": \"west://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"west:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"android://x:0/a\",\n    \"base\": null,\n    \"href\": \"android://x:0/a\",\n    \"origin\": \"null\",\n    \"protocol\": \"android:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"/a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"drivefs://x:0/a\",\n    \"base\": null,\n    \"href\": \"drivefs://x:0/a\",\n    \"origin\": \"null\",\n    \"protocol\": \"drivefs:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"/a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"chromeos-steam://x:0/a\",\n    \"base\": null,\n    \"href\": \"chromeos-steam://x:0/a\",\n    \"origin\": \"null\",\n    \"protocol\": \"chromeos-steam:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"/a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"steam://x:0/a\",\n    \"base\": null,\n    \"href\": \"steam://x:0/a\",\n    \"origin\": \"null\",\n    \"protocol\": \"steam:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"/a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"materialized-view://x:0/a\",\n    \"base\": null,\n    \"href\": \"materialized-view://x:0/a\",\n    \"origin\": \"null\",\n    \"protocol\": \"materialized-view:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"/a\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"android-app://x:0\",\n    \"base\": null,\n    \"href\": \"android-app://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"android-app:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"chrome-distiller://x:0\",\n    \"base\": null,\n    \"href\": \"chrome-distiller://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"chrome-distiller:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"chrome-extension://x:0\",\n    \"base\": null,\n    \"href\": \"chrome-extension://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"chrome-extension:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"chrome-native://x:0\",\n    \"base\": null,\n    \"href\": \"chrome-native://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"chrome-native:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"chrome-resource://x:0\",\n    \"base\": null,\n    \"href\": \"chrome-resource://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"chrome-resource:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"chrome-search://x:0\",\n    \"base\": null,\n    \"href\": \"chrome-search://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"chrome-search:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"fuchsia-dir://x:0\",\n    \"base\": null,\n    \"href\": \"fuchsia-dir://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"fuchsia-dir:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"isolated-app://x:0\",\n    \"base\": null,\n    \"href\": \"isolated-app://x:0\",\n    \"origin\": \"null\",\n    \"protocol\": \"isolated-app:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"x:0\",\n    \"hostname\": \"x\",\n    \"port\": \"0\",\n    \"pathname\": \"\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"Scheme relative path starting with multiple slashes\",\n  {\n    \"input\": \"///test\",\n    \"base\": \"http://example.org/\",\n    \"href\": \"http://test/\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///\\\\//\\\\//test\",\n    \"base\": \"http://example.org/\",\n    \"href\": \"http://test/\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"test\",\n    \"hostname\": \"test\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///example.org/path\",\n    \"base\": \"http://example.org/\",\n    \"href\": \"http://example.org/path\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///example.org/../path\",\n    \"base\": \"http://example.org/\",\n    \"href\": \"http://example.org/path\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///example.org/../../\",\n    \"base\": \"http://example.org/\",\n    \"href\": \"http://example.org/\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///example.org/../path/../../\",\n    \"base\": \"http://example.org/\",\n    \"href\": \"http://example.org/\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///example.org/../path/../../path\",\n    \"base\": \"http://example.org/\",\n    \"href\": \"http://example.org/path\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/\\\\/\\\\//example.org/../path\",\n    \"base\": \"http://example.org/\",\n    \"href\": \"http://example.org/path\",\n    \"protocol\": \"http:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"example.org\",\n    \"hostname\": \"example.org\",\n    \"port\": \"\",\n    \"pathname\": \"/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"///abcdef/../\",\n    \"base\": \"file:///\",\n    \"href\": \"file:///\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"/\\\\//\\\\/a/../\",\n    \"base\": \"file:///\",\n    \"href\": \"file://////\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"////\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"//a/../\",\n    \"base\": \"file:///\",\n    \"href\": \"file://a/\",\n    \"protocol\": \"file:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"a\",\n    \"hostname\": \"a\",\n    \"port\": \"\",\n    \"pathname\": \"/\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  \"# Non-special URL and backslashes\",\n  {\n    \"input\": \"non-special:\\\\\\\\opaque\",\n    \"base\": null,\n    \"href\": \"non-special:\\\\\\\\opaque\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\\\\\\\\opaque\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special:\\\\\\\\opaque/path\",\n    \"base\": null,\n    \"href\": \"non-special:\\\\\\\\opaque/path\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\\\\\\\\opaque/path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special:\\\\\\\\opaque\\\\path\",\n    \"base\": null,\n    \"href\": \"non-special:\\\\\\\\opaque\\\\path\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\\\\\\\\opaque\\\\path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special:\\\\/opaque\",\n    \"base\": null,\n    \"href\": \"non-special:\\\\/opaque\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"\\\\/opaque\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special:/\\\\path\",\n    \"base\": null,\n    \"href\": \"non-special:/\\\\path\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"/\\\\path\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"input\": \"non-special://host\\\\a\",\n    \"base\": null,\n    \"failure\": true\n  },\n  {\n    \"input\": \"non-special://host/a\\\\b\",\n    \"base\": null,\n    \"href\": \"non-special://host/a\\\\b\",\n    \"origin\": \"null\",\n    \"protocol\": \"non-special:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"host\",\n    \"hostname\": \"host\",\n    \"port\": \"\",\n    \"pathname\": \"/a\\\\b\",\n    \"search\": \"\",\n    \"hash\": \"\"\n  },\n  {\n    \"comment\": \"Fragment with <> on data: URI\",\n    \"input\": \"data:text/plain,test#<foo> <bar>\",\n    \"base\": null,\n    \"href\": \"data:text/plain,test#%3Cfoo%3E%20%3Cbar%3E\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"text/plain,test\",\n    \"search\": \"\",\n    \"hash\": \"#%3Cfoo%3E%20%3Cbar%3E\"\n  },\n  {\n    \"comment\": \"Fragment with <> on about:blank\",\n    \"input\": \"about:blank#<foo> <bar>\",\n    \"base\": null,\n    \"href\": \"about:blank#%3Cfoo%3E%20%3Cbar%3E\",\n    \"protocol\": \"about:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"blank\",\n    \"search\": \"\",\n    \"hash\": \"#%3Cfoo%3E%20%3Cbar%3E\"\n  },\n  {\n    \"comment\": \"Fragment percent-encode set on data: URI; tabs and newlines are removed\",\n    \"input\":\"data:text/plain,test#\\u0000\\u0001\\t\\n\\r\\u001f !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~\\u007f\\u0080\\u0081Éé\",\n    \"base\": null,\n    \"href\": \"data:text/plain,test#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\",\n    \"protocol\": \"data:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"text/plain,test\",\n    \"search\": \"\",\n    \"hash\": \"#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\"\n  },\n  {\n    \"comment\": \"Fragment percent-encode set on about:blank; tabs and newlines are removed\",\n    \"input\": \"about:blank#\\u0000\\u0001\\t\\n\\r\\u001f !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~\\u007f\\u0080\\u0081Éé\",\n    \"base\": null,\n    \"href\": \"about:blank#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\",\n    \"protocol\": \"about:\",\n    \"username\": \"\",\n    \"password\": \"\",\n    \"host\": \"\",\n    \"hostname\": \"\",\n    \"port\": \"\",\n    \"pathname\": \"blank\",\n    \"search\": \"\",\n    \"hash\": \"#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\"\n  }\n]\n"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/resources/org/wiremock/url/whatwg/whatwg_invalid_wiremock_invalid.json",
    "content": "[\n{ \"input\": \"\\\\\\\\\\\\.\\\\Y:\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `\\\\\\\\\\\\.\\\\Y:`\", \"exceptionCauseType\": \"IllegalScheme\", \"exceptionCauseMessage\": \"Illegal scheme `\\\\\\\\\\\\.\\\\Y`; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\", \"source\": { \"input\": \"\\\\\\\\\\\\.\\\\Y:\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true } },\n{ \"input\": \"\\\\\\\\\\\\.\\\\y:\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `\\\\\\\\\\\\.\\\\y:`\", \"exceptionCauseType\": \"IllegalScheme\", \"exceptionCauseMessage\": \"Illegal scheme `\\\\\\\\\\\\.\\\\y`; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\", \"source\": { \"input\": \"\\\\\\\\\\\\.\\\\y:\", \"relativeTo\": \"non-opaque-path-base\", \"failure\": true } },\n{ \"input\": \"asdf://%43|/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `asdf://%43|/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `%43|`\", \"source\": { \"input\": \"asdf://%43|/\", \"failure\": true } },\n{ \"input\": \"data://[:1]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `data://[:1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[:1]`\", \"source\": { \"input\": \"data://[:1]\", \"failure\": true } },\n{ \"input\": \"data://test:test\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `data://test:test`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `test:test`\", \"source\": { \"input\": \"data://test:test\", \"failure\": true } },\n{ \"input\": \"file://%43|\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `file://%43|`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `%43|`\", \"source\": { \"input\": \"file://%43|\", \"failure\": true } },\n{ \"input\": \"file://[example]/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `file://[example]/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[example]`\", \"source\": { \"input\": \"file://[example]/\", \"failure\": true } },\n{ \"input\": \"file://example%/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `file://example%/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `example%`\", \"source\": { \"input\": \"file://example%/\", \"failure\": true } },\n{ \"input\": \"file://example:test/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `file://example:test/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `example:test`\", \"source\": { \"input\": \"file://example:test/\", \"failure\": true } },\n{ \"input\": \"file://­/p\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `file://­/p`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `­`\", \"source\": { \"input\": \"file://­/p\", \"failure\": true } },\n{ \"input\": \"http://%3g%78%63%30%2e%30%32%35%30%2E.01\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://%3g%78%63%30%2e%30%32%35%30%2E.01`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `%3g%78%63%30%2e%30%32%35%30%2E.01`\", \"source\": { \"input\": \"http://%3g%78%63%30%2e%30%32%35%30%2E.01\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://%5B::1]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://%5B::1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `%5B::1]`\", \"source\": { \"input\": \"http://%5B::1]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://%zz%66%a.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://%zz%66%a.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `%zz%66%a.com`\", \"source\": { \"input\": \"http://%zz%66%a.com\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://192.168.0.1 hello\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://192.168.0.1 hello`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `192.168.0.1 hello`\", \"source\": { \"input\": \"http://192.168.0.1 hello\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://2001::1\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://2001::1`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `2001::1`\", \"source\": { \"input\": \"http://2001::1\", \"base\": \"http://example.org/foo/bar\", \"failure\": true } },\n{ \"input\": \"http://2001::1]\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://2001::1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `2001::1]`\", \"source\": { \"input\": \"http://2001::1]\", \"base\": \"http://example.org/foo/bar\", \"failure\": true } },\n{ \"input\": \"http://2001::1]:80\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://2001::1]:80`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `2001::1]:80`\", \"source\": { \"input\": \"http://2001::1]:80\", \"base\": \"http://example.org/foo/bar\", \"failure\": true } },\n{ \"input\": \"http://@:www.example.com\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://@:www.example.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `@:www.example.com`\", \"source\": { \"input\": \"http://@:www.example.com\", \"failure\": true } },\n{ \"input\": \"http://GOO 　goo.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://GOO 　goo.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `GOO 　goo.com`\", \"source\": { \"input\": \"http://GOO 　goo.com\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://Goo%20 goo%7C|.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://Goo%20 goo%7C|.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `Goo%20 goo%7C|.com`\", \"source\": { \"input\": \"http://Goo%20 goo%7C|.com\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[0:1:2:3:4:5:6:7:8]\", \"base\": \"http://example.net/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[0:1:2:3:4:5:6:7:8]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[0:1:2:3:4:5:6:7:8]`\", \"source\": { \"input\": \"http://[0:1:2:3:4:5:6:7:8]\", \"base\": \"http://example.net/\", \"failure\": true } },\n{ \"input\": \"http://[1::2]:3:4\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[1::2]:3:4`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[1::2]:3:4`\", \"source\": { \"input\": \"http://[1::2]:3:4\", \"base\": \"http://example.org/foo/bar\", \"failure\": true } },\n{ \"input\": \"http://[::%31]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[::%31]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[::%31]`\", \"source\": { \"input\": \"http://[::%31]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[::.1.2]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[::.1.2]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[::.1.2]`\", \"source\": { \"input\": \"http://[::.1.2]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[::.1]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[::.1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[::.1]`\", \"source\": { \"input\": \"http://[::.1]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[::1.2.3.4x]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[::1.2.3.4x]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[::1.2.3.4x]`\", \"source\": { \"input\": \"http://[::1.2.3.4x]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[::1.2.3.]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[::1.2.3.]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[::1.2.3.]`\", \"source\": { \"input\": \"http://[::1.2.3.]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[::1.2.]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[::1.2.]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[::1.2.]`\", \"source\": { \"input\": \"http://[::1.2.]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[::1.]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[::1.]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[::1.]`\", \"source\": { \"input\": \"http://[::1.]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[::127.0.0.0.1]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[::127.0.0.0.1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[::127.0.0.0.1]`\", \"source\": { \"input\": \"http://[::127.0.0.0.1]\", \"failure\": true } },\n{ \"input\": \"http://[::127.0.0.1.]\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[::127.0.0.1.]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[::127.0.0.1.]`\", \"source\": { \"input\": \"http://[::127.0.0.1.]\", \"base\": \"http://example.org/foo/bar\", \"failure\": true } },\n{ \"input\": \"http://[:]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[:]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[:]`\", \"source\": { \"input\": \"http://[:]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[]`\", \"source\": { \"input\": \"http://[]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[google.com]\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[google.com]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[google.com]`\", \"source\": { \"input\": \"http://[google.com]\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://[www.google.com]/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://[www.google.com]/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[www.google.com]`\", \"source\": { \"input\": \"http://[www.google.com]/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0000b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0000b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0000b`\", \"source\": { \"input\": \"http://a\\u0000b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0001b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0001b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0001b`\", \"source\": { \"input\": \"http://a\\u0001b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0002b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0002b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0002b`\", \"source\": { \"input\": \"http://a\\u0002b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0003b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0003b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0003b`\", \"source\": { \"input\": \"http://a\\u0003b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0004b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0004b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0004b`\", \"source\": { \"input\": \"http://a\\u0004b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0005b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0005b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0005b`\", \"source\": { \"input\": \"http://a\\u0005b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0006b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0006b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0006b`\", \"source\": { \"input\": \"http://a\\u0006b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0007b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0007b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0007b`\", \"source\": { \"input\": \"http://a\\u0007b/\", \"failure\": true } },\n{ \"input\": \"http://a\\bb/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\bb/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\bb`\", \"source\": { \"input\": \"http://a\\bb/\", \"failure\": true } },\n{ \"input\": \"http://a\\u000Bb/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u000Bb/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u000Bb`\", \"source\": { \"input\": \"http://a\\u000Bb/\", \"failure\": true } },\n{ \"input\": \"http://a\\fb/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\fb/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\fb`\", \"source\": { \"input\": \"http://a\\fb/\", \"failure\": true } },\n{ \"input\": \"http://a\\u000Eb/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u000Eb/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u000Eb`\", \"source\": { \"input\": \"http://a\\u000Eb/\", \"failure\": true } },\n{ \"input\": \"http://a\\u000Fb/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u000Fb/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u000Fb`\", \"source\": { \"input\": \"http://a\\u000Fb/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0010b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0010b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0010b`\", \"source\": { \"input\": \"http://a\\u0010b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0011b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0011b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0011b`\", \"source\": { \"input\": \"http://a\\u0011b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0012b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0012b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0012b`\", \"source\": { \"input\": \"http://a\\u0012b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0013b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0013b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0013b`\", \"source\": { \"input\": \"http://a\\u0013b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0014b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0014b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0014b`\", \"source\": { \"input\": \"http://a\\u0014b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0015b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0015b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0015b`\", \"source\": { \"input\": \"http://a\\u0015b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0016b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0016b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0016b`\", \"source\": { \"input\": \"http://a\\u0016b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0017b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0017b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0017b`\", \"source\": { \"input\": \"http://a\\u0017b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0018b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0018b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0018b`\", \"source\": { \"input\": \"http://a\\u0018b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u0019b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u0019b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0019b`\", \"source\": { \"input\": \"http://a\\u0019b/\", \"failure\": true } },\n{ \"input\": \"http://a\\u001Ab/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u001Ab/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u001Ab`\", \"source\": { \"input\": \"http://a\\u001Ab/\", \"failure\": true } },\n{ \"input\": \"http://a\\u001Bb/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u001Bb/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u001Bb`\", \"source\": { \"input\": \"http://a\\u001Bb/\", \"failure\": true } },\n{ \"input\": \"http://a\\u001Cb/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u001Cb/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u001Cb`\", \"source\": { \"input\": \"http://a\\u001Cb/\", \"failure\": true } },\n{ \"input\": \"http://a\\u001Db/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u001Db/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u001Db`\", \"source\": { \"input\": \"http://a\\u001Db/\", \"failure\": true } },\n{ \"input\": \"http://a\\u001Eb/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u001Eb/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u001Eb`\", \"source\": { \"input\": \"http://a\\u001Eb/\", \"failure\": true } },\n{ \"input\": \"http://a\\u001Fb/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a\\u001Fb/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u001Fb`\", \"source\": { \"input\": \"http://a\\u001Fb/\", \"failure\": true } },\n{ \"input\": \"http://a b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a b`\", \"source\": { \"input\": \"http://a b/\", \"failure\": true } },\n{ \"input\": \"http://a%b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a%b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a%b`\", \"source\": { \"input\": \"http://a%b/\", \"failure\": true } },\n{ \"input\": \"http://a<b\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a<b`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a<b`\", \"source\": { \"input\": \"http://a<b\", \"failure\": true } },\n{ \"input\": \"http://a>b\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a>b`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a>b`\", \"source\": { \"input\": \"http://a>b\", \"failure\": true } },\n{ \"input\": \"http://a[b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a[b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a[b`\", \"source\": { \"input\": \"http://a[b/\", \"failure\": true } },\n{ \"input\": \"http://a]b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a]b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a]b`\", \"source\": { \"input\": \"http://a]b/\", \"failure\": true } },\n{ \"input\": \"http://a^b\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a^b`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a^b`\", \"source\": { \"input\": \"http://a^b\", \"failure\": true } },\n{ \"input\": \"http://a|b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a|b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a|b`\", \"source\": { \"input\": \"http://a|b/\", \"failure\": true } },\n{ \"input\": \"http://ab/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://ab/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ab`\", \"source\": { \"input\": \"http://ab/\", \"failure\": true } },\n{ \"input\": \"http://example example.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://example example.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `example example.com`\", \"source\": { \"input\": \"http://example example.com\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://f: /c\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://f: /c`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `f: `\", \"source\": { \"input\": \"http://f: /c\", \"base\": \"http://example.org/foo/bar\", \"failure\": true } },\n{ \"input\": \"http://f: 21 / b ? d # e \", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://f: 21 / b ? d # e `\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `f: 21 `\", \"source\": { \"input\": \"http://f: 21 / b ? d # e \", \"base\": \"http://example.org/foo/bar\", \"failure\": true } },\n{ \"input\": \"http://f:18446744073709551697/c\", \"base\": \"http://example.org/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://f:18446744073709551697/c`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `f:18446744073709551697`\", \"source\": { \"input\": \"http://f:18446744073709551697/c\", \"base\": \"http://example.org/\", \"failure\": true } },\n{ \"input\": \"http://f:340282366920938463463374607431768211537/c\", \"base\": \"http://example.org/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://f:340282366920938463463374607431768211537/c`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `f:340282366920938463463374607431768211537`\", \"source\": { \"input\": \"http://f:340282366920938463463374607431768211537/c\", \"base\": \"http://example.org/\", \"failure\": true } },\n{ \"input\": \"http://f:4294967377/c\", \"base\": \"http://example.org/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://f:4294967377/c`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `f:4294967377`\", \"source\": { \"input\": \"http://f:4294967377/c\", \"base\": \"http://example.org/\", \"failure\": true } },\n{ \"input\": \"http://f:b/c\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://f:b/c`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `f:b`\", \"source\": { \"input\": \"http://f:b/c\", \"base\": \"http://example.org/foo/bar\", \"failure\": true } },\n{ \"input\": \"http://f:fifty-two/c\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://f:fifty-two/c`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `f:fifty-two`\", \"source\": { \"input\": \"http://f:fifty-two/c\", \"base\": \"http://example.org/foo/bar\", \"failure\": true } },\n{ \"input\": \"http://foo:-80/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://foo:-80/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `foo:-80`\", \"source\": { \"input\": \"http://foo:-80/\", \"failure\": true } },\n{ \"input\": \"http://\\uD83D\\uDCA9.123/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://\\uD83D\\uDCA9.123/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `\\uD83D\\uDCA9.123`\", \"source\": { \"input\": \"http://\\uD83D\\uDCA9.123/\", \"failure\": true } },\n{ \"input\": \"http://﷐zyx.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://﷐zyx.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `﷐zyx.com`\", \"source\": { \"input\": \"http://﷐zyx.com\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://％００.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://％００.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `％００.com`\", \"source\": { \"input\": \"http://％００.com\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"http://％４１.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://％４１.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `％４１.com`\", \"source\": { \"input\": \"http://％４１.com\", \"base\": \"http://other.com/\", \"failure\": true } },\n{ \"input\": \"https://\\u0000y\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://\\u0000y`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `\\u0000y`\", \"source\": { \"input\": \"https://\\u0000y\", \"failure\": true } },\n{ \"input\": \"https://[0:.0]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://[0:.0]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[0:.0]`\", \"source\": { \"input\": \"https://[0:.0]\", \"failure\": true } },\n{ \"input\": \"https://[0:0:]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://[0:0:]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[0:0:]`\", \"source\": { \"input\": \"https://[0:0:]\", \"failure\": true } },\n{ \"input\": \"https://[0:1.00.0.0.0]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://[0:1.00.0.0.0]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[0:1.00.0.0.0]`\", \"source\": { \"input\": \"https://[0:1.00.0.0.0]\", \"failure\": true } },\n{ \"input\": \"https://[0:1.23.23]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://[0:1.23.23]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[0:1.23.23]`\", \"source\": { \"input\": \"https://[0:1.23.23]\", \"failure\": true } },\n{ \"input\": \"https://[0:1.290.0.0.0]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://[0:1.290.0.0.0]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[0:1.290.0.0.0]`\", \"source\": { \"input\": \"https://[0:1.290.0.0.0]\", \"failure\": true } },\n{ \"input\": \"https://[0:1:2:3:4:5:6:7.0.0.0.1]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://[0:1:2:3:4:5:6:7.0.0.0.1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[0:1:2:3:4:5:6:7.0.0.0.1]`\", \"source\": { \"input\": \"https://[0:1:2:3:4:5:6:7.0.0.0.1]\", \"failure\": true } },\n{ \"input\": \"https://[0::0::0]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://[0::0::0]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[0::0::0]`\", \"source\": { \"input\": \"https://[0::0::0]\", \"failure\": true } },\n{ \"input\": \"https://x x:12\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://x x:12`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `x x:12`\", \"source\": { \"input\": \"https://x x:12\", \"failure\": true } },\n{ \"input\": \"https://­/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://­/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `­`\", \"source\": { \"input\": \"https://­/\", \"failure\": true } },\n{ \"input\": \"https://�\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://�`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `�`\", \"source\": { \"input\": \"https://�\", \"failure\": true } },\n{ \"input\": \"https://￿y\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://￿y`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `￿y`\", \"source\": { \"input\": \"https://￿y\", \"failure\": true } },\n{ \"input\": \"intent://[:1]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `intent://[:1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[:1]`\", \"source\": { \"input\": \"intent://[:1]\", \"failure\": true } },\n{ \"input\": \"intent://test:test\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `intent://test:test`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `test:test`\", \"source\": { \"input\": \"intent://test:test\", \"failure\": true } },\n{ \"input\": \"javascript://[:1]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `javascript://[:1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[:1]`\", \"source\": { \"input\": \"javascript://[:1]\", \"failure\": true } },\n{ \"input\": \"javascript://test:test\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `javascript://test:test`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `test:test`\", \"source\": { \"input\": \"javascript://test:test\", \"failure\": true } },\n{ \"input\": \"mailto://[:1]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `mailto://[:1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[:1]`\", \"source\": { \"input\": \"mailto://[:1]\", \"failure\": true } },\n{ \"input\": \"mailto://test:test\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `mailto://test:test`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `test:test`\", \"source\": { \"input\": \"mailto://test:test\", \"failure\": true } },\n{ \"input\": \"non-special://[:80/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `non-special://[:80/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[:80`\", \"source\": { \"input\": \"non-special://[:80/\", \"failure\": true } },\n{ \"input\": \"non-special://host\\\\a\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `non-special://host\\\\a`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `host\\\\a`\", \"source\": { \"input\": \"non-special://host\\\\a\", \"failure\": true } },\n{ \"input\": \"sc://a\\u0000b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://a\\u0000b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\u0000b`\", \"source\": { \"input\": \"sc://a\\u0000b/\", \"failure\": true } },\n{ \"input\": \"sc://a b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://a b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a b`\", \"source\": { \"input\": \"sc://a b/\", \"failure\": true } },\n{ \"input\": \"sc://a<b\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://a<b`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a<b`\", \"source\": { \"input\": \"sc://a<b\", \"failure\": true } },\n{ \"input\": \"sc://a>b\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://a>b`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a>b`\", \"source\": { \"input\": \"sc://a>b\", \"failure\": true } },\n{ \"input\": \"sc://a[b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://a[b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a[b`\", \"source\": { \"input\": \"sc://a[b/\", \"failure\": true } },\n{ \"input\": \"sc://a\\\\b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://a\\\\b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a\\\\b`\", \"source\": { \"input\": \"sc://a\\\\b/\", \"failure\": true } },\n{ \"input\": \"sc://a]b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://a]b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a]b`\", \"source\": { \"input\": \"sc://a]b/\", \"failure\": true } },\n{ \"input\": \"sc://a^b\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://a^b`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a^b`\", \"source\": { \"input\": \"sc://a^b\", \"failure\": true } },\n{ \"input\": \"sc://a|b/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://a|b/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a|b`\", \"source\": { \"input\": \"sc://a|b/\", \"failure\": true } },\n{ \"input\": \"sc://te@s:t@/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://te@s:t@/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `te@s:t@`\", \"source\": { \"input\": \"sc://te@s:t@/\", \"failure\": true } },\n{ \"input\": \"stun://[:1]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `stun://[:1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[:1]`\", \"source\": { \"input\": \"stun://[:1]\", \"failure\": true } },\n{ \"input\": \"stun://test:test\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `stun://test:test`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `test:test`\", \"source\": { \"input\": \"stun://test:test\", \"failure\": true } },\n{ \"input\": \"turn://[:1]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `turn://[:1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[:1]`\", \"source\": { \"input\": \"turn://[:1]\", \"failure\": true } },\n{ \"input\": \"turn://test:test\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `turn://test:test`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `test:test`\", \"source\": { \"input\": \"turn://test:test\", \"failure\": true } },\n{ \"input\": \"urn://[:1]\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `urn://[:1]`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `[:1]`\", \"source\": { \"input\": \"urn://[:1]\", \"failure\": true } },\n{ \"input\": \"urn://test:test\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `urn://test:test`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `test:test`\", \"source\": { \"input\": \"urn://test:test\", \"failure\": true } }\n]"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/resources/org/wiremock/url/whatwg/whatwg_invalid_wiremock_valid.json",
    "content": "[\n  {\n    \"input\" : \"\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"#\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#\", \"relativeTo\" : \"any-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"../i\",\n    \"base\" : \"sc:sd\",\n    \"inputExpected\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"../i\", \"base\" : \"sc:sd\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"../i\",\n    \"base\" : \"sc:sd/sd\",\n    \"inputExpected\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:sd/i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"../i\", \"base\" : \"sc:sd/sd\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/i\",\n    \"base\" : \"sc:sd\",\n    \"inputExpected\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:/i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"/i\", \"base\" : \"sc:sd\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/i\",\n    \"base\" : \"sc:sd/sd\",\n    \"inputExpected\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:/i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"/i\", \"base\" : \"sc:sd/sd\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"?\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"?\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"?\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"?\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"?\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"?i\",\n    \"base\" : \"sc:sd\",\n    \"inputExpected\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:sd?i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : \"i\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"?i\", \"base\" : \"sc:sd\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"?i\",\n    \"base\" : \"sc:sd/sd\",\n    \"inputExpected\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:sd/sd?i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : \"i\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"?i\", \"base\" : \"sc:sd/sd\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"a\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"a\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"a\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"a\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"a\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"a/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"a/\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"a/\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"a/\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"a/\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"a//\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"a//\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a//\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"a//\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a//\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"a//\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a//\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"a//\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"data://:443\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"data://:443\", \"type\" : \"Origin\", \"scheme\" : \"data\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"data://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"data\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"data://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"data\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"data://:443\", \"type\" : \"Origin\", \"scheme\" : \"data\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"data://:443\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://%43%3A\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://%43%3A\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"%43%3A\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%3A\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://%43%3A/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"%43%3A\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%3A\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://%43%3A/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"%43%3A\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%3A\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://%43%3A\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"%43%3A\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%3A\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://%43%3A\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://%43%7C\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://%43%7C\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://%43%7C\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://%43%7C\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://%43%7C/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://%43%7C\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://%43%7C/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://%C2%AD/p\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://%C2%AD/p\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"%C2%AD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%C2%AD\", \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://%C2%AD/p\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"%C2%AD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%C2%AD\", \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://%C2%AD/p\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"%C2%AD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%C2%AD\", \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://%C2%AD\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"%C2%AD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%C2%AD\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://%C2%AD/p\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://C%7C\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://C%7C\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"C%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"C%7C\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://c%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"c%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"c%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://c%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"c%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"c%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://c%7C\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"c%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"c%7C\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://C%7C\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://example:1/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://example:1/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"example:1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example\", \"port\" : \"1\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://example:1/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"example:1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example\", \"port\" : \"1\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://example:1/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"example:1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example\", \"port\" : \"1\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://example:1\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"example:1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example\", \"port\" : \"1\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://example:1/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://xn--/p\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://xn--/p\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"xn--\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"xn--\", \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://xn--/p\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"xn--\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"xn--\", \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://xn--/p\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"xn--\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"xn--\", \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://xn--\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"xn--\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"xn--\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://xn--/p\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ftp://example.com%80/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ftp://example.com%80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"example.com%80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%80\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftp://example.com%80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"example.com%80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%80\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ftp://example.com%80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"example.com%80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%80\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ftp://example.com%80\", \"type\" : \"Origin\", \"scheme\" : \"ftp\", \"authority\" : \"example.com%80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%80\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ftp://example.com%80/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ftp://example.com%A0/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ftp://example.com%A0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"example.com%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%A0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftp://example.com%A0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"example.com%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%A0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ftp://example.com%A0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"example.com%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%A0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ftp://example.com%A0\", \"type\" : \"Origin\", \"scheme\" : \"ftp\", \"authority\" : \"example.com%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%A0\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ftp://example.com%A0/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:\",\n    \"base\" : \"https://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"https://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"https://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:\", \"base\" : \"https://example.org/foo/bar\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://#\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http:///#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : \"\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:///#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : \"\" },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://#\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://%25\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://%25\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"%25\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%25\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://%25/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%25\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%25\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://%25/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%25\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%25\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://%25\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"%25\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%25\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://%25\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://%ef%b7%90zyx.com\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://%ef%b7%90zyx.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%ef%b7%90zyx.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%ef%b7%90zyx.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://%EF%B7%90zyx.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%EF%B7%90zyx.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%B7%90zyx.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://%EF%B7%90zyx.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%EF%B7%90zyx.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%B7%90zyx.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://%EF%B7%90zyx.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"%EF%B7%90zyx.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%B7%90zyx.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://%ef%b7%90zyx.com\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://%ef%bc%85%ef%bc%90%ef%bc%90.com\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://%ef%bc%85%ef%bc%90%ef%bc%90.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%ef%bc%85%ef%bc%90%ef%bc%90.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%ef%bc%85%ef%bc%90%ef%bc%90.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://%EF%BC%85%EF%BC%90%EF%BC%90.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%EF%BC%85%EF%BC%90%EF%BC%90.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BC%85%EF%BC%90%EF%BC%90.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://%EF%BC%85%EF%BC%90%EF%BC%90.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%EF%BC%85%EF%BC%90%EF%BC%90.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BC%85%EF%BC%90%EF%BC%90.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://%EF%BC%85%EF%BC%90%EF%BC%90.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"%EF%BC%85%EF%BC%90%EF%BC%90.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BC%85%EF%BC%90%EF%BC%90.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://%ef%bc%85%ef%bc%90%ef%bc%90.com\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://%ef%bc%85%ef%bc%94%ef%bc%91.com\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://%ef%bc%85%ef%bc%94%ef%bc%91.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%ef%bc%85%ef%bc%94%ef%bc%91.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%ef%bc%85%ef%bc%94%ef%bc%91.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://%EF%BC%85%EF%BC%94%EF%BC%91.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%EF%BC%85%EF%BC%94%EF%BC%91.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BC%85%EF%BC%94%EF%BC%91.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://%EF%BC%85%EF%BC%94%EF%BC%91.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%EF%BC%85%EF%BC%94%EF%BC%91.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BC%85%EF%BC%94%EF%BC%91.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://%EF%BC%85%EF%BC%94%EF%BC%91.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"%EF%BC%85%EF%BC%94%EF%BC%91.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BC%85%EF%BC%94%EF%BC%91.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://%ef%bc%85%ef%bc%94%ef%bc%91.com\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://0..0x300./\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://0..0x300./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0..0x300.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0..0x300.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0..0x300./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0..0x300.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0..0x300.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://0..0x300./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0..0x300.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0..0x300.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0..0x300.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0..0x300.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0..0x300.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0..0x300./\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://0..0x300/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://0..0x300/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0..0x300\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0..0x300\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0..0x300/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0..0x300\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0..0x300\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://0..0x300/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0..0x300\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0..0x300\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0..0x300\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0..0x300\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0..0x300\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0..0x300/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://01.2.3.4.5\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://01.2.3.4.5\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"01.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"01.2.3.4.5\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://01.2.3.4.5/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"01.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"01.2.3.4.5\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://01.2.3.4.5/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"01.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"01.2.3.4.5\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://01.2.3.4.5\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"01.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"01.2.3.4.5\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://01.2.3.4.5\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://01.2.3.4.5.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://01.2.3.4.5.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"01.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"01.2.3.4.5.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://01.2.3.4.5./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"01.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"01.2.3.4.5.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://01.2.3.4.5./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"01.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"01.2.3.4.5.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://01.2.3.4.5.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"01.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"01.2.3.4.5.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://01.2.3.4.5.\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://09.2.3.4\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://09.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"09.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"09.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://09.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"09.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"09.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://09.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"09.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"09.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://09.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"09.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"09.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://09.2.3.4\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://09.2.3.4.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://09.2.3.4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"09.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"09.2.3.4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://09.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"09.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"09.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://09.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"09.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"09.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://09.2.3.4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"09.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"09.2.3.4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://09.2.3.4.\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://0999999999999999999/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://0999999999999999999/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0999999999999999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0999999999999999999\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0999999999999999999/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0999999999999999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0999999999999999999\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://0999999999999999999/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0999999999999999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0999999999999999999\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0999999999999999999\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0999999999999999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0999999999999999999\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0999999999999999999/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://0x1.2.3.4.5\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://0x1.2.3.4.5\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x1.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x1.2.3.4.5\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0x1.2.3.4.5/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x1.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x1.2.3.4.5\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://0x1.2.3.4.5/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x1.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x1.2.3.4.5\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0x1.2.3.4.5\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x1.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x1.2.3.4.5\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0x1.2.3.4.5\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://0x1.2.3.4.5.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://0x1.2.3.4.5.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x1.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x1.2.3.4.5.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0x1.2.3.4.5./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x1.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x1.2.3.4.5.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://0x1.2.3.4.5./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x1.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x1.2.3.4.5.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0x1.2.3.4.5.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x1.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x1.2.3.4.5.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0x1.2.3.4.5.\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://0x100.2.3.4\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://0x100.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x100.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0x100.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x100.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://0x100.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x100.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0x100.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x100.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0x100.2.3.4\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://0x100.2.3.4.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://0x100.2.3.4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x100.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100.2.3.4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0x100.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x100.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://0x100.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x100.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0x100.2.3.4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x100.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100.2.3.4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0x100.2.3.4.\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://0xffffffff1\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://0xffffffff1\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0xffffffff1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0xffffffff1\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0xffffffff1/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0xffffffff1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0xffffffff1\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://0xffffffff1/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0xffffffff1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0xffffffff1\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0xffffffff1\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0xffffffff1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0xffffffff1\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0xffffffff1\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://1.2.3.08\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://1.2.3.08\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.08\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.08\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://1.2.3.08/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.08\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.08\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://1.2.3.08/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.08\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.08\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://1.2.3.08\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.08\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.08\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://1.2.3.08\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://1.2.3.08.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://1.2.3.08.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.08.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.08.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://1.2.3.08./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.08.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.08.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://1.2.3.08./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.08.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.08.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://1.2.3.08.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.08.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.08.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://1.2.3.08.\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://1.2.3.09\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://1.2.3.09\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.09\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.09\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://1.2.3.09/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.09\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.09\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://1.2.3.09/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.09\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.09\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://1.2.3.09\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.09\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.09\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://1.2.3.09\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://1.2.3.4.5\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://1.2.3.4.5\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.5\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://1.2.3.4.5/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.5\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://1.2.3.4.5/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.5\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://1.2.3.4.5\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.5\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.5\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://1.2.3.4.5\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://1.2.3.4.5.\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://1.2.3.4.5.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.5.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://1.2.3.4.5./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.5.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://1.2.3.4.5./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.5.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://1.2.3.4.5.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.5.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.5.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://1.2.3.4.5.\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://10.0.0.XN--pokxncvks\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://10.0.0.XN--pokxncvks\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.XN--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.XN--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://10.0.0.XN--pokxncvks\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://10.0.0.xN--pokxncvks\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://10.0.0.xN--pokxncvks\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xN--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xN--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://10.0.0.xN--pokxncvks\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://10.0.0.xn--pokxncvks\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://10.0.0.xn--pokxncvks\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"10.0.0.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.0.0.xn--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://10.0.0.xn--pokxncvks\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://10000000000\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://10000000000\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"10000000000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10000000000\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://10000000000/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10000000000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10000000000\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://10000000000/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10000000000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10000000000\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://10000000000\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"10000000000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10000000000\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://10000000000\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://192.168.0.257\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://192.168.0.257\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"192.168.0.257\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.0.257\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://192.168.0.257/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.168.0.257\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.0.257\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://192.168.0.257/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.168.0.257\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.0.257\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://192.168.0.257\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"192.168.0.257\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.0.257\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://192.168.0.257\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://256.256.256.256\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://256.256.256.256\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://256.256.256.256/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://256.256.256.256/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://256.256.256.256\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://256.256.256.256\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://256.256.256.256.256\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://256.256.256.256.256\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256.256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256.256\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://256.256.256.256.256/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256.256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256.256\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://256.256.256.256.256/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256.256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256.256\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://256.256.256.256.256\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256.256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256.256\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://256.256.256.256.256\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://256.256.256.256.256.\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://256.256.256.256.256.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256.256.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256.256.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://256.256.256.256.256./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256.256.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256.256.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://256.256.256.256.256./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256.256.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256.256.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://256.256.256.256.256.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256.256.256.256.256.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.256.256.256.256.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://256.256.256.256.256.\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://4294967296\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://4294967296\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"4294967296\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"4294967296\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://4294967296/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"4294967296\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"4294967296\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://4294967296/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"4294967296\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"4294967296\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://4294967296\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"4294967296\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"4294967296\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://4294967296\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://?\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://?\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : \"\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:///?\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:///?\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://?\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://@/www.example.com\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"@\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://@/www.example.com\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"@\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://@/www.example.com\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"@\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://@/www.example.com\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://a.b.c.XN--pokxncvks\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://a.b.c.XN--pokxncvks\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.XN--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.XN--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://a.b.c.XN--pokxncvks\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://a.b.c.Xn--pokxncvks\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://a.b.c.Xn--pokxncvks\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.Xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.Xn--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://a.b.c.Xn--pokxncvks\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://a.b.c.xn--pokxncvks\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://a.b.c.xn--pokxncvks\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"a.b.c.xn--pokxncvks\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a.b.c.xn--pokxncvks\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://a.b.c.xn--pokxncvks\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://a:b@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://a:b@/www.example.com\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"a:b@\", \"userInfo\" : \"a:b\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"\", \"port\" : null, \"path\" : \"/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://a:b@/www.example.com\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"a:b@\", \"userInfo\" : \"a:b\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"\", \"port\" : null, \"path\" : \"/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://a:b@/www.example.com\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"a:b@\", \"userInfo\" : \"a:b\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"\", \"port\" : null, \"path\" : \"/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://a:b@/www.example.com\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://f:999999/c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://f:999999/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"999999\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://f:999999/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"999999\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://f:999999/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"999999\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://f:999999\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"f:999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"999999\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://f:999999/c\", \"base\" : \"http://example.org/foo/bar\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.09\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.09\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.09\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.09/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.09\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.09/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.09\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.09\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.09\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.09\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.09.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.09.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.09.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.09./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.09.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.09./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.09.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.09.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.09.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.09.\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.0XFfFfFfFfFfFfFfFfFfAcE123\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.0XFfFfFfFfFfFfFfFfFfAcE123\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.0XFfFfFfFfFfFfFfFfFfAcE123\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0XFfFfFfFfFfFfFfFfFfAcE123\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.0xfffffffffffffffffface123/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.0xfffffffffffffffffface123\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0xfffffffffffffffffface123\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.0xfffffffffffffffffface123/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.0xfffffffffffffffffface123\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0xfffffffffffffffffface123\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.0xfffffffffffffffffface123\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.0xfffffffffffffffffface123\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0xfffffffffffffffffface123\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.0XFfFfFfFfFfFfFfFfFfAcE123\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.0x\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.0x\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.0x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.0x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.0x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.0x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.0x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.0x\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.0x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.0x\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.0x4\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.0x4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.0x4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.0x4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.0x4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.0x4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.0x4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.0x4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.0x4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.0x4\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.0x4.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.0x4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.0x4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.0x4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.0x4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.0x4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.0x4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.0x4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.0x4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.0x4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.0x4.\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.1.2.3.4\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.1.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.1.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.1.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.1.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.1.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.1.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.1.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.1.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.1.2.3.4\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.1.2.3.4.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.1.2.3.4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.1.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.1.2.3.4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.1.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.1.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.1.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.1.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.1.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.1.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.1.2.3.4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.1.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.1.2.3.4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.1.2.3.4.\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.2.3.4\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.2.3.4\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.2.3.4.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.2.3.4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.2.3.4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.2.3.4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.2.3.4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.2.3.4.\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://hello%00\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://hello%00\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"hello%00\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"hello%00\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://hello%00/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"hello%00\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"hello%00\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://hello%00/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"hello%00\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"hello%00\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://hello%00\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"hello%00\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"hello%00\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://hello%00\", \"base\" : \"http://other.com/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%00st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%00st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%00st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%00st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%00st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%00st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%00st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%00st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%00st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%00st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%00st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%00st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%00st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%00st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%01st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%01st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%01st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%01st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%01st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%01st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%01st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%01st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%01st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%01st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%01st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%01st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%01st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%01st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%02st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%02st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%02st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%02st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%02st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%02st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%02st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%02st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%02st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%02st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%02st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%02st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%02st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%02st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%03st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%03st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%03st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%03st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%03st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%03st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%03st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%03st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%03st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%03st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%03st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%03st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%03st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%03st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%04st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%04st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%04st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%04st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%04st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%04st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%04st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%04st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%04st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%04st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%04st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%04st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%04st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%04st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%05st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%05st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%05st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%05st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%05st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%05st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%05st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%05st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%05st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%05st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%05st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%05st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%05st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%05st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%06st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%06st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%06st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%06st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%06st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%06st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%06st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%06st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%06st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%06st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%06st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%06st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%06st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%06st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%07st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%07st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%07st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%07st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%07st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%07st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%07st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%07st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%07st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%07st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%07st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%07st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%07st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%07st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%08st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%08st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%08st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%08st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%08st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%08st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%08st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%08st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%08st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%08st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%08st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%08st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%08st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%08st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%09st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%09st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%09st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%09st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%09st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%09st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%09st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%09st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%09st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%09st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%09st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%09st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%09st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%09st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%0Ast/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%0Ast/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Ast\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%0Ast/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Ast\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%0Ast/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Ast\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%0Ast\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%0Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Ast\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%0Ast/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%0Bst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%0Bst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Bst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%0Bst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Bst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%0Bst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Bst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%0Bst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%0Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Bst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%0Bst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%0Cst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%0Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%0Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%0Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%0Cst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%0Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Cst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%0Cst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%0Dst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%0Dst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Dst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%0Dst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Dst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%0Dst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Dst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%0Dst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%0Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Dst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%0Dst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%0Est/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%0Est/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Est\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%0Est/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Est\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%0Est/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Est\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%0Est\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%0Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Est\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%0Est/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%0Fst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%0Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%0Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%0Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%0Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%0Fst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%0Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%0Fst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%0Fst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%10st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%10st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%10st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%10st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%10st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%10st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%10st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%10st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%10st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%10st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%10st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%10st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%10st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%10st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%11st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%11st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%11st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%11st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%11st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%11st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%11st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%11st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%11st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%11st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%11st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%11st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%11st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%11st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%12st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%12st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%12st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%12st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%12st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%12st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%12st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%12st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%12st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%12st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%12st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%12st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%12st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%12st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%13st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%13st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%13st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%13st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%13st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%13st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%13st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%13st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%13st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%13st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%13st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%13st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%13st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%13st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%14st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%14st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%14st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%14st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%14st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%14st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%14st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%14st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%14st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%14st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%14st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%14st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%14st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%14st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%15st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%15st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%15st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%15st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%15st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%15st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%15st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%15st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%15st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%15st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%15st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%15st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%15st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%15st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%16st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%16st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%16st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%16st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%16st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%16st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%16st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%16st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%16st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%16st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%16st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%16st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%16st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%16st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%17st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%17st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%17st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%17st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%17st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%17st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%17st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%17st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%17st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%17st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%17st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%17st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%17st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%17st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%18st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%18st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%18st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%18st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%18st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%18st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%18st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%18st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%18st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%18st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%18st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%18st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%18st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%18st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%19st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%19st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%19st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%19st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%19st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%19st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%19st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%19st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%19st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%19st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%19st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%19st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%19st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%19st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%1Ast/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%1Ast/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Ast\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%1Ast/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Ast\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%1Ast/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Ast\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%1Ast\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%1Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Ast\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%1Ast/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%1Bst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%1Bst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Bst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%1Bst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Bst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%1Bst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Bst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%1Bst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%1Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Bst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%1Bst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%1Cst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%1Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%1Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%1Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%1Cst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%1Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Cst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%1Cst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%1Dst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%1Dst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Dst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%1Dst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Dst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%1Dst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Dst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%1Dst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%1Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Dst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%1Dst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%1Est/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%1Est/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Est\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%1Est/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Est\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%1Est/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Est\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%1Est\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%1Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Est\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%1Est/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%1Fst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%1Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%1Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%1Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%1Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%1Fst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%1Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%1Fst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%1Fst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%20st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%20st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%20st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%20st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%20st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%20st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%20st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%20st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%20st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%20st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%20st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%20st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%20st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%20st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%23st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%23st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%23st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%23st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%23st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%23st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%23st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%23st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%23st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%23st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%23st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%23st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%23st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%23st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%25st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%25st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%25st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%25st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%25st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%25st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%25st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%25st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%25st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%25st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%25st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%25st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%25st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%25st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%2Fst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%2Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%2Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%2Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%2Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%2Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%2Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%2Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%2Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%2Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%2Fst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%2Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%2Fst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%2Fst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%3Ast/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%3Ast/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Ast\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%3Ast/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Ast\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%3Ast/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Ast\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%3Ast\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%3Ast\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Ast\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%3Ast/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%3Cst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%3Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%3Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%3Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%3Cst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%3Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Cst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%3Cst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%3Est/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%3Est/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Est\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%3Est/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Est\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%3Est/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Est\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%3Est\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%3Est\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Est\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%3Est/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%3Fst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%3Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%3Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%3Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%3Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%3Fst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%3Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%3Fst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%3Fst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%40st/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%40st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%40st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%40st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%40st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%40st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%40st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%40st/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%40st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%40st\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%40st\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%40st\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%40st\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%40st/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%5Bst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%5Bst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%5Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Bst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%5Bst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%5Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Bst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%5Bst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%5Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Bst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%5Bst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%5Bst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Bst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%5Bst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%5Cst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%5Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%5Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%5Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%5Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%5Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%5Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%5Cst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%5Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Cst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%5Cst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%5Dst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%5Dst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%5Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Dst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%5Dst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%5Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Dst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%5Dst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%5Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Dst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%5Dst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%5Dst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%5Dst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%5Dst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%7Cst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%7Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%7Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%7Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%7Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%7Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%7Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%7Cst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%7Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%7Cst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%7Cst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%7Cst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%7Cst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%7Cst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ho%7Fst/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://ho%7Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%7Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%7Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://ho%7Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%7Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%7Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://ho%7Fst/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ho%7Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%7Fst\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://ho%7Fst\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"ho%7Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho%7Fst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ho%7Fst/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://user:pass@/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://user:pass@/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://user:pass@/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://user:pass@/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://user:pass@/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://user@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://user@/www.example.com\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user@\", \"userInfo\" : \"user\", \"username\" : \"user\", \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://user@/www.example.com\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user@\", \"userInfo\" : \"user\", \"username\" : \"user\", \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://user@/www.example.com\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user@\", \"userInfo\" : \"user\", \"username\" : \"user\", \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://user@/www.example.com\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:/:@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:/:@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/:@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/:@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/:@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:/:@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/:@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/:@/www.example.com\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:/@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:/@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:/@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/@/www.example.com\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:/@:www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:/@:www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/@:www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/@:www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/@:www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:/@:www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/@:www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/@:www.example.com\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:/a:b@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:/a:b@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a:b@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/a:b@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a:b@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:/a:b@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a:b@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/a:b@/www.example.com\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http::@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http::@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http::@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http::@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http::@/www.example.com\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:@/www.example.com\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:@:www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:@:www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@:www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:@:www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@:www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:@:www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@:www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:@:www.example.com\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:a:b@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:a:b@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a:b@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:a:b@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a:b@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:a:b@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a:b@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:a:b@/www.example.com\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://%43%7C/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://%43%7C\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://%43%7C/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://%C2%AD/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://%C2%AD/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%C2%AD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%C2%AD\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://%C2%AD/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%C2%AD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%C2%AD\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://%C2%AD/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%C2%AD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%C2%AD\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://%C2%AD\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"%C2%AD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%C2%AD\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://%C2%AD/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://%EF%BF%BD\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://%EF%BF%BD\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"%EF%BF%BD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BF%BD\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://%EF%BF%BD/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%EF%BF%BD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BF%BD\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://%EF%BF%BD/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%EF%BF%BD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BF%BD\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://%EF%BF%BD\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"%EF%BF%BD\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%EF%BF%BD\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://%EF%BF%BD\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://0x100000000/test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://0x100000000/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"0x100000000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100000000\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://0x100000000/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"0x100000000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100000000\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://0x100000000/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"0x100000000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100000000\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://0x100000000\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"0x100000000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x100000000\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://0x100000000/test\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://256.0.0.1/test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://256.0.0.1/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"256.0.0.1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.0.0.1\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://256.0.0.1/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"256.0.0.1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.0.0.1\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://256.0.0.1/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"256.0.0.1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.0.0.1\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://256.0.0.1\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"256.0.0.1\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.0.0.1\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://256.0.0.1/test\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://example.com%80/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://example.com%80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com%80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%80\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://example.com%80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com%80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%80\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://example.com%80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com%80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%80\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://example.com%80\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"example.com%80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%80\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://example.com%80/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://example.com%A0/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://example.com%A0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%A0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://example.com%A0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%A0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://example.com%A0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%A0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://example.com%A0\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"example.com%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com%A0\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://example.com%A0/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://xn--/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://xn--/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"xn--\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"xn--\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://xn--/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"xn--\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"xn--\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://xn--/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"xn--\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"xn--\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://xn--\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"xn--\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"xn--\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://xn--/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https:@/www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https:@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https:@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https:@/www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@/www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"https:@/www.example.com\", \"relativeTo\" : \"non-opaque-path-base\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"i\",\n    \"base\" : \"sc:sd\",\n    \"inputExpected\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"i\", \"base\" : \"sc:sd\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"i\",\n    \"base\" : \"sc:sd/sd\",\n    \"inputExpected\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:sd/i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"i\", \"base\" : \"sc:sd/sd\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"intent://:443\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"intent://:443\", \"type\" : \"Origin\", \"scheme\" : \"intent\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"intent://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"intent\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"intent://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"intent\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"intent://:443\", \"type\" : \"Origin\", \"scheme\" : \"intent\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"intent://:443\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"javascript://:443\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"javascript://:443\", \"type\" : \"Origin\", \"scheme\" : \"javascript\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"javascript://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"javascript\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"javascript://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"javascript\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"javascript://:443\", \"type\" : \"Origin\", \"scheme\" : \"javascript\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"javascript://:443\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"mailto://:443\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"mailto://:443\", \"type\" : \"Origin\", \"scheme\" : \"mailto\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"mailto://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"mailto\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"mailto://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"mailto\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"mailto://:443\", \"type\" : \"Origin\", \"scheme\" : \"mailto\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"mailto://:443\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special://f:999999/c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"non-special://f:999999/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"f:999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"999999\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special://f:999999/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"f:999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"999999\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"non-special://f:999999/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"f:999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"999999\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"non-special://f:999999\", \"type\" : \"Origin\", \"scheme\" : \"non-special\", \"authority\" : \"f:999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"999999\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-special://f:999999/c\", \"base\" : \"http://example.org/foo/bar\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"sc://:/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"sc://:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \":\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"sc:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"sc:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"sc://:/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"sc://:12/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"sc://:12/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \":12\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"12\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"sc://:12/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \":12\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"12\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"sc://:12/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \":12\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"12\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://:12\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \":12\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"12\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"sc://:12/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"sc://@/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"sc://@/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"@\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"sc://@/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"@\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"sc://@/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"@\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"sc://@/\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"stun://:443\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"stun://:443\", \"type\" : \"Origin\", \"scheme\" : \"stun\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"stun://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"stun\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"stun://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"stun\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"stun://:443\", \"type\" : \"Origin\", \"scheme\" : \"stun\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"stun://:443\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"test-a-colon-b.html\",\n    \"base\" : \"a:b\",\n    \"inputExpected\" : { \"stringValue\" : \"test-a-colon-b.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-b.html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"test-a-colon-b.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-b.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"a:b\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"b\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"a:b\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"b\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"a:test-a-colon-b.html\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-b.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"test-a-colon-b.html\", \"base\" : \"a:b\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"test-a-colon.html\",\n    \"base\" : \"a:\",\n    \"inputExpected\" : { \"stringValue\" : \"test-a-colon.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon.html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"test-a-colon.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"a:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"a:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"a:test-a-colon.html\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"test-a-colon.html\", \"base\" : \"a:\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"turn://:443\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"turn://:443\", \"type\" : \"Origin\", \"scheme\" : \"turn\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"turn://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"turn\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"turn://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"turn\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"turn://:443\", \"type\" : \"Origin\", \"scheme\" : \"turn\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"turn://:443\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"urn://:443\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"urn://:443\", \"type\" : \"Origin\", \"scheme\" : \"urn\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"urn://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"urn\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"urn://:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"urn\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"urn://:443\", \"type\" : \"Origin\", \"scheme\" : \"urn\", \"authority\" : \":443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"urn://:443\", \"failure\" : true },\n    \"matchesWhatWg\" : false\n  }\n]"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/resources/org/wiremock/url/whatwg/whatwg_valid_wiremock_invalid.json",
    "content": "[\n{ \"input\": \"\\u0000\\u001B\\u0004\\u0012 http://example.com/\\u001F \\r \", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `\\u0000\\u001B\\u0004\\u0012 http://example.com/\\u001F \\r `\", \"exceptionCauseType\": \"IllegalScheme\", \"exceptionCauseMessage\": \"Illegal scheme `\\u0000\\u001B\\u0004\\u0012 http`; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\", \"source\": { \"input\": \"\\u0000\\u001B\\u0004\\u0012 http://example.com/\\u001F \\r \", \"href\": \"http://example.com/\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"\\t   :foo.com   \\n\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `\\t   :foo.com   \\n`\", \"exceptionCauseType\": \"IllegalScheme\", \"exceptionCauseMessage\": \"Illegal scheme `\\t   `; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\", \"source\": { \"input\": \"\\t   :foo.com   \\n\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:foo.com\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:foo.com\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"  File:c|////foo\\\\bar.html\", \"base\": \"file:///tmp/mock/path\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `  File:c|////foo\\\\bar.html`\", \"exceptionCauseType\": \"IllegalScheme\", \"exceptionCauseMessage\": \"Illegal scheme `  File`; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\", \"source\": { \"input\": \"  File:c|////foo\\\\bar.html\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///c:////foo/bar.html\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/c:////foo/bar.html\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"#x\", \"base\": \"sc://ñ\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://ñ`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ñ`\", \"source\": { \"input\": \"#x\", \"base\": \"sc://ñ\", \"href\": \"sc://%C3%B1#x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"#x\" } },\n{ \"input\": \"//C|/foo/bar\", \"base\": \"file:///tmp/mock/path\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `//C|/foo/bar`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `C|`\", \"source\": { \"input\": \"//C|/foo/bar\", \"base\": \"file:///tmp/mock/path\", \"href\": \"file:///C:/foo/bar\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/foo/bar\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"10.0.0.7:8080/foo.html\", \"base\": \"file:///some/dir/bar.html\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `10.0.0.7:8080/foo.html`\", \"exceptionCauseType\": \"IllegalScheme\", \"exceptionCauseMessage\": \"Illegal scheme `10.0.0.7`; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\", \"source\": { \"input\": \"10.0.0.7:8080/foo.html\", \"base\": \"file:///some/dir/bar.html\", \"href\": \"file:///some/dir/10.0.0.7:8080/foo.html\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/some/dir/10.0.0.7:8080/foo.html\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \":\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `:` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `:` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \":\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \":#\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `:#` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `:` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \":#\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:#\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \":/\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `:/` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `:/` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \":/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \":23\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `:23` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `:23` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \":23\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:23\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:23\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"::\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `::` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `::` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \"::\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/::\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/::\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"::23\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `::23` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `::23` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \"::23\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/::23\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/::23\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \":\\\\\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `:\\\\` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `:\\\\` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \":\\\\\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \":a\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `:a` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `:a` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \":a\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:a\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:a\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \":foo.com/\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `:foo.com/` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `:foo.com/` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \":foo.com/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:foo.com/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:foo.com/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \":foo.com\\\\\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalRelativeUrl\", \"exceptionMessage\": \"Illegal relative url: `:foo.com\\\\` - a relative url without authority's path may not contain a colon (`:`) in the first segment, as that implies a scheme\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `:foo.com\\\\` - may not contain a colon (`:`) in the first segment of a relative url with no authority\", \"source\": { \"input\": \":foo.com\\\\\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/:foo.com/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/:foo.com/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"?x\", \"base\": \"sc://ñ\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://ñ`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ñ`\", \"source\": { \"input\": \"?x\", \"base\": \"sc://ñ\", \"href\": \"sc://%C3%B1?x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"?x\", \"hash\": \"\" } },\n{ \"input\": \"C|\\n/\", \"base\": \"file://host/dir/file\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `C|\\n/`\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `C|\\n/`\", \"source\": { \"input\": \"C|\\n/\", \"base\": \"file://host/dir/file\", \"href\": \"file://host/C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"[61:24:74]:98\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `[61:24:74]:98`\", \"exceptionCauseType\": \"IllegalScheme\", \"exceptionCauseMessage\": \"Illegal scheme `[61`; Scheme must match [a-zA-Z][a-zA-Z0-9+\\\\-.]{0,255}\", \"source\": { \"input\": \"[61:24:74]:98\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/foo/[61:24:74]:98\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/foo/[61:24:74]:98\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"about:blank#\\u0000\\u0001\\t\\n\\r\\u001F !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~Éé\", \"base\": null, \"exceptionType\": \"IllegalAbsoluteUrl\", \"exceptionMessage\": \"Illegal absolute url: `about:blank#\\u0000\\u0001\\t\\n\\r\\u001F !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~Éé`\", \"exceptionCauseType\": null, \"exceptionCauseMessage\": null, \"source\": { \"input\": \"about:blank#\\u0000\\u0001\\t\\n\\r\\u001F !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~Éé\", \"href\": \"about:blank#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\", \"protocol\": \"about:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"blank\", \"search\": \"\", \"hash\": \"#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\" } },\n{ \"input\": \"data:text/plain,test#\\u0000\\u0001\\t\\n\\r\\u001F !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~Éé\", \"base\": null, \"exceptionType\": \"IllegalAbsoluteUrl\", \"exceptionMessage\": \"Illegal absolute url: `data:text/plain,test#\\u0000\\u0001\\t\\n\\r\\u001F !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~Éé`\", \"exceptionCauseType\": null, \"exceptionCauseMessage\": null, \"source\": { \"input\": \"data:text/plain,test#\\u0000\\u0001\\t\\n\\r\\u001F !\\\"#$%&'()*+,-./09:;<=>?@AZ[\\\\]^_`az{|}~Éé\", \"href\": \"data:text/plain,test#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\", \"protocol\": \"data:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"text/plain,test\", \"search\": \"\", \"hash\": \"#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9\" } },\n{ \"input\": \"file://C|/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `file://C|/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `C|`\", \"source\": { \"input\": \"file://C|/\", \"href\": \"file:///C:/\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/C:/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"file://\\\\/localhost//cat\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `file://\\\\/localhost//cat`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `\\\\`\", \"source\": { \"input\": \"file://\\\\/localhost//cat\", \"href\": \"file:////localhost//cat\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"//localhost//cat\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"file://a­b/p\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `file://a­b/p`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a­b`\", \"source\": { \"input\": \"file://a­b/p\", \"href\": \"file://ab/p\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"ab\", \"hostname\": \"ab\", \"port\": \"\", \"pathname\": \"/p\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"file://loC\\uD835\\uDC00\\uD835\\uDC0B\\uD835\\uDC07\\uD835\\uDC28\\uD835\\uDC2C\\uD835\\uDC2D/usr/bin\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `file://loC\\uD835\\uDC00\\uD835\\uDC0B\\uD835\\uDC07\\uD835\\uDC28\\uD835\\uDC2C\\uD835\\uDC2D/usr/bin`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `loC\\uD835\\uDC00\\uD835\\uDC0B\\uD835\\uDC07\\uD835\\uDC28\\uD835\\uDC2C\\uD835\\uDC2D`\", \"source\": { \"input\": \"file://loC\\uD835\\uDC00\\uD835\\uDC0B\\uD835\\uDC07\\uD835\\uDC28\\uD835\\uDC2C\\uD835\\uDC2D/usr/bin\", \"href\": \"file:///usr/bin\", \"protocol\": \"file:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"/usr/bin\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"foo:// !\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@host/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `foo:// !\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@host/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: ` !\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@host`\", \"source\": { \"input\": \"foo:// !\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@host/\", \"href\": \"foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"foo://!\\\"$%&'()*+,-.;=_`{}~/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `foo://!\\\"$%&'()*+,-.;=_`{}~/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `!\\\"$%&'()*+,-.;=_`{}~`\", \"source\": { \"input\": \"foo://!\\\"$%&'()*+,-.;=_`{}~/\", \"href\": \"foo://!\\\"$%&'()*+,-.;=_`{}~/\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"!\\\"$%&'()*+,-.;=_`{}~\", \"hostname\": \"!\\\"$%&'()*+,-.;=_`{}~\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"foo://ho\\tst/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `foo://ho\\tst/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ho\\tst`\", \"source\": { \"input\": \"foo://ho\\tst/\", \"href\": \"foo://host/\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"foo://ho\\nst/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `foo://ho\\nst/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ho\\nst`\", \"source\": { \"input\": \"foo://ho\\nst/\", \"href\": \"foo://host/\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"foo://ho\\rst/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `foo://ho\\rst/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ho\\rst`\", \"source\": { \"input\": \"foo://ho\\rst/\", \"href\": \"foo://host/\", \"protocol\": \"foo:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"foo://joe: !\\\"$%&'()*+,-.:;<=>@[\\\\]^_`{|}~@host/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `foo://joe: !\\\"$%&'()*+,-.:;<=>@[\\\\]^_`{|}~@host/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `joe: !\\\"$%&'()*+,-.:;<=>@[\\\\]^_`{|}~@host`\", \"source\": { \"input\": \"foo://joe: !\\\"$%&'()*+,-.:;<=>@[\\\\]^_`{|}~@host/\", \"href\": \"foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/\", \"origin\": \"null\", \"protocol\": \"foo:\", \"username\": \"joe\", \"password\": \"%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"h\\tt\\nt\\rp://h\\to\\ns\\rt:9\\t0\\n0\\r0/p\\ta\\nt\\rh?q\\tu\\ne\\rry#f\\tr\\na\\rg\", \"base\": null, \"exceptionType\": \"IllegalAbsoluteUrl\", \"exceptionMessage\": \"Illegal absolute url: `h\\tt\\nt\\rp://h\\to\\ns\\rt:9\\t0\\n0\\r0/p\\ta\\nt\\rh?q\\tu\\ne\\rry#f\\tr\\na\\rg`\", \"exceptionCauseType\": null, \"exceptionCauseMessage\": null, \"source\": { \"input\": \"h\\tt\\nt\\rp://h\\to\\ns\\rt:9\\t0\\n0\\r0/p\\ta\\nt\\rh?q\\tu\\ne\\rry#f\\tr\\na\\rg\", \"href\": \"http://host:9000/path?query#frag\", \"origin\": \"http://host:9000\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"host:9000\", \"hostname\": \"host\", \"port\": \"9000\", \"pathname\": \"/path\", \"search\": \"?query\", \"hash\": \"#frag\" } },\n{ \"input\": \"http://!\\\"$&'()*+,-.;=_`{}~/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://!\\\"$&'()*+,-.;=_`{}~/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `!\\\"$&'()*+,-.;=_`{}~`\", \"source\": { \"input\": \"http://!\\\"$&'()*+,-.;=_`{}~/\", \"href\": \"http://!\\\"$&'()*+,-.;=_`{}~/\", \"origin\": \"http://!\\\"$&'()*+,-.;=_`{}~\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"!\\\"$&'()*+,-.;=_`{}~\", \"hostname\": \"!\\\"$&'()*+,-.;=_`{}~\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://&a:foo(b]c@d:2/\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://&a:foo(b]c@d:2/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `&a:foo(b]c@d:2`\", \"source\": { \"input\": \"http://&a:foo(b]c@d:2/\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://&a:foo(b%5Dc@d:2/\", \"origin\": \"http://d:2\", \"protocol\": \"http:\", \"username\": \"&a\", \"password\": \"foo(b%5Dc\", \"host\": \"d:2\", \"hostname\": \"d\", \"port\": \"2\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://::@c@d:2\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://::@c@d:2`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `::@c@d:2`\", \"source\": { \"input\": \"http://::@c@d:2\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://:%3A%40c@d:2/\", \"origin\": \"http://d:2\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"%3A%40c\", \"host\": \"d:2\", \"hostname\": \"d\", \"port\": \"2\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://GOO​⁠﻿goo.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://GOO​⁠﻿goo.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `GOO​⁠﻿goo.com`\", \"source\": { \"input\": \"http://GOO​⁠﻿goo.com\", \"base\": \"http://other.com/\", \"href\": \"http://googoo.com/\", \"origin\": \"http://googoo.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"googoo.com\", \"hostname\": \"googoo.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://`{}:`{}@h/`{}?`{}\", \"base\": \"http://doesnotmatter/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://`{}:`{}@h/`{}?`{}`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: ``{}:`{}@h`\", \"source\": { \"input\": \"http://`{}:`{}@h/`{}?`{}\", \"base\": \"http://doesnotmatter/\", \"href\": \"http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}\", \"origin\": \"http://h\", \"protocol\": \"http:\", \"username\": \"%60%7B%7D\", \"password\": \"%60%7B%7D\", \"host\": \"h\", \"hostname\": \"h\", \"port\": \"\", \"pathname\": \"/%60%7B%7D\", \"search\": \"?`{}\", \"hash\": \"\" } },\n{ \"input\": \"http://a:b@c\\\\\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://a:b@c\\\\`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a:b@c\\\\`\", \"source\": { \"input\": \"http://a:b@c\\\\\", \"href\": \"http://a:b@c/\", \"origin\": \"http://c\", \"protocol\": \"http:\", \"username\": \"a\", \"password\": \"b\", \"host\": \"c\", \"hostname\": \"c\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://example\\t.\\norg\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://example\\t.\\norg`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `example\\t.\\norg`\", \"source\": { \"input\": \"http://example\\t.\\norg\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://example.org/\", \"origin\": \"http://example.org\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.org\", \"hostname\": \"example.org\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://example.com/foo\\t%91\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://example.com/foo\\t%91`\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `/foo\\t%91`\", \"source\": { \"input\": \"http://example.com/foo\\t%91\", \"href\": \"http://example.com/foo%C2%91%91\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/foo%C2%91%91\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://example.com\\\\\\\\foo\\\\\\\\bar\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://example.com\\\\\\\\foo\\\\\\\\bar`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `example.com\\\\\\\\foo\\\\\\\\bar`\", \"source\": { \"input\": \"http://example.com\\\\\\\\foo\\\\\\\\bar\", \"href\": \"http://example.com//foo//bar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"//foo//bar\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://f:\\n/c\", \"base\": \"http://example.org/foo/bar\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://f:\\n/c`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `f:\\n`\", \"source\": { \"input\": \"http://f:\\n/c\", \"base\": \"http://example.org/foo/bar\", \"href\": \"http://f/c\", \"origin\": \"http://f\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"f\", \"hostname\": \"f\", \"port\": \"\", \"pathname\": \"/c\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://foo:\\uD83D\\uDCA9@example.com/bar\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://foo:\\uD83D\\uDCA9@example.com/bar`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `foo:\\uD83D\\uDCA9@example.com`\", \"source\": { \"input\": \"http://foo:\\uD83D\\uDCA9@example.com/bar\", \"base\": \"http://other.com/\", \"href\": \"http://foo:%F0%9F%92%A9@example.com/bar\", \"origin\": \"http://example.com\", \"protocol\": \"http:\", \"username\": \"foo\", \"password\": \"%F0%9F%92%A9\", \"host\": \"example.com\", \"hostname\": \"example.com\", \"port\": \"\", \"pathname\": \"/bar\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://ho\\tst/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://ho\\tst/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ho\\tst`\", \"source\": { \"input\": \"http://ho\\tst/\", \"href\": \"http://host/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://ho\\nst/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://ho\\nst/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ho\\nst`\", \"source\": { \"input\": \"http://ho\\nst/\", \"href\": \"http://host/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://ho\\rst/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://ho\\rst/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ho\\rst`\", \"source\": { \"input\": \"http://ho\\rst/\", \"href\": \"http://host/\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://www.foo。bar.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://www.foo。bar.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `www.foo。bar.com`\", \"source\": { \"input\": \"http://www.foo。bar.com\", \"base\": \"http://other.com/\", \"href\": \"http://www.foo.bar.com/\", \"origin\": \"http://www.foo.bar.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.foo.bar.com\", \"hostname\": \"www.foo.bar.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://你好你好\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://你好你好`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `你好你好`\", \"source\": { \"input\": \"http://你好你好\", \"base\": \"http://other.com/\", \"href\": \"http://xn--6qqa088eba/\", \"origin\": \"http://xn--6qqa088eba\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"xn--6qqa088eba\", \"hostname\": \"xn--6qqa088eba\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://０Ｘｃ０．０２５０．０１\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://０Ｘｃ０．０２５０．０１`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `０Ｘｃ０．０２５０．０１`\", \"source\": { \"input\": \"http://０Ｘｃ０．０２５０．０１\", \"base\": \"http://other.com/\", \"href\": \"http://192.168.0.1/\", \"origin\": \"http://192.168.0.1\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"192.168.0.1\", \"hostname\": \"192.168.0.1\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"http://Ｇｏ.com\", \"base\": \"http://other.com/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `http://Ｇｏ.com`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `Ｇｏ.com`\", \"source\": { \"input\": \"http://Ｇｏ.com\", \"base\": \"http://other.com/\", \"href\": \"http://go.com/\", \"origin\": \"http://go.com\", \"protocol\": \"http:\", \"username\": \"\", \"password\": \"\", \"host\": \"go.com\", \"hostname\": \"go.com\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"https://@@@example\", \"base\": \"http://doesnotmatter/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://@@@example`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `@@@example`\", \"source\": { \"input\": \"https://@@@example\", \"base\": \"http://doesnotmatter/\", \"href\": \"https://%40%40@example/\", \"origin\": \"https://example\", \"protocol\": \"https:\", \"username\": \"%40%40\", \"password\": \"\", \"host\": \"example\", \"hostname\": \"example\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"https://@test@test@example:800/\", \"base\": \"http://doesnotmatter/\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://@test@test@example:800/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `@test@test@example:800`\", \"source\": { \"input\": \"https://@test@test@example:800/\", \"base\": \"http://doesnotmatter/\", \"href\": \"https://%40test%40test@example:800/\", \"origin\": \"https://example:800\", \"protocol\": \"https:\", \"username\": \"%40test%40test\", \"password\": \"\", \"host\": \"example:800\", \"hostname\": \"example\", \"port\": \"800\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"https://faß.ExAmPlE/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://faß.ExAmPlE/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `faß.ExAmPlE`\", \"source\": { \"input\": \"https://faß.ExAmPlE/\", \"href\": \"https://xn--fa-hia.example/\", \"origin\": \"https://xn--fa-hia.example\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"xn--fa-hia.example\", \"hostname\": \"xn--fa-hia.example\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"https://user:pass[@foo/bar\", \"base\": \"http://example.org\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://user:pass[@foo/bar`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `user:pass[@foo`\", \"source\": { \"input\": \"https://user:pass[@foo/bar\", \"base\": \"http://example.org\", \"href\": \"https://user:pass%5B%7F@foo/bar\", \"origin\": \"https://foo\", \"protocol\": \"https:\", \"username\": \"user\", \"password\": \"pass%5B%7F\", \"host\": \"foo\", \"hostname\": \"foo\", \"port\": \"\", \"pathname\": \"/bar\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"https://www.example.com/path{path.html?query'=query#fragment<fragment\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://www.example.com/path{path.html?query'=query#fragment<fragment`\", \"exceptionCauseType\": \"IllegalQuery\", \"exceptionCauseMessage\": \"Illegal query: `query'=query`\", \"source\": { \"input\": \"https://www.example.com/path{path.html?query'=query#fragment<fragment\", \"href\": \"https://www.example.com/path%7B%7Fpath.html?query%27%7F=query#fragment%3C%7Ffragment\", \"origin\": \"https://www.example.com\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"www.example.com\", \"hostname\": \"www.example.com\", \"port\": \"\", \"pathname\": \"/path%7B%7Fpath.html\", \"search\": \"?query%27%7F=query\", \"hash\": \"#fragment%3C%7Ffragment\" } },\n{ \"input\": \"https://x/\\u0000y\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://x/\\u0000y`\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `/\\u0000y`\", \"source\": { \"input\": \"https://x/\\u0000y\", \"href\": \"https://x/%00y\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/%00y\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"https://x/?\\u0000y\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `https://x/?\\u0000y`\", \"exceptionCauseType\": \"IllegalQuery\", \"exceptionCauseMessage\": \"Illegal query: `\\u0000y`\", \"source\": { \"input\": \"https://x/?\\u0000y\", \"href\": \"https://x/?%00y\", \"protocol\": \"https:\", \"username\": \"\", \"password\": \"\", \"host\": \"x\", \"hostname\": \"x\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"?%00y\", \"hash\": \"\" } },\n{ \"input\": \"non-special:\\u0000y\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `non-special:\\u0000y`\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `\\u0000y`\", \"source\": { \"input\": \"non-special:\\u0000y\", \"href\": \"non-special:%00y\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"%00y\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"non-special:cannot-be-a-base-url-\\u0000\\u0001\\u001F\\u001E~\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `non-special:cannot-be-a-base-url-\\u0000\\u0001\\u001F\\u001E~`\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `cannot-be-a-base-url-\\u0000\\u0001\\u001F\\u001E~`\", \"source\": { \"input\": \"non-special:cannot-be-a-base-url-\\u0000\\u0001\\u001F\\u001E~\", \"href\": \"non-special:cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"non-special:opaque\\t\\t  \\r #hi\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `non-special:opaque\\t\\t  \\r #hi`\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `opaque\\t\\t  \\r `\", \"source\": { \"input\": \"non-special:opaque\\t\\t  \\r #hi\", \"href\": \"non-special:opaque  %20#hi\", \"origin\": \"null\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"opaque  %20\", \"search\": \"\", \"hash\": \"#hi\" } },\n{ \"input\": \"non-special:x/\\u0000y\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `non-special:x/\\u0000y`\", \"exceptionCauseType\": \"IllegalPath\", \"exceptionCauseMessage\": \"Illegal path: `x/\\u0000y`\", \"source\": { \"input\": \"non-special:x/\\u0000y\", \"href\": \"non-special:x/%00y\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x/%00y\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"non-special:x/?\\u0000y\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `non-special:x/?\\u0000y`\", \"exceptionCauseType\": \"IllegalQuery\", \"exceptionCauseMessage\": \"Illegal query: `\\u0000y`\", \"source\": { \"input\": \"non-special:x/?\\u0000y\", \"href\": \"non-special:x/?%00y\", \"protocol\": \"non-special:\", \"username\": \"\", \"password\": \"\", \"host\": \"\", \"hostname\": \"\", \"port\": \"\", \"pathname\": \"x/\", \"search\": \"?%00y\", \"hash\": \"\" } },\n{ \"input\": \"sc://\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\u000B\\f\\u000E\\u000F\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001A\\u001B\\u001C\\u001D\\u001E\\u001F!\\\"$%&'()*+,-.;=_`{}~/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\u000B\\f\\u000E\\u000F\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001A\\u001B\\u001C\\u001D\\u001E\\u001F!\\\"$%&'()*+,-.;=_`{}~/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\u000B\\f\\u000E\\u000F\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001A\\u001B\\u001C\\u001D\\u001E\\u001F!\\\"$%&'()*+,-.;=_`{}~`\", \"source\": { \"input\": \"sc://\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\u000B\\f\\u000E\\u000F\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001A\\u001B\\u001C\\u001D\\u001E\\u001F!\\\"$%&'()*+,-.;=_`{}~/\", \"href\": \"sc://%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\\\"$%&'()*+,-.;=_`{}~/\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\\\"$%&'()*+,-.;=_`{}~\", \"hostname\": \"%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\\\"$%&'()*+,-.;=_`{}~\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"sc://%/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://%/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `%`\", \"source\": { \"input\": \"sc://%/\", \"href\": \"sc://%/\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%\", \"hostname\": \"%\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"sc://faß.ExAmPlE/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://faß.ExAmPlE/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `faß.ExAmPlE`\", \"source\": { \"input\": \"sc://faß.ExAmPlE/\", \"href\": \"sc://fa%C3%9F.ExAmPlE/\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"fa%C3%9F.ExAmPlE\", \"hostname\": \"fa%C3%9F.ExAmPlE\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"sc://ñ\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://ñ`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ñ`\", \"source\": { \"input\": \"sc://ñ\", \"href\": \"sc://%C3%B1\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"sc://ñ#x\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://ñ#x`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ñ`\", \"source\": { \"input\": \"sc://ñ#x\", \"href\": \"sc://%C3%B1#x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"\", \"hash\": \"#x\" } },\n{ \"input\": \"sc://ñ.test/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://ñ.test/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ñ.test`\", \"source\": { \"input\": \"sc://ñ.test/\", \"href\": \"sc://%C3%B1.test/\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1.test\", \"hostname\": \"%C3%B1.test\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"sc://ñ?x\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://ñ?x`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ñ`\", \"source\": { \"input\": \"sc://ñ?x\", \"href\": \"sc://%C3%B1?x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"\", \"search\": \"?x\", \"hash\": \"\" } },\n{ \"input\": \"ws://a@b\\\\c\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `ws://a@b\\\\c`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `a@b\\\\c`\", \"source\": { \"input\": \"ws://a@b\\\\c\", \"href\": \"ws://a@b/c\", \"origin\": \"ws://b\", \"protocol\": \"ws:\", \"username\": \"a\", \"password\": \"\", \"host\": \"b\", \"hostname\": \"b\", \"port\": \"\", \"pathname\": \"/c\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"wss:// !\\\"$%&'()*+,-.;<=>@[]^_`{|}~@host/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `wss:// !\\\"$%&'()*+,-.;<=>@[]^_`{|}~@host/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: ` !\\\"$%&'()*+,-.;<=>@[]^_`{|}~@host`\", \"source\": { \"input\": \"wss:// !\\\"$%&'()*+,-.;<=>@[]^_`{|}~@host/\", \"href\": \"wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/\", \"origin\": \"wss://host\", \"protocol\": \"wss:\", \"username\": \"%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~\", \"password\": \"\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"wss://!\\\"$&'()*+,-.;=_`{}~/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `wss://!\\\"$&'()*+,-.;=_`{}~/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `!\\\"$&'()*+,-.;=_`{}~`\", \"source\": { \"input\": \"wss://!\\\"$&'()*+,-.;=_`{}~/\", \"href\": \"wss://!\\\"$&'()*+,-.;=_`{}~/\", \"origin\": \"wss://!\\\"$&'()*+,-.;=_`{}~\", \"protocol\": \"wss:\", \"username\": \"\", \"password\": \"\", \"host\": \"!\\\"$&'()*+,-.;=_`{}~\", \"hostname\": \"!\\\"$&'()*+,-.;=_`{}~\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"wss://joe: !\\\"$%&'()*+,-.:;<=>@[]^_`{|}~@host/\", \"base\": null, \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `wss://joe: !\\\"$%&'()*+,-.:;<=>@[]^_`{|}~@host/`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `joe: !\\\"$%&'()*+,-.:;<=>@[]^_`{|}~@host`\", \"source\": { \"input\": \"wss://joe: !\\\"$%&'()*+,-.:;<=>@[]^_`{|}~@host/\", \"href\": \"wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/\", \"origin\": \"wss://host\", \"protocol\": \"wss:\", \"username\": \"joe\", \"password\": \"%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~\", \"host\": \"host\", \"hostname\": \"host\", \"port\": \"\", \"pathname\": \"/\", \"search\": \"\", \"hash\": \"\" } },\n{ \"input\": \"x\", \"base\": \"sc://ñ\", \"exceptionType\": \"IllegalUri\", \"exceptionMessage\": \"Illegal uri: `sc://ñ`\", \"exceptionCauseType\": \"IllegalAuthority\", \"exceptionCauseMessage\": \"Illegal authority: `ñ`\", \"source\": { \"input\": \"x\", \"base\": \"sc://ñ\", \"href\": \"sc://%C3%B1/x\", \"origin\": \"null\", \"protocol\": \"sc:\", \"username\": \"\", \"password\": \"\", \"host\": \"%C3%B1\", \"hostname\": \"%C3%B1\", \"port\": \"\", \"pathname\": \"/x\", \"search\": \"\", \"hash\": \"\" } }\n]"
  },
  {
    "path": "wiremock-url/wiremock-url/src/test/resources/org/wiremock/url/whatwg/whatwg_valid_wiremock_valid.json",
    "content": "[\n  {\n    \"input\" : \"\",\n    \"base\" : \"file:///test?test#test\",\n    \"inputExpected\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"resolved\" : { \"stringValue\" : \"file:///test?test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"\", \"base\" : \"file:///test?test#test\", \"href\" : \"file:///test?test\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?test\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"\",\n    \"base\" : \"http://user:pass@example.org:21/smth\",\n    \"inputExpected\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://user:pass@example.org:21/smth\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@example.org:21\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"example.org\", \"port\" : \"21\", \"path\" : \"/smth\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://user:pass@example.org:21/smth\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@example.org:21\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"example.org\", \"port\" : \"21\", \"path\" : \"/smth\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://user:pass@example.org:21/smth\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@example.org:21\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"example.org\", \"port\" : \"21\", \"path\" : \"/smth\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org:21\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org:21\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : \"21\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"\", \"base\" : \"http://user:pass@example.org:21/smth\", \"href\" : \"http://user:pass@example.org:21/smth\", \"origin\" : \"http://example.org:21\", \"protocol\" : \"http:\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"example.org:21\", \"hostname\" : \"example.org\", \"port\" : \"21\", \"pathname\" : \"/smth\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"\",\n    \"base\" : \"non-spec:/..//p\",\n    \"inputExpected\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"non-spec:/..//p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/..//p\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"\", \"base\" : \"non-spec:/..//p\", \"href\" : \"non-spec:/.//p\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//p\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"  \\t\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"  \\t\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"  \\t\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"  \\t\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"  \\t\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/%20%20%09\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/%20%20%09\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"  \\t\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \" foo.com  \",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \" foo.com  \", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \" foo.com  \", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \" foo.com  \", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \" foo.com  \", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/%20foo.com%20%20\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/%20foo.com%20%20\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \" foo.com  \", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/foo.com\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/foo.com\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"#\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/bar#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : \"\" },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"#\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar#\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#\",\n    \"base\" : \"test:test\",\n    \"inputExpected\" : { \"stringValue\" : \"#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"baseExpected\" : { \"stringValue\" : \"test:test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"test\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"test:test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"test\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"test:test#\", \"type\" : \"OpaqueUri\", \"scheme\" : \"test\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : \"\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#\", \"base\" : \"test:test\", \"href\" : \"test:test#\", \"origin\" : \"null\", \"protocol\" : \"test:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#\",\n    \"base\" : \"test:test?test\",\n    \"inputExpected\" : { \"stringValue\" : \"#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"baseExpected\" : { \"stringValue\" : \"test:test?test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"test\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : \"test\", \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"test:test?test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"test\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : \"test\", \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"test:test?test#\", \"type\" : \"OpaqueUri\", \"scheme\" : \"test\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : \"test\", \"fragment\" : \"\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#\", \"base\" : \"test:test?test\", \"href\" : \"test:test?test#\", \"origin\" : \"null\", \"protocol\" : \"test:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"test\", \"search\" : \"?test\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"#/\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"/\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#/\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"/\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/bar#/\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : \"/\" },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"#/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar#/\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"hash\" : \"#/\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#;?\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"#;?\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \";?\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#;?\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \";?\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/bar#;?\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : \";?\" },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"#;?\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar#;?\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"hash\" : \"#;?\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#\\\\\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"#\\\\\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\\\\\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#\\\\\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\\\\\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/bar#%5C\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : \"%5C\" },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"#\\\\\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar#\\\\\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"hash\" : \"#\\\\\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"#i\",\n    \"base\" : \"sc:///pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"baseExpected\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:///pa/pa#i\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : \"i\" },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"#i\", \"base\" : \"sc:///pa/pa\", \"href\" : \"sc:///pa/pa#i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/pa/pa\", \"search\" : \"\", \"hash\" : \"#i\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#i\",\n    \"base\" : \"sc://ho/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"baseExpected\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc://ho/pa#i\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : \"i\" },\n    \"origin\" : { \"stringValue\" : \"sc://ho\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"#i\", \"base\" : \"sc://ho/pa\", \"href\" : \"sc://ho/pa#i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"ho\", \"hostname\" : \"ho\", \"port\" : \"\", \"pathname\" : \"/pa\", \"search\" : \"\", \"hash\" : \"#i\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#i\",\n    \"base\" : \"sc:/pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"baseExpected\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:/pa/pa#i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : \"i\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#i\", \"base\" : \"sc:/pa/pa\", \"href\" : \"sc:/pa/pa#i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/pa/pa\", \"search\" : \"\", \"hash\" : \"#i\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#i\",\n    \"base\" : \"sc:sd\",\n    \"inputExpected\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:sd#i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd\", \"query\" : null, \"fragment\" : \"i\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#i\", \"base\" : \"sc:sd\", \"href\" : \"sc:sd#i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"sd\", \"search\" : \"\", \"hash\" : \"#i\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#i\",\n    \"base\" : \"sc:sd/sd\",\n    \"inputExpected\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"i\" },\n    \"baseExpected\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:sd/sd\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:sd/sd#i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"sd/sd\", \"query\" : null, \"fragment\" : \"i\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#i\", \"base\" : \"sc:sd/sd\", \"href\" : \"sc:sd/sd#i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"sd/sd\", \"search\" : \"\", \"hash\" : \"#i\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#link\",\n    \"base\" : \"https://example.org/##link\",\n    \"inputExpected\" : { \"stringValue\" : \"#link\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"link\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#link\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"link\" },\n    \"baseExpected\" : { \"stringValue\" : \"https://example.org/##link\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : \"#link\" },\n    \"baseNormalised\" : { \"stringValue\" : \"https://example.org/#%23link\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : \"%23link\" },\n    \"resolved\" : { \"stringValue\" : \"https://example.org/#link\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : \"link\" },\n    \"origin\" : { \"stringValue\" : \"https://example.org\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"#link\", \"base\" : \"https://example.org/##link\", \"href\" : \"https://example.org/#link\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"#link\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#x\",\n    \"base\" : \"about:blank\",\n    \"inputExpected\" : { \"stringValue\" : \"#x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"baseExpected\" : { \"stringValue\" : \"about:blank\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blank\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"about:blank\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blank\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"about:blank#x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blank\", \"query\" : null, \"fragment\" : \"x\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#x\", \"base\" : \"about:blank\", \"href\" : \"about:blank#x\", \"origin\" : \"null\", \"protocol\" : \"about:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"blank\", \"search\" : \"\", \"hash\" : \"#x\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#x\",\n    \"base\" : \"data:,\",\n    \"inputExpected\" : { \"stringValue\" : \"#x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"baseExpected\" : { \"stringValue\" : \"data:,\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \",\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"data:,\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \",\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"data:,#x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \",\", \"query\" : null, \"fragment\" : \"x\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#x\", \"base\" : \"data:,\", \"href\" : \"data:,#x\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \",\", \"search\" : \"\", \"hash\" : \"#x\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#x\",\n    \"base\" : \"file:///test?test#test\",\n    \"inputExpected\" : { \"stringValue\" : \"#x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"baseExpected\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"resolved\" : { \"stringValue\" : \"file:///test?test#x\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"x\" },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"#x\", \"base\" : \"file:///test?test#test\", \"href\" : \"file:///test?test#x\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?test\", \"hash\" : \"#x\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#x\",\n    \"base\" : \"mailto:x@x.com\",\n    \"inputExpected\" : { \"stringValue\" : \"#x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"baseExpected\" : { \"stringValue\" : \"mailto:x@x.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x@x.com\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"mailto:x@x.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x@x.com\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"mailto:x@x.com#x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x@x.com\", \"query\" : null, \"fragment\" : \"x\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#x\", \"base\" : \"mailto:x@x.com\", \"href\" : \"mailto:x@x.com#x\", \"origin\" : \"null\", \"protocol\" : \"mailto:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"x@x.com\", \"search\" : \"\", \"hash\" : \"#x\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#x:y\",\n    \"base\" : \"about:blank\",\n    \"inputExpected\" : { \"stringValue\" : \"#x:y\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x:y\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#x:y\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x:y\" },\n    \"baseExpected\" : { \"stringValue\" : \"about:blank\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blank\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"about:blank\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blank\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"about:blank#x:y\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blank\", \"query\" : null, \"fragment\" : \"x:y\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"#x:y\", \"base\" : \"about:blank\", \"href\" : \"about:blank#x:y\", \"origin\" : \"null\", \"protocol\" : \"about:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"blank\", \"search\" : \"\", \"hash\" : \"#x:y\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"#β\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"#β\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"β\" },\n    \"inputNormalised\" : { \"stringValue\" : \"#β\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"β\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/bar#%CE%B2\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : \"%CE%B2\" },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"#β\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar#%CE%B2\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"hash\" : \"#%CE%B2\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \".\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \".\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \".\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \".\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \".\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \".\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"..\",\n    \"base\" : \"abc://x/y/z/C:/\",\n    \"inputExpected\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"abc://x/y/z/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"abc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/y/z/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"abc://x/y/z/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"abc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/y/z/C:/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"abc://x/y/z/\", \"type\" : \"BaseUrl\", \"scheme\" : \"abc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/y/z/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"abc://x\", \"type\" : \"Origin\", \"scheme\" : \"abc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"..\", \"base\" : \"abc://x/y/z/C:/\", \"href\" : \"abc://x/y/z/\", \"protocol\" : \"abc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x\", \"hostname\" : \"x\", \"port\" : \"\", \"pathname\" : \"/y/z/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"..\",\n    \"base\" : \"file:///\",\n    \"inputExpected\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"..\", \"base\" : \"file:///\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"..\",\n    \"base\" : \"file:///1:/\",\n    \"inputExpected\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///1:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/1:/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///1:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/1:/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"..\", \"base\" : \"file:///1:/\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"..\",\n    \"base\" : \"file:///C:/\",\n    \"inputExpected\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"..\", \"base\" : \"file:///C:/\", \"href\" : \"file:///C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"..\",\n    \"base\" : \"file:///ab:/\",\n    \"inputExpected\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///ab:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/ab:/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///ab:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/ab:/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"..\", \"base\" : \"file:///ab:/\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"..\",\n    \"base\" : \"file://x/C:/\",\n    \"inputExpected\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://x/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://x/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://x\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"..\", \"base\" : \"file://x/C:/\", \"href\" : \"file://x/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x\", \"hostname\" : \"x\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"..\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"..\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"..\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"../../test.txt\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"../../test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../../test.txt\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"../../test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../../test.txt\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/test.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"../../test.txt\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/test.txt\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/test.txt\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"..//path\",\n    \"base\" : \"non-spec:/p\",\n    \"inputExpected\" : { \"stringValue\" : \"..//path\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..//path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"..//path\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..//path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"non-spec://path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"//path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"..//path\", \"base\" : \"non-spec:/p\", \"href\" : \"non-spec:/.//path\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"../aaa/test.txt\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"../aaa/test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../aaa/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"../aaa/test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../aaa/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/aaa/test.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/aaa/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"../aaa/test.txt\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/aaa/test.txt\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/aaa/test.txt\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"../i\",\n    \"base\" : \"sc:///pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:///i\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"../i\", \"base\" : \"sc:///pa/pa\", \"href\" : \"sc:///i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/i\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"../i\",\n    \"base\" : \"sc://ho/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc://ho/i\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://ho\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"../i\", \"base\" : \"sc://ho/pa\", \"href\" : \"sc://ho/i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"ho\", \"hostname\" : \"ho\", \"port\" : \"\", \"pathname\" : \"/i\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"../i\",\n    \"base\" : \"sc:/pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"../i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:/i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"../i\", \"base\" : \"sc:/pa/pa\", \"href\" : \"sc:/i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/i\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"../path\",\n    \"base\" : \"non-spec:/.//p\",\n    \"inputExpected\" : { \"stringValue\" : \"../path\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"../path\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"non-spec:/.//p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/.//p\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"non-spec:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"../path\", \"base\" : \"non-spec:/.//p\", \"href\" : \"non-spec:/path\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"../test.txt\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"../test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../test.txt\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"../test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"../test.txt\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/test.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"../test.txt\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/test.txt\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/test.txt\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"./test.txt\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"./test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"./test.txt\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"./test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"./test.txt\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/test.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"./test.txt\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/test.txt\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/test.txt\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/\",\n    \"base\" : \"file:///C:/a/b\",\n    \"inputExpected\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///C:/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/a/b\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///C:/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/a/b\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/\", \"base\" : \"file:///C:/a/b\", \"href\" : \"file:///C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/\",\n    \"base\" : \"file://h/C:/a/b\",\n    \"inputExpected\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://h/C:/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"h\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h\", \"port\" : null, \"path\" : \"/C:/a/b\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://h/C:/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"h\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h\", \"port\" : null, \"path\" : \"/C:/a/b\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://h/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"h\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://h\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"h\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/\", \"base\" : \"file://h/C:/a/b\", \"href\" : \"file://h/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"h\", \"hostname\" : \"h\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/\",\n    \"base\" : \"file://h/a/b\",\n    \"inputExpected\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://h/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"h\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h\", \"port\" : null, \"path\" : \"/a/b\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://h/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"h\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h\", \"port\" : null, \"path\" : \"/a/b\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://h/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"h\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://h\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"h\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/\", \"base\" : \"file://h/a/b\", \"href\" : \"file://h/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"h\", \"hostname\" : \"h\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/..//localhost//pig\",\n    \"base\" : \"file://lion/\",\n    \"inputExpected\" : { \"stringValue\" : \"/..//localhost//pig\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/..//localhost//pig\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/..//localhost//pig\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/..//localhost//pig\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://lion/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://lion/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://lion//localhost//pig\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"//localhost//pig\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://lion\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/..//localhost//pig\", \"base\" : \"file://lion/\", \"href\" : \"file://lion//localhost//pig\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"lion\", \"hostname\" : \"lion\", \"port\" : \"\", \"pathname\" : \"//localhost//pig\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/..//path\",\n    \"base\" : \"non-spec:/p\",\n    \"inputExpected\" : { \"stringValue\" : \"/..//path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/..//path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/..//path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/..//path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"non-spec://path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"//path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"/..//path\", \"base\" : \"non-spec:/p\", \"href\" : \"non-spec:/.//path\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/.//path\",\n    \"base\" : \"non-spec:/p\",\n    \"inputExpected\" : { \"stringValue\" : \"/.//path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/.//path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/.//path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/.//path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"non-spec://path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"//path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"/.//path\", \"base\" : \"non-spec:/p\", \"href\" : \"non-spec:/.//path\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"//\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"//\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"///\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"///\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"///\",\n    \"base\" : \"sc://x/\",\n    \"inputExpected\" : { \"stringValue\" : \"///\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc://x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc://x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///\", \"base\" : \"sc://x/\", \"href\" : \"sc:///\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"////\",\n    \"base\" : \"sc://x/\",\n    \"inputExpected\" : { \"stringValue\" : \"////\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"////\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc://x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc://x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:////\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"////\", \"base\" : \"sc://x/\", \"href\" : \"sc:////\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/////mouse\",\n    \"base\" : \"file:///elephant\",\n    \"inputExpected\" : { \"stringValue\" : \"/////mouse\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"///mouse\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/////mouse\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"///mouse\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///elephant\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/elephant\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///elephant\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/elephant\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://///mouse\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"///mouse\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/////mouse\", \"base\" : \"file:///elephant\", \"href\" : \"file://///mouse\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"///mouse\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"////one/two\",\n    \"base\" : \"file:///\",\n    \"inputExpected\" : { \"stringValue\" : \"////one/two\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//one/two\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"////one/two\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//one/two\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:////one/two\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//one/two\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"////one/two\", \"base\" : \"file:///\", \"href\" : \"file:////one/two\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//one/two\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"////x/\",\n    \"base\" : \"sc://x/\",\n    \"inputExpected\" : { \"stringValue\" : \"////x/\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//x/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"////x/\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//x/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc://x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc://x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:////x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//x/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"////x/\", \"base\" : \"sc://x/\", \"href\" : \"sc:////x/\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//x/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"///C:/\",\n    \"base\" : \"file://host/\",\n    \"inputExpected\" : { \"stringValue\" : \"///C:/\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///C:/\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///C:/\", \"base\" : \"file://host/\", \"href\" : \"file:///C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"///\\\\//\\\\//test\",\n    \"base\" : \"http://example.org/\",\n    \"inputExpected\" : { \"stringValue\" : \"///\\\\//\\\\//test\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\\\\//\\\\//test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///\\\\//\\\\//test\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\\\\//\\\\//test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:///%5C//%5C//test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/%5C//%5C//test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///\\\\//\\\\//test\", \"base\" : \"http://example.org/\", \"href\" : \"http://test/\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"///abcdef/../\",\n    \"base\" : \"file:///\",\n    \"inputExpected\" : { \"stringValue\" : \"///abcdef/../\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/abcdef/../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///abcdef/../\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/abcdef/../\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///abcdef/../\", \"base\" : \"file:///\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"///example.org/../../\",\n    \"base\" : \"http://example.org/\",\n    \"inputExpected\" : { \"stringValue\" : \"///example.org/../../\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/../../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///example.org/../../\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/../../\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///example.org/../../\", \"base\" : \"http://example.org/\", \"href\" : \"http://example.org/\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"///example.org/../path\",\n    \"base\" : \"http://example.org/\",\n    \"inputExpected\" : { \"stringValue\" : \"///example.org/../path\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/../path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///example.org/../path\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/../path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:///path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///example.org/../path\", \"base\" : \"http://example.org/\", \"href\" : \"http://example.org/path\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"///example.org/../path/../../\",\n    \"base\" : \"http://example.org/\",\n    \"inputExpected\" : { \"stringValue\" : \"///example.org/../path/../../\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/../path/../../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///example.org/../path/../../\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/../path/../../\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///example.org/../path/../../\", \"base\" : \"http://example.org/\", \"href\" : \"http://example.org/\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"///example.org/../path/../../path\",\n    \"base\" : \"http://example.org/\",\n    \"inputExpected\" : { \"stringValue\" : \"///example.org/../path/../../path\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/../path/../../path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///example.org/../path/../../path\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/../path/../../path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:///path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///example.org/../path/../../path\", \"base\" : \"http://example.org/\", \"href\" : \"http://example.org/path\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"///example.org/path\",\n    \"base\" : \"http://example.org/\",\n    \"inputExpected\" : { \"stringValue\" : \"///example.org/path\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///example.org/path\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:///example.org/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/example.org/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///example.org/path\", \"base\" : \"http://example.org/\", \"href\" : \"http://example.org/path\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"///one/two\",\n    \"base\" : \"file:///\",\n    \"inputExpected\" : { \"stringValue\" : \"///one/two\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/one/two\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///one/two\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/one/two\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///one/two\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/one/two\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///one/two\", \"base\" : \"file:///\", \"href\" : \"file:///one/two\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/one/two\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"///test\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"///test\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///test\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///test\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///test\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"///test\",\n    \"base\" : \"http://example.org/\",\n    \"inputExpected\" : { \"stringValue\" : \"///test\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"///test\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"///test\", \"base\" : \"http://example.org/\", \"href\" : \"http://test/\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"//C:/\",\n    \"base\" : \"file://host/\",\n    \"inputExpected\" : { \"stringValue\" : \"//C:/\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"C:\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//C:/\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"C:\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://c/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"c\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"c\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://c\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"c\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"c\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//C:/\", \"base\" : \"file://host/\", \"href\" : \"file:///C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"//a/../\",\n    \"base\" : \"file:///\",\n    \"inputExpected\" : { \"stringValue\" : \"//a/../\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"a\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a\", \"port\" : null, \"path\" : \"/../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//a/../\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"a\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a\", \"port\" : null, \"path\" : \"/../\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://a/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"a\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://a\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"a\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//a/../\", \"base\" : \"file:///\", \"href\" : \"file://a/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"a\", \"hostname\" : \"a\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"//d:\",\n    \"base\" : \"file:///C:/a/b\",\n    \"inputExpected\" : { \"stringValue\" : \"//d:\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"d:\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"d\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//d:\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"d:\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"d\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///C:/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/a/b\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///C:/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/a/b\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://d/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"d\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"d\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://d\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"d\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"d\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//d:\", \"base\" : \"file:///C:/a/b\", \"href\" : \"file:///d:\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/d:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"//d:/..\",\n    \"base\" : \"file:///C:/a/b\",\n    \"inputExpected\" : { \"stringValue\" : \"//d:/..\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"d:\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"d\", \"port\" : null, \"path\" : \"/..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//d:/..\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"d:\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"d\", \"port\" : null, \"path\" : \"/..\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///C:/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/a/b\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///C:/a/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/a/b\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://d/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"d\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"d\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://d\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"d\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"d\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//d:/..\", \"base\" : \"file:///C:/a/b\", \"href\" : \"file:///d:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/d:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"//foo/bar\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"//foo/bar\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//foo/bar\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//foo/bar\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://foo/bar\", \"origin\" : \"http://foo\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo\", \"hostname\" : \"foo\", \"port\" : \"\", \"pathname\" : \"/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"//localhost//pig\",\n    \"base\" : \"file://lion/\",\n    \"inputExpected\" : { \"stringValue\" : \"//localhost//pig\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"//pig\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//localhost//pig\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"//pig\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://lion/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://lion/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://localhost//pig\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"//pig\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://localhost\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//localhost//pig\", \"base\" : \"file://lion/\", \"href\" : \"file:////pig\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//pig\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"//one/two\",\n    \"base\" : \"file:///\",\n    \"inputExpected\" : { \"stringValue\" : \"//one/two\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"one\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"one\", \"port\" : null, \"path\" : \"/two\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//one/two\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"one\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"one\", \"port\" : null, \"path\" : \"/two\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://one/two\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"one\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"one\", \"port\" : null, \"path\" : \"/two\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://one\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"one\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"one\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//one/two\", \"base\" : \"file:///\", \"href\" : \"file://one/two\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"one\", \"hostname\" : \"one\", \"port\" : \"\", \"pathname\" : \"/two\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"//server/file\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"//server/file\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"server\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"server\", \"port\" : null, \"path\" : \"/file\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//server/file\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"server\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"server\", \"port\" : null, \"path\" : \"/file\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://server/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"server\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"server\", \"port\" : null, \"path\" : \"/file\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://server\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"server\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"server\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//server/file\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file://server/file\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"server\", \"hostname\" : \"server\", \"port\" : \"\", \"pathname\" : \"/file\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"//www.example2.com\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"//www.example2.com\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"www.example2.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example2.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"//www.example2.com\", \"type\" : \"SchemeRelativeUrl\", \"scheme\" : null, \"authority\" : \"www.example2.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example2.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example2.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example2.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example2.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example2.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example2.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example2.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"//www.example2.com\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example2.com/\", \"origin\" : \"http://www.example2.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example2.com\", \"hostname\" : \"www.example2.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/:23\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"/:23\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/:23\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/:23\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/:23\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/:23\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/:23\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/:23\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/:23\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/:23\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/?chai\",\n    \"base\" : \"file://tea/\",\n    \"inputExpected\" : { \"stringValue\" : \"/?chai\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : \"chai\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/?chai\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : \"chai\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://tea/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"tea\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"tea\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://tea/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"tea\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"tea\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://tea/?chai\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"tea\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"tea\", \"port\" : null, \"path\" : \"/\", \"query\" : \"chai\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://tea\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"tea\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"tea\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/?chai\", \"base\" : \"file://tea/\", \"href\" : \"file://tea/?chai\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"tea\", \"hostname\" : \"tea\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"?chai\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/C:/\",\n    \"base\" : \"file://host/\",\n    \"inputExpected\" : { \"stringValue\" : \"/C:/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/C:/\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/C:/\", \"base\" : \"file://host/\", \"href\" : \"file://host/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/C|\\\\foo\\\\bar\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"/C|\\\\foo\\\\bar\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C|\\\\foo\\\\bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/C|\\\\foo\\\\bar\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C|\\\\foo\\\\bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///C%7C%5Cfoo%5Cbar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C%7C%5Cfoo%5Cbar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/C|\\\\foo\\\\bar\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///C:/foo/bar\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/\\\\//\\\\/a/../\",\n    \"base\" : \"file:///\",\n    \"inputExpected\" : { \"stringValue\" : \"/\\\\//\\\\/a/../\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\\\\//\\\\/a/../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/\\\\//\\\\/a/../\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\\\\//\\\\/a/../\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///%5C//%5C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/%5C//%5C/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/\\\\//\\\\/a/../\", \"base\" : \"file:///\", \"href\" : \"file://////\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"////\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/\\\\/\\\\//example.org/../path\",\n    \"base\" : \"http://example.org/\",\n    \"inputExpected\" : { \"stringValue\" : \"/\\\\/\\\\//example.org/../path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\\\\/\\\\//example.org/../path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/\\\\/\\\\//example.org/../path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\\\\/\\\\//example.org/../path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/%5C/%5C//path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/%5C/%5C//path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/\\\\/\\\\//example.org/../path\", \"base\" : \"http://example.org/\", \"href\" : \"http://example.org/path\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/\\\\server/file\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"/\\\\server/file\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\\\\server/file\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/\\\\server/file\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\\\\server/file\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///%5Cserver/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/%5Cserver/file\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/\\\\server/file\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file://server/file\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"server\", \"hostname\" : \"server\", \"port\" : \"\", \"pathname\" : \"/file\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/a%2fc\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"/a%2fc\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a%2fc\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/a%2fc\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a%2fc\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/a%2Fc\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/a%2Fc\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/a%2fc\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/a%2fc\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/a%2fc\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/a/ /c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"/a/ /c\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a/ /c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/a/ /c\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a/ /c\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/a/%20/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/a/%20/c\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/a/ /c\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/a/%20/c\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/a/%20/c\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/a/%2f/c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"/a/%2f/c\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a/%2f/c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/a/%2f/c\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a/%2f/c\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/a/%2F/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/a/%2F/c\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/a/%2f/c\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/a/%2f/c\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/a/%2f/c\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/a/b/c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"/a/b/c\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a/b/c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/a/b/c\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a/b/c\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/a/b/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/a/b/c\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/a/b/c\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/a/b/c\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/a/b/c\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/c:/foo/bar\",\n    \"base\" : \"file:///c:/baz/qux\",\n    \"inputExpected\" : { \"stringValue\" : \"/c:/foo/bar\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/c:/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/c:/foo/bar\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/c:/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///c:/baz/qux\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/c:/baz/qux\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///c:/baz/qux\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/c:/baz/qux\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///c:/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/c:/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/c:/foo/bar\", \"base\" : \"file:///c:/baz/qux\", \"href\" : \"file:///c:/foo/bar\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/c:/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/c:/foo/bar\",\n    \"base\" : \"file://host/path\",\n    \"inputExpected\" : { \"stringValue\" : \"/c:/foo/bar\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/c:/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/c:/foo/bar\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/c:/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/c:/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/c:/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/c:/foo/bar\", \"base\" : \"file://host/path\", \"href\" : \"file://host/c:/foo/bar\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/c:/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/c|/foo/bar\",\n    \"base\" : \"file:///c:/baz/qux\",\n    \"inputExpected\" : { \"stringValue\" : \"/c|/foo/bar\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/c|/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/c|/foo/bar\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/c|/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///c:/baz/qux\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/c:/baz/qux\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///c:/baz/qux\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/c:/baz/qux\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///c%7C/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/c%7C/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/c|/foo/bar\", \"base\" : \"file:///c:/baz/qux\", \"href\" : \"file:///c:/foo/bar\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/c:/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"/i\",\n    \"base\" : \"sc:///pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:///i\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/i\", \"base\" : \"sc:///pa/pa\", \"href\" : \"sc:///i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/i\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/i\",\n    \"base\" : \"sc://ho/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc://ho/i\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://ho\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/i\", \"base\" : \"sc://ho/pa\", \"href\" : \"sc://ho/i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"ho\", \"hostname\" : \"ho\", \"port\" : \"\", \"pathname\" : \"/i\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/i\",\n    \"base\" : \"sc:/pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:/i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"/i\", \"base\" : \"sc:/pa/pa\", \"href\" : \"sc:/i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/i\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/rooibos\",\n    \"base\" : \"file://tea/\",\n    \"inputExpected\" : { \"stringValue\" : \"/rooibos\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/rooibos\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/rooibos\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/rooibos\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://tea/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"tea\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"tea\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://tea/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"tea\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"tea\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://tea/rooibos\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"tea\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"tea\", \"port\" : null, \"path\" : \"/rooibos\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://tea\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"tea\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"tea\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/rooibos\", \"base\" : \"file://tea/\", \"href\" : \"file://tea/rooibos\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"tea\", \"hostname\" : \"tea\", \"port\" : \"\", \"pathname\" : \"/rooibos\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/some/path\",\n    \"base\" : \"http://user:pass@example.org:21/smth\",\n    \"inputExpected\" : { \"stringValue\" : \"/some/path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/some/path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/some/path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/some/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://user:pass@example.org:21/smth\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@example.org:21\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"example.org\", \"port\" : \"21\", \"path\" : \"/smth\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://user:pass@example.org:21/smth\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@example.org:21\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"example.org\", \"port\" : \"21\", \"path\" : \"/smth\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://user:pass@example.org:21/some/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@example.org:21\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"example.org\", \"port\" : \"21\", \"path\" : \"/some/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org:21\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org:21\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : \"21\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/some/path\", \"base\" : \"http://user:pass@example.org:21/smth\", \"href\" : \"http://user:pass@example.org:21/some/path\", \"origin\" : \"http://example.org:21\", \"protocol\" : \"http:\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"example.org:21\", \"hostname\" : \"example.org\", \"port\" : \"21\", \"pathname\" : \"/some/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/some/path\",\n    \"base\" : \"http://user@example.org/smth\",\n    \"inputExpected\" : { \"stringValue\" : \"/some/path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/some/path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/some/path\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/some/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://user@example.org/smth\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user@example.org\", \"userInfo\" : \"user\", \"username\" : \"user\", \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/smth\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://user@example.org/smth\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user@example.org\", \"userInfo\" : \"user\", \"username\" : \"user\", \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/smth\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://user@example.org/some/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user@example.org\", \"userInfo\" : \"user\", \"username\" : \"user\", \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/some/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/some/path\", \"base\" : \"http://user@example.org/smth\", \"href\" : \"http://user@example.org/some/path\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"user\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/some/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"/test.txt\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"/test.txt\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"/test.txt\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/test.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"/test.txt\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/test.txt\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/test.txt\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"?\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"?\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"?\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/bar?\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : \"\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"?\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar?\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"??a=b&c=d\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"??a=b&c=d\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"?a=b&c=d\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"??a=b&c=d\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"?a=b&c=d\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/bar??a=b&c=d\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : \"?a=b&c=d\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"??a=b&c=d\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar??a=b&c=d\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"??a=b&c=d\", \"searchParams\" : \"%3Fa=b&c=d\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"?a=b&c=d\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"?a=b&c=d\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"a=b&c=d\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"?a=b&c=d\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"a=b&c=d\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/bar?a=b&c=d\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : \"a=b&c=d\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"?a=b&c=d\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar?a=b&c=d\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"?a=b&c=d\", \"searchParams\" : \"a=b&c=d\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"?i\",\n    \"base\" : \"sc:///pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:///pa/pa?i\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : \"i\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"?i\", \"base\" : \"sc:///pa/pa\", \"href\" : \"sc:///pa/pa?i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/pa/pa\", \"search\" : \"?i\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"?i\",\n    \"base\" : \"sc://ho/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc://ho/pa?i\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : \"i\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://ho\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"?i\", \"base\" : \"sc://ho/pa\", \"href\" : \"sc://ho/pa?i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"ho\", \"hostname\" : \"ho\", \"port\" : \"\", \"pathname\" : \"/pa\", \"search\" : \"?i\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"?i\",\n    \"base\" : \"sc:/pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"?i\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"i\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:/pa/pa?i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : \"i\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"?i\", \"base\" : \"sc:/pa/pa\", \"href\" : \"sc:/pa/pa?i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/pa/pa\", \"search\" : \"?i\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"?x\",\n    \"base\" : \"file:///test?test#test\",\n    \"inputExpected\" : { \"stringValue\" : \"?x\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"x\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"?x\", \"type\" : \"PathAndQuery\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"x\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"resolved\" : { \"stringValue\" : \"file:///test?x\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"x\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"?x\", \"base\" : \"file:///test?test#test\", \"href\" : \"file:///test?x\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?x\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"C\",\n    \"base\" : \"file://host/dir/file\",\n    \"inputExpected\" : { \"stringValue\" : \"C\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"C\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/dir/C\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/C\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C\", \"base\" : \"file://host/dir/file\", \"href\" : \"file://host/dir/C\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/dir/C\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"C|\",\n    \"base\" : \"file://host/D:/dir1/dir2/file\",\n    \"inputExpected\" : { \"stringValue\" : \"C|\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"C|\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/D:/dir1/dir2/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/D:/dir1/dir2/file\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/D:/dir1/dir2/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/D:/dir1/dir2/file\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/D:/dir1/dir2/C%7C\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/D:/dir1/dir2/C%7C\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C|\", \"base\" : \"file://host/D:/dir1/dir2/file\", \"href\" : \"file://host/C:\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"C|\",\n    \"base\" : \"file://host/dir/file\",\n    \"inputExpected\" : { \"stringValue\" : \"C|\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"C|\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/dir/C%7C\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/C%7C\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C|\", \"base\" : \"file://host/dir/file\", \"href\" : \"file://host/C:\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"C|#\",\n    \"base\" : \"file://host/dir/file\",\n    \"inputExpected\" : { \"stringValue\" : \"C|#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\", \"query\" : null, \"fragment\" : \"\" },\n    \"inputNormalised\" : { \"stringValue\" : \"C|#\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\", \"query\" : null, \"fragment\" : \"\" },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/dir/C%7C#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/C%7C\", \"query\" : null, \"fragment\" : \"\" },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C|#\", \"base\" : \"file://host/dir/file\", \"href\" : \"file://host/C:#\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"C|/\",\n    \"base\" : \"file://host/\",\n    \"inputExpected\" : { \"stringValue\" : \"C|/\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"C|/\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/C%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/C%7C/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C|/\", \"base\" : \"file://host/\", \"href\" : \"file://host/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"C|/\",\n    \"base\" : \"file://host/dir/file\",\n    \"inputExpected\" : { \"stringValue\" : \"C|/\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"C|/\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/dir/C%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/C%7C/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C|/\", \"base\" : \"file://host/dir/file\", \"href\" : \"file://host/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"C|/foo/bar\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"C|/foo/bar\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"C|/foo/bar\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///tmp/mock/C%7C/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/C%7C/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C|/foo/bar\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///C:/foo/bar\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"C|?\",\n    \"base\" : \"file://host/dir/file\",\n    \"inputExpected\" : { \"stringValue\" : \"C|?\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\", \"query\" : \"\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"C|?\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\", \"query\" : \"\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/dir/C%7C?\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/C%7C\", \"query\" : \"\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C|?\", \"base\" : \"file://host/dir/file\", \"href\" : \"file://host/C:?\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"C|\\\\\",\n    \"base\" : \"file://host/dir/file\",\n    \"inputExpected\" : { \"stringValue\" : \"C|\\\\\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\\\\\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"C|\\\\\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|\\\\\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/dir/C%7C%5C\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/C%7C%5C\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C|\\\\\", \"base\" : \"file://host/dir/file\", \"href\" : \"file://host/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"C|a\",\n    \"base\" : \"file://host/dir/file\",\n    \"inputExpected\" : { \"stringValue\" : \"C|a\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"C|a\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|a\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://host/dir/C%7Ca\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/C%7Ca\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://host\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"C|a\", \"base\" : \"file://host/dir/file\", \"href\" : \"file://host/dir/C|a\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/dir/C|a\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"\\\\//pig\",\n    \"base\" : \"file://lion/\",\n    \"inputExpected\" : { \"stringValue\" : \"\\\\//pig\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\//pig\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\\\\//pig\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\//pig\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://lion/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://lion/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://lion/%5C//pig\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/%5C//pig\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://lion\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"\\\\//pig\", \"base\" : \"file://lion/\", \"href\" : \"file:///pig\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/pig\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"\\\\/localhost//pig\",\n    \"base\" : \"file://lion/\",\n    \"inputExpected\" : { \"stringValue\" : \"\\\\/localhost//pig\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\/localhost//pig\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\\\\/localhost//pig\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\/localhost//pig\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://lion/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://lion/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://lion/%5C/localhost//pig\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"/%5C/localhost//pig\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://lion\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"lion\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"lion\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"\\\\/localhost//pig\", \"base\" : \"file://lion/\", \"href\" : \"file:////pig\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//pig\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"\\\\\\\\server\\\\file\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"\\\\\\\\server\\\\file\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\server\\\\file\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\\\\\\\\server\\\\file\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\server\\\\file\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///tmp/mock/%5C%5Cserver%5Cfile\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/%5C%5Cserver%5Cfile\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"\\\\\\\\server\\\\file\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file://server/file\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"server\", \"hostname\" : \"server\", \"port\" : \"\", \"pathname\" : \"/file\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"\\\\\\\\x\\\\hello\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"\\\\\\\\x\\\\hello\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\x\\\\hello\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\\\\\\\\x\\\\hello\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\x\\\\hello\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/%5C%5Cx%5Chello\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/%5C%5Cx%5Chello\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"\\\\\\\\x\\\\hello\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://x/hello\", \"origin\" : \"http://x\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x\", \"hostname\" : \"x\", \"port\" : \"\", \"pathname\" : \"/hello\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"\\\\x\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"\\\\x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\x\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"\\\\x\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\x\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.org/foo/%5Cx\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/%5Cx\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"\\\\x\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/x\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/x\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"a!@$*=/foo.html\",\n    \"base\" : \"file:///some/dir/bar.html\",\n    \"inputExpected\" : { \"stringValue\" : \"a!@$*=/foo.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a!@$*=/foo.html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"a!@$*=/foo.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a!@$*=/foo.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///some/dir/bar.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/some/dir/bar.html\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///some/dir/bar.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/some/dir/bar.html\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///some/dir/a!@$*=/foo.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/some/dir/a!@$*=/foo.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"a!@$*=/foo.html\", \"base\" : \"file:///some/dir/bar.html\", \"href\" : \"file:///some/dir/a!@$*=/foo.html\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/some/dir/a!@$*=/foo.html\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"a/..//path\",\n    \"base\" : \"non-spec:/p\",\n    \"inputExpected\" : { \"stringValue\" : \"a/..//path\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a/..//path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"a/..//path\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a/..//path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"non-spec://path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"//path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"a/..//path\", \"base\" : \"non-spec:/p\", \"href\" : \"non-spec:/.//path\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"a1234567890-+.:foo/bar\",\n    \"base\" : \"http://example.com/dir/file\",\n    \"inputExpected\" : { \"stringValue\" : \"a1234567890-+.:foo/bar\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a1234567890-+.\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"a1234567890-+.:foo/bar\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a1234567890-+.\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.com/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.com/dir/file\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/dir/file\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"a1234567890-+.:foo/bar\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a1234567890-+.\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"a1234567890-+.:foo/bar\", \"base\" : \"http://example.com/dir/file\", \"href\" : \"a1234567890-+.:foo/bar\", \"protocol\" : \"a1234567890-+.:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"a:\\t foo.com\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"a:\\t foo.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\t foo.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"a:%09%20foo.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%09%20foo.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"a:%09%20foo.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%09%20foo.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"a:\\t foo.com\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"a: foo.com\", \"origin\" : \"null\", \"protocol\" : \"a:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \" foo.com\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"abc:/rooted\",\n    \"base\" : \"abc://host/path\",\n    \"inputExpected\" : { \"stringValue\" : \"abc:/rooted\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/rooted\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"abc:/rooted\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/rooted\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"abc://host/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"abc\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"abc://host/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"abc\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"abc:/rooted\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/rooted\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"abc:/rooted\", \"base\" : \"abc://host/path\", \"href\" : \"abc:/rooted\", \"protocol\" : \"abc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/rooted\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"abc:rootless\",\n    \"base\" : \"abc://host/path\",\n    \"inputExpected\" : { \"stringValue\" : \"abc:rootless\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"rootless\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"abc:rootless\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"rootless\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"abc://host/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"abc\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"abc://host/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"abc\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"abc:rootless\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"rootless\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"abc:rootless\", \"base\" : \"abc://host/path\", \"href\" : \"abc:rootless\", \"protocol\" : \"abc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"rootless\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"abc:rootless\",\n    \"base\" : \"abc:/path\",\n    \"inputExpected\" : { \"stringValue\" : \"abc:rootless\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"rootless\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"abc:rootless\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"rootless\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"abc:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"abc:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"abc:rootless\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"rootless\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"abc:rootless\", \"base\" : \"abc:/path\", \"href\" : \"abc:rootless\", \"protocol\" : \"abc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"rootless\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"abc:rootless\",\n    \"base\" : \"abc:path\",\n    \"inputExpected\" : { \"stringValue\" : \"abc:rootless\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"rootless\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"abc:rootless\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"rootless\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"abc:path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"abc:path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"abc:rootless\", \"type\" : \"OpaqueUri\", \"scheme\" : \"abc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"rootless\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"abc:rootless\", \"base\" : \"abc:path\", \"href\" : \"abc:rootless\", \"protocol\" : \"abc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"rootless\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"about:/../\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"about:/../\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"about:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"about:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"about:/../\", \"href\" : \"about:/\", \"origin\" : \"null\", \"protocol\" : \"about:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"about:blank#<foo> <bar>\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"about:blank#<foo> <bar>\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blank\", \"query\" : null, \"fragment\" : \"<foo> <bar>\" },\n    \"inputNormalised\" : { \"stringValue\" : \"about:blank#%3Cfoo%3E%20%3Cbar%3E\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blank\", \"query\" : null, \"fragment\" : \"%3Cfoo%3E%20%3Cbar%3E\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"about:blank#%3Cfoo%3E%20%3Cbar%3E\", \"type\" : \"OpaqueUri\", \"scheme\" : \"about\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blank\", \"query\" : null, \"fragment\" : \"%3Cfoo%3E%20%3Cbar%3E\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"about:blank#<foo> <bar>\", \"href\" : \"about:blank#%3Cfoo%3E%20%3Cbar%3E\", \"protocol\" : \"about:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"blank\", \"search\" : \"\", \"hash\" : \"#%3Cfoo%3E%20%3Cbar%3E\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"android-app://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"android-app://x:0\", \"type\" : \"Origin\", \"scheme\" : \"android-app\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"android-app://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"android-app\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"android-app://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"android-app\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"android-app://x:0\", \"type\" : \"Origin\", \"scheme\" : \"android-app\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"android-app://x:0\", \"href\" : \"android-app://x:0\", \"origin\" : \"null\", \"protocol\" : \"android-app:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"android://x:0/a\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"android://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"android\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"android://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"android\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"android://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"android\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"android://x:0\", \"type\" : \"Origin\", \"scheme\" : \"android\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"android://x:0/a\", \"href\" : \"android://x:0/a\", \"origin\" : \"null\", \"protocol\" : \"android:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"/a\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"asdf://%43%7C/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"asdf://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"asdf\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"asdf://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"asdf\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"asdf://%43%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"asdf\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"asdf://%43%7C\", \"type\" : \"Origin\", \"scheme\" : \"asdf\", \"authority\" : \"%43%7C\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%43%7C\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"asdf://%43%7C/\", \"href\" : \"asdf://%43%7C/\", \"origin\" : \"null\", \"protocol\" : \"asdf:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"%43%7C\", \"hostname\" : \"%43%7C\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:\", \"href\" : \"blob:\", \"origin\" : \"null\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:about:blank\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:about:blank\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"about:blank\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:about:blank\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"about:blank\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:about:blank\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"about:blank\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:about:blank\", \"href\" : \"blob:about:blank\", \"origin\" : \"null\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"about:blank\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:blob:\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:blob:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blob:\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:blob:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blob:\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:blob:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blob:\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:blob:\", \"href\" : \"blob:blob:\", \"origin\" : \"null\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"blob:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:blob:https://example.org/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:blob:https://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blob:https://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:blob:https://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blob:https://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:blob:https://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"blob:https://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:blob:https://example.org/\", \"href\" : \"blob:blob:https://example.org/\", \"origin\" : \"null\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"blob:https://example.org/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"href\" : \"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"origin\" : \"null\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"d3958f5c-0777-0845-9dcf-2cb28783acaf\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:file://host/path\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:file://host/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"file://host/path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:file://host/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"file://host/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:file://host/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"file://host/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:file://host/path\", \"href\" : \"blob:file://host/path\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"file://host/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:ftp://host/path\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:ftp://host/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"ftp://host/path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:ftp://host/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"ftp://host/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:ftp://host/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"ftp://host/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:ftp://host/path\", \"href\" : \"blob:ftp://host/path\", \"origin\" : \"null\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"ftp://host/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:http%3a//example.org/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:http%3a//example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"http%3a//example.org/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:http://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"http://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:http://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"http://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:http%3a//example.org/\", \"href\" : \"blob:http%3a//example.org/\", \"origin\" : \"null\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"http%3a//example.org/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"blob:http://example.org:88/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:http://example.org:88/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"http://example.org:88/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:http://example.org:88/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"http://example.org:88/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:http://example.org:88/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"http://example.org:88/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:http://example.org:88/\", \"href\" : \"blob:http://example.org:88/\", \"origin\" : \"http://example.org:88\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"http://example.org:88/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:https://example.com:443/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:https://example.com:443/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"https://example.com:443/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:https://example.com:443/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"https://example.com:443/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:https://example.com:443/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"https://example.com:443/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:https://example.com:443/\", \"href\" : \"blob:https://example.com:443/\", \"origin\" : \"https://example.com\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"https://example.com:443/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:ws://example.org/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:ws://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"ws://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:ws://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"ws://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:ws://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"ws://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:ws://example.org/\", \"href\" : \"blob:ws://example.org/\", \"origin\" : \"null\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"ws://example.org/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"blob:wss://example.org/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"blob:wss://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"wss://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"blob:wss://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"wss://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"blob:wss://example.org/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"blob\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"wss://example.org/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"blob:wss://example.org/\", \"href\" : \"blob:wss://example.org/\", \"origin\" : \"null\", \"protocol\" : \"blob:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"wss://example.org/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"c:/foo\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"c:/foo\", \"type\" : \"OpaqueUri\", \"scheme\" : \"c\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"c:/foo\", \"type\" : \"OpaqueUri\", \"scheme\" : \"c\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"c:/foo\", \"type\" : \"OpaqueUri\", \"scheme\" : \"c\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"c:/foo\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"c:/foo\", \"origin\" : \"null\", \"protocol\" : \"c:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"chrome-distiller://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"chrome-distiller://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-distiller\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"chrome-distiller://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-distiller\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"chrome-distiller://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-distiller\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"chrome-distiller://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-distiller\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"chrome-distiller://x:0\", \"href\" : \"chrome-distiller://x:0\", \"origin\" : \"null\", \"protocol\" : \"chrome-distiller:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"chrome-extension://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"chrome-extension://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-extension\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"chrome-extension://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-extension\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"chrome-extension://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-extension\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"chrome-extension://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-extension\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"chrome-extension://x:0\", \"href\" : \"chrome-extension://x:0\", \"origin\" : \"null\", \"protocol\" : \"chrome-extension:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"chrome-native://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"chrome-native://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-native\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"chrome-native://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-native\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"chrome-native://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-native\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"chrome-native://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-native\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"chrome-native://x:0\", \"href\" : \"chrome-native://x:0\", \"origin\" : \"null\", \"protocol\" : \"chrome-native:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"chrome-resource://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"chrome-resource://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-resource\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"chrome-resource://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-resource\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"chrome-resource://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-resource\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"chrome-resource://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-resource\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"chrome-resource://x:0\", \"href\" : \"chrome-resource://x:0\", \"origin\" : \"null\", \"protocol\" : \"chrome-resource:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"chrome-search://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"chrome-search://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-search\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"chrome-search://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-search\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"chrome-search://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"chrome-search\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"chrome-search://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chrome-search\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"chrome-search://x:0\", \"href\" : \"chrome-search://x:0\", \"origin\" : \"null\", \"protocol\" : \"chrome-search:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"chromeos-steam://x:0/a\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"chromeos-steam://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"chromeos-steam\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"chromeos-steam://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"chromeos-steam\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"chromeos-steam://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"chromeos-steam\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"chromeos-steam://x:0\", \"type\" : \"Origin\", \"scheme\" : \"chromeos-steam\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"chromeos-steam://x:0/a\", \"href\" : \"chromeos-steam://x:0/a\", \"origin\" : \"null\", \"protocol\" : \"chromeos-steam:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"/a\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data:/../\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"data:/../\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"data:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"data:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"data:/../\", \"href\" : \"data:/\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data:///test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"data:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"data\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"data:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"data\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"data:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"data\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"data://\", \"type\" : \"Origin\", \"scheme\" : \"data\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"data:///test\", \"href\" : \"data:///test\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data://example.com:8080/pathname?search#hash\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"data://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"data\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"inputNormalised\" : { \"stringValue\" : \"data://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"data\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"data://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"data\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"origin\" : { \"stringValue\" : \"data://example.com:8080\", \"type\" : \"Origin\", \"scheme\" : \"data\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"data://example.com:8080/pathname?search#hash\", \"href\" : \"data://example.com:8080/pathname?search#hash\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com:8080\", \"hostname\" : \"example.com\", \"port\" : \"8080\", \"pathname\" : \"/pathname\", \"search\" : \"?search\", \"hash\" : \"#hash\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data://test/a/../b\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"data://test/a/../b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"data\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/a/../b\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"data://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"data\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"data://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"data\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"data://test\", \"type\" : \"Origin\", \"scheme\" : \"data\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"data://test/a/../b\", \"href\" : \"data://test/b\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/b\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"data:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"data:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"data:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"data:/example.com/\", \"href\" : \"data:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"data:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"data:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"data:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"data:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"data:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"data:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"data:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"data:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"data:example.com/\", \"href\" : \"data:example.com/\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"data:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"data:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"data:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"data:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"data:example.com/\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data:test# »\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"data:test# »\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : \" »\" },\n    \"inputNormalised\" : { \"stringValue\" : \"data:test#%20%C2%BB\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : \"%20%C2%BB\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"data:test#%20%C2%BB\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : \"%20%C2%BB\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"data:test# »\", \"href\" : \"data:test#%20%C2%BB\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"test\", \"search\" : \"\", \"hash\" : \"#%20%C2%BB\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data:text/html,test#test\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"data:text/html,test#test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"text/html,test\", \"query\" : null, \"fragment\" : \"test\" },\n    \"inputNormalised\" : { \"stringValue\" : \"data:text/html,test#test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"text/html,test\", \"query\" : null, \"fragment\" : \"test\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"data:text/html,test#test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"text/html,test\", \"query\" : null, \"fragment\" : \"test\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"data:text/html,test#test\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"data:text/html,test#test\", \"origin\" : \"null\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"text/html,test\", \"search\" : \"\", \"hash\" : \"#test\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"data:text/plain,test#<foo> <bar>\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"data:text/plain,test#<foo> <bar>\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"text/plain,test\", \"query\" : null, \"fragment\" : \"<foo> <bar>\" },\n    \"inputNormalised\" : { \"stringValue\" : \"data:text/plain,test#%3Cfoo%3E%20%3Cbar%3E\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"text/plain,test\", \"query\" : null, \"fragment\" : \"%3Cfoo%3E%20%3Cbar%3E\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"data:text/plain,test#%3Cfoo%3E%20%3Cbar%3E\", \"type\" : \"OpaqueUri\", \"scheme\" : \"data\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"text/plain,test\", \"query\" : null, \"fragment\" : \"%3Cfoo%3E%20%3Cbar%3E\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"data:text/plain,test#<foo> <bar>\", \"href\" : \"data:text/plain,test#%3Cfoo%3E%20%3Cbar%3E\", \"protocol\" : \"data:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"text/plain,test\", \"search\" : \"\", \"hash\" : \"#%3Cfoo%3E%20%3Cbar%3E\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"dns://fw.example.org:9999/foo.bar.org?type=TXT\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"dns://fw.example.org:9999/foo.bar.org?type=TXT\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"dns\", \"authority\" : \"fw.example.org:9999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"fw.example.org\", \"port\" : \"9999\", \"path\" : \"/foo.bar.org\", \"query\" : \"type=TXT\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"dns://fw.example.org:9999/foo.bar.org?type=TXT\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"dns\", \"authority\" : \"fw.example.org:9999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"fw.example.org\", \"port\" : \"9999\", \"path\" : \"/foo.bar.org\", \"query\" : \"type=TXT\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"dns://fw.example.org:9999/foo.bar.org?type=TXT\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"dns\", \"authority\" : \"fw.example.org:9999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"fw.example.org\", \"port\" : \"9999\", \"path\" : \"/foo.bar.org\", \"query\" : \"type=TXT\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"dns://fw.example.org:9999\", \"type\" : \"Origin\", \"scheme\" : \"dns\", \"authority\" : \"fw.example.org:9999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"fw.example.org\", \"port\" : \"9999\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"dns://fw.example.org:9999/foo.bar.org?type=TXT\", \"href\" : \"dns://fw.example.org:9999/foo.bar.org?type=TXT\", \"origin\" : \"null\", \"protocol\" : \"dns:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"fw.example.org:9999\", \"hostname\" : \"fw.example.org\", \"port\" : \"9999\", \"pathname\" : \"/foo.bar.org\", \"search\" : \"?type=TXT\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"drivefs://x:0/a\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"drivefs://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"drivefs\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"drivefs://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"drivefs\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"drivefs://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"drivefs\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"drivefs://x:0\", \"type\" : \"Origin\", \"scheme\" : \"drivefs\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"drivefs://x:0/a\", \"href\" : \"drivefs://x:0/a\", \"origin\" : \"null\", \"protocol\" : \"drivefs:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"/a\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:\",\n    \"base\" : \"file:///test?test#test\",\n    \"inputExpected\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"resolved\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:\", \"base\" : \"file:///test?test#test\", \"href\" : \"file:///test?test\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?test\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:#frag\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:#frag\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"frag\" },\n    \"inputNormalised\" : { \"stringValue\" : \"file:#frag\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"frag\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:#frag\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"frag\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:#frag\", \"href\" : \"file:///#frag\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"#frag\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:#x\",\n    \"base\" : \"file:///test?test#test\",\n    \"inputExpected\" : { \"stringValue\" : \"file:#x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"inputNormalised\" : { \"stringValue\" : \"file:#x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"baseExpected\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"resolved\" : { \"stringValue\" : \"file:#x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"x\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:#x\", \"base\" : \"file:///test?test#test\", \"href\" : \"file:///test?test#x\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?test\", \"hash\" : \"#x\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:.\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \".\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:.\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:.\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"file:.\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \".\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:.\", \"base\" : \"http://www.example.com/test\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:..\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"file:..\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:..\", \"base\" : \"http://www.example.com/test\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:...\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"file:...\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"...\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:...\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"...\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:...\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"...\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:...\", \"base\" : \"http://www.example.com/test\", \"href\" : \"file:///...\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/...\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:.//p\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:.//p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \".//p\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:.//p\", \"href\" : \"file:////p\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//p\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:/.//p\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:/.//p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/.//p\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:/.//p\", \"href\" : \"file:////p\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//p\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://\",\n    \"base\" : \"file://ape/\",\n    \"inputExpected\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://ape/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"ape\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ape\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://ape/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"ape\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ape\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://\", \"base\" : \"file://ape/\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///.//\",\n    \"base\" : \"file:////\",\n    \"inputExpected\" : { \"stringValue\" : \"file:///.//\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/.//\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:////\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:////\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:////\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:////\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///.//\", \"base\" : \"file:////\", \"href\" : \"file:////\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///./Y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///./Y\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/./Y\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///Y\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///Y\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///./Y\", \"href\" : \"file:///Y\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/Y\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///./Y:\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///./Y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/./Y:\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///Y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y:\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///Y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y:\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///./Y:\", \"href\" : \"file:///Y:\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/Y:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///./y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///./y\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/./y\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///y\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///y\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///./y\", \"href\" : \"file:///y\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/y\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///./y:\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///./y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/./y:\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y:\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y:\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///./y:\", \"href\" : \"file:///y:\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/y:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:////foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:////foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:////foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:////foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:////foo\", \"href\" : \"file:////foo\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:////one/two\",\n    \"base\" : \"file:///\",\n    \"inputExpected\" : { \"stringValue\" : \"file:////one/two\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//one/two\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:////one/two\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//one/two\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:////one/two\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//one/two\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:////one/two\", \"base\" : \"file:///\", \"href\" : \"file:////one/two\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//one/two\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///C%3A/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///C%3A/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C%3A/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///C%3A/\", \"href\" : \"file:///C%3A/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C%3A/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:///C%7C/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///C%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C%7C/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///C%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C%7C/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///C%7C/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C%7C/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///C%7C/\", \"href\" : \"file:///C%7C/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C%7C/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///C:/\",\n    \"base\" : \"file://host/\",\n    \"inputExpected\" : { \"stringValue\" : \"file:///C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///C:/\", \"base\" : \"file://host/\", \"href\" : \"file:///C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///Y:\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///Y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y:\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///Y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y:\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///Y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y:\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///Y:\", \"href\" : \"file:///Y:\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/Y:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///Y:/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///Y:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///Y:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///Y:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/Y:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///Y:/\", \"href\" : \"file:///Y:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/Y:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///foo/bar.txt\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"file:///foo/bar.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/foo/bar.txt\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///foo/bar.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/foo/bar.txt\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///foo/bar.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/foo/bar.txt\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///foo/bar.txt\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///foo/bar.txt\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/foo/bar.txt\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///home/me\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"file:///home/me\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/home/me\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///home/me\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/home/me\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///home/me\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/home/me\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///home/me\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///home/me\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/home/me\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///localhost//cat\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///localhost//cat\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/localhost//cat\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///localhost//cat\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/localhost//cat\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///localhost//cat\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/localhost//cat\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///localhost//cat\", \"href\" : \"file:///localhost//cat\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/localhost//cat\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///one/two\",\n    \"base\" : \"file:///\",\n    \"inputExpected\" : { \"stringValue\" : \"file:///one/two\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/one/two\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///one/two\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/one/two\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///one/two\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/one/two\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///one/two\", \"base\" : \"file:///\", \"href\" : \"file:///one/two\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/one/two\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///w|/m\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///w|/m\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/w|/m\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///w%7C/m\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/w%7C/m\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///w%7C/m\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/w%7C/m\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///w|/m\", \"href\" : \"file:///w:/m\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/w:/m\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:///w|m\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///w|m\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/w|m\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///w%7Cm\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/w%7Cm\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///w%7Cm\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/w%7Cm\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///w|m\", \"href\" : \"file:///w|m\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/w|m\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:///w||m\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///w||m\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/w||m\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///w%7C%7Cm\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/w%7C%7Cm\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///w%7C%7Cm\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/w%7C%7Cm\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///w||m\", \"href\" : \"file:///w||m\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/w||m\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:///y:\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y:\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y:\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///y:\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y:\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///y:\", \"href\" : \"file:///y:\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/y:\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:///y:/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:///y:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:///y:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:///y:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/y:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file:///y:/\", \"href\" : \"file:///y:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/y:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file://1.2.3.4/C:/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://1.2.3.4/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://1.2.3.4/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://1.2.3.4/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://1.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://1.2.3.4/C:/\", \"href\" : \"file://1.2.3.4/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"1.2.3.4\", \"hostname\" : \"1.2.3.4\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file://C:/\",\n    \"base\" : \"file://host/\",\n    \"inputExpected\" : { \"stringValue\" : \"file://C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"C:\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"C\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://c/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"c\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"c\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://c/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"c\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"c\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://c\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"c\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"c\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://C:/\", \"base\" : \"file://host/\", \"href\" : \"file:///C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://[1::8]/C:/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://[1::8]/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"[1::8]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1::8]\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://[1::8]/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"[1::8]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1::8]\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://[1::8]/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"[1::8]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1::8]\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://[1::8]\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"[1::8]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1::8]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://[1::8]/C:/\", \"href\" : \"file://[1::8]/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[1::8]\", \"hostname\" : \"[1::8]\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file://a%C2%ADb/p\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://a%C2%ADb/p\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"a%C2%ADb\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a%C2%ADb\", \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://a%C2%ADb/p\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"a%C2%ADb\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a%C2%ADb\", \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://a%C2%ADb/p\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"a%C2%ADb\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a%C2%ADb\", \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://a%C2%ADb\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"a%C2%ADb\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a%C2%ADb\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://a%C2%ADb/p\", \"href\" : \"file://ab/p\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"ab\", \"hostname\" : \"ab\", \"port\" : \"\", \"pathname\" : \"/p\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://example.net/C:/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://example.net/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"example.net\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.net\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://example.net/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"example.net\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.net\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://example.net/C:/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"example.net\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.net\", \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://example.net\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"example.net\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.net\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://example.net/C:/\", \"href\" : \"file://example.net/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.net\", \"hostname\" : \"example.net\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file://localhost\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"file://localhost\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://localhost/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://localhost/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://localhost\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://localhost\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://localhost/\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"file://localhost/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://localhost/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://localhost/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://localhost\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://localhost/\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://localhost////foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://localhost////foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"////foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://localhost////foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"////foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://localhost////foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"////foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://localhost\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://localhost////foo\", \"href\" : \"file://////foo\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"////foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://localhost//a//../..//\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://localhost//a//../..//\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"//a//../..//\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://localhost///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"///\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://localhost///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"///\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://localhost\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://localhost//a//../..//\", \"href\" : \"file://///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"///\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://localhost//a//../..//foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://localhost//a//../..//foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"//a//../..//foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://localhost///foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"///foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://localhost///foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"///foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://localhost\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://localhost//a//../..//foo\", \"href\" : \"file://///foo\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"///foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://localhost/test\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"file://localhost/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://localhost/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://localhost/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://localhost\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"localhost\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://localhost/test\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///test\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file://spider///\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file://spider///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"spider\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"spider\", \"port\" : null, \"path\" : \"///\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://spider///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"spider\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"spider\", \"port\" : null, \"path\" : \"///\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file://spider///\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"spider\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"spider\", \"port\" : null, \"path\" : \"///\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://spider\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"spider\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"spider\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://spider///\", \"href\" : \"file://spider///\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"spider\", \"hostname\" : \"spider\", \"port\" : \"\", \"pathname\" : \"///\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file://test\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"file://test\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file://test/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file://test/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://test\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"file://test\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file://test/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"file:/C:/\",\n    \"base\" : \"file://host/\",\n    \"inputExpected\" : { \"stringValue\" : \"file:/C:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:/C:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:/C:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:/C:/\", \"base\" : \"file://host/\", \"href\" : \"file://host/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:/C|/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:/C|/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C|/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:/C%7C/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C%7C/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:/C%7C/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/C%7C/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:/C|/\", \"href\" : \"file:///C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:/example.com/\", \"href\" : \"file:///example.com/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"file:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"file:///example.com/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:?q=v\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:?q=v\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"q=v\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:?q=v\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"q=v\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:?q=v\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"q=v\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:?q=v\", \"href\" : \"file:///?q=v\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"?q=v\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:?x\",\n    \"base\" : \"file:///test?test#test\",\n    \"inputExpected\" : { \"stringValue\" : \"file:?x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"x\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:?x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"x\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///test?test#test\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"test\", \"fragment\" : \"test\" },\n    \"resolved\" : { \"stringValue\" : \"file:?x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : \"x\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:?x\", \"base\" : \"file:///test?test#test\", \"href\" : \"file:///test?x\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?x\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:C:/\",\n    \"base\" : \"file://host/\",\n    \"inputExpected\" : { \"stringValue\" : \"file:C:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C:/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:C:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C:/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file://host/\", \"type\" : \"BaseUrl\", \"scheme\" : \"file\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:C:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C:/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:C:/\", \"base\" : \"file://host/\", \"href\" : \"file://host/C:/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/C:/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:C|/m/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:C|/m/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C|/m/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:C%7C/m/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C%7C/m/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:C%7C/m/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C%7C/m/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:C|/m/\", \"href\" : \"file:///C:/m/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/m/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:C||/m/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:C||/m/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C||/m/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:C%7C%7C/m/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C%7C%7C/m/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:C%7C%7C/m/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"C%7C%7C/m/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:C||/m/\", \"href\" : \"file:///C||/m/\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C||/m/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:\\\\\\\\//\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:\\\\\\\\//\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\//\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:%5C%5C//\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5C//\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:%5C%5C//\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5C//\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:\\\\\\\\//\", \"href\" : \"file:////\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:\\\\\\\\\\\\\\\\\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:\\\\\\\\\\\\\\\\\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\\\\\\\\\\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:%5C%5C%5C%5C\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5C%5C%5C\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:%5C%5C%5C%5C\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5C%5C%5C\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:\\\\\\\\\\\\\\\\\", \"href\" : \"file:////\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:\\\\\\\\\\\\\\\\#guppy\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:\\\\\\\\\\\\\\\\#guppy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\\\\\\\\\\", \"query\" : null, \"fragment\" : \"guppy\" },\n    \"inputNormalised\" : { \"stringValue\" : \"file:%5C%5C%5C%5C#guppy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5C%5C%5C\", \"query\" : null, \"fragment\" : \"guppy\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:%5C%5C%5C%5C#guppy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5C%5C%5C\", \"query\" : null, \"fragment\" : \"guppy\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:\\\\\\\\\\\\\\\\#guppy\", \"href\" : \"file:////#guppy\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"#guppy\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:\\\\\\\\\\\\\\\\?fox\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:\\\\\\\\\\\\\\\\?fox\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\\\\\\\\\\", \"query\" : \"fox\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:%5C%5C%5C%5C?fox\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5C%5C%5C\", \"query\" : \"fox\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:%5C%5C%5C%5C?fox\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5C%5C%5C\", \"query\" : \"fox\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:\\\\\\\\\\\\\\\\?fox\", \"href\" : \"file:////?fox\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"?fox\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:\\\\\\\\localhost//\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"file:\\\\\\\\localhost//\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\localhost//\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:%5C%5Clocalhost//\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Clocalhost//\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"file:%5C%5Clocalhost//\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Clocalhost//\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:\\\\\\\\localhost//\", \"href\" : \"file:////\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:\\\\c:\\\\foo\\\\bar\",\n    \"base\" : \"file:///c:/baz/qux\",\n    \"inputExpected\" : { \"stringValue\" : \"file:\\\\c:\\\\foo\\\\bar\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\c:\\\\foo\\\\bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:%5Cc:%5Cfoo%5Cbar\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5Cc:%5Cfoo%5Cbar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///c:/baz/qux\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/c:/baz/qux\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///c:/baz/qux\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/c:/baz/qux\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:%5Cc:%5Cfoo%5Cbar\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5Cc:%5Cfoo%5Cbar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:\\\\c:\\\\foo\\\\bar\", \"base\" : \"file:///c:/baz/qux\", \"href\" : \"file:///c:/foo/bar\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/c:/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:a\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"file:a\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:a\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:a\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:a\", \"base\" : \"http://www.example.com/test\", \"href\" : \"file:///a\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/a\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:c:\\\\foo\\\\bar.html\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"file:c:\\\\foo\\\\bar.html\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"c:\\\\foo\\\\bar.html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:c:%5Cfoo%5Cbar.html\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"c:%5Cfoo%5Cbar.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:c:%5Cfoo%5Cbar.html\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"c:%5Cfoo%5Cbar.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:c:\\\\foo\\\\bar.html\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///c:/foo/bar.html\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/c:/foo/bar.html\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"file:test\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"file:test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"file:test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:test\", \"type\" : \"OpaqueUri\", \"scheme\" : \"file\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"file:test\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///tmp/mock/test\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/tmp/mock/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"foo:/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"foo:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"foo\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"foo:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"foo\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"foo:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"foo\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"foo:/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"foo:/\", \"origin\" : \"null\", \"protocol\" : \"foo:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"foo://\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"foo://\", \"type\" : \"Origin\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"foo:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"foo:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"foo://\", \"type\" : \"Origin\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"foo://\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"foo://\", \"origin\" : \"null\", \"protocol\" : \"foo:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"foo://///////\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"foo://///////\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"///////\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"foo://///////\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"///////\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"foo://///////\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"///////\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"foo://\", \"type\" : \"Origin\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"foo://///////\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"foo://///////\", \"origin\" : \"null\", \"protocol\" : \"foo:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"///////\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"foo://///////bar.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"foo://///////bar.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"///////bar.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"foo://///////bar.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"///////bar.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"foo://///////bar.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"///////bar.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"foo://\", \"type\" : \"Origin\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"foo://///////bar.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"foo://///////bar.com/\", \"origin\" : \"null\", \"protocol\" : \"foo:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"///////bar.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"foo:////://///\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"foo:////://///\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//://///\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"foo:////://///\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//://///\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"foo:////://///\", \"type\" : \"BaseUrl\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"//://///\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"foo://\", \"type\" : \"Origin\", \"scheme\" : \"foo\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"foo:////://///\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"foo:////://///\", \"origin\" : \"null\", \"protocol\" : \"foo:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//://///\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"foo://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"foo://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"foo://host/%20!%22$%25&'()*+,-./:;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/%20!%22$%25&'()*+,-./:;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"foo://host/%20!%22$%25&'()*+,-./:;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/%20!%22$%25&'()*+,-./:;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"foo://host\", \"type\" : \"Origin\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"foo://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\", \"href\" : \"foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\\\]%5E_%60%7B|%7D~\", \"origin\" : \"null\", \"protocol\" : \"foo:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/%20!%22$%&'()*+,-./:;%3C=%3E@[\\\\]%5E_%60%7B|%7D~\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"foo://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"foo://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : null, \"fragment\" : \" !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\" },\n    \"inputNormalised\" : { \"stringValue\" : \"foo://host/dir/#%20!%22%23$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : null, \"fragment\" : \"%20!%22%23$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"foo://host/dir/#%20!%22%23$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : null, \"fragment\" : \"%20!%22%23$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\" },\n    \"origin\" : { \"stringValue\" : \"foo://host\", \"type\" : \"Origin\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"foo://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"href\" : \"foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\", \"origin\" : \"null\", \"protocol\" : \"foo:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/dir/\", \"search\" : \"\", \"hash\" : \"#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"foo://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"foo://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : \" !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"foo://host/dir/?%20!%22$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : \"%20!%22$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"foo://host/dir/?%20!%22$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : \"%20!%22$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"foo://host\", \"type\" : \"Origin\", \"scheme\" : \"foo\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"foo://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"href\" : \"foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\", \"origin\" : \"null\", \"protocol\" : \"foo:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/dir/\", \"search\" : \"?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"foo:/bar.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"foo:/bar.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"foo\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/bar.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"foo:/bar.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"foo\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/bar.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"foo:/bar.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"foo\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/bar.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"foo:/bar.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"foo:/bar.com/\", \"origin\" : \"null\", \"protocol\" : \"foo:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/bar.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ftp://%e2%98%83\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ftp://%e2%98%83\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"%e2%98%83\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%e2%98%83\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftp://%E2%98%83/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"%E2%98%83\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%98%83\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ftp://%E2%98%83/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"%E2%98%83\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%98%83\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ftp://%E2%98%83\", \"type\" : \"Origin\", \"scheme\" : \"ftp\", \"authority\" : \"%E2%98%83\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%98%83\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ftp://%e2%98%83\", \"href\" : \"ftp://xn--n3h/\", \"origin\" : \"ftp://xn--n3h\", \"protocol\" : \"ftp:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"xn--n3h\", \"hostname\" : \"xn--n3h\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ftp://foo:21/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ftp://foo:21/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"foo:21\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"21\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftp://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ftp://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ftp://foo\", \"type\" : \"Origin\", \"scheme\" : \"ftp\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ftp://foo:21/\", \"href\" : \"ftp://foo/\", \"origin\" : \"ftp://foo\", \"protocol\" : \"ftp:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo\", \"hostname\" : \"foo\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ftp://foo:80/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ftp://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftp://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ftp://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ftp\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ftp://foo:80\", \"type\" : \"Origin\", \"scheme\" : \"ftp\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ftp://foo:80/\", \"href\" : \"ftp://foo:80/\", \"origin\" : \"ftp://foo:80\", \"protocol\" : \"ftp:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:80\", \"hostname\" : \"foo\", \"port\" : \"80\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ftp:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ftp:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftp:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ftp:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ftp:/example.com/\", \"href\" : \"ftp://example.com/\", \"origin\" : \"ftp://example.com\", \"protocol\" : \"ftp:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ftp:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"ftp:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftp:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"ftp:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ftp:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"ftp://example.com/\", \"origin\" : \"ftp://example.com\", \"protocol\" : \"ftp:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ftp:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ftp:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftp:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ftp:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ftp:example.com/\", \"href\" : \"ftp://example.com/\", \"origin\" : \"ftp://example.com\", \"protocol\" : \"ftp:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ftp:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"ftp:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftp:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"ftp:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftp\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ftp:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"ftp://example.com/\", \"origin\" : \"ftp://example.com\", \"protocol\" : \"ftp:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ftps:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ftps:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftps:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ftps:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ftps:/example.com/\", \"href\" : \"ftps:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"ftps:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ftps:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"ftps:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftps:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"ftps:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ftps:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"ftps:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"ftps:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ftps:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ftps:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftps:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ftps:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ftps:example.com/\", \"href\" : \"ftps:example.com/\", \"origin\" : \"null\", \"protocol\" : \"ftps:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ftps:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"ftps:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ftps:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"ftps:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ftps\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ftps:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"ftps:example.com/\", \"origin\" : \"null\", \"protocol\" : \"ftps:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"fuchsia-dir://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"fuchsia-dir://x:0\", \"type\" : \"Origin\", \"scheme\" : \"fuchsia-dir\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"fuchsia-dir://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"fuchsia-dir\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"fuchsia-dir://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"fuchsia-dir\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"fuchsia-dir://x:0\", \"type\" : \"Origin\", \"scheme\" : \"fuchsia-dir\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"fuchsia-dir://x:0\", \"href\" : \"fuchsia-dir://x:0\", \"origin\" : \"null\", \"protocol\" : \"fuchsia-dir:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"git+https://github.com/foo/bar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"git+https://github.com/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"git+https\", \"authority\" : \"github.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"github.com\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"git+https://github.com/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"git+https\", \"authority\" : \"github.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"github.com\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"git+https://github.com/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"git+https\", \"authority\" : \"github.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"github.com\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"git+https://github.com\", \"type\" : \"Origin\", \"scheme\" : \"git+https\", \"authority\" : \"github.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"github.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"git+https://github.com/foo/bar\", \"href\" : \"git+https://github.com/foo/bar\", \"origin\" : \"null\", \"protocol\" : \"git+https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"github.com\", \"hostname\" : \"github.com\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"git://github.com/foo/bar.git\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"git://github.com/foo/bar.git\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"git\", \"authority\" : \"github.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"github.com\", \"port\" : null, \"path\" : \"/foo/bar.git\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"git://github.com/foo/bar.git\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"git\", \"authority\" : \"github.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"github.com\", \"port\" : null, \"path\" : \"/foo/bar.git\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"git://github.com/foo/bar.git\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"git\", \"authority\" : \"github.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"github.com\", \"port\" : null, \"path\" : \"/foo/bar.git\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"git://github.com\", \"type\" : \"Origin\", \"scheme\" : \"git\", \"authority\" : \"github.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"github.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"git://github.com/foo/bar.git\", \"href\" : \"git://github.com/foo/bar.git\", \"origin\" : \"null\", \"protocol\" : \"git:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"github.com\", \"hostname\" : \"github.com\", \"port\" : \"\", \"pathname\" : \"/foo/bar.git\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"gopher://foo:443/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"gopher://foo:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"gopher\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"gopher://foo:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"gopher\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"gopher://foo:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"gopher\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"gopher://foo:443\", \"type\" : \"Origin\", \"scheme\" : \"gopher\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"gopher://foo:443/\", \"href\" : \"gopher://foo:443/\", \"origin\" : \"null\", \"protocol\" : \"gopher:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:443\", \"hostname\" : \"foo\", \"port\" : \"443\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"gopher://foo:70/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"gopher://foo:70/\", \"type\" : \"BaseUrl\", \"scheme\" : \"gopher\", \"authority\" : \"foo:70\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"70\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"gopher://foo:70/\", \"type\" : \"BaseUrl\", \"scheme\" : \"gopher\", \"authority\" : \"foo:70\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"70\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"gopher://foo:70/\", \"type\" : \"BaseUrl\", \"scheme\" : \"gopher\", \"authority\" : \"foo:70\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"70\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"gopher://foo:70\", \"type\" : \"Origin\", \"scheme\" : \"gopher\", \"authority\" : \"foo:70\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"70\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"gopher://foo:70/\", \"href\" : \"gopher://foo:70/\", \"origin\" : \"null\", \"protocol\" : \"gopher:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:70\", \"hostname\" : \"foo\", \"port\" : \"70\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"gopher:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"gopher:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"gopher:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"gopher:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"gopher:/example.com/\", \"href\" : \"gopher:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"gopher:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"gopher:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"gopher:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"gopher:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"gopher:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"gopher:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"gopher:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"gopher:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"gopher:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"gopher:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"gopher:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"gopher:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"gopher:example.com/\", \"href\" : \"gopher:example.com/\", \"origin\" : \"null\", \"protocol\" : \"gopher:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"gopher:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"gopher:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"gopher:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"gopher:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"gopher\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"gopher:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"gopher:example.com/\", \"origin\" : \"null\", \"protocol\" : \"gopher:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"h://.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"h://.\", \"type\" : \"Origin\", \"scheme\" : \"h\", \"authority\" : \".\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \".\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"h://./\", \"type\" : \"BaseUrl\", \"scheme\" : \"h\", \"authority\" : \".\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \".\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"h://./\", \"type\" : \"BaseUrl\", \"scheme\" : \"h\", \"authority\" : \".\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \".\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"h://.\", \"type\" : \"Origin\", \"scheme\" : \"h\", \"authority\" : \".\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \".\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"h://.\", \"href\" : \"h://.\", \"origin\" : \"null\", \"protocol\" : \"h:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \".\", \"hostname\" : \".\", \"port\" : \"\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/bar\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/bar\", \"search\" : \"\", \"searchParams\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://%25DOMAIN:foobar@foodomain.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://%25DOMAIN:foobar@foodomain.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%25DOMAIN:foobar@foodomain.com\", \"userInfo\" : \"%25DOMAIN:foobar\", \"username\" : \"%25DOMAIN\", \"password\" : \"foobar\", \"host\" : \"foodomain.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://%25DOMAIN:foobar@foodomain.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%25DOMAIN:foobar@foodomain.com\", \"userInfo\" : \"%25DOMAIN:foobar\", \"username\" : \"%25DOMAIN\", \"password\" : \"foobar\", \"host\" : \"foodomain.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://%25DOMAIN:foobar@foodomain.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%25DOMAIN:foobar@foodomain.com\", \"userInfo\" : \"%25DOMAIN:foobar\", \"username\" : \"%25DOMAIN\", \"password\" : \"foobar\", \"host\" : \"foodomain.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foodomain.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foodomain.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foodomain.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://%25DOMAIN:foobar@foodomain.com/\", \"href\" : \"http://%25DOMAIN:foobar@foodomain.com/\", \"origin\" : \"http://foodomain.com\", \"protocol\" : \"http:\", \"username\" : \"%25DOMAIN\", \"password\" : \"foobar\", \"host\" : \"foodomain.com\", \"hostname\" : \"foodomain.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://%30%78%63%30%2e%30%32%35%30.01\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://%30%78%63%30%2e%30%32%35%30.01\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%30%78%63%30%2e%30%32%35%30.01\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%30%78%63%30%2e%30%32%35%30.01\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://%30%78%63%30%2E%30%32%35%30.01/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%30%78%63%30%2E%30%32%35%30.01\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%30%78%63%30%2E%30%32%35%30.01\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://%30%78%63%30%2E%30%32%35%30.01/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%30%78%63%30%2E%30%32%35%30.01\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%30%78%63%30%2E%30%32%35%30.01\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://%30%78%63%30%2E%30%32%35%30.01\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"%30%78%63%30%2E%30%32%35%30.01\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%30%78%63%30%2E%30%32%35%30.01\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://%30%78%63%30%2e%30%32%35%30.01\", \"base\" : \"http://other.com/\", \"href\" : \"http://192.168.0.1/\", \"origin\" : \"http://192.168.0.1\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"192.168.0.1\", \"hostname\" : \"192.168.0.1\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://%30%78%63%30%2e%30%32%35%30.01%2e\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://%30%78%63%30%2e%30%32%35%30.01%2e\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%30%78%63%30%2e%30%32%35%30.01%2e\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%30%78%63%30%2e%30%32%35%30.01%2e\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://%30%78%63%30%2E%30%32%35%30.01%2E/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%30%78%63%30%2E%30%32%35%30.01%2E\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%30%78%63%30%2E%30%32%35%30.01%2E\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://%30%78%63%30%2E%30%32%35%30.01%2E/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"%30%78%63%30%2E%30%32%35%30.01%2E\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%30%78%63%30%2E%30%32%35%30.01%2E\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://%30%78%63%30%2E%30%32%35%30.01%2E\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"%30%78%63%30%2E%30%32%35%30.01%2E\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%30%78%63%30%2E%30%32%35%30.01%2E\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://%30%78%63%30%2e%30%32%35%30.01%2e\", \"base\" : \"http://other.com/\", \"href\" : \"http://192.168.0.1/\", \"origin\" : \"http://192.168.0.1\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"192.168.0.1\", \"hostname\" : \"192.168.0.1\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://../\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://../\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"..\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"..\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://../\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"..\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"..\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://../\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"..\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"..\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://..\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"..\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"..\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://../\", \"href\" : \"http://../\", \"origin\" : \"http://..\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"..\", \"hostname\" : \"..\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://./\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \".\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \".\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \".\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \".\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \".\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \".\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \".\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \".\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://./\", \"href\" : \"http://./\", \"origin\" : \"http://.\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \".\", \"hostname\" : \".\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://0X7F.0.0.0X7G\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://0X7F.0.0.0X7G\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0X7F.0.0.0X7G\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0X7F.0.0.0X7G\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0x7f.0.0.0x7g/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x7f.0.0.0x7g\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x7f.0.0.0x7g\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://0x7f.0.0.0x7g/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x7f.0.0.0x7g\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x7f.0.0.0x7g\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0x7f.0.0.0x7g\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x7f.0.0.0x7g\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x7f.0.0.0x7g\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0X7F.0.0.0X7G\", \"href\" : \"http://0x7f.0.0.0x7g/\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"0x7f.0.0.0x7g\", \"hostname\" : \"0x7f.0.0.0x7g\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://0x7f.0.0.0x7g\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://0x7f.0.0.0x7g\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x7f.0.0.0x7g\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x7f.0.0.0x7g\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0x7f.0.0.0x7g/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x7f.0.0.0x7g\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x7f.0.0.0x7g\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://0x7f.0.0.0x7g/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0x7f.0.0.0x7g\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x7f.0.0.0x7g\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0x7f.0.0.0x7g\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0x7f.0.0.0x7g\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x7f.0.0.0x7g\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0x7f.0.0.0x7g\", \"href\" : \"http://0x7f.0.0.0x7g/\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"0x7f.0.0.0x7g\", \"hostname\" : \"0x7f.0.0.0x7g\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://0xffffffff\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://0xffffffff\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0xffffffff\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0xffffffff\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://0xffffffff/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0xffffffff\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0xffffffff\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://0xffffffff/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"0xffffffff\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0xffffffff\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://0xffffffff\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"0xffffffff\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0xffffffff\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://0xffffffff\", \"base\" : \"http://other.com/\", \"href\" : \"http://255.255.255.255/\", \"origin\" : \"http://255.255.255.255\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"255.255.255.255\", \"hostname\" : \"255.255.255.255\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://1.2.3.4./\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://1.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://1.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://1.2.3.4./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://1.2.3.4.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://1.2.3.4./\", \"base\" : \"http://other.com/\", \"href\" : \"http://1.2.3.4/\", \"origin\" : \"http://1.2.3.4\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"1.2.3.4\", \"hostname\" : \"1.2.3.4\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://1.2.3.4/\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://1.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://1.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://1.2.3.4/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://1.2.3.4\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"1.2.3.4\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"1.2.3.4\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://1.2.3.4/\", \"base\" : \"http://other.com/\", \"href\" : \"http://1.2.3.4/\", \"origin\" : \"http://1.2.3.4\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"1.2.3.4\", \"hostname\" : \"1.2.3.4\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://10000000000.com\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://10000000000.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"10000000000.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10000000000.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://10000000000.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10000000000.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10000000000.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://10000000000.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"10000000000.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10000000000.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://10000000000.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"10000000000.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10000000000.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://10000000000.com\", \"base\" : \"http://other.com/\", \"href\" : \"http://10000000000.com/\", \"origin\" : \"http://10000000000.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"10000000000.com\", \"hostname\" : \"10000000000.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://127.0.0.1:10100/relative_import.html\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://127.0.0.1:10100/relative_import.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"127.0.0.1:10100\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"127.0.0.1\", \"port\" : \"10100\", \"path\" : \"/relative_import.html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://127.0.0.1:10100/relative_import.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"127.0.0.1:10100\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"127.0.0.1\", \"port\" : \"10100\", \"path\" : \"/relative_import.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://127.0.0.1:10100/relative_import.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"127.0.0.1:10100\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"127.0.0.1\", \"port\" : \"10100\", \"path\" : \"/relative_import.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://127.0.0.1:10100\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"127.0.0.1:10100\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"127.0.0.1\", \"port\" : \"10100\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://127.0.0.1:10100/relative_import.html\", \"href\" : \"http://127.0.0.1:10100/relative_import.html\", \"origin\" : \"http://127.0.0.1:10100\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"127.0.0.1:10100\", \"hostname\" : \"127.0.0.1\", \"port\" : \"10100\", \"pathname\" : \"/relative_import.html\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://192.0x00A80001\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://192.0x00A80001\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.0x00A80001\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.0x00A80001\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://192.0x00a80001/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.0x00a80001\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.0x00a80001\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://192.0x00a80001/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.0x00a80001\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.0x00a80001\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://192.0x00a80001\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"192.0x00a80001\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.0x00a80001\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://192.0x00A80001\", \"href\" : \"http://192.168.0.1/\", \"origin\" : \"http://192.168.0.1\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"192.168.0.1\", \"hostname\" : \"192.168.0.1\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://192.168.257\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://192.168.257\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"192.168.257\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://192.168.257/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.168.257\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://192.168.257/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.168.257\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://192.168.257\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"192.168.257\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://192.168.257\", \"base\" : \"http://other.com/\", \"href\" : \"http://192.168.1.1/\", \"origin\" : \"http://192.168.1.1\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"192.168.1.1\", \"hostname\" : \"192.168.1.1\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://192.168.257.\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://192.168.257.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"192.168.257.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://192.168.257./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.168.257.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://192.168.257./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.168.257.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://192.168.257.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"192.168.257.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://192.168.257.\", \"base\" : \"http://other.com/\", \"href\" : \"http://192.168.1.1/\", \"origin\" : \"http://192.168.1.1\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"192.168.1.1\", \"hostname\" : \"192.168.1.1\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://192.168.257.com\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://192.168.257.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"192.168.257.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://192.168.257.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.168.257.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://192.168.257.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"192.168.257.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://192.168.257.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"192.168.257.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"192.168.257.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://192.168.257.com\", \"base\" : \"http://other.com/\", \"href\" : \"http://192.168.257.com/\", \"origin\" : \"http://192.168.257.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"192.168.257.com\", \"hostname\" : \"192.168.257.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://256\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://256\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://256/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://256/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://256\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://256\", \"base\" : \"http://other.com/\", \"href\" : \"http://0.0.1.0/\", \"origin\" : \"http://0.0.1.0\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"0.0.1.0\", \"hostname\" : \"0.0.1.0\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://256.com\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://256.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://256.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://256.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"256.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://256.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"256.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"256.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://256.com\", \"base\" : \"http://other.com/\", \"href\" : \"http://256.com/\", \"origin\" : \"http://256.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"256.com\", \"hostname\" : \"256.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://4294967295\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://4294967295\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"4294967295\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"4294967295\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://4294967295/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"4294967295\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"4294967295\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://4294967295/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"4294967295\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"4294967295\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://4294967295\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"4294967295\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"4294967295\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://4294967295\", \"base\" : \"http://other.com/\", \"href\" : \"http://255.255.255.255/\", \"origin\" : \"http://255.255.255.255\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"255.255.255.255\", \"hostname\" : \"255.255.255.255\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://999999999\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://999999999\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"999999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://999999999/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"999999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://999999999/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"999999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://999999999\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"999999999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://999999999\", \"base\" : \"http://other.com/\", \"href\" : \"http://59.154.201.255/\", \"origin\" : \"http://59.154.201.255\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"59.154.201.255\", \"hostname\" : \"59.154.201.255\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://999999999.\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://999999999.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"999999999.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://999999999./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"999999999.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://999999999./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"999999999.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999.\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://999999999.\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"999999999.\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999.\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://999999999.\", \"base\" : \"http://other.com/\", \"href\" : \"http://59.154.201.255/\", \"origin\" : \"http://59.154.201.255\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"59.154.201.255\", \"hostname\" : \"59.154.201.255\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://999999999.com\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://999999999.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"999999999.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://999999999.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"999999999.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://999999999.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"999999999.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://999999999.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"999999999.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"999999999.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://999999999.com\", \"base\" : \"http://other.com/\", \"href\" : \"http://999999999.com/\", \"origin\" : \"http://999999999.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"999999999.com\", \"hostname\" : \"999999999.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://:@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://:@www.example.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \":@www.example.com\", \"userInfo\" : \":\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://:@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \":@www.example.com\", \"userInfo\" : \":\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://:@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \":@www.example.com\", \"userInfo\" : \":\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://:@www.example.com\", \"href\" : \"http://www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://:b@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://:b@www.example.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \":b@www.example.com\", \"userInfo\" : \":b\", \"username\" : \"\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://:b@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \":b@www.example.com\", \"userInfo\" : \":b\", \"username\" : \"\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://:b@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \":b@www.example.com\", \"userInfo\" : \":b\", \"username\" : \"\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://:b@www.example.com\", \"href\" : \"http://:b@www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://@pple.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://@pple.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"@pple.com\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"pple.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://@pple.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"@pple.com\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"pple.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://@pple.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"@pple.com\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"pple.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://pple.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"pple.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"pple.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://@pple.com\", \"href\" : \"http://pple.com/\", \"origin\" : \"http://pple.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"pple.com\", \"hostname\" : \"pple.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://@www.example.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"@www.example.com\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"@www.example.com\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"@www.example.com\", \"userInfo\" : \"\", \"username\" : \"\", \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://@www.example.com\", \"href\" : \"http://www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://ExAmPlE.CoM\",\n    \"base\" : \"http://other.com/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://ExAmPlE.CoM\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"ExAmPlE.CoM\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ExAmPlE.CoM\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://other.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"other.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"other.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://ExAmPlE.CoM\", \"base\" : \"http://other.com/\", \"href\" : \"http://example.com/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://[0:0:0:0:0:0:13.1.68.3]\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://[0:0:0:0:0:0:13.1.68.3]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[0:0:0:0:0:0:13.1.68.3]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[0:0:0:0:0:0:13.1.68.3]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://[0:0:0:0:0:0:13.1.68.3]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[0:0:0:0:0:0:13.1.68.3]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[0:0:0:0:0:0:13.1.68.3]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://[0:0:0:0:0:0:13.1.68.3]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[0:0:0:0:0:0:13.1.68.3]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[0:0:0:0:0:0:13.1.68.3]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://[0:0:0:0:0:0:13.1.68.3]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[0:0:0:0:0:0:13.1.68.3]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[0:0:0:0:0:0:13.1.68.3]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://[0:0:0:0:0:0:13.1.68.3]\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://[::d01:4403]/\", \"origin\" : \"http://[::d01:4403]\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[::d01:4403]\", \"hostname\" : \"[::d01:4403]\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://[0:1:0:1:0:1:0:1]\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://[0:1:0:1:0:1:0:1]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[0:1:0:1:0:1:0:1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[0:1:0:1:0:1:0:1]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://[0:1:0:1:0:1:0:1]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[0:1:0:1:0:1:0:1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[0:1:0:1:0:1:0:1]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://[0:1:0:1:0:1:0:1]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[0:1:0:1:0:1:0:1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[0:1:0:1:0:1:0:1]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://[0:1:0:1:0:1:0:1]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[0:1:0:1:0:1:0:1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[0:1:0:1:0:1:0:1]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://[0:1:0:1:0:1:0:1]\", \"href\" : \"http://[0:1:0:1:0:1:0:1]/\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[0:1:0:1:0:1:0:1]\", \"hostname\" : \"[0:1:0:1:0:1:0:1]\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://[1:0:1:0:1:0:1:0]\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://[1:0:1:0:1:0:1:0]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[1:0:1:0:1:0:1:0]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:0:1:0:1:0:1:0]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://[1:0:1:0:1:0:1:0]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[1:0:1:0:1:0:1:0]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:0:1:0:1:0:1:0]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://[1:0:1:0:1:0:1:0]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[1:0:1:0:1:0:1:0]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:0:1:0:1:0:1:0]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://[1:0:1:0:1:0:1:0]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[1:0:1:0:1:0:1:0]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:0:1:0:1:0:1:0]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://[1:0:1:0:1:0:1:0]\", \"href\" : \"http://[1:0:1:0:1:0:1:0]/\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[1:0:1:0:1:0:1:0]\", \"hostname\" : \"[1:0:1:0:1:0:1:0]\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://[1:0::]\",\n    \"base\" : \"http://example.net/\",\n    \"inputExpected\" : { \"stringValue\" : \"http://[1:0::]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[1:0::]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:0::]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://[1:0::]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[1:0::]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:0::]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.net/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.net\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.net\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.net/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.net\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.net\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://[1:0::]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[1:0::]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:0::]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://[1:0::]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[1:0::]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:0::]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://[1:0::]\", \"base\" : \"http://example.net/\", \"href\" : \"http://[1::]/\", \"origin\" : \"http://[1::]\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[1::]\", \"hostname\" : \"[1::]\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://[2001::1]\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://[2001::1]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[2001::1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[2001::1]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://[2001::1]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[2001::1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[2001::1]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://[2001::1]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[2001::1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[2001::1]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://[2001::1]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[2001::1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[2001::1]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://[2001::1]\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://[2001::1]/\", \"origin\" : \"http://[2001::1]\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[2001::1]\", \"hostname\" : \"[2001::1]\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://[2001::1]:80\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://[2001::1]:80\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[2001::1]:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[2001::1]\", \"port\" : \"80\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://[2001::1]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[2001::1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[2001::1]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://[2001::1]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[2001::1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[2001::1]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://[2001::1]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[2001::1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[2001::1]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://[2001::1]:80\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://[2001::1]/\", \"origin\" : \"http://[2001::1]\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[2001::1]\", \"hostname\" : \"[2001::1]\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://[::127.0.0.1]\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://[::127.0.0.1]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[::127.0.0.1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[::127.0.0.1]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://[::127.0.0.1]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[::127.0.0.1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[::127.0.0.1]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://[::127.0.0.1]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"[::127.0.0.1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[::127.0.0.1]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://[::127.0.0.1]\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"[::127.0.0.1]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[::127.0.0.1]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://[::127.0.0.1]\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://[::7f00:1]/\", \"origin\" : \"http://[::7f00:1]\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[::7f00:1]\", \"hostname\" : \"[::7f00:1]\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://a:@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://a:@www.example.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a:@www.example.com\", \"userInfo\" : \"a:\", \"username\" : \"a\", \"password\" : \"\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://a:@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a:@www.example.com\", \"userInfo\" : \"a:\", \"username\" : \"a\", \"password\" : \"\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://a:@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a:@www.example.com\", \"userInfo\" : \"a:\", \"username\" : \"a\", \"password\" : \"\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://a:@www.example.com\", \"href\" : \"http://a@www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"a\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://a:b@c:29/d\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://a:b@c:29/d\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"a:b@c:29\", \"userInfo\" : \"a:b\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"c\", \"port\" : \"29\", \"path\" : \"/d\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://a:b@c:29/d\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"a:b@c:29\", \"userInfo\" : \"a:b\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"c\", \"port\" : \"29\", \"path\" : \"/d\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://a:b@c:29/d\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"a:b@c:29\", \"userInfo\" : \"a:b\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"c\", \"port\" : \"29\", \"path\" : \"/d\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://c:29\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"c:29\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"c\", \"port\" : \"29\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://a:b@c:29/d\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://a:b@c:29/d\", \"origin\" : \"http://c:29\", \"protocol\" : \"http:\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"c:29\", \"hostname\" : \"c\", \"port\" : \"29\", \"pathname\" : \"/d\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://a:b@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://a:b@www.example.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a:b@www.example.com\", \"userInfo\" : \"a:b\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://a:b@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a:b@www.example.com\", \"userInfo\" : \"a:b\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://a:b@www.example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"a:b@www.example.com\", \"userInfo\" : \"a:b\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://a:b@www.example.com\", \"href\" : \"http://a:b@www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/%20foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/%20foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%20foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/%20foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%20foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/%20foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%20foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/%20foo\", \"href\" : \"http://example.com/%20foo\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/%20foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/%3A%3a%3C%3c\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/%3A%3a%3C%3c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%3A%3a%3C%3c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/::%3C%3C\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/::%3C%3C\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/::%3C%3C\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/::%3C%3C\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/%3A%3a%3C%3c\", \"href\" : \"http://example.com/%3A%3a%3C%3c\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/%3A%3a%3C%3c\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%7Ffp3%3Eju%3Dduvgw%3Dd\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/%7Ffp3%3Eju=duvgw=d\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%7Ffp3%3Eju=duvgw=d\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/%7Ffp3%3Eju=duvgw=d\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%7Ffp3%3Eju=duvgw=d\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd\", \"href\" : \"http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/%7Ffp3%3Eju%3Dduvgw%3Dd\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/(%28:%3A%29)\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/(%28:%3A%29)\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/(%28:%3A%29)\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/((::))\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/((::))\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/((::))\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/((::))\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/(%28:%3A%29)\", \"href\" : \"http://example.com/(%28:%3A%29)\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/(%28:%3A%29)\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/././foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/././foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/././foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/././foo\", \"href\" : \"http://example.com/foo\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/./.foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/./.foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/./.foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/.foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/.foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/.foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/.foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/./.foo\", \"href\" : \"http://example.com/.foo\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/.foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com////../..\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com////../..\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"////../..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com//\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"//\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com//\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"//\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com////../..\", \"href\" : \"http://example.com//\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/@asdf%40\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/@asdf%40\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/@asdf%40\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/@asdf@\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/@asdf@\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/@asdf@\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/@asdf@\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/@asdf%40\", \"href\" : \"http://example.com/@asdf%40\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/@asdf%40\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo\", \"href\" : \"http://example.com/foo\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo\\tbar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo\\tbar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo\\tbar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo%09bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%09bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo%09bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%09bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo\\tbar\", \"href\" : \"http://example.com/foobar\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foobar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo%\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo%\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo%25\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%25\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo%25\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%25\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo%\", \"href\" : \"http://example.com/foo%\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo%\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo%00%51\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo%00%51\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%00%51\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo%00Q\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%00Q\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo%00Q\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%00Q\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo%00%51\", \"href\" : \"http://example.com/foo%00%51\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo%00%51\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo%2\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo%2\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%2\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo%252\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%252\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo%252\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%252\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo%2\", \"href\" : \"http://example.com/foo%2\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo%2\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo%2zbar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo%2zbar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%2zbar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo%252zbar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%252zbar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo%252zbar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%252zbar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo%2zbar\", \"href\" : \"http://example.com/foo%2zbar\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo%2zbar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo%2Â©zbar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo%2Â©zbar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%2Â©zbar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo%252%C3%82%C2%A9zbar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%252%C3%82%C2%A9zbar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo%252%C3%82%C2%A9zbar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%252%C3%82%C2%A9zbar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo%2Â©zbar\", \"href\" : \"http://example.com/foo%2%C3%82%C2%A9zbar\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo%2%C3%82%C2%A9zbar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo%41%7a\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo%41%7a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo%41%7a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/fooAz\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/fooAz\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/fooAz\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/fooAz\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo%41%7a\", \"href\" : \"http://example.com/foo%41%7a\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo%41%7a\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo/%2e\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/%2e\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/%2e\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/%2e\", \"href\" : \"http://example.com/foo/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/%2e%2\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/%2e%2\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/%2e%2\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/.%252\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/.%252\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/.%252\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/.%252\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/%2e%2\", \"href\" : \"http://example.com/foo/%2e%2\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/%2e%2\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/%2e./%2e%2e/.%2e/%2e.bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/..bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/..bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/..bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/..bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar\", \"href\" : \"http://example.com/%2e.bar\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/%2e.bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.com/foo/.\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/.\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/.\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/.\", \"href\" : \"http://example.com/foo/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/../../..\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/../../..\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/../../..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/../../..\", \"href\" : \"http://example.com/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/../../../ton\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/../../../ton\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/../../../ton\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/ton\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/ton\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/ton\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/ton\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/../../../ton\", \"href\" : \"http://example.com/ton\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/ton\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/..bar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/..bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/..bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/..bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/..bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/..bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/..bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/..bar\", \"href\" : \"http://example.com/foo/..bar\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/..bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/./\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/./\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/./\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/./\", \"href\" : \"http://example.com/foo/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/bar/..\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/bar/..\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar/..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/bar/..\", \"href\" : \"http://example.com/foo/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/bar/../\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/bar/../\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar/../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/bar/../\", \"href\" : \"http://example.com/foo/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/bar/../ton\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/bar/../ton\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar/../ton\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/ton\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/ton\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/ton\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/ton\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/bar/../ton\", \"href\" : \"http://example.com/foo/ton\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/ton\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/bar/../ton/../../a\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/bar/../ton/../../a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar/../ton/../../a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/bar/../ton/../../a\", \"href\" : \"http://example.com/a\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/a\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/bar//..\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/bar//..\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar//..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/bar/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/bar/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/bar//..\", \"href\" : \"http://example.com/foo/bar/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/bar/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/foo/bar//../..\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/foo/bar//../..\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar//../..\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/foo/bar//../..\", \"href\" : \"http://example.com/foo/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/‥/foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/‥/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/‥/foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/%E2%80%A5/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%E2%80%A5/foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/%E2%80%A5/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%E2%80%A5/foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/‥/foo\", \"href\" : \"http://example.com/%E2%80%A5/foo\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/%E2%80%A5/foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/‮/foo/‭/bar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/‮/foo/‭/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/‮/foo/‭/bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/%E2%80%AE/foo/%E2%80%AD/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%E2%80%AE/foo/%E2%80%AD/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/%E2%80%AE/foo/%E2%80%AD/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%E2%80%AE/foo/%E2%80%AD/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/‮/foo/‭/bar\", \"href\" : \"http://example.com/%E2%80%AE/foo/%E2%80%AD/bar\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/%E2%80%AE/foo/%E2%80%AD/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/你好你好\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/你好你好\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/你好你好\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/你好你好\", \"href\" : \"http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.com/﻿/foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.com/﻿/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/﻿/foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.com/%EF%BB%BF/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%EF%BB%BF/foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.com/%EF%BB%BF/foo\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%EF%BB%BF/foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.com/﻿/foo\", \"href\" : \"http://example.com/%EF%BB%BF/foo\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/%EF%BB%BF/foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.org/test?\\\"\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?\\\"\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"\\\"\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?%22\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%22\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?%22\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%22\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?\\\"\", \"href\" : \"http://example.org/test?%22\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?%22\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.org/test?#\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"\", \"fragment\" : \"\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"\", \"fragment\" : \"\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"\", \"fragment\" : \"\" },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?#\", \"href\" : \"http://example.org/test?#\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.org/test?%23%23\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?%23%23\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%23%23\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?%23%23\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%23%23\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?%23%23\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%23%23\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?%23%23\", \"href\" : \"http://example.org/test?%23%23\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?%23%23\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.org/test?%GH\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?%GH\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%GH\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?%25GH\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%25GH\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?%25GH\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%25GH\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?%GH\", \"href\" : \"http://example.org/test?%GH\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?%GH\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.org/test?<\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?<\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"<\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?%3C\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%3C\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?%3C\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%3C\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?<\", \"href\" : \"http://example.org/test?%3C\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?%3C\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.org/test?>\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?>\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \">\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?%3E\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%3E\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?%3E\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%3E\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?>\", \"href\" : \"http://example.org/test?%3E\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?%3E\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.org/test?a#%EF\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?a#%EF\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"%EF\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?a#%EF\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"%EF\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?a#%EF\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"%EF\" },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?a#%EF\", \"href\" : \"http://example.org/test?a#%EF\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?a\", \"hash\" : \"#%EF\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.org/test?a#%GH\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?a#%GH\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"%GH\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?a#%25GH\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"%25GH\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?a#%25GH\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"%25GH\" },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?a#%GH\", \"href\" : \"http://example.org/test?a#%GH\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?a\", \"hash\" : \"#%GH\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://example.org/test?a#b\\u0000c\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?a#b\\u0000c\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"b\\u0000c\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?a#b%00c\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"b%00c\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?a#b%00c\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"b%00c\" },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?a#b\\u0000c\", \"href\" : \"http://example.org/test?a#b%00c\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?a\", \"hash\" : \"#b%00c\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://example.org/test?⌣\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://example.org/test?⌣\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"⌣\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://example.org/test?%E2%8C%A3\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%E2%8C%A3\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://example.org/test?%E2%8C%A3\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"%E2%8C%A3\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://example.org\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://example.org/test?⌣\", \"href\" : \"http://example.org/test?%E2%8C%A3\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?%E2%8C%A3\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://f:/c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://f:/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : null, \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://f/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : null, \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://f/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : null, \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://f\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"f\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://f:/c\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://f/c\", \"origin\" : \"http://f\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"f\", \"hostname\" : \"f\", \"port\" : \"\", \"pathname\" : \"/c\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://f:0/c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://f:0/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"0\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://f:0/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"0\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://f:0/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"0\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://f:0\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"f:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://f:0/c\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://f:0/c\", \"origin\" : \"http://f:0\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"f:0\", \"hostname\" : \"f\", \"port\" : \"0\", \"pathname\" : \"/c\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://f:00000000000000/c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://f:00000000000000/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:00000000000000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"00000000000000\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://f:0/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"0\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://f:0/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"0\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://f:0\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"f:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://f:00000000000000/c\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://f:0/c\", \"origin\" : \"http://f:0\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"f:0\", \"hostname\" : \"f\", \"port\" : \"0\", \"pathname\" : \"/c\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://f:00000000000000000000080/c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://f:00000000000000000000080/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:00000000000000000000080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"00000000000000000000080\", \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://f/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : null, \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://f/c\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : null, \"path\" : \"/c\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://f\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"f\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://f:00000000000000000000080/c\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://f/c\", \"origin\" : \"http://f\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"f\", \"hostname\" : \"f\", \"port\" : \"\", \"pathname\" : \"/c\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://f:21/ b ? d # e \",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://f:21/ b ? d # e \", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:21\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"21\", \"path\" : \"/ b \", \"query\" : \" d \", \"fragment\" : \" e \" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://f:21/%20b%20?%20d%20#%20e%20\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:21\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"21\", \"path\" : \"/%20b%20\", \"query\" : \"%20d%20\", \"fragment\" : \"%20e%20\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://f:21/%20b%20?%20d%20#%20e%20\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"f:21\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"21\", \"path\" : \"/%20b%20\", \"query\" : \"%20d%20\", \"fragment\" : \"%20e%20\" },\n    \"origin\" : { \"stringValue\" : \"http://f:21\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"f:21\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"f\", \"port\" : \"21\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://f:21/ b ? d # e \", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://f:21/%20b%20?%20d%20#%20e\", \"origin\" : \"http://f:21\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"f:21\", \"hostname\" : \"f\", \"port\" : \"21\", \"pathname\" : \"/%20b%20\", \"search\" : \"?%20d%20\", \"hash\" : \"#%20e\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://facebook.com/?foo=%7B%22abc%22\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://facebook.com/?foo=%7B%22abc%22\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"facebook.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"facebook.com\", \"port\" : null, \"path\" : \"/\", \"query\" : \"foo=%7B%22abc%22\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://facebook.com/?foo=%7B%22abc%22\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"facebook.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"facebook.com\", \"port\" : null, \"path\" : \"/\", \"query\" : \"foo=%7B%22abc%22\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://facebook.com/?foo=%7B%22abc%22\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"facebook.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"facebook.com\", \"port\" : null, \"path\" : \"/\", \"query\" : \"foo=%7B%22abc%22\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://facebook.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"facebook.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"facebook.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://facebook.com/?foo=%7B%22abc%22\", \"href\" : \"http://facebook.com/?foo=%7B%22abc%22\", \"origin\" : \"http://facebook.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"facebook.com\", \"hostname\" : \"facebook.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"?foo=%7B%22abc%22\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo.09..\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.09..\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.09..\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09..\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.09../\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.09..\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09..\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.09../\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.09..\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09..\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.09..\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.09..\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.09..\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.09..\", \"href\" : \"http://foo.09../\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo.09..\", \"hostname\" : \"foo.09..\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo.bar/baz?qux#foo\\bbar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo\\bbar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo\\bbar\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%08bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%08bar\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%08bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%08bar\" },\n    \"origin\" : { \"stringValue\" : \"http://foo.bar\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.bar/baz?qux#foo\\bbar\", \"href\" : \"http://foo.bar/baz?qux#foo%08bar\", \"origin\" : \"http://foo.bar\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo.bar\", \"hostname\" : \"foo.bar\", \"port\" : \"\", \"pathname\" : \"/baz\", \"search\" : \"?qux\", \"searchParams\" : \"qux=\", \"hash\" : \"#foo%08bar\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo.bar/baz?qux#foo\\\"bar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo\\\"bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo\\\"bar\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%22bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%22bar\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%22bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%22bar\" },\n    \"origin\" : { \"stringValue\" : \"http://foo.bar\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.bar/baz?qux#foo\\\"bar\", \"href\" : \"http://foo.bar/baz?qux#foo%22bar\", \"origin\" : \"http://foo.bar\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo.bar\", \"hostname\" : \"foo.bar\", \"port\" : \"\", \"pathname\" : \"/baz\", \"search\" : \"?qux\", \"searchParams\" : \"qux=\", \"hash\" : \"#foo%22bar\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo.bar/baz?qux#foo<bar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo<bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo<bar\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%3Cbar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%3Cbar\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%3Cbar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%3Cbar\" },\n    \"origin\" : { \"stringValue\" : \"http://foo.bar\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.bar/baz?qux#foo<bar\", \"href\" : \"http://foo.bar/baz?qux#foo%3Cbar\", \"origin\" : \"http://foo.bar\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo.bar\", \"hostname\" : \"foo.bar\", \"port\" : \"\", \"pathname\" : \"/baz\", \"search\" : \"?qux\", \"searchParams\" : \"qux=\", \"hash\" : \"#foo%3Cbar\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo.bar/baz?qux#foo>bar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo>bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo>bar\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%3Ebar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%3Ebar\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%3Ebar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%3Ebar\" },\n    \"origin\" : { \"stringValue\" : \"http://foo.bar\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.bar/baz?qux#foo>bar\", \"href\" : \"http://foo.bar/baz?qux#foo%3Ebar\", \"origin\" : \"http://foo.bar\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo.bar\", \"hostname\" : \"foo.bar\", \"port\" : \"\", \"pathname\" : \"/baz\", \"search\" : \"?qux\", \"searchParams\" : \"qux=\", \"hash\" : \"#foo%3Ebar\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo.bar/baz?qux#foo`bar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo`bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo`bar\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%60bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%60bar\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo.bar/baz?qux#foo%60bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"/baz\", \"query\" : \"qux\", \"fragment\" : \"foo%60bar\" },\n    \"origin\" : { \"stringValue\" : \"http://foo.bar\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.bar\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.bar\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.bar/baz?qux#foo`bar\", \"href\" : \"http://foo.bar/baz?qux#foo%60bar\", \"origin\" : \"http://foo.bar\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo.bar\", \"hostname\" : \"foo.bar\", \"port\" : \"\", \"pathname\" : \"/baz\", \"search\" : \"?qux\", \"searchParams\" : \"qux=\", \"hash\" : \"#foo%60bar\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo.com/\\\\@\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.com/\\\\@\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.com\", \"port\" : null, \"path\" : \"/\\\\@\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.com/%5C@\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.com\", \"port\" : null, \"path\" : \"/%5C@\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://foo.com/%5C@\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.com\", \"port\" : null, \"path\" : \"/%5C@\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.com/\\\\@\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://foo.com//@\", \"origin\" : \"http://foo.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo.com\", \"hostname\" : \"foo.com\", \"port\" : \"\", \"pathname\" : \"//@\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo.com:b@d/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://foo.com:b@d/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.com:b@d\", \"userInfo\" : \"foo.com:b\", \"username\" : \"foo.com\", \"password\" : \"b\", \"host\" : \"d\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo.com:b@d/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.com:b@d\", \"userInfo\" : \"foo.com:b\", \"username\" : \"foo.com\", \"password\" : \"b\", \"host\" : \"d\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://foo.com:b@d/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo.com:b@d\", \"userInfo\" : \"foo.com:b\", \"username\" : \"foo.com\", \"password\" : \"b\", \"host\" : \"d\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://d\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"d\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"d\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo.com:b@d/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://foo.com:b@d/\", \"origin\" : \"http://d\", \"protocol\" : \"http:\", \"username\" : \"foo.com\", \"password\" : \"b\", \"host\" : \"d\", \"hostname\" : \"d\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo/abcd#foo?bar\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://foo/abcd#foo?bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/abcd\", \"query\" : null, \"fragment\" : \"foo?bar\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo/abcd#foo?bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/abcd\", \"query\" : null, \"fragment\" : \"foo?bar\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://foo/abcd#foo?bar\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/abcd\", \"query\" : null, \"fragment\" : \"foo?bar\" },\n    \"origin\" : { \"stringValue\" : \"http://foo\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo/abcd#foo?bar\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://foo/abcd#foo?bar\", \"origin\" : \"http://foo\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo\", \"hostname\" : \"foo\", \"port\" : \"\", \"pathname\" : \"/abcd\", \"search\" : \"\", \"hash\" : \"#foo?bar\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo/abcd?efgh?ijkl\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://foo/abcd?efgh?ijkl\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/abcd\", \"query\" : \"efgh?ijkl\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo/abcd?efgh?ijkl\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/abcd\", \"query\" : \"efgh?ijkl\", \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://foo/abcd?efgh?ijkl\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/abcd\", \"query\" : \"efgh?ijkl\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo/abcd?efgh?ijkl\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://foo/abcd?efgh?ijkl\", \"origin\" : \"http://foo\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo\", \"hostname\" : \"foo\", \"port\" : \"\", \"pathname\" : \"/abcd\", \"search\" : \"?efgh?ijkl\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo/path;a??e#f#g\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://foo/path;a??e#f#g\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/path;a\", \"query\" : \"?e\", \"fragment\" : \"f#g\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo/path;a??e#f%23g\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/path;a\", \"query\" : \"?e\", \"fragment\" : \"f%23g\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://foo/path;a??e#f%23g\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/path;a\", \"query\" : \"?e\", \"fragment\" : \"f%23g\" },\n    \"origin\" : { \"stringValue\" : \"http://foo\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo/path;a??e#f#g\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://foo/path;a??e#f#g\", \"origin\" : \"http://foo\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo\", \"hostname\" : \"foo\", \"port\" : \"\", \"pathname\" : \"/path;a\", \"search\" : \"??e\", \"hash\" : \"#f#g\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://foo:80/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo:80/\", \"href\" : \"http://foo/\", \"origin\" : \"http://foo\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo\", \"hostname\" : \"foo\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://foo:81/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://foo:81/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://foo:81/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://foo:81/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://foo:81\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://foo:81/\", \"href\" : \"http://foo:81/\", \"origin\" : \"http://foo:81\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:81\", \"hostname\" : \"foo\", \"port\" : \"81\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://host/?'\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://host/?'\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : \"'\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://host/?'\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : \"'\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://host/?'\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : \"'\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://host\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://host/?'\", \"href\" : \"http://host/?%27\", \"origin\" : \"http://host\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"?%27\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://user:pass@foo:21/bar;par?b#c\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http://user:pass@foo:21/bar;par?b#c\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@foo:21\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"foo\", \"port\" : \"21\", \"path\" : \"/bar;par\", \"query\" : \"b\", \"fragment\" : \"c\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://user:pass@foo:21/bar;par?b#c\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@foo:21\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"foo\", \"port\" : \"21\", \"path\" : \"/bar;par\", \"query\" : \"b\", \"fragment\" : \"c\" },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://user:pass@foo:21/bar;par?b#c\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"user:pass@foo:21\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"foo\", \"port\" : \"21\", \"path\" : \"/bar;par\", \"query\" : \"b\", \"fragment\" : \"c\" },\n    \"origin\" : { \"stringValue\" : \"http://foo:21\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"foo:21\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"21\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://user:pass@foo:21/bar;par?b#c\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://user:pass@foo:21/bar;par?b#c\", \"origin\" : \"http://foo:21\", \"protocol\" : \"http:\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"foo:21\", \"hostname\" : \"foo\", \"port\" : \"21\", \"pathname\" : \"/bar;par\", \"search\" : \"?b\", \"hash\" : \"#c\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://www.@pple.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://www.@pple.com\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.@pple.com\", \"userInfo\" : \"www.\", \"username\" : \"www.\", \"password\" : null, \"host\" : \"pple.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://www.@pple.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.@pple.com\", \"userInfo\" : \"www.\", \"username\" : \"www.\", \"password\" : null, \"host\" : \"pple.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://www.@pple.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.@pple.com\", \"userInfo\" : \"www.\", \"username\" : \"www.\", \"password\" : null, \"host\" : \"pple.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://pple.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"pple.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"pple.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://www.@pple.com\", \"href\" : \"http://www.@pple.com/\", \"origin\" : \"http://pple.com\", \"protocol\" : \"http:\", \"username\" : \"www.\", \"password\" : \"\", \"host\" : \"pple.com\", \"hostname\" : \"pple.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://www.example2.com\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"http://www.example2.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example2.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example2.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://www.example2.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example2.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example2.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example2.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example2.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example2.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example2.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example2.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example2.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://www.example2.com\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example2.com/\", \"origin\" : \"http://www.example2.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example2.com\", \"hostname\" : \"www.example2.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://www.google.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://www.google.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://www.google.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://www.google.com/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.google.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://www.google.com\", \"href\" : \"http://www.google.com/\", \"origin\" : \"http://www.google.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.google.com\", \"hostname\" : \"www.google.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://www.google.com/foo?bar=baz#\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://www.google.com/foo?bar=baz#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : \"bar=baz\", \"fragment\" : \"\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://www.google.com/foo?bar=baz#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : \"bar=baz\", \"fragment\" : \"\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://www.google.com/foo?bar=baz#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : \"bar=baz\", \"fragment\" : \"\" },\n    \"origin\" : { \"stringValue\" : \"http://www.google.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://www.google.com/foo?bar=baz#\", \"href\" : \"http://www.google.com/foo?bar=baz#\", \"origin\" : \"http://www.google.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.google.com\", \"hostname\" : \"www.google.com\", \"port\" : \"\", \"pathname\" : \"/foo\", \"search\" : \"?bar=baz\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://www.google.com/foo?bar=baz# »\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://www.google.com/foo?bar=baz# »\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : \"bar=baz\", \"fragment\" : \" »\" },\n    \"inputNormalised\" : { \"stringValue\" : \"http://www.google.com/foo?bar=baz#%20%C2%BB\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : \"bar=baz\", \"fragment\" : \"%20%C2%BB\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://www.google.com/foo?bar=baz#%20%C2%BB\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"/foo\", \"query\" : \"bar=baz\", \"fragment\" : \"%20%C2%BB\" },\n    \"origin\" : { \"stringValue\" : \"http://www.google.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.google.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.google.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://www.google.com/foo?bar=baz# »\", \"href\" : \"http://www.google.com/foo?bar=baz#%20%C2%BB\", \"origin\" : \"http://www.google.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.google.com\", \"hostname\" : \"www.google.com\", \"port\" : \"\", \"pathname\" : \"/foo\", \"search\" : \"?bar=baz\", \"hash\" : \"#%20%C2%BB\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http://www/foo%2Ehtml\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://www/foo%2Ehtml\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www\", \"port\" : null, \"path\" : \"/foo%2Ehtml\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://www/foo.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www\", \"port\" : null, \"path\" : \"/foo.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://www/foo.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www\", \"port\" : null, \"path\" : \"/foo.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://www/foo%2Ehtml\", \"href\" : \"http://www/foo%2Ehtml\", \"origin\" : \"http://www\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www\", \"hostname\" : \"www\", \"port\" : \"\", \"pathname\" : \"/foo%2Ehtml\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http://www/foo/%2E/html\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http://www/foo/%2E/html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www\", \"port\" : null, \"path\" : \"/foo/%2E/html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http://www/foo/html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www\", \"port\" : null, \"path\" : \"/foo/html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http://www/foo/html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www\", \"port\" : null, \"path\" : \"/foo/html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"http://www/foo/%2E/html\", \"href\" : \"http://www/foo/html\", \"origin\" : \"http://www\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www\", \"hostname\" : \"www\", \"port\" : \"\", \"pathname\" : \"/foo/html\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"http:/:b@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:/:b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/:b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/:b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/:b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:/:b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/:b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/:b@www.example.com\", \"href\" : \"http://:b@www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:/@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:/@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:/@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/@www.example.com\", \"href\" : \"http://www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:/a:@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:/a:@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a:@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/a:@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a:@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:/a:@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a:@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/a:@www.example.com\", \"href\" : \"http://a@www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"a\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:/a:b@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:/a:b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a:b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/a:b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a:b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:/a:b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a:b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/a:b@www.example.com\", \"href\" : \"http://a:b@www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/example.com/\", \"href\" : \"http://example.com/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/example.com/\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http::@c:29\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http::@c:29\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":@c:29\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http::@c:29\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":@c:29\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http::@c:29\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":@c:29\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http::@c:29\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/:@c:29\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/:@c:29\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http::b@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http::b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http::b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http::b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http::b@www.example.com\", \"href\" : \"http://:b@www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:@www.example.com\", \"href\" : \"http://www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:[61:27]/:foo\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http:[61:27]/:foo\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"[61:27]/:foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:%5B61:27%5D/:foo\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5B61:27%5D/:foo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:%5B61:27%5D/:foo\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5B61:27%5D/:foo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:[61:27]/:foo\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/[61:27]/:foo\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/[61:27]/:foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:%5C%5Ca%5Cb:c%5Cd@foo.com%5C\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Ca%5Cb:c%5Cd@foo.com%5C\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:%5C%5Ca%5Cb:c%5Cd@foo.com%5C\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Ca%5Cb:c%5Cd@foo.com%5C\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:\\\\\\\\a\\\\b:c\\\\d@foo.com\\\\\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://a/b:c/d@foo.com/\", \"origin\" : \"http://a\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"a\", \"hostname\" : \"a\", \"port\" : \"\", \"pathname\" : \"/b:c/d@foo.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:\\\\\\\\foo.com\\\\\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http:\\\\\\\\foo.com\\\\\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\foo.com\\\\\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:%5C%5Cfoo.com%5C\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Cfoo.com%5C\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:%5C%5Cfoo.com%5C\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Cfoo.com%5C\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:\\\\\\\\foo.com\\\\\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://foo.com/\", \"origin\" : \"http://foo.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo.com\", \"hostname\" : \"foo.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:\\\\\\\\www.google.com\\\\foo\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:\\\\\\\\www.google.com\\\\foo\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\www.google.com\\\\foo\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:%5C%5Cwww.google.com%5Cfoo\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Cwww.google.com%5Cfoo\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:%5C%5Cwww.google.com%5Cfoo\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Cwww.google.com%5Cfoo\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:\\\\\\\\www.google.com\\\\foo\", \"href\" : \"http://www.google.com/foo\", \"origin\" : \"http://www.google.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.google.com\", \"hostname\" : \"www.google.com\", \"port\" : \"\", \"pathname\" : \"/foo\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:a:@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:a:@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a:@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:a:@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a:@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:a:@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a:@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:a:@www.example.com\", \"href\" : \"http://a@www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"a\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:a:b@www.example.com\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:a:b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a:b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:a:b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a:b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:a:b@www.example.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"a:b@www.example.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:a:b@www.example.com\", \"href\" : \"http://a:b@www.example.com/\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"a\", \"password\" : \"b\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"http:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"http:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:example.com/\", \"href\" : \"http://example.com/\", \"origin\" : \"http://example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/example.com/\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"http:foo.com\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"http:foo.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"foo.com\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"http:foo.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"foo.com\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http:foo.com\", \"type\" : \"OpaqueUri\", \"scheme\" : \"http\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"foo.com\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"http:foo.com\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"http://example.org/foo/foo.com\", \"origin\" : \"http://example.org\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/foo/foo.com\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"httpa://foo:80/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"httpa://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"httpa\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"httpa://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"httpa\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"httpa://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"httpa\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"httpa://foo:80\", \"type\" : \"Origin\", \"scheme\" : \"httpa\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"httpa://foo:80/\", \"href\" : \"httpa://foo:80/\", \"origin\" : \"null\", \"protocol\" : \"httpa:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:80\", \"hostname\" : \"foo\", \"port\" : \"80\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://%e2%98%83\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://%e2%98%83\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%e2%98%83\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%e2%98%83\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://%E2%98%83/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%E2%98%83\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%98%83\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://%E2%98%83/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"%E2%98%83\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%98%83\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://%E2%98%83\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"%E2%98%83\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%98%83\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://%e2%98%83\", \"href\" : \"https://xn--n3h/\", \"origin\" : \"https://xn--n3h\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"xn--n3h\", \"hostname\" : \"xn--n3h\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://00.00.00.00\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://00.00.00.00\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"00.00.00.00\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"00.00.00.00\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://00.00.00.00/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"00.00.00.00\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"00.00.00.00\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://00.00.00.00/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"00.00.00.00\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"00.00.00.00\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://00.00.00.00\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"00.00.00.00\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"00.00.00.00\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://00.00.00.00\", \"href\" : \"https://0.0.0.0/\", \"origin\" : \"https://0.0.0.0\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"0.0.0.0\", \"hostname\" : \"0.0.0.0\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://0x.0x.0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://0x.0x.0\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"0x.0x.0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x.0x.0\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://0x.0x.0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"0x.0x.0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x.0x.0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://0x.0x.0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"0x.0x.0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x.0x.0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://0x.0x.0\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"0x.0x.0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x.0x.0\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://0x.0x.0\", \"href\" : \"https://0.0.0.0/\", \"origin\" : \"https://0.0.0.0\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"0.0.0.0\", \"hostname\" : \"0.0.0.0\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://0x.0x.0x.0x\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://0x.0x.0x.0x\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"0x.0x.0x.0x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x.0x.0x.0x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://0x.0x.0x.0x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"0x.0x.0x.0x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x.0x.0x.0x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://0x.0x.0x.0x/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"0x.0x.0x.0x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x.0x.0x.0x\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://0x.0x.0x.0x\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"0x.0x.0x.0x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"0x.0x.0x.0x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://0x.0x.0x.0x\", \"href\" : \"https://0.0.0.0/\", \"origin\" : \"https://0.0.0.0\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"0.0.0.0\", \"hostname\" : \"0.0.0.0\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://:@test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://:@test\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \":@test\", \"userInfo\" : \":\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://:@test/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \":@test\", \"userInfo\" : \":\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://:@test/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \":@test\", \"userInfo\" : \":\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://test\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://:@test\", \"href\" : \"https://test/\", \"origin\" : \"https://test\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://a%C2%ADb/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://a%C2%ADb/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"a%C2%ADb\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a%C2%ADb\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://a%C2%ADb/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"a%C2%ADb\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a%C2%ADb\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://a%C2%ADb/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"a%C2%ADb\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a%C2%ADb\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://a%C2%ADb\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"a%C2%ADb\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"a%C2%ADb\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://a%C2%ADb/\", \"href\" : \"https://ab/\", \"origin\" : \"https://ab\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"ab\", \"hostname\" : \"ab\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://example.com/\\\"quoted\\\"\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://example.com/\\\"quoted\\\"\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/\\\"quoted\\\"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://example.com/%22quoted%22\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%22quoted%22\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://example.com/%22quoted%22\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/%22quoted%22\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://example.com\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://example.com/\\\"quoted\\\"\", \"href\" : \"https://example.com/%22quoted%22\", \"origin\" : \"https://example.com\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/%22quoted%22\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://example.com/aaa/bbb/%2e%2e?query\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://example.com/aaa/bbb/%2e%2e?query\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/aaa/bbb/%2e%2e\", \"query\" : \"query\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://example.com/aaa/?query\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/aaa/\", \"query\" : \"query\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://example.com/aaa/?query\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/aaa/\", \"query\" : \"query\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://example.com\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://example.com/aaa/bbb/%2e%2e?query\", \"href\" : \"https://example.com/aaa/?query\", \"origin\" : \"https://example.com\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/aaa/\", \"search\" : \"?query\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://foo:443/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://foo:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://foo\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://foo:443/\", \"href\" : \"https://foo/\", \"origin\" : \"https://foo\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo\", \"hostname\" : \"foo\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://foo:80/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://foo:80\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://foo:80/\", \"href\" : \"https://foo:80/\", \"origin\" : \"https://foo:80\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:80\", \"hostname\" : \"foo\", \"port\" : \"80\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://localhost:3000/jqueryui@1.2.3\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://localhost:3000/jqueryui@1.2.3\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"localhost:3000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : \"3000\", \"path\" : \"/jqueryui@1.2.3\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://localhost:3000/jqueryui@1.2.3\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"localhost:3000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : \"3000\", \"path\" : \"/jqueryui@1.2.3\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://localhost:3000/jqueryui@1.2.3\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"localhost:3000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : \"3000\", \"path\" : \"/jqueryui@1.2.3\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://localhost:3000\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"localhost:3000\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : \"3000\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://localhost:3000/jqueryui@1.2.3\", \"href\" : \"https://localhost:3000/jqueryui@1.2.3\", \"origin\" : \"https://localhost:3000\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"localhost:3000\", \"hostname\" : \"localhost\", \"port\" : \"3000\", \"pathname\" : \"/jqueryui@1.2.3\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://test:@test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://test:@test\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"test:@test\", \"userInfo\" : \"test:\", \"username\" : \"test\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://test:@test/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"test:@test\", \"userInfo\" : \"test:\", \"username\" : \"test\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://test:@test/\", \"type\" : \"BaseUrl\", \"scheme\" : \"https\", \"authority\" : \"test:@test\", \"userInfo\" : \"test:\", \"username\" : \"test\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://test\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://test:@test\", \"href\" : \"https://test@test/\", \"origin\" : \"https://test\", \"protocol\" : \"https:\", \"username\" : \"test\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https://x/?#\\u0000y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://x/?#\\u0000y\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : \"\\u0000y\" },\n    \"inputNormalised\" : { \"stringValue\" : \"https://x/?#%00y\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : \"%00y\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://x/?#%00y\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : \"%00y\" },\n    \"origin\" : { \"stringValue\" : \"https://x\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://x/?#\\u0000y\", \"href\" : \"https://x/?#%00y\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x\", \"hostname\" : \"x\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"#%00y\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://x/?#￿y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://x/?#￿y\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : \"￿y\" },\n    \"inputNormalised\" : { \"stringValue\" : \"https://x/?#%EF%BF%BFy\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : \"%EF%BF%BFy\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://x/?#%EF%BF%BFy\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : \"%EF%BF%BFy\" },\n    \"origin\" : { \"stringValue\" : \"https://x\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://x/?#￿y\", \"href\" : \"https://x/?#%EF%BF%BFy\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x\", \"hostname\" : \"x\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"#%EF%BF%BFy\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://x/?￿y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://x/?￿y\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : \"￿y\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://x/?%EF%BF%BFy\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : \"%EF%BF%BFy\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://x/?%EF%BF%BFy\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/\", \"query\" : \"%EF%BF%BFy\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://x\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://x/?￿y\", \"href\" : \"https://x/?%EF%BF%BFy\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x\", \"hostname\" : \"x\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"?%EF%BF%BFy\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://x/�?�#�\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://x/�?�#�\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/�\", \"query\" : \"�\", \"fragment\" : \"�\" },\n    \"inputNormalised\" : { \"stringValue\" : \"https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/%EF%BF%BD\", \"query\" : \"%EF%BF%BD\", \"fragment\" : \"%EF%BF%BD\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/%EF%BF%BD\", \"query\" : \"%EF%BF%BD\", \"fragment\" : \"%EF%BF%BD\" },\n    \"origin\" : { \"stringValue\" : \"https://x\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://x/�?�#�\", \"href\" : \"https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD\", \"origin\" : \"https://x\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x\", \"hostname\" : \"x\", \"port\" : \"\", \"pathname\" : \"/%EF%BF%BD\", \"search\" : \"?%EF%BF%BD\", \"hash\" : \"#%EF%BF%BD\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https://x/￿y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https://x/￿y\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/￿y\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https://x/%EF%BF%BFy\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/%EF%BF%BFy\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https://x/%EF%BF%BFy\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"/%EF%BF%BFy\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"https://x\", \"type\" : \"Origin\", \"scheme\" : \"https\", \"authority\" : \"x\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"https://x/￿y\", \"href\" : \"https://x/%EF%BF%BFy\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x\", \"hostname\" : \"x\", \"port\" : \"\", \"pathname\" : \"/%EF%BF%BFy\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"https:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"https:/example.com/\", \"href\" : \"https://example.com/\", \"origin\" : \"https://example.com\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"https:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"https:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"https:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"https://example.com/\", \"origin\" : \"https://example.com\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"https:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"https:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"https:example.com/\", \"href\" : \"https://example.com/\", \"origin\" : \"https://example.com\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"https:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"https:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"https:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"https:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"https\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"https:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"https://example.com/\", \"origin\" : \"https://example.com\", \"protocol\" : \"https:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"i\",\n    \"base\" : \"sc:///pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:///pa/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:///pa/i\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/pa/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"i\", \"base\" : \"sc:///pa/pa\", \"href\" : \"sc:///pa/i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/pa/i\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"i\",\n    \"base\" : \"sc://ho/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc://ho/pa\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc://ho/i\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://ho\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"ho\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"ho\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"i\", \"base\" : \"sc://ho/pa\", \"href\" : \"sc://ho/i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"ho\", \"hostname\" : \"ho\", \"port\" : \"\", \"pathname\" : \"/i\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"i\",\n    \"base\" : \"sc:/pa/pa\",\n    \"inputExpected\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"i\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"i\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"sc:/pa/pa\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/pa\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:/pa/i\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/pa/i\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"i\", \"base\" : \"sc:/pa/pa\", \"href\" : \"sc:/pa/i\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/pa/i\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"intent:///test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"intent:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"intent\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"intent:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"intent\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"intent:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"intent\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"intent://\", \"type\" : \"Origin\", \"scheme\" : \"intent\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"intent:///test\", \"href\" : \"intent:///test\", \"origin\" : \"null\", \"protocol\" : \"intent:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"intent://example.com:8080/pathname?search#hash\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"intent://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"intent\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"inputNormalised\" : { \"stringValue\" : \"intent://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"intent\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"intent://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"intent\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"origin\" : { \"stringValue\" : \"intent://example.com:8080\", \"type\" : \"Origin\", \"scheme\" : \"intent\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"intent://example.com:8080/pathname?search#hash\", \"href\" : \"intent://example.com:8080/pathname?search#hash\", \"origin\" : \"null\", \"protocol\" : \"intent:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com:8080\", \"hostname\" : \"example.com\", \"port\" : \"8080\", \"pathname\" : \"/pathname\", \"search\" : \"?search\", \"hash\" : \"#hash\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"intent://test/a/../b\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"intent://test/a/../b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"intent\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/a/../b\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"intent://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"intent\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"intent://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"intent\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"intent://test\", \"type\" : \"Origin\", \"scheme\" : \"intent\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"intent://test/a/../b\", \"href\" : \"intent://test/b\", \"origin\" : \"null\", \"protocol\" : \"intent:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/b\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"irc://myserver.com:6999/channel?passwd\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"irc://myserver.com:6999/channel?passwd\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"irc\", \"authority\" : \"myserver.com:6999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"myserver.com\", \"port\" : \"6999\", \"path\" : \"/channel\", \"query\" : \"passwd\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"irc://myserver.com:6999/channel?passwd\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"irc\", \"authority\" : \"myserver.com:6999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"myserver.com\", \"port\" : \"6999\", \"path\" : \"/channel\", \"query\" : \"passwd\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"irc://myserver.com:6999/channel?passwd\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"irc\", \"authority\" : \"myserver.com:6999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"myserver.com\", \"port\" : \"6999\", \"path\" : \"/channel\", \"query\" : \"passwd\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"irc://myserver.com:6999\", \"type\" : \"Origin\", \"scheme\" : \"irc\", \"authority\" : \"myserver.com:6999\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"myserver.com\", \"port\" : \"6999\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"irc://myserver.com:6999/channel?passwd\", \"href\" : \"irc://myserver.com:6999/channel?passwd\", \"origin\" : \"null\", \"protocol\" : \"irc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"myserver.com:6999\", \"hostname\" : \"myserver.com\", \"port\" : \"6999\", \"pathname\" : \"/channel\", \"search\" : \"?passwd\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"isolated-app://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"isolated-app://x:0\", \"type\" : \"Origin\", \"scheme\" : \"isolated-app\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"isolated-app://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"isolated-app\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"isolated-app://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"isolated-app\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"isolated-app://x:0\", \"type\" : \"Origin\", \"scheme\" : \"isolated-app\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"isolated-app://x:0\", \"href\" : \"isolated-app://x:0\", \"origin\" : \"null\", \"protocol\" : \"isolated-app:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"javascript:/../\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"javascript:/../\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"javascript:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"javascript:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"javascript:/../\", \"href\" : \"javascript:/\", \"origin\" : \"null\", \"protocol\" : \"javascript:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"javascript:///test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"javascript:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"javascript\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"javascript:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"javascript\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"javascript:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"javascript\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"javascript://\", \"type\" : \"Origin\", \"scheme\" : \"javascript\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"javascript:///test\", \"href\" : \"javascript:///test\", \"origin\" : \"null\", \"protocol\" : \"javascript:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"javascript://example.com:8080/pathname?search#hash\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"javascript://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"javascript\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"inputNormalised\" : { \"stringValue\" : \"javascript://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"javascript\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"javascript://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"javascript\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"origin\" : { \"stringValue\" : \"javascript://example.com:8080\", \"type\" : \"Origin\", \"scheme\" : \"javascript\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"javascript://example.com:8080/pathname?search#hash\", \"href\" : \"javascript://example.com:8080/pathname?search#hash\", \"origin\" : \"null\", \"protocol\" : \"javascript:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com:8080\", \"hostname\" : \"example.com\", \"port\" : \"8080\", \"pathname\" : \"/pathname\", \"search\" : \"?search\", \"hash\" : \"#hash\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"javascript://test/a/../b\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"javascript://test/a/../b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"javascript\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/a/../b\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"javascript://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"javascript\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"javascript://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"javascript\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"javascript://test\", \"type\" : \"Origin\", \"scheme\" : \"javascript\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"javascript://test/a/../b\", \"href\" : \"javascript://test/b\", \"origin\" : \"null\", \"protocol\" : \"javascript:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/b\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"javascript:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"javascript:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"javascript:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"javascript:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"javascript:/example.com/\", \"href\" : \"javascript:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"javascript:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"javascript:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"javascript:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"javascript:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"javascript:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"javascript:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"javascript:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"javascript:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"javascript:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"javascript:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"javascript:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"javascript:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"javascript:example.com/\", \"href\" : \"javascript:example.com/\", \"origin\" : \"null\", \"protocol\" : \"javascript:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"javascript:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"javascript:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"javascript:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"javascript:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"javascript\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"javascript:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"javascript:example.com/\", \"origin\" : \"null\", \"protocol\" : \"javascript:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ldap://localhost:389/ou=People,o=JNDITutorial\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ldap://localhost:389/ou=People,o=JNDITutorial\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"ldap\", \"authority\" : \"localhost:389\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : \"389\", \"path\" : \"/ou=People,o=JNDITutorial\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ldap://localhost:389/ou=People,o=JNDITutorial\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"ldap\", \"authority\" : \"localhost:389\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : \"389\", \"path\" : \"/ou=People,o=JNDITutorial\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ldap://localhost:389/ou=People,o=JNDITutorial\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"ldap\", \"authority\" : \"localhost:389\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : \"389\", \"path\" : \"/ou=People,o=JNDITutorial\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ldap://localhost:389\", \"type\" : \"Origin\", \"scheme\" : \"ldap\", \"authority\" : \"localhost:389\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"localhost\", \"port\" : \"389\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ldap://localhost:389/ou=People,o=JNDITutorial\", \"href\" : \"ldap://localhost:389/ou=People,o=JNDITutorial\", \"origin\" : \"null\", \"protocol\" : \"ldap:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"localhost:389\", \"hostname\" : \"localhost\", \"port\" : \"389\", \"pathname\" : \"/ou=People,o=JNDITutorial\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"lolscheme:x x#x x\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"lolscheme:x x#x x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"lolscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x x\", \"query\" : null, \"fragment\" : \"x x\" },\n    \"inputNormalised\" : { \"stringValue\" : \"lolscheme:x%20x#x%20x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"lolscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x%20x\", \"query\" : null, \"fragment\" : \"x%20x\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"lolscheme:x%20x#x%20x\", \"type\" : \"OpaqueUri\", \"scheme\" : \"lolscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x%20x\", \"query\" : null, \"fragment\" : \"x%20x\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"lolscheme:x x#x x\", \"href\" : \"lolscheme:x x#x%20x\", \"protocol\" : \"lolscheme:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"x x\", \"search\" : \"\", \"hash\" : \"#x%20x\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"madeupscheme:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"madeupscheme:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"madeupscheme:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"madeupscheme:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"madeupscheme:/example.com/\", \"href\" : \"madeupscheme:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"madeupscheme:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"madeupscheme:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"madeupscheme:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"madeupscheme:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"madeupscheme:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"madeupscheme:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"madeupscheme:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"madeupscheme:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"madeupscheme:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"madeupscheme:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"madeupscheme:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"madeupscheme:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"madeupscheme:example.com/\", \"href\" : \"madeupscheme:example.com/\", \"origin\" : \"null\", \"protocol\" : \"madeupscheme:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"madeupscheme:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"madeupscheme:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"madeupscheme:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"madeupscheme:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"madeupscheme\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"madeupscheme:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"madeupscheme:example.com/\", \"origin\" : \"null\", \"protocol\" : \"madeupscheme:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"mailto:/../\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"mailto:/../\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"mailto:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"mailto:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"mailto:/../\", \"href\" : \"mailto:/\", \"origin\" : \"null\", \"protocol\" : \"mailto:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"mailto:///test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"mailto:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"mailto\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"mailto:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"mailto\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"mailto:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"mailto\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"mailto://\", \"type\" : \"Origin\", \"scheme\" : \"mailto\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"mailto:///test\", \"href\" : \"mailto:///test\", \"origin\" : \"null\", \"protocol\" : \"mailto:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"mailto://example.com:8080/pathname?search#hash\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"mailto://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"mailto\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"inputNormalised\" : { \"stringValue\" : \"mailto://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"mailto\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"mailto://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"mailto\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"origin\" : { \"stringValue\" : \"mailto://example.com:8080\", \"type\" : \"Origin\", \"scheme\" : \"mailto\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"mailto://example.com:8080/pathname?search#hash\", \"href\" : \"mailto://example.com:8080/pathname?search#hash\", \"origin\" : \"null\", \"protocol\" : \"mailto:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com:8080\", \"hostname\" : \"example.com\", \"port\" : \"8080\", \"pathname\" : \"/pathname\", \"search\" : \"?search\", \"hash\" : \"#hash\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"mailto://test/a/../b\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"mailto://test/a/../b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"mailto\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/a/../b\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"mailto://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"mailto\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"mailto://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"mailto\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"mailto://test\", \"type\" : \"Origin\", \"scheme\" : \"mailto\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"mailto://test/a/../b\", \"href\" : \"mailto://test/b\", \"origin\" : \"null\", \"protocol\" : \"mailto:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/b\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"mailto:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"mailto:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"mailto:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"mailto:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"mailto:/example.com/\", \"href\" : \"mailto:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"mailto:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"mailto:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"mailto:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"mailto:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"mailto:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"mailto:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"mailto:/example.com/\", \"origin\" : \"null\", \"protocol\" : \"mailto:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"mailto:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"mailto:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"mailto:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"mailto:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"mailto:example.com/\", \"href\" : \"mailto:example.com/\", \"origin\" : \"null\", \"protocol\" : \"mailto:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"mailto:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"mailto:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"mailto:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"mailto:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"mailto\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"mailto:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"mailto:example.com/\", \"origin\" : \"null\", \"protocol\" : \"mailto:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"example.com/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"materialized-view://x:0/a\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"materialized-view://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"materialized-view\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"materialized-view://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"materialized-view\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"materialized-view://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"materialized-view\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"materialized-view://x:0\", \"type\" : \"Origin\", \"scheme\" : \"materialized-view\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"materialized-view://x:0/a\", \"href\" : \"materialized-view://x:0/a\", \"origin\" : \"null\", \"protocol\" : \"materialized-view:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"/a\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"non-spec:/..//\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-spec:/..//\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/..//\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-spec:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-spec:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-spec:/..//\", \"href\" : \"non-spec:/.//\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-spec:/..//path\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-spec:/..//path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/..//path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-spec:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-spec:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-spec:/..//path\", \"href\" : \"non-spec:/.//path\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-spec:/.//\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-spec:/.//\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/.//\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-spec:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-spec:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-spec:/.//\", \"href\" : \"non-spec:/.//\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-spec:/.//path\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-spec:/.//path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/.//path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-spec:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-spec:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-spec:/.//path\", \"href\" : \"non-spec:/.//path\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-spec://example.org/test?a#b\\u0000c\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-spec://example.org/test?a#b\\u0000c\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"non-spec\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"b\\u0000c\" },\n    \"inputNormalised\" : { \"stringValue\" : \"non-spec://example.org/test?a#b%00c\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"non-spec\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"b%00c\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-spec://example.org/test?a#b%00c\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"non-spec\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"b%00c\" },\n    \"origin\" : { \"stringValue\" : \"non-spec://example.org\", \"type\" : \"Origin\", \"scheme\" : \"non-spec\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-spec://example.org/test?a#b\\u0000c\", \"href\" : \"non-spec://example.org/test?a#b%00c\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.org\", \"hostname\" : \"example.org\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?a\", \"hash\" : \"#b%00c\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"non-spec:/a/..//\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-spec:/a/..//\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a/..//\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-spec:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-spec:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-spec:/a/..//\", \"href\" : \"non-spec:/.//\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-spec:/a/..//path\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-spec:/a/..//path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/a/..//path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-spec:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-spec:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-spec:/a/..//path\", \"href\" : \"non-spec:/.//path\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-spec:/test?a#b\\u0000c\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-spec:/test?a#b\\u0000c\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"b\\u0000c\" },\n    \"inputNormalised\" : { \"stringValue\" : \"non-spec:/test?a#b%00c\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"b%00c\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-spec:/test?a#b%00c\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/test\", \"query\" : \"a\", \"fragment\" : \"b%00c\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-spec:/test?a#b\\u0000c\", \"href\" : \"non-spec:/test?a#b%00c\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"?a\", \"hash\" : \"#b%00c\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"non-special://%E2%80%A0/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special://%E2%80%A0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"%E2%80%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%80%A0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special://%E2%80%A0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"%E2%80%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%80%A0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special://%E2%80%A0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"%E2%80%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%80%A0\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"non-special://%E2%80%A0\", \"type\" : \"Origin\", \"scheme\" : \"non-special\", \"authority\" : \"%E2%80%A0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"%E2%80%A0\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-special://%E2%80%A0/\", \"href\" : \"non-special://%E2%80%A0/\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"%E2%80%A0\", \"hostname\" : \"%E2%80%A0\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"non-special://:@test/x\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special://:@test/x\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \":@test\", \"userInfo\" : \":\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/x\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special://:@test/x\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \":@test\", \"userInfo\" : \":\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/x\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special://:@test/x\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \":@test\", \"userInfo\" : \":\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/x\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"non-special://test\", \"type\" : \"Origin\", \"scheme\" : \"non-special\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-special://:@test/x\", \"href\" : \"non-special://test/x\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/x\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special://H%4fSt/path\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special://H%4fSt/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"H%4fSt\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"H%4fSt\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special://h%4Fst/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"h%4Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h%4Fst\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special://h%4Fst/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"h%4Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h%4Fst\", \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"non-special://h%4Fst\", \"type\" : \"Origin\", \"scheme\" : \"non-special\", \"authority\" : \"h%4Fst\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"h%4Fst\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-special://H%4fSt/path\", \"href\" : \"non-special://H%4fSt/path\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"H%4fSt\", \"hostname\" : \"H%4fSt\", \"port\" : \"\", \"pathname\" : \"/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special://[1:2:0:0:0:0:0:3]/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special://[1:2:0:0:0:0:0:3]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2:0:0:0:0:0:3]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2:0:0:0:0:0:3]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special://[1:2:0:0:0:0:0:3]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2:0:0:0:0:0:3]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2:0:0:0:0:0:3]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special://[1:2:0:0:0:0:0:3]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2:0:0:0:0:0:3]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2:0:0:0:0:0:3]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"non-special://[1:2:0:0:0:0:0:3]\", \"type\" : \"Origin\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2:0:0:0:0:0:3]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2:0:0:0:0:0:3]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-special://[1:2:0:0:0:0:0:3]/\", \"href\" : \"non-special://[1:2::3]/\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[1:2::3]\", \"hostname\" : \"[1:2::3]\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special://[1:2:0:0:5:0:0:0]/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special://[1:2:0:0:5:0:0:0]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2:0:0:5:0:0:0]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2:0:0:5:0:0:0]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special://[1:2:0:0:5:0:0:0]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2:0:0:5:0:0:0]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2:0:0:5:0:0:0]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special://[1:2:0:0:5:0:0:0]/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2:0:0:5:0:0:0]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2:0:0:5:0:0:0]\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"non-special://[1:2:0:0:5:0:0:0]\", \"type\" : \"Origin\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2:0:0:5:0:0:0]\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2:0:0:5:0:0:0]\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-special://[1:2:0:0:5:0:0:0]/\", \"href\" : \"non-special://[1:2:0:0:5::]/\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[1:2:0:0:5::]\", \"hostname\" : \"[1:2:0:0:5::]\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special://[1:2::3]:80/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special://[1:2::3]:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2::3]:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2::3]\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special://[1:2::3]:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2::3]:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2::3]\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special://[1:2::3]:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2::3]:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2::3]\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"non-special://[1:2::3]:80\", \"type\" : \"Origin\", \"scheme\" : \"non-special\", \"authority\" : \"[1:2::3]:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"[1:2::3]\", \"port\" : \"80\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-special://[1:2::3]:80/\", \"href\" : \"non-special://[1:2::3]:80/\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"[1:2::3]:80\", \"hostname\" : \"[1:2::3]\", \"port\" : \"80\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"non-special://host/a\\\\b\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special://host/a\\\\b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/a\\\\b\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special://host/a%5Cb\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/a%5Cb\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special://host/a%5Cb\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/a%5Cb\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"non-special://host\", \"type\" : \"Origin\", \"scheme\" : \"non-special\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-special://host/a\\\\b\", \"href\" : \"non-special://host/a\\\\b\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/a\\\\b\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special://test:@test/x\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special://test:@test/x\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"test:@test\", \"userInfo\" : \"test:\", \"username\" : \"test\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/x\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special://test:@test/x\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"test:@test\", \"userInfo\" : \"test:\", \"username\" : \"test\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/x\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special://test:@test/x\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"non-special\", \"authority\" : \"test:@test\", \"userInfo\" : \"test:\", \"username\" : \"test\", \"password\" : \"\", \"host\" : \"test\", \"port\" : null, \"path\" : \"/x\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"non-special://test\", \"type\" : \"Origin\", \"scheme\" : \"non-special\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"non-special://test:@test/x\", \"href\" : \"non-special://test@test/x\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"test\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/x\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:/\\\\path\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:/\\\\path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\\\\path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:/%5Cpath\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/%5Cpath\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:/%5Cpath\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/%5Cpath\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:/\\\\path\", \"href\" : \"non-special:/\\\\path\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/\\\\path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:\\\\/opaque\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:\\\\/opaque\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\/opaque\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:%5C/opaque\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C/opaque\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:%5C/opaque\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C/opaque\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:\\\\/opaque\", \"href\" : \"non-special:\\\\/opaque\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\\\\/opaque\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:\\\\\\\\opaque\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:\\\\\\\\opaque\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\opaque\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:%5C%5Copaque\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Copaque\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:%5C%5Copaque\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Copaque\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:\\\\\\\\opaque\", \"href\" : \"non-special:\\\\\\\\opaque\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\\\\\\\\opaque\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:\\\\\\\\opaque/path\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:\\\\\\\\opaque/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\opaque/path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:%5C%5Copaque/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Copaque/path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:%5C%5Copaque/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Copaque/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:\\\\\\\\opaque/path\", \"href\" : \"non-special:\\\\\\\\opaque/path\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\\\\\\\\opaque/path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:\\\\\\\\opaque\\\\path\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:\\\\\\\\opaque\\\\path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\\\\\opaque\\\\path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:%5C%5Copaque%5Cpath\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Copaque%5Cpath\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:%5C%5Copaque%5Cpath\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C%5Copaque%5Cpath\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:\\\\\\\\opaque\\\\path\", \"href\" : \"non-special:\\\\\\\\opaque\\\\path\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\\\\\\\\opaque\\\\path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:cannot-be-a-base-url-!%22$%25&'()*+,-.;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~@/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"cannot-be-a-base-url-!%22$%25&'()*+,-.;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~@/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:cannot-be-a-base-url-!%22$%25&'()*+,-.;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~@/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"cannot-be-a-base-url-!%22$%25&'()*+,-.;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~@/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\", \"href\" : \"non-special:cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"cannot-be-a-base-url-!\\\"$%&'()*+,-.;<=>@[\\\\]^_`{|}~@/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:opaque \\t\\t  \\t#hi\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:opaque \\t\\t  \\t#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque \\t\\t  \\t\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:opaque%20%09%09%20%20%09#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%09%09%20%20%09\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:opaque%20%09%09%20%20%09#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%09%09%20%20%09\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:opaque \\t\\t  \\t#hi\", \"href\" : \"non-special:opaque  %20#hi\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"opaque  %20\", \"search\" : \"\", \"hash\" : \"#hi\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:opaque \\t\\t  #hi\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:opaque \\t\\t  #hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque \\t\\t  \", \"query\" : null, \"fragment\" : \"hi\" },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:opaque%20%09%09%20%20#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%09%09%20%20\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:opaque%20%09%09%20%20#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%09%09%20%20\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:opaque \\t\\t  #hi\", \"href\" : \"non-special:opaque  %20#hi\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"opaque  %20\", \"search\" : \"\", \"hash\" : \"#hi\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:opaque  \",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:opaque  \", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque  \", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:opaque%20%20\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:opaque%20%20\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:opaque  \", \"href\" : \"non-special:opaque\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"opaque\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:opaque  #hi\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:opaque  #hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque  \", \"query\" : null, \"fragment\" : \"hi\" },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:opaque%20%20#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:opaque%20%20#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:opaque  #hi\", \"href\" : \"non-special:opaque %20#hi\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"opaque %20\", \"search\" : \"\", \"hash\" : \"#hi\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:opaque  ?hi\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:opaque  ?hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque  \", \"query\" : \"hi\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:opaque%20%20?hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20\", \"query\" : \"hi\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:opaque%20%20?hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20\", \"query\" : \"hi\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:opaque  ?hi\", \"href\" : \"non-special:opaque %20?hi\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"opaque %20\", \"search\" : \"?hi\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:opaque  x#hi\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:opaque  x#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque  x\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:opaque%20%20x#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20x\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:opaque%20%20x#hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20x\", \"query\" : null, \"fragment\" : \"hi\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:opaque  x#hi\", \"href\" : \"non-special:opaque  x#hi\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"opaque  x\", \"search\" : \"\", \"hash\" : \"#hi\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:opaque  x?hi\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:opaque  x?hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque  x\", \"query\" : \"hi\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:opaque%20%20x?hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20x\", \"query\" : \"hi\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:opaque%20%20x?hi\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"opaque%20%20x\", \"query\" : \"hi\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:opaque  x?hi\", \"href\" : \"non-special:opaque  x?hi\", \"origin\" : \"null\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"opaque  x\", \"search\" : \"?hi\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"non-special:x/?#\\u0000y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:x/?#\\u0000y\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/\", \"query\" : \"\", \"fragment\" : \"\\u0000y\" },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:x/?#%00y\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/\", \"query\" : \"\", \"fragment\" : \"%00y\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:x/?#%00y\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/\", \"query\" : \"\", \"fragment\" : \"%00y\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:x/?#\\u0000y\", \"href\" : \"non-special:x/?#%00y\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"x/\", \"search\" : \"\", \"hash\" : \"#%00y\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"non-special:x/?#￿y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:x/?#￿y\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/\", \"query\" : \"\", \"fragment\" : \"￿y\" },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:x/?#%EF%BF%BFy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/\", \"query\" : \"\", \"fragment\" : \"%EF%BF%BFy\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:x/?#%EF%BF%BFy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/\", \"query\" : \"\", \"fragment\" : \"%EF%BF%BFy\" },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:x/?#￿y\", \"href\" : \"non-special:x/?#%EF%BF%BFy\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"x/\", \"search\" : \"\", \"hash\" : \"#%EF%BF%BFy\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"non-special:x/?￿y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:x/?￿y\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/\", \"query\" : \"￿y\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:x/?%EF%BF%BFy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/\", \"query\" : \"%EF%BF%BFy\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:x/?%EF%BF%BFy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/\", \"query\" : \"%EF%BF%BFy\", \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:x/?￿y\", \"href\" : \"non-special:x/?%EF%BF%BFy\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"x/\", \"search\" : \"?%EF%BF%BFy\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"non-special:x/￿y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:x/￿y\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/￿y\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:x/%EF%BF%BFy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/%EF%BF%BFy\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:x/%EF%BF%BFy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"x/%EF%BF%BFy\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:x/￿y\", \"href\" : \"non-special:x/%EF%BF%BFy\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"x/%EF%BF%BFy\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"non-special:￿y\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"non-special:￿y\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"￿y\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"non-special:%EF%BF%BFy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%EF%BF%BFy\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"non-special:%EF%BF%BFy\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-special\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%EF%BF%BFy\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"non-special:￿y\", \"href\" : \"non-special:%EF%BF%BFy\", \"protocol\" : \"non-special:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"%EF%BF%BFy\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"notspecial://host/?'\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"notspecial://host/?'\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"notspecial\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : \"'\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"notspecial://host/?'\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"notspecial\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : \"'\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"notspecial://host/?'\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"notspecial\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/\", \"query\" : \"'\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"notspecial://host\", \"type\" : \"Origin\", \"scheme\" : \"notspecial\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"notspecial://host/?'\", \"href\" : \"notspecial://host/?'\", \"origin\" : \"null\", \"protocol\" : \"notspecial:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"?'\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"path\",\n    \"base\" : \"non-spec:/..//p\",\n    \"inputExpected\" : { \"stringValue\" : \"path\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"path\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"path\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"path\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"non-spec:/..//p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/..//p\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"non-spec:/p\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/p\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"non-spec:/path\", \"type\" : \"OpaqueUri\", \"scheme\" : \"non-spec\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/path\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"path\", \"base\" : \"non-spec:/..//p\", \"href\" : \"non-spec:/.//path\", \"protocol\" : \"non-spec:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"//path\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"pix/submit.gif\",\n    \"base\" : \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html\",\n    \"inputExpected\" : { \"stringValue\" : \"pix/submit.gif\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"pix/submit.gif\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"pix/submit.gif\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"pix/submit.gif\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"pix/submit.gif\", \"base\" : \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html\", \"href\" : \"file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"redis\", \"authority\" : \"foo:bar@somehost:6379\", \"userInfo\" : \"foo:bar\", \"username\" : \"foo\", \"password\" : \"bar\", \"host\" : \"somehost\", \"port\" : \"6379\", \"path\" : \"/0\", \"query\" : \"baz=bam&qux=baz\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"redis\", \"authority\" : \"foo:bar@somehost:6379\", \"userInfo\" : \"foo:bar\", \"username\" : \"foo\", \"password\" : \"bar\", \"host\" : \"somehost\", \"port\" : \"6379\", \"path\" : \"/0\", \"query\" : \"baz=bam&qux=baz\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"redis\", \"authority\" : \"foo:bar@somehost:6379\", \"userInfo\" : \"foo:bar\", \"username\" : \"foo\", \"password\" : \"bar\", \"host\" : \"somehost\", \"port\" : \"6379\", \"path\" : \"/0\", \"query\" : \"baz=bam&qux=baz\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"redis://somehost:6379\", \"type\" : \"Origin\", \"scheme\" : \"redis\", \"authority\" : \"somehost:6379\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"somehost\", \"port\" : \"6379\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\", \"href\" : \"redis://foo:bar@somehost:6379/0?baz=bam&qux=baz\", \"origin\" : \"null\", \"protocol\" : \"redis:\", \"username\" : \"foo\", \"password\" : \"bar\", \"host\" : \"somehost:6379\", \"hostname\" : \"somehost\", \"port\" : \"6379\", \"pathname\" : \"/0\", \"search\" : \"?baz=bam&qux=baz\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"rsync://foo@host:911/sup\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"rsync://foo@host:911/sup\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"rsync\", \"authority\" : \"foo@host:911\", \"userInfo\" : \"foo\", \"username\" : \"foo\", \"password\" : null, \"host\" : \"host\", \"port\" : \"911\", \"path\" : \"/sup\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"rsync://foo@host:911/sup\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"rsync\", \"authority\" : \"foo@host:911\", \"userInfo\" : \"foo\", \"username\" : \"foo\", \"password\" : null, \"host\" : \"host\", \"port\" : \"911\", \"path\" : \"/sup\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"rsync://foo@host:911/sup\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"rsync\", \"authority\" : \"foo@host:911\", \"userInfo\" : \"foo\", \"username\" : \"foo\", \"password\" : null, \"host\" : \"host\", \"port\" : \"911\", \"path\" : \"/sup\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"rsync://host:911\", \"type\" : \"Origin\", \"scheme\" : \"rsync\", \"authority\" : \"host:911\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : \"911\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"rsync://foo@host:911/sup\", \"href\" : \"rsync://foo@host:911/sup\", \"origin\" : \"null\", \"protocol\" : \"rsync:\", \"username\" : \"foo\", \"password\" : \"\", \"host\" : \"host:911\", \"hostname\" : \"host\", \"port\" : \"911\", \"pathname\" : \"/sup\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"sc:\",\n    \"base\" : \"https://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"sc:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"sc:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"https://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"https://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"https\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"sc:\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"sc:\", \"base\" : \"https://example.org/foo/bar\", \"href\" : \"sc:\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\", \"search\" : \"\", \"searchParams\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"sc://#\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"sc://#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : \"\" },\n    \"inputNormalised\" : { \"stringValue\" : \"sc:///#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : \"\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"sc:///#\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : \"\" },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"sc://#\", \"href\" : \"sc://#\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"sc://?\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"sc://?\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : \"\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"sc:///?\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"sc:///?\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : \"\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"sc://\", \"type\" : \"Origin\", \"scheme\" : \"sc\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"sc://?\", \"href\" : \"sc://?\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"sc::a@example.net\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"sc::a@example.net\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":a@example.net\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"sc::a@example.net\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":a@example.net\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"sc::a@example.net\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \":a@example.net\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"sc::a@example.net\", \"href\" : \"sc::a@example.net\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \":a@example.net\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"sc:\\\\../\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"sc:\\\\../\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"\\\\../\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"sc:%5C../\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C../\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"sc:%5C../\", \"type\" : \"OpaqueUri\", \"scheme\" : \"sc\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%5C../\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"sc:\\\\../\", \"href\" : \"sc:\\\\../\", \"origin\" : \"null\", \"protocol\" : \"sc:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"\\\\../\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ssh://example.com/foo/bar.git\",\n    \"base\" : \"http://example.org/\",\n    \"inputExpected\" : { \"stringValue\" : \"ssh://example.com/foo/bar.git\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"ssh\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar.git\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ssh://example.com/foo/bar.git\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"ssh\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar.git\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/\", \"type\" : \"BaseUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"ssh://example.com/foo/bar.git\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"ssh\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"/foo/bar.git\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ssh://example.com\", \"type\" : \"Origin\", \"scheme\" : \"ssh\", \"authority\" : \"example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ssh://example.com/foo/bar.git\", \"base\" : \"http://example.org/\", \"href\" : \"ssh://example.com/foo/bar.git\", \"origin\" : \"null\", \"protocol\" : \"ssh:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/foo/bar.git\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"steam://x:0/a\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"steam://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"steam\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"steam://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"steam\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"steam://x:0/a\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"steam\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/a\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"steam://x:0\", \"type\" : \"Origin\", \"scheme\" : \"steam\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"steam://x:0/a\", \"href\" : \"steam://x:0/a\", \"origin\" : \"null\", \"protocol\" : \"steam:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"/a\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"stun:///test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"stun:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"stun\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"stun:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"stun\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"stun:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"stun\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"stun://\", \"type\" : \"Origin\", \"scheme\" : \"stun\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"stun:///test\", \"href\" : \"stun:///test\", \"origin\" : \"null\", \"protocol\" : \"stun:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"stun://example.com:8080/pathname?search#hash\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"stun://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"stun\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"inputNormalised\" : { \"stringValue\" : \"stun://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"stun\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"stun://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"stun\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"origin\" : { \"stringValue\" : \"stun://example.com:8080\", \"type\" : \"Origin\", \"scheme\" : \"stun\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"stun://example.com:8080/pathname?search#hash\", \"href\" : \"stun://example.com:8080/pathname?search#hash\", \"origin\" : \"null\", \"protocol\" : \"stun:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com:8080\", \"hostname\" : \"example.com\", \"port\" : \"8080\", \"pathname\" : \"/pathname\", \"search\" : \"?search\", \"hash\" : \"#hash\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"stun://test/a/../b\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"stun://test/a/../b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"stun\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/a/../b\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"stun://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"stun\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"stun://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"stun\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"stun://test\", \"type\" : \"Origin\", \"scheme\" : \"stun\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"stun://test/a/../b\", \"href\" : \"stun://test/b\", \"origin\" : \"null\", \"protocol\" : \"stun:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/b\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"tag:joe@example.org,2001:foo/bar\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"tag:joe@example.org,2001:foo/bar\", \"type\" : \"OpaqueUri\", \"scheme\" : \"tag\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"joe@example.org,2001:foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"tag:joe@example.org,2001:foo/bar\", \"type\" : \"OpaqueUri\", \"scheme\" : \"tag\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"joe@example.org,2001:foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"tag:joe@example.org,2001:foo/bar\", \"type\" : \"OpaqueUri\", \"scheme\" : \"tag\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"joe@example.org,2001:foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"tag:joe@example.org,2001:foo/bar\", \"href\" : \"tag:joe@example.org,2001:foo/bar\", \"origin\" : \"null\", \"protocol\" : \"tag:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"joe@example.org,2001:foo/bar\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"tel:1234567890\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"tel:1234567890\", \"type\" : \"OpaqueUri\", \"scheme\" : \"tel\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"1234567890\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"tel:1234567890\", \"type\" : \"OpaqueUri\", \"scheme\" : \"tel\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"1234567890\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"tel:1234567890\", \"type\" : \"OpaqueUri\", \"scheme\" : \"tel\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"1234567890\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"tel:1234567890\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"tel:1234567890\", \"origin\" : \"null\", \"protocol\" : \"tel:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"1234567890\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"telnet://user:pass@foobar.com:23/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"telnet://user:pass@foobar.com:23/\", \"type\" : \"BaseUrl\", \"scheme\" : \"telnet\", \"authority\" : \"user:pass@foobar.com:23\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"foobar.com\", \"port\" : \"23\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"telnet://user:pass@foobar.com:23/\", \"type\" : \"BaseUrl\", \"scheme\" : \"telnet\", \"authority\" : \"user:pass@foobar.com:23\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"foobar.com\", \"port\" : \"23\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"telnet://user:pass@foobar.com:23/\", \"type\" : \"BaseUrl\", \"scheme\" : \"telnet\", \"authority\" : \"user:pass@foobar.com:23\", \"userInfo\" : \"user:pass\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"foobar.com\", \"port\" : \"23\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"telnet://foobar.com:23\", \"type\" : \"Origin\", \"scheme\" : \"telnet\", \"authority\" : \"foobar.com:23\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foobar.com\", \"port\" : \"23\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"telnet://user:pass@foobar.com:23/\", \"href\" : \"telnet://user:pass@foobar.com:23/\", \"origin\" : \"null\", \"protocol\" : \"telnet:\", \"username\" : \"user\", \"password\" : \"pass\", \"host\" : \"foobar.com:23\", \"hostname\" : \"foobar.com\", \"port\" : \"23\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"test\",\n    \"base\" : \"file:///tmp/mock/path\",\n    \"inputExpected\" : { \"stringValue\" : \"test\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"test\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"file:///tmp/mock/path\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/path\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"file:///tmp/mock/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/tmp/mock/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"file://\", \"type\" : \"Origin\", \"scheme\" : \"file\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"test\", \"base\" : \"file:///tmp/mock/path\", \"href\" : \"file:///tmp/mock/test\", \"protocol\" : \"file:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/tmp/mock/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"test-a-colon-slash-b.html\",\n    \"base\" : \"a:/b\",\n    \"inputExpected\" : { \"stringValue\" : \"test-a-colon-slash-b.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-slash-b.html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"test-a-colon-slash-b.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-slash-b.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"a:/b\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"a:/b\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"a:/test-a-colon-slash-b.html\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/test-a-colon-slash-b.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"test-a-colon-slash-b.html\", \"base\" : \"a:/b\", \"href\" : \"a:/test-a-colon-slash-b.html\", \"protocol\" : \"a:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test-a-colon-slash-b.html\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"test-a-colon-slash-slash-b.html\",\n    \"base\" : \"a://b\",\n    \"inputExpected\" : { \"stringValue\" : \"test-a-colon-slash-slash-b.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-slash-slash-b.html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"test-a-colon-slash-slash-b.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-slash-slash-b.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"a://b\", \"type\" : \"Origin\", \"scheme\" : \"a\", \"authority\" : \"b\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"b\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"a://b/\", \"type\" : \"BaseUrl\", \"scheme\" : \"a\", \"authority\" : \"b\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"b\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"a://b/test-a-colon-slash-slash-b.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"a\", \"authority\" : \"b\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"b\", \"port\" : null, \"path\" : \"/test-a-colon-slash-slash-b.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"a://b\", \"type\" : \"Origin\", \"scheme\" : \"a\", \"authority\" : \"b\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"b\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"test-a-colon-slash-slash-b.html\", \"base\" : \"a://b\", \"href\" : \"a://b/test-a-colon-slash-slash-b.html\", \"protocol\" : \"a:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"b\", \"hostname\" : \"b\", \"port\" : \"\", \"pathname\" : \"/test-a-colon-slash-slash-b.html\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"test-a-colon-slash-slash.html\",\n    \"base\" : \"a://\",\n    \"inputExpected\" : { \"stringValue\" : \"test-a-colon-slash-slash.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-slash-slash.html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"test-a-colon-slash-slash.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-slash-slash.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"a://\", \"type\" : \"Origin\", \"scheme\" : \"a\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"a:///\", \"type\" : \"BaseUrl\", \"scheme\" : \"a\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"a:///test-a-colon-slash-slash.html\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"a\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test-a-colon-slash-slash.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"a://\", \"type\" : \"Origin\", \"scheme\" : \"a\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"test-a-colon-slash-slash.html\", \"base\" : \"a://\", \"href\" : \"a:///test-a-colon-slash-slash.html\", \"protocol\" : \"a:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test-a-colon-slash-slash.html\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"test-a-colon-slash.html\",\n    \"base\" : \"a:/\",\n    \"inputExpected\" : { \"stringValue\" : \"test-a-colon-slash.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-slash.html\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"test-a-colon-slash.html\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test-a-colon-slash.html\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"a:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"a:/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"a:/test-a-colon-slash.html\", \"type\" : \"OpaqueUri\", \"scheme\" : \"a\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/test-a-colon-slash.html\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"test-a-colon-slash.html\", \"base\" : \"a:/\", \"href\" : \"a:/test-a-colon-slash.html\", \"protocol\" : \"a:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test-a-colon-slash.html\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"test.txt\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test.txt\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"test.txt\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/test.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"test.txt\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/test.txt\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/test.txt\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"tftp://foobar.com/someconfig;mode=netascii\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"tftp://foobar.com/someconfig;mode=netascii\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"tftp\", \"authority\" : \"foobar.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foobar.com\", \"port\" : null, \"path\" : \"/someconfig;mode=netascii\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"tftp://foobar.com/someconfig;mode=netascii\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"tftp\", \"authority\" : \"foobar.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foobar.com\", \"port\" : null, \"path\" : \"/someconfig;mode=netascii\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"tftp://foobar.com/someconfig;mode=netascii\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"tftp\", \"authority\" : \"foobar.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foobar.com\", \"port\" : null, \"path\" : \"/someconfig;mode=netascii\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"tftp://foobar.com\", \"type\" : \"Origin\", \"scheme\" : \"tftp\", \"authority\" : \"foobar.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foobar.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"tftp://foobar.com/someconfig;mode=netascii\", \"href\" : \"tftp://foobar.com/someconfig;mode=netascii\", \"origin\" : \"null\", \"protocol\" : \"tftp:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foobar.com\", \"hostname\" : \"foobar.com\", \"port\" : \"\", \"pathname\" : \"/someconfig;mode=netascii\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"turn:///test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"turn:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"turn\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"turn:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"turn\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"turn:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"turn\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"turn://\", \"type\" : \"Origin\", \"scheme\" : \"turn\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"turn:///test\", \"href\" : \"turn:///test\", \"origin\" : \"null\", \"protocol\" : \"turn:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"turn://example.com:8080/pathname?search#hash\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"turn://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"turn\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"inputNormalised\" : { \"stringValue\" : \"turn://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"turn\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"turn://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"turn\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"origin\" : { \"stringValue\" : \"turn://example.com:8080\", \"type\" : \"Origin\", \"scheme\" : \"turn\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"turn://example.com:8080/pathname?search#hash\", \"href\" : \"turn://example.com:8080/pathname?search#hash\", \"origin\" : \"null\", \"protocol\" : \"turn:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com:8080\", \"hostname\" : \"example.com\", \"port\" : \"8080\", \"pathname\" : \"/pathname\", \"search\" : \"?search\", \"hash\" : \"#hash\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"turn://test/a/../b\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"turn://test/a/../b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"turn\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/a/../b\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"turn://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"turn\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"turn://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"turn\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"turn://test\", \"type\" : \"Origin\", \"scheme\" : \"turn\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"turn://test/a/../b\", \"href\" : \"turn://test/b\", \"origin\" : \"null\", \"protocol\" : \"turn:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/b\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"urn:///test\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"urn:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"urn\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"urn:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"urn\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"urn:///test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"urn\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"urn://\", \"type\" : \"Origin\", \"scheme\" : \"urn\", \"authority\" : \"\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"urn:///test\", \"href\" : \"urn:///test\", \"origin\" : \"null\", \"protocol\" : \"urn:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"/test\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"urn://example.com:8080/pathname?search#hash\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"urn://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"urn\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"inputNormalised\" : { \"stringValue\" : \"urn://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"urn\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"urn://example.com:8080/pathname?search#hash\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"urn\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"/pathname\", \"query\" : \"search\", \"fragment\" : \"hash\" },\n    \"origin\" : { \"stringValue\" : \"urn://example.com:8080\", \"type\" : \"Origin\", \"scheme\" : \"urn\", \"authority\" : \"example.com:8080\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.com\", \"port\" : \"8080\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"urn://example.com:8080/pathname?search#hash\", \"href\" : \"urn://example.com:8080/pathname?search#hash\", \"origin\" : \"null\", \"protocol\" : \"urn:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com:8080\", \"hostname\" : \"example.com\", \"port\" : \"8080\", \"pathname\" : \"/pathname\", \"search\" : \"?search\", \"hash\" : \"#hash\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"urn://test/a/../b\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"urn://test/a/../b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"urn\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/a/../b\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"urn://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"urn\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"urn://test/b\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"urn\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"/b\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"urn://test\", \"type\" : \"Origin\", \"scheme\" : \"urn\", \"authority\" : \"test\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"test\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"urn://test/a/../b\", \"href\" : \"urn://test/b\", \"origin\" : \"null\", \"protocol\" : \"urn:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"test\", \"hostname\" : \"test\", \"port\" : \"\", \"pathname\" : \"/b\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"urn:ietf:rfc:2648\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"urn:ietf:rfc:2648\", \"type\" : \"OpaqueUri\", \"scheme\" : \"urn\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"ietf:rfc:2648\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"urn:ietf:rfc:2648\", \"type\" : \"OpaqueUri\", \"scheme\" : \"urn\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"ietf:rfc:2648\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"urn:ietf:rfc:2648\", \"type\" : \"OpaqueUri\", \"scheme\" : \"urn\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"ietf:rfc:2648\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"urn:ietf:rfc:2648\", \"href\" : \"urn:ietf:rfc:2648\", \"origin\" : \"null\", \"protocol\" : \"urn:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"ietf:rfc:2648\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ut2004://10.10.10.10:7777/Index.ut2\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ut2004://10.10.10.10:7777/Index.ut2\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"ut2004\", \"authority\" : \"10.10.10.10:7777\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.10.10.10\", \"port\" : \"7777\", \"path\" : \"/Index.ut2\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ut2004://10.10.10.10:7777/Index.ut2\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"ut2004\", \"authority\" : \"10.10.10.10:7777\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.10.10.10\", \"port\" : \"7777\", \"path\" : \"/Index.ut2\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ut2004://10.10.10.10:7777/Index.ut2\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"ut2004\", \"authority\" : \"10.10.10.10:7777\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.10.10.10\", \"port\" : \"7777\", \"path\" : \"/Index.ut2\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ut2004://10.10.10.10:7777\", \"type\" : \"Origin\", \"scheme\" : \"ut2004\", \"authority\" : \"10.10.10.10:7777\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"10.10.10.10\", \"port\" : \"7777\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ut2004://10.10.10.10:7777/Index.ut2\", \"href\" : \"ut2004://10.10.10.10:7777/Index.ut2\", \"origin\" : \"null\", \"protocol\" : \"ut2004:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"10.10.10.10:7777\", \"hostname\" : \"10.10.10.10\", \"port\" : \"7777\", \"pathname\" : \"/Index.ut2\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"w://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"w://x:0\", \"type\" : \"Origin\", \"scheme\" : \"w\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"w://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"w\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"w://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"w\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"w://x:0\", \"type\" : \"Origin\", \"scheme\" : \"w\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"w://x:0\", \"href\" : \"w://x:0\", \"origin\" : \"null\", \"protocol\" : \"w:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"west://x:0\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"west://x:0\", \"type\" : \"Origin\", \"scheme\" : \"west\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"west://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"west\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"west://x:0/\", \"type\" : \"BaseUrl\", \"scheme\" : \"west\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"west://x:0\", \"type\" : \"Origin\", \"scheme\" : \"west\", \"authority\" : \"x:0\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"x\", \"port\" : \"0\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"west://x:0\", \"href\" : \"west://x:0\", \"origin\" : \"null\", \"protocol\" : \"west:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"x:0\", \"hostname\" : \"x\", \"port\" : \"0\", \"pathname\" : \"\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wow:%1G\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wow:%1G\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wow\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%1G\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wow:%251G\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wow\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%251G\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wow:%251G\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wow\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%251G\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"wow:%1G\", \"href\" : \"wow:%1G\", \"origin\" : \"null\", \"protocol\" : \"wow:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"%1G\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wow:%NBD\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wow:%NBD\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wow\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%NBD\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wow:%25NBD\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wow\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%25NBD\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wow:%25NBD\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wow\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%25NBD\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"wow:%NBD\", \"href\" : \"wow:%NBD\", \"origin\" : \"null\", \"protocol\" : \"wow:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"%NBD\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wow:￿\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wow:￿\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wow\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"￿\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wow:%EF%BF%BF\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wow\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%EF%BF%BF\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wow:%EF%BF%BF\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wow\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"%EF%BF%BF\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"wow:￿\", \"href\" : \"wow:%EF%BF%BF\", \"origin\" : \"null\", \"protocol\" : \"wow:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"\", \"hostname\" : \"\", \"port\" : \"\", \"pathname\" : \"%EF%BF%BF\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ws://foo:443/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ws://foo:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ws://foo:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ws://foo:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ws://foo:443\", \"type\" : \"Origin\", \"scheme\" : \"ws\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ws://foo:443/\", \"href\" : \"ws://foo:443/\", \"origin\" : \"ws://foo:443\", \"protocol\" : \"ws:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:443\", \"hostname\" : \"foo\", \"port\" : \"443\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ws://foo:80/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ws://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ws://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ws://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ws://foo\", \"type\" : \"Origin\", \"scheme\" : \"ws\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ws://foo:80/\", \"href\" : \"ws://foo/\", \"origin\" : \"ws://foo\", \"protocol\" : \"ws:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo\", \"hostname\" : \"foo\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ws://foo:81/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ws://foo:81/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ws://foo:81/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ws://foo:81/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ws://foo:81\", \"type\" : \"Origin\", \"scheme\" : \"ws\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ws://foo:81/\", \"href\" : \"ws://foo:81/\", \"origin\" : \"ws://foo:81\", \"protocol\" : \"ws:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:81\", \"hostname\" : \"foo\", \"port\" : \"81\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ws://foo:815/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ws://foo:815/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:815\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"815\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ws://foo:815/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:815\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"815\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ws://foo:815/\", \"type\" : \"BaseUrl\", \"scheme\" : \"ws\", \"authority\" : \"foo:815\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"815\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"ws://foo:815\", \"type\" : \"Origin\", \"scheme\" : \"ws\", \"authority\" : \"foo:815\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"815\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"ws://foo:815/\", \"href\" : \"ws://foo:815/\", \"origin\" : \"ws://foo:815\", \"protocol\" : \"ws:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:815\", \"hostname\" : \"foo\", \"port\" : \"815\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"ws:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ws:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ws:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ws:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ws:/example.com/\", \"href\" : \"ws://example.com/\", \"origin\" : \"ws://example.com\", \"protocol\" : \"ws:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ws:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"ws:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ws:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"ws:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ws:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"ws://example.com/\", \"origin\" : \"ws://example.com\", \"protocol\" : \"ws:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ws:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"ws:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ws:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"ws:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ws:example.com/\", \"href\" : \"ws://example.com/\", \"origin\" : \"ws://example.com\", \"protocol\" : \"ws:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"ws:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"ws:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"ws:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"ws:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"ws\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"ws:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"ws://example.com/\", \"origin\" : \"ws://example.com\", \"protocol\" : \"ws:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wss://foo:443/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wss://foo:443/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:443\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"443\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wss://foo/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"wss://foo\", \"type\" : \"Origin\", \"scheme\" : \"wss\", \"authority\" : \"foo\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"wss://foo:443/\", \"href\" : \"wss://foo/\", \"origin\" : \"wss://foo\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo\", \"hostname\" : \"foo\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"wss://foo:80/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wss://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wss://foo:80/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"wss://foo:80\", \"type\" : \"Origin\", \"scheme\" : \"wss\", \"authority\" : \"foo:80\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"80\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"wss://foo:80/\", \"href\" : \"wss://foo:80/\", \"origin\" : \"wss://foo:80\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:80\", \"hostname\" : \"foo\", \"port\" : \"80\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"wss://foo:81/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wss://foo:81/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss://foo:81/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wss://foo:81/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"wss://foo:81\", \"type\" : \"Origin\", \"scheme\" : \"wss\", \"authority\" : \"foo:81\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"81\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"wss://foo:81/\", \"href\" : \"wss://foo:81/\", \"origin\" : \"wss://foo:81\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:81\", \"hostname\" : \"foo\", \"port\" : \"81\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"wss://foo:815/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wss://foo:815/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:815\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"815\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss://foo:815/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:815\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"815\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wss://foo:815/\", \"type\" : \"BaseUrl\", \"scheme\" : \"wss\", \"authority\" : \"foo:815\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"815\", \"path\" : \"/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"wss://foo:815\", \"type\" : \"Origin\", \"scheme\" : \"wss\", \"authority\" : \"foo:815\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"foo\", \"port\" : \"815\", \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"wss://foo:815/\", \"href\" : \"wss://foo:815/\", \"origin\" : \"wss://foo:815\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"foo:815\", \"hostname\" : \"foo\", \"port\" : \"815\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  },\n  {\n    \"input\" : \"wss://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wss://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss://host/%20!%22$%25&'()*+,-./:;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/%20!%22$%25&'()*+,-./:;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wss://host/%20!%22$%25&'()*+,-./:;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/%20!%22$%25&'()*+,-./:;%3C=%3E@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"wss://host\", \"type\" : \"Origin\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"wss://host/ !\\\"$%&'()*+,-./:;<=>@[\\\\]^_`{|}~\", \"href\" : \"wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~\", \"origin\" : \"wss://host\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wss://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wss://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : null, \"fragment\" : \" !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\" },\n    \"inputNormalised\" : { \"stringValue\" : \"wss://host/dir/#%20!%22%23$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : null, \"fragment\" : \"%20!%22%23$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\" },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wss://host/dir/#%20!%22%23$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"AbsoluteUrl\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : null, \"fragment\" : \"%20!%22%23$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\" },\n    \"origin\" : { \"stringValue\" : \"wss://host\", \"type\" : \"Origin\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"wss://host/dir/# !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"href\" : \"wss://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\", \"origin\" : \"wss://host\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/dir/\", \"search\" : \"\", \"hash\" : \"#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\\\]^_%60{|}~\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wss://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wss://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : \" !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss://host/dir/?%20!%22$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : \"%20!%22$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wss://host/dir/?%20!%22$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"/dir/\", \"query\" : \"%20!%22$%25&'()*+,-./:;%3C=%3E?@%5B%5C%5D%5E_%60%7B%7C%7D~\", \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"wss://host\", \"type\" : \"Origin\", \"scheme\" : \"wss\", \"authority\" : \"host\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"host\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"wss://host/dir/? !\\\"$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\", \"href\" : \"wss://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\", \"origin\" : \"wss://host\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"host\", \"hostname\" : \"host\", \"port\" : \"\", \"pathname\" : \"/dir/\", \"search\" : \"?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\\\]^_`{|}~\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wss:/example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wss:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wss:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"wss:/example.com/\", \"href\" : \"wss://example.com/\", \"origin\" : \"wss://example.com\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wss:/example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"wss:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"wss:/example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"/example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"wss:/example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"wss://example.com/\", \"origin\" : \"wss://example.com\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wss:example.com/\",\n    \"base\" : null,\n    \"inputExpected\" : { \"stringValue\" : \"wss:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : null,\n    \"baseNormalised\" : null,\n    \"resolved\" : { \"stringValue\" : \"wss:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"wss:example.com/\", \"href\" : \"wss://example.com/\", \"origin\" : \"wss://example.com\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"wss:example.com/\",\n    \"base\" : \"http://example.org/foo/bar\",\n    \"inputExpected\" : { \"stringValue\" : \"wss:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"wss:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://example.org/foo/bar\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"example.org\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"example.org\", \"port\" : null, \"path\" : \"/foo/bar\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"wss:example.com/\", \"type\" : \"OpaqueUri\", \"scheme\" : \"wss\", \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"example.com/\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : null,\n    \"source\" : { \"input\" : \"wss:example.com/\", \"base\" : \"http://example.org/foo/bar\", \"href\" : \"wss://example.com/\", \"origin\" : \"wss://example.com\", \"protocol\" : \"wss:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"example.com\", \"hostname\" : \"example.com\", \"port\" : \"\", \"pathname\" : \"/\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : false\n  },\n  {\n    \"input\" : \"中/test.txt\",\n    \"base\" : \"http://www.example.com/test\",\n    \"inputExpected\" : { \"stringValue\" : \"中/test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"中/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"inputNormalised\" : { \"stringValue\" : \"中/test.txt\", \"type\" : \"RelativeUrl\", \"scheme\" : null, \"authority\" : null, \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : null, \"port\" : null, \"path\" : \"中/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"baseExpected\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"baseNormalised\" : { \"stringValue\" : \"http://www.example.com/test\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/test\", \"query\" : null, \"fragment\" : null },\n    \"resolved\" : { \"stringValue\" : \"http://www.example.com/%E4%B8%AD/test.txt\", \"type\" : \"ServersideAbsoluteUrl\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"/%E4%B8%AD/test.txt\", \"query\" : null, \"fragment\" : null },\n    \"origin\" : { \"stringValue\" : \"http://www.example.com\", \"type\" : \"Origin\", \"scheme\" : \"http\", \"authority\" : \"www.example.com\", \"userInfo\" : null, \"username\" : null, \"password\" : null, \"host\" : \"www.example.com\", \"port\" : null, \"path\" : \"\", \"query\" : null, \"fragment\" : null },\n    \"source\" : { \"input\" : \"中/test.txt\", \"base\" : \"http://www.example.com/test\", \"href\" : \"http://www.example.com/%E4%B8%AD/test.txt\", \"origin\" : \"http://www.example.com\", \"protocol\" : \"http:\", \"username\" : \"\", \"password\" : \"\", \"host\" : \"www.example.com\", \"hostname\" : \"www.example.com\", \"port\" : \"\", \"pathname\" : \"/%E4%B8%AD/test.txt\", \"search\" : \"\", \"hash\" : \"\" },\n    \"matchesWhatWg\" : true\n  }\n]"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson2/build.gradle.kts",
    "content": "@file:Suppress(\"VulnerableLibrariesLocal\")\n\nimport net.ltgt.gradle.errorprone.CheckSeverity\nimport net.ltgt.gradle.errorprone.errorprone\n\nplugins {\n  id(\"wiremock.common-conventions\")\n  id(\"net.ltgt.errorprone\") version \"5.1.0\"\n}\n\ntasks.jar {\n  archiveBaseName.set(\"wiremock-url-jackson2\")\n}\n\ndependencies {\n  api(project(\":wiremock-url:wiremock-url\"))\n  api(project(\":wiremock-url:wiremock-string-parser-jackson2\"))\n\n  implementation(project(\":wiremock-url:wiremock-string-parser\"))\n\n  compileOnly(\"org.jspecify:jspecify:1.0.0\")\n\n  testImplementation(\"com.fasterxml.jackson.core:jackson-core:2.5.0\")\n  testImplementation(\"com.fasterxml.jackson.core:jackson-databind:2.5.0\")\n  testImplementation(\"com.fasterxml.jackson.core:jackson-annotations:2.5.0\")\n  testImplementation(platform(\"org.junit:junit-bom:6.0.1\"))\n  testImplementation(libs.junit.jupiter.api)\n  testImplementation(libs.junit.jupiter.params)\n  testImplementation(libs.assertj.core)\n\n  testImplementation(\"io.github.classgraph:classgraph:4.8.184\")\n\n  testRuntimeOnly(libs.junit.jupiter)\n  testRuntimeOnly(libs.junit.platform.launcher)\n\n  annotationProcessor(\"com.uber.nullaway:nullaway:0.13.1\")\n  errorprone(\"com.google.errorprone:error_prone_core:2.42.0\")\n}\n\ntasks.compileJava {\n  options.errorprone {\n    check(\"NullAway\", CheckSeverity.ERROR)\n    check(\"NullableOptional\", CheckSeverity.OFF)\n    check(\"ClassInitializationDeadlock\", CheckSeverity.OFF)\n    option(\"NullAway:AnnotatedPackages\", \"org.wiremock.url\")\n  }\n}\n\ntasks.compileTestJava {\n  options.errorprone {\n    disableAllChecks = true\n  }\n}\n\npublishing {\n  publications {\n    create<MavenPublication>(\"mavenJava\") {\n      artifactId = tasks.jar.get().archiveBaseName.get()\n      from(components[\"java\"])\n\n      pom {\n        name = \"WireMock URL Jackson 2\"\n        description = \"Jackson 2 module for WireMock URL\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson2/src/main/java/org/wiremock/url/jackson2/WireMockUrlModule.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.jackson2;\n\nimport java.util.List;\nimport org.wiremock.stringparser.jackson2.ParsedStringModule;\nimport org.wiremock.url.AbsoluteUriParser;\nimport org.wiremock.url.AbsoluteUrlParser;\nimport org.wiremock.url.AuthorityParser;\nimport org.wiremock.url.BaseUrlParser;\nimport org.wiremock.url.FragmentParser;\nimport org.wiremock.url.HostAndPortParser;\nimport org.wiremock.url.HostParser;\nimport org.wiremock.url.OpaqueUriParser;\nimport org.wiremock.url.OriginParser;\nimport org.wiremock.url.PasswordParser;\nimport org.wiremock.url.PathAndQueryParser;\nimport org.wiremock.url.PathParser;\nimport org.wiremock.url.PortParser;\nimport org.wiremock.url.QueryParamKeyParser;\nimport org.wiremock.url.QueryParamValueParser;\nimport org.wiremock.url.QueryParser;\nimport org.wiremock.url.RelativeUrlParser;\nimport org.wiremock.url.SchemeRegistry;\nimport org.wiremock.url.SchemeRelativeUrlParser;\nimport org.wiremock.url.SegmentParser;\nimport org.wiremock.url.ServersideAbsoluteUrlParser;\nimport org.wiremock.url.UriParser;\nimport org.wiremock.url.UrlParser;\nimport org.wiremock.url.UrlWithAuthorityParser;\nimport org.wiremock.url.UserInfoParser;\nimport org.wiremock.url.UsernameParser;\n\npublic class WireMockUrlModule extends ParsedStringModule {\n\n  public WireMockUrlModule() {\n    this(UriParser.INSTANCE);\n  }\n\n  public WireMockUrlModule(SchemeRegistry schemeRegistry) {\n    this(new UriParser(schemeRegistry));\n  }\n\n  public WireMockUrlModule(UriParser uriParser) {\n    super(\n        List.of(\n            new AbsoluteUriParser(uriParser),\n            new AbsoluteUrlParser(uriParser),\n            new OpaqueUriParser(uriParser),\n            new OriginParser(uriParser),\n            new RelativeUrlParser(uriParser),\n            new SchemeRelativeUrlParser(uriParser),\n            new ServersideAbsoluteUrlParser(uriParser),\n            new UrlParser(uriParser),\n            new UrlWithAuthorityParser(uriParser),\n            new BaseUrlParser(uriParser),\n            PathAndQueryParser.INSTANCE,\n            AuthorityParser.INSTANCE,\n            FragmentParser.INSTANCE,\n            HostParser.INSTANCE,\n            HostAndPortParser.INSTANCE,\n            PasswordParser.INSTANCE,\n            PathParser.INSTANCE,\n            PortParser.INSTANCE,\n            QueryParser.INSTANCE,\n            QueryParamKeyParser.INSTANCE,\n            QueryParamValueParser.INSTANCE,\n            SchemeRegistry.INSTANCE,\n            SegmentParser.INSTANCE,\n            UriParser.INSTANCE,\n            UserInfoParser.INSTANCE,\n            UsernameParser.INSTANCE));\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson2/src/main/java/org/wiremock/url/jackson2/package-info.java",
    "content": "@NullMarked\npackage org.wiremock.url.jackson2;\n\nimport org.jspecify.annotations.NullMarked;\n"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson2/src/test/java/org/wiremock/url/jackson2/WireMockUrlModuleRegistrationTest.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.jackson2;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport io.github.classgraph.ClassGraph;\nimport io.github.classgraph.ClassInfo;\nimport io.github.classgraph.ScanResult;\nimport java.lang.reflect.Modifier;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.stream.Collectors;\nimport org.junit.jupiter.api.Test;\nimport org.wiremock.stringparser.ParsedString;\nimport org.wiremock.stringparser.StringParser;\nimport org.wiremock.stringparser.jackson2.ParsedStringModule;\nimport org.wiremock.url.PercentEncoded;\n\nclass WireMockUrlModuleRegistrationTest {\n\n  @Test\n  void allPublicParsedStringSubtypesAreRegistered() {\n    Set<Class<?>> parsedStringSubtypes = findPublicParsedStringSubtypes();\n    Set<Class<?>> registeredTypes = getRegisteredTypes(new WireMockUrlModule());\n\n    assertThat(registeredTypes)\n        .as(\"All public ParsedString subtypes in org.wiremock.url should be registered\")\n        .containsExactlyInAnyOrderElementsOf(parsedStringSubtypes);\n  }\n\n  private Set<Class<?>> findPublicParsedStringSubtypes() {\n    try (ScanResult scanResult =\n        new ClassGraph().enableClassInfo().acceptPackages(\"org.wiremock.url\").scan()) {\n\n      return scanResult.getClassesImplementing(ParsedString.class).stream()\n          .filter(classInfo -> Modifier.isPublic(classInfo.getModifiers()))\n          .filter(ClassInfo::isInterface)\n          .filter(classInfo -> !classInfo.getName().equals(ParsedString.class.getName()))\n          .filter(classInfo -> !classInfo.getName().equals(PercentEncoded.class.getName()))\n          .map(ClassInfo::loadClass)\n          .collect(Collectors.toSet());\n    }\n  }\n\n  private Set<Class<?>> getRegisteredTypes(ParsedStringModule module) {\n    List<StringParser<?>> deserializers = module.getStringParsers();\n\n    return deserializers.stream().map(StringParser::getType).collect(Collectors.toSet());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson2/src/test/java/org/wiremock/url/jackson2/WireMockUrlModuleSerializationTest.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.jackson2;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatThrownBy;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fasterxml.jackson.databind.JsonMappingException;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport java.io.IOException;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Nested;\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 org.wiremock.url.AbsoluteUri;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.Authority;\nimport org.wiremock.url.Fragment;\nimport org.wiremock.url.Host;\nimport org.wiremock.url.HostAndPort;\nimport org.wiremock.url.OpaqueUri;\nimport org.wiremock.url.Origin;\nimport org.wiremock.url.Password;\nimport org.wiremock.url.Path;\nimport org.wiremock.url.PathAndQuery;\nimport org.wiremock.url.Port;\nimport org.wiremock.url.Query;\nimport org.wiremock.url.QueryParamKey;\nimport org.wiremock.url.QueryParamValue;\nimport org.wiremock.url.RelativeUrl;\nimport org.wiremock.url.Scheme;\nimport org.wiremock.url.SchemeRelativeUrl;\nimport org.wiremock.url.Segment;\nimport org.wiremock.url.ServersideAbsoluteUrl;\nimport org.wiremock.url.Uri;\nimport org.wiremock.url.Url;\nimport org.wiremock.url.UrlWithAuthority;\nimport org.wiremock.url.UserInfo;\nimport org.wiremock.url.Username;\n\n@SuppressWarnings(\"VulnerableCodeUsages\")\nclass WireMockUrlModuleSerializationTest {\n\n  private ObjectMapper objectMapper;\n\n  @BeforeEach\n  void setUp() {\n    objectMapper = new ObjectMapper();\n    objectMapper.registerModule(new WireMockUrlModule());\n  }\n\n  @Nested\n  class Deserialization {\n\n    @Test\n    void deserializesAbsoluteUri() throws IOException {\n      String json = \"\\\"https://example.com/path?query=value#fragment\\\"\";\n      AbsoluteUri result = objectMapper.readValue(json, AbsoluteUri.class);\n      assertThat(result.toString()).isEqualTo(\"https://example.com/path?query=value#fragment\");\n    }\n\n    @Test\n    void deserializesAbsoluteUrl() throws IOException {\n      String json = \"\\\"https://user:pass@example.com:8080/path\\\"\";\n      AbsoluteUrl result = objectMapper.readValue(json, AbsoluteUrl.class);\n      assertThat(result.toString()).isEqualTo(\"https://user:pass@example.com:8080/path\");\n      assertThat(result.getScheme().toString()).isEqualTo(\"https\");\n    }\n\n    @Test\n    void deserializesAuthority() throws IOException {\n      String json = \"\\\"user:pass@example.com:8080\\\"\";\n      Authority result = objectMapper.readValue(json, Authority.class);\n      assertThat(result.toString()).isEqualTo(\"user:pass@example.com:8080\");\n      assertThat(result.getHost().toString()).isEqualTo(\"example.com\");\n    }\n\n    @Test\n    void deserializesFragment() throws IOException {\n      String json = \"\\\"section-1\\\"\";\n      Fragment result = objectMapper.readValue(json, Fragment.class);\n      assertThat(result.toString()).isEqualTo(\"section-1\");\n    }\n\n    @Test\n    void deserializesHost() throws IOException {\n      String json = \"\\\"example.com\\\"\";\n      Host result = objectMapper.readValue(json, Host.class);\n      assertThat(result.toString()).isEqualTo(\"example.com\");\n    }\n\n    @Test\n    void deserializesHostWithIPv6() throws IOException {\n      String json = \"\\\"[::1]\\\"\";\n      Host result = objectMapper.readValue(json, Host.class);\n      assertThat(result.toString()).isEqualTo(\"[::1]\");\n    }\n\n    @Test\n    void deserializesHostAndPort() throws IOException {\n      String json = \"\\\"example.com:8080\\\"\";\n      HostAndPort result = objectMapper.readValue(json, HostAndPort.class);\n      assertThat(result.toString()).isEqualTo(\"example.com:8080\");\n      assertThat(result.getHost().toString()).isEqualTo(\"example.com\");\n    }\n\n    @Test\n    void deserializesOpaqueUri() throws IOException {\n      String json = \"\\\"mailto:user@example.com\\\"\";\n      OpaqueUri result = objectMapper.readValue(json, OpaqueUri.class);\n      assertThat(result.toString()).isEqualTo(\"mailto:user@example.com\");\n    }\n\n    @Test\n    void deserializesOrigin() throws IOException {\n      String json = \"\\\"https://example.com:8080\\\"\";\n      Origin result = objectMapper.readValue(json, Origin.class);\n      assertThat(result.toString()).isEqualTo(\"https://example.com:8080\");\n    }\n\n    @Test\n    void deserializesPassword() throws IOException {\n      String json = \"\\\"secret123\\\"\";\n      Password result = objectMapper.readValue(json, Password.class);\n      assertThat(result.toString()).isEqualTo(\"secret123\");\n    }\n\n    @Test\n    void deserializesPath() throws IOException {\n      String json = \"\\\"/api/v1/users\\\"\";\n      Path result = objectMapper.readValue(json, Path.class);\n      assertThat(result.toString()).isEqualTo(\"/api/v1/users\");\n    }\n\n    @Test\n    void deserializesPathAndQuery() throws IOException {\n      String json = \"\\\"/path?key=value\\\"\";\n      PathAndQuery result = objectMapper.readValue(json, PathAndQuery.class);\n      assertThat(result.toString()).isEqualTo(\"/path?key=value\");\n    }\n\n    @Test\n    void deserializesPort() throws IOException {\n      String json = \"\\\"8080\\\"\";\n      Port result = objectMapper.readValue(json, Port.class);\n      assertThat(result.toString()).isEqualTo(\"8080\");\n      assertThat(result.getIntValue()).isEqualTo(8080);\n    }\n\n    @Test\n    void deserializesQuery() throws IOException {\n      String json = \"\\\"key1=value1&key2=value2\\\"\";\n      Query result = objectMapper.readValue(json, Query.class);\n      assertThat(result.toString()).isEqualTo(\"key1=value1&key2=value2\");\n    }\n\n    @Test\n    void deserializesQueryParamKey() throws IOException {\n      String json = \"\\\"paramName\\\"\";\n      QueryParamKey result = objectMapper.readValue(json, QueryParamKey.class);\n      assertThat(result.toString()).isEqualTo(\"paramName\");\n    }\n\n    @Test\n    void deserializesQueryParamValue() throws IOException {\n      String json = \"\\\"paramValue\\\"\";\n      QueryParamValue result = objectMapper.readValue(json, QueryParamValue.class);\n      assertThat(result.toString()).isEqualTo(\"paramValue\");\n    }\n\n    @Test\n    void deserializesRelativeUrl() throws IOException {\n      String json = \"\\\"/path/to/resource?query=value\\\"\";\n      RelativeUrl result = objectMapper.readValue(json, RelativeUrl.class);\n      assertThat(result.toString()).isEqualTo(\"/path/to/resource?query=value\");\n    }\n\n    @Test\n    void deserializesScheme() throws IOException {\n      String json = \"\\\"https\\\"\";\n      Scheme result = objectMapper.readValue(json, Scheme.class);\n      assertThat(result.toString()).isEqualTo(\"https\");\n    }\n\n    @Test\n    void deserializesSchemeRelativeUrl() throws IOException {\n      String json = \"\\\"//example.com/path\\\"\";\n      SchemeRelativeUrl result = objectMapper.readValue(json, SchemeRelativeUrl.class);\n      assertThat(result.toString()).isEqualTo(\"//example.com/path\");\n    }\n\n    @Test\n    void deserializesSegment() throws IOException {\n      String json = \"\\\"path-segment\\\"\";\n      Segment result = objectMapper.readValue(json, Segment.class);\n      assertThat(result.toString()).isEqualTo(\"path-segment\");\n    }\n\n    @Test\n    void deserializesServersideAbsoluteUrl() throws IOException {\n      String json = \"\\\"http://localhost:8080/api\\\"\";\n      ServersideAbsoluteUrl result = objectMapper.readValue(json, ServersideAbsoluteUrl.class);\n      assertThat(result.toString()).isEqualTo(\"http://localhost:8080/api\");\n    }\n\n    @Test\n    void deserializesUri() throws IOException {\n      String json = \"\\\"https://example.com/path\\\"\";\n      Uri result = objectMapper.readValue(json, Uri.class);\n      assertThat(result.toString()).isEqualTo(\"https://example.com/path\");\n    }\n\n    @Test\n    void deserializesUrl() throws IOException {\n      String json = \"\\\"/path/to/resource\\\"\";\n      Url result = objectMapper.readValue(json, Url.class);\n      assertThat(result.toString()).isEqualTo(\"/path/to/resource\");\n    }\n\n    @Test\n    void deserializesUrlWithAuthority() throws IOException {\n      String json = \"\\\"//example.com/path\\\"\";\n      UrlWithAuthority result = objectMapper.readValue(json, UrlWithAuthority.class);\n      assertThat(result.toString()).isEqualTo(\"//example.com/path\");\n      assertThat(result.getAuthority().getHost().toString()).isEqualTo(\"example.com\");\n    }\n\n    @Test\n    void deserializesUserInfo() throws IOException {\n      String json = \"\\\"user:password\\\"\";\n      UserInfo result = objectMapper.readValue(json, UserInfo.class);\n      assertThat(result.toString()).isEqualTo(\"user:password\");\n    }\n\n    @Test\n    void deserializesUsername() throws IOException {\n      String json = \"\\\"johndoe\\\"\";\n      Username result = objectMapper.readValue(json, Username.class);\n      assertThat(result.toString()).isEqualTo(\"johndoe\");\n    }\n\n    @Test\n    void deserializesNullAsNull() throws IOException {\n      String json = \"null\";\n      Host result = objectMapper.readValue(json, Host.class);\n      assertThat(result).isNull();\n    }\n  }\n\n  @Nested\n  class Serialization {\n\n    @Test\n    void serializesHost() throws JsonProcessingException {\n      Host host = Host.parse(\"example.com\");\n      String json = objectMapper.writeValueAsString(host);\n      assertThat(json).isEqualTo(\"\\\"example.com\\\"\");\n    }\n\n    @Test\n    void serializesAbsoluteUrl() throws JsonProcessingException {\n      AbsoluteUrl url = AbsoluteUrl.parse(\"https://example.com/path\");\n      String json = objectMapper.writeValueAsString(url);\n      assertThat(json).isEqualTo(\"\\\"https://example.com/path\\\"\");\n    }\n\n    @Test\n    void serializesAuthority() throws JsonProcessingException {\n      Authority authority = Authority.parse(\"user@example.com:8080\");\n      String json = objectMapper.writeValueAsString(authority);\n      assertThat(json).isEqualTo(\"\\\"user@example.com:8080\\\"\");\n    }\n\n    @Test\n    void serializesPath() throws JsonProcessingException {\n      Path path = Path.parse(\"/api/v1/users\");\n      String json = objectMapper.writeValueAsString(path);\n      assertThat(json).isEqualTo(\"\\\"/api/v1/users\\\"\");\n    }\n\n    @Test\n    void serializesQuery() throws JsonProcessingException {\n      Query query = Query.parse(\"key=value&foo=bar\");\n      String json = objectMapper.writeValueAsString(query);\n      assertThat(json).isEqualTo(\"\\\"key=value&foo=bar\\\"\");\n    }\n\n    @Test\n    void serializesPort() throws JsonProcessingException {\n      Port port = Port.parse(\"443\");\n      String json = objectMapper.writeValueAsString(port);\n      assertThat(json).isEqualTo(\"\\\"443\\\"\");\n    }\n\n    @Test\n    void serializesScheme() throws JsonProcessingException {\n      Scheme scheme = Scheme.parse(\"https\");\n      String json = objectMapper.writeValueAsString(scheme);\n      assertThat(json).isEqualTo(\"\\\"https\\\"\");\n    }\n  }\n\n  @Nested\n  class RoundTrip {\n\n    @SuppressWarnings(\"JsonStandardCompliance\")\n    static Stream<Arguments> roundTripTestCases() {\n      return Stream.of(\n          Arguments.of(AbsoluteUri.class, \"https://example.com/path?q=1#frag\"),\n          Arguments.of(AbsoluteUrl.class, \"https://user:pass@example.com:8080/path\"),\n          Arguments.of(Authority.class, \"user:pass@example.com:8080\"),\n          Arguments.of(Fragment.class, \"section-1\"),\n          Arguments.of(Host.class, \"example.com\"),\n          Arguments.of(Host.class, \"[::1]\"),\n          Arguments.of(HostAndPort.class, \"example.com:443\"),\n          Arguments.of(OpaqueUri.class, \"mailto:test@example.com\"),\n          Arguments.of(Origin.class, \"https://example.com\"),\n          Arguments.of(Password.class, \"secret%20pass\"),\n          Arguments.of(Path.class, \"/api/v1/users\"),\n          Arguments.of(Path.class, \"/path%20with%20spaces\"),\n          Arguments.of(PathAndQuery.class, \"/path?key=value\"),\n          Arguments.of(Port.class, \"8080\"),\n          Arguments.of(Query.class, \"a=1&b=2&c=3\"),\n          Arguments.of(QueryParamKey.class, \"param-name\"),\n          Arguments.of(QueryParamValue.class, \"param-value\"),\n          Arguments.of(RelativeUrl.class, \"/relative/path?q=test\"),\n          Arguments.of(Scheme.class, \"https\"),\n          Arguments.of(Scheme.class, \"custom-scheme\"),\n          Arguments.of(SchemeRelativeUrl.class, \"//example.com/path\"),\n          Arguments.of(Segment.class, \"path-segment\"),\n          Arguments.of(ServersideAbsoluteUrl.class, \"http://localhost:8080/api\"),\n          Arguments.of(Uri.class, \"https://example.com/path\"),\n          Arguments.of(Url.class, \"/some/path\"),\n          Arguments.of(UrlWithAuthority.class, \"https://example.com/path\"),\n          Arguments.of(UserInfo.class, \"user:password\"),\n          Arguments.of(Username.class, \"john-doe\"));\n    }\n\n    @ParameterizedTest\n    @MethodSource(\"roundTripTestCases\")\n    void roundTripPreservesValue(Class<?> type, String value) throws IOException {\n      String json = \"\\\"\" + value + \"\\\"\";\n\n      // Deserialize\n      Object deserialized = objectMapper.readValue(json, type);\n      assertThat(deserialized.toString()).isEqualTo(value);\n\n      // Serialize back\n      String serialized = objectMapper.writeValueAsString(deserialized);\n      assertThat(serialized).isEqualTo(json);\n\n      // Deserialize again\n      Object deserializedAgain = objectMapper.readValue(serialized, type);\n      assertThat(deserializedAgain.toString()).isEqualTo(value);\n    }\n  }\n\n  @Nested\n  class PercentEncoding {\n\n    @Test\n    void preservesPercentEncodingInPath() throws IOException {\n      String json = \"\\\"/path%20with%20spaces\\\"\";\n      Path result = objectMapper.readValue(json, Path.class);\n      assertThat(result.toString()).isEqualTo(\"/path%20with%20spaces\");\n      assertThat(result.decode()).isEqualTo(\"/path with spaces\");\n    }\n\n    @Test\n    void preservesPercentEncodingInQuery() throws IOException {\n      String json = \"\\\"key%3Dname=value%26more\\\"\";\n      Query result = objectMapper.readValue(json, Query.class);\n      assertThat(result.toString()).isEqualTo(\"key%3Dname=value%26more\");\n    }\n\n    @Test\n    void preservesPercentEncodingInHost() throws IOException {\n      String json = \"\\\"xn--n3h.com\\\"\";\n      Host result = objectMapper.readValue(json, Host.class);\n      assertThat(result.toString()).isEqualTo(\"xn--n3h.com\");\n    }\n  }\n\n  @SuppressWarnings(\"VulnerableCodeUsages\")\n  @Nested\n  class ErrorHandling {\n\n    @Test\n    void throwsOnInvalidPort() {\n      String json = \"\\\"not-a-number\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, Port.class))\n          .isInstanceOf(JsonMappingException.class);\n    }\n\n    @Test\n    void throwsOnInvalidScheme() {\n      String json = \"\\\"123invalid\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, Scheme.class))\n          .isInstanceOf(JsonMappingException.class);\n    }\n\n    @Test\n    void throwsOnInvalidAbsoluteUrl() {\n      String json = \"\\\"/relative/path\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, AbsoluteUrl.class))\n          .isInstanceOf(JsonMappingException.class);\n    }\n\n    @Test\n    void throwsOnInvalidRelativeUrl() {\n      String json = \"\\\"https://example.com/absolute\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, RelativeUrl.class))\n          .isInstanceOf(JsonMappingException.class);\n    }\n\n    @Test\n    void throwsOnInvalidOpaqueUri() {\n      String json = \"\\\"https://example.com/not-opaque\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, OpaqueUri.class))\n          .isInstanceOf(JsonMappingException.class);\n    }\n  }\n\n  @Nested\n  class ObjectFieldDeserialization {\n\n    @Test\n    void deserializesObjectWithUrlField() throws IOException {\n      String json = \"{\\\"url\\\": \\\"https://example.com/api\\\"}\";\n      TestRecord result = objectMapper.readValue(json, TestRecord.class);\n      assertThat(result.url.toString()).isEqualTo(\"https://example.com/api\");\n    }\n\n    @Test\n    void serializesObjectWithUrlField() throws JsonProcessingException {\n      TestRecord record = new TestRecord(AbsoluteUrl.parse(\"https://example.com/api\"));\n      String json = objectMapper.writeValueAsString(record);\n      assertThat(json).isEqualTo(\"{\\\"url\\\":\\\"https://example.com/api\\\"}\");\n    }\n\n    static final class TestRecord {\n\n      private final AbsoluteUrl url;\n\n      TestRecord(@JsonProperty(\"url\") AbsoluteUrl url) {\n        this.url = url;\n      }\n\n      @SuppressWarnings(\"unused\")\n      public AbsoluteUrl getUrl() {\n        return url;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson3/build.gradle.kts",
    "content": "import net.ltgt.gradle.errorprone.CheckSeverity\nimport net.ltgt.gradle.errorprone.errorprone\n\nplugins {\n  id(\"wiremock.common-conventions\")\n  id(\"net.ltgt.errorprone\") version \"5.1.0\"\n}\n\ntasks.jar {\n  archiveBaseName.set(\"wiremock-url-jackson3\")\n}\n\ndependencies {\n  api(project(\":wiremock-url:wiremock-url\"))\n  api(project(\":wiremock-url:wiremock-string-parser-jackson3\"))\n\n  implementation(project(\":wiremock-url:wiremock-string-parser\"))\n\n  compileOnly(\"org.jspecify:jspecify:1.0.0\")\n\n  testImplementation(\"tools.jackson.core:jackson-databind:3.0.0\")\n  testImplementation(platform(\"org.junit:junit-bom:6.0.1\"))\n  testImplementation(libs.junit.jupiter.api)\n  testImplementation(libs.junit.jupiter.params)\n  testImplementation(libs.assertj.core)\n\n  testImplementation(\"io.github.classgraph:classgraph:4.8.184\")\n\n  testRuntimeOnly(libs.junit.jupiter)\n  testRuntimeOnly(libs.junit.platform.launcher)\n\n  annotationProcessor(\"com.uber.nullaway:nullaway:0.13.1\")\n  errorprone(\"com.google.errorprone:error_prone_core:2.42.0\")\n}\n\ntasks.compileJava {\n  options.errorprone {\n    check(\"NullAway\", CheckSeverity.ERROR)\n    check(\"NullableOptional\", CheckSeverity.OFF)\n    check(\"ClassInitializationDeadlock\", CheckSeverity.OFF)\n    option(\"NullAway:AnnotatedPackages\", \"org.wiremock.url\")\n  }\n}\n\ntasks.compileTestJava {\n  options.errorprone {\n    disableAllChecks = true\n  }\n}\n\npublishing {\n  publications {\n    create<MavenPublication>(\"mavenJava\") {\n      artifactId = tasks.jar.get().archiveBaseName.get()\n      from(components[\"java\"])\n\n      pom {\n        name = \"WireMock URL Jackson 3\"\n        description = \"Jackson 3 module for WireMock URL\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson3/src/main/java/org/wiremock/url/jackson3/WireMockUrlModule.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.jackson3;\n\nimport java.util.List;\nimport org.wiremock.stringparser.jackson3.ParsedStringModule;\nimport org.wiremock.url.AbsoluteUriParser;\nimport org.wiremock.url.AbsoluteUrlParser;\nimport org.wiremock.url.AuthorityParser;\nimport org.wiremock.url.BaseUrlParser;\nimport org.wiremock.url.FragmentParser;\nimport org.wiremock.url.HostAndPortParser;\nimport org.wiremock.url.HostParser;\nimport org.wiremock.url.OpaqueUriParser;\nimport org.wiremock.url.OriginParser;\nimport org.wiremock.url.PasswordParser;\nimport org.wiremock.url.PathAndQueryParser;\nimport org.wiremock.url.PathParser;\nimport org.wiremock.url.PortParser;\nimport org.wiremock.url.QueryParamKeyParser;\nimport org.wiremock.url.QueryParamValueParser;\nimport org.wiremock.url.QueryParser;\nimport org.wiremock.url.RelativeUrlParser;\nimport org.wiremock.url.SchemeRegistry;\nimport org.wiremock.url.SchemeRelativeUrlParser;\nimport org.wiremock.url.SegmentParser;\nimport org.wiremock.url.ServersideAbsoluteUrlParser;\nimport org.wiremock.url.UriParser;\nimport org.wiremock.url.UrlParser;\nimport org.wiremock.url.UrlWithAuthorityParser;\nimport org.wiremock.url.UserInfoParser;\nimport org.wiremock.url.UsernameParser;\n\npublic class WireMockUrlModule extends ParsedStringModule {\n\n  public WireMockUrlModule() {\n    this(UriParser.INSTANCE);\n  }\n\n  public WireMockUrlModule(SchemeRegistry schemeRegistry) {\n    this(new UriParser(schemeRegistry));\n  }\n\n  public WireMockUrlModule(UriParser uriParser) {\n    super(\n        List.of(\n            new AbsoluteUriParser(uriParser),\n            new AbsoluteUrlParser(uriParser),\n            new OpaqueUriParser(uriParser),\n            new OriginParser(uriParser),\n            new RelativeUrlParser(uriParser),\n            new SchemeRelativeUrlParser(uriParser),\n            new ServersideAbsoluteUrlParser(uriParser),\n            new UrlParser(uriParser),\n            new UrlWithAuthorityParser(uriParser),\n            new BaseUrlParser(uriParser),\n            PathAndQueryParser.INSTANCE,\n            AuthorityParser.INSTANCE,\n            FragmentParser.INSTANCE,\n            HostParser.INSTANCE,\n            HostAndPortParser.INSTANCE,\n            PasswordParser.INSTANCE,\n            PathParser.INSTANCE,\n            PortParser.INSTANCE,\n            QueryParser.INSTANCE,\n            QueryParamKeyParser.INSTANCE,\n            QueryParamValueParser.INSTANCE,\n            SchemeRegistry.INSTANCE,\n            SegmentParser.INSTANCE,\n            UriParser.INSTANCE,\n            UserInfoParser.INSTANCE,\n            UsernameParser.INSTANCE));\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson3/src/main/java/org/wiremock/url/jackson3/package-info.java",
    "content": "@NullMarked\npackage org.wiremock.url.jackson3;\n\nimport org.jspecify.annotations.NullMarked;\n"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson3/src/test/java/org/wiremock/url/jackson3/WireMockUrlModuleRegistrationTest.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.jackson3;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nimport io.github.classgraph.ClassGraph;\nimport io.github.classgraph.ClassInfo;\nimport io.github.classgraph.ScanResult;\nimport java.lang.reflect.Modifier;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.stream.Collectors;\nimport org.junit.jupiter.api.Test;\nimport org.wiremock.stringparser.ParsedString;\nimport org.wiremock.stringparser.StringParser;\nimport org.wiremock.stringparser.jackson3.ParsedStringModule;\nimport org.wiremock.url.PercentEncoded;\n\nclass WireMockUrlModuleRegistrationTest {\n\n  @Test\n  void allPublicParsedStringSubtypesAreRegistered() {\n    Set<Class<?>> parsedStringSubtypes = findPublicParsedStringSubtypes();\n    Set<Class<?>> registeredTypes = getRegisteredTypes(new WireMockUrlModule());\n\n    assertThat(registeredTypes)\n        .as(\"All public ParsedString subtypes in org.wiremock.url should be registered\")\n        .containsExactlyInAnyOrderElementsOf(parsedStringSubtypes);\n  }\n\n  private Set<Class<?>> findPublicParsedStringSubtypes() {\n    try (ScanResult scanResult =\n        new ClassGraph().enableClassInfo().acceptPackages(\"org.wiremock.url\").scan()) {\n\n      return scanResult.getClassesImplementing(ParsedString.class).stream()\n          .filter(classInfo -> Modifier.isPublic(classInfo.getModifiers()))\n          .filter(ClassInfo::isInterface)\n          .filter(classInfo -> !classInfo.getName().equals(ParsedString.class.getName()))\n          .filter(classInfo -> !classInfo.getName().equals(PercentEncoded.class.getName()))\n          .map(ClassInfo::loadClass)\n          .collect(Collectors.toSet());\n    }\n  }\n\n  private Set<Class<?>> getRegisteredTypes(ParsedStringModule module) {\n    List<StringParser<?>> deserializers = module.getStringParsers();\n\n    return deserializers.stream().map(StringParser::getType).collect(Collectors.toSet());\n  }\n}\n"
  },
  {
    "path": "wiremock-url/wiremock-url-jackson3/src/test/java/org/wiremock/url/jackson3/WireMockUrlModuleSerializationTest.java",
    "content": "/*\n * Copyright (C) 2026 Thomas Akehurst\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 */\npackage org.wiremock.url.jackson3;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.assertj.core.api.Assertions.assertThatThrownBy;\n\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Nested;\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 org.wiremock.url.AbsoluteUri;\nimport org.wiremock.url.AbsoluteUrl;\nimport org.wiremock.url.Authority;\nimport org.wiremock.url.Fragment;\nimport org.wiremock.url.Host;\nimport org.wiremock.url.HostAndPort;\nimport org.wiremock.url.OpaqueUri;\nimport org.wiremock.url.Origin;\nimport org.wiremock.url.Password;\nimport org.wiremock.url.Path;\nimport org.wiremock.url.PathAndQuery;\nimport org.wiremock.url.Port;\nimport org.wiremock.url.Query;\nimport org.wiremock.url.QueryParamKey;\nimport org.wiremock.url.QueryParamValue;\nimport org.wiremock.url.RelativeUrl;\nimport org.wiremock.url.Scheme;\nimport org.wiremock.url.SchemeRelativeUrl;\nimport org.wiremock.url.Segment;\nimport org.wiremock.url.ServersideAbsoluteUrl;\nimport org.wiremock.url.Uri;\nimport org.wiremock.url.Url;\nimport org.wiremock.url.UrlWithAuthority;\nimport org.wiremock.url.UserInfo;\nimport org.wiremock.url.Username;\nimport tools.jackson.databind.ObjectMapper;\nimport tools.jackson.databind.exc.InvalidFormatException;\nimport tools.jackson.databind.json.JsonMapper;\n\nclass WireMockUrlModuleSerializationTest {\n\n  private ObjectMapper objectMapper;\n\n  @BeforeEach\n  void setUp() {\n    objectMapper = JsonMapper.builder().addModule(new WireMockUrlModule()).build();\n  }\n\n  @Nested\n  class Deserialization {\n\n    @Test\n    void deserializesAbsoluteUri() {\n      String json = \"\\\"https://example.com/path?query=value#fragment\\\"\";\n      AbsoluteUri result = objectMapper.readValue(json, AbsoluteUri.class);\n      assertThat(result.toString()).isEqualTo(\"https://example.com/path?query=value#fragment\");\n    }\n\n    @Test\n    void deserializesAbsoluteUrl() {\n      String json = \"\\\"https://user:pass@example.com:8080/path\\\"\";\n      AbsoluteUrl result = objectMapper.readValue(json, AbsoluteUrl.class);\n      assertThat(result.toString()).isEqualTo(\"https://user:pass@example.com:8080/path\");\n      assertThat(result.getScheme().toString()).isEqualTo(\"https\");\n    }\n\n    @Test\n    void deserializesAuthority() {\n      String json = \"\\\"user:pass@example.com:8080\\\"\";\n      Authority result = objectMapper.readValue(json, Authority.class);\n      assertThat(result.toString()).isEqualTo(\"user:pass@example.com:8080\");\n      assertThat(result.getHost().toString()).isEqualTo(\"example.com\");\n    }\n\n    @Test\n    void deserializesFragment() {\n      String json = \"\\\"section-1\\\"\";\n      Fragment result = objectMapper.readValue(json, Fragment.class);\n      assertThat(result.toString()).isEqualTo(\"section-1\");\n    }\n\n    @Test\n    void deserializesHost() {\n      String json = \"\\\"example.com\\\"\";\n      Host result = objectMapper.readValue(json, Host.class);\n      assertThat(result.toString()).isEqualTo(\"example.com\");\n    }\n\n    @Test\n    void deserializesHostWithIPv6() {\n      String json = \"\\\"[::1]\\\"\";\n      Host result = objectMapper.readValue(json, Host.class);\n      assertThat(result.toString()).isEqualTo(\"[::1]\");\n    }\n\n    @Test\n    void deserializesHostAndPort() {\n      String json = \"\\\"example.com:8080\\\"\";\n      HostAndPort result = objectMapper.readValue(json, HostAndPort.class);\n      assertThat(result.toString()).isEqualTo(\"example.com:8080\");\n      assertThat(result.getHost().toString()).isEqualTo(\"example.com\");\n    }\n\n    @Test\n    void deserializesOpaqueUri() {\n      String json = \"\\\"mailto:user@example.com\\\"\";\n      OpaqueUri result = objectMapper.readValue(json, OpaqueUri.class);\n      assertThat(result.toString()).isEqualTo(\"mailto:user@example.com\");\n    }\n\n    @Test\n    void deserializesOrigin() {\n      String json = \"\\\"https://example.com:8080\\\"\";\n      Origin result = objectMapper.readValue(json, Origin.class);\n      assertThat(result.toString()).isEqualTo(\"https://example.com:8080\");\n    }\n\n    @Test\n    void deserializesPassword() {\n      String json = \"\\\"secret123\\\"\";\n      Password result = objectMapper.readValue(json, Password.class);\n      assertThat(result.toString()).isEqualTo(\"secret123\");\n    }\n\n    @Test\n    void deserializesPath() {\n      String json = \"\\\"/api/v1/users\\\"\";\n      Path result = objectMapper.readValue(json, Path.class);\n      assertThat(result.toString()).isEqualTo(\"/api/v1/users\");\n    }\n\n    @Test\n    void deserializesPathAndQuery() {\n      String json = \"\\\"/path?key=value\\\"\";\n      PathAndQuery result = objectMapper.readValue(json, PathAndQuery.class);\n      assertThat(result.toString()).isEqualTo(\"/path?key=value\");\n    }\n\n    @Test\n    void deserializesPort() {\n      String json = \"\\\"8080\\\"\";\n      Port result = objectMapper.readValue(json, Port.class);\n      assertThat(result.toString()).isEqualTo(\"8080\");\n      assertThat(result.getIntValue()).isEqualTo(8080);\n    }\n\n    @Test\n    void deserializesQuery() {\n      String json = \"\\\"key1=value1&key2=value2\\\"\";\n      Query result = objectMapper.readValue(json, Query.class);\n      assertThat(result.toString()).isEqualTo(\"key1=value1&key2=value2\");\n    }\n\n    @Test\n    void deserializesQueryParamKey() {\n      String json = \"\\\"paramName\\\"\";\n      QueryParamKey result = objectMapper.readValue(json, QueryParamKey.class);\n      assertThat(result.toString()).isEqualTo(\"paramName\");\n    }\n\n    @Test\n    void deserializesQueryParamValue() {\n      String json = \"\\\"paramValue\\\"\";\n      QueryParamValue result = objectMapper.readValue(json, QueryParamValue.class);\n      assertThat(result.toString()).isEqualTo(\"paramValue\");\n    }\n\n    @Test\n    void deserializesRelativeUrl() {\n      String json = \"\\\"/path/to/resource?query=value\\\"\";\n      RelativeUrl result = objectMapper.readValue(json, RelativeUrl.class);\n      assertThat(result.toString()).isEqualTo(\"/path/to/resource?query=value\");\n    }\n\n    @Test\n    void deserializesScheme() {\n      String json = \"\\\"https\\\"\";\n      Scheme result = objectMapper.readValue(json, Scheme.class);\n      assertThat(result.toString()).isEqualTo(\"https\");\n    }\n\n    @Test\n    void deserializesSchemeRelativeUrl() {\n      String json = \"\\\"//example.com/path\\\"\";\n      SchemeRelativeUrl result = objectMapper.readValue(json, SchemeRelativeUrl.class);\n      assertThat(result.toString()).isEqualTo(\"//example.com/path\");\n    }\n\n    @Test\n    void deserializesSegment() {\n      String json = \"\\\"path-segment\\\"\";\n      Segment result = objectMapper.readValue(json, Segment.class);\n      assertThat(result.toString()).isEqualTo(\"path-segment\");\n    }\n\n    @Test\n    void deserializesServersideAbsoluteUrl() {\n      String json = \"\\\"http://localhost:8080/api\\\"\";\n      ServersideAbsoluteUrl result = objectMapper.readValue(json, ServersideAbsoluteUrl.class);\n      assertThat(result.toString()).isEqualTo(\"http://localhost:8080/api\");\n    }\n\n    @Test\n    void deserializesUri() {\n      String json = \"\\\"https://example.com/path\\\"\";\n      Uri result = objectMapper.readValue(json, Uri.class);\n      assertThat(result.toString()).isEqualTo(\"https://example.com/path\");\n    }\n\n    @Test\n    void deserializesUrl() {\n      String json = \"\\\"/path/to/resource\\\"\";\n      Url result = objectMapper.readValue(json, Url.class);\n      assertThat(result.toString()).isEqualTo(\"/path/to/resource\");\n    }\n\n    @Test\n    void deserializesUrlWithAuthority() {\n      String json = \"\\\"//example.com/path\\\"\";\n      UrlWithAuthority result = objectMapper.readValue(json, UrlWithAuthority.class);\n      assertThat(result.toString()).isEqualTo(\"//example.com/path\");\n      assertThat(result.getAuthority().getHost().toString()).isEqualTo(\"example.com\");\n    }\n\n    @Test\n    void deserializesUserInfo() {\n      String json = \"\\\"user:password\\\"\";\n      UserInfo result = objectMapper.readValue(json, UserInfo.class);\n      assertThat(result.toString()).isEqualTo(\"user:password\");\n    }\n\n    @Test\n    void deserializesUsername() {\n      String json = \"\\\"johndoe\\\"\";\n      Username result = objectMapper.readValue(json, Username.class);\n      assertThat(result.toString()).isEqualTo(\"johndoe\");\n    }\n\n    @Test\n    void deserializesNullAsNull() {\n      String json = \"null\";\n      Host result = objectMapper.readValue(json, Host.class);\n      assertThat(result).isNull();\n    }\n  }\n\n  @Nested\n  class Serialization {\n\n    @Test\n    void serializesHost() {\n      Host host = Host.parse(\"example.com\");\n      String json = objectMapper.writeValueAsString(host);\n      assertThat(json).isEqualTo(\"\\\"example.com\\\"\");\n    }\n\n    @Test\n    void serializesAbsoluteUrl() {\n      AbsoluteUrl url = AbsoluteUrl.parse(\"https://example.com/path\");\n      String json = objectMapper.writeValueAsString(url);\n      assertThat(json).isEqualTo(\"\\\"https://example.com/path\\\"\");\n    }\n\n    @Test\n    void serializesAuthority() {\n      Authority authority = Authority.parse(\"user@example.com:8080\");\n      String json = objectMapper.writeValueAsString(authority);\n      assertThat(json).isEqualTo(\"\\\"user@example.com:8080\\\"\");\n    }\n\n    @Test\n    void serializesPath() {\n      Path path = Path.parse(\"/api/v1/users\");\n      String json = objectMapper.writeValueAsString(path);\n      assertThat(json).isEqualTo(\"\\\"/api/v1/users\\\"\");\n    }\n\n    @Test\n    void serializesQuery() {\n      Query query = Query.parse(\"key=value&foo=bar\");\n      String json = objectMapper.writeValueAsString(query);\n      assertThat(json).isEqualTo(\"\\\"key=value&foo=bar\\\"\");\n    }\n\n    @Test\n    void serializesPort() {\n      Port port = Port.parse(\"443\");\n      String json = objectMapper.writeValueAsString(port);\n      assertThat(json).isEqualTo(\"\\\"443\\\"\");\n    }\n\n    @Test\n    void serializesScheme() {\n      Scheme scheme = Scheme.parse(\"https\");\n      String json = objectMapper.writeValueAsString(scheme);\n      assertThat(json).isEqualTo(\"\\\"https\\\"\");\n    }\n\n    @Test\n    void serializesNullAsNull() {\n      Host host = null;\n      String json = objectMapper.writeValueAsString(host);\n      assertThat(json).isEqualTo(\"null\");\n    }\n  }\n\n  @Nested\n  class RoundTrip {\n\n    static Stream<Arguments> roundTripTestCases() {\n      return Stream.of(\n          Arguments.of(AbsoluteUri.class, \"https://example.com/path?q=1#frag\"),\n          Arguments.of(AbsoluteUrl.class, \"https://user:pass@example.com:8080/path\"),\n          Arguments.of(Authority.class, \"user:pass@example.com:8080\"),\n          Arguments.of(Fragment.class, \"section-1\"),\n          Arguments.of(Host.class, \"example.com\"),\n          Arguments.of(Host.class, \"[::1]\"),\n          Arguments.of(HostAndPort.class, \"example.com:443\"),\n          Arguments.of(OpaqueUri.class, \"mailto:test@example.com\"),\n          Arguments.of(Origin.class, \"https://example.com\"),\n          Arguments.of(Password.class, \"secret%20pass\"),\n          Arguments.of(Path.class, \"/api/v1/users\"),\n          Arguments.of(Path.class, \"/path%20with%20spaces\"),\n          Arguments.of(PathAndQuery.class, \"/path?key=value\"),\n          Arguments.of(Port.class, \"8080\"),\n          Arguments.of(Query.class, \"a=1&b=2&c=3\"),\n          Arguments.of(QueryParamKey.class, \"param-name\"),\n          Arguments.of(QueryParamValue.class, \"param-value\"),\n          Arguments.of(RelativeUrl.class, \"/relative/path?q=test\"),\n          Arguments.of(Scheme.class, \"https\"),\n          Arguments.of(Scheme.class, \"custom-scheme\"),\n          Arguments.of(SchemeRelativeUrl.class, \"//example.com/path\"),\n          Arguments.of(Segment.class, \"path-segment\"),\n          Arguments.of(ServersideAbsoluteUrl.class, \"http://localhost:8080/api\"),\n          Arguments.of(Uri.class, \"https://example.com/path\"),\n          Arguments.of(Url.class, \"/some/path\"),\n          Arguments.of(UrlWithAuthority.class, \"https://example.com/path\"),\n          Arguments.of(UserInfo.class, \"user:password\"),\n          Arguments.of(Username.class, \"john-doe\"));\n    }\n\n    @ParameterizedTest\n    @MethodSource(\"roundTripTestCases\")\n    void roundTripPreservesValue(Class<?> type, String value) {\n      String json = \"\\\"\" + value + \"\\\"\";\n\n      // Deserialize\n      Object deserialized = objectMapper.readValue(json, type);\n      assertThat(deserialized.toString()).isEqualTo(value);\n\n      // Serialize back\n      String serialized = objectMapper.writeValueAsString(deserialized);\n      assertThat(serialized).isEqualTo(json);\n\n      // Deserialize again\n      Object deserializedAgain = objectMapper.readValue(serialized, type);\n      assertThat(deserializedAgain.toString()).isEqualTo(value);\n    }\n  }\n\n  @Nested\n  class PercentEncoding {\n\n    @Test\n    void preservesPercentEncodingInPath() {\n      String json = \"\\\"/path%20with%20spaces\\\"\";\n      Path result = objectMapper.readValue(json, Path.class);\n      assertThat(result.toString()).isEqualTo(\"/path%20with%20spaces\");\n      assertThat(result.decode()).isEqualTo(\"/path with spaces\");\n    }\n\n    @Test\n    void preservesPercentEncodingInQuery() {\n      String json = \"\\\"key%3Dname=value%26more\\\"\";\n      Query result = objectMapper.readValue(json, Query.class);\n      assertThat(result.toString()).isEqualTo(\"key%3Dname=value%26more\");\n    }\n\n    @Test\n    void preservesPercentEncodingInHost() {\n      String json = \"\\\"xn--n3h.com\\\"\";\n      Host result = objectMapper.readValue(json, Host.class);\n      assertThat(result.toString()).isEqualTo(\"xn--n3h.com\");\n    }\n  }\n\n  @Nested\n  class ErrorHandling {\n\n    @Test\n    void throwsOnInvalidPort() {\n      String json = \"\\\"not-a-number\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, Port.class))\n          .isInstanceOf(InvalidFormatException.class);\n    }\n\n    @Test\n    void throwsOnInvalidScheme() {\n      String json = \"\\\"123invalid\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, Scheme.class))\n          .isInstanceOf(InvalidFormatException.class);\n    }\n\n    @Test\n    void throwsOnInvalidAbsoluteUrl() {\n      String json = \"\\\"/relative/path\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, AbsoluteUrl.class))\n          .isInstanceOf(InvalidFormatException.class);\n    }\n\n    @Test\n    void throwsOnInvalidRelativeUrl() {\n      String json = \"\\\"https://example.com/absolute\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, RelativeUrl.class))\n          .isInstanceOf(InvalidFormatException.class);\n    }\n\n    @Test\n    void throwsOnInvalidOpaqueUri() {\n      String json = \"\\\"https://example.com/not-opaque\\\"\";\n      assertThatThrownBy(() -> objectMapper.readValue(json, OpaqueUri.class))\n          .isInstanceOf(InvalidFormatException.class);\n    }\n  }\n\n  @Nested\n  class ObjectFieldDeserialization {\n\n    @Test\n    void deserializesObjectWithUrlField() {\n      String json = \"{\\\"url\\\": \\\"https://example.com/api\\\"}\";\n      TestRecord result = objectMapper.readValue(json, TestRecord.class);\n      assertThat(result.url().toString()).isEqualTo(\"https://example.com/api\");\n    }\n\n    @Test\n    void serializesObjectWithUrlField() {\n      TestRecord record = new TestRecord(AbsoluteUrl.parse(\"https://example.com/api\"));\n      String json = objectMapper.writeValueAsString(record);\n      assertThat(json).isEqualTo(\"{\\\"url\\\":\\\"https://example.com/api\\\"}\");\n    }\n\n    record TestRecord(AbsoluteUrl url) {}\n  }\n}\n"
  }
]